@atlaskit/renderer 85.0.0 → 89.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +83 -0
- package/dist/cjs/analytics/enums.js +1 -0
- package/dist/cjs/messages.js +47 -1
- package/dist/cjs/react/hooks/use-observed-width.js +94 -0
- package/dist/cjs/react/index.js +2 -0
- package/dist/cjs/react/nodes/copy-text-provider.js +2 -1
- package/dist/cjs/react/nodes/heading-anchor.js +8 -2
- package/dist/cjs/react/nodes/inlineCard.js +12 -1
- package/dist/cjs/react/nodes/mediaSingle/index.js +145 -151
- package/dist/cjs/react/nodes/mention.js +0 -2
- package/dist/cjs/react/nodes/status.js +2 -1
- package/dist/cjs/react/nodes/tableCell.js +19 -8
- package/dist/cjs/react/nodes/task-item-with-providers.js +4 -2
- package/dist/cjs/react/nodes/taskItem.js +1 -0
- package/dist/cjs/render-document.js +17 -1
- package/dist/cjs/types/smartLinksOptions.js +5 -0
- package/dist/cjs/ui/Renderer/breakout-ssr.js +47 -4
- package/dist/cjs/ui/Renderer/index.js +1 -0
- package/dist/cjs/ui/SortingIcon.js +22 -9
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/enums.js +1 -0
- package/dist/es2019/messages.js +44 -0
- package/dist/es2019/react/hooks/use-observed-width.js +59 -0
- package/dist/es2019/react/index.js +2 -0
- package/dist/es2019/react/nodes/copy-text-provider.js +2 -1
- package/dist/es2019/react/nodes/heading-anchor.js +11 -2
- package/dist/es2019/react/nodes/inlineCard.js +11 -1
- package/dist/es2019/react/nodes/mediaSingle/index.js +132 -112
- package/dist/es2019/react/nodes/mention.js +0 -2
- package/dist/es2019/react/nodes/status.js +2 -1
- package/dist/es2019/react/nodes/tableCell.js +20 -9
- package/dist/es2019/react/nodes/task-item-with-providers.js +3 -1
- package/dist/es2019/react/nodes/taskItem.js +1 -0
- package/dist/es2019/render-document.js +17 -1
- package/dist/es2019/types/smartLinksOptions.js +1 -0
- package/dist/es2019/ui/Renderer/breakout-ssr.js +45 -4
- package/dist/es2019/ui/Renderer/index.js +1 -0
- package/dist/es2019/ui/SortingIcon.js +22 -10
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/enums.js +1 -0
- package/dist/esm/messages.js +44 -0
- package/dist/esm/react/hooks/use-observed-width.js +80 -0
- package/dist/esm/react/index.js +2 -0
- package/dist/esm/react/nodes/copy-text-provider.js +2 -1
- package/dist/esm/react/nodes/heading-anchor.js +9 -2
- package/dist/esm/react/nodes/inlineCard.js +11 -1
- package/dist/esm/react/nodes/mediaSingle/index.js +140 -141
- package/dist/esm/react/nodes/mention.js +0 -2
- package/dist/esm/react/nodes/status.js +2 -1
- package/dist/esm/react/nodes/tableCell.js +17 -8
- package/dist/esm/react/nodes/task-item-with-providers.js +4 -2
- package/dist/esm/react/nodes/taskItem.js +1 -0
- package/dist/esm/render-document.js +16 -1
- package/dist/esm/types/smartLinksOptions.js +1 -0
- package/dist/esm/ui/Renderer/breakout-ssr.js +47 -4
- package/dist/esm/ui/Renderer/index.js +1 -0
- package/dist/esm/ui/SortingIcon.js +20 -10
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/enums.d.ts +2 -1
- package/dist/types/analytics/events.d.ts +2 -1
- package/dist/types/messages.d.ts +44 -0
- package/dist/types/react/hooks/use-observed-width.d.ts +3 -0
- package/dist/types/react/index.d.ts +3 -0
- package/dist/types/react/nodes/index.d.ts +1 -1
- package/dist/types/react/nodes/inlineCard.d.ts +22 -20
- package/dist/types/react/nodes/mediaSingle/index.d.ts +3 -7
- package/dist/types/react/nodes/mediaSingle/styles.d.ts +1 -1
- package/dist/types/react/nodes/mention.d.ts +0 -1
- package/dist/types/react/nodes/tableCell.d.ts +6 -59
- package/dist/types/react/nodes/task-item-with-providers.d.ts +1 -0
- package/dist/types/types/smartLinksOptions.d.ts +3 -0
- package/dist/types/ui/SortingIcon.d.ts +6 -3
- package/dist/types/ui/renderer-props.d.ts +2 -0
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,88 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 89.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 88.0.0
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 87.0.0
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
21
|
+
## 86.0.0
|
|
22
|
+
|
|
23
|
+
### Major Changes
|
|
24
|
+
|
|
25
|
+
- [`304351e4b1e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/304351e4b1e) - CETI-241 - Added additional panel ADF attributes (panelIconId, panelIconText) to uniquely identify custom panel emojis. The change has been categorised as major since it is a change to the full-schema ADF. However, the custom panel feature is behind a feature flag, has not yet been released to production, and is only currently planned for release to Confluence. See ADF change #61 for further details.
|
|
26
|
+
- [`9d1e0356622`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d1e0356622) - [ux] CETI-166 Increase the standard panel icons size to make it consistent with the emojis in the panel content area
|
|
27
|
+
|
|
28
|
+
### Minor Changes
|
|
29
|
+
|
|
30
|
+
- [`de207a6b8e0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/de207a6b8e0) - Fixed a bug in SSR where media components would resize due to MutationObserver not receiving all children in initial call.
|
|
31
|
+
- [`49878ec3af4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/49878ec3af4) - Add `smartLinks` prop to React Renderer component
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
interface SmartLinksOptions {
|
|
35
|
+
ssr?: boolean;
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
It contains a `ssr` field which when set to true will enable SSR support for smart links nodes
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
<Renderer
|
|
43
|
+
smartLinks={{
|
|
44
|
+
ssr: true
|
|
45
|
+
}}
|
|
46
|
+
>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- [`9c9557fcdd8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9c9557fcdd8) - AK-279 Moved copy button outside of heading, that made heading accessible
|
|
50
|
+
- [`bd283364aad`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bd283364aad) - Fixed a bug for SSR where some media components would be rendered in the incorrect size resulting in jumping components during hydration.
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- [`439cf07029a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/439cf07029a) - ED-13881 Move @atlaskit/adf-schema test helpers to @atlaskit/editor-test-helpers
|
|
55
|
+
|
|
56
|
+
A new entry point for @atlaskit/editor-test-helpers/adf-schema has been
|
|
57
|
+
introduced. All test helpers that previously lived under @atlaskit/adf-schema
|
|
58
|
+
have been moved there instead.
|
|
59
|
+
|
|
60
|
+
Imports inside @atlaskit/adf-schema that previously relied on relative paths, or
|
|
61
|
+
imports from other packages that referred to @atlaskit/adf-schema/test-helpers,
|
|
62
|
+
should be updated to reference @atlaskit/editor-test-helpers/adf-schema instead.
|
|
63
|
+
|
|
64
|
+
Old usages:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
import { schema } from '../relative/path/to/test-helpers';
|
|
68
|
+
import { schema } from '@atlaskit/adf-schema/test-helpers';
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
New usage:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
import { schema } from '@atlaskit/editor-test-helpers/adf-schema';
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
- [`5293a48368e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5293a48368e) - fix image size in layout with ref and width observer
|
|
78
|
+
- [`85bffe0fecb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/85bffe0fecb) - Removed portal prop from Mention node
|
|
79
|
+
- [`85c4e5a71ee`](https://bitbucket.org/atlassian/atlassian-frontend/commits/85c4e5a71ee) - [AK-837] added role prop for Status component
|
|
80
|
+
- [`57f3b255fb2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/57f3b255fb2) - [ux] AK-608: Action items are keyboard accessible
|
|
81
|
+
- [`3b49ff824ec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3b49ff824ec) - ED-14043 update prosemirror schema to only allow link mark on children of paragraph and mediaSingle
|
|
82
|
+
- [`16294b02fd4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/16294b02fd4) - CETI-242 Change the Color palette labels for panel
|
|
83
|
+
- [`a36d06dee66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a36d06dee66) - [ux] Added intl tooling to all strings that were previously not using intl tooling. Should mean that more things are able to be translated. Also fixed the relevent tests to account for intl tooling.
|
|
84
|
+
- Updated dependencies
|
|
85
|
+
|
|
3
86
|
## 85.0.0
|
|
4
87
|
|
|
5
88
|
### Major Changes
|
|
@@ -39,6 +39,7 @@ exports.ACTION = ACTION;
|
|
|
39
39
|
ACTION["CREATE_NOT_ALLOWED"] = "createNotAllowed";
|
|
40
40
|
ACTION["UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED"] = "unsupportedContentLevelsTrackingSucceeded";
|
|
41
41
|
ACTION["UNSUPPORTED_CONTENT_LEVELS_TRACKING_ERRORED"] = "unsupportedContentLevelsTrackingErrored";
|
|
42
|
+
ACTION["MEDIA_LINK_TRANSFORMED"] = "mediaLinkTransformed";
|
|
42
43
|
})(ACTION || (exports.ACTION = ACTION = {}));
|
|
43
44
|
|
|
44
45
|
var ACTION_SUBJECT;
|
package/dist/cjs/messages.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.headingAnchorLinkMessages = exports.codeBlockCopyButtonMessages = void 0;
|
|
6
|
+
exports.tableCellMessages = exports.sortingIconMessages = exports.headingAnchorLinkMessages = exports.codeBlockCopyButtonMessages = void 0;
|
|
7
7
|
|
|
8
8
|
var _reactIntlNext = require("react-intl-next");
|
|
9
9
|
|
|
@@ -22,9 +22,55 @@ var headingAnchorLinkMessages = (0, _reactIntlNext.defineMessages)({
|
|
|
22
22
|
id: 'fabric.editor.headingLink.failedToCopy',
|
|
23
23
|
defaultMessage: 'Copy failed',
|
|
24
24
|
description: 'failed to copy heading link to clipboard'
|
|
25
|
+
},
|
|
26
|
+
copyAriaLabel: {
|
|
27
|
+
id: 'fabric.editor.headingLink.copyAriaLabel',
|
|
28
|
+
defaultMessage: 'Copy',
|
|
29
|
+
description: 'copy aria label for link icon'
|
|
25
30
|
}
|
|
26
31
|
});
|
|
27
32
|
exports.headingAnchorLinkMessages = headingAnchorLinkMessages;
|
|
33
|
+
var tableCellMessages = (0, _reactIntlNext.defineMessages)({
|
|
34
|
+
noneSortingLabel: {
|
|
35
|
+
id: 'fabric.editor.headingLink.noneSortingLabel',
|
|
36
|
+
defaultMessage: 'none',
|
|
37
|
+
description: 'this table column is not sorted'
|
|
38
|
+
},
|
|
39
|
+
ascSortingLabel: {
|
|
40
|
+
id: 'fabric.editor.headingLink.ascSortingLabel',
|
|
41
|
+
defaultMessage: 'ascending',
|
|
42
|
+
description: 'this table column is sorted in ascending order'
|
|
43
|
+
},
|
|
44
|
+
descSortingLabel: {
|
|
45
|
+
id: 'fabric.editor.headingLink.noneSortingLabel',
|
|
46
|
+
defaultMessage: 'descending',
|
|
47
|
+
description: 'this table column is sorted in descending order'
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
exports.tableCellMessages = tableCellMessages;
|
|
51
|
+
var sortingIconMessages = (0, _reactIntlNext.defineMessages)({
|
|
52
|
+
noOrderLabel: {
|
|
53
|
+
id: 'fabric.editor.headingLink.noOrderLabel',
|
|
54
|
+
defaultMessage: 'Sort column A to Z',
|
|
55
|
+
description: 'Sort the column in ascending order'
|
|
56
|
+
},
|
|
57
|
+
ascOrderLabel: {
|
|
58
|
+
id: 'fabric.editor.headingLink.ascOrderLabel',
|
|
59
|
+
defaultMessage: 'Sort column Z to A',
|
|
60
|
+
description: 'Sort the column in descending order'
|
|
61
|
+
},
|
|
62
|
+
descOrderLabel: {
|
|
63
|
+
id: 'fabric.editor.headingLink.descOrderLabel',
|
|
64
|
+
defaultMessage: 'Clear sorting',
|
|
65
|
+
description: 'clear the sorting from this column'
|
|
66
|
+
},
|
|
67
|
+
invalidLabel: {
|
|
68
|
+
id: 'fabric.editor.headingLink.descOrderLabel',
|
|
69
|
+
defaultMessage: "\u26A0\uFE0F You can't sort a table with merged cell",
|
|
70
|
+
description: 'this sort is invalid for merged cells'
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
exports.sortingIconMessages = sortingIconMessages;
|
|
28
74
|
var codeBlockCopyButtonMessages = (0, _reactIntlNext.defineMessages)({
|
|
29
75
|
copyCodeToClipboard: {
|
|
30
76
|
id: 'fabric.editor.codeBlockCopyButton.copyToClipboard',
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.useObservedWidth = void 0;
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
15
|
+
|
|
16
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
+
|
|
18
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
19
|
+
|
|
20
|
+
var resizeObserver;
|
|
21
|
+
var nodeToCallback = new WeakMap();
|
|
22
|
+
|
|
23
|
+
var useObservedWidth = function useObservedWidth(node, useObservedWidthFlag) {
|
|
24
|
+
var _React$useState = _react.default.useState({
|
|
25
|
+
x: 0,
|
|
26
|
+
y: 0,
|
|
27
|
+
width: 0,
|
|
28
|
+
height: 0,
|
|
29
|
+
top: 0,
|
|
30
|
+
left: 0,
|
|
31
|
+
bottom: 0,
|
|
32
|
+
right: 0
|
|
33
|
+
}),
|
|
34
|
+
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
35
|
+
rect = _React$useState2[0],
|
|
36
|
+
setRect = _React$useState2[1];
|
|
37
|
+
|
|
38
|
+
_react.default.useEffect(function () {
|
|
39
|
+
if (!node || !useObservedWidthFlag) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (!resizeObserver) {
|
|
44
|
+
resizeObserver = new ResizeObserver(function (entries) {
|
|
45
|
+
var _iterator = _createForOfIteratorHelper(entries),
|
|
46
|
+
_step;
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
50
|
+
var entry = _step.value;
|
|
51
|
+
|
|
52
|
+
if (nodeToCallback.has(entry.target)) {
|
|
53
|
+
nodeToCallback.get(entry.target)(entry.contentRect);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
} catch (err) {
|
|
57
|
+
_iterator.e(err);
|
|
58
|
+
} finally {
|
|
59
|
+
_iterator.f();
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
nodeToCallback.set(node, function (rect) {
|
|
65
|
+
var x = rect.x,
|
|
66
|
+
y = rect.y,
|
|
67
|
+
width = rect.width,
|
|
68
|
+
height = rect.height,
|
|
69
|
+
top = rect.top,
|
|
70
|
+
left = rect.left,
|
|
71
|
+
bottom = rect.bottom,
|
|
72
|
+
right = rect.right;
|
|
73
|
+
return setRect({
|
|
74
|
+
x: x,
|
|
75
|
+
y: y,
|
|
76
|
+
width: width,
|
|
77
|
+
height: height,
|
|
78
|
+
top: top,
|
|
79
|
+
left: left,
|
|
80
|
+
bottom: bottom,
|
|
81
|
+
right: right
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
resizeObserver.observe(node);
|
|
85
|
+
return function () {
|
|
86
|
+
resizeObserver.unobserve(node);
|
|
87
|
+
nodeToCallback.delete(node);
|
|
88
|
+
};
|
|
89
|
+
}, [node, useObservedWidthFlag]);
|
|
90
|
+
|
|
91
|
+
return rect;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
exports.useObservedWidth = useObservedWidth;
|
package/dist/cjs/react/index.js
CHANGED
|
@@ -204,6 +204,7 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
204
204
|
this.allowAnnotations = Boolean(init.allowAnnotations);
|
|
205
205
|
this.surroundTextNodesWithTextWrapper = Boolean(init.surroundTextNodesWithTextWrapper);
|
|
206
206
|
this.media = init.media;
|
|
207
|
+
this.smartLinks = init.smartLinks;
|
|
207
208
|
this.allowSelectAllTrap = init.allowSelectAllTrap;
|
|
208
209
|
}
|
|
209
210
|
|
|
@@ -568,6 +569,7 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
568
569
|
fireAnalyticsEvent: this.fireAnalyticsEvent,
|
|
569
570
|
nodeType: node.type.name,
|
|
570
571
|
marks: node.marks,
|
|
572
|
+
smartLinks: this.smartLinks,
|
|
571
573
|
dataAttributes: {
|
|
572
574
|
// We need to account for depth (path.length gives up depth) here
|
|
573
575
|
// but depth doesnt increment the pos, only accounted for.
|
|
@@ -114,7 +114,8 @@ exports.CopyTextConsumer = Consumer;
|
|
|
114
114
|
|
|
115
115
|
var CopyArea = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
116
116
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
|
117
|
-
ref: ref
|
|
117
|
+
ref: ref // eslint-disable-next-line @atlaskit/design-system/use-visually-hidden
|
|
118
|
+
,
|
|
118
119
|
style: {
|
|
119
120
|
position: 'absolute',
|
|
120
121
|
left: '-9999px',
|
|
@@ -90,10 +90,15 @@ var HeadingAnchor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
90
90
|
var isClicked = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
91
91
|
|
|
92
92
|
_this.setState({
|
|
93
|
+
// TODO: ED-14403 investigate why this does not translate
|
|
93
94
|
tooltipMessage: _this.props.intl.formatMessage(message),
|
|
94
95
|
isClicked: isClicked
|
|
95
96
|
});
|
|
96
97
|
});
|
|
98
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getCopyAriaLabel", function () {
|
|
99
|
+
var copyAriaLabel = _messages.headingAnchorLinkMessages.copyAriaLabel;
|
|
100
|
+
return _this.props.intl.formatMessage(copyAriaLabel);
|
|
101
|
+
});
|
|
97
102
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "copyToClipboard", /*#__PURE__*/function () {
|
|
98
103
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(event) {
|
|
99
104
|
var copiedHeadingLinkToClipboard, failedToCopyHeadingLink;
|
|
@@ -137,9 +142,10 @@ var HeadingAnchor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
137
142
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderAnchorButton", function () {
|
|
138
143
|
return /*#__PURE__*/_react.default.createElement(CopyAnchorButton, {
|
|
139
144
|
onMouseLeave: _this.resetMessage,
|
|
140
|
-
onClick: _this.copyToClipboard
|
|
145
|
+
onClick: _this.copyToClipboard,
|
|
146
|
+
"aria-label": _this.state.tooltipMessage
|
|
141
147
|
}, /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
142
|
-
label:
|
|
148
|
+
label: _this.getCopyAriaLabel(),
|
|
143
149
|
size: _this.props.level > 3 ? 'small' : 'medium',
|
|
144
150
|
primaryColor: _this.state.isClicked ? _colors.B400 : _colors.N200
|
|
145
151
|
}));
|
|
@@ -13,6 +13,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
13
13
|
|
|
14
14
|
var _smartCard = require("@atlaskit/smart-card");
|
|
15
15
|
|
|
16
|
+
var _ssr = require("@atlaskit/smart-card/ssr");
|
|
17
|
+
|
|
16
18
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
17
19
|
|
|
18
20
|
var _fallback = require("./fallback");
|
|
@@ -25,7 +27,8 @@ var InlineCard = function InlineCard(props) {
|
|
|
25
27
|
var url = props.url,
|
|
26
28
|
data = props.data,
|
|
27
29
|
eventHandlers = props.eventHandlers,
|
|
28
|
-
portal = props.portal
|
|
30
|
+
portal = props.portal,
|
|
31
|
+
smartLinks = props.smartLinks;
|
|
29
32
|
var onClick = (0, _getCardClickHandler.getCardClickHandler)(eventHandlers, url);
|
|
30
33
|
var cardProps = {
|
|
31
34
|
url: url,
|
|
@@ -33,6 +36,14 @@ var InlineCard = function InlineCard(props) {
|
|
|
33
36
|
onClick: onClick,
|
|
34
37
|
container: portal
|
|
35
38
|
};
|
|
39
|
+
|
|
40
|
+
if (smartLinks !== null && smartLinks !== void 0 && smartLinks.ssr && url) {
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement(_ssr.CardSSR, {
|
|
42
|
+
appearance: "inline",
|
|
43
|
+
url: url
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
36
47
|
return /*#__PURE__*/_react.default.createElement("span", {
|
|
37
48
|
"data-inline-card": true,
|
|
38
49
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|