@atlaskit/editor-plugin-layout 2.0.1 → 2.1.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 +15 -0
- package/dist/cjs/layoutPlugin.js +110 -86
- package/dist/es2019/layoutPlugin.js +99 -77
- package/dist/esm/layoutPlugin.js +110 -86
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-layout
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#120472](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120472)
|
|
8
|
+
[`73c800ab5f2fc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/73c800ab5f2fc) -
|
|
9
|
+
ED-26766 update adf-schema from 47.2.1 to 47.6.0 and adf-schema-json from 1.27.0 to 1.31.0
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#120007](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120007)
|
|
14
|
+
[`e87df0a8c73c6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e87df0a8c73c6) -
|
|
15
|
+
[ux] Do not add headings, lists, layouts, panels in the new QuickInsert menu
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 2.0.1
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/cjs/layoutPlugin.js
CHANGED
|
@@ -86,94 +86,118 @@ var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
|
|
|
86
86
|
}
|
|
87
87
|
return tr;
|
|
88
88
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
var tr = insert((0, _actions.createMultiColumnLayoutSection)(state, 2));
|
|
102
|
-
withInsertLayoutAnalytics(tr);
|
|
103
|
-
return tr;
|
|
104
|
-
}
|
|
105
|
-
}, {
|
|
106
|
-
id: 'threecolumnslayout',
|
|
107
|
-
title: formatMessage(_messages.layoutMessages.threeColumnsAdvancedLayout),
|
|
108
|
-
description: formatMessage(_messages.toolbarInsertBlockMessages.columnsDescriptionAdvancedLayout, {
|
|
109
|
-
numberOfColumns: 'three'
|
|
110
|
-
}),
|
|
111
|
-
keywords: ['layout', 'column', 'section', 'three column'],
|
|
112
|
-
priority: 1100,
|
|
113
|
-
icon: function icon() {
|
|
114
|
-
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconThreeColumnLayout, null);
|
|
115
|
-
},
|
|
116
|
-
action: function action(insert, state) {
|
|
117
|
-
var tr = insert((0, _actions.createMultiColumnLayoutSection)(state, 3));
|
|
118
|
-
withInsertLayoutAnalytics(tr);
|
|
119
|
-
return tr;
|
|
120
|
-
}
|
|
121
|
-
}, {
|
|
122
|
-
id: 'fourcolumnslayout',
|
|
123
|
-
title: formatMessage(_messages.layoutMessages.fourColumns),
|
|
124
|
-
description: formatMessage(_messages.toolbarInsertBlockMessages.columnsDescriptionAdvancedLayout, {
|
|
125
|
-
numberOfColumns: 'four'
|
|
126
|
-
}),
|
|
127
|
-
keywords: ['layout', 'column', 'section', 'four column'],
|
|
128
|
-
priority: 1100,
|
|
129
|
-
icon: function icon() {
|
|
130
|
-
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconFourColumnLayout, null);
|
|
131
|
-
},
|
|
132
|
-
action: function action(insert, state) {
|
|
133
|
-
var tr = insert((0, _actions.createMultiColumnLayoutSection)(state, 4));
|
|
134
|
-
withInsertLayoutAnalytics(tr);
|
|
135
|
-
return tr;
|
|
136
|
-
}
|
|
137
|
-
}, {
|
|
138
|
-
id: 'fivecolumnslayout',
|
|
139
|
-
title: formatMessage(_messages.layoutMessages.fiveColumns),
|
|
140
|
-
description: formatMessage(_messages.toolbarInsertBlockMessages.columnsDescriptionAdvancedLayout, {
|
|
141
|
-
numberOfColumns: 'five'
|
|
142
|
-
}),
|
|
143
|
-
keywords: ['layout', 'column', 'section', 'five column'],
|
|
144
|
-
priority: 1100,
|
|
145
|
-
icon: function icon() {
|
|
146
|
-
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconFiveColumnLayout, null);
|
|
147
|
-
},
|
|
148
|
-
action: function action(insert, state) {
|
|
149
|
-
var tr = insert((0, _actions.createMultiColumnLayoutSection)(state, 5));
|
|
150
|
-
withInsertLayoutAnalytics(tr);
|
|
151
|
-
return tr;
|
|
152
|
-
}
|
|
153
|
-
}] : [{
|
|
154
|
-
id: 'layout',
|
|
155
|
-
title: formatMessage(_messages.toolbarInsertBlockMessages.columns),
|
|
156
|
-
description: formatMessage(_messages.toolbarInsertBlockMessages.columnsDescription),
|
|
157
|
-
keywords: ['column', 'section'],
|
|
158
|
-
priority: 1100,
|
|
159
|
-
icon: function icon() {
|
|
160
|
-
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconLayout, null);
|
|
161
|
-
},
|
|
162
|
-
action: function action(insert, state) {
|
|
163
|
-
var _api$analytics3;
|
|
164
|
-
var tr = insert((0, _actions.createDefaultLayoutSection)(state));
|
|
165
|
-
api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 || (_api$analytics3 = _api$analytics3.actions) === null || _api$analytics3 === void 0 || _api$analytics3.attachAnalyticsEvent({
|
|
166
|
-
action: _analytics.ACTION.INSERTED,
|
|
167
|
-
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
168
|
-
actionSubjectId: _analytics.ACTION_SUBJECT_ID.LAYOUT,
|
|
169
|
-
attributes: {
|
|
170
|
-
inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
|
|
89
|
+
if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
90
|
+
if ((0, _experiments.editorExperiment)('platform_editor_insertion', 'variant1')) {
|
|
91
|
+
return [{
|
|
92
|
+
id: 'threecolumnslayout',
|
|
93
|
+
title: formatMessage(_messages.layoutMessages.threeColumnsAdvancedLayout),
|
|
94
|
+
description: formatMessage(_messages.toolbarInsertBlockMessages.columnsDescriptionAdvancedLayout, {
|
|
95
|
+
numberOfColumns: 'three'
|
|
96
|
+
}),
|
|
97
|
+
keywords: ['layout', 'column', 'section', 'three column'],
|
|
98
|
+
priority: 1100,
|
|
99
|
+
icon: function icon() {
|
|
100
|
+
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconThreeColumnLayout, null);
|
|
171
101
|
},
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
102
|
+
action: function action(insert, state) {
|
|
103
|
+
var tr = insert((0, _actions.createMultiColumnLayoutSection)(state, 3));
|
|
104
|
+
withInsertLayoutAnalytics(tr);
|
|
105
|
+
return tr;
|
|
106
|
+
}
|
|
107
|
+
}];
|
|
108
|
+
} else {
|
|
109
|
+
return [{
|
|
110
|
+
id: 'twocolumnslayout',
|
|
111
|
+
title: formatMessage(_messages.layoutMessages.twoColumnsAdvancedLayout),
|
|
112
|
+
description: formatMessage(_messages.toolbarInsertBlockMessages.columnsDescriptionAdvancedLayout, {
|
|
113
|
+
numberOfColumns: 'two'
|
|
114
|
+
}),
|
|
115
|
+
keywords: ['layout', 'column', 'section', 'two column'],
|
|
116
|
+
priority: 1100,
|
|
117
|
+
icon: function icon() {
|
|
118
|
+
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconTwoColumnLayout, null);
|
|
119
|
+
},
|
|
120
|
+
action: function action(insert, state) {
|
|
121
|
+
var tr = insert((0, _actions.createMultiColumnLayoutSection)(state, 2));
|
|
122
|
+
withInsertLayoutAnalytics(tr);
|
|
123
|
+
return tr;
|
|
124
|
+
}
|
|
125
|
+
}, {
|
|
126
|
+
id: 'threecolumnslayout',
|
|
127
|
+
title: formatMessage(_messages.layoutMessages.threeColumnsAdvancedLayout),
|
|
128
|
+
description: formatMessage(_messages.toolbarInsertBlockMessages.columnsDescriptionAdvancedLayout, {
|
|
129
|
+
numberOfColumns: 'three'
|
|
130
|
+
}),
|
|
131
|
+
keywords: ['layout', 'column', 'section', 'three column'],
|
|
132
|
+
priority: 1100,
|
|
133
|
+
icon: function icon() {
|
|
134
|
+
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconThreeColumnLayout, null);
|
|
135
|
+
},
|
|
136
|
+
action: function action(insert, state) {
|
|
137
|
+
var tr = insert((0, _actions.createMultiColumnLayoutSection)(state, 3));
|
|
138
|
+
withInsertLayoutAnalytics(tr);
|
|
139
|
+
return tr;
|
|
140
|
+
}
|
|
141
|
+
}, {
|
|
142
|
+
id: 'fourcolumnslayout',
|
|
143
|
+
title: formatMessage(_messages.layoutMessages.fourColumns),
|
|
144
|
+
description: formatMessage(_messages.toolbarInsertBlockMessages.columnsDescriptionAdvancedLayout, {
|
|
145
|
+
numberOfColumns: 'four'
|
|
146
|
+
}),
|
|
147
|
+
keywords: ['layout', 'column', 'section', 'four column'],
|
|
148
|
+
priority: 1100,
|
|
149
|
+
icon: function icon() {
|
|
150
|
+
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconFourColumnLayout, null);
|
|
151
|
+
},
|
|
152
|
+
action: function action(insert, state) {
|
|
153
|
+
var tr = insert((0, _actions.createMultiColumnLayoutSection)(state, 4));
|
|
154
|
+
withInsertLayoutAnalytics(tr);
|
|
155
|
+
return tr;
|
|
156
|
+
}
|
|
157
|
+
}, {
|
|
158
|
+
id: 'fivecolumnslayout',
|
|
159
|
+
title: formatMessage(_messages.layoutMessages.fiveColumns),
|
|
160
|
+
description: formatMessage(_messages.toolbarInsertBlockMessages.columnsDescriptionAdvancedLayout, {
|
|
161
|
+
numberOfColumns: 'five'
|
|
162
|
+
}),
|
|
163
|
+
keywords: ['layout', 'column', 'section', 'five column'],
|
|
164
|
+
priority: 1100,
|
|
165
|
+
icon: function icon() {
|
|
166
|
+
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconFiveColumnLayout, null);
|
|
167
|
+
},
|
|
168
|
+
action: function action(insert, state) {
|
|
169
|
+
var tr = insert((0, _actions.createMultiColumnLayoutSection)(state, 5));
|
|
170
|
+
withInsertLayoutAnalytics(tr);
|
|
171
|
+
return tr;
|
|
172
|
+
}
|
|
173
|
+
}];
|
|
175
174
|
}
|
|
176
|
-
}
|
|
175
|
+
} else {
|
|
176
|
+
return [{
|
|
177
|
+
id: 'layout',
|
|
178
|
+
title: formatMessage(_messages.toolbarInsertBlockMessages.columns),
|
|
179
|
+
description: formatMessage(_messages.toolbarInsertBlockMessages.columnsDescription),
|
|
180
|
+
keywords: ['column', 'section'],
|
|
181
|
+
priority: 1100,
|
|
182
|
+
icon: function icon() {
|
|
183
|
+
return /*#__PURE__*/_react.default.createElement(_quickInsert.IconLayout, null);
|
|
184
|
+
},
|
|
185
|
+
action: function action(insert, state) {
|
|
186
|
+
var _api$analytics3;
|
|
187
|
+
var tr = insert((0, _actions.createDefaultLayoutSection)(state));
|
|
188
|
+
api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 || (_api$analytics3 = _api$analytics3.actions) === null || _api$analytics3 === void 0 || _api$analytics3.attachAnalyticsEvent({
|
|
189
|
+
action: _analytics.ACTION.INSERTED,
|
|
190
|
+
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
191
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.LAYOUT,
|
|
192
|
+
attributes: {
|
|
193
|
+
inputMethod: _analytics.INPUT_METHOD.QUICK_INSERT
|
|
194
|
+
},
|
|
195
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
196
|
+
})(tr);
|
|
197
|
+
return tr;
|
|
198
|
+
}
|
|
199
|
+
}];
|
|
200
|
+
}
|
|
177
201
|
}
|
|
178
202
|
},
|
|
179
203
|
contentComponent: function contentComponent() {
|
|
@@ -78,84 +78,106 @@ export const layoutPlugin = ({
|
|
|
78
78
|
}
|
|
79
79
|
return tr;
|
|
80
80
|
};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
81
|
+
if (editorExperiment('advanced_layouts', true)) {
|
|
82
|
+
if (editorExperiment('platform_editor_insertion', 'variant1')) {
|
|
83
|
+
return [{
|
|
84
|
+
id: 'threecolumnslayout',
|
|
85
|
+
title: formatMessage(layoutMessages.threeColumnsAdvancedLayout),
|
|
86
|
+
description: formatMessage(messages.columnsDescriptionAdvancedLayout, {
|
|
87
|
+
numberOfColumns: 'three'
|
|
88
|
+
}),
|
|
89
|
+
keywords: ['layout', 'column', 'section', 'three column'],
|
|
90
|
+
priority: 1100,
|
|
91
|
+
icon: () => /*#__PURE__*/React.createElement(IconThreeColumnLayout, null),
|
|
92
|
+
action(insert, state) {
|
|
93
|
+
const tr = insert(createMultiColumnLayoutSection(state, 3));
|
|
94
|
+
withInsertLayoutAnalytics(tr);
|
|
95
|
+
return tr;
|
|
96
|
+
}
|
|
97
|
+
}];
|
|
98
|
+
} else {
|
|
99
|
+
return [{
|
|
100
|
+
id: 'twocolumnslayout',
|
|
101
|
+
title: formatMessage(layoutMessages.twoColumnsAdvancedLayout),
|
|
102
|
+
description: formatMessage(messages.columnsDescriptionAdvancedLayout, {
|
|
103
|
+
numberOfColumns: 'two'
|
|
104
|
+
}),
|
|
105
|
+
keywords: ['layout', 'column', 'section', 'two column'],
|
|
106
|
+
priority: 1100,
|
|
107
|
+
icon: () => /*#__PURE__*/React.createElement(IconTwoColumnLayout, null),
|
|
108
|
+
action(insert, state) {
|
|
109
|
+
const tr = insert(createMultiColumnLayoutSection(state, 2));
|
|
110
|
+
withInsertLayoutAnalytics(tr);
|
|
111
|
+
return tr;
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
id: 'threecolumnslayout',
|
|
115
|
+
title: formatMessage(layoutMessages.threeColumnsAdvancedLayout),
|
|
116
|
+
description: formatMessage(messages.columnsDescriptionAdvancedLayout, {
|
|
117
|
+
numberOfColumns: 'three'
|
|
118
|
+
}),
|
|
119
|
+
keywords: ['layout', 'column', 'section', 'three column'],
|
|
120
|
+
priority: 1100,
|
|
121
|
+
icon: () => /*#__PURE__*/React.createElement(IconThreeColumnLayout, null),
|
|
122
|
+
action(insert, state) {
|
|
123
|
+
const tr = insert(createMultiColumnLayoutSection(state, 3));
|
|
124
|
+
withInsertLayoutAnalytics(tr);
|
|
125
|
+
return tr;
|
|
126
|
+
}
|
|
127
|
+
}, {
|
|
128
|
+
id: 'fourcolumnslayout',
|
|
129
|
+
title: formatMessage(layoutMessages.fourColumns),
|
|
130
|
+
description: formatMessage(messages.columnsDescriptionAdvancedLayout, {
|
|
131
|
+
numberOfColumns: 'four'
|
|
132
|
+
}),
|
|
133
|
+
keywords: ['layout', 'column', 'section', 'four column'],
|
|
134
|
+
priority: 1100,
|
|
135
|
+
icon: () => /*#__PURE__*/React.createElement(IconFourColumnLayout, null),
|
|
136
|
+
action(insert, state) {
|
|
137
|
+
const tr = insert(createMultiColumnLayoutSection(state, 4));
|
|
138
|
+
withInsertLayoutAnalytics(tr);
|
|
139
|
+
return tr;
|
|
140
|
+
}
|
|
141
|
+
}, {
|
|
142
|
+
id: 'fivecolumnslayout',
|
|
143
|
+
title: formatMessage(layoutMessages.fiveColumns),
|
|
144
|
+
description: formatMessage(messages.columnsDescriptionAdvancedLayout, {
|
|
145
|
+
numberOfColumns: 'five'
|
|
146
|
+
}),
|
|
147
|
+
keywords: ['layout', 'column', 'section', 'five column'],
|
|
148
|
+
priority: 1100,
|
|
149
|
+
icon: () => /*#__PURE__*/React.createElement(IconFiveColumnLayout, null),
|
|
150
|
+
action(insert, state) {
|
|
151
|
+
const tr = insert(createMultiColumnLayoutSection(state, 5));
|
|
152
|
+
withInsertLayoutAnalytics(tr);
|
|
153
|
+
return tr;
|
|
154
|
+
}
|
|
155
|
+
}];
|
|
94
156
|
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const tr = insert(createMultiColumnLayoutSection(state, 4));
|
|
120
|
-
withInsertLayoutAnalytics(tr);
|
|
121
|
-
return tr;
|
|
122
|
-
}
|
|
123
|
-
}, {
|
|
124
|
-
id: 'fivecolumnslayout',
|
|
125
|
-
title: formatMessage(layoutMessages.fiveColumns),
|
|
126
|
-
description: formatMessage(messages.columnsDescriptionAdvancedLayout, {
|
|
127
|
-
numberOfColumns: 'five'
|
|
128
|
-
}),
|
|
129
|
-
keywords: ['layout', 'column', 'section', 'five column'],
|
|
130
|
-
priority: 1100,
|
|
131
|
-
icon: () => /*#__PURE__*/React.createElement(IconFiveColumnLayout, null),
|
|
132
|
-
action(insert, state) {
|
|
133
|
-
const tr = insert(createMultiColumnLayoutSection(state, 5));
|
|
134
|
-
withInsertLayoutAnalytics(tr);
|
|
135
|
-
return tr;
|
|
136
|
-
}
|
|
137
|
-
}] : [{
|
|
138
|
-
id: 'layout',
|
|
139
|
-
title: formatMessage(messages.columns),
|
|
140
|
-
description: formatMessage(messages.columnsDescription),
|
|
141
|
-
keywords: ['column', 'section'],
|
|
142
|
-
priority: 1100,
|
|
143
|
-
icon: () => /*#__PURE__*/React.createElement(IconLayout, null),
|
|
144
|
-
action(insert, state) {
|
|
145
|
-
var _api$analytics3, _api$analytics3$actio;
|
|
146
|
-
const tr = insert(createDefaultLayoutSection(state));
|
|
147
|
-
api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : (_api$analytics3$actio = _api$analytics3.actions) === null || _api$analytics3$actio === void 0 ? void 0 : _api$analytics3$actio.attachAnalyticsEvent({
|
|
148
|
-
action: ACTION.INSERTED,
|
|
149
|
-
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
150
|
-
actionSubjectId: ACTION_SUBJECT_ID.LAYOUT,
|
|
151
|
-
attributes: {
|
|
152
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
153
|
-
},
|
|
154
|
-
eventType: EVENT_TYPE.TRACK
|
|
155
|
-
})(tr);
|
|
156
|
-
return tr;
|
|
157
|
-
}
|
|
158
|
-
}];
|
|
157
|
+
} else {
|
|
158
|
+
return [{
|
|
159
|
+
id: 'layout',
|
|
160
|
+
title: formatMessage(messages.columns),
|
|
161
|
+
description: formatMessage(messages.columnsDescription),
|
|
162
|
+
keywords: ['column', 'section'],
|
|
163
|
+
priority: 1100,
|
|
164
|
+
icon: () => /*#__PURE__*/React.createElement(IconLayout, null),
|
|
165
|
+
action(insert, state) {
|
|
166
|
+
var _api$analytics3, _api$analytics3$actio;
|
|
167
|
+
const tr = insert(createDefaultLayoutSection(state));
|
|
168
|
+
api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : (_api$analytics3$actio = _api$analytics3.actions) === null || _api$analytics3$actio === void 0 ? void 0 : _api$analytics3$actio.attachAnalyticsEvent({
|
|
169
|
+
action: ACTION.INSERTED,
|
|
170
|
+
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
171
|
+
actionSubjectId: ACTION_SUBJECT_ID.LAYOUT,
|
|
172
|
+
attributes: {
|
|
173
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
174
|
+
},
|
|
175
|
+
eventType: EVENT_TYPE.TRACK
|
|
176
|
+
})(tr);
|
|
177
|
+
return tr;
|
|
178
|
+
}
|
|
179
|
+
}];
|
|
180
|
+
}
|
|
159
181
|
}
|
|
160
182
|
},
|
|
161
183
|
contentComponent() {
|
package/dist/esm/layoutPlugin.js
CHANGED
|
@@ -79,94 +79,118 @@ export var layoutPlugin = function layoutPlugin(_ref) {
|
|
|
79
79
|
}
|
|
80
80
|
return tr;
|
|
81
81
|
};
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
var tr = insert(createMultiColumnLayoutSection(state, 2));
|
|
95
|
-
withInsertLayoutAnalytics(tr);
|
|
96
|
-
return tr;
|
|
97
|
-
}
|
|
98
|
-
}, {
|
|
99
|
-
id: 'threecolumnslayout',
|
|
100
|
-
title: formatMessage(layoutMessages.threeColumnsAdvancedLayout),
|
|
101
|
-
description: formatMessage(messages.columnsDescriptionAdvancedLayout, {
|
|
102
|
-
numberOfColumns: 'three'
|
|
103
|
-
}),
|
|
104
|
-
keywords: ['layout', 'column', 'section', 'three column'],
|
|
105
|
-
priority: 1100,
|
|
106
|
-
icon: function icon() {
|
|
107
|
-
return /*#__PURE__*/React.createElement(IconThreeColumnLayout, null);
|
|
108
|
-
},
|
|
109
|
-
action: function action(insert, state) {
|
|
110
|
-
var tr = insert(createMultiColumnLayoutSection(state, 3));
|
|
111
|
-
withInsertLayoutAnalytics(tr);
|
|
112
|
-
return tr;
|
|
113
|
-
}
|
|
114
|
-
}, {
|
|
115
|
-
id: 'fourcolumnslayout',
|
|
116
|
-
title: formatMessage(layoutMessages.fourColumns),
|
|
117
|
-
description: formatMessage(messages.columnsDescriptionAdvancedLayout, {
|
|
118
|
-
numberOfColumns: 'four'
|
|
119
|
-
}),
|
|
120
|
-
keywords: ['layout', 'column', 'section', 'four column'],
|
|
121
|
-
priority: 1100,
|
|
122
|
-
icon: function icon() {
|
|
123
|
-
return /*#__PURE__*/React.createElement(IconFourColumnLayout, null);
|
|
124
|
-
},
|
|
125
|
-
action: function action(insert, state) {
|
|
126
|
-
var tr = insert(createMultiColumnLayoutSection(state, 4));
|
|
127
|
-
withInsertLayoutAnalytics(tr);
|
|
128
|
-
return tr;
|
|
129
|
-
}
|
|
130
|
-
}, {
|
|
131
|
-
id: 'fivecolumnslayout',
|
|
132
|
-
title: formatMessage(layoutMessages.fiveColumns),
|
|
133
|
-
description: formatMessage(messages.columnsDescriptionAdvancedLayout, {
|
|
134
|
-
numberOfColumns: 'five'
|
|
135
|
-
}),
|
|
136
|
-
keywords: ['layout', 'column', 'section', 'five column'],
|
|
137
|
-
priority: 1100,
|
|
138
|
-
icon: function icon() {
|
|
139
|
-
return /*#__PURE__*/React.createElement(IconFiveColumnLayout, null);
|
|
140
|
-
},
|
|
141
|
-
action: function action(insert, state) {
|
|
142
|
-
var tr = insert(createMultiColumnLayoutSection(state, 5));
|
|
143
|
-
withInsertLayoutAnalytics(tr);
|
|
144
|
-
return tr;
|
|
145
|
-
}
|
|
146
|
-
}] : [{
|
|
147
|
-
id: 'layout',
|
|
148
|
-
title: formatMessage(messages.columns),
|
|
149
|
-
description: formatMessage(messages.columnsDescription),
|
|
150
|
-
keywords: ['column', 'section'],
|
|
151
|
-
priority: 1100,
|
|
152
|
-
icon: function icon() {
|
|
153
|
-
return /*#__PURE__*/React.createElement(IconLayout, null);
|
|
154
|
-
},
|
|
155
|
-
action: function action(insert, state) {
|
|
156
|
-
var _api$analytics3;
|
|
157
|
-
var tr = insert(createDefaultLayoutSection(state));
|
|
158
|
-
api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 || (_api$analytics3 = _api$analytics3.actions) === null || _api$analytics3 === void 0 || _api$analytics3.attachAnalyticsEvent({
|
|
159
|
-
action: ACTION.INSERTED,
|
|
160
|
-
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
161
|
-
actionSubjectId: ACTION_SUBJECT_ID.LAYOUT,
|
|
162
|
-
attributes: {
|
|
163
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
82
|
+
if (editorExperiment('advanced_layouts', true)) {
|
|
83
|
+
if (editorExperiment('platform_editor_insertion', 'variant1')) {
|
|
84
|
+
return [{
|
|
85
|
+
id: 'threecolumnslayout',
|
|
86
|
+
title: formatMessage(layoutMessages.threeColumnsAdvancedLayout),
|
|
87
|
+
description: formatMessage(messages.columnsDescriptionAdvancedLayout, {
|
|
88
|
+
numberOfColumns: 'three'
|
|
89
|
+
}),
|
|
90
|
+
keywords: ['layout', 'column', 'section', 'three column'],
|
|
91
|
+
priority: 1100,
|
|
92
|
+
icon: function icon() {
|
|
93
|
+
return /*#__PURE__*/React.createElement(IconThreeColumnLayout, null);
|
|
164
94
|
},
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
95
|
+
action: function action(insert, state) {
|
|
96
|
+
var tr = insert(createMultiColumnLayoutSection(state, 3));
|
|
97
|
+
withInsertLayoutAnalytics(tr);
|
|
98
|
+
return tr;
|
|
99
|
+
}
|
|
100
|
+
}];
|
|
101
|
+
} else {
|
|
102
|
+
return [{
|
|
103
|
+
id: 'twocolumnslayout',
|
|
104
|
+
title: formatMessage(layoutMessages.twoColumnsAdvancedLayout),
|
|
105
|
+
description: formatMessage(messages.columnsDescriptionAdvancedLayout, {
|
|
106
|
+
numberOfColumns: 'two'
|
|
107
|
+
}),
|
|
108
|
+
keywords: ['layout', 'column', 'section', 'two column'],
|
|
109
|
+
priority: 1100,
|
|
110
|
+
icon: function icon() {
|
|
111
|
+
return /*#__PURE__*/React.createElement(IconTwoColumnLayout, null);
|
|
112
|
+
},
|
|
113
|
+
action: function action(insert, state) {
|
|
114
|
+
var tr = insert(createMultiColumnLayoutSection(state, 2));
|
|
115
|
+
withInsertLayoutAnalytics(tr);
|
|
116
|
+
return tr;
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
id: 'threecolumnslayout',
|
|
120
|
+
title: formatMessage(layoutMessages.threeColumnsAdvancedLayout),
|
|
121
|
+
description: formatMessage(messages.columnsDescriptionAdvancedLayout, {
|
|
122
|
+
numberOfColumns: 'three'
|
|
123
|
+
}),
|
|
124
|
+
keywords: ['layout', 'column', 'section', 'three column'],
|
|
125
|
+
priority: 1100,
|
|
126
|
+
icon: function icon() {
|
|
127
|
+
return /*#__PURE__*/React.createElement(IconThreeColumnLayout, null);
|
|
128
|
+
},
|
|
129
|
+
action: function action(insert, state) {
|
|
130
|
+
var tr = insert(createMultiColumnLayoutSection(state, 3));
|
|
131
|
+
withInsertLayoutAnalytics(tr);
|
|
132
|
+
return tr;
|
|
133
|
+
}
|
|
134
|
+
}, {
|
|
135
|
+
id: 'fourcolumnslayout',
|
|
136
|
+
title: formatMessage(layoutMessages.fourColumns),
|
|
137
|
+
description: formatMessage(messages.columnsDescriptionAdvancedLayout, {
|
|
138
|
+
numberOfColumns: 'four'
|
|
139
|
+
}),
|
|
140
|
+
keywords: ['layout', 'column', 'section', 'four column'],
|
|
141
|
+
priority: 1100,
|
|
142
|
+
icon: function icon() {
|
|
143
|
+
return /*#__PURE__*/React.createElement(IconFourColumnLayout, null);
|
|
144
|
+
},
|
|
145
|
+
action: function action(insert, state) {
|
|
146
|
+
var tr = insert(createMultiColumnLayoutSection(state, 4));
|
|
147
|
+
withInsertLayoutAnalytics(tr);
|
|
148
|
+
return tr;
|
|
149
|
+
}
|
|
150
|
+
}, {
|
|
151
|
+
id: 'fivecolumnslayout',
|
|
152
|
+
title: formatMessage(layoutMessages.fiveColumns),
|
|
153
|
+
description: formatMessage(messages.columnsDescriptionAdvancedLayout, {
|
|
154
|
+
numberOfColumns: 'five'
|
|
155
|
+
}),
|
|
156
|
+
keywords: ['layout', 'column', 'section', 'five column'],
|
|
157
|
+
priority: 1100,
|
|
158
|
+
icon: function icon() {
|
|
159
|
+
return /*#__PURE__*/React.createElement(IconFiveColumnLayout, null);
|
|
160
|
+
},
|
|
161
|
+
action: function action(insert, state) {
|
|
162
|
+
var tr = insert(createMultiColumnLayoutSection(state, 5));
|
|
163
|
+
withInsertLayoutAnalytics(tr);
|
|
164
|
+
return tr;
|
|
165
|
+
}
|
|
166
|
+
}];
|
|
168
167
|
}
|
|
169
|
-
}
|
|
168
|
+
} else {
|
|
169
|
+
return [{
|
|
170
|
+
id: 'layout',
|
|
171
|
+
title: formatMessage(messages.columns),
|
|
172
|
+
description: formatMessage(messages.columnsDescription),
|
|
173
|
+
keywords: ['column', 'section'],
|
|
174
|
+
priority: 1100,
|
|
175
|
+
icon: function icon() {
|
|
176
|
+
return /*#__PURE__*/React.createElement(IconLayout, null);
|
|
177
|
+
},
|
|
178
|
+
action: function action(insert, state) {
|
|
179
|
+
var _api$analytics3;
|
|
180
|
+
var tr = insert(createDefaultLayoutSection(state));
|
|
181
|
+
api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 || (_api$analytics3 = _api$analytics3.actions) === null || _api$analytics3 === void 0 || _api$analytics3.attachAnalyticsEvent({
|
|
182
|
+
action: ACTION.INSERTED,
|
|
183
|
+
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
184
|
+
actionSubjectId: ACTION_SUBJECT_ID.LAYOUT,
|
|
185
|
+
attributes: {
|
|
186
|
+
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
187
|
+
},
|
|
188
|
+
eventType: EVENT_TYPE.TRACK
|
|
189
|
+
})(tr);
|
|
190
|
+
return tr;
|
|
191
|
+
}
|
|
192
|
+
}];
|
|
193
|
+
}
|
|
170
194
|
}
|
|
171
195
|
},
|
|
172
196
|
contentComponent: function contentComponent() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-layout",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Layout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
".": "./src/index.ts"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@atlaskit/adf-schema": "^47.
|
|
37
|
-
"@atlaskit/editor-common": "^100.
|
|
38
|
-
"@atlaskit/editor-plugin-analytics": "^2.
|
|
36
|
+
"@atlaskit/adf-schema": "^47.6.0",
|
|
37
|
+
"@atlaskit/editor-common": "^100.5.0",
|
|
38
|
+
"@atlaskit/editor-plugin-analytics": "^2.1.0",
|
|
39
39
|
"@atlaskit/editor-plugin-decorations": "^2.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
41
41
|
"@atlaskit/editor-plugin-selection": "^2.0.0",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
44
44
|
"@atlaskit/icon": "^24.1.0",
|
|
45
45
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
46
|
-
"@atlaskit/tmp-editor-statsig": "^3.
|
|
47
|
-
"@atlaskit/tokens": "^4.
|
|
46
|
+
"@atlaskit/tmp-editor-statsig": "^3.4.0",
|
|
47
|
+
"@atlaskit/tokens": "^4.3.0",
|
|
48
48
|
"@babel/runtime": "^7.0.0",
|
|
49
49
|
"@emotion/react": "^11.7.1"
|
|
50
50
|
},
|