@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
package/dist/esm/messages.js
CHANGED
package/dist/esm/react/index.js
CHANGED
|
@@ -430,7 +430,8 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
430
430
|
}, {
|
|
431
431
|
key: "getMediaProps",
|
|
432
432
|
value: function getMediaProps(node) {
|
|
433
|
-
var _this6 = this
|
|
433
|
+
var _this6 = this,
|
|
434
|
+
_this$media;
|
|
434
435
|
|
|
435
436
|
var path = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
436
437
|
var link = node.type.schema.marks.link;
|
|
@@ -446,7 +447,8 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
446
447
|
isLinkMark: isLinkMark,
|
|
447
448
|
allowAltTextOnImages: this.allowAltTextOnImages,
|
|
448
449
|
featureFlags: this.media && this.media.featureFlags,
|
|
449
|
-
shouldOpenMediaViewer: this.shouldOpenMediaViewer
|
|
450
|
+
shouldOpenMediaViewer: this.shouldOpenMediaViewer,
|
|
451
|
+
ssr: (_this$media = this.media) === null || _this$media === void 0 ? void 0 : _this$media.ssr
|
|
450
452
|
});
|
|
451
453
|
}
|
|
452
454
|
}, {
|
|
@@ -473,13 +475,14 @@ var ReactSerializer = /*#__PURE__*/function () {
|
|
|
473
475
|
}, {
|
|
474
476
|
key: "getMediaGroupProps",
|
|
475
477
|
value: function getMediaGroupProps(node) {
|
|
476
|
-
var _this$
|
|
478
|
+
var _this$media2, _this$media3;
|
|
477
479
|
|
|
478
480
|
return _objectSpread(_objectSpread({}, this.getProps(node)), {}, {
|
|
479
481
|
shouldOpenMediaViewer: this.shouldOpenMediaViewer,
|
|
480
482
|
allowAltTextOnImages: this.allowAltTextOnImages,
|
|
481
483
|
featureFlags: this.media && this.media.featureFlags,
|
|
482
|
-
enableDownloadButton: (_this$
|
|
484
|
+
enableDownloadButton: (_this$media2 = this.media) === null || _this$media2 === void 0 ? void 0 : _this$media2.enableDownloadButton,
|
|
485
|
+
ssr: (_this$media3 = this.media) === null || _this$media3 === void 0 ? void 0 : _this$media3.ssr
|
|
483
486
|
});
|
|
484
487
|
}
|
|
485
488
|
}, {
|
|
@@ -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
|
+
var 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 var 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 var toReact = function 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,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
3
4
|
export default function TextColor(props) {
|
|
5
|
+
var style = useMemo(function () {
|
|
6
|
+
return _defineProperty({}, '--custom-text-color', props.color);
|
|
7
|
+
}, [props.color]);
|
|
4
8
|
return /*#__PURE__*/React.createElement("span", _extends({}, props.dataAttributes, {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
9
|
+
"data-text-custom-color": props.color,
|
|
10
|
+
className: "fabric-text-color-mark",
|
|
11
|
+
style: style
|
|
8
12
|
}), props.children);
|
|
9
13
|
}
|
|
@@ -3,7 +3,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
|
-
import { injectIntl } from 'react-intl';
|
|
6
|
+
import { injectIntl } from 'react-intl-next';
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { CodeBlock as AkCodeBlock } from '@atlaskit/code';
|
|
9
9
|
import { overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
@@ -4,7 +4,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
4
4
|
var _templateObject;
|
|
5
5
|
|
|
6
6
|
import React, { useState } from 'react';
|
|
7
|
-
import { injectIntl } from 'react-intl';
|
|
7
|
+
import { injectIntl } from 'react-intl-next';
|
|
8
8
|
import styled from 'styled-components';
|
|
9
9
|
import Tooltip from '@atlaskit/tooltip';
|
|
10
10
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
@@ -11,7 +11,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import { PureComponent } from 'react';
|
|
13
13
|
import { isPastDate, timestampToString, timestampToTaskContext, DateSharedCssClassName } from '@atlaskit/editor-common';
|
|
14
|
-
import { injectIntl } from 'react-intl';
|
|
14
|
+
import { injectIntl } from 'react-intl-next';
|
|
15
15
|
|
|
16
16
|
var Date = /*#__PURE__*/function (_PureComponent) {
|
|
17
17
|
_inherits(Date, _PureComponent);
|
|
@@ -22,7 +22,7 @@ import styled from 'styled-components';
|
|
|
22
22
|
import { N200, N500, B400 } from '@atlaskit/theme/colors';
|
|
23
23
|
import LinkIcon from '@atlaskit/icon/glyph/link';
|
|
24
24
|
import Tooltip from '@atlaskit/tooltip';
|
|
25
|
-
import { injectIntl } from 'react-intl';
|
|
25
|
+
import { injectIntl } from 'react-intl-next';
|
|
26
26
|
import { headingAnchorLinkMessages } from '../../messages';
|
|
27
27
|
export var HeadingAnchorWrapperClassName = 'heading-anchor-wrapper';
|
|
28
28
|
var CopyAnchorWrapperWithRef = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -1,15 +1,14 @@
|
|
|
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
|
var getCurrentUrlWithHash = function getCurrentUrlWithHash() {
|
|
10
9
|
var hash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
11
|
-
var url = new
|
|
12
|
-
url.
|
|
10
|
+
var url = new URL(window.location.href);
|
|
11
|
+
url.hash = encodeURIComponent(hash);
|
|
13
12
|
return url.href;
|
|
14
13
|
};
|
|
15
14
|
|
|
@@ -44,7 +44,8 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
44
44
|
alt = _this$props.alt,
|
|
45
45
|
featureFlags = _this$props.featureFlags,
|
|
46
46
|
allowMediaViewer = _this$props.shouldOpenMediaViewer,
|
|
47
|
-
enableDownloadButton = _this$props.enableDownloadButton
|
|
47
|
+
enableDownloadButton = _this$props.enableDownloadButton,
|
|
48
|
+
ssr = _this$props.ssr;
|
|
48
49
|
|
|
49
50
|
var linkMark = _this.props.marks.find(_this.props.isLinkMark);
|
|
50
51
|
|
|
@@ -59,7 +60,8 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
59
60
|
eventHandlers: eventHandlers,
|
|
60
61
|
alt: allowAltTextOnImages ? alt : undefined,
|
|
61
62
|
featureFlags: featureFlags,
|
|
62
|
-
shouldEnableDownloadButton: enableDownloadButton
|
|
63
|
+
shouldEnableDownloadButton: enableDownloadButton,
|
|
64
|
+
ssr: ssr
|
|
63
65
|
}));
|
|
64
66
|
return linkHref ? /*#__PURE__*/React.createElement(MediaLink, {
|
|
65
67
|
href: linkHref,
|
|
@@ -14,7 +14,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
14
14
|
import { mapBreakpointToLayoutMaxWidth, WidthConsumer } from '@atlaskit/editor-common';
|
|
15
15
|
import { akEditorFullWidthLayoutWidth, getAkEditorFullPageMaxWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
16
16
|
import { Component, default as React } from 'react';
|
|
17
|
-
import { injectIntl } from 'react-intl';
|
|
17
|
+
import { injectIntl } from 'react-intl-next';
|
|
18
18
|
import { FullPagePadding } from '../../../ui/Renderer/style';
|
|
19
19
|
import { ExtendedUIMediaSingle } from './styles';
|
|
20
20
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
@@ -17,17 +17,16 @@ import EmojiItem from './emoji'; // AFP-2532 TODO: Fix automatic suppressions be
|
|
|
17
17
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
18
18
|
|
|
19
19
|
import { themed } from '@atlaskit/theme';
|
|
20
|
+
import { getPanelBackgroundDarkModeColors } from '@atlaskit/editor-common';
|
|
20
21
|
var PanelStyled = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n"])), function (props) {
|
|
21
22
|
if (props['data-panel-type'] !== PanelType.CUSTOM || !props.backgroundColor) {
|
|
22
23
|
return '';
|
|
23
|
-
}
|
|
24
|
+
} // Similar to mainDynamicStyles()
|
|
24
25
|
|
|
25
|
-
var border = themed({
|
|
26
|
-
light: 'none',
|
|
27
|
-
dark: "1px solid rgba(255, 255, 255, 0.4)"
|
|
28
|
-
})(props); // Similar to mainDynamicStyles()
|
|
29
26
|
|
|
30
|
-
return "\n &[data-panel-type=".concat(PanelType.CUSTOM, "] {\n background-color: ").concat(props.backgroundColor, ";\n
|
|
27
|
+
return "\n &[data-panel-type=".concat(PanelType.CUSTOM, "] {\n background-color: ").concat(props.backgroundColor, ";\n ").concat(themed({
|
|
28
|
+
dark: getPanelBackgroundDarkModeColors
|
|
29
|
+
}), ";\n }\n ");
|
|
31
30
|
});
|
|
32
31
|
var panelIcons = {
|
|
33
32
|
info: InfoIcon,
|
|
@@ -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
|
var SUPPORTS_HIRES_TIMER_API = !!(window.performance && performance.now);
|
|
6
8
|
|
|
@@ -64,7 +66,23 @@ export var renderDocument = function renderDocument(doc, serializer) {
|
|
|
64
66
|
|
|
65
67
|
var _withStopwatch2 = withStopwatch(function () {
|
|
66
68
|
var pmNode = schema.nodeFromJSON(validDoc);
|
|
67
|
-
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
pmNode.check();
|
|
72
|
+
} catch (err) {
|
|
73
|
+
if (dispatchAnalyticsEvent) {
|
|
74
|
+
dispatchAnalyticsEvent({
|
|
75
|
+
action: ACTION.INVALID_PROSEMIRROR_DOCUMENT,
|
|
76
|
+
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
77
|
+
attributes: {
|
|
78
|
+
platform: PLATFORM.WEB,
|
|
79
|
+
error: err === null || err === void 0 ? void 0 : err.toString()
|
|
80
|
+
},
|
|
81
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
68
86
|
return pmNode;
|
|
69
87
|
}),
|
|
70
88
|
node = _withStopwatch2.output,
|
package/dist/esm/ui/Expand.js
CHANGED
|
@@ -13,7 +13,7 @@ import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper, E
|
|
|
13
13
|
import { akEditorLineHeight, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
14
14
|
import { PLATFORM, MODE } from '../analytics/events';
|
|
15
15
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics/enums';
|
|
16
|
-
import { injectIntl } from 'react-intl';
|
|
16
|
+
import { injectIntl } from 'react-intl-next';
|
|
17
17
|
import { ActiveHeaderIdConsumer } from './active-header-id-provider';
|
|
18
18
|
import _uniqueId from 'lodash/uniqueId';
|
|
19
19
|
var Title = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n outline: none;\n border: none;\n font-size: ", ";\n line-height: ", ";\n font-weight: normal;\n display: flex;\n flex: 1;\n margin: 0;\n padding: 0 0 0 ", "px;\n text-align: left;\n"])), relativeFontSizeToBase16(fontSize()), akEditorLineHeight, gridSize() / 2);
|
package/dist/esm/ui/MediaCard.js
CHANGED
|
@@ -262,7 +262,8 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
262
262
|
imageStatus = _this$props4.imageStatus,
|
|
263
263
|
disableOverlay = _this$props4.disableOverlay,
|
|
264
264
|
alt = _this$props4.alt,
|
|
265
|
-
featureFlags = _this$props4.featureFlags
|
|
265
|
+
featureFlags = _this$props4.featureFlags,
|
|
266
|
+
ssr = _this$props4.ssr;
|
|
266
267
|
|
|
267
268
|
if (imageStatus === 'loading' || !url) {
|
|
268
269
|
return this.renderLoadingCard();
|
|
@@ -287,7 +288,8 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
287
288
|
mediaViewerDataSource: {
|
|
288
289
|
list: Array.from(mediaIdentifierMap.values())
|
|
289
290
|
},
|
|
290
|
-
featureFlags: featureFlags
|
|
291
|
+
featureFlags: featureFlags,
|
|
292
|
+
ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
|
|
291
293
|
});
|
|
292
294
|
}
|
|
293
295
|
/**
|
|
@@ -302,7 +304,7 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
302
304
|
value: function render() {
|
|
303
305
|
var _this$state = this.state,
|
|
304
306
|
contextIdentifierProvider = _this$state.contextIdentifierProvider,
|
|
305
|
-
|
|
307
|
+
mediaClientConfigInState = _this$state.mediaClientConfig,
|
|
306
308
|
fileState = _this$state.fileState;
|
|
307
309
|
var _this$props5 = this.props,
|
|
308
310
|
id = _this$props5.id,
|
|
@@ -318,7 +320,8 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
318
320
|
originalDimensions = _this$props5.originalDimensions,
|
|
319
321
|
forceOpenMediaViewer = _this$props5.shouldOpenMediaViewer,
|
|
320
322
|
featureFlags = _this$props5.featureFlags,
|
|
321
|
-
shouldEnableDownloadButton = _this$props5.shouldEnableDownloadButton
|
|
323
|
+
shouldEnableDownloadButton = _this$props5.shouldEnableDownloadButton,
|
|
324
|
+
ssr = _this$props5.ssr;
|
|
322
325
|
var isMobile = rendererAppearance === 'mobile';
|
|
323
326
|
var shouldPlayInline = useInlinePlayer !== undefined ? useInlinePlayer : true;
|
|
324
327
|
var isInlinePlayer = isMobile ? false : shouldPlayInline;
|
|
@@ -333,6 +336,8 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
333
336
|
return null;
|
|
334
337
|
}
|
|
335
338
|
|
|
339
|
+
var mediaClientConfig = !!ssr ? ssr.config : mediaClientConfigInState;
|
|
340
|
+
|
|
336
341
|
if (!mediaClientConfig || !id) {
|
|
337
342
|
return this.renderLoadingCard();
|
|
338
343
|
}
|
|
@@ -374,7 +379,8 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
374
379
|
list: Array.from(mediaIdentifierMap.values())
|
|
375
380
|
},
|
|
376
381
|
featureFlags: featureFlags,
|
|
377
|
-
shouldEnableDownloadButton: shouldEnableDownloadButton
|
|
382
|
+
shouldEnableDownloadButton: shouldEnableDownloadButton,
|
|
383
|
+
ssr: ssr === null || ssr === void 0 ? void 0 : ssr.mode
|
|
378
384
|
}));
|
|
379
385
|
}
|
|
380
386
|
}]);
|
|
@@ -17,10 +17,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
17
17
|
|
|
18
18
|
import React, { useContext, useLayoutEffect, useRef } from 'react';
|
|
19
19
|
import { PureComponent } from 'react';
|
|
20
|
-
import { IntlProvider } from 'react-intl';
|
|
21
20
|
import { getSchemaBasedOnStage } from '@atlaskit/adf-schema';
|
|
22
21
|
import { reduce } from '@atlaskit/adf-utils';
|
|
23
|
-
import { UnsupportedBlock, ProviderFactory, BaseTheme, WidthProvider, getAnalyticsAppearance, getAnalyticsEventSeverity, WithCreateAnalyticsEvent, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking } from '@atlaskit/editor-common';
|
|
22
|
+
import { UnsupportedBlock, ProviderFactory, BaseTheme, WidthProvider, getAnalyticsAppearance, getAnalyticsEventSeverity, WithCreateAnalyticsEvent, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking, IntlNextErrorBoundary, LegacyToNextIntlProvider, IntlLegacyFallbackProvider } from '@atlaskit/editor-common';
|
|
24
23
|
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
25
24
|
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
26
25
|
import { IframeWidthObserverFallbackWrapper, IframeWrapperConsumer } from '@atlaskit/width-detector';
|
|
@@ -174,7 +173,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
174
173
|
var nextMedia = nextProps.media || {};
|
|
175
174
|
var media = this.props.media || {};
|
|
176
175
|
|
|
177
|
-
if (nextProps.portal !== this.props.portal || nextProps.appearance !== this.props.appearance || nextProps.stickyHeaders !== this.props.stickyHeaders || nextProps.disableActions !== this.props.disableActions || nextProps.
|
|
176
|
+
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) {
|
|
178
177
|
this.serializer = new ReactSerializer(this.deriveSerializerProps(nextProps));
|
|
179
178
|
}
|
|
180
179
|
}
|
|
@@ -208,7 +207,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
208
207
|
surroundTextNodesWithTextWrapper: allowAnnotationsDraftMode,
|
|
209
208
|
media: props.media,
|
|
210
209
|
allowCopyToClipboard: props.allowCopyToClipboard,
|
|
211
|
-
allowCustomPanels: props.
|
|
210
|
+
allowCustomPanels: props.allowCustomPanels,
|
|
212
211
|
allowAnnotations: props.allowAnnotations,
|
|
213
212
|
allowSelectAllTrap: props.allowSelectAllTrap,
|
|
214
213
|
allowPlaceholderText: props.allowPlaceholderText
|
|
@@ -234,7 +233,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
234
233
|
allowPlaceholderText = _this$props2.allowPlaceholderText,
|
|
235
234
|
allowColumnSorting = _this$props2.allowColumnSorting,
|
|
236
235
|
allowCopyToClipboard = _this$props2.allowCopyToClipboard,
|
|
237
|
-
|
|
236
|
+
allowCustomPanels = _this$props2.allowCustomPanels;
|
|
238
237
|
var allowNestedHeaderLinks = isNestedHeaderLinksEnabled(allowHeadingAnchorLinks);
|
|
239
238
|
/**
|
|
240
239
|
* Handle clicks inside renderer. If the click isn't on media, in the media picker, or on a
|
|
@@ -297,7 +296,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
297
296
|
value: this.featureFlags(this.props.featureFlags)
|
|
298
297
|
}, /*#__PURE__*/React.createElement(CopyTextProvider, null, /*#__PURE__*/React.createElement(ActiveHeaderIdProvider, {
|
|
299
298
|
value: getActiveHeadingId(allowHeadingAnchorLinks)
|
|
300
|
-
}, /*#__PURE__*/React.createElement(
|
|
299
|
+
}, /*#__PURE__*/React.createElement(LegacyToNextIntlProvider, null, /*#__PURE__*/React.createElement(IntlLegacyFallbackProvider, null, /*#__PURE__*/React.createElement(AnalyticsContext.Provider, {
|
|
301
300
|
value: {
|
|
302
301
|
fireAnalyticsEvent: function fireAnalyticsEvent(event) {
|
|
303
302
|
return _this3.fireAnalyticsEvent(event);
|
|
@@ -309,7 +308,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
309
308
|
allowNestedHeaderLinks: allowNestedHeaderLinks,
|
|
310
309
|
allowColumnSorting: allowColumnSorting,
|
|
311
310
|
allowCopyToClipboard: allowCopyToClipboard,
|
|
312
|
-
allowCustomPanels:
|
|
311
|
+
allowCustomPanels: allowCustomPanels,
|
|
313
312
|
allowPlaceholderText: allowPlaceholderText,
|
|
314
313
|
innerRef: this.editorRef,
|
|
315
314
|
onClick: handleWrapperOnClick,
|
|
@@ -320,7 +319,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
320
319
|
doc: pmDoc,
|
|
321
320
|
schema: schema,
|
|
322
321
|
onAnalyticsEvent: this.fireAnalyticsEvent
|
|
323
|
-
}, result))))))));
|
|
322
|
+
}, result)))))))));
|
|
324
323
|
return truncated ? /*#__PURE__*/React.createElement(TruncatedWrapper, {
|
|
325
324
|
height: maxHeight,
|
|
326
325
|
fadeHeight: fadeOutHeight
|
|
@@ -371,14 +370,15 @@ var RendererWithAnalytics = /*#__PURE__*/React.memo(function (props) {
|
|
|
371
370
|
}
|
|
372
371
|
}, /*#__PURE__*/React.createElement(WithCreateAnalyticsEvent, {
|
|
373
372
|
render: function render(createAnalyticsEvent) {
|
|
373
|
+
// `IntlNextErrorBoundary` only captures Internationalisation errors, leaving others for `ErrorBoundary`.
|
|
374
374
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
375
375
|
component: ACTION_SUBJECT.RENDERER,
|
|
376
376
|
rethrowError: true,
|
|
377
377
|
fallbackComponent: null,
|
|
378
378
|
createAnalyticsEvent: createAnalyticsEvent
|
|
379
|
-
}, /*#__PURE__*/React.createElement(Renderer, _extends({}, props, {
|
|
379
|
+
}, /*#__PURE__*/React.createElement(IntlNextErrorBoundary, null, /*#__PURE__*/React.createElement(Renderer, _extends({}, props, {
|
|
380
380
|
createAnalyticsEvent: createAnalyticsEvent
|
|
381
|
-
})));
|
|
381
|
+
}))));
|
|
382
382
|
}
|
|
383
383
|
}));
|
|
384
384
|
});
|
|
@@ -7,7 +7,8 @@ import { themed } from '@atlaskit/theme/components';
|
|
|
7
7
|
import { gridSize, fontFamily, fontSize, borderRadius } from '@atlaskit/theme/constants';
|
|
8
8
|
import * as colors from '@atlaskit/theme/colors';
|
|
9
9
|
import { headingSizes as headingSizesImport } from '@atlaskit/theme/typography';
|
|
10
|
-
import { tableSharedStyle, columnLayoutSharedStyle, blockquoteSharedStyles, headingsSharedStyles, panelSharedStyles, ruleSharedStyles, whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, mediaSingleSharedStyle, TableSharedCssClassName, tableMarginTop, codeMarkSharedStyles, shadowSharedStyle,
|
|
10
|
+
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';
|
|
11
|
+
import { shadowClassNames } from '@atlaskit/editor-common/ui';
|
|
11
12
|
import { editorFontSize, blockNodesVerticalMargin, akEditorTableToolbar, akEditorTableToolbarDark, akEditorTableBorder, akEditorTableBorderDark, akEditorTableNumberColumnWidth, gridMediumMaxWidth, akEditorFullWidthLayoutWidth, akEditorStickyHeaderZIndex, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
12
13
|
import { RendererCssClassName } from '../../consts';
|
|
13
14
|
import { HeadingAnchorWrapperClassName } from '../../react/nodes/heading-anchor';
|
|
@@ -91,10 +92,10 @@ var fullWidthStyles = function fullWidthStyles(_ref4) {
|
|
|
91
92
|
}; // prettier-ignore
|
|
92
93
|
|
|
93
94
|
|
|
94
|
-
export var Wrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + .rich-media-wrapped + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n\n ", "\n\n .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after, &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-child {\n height: 100%;\n\n td, th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid ", ";\n border-bottom: 1px solid ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th, .sticky td {\n box-shadow: 0px 1px ", ", 0px -0.5px ", ", inset -1px 0px ", ", 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard{\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n }\n"])), editorFontSize, themed({
|
|
95
|
+
export var Wrapper = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + .rich-media-wrapped + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n\n ", "\n\n .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after, &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-child {\n height: 100%;\n\n td, th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid ", ";\n border-bottom: 1px solid ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th, .sticky td {\n box-shadow: 0px 1px ", ", 0px -0.5px ", ", inset -1px 0px ", ", 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard, .copy-to-clipboard:focus{\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n }\n"])), editorFontSize, themed({
|
|
95
96
|
light: colors.N800,
|
|
96
97
|
dark: '#B8C7E0'
|
|
97
|
-
}), fullPageStyles, fullWidthStyles, headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), colors.B400, colors.B300, colors.placeholderText, whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles, panelSharedStyles, ruleSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, tasksAndDecisionsStyles, smartCardSharedStyles, fontFamily(), relativeFontSizeToBase16(fontSize()), themed({
|
|
98
|
+
}), fullPageStyles, fullWidthStyles, headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), colors.B400, colors.B300, colors.placeholderText, whitespaceSharedStyles, blockquoteSharedStyles, headingsSharedStyles, panelSharedStyles, ruleSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, blockMarksSharedStyles, codeMarkSharedStyles, shadowSharedStyle, dateSharedStyle, textColorStyles, tasksAndDecisionsStyles, smartCardSharedStyles, fontFamily(), relativeFontSizeToBase16(fontSize()), themed({
|
|
98
99
|
light: colors.N30A,
|
|
99
100
|
dark: colors.DN70
|
|
100
101
|
}), borderRadius(), themed({
|
|
@@ -23,7 +23,7 @@ export var StatusClassNames;
|
|
|
23
23
|
})(StatusClassNames || (StatusClassNames = {}));
|
|
24
24
|
|
|
25
25
|
var Wrapper = styled.figure(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: 6px;\n right: 0;\n top: 0;\n border: 2px solid #fff;\n border-radius: ", "px;\n background-color: ", ";\n justify-content: center;\n align-items: center;\n\n &:hover {\n background-color: ", ";\n }\n\n &.", " {\n cursor: not-allowed;\n }\n"])), gridSize() / 2, N20, N30, StatusClassNames.SORTING_NOT_ALLOWED);
|
|
26
|
-
var TableSortingIcon = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n background-image: url(", ");\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.
|
|
26
|
+
var TableSortingIcon = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n background-image: url(", ");\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), TableSortIconDataUrl, StatusClassNames.DESC, TABLE_SORTING_ICON_CLASS);
|
|
27
27
|
|
|
28
28
|
var getClassName = function getClassName(status) {
|
|
29
29
|
switch (status) {
|
|
@@ -31,7 +31,9 @@ export var useAnnotationStateByTypeEvent = function useAnnotationStateByTypeEven
|
|
|
31
31
|
|
|
32
32
|
var nextStates = Object.values(payload).reduce(function (acc, curr) {
|
|
33
33
|
if (curr.annotationType === type) {
|
|
34
|
-
|
|
34
|
+
// Check for empty state to prevent additional renders
|
|
35
|
+
var isEmpty = curr.state === null || curr.state === undefined;
|
|
36
|
+
return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, curr.id, !isEmpty ? curr.state : states[curr.id]));
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
return acc;
|
package/dist/esm/version.json
CHANGED
|
@@ -8,6 +8,7 @@ export declare enum ACTION {
|
|
|
8
8
|
STARTED = "started",
|
|
9
9
|
RENDERED = "rendered",
|
|
10
10
|
CRASHED = "unhandledErrorCaught",
|
|
11
|
+
INVALID_PROSEMIRROR_DOCUMENT = "invalidProsemirrorDocument",
|
|
11
12
|
SELECT_ALL_CAUGHT = "selectAllCaught",
|
|
12
13
|
SELECT_ALL_ESCAPED = "selectAllEscaped",
|
|
13
14
|
CLICKED = "clicked",
|
|
@@ -27,6 +27,10 @@ export declare type ComponentCrashErrorAEP = AEP<ACTION.CRASHED, ACTION_SUBJECT.
|
|
|
27
27
|
componentStack?: string;
|
|
28
28
|
errorRethrown?: boolean;
|
|
29
29
|
}, EVENT_TYPE.OPERATIONAL>;
|
|
30
|
+
declare type InvalidProsemirrorDocumentErrorAEP = AEP<ACTION.INVALID_PROSEMIRROR_DOCUMENT, ACTION_SUBJECT.RENDERER, ACTION_SUBJECT_ID, {
|
|
31
|
+
platform: PLATFORM.WEB;
|
|
32
|
+
errorStack?: string;
|
|
33
|
+
}, EVENT_TYPE.OPERATIONAL>;
|
|
30
34
|
declare type RendererUnsupportedContentLevelsTrackingSucceeded = AEP<ACTION.UNSUPPORTED_CONTENT_LEVELS_TRACKING_SUCCEEDED, ACTION_SUBJECT.RENDERER, undefined, {
|
|
31
35
|
appearance?: string;
|
|
32
36
|
platform: PLATFORM.WEB;
|
|
@@ -90,5 +94,5 @@ export declare enum RESOLVE_METHOD {
|
|
|
90
94
|
ORPHANED = "orphaned"
|
|
91
95
|
}
|
|
92
96
|
export declare type AnnotationAEP = AEP<AnnotationActionType, ACTION_SUBJECT.ANNOTATION, ACTION_SUBJECT_ID.INLINE_COMMENT, AnnotationAEPAttributes, undefined>;
|
|
93
|
-
export declare type AnalyticsEventPayload = RendererStartAEP | RendererRenderedAEP | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | HeadingAnchorLinkButtonAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP;
|
|
97
|
+
export declare type AnalyticsEventPayload = RendererStartAEP | RendererRenderedAEP | ComponentCrashErrorAEP | RendererUnsupportedContentLevelsTrackingSucceeded | RendererUnsupportedContentLevelsTrackingErrored | RendererSelectAllCaughtAEP | RendererSelectAllEscapedAEP | HeadingAnchorLinkButtonAEP | AnchorLinkAEP | TableSortColumnNotAllowedAEP | TableSortColumnAEP | VisitLinkAEP | VisitMediaLinkAEP | ExpandAEP | UnsupportedContentPayload | UnsupportedContentTooltipPayload | AnnotationAEP | AnnotationDeleteAEP | InvalidProsemirrorDocumentErrorAEP;
|
|
94
98
|
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import { Mark } from 'prosemirror-model';
|
|
4
4
|
import type { MarkProps } from '../types';
|
|
5
5
|
export declare const isCodeMark: (mark: Mark) => boolean;
|
|
6
6
|
export declare function CodeWithIntl(props: MarkProps<{
|
|
7
7
|
codeBidiWarningTooltipEnabled: boolean;
|
|
8
|
-
}> &
|
|
9
|
-
declare const _default: React.
|
|
8
|
+
}> & WrappedComponentProps): JSX.Element;
|
|
9
|
+
declare const _default: React.FC<import("react-intl-next").WithIntlProps<{
|
|
10
10
|
codeBidiWarningTooltipEnabled: boolean;
|
|
11
|
-
} & import("../types").MarkMeta
|
|
12
|
-
WrappedComponent:
|
|
11
|
+
} & import("../types").MarkMeta & WrappedComponentProps<"intl">>> & {
|
|
12
|
+
WrappedComponent: React.ComponentType<{
|
|
13
13
|
codeBidiWarningTooltipEnabled: boolean;
|
|
14
|
-
} & import("../types").MarkMeta &
|
|
14
|
+
} & import("../types").MarkMeta & WrappedComponentProps<"intl">>;
|
|
15
15
|
};
|
|
16
16
|
export default _default;
|
|
@@ -12,9 +12,10 @@ import Breakout from './breakout';
|
|
|
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';
|
|
16
17
|
export declare const markToReact: {
|
|
17
18
|
[key: string]: ComponentType<any>;
|
|
18
19
|
};
|
|
19
20
|
export declare const toReact: (mark: Mark) => ComponentType<any>;
|
|
20
|
-
export { Code, Em, Link, Strike, Strong, Subsup, TextColor, Underline, Breakout, Annotation, UnsupportedMark, isAnnotationMark, UnsupportedNodeAttribute, DataConsumer, };
|
|
21
|
+
export { Code, Em, Link, Strike, Strong, Subsup, TextColor, Underline, Breakout, Annotation, UnsupportedMark, isAnnotationMark, UnsupportedNodeAttribute, DataConsumer, FragmentMark, };
|