@atlaskit/renderer 84.1.1 → 88.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 +95 -0
- package/dist/cjs/actions/index.js +3 -3
- package/dist/cjs/analytics/enums.js +1 -0
- package/dist/cjs/analytics/unsupported-content.js +3 -3
- package/dist/cjs/messages.js +47 -1
- package/dist/cjs/react/hooks/use-observed-width.js +94 -0
- package/dist/cjs/react/index.js +15 -9
- package/dist/cjs/react/marks/annotation.js +2 -2
- package/dist/cjs/react/marks/breakout.js +5 -3
- package/dist/cjs/react/nodes/blockCard.js +2 -2
- package/dist/cjs/react/nodes/caption.js +2 -2
- package/dist/cjs/react/nodes/copy-text-provider.js +2 -1
- package/dist/cjs/react/nodes/date.js +6 -4
- package/dist/cjs/react/nodes/embedCard.js +5 -5
- package/dist/cjs/react/nodes/emoji.js +2 -2
- package/dist/cjs/react/nodes/extension.js +6 -4
- package/dist/cjs/react/nodes/heading-anchor.js +11 -3
- package/dist/cjs/react/nodes/index.js +80 -55
- package/dist/cjs/react/nodes/inlineCard.js +14 -3
- package/dist/cjs/react/nodes/layoutColumn.js +2 -2
- package/dist/cjs/react/nodes/media.js +5 -3
- package/dist/cjs/react/nodes/mediaGroup.js +2 -2
- package/dist/cjs/react/nodes/mediaInline.js +2 -2
- package/dist/cjs/react/nodes/mediaSingle/index.js +146 -152
- package/dist/cjs/react/nodes/mediaSingle/styles.js +2 -2
- package/dist/cjs/react/nodes/mention.js +2 -4
- package/dist/cjs/react/nodes/panel.js +18 -20
- package/dist/cjs/react/nodes/status.js +2 -1
- package/dist/cjs/react/nodes/table/colgroup.js +2 -2
- package/dist/cjs/react/nodes/table/sticky.js +4 -4
- package/dist/cjs/react/nodes/table.js +19 -13
- package/dist/cjs/react/nodes/tableCell.js +34 -21
- package/dist/cjs/react/nodes/tableRow.js +6 -4
- package/dist/cjs/react/nodes/task-item-with-providers.js +6 -2
- package/dist/cjs/react/nodes/taskItem.js +4 -3
- package/dist/cjs/render-document.js +19 -3
- package/dist/cjs/text/nodes/date.js +3 -3
- package/dist/cjs/types/smartLinksOptions.js +5 -0
- package/dist/cjs/ui/Expand.js +9 -9
- package/dist/cjs/ui/ExtensionRenderer.js +8 -4
- package/dist/cjs/ui/MediaCard.js +4 -4
- package/dist/cjs/ui/Renderer/breakout-ssr.js +50 -7
- package/dist/cjs/ui/Renderer/index.js +23 -18
- package/dist/cjs/ui/SortingIcon.js +30 -17
- package/dist/cjs/ui/annotations/draft/component.js +2 -2
- package/dist/cjs/ui/annotations/element/index.js +2 -2
- package/dist/cjs/ui/annotations/element/mark.js +4 -4
- package/dist/cjs/ui/annotations/hooks/use-events.js +11 -11
- package/dist/cjs/ui/annotations/hooks/use-load-annotations.js +4 -4
- package/dist/cjs/utils.js +4 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +1 -1
- package/dist/es2019/analytics/enums.js +1 -0
- package/dist/es2019/analytics/unsupported-content.js +1 -1
- package/dist/es2019/messages.js +44 -0
- package/dist/es2019/react/hooks/use-observed-width.js +59 -0
- package/dist/es2019/react/index.js +4 -1
- package/dist/es2019/react/marks/breakout.js +2 -1
- package/dist/es2019/react/nodes/blockCard.js +1 -1
- package/dist/es2019/react/nodes/caption.js +1 -1
- package/dist/es2019/react/nodes/copy-text-provider.js +2 -1
- package/dist/es2019/react/nodes/date.js +2 -1
- package/dist/es2019/react/nodes/embedCard.js +1 -1
- package/dist/es2019/react/nodes/emoji.js +1 -1
- package/dist/es2019/react/nodes/extension.js +2 -1
- package/dist/es2019/react/nodes/heading-anchor.js +11 -2
- package/dist/es2019/react/nodes/index.js +32 -7
- package/dist/es2019/react/nodes/inlineCard.js +12 -2
- package/dist/es2019/react/nodes/layoutColumn.js +1 -1
- package/dist/es2019/react/nodes/media.js +2 -1
- package/dist/es2019/react/nodes/mediaInline.js +1 -1
- package/dist/es2019/react/nodes/mediaSingle/index.js +132 -112
- package/dist/es2019/react/nodes/mediaSingle/styles.js +1 -1
- package/dist/es2019/react/nodes/mention.js +1 -3
- package/dist/es2019/react/nodes/panel.js +14 -12
- package/dist/es2019/react/nodes/status.js +2 -1
- package/dist/es2019/react/nodes/table/colgroup.js +1 -1
- package/dist/es2019/react/nodes/table/sticky.js +1 -1
- package/dist/es2019/react/nodes/table.js +4 -1
- package/dist/es2019/react/nodes/tableCell.js +22 -10
- package/dist/es2019/react/nodes/tableRow.js +2 -1
- package/dist/es2019/react/nodes/task-item-with-providers.js +3 -1
- package/dist/es2019/react/nodes/taskItem.js +2 -1
- package/dist/es2019/render-document.js +18 -2
- package/dist/es2019/text/nodes/date.js +1 -1
- package/dist/es2019/types/smartLinksOptions.js +1 -0
- package/dist/es2019/ui/Expand.js +1 -1
- package/dist/es2019/ui/ExtensionRenderer.js +3 -1
- package/dist/es2019/ui/MediaCard.js +1 -1
- package/dist/es2019/ui/Renderer/breakout-ssr.js +46 -5
- package/dist/es2019/ui/Renderer/index.js +4 -1
- package/dist/es2019/ui/SortingIcon.js +23 -11
- package/dist/es2019/ui/annotations/draft/component.js +1 -1
- package/dist/es2019/ui/annotations/element/index.js +1 -1
- package/dist/es2019/ui/annotations/element/mark.js +1 -1
- package/dist/es2019/ui/annotations/hooks/use-events.js +1 -1
- package/dist/es2019/ui/annotations/hooks/use-load-annotations.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +1 -1
- package/dist/esm/analytics/enums.js +1 -0
- package/dist/esm/analytics/unsupported-content.js +1 -1
- package/dist/esm/messages.js +44 -0
- package/dist/esm/react/hooks/use-observed-width.js +80 -0
- package/dist/esm/react/index.js +8 -4
- package/dist/esm/react/marks/annotation.js +2 -2
- package/dist/esm/react/marks/breakout.js +2 -1
- package/dist/esm/react/nodes/blockCard.js +1 -1
- package/dist/esm/react/nodes/caption.js +1 -1
- package/dist/esm/react/nodes/copy-text-provider.js +2 -1
- package/dist/esm/react/nodes/date.js +2 -1
- package/dist/esm/react/nodes/embedCard.js +1 -1
- package/dist/esm/react/nodes/emoji.js +1 -1
- package/dist/esm/react/nodes/extension.js +2 -1
- package/dist/esm/react/nodes/heading-anchor.js +12 -3
- package/dist/esm/react/nodes/index.js +62 -7
- package/dist/esm/react/nodes/inlineCard.js +12 -2
- package/dist/esm/react/nodes/layoutColumn.js +1 -1
- package/dist/esm/react/nodes/media.js +2 -1
- package/dist/esm/react/nodes/mediaGroup.js +2 -2
- package/dist/esm/react/nodes/mediaInline.js +1 -1
- package/dist/esm/react/nodes/mediaSingle/index.js +140 -141
- package/dist/esm/react/nodes/mediaSingle/styles.js +1 -1
- package/dist/esm/react/nodes/mention.js +1 -3
- package/dist/esm/react/nodes/panel.js +14 -12
- package/dist/esm/react/nodes/status.js +2 -1
- package/dist/esm/react/nodes/table/colgroup.js +1 -1
- package/dist/esm/react/nodes/table/sticky.js +1 -1
- package/dist/esm/react/nodes/table.js +4 -1
- package/dist/esm/react/nodes/tableCell.js +19 -9
- package/dist/esm/react/nodes/tableRow.js +2 -1
- package/dist/esm/react/nodes/task-item-with-providers.js +5 -2
- package/dist/esm/react/nodes/taskItem.js +2 -1
- package/dist/esm/render-document.js +17 -2
- package/dist/esm/text/nodes/date.js +1 -1
- package/dist/esm/types/smartLinksOptions.js +1 -0
- package/dist/esm/ui/Expand.js +1 -1
- package/dist/esm/ui/ExtensionRenderer.js +3 -1
- package/dist/esm/ui/MediaCard.js +3 -3
- package/dist/esm/ui/Renderer/breakout-ssr.js +48 -5
- package/dist/esm/ui/Renderer/index.js +6 -3
- package/dist/esm/ui/SortingIcon.js +21 -11
- package/dist/esm/ui/annotations/draft/component.js +1 -1
- package/dist/esm/ui/annotations/element/index.js +1 -1
- package/dist/esm/ui/annotations/element/mark.js +3 -3
- package/dist/esm/ui/annotations/hooks/use-events.js +3 -3
- package/dist/esm/ui/annotations/hooks/use-load-annotations.js +3 -3
- package/dist/esm/utils.js +3 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +1 -1
- package/dist/types/analytics/enums.d.ts +2 -1
- package/dist/types/analytics/events.d.ts +5 -2
- package/dist/types/analytics/unsupported-content.d.ts +1 -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 +6 -1
- package/dist/types/react/nodes/blockCard.d.ts +1 -1
- package/dist/types/react/nodes/bodiedExtension.d.ts +2 -1
- package/dist/types/react/nodes/codeBlock.d.ts +3 -3
- package/dist/types/react/nodes/embedCard.d.ts +1 -1
- package/dist/types/react/nodes/emoji.d.ts +1 -1
- package/dist/types/react/nodes/extension.d.ts +14 -13
- package/dist/types/react/nodes/index.d.ts +39 -15
- package/dist/types/react/nodes/inlineCard.d.ts +23 -21
- package/dist/types/react/nodes/inlineExtension.d.ts +2 -1
- package/dist/types/react/nodes/media.d.ts +2 -2
- package/dist/types/react/nodes/mediaGroup.d.ts +1 -1
- package/dist/types/react/nodes/mediaInline.d.ts +1 -1
- 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 +2 -2
- package/dist/types/react/nodes/panel.d.ts +3 -1
- package/dist/types/react/nodes/table/sticky.d.ts +1 -1
- package/dist/types/react/nodes/table.d.ts +22 -21
- package/dist/types/react/nodes/tableCell.d.ts +7 -60
- package/dist/types/react/nodes/tableRow.d.ts +1 -1
- package/dist/types/react/nodes/task-item-with-providers.d.ts +2 -1
- package/dist/types/react/nodes/taskItem.d.ts +1 -1
- package/dist/types/react/types.d.ts +3 -1
- package/dist/types/react/utils/getCardClickHandler.d.ts +1 -1
- package/dist/types/render-document.d.ts +1 -1
- package/dist/types/types/smartLinksOptions.d.ts +3 -0
- package/dist/types/ui/ExtensionRenderer.d.ts +3 -1
- package/dist/types/ui/MediaCard.d.ts +3 -2
- package/dist/types/ui/SortingIcon.d.ts +7 -4
- package/dist/types/ui/annotations/context.d.ts +1 -1
- package/dist/types/ui/annotations/element/mark.d.ts +1 -1
- package/dist/types/ui/annotations/hooks/use-events.d.ts +2 -1
- package/dist/types/ui/annotations/hooks/use-inline-comment-subscriber.d.ts +1 -1
- package/dist/types/ui/annotations/selection/mounter.d.ts +1 -1
- package/dist/types/ui/annotations/selection/range-validator.d.ts +1 -1
- package/dist/types/ui/annotations/types.d.ts +1 -1
- package/dist/types/ui/renderer-props.d.ts +8 -1
- package/dist/types/utils.d.ts +3 -1
- package/package.json +20 -21
|
@@ -3,7 +3,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
3
3
|
var _templateObject;
|
|
4
4
|
|
|
5
5
|
import styled from 'styled-components';
|
|
6
|
-
import { MediaSingle as UIMediaSingle } from '@atlaskit/editor-common';
|
|
6
|
+
import { MediaSingle as UIMediaSingle } from '@atlaskit/editor-common/ui';
|
|
7
7
|
export var ExtendedUIMediaSingle = styled(UIMediaSingle)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", " transition: all 0.1s linear;\n"])), function (_ref) {
|
|
8
8
|
var layout = _ref.layout;
|
|
9
9
|
return layout === 'full-width' || layout === 'wide' ? "\n margin-left: 50%;\n transform: translateX(-50%);\n " : "";
|
|
@@ -10,7 +10,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
10
10
|
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import { PureComponent } from 'react';
|
|
13
|
-
import { Mention } from '@atlaskit/editor-common';
|
|
13
|
+
import { Mention } from '@atlaskit/editor-common/mention';
|
|
14
14
|
|
|
15
15
|
var MentionItem = /*#__PURE__*/function (_PureComponent) {
|
|
16
16
|
_inherits(MentionItem, _PureComponent);
|
|
@@ -29,7 +29,6 @@ var MentionItem = /*#__PURE__*/function (_PureComponent) {
|
|
|
29
29
|
var _this$props = this.props,
|
|
30
30
|
eventHandlers = _this$props.eventHandlers,
|
|
31
31
|
id = _this$props.id,
|
|
32
|
-
portal = _this$props.portal,
|
|
33
32
|
providers = _this$props.providers,
|
|
34
33
|
text = _this$props.text,
|
|
35
34
|
accessLevel = _this$props.accessLevel;
|
|
@@ -38,7 +37,6 @@ var MentionItem = /*#__PURE__*/function (_PureComponent) {
|
|
|
38
37
|
text: text,
|
|
39
38
|
accessLevel: accessLevel,
|
|
40
39
|
providers: providers,
|
|
41
|
-
portal: portal,
|
|
42
40
|
eventHandlers: eventHandlers && eventHandlers.mention
|
|
43
41
|
});
|
|
44
42
|
}
|
|
@@ -4,20 +4,16 @@ var _templateObject;
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
|
-
import InfoIcon from '@atlaskit/icon/glyph/editor/info';
|
|
8
7
|
import TipIcon from '@atlaskit/icon/glyph/editor/hint';
|
|
9
|
-
import SuccessIcon from '@atlaskit/icon/glyph/editor/success';
|
|
10
|
-
import ErrorIcon from '@atlaskit/icon/glyph/editor/error';
|
|
11
|
-
import NoteIcon from '@atlaskit/icon/glyph/editor/note';
|
|
12
|
-
import WarningIcon from '@atlaskit/icon/glyph/warning';
|
|
13
8
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
14
|
-
import { PanelSharedCssClassName } from '@atlaskit/editor-common';
|
|
9
|
+
import { PanelSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
15
10
|
import EmojiIcon from '@atlaskit/icon/glyph/editor/emoji';
|
|
16
11
|
import EmojiItem from './emoji'; // AFP-2532 TODO: Fix automatic suppressions below
|
|
17
12
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
18
13
|
|
|
19
14
|
import { themed } from '@atlaskit/theme';
|
|
20
|
-
import { getPanelBackgroundDarkModeColors } from '@atlaskit/editor-common';
|
|
15
|
+
import { getPanelBackgroundDarkModeColors } from '@atlaskit/editor-common/styles';
|
|
16
|
+
import { PanelInfoIcon, PanelSuccessIcon, PanelNoteIcon, PanelWarningIcon, PanelErrorIcon } from '@atlaskit/editor-common/icons';
|
|
21
17
|
var PanelStyled = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n"])), function (props) {
|
|
22
18
|
if (props['data-panel-type'] !== PanelType.CUSTOM || !props.backgroundColor) {
|
|
23
19
|
return '';
|
|
@@ -29,12 +25,12 @@ var PanelStyled = styled.div(_templateObject || (_templateObject = _taggedTempla
|
|
|
29
25
|
}), ";\n }\n ");
|
|
30
26
|
});
|
|
31
27
|
var panelIcons = {
|
|
32
|
-
info:
|
|
33
|
-
success:
|
|
34
|
-
note:
|
|
28
|
+
info: PanelInfoIcon,
|
|
29
|
+
success: PanelSuccessIcon,
|
|
30
|
+
note: PanelNoteIcon,
|
|
35
31
|
tip: TipIcon,
|
|
36
|
-
warning:
|
|
37
|
-
error:
|
|
32
|
+
warning: PanelWarningIcon,
|
|
33
|
+
error: PanelErrorIcon,
|
|
38
34
|
custom: EmojiIcon
|
|
39
35
|
};
|
|
40
36
|
|
|
@@ -43,6 +39,8 @@ var Panel = function Panel(props) {
|
|
|
43
39
|
type = props.panelType,
|
|
44
40
|
panelColor = props.panelColor,
|
|
45
41
|
panelIcon = props.panelIcon,
|
|
42
|
+
panelIconId = props.panelIconId,
|
|
43
|
+
panelIconText = props.panelIconText,
|
|
46
44
|
providers = props.providers,
|
|
47
45
|
children = props.children; // only allow custom panel type if flag is set
|
|
48
46
|
// otherwise fall back to info if custom panel is given
|
|
@@ -53,6 +51,8 @@ var Panel = function Panel(props) {
|
|
|
53
51
|
if (panelType === PanelType.CUSTOM) {
|
|
54
52
|
if (panelIcon && providers) {
|
|
55
53
|
return /*#__PURE__*/React.createElement(EmojiItem, {
|
|
54
|
+
id: panelIconId,
|
|
55
|
+
text: panelIconText,
|
|
56
56
|
shortName: panelIcon,
|
|
57
57
|
providers: providers
|
|
58
58
|
});
|
|
@@ -82,6 +82,8 @@ var Panel = function Panel(props) {
|
|
|
82
82
|
"data-panel-type": panelType,
|
|
83
83
|
"data-panel-color": panelColor,
|
|
84
84
|
"data-panel-icon": panelIcon,
|
|
85
|
+
"data-panel-icon-id": panelIconId,
|
|
86
|
+
"data-panel-icon-text": panelIconText,
|
|
85
87
|
backgroundColor: panelColor
|
|
86
88
|
}, renderIcon(), /*#__PURE__*/React.createElement("div", {
|
|
87
89
|
className: PanelSharedCssClassName.content
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common';
|
|
2
|
+
import { tableCellBorderWidth, tableCellMinWidth } from '@atlaskit/editor-common/styles';
|
|
3
3
|
import { akEditorTableNumberColumnWidth, akEditorWideLayoutWidth, akEditorFullWidthLayoutWidth, akEditorTableLegacyCellMinWidth } from '@atlaskit/editor-shared-styles';
|
|
4
4
|
import { calcLineLength } from '../../../ui/Renderer/breakout-ssr';
|
|
5
5
|
// we allow scaling down column widths by no more than 15%
|
|
@@ -6,7 +6,7 @@ var _templateObject, _templateObject2, _templateObject3;
|
|
|
6
6
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import styled from 'styled-components';
|
|
9
|
-
import { TableSharedCssClassName } from '@atlaskit/editor-common';
|
|
9
|
+
import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
10
10
|
import { akEditorStickyHeaderZIndex } from '@atlaskit/editor-shared-styles';
|
|
11
11
|
import * as colors from '@atlaskit/theme/colors';
|
|
12
12
|
var N40A = colors.N40A;
|
|
@@ -16,7 +16,10 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
16
16
|
|
|
17
17
|
import React from 'react';
|
|
18
18
|
import styled from 'styled-components';
|
|
19
|
-
import { calcTableWidth,
|
|
19
|
+
import { calcTableWidth, TableSharedCssClassName, tableMarginTop } from '@atlaskit/editor-common/styles';
|
|
20
|
+
import { WidthConsumer, overflowShadow } from '@atlaskit/editor-common/ui';
|
|
21
|
+
import { createCompareNodes, convertProsemirrorTableNodeToArrayOfRows, hasMergedCell, compose } from '@atlaskit/editor-common/utils';
|
|
22
|
+
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
20
23
|
import { FullPagePadding } from '../../ui/Renderer/style';
|
|
21
24
|
import { TableHeader } from './tableCell';
|
|
22
25
|
import { withSmartCardStorage } from '../../ui/SmartCardStorage';
|
|
@@ -13,11 +13,14 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
13
|
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import { tableBackgroundColorPalette } from '@atlaskit/adf-schema';
|
|
16
|
-
import { compose
|
|
16
|
+
import { compose } from '@atlaskit/editor-common/utils';
|
|
17
|
+
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
17
18
|
import SortingIcon from '../../ui/SortingIcon';
|
|
18
19
|
import { MODE, PLATFORM } from '../../analytics/events';
|
|
19
20
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../analytics/enums';
|
|
20
21
|
import { RendererCssClassName } from '../../consts';
|
|
22
|
+
import { injectIntl } from 'react-intl-next';
|
|
23
|
+
import { tableCellMessages } from '../../messages';
|
|
21
24
|
var IgnoreSorting = ['LABEL', 'INPUT'];
|
|
22
25
|
|
|
23
26
|
var nextStatusOrder = function nextStatusOrder(currentSortOrder) {
|
|
@@ -35,19 +38,23 @@ var nextStatusOrder = function nextStatusOrder(currentSortOrder) {
|
|
|
35
38
|
return SortOrder.NO_ORDER;
|
|
36
39
|
};
|
|
37
40
|
|
|
38
|
-
var getSortOrderLabel = function getSortOrderLabel(currentSortOrder) {
|
|
41
|
+
var getSortOrderLabel = function getSortOrderLabel(intl, currentSortOrder) {
|
|
42
|
+
var noneSortingLabel = tableCellMessages.noneSortingLabel,
|
|
43
|
+
ascSortingLabel = tableCellMessages.ascSortingLabel,
|
|
44
|
+
descSortingLabel = tableCellMessages.descSortingLabel;
|
|
45
|
+
|
|
39
46
|
switch (currentSortOrder) {
|
|
40
47
|
case SortOrder.NO_ORDER:
|
|
41
|
-
return
|
|
48
|
+
return intl.formatMessage(noneSortingLabel);
|
|
42
49
|
|
|
43
50
|
case SortOrder.ASC:
|
|
44
|
-
return
|
|
51
|
+
return intl.formatMessage(ascSortingLabel);
|
|
45
52
|
|
|
46
53
|
case SortOrder.DESC:
|
|
47
|
-
return
|
|
54
|
+
return intl.formatMessage(descSortingLabel);
|
|
48
55
|
|
|
49
56
|
default:
|
|
50
|
-
return
|
|
57
|
+
return intl.formatMessage(noneSortingLabel);
|
|
51
58
|
}
|
|
52
59
|
};
|
|
53
60
|
|
|
@@ -125,7 +132,7 @@ var withCellProps = function withCellProps(WrapperComponent) {
|
|
|
125
132
|
};
|
|
126
133
|
|
|
127
134
|
export var withSortableColumn = function withSortableColumn(WrapperComponent) {
|
|
128
|
-
|
|
135
|
+
var WithSortableColumn = /*#__PURE__*/function (_React$Component2) {
|
|
129
136
|
_inherits(WithSortableColumn, _React$Component2);
|
|
130
137
|
|
|
131
138
|
var _super2 = _createSuper(WithSortableColumn);
|
|
@@ -200,7 +207,8 @@ export var withSortableColumn = function withSortableColumn(WrapperComponent) {
|
|
|
200
207
|
onSorting = _this$props3.onSorting,
|
|
201
208
|
children = _this$props3.children,
|
|
202
209
|
sortOrdered = _this$props3.sortOrdered,
|
|
203
|
-
isHeaderRow = _this$props3.isHeaderRow
|
|
210
|
+
isHeaderRow = _this$props3.isHeaderRow,
|
|
211
|
+
intl = _this$props3.intl;
|
|
204
212
|
var sortOrderedClassName = sortOrdered === SortOrder.NO_ORDER ? RendererCssClassName.SORTABLE_COLUMN_NO_ORDER : '';
|
|
205
213
|
|
|
206
214
|
if (!allowColumnSorting || !isHeaderRow) {
|
|
@@ -215,7 +223,7 @@ export var withSortableColumn = function withSortableColumn(WrapperComponent) {
|
|
|
215
223
|
|
|
216
224
|
return /*#__PURE__*/React.createElement(WrapperComponent, _extends({}, this.props, {
|
|
217
225
|
className: className,
|
|
218
|
-
ariaSort: getSortOrderLabel(sortOrdered)
|
|
226
|
+
ariaSort: getSortOrderLabel(intl, sortOrdered)
|
|
219
227
|
}), /*#__PURE__*/React.createElement("div", {
|
|
220
228
|
className: RendererCssClassName.SORTABLE_COLUMN_BUTTON,
|
|
221
229
|
role: "button",
|
|
@@ -235,6 +243,8 @@ export var withSortableColumn = function withSortableColumn(WrapperComponent) {
|
|
|
235
243
|
|
|
236
244
|
return WithSortableColumn;
|
|
237
245
|
}(React.Component);
|
|
246
|
+
|
|
247
|
+
return injectIntl(WithSortableColumn);
|
|
238
248
|
};
|
|
239
249
|
export var TableHeader = compose(withSortableColumn, withCellProps)('th');
|
|
240
250
|
export var TableCell = withCellProps('td');
|
|
@@ -11,7 +11,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
11
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
12
|
|
|
13
13
|
import React from 'react';
|
|
14
|
-
import {
|
|
14
|
+
import { compose } from '@atlaskit/editor-common/utils';
|
|
15
|
+
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
15
16
|
import { RendererCssClassName } from '../../consts';
|
|
16
17
|
|
|
17
18
|
var TableRow = /*#__PURE__*/function (_React$Component) {
|
|
@@ -9,6 +9,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
9
9
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
10
10
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
11
11
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
12
|
+
var _excluded = ["contextIdentifierProvider", "objectAri", "isRenderer"];
|
|
12
13
|
|
|
13
14
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
15
|
|
|
@@ -115,11 +116,13 @@ var TaskItemWithProviders = /*#__PURE__*/function (_Component) {
|
|
|
115
116
|
var _this$props = this.props,
|
|
116
117
|
contextIdentifierProvider = _this$props.contextIdentifierProvider,
|
|
117
118
|
objectAri = _this$props.objectAri,
|
|
118
|
-
|
|
119
|
+
isRenderer = _this$props.isRenderer,
|
|
120
|
+
otherProps = _objectWithoutProperties(_this$props, _excluded);
|
|
119
121
|
|
|
120
122
|
var resolvedObjectId = this.state.resolvedContextProvider && this.state.resolvedContextProvider.objectId || objectAri;
|
|
121
123
|
return /*#__PURE__*/React.createElement(ResourcedTaskItem, _extends({}, otherProps, {
|
|
122
|
-
objectAri: resolvedObjectId
|
|
124
|
+
objectAri: resolvedObjectId,
|
|
125
|
+
isRenderer: isRenderer
|
|
123
126
|
}));
|
|
124
127
|
}
|
|
125
128
|
}]);
|
|
@@ -12,7 +12,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
12
12
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { PureComponent } from 'react';
|
|
15
|
-
import { ProviderFactory, WithProviders } from '@atlaskit/editor-common';
|
|
15
|
+
import { ProviderFactory, WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
16
16
|
import TaskItemWithProviders from './task-item-with-providers';
|
|
17
17
|
import { FabricElementsAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
18
18
|
|
|
@@ -52,6 +52,7 @@ var TaskItem = /*#__PURE__*/function (_PureComponent) {
|
|
|
52
52
|
objectAri: objectAri,
|
|
53
53
|
taskId: localId,
|
|
54
54
|
isDone: state === 'DONE',
|
|
55
|
+
isRenderer: true,
|
|
55
56
|
disabled: disabled,
|
|
56
57
|
taskDecisionProvider: taskDecisionProvider,
|
|
57
58
|
contextIdentifierProvider: contextIdentifierProvider,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { defaultSchema } from '@atlaskit/adf-schema';
|
|
2
2
|
import { getValidDocument } from '@atlaskit/editor-common/validator';
|
|
3
|
-
import { validateADFEntity, findAndTrackUnsupportedContentNodes } from '@atlaskit/editor-common';
|
|
3
|
+
import { validateADFEntity, findAndTrackUnsupportedContentNodes } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from './analytics/enums';
|
|
5
5
|
import { PLATFORM } from './analytics/events';
|
|
6
6
|
import { trackUnsupportedContentLevels } from './analytics/unsupported-content';
|
|
7
|
+
import { transformMediaLinkMarks } from '@atlaskit/adf-utils';
|
|
7
8
|
var SUPPORTS_HIRES_TIMER_API = !!(window.performance && performance.now);
|
|
8
9
|
|
|
9
10
|
var withStopwatch = function withStopwatch(cb) {
|
|
@@ -31,7 +32,21 @@ export var renderDocument = function renderDocument(doc, serializer) {
|
|
|
31
32
|
|
|
32
33
|
var _withStopwatch = withStopwatch(function () {
|
|
33
34
|
if (useSpecBasedValidator) {
|
|
34
|
-
|
|
35
|
+
// link mark on mediaSingle is deprecated, need to move link mark to child media node
|
|
36
|
+
// https://product-fabric.atlassian.net/browse/ED-14043
|
|
37
|
+
var _transformMediaLinkMa = transformMediaLinkMarks(doc),
|
|
38
|
+
transformedAdf = _transformMediaLinkMa.transformedAdf,
|
|
39
|
+
isTransformed = _transformMediaLinkMa.isTransformed;
|
|
40
|
+
|
|
41
|
+
if (isTransformed && dispatchAnalyticsEvent) {
|
|
42
|
+
dispatchAnalyticsEvent({
|
|
43
|
+
action: ACTION.MEDIA_LINK_TRANSFORMED,
|
|
44
|
+
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
45
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return validateADFEntity(schema, transformedAdf || doc, dispatchAnalyticsEvent);
|
|
35
50
|
}
|
|
36
51
|
|
|
37
52
|
return getValidDocument(doc, schema, adfStage);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/ui/Expand.js
CHANGED
|
@@ -9,7 +9,7 @@ import styled from 'styled-components';
|
|
|
9
9
|
import { gridSize, fontSize } from '@atlaskit/theme/constants';
|
|
10
10
|
import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
|
|
11
11
|
import Tooltip from '@atlaskit/tooltip';
|
|
12
|
-
import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper, ExpandLayoutWrapper, ClearNextSiblingMarginTop } from '@atlaskit/editor-common';
|
|
12
|
+
import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper, ExpandLayoutWrapper, ClearNextSiblingMarginTop } from '@atlaskit/editor-common/ui';
|
|
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';
|
|
@@ -12,7 +12,9 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
12
12
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import memoizeOne from 'memoize-one';
|
|
15
|
-
import {
|
|
15
|
+
import { getNodeRenderer } from '@atlaskit/editor-common/extensions';
|
|
16
|
+
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
17
|
+
import { getExtensionRenderer } from '@atlaskit/editor-common/utils';
|
|
16
18
|
|
|
17
19
|
var ExtensionRenderer = /*#__PURE__*/function (_React$Component) {
|
|
18
20
|
_inherits(ExtensionRenderer, _React$Component);
|
package/dist/esm/ui/MediaCard.js
CHANGED
|
@@ -11,9 +11,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
11
11
|
|
|
12
12
|
var _templateObject;
|
|
13
13
|
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
15
|
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17
17
|
|
|
18
18
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
19
19
|
|
|
@@ -24,7 +24,7 @@ import { Component } from 'react';
|
|
|
24
24
|
import { filter } from '@atlaskit/adf-utils';
|
|
25
25
|
import { Card, CardLoading, CardError } from '@atlaskit/media-card';
|
|
26
26
|
import { getMediaClient } from '@atlaskit/media-client';
|
|
27
|
-
import { withImageLoader } from '@atlaskit/editor-common';
|
|
27
|
+
import { withImageLoader } from '@atlaskit/editor-common/utils';
|
|
28
28
|
import styled from 'styled-components';
|
|
29
29
|
var mediaIdentifierMap = new Map();
|
|
30
30
|
export var getListOfIdentifiersFromDoc = function getListOfIdentifiersFromDoc(doc) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { breakoutConsts } from '@atlaskit/editor-common';
|
|
2
|
+
import { breakoutConsts } from '@atlaskit/editor-common/utils';
|
|
3
3
|
/**
|
|
4
4
|
* Inline Script that updates breakout node width on client side,
|
|
5
5
|
* before main JavaScript bundle is ready.
|
|
@@ -33,13 +33,16 @@ export function createBreakoutInlineScript(id, allowDynamicTextSizing) {
|
|
|
33
33
|
export var breakoutInlineScriptContext = "\n var breakoutConsts = ".concat(JSON.stringify(breakoutConsts), ";\n breakoutConsts.mapBreakpointToLayoutMaxWidth = ").concat(breakoutConsts.mapBreakpointToLayoutMaxWidth.toString(), ";\n breakoutConsts.getBreakpoint = ").concat(breakoutConsts.getBreakpoint.toString(), ";\n breakoutConsts.calcBreakoutWidth = ").concat(breakoutConsts.calcBreakoutWidth.toString(), ";\n breakoutConsts.calcLineLength = ").concat(breakoutConsts.calcLineLength.toString(), ";\n breakoutConsts.calcWideWidth = ").concat(breakoutConsts.calcWideWidth.toString(), ";\n");
|
|
34
34
|
|
|
35
35
|
function applyBreakoutAfterSSR(id, allowDynamicTextSizing, breakoutConsts) {
|
|
36
|
-
|
|
36
|
+
var MEDIA_NODE_TYPE = 'mediaSingle';
|
|
37
|
+
var WIDE_LAYOUT_MODES = ['full-width', 'wide'];
|
|
38
|
+
|
|
39
|
+
function findUp(element, condition) {
|
|
37
40
|
if (!element) {
|
|
38
41
|
return;
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
while (element.parentElement) {
|
|
42
|
-
if (element
|
|
45
|
+
if (condition(element)) {
|
|
43
46
|
return element.parentElement;
|
|
44
47
|
}
|
|
45
48
|
|
|
@@ -47,7 +50,11 @@ function applyBreakoutAfterSSR(id, allowDynamicTextSizing, breakoutConsts) {
|
|
|
47
50
|
}
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
var renderer = findUp(document.querySelector('[data-breakout-script-id="' + id + '"]'),
|
|
53
|
+
var renderer = findUp(document.querySelector('[data-breakout-script-id="' + id + '"]'), function (elem) {
|
|
54
|
+
var _elem$parentElement;
|
|
55
|
+
|
|
56
|
+
return !!((_elem$parentElement = elem.parentElement) !== null && _elem$parentElement !== void 0 && _elem$parentElement.classList.contains('ak-renderer-wrapper'));
|
|
57
|
+
});
|
|
51
58
|
|
|
52
59
|
if (!renderer) {
|
|
53
60
|
return;
|
|
@@ -64,7 +71,7 @@ function applyBreakoutAfterSSR(id, allowDynamicTextSizing, breakoutConsts) {
|
|
|
64
71
|
var node = maybeNode;
|
|
65
72
|
var mode = node.dataset.mode || node.dataset.layout || '';
|
|
66
73
|
|
|
67
|
-
if (!mode || !
|
|
74
|
+
if (!mode || !WIDE_LAYOUT_MODES.includes(mode)) {
|
|
68
75
|
return;
|
|
69
76
|
}
|
|
70
77
|
|
|
@@ -87,9 +94,45 @@ function applyBreakoutAfterSSR(id, allowDynamicTextSizing, breakoutConsts) {
|
|
|
87
94
|
}
|
|
88
95
|
}
|
|
89
96
|
});
|
|
97
|
+
} else if (
|
|
98
|
+
/**
|
|
99
|
+
* The mutation observer is only called once per added node.
|
|
100
|
+
* The above condition only deals with direct children of <div class="ak-renderer-document" />
|
|
101
|
+
* When it is initially called on the direct children, not all the sub children have loaded.
|
|
102
|
+
* So nested media elements which are not immediately loaded as sub children are not availabe in the above conditional.
|
|
103
|
+
* Thus adding this conditional to deal with all meida elements directly.
|
|
104
|
+
*/
|
|
105
|
+
item.target.dataset.nodeType === MEDIA_NODE_TYPE) {
|
|
106
|
+
applyMediaBreakout(item.target);
|
|
90
107
|
}
|
|
91
108
|
});
|
|
92
109
|
});
|
|
110
|
+
|
|
111
|
+
var applyMediaBreakout = function applyMediaBreakout(card) {
|
|
112
|
+
// width was already set by another breakout script
|
|
113
|
+
if (card.style.width) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
var tableParent = findUp(card, function (elem) {
|
|
118
|
+
return elem instanceof HTMLTableCellElement;
|
|
119
|
+
}); // only apply the breakout to media elements not nested inside table
|
|
120
|
+
// table sizing is not based on percentage width
|
|
121
|
+
|
|
122
|
+
if (tableParent) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
var mode = card.dataset.mode || card.dataset.layout || '';
|
|
127
|
+
var width = card.dataset.width;
|
|
128
|
+
|
|
129
|
+
if (WIDE_LAYOUT_MODES.includes(mode)) {
|
|
130
|
+
card.style.width = '100%';
|
|
131
|
+
} else if (width) {
|
|
132
|
+
card.style.width = "".concat(width, "%");
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
93
136
|
observer.observe(renderer, {
|
|
94
137
|
childList: true,
|
|
95
138
|
subtree: true
|
|
@@ -7,9 +7,9 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
|
|
10
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
10
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
11
11
|
|
|
12
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
13
|
|
|
14
14
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
15
|
|
|
@@ -19,7 +19,9 @@ import React, { useContext, useLayoutEffect, useRef } from 'react';
|
|
|
19
19
|
import { PureComponent } from 'react';
|
|
20
20
|
import { getSchemaBasedOnStage } from '@atlaskit/adf-schema';
|
|
21
21
|
import { reduce } from '@atlaskit/adf-utils';
|
|
22
|
-
import {
|
|
22
|
+
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
23
|
+
import { UnsupportedBlock, BaseTheme, WidthProvider, WithCreateAnalyticsEvent, LegacyToNextIntlProvider, IntlLegacyFallbackProvider, IntlNextErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
24
|
+
import { getAnalyticsAppearance, getAnalyticsEventSeverity, getResponseEndTime, startMeasure, stopMeasure, shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
23
25
|
import { normalizeFeatureFlags } from '@atlaskit/editor-common/normalize-feature-flags';
|
|
24
26
|
import { akEditorFullPageDefaultFontSize } from '@atlaskit/editor-shared-styles';
|
|
25
27
|
import { IframeWidthObserverFallbackWrapper, IframeWrapperConsumer } from '@atlaskit/width-detector';
|
|
@@ -206,6 +208,7 @@ export var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
206
208
|
allowMediaLinking: props.media && props.media.allowLinking,
|
|
207
209
|
surroundTextNodesWithTextWrapper: allowAnnotationsDraftMode,
|
|
208
210
|
media: props.media,
|
|
211
|
+
smartLinks: props.smartLinks,
|
|
209
212
|
allowCopyToClipboard: props.allowCopyToClipboard,
|
|
210
213
|
allowCustomPanels: props.allowCustomPanels,
|
|
211
214
|
allowAnnotations: props.allowAnnotations,
|
|
@@ -4,10 +4,12 @@ var _templateObject, _templateObject2;
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
|
-
import { SortOrder } from '@atlaskit/editor-common';
|
|
8
7
|
import Tooltip from '@atlaskit/tooltip';
|
|
9
8
|
import { gridSize } from '@atlaskit/theme/constants';
|
|
10
|
-
import { N20, N30 } from '@atlaskit/theme/colors';
|
|
9
|
+
import { N20, N30 } from '@atlaskit/theme/colors';
|
|
10
|
+
import { SortOrder } from '@atlaskit/editor-common/types';
|
|
11
|
+
import { sortingIconMessages } from '../messages';
|
|
12
|
+
import { injectIntl } from 'react-intl-next'; // We use data url here because of this issue:
|
|
11
13
|
// https://product-fabric.atlassian.net/browse/ED-8001
|
|
12
14
|
// Remove this workaround if Firefox has fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=1664350
|
|
13
15
|
|
|
@@ -38,29 +40,37 @@ var getClassName = function getClassName(status) {
|
|
|
38
40
|
}
|
|
39
41
|
};
|
|
40
42
|
|
|
41
|
-
var getTooltipTitle = function getTooltipTitle(status) {
|
|
43
|
+
var getTooltipTitle = function getTooltipTitle(intl, isSortingAllowed, status) {
|
|
44
|
+
var noOrderLabel = sortingIconMessages.noOrderLabel,
|
|
45
|
+
ascOrderLabel = sortingIconMessages.ascOrderLabel,
|
|
46
|
+
descOrderLabel = sortingIconMessages.descOrderLabel,
|
|
47
|
+
invalidLabel = sortingIconMessages.invalidLabel;
|
|
48
|
+
|
|
49
|
+
if (!isSortingAllowed) {
|
|
50
|
+
return intl.formatMessage(invalidLabel);
|
|
51
|
+
}
|
|
52
|
+
|
|
42
53
|
switch (status) {
|
|
43
54
|
case SortOrder.NO_ORDER:
|
|
44
|
-
return
|
|
55
|
+
return intl.formatMessage(noOrderLabel);
|
|
45
56
|
|
|
46
57
|
case SortOrder.ASC:
|
|
47
|
-
return
|
|
58
|
+
return intl.formatMessage(ascOrderLabel);
|
|
48
59
|
|
|
49
60
|
case SortOrder.DESC:
|
|
50
|
-
return
|
|
61
|
+
return intl.formatMessage(descOrderLabel);
|
|
51
62
|
}
|
|
52
63
|
|
|
53
64
|
return '';
|
|
54
65
|
};
|
|
55
66
|
|
|
56
|
-
var notAllowedTooltip = "\u26A0\uFE0F You can't sort a table with merged cell";
|
|
57
|
-
|
|
58
67
|
var SortingIcon = function SortingIcon(_ref) {
|
|
59
68
|
var isSortingAllowed = _ref.isSortingAllowed,
|
|
60
|
-
sortOrdered = _ref.sortOrdered
|
|
69
|
+
sortOrdered = _ref.sortOrdered,
|
|
70
|
+
intl = _ref.intl;
|
|
61
71
|
var activated = sortOrdered !== SortOrder.NO_ORDER;
|
|
62
72
|
var wrapperClassName = !isSortingAllowed ? StatusClassNames.SORTING_NOT_ALLOWED : '';
|
|
63
|
-
var content = isSortingAllowed
|
|
73
|
+
var content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
|
|
64
74
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
65
75
|
delay: 0,
|
|
66
76
|
content: content,
|
|
@@ -72,4 +82,4 @@ var SortingIcon = function SortingIcon(_ref) {
|
|
|
72
82
|
})));
|
|
73
83
|
};
|
|
74
84
|
|
|
75
|
-
export default SortingIcon;
|
|
85
|
+
export default injectIntl(SortingIcon);
|
|
@@ -10,7 +10,7 @@ import { splitText, calcTextSplitOffset } from './text';
|
|
|
10
10
|
import { calcInsertDraftPositionOnText } from './position';
|
|
11
11
|
import { dataAttributes } from './dom';
|
|
12
12
|
import styled from 'styled-components';
|
|
13
|
-
import { AnnotationSharedCSSByState } from '@atlaskit/editor-common';
|
|
13
|
+
import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
|
|
14
14
|
var DraftAnnotation = styled.mark(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n\n ", ";\n"])), AnnotationSharedCSSByState.focus);
|
|
15
15
|
export var AnnotationDraft = function AnnotationDraft(_ref) {
|
|
16
16
|
var draftPosition = _ref.draftPosition,
|
|
@@ -3,7 +3,7 @@ import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
|
3
3
|
import { MarkComponent } from './mark';
|
|
4
4
|
import { useInlineCommentSubscriberContext, useHasFocusEvent, useInlineCommentsFilter } from '../hooks';
|
|
5
5
|
import { InlineCommentsStateContext } from '../context';
|
|
6
|
-
import { AnnotationUpdateEvent } from '@atlaskit/editor-common';
|
|
6
|
+
import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
|
|
7
7
|
|
|
8
8
|
var MarkElement = function MarkElement(_ref) {
|
|
9
9
|
var annotationParentIds = _ref.annotationParentIds,
|
|
@@ -5,12 +5,12 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
5
5
|
|
|
6
6
|
var _templateObject;
|
|
7
7
|
|
|
8
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
8
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
9
|
|
|
10
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
10
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
11
|
|
|
12
12
|
import React, { useMemo, useCallback } from 'react';
|
|
13
|
-
import { AnnotationSharedCSSByState } from '@atlaskit/editor-common';
|
|
13
|
+
import { AnnotationSharedCSSByState } from '@atlaskit/editor-common/styles';
|
|
14
14
|
import { AnnotationMarkStates } from '@atlaskit/adf-schema';
|
|
15
15
|
import styled from 'styled-components';
|
|
16
16
|
var MarkStyled = styled.mark(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n\n &[data-mark-annotation-state='", "'] {\n ", ";\n\n &:focus,\n &[data-has-focus='true'] {\n ", ";\n }\n }\n"])), AnnotationMarkStates.ACTIVE, AnnotationSharedCSSByState.blur, AnnotationSharedCSSByState.focus);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
4
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
5
|
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
7
|
|
|
8
8
|
import { useLayoutEffect, useState } from 'react';
|
|
9
|
-
import { AnnotationUpdateEvent } from '@atlaskit/editor-common';
|
|
9
|
+
import { AnnotationUpdateEvent } from '@atlaskit/editor-common/types';
|
|
10
10
|
import { AnnotationTypes } from '@atlaskit/adf-schema';
|
|
11
11
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '../../../analytics/enums';
|
|
12
12
|
import { FabricChannel } from '@atlaskit/analytics-listeners';
|