@atlaskit/renderer 92.0.0 → 93.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +75 -0
- package/dist/cjs/analytics/enums.js +1 -0
- package/dist/cjs/i18n/en.js +28 -0
- package/dist/cjs/i18n/en_GB.js +28 -0
- package/dist/cjs/i18n/pl.js +7 -1
- package/dist/cjs/i18n/pt_BR.js +1 -1
- 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 +1 -1
- 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/mediaSingle/index.js +15 -4
- package/dist/cjs/react/nodes/mediaSingle/styles.js +7 -10
- package/dist/cjs/react/nodes/panel.js +36 -20
- package/dist/cjs/react/nodes/table/sticky.js +51 -54
- package/dist/cjs/react/nodes/table.js +2 -10
- package/dist/cjs/react/utils/performance/RenderTracking.js +52 -0
- package/dist/cjs/render-document.js +2 -2
- package/dist/cjs/text/index.js +2 -2
- package/dist/cjs/ui/Expand.js +40 -20
- package/dist/cjs/ui/MediaCard.js +4 -14
- package/dist/cjs/ui/Renderer/click-to-edit.js +4 -4
- package/dist/cjs/ui/Renderer/index.js +39 -50
- package/dist/cjs/ui/Renderer/style.js +58 -63
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +19 -21
- package/dist/cjs/ui/SortingIcon.js +8 -9
- package/dist/cjs/ui/renderer-props.js +1 -3
- package/dist/cjs/utils.js +2 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/enums.js +1 -0
- package/dist/es2019/i18n/en.js +20 -0
- package/dist/es2019/i18n/en_GB.js +20 -0
- package/dist/es2019/i18n/pl.js +7 -1
- package/dist/es2019/i18n/pt_BR.js +1 -1
- 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 +1 -1
- 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/mediaSingle/index.js +10 -6
- package/dist/es2019/react/nodes/mediaSingle/styles.js +6 -7
- package/dist/es2019/react/nodes/panel.js +38 -18
- package/dist/es2019/react/nodes/table/sticky.js +48 -41
- package/dist/es2019/react/nodes/table.js +2 -5
- package/dist/es2019/react/utils/performance/RenderTracking.js +37 -0
- package/dist/es2019/render-document.js +1 -1
- package/dist/es2019/text/index.js +1 -1
- package/dist/es2019/ui/Expand.js +52 -28
- package/dist/es2019/ui/MediaCard.js +3 -6
- package/dist/es2019/ui/Renderer/click-to-edit.js +1 -1
- package/dist/es2019/ui/Renderer/index.js +38 -43
- package/dist/es2019/ui/Renderer/style.js +363 -337
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +26 -15
- package/dist/es2019/ui/SortingIcon.js +9 -7
- package/dist/es2019/ui/renderer-props.js +1 -1
- package/dist/es2019/utils.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/enums.js +1 -0
- package/dist/esm/i18n/en.js +20 -0
- package/dist/esm/i18n/en_GB.js +20 -0
- package/dist/esm/i18n/pl.js +7 -1
- package/dist/esm/i18n/pt_BR.js +1 -1
- 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 +1 -1
- 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/mediaSingle/index.js +11 -6
- package/dist/esm/react/nodes/mediaSingle/styles.js +5 -7
- package/dist/esm/react/nodes/panel.js +34 -17
- package/dist/esm/react/nodes/table/sticky.js +53 -52
- package/dist/esm/react/nodes/table.js +2 -8
- package/dist/esm/react/utils/performance/RenderTracking.js +39 -0
- package/dist/esm/render-document.js +1 -1
- package/dist/esm/text/index.js +1 -1
- package/dist/esm/ui/Expand.js +45 -21
- package/dist/esm/ui/MediaCard.js +3 -9
- package/dist/esm/ui/Renderer/click-to-edit.js +1 -1
- package/dist/esm/ui/Renderer/index.js +39 -47
- package/dist/esm/ui/Renderer/style.js +56 -57
- package/dist/esm/ui/Renderer/truncated-wrapper.js +20 -14
- package/dist/esm/ui/SortingIcon.js +9 -7
- package/dist/esm/ui/renderer-props.js +1 -1
- package/dist/esm/utils.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/enums.d.ts +1 -0
- package/dist/types/analytics/events.d.ts +7 -2
- package/dist/types/i18n/en.d.ts +20 -0
- package/dist/types/i18n/en_GB.d.ts +20 -0
- package/dist/types/i18n/pl.d.ts +6 -0
- 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/embedCard.d.ts +3 -2
- package/dist/types/react/nodes/heading-anchor.d.ts +1 -0
- package/dist/types/react/nodes/media.d.ts +1 -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/performance/RenderTracking.d.ts +15 -0
- package/dist/types/ui/Expand.d.ts +2 -2
- package/dist/types/ui/MediaCard.d.ts +1 -3
- package/dist/types/ui/Renderer/index.d.ts +0 -25
- package/dist/types/ui/Renderer/style.d.ts +1 -4
- package/dist/types/ui/Renderer/truncated-wrapper.d.ts +3 -1
- package/dist/types/ui/SortingIcon.d.ts +3 -3
- package/dist/types/ui/renderer-props.d.ts +14 -2
- package/package.json +22 -24
|
@@ -1,29 +1,46 @@
|
|
|
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
|
-
import { PanelSharedCssClassName } from '@atlaskit/editor-common/
|
|
11
|
+
import { getPanelBackgroundDarkModeColors, panelSharedStylesWithoutPrefix, PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
|
|
10
12
|
import EmojiIcon from '@atlaskit/icon/glyph/editor/emoji';
|
|
11
13
|
import EmojiItem from './emoji'; // AFP-2532 TODO: Fix automatic suppressions below
|
|
12
14
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
13
15
|
|
|
14
16
|
import { themed } from '@atlaskit/theme';
|
|
15
|
-
import { getPanelBackgroundDarkModeColors } from '@atlaskit/editor-common/styles';
|
|
16
17
|
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
18
|
|
|
19
|
+
var PanelStyled = function PanelStyled(props) {
|
|
20
|
+
var styles = function styles(theme) {
|
|
21
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &.", " {\n ", "\n }\n "])), PanelSharedCssClassName.prefix, panelSharedStylesWithoutPrefix({
|
|
22
|
+
theme: theme
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
if (props['data-panel-type'] === PanelType.CUSTOM && props.backgroundColor) {
|
|
27
|
+
styles = function styles(theme) {
|
|
28
|
+
return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n &.", " {\n ", "\n }\n\n &[data-panel-type=", "] {\n background-color: ", ";\n ", ";\n }\n "])), PanelSharedCssClassName.prefix, panelSharedStylesWithoutPrefix({
|
|
29
|
+
theme: theme
|
|
30
|
+
}), PanelType.CUSTOM, props.backgroundColor, themed({
|
|
31
|
+
dark: getPanelBackgroundDarkModeColors
|
|
32
|
+
})({
|
|
33
|
+
theme: theme
|
|
34
|
+
}));
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return jsx("div", _extends({
|
|
39
|
+
css: styles
|
|
40
|
+
}, props), props.children);
|
|
41
|
+
};
|
|
22
42
|
|
|
23
|
-
|
|
24
|
-
dark: getPanelBackgroundDarkModeColors
|
|
25
|
-
}), ";\n }\n ");
|
|
26
|
-
});
|
|
43
|
+
PanelStyled.displayName = 'PanelStyled';
|
|
27
44
|
var panelIcons = {
|
|
28
45
|
info: PanelInfoIcon,
|
|
29
46
|
success: PanelSuccessIcon,
|
|
@@ -50,7 +67,7 @@ var Panel = function Panel(props) {
|
|
|
50
67
|
var getIcon = function getIcon() {
|
|
51
68
|
if (panelType === PanelType.CUSTOM) {
|
|
52
69
|
if (panelIcon && providers) {
|
|
53
|
-
return
|
|
70
|
+
return jsx(EmojiItem, {
|
|
54
71
|
id: panelIconId,
|
|
55
72
|
text: panelIconText,
|
|
56
73
|
shortName: panelIcon,
|
|
@@ -62,7 +79,7 @@ var Panel = function Panel(props) {
|
|
|
62
79
|
}
|
|
63
80
|
|
|
64
81
|
var Icon = panelIcons[panelType];
|
|
65
|
-
return
|
|
82
|
+
return jsx(Icon, {
|
|
66
83
|
label: "Panel ".concat(panelType)
|
|
67
84
|
});
|
|
68
85
|
};
|
|
@@ -71,13 +88,13 @@ var Panel = function Panel(props) {
|
|
|
71
88
|
var icon = getIcon();
|
|
72
89
|
|
|
73
90
|
if (icon) {
|
|
74
|
-
return
|
|
91
|
+
return jsx("div", {
|
|
75
92
|
className: PanelSharedCssClassName.icon
|
|
76
93
|
}, icon);
|
|
77
94
|
}
|
|
78
95
|
};
|
|
79
96
|
|
|
80
|
-
return
|
|
97
|
+
return jsx(PanelStyled, {
|
|
81
98
|
className: PanelSharedCssClassName.prefix,
|
|
82
99
|
"data-panel-type": panelType,
|
|
83
100
|
"data-panel-color": panelColor,
|
|
@@ -85,7 +102,7 @@ var Panel = function Panel(props) {
|
|
|
85
102
|
"data-panel-icon-id": panelIconId,
|
|
86
103
|
"data-panel-icon-text": panelIconText,
|
|
87
104
|
backgroundColor: panelColor
|
|
88
|
-
}, renderIcon(),
|
|
105
|
+
}, renderIcon(), jsx("div", {
|
|
89
106
|
className: PanelSharedCssClassName.content
|
|
90
107
|
}, children));
|
|
91
108
|
};
|
|
@@ -4,8 +4,9 @@ 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';
|
|
@@ -14,70 +15,70 @@ import { findHorizontalOverflowScrollParent } from '../../../utils';
|
|
|
14
15
|
import { Table } from './table';
|
|
15
16
|
import { recursivelyInjectProps } from '../../utils/inject-props';
|
|
16
17
|
export var tableStickyPadding = 8;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
})(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
29
|
-
export var FixedTableDiv = styled.div.attrs({
|
|
30
|
-
style: function style(_ref2) {
|
|
31
|
-
var top = _ref2.top,
|
|
32
|
-
wrapperWidth = _ref2.wrapperWidth;
|
|
33
|
-
return {
|
|
34
|
-
top: top,
|
|
35
|
-
width: wrapperWidth
|
|
36
|
-
};
|
|
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]);
|
|
37
28
|
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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, {
|
|
65
66
|
top: mode === 'stick' ? top : undefined,
|
|
66
67
|
mode: rowHeight > 300 ? 'none' : mode,
|
|
67
68
|
wrapperWidth: wrapperWidth
|
|
68
|
-
},
|
|
69
|
+
}, jsx("div", {
|
|
69
70
|
className: "".concat(TableSharedCssClassName.TABLE_CONTAINER, " ").concat(shadowClassNames),
|
|
70
71
|
"data-layout": layout,
|
|
71
72
|
style: {
|
|
72
73
|
width: tableWidth
|
|
73
74
|
}
|
|
74
|
-
},
|
|
75
|
-
|
|
75
|
+
}, jsx("div", {
|
|
76
|
+
ref: innerRef,
|
|
76
77
|
className: "".concat(TableSharedCssClassName.TABLE_STICKY_WRAPPER),
|
|
77
78
|
style: {
|
|
78
79
|
overflow: 'hidden'
|
|
79
80
|
}
|
|
80
|
-
},
|
|
81
|
+
}, jsx(Table, {
|
|
81
82
|
columnWidths: columnWidths,
|
|
82
83
|
layout: layout,
|
|
83
84
|
isNumberColumnEnabled: isNumberColumnEnabled,
|
|
@@ -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,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
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defaultSchema } from '@atlaskit/adf-schema';
|
|
1
|
+
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
2
2
|
import { getValidDocument } from '@atlaskit/editor-common/validator';
|
|
3
3
|
import { validateADFEntity, findAndTrackUnsupportedContentNodes } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from './analytics/enums';
|
package/dist/esm/text/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import { defaultSchema } from '@atlaskit/adf-schema';
|
|
3
|
+
import { defaultSchema } from '@atlaskit/adf-schema/schema-default';
|
|
4
4
|
import { reduce } from './nodes';
|
|
5
5
|
|
|
6
6
|
var TextSerializer = /*#__PURE__*/function () {
|
package/dist/esm/ui/Expand.js
CHANGED
|
@@ -5,36 +5,59 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
5
5
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
6
6
|
|
|
7
7
|
/** @jsx jsx */
|
|
8
|
-
import React, {
|
|
9
|
-
import { jsx } from '@emotion/react';
|
|
10
|
-
import styled from 'styled-components';
|
|
8
|
+
import React, { useRef, useCallback } from 'react';
|
|
9
|
+
import { css, jsx } from '@emotion/react';
|
|
11
10
|
import { gridSize, fontSize } from '@atlaskit/theme/constants';
|
|
12
11
|
import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
|
|
13
12
|
import Tooltip from '@atlaskit/tooltip';
|
|
14
|
-
import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper,
|
|
13
|
+
import { expandMessages, sharedExpandStyles, WidthProvider, ExpandIconWrapper, clearNextSiblingMarginTopStyle, ExpandLayoutWrapperWithRef } from '@atlaskit/editor-common/ui';
|
|
15
14
|
import { akEditorLineHeight, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
16
15
|
import { PLATFORM, MODE } from '../analytics/events';
|
|
17
16
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../analytics/enums';
|
|
18
17
|
import { injectIntl } from 'react-intl-next';
|
|
19
18
|
import { ActiveHeaderIdConsumer } from './active-header-id-provider';
|
|
20
19
|
import _uniqueId from 'lodash/uniqueId';
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
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
|
+
|
|
28
47
|
TitleContainer.displayName = 'TitleContainerButton';
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
|
|
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
|
+
};
|
|
38
61
|
|
|
39
62
|
function fireExpandToggleAnalytics(nodeType, expanded, fireAnalyticsEvent) {
|
|
40
63
|
if (!fireAnalyticsEvent) {
|
|
@@ -116,7 +139,8 @@ function Expand(_ref) {
|
|
|
116
139
|
expanded: expanded
|
|
117
140
|
}, jsx(ChevronRightIcon, {
|
|
118
141
|
label: label
|
|
119
|
-
}))), jsx(
|
|
142
|
+
}))), jsx("span", {
|
|
143
|
+
css: titleStyles,
|
|
120
144
|
id: id
|
|
121
145
|
}, title || intl.formatMessage(expandMessages.expandDefaultTitle))), jsx(ContentContainer, {
|
|
122
146
|
expanded: expanded
|
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,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fileCardImageViewSelector } from '@atlaskit/media-card';
|
|
1
|
+
import { fileCardImageViewSelector } from '@atlaskit/media-card/classnames';
|
|
2
2
|
import { mediaViewerPopupClass } from '@atlaskit/media-viewer/classnames';
|
|
3
3
|
/**
|
|
4
4
|
* Check if an element is interactive (or otherwise if clicking on it shouldn't transition the
|