@atlaskit/editor-plugin-card 37.0.0 → 38.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 38.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b2444e74978c4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b2444e74978c4) -
8
+ Make the shipped editor memory-leak reductions permanent and remove the experiment checks.
9
+ - Updated dependencies
10
+
11
+ ## 37.0.1
12
+
13
+ ### Patch Changes
14
+
15
+ - [`84f221954c9fb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/84f221954c9fb) -
16
+ Remove the `control` branches of experiment `platform_editor_controls`; the editor controls
17
+ (`variant1`) experience is now permanent.
18
+ - Updated dependencies
19
+
3
20
  ## 37.0.0
4
21
 
5
22
  ### Patch Changes
@@ -79,9 +79,7 @@ var BlockCardComponent = exports.BlockCardComponent = /*#__PURE__*/function (_Re
79
79
  })(view.state.tr));
80
80
  }
81
81
  });
82
- if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_memory_leaks')) {
83
- _this.pendingRegisterCard = scheduleRegisterCard;
84
- }
82
+ _this.pendingRegisterCard = scheduleRegisterCard;
85
83
  scheduleRegisterCard();
86
84
  });
87
85
  (0, _defineProperty2.default)(_this, "removeCardDispatched", false);
@@ -114,11 +112,9 @@ var BlockCardComponent = exports.BlockCardComponent = /*#__PURE__*/function (_Re
114
112
  return (0, _createClass2.default)(BlockCardComponent, [{
115
113
  key: "componentWillUnmount",
116
114
  value: function componentWillUnmount() {
117
- if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_memory_leaks')) {
118
- var _this$pendingRegister;
119
- (_this$pendingRegister = this.pendingRegisterCard) === null || _this$pendingRegister === void 0 || _this$pendingRegister.cancel();
120
- this.pendingRegisterCard = undefined;
121
- }
115
+ var _this$pendingRegister;
116
+ (_this$pendingRegister = this.pendingRegisterCard) === null || _this$pendingRegister === void 0 || _this$pendingRegister.cancel();
117
+ this.pendingRegisterCard = undefined;
122
118
  this.removeCard();
123
119
  }
124
120
  }, {
@@ -14,7 +14,6 @@ var _utils = require("@atlaskit/editor-common/Popup/utils");
14
14
  var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
15
15
  var _lazy = require("@atlaskit/smart-card/card/lazy");
16
16
  var _ssr = require("@atlaskit/smart-card/ssr");
17
- var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
18
17
  var _actions = require("../pm-plugins/actions");
19
18
  var _toolbar = require("../ui/toolbar");
20
19
  var _isIntersectionObserverSupported = require("./isIntersectionObserverSupported");
@@ -46,11 +45,9 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
46
45
  var pendingRegisterCard = (0, _react.useRef)(null);
47
46
  (0, _react.useEffect)(function () {
48
47
  return function () {
49
- if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_memory_leaks')) {
50
- var _pendingRegisterCard$;
51
- (_pendingRegisterCard$ = pendingRegisterCard.current) === null || _pendingRegisterCard$ === void 0 || _pendingRegisterCard$.cancel();
52
- pendingRegisterCard.current = null;
53
- }
48
+ var _pendingRegisterCard$;
49
+ (_pendingRegisterCard$ = pendingRegisterCard.current) === null || _pendingRegisterCard$ === void 0 || _pendingRegisterCard$.cancel();
50
+ pendingRegisterCard.current = null;
54
51
  };
55
52
  }, []);
56
53
  var cardActions = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions;
@@ -121,9 +118,7 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
121
118
  view.dispatch(tr);
122
119
  }
123
120
  });
124
- if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_memory_leaks')) {
125
- pendingRegisterCard.current = scheduleRegisterCard;
126
- }
121
+ pendingRegisterCard.current = scheduleRegisterCard;
127
122
  scheduleRegisterCard();
128
123
  }, [getPos, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_forced_layout_2') ? undefined : view, onRes, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_forced_layout_2') ? registerResolvedCard : undefined]);
129
124
  var onError = (0, _react.useCallback)(function (data) {
@@ -148,14 +143,13 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
148
143
  propsOnClick === null || propsOnClick === void 0 || propsOnClick(event);
149
144
  }
150
145
  }, [propsOnClick, url, view, pluginInjectionApi]);
151
- var onClick = (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') ? handleOnClick : propsOnClick;
152
146
  var card = (0, _react.useMemo)(function () {
153
147
  if ((isPageSSRed || cardState) && url) {
154
148
  return /*#__PURE__*/_react.default.createElement(_ssr.CardSSR, {
155
149
  key: url,
156
150
  url: url,
157
151
  appearance: "inline",
158
- onClick: onClick,
152
+ onClick: handleOnClick,
159
153
  container: scrollContainer,
160
154
  onResolve: onResolve,
161
155
  onError: onError,
@@ -172,7 +166,7 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
172
166
  key: url,
173
167
  url: url !== null && url !== void 0 ? url : data.url,
174
168
  appearance: "inline",
175
- onClick: onClick,
169
+ onClick: handleOnClick,
176
170
  container: scrollContainer,
177
171
  onResolve: onResolve,
178
172
  onError: onError,
@@ -183,7 +177,7 @@ var InlineCard = exports.InlineCard = /*#__PURE__*/(0, _react.memo)(function (_r
183
177
  hoverPreviewOptions: hoverPreviewOptions,
184
178
  disablePreviewPanel: disablePreviewPanel
185
179
  });
186
- }, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, disablePreviewPanel, cardState]);
180
+ }, [url, data, handleOnClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, disablePreviewPanel, cardState]);
187
181
 
188
182
  // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
189
183
  // otherwise if we got data, we can render the card directly since it doesn't need the Provider
@@ -66,9 +66,7 @@ var InlineCardWithAwareness = exports.InlineCardWithAwareness = /*#__PURE__*/(0,
66
66
  var setIsInsertedRef = (0, _react.useRef)(setIsInserted);
67
67
  (0, _react.useEffect)(function () {
68
68
  return function () {
69
- if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_memory_leaks')) {
70
- setIsInsertedRef.current = undefined;
71
- }
69
+ setIsInsertedRef.current = undefined;
72
70
  };
73
71
  }, []);
74
72
  var _useState5 = (0, _react.useState)(false),
@@ -82,9 +80,7 @@ var InlineCardWithAwareness = exports.InlineCardWithAwareness = /*#__PURE__*/(0,
82
80
  var onResolve = (0, _react.useCallback)(function (tr, title) {
83
81
  if (tr) {
84
82
  var metadata = tr.getMeta(_pluginKey.pluginKey);
85
- var removeOverlay = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_memory_leaks') ? createRemoveOverlay(setIsInsertedRef) : function () {
86
- return setIsInserted(false);
87
- };
83
+ var removeOverlay = createRemoveOverlay(setIsInsertedRef);
88
84
  if (metadata && metadata.type === 'REGISTER') {
89
85
  (0, _actions.registerRemoveOverlay)(removeOverlay, metadata.info)(tr);
90
86
  } else {
@@ -22,7 +22,6 @@ var _hyperlink = require("@atlaskit/editor-common/utils/hyperlink");
22
22
  var _state = require("@atlaskit/editor-prosemirror/state");
23
23
  var _fg = require("@atlaskit/platform-feature-flags/fg");
24
24
  var _closeHistory = require("@atlaskit/prosemirror-history/closeHistory");
25
- var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
26
25
  var _actions = require("./actions");
27
26
  var _pluginKey = require("./plugin-key");
28
27
  var _shouldReplaceLink = require("./shouldReplaceLink");
@@ -359,25 +358,14 @@ var convertHyperlinkToSmartCard = exports.convertHyperlinkToSmartCard = function
359
358
  shouldReplaceLink: true
360
359
  };
361
360
  };
362
- if ((0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1')) {
363
- var activeLinkMark = (0, _utils.getActiveLinkMark)(state);
364
- if (activeLinkMark) {
365
- var linkMark = activeLinkMark.node.marks.find(function (mark) {
366
- return mark.type === link;
367
- });
368
- if (linkMark) {
369
- requests.push(createRequest(linkMark, activeLinkMark.pos));
370
- }
371
- }
372
- } else {
373
- state.tr.doc.nodesBetween(state.selection.from, state.selection.to, function (node, pos) {
374
- var linkMark = node.marks.find(function (mark) {
375
- return mark.type === link;
376
- });
377
- if (linkMark) {
378
- requests.push(createRequest(linkMark, pos));
379
- }
361
+ var activeLinkMark = (0, _utils.getActiveLinkMark)(state);
362
+ if (activeLinkMark) {
363
+ var linkMark = activeLinkMark.node.marks.find(function (mark) {
364
+ return mark.type === link;
380
365
  });
366
+ if (linkMark) {
367
+ requests.push(createRequest(linkMark, activeLinkMark.pos));
368
+ }
381
369
  }
382
370
  (0, _card.addLinkMetadata)(state.selection, state.tr, {
383
371
  action: _enums.ACTION.CHANGED_TYPE
@@ -254,11 +254,9 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
254
254
  */
255
255
  var invoke = (0, _rafSchd.default)(function () {
256
256
  var _pluginInjectionApi$a, _pluginInjectionApi$a2, _pluginInjectionApi$a3, _currentState$embedCa;
257
- if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_memory_leaks')) {
258
- var index = rafCancellationCallbacks.indexOf(invoke.cancel);
259
- if (index !== -1) {
260
- rafCancellationCallbacks.splice(index, 1);
261
- }
257
+ var index = rafCancellationCallbacks.indexOf(invoke.cancel);
258
+ if (index !== -1) {
259
+ rafCancellationCallbacks.splice(index, 1);
262
260
  }
263
261
  (0, _resolve.resolveWithProvider)(view, _provider, request, options, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions, (_pluginInjectionApi$a2 = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 || (_pluginInjectionApi$a3 = _pluginInjectionApi$a3.sharedState.currentState()) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.createAnalyticsEvent) !== null && _pluginInjectionApi$a2 !== void 0 ? _pluginInjectionApi$a2 : undefined, currentState === null || currentState === void 0 || (_currentState$embedCa = currentState.embedCardTransformers) === null || _currentState$embedCa === void 0 ? void 0 : _currentState$embedCa.embedCardNodeTransformer);
264
262
  });
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports.default = void 0;
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
- var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
12
11
  var _pastedInlineLink = require("./util/pasted-inline-link");
13
12
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
13
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
@@ -41,7 +40,7 @@ var removeCard = function removeCard(state, action) {
41
40
  var cards = state.cards.filter(function (card) {
42
41
  return card.id !== action.info.id;
43
42
  });
44
- if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_memory_leaks') && state.removeOverlayCardId !== undefined && state.removeOverlayCardId === action.info.id) {
43
+ if (state.removeOverlayCardId !== undefined && state.removeOverlayCardId === action.info.id) {
45
44
  return _objectSpread(_objectSpread({}, state), {}, {
46
45
  cards: cards,
47
46
  removeOverlay: undefined,
@@ -101,15 +100,10 @@ var hideDatasourceModal = function hideDatasourceModal(state) {
101
100
  });
102
101
  };
103
102
  var clearOverlayCandidate = function clearOverlayCandidate(state) {
104
- if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_memory_leaks')) {
105
- return _objectSpread(_objectSpread({}, state), {}, {
106
- overlayCandidatePosition: undefined,
107
- removeOverlay: undefined,
108
- removeOverlayCardId: undefined
109
- });
110
- }
111
103
  return _objectSpread(_objectSpread({}, state), {}, {
112
- overlayCandidatePosition: undefined
104
+ overlayCandidatePosition: undefined,
105
+ removeOverlay: undefined,
106
+ removeOverlayCardId: undefined
113
107
  });
114
108
  };
115
109
  var registerRemoveOverlayOnInsertedLink = function registerRemoveOverlayOnInsertedLink(state, action) {
@@ -119,10 +113,9 @@ var registerRemoveOverlayOnInsertedLink = function registerRemoveOverlayOnInsert
119
113
  var _action$info;
120
114
  return card.pos !== ((_action$info = action.info) === null || _action$info === void 0 ? void 0 : _action$info.pos);
121
115
  }).concat(action.info) : state.cards,
122
- removeOverlay: action.callback
123
- }, (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_reduce_memory_leaks') ? {
116
+ removeOverlay: action.callback,
124
117
  removeOverlayCardId: (_action$info2 = action.info) === null || _action$info2 === void 0 ? void 0 : _action$info2.id
125
- } : {});
118
+ });
126
119
  };
127
120
  var setDatasourceStash = function setDatasourceStash(state, action) {
128
121
  return _objectSpread(_objectSpread({}, state), {}, {
@@ -11,7 +11,6 @@ var _react = require("react");
11
11
  var _react2 = require("@emotion/react");
12
12
  var _reactIntl = require("react-intl");
13
13
  var _Button = _interopRequireDefault(require("@atlaskit/editor-common/FloatingToolbar/Button"));
14
- var _Separator = _interopRequireDefault(require("@atlaskit/editor-common/FloatingToolbar/Separator"));
15
14
  var _card = require("@atlaskit/editor-common/messages/card");
16
15
  var _linkToolbar = require("@atlaskit/editor-common/messages/link-toolbar");
17
16
  var _types = require("@atlaskit/editor-common/ui-menu/ArrowKeyNavigationProvider/types");
@@ -20,7 +19,6 @@ var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/chevron-d
20
19
  var _useSmartLinkContext = require("@atlaskit/link-provider/use-smart-link-context");
21
20
  var _buttonItem = _interopRequireDefault(require("@atlaskit/menu/button-item"));
22
21
  var _flex = require("@atlaskit/primitives/compiled/flex");
23
- var _editorExperiment = require("@atlaskit/tmp-editor-statsig/editor-experiment");
24
22
  var _utils = require("../../pm-plugins/utils");
25
23
  var _editDatasourceAction = require("../editDatasourceAction");
26
24
  var _useFetchDatasourceDataInfo = require("../useFetchDatasourceDataInfo");
@@ -109,9 +107,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
109
107
  }, (0, _react2.jsx)(_reactIntl.FormattedMessage
110
108
  // Ignored via go/ees005
111
109
  // eslint-disable-next-line react/jsx-props-no-spreading
112
- , _linkToolbar.linkToolbarMessages.editLink)), !(0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') && (0, _react2.jsx)(_Separator.default, {
113
- areAnyNewToolbarFlagsEnabled: false
114
- }));
110
+ , _linkToolbar.linkToolbarMessages.editLink)));
115
111
  }
116
112
  case 'edit-datasource':
117
113
  {
@@ -125,9 +121,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
125
121
  }, (0, _react2.jsx)(_reactIntl.FormattedMessage
126
122
  // Ignored via go/ees005
127
123
  // eslint-disable-next-line react/jsx-props-no-spreading
128
- , _linkToolbar.linkToolbarMessages.editDatasourceStandalone)), !(0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') && (0, _react2.jsx)(_Separator.default, {
129
- areAnyNewToolbarFlagsEnabled: false
130
- }));
124
+ , _linkToolbar.linkToolbarMessages.editDatasourceStandalone)));
131
125
  }
132
126
  case 'edit-dropdown':
133
127
  {
@@ -149,9 +143,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
149
143
  }, (0, _react2.jsx)(_reactIntl.FormattedMessage
150
144
  // Ignored via go/ees005
151
145
  // eslint-disable-next-line react/jsx-props-no-spreading
152
- , _card.messages.editDropdownTriggerTitle)), !(0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') && (0, _react2.jsx)(_Separator.default, {
153
- areAnyNewToolbarFlagsEnabled: false
154
- }));
146
+ , _card.messages.editDropdownTriggerTitle)));
155
147
  return (0, _react2.jsx)(_flex.Flex, {
156
148
  ref: containerRef
157
149
  }, (0, _react2.jsx)(_DropdownContainer.DropdownContainer, {
@@ -343,7 +343,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
343
343
  testId: 'inline-card-toolbar-comment-button',
344
344
  iconFallback: _comment.default,
345
345
  title: intl.formatMessage(_annotation.annotationMessages.createComment),
346
- showTitle: (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'control') ? undefined : true,
346
+ showTitle: true,
347
347
  onClick: onCommentButtonClick,
348
348
  disabled: (0, _isOfflineMode.isOfflineMode)(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c2 = pluginInjectionApi.connectivity) === null || _pluginInjectionApi$c2 === void 0 || (_pluginInjectionApi$c2 = _pluginInjectionApi$c2.sharedState) === null || _pluginInjectionApi$c2 === void 0 || (_pluginInjectionApi$c2 = _pluginInjectionApi$c2.currentState()) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.mode)
349
349
  }, {
@@ -740,7 +740,7 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
740
740
  // see hideOnEsc in platform/packages/editor/editor-plugin-floating-toolbar/src/ui/Dropdown.tsx
741
741
  var testId = 'datasource-overflow-dropdown-trigger';
742
742
 
743
- // When canShowAppearanceSwitch is true, and platform_editor_controls is on, the link appearance dropdown shows, which includes a link preference button
743
+ // When canShowAppearanceSwitch is true, the link appearance dropdown shows, which includes a link preference button
744
744
  // So only add the link appearance button when canShowAppearanceSwitch is false
745
745
  if (!canShowAppearanceSwitch()) {
746
746
  var linkPreferenceButton = getSettingsButton(intl, editorAnalyticsApi, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.userPreferencesLink);
@@ -821,9 +821,9 @@ var getStartingToolbarItems = exports.getStartingToolbarItems = function getStar
821
821
  type: 'button',
822
822
  onClick: onEditLink,
823
823
  title: intl.formatMessage(_linkToolbar.linkToolbarMessages.editLink),
824
- showTitle: (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') ? false : true,
824
+ showTitle: false,
825
825
  metadata: metadata,
826
- icon: (0, _editorExperiment.editorExperiment)('platform_editor_controls', 'variant1') ? _edit.default : undefined
826
+ icon: _edit.default
827
827
  }, {
828
828
  type: 'separator'
829
829
  }];
@@ -67,9 +67,7 @@ export class BlockCardComponent extends React.PureComponent {
67
67
  })(view.state.tr));
68
68
  }
69
69
  });
70
- if (isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
71
- this.pendingRegisterCard = scheduleRegisterCard;
72
- }
70
+ this.pendingRegisterCard = scheduleRegisterCard;
73
71
  scheduleRegisterCard();
74
72
  });
75
73
  _defineProperty(this, "removeCardDispatched", false);
@@ -99,11 +97,9 @@ export class BlockCardComponent extends React.PureComponent {
99
97
  findOverflowScrollParent(props.view.dom) || undefined;
100
98
  }
101
99
  componentWillUnmount() {
102
- if (isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
103
- var _this$pendingRegister;
104
- (_this$pendingRegister = this.pendingRegisterCard) === null || _this$pendingRegister === void 0 ? void 0 : _this$pendingRegister.cancel();
105
- this.pendingRegisterCard = undefined;
106
- }
100
+ var _this$pendingRegister;
101
+ (_this$pendingRegister = this.pendingRegisterCard) === null || _this$pendingRegister === void 0 ? void 0 : _this$pendingRegister.cancel();
102
+ this.pendingRegisterCard = undefined;
107
103
  this.removeCard();
108
104
  }
109
105
  removeCard() {
@@ -7,7 +7,6 @@ import { findOverflowScrollParent } from '@atlaskit/editor-common/Popup/utils';
7
7
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
8
8
  import { Card as SmartCard } from '@atlaskit/smart-card/card/lazy';
9
9
  import { CardSSR } from '@atlaskit/smart-card/ssr';
10
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
11
10
  import { registerCard, removeCard } from '../pm-plugins/actions';
12
11
  import { visitCardLinkAnalytics } from '../ui/toolbar';
13
12
  import { isIntersectionObserverSupported } from './isIntersectionObserverSupported';
@@ -38,11 +37,9 @@ export const InlineCard = /*#__PURE__*/memo(({
38
37
  const pendingRegisterCard = useRef(null);
39
38
  useEffect(() => {
40
39
  return () => {
41
- if (isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
42
- var _pendingRegisterCard$;
43
- (_pendingRegisterCard$ = pendingRegisterCard.current) === null || _pendingRegisterCard$ === void 0 ? void 0 : _pendingRegisterCard$.cancel();
44
- pendingRegisterCard.current = null;
45
- }
40
+ var _pendingRegisterCard$;
41
+ (_pendingRegisterCard$ = pendingRegisterCard.current) === null || _pendingRegisterCard$ === void 0 ? void 0 : _pendingRegisterCard$.cancel();
42
+ pendingRegisterCard.current = null;
46
43
  };
47
44
  }, []);
48
45
  const cardActions = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions;
@@ -116,9 +113,7 @@ export const InlineCard = /*#__PURE__*/memo(({
116
113
  view.dispatch(tr);
117
114
  }
118
115
  });
119
- if (isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
120
- pendingRegisterCard.current = scheduleRegisterCard;
121
- }
116
+ pendingRegisterCard.current = scheduleRegisterCard;
122
117
  scheduleRegisterCard();
123
118
  }, [getPos, isExperimentEnabled('platform_editor_reduce_forced_layout_2') ? undefined : view, onRes, isExperimentEnabled('platform_editor_reduce_forced_layout_2') ? registerResolvedCard : undefined]);
124
119
  const onError = useCallback(data => {
@@ -146,14 +141,13 @@ export const InlineCard = /*#__PURE__*/memo(({
146
141
  propsOnClick === null || propsOnClick === void 0 ? void 0 : propsOnClick(event);
147
142
  }
148
143
  }, [propsOnClick, url, view, pluginInjectionApi]);
149
- const onClick = editorExperiment('platform_editor_controls', 'variant1') ? handleOnClick : propsOnClick;
150
144
  const card = useMemo(() => {
151
145
  if ((isPageSSRed || cardState) && url) {
152
146
  return /*#__PURE__*/React.createElement(CardSSR, {
153
147
  key: url,
154
148
  url: url,
155
149
  appearance: "inline",
156
- onClick: onClick,
150
+ onClick: handleOnClick,
157
151
  container: scrollContainer,
158
152
  onResolve: onResolve,
159
153
  onError: onError,
@@ -170,7 +164,7 @@ export const InlineCard = /*#__PURE__*/memo(({
170
164
  key: url,
171
165
  url: url !== null && url !== void 0 ? url : data.url,
172
166
  appearance: "inline",
173
- onClick: onClick,
167
+ onClick: handleOnClick,
174
168
  container: scrollContainer,
175
169
  onResolve: onResolve,
176
170
  onError: onError,
@@ -181,7 +175,7 @@ export const InlineCard = /*#__PURE__*/memo(({
181
175
  hoverPreviewOptions: hoverPreviewOptions,
182
176
  disablePreviewPanel: disablePreviewPanel
183
177
  });
184
- }, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, disablePreviewPanel, cardState]);
178
+ }, [url, data, handleOnClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, disablePreviewPanel, cardState]);
185
179
 
186
180
  // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
187
181
  // otherwise if we got data, we can render the card directly since it doesn't need the Provider
@@ -49,9 +49,7 @@ export const InlineCardWithAwareness = /*#__PURE__*/memo(({
49
49
  const setIsInsertedRef = useRef(setIsInserted);
50
50
  useEffect(() => {
51
51
  return () => {
52
- if (isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
53
- setIsInsertedRef.current = undefined;
54
- }
52
+ setIsInsertedRef.current = undefined;
55
53
  };
56
54
  }, []);
57
55
  const [isResolvedViewRendered, setIsResolvedViewRendered] = useState(false);
@@ -62,7 +60,7 @@ export const InlineCardWithAwareness = /*#__PURE__*/memo(({
62
60
  const onResolve = useCallback((tr, title) => {
63
61
  if (tr) {
64
62
  const metadata = tr.getMeta(pluginKey);
65
- const removeOverlay = isExperimentEnabled('platform_editor_reduce_memory_leaks') ? createRemoveOverlay(setIsInsertedRef) : () => setIsInserted(false);
63
+ const removeOverlay = createRemoveOverlay(setIsInsertedRef);
66
64
  if (metadata && metadata.type === 'REGISTER') {
67
65
  registerRemoveOverlay(removeOverlay, metadata.info)(tr);
68
66
  } else {
@@ -12,7 +12,6 @@ import { getLinkCreationAnalyticsEvent, isFromCurrentDomain } from '@atlaskit/ed
12
12
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
13
13
  import { fg } from '@atlaskit/platform-feature-flags/fg';
14
14
  import { closeHistory } from '@atlaskit/prosemirror-history/closeHistory';
15
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
16
15
  import { hideDatasourceModal, queueCards, removeDatasourceStash, resolveCard, setDatasourceStash } from './actions';
17
16
  import { pluginKey } from './plugin-key';
18
17
  import { shouldReplaceLink } from './shouldReplaceLink';
@@ -332,21 +331,12 @@ export const convertHyperlinkToSmartCard = (state, source, appearance, normalize
332
331
  analyticsAction: ACTION.CHANGED_TYPE,
333
332
  shouldReplaceLink: true
334
333
  });
335
- if (editorExperiment('platform_editor_controls', 'variant1')) {
336
- const activeLinkMark = getActiveLinkMark(state);
337
- if (activeLinkMark) {
338
- const linkMark = activeLinkMark.node.marks.find(mark => mark.type === link);
339
- if (linkMark) {
340
- requests.push(createRequest(linkMark, activeLinkMark.pos));
341
- }
334
+ const activeLinkMark = getActiveLinkMark(state);
335
+ if (activeLinkMark) {
336
+ const linkMark = activeLinkMark.node.marks.find(mark => mark.type === link);
337
+ if (linkMark) {
338
+ requests.push(createRequest(linkMark, activeLinkMark.pos));
342
339
  }
343
- } else {
344
- state.tr.doc.nodesBetween(state.selection.from, state.selection.to, (node, pos) => {
345
- const linkMark = node.marks.find(mark => mark.type === link);
346
- if (linkMark) {
347
- requests.push(createRequest(linkMark, pos));
348
- }
349
- });
350
340
  }
351
341
  addLinkMetadata(state.selection, state.tr, {
352
342
  action: ACTION.CHANGED_TYPE
@@ -251,11 +251,9 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
251
251
  */
252
252
  const invoke = rafSchedule(() => {
253
253
  var _pluginInjectionApi$a, _pluginInjectionApi$a2, _pluginInjectionApi$a3, _pluginInjectionApi$a4, _currentState$embedCa;
254
- if (isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
255
- const index = rafCancellationCallbacks.indexOf(invoke.cancel);
256
- if (index !== -1) {
257
- rafCancellationCallbacks.splice(index, 1);
258
- }
254
+ const index = rafCancellationCallbacks.indexOf(invoke.cancel);
255
+ if (index !== -1) {
256
+ rafCancellationCallbacks.splice(index, 1);
259
257
  }
260
258
  resolveWithProvider(view, provider, request, options, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions, (_pluginInjectionApi$a2 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : (_pluginInjectionApi$a4 = _pluginInjectionApi$a3.sharedState.currentState()) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.createAnalyticsEvent) !== null && _pluginInjectionApi$a2 !== void 0 ? _pluginInjectionApi$a2 : undefined, currentState === null || currentState === void 0 ? void 0 : (_currentState$embedCa = currentState.embedCardTransformers) === null || _currentState$embedCa === void 0 ? void 0 : _currentState$embedCa.embedCardNodeTransformer);
261
259
  });
@@ -1,4 +1,3 @@
1
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
2
1
  import { removePastedInlineLink } from './util/pasted-inline-link';
3
2
  const queue = (state, action) => {
4
3
  return {
@@ -26,7 +25,7 @@ const register = (state, action) => {
26
25
  };
27
26
  const removeCard = (state, action) => {
28
27
  const cards = state.cards.filter(card => card.id !== action.info.id);
29
- if (isExperimentEnabled('platform_editor_reduce_memory_leaks') && state.removeOverlayCardId !== undefined && state.removeOverlayCardId === action.info.id) {
28
+ if (state.removeOverlayCardId !== undefined && state.removeOverlayCardId === action.info.id) {
30
29
  return {
31
30
  ...state,
32
31
  cards,
@@ -100,17 +99,11 @@ const hideDatasourceModal = state => {
100
99
  };
101
100
  };
102
101
  const clearOverlayCandidate = state => {
103
- if (isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
104
- return {
105
- ...state,
106
- overlayCandidatePosition: undefined,
107
- removeOverlay: undefined,
108
- removeOverlayCardId: undefined
109
- };
110
- }
111
102
  return {
112
103
  ...state,
113
- overlayCandidatePosition: undefined
104
+ overlayCandidatePosition: undefined,
105
+ removeOverlay: undefined,
106
+ removeOverlayCardId: undefined
114
107
  };
115
108
  };
116
109
  const registerRemoveOverlayOnInsertedLink = (state, action) => {
@@ -122,9 +115,7 @@ const registerRemoveOverlayOnInsertedLink = (state, action) => {
122
115
  return card.pos !== ((_action$info = action.info) === null || _action$info === void 0 ? void 0 : _action$info.pos);
123
116
  }).concat(action.info) : state.cards,
124
117
  removeOverlay: action.callback,
125
- ...(isExperimentEnabled('platform_editor_reduce_memory_leaks') ? {
126
- removeOverlayCardId: (_action$info2 = action.info) === null || _action$info2 === void 0 ? void 0 : _action$info2.id
127
- } : {})
118
+ removeOverlayCardId: (_action$info2 = action.info) === null || _action$info2 === void 0 ? void 0 : _action$info2.id
128
119
  };
129
120
  };
130
121
  const setDatasourceStash = (state, action) => {
@@ -8,7 +8,6 @@ import { useCallback, useMemo, useRef, useState } from 'react';
8
8
  import { css, jsx } from '@emotion/react';
9
9
  import { FormattedMessage } from 'react-intl';
10
10
  import Button from '@atlaskit/editor-common/FloatingToolbar/Button';
11
- import Separator from '@atlaskit/editor-common/FloatingToolbar/Separator';
12
11
  import { messages } from '@atlaskit/editor-common/messages/card';
13
12
  import { linkToolbarMessages } from '@atlaskit/editor-common/messages/link-toolbar';
14
13
  import { ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu/ArrowKeyNavigationProvider/types';
@@ -17,7 +16,6 @@ import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
17
16
  import { useSmartLinkContext } from '@atlaskit/link-provider/use-smart-link-context';
18
17
  import ButtonItem from '@atlaskit/menu/button-item';
19
18
  import { Flex } from '@atlaskit/primitives/compiled/flex';
20
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
21
19
  import { focusEditorView, isDatasourceConfigEditable } from '../../pm-plugins/utils';
22
20
  import { editDatasource } from '../editDatasourceAction';
23
21
  import { useFetchDatasourceDataInfo } from '../useFetchDatasourceDataInfo';
@@ -94,9 +92,7 @@ const EditToolbarButtonWithCardContext = props => {
94
92
  }, jsx(FormattedMessage
95
93
  // Ignored via go/ees005
96
94
  // eslint-disable-next-line react/jsx-props-no-spreading
97
- , linkToolbarMessages.editLink)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator, {
98
- areAnyNewToolbarFlagsEnabled: false
99
- }));
95
+ , linkToolbarMessages.editLink)));
100
96
  }
101
97
  case 'edit-datasource':
102
98
  {
@@ -110,9 +106,7 @@ const EditToolbarButtonWithCardContext = props => {
110
106
  }, jsx(FormattedMessage
111
107
  // Ignored via go/ees005
112
108
  // eslint-disable-next-line react/jsx-props-no-spreading
113
- , linkToolbarMessages.editDatasourceStandalone)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator, {
114
- areAnyNewToolbarFlagsEnabled: false
115
- }));
109
+ , linkToolbarMessages.editDatasourceStandalone)));
116
110
  }
117
111
  case 'edit-dropdown':
118
112
  {
@@ -134,9 +128,7 @@ const EditToolbarButtonWithCardContext = props => {
134
128
  }, jsx(FormattedMessage
135
129
  // Ignored via go/ees005
136
130
  // eslint-disable-next-line react/jsx-props-no-spreading
137
- , messages.editDropdownTriggerTitle)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator, {
138
- areAnyNewToolbarFlagsEnabled: false
139
- }));
131
+ , messages.editDropdownTriggerTitle)));
140
132
  return jsx(Flex, {
141
133
  ref: containerRef
142
134
  }, jsx(UiDropdown, {
@@ -332,7 +332,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
332
332
  testId: 'inline-card-toolbar-comment-button',
333
333
  iconFallback: CommentIcon,
334
334
  title: intl.formatMessage(annotationMessages.createComment),
335
- showTitle: editorExperiment('platform_editor_controls', 'control') ? undefined : true,
335
+ showTitle: true,
336
336
  onClick: onCommentButtonClick,
337
337
  disabled: isOfflineMode(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c2 = pluginInjectionApi.connectivity) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : (_pluginInjectionApi$c3 = _pluginInjectionApi$c2.sharedState) === null || _pluginInjectionApi$c3 === void 0 ? void 0 : (_pluginInjectionApi$c4 = _pluginInjectionApi$c3.currentState()) === null || _pluginInjectionApi$c4 === void 0 ? void 0 : _pluginInjectionApi$c4.mode)
338
338
  }, {
@@ -720,7 +720,7 @@ const getDatasourceButtonGroup = (metadata, intl, editorAnalyticsApi, node, hove
720
720
  // see hideOnEsc in platform/packages/editor/editor-plugin-floating-toolbar/src/ui/Dropdown.tsx
721
721
  const testId = 'datasource-overflow-dropdown-trigger';
722
722
 
723
- // When canShowAppearanceSwitch is true, and platform_editor_controls is on, the link appearance dropdown shows, which includes a link preference button
723
+ // When canShowAppearanceSwitch is true, the link appearance dropdown shows, which includes a link preference button
724
724
  // So only add the link appearance button when canShowAppearanceSwitch is false
725
725
  if (!canShowAppearanceSwitch()) {
726
726
  const linkPreferenceButton = getSettingsButton(intl, editorAnalyticsApi, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.userPreferencesLink);
@@ -801,9 +801,9 @@ export const getStartingToolbarItems = (options, api) => {
801
801
  type: 'button',
802
802
  onClick: onEditLink,
803
803
  title: intl.formatMessage(linkToolbarMessages.editLink),
804
- showTitle: editorExperiment('platform_editor_controls', 'variant1') ? false : true,
804
+ showTitle: false,
805
805
  metadata: metadata,
806
- icon: editorExperiment('platform_editor_controls', 'variant1') ? EditIcon : undefined
806
+ icon: EditIcon
807
807
  }, {
808
808
  type: 'separator'
809
809
  }];
@@ -74,9 +74,7 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
74
74
  })(view.state.tr));
75
75
  }
76
76
  });
77
- if (isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
78
- _this.pendingRegisterCard = scheduleRegisterCard;
79
- }
77
+ _this.pendingRegisterCard = scheduleRegisterCard;
80
78
  scheduleRegisterCard();
81
79
  });
82
80
  _defineProperty(_this, "removeCardDispatched", false);
@@ -109,11 +107,9 @@ export var BlockCardComponent = /*#__PURE__*/function (_React$PureComponent) {
109
107
  return _createClass(BlockCardComponent, [{
110
108
  key: "componentWillUnmount",
111
109
  value: function componentWillUnmount() {
112
- if (isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
113
- var _this$pendingRegister;
114
- (_this$pendingRegister = this.pendingRegisterCard) === null || _this$pendingRegister === void 0 || _this$pendingRegister.cancel();
115
- this.pendingRegisterCard = undefined;
116
- }
110
+ var _this$pendingRegister;
111
+ (_this$pendingRegister = this.pendingRegisterCard) === null || _this$pendingRegister === void 0 || _this$pendingRegister.cancel();
112
+ this.pendingRegisterCard = undefined;
117
113
  this.removeCard();
118
114
  }
119
115
  }, {
@@ -7,7 +7,6 @@ import { findOverflowScrollParent } from '@atlaskit/editor-common/Popup/utils';
7
7
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
8
8
  import { Card as SmartCard } from '@atlaskit/smart-card/card/lazy';
9
9
  import { CardSSR } from '@atlaskit/smart-card/ssr';
10
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
11
10
  import { registerCard, removeCard } from '../pm-plugins/actions';
12
11
  import { visitCardLinkAnalytics } from '../ui/toolbar';
13
12
  import { isIntersectionObserverSupported } from './isIntersectionObserverSupported';
@@ -36,11 +35,9 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
36
35
  var pendingRegisterCard = useRef(null);
37
36
  useEffect(function () {
38
37
  return function () {
39
- if (isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
40
- var _pendingRegisterCard$;
41
- (_pendingRegisterCard$ = pendingRegisterCard.current) === null || _pendingRegisterCard$ === void 0 || _pendingRegisterCard$.cancel();
42
- pendingRegisterCard.current = null;
43
- }
38
+ var _pendingRegisterCard$;
39
+ (_pendingRegisterCard$ = pendingRegisterCard.current) === null || _pendingRegisterCard$ === void 0 || _pendingRegisterCard$.cancel();
40
+ pendingRegisterCard.current = null;
44
41
  };
45
42
  }, []);
46
43
  var cardActions = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.card.actions;
@@ -111,9 +108,7 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
111
108
  view.dispatch(tr);
112
109
  }
113
110
  });
114
- if (isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
115
- pendingRegisterCard.current = scheduleRegisterCard;
116
- }
111
+ pendingRegisterCard.current = scheduleRegisterCard;
117
112
  scheduleRegisterCard();
118
113
  }, [getPos, isExperimentEnabled('platform_editor_reduce_forced_layout_2') ? undefined : view, onRes, isExperimentEnabled('platform_editor_reduce_forced_layout_2') ? registerResolvedCard : undefined]);
119
114
  var onError = useCallback(function (data) {
@@ -138,14 +133,13 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
138
133
  propsOnClick === null || propsOnClick === void 0 || propsOnClick(event);
139
134
  }
140
135
  }, [propsOnClick, url, view, pluginInjectionApi]);
141
- var onClick = editorExperiment('platform_editor_controls', 'variant1') ? handleOnClick : propsOnClick;
142
136
  var card = useMemo(function () {
143
137
  if ((isPageSSRed || cardState) && url) {
144
138
  return /*#__PURE__*/React.createElement(CardSSR, {
145
139
  key: url,
146
140
  url: url,
147
141
  appearance: "inline",
148
- onClick: onClick,
142
+ onClick: handleOnClick,
149
143
  container: scrollContainer,
150
144
  onResolve: onResolve,
151
145
  onError: onError,
@@ -162,7 +156,7 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
162
156
  key: url,
163
157
  url: url !== null && url !== void 0 ? url : data.url,
164
158
  appearance: "inline",
165
- onClick: onClick,
159
+ onClick: handleOnClick,
166
160
  container: scrollContainer,
167
161
  onResolve: onResolve,
168
162
  onError: onError,
@@ -173,7 +167,7 @@ export var InlineCard = /*#__PURE__*/memo(function (_ref) {
173
167
  hoverPreviewOptions: hoverPreviewOptions,
174
168
  disablePreviewPanel: disablePreviewPanel
175
169
  });
176
- }, [url, data, onClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, disablePreviewPanel, cardState]);
170
+ }, [url, data, handleOnClick, scrollContainer, onResolve, onError, useAlternativePreloader, actionOptions, isHovered, showHoverPreview, hoverPreviewOptions, isPageSSRed, disablePreviewPanel, cardState]);
177
171
 
178
172
  // [WS-2307]: we only render card wrapped into a Provider when the value is ready,
179
173
  // otherwise if we got data, we can render the card directly since it doesn't need the Provider
@@ -57,9 +57,7 @@ export var InlineCardWithAwareness = /*#__PURE__*/memo(function (_ref) {
57
57
  var setIsInsertedRef = useRef(setIsInserted);
58
58
  useEffect(function () {
59
59
  return function () {
60
- if (isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
61
- setIsInsertedRef.current = undefined;
62
- }
60
+ setIsInsertedRef.current = undefined;
63
61
  };
64
62
  }, []);
65
63
  var _useState5 = useState(false),
@@ -73,9 +71,7 @@ export var InlineCardWithAwareness = /*#__PURE__*/memo(function (_ref) {
73
71
  var onResolve = useCallback(function (tr, title) {
74
72
  if (tr) {
75
73
  var metadata = tr.getMeta(pluginKey);
76
- var removeOverlay = isExperimentEnabled('platform_editor_reduce_memory_leaks') ? createRemoveOverlay(setIsInsertedRef) : function () {
77
- return setIsInserted(false);
78
- };
74
+ var removeOverlay = createRemoveOverlay(setIsInsertedRef);
79
75
  if (metadata && metadata.type === 'REGISTER') {
80
76
  registerRemoveOverlay(removeOverlay, metadata.info)(tr);
81
77
  } else {
@@ -17,7 +17,6 @@ import { getLinkCreationAnalyticsEvent, isFromCurrentDomain } from '@atlaskit/ed
17
17
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
18
18
  import { fg } from '@atlaskit/platform-feature-flags/fg';
19
19
  import { closeHistory } from '@atlaskit/prosemirror-history/closeHistory';
20
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
21
20
  import { hideDatasourceModal, queueCards, removeDatasourceStash, resolveCard, setDatasourceStash } from './actions';
22
21
  import { pluginKey } from './plugin-key';
23
22
  import { shouldReplaceLink } from './shouldReplaceLink';
@@ -353,25 +352,14 @@ export var convertHyperlinkToSmartCard = function convertHyperlinkToSmartCard(st
353
352
  shouldReplaceLink: true
354
353
  };
355
354
  };
356
- if (editorExperiment('platform_editor_controls', 'variant1')) {
357
- var activeLinkMark = getActiveLinkMark(state);
358
- if (activeLinkMark) {
359
- var linkMark = activeLinkMark.node.marks.find(function (mark) {
360
- return mark.type === link;
361
- });
362
- if (linkMark) {
363
- requests.push(createRequest(linkMark, activeLinkMark.pos));
364
- }
365
- }
366
- } else {
367
- state.tr.doc.nodesBetween(state.selection.from, state.selection.to, function (node, pos) {
368
- var linkMark = node.marks.find(function (mark) {
369
- return mark.type === link;
370
- });
371
- if (linkMark) {
372
- requests.push(createRequest(linkMark, pos));
373
- }
355
+ var activeLinkMark = getActiveLinkMark(state);
356
+ if (activeLinkMark) {
357
+ var linkMark = activeLinkMark.node.marks.find(function (mark) {
358
+ return mark.type === link;
374
359
  });
360
+ if (linkMark) {
361
+ requests.push(createRequest(linkMark, activeLinkMark.pos));
362
+ }
375
363
  }
376
364
  addLinkMetadata(state.selection, state.tr, {
377
365
  action: ACTION.CHANGED_TYPE
@@ -247,11 +247,9 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
247
247
  */
248
248
  var invoke = rafSchedule(function () {
249
249
  var _pluginInjectionApi$a, _pluginInjectionApi$a2, _pluginInjectionApi$a3, _currentState$embedCa;
250
- if (isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
251
- var index = rafCancellationCallbacks.indexOf(invoke.cancel);
252
- if (index !== -1) {
253
- rafCancellationCallbacks.splice(index, 1);
254
- }
250
+ var index = rafCancellationCallbacks.indexOf(invoke.cancel);
251
+ if (index !== -1) {
252
+ rafCancellationCallbacks.splice(index, 1);
255
253
  }
256
254
  resolveWithProvider(view, _provider, request, options, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions, (_pluginInjectionApi$a2 = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 || (_pluginInjectionApi$a3 = _pluginInjectionApi$a3.sharedState.currentState()) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.createAnalyticsEvent) !== null && _pluginInjectionApi$a2 !== void 0 ? _pluginInjectionApi$a2 : undefined, currentState === null || currentState === void 0 || (_currentState$embedCa = currentState.embedCardTransformers) === null || _currentState$embedCa === void 0 ? void 0 : _currentState$embedCa.embedCardNodeTransformer);
257
255
  });
@@ -5,7 +5,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
5
5
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
6
  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; }
7
7
  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) { _defineProperty(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; }
8
- import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
9
8
  import { removePastedInlineLink } from './util/pasted-inline-link';
10
9
  var queue = function queue(state, action) {
11
10
  return _objectSpread(_objectSpread({}, state), {}, {
@@ -34,7 +33,7 @@ var removeCard = function removeCard(state, action) {
34
33
  var cards = state.cards.filter(function (card) {
35
34
  return card.id !== action.info.id;
36
35
  });
37
- if (isExperimentEnabled('platform_editor_reduce_memory_leaks') && state.removeOverlayCardId !== undefined && state.removeOverlayCardId === action.info.id) {
36
+ if (state.removeOverlayCardId !== undefined && state.removeOverlayCardId === action.info.id) {
38
37
  return _objectSpread(_objectSpread({}, state), {}, {
39
38
  cards: cards,
40
39
  removeOverlay: undefined,
@@ -94,15 +93,10 @@ var hideDatasourceModal = function hideDatasourceModal(state) {
94
93
  });
95
94
  };
96
95
  var clearOverlayCandidate = function clearOverlayCandidate(state) {
97
- if (isExperimentEnabled('platform_editor_reduce_memory_leaks')) {
98
- return _objectSpread(_objectSpread({}, state), {}, {
99
- overlayCandidatePosition: undefined,
100
- removeOverlay: undefined,
101
- removeOverlayCardId: undefined
102
- });
103
- }
104
96
  return _objectSpread(_objectSpread({}, state), {}, {
105
- overlayCandidatePosition: undefined
97
+ overlayCandidatePosition: undefined,
98
+ removeOverlay: undefined,
99
+ removeOverlayCardId: undefined
106
100
  });
107
101
  };
108
102
  var registerRemoveOverlayOnInsertedLink = function registerRemoveOverlayOnInsertedLink(state, action) {
@@ -112,10 +106,9 @@ var registerRemoveOverlayOnInsertedLink = function registerRemoveOverlayOnInsert
112
106
  var _action$info;
113
107
  return card.pos !== ((_action$info = action.info) === null || _action$info === void 0 ? void 0 : _action$info.pos);
114
108
  }).concat(action.info) : state.cards,
115
- removeOverlay: action.callback
116
- }, isExperimentEnabled('platform_editor_reduce_memory_leaks') ? {
109
+ removeOverlay: action.callback,
117
110
  removeOverlayCardId: (_action$info2 = action.info) === null || _action$info2 === void 0 ? void 0 : _action$info2.id
118
- } : {});
111
+ });
119
112
  };
120
113
  var setDatasourceStash = function setDatasourceStash(state, action) {
121
114
  return _objectSpread(_objectSpread({}, state), {}, {
@@ -11,7 +11,6 @@ import { useCallback, useMemo, useRef, useState } from 'react';
11
11
  import { css, jsx } from '@emotion/react';
12
12
  import { FormattedMessage } from 'react-intl';
13
13
  import Button from '@atlaskit/editor-common/FloatingToolbar/Button';
14
- import Separator from '@atlaskit/editor-common/FloatingToolbar/Separator';
15
14
  import { messages } from '@atlaskit/editor-common/messages/card';
16
15
  import { linkToolbarMessages } from '@atlaskit/editor-common/messages/link-toolbar';
17
16
  import { ArrowKeyNavigationType } from '@atlaskit/editor-common/ui-menu/ArrowKeyNavigationProvider/types';
@@ -20,7 +19,6 @@ import ChevronDownIcon from '@atlaskit/icon/core/chevron-down';
20
19
  import { useSmartLinkContext } from '@atlaskit/link-provider/use-smart-link-context';
21
20
  import ButtonItem from '@atlaskit/menu/button-item';
22
21
  import { Flex } from '@atlaskit/primitives/compiled/flex';
23
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/editor-experiment';
24
22
  import { focusEditorView, isDatasourceConfigEditable } from '../../pm-plugins/utils';
25
23
  import { editDatasource } from '../editDatasourceAction';
26
24
  import { useFetchDatasourceDataInfo } from '../useFetchDatasourceDataInfo';
@@ -103,9 +101,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
103
101
  }, jsx(FormattedMessage
104
102
  // Ignored via go/ees005
105
103
  // eslint-disable-next-line react/jsx-props-no-spreading
106
- , linkToolbarMessages.editLink)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator, {
107
- areAnyNewToolbarFlagsEnabled: false
108
- }));
104
+ , linkToolbarMessages.editLink)));
109
105
  }
110
106
  case 'edit-datasource':
111
107
  {
@@ -119,9 +115,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
119
115
  }, jsx(FormattedMessage
120
116
  // Ignored via go/ees005
121
117
  // eslint-disable-next-line react/jsx-props-no-spreading
122
- , linkToolbarMessages.editDatasourceStandalone)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator, {
123
- areAnyNewToolbarFlagsEnabled: false
124
- }));
118
+ , linkToolbarMessages.editDatasourceStandalone)));
125
119
  }
126
120
  case 'edit-dropdown':
127
121
  {
@@ -143,9 +137,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
143
137
  }, jsx(FormattedMessage
144
138
  // Ignored via go/ees005
145
139
  // eslint-disable-next-line react/jsx-props-no-spreading
146
- , messages.editDropdownTriggerTitle)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator, {
147
- areAnyNewToolbarFlagsEnabled: false
148
- }));
140
+ , messages.editDropdownTriggerTitle)));
149
141
  return jsx(Flex, {
150
142
  ref: containerRef
151
143
  }, jsx(UiDropdown, {
@@ -334,7 +334,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
334
334
  testId: 'inline-card-toolbar-comment-button',
335
335
  iconFallback: CommentIcon,
336
336
  title: intl.formatMessage(annotationMessages.createComment),
337
- showTitle: editorExperiment('platform_editor_controls', 'control') ? undefined : true,
337
+ showTitle: true,
338
338
  onClick: onCommentButtonClick,
339
339
  disabled: isOfflineMode(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c2 = pluginInjectionApi.connectivity) === null || _pluginInjectionApi$c2 === void 0 || (_pluginInjectionApi$c2 = _pluginInjectionApi$c2.sharedState) === null || _pluginInjectionApi$c2 === void 0 || (_pluginInjectionApi$c2 = _pluginInjectionApi$c2.currentState()) === null || _pluginInjectionApi$c2 === void 0 ? void 0 : _pluginInjectionApi$c2.mode)
340
340
  }, {
@@ -731,7 +731,7 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
731
731
  // see hideOnEsc in platform/packages/editor/editor-plugin-floating-toolbar/src/ui/Dropdown.tsx
732
732
  var testId = 'datasource-overflow-dropdown-trigger';
733
733
 
734
- // When canShowAppearanceSwitch is true, and platform_editor_controls is on, the link appearance dropdown shows, which includes a link preference button
734
+ // When canShowAppearanceSwitch is true, the link appearance dropdown shows, which includes a link preference button
735
735
  // So only add the link appearance button when canShowAppearanceSwitch is false
736
736
  if (!canShowAppearanceSwitch()) {
737
737
  var linkPreferenceButton = getSettingsButton(intl, editorAnalyticsApi, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.userPreferencesLink);
@@ -812,9 +812,9 @@ export var getStartingToolbarItems = function getStartingToolbarItems(options, a
812
812
  type: 'button',
813
813
  onClick: onEditLink,
814
814
  title: intl.formatMessage(linkToolbarMessages.editLink),
815
- showTitle: editorExperiment('platform_editor_controls', 'variant1') ? false : true,
815
+ showTitle: false,
816
816
  metadata: metadata,
817
- icon: editorExperiment('platform_editor_controls', 'variant1') ? EditIcon : undefined
817
+ icon: EditIcon
818
818
  }, {
819
819
  type: 'separator'
820
820
  }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "37.0.0",
3
+ "version": "38.0.0",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -26,23 +26,23 @@
26
26
  "@atlaskit/css": "^1.1.0",
27
27
  "@atlaskit/custom-steps": "^1.1.0",
28
28
  "@atlaskit/editor-card-provider": "^8.2.0",
29
- "@atlaskit/editor-plugin-analytics": "^31.0.0",
30
- "@atlaskit/editor-plugin-annotation": "^31.0.0",
31
- "@atlaskit/editor-plugin-base": "^32.0.0",
32
- "@atlaskit/editor-plugin-connectivity": "^31.0.0",
33
- "@atlaskit/editor-plugin-decorations": "^31.0.0",
34
- "@atlaskit/editor-plugin-editor-disabled": "^31.0.0",
35
- "@atlaskit/editor-plugin-editor-viewmode": "^33.0.0",
36
- "@atlaskit/editor-plugin-feature-flags": "^30.0.0",
37
- "@atlaskit/editor-plugin-floating-toolbar": "^33.0.0",
38
- "@atlaskit/editor-plugin-grid": "^31.0.0",
39
- "@atlaskit/editor-plugin-selection": "^31.0.0",
40
- "@atlaskit/editor-plugin-toolbar": "^28.0.0",
41
- "@atlaskit/editor-plugin-ui-control-registry": "^25.0.0",
42
- "@atlaskit/editor-plugin-user-intent": "^29.0.0",
43
- "@atlaskit/editor-plugin-width": "^32.0.0",
29
+ "@atlaskit/editor-plugin-analytics": "^32.0.0",
30
+ "@atlaskit/editor-plugin-annotation": "^32.0.0",
31
+ "@atlaskit/editor-plugin-base": "^33.0.0",
32
+ "@atlaskit/editor-plugin-connectivity": "^32.0.0",
33
+ "@atlaskit/editor-plugin-decorations": "^32.0.0",
34
+ "@atlaskit/editor-plugin-editor-disabled": "^32.0.0",
35
+ "@atlaskit/editor-plugin-editor-viewmode": "^34.0.0",
36
+ "@atlaskit/editor-plugin-feature-flags": "^31.0.0",
37
+ "@atlaskit/editor-plugin-floating-toolbar": "^34.0.0",
38
+ "@atlaskit/editor-plugin-grid": "^32.0.0",
39
+ "@atlaskit/editor-plugin-selection": "^32.0.0",
40
+ "@atlaskit/editor-plugin-toolbar": "^29.0.0",
41
+ "@atlaskit/editor-plugin-ui-control-registry": "^26.0.0",
42
+ "@atlaskit/editor-plugin-user-intent": "^30.0.0",
43
+ "@atlaskit/editor-plugin-width": "^33.0.0",
44
44
  "@atlaskit/editor-prosemirror": "^9.0.0",
45
- "@atlaskit/editor-shared-styles": "^5.1.0",
45
+ "@atlaskit/editor-shared-styles": "^5.2.0",
46
46
  "@atlaskit/editor-smart-link-draggable": "^1.2.0",
47
47
  "@atlaskit/editor-toolbar": "^2.11.0",
48
48
  "@atlaskit/editor-ui-control-model": "^3.0.0",
@@ -52,7 +52,7 @@
52
52
  "@atlaskit/link": "^5.1.0",
53
53
  "@atlaskit/link-analytics": "^13.0.0",
54
54
  "@atlaskit/link-client-extension": "^8.0.0",
55
- "@atlaskit/link-datasource": "^7.13.0",
55
+ "@atlaskit/link-datasource": "^7.15.0",
56
56
  "@atlaskit/link-extractors": "^5.0.0",
57
57
  "@atlaskit/linking-common": "^13.0.0",
58
58
  "@atlaskit/linking-types": "^16.1.0",
@@ -62,7 +62,7 @@
62
62
  "@atlaskit/platform-feature-flags-react": "^1.2.0",
63
63
  "@atlaskit/primitives": "^22.7.0",
64
64
  "@atlaskit/prosemirror-history": "^1.3.0",
65
- "@atlaskit/smart-card": "^46.15.0",
65
+ "@atlaskit/smart-card": "^46.18.0",
66
66
  "@atlaskit/tmp-editor-statsig": "^264.0.0",
67
67
  "@atlaskit/tokens": "^20.12.0",
68
68
  "@atlaskit/tooltip": "^24.4.0",
@@ -73,8 +73,8 @@
73
73
  "uuid": "^11.1.1"
74
74
  },
75
75
  "peerDependencies": {
76
- "@atlaskit/editor-common": "^135.0.0",
77
- "@atlaskit/link-provider": "^6.1.0",
76
+ "@atlaskit/editor-common": "^136.0.0",
77
+ "@atlaskit/link-provider": "^6.2.0",
78
78
  "react": "^18.2.0 || ^19.2.0",
79
79
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
80
80
  },
@@ -107,8 +107,8 @@
107
107
  },
108
108
  "compassUnitTestMetricSourceId": "ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:metric-source/c5751cc6-3513-4070-9deb-af31e86aed34/e6f3220b-0ca2-445a-a4c5-78cff6ca2a34",
109
109
  "devDependencies": {
110
- "@atlaskit/editor-common": "^135.0.0",
111
- "@atlaskit/link-provider": "^6.1.0",
110
+ "@atlaskit/editor-common": "^136.0.0",
111
+ "@atlaskit/link-provider": "^6.2.0",
112
112
  "react": "^19.2.0",
113
113
  "react-intl": "^7.0.0"
114
114
  }