@atlaskit/editor-plugin-card 6.7.1 → 7.0.0
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
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 7.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#181024](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/181024)
|
|
8
|
+
[`8e80c487ca307`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e80c487ca307) - ##
|
|
9
|
+
Make `@atlaskit/editor-common` a peer dependency
|
|
10
|
+
|
|
11
|
+
**WHAT:** `@atlaskit/editor-common` has been moved from `dependencies` to `peerDependencies` in
|
|
12
|
+
all editor plugin packages.
|
|
13
|
+
|
|
14
|
+
**WHY:** This change ensures that only a single version of `@atlaskit/editor-common` is used in
|
|
15
|
+
consuming applications, preventing issues caused by multiple versions of singleton libraries (such
|
|
16
|
+
as context mismatches or duplicated state). This is especially important for packages that rely on
|
|
17
|
+
shared context or singletons.
|
|
18
|
+
|
|
19
|
+
**HOW TO ADJUST:**
|
|
20
|
+
|
|
21
|
+
- Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
|
|
22
|
+
any of these editor plugins.
|
|
23
|
+
- Ensure the version you install matches the version required by the plugins.
|
|
24
|
+
- You can use the
|
|
25
|
+
[`check-peer-dependencies`](https://www.npmjs.com/package/check-peer-dependencies) package to
|
|
26
|
+
verify that all required peer dependencies are installed and compatible.
|
|
27
|
+
- Example install command:
|
|
28
|
+
```
|
|
29
|
+
npm install @atlaskit/editor-common
|
|
30
|
+
```
|
|
31
|
+
or
|
|
32
|
+
```
|
|
33
|
+
yarn add @atlaskit/editor-common
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Note:** This is a breaking change. If `@atlaskit/editor-common` is not installed at the
|
|
37
|
+
application level, you may see errors or unexpected behavior.
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies
|
|
42
|
+
|
|
43
|
+
## 6.8.0
|
|
44
|
+
|
|
45
|
+
### Minor Changes
|
|
46
|
+
|
|
47
|
+
- [#180491](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/180491)
|
|
48
|
+
[`33c19072599ca`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/33c19072599ca) -
|
|
49
|
+
Tidied up smart card overlay experiment
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- Updated dependencies
|
|
54
|
+
|
|
3
55
|
## 6.7.1
|
|
4
56
|
|
|
5
57
|
### Patch Changes
|
|
@@ -14,7 +14,6 @@ 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
16
|
var _primitives = require("@atlaskit/primitives");
|
|
17
|
-
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
18
17
|
var _toolbar = require("../toolbar");
|
|
19
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
19
|
/* eslint-disable @atlaskit/design-system/no-nested-styles */
|
|
@@ -94,26 +93,6 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
94
93
|
isHovered = _useState4[0],
|
|
95
94
|
setHovered = _useState4[1];
|
|
96
95
|
var openTextWidthRef = (0, _react.useRef)(null);
|
|
97
|
-
(0, _react.useLayoutEffect)(function () {
|
|
98
|
-
if ((0, _experiments.editorExperiment)('platform_editor_smart_card_open_overlay_perf', false, {
|
|
99
|
-
exposure: true
|
|
100
|
-
})) {
|
|
101
|
-
var hiddenText = hiddenTextRef.current;
|
|
102
|
-
if (!hiddenText) {
|
|
103
|
-
openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
// Measure the width of the hidden text
|
|
107
|
-
// Temporarily make the element visible to measure its width
|
|
108
|
-
hiddenText.style.visibility = 'hidden';
|
|
109
|
-
hiddenText.style.display = 'inline';
|
|
110
|
-
openTextWidthRef.current = hiddenText.offsetWidth;
|
|
111
|
-
|
|
112
|
-
// Reset the hiddenText's display property
|
|
113
|
-
hiddenText.style.display = 'none';
|
|
114
|
-
hiddenText.style.visibility = 'inherit';
|
|
115
|
-
}
|
|
116
|
-
}, []);
|
|
117
96
|
(0, _react.useLayoutEffect)(function () {
|
|
118
97
|
var _containerRef$current, _openButtonRef$curren;
|
|
119
98
|
if (!isVisible || !isHovered) {
|
|
@@ -123,24 +102,20 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
123
102
|
var openButtonWidth = (_openButtonRef$curren = openButtonRef.current) === null || _openButtonRef$curren === void 0 ? void 0 : _openButtonRef$curren.offsetWidth;
|
|
124
103
|
|
|
125
104
|
// Get the hidden text width
|
|
126
|
-
if (
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
hiddenText.style.visibility = 'hidden';
|
|
135
|
-
hiddenText.style.display = 'inline';
|
|
136
|
-
openTextWidthRef.current = hiddenText.offsetWidth;
|
|
105
|
+
if (!openTextWidthRef.current) {
|
|
106
|
+
var hiddenText = hiddenTextRef.current;
|
|
107
|
+
if (hiddenText) {
|
|
108
|
+
// Measure the width of the hidden text
|
|
109
|
+
// Temporarily make the element visible to measure its width
|
|
110
|
+
hiddenText.style.visibility = 'hidden';
|
|
111
|
+
hiddenText.style.display = 'inline';
|
|
112
|
+
openTextWidthRef.current = hiddenText.offsetWidth;
|
|
137
113
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
114
|
+
// Reset the hiddenText's display property
|
|
115
|
+
hiddenText.style.display = 'none';
|
|
116
|
+
hiddenText.style.visibility = 'inherit';
|
|
117
|
+
} else {
|
|
118
|
+
openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
|
|
144
119
|
}
|
|
145
120
|
}
|
|
146
121
|
if (!cardWidth || !openButtonWidth) {
|
|
@@ -12,7 +12,6 @@ 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
14
|
import { Anchor, Box, Text, xcss } from '@atlaskit/primitives';
|
|
15
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
16
15
|
import { visitCardLinkAnalytics } from '../toolbar';
|
|
17
16
|
const containerStyles = css({
|
|
18
17
|
position: 'relative'
|
|
@@ -75,26 +74,6 @@ const OpenButtonOverlay = ({
|
|
|
75
74
|
const [showLabel, setShowLabel] = useState(true);
|
|
76
75
|
const [isHovered, setHovered] = useState(false);
|
|
77
76
|
const openTextWidthRef = useRef(null);
|
|
78
|
-
useLayoutEffect(() => {
|
|
79
|
-
if (editorExperiment('platform_editor_smart_card_open_overlay_perf', false, {
|
|
80
|
-
exposure: true
|
|
81
|
-
})) {
|
|
82
|
-
const hiddenText = hiddenTextRef.current;
|
|
83
|
-
if (!hiddenText) {
|
|
84
|
-
openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
// Measure the width of the hidden text
|
|
88
|
-
// Temporarily make the element visible to measure its width
|
|
89
|
-
hiddenText.style.visibility = 'hidden';
|
|
90
|
-
hiddenText.style.display = 'inline';
|
|
91
|
-
openTextWidthRef.current = hiddenText.offsetWidth;
|
|
92
|
-
|
|
93
|
-
// Reset the hiddenText's display property
|
|
94
|
-
hiddenText.style.display = 'none';
|
|
95
|
-
hiddenText.style.visibility = 'inherit';
|
|
96
|
-
}
|
|
97
|
-
}, []);
|
|
98
77
|
useLayoutEffect(() => {
|
|
99
78
|
var _containerRef$current, _openButtonRef$curren;
|
|
100
79
|
if (!isVisible || !isHovered) {
|
|
@@ -104,24 +83,20 @@ const OpenButtonOverlay = ({
|
|
|
104
83
|
const openButtonWidth = (_openButtonRef$curren = openButtonRef.current) === null || _openButtonRef$curren === void 0 ? void 0 : _openButtonRef$curren.offsetWidth;
|
|
105
84
|
|
|
106
85
|
// Get the hidden text width
|
|
107
|
-
if (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
hiddenText.style.visibility = 'hidden';
|
|
116
|
-
hiddenText.style.display = 'inline';
|
|
117
|
-
openTextWidthRef.current = hiddenText.offsetWidth;
|
|
86
|
+
if (!openTextWidthRef.current) {
|
|
87
|
+
const hiddenText = hiddenTextRef.current;
|
|
88
|
+
if (hiddenText) {
|
|
89
|
+
// Measure the width of the hidden text
|
|
90
|
+
// Temporarily make the element visible to measure its width
|
|
91
|
+
hiddenText.style.visibility = 'hidden';
|
|
92
|
+
hiddenText.style.display = 'inline';
|
|
93
|
+
openTextWidthRef.current = hiddenText.offsetWidth;
|
|
118
94
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
95
|
+
// Reset the hiddenText's display property
|
|
96
|
+
hiddenText.style.display = 'none';
|
|
97
|
+
hiddenText.style.visibility = 'inherit';
|
|
98
|
+
} else {
|
|
99
|
+
openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
|
|
125
100
|
}
|
|
126
101
|
}
|
|
127
102
|
if (!cardWidth || !openButtonWidth) {
|
|
@@ -13,7 +13,6 @@ 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
15
|
import { Anchor, Box, Text, xcss } from '@atlaskit/primitives';
|
|
16
|
-
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
17
16
|
import { visitCardLinkAnalytics } from '../toolbar';
|
|
18
17
|
var containerStyles = css({
|
|
19
18
|
position: 'relative'
|
|
@@ -81,26 +80,6 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
81
80
|
isHovered = _useState4[0],
|
|
82
81
|
setHovered = _useState4[1];
|
|
83
82
|
var openTextWidthRef = useRef(null);
|
|
84
|
-
useLayoutEffect(function () {
|
|
85
|
-
if (editorExperiment('platform_editor_smart_card_open_overlay_perf', false, {
|
|
86
|
-
exposure: true
|
|
87
|
-
})) {
|
|
88
|
-
var hiddenText = hiddenTextRef.current;
|
|
89
|
-
if (!hiddenText) {
|
|
90
|
-
openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
// Measure the width of the hidden text
|
|
94
|
-
// Temporarily make the element visible to measure its width
|
|
95
|
-
hiddenText.style.visibility = 'hidden';
|
|
96
|
-
hiddenText.style.display = 'inline';
|
|
97
|
-
openTextWidthRef.current = hiddenText.offsetWidth;
|
|
98
|
-
|
|
99
|
-
// Reset the hiddenText's display property
|
|
100
|
-
hiddenText.style.display = 'none';
|
|
101
|
-
hiddenText.style.visibility = 'inherit';
|
|
102
|
-
}
|
|
103
|
-
}, []);
|
|
104
83
|
useLayoutEffect(function () {
|
|
105
84
|
var _containerRef$current, _openButtonRef$curren;
|
|
106
85
|
if (!isVisible || !isHovered) {
|
|
@@ -110,24 +89,20 @@ var OpenButtonOverlay = function OpenButtonOverlay(_ref) {
|
|
|
110
89
|
var openButtonWidth = (_openButtonRef$curren = openButtonRef.current) === null || _openButtonRef$curren === void 0 ? void 0 : _openButtonRef$curren.offsetWidth;
|
|
111
90
|
|
|
112
91
|
// Get the hidden text width
|
|
113
|
-
if (
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
hiddenText.style.visibility = 'hidden';
|
|
122
|
-
hiddenText.style.display = 'inline';
|
|
123
|
-
openTextWidthRef.current = hiddenText.offsetWidth;
|
|
92
|
+
if (!openTextWidthRef.current) {
|
|
93
|
+
var hiddenText = hiddenTextRef.current;
|
|
94
|
+
if (hiddenText) {
|
|
95
|
+
// Measure the width of the hidden text
|
|
96
|
+
// Temporarily make the element visible to measure its width
|
|
97
|
+
hiddenText.style.visibility = 'hidden';
|
|
98
|
+
hiddenText.style.display = 'inline';
|
|
99
|
+
openTextWidthRef.current = hiddenText.offsetWidth;
|
|
124
100
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
101
|
+
// Reset the hiddenText's display property
|
|
102
|
+
hiddenText.style.display = 'none';
|
|
103
|
+
hiddenText.style.visibility = 'inherit';
|
|
104
|
+
} else {
|
|
105
|
+
openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
|
|
131
106
|
}
|
|
132
107
|
}
|
|
133
108
|
if (!cardWidth || !openButtonWidth) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -36,17 +36,16 @@
|
|
|
36
36
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
37
37
|
"@atlaskit/button": "^23.2.0",
|
|
38
38
|
"@atlaskit/custom-steps": "^0.11.0",
|
|
39
|
-
"@atlaskit/editor-
|
|
40
|
-
"@atlaskit/editor-plugin-
|
|
41
|
-
"@atlaskit/editor-plugin-
|
|
42
|
-
"@atlaskit/editor-plugin-
|
|
43
|
-
"@atlaskit/editor-plugin-
|
|
44
|
-
"@atlaskit/editor-plugin-editor-
|
|
45
|
-
"@atlaskit/editor-plugin-
|
|
46
|
-
"@atlaskit/editor-plugin-
|
|
47
|
-
"@atlaskit/editor-plugin-
|
|
48
|
-
"@atlaskit/editor-plugin-
|
|
49
|
-
"@atlaskit/editor-plugin-width": "^3.0.0",
|
|
39
|
+
"@atlaskit/editor-plugin-analytics": "^3.0.0",
|
|
40
|
+
"@atlaskit/editor-plugin-base": "^4.0.0",
|
|
41
|
+
"@atlaskit/editor-plugin-connectivity": "^3.0.0",
|
|
42
|
+
"@atlaskit/editor-plugin-decorations": "^3.0.0",
|
|
43
|
+
"@atlaskit/editor-plugin-editor-disabled": "^3.0.0",
|
|
44
|
+
"@atlaskit/editor-plugin-editor-viewmode": "^5.0.0",
|
|
45
|
+
"@atlaskit/editor-plugin-feature-flags": "^2.0.0",
|
|
46
|
+
"@atlaskit/editor-plugin-floating-toolbar": "^5.0.0",
|
|
47
|
+
"@atlaskit/editor-plugin-grid": "^3.0.0",
|
|
48
|
+
"@atlaskit/editor-plugin-width": "^4.0.0",
|
|
50
49
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
51
50
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
52
51
|
"@atlaskit/frontend-utilities": "^3.0.0",
|
|
@@ -54,15 +53,15 @@
|
|
|
54
53
|
"@atlaskit/link": "^3.2.0",
|
|
55
54
|
"@atlaskit/link-analytics": "^10.0.0",
|
|
56
55
|
"@atlaskit/link-client-extension": "^5.0.0",
|
|
57
|
-
"@atlaskit/link-datasource": "^4.
|
|
56
|
+
"@atlaskit/link-datasource": "^4.12.0",
|
|
58
57
|
"@atlaskit/linking-common": "^9.1.0",
|
|
59
58
|
"@atlaskit/linking-types": "^13.0.0",
|
|
60
59
|
"@atlaskit/menu": "^8.0.0",
|
|
61
60
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
62
61
|
"@atlaskit/primitives": "^14.10.0",
|
|
63
|
-
"@atlaskit/smart-card": "^
|
|
62
|
+
"@atlaskit/smart-card": "^39.0.0",
|
|
64
63
|
"@atlaskit/theme": "^18.0.0",
|
|
65
|
-
"@atlaskit/tmp-editor-statsig": "^8.
|
|
64
|
+
"@atlaskit/tmp-editor-statsig": "^8.7.0",
|
|
66
65
|
"@atlaskit/tokens": "^5.4.0",
|
|
67
66
|
"@babel/runtime": "^7.0.0",
|
|
68
67
|
"@emotion/react": "^11.7.1",
|
|
@@ -72,6 +71,7 @@
|
|
|
72
71
|
"uuid": "^3.1.0"
|
|
73
72
|
},
|
|
74
73
|
"peerDependencies": {
|
|
74
|
+
"@atlaskit/editor-common": "^107.6.0",
|
|
75
75
|
"@atlaskit/link-provider": "^3.4.0",
|
|
76
76
|
"react": "^18.2.0",
|
|
77
77
|
"react-intl-next": "npm:react-intl@^5.18.1"
|