@atlaskit/renderer 91.0.0 → 93.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 +49 -0
- package/dist/cjs/analytics/enums.js +2 -0
- package/dist/cjs/react/marks/alignment.js +11 -12
- package/dist/cjs/react/marks/breakout.js +7 -9
- package/dist/cjs/react/marks/link.js +13 -6
- package/dist/cjs/react/nodes/codeBlock.js +17 -16
- package/dist/cjs/react/nodes/codeBlockCopyButton.js +13 -11
- package/dist/cjs/react/nodes/embedCard.js +25 -33
- package/dist/cjs/react/nodes/heading-anchor.js +7 -6
- package/dist/cjs/react/nodes/heading.js +4 -2
- package/dist/cjs/react/nodes/layoutColumn.js +7 -2
- package/dist/cjs/react/nodes/media.js +7 -6
- package/dist/cjs/react/nodes/mediaSingle/index.js +15 -4
- package/dist/cjs/react/nodes/mediaSingle/styles.js +7 -10
- package/dist/cjs/react/nodes/panel.js +26 -16
- package/dist/cjs/react/nodes/table/sticky.js +63 -55
- package/dist/cjs/react/nodes/table.js +2 -10
- package/dist/cjs/react/utils/inject-props.js +33 -0
- package/dist/cjs/react/utils/performance/RenderTracking.js +52 -0
- package/dist/cjs/ui/Expand.js +52 -28
- package/dist/cjs/ui/MediaCard.js +4 -14
- package/dist/cjs/ui/Renderer/index.js +72 -64
- package/dist/cjs/ui/Renderer/style.js +62 -55
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +19 -21
- package/dist/cjs/ui/SortingIcon.js +8 -9
- package/dist/cjs/ui/annotations/draft/component.js +22 -12
- package/dist/cjs/ui/annotations/element/mark.js +9 -5
- package/dist/cjs/ui/renderer-props.js +1 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/enums.js +2 -0
- package/dist/es2019/react/marks/alignment.js +15 -7
- package/dist/es2019/react/marks/breakout.js +6 -5
- package/dist/es2019/react/marks/link.js +8 -5
- package/dist/es2019/react/nodes/codeBlock.js +25 -23
- package/dist/es2019/react/nodes/codeBlockCopyButton.js +12 -9
- package/dist/es2019/react/nodes/embedCard.js +16 -16
- package/dist/es2019/react/nodes/heading-anchor.js +9 -6
- package/dist/es2019/react/nodes/heading.js +4 -2
- package/dist/es2019/react/nodes/layoutColumn.js +7 -3
- package/dist/es2019/react/nodes/media.js +9 -5
- package/dist/es2019/react/nodes/mediaSingle/index.js +10 -6
- package/dist/es2019/react/nodes/mediaSingle/styles.js +6 -7
- package/dist/es2019/react/nodes/panel.js +23 -16
- package/dist/es2019/react/nodes/table/sticky.js +55 -37
- package/dist/es2019/react/nodes/table.js +2 -5
- package/dist/es2019/react/utils/inject-props.js +24 -0
- package/dist/es2019/react/utils/performance/RenderTracking.js +37 -0
- package/dist/es2019/ui/Expand.js +65 -36
- package/dist/es2019/ui/MediaCard.js +3 -6
- package/dist/es2019/ui/Renderer/index.js +72 -57
- package/dist/es2019/ui/Renderer/style.js +370 -327
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +26 -15
- package/dist/es2019/ui/SortingIcon.js +9 -7
- package/dist/es2019/ui/annotations/draft/component.js +18 -12
- package/dist/es2019/ui/annotations/element/mark.js +12 -6
- package/dist/es2019/ui/renderer-props.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/enums.js +2 -0
- package/dist/esm/react/marks/alignment.js +13 -6
- package/dist/esm/react/marks/breakout.js +6 -5
- package/dist/esm/react/marks/link.js +7 -5
- package/dist/esm/react/nodes/codeBlock.js +18 -14
- package/dist/esm/react/nodes/codeBlockCopyButton.js +10 -7
- package/dist/esm/react/nodes/embedCard.js +19 -19
- package/dist/esm/react/nodes/heading-anchor.js +8 -6
- package/dist/esm/react/nodes/heading.js +4 -2
- package/dist/esm/react/nodes/layoutColumn.js +7 -3
- package/dist/esm/react/nodes/media.js +8 -5
- package/dist/esm/react/nodes/mediaSingle/index.js +11 -6
- package/dist/esm/react/nodes/mediaSingle/styles.js +5 -7
- package/dist/esm/react/nodes/panel.js +27 -15
- package/dist/esm/react/nodes/table/sticky.js +64 -53
- package/dist/esm/react/nodes/table.js +2 -8
- package/dist/esm/react/utils/inject-props.js +24 -0
- package/dist/esm/react/utils/performance/RenderTracking.js +39 -0
- package/dist/esm/ui/Expand.js +57 -29
- package/dist/esm/ui/MediaCard.js +3 -9
- package/dist/esm/ui/Renderer/index.js +74 -61
- package/dist/esm/ui/Renderer/style.js +58 -51
- package/dist/esm/ui/Renderer/truncated-wrapper.js +20 -14
- package/dist/esm/ui/SortingIcon.js +9 -7
- package/dist/esm/ui/annotations/draft/component.js +18 -11
- package/dist/esm/ui/annotations/element/mark.js +11 -4
- package/dist/esm/ui/renderer-props.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/enums.d.ts +2 -0
- package/dist/types/analytics/events.d.ts +12 -2
- package/dist/types/react/marks/alignment.d.ts +2 -2
- package/dist/types/react/marks/breakout.d.ts +4 -3
- package/dist/types/react/marks/link.d.ts +2 -2
- package/dist/types/react/nodes/codeBlock.d.ts +4 -14
- package/dist/types/react/nodes/embedCard.d.ts +3 -2
- package/dist/types/react/nodes/heading-anchor.d.ts +1 -0
- package/dist/types/react/nodes/heading.d.ts +1 -0
- package/dist/types/react/nodes/index.d.ts +1 -13
- package/dist/types/react/nodes/layoutColumn.d.ts +3 -1
- package/dist/types/react/nodes/media.d.ts +3 -1
- package/dist/types/react/nodes/mediaSingle/index.d.ts +1 -0
- package/dist/types/react/nodes/mediaSingle/styles.d.ts +2 -3
- package/dist/types/react/nodes/panel.d.ts +3 -1
- package/dist/types/react/nodes/table/sticky.d.ts +4 -2
- package/dist/types/react/utils/inject-props.d.ts +6 -0
- package/dist/types/react/utils/performance/RenderTracking.d.ts +15 -0
- package/dist/types/ui/Expand.d.ts +3 -2
- package/dist/types/ui/MediaCard.d.ts +1 -3
- package/dist/types/ui/Renderer/index.d.ts +3 -26
- package/dist/types/ui/Renderer/style.d.ts +2 -3
- package/dist/types/ui/Renderer/truncated-wrapper.d.ts +3 -1
- package/dist/types/ui/SortingIcon.d.ts +3 -3
- package/dist/types/ui/annotations/draft/component.d.ts +1 -0
- package/dist/types/ui/annotations/element/mark.d.ts +1 -0
- package/dist/types/ui/renderer-props.d.ts +14 -2
- package/package.json +22 -23
|
@@ -11,10 +11,12 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
11
11
|
|
|
12
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
13
|
|
|
14
|
+
/** @jsx jsx */
|
|
14
15
|
import React from 'react';
|
|
15
16
|
import { PureComponent } from 'react';
|
|
17
|
+
import { jsx } from '@emotion/react';
|
|
16
18
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
17
|
-
import {
|
|
19
|
+
import { mediaLinkStyle } from '@atlaskit/editor-common/ui';
|
|
18
20
|
import { MediaCard } from '../../ui/MediaCard';
|
|
19
21
|
import { getEventHandler } from '../../utils';
|
|
20
22
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '../../analytics/enums';
|
|
@@ -53,7 +55,7 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
53
55
|
var linkHref = linkMark === null || linkMark === void 0 ? void 0 : linkMark.attrs.href;
|
|
54
56
|
var eventHandlers = linkHref ? undefined : _this.props.eventHandlers;
|
|
55
57
|
var shouldOpenMediaViewer = !linkHref && allowMediaViewer;
|
|
56
|
-
var mediaComponent =
|
|
58
|
+
var mediaComponent = jsx(MediaCard, _extends({
|
|
57
59
|
mediaProvider: mediaProvider,
|
|
58
60
|
contextIdentifierProvider: contextIdentifierProvider
|
|
59
61
|
}, _this.props, {
|
|
@@ -64,11 +66,12 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
64
66
|
shouldEnableDownloadButton: enableDownloadButton,
|
|
65
67
|
ssr: ssr
|
|
66
68
|
}));
|
|
67
|
-
return linkHref ?
|
|
69
|
+
return linkHref ? jsx("a", {
|
|
68
70
|
href: linkHref,
|
|
69
71
|
rel: "noreferrer noopener",
|
|
70
72
|
onClick: _this.handleMediaLinkClick,
|
|
71
|
-
"data-block-link": linkHref
|
|
73
|
+
"data-block-link": linkHref,
|
|
74
|
+
css: mediaLinkStyle
|
|
72
75
|
}, mediaComponent) : mediaComponent;
|
|
73
76
|
});
|
|
74
77
|
|
|
@@ -115,7 +118,7 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
115
118
|
return this.renderCard();
|
|
116
119
|
}
|
|
117
120
|
|
|
118
|
-
return
|
|
121
|
+
return jsx(WithProviders, {
|
|
119
122
|
providers: ['mediaProvider', 'contextIdentifierProvider'],
|
|
120
123
|
providerFactory: providers,
|
|
121
124
|
renderNode: this.renderCard
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { default as React, Fragment } from 'react';
|
|
5
|
+
import { jsx } from '@emotion/react';
|
|
3
6
|
import { injectIntl } from 'react-intl-next';
|
|
4
7
|
import { getMediaFeatureFlag } from '@atlaskit/media-common';
|
|
5
|
-
import { mapBreakpointToLayoutMaxWidth, getBreakpoint, WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
8
|
+
import { mapBreakpointToLayoutMaxWidth, getBreakpoint, MediaSingle as UIMediaSingle, WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
6
9
|
import { akEditorFullWidthLayoutWidth, getAkEditorFullPageMaxWidth, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
7
10
|
import { FullPagePadding } from '../../../ui/Renderer/style';
|
|
8
11
|
import { useObservedWidth } from '../../hooks/use-observed-width';
|
|
9
|
-
import {
|
|
12
|
+
import { uiMediaSingleBaseStyles, uiMediaSingleLayoutStyles } from './styles';
|
|
10
13
|
var DEFAULT_WIDTH = 250;
|
|
11
14
|
var DEFAULT_HEIGHT = 200;
|
|
12
15
|
|
|
@@ -175,7 +178,9 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
175
178
|
disableOverlay: true,
|
|
176
179
|
featureFlags: featureFlags
|
|
177
180
|
});
|
|
178
|
-
|
|
181
|
+
var uiMediaSingleStyles = layout === 'full-width' || layout === 'wide' ? [uiMediaSingleBaseStyles, uiMediaSingleLayoutStyles] : [uiMediaSingleBaseStyles];
|
|
182
|
+
return jsx(UIMediaSingle, {
|
|
183
|
+
css: uiMediaSingleStyles,
|
|
179
184
|
handleMediaSingleRef: ref,
|
|
180
185
|
layout: layout,
|
|
181
186
|
width: width,
|
|
@@ -184,10 +189,10 @@ var MediaSingle = function MediaSingle(props) {
|
|
|
184
189
|
containerWidth: containerWidth,
|
|
185
190
|
pctWidth: pctWidth,
|
|
186
191
|
fullWidthMode: isFullWidth
|
|
187
|
-
},
|
|
192
|
+
}, jsx(Fragment, null, mediaComponent), isCaptionsFlaggedOn && caption);
|
|
188
193
|
};
|
|
189
194
|
|
|
190
|
-
return observedWidthFlag ? renderMediaSingle(observedWidth || document.body.offsetWidth) :
|
|
195
|
+
return observedWidthFlag ? renderMediaSingle(observedWidth || document.body.offsetWidth) : jsx(WidthConsumer, null, function (_ref3) {
|
|
191
196
|
var width = _ref3.width,
|
|
192
197
|
breakpoint = _ref3.breakpoint;
|
|
193
198
|
return renderMediaSingle(width, breakpoint);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject;
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
export var
|
|
8
|
-
|
|
9
|
-
return layout === 'full-width' || layout === 'wide' ? "\n margin-left: 50%;\n transform: translateX(-50%);\n " : "";
|
|
10
|
-
});
|
|
5
|
+
/** @jsx jsx */
|
|
6
|
+
import { css } from '@emotion/react';
|
|
7
|
+
export var uiMediaSingleBaseStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n transition: all 0.1s linear;\n"])));
|
|
8
|
+
export var uiMediaSingleLayoutStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-left: 50%;\n transform: translateX(-50%);\n"])));
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
3
|
|
|
3
|
-
var _templateObject;
|
|
4
|
+
var _templateObject, _templateObject2;
|
|
4
5
|
|
|
6
|
+
/** @jsx jsx */
|
|
5
7
|
import React from 'react';
|
|
6
|
-
import
|
|
8
|
+
import { css, jsx } from '@emotion/react';
|
|
7
9
|
import TipIcon from '@atlaskit/icon/glyph/editor/hint';
|
|
8
10
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
9
11
|
import { PanelSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
@@ -14,16 +16,26 @@ import EmojiItem from './emoji'; // AFP-2532 TODO: Fix automatic suppressions be
|
|
|
14
16
|
import { themed } from '@atlaskit/theme';
|
|
15
17
|
import { getPanelBackgroundDarkModeColors } from '@atlaskit/editor-common/styles';
|
|
16
18
|
import { PanelInfoIcon, PanelSuccessIcon, PanelNoteIcon, PanelWarningIcon, PanelErrorIcon } from '@atlaskit/editor-common/icons';
|
|
17
|
-
var PanelStyled = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n"])), function (props) {
|
|
18
|
-
if (props['data-panel-type'] !== PanelType.CUSTOM || !props.backgroundColor) {
|
|
19
|
-
return '';
|
|
20
|
-
} // Similar to mainDynamicStyles()
|
|
21
19
|
|
|
20
|
+
var PanelStyled = function PanelStyled(props) {
|
|
21
|
+
var styles = function styles(themeProps) {
|
|
22
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral([""])));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
if (props['data-panel-type'] === PanelType.CUSTOM && props.backgroundColor) {
|
|
26
|
+
styles = function styles(themeProps) {
|
|
27
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &[data-panel-type=", "] {\n background-color: ", ";\n ", ";\n }\n "])), PanelType.CUSTOM, props.backgroundColor, themed({
|
|
28
|
+
dark: getPanelBackgroundDarkModeColors
|
|
29
|
+
})(themeProps));
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return jsx("div", _extends({
|
|
34
|
+
css: styles
|
|
35
|
+
}, props), props.children);
|
|
36
|
+
};
|
|
22
37
|
|
|
23
|
-
|
|
24
|
-
dark: getPanelBackgroundDarkModeColors
|
|
25
|
-
}), ";\n }\n ");
|
|
26
|
-
});
|
|
38
|
+
PanelStyled.displayName = 'PanelStyled';
|
|
27
39
|
var panelIcons = {
|
|
28
40
|
info: PanelInfoIcon,
|
|
29
41
|
success: PanelSuccessIcon,
|
|
@@ -50,7 +62,7 @@ var Panel = function Panel(props) {
|
|
|
50
62
|
var getIcon = function getIcon() {
|
|
51
63
|
if (panelType === PanelType.CUSTOM) {
|
|
52
64
|
if (panelIcon && providers) {
|
|
53
|
-
return
|
|
65
|
+
return jsx(EmojiItem, {
|
|
54
66
|
id: panelIconId,
|
|
55
67
|
text: panelIconText,
|
|
56
68
|
shortName: panelIcon,
|
|
@@ -62,7 +74,7 @@ var Panel = function Panel(props) {
|
|
|
62
74
|
}
|
|
63
75
|
|
|
64
76
|
var Icon = panelIcons[panelType];
|
|
65
|
-
return
|
|
77
|
+
return jsx(Icon, {
|
|
66
78
|
label: "Panel ".concat(panelType)
|
|
67
79
|
});
|
|
68
80
|
};
|
|
@@ -71,13 +83,13 @@ var Panel = function Panel(props) {
|
|
|
71
83
|
var icon = getIcon();
|
|
72
84
|
|
|
73
85
|
if (icon) {
|
|
74
|
-
return
|
|
86
|
+
return jsx("div", {
|
|
75
87
|
className: PanelSharedCssClassName.icon
|
|
76
88
|
}, icon);
|
|
77
89
|
}
|
|
78
90
|
};
|
|
79
91
|
|
|
80
|
-
return
|
|
92
|
+
return jsx(PanelStyled, {
|
|
81
93
|
className: PanelSharedCssClassName.prefix,
|
|
82
94
|
"data-panel-type": panelType,
|
|
83
95
|
"data-panel-color": panelColor,
|
|
@@ -85,7 +97,7 @@ var Panel = function Panel(props) {
|
|
|
85
97
|
"data-panel-icon-id": panelIconId,
|
|
86
98
|
"data-panel-icon-text": panelIconText,
|
|
87
99
|
backgroundColor: panelColor
|
|
88
|
-
}, renderIcon(),
|
|
100
|
+
}, renderIcon(), jsx("div", {
|
|
89
101
|
className: PanelSharedCssClassName.content
|
|
90
102
|
}, children));
|
|
91
103
|
};
|
|
@@ -4,85 +4,96 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
4
4
|
|
|
5
5
|
var _templateObject, _templateObject2, _templateObject3;
|
|
6
6
|
|
|
7
|
+
/** @jsx jsx */
|
|
7
8
|
import React from 'react';
|
|
8
|
-
import
|
|
9
|
+
import { css, jsx } from '@emotion/react';
|
|
9
10
|
import { TableSharedCssClassName } from '@atlaskit/editor-common/styles';
|
|
10
11
|
import { akEditorStickyHeaderZIndex } from '@atlaskit/editor-shared-styles';
|
|
11
12
|
import * as colors from '@atlaskit/theme/colors';
|
|
12
13
|
var N40A = colors.N40A;
|
|
13
14
|
import { findHorizontalOverflowScrollParent } from '../../../utils';
|
|
14
15
|
import { Table } from './table';
|
|
16
|
+
import { recursivelyInjectProps } from '../../utils/inject-props';
|
|
15
17
|
export var tableStickyPadding = 8;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
})(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
28
|
-
export var FixedTableDiv = styled.div.attrs({
|
|
29
|
-
style: function style(_ref2) {
|
|
30
|
-
var top = _ref2.top,
|
|
31
|
-
wrapperWidth = _ref2.wrapperWidth;
|
|
32
|
-
return {
|
|
33
|
-
top: top,
|
|
34
|
-
width: wrapperWidth
|
|
35
|
-
};
|
|
18
|
+
var fixedTableDivModeToPosition = {
|
|
19
|
+
stick: 'fixed',
|
|
20
|
+
'pin-bottom': 'absolute'
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var getModeSpecificStyles = function getModeSpecificStyles(mode) {
|
|
24
|
+
if (mode === 'none') {
|
|
25
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: none;\n "])));
|
|
26
|
+
} else {
|
|
27
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: ", ";\n "])), fixedTableDivModeToPosition[mode]);
|
|
36
28
|
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width) {
|
|
32
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n top: ", "px;\n width: ", "px;\n z-index: ", ";\n &\n .", ",\n &\n .", "\n > table {\n margin-top: 0;\n margin-bottom: 0;\n }\n\n border-top: ", "px solid white;\n background: white;\n box-shadow: 0 6px 4px -4px ", ";\n\n div[data-expanded='false'] & {\n display: none;\n }\n\n &\n .", ".right-shadow::after,\n &\n .", ".left-shadow::before {\n top: 0px;\n height: 100%;\n }\n"])), top, width, akEditorStickyHeaderZIndex, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableStickyPadding, N40A, TableSharedCssClassName.TABLE_CONTAINER, TableSharedCssClassName.TABLE_CONTAINER);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export var FixedTableDiv = function FixedTableDiv(props) {
|
|
36
|
+
var top = props.top,
|
|
37
|
+
wrapperWidth = props.wrapperWidth,
|
|
38
|
+
mode = props.mode;
|
|
39
|
+
var fixedTableCss = [fixedTableDivStaticStyles(top, wrapperWidth), getModeSpecificStyles(mode)];
|
|
40
|
+
return jsx("div", {
|
|
41
|
+
css: fixedTableCss
|
|
42
|
+
}, props.children);
|
|
43
|
+
};
|
|
44
|
+
export var StickyTable = function StickyTable(_ref) {
|
|
45
|
+
var top = _ref.top,
|
|
46
|
+
left = _ref.left,
|
|
47
|
+
mode = _ref.mode,
|
|
48
|
+
shadowClassNames = _ref.shadowClassNames,
|
|
49
|
+
innerRef = _ref.innerRef,
|
|
50
|
+
wrapperWidth = _ref.wrapperWidth,
|
|
51
|
+
tableWidth = _ref.tableWidth,
|
|
52
|
+
isNumberColumnEnabled = _ref.isNumberColumnEnabled,
|
|
53
|
+
layout = _ref.layout,
|
|
54
|
+
children = _ref.children,
|
|
55
|
+
columnWidths = _ref.columnWidths,
|
|
56
|
+
renderWidth = _ref.renderWidth,
|
|
57
|
+
allowDynamicTextSizing = _ref.allowDynamicTextSizing,
|
|
58
|
+
rowHeight = _ref.rowHeight;
|
|
59
|
+
return jsx("div", {
|
|
60
|
+
css: {
|
|
61
|
+
left: left && left < 0 ? left : undefined,
|
|
62
|
+
top: mode === 'pin-bottom' ? top : undefined,
|
|
63
|
+
position: 'relative'
|
|
64
|
+
}
|
|
65
|
+
}, jsx(FixedTableDiv, {
|
|
64
66
|
top: mode === 'stick' ? top : undefined,
|
|
65
67
|
mode: rowHeight > 300 ? 'none' : mode,
|
|
66
68
|
wrapperWidth: wrapperWidth
|
|
67
|
-
},
|
|
69
|
+
}, jsx("div", {
|
|
68
70
|
className: "".concat(TableSharedCssClassName.TABLE_CONTAINER, " ").concat(shadowClassNames),
|
|
69
71
|
"data-layout": layout,
|
|
70
72
|
style: {
|
|
71
73
|
width: tableWidth
|
|
72
74
|
}
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
+
}, jsx("div", {
|
|
76
|
+
ref: innerRef,
|
|
75
77
|
className: "".concat(TableSharedCssClassName.TABLE_STICKY_WRAPPER),
|
|
76
78
|
style: {
|
|
77
79
|
overflow: 'hidden'
|
|
78
80
|
}
|
|
79
|
-
},
|
|
81
|
+
}, jsx(Table, {
|
|
80
82
|
columnWidths: columnWidths,
|
|
81
83
|
layout: layout,
|
|
82
84
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
83
85
|
renderWidth: renderWidth,
|
|
84
86
|
allowDynamicTextSizing: allowDynamicTextSizing
|
|
85
|
-
},
|
|
87
|
+
},
|
|
88
|
+
/**
|
|
89
|
+
* @see https://product-fabric.atlassian.net/browse/ED-10235
|
|
90
|
+
* We pass prop 'invisible' to our table's children nodes meaning
|
|
91
|
+
* they exist inside of the 'invisible' duplicated table component that
|
|
92
|
+
* enables sticky headers.
|
|
93
|
+
*/
|
|
94
|
+
recursivelyInjectProps(children, {
|
|
95
|
+
invisible: true
|
|
96
|
+
}))))));
|
|
86
97
|
};
|
|
87
98
|
export var OverflowParent = /*#__PURE__*/function () {
|
|
88
99
|
function OverflowParent(ref) {
|
|
@@ -6,16 +6,12 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
6
6
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
10
|
-
|
|
11
|
-
var _templateObject;
|
|
12
9
|
|
|
13
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); }; }
|
|
14
11
|
|
|
15
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; } }
|
|
16
13
|
|
|
17
14
|
import React from 'react';
|
|
18
|
-
import styled from 'styled-components';
|
|
19
15
|
import { calcTableWidth, TableSharedCssClassName, tableMarginTop } from '@atlaskit/editor-common/styles';
|
|
20
16
|
import { WidthConsumer, overflowShadow } from '@atlaskit/editor-common/ui';
|
|
21
17
|
import { createCompareNodes, convertProsemirrorTableNodeToArrayOfRows, hasMergedCell, compose } from '@atlaskit/editor-common/utils';
|
|
@@ -124,8 +120,6 @@ var tableCanBeSticky = function tableCanBeSticky(node, children) {
|
|
|
124
120
|
return isHeaderRowEnabled(children) && node && node.firstChild && !hasRowspan(node.firstChild);
|
|
125
121
|
};
|
|
126
122
|
|
|
127
|
-
var MainTableContainer = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral([""])));
|
|
128
|
-
|
|
129
123
|
var canUseLinelength = function canUseLinelength(appearance) {
|
|
130
124
|
return appearance === 'full-page' || appearance === 'mobile';
|
|
131
125
|
};
|
|
@@ -330,10 +324,10 @@ export var TableContainer = /*#__PURE__*/function (_React$Component) {
|
|
|
330
324
|
columnWidths: columnWidths,
|
|
331
325
|
rowHeight: this.headerRowHeight,
|
|
332
326
|
allowDynamicTextSizing: allowDynamicTextSizing
|
|
333
|
-
}, [children && children[0]]), /*#__PURE__*/React.createElement(
|
|
327
|
+
}, [children && children[0]]), /*#__PURE__*/React.createElement("div", {
|
|
334
328
|
className: "".concat(TableSharedCssClassName.TABLE_CONTAINER, " ").concat(this.props.shadowClassNames),
|
|
335
329
|
"data-layout": layout,
|
|
336
|
-
|
|
330
|
+
ref: this.props.handleRef,
|
|
337
331
|
style: {
|
|
338
332
|
width: tableWidth,
|
|
339
333
|
left: left && left < 0 ? left : undefined
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to recursively injects props to
|
|
4
|
+
* all valid children react nodes.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export function recursivelyInjectProps(children, propsToInject) {
|
|
8
|
+
return React.Children.toArray(children).map(function (child) {
|
|
9
|
+
// Cannot add a prop to an invalid element, so just return the child
|
|
10
|
+
if (! /*#__PURE__*/React.isValidElement(child)) {
|
|
11
|
+
return child;
|
|
12
|
+
} // Recursive call if child has nested children
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
if (child.props.children) {
|
|
16
|
+
child = /*#__PURE__*/React.cloneElement(child, {
|
|
17
|
+
children: recursivelyInjectProps(child.props.children, propsToInject)
|
|
18
|
+
});
|
|
19
|
+
} // Add props to react child node
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
return /*#__PURE__*/React.cloneElement(child, propsToInject);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import debounce from 'lodash/debounce';
|
|
3
|
+
import { useComponentRenderTracking } from '@atlaskit/editor-common/utils';
|
|
4
|
+
import { EVENT_TYPE } from '../../../analytics/enums';
|
|
5
|
+
export function RenderTracking(props) {
|
|
6
|
+
var debouncedHandleAnalyticsEvent = useMemo(function () {
|
|
7
|
+
return debounce(props.handleAnalyticsEvent, 500);
|
|
8
|
+
}, [props.handleAnalyticsEvent]);
|
|
9
|
+
useComponentRenderTracking({
|
|
10
|
+
onRender: function onRender(_ref) {
|
|
11
|
+
var renderCount = _ref.renderCount,
|
|
12
|
+
propsDifference = _ref.propsDifference,
|
|
13
|
+
componentId = _ref.componentId;
|
|
14
|
+
|
|
15
|
+
if (!renderCount) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
debouncedHandleAnalyticsEvent({
|
|
20
|
+
action: props.action,
|
|
21
|
+
actionSubject: props.actionSubject,
|
|
22
|
+
attributes: {
|
|
23
|
+
count: renderCount,
|
|
24
|
+
propsDifference: propsDifference,
|
|
25
|
+
componentId: componentId
|
|
26
|
+
},
|
|
27
|
+
eventType: EVENT_TYPE.OPERATIONAL
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
propsDiffingOptions: {
|
|
31
|
+
enabled: true,
|
|
32
|
+
props: props.componentProps,
|
|
33
|
+
propsToIgnore: props.propsToIgnore,
|
|
34
|
+
useShallow: props.useShallow
|
|
35
|
+
},
|
|
36
|
+
zeroBasedCount: true
|
|
37
|
+
});
|
|
38
|
+
return null;
|
|
39
|
+
}
|
package/dist/esm/ui/Expand.js
CHANGED
|
@@ -4,35 +4,60 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
4
4
|
|
|
5
5
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
import
|
|
7
|
+
/** @jsx jsx */
|
|
8
|
+
import React, { useRef, useCallback } from 'react';
|
|
9
|
+
import { css, jsx } from '@emotion/react';
|
|
9
10
|
import { gridSize, fontSize } from '@atlaskit/theme/constants';
|
|
10
11
|
import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
|
|
11
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
12
|
-
import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper,
|
|
13
|
+
import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper, clearNextSiblingMarginTopStyle, ExpandLayoutWrapperWithRef } from '@atlaskit/editor-common/ui';
|
|
13
14
|
import { akEditorLineHeight, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
14
15
|
import { PLATFORM, MODE } from '../analytics/events';
|
|
15
16
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics/enums';
|
|
16
17
|
import { injectIntl } from 'react-intl-next';
|
|
17
18
|
import { ActiveHeaderIdConsumer } from './active-header-id-provider';
|
|
18
19
|
import _uniqueId from 'lodash/uniqueId';
|
|
19
|
-
var
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
var titleStyles = css(_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);
|
|
21
|
+
|
|
22
|
+
var Container = function Container(props) {
|
|
23
|
+
var paddingBottom = "".concat(props.expanded ? gridSize() : 0, "px");
|
|
24
|
+
var sharedContainerStyles = sharedExpandStyles.containerStyles(props);
|
|
25
|
+
|
|
26
|
+
var styles = function styles(themeProps) {
|
|
27
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n padding: 0;\n padding-bottom: ", ";\n "])), sharedContainerStyles(themeProps), paddingBottom);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return jsx("div", _extends({
|
|
31
|
+
css: styles
|
|
32
|
+
}, props), props.children);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
var TitleContainer = function TitleContainer(props) {
|
|
36
|
+
var paddingBottom = "".concat(!props.expanded ? gridSize() : 0, "px");
|
|
37
|
+
|
|
38
|
+
var styles = function styles(themeProps) {
|
|
39
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n padding: ", "px;\n padding-bottom: ", ";\n "])), sharedExpandStyles.titleContainerStyles(themeProps), gridSize(), paddingBottom);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return jsx("button", _extends({
|
|
43
|
+
css: styles
|
|
44
|
+
}, props), props.children);
|
|
45
|
+
};
|
|
46
|
+
|
|
26
47
|
TitleContainer.displayName = 'TitleContainerButton';
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
48
|
+
|
|
49
|
+
var ContentContainer = function ContentContainer(props) {
|
|
50
|
+
var sharedContentStyles = sharedExpandStyles.contentStyles(props);
|
|
51
|
+
var visibility = props.expanded ? 'visible' : 'hidden';
|
|
52
|
+
|
|
53
|
+
var styles = function styles(themeProps) {
|
|
54
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", ";\n padding-right: ", "px;\n padding-left: ", "px;\n visibility: ", ";\n "])), sharedContentStyles(themeProps), gridSize() * 2, gridSize() * 5 - gridSize() / 2, visibility);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
return jsx("div", _extends({
|
|
58
|
+
css: styles
|
|
59
|
+
}, props), props.children);
|
|
60
|
+
};
|
|
36
61
|
|
|
37
62
|
function fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent) {
|
|
38
63
|
if (!fireAnalyticsEvent) {
|
|
@@ -80,18 +105,18 @@ function Expand(_ref) {
|
|
|
80
105
|
var handleBlur = useCallback(function () {
|
|
81
106
|
return setFocused(false);
|
|
82
107
|
}, []);
|
|
83
|
-
return
|
|
108
|
+
return jsx(Container, {
|
|
84
109
|
"data-node-type": nodeType,
|
|
85
110
|
"data-title": title,
|
|
86
111
|
"data-expanded": expanded,
|
|
87
112
|
expanded: expanded,
|
|
88
113
|
focused: focused
|
|
89
|
-
}, nestedHeaderIds && nestedHeaderIds.length > 0 ?
|
|
114
|
+
}, nestedHeaderIds && nestedHeaderIds.length > 0 ? jsx(ActiveHeaderIdConsumer, {
|
|
90
115
|
nestedHeaderIds: nestedHeaderIds,
|
|
91
116
|
onNestedHeaderIdMatch: function onNestedHeaderIdMatch() {
|
|
92
117
|
return setExpanded(true);
|
|
93
118
|
}
|
|
94
|
-
}) : null,
|
|
119
|
+
}) : null, jsx(TitleContainer, {
|
|
95
120
|
onClick: function onClick(e) {
|
|
96
121
|
e.stopPropagation();
|
|
97
122
|
fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent);
|
|
@@ -106,21 +131,24 @@ function Expand(_ref) {
|
|
|
106
131
|
"aria-expanded": expanded,
|
|
107
132
|
contentEditable: false,
|
|
108
133
|
expanded: expanded
|
|
109
|
-
},
|
|
134
|
+
}, jsx(Tooltip, {
|
|
110
135
|
content: label,
|
|
111
136
|
position: "top",
|
|
112
137
|
tag: ExpandLayoutWrapperWithRef
|
|
113
|
-
},
|
|
138
|
+
}, jsx(ExpandIconWrapper, {
|
|
114
139
|
expanded: expanded
|
|
115
|
-
},
|
|
140
|
+
}, jsx(ChevronRightIcon, {
|
|
116
141
|
label: label
|
|
117
|
-
}))),
|
|
142
|
+
}))), jsx("span", {
|
|
143
|
+
css: titleStyles,
|
|
118
144
|
id: id
|
|
119
|
-
}, title || intl.formatMessage(expandMessages.expandDefaultTitle))),
|
|
145
|
+
}, title || intl.formatMessage(expandMessages.expandDefaultTitle))), jsx(ContentContainer, {
|
|
120
146
|
expanded: expanded
|
|
121
|
-
},
|
|
147
|
+
}, jsx("div", {
|
|
122
148
|
className: "".concat(nodeType, "-content-wrapper")
|
|
123
|
-
},
|
|
149
|
+
}, jsx(WidthProvider, null, jsx("div", {
|
|
150
|
+
css: clearNextSiblingMarginTopStyle
|
|
151
|
+
}), children))));
|
|
124
152
|
}
|
|
125
153
|
|
|
126
154
|
export default injectIntl(Expand);
|
package/dist/esm/ui/MediaCard.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
1
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
@@ -9,8 +8,6 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
9
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
10
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
11
10
|
|
|
12
|
-
var _templateObject;
|
|
13
|
-
|
|
14
11
|
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
12
|
|
|
16
13
|
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; }
|
|
@@ -19,13 +16,11 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
19
16
|
|
|
20
17
|
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; } }
|
|
21
18
|
|
|
22
|
-
import React from 'react';
|
|
23
|
-
import { Component } from 'react';
|
|
19
|
+
import React, { Component } from 'react';
|
|
24
20
|
import { filter } from '@atlaskit/adf-utils';
|
|
25
21
|
import { Card, CardLoading, CardError } from '@atlaskit/media-card';
|
|
26
22
|
import { getMediaClient } from '@atlaskit/media-client';
|
|
27
23
|
import { withImageLoader } from '@atlaskit/editor-common/utils';
|
|
28
|
-
import styled from 'styled-components';
|
|
29
24
|
var mediaIdentifierMap = new Map();
|
|
30
25
|
export var getListOfIdentifiersFromDoc = function getListOfIdentifiersFromDoc(doc) {
|
|
31
26
|
if (!doc) {
|
|
@@ -355,7 +350,7 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
355
350
|
collectionName: collection,
|
|
356
351
|
occurrenceKey: occurrenceKey
|
|
357
352
|
};
|
|
358
|
-
return /*#__PURE__*/React.createElement(
|
|
353
|
+
return /*#__PURE__*/React.createElement("div", getClipboardAttrs({
|
|
359
354
|
id: id,
|
|
360
355
|
alt: alt,
|
|
361
356
|
collection: collection,
|
|
@@ -386,8 +381,7 @@ export var MediaCardInternal = /*#__PURE__*/function (_Component) {
|
|
|
386
381
|
}]);
|
|
387
382
|
|
|
388
383
|
return MediaCardInternal;
|
|
389
|
-
}(Component);
|
|
390
|
-
export var CardWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral([""]))); // Needed for copy & paste
|
|
384
|
+
}(Component); // Needed for copy & paste
|
|
391
385
|
|
|
392
386
|
export var getClipboardAttrs = function getClipboardAttrs(_ref2) {
|
|
393
387
|
var id = _ref2.id,
|