@atlaskit/editor-plugin-card 6.6.7 → 6.6.9
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/nodeviews/inlineCardWithAwareness.js +1 -2
- package/dist/cjs/pm-plugins/doc.js +1 -1
- package/dist/cjs/ui/OpenButtonOverlay/index.js +6 -14
- package/dist/cjs/ui/toolbar.js +2 -2
- package/dist/es2019/nodeviews/inlineCardWithAwareness.js +1 -2
- package/dist/es2019/pm-plugins/doc.js +1 -1
- package/dist/es2019/ui/OpenButtonOverlay/index.js +6 -14
- package/dist/es2019/ui/toolbar.js +2 -2
- package/dist/esm/nodeviews/inlineCardWithAwareness.js +1 -2
- package/dist/esm/pm-plugins/doc.js +1 -1
- package/dist/esm/ui/OpenButtonOverlay/index.js +6 -14
- package/dist/esm/ui/toolbar.js +2 -2
- package/package.json +7 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 6.6.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#173379](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/173379)
|
|
8
|
+
[`99e2b882f5cf0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/99e2b882f5cf0) -
|
|
9
|
+
Clean up platform_editor_controls_patch_3
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 6.6.8
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#172583](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/172583)
|
|
17
|
+
[`40f387a0c0962`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/40f387a0c0962) -
|
|
18
|
+
Clean up platform_editor_controls_patch_2
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 6.6.7
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -10,7 +10,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
12
12
|
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
15
14
|
var _actions = require("../pm-plugins/actions");
|
|
16
15
|
var _pluginKey = require("../pm-plugins/plugin-key");
|
|
@@ -123,7 +122,7 @@ var InlineCardWithAwareness = exports.InlineCardWithAwareness = /*#__PURE__*/(0,
|
|
|
123
122
|
});
|
|
124
123
|
}, [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view, isPageSSRed, pluginInjectionApi]);
|
|
125
124
|
var shouldShowOpenButtonOverlay = (0, _react.useMemo)(function () {
|
|
126
|
-
var shouldShowOpenButtonOverlayInChomeless = editorAppearance === 'chromeless'
|
|
125
|
+
var shouldShowOpenButtonOverlayInChomeless = editorAppearance === 'chromeless';
|
|
127
126
|
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1');
|
|
128
127
|
}, [mode, editorAppearance]);
|
|
129
128
|
var innerCard = shouldShowOpenButtonOverlay ? innerCardWithOpenButtonOverlay : innerCardOriginal;
|
|
@@ -251,7 +251,7 @@ var convertHyperlinkToSmartCard = exports.convertHyperlinkToSmartCard = function
|
|
|
251
251
|
shouldReplaceLink: true
|
|
252
252
|
};
|
|
253
253
|
};
|
|
254
|
-
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')
|
|
254
|
+
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
255
255
|
var activeLinkMark = (0, _link.getActiveLinkMark)(state);
|
|
256
256
|
if (activeLinkMark) {
|
|
257
257
|
var linkMark = activeLinkMark.node.marks.find(function (mark) {
|
|
@@ -13,7 +13,6 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
13
13
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
14
14
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
15
15
|
var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
|
|
16
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
16
|
var _primitives = require("@atlaskit/primitives");
|
|
18
17
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
19
18
|
var _toolbar = require("../toolbar");
|
|
@@ -61,15 +60,13 @@ var linkStyles = (0, _primitives.xcss)({
|
|
|
61
60
|
borderRadius: "var(--ds-border-radius, 3px)",
|
|
62
61
|
color: 'color.text.subtle',
|
|
63
62
|
textDecoration: 'none',
|
|
63
|
+
whiteSpace: 'nowrap',
|
|
64
64
|
':hover': {
|
|
65
65
|
backgroundColor: 'elevation.surface.hovered',
|
|
66
66
|
color: 'color.text.subtle',
|
|
67
67
|
textDecoration: 'none'
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
|
-
var linkStylesFix = (0, _primitives.xcss)({
|
|
71
|
-
whiteSpace: 'nowrap'
|
|
72
|
-
});
|
|
73
70
|
var MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY = 45;
|
|
74
71
|
var ICON_WIDTH = 16;
|
|
75
72
|
var DEFAULT_OPEN_TEXT_WIDTH = 28; // Default open text width in English
|
|
@@ -84,7 +81,7 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
84
81
|
view = _ref.view;
|
|
85
82
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
86
83
|
formatMessage = _useIntl.formatMessage;
|
|
87
|
-
var label =
|
|
84
|
+
var label = formatMessage(_messages.cardMessages.openButtonTitle);
|
|
88
85
|
var containerRef = (0, _react.useRef)(null);
|
|
89
86
|
var openButtonRef = (0, _react.useRef)(null);
|
|
90
87
|
var hiddenTextRef = (0, _react.useRef)(null);
|
|
@@ -150,12 +147,7 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
150
147
|
return;
|
|
151
148
|
}
|
|
152
149
|
var openTextWidth = openTextWidthRef.current || DEFAULT_OPEN_TEXT_WIDTH;
|
|
153
|
-
var canShowLabel =
|
|
154
|
-
if ((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_2')) {
|
|
155
|
-
canShowLabel = cardWidth - openTextWidth > MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY + ICON_WIDTH;
|
|
156
|
-
} else {
|
|
157
|
-
canShowLabel = cardWidth - openButtonWidth > MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY;
|
|
158
|
-
}
|
|
150
|
+
var canShowLabel = cardWidth - openTextWidth > MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY + ICON_WIDTH;
|
|
159
151
|
setShowLabel(canShowLabel);
|
|
160
152
|
}, [isVisible, isHovered]);
|
|
161
153
|
var handleOverlayChange = function handleOverlayChange(isHovered) {
|
|
@@ -187,7 +179,7 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
187
179
|
onMouseLeave: function onMouseLeave() {
|
|
188
180
|
return handleOverlayChange(false);
|
|
189
181
|
}
|
|
190
|
-
}, children, (0,
|
|
182
|
+
}, children, (0, _react2.jsx)("span", {
|
|
191
183
|
css: hiddenTextStyle,
|
|
192
184
|
"aria-hidden": "true"
|
|
193
185
|
}, (0, _react2.jsx)(_primitives.Text, {
|
|
@@ -196,11 +188,11 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
196
188
|
maxLines: 1
|
|
197
189
|
}, label)), isHovered && (0, _react2.jsx)(_primitives.Anchor, {
|
|
198
190
|
ref: openButtonRef,
|
|
199
|
-
xcss:
|
|
191
|
+
xcss: linkStyles,
|
|
200
192
|
href: url,
|
|
201
193
|
target: "_blank",
|
|
202
194
|
style: {
|
|
203
|
-
paddingBlock: editorAppearance === 'comment' || editorAppearance === 'chromeless'
|
|
195
|
+
paddingBlock: editorAppearance === 'comment' || editorAppearance === 'chromeless' ? '1px' : "var(--ds-space-025, 2px)"
|
|
204
196
|
},
|
|
205
197
|
onClick: handleClick
|
|
206
198
|
}, (0, _react2.jsx)(_primitives.Box, {
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -478,7 +478,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
478
478
|
};
|
|
479
479
|
// testId is required to show focus on trigger button on ESC key press
|
|
480
480
|
// see hideOnEsc in platform/packages/editor/editor-plugin-floating-toolbar/src/ui/Dropdown.tsx
|
|
481
|
-
var testId =
|
|
481
|
+
var testId = 'card-overflow-dropdown-trigger';
|
|
482
482
|
var overflowMenuConfig = [{
|
|
483
483
|
type: 'separator',
|
|
484
484
|
fullHeight: true
|
|
@@ -672,7 +672,7 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
672
672
|
} else {
|
|
673
673
|
// testId is required to show focus on trigger button on ESC key press
|
|
674
674
|
// see hideOnEsc in platform/packages/editor/editor-plugin-floating-toolbar/src/ui/Dropdown.tsx
|
|
675
|
-
var testId =
|
|
675
|
+
var testId = 'datasource-overflow-dropdown-trigger';
|
|
676
676
|
|
|
677
677
|
// When canShowAppearanceSwitch is true, and platform_editor_controls is on, the link appearance dropdown shows, which includes a link preference button
|
|
678
678
|
// So only add the link appearance button when canShowAppearanceSwitch is false
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { memo, useCallback, useMemo, useState } from 'react';
|
|
2
2
|
import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
3
3
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
4
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
6
5
|
import { registerRemoveOverlay } from '../pm-plugins/actions';
|
|
7
6
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
@@ -101,7 +100,7 @@ export const InlineCardWithAwareness = /*#__PURE__*/memo(({
|
|
|
101
100
|
pluginInjectionApi: pluginInjectionApi
|
|
102
101
|
}), [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view, isPageSSRed, pluginInjectionApi]);
|
|
103
102
|
const shouldShowOpenButtonOverlay = useMemo(() => {
|
|
104
|
-
const shouldShowOpenButtonOverlayInChomeless = editorAppearance === 'chromeless'
|
|
103
|
+
const shouldShowOpenButtonOverlayInChomeless = editorAppearance === 'chromeless';
|
|
105
104
|
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && editorExperiment('platform_editor_controls', 'variant1');
|
|
106
105
|
}, [mode, editorAppearance]);
|
|
107
106
|
const innerCard = shouldShowOpenButtonOverlay ? innerCardWithOpenButtonOverlay : innerCardOriginal;
|
|
@@ -230,7 +230,7 @@ export const convertHyperlinkToSmartCard = (state, source, appearance, normalize
|
|
|
230
230
|
analyticsAction: ACTION.CHANGED_TYPE,
|
|
231
231
|
shouldReplaceLink: true
|
|
232
232
|
});
|
|
233
|
-
if (editorExperiment('platform_editor_controls', 'variant1')
|
|
233
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
234
234
|
const activeLinkMark = getActiveLinkMark(state);
|
|
235
235
|
if (activeLinkMark) {
|
|
236
236
|
const linkMark = activeLinkMark.node.marks.find(mark => mark.type === link);
|
|
@@ -11,7 +11,6 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
11
11
|
import { cardMessages } from '@atlaskit/editor-common/messages';
|
|
12
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
13
13
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
14
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
14
|
import { Anchor, Box, Text, xcss } from '@atlaskit/primitives';
|
|
16
15
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
17
16
|
import { visitCardLinkAnalyticsOnly } from '../toolbar';
|
|
@@ -47,15 +46,13 @@ const linkStyles = xcss({
|
|
|
47
46
|
borderRadius: "var(--ds-border-radius, 3px)",
|
|
48
47
|
color: 'color.text.subtle',
|
|
49
48
|
textDecoration: 'none',
|
|
49
|
+
whiteSpace: 'nowrap',
|
|
50
50
|
':hover': {
|
|
51
51
|
backgroundColor: 'elevation.surface.hovered',
|
|
52
52
|
color: 'color.text.subtle',
|
|
53
53
|
textDecoration: 'none'
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
|
-
const linkStylesFix = xcss({
|
|
57
|
-
whiteSpace: 'nowrap'
|
|
58
|
-
});
|
|
59
56
|
const MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY = 45;
|
|
60
57
|
const ICON_WIDTH = 16;
|
|
61
58
|
const DEFAULT_OPEN_TEXT_WIDTH = 28; // Default open text width in English
|
|
@@ -71,7 +68,7 @@ const OpenButtonOverlay = ({
|
|
|
71
68
|
const {
|
|
72
69
|
formatMessage
|
|
73
70
|
} = useIntl();
|
|
74
|
-
const label =
|
|
71
|
+
const label = formatMessage(cardMessages.openButtonTitle);
|
|
75
72
|
const containerRef = useRef(null);
|
|
76
73
|
const openButtonRef = useRef(null);
|
|
77
74
|
const hiddenTextRef = useRef(null);
|
|
@@ -131,12 +128,7 @@ const OpenButtonOverlay = ({
|
|
|
131
128
|
return;
|
|
132
129
|
}
|
|
133
130
|
const openTextWidth = openTextWidthRef.current || DEFAULT_OPEN_TEXT_WIDTH;
|
|
134
|
-
|
|
135
|
-
if (fg('platform_editor_controls_patch_2')) {
|
|
136
|
-
canShowLabel = cardWidth - openTextWidth > MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY + ICON_WIDTH;
|
|
137
|
-
} else {
|
|
138
|
-
canShowLabel = cardWidth - openButtonWidth > MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY;
|
|
139
|
-
}
|
|
131
|
+
const canShowLabel = cardWidth - openTextWidth > MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY + ICON_WIDTH;
|
|
140
132
|
setShowLabel(canShowLabel);
|
|
141
133
|
}, [isVisible, isHovered]);
|
|
142
134
|
const handleOverlayChange = isHovered => {
|
|
@@ -164,7 +156,7 @@ const OpenButtonOverlay = ({
|
|
|
164
156
|
onDoubleClick: handleDoubleClick,
|
|
165
157
|
onMouseEnter: () => handleOverlayChange(true),
|
|
166
158
|
onMouseLeave: () => handleOverlayChange(false)
|
|
167
|
-
}, children,
|
|
159
|
+
}, children, jsx("span", {
|
|
168
160
|
css: hiddenTextStyle,
|
|
169
161
|
"aria-hidden": "true"
|
|
170
162
|
}, jsx(Text, {
|
|
@@ -173,11 +165,11 @@ const OpenButtonOverlay = ({
|
|
|
173
165
|
maxLines: 1
|
|
174
166
|
}, label)), isHovered && jsx(Anchor, {
|
|
175
167
|
ref: openButtonRef,
|
|
176
|
-
xcss:
|
|
168
|
+
xcss: linkStyles,
|
|
177
169
|
href: url,
|
|
178
170
|
target: "_blank",
|
|
179
171
|
style: {
|
|
180
|
-
paddingBlock: editorAppearance === 'comment' || editorAppearance === 'chromeless'
|
|
172
|
+
paddingBlock: editorAppearance === 'comment' || editorAppearance === 'chromeless' ? '1px' : "var(--ds-space-025, 2px)"
|
|
181
173
|
},
|
|
182
174
|
onClick: handleClick
|
|
183
175
|
}, jsx(Box, {
|
|
@@ -469,7 +469,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
469
469
|
});
|
|
470
470
|
// testId is required to show focus on trigger button on ESC key press
|
|
471
471
|
// see hideOnEsc in platform/packages/editor/editor-plugin-floating-toolbar/src/ui/Dropdown.tsx
|
|
472
|
-
const testId =
|
|
472
|
+
const testId = 'card-overflow-dropdown-trigger';
|
|
473
473
|
const overflowMenuConfig = [{
|
|
474
474
|
type: 'separator',
|
|
475
475
|
fullHeight: true
|
|
@@ -665,7 +665,7 @@ const getDatasourceButtonGroup = (metadata, intl, editorAnalyticsApi, node, hove
|
|
|
665
665
|
} else {
|
|
666
666
|
// testId is required to show focus on trigger button on ESC key press
|
|
667
667
|
// see hideOnEsc in platform/packages/editor/editor-plugin-floating-toolbar/src/ui/Dropdown.tsx
|
|
668
|
-
const testId =
|
|
668
|
+
const testId = 'datasource-overflow-dropdown-trigger';
|
|
669
669
|
|
|
670
670
|
// When canShowAppearanceSwitch is true, and platform_editor_controls is on, the link appearance dropdown shows, which includes a link preference button
|
|
671
671
|
// So only add the link appearance button when canShowAppearanceSwitch is false
|
|
@@ -2,7 +2,6 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import React, { memo, useCallback, useMemo, useState } from 'react';
|
|
3
3
|
import { sharedPluginStateHookMigratorFactory, useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
4
4
|
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
6
|
import { registerRemoveOverlay } from '../pm-plugins/actions';
|
|
8
7
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
@@ -114,7 +113,7 @@ export var InlineCardWithAwareness = /*#__PURE__*/memo(function (_ref) {
|
|
|
114
113
|
});
|
|
115
114
|
}, [actionOptions, cardContext, getPos, isHovered, node, onClick, onResolve, useAlternativePreloader, view, isPageSSRed, pluginInjectionApi]);
|
|
116
115
|
var shouldShowOpenButtonOverlay = useMemo(function () {
|
|
117
|
-
var shouldShowOpenButtonOverlayInChomeless = editorAppearance === 'chromeless'
|
|
116
|
+
var shouldShowOpenButtonOverlayInChomeless = editorAppearance === 'chromeless';
|
|
118
117
|
return (mode === 'edit' || editorAppearance === 'comment' || shouldShowOpenButtonOverlayInChomeless) && editorExperiment('platform_editor_controls', 'variant1');
|
|
119
118
|
}, [mode, editorAppearance]);
|
|
120
119
|
var innerCard = shouldShowOpenButtonOverlay ? innerCardWithOpenButtonOverlay : innerCardOriginal;
|
|
@@ -245,7 +245,7 @@ export var convertHyperlinkToSmartCard = function convertHyperlinkToSmartCard(st
|
|
|
245
245
|
shouldReplaceLink: true
|
|
246
246
|
};
|
|
247
247
|
};
|
|
248
|
-
if (editorExperiment('platform_editor_controls', 'variant1')
|
|
248
|
+
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
249
249
|
var activeLinkMark = getActiveLinkMark(state);
|
|
250
250
|
if (activeLinkMark) {
|
|
251
251
|
var linkMark = activeLinkMark.node.marks.find(function (mark) {
|
|
@@ -12,7 +12,6 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
12
12
|
import { cardMessages } from '@atlaskit/editor-common/messages';
|
|
13
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
14
14
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
15
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
15
|
import { Anchor, Box, Text, xcss } from '@atlaskit/primitives';
|
|
17
16
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
18
17
|
import { visitCardLinkAnalyticsOnly } from '../toolbar';
|
|
@@ -48,15 +47,13 @@ var linkStyles = xcss({
|
|
|
48
47
|
borderRadius: "var(--ds-border-radius, 3px)",
|
|
49
48
|
color: 'color.text.subtle',
|
|
50
49
|
textDecoration: 'none',
|
|
50
|
+
whiteSpace: 'nowrap',
|
|
51
51
|
':hover': {
|
|
52
52
|
backgroundColor: 'elevation.surface.hovered',
|
|
53
53
|
color: 'color.text.subtle',
|
|
54
54
|
textDecoration: 'none'
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
-
var linkStylesFix = xcss({
|
|
58
|
-
whiteSpace: 'nowrap'
|
|
59
|
-
});
|
|
60
57
|
var MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY = 45;
|
|
61
58
|
var ICON_WIDTH = 16;
|
|
62
59
|
var DEFAULT_OPEN_TEXT_WIDTH = 28; // Default open text width in English
|
|
@@ -71,7 +68,7 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
71
68
|
view = _ref.view;
|
|
72
69
|
var _useIntl = useIntl(),
|
|
73
70
|
formatMessage = _useIntl.formatMessage;
|
|
74
|
-
var label =
|
|
71
|
+
var label = formatMessage(cardMessages.openButtonTitle);
|
|
75
72
|
var containerRef = useRef(null);
|
|
76
73
|
var openButtonRef = useRef(null);
|
|
77
74
|
var hiddenTextRef = useRef(null);
|
|
@@ -137,12 +134,7 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
137
134
|
return;
|
|
138
135
|
}
|
|
139
136
|
var openTextWidth = openTextWidthRef.current || DEFAULT_OPEN_TEXT_WIDTH;
|
|
140
|
-
var canShowLabel =
|
|
141
|
-
if (fg('platform_editor_controls_patch_2')) {
|
|
142
|
-
canShowLabel = cardWidth - openTextWidth > MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY + ICON_WIDTH;
|
|
143
|
-
} else {
|
|
144
|
-
canShowLabel = cardWidth - openButtonWidth > MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY;
|
|
145
|
-
}
|
|
137
|
+
var canShowLabel = cardWidth - openTextWidth > MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY + ICON_WIDTH;
|
|
146
138
|
setShowLabel(canShowLabel);
|
|
147
139
|
}, [isVisible, isHovered]);
|
|
148
140
|
var handleOverlayChange = function handleOverlayChange(isHovered) {
|
|
@@ -174,7 +166,7 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
174
166
|
onMouseLeave: function onMouseLeave() {
|
|
175
167
|
return handleOverlayChange(false);
|
|
176
168
|
}
|
|
177
|
-
}, children,
|
|
169
|
+
}, children, jsx("span", {
|
|
178
170
|
css: hiddenTextStyle,
|
|
179
171
|
"aria-hidden": "true"
|
|
180
172
|
}, jsx(Text, {
|
|
@@ -183,11 +175,11 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
183
175
|
maxLines: 1
|
|
184
176
|
}, label)), isHovered && jsx(Anchor, {
|
|
185
177
|
ref: openButtonRef,
|
|
186
|
-
xcss:
|
|
178
|
+
xcss: linkStyles,
|
|
187
179
|
href: url,
|
|
188
180
|
target: "_blank",
|
|
189
181
|
style: {
|
|
190
|
-
paddingBlock: editorAppearance === 'comment' || editorAppearance === 'chromeless'
|
|
182
|
+
paddingBlock: editorAppearance === 'comment' || editorAppearance === 'chromeless' ? '1px' : "var(--ds-space-025, 2px)"
|
|
191
183
|
},
|
|
192
184
|
onClick: handleClick
|
|
193
185
|
}, jsx(Box, {
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -469,7 +469,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
469
469
|
};
|
|
470
470
|
// testId is required to show focus on trigger button on ESC key press
|
|
471
471
|
// see hideOnEsc in platform/packages/editor/editor-plugin-floating-toolbar/src/ui/Dropdown.tsx
|
|
472
|
-
var testId =
|
|
472
|
+
var testId = 'card-overflow-dropdown-trigger';
|
|
473
473
|
var overflowMenuConfig = [{
|
|
474
474
|
type: 'separator',
|
|
475
475
|
fullHeight: true
|
|
@@ -663,7 +663,7 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
663
663
|
} else {
|
|
664
664
|
// testId is required to show focus on trigger button on ESC key press
|
|
665
665
|
// see hideOnEsc in platform/packages/editor/editor-plugin-floating-toolbar/src/ui/Dropdown.tsx
|
|
666
|
-
var testId =
|
|
666
|
+
var testId = 'datasource-overflow-dropdown-trigger';
|
|
667
667
|
|
|
668
668
|
// When canShowAppearanceSwitch is true, and platform_editor_controls is on, the link appearance dropdown shows, which includes a link preference button
|
|
669
669
|
// So only add the link appearance button when canShowAppearanceSwitch is false
|
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.9",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -56,15 +56,15 @@
|
|
|
56
56
|
"@atlaskit/link-analytics": "^10.0.0",
|
|
57
57
|
"@atlaskit/link-client-extension": "^5.0.0",
|
|
58
58
|
"@atlaskit/link-datasource": "^4.11.0",
|
|
59
|
-
"@atlaskit/linking-common": "^9.
|
|
60
|
-
"@atlaskit/linking-types": "^12.
|
|
59
|
+
"@atlaskit/linking-common": "^9.1.0",
|
|
60
|
+
"@atlaskit/linking-types": "^12.1.0",
|
|
61
61
|
"@atlaskit/menu": "^8.0.0",
|
|
62
62
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
63
|
-
"@atlaskit/primitives": "^14.
|
|
64
|
-
"@atlaskit/smart-card": "^38.
|
|
63
|
+
"@atlaskit/primitives": "^14.9.0",
|
|
64
|
+
"@atlaskit/smart-card": "^38.12.0",
|
|
65
65
|
"@atlaskit/theme": "^18.0.0",
|
|
66
|
-
"@atlaskit/tmp-editor-statsig": "^7.
|
|
67
|
-
"@atlaskit/tokens": "^5.
|
|
66
|
+
"@atlaskit/tmp-editor-statsig": "^7.2.0",
|
|
67
|
+
"@atlaskit/tokens": "^5.3.0",
|
|
68
68
|
"@babel/runtime": "^7.0.0",
|
|
69
69
|
"@emotion/react": "^11.7.1",
|
|
70
70
|
"lodash": "^4.17.21",
|
|
@@ -126,15 +126,6 @@
|
|
|
126
126
|
"platform_ssr_smartlinks_editor": {
|
|
127
127
|
"type": "boolean"
|
|
128
128
|
},
|
|
129
|
-
"platform_editor_controls_patch_2": {
|
|
130
|
-
"type": "boolean"
|
|
131
|
-
},
|
|
132
|
-
"platform_editor_controls_patch_3": {
|
|
133
|
-
"type": "boolean"
|
|
134
|
-
},
|
|
135
|
-
"platform_editor_controls_patch_5": {
|
|
136
|
-
"type": "boolean"
|
|
137
|
-
},
|
|
138
129
|
"platform_editor_controls_patch_9": {
|
|
139
130
|
"type": "boolean"
|
|
140
131
|
},
|
|
@@ -147,9 +138,6 @@
|
|
|
147
138
|
"platform_editor_fix_advanced_code_crash": {
|
|
148
139
|
"type": "boolean"
|
|
149
140
|
},
|
|
150
|
-
"platform_editor_controls_patch_8": {
|
|
151
|
-
"type": "boolean"
|
|
152
|
-
},
|
|
153
141
|
"prompt_whiteboard_competitor_link_gate": {
|
|
154
142
|
"type": "boolean"
|
|
155
143
|
},
|