@atlaskit/editor-plugin-layout 1.9.8 → 1.9.10

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,22 @@
1
1
  # @atlaskit/editor-plugin-layout
2
2
 
3
+ ## 1.9.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#159826](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/159826)
8
+ [`f60aee4fc057e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f60aee4fc057e) -
9
+ [ux] Show toolbar distribution options based on layout columnsnumber
10
+ - Updated dependencies
11
+
12
+ ## 1.9.9
13
+
14
+ ### Patch Changes
15
+
16
+ - [#159176](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/159176)
17
+ [`8f1d77592a9dc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8f1d77592a9dc) -
18
+ Bump adf-schema to 44.2.0
19
+
3
20
  ## 1.9.8
4
21
 
5
22
  ### Patch Changes
@@ -66,6 +66,12 @@ var SIDEBAR_LAYOUT_TYPES = [{
66
66
  icon: _layoutThreeColumnsSidebars.default,
67
67
  iconFallback: _layoutThreeWithSidebars.default
68
68
  }];
69
+ var SIDEBAR_LAYOUT_TYPES_BY_COLUMNS = {
70
+ 2: [SIDEBAR_LAYOUT_TYPES[0], SIDEBAR_LAYOUT_TYPES[1]],
71
+ 3: [SIDEBAR_LAYOUT_TYPES[2]],
72
+ 4: [],
73
+ 5: []
74
+ };
69
75
  var buildLayoutButton = function buildLayoutButton(intl, item, currentLayout, editorAnalyticsAPI) {
70
76
  return {
71
77
  id: item.id,
@@ -144,6 +150,7 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(state, intl, pos
144
150
  onClick: (0, _actions.setPresetLayout)(editorAnalyticsAPI)('five_equal', intl.formatMessage),
145
151
  selected: numberOfColumns === 5
146
152
  }];
153
+ var sidebarTypesByColumns = SIDEBAR_LAYOUT_TYPES_BY_COLUMNS[numberOfColumns];
147
154
  return {
148
155
  title: layoutToolbarTitle,
149
156
  getDomRef: function getDomRef(view) {
@@ -160,9 +167,11 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(state, intl, pos
160
167
  options: columnOptions,
161
168
  showSelected: true,
162
169
  testId: 'column-options-button'
163
- }] : []), (0, _toConsumableArray2.default)(layoutTypes.map(function (i) {
170
+ }, sidebarTypesByColumns.length > 0 && separator] : []), (0, _toConsumableArray2.default)(layoutTypes.map(function (i) {
171
+ return buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI);
172
+ })), (0, _toConsumableArray2.default)(addSidebarLayouts ? (0, _preRelease.isPreRelease2)() ? sidebarTypesByColumns.map(function (i) {
164
173
  return buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI);
165
- })), (0, _toConsumableArray2.default)(addSidebarLayouts ? SIDEBAR_LAYOUT_TYPES.map(function (i) {
174
+ }) : SIDEBAR_LAYOUT_TYPES.map(function (i) {
166
175
  return buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI);
167
176
  }) : []), [separator, {
168
177
  type: 'copy-button',
@@ -55,6 +55,12 @@ const SIDEBAR_LAYOUT_TYPES = [{
55
55
  icon: LayoutThreeColumnsSidebarsIcon,
56
56
  iconFallback: LayoutThreeWithSidebarsIcon
57
57
  }];
58
+ const SIDEBAR_LAYOUT_TYPES_BY_COLUMNS = {
59
+ 2: [SIDEBAR_LAYOUT_TYPES[0], SIDEBAR_LAYOUT_TYPES[1]],
60
+ 3: [SIDEBAR_LAYOUT_TYPES[2]],
61
+ 4: [],
62
+ 5: []
63
+ };
58
64
  const buildLayoutButton = (intl, item, currentLayout, editorAnalyticsAPI) => ({
59
65
  id: item.id,
60
66
  type: 'button',
@@ -132,6 +138,7 @@ export const buildToolbar = (state, intl, pos, _allowBreakout, addSidebarLayouts
132
138
  onClick: setPresetLayout(editorAnalyticsAPI)('five_equal', intl.formatMessage),
133
139
  selected: numberOfColumns === 5
134
140
  }];
141
+ const sidebarTypesByColumns = SIDEBAR_LAYOUT_TYPES_BY_COLUMNS[numberOfColumns];
135
142
  return {
136
143
  title: layoutToolbarTitle,
137
144
  getDomRef: view => findDomRefAtPos(pos, view.domAtPos.bind(view)),
@@ -146,7 +153,7 @@ export const buildToolbar = (state, intl, pos, _allowBreakout, addSidebarLayouts
146
153
  options: columnOptions,
147
154
  showSelected: true,
148
155
  testId: 'column-options-button'
149
- }] : []), ...layoutTypes.map(i => buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI)), ...(addSidebarLayouts ? SIDEBAR_LAYOUT_TYPES.map(i => buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI)) : []), separator, {
156
+ }, 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, {
150
157
  type: 'copy-button',
151
158
  supportsViewMode: true,
152
159
  items: [{
@@ -56,6 +56,12 @@ var SIDEBAR_LAYOUT_TYPES = [{
56
56
  icon: LayoutThreeColumnsSidebarsIcon,
57
57
  iconFallback: LayoutThreeWithSidebarsIcon
58
58
  }];
59
+ var SIDEBAR_LAYOUT_TYPES_BY_COLUMNS = {
60
+ 2: [SIDEBAR_LAYOUT_TYPES[0], SIDEBAR_LAYOUT_TYPES[1]],
61
+ 3: [SIDEBAR_LAYOUT_TYPES[2]],
62
+ 4: [],
63
+ 5: []
64
+ };
59
65
  var buildLayoutButton = function buildLayoutButton(intl, item, currentLayout, editorAnalyticsAPI) {
60
66
  return {
61
67
  id: item.id,
@@ -134,6 +140,7 @@ export var buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout
134
140
  onClick: setPresetLayout(editorAnalyticsAPI)('five_equal', intl.formatMessage),
135
141
  selected: numberOfColumns === 5
136
142
  }];
143
+ var sidebarTypesByColumns = SIDEBAR_LAYOUT_TYPES_BY_COLUMNS[numberOfColumns];
137
144
  return {
138
145
  title: layoutToolbarTitle,
139
146
  getDomRef: function getDomRef(view) {
@@ -150,9 +157,11 @@ export var buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout
150
157
  options: columnOptions,
151
158
  showSelected: true,
152
159
  testId: 'column-options-button'
153
- }] : []), _toConsumableArray(layoutTypes.map(function (i) {
160
+ }, sidebarTypesByColumns.length > 0 && separator] : []), _toConsumableArray(layoutTypes.map(function (i) {
161
+ return buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI);
162
+ })), _toConsumableArray(addSidebarLayouts ? isPreRelease2() ? sidebarTypesByColumns.map(function (i) {
154
163
  return buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI);
155
- })), _toConsumableArray(addSidebarLayouts ? SIDEBAR_LAYOUT_TYPES.map(function (i) {
164
+ }) : SIDEBAR_LAYOUT_TYPES.map(function (i) {
156
165
  return buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI);
157
166
  }) : []), [separator, {
158
167
  type: 'copy-button',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-layout",
3
- "version": "1.9.8",
3
+ "version": "1.9.10",
4
4
  "description": "Layout plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,15 +31,15 @@
31
31
  ".": "./src/index.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/adf-schema": "^42.3.1",
35
- "@atlaskit/editor-common": "^94.9.0",
34
+ "@atlaskit/adf-schema": "^44.2.0",
35
+ "@atlaskit/editor-common": "^94.11.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
37
37
  "@atlaskit/editor-plugin-decorations": "^1.3.0",
38
38
  "@atlaskit/editor-prosemirror": "6.0.0",
39
39
  "@atlaskit/icon": "^22.24.0",
40
40
  "@atlaskit/platform-feature-flags": "^0.3.0",
41
- "@atlaskit/tmp-editor-statsig": "^2.10.0",
42
- "@atlaskit/tokens": "^2.0.0",
41
+ "@atlaskit/tmp-editor-statsig": "^2.11.0",
42
+ "@atlaskit/tokens": "^2.1.0",
43
43
  "@babel/runtime": "^7.0.0",
44
44
  "@emotion/react": "^11.7.1"
45
45
  },