@atlaskit/editor-plugin-layout 8.1.10 → 8.1.12

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,24 @@
1
1
  # @atlaskit/editor-plugin-layout
2
2
 
3
+ ## 8.1.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [`1bd298ad0a152`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1bd298ad0a152) -
8
+ [ux] EDITOR-6280 Clean up platform_editor_block_menu_v2_patch_3 to fix icon and copy in jira block
9
+ menu
10
+ - Updated dependencies
11
+
12
+ ## 8.1.11
13
+
14
+ ### Patch Changes
15
+
16
+ - [`8ad443c7b22d0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8ad443c7b22d0) -
17
+ Support 'max' editor appearance for layout column resize handle when
18
+ platform_editor_layout_column_resize_handle experiment is enabled; guard column divider
19
+ decorations behind layout resizing plugin availability check
20
+ - Updated dependencies
21
+
3
22
  ## 8.1.10
4
23
 
5
24
  ### Patch Changes
@@ -94,7 +94,7 @@ var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
94
94
  return (0, _main.default)(options);
95
95
  }
96
96
  }];
97
- if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width') && api && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
97
+ if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width' || options.editorAppearance === 'max' && (0, _experiments.editorExperiment)('platform_editor_layout_column_resize_handle', true)) && api && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
98
98
  plugins.push({
99
99
  name: 'layoutResizing',
100
100
  plugin: function plugin(_ref2) {
@@ -20,6 +20,7 @@ var _actions = require("./actions");
20
20
  var _columnResizeDivider = require("./column-resize-divider");
21
21
  var _consts = require("./consts");
22
22
  var _pluginKey = require("./plugin-key");
23
+ var _resizing = require("./resizing");
23
24
  var _utils3 = require("./utils");
24
25
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25
26
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -142,7 +143,8 @@ var _default = exports.default = function _default(options) {
142
143
  props: {
143
144
  decorations: function decorations(state) {
144
145
  var layoutState = _pluginKey.pluginKey.getState(state);
145
- if ((0, _experiments.editorExperiment)('advanced_layouts', true) && (0, _experiments.editorExperiment)('platform_editor_layout_column_resize_handle', true)) {
146
+ var isLayoutResizingPluginAvailable = _resizing.pluginKey.get(state) !== undefined;
147
+ if ((0, _experiments.editorExperiment)('advanced_layouts', true) && (0, _experiments.editorExperiment)('platform_editor_layout_column_resize_handle', true) && isLayoutResizingPluginAvailable) {
146
148
  var dividerDecorations = (0, _columnResizeDivider.getColumnDividerDecorations)(state, editorViewRef);
147
149
  var selectedDecorations = layoutState.pos !== null ? getNodeDecoration(layoutState.pos, state.doc.nodeAt(layoutState.pos)) : [];
148
150
  var allDecorations = [].concat((0, _toConsumableArray2.default)(selectedDecorations), (0, _toConsumableArray2.default)(dividerDecorations));
@@ -14,7 +14,6 @@ var _analytics = require("@atlaskit/editor-common/analytics");
14
14
  var _messages = require("@atlaskit/editor-common/messages");
15
15
  var _editorToolbar = require("@atlaskit/editor-toolbar");
16
16
  var _layoutTwoColumns = _interopRequireDefault(require("@atlaskit/icon/core/layout-two-columns"));
17
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
17
  var styles = {
19
18
  svgOverflow: "_1wrmewfl _172sewfl"
20
19
  };
@@ -39,21 +38,14 @@ var LayoutBlockMenuItem = function LayoutBlockMenuItem(_ref) {
39
38
  }) : null;
40
39
  });
41
40
  };
42
-
43
- // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
44
- // Adds size="small" to icons for better visual consistency in block menu.
45
- // Adds overflow: visible to SVGs to fix when view port is in different zoom level, sometimes the right edge of the icon is cut off.
46
- // To clean up: remove conditionals, keep only size="small" version and always apply svgOverflowStyles wrapper.
47
- var iconSize = (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3') ? 'small' : undefined;
48
- var icon = /*#__PURE__*/_react.default.createElement(_layoutTwoColumns.default, {
49
- label: "",
50
- size: iconSize
51
- });
52
41
  return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
53
42
  onClick: handleClick,
54
- elemBefore: (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3') ? /*#__PURE__*/_react.default.createElement("span", {
43
+ elemBefore: /*#__PURE__*/_react.default.createElement("span", {
55
44
  className: (0, _runtime.ax)([styles.svgOverflow])
56
- }, icon) : icon
45
+ }, /*#__PURE__*/_react.default.createElement(_layoutTwoColumns.default, {
46
+ label: "",
47
+ size: "small"
48
+ }))
57
49
  }, formatMessage(_messages.blockMenuMessages.layout));
58
50
  };
59
51
  var createLayoutBlockMenuItem = exports.createLayoutBlockMenuItem = function createLayoutBlockMenuItem(api) {
@@ -85,7 +85,7 @@ export const layoutPlugin = ({
85
85
  name: 'layout',
86
86
  plugin: () => createLayoutPlugin(options)
87
87
  }];
88
- if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width') && api && editorExperiment('advanced_layouts', true)) {
88
+ if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width' || options.editorAppearance === 'max' && editorExperiment('platform_editor_layout_column_resize_handle', true)) && api && editorExperiment('advanced_layouts', true)) {
89
89
  plugins.push({
90
90
  name: 'layoutResizing',
91
91
  plugin: ({
@@ -11,6 +11,7 @@ import { fixColumnSizes, fixColumnStructure, getSelectedLayout } from './actions
11
11
  import { getColumnDividerDecorations } from './column-resize-divider';
12
12
  import { EVEN_DISTRIBUTED_COL_WIDTHS } from './consts';
13
13
  import { pluginKey } from './plugin-key';
14
+ import { pluginKey as layoutResizingPluginKey } from './resizing';
14
15
  import { getMaybeLayoutSection } from './utils';
15
16
  export const DEFAULT_LAYOUT = 'two_equal';
16
17
  const isWholeSelectionInsideLayoutColumn = state => {
@@ -136,7 +137,8 @@ export default (options => {
136
137
  props: {
137
138
  decorations(state) {
138
139
  const layoutState = pluginKey.getState(state);
139
- if (editorExperiment('advanced_layouts', true) && editorExperiment('platform_editor_layout_column_resize_handle', true)) {
140
+ const isLayoutResizingPluginAvailable = layoutResizingPluginKey.get(state) !== undefined;
141
+ if (editorExperiment('advanced_layouts', true) && editorExperiment('platform_editor_layout_column_resize_handle', true) && isLayoutResizingPluginAvailable) {
140
142
  const dividerDecorations = getColumnDividerDecorations(state, editorViewRef);
141
143
  const selectedDecorations = layoutState.pos !== null ? getNodeDecoration(layoutState.pos, state.doc.nodeAt(layoutState.pos)) : [];
142
144
  const allDecorations = [...selectedDecorations, ...dividerDecorations];
@@ -7,7 +7,6 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
7
7
  import { blockMenuMessages } from '@atlaskit/editor-common/messages';
8
8
  import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
9
9
  import LayoutTwoColumnsIcon from '@atlaskit/icon/core/layout-two-columns';
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
10
  const styles = {
12
11
  svgOverflow: "_1wrmewfl _172sewfl"
13
12
  };
@@ -35,21 +34,14 @@ const LayoutBlockMenuItem = ({
35
34
  }) : null;
36
35
  });
37
36
  };
38
-
39
- // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
40
- // Adds size="small" to icons for better visual consistency in block menu.
41
- // Adds overflow: visible to SVGs to fix when view port is in different zoom level, sometimes the right edge of the icon is cut off.
42
- // To clean up: remove conditionals, keep only size="small" version and always apply svgOverflowStyles wrapper.
43
- const iconSize = fg('platform_editor_block_menu_v2_patch_3') ? 'small' : undefined;
44
- const icon = /*#__PURE__*/React.createElement(LayoutTwoColumnsIcon, {
45
- label: "",
46
- size: iconSize
47
- });
48
37
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
49
38
  onClick: handleClick,
50
- elemBefore: fg('platform_editor_block_menu_v2_patch_3') ? /*#__PURE__*/React.createElement("span", {
39
+ elemBefore: /*#__PURE__*/React.createElement("span", {
51
40
  className: ax([styles.svgOverflow])
52
- }, icon) : icon
41
+ }, /*#__PURE__*/React.createElement(LayoutTwoColumnsIcon, {
42
+ label: "",
43
+ size: "small"
44
+ }))
53
45
  }, formatMessage(blockMenuMessages.layout));
54
46
  };
55
47
  export const createLayoutBlockMenuItem = api => {
@@ -88,7 +88,7 @@ export var layoutPlugin = function layoutPlugin(_ref) {
88
88
  return createLayoutPlugin(options);
89
89
  }
90
90
  }];
91
- if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width') && api && editorExperiment('advanced_layouts', true)) {
91
+ if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width' || options.editorAppearance === 'max' && editorExperiment('platform_editor_layout_column_resize_handle', true)) && api && editorExperiment('advanced_layouts', true)) {
92
92
  plugins.push({
93
93
  name: 'layoutResizing',
94
94
  plugin: function plugin(_ref2) {
@@ -15,6 +15,7 @@ import { fixColumnSizes, fixColumnStructure, getSelectedLayout } from './actions
15
15
  import { getColumnDividerDecorations } from './column-resize-divider';
16
16
  import { EVEN_DISTRIBUTED_COL_WIDTHS } from './consts';
17
17
  import { pluginKey } from './plugin-key';
18
+ import { pluginKey as layoutResizingPluginKey } from './resizing';
18
19
  import { getMaybeLayoutSection } from './utils';
19
20
  export var DEFAULT_LAYOUT = 'two_equal';
20
21
  var isWholeSelectionInsideLayoutColumn = function isWholeSelectionInsideLayoutColumn(state) {
@@ -135,7 +136,8 @@ export default (function (options) {
135
136
  props: {
136
137
  decorations: function decorations(state) {
137
138
  var layoutState = pluginKey.getState(state);
138
- if (editorExperiment('advanced_layouts', true) && editorExperiment('platform_editor_layout_column_resize_handle', true)) {
139
+ var isLayoutResizingPluginAvailable = layoutResizingPluginKey.get(state) !== undefined;
140
+ if (editorExperiment('advanced_layouts', true) && editorExperiment('platform_editor_layout_column_resize_handle', true) && isLayoutResizingPluginAvailable) {
139
141
  var dividerDecorations = getColumnDividerDecorations(state, editorViewRef);
140
142
  var selectedDecorations = layoutState.pos !== null ? getNodeDecoration(layoutState.pos, state.doc.nodeAt(layoutState.pos)) : [];
141
143
  var allDecorations = [].concat(_toConsumableArray(selectedDecorations), _toConsumableArray(dividerDecorations));
@@ -7,7 +7,6 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
7
7
  import { blockMenuMessages } from '@atlaskit/editor-common/messages';
8
8
  import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
9
9
  import LayoutTwoColumnsIcon from '@atlaskit/icon/core/layout-two-columns';
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
10
  var styles = {
12
11
  svgOverflow: "_1wrmewfl _172sewfl"
13
12
  };
@@ -32,21 +31,14 @@ var LayoutBlockMenuItem = function LayoutBlockMenuItem(_ref) {
32
31
  }) : null;
33
32
  });
34
33
  };
35
-
36
- // [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
37
- // Adds size="small" to icons for better visual consistency in block menu.
38
- // Adds overflow: visible to SVGs to fix when view port is in different zoom level, sometimes the right edge of the icon is cut off.
39
- // To clean up: remove conditionals, keep only size="small" version and always apply svgOverflowStyles wrapper.
40
- var iconSize = fg('platform_editor_block_menu_v2_patch_3') ? 'small' : undefined;
41
- var icon = /*#__PURE__*/React.createElement(LayoutTwoColumnsIcon, {
42
- label: "",
43
- size: iconSize
44
- });
45
34
  return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
46
35
  onClick: handleClick,
47
- elemBefore: fg('platform_editor_block_menu_v2_patch_3') ? /*#__PURE__*/React.createElement("span", {
36
+ elemBefore: /*#__PURE__*/React.createElement("span", {
48
37
  className: ax([styles.svgOverflow])
49
- }, icon) : icon
38
+ }, /*#__PURE__*/React.createElement(LayoutTwoColumnsIcon, {
39
+ label: "",
40
+ size: "small"
41
+ }))
50
42
  }, formatMessage(blockMenuMessages.layout));
51
43
  };
52
44
  export var createLayoutBlockMenuItem = function createLayoutBlockMenuItem(api) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-layout",
3
- "version": "8.1.10",
3
+ "version": "8.1.12",
4
4
  "description": "Layout plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/icon": "^34.1.0",
47
47
  "@atlaskit/icon-lab": "^6.5.0",
48
48
  "@atlaskit/platform-feature-flags": "^1.1.0",
49
- "@atlaskit/tmp-editor-statsig": "^62.0.0",
49
+ "@atlaskit/tmp-editor-statsig": "^62.2.0",
50
50
  "@atlaskit/tokens": "^13.0.0",
51
51
  "@babel/runtime": "^7.0.0",
52
52
  "@emotion/react": "^11.7.1",