@atlaskit/renderer 109.10.5 → 109.10.7
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 +12 -0
- package/dist/cjs/react/marks/annotation.js +4 -2
- package/dist/cjs/react/nodes/embedCard.js +1 -1
- package/dist/cjs/react/nodes/media/index.js +2 -1
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/annotations/element/index.js +4 -2
- package/dist/cjs/ui/annotations/element/mark.js +16 -18
- package/dist/es2019/react/marks/annotation.js +4 -2
- package/dist/es2019/react/nodes/embedCard.js +1 -1
- package/dist/es2019/react/nodes/media/index.js +2 -1
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/annotations/element/index.js +4 -2
- package/dist/es2019/ui/annotations/element/mark.js +16 -19
- package/dist/esm/react/marks/annotation.js +4 -2
- package/dist/esm/react/nodes/embedCard.js +1 -1
- package/dist/esm/react/nodes/media/index.js +2 -1
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/annotations/element/index.js +4 -2
- package/dist/esm/ui/annotations/element/mark.js +16 -15
- package/dist/types/react/marks/annotation.d.ts +3 -3
- package/dist/types/react/types.d.ts +1 -0
- package/dist/types/ui/annotations/element/index.d.ts +2 -1
- package/dist/types/ui/annotations/element/mark.d.ts +41 -3
- package/dist/types-ts4.5/react/marks/annotation.d.ts +3 -3
- package/dist/types-ts4.5/react/types.d.ts +1 -0
- package/dist/types-ts4.5/ui/annotations/element/index.d.ts +2 -1
- package/dist/types-ts4.5/ui/annotations/element/mark.d.ts +41 -3
- package/package.json +2 -2
- package/.eslintrc.js +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 109.10.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#83297](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83297) [`6b1707c169e0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6b1707c169e0) - The internal composition of this component has changed. There is no expected change in behaviour.
|
|
8
|
+
|
|
9
|
+
## 109.10.6
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#84179](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84179) [`8bd86714a915`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8bd86714a915) - Fixed annotation highlight support for media elements by allow mark to be changed to a block level element
|
|
14
|
+
|
|
3
15
|
## 109.10.5
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -22,7 +22,8 @@ var AnnotationComponent = function AnnotationComponent(_ref) {
|
|
|
22
22
|
dataAttributes = _ref.dataAttributes,
|
|
23
23
|
_ref$annotationParent = _ref.annotationParentIds,
|
|
24
24
|
annotationParentIds = _ref$annotationParent === void 0 ? [] : _ref$annotationParent,
|
|
25
|
-
allowAnnotations = _ref.allowAnnotations
|
|
25
|
+
allowAnnotations = _ref.allowAnnotations,
|
|
26
|
+
useBlockLevel = _ref.useBlockLevel;
|
|
26
27
|
var data = _objectSpread(_objectSpread({}, dataAttributes), (0, _adfSchema.buildAnnotationMarkDataAttributes)({
|
|
27
28
|
id: id,
|
|
28
29
|
annotationType: annotationType
|
|
@@ -32,7 +33,8 @@ var AnnotationComponent = function AnnotationComponent(_ref) {
|
|
|
32
33
|
id: id,
|
|
33
34
|
dataAttributes: data,
|
|
34
35
|
annotationParentIds: annotationParentIds,
|
|
35
|
-
annotationType: annotationType
|
|
36
|
+
annotationType: annotationType,
|
|
37
|
+
useBlockLevel: useBlockLevel
|
|
36
38
|
}, children);
|
|
37
39
|
}
|
|
38
40
|
return /*#__PURE__*/_react.default.createElement("span", (0, _extends2.default)({
|
|
@@ -33,7 +33,7 @@ var embedCardWrapperStyles = (0, _react.css)({
|
|
|
33
33
|
margin: '0 auto'
|
|
34
34
|
});
|
|
35
35
|
var uIMediaSingleLayoutStyles = (0, _react.css)({
|
|
36
|
-
// eslint-disable-next-line @atlaskit/design-system/
|
|
36
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
37
37
|
marginLeft: '50%',
|
|
38
38
|
transform: 'translateX(-50%)'
|
|
39
39
|
});
|
|
@@ -81,7 +81,8 @@ var MediaAnnotation = function MediaAnnotation(_ref3) {
|
|
|
81
81
|
// This should be fine being empty [] since the serializer serializeFragmentChild getMarkProps call always passes
|
|
82
82
|
,
|
|
83
83
|
annotationParentIds: [],
|
|
84
|
-
allowAnnotations: true
|
|
84
|
+
allowAnnotations: true,
|
|
85
|
+
useBlockLevel: true
|
|
85
86
|
}, children);
|
|
86
87
|
};
|
|
87
88
|
var Media = exports.default = /*#__PURE__*/function (_PureComponent) {
|
|
@@ -55,7 +55,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
55
55
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
56
56
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
57
57
|
var packageName = "@atlaskit/renderer";
|
|
58
|
-
var packageVersion = "109.10.
|
|
58
|
+
var packageVersion = "109.10.7";
|
|
59
59
|
var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
60
60
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
61
61
|
var _super = _createSuper(Renderer);
|
|
@@ -17,7 +17,8 @@ var MarkElement = exports.MarkElement = function MarkElement(_ref) {
|
|
|
17
17
|
var annotationParentIds = _ref.annotationParentIds,
|
|
18
18
|
children = _ref.children,
|
|
19
19
|
dataAttributes = _ref.dataAttributes,
|
|
20
|
-
id = _ref.id
|
|
20
|
+
id = _ref.id,
|
|
21
|
+
useBlockLevel = _ref.useBlockLevel;
|
|
21
22
|
var updateSubscriber = (0, _hooks.useInlineCommentSubscriberContext)();
|
|
22
23
|
var states = (0, _react.useContext)(_context.InlineCommentsStateContext);
|
|
23
24
|
var hasFocus = (0, _hooks.useHasFocusEvent)({
|
|
@@ -50,6 +51,7 @@ var MarkElement = exports.MarkElement = function MarkElement(_ref) {
|
|
|
50
51
|
annotationParentIds: activeParentIds,
|
|
51
52
|
onClick: onClick,
|
|
52
53
|
hasFocus: hasFocus,
|
|
53
|
-
state: states[id]
|
|
54
|
+
state: states[id],
|
|
55
|
+
useBlockLevel: useBlockLevel
|
|
54
56
|
}, children);
|
|
55
57
|
};
|
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.MarkComponent = void 0;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
|
-
var _react =
|
|
11
|
+
var _react = require("react");
|
|
14
12
|
var _react2 = require("@emotion/react");
|
|
15
13
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
16
14
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
17
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
18
16
|
var _templateObject;
|
|
19
17
|
/** @jsx jsx */
|
|
20
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
21
|
-
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; }
|
|
22
18
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
19
|
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) { (0, _defineProperty2.default)(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; }
|
|
24
20
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- `AnnotationSharedCSSByState` is not object-safe
|
|
25
21
|
var markStyles = function markStyles() {
|
|
26
|
-
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: transparent;\n\n &[data-mark-annotation-state='", "'] {\n ", ";\n\n &:focus,\n &[data-has-focus='true'] {\n ", ";\n }\n
|
|
22
|
+
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: transparent;\n\n &[data-mark-annotation-state='", "'] {\n ", ";\n\n &:focus,\n &[data-has-focus='true'] {\n ", ";\n }\n }\n"])), _adfSchema.AnnotationMarkStates.ACTIVE, (0, _styles.AnnotationSharedCSSByState)().blur, (0, _styles.AnnotationSharedCSSByState)().focus);
|
|
23
|
+
};
|
|
24
|
+
var blockStyles = function blockStyles() {
|
|
25
|
+
return (0, _react2.css)((0, _defineProperty2.default)({
|
|
26
|
+
color: 'inherit',
|
|
27
|
+
backgroundColor: 'unset',
|
|
28
|
+
WebkitTapHighlightColor: 'transparent'
|
|
29
|
+
}, "&[data-mark-annotation-state='".concat(_adfSchema.AnnotationMarkStates.ACTIVE, "']"), _styles.mediaAnnotationStyles));
|
|
27
30
|
};
|
|
28
31
|
var MarkComponent = exports.MarkComponent = function MarkComponent(_ref) {
|
|
29
32
|
var annotationParentIds = _ref.annotationParentIds,
|
|
@@ -32,7 +35,8 @@ var MarkComponent = exports.MarkComponent = function MarkComponent(_ref) {
|
|
|
32
35
|
id = _ref.id,
|
|
33
36
|
state = _ref.state,
|
|
34
37
|
hasFocus = _ref.hasFocus,
|
|
35
|
-
onClick = _ref.onClick
|
|
38
|
+
onClick = _ref.onClick,
|
|
39
|
+
useBlockLevel = _ref.useBlockLevel;
|
|
36
40
|
var annotationIds = (0, _react.useMemo)(function () {
|
|
37
41
|
return (0, _toConsumableArray2.default)(new Set([].concat((0, _toConsumableArray2.default)(annotationParentIds), [id])));
|
|
38
42
|
}, [id, annotationParentIds]);
|
|
@@ -61,15 +65,9 @@ var MarkComponent = exports.MarkComponent = function MarkComponent(_ref) {
|
|
|
61
65
|
} : {
|
|
62
66
|
'aria-details': annotationIds.join(', ')
|
|
63
67
|
};
|
|
64
|
-
return (0,
|
|
65
|
-
id: id
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
css: markStyles
|
|
69
|
-
}), children) : (0, _react2.jsx)("mark", (0, _extends2.default)({
|
|
70
|
-
id: id,
|
|
71
|
-
onClick: onMarkClick
|
|
72
|
-
}, accessibility, overriddenData, {
|
|
73
|
-
css: markStyles
|
|
68
|
+
return (0, _react2.jsx)(useBlockLevel ? 'div' : 'mark', _objectSpread(_objectSpread(_objectSpread((0, _defineProperty2.default)({
|
|
69
|
+
id: id
|
|
70
|
+
}, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes') ? 'onClickCapture' : 'onClick', onMarkClick), accessibility), overriddenData), {}, {
|
|
71
|
+
css: useBlockLevel ? blockStyles : markStyles
|
|
74
72
|
}), children);
|
|
75
73
|
};
|
|
@@ -11,7 +11,8 @@ const AnnotationComponent = ({
|
|
|
11
11
|
children,
|
|
12
12
|
dataAttributes,
|
|
13
13
|
annotationParentIds = [],
|
|
14
|
-
allowAnnotations
|
|
14
|
+
allowAnnotations,
|
|
15
|
+
useBlockLevel
|
|
15
16
|
}) => {
|
|
16
17
|
const data = {
|
|
17
18
|
...dataAttributes,
|
|
@@ -25,7 +26,8 @@ const AnnotationComponent = ({
|
|
|
25
26
|
id: id,
|
|
26
27
|
dataAttributes: data,
|
|
27
28
|
annotationParentIds: annotationParentIds,
|
|
28
|
-
annotationType: annotationType
|
|
29
|
+
annotationType: annotationType,
|
|
30
|
+
useBlockLevel: useBlockLevel
|
|
29
31
|
}, children);
|
|
30
32
|
}
|
|
31
33
|
return /*#__PURE__*/React.createElement("span", _extends({
|
|
@@ -24,7 +24,7 @@ const embedCardWrapperStyles = css({
|
|
|
24
24
|
margin: '0 auto'
|
|
25
25
|
});
|
|
26
26
|
const uIMediaSingleLayoutStyles = css({
|
|
27
|
-
// eslint-disable-next-line @atlaskit/design-system/
|
|
27
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
28
28
|
marginLeft: '50%',
|
|
29
29
|
transform: 'translateX(-50%)'
|
|
30
30
|
});
|
|
@@ -68,7 +68,8 @@ const MediaAnnotation = ({
|
|
|
68
68
|
// This should be fine being empty [] since the serializer serializeFragmentChild getMarkProps call always passes
|
|
69
69
|
,
|
|
70
70
|
annotationParentIds: [],
|
|
71
|
-
allowAnnotations: true
|
|
71
|
+
allowAnnotations: true,
|
|
72
|
+
useBlockLevel: true
|
|
72
73
|
}, children);
|
|
73
74
|
};
|
|
74
75
|
export default class Media extends PureComponent {
|
|
@@ -36,7 +36,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
|
|
|
36
36
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
37
37
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
38
38
|
const packageName = "@atlaskit/renderer";
|
|
39
|
-
const packageVersion = "109.10.
|
|
39
|
+
const packageVersion = "109.10.7";
|
|
40
40
|
export class Renderer extends PureComponent {
|
|
41
41
|
constructor(props) {
|
|
42
42
|
super(props);
|
|
@@ -8,7 +8,8 @@ const MarkElement = ({
|
|
|
8
8
|
annotationParentIds,
|
|
9
9
|
children,
|
|
10
10
|
dataAttributes,
|
|
11
|
-
id
|
|
11
|
+
id,
|
|
12
|
+
useBlockLevel
|
|
12
13
|
}) => {
|
|
13
14
|
const updateSubscriber = useInlineCommentSubscriberContext();
|
|
14
15
|
const states = useContext(InlineCommentsStateContext);
|
|
@@ -42,7 +43,8 @@ const MarkElement = ({
|
|
|
42
43
|
annotationParentIds: activeParentIds,
|
|
43
44
|
onClick: onClick,
|
|
44
45
|
hasFocus: hasFocus,
|
|
45
|
-
state: states[id]
|
|
46
|
+
state: states[id],
|
|
47
|
+
useBlockLevel: useBlockLevel
|
|
46
48
|
}, children);
|
|
47
49
|
};
|
|
48
50
|
export { MarkElement };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
/** @jsx jsx */
|
|
3
2
|
|
|
4
|
-
import
|
|
3
|
+
import { useMemo, useCallback } from 'react';
|
|
5
4
|
import { css, jsx } from '@emotion/react';
|
|
6
5
|
import { AnnotationSharedCSSByState, mediaAnnotationStyles } from '@atlaskit/editor-common/styles';
|
|
7
6
|
import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
@@ -20,13 +19,14 @@ const markStyles = () => css`
|
|
|
20
19
|
&[data-has-focus='true'] {
|
|
21
20
|
${AnnotationSharedCSSByState().focus};
|
|
22
21
|
}
|
|
23
|
-
|
|
24
|
-
& div.media-file-card-view {
|
|
25
|
-
${mediaAnnotationStyles};
|
|
26
|
-
z-index: -1;
|
|
27
|
-
}
|
|
28
22
|
}
|
|
29
23
|
`;
|
|
24
|
+
const blockStyles = () => css({
|
|
25
|
+
color: 'inherit',
|
|
26
|
+
backgroundColor: 'unset',
|
|
27
|
+
WebkitTapHighlightColor: 'transparent',
|
|
28
|
+
[`&[data-mark-annotation-state='${AnnotationMarkStates.ACTIVE}']`]: mediaAnnotationStyles
|
|
29
|
+
});
|
|
30
30
|
export const MarkComponent = ({
|
|
31
31
|
annotationParentIds,
|
|
32
32
|
children,
|
|
@@ -34,7 +34,8 @@ export const MarkComponent = ({
|
|
|
34
34
|
id,
|
|
35
35
|
state,
|
|
36
36
|
hasFocus,
|
|
37
|
-
onClick
|
|
37
|
+
onClick,
|
|
38
|
+
useBlockLevel
|
|
38
39
|
}) => {
|
|
39
40
|
const annotationIds = useMemo(() => [...new Set([...annotationParentIds, id])], [id, annotationParentIds]);
|
|
40
41
|
const onMarkClick = useCallback(event => {
|
|
@@ -63,15 +64,11 @@ export const MarkComponent = ({
|
|
|
63
64
|
} : {
|
|
64
65
|
'aria-details': annotationIds.join(', ')
|
|
65
66
|
};
|
|
66
|
-
return
|
|
67
|
-
id
|
|
68
|
-
onClickCapture: onMarkClick
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
onClick: onMarkClick
|
|
74
|
-
}, accessibility, overriddenData, {
|
|
75
|
-
css: markStyles
|
|
76
|
-
}), children);
|
|
67
|
+
return jsx(useBlockLevel ? 'div' : 'mark', {
|
|
68
|
+
id,
|
|
69
|
+
[getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes') ? 'onClickCapture' : 'onClick']: onMarkClick,
|
|
70
|
+
...accessibility,
|
|
71
|
+
...overriddenData,
|
|
72
|
+
css: useBlockLevel ? blockStyles : markStyles
|
|
73
|
+
}, children);
|
|
77
74
|
};
|
|
@@ -15,7 +15,8 @@ var AnnotationComponent = function AnnotationComponent(_ref) {
|
|
|
15
15
|
dataAttributes = _ref.dataAttributes,
|
|
16
16
|
_ref$annotationParent = _ref.annotationParentIds,
|
|
17
17
|
annotationParentIds = _ref$annotationParent === void 0 ? [] : _ref$annotationParent,
|
|
18
|
-
allowAnnotations = _ref.allowAnnotations
|
|
18
|
+
allowAnnotations = _ref.allowAnnotations,
|
|
19
|
+
useBlockLevel = _ref.useBlockLevel;
|
|
19
20
|
var data = _objectSpread(_objectSpread({}, dataAttributes), buildAnnotationMarkDataAttributes({
|
|
20
21
|
id: id,
|
|
21
22
|
annotationType: annotationType
|
|
@@ -25,7 +26,8 @@ var AnnotationComponent = function AnnotationComponent(_ref) {
|
|
|
25
26
|
id: id,
|
|
26
27
|
dataAttributes: data,
|
|
27
28
|
annotationParentIds: annotationParentIds,
|
|
28
|
-
annotationType: annotationType
|
|
29
|
+
annotationType: annotationType,
|
|
30
|
+
useBlockLevel: useBlockLevel
|
|
29
31
|
}, children);
|
|
30
32
|
}
|
|
31
33
|
return /*#__PURE__*/React.createElement("span", _extends({
|
|
@@ -25,7 +25,7 @@ var embedCardWrapperStyles = css({
|
|
|
25
25
|
margin: '0 auto'
|
|
26
26
|
});
|
|
27
27
|
var uIMediaSingleLayoutStyles = css({
|
|
28
|
-
// eslint-disable-next-line @atlaskit/design-system/
|
|
28
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
29
29
|
marginLeft: '50%',
|
|
30
30
|
transform: 'translateX(-50%)'
|
|
31
31
|
});
|
|
@@ -73,7 +73,8 @@ var MediaAnnotation = function MediaAnnotation(_ref3) {
|
|
|
73
73
|
// This should be fine being empty [] since the serializer serializeFragmentChild getMarkProps call always passes
|
|
74
74
|
,
|
|
75
75
|
annotationParentIds: [],
|
|
76
|
-
allowAnnotations: true
|
|
76
|
+
allowAnnotations: true,
|
|
77
|
+
useBlockLevel: true
|
|
77
78
|
}, children);
|
|
78
79
|
};
|
|
79
80
|
var Media = /*#__PURE__*/function (_PureComponent) {
|
|
@@ -46,7 +46,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
|
|
|
46
46
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
47
47
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
48
48
|
var packageName = "@atlaskit/renderer";
|
|
49
|
-
var packageVersion = "109.10.
|
|
49
|
+
var packageVersion = "109.10.7";
|
|
50
50
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
51
51
|
_inherits(Renderer, _PureComponent);
|
|
52
52
|
var _super = _createSuper(Renderer);
|
|
@@ -8,7 +8,8 @@ var MarkElement = function MarkElement(_ref) {
|
|
|
8
8
|
var annotationParentIds = _ref.annotationParentIds,
|
|
9
9
|
children = _ref.children,
|
|
10
10
|
dataAttributes = _ref.dataAttributes,
|
|
11
|
-
id = _ref.id
|
|
11
|
+
id = _ref.id,
|
|
12
|
+
useBlockLevel = _ref.useBlockLevel;
|
|
12
13
|
var updateSubscriber = useInlineCommentSubscriberContext();
|
|
13
14
|
var states = useContext(InlineCommentsStateContext);
|
|
14
15
|
var hasFocus = useHasFocusEvent({
|
|
@@ -41,7 +42,8 @@ var MarkElement = function MarkElement(_ref) {
|
|
|
41
42
|
annotationParentIds: activeParentIds,
|
|
42
43
|
onClick: onClick,
|
|
43
44
|
hasFocus: hasFocus,
|
|
44
|
-
state: states[id]
|
|
45
|
+
state: states[id],
|
|
46
|
+
useBlockLevel: useBlockLevel
|
|
45
47
|
}, children);
|
|
46
48
|
};
|
|
47
49
|
export { MarkElement };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
3
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
5
4
|
var _templateObject;
|
|
6
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
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; }
|
|
8
7
|
/** @jsx jsx */
|
|
9
8
|
|
|
10
|
-
import
|
|
9
|
+
import { useMemo, useCallback } from 'react';
|
|
11
10
|
import { css, jsx } from '@emotion/react';
|
|
12
11
|
import { AnnotationSharedCSSByState, mediaAnnotationStyles } from '@atlaskit/editor-common/styles';
|
|
13
12
|
import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
@@ -15,7 +14,14 @@ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
|
15
14
|
|
|
16
15
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- `AnnotationSharedCSSByState` is not object-safe
|
|
17
16
|
var markStyles = function markStyles() {
|
|
18
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: transparent;\n\n &[data-mark-annotation-state='", "'] {\n ", ";\n\n &:focus,\n &[data-has-focus='true'] {\n ", ";\n }\n
|
|
17
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: transparent;\n\n &[data-mark-annotation-state='", "'] {\n ", ";\n\n &:focus,\n &[data-has-focus='true'] {\n ", ";\n }\n }\n"])), AnnotationMarkStates.ACTIVE, AnnotationSharedCSSByState().blur, AnnotationSharedCSSByState().focus);
|
|
18
|
+
};
|
|
19
|
+
var blockStyles = function blockStyles() {
|
|
20
|
+
return css(_defineProperty({
|
|
21
|
+
color: 'inherit',
|
|
22
|
+
backgroundColor: 'unset',
|
|
23
|
+
WebkitTapHighlightColor: 'transparent'
|
|
24
|
+
}, "&[data-mark-annotation-state='".concat(AnnotationMarkStates.ACTIVE, "']"), mediaAnnotationStyles));
|
|
19
25
|
};
|
|
20
26
|
export var MarkComponent = function MarkComponent(_ref) {
|
|
21
27
|
var annotationParentIds = _ref.annotationParentIds,
|
|
@@ -24,7 +30,8 @@ export var MarkComponent = function MarkComponent(_ref) {
|
|
|
24
30
|
id = _ref.id,
|
|
25
31
|
state = _ref.state,
|
|
26
32
|
hasFocus = _ref.hasFocus,
|
|
27
|
-
onClick = _ref.onClick
|
|
33
|
+
onClick = _ref.onClick,
|
|
34
|
+
useBlockLevel = _ref.useBlockLevel;
|
|
28
35
|
var annotationIds = useMemo(function () {
|
|
29
36
|
return _toConsumableArray(new Set([].concat(_toConsumableArray(annotationParentIds), [id])));
|
|
30
37
|
}, [id, annotationParentIds]);
|
|
@@ -53,15 +60,9 @@ export var MarkComponent = function MarkComponent(_ref) {
|
|
|
53
60
|
} : {
|
|
54
61
|
'aria-details': annotationIds.join(', ')
|
|
55
62
|
};
|
|
56
|
-
return
|
|
57
|
-
id: id
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
css: markStyles
|
|
61
|
-
}), children) : jsx("mark", _extends({
|
|
62
|
-
id: id,
|
|
63
|
-
onClick: onMarkClick
|
|
64
|
-
}, accessibility, overriddenData, {
|
|
65
|
-
css: markStyles
|
|
63
|
+
return jsx(useBlockLevel ? 'div' : 'mark', _objectSpread(_objectSpread(_objectSpread(_defineProperty({
|
|
64
|
+
id: id
|
|
65
|
+
}, getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes') ? 'onClickCapture' : 'onClick', onMarkClick), accessibility), overriddenData), {}, {
|
|
66
|
+
css: useBlockLevel ? blockStyles : markStyles
|
|
66
67
|
}), children);
|
|
67
68
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { MarkProps, AnnotationMarkMeta } from '../types';
|
|
3
|
-
import { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { MarkProps, AnnotationMarkMeta } from '../types';
|
|
3
|
+
import type { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
export declare const isAnnotationMark: (mark: Mark) => boolean;
|
|
5
|
-
declare const AnnotationComponent: ({ id, annotationType, children, dataAttributes, annotationParentIds, allowAnnotations, }: MarkProps<AnnotationMarkMeta>) => JSX.Element;
|
|
5
|
+
declare const AnnotationComponent: ({ id, annotationType, children, dataAttributes, annotationParentIds, allowAnnotations, useBlockLevel, }: MarkProps<AnnotationMarkMeta>) => JSX.Element;
|
|
6
6
|
export default AnnotationComponent;
|
|
@@ -53,6 +53,7 @@ export interface AnnotationMarkMeta extends MarkMeta {
|
|
|
53
53
|
annotationType: AnnotationTypes;
|
|
54
54
|
annotationParentIds: string[];
|
|
55
55
|
allowAnnotations: boolean;
|
|
56
|
+
useBlockLevel?: boolean;
|
|
56
57
|
}
|
|
57
58
|
export type NodeProps<NodeAttrs = {}> = NodeAttrs & PropsWithChildren<NodeMeta>;
|
|
58
59
|
export type MarkProps<MarkAttrs = {}> = MarkAttrs & PropsWithChildren<MarkMeta>;
|
|
@@ -5,6 +5,7 @@ type MarkElementProps = React.PropsWithChildren<{
|
|
|
5
5
|
annotationParentIds: AnnotationId[];
|
|
6
6
|
dataAttributes: AnnotationDataAttributes;
|
|
7
7
|
annotationType: AnnotationTypes;
|
|
8
|
+
useBlockLevel?: boolean;
|
|
8
9
|
}>;
|
|
9
|
-
declare const MarkElement: ({ annotationParentIds, children, dataAttributes, id, }: MarkElementProps) => JSX.Element;
|
|
10
|
+
declare const MarkElement: ({ annotationParentIds, children, dataAttributes, id, useBlockLevel, }: MarkElementProps) => JSX.Element;
|
|
10
11
|
export { MarkElement };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
import type React from 'react';
|
|
3
2
|
import type { OnAnnotationClickPayload } from '@atlaskit/editor-common/types';
|
|
4
3
|
import type { AnnotationId, AnnotationDataAttributes } from '@atlaskit/adf-schema';
|
|
5
4
|
import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
@@ -10,6 +9,45 @@ type MarkComponentProps = {
|
|
|
10
9
|
state: AnnotationMarkStates | null;
|
|
11
10
|
hasFocus: boolean;
|
|
12
11
|
onClick: (props: OnAnnotationClickPayload) => void;
|
|
12
|
+
useBlockLevel?: boolean;
|
|
13
13
|
};
|
|
14
|
-
export declare const MarkComponent: ({ annotationParentIds, children, dataAttributes, id, state, hasFocus, onClick, }: React.PropsWithChildren<MarkComponentProps>) =>
|
|
14
|
+
export declare const MarkComponent: ({ annotationParentIds, children, dataAttributes, id, state, hasFocus, onClick, useBlockLevel, }: React.PropsWithChildren<MarkComponentProps>) => React.DetailedReactHTMLElement<{
|
|
15
|
+
css: () => import("@emotion/react").SerializedStyles;
|
|
16
|
+
'data-mark-type': string;
|
|
17
|
+
'data-mark-annotation-type': import("@atlaskit/adf-schema").AnnotationTypes;
|
|
18
|
+
'data-id': string;
|
|
19
|
+
'data-mark-annotation-state'?: AnnotationMarkStates | undefined;
|
|
20
|
+
'aria-disabled': boolean;
|
|
21
|
+
'aria-details'?: undefined;
|
|
22
|
+
id: string;
|
|
23
|
+
} | {
|
|
24
|
+
css: () => import("@emotion/react").SerializedStyles;
|
|
25
|
+
'data-mark-annotation-state': AnnotationMarkStates;
|
|
26
|
+
'data-has-focus': boolean;
|
|
27
|
+
'data-mark-type': string;
|
|
28
|
+
'data-mark-annotation-type': import("@atlaskit/adf-schema").AnnotationTypes;
|
|
29
|
+
'data-id': string;
|
|
30
|
+
'aria-disabled': boolean;
|
|
31
|
+
'aria-details'?: undefined;
|
|
32
|
+
id: string;
|
|
33
|
+
} | {
|
|
34
|
+
css: () => import("@emotion/react").SerializedStyles;
|
|
35
|
+
'data-mark-type': string;
|
|
36
|
+
'data-mark-annotation-type': import("@atlaskit/adf-schema").AnnotationTypes;
|
|
37
|
+
'data-id': string;
|
|
38
|
+
'data-mark-annotation-state'?: AnnotationMarkStates | undefined;
|
|
39
|
+
'aria-details': string;
|
|
40
|
+
'aria-disabled'?: undefined;
|
|
41
|
+
id: string;
|
|
42
|
+
} | {
|
|
43
|
+
css: () => import("@emotion/react").SerializedStyles;
|
|
44
|
+
'data-mark-annotation-state': AnnotationMarkStates;
|
|
45
|
+
'data-has-focus': boolean;
|
|
46
|
+
'data-mark-type': string;
|
|
47
|
+
'data-mark-annotation-type': import("@atlaskit/adf-schema").AnnotationTypes;
|
|
48
|
+
'data-id': string;
|
|
49
|
+
'aria-details': string;
|
|
50
|
+
'aria-disabled'?: undefined;
|
|
51
|
+
id: string;
|
|
52
|
+
}, HTMLElement>;
|
|
15
53
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { MarkProps, AnnotationMarkMeta } from '../types';
|
|
3
|
-
import { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { MarkProps, AnnotationMarkMeta } from '../types';
|
|
3
|
+
import type { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
export declare const isAnnotationMark: (mark: Mark) => boolean;
|
|
5
|
-
declare const AnnotationComponent: ({ id, annotationType, children, dataAttributes, annotationParentIds, allowAnnotations, }: MarkProps<AnnotationMarkMeta>) => JSX.Element;
|
|
5
|
+
declare const AnnotationComponent: ({ id, annotationType, children, dataAttributes, annotationParentIds, allowAnnotations, useBlockLevel, }: MarkProps<AnnotationMarkMeta>) => JSX.Element;
|
|
6
6
|
export default AnnotationComponent;
|
|
@@ -53,6 +53,7 @@ export interface AnnotationMarkMeta extends MarkMeta {
|
|
|
53
53
|
annotationType: AnnotationTypes;
|
|
54
54
|
annotationParentIds: string[];
|
|
55
55
|
allowAnnotations: boolean;
|
|
56
|
+
useBlockLevel?: boolean;
|
|
56
57
|
}
|
|
57
58
|
export type NodeProps<NodeAttrs = {}> = NodeAttrs & PropsWithChildren<NodeMeta>;
|
|
58
59
|
export type MarkProps<MarkAttrs = {}> = MarkAttrs & PropsWithChildren<MarkMeta>;
|
|
@@ -5,6 +5,7 @@ type MarkElementProps = React.PropsWithChildren<{
|
|
|
5
5
|
annotationParentIds: AnnotationId[];
|
|
6
6
|
dataAttributes: AnnotationDataAttributes;
|
|
7
7
|
annotationType: AnnotationTypes;
|
|
8
|
+
useBlockLevel?: boolean;
|
|
8
9
|
}>;
|
|
9
|
-
declare const MarkElement: ({ annotationParentIds, children, dataAttributes, id, }: MarkElementProps) => JSX.Element;
|
|
10
|
+
declare const MarkElement: ({ annotationParentIds, children, dataAttributes, id, useBlockLevel, }: MarkElementProps) => JSX.Element;
|
|
10
11
|
export { MarkElement };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
import type React from 'react';
|
|
3
2
|
import type { OnAnnotationClickPayload } from '@atlaskit/editor-common/types';
|
|
4
3
|
import type { AnnotationId, AnnotationDataAttributes } from '@atlaskit/adf-schema';
|
|
5
4
|
import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
@@ -10,6 +9,45 @@ type MarkComponentProps = {
|
|
|
10
9
|
state: AnnotationMarkStates | null;
|
|
11
10
|
hasFocus: boolean;
|
|
12
11
|
onClick: (props: OnAnnotationClickPayload) => void;
|
|
12
|
+
useBlockLevel?: boolean;
|
|
13
13
|
};
|
|
14
|
-
export declare const MarkComponent: ({ annotationParentIds, children, dataAttributes, id, state, hasFocus, onClick, }: React.PropsWithChildren<MarkComponentProps>) =>
|
|
14
|
+
export declare const MarkComponent: ({ annotationParentIds, children, dataAttributes, id, state, hasFocus, onClick, useBlockLevel, }: React.PropsWithChildren<MarkComponentProps>) => React.DetailedReactHTMLElement<{
|
|
15
|
+
css: () => import("@emotion/react").SerializedStyles;
|
|
16
|
+
'data-mark-type': string;
|
|
17
|
+
'data-mark-annotation-type': import("@atlaskit/adf-schema").AnnotationTypes;
|
|
18
|
+
'data-id': string;
|
|
19
|
+
'data-mark-annotation-state'?: AnnotationMarkStates | undefined;
|
|
20
|
+
'aria-disabled': boolean;
|
|
21
|
+
'aria-details'?: undefined;
|
|
22
|
+
id: string;
|
|
23
|
+
} | {
|
|
24
|
+
css: () => import("@emotion/react").SerializedStyles;
|
|
25
|
+
'data-mark-annotation-state': AnnotationMarkStates;
|
|
26
|
+
'data-has-focus': boolean;
|
|
27
|
+
'data-mark-type': string;
|
|
28
|
+
'data-mark-annotation-type': import("@atlaskit/adf-schema").AnnotationTypes;
|
|
29
|
+
'data-id': string;
|
|
30
|
+
'aria-disabled': boolean;
|
|
31
|
+
'aria-details'?: undefined;
|
|
32
|
+
id: string;
|
|
33
|
+
} | {
|
|
34
|
+
css: () => import("@emotion/react").SerializedStyles;
|
|
35
|
+
'data-mark-type': string;
|
|
36
|
+
'data-mark-annotation-type': import("@atlaskit/adf-schema").AnnotationTypes;
|
|
37
|
+
'data-id': string;
|
|
38
|
+
'data-mark-annotation-state'?: AnnotationMarkStates | undefined;
|
|
39
|
+
'aria-details': string;
|
|
40
|
+
'aria-disabled'?: undefined;
|
|
41
|
+
id: string;
|
|
42
|
+
} | {
|
|
43
|
+
css: () => import("@emotion/react").SerializedStyles;
|
|
44
|
+
'data-mark-annotation-state': AnnotationMarkStates;
|
|
45
|
+
'data-has-focus': boolean;
|
|
46
|
+
'data-mark-type': string;
|
|
47
|
+
'data-mark-annotation-type': import("@atlaskit/adf-schema").AnnotationTypes;
|
|
48
|
+
'data-id': string;
|
|
49
|
+
'aria-details': string;
|
|
50
|
+
'aria-disabled'?: undefined;
|
|
51
|
+
id: string;
|
|
52
|
+
}, HTMLElement>;
|
|
15
53
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "109.10.
|
|
3
|
+
"version": "109.10.7",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
32
32
|
"@atlaskit/button": "^17.7.0",
|
|
33
33
|
"@atlaskit/code": "^15.1.0",
|
|
34
|
-
"@atlaskit/editor-common": "^78.
|
|
34
|
+
"@atlaskit/editor-common": "^78.20.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
36
36
|
"@atlaskit/editor-palette": "1.5.3",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "3.0.0",
|