@atlaskit/editor-plugin-layout 1.13.0 → 1.13.1
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 +6 -0
- package/dist/cjs/pm-plugins/actions.js +0 -11
- package/dist/cjs/pm-plugins/main.js +0 -2
- package/dist/cjs/pm-plugins/resizing.js +1 -4
- package/dist/cjs/ui/toolbar.js +2 -8
- package/dist/es2019/pm-plugins/actions.js +0 -11
- package/dist/es2019/pm-plugins/main.js +0 -2
- package/dist/es2019/pm-plugins/resizing.js +1 -4
- package/dist/es2019/ui/toolbar.js +2 -8
- package/dist/esm/pm-plugins/actions.js +0 -11
- package/dist/esm/pm-plugins/main.js +0 -2
- package/dist/esm/pm-plugins/resizing.js +1 -4
- package/dist/esm/ui/toolbar.js +2 -8
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -260,8 +260,6 @@ var decreaseColumns = function decreaseColumns(node, insideRightEdgePos) {
|
|
|
260
260
|
* Switching from 3 -> 2 moves all the content of the third col inside the second before
|
|
261
261
|
* removing it
|
|
262
262
|
*/
|
|
263
|
-
// Ignored via go/ees005
|
|
264
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
265
263
|
function forceColumnStructure(state, node, pos, presetLayout) {
|
|
266
264
|
var tr = state.tr;
|
|
267
265
|
var insideRightEdgeOfLayoutSection = pos + node.nodeSize - 1;
|
|
@@ -296,9 +294,6 @@ function forceColumnStructure(state, node, pos, presetLayout) {
|
|
|
296
294
|
}
|
|
297
295
|
return tr;
|
|
298
296
|
}
|
|
299
|
-
|
|
300
|
-
// Ignored via go/ees005
|
|
301
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
302
297
|
function forceColumnStructureNew(state, node, pos, presetLayout) {
|
|
303
298
|
var tr = state.tr;
|
|
304
299
|
var insideRightEdgeOfLayoutSection = pos + node.nodeSize - 1;
|
|
@@ -326,9 +321,6 @@ function columnWidth(node, schema, widths) {
|
|
|
326
321
|
}
|
|
327
322
|
});
|
|
328
323
|
}
|
|
329
|
-
|
|
330
|
-
// Ignored via go/ees005
|
|
331
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
332
324
|
function forceColumnWidths(state, tr, pos, presetLayout) {
|
|
333
325
|
var node = tr.doc.nodeAt(pos);
|
|
334
326
|
if (!node) {
|
|
@@ -336,9 +328,6 @@ function forceColumnWidths(state, tr, pos, presetLayout) {
|
|
|
336
328
|
}
|
|
337
329
|
return tr.replaceWith(pos + 1, pos + node.nodeSize - 1, columnWidth(node, state.schema, getWidthsForPreset(presetLayout)));
|
|
338
330
|
}
|
|
339
|
-
|
|
340
|
-
// Ignored via go/ees005
|
|
341
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
342
331
|
function forceSectionToPresetLayout(state, node, pos, presetLayout) {
|
|
343
332
|
var forceColumnStructureFn = (0, _experiments.editorExperiment)('advanced_layouts', true) ? forceColumnStructureNew : forceColumnStructure;
|
|
344
333
|
var tr = forceColumnStructureFn(state, node, pos, presetLayout);
|
|
@@ -92,8 +92,6 @@ var _default = exports.default = function _default(options) {
|
|
|
92
92
|
init: function init(_, state) {
|
|
93
93
|
return getInitialPluginState(options, state);
|
|
94
94
|
},
|
|
95
|
-
// Ignored via go/ees005
|
|
96
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
97
95
|
apply: function apply(tr, pluginState, _oldState, newState) {
|
|
98
96
|
if (tr.docChanged || tr.selectionSet) {
|
|
99
97
|
var maybeLayoutSection = (0, _utils3.getMaybeLayoutSection)(newState);
|
|
@@ -8,10 +8,7 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
8
8
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
9
|
var _nodeviews = require("../nodeviews");
|
|
10
10
|
var pluginKey = exports.pluginKey = new _state.PluginKey('layoutResizingPlugin');
|
|
11
|
-
var _default = exports.default = function _default(options, pluginInjectionApi, portalProviderAPI, eventDispatcher
|
|
12
|
-
// Ignored via go/ees005
|
|
13
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
14
|
-
) {
|
|
11
|
+
var _default = exports.default = function _default(options, pluginInjectionApi, portalProviderAPI, eventDispatcher) {
|
|
15
12
|
return new _safePlugin.SafePlugin({
|
|
16
13
|
key: pluginKey,
|
|
17
14
|
props: {
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -115,10 +115,7 @@ var LAYOUT_WITH_THREE_COL_DISTRIBUTION = [{
|
|
|
115
115
|
icon: _LayoutThreeWithLeftSidebars.LayoutThreeWithLeftSidebarsIcon,
|
|
116
116
|
iconFallback: _LayoutThreeWithLeftSidebars.LayoutThreeWithLeftSidebarsIcon
|
|
117
117
|
}];
|
|
118
|
-
var buildLayoutButton = function buildLayoutButton(intl, item, currentLayout, editorAnalyticsAPI
|
|
119
|
-
// Ignored via go/ees005
|
|
120
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
121
|
-
) {
|
|
118
|
+
var buildLayoutButton = function buildLayoutButton(intl, item, currentLayout, editorAnalyticsAPI) {
|
|
122
119
|
return {
|
|
123
120
|
id: item.id,
|
|
124
121
|
type: 'button',
|
|
@@ -200,10 +197,7 @@ var getAdvancedLayoutItems = function getAdvancedLayoutItems(_ref) {
|
|
|
200
197
|
}]
|
|
201
198
|
}, separator, deleteButton]);
|
|
202
199
|
};
|
|
203
|
-
var buildToolbar = exports.buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout, addSidebarLayouts, allowSingleColumnLayout, api
|
|
204
|
-
// Ignored via go/ees005
|
|
205
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
206
|
-
) {
|
|
200
|
+
var buildToolbar = exports.buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout, addSidebarLayouts, allowSingleColumnLayout, api) {
|
|
207
201
|
var _api$decorations$acti, _api$decorations, _api$analytics;
|
|
208
202
|
var _ref2 = (_api$decorations$acti = api === null || api === void 0 || (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions) !== null && _api$decorations$acti !== void 0 ? _api$decorations$acti : {},
|
|
209
203
|
hoverDecoration = _ref2.hoverDecoration;
|
|
@@ -237,8 +237,6 @@ const decreaseColumns = (node, insideRightEdgePos, columnsNumberToRemove = 1) =>
|
|
|
237
237
|
* Switching from 3 -> 2 moves all the content of the third col inside the second before
|
|
238
238
|
* removing it
|
|
239
239
|
*/
|
|
240
|
-
// Ignored via go/ees005
|
|
241
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
242
240
|
function forceColumnStructure(state, node, pos, presetLayout) {
|
|
243
241
|
const tr = state.tr;
|
|
244
242
|
const insideRightEdgeOfLayoutSection = pos + node.nodeSize - 1;
|
|
@@ -273,9 +271,6 @@ function forceColumnStructure(state, node, pos, presetLayout) {
|
|
|
273
271
|
}
|
|
274
272
|
return tr;
|
|
275
273
|
}
|
|
276
|
-
|
|
277
|
-
// Ignored via go/ees005
|
|
278
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
279
274
|
function forceColumnStructureNew(state, node, pos, presetLayout) {
|
|
280
275
|
const tr = state.tr;
|
|
281
276
|
const insideRightEdgeOfLayoutSection = pos + node.nodeSize - 1;
|
|
@@ -304,9 +299,6 @@ function columnWidth(node, schema, widths) {
|
|
|
304
299
|
}
|
|
305
300
|
});
|
|
306
301
|
}
|
|
307
|
-
|
|
308
|
-
// Ignored via go/ees005
|
|
309
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
310
302
|
function forceColumnWidths(state, tr, pos, presetLayout) {
|
|
311
303
|
const node = tr.doc.nodeAt(pos);
|
|
312
304
|
if (!node) {
|
|
@@ -314,9 +306,6 @@ function forceColumnWidths(state, tr, pos, presetLayout) {
|
|
|
314
306
|
}
|
|
315
307
|
return tr.replaceWith(pos + 1, pos + node.nodeSize - 1, columnWidth(node, state.schema, getWidthsForPreset(presetLayout)));
|
|
316
308
|
}
|
|
317
|
-
|
|
318
|
-
// Ignored via go/ees005
|
|
319
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
320
309
|
export function forceSectionToPresetLayout(state, node, pos, presetLayout) {
|
|
321
310
|
const forceColumnStructureFn = editorExperiment('advanced_layouts', true) ? forceColumnStructureNew : forceColumnStructure;
|
|
322
311
|
let tr = forceColumnStructureFn(state, node, pos, presetLayout);
|
|
@@ -84,8 +84,6 @@ export default (options => new SafePlugin({
|
|
|
84
84
|
key: pluginKey,
|
|
85
85
|
state: {
|
|
86
86
|
init: (_, state) => getInitialPluginState(options, state),
|
|
87
|
-
// Ignored via go/ees005
|
|
88
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
89
87
|
apply: (tr, pluginState, _oldState, newState) => {
|
|
90
88
|
if (tr.docChanged || tr.selectionSet) {
|
|
91
89
|
const maybeLayoutSection = getMaybeLayoutSection(newState);
|
|
@@ -2,10 +2,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { LayoutSectionView } from '../nodeviews';
|
|
4
4
|
export const pluginKey = new PluginKey('layoutResizingPlugin');
|
|
5
|
-
export default ((options, pluginInjectionApi, portalProviderAPI, eventDispatcher
|
|
6
|
-
// Ignored via go/ees005
|
|
7
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
8
|
-
) => new SafePlugin({
|
|
5
|
+
export default ((options, pluginInjectionApi, portalProviderAPI, eventDispatcher) => new SafePlugin({
|
|
9
6
|
key: pluginKey,
|
|
10
7
|
props: {
|
|
11
8
|
nodeViews: {
|
|
@@ -104,10 +104,7 @@ const LAYOUT_WITH_THREE_COL_DISTRIBUTION = [{
|
|
|
104
104
|
icon: LayoutThreeWithLeftSidebarsIcon,
|
|
105
105
|
iconFallback: LayoutThreeWithLeftSidebarsIcon
|
|
106
106
|
}];
|
|
107
|
-
const buildLayoutButton = (intl, item, currentLayout, editorAnalyticsAPI
|
|
108
|
-
// Ignored via go/ees005
|
|
109
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
110
|
-
) => ({
|
|
107
|
+
const buildLayoutButton = (intl, item, currentLayout, editorAnalyticsAPI) => ({
|
|
111
108
|
id: item.id,
|
|
112
109
|
type: 'button',
|
|
113
110
|
icon: item.icon,
|
|
@@ -186,10 +183,7 @@ const getAdvancedLayoutItems = ({
|
|
|
186
183
|
}]
|
|
187
184
|
}, separator, deleteButton];
|
|
188
185
|
};
|
|
189
|
-
export const buildToolbar = (state, intl, pos, _allowBreakout, addSidebarLayouts, allowSingleColumnLayout, api
|
|
190
|
-
// Ignored via go/ees005
|
|
191
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
192
|
-
) => {
|
|
186
|
+
export const buildToolbar = (state, intl, pos, _allowBreakout, addSidebarLayouts, allowSingleColumnLayout, api) => {
|
|
193
187
|
var _api$decorations$acti, _api$decorations, _api$analytics;
|
|
194
188
|
const {
|
|
195
189
|
hoverDecoration
|
|
@@ -251,8 +251,6 @@ var decreaseColumns = function decreaseColumns(node, insideRightEdgePos) {
|
|
|
251
251
|
* Switching from 3 -> 2 moves all the content of the third col inside the second before
|
|
252
252
|
* removing it
|
|
253
253
|
*/
|
|
254
|
-
// Ignored via go/ees005
|
|
255
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
256
254
|
function forceColumnStructure(state, node, pos, presetLayout) {
|
|
257
255
|
var tr = state.tr;
|
|
258
256
|
var insideRightEdgeOfLayoutSection = pos + node.nodeSize - 1;
|
|
@@ -287,9 +285,6 @@ function forceColumnStructure(state, node, pos, presetLayout) {
|
|
|
287
285
|
}
|
|
288
286
|
return tr;
|
|
289
287
|
}
|
|
290
|
-
|
|
291
|
-
// Ignored via go/ees005
|
|
292
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
293
288
|
function forceColumnStructureNew(state, node, pos, presetLayout) {
|
|
294
289
|
var tr = state.tr;
|
|
295
290
|
var insideRightEdgeOfLayoutSection = pos + node.nodeSize - 1;
|
|
@@ -317,9 +312,6 @@ function columnWidth(node, schema, widths) {
|
|
|
317
312
|
}
|
|
318
313
|
});
|
|
319
314
|
}
|
|
320
|
-
|
|
321
|
-
// Ignored via go/ees005
|
|
322
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
323
315
|
function forceColumnWidths(state, tr, pos, presetLayout) {
|
|
324
316
|
var node = tr.doc.nodeAt(pos);
|
|
325
317
|
if (!node) {
|
|
@@ -327,9 +319,6 @@ function forceColumnWidths(state, tr, pos, presetLayout) {
|
|
|
327
319
|
}
|
|
328
320
|
return tr.replaceWith(pos + 1, pos + node.nodeSize - 1, columnWidth(node, state.schema, getWidthsForPreset(presetLayout)));
|
|
329
321
|
}
|
|
330
|
-
|
|
331
|
-
// Ignored via go/ees005
|
|
332
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
333
322
|
export function forceSectionToPresetLayout(state, node, pos, presetLayout) {
|
|
334
323
|
var forceColumnStructureFn = editorExperiment('advanced_layouts', true) ? forceColumnStructureNew : forceColumnStructure;
|
|
335
324
|
var tr = forceColumnStructureFn(state, node, pos, presetLayout);
|
|
@@ -85,8 +85,6 @@ export default (function (options) {
|
|
|
85
85
|
init: function init(_, state) {
|
|
86
86
|
return getInitialPluginState(options, state);
|
|
87
87
|
},
|
|
88
|
-
// Ignored via go/ees005
|
|
89
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
90
88
|
apply: function apply(tr, pluginState, _oldState, newState) {
|
|
91
89
|
if (tr.docChanged || tr.selectionSet) {
|
|
92
90
|
var maybeLayoutSection = getMaybeLayoutSection(newState);
|
|
@@ -2,10 +2,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import { LayoutSectionView } from '../nodeviews';
|
|
4
4
|
export var pluginKey = new PluginKey('layoutResizingPlugin');
|
|
5
|
-
export default (function (options, pluginInjectionApi, portalProviderAPI, eventDispatcher
|
|
6
|
-
// Ignored via go/ees005
|
|
7
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
8
|
-
) {
|
|
5
|
+
export default (function (options, pluginInjectionApi, portalProviderAPI, eventDispatcher) {
|
|
9
6
|
return new SafePlugin({
|
|
10
7
|
key: pluginKey,
|
|
11
8
|
props: {
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -105,10 +105,7 @@ var LAYOUT_WITH_THREE_COL_DISTRIBUTION = [{
|
|
|
105
105
|
icon: LayoutThreeWithLeftSidebarsIcon,
|
|
106
106
|
iconFallback: LayoutThreeWithLeftSidebarsIcon
|
|
107
107
|
}];
|
|
108
|
-
var buildLayoutButton = function buildLayoutButton(intl, item, currentLayout, editorAnalyticsAPI
|
|
109
|
-
// Ignored via go/ees005
|
|
110
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
111
|
-
) {
|
|
108
|
+
var buildLayoutButton = function buildLayoutButton(intl, item, currentLayout, editorAnalyticsAPI) {
|
|
112
109
|
return {
|
|
113
110
|
id: item.id,
|
|
114
111
|
type: 'button',
|
|
@@ -190,10 +187,7 @@ var getAdvancedLayoutItems = function getAdvancedLayoutItems(_ref) {
|
|
|
190
187
|
}]
|
|
191
188
|
}, separator, deleteButton]);
|
|
192
189
|
};
|
|
193
|
-
export var buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout, addSidebarLayouts, allowSingleColumnLayout, api
|
|
194
|
-
// Ignored via go/ees005
|
|
195
|
-
// eslint-disable-next-line @typescript-eslint/max-params
|
|
196
|
-
) {
|
|
190
|
+
export var buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout, addSidebarLayouts, allowSingleColumnLayout, api) {
|
|
197
191
|
var _api$decorations$acti, _api$decorations, _api$analytics;
|
|
198
192
|
var _ref2 = (_api$decorations$acti = api === null || api === void 0 || (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions) !== null && _api$decorations$acti !== void 0 ? _api$decorations$acti : {},
|
|
199
193
|
hoverDecoration = _ref2.hoverDecoration;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-layout",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.1",
|
|
4
4
|
"description": "Layout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^46.1.0",
|
|
35
|
-
"@atlaskit/editor-common": "^99.
|
|
36
|
-
"@atlaskit/editor-plugin-analytics": "^1.
|
|
37
|
-
"@atlaskit/editor-plugin-decorations": "^1.
|
|
38
|
-
"@atlaskit/editor-plugin-editor-disabled": "^1.
|
|
35
|
+
"@atlaskit/editor-common": "^99.7.0",
|
|
36
|
+
"@atlaskit/editor-plugin-analytics": "^1.11.0",
|
|
37
|
+
"@atlaskit/editor-plugin-decorations": "^1.4.0",
|
|
38
|
+
"@atlaskit/editor-plugin-editor-disabled": "^1.4.0",
|
|
39
39
|
"@atlaskit/editor-plugin-selection": "^1.6.0",
|
|
40
40
|
"@atlaskit/editor-plugin-width": "^2.0.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
42
|
-
"@atlaskit/icon": "^23.
|
|
43
|
-
"@atlaskit/platform-feature-flags": "^0.
|
|
44
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
45
|
-
"@atlaskit/tokens": "^3.
|
|
42
|
+
"@atlaskit/icon": "^23.6.0",
|
|
43
|
+
"@atlaskit/platform-feature-flags": "^1.0.0",
|
|
44
|
+
"@atlaskit/tmp-editor-statsig": "^2.41.0",
|
|
45
|
+
"@atlaskit/tokens": "^3.3.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0",
|
|
47
47
|
"@emotion/react": "^11.7.1"
|
|
48
48
|
},
|