@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,2 +0,0 @@
1
- (()=>{var e=document.currentScript;define("467dc675-7cc5-4709-8aac-78e3b71bd2f6_1.23.1",["@microsoft/sp-core-library","@microsoft/sp-diagnostics","@microsoft/sp-page-context","@microsoft/sp-http","@microsoft/sp-dynamic-data","@microsoft/sp-lodash-subset","tslib","@msinternal/sp-safehtml","@microsoft/load-themed-styles","@msinternal/sp-telemetry"],(t,n,a,i,r,o,s,c,d,l)=>(()=>{"use strict";var u={620(e,t,n){n.d(t,{T:()=>i,X:()=>r});var a=n(676);function i(){return a._SPFlight.isEnabled(60693)}function r(){return a._SPFlight.isEnabled(61389)}}
2
- ,424(e){e.exports=d},676(e){e.exports=t},207(e){e.exports=n},745(e){e.exports=r},909(e){e.exports=i},529(e){e.exports=o},408(e){e.exports=a},356(e){e.exports=c},519(e){e.exports=l},280(e){e.exports=s}},f={};function p(e){var t=f[e];if(void 0!==t)return t.exports;var n=f[e]={exports:{}};return u[e](n,n.exports,p),n.exports}p.m=u;var m,_,h,b={"216":"Tc2PKPdCtQzQ/mEWe3vUk+wG4axnSUsp7BXkSZd7//U=","386":"545UX94B5yaEn4vvm23UycJBry7WOc3/IoXP/Y/9/4o="};p.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return p.d(t,{a:t}),t},p.d=(e,t)=>{for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.f={},p.e=e=>Promise.all(Object.keys(p.f).reduce((t,n)=>(p.f[n](e,t),t),[])),p.u=e=>"chunk."+{216:"teams-apps-client",386:"legacy-third-party-fabric-core-localfont"}[e]+"_none_"+{216:"f9872389cb6ea9ad28e2",386:"9e84ea19c68fdc8b9094"}[e]+".js",p.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),m={},_="467dc675-7cc5-4709-8aac-78e3b71bd2f6_1.23.1:",p.l=(e,t,n,a)=>{if(m[e])m[e].push(t);else{var i,r;if(void 0!==n)for(var o=document.getElementsByTagName("script"),s=0;s<o.length;s++){var c=o[s];if(c.getAttribute("src")==e||c.getAttribute("data-webpack")==_+n){i=c;break}}if(!i){r=!0,(i=document.createElement("script")).charset="utf-8",p.nc&&i.setAttribute("nonce",p.nc),i.setAttribute("data-webpack",_+n),i.src=e,0!==i.src.indexOf(window.location.origin+"/")&&(i.crossOrigin="anonymous");var d=function(e){return"sha256-"+(b[e]||"Missing+Integrity+Hash+For+Script+Aborting=")}(a);d&&(i.integrity=d)}m[e]=[t];var l=(t,n)=>{i.onerror=i.onload=null,clearTimeout(u);var a=m[e];if(delete m[e],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach(e=>e(n)),t)return t(n)},u=setTimeout(l.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=l.bind(null,i.onerror),i.onload=l.bind(null,i.onload),r&&document.head.appendChild(i)}},p.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},h=e?e.src:"",p.p=h.slice(0,h.lastIndexOf("/")+1),(()=>{var e={826:0};p.f.j=(t,n)=>{var a=p.o(e,t)?e[t]:void 0;if(0!==a)if(a)n.push(a[2]);else{var i=new Promise((n,i)=>a=e[t]=[n,i]);n.push(a[2]=i);var r=p.p+p.u(t),o=new Error;p.l(r,n=>{if(p.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var i=n&&("load"===n.type?"missing":n.type),r=n&&n.target&&n.target.src;o.message="Loading chunk "+t+" failed.\n("+i+": "+r+")",o.name="ChunkLoadError",o.type=i,o.request=r,a[1](o)}},"chunk-"+t,t)}};var t=(t,n)=>{var a,i,[r,o,s]=n,c=0;if(r.some(t=>0!==e[t])){for(a in o)p.o(o,a)&&(p.m[a]=o[a]);s&&s(p)}for(t&&t(n);c<r.length;c++)i=r[c],p.o(e,i)&&e[i]&&e[i][0](),e[i]=0},n=self["webpackJsonp_467dc675-7cc5-4709-8aac-78e3b71bd2f6_1.23.1"]=self["webpackJsonp_467dc675-7cc5-4709-8aac-78e3b71bd2f6_1.23.1"]||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var g={};return(()=>{p.r(g),p.d(g,{BaseComponent:()=>n,BaseComponentContext:()=>m,DynamicDataProvider:()=>c,DynamicDataSourceManager:()=>u,DynamicProperty:()=>_,ThemeChangedEventArgs:()=>D,ThemeProvider:()=>I,_CacheMissReason:()=>E,_DeferredTeamsAppsClient:()=>k,_LegacyThirdPartyFabricCoreLoader:()=>h,_PropertyMetadataProcessor:()=>y,_ServerProcessedDataType:()=>S,_ShimmerFactory:()=>x,_WebPartLoadDataCollector:()=>L,_ensureIsolatedDomainUrl:()=>O});var e=p(676),t=function(){function e(){this._isWebPartAndContainsDynamicDataSource=!1,this._isDisposed=!1}return Object.defineProperty(e.prototype,"_dynamicDataSourceId",{get:function(){return"".concat(this.manifest.componentType,".").concat(this.manifest.id,".").concat(this.instanceId)},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._isDisposed||(this.onDispose(),this.context.dispose(),delete this.context,this._isDisposed=!0)},Object.defineProperty(e.prototype,"_containsDynamicDataSource",{get:function(){return this._isWebPartAndContainsDynamicDataSource},set:function(e){this._isWebPartAndContainsDynamicDataSource="WebPart"===this.manifest.componentType&&e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"manifest",{get:function(){return this.context.manifest},enumerable:!1,configurable:!0}),e.prototype.onDispose=function(){},Object.defineProperty(e.prototype,"instanceId",{get:function(){return this.context.instanceId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"componentId",{get:function(){return this.context.manifest.id},enumerable:!1,configurable:!0}),e.prototype._initializeContext=function(e){this.context=e,this.onProvideServices(e.serviceScope),e.serviceScope._isFinished||e.serviceScope.finish(),this.context._initializeDynamicData(this,e.serviceScope)},e.prototype.onProvideServices=function(e){},e}();const n=t;(0,e._ES5CompatibleClass)(t);var a=p(207),i=p(408),r=p(909),o=p(745),s=p(529);const c=function(){function t(){this._isDisposed=!1,this._isInitialized=!1,this._isSourcesChangedEventListenerAdded=!1}return t.prototype._initialize=function(t,n){e.Validate.isNotNullOrUndefined(t,"component"),e.Validate.isNotNullOrUndefined(n,"serviceScope"),this._component=t,this._pendingRegistrations=new Map,this._dynamicDataManager=n.consume(o._DynamicDataUtilities.IDynamicDataManagerServiceKey),this._isInitialized=!0,this._onSourcesChanged=this._onSourcesChanged.bind(this)},t.prototype.dispose=function(){this._isDisposed||(delete this._pendingRegistrations,this._dynamicDataManager.sourcesChangedEvent.remove(this._component,this._onSourcesChanged),delete this._dynamicDataManager,delete this._component,this._isInitialized=!1,this._isDisposed=!0)},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isProviderInitialized",{get:function(){return this._isInitialized},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_dynamicDataSourceId",{get:function(){return this._component._dynamicDataSourceId},enumerable:!1,configurable:!0}),t.prototype.registerSourceChanged=function(t,n){this._assertNotDisposed(),this._assertInitialized(),e.Validate.isNonemptyString(t,"sourceId"),e.Validate.isNotNullOrUndefined(n,"callback"),-1!==this.getAvailableSources().map(function(e){return e.id}).indexOf(t)?(this._dynamicDataManager.registerSourceChanged(t,this._component,n),this._logFeatureEntry("RegisterSourceChanged",{sourceId:t})):this._addPendingRegistration({id:t,callback:n})},t.prototype.unregisterSourceChanged=function(t,n){this._assertNotDisposed(),this._assertInitialized(),e.Validate.isNonemptyString(t,"sourceId"),e.Validate.isNotNullOrUndefined(n,"callback");var a={id:t,callback:n};this._isRegistrationPending(a)?this._removePendingRegistration(a):(this._dynamicDataManager.unregisterSourceChanged(t,this._component,n),this._logFeatureEntry("UnregisterSourceChanged",{sourceId:t}))},t.prototype.registerPropertyChanged=function(t,n,a){this._assertNotDisposed(),this._assertInitialized(),e.Validate.isNonemptyString(t,"sourceId"),e.Validate.isNonemptyString(n,"propertyId"),e.Validate.isNotNullOrUndefined(a,"callback"),-1!==this.getAvailableSources().map(function(e){return e.id}).indexOf(t)?(this._dynamicDataManager.registerPropertyChanged(t,n,this._component,a),this._logFeatureEntry("RegisterPropertyChanged",{sourceId:t,propertyId:n})):this._addPendingRegistration({id:t,propertyId:n,callback:a})},t.prototype.unregisterPropertyChanged=function(t,n,a){this._assertNotDisposed(),this._assertInitialized(),e.Validate.isNonemptyString(t,"sourceId"),e.Validate.isNonemptyString(n,"propertyId"),e.Validate.isNotNullOrUndefined(a,"callback");var i={id:t,callback:a,propertyId:n};this._isRegistrationPending(i)?this._removePendingRegistration(i):(this._dynamicDataManager.unregisterPropertyChanged(t,n,this._component,a),this._logFeatureEntry("UnregisterPropertyChanged",{sourceId:t,propertyId:n}))},t.prototype.registerAvailableSourcesChanged=function(t){e.Validate.isNotNullOrUndefined(t,"callback"),this._assertNotDisposed(),this._assertInitialized(),this._dynamicDataManager.sourcesChangedEvent.add(this._component,t)},t.prototype.unregisterAvailableSourcesChanged=function(t){e.Validate.isNotNullOrUndefined(t,"callback"),this._assertNotDisposed(),this._assertInitialized(),this._dynamicDataManager.sourcesChangedEvent.remove(this._component,t)},t.prototype.getAvailableSources=function(){return this._assertNotDisposed(),this._assertInitialized(),this._dynamicDataManager.getSources()},t.prototype.getAvailableSourcesByComponentId=function(t){this._assertNotDisposed(),this._assertInitialized();var n=[];return this._dynamicDataManager.getSources().forEach(function(a){t.equals(e.Guid.tryParse(a.metadata.componentId)||e.Guid.empty)&&n.push(a)}),n},t.prototype.tryGetSource=function(t){return this._assertNotDisposed(),this._assertInitialized(),e.Validate.isNotNullOrUndefined(t,"id"),this._dynamicDataManager.tryGetSource(t)},t.prototype._getData=function(n){this._assertNotDisposed(),this._assertInitialized(),e.Validate.isNotNullOrUndefined(n,"dataReference");var a=this._dynamicDataManager.tryGetSource(n.sourceId);if(a){var i=a.getPropertyValue(n.property);return i&&n.propertyPath&&n.propertyPath.split(".").forEach(function(e){var n=e.split(t._jsonPathArrayRegex),a=n[0];if(i)if(Array.isArray(i)){var r=[];i.forEach(function(e){e.hasOwnProperty(a)&&r.push(e[a])});var o=n[1];if(n.length>1){var s=[];r.forEach(function(e){e.forEach(function(e){return s.push(e)})}),r=s}i=isNaN(parseInt(o,10))?r:r[o]}else i=i.hasOwnProperty(a)?i[a]:void 0}),i}},t.prototype._onSourcesChanged=function(){var e=this,t=this.getAvailableSources().map(function(e){return e.id});this._pendingRegistrations.forEach(function(n){-1!==t.indexOf(n.id)&&(n.propertyId?(e._dynamicDataManager.registerPropertyChanged(n.id,n.propertyId,e._component,n.callback),e._logFeatureEntry("RegisterPropertyChanged",{sourceId:n.id,propertyId:n.propertyId})):(e._dynamicDataManager.registerSourceChanged(n.id,e._component,n.callback),e._logFeatureEntry("RegisterSourceChanged",{sourceId:n.id})),e._removePendingRegistration(n))})},t.prototype._assertNotDisposed=function(){if(this.isDisposed)throw new Error("Dynamic Data Provider has been disposed")},t.prototype._assertInitialized=function(){if(!this._isInitialized)throw new Error("Dynamic Data Provider has not been initialized.")},t.prototype._addPendingRegistration=function(e){this._isRegistrationPending(e)||this._pendingRegistrations.set(e.id+(e.propertyId||""),{id:e.id,propertyId:e.propertyId,callback:e.callback}),this._isSourcesChangedEventListenerAdded||(this._dynamicDataManager.sourcesChangedEvent.add(this._component,this._onSourcesChanged),this._isSourcesChangedEventListenerAdded=!0)},t.prototype._removePendingRegistration=function(e){this._pendingRegistrations.delete(e.id+(e.propertyId||"")),0===this._pendingRegistrations.size&&(this._dynamicDataManager.sourcesChangedEvent.remove(this._component,this._onSourcesChanged),this._isSourcesChangedEventListenerAdded=!1)},t.prototype._isRegistrationPending=function(e){return this._pendingRegistrations.has(e.id+(e.propertyId||""))},t.prototype._logFeatureEntry=function(e,t){var n=this._component.manifest.isInternal||!1,i={alias:this._component.manifest.alias,isInternal:n.toString()},r=new a._LogEntry("DynamicDataProvider",e,a._LogType.Event,s.merge(i,t));a._EngagementLogger.logEventWithLogEntry(r)},t._jsonPathArrayRegex=new RegExp(/\[|\]/),t}();var d=p(280);const l=JSON.parse('{"lw":"Śōũŕćē ĥàś àĺŕēàďŷ ƀēēń ĩńĩţĩàĺĩźēď.","Yt":"\\u0022śēńďĒvēńţ()\\u0022 mũśţ ƀē ďēƒĩńēď, ŵĥēń ţĥē \\u0022àĺĺōŵēďĒvēńţś()\\u0022 ŕēţũŕńś à ńōń-ēmƥţŷ vàĺũē.","C3":"Ďŷńàmĩć Ďàţà Śōũŕćē Màńàĝēŕ ĥàś ƀēēń ďĩśƥōśēď.","ad":"Ďŷńàmĩć Ďàţà Śōũŕćē Màńàĝēŕ ĥàś ńōţ ƀēēń ĩńĩţĩàĺĩźēď.","fT":"Ďŷńàmĩć Ďàţà Śōũŕćē ĥàś ńōţ ƀēēń ĩńĩţĩàĺĩźēď.","Qm":"\\u0022{0}\\u0022 ēvēńţ ĩś ńōţ àĺĺōŵēď ōń ţĥē śōũŕćē \\u0022{1}\\u0022"}'),u=function(){function t(){this._src=void 0,this._isDisposed=!1,this._isInitialized=!1,this._logSource=a._LogSource.create("DynamicDataSourceManager")}return t.prototype._initialize=function(t,n){e.Validate.isNotNullOrUndefined(t,"component"),e.Validate.isNotNullOrUndefined(n,"serviceScope"),this._component=t,this._dynamicDataManager=n.consume(o._DynamicDataUtilities.IDynamicDataManagerServiceKey),this._isInitialized=!0},t.prototype.dispose=function(){this._isDisposed||(this._src&&(this._dynamicDataManager.removeSource(this._src.id),delete this._src),delete this._dynamicDataManager,delete this._component,this._isInitialized=!1,this._isDisposed=!0)},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_source",{get:function(){return this._src},enumerable:!1,configurable:!0}),t.prototype.initializeSource=function(t){if(this._assertNotDisposed(),this._assertInitialized(),this._src)throw new Error(l.lw);this._callableFunctions=t,this._src=this._buildSource(this._component),this._dynamicDataManager.addSource(this._src),e._SPKillSwitch.isActivated("bbd78e03-ff18-40ed-9a94-973fc659366c")||(this._component._containsDynamicDataSource=!0),this._logFeatureEntry("DynamicDataSourceInitialized",{sourceId:this._src.id})},t.prototype.notifySourceChanged=function(){this._assertNotDisposed(),this._assertInitialized(),this._assertSourceExists(),this._dynamicDataManager.notifySourceChanged(this._src.id)},t.prototype.notifyPropertyChanged=function(t){e.Validate.isNonemptyString(t,"propertyId"),this._assertNotDisposed(),this._assertInitialized(),this._assertSourceExists(),this._dynamicDataManager.notifyPropertyChanged(this._src.id,t)},t.prototype.updateMetadata=function(t){this._assertNotDisposed(),this._assertInitialized(),this._assertSourceExists(),e.Validate.isNotNullOrUndefined(t,"metadata"),t.alias=void 0,t.componentId=void 0,t.instanceId=void 0,(0,s.merge)(this._src.metadata,t)},Object.defineProperty(t.prototype,"sourceId",{get:function(){return this._src?this._src.id:""},enumerable:!1,configurable:!0}),t.prototype._buildSource=function(e){if(this._callableFunctions.allowedEvents&&this._callableFunctions.allowedEvents.length>0&&!this._callableFunctions.sendEvent)throw new Error(l.Yt);return{id:this._component._dynamicDataSourceId,metadata:this._buildMetadata(e),getPropertyDefinitions:this._getPropertyDefinitions.bind(this),getPropertyValue:this._getPropertyValue.bind(this),getAnnotatedPropertyValue:this._getAnnotatedPropertyValue.bind(this),getPropertyDefinitionsAsync:this._getPropertyDefinitionsAsync.bind(this),getPropertyValueAsync:this._getPropertyValueAsync.bind(this),getAnnotatedPropertyValueAsync:this._getAnnotatedPropertyValueAsync.bind(this),allowedEventsAsync:this._allowedEventsAsync.bind(this),sendEvent:this._sendEvent.bind(this)}},t.prototype._allowedEvents=function(){return this._callableFunctions.allowedEvents?(0,s.cloneDeep)(this._callableFunctions.allowedEvents()):void 0},t.prototype._sendEvent=function(e,t){this._assertValidEvent(e),this._callableFunctions.sendEvent(e,t)},t.prototype._getPropertyDefinitions=function(){return(0,s.cloneDeep)(this._callableFunctions.getPropertyDefinitions())},t.prototype._getPropertyValue=function(t){e.Validate.isNotNullOrUndefined(t,"propertyId");var n=new a._QosMonitor("DynamicDataSourceManager._getPropertyValue"),i=t.split(c._jsonPathArrayRegex);try{var r=this._callableFunctions.getPropertyValue(i.shift());if(i.length>0&&!isNaN(parseInt(i[0],10))&&Array.isArray(r)&&(r=r[i[0]]),void 0===r&&0===this._callableFunctions.getPropertyDefinitions().filter(function(e){return e.id===t}).length&&this._src)throw new Error('Property "'.concat(t,'" doesn\'t exist in source "').concat(this._src.metadata.title,'"'));return n.writeSuccess((0,d.__assign)((0,d.__assign)({},this._src&&this._src.metadata||{}),{sourceId:this._src&&this._src.id,propertyId:t})),(0,s.cloneDeep)(r)}catch(e){return n.writeUnexpectedFailure("NoPropertyId",e,{propertyId:t}),void a._TraceLogger.logErrorData({source:this._logSource,error:e})}},t.prototype._getPropertyDefinitionsAsync=function(){return Promise.resolve(this._getPropertyDefinitions())},t.prototype._getPropertyValueAsync=function(e){return Promise.resolve(this._getPropertyValue(e))},t.prototype._allowedEventsAsync=function(){return Promise.resolve(this._allowedEvents())},t.prototype._getAnnotatedPropertyValue=function(t){e.Validate.isNotNullOrUndefined(t,"propertyId");var n,i=new a._QosMonitor("DynamicDataSourceManager._getAnnotatedPropertyValue");if(this._callableFunctions.getAnnotatedPropertyValue){var r=t.split(c._jsonPathArrayRegex);try{n=this._callableFunctions.getAnnotatedPropertyValue(r.shift()),r.length>0&&!isNaN(parseInt(r[0],10))&&Array.isArray(n)&&(n=n[r[0]]),i.writeSuccess((0,d.__assign)((0,d.__assign)({},this._src&&this._src.metadata||{}),{sourceId:this._src&&this._src.id,annotatedPropertyValue:n,propertyId:t}))}catch(e){i.writeExpectedFailure("NoAnnotatedPropertyValue",e,{annotatedPropertyValue:n}),a._TraceLogger.logErrorData({source:this._logSource,error:e}),n=void 0}}return n||(n={sampleValue:this._getPropertyValue(t),metadata:void 0}),n},t.prototype._getAnnotatedPropertyValueAsync=function(e){return Promise.resolve(this._getAnnotatedPropertyValue(e))},t.prototype._buildMetadata=function(e){var t={title:e.manifest.alias,alias:e.manifest.alias,componentId:e.componentId,instanceId:e.instanceId},n=e;return n.title&&(t.title=n.title),n.description&&(t.description=n.description),t},t.prototype._assertValidEvent=function(t){if(!this._allowedEvents()||-1===(0,s.findIndex)(this._allowedEvents(),{name:t}))throw new Error(e.Text.format(l.Qm,t,this._src.metadata.title))},t.prototype._assertNotDisposed=function(){if(this.isDisposed)throw new Error(l.C3)},t.prototype._assertInitialized=function(){if(!this._isInitialized)throw new Error(l.ad)},t.prototype._assertSourceExists=function(){if(!this._src)throw new Error(l.fT)},t.prototype._logFeatureEntry=function(e,t){var n=this._component.manifest.isInternal||!1,i={alias:this._component.manifest.alias,isInternal:n.toString()},r=new a._LogEntry("DynamicDataSourceManager",e,a._LogType.Event,s.merge(i,t));a._EngagementLogger.logEventWithLogEntry(r)},t}();var f=function(){function t(t){var n=this;this._isDisposed=!1,this._isServedFromLocalhost=!1,e.Validate.isNotNullOrUndefined(t,"parameters"),e.Validate.isNotNullOrUndefined(t.manifest,"manifest"),this.manifest=t.manifest;var o=this.manifest.loaderConfig;o&&o.internalModuleBaseUrls&&o.internalModuleBaseUrls.length&&(this._isServedFromLocalhost=/^http(s)?\:\/\/(localhost|127.0.0.1)/gim.test(o.internalModuleBaseUrls[0])),e.Validate.isNotNullOrUndefined(t.parentServiceScope,"parentServiceScope"),this._serviceScope=t.parentServiceScope.startNewChild(),e.Validate.isNotNullOrUndefined(t.loggingTag,"loggingTag"),this.serviceScope.provide(a._logSourceServiceKey,a._LogSource.create(t.loggingTag)),e.Validate.isNonemptyString(t.instanceId,"instanceId"),this._instanceId=t.instanceId,this._httpClient=this.serviceScope.createDefaultAndProvide(r.HttpClient.serviceKey),this._spHttpClient=this.serviceScope.createDefaultAndProvide(r.SPHttpClient.serviceKey),this._msGraphClientFactory=this.serviceScope.createDefaultAndProvide(r.MSGraphClientFactory.serviceKey),this._aadClientFactory=this.serviceScope.createDefaultAndProvide(r.AadHttpClientFactory.serviceKey),this._aadTokenFactory=this.serviceScope.createDefaultAndProvide(r.AadTokenProviderFactory.serviceKey),this.serviceScope.provide(e._ClientManifestData.serviceKey,new e._ClientManifestData(this.serviceScope,this.manifest)),this.serviceScope.whenFinished(function(){n._pageContext=n.serviceScope.consume(i.PageContext.serviceKey)}),this._dynamicDataProvider=new c,this._dynamicDataSourceManager=new u}return Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this._isDisposed||(this._dynamicDataProvider&&this._dynamicDataProvider.dispose(),this._dynamicDataSourceManager&&this._dynamicDataSourceManager.dispose(),delete this._serviceScope,delete this._pageContext,delete this._dynamicDataProvider,delete this._dynamicDataSourceManager,this._isDisposed=!0)},Object.defineProperty(t.prototype,"serviceScope",{get:function(){return this._serviceScope},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instanceId",{get:function(){return this._instanceId},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageContext",{get:function(){return this._pageContext},enumerable:!1,configurable:!0}),t.prototype._initializeDynamicData=function(e,t){this._dynamicDataProvider._initialize(e,t),this._dynamicDataSourceManager._initialize(e,t)},Object.defineProperty(t.prototype,"dynamicDataProvider",{get:function(){return this._dynamicDataProvider},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dynamicDataSourceManager",{get:function(){return this._dynamicDataSourceManager},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"aadHttpClientFactory",{get:function(){return this._aadClientFactory},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"aadTokenProviderFactory",{get:function(){return this._aadTokenFactory},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"msGraphClientFactory",{get:function(){return this._msGraphClientFactory},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"httpClient",{get:function(){return this._httpClient},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"spHttpClient",{get:function(){return this._spHttpClient},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isServedFromLocalhost",{get:function(){return this._isServedFromLocalhost},enumerable:!1,configurable:!0}),t}();(0,e._ES5CompatibleClass)(f);const m=f,_=function(){function t(n,a){this._hasValue=!1,this._isDisposed=!1,e.Validate.isNotNullOrUndefined(n,"provider"),this.__type=t._TYPE_NAME,this._provider=n,this._callbacks=new Set,this._pendingCallbacks=new Set,a?(this._pendingCallbacks.add(a),this._defaultCallback=a):this._defaultCallback=void 0,this._onSourcesChanged=this._onSourcesChangedCallback.bind(this),this._cloneDeep=this._cloneDeep.bind(this),this._provider.registerAvailableSourcesChanged(this._onSourcesChanged)}return t.prototype.setReference=function(t){var n=this;e.Validate.isNonemptyString(t,"id"),this._value=void 0,this._hasValue=!1;var a=new Set;this._callbacks.forEach(function(e){return a.add(e)}),this._callbacks.forEach(function(e){return n.unregister(e)}),this._reference=new o.DynamicDataReference(t),this._sourceId=this._getSourceId(),a.forEach(function(e){return n.register(e)}),this._onSourcesChangedCallback()},t.prototype.setValue=function(e){var t=this,n=this._callbacks;n.forEach(function(e){return t.unregister(e)}),this._value=e,this._reference=void 0,this._sourceId=void 0,this._hasValue=!0,n.forEach(function(e){return t.register(e)})},Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){var e=this;this._isDisposed||(this._provider.unregisterAvailableSourcesChanged(this._onSourcesChanged),this._defaultCallback&&(this.unregister(this._defaultCallback),delete this._defaultCallback),this._callbacks.forEach(function(t){return e.unregister(t)}),delete this._callbacks,delete this._onSourcesChanged,delete this._pendingCallbacks,delete this._provider,delete this._reference,delete this._sourceId,this._isDisposed=!0)},t.prototype.toJSON=function(){return this._hasValue?{__type:t._TYPE_NAME,value:this._value}:{__type:t._TYPE_NAME,reference:this._reference}},Object.defineProperty(t.prototype,"reference",{get:function(){return this._hasValue?void 0:this._reference.reference},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this._value},enumerable:!1,configurable:!0}),t.prototype.tryGetValue=function(){if(!this.isDisposed||e._SPKillSwitch.isActivated("413769dc-5e0c-4609-9c86-bdf099fe84e3")){e.Validate.isNotDisposed(this,"DynamicData");var t=this._getData();return Array.isArray(t)&&(t=t[0]),t}},t.prototype.tryGetValues=function(){var e=this._getData();return e?Array.isArray(e)||(e=[e]):e=[],e},t.prototype.tryGetSource=function(){if(!this.isDisposed||e._SPKillSwitch.isActivated("413769dc-5e0c-4609-9c86-bdf099fe84e3"))return e.Validate.isNotDisposed(this,"DynamicData"),this._hasValue?void 0:this._provider.tryGetSource(this._sourceId)},t.prototype.register=function(t){e.Validate.isNotDisposed(this,"DynamicData"),!this._hasValue&&this._sourceId&&this._provider.tryGetSource(this._sourceId)?(this._provider.registerPropertyChanged(this._sourceId,this._getPropertyToRegister(),t),this._callbacks.add(t)):this._pendingCallbacks.add(t)},t.prototype.unregister=function(t){e.Validate.isNotDisposed(this,"DynamicData"),!this._hasValue&&this._sourceId&&this._provider.tryGetSource(this._sourceId)&&this._provider.unregisterPropertyChanged(this._sourceId,this._getPropertyToRegister(),t),this._pendingCallbacks.delete(t),this._callbacks.delete(t)},t.prototype.hasDefaultCallback=function(){return!!this._defaultCallback},t.prototype.removeDefaultCallback=function(){this._defaultCallback&&(this.unregister(this._defaultCallback),this._defaultCallback=void 0)},t.prototype._getSourceId=function(){return e.Validate.isNotDisposed(this,"DynamicData"),this._hasValue?"":this._reference.sourceId},t.prototype._getProperty=function(){return e.Validate.isNotDisposed(this,"DynamicData"),this._hasValue?"":this._reference.property},t.prototype._getPropertyPath=function(){return e.Validate.isNotDisposed(this,"DynamicData"),this._hasValue?"":this._reference.propertyPath||""},t.prototype._cloneDeep=function(e){return s.cloneDeepWith(e,function(e){if(e instanceof c)return e})},t.prototype._getPropertyToRegister=function(){return e.Validate.isNotDisposed(this,"DynamicData"),this._getProperty().split(t._arrayRegex)[0]},t.prototype._onSourcesChangedCallback=function(){var e=this;if(!this._hasValue&&this._sourceId&&this._provider.tryGetSource(this._sourceId)){var t=this._pendingCallbacks;this._pendingCallbacks=new Set,t.forEach(function(t){e.register(t),t()})}},t.prototype._getData=function(){if(!this.isDisposed||e._SPKillSwitch.isActivated("413769dc-5e0c-4609-9c86-bdf099fe84e3")){var t;e.Validate.isNotDisposed(this,"DynamicData");try{t=this._hasValue?this._value:this._provider._getData(this._reference)}catch(e){throw a._EngagementLogger.logEventWithLogEntry(e),e}return a._EngagementLogger.logEventWithLogEntry(new a._LogEntry("DynamicData","getData",a._LogType.Event,{value:JSON.stringify(this.value)})),t}},t._TYPE_NAME="DynamicProperty",t._arrayRegex=new RegExp(/\[\*\]$/),t}(),h=function(){function t(){}return t.load=function(e){return e||t._isLoaded?Promise.resolve():p.e(386).then(p.bind(p,521)).then(function(){t._isLoaded=!0})},t.forceLoad=function(e){try{return t._shouldLoad(e)?p.e(386).then(p.bind(p,521)).then(function(){t._isLoaded=!0}):Promise.resolve()}catch(e){return Promise.reject(e)}},t.needLegacyFabricCss=function(t){if(t.isInternal)return!1;if(void 0===t.loadLegacyFabricCss){var n=e.Version._tryParseSPFxVersion(t);return!n||n.lessThan(e.Version.parse("1.8.2"))}return t.loadLegacyFabricCss},t._shouldLoad=function(e){return!t._isLoaded&&t.needLegacyFabricCss(e)},t._isLoaded=!1,t}();var b=p(620),v=p(356),y=function(){function t(){}return t.serializeServerProcessedData=function(t,n,a){var i=this;this._forEachPropertyWithMetaData(t,n,function(t,r,o){r.shouldNotPersist&&s.set(n,t,void 0);var c=t,d=s.get(n,t);if(a&&"string"==typeof d&&d){if(a.htmlStrings&&r.isHtmlString?a.htmlStrings[c]=d:a.searchablePlainTexts&&r.isSearchablePlainText?a.searchablePlainTexts[c]=d:a.links&&r.isLink?a.links[c]=d:a.imageSources&&r.isImageSource?a.imageSources[c]=d:r.isComponentDependency&&(a.componentDependencies||(a.componentDependencies={}),a.componentDependencies[c]=d),r.customMetadata){var l={};if(r&&r.customMetadata)for(var u=function(t,c){var d=c;void 0!==o&&-1!==d.indexOf("*")&&(d=d.replace("*",o.toString())),i._validateAndIteratePath(d,n,function(i,o){if(void 0===o&&r.customMetadata){var c=s.get(n,i);a&&void 0!==c&&(e._SPKillSwitch.isActivated("bf085c27-422d-4b62-a93a-43efa89e77ee")?l[i]=c:l[t]=c)}})},f=0,p=Object.entries(r.customMetadata);f<p.length;f++){var m=p[f];u(m[0],m[1])}a.customMetadata||(a.customMetadata={}),a.customMetadata[c]=l}s.set(n,t,void 0)}})},t.reInstateServerProcessedData=function(t,n,i,r){var o=this,c=new Set;if(r&&this._forEachPropertyWithMetaData(t,n,function(t,i){if((0,b.X)()){if("b7dd04e1-19ce-4b24-9132-b60a1c2b910d"===r.id&&e._SPKillSwitch.isActivated("71b68bd4-eb7a-4330-93bd-dc6d382123c1"))return;var d=s.get(n,t);if(void 0!==d){var l=new a._QosMonitor("PropertyMetadataProcessor.clearMetadataValue");if(i.isLink&&(c.add(t),o._isSafeLink(d)||(l.writeUnexpectedFailure("ClearingLinkProperty",new Error(t)),s.set(n,t,void 0))),i.isHtmlString){c.add(t);var u=o._getSafeHtml(d);u!==d&&(l.writeUnexpectedFailure("SettingSafeHtml",new Error(t)),s.set(n,t,u))}l.hasEnded||l.writeSuccess()}}else"b7dd04e1-19ce-4b24-9132-b60a1c2b910d"!==r.id&&i.isHtmlString&&s.set(n,t,void 0)}),i)for(var d=0,l=[i.htmlStrings,i.searchablePlainTexts,i.imageSources,i.links,i.componentDependencies];d<l.length;d++){var u=l[d];if(u)for(var f=0,p=Object.entries(u);f<p.length;f++){var m=p[f],_=m[0],h=m[1];"string"==typeof h&&(s.set(n,_,h),(0,b.X)()&&c.delete(_))}}(0,b.X)()&&r&&c.size>0&&new a._QosMonitor("PropertyMetadataProcessor.serverProcessedContentMissing").writeUnexpectedFailure("Missing Content",void 0,{manifest:r.id,properties:Array.from(c).join(",")})},t._isSafeLink=function(e){try{var t=new URL(e);return v.SafeHtml.isSafeLinkProtocol(t.protocol)}catch(n){try{return t=new URL(e,window.location.origin),v.SafeHtml.isSafeLinkProtocol(t.protocol)}catch(e){return!1}}},t._getSafeHtml=function(e){return v.SafeHtml.clean(e)},t._forEachPropertyWithMetaData=function(e,t,n){if(e)for(var a=function(e,a){i._validateAndIteratePath(e,t,function(e,t){n(e,a,t)})},i=this,r=0,o=Object.entries(e);r<o.length;r++){var s=o[r];a(s[0],s[1])}},t._validateAndIteratePath=function(e,t,n){var a=(e.match(/\*/g)||[]).length;if(a>1)console.warn("Invalid property path: Multiple wildcards are not supported in property paths.\nEntry with path '".concat(e,"' got ignored in the properties metadata."));else if(1===a){var i=e.indexOf("[*]");if(i<-1)return void console.warn("Invalid property path: Wildcards are only supported inside brackets to select array\nindices as in 'foo[*].bar'. Entry with path '".concat(e,"' got ignored in the properties metadata."));var r=e.substr(0,i),o=s.get(t,r);if(!o)return void console.warn("Invalid property path: Could not find an array named '".concat(r,"' in the properties.\nEntry with path '").concat(e,"' got ignored in the properties metadata."));for(var c=0;c<o.length;c++)n(e.replace("*","".concat(c)),c)}else n(e)},t}(),S={htmlString:1,link:2,imageSource:3,searchablePlainText:4},D=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,d.__extends)(t,e),t}(e.SPEventArgs),I=function(){function t(n,a,i){this._id=t._instanceCount++,this.themeChangedEvent=new e.SPEvent(this._themeChangedEventName),a&&(this._theme=Object.freeze(a)),i&&(this._themeV2=Object.freeze(i))}return Object.defineProperty(t.prototype,"_themeChangedEventName",{get:function(){return t._themeChangedEventNameLiteral+this._id},enumerable:!1,configurable:!0}),t.prototype._clearTheme=function(){this._theme=void 0,this._themeV2=void 0,this._raiseEvent()},t.prototype._setTheme=function(t,n){e.Validate.isNotNullOrUndefined(t,"theme"),this._theme=Object.freeze(t),n&&(this._themeV2=Object.freeze(n)),this._raiseEvent()},t.prototype.tryGetTheme=function(){return this._theme},t.prototype.tryGetThemeV2=function(){return this._themeV2},t.prototype._raiseEvent=function(){e._SPEventManager.instance.raiseEvent(this._themeChangedEventName,{theme:this._theme,themeV2:this._themeV2})},t.serviceKey=e.ServiceKey.create("sp-component-base.ThemeProvider",t),t._themeChangedEventNameLiteral="ThemeProvider.themeChangedEvent",t._instanceCount=0,t}();p(424).loadStyles(".s_mwxHE_o5ljQ{background-color:transparent;height:100%;margin:5px;position:relative;width:100%}.s_bzcYC_o5ljQ{fill:#f4f4f4}",!0);const x=function(){function e(){}return e.createShimmer=function(t,n,a,i,r){void 0===r&&(r=void 0),t=t||100,n=n||100;var o=document.createElement("div");o.className="s_mwxHE_o5ljQ";var s=document.createElement("div"),c=.9*n/9,d=2*(c=Math.min(16,c)),l=c,u=l+d,f=u+d,p=f+d,m="s_bzcYC_o5ljQ";s.innerHTML="<svg width=".concat(t," height=").concat(n,' viewBox="0 0 ').concat(t," ").concat(n,'" version="1.1"\n xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>').concat(i,"</title>\n <g id=").concat(a,'_Shimmer stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <rect x="0" y="0" width=').concat(t," height=").concat(n,"></rect>\n ").concat(e._shimmerRect(a+"_1",m,8,l,20,c),"\n ").concat(e._shimmerRect(a+"_2",m,8,u,40,c),"\n ").concat(e._shimmerRect(a+"_3",m,8,f,90,c),"\n ").concat(e._shimmerRect(a+"_4",m,8,p,80,c),"\n </g>\n </svg>"),void 0!==r&&(o.style.margin=r+""),o.appendChild(s);var _=document.createElement("div");return _.setAttribute("role","status"),_.setAttribute("aria-live","polite"),o.appendChild(_),o},e._shimmerRect=function(e,t,n,a,i,r){return"<rect id=".concat(e," class=").concat(t," x=").concat(n," y=").concat(a,' width="').concat(i,'%" height=').concat(r,'>\n <animate\n attributeName="opacity"\n dur="1s"\n values="0.2;0.5;0.9"\n repeatCount="indefinite"\n begin="0"/>\n </rect>')},e}();var C=new RegExp("^https://[^/]*/");function O(e,t){if(!e)return t;var n=!1;return"/"!==t.charAt(t.length-1)&&(t+="/",n=!0),t=t.replace(C,"https://".concat(e,"/")),n&&(t=t.substr(0,t.length-1)),t}var w=p(519),E={CacheConfigMissmatch:"CacheConfigMissmatch",LateFlush:"LateFlush",CachedItemNotFound:"CachedItemNotFound",CacheExpired:"CacheExpired",NotSpecified:"NotSpecified",NotApplicable:"N/A"},A="N/A",L=function(){function t(){}return t.collect=function(n,a,i){var r=function(e){return w._PerformanceLogger.readComponentBreakdown(a,e)||w._PerformanceLogger.readTempData("".concat(a,".").concat(e))},o=r("start"),s=r("modulesLoaded"),c=r("init"),d=r("end"),l=!!r("displaySpinner"),u=Boolean(i&&i.legacyPageContext&&i.legacyPageContext.isMultiGeoTenant),f=A,p=A,m="N/A",_=E.NotApplicable;if(n.isInternal){var h=r("CacheHit"),b=r("CacheMiss"),g=r("prefetchedData");m=Boolean(h||b)?h?"true":"false":"N/A",_=t._getCacheMissReason(h,r);var v=w._PerformanceLogger.now(),y=w._PerformanceDataDimensions.Layout,S=w._PerformanceDataDimensions.DataProvider,D=w._PerformanceLogger.readFullEUPLBreakDown();Object.keys(D).forEach(function(e){e.indexOf(a)>-1&&(p===A&&e.indexOf(y)>-1?p=e.split(y)[1]:e.indexOf(S)>-1&&(f===A||D[e]<v)&&(f=e.split(S)[1],v=D[e]))}),f=g?"Prefetch":f}var I=w._PerformanceLogger.getWebpartFlightsAndExperiments(a),x=this._getSyncRenderTime(p,r),C={alias:n.alias,isMultiGeo:u,isInternal:n.isInternal,isSpinnyShown:l,manifestId:n.id,moduleLoadTime:Math.floor(s-o),initTime:Math.floor(c-s),renderTime:Math.floor(d-c),syncRenderTime:x,scenarioId:w._PerformanceLogger.getScenarioId(),isFullPage:w._PerformanceLogger.fullPageLoad,dataProvider:f,layout:p,mySiteCacheHit:m,cacheMissReason:_,flights:I,storeAppId:n.storeAppId,mpnId:n.mpnId,componentDeveloperName:n.componentDeveloperName};return C.teamsHosted=e._BrowserUtilities.isTeamsHosted(),C},t._getSyncRenderTime=function(e,t){var n=void 0;n=Math.floor(t("syncRender")-t("getDataComplete"));var a=t("postRenderComplete"),i=t("loadLayoutEnd"),r=t("syncLayoutRenderComplete");return i&&r&&(n=Math.floor(n+(r-i))),a&&(n=Math.floor(n+(a-t(w._PerformanceDataDimensions.Layout+e)))),n},t._getCacheMissReason=function(e,t){if(e)return E.NotApplicable;var n=!!t("CacheMissConfigMismatch"),a=!!t("LateFlush"),i=!!t("CachedWebPartNotFound"),r=!!t("CacheExpired"),o=E.NotSpecified;return n?o=E.CacheConfigMissmatch:a?o=E.LateFlush:i?o=E.CachedItemNotFound:r&&(o=E.CacheExpired),o},t}(),k=function(){function t(e){this._serviceScope=e}return t.prototype.getClient=function(){var e=this;if(this._teamsAppsClient)return Promise.resolve(this._teamsAppsClient);if(!this._teamsAppsClientPromise){var t=new a._QosMonitor("DeferredTeamsAppsClient.LoadTeamsAppClient");this._teamsAppsClientPromise=p.e(216).then(p.bind(p,165)).then(function(n){var a=n.TeamsAppsClient;return e._teamsAppsClient=new a(e._serviceScope),t.writeSuccess(),e._teamsAppsClient}).catch(function(e){throw t.writeUnexpectedFailure(void 0,e),e})}return this._teamsAppsClientPromise},t.serviceKey=e.ServiceKey.create("sp-teams-apps-client",t),t}()})(),g})())})();
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseComponent.d.ts","sourceRoot":"","sources":["../src/BaseComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAEpF,OAAO,KAAK,oBAAoB,MAAM,wBAAwB,CAAC;AAE/D;;;;GAIG;AACH,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,aAAc,YAAW,gBAAgB;IACrE;;;;;;;;;;;;;;;OAeG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAEzC;;;OAGG;IACH,SAAS,CAAC,sCAAsC,EAAE,OAAO,CAAS;IAElE,OAAO,CAAC,WAAW,CAAkB;IAErC;;;;OAIG;IACH,IAAW,oBAAoB,IAAI,MAAM,CAExC;IAED,gBAAgB;;IAKhB;;;;;;;;OAQG;IACI,OAAO,IAAI,IAAI;IAWtB;;;OAGG;IACH,IAAW,0BAA0B,IAAI,OAAO,CAE/C;IAED,IAAW,0BAA0B,CAAC,GAAG,EAAE,OAAO,EAEjD;IAED;;OAEG;IACH,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED;;;;;OAKG;IACH,IAAW,QAAQ,IAAI,4BAA4B,CAElD;IAED;;;;;OAKG;IACH,SAAS,CAAC,SAAS,IAAI,IAAI;IAI3B;;;;;;;;OAQG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED;;;;;;;OAOG;IACH,IAAW,WAAW,IAAI,MAAM,CAE/B;IAED;;OAEG;IACH,SAAS,CAAC,kBAAkB,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI;IAiBjE;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,iBAAiB,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;CAG9D"}
@@ -1,161 +0,0 @@
1
- import { _ES5CompatibleClass } from '@microsoft/sp-core-library';
2
- /**
3
- * The base class for client-side components such as BaseClientSideWebPart or BaseExtension.
4
- *
5
- * @public
6
- */
7
- var BaseComponent = /** @class */ (function () {
8
- /** @internal */
9
- function BaseComponent() {
10
- /**
11
- * Stores whether or not this component has a dynamic data source.
12
- * @internal
13
- */
14
- this._isWebPartAndContainsDynamicDataSource = false;
15
- this._isDisposed = false;
16
- // empty block
17
- }
18
- Object.defineProperty(BaseComponent.prototype, "_dynamicDataSourceId", {
19
- /**
20
- * Returns the dynamic data source id for the current instance of the component.
21
- *
22
- * @internal
23
- */
24
- get: function () {
25
- return "".concat(this.manifest.componentType, ".").concat(this.manifest.id, ".").concat(this.instanceId);
26
- },
27
- enumerable: false,
28
- configurable: true
29
- });
30
- /**
31
- * Disposes the component.
32
- *
33
- * @remarks
34
- * Third-party code generally does not need to call this method; it's invoked
35
- * automatically when the lifecycle ends for a web part or extension. To perform
36
- * custom cleanup when your component is disposed, override the {@link BaseComponent.onDispose}
37
- * method.
38
- */
39
- BaseComponent.prototype.dispose = function () {
40
- if (!this._isDisposed) {
41
- this.onDispose();
42
- this.context.dispose();
43
- delete this.context;
44
- this._isDisposed = true;
45
- }
46
- };
47
- Object.defineProperty(BaseComponent.prototype, "_containsDynamicDataSource", {
48
- /**
49
- * Returns whether or not this component contains a dynamic data source.
50
- * @internal
51
- */
52
- get: function () {
53
- return this._isWebPartAndContainsDynamicDataSource;
54
- },
55
- set: function (val) {
56
- this._isWebPartAndContainsDynamicDataSource = this.manifest.componentType === 'WebPart' ? val : false;
57
- },
58
- enumerable: false,
59
- configurable: true
60
- });
61
- Object.defineProperty(BaseComponent.prototype, "isDisposed", {
62
- /**
63
- * Returns true if the component has been already disposed.
64
- */
65
- get: function () {
66
- return this._isDisposed;
67
- },
68
- enumerable: false,
69
- configurable: true
70
- });
71
- Object.defineProperty(BaseComponent.prototype, "manifest", {
72
- /**
73
- * Provides access to the manifest for the client-side component.
74
- * virtual
75
- * @remarks
76
- * Child classes can override this with more specialized manifest types.
77
- */
78
- get: function () {
79
- return this.context.manifest;
80
- },
81
- enumerable: false,
82
- configurable: true
83
- });
84
- /**
85
- * This event method is called at the end of the component's lifecycle.
86
- * It provides an opportunity to release any associated resources, cancel any
87
- * outstanding requests, etc.
88
- * virtual
89
- */
90
- BaseComponent.prototype.onDispose = function () {
91
- // (empty block)
92
- };
93
- Object.defineProperty(BaseComponent.prototype, "instanceId", {
94
- /**
95
- * A unique identifier for the instance of the component.
96
- *
97
- * @remarks
98
- * A component implementation can be loaded multiple times on the page.
99
- * For example, if the component is a charting web part, multiple instances of this web part
100
- * could be added to the SharePoint canvas. The instanceId uniquely identifies each
101
- * of these instances.
102
- */
103
- get: function () {
104
- return this.context.instanceId;
105
- },
106
- enumerable: false,
107
- configurable: true
108
- });
109
- Object.defineProperty(BaseComponent.prototype, "componentId", {
110
- /**
111
- * Returns the component identifier as defined in the component's associated manifest.
112
- *
113
- * @remarks
114
- * Each client-side component has an associated manifest that is used by the sp-loader to load its scripts,
115
- * and which may include additional metadata about the component. The manifest is uniquely identified using
116
- * a text string containing a lower case GUID value.
117
- */
118
- get: function () {
119
- return this.context.manifest.id;
120
- },
121
- enumerable: false,
122
- configurable: true
123
- });
124
- /**
125
- * @internal
126
- */
127
- BaseComponent.prototype._initializeContext = function (context) {
128
- this.context = context;
129
- this.onProvideServices(context.serviceScope);
130
- /*
131
- * Calling finish on an already finished servicescope will throw.
132
- * Hence, checking it before finishing the servicescope.
133
- *
134
- * In the case of ApplicationCustomizers, it's context is calling 'finish'
135
- * on the service scope. Hence, it is required to have the below check.
136
- */
137
- if (!context.serviceScope._isFinished) {
138
- context.serviceScope.finish();
139
- }
140
- this.context._initializeDynamicData(this, context.serviceScope);
141
- };
142
- /**
143
- * This event method allows a component to add custom services to its
144
- * {@link @microsoft/sp-core-library#ServiceScope}.
145
- *
146
- * @remarks
147
- * This event method is fired before {@link @microsoft/sp-core-library#ServiceScope | ServiceScope.finish()}
148
- * is called, allowing the component to provide custom services.
149
- *
150
- * virtual
151
- *
152
- * @alpha
153
- */
154
- BaseComponent.prototype.onProvideServices = function (serviceScope) {
155
- // empty block
156
- };
157
- return BaseComponent;
158
- }());
159
- export default BaseComponent;
160
- _ES5CompatibleClass(BaseComponent);
161
- //# sourceMappingURL=BaseComponent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BaseComponentContext.d.ts","sourceRoot":"","sources":["../src/BaseComponentContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,YAAY,EAEjB,KAAK,WAAW,EAGjB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EACL,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,mBAAmB,MAAM,uBAAuB,CAAC;AACxD,OAAO,wBAAwB,MAAM,4BAA4B,CAAC;AAElE;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;;OAGG;IACH,QAAQ,CAAC,kBAAkB,EAAE,YAAY,CAAC;IAE1C;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,4BAA4B,CAAC;IAEhD;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,uBAAe,oBAAqB,YAAW,WAAW;IACxD;;OAEG;IACH,SAAgB,QAAQ,EAAE,4BAA4B,CAAC;IAEvD,OAAO,CAAC,aAAa,CAA2B;IAChD,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,YAAY,CAA0B;IAC9C,OAAO,CAAC,oBAAoB,CAAkC;IAC9D,OAAO,CAAC,yBAAyB,CAAuC;IACxE,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,aAAa,CAAe;IACpC,OAAO,CAAC,iBAAiB,CAAuB;IAChD,OAAO,CAAC,gBAAgB,CAA0B;IAClD,OAAO,CAAC,qBAAqB,CAAuB;IACpD,OAAO,CAAC,sBAAsB,CAAkB;IAEhD,gBAAgB;gBACG,UAAU,EAAE,2BAA2B;IA0C1D;;OAEG;IACH,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED;;OAEG;IACI,OAAO,IAAI,IAAI;IAkBtB;;;;OAIG;IACH,IAAW,YAAY,IAAI,YAAY,CAEtC;IAED;;OAEG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;IAED;;;;OAIG;IACH,IAAW,WAAW,IAAI,WAAW,CAEpC;IAED;;;;;;OAMG;IACI,sBAAsB,CAAC,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI;IAKzF;;OAEG;IACH,IAAW,mBAAmB,IAAI,mBAAmB,CAEpD;IAED;;OAEG;IACH,IAAW,wBAAwB,IAAI,wBAAwB,CAE9D;IAED;;OAEG;IACH,IAAW,oBAAoB,IAAI,oBAAoB,CAEtD;IAED;;OAEG;IACH,IAAW,uBAAuB,IAAI,uBAAuB,CAE5D;IAED;;OAEG;IACH,IAAW,oBAAoB,IAAI,oBAAoB,CAEtD;IAED;;OAEG;IACH,IAAW,UAAU,IAAI,UAAU,CAElC;IAED;;OAEG;IACH,IAAW,YAAY,IAAI,YAAY,CAEtC;IAED;;OAEG;IACH,IAAW,qBAAqB,IAAI,OAAO,CAE1C;CACF;AAID,eAAe,oBAAoB,CAAC"}
@@ -1,222 +0,0 @@
1
- import { Validate, _ClientManifestData, _ES5CompatibleClass } from '@microsoft/sp-core-library';
2
- import { _LogSource, _logSourceServiceKey } from '@microsoft/sp-diagnostics';
3
- import { PageContext } from '@microsoft/sp-page-context';
4
- import { HttpClient, SPHttpClient, AadHttpClientFactory, AadTokenProviderFactory, MSGraphClientFactory } from '@microsoft/sp-http';
5
- import DynamicDataProvider from './DynamicDataProvider';
6
- import DynamicDataSourceManager from './DynamicDataSourceManager';
7
- /**
8
- * The base class for context objects for client-side components.
9
- *
10
- * @remarks
11
- * A "context" object is a collection of well-known services and other
12
- * objects that are likely to be needed by business logic that interacts with a
13
- * associated component. Each component type has its own specialized subclass
14
- * of BaseComponentContext, e.g. WebPartContext for web parts, ExtensionContext for
15
- * client-side extensions, and so on.
16
- *
17
- * @privateRemarks
18
- *
19
- * NOTE: The context object is a convenience that avoids the overhead of
20
- * properly factoring the dependencies for every class in a project.
21
- * If lots of members are added to the context without discipline, it can
22
- * easily devolve into a poor engineering practice (where "everything depends
23
- * on everything else"). Think carefully before adding more objects to the context object.
24
- * Is it really a core scenario? Is it unnecessarily coupling your package to another
25
- * package? Is there a better place to put the object?
26
- *
27
- * Only add data properties or well-defined classes with ubiquitous applicability.
28
- * Never add loose functions, callbacks, or settable properties to the context.
29
- *
30
- * @public
31
- */
32
- var BaseComponentContext = /** @class */ (function () {
33
- /** @internal */
34
- function BaseComponentContext(parameters) {
35
- var _this = this;
36
- this._isDisposed = false;
37
- this._isServedFromLocalhost = false;
38
- Validate.isNotNullOrUndefined(parameters, 'parameters');
39
- Validate.isNotNullOrUndefined(parameters.manifest, 'manifest');
40
- this.manifest = parameters.manifest;
41
- var loaderConfig = this.manifest.loaderConfig;
42
- if (loaderConfig && loaderConfig.internalModuleBaseUrls && loaderConfig.internalModuleBaseUrls.length) {
43
- this._isServedFromLocalhost = /^http(s)?\:\/\/(localhost|127.0.0.1)/gim.test(loaderConfig.internalModuleBaseUrls[0]);
44
- }
45
- Validate.isNotNullOrUndefined(parameters.parentServiceScope, 'parentServiceScope');
46
- this._serviceScope = parameters.parentServiceScope.startNewChild();
47
- // TODO: VSO:507790 Reconcile this with ClientSideWebPartManager._createWebPartTag()
48
- Validate.isNotNullOrUndefined(parameters.loggingTag, 'loggingTag');
49
- this.serviceScope.provide(_logSourceServiceKey, _LogSource.create(parameters.loggingTag));
50
- Validate.isNonemptyString(parameters.instanceId, 'instanceId');
51
- this._instanceId = parameters.instanceId;
52
- this._httpClient = this.serviceScope.createDefaultAndProvide(HttpClient.serviceKey);
53
- this._spHttpClient = this.serviceScope.createDefaultAndProvide(SPHttpClient.serviceKey);
54
- this._msGraphClientFactory = this.serviceScope.createDefaultAndProvide(MSGraphClientFactory.serviceKey);
55
- this._aadClientFactory = this.serviceScope.createDefaultAndProvide(AadHttpClientFactory.serviceKey);
56
- this._aadTokenFactory = this.serviceScope.createDefaultAndProvide(AadTokenProviderFactory.serviceKey);
57
- this.serviceScope.provide(_ClientManifestData.serviceKey, new _ClientManifestData(this.serviceScope, this.manifest));
58
- // Consume services
59
- this.serviceScope.whenFinished(function () {
60
- _this._pageContext = _this.serviceScope.consume(PageContext.serviceKey);
61
- });
62
- this._dynamicDataProvider = new DynamicDataProvider();
63
- this._dynamicDataSourceManager = new DynamicDataSourceManager();
64
- }
65
- Object.defineProperty(BaseComponentContext.prototype, "isDisposed", {
66
- /**
67
- * Returns true if the context is disposed.
68
- */
69
- get: function () {
70
- return this._isDisposed;
71
- },
72
- enumerable: false,
73
- configurable: true
74
- });
75
- /**
76
- * Disposes the base component context.
77
- */
78
- BaseComponentContext.prototype.dispose = function () {
79
- if (!this._isDisposed) {
80
- if (this._dynamicDataProvider) {
81
- this._dynamicDataProvider.dispose();
82
- }
83
- if (this._dynamicDataSourceManager) {
84
- this._dynamicDataSourceManager.dispose();
85
- }
86
- delete this._serviceScope;
87
- delete this._pageContext;
88
- delete this._dynamicDataProvider;
89
- delete this._dynamicDataSourceManager;
90
- this._isDisposed = true;
91
- }
92
- };
93
- Object.defineProperty(BaseComponentContext.prototype, "serviceScope", {
94
- /**
95
- * The associated {@link @microsoft/sp-core-library#ServiceScope} for this component.
96
- * @remarks
97
- * A child service scope is created for each client-side component.
98
- */
99
- get: function () {
100
- return this._serviceScope;
101
- },
102
- enumerable: false,
103
- configurable: true
104
- });
105
- Object.defineProperty(BaseComponentContext.prototype, "instanceId", {
106
- /**
107
- * {@inheritDoc BaseComponent.instanceId}
108
- */
109
- get: function () {
110
- return this._instanceId;
111
- },
112
- enumerable: false,
113
- configurable: true
114
- });
115
- Object.defineProperty(BaseComponentContext.prototype, "pageContext", {
116
- /**
117
- * The page context provides standard definitions for common SharePoint objects
118
- * that need to be shared between the client-side application, web parts, and other
119
- * components.
120
- */
121
- get: function () {
122
- return this._pageContext;
123
- },
124
- enumerable: false,
125
- configurable: true
126
- });
127
- /**
128
- * Creates a Dynamic Data Provider for the component.
129
- *
130
- * @param component - Component tied to the Dynamic Data Provider
131
- * @param serviceScope - ServiceScope to consume the Dynamic Data Manager from. Must be finished.
132
- * @internal
133
- */
134
- BaseComponentContext.prototype._initializeDynamicData = function (component, serviceScope) {
135
- this._dynamicDataProvider._initialize(component, serviceScope);
136
- this._dynamicDataSourceManager._initialize(component, serviceScope);
137
- };
138
- Object.defineProperty(BaseComponentContext.prototype, "dynamicDataProvider", {
139
- /**
140
- * Returns the Dynamic Data Provider associated with the component.
141
- */
142
- get: function () {
143
- return this._dynamicDataProvider;
144
- },
145
- enumerable: false,
146
- configurable: true
147
- });
148
- Object.defineProperty(BaseComponentContext.prototype, "dynamicDataSourceManager", {
149
- /**
150
- * Returns the Dynamic Data Source Manager associated with the component.
151
- */
152
- get: function () {
153
- return this._dynamicDataSourceManager;
154
- },
155
- enumerable: false,
156
- configurable: true
157
- });
158
- Object.defineProperty(BaseComponentContext.prototype, "aadHttpClientFactory", {
159
- /**
160
- * The instance of AadHttpClientFactory created for this instance of component
161
- */
162
- get: function () {
163
- return this._aadClientFactory;
164
- },
165
- enumerable: false,
166
- configurable: true
167
- });
168
- Object.defineProperty(BaseComponentContext.prototype, "aadTokenProviderFactory", {
169
- /**
170
- * The instance of AadTokenProviderFactory created for this instance of component
171
- */
172
- get: function () {
173
- return this._aadTokenFactory;
174
- },
175
- enumerable: false,
176
- configurable: true
177
- });
178
- Object.defineProperty(BaseComponentContext.prototype, "msGraphClientFactory", {
179
- /**
180
- * The instance of MSGraphClientFactory created for this instance of component
181
- */
182
- get: function () {
183
- return this._msGraphClientFactory;
184
- },
185
- enumerable: false,
186
- configurable: true
187
- });
188
- Object.defineProperty(BaseComponentContext.prototype, "httpClient", {
189
- /**
190
- * The instance of HttpClient created for this instance of component
191
- */
192
- get: function () {
193
- return this._httpClient;
194
- },
195
- enumerable: false,
196
- configurable: true
197
- });
198
- Object.defineProperty(BaseComponentContext.prototype, "spHttpClient", {
199
- /**
200
- * The instance of SpHttpClient created for this instance of component
201
- */
202
- get: function () {
203
- return this._spHttpClient;
204
- },
205
- enumerable: false,
206
- configurable: true
207
- });
208
- Object.defineProperty(BaseComponentContext.prototype, "isServedFromLocalhost", {
209
- /**
210
- * Returns true if the solution is being served from localhost
211
- */
212
- get: function () {
213
- return this._isServedFromLocalhost;
214
- },
215
- enumerable: false,
216
- configurable: true
217
- });
218
- return BaseComponentContext;
219
- }());
220
- _ES5CompatibleClass(BaseComponentContext);
221
- export default BaseComponentContext;
222
- //# sourceMappingURL=BaseComponentContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DynamicDataProvider.d.ts","sourceRoot":"","sources":["../src/DynamicDataProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAY,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAEjG,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EAGxB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AAQjD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAoB,YAAW,WAAW;IAC7D;;;OAGG;IACH,gBAAuB,mBAAmB,EAAE,MAAM,CAAuB;IACzE,OAAO,CAAC,mBAAmB,CAAmC;IAC9D,OAAO,CAAC,UAAU,CAA4B;IAC9C,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,cAAc,CAAkB;IACxC,OAAO,CAAC,mCAAmC,CAAkB;IAE7D;;OAEG;IACH,OAAO,CAAC,qBAAqB,CAAwD;IAErF;;;;;;OAMG;IACI,WAAW,CAAC,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,GAAG,IAAI;IAiB9E;;OAEG;IACI,OAAO,IAAI,IAAI;IActB;;OAEG;IACH,IAAW,UAAU,IAAI,OAAO,CAE/B;IAED;;;OAGG;IACH,IAAW,sBAAsB,IAAI,OAAO,CAE3C;IAED;;;OAGG;IACH,IAAW,oBAAoB,IAAI,MAAM,CAExC;IAED;;;;;;;;;;OAUG;IACI,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAiB1E;;;;;OAKG;IACI,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAkB5E;;;;;;;;;;OAUG;IACI,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAkBhG;;;;;;;;;;;;;;OAcG;IACI,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAuBlG;;;;OAIG;IACI,+BAA+B,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAQlE;;;;;;;OAOG;IACI,iCAAiC,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAQpE;;;;OAIG;IACI,mBAAmB,IAAI,aAAa,CAAC,kBAAkB,CAAC;IAM/D;;;;;OAKG;IACI,gCAAgC,CAAC,WAAW,EAAE,IAAI,GAAG,aAAa,CAAC,kBAAkB,CAAC;IAc7F;;;;;OAKG;IACI,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAQ/D;;;;;OAKG;IACI,QAAQ,CAAC,KAAK,EAAE,aAAa,EAAE,oBAAoB,GAAG,KAAK,GAAG,SAAS;IA0E9E,OAAO,CAAC,iBAAiB;IA2BzB,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,kBAAkB;IAM1B;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAe/B;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IASlC;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAI9B;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;CAezB"}