@atlaskit/editor-core 221.9.0 → 221.9.1

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,12 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 221.9.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c9c84b6b7437c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c9c84b6b7437c) -
8
+ refactor context panel styles
9
+
3
10
  ## 221.9.0
4
11
 
5
12
  ### Minor Changes
@@ -5,7 +5,6 @@
5
5
  ._18m915vq{overflow-y:hidden}
6
6
  ._18m91wug{overflow-y:auto}
7
7
  ._19bvpxbi{padding-left:var(--ds-space-200,1pc)}
8
- ._1bsbidpf{width:0}
9
8
  ._1bsbnklw{width:20pc}
10
9
  ._1reo15vq{overflow-x:hidden}
11
10
  ._4t3i1osq{height:100%}
@@ -8,7 +8,8 @@ Object.defineProperty(exports, "__esModule", {
8
8
  });
9
9
  exports.ContextPanelWrapperCompiled = exports.ContextPanelContentCompiled = void 0;
10
10
  require("./index-compiled.compiled.css");
11
- var React = _interopRequireWildcard(require("react"));
11
+ var _react = _interopRequireWildcard(require("react"));
12
+ var React = _react;
12
13
  var _runtime = require("@compiled/react/runtime");
13
14
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
14
15
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
@@ -23,46 +24,68 @@ var _excluded = ["children", "customWidth", "visible", "disableAnimation"],
23
24
  */
24
25
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
25
26
  var ANIM_SPEED_MS = 500;
27
+ var getContextPanelWidthStyle = function getContextPanelWidthStyle(_ref) {
28
+ var customWidth = _ref.customWidth,
29
+ visible = _ref.visible;
30
+ if (!visible) {
31
+ return {
32
+ width: 0
33
+ };
34
+ }
35
+ if (customWidth) {
36
+ return {
37
+ width: "".concat(customWidth, "px")
38
+ };
39
+ }
40
+ return undefined;
41
+ };
26
42
  var panelStyles = {
27
43
  panel: "_v5648l2w _1reo15vq _18m915vq _1bsbnklw _4t3i1osq _16qshh4h",
28
- panelHidden: "_1bsbidpf",
29
44
  disablePanelAnimation: "_v564glyw",
30
45
  content: "_v564e1q5 _vchhusvi _1bsbnklw _4t3i1osq _18m91wug",
31
46
  padding: "_ca0qpxbi _u5f3pxbi _n3tdze3t _19bvpxbi",
32
47
  customWidthOverflow: "_1reo15vq"
33
48
  };
34
- var ContextPanelWrapperCompiled = exports.ContextPanelWrapperCompiled = function ContextPanelWrapperCompiled(_ref) {
35
- var children = _ref.children,
36
- customWidth = _ref.customWidth,
37
- visible = _ref.visible,
38
- disableAnimation = _ref.disableAnimation,
39
- rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
49
+ var ContextPanelWrapperCompiled = exports.ContextPanelWrapperCompiled = function ContextPanelWrapperCompiled(_ref2) {
50
+ var children = _ref2.children,
51
+ customWidth = _ref2.customWidth,
52
+ visible = _ref2.visible,
53
+ disableAnimation = _ref2.disableAnimation,
54
+ rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
55
+ var widthStyle = (0, _react.useMemo)(function () {
56
+ return getContextPanelWidthStyle({
57
+ customWidth: customWidth,
58
+ visible: visible
59
+ });
60
+ }, [customWidth, visible]);
40
61
  return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
41
62
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic width cannot be expressed as static compiled CSS
42
- style: customWidth && visible ? {
43
- width: "".concat(customWidth, "px")
44
- } : undefined
63
+ style: widthStyle
45
64
  // eslint-disable-next-line react/jsx-props-no-spreading
46
65
  }, rest, {
47
- className: (0, _runtime.ax)([panelStyles.panel, customWidth && "", !visible && panelStyles.panelHidden, disableAnimation && panelStyles.disablePanelAnimation])
66
+ className: (0, _runtime.ax)([panelStyles.panel, customWidth && "", disableAnimation && panelStyles.disablePanelAnimation])
48
67
  }), children);
49
68
  };
50
69
 
51
70
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
52
- var ContextPanelContentCompiled = exports.ContextPanelContentCompiled = function ContextPanelContentCompiled(_ref2) {
53
- var children = _ref2.children,
54
- customWidth = _ref2.customWidth,
55
- visible = _ref2.visible,
56
- disableAnimation = _ref2.disableAnimation,
57
- hasPadding = _ref2.hasPadding,
58
- rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
71
+ var ContextPanelContentCompiled = exports.ContextPanelContentCompiled = function ContextPanelContentCompiled(_ref3) {
72
+ var children = _ref3.children,
73
+ customWidth = _ref3.customWidth,
74
+ visible = _ref3.visible,
75
+ disableAnimation = _ref3.disableAnimation,
76
+ hasPadding = _ref3.hasPadding,
77
+ rest = (0, _objectWithoutProperties2.default)(_ref3, _excluded2);
78
+ var widthStyle = (0, _react.useMemo)(function () {
79
+ return getContextPanelWidthStyle({
80
+ customWidth: customWidth,
81
+ visible: visible
82
+ });
83
+ }, [customWidth, visible]);
59
84
  return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
60
85
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic width cannot be expressed as static compiled CSS
61
- style: customWidth && visible ? {
62
- width: "".concat(customWidth, "px")
63
- } : undefined
86
+ style: widthStyle
64
87
  // eslint-disable-next-line react/jsx-props-no-spreading
65
88
  }, rest, {
66
- className: (0, _runtime.ax)([panelStyles.content, hasPadding && panelStyles.padding, customWidth && "", !visible && panelStyles.panelHidden, disableAnimation && panelStyles.disablePanelAnimation])
89
+ className: (0, _runtime.ax)([panelStyles.content, hasPadding && panelStyles.padding, customWidth && "", disableAnimation && panelStyles.disablePanelAnimation])
67
90
  }), children);
68
91
  };
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
8
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
9
- var version = exports.version = "221.8.3";
9
+ var version = exports.version = "221.9.0";
@@ -5,7 +5,6 @@
5
5
  ._18m915vq{overflow-y:hidden}
6
6
  ._18m91wug{overflow-y:auto}
7
7
  ._19bvpxbi{padding-left:var(--ds-space-200,1pc)}
8
- ._1bsbidpf{width:0}
9
8
  ._1bsbnklw{width:20pc}
10
9
  ._1reo15vq{overflow-x:hidden}
11
10
  ._4t3i1osq{height:100%}
@@ -9,12 +9,27 @@ import { ax, ix } from "@compiled/react/runtime";
9
9
  *
10
10
  * Cleanup: delete this file once the `platform_editor_core_non_ecc_static_css` experiment has shipped.
11
11
  */
12
-
12
+ import { useMemo } from 'react';
13
13
  import { akEditorContextPanelWidth, akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
14
14
  const ANIM_SPEED_MS = 500;
15
+ const getContextPanelWidthStyle = ({
16
+ customWidth,
17
+ visible
18
+ }) => {
19
+ if (!visible) {
20
+ return {
21
+ width: 0
22
+ };
23
+ }
24
+ if (customWidth) {
25
+ return {
26
+ width: `${customWidth}px`
27
+ };
28
+ }
29
+ return undefined;
30
+ };
15
31
  const panelStyles = {
16
32
  panel: "_v5648l2w _1reo15vq _18m915vq _1bsbnklw _4t3i1osq _16qshh4h",
17
- panelHidden: "_1bsbidpf",
18
33
  disablePanelAnimation: "_v564glyw",
19
34
  content: "_v564e1q5 _vchhusvi _1bsbnklw _4t3i1osq _18m91wug",
20
35
  padding: "_ca0qpxbi _u5f3pxbi _n3tdze3t _19bvpxbi",
@@ -26,15 +41,19 @@ export const ContextPanelWrapperCompiled = ({
26
41
  visible,
27
42
  disableAnimation,
28
43
  ...rest
29
- }) => /*#__PURE__*/React.createElement("div", _extends({
30
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic width cannot be expressed as static compiled CSS
31
- style: customWidth && visible ? {
32
- width: `${customWidth}px`
33
- } : undefined
34
- // eslint-disable-next-line react/jsx-props-no-spreading
35
- }, rest, {
36
- className: ax([panelStyles.panel, customWidth && "", !visible && panelStyles.panelHidden, disableAnimation && panelStyles.disablePanelAnimation])
37
- }), children);
44
+ }) => {
45
+ const widthStyle = useMemo(() => getContextPanelWidthStyle({
46
+ customWidth,
47
+ visible
48
+ }), [customWidth, visible]);
49
+ return /*#__PURE__*/React.createElement("div", _extends({
50
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic width cannot be expressed as static compiled CSS
51
+ style: widthStyle
52
+ // eslint-disable-next-line react/jsx-props-no-spreading
53
+ }, rest, {
54
+ className: ax([panelStyles.panel, customWidth && "", disableAnimation && panelStyles.disablePanelAnimation])
55
+ }), children);
56
+ };
38
57
 
39
58
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
40
59
  export const ContextPanelContentCompiled = ({
@@ -44,12 +63,16 @@ export const ContextPanelContentCompiled = ({
44
63
  disableAnimation,
45
64
  hasPadding,
46
65
  ...rest
47
- }) => /*#__PURE__*/React.createElement("div", _extends({
48
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic width cannot be expressed as static compiled CSS
49
- style: customWidth && visible ? {
50
- width: `${customWidth}px`
51
- } : undefined
52
- // eslint-disable-next-line react/jsx-props-no-spreading
53
- }, rest, {
54
- className: ax([panelStyles.content, hasPadding && panelStyles.padding, customWidth && "", !visible && panelStyles.panelHidden, disableAnimation && panelStyles.disablePanelAnimation])
55
- }), children);
66
+ }) => {
67
+ const widthStyle = useMemo(() => getContextPanelWidthStyle({
68
+ customWidth,
69
+ visible
70
+ }), [customWidth, visible]);
71
+ return /*#__PURE__*/React.createElement("div", _extends({
72
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic width cannot be expressed as static compiled CSS
73
+ style: widthStyle
74
+ // eslint-disable-next-line react/jsx-props-no-spreading
75
+ }, rest, {
76
+ className: ax([panelStyles.content, hasPadding && panelStyles.padding, customWidth && "", disableAnimation && panelStyles.disablePanelAnimation])
77
+ }), children);
78
+ };
@@ -1,3 +1,3 @@
1
1
  export const name = "@atlaskit/editor-core";
2
2
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
3
- export const version = "221.8.3";
3
+ export const version = "221.9.0";
@@ -5,7 +5,6 @@
5
5
  ._18m915vq{overflow-y:hidden}
6
6
  ._18m91wug{overflow-y:auto}
7
7
  ._19bvpxbi{padding-left:var(--ds-space-200,1pc)}
8
- ._1bsbidpf{width:0}
9
8
  ._1bsbnklw{width:20pc}
10
9
  ._1reo15vq{overflow-x:hidden}
11
10
  ._4t3i1osq{height:100%}
@@ -12,49 +12,71 @@ import { ax, ix } from "@compiled/react/runtime";
12
12
  *
13
13
  * Cleanup: delete this file once the `platform_editor_core_non_ecc_static_css` experiment has shipped.
14
14
  */
15
-
15
+ import { useMemo } from 'react';
16
16
  import { akEditorContextPanelWidth, akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
17
17
  var ANIM_SPEED_MS = 500;
18
+ var getContextPanelWidthStyle = function getContextPanelWidthStyle(_ref) {
19
+ var customWidth = _ref.customWidth,
20
+ visible = _ref.visible;
21
+ if (!visible) {
22
+ return {
23
+ width: 0
24
+ };
25
+ }
26
+ if (customWidth) {
27
+ return {
28
+ width: "".concat(customWidth, "px")
29
+ };
30
+ }
31
+ return undefined;
32
+ };
18
33
  var panelStyles = {
19
34
  panel: "_v5648l2w _1reo15vq _18m915vq _1bsbnklw _4t3i1osq _16qshh4h",
20
- panelHidden: "_1bsbidpf",
21
35
  disablePanelAnimation: "_v564glyw",
22
36
  content: "_v564e1q5 _vchhusvi _1bsbnklw _4t3i1osq _18m91wug",
23
37
  padding: "_ca0qpxbi _u5f3pxbi _n3tdze3t _19bvpxbi",
24
38
  customWidthOverflow: "_1reo15vq"
25
39
  };
26
- export var ContextPanelWrapperCompiled = function ContextPanelWrapperCompiled(_ref) {
27
- var children = _ref.children,
28
- customWidth = _ref.customWidth,
29
- visible = _ref.visible,
30
- disableAnimation = _ref.disableAnimation,
31
- rest = _objectWithoutProperties(_ref, _excluded);
40
+ export var ContextPanelWrapperCompiled = function ContextPanelWrapperCompiled(_ref2) {
41
+ var children = _ref2.children,
42
+ customWidth = _ref2.customWidth,
43
+ visible = _ref2.visible,
44
+ disableAnimation = _ref2.disableAnimation,
45
+ rest = _objectWithoutProperties(_ref2, _excluded);
46
+ var widthStyle = useMemo(function () {
47
+ return getContextPanelWidthStyle({
48
+ customWidth: customWidth,
49
+ visible: visible
50
+ });
51
+ }, [customWidth, visible]);
32
52
  return /*#__PURE__*/React.createElement("div", _extends({
33
53
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic width cannot be expressed as static compiled CSS
34
- style: customWidth && visible ? {
35
- width: "".concat(customWidth, "px")
36
- } : undefined
54
+ style: widthStyle
37
55
  // eslint-disable-next-line react/jsx-props-no-spreading
38
56
  }, rest, {
39
- className: ax([panelStyles.panel, customWidth && "", !visible && panelStyles.panelHidden, disableAnimation && panelStyles.disablePanelAnimation])
57
+ className: ax([panelStyles.panel, customWidth && "", disableAnimation && panelStyles.disablePanelAnimation])
40
58
  }), children);
41
59
  };
42
60
 
43
61
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
44
- export var ContextPanelContentCompiled = function ContextPanelContentCompiled(_ref2) {
45
- var children = _ref2.children,
46
- customWidth = _ref2.customWidth,
47
- visible = _ref2.visible,
48
- disableAnimation = _ref2.disableAnimation,
49
- hasPadding = _ref2.hasPadding,
50
- rest = _objectWithoutProperties(_ref2, _excluded2);
62
+ export var ContextPanelContentCompiled = function ContextPanelContentCompiled(_ref3) {
63
+ var children = _ref3.children,
64
+ customWidth = _ref3.customWidth,
65
+ visible = _ref3.visible,
66
+ disableAnimation = _ref3.disableAnimation,
67
+ hasPadding = _ref3.hasPadding,
68
+ rest = _objectWithoutProperties(_ref3, _excluded2);
69
+ var widthStyle = useMemo(function () {
70
+ return getContextPanelWidthStyle({
71
+ customWidth: customWidth,
72
+ visible: visible
73
+ });
74
+ }, [customWidth, visible]);
51
75
  return /*#__PURE__*/React.createElement("div", _extends({
52
76
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- dynamic width cannot be expressed as static compiled CSS
53
- style: customWidth && visible ? {
54
- width: "".concat(customWidth, "px")
55
- } : undefined
77
+ style: widthStyle
56
78
  // eslint-disable-next-line react/jsx-props-no-spreading
57
79
  }, rest, {
58
- className: ax([panelStyles.content, hasPadding && panelStyles.padding, customWidth && "", !visible && panelStyles.panelHidden, disableAnimation && panelStyles.disablePanelAnimation])
80
+ className: ax([panelStyles.content, hasPadding && panelStyles.padding, customWidth && "", disableAnimation && panelStyles.disablePanelAnimation])
59
81
  }), children);
60
82
  };
@@ -1,3 +1,3 @@
1
1
  export var name = "@atlaskit/editor-core";
2
2
  // eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
3
- export var version = "221.8.3";
3
+ export var version = "221.9.0";
@@ -1,7 +1,6 @@
1
1
  /**
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
- * @jsxFrag
5
4
  */
6
5
  import React from 'react';
7
6
  import type { OptionalPlugin, PublicPluginAPI } from '@atlaskit/editor-common/types';
@@ -1,14 +1,3 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- * Compiled migration: platform_editor_core_non_ecc_static_css
5
- */
6
- /**
7
- * Compiled branch of the `platform_editor_core_non_ecc_static_css` experiment.
8
- * Used via `componentWithCondition` in `index.tsx`.
9
- *
10
- * Cleanup: delete this file once the `platform_editor_core_non_ecc_static_css` experiment has shipped.
11
- */
12
1
  import type { HTMLAttributes } from 'react';
13
2
  export interface ContextPanelWrapperProps extends HTMLAttributes<HTMLDivElement> {
14
3
  customWidth?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "221.9.0",
3
+ "version": "221.9.1",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"