@atlaskit/editor-plugin-expand 3.2.11 → 3.2.13

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,38 @@
1
1
  # @atlaskit/editor-plugin-expand
2
2
 
3
+ ## 3.2.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [#159655](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/159655)
8
+ [`24f8c627d50f2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/24f8c627d50f2) - ##
9
+ WHAT? Remove experimental graceful edit mode from view mode plugin and associated props.
10
+
11
+ ## WHY?
12
+
13
+ This experiment is being cleaned up and we are no longer proceeding in this direction.
14
+
15
+ ## HOW to adjust?
16
+
17
+ This experiment was only enabled for Confluence and should not have been enabled in other places.
18
+ If for some reason any of the following props/state/methdos were used please remove them:
19
+
20
+ - isConsumption
21
+ - contentMode
22
+ - initialContentMode
23
+ - updateContentMode
24
+
25
+ - Updated dependencies
26
+
27
+ ## 3.2.12
28
+
29
+ ### Patch Changes
30
+
31
+ - [#159403](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/159403)
32
+ [`8db235c23c369`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8db235c23c369) -
33
+ ENGHEALTH-28082:Added aria label to expand button
34
+ - Updated dependencies
35
+
3
36
  ## 3.2.11
4
37
 
5
38
  ### Patch Changes
@@ -78,7 +78,7 @@ var updateExpandTitle = exports.updateExpandTitle = function updateExpandTitle(_
78
78
  var node = state.doc.nodeAt(pos);
79
79
  if (node && node.type === nodeType && dispatch) {
80
80
  var tr = state.tr;
81
- if (__livePage && (0, _platformFeatureFlags.fg)('platform.editor.live-pages-expand-divergence')) {
81
+ if (__livePage) {
82
82
  tr.step(new _steps.SetAttrsStep(pos, _objectSpread(_objectSpread({}, node.attrs), {}, {
83
83
  title: title
84
84
  })));
@@ -102,7 +102,7 @@ var toggleExpandExpanded = exports.toggleExpandExpanded = function toggleExpandE
102
102
  if (node && node.type === nodeType && dispatch) {
103
103
  var tr = state.tr;
104
104
  var isExpandedNext = !node.attrs.__expanded;
105
- if (__livePage && (0, _platformFeatureFlags.fg)('platform.editor.live-pages-expand-divergence')) {
105
+ if (__livePage) {
106
106
  tr.step(new _steps.SetAttrsStep(pos, _objectSpread(_objectSpread({}, node.attrs), {}, {
107
107
  __expanded: isExpandedNext
108
108
  })));
@@ -115,7 +115,7 @@ var toggleExpandExpanded = exports.toggleExpandExpanded = function toggleExpandE
115
115
  // If we're going to collapse the expand and our cursor is currently inside
116
116
  // Move to a right gap cursor, if the toolbar is interacted (or an API),
117
117
  // it will insert below rather than inside (which will be invisible).
118
- if (__livePage && (0, _platformFeatureFlags.fg)('platform.editor.live-pages-expand-divergence') ? isExpandedNext === true : isExpandedNext === false && (0, _transforms.findExpand)(state)) {
118
+ if (__livePage ? isExpandedNext === true : isExpandedNext === false && (0, _transforms.findExpand)(state)) {
119
119
  tr.setSelection(new _selection.GapCursorSelection(tr.doc.resolve(pos + node.nodeSize), _selection.Side.RIGHT));
120
120
  }
121
121
 
@@ -127,7 +127,7 @@ var toggleExpandExpanded = exports.toggleExpandExpanded = function toggleExpandE
127
127
  attributes: {
128
128
  platform: _analytics.PLATFORMS.WEB,
129
129
  mode: _analytics.MODE.EDITOR,
130
- expanded: __livePage && (0, _platformFeatureFlags.fg)('platform.editor.live-pages-expand-divergence') ? !isExpandedNext : isExpandedNext
130
+ expanded: __livePage ? !isExpandedNext : isExpandedNext
131
131
  },
132
132
  eventType: _analytics.EVENT_TYPE.TRACK
133
133
  };
@@ -19,7 +19,6 @@ var _utils = require("@atlaskit/editor-common/utils");
19
19
  var _history = require("@atlaskit/editor-prosemirror/history");
20
20
  var _model = require("@atlaskit/editor-prosemirror/model");
21
21
  var _state = require("@atlaskit/editor-prosemirror/state");
22
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
22
  var _commands = require("../commands");
24
23
  var _ExpandIconButton = require("../ui/ExpandIconButton");
25
24
  function buildExpandClassName(type, expanded) {
@@ -28,7 +27,7 @@ function buildExpandClassName(type, expanded) {
28
27
  var toDOM = function toDOM(node, __livePage, intl, titleReadOnly, contentEditable) {
29
28
  return ['div', {
30
29
  // prettier-ignore
31
- 'class': buildExpandClassName(node.type.name, __livePage && (0, _platformFeatureFlags.fg)('platform.editor.live-pages-expand-divergence') ? !node.attrs.__expanded : node.attrs.__expanded),
30
+ 'class': buildExpandClassName(node.type.name, __livePage ? !node.attrs.__expanded : node.attrs.__expanded),
32
31
  'data-node-type': node.type.name,
33
32
  'data-title': node.attrs.title
34
33
  }, ['div', {
@@ -272,7 +271,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
272
271
  }
273
272
  });
274
273
  (0, _defineProperty2.default)(this, "isCollapsed", function () {
275
- if (_this.__livePage && (0, _platformFeatureFlags.fg)('platform.editor.live-pages-expand-divergence')) {
274
+ if (_this.__livePage) {
276
275
  return _this.node.attrs.__expanded;
277
276
  }
278
277
  return !_this.node.attrs.__expanded;
@@ -402,7 +401,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
402
401
  return;
403
402
  });
404
403
  (0, _defineProperty2.default)(this, "getContentEditable", function (node) {
405
- var contentEditable = _this.__livePage && (0, _platformFeatureFlags.fg)('platform.editor.live-pages-expand-divergence') ? !node.attrs.__expanded : node.attrs.__expanded;
404
+ var contentEditable = _this.__livePage ? !node.attrs.__expanded : node.attrs.__expanded;
406
405
  if (_this.api && _this.api.editorDisabled) {
407
406
  var _this$api$editorDisab;
408
407
  return !((_this$api$editorDisab = _this.api.editorDisabled.sharedState.currentState()) !== null && _this$api$editorDisab !== void 0 && _this$api$editorDisab.editorDisabled) && contentEditable;
@@ -495,7 +494,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
495
494
  return /*#__PURE__*/_react.default.createElement(_ExpandIconButton.ExpandIconButton, {
496
495
  intl: intl,
497
496
  allowInteractiveExpand: _this3.allowInteractiveExpand,
498
- expanded: _this3.__livePage && (0, _platformFeatureFlags.fg)('platform.editor.live-pages-expand-divergence') ? !__expanded : __expanded
497
+ expanded: _this3.__livePage ? !__expanded : __expanded
499
498
  });
500
499
  }, this.icon, this.renderKey);
501
500
  }
@@ -11,7 +11,6 @@ var _utils = require("@atlaskit/editor-common/utils");
11
11
  var _keymap = require("@atlaskit/editor-prosemirror/keymap");
12
12
  var _state = require("@atlaskit/editor-prosemirror/state");
13
13
  var _utils2 = require("@atlaskit/editor-tables/utils");
14
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
14
  var _commands = require("../commands");
16
15
  var isExpandNode = function isExpandNode(node) {
17
16
  return (node === null || node === void 0 ? void 0 : node.type.name) === 'expand' || (node === null || node === void 0 ? void 0 : node.type.name) === 'nestedExpand';
@@ -92,9 +91,7 @@ function expandKeymap(api, options) {
92
91
  var selection = state.selection,
93
92
  schema = state.schema;
94
93
  var nodeBefore = selection.$from.nodeBefore;
95
- if (selection instanceof _selection.GapCursorSelection && selection.side === _selection.Side.RIGHT && nodeBefore && (nodeBefore.type === schema.nodes.expand || nodeBefore.type === schema.nodes.nestedExpand) && (
96
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
97
- (0, _platformFeatureFlags.fg)('platform.editor.live-pages-expand-divergence') && options.__livePage ? nodeBefore.attrs.__expanded : !nodeBefore.attrs.__expanded)) {
94
+ if (selection instanceof _selection.GapCursorSelection && selection.side === _selection.Side.RIGHT && nodeBefore && (nodeBefore.type === schema.nodes.expand || nodeBefore.type === schema.nodes.nestedExpand) && (options.__livePage ? nodeBefore.attrs.__expanded : !nodeBefore.attrs.__expanded)) {
98
95
  var _$from = selection.$from;
99
96
  return (0, _commands.focusTitle)(Math.max(_$from.pos - 1, 0))(state, dispatch, editorView);
100
97
  }
@@ -118,9 +115,7 @@ function expandKeymap(api, options) {
118
115
  var expandBefore = (0, _transforms.findExpand)(state, sel);
119
116
  if (sel && expandBefore) {
120
117
  // moving cursor from outside of an expand to the title when it is collapsed
121
- if (
122
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
123
- (0, _platformFeatureFlags.fg)('platform.editor.live-pages-expand-divergence') && options.__livePage ? expandBefore.node.attrs.__expanded : !expandBefore.node.attrs.__expanded) {
118
+ if (options.__livePage ? expandBefore.node.attrs.__expanded : !expandBefore.node.attrs.__expanded) {
124
119
  return (0, _commands.focusTitle)(expandBefore.start)(state, dispatch, editorView);
125
120
  }
126
121
  // moving cursor from outside of an expand to the content when it is expanded
@@ -144,9 +139,7 @@ function expandKeymap(api, options) {
144
139
  nestedExpand = _state$schema$nodes.nestedExpand;
145
140
  var selection = state.selection;
146
141
  var nodeAfter = selection.$from.nodeAfter;
147
- if (selection instanceof _selection.GapCursorSelection && selection.side === _selection.Side.LEFT && nodeAfter && (nodeAfter.type === expand || nodeAfter.type === nestedExpand) && (
148
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
149
- (0, _platformFeatureFlags.fg)('platform.editor.live-pages-expand-divergence') && options.__livePage ? nodeAfter.attrs.__expanded : !nodeAfter.attrs.__expanded)) {
142
+ if (selection instanceof _selection.GapCursorSelection && selection.side === _selection.Side.LEFT && nodeAfter && (nodeAfter.type === expand || nodeAfter.type === nestedExpand) && (options.__livePage ? nodeAfter.attrs.__expanded : !nodeAfter.attrs.__expanded)) {
150
143
  var $from = selection.$from;
151
144
  return (0, _commands.focusTitle)($from.pos + 1)(state, dispatch, editorView);
152
145
  }
@@ -179,9 +172,7 @@ function expandKeymap(api, options) {
179
172
  // @see ED-7977
180
173
  var sel = _state.Selection.findFrom(state.doc.resolve(Math.max(selection.$from.pos - 1, 0)), -1);
181
174
  var expandBefore = (0, _transforms.findExpand)(state, sel);
182
- if (expandBefore && (expandBefore.node.type === expand || expandBefore.node.type === nestedExpand) && (
183
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
184
- (0, _platformFeatureFlags.fg)('platform.editor.live-pages-expand-divergence') && options.__livePage ? expandBefore.node.attrs.__expanded : !expandBefore.node.attrs.__expanded)) {
175
+ if (expandBefore && (expandBefore.node.type === expand || expandBefore.node.type === nestedExpand) && (options.__livePage ? expandBefore.node.attrs.__expanded : !expandBefore.node.attrs.__expanded)) {
185
176
  return (0, _commands.focusTitle)(expandBefore.start)(state, dispatch, editorView);
186
177
  }
187
178
  return false;
@@ -61,7 +61,8 @@ var withTooltip = exports.withTooltip = function withTooltip(WrapperComponent) {
61
61
  };
62
62
  var CustomButton = exports.CustomButton = function CustomButton(props) {
63
63
  var allowInteractiveExpand = props.allowInteractiveExpand,
64
- expanded = props.expanded;
64
+ expanded = props.expanded,
65
+ intl = props.intl;
65
66
  var useTheme = (0, _react.useCallback)(
66
67
  // Ignored via go/ees005
67
68
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -79,6 +80,8 @@ var CustomButton = exports.CustomButton = function CustomButton(props) {
79
80
  })
80
81
  }, rest);
81
82
  }, [props]);
83
+ var label = expanded ? _ui.expandMessages.collapseNode : _ui.expandMessages.expandNode;
84
+ var labelIntl = intl ? intl.formatMessage(label) : label.defaultMessage;
82
85
  return (0, _react2.jsx)(_customThemeButton.default, {
83
86
  appearance: "subtle"
84
87
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -90,6 +93,7 @@ var CustomButton = exports.CustomButton = function CustomButton(props) {
90
93
  }),
91
94
  shouldFitContainer: true,
92
95
  theme: useTheme,
96
+ "aria-label": labelIntl,
93
97
  "aria-expanded": expanded,
94
98
  isDisabled: !allowInteractiveExpand
95
99
  });
@@ -20,7 +20,6 @@ var _history = require("@atlaskit/editor-prosemirror/history");
20
20
  var _model = require("@atlaskit/editor-prosemirror/model");
21
21
  var _state = require("@atlaskit/editor-prosemirror/state");
22
22
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
24
23
  var _commands = require("../commands");
25
24
  var _ExpandButton = require("../ui/ExpandButton");
26
25
  var _NodeView = require("../ui/NodeView");
@@ -28,7 +27,7 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
28
27
  function ExpandNodeView(_node, view, getPos, getIntl, isMobile, selectNearNode, api, nodeViewPortalProviderAPI) {
29
28
  var _this = this,
30
29
  _api$editorDisabled,
31
- _this$api8;
30
+ _this$api6;
32
31
  var allowInteractiveExpand = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : true;
33
32
  var __livePage = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
34
33
  var cleanUpEditorDisabledOnChange = arguments.length > 10 ? arguments[10] : undefined;
@@ -123,17 +122,9 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
123
122
  (0, _defineProperty2.default)(this, "handleFocus", function (event) {
124
123
  event.stopImmediatePropagation();
125
124
  });
126
- (0, _defineProperty2.default)(this, "handleInputClick", function () {
127
- if (!(0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control')) {
128
- var _this$api2, _this$api3;
129
- (_this$api2 = _this.api) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.core) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.actions) === null || _this$api2 === void 0 || _this$api2.execute((_this$api3 = _this.api) === null || _this$api3 === void 0 || (_this$api3 = _this$api3.editorViewMode) === null || _this$api3 === void 0 ? void 0 : _this$api3.commands.updateContentMode({
130
- type: 'intent-to-edit'
131
- }));
132
- }
133
- });
134
125
  (0, _defineProperty2.default)(this, "handleInputFocus", function () {
135
- var _this$api4;
136
- _this.decorationCleanup = (_this$api4 = _this.api) === null || _this$api4 === void 0 || (_this$api4 = _this$api4.selectionMarker) === null || _this$api4 === void 0 || (_this$api4 = _this$api4.actions) === null || _this$api4 === void 0 ? void 0 : _this$api4.hideDecoration();
126
+ var _this$api2;
127
+ _this.decorationCleanup = (_this$api2 = _this.api) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.selectionMarker) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.actions) === null || _this$api2 === void 0 ? void 0 : _this$api2.hideDecoration();
137
128
  });
138
129
  (0, _defineProperty2.default)(this, "handleBlur", function () {
139
130
  var _this$decorationClean;
@@ -185,8 +176,8 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
185
176
  return;
186
177
  }
187
178
  if (expandNode && (0, _utils.isEmptyNode)(state.schema)(expandNode)) {
188
- var _this$api5;
189
- (0, _commands.deleteExpand)((_this$api5 = _this.api) === null || _this$api5 === void 0 || (_this$api5 = _this$api5.analytics) === null || _this$api5 === void 0 ? void 0 : _this$api5.actions)(state, _this.view.dispatch);
179
+ var _this$api3;
180
+ (0, _commands.deleteExpand)((_this$api3 = _this.api) === null || _this$api3 === void 0 || (_this$api3 = _this$api3.analytics) === null || _this$api3 === void 0 ? void 0 : _this$api3.actions)(state, _this.view.dispatch);
190
181
  }
191
182
  });
192
183
  (0, _defineProperty2.default)(this, "toggleExpand", function () {
@@ -195,12 +186,12 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
195
186
  return;
196
187
  }
197
188
  if (_this.allowInteractiveExpand) {
198
- var _this$api6;
189
+ var _this$api4;
199
190
  var _this$view3 = _this.view,
200
191
  state = _this$view3.state,
201
192
  dispatch = _this$view3.dispatch;
202
193
  (0, _commands.toggleExpandExpanded)({
203
- editorAnalyticsAPI: (_this$api6 = _this.api) === null || _this$api6 === void 0 || (_this$api6 = _this$api6.analytics) === null || _this$api6 === void 0 ? void 0 : _this$api6.actions,
194
+ editorAnalyticsAPI: (_this$api4 = _this.api) === null || _this$api4 === void 0 || (_this$api4 = _this$api4.analytics) === null || _this$api4 === void 0 ? void 0 : _this$api4.actions,
204
195
  pos: pos,
205
196
  node: _this.node
206
197
  })(state, dispatch);
@@ -322,13 +313,13 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
322
313
  selectionStart = _this$input5.selectionStart,
323
314
  selectionEnd = _this$input5.selectionEnd;
324
315
  if (selectionStart === selectionEnd && selectionStart === 0) {
325
- var _this$api7;
316
+ var _this$api5;
326
317
  event.preventDefault();
327
318
  var _this$view8 = _this.view,
328
319
  state = _this$view8.state,
329
320
  dispatch = _this$view8.dispatch;
330
321
  _this.view.focus();
331
- var selectionSharedState = ((_this$api7 = _this.api) === null || _this$api7 === void 0 || (_this$api7 = _this$api7.selection) === null || _this$api7 === void 0 ? void 0 : _this$api7.sharedState.currentState()) || {};
322
+ var selectionSharedState = ((_this$api5 = _this.api) === null || _this$api5 === void 0 || (_this$api5 = _this$api5.selection) === null || _this$api5 === void 0 ? void 0 : _this$api5.sharedState.currentState()) || {};
332
323
  // selectionRelativeToNode is undefined when user clicked to select node, then hit left to get focus in title
333
324
  // This is a special case where we want to bypass node selection and jump straight to gap cursor
334
325
  if ((selectionSharedState === null || selectionSharedState === void 0 ? void 0 : selectionSharedState.selectionRelativeToNode) === undefined) {
@@ -429,11 +420,8 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
429
420
  // If the user interacts in our title bar (either toggle or input)
430
421
  // Prevent ProseMirror from getting a focus event (causes weird selection issues).
431
422
  this.titleContainer.addEventListener('focus', this.handleFocus);
432
- if (!(0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control')) {
433
- this.input.addEventListener('click', this.handleInputClick);
434
- }
435
423
  this.icon.addEventListener('keydown', this.handleIconKeyDown);
436
- if ((_this$api8 = this.api) !== null && _this$api8 !== void 0 && _this$api8.editorDisabled) {
424
+ if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled) {
437
425
  this.cleanUpEditorDisabledOnChange = this.api.editorDisabled.sharedState.onChange(function (sharedState) {
438
426
  var editorDisabled = sharedState.nextSharedState.editorDisabled;
439
427
  if (_this.input) {
@@ -535,9 +523,6 @@ var ExpandNodeView = exports.ExpandNodeView = /*#__PURE__*/function () {
535
523
  this.input.removeEventListener('blur', this.handleBlur);
536
524
  this.input.removeEventListener('focus', this.handleInputFocus);
537
525
  this.titleContainer.removeEventListener('focus', this.handleFocus);
538
- if (!(0, _experiments.editorExperiment)('live_pages_graceful_edit', 'control')) {
539
- this.input.removeEventListener('click', this.handleInputClick);
540
- }
541
526
  this.icon.removeEventListener('keydown', this.handleIconKeyDown);
542
527
  (_this$decorationClean2 = this.decorationCleanup) === null || _this$decorationClean2 === void 0 || _this$decorationClean2.call(this);
543
528
  if (this.cleanUpEditorDisabledOnChange) {
@@ -63,6 +63,10 @@ var ExpandButtonInner = exports.ExpandButtonInner = function ExpandButtonInner(p
63
63
  })
64
64
  }, rest);
65
65
  }, [props]);
66
+ var intl = props.intl,
67
+ expanded = props.expanded;
68
+ var label = expanded ? _ui.expandMessages.collapseNode : _ui.expandMessages.expandNode;
69
+ var labelIntl = intl ? intl.formatMessage(label) : label.defaultMessage;
66
70
  return (0, _react2.jsx)(_customThemeButton.default, {
67
71
  appearance: "subtle"
68
72
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -74,6 +78,7 @@ var ExpandButtonInner = exports.ExpandButtonInner = function ExpandButtonInner(p
74
78
  }),
75
79
  shouldFitContainer: true,
76
80
  theme: useTheme,
81
+ "aria-label": labelIntl,
77
82
  "aria-expanded": props.expanded,
78
83
  isDisabled: !props.allowInteractiveExpand
79
84
  });
@@ -62,7 +62,7 @@ export const updateExpandTitle = ({
62
62
  const {
63
63
  tr
64
64
  } = state;
65
- if (__livePage && fg('platform.editor.live-pages-expand-divergence')) {
65
+ if (__livePage) {
66
66
  tr.step(new SetAttrsStep(pos, {
67
67
  ...node.attrs,
68
68
  title
@@ -89,7 +89,7 @@ export const toggleExpandExpanded = ({
89
89
  tr
90
90
  } = state;
91
91
  const isExpandedNext = !node.attrs.__expanded;
92
- if (__livePage && fg('platform.editor.live-pages-expand-divergence')) {
92
+ if (__livePage) {
93
93
  tr.step(new SetAttrsStep(pos, {
94
94
  ...node.attrs,
95
95
  __expanded: isExpandedNext
@@ -104,7 +104,7 @@ export const toggleExpandExpanded = ({
104
104
  // If we're going to collapse the expand and our cursor is currently inside
105
105
  // Move to a right gap cursor, if the toolbar is interacted (or an API),
106
106
  // it will insert below rather than inside (which will be invisible).
107
- if (__livePage && fg('platform.editor.live-pages-expand-divergence') ? isExpandedNext === true : isExpandedNext === false && findExpand(state)) {
107
+ if (__livePage ? isExpandedNext === true : isExpandedNext === false && findExpand(state)) {
108
108
  tr.setSelection(new GapCursorSelection(tr.doc.resolve(pos + node.nodeSize), Side.RIGHT));
109
109
  }
110
110
 
@@ -116,7 +116,7 @@ export const toggleExpandExpanded = ({
116
116
  attributes: {
117
117
  platform: PLATFORMS.WEB,
118
118
  mode: MODE.EDITOR,
119
- expanded: __livePage && fg('platform.editor.live-pages-expand-divergence') ? !isExpandedNext : isExpandedNext
119
+ expanded: __livePage ? !isExpandedNext : isExpandedNext
120
120
  },
121
121
  eventType: EVENT_TYPE.TRACK
122
122
  };
@@ -9,7 +9,6 @@ import { closestElement, isEmptyNode } from '@atlaskit/editor-common/utils';
9
9
  import { redo, undo } from '@atlaskit/editor-prosemirror/history';
10
10
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
11
11
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
12
- import { fg } from '@atlaskit/platform-feature-flags';
13
12
  import { deleteExpandAtPos, setSelectionInsideExpand, toggleExpandExpanded, updateExpandTitle } from '../commands';
14
13
  import { ExpandIconButton } from '../ui/ExpandIconButton';
15
14
  function buildExpandClassName(type, expanded) {
@@ -17,7 +16,7 @@ function buildExpandClassName(type, expanded) {
17
16
  }
18
17
  const toDOM = (node, __livePage, intl, titleReadOnly, contentEditable) => ['div', {
19
18
  // prettier-ignore
20
- 'class': buildExpandClassName(node.type.name, __livePage && fg('platform.editor.live-pages-expand-divergence') ? !node.attrs.__expanded : node.attrs.__expanded),
19
+ 'class': buildExpandClassName(node.type.name, __livePage ? !node.attrs.__expanded : node.attrs.__expanded),
21
20
  'data-node-type': node.type.name,
22
21
  'data-title': node.attrs.title
23
22
  }, ['div', {
@@ -263,7 +262,7 @@ export class ExpandNodeView {
263
262
  }
264
263
  });
265
264
  _defineProperty(this, "isCollapsed", () => {
266
- if (this.__livePage && fg('platform.editor.live-pages-expand-divergence')) {
265
+ if (this.__livePage) {
267
266
  return this.node.attrs.__expanded;
268
267
  }
269
268
  return !this.node.attrs.__expanded;
@@ -403,7 +402,7 @@ export class ExpandNodeView {
403
402
  return;
404
403
  });
405
404
  _defineProperty(this, "getContentEditable", node => {
406
- const contentEditable = this.__livePage && fg('platform.editor.live-pages-expand-divergence') ? !node.attrs.__expanded : node.attrs.__expanded;
405
+ const contentEditable = this.__livePage ? !node.attrs.__expanded : node.attrs.__expanded;
407
406
  if (this.api && this.api.editorDisabled) {
408
407
  var _this$api$editorDisab;
409
408
  return !((_this$api$editorDisab = this.api.editorDisabled.sharedState.currentState()) !== null && _this$api$editorDisab !== void 0 && _this$api$editorDisab.editorDisabled) && contentEditable;
@@ -491,7 +490,7 @@ export class ExpandNodeView {
491
490
  this.nodeViewPortalProviderAPI.render(() => /*#__PURE__*/React.createElement(ExpandIconButton, {
492
491
  intl: intl,
493
492
  allowInteractiveExpand: this.allowInteractiveExpand,
494
- expanded: this.__livePage && fg('platform.editor.live-pages-expand-divergence') ? !__expanded : __expanded
493
+ expanded: this.__livePage ? !__expanded : __expanded
495
494
  }), this.icon, this.renderKey);
496
495
  }
497
496
  stopEvent(event) {
@@ -5,7 +5,6 @@ import { isEmptyNode, isPositionNearTableRow } from '@atlaskit/editor-common/uti
5
5
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
6
6
  import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { isInTable } from '@atlaskit/editor-tables/utils';
8
- import { fg } from '@atlaskit/platform-feature-flags';
9
8
  import { deleteExpand, focusIcon, focusTitle } from '../commands';
10
9
  const isExpandNode = node => {
11
10
  return (node === null || node === void 0 ? void 0 : node.type.name) === 'expand' || (node === null || node === void 0 ? void 0 : node.type.name) === 'nestedExpand';
@@ -98,9 +97,7 @@ export function expandKeymap(api, options) {
98
97
  const {
99
98
  nodeBefore
100
99
  } = selection.$from;
101
- if (selection instanceof GapCursorSelection && selection.side === Side.RIGHT && nodeBefore && (nodeBefore.type === schema.nodes.expand || nodeBefore.type === schema.nodes.nestedExpand) && (
102
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
103
- fg('platform.editor.live-pages-expand-divergence') && options.__livePage ? nodeBefore.attrs.__expanded : !nodeBefore.attrs.__expanded)) {
100
+ if (selection instanceof GapCursorSelection && selection.side === Side.RIGHT && nodeBefore && (nodeBefore.type === schema.nodes.expand || nodeBefore.type === schema.nodes.nestedExpand) && (options.__livePage ? nodeBefore.attrs.__expanded : !nodeBefore.attrs.__expanded)) {
104
101
  const {
105
102
  $from
106
103
  } = selection;
@@ -128,9 +125,7 @@ export function expandKeymap(api, options) {
128
125
  const expandBefore = findExpand(state, sel);
129
126
  if (sel && expandBefore) {
130
127
  // moving cursor from outside of an expand to the title when it is collapsed
131
- if (
132
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
133
- fg('platform.editor.live-pages-expand-divergence') && options.__livePage ? expandBefore.node.attrs.__expanded : !expandBefore.node.attrs.__expanded) {
128
+ if (options.__livePage ? expandBefore.node.attrs.__expanded : !expandBefore.node.attrs.__expanded) {
134
129
  return focusTitle(expandBefore.start)(state, dispatch, editorView);
135
130
  }
136
131
  // moving cursor from outside of an expand to the content when it is expanded
@@ -159,9 +154,7 @@ export function expandKeymap(api, options) {
159
154
  const {
160
155
  nodeAfter
161
156
  } = selection.$from;
162
- if (selection instanceof GapCursorSelection && selection.side === Side.LEFT && nodeAfter && (nodeAfter.type === expand || nodeAfter.type === nestedExpand) && (
163
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
164
- fg('platform.editor.live-pages-expand-divergence') && options.__livePage ? nodeAfter.attrs.__expanded : !nodeAfter.attrs.__expanded)) {
157
+ if (selection instanceof GapCursorSelection && selection.side === Side.LEFT && nodeAfter && (nodeAfter.type === expand || nodeAfter.type === nestedExpand) && (options.__livePage ? nodeAfter.attrs.__expanded : !nodeAfter.attrs.__expanded)) {
165
158
  const {
166
159
  $from
167
160
  } = selection;
@@ -203,9 +196,7 @@ export function expandKeymap(api, options) {
203
196
  // @see ED-7977
204
197
  const sel = Selection.findFrom(state.doc.resolve(Math.max(selection.$from.pos - 1, 0)), -1);
205
198
  const expandBefore = findExpand(state, sel);
206
- if (expandBefore && (expandBefore.node.type === expand || expandBefore.node.type === nestedExpand) && (
207
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
208
- fg('platform.editor.live-pages-expand-divergence') && options.__livePage ? expandBefore.node.attrs.__expanded : !expandBefore.node.attrs.__expanded)) {
199
+ if (expandBefore && (expandBefore.node.type === expand || expandBefore.node.type === nestedExpand) && (options.__livePage ? expandBefore.node.attrs.__expanded : !expandBefore.node.attrs.__expanded)) {
209
200
  return focusTitle(expandBefore.start)(state, dispatch, editorView);
210
201
  }
211
202
  return false;
@@ -40,7 +40,8 @@ export const withTooltip = WrapperComponent => {
40
40
  export const CustomButton = props => {
41
41
  const {
42
42
  allowInteractiveExpand,
43
- expanded
43
+ expanded,
44
+ intl
44
45
  } = props;
45
46
  const useTheme = useCallback(
46
47
  // Ignored via go/ees005
@@ -62,6 +63,8 @@ export const CustomButton = props => {
62
63
  ...rest
63
64
  };
64
65
  }, [props]);
66
+ const label = expanded ? expandMessages.collapseNode : expandMessages.expandNode;
67
+ const labelIntl = intl ? intl.formatMessage(label) : label.defaultMessage;
65
68
  return jsx(Button, {
66
69
  appearance: "subtle"
67
70
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -73,6 +76,7 @@ export const CustomButton = props => {
73
76
  }),
74
77
  shouldFitContainer: true,
75
78
  theme: useTheme,
79
+ "aria-label": labelIntl,
76
80
  "aria-expanded": expanded,
77
81
  isDisabled: !allowInteractiveExpand
78
82
  });
@@ -10,13 +10,12 @@ import { redo, undo } from '@atlaskit/editor-prosemirror/history';
10
10
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
11
11
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
13
  import { deleteExpand, setSelectionInsideExpand, toggleExpandExpanded, updateExpandTitle } from '../commands';
15
14
  import { ExpandButton } from '../ui/ExpandButton';
16
15
  import { buildExpandClassName, toDOM } from '../ui/NodeView';
17
16
  export class ExpandNodeView {
18
17
  constructor(_node, view, getPos, getIntl, isMobile, selectNearNode, api, nodeViewPortalProviderAPI, allowInteractiveExpand = true, __livePage = false, cleanUpEditorDisabledOnChange) {
19
- var _api$editorDisabled, _api$editorDisabled$s, _this$api8;
18
+ var _api$editorDisabled, _api$editorDisabled$s, _this$api6;
20
19
  _defineProperty(this, "allowInteractiveExpand", true);
21
20
  _defineProperty(this, "isMobile", false);
22
21
  _defineProperty(this, "focusTitle", () => {
@@ -109,17 +108,9 @@ export class ExpandNodeView {
109
108
  _defineProperty(this, "handleFocus", event => {
110
109
  event.stopImmediatePropagation();
111
110
  });
112
- _defineProperty(this, "handleInputClick", () => {
113
- if (!editorExperiment('live_pages_graceful_edit', 'control')) {
114
- var _this$api2, _this$api2$core, _this$api2$core$actio, _this$api3, _this$api3$editorView;
115
- (_this$api2 = this.api) === null || _this$api2 === void 0 ? void 0 : (_this$api2$core = _this$api2.core) === null || _this$api2$core === void 0 ? void 0 : (_this$api2$core$actio = _this$api2$core.actions) === null || _this$api2$core$actio === void 0 ? void 0 : _this$api2$core$actio.execute((_this$api3 = this.api) === null || _this$api3 === void 0 ? void 0 : (_this$api3$editorView = _this$api3.editorViewMode) === null || _this$api3$editorView === void 0 ? void 0 : _this$api3$editorView.commands.updateContentMode({
116
- type: 'intent-to-edit'
117
- }));
118
- }
119
- });
120
111
  _defineProperty(this, "handleInputFocus", () => {
121
- var _this$api4, _this$api4$selectionM, _this$api4$selectionM2;
122
- this.decorationCleanup = (_this$api4 = this.api) === null || _this$api4 === void 0 ? void 0 : (_this$api4$selectionM = _this$api4.selectionMarker) === null || _this$api4$selectionM === void 0 ? void 0 : (_this$api4$selectionM2 = _this$api4$selectionM.actions) === null || _this$api4$selectionM2 === void 0 ? void 0 : _this$api4$selectionM2.hideDecoration();
112
+ var _this$api2, _this$api2$selectionM, _this$api2$selectionM2;
113
+ this.decorationCleanup = (_this$api2 = this.api) === null || _this$api2 === void 0 ? void 0 : (_this$api2$selectionM = _this$api2.selectionMarker) === null || _this$api2$selectionM === void 0 ? void 0 : (_this$api2$selectionM2 = _this$api2$selectionM.actions) === null || _this$api2$selectionM2 === void 0 ? void 0 : _this$api2$selectionM2.hideDecoration();
123
114
  });
124
115
  _defineProperty(this, "handleBlur", () => {
125
116
  var _this$decorationClean;
@@ -174,8 +165,8 @@ export class ExpandNodeView {
174
165
  return;
175
166
  }
176
167
  if (expandNode && isEmptyNode(state.schema)(expandNode)) {
177
- var _this$api5, _this$api5$analytics;
178
- deleteExpand((_this$api5 = this.api) === null || _this$api5 === void 0 ? void 0 : (_this$api5$analytics = _this$api5.analytics) === null || _this$api5$analytics === void 0 ? void 0 : _this$api5$analytics.actions)(state, this.view.dispatch);
168
+ var _this$api3, _this$api3$analytics;
169
+ deleteExpand((_this$api3 = this.api) === null || _this$api3 === void 0 ? void 0 : (_this$api3$analytics = _this$api3.analytics) === null || _this$api3$analytics === void 0 ? void 0 : _this$api3$analytics.actions)(state, this.view.dispatch);
179
170
  }
180
171
  });
181
172
  _defineProperty(this, "toggleExpand", () => {
@@ -184,13 +175,13 @@ export class ExpandNodeView {
184
175
  return;
185
176
  }
186
177
  if (this.allowInteractiveExpand) {
187
- var _this$api6, _this$api6$analytics;
178
+ var _this$api4, _this$api4$analytics;
188
179
  const {
189
180
  state,
190
181
  dispatch
191
182
  } = this.view;
192
183
  toggleExpandExpanded({
193
- editorAnalyticsAPI: (_this$api6 = this.api) === null || _this$api6 === void 0 ? void 0 : (_this$api6$analytics = _this$api6.analytics) === null || _this$api6$analytics === void 0 ? void 0 : _this$api6$analytics.actions,
184
+ editorAnalyticsAPI: (_this$api4 = this.api) === null || _this$api4 === void 0 ? void 0 : (_this$api4$analytics = _this$api4.analytics) === null || _this$api4$analytics === void 0 ? void 0 : _this$api4$analytics.actions,
194
185
  pos,
195
186
  node: this.node
196
187
  })(state, dispatch);
@@ -320,14 +311,14 @@ export class ExpandNodeView {
320
311
  selectionEnd
321
312
  } = this.input;
322
313
  if (selectionStart === selectionEnd && selectionStart === 0) {
323
- var _this$api7, _this$api7$selection;
314
+ var _this$api5, _this$api5$selection;
324
315
  event.preventDefault();
325
316
  const {
326
317
  state,
327
318
  dispatch
328
319
  } = this.view;
329
320
  this.view.focus();
330
- const selectionSharedState = ((_this$api7 = this.api) === null || _this$api7 === void 0 ? void 0 : (_this$api7$selection = _this$api7.selection) === null || _this$api7$selection === void 0 ? void 0 : _this$api7$selection.sharedState.currentState()) || {};
321
+ const selectionSharedState = ((_this$api5 = this.api) === null || _this$api5 === void 0 ? void 0 : (_this$api5$selection = _this$api5.selection) === null || _this$api5$selection === void 0 ? void 0 : _this$api5$selection.sharedState.currentState()) || {};
331
322
  // selectionRelativeToNode is undefined when user clicked to select node, then hit left to get focus in title
332
323
  // This is a special case where we want to bypass node selection and jump straight to gap cursor
333
324
  if ((selectionSharedState === null || selectionSharedState === void 0 ? void 0 : selectionSharedState.selectionRelativeToNode) === undefined) {
@@ -429,11 +420,8 @@ export class ExpandNodeView {
429
420
  // If the user interacts in our title bar (either toggle or input)
430
421
  // Prevent ProseMirror from getting a focus event (causes weird selection issues).
431
422
  this.titleContainer.addEventListener('focus', this.handleFocus);
432
- if (!editorExperiment('live_pages_graceful_edit', 'control')) {
433
- this.input.addEventListener('click', this.handleInputClick);
434
- }
435
423
  this.icon.addEventListener('keydown', this.handleIconKeyDown);
436
- if ((_this$api8 = this.api) !== null && _this$api8 !== void 0 && _this$api8.editorDisabled) {
424
+ if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled) {
437
425
  this.cleanUpEditorDisabledOnChange = this.api.editorDisabled.sharedState.onChange(sharedState => {
438
426
  const editorDisabled = sharedState.nextSharedState.editorDisabled;
439
427
  if (this.input) {
@@ -522,9 +510,6 @@ export class ExpandNodeView {
522
510
  this.input.removeEventListener('blur', this.handleBlur);
523
511
  this.input.removeEventListener('focus', this.handleInputFocus);
524
512
  this.titleContainer.removeEventListener('focus', this.handleFocus);
525
- if (!editorExperiment('live_pages_graceful_edit', 'control')) {
526
- this.input.removeEventListener('click', this.handleInputClick);
527
- }
528
513
  this.icon.removeEventListener('keydown', this.handleIconKeyDown);
529
514
  (_this$decorationClean2 = this.decorationCleanup) === null || _this$decorationClean2 === void 0 ? void 0 : _this$decorationClean2.call(this);
530
515
  if (this.cleanUpEditorDisabledOnChange) {
@@ -52,6 +52,12 @@ export const ExpandButtonInner = props => {
52
52
  ...rest
53
53
  };
54
54
  }, [props]);
55
+ const {
56
+ intl,
57
+ expanded
58
+ } = props;
59
+ const label = expanded ? expandMessages.collapseNode : expandMessages.expandNode;
60
+ const labelIntl = intl ? intl.formatMessage(label) : label.defaultMessage;
55
61
  return jsx(Button, {
56
62
  appearance: "subtle"
57
63
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -63,6 +69,7 @@ export const ExpandButtonInner = props => {
63
69
  }),
64
70
  shouldFitContainer: true,
65
71
  theme: useTheme,
72
+ "aria-label": labelIntl,
66
73
  "aria-expanded": props.expanded,
67
74
  isDisabled: !props.allowInteractiveExpand
68
75
  });
@@ -71,7 +71,7 @@ export var updateExpandTitle = function updateExpandTitle(_ref) {
71
71
  var node = state.doc.nodeAt(pos);
72
72
  if (node && node.type === nodeType && dispatch) {
73
73
  var tr = state.tr;
74
- if (__livePage && fg('platform.editor.live-pages-expand-divergence')) {
74
+ if (__livePage) {
75
75
  tr.step(new SetAttrsStep(pos, _objectSpread(_objectSpread({}, node.attrs), {}, {
76
76
  title: title
77
77
  })));
@@ -95,7 +95,7 @@ export var toggleExpandExpanded = function toggleExpandExpanded(_ref2) {
95
95
  if (node && node.type === nodeType && dispatch) {
96
96
  var tr = state.tr;
97
97
  var isExpandedNext = !node.attrs.__expanded;
98
- if (__livePage && fg('platform.editor.live-pages-expand-divergence')) {
98
+ if (__livePage) {
99
99
  tr.step(new SetAttrsStep(pos, _objectSpread(_objectSpread({}, node.attrs), {}, {
100
100
  __expanded: isExpandedNext
101
101
  })));
@@ -108,7 +108,7 @@ export var toggleExpandExpanded = function toggleExpandExpanded(_ref2) {
108
108
  // If we're going to collapse the expand and our cursor is currently inside
109
109
  // Move to a right gap cursor, if the toolbar is interacted (or an API),
110
110
  // it will insert below rather than inside (which will be invisible).
111
- if (__livePage && fg('platform.editor.live-pages-expand-divergence') ? isExpandedNext === true : isExpandedNext === false && findExpand(state)) {
111
+ if (__livePage ? isExpandedNext === true : isExpandedNext === false && findExpand(state)) {
112
112
  tr.setSelection(new GapCursorSelection(tr.doc.resolve(pos + node.nodeSize), Side.RIGHT));
113
113
  }
114
114
 
@@ -120,7 +120,7 @@ export var toggleExpandExpanded = function toggleExpandExpanded(_ref2) {
120
120
  attributes: {
121
121
  platform: PLATFORMS.WEB,
122
122
  mode: MODE.EDITOR,
123
- expanded: __livePage && fg('platform.editor.live-pages-expand-divergence') ? !isExpandedNext : isExpandedNext
123
+ expanded: __livePage ? !isExpandedNext : isExpandedNext
124
124
  },
125
125
  eventType: EVENT_TYPE.TRACK
126
126
  };
@@ -11,7 +11,6 @@ import { closestElement, isEmptyNode } from '@atlaskit/editor-common/utils';
11
11
  import { redo, undo } from '@atlaskit/editor-prosemirror/history';
12
12
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
13
13
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
14
- import { fg } from '@atlaskit/platform-feature-flags';
15
14
  import { deleteExpandAtPos, setSelectionInsideExpand, toggleExpandExpanded, updateExpandTitle } from '../commands';
16
15
  import { ExpandIconButton } from '../ui/ExpandIconButton';
17
16
  function buildExpandClassName(type, expanded) {
@@ -20,7 +19,7 @@ function buildExpandClassName(type, expanded) {
20
19
  var toDOM = function toDOM(node, __livePage, intl, titleReadOnly, contentEditable) {
21
20
  return ['div', {
22
21
  // prettier-ignore
23
- 'class': buildExpandClassName(node.type.name, __livePage && fg('platform.editor.live-pages-expand-divergence') ? !node.attrs.__expanded : node.attrs.__expanded),
22
+ 'class': buildExpandClassName(node.type.name, __livePage ? !node.attrs.__expanded : node.attrs.__expanded),
24
23
  'data-node-type': node.type.name,
25
24
  'data-title': node.attrs.title
26
25
  }, ['div', {
@@ -264,7 +263,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
264
263
  }
265
264
  });
266
265
  _defineProperty(this, "isCollapsed", function () {
267
- if (_this.__livePage && fg('platform.editor.live-pages-expand-divergence')) {
266
+ if (_this.__livePage) {
268
267
  return _this.node.attrs.__expanded;
269
268
  }
270
269
  return !_this.node.attrs.__expanded;
@@ -394,7 +393,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
394
393
  return;
395
394
  });
396
395
  _defineProperty(this, "getContentEditable", function (node) {
397
- var contentEditable = _this.__livePage && fg('platform.editor.live-pages-expand-divergence') ? !node.attrs.__expanded : node.attrs.__expanded;
396
+ var contentEditable = _this.__livePage ? !node.attrs.__expanded : node.attrs.__expanded;
398
397
  if (_this.api && _this.api.editorDisabled) {
399
398
  var _this$api$editorDisab;
400
399
  return !((_this$api$editorDisab = _this.api.editorDisabled.sharedState.currentState()) !== null && _this$api$editorDisab !== void 0 && _this$api$editorDisab.editorDisabled) && contentEditable;
@@ -487,7 +486,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
487
486
  return /*#__PURE__*/React.createElement(ExpandIconButton, {
488
487
  intl: intl,
489
488
  allowInteractiveExpand: _this3.allowInteractiveExpand,
490
- expanded: _this3.__livePage && fg('platform.editor.live-pages-expand-divergence') ? !__expanded : __expanded
489
+ expanded: _this3.__livePage ? !__expanded : __expanded
491
490
  });
492
491
  }, this.icon, this.renderKey);
493
492
  }
@@ -5,7 +5,6 @@ import { isEmptyNode, isPositionNearTableRow } from '@atlaskit/editor-common/uti
5
5
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
6
6
  import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
7
7
  import { isInTable } from '@atlaskit/editor-tables/utils';
8
- import { fg } from '@atlaskit/platform-feature-flags';
9
8
  import { deleteExpand, focusIcon, focusTitle } from '../commands';
10
9
  var isExpandNode = function isExpandNode(node) {
11
10
  return (node === null || node === void 0 ? void 0 : node.type.name) === 'expand' || (node === null || node === void 0 ? void 0 : node.type.name) === 'nestedExpand';
@@ -86,9 +85,7 @@ export function expandKeymap(api, options) {
86
85
  var selection = state.selection,
87
86
  schema = state.schema;
88
87
  var nodeBefore = selection.$from.nodeBefore;
89
- if (selection instanceof GapCursorSelection && selection.side === Side.RIGHT && nodeBefore && (nodeBefore.type === schema.nodes.expand || nodeBefore.type === schema.nodes.nestedExpand) && (
90
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
91
- fg('platform.editor.live-pages-expand-divergence') && options.__livePage ? nodeBefore.attrs.__expanded : !nodeBefore.attrs.__expanded)) {
88
+ if (selection instanceof GapCursorSelection && selection.side === Side.RIGHT && nodeBefore && (nodeBefore.type === schema.nodes.expand || nodeBefore.type === schema.nodes.nestedExpand) && (options.__livePage ? nodeBefore.attrs.__expanded : !nodeBefore.attrs.__expanded)) {
92
89
  var _$from = selection.$from;
93
90
  return focusTitle(Math.max(_$from.pos - 1, 0))(state, dispatch, editorView);
94
91
  }
@@ -112,9 +109,7 @@ export function expandKeymap(api, options) {
112
109
  var expandBefore = findExpand(state, sel);
113
110
  if (sel && expandBefore) {
114
111
  // moving cursor from outside of an expand to the title when it is collapsed
115
- if (
116
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
117
- fg('platform.editor.live-pages-expand-divergence') && options.__livePage ? expandBefore.node.attrs.__expanded : !expandBefore.node.attrs.__expanded) {
112
+ if (options.__livePage ? expandBefore.node.attrs.__expanded : !expandBefore.node.attrs.__expanded) {
118
113
  return focusTitle(expandBefore.start)(state, dispatch, editorView);
119
114
  }
120
115
  // moving cursor from outside of an expand to the content when it is expanded
@@ -138,9 +133,7 @@ export function expandKeymap(api, options) {
138
133
  nestedExpand = _state$schema$nodes.nestedExpand;
139
134
  var selection = state.selection;
140
135
  var nodeAfter = selection.$from.nodeAfter;
141
- if (selection instanceof GapCursorSelection && selection.side === Side.LEFT && nodeAfter && (nodeAfter.type === expand || nodeAfter.type === nestedExpand) && (
142
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
143
- fg('platform.editor.live-pages-expand-divergence') && options.__livePage ? nodeAfter.attrs.__expanded : !nodeAfter.attrs.__expanded)) {
136
+ if (selection instanceof GapCursorSelection && selection.side === Side.LEFT && nodeAfter && (nodeAfter.type === expand || nodeAfter.type === nestedExpand) && (options.__livePage ? nodeAfter.attrs.__expanded : !nodeAfter.attrs.__expanded)) {
144
137
  var $from = selection.$from;
145
138
  return focusTitle($from.pos + 1)(state, dispatch, editorView);
146
139
  }
@@ -173,9 +166,7 @@ export function expandKeymap(api, options) {
173
166
  // @see ED-7977
174
167
  var sel = Selection.findFrom(state.doc.resolve(Math.max(selection.$from.pos - 1, 0)), -1);
175
168
  var expandBefore = findExpand(state, sel);
176
- if (expandBefore && (expandBefore.node.type === expand || expandBefore.node.type === nestedExpand) && (
177
- // eslint-disable-next-line @atlaskit/platform/no-preconditioning
178
- fg('platform.editor.live-pages-expand-divergence') && options.__livePage ? expandBefore.node.attrs.__expanded : !expandBefore.node.attrs.__expanded)) {
169
+ if (expandBefore && (expandBefore.node.type === expand || expandBefore.node.type === nestedExpand) && (options.__livePage ? expandBefore.node.attrs.__expanded : !expandBefore.node.attrs.__expanded)) {
179
170
  return focusTitle(expandBefore.start)(state, dispatch, editorView);
180
171
  }
181
172
  return false;
@@ -54,7 +54,8 @@ export var withTooltip = function withTooltip(WrapperComponent) {
54
54
  };
55
55
  export var CustomButton = function CustomButton(props) {
56
56
  var allowInteractiveExpand = props.allowInteractiveExpand,
57
- expanded = props.expanded;
57
+ expanded = props.expanded,
58
+ intl = props.intl;
58
59
  var useTheme = useCallback(
59
60
  // Ignored via go/ees005
60
61
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -72,6 +73,8 @@ export var CustomButton = function CustomButton(props) {
72
73
  })
73
74
  }, rest);
74
75
  }, [props]);
76
+ var label = expanded ? expandMessages.collapseNode : expandMessages.expandNode;
77
+ var labelIntl = intl ? intl.formatMessage(label) : label.defaultMessage;
75
78
  return jsx(Button, {
76
79
  appearance: "subtle"
77
80
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -83,6 +86,7 @@ export var CustomButton = function CustomButton(props) {
83
86
  }),
84
87
  shouldFitContainer: true,
85
88
  theme: useTheme,
89
+ "aria-label": labelIntl,
86
90
  "aria-expanded": expanded,
87
91
  isDisabled: !allowInteractiveExpand
88
92
  });
@@ -12,7 +12,6 @@ import { redo, undo } from '@atlaskit/editor-prosemirror/history';
12
12
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
13
13
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
16
15
  import { deleteExpand, setSelectionInsideExpand, toggleExpandExpanded, updateExpandTitle } from '../commands';
17
16
  import { ExpandButton } from '../ui/ExpandButton';
18
17
  import { buildExpandClassName, toDOM } from '../ui/NodeView';
@@ -20,7 +19,7 @@ export var ExpandNodeView = /*#__PURE__*/function () {
20
19
  function ExpandNodeView(_node, view, getPos, getIntl, isMobile, selectNearNode, api, nodeViewPortalProviderAPI) {
21
20
  var _this = this,
22
21
  _api$editorDisabled,
23
- _this$api8;
22
+ _this$api6;
24
23
  var allowInteractiveExpand = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : true;
25
24
  var __livePage = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false;
26
25
  var cleanUpEditorDisabledOnChange = arguments.length > 10 ? arguments[10] : undefined;
@@ -115,17 +114,9 @@ export var ExpandNodeView = /*#__PURE__*/function () {
115
114
  _defineProperty(this, "handleFocus", function (event) {
116
115
  event.stopImmediatePropagation();
117
116
  });
118
- _defineProperty(this, "handleInputClick", function () {
119
- if (!editorExperiment('live_pages_graceful_edit', 'control')) {
120
- var _this$api2, _this$api3;
121
- (_this$api2 = _this.api) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.core) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.actions) === null || _this$api2 === void 0 || _this$api2.execute((_this$api3 = _this.api) === null || _this$api3 === void 0 || (_this$api3 = _this$api3.editorViewMode) === null || _this$api3 === void 0 ? void 0 : _this$api3.commands.updateContentMode({
122
- type: 'intent-to-edit'
123
- }));
124
- }
125
- });
126
117
  _defineProperty(this, "handleInputFocus", function () {
127
- var _this$api4;
128
- _this.decorationCleanup = (_this$api4 = _this.api) === null || _this$api4 === void 0 || (_this$api4 = _this$api4.selectionMarker) === null || _this$api4 === void 0 || (_this$api4 = _this$api4.actions) === null || _this$api4 === void 0 ? void 0 : _this$api4.hideDecoration();
118
+ var _this$api2;
119
+ _this.decorationCleanup = (_this$api2 = _this.api) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.selectionMarker) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.actions) === null || _this$api2 === void 0 ? void 0 : _this$api2.hideDecoration();
129
120
  });
130
121
  _defineProperty(this, "handleBlur", function () {
131
122
  var _this$decorationClean;
@@ -177,8 +168,8 @@ export var ExpandNodeView = /*#__PURE__*/function () {
177
168
  return;
178
169
  }
179
170
  if (expandNode && isEmptyNode(state.schema)(expandNode)) {
180
- var _this$api5;
181
- deleteExpand((_this$api5 = _this.api) === null || _this$api5 === void 0 || (_this$api5 = _this$api5.analytics) === null || _this$api5 === void 0 ? void 0 : _this$api5.actions)(state, _this.view.dispatch);
171
+ var _this$api3;
172
+ deleteExpand((_this$api3 = _this.api) === null || _this$api3 === void 0 || (_this$api3 = _this$api3.analytics) === null || _this$api3 === void 0 ? void 0 : _this$api3.actions)(state, _this.view.dispatch);
182
173
  }
183
174
  });
184
175
  _defineProperty(this, "toggleExpand", function () {
@@ -187,12 +178,12 @@ export var ExpandNodeView = /*#__PURE__*/function () {
187
178
  return;
188
179
  }
189
180
  if (_this.allowInteractiveExpand) {
190
- var _this$api6;
181
+ var _this$api4;
191
182
  var _this$view3 = _this.view,
192
183
  state = _this$view3.state,
193
184
  dispatch = _this$view3.dispatch;
194
185
  toggleExpandExpanded({
195
- editorAnalyticsAPI: (_this$api6 = _this.api) === null || _this$api6 === void 0 || (_this$api6 = _this$api6.analytics) === null || _this$api6 === void 0 ? void 0 : _this$api6.actions,
186
+ editorAnalyticsAPI: (_this$api4 = _this.api) === null || _this$api4 === void 0 || (_this$api4 = _this$api4.analytics) === null || _this$api4 === void 0 ? void 0 : _this$api4.actions,
196
187
  pos: pos,
197
188
  node: _this.node
198
189
  })(state, dispatch);
@@ -314,13 +305,13 @@ export var ExpandNodeView = /*#__PURE__*/function () {
314
305
  selectionStart = _this$input5.selectionStart,
315
306
  selectionEnd = _this$input5.selectionEnd;
316
307
  if (selectionStart === selectionEnd && selectionStart === 0) {
317
- var _this$api7;
308
+ var _this$api5;
318
309
  event.preventDefault();
319
310
  var _this$view8 = _this.view,
320
311
  state = _this$view8.state,
321
312
  dispatch = _this$view8.dispatch;
322
313
  _this.view.focus();
323
- var selectionSharedState = ((_this$api7 = _this.api) === null || _this$api7 === void 0 || (_this$api7 = _this$api7.selection) === null || _this$api7 === void 0 ? void 0 : _this$api7.sharedState.currentState()) || {};
314
+ var selectionSharedState = ((_this$api5 = _this.api) === null || _this$api5 === void 0 || (_this$api5 = _this$api5.selection) === null || _this$api5 === void 0 ? void 0 : _this$api5.sharedState.currentState()) || {};
324
315
  // selectionRelativeToNode is undefined when user clicked to select node, then hit left to get focus in title
325
316
  // This is a special case where we want to bypass node selection and jump straight to gap cursor
326
317
  if ((selectionSharedState === null || selectionSharedState === void 0 ? void 0 : selectionSharedState.selectionRelativeToNode) === undefined) {
@@ -421,11 +412,8 @@ export var ExpandNodeView = /*#__PURE__*/function () {
421
412
  // If the user interacts in our title bar (either toggle or input)
422
413
  // Prevent ProseMirror from getting a focus event (causes weird selection issues).
423
414
  this.titleContainer.addEventListener('focus', this.handleFocus);
424
- if (!editorExperiment('live_pages_graceful_edit', 'control')) {
425
- this.input.addEventListener('click', this.handleInputClick);
426
- }
427
415
  this.icon.addEventListener('keydown', this.handleIconKeyDown);
428
- if ((_this$api8 = this.api) !== null && _this$api8 !== void 0 && _this$api8.editorDisabled) {
416
+ if ((_this$api6 = this.api) !== null && _this$api6 !== void 0 && _this$api6.editorDisabled) {
429
417
  this.cleanUpEditorDisabledOnChange = this.api.editorDisabled.sharedState.onChange(function (sharedState) {
430
418
  var editorDisabled = sharedState.nextSharedState.editorDisabled;
431
419
  if (_this.input) {
@@ -527,9 +515,6 @@ export var ExpandNodeView = /*#__PURE__*/function () {
527
515
  this.input.removeEventListener('blur', this.handleBlur);
528
516
  this.input.removeEventListener('focus', this.handleInputFocus);
529
517
  this.titleContainer.removeEventListener('focus', this.handleFocus);
530
- if (!editorExperiment('live_pages_graceful_edit', 'control')) {
531
- this.input.removeEventListener('click', this.handleInputClick);
532
- }
533
518
  this.icon.removeEventListener('keydown', this.handleIconKeyDown);
534
519
  (_this$decorationClean2 = this.decorationCleanup) === null || _this$decorationClean2 === void 0 || _this$decorationClean2.call(this);
535
520
  if (this.cleanUpEditorDisabledOnChange) {
@@ -54,6 +54,10 @@ export var ExpandButtonInner = function ExpandButtonInner(props) {
54
54
  })
55
55
  }, rest);
56
56
  }, [props]);
57
+ var intl = props.intl,
58
+ expanded = props.expanded;
59
+ var label = expanded ? expandMessages.collapseNode : expandMessages.expandNode;
60
+ var labelIntl = intl ? intl.formatMessage(label) : label.defaultMessage;
57
61
  return jsx(Button, {
58
62
  appearance: "subtle"
59
63
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
@@ -65,6 +69,7 @@ export var ExpandButtonInner = function ExpandButtonInner(props) {
65
69
  }),
66
70
  shouldFitContainer: true,
67
71
  theme: useTheme,
72
+ "aria-label": labelIntl,
68
73
  "aria-expanded": props.expanded,
69
74
  isDisabled: !props.allowInteractiveExpand
70
75
  });
@@ -31,7 +31,6 @@ export declare class ExpandNodeView implements NodeView {
31
31
  private handleClick;
32
32
  private handleInput;
33
33
  private handleFocus;
34
- private handleInputClick;
35
34
  private handleInputFocus;
36
35
  private handleBlur;
37
36
  private handleTitleKeydown;
@@ -31,7 +31,6 @@ export declare class ExpandNodeView implements NodeView {
31
31
  private handleClick;
32
32
  private handleInput;
33
33
  private handleFocus;
34
- private handleInputClick;
35
34
  private handleInputFocus;
36
35
  private handleBlur;
37
36
  private handleTitleKeydown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-expand",
3
- "version": "3.2.11",
3
+ "version": "3.2.13",
4
4
  "description": "Expand plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,21 +34,21 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@atlaskit/adf-schema": "^47.6.0",
37
- "@atlaskit/button": "^23.0.0",
38
- "@atlaskit/editor-common": "^105.0.0",
39
- "@atlaskit/editor-plugin-analytics": "^2.2.0",
37
+ "@atlaskit/button": "^23.2.0",
38
+ "@atlaskit/editor-common": "^105.10.0",
39
+ "@atlaskit/editor-plugin-analytics": "^2.3.0",
40
40
  "@atlaskit/editor-plugin-decorations": "^2.0.0",
41
41
  "@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
42
- "@atlaskit/editor-plugin-editor-viewmode": "^3.1.0",
42
+ "@atlaskit/editor-plugin-editor-viewmode": "^4.0.0",
43
43
  "@atlaskit/editor-plugin-selection": "^2.2.0",
44
- "@atlaskit/editor-plugin-selection-marker": "^2.3.0",
44
+ "@atlaskit/editor-plugin-selection-marker": "^2.4.0",
45
45
  "@atlaskit/editor-prosemirror": "7.0.0",
46
46
  "@atlaskit/editor-shared-styles": "^3.4.0",
47
47
  "@atlaskit/editor-tables": "^2.9.0",
48
- "@atlaskit/icon": "^26.0.0",
48
+ "@atlaskit/icon": "^26.3.0",
49
49
  "@atlaskit/platform-feature-flags": "^1.1.0",
50
- "@atlaskit/tmp-editor-statsig": "^4.19.0",
51
- "@atlaskit/tokens": "^4.8.0",
50
+ "@atlaskit/tmp-editor-statsig": "^5.0.0",
51
+ "@atlaskit/tokens": "^4.9.0",
52
52
  "@atlaskit/tooltip": "^20.0.0",
53
53
  "@babel/runtime": "^7.0.0",
54
54
  "@emotion/react": "^11.7.1",
@@ -65,8 +65,8 @@
65
65
  "@atlaskit/editor-plugin-content-insertion": "^2.1.0",
66
66
  "@atlaskit/editor-plugin-guideline": "^2.0.0",
67
67
  "@atlaskit/editor-plugin-quick-insert": "^2.5.0",
68
- "@atlaskit/editor-plugin-table": "^10.9.0",
69
- "@atlaskit/editor-plugin-type-ahead": "^2.6.0",
68
+ "@atlaskit/editor-plugin-table": "^10.11.0",
69
+ "@atlaskit/editor-plugin-type-ahead": "^2.7.0",
70
70
  "@atlaskit/editor-plugin-width": "^3.0.0",
71
71
  "@testing-library/react": "^13.4.0",
72
72
  "react-test-renderer": "^18.2.0",
@@ -106,9 +106,6 @@
106
106
  }
107
107
  },
108
108
  "platform-feature-flags": {
109
- "platform.editor.live-pages-expand-divergence": {
110
- "type": "boolean"
111
- },
112
109
  "platform-editor-single-player-expand": {
113
110
  "type": "boolean"
114
111
  },