@atlaskit/editor-plugin-card 5.4.3 → 5.4.5
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 +14 -0
- package/dist/cjs/ui/AwarenessWrapper/index.js +15 -11
- package/dist/cjs/ui/toolbar.js +1 -2
- package/dist/es2019/ui/AwarenessWrapper/index.js +11 -7
- package/dist/es2019/ui/toolbar.js +1 -2
- package/dist/esm/ui/AwarenessWrapper/index.js +15 -11
- package/dist/esm/ui/toolbar.js +1 -2
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 5.4.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 5.4.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#132051](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/132051)
|
|
14
|
+
[`d4b3a24694bb8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d4b3a24694bb8) -
|
|
15
|
+
[ux] [ED-27252] Hide open link overlay in editor view mode
|
|
16
|
+
|
|
3
17
|
## 5.4.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -9,6 +9,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
13
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
13
14
|
var _utils = require("../../pm-plugins/utils");
|
|
14
15
|
var _useLinkUpgradeDiscoverability = _interopRequireDefault(require("../hooks/useLinkUpgradeDiscoverability"));
|
|
@@ -102,17 +103,20 @@ var AwarenessWrapper = exports.AwarenessWrapper = function AwarenessWrapper(_ref
|
|
|
102
103
|
return children;
|
|
103
104
|
}, [shouldShowLinkOverlay, children, isSelected, isResolvedViewRendered, isInserted, isHovered, url, handleOverlayChange]);
|
|
104
105
|
var cardWithOpenButtonOverlay = (0, _react.useMemo)(function () {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
106
|
+
if (shouldShowLinkOverlay || !(0, _platformFeatureFlags.fg)('platform_editor_controls_patch_1')) {
|
|
107
|
+
return (0, _react2.jsx)(_OpenButtonOverlay.default, {
|
|
108
|
+
isVisible: isResolvedViewRendered && isHovered,
|
|
109
|
+
onMouseEnter: function onMouseEnter() {
|
|
110
|
+
return handleOverlayChange(true);
|
|
111
|
+
},
|
|
112
|
+
onMouseLeave: function onMouseLeave() {
|
|
113
|
+
return handleOverlayChange(false);
|
|
114
|
+
},
|
|
115
|
+
url: url
|
|
116
|
+
}, children);
|
|
117
|
+
}
|
|
118
|
+
return children;
|
|
119
|
+
}, [children, isHovered, url, handleOverlayChange, isResolvedViewRendered, shouldShowLinkOverlay]);
|
|
116
120
|
var isInline = appearance === 'inline';
|
|
117
121
|
return (0, _react.useMemo)(function () {
|
|
118
122
|
var _cardContext$value;
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -30,7 +30,6 @@ var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove
|
|
|
30
30
|
var _settings2 = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/settings"));
|
|
31
31
|
var _unlink = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/unlink"));
|
|
32
32
|
var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"));
|
|
33
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
34
33
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
35
34
|
var _doc = require("../pm-plugins/doc");
|
|
36
35
|
var _pluginKey = require("../pm-plugins/plugin-key");
|
|
@@ -225,7 +224,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
225
224
|
var activeCommentMark = node.marks.find(function (mark) {
|
|
226
225
|
return mark.type.name === 'annotation' && (annotationApiState === null || annotationApiState === void 0 ? void 0 : annotationApiState.annotations[mark.attrs.id]) === false;
|
|
227
226
|
});
|
|
228
|
-
var isCommentEnabled = annotationApiState && annotationApiState.isVisible && !annotationApiState.bookmark && !annotationApiState.mouseData.isSelecting && !activeCommentMark && node.type === state.schema.nodes.inlineCard
|
|
227
|
+
var isCommentEnabled = annotationApiState && annotationApiState.isVisible && !annotationApiState.bookmark && !annotationApiState.mouseData.isSelecting && !activeCommentMark && node.type === state.schema.nodes.inlineCard;
|
|
229
228
|
var onCommentButtonClick = function onCommentButtonClick(state, dispatch) {
|
|
230
229
|
var _pluginInjectionApi$a3;
|
|
231
230
|
if (!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.annotation) || !isCommentEnabled) {
|
|
@@ -7,6 +7,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
10
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
11
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
11
12
|
import { getResolvedAttributesFromStore } from '../../pm-plugins/utils';
|
|
12
13
|
import useLinkUpgradeDiscoverability from '../hooks/useLinkUpgradeDiscoverability';
|
|
@@ -88,13 +89,16 @@ export const AwarenessWrapper = ({
|
|
|
88
89
|
return children;
|
|
89
90
|
}, [shouldShowLinkOverlay, children, isSelected, isResolvedViewRendered, isInserted, isHovered, url, handleOverlayChange]);
|
|
90
91
|
const cardWithOpenButtonOverlay = useMemo(() => {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
if (shouldShowLinkOverlay || !fg('platform_editor_controls_patch_1')) {
|
|
93
|
+
return jsx(OpenButtonOverlay, {
|
|
94
|
+
isVisible: isResolvedViewRendered && isHovered,
|
|
95
|
+
onMouseEnter: () => handleOverlayChange(true),
|
|
96
|
+
onMouseLeave: () => handleOverlayChange(false),
|
|
97
|
+
url: url
|
|
98
|
+
}, children);
|
|
99
|
+
}
|
|
100
|
+
return children;
|
|
101
|
+
}, [children, isHovered, url, handleOverlayChange, isResolvedViewRendered, shouldShowLinkOverlay]);
|
|
98
102
|
const isInline = appearance === 'inline';
|
|
99
103
|
return useMemo(() => {
|
|
100
104
|
var _cardContext$value;
|
|
@@ -20,7 +20,6 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
|
20
20
|
import CogIcon from '@atlaskit/icon/glyph/editor/settings';
|
|
21
21
|
import UnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
|
|
22
22
|
import OpenIcon from '@atlaskit/icon/glyph/shortcut';
|
|
23
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
24
23
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
25
24
|
import { changeSelectedCardToText } from '../pm-plugins/doc';
|
|
26
25
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
@@ -215,7 +214,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
215
214
|
const pluginState = pluginKey.getState(state);
|
|
216
215
|
const annotationApiState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.annotation) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.sharedState.currentState();
|
|
217
216
|
const activeCommentMark = node.marks.find(mark => mark.type.name === 'annotation' && (annotationApiState === null || annotationApiState === void 0 ? void 0 : annotationApiState.annotations[mark.attrs.id]) === false);
|
|
218
|
-
const isCommentEnabled = annotationApiState && annotationApiState.isVisible && !annotationApiState.bookmark && !annotationApiState.mouseData.isSelecting && !activeCommentMark && node.type === state.schema.nodes.inlineCard
|
|
217
|
+
const isCommentEnabled = annotationApiState && annotationApiState.isVisible && !annotationApiState.bookmark && !annotationApiState.mouseData.isSelecting && !activeCommentMark && node.type === state.schema.nodes.inlineCard;
|
|
219
218
|
const onCommentButtonClick = (state, dispatch) => {
|
|
220
219
|
var _pluginInjectionApi$a3, _pluginInjectionApi$a4;
|
|
221
220
|
if (!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.annotation) || !isCommentEnabled) {
|
|
@@ -8,6 +8,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
12
13
|
import { getResolvedAttributesFromStore } from '../../pm-plugins/utils';
|
|
13
14
|
import useLinkUpgradeDiscoverability from '../hooks/useLinkUpgradeDiscoverability';
|
|
@@ -94,17 +95,20 @@ export var AwarenessWrapper = function AwarenessWrapper(_ref) {
|
|
|
94
95
|
return children;
|
|
95
96
|
}, [shouldShowLinkOverlay, children, isSelected, isResolvedViewRendered, isInserted, isHovered, url, handleOverlayChange]);
|
|
96
97
|
var cardWithOpenButtonOverlay = useMemo(function () {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
98
|
+
if (shouldShowLinkOverlay || !fg('platform_editor_controls_patch_1')) {
|
|
99
|
+
return jsx(OpenButtonOverlay, {
|
|
100
|
+
isVisible: isResolvedViewRendered && isHovered,
|
|
101
|
+
onMouseEnter: function onMouseEnter() {
|
|
102
|
+
return handleOverlayChange(true);
|
|
103
|
+
},
|
|
104
|
+
onMouseLeave: function onMouseLeave() {
|
|
105
|
+
return handleOverlayChange(false);
|
|
106
|
+
},
|
|
107
|
+
url: url
|
|
108
|
+
}, children);
|
|
109
|
+
}
|
|
110
|
+
return children;
|
|
111
|
+
}, [children, isHovered, url, handleOverlayChange, isResolvedViewRendered, shouldShowLinkOverlay]);
|
|
108
112
|
var isInline = appearance === 'inline';
|
|
109
113
|
return useMemo(function () {
|
|
110
114
|
var _cardContext$value;
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -24,7 +24,6 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
|
24
24
|
import CogIcon from '@atlaskit/icon/glyph/editor/settings';
|
|
25
25
|
import UnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
|
|
26
26
|
import OpenIcon from '@atlaskit/icon/glyph/shortcut';
|
|
27
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
28
27
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
29
28
|
import { changeSelectedCardToText } from '../pm-plugins/doc';
|
|
30
29
|
import { pluginKey } from '../pm-plugins/plugin-key';
|
|
@@ -215,7 +214,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
215
214
|
var activeCommentMark = node.marks.find(function (mark) {
|
|
216
215
|
return mark.type.name === 'annotation' && (annotationApiState === null || annotationApiState === void 0 ? void 0 : annotationApiState.annotations[mark.attrs.id]) === false;
|
|
217
216
|
});
|
|
218
|
-
var isCommentEnabled = annotationApiState && annotationApiState.isVisible && !annotationApiState.bookmark && !annotationApiState.mouseData.isSelecting && !activeCommentMark && node.type === state.schema.nodes.inlineCard
|
|
217
|
+
var isCommentEnabled = annotationApiState && annotationApiState.isVisible && !annotationApiState.bookmark && !annotationApiState.mouseData.isSelecting && !activeCommentMark && node.type === state.schema.nodes.inlineCard;
|
|
219
218
|
var onCommentButtonClick = function onCommentButtonClick(state, dispatch) {
|
|
220
219
|
var _pluginInjectionApi$a3;
|
|
221
220
|
if (!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.annotation) || !isCommentEnabled) {
|
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.5",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
37
37
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
38
|
-
"@atlaskit/button": "^
|
|
38
|
+
"@atlaskit/button": "^22.0.0",
|
|
39
39
|
"@atlaskit/custom-steps": "^0.11.0",
|
|
40
40
|
"@atlaskit/editor-common": "^102.13.0",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^2.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": "^25.
|
|
54
|
+
"@atlaskit/icon": "^25.2.0",
|
|
55
55
|
"@atlaskit/link-analytics": "^9.1.0",
|
|
56
56
|
"@atlaskit/link-client-extension": "^4.0.0",
|
|
57
57
|
"@atlaskit/link-datasource": "^4.1.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@atlaskit/menu": "^3.1.0",
|
|
61
61
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
62
62
|
"@atlaskit/primitives": "^14.2.0",
|
|
63
|
-
"@atlaskit/smart-card": "^36.
|
|
63
|
+
"@atlaskit/smart-card": "^36.2.0",
|
|
64
64
|
"@atlaskit/theme": "^18.0.0",
|
|
65
65
|
"@atlaskit/tmp-editor-statsig": "^4.4.0",
|
|
66
66
|
"@atlaskit/tokens": "^4.5.0",
|
|
@@ -131,9 +131,6 @@
|
|
|
131
131
|
"platform_editor_ssr_fix_smartlinks": {
|
|
132
132
|
"type": "boolean"
|
|
133
133
|
},
|
|
134
|
-
"platform_inline_node_as_valid_annotation_selection": {
|
|
135
|
-
"type": "boolean"
|
|
136
|
-
},
|
|
137
134
|
"platform_editor_fix_card_plugin_state": {
|
|
138
135
|
"type": "boolean"
|
|
139
136
|
},
|
|
@@ -148,6 +145,9 @@
|
|
|
148
145
|
},
|
|
149
146
|
"platform_ssr_smartlinks_editor": {
|
|
150
147
|
"type": "boolean"
|
|
148
|
+
},
|
|
149
|
+
"platform_editor_controls_patch_1": {
|
|
150
|
+
"type": "boolean"
|
|
151
151
|
}
|
|
152
152
|
},
|
|
153
153
|
"stricter": {
|