@atlaskit/flag 15.5.1 → 15.5.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,5 +1,14 @@
1
1
  # @atlaskit/flag
2
2
 
3
+ ## 15.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#101206](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/101206)
8
+ [`e7b8d483e629`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e7b8d483e629) -
9
+ Introduce a new prop shouldRenderToParent on FlagProvider to render flag group directly to
10
+ parent instead of Portal
11
+
3
12
  ## 15.5.1
4
13
 
5
14
  ### Patch Changes
@@ -15,7 +15,7 @@ var _flagGroup = require("./flag-group");
15
15
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
16
16
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
17
17
  var packageName = "@atlaskit/flag";
18
- var packageVersion = "15.5.1";
18
+ var packageVersion = "15.5.2";
19
19
  var AUTO_DISMISS_SECONDS = exports.AUTO_DISMISS_SECONDS = 8;
20
20
 
21
21
  /**
@@ -42,7 +42,8 @@ var getUniqueId = function () {
42
42
  };
43
43
  }();
44
44
  function FlagsProvider(_ref) {
45
- var children = _ref.children;
45
+ var children = _ref.children,
46
+ shouldRenderToParent = _ref.shouldRenderToParent;
46
47
  var _useState = (0, _react.useState)([]),
47
48
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
48
49
  flags = _useState2[0],
@@ -84,7 +85,8 @@ function FlagsProvider(_ref) {
84
85
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(FlagContext.Provider, {
85
86
  value: api
86
87
  }, children), /*#__PURE__*/_react.default.createElement(_flagGroup.default, {
87
- onDismissed: removeFlag
88
+ onDismissed: removeFlag,
89
+ shouldRenderToParent: shouldRenderToParent
88
90
  }, flags.map(function (flag) {
89
91
  var isAutoDismiss = flag.isAutoDismiss,
90
92
  restProps = (0, _objectWithoutProperties2.default)(flag, _excluded);
package/dist/cjs/flag.js CHANGED
@@ -52,7 +52,7 @@ var flagWrapperStyles = (0, _react2.css)({
52
52
  var analyticsAttributes = {
53
53
  componentName: 'flag',
54
54
  packageName: "@atlaskit/flag",
55
- packageVersion: "15.5.1"
55
+ packageVersion: "15.5.2"
56
56
  };
57
57
  var transitionStyles = (0, _react2.css)({
58
58
  flexGrow: 1,
@@ -5,7 +5,7 @@ import noop from '@atlaskit/ds-lib/noop';
5
5
  import Flag from './flag';
6
6
  import { useFlagGroup } from './flag-group';
7
7
  const packageName = "@atlaskit/flag";
8
- const packageVersion = "15.5.1";
8
+ const packageVersion = "15.5.2";
9
9
  export const AUTO_DISMISS_SECONDS = 8;
10
10
 
11
11
  /**
@@ -21,7 +21,8 @@ const getUniqueId = (() => {
21
21
  return () => `flag-provider-unique-id:${count++}`;
22
22
  })();
23
23
  export function FlagsProvider({
24
- children
24
+ children,
25
+ shouldRenderToParent
25
26
  }) {
26
27
  const [flags, setFlags] = useState([]);
27
28
  const removeFlag = useCallback(id => {
@@ -56,7 +57,8 @@ export function FlagsProvider({
56
57
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FlagContext.Provider, {
57
58
  value: api
58
59
  }, children), /*#__PURE__*/React.createElement(FlagGroup, {
59
- onDismissed: removeFlag
60
+ onDismissed: removeFlag,
61
+ shouldRenderToParent: shouldRenderToParent
60
62
  }, flags.map(flag => {
61
63
  const {
62
64
  isAutoDismiss,
@@ -42,7 +42,7 @@ const flagWrapperStyles = css({
42
42
  const analyticsAttributes = {
43
43
  componentName: 'flag',
44
44
  packageName: "@atlaskit/flag",
45
- packageVersion: "15.5.1"
45
+ packageVersion: "15.5.2"
46
46
  };
47
47
  const transitionStyles = css({
48
48
  flexGrow: 1,
@@ -5,7 +5,7 @@ import noop from '@atlaskit/ds-lib/noop';
5
5
  import Flag from './flag';
6
6
  import { useFlagGroup } from './flag-group';
7
7
  var packageName = "@atlaskit/flag";
8
- var packageVersion = "15.5.1";
8
+ var packageVersion = "15.5.2";
9
9
  export var AUTO_DISMISS_SECONDS = 8;
10
10
 
11
11
  /**
@@ -30,7 +30,8 @@ var getUniqueId = function () {
30
30
  };
31
31
  }();
32
32
  export function FlagsProvider(_ref) {
33
- var children = _ref.children;
33
+ var children = _ref.children,
34
+ shouldRenderToParent = _ref.shouldRenderToParent;
34
35
  var _useState = useState([]),
35
36
  _useState2 = _slicedToArray(_useState, 2),
36
37
  flags = _useState2[0],
@@ -72,7 +73,8 @@ export function FlagsProvider(_ref) {
72
73
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FlagContext.Provider, {
73
74
  value: api
74
75
  }, children), /*#__PURE__*/React.createElement(FlagGroup, {
75
- onDismissed: removeFlag
76
+ onDismissed: removeFlag,
77
+ shouldRenderToParent: shouldRenderToParent
76
78
  }, flags.map(function (flag) {
77
79
  var isAutoDismiss = flag.isAutoDismiss,
78
80
  restProps = _objectWithoutProperties(flag, _excluded);
package/dist/esm/flag.js CHANGED
@@ -46,7 +46,7 @@ var flagWrapperStyles = css({
46
46
  var analyticsAttributes = {
47
47
  componentName: 'flag',
48
48
  packageName: "@atlaskit/flag",
49
- packageVersion: "15.5.1"
49
+ packageVersion: "15.5.2"
50
50
  };
51
51
  var transitionStyles = css({
52
52
  flexGrow: 1,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { FlagPropsWithoutId } from './types';
2
+ import { type FlagPropsWithoutId } from './types';
3
3
  type FlagId = string | number;
4
4
  export type Combine<First, Second> = Omit<First, keyof Second> & Second;
5
5
  export interface CreateFlagArgs extends FlagPropsWithoutId {
@@ -26,8 +26,9 @@ export type FlagAPI = {
26
26
  * - [Examples](https://atlassian.design/components/flag/flags-provider/examples#using-showflags)
27
27
  */
28
28
  export declare function useFlags(): FlagAPI;
29
- export declare function FlagsProvider({ children }: {
29
+ export declare function FlagsProvider({ children, shouldRenderToParent, }: {
30
30
  children: React.ReactNode;
31
+ shouldRenderToParent?: boolean;
31
32
  }): JSX.Element;
32
33
  export declare const withFlagsProvider: (fn: () => React.ReactNode) => React.ReactNode;
33
34
  export {};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { FlagPropsWithoutId } from './types';
2
+ import { type FlagPropsWithoutId } from './types';
3
3
  type FlagId = string | number;
4
4
  export type Combine<First, Second> = Omit<First, keyof Second> & Second;
5
5
  export interface CreateFlagArgs extends FlagPropsWithoutId {
@@ -26,8 +26,9 @@ export type FlagAPI = {
26
26
  * - [Examples](https://atlassian.design/components/flag/flags-provider/examples#using-showflags)
27
27
  */
28
28
  export declare function useFlags(): FlagAPI;
29
- export declare function FlagsProvider({ children }: {
29
+ export declare function FlagsProvider({ children, shouldRenderToParent, }: {
30
30
  children: React.ReactNode;
31
+ shouldRenderToParent?: boolean;
31
32
  }): JSX.Element;
32
33
  export declare const withFlagsProvider: (fn: () => React.ReactNode) => React.ReactNode;
33
34
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/flag",
3
- "version": "15.5.1",
3
+ "version": "15.5.2",
4
4
  "description": "A flag is used for confirmations, alerts, and acknowledgments that require minimal user interaction, often displayed using a flag group.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -49,12 +49,12 @@
49
49
  "@atlaskit/analytics-next": "^9.3.0",
50
50
  "@atlaskit/button": "^17.14.0",
51
51
  "@atlaskit/ds-lib": "^2.3.0",
52
- "@atlaskit/icon": "^22.1.0",
53
- "@atlaskit/motion": "^1.5.0",
54
- "@atlaskit/portal": "^4.4.0",
55
- "@atlaskit/primitives": "^6.0.0",
56
- "@atlaskit/theme": "^12.7.0",
57
- "@atlaskit/tokens": "^1.45.0",
52
+ "@atlaskit/icon": "^22.2.0",
53
+ "@atlaskit/motion": "^1.6.0",
54
+ "@atlaskit/portal": "^4.5.0",
55
+ "@atlaskit/primitives": "^6.2.0",
56
+ "@atlaskit/theme": "^12.8.0",
57
+ "@atlaskit/tokens": "^1.48.0",
58
58
  "@atlaskit/visually-hidden": "^1.3.0",
59
59
  "@babel/runtime": "^7.0.0",
60
60
  "@emotion/react": "^11.7.1"