@atlaskit/editor-plugin-card 5.4.17 → 5.4.19
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 +18 -0
- package/dist/cjs/pm-plugins/main.js +6 -10
- package/dist/cjs/ui/EditToolbarButton/index.js +4 -3
- package/dist/cjs/ui/toolbar.js +11 -8
- package/dist/es2019/pm-plugins/main.js +6 -10
- package/dist/es2019/ui/EditToolbarButton/index.js +4 -3
- package/dist/es2019/ui/toolbar.js +9 -8
- package/dist/esm/pm-plugins/main.js +6 -10
- package/dist/esm/ui/EditToolbarButton/index.js +4 -3
- package/dist/esm/ui/toolbar.js +11 -8
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 5.4.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#145180](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/145180)
|
|
8
|
+
[`46856892862ec`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/46856892862ec) -
|
|
9
|
+
Clean up FG platform_linking_enable_transaction_filtering
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 5.4.18
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#144194](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/144194)
|
|
17
|
+
[`542b82e03416e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/542b82e03416e) -
|
|
18
|
+
[ux] Remove separators within group in Editor floating toolbar
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 5.4.17
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -155,18 +155,14 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pluginI
|
|
|
155
155
|
}
|
|
156
156
|
},
|
|
157
157
|
filterTransaction: function filterTransaction(tr) {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
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);
|
|
@@ -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, {
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -178,7 +178,10 @@ var buildAlignmentOptions = function buildAlignmentOptions(state, intl, widthPlu
|
|
|
178
178
|
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6')) {
|
|
179
179
|
return (0, _card.buildLayoutDropdown)(state, intl, state.schema.nodes.embedCard, widthPluginDependencyApi, analyticsApi, true, true, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowWrapping, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowAlignment);
|
|
180
180
|
}
|
|
181
|
-
|
|
181
|
+
var layoutButtons = (0, _card.buildLayoutButtons)(state, intl, state.schema.nodes.embedCard, widthPluginDependencyApi, analyticsApi, true, true, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowWrapping, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowAlignment);
|
|
182
|
+
return (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6') ? layoutButtons.filter(function (item) {
|
|
183
|
+
return item.type !== 'separator';
|
|
184
|
+
}) : layoutButtons;
|
|
182
185
|
};
|
|
183
186
|
var withToolbarMetadata = function withToolbarMetadata(command) {
|
|
184
187
|
return (0, _card.commandWithMetadata)(command, {
|
|
@@ -347,9 +350,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
347
350
|
icon: _edit.default,
|
|
348
351
|
testId: 'link-toolbar-edit-link-button',
|
|
349
352
|
onClick: (0, _EditLinkToolbar.getEditLinkCallback)(editorAnalyticsApi, true)
|
|
350
|
-
}, {
|
|
353
|
+
}].concat((0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6') ? [] : [{
|
|
351
354
|
type: 'separator'
|
|
352
|
-
}]
|
|
355
|
+
}]), (0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
353
356
|
id: 'editor.link.openLink',
|
|
354
357
|
type: 'button',
|
|
355
358
|
icon: _linkExternal.default,
|
|
@@ -365,7 +368,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
365
368
|
if (currentAppearance === 'embed') {
|
|
366
369
|
var _pluginInjectionApi$a4;
|
|
367
370
|
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) {
|
|
371
|
+
if (alignmentOptions.length && (!(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') || !(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6'))) {
|
|
369
372
|
alignmentOptions.push({
|
|
370
373
|
type: 'separator'
|
|
371
374
|
});
|
|
@@ -422,9 +425,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
422
425
|
inputMethod: _analytics.INPUT_METHOD.FLOATING_TB
|
|
423
426
|
});
|
|
424
427
|
}
|
|
425
|
-
}] : []), [{
|
|
428
|
+
}] : []), (0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6') ? [] : [{
|
|
426
429
|
type: 'separator'
|
|
427
|
-
}]));
|
|
430
|
+
}])));
|
|
428
431
|
}
|
|
429
432
|
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
430
433
|
var hoverDecorationProps = function hoverDecorationProps(nodeType, className) {
|
|
@@ -474,9 +477,9 @@ var getUnlinkButtonGroup = function getUnlinkButtonGroup(state, intl, node, inli
|
|
|
474
477
|
icon: _linkBroken.default,
|
|
475
478
|
iconFallback: _unlink.default,
|
|
476
479
|
onClick: withToolbarMetadata(unlinkCard(node, state, editorAnalyticsApi))
|
|
477
|
-
}, {
|
|
480
|
+
}].concat((0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6') ? [] : [{
|
|
478
481
|
type: 'separator'
|
|
479
|
-
}] : [];
|
|
482
|
+
}])) : [];
|
|
480
483
|
};
|
|
481
484
|
var getSettingsButton = exports.getSettingsButton = function getSettingsButton(intl, editorAnalyticsApi, userPreferencesLink) {
|
|
482
485
|
return {
|
|
@@ -148,18 +148,14 @@ export const createPlugin = (options, pluginInjectionApi) => pmPluginFactoryPara
|
|
|
148
148
|
}
|
|
149
149
|
},
|
|
150
150
|
filterTransaction(tr) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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);
|
|
@@ -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, {
|
|
@@ -171,7 +171,8 @@ const buildAlignmentOptions = (state, intl, widthPluginDependencyApi, analyticsA
|
|
|
171
171
|
if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_6')) {
|
|
172
172
|
return buildLayoutDropdown(state, intl, state.schema.nodes.embedCard, widthPluginDependencyApi, analyticsApi, true, true, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowWrapping, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowAlignment);
|
|
173
173
|
}
|
|
174
|
-
|
|
174
|
+
const layoutButtons = buildLayoutButtons(state, intl, state.schema.nodes.embedCard, widthPluginDependencyApi, analyticsApi, true, true, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowWrapping, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowAlignment);
|
|
175
|
+
return editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_6') ? layoutButtons.filter(item => item.type !== 'separator') : layoutButtons;
|
|
175
176
|
};
|
|
176
177
|
const withToolbarMetadata = command => commandWithMetadata(command, {
|
|
177
178
|
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
@@ -339,9 +340,9 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
339
340
|
icon: EditIcon,
|
|
340
341
|
testId: 'link-toolbar-edit-link-button',
|
|
341
342
|
onClick: getEditLinkCallback(editorAnalyticsApi, true)
|
|
342
|
-
}, {
|
|
343
|
+
}, ...(fg('platform_editor_controls_patch_6') ? [] : [{
|
|
343
344
|
type: 'separator'
|
|
344
|
-
}, ...getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi), {
|
|
345
|
+
}]), ...getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi), {
|
|
345
346
|
id: 'editor.link.openLink',
|
|
346
347
|
type: 'button',
|
|
347
348
|
icon: LinkExternalIcon,
|
|
@@ -357,7 +358,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
357
358
|
if (currentAppearance === 'embed') {
|
|
358
359
|
var _pluginInjectionApi$a5;
|
|
359
360
|
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) {
|
|
361
|
+
if (alignmentOptions.length && (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6'))) {
|
|
361
362
|
alignmentOptions.push({
|
|
362
363
|
type: 'separator'
|
|
363
364
|
});
|
|
@@ -412,9 +413,9 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
412
413
|
editorState: state,
|
|
413
414
|
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
414
415
|
})
|
|
415
|
-
}] : []), {
|
|
416
|
+
}] : []), ...(fg('platform_editor_controls_patch_6') ? [] : [{
|
|
416
417
|
type: 'separator'
|
|
417
|
-
});
|
|
418
|
+
}]));
|
|
418
419
|
}
|
|
419
420
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
420
421
|
const hoverDecorationProps = (nodeType, className) => ({
|
|
@@ -463,9 +464,9 @@ const getUnlinkButtonGroup = (state, intl, node, inlineCard, editorAnalyticsApi)
|
|
|
463
464
|
icon: LinkBrokenIcon,
|
|
464
465
|
iconFallback: UnlinkIcon,
|
|
465
466
|
onClick: withToolbarMetadata(unlinkCard(node, state, editorAnalyticsApi))
|
|
466
|
-
}, {
|
|
467
|
+
}, ...(fg('platform_editor_controls_patch_6') ? [] : [{
|
|
467
468
|
type: 'separator'
|
|
468
|
-
}] : [];
|
|
469
|
+
}])] : [];
|
|
469
470
|
};
|
|
470
471
|
export const getSettingsButton = (intl, editorAnalyticsApi, userPreferencesLink) => {
|
|
471
472
|
return {
|
|
@@ -148,18 +148,14 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
|
|
|
148
148
|
}
|
|
149
149
|
},
|
|
150
150
|
filterTransaction: function filterTransaction(tr) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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);
|
|
@@ -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, {
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -168,7 +168,10 @@ var buildAlignmentOptions = function buildAlignmentOptions(state, intl, widthPlu
|
|
|
168
168
|
if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_6')) {
|
|
169
169
|
return buildLayoutDropdown(state, intl, state.schema.nodes.embedCard, widthPluginDependencyApi, analyticsApi, true, true, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowWrapping, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowAlignment);
|
|
170
170
|
}
|
|
171
|
-
|
|
171
|
+
var layoutButtons = buildLayoutButtons(state, intl, state.schema.nodes.embedCard, widthPluginDependencyApi, analyticsApi, true, true, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowWrapping, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowAlignment);
|
|
172
|
+
return editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_6') ? layoutButtons.filter(function (item) {
|
|
173
|
+
return item.type !== 'separator';
|
|
174
|
+
}) : layoutButtons;
|
|
172
175
|
};
|
|
173
176
|
var withToolbarMetadata = function withToolbarMetadata(command) {
|
|
174
177
|
return commandWithMetadata(command, {
|
|
@@ -337,9 +340,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
337
340
|
icon: EditIcon,
|
|
338
341
|
testId: 'link-toolbar-edit-link-button',
|
|
339
342
|
onClick: getEditLinkCallback(editorAnalyticsApi, true)
|
|
340
|
-
}
|
|
343
|
+
}].concat(_toConsumableArray(fg('platform_editor_controls_patch_6') ? [] : [{
|
|
341
344
|
type: 'separator'
|
|
342
|
-
}]
|
|
345
|
+
}]), _toConsumableArray(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
343
346
|
id: 'editor.link.openLink',
|
|
344
347
|
type: 'button',
|
|
345
348
|
icon: LinkExternalIcon,
|
|
@@ -355,7 +358,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
355
358
|
if (currentAppearance === 'embed') {
|
|
356
359
|
var _pluginInjectionApi$a4;
|
|
357
360
|
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) {
|
|
361
|
+
if (alignmentOptions.length && (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6'))) {
|
|
359
362
|
alignmentOptions.push({
|
|
360
363
|
type: 'separator'
|
|
361
364
|
});
|
|
@@ -412,9 +415,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
412
415
|
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
413
416
|
});
|
|
414
417
|
}
|
|
415
|
-
}] : []), [{
|
|
418
|
+
}] : []), _toConsumableArray(fg('platform_editor_controls_patch_6') ? [] : [{
|
|
416
419
|
type: 'separator'
|
|
417
|
-
}]));
|
|
420
|
+
}])));
|
|
418
421
|
}
|
|
419
422
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
420
423
|
var hoverDecorationProps = function hoverDecorationProps(nodeType, className) {
|
|
@@ -464,9 +467,9 @@ var getUnlinkButtonGroup = function getUnlinkButtonGroup(state, intl, node, inli
|
|
|
464
467
|
icon: LinkBrokenIcon,
|
|
465
468
|
iconFallback: UnlinkIcon,
|
|
466
469
|
onClick: withToolbarMetadata(unlinkCard(node, state, editorAnalyticsApi))
|
|
467
|
-
}
|
|
470
|
+
}].concat(_toConsumableArray(fg('platform_editor_controls_patch_6') ? [] : [{
|
|
468
471
|
type: 'separator'
|
|
469
|
-
}] : [];
|
|
472
|
+
}])) : [];
|
|
470
473
|
};
|
|
471
474
|
export var getSettingsButton = function getSettingsButton(intl, editorAnalyticsApi, userPreferencesLink) {
|
|
472
475
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.19",
|
|
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.
|
|
40
|
+
"@atlaskit/editor-common": "^103.15.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,13 +54,13 @@
|
|
|
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.
|
|
57
|
+
"@atlaskit/link-datasource": "^4.6.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.
|
|
63
|
+
"@atlaskit/smart-card": "^36.9.0",
|
|
64
64
|
"@atlaskit/theme": "^18.0.0",
|
|
65
65
|
"@atlaskit/tmp-editor-statsig": "^4.13.0",
|
|
66
66
|
"@atlaskit/tokens": "^4.8.0",
|
|
@@ -122,9 +122,6 @@
|
|
|
122
122
|
"hardcoded-embeds-only-on-new-line": {
|
|
123
123
|
"type": "boolean"
|
|
124
124
|
},
|
|
125
|
-
"platform_linking_enable_transaction_filtering": {
|
|
126
|
-
"type": "boolean"
|
|
127
|
-
},
|
|
128
125
|
"linking_platform_smart_links_in_live_pages": {
|
|
129
126
|
"type": "boolean"
|
|
130
127
|
},
|