@atlaskit/editor-plugin-card 2.4.0 → 2.4.2
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 +15 -0
- package/dist/cjs/ui/InlineCardOverlay/index.js +10 -10
- package/dist/cjs/ui/LeftIconOverlay/index.js +6 -6
- package/dist/es2019/ui/InlineCardOverlay/index.js +1 -1
- package/dist/es2019/ui/LeftIconOverlay/index.js +1 -1
- package/dist/esm/ui/InlineCardOverlay/index.js +1 -1
- package/dist/esm/ui/LeftIconOverlay/index.js +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 2.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#117973](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117973)
|
|
8
|
+
[`6e37bac62083f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6e37bac62083f) -
|
|
9
|
+
moved one const, added new entry point for other and deprecated
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 2.4.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 2.4.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
|
@@ -15,10 +15,10 @@ var _react2 = require("@emotion/react");
|
|
|
15
15
|
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
16
16
|
var _reactIntlNext = require("react-intl-next");
|
|
17
17
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
18
|
-
var
|
|
18
|
+
var _whitespace = require("@atlaskit/editor-common/whitespace");
|
|
19
19
|
var _preferences = _interopRequireDefault(require("@atlaskit/icon/glyph/preferences"));
|
|
20
20
|
var _colors = require("@atlaskit/theme/colors");
|
|
21
|
-
var
|
|
21
|
+
var _utils = require("./utils");
|
|
22
22
|
var _excluded = ["children", "isSelected", "isVisible", "testId", "url"];
|
|
23
23
|
var _active;
|
|
24
24
|
/* eslint-disable @atlaskit/design-system/no-nested-styles */
|
|
@@ -140,17 +140,17 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
|
|
|
140
140
|
if (!containerRef.current || !maxOverlayWidth.current) {
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
|
-
var marker = (0,
|
|
143
|
+
var marker = (0, _utils.getChildElement)(containerRef, ".".concat(OVERLAY_MARKER_CLASSNAME));
|
|
144
144
|
if (!marker) {
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
try {
|
|
148
|
-
var oneLine = (0,
|
|
148
|
+
var oneLine = (0, _utils.isOneLine)(containerRef.current, marker);
|
|
149
149
|
|
|
150
150
|
// Get the width of the available space to display overlay.
|
|
151
151
|
// This is the width of the inline link itself. If the inline
|
|
152
152
|
// is wrapped to the next line, this is width of the last line.
|
|
153
|
-
var _availableWidth = (0,
|
|
153
|
+
var _availableWidth = (0, _utils.getInlineCardAvailableWidth)(containerRef.current, marker) - PADDING_IN_PX - (
|
|
154
154
|
// Always leave at least the icon visible
|
|
155
155
|
oneLine ? ICON_WIDTH_IN_PX + PADDING_IN_PX : 0);
|
|
156
156
|
setAvailableWidth(_availableWidth);
|
|
@@ -175,16 +175,16 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
|
|
|
175
175
|
|
|
176
176
|
// This should run only once
|
|
177
177
|
if (!maxOverlayWidth.current) {
|
|
178
|
-
var iconAndLabel = (0,
|
|
179
|
-
var _label = (0,
|
|
178
|
+
var iconAndLabel = (0, _utils.getChildElement)(containerRef, ".".concat(ICON_AND_LABEL_CLASSNAME));
|
|
179
|
+
var _label = (0, _utils.getChildElement)(containerRef, ".".concat(OVERLAY_LABEL_CLASSNAME));
|
|
180
180
|
if (iconAndLabel && _label) {
|
|
181
181
|
// Set overlay max (label + icon) and min (icon only) width.
|
|
182
|
-
var _getOverlayWidths = (0,
|
|
182
|
+
var _getOverlayWidths = (0, _utils.getOverlayWidths)(iconAndLabel, _label),
|
|
183
183
|
max = _getOverlayWidths.max,
|
|
184
184
|
min = _getOverlayWidths.min;
|
|
185
185
|
maxOverlayWidth.current = max;
|
|
186
186
|
minOverlayWidth.current = min;
|
|
187
|
-
iconSize.current = (0,
|
|
187
|
+
iconSize.current = (0, _utils.getIconSize)(_label);
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
if (isVisible) {
|
|
@@ -230,7 +230,7 @@ var InlineCardOverlay = function InlineCardOverlay(_ref) {
|
|
|
230
230
|
}), children, isVisible && (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("span", {
|
|
231
231
|
"aria-hidden": "true",
|
|
232
232
|
className: OVERLAY_MARKER_CLASSNAME
|
|
233
|
-
},
|
|
233
|
+
}, _whitespace.ZERO_WIDTH_JOINER), (0, _react2.jsx)("a", {
|
|
234
234
|
css: [overlayStyles, showOverlay && showOverlayStyles],
|
|
235
235
|
style: {
|
|
236
236
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
@@ -14,11 +14,11 @@ var _react2 = require("@emotion/react");
|
|
|
14
14
|
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
15
15
|
var _reactIntlNext = require("react-intl-next");
|
|
16
16
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
17
|
-
var
|
|
17
|
+
var _whitespace = require("@atlaskit/editor-common/whitespace");
|
|
18
18
|
var _preferences = _interopRequireDefault(require("@atlaskit/icon/glyph/preferences"));
|
|
19
19
|
var _colors = require("@atlaskit/theme/colors");
|
|
20
20
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
21
|
-
var
|
|
21
|
+
var _utils = require("../InlineCardOverlay/utils");
|
|
22
22
|
var _excluded = ["children", "isSelected", "isVisible", "testId"];
|
|
23
23
|
/* eslint-disable @atlaskit/design-system/no-nested-styles */
|
|
24
24
|
/* eslint-disable @atlaskit/design-system/prefer-primitives */
|
|
@@ -114,17 +114,17 @@ var LeftIconOverlay = function LeftIconOverlay(_ref) {
|
|
|
114
114
|
if (!containerRef.current) {
|
|
115
115
|
return;
|
|
116
116
|
}
|
|
117
|
-
var marker = (0,
|
|
117
|
+
var marker = (0, _utils.getChildElement)(containerRef, ".".concat(OVERLAY_MARKER_CLASSNAME));
|
|
118
118
|
if (!marker) {
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
121
121
|
try {
|
|
122
|
-
var oneLine = (0,
|
|
122
|
+
var oneLine = (0, _utils.isOneLine)(containerRef.current, marker);
|
|
123
123
|
|
|
124
124
|
// Get the width of the available space to display overlay.
|
|
125
125
|
// This is the width of the inline link itself. If the inline
|
|
126
126
|
// is wrapped to the next line, this is width of the last line.
|
|
127
|
-
var _availableWidth = (0,
|
|
127
|
+
var _availableWidth = (0, _utils.getInlineCardAvailableWidth)(containerRef.current, marker) - PADDING_IN_PX - (
|
|
128
128
|
// Always leave at least the icon visible
|
|
129
129
|
oneLine ? ICON_WIDTH_IN_PX + PADDING_IN_PX : 0);
|
|
130
130
|
setAvailableWidth(_availableWidth);
|
|
@@ -178,7 +178,7 @@ var LeftIconOverlay = function LeftIconOverlay(_ref) {
|
|
|
178
178
|
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)("span", {
|
|
179
179
|
"aria-hidden": "true",
|
|
180
180
|
className: OVERLAY_MARKER_CLASSNAME
|
|
181
|
-
},
|
|
181
|
+
}, _whitespace.ZERO_WIDTH_JOINER), (0, _react2.jsx)("span", {
|
|
182
182
|
css: [overlayStyles, showOverlay && showOverlayStyles],
|
|
183
183
|
tabIndex: -1,
|
|
184
184
|
"data-testid": testId
|
|
@@ -9,7 +9,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
9
9
|
import debounce from 'lodash/debounce';
|
|
10
10
|
import { useIntl } from 'react-intl-next';
|
|
11
11
|
import { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
12
|
-
import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/
|
|
12
|
+
import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/whitespace';
|
|
13
13
|
import PreferencesIcon from '@atlaskit/icon/glyph/preferences';
|
|
14
14
|
import { B100, N0, N700 } from '@atlaskit/theme/colors';
|
|
15
15
|
import { getChildElement, getIconSize, getInlineCardAvailableWidth, getOverlayWidths, isOneLine } from './utils';
|
|
@@ -9,7 +9,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
9
9
|
import debounce from 'lodash/debounce';
|
|
10
10
|
import { useIntl } from 'react-intl-next';
|
|
11
11
|
import { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
12
|
-
import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/
|
|
12
|
+
import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/whitespace';
|
|
13
13
|
import PreferencesIcon from '@atlaskit/icon/glyph/preferences';
|
|
14
14
|
import { N0, N30A, N40A, N60A, N700 } from '@atlaskit/theme/colors';
|
|
15
15
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -14,7 +14,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
14
14
|
import debounce from 'lodash/debounce';
|
|
15
15
|
import { useIntl } from 'react-intl-next';
|
|
16
16
|
import { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
17
|
-
import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/
|
|
17
|
+
import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/whitespace';
|
|
18
18
|
import PreferencesIcon from '@atlaskit/icon/glyph/preferences';
|
|
19
19
|
import { B100, N0, N700 } from '@atlaskit/theme/colors';
|
|
20
20
|
import { getChildElement, getIconSize, getInlineCardAvailableWidth, getOverlayWidths, isOneLine } from './utils';
|
|
@@ -12,7 +12,7 @@ import { css, jsx } from '@emotion/react';
|
|
|
12
12
|
import debounce from 'lodash/debounce';
|
|
13
13
|
import { useIntl } from 'react-intl-next';
|
|
14
14
|
import { cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
15
|
-
import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/
|
|
15
|
+
import { ZERO_WIDTH_JOINER } from '@atlaskit/editor-common/whitespace';
|
|
16
16
|
import PreferencesIcon from '@atlaskit/icon/glyph/preferences';
|
|
17
17
|
import { N0, N30A, N40A, N60A, N700 } from '@atlaskit/theme/colors';
|
|
18
18
|
import Tooltip from '@atlaskit/tooltip';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/adf-schema": "^39.0.3",
|
|
36
36
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
37
|
-
"@atlaskit/button": "^18.
|
|
37
|
+
"@atlaskit/button": "^18.2.0",
|
|
38
38
|
"@atlaskit/custom-steps": "^0.4.0",
|
|
39
39
|
"@atlaskit/dropdown-menu": "^12.14.0",
|
|
40
|
-
"@atlaskit/editor-common": "^84.
|
|
40
|
+
"@atlaskit/editor-common": "^84.3.0",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^1.4.0",
|
|
42
42
|
"@atlaskit/editor-plugin-decorations": "^1.1.0",
|
|
43
43
|
"@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
"@atlaskit/editor-prosemirror": "4.0.1",
|
|
50
50
|
"@atlaskit/editor-shared-styles": "^2.12.0",
|
|
51
51
|
"@atlaskit/frontend-utilities": "^2.7.0",
|
|
52
|
-
"@atlaskit/icon": "^22.
|
|
52
|
+
"@atlaskit/icon": "^22.6.0",
|
|
53
53
|
"@atlaskit/link-analytics": "^8.3.0",
|
|
54
54
|
"@atlaskit/link-client-extension": "^1.9.0",
|
|
55
55
|
"@atlaskit/link-datasource": "^2.5.0",
|
|
56
56
|
"@atlaskit/linking-common": "^5.7.0",
|
|
57
57
|
"@atlaskit/linking-types": "^8.9.0",
|
|
58
|
-
"@atlaskit/menu": "2.7.
|
|
58
|
+
"@atlaskit/menu": "2.7.1",
|
|
59
59
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
60
|
-
"@atlaskit/primitives": "^10.
|
|
60
|
+
"@atlaskit/primitives": "^10.1.0",
|
|
61
61
|
"@atlaskit/smart-card": "^27.9.0",
|
|
62
62
|
"@atlaskit/theme": "^12.11.0",
|
|
63
63
|
"@atlaskit/tokens": "^1.53.0",
|