@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
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -21,31 +19,31 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
21
19
|
|
|
22
20
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
23
21
|
|
|
24
|
-
var _react =
|
|
22
|
+
var _react = require("@emotion/react");
|
|
25
23
|
|
|
26
|
-
var
|
|
24
|
+
var _react2 = require("react");
|
|
27
25
|
|
|
28
26
|
var _templateObject;
|
|
29
27
|
|
|
30
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
|
-
|
|
32
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
33
|
-
|
|
34
28
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
35
29
|
|
|
36
30
|
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; } }
|
|
37
31
|
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
32
|
+
var fadeOutStyles = function fadeOutStyles(maxHeight, top, backgroundColor) {
|
|
33
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n overflow-y: hidden;\n max-height: ", "px;\n &::after {\n content: '';\n position: absolute;\n top: ", "px;\n bottom: 0;\n left: 0;\n right: 0;\n background-image: linear-gradient(\n rgba(255, 255, 255, 0),\n ", "\n );\n }\n"])), maxHeight, top, backgroundColor);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
var FadeOut = function FadeOut(props) {
|
|
37
|
+
var children = props.children,
|
|
38
|
+
backgroundColor = props.backgroundColor,
|
|
39
|
+
fadeHeight = props.fadeHeight,
|
|
40
|
+
height = props.height;
|
|
41
|
+
var top = height - fadeHeight;
|
|
42
|
+
var styles = fadeOutStyles(height, top, backgroundColor);
|
|
43
|
+
return (0, _react.jsx)("div", {
|
|
44
|
+
css: styles
|
|
45
|
+
}, children);
|
|
46
|
+
};
|
|
49
47
|
|
|
50
48
|
var TruncatedWrapper = /*#__PURE__*/function (_Component) {
|
|
51
49
|
(0, _inherits2.default)(TruncatedWrapper, _Component);
|
|
@@ -68,7 +66,7 @@ var TruncatedWrapper = /*#__PURE__*/function (_Component) {
|
|
|
68
66
|
_this$props$backgroun = _this$props.backgroundColor,
|
|
69
67
|
backgroundColor = _this$props$backgroun === void 0 ? 'white' : _this$props$backgroun,
|
|
70
68
|
children = _this$props.children;
|
|
71
|
-
return
|
|
69
|
+
return (0, _react.jsx)(FadeOut, {
|
|
72
70
|
height: height,
|
|
73
71
|
fadeHeight: fadeHeight,
|
|
74
72
|
backgroundColor: backgroundColor
|
|
@@ -76,6 +74,6 @@ var TruncatedWrapper = /*#__PURE__*/function (_Component) {
|
|
|
76
74
|
}
|
|
77
75
|
}]);
|
|
78
76
|
return TruncatedWrapper;
|
|
79
|
-
}(
|
|
77
|
+
}(_react2.Component);
|
|
80
78
|
|
|
81
79
|
exports.TruncatedWrapper = TruncatedWrapper;
|
|
@@ -9,9 +9,7 @@ exports.default = exports.TableSortIconDataUrl = exports.StatusClassNames = void
|
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
12
|
-
var _react =
|
|
13
|
-
|
|
14
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
12
|
+
var _react = require("@emotion/react");
|
|
15
13
|
|
|
16
14
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
17
15
|
|
|
@@ -43,9 +41,8 @@ exports.StatusClassNames = StatusClassNames;
|
|
|
43
41
|
StatusClassNames["SORTING_NOT_ALLOWED"] = "sorting-icon-svg__not-allowed";
|
|
44
42
|
})(StatusClassNames || (exports.StatusClassNames = StatusClassNames = {}));
|
|
45
43
|
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
var TableSortingIcon = _styledComponents.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n background-image: url(", ");\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), TableSortIconDataUrl, StatusClassNames.DESC, TABLE_SORTING_ICON_CLASS);
|
|
44
|
+
var wrapperStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n display: flex;\n height: 28px;\n width: 28px;\n margin: 6px;\n right: 0;\n top: 0;\n border: 2px solid #fff;\n border-radius: ", "px;\n background-color: ", ";\n justify-content: center;\n align-items: center;\n\n &:hover {\n background-color: ", ";\n }\n\n &.", " {\n cursor: not-allowed;\n }\n"])), (0, _constants.gridSize)() / 2, _colors.N20, _colors.N30, StatusClassNames.SORTING_NOT_ALLOWED);
|
|
45
|
+
var tableSortingIconStyles = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: 8px;\n height: 12px;\n transition: transform 0.3s cubic-bezier(0.15, 1, 0.3, 1);\n transform-origin: 50% 50%;\n background-image: url(", ");\n\n &.", " {\n transform: rotate(-180deg);\n }\n\n &.", "-inactive {\n opacity: 0.7;\n }\n"])), TableSortIconDataUrl, StatusClassNames.DESC, TABLE_SORTING_ICON_CLASS);
|
|
49
46
|
|
|
50
47
|
var getClassName = function getClassName(status) {
|
|
51
48
|
switch (status) {
|
|
@@ -91,13 +88,15 @@ var SortingIcon = function SortingIcon(_ref) {
|
|
|
91
88
|
var activated = sortOrdered !== _types.SortOrder.NO_ORDER;
|
|
92
89
|
var wrapperClassName = !isSortingAllowed ? StatusClassNames.SORTING_NOT_ALLOWED : '';
|
|
93
90
|
var content = getTooltipTitle(intl, isSortingAllowed, sortOrdered);
|
|
94
|
-
return
|
|
91
|
+
return (0, _react.jsx)(_tooltip.default, {
|
|
95
92
|
delay: 0,
|
|
96
93
|
content: content,
|
|
97
94
|
position: "top"
|
|
98
|
-
},
|
|
95
|
+
}, (0, _react.jsx)("figure", {
|
|
96
|
+
css: wrapperStyles,
|
|
99
97
|
className: wrapperClassName
|
|
100
|
-
},
|
|
98
|
+
}, (0, _react.jsx)("div", {
|
|
99
|
+
css: tableSortingIconStyles,
|
|
101
100
|
className: "".concat(getClassName(sortOrdered), " ").concat(TABLE_SORTING_ICON_CLASS, "-").concat(activated ? 'active' : 'inactive')
|
|
102
101
|
})));
|
|
103
102
|
};
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
6
8
|
value: true
|
|
7
9
|
});
|
|
@@ -11,7 +13,9 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
|
11
13
|
|
|
12
14
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
15
|
|
|
14
|
-
var _react =
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
|
|
18
|
+
var _react2 = require("@emotion/react");
|
|
15
19
|
|
|
16
20
|
var _types = require("../types");
|
|
17
21
|
|
|
@@ -23,20 +27,26 @@ var _position = require("./position");
|
|
|
23
27
|
|
|
24
28
|
var _dom = require("./dom");
|
|
25
29
|
|
|
26
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
27
|
-
|
|
28
30
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
29
31
|
|
|
30
32
|
var _templateObject;
|
|
31
33
|
|
|
32
|
-
var
|
|
34
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
35
|
+
|
|
36
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
37
|
+
|
|
38
|
+
var markStyles = function markStyles(props) {
|
|
39
|
+
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n\n ", ";\n"])), (0, _styles.AnnotationSharedCSSByState)(props).focus);
|
|
40
|
+
};
|
|
33
41
|
|
|
34
42
|
var AnnotationDraft = function AnnotationDraft(_ref) {
|
|
35
43
|
var draftPosition = _ref.draftPosition,
|
|
36
44
|
children = _ref.children;
|
|
37
|
-
return
|
|
45
|
+
return (0, _react2.jsx)("mark", (0, _extends2.default)({
|
|
38
46
|
"data-renderer-mark": true
|
|
39
|
-
}, (0, _dom.dataAttributes)(draftPosition)
|
|
47
|
+
}, (0, _dom.dataAttributes)(draftPosition), {
|
|
48
|
+
css: markStyles
|
|
49
|
+
}), children);
|
|
40
50
|
};
|
|
41
51
|
|
|
42
52
|
exports.AnnotationDraft = AnnotationDraft;
|
|
@@ -66,13 +76,13 @@ var applyAnnotationOnText = function applyAnnotationOnText(_ref2) {
|
|
|
66
76
|
var annotateIndex = getAnnotationIndex(shouldApplyAnnotationAt, texts.length);
|
|
67
77
|
return texts.map(function (value, index) {
|
|
68
78
|
if (annotateIndex === index) {
|
|
69
|
-
return
|
|
79
|
+
return (0, _react2.jsx)(AnnotationDraft, {
|
|
70
80
|
key: index,
|
|
71
81
|
draftPosition: draftPosition
|
|
72
82
|
}, value);
|
|
73
83
|
}
|
|
74
84
|
|
|
75
|
-
return
|
|
85
|
+
return (0, _react2.jsx)(_react.default.Fragment, {
|
|
76
86
|
key: index
|
|
77
87
|
}, value);
|
|
78
88
|
});
|
|
@@ -103,11 +113,11 @@ var TextWithAnnotationDraft = function TextWithAnnotationDraft(_ref3) {
|
|
|
103
113
|
}, [nextDraftPosition, textPosition]);
|
|
104
114
|
|
|
105
115
|
if (shouldApplyAnnotationAt === false || !nextDraftPosition) {
|
|
106
|
-
return
|
|
116
|
+
return (0, _react2.jsx)(_react.Fragment, null, children);
|
|
107
117
|
}
|
|
108
118
|
|
|
109
119
|
if (shouldApplyAnnotationAt === _types.InsertDraftPosition.AROUND_TEXT) {
|
|
110
|
-
return
|
|
120
|
+
return (0, _react2.jsx)(AnnotationDraft, {
|
|
111
121
|
key: 0,
|
|
112
122
|
draftPosition: nextDraftPosition
|
|
113
123
|
}, children);
|
|
@@ -117,7 +127,7 @@ var TextWithAnnotationDraft = function TextWithAnnotationDraft(_ref3) {
|
|
|
117
127
|
var texts = (0, _text.splitText)(children, offsets);
|
|
118
128
|
|
|
119
129
|
if (!texts) {
|
|
120
|
-
return
|
|
130
|
+
return (0, _react2.jsx)(_react.Fragment, null, children);
|
|
121
131
|
}
|
|
122
132
|
|
|
123
133
|
var components = applyAnnotationOnText({
|
|
@@ -125,7 +135,7 @@ var TextWithAnnotationDraft = function TextWithAnnotationDraft(_ref3) {
|
|
|
125
135
|
shouldApplyAnnotationAt: shouldApplyAnnotationAt,
|
|
126
136
|
draftPosition: nextDraftPosition
|
|
127
137
|
});
|
|
128
|
-
return
|
|
138
|
+
return (0, _react2.jsx)(_react.Fragment, null, components);
|
|
129
139
|
};
|
|
130
140
|
|
|
131
141
|
exports.TextWithAnnotationDraft = TextWithAnnotationDraft;
|
|
@@ -19,12 +19,12 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
19
19
|
|
|
20
20
|
var _react = _interopRequireWildcard(require("react"));
|
|
21
21
|
|
|
22
|
+
var _react2 = require("@emotion/react");
|
|
23
|
+
|
|
22
24
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
23
25
|
|
|
24
26
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
25
27
|
|
|
26
|
-
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
27
|
-
|
|
28
28
|
var _templateObject;
|
|
29
29
|
|
|
30
30
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -35,7 +35,9 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
35
35
|
|
|
36
36
|
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) { (0, _defineProperty2.default)(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; }
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var markStyles = function markStyles(props) {
|
|
39
|
+
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: inherit;\n background-color: unset;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n\n &[data-mark-annotation-state='", "'] {\n ", ";\n\n &:focus,\n &[data-has-focus='true'] {\n ", ";\n }\n }\n"])), _adfSchema.AnnotationMarkStates.ACTIVE, (0, _styles.AnnotationSharedCSSByState)(props).blur, (0, _styles.AnnotationSharedCSSByState)(props).focus);
|
|
40
|
+
};
|
|
39
41
|
|
|
40
42
|
var MarkComponent = function MarkComponent(_ref) {
|
|
41
43
|
var annotationParentIds = _ref.annotationParentIds,
|
|
@@ -70,10 +72,12 @@ var MarkComponent = function MarkComponent(_ref) {
|
|
|
70
72
|
} : {
|
|
71
73
|
'aria-details': annotationIds.join(', ')
|
|
72
74
|
};
|
|
73
|
-
return
|
|
75
|
+
return (0, _react2.jsx)("mark", (0, _extends2.default)({
|
|
74
76
|
id: id,
|
|
75
77
|
onClick: onMarkClick
|
|
76
|
-
}, accessibility, overriddenData
|
|
78
|
+
}, accessibility, overriddenData, {
|
|
79
|
+
css: markStyles
|
|
80
|
+
}), children);
|
|
77
81
|
};
|
|
78
82
|
|
|
79
83
|
exports.MarkComponent = MarkComponent;
|
package/dist/cjs/version.json
CHANGED
|
@@ -12,6 +12,8 @@ export let ACTION;
|
|
|
12
12
|
(function (ACTION) {
|
|
13
13
|
ACTION["STARTED"] = "started";
|
|
14
14
|
ACTION["RENDERED"] = "rendered";
|
|
15
|
+
ACTION["RE_RENDERED"] = "reRendered";
|
|
16
|
+
ACTION["RENDERER_TTI"] = "tti";
|
|
15
17
|
ACTION["CRASHED"] = "unhandledErrorCaught";
|
|
16
18
|
ACTION["INVALID_PROSEMIRROR_DOCUMENT"] = "invalidProsemirrorDocument";
|
|
17
19
|
ACTION["SELECT_ALL_CAUGHT"] = "selectAllCaught";
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
1
4
|
import React from 'react';
|
|
2
|
-
import
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
3
6
|
import { alignmentPositionMap } from '@atlaskit/adf-schema';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
|
|
8
|
+
const MarkWrapper = props => {
|
|
9
|
+
const styles = props['data-align'] ? css`
|
|
10
|
+
text-align: ${alignmentPositionMap[props['data-align']]};
|
|
11
|
+
` : '';
|
|
12
|
+
return jsx("div", _extends({
|
|
13
|
+
css: styles
|
|
14
|
+
}, props), props.children);
|
|
15
|
+
};
|
|
16
|
+
|
|
9
17
|
export default function Alignment(props) {
|
|
10
|
-
return
|
|
18
|
+
return jsx(MarkWrapper, {
|
|
11
19
|
className: "fabric-editor-block-mark",
|
|
12
20
|
"data-align": props.align
|
|
13
21
|
}, props.children);
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
3
3
|
import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
4
4
|
import { calcBreakoutWidth } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
|
|
6
|
-
export const
|
|
6
|
+
export const wrapperStyles = css`
|
|
7
7
|
margin: ${blockNodesVerticalMargin} 0;
|
|
8
8
|
margin-left: 50%;
|
|
9
9
|
transform: translateX(-50%);
|
|
10
10
|
`;
|
|
11
11
|
export default function Breakout(props) {
|
|
12
|
-
return
|
|
12
|
+
return jsx(WidthConsumer, null, ({
|
|
13
13
|
width
|
|
14
|
-
}) =>
|
|
14
|
+
}) => jsx("div", {
|
|
15
|
+
css: wrapperStyles,
|
|
15
16
|
"data-mode": props.mode,
|
|
16
17
|
style: {
|
|
17
18
|
width: calcBreakoutWidth(props.mode, width)
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import React, { Fragment } from 'react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
3
6
|
import { B400, B300 } from '@atlaskit/theme/colors';
|
|
4
|
-
import styled from 'styled-components';
|
|
5
7
|
import { getEventHandler } from '../../utils';
|
|
6
8
|
import { PLATFORM, MODE } from '../../analytics/events';
|
|
7
9
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE } from '../../analytics/enums';
|
|
8
|
-
const
|
|
10
|
+
const anchorStyles = css`
|
|
9
11
|
color: ${B400};
|
|
10
12
|
|
|
11
13
|
&:hover {
|
|
@@ -35,10 +37,11 @@ export default function Link(props) {
|
|
|
35
37
|
const handler = getEventHandler(eventHandlers, 'link');
|
|
36
38
|
|
|
37
39
|
if (isMediaLink) {
|
|
38
|
-
return
|
|
40
|
+
return jsx(Fragment, null, props.children);
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
return
|
|
43
|
+
return jsx("a", _extends({
|
|
44
|
+
css: anchorStyles,
|
|
42
45
|
onClick: e => {
|
|
43
46
|
if (fireAnalyticsEvent) {
|
|
44
47
|
fireAnalyticsEvent({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx, css } from '@emotion/react';
|
|
2
3
|
import { injectIntl } from 'react-intl-next';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
4
|
import { CodeBlock as AkCodeBlock } from '@atlaskit/code';
|
|
5
5
|
import { overflowShadow, relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
import { N20, DN50 } from '@atlaskit/theme/colors';
|
|
@@ -10,6 +10,23 @@ import { codeBidiWarningMessages } from '@atlaskit/editor-common/messages';
|
|
|
10
10
|
import { useFeatureFlags } from '../../use-feature-flags';
|
|
11
11
|
import CopyButton from './codeBlockCopyButton';
|
|
12
12
|
|
|
13
|
+
const codeBlockStyle = props => css`
|
|
14
|
+
tab-size: 4;
|
|
15
|
+
[data-ds--code--code-block] {
|
|
16
|
+
font-size: ${relativeFontSizeToBase16(fontSize())};
|
|
17
|
+
line-height: 1.5rem;
|
|
18
|
+
background-image: ${overflowShadow({
|
|
19
|
+
background: themed({
|
|
20
|
+
light: N20,
|
|
21
|
+
dark: DN50
|
|
22
|
+
})(props),
|
|
23
|
+
width: `${gridSize()}px`
|
|
24
|
+
})};
|
|
25
|
+
background-attachment: local, scroll, scroll;
|
|
26
|
+
background-position: 100% 0, 100% 0, 0 0;
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
|
|
13
30
|
function CodeBlock(props) {
|
|
14
31
|
const {
|
|
15
32
|
text,
|
|
@@ -20,11 +37,12 @@ function CodeBlock(props) {
|
|
|
20
37
|
const featureFlags = useFeatureFlags();
|
|
21
38
|
const codeBidiWarningLabel = props.intl.formatMessage(codeBidiWarningMessages.label);
|
|
22
39
|
const className = ['code-block', props.className].join(' ');
|
|
23
|
-
return
|
|
24
|
-
className: className
|
|
25
|
-
|
|
40
|
+
return jsx("div", {
|
|
41
|
+
className: className,
|
|
42
|
+
css: codeBlockStyle
|
|
43
|
+
}, allowCopyToClipboard ? jsx(CopyButton, {
|
|
26
44
|
content: text
|
|
27
|
-
}) : null,
|
|
45
|
+
}) : null, jsx(AkCodeBlock, {
|
|
28
46
|
language: language,
|
|
29
47
|
text: text,
|
|
30
48
|
codeBidiWarnings: featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags.codeBidiWarnings,
|
|
@@ -33,20 +51,4 @@ function CodeBlock(props) {
|
|
|
33
51
|
}));
|
|
34
52
|
}
|
|
35
53
|
|
|
36
|
-
|
|
37
|
-
export default styled(IntlCodeBlock)`
|
|
38
|
-
tab-size: 4;
|
|
39
|
-
[data-ds--code--code-block] {
|
|
40
|
-
font-size: ${relativeFontSizeToBase16(fontSize())};
|
|
41
|
-
line-height: 1.5rem;
|
|
42
|
-
background-image: ${overflowShadow({
|
|
43
|
-
background: themed({
|
|
44
|
-
light: N20,
|
|
45
|
-
dark: DN50
|
|
46
|
-
}),
|
|
47
|
-
width: `${gridSize()}px`
|
|
48
|
-
})};
|
|
49
|
-
background-attachment: local, scroll, scroll;
|
|
50
|
-
background-position: 100% 0, 100% 0, 0 0;
|
|
51
|
-
}
|
|
52
|
-
`;
|
|
54
|
+
export default injectIntl(CodeBlock);
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { css, jsx } from '@emotion/react';
|
|
1
3
|
import React, { useState } from 'react';
|
|
2
4
|
import { injectIntl } from 'react-intl-next';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
5
|
import Tooltip from '@atlaskit/tooltip';
|
|
5
6
|
import Button from '@atlaskit/button/custom-theme-button';
|
|
6
7
|
import CopyIcon from '@atlaskit/icon/glyph/copy';
|
|
7
8
|
import { N20, N30, N700 } from '@atlaskit/theme/colors';
|
|
8
9
|
import { CopyTextConsumer } from './copy-text-provider';
|
|
9
10
|
import { codeBlockCopyButtonMessages } from '../../messages';
|
|
10
|
-
const
|
|
11
|
+
const copyButtonWrapperStyles = css`
|
|
11
12
|
display: flex;
|
|
12
13
|
position: sticky;
|
|
13
14
|
justify-content: flex-end;
|
|
@@ -24,7 +25,7 @@ const CopyButtonWrapper = styled.span`
|
|
|
24
25
|
padding: 2px;
|
|
25
26
|
opacity: 0;
|
|
26
27
|
transition: opacity 0.2s ease 0s;
|
|
27
|
-
border: 2px solid #
|
|
28
|
+
border: 2px solid #fff;
|
|
28
29
|
border-radius: 4px;
|
|
29
30
|
background-color: ${N20};
|
|
30
31
|
color: rgb(66, 82, 110);
|
|
@@ -36,7 +37,7 @@ const CopyButtonWrapper = styled.span`
|
|
|
36
37
|
|
|
37
38
|
button.clicked {
|
|
38
39
|
background-color: ${N700};
|
|
39
|
-
color: #
|
|
40
|
+
color: #fff !important;
|
|
40
41
|
}
|
|
41
42
|
`;
|
|
42
43
|
|
|
@@ -52,22 +53,24 @@ const CopyButton = ({
|
|
|
52
53
|
setClassName('copy-to-clipboard');
|
|
53
54
|
};
|
|
54
55
|
|
|
55
|
-
return
|
|
56
|
+
return jsx(CopyTextConsumer, null, ({
|
|
56
57
|
copyTextToClipboard
|
|
57
58
|
}) => {
|
|
58
|
-
return
|
|
59
|
+
return jsx("span", {
|
|
60
|
+
css: copyButtonWrapperStyles
|
|
61
|
+
}, jsx(Tooltip, {
|
|
59
62
|
content: tooltip,
|
|
60
63
|
hideTooltipOnClick: false,
|
|
61
64
|
position: "top"
|
|
62
|
-
},
|
|
65
|
+
}, jsx("div", {
|
|
63
66
|
onMouseLeave: onMouseLeave
|
|
64
|
-
},
|
|
67
|
+
}, jsx(Button, {
|
|
65
68
|
className: className,
|
|
66
69
|
"aria-label": tooltip,
|
|
67
70
|
spacing: "compact",
|
|
68
71
|
appearance: "subtle",
|
|
69
72
|
"aria-haspopup": true,
|
|
70
|
-
iconBefore:
|
|
73
|
+
iconBefore: jsx(CopyIcon, {
|
|
71
74
|
label: tooltip
|
|
72
75
|
}),
|
|
73
76
|
onClick: () => {
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
5
|
+
import { useMemo, useContext, useState, useRef } from 'react';
|
|
3
6
|
import { Card, Context as CardContext, EmbedResizeMessageListener } from '@atlaskit/smart-card';
|
|
4
7
|
import { WidthConsumer, mapBreakpointToLayoutMaxWidth, UnsupportedBlock, MediaSingle as UIMediaSingle } from '@atlaskit/editor-common/ui';
|
|
5
8
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH, getAkEditorFullPageMaxWidth } from '@atlaskit/editor-shared-styles';
|
|
6
9
|
import { getPlatform } from '../../utils';
|
|
7
10
|
import { CardErrorBoundary } from './fallback';
|
|
8
|
-
import styled from 'styled-components';
|
|
9
11
|
import { FullPagePadding } from '../../ui/Renderer/style';
|
|
10
12
|
import { getCardClickHandler } from '../utils/getCardClickHandler';
|
|
11
|
-
const
|
|
13
|
+
const embedCardWrapperStyles = css`
|
|
12
14
|
width: 100%;
|
|
13
15
|
height: 100%;
|
|
14
16
|
|
|
@@ -22,16 +24,10 @@ const EmbedCardWrapper = styled.div`
|
|
|
22
24
|
|
|
23
25
|
margin: 0 auto;
|
|
24
26
|
`;
|
|
25
|
-
|
|
26
|
-
const ExtendedEmbedCard = styled(UIMediaSingle)`
|
|
27
|
-
${({
|
|
28
|
-
layout
|
|
29
|
-
}) => layout === 'full-width' || layout === 'wide' ? `
|
|
27
|
+
const uIMediaSingleLayoutStyles = css`
|
|
30
28
|
margin-left: 50%;
|
|
31
29
|
transform: translateX(-50%);
|
|
32
|
-
` : ``}
|
|
33
30
|
`;
|
|
34
|
-
ExtendedEmbedCard.displayName = 'ExtendedEmbedCard';
|
|
35
31
|
export default function EmbedCard(props) {
|
|
36
32
|
const {
|
|
37
33
|
url,
|
|
@@ -97,7 +93,7 @@ export default function EmbedCard(props) {
|
|
|
97
93
|
setAspectRatio(resolvedAspectRatio);
|
|
98
94
|
};
|
|
99
95
|
|
|
100
|
-
return
|
|
96
|
+
return jsx(WidthConsumer, null, ({
|
|
101
97
|
width: containerWidth,
|
|
102
98
|
breakpoint
|
|
103
99
|
}) => {
|
|
@@ -117,12 +113,14 @@ export default function EmbedCard(props) {
|
|
|
117
113
|
}
|
|
118
114
|
|
|
119
115
|
const lineLength = isFullWidth ? Math.min(akEditorFullWidthLayoutWidth, containerWidth - padding) : nonFullWidthSize;
|
|
120
|
-
|
|
116
|
+
const uiMediaSingleStyles = layout === 'full-width' || layout === 'wide' ? uIMediaSingleLayoutStyles : '';
|
|
117
|
+
return jsx(CardErrorBoundary, _extends({
|
|
121
118
|
unsupportedComponent: UnsupportedBlock
|
|
122
|
-
}, cardProps),
|
|
119
|
+
}, cardProps), jsx(EmbedResizeMessageListener, {
|
|
123
120
|
embedIframeRef: embedIframeRef,
|
|
124
121
|
onHeightUpdate: setLiveHeight
|
|
125
|
-
},
|
|
122
|
+
}, jsx(UIMediaSingle, {
|
|
123
|
+
css: uiMediaSingleStyles,
|
|
126
124
|
layout: layout,
|
|
127
125
|
width: originalWidth,
|
|
128
126
|
containerWidth: containerWidth,
|
|
@@ -132,7 +130,9 @@ export default function EmbedCard(props) {
|
|
|
132
130
|
nodeType: "embedCard",
|
|
133
131
|
lineLength: isInsideOfBlockNode ? containerWidth : lineLength,
|
|
134
132
|
hasFallbackContainer: hasPreview
|
|
135
|
-
},
|
|
133
|
+
}, jsx("div", {
|
|
134
|
+
css: embedCardWrapperStyles
|
|
135
|
+
}, jsx("div", {
|
|
136
136
|
className: "embedCardView-content-wrap",
|
|
137
137
|
"data-embed-card": true,
|
|
138
138
|
"data-layout": layout,
|
|
@@ -140,7 +140,7 @@ export default function EmbedCard(props) {
|
|
|
140
140
|
"data-card-data": data ? JSON.stringify(data) : undefined,
|
|
141
141
|
"data-card-url": url,
|
|
142
142
|
"data-card-original-height": originalHeight
|
|
143
|
-
},
|
|
143
|
+
}, jsx(Card, _extends({
|
|
144
144
|
appearance: "embed"
|
|
145
145
|
}, cardProps, {
|
|
146
146
|
onResolve: onResolve,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
|
|
4
|
+
/** @jsx jsx */
|
|
3
5
|
import React from 'react';
|
|
4
|
-
import
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
5
7
|
import { N200, N500, B400 } from '@atlaskit/theme/colors';
|
|
6
8
|
import LinkIcon from '@atlaskit/icon/glyph/link';
|
|
7
9
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -13,12 +15,12 @@ const CopyAnchorWrapperWithRef = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
13
15
|
children,
|
|
14
16
|
...rest
|
|
15
17
|
} = props;
|
|
16
|
-
return
|
|
18
|
+
return jsx("span", _extends({}, rest, {
|
|
17
19
|
className: HeadingAnchorWrapperClassName,
|
|
18
20
|
ref: ref
|
|
19
21
|
}), children);
|
|
20
22
|
});
|
|
21
|
-
const
|
|
23
|
+
const copyAnchorButtonStyles = css`
|
|
22
24
|
display: inline;
|
|
23
25
|
outline: none;
|
|
24
26
|
background-color: transparent;
|
|
@@ -72,11 +74,12 @@ class HeadingAnchor extends React.PureComponent {
|
|
|
72
74
|
});
|
|
73
75
|
|
|
74
76
|
_defineProperty(this, "renderAnchorButton", () => {
|
|
75
|
-
return
|
|
77
|
+
return jsx("button", {
|
|
78
|
+
css: copyAnchorButtonStyles,
|
|
76
79
|
onMouseLeave: this.resetMessage,
|
|
77
80
|
onClick: this.copyToClipboard,
|
|
78
81
|
"aria-label": this.state.tooltipMessage
|
|
79
|
-
},
|
|
82
|
+
}, jsx(LinkIcon, {
|
|
80
83
|
label: this.getCopyAriaLabel(),
|
|
81
84
|
size: this.props.level > 3 ? 'small' : 'medium',
|
|
82
85
|
primaryColor: this.state.isClicked ? B400 : N200
|
|
@@ -97,7 +100,7 @@ class HeadingAnchor extends React.PureComponent {
|
|
|
97
100
|
// We set the key to the message to ensure it remounts when the message
|
|
98
101
|
// changes, so that it correctly repositions.
|
|
99
102
|
// @see https://ecosystem.atlassian.net/projects/AK/queues/issue/AK-6548
|
|
100
|
-
return
|
|
103
|
+
return jsx(Tooltip, {
|
|
101
104
|
tag: CopyAnchorWrapperWithRef,
|
|
102
105
|
content: tooltipMessage,
|
|
103
106
|
position: "top",
|