@atlaskit/editor-plugin-layout 3.1.3 → 3.1.5
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 +18 -0
- package/dist/cjs/layoutPlugin.js +2 -2
- package/dist/cjs/nodeviews/index.js +4 -3
- package/dist/cjs/pm-plugins/actions.js +23 -9
- package/dist/es2019/layoutPlugin.js +4 -4
- package/dist/es2019/nodeviews/index.js +4 -3
- package/dist/es2019/pm-plugins/actions.js +24 -8
- package/dist/esm/layoutPlugin.js +4 -4
- package/dist/esm/nodeviews/index.js +4 -3
- package/dist/esm/pm-plugins/actions.js +23 -9
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-layout
|
|
2
2
|
|
|
3
|
+
## 3.1.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#195965](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/195965)
|
|
8
|
+
[`3a58e5cf3f7c4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3a58e5cf3f7c4) -
|
|
9
|
+
EDITOR-1104 Add localId attribute to layout nodes behind platform_editor_adf_with_localid
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.1.4
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#195649](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/195649)
|
|
17
|
+
[`231bb33e06dfe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/231bb33e06dfe) -
|
|
18
|
+
EDITOR-1131 Bump adf-schema version to 50.2.0
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 3.1.3
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/cjs/layoutPlugin.js
CHANGED
|
@@ -61,10 +61,10 @@ var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
|
|
|
61
61
|
nodes: function nodes() {
|
|
62
62
|
return [{
|
|
63
63
|
name: 'layoutSection',
|
|
64
|
-
node: (0, _experiments.editorExperiment)('advanced_layouts', true) ? _schema.layoutSectionWithSingleColumn : _adfSchema.layoutSection
|
|
64
|
+
node: (0, _experiments.editorExperiment)('advanced_layouts', true) ? (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _schema.layoutSectionWithSingleColumnLocalId : _schema.layoutSectionWithSingleColumn : _adfSchema.layoutSection
|
|
65
65
|
}, {
|
|
66
66
|
name: 'layoutColumn',
|
|
67
|
-
node: _adfSchema.layoutColumn
|
|
67
|
+
node: (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.layoutColumnWithLocalId : _adfSchema.layoutColumn
|
|
68
68
|
}];
|
|
69
69
|
},
|
|
70
70
|
pmPlugins: function pmPlugins() {
|
|
@@ -119,9 +119,10 @@ var LayoutBreakoutResizer = function LayoutBreakoutResizer(_ref) {
|
|
|
119
119
|
dynamicFullWidthGuidelineOffset: layoutDynamicFullWidthGuidelineOffset
|
|
120
120
|
});
|
|
121
121
|
};
|
|
122
|
-
var toDOM = function toDOM() {
|
|
122
|
+
var toDOM = function toDOM(node) {
|
|
123
123
|
return ['div', {
|
|
124
|
-
class: 'layout-section-container'
|
|
124
|
+
class: 'layout-section-container',
|
|
125
|
+
'data-local-id': node.attrs.localId
|
|
125
126
|
}, ['div', {
|
|
126
127
|
'data-layout-section': true
|
|
127
128
|
}, 0]];
|
|
@@ -161,7 +162,7 @@ var LayoutSectionView = exports.LayoutSectionView = /*#__PURE__*/function (_Reac
|
|
|
161
162
|
return (0, _createClass2.default)(LayoutSectionView, [{
|
|
162
163
|
key: "getContentDOM",
|
|
163
164
|
value: function getContentDOM() {
|
|
164
|
-
var _ref2 = _model.DOMSerializer.renderSpec(document, toDOM()),
|
|
165
|
+
var _ref2 = _model.DOMSerializer.renderSpec(document, toDOM(this.node)),
|
|
165
166
|
container = _ref2.dom,
|
|
166
167
|
contentDOM = _ref2.contentDOM;
|
|
167
168
|
|
|
@@ -8,6 +8,7 @@ exports.fixColumnStructure = exports.fixColumnSizes = exports.deleteActiveLayout
|
|
|
8
8
|
exports.forceSectionToPresetLayout = forceSectionToPresetLayout;
|
|
9
9
|
exports.setPresetLayout = exports.insertLayoutColumnsWithAnalytics = exports.insertLayoutColumns = exports.getSelectedLayout = exports.getPresetLayout = void 0;
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _adfSchema = require("@atlaskit/adf-schema");
|
|
11
12
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
13
|
var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
|
|
13
14
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -149,23 +150,33 @@ var createMultiColumnLayoutSection = exports.createMultiColumnLayoutSection = fu
|
|
|
149
150
|
length: numberOfColumns
|
|
150
151
|
}, function () {
|
|
151
152
|
return layoutColumn.createAndFill({
|
|
152
|
-
width: _consts.EVEN_DISTRIBUTED_COL_WIDTHS[numberOfColumns]
|
|
153
|
+
width: _consts.EVEN_DISTRIBUTED_COL_WIDTHS[numberOfColumns],
|
|
154
|
+
localId: (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.uuid.generate() : undefined
|
|
153
155
|
});
|
|
154
156
|
}));
|
|
155
|
-
|
|
157
|
+
var attrs = (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? {
|
|
158
|
+
localId: _adfSchema.uuid.generate()
|
|
159
|
+
} : undefined;
|
|
160
|
+
return layoutSection.createAndFill(attrs, columns);
|
|
156
161
|
};
|
|
157
162
|
var createDefaultLayoutSection = exports.createDefaultLayoutSection = function createDefaultLayoutSection(state) {
|
|
158
163
|
var _state$schema$nodes2 = state.schema.nodes,
|
|
159
164
|
layoutSection = _state$schema$nodes2.layoutSection,
|
|
160
165
|
layoutColumn = _state$schema$nodes2.layoutColumn;
|
|
161
|
-
|
|
162
166
|
// create a 50-50 layout by default
|
|
163
|
-
var columns = _model.Fragment.fromArray([layoutColumn.createAndFill({
|
|
167
|
+
var columns = _model.Fragment.fromArray([layoutColumn.createAndFill(_objectSpread({
|
|
164
168
|
width: 50
|
|
165
|
-
}
|
|
169
|
+
}, (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? {
|
|
170
|
+
localId: _adfSchema.uuid.generate()
|
|
171
|
+
} : undefined)), layoutColumn.createAndFill(_objectSpread({
|
|
166
172
|
width: 50
|
|
167
|
-
})
|
|
168
|
-
|
|
173
|
+
}, (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? {
|
|
174
|
+
localId: _adfSchema.uuid.generate()
|
|
175
|
+
} : undefined))]);
|
|
176
|
+
var attrs = (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? {
|
|
177
|
+
localId: _adfSchema.uuid.generate()
|
|
178
|
+
} : undefined;
|
|
179
|
+
return layoutSection.createAndFill(attrs, columns);
|
|
169
180
|
};
|
|
170
181
|
var insertLayoutColumns = exports.insertLayoutColumns = function insertLayoutColumns(state, dispatch) {
|
|
171
182
|
if (dispatch) {
|
|
@@ -197,13 +208,16 @@ var insertLayoutColumnsWithAnalytics = exports.insertLayoutColumnsWithAnalytics
|
|
|
197
208
|
* Add a column to the right of existing layout
|
|
198
209
|
*/
|
|
199
210
|
function addColumn(schema, pos) {
|
|
211
|
+
var attrs = (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? {
|
|
212
|
+
localId: _adfSchema.uuid.generate()
|
|
213
|
+
} : undefined;
|
|
200
214
|
if ((0, _experiments.editorExperiment)('advanced_layouts', false)) {
|
|
201
215
|
return function (tr) {
|
|
202
|
-
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill());
|
|
216
|
+
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill(attrs));
|
|
203
217
|
};
|
|
204
218
|
}
|
|
205
219
|
return function (tr) {
|
|
206
|
-
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill(
|
|
220
|
+
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill(attrs));
|
|
207
221
|
};
|
|
208
222
|
}
|
|
209
223
|
function removeLastColumnInLayout(column, columnPos, insideRightEdgePos) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { layoutColumn, layoutSection } from '@atlaskit/adf-schema';
|
|
3
|
-
import { layoutSectionWithSingleColumn } from '@atlaskit/adf-schema/schema';
|
|
2
|
+
import { layoutColumn, layoutSection, layoutColumnWithLocalId } from '@atlaskit/adf-schema';
|
|
3
|
+
import { layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId } from '@atlaskit/adf-schema/schema';
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { layoutMessages, toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { IconFiveColumnLayout, IconFourColumnLayout, IconLayout, IconOneColumnLayout, IconThreeColumnLayout, IconTwoColumnLayout } from '@atlaskit/editor-common/quick-insert';
|
|
@@ -54,10 +54,10 @@ export const layoutPlugin = ({
|
|
|
54
54
|
nodes() {
|
|
55
55
|
return [{
|
|
56
56
|
name: 'layoutSection',
|
|
57
|
-
node: editorExperiment('advanced_layouts', true) ? layoutSectionWithSingleColumn : layoutSection
|
|
57
|
+
node: editorExperiment('advanced_layouts', true) ? fg('platform_editor_adf_with_localid') ? layoutSectionWithSingleColumnLocalId : layoutSectionWithSingleColumn : layoutSection
|
|
58
58
|
}, {
|
|
59
59
|
name: 'layoutColumn',
|
|
60
|
-
node: layoutColumn
|
|
60
|
+
node: fg('platform_editor_adf_with_localid') ? layoutColumnWithLocalId : layoutColumn
|
|
61
61
|
}];
|
|
62
62
|
},
|
|
63
63
|
pmPlugins() {
|
|
@@ -106,8 +106,9 @@ const LayoutBreakoutResizer = ({
|
|
|
106
106
|
dynamicFullWidthGuidelineOffset: layoutDynamicFullWidthGuidelineOffset
|
|
107
107
|
});
|
|
108
108
|
};
|
|
109
|
-
const toDOM =
|
|
110
|
-
class: 'layout-section-container'
|
|
109
|
+
const toDOM = node => ['div', {
|
|
110
|
+
class: 'layout-section-container',
|
|
111
|
+
'data-local-id': node.attrs.localId
|
|
111
112
|
}, ['div', {
|
|
112
113
|
'data-layout-section': true
|
|
113
114
|
}, 0]];
|
|
@@ -143,7 +144,7 @@ export class LayoutSectionView extends ReactNodeView {
|
|
|
143
144
|
const {
|
|
144
145
|
dom: container,
|
|
145
146
|
contentDOM
|
|
146
|
-
} = DOMSerializer.renderSpec(document, toDOM());
|
|
147
|
+
} = DOMSerializer.renderSpec(document, toDOM(this.node));
|
|
147
148
|
|
|
148
149
|
// Ignored via go/ees005
|
|
149
150
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { uuid } from '@atlaskit/adf-schema';
|
|
1
2
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, LAYOUT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
2
3
|
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
3
4
|
import { flatmap, getStepRange, isEmptyDocument, mapChildren } from '@atlaskit/editor-common/utils';
|
|
@@ -132,23 +133,35 @@ export const createMultiColumnLayoutSection = (state, numberOfColumns = 2) => {
|
|
|
132
133
|
const columns = Fragment.fromArray(Array.from({
|
|
133
134
|
length: numberOfColumns
|
|
134
135
|
}, () => layoutColumn.createAndFill({
|
|
135
|
-
width: EVEN_DISTRIBUTED_COL_WIDTHS[numberOfColumns]
|
|
136
|
+
width: EVEN_DISTRIBUTED_COL_WIDTHS[numberOfColumns],
|
|
137
|
+
localId: fg('platform_editor_adf_with_localid') ? uuid.generate() : undefined
|
|
136
138
|
})));
|
|
137
|
-
|
|
139
|
+
const attrs = fg('platform_editor_adf_with_localid') ? {
|
|
140
|
+
localId: uuid.generate()
|
|
141
|
+
} : undefined;
|
|
142
|
+
return layoutSection.createAndFill(attrs, columns);
|
|
138
143
|
};
|
|
139
144
|
export const createDefaultLayoutSection = state => {
|
|
140
145
|
const {
|
|
141
146
|
layoutSection,
|
|
142
147
|
layoutColumn
|
|
143
148
|
} = state.schema.nodes;
|
|
144
|
-
|
|
145
149
|
// create a 50-50 layout by default
|
|
146
150
|
const columns = Fragment.fromArray([layoutColumn.createAndFill({
|
|
147
|
-
width: 50
|
|
151
|
+
width: 50,
|
|
152
|
+
...(fg('platform_editor_adf_with_localid') ? {
|
|
153
|
+
localId: uuid.generate()
|
|
154
|
+
} : undefined)
|
|
148
155
|
}), layoutColumn.createAndFill({
|
|
149
|
-
width: 50
|
|
156
|
+
width: 50,
|
|
157
|
+
...(fg('platform_editor_adf_with_localid') ? {
|
|
158
|
+
localId: uuid.generate()
|
|
159
|
+
} : undefined)
|
|
150
160
|
})]);
|
|
151
|
-
|
|
161
|
+
const attrs = fg('platform_editor_adf_with_localid') ? {
|
|
162
|
+
localId: uuid.generate()
|
|
163
|
+
} : undefined;
|
|
164
|
+
return layoutSection.createAndFill(attrs, columns);
|
|
152
165
|
};
|
|
153
166
|
export const insertLayoutColumns = (state, dispatch) => {
|
|
154
167
|
if (dispatch) {
|
|
@@ -176,13 +189,16 @@ export const insertLayoutColumnsWithAnalytics = editorAnalyticsAPI => inputMetho
|
|
|
176
189
|
* Add a column to the right of existing layout
|
|
177
190
|
*/
|
|
178
191
|
function addColumn(schema, pos) {
|
|
192
|
+
const attrs = fg('platform_editor_adf_with_localid') ? {
|
|
193
|
+
localId: uuid.generate()
|
|
194
|
+
} : undefined;
|
|
179
195
|
if (editorExperiment('advanced_layouts', false)) {
|
|
180
196
|
return tr => {
|
|
181
|
-
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill());
|
|
197
|
+
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill(attrs));
|
|
182
198
|
};
|
|
183
199
|
}
|
|
184
200
|
return tr => {
|
|
185
|
-
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill(
|
|
201
|
+
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill(attrs));
|
|
186
202
|
};
|
|
187
203
|
}
|
|
188
204
|
function removeLastColumnInLayout(column, columnPos, insideRightEdgePos) {
|
package/dist/esm/layoutPlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { layoutColumn, layoutSection } from '@atlaskit/adf-schema';
|
|
3
|
-
import { layoutSectionWithSingleColumn } from '@atlaskit/adf-schema/schema';
|
|
2
|
+
import { layoutColumn, layoutSection, layoutColumnWithLocalId } from '@atlaskit/adf-schema';
|
|
3
|
+
import { layoutSectionWithSingleColumn, layoutSectionWithSingleColumnLocalId } from '@atlaskit/adf-schema/schema';
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
import { layoutMessages, toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { IconFiveColumnLayout, IconFourColumnLayout, IconLayout, IconOneColumnLayout, IconThreeColumnLayout, IconTwoColumnLayout } from '@atlaskit/editor-common/quick-insert';
|
|
@@ -55,10 +55,10 @@ export var layoutPlugin = function layoutPlugin(_ref) {
|
|
|
55
55
|
nodes: function nodes() {
|
|
56
56
|
return [{
|
|
57
57
|
name: 'layoutSection',
|
|
58
|
-
node: editorExperiment('advanced_layouts', true) ? layoutSectionWithSingleColumn : layoutSection
|
|
58
|
+
node: editorExperiment('advanced_layouts', true) ? fg('platform_editor_adf_with_localid') ? layoutSectionWithSingleColumnLocalId : layoutSectionWithSingleColumn : layoutSection
|
|
59
59
|
}, {
|
|
60
60
|
name: 'layoutColumn',
|
|
61
|
-
node: layoutColumn
|
|
61
|
+
node: fg('platform_editor_adf_with_localid') ? layoutColumnWithLocalId : layoutColumn
|
|
62
62
|
}];
|
|
63
63
|
},
|
|
64
64
|
pmPlugins: function pmPlugins() {
|
|
@@ -110,9 +110,10 @@ var LayoutBreakoutResizer = function LayoutBreakoutResizer(_ref) {
|
|
|
110
110
|
dynamicFullWidthGuidelineOffset: layoutDynamicFullWidthGuidelineOffset
|
|
111
111
|
});
|
|
112
112
|
};
|
|
113
|
-
var toDOM = function toDOM() {
|
|
113
|
+
var toDOM = function toDOM(node) {
|
|
114
114
|
return ['div', {
|
|
115
|
-
class: 'layout-section-container'
|
|
115
|
+
class: 'layout-section-container',
|
|
116
|
+
'data-local-id': node.attrs.localId
|
|
116
117
|
}, ['div', {
|
|
117
118
|
'data-layout-section': true
|
|
118
119
|
}, 0]];
|
|
@@ -152,7 +153,7 @@ export var LayoutSectionView = /*#__PURE__*/function (_ReactNodeView) {
|
|
|
152
153
|
return _createClass(LayoutSectionView, [{
|
|
153
154
|
key: "getContentDOM",
|
|
154
155
|
value: function getContentDOM() {
|
|
155
|
-
var _ref2 = DOMSerializer.renderSpec(document, toDOM()),
|
|
156
|
+
var _ref2 = DOMSerializer.renderSpec(document, toDOM(this.node)),
|
|
156
157
|
container = _ref2.dom,
|
|
157
158
|
contentDOM = _ref2.contentDOM;
|
|
158
159
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
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; }
|
|
3
3
|
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) { _defineProperty(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; }
|
|
4
|
+
import { uuid } from '@atlaskit/adf-schema';
|
|
4
5
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, LAYOUT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
6
|
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
6
7
|
import { flatmap, getStepRange, isEmptyDocument, mapChildren } from '@atlaskit/editor-common/utils';
|
|
@@ -140,23 +141,33 @@ export var createMultiColumnLayoutSection = function createMultiColumnLayoutSect
|
|
|
140
141
|
length: numberOfColumns
|
|
141
142
|
}, function () {
|
|
142
143
|
return layoutColumn.createAndFill({
|
|
143
|
-
width: EVEN_DISTRIBUTED_COL_WIDTHS[numberOfColumns]
|
|
144
|
+
width: EVEN_DISTRIBUTED_COL_WIDTHS[numberOfColumns],
|
|
145
|
+
localId: fg('platform_editor_adf_with_localid') ? uuid.generate() : undefined
|
|
144
146
|
});
|
|
145
147
|
}));
|
|
146
|
-
|
|
148
|
+
var attrs = fg('platform_editor_adf_with_localid') ? {
|
|
149
|
+
localId: uuid.generate()
|
|
150
|
+
} : undefined;
|
|
151
|
+
return layoutSection.createAndFill(attrs, columns);
|
|
147
152
|
};
|
|
148
153
|
export var createDefaultLayoutSection = function createDefaultLayoutSection(state) {
|
|
149
154
|
var _state$schema$nodes2 = state.schema.nodes,
|
|
150
155
|
layoutSection = _state$schema$nodes2.layoutSection,
|
|
151
156
|
layoutColumn = _state$schema$nodes2.layoutColumn;
|
|
152
|
-
|
|
153
157
|
// create a 50-50 layout by default
|
|
154
|
-
var columns = Fragment.fromArray([layoutColumn.createAndFill({
|
|
158
|
+
var columns = Fragment.fromArray([layoutColumn.createAndFill(_objectSpread({
|
|
155
159
|
width: 50
|
|
156
|
-
}
|
|
160
|
+
}, fg('platform_editor_adf_with_localid') ? {
|
|
161
|
+
localId: uuid.generate()
|
|
162
|
+
} : undefined)), layoutColumn.createAndFill(_objectSpread({
|
|
157
163
|
width: 50
|
|
158
|
-
})
|
|
159
|
-
|
|
164
|
+
}, fg('platform_editor_adf_with_localid') ? {
|
|
165
|
+
localId: uuid.generate()
|
|
166
|
+
} : undefined))]);
|
|
167
|
+
var attrs = fg('platform_editor_adf_with_localid') ? {
|
|
168
|
+
localId: uuid.generate()
|
|
169
|
+
} : undefined;
|
|
170
|
+
return layoutSection.createAndFill(attrs, columns);
|
|
160
171
|
};
|
|
161
172
|
export var insertLayoutColumns = function insertLayoutColumns(state, dispatch) {
|
|
162
173
|
if (dispatch) {
|
|
@@ -188,13 +199,16 @@ export var insertLayoutColumnsWithAnalytics = function insertLayoutColumnsWithAn
|
|
|
188
199
|
* Add a column to the right of existing layout
|
|
189
200
|
*/
|
|
190
201
|
function addColumn(schema, pos) {
|
|
202
|
+
var attrs = fg('platform_editor_adf_with_localid') ? {
|
|
203
|
+
localId: uuid.generate()
|
|
204
|
+
} : undefined;
|
|
191
205
|
if (editorExperiment('advanced_layouts', false)) {
|
|
192
206
|
return function (tr) {
|
|
193
|
-
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill());
|
|
207
|
+
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill(attrs));
|
|
194
208
|
};
|
|
195
209
|
}
|
|
196
210
|
return function (tr) {
|
|
197
|
-
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill(
|
|
211
|
+
tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill(attrs));
|
|
198
212
|
};
|
|
199
213
|
}
|
|
200
214
|
function removeLastColumnInLayout(column, columnPos, insideRightEdgePos) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-layout",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
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
|
".": "./src/index.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/adf-schema": "^50.0
|
|
35
|
+
"@atlaskit/adf-schema": "^50.2.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^3.0.0",
|
|
37
37
|
"@atlaskit/editor-plugin-decorations": "^3.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-editor-disabled": "^3.0.0",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@atlaskit/icon": "^27.9.0",
|
|
46
46
|
"@atlaskit/icon-lab": "^5.3.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
|
-
"@atlaskit/tmp-editor-statsig": "^9.
|
|
48
|
+
"@atlaskit/tmp-editor-statsig": "^9.23.0",
|
|
49
49
|
"@atlaskit/tokens": "^6.0.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"@emotion/react": "^11.7.1"
|
|
@@ -108,6 +108,9 @@
|
|
|
108
108
|
},
|
|
109
109
|
"platform_editor_column_count_analytics": {
|
|
110
110
|
"type": "boolean"
|
|
111
|
+
},
|
|
112
|
+
"platform_editor_adf_with_localid": {
|
|
113
|
+
"type": "boolean"
|
|
111
114
|
}
|
|
112
115
|
}
|
|
113
116
|
}
|