@atlaskit/editor-plugin-layout 1.12.16 → 1.12.18

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.
Files changed (33) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/layoutPlugin.js +0 -6
  3. package/dist/cjs/layoutPluginType.js +1 -8
  4. package/dist/cjs/nodeviews/index.js +3 -0
  5. package/dist/cjs/pm-plugins/actions.js +11 -0
  6. package/dist/cjs/pm-plugins/main.js +10 -1
  7. package/dist/cjs/pm-plugins/resizing.js +4 -1
  8. package/dist/cjs/ui/icons/LayoutThreeWithLeftSidebars.js +6 -0
  9. package/dist/cjs/ui/icons/LayoutThreeWithRightSidebars.js +6 -0
  10. package/dist/cjs/ui/toolbar.js +10 -2
  11. package/dist/es2019/layoutPlugin.js +0 -1
  12. package/dist/es2019/layoutPluginType.js +1 -2
  13. package/dist/es2019/nodeviews/index.js +3 -0
  14. package/dist/es2019/pm-plugins/actions.js +11 -0
  15. package/dist/es2019/pm-plugins/main.js +10 -1
  16. package/dist/es2019/pm-plugins/resizing.js +4 -1
  17. package/dist/es2019/ui/icons/LayoutThreeWithLeftSidebars.js +6 -0
  18. package/dist/es2019/ui/icons/LayoutThreeWithRightSidebars.js +6 -0
  19. package/dist/es2019/ui/toolbar.js +10 -2
  20. package/dist/esm/layoutPlugin.js +0 -1
  21. package/dist/esm/layoutPluginType.js +1 -2
  22. package/dist/esm/nodeviews/index.js +3 -0
  23. package/dist/esm/pm-plugins/actions.js +11 -0
  24. package/dist/esm/pm-plugins/main.js +10 -1
  25. package/dist/esm/pm-plugins/resizing.js +4 -1
  26. package/dist/esm/ui/icons/LayoutThreeWithLeftSidebars.js +6 -0
  27. package/dist/esm/ui/icons/LayoutThreeWithRightSidebars.js +6 -0
  28. package/dist/esm/ui/toolbar.js +10 -2
  29. package/dist/types/layoutPlugin.d.ts +0 -2
  30. package/dist/types/layoutPluginType.d.ts +0 -2
  31. package/dist/types-ts4.5/layoutPlugin.d.ts +0 -2
  32. package/dist/types-ts4.5/layoutPluginType.d.ts +0 -2
  33. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-plugin-layout
2
2
 
3
+ ## 1.12.18
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 1.12.17
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 1.12.16
4
16
 
5
17
  ### Patch Changes
@@ -5,12 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.layoutPlugin = void 0;
8
- Object.defineProperty(exports, "pluginKey", {
9
- enumerable: true,
10
- get: function get() {
11
- return _pluginKey.pluginKey;
12
- }
13
- });
14
8
  var _react = _interopRequireDefault(require("react"));
15
9
  var _adfSchema = require("@atlaskit/adf-schema");
16
10
  var _schema = require("@atlaskit/adf-schema/schema");
@@ -2,11 +2,4 @@
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
- });
6
- Object.defineProperty(exports, "pluginKey", {
7
- enumerable: true,
8
- get: function get() {
9
- return _pluginKey.pluginKey;
10
- }
11
- });
12
- var _pluginKey = require("./pm-plugins/plugin-key");
5
+ });
@@ -96,6 +96,9 @@ var LayoutSectionView = exports.LayoutSectionView = /*#__PURE__*/function (_Reac
96
96
  var _ref2 = _model.DOMSerializer.renderSpec(document, toDOM()),
97
97
  container = _ref2.dom,
98
98
  contentDOM = _ref2.contentDOM;
99
+
100
+ // Ignored via go/ees005
101
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
99
102
  this.layoutDOM = container.querySelector('[data-layout-section]');
100
103
  this.layoutDOM.setAttribute('data-column-rule-style', this.node.attrs.columnRuleStyle);
101
104
  if ((0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_post_fix_patch_1')) {
@@ -260,6 +260,8 @@ 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
263
265
  function forceColumnStructure(state, node, pos, presetLayout) {
264
266
  var tr = state.tr;
265
267
  var insideRightEdgeOfLayoutSection = pos + node.nodeSize - 1;
@@ -294,6 +296,9 @@ function forceColumnStructure(state, node, pos, presetLayout) {
294
296
  }
295
297
  return tr;
296
298
  }
299
+
300
+ // Ignored via go/ees005
301
+ // eslint-disable-next-line @typescript-eslint/max-params
297
302
  function forceColumnStructureNew(state, node, pos, presetLayout) {
298
303
  var tr = state.tr;
299
304
  var insideRightEdgeOfLayoutSection = pos + node.nodeSize - 1;
@@ -321,6 +326,9 @@ function columnWidth(node, schema, widths) {
321
326
  }
322
327
  });
323
328
  }
329
+
330
+ // Ignored via go/ees005
331
+ // eslint-disable-next-line @typescript-eslint/max-params
324
332
  function forceColumnWidths(state, tr, pos, presetLayout) {
325
333
  var node = tr.doc.nodeAt(pos);
326
334
  if (!node) {
@@ -328,6 +336,9 @@ function forceColumnWidths(state, tr, pos, presetLayout) {
328
336
  }
329
337
  return tr.replaceWith(pos + 1, pos + node.nodeSize - 1, columnWidth(node, state.schema, getWidthsForPreset(presetLayout)));
330
338
  }
339
+
340
+ // Ignored via go/ees005
341
+ // eslint-disable-next-line @typescript-eslint/max-params
331
342
  function forceSectionToPresetLayout(state, node, pos, presetLayout) {
332
343
  var forceColumnStructureFn = (0, _experiments.editorExperiment)('advanced_layouts', true) ? forceColumnStructureNew : forceColumnStructure;
333
344
  var tr = forceColumnStructureFn(state, node, pos, presetLayout);
@@ -34,7 +34,11 @@ var moveCursorToNextColumn = function moveCursorToNextColumn(state, dispatch) {
34
34
  var _state$schema$nodes = state.schema.nodes,
35
35
  layoutColumn = _state$schema$nodes.layoutColumn,
36
36
  layoutSection = _state$schema$nodes.layoutSection;
37
+ // Ignored via go/ees005
38
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
37
39
  var section = (0, _utils2.findParentNodeOfType)(layoutSection)(selection);
40
+ // Ignored via go/ees005
41
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
38
42
  var column = (0, _utils2.findParentNodeOfType)(layoutColumn)(selection);
39
43
  if (column.node !== section.node.lastChild) {
40
44
  var $nextColumn = state.doc.resolve(column.pos + column.node.nodeSize);
@@ -88,12 +92,17 @@ var _default = exports.default = function _default(options) {
88
92
  init: function init(_, state) {
89
93
  return getInitialPluginState(options, state);
90
94
  },
95
+ // Ignored via go/ees005
96
+ // eslint-disable-next-line @typescript-eslint/max-params
91
97
  apply: function apply(tr, pluginState, _oldState, newState) {
92
98
  if (tr.docChanged || tr.selectionSet) {
93
99
  var maybeLayoutSection = (0, _utils3.getMaybeLayoutSection)(newState);
94
100
  var newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
95
101
  pos: maybeLayoutSection ? maybeLayoutSection.pos : null,
96
- selectedLayout: (0, _actions.getSelectedLayout)(maybeLayoutSection && maybeLayoutSection.node, pluginState.selectedLayout)
102
+ selectedLayout: (0, _actions.getSelectedLayout)(maybeLayoutSection && maybeLayoutSection.node,
103
+ // Ignored via go/ees005
104
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
105
+ pluginState.selectedLayout)
97
106
  });
98
107
  return newPluginState;
99
108
  }
@@ -8,7 +8,10 @@ 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) {
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
+ ) {
12
15
  return new _safePlugin.SafePlugin({
13
16
  key: pluginKey,
14
17
  props: {
@@ -23,6 +23,8 @@ var LayoutThreeWithLeftSidebarsGlyph = function LayoutThreeWithLeftSidebarsGlyph
23
23
  viewBox: "0 0 16 14",
24
24
  fill: "none",
25
25
  xmlns: "http://www.w3.org/2000/svg"
26
+ // Ignored via go/ees005
27
+ // eslint-disable-next-line react/jsx-props-no-spreading
26
28
  }, props), (0, _react.jsx)("path", {
27
29
  fillRule: "evenodd",
28
30
  clipRule: "evenodd",
@@ -36,6 +38,8 @@ var LayoutThreeWithLeftSidebarsGlyph = function LayoutThreeWithLeftSidebarsGlyph
36
38
  viewBox: "0 0 16 14",
37
39
  fill: "none",
38
40
  xmlns: "http://www.w3.org/2000/svg"
41
+ // Ignored via go/ees005
42
+ // eslint-disable-next-line react/jsx-props-no-spreading
39
43
  }, props), (0, _react.jsx)("path", {
40
44
  fillRule: "evenodd",
41
45
  clipRule: "evenodd",
@@ -52,5 +56,7 @@ var LayoutThreeWithLeftSidebarsIcon = exports.LayoutThreeWithLeftSidebarsIcon =
52
56
  css: floatingToolbarPadding
53
57
  }, (0, _react.jsx)(_icon.default, (0, _extends2.default)({
54
58
  glyph: LayoutThreeWithLeftSidebarsGlyph
59
+ // Ignored via go/ees005
60
+ // eslint-disable-next-line react/jsx-props-no-spreading
55
61
  }, props)));
56
62
  };
@@ -23,6 +23,8 @@ var LayoutThreeWithRightSidebarsGlyph = function LayoutThreeWithRightSidebarsGly
23
23
  viewBox: "0 0 16 14",
24
24
  fill: "none",
25
25
  xmlns: "http://www.w3.org/2000/svg"
26
+ // Ignored via go/ees005
27
+ // eslint-disable-next-line react/jsx-props-no-spreading
26
28
  }, props), (0, _react.jsx)("path", {
27
29
  fillRule: "evenodd",
28
30
  clipRule: "evenodd",
@@ -36,6 +38,8 @@ var LayoutThreeWithRightSidebarsGlyph = function LayoutThreeWithRightSidebarsGly
36
38
  viewBox: "0 0 16 14",
37
39
  fill: "none",
38
40
  xmlns: "http://www.w3.org/2000/svg"
41
+ // Ignored via go/ees005
42
+ // eslint-disable-next-line react/jsx-props-no-spreading
39
43
  }, props), (0, _react.jsx)("path", {
40
44
  fillRule: "evenodd",
41
45
  clipRule: "evenodd",
@@ -52,5 +56,7 @@ var LayoutThreeWithRightSidebarsIcon = exports.LayoutThreeWithRightSidebarsIcon
52
56
  css: floatingToolbarPadding
53
57
  }, (0, _react.jsx)(_icon.default, (0, _extends2.default)({
54
58
  glyph: LayoutThreeWithRightSidebarsGlyph
59
+ // Ignored via go/ees005
60
+ // eslint-disable-next-line react/jsx-props-no-spreading
55
61
  }, props)));
56
62
  };
@@ -115,7 +115,10 @@ 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) {
118
+ var buildLayoutButton = function buildLayoutButton(intl, item, currentLayout, editorAnalyticsAPI
119
+ // Ignored via go/ees005
120
+ // eslint-disable-next-line @typescript-eslint/max-params
121
+ ) {
119
122
  return {
120
123
  id: item.id,
121
124
  type: 'button',
@@ -197,7 +200,10 @@ var getAdvancedLayoutItems = function getAdvancedLayoutItems(_ref) {
197
200
  }]
198
201
  }, separator, deleteButton]);
199
202
  };
200
- var buildToolbar = exports.buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout, addSidebarLayouts, allowSingleColumnLayout, api) {
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
+ ) {
201
207
  var _api$decorations$acti, _api$decorations, _api$analytics;
202
208
  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 : {},
203
209
  hoverDecoration = _ref2.hoverDecoration;
@@ -228,6 +234,8 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(state, intl, pos
228
234
  var layoutTypes = allowSingleColumnLayout ? LAYOUT_TYPES_WITH_SINGLE_COL : LAYOUT_TYPES;
229
235
  return {
230
236
  title: layoutToolbarTitle,
237
+ // Ignored via go/ees005
238
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
231
239
  getDomRef: function getDomRef(view) {
232
240
  return (0, _utils.findDomRefAtPos)(pos, view.domAtPos.bind(view));
233
241
  },
@@ -12,7 +12,6 @@ import { pluginKey } from './pm-plugins/plugin-key';
12
12
  import { default as createLayoutResizingPlugin } from './pm-plugins/resizing';
13
13
  import { GlobalStylesWrapper } from './ui/global-styles';
14
14
  import { buildToolbar } from './ui/toolbar';
15
- export { pluginKey };
16
15
  export const layoutPlugin = ({
17
16
  config: options = {},
18
17
  api
@@ -1,2 +1 @@
1
- import { pluginKey } from './pm-plugins/plugin-key';
2
- export { pluginKey };
1
+ export {};
@@ -74,6 +74,9 @@ export class LayoutSectionView extends ReactNodeView {
74
74
  dom: container,
75
75
  contentDOM
76
76
  } = DOMSerializer.renderSpec(document, toDOM());
77
+
78
+ // Ignored via go/ees005
79
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
77
80
  this.layoutDOM = container.querySelector('[data-layout-section]');
78
81
  this.layoutDOM.setAttribute('data-column-rule-style', this.node.attrs.columnRuleStyle);
79
82
  if (fg('platform_editor_advanced_layouts_post_fix_patch_1')) {
@@ -237,6 +237,8 @@ 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
240
242
  function forceColumnStructure(state, node, pos, presetLayout) {
241
243
  const tr = state.tr;
242
244
  const insideRightEdgeOfLayoutSection = pos + node.nodeSize - 1;
@@ -271,6 +273,9 @@ function forceColumnStructure(state, node, pos, presetLayout) {
271
273
  }
272
274
  return tr;
273
275
  }
276
+
277
+ // Ignored via go/ees005
278
+ // eslint-disable-next-line @typescript-eslint/max-params
274
279
  function forceColumnStructureNew(state, node, pos, presetLayout) {
275
280
  const tr = state.tr;
276
281
  const insideRightEdgeOfLayoutSection = pos + node.nodeSize - 1;
@@ -299,6 +304,9 @@ function columnWidth(node, schema, widths) {
299
304
  }
300
305
  });
301
306
  }
307
+
308
+ // Ignored via go/ees005
309
+ // eslint-disable-next-line @typescript-eslint/max-params
302
310
  function forceColumnWidths(state, tr, pos, presetLayout) {
303
311
  const node = tr.doc.nodeAt(pos);
304
312
  if (!node) {
@@ -306,6 +314,9 @@ function forceColumnWidths(state, tr, pos, presetLayout) {
306
314
  }
307
315
  return tr.replaceWith(pos + 1, pos + node.nodeSize - 1, columnWidth(node, state.schema, getWidthsForPreset(presetLayout)));
308
316
  }
317
+
318
+ // Ignored via go/ees005
319
+ // eslint-disable-next-line @typescript-eslint/max-params
309
320
  export function forceSectionToPresetLayout(state, node, pos, presetLayout) {
310
321
  const forceColumnStructureFn = editorExperiment('advanced_layouts', true) ? forceColumnStructureNew : forceColumnStructure;
311
322
  let tr = forceColumnStructureFn(state, node, pos, presetLayout);
@@ -31,7 +31,11 @@ const moveCursorToNextColumn = (state, dispatch) => {
31
31
  }
32
32
  }
33
33
  } = state;
34
+ // Ignored via go/ees005
35
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
34
36
  const section = findParentNodeOfType(layoutSection)(selection);
37
+ // Ignored via go/ees005
38
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
35
39
  const column = findParentNodeOfType(layoutColumn)(selection);
36
40
  if (column.node !== section.node.lastChild) {
37
41
  const $nextColumn = state.doc.resolve(column.pos + column.node.nodeSize);
@@ -80,13 +84,18 @@ export default (options => new SafePlugin({
80
84
  key: pluginKey,
81
85
  state: {
82
86
  init: (_, state) => getInitialPluginState(options, state),
87
+ // Ignored via go/ees005
88
+ // eslint-disable-next-line @typescript-eslint/max-params
83
89
  apply: (tr, pluginState, _oldState, newState) => {
84
90
  if (tr.docChanged || tr.selectionSet) {
85
91
  const maybeLayoutSection = getMaybeLayoutSection(newState);
86
92
  const newPluginState = {
87
93
  ...pluginState,
88
94
  pos: maybeLayoutSection ? maybeLayoutSection.pos : null,
89
- selectedLayout: getSelectedLayout(maybeLayoutSection && maybeLayoutSection.node, pluginState.selectedLayout)
95
+ selectedLayout: getSelectedLayout(maybeLayoutSection && maybeLayoutSection.node,
96
+ // Ignored via go/ees005
97
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
98
+ pluginState.selectedLayout)
90
99
  };
91
100
  return newPluginState;
92
101
  }
@@ -2,7 +2,10 @@ 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) => new SafePlugin({
5
+ export default ((options, pluginInjectionApi, portalProviderAPI, eventDispatcher
6
+ // Ignored via go/ees005
7
+ // eslint-disable-next-line @typescript-eslint/max-params
8
+ ) => new SafePlugin({
6
9
  key: pluginKey,
7
10
  props: {
8
11
  nodeViews: {
@@ -15,6 +15,8 @@ const LayoutThreeWithLeftSidebarsGlyph = props => {
15
15
  viewBox: "0 0 16 14",
16
16
  fill: "none",
17
17
  xmlns: "http://www.w3.org/2000/svg"
18
+ // Ignored via go/ees005
19
+ // eslint-disable-next-line react/jsx-props-no-spreading
18
20
  }, props), jsx("path", {
19
21
  fillRule: "evenodd",
20
22
  clipRule: "evenodd",
@@ -28,6 +30,8 @@ const LayoutThreeWithLeftSidebarsGlyph = props => {
28
30
  viewBox: "0 0 16 14",
29
31
  fill: "none",
30
32
  xmlns: "http://www.w3.org/2000/svg"
33
+ // Ignored via go/ees005
34
+ // eslint-disable-next-line react/jsx-props-no-spreading
31
35
  }, props), jsx("path", {
32
36
  fillRule: "evenodd",
33
37
  clipRule: "evenodd",
@@ -43,4 +47,6 @@ export const LayoutThreeWithLeftSidebarsIcon = props => jsx("span", {
43
47
  css: floatingToolbarPadding
44
48
  }, jsx(Icon, _extends({
45
49
  glyph: LayoutThreeWithLeftSidebarsGlyph
50
+ // Ignored via go/ees005
51
+ // eslint-disable-next-line react/jsx-props-no-spreading
46
52
  }, props)));
@@ -15,6 +15,8 @@ const LayoutThreeWithRightSidebarsGlyph = props => {
15
15
  viewBox: "0 0 16 14",
16
16
  fill: "none",
17
17
  xmlns: "http://www.w3.org/2000/svg"
18
+ // Ignored via go/ees005
19
+ // eslint-disable-next-line react/jsx-props-no-spreading
18
20
  }, props), jsx("path", {
19
21
  fillRule: "evenodd",
20
22
  clipRule: "evenodd",
@@ -28,6 +30,8 @@ const LayoutThreeWithRightSidebarsGlyph = props => {
28
30
  viewBox: "0 0 16 14",
29
31
  fill: "none",
30
32
  xmlns: "http://www.w3.org/2000/svg"
33
+ // Ignored via go/ees005
34
+ // eslint-disable-next-line react/jsx-props-no-spreading
31
35
  }, props), jsx("path", {
32
36
  fillRule: "evenodd",
33
37
  clipRule: "evenodd",
@@ -43,4 +47,6 @@ export const LayoutThreeWithRightSidebarsIcon = props => jsx("span", {
43
47
  css: floatingToolbarPadding
44
48
  }, jsx(Icon, _extends({
45
49
  glyph: LayoutThreeWithRightSidebarsGlyph
50
+ // Ignored via go/ees005
51
+ // eslint-disable-next-line react/jsx-props-no-spreading
46
52
  }, props)));
@@ -104,7 +104,10 @@ const LAYOUT_WITH_THREE_COL_DISTRIBUTION = [{
104
104
  icon: LayoutThreeWithLeftSidebarsIcon,
105
105
  iconFallback: LayoutThreeWithLeftSidebarsIcon
106
106
  }];
107
- const buildLayoutButton = (intl, item, currentLayout, editorAnalyticsAPI) => ({
107
+ const buildLayoutButton = (intl, item, currentLayout, editorAnalyticsAPI
108
+ // Ignored via go/ees005
109
+ // eslint-disable-next-line @typescript-eslint/max-params
110
+ ) => ({
108
111
  id: item.id,
109
112
  type: 'button',
110
113
  icon: item.icon,
@@ -183,7 +186,10 @@ const getAdvancedLayoutItems = ({
183
186
  }]
184
187
  }, separator, deleteButton];
185
188
  };
186
- export const buildToolbar = (state, intl, pos, _allowBreakout, addSidebarLayouts, allowSingleColumnLayout, api) => {
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
+ ) => {
187
193
  var _api$decorations$acti, _api$decorations, _api$analytics;
188
194
  const {
189
195
  hoverDecoration
@@ -215,6 +221,8 @@ export const buildToolbar = (state, intl, pos, _allowBreakout, addSidebarLayouts
215
221
  const layoutTypes = allowSingleColumnLayout ? LAYOUT_TYPES_WITH_SINGLE_COL : LAYOUT_TYPES;
216
222
  return {
217
223
  title: layoutToolbarTitle,
224
+ // Ignored via go/ees005
225
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
218
226
  getDomRef: view => findDomRefAtPos(pos, view.domAtPos.bind(view)),
219
227
  nodeType,
220
228
  groupLabel: intl.formatMessage(toolbarMessages.floatingToolbarRadioGroupAriaLabel),
@@ -12,7 +12,6 @@ import { pluginKey } from './pm-plugins/plugin-key';
12
12
  import { default as createLayoutResizingPlugin } from './pm-plugins/resizing';
13
13
  import { GlobalStylesWrapper } from './ui/global-styles';
14
14
  import { buildToolbar } from './ui/toolbar';
15
- export { pluginKey };
16
15
  export var layoutPlugin = function layoutPlugin(_ref) {
17
16
  var _api$analytics;
18
17
  var _ref$config = _ref.config,
@@ -1,2 +1 @@
1
- import { pluginKey } from './pm-plugins/plugin-key';
2
- export { pluginKey };
1
+ export {};
@@ -86,6 +86,9 @@ export var LayoutSectionView = /*#__PURE__*/function (_ReactNodeView) {
86
86
  var _ref2 = DOMSerializer.renderSpec(document, toDOM()),
87
87
  container = _ref2.dom,
88
88
  contentDOM = _ref2.contentDOM;
89
+
90
+ // Ignored via go/ees005
91
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
89
92
  this.layoutDOM = container.querySelector('[data-layout-section]');
90
93
  this.layoutDOM.setAttribute('data-column-rule-style', this.node.attrs.columnRuleStyle);
91
94
  if (fg('platform_editor_advanced_layouts_post_fix_patch_1')) {
@@ -251,6 +251,8 @@ 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
254
256
  function forceColumnStructure(state, node, pos, presetLayout) {
255
257
  var tr = state.tr;
256
258
  var insideRightEdgeOfLayoutSection = pos + node.nodeSize - 1;
@@ -285,6 +287,9 @@ function forceColumnStructure(state, node, pos, presetLayout) {
285
287
  }
286
288
  return tr;
287
289
  }
290
+
291
+ // Ignored via go/ees005
292
+ // eslint-disable-next-line @typescript-eslint/max-params
288
293
  function forceColumnStructureNew(state, node, pos, presetLayout) {
289
294
  var tr = state.tr;
290
295
  var insideRightEdgeOfLayoutSection = pos + node.nodeSize - 1;
@@ -312,6 +317,9 @@ function columnWidth(node, schema, widths) {
312
317
  }
313
318
  });
314
319
  }
320
+
321
+ // Ignored via go/ees005
322
+ // eslint-disable-next-line @typescript-eslint/max-params
315
323
  function forceColumnWidths(state, tr, pos, presetLayout) {
316
324
  var node = tr.doc.nodeAt(pos);
317
325
  if (!node) {
@@ -319,6 +327,9 @@ function forceColumnWidths(state, tr, pos, presetLayout) {
319
327
  }
320
328
  return tr.replaceWith(pos + 1, pos + node.nodeSize - 1, columnWidth(node, state.schema, getWidthsForPreset(presetLayout)));
321
329
  }
330
+
331
+ // Ignored via go/ees005
332
+ // eslint-disable-next-line @typescript-eslint/max-params
322
333
  export function forceSectionToPresetLayout(state, node, pos, presetLayout) {
323
334
  var forceColumnStructureFn = editorExperiment('advanced_layouts', true) ? forceColumnStructureNew : forceColumnStructure;
324
335
  var tr = forceColumnStructureFn(state, node, pos, presetLayout);
@@ -27,7 +27,11 @@ var moveCursorToNextColumn = function moveCursorToNextColumn(state, dispatch) {
27
27
  var _state$schema$nodes = state.schema.nodes,
28
28
  layoutColumn = _state$schema$nodes.layoutColumn,
29
29
  layoutSection = _state$schema$nodes.layoutSection;
30
+ // Ignored via go/ees005
31
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
30
32
  var section = findParentNodeOfType(layoutSection)(selection);
33
+ // Ignored via go/ees005
34
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
31
35
  var column = findParentNodeOfType(layoutColumn)(selection);
32
36
  if (column.node !== section.node.lastChild) {
33
37
  var $nextColumn = state.doc.resolve(column.pos + column.node.nodeSize);
@@ -81,12 +85,17 @@ export default (function (options) {
81
85
  init: function init(_, state) {
82
86
  return getInitialPluginState(options, state);
83
87
  },
88
+ // Ignored via go/ees005
89
+ // eslint-disable-next-line @typescript-eslint/max-params
84
90
  apply: function apply(tr, pluginState, _oldState, newState) {
85
91
  if (tr.docChanged || tr.selectionSet) {
86
92
  var maybeLayoutSection = getMaybeLayoutSection(newState);
87
93
  var newPluginState = _objectSpread(_objectSpread({}, pluginState), {}, {
88
94
  pos: maybeLayoutSection ? maybeLayoutSection.pos : null,
89
- selectedLayout: getSelectedLayout(maybeLayoutSection && maybeLayoutSection.node, pluginState.selectedLayout)
95
+ selectedLayout: getSelectedLayout(maybeLayoutSection && maybeLayoutSection.node,
96
+ // Ignored via go/ees005
97
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
98
+ pluginState.selectedLayout)
90
99
  });
91
100
  return newPluginState;
92
101
  }
@@ -2,7 +2,10 @@ 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) {
5
+ export default (function (options, pluginInjectionApi, portalProviderAPI, eventDispatcher
6
+ // Ignored via go/ees005
7
+ // eslint-disable-next-line @typescript-eslint/max-params
8
+ ) {
6
9
  return new SafePlugin({
7
10
  key: pluginKey,
8
11
  props: {
@@ -15,6 +15,8 @@ var LayoutThreeWithLeftSidebarsGlyph = function LayoutThreeWithLeftSidebarsGlyph
15
15
  viewBox: "0 0 16 14",
16
16
  fill: "none",
17
17
  xmlns: "http://www.w3.org/2000/svg"
18
+ // Ignored via go/ees005
19
+ // eslint-disable-next-line react/jsx-props-no-spreading
18
20
  }, props), jsx("path", {
19
21
  fillRule: "evenodd",
20
22
  clipRule: "evenodd",
@@ -28,6 +30,8 @@ var LayoutThreeWithLeftSidebarsGlyph = function LayoutThreeWithLeftSidebarsGlyph
28
30
  viewBox: "0 0 16 14",
29
31
  fill: "none",
30
32
  xmlns: "http://www.w3.org/2000/svg"
33
+ // Ignored via go/ees005
34
+ // eslint-disable-next-line react/jsx-props-no-spreading
31
35
  }, props), jsx("path", {
32
36
  fillRule: "evenodd",
33
37
  clipRule: "evenodd",
@@ -44,5 +48,7 @@ export var LayoutThreeWithLeftSidebarsIcon = function LayoutThreeWithLeftSidebar
44
48
  css: floatingToolbarPadding
45
49
  }, jsx(Icon, _extends({
46
50
  glyph: LayoutThreeWithLeftSidebarsGlyph
51
+ // Ignored via go/ees005
52
+ // eslint-disable-next-line react/jsx-props-no-spreading
47
53
  }, props)));
48
54
  };
@@ -15,6 +15,8 @@ var LayoutThreeWithRightSidebarsGlyph = function LayoutThreeWithRightSidebarsGly
15
15
  viewBox: "0 0 16 14",
16
16
  fill: "none",
17
17
  xmlns: "http://www.w3.org/2000/svg"
18
+ // Ignored via go/ees005
19
+ // eslint-disable-next-line react/jsx-props-no-spreading
18
20
  }, props), jsx("path", {
19
21
  fillRule: "evenodd",
20
22
  clipRule: "evenodd",
@@ -28,6 +30,8 @@ var LayoutThreeWithRightSidebarsGlyph = function LayoutThreeWithRightSidebarsGly
28
30
  viewBox: "0 0 16 14",
29
31
  fill: "none",
30
32
  xmlns: "http://www.w3.org/2000/svg"
33
+ // Ignored via go/ees005
34
+ // eslint-disable-next-line react/jsx-props-no-spreading
31
35
  }, props), jsx("path", {
32
36
  fillRule: "evenodd",
33
37
  clipRule: "evenodd",
@@ -44,5 +48,7 @@ export var LayoutThreeWithRightSidebarsIcon = function LayoutThreeWithRightSideb
44
48
  css: floatingToolbarPadding
45
49
  }, jsx(Icon, _extends({
46
50
  glyph: LayoutThreeWithRightSidebarsGlyph
51
+ // Ignored via go/ees005
52
+ // eslint-disable-next-line react/jsx-props-no-spreading
47
53
  }, props)));
48
54
  };
@@ -105,7 +105,10 @@ 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) {
108
+ var buildLayoutButton = function buildLayoutButton(intl, item, currentLayout, editorAnalyticsAPI
109
+ // Ignored via go/ees005
110
+ // eslint-disable-next-line @typescript-eslint/max-params
111
+ ) {
109
112
  return {
110
113
  id: item.id,
111
114
  type: 'button',
@@ -187,7 +190,10 @@ var getAdvancedLayoutItems = function getAdvancedLayoutItems(_ref) {
187
190
  }]
188
191
  }, separator, deleteButton]);
189
192
  };
190
- export var buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout, addSidebarLayouts, allowSingleColumnLayout, api) {
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
+ ) {
191
197
  var _api$decorations$acti, _api$decorations, _api$analytics;
192
198
  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 : {},
193
199
  hoverDecoration = _ref2.hoverDecoration;
@@ -218,6 +224,8 @@ export var buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout
218
224
  var layoutTypes = allowSingleColumnLayout ? LAYOUT_TYPES_WITH_SINGLE_COL : LAYOUT_TYPES;
219
225
  return {
220
226
  title: layoutToolbarTitle,
227
+ // Ignored via go/ees005
228
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
221
229
  getDomRef: function getDomRef(view) {
222
230
  return findDomRefAtPos(pos, view.domAtPos.bind(view));
223
231
  },
@@ -1,4 +1,2 @@
1
1
  import type { LayoutPlugin } from './layoutPluginType';
2
- import { pluginKey } from './pm-plugins/plugin-key';
3
- export { pluginKey };
4
2
  export declare const layoutPlugin: LayoutPlugin;
@@ -5,9 +5,7 @@ import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabl
5
5
  import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
6
6
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
7
7
  import type { insertLayoutColumnsWithAnalytics } from './pm-plugins/actions';
8
- import { pluginKey } from './pm-plugins/plugin-key';
9
8
  import type { LayoutPluginOptions } from './types';
10
- export { pluginKey };
11
9
  export type LayoutPlugin = NextEditorPlugin<'layout', {
12
10
  pluginConfiguration: LayoutPluginOptions | undefined;
13
11
  dependencies: [
@@ -1,4 +1,2 @@
1
1
  import type { LayoutPlugin } from './layoutPluginType';
2
- import { pluginKey } from './pm-plugins/plugin-key';
3
- export { pluginKey };
4
2
  export declare const layoutPlugin: LayoutPlugin;
@@ -5,9 +5,7 @@ import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabl
5
5
  import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
6
6
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
7
7
  import type { insertLayoutColumnsWithAnalytics } from './pm-plugins/actions';
8
- import { pluginKey } from './pm-plugins/plugin-key';
9
8
  import type { LayoutPluginOptions } from './types';
10
- export { pluginKey };
11
9
  export type LayoutPlugin = NextEditorPlugin<'layout', {
12
10
  pluginConfiguration: LayoutPluginOptions | undefined;
13
11
  dependencies: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-layout",
3
- "version": "1.12.16",
3
+ "version": "1.12.18",
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": "^96.5.0",
35
+ "@atlaskit/editor-common": "^97.2.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",
39
39
  "@atlaskit/editor-plugin-selection": "^1.6.0",
40
- "@atlaskit/editor-plugin-width": "^1.3.0",
40
+ "@atlaskit/editor-plugin-width": "^2.0.0",
41
41
  "@atlaskit/editor-prosemirror": "6.2.1",
42
42
  "@atlaskit/icon": "^23.1.0",
43
43
  "@atlaskit/platform-feature-flags": "^0.3.0",
44
- "@atlaskit/tmp-editor-statsig": "^2.27.0",
45
- "@atlaskit/tokens": "^2.4.0",
44
+ "@atlaskit/tmp-editor-statsig": "^2.29.0",
45
+ "@atlaskit/tokens": "^2.5.0",
46
46
  "@babel/runtime": "^7.0.0",
47
47
  "@emotion/react": "^11.7.1"
48
48
  },