@atlaskit/app-provider
Advanced tools
Comparing version 1.0.1 to 1.1.0
# @atlaskit/app-provider | ||
## 1.1.0 | ||
### Minor Changes | ||
- [#87244](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87244) [`7d9d0320d3da`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7d9d0320d3da) - Add option to disable theming features with `UNSAFE_isThemingDisabled` | ||
## 1.0.1 | ||
@@ -4,0 +10,0 @@ |
@@ -28,3 +28,4 @@ "use strict"; | ||
defaultTheme = _ref.defaultTheme, | ||
routerLinkComponent = _ref.routerLinkComponent; | ||
routerLinkComponent = _ref.routerLinkComponent, | ||
UNSAFE_isThemingDisabled = _ref.UNSAFE_isThemingDisabled; | ||
var isInsideAppProvider = (0, _react.useContext)(InsideAppProviderContext); | ||
@@ -34,11 +35,12 @@ if (isInsideAppProvider) { | ||
} | ||
var routerLinkProvider = /*#__PURE__*/_react.default.createElement(_routerLinkProvider.default, { | ||
routerLinkComponent: routerLinkComponent | ||
}, children); | ||
return /*#__PURE__*/_react.default.createElement(InsideAppProviderContext.Provider, { | ||
value: true | ||
}, /*#__PURE__*/_react.default.createElement(_themeProvider.default, { | ||
}, UNSAFE_isThemingDisabled ? routerLinkProvider : /*#__PURE__*/_react.default.createElement(_themeProvider.default, { | ||
defaultColorMode: defaultColorMode, | ||
defaultTheme: defaultTheme | ||
}, /*#__PURE__*/_react.default.createElement(_routerLinkProvider.default, { | ||
routerLinkComponent: routerLinkComponent | ||
}, children))); | ||
}, routerLinkProvider)); | ||
} | ||
var _default = exports.default = AppProvider; |
@@ -16,3 +16,4 @@ import React, { createContext, useContext } from 'react'; | ||
defaultTheme, | ||
routerLinkComponent | ||
routerLinkComponent, | ||
UNSAFE_isThemingDisabled | ||
}) { | ||
@@ -23,11 +24,12 @@ const isInsideAppProvider = useContext(InsideAppProviderContext); | ||
} | ||
const routerLinkProvider = /*#__PURE__*/React.createElement(RouterLinkProvider, { | ||
routerLinkComponent: routerLinkComponent | ||
}, children); | ||
return /*#__PURE__*/React.createElement(InsideAppProviderContext.Provider, { | ||
value: true | ||
}, /*#__PURE__*/React.createElement(ThemeProvider, { | ||
}, UNSAFE_isThemingDisabled ? routerLinkProvider : /*#__PURE__*/React.createElement(ThemeProvider, { | ||
defaultColorMode: defaultColorMode, | ||
defaultTheme: defaultTheme | ||
}, /*#__PURE__*/React.createElement(RouterLinkProvider, { | ||
routerLinkComponent: routerLinkComponent | ||
}, children))); | ||
}, routerLinkProvider)); | ||
} | ||
export default AppProvider; |
@@ -17,3 +17,4 @@ import React, { createContext, useContext } from 'react'; | ||
defaultTheme = _ref.defaultTheme, | ||
routerLinkComponent = _ref.routerLinkComponent; | ||
routerLinkComponent = _ref.routerLinkComponent, | ||
UNSAFE_isThemingDisabled = _ref.UNSAFE_isThemingDisabled; | ||
var isInsideAppProvider = useContext(InsideAppProviderContext); | ||
@@ -23,11 +24,12 @@ if (isInsideAppProvider) { | ||
} | ||
var routerLinkProvider = /*#__PURE__*/React.createElement(RouterLinkProvider, { | ||
routerLinkComponent: routerLinkComponent | ||
}, children); | ||
return /*#__PURE__*/React.createElement(InsideAppProviderContext.Provider, { | ||
value: true | ||
}, /*#__PURE__*/React.createElement(ThemeProvider, { | ||
}, UNSAFE_isThemingDisabled ? routerLinkProvider : /*#__PURE__*/React.createElement(ThemeProvider, { | ||
defaultColorMode: defaultColorMode, | ||
defaultTheme: defaultTheme | ||
}, /*#__PURE__*/React.createElement(RouterLinkProvider, { | ||
routerLinkComponent: routerLinkComponent | ||
}, children))); | ||
}, routerLinkProvider)); | ||
} | ||
export default AppProvider; |
@@ -18,2 +18,11 @@ import React from 'react'; | ||
/** | ||
* Disables theming functionality. | ||
* This is intended for use in apps with existing | ||
* theming configuration that want to incrementally | ||
* adopt AppProvider. | ||
* | ||
* @warning Use with caution. This prop will be removed in a future release. | ||
*/ | ||
UNSAFE_isThemingDisabled?: boolean; | ||
/** | ||
* App content. | ||
@@ -30,3 +39,3 @@ */ | ||
*/ | ||
export declare function AppProvider({ children, defaultColorMode, defaultTheme, routerLinkComponent, }: AppProviderProps): JSX.Element; | ||
export declare function AppProvider({ children, defaultColorMode, defaultTheme, routerLinkComponent, UNSAFE_isThemingDisabled, }: AppProviderProps): JSX.Element; | ||
export default AppProvider; |
@@ -18,2 +18,11 @@ import React from 'react'; | ||
/** | ||
* Disables theming functionality. | ||
* This is intended for use in apps with existing | ||
* theming configuration that want to incrementally | ||
* adopt AppProvider. | ||
* | ||
* @warning Use with caution. This prop will be removed in a future release. | ||
*/ | ||
UNSAFE_isThemingDisabled?: boolean; | ||
/** | ||
* App content. | ||
@@ -30,3 +39,3 @@ */ | ||
*/ | ||
export declare function AppProvider({ children, defaultColorMode, defaultTheme, routerLinkComponent, }: AppProviderProps): JSX.Element; | ||
export declare function AppProvider({ children, defaultColorMode, defaultTheme, routerLinkComponent, UNSAFE_isThemingDisabled, }: AppProviderProps): JSX.Element; | ||
export default AppProvider; |
{ | ||
"name": "@atlaskit/app-provider", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "A top level provider for the Design System.", | ||
@@ -5,0 +5,0 @@ "author": "Atlassian Pty Ltd", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49220
1057