@atlaskit/editor-plugin-card 5.4.17 → 5.4.20

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,32 @@
1
1
  # @atlaskit/editor-plugin-card
2
2
 
3
+ ## 5.4.20
4
+
5
+ ### Patch Changes
6
+
7
+ - [#145382](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/145382)
8
+ [`09a75a68f9d26`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/09a75a68f9d26) -
9
+ Clean up FG linking-platform-contenteditable-false-live-view
10
+ - Updated dependencies
11
+
12
+ ## 5.4.19
13
+
14
+ ### Patch Changes
15
+
16
+ - [#145180](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/145180)
17
+ [`46856892862ec`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/46856892862ec) -
18
+ Clean up FG platform_linking_enable_transaction_filtering
19
+ - Updated dependencies
20
+
21
+ ## 5.4.18
22
+
23
+ ### Patch Changes
24
+
25
+ - [#144194](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/144194)
26
+ [`542b82e03416e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/542b82e03416e) -
27
+ [ux] Remove separators within group in Editor floating toolbar
28
+ - Updated dependencies
29
+
3
30
  ## 5.4.17
4
31
 
5
32
  ### Patch Changes
@@ -132,20 +132,17 @@ var BlockCard = exports.BlockCard = /*#__PURE__*/function (_ReactNodeView) {
132
132
  return (0, _createClass2.default)(BlockCard, [{
133
133
  key: "createDomRef",
134
134
  value: function createDomRef() {
135
- var _this3 = this;
135
+ var _this$reactComponentP,
136
+ _this3 = this,
137
+ _this$reactComponentP2;
136
138
  var domRef = document.createElement('div');
137
139
  // workaround Chrome bug in https://product-fabric.atlassian.net/browse/ED-5379
138
140
  // see also: https://github.com/ProseMirror/prosemirror/issues/884
139
- if ((0, _platformFeatureFlags.fg)('linking-platform-contenteditable-false-live-view')) {
140
- var _this$reactComponentP, _this$reactComponentP2;
141
- this.unsubscribe = (_this$reactComponentP = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP === void 0 || (_this$reactComponentP = _this$reactComponentP.editorViewMode) === null || _this$reactComponentP === void 0 ? void 0 : _this$reactComponentP.sharedState.onChange(function (_ref2) {
142
- var nextSharedState = _ref2.nextSharedState;
143
- return _this3.updateContentEditable(nextSharedState, domRef);
144
- });
145
- this.updateContentEditable((_this$reactComponentP2 = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP2 === void 0 || (_this$reactComponentP2 = _this$reactComponentP2.editorViewMode) === null || _this$reactComponentP2 === void 0 ? void 0 : _this$reactComponentP2.sharedState.currentState(), domRef);
146
- } else {
147
- domRef.contentEditable = 'true';
148
- }
141
+ this.unsubscribe = (_this$reactComponentP = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP === void 0 || (_this$reactComponentP = _this$reactComponentP.editorViewMode) === null || _this$reactComponentP === void 0 ? void 0 : _this$reactComponentP.sharedState.onChange(function (_ref2) {
142
+ var nextSharedState = _ref2.nextSharedState;
143
+ return _this3.updateContentEditable(nextSharedState, domRef);
144
+ });
145
+ this.updateContentEditable((_this$reactComponentP2 = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP2 === void 0 || (_this$reactComponentP2 = _this$reactComponentP2.editorViewMode) === null || _this$reactComponentP2 === void 0 ? void 0 : _this$reactComponentP2.sharedState.currentState(), domRef);
149
146
  domRef.setAttribute('spellcheck', 'false');
150
147
  return domRef;
151
148
  }
@@ -360,19 +360,16 @@ var EmbedCard = exports.EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
360
360
  }, {
361
361
  key: "createDomRef",
362
362
  value: function createDomRef() {
363
- var _this3 = this;
363
+ var _this$reactComponentP,
364
+ _this3 = this,
365
+ _this$reactComponentP2;
364
366
  var domRef = document.createElement('div');
365
367
  // It is a tradeoff for the bug mentioned that occurs in Chrome: https://product-fabric.atlassian.net/browse/ED-5379, https://github.com/ProseMirror/prosemirror/issues/884
366
- if ((0, _platformFeatureFlags.fg)('linking-platform-contenteditable-false-live-view')) {
367
- var _this$reactComponentP, _this$reactComponentP2;
368
- this.unsubscribe = (_this$reactComponentP = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP === void 0 || (_this$reactComponentP = _this$reactComponentP.editorViewMode) === null || _this$reactComponentP === void 0 ? void 0 : _this$reactComponentP.sharedState.onChange(function (_ref3) {
369
- var nextSharedState = _ref3.nextSharedState;
370
- return _this3.updateContentEditable(nextSharedState, domRef);
371
- });
372
- this.updateContentEditable((_this$reactComponentP2 = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP2 === void 0 || (_this$reactComponentP2 = _this$reactComponentP2.editorViewMode) === null || _this$reactComponentP2 === void 0 ? void 0 : _this$reactComponentP2.sharedState.currentState(), domRef);
373
- } else {
374
- domRef.contentEditable = 'true';
375
- }
368
+ this.unsubscribe = (_this$reactComponentP = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP === void 0 || (_this$reactComponentP = _this$reactComponentP.editorViewMode) === null || _this$reactComponentP === void 0 ? void 0 : _this$reactComponentP.sharedState.onChange(function (_ref3) {
369
+ var nextSharedState = _ref3.nextSharedState;
370
+ return _this3.updateContentEditable(nextSharedState, domRef);
371
+ });
372
+ this.updateContentEditable((_this$reactComponentP2 = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP2 === void 0 || (_this$reactComponentP2 = _this$reactComponentP2.editorViewMode) === null || _this$reactComponentP2 === void 0 ? void 0 : _this$reactComponentP2.sharedState.currentState(), domRef);
376
373
  domRef.setAttribute('spellcheck', 'false');
377
374
  return domRef;
378
375
  }
@@ -155,18 +155,14 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
155
155
  }
156
156
  },
157
157
  filterTransaction: function filterTransaction(tr) {
158
- if ((0, _platformFeatureFlags.fg)('platform_linking_enable_transaction_filtering')) {
159
- var isOutsideClicked = tr.getMeta('outsideProsemirrorEditorClicked');
160
- if (isOutsideClicked) {
161
- var isInlineEditingActive = document.getElementById('sllv-active-inline-edit');
162
- if (isInlineEditingActive) {
163
- return false;
164
- }
158
+ var isOutsideClicked = tr.getMeta('outsideProsemirrorEditorClicked');
159
+ if (isOutsideClicked) {
160
+ var isInlineEditingActive = document.getElementById('sllv-active-inline-edit');
161
+ if (isInlineEditingActive) {
162
+ return false;
165
163
  }
166
- return true;
167
- } else {
168
- return true;
169
164
  }
165
+ return true;
170
166
  },
171
167
  view: function view(_view) {
172
168
  var domAtPos = _view.domAtPos.bind(_view);
@@ -80,7 +80,7 @@ var EditToolbarButtonPresentation = function EditToolbarButtonPresentation(_ref)
80
80
  }, (0, _experiments.editorExperiment)('platform_editor_controls', 'control') && (0, _react2.jsx)(_reactIntlNext.FormattedMessage
81
81
  // Ignored via go/ees005
82
82
  // eslint-disable-next-line react/jsx-props-no-spreading
83
- , _messages.linkToolbarMessages.editLink)), (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
83
+ , _messages.linkToolbarMessages.editLink)), (!(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') || !(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6')) && (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
84
84
  }
85
85
  case 'edit-datasource':
86
86
  {
@@ -93,7 +93,7 @@ var EditToolbarButtonPresentation = function EditToolbarButtonPresentation(_ref)
93
93
  }, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
94
94
  // Ignored via go/ees005
95
95
  // eslint-disable-next-line react/jsx-props-no-spreading
96
- , _messages.linkToolbarMessages.editDatasourceStandalone)), (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
96
+ , _messages.linkToolbarMessages.editDatasourceStandalone)), (!(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') || !(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6')) && (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
97
97
  }
98
98
  case 'edit-dropdown':
99
99
  {
@@ -115,7 +115,7 @@ var EditToolbarButtonPresentation = function EditToolbarButtonPresentation(_ref)
115
115
  }, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
116
116
  // Ignored via go/ees005
117
117
  // eslint-disable-next-line react/jsx-props-no-spreading
118
- , _messages.cardMessages.editDropdownTriggerTitle)), (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
118
+ , _messages.cardMessages.editDropdownTriggerTitle)), (!(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') || !(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6')) && (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
119
119
  return (0, _react2.jsx)(_compiled.Flex, {
120
120
  ref: containerRef
121
121
  }, (0, _react2.jsx)(_uiMenu.DropdownContainer, {
@@ -19,6 +19,7 @@ var _linkProvider = require("@atlaskit/link-provider");
19
19
  var _menu = require("@atlaskit/menu");
20
20
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
21
  var _compiled = require("@atlaskit/primitives/compiled");
22
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
22
23
  var _utils = require("../../pm-plugins/utils");
23
24
  var _editDatasourceAction = require("../editDatasourceAction");
24
25
  var _useFetchDatasourceDataInfo = require("../useFetchDatasourceDataInfo");
@@ -105,7 +106,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
105
106
  }, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
106
107
  // Ignored via go/ees005
107
108
  // eslint-disable-next-line react/jsx-props-no-spreading
108
- , _messages.linkToolbarMessages.editLink)), (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
109
+ , _messages.linkToolbarMessages.editLink)), (!(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') || !(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6')) && (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
109
110
  }
110
111
  case 'edit-datasource':
111
112
  {
@@ -118,7 +119,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
118
119
  }, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
119
120
  // Ignored via go/ees005
120
121
  // eslint-disable-next-line react/jsx-props-no-spreading
121
- , _messages.linkToolbarMessages.editDatasourceStandalone)), (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
122
+ , _messages.linkToolbarMessages.editDatasourceStandalone)), (!(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') || !(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6')) && (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
122
123
  }
123
124
  case 'edit-dropdown':
124
125
  {
@@ -140,7 +141,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
140
141
  }, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
141
142
  // Ignored via go/ees005
142
143
  // eslint-disable-next-line react/jsx-props-no-spreading
143
- , _messages.cardMessages.editDropdownTriggerTitle)), (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
144
+ , _messages.cardMessages.editDropdownTriggerTitle)), (!(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') || !(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6')) && (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
144
145
  return (0, _react2.jsx)(_compiled.Flex, {
145
146
  ref: containerRef
146
147
  }, (0, _react2.jsx)(_uiMenu.DropdownContainer, {
@@ -347,9 +347,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
347
347
  icon: _edit.default,
348
348
  testId: 'link-toolbar-edit-link-button',
349
349
  onClick: (0, _EditLinkToolbar.getEditLinkCallback)(editorAnalyticsApi, true)
350
- }, {
350
+ }].concat((0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6') ? [] : [{
351
351
  type: 'separator'
352
- }].concat((0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
352
+ }]), (0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
353
353
  id: 'editor.link.openLink',
354
354
  type: 'button',
355
355
  icon: _linkExternal.default,
@@ -365,7 +365,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
365
365
  if (currentAppearance === 'embed') {
366
366
  var _pluginInjectionApi$a4;
367
367
  var alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions, cardOptions);
368
- if (alignmentOptions.length) {
368
+ if (alignmentOptions.length && (!(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') || !(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6'))) {
369
369
  alignmentOptions.push({
370
370
  type: 'separator'
371
371
  });
@@ -422,9 +422,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
422
422
  inputMethod: _analytics.INPUT_METHOD.FLOATING_TB
423
423
  });
424
424
  }
425
- }] : []), [{
425
+ }] : []), (0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6') ? [] : [{
426
426
  type: 'separator'
427
- }]));
427
+ }])));
428
428
  }
429
429
  if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
430
430
  var hoverDecorationProps = function hoverDecorationProps(nodeType, className) {
@@ -474,9 +474,9 @@ var getUnlinkButtonGroup = function getUnlinkButtonGroup(state, intl, node, inli
474
474
  icon: _linkBroken.default,
475
475
  iconFallback: _unlink.default,
476
476
  onClick: withToolbarMetadata(unlinkCard(node, state, editorAnalyticsApi))
477
- }, {
477
+ }].concat((0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6') ? [] : [{
478
478
  type: 'separator'
479
- }] : [];
479
+ }])) : [];
480
480
  };
481
481
  var getSettingsButton = exports.getSettingsButton = function getSettingsButton(intl, editorAnalyticsApi, userPreferencesLink) {
482
482
  return {
@@ -107,18 +107,14 @@ export class BlockCard extends ReactNodeView {
107
107
  });
108
108
  }
109
109
  createDomRef() {
110
+ var _this$reactComponentP, _this$reactComponentP2, _this$reactComponentP3, _this$reactComponentP4;
110
111
  const domRef = document.createElement('div');
111
112
  // workaround Chrome bug in https://product-fabric.atlassian.net/browse/ED-5379
112
113
  // see also: https://github.com/ProseMirror/prosemirror/issues/884
113
- if (fg('linking-platform-contenteditable-false-live-view')) {
114
- var _this$reactComponentP, _this$reactComponentP2, _this$reactComponentP3, _this$reactComponentP4;
115
- this.unsubscribe = (_this$reactComponentP = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP === void 0 ? void 0 : (_this$reactComponentP2 = _this$reactComponentP.editorViewMode) === null || _this$reactComponentP2 === void 0 ? void 0 : _this$reactComponentP2.sharedState.onChange(({
116
- nextSharedState
117
- }) => this.updateContentEditable(nextSharedState, domRef));
118
- this.updateContentEditable((_this$reactComponentP3 = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP3 === void 0 ? void 0 : (_this$reactComponentP4 = _this$reactComponentP3.editorViewMode) === null || _this$reactComponentP4 === void 0 ? void 0 : _this$reactComponentP4.sharedState.currentState(), domRef);
119
- } else {
120
- domRef.contentEditable = 'true';
121
- }
114
+ this.unsubscribe = (_this$reactComponentP = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP === void 0 ? void 0 : (_this$reactComponentP2 = _this$reactComponentP.editorViewMode) === null || _this$reactComponentP2 === void 0 ? void 0 : _this$reactComponentP2.sharedState.onChange(({
115
+ nextSharedState
116
+ }) => this.updateContentEditable(nextSharedState, domRef));
117
+ this.updateContentEditable((_this$reactComponentP3 = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP3 === void 0 ? void 0 : (_this$reactComponentP4 = _this$reactComponentP3.editorViewMode) === null || _this$reactComponentP4 === void 0 ? void 0 : _this$reactComponentP4.sharedState.currentState(), domRef);
122
118
  domRef.setAttribute('spellcheck', 'false');
123
119
  return domRef;
124
120
  }
@@ -341,17 +341,13 @@ export class EmbedCard extends ReactNodeView {
341
341
  return super.viewShouldUpdate(nextNode);
342
342
  }
343
343
  createDomRef() {
344
+ var _this$reactComponentP, _this$reactComponentP2, _this$reactComponentP3, _this$reactComponentP4;
344
345
  const domRef = document.createElement('div');
345
346
  // It is a tradeoff for the bug mentioned that occurs in Chrome: https://product-fabric.atlassian.net/browse/ED-5379, https://github.com/ProseMirror/prosemirror/issues/884
346
- if (fg('linking-platform-contenteditable-false-live-view')) {
347
- var _this$reactComponentP, _this$reactComponentP2, _this$reactComponentP3, _this$reactComponentP4;
348
- this.unsubscribe = (_this$reactComponentP = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP === void 0 ? void 0 : (_this$reactComponentP2 = _this$reactComponentP.editorViewMode) === null || _this$reactComponentP2 === void 0 ? void 0 : _this$reactComponentP2.sharedState.onChange(({
349
- nextSharedState
350
- }) => this.updateContentEditable(nextSharedState, domRef));
351
- this.updateContentEditable((_this$reactComponentP3 = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP3 === void 0 ? void 0 : (_this$reactComponentP4 = _this$reactComponentP3.editorViewMode) === null || _this$reactComponentP4 === void 0 ? void 0 : _this$reactComponentP4.sharedState.currentState(), domRef);
352
- } else {
353
- domRef.contentEditable = 'true';
354
- }
347
+ this.unsubscribe = (_this$reactComponentP = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP === void 0 ? void 0 : (_this$reactComponentP2 = _this$reactComponentP.editorViewMode) === null || _this$reactComponentP2 === void 0 ? void 0 : _this$reactComponentP2.sharedState.onChange(({
348
+ nextSharedState
349
+ }) => this.updateContentEditable(nextSharedState, domRef));
350
+ this.updateContentEditable((_this$reactComponentP3 = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP3 === void 0 ? void 0 : (_this$reactComponentP4 = _this$reactComponentP3.editorViewMode) === null || _this$reactComponentP4 === void 0 ? void 0 : _this$reactComponentP4.sharedState.currentState(), domRef);
355
351
  domRef.setAttribute('spellcheck', 'false');
356
352
  return domRef;
357
353
  }
@@ -148,18 +148,14 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
148
148
  }
149
149
  },
150
150
  filterTransaction(tr) {
151
- if (fg('platform_linking_enable_transaction_filtering')) {
152
- const isOutsideClicked = tr.getMeta('outsideProsemirrorEditorClicked');
153
- if (isOutsideClicked) {
154
- const isInlineEditingActive = document.getElementById('sllv-active-inline-edit');
155
- if (isInlineEditingActive) {
156
- return false;
157
- }
151
+ const isOutsideClicked = tr.getMeta('outsideProsemirrorEditorClicked');
152
+ if (isOutsideClicked) {
153
+ const isInlineEditingActive = document.getElementById('sllv-active-inline-edit');
154
+ if (isInlineEditingActive) {
155
+ return false;
158
156
  }
159
- return true;
160
- } else {
161
- return true;
162
157
  }
158
+ return true;
163
159
  },
164
160
  view(view) {
165
161
  const domAtPos = view.domAtPos.bind(view);
@@ -63,7 +63,7 @@ const EditToolbarButtonPresentation = ({
63
63
  }, editorExperiment('platform_editor_controls', 'control') && jsx(FormattedMessage
64
64
  // Ignored via go/ees005
65
65
  // eslint-disable-next-line react/jsx-props-no-spreading
66
- , linkToolbarMessages.editLink)), jsx(Separator, null));
66
+ , linkToolbarMessages.editLink)), (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6')) && jsx(Separator, null));
67
67
  }
68
68
  case 'edit-datasource':
69
69
  {
@@ -76,7 +76,7 @@ const EditToolbarButtonPresentation = ({
76
76
  }, jsx(FormattedMessage
77
77
  // Ignored via go/ees005
78
78
  // eslint-disable-next-line react/jsx-props-no-spreading
79
- , linkToolbarMessages.editDatasourceStandalone)), jsx(Separator, null));
79
+ , linkToolbarMessages.editDatasourceStandalone)), (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6')) && jsx(Separator, null));
80
80
  }
81
81
  case 'edit-dropdown':
82
82
  {
@@ -98,7 +98,7 @@ const EditToolbarButtonPresentation = ({
98
98
  }, jsx(FormattedMessage
99
99
  // Ignored via go/ees005
100
100
  // eslint-disable-next-line react/jsx-props-no-spreading
101
- , messages.editDropdownTriggerTitle)), jsx(Separator, null));
101
+ , messages.editDropdownTriggerTitle)), (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6')) && jsx(Separator, null));
102
102
  return jsx(Flex, {
103
103
  ref: containerRef
104
104
  }, jsx(UiDropdown, {
@@ -16,6 +16,7 @@ import { useSmartLinkContext } from '@atlaskit/link-provider';
16
16
  import { ButtonItem } from '@atlaskit/menu';
17
17
  import { fg } from '@atlaskit/platform-feature-flags';
18
18
  import { Flex } from '@atlaskit/primitives/compiled';
19
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
19
20
  import { focusEditorView, isDatasourceConfigEditable } from '../../pm-plugins/utils';
20
21
  import { editDatasource } from '../editDatasourceAction';
21
22
  import { useFetchDatasourceDataInfo } from '../useFetchDatasourceDataInfo';
@@ -90,7 +91,7 @@ const EditToolbarButtonWithCardContext = props => {
90
91
  }, jsx(FormattedMessage
91
92
  // Ignored via go/ees005
92
93
  // eslint-disable-next-line react/jsx-props-no-spreading
93
- , linkToolbarMessages.editLink)), jsx(Separator, null));
94
+ , linkToolbarMessages.editLink)), (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6')) && jsx(Separator, null));
94
95
  }
95
96
  case 'edit-datasource':
96
97
  {
@@ -103,7 +104,7 @@ const EditToolbarButtonWithCardContext = props => {
103
104
  }, jsx(FormattedMessage
104
105
  // Ignored via go/ees005
105
106
  // eslint-disable-next-line react/jsx-props-no-spreading
106
- , linkToolbarMessages.editDatasourceStandalone)), jsx(Separator, null));
107
+ , linkToolbarMessages.editDatasourceStandalone)), (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6')) && jsx(Separator, null));
107
108
  }
108
109
  case 'edit-dropdown':
109
110
  {
@@ -125,7 +126,7 @@ const EditToolbarButtonWithCardContext = props => {
125
126
  }, jsx(FormattedMessage
126
127
  // Ignored via go/ees005
127
128
  // eslint-disable-next-line react/jsx-props-no-spreading
128
- , messages.editDropdownTriggerTitle)), jsx(Separator, null));
129
+ , messages.editDropdownTriggerTitle)), (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6')) && jsx(Separator, null));
129
130
  return jsx(Flex, {
130
131
  ref: containerRef
131
132
  }, jsx(UiDropdown, {
@@ -339,9 +339,9 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
339
339
  icon: EditIcon,
340
340
  testId: 'link-toolbar-edit-link-button',
341
341
  onClick: getEditLinkCallback(editorAnalyticsApi, true)
342
- }, {
342
+ }, ...(fg('platform_editor_controls_patch_6') ? [] : [{
343
343
  type: 'separator'
344
- }, ...getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi), {
344
+ }]), ...getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi), {
345
345
  id: 'editor.link.openLink',
346
346
  type: 'button',
347
347
  icon: LinkExternalIcon,
@@ -357,7 +357,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
357
357
  if (currentAppearance === 'embed') {
358
358
  var _pluginInjectionApi$a5;
359
359
  const alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a5 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a5 === void 0 ? void 0 : _pluginInjectionApi$a5.actions, cardOptions);
360
- if (alignmentOptions.length) {
360
+ if (alignmentOptions.length && (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6'))) {
361
361
  alignmentOptions.push({
362
362
  type: 'separator'
363
363
  });
@@ -412,9 +412,9 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
412
412
  editorState: state,
413
413
  inputMethod: INPUT_METHOD.FLOATING_TB
414
414
  })
415
- }] : []), {
415
+ }] : []), ...(fg('platform_editor_controls_patch_6') ? [] : [{
416
416
  type: 'separator'
417
- });
417
+ }]));
418
418
  }
419
419
  if (editorExperiment('platform_editor_controls', 'variant1')) {
420
420
  const hoverDecorationProps = (nodeType, className) => ({
@@ -463,9 +463,9 @@ const getUnlinkButtonGroup = (state, intl, node, inlineCard, editorAnalyticsApi)
463
463
  icon: LinkBrokenIcon,
464
464
  iconFallback: UnlinkIcon,
465
465
  onClick: withToolbarMetadata(unlinkCard(node, state, editorAnalyticsApi))
466
- }, {
466
+ }, ...(fg('platform_editor_controls_patch_6') ? [] : [{
467
467
  type: 'separator'
468
- }] : [];
468
+ }])] : [];
469
469
  };
470
470
  export const getSettingsButton = (intl, editorAnalyticsApi, userPreferencesLink) => {
471
471
  return {
@@ -126,20 +126,17 @@ export var BlockCard = /*#__PURE__*/function (_ReactNodeView) {
126
126
  return _createClass(BlockCard, [{
127
127
  key: "createDomRef",
128
128
  value: function createDomRef() {
129
- var _this3 = this;
129
+ var _this$reactComponentP,
130
+ _this3 = this,
131
+ _this$reactComponentP2;
130
132
  var domRef = document.createElement('div');
131
133
  // workaround Chrome bug in https://product-fabric.atlassian.net/browse/ED-5379
132
134
  // see also: https://github.com/ProseMirror/prosemirror/issues/884
133
- if (fg('linking-platform-contenteditable-false-live-view')) {
134
- var _this$reactComponentP, _this$reactComponentP2;
135
- this.unsubscribe = (_this$reactComponentP = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP === void 0 || (_this$reactComponentP = _this$reactComponentP.editorViewMode) === null || _this$reactComponentP === void 0 ? void 0 : _this$reactComponentP.sharedState.onChange(function (_ref2) {
136
- var nextSharedState = _ref2.nextSharedState;
137
- return _this3.updateContentEditable(nextSharedState, domRef);
138
- });
139
- this.updateContentEditable((_this$reactComponentP2 = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP2 === void 0 || (_this$reactComponentP2 = _this$reactComponentP2.editorViewMode) === null || _this$reactComponentP2 === void 0 ? void 0 : _this$reactComponentP2.sharedState.currentState(), domRef);
140
- } else {
141
- domRef.contentEditable = 'true';
142
- }
135
+ this.unsubscribe = (_this$reactComponentP = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP === void 0 || (_this$reactComponentP = _this$reactComponentP.editorViewMode) === null || _this$reactComponentP === void 0 ? void 0 : _this$reactComponentP.sharedState.onChange(function (_ref2) {
136
+ var nextSharedState = _ref2.nextSharedState;
137
+ return _this3.updateContentEditable(nextSharedState, domRef);
138
+ });
139
+ this.updateContentEditable((_this$reactComponentP2 = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP2 === void 0 || (_this$reactComponentP2 = _this$reactComponentP2.editorViewMode) === null || _this$reactComponentP2 === void 0 ? void 0 : _this$reactComponentP2.sharedState.currentState(), domRef);
143
140
  domRef.setAttribute('spellcheck', 'false');
144
141
  return domRef;
145
142
  }
@@ -353,19 +353,16 @@ export var EmbedCard = /*#__PURE__*/function (_ReactNodeView) {
353
353
  }, {
354
354
  key: "createDomRef",
355
355
  value: function createDomRef() {
356
- var _this3 = this;
356
+ var _this$reactComponentP,
357
+ _this3 = this,
358
+ _this$reactComponentP2;
357
359
  var domRef = document.createElement('div');
358
360
  // It is a tradeoff for the bug mentioned that occurs in Chrome: https://product-fabric.atlassian.net/browse/ED-5379, https://github.com/ProseMirror/prosemirror/issues/884
359
- if (fg('linking-platform-contenteditable-false-live-view')) {
360
- var _this$reactComponentP, _this$reactComponentP2;
361
- this.unsubscribe = (_this$reactComponentP = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP === void 0 || (_this$reactComponentP = _this$reactComponentP.editorViewMode) === null || _this$reactComponentP === void 0 ? void 0 : _this$reactComponentP.sharedState.onChange(function (_ref3) {
362
- var nextSharedState = _ref3.nextSharedState;
363
- return _this3.updateContentEditable(nextSharedState, domRef);
364
- });
365
- this.updateContentEditable((_this$reactComponentP2 = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP2 === void 0 || (_this$reactComponentP2 = _this$reactComponentP2.editorViewMode) === null || _this$reactComponentP2 === void 0 ? void 0 : _this$reactComponentP2.sharedState.currentState(), domRef);
366
- } else {
367
- domRef.contentEditable = 'true';
368
- }
361
+ this.unsubscribe = (_this$reactComponentP = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP === void 0 || (_this$reactComponentP = _this$reactComponentP.editorViewMode) === null || _this$reactComponentP === void 0 ? void 0 : _this$reactComponentP.sharedState.onChange(function (_ref3) {
362
+ var nextSharedState = _ref3.nextSharedState;
363
+ return _this3.updateContentEditable(nextSharedState, domRef);
364
+ });
365
+ this.updateContentEditable((_this$reactComponentP2 = this.reactComponentProps.pluginInjectionApi) === null || _this$reactComponentP2 === void 0 || (_this$reactComponentP2 = _this$reactComponentP2.editorViewMode) === null || _this$reactComponentP2 === void 0 ? void 0 : _this$reactComponentP2.sharedState.currentState(), domRef);
369
366
  domRef.setAttribute('spellcheck', 'false');
370
367
  return domRef;
371
368
  }
@@ -148,18 +148,14 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
148
148
  }
149
149
  },
150
150
  filterTransaction: function filterTransaction(tr) {
151
- if (fg('platform_linking_enable_transaction_filtering')) {
152
- var isOutsideClicked = tr.getMeta('outsideProsemirrorEditorClicked');
153
- if (isOutsideClicked) {
154
- var isInlineEditingActive = document.getElementById('sllv-active-inline-edit');
155
- if (isInlineEditingActive) {
156
- return false;
157
- }
151
+ var isOutsideClicked = tr.getMeta('outsideProsemirrorEditorClicked');
152
+ if (isOutsideClicked) {
153
+ var isInlineEditingActive = document.getElementById('sllv-active-inline-edit');
154
+ if (isInlineEditingActive) {
155
+ return false;
158
156
  }
159
- return true;
160
- } else {
161
- return true;
162
157
  }
158
+ return true;
163
159
  },
164
160
  view: function view(_view) {
165
161
  var domAtPos = _view.domAtPos.bind(_view);
@@ -72,7 +72,7 @@ var EditToolbarButtonPresentation = function EditToolbarButtonPresentation(_ref)
72
72
  }, editorExperiment('platform_editor_controls', 'control') && jsx(FormattedMessage
73
73
  // Ignored via go/ees005
74
74
  // eslint-disable-next-line react/jsx-props-no-spreading
75
- , linkToolbarMessages.editLink)), jsx(Separator, null));
75
+ , linkToolbarMessages.editLink)), (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6')) && jsx(Separator, null));
76
76
  }
77
77
  case 'edit-datasource':
78
78
  {
@@ -85,7 +85,7 @@ var EditToolbarButtonPresentation = function EditToolbarButtonPresentation(_ref)
85
85
  }, jsx(FormattedMessage
86
86
  // Ignored via go/ees005
87
87
  // eslint-disable-next-line react/jsx-props-no-spreading
88
- , linkToolbarMessages.editDatasourceStandalone)), jsx(Separator, null));
88
+ , linkToolbarMessages.editDatasourceStandalone)), (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6')) && jsx(Separator, null));
89
89
  }
90
90
  case 'edit-dropdown':
91
91
  {
@@ -107,7 +107,7 @@ var EditToolbarButtonPresentation = function EditToolbarButtonPresentation(_ref)
107
107
  }, jsx(FormattedMessage
108
108
  // Ignored via go/ees005
109
109
  // eslint-disable-next-line react/jsx-props-no-spreading
110
- , messages.editDropdownTriggerTitle)), jsx(Separator, null));
110
+ , messages.editDropdownTriggerTitle)), (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6')) && jsx(Separator, null));
111
111
  return jsx(Flex, {
112
112
  ref: containerRef
113
113
  }, jsx(UiDropdown, {
@@ -19,6 +19,7 @@ import { useSmartLinkContext } from '@atlaskit/link-provider';
19
19
  import { ButtonItem } from '@atlaskit/menu';
20
20
  import { fg } from '@atlaskit/platform-feature-flags';
21
21
  import { Flex } from '@atlaskit/primitives/compiled';
22
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
22
23
  import { focusEditorView, isDatasourceConfigEditable } from '../../pm-plugins/utils';
23
24
  import { editDatasource } from '../editDatasourceAction';
24
25
  import { useFetchDatasourceDataInfo } from '../useFetchDatasourceDataInfo';
@@ -99,7 +100,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
99
100
  }, jsx(FormattedMessage
100
101
  // Ignored via go/ees005
101
102
  // eslint-disable-next-line react/jsx-props-no-spreading
102
- , linkToolbarMessages.editLink)), jsx(Separator, null));
103
+ , linkToolbarMessages.editLink)), (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6')) && jsx(Separator, null));
103
104
  }
104
105
  case 'edit-datasource':
105
106
  {
@@ -112,7 +113,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
112
113
  }, jsx(FormattedMessage
113
114
  // Ignored via go/ees005
114
115
  // eslint-disable-next-line react/jsx-props-no-spreading
115
- , linkToolbarMessages.editDatasourceStandalone)), jsx(Separator, null));
116
+ , linkToolbarMessages.editDatasourceStandalone)), (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6')) && jsx(Separator, null));
116
117
  }
117
118
  case 'edit-dropdown':
118
119
  {
@@ -134,7 +135,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
134
135
  }, jsx(FormattedMessage
135
136
  // Ignored via go/ees005
136
137
  // eslint-disable-next-line react/jsx-props-no-spreading
137
- , messages.editDropdownTriggerTitle)), jsx(Separator, null));
138
+ , messages.editDropdownTriggerTitle)), (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6')) && jsx(Separator, null));
138
139
  return jsx(Flex, {
139
140
  ref: containerRef
140
141
  }, jsx(UiDropdown, {
@@ -337,9 +337,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
337
337
  icon: EditIcon,
338
338
  testId: 'link-toolbar-edit-link-button',
339
339
  onClick: getEditLinkCallback(editorAnalyticsApi, true)
340
- }, {
340
+ }].concat(_toConsumableArray(fg('platform_editor_controls_patch_6') ? [] : [{
341
341
  type: 'separator'
342
- }].concat(_toConsumableArray(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
342
+ }]), _toConsumableArray(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
343
343
  id: 'editor.link.openLink',
344
344
  type: 'button',
345
345
  icon: LinkExternalIcon,
@@ -355,7 +355,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
355
355
  if (currentAppearance === 'embed') {
356
356
  var _pluginInjectionApi$a4;
357
357
  var alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions, cardOptions);
358
- if (alignmentOptions.length) {
358
+ if (alignmentOptions.length && (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6'))) {
359
359
  alignmentOptions.push({
360
360
  type: 'separator'
361
361
  });
@@ -412,9 +412,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
412
412
  inputMethod: INPUT_METHOD.FLOATING_TB
413
413
  });
414
414
  }
415
- }] : []), [{
415
+ }] : []), _toConsumableArray(fg('platform_editor_controls_patch_6') ? [] : [{
416
416
  type: 'separator'
417
- }]));
417
+ }])));
418
418
  }
419
419
  if (editorExperiment('platform_editor_controls', 'variant1')) {
420
420
  var hoverDecorationProps = function hoverDecorationProps(nodeType, className) {
@@ -464,9 +464,9 @@ var getUnlinkButtonGroup = function getUnlinkButtonGroup(state, intl, node, inli
464
464
  icon: LinkBrokenIcon,
465
465
  iconFallback: UnlinkIcon,
466
466
  onClick: withToolbarMetadata(unlinkCard(node, state, editorAnalyticsApi))
467
- }, {
467
+ }].concat(_toConsumableArray(fg('platform_editor_controls_patch_6') ? [] : [{
468
468
  type: 'separator'
469
- }] : [];
469
+ }])) : [];
470
470
  };
471
471
  export var getSettingsButton = function getSettingsButton(intl, editorAnalyticsApi, userPreferencesLink) {
472
472
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-card",
3
- "version": "5.4.17",
3
+ "version": "5.4.20",
4
4
  "description": "Card plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/analytics-next": "^11.0.0",
38
38
  "@atlaskit/button": "^23.0.0",
39
39
  "@atlaskit/custom-steps": "^0.11.0",
40
- "@atlaskit/editor-common": "^103.13.0",
40
+ "@atlaskit/editor-common": "^103.16.0",
41
41
  "@atlaskit/editor-plugin-analytics": "^2.2.0",
42
42
  "@atlaskit/editor-plugin-base": "^2.3.0",
43
43
  "@atlaskit/editor-plugin-connectivity": "^2.0.0",
@@ -54,15 +54,15 @@
54
54
  "@atlaskit/icon": "^25.6.0",
55
55
  "@atlaskit/link-analytics": "^9.1.0",
56
56
  "@atlaskit/link-client-extension": "^4.0.0",
57
- "@atlaskit/link-datasource": "^4.5.0",
57
+ "@atlaskit/link-datasource": "^4.7.0",
58
58
  "@atlaskit/linking-common": "^8.0.0",
59
59
  "@atlaskit/linking-types": "^9.9.0",
60
60
  "@atlaskit/menu": "^3.2.0",
61
61
  "@atlaskit/platform-feature-flags": "^1.1.0",
62
62
  "@atlaskit/primitives": "^14.4.0",
63
- "@atlaskit/smart-card": "^36.8.0",
63
+ "@atlaskit/smart-card": "^36.10.0",
64
64
  "@atlaskit/theme": "^18.0.0",
65
- "@atlaskit/tmp-editor-statsig": "^4.13.0",
65
+ "@atlaskit/tmp-editor-statsig": "^4.14.0",
66
66
  "@atlaskit/tokens": "^4.8.0",
67
67
  "@babel/runtime": "^7.0.0",
68
68
  "@emotion/react": "^11.7.1",
@@ -113,18 +113,12 @@
113
113
  }
114
114
  },
115
115
  "platform-feature-flags": {
116
- "linking-platform-contenteditable-false-live-view": {
117
- "type": "boolean"
118
- },
119
116
  "editor_inline_comments_paste_insert_nodes": {
120
117
  "type": "boolean"
121
118
  },
122
119
  "hardcoded-embeds-only-on-new-line": {
123
120
  "type": "boolean"
124
121
  },
125
- "platform_linking_enable_transaction_filtering": {
126
- "type": "boolean"
127
- },
128
122
  "linking_platform_smart_links_in_live_pages": {
129
123
  "type": "boolean"
130
124
  },