@atlaskit/renderer 82.2.0 → 84.1.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 +97 -0
- package/dist/cjs/actions/matches-utils.js +1 -1
- package/dist/cjs/analytics/enums.js +2 -1
- package/dist/cjs/analytics/events.js +1 -1
- package/dist/cjs/i18n/index.js +26 -26
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/messages.js +4 -4
- package/dist/cjs/react/index.js +7 -4
- package/dist/cjs/react/marks/annotation.js +1 -1
- package/dist/cjs/react/marks/breakout.js +1 -1
- package/dist/cjs/react/marks/code.js +3 -3
- package/dist/cjs/react/marks/fragment.js +21 -0
- package/dist/cjs/react/marks/index.js +28 -19
- package/dist/cjs/react/marks/textColor.js +15 -4
- package/dist/cjs/react/nodes/codeBlock.js +2 -2
- package/dist/cjs/react/nodes/codeBlockCopyButton.js +2 -2
- package/dist/cjs/react/nodes/copy-text-provider.js +1 -1
- package/dist/cjs/react/nodes/date.js +2 -2
- package/dist/cjs/react/nodes/doc.js +1 -1
- package/dist/cjs/react/nodes/extension.js +1 -1
- package/dist/cjs/react/nodes/heading-anchor.js +2 -2
- package/dist/cjs/react/nodes/heading.js +2 -4
- package/dist/cjs/react/nodes/index.js +31 -22
- package/dist/cjs/react/nodes/media.js +4 -2
- package/dist/cjs/react/nodes/mediaSingle/index.js +3 -3
- package/dist/cjs/react/nodes/panel.js +4 -6
- package/dist/cjs/react/nodes/table/colgroup.js +1 -1
- package/dist/cjs/react/nodes/table/sticky.js +1 -1
- package/dist/cjs/react/nodes/tableCell.js +1 -1
- package/dist/cjs/react/renderer-node.js +1 -1
- package/dist/cjs/react/utils/links.js +1 -1
- package/dist/cjs/render-document.js +21 -1
- package/dist/cjs/renderer-context.js +1 -1
- package/dist/cjs/steps/index.js +2 -2
- package/dist/cjs/text/nodes/index.js +1 -1
- package/dist/cjs/ui/Expand.js +2 -2
- package/dist/cjs/ui/MediaCard.js +12 -6
- package/dist/cjs/ui/Renderer/breakout-ssr.js +1 -1
- package/dist/cjs/ui/Renderer/index.js +11 -11
- package/dist/cjs/ui/Renderer/style.js +9 -7
- package/dist/cjs/ui/RendererActionsContext/index.js +1 -1
- package/dist/cjs/ui/SortingIcon.js +2 -2
- package/dist/cjs/ui/active-header-id-provider.js +1 -1
- package/dist/cjs/ui/annotations/context.js +1 -1
- package/dist/cjs/ui/annotations/draft/component.js +1 -1
- package/dist/cjs/ui/annotations/draft/index.js +4 -4
- package/dist/cjs/ui/annotations/draft/text.js +1 -1
- package/dist/cjs/ui/annotations/hooks/index.js +8 -8
- package/dist/cjs/ui/annotations/hooks/use-events.js +4 -2
- package/dist/cjs/ui/annotations/index.js +5 -5
- package/dist/cjs/utils.js +2 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/enums.js +1 -0
- package/dist/es2019/messages.js +1 -1
- package/dist/es2019/react/index.js +7 -3
- package/dist/es2019/react/marks/code.js +1 -1
- package/dist/es2019/react/marks/fragment.js +10 -0
- package/dist/es2019/react/marks/index.js +4 -2
- package/dist/es2019/react/marks/textColor.js +7 -4
- package/dist/es2019/react/nodes/codeBlock.js +1 -1
- package/dist/es2019/react/nodes/codeBlockCopyButton.js +1 -1
- package/dist/es2019/react/nodes/date.js +1 -1
- package/dist/es2019/react/nodes/heading-anchor.js +1 -1
- package/dist/es2019/react/nodes/heading.js +2 -3
- package/dist/es2019/react/nodes/media.js +4 -2
- package/dist/es2019/react/nodes/mediaSingle/index.js +1 -1
- package/dist/es2019/react/nodes/panel.js +5 -6
- package/dist/es2019/render-document.js +19 -1
- package/dist/es2019/ui/Expand.js +1 -1
- package/dist/es2019/ui/MediaCard.js +11 -5
- package/dist/es2019/ui/Renderer/index.js +10 -10
- package/dist/es2019/ui/Renderer/style.js +4 -2
- package/dist/es2019/ui/SortingIcon.js +1 -1
- package/dist/es2019/ui/annotations/hooks/use-events.js +3 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/enums.js +1 -0
- package/dist/esm/messages.js +1 -1
- package/dist/esm/react/index.js +7 -4
- package/dist/esm/react/marks/code.js +1 -1
- package/dist/esm/react/marks/fragment.js +10 -0
- package/dist/esm/react/marks/index.js +4 -2
- package/dist/esm/react/marks/textColor.js +8 -4
- package/dist/esm/react/nodes/codeBlock.js +1 -1
- package/dist/esm/react/nodes/codeBlockCopyButton.js +1 -1
- package/dist/esm/react/nodes/date.js +1 -1
- package/dist/esm/react/nodes/heading-anchor.js +1 -1
- package/dist/esm/react/nodes/heading.js +2 -3
- package/dist/esm/react/nodes/media.js +4 -2
- package/dist/esm/react/nodes/mediaSingle/index.js +1 -1
- package/dist/esm/react/nodes/panel.js +5 -6
- package/dist/esm/render-document.js +19 -1
- package/dist/esm/ui/Expand.js +1 -1
- package/dist/esm/ui/MediaCard.js +11 -5
- package/dist/esm/ui/Renderer/index.js +10 -10
- package/dist/esm/ui/Renderer/style.js +4 -3
- package/dist/esm/ui/SortingIcon.js +1 -1
- package/dist/esm/ui/annotations/hooks/use-events.js +3 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/enums.d.ts +1 -0
- package/dist/types/analytics/events.d.ts +5 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/react/index.d.ts +1 -0
- package/dist/types/react/marks/alignment.d.ts +1 -0
- package/dist/types/react/marks/annotation.d.ts +1 -0
- package/dist/types/react/marks/code.d.ts +6 -6
- package/dist/types/react/marks/data-consumer.d.ts +1 -0
- package/dist/types/react/marks/em.d.ts +1 -0
- package/dist/types/react/marks/fragment.d.ts +4 -0
- package/dist/types/react/marks/indentation.d.ts +1 -0
- package/dist/types/react/marks/index.d.ts +2 -1
- package/dist/types/react/marks/link.d.ts +1 -0
- package/dist/types/react/marks/strike.d.ts +1 -0
- package/dist/types/react/marks/strong.d.ts +1 -0
- package/dist/types/react/marks/subsup.d.ts +1 -0
- package/dist/types/react/marks/textColor.d.ts +1 -0
- package/dist/types/react/marks/underline.d.ts +1 -0
- package/dist/types/react/marks/unsupportedMark.d.ts +1 -0
- package/dist/types/react/marks/unsupportedNodeAttribute.d.ts +1 -0
- package/dist/types/react/nodes/blockCard.d.ts +1 -0
- package/dist/types/react/nodes/caption.d.ts +1 -0
- package/dist/types/react/nodes/codeBlock.d.ts +11 -3
- package/dist/types/react/nodes/codeBlockCopyButton.d.ts +3 -3
- package/dist/types/react/nodes/date.d.ts +3 -3
- package/dist/types/react/nodes/decisionItem.d.ts +1 -0
- package/dist/types/react/nodes/doc.d.ts +1 -0
- package/dist/types/react/nodes/embedCard.d.ts +1 -0
- package/dist/types/react/nodes/heading-anchor.d.ts +4 -4
- package/dist/types/react/nodes/heading.d.ts +1 -0
- package/dist/types/react/nodes/index.d.ts +8 -8
- package/dist/types/react/nodes/mediaSingle/index.d.ts +3 -3
- package/dist/types/react/nodes/paragraph.d.ts +1 -0
- package/dist/types/react/nodes/placeholder.d.ts +1 -0
- package/dist/types/react/nodes/rule.d.ts +1 -0
- package/dist/types/react/nodes/table/colgroup.d.ts +1 -0
- package/dist/types/react/nodes/text-wrapper.d.ts +1 -0
- package/dist/types/types/mediaOptions.d.ts +7 -1
- package/dist/types/ui/Expand.d.ts +3 -3
- package/dist/types/ui/MediaCard.d.ts +2 -0
- package/dist/types/ui/Renderer/breakout-ssr.d.ts +1 -0
- package/dist/types/ui/SortingIcon.d.ts +1 -0
- package/dist/types/ui/renderer-props.d.ts +1 -1
- package/package.json +23 -23
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.ProvidersContext = exports.InlineCommentsStateContext = exports.AnnotationsDraftContextWrapper = exports.AnnotationsDraftContext = void 0;
|
|
11
11
|
|
|
12
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
13
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.getAnnotationIndex = exports.applyAnnotationOnText = exports.TextWithAnnotationDraft = exports.AnnotationDraft = void 0;
|
|
9
9
|
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
11
|
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "TextWithAnnotationDraft", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _component.TextWithAnnotationDraft;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "updateWindowSelectionAroundDraft", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return
|
|
15
|
+
return _dom.updateWindowSelectionAroundDraft;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.splitText = exports.calcTextSplitOffset = void 0;
|
|
7
7
|
|
|
8
8
|
var splitText = function splitText(text, _ref) {
|
|
9
9
|
var startOffset = _ref.startOffset,
|
|
@@ -3,22 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "useHasFocusEvent", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _useEvents.useHasFocusEvent;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
6
|
Object.defineProperty(exports, "useAnnotationClickEvent", {
|
|
13
7
|
enumerable: true,
|
|
14
8
|
get: function get() {
|
|
15
9
|
return _useEvents.useAnnotationClickEvent;
|
|
16
10
|
}
|
|
17
11
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "useHasFocusEvent", {
|
|
19
13
|
enumerable: true,
|
|
20
14
|
get: function get() {
|
|
21
|
-
return
|
|
15
|
+
return _useEvents.useHasFocusEvent;
|
|
22
16
|
}
|
|
23
17
|
});
|
|
24
18
|
Object.defineProperty(exports, "useInlineCommentSubscriberContext", {
|
|
@@ -27,6 +21,12 @@ Object.defineProperty(exports, "useInlineCommentSubscriberContext", {
|
|
|
27
21
|
return _useInlineCommentSubscriber.useInlineCommentSubscriberContext;
|
|
28
22
|
}
|
|
29
23
|
});
|
|
24
|
+
Object.defineProperty(exports, "useInlineCommentsFilter", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function get() {
|
|
27
|
+
return _useInlineCommentsFilter.useInlineCommentsFilter;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
30
|
|
|
31
31
|
var _useEvents = require("./use-events");
|
|
32
32
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.useHasFocusEvent = exports.useAnnotationStateByTypeEvent = exports.useAnnotationClickEvent = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
@@ -46,7 +46,9 @@ var useAnnotationStateByTypeEvent = function useAnnotationStateByTypeEvent(_ref)
|
|
|
46
46
|
|
|
47
47
|
var nextStates = Object.values(payload).reduce(function (acc, curr) {
|
|
48
48
|
if (curr.annotationType === type) {
|
|
49
|
-
|
|
49
|
+
// Check for empty state to prevent additional renders
|
|
50
|
+
var isEmpty = curr.state === null || curr.state === undefined;
|
|
51
|
+
return _objectSpread(_objectSpread({}, acc), {}, (0, _defineProperty2.default)({}, curr.id, !isEmpty ? curr.state : states[curr.id]));
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
return acc;
|
|
@@ -5,19 +5,19 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
Object.defineProperty(exports, "
|
|
8
|
+
Object.defineProperty(exports, "AnnotationMark", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function get() {
|
|
11
|
-
return
|
|
11
|
+
return _element.MarkElement;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
|
|
14
|
+
exports.AnnotationsWrapper = void 0;
|
|
15
|
+
Object.defineProperty(exports, "TextWithAnnotationDraft", {
|
|
15
16
|
enumerable: true,
|
|
16
17
|
get: function get() {
|
|
17
|
-
return
|
|
18
|
+
return _draft.TextWithAnnotationDraft;
|
|
18
19
|
}
|
|
19
20
|
});
|
|
20
|
-
exports.AnnotationsWrapper = void 0;
|
|
21
21
|
|
|
22
22
|
var _react = _interopRequireDefault(require("react"));
|
|
23
23
|
|
package/dist/cjs/utils.js
CHANGED
|
@@ -5,9 +5,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
exports.ADFEncoder = void 0;
|
|
8
9
|
exports.findHorizontalOverflowScrollParent = findHorizontalOverflowScrollParent;
|
|
9
10
|
exports.findInTree = findInTree;
|
|
10
|
-
exports.
|
|
11
|
+
exports.getText = exports.getPlatform = exports.getEventHandler = void 0;
|
|
11
12
|
|
|
12
13
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
14
|
|
package/dist/cjs/version.json
CHANGED
|
@@ -13,6 +13,7 @@ export let ACTION;
|
|
|
13
13
|
ACTION["STARTED"] = "started";
|
|
14
14
|
ACTION["RENDERED"] = "rendered";
|
|
15
15
|
ACTION["CRASHED"] = "unhandledErrorCaught";
|
|
16
|
+
ACTION["INVALID_PROSEMIRROR_DOCUMENT"] = "invalidProsemirrorDocument";
|
|
16
17
|
ACTION["SELECT_ALL_CAUGHT"] = "selectAllCaught";
|
|
17
18
|
ACTION["SELECT_ALL_ESCAPED"] = "selectAllEscaped";
|
|
18
19
|
ACTION["CLICKED"] = "clicked";
|
package/dist/es2019/messages.js
CHANGED
|
@@ -379,6 +379,8 @@ export default class ReactSerializer {
|
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
getMediaProps(node, path = []) {
|
|
382
|
+
var _this$media;
|
|
383
|
+
|
|
382
384
|
const {
|
|
383
385
|
marks: {
|
|
384
386
|
link
|
|
@@ -392,7 +394,8 @@ export default class ReactSerializer {
|
|
|
392
394
|
isLinkMark,
|
|
393
395
|
allowAltTextOnImages: this.allowAltTextOnImages,
|
|
394
396
|
featureFlags: this.media && this.media.featureFlags,
|
|
395
|
-
shouldOpenMediaViewer: this.shouldOpenMediaViewer
|
|
397
|
+
shouldOpenMediaViewer: this.shouldOpenMediaViewer,
|
|
398
|
+
ssr: (_this$media = this.media) === null || _this$media === void 0 ? void 0 : _this$media.ssr
|
|
396
399
|
};
|
|
397
400
|
}
|
|
398
401
|
|
|
@@ -413,13 +416,14 @@ export default class ReactSerializer {
|
|
|
413
416
|
}
|
|
414
417
|
|
|
415
418
|
getMediaGroupProps(node) {
|
|
416
|
-
var _this$
|
|
419
|
+
var _this$media2, _this$media3;
|
|
417
420
|
|
|
418
421
|
return { ...this.getProps(node),
|
|
419
422
|
shouldOpenMediaViewer: this.shouldOpenMediaViewer,
|
|
420
423
|
allowAltTextOnImages: this.allowAltTextOnImages,
|
|
421
424
|
featureFlags: this.media && this.media.featureFlags,
|
|
422
|
-
enableDownloadButton: (_this$
|
|
425
|
+
enableDownloadButton: (_this$media2 = this.media) === null || _this$media2 === void 0 ? void 0 : _this$media2.enableDownloadButton,
|
|
426
|
+
ssr: (_this$media3 = this.media) === null || _this$media3 === void 0 ? void 0 : _this$media3.ssr
|
|
423
427
|
};
|
|
424
428
|
}
|
|
425
429
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { injectIntl } from 'react-intl';
|
|
3
|
+
import { injectIntl } from 'react-intl-next';
|
|
4
4
|
import AkCode from '@atlaskit/code/inline';
|
|
5
5
|
import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { useFeatureFlags } from '../../use-feature-flags';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export default function FragmentMark(props) {
|
|
4
|
+
const WrapperElement = props.isInline ? 'span' : 'div';
|
|
5
|
+
return /*#__PURE__*/React.createElement(WrapperElement, _extends({
|
|
6
|
+
"data-localId": props.localId,
|
|
7
|
+
"data-name": props.name,
|
|
8
|
+
"data-mark-type": "fragment"
|
|
9
|
+
}, props.dataAttributes), props.children);
|
|
10
|
+
}
|
|
@@ -12,6 +12,7 @@ import Indentation from './indentation';
|
|
|
12
12
|
import UnsupportedMark from './unsupportedMark';
|
|
13
13
|
import UnsupportedNodeAttribute from './unsupportedNodeAttribute';
|
|
14
14
|
import DataConsumer from './data-consumer';
|
|
15
|
+
import FragmentMark from './fragment';
|
|
15
16
|
import Annotation, { isAnnotationMark } from './annotation'; // Stage0
|
|
16
17
|
|
|
17
18
|
import ConfluenceInlineComment from './confluence-inline-comment';
|
|
@@ -32,9 +33,10 @@ export const markToReact = {
|
|
|
32
33
|
indentation: Indentation,
|
|
33
34
|
unsupportedMark: UnsupportedMark,
|
|
34
35
|
unsupportedNodeAttribute: UnsupportedNodeAttribute,
|
|
35
|
-
dataConsumer: DataConsumer
|
|
36
|
+
dataConsumer: DataConsumer,
|
|
37
|
+
fragment: FragmentMark
|
|
36
38
|
};
|
|
37
39
|
export const toReact = mark => {
|
|
38
40
|
return markToReact[mark.type.name];
|
|
39
41
|
};
|
|
40
|
-
export { Code, Em, Link, Strike, Strong, Subsup, TextColor, Underline, Breakout, Annotation, UnsupportedMark, isAnnotationMark, UnsupportedNodeAttribute, DataConsumer };
|
|
42
|
+
export { Code, Em, Link, Strike, Strong, Subsup, TextColor, Underline, Breakout, Annotation, UnsupportedMark, isAnnotationMark, UnsupportedNodeAttribute, DataConsumer, FragmentMark };
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
3
|
export default function TextColor(props) {
|
|
4
|
+
const style = useMemo(() => ({
|
|
5
|
+
['--custom-text-color']: props.color
|
|
6
|
+
}), [props.color]);
|
|
4
7
|
return /*#__PURE__*/React.createElement("span", _extends({}, props.dataAttributes, {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
"data-text-custom-color": props.color,
|
|
9
|
+
className: "fabric-text-color-mark",
|
|
10
|
+
style: style
|
|
8
11
|
}), props.children);
|
|
9
12
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { injectIntl } from 'react-intl';
|
|
2
|
+
import { injectIntl } from 'react-intl-next';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { CodeBlock as AkCodeBlock } from '@atlaskit/code';
|
|
5
5
|
import { overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { injectIntl } from 'react-intl';
|
|
2
|
+
import { injectIntl } from 'react-intl-next';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import Tooltip from '@atlaskit/tooltip';
|
|
5
5
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { PureComponent } from 'react';
|
|
3
3
|
import { isPastDate, timestampToString, timestampToTaskContext, DateSharedCssClassName } from '@atlaskit/editor-common';
|
|
4
|
-
import { injectIntl } from 'react-intl';
|
|
4
|
+
import { injectIntl } from 'react-intl-next';
|
|
5
5
|
|
|
6
6
|
class Date extends PureComponent {
|
|
7
7
|
render() {
|
|
@@ -5,7 +5,7 @@ import styled from 'styled-components';
|
|
|
5
5
|
import { N200, N500, B400 } from '@atlaskit/theme/colors';
|
|
6
6
|
import LinkIcon from '@atlaskit/icon/glyph/link';
|
|
7
7
|
import Tooltip from '@atlaskit/tooltip';
|
|
8
|
-
import { injectIntl } from 'react-intl';
|
|
8
|
+
import { injectIntl } from 'react-intl-next';
|
|
9
9
|
import { headingAnchorLinkMessages } from '../../messages';
|
|
10
10
|
export const HeadingAnchorWrapperClassName = 'heading-anchor-wrapper';
|
|
11
11
|
const CopyAnchorWrapperWithRef = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import HeadingAnchor from './heading-anchor';
|
|
4
|
-
import Url from 'url-parse';
|
|
5
4
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics/enums';
|
|
6
5
|
import AnalyticsContext from '../../analytics/analyticsContext';
|
|
7
6
|
import { CopyTextConsumer } from './copy-text-provider';
|
|
8
7
|
|
|
9
8
|
const getCurrentUrlWithHash = (hash = '') => {
|
|
10
|
-
const url = new
|
|
11
|
-
url.
|
|
9
|
+
const url = new URL(window.location.href);
|
|
10
|
+
url.hash = encodeURIComponent(hash);
|
|
12
11
|
return url.href;
|
|
13
12
|
};
|
|
14
13
|
|
|
@@ -21,7 +21,8 @@ export default class Media extends PureComponent {
|
|
|
21
21
|
alt,
|
|
22
22
|
featureFlags,
|
|
23
23
|
shouldOpenMediaViewer: allowMediaViewer,
|
|
24
|
-
enableDownloadButton
|
|
24
|
+
enableDownloadButton,
|
|
25
|
+
ssr
|
|
25
26
|
} = this.props;
|
|
26
27
|
const linkMark = this.props.marks.find(this.props.isLinkMark);
|
|
27
28
|
const linkHref = linkMark === null || linkMark === void 0 ? void 0 : linkMark.attrs.href;
|
|
@@ -35,7 +36,8 @@ export default class Media extends PureComponent {
|
|
|
35
36
|
eventHandlers: eventHandlers,
|
|
36
37
|
alt: allowAltTextOnImages ? alt : undefined,
|
|
37
38
|
featureFlags: featureFlags,
|
|
38
|
-
shouldEnableDownloadButton: enableDownloadButton
|
|
39
|
+
shouldEnableDownloadButton: enableDownloadButton,
|
|
40
|
+
ssr: ssr
|
|
39
41
|
}));
|
|
40
42
|
return linkHref ? /*#__PURE__*/React.createElement(MediaLink, {
|
|
41
43
|
href: linkHref,
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import { mapBreakpointToLayoutMaxWidth, WidthConsumer } from '@atlaskit/editor-common';
|
|
3
3
|
import { akEditorFullWidthLayoutWidth, getAkEditorFullPageMaxWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { Component, default as React } from 'react';
|
|
5
|
-
import { injectIntl } from 'react-intl';
|
|
5
|
+
import { injectIntl } from 'react-intl-next';
|
|
6
6
|
import { FullPagePadding } from '../../../ui/Renderer/style';
|
|
7
7
|
import { ExtendedUIMediaSingle } from './styles';
|
|
8
8
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
@@ -13,21 +13,20 @@ import EmojiItem from './emoji'; // AFP-2532 TODO: Fix automatic suppressions be
|
|
|
13
13
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
14
14
|
|
|
15
15
|
import { themed } from '@atlaskit/theme';
|
|
16
|
+
import { getPanelBackgroundDarkModeColors } from '@atlaskit/editor-common';
|
|
16
17
|
const PanelStyled = styled.div`
|
|
17
18
|
${props => {
|
|
18
19
|
if (props['data-panel-type'] !== PanelType.CUSTOM || !props.backgroundColor) {
|
|
19
20
|
return '';
|
|
20
|
-
}
|
|
21
|
+
} // Similar to mainDynamicStyles()
|
|
21
22
|
|
|
22
|
-
const border = themed({
|
|
23
|
-
light: 'none',
|
|
24
|
-
dark: `1px solid rgba(255, 255, 255, 0.4)`
|
|
25
|
-
})(props); // Similar to mainDynamicStyles()
|
|
26
23
|
|
|
27
24
|
return `
|
|
28
25
|
&[data-panel-type=${PanelType.CUSTOM}] {
|
|
29
26
|
background-color: ${props.backgroundColor};
|
|
30
|
-
|
|
27
|
+
${themed({
|
|
28
|
+
dark: getPanelBackgroundDarkModeColors
|
|
29
|
+
})};
|
|
31
30
|
}
|
|
32
31
|
`;
|
|
33
32
|
}}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { defaultSchema } from '@atlaskit/adf-schema';
|
|
2
2
|
import { getValidDocument } from '@atlaskit/editor-common/validator';
|
|
3
3
|
import { validateADFEntity, findAndTrackUnsupportedContentNodes } from '@atlaskit/editor-common';
|
|
4
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from './analytics/enums';
|
|
5
|
+
import { PLATFORM } from './analytics/events';
|
|
4
6
|
import { trackUnsupportedContentLevels } from './analytics/unsupported-content';
|
|
5
7
|
const SUPPORTS_HIRES_TIMER_API = !!(window.performance && performance.now);
|
|
6
8
|
|
|
@@ -59,7 +61,23 @@ export const renderDocument = (doc, serializer, schema = defaultSchema, adfStage
|
|
|
59
61
|
time: buildTreeTime
|
|
60
62
|
} = withStopwatch(() => {
|
|
61
63
|
const pmNode = schema.nodeFromJSON(validDoc);
|
|
62
|
-
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
pmNode.check();
|
|
67
|
+
} catch (err) {
|
|
68
|
+
if (dispatchAnalyticsEvent) {
|
|
69
|
+
dispatchAnalyticsEvent({
|
|
70
|
+
action: ACTION.INVALID_PROSEMIRROR_DOCUMENT,
|
|
71
|
+
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
72
|
+
attributes: {
|
|
73
|
+
platform: PLATFORM.WEB,
|
|
74
|
+
error: err === null || err === void 0 ? void 0 : err.toString()
|
|
75
|
+
},
|
|
76
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
63
81
|
return pmNode;
|
|
64
82
|
}); // save build tree time to stats
|
|
65
83
|
|
package/dist/es2019/ui/Expand.js
CHANGED
|
@@ -8,7 +8,7 @@ import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper, E
|
|
|
8
8
|
import { akEditorLineHeight, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
9
9
|
import { PLATFORM, MODE } from '../analytics/events';
|
|
10
10
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics/enums';
|
|
11
|
-
import { injectIntl } from 'react-intl';
|
|
11
|
+
import { injectIntl } from 'react-intl-next';
|
|
12
12
|
import { ActiveHeaderIdConsumer } from './active-header-id-provider';
|
|
13
13
|
import _uniqueId from 'lodash/uniqueId';
|
|
14
14
|
const Title = styled.span`
|
|
@@ -174,7 +174,8 @@ export class MediaCardInternal extends Component {
|
|
|
174
174
|
imageStatus,
|
|
175
175
|
disableOverlay,
|
|
176
176
|
alt,
|
|
177
|
-
featureFlags
|
|
177
|
+
featureFlags,
|
|
178
|
+
ssr
|
|
178
179
|
} = this.props;
|
|
179
180
|
|
|
180
181
|
if (imageStatus === 'loading' || !url) {
|
|
@@ -200,7 +201,8 @@ export class MediaCardInternal extends Component {
|
|
|
200
201
|
mediaViewerDataSource: {
|
|
201
202
|
list: Array.from(mediaIdentifierMap.values())
|
|
202
203
|
},
|
|
203
|
-
featureFlags: featureFlags
|
|
204
|
+
featureFlags: featureFlags,
|
|
205
|
+
ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
|
|
204
206
|
});
|
|
205
207
|
}
|
|
206
208
|
/**
|
|
@@ -214,7 +216,7 @@ export class MediaCardInternal extends Component {
|
|
|
214
216
|
render() {
|
|
215
217
|
const {
|
|
216
218
|
contextIdentifierProvider,
|
|
217
|
-
mediaClientConfig,
|
|
219
|
+
mediaClientConfig: mediaClientConfigInState,
|
|
218
220
|
fileState
|
|
219
221
|
} = this.state;
|
|
220
222
|
const {
|
|
@@ -231,7 +233,8 @@ export class MediaCardInternal extends Component {
|
|
|
231
233
|
originalDimensions,
|
|
232
234
|
shouldOpenMediaViewer: forceOpenMediaViewer,
|
|
233
235
|
featureFlags,
|
|
234
|
-
shouldEnableDownloadButton
|
|
236
|
+
shouldEnableDownloadButton,
|
|
237
|
+
ssr
|
|
235
238
|
} = this.props;
|
|
236
239
|
const isMobile = rendererAppearance === 'mobile';
|
|
237
240
|
const shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
|
|
@@ -247,6 +250,8 @@ export class MediaCardInternal extends Component {
|
|
|
247
250
|
return null;
|
|
248
251
|
}
|
|
249
252
|
|
|
253
|
+
const mediaClientConfig = !!ssr ? ssr.config : mediaClientConfigInState;
|
|
254
|
+
|
|
250
255
|
if (!mediaClientConfig || !id) {
|
|
251
256
|
return this.renderLoadingCard();
|
|
252
257
|
}
|
|
@@ -288,7 +293,8 @@ export class MediaCardInternal extends Component {
|
|
|
288
293
|
list: Array.from(mediaIdentifierMap.values())
|
|
289
294
|
},
|
|
290
295
|
featureFlags: featureFlags,
|
|
291
|
-
shouldEnableDownloadButton: shouldEnableDownloadButton
|
|
296
|
+
shouldEnableDownloadButton: shouldEnableDownloadButton,
|
|
297
|
+
ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
|
|
292
298
|
}));
|
|
293
299
|
}
|
|
294
300
|
|
|
@@ -2,10 +2,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import React, { useContext, useLayoutEffect, useRef } from 'react';
|
|
4
4
|
import { PureComponent } from 'react';
|
|
5
|
-
import { IntlProvider } from 'react-intl';
|
|
6
5
|
import { getSchemaBasedOnStage } from '@atlaskit/adf-schema';
|
|
7
6
|
import { reduce } from '@atlaskit/adf-utils';
|
|
8
|
-
import { UnsupportedBlock, ProviderFactory, BaseTheme, WidthProvider, getAnalyticsAppearance, getAnalyticsEventSeverity, WithCreateAnalyticsEvent, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking } from '@atlaskit/editor-common';
|
|
7
|
+
import { UnsupportedBlock, ProviderFactory, BaseTheme, WidthProvider, getAnalyticsAppearance, getAnalyticsEventSeverity, WithCreateAnalyticsEvent, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking, IntlNextErrorBoundary, LegacyToNextIntlProvider, IntlLegacyFallbackProvider } from '@atlaskit/editor-common';
|
|
9
8
|
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
10
9
|
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
11
10
|
import { IframeWidthObserverFallbackWrapper, IframeWrapperConsumer } from '@atlaskit/width-detector';
|
|
@@ -147,7 +146,7 @@ export class Renderer extends PureComponent {
|
|
|
147
146
|
const nextMedia = nextProps.media || {};
|
|
148
147
|
const media = this.props.media || {};
|
|
149
148
|
|
|
150
|
-
if (nextProps.portal !== this.props.portal || nextProps.appearance !== this.props.appearance || nextProps.stickyHeaders !== this.props.stickyHeaders || nextProps.disableActions !== this.props.disableActions || nextProps.
|
|
149
|
+
if (nextProps.portal !== this.props.portal || nextProps.appearance !== this.props.appearance || nextProps.stickyHeaders !== this.props.stickyHeaders || nextProps.disableActions !== this.props.disableActions || nextProps.allowCustomPanels !== this.props.allowCustomPanels || nextProps.allowHeadingAnchorLinks !== this.props.allowHeadingAnchorLinks || nextMedia.allowLinking !== media.allowLinking) {
|
|
151
150
|
this.serializer = new ReactSerializer(this.deriveSerializerProps(nextProps));
|
|
152
151
|
}
|
|
153
152
|
}
|
|
@@ -183,7 +182,7 @@ export class Renderer extends PureComponent {
|
|
|
183
182
|
surroundTextNodesWithTextWrapper: allowAnnotationsDraftMode,
|
|
184
183
|
media: props.media,
|
|
185
184
|
allowCopyToClipboard: props.allowCopyToClipboard,
|
|
186
|
-
allowCustomPanels: props.
|
|
185
|
+
allowCustomPanels: props.allowCustomPanels,
|
|
187
186
|
allowAnnotations: props.allowAnnotations,
|
|
188
187
|
allowSelectAllTrap: props.allowSelectAllTrap,
|
|
189
188
|
allowPlaceholderText: props.allowPlaceholderText
|
|
@@ -206,7 +205,7 @@ export class Renderer extends PureComponent {
|
|
|
206
205
|
allowPlaceholderText,
|
|
207
206
|
allowColumnSorting,
|
|
208
207
|
allowCopyToClipboard,
|
|
209
|
-
|
|
208
|
+
allowCustomPanels
|
|
210
209
|
} = this.props;
|
|
211
210
|
const allowNestedHeaderLinks = isNestedHeaderLinksEnabled(allowHeadingAnchorLinks);
|
|
212
211
|
/**
|
|
@@ -270,7 +269,7 @@ export class Renderer extends PureComponent {
|
|
|
270
269
|
value: this.featureFlags(this.props.featureFlags)
|
|
271
270
|
}, /*#__PURE__*/React.createElement(CopyTextProvider, null, /*#__PURE__*/React.createElement(ActiveHeaderIdProvider, {
|
|
272
271
|
value: getActiveHeadingId(allowHeadingAnchorLinks)
|
|
273
|
-
}, /*#__PURE__*/React.createElement(
|
|
272
|
+
}, /*#__PURE__*/React.createElement(LegacyToNextIntlProvider, null, /*#__PURE__*/React.createElement(IntlLegacyFallbackProvider, null, /*#__PURE__*/React.createElement(AnalyticsContext.Provider, {
|
|
274
273
|
value: {
|
|
275
274
|
fireAnalyticsEvent: event => this.fireAnalyticsEvent(event)
|
|
276
275
|
}
|
|
@@ -280,7 +279,7 @@ export class Renderer extends PureComponent {
|
|
|
280
279
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
281
280
|
allowColumnSorting: allowColumnSorting,
|
|
282
281
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
283
|
-
allowCustomPanels:
|
|
282
|
+
allowCustomPanels: allowCustomPanels,
|
|
284
283
|
allowPlaceholderText: allowPlaceholderText,
|
|
285
284
|
innerRef: this.editorRef,
|
|
286
285
|
onClick: handleWrapperOnClick,
|
|
@@ -291,7 +290,7 @@ export class Renderer extends PureComponent {
|
|
|
291
290
|
doc: pmDoc,
|
|
292
291
|
schema: schema,
|
|
293
292
|
onAnalyticsEvent: this.fireAnalyticsEvent
|
|
294
|
-
}, result))))))));
|
|
293
|
+
}, result)))))))));
|
|
295
294
|
return truncated ? /*#__PURE__*/React.createElement(TruncatedWrapper, {
|
|
296
295
|
height: maxHeight,
|
|
297
296
|
fadeHeight: fadeOutHeight
|
|
@@ -340,14 +339,15 @@ const RendererWithAnalytics = /*#__PURE__*/React.memo(props => /*#__PURE__*/Reac
|
|
|
340
339
|
}
|
|
341
340
|
}, /*#__PURE__*/React.createElement(WithCreateAnalyticsEvent, {
|
|
342
341
|
render: createAnalyticsEvent => {
|
|
342
|
+
// `IntlNextErrorBoundary` only captures Internationalisation errors, leaving others for `ErrorBoundary`.
|
|
343
343
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
344
344
|
component: ACTION_SUBJECT.RENDERER,
|
|
345
345
|
rethrowError: true,
|
|
346
346
|
fallbackComponent: null,
|
|
347
347
|
createAnalyticsEvent: createAnalyticsEvent
|
|
348
|
-
}, /*#__PURE__*/React.createElement(Renderer, _extends({}, props, {
|
|
348
|
+
}, /*#__PURE__*/React.createElement(IntlNextErrorBoundary, null, /*#__PURE__*/React.createElement(Renderer, _extends({}, props, {
|
|
349
349
|
createAnalyticsEvent: createAnalyticsEvent
|
|
350
|
-
})));
|
|
350
|
+
}))));
|
|
351
351
|
}
|
|
352
352
|
})));
|
|
353
353
|
const RendererWithIframeFallbackWrapper = /*#__PURE__*/React.memo(props => {
|
|
@@ -3,7 +3,8 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
3
3
|
import { gridSize, fontFamily, fontSize, borderRadius } from '@atlaskit/theme/constants';
|
|
4
4
|
import * as colors from '@atlaskit/theme/colors';
|
|
5
5
|
import { headingSizes as headingSizesImport } from '@atlaskit/theme/typography';
|
|
6
|
-
import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, panelSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle,
|
|
6
|
+
import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, panelSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, richMediaClassName, tasksAndDecisionsStyles, smartCardSharedStyles, tableCellPadding, textColorStyles } from '@atlaskit/editor-common/styles';
|
|
7
|
+
import { shadowClassNames } from '@atlaskit/editor-common/ui';
|
|
7
8
|
import { editorFontSize, blockNodesVerticalMargin, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, gridMediumMaxWidth, akEditorFullWidthLayoutWidth, akEditorStickyHeaderZIndex, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
8
9
|
import { RendererCssClassName } from '../../consts';
|
|
9
10
|
import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
|
|
@@ -333,6 +334,7 @@ export const Wrapper = styled.div`
|
|
|
333
334
|
${codeMarkSharedStyles};
|
|
334
335
|
${shadowSharedStyle};
|
|
335
336
|
${dateSharedStyle};
|
|
337
|
+
${textColorStyles};
|
|
336
338
|
${tasksAndDecisionsStyles};
|
|
337
339
|
${smartCardSharedStyles}
|
|
338
340
|
|
|
@@ -589,7 +591,7 @@ export const Wrapper = styled.div`
|
|
|
589
591
|
margin-top: 0;
|
|
590
592
|
}
|
|
591
593
|
|
|
592
|
-
&:hover button.copy-to-clipboard{
|
|
594
|
+
&:hover button.copy-to-clipboard, .copy-to-clipboard:focus{
|
|
593
595
|
opacity: 1;
|
|
594
596
|
position: absolute;
|
|
595
597
|
height: 32px;
|
|
@@ -20,8 +20,10 @@ export const useAnnotationStateByTypeEvent = ({
|
|
|
20
20
|
|
|
21
21
|
const nextStates = Object.values(payload).reduce((acc, curr) => {
|
|
22
22
|
if (curr.annotationType === type) {
|
|
23
|
+
// Check for empty state to prevent additional renders
|
|
24
|
+
const isEmpty = curr.state === null || curr.state === undefined;
|
|
23
25
|
return { ...acc,
|
|
24
|
-
[curr.id]: curr.state
|
|
26
|
+
[curr.id]: !isEmpty ? curr.state : states[curr.id]
|
|
25
27
|
};
|
|
26
28
|
}
|
|
27
29
|
|
package/dist/es2019/version.json
CHANGED
|
@@ -13,6 +13,7 @@ export var ACTION;
|
|
|
13
13
|
ACTION["STARTED"] = "started";
|
|
14
14
|
ACTION["RENDERED"] = "rendered";
|
|
15
15
|
ACTION["CRASHED"] = "unhandledErrorCaught";
|
|
16
|
+
ACTION["INVALID_PROSEMIRROR_DOCUMENT"] = "invalidProsemirrorDocument";
|
|
16
17
|
ACTION["SELECT_ALL_CAUGHT"] = "selectAllCaught";
|
|
17
18
|
ACTION["SELECT_ALL_ESCAPED"] = "selectAllEscaped";
|
|
18
19
|
ACTION["CLICKED"] = "clicked";
|