@atlaskit/editor-plugin-layout 1.10.0 → 1.12.0

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,38 @@
1
1
  # @atlaskit/editor-plugin-layout
2
2
 
3
+ ## 1.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#162388](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/162388)
8
+ [`ac57b50211fdc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ac57b50211fdc) -
9
+ add 'clamped' option to resizer prop HandleSize which uses CSS to alter height of handle, add
10
+ logic to ensure handles are visible when selection is inside node
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 1.11.1
17
+
18
+ ### Patch Changes
19
+
20
+ - [#161230](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/161230)
21
+ [`70a438baa282b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/70a438baa282b) -
22
+ [ux] Add equal distribution button on layout toolbar
23
+
24
+ ## 1.11.0
25
+
26
+ ### Minor Changes
27
+
28
+ - [#159018](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/159018)
29
+ [`14d5e189df870`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/14d5e189df870) -
30
+ [ux] ED-25367-remove-copy-button-from-view-mode-when-its-the-only-item
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies
35
+
3
36
  ## 1.10.0
4
37
 
5
38
  ### Minor Changes
@@ -20,7 +20,8 @@ var LayoutBreakoutResizer = function LayoutBreakoutResizer(_ref) {
20
20
  var pluginInjectionApi = _ref.pluginInjectionApi,
21
21
  forwardRef = _ref.forwardRef,
22
22
  getPos = _ref.getPos,
23
- view = _ref.view;
23
+ view = _ref.view,
24
+ parentRef = _ref.parentRef;
24
25
  var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['editorDisabled']),
25
26
  editorDisabledState = _useSharedPluginState.editorDisabledState;
26
27
  var getEditorWidth = function getEditorWidth() {
@@ -31,9 +32,10 @@ var LayoutBreakoutResizer = function LayoutBreakoutResizer(_ref) {
31
32
  getRef: forwardRef,
32
33
  getPos: getPos,
33
34
  editorView: view,
34
- node: "layoutSection",
35
+ nodeType: "layoutSection",
35
36
  getEditorWidth: getEditorWidth,
36
- disabled: (editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled) === true
37
+ disabled: (editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled) === true,
38
+ parentRef: parentRef
37
39
  });
38
40
  };
39
41
  var LayoutSectionView = exports.LayoutSectionView = /*#__PURE__*/function (_ReactNodeView) {
@@ -71,7 +73,8 @@ var LayoutSectionView = exports.LayoutSectionView = /*#__PURE__*/function (_Reac
71
73
  pluginInjectionApi: props.pluginInjectionApi,
72
74
  forwardRef: forwardRef,
73
75
  getPos: props.getPos,
74
- view: props.view
76
+ view: props.view,
77
+ parentRef: this.layoutDOM
75
78
  });
76
79
  }
77
80
  }, {
@@ -23,6 +23,7 @@ var _layoutTwoEqual = _interopRequireDefault(require("@atlaskit/icon/glyph/edito
23
23
  var _layoutTwoLeftSidebar = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/layout-two-left-sidebar"));
24
24
  var _layoutTwoRightSidebar = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/layout-two-right-sidebar"));
25
25
  var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
26
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
26
27
  var _actions = require("./actions");
27
28
  var _preRelease = require("./utils/preRelease");
28
29
  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); }
@@ -66,9 +67,40 @@ var SIDEBAR_LAYOUT_TYPES = [{
66
67
  icon: _layoutThreeColumnsSidebars.default,
67
68
  iconFallback: _layoutThreeWithSidebars.default
68
69
  }];
70
+ var LAYOUT_DISTRIBUTION_TYPES = [{
71
+ id: 'editor.layout.twoEquals',
72
+ type: 'two_equal',
73
+ title: _messages.layoutMessages.twoColumns,
74
+ icon: _layoutTwoColumns.default,
75
+ iconFallback: _layoutTwoEqual.default
76
+ }, {
77
+ id: 'editor.layout.twoRightSidebar',
78
+ type: 'two_right_sidebar',
79
+ title: _messages.layoutMessages.rightSidebar,
80
+ icon: _layoutTwoColumnsSidebarRight.default,
81
+ iconFallback: _layoutTwoRightSidebar.default
82
+ }, {
83
+ id: 'editor.layout.twoLeftSidebar',
84
+ type: 'two_left_sidebar',
85
+ title: _messages.layoutMessages.leftSidebar,
86
+ icon: _layoutTwoColumnsSidebarLeft.default,
87
+ iconFallback: _layoutTwoLeftSidebar.default
88
+ }, {
89
+ id: 'editor.layout.threeEquals',
90
+ type: 'three_equal',
91
+ title: _messages.layoutMessages.threeColumns,
92
+ icon: _layoutThreeColumns.default,
93
+ iconFallback: _layoutThreeEqual.default
94
+ }, {
95
+ id: 'editor.layout.threeWithSidebars',
96
+ type: 'three_with_sidebars',
97
+ title: _messages.layoutMessages.threeColumnsWithSidebars,
98
+ icon: _layoutThreeColumnsSidebars.default,
99
+ iconFallback: _layoutThreeWithSidebars.default
100
+ }];
69
101
  var SIDEBAR_LAYOUT_TYPES_BY_COLUMNS = {
70
- 2: [SIDEBAR_LAYOUT_TYPES[0], SIDEBAR_LAYOUT_TYPES[1]],
71
- 3: [SIDEBAR_LAYOUT_TYPES[2]],
102
+ 2: [LAYOUT_DISTRIBUTION_TYPES[0], LAYOUT_DISTRIBUTION_TYPES[1], LAYOUT_DISTRIBUTION_TYPES[2]],
103
+ 3: [LAYOUT_DISTRIBUTION_TYPES[3], LAYOUT_DISTRIBUTION_TYPES[4]],
72
104
  4: [],
73
105
  5: []
74
106
  };
@@ -175,7 +207,7 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(state, intl, pos
175
207
  return buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI);
176
208
  }) : []), [separator, {
177
209
  type: 'copy-button',
178
- supportsViewMode: true,
210
+ supportsViewMode: !(0, _platformFeatureFlags.fg)('platform_editor_remove_copy_button_from_view_mode'),
179
211
  items: [{
180
212
  state: state,
181
213
  formatMessage: intl.formatMessage,
@@ -6,7 +6,8 @@ const LayoutBreakoutResizer = ({
6
6
  pluginInjectionApi,
7
7
  forwardRef,
8
8
  getPos,
9
- view
9
+ view,
10
+ parentRef
10
11
  }) => {
11
12
  const {
12
13
  editorDisabledState
@@ -19,9 +20,10 @@ const LayoutBreakoutResizer = ({
19
20
  getRef: forwardRef,
20
21
  getPos: getPos,
21
22
  editorView: view,
22
- node: "layoutSection",
23
+ nodeType: "layoutSection",
23
24
  getEditorWidth: getEditorWidth,
24
- disabled: (editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled) === true
25
+ disabled: (editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled) === true,
26
+ parentRef: parentRef
25
27
  });
26
28
  };
27
29
  export class LayoutSectionView extends ReactNodeView {
@@ -48,7 +50,8 @@ export class LayoutSectionView extends ReactNodeView {
48
50
  pluginInjectionApi: props.pluginInjectionApi,
49
51
  forwardRef: forwardRef,
50
52
  getPos: props.getPos,
51
- view: props.view
53
+ view: props.view,
54
+ parentRef: this.layoutDOM
52
55
  });
53
56
  }
54
57
  ignoreMutation(mutation) {
@@ -14,6 +14,7 @@ import LayoutTwoEqualIcon from '@atlaskit/icon/glyph/editor/layout-two-equal';
14
14
  import LayoutTwoLeftSidebarIcon from '@atlaskit/icon/glyph/editor/layout-two-left-sidebar';
15
15
  import LayoutTwoRightSidebarIcon from '@atlaskit/icon/glyph/editor/layout-two-right-sidebar';
16
16
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
17
+ import { fg } from '@atlaskit/platform-feature-flags';
17
18
  import { deleteActiveLayoutNode, getPresetLayout, setPresetLayout } from './actions';
18
19
  import { isPreRelease2 } from './utils/preRelease';
19
20
  const LAYOUT_TYPES = [{
@@ -55,9 +56,40 @@ const SIDEBAR_LAYOUT_TYPES = [{
55
56
  icon: LayoutThreeColumnsSidebarsIcon,
56
57
  iconFallback: LayoutThreeWithSidebarsIcon
57
58
  }];
59
+ const LAYOUT_DISTRIBUTION_TYPES = [{
60
+ id: 'editor.layout.twoEquals',
61
+ type: 'two_equal',
62
+ title: toolbarMessages.twoColumns,
63
+ icon: LayoutTwoColumnsIcon,
64
+ iconFallback: LayoutTwoEqualIcon
65
+ }, {
66
+ id: 'editor.layout.twoRightSidebar',
67
+ type: 'two_right_sidebar',
68
+ title: toolbarMessages.rightSidebar,
69
+ icon: LayoutTwoColumnsSidebarRightIcon,
70
+ iconFallback: LayoutTwoRightSidebarIcon
71
+ }, {
72
+ id: 'editor.layout.twoLeftSidebar',
73
+ type: 'two_left_sidebar',
74
+ title: toolbarMessages.leftSidebar,
75
+ icon: LayoutTwoColumnsSidebarLeftIcon,
76
+ iconFallback: LayoutTwoLeftSidebarIcon
77
+ }, {
78
+ id: 'editor.layout.threeEquals',
79
+ type: 'three_equal',
80
+ title: toolbarMessages.threeColumns,
81
+ icon: LayoutThreeColumnsIcon,
82
+ iconFallback: LayoutThreeEqualIcon
83
+ }, {
84
+ id: 'editor.layout.threeWithSidebars',
85
+ type: 'three_with_sidebars',
86
+ title: toolbarMessages.threeColumnsWithSidebars,
87
+ icon: LayoutThreeColumnsSidebarsIcon,
88
+ iconFallback: LayoutThreeWithSidebarsIcon
89
+ }];
58
90
  const SIDEBAR_LAYOUT_TYPES_BY_COLUMNS = {
59
- 2: [SIDEBAR_LAYOUT_TYPES[0], SIDEBAR_LAYOUT_TYPES[1]],
60
- 3: [SIDEBAR_LAYOUT_TYPES[2]],
91
+ 2: [LAYOUT_DISTRIBUTION_TYPES[0], LAYOUT_DISTRIBUTION_TYPES[1], LAYOUT_DISTRIBUTION_TYPES[2]],
92
+ 3: [LAYOUT_DISTRIBUTION_TYPES[3], LAYOUT_DISTRIBUTION_TYPES[4]],
61
93
  4: [],
62
94
  5: []
63
95
  };
@@ -155,7 +187,7 @@ export const buildToolbar = (state, intl, pos, _allowBreakout, addSidebarLayouts
155
187
  testId: 'column-options-button'
156
188
  }, sidebarTypesByColumns.length > 0 && separator] : []), ...layoutTypes.map(i => buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI)), ...(addSidebarLayouts ? isPreRelease2() ? sidebarTypesByColumns.map(i => buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI)) : SIDEBAR_LAYOUT_TYPES.map(i => buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI)) : []), separator, {
157
189
  type: 'copy-button',
158
- supportsViewMode: true,
190
+ supportsViewMode: !fg('platform_editor_remove_copy_button_from_view_mode'),
159
191
  items: [{
160
192
  state,
161
193
  formatMessage: intl.formatMessage,
@@ -13,7 +13,8 @@ var LayoutBreakoutResizer = function LayoutBreakoutResizer(_ref) {
13
13
  var pluginInjectionApi = _ref.pluginInjectionApi,
14
14
  forwardRef = _ref.forwardRef,
15
15
  getPos = _ref.getPos,
16
- view = _ref.view;
16
+ view = _ref.view,
17
+ parentRef = _ref.parentRef;
17
18
  var _useSharedPluginState = useSharedPluginState(pluginInjectionApi, ['editorDisabled']),
18
19
  editorDisabledState = _useSharedPluginState.editorDisabledState;
19
20
  var getEditorWidth = function getEditorWidth() {
@@ -24,9 +25,10 @@ var LayoutBreakoutResizer = function LayoutBreakoutResizer(_ref) {
24
25
  getRef: forwardRef,
25
26
  getPos: getPos,
26
27
  editorView: view,
27
- node: "layoutSection",
28
+ nodeType: "layoutSection",
28
29
  getEditorWidth: getEditorWidth,
29
- disabled: (editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled) === true
30
+ disabled: (editorDisabledState === null || editorDisabledState === void 0 ? void 0 : editorDisabledState.editorDisabled) === true,
31
+ parentRef: parentRef
30
32
  });
31
33
  };
32
34
  export var LayoutSectionView = /*#__PURE__*/function (_ReactNodeView) {
@@ -64,7 +66,8 @@ export var LayoutSectionView = /*#__PURE__*/function (_ReactNodeView) {
64
66
  pluginInjectionApi: props.pluginInjectionApi,
65
67
  forwardRef: forwardRef,
66
68
  getPos: props.getPos,
67
- view: props.view
69
+ view: props.view,
70
+ parentRef: this.layoutDOM
68
71
  });
69
72
  }
70
73
  }, {
@@ -15,6 +15,7 @@ import LayoutTwoEqualIcon from '@atlaskit/icon/glyph/editor/layout-two-equal';
15
15
  import LayoutTwoLeftSidebarIcon from '@atlaskit/icon/glyph/editor/layout-two-left-sidebar';
16
16
  import LayoutTwoRightSidebarIcon from '@atlaskit/icon/glyph/editor/layout-two-right-sidebar';
17
17
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
18
+ import { fg } from '@atlaskit/platform-feature-flags';
18
19
  import { deleteActiveLayoutNode, getPresetLayout, setPresetLayout } from './actions';
19
20
  import { isPreRelease2 } from './utils/preRelease';
20
21
  var LAYOUT_TYPES = [{
@@ -56,9 +57,40 @@ var SIDEBAR_LAYOUT_TYPES = [{
56
57
  icon: LayoutThreeColumnsSidebarsIcon,
57
58
  iconFallback: LayoutThreeWithSidebarsIcon
58
59
  }];
60
+ var LAYOUT_DISTRIBUTION_TYPES = [{
61
+ id: 'editor.layout.twoEquals',
62
+ type: 'two_equal',
63
+ title: toolbarMessages.twoColumns,
64
+ icon: LayoutTwoColumnsIcon,
65
+ iconFallback: LayoutTwoEqualIcon
66
+ }, {
67
+ id: 'editor.layout.twoRightSidebar',
68
+ type: 'two_right_sidebar',
69
+ title: toolbarMessages.rightSidebar,
70
+ icon: LayoutTwoColumnsSidebarRightIcon,
71
+ iconFallback: LayoutTwoRightSidebarIcon
72
+ }, {
73
+ id: 'editor.layout.twoLeftSidebar',
74
+ type: 'two_left_sidebar',
75
+ title: toolbarMessages.leftSidebar,
76
+ icon: LayoutTwoColumnsSidebarLeftIcon,
77
+ iconFallback: LayoutTwoLeftSidebarIcon
78
+ }, {
79
+ id: 'editor.layout.threeEquals',
80
+ type: 'three_equal',
81
+ title: toolbarMessages.threeColumns,
82
+ icon: LayoutThreeColumnsIcon,
83
+ iconFallback: LayoutThreeEqualIcon
84
+ }, {
85
+ id: 'editor.layout.threeWithSidebars',
86
+ type: 'three_with_sidebars',
87
+ title: toolbarMessages.threeColumnsWithSidebars,
88
+ icon: LayoutThreeColumnsSidebarsIcon,
89
+ iconFallback: LayoutThreeWithSidebarsIcon
90
+ }];
59
91
  var SIDEBAR_LAYOUT_TYPES_BY_COLUMNS = {
60
- 2: [SIDEBAR_LAYOUT_TYPES[0], SIDEBAR_LAYOUT_TYPES[1]],
61
- 3: [SIDEBAR_LAYOUT_TYPES[2]],
92
+ 2: [LAYOUT_DISTRIBUTION_TYPES[0], LAYOUT_DISTRIBUTION_TYPES[1], LAYOUT_DISTRIBUTION_TYPES[2]],
93
+ 3: [LAYOUT_DISTRIBUTION_TYPES[3], LAYOUT_DISTRIBUTION_TYPES[4]],
62
94
  4: [],
63
95
  5: []
64
96
  };
@@ -165,7 +197,7 @@ export var buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout
165
197
  return buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI);
166
198
  }) : []), [separator, {
167
199
  type: 'copy-button',
168
- supportsViewMode: true,
200
+ supportsViewMode: !fg('platform_editor_remove_copy_button_from_view_mode'),
169
201
  items: [{
170
202
  state: state,
171
203
  formatMessage: intl.formatMessage,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-layout",
3
- "version": "1.10.0",
3
+ "version": "1.12.0",
4
4
  "description": "Layout plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^44.2.0",
35
- "@atlaskit/editor-common": "^94.12.0",
35
+ "@atlaskit/editor-common": "^94.17.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
37
37
  "@atlaskit/editor-plugin-decorations": "^1.3.0",
38
38
  "@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
@@ -40,8 +40,8 @@
40
40
  "@atlaskit/editor-prosemirror": "6.0.0",
41
41
  "@atlaskit/icon": "^22.24.0",
42
42
  "@atlaskit/platform-feature-flags": "^0.3.0",
43
- "@atlaskit/tmp-editor-statsig": "^2.11.0",
44
- "@atlaskit/tokens": "^2.1.0",
43
+ "@atlaskit/tmp-editor-statsig": "^2.12.0",
44
+ "@atlaskit/tokens": "^2.2.0",
45
45
  "@babel/runtime": "^7.0.0",
46
46
  "@emotion/react": "^11.7.1"
47
47
  },
@@ -94,6 +94,9 @@
94
94
  "platform_editor_advanced_layouts_pre_release_2": {
95
95
  "type": "boolean"
96
96
  },
97
+ "platform_editor_remove_copy_button_from_view_mode": {
98
+ "type": "boolean"
99
+ },
97
100
  "platform_editor_advanced_layouts_breakout_resizing": {
98
101
  "type": "boolean"
99
102
  }