@atlaskit/renderer 109.8.1 → 109.8.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 +6 -0
- package/dist/cjs/react/nodes/inlineCard.js +22 -8
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/annotations/element/mark.js +14 -2
- package/dist/es2019/react/nodes/inlineCard.js +21 -8
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/annotations/element/mark.js +12 -2
- package/dist/esm/react/nodes/inlineCard.js +21 -8
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/annotations/element/mark.js +12 -2
- package/dist/types/react/nodes/inlineCard.d.ts +9 -8
- package/dist/types/ui/annotations/element/mark.d.ts +4 -4
- package/dist/types-ts4.5/react/nodes/inlineCard.d.ts +9 -8
- package/dist/types-ts4.5/ui/annotations/element/mark.d.ts +4 -4
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 109.8.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#81133](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/81133) [`ad1f563ea96b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ad1f563ea96b) - [ux] ED-22503 Styling for annotations on the inline card for edit and render view
|
|
8
|
+
|
|
3
9
|
## 109.8.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -6,14 +6,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _react =
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
10
|
var _smartCard = require("@atlaskit/smart-card");
|
|
11
11
|
var _ssr = require("@atlaskit/smart-card/ssr");
|
|
12
12
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
13
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
15
|
var _fallback = require("./fallback");
|
|
14
16
|
var _SmartCardStorage = require("../../ui/SmartCardStorage");
|
|
15
17
|
var _getCardClickHandler = require("../utils/getCardClickHandler");
|
|
16
18
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
19
|
+
/** @jsx jsx */
|
|
20
|
+
|
|
21
|
+
var annotatedCard = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes') ? (0, _react.css)({
|
|
22
|
+
"[data-mark-type='annotation'][data-mark-annotation-state='active'] &": {
|
|
23
|
+
background: "var(--ds-background-accent-yellow-subtler, ".concat(_colors.Y75, ")"),
|
|
24
|
+
borderBottom: "2px solid ".concat("var(--ds-border-accent-yellow, ".concat(_colors.Y300, ")")),
|
|
25
|
+
boxShadow: "var(--ds-shadow-overlay, ".concat("1px 2px 3px ".concat(_colors.N60A, ", -1px 2px 3px ").concat(_colors.N60A), ")"),
|
|
26
|
+
cursor: 'pointer',
|
|
27
|
+
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-025, 2px)")
|
|
28
|
+
}
|
|
29
|
+
}) : '';
|
|
17
30
|
var InlineCard = function InlineCard(props) {
|
|
18
31
|
var url = props.url,
|
|
19
32
|
data = props.data,
|
|
@@ -41,9 +54,9 @@ var InlineCard = function InlineCard(props) {
|
|
|
41
54
|
location: 'renderer'
|
|
42
55
|
};
|
|
43
56
|
if (ssr && url) {
|
|
44
|
-
return
|
|
57
|
+
return (0, _react.jsx)(_analyticsNext.AnalyticsContext, {
|
|
45
58
|
data: analyticsData
|
|
46
|
-
},
|
|
59
|
+
}, (0, _react.jsx)(_ssr.CardSSR, {
|
|
47
60
|
appearance: "inline",
|
|
48
61
|
url: url,
|
|
49
62
|
showAuthTooltip: showAuthTooltip,
|
|
@@ -59,15 +72,16 @@ var InlineCard = function InlineCard(props) {
|
|
|
59
72
|
throw err;
|
|
60
73
|
}
|
|
61
74
|
};
|
|
62
|
-
return
|
|
75
|
+
return (0, _react.jsx)(_analyticsNext.AnalyticsContext, {
|
|
63
76
|
data: analyticsData
|
|
64
|
-
},
|
|
77
|
+
}, (0, _react.jsx)("span", {
|
|
65
78
|
"data-inline-card": true,
|
|
66
79
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
67
|
-
"data-card-url": url
|
|
68
|
-
|
|
80
|
+
"data-card-url": url,
|
|
81
|
+
css: annotatedCard
|
|
82
|
+
}, (0, _react.jsx)(_fallback.CardErrorBoundary, (0, _extends2.default)({
|
|
69
83
|
unsupportedComponent: _ui.UnsupportedInline
|
|
70
|
-
}, cardProps),
|
|
84
|
+
}, cardProps), (0, _react.jsx)(_smartCard.Card, (0, _extends2.default)({
|
|
71
85
|
appearance: "inline",
|
|
72
86
|
showHoverPreview: !hideHoverPreview,
|
|
73
87
|
showAuthTooltip: showAuthTooltip,
|
|
@@ -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.8.
|
|
58
|
+
var packageVersion = "109.8.2";
|
|
59
59
|
var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
60
60
|
(0, _inherits2.default)(Renderer, _PureComponent);
|
|
61
61
|
var _super = _createSuper(Renderer);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -9,12 +10,15 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
9
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
12
|
-
var _react = require("react");
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
14
|
var _react2 = require("@emotion/react");
|
|
14
15
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
15
16
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
18
|
var _templateObject;
|
|
17
19
|
/** @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; }
|
|
18
22
|
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; }
|
|
19
23
|
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; }
|
|
20
24
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- `AnnotationSharedCSSByState` is not object-safe
|
|
@@ -40,6 +44,9 @@ var MarkComponent = exports.MarkComponent = function MarkComponent(_ref) {
|
|
|
40
44
|
|
|
41
45
|
// prevents from opening link URL inside webView in Safari
|
|
42
46
|
event.preventDefault();
|
|
47
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes')) {
|
|
48
|
+
event.stopPropagation();
|
|
49
|
+
}
|
|
43
50
|
onClick({
|
|
44
51
|
eventTarget: event.target,
|
|
45
52
|
annotationIds: annotationIds
|
|
@@ -54,7 +61,12 @@ var MarkComponent = exports.MarkComponent = function MarkComponent(_ref) {
|
|
|
54
61
|
} : {
|
|
55
62
|
'aria-details': annotationIds.join(', ')
|
|
56
63
|
};
|
|
57
|
-
return (0, _react2.jsx)("mark", (0, _extends2.default)({
|
|
64
|
+
return (0, _platformFeatureFlags.getBooleanFF)('platform.editor.allow-inline-comments-for-inline-nodes') ? (0, _react2.jsx)("mark", (0, _extends2.default)({
|
|
65
|
+
id: id,
|
|
66
|
+
onClickCapture: onMarkClick
|
|
67
|
+
}, accessibility, overriddenData, {
|
|
68
|
+
css: markStyles
|
|
69
|
+
}), children) : (0, _react2.jsx)("mark", (0, _extends2.default)({
|
|
58
70
|
id: id,
|
|
59
71
|
onClick: onMarkClick
|
|
60
72
|
}, accessibility, overriddenData, {
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import { Card } from '@atlaskit/smart-card';
|
|
4
5
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
5
6
|
import { UnsupportedInline } from '@atlaskit/editor-common/ui';
|
|
7
|
+
import { N60A, Y300, Y75 } from '@atlaskit/theme/colors';
|
|
8
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
9
|
import { CardErrorBoundary } from './fallback';
|
|
7
10
|
import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
8
11
|
import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
9
12
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
13
|
+
const annotatedCard = getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes') ? css({
|
|
14
|
+
"[data-mark-type='annotation'][data-mark-annotation-state='active'] &": {
|
|
15
|
+
background: `var(--ds-background-accent-yellow-subtler, ${Y75})`,
|
|
16
|
+
borderBottom: `2px solid ${`var(--ds-border-accent-yellow, ${Y300})`}`,
|
|
17
|
+
boxShadow: `var(--ds-shadow-overlay, ${`1px 2px 3px ${N60A}, -1px 2px 3px ${N60A}`})`,
|
|
18
|
+
cursor: 'pointer',
|
|
19
|
+
padding: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-025, 2px)"}`
|
|
20
|
+
}
|
|
21
|
+
}) : '';
|
|
10
22
|
const InlineCard = props => {
|
|
11
23
|
const {
|
|
12
24
|
url,
|
|
@@ -37,9 +49,9 @@ const InlineCard = props => {
|
|
|
37
49
|
location: 'renderer'
|
|
38
50
|
};
|
|
39
51
|
if (ssr && url) {
|
|
40
|
-
return
|
|
52
|
+
return jsx(AnalyticsContext, {
|
|
41
53
|
data: analyticsData
|
|
42
|
-
},
|
|
54
|
+
}, jsx(CardSSR, {
|
|
43
55
|
appearance: "inline",
|
|
44
56
|
url: url,
|
|
45
57
|
showAuthTooltip: showAuthTooltip,
|
|
@@ -56,15 +68,16 @@ const InlineCard = props => {
|
|
|
56
68
|
throw err;
|
|
57
69
|
}
|
|
58
70
|
};
|
|
59
|
-
return
|
|
71
|
+
return jsx(AnalyticsContext, {
|
|
60
72
|
data: analyticsData
|
|
61
|
-
},
|
|
73
|
+
}, jsx("span", {
|
|
62
74
|
"data-inline-card": true,
|
|
63
75
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
64
|
-
"data-card-url": url
|
|
65
|
-
|
|
76
|
+
"data-card-url": url,
|
|
77
|
+
css: annotatedCard
|
|
78
|
+
}, jsx(CardErrorBoundary, _extends({
|
|
66
79
|
unsupportedComponent: UnsupportedInline
|
|
67
|
-
}, cardProps),
|
|
80
|
+
}, cardProps), jsx(Card, _extends({
|
|
68
81
|
appearance: "inline",
|
|
69
82
|
showHoverPreview: !hideHoverPreview,
|
|
70
83
|
showAuthTooltip: showAuthTooltip,
|
|
@@ -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.8.
|
|
39
|
+
const packageVersion = "109.8.2";
|
|
40
40
|
export class Renderer extends PureComponent {
|
|
41
41
|
constructor(props) {
|
|
42
42
|
super(props);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
import React, { useMemo, useCallback } from 'react';
|
|
4
5
|
import { css, jsx } from '@emotion/react';
|
|
5
6
|
import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
|
|
6
7
|
import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
8
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
9
|
|
|
8
10
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- `AnnotationSharedCSSByState` is not object-safe
|
|
9
11
|
const markStyles = () => css`
|
|
@@ -38,6 +40,9 @@ export const MarkComponent = ({
|
|
|
38
40
|
|
|
39
41
|
// prevents from opening link URL inside webView in Safari
|
|
40
42
|
event.preventDefault();
|
|
43
|
+
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes')) {
|
|
44
|
+
event.stopPropagation();
|
|
45
|
+
}
|
|
41
46
|
onClick({
|
|
42
47
|
eventTarget: event.target,
|
|
43
48
|
annotationIds
|
|
@@ -53,7 +58,12 @@ export const MarkComponent = ({
|
|
|
53
58
|
} : {
|
|
54
59
|
'aria-details': annotationIds.join(', ')
|
|
55
60
|
};
|
|
56
|
-
return jsx("mark", _extends({
|
|
61
|
+
return getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes') ? jsx("mark", _extends({
|
|
62
|
+
id: id,
|
|
63
|
+
onClickCapture: onMarkClick
|
|
64
|
+
}, accessibility, overriddenData, {
|
|
65
|
+
css: markStyles
|
|
66
|
+
}), children) : jsx("mark", _extends({
|
|
57
67
|
id: id,
|
|
58
68
|
onClick: onMarkClick
|
|
59
69
|
}, accessibility, overriddenData, {
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import { Card } from '@atlaskit/smart-card';
|
|
4
5
|
import { CardSSR } from '@atlaskit/smart-card/ssr';
|
|
5
6
|
import { UnsupportedInline } from '@atlaskit/editor-common/ui';
|
|
7
|
+
import { N60A, Y300, Y75 } from '@atlaskit/theme/colors';
|
|
8
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
9
|
import { CardErrorBoundary } from './fallback';
|
|
7
10
|
import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
8
11
|
import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
9
12
|
import { AnalyticsContext } from '@atlaskit/analytics-next';
|
|
13
|
+
var annotatedCard = getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes') ? css({
|
|
14
|
+
"[data-mark-type='annotation'][data-mark-annotation-state='active'] &": {
|
|
15
|
+
background: "var(--ds-background-accent-yellow-subtler, ".concat(Y75, ")"),
|
|
16
|
+
borderBottom: "2px solid ".concat("var(--ds-border-accent-yellow, ".concat(Y300, ")")),
|
|
17
|
+
boxShadow: "var(--ds-shadow-overlay, ".concat("1px 2px 3px ".concat(N60A, ", -1px 2px 3px ").concat(N60A), ")"),
|
|
18
|
+
cursor: 'pointer',
|
|
19
|
+
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-025, 2px)")
|
|
20
|
+
}
|
|
21
|
+
}) : '';
|
|
10
22
|
var InlineCard = function InlineCard(props) {
|
|
11
23
|
var url = props.url,
|
|
12
24
|
data = props.data,
|
|
@@ -34,9 +46,9 @@ var InlineCard = function InlineCard(props) {
|
|
|
34
46
|
location: 'renderer'
|
|
35
47
|
};
|
|
36
48
|
if (ssr && url) {
|
|
37
|
-
return
|
|
49
|
+
return jsx(AnalyticsContext, {
|
|
38
50
|
data: analyticsData
|
|
39
|
-
},
|
|
51
|
+
}, jsx(CardSSR, {
|
|
40
52
|
appearance: "inline",
|
|
41
53
|
url: url,
|
|
42
54
|
showAuthTooltip: showAuthTooltip,
|
|
@@ -52,15 +64,16 @@ var InlineCard = function InlineCard(props) {
|
|
|
52
64
|
throw err;
|
|
53
65
|
}
|
|
54
66
|
};
|
|
55
|
-
return
|
|
67
|
+
return jsx(AnalyticsContext, {
|
|
56
68
|
data: analyticsData
|
|
57
|
-
},
|
|
69
|
+
}, jsx("span", {
|
|
58
70
|
"data-inline-card": true,
|
|
59
71
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
60
|
-
"data-card-url": url
|
|
61
|
-
|
|
72
|
+
"data-card-url": url,
|
|
73
|
+
css: annotatedCard
|
|
74
|
+
}, jsx(CardErrorBoundary, _extends({
|
|
62
75
|
unsupportedComponent: UnsupportedInline
|
|
63
|
-
}, cardProps),
|
|
76
|
+
}, cardProps), jsx(Card, _extends({
|
|
64
77
|
appearance: "inline",
|
|
65
78
|
showHoverPreview: !hideHoverPreview,
|
|
66
79
|
showAuthTooltip: showAuthTooltip,
|
|
@@ -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.8.
|
|
49
|
+
var packageVersion = "109.8.2";
|
|
50
50
|
export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
51
51
|
_inherits(Renderer, _PureComponent);
|
|
52
52
|
var _super = _createSuper(Renderer);
|
|
@@ -6,10 +6,12 @@ var _templateObject;
|
|
|
6
6
|
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
7
|
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
8
|
/** @jsx jsx */
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
import React, { useMemo, useCallback } from 'react';
|
|
10
11
|
import { css, jsx } from '@emotion/react';
|
|
11
12
|
import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
|
|
12
13
|
import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
14
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
13
15
|
|
|
14
16
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- `AnnotationSharedCSSByState` is not object-safe
|
|
15
17
|
var markStyles = function markStyles() {
|
|
@@ -34,6 +36,9 @@ export var MarkComponent = function MarkComponent(_ref) {
|
|
|
34
36
|
|
|
35
37
|
// prevents from opening link URL inside webView in Safari
|
|
36
38
|
event.preventDefault();
|
|
39
|
+
if (getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes')) {
|
|
40
|
+
event.stopPropagation();
|
|
41
|
+
}
|
|
37
42
|
onClick({
|
|
38
43
|
eventTarget: event.target,
|
|
39
44
|
annotationIds: annotationIds
|
|
@@ -48,7 +53,12 @@ export var MarkComponent = function MarkComponent(_ref) {
|
|
|
48
53
|
} : {
|
|
49
54
|
'aria-details': annotationIds.join(', ')
|
|
50
55
|
};
|
|
51
|
-
return jsx("mark", _extends({
|
|
56
|
+
return getBooleanFF('platform.editor.allow-inline-comments-for-inline-nodes') ? jsx("mark", _extends({
|
|
57
|
+
id: id,
|
|
58
|
+
onClickCapture: onMarkClick
|
|
59
|
+
}, accessibility, overriddenData, {
|
|
60
|
+
css: markStyles
|
|
61
|
+
}), children) : jsx("mark", _extends({
|
|
52
62
|
id: id,
|
|
53
63
|
onClick: onMarkClick
|
|
54
64
|
}, accessibility, overriddenData, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
3
3
|
import type { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
|
|
4
4
|
import type { SmartLinksOptions } from '../../types/smartLinksOptions';
|
|
@@ -8,6 +8,7 @@ export interface InlineCardProps {
|
|
|
8
8
|
eventHandlers?: EventHandlers;
|
|
9
9
|
portal?: HTMLElement;
|
|
10
10
|
smartLinks?: SmartLinksOptions;
|
|
11
|
+
marks?: string[];
|
|
11
12
|
}
|
|
12
13
|
declare const _default: {
|
|
13
14
|
new (props: import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps> | Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>): {
|
|
@@ -16,16 +17,16 @@ declare const _default: {
|
|
|
16
17
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
17
18
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
18
19
|
readonly props: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>> & Readonly<{
|
|
19
|
-
children?:
|
|
20
|
+
children?: import("react").ReactNode;
|
|
20
21
|
}>;
|
|
21
22
|
state: Readonly<{}>;
|
|
22
23
|
refs: {
|
|
23
|
-
[key: string]:
|
|
24
|
+
[key: string]: import("react").ReactInstance;
|
|
24
25
|
};
|
|
25
26
|
componentDidMount?(): void;
|
|
26
27
|
shouldComponentUpdate?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
27
28
|
componentWillUnmount?(): void;
|
|
28
|
-
componentDidCatch?(error: Error, errorInfo:
|
|
29
|
+
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
29
30
|
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>, prevState: Readonly<{}>): any;
|
|
30
31
|
componentDidUpdate?(prevProps: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
31
32
|
componentWillMount?(): void;
|
|
@@ -41,16 +42,16 @@ declare const _default: {
|
|
|
41
42
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
42
43
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
43
44
|
readonly props: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>> & Readonly<{
|
|
44
|
-
children?:
|
|
45
|
+
children?: import("react").ReactNode;
|
|
45
46
|
}>;
|
|
46
47
|
state: Readonly<{}>;
|
|
47
48
|
refs: {
|
|
48
|
-
[key: string]:
|
|
49
|
+
[key: string]: import("react").ReactInstance;
|
|
49
50
|
};
|
|
50
51
|
componentDidMount?(): void;
|
|
51
52
|
shouldComponentUpdate?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
52
53
|
componentWillUnmount?(): void;
|
|
53
|
-
componentDidCatch?(error: Error, errorInfo:
|
|
54
|
+
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
54
55
|
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>, prevState: Readonly<{}>): any;
|
|
55
56
|
componentDidUpdate?(prevProps: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
56
57
|
componentWillMount?(): void;
|
|
@@ -60,6 +61,6 @@ declare const _default: {
|
|
|
60
61
|
componentWillUpdate?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
|
61
62
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
|
62
63
|
};
|
|
63
|
-
contextType?:
|
|
64
|
+
contextType?: import("react").Context<any> | undefined;
|
|
64
65
|
};
|
|
65
66
|
export default _default;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import type { OnAnnotationClickPayload } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { AnnotationId, AnnotationDataAttributes } from '@atlaskit/adf-schema';
|
|
5
5
|
import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
6
|
-
type MarkComponentProps =
|
|
6
|
+
type MarkComponentProps = {
|
|
7
7
|
id: AnnotationId;
|
|
8
8
|
annotationParentIds: AnnotationId[];
|
|
9
9
|
dataAttributes: AnnotationDataAttributes;
|
|
10
10
|
state: AnnotationMarkStates | null;
|
|
11
11
|
hasFocus: boolean;
|
|
12
12
|
onClick: (props: OnAnnotationClickPayload) => void;
|
|
13
|
-
}
|
|
14
|
-
export declare const MarkComponent: ({ annotationParentIds, children, dataAttributes, id, state, hasFocus, onClick, }: MarkComponentProps) => jsx.JSX.Element;
|
|
13
|
+
};
|
|
14
|
+
export declare const MarkComponent: ({ annotationParentIds, children, dataAttributes, id, state, hasFocus, onClick, }: React.PropsWithChildren<MarkComponentProps>) => jsx.JSX.Element;
|
|
15
15
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import type { EventHandlers } from '@atlaskit/editor-common/ui';
|
|
3
3
|
import type { WithSmartCardStorageProps } from '../../ui/SmartCardStorage';
|
|
4
4
|
import type { SmartLinksOptions } from '../../types/smartLinksOptions';
|
|
@@ -8,6 +8,7 @@ export interface InlineCardProps {
|
|
|
8
8
|
eventHandlers?: EventHandlers;
|
|
9
9
|
portal?: HTMLElement;
|
|
10
10
|
smartLinks?: SmartLinksOptions;
|
|
11
|
+
marks?: string[];
|
|
11
12
|
}
|
|
12
13
|
declare const _default: {
|
|
13
14
|
new (props: import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps> | Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>): {
|
|
@@ -16,16 +17,16 @@ declare const _default: {
|
|
|
16
17
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
17
18
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
18
19
|
readonly props: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>> & Readonly<{
|
|
19
|
-
children?:
|
|
20
|
+
children?: import("react").ReactNode;
|
|
20
21
|
}>;
|
|
21
22
|
state: Readonly<{}>;
|
|
22
23
|
refs: {
|
|
23
|
-
[key: string]:
|
|
24
|
+
[key: string]: import("react").ReactInstance;
|
|
24
25
|
};
|
|
25
26
|
componentDidMount?(): void;
|
|
26
27
|
shouldComponentUpdate?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
27
28
|
componentWillUnmount?(): void;
|
|
28
|
-
componentDidCatch?(error: Error, errorInfo:
|
|
29
|
+
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
29
30
|
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>, prevState: Readonly<{}>): any;
|
|
30
31
|
componentDidUpdate?(prevProps: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
31
32
|
componentWillMount?(): void;
|
|
@@ -41,16 +42,16 @@ declare const _default: {
|
|
|
41
42
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
42
43
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
43
44
|
readonly props: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>> & Readonly<{
|
|
44
|
-
children?:
|
|
45
|
+
children?: import("react").ReactNode;
|
|
45
46
|
}>;
|
|
46
47
|
state: Readonly<{}>;
|
|
47
48
|
refs: {
|
|
48
|
-
[key: string]:
|
|
49
|
+
[key: string]: import("react").ReactInstance;
|
|
49
50
|
};
|
|
50
51
|
componentDidMount?(): void;
|
|
51
52
|
shouldComponentUpdate?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
52
53
|
componentWillUnmount?(): void;
|
|
53
|
-
componentDidCatch?(error: Error, errorInfo:
|
|
54
|
+
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
54
55
|
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>, prevState: Readonly<{}>): any;
|
|
55
56
|
componentDidUpdate?(prevProps: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
56
57
|
componentWillMount?(): void;
|
|
@@ -60,6 +61,6 @@ declare const _default: {
|
|
|
60
61
|
componentWillUpdate?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
|
61
62
|
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@atlaskit/editor-common/utils").Diff<InlineCardProps & WithSmartCardStorageProps, WithSmartCardStorageProps>>, nextState: Readonly<{}>, nextContext: any): void;
|
|
62
63
|
};
|
|
63
|
-
contextType?:
|
|
64
|
+
contextType?: import("react").Context<any> | undefined;
|
|
64
65
|
};
|
|
65
66
|
export default _default;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
3
|
import type { OnAnnotationClickPayload } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { AnnotationId, AnnotationDataAttributes } from '@atlaskit/adf-schema';
|
|
5
5
|
import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
6
|
-
type MarkComponentProps =
|
|
6
|
+
type MarkComponentProps = {
|
|
7
7
|
id: AnnotationId;
|
|
8
8
|
annotationParentIds: AnnotationId[];
|
|
9
9
|
dataAttributes: AnnotationDataAttributes;
|
|
10
10
|
state: AnnotationMarkStates | null;
|
|
11
11
|
hasFocus: boolean;
|
|
12
12
|
onClick: (props: OnAnnotationClickPayload) => void;
|
|
13
|
-
}
|
|
14
|
-
export declare const MarkComponent: ({ annotationParentIds, children, dataAttributes, id, state, hasFocus, onClick, }: MarkComponentProps) => jsx.JSX.Element;
|
|
13
|
+
};
|
|
14
|
+
export declare const MarkComponent: ({ annotationParentIds, children, dataAttributes, id, state, hasFocus, onClick, }: React.PropsWithChildren<MarkComponentProps>) => jsx.JSX.Element;
|
|
15
15
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "109.8.
|
|
3
|
+
"version": "109.8.2",
|
|
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.13.0",
|
|
35
35
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
36
36
|
"@atlaskit/editor-palette": "1.5.2",
|
|
37
37
|
"@atlaskit/editor-prosemirror": "3.0.0",
|
|
@@ -132,6 +132,9 @@
|
|
|
132
132
|
},
|
|
133
133
|
"platform.editor.inline_extension.extended_lcqdn": {
|
|
134
134
|
"type": "boolean"
|
|
135
|
+
},
|
|
136
|
+
"platform.editor.allow-inline-comments-for-inline-nodes": {
|
|
137
|
+
"type": "boolean"
|
|
135
138
|
}
|
|
136
139
|
},
|
|
137
140
|
"af:exports": {
|