Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@uifabric/foundation

Package Overview
Dependencies
Maintainers
4
Versions
196
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uifabric/foundation - npm Package Compare versions

Comparing version 0.5.6 to 0.5.7

lib-amd/themeProvider.d.ts

14

CHANGELOG.json

@@ -5,2 +5,16 @@ {

{
"version": "0.5.7",
"tag": "@uifabric/foundation_v0.5.7",
"date": "Wed, 31 Oct 2018 12:32:41 GMT",
"comments": {
"patch": [
{
"comment": "Add theme provider for using schemes. Remove implicit scheme prop for all components using Foundation.",
"author": "Jason Gore <jagore@microsoft.com>",
"commit": "fc5a1f4620c93499a41abe8377ff61161cf5bd76"
}
]
}
},
{
"version": "0.5.6",

@@ -7,0 +21,0 @@ "tag": "@uifabric/foundation_v0.5.6",

9

CHANGELOG.md
# Change Log - @uifabric/foundation
This log was last generated on Thu, 18 Oct 2018 20:22:36 GMT and should not be manually modified.
This log was last generated on Wed, 31 Oct 2018 12:32:41 GMT and should not be manually modified.
## 0.5.7
Wed, 31 Oct 2018 12:32:41 GMT
### Patches
- Add theme provider for using schemes. Remove implicit scheme prop for all components using Foundation.
## 0.5.6

@@ -6,0 +13,0 @@ Thu, 18 Oct 2018 20:22:36 GMT

@@ -366,3 +366,3 @@ var FabricFoundation =

* @param {IComponent} component
* @param {IStylingProviders} providers
* @param {IComponentProviders} providers
*/

@@ -372,3 +372,5 @@ function createComponent(component, providers) {

var result = function (componentProps) {
return (react__WEBPACK_IMPORTED_MODULE_1__["createElement"](CustomizerContext.Consumer, null, function (context) {
return (
// TODO: createComponent is also probably affected by https://github.com/OfficeDev/office-ui-fabric-react/issues/6603
react__WEBPACK_IMPORTED_MODULE_1__["createElement"](CustomizerContext.Consumer, null, function (context) {
var settings = providers.getCustomizations(component.displayName, context, component.fields);

@@ -392,7 +394,2 @@ var renderView = function (viewProps) {

? tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"]({}, componentProps, viewProps) : componentProps;
var newContext = providers.getContextFromProps(mergedProps, context, settings);
if (newContext) {
// If we have a new context we need to refresh our settings (to reflect new contextual theme, for example)
settings = providers.getCustomizations(component.displayName, newContext);
}
var settingsStyles = settings.styles, settingsRest = tslib__WEBPACK_IMPORTED_MODULE_0__["__rest"](settings, ["styles"]);

@@ -412,3 +409,3 @@ // TODO: this next line is basically saying 'theme' prop will ALWAYS be available from getCustomizations.

// If a new context has been generated, instantiate a Provider to provide it.
return newContext ? (react__WEBPACK_IMPORTED_MODULE_1__["createElement"](CustomizerContext.Provider, { value: newContext }, component.view(viewComponentProps))) : (component.view(viewComponentProps));
return component.view(viewComponentProps);
};

@@ -454,9 +451,49 @@ return component.state ? react__WEBPACK_IMPORTED_MODULE_1__["createElement"](component.state, tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"]({}, componentProps, { renderView: renderView })) : renderView();

/* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./lib/version.js");
/* harmony import */ var _themeProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./lib/themeProvider.js");
/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "themeProvider", function() { return _themeProvider__WEBPACK_IMPORTED_MODULE_1__["themeProvider"]; });
/* harmony import */ var _version__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./lib/version.js");
/***/ }),
/***/ "./lib/themeProvider.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "themeProvider", function() { return themeProvider; });
/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../common/temp/node_modules/tslib/tslib.es6.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
/**
* Theme provider is a simplified version of Customizer that activates the appropriate theme data
* for a given scheme name.
*
* @param providers - Injected providers for accessing theme data and providing it via a Customizer component.
*/
function themeProvider(providers) {
var Customizer = providers.CustomizerComponent;
var result = function (props) {
var scheme = props.scheme, theme = props.theme, rest = tslib__WEBPACK_IMPORTED_MODULE_0__["__rest"](props, ["scheme", "theme"]);
// TODO: consider merging implementation with theme-proto, which only stores a reference / scheme name to theme in context
// and uses quick global store accessor to trigger change by passing in theme object as child and triggering re-render.
// (perf benefits need verification)
// tslint:disable-next-line:typedef
var contextTransform = function (context) {
return providers.getThemedContext(context, scheme, theme);
};
return react__WEBPACK_IMPORTED_MODULE_1__["createElement"](Customizer, tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"]({}, rest, { contextTransform: contextTransform }));
};
return result;
}
/***/ }),
/***/ "./lib/utilities.js":

@@ -481,6 +518,6 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) {

/* harmony import */ var _uifabric_set_version__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../set-version/lib/index.js");
// @uifabric/foundation@0.5.6
// @uifabric/foundation@0.5.7
// Do not modify this file, the file is generated as part of publish. The checked in version is a placeholder only.
Object(_uifabric_set_version__WEBPACK_IMPORTED_MODULE_0__["setVersion"])('@uifabric/foundation', '0.5.6');
Object(_uifabric_set_version__WEBPACK_IMPORTED_MODULE_0__["setVersion"])('@uifabric/foundation', '0.5.7');

@@ -487,0 +524,0 @@

2

dist/foundation.min.js

@@ -1,2 +0,2 @@

var FabricFoundation=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){e.exports=React},function(e,t,n){"use strict";n.r(t);var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var o=n(0),a=r;function i(e,t){var n=t.CustomizerContext,i=function(a){return o.createElement(n.Consumer,null,function(i){var u=t.getCustomizations(e.displayName,i,e.fields),c=function(c){var f=c?r({},a,c):a,l=t.getContextFromProps(f,i,u);l&&(u=t.getCustomizations(e.displayName,l));var p=u.styles,d=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n}(u,["styles"]),y=r({},d,f),v=r({},f,{classNames:t.mergeStyleSets(s(y,e.styles),s(y,p),s(y,f.styles))});return l?o.createElement(n.Provider,{value:l},e.view(v)):e.view(v)};return e.state?o.createElement(e.state,r({},a,{renderView:c})):c()})};return i.displayName=e.displayName,a(i,e.statics),i}function u(e,t){return i(e,t)}function s(e,t){return"function"==typeof t?t(e):t}var c={};!function(e,t){if("undefined"!=typeof window){var n=window.__packages__=window.__packages__||{};n[e]&&c[e]||(c[e]=t,(n[e]=n[e]||[]).push(t))}}("@uifabric/foundation","0.5.6"),n.d(t,"createComponent",function(){return i}),n.d(t,"createStatelessComponent",function(){return u})}]);
var FabricFoundation=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(e,t){e.exports=React},function(e,t,n){"use strict";n.r(t);var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&(n[r[o]]=e[r[o]])}return n}var u=n(0),i=r;function a(e,t){var n=t.CustomizerContext,a=function(i){return u.createElement(n.Consumer,null,function(n){var a=t.getCustomizations(e.displayName,n,e.fields),c=function(n){var u=n?r({},i,n):i,c=a.styles,f=o(a,["styles"]),l=r({},f,u),p=r({},u,{classNames:t.mergeStyleSets(s(l,e.styles),s(l,c),s(l,u.styles))});return e.view(p)};return e.state?u.createElement(e.state,r({},i,{renderView:c})):c()})};return a.displayName=e.displayName,i(a,e.statics),a}function c(e,t){return a(e,t)}function s(e,t){return"function"==typeof t?t(e):t}function f(e){var t=e.CustomizerComponent;return function(n){var i=n.scheme,a=n.theme,c=o(n,["scheme","theme"]);return u.createElement(t,r({},c,{contextTransform:function(t){return e.getThemedContext(t,i,a)}}))}}var l={};!function(e,t){if("undefined"!=typeof window){var n=window.__packages__=window.__packages__||{};n[e]&&l[e]||(l[e]=t,(n[e]=n[e]||[]).push(t))}}("@uifabric/foundation","0.5.7"),n.d(t,"createComponent",function(){return a}),n.d(t,"createStatelessComponent",function(){return c}),n.d(t,"themeProvider",function(){return f})}]);
//# sourceMappingURL=foundation.min.js.map

@@ -10,7 +10,2 @@ import * as React from 'react';

theme?: TTheme;
/**
* Optional scheme to apply to contextual theme. Specifying this prop
* will modify context and affect all children.
*/
scheme?: TScheme;
}

@@ -41,3 +36,3 @@ /**

*/
export declare type IStateComponentType<TComponentProps, TViewProps, TProcessedStyleSet> = React.ComponentType<IStateComponentProps<TComponentProps, TViewProps>>;
export declare type IStateComponentType<TComponentProps, TViewProps> = React.ComponentType<IStateComponentProps<TComponentProps, TViewProps>>;
/**

@@ -77,3 +72,3 @@ * The props that get passed to view components.

*/
state?: IStateComponentType<TComponentProps, TViewProps, TProcessedStyleSet>;
state?: IStateComponentType<TComponentProps, TViewProps>;
/**

@@ -95,3 +90,3 @@ * Optional static object to assign to constructed component.

*/
export interface IStylingProviders<TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme> {
export interface IComponentProviders<TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme> {
/**

@@ -109,10 +104,2 @@ * A required provider that merges multiple TStyleSets to create a TProcessedStyleSet that will be passed onto views components.

/**
* A provider that allows consumer to change context based on component's view props. If returned value is defined,
* foundation assumes context has changed and will automatically instantiate a CustomizerContext.Provider to provide new context.
* @param {IStyleableComponentProps} props Combined component and processed props.
* @param {TContext} context Current context including any contextual customizations.
* @param {IStyleableComponentProps} settings Customizations obtained from getCustomizations provider.
*/
getContextFromProps: (props: IStyleableComponentProps<TViewProps, TStyleSet, TTheme, TScheme>, context: TContext, settings: IStyleableComponentProps<TViewProps, TStyleSet, TTheme, TScheme>) => TContext | undefined;
/**
* React context provider based on TContext.

@@ -145,5 +132,5 @@ */

* @param {IComponent} component
* @param {IStylingProviders} providers
* @param {IComponentProviders} providers
*/
export declare function createComponent<TComponentProps, TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme, TStatics>(component: IComponent<TComponentProps, TViewProps, TStyleSet, TProcessedStyleSet, TTheme, TStatics>, providers: IStylingProviders<TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme>): React.StatelessComponent<TComponentProps> & TStatics;
export declare function createComponent<TComponentProps, TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme, TStatics>(component: IComponent<TComponentProps, TViewProps, TStyleSet, TProcessedStyleSet, TTheme, TStatics>, providers: IComponentProviders<TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme>): React.StatelessComponent<TComponentProps> & TStatics;
/**

@@ -154,2 +141,2 @@ * A wrapper function around createComponent to confine generics and component properties for stateless components.

*/
export declare function createStatelessComponent<TComponentProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme, TStatics>(component: IStatelessComponent<TComponentProps, TStyleSet, TProcessedStyleSet, TTheme, TStatics>, providers: IStylingProviders<TComponentProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme>): React.StatelessComponent<TComponentProps> & TStatics;
export declare function createStatelessComponent<TComponentProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme, TStatics>(component: IStatelessComponent<TComponentProps, TStyleSet, TProcessedStyleSet, TTheme, TStatics>, providers: IComponentProviders<TComponentProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme>): React.StatelessComponent<TComponentProps> & TStatics;

@@ -27,3 +27,3 @@ define(["require", "exports", "tslib", "react", "./utilities"], function (require, exports, tslib_1, React, utilities_1) {

* @param {IComponent} component
* @param {IStylingProviders} providers
* @param {IComponentProviders} providers
*/

@@ -33,3 +33,5 @@ function createComponent(component, providers) {

var result = function (componentProps) {
return (React.createElement(CustomizerContext.Consumer, null, function (context) {
return (
// TODO: createComponent is also probably affected by https://github.com/OfficeDev/office-ui-fabric-react/issues/6603
React.createElement(CustomizerContext.Consumer, null, function (context) {
var settings = providers.getCustomizations(component.displayName, context, component.fields);

@@ -53,7 +55,2 @@ var renderView = function (viewProps) {

? tslib_1.__assign({}, componentProps, viewProps) : componentProps;
var newContext = providers.getContextFromProps(mergedProps, context, settings);
if (newContext) {
// If we have a new context we need to refresh our settings (to reflect new contextual theme, for example)
settings = providers.getCustomizations(component.displayName, newContext);
}
var settingsStyles = settings.styles, settingsRest = tslib_1.__rest(settings, ["styles"]);

@@ -73,3 +70,3 @@ // TODO: this next line is basically saying 'theme' prop will ALWAYS be available from getCustomizations.

// If a new context has been generated, instantiate a Provider to provide it.
return newContext ? (React.createElement(CustomizerContext.Provider, { value: newContext }, component.view(viewComponentProps))) : (component.view(viewComponentProps));
return component.view(viewComponentProps);
};

@@ -76,0 +73,0 @@ return component.state ? React.createElement(component.state, tslib_1.__assign({}, componentProps, { renderView: renderView })) : renderView();

export * from './createComponent';
export * from './themeProvider';
import './version';

@@ -1,6 +0,7 @@

define(["require", "exports", "tslib", "./createComponent", "./version"], function (require, exports, tslib_1, createComponent_1) {
define(["require", "exports", "tslib", "./createComponent", "./themeProvider", "./version"], function (require, exports, tslib_1, createComponent_1, themeProvider_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
tslib_1.__exportStar(createComponent_1, exports);
tslib_1.__exportStar(themeProvider_1, exports);
});
//# sourceMappingURL=index.js.map
define(["require", "exports", "@uifabric/set-version"], function (require, exports, set_version_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
set_version_1.setVersion('@uifabric/foundation', '0.5.6');
set_version_1.setVersion('@uifabric/foundation', '0.5.7');
});
//# sourceMappingURL=version.js.map

@@ -10,7 +10,2 @@ import * as React from 'react';

theme?: TTheme;
/**
* Optional scheme to apply to contextual theme. Specifying this prop
* will modify context and affect all children.
*/
scheme?: TScheme;
}

@@ -41,3 +36,3 @@ /**

*/
export declare type IStateComponentType<TComponentProps, TViewProps, TProcessedStyleSet> = React.ComponentType<IStateComponentProps<TComponentProps, TViewProps>>;
export declare type IStateComponentType<TComponentProps, TViewProps> = React.ComponentType<IStateComponentProps<TComponentProps, TViewProps>>;
/**

@@ -77,3 +72,3 @@ * The props that get passed to view components.

*/
state?: IStateComponentType<TComponentProps, TViewProps, TProcessedStyleSet>;
state?: IStateComponentType<TComponentProps, TViewProps>;
/**

@@ -95,3 +90,3 @@ * Optional static object to assign to constructed component.

*/
export interface IStylingProviders<TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme> {
export interface IComponentProviders<TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme> {
/**

@@ -109,10 +104,2 @@ * A required provider that merges multiple TStyleSets to create a TProcessedStyleSet that will be passed onto views components.

/**
* A provider that allows consumer to change context based on component's view props. If returned value is defined,
* foundation assumes context has changed and will automatically instantiate a CustomizerContext.Provider to provide new context.
* @param {IStyleableComponentProps} props Combined component and processed props.
* @param {TContext} context Current context including any contextual customizations.
* @param {IStyleableComponentProps} settings Customizations obtained from getCustomizations provider.
*/
getContextFromProps: (props: IStyleableComponentProps<TViewProps, TStyleSet, TTheme, TScheme>, context: TContext, settings: IStyleableComponentProps<TViewProps, TStyleSet, TTheme, TScheme>) => TContext | undefined;
/**
* React context provider based on TContext.

@@ -145,5 +132,5 @@ */

* @param {IComponent} component
* @param {IStylingProviders} providers
* @param {IComponentProviders} providers
*/
export declare function createComponent<TComponentProps, TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme, TStatics>(component: IComponent<TComponentProps, TViewProps, TStyleSet, TProcessedStyleSet, TTheme, TStatics>, providers: IStylingProviders<TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme>): React.StatelessComponent<TComponentProps> & TStatics;
export declare function createComponent<TComponentProps, TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme, TStatics>(component: IComponent<TComponentProps, TViewProps, TStyleSet, TProcessedStyleSet, TTheme, TStatics>, providers: IComponentProviders<TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme>): React.StatelessComponent<TComponentProps> & TStatics;
/**

@@ -154,2 +141,2 @@ * A wrapper function around createComponent to confine generics and component properties for stateless components.

*/
export declare function createStatelessComponent<TComponentProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme, TStatics>(component: IStatelessComponent<TComponentProps, TStyleSet, TProcessedStyleSet, TTheme, TStatics>, providers: IStylingProviders<TComponentProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme>): React.StatelessComponent<TComponentProps> & TStatics;
export declare function createStatelessComponent<TComponentProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme, TStatics>(component: IStatelessComponent<TComponentProps, TStyleSet, TProcessedStyleSet, TTheme, TStatics>, providers: IComponentProviders<TComponentProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme>): React.StatelessComponent<TComponentProps> & TStatics;

@@ -29,3 +29,3 @@ "use strict";

* @param {IComponent} component
* @param {IStylingProviders} providers
* @param {IComponentProviders} providers
*/

@@ -35,3 +35,5 @@ function createComponent(component, providers) {

var result = function (componentProps) {
return (React.createElement(CustomizerContext.Consumer, null, function (context) {
return (
// TODO: createComponent is also probably affected by https://github.com/OfficeDev/office-ui-fabric-react/issues/6603
React.createElement(CustomizerContext.Consumer, null, function (context) {
var settings = providers.getCustomizations(component.displayName, context, component.fields);

@@ -55,7 +57,2 @@ var renderView = function (viewProps) {

? tslib_1.__assign({}, componentProps, viewProps) : componentProps;
var newContext = providers.getContextFromProps(mergedProps, context, settings);
if (newContext) {
// If we have a new context we need to refresh our settings (to reflect new contextual theme, for example)
settings = providers.getCustomizations(component.displayName, newContext);
}
var settingsStyles = settings.styles, settingsRest = tslib_1.__rest(settings, ["styles"]);

@@ -75,3 +72,3 @@ // TODO: this next line is basically saying 'theme' prop will ALWAYS be available from getCustomizations.

// If a new context has been generated, instantiate a Provider to provide it.
return newContext ? (React.createElement(CustomizerContext.Provider, { value: newContext }, component.view(viewComponentProps))) : (component.view(viewComponentProps));
return component.view(viewComponentProps);
};

@@ -78,0 +75,0 @@ return component.state ? React.createElement(component.state, tslib_1.__assign({}, componentProps, { renderView: renderView })) : renderView();

export * from './createComponent';
export * from './themeProvider';
import './version';

@@ -5,3 +5,4 @@ "use strict";

tslib_1.__exportStar(require("./createComponent"), exports);
tslib_1.__exportStar(require("./themeProvider"), exports);
require("./version");
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// @uifabric/foundation@0.5.6
// @uifabric/foundation@0.5.7
// Do not modify this file, the file is generated as part of publish. The checked in version is a placeholder only.
var set_version_1 = require("@uifabric/set-version");
set_version_1.setVersion('@uifabric/foundation', '0.5.6');
set_version_1.setVersion('@uifabric/foundation', '0.5.7');
//# sourceMappingURL=version.js.map

@@ -10,7 +10,2 @@ import * as React from 'react';

theme?: TTheme;
/**
* Optional scheme to apply to contextual theme. Specifying this prop
* will modify context and affect all children.
*/
scheme?: TScheme;
}

@@ -41,3 +36,3 @@ /**

*/
export declare type IStateComponentType<TComponentProps, TViewProps, TProcessedStyleSet> = React.ComponentType<IStateComponentProps<TComponentProps, TViewProps>>;
export declare type IStateComponentType<TComponentProps, TViewProps> = React.ComponentType<IStateComponentProps<TComponentProps, TViewProps>>;
/**

@@ -77,3 +72,3 @@ * The props that get passed to view components.

*/
state?: IStateComponentType<TComponentProps, TViewProps, TProcessedStyleSet>;
state?: IStateComponentType<TComponentProps, TViewProps>;
/**

@@ -95,3 +90,3 @@ * Optional static object to assign to constructed component.

*/
export interface IStylingProviders<TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme> {
export interface IComponentProviders<TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme> {
/**

@@ -109,10 +104,2 @@ * A required provider that merges multiple TStyleSets to create a TProcessedStyleSet that will be passed onto views components.

/**
* A provider that allows consumer to change context based on component's view props. If returned value is defined,
* foundation assumes context has changed and will automatically instantiate a CustomizerContext.Provider to provide new context.
* @param {IStyleableComponentProps} props Combined component and processed props.
* @param {TContext} context Current context including any contextual customizations.
* @param {IStyleableComponentProps} settings Customizations obtained from getCustomizations provider.
*/
getContextFromProps: (props: IStyleableComponentProps<TViewProps, TStyleSet, TTheme, TScheme>, context: TContext, settings: IStyleableComponentProps<TViewProps, TStyleSet, TTheme, TScheme>) => TContext | undefined;
/**
* React context provider based on TContext.

@@ -145,5 +132,5 @@ */

* @param {IComponent} component
* @param {IStylingProviders} providers
* @param {IComponentProviders} providers
*/
export declare function createComponent<TComponentProps, TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme, TStatics>(component: IComponent<TComponentProps, TViewProps, TStyleSet, TProcessedStyleSet, TTheme, TStatics>, providers: IStylingProviders<TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme>): React.StatelessComponent<TComponentProps> & TStatics;
export declare function createComponent<TComponentProps, TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme, TStatics>(component: IComponent<TComponentProps, TViewProps, TStyleSet, TProcessedStyleSet, TTheme, TStatics>, providers: IComponentProviders<TViewProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme>): React.StatelessComponent<TComponentProps> & TStatics;
/**

@@ -154,2 +141,2 @@ * A wrapper function around createComponent to confine generics and component properties for stateless components.

*/
export declare function createStatelessComponent<TComponentProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme, TStatics>(component: IStatelessComponent<TComponentProps, TStyleSet, TProcessedStyleSet, TTheme, TStatics>, providers: IStylingProviders<TComponentProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme>): React.StatelessComponent<TComponentProps> & TStatics;
export declare function createStatelessComponent<TComponentProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme, TStatics>(component: IStatelessComponent<TComponentProps, TStyleSet, TProcessedStyleSet, TTheme, TStatics>, providers: IComponentProviders<TComponentProps, TStyleSet, TProcessedStyleSet, TContext, TTheme, TScheme>): React.StatelessComponent<TComponentProps> & TStatics;

@@ -27,3 +27,3 @@ import * as tslib_1 from "tslib";

* @param {IComponent} component
* @param {IStylingProviders} providers
* @param {IComponentProviders} providers
*/

@@ -33,3 +33,5 @@ export function createComponent(component, providers) {

var result = function (componentProps) {
return (React.createElement(CustomizerContext.Consumer, null, function (context) {
return (
// TODO: createComponent is also probably affected by https://github.com/OfficeDev/office-ui-fabric-react/issues/6603
React.createElement(CustomizerContext.Consumer, null, function (context) {
var settings = providers.getCustomizations(component.displayName, context, component.fields);

@@ -53,7 +55,2 @@ var renderView = function (viewProps) {

? tslib_1.__assign({}, componentProps, viewProps) : componentProps;
var newContext = providers.getContextFromProps(mergedProps, context, settings);
if (newContext) {
// If we have a new context we need to refresh our settings (to reflect new contextual theme, for example)
settings = providers.getCustomizations(component.displayName, newContext);
}
var settingsStyles = settings.styles, settingsRest = tslib_1.__rest(settings, ["styles"]);

@@ -73,3 +70,3 @@ // TODO: this next line is basically saying 'theme' prop will ALWAYS be available from getCustomizations.

// If a new context has been generated, instantiate a Provider to provide it.
return newContext ? (React.createElement(CustomizerContext.Provider, { value: newContext }, component.view(viewComponentProps))) : (component.view(viewComponentProps));
return component.view(viewComponentProps);
};

@@ -76,0 +73,0 @@ return component.state ? React.createElement(component.state, tslib_1.__assign({}, componentProps, { renderView: renderView })) : renderView();

export * from './createComponent';
export * from './themeProvider';
import './version';
export * from './createComponent';
export * from './themeProvider';
import './version';
//# sourceMappingURL=index.js.map

@@ -1,5 +0,5 @@

// @uifabric/foundation@0.5.6
// @uifabric/foundation@0.5.7
// Do not modify this file, the file is generated as part of publish. The checked in version is a placeholder only.
import { setVersion } from '@uifabric/set-version';
setVersion('@uifabric/foundation', '0.5.6');
setVersion('@uifabric/foundation', '0.5.7');
//# sourceMappingURL=version.js.map

@@ -7,4 +7,4 @@ {

"packages/foundation/.vscode/settings.json": "a47d61e2fb865a31a0ee471e65cfb447269f23f2",
"packages/foundation/CHANGELOG.json": "45268ad36cb5a079597bc398938099d55ca2fb01",
"packages/foundation/CHANGELOG.md": "ad4ec7df1590a06542c3137c57b7db36ff7bc82c",
"packages/foundation/CHANGELOG.json": "46b4c348a21b3515e0804c80203ab00218104391",
"packages/foundation/CHANGELOG.md": "06f72a02cc60f34ac633a4d7b516fdac0ed79499",
"packages/foundation/LICENSE": "f40682078e868be480a62821f1def5fbe0dd965e",

@@ -15,13 +15,14 @@ "packages/foundation/README.md": "087545875d3296f7c6652fb9471d9a8ef15b4d0e",

"packages/foundation/jsconfig.json": "c25b2cc60e6443982c62d0847d67b6ac6960dddc",
"packages/foundation/package.json": "6570a85a2e1fab24fda8fd1def2c1572ef583876",
"packages/foundation/src/createComponent.tsx": "0f9697d33cf54462d3f7dc30cdb4e09a248c6dd6",
"packages/foundation/src/index.ts": "bd566476eef79592d2e2444591f55a646f1b6933",
"packages/foundation/package.json": "467771b3d2f46379762ff29b48c3a00eae900d0b",
"packages/foundation/src/createComponent.tsx": "959b1af03622e537435d86c0b63661811885354d",
"packages/foundation/src/index.ts": "e7d04125ab97714bf89964aaac2a6b3f337cfb6c",
"packages/foundation/src/themeProvider.tsx": "0e2c57e8e8137ea2af31bfd78f21e7bac2fd574d",
"packages/foundation/src/utilities.ts": "3146eabfcb3301605bc038fad923b2546d0c1faa",
"packages/foundation/src/version.ts": "80baba69d36f1592791a208c54e65779d2123535",
"packages/foundation/src/version.ts": "1e796156d947ac286615e760ddda318dc04b1b75",
"packages/foundation/tsconfig.json": "3758c6c261a8af0f1c243da01fcd0a0c221684ae",
"packages/foundation/tslint.json": "be9508c1adfdde496e38227c44402f31af6713fc",
"packages/foundation/webpack.config.js": "fca7f555c8de2b3f0dd69a9639400ea188eed229",
"common/config/rush/npm-shrinkwrap.json": "7ee878de9ddbd0a907eaffdd0b74b2ff5e758e89"
"common/config/rush/npm-shrinkwrap.json": "0e977ac88694c48e4ae08ba122816507e4d4b358"
},
"arguments": "node ../../scripts/build.js --production"
}
{
"name": "@uifabric/foundation",
"version": "0.5.6",
"version": "0.5.7",
"description": "Foundation library for building Fabric components.",

@@ -5,0 +5,0 @@ "main": "lib-commonjs/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc