@atlaskit/app-provider 1.3.0 → 1.3.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.
package/CHANGELOG.md CHANGED
@@ -1,70 +1,110 @@
1
1
  # @atlaskit/app-provider
2
2
 
3
+ ## 1.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#89307](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89307)
8
+ [`5e4a7780400d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5e4a7780400d) -
9
+ Adding new functionality to allow easier migration of theming.
10
+
11
+ ## 1.3.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [#94316](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94316)
16
+ [`35fd5ed8e1d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35fd5ed8e1d7) -
17
+ Upgrading internal dependency `bind-event-listener` to `@^3.0.0`
18
+
3
19
  ## 1.3.0
4
20
 
5
21
  ### Minor Changes
6
22
 
7
- - [#88515](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88515) [`ef20ec7145b7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ef20ec7145b7) - Add type export for `RouterLinkComponent` to enable router link configuration
23
+ - [#88515](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88515)
24
+ [`ef20ec7145b7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ef20ec7145b7) -
25
+ Add type export for `RouterLinkComponent` to enable router link configuration
8
26
 
9
27
  ## 1.2.0
10
28
 
11
29
  ### Minor Changes
12
30
 
13
- - [#87603](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87603) [`07a08e440f76`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/07a08e440f76) - Added support for React 18
31
+ - [#87603](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87603)
32
+ [`07a08e440f76`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/07a08e440f76) -
33
+ Added support for React 18
14
34
 
15
35
  ## 1.1.0
16
36
 
17
37
  ### Minor Changes
18
38
 
19
- - [#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`
39
+ - [#87244](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87244)
40
+ [`7d9d0320d3da`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7d9d0320d3da) -
41
+ Add option to disable theming features with `UNSAFE_isThemingDisabled`
20
42
 
21
43
  ## 1.0.1
22
44
 
23
45
  ### Patch Changes
24
46
 
25
- - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116) [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) - Upgrade Typescript from `4.9.5` to `5.4.2`
47
+ - [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)
48
+ [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -
49
+ Upgrade Typescript from `4.9.5` to `5.4.2`
26
50
 
27
51
  ## 1.0.0
28
52
 
29
53
  ### Major Changes
30
54
 
31
- - [#69683](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69683) [`203c0f3c8b03`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/203c0f3c8b03) - Stable v1 release of app provider
55
+ - [#69683](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/69683)
56
+ [`203c0f3c8b03`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/203c0f3c8b03) -
57
+ Stable v1 release of app provider
32
58
 
33
59
  ## 0.4.0
34
60
 
35
61
  ### Minor Changes
36
62
 
37
- - [#42305](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42305) [`4c9d4a7be34`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4c9d4a7be34) - - Router link components are now required to forward refs
38
- - The `useRouterLink()` hook now supports generic router link configuration: `useRouterLink<YourLinkConfigObject>()`
63
+ - [#42305](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42305)
64
+ [`4c9d4a7be34`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4c9d4a7be34) - -
65
+ Router link components are now required to forward refs
66
+ - The `useRouterLink()` hook now supports generic router link configuration:
67
+ `useRouterLink<YourLinkConfigObject>()`
39
68
 
40
69
  ### Patch Changes
41
70
 
42
- - [#42305](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42305) [`4c9d4a7be34`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4c9d4a7be34) - - Fixes a bug with router link component generic `href` prop typings where non-object types were allowed
71
+ - [#42305](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42305)
72
+ [`4c9d4a7be34`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4c9d4a7be34) - -
73
+ Fixes a bug with router link component generic `href` prop typings where non-object types were
74
+ allowed
43
75
 
44
76
  ## 0.3.1
45
77
 
46
78
  ### Patch Changes
47
79
 
48
- - [#42130](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42130) [`b9b8b2c1e0a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b9b8b2c1e0a) - Removed unused dev dependencies `@atlaskit/primitives` and `@atlaskit/dropdown-menu`
80
+ - [#42130](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42130)
81
+ [`b9b8b2c1e0a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b9b8b2c1e0a) -
82
+ Removed unused dev dependencies `@atlaskit/primitives` and `@atlaskit/dropdown-menu`
49
83
 
50
84
  ## 0.3.0
51
85
 
52
86
  ### Minor Changes
53
87
 
54
- - [#42091](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42091) [`4ec3142822b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ec3142822b) - Add the `routerLinkComponent` prop to support router link configuration within the Design System.
88
+ - [#42091](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42091)
89
+ [`4ec3142822b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ec3142822b) - Add
90
+ the `routerLinkComponent` prop to support router link configuration within the Design System.
55
91
 
56
92
  ## 0.2.0
57
93
 
58
94
  ### Minor Changes
59
95
 
60
- - [#41931](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41931) [`5df5614a6b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5df5614a6b5) - defaultTheme now applies default sub-themes when ommited.
96
+ - [#41931](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41931)
97
+ [`5df5614a6b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5df5614a6b5) -
98
+ defaultTheme now applies default sub-themes when ommited.
61
99
 
62
100
  ## 0.1.0
63
101
 
64
102
  ### Minor Changes
65
103
 
66
- - [#41035](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41035) [`e7344823cff`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e7344823cff) - Created the AppProvider component with support for theming.
104
+ - [#41035](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41035)
105
+ [`e7344823cff`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e7344823cff) -
106
+ Created the AppProvider component with support for theming.
67
107
 
68
108
  ## 0.0.1
69
109
 
70
- - Scaffold AppProvider component.
110
+ - Scaffold AppProvider component.
@@ -4,7 +4,7 @@ order: 0
4
4
 
5
5
  import defaultExample from '../../examples/constellation/0-default';
6
6
  import themeSwitcherExample from '../../examples/constellation/1-theme-switcher';
7
- import RouterLinkComponentExample from '../../examples/constellation/2-router-link-component';
7
+ import routerLinkComponentExample from '../../examples/constellation/2-router-link-component';
8
8
 
9
9
  ## Theming
10
10
 
@@ -32,12 +32,18 @@ The `useTheme` hook can be used to get the active themes. The `useSetTheme` hook
32
32
 
33
33
  The `routerLinkComponent` prop provides support for configuring router links within Design System components.
34
34
 
35
- Support for this is limited as Design System components are being updated, starting with [Button](/components/button/button-new/examples).
35
+ Support for this is limited as Design System components are being updated, starting with:
36
+
37
+ - [LinkButton](/components/button/link-button/examples).
38
+ - [LinkIconButton](/components/button/icon-button/examples#link-icon-button).
39
+ - [Link](/components/link/examples).
40
+ - [Anchor primitive](/components/primitives/anchor/examples).
36
41
 
37
42
  This example shows how links can be configured to utilize the router link component supplied by [React Resource Router](https://github.com/atlassian-labs/react-resource-router), however any routing library can be used.
38
43
 
39
44
  <Example
40
- Component={RouterLinkComponentExample}
45
+ Component={routerLinkComponentExample.example}
46
+ source={routerLinkComponentExample.code}
41
47
  appearance="source-only"
42
48
  packageName="@atlaskit/app-provider"
43
49
  />
package/dist/cjs/index.js CHANGED
@@ -4,6 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ Object.defineProperty(exports, "UNSAFE_useColorModeForMigration", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _themeProvider.UNSAFE_useColorModeForMigration;
11
+ }
12
+ });
7
13
  Object.defineProperty(exports, "default", {
8
14
  enumerable: true,
9
15
  get: function get() {
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.ThemeProvider = ThemeProvider;
9
+ exports.UNSAFE_useColorModeForMigration = UNSAFE_useColorModeForMigration;
9
10
  exports.default = void 0;
10
11
  exports.useColorMode = useColorMode;
11
12
  exports.useSetColorMode = useSetColorMode;
@@ -30,6 +31,18 @@ var SetColorModeContext = /*#__PURE__*/(0, _react.createContext)(undefined);
30
31
  var ThemeContext = /*#__PURE__*/(0, _react.createContext)(undefined);
31
32
  var SetThemeContext = /*#__PURE__*/(0, _react.createContext)(undefined);
32
33
 
34
+ /**
35
+ * __UNSAFE_useColorModeForMigration()__
36
+ *
37
+ * Returns the current color mode when inside the app provider.
38
+ * Unlike useColorMode, this utility returns undefined, instead of throwing an error, when the app provider is missing.
39
+ * This allows it to be used by components that need to operate with and without an app provider.
40
+ */
41
+ function UNSAFE_useColorModeForMigration() {
42
+ var value = (0, _react.useContext)(ColorModeContext);
43
+ return value;
44
+ }
45
+
33
46
  /**
34
47
  * __useColorMode()__
35
48
  *
@@ -1,4 +1,4 @@
1
1
  export { default } from './app-provider';
2
- export { useColorMode, useSetColorMode, useSetTheme, useTheme } from './theme-provider';
2
+ export { UNSAFE_useColorModeForMigration, useColorMode, useSetColorMode, useSetTheme, useTheme } from './theme-provider';
3
3
  import useRouterLink from './router-link-provider/hooks/use-router-link';
4
4
  export { useRouterLink };
@@ -11,6 +11,18 @@ const SetColorModeContext = /*#__PURE__*/createContext(undefined);
11
11
  const ThemeContext = /*#__PURE__*/createContext(undefined);
12
12
  const SetThemeContext = /*#__PURE__*/createContext(undefined);
13
13
 
14
+ /**
15
+ * __UNSAFE_useColorModeForMigration()__
16
+ *
17
+ * Returns the current color mode when inside the app provider.
18
+ * Unlike useColorMode, this utility returns undefined, instead of throwing an error, when the app provider is missing.
19
+ * This allows it to be used by components that need to operate with and without an app provider.
20
+ */
21
+ export function UNSAFE_useColorModeForMigration() {
22
+ const value = useContext(ColorModeContext);
23
+ return value;
24
+ }
25
+
14
26
  /**
15
27
  * __useColorMode()__
16
28
  *
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export { default } from './app-provider';
2
- export { useColorMode, useSetColorMode, useSetTheme, useTheme } from './theme-provider';
2
+ export { UNSAFE_useColorModeForMigration, useColorMode, useSetColorMode, useSetTheme, useTheme } from './theme-provider';
3
3
  import useRouterLink from './router-link-provider/hooks/use-router-link';
4
4
  export { useRouterLink };
@@ -15,6 +15,18 @@ var SetColorModeContext = /*#__PURE__*/createContext(undefined);
15
15
  var ThemeContext = /*#__PURE__*/createContext(undefined);
16
16
  var SetThemeContext = /*#__PURE__*/createContext(undefined);
17
17
 
18
+ /**
19
+ * __UNSAFE_useColorModeForMigration()__
20
+ *
21
+ * Returns the current color mode when inside the app provider.
22
+ * Unlike useColorMode, this utility returns undefined, instead of throwing an error, when the app provider is missing.
23
+ * This allows it to be used by components that need to operate with and without an app provider.
24
+ */
25
+ export function UNSAFE_useColorModeForMigration() {
26
+ var value = useContext(ColorModeContext);
27
+ return value;
28
+ }
29
+
18
30
  /**
19
31
  * __useColorMode()__
20
32
  *
@@ -1,5 +1,5 @@
1
1
  export { default } from './app-provider';
2
- export { useColorMode, useSetColorMode, useSetTheme, useTheme, } from './theme-provider';
2
+ export { UNSAFE_useColorModeForMigration, useColorMode, useSetColorMode, useSetTheme, useTheme, } from './theme-provider';
3
3
  export { type RouterLinkComponent, type RouterLinkComponentProps, } from './router-link-provider';
4
4
  import useRouterLink from './router-link-provider/hooks/use-router-link';
5
5
  export { useRouterLink };
@@ -3,6 +3,14 @@ import { type ThemeState } from '@atlaskit/tokens';
3
3
  export type Theme = Omit<ThemeState, 'colorMode' | 'contrastMode'>;
4
4
  export type ColorMode = 'light' | 'dark' | 'auto';
5
5
  export type ReconciledColorMode = Exclude<ColorMode, 'auto'>;
6
+ /**
7
+ * __UNSAFE_useColorModeForMigration()__
8
+ *
9
+ * Returns the current color mode when inside the app provider.
10
+ * Unlike useColorMode, this utility returns undefined, instead of throwing an error, when the app provider is missing.
11
+ * This allows it to be used by components that need to operate with and without an app provider.
12
+ */
13
+ export declare function UNSAFE_useColorModeForMigration(): ReconciledColorMode | undefined;
6
14
  /**
7
15
  * __useColorMode()__
8
16
  *
@@ -1,5 +1,5 @@
1
1
  export { default } from './app-provider';
2
- export { useColorMode, useSetColorMode, useSetTheme, useTheme, } from './theme-provider';
2
+ export { UNSAFE_useColorModeForMigration, useColorMode, useSetColorMode, useSetTheme, useTheme, } from './theme-provider';
3
3
  export { type RouterLinkComponent, type RouterLinkComponentProps, } from './router-link-provider';
4
4
  import useRouterLink from './router-link-provider/hooks/use-router-link';
5
5
  export { useRouterLink };
@@ -3,6 +3,14 @@ import { type ThemeState } from '@atlaskit/tokens';
3
3
  export type Theme = Omit<ThemeState, 'colorMode' | 'contrastMode'>;
4
4
  export type ColorMode = 'light' | 'dark' | 'auto';
5
5
  export type ReconciledColorMode = Exclude<ColorMode, 'auto'>;
6
+ /**
7
+ * __UNSAFE_useColorModeForMigration()__
8
+ *
9
+ * Returns the current color mode when inside the app provider.
10
+ * Unlike useColorMode, this utility returns undefined, instead of throwing an error, when the app provider is missing.
11
+ * This allows it to be used by components that need to operate with and without an app provider.
12
+ */
13
+ export declare function UNSAFE_useColorModeForMigration(): ReconciledColorMode | undefined;
6
14
  /**
7
15
  * __useColorMode()__
8
16
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/app-provider",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "A top level provider for the Design System.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -39,16 +39,16 @@
39
39
  ".": "./src/index.tsx"
40
40
  },
41
41
  "dependencies": {
42
- "@atlaskit/tokens": "^1.43.0",
42
+ "@atlaskit/tokens": "^1.49.0",
43
43
  "@babel/runtime": "^7.0.0",
44
- "bind-event-listener": "^2.1.1"
44
+ "bind-event-listener": "^3.0.0"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": "^16.8.0 || ^17.0.0 || ~18.2.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@af/visual-regression": "*",
51
- "@atlaskit/ds-lib": "^2.2.0",
51
+ "@atlaskit/ds-lib": "^2.3.0",
52
52
  "@atlaskit/ssr": "*",
53
53
  "@atlaskit/visual-regression": "*",
54
54
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
@@ -92,6 +92,6 @@
92
92
  ]
93
93
  }
94
94
  },
95
- "homepage": "https://atlassian.design/components",
95
+ "homepage": "https://atlassian.design/components/app-provider",
96
96
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
97
97
  }