@atlaskit/editor-plugin-card 5.4.16 → 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 +27 -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 +15 -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 +14 -9
- package/dist/esm/pm-plugins/main.js +6 -10
- package/dist/esm/ui/EditToolbarButton/index.js +4 -3
- package/dist/esm/ui/toolbar.js +16 -9
- package/package.json +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
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
|
+
|
|
21
|
+
## 5.4.17
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#144829](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/144829)
|
|
26
|
+
[`14b488c2295de`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/14b488c2295de) -
|
|
27
|
+
[ux] ED27537 Update alignment dropdown in media and embed card floating toolbar
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
|
|
3
30
|
## 5.4.16
|
|
4
31
|
|
|
5
32
|
### 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
|
@@ -31,6 +31,7 @@ var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove
|
|
|
31
31
|
var _settings2 = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/settings"));
|
|
32
32
|
var _unlink = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/unlink"));
|
|
33
33
|
var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"));
|
|
34
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
34
35
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
35
36
|
var _doc = require("../pm-plugins/doc");
|
|
36
37
|
var _pluginKey = require("../pm-plugins/plugin-key");
|
|
@@ -174,7 +175,13 @@ var unlinkCard = function unlinkCard(node, state, editorAnalyticsApi) {
|
|
|
174
175
|
};
|
|
175
176
|
};
|
|
176
177
|
var buildAlignmentOptions = function buildAlignmentOptions(state, intl, widthPluginDependencyApi, analyticsApi, cardOptions) {
|
|
177
|
-
|
|
178
|
+
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6')) {
|
|
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
|
+
}
|
|
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;
|
|
178
185
|
};
|
|
179
186
|
var withToolbarMetadata = function withToolbarMetadata(command) {
|
|
180
187
|
return (0, _card.commandWithMetadata)(command, {
|
|
@@ -343,9 +350,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
343
350
|
icon: _edit.default,
|
|
344
351
|
testId: 'link-toolbar-edit-link-button',
|
|
345
352
|
onClick: (0, _EditLinkToolbar.getEditLinkCallback)(editorAnalyticsApi, true)
|
|
346
|
-
}, {
|
|
353
|
+
}].concat((0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6') ? [] : [{
|
|
347
354
|
type: 'separator'
|
|
348
|
-
}]
|
|
355
|
+
}]), (0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
349
356
|
id: 'editor.link.openLink',
|
|
350
357
|
type: 'button',
|
|
351
358
|
icon: _linkExternal.default,
|
|
@@ -361,7 +368,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
361
368
|
if (currentAppearance === 'embed') {
|
|
362
369
|
var _pluginInjectionApi$a4;
|
|
363
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);
|
|
364
|
-
if (alignmentOptions.length) {
|
|
371
|
+
if (alignmentOptions.length && (!(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') || !(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6'))) {
|
|
365
372
|
alignmentOptions.push({
|
|
366
373
|
type: 'separator'
|
|
367
374
|
});
|
|
@@ -418,9 +425,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
418
425
|
inputMethod: _analytics.INPUT_METHOD.FLOATING_TB
|
|
419
426
|
});
|
|
420
427
|
}
|
|
421
|
-
}] : []), [{
|
|
428
|
+
}] : []), (0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6') ? [] : [{
|
|
422
429
|
type: 'separator'
|
|
423
|
-
}]));
|
|
430
|
+
}])));
|
|
424
431
|
}
|
|
425
432
|
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
426
433
|
var hoverDecorationProps = function hoverDecorationProps(nodeType, className) {
|
|
@@ -470,9 +477,9 @@ var getUnlinkButtonGroup = function getUnlinkButtonGroup(state, intl, node, inli
|
|
|
470
477
|
icon: _linkBroken.default,
|
|
471
478
|
iconFallback: _unlink.default,
|
|
472
479
|
onClick: withToolbarMetadata(unlinkCard(node, state, editorAnalyticsApi))
|
|
473
|
-
}, {
|
|
480
|
+
}].concat((0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_6') ? [] : [{
|
|
474
481
|
type: 'separator'
|
|
475
|
-
}] : [];
|
|
482
|
+
}])) : [];
|
|
476
483
|
};
|
|
477
484
|
var getSettingsButton = exports.getSettingsButton = function getSettingsButton(intl, editorAnalyticsApi, userPreferencesLink) {
|
|
478
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, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID as ACTION_SUBJECTID, buildOpenedSettingsPayload, buildVisitedLinkPayload, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { buildLayoutButtons, commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
4
|
+
import { buildLayoutButtons, buildLayoutDropdown, commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
5
5
|
import { getLinkPreferencesURLFromENV } from '@atlaskit/editor-common/link';
|
|
6
6
|
import commonMessages, { annotationMessages, linkMessages, linkToolbarMessages, cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
7
7
|
import { FLOATING_TOOLBAR_LINKPICKER_CLASSNAME, richMediaClassName } from '@atlaskit/editor-common/styles';
|
|
@@ -21,6 +21,7 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
|
21
21
|
import CogIcon from '@atlaskit/icon/glyph/editor/settings';
|
|
22
22
|
import UnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
|
|
23
23
|
import OpenIcon from '@atlaskit/icon/glyph/shortcut';
|
|
24
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
24
25
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
25
26
|
import { changeSelectedCardToText } from '../pm-plugins/doc';
|
|
26
27
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
@@ -167,7 +168,11 @@ const unlinkCard = (node, state, editorAnalyticsApi) => {
|
|
|
167
168
|
return () => false;
|
|
168
169
|
};
|
|
169
170
|
const buildAlignmentOptions = (state, intl, widthPluginDependencyApi, analyticsApi, cardOptions) => {
|
|
170
|
-
|
|
171
|
+
if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_6')) {
|
|
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
|
+
}
|
|
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;
|
|
171
176
|
};
|
|
172
177
|
const withToolbarMetadata = command => commandWithMetadata(command, {
|
|
173
178
|
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
@@ -335,9 +340,9 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
335
340
|
icon: EditIcon,
|
|
336
341
|
testId: 'link-toolbar-edit-link-button',
|
|
337
342
|
onClick: getEditLinkCallback(editorAnalyticsApi, true)
|
|
338
|
-
}, {
|
|
343
|
+
}, ...(fg('platform_editor_controls_patch_6') ? [] : [{
|
|
339
344
|
type: 'separator'
|
|
340
|
-
}, ...getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi), {
|
|
345
|
+
}]), ...getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi), {
|
|
341
346
|
id: 'editor.link.openLink',
|
|
342
347
|
type: 'button',
|
|
343
348
|
icon: LinkExternalIcon,
|
|
@@ -353,7 +358,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
353
358
|
if (currentAppearance === 'embed') {
|
|
354
359
|
var _pluginInjectionApi$a5;
|
|
355
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);
|
|
356
|
-
if (alignmentOptions.length) {
|
|
361
|
+
if (alignmentOptions.length && (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6'))) {
|
|
357
362
|
alignmentOptions.push({
|
|
358
363
|
type: 'separator'
|
|
359
364
|
});
|
|
@@ -408,9 +413,9 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
408
413
|
editorState: state,
|
|
409
414
|
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
410
415
|
})
|
|
411
|
-
}] : []), {
|
|
416
|
+
}] : []), ...(fg('platform_editor_controls_patch_6') ? [] : [{
|
|
412
417
|
type: 'separator'
|
|
413
|
-
});
|
|
418
|
+
}]));
|
|
414
419
|
}
|
|
415
420
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
416
421
|
const hoverDecorationProps = (nodeType, className) => ({
|
|
@@ -459,9 +464,9 @@ const getUnlinkButtonGroup = (state, intl, node, inlineCard, editorAnalyticsApi)
|
|
|
459
464
|
icon: LinkBrokenIcon,
|
|
460
465
|
iconFallback: UnlinkIcon,
|
|
461
466
|
onClick: withToolbarMetadata(unlinkCard(node, state, editorAnalyticsApi))
|
|
462
|
-
}, {
|
|
467
|
+
}, ...(fg('platform_editor_controls_patch_6') ? [] : [{
|
|
463
468
|
type: 'separator'
|
|
464
|
-
}] : [];
|
|
469
|
+
}])] : [];
|
|
465
470
|
};
|
|
466
471
|
export const getSettingsButton = (intl, editorAnalyticsApi, userPreferencesLink) => {
|
|
467
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
|
@@ -5,7 +5,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
7
7
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID as ACTION_SUBJECTID, buildOpenedSettingsPayload, buildVisitedLinkPayload, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
8
|
-
import { buildLayoutButtons, commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
8
|
+
import { buildLayoutButtons, buildLayoutDropdown, commandWithMetadata } from '@atlaskit/editor-common/card';
|
|
9
9
|
import { getLinkPreferencesURLFromENV } from '@atlaskit/editor-common/link';
|
|
10
10
|
import commonMessages, { annotationMessages, linkMessages, linkToolbarMessages, cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
import { FLOATING_TOOLBAR_LINKPICKER_CLASSNAME, richMediaClassName } from '@atlaskit/editor-common/styles';
|
|
@@ -25,6 +25,7 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
|
25
25
|
import CogIcon from '@atlaskit/icon/glyph/editor/settings';
|
|
26
26
|
import UnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
|
|
27
27
|
import OpenIcon from '@atlaskit/icon/glyph/shortcut';
|
|
28
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
28
29
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
29
30
|
import { changeSelectedCardToText } from '../pm-plugins/doc';
|
|
30
31
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
@@ -164,7 +165,13 @@ var unlinkCard = function unlinkCard(node, state, editorAnalyticsApi) {
|
|
|
164
165
|
};
|
|
165
166
|
};
|
|
166
167
|
var buildAlignmentOptions = function buildAlignmentOptions(state, intl, widthPluginDependencyApi, analyticsApi, cardOptions) {
|
|
167
|
-
|
|
168
|
+
if (editorExperiment('platform_editor_controls', 'variant1') && fg('platform_editor_controls_patch_6')) {
|
|
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
|
+
}
|
|
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;
|
|
168
175
|
};
|
|
169
176
|
var withToolbarMetadata = function withToolbarMetadata(command) {
|
|
170
177
|
return commandWithMetadata(command, {
|
|
@@ -333,9 +340,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
333
340
|
icon: EditIcon,
|
|
334
341
|
testId: 'link-toolbar-edit-link-button',
|
|
335
342
|
onClick: getEditLinkCallback(editorAnalyticsApi, true)
|
|
336
|
-
}
|
|
343
|
+
}].concat(_toConsumableArray(fg('platform_editor_controls_patch_6') ? [] : [{
|
|
337
344
|
type: 'separator'
|
|
338
|
-
}]
|
|
345
|
+
}]), _toConsumableArray(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
339
346
|
id: 'editor.link.openLink',
|
|
340
347
|
type: 'button',
|
|
341
348
|
icon: LinkExternalIcon,
|
|
@@ -351,7 +358,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
351
358
|
if (currentAppearance === 'embed') {
|
|
352
359
|
var _pluginInjectionApi$a4;
|
|
353
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);
|
|
354
|
-
if (alignmentOptions.length) {
|
|
361
|
+
if (alignmentOptions.length && (!editorExperiment('platform_editor_controls', 'variant1') || !fg('platform_editor_controls_patch_6'))) {
|
|
355
362
|
alignmentOptions.push({
|
|
356
363
|
type: 'separator'
|
|
357
364
|
});
|
|
@@ -408,9 +415,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
408
415
|
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
409
416
|
});
|
|
410
417
|
}
|
|
411
|
-
}] : []), [{
|
|
418
|
+
}] : []), _toConsumableArray(fg('platform_editor_controls_patch_6') ? [] : [{
|
|
412
419
|
type: 'separator'
|
|
413
|
-
}]));
|
|
420
|
+
}])));
|
|
414
421
|
}
|
|
415
422
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
416
423
|
var hoverDecorationProps = function hoverDecorationProps(nodeType, className) {
|
|
@@ -460,9 +467,9 @@ var getUnlinkButtonGroup = function getUnlinkButtonGroup(state, intl, node, inli
|
|
|
460
467
|
icon: LinkBrokenIcon,
|
|
461
468
|
iconFallback: UnlinkIcon,
|
|
462
469
|
onClick: withToolbarMetadata(unlinkCard(node, state, editorAnalyticsApi))
|
|
463
|
-
}
|
|
470
|
+
}].concat(_toConsumableArray(fg('platform_editor_controls_patch_6') ? [] : [{
|
|
464
471
|
type: 'separator'
|
|
465
|
-
}] : [];
|
|
472
|
+
}])) : [];
|
|
466
473
|
};
|
|
467
474
|
export var getSettingsButton = function getSettingsButton(intl, editorAnalyticsApi, userPreferencesLink) {
|
|
468
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,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.
|
|
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
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
65
|
+
"@atlaskit/tmp-editor-statsig": "^4.13.0",
|
|
66
66
|
"@atlaskit/tokens": "^4.8.0",
|
|
67
67
|
"@babel/runtime": "^7.0.0",
|
|
68
68
|
"@emotion/react": "^11.7.1",
|
|
@@ -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
|
},
|