@atlaskit/renderer 84.0.0 → 86.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 +100 -0
- package/dist/cjs/actions/index.js +3 -3
- package/dist/cjs/analytics/enums.js +2 -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/marks/textColor.js +15 -4
- 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 +40 -4
- 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/Renderer/style.js +8 -6
- 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 +2 -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/marks/textColor.js +7 -4
- 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 +37 -3
- 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/Renderer/style.js +3 -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 +2 -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/marks/textColor.js +8 -4
- 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 +36 -3
- 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/Renderer/style.js +4 -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 +3 -1
- package/dist/types/analytics/events.d.ts +9 -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 +21 -22
|
@@ -1,23 +1,12 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
9
|
-
|
|
10
|
-
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); }; }
|
|
11
|
-
|
|
12
|
-
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; } }
|
|
13
|
-
|
|
14
|
-
import { mapBreakpointToLayoutMaxWidth, WidthConsumer } from '@atlaskit/editor-common';
|
|
15
|
-
import { akEditorFullWidthLayoutWidth, getAkEditorFullPageMaxWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
16
|
-
import { Component, default as React } from 'react';
|
|
2
|
+
import { default as React } from 'react';
|
|
17
3
|
import { injectIntl } from 'react-intl-next';
|
|
4
|
+
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
5
|
+
import { mapBreakpointToLayoutMaxWidth, getBreakpoint, WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
6
|
+
import { akEditorFullWidthLayoutWidth, getAkEditorFullPageMaxWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
18
7
|
import { FullPagePadding } from '../../../ui/Renderer/style';
|
|
8
|
+
import { useObservedWidth } from '../../hooks/use-observed-width';
|
|
19
9
|
import { ExtendedUIMediaSingle } from './styles';
|
|
20
|
-
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
21
10
|
var DEFAULT_WIDTH = 250;
|
|
22
11
|
var DEFAULT_HEIGHT = 200;
|
|
23
12
|
|
|
@@ -53,146 +42,156 @@ export var getMediaContainerWidth = function getMediaContainerWidth(currentConta
|
|
|
53
42
|
return !currentContainerWidth && layout !== 'full-width' && layout !== 'wide' ? akEditorDefaultLayoutWidth : currentContainerWidth;
|
|
54
43
|
};
|
|
55
44
|
|
|
56
|
-
var MediaSingle =
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
45
|
+
var MediaSingle = function MediaSingle(props) {
|
|
46
|
+
var _ref$current;
|
|
47
|
+
|
|
48
|
+
var rendererAppearance = props.rendererAppearance,
|
|
49
|
+
featureFlags = props.featureFlags,
|
|
50
|
+
isInsideOfBlockNode = props.isInsideOfBlockNode,
|
|
51
|
+
allowDynamicTextSizing = props.allowDynamicTextSizing,
|
|
52
|
+
layout = props.layout,
|
|
53
|
+
children = props.children,
|
|
54
|
+
pctWidth = props.width;
|
|
55
|
+
var isCaptionsFlaggedOn = getMediaFeatureFlag('captions', featureFlags);
|
|
56
|
+
|
|
57
|
+
var _React$useState = React.useState({
|
|
58
|
+
width: 0,
|
|
59
|
+
height: 0
|
|
60
|
+
}),
|
|
61
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
62
|
+
externalImageDimensions = _React$useState2[0],
|
|
63
|
+
setExternalImageDimensions = _React$useState2[1];
|
|
64
|
+
|
|
65
|
+
var ref = React.useRef(null);
|
|
66
|
+
var onExternalImageLoaded = React.useCallback(function (_ref2) {
|
|
67
|
+
var width = _ref2.width,
|
|
68
|
+
height = _ref2.height;
|
|
69
|
+
setExternalImageDimensions({
|
|
70
|
+
width: width,
|
|
71
|
+
height: height
|
|
72
|
+
});
|
|
73
|
+
}, []);
|
|
74
|
+
var observedWidthFlag = getMediaFeatureFlag('observedWidth', featureFlags);
|
|
65
75
|
|
|
66
|
-
|
|
76
|
+
var _useObservedWidth = useObservedWidth((_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.parentElement, observedWidthFlag),
|
|
77
|
+
observedWidth = _useObservedWidth.width;
|
|
67
78
|
|
|
68
|
-
|
|
69
|
-
var width = _ref2.width,
|
|
70
|
-
height = _ref2.height;
|
|
79
|
+
var media;
|
|
71
80
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
});
|
|
81
|
+
var _React$Children$toArr3 = React.Children.toArray(children),
|
|
82
|
+
_React$Children$toArr4 = _slicedToArray(_React$Children$toArr3, 2),
|
|
83
|
+
node = _React$Children$toArr4[0],
|
|
84
|
+
caption = _React$Children$toArr4[1];
|
|
77
85
|
|
|
78
|
-
|
|
86
|
+
if (!isMediaElement(node)) {
|
|
87
|
+
var mediaElement = checkForMediaElement(node.props.children);
|
|
79
88
|
|
|
80
|
-
|
|
89
|
+
if (!mediaElement) {
|
|
90
|
+
return node;
|
|
91
|
+
}
|
|
81
92
|
|
|
82
|
-
|
|
93
|
+
media = mediaElement;
|
|
94
|
+
} else {
|
|
95
|
+
media = node;
|
|
83
96
|
}
|
|
84
97
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
var media;
|
|
98
|
+
var _media$props = media.props,
|
|
99
|
+
_media$props$width = _media$props.width,
|
|
100
|
+
width = _media$props$width === void 0 ? DEFAULT_WIDTH : _media$props$width,
|
|
101
|
+
_media$props$height = _media$props.height,
|
|
102
|
+
height = _media$props$height === void 0 ? DEFAULT_HEIGHT : _media$props$height,
|
|
103
|
+
type = _media$props.type;
|
|
92
104
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
caption = _React$Children$toArr4[1];
|
|
105
|
+
if (type === 'external') {
|
|
106
|
+
var stateWidth = externalImageDimensions.width,
|
|
107
|
+
stateHeight = externalImageDimensions.height;
|
|
97
108
|
|
|
98
|
-
|
|
99
|
-
|
|
109
|
+
if (width === null) {
|
|
110
|
+
width = stateWidth || DEFAULT_WIDTH;
|
|
111
|
+
}
|
|
100
112
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
113
|
+
if (height === null) {
|
|
114
|
+
height = stateHeight || DEFAULT_HEIGHT;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
104
117
|
|
|
105
|
-
|
|
118
|
+
if (width === null) {
|
|
119
|
+
width = DEFAULT_WIDTH;
|
|
120
|
+
height = DEFAULT_HEIGHT;
|
|
121
|
+
} // TODO: put appearance-based padding into theme instead
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
var padding = rendererAppearance === 'full-page' ? FullPagePadding * 2 : 0;
|
|
125
|
+
var isFullWidth = rendererAppearance === 'full-width';
|
|
126
|
+
|
|
127
|
+
var calcDimensions = function calcDimensions(mediaContainerWidth, mediaBreakpoint) {
|
|
128
|
+
var containerWidth = getMediaContainerWidth(mediaContainerWidth, layout);
|
|
129
|
+
var breakpoint = mediaBreakpoint || getBreakpoint(containerWidth);
|
|
130
|
+
var maxWidth = containerWidth;
|
|
131
|
+
var maxHeight = height / width * maxWidth;
|
|
132
|
+
var cardDimensions = {
|
|
133
|
+
width: "".concat(maxWidth, "px"),
|
|
134
|
+
height: "".concat(maxHeight, "px")
|
|
135
|
+
};
|
|
136
|
+
var nonFullWidthSize = containerWidth;
|
|
137
|
+
|
|
138
|
+
if (!isInsideOfBlockNode && rendererAppearance !== 'comment') {
|
|
139
|
+
var isContainerSizeGreaterThanMaxFullPageWidth = containerWidth - padding >= getAkEditorFullPageMaxWidth(allowDynamicTextSizing);
|
|
140
|
+
|
|
141
|
+
if (isContainerSizeGreaterThanMaxFullPageWidth && allowDynamicTextSizing) {
|
|
142
|
+
nonFullWidthSize = mapBreakpointToLayoutMaxWidth(breakpoint);
|
|
143
|
+
} else if (isContainerSizeGreaterThanMaxFullPageWidth) {
|
|
144
|
+
nonFullWidthSize = getAkEditorFullPageMaxWidth(allowDynamicTextSizing);
|
|
106
145
|
} else {
|
|
107
|
-
|
|
146
|
+
nonFullWidthSize = containerWidth - padding;
|
|
108
147
|
}
|
|
109
|
-
|
|
110
|
-
var _media$props = media.props,
|
|
111
|
-
_media$props$width = _media$props.width,
|
|
112
|
-
width = _media$props$width === void 0 ? DEFAULT_WIDTH : _media$props$width,
|
|
113
|
-
_media$props$height = _media$props.height,
|
|
114
|
-
height = _media$props$height === void 0 ? DEFAULT_HEIGHT : _media$props$height,
|
|
115
|
-
type = _media$props.type;
|
|
116
|
-
|
|
117
|
-
if (type === 'external') {
|
|
118
|
-
var _this$state = this.state,
|
|
119
|
-
stateWidth = _this$state.width,
|
|
120
|
-
stateHeight = _this$state.height;
|
|
121
|
-
|
|
122
|
-
if (width === null) {
|
|
123
|
-
width = stateWidth || DEFAULT_WIDTH;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
if (height === null) {
|
|
127
|
-
height = stateHeight || DEFAULT_HEIGHT;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (width === null) {
|
|
132
|
-
width = DEFAULT_WIDTH;
|
|
133
|
-
height = DEFAULT_HEIGHT;
|
|
134
|
-
} // TODO: put appearance-based padding into theme instead
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
var _this$props = this.props,
|
|
138
|
-
rendererAppearance = _this$props.rendererAppearance,
|
|
139
|
-
featureFlags = _this$props.featureFlags;
|
|
140
|
-
var padding = rendererAppearance === 'full-page' ? FullPagePadding * 2 : 0;
|
|
141
|
-
return /*#__PURE__*/React.createElement(WidthConsumer, null, function (_ref3) {
|
|
142
|
-
var widthConsumerValue = _ref3.width,
|
|
143
|
-
breakpoint = _ref3.breakpoint;
|
|
144
|
-
var containerWidth = getMediaContainerWidth(widthConsumerValue, props.layout);
|
|
145
|
-
var _this2$props = _this2.props,
|
|
146
|
-
isInsideOfBlockNode = _this2$props.isInsideOfBlockNode,
|
|
147
|
-
allowDynamicTextSizing = _this2$props.allowDynamicTextSizing;
|
|
148
|
-
var maxWidth = containerWidth;
|
|
149
|
-
var maxHeight = height / width * maxWidth;
|
|
150
|
-
var cardDimensions = {
|
|
151
|
-
width: "".concat(maxWidth, "px"),
|
|
152
|
-
height: "".concat(maxHeight, "px")
|
|
153
|
-
};
|
|
154
|
-
var isFullWidth = rendererAppearance === 'full-width';
|
|
155
|
-
var nonFullWidthSize = containerWidth;
|
|
156
|
-
|
|
157
|
-
if (!isInsideOfBlockNode && rendererAppearance !== 'comment') {
|
|
158
|
-
var isContainerSizeGreaterThanMaxFullPageWidth = containerWidth - padding >= getAkEditorFullPageMaxWidth(allowDynamicTextSizing);
|
|
159
|
-
|
|
160
|
-
if (isContainerSizeGreaterThanMaxFullPageWidth && allowDynamicTextSizing) {
|
|
161
|
-
nonFullWidthSize = mapBreakpointToLayoutMaxWidth(breakpoint);
|
|
162
|
-
} else if (isContainerSizeGreaterThanMaxFullPageWidth) {
|
|
163
|
-
nonFullWidthSize = getAkEditorFullPageMaxWidth(allowDynamicTextSizing);
|
|
164
|
-
} else {
|
|
165
|
-
nonFullWidthSize = containerWidth - padding;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
var lineLength = isFullWidth ? Math.min(akEditorFullWidthLayoutWidth, containerWidth - padding) : nonFullWidthSize;
|
|
170
|
-
var originalDimensions = {
|
|
171
|
-
height: height,
|
|
172
|
-
width: width
|
|
173
|
-
};
|
|
174
|
-
var mediaComponent = /*#__PURE__*/React.cloneElement(media, {
|
|
175
|
-
resizeMode: 'stretchy-fit',
|
|
176
|
-
cardDimensions: cardDimensions,
|
|
177
|
-
originalDimensions: originalDimensions,
|
|
178
|
-
onExternalImageLoaded: _this2.onExternalImageLoaded,
|
|
179
|
-
disableOverlay: true,
|
|
180
|
-
featureFlags: featureFlags
|
|
181
|
-
});
|
|
182
|
-
return /*#__PURE__*/React.createElement(ExtendedUIMediaSingle, {
|
|
183
|
-
layout: props.layout,
|
|
184
|
-
width: width,
|
|
185
|
-
height: height,
|
|
186
|
-
lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
|
|
187
|
-
containerWidth: containerWidth,
|
|
188
|
-
pctWidth: props.width,
|
|
189
|
-
fullWidthMode: isFullWidth
|
|
190
|
-
}, /*#__PURE__*/React.createElement(React.Fragment, null, mediaComponent), _this2.isCaptionsFlaggedOn && caption);
|
|
191
|
-
});
|
|
192
148
|
}
|
|
193
|
-
}]);
|
|
194
149
|
|
|
195
|
-
|
|
196
|
-
|
|
150
|
+
var minWidth = Math.min(akEditorFullWidthLayoutWidth, containerWidth - padding);
|
|
151
|
+
var lineLength = isFullWidth ? minWidth : nonFullWidthSize;
|
|
152
|
+
return {
|
|
153
|
+
cardDimensions: cardDimensions,
|
|
154
|
+
lineLength: lineLength,
|
|
155
|
+
containerWidth: containerWidth
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
var originalDimensions = {
|
|
160
|
+
height: height,
|
|
161
|
+
width: width
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
var renderMediaSingle = function renderMediaSingle(renderWidth, mediaBreakpoint) {
|
|
165
|
+
var _calcDimensions = calcDimensions(renderWidth, mediaBreakpoint),
|
|
166
|
+
cardDimensions = _calcDimensions.cardDimensions,
|
|
167
|
+
lineLength = _calcDimensions.lineLength,
|
|
168
|
+
containerWidth = _calcDimensions.containerWidth;
|
|
169
|
+
|
|
170
|
+
var mediaComponent = /*#__PURE__*/React.cloneElement(media, {
|
|
171
|
+
resizeMode: 'stretchy-fit',
|
|
172
|
+
cardDimensions: cardDimensions,
|
|
173
|
+
originalDimensions: originalDimensions,
|
|
174
|
+
onExternalImageLoaded: onExternalImageLoaded,
|
|
175
|
+
disableOverlay: true,
|
|
176
|
+
featureFlags: featureFlags
|
|
177
|
+
});
|
|
178
|
+
return /*#__PURE__*/React.createElement(ExtendedUIMediaSingle, {
|
|
179
|
+
handleMediaSingleRef: ref,
|
|
180
|
+
layout: layout,
|
|
181
|
+
width: width,
|
|
182
|
+
height: height,
|
|
183
|
+
lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
|
|
184
|
+
containerWidth: containerWidth,
|
|
185
|
+
pctWidth: pctWidth,
|
|
186
|
+
fullWidthMode: isFullWidth
|
|
187
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, mediaComponent), isCaptionsFlaggedOn && caption);
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
return observedWidthFlag ? renderMediaSingle(observedWidth || document.body.offsetWidth) : /*#__PURE__*/React.createElement(WidthConsumer, null, function (_ref3) {
|
|
191
|
+
var width = _ref3.width,
|
|
192
|
+
breakpoint = _ref3.breakpoint;
|
|
193
|
+
return renderMediaSingle(width, breakpoint);
|
|
194
|
+
});
|
|
195
|
+
};
|
|
197
196
|
|
|
198
197
|
export default injectIntl(MediaSingle);
|
|
@@ -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,7 +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
|
+
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from './analytics/enums';
|
|
5
|
+
import { PLATFORM } from './analytics/events';
|
|
4
6
|
import { trackUnsupportedContentLevels } from './analytics/unsupported-content';
|
|
7
|
+
import { transformMediaLinkMarks } from '@atlaskit/adf-utils';
|
|
5
8
|
var SUPPORTS_HIRES_TIMER_API = !!(window.performance && performance.now);
|
|
6
9
|
|
|
7
10
|
var withStopwatch = function withStopwatch(cb) {
|
|
@@ -29,7 +32,21 @@ export var renderDocument = function renderDocument(doc, serializer) {
|
|
|
29
32
|
|
|
30
33
|
var _withStopwatch = withStopwatch(function () {
|
|
31
34
|
if (useSpecBasedValidator) {
|
|
32
|
-
|
|
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);
|
|
33
50
|
}
|
|
34
51
|
|
|
35
52
|
return getValidDocument(doc, schema, adfStage);
|
|
@@ -64,7 +81,23 @@ export var renderDocument = function renderDocument(doc, serializer) {
|
|
|
64
81
|
|
|
65
82
|
var _withStopwatch2 = withStopwatch(function () {
|
|
66
83
|
var pmNode = schema.nodeFromJSON(validDoc);
|
|
67
|
-
|
|
84
|
+
|
|
85
|
+
try {
|
|
86
|
+
pmNode.check();
|
|
87
|
+
} catch (err) {
|
|
88
|
+
if (dispatchAnalyticsEvent) {
|
|
89
|
+
dispatchAnalyticsEvent({
|
|
90
|
+
action: ACTION.INVALID_PROSEMIRROR_DOCUMENT,
|
|
91
|
+
actionSubject: ACTION_SUBJECT.RENDERER,
|
|
92
|
+
attributes: {
|
|
93
|
+
platform: PLATFORM.WEB,
|
|
94
|
+
error: err === null || err === void 0 ? void 0 : err.toString()
|
|
95
|
+
},
|
|
96
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
68
101
|
return pmNode;
|
|
69
102
|
}),
|
|
70
103
|
node = _withStopwatch2.output,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|