@atlaskit/editor-common 78.23.9 → 78.24.1
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 +24 -0
- package/dist/cjs/media/messages/comments.js +6 -1
- package/dist/cjs/media-single/CommentBadge.js +16 -8
- package/dist/cjs/messages/card.js +5 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/MediaSingle/styled.js +1 -1
- package/dist/cjs/utils/datasource.js +2 -0
- package/dist/es2019/media/messages/comments.js +6 -1
- package/dist/es2019/media-single/CommentBadge.js +15 -8
- package/dist/es2019/messages/card.js +5 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/MediaSingle/styled.js +5 -0
- package/dist/es2019/utils/datasource.js +3 -1
- package/dist/esm/media/messages/comments.js +6 -1
- package/dist/esm/media-single/CommentBadge.js +16 -8
- package/dist/esm/messages/card.js +5 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/MediaSingle/styled.js +1 -1
- package/dist/esm/utils/datasource.js +3 -1
- package/dist/types/media/messages/comments.d.ts +5 -0
- package/dist/types/media-single/CommentBadge.d.ts +8 -9
- package/dist/types/media-single/index.d.ts +1 -0
- package/dist/types/messages/card.d.ts +5 -0
- package/dist/types/types/datasource.d.ts +1 -1
- package/dist/types/types/floating-toolbar.d.ts +8 -0
- package/dist/types-ts4.5/media/messages/comments.d.ts +5 -0
- package/dist/types-ts4.5/media-single/CommentBadge.d.ts +8 -9
- package/dist/types-ts4.5/media-single/index.d.ts +1 -0
- package/dist/types-ts4.5/messages/card.d.ts +5 -0
- package/dist/types-ts4.5/types/datasource.d.ts +1 -1
- package/dist/types-ts4.5/types/floating-toolbar.d.ts +8 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 78.24.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#88742](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88742) [`6771cedeadd3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6771cedeadd3) - Add UI for comment badge in Renderer, clean up props
|
|
8
|
+
|
|
9
|
+
## 78.24.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#88295](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88295) [`6b703183b847`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6b703183b847) - [ux] Remove (Beta) from the /Assets and + Assets elements description for GA
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#88323](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88323) [`98bac3c2f1ff`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/98bac3c2f1ff) - Update styles for annotation on media
|
|
18
|
+
- [#88531](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88531) [`2362c633e4e9`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2362c633e4e9) - Adds confluence-search modal integration
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
21
|
+
## 78.23.10
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [#88137](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88137) [`0a744349d5e6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0a744349d5e6) - [ux] [ED-22833] Change icon used for comment button in media floating toolbar when there are active comments associated with the media. The icon will now be comment icon with a dot at top right corner.
|
|
26
|
+
|
|
3
27
|
## 78.23.9
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -9,7 +9,12 @@ var commentMessages = exports.commentMessages = (0, _reactIntlNext.defineMessage
|
|
|
9
9
|
addCommentOnMedia: {
|
|
10
10
|
id: 'fabric.editor.addCommentOnMedia',
|
|
11
11
|
defaultMessage: 'Add comment',
|
|
12
|
-
description: 'Add a comment for this image'
|
|
12
|
+
description: 'Add a comment for this media (image/video)'
|
|
13
|
+
},
|
|
14
|
+
viewCommentsOnMedia: {
|
|
15
|
+
id: 'fabric.editor.viewCommentOnMedia',
|
|
16
|
+
defaultMessage: 'View comment',
|
|
17
|
+
description: 'View a existing comment for this media (image/video)'
|
|
13
18
|
},
|
|
14
19
|
viewAndAddCommentsOnMedia: {
|
|
15
20
|
id: 'fabric.editor.viewAndAddCommentsOnMedia',
|
|
@@ -10,6 +10,7 @@ var _react = require("react");
|
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
12
12
|
var _button = require("@atlaskit/button");
|
|
13
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
13
14
|
var _comment = _interopRequireDefault(require("@atlaskit/icon/glyph/comment"));
|
|
14
15
|
var _constants = require("@atlaskit/theme/constants");
|
|
15
16
|
var _media = require("../media");
|
|
@@ -18,21 +19,28 @@ var _media = require("../media");
|
|
|
18
19
|
var commentBadgeWrapper = (0, _react2.css)({
|
|
19
20
|
position: 'absolute',
|
|
20
21
|
// closest parent element with position relative is .resizer-hover-zone, which includes 10px padding
|
|
21
|
-
right: '
|
|
22
|
+
right: '2px',
|
|
22
23
|
top: '2px',
|
|
23
24
|
borderRadius: '3px',
|
|
25
|
+
zIndex: _editorSharedStyles.akEditorUnitZIndex * 10
|
|
26
|
+
});
|
|
27
|
+
var commentBadgeEditorOverrides = (0, _react2.css)({
|
|
28
|
+
right: '14px',
|
|
24
29
|
zIndex: _constants.layers.card()
|
|
25
30
|
});
|
|
26
|
-
var
|
|
31
|
+
var getBadgeSize = function getBadgeSize(width, height) {
|
|
27
32
|
// width is the original width of image, not resized or currently rendered to user. Defaulting to medium for now
|
|
28
|
-
return
|
|
33
|
+
return width && width < 70 || height && height < 70 ? 'small' : 'medium';
|
|
29
34
|
};
|
|
30
35
|
var CommentBadge = exports.CommentBadge = function CommentBadge(_ref) {
|
|
31
36
|
var intl = _ref.intl,
|
|
32
|
-
|
|
37
|
+
width = _ref.width,
|
|
38
|
+
height = _ref.height,
|
|
33
39
|
mediaElement = _ref.mediaElement,
|
|
34
|
-
onClick = _ref.onClick
|
|
35
|
-
|
|
40
|
+
onClick = _ref.onClick,
|
|
41
|
+
_ref$isEditor = _ref.isEditor,
|
|
42
|
+
isEditor = _ref$isEditor === void 0 ? false : _ref$isEditor;
|
|
43
|
+
var _useState = (0, _react.useState)(getBadgeSize(width, height)),
|
|
36
44
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
37
45
|
badgeSize = _useState2[0],
|
|
38
46
|
setBadgeSize = _useState2[1];
|
|
@@ -44,7 +52,7 @@ var CommentBadge = exports.CommentBadge = function CommentBadge(_ref) {
|
|
|
44
52
|
var _entry$contentRect = entry.contentRect,
|
|
45
53
|
width = _entry$contentRect.width,
|
|
46
54
|
height = _entry$contentRect.height;
|
|
47
|
-
setBadgeSize(width
|
|
55
|
+
setBadgeSize(getBadgeSize(width, height));
|
|
48
56
|
}));
|
|
49
57
|
if (mediaElement) {
|
|
50
58
|
observer.observe(mediaElement);
|
|
@@ -55,7 +63,7 @@ var CommentBadge = exports.CommentBadge = function CommentBadge(_ref) {
|
|
|
55
63
|
}, [mediaElement]);
|
|
56
64
|
var badgeDimensions = badgeSize === 'medium' ? '24px' : '16px';
|
|
57
65
|
return (0, _react2.jsx)("div", {
|
|
58
|
-
css: commentBadgeWrapper
|
|
66
|
+
css: isEditor ? [commentBadgeWrapper, commentBadgeEditorOverrides] : commentBadgeWrapper
|
|
59
67
|
}, (0, _react2.jsx)(_button.CustomThemeButton, {
|
|
60
68
|
style: {
|
|
61
69
|
height: badgeDimensions,
|
|
@@ -106,6 +106,11 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
106
106
|
defaultMessage: 'Insert Jira issues from Jira Cloud with enhanced search, filtering, and configuration.',
|
|
107
107
|
description: 'Insert a jira datasource table'
|
|
108
108
|
},
|
|
109
|
+
datasourceAssetsObjectsGeneralAvailability: {
|
|
110
|
+
id: 'fabric.editor.datasource.assetsObjectsGeneralAvailability',
|
|
111
|
+
defaultMessage: 'Assets',
|
|
112
|
+
description: 'Text displayed when selecting the type of data to include onto the page, in this case: JSM Assets objects.'
|
|
113
|
+
},
|
|
109
114
|
datasourceAssetsObjects: {
|
|
110
115
|
id: 'fabric.editor.datasource.assetsObjects',
|
|
111
116
|
defaultMessage: 'Assets (Beta)',
|
|
@@ -16,7 +16,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
16
16
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
17
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
18
18
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
19
|
-
var packageVersion = "78.
|
|
19
|
+
var packageVersion = "78.24.1";
|
|
20
20
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
21
21
|
// Remove URL as it has UGC
|
|
22
22
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -22,7 +22,7 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
22
22
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
23
23
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
|
|
24
24
|
var packageName = "@atlaskit/editor-common";
|
|
25
|
-
var packageVersion = "78.
|
|
25
|
+
var packageVersion = "78.24.1";
|
|
26
26
|
var halfFocusRing = 1;
|
|
27
27
|
var dropOffset = '0, 8';
|
|
28
28
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -180,7 +180,7 @@ var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
|
|
|
180
180
|
|
|
181
181
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
182
182
|
var mediaWrapperStyle = exports.mediaWrapperStyle = function mediaWrapperStyle(props) {
|
|
183
|
-
return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n\n ", "\n\n /* Editor */\n & > figure {\n position: ", ";\n height: 100%;\n width: 100%;\n }\n\n & > div {\n position: ", ";\n height: 100%;\n width: 100%;\n }\n\n &[data-node-type='embedCard'] > div {\n width: 100%;\n }\n\n /* Renderer */\n [data-node-type='media'] {\n position: static !important;\n\n > div {\n position: absolute;\n height: 100%;\n }\n }\n"])), RenderFallbackContainer(props), props.hasFallbackContainer ? 'absolute' : 'relative', props.hasFallbackContainer ? 'absolute' : 'relative');
|
|
183
|
+
return (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n\n ", "\n\n /* Editor */\n & > figure {\n position: ", ";\n height: 100%;\n width: 100%;\n }\n\n & > div {\n position: ", ";\n height: 100%;\n width: 100%;\n }\n\n & * [data-mark-annotation-type='inlineComment'] {\n width: 100%;\n height: 100%;\n }\n\n &[data-node-type='embedCard'] > div {\n width: 100%;\n }\n\n /* Renderer */\n [data-node-type='media'] {\n position: static !important;\n\n > div {\n position: absolute;\n height: 100%;\n }\n }\n"])), RenderFallbackContainer(props), props.hasFallbackContainer ? 'absolute' : 'relative', props.hasFallbackContainer ? 'absolute' : 'relative');
|
|
184
184
|
};
|
|
185
185
|
var MediaWrapper = exports.MediaWrapper = function MediaWrapper(_ref3) {
|
|
186
186
|
var children = _ref3.children,
|
|
@@ -12,6 +12,8 @@ var getDatasourceType = exports.getDatasourceType = function getDatasourceType(d
|
|
|
12
12
|
return 'jira';
|
|
13
13
|
case _linkDatasource.ASSETS_LIST_OF_LINKS_DATASOURCE_ID:
|
|
14
14
|
return 'assets';
|
|
15
|
+
case _linkDatasource.CONFLUENCE_SEARCH_DATASOURCE_ID:
|
|
16
|
+
return 'confluence-search';
|
|
15
17
|
default:
|
|
16
18
|
return undefined;
|
|
17
19
|
}
|
|
@@ -3,7 +3,12 @@ export const commentMessages = defineMessages({
|
|
|
3
3
|
addCommentOnMedia: {
|
|
4
4
|
id: 'fabric.editor.addCommentOnMedia',
|
|
5
5
|
defaultMessage: 'Add comment',
|
|
6
|
-
description: 'Add a comment for this image'
|
|
6
|
+
description: 'Add a comment for this media (image/video)'
|
|
7
|
+
},
|
|
8
|
+
viewCommentsOnMedia: {
|
|
9
|
+
id: 'fabric.editor.viewCommentOnMedia',
|
|
10
|
+
defaultMessage: 'View comment',
|
|
11
|
+
description: 'View a existing comment for this media (image/video)'
|
|
7
12
|
},
|
|
8
13
|
viewAndAddCommentsOnMedia: {
|
|
9
14
|
id: 'fabric.editor.viewAndAddCommentsOnMedia',
|
|
@@ -3,28 +3,35 @@ import { useEffect, useState } from 'react';
|
|
|
3
3
|
import { css, jsx } from '@emotion/react';
|
|
4
4
|
import debounce from 'lodash/debounce';
|
|
5
5
|
import { CustomThemeButton } from '@atlaskit/button';
|
|
6
|
+
import { akEditorUnitZIndex } from '@atlaskit/editor-shared-styles';
|
|
6
7
|
import CommentIcon from '@atlaskit/icon/glyph/comment';
|
|
7
8
|
import { layers } from '@atlaskit/theme/constants';
|
|
8
9
|
import { commentMessages as messages } from '../media';
|
|
9
10
|
const commentBadgeWrapper = css({
|
|
10
11
|
position: 'absolute',
|
|
11
12
|
// closest parent element with position relative is .resizer-hover-zone, which includes 10px padding
|
|
12
|
-
right: '
|
|
13
|
+
right: '2px',
|
|
13
14
|
top: '2px',
|
|
14
15
|
borderRadius: '3px',
|
|
16
|
+
zIndex: akEditorUnitZIndex * 10
|
|
17
|
+
});
|
|
18
|
+
const commentBadgeEditorOverrides = css({
|
|
19
|
+
right: '14px',
|
|
15
20
|
zIndex: layers.card()
|
|
16
21
|
});
|
|
17
|
-
const
|
|
22
|
+
const getBadgeSize = (width, height) => {
|
|
18
23
|
// width is the original width of image, not resized or currently rendered to user. Defaulting to medium for now
|
|
19
|
-
return
|
|
24
|
+
return width && width < 70 || height && height < 70 ? 'small' : 'medium';
|
|
20
25
|
};
|
|
21
26
|
export const CommentBadge = ({
|
|
22
27
|
intl,
|
|
23
|
-
|
|
28
|
+
width,
|
|
29
|
+
height,
|
|
24
30
|
mediaElement,
|
|
25
|
-
onClick
|
|
31
|
+
onClick,
|
|
32
|
+
isEditor = false
|
|
26
33
|
}) => {
|
|
27
|
-
const [badgeSize, setBadgeSize] = useState(
|
|
34
|
+
const [badgeSize, setBadgeSize] = useState(getBadgeSize(width, height));
|
|
28
35
|
const title = intl.formatMessage(messages.viewAndAddCommentsOnMedia);
|
|
29
36
|
useEffect(() => {
|
|
30
37
|
const observer = new ResizeObserver(debounce(entries => {
|
|
@@ -33,7 +40,7 @@ export const CommentBadge = ({
|
|
|
33
40
|
width,
|
|
34
41
|
height
|
|
35
42
|
} = entry.contentRect;
|
|
36
|
-
setBadgeSize(width
|
|
43
|
+
setBadgeSize(getBadgeSize(width, height));
|
|
37
44
|
}));
|
|
38
45
|
if (mediaElement) {
|
|
39
46
|
observer.observe(mediaElement);
|
|
@@ -44,7 +51,7 @@ export const CommentBadge = ({
|
|
|
44
51
|
}, [mediaElement]);
|
|
45
52
|
const badgeDimensions = badgeSize === 'medium' ? '24px' : '16px';
|
|
46
53
|
return jsx("div", {
|
|
47
|
-
css: commentBadgeWrapper
|
|
54
|
+
css: isEditor ? [commentBadgeWrapper, commentBadgeEditorOverrides] : commentBadgeWrapper
|
|
48
55
|
}, jsx(CustomThemeButton, {
|
|
49
56
|
style: {
|
|
50
57
|
height: badgeDimensions,
|
|
@@ -100,6 +100,11 @@ export const messages = defineMessages({
|
|
|
100
100
|
defaultMessage: 'Insert Jira issues from Jira Cloud with enhanced search, filtering, and configuration.',
|
|
101
101
|
description: 'Insert a jira datasource table'
|
|
102
102
|
},
|
|
103
|
+
datasourceAssetsObjectsGeneralAvailability: {
|
|
104
|
+
id: 'fabric.editor.datasource.assetsObjectsGeneralAvailability',
|
|
105
|
+
defaultMessage: 'Assets',
|
|
106
|
+
description: 'Text displayed when selecting the type of data to include onto the page, in this case: JSM Assets objects.'
|
|
107
|
+
},
|
|
103
108
|
datasourceAssetsObjects: {
|
|
104
109
|
id: 'fabric.editor.datasource.assetsObjects',
|
|
105
110
|
defaultMessage: 'Assets (Beta)',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
2
2
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
3
|
-
const packageVersion = "78.
|
|
3
|
+
const packageVersion = "78.24.1";
|
|
4
4
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
5
5
|
// Remove URL as it has UGC
|
|
6
6
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -7,7 +7,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
7
7
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
8
8
|
import Layer from '../Layer';
|
|
9
9
|
const packageName = "@atlaskit/editor-common";
|
|
10
|
-
const packageVersion = "78.
|
|
10
|
+
const packageVersion = "78.24.1";
|
|
11
11
|
const halfFocusRing = 1;
|
|
12
12
|
const dropOffset = '0, 8';
|
|
13
13
|
class DropList extends Component {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID, JIRA_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource';
|
|
1
|
+
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID, CONFLUENCE_SEARCH_DATASOURCE_ID, JIRA_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource';
|
|
2
2
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
3
|
export const getDatasourceType = datasourceId => {
|
|
4
4
|
switch (datasourceId) {
|
|
@@ -6,6 +6,8 @@ export const getDatasourceType = datasourceId => {
|
|
|
6
6
|
return 'jira';
|
|
7
7
|
case ASSETS_LIST_OF_LINKS_DATASOURCE_ID:
|
|
8
8
|
return 'assets';
|
|
9
|
+
case CONFLUENCE_SEARCH_DATASOURCE_ID:
|
|
10
|
+
return 'confluence-search';
|
|
9
11
|
default:
|
|
10
12
|
return undefined;
|
|
11
13
|
}
|
|
@@ -3,7 +3,12 @@ export var commentMessages = defineMessages({
|
|
|
3
3
|
addCommentOnMedia: {
|
|
4
4
|
id: 'fabric.editor.addCommentOnMedia',
|
|
5
5
|
defaultMessage: 'Add comment',
|
|
6
|
-
description: 'Add a comment for this image'
|
|
6
|
+
description: 'Add a comment for this media (image/video)'
|
|
7
|
+
},
|
|
8
|
+
viewCommentsOnMedia: {
|
|
9
|
+
id: 'fabric.editor.viewCommentOnMedia',
|
|
10
|
+
defaultMessage: 'View comment',
|
|
11
|
+
description: 'View a existing comment for this media (image/video)'
|
|
7
12
|
},
|
|
8
13
|
viewAndAddCommentsOnMedia: {
|
|
9
14
|
id: 'fabric.editor.viewAndAddCommentsOnMedia',
|
|
@@ -4,27 +4,35 @@ import { useEffect, useState } from 'react';
|
|
|
4
4
|
import { css, jsx } from '@emotion/react';
|
|
5
5
|
import debounce from 'lodash/debounce';
|
|
6
6
|
import { CustomThemeButton } from '@atlaskit/button';
|
|
7
|
+
import { akEditorUnitZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
8
|
import CommentIcon from '@atlaskit/icon/glyph/comment';
|
|
8
9
|
import { layers } from '@atlaskit/theme/constants';
|
|
9
10
|
import { commentMessages as messages } from '../media';
|
|
10
11
|
var commentBadgeWrapper = css({
|
|
11
12
|
position: 'absolute',
|
|
12
13
|
// closest parent element with position relative is .resizer-hover-zone, which includes 10px padding
|
|
13
|
-
right: '
|
|
14
|
+
right: '2px',
|
|
14
15
|
top: '2px',
|
|
15
16
|
borderRadius: '3px',
|
|
17
|
+
zIndex: akEditorUnitZIndex * 10
|
|
18
|
+
});
|
|
19
|
+
var commentBadgeEditorOverrides = css({
|
|
20
|
+
right: '14px',
|
|
16
21
|
zIndex: layers.card()
|
|
17
22
|
});
|
|
18
|
-
var
|
|
23
|
+
var getBadgeSize = function getBadgeSize(width, height) {
|
|
19
24
|
// width is the original width of image, not resized or currently rendered to user. Defaulting to medium for now
|
|
20
|
-
return
|
|
25
|
+
return width && width < 70 || height && height < 70 ? 'small' : 'medium';
|
|
21
26
|
};
|
|
22
27
|
export var CommentBadge = function CommentBadge(_ref) {
|
|
23
28
|
var intl = _ref.intl,
|
|
24
|
-
|
|
29
|
+
width = _ref.width,
|
|
30
|
+
height = _ref.height,
|
|
25
31
|
mediaElement = _ref.mediaElement,
|
|
26
|
-
onClick = _ref.onClick
|
|
27
|
-
|
|
32
|
+
onClick = _ref.onClick,
|
|
33
|
+
_ref$isEditor = _ref.isEditor,
|
|
34
|
+
isEditor = _ref$isEditor === void 0 ? false : _ref$isEditor;
|
|
35
|
+
var _useState = useState(getBadgeSize(width, height)),
|
|
28
36
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
37
|
badgeSize = _useState2[0],
|
|
30
38
|
setBadgeSize = _useState2[1];
|
|
@@ -36,7 +44,7 @@ export var CommentBadge = function CommentBadge(_ref) {
|
|
|
36
44
|
var _entry$contentRect = entry.contentRect,
|
|
37
45
|
width = _entry$contentRect.width,
|
|
38
46
|
height = _entry$contentRect.height;
|
|
39
|
-
setBadgeSize(width
|
|
47
|
+
setBadgeSize(getBadgeSize(width, height));
|
|
40
48
|
}));
|
|
41
49
|
if (mediaElement) {
|
|
42
50
|
observer.observe(mediaElement);
|
|
@@ -47,7 +55,7 @@ export var CommentBadge = function CommentBadge(_ref) {
|
|
|
47
55
|
}, [mediaElement]);
|
|
48
56
|
var badgeDimensions = badgeSize === 'medium' ? '24px' : '16px';
|
|
49
57
|
return jsx("div", {
|
|
50
|
-
css: commentBadgeWrapper
|
|
58
|
+
css: isEditor ? [commentBadgeWrapper, commentBadgeEditorOverrides] : commentBadgeWrapper
|
|
51
59
|
}, jsx(CustomThemeButton, {
|
|
52
60
|
style: {
|
|
53
61
|
height: badgeDimensions,
|
|
@@ -100,6 +100,11 @@ export var messages = defineMessages({
|
|
|
100
100
|
defaultMessage: 'Insert Jira issues from Jira Cloud with enhanced search, filtering, and configuration.',
|
|
101
101
|
description: 'Insert a jira datasource table'
|
|
102
102
|
},
|
|
103
|
+
datasourceAssetsObjectsGeneralAvailability: {
|
|
104
|
+
id: 'fabric.editor.datasource.assetsObjectsGeneralAvailability',
|
|
105
|
+
defaultMessage: 'Assets',
|
|
106
|
+
description: 'Text displayed when selecting the type of data to include onto the page, in this case: JSM Assets objects.'
|
|
107
|
+
},
|
|
103
108
|
datasourceAssetsObjects: {
|
|
104
109
|
id: 'fabric.editor.datasource.assetsObjects',
|
|
105
110
|
defaultMessage: 'Assets (Beta)',
|
|
@@ -6,7 +6,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
6
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
8
8
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
9
|
-
var packageVersion = "78.
|
|
9
|
+
var packageVersion = "78.24.1";
|
|
10
10
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
11
11
|
// Remove URL as it has UGC
|
|
12
12
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -17,7 +17,7 @@ import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@
|
|
|
17
17
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
18
18
|
import Layer from '../Layer';
|
|
19
19
|
var packageName = "@atlaskit/editor-common";
|
|
20
|
-
var packageVersion = "78.
|
|
20
|
+
var packageVersion = "78.24.1";
|
|
21
21
|
var halfFocusRing = 1;
|
|
22
22
|
var dropOffset = '0, 8';
|
|
23
23
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -170,7 +170,7 @@ var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
|
|
|
170
170
|
|
|
171
171
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
172
172
|
export var mediaWrapperStyle = function mediaWrapperStyle(props) {
|
|
173
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n\n ", "\n\n /* Editor */\n & > figure {\n position: ", ";\n height: 100%;\n width: 100%;\n }\n\n & > div {\n position: ", ";\n height: 100%;\n width: 100%;\n }\n\n &[data-node-type='embedCard'] > div {\n width: 100%;\n }\n\n /* Renderer */\n [data-node-type='media'] {\n position: static !important;\n\n > div {\n position: absolute;\n height: 100%;\n }\n }\n"])), RenderFallbackContainer(props), props.hasFallbackContainer ? 'absolute' : 'relative', props.hasFallbackContainer ? 'absolute' : 'relative');
|
|
173
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n position: relative;\n\n ", "\n\n /* Editor */\n & > figure {\n position: ", ";\n height: 100%;\n width: 100%;\n }\n\n & > div {\n position: ", ";\n height: 100%;\n width: 100%;\n }\n\n & * [data-mark-annotation-type='inlineComment'] {\n width: 100%;\n height: 100%;\n }\n\n &[data-node-type='embedCard'] > div {\n width: 100%;\n }\n\n /* Renderer */\n [data-node-type='media'] {\n position: static !important;\n\n > div {\n position: absolute;\n height: 100%;\n }\n }\n"])), RenderFallbackContainer(props), props.hasFallbackContainer ? 'absolute' : 'relative', props.hasFallbackContainer ? 'absolute' : 'relative');
|
|
174
174
|
};
|
|
175
175
|
export var MediaWrapper = function MediaWrapper(_ref3) {
|
|
176
176
|
var children = _ref3.children,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID, JIRA_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource';
|
|
1
|
+
import { ASSETS_LIST_OF_LINKS_DATASOURCE_ID, CONFLUENCE_SEARCH_DATASOURCE_ID, JIRA_LIST_OF_LINKS_DATASOURCE_ID } from '@atlaskit/link-datasource';
|
|
2
2
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
3
|
export var getDatasourceType = function getDatasourceType(datasourceId) {
|
|
4
4
|
switch (datasourceId) {
|
|
@@ -6,6 +6,8 @@ export var getDatasourceType = function getDatasourceType(datasourceId) {
|
|
|
6
6
|
return 'jira';
|
|
7
7
|
case ASSETS_LIST_OF_LINKS_DATASOURCE_ID:
|
|
8
8
|
return 'assets';
|
|
9
|
+
case CONFLUENCE_SEARCH_DATASOURCE_ID:
|
|
10
|
+
return 'confluence-search';
|
|
9
11
|
default:
|
|
10
12
|
return undefined;
|
|
11
13
|
}
|
|
@@ -4,6 +4,11 @@ export declare const commentMessages: {
|
|
|
4
4
|
defaultMessage: string;
|
|
5
5
|
description: string;
|
|
6
6
|
};
|
|
7
|
+
viewCommentsOnMedia: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
7
12
|
viewAndAddCommentsOnMedia: {
|
|
8
13
|
id: string;
|
|
9
14
|
defaultMessage: string;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { jsx } from '@emotion/react';
|
|
2
3
|
import type { IntlShape } from 'react-intl-next';
|
|
3
|
-
|
|
4
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
type CommentBadgeProps = {
|
|
4
|
+
export type CommentBadgeProps = {
|
|
6
5
|
intl: IntlShape;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
mediaElement?: HTMLElement;
|
|
10
|
-
onClick: () => void;
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
mediaElement?: HTMLElement | null;
|
|
9
|
+
onClick: (e: React.MouseEvent) => void;
|
|
10
|
+
isEditor?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare const CommentBadge: ({ intl,
|
|
13
|
-
export {};
|
|
12
|
+
export declare const CommentBadge: ({ intl, width, height, mediaElement, onClick, isEditor, }: CommentBadgeProps) => jsx.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH, MEDIA_SINGLE_SNAP_GAP, MEDIA_SINGLE_HIGHLIGHT_GAP, MEDIA_SINGLE_GUTTER_SIZE, MEDIA_SINGLE_RESIZE_THROTTLE_TIME, Layout as MediaSingleLayout, DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, wrappedLayouts, CAPTION_PLACEHOLDER_ID, } from './constants';
|
|
2
2
|
export { getMediaSinglePixelWidth, calcMediaSinglePixelWidth, calcMediaSingleMaxWidth, getMediaSingleInitialWidth, calculateOffsetLeft, roundToNearest, calcMinWidth, getMaxWidthForNestedNode, getMaxWidthForNestedNodeNext, currentMediaNodeWithPos, } from './utils';
|
|
3
3
|
export { CommentBadge } from './CommentBadge';
|
|
4
|
+
export type { CommentBadgeProps } from './CommentBadge';
|
|
@@ -99,6 +99,11 @@ export declare const messages: {
|
|
|
99
99
|
defaultMessage: string;
|
|
100
100
|
description: string;
|
|
101
101
|
};
|
|
102
|
+
datasourceAssetsObjectsGeneralAvailability: {
|
|
103
|
+
id: string;
|
|
104
|
+
defaultMessage: string;
|
|
105
|
+
description: string;
|
|
106
|
+
};
|
|
102
107
|
datasourceAssetsObjects: {
|
|
103
108
|
id: string;
|
|
104
109
|
defaultMessage: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type DatasourceModalType = 'jira' | 'assets';
|
|
1
|
+
export type DatasourceModalType = 'jira' | 'assets' | 'confluence-search';
|
|
@@ -27,10 +27,18 @@ export interface DropdownOptionT<T extends {}> {
|
|
|
27
27
|
selected?: boolean;
|
|
28
28
|
disabled?: boolean;
|
|
29
29
|
hidden?: boolean;
|
|
30
|
+
domItemOptions?: {
|
|
31
|
+
type: typeOption;
|
|
32
|
+
};
|
|
30
33
|
testId?: string;
|
|
31
34
|
tooltip?: string;
|
|
32
35
|
elemAfter?: React.ReactNode;
|
|
33
36
|
}
|
|
37
|
+
export type typeOption =
|
|
38
|
+
/** Dropdown menu item type
|
|
39
|
+
* @default 'item'
|
|
40
|
+
*/
|
|
41
|
+
'item' | 'item-checkbox';
|
|
34
42
|
export type DropdownOptions<T extends {}> = Array<DropdownOptionT<T>> | {
|
|
35
43
|
render: (props: RenderOptionsPropsT<T>) => React.ReactElement<any> | null;
|
|
36
44
|
height: number;
|
|
@@ -4,6 +4,11 @@ export declare const commentMessages: {
|
|
|
4
4
|
defaultMessage: string;
|
|
5
5
|
description: string;
|
|
6
6
|
};
|
|
7
|
+
viewCommentsOnMedia: {
|
|
8
|
+
id: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
7
12
|
viewAndAddCommentsOnMedia: {
|
|
8
13
|
id: string;
|
|
9
14
|
defaultMessage: string;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { jsx } from '@emotion/react';
|
|
2
3
|
import type { IntlShape } from 'react-intl-next';
|
|
3
|
-
|
|
4
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
5
|
-
type CommentBadgeProps = {
|
|
4
|
+
export type CommentBadgeProps = {
|
|
6
5
|
intl: IntlShape;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
mediaElement?: HTMLElement;
|
|
10
|
-
onClick: () => void;
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
mediaElement?: HTMLElement | null;
|
|
9
|
+
onClick: (e: React.MouseEvent) => void;
|
|
10
|
+
isEditor?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare const CommentBadge: ({ intl,
|
|
13
|
-
export {};
|
|
12
|
+
export declare const CommentBadge: ({ intl, width, height, mediaElement, onClick, isEditor, }: CommentBadgeProps) => jsx.JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH, MEDIA_SINGLE_SNAP_GAP, MEDIA_SINGLE_HIGHLIGHT_GAP, MEDIA_SINGLE_GUTTER_SIZE, MEDIA_SINGLE_RESIZE_THROTTLE_TIME, Layout as MediaSingleLayout, DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, wrappedLayouts, CAPTION_PLACEHOLDER_ID, } from './constants';
|
|
2
2
|
export { getMediaSinglePixelWidth, calcMediaSinglePixelWidth, calcMediaSingleMaxWidth, getMediaSingleInitialWidth, calculateOffsetLeft, roundToNearest, calcMinWidth, getMaxWidthForNestedNode, getMaxWidthForNestedNodeNext, currentMediaNodeWithPos, } from './utils';
|
|
3
3
|
export { CommentBadge } from './CommentBadge';
|
|
4
|
+
export type { CommentBadgeProps } from './CommentBadge';
|
|
@@ -99,6 +99,11 @@ export declare const messages: {
|
|
|
99
99
|
defaultMessage: string;
|
|
100
100
|
description: string;
|
|
101
101
|
};
|
|
102
|
+
datasourceAssetsObjectsGeneralAvailability: {
|
|
103
|
+
id: string;
|
|
104
|
+
defaultMessage: string;
|
|
105
|
+
description: string;
|
|
106
|
+
};
|
|
102
107
|
datasourceAssetsObjects: {
|
|
103
108
|
id: string;
|
|
104
109
|
defaultMessage: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type DatasourceModalType = 'jira' | 'assets';
|
|
1
|
+
export type DatasourceModalType = 'jira' | 'assets' | 'confluence-search';
|
|
@@ -27,10 +27,18 @@ export interface DropdownOptionT<T extends {}> {
|
|
|
27
27
|
selected?: boolean;
|
|
28
28
|
disabled?: boolean;
|
|
29
29
|
hidden?: boolean;
|
|
30
|
+
domItemOptions?: {
|
|
31
|
+
type: typeOption;
|
|
32
|
+
};
|
|
30
33
|
testId?: string;
|
|
31
34
|
tooltip?: string;
|
|
32
35
|
elemAfter?: React.ReactNode;
|
|
33
36
|
}
|
|
37
|
+
export type typeOption =
|
|
38
|
+
/** Dropdown menu item type
|
|
39
|
+
* @default 'item'
|
|
40
|
+
*/
|
|
41
|
+
'item' | 'item-checkbox';
|
|
34
42
|
export type DropdownOptions<T extends {}> = Array<DropdownOptionT<T>> | {
|
|
35
43
|
render: (props: RenderOptionsPropsT<T>) => React.ReactElement<any> | null;
|
|
36
44
|
height: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "78.
|
|
3
|
+
"version": "78.24.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"@atlaskit/icon": "^22.1.0",
|
|
114
114
|
"@atlaskit/icon-object": "^6.3.0",
|
|
115
115
|
"@atlaskit/in-product-testing": "^0.2.0",
|
|
116
|
-
"@atlaskit/link-datasource": "^1.
|
|
116
|
+
"@atlaskit/link-datasource": "^1.26.0",
|
|
117
117
|
"@atlaskit/link-picker": "^1.34.0",
|
|
118
118
|
"@atlaskit/media-card": "^77.10.0",
|
|
119
119
|
"@atlaskit/media-client": "^26.2.0",
|