@atlaskit/editor-plugin-card 6.6.5 → 6.6.7
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 +12 -0
- package/dist/cjs/nodeviews/inlineCardWithAwareness.js +1 -1
- package/dist/cjs/ui/EditToolbarButton/EditToolbarButtonPresentation.js +3 -3
- package/dist/cjs/ui/EditToolbarButton/index.js +3 -4
- package/dist/cjs/ui/OpenButtonOverlay/index.js +1 -1
- package/dist/cjs/ui/toolbar.js +6 -7
- package/dist/es2019/nodeviews/inlineCardWithAwareness.js +1 -1
- package/dist/es2019/ui/EditToolbarButton/EditToolbarButtonPresentation.js +3 -3
- package/dist/es2019/ui/EditToolbarButton/index.js +3 -4
- package/dist/es2019/ui/OpenButtonOverlay/index.js +1 -1
- package/dist/es2019/ui/toolbar.js +6 -7
- package/dist/esm/nodeviews/inlineCardWithAwareness.js +1 -1
- package/dist/esm/ui/EditToolbarButton/EditToolbarButtonPresentation.js +3 -3
- package/dist/esm/ui/EditToolbarButton/index.js +3 -4
- package/dist/esm/ui/OpenButtonOverlay/index.js +1 -1
- package/dist/esm/ui/toolbar.js +6 -7
- package/package.json +7 -10
package/CHANGELOG.md
CHANGED
|
@@ -124,7 +124,7 @@ var InlineCardWithAwareness = exports.InlineCardWithAwareness = /*#__PURE__*/(0,
|
|
|
124
124
|
}, [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view, isPageSSRed, pluginInjectionApi]);
|
|
125
125
|
var shouldShowOpenButtonOverlay = (0, _react.useMemo)(function () {
|
|
126
126
|
var shouldShowOpenButtonOverlayInChomeless = editorAppearance === 'chromeless' && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_8');
|
|
127
|
-
return (mode === 'edit' || editorAppearance === 'comment'
|
|
127
|
+
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1');
|
|
128
128
|
}, [mode, editorAppearance]);
|
|
129
129
|
var innerCard = shouldShowOpenButtonOverlay ? innerCardWithOpenButtonOverlay : innerCardOriginal;
|
|
130
130
|
var getPosFunction = typeof getPos === 'function' ? getPos : undefined;
|
|
@@ -82,7 +82,7 @@ var EditToolbarButtonPresentation = function EditToolbarButtonPresentation(_ref)
|
|
|
82
82
|
}, !isControlsOn && (0, _react2.jsx)(_reactIntlNext.FormattedMessage
|
|
83
83
|
// Ignored via go/ees005
|
|
84
84
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
85
|
-
, _messages.linkToolbarMessages.editLink)),
|
|
85
|
+
, _messages.linkToolbarMessages.editLink)), !isControlsOn && (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
|
|
86
86
|
}
|
|
87
87
|
case 'edit-datasource':
|
|
88
88
|
{
|
|
@@ -95,7 +95,7 @@ var EditToolbarButtonPresentation = function EditToolbarButtonPresentation(_ref)
|
|
|
95
95
|
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
|
|
96
96
|
// Ignored via go/ees005
|
|
97
97
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
98
|
-
, _messages.linkToolbarMessages.editDatasourceStandalone)),
|
|
98
|
+
, _messages.linkToolbarMessages.editDatasourceStandalone)), !isControlsOn && (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
|
|
99
99
|
}
|
|
100
100
|
case 'edit-dropdown':
|
|
101
101
|
{
|
|
@@ -116,7 +116,7 @@ var EditToolbarButtonPresentation = function EditToolbarButtonPresentation(_ref)
|
|
|
116
116
|
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
|
|
117
117
|
// Ignored via go/ees005
|
|
118
118
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
119
|
-
, _messages.cardMessages.editDropdownTriggerTitle)),
|
|
119
|
+
, _messages.cardMessages.editDropdownTriggerTitle)), !isControlsOn && (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
|
|
120
120
|
return (0, _react2.jsx)(_compiled.Flex, {
|
|
121
121
|
ref: containerRef
|
|
122
122
|
}, (0, _react2.jsx)(_uiMenu.DropdownContainer, {
|
|
@@ -16,7 +16,6 @@ var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
|
16
16
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/core/migration/chevron-down"));
|
|
17
17
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
18
18
|
var _menu = require("@atlaskit/menu");
|
|
19
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
19
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
21
20
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
22
21
|
var _utils = require("../../pm-plugins/utils");
|
|
@@ -105,7 +104,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
|
|
|
105
104
|
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
|
|
106
105
|
// Ignored via go/ees005
|
|
107
106
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
108
|
-
, _messages.linkToolbarMessages.editLink)),
|
|
107
|
+
, _messages.linkToolbarMessages.editLink)), !(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
|
|
109
108
|
}
|
|
110
109
|
case 'edit-datasource':
|
|
111
110
|
{
|
|
@@ -118,7 +117,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
|
|
|
118
117
|
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
|
|
119
118
|
// Ignored via go/ees005
|
|
120
119
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
121
|
-
, _messages.linkToolbarMessages.editDatasourceStandalone)),
|
|
120
|
+
, _messages.linkToolbarMessages.editDatasourceStandalone)), !(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
|
|
122
121
|
}
|
|
123
122
|
case 'edit-dropdown':
|
|
124
123
|
{
|
|
@@ -139,7 +138,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
|
|
|
139
138
|
}, (0, _react2.jsx)(_reactIntlNext.FormattedMessage
|
|
140
139
|
// Ignored via go/ees005
|
|
141
140
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
142
|
-
, _messages.cardMessages.editDropdownTriggerTitle)),
|
|
141
|
+
, _messages.cardMessages.editDropdownTriggerTitle)), !(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') && (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null));
|
|
143
142
|
return (0, _react2.jsx)(_compiled.Flex, {
|
|
144
143
|
ref: containerRef
|
|
145
144
|
}, (0, _react2.jsx)(_uiMenu.DropdownContainer, {
|
|
@@ -200,7 +200,7 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
200
200
|
href: url,
|
|
201
201
|
target: "_blank",
|
|
202
202
|
style: {
|
|
203
|
-
paddingBlock: editorAppearance === 'comment'
|
|
203
|
+
paddingBlock: editorAppearance === 'comment' || editorAppearance === 'chromeless' && (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_8') ? '1px' : "var(--ds-space-025, 2px)"
|
|
204
204
|
},
|
|
205
205
|
onClick: handleClick
|
|
206
206
|
}, (0, _react2.jsx)(_primitives.Box, {
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -32,6 +32,7 @@ var _linkExternalShortcut = _interopRequireDefault(require("@atlaskit/icon/core/
|
|
|
32
32
|
var _settingsEditorSettings = _interopRequireDefault(require("@atlaskit/icon/core/migration/settings--editor-settings"));
|
|
33
33
|
var _settings = _interopRequireDefault(require("@atlaskit/icon/core/settings"));
|
|
34
34
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
35
|
+
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
35
36
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
36
37
|
var _doc = require("../pm-plugins/doc");
|
|
37
38
|
var _pluginKey = require("../pm-plugins/plugin-key");
|
|
@@ -195,7 +196,7 @@ var unlinkCard = function unlinkCard(node, state, editorAnalyticsApi) {
|
|
|
195
196
|
};
|
|
196
197
|
};
|
|
197
198
|
var buildAlignmentOptions = function buildAlignmentOptions(state, intl, widthPluginDependencyApi, analyticsApi, cardOptions) {
|
|
198
|
-
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')
|
|
199
|
+
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
199
200
|
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);
|
|
200
201
|
}
|
|
201
202
|
return (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);
|
|
@@ -386,9 +387,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
386
387
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
387
388
|
title: intl.formatMessage(_messages.default.remove),
|
|
388
389
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
389
|
-
}]) : [].concat(editButtonItems, (0, _toConsumableArray2.default)((
|
|
390
|
-
type: 'separator'
|
|
391
|
-
}]), (0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [_objectSpread({
|
|
390
|
+
}]) : [].concat(editButtonItems, (0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [_objectSpread({
|
|
392
391
|
id: 'editor.link.openLink',
|
|
393
392
|
type: 'button',
|
|
394
393
|
icon: _linkExternal.default,
|
|
@@ -407,7 +406,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
407
406
|
if (currentAppearance === 'embed') {
|
|
408
407
|
var _pluginInjectionApi$a4;
|
|
409
408
|
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);
|
|
410
|
-
if (alignmentOptions.length &&
|
|
409
|
+
if (alignmentOptions.length && !(0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
411
410
|
alignmentOptions.push({
|
|
412
411
|
type: 'separator'
|
|
413
412
|
});
|
|
@@ -464,7 +463,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
464
463
|
inputMethod: _analytics.INPUT_METHOD.FLOATING_TB
|
|
465
464
|
});
|
|
466
465
|
}
|
|
467
|
-
}] : []), (0, _toConsumableArray2.default)((0,
|
|
466
|
+
}] : []), (0, _toConsumableArray2.default)((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') ? [] : [{
|
|
468
467
|
type: 'separator'
|
|
469
468
|
}])));
|
|
470
469
|
}
|
|
@@ -520,7 +519,7 @@ var getUnlinkButtonGroup = function getUnlinkButtonGroup(state, intl, node, inli
|
|
|
520
519
|
icon: _linkBroken.default,
|
|
521
520
|
iconFallback: _linkBrokenEditorUnlink.default,
|
|
522
521
|
onClick: withToolbarMetadata(unlinkCard(node, state, editorAnalyticsApi))
|
|
523
|
-
}].concat((0, _toConsumableArray2.default)((0,
|
|
522
|
+
}].concat((0, _toConsumableArray2.default)((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_controls', 'cohort', 'variant1') ? [] : [{
|
|
524
523
|
type: 'separator'
|
|
525
524
|
}])) : [];
|
|
526
525
|
};
|
|
@@ -102,7 +102,7 @@ export const InlineCardWithAwareness = /*#__PURE__*/memo(({
|
|
|
102
102
|
}), [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view, isPageSSRed, pluginInjectionApi]);
|
|
103
103
|
const shouldShowOpenButtonOverlay = useMemo(() => {
|
|
104
104
|
const shouldShowOpenButtonOverlayInChomeless = editorAppearance === 'chromeless' && fg('platform_editor_controls_patch_8');
|
|
105
|
-
return (mode === 'edit' || editorAppearance === 'comment'
|
|
105
|
+
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && editorExperiment('platform_editor_controls', 'variant1');
|
|
106
106
|
}, [mode, editorAppearance]);
|
|
107
107
|
const innerCard = shouldShowOpenButtonOverlay ? innerCardWithOpenButtonOverlay : innerCardOriginal;
|
|
108
108
|
const getPosFunction = typeof getPos === 'function' ? getPos : undefined;
|
|
@@ -65,7 +65,7 @@ const EditToolbarButtonPresentation = ({
|
|
|
65
65
|
}, !isControlsOn && jsx(FormattedMessage
|
|
66
66
|
// Ignored via go/ees005
|
|
67
67
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
68
|
-
, linkToolbarMessages.editLink)),
|
|
68
|
+
, linkToolbarMessages.editLink)), !isControlsOn && jsx(Separator, null));
|
|
69
69
|
}
|
|
70
70
|
case 'edit-datasource':
|
|
71
71
|
{
|
|
@@ -78,7 +78,7 @@ const EditToolbarButtonPresentation = ({
|
|
|
78
78
|
}, jsx(FormattedMessage
|
|
79
79
|
// Ignored via go/ees005
|
|
80
80
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
81
|
-
, linkToolbarMessages.editDatasourceStandalone)),
|
|
81
|
+
, linkToolbarMessages.editDatasourceStandalone)), !isControlsOn && jsx(Separator, null));
|
|
82
82
|
}
|
|
83
83
|
case 'edit-dropdown':
|
|
84
84
|
{
|
|
@@ -99,7 +99,7 @@ const EditToolbarButtonPresentation = ({
|
|
|
99
99
|
}, jsx(FormattedMessage
|
|
100
100
|
// Ignored via go/ees005
|
|
101
101
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
102
|
-
, messages.editDropdownTriggerTitle)),
|
|
102
|
+
, messages.editDropdownTriggerTitle)), !isControlsOn && jsx(Separator, null));
|
|
103
103
|
return jsx(Flex, {
|
|
104
104
|
ref: containerRef
|
|
105
105
|
}, jsx(UiDropdown, {
|
|
@@ -13,7 +13,6 @@ import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlask
|
|
|
13
13
|
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
|
|
14
14
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
15
15
|
import { ButtonItem } from '@atlaskit/menu';
|
|
16
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
16
|
import { Flex } from '@atlaskit/primitives/compiled';
|
|
18
17
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
19
18
|
import { focusEditorView, isDatasourceConfigEditable } from '../../pm-plugins/utils';
|
|
@@ -90,7 +89,7 @@ const EditToolbarButtonWithCardContext = props => {
|
|
|
90
89
|
}, jsx(FormattedMessage
|
|
91
90
|
// Ignored via go/ees005
|
|
92
91
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
93
|
-
, linkToolbarMessages.editLink)),
|
|
92
|
+
, linkToolbarMessages.editLink)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator, null));
|
|
94
93
|
}
|
|
95
94
|
case 'edit-datasource':
|
|
96
95
|
{
|
|
@@ -103,7 +102,7 @@ const EditToolbarButtonWithCardContext = props => {
|
|
|
103
102
|
}, jsx(FormattedMessage
|
|
104
103
|
// Ignored via go/ees005
|
|
105
104
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
106
|
-
, linkToolbarMessages.editDatasourceStandalone)),
|
|
105
|
+
, linkToolbarMessages.editDatasourceStandalone)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator, null));
|
|
107
106
|
}
|
|
108
107
|
case 'edit-dropdown':
|
|
109
108
|
{
|
|
@@ -124,7 +123,7 @@ const EditToolbarButtonWithCardContext = props => {
|
|
|
124
123
|
}, jsx(FormattedMessage
|
|
125
124
|
// Ignored via go/ees005
|
|
126
125
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
127
|
-
, messages.editDropdownTriggerTitle)),
|
|
126
|
+
, messages.editDropdownTriggerTitle)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator, null));
|
|
128
127
|
return jsx(Flex, {
|
|
129
128
|
ref: containerRef
|
|
130
129
|
}, jsx(UiDropdown, {
|
|
@@ -177,7 +177,7 @@ const OpenButtonOverlay = ({
|
|
|
177
177
|
href: url,
|
|
178
178
|
target: "_blank",
|
|
179
179
|
style: {
|
|
180
|
-
paddingBlock: editorAppearance === 'comment'
|
|
180
|
+
paddingBlock: editorAppearance === 'comment' || editorAppearance === 'chromeless' && fg('platform_editor_controls_patch_8') ? '1px' : "var(--ds-space-025, 2px)"
|
|
181
181
|
},
|
|
182
182
|
onClick: handleClick
|
|
183
183
|
}, jsx(Box, {
|
|
@@ -22,6 +22,7 @@ import OpenIcon from '@atlaskit/icon/core/migration/link-external--shortcut';
|
|
|
22
22
|
import CogIcon from '@atlaskit/icon/core/migration/settings--editor-settings';
|
|
23
23
|
import SettingsIcon from '@atlaskit/icon/core/settings';
|
|
24
24
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
25
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
25
26
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
26
27
|
import { changeSelectedCardToText } from '../pm-plugins/doc';
|
|
27
28
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
@@ -191,7 +192,7 @@ const unlinkCard = (node, state, editorAnalyticsApi) => {
|
|
|
191
192
|
return () => false;
|
|
192
193
|
};
|
|
193
194
|
const buildAlignmentOptions = (state, intl, widthPluginDependencyApi, analyticsApi, cardOptions) => {
|
|
194
|
-
if (editorExperiment('platform_editor_controls', 'variant1')
|
|
195
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
195
196
|
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);
|
|
196
197
|
}
|
|
197
198
|
return 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);
|
|
@@ -380,9 +381,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
380
381
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
381
382
|
title: intl.formatMessage(commonMessages.remove),
|
|
382
383
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
383
|
-
}] : [...editButtonItems, ...(
|
|
384
|
-
type: 'separator'
|
|
385
|
-
}]), ...getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi), {
|
|
384
|
+
}] : [...editButtonItems, ...getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi), {
|
|
386
385
|
id: 'editor.link.openLink',
|
|
387
386
|
type: 'button',
|
|
388
387
|
icon: LinkExternalIcon,
|
|
@@ -402,7 +401,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
402
401
|
if (currentAppearance === 'embed') {
|
|
403
402
|
var _pluginInjectionApi$a5;
|
|
404
403
|
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);
|
|
405
|
-
if (alignmentOptions.length &&
|
|
404
|
+
if (alignmentOptions.length && !editorExperiment('platform_editor_controls', 'variant1')) {
|
|
406
405
|
alignmentOptions.push({
|
|
407
406
|
type: 'separator'
|
|
408
407
|
});
|
|
@@ -457,7 +456,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
457
456
|
editorState: state,
|
|
458
457
|
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
459
458
|
})
|
|
460
|
-
}] : []), ...(
|
|
459
|
+
}] : []), ...(expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') ? [] : [{
|
|
461
460
|
type: 'separator'
|
|
462
461
|
}]));
|
|
463
462
|
}
|
|
@@ -512,7 +511,7 @@ const getUnlinkButtonGroup = (state, intl, node, inlineCard, editorAnalyticsApi)
|
|
|
512
511
|
icon: LinkBrokenIcon,
|
|
513
512
|
iconFallback: UnlinkIcon,
|
|
514
513
|
onClick: withToolbarMetadata(unlinkCard(node, state, editorAnalyticsApi))
|
|
515
|
-
}, ...(
|
|
514
|
+
}, ...(expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') ? [] : [{
|
|
516
515
|
type: 'separator'
|
|
517
516
|
}])] : [];
|
|
518
517
|
};
|
|
@@ -115,7 +115,7 @@ export var InlineCardWithAwareness = /*#__PURE__*/memo(function (_ref) {
|
|
|
115
115
|
}, [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view, isPageSSRed, pluginInjectionApi]);
|
|
116
116
|
var shouldShowOpenButtonOverlay = useMemo(function () {
|
|
117
117
|
var shouldShowOpenButtonOverlayInChomeless = editorAppearance === 'chromeless' && fg('platform_editor_controls_patch_8');
|
|
118
|
-
return (mode === 'edit' || editorAppearance === 'comment'
|
|
118
|
+
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && editorExperiment('platform_editor_controls', 'variant1');
|
|
119
119
|
}, [mode, editorAppearance]);
|
|
120
120
|
var innerCard = shouldShowOpenButtonOverlay ? innerCardWithOpenButtonOverlay : innerCardOriginal;
|
|
121
121
|
var getPosFunction = typeof getPos === 'function' ? getPos : undefined;
|
|
@@ -74,7 +74,7 @@ var EditToolbarButtonPresentation = function EditToolbarButtonPresentation(_ref)
|
|
|
74
74
|
}, !isControlsOn && jsx(FormattedMessage
|
|
75
75
|
// Ignored via go/ees005
|
|
76
76
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
77
|
-
, linkToolbarMessages.editLink)),
|
|
77
|
+
, linkToolbarMessages.editLink)), !isControlsOn && jsx(Separator, null));
|
|
78
78
|
}
|
|
79
79
|
case 'edit-datasource':
|
|
80
80
|
{
|
|
@@ -87,7 +87,7 @@ var EditToolbarButtonPresentation = function EditToolbarButtonPresentation(_ref)
|
|
|
87
87
|
}, jsx(FormattedMessage
|
|
88
88
|
// Ignored via go/ees005
|
|
89
89
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
90
|
-
, linkToolbarMessages.editDatasourceStandalone)),
|
|
90
|
+
, linkToolbarMessages.editDatasourceStandalone)), !isControlsOn && jsx(Separator, null));
|
|
91
91
|
}
|
|
92
92
|
case 'edit-dropdown':
|
|
93
93
|
{
|
|
@@ -108,7 +108,7 @@ var EditToolbarButtonPresentation = function EditToolbarButtonPresentation(_ref)
|
|
|
108
108
|
}, jsx(FormattedMessage
|
|
109
109
|
// Ignored via go/ees005
|
|
110
110
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
111
|
-
, messages.editDropdownTriggerTitle)),
|
|
111
|
+
, messages.editDropdownTriggerTitle)), !isControlsOn && jsx(Separator, null));
|
|
112
112
|
return jsx(Flex, {
|
|
113
113
|
ref: containerRef
|
|
114
114
|
}, jsx(UiDropdown, {
|
|
@@ -16,7 +16,6 @@ import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlask
|
|
|
16
16
|
import ChevronDownIcon from '@atlaskit/icon/core/migration/chevron-down';
|
|
17
17
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
18
18
|
import { ButtonItem } from '@atlaskit/menu';
|
|
19
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
20
19
|
import { Flex } from '@atlaskit/primitives/compiled';
|
|
21
20
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
22
21
|
import { focusEditorView, isDatasourceConfigEditable } from '../../pm-plugins/utils';
|
|
@@ -99,7 +98,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
|
|
|
99
98
|
}, jsx(FormattedMessage
|
|
100
99
|
// Ignored via go/ees005
|
|
101
100
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
102
|
-
, linkToolbarMessages.editLink)),
|
|
101
|
+
, linkToolbarMessages.editLink)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator, null));
|
|
103
102
|
}
|
|
104
103
|
case 'edit-datasource':
|
|
105
104
|
{
|
|
@@ -112,7 +111,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
|
|
|
112
111
|
}, jsx(FormattedMessage
|
|
113
112
|
// Ignored via go/ees005
|
|
114
113
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
115
|
-
, linkToolbarMessages.editDatasourceStandalone)),
|
|
114
|
+
, linkToolbarMessages.editDatasourceStandalone)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator, null));
|
|
116
115
|
}
|
|
117
116
|
case 'edit-dropdown':
|
|
118
117
|
{
|
|
@@ -133,7 +132,7 @@ var EditToolbarButtonWithCardContext = function EditToolbarButtonWithCardContext
|
|
|
133
132
|
}, jsx(FormattedMessage
|
|
134
133
|
// Ignored via go/ees005
|
|
135
134
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
136
|
-
, messages.editDropdownTriggerTitle)),
|
|
135
|
+
, messages.editDropdownTriggerTitle)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator, null));
|
|
137
136
|
return jsx(Flex, {
|
|
138
137
|
ref: containerRef
|
|
139
138
|
}, jsx(UiDropdown, {
|
|
@@ -187,7 +187,7 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
187
187
|
href: url,
|
|
188
188
|
target: "_blank",
|
|
189
189
|
style: {
|
|
190
|
-
paddingBlock: editorAppearance === 'comment'
|
|
190
|
+
paddingBlock: editorAppearance === 'comment' || editorAppearance === 'chromeless' && fg('platform_editor_controls_patch_8') ? '1px' : "var(--ds-space-025, 2px)"
|
|
191
191
|
},
|
|
192
192
|
onClick: handleClick
|
|
193
193
|
}, jsx(Box, {
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -26,6 +26,7 @@ import OpenIcon from '@atlaskit/icon/core/migration/link-external--shortcut';
|
|
|
26
26
|
import CogIcon from '@atlaskit/icon/core/migration/settings--editor-settings';
|
|
27
27
|
import SettingsIcon from '@atlaskit/icon/core/settings';
|
|
28
28
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
29
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
29
30
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
30
31
|
import { changeSelectedCardToText } from '../pm-plugins/doc';
|
|
31
32
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
@@ -186,7 +187,7 @@ var unlinkCard = function unlinkCard(node, state, editorAnalyticsApi) {
|
|
|
186
187
|
};
|
|
187
188
|
};
|
|
188
189
|
var buildAlignmentOptions = function buildAlignmentOptions(state, intl, widthPluginDependencyApi, analyticsApi, cardOptions) {
|
|
189
|
-
if (editorExperiment('platform_editor_controls', 'variant1')
|
|
190
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
190
191
|
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);
|
|
191
192
|
}
|
|
192
193
|
return 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);
|
|
@@ -377,9 +378,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
377
378
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
378
379
|
title: intl.formatMessage(commonMessages.remove),
|
|
379
380
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
380
|
-
}]) : [].concat(editButtonItems, _toConsumableArray(
|
|
381
|
-
type: 'separator'
|
|
382
|
-
}]), _toConsumableArray(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [_objectSpread({
|
|
381
|
+
}]) : [].concat(editButtonItems, _toConsumableArray(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [_objectSpread({
|
|
383
382
|
id: 'editor.link.openLink',
|
|
384
383
|
type: 'button',
|
|
385
384
|
icon: LinkExternalIcon,
|
|
@@ -398,7 +397,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
398
397
|
if (currentAppearance === 'embed') {
|
|
399
398
|
var _pluginInjectionApi$a4;
|
|
400
399
|
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);
|
|
401
|
-
if (alignmentOptions.length &&
|
|
400
|
+
if (alignmentOptions.length && !editorExperiment('platform_editor_controls', 'variant1')) {
|
|
402
401
|
alignmentOptions.push({
|
|
403
402
|
type: 'separator'
|
|
404
403
|
});
|
|
@@ -455,7 +454,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
455
454
|
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
456
455
|
});
|
|
457
456
|
}
|
|
458
|
-
}] : []), _toConsumableArray(
|
|
457
|
+
}] : []), _toConsumableArray(expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') ? [] : [{
|
|
459
458
|
type: 'separator'
|
|
460
459
|
}])));
|
|
461
460
|
}
|
|
@@ -511,7 +510,7 @@ var getUnlinkButtonGroup = function getUnlinkButtonGroup(state, intl, node, inli
|
|
|
511
510
|
icon: LinkBrokenIcon,
|
|
512
511
|
iconFallback: UnlinkIcon,
|
|
513
512
|
onClick: withToolbarMetadata(unlinkCard(node, state, editorAnalyticsApi))
|
|
514
|
-
}].concat(_toConsumableArray(
|
|
513
|
+
}].concat(_toConsumableArray(expValEqualsNoExposure('platform_editor_controls', 'cohort', 'variant1') ? [] : [{
|
|
515
514
|
type: 'separator'
|
|
516
515
|
}])) : [];
|
|
517
516
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.7",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
38
38
|
"@atlaskit/button": "^23.2.0",
|
|
39
39
|
"@atlaskit/custom-steps": "^0.11.0",
|
|
40
|
-
"@atlaskit/editor-common": "^
|
|
40
|
+
"@atlaskit/editor-common": "^107.0.0",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
42
42
|
"@atlaskit/editor-plugin-base": "^3.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-connectivity": "^2.0.0",
|
|
44
44
|
"@atlaskit/editor-plugin-decorations": "^2.0.0",
|
|
45
|
-
"@atlaskit/editor-plugin-editor-disabled": "^2.
|
|
45
|
+
"@atlaskit/editor-plugin-editor-disabled": "^2.1.0",
|
|
46
46
|
"@atlaskit/editor-plugin-editor-viewmode": "^4.0.0",
|
|
47
47
|
"@atlaskit/editor-plugin-feature-flags": "^1.4.0",
|
|
48
48
|
"@atlaskit/editor-plugin-floating-toolbar": "^4.2.0",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
52
52
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
53
53
|
"@atlaskit/frontend-utilities": "^3.0.0",
|
|
54
|
-
"@atlaskit/icon": "^
|
|
54
|
+
"@atlaskit/icon": "^27.0.0",
|
|
55
55
|
"@atlaskit/link": "^3.2.0",
|
|
56
56
|
"@atlaskit/link-analytics": "^10.0.0",
|
|
57
57
|
"@atlaskit/link-client-extension": "^5.0.0",
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"@atlaskit/menu": "^8.0.0",
|
|
62
62
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
63
63
|
"@atlaskit/primitives": "^14.8.0",
|
|
64
|
-
"@atlaskit/smart-card": "^38.
|
|
64
|
+
"@atlaskit/smart-card": "^38.10.0",
|
|
65
65
|
"@atlaskit/theme": "^18.0.0",
|
|
66
|
-
"@atlaskit/tmp-editor-statsig": "^7.
|
|
67
|
-
"@atlaskit/tokens": "^5.
|
|
66
|
+
"@atlaskit/tmp-editor-statsig": "^7.1.0",
|
|
67
|
+
"@atlaskit/tokens": "^5.2.0",
|
|
68
68
|
"@babel/runtime": "^7.0.0",
|
|
69
69
|
"@emotion/react": "^11.7.1",
|
|
70
70
|
"lodash": "^4.17.21",
|
|
@@ -135,9 +135,6 @@
|
|
|
135
135
|
"platform_editor_controls_patch_5": {
|
|
136
136
|
"type": "boolean"
|
|
137
137
|
},
|
|
138
|
-
"platform_editor_controls_patch_6": {
|
|
139
|
-
"type": "boolean"
|
|
140
|
-
},
|
|
141
138
|
"platform_editor_controls_patch_9": {
|
|
142
139
|
"type": "boolean"
|
|
143
140
|
},
|