@atlaskit/editor-plugin-layout 1.12.9 → 1.12.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-plugin-layout
2
2
 
3
+ ## 1.12.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#171014](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/171014)
8
+ [`6163248356c63`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6163248356c63) -
9
+ [ED-25833] Replace the following FGs with experiment `platform_editor_advanced_layouts`
10
+
11
+ - platform_editor_advanced_layouts_breakout_resizing
12
+ - platform_editor_advanced_layouts_pre_release_1
13
+ - platform_editor_advanced_layouts_pre_release_2
14
+
3
15
  ## 1.12.9
4
16
 
5
17
  ### Patch Changes
@@ -17,12 +17,11 @@ var _schema = require("@atlaskit/adf-schema/schema");
17
17
  var _analytics = require("@atlaskit/editor-common/analytics");
18
18
  var _messages = require("@atlaskit/editor-common/messages");
19
19
  var _quickInsert = require("@atlaskit/editor-common/quick-insert");
20
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
21
21
  var _actions = require("./pm-plugins/actions");
22
22
  var _main = _interopRequireDefault(require("./pm-plugins/main"));
23
23
  var _pluginKey = require("./pm-plugins/plugin-key");
24
24
  var _resizing = _interopRequireDefault(require("./pm-plugins/resizing"));
25
- var _preRelease = require("./pm-plugins/utils/preRelease");
26
25
  var _globalStyles = require("./ui/global-styles");
27
26
  var _toolbar = require("./ui/toolbar");
28
27
  var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
@@ -35,7 +34,7 @@ var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
35
34
  nodes: function nodes() {
36
35
  return [{
37
36
  name: 'layoutSection',
38
- node: (0, _preRelease.isPreRelease2)() ? _schema.layoutSectionWithSingleColumn : _adfSchema.layoutSection
37
+ node: (0, _experiments.editorExperiment)('advanced_layouts', true) ? _schema.layoutSectionWithSingleColumn : _adfSchema.layoutSection
39
38
  }, {
40
39
  name: 'layoutColumn',
41
40
  node: _adfSchema.layoutColumn
@@ -48,7 +47,7 @@ var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
48
47
  return (0, _main.default)(options);
49
48
  }
50
49
  }];
51
- if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width') && api && (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing')) {
50
+ if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width') && api && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
52
51
  plugins.push({
53
52
  name: 'layoutResizing',
54
53
  plugin: function plugin(_ref2) {
@@ -77,7 +76,7 @@ var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
77
76
  },
78
77
  quickInsert: function quickInsert(_ref4) {
79
78
  var formatMessage = _ref4.formatMessage;
80
- return (0, _preRelease.isPreRelease2)() ? [{
79
+ return (0, _experiments.editorExperiment)('advanced_layouts', true) ? [{
81
80
  id: 'twocolumnslayout',
82
81
  title: formatMessage(_messages.layoutMessages.twoColumns),
83
82
  description: formatMessage(_messages.toolbarInsertBlockMessages.columnsDescription),
@@ -156,7 +155,7 @@ var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
156
155
  }
157
156
  },
158
157
  contentComponent: function contentComponent() {
159
- return (0, _preRelease.isPreRelease2)() ? /*#__PURE__*/_react.default.createElement(_globalStyles.GlobalStylesWrapper, null) : null;
158
+ return (0, _experiments.editorExperiment)('advanced_layouts', true) ? /*#__PURE__*/_react.default.createElement(_globalStyles.GlobalStylesWrapper, null) : null;
160
159
  }
161
160
  };
162
161
  };
@@ -17,14 +17,13 @@ var _utils2 = require("@atlaskit/editor-prosemirror/utils");
17
17
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
18
18
  var _consts = require("./consts");
19
19
  var _pluginKey = require("./plugin-key");
20
- var _preRelease = require("./utils/preRelease");
21
20
  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; }
22
21
  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) { (0, _defineProperty2.default)(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; }
23
22
  var ONE_COL_LAYOUTS = exports.ONE_COL_LAYOUTS = ['single'];
24
23
  var TWO_COL_LAYOUTS = exports.TWO_COL_LAYOUTS = ['two_equal', 'two_left_sidebar', 'two_right_sidebar'];
25
24
  var THREE_COL_LAYOUTS = exports.THREE_COL_LAYOUTS = ['three_equal', 'three_with_sidebars'];
26
25
  var getWidthsForPreset = function getWidthsForPreset(presetLayout) {
27
- if ((0, _preRelease.isPreRelease2)()) {
26
+ if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
28
27
  switch (presetLayout) {
29
28
  case 'single':
30
29
  return [100];
@@ -87,7 +86,7 @@ var getPresetLayout = exports.getPresetLayout = function getPresetLayout(section
87
86
  var widths = (0, _utils.mapChildren)(section, function (column) {
88
87
  return column.attrs.width;
89
88
  }).join(',');
90
- if ((0, _preRelease.isPreRelease2)()) {
89
+ if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
91
90
  switch (widths) {
92
91
  case '100':
93
92
  return 'single';
@@ -190,7 +189,7 @@ var insertLayoutColumnsWithAnalytics = exports.insertLayoutColumnsWithAnalytics
190
189
  * Add a column to the right of existing layout
191
190
  */
192
191
  function addColumn(schema, pos) {
193
- if (!(0, _preRelease.isPreRelease2)()) {
192
+ if ((0, _experiments.editorExperiment)('advanced_layouts', false)) {
194
193
  return function (tr) {
195
194
  tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill());
196
195
  };
@@ -323,7 +322,7 @@ function forceColumnWidths(state, tr, pos, presetLayout) {
323
322
  return tr.replaceWith(pos + 1, pos + node.nodeSize - 1, columnWidth(node, state.schema, getWidthsForPreset(presetLayout)));
324
323
  }
325
324
  function forceSectionToPresetLayout(state, node, pos, presetLayout) {
326
- var forceColumnStructureFn = (0, _preRelease.isPreRelease2)() ? forceColumnStructureNew : forceColumnStructure;
325
+ var forceColumnStructureFn = (0, _experiments.editorExperiment)('advanced_layouts', true) ? forceColumnStructureNew : forceColumnStructure;
327
326
  var tr = forceColumnStructureFn(state, node, pos, presetLayout);
328
327
 
329
328
  // save the selection here, since forcing column widths causes a change over the
@@ -369,7 +368,7 @@ var setPresetLayout = exports.setPresetLayout = function setPresetLayout(editorA
369
368
  };
370
369
  };
371
370
  function layoutNeedChanges(node) {
372
- if ((0, _preRelease.isPreRelease2)()) {
371
+ if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
373
372
  return !getPresetLayout(node) || !isValidLayoutWidthDistributions(node);
374
373
  }
375
374
  return !getPresetLayout(node);
@@ -482,7 +481,7 @@ var deleteActiveLayoutNode = exports.deleteActiveLayoutNode = function deleteAct
482
481
  };
483
482
  };
484
483
  var formatLayoutName = function formatLayoutName(layout) {
485
- if ((0, _preRelease.isPreRelease2)()) {
484
+ if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
486
485
  switch (layout) {
487
486
  case 'single':
488
487
  return _analytics.LAYOUT_TYPE.SINGLE_COL;
@@ -24,8 +24,8 @@ var _layoutTwoLeftSidebar = _interopRequireDefault(require("@atlaskit/icon/glyph
24
24
  var _layoutTwoRightSidebar = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/layout-two-right-sidebar"));
25
25
  var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
26
26
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
27
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
27
28
  var _actions = require("../pm-plugins/actions");
28
- var _preRelease = require("../pm-plugins/utils/preRelease");
29
29
  var _LayoutThreeWithLeftSidebars = require("./icons/LayoutThreeWithLeftSidebars");
30
30
  var _LayoutThreeWithRightSidebars = require("./icons/LayoutThreeWithRightSidebars");
31
31
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
@@ -233,7 +233,7 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(state, intl, pos
233
233
  },
234
234
  nodeType: nodeType,
235
235
  groupLabel: intl.formatMessage(_messages.layoutMessages.floatingToolbarRadioGroupAriaLabel),
236
- items: (0, _preRelease.isPreRelease2)() ? getAdvancedLayoutItems({
236
+ items: (0, _experiments.editorExperiment)('advanced_layouts', true) ? getAdvancedLayoutItems({
237
237
  addSidebarLayouts: addSidebarLayouts,
238
238
  intl: intl,
239
239
  editorAnalyticsAPI: editorAnalyticsAPI,
@@ -4,12 +4,11 @@ import { layoutSectionWithSingleColumn } 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, IconThreeColumnLayout, IconTwoColumnLayout } from '@atlaskit/editor-common/quick-insert';
7
- import { fg } from '@atlaskit/platform-feature-flags';
7
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
8
  import { createDefaultLayoutSection, createMultiColumnLayoutSection, insertLayoutColumnsWithAnalytics } from './pm-plugins/actions';
9
9
  import { default as createLayoutPlugin } from './pm-plugins/main';
10
10
  import { pluginKey } from './pm-plugins/plugin-key';
11
11
  import { default as createLayoutResizingPlugin } from './pm-plugins/resizing';
12
- import { isPreRelease2 } from './pm-plugins/utils/preRelease';
13
12
  import { GlobalStylesWrapper } from './ui/global-styles';
14
13
  import { buildToolbar } from './ui/toolbar';
15
14
  export { pluginKey };
@@ -23,7 +22,7 @@ export const layoutPlugin = ({
23
22
  nodes() {
24
23
  return [{
25
24
  name: 'layoutSection',
26
- node: isPreRelease2() ? layoutSectionWithSingleColumn : layoutSection
25
+ node: editorExperiment('advanced_layouts', true) ? layoutSectionWithSingleColumn : layoutSection
27
26
  }, {
28
27
  name: 'layoutColumn',
29
28
  node: layoutColumn
@@ -34,7 +33,7 @@ export const layoutPlugin = ({
34
33
  name: 'layout',
35
34
  plugin: () => createLayoutPlugin(options)
36
35
  }];
37
- if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width') && api && fg('platform_editor_advanced_layouts_breakout_resizing')) {
36
+ if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width') && api && editorExperiment('advanced_layouts', true)) {
38
37
  plugins.push({
39
38
  name: 'layoutResizing',
40
39
  plugin: ({
@@ -63,7 +62,7 @@ export const layoutPlugin = ({
63
62
  },
64
63
  quickInsert: ({
65
64
  formatMessage
66
- }) => isPreRelease2() ? [{
65
+ }) => editorExperiment('advanced_layouts', true) ? [{
67
66
  id: 'twocolumnslayout',
68
67
  title: formatMessage(layoutMessages.twoColumns),
69
68
  description: formatMessage(messages.columnsDescription),
@@ -131,7 +130,7 @@ export const layoutPlugin = ({
131
130
  }]
132
131
  },
133
132
  contentComponent() {
134
- return isPreRelease2() ? /*#__PURE__*/React.createElement(GlobalStylesWrapper, null) : null;
133
+ return editorExperiment('advanced_layouts', true) ? /*#__PURE__*/React.createElement(GlobalStylesWrapper, null) : null;
135
134
  }
136
135
  };
137
136
  };
@@ -7,12 +7,11 @@ import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
7
7
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
8
  import { EVEN_DISTRIBUTED_COL_WIDTHS } from './consts';
9
9
  import { pluginKey } from './plugin-key';
10
- import { isPreRelease2 } from './utils/preRelease';
11
10
  export const ONE_COL_LAYOUTS = ['single'];
12
11
  export const TWO_COL_LAYOUTS = ['two_equal', 'two_left_sidebar', 'two_right_sidebar'];
13
12
  export const THREE_COL_LAYOUTS = ['three_equal', 'three_with_sidebars'];
14
13
  const getWidthsForPreset = presetLayout => {
15
- if (isPreRelease2()) {
14
+ if (editorExperiment('advanced_layouts', true)) {
16
15
  switch (presetLayout) {
17
16
  case 'single':
18
17
  return [100];
@@ -71,7 +70,7 @@ const isValidLayoutWidthDistributions = layoutSection => {
71
70
  */
72
71
  export const getPresetLayout = section => {
73
72
  const widths = mapChildren(section, column => column.attrs.width).join(',');
74
- if (isPreRelease2()) {
73
+ if (editorExperiment('advanced_layouts', true)) {
75
74
  switch (widths) {
76
75
  case '100':
77
76
  return 'single';
@@ -169,7 +168,7 @@ export const insertLayoutColumnsWithAnalytics = editorAnalyticsAPI => inputMetho
169
168
  * Add a column to the right of existing layout
170
169
  */
171
170
  function addColumn(schema, pos) {
172
- if (!isPreRelease2()) {
171
+ if (editorExperiment('advanced_layouts', false)) {
173
172
  return tr => {
174
173
  tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill());
175
174
  };
@@ -301,7 +300,7 @@ function forceColumnWidths(state, tr, pos, presetLayout) {
301
300
  return tr.replaceWith(pos + 1, pos + node.nodeSize - 1, columnWidth(node, state.schema, getWidthsForPreset(presetLayout)));
302
301
  }
303
302
  export function forceSectionToPresetLayout(state, node, pos, presetLayout) {
304
- const forceColumnStructureFn = isPreRelease2() ? forceColumnStructureNew : forceColumnStructure;
303
+ const forceColumnStructureFn = editorExperiment('advanced_layouts', true) ? forceColumnStructureNew : forceColumnStructure;
305
304
  let tr = forceColumnStructureFn(state, node, pos, presetLayout);
306
305
 
307
306
  // save the selection here, since forcing column widths causes a change over the
@@ -344,7 +343,7 @@ export const setPresetLayout = editorAnalyticsAPI => layout => (state, dispatch)
344
343
  return false;
345
344
  };
346
345
  function layoutNeedChanges(node) {
347
- if (isPreRelease2()) {
346
+ if (editorExperiment('advanced_layouts', true)) {
348
347
  return !getPresetLayout(node) || !isValidLayoutWidthDistributions(node);
349
348
  }
350
349
  return !getPresetLayout(node);
@@ -459,7 +458,7 @@ export const deleteActiveLayoutNode = editorAnalyticsAPI => (state, dispatch) =>
459
458
  return false;
460
459
  };
461
460
  const formatLayoutName = layout => {
462
- if (isPreRelease2()) {
461
+ if (editorExperiment('advanced_layouts', true)) {
463
462
  switch (layout) {
464
463
  case 'single':
465
464
  return LAYOUT_TYPE.SINGLE_COL;
@@ -15,8 +15,8 @@ import LayoutTwoLeftSidebarIcon from '@atlaskit/icon/glyph/editor/layout-two-lef
15
15
  import LayoutTwoRightSidebarIcon from '@atlaskit/icon/glyph/editor/layout-two-right-sidebar';
16
16
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
17
17
  import { fg } from '@atlaskit/platform-feature-flags';
18
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
18
19
  import { deleteActiveLayoutNode, getPresetLayout, setPresetLayout } from '../pm-plugins/actions';
19
- import { isPreRelease2 } from '../pm-plugins/utils/preRelease';
20
20
  import { LayoutThreeWithLeftSidebarsIcon } from './icons/LayoutThreeWithLeftSidebars';
21
21
  import { LayoutThreeWithRightSidebarsIcon } from './icons/LayoutThreeWithRightSidebars';
22
22
  const LAYOUT_TYPES = [{
@@ -218,7 +218,7 @@ export const buildToolbar = (state, intl, pos, _allowBreakout, addSidebarLayouts
218
218
  getDomRef: view => findDomRefAtPos(pos, view.domAtPos.bind(view)),
219
219
  nodeType,
220
220
  groupLabel: intl.formatMessage(toolbarMessages.floatingToolbarRadioGroupAriaLabel),
221
- items: isPreRelease2() ? getAdvancedLayoutItems({
221
+ items: editorExperiment('advanced_layouts', true) ? getAdvancedLayoutItems({
222
222
  addSidebarLayouts,
223
223
  intl,
224
224
  editorAnalyticsAPI,
@@ -4,12 +4,11 @@ import { layoutSectionWithSingleColumn } 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, IconThreeColumnLayout, IconTwoColumnLayout } from '@atlaskit/editor-common/quick-insert';
7
- import { fg } from '@atlaskit/platform-feature-flags';
7
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
8
  import { createDefaultLayoutSection, createMultiColumnLayoutSection, insertLayoutColumnsWithAnalytics } from './pm-plugins/actions';
9
9
  import { default as createLayoutPlugin } from './pm-plugins/main';
10
10
  import { pluginKey } from './pm-plugins/plugin-key';
11
11
  import { default as createLayoutResizingPlugin } from './pm-plugins/resizing';
12
- import { isPreRelease2 } from './pm-plugins/utils/preRelease';
13
12
  import { GlobalStylesWrapper } from './ui/global-styles';
14
13
  import { buildToolbar } from './ui/toolbar';
15
14
  export { pluginKey };
@@ -23,7 +22,7 @@ export var layoutPlugin = function layoutPlugin(_ref) {
23
22
  nodes: function nodes() {
24
23
  return [{
25
24
  name: 'layoutSection',
26
- node: isPreRelease2() ? layoutSectionWithSingleColumn : layoutSection
25
+ node: editorExperiment('advanced_layouts', true) ? layoutSectionWithSingleColumn : layoutSection
27
26
  }, {
28
27
  name: 'layoutColumn',
29
28
  node: layoutColumn
@@ -36,7 +35,7 @@ export var layoutPlugin = function layoutPlugin(_ref) {
36
35
  return createLayoutPlugin(options);
37
36
  }
38
37
  }];
39
- if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width') && api && fg('platform_editor_advanced_layouts_breakout_resizing')) {
38
+ if ((options.editorAppearance === 'full-page' || options.editorAppearance === 'full-width') && api && editorExperiment('advanced_layouts', true)) {
40
39
  plugins.push({
41
40
  name: 'layoutResizing',
42
41
  plugin: function plugin(_ref2) {
@@ -65,7 +64,7 @@ export var layoutPlugin = function layoutPlugin(_ref) {
65
64
  },
66
65
  quickInsert: function quickInsert(_ref4) {
67
66
  var formatMessage = _ref4.formatMessage;
68
- return isPreRelease2() ? [{
67
+ return editorExperiment('advanced_layouts', true) ? [{
69
68
  id: 'twocolumnslayout',
70
69
  title: formatMessage(layoutMessages.twoColumns),
71
70
  description: formatMessage(messages.columnsDescription),
@@ -144,7 +143,7 @@ export var layoutPlugin = function layoutPlugin(_ref) {
144
143
  }
145
144
  },
146
145
  contentComponent: function contentComponent() {
147
- return isPreRelease2() ? /*#__PURE__*/React.createElement(GlobalStylesWrapper, null) : null;
146
+ return editorExperiment('advanced_layouts', true) ? /*#__PURE__*/React.createElement(GlobalStylesWrapper, null) : null;
148
147
  }
149
148
  };
150
149
  };
@@ -10,12 +10,11 @@ import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
10
10
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
11
11
  import { EVEN_DISTRIBUTED_COL_WIDTHS } from './consts';
12
12
  import { pluginKey } from './plugin-key';
13
- import { isPreRelease2 } from './utils/preRelease';
14
13
  export var ONE_COL_LAYOUTS = ['single'];
15
14
  export var TWO_COL_LAYOUTS = ['two_equal', 'two_left_sidebar', 'two_right_sidebar'];
16
15
  export var THREE_COL_LAYOUTS = ['three_equal', 'three_with_sidebars'];
17
16
  var getWidthsForPreset = function getWidthsForPreset(presetLayout) {
18
- if (isPreRelease2()) {
17
+ if (editorExperiment('advanced_layouts', true)) {
19
18
  switch (presetLayout) {
20
19
  case 'single':
21
20
  return [100];
@@ -78,7 +77,7 @@ export var getPresetLayout = function getPresetLayout(section) {
78
77
  var widths = mapChildren(section, function (column) {
79
78
  return column.attrs.width;
80
79
  }).join(',');
81
- if (isPreRelease2()) {
80
+ if (editorExperiment('advanced_layouts', true)) {
82
81
  switch (widths) {
83
82
  case '100':
84
83
  return 'single';
@@ -181,7 +180,7 @@ export var insertLayoutColumnsWithAnalytics = function insertLayoutColumnsWithAn
181
180
  * Add a column to the right of existing layout
182
181
  */
183
182
  function addColumn(schema, pos) {
184
- if (!isPreRelease2()) {
183
+ if (editorExperiment('advanced_layouts', false)) {
185
184
  return function (tr) {
186
185
  tr.replaceWith(tr.mapping.map(pos), tr.mapping.map(pos), schema.nodes.layoutColumn.createAndFill());
187
186
  };
@@ -314,7 +313,7 @@ function forceColumnWidths(state, tr, pos, presetLayout) {
314
313
  return tr.replaceWith(pos + 1, pos + node.nodeSize - 1, columnWidth(node, state.schema, getWidthsForPreset(presetLayout)));
315
314
  }
316
315
  export function forceSectionToPresetLayout(state, node, pos, presetLayout) {
317
- var forceColumnStructureFn = isPreRelease2() ? forceColumnStructureNew : forceColumnStructure;
316
+ var forceColumnStructureFn = editorExperiment('advanced_layouts', true) ? forceColumnStructureNew : forceColumnStructure;
318
317
  var tr = forceColumnStructureFn(state, node, pos, presetLayout);
319
318
 
320
319
  // save the selection here, since forcing column widths causes a change over the
@@ -360,7 +359,7 @@ export var setPresetLayout = function setPresetLayout(editorAnalyticsAPI) {
360
359
  };
361
360
  };
362
361
  function layoutNeedChanges(node) {
363
- if (isPreRelease2()) {
362
+ if (editorExperiment('advanced_layouts', true)) {
364
363
  return !getPresetLayout(node) || !isValidLayoutWidthDistributions(node);
365
364
  }
366
365
  return !getPresetLayout(node);
@@ -473,7 +472,7 @@ export var deleteActiveLayoutNode = function deleteActiveLayoutNode(editorAnalyt
473
472
  };
474
473
  };
475
474
  var formatLayoutName = function formatLayoutName(layout) {
476
- if (isPreRelease2()) {
475
+ if (editorExperiment('advanced_layouts', true)) {
477
476
  switch (layout) {
478
477
  case 'single':
479
478
  return LAYOUT_TYPE.SINGLE_COL;
@@ -16,8 +16,8 @@ import LayoutTwoLeftSidebarIcon from '@atlaskit/icon/glyph/editor/layout-two-lef
16
16
  import LayoutTwoRightSidebarIcon from '@atlaskit/icon/glyph/editor/layout-two-right-sidebar';
17
17
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
18
18
  import { fg } from '@atlaskit/platform-feature-flags';
19
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
19
20
  import { deleteActiveLayoutNode, getPresetLayout, setPresetLayout } from '../pm-plugins/actions';
20
- import { isPreRelease2 } from '../pm-plugins/utils/preRelease';
21
21
  import { LayoutThreeWithLeftSidebarsIcon } from './icons/LayoutThreeWithLeftSidebars';
22
22
  import { LayoutThreeWithRightSidebarsIcon } from './icons/LayoutThreeWithRightSidebars';
23
23
  var LAYOUT_TYPES = [{
@@ -223,7 +223,7 @@ export var buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout
223
223
  },
224
224
  nodeType: nodeType,
225
225
  groupLabel: intl.formatMessage(toolbarMessages.floatingToolbarRadioGroupAriaLabel),
226
- items: isPreRelease2() ? getAdvancedLayoutItems({
226
+ items: editorExperiment('advanced_layouts', true) ? getAdvancedLayoutItems({
227
227
  addSidebarLayouts: addSidebarLayouts,
228
228
  intl: intl,
229
229
  editorAnalyticsAPI: editorAnalyticsAPI,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-layout",
3
- "version": "1.12.9",
3
+ "version": "1.12.10",
4
4
  "description": "Layout plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -94,15 +94,9 @@
94
94
  }
95
95
  },
96
96
  "platform-feature-flags": {
97
- "platform_editor_advanced_layouts_pre_release_2": {
98
- "type": "boolean"
99
- },
100
97
  "platform_editor_remove_copy_button_from_view_mode": {
101
98
  "type": "boolean"
102
99
  },
103
- "platform_editor_advanced_layouts_breakout_resizing": {
104
- "type": "boolean"
105
- },
106
100
  "platform-visual-refresh-icons": {
107
101
  "type": "boolean"
108
102
  }
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isPreRelease2 = void 0;
7
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
8
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
9
- var isPreRelease2 = exports.isPreRelease2 = function isPreRelease2() {
10
- return (0, _experiments.editorExperiment)('advanced_layouts', true) || (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_pre_release_2');
11
- };
@@ -1,3 +0,0 @@
1
- import { fg } from '@atlaskit/platform-feature-flags';
2
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
- export const isPreRelease2 = () => editorExperiment('advanced_layouts', true) || fg('platform_editor_advanced_layouts_pre_release_2');
@@ -1,5 +0,0 @@
1
- import { fg } from '@atlaskit/platform-feature-flags';
2
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
- export var isPreRelease2 = function isPreRelease2() {
4
- return editorExperiment('advanced_layouts', true) || fg('platform_editor_advanced_layouts_pre_release_2');
5
- };
@@ -1 +0,0 @@
1
- export declare const isPreRelease2: () => boolean;
@@ -1 +0,0 @@
1
- export declare const isPreRelease2: () => boolean;