Added package, resizing, placeholder size fix

This commit is contained in:
Hugo Bernier 2020-08-15 15:06:40 -04:00
parent b9e4789088
commit baeb96dea9
15 changed files with 148 additions and 72 deletions

View File

@ -35,7 +35,7 @@ react-enhanced-powerapps | Hugo Bernier ([Tahoe Ninjas](http://tahoeninjas.blog/
Version|Date|Comments
-------|----|--------
1.0|July 27, 2020|Initial release
1.1|August 15, 2020|Added improved resize event handler
## Disclaimer
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**

View File

@ -3,7 +3,7 @@
"solution": {
"name": "react-enhanced-powerapps-client-side-solution",
"id": "601b7688-1e9c-468c-b9a3-e4bb4e14edcd",
"version": "1.0.0.0",
"version": "1.1.0.0",
"includeClientSideAssets": true,
"isDomainIsolated": false,
"developer": {

View File

@ -36,5 +36,10 @@ export default class EnhancedPowerAppsWebPart extends BaseClientSideWebPart<IEnh
* @param args The new theme
*/
private _handleThemeChangedEvent;
/**
* Redraws the web part when resized
* @param _newWidth
*/
protected onAfterResize(_newWidth: number): void;
}
//# sourceMappingURL=EnhancedPowerAppsWebPart.d.ts.map

View File

@ -1 +1 @@
{"version":3,"file":"EnhancedPowerAppsWebPart.d.ts","sourceRoot":"","sources":["../../../src/webparts/enhancedPowerApps/EnhancedPowerAppsWebPart.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACL,0BAA0B,EAK3B,MAAM,6BAA6B,CAAC;AAMrC;;GAEG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;GAEG;AACH,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAG3B,MAAM,4BAA4B,CAAC;AAuBpC,MAAM,WAAW,8BAA8B;IAC7C,WAAW,EAAE,eAAe,CAA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AC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,aAAa,GAAC,aAAa,CAAC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,GAAC,KAAK,GAAC,OAAO,GAAC,KAAK,GAAC,QAAQ,CAAC;IACjD,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,OAAO,wBAAyB,SAAQ,qBAAqB,CAAC,8BAA8B,CAAC;IACzG,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,aAAa,CAA6B;IAElD,SAAS,CAAC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAa1B,MAAM,IAAI,IAAI;IA4DrB,SAAS,CAAC,SAAS,IAAI,IAAI;uBAIb,WAAW,EAAI,OAAO;IAIpC,SAAS,CAAC,4BAA4B,IAAI,0BAA0B;uBAwItD,kBAAkB,EAAI,0BAA0B;IAU9D,OAAO,CAAC,YAAY,CAEnB;IAED;;;;KAIC;IACD,OAAO,CAAC,wBAAwB;IAKhC;;;OAGG;IACH,SAAS,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;CAIjD"}

View File

@ -54,9 +54,12 @@ var EnhancedPowerAppsWebPart = /** @class */ (function (_super) {
return _super.prototype.onInit.call(this);
};
EnhancedPowerAppsWebPart.prototype.render = function () {
var clientWidth = this.domElement.clientWidth;
// Context variables and dynamic properties
var dynamicProp = this.properties.dynamicProp.tryGetValue();
var locale = this.context.pageContext.cultureInfo.currentCultureName;
// Get the client width. This is how we'll calculate the aspect ratio and resize the iframe
var clientWidth = this.domElement.clientWidth;
// Get the aspect width and height based on aspect ratio for the web part
var aspectWidth;
var aspectHeight;
switch (this.properties.aspectratio) {
@ -77,9 +80,12 @@ var EnhancedPowerAppsWebPart = /** @class */ (function (_super) {
aspectHeight = 3;
break;
case "Custom":
// Custom aspects just use the width and height properties
aspectWidth = this.properties.width;
aspectHeight = this.properties.height;
}
// If we're using fixed height, we pass the height and don't resize, otherwise we
// calculate the height based on the web part's width and selected aspect ratio
var clientHeight = this.properties.layout === 'FixedHeight' ?
this.properties.height :
clientWidth * (aspectHeight / aspectWidth);
@ -265,6 +271,14 @@ var EnhancedPowerAppsWebPart = /** @class */ (function (_super) {
this._themeVariant = args.theme;
this.render();
};
/**
* Redraws the web part when resized
* @param _newWidth
*/
EnhancedPowerAppsWebPart.prototype.onAfterResize = function (_newWidth) {
// redraw the web part
this.render();
};
return EnhancedPowerAppsWebPart;
}(BaseClientSideWebPart));
export default EnhancedPowerAppsWebPart;

View File

@ -1 +1 @@
{"version":3,"file":"EnhancedPowerApps.d.ts","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/EnhancedPowerApps.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAYpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,KAAK,CAAC,SAAS,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;IAEvG,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,uBAAuB,CAAC;CAkE7D"}
{"version":3,"file":"EnhancedPowerApps.d.ts","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/EnhancedPowerApps.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAYpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,KAAK,CAAC,SAAS,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;IAEvG,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,uBAAuB,CAAC;CAiE7D"}

View File

@ -24,9 +24,11 @@ var EnhancedPowerApps = /** @class */ (function (_super) {
return _super !== null && _super.apply(this, arguments) || this;
}
EnhancedPowerApps.prototype.render = function () {
var _a = this.props, dynamicProp = _a.dynamicProp, themeVariant = _a.themeVariant, themeValues = _a.themeValues, appWebLink = _a.appWebLink, useDynamicProp = _a.useDynamicProp, dynamicPropName = _a.dynamicPropName, locale = _a.locale, border = _a.border, height = _a.height, width = _a.width;
var _a = this.props, dynamicProp = _a.dynamicProp, themeVariant = _a.themeVariant, themeValues = _a.themeValues, appWebLink = _a.appWebLink, useDynamicProp = _a.useDynamicProp, dynamicPropName = _a.dynamicPropName, locale = _a.locale, border = _a.border, height = _a.height;
// The only thing we need for this web part to be configured is an app link or app id
var needConfiguration = !appWebLink;
var semanticColors = themeVariant.semanticColors;
// If we passed a dynamic property, add it as a query string parameter
var dynamicPropValue = useDynamicProp && dynamicProp !== undefined ? "&" + encodeURIComponent(dynamicPropName) + "=" + encodeURIComponent(dynamicProp) : '';
// We can take an app id or a full link. We'll assume (for now) that people are passing a valid app URL
// would LOVE to find an API to retrieve list of valid apps
@ -46,8 +48,7 @@ var EnhancedPowerApps = /** @class */ (function (_super) {
}
// Build the frame url
var frameUrl = appUrl + "?source=SPClient-EnhancedPowerAppsWebPart&amp;locale=" + locale + "&amp;enableOnBehalfOf=true&amp;authMode=onbehalfof&amp;hideNavBar=true&amp;" + dynamicPropValue + themeParams + "&locale=" + locale;
console.log("URL", frameUrl);
return (React.createElement("div", { className: styles.enhancedPowerApps, style: { height: height + "px" } },
return (React.createElement("div", { className: styles.enhancedPowerApps, style: needConfiguration ? { height: "315px" } : { height: height + "px" } },
needConfiguration &&
React.createElement(Placeholder, { iconName: 'PowerApps', iconText: strings.PlaceholderIconText, description: strings.PlaceholderDescription, buttonLabel: strings.PlaceholderButtonLabel, onConfigure: this.props.onConfigure }),
!needConfiguration &&

View File

@ -1 +1 @@
{"version":3,"file":"EnhancedPowerApps.js","sourceRoot":"","sources":["../../../../src/webparts/enhancedPowerApps/components/EnhancedPowerApps.tsx"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,iCAAiC,CAAC;AAErD,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAC;AAE3D;;KAEK;AACL,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAQvE;IAA+C,qCAAiE;IAAhH;;IAoEA,CAAC;IAlEQ,kCAAM,GAAb;QACQ,IAAA,eAWU,EAVd,4BAAW,EACX,8BAAY,EACZ,4BAAW,EACX,0BAAU,EACV,kCAAc,EACd,oCAAe,EACf,kBAAM,EACN,kBAAM,EACN,kBAAM,EACN,gBACc,CAAC;QACjB,IAAM,iBAAiB,GAAY,CAAC,UAAU,CAAC;QAEvC,IAAA,4CAAc,CAAkC;QAExD,IAAM,gBAAgB,GAAW,cAAc,IAAI,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,MAAI,kBAAkB,CAAC,eAAe,CAAC,SAAI,kBAAkB,CAAC,WAAW,CAAG,CAAA,CAAC,CAAA,EAAE,CAAC;QAE/J,uGAAuG;QACvG,2DAA2D;QAC3D,IAAM,MAAM,GAAW,UAAU,IAAI,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,qCAAmC,UAAY,CAAC,CAAC,CAAC,UAAU,CAAC;QAExI,gEAAgE;QAChE,IAAI,WAAW,GAAW,EAAE,CAAC;QAE7B,IAAI,WAAW,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;YAC3C,WAAW,CAAC,OAAO,CAAC,UAAC,UAAkB;gBACrC,IAAI;oBAEF,IAAM,UAAU,GAAW,cAAc,CAAC,UAAU,CAAC,CAAC;oBACtD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,CAAC,CAAC,CAAC,CAAC;iBAChB;YACH,CAAC,CAAC,CAAC;SACJ;QAGD,sBAAsB;QACtB,IAAM,QAAQ,GAAc,MAAM,6DAAwD,MAAM,mFAA8E,gBAAgB,GAAG,WAAW,gBAAW,MAAQ,CAAC;QAEhO,OAAO,CACL,6BAAK,SAAS,EAAG,MAAM,CAAC,iBAAiB,EAAG,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAC,MAAM,EAAC,OAAO,EAAC,CAAA,CAAC,CAAA,EAAC,MAAM,EAAI,MAAM,OAAI,EAAC;YAC3G,iBAAiB;gBACjB,oBAAC,WAAW,IACZ,QAAQ,EAAC,WAAW,EACpB,QAAQ,EAAE,OAAO,CAAC,mBAAmB,EACrC,WAAW,EAAE,OAAO,CAAC,sBAAsB,EAC3C,WAAW,EAAE,OAAO,CAAC,sBAAsB,EAC3C,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,GAAI;YACtC,CAAC,iBAAiB;gBACnB,0CACC,IAAI,CAAC,KAAK,CAAC,UAAU;oBACvB,gCAAQ,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,IAAI,EAAC,KAAK,EAAC,sDAAsD,EAAC,OAAO,EAAC,gIAAgI,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EACnR,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAA,CAAC,CAAC,GAAG,GACpB,CAEN,CAEA,CACP,CAAC;IACJ,CAAC;IACH,wBAAC;AAAD,CAAC,AAnED,CAA+C,KAAK,CAAC,SAAS,GAmE7D"}

View File

@ -1,2 +1 @@
.enhancedPowerApps_e02a5fc2{color:inherit}.enhancedPowerApps_e02a5fc2 span[class^=placeholderText_]{font-size:20px!important;font-weight:600!important;color:#323130}.enhancedPowerApps_e02a5fc2 span[class^=placeholderDescriptionText_]{color:#605e5c!important;margin:20px 0 28px;line-height:23px;font-size:16px!important}
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyY1xcd2VicGFydHNcXGVuaGFuY2VkUG93ZXJBcHBzXFxjb21wb25lbnRzXFxFbmhhbmNlZFBvd2VyQXBwcy5tb2R1bGUuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQSw0QkFDRSxNQUFBLFFBREYsMERBU0ksVUFBQSxlQUNBLFlBQUEsY0FDQSxNQUFBLFFBWEoscUVBZUksTUFBQSxrQkFDQSxPQUFBLEtBQUEsRUFBQSxLQUNBLFlBQUEsS0FDQSxVQUFBIn0= */
.enhancedPowerApps_e02a5fc2{color:inherit}.enhancedPowerApps_e02a5fc2 span[class^=placeholderText_]{font-size:20px!important;font-weight:600!important;color:#323130}.enhancedPowerApps_e02a5fc2 span[class^=placeholderDescriptionText_]{color:#605e5c!important;margin:20px 0 28px;line-height:23px;font-size:16px!important}

View File

@ -1,6 +1,6 @@
{
"name": "react-enhanced-powerapps",
"version": "0.0.1",
"version": "1.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -2211,6 +2211,15 @@
"statuses": "1"
}
},
"lru-cache": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
"integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
"dev": true,
"requires": {
"yallist": "^3.0.2"
}
},
"mime": {
"version": "1.3.4",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz",
@ -2343,6 +2352,44 @@
"terser": "^3.16.1",
"webpack-sources": "^1.1.0",
"worker-farm": "^1.5.2"
},
"dependencies": {
"cacache": {
"version": "11.3.3",
"resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.3.tgz",
"integrity": "sha512-p8WcneCytvzPxhDvYp31PD039vi77I12W+/KfR9S8AZbaiARFBCpsPJS+9uhWfeBfeAtW7o/4vt3MUqLkbY6nA==",
"dev": true,
"requires": {
"bluebird": "^3.5.5",
"chownr": "^1.1.1",
"figgy-pudding": "^3.5.1",
"glob": "^7.1.4",
"graceful-fs": "^4.1.15",
"lru-cache": "^5.1.1",
"mississippi": "^3.0.0",
"mkdirp": "^0.5.1",
"move-concurrently": "^1.0.1",
"promise-inflight": "^1.0.1",
"rimraf": "^2.6.3",
"ssri": "^6.0.1",
"unique-filename": "^1.1.1",
"y18n": "^4.0.0"
}
},
"glob": {
"version": "7.1.6",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^3.0.4",
"once": "^1.3.0",
"path-is-absolute": "^1.0.0"
}
}
}
},
"uuid": {
@ -2381,6 +2428,18 @@
"watchpack": "^1.5.0",
"webpack-sources": "^1.3.0"
}
},
"y18n": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
"dev": true
},
"yallist": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
"dev": true
}
}
},
@ -5551,51 +5610,6 @@
"integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=",
"dev": true
},
"cacache": {
"version": "11.3.3",
"resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.3.tgz",
"integrity": "sha512-p8WcneCytvzPxhDvYp31PD039vi77I12W+/KfR9S8AZbaiARFBCpsPJS+9uhWfeBfeAtW7o/4vt3MUqLkbY6nA==",
"dev": true,
"requires": {
"bluebird": "^3.5.5",
"chownr": "^1.1.1",
"figgy-pudding": "^3.5.1",
"glob": "^7.1.4",
"graceful-fs": "^4.1.15",
"lru-cache": "^5.1.1",
"mississippi": "^3.0.0",
"mkdirp": "^0.5.1",
"move-concurrently": "^1.0.1",
"promise-inflight": "^1.0.1",
"rimraf": "^2.6.3",
"ssri": "^6.0.1",
"unique-filename": "^1.1.1",
"y18n": "^4.0.0"
},
"dependencies": {
"lru-cache": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
"integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
"dev": true,
"requires": {
"yallist": "^3.0.2"
}
},
"y18n": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
"dev": true
},
"yallist": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
"dev": true
}
}
},
"cache-base": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",

View File

@ -1,6 +1,6 @@
{
"name": "react-enhanced-powerapps",
"version": "0.0.1",
"version": "1.1.0",
"private": true,
"main": "lib/index.js",
"engines": {

View File

@ -26,8 +26,7 @@ export default class EnhancedPowerApps extends React.Component<IEnhancedPowerApp
dynamicPropName,
locale,
border,
height,
width
height
} = this.props;
// The only thing we need for this web part to be configured is an app link or app id
@ -37,23 +36,23 @@ export default class EnhancedPowerApps extends React.Component<IEnhancedPowerApp
// If we passed a dynamic property, add it as a query string parameter
const dynamicPropValue: string = useDynamicProp && dynamicProp !== undefined ? `&${encodeURIComponent(dynamicPropName)}=${encodeURIComponent(dynamicProp)}`:'';
// We can take an app id or a full link. We'll assume (for now) that people are passing a valid app URL
// would LOVE to find an API to retrieve list of valid apps
const appUrl: string = appWebLink && appWebLink.indexOf('https://') != 0 ? `https://apps.powerapps.com/play/${appWebLink}` : appWebLink;
// Build the portion of the URL where we're passing theme colors
let themeParams: string = "";
if (themeValues && themeValues.length > 0) {
themeValues.forEach((themeValue: string) => {
try {
const themeColor: string = semanticColors[themeValue];
themeParams = themeParams + `&${themeValue}=${encodeURIComponent(themeColor)}`;
} catch (e) {
console.log(e);
}
}
});
}
@ -61,10 +60,8 @@ export default class EnhancedPowerApps extends React.Component<IEnhancedPowerApp
// Build the frame url
const frameUrl: string = `${appUrl}?source=SPClient-EnhancedPowerAppsWebPart&amp;locale=${locale}&amp;enableOnBehalfOf=true&amp;authMode=onbehalfof&amp;hideNavBar=true&amp;${dynamicPropValue}${themeParams}&locale=${locale}`;
console.log("URL", frameUrl);
return (
<div className={ styles.enhancedPowerApps } style={{height:`${height}px`}}>
<div className={ styles.enhancedPowerApps } style={needConfiguration ? {height:`315px`}:{height:`${height}px`}}>
{needConfiguration &&
<Placeholder
iconName='PowerApps'

View File

@ -686,7 +686,7 @@ var MANIFESTS_ARRAY = [
"id": "3d2f89fa-3b9e-4876-82c2-c15ff82190f1",
"alias": "EnhancedPowerAppsWebPart",
"componentType": "WebPart",
"version": "0.0.1",
"version": "1.1.0",
"manifestVersion": 2,
"requiresCustomScript": false,
"supportsFullBleed": true,
@ -725,11 +725,57 @@ var MANIFESTS_ARRAY = [
},
"EnhancedPowerAppsWebPartStrings": {
"defaultPath": "lib/webparts/enhancedPowerApps/loc/en-us.js",
"type": "localizedPath"
"type": "localizedPath",
"paths": {}
},
"PropertyControlStrings": {
"defaultPath": "node_modules/@pnp/spfx-property-controls/lib/loc/en-us.js",
"type": "localizedPath"
"type": "localizedPath",
"paths": {
"en-US": "node_modules/@pnp/spfx-property-controls/lib/loc/en-us.js",
"bn": "node_modules/@pnp/spfx-property-controls/lib/loc/en-us.js",
"chr": "node_modules/@pnp/spfx-property-controls/lib/loc/en-us.js",
"dv": "node_modules/@pnp/spfx-property-controls/lib/loc/en-us.js",
"div": "node_modules/@pnp/spfx-property-controls/lib/loc/en-us.js",
"en": "node_modules/@pnp/spfx-property-controls/lib/loc/en-us.js",
"fil": "node_modules/@pnp/spfx-property-controls/lib/loc/en-us.js",
"haw": "node_modules/@pnp/spfx-property-controls/lib/loc/en-us.js",
"iu": "node_modules/@pnp/spfx-property-controls/lib/loc/en-us.js",
"lo": "node_modules/@pnp/spfx-property-controls/lib/loc/en-us.js",
"moh": "node_modules/@pnp/spfx-property-controls/lib/loc/en-us.js",
"fr-FR": "node_modules/@pnp/spfx-property-controls/lib/loc/fr-fr.js",
"gsw": "node_modules/@pnp/spfx-property-controls/lib/loc/fr-fr.js",
"br": "node_modules/@pnp/spfx-property-controls/lib/loc/fr-fr.js",
"tzm-Tfng": "node_modules/@pnp/spfx-property-controls/lib/loc/fr-fr.js",
"co": "node_modules/@pnp/spfx-property-controls/lib/loc/fr-fr.js",
"fr": "node_modules/@pnp/spfx-property-controls/lib/loc/fr-fr.js",
"ff": "node_modules/@pnp/spfx-property-controls/lib/loc/fr-fr.js",
"lb": "node_modules/@pnp/spfx-property-controls/lib/loc/fr-fr.js",
"mg": "node_modules/@pnp/spfx-property-controls/lib/loc/fr-fr.js",
"oc": "node_modules/@pnp/spfx-property-controls/lib/loc/fr-fr.js",
"zgh": "node_modules/@pnp/spfx-property-controls/lib/loc/fr-fr.js",
"wo": "node_modules/@pnp/spfx-property-controls/lib/loc/fr-fr.js",
"nl-NL": "node_modules/@pnp/spfx-property-controls/lib/loc/nl-nl.js",
"nl": "node_modules/@pnp/spfx-property-controls/lib/loc/nl-nl.js",
"fy": "node_modules/@pnp/spfx-property-controls/lib/loc/nl-nl.js",
"no": "node_modules/@pnp/spfx-property-controls/lib/loc/no.js",
"ru-RU": "node_modules/@pnp/spfx-property-controls/lib/loc/ru-ru.js",
"ru": "node_modules/@pnp/spfx-property-controls/lib/loc/ru-ru.js",
"ba": "node_modules/@pnp/spfx-property-controls/lib/loc/ru-ru.js",
"be": "node_modules/@pnp/spfx-property-controls/lib/loc/ru-ru.js",
"ky": "node_modules/@pnp/spfx-property-controls/lib/loc/ru-ru.js",
"mn": "node_modules/@pnp/spfx-property-controls/lib/loc/ru-ru.js",
"sah": "node_modules/@pnp/spfx-property-controls/lib/loc/ru-ru.js",
"tg": "node_modules/@pnp/spfx-property-controls/lib/loc/ru-ru.js",
"tt": "node_modules/@pnp/spfx-property-controls/lib/loc/ru-ru.js",
"tk": "node_modules/@pnp/spfx-property-controls/lib/loc/ru-ru.js",
"zh-CN": "node_modules/@pnp/spfx-property-controls/lib/loc/zh-cn.js",
"zh": "node_modules/@pnp/spfx-property-controls/lib/loc/zh-cn.js",
"mn-Mong": "node_modules/@pnp/spfx-property-controls/lib/loc/zh-cn.js",
"bo": "node_modules/@pnp/spfx-property-controls/lib/loc/zh-cn.js",
"ug": "node_modules/@pnp/spfx-property-controls/lib/loc/zh-cn.js",
"ii": "node_modules/@pnp/spfx-property-controls/lib/loc/zh-cn.js"
}
},
"@microsoft/sp-property-pane": {
"type": "component",

File diff suppressed because one or more lines are too long