@atlaskit/renderer 93.0.4 → 95.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 +29 -0
- package/dist/cjs/react/marks/link.js +3 -1
- package/dist/cjs/react/nodes/codeBlock.js +5 -0
- package/dist/cjs/react/nodes/codeBlockCopyButton.js +3 -1
- package/dist/cjs/react/nodes/heading-anchor.js +4 -2
- package/dist/cjs/react/nodes/table/sticky.js +19 -17
- package/dist/cjs/render-document.js +141 -54
- package/dist/cjs/ui/Renderer/index.js +19 -23
- package/dist/cjs/ui/Renderer/style.js +30 -28
- package/dist/cjs/ui/Renderer/truncated-wrapper.js +6 -3
- package/dist/cjs/ui/SortingIcon.js +6 -2
- package/dist/cjs/ui/annotations/draft/component.js +1 -1
- package/dist/cjs/ui/annotations/element/mark.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/react/marks/link.js +8 -3
- package/dist/es2019/react/nodes/codeBlock.js +5 -0
- package/dist/es2019/react/nodes/codeBlockCopyButton.js +7 -6
- package/dist/es2019/react/nodes/heading-anchor.js +3 -2
- package/dist/es2019/react/nodes/table/sticky.js +28 -24
- package/dist/es2019/render-document.js +116 -55
- package/dist/es2019/ui/Renderer/index.js +3 -8
- package/dist/es2019/ui/Renderer/style.js +34 -29
- package/dist/es2019/ui/Renderer/truncated-wrapper.js +5 -3
- package/dist/es2019/ui/SortingIcon.js +7 -5
- package/dist/es2019/ui/annotations/draft/component.js +1 -1
- package/dist/es2019/ui/annotations/element/mark.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/react/marks/link.js +3 -2
- package/dist/esm/react/nodes/codeBlock.js +5 -0
- package/dist/esm/react/nodes/codeBlockCopyButton.js +2 -1
- package/dist/esm/react/nodes/heading-anchor.js +3 -2
- package/dist/esm/react/nodes/table/sticky.js +18 -18
- package/dist/esm/render-document.js +136 -54
- package/dist/esm/ui/Renderer/index.js +19 -23
- package/dist/esm/ui/Renderer/style.js +29 -28
- package/dist/esm/ui/Renderer/truncated-wrapper.js +5 -3
- package/dist/esm/ui/SortingIcon.js +5 -3
- package/dist/esm/ui/annotations/draft/component.js +1 -1
- package/dist/esm/ui/annotations/element/mark.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/render-document.d.ts +1 -1
- package/package.json +22 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 95.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 95.0.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`bd24b9d71d2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/bd24b9d71d2) - [ux] Instrumented `@atlaskit/renderer` with the new theming package, `@atlaskit/tokens`.
|
|
14
|
+
|
|
15
|
+
New tokens will be visible only in applications configured to use the new Tokens API (currently in alpha).
|
|
16
|
+
These changes are intended to be interoperable with the legacy theme implementation. Legacy dark mode users should expect no visual or breaking changes.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [`ccde3d9eb43`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ccde3d9eb43) - [ux] ED-10335: memoize schema, validation and serialization for Renderer
|
|
21
|
+
- [`59e17ae76c1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/59e17ae76c1) - [ux] ED-14961-table-sticky-header-overlap-popup
|
|
22
|
+
- [`47a59c220af`](https://bitbucket.org/atlassian/atlassian-frontend/commits/47a59c220af) - [ux] ED-10334: memoised schema.nodeFromJSON() and node.check() in Renderer.renderDocument()
|
|
23
|
+
- [`08edcd36c6f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/08edcd36c6f) - [ux] Convert RGB color usage to Design Tokens. This change is backwards compatible with existing theming
|
|
24
|
+
- Updated dependencies
|
|
25
|
+
|
|
26
|
+
## 94.0.0
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies
|
|
31
|
+
|
|
3
32
|
## 93.0.4
|
|
4
33
|
|
|
5
34
|
### Patch Changes
|
|
@@ -25,13 +25,15 @@ var _events = require("../../analytics/events");
|
|
|
25
25
|
|
|
26
26
|
var _enums = require("../../analytics/enums");
|
|
27
27
|
|
|
28
|
+
var _tokens = require("@atlaskit/tokens");
|
|
29
|
+
|
|
28
30
|
var _templateObject;
|
|
29
31
|
|
|
30
32
|
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
33
|
|
|
32
34
|
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
35
|
|
|
34
|
-
var anchorStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n"])), _colors.B400, _colors.B300);
|
|
36
|
+
var anchorStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:active {\n color: ", ";\n }\n"])), (0, _tokens.token)('color.link', _colors.B400), (0, _tokens.token)('color.link', _colors.B300), (0, _tokens.token)('color.link.pressed', _colors.B500));
|
|
35
37
|
|
|
36
38
|
function Link(props) {
|
|
37
39
|
var href = props.href,
|
|
@@ -31,6 +31,9 @@ var _codeBlockCopyButton = _interopRequireDefault(require("./codeBlockCopyButton
|
|
|
31
31
|
|
|
32
32
|
var _templateObject;
|
|
33
33
|
|
|
34
|
+
// TODO: Quality ticket https://product-fabric.atlassian.net/browse/DSP-4118
|
|
35
|
+
|
|
36
|
+
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
34
37
|
var codeBlockStyle = function codeBlockStyle(props) {
|
|
35
38
|
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n tab-size: 4;\n [data-ds--code--code-block] {\n font-size: ", ";\n line-height: 1.5rem;\n background-image: ", ";\n background-attachment: local, scroll, scroll;\n background-position: 100% 0, 100% 0, 0 0;\n }\n "])), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _editorSharedStyles.overflowShadow)({
|
|
36
39
|
background: (0, _components.themed)({
|
|
@@ -40,6 +43,8 @@ var codeBlockStyle = function codeBlockStyle(props) {
|
|
|
40
43
|
width: "".concat((0, _constants.gridSize)(), "px")
|
|
41
44
|
}));
|
|
42
45
|
};
|
|
46
|
+
/* eslint-enable */
|
|
47
|
+
|
|
43
48
|
|
|
44
49
|
function CodeBlock(props) {
|
|
45
50
|
var text = props.text,
|
|
@@ -31,13 +31,15 @@ var _copyTextProvider = require("./copy-text-provider");
|
|
|
31
31
|
|
|
32
32
|
var _messages = require("../../messages");
|
|
33
33
|
|
|
34
|
+
var _tokens = require("@atlaskit/tokens");
|
|
35
|
+
|
|
34
36
|
var _templateObject;
|
|
35
37
|
|
|
36
38
|
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); }
|
|
37
39
|
|
|
38
40
|
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; }
|
|
39
41
|
|
|
40
|
-
var copyButtonWrapperStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n position: sticky;\n justify-content: flex-end;\n top: 0;\n\n button {\n position: absolute;\n display: flex;\n justify-content: center;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n opacity: 0;\n transition: opacity 0.2s ease 0s;\n border: 2px solid
|
|
42
|
+
var copyButtonWrapperStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n position: sticky;\n justify-content: flex-end;\n top: 0;\n\n button {\n position: absolute;\n display: flex;\n justify-content: center;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n opacity: 0;\n transition: opacity 0.2s ease 0s;\n border: 2px solid ", ";\n border-radius: 4px;\n background-color: ", ";\n color: ", ";\n }\n\n button:hover {\n background-color: ", ";\n }\n\n button.clicked {\n background-color: ", ";\n color: ", " !important;\n }\n"])), (0, _tokens.token)('color.border.inverse', '#fff'), (0, _tokens.token)('color.background.neutral.subtle', _colors.N20), (0, _tokens.token)('color.icon', 'rgb(66, 82, 110)'), (0, _tokens.token)('color.background.neutral.hovered', _colors.N30), (0, _tokens.token)('color.background.neutral.bold.pressed', _colors.N700), (0, _tokens.token)('color.icon.inverse', '#fff'));
|
|
41
43
|
|
|
42
44
|
var CopyButton = function CopyButton(_ref) {
|
|
43
45
|
var content = _ref.content,
|
|
@@ -45,6 +45,8 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
45
45
|
|
|
46
46
|
var _messages = require("../../messages");
|
|
47
47
|
|
|
48
|
+
var _tokens = require("@atlaskit/tokens");
|
|
49
|
+
|
|
48
50
|
var _templateObject;
|
|
49
51
|
|
|
50
52
|
var _excluded = ["children"];
|
|
@@ -65,7 +67,7 @@ var CopyAnchorWrapperWithRef = /*#__PURE__*/_react.default.forwardRef(function (
|
|
|
65
67
|
}), children);
|
|
66
68
|
});
|
|
67
69
|
|
|
68
|
-
var copyAnchorButtonStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: inline;\n outline: none;\n background-color: transparent;\n border: none;\n color: ", ";\n cursor: pointer;\n right: 0;\n"])), _colors.N500);
|
|
70
|
+
var copyAnchorButtonStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: inline;\n outline: none;\n background-color: transparent;\n border: none;\n color: ", ";\n cursor: pointer;\n right: 0;\n"])), (0, _tokens.token)('color.icon', _colors.N500));
|
|
69
71
|
|
|
70
72
|
var HeadingAnchor = /*#__PURE__*/function (_React$PureComponent) {
|
|
71
73
|
(0, _inherits2.default)(HeadingAnchor, _React$PureComponent);
|
|
@@ -148,7 +150,7 @@ var HeadingAnchor = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
148
150
|
}, (0, _react2.jsx)(_link.default, {
|
|
149
151
|
label: _this.getCopyAriaLabel(),
|
|
150
152
|
size: _this.props.level > 3 ? 'small' : 'medium',
|
|
151
|
-
primaryColor: _this.state.isClicked ? _colors.B400 : _colors.N200
|
|
153
|
+
primaryColor: _this.state.isClicked ? (0, _tokens.token)('color.icon.selected', _colors.B400) : (0, _tokens.token)('color.icon.subtle', _colors.N200)
|
|
152
154
|
}));
|
|
153
155
|
});
|
|
154
156
|
return _this;
|
|
@@ -13,6 +13,8 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
13
13
|
|
|
14
14
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
15
|
|
|
16
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
17
|
+
|
|
16
18
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
17
19
|
|
|
18
20
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -25,46 +27,46 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
25
27
|
|
|
26
28
|
var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
27
29
|
|
|
30
|
+
var _tokens = require("@atlaskit/tokens");
|
|
31
|
+
|
|
28
32
|
var _utils = require("../../../utils");
|
|
29
33
|
|
|
30
34
|
var _table = require("./table");
|
|
31
35
|
|
|
32
36
|
var _injectProps = require("../../utils/inject-props");
|
|
33
37
|
|
|
34
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
38
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
35
39
|
|
|
36
40
|
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); }
|
|
37
41
|
|
|
38
42
|
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; }
|
|
39
43
|
|
|
44
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
40
45
|
var N40A = colors.N40A;
|
|
41
46
|
var tableStickyPadding = 8;
|
|
42
47
|
exports.tableStickyPadding = tableStickyPadding;
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
var getModeSpecificStyles = function getModeSpecificStyles(mode) {
|
|
49
|
-
if (mode === 'none') {
|
|
50
|
-
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: none;\n "])));
|
|
51
|
-
} else {
|
|
52
|
-
return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: ", ";\n "])), fixedTableDivModeToPosition[mode]);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
48
|
+
var modeSpecficStyles = {
|
|
49
|
+
none: (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: none;\n "]))),
|
|
50
|
+
stick: (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n position: fixed;\n "]))),
|
|
51
|
+
'pin-bottom': (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n position: absolute;\n "])))
|
|
52
|
+
}; // TODO: Quality ticket: https://product-fabric.atlassian.net/browse/DSP-4123
|
|
55
53
|
|
|
56
54
|
var fixedTableDivStaticStyles = function fixedTableDivStaticStyles(top, width) {
|
|
57
|
-
return (0, _react2.css)(
|
|
55
|
+
return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", "\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\n ", ";\n background: ", ";\n box-shadow: ", ";\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"])), typeof top === 'number' && "top: ".concat(top, "px;"), width, _editorSharedStyles.akEditorStickyHeaderZIndex, _styles.TableSharedCssClassName.TABLE_CONTAINER, _styles.TableSharedCssClassName.TABLE_STICKY_WRAPPER, tableStickyPadding, (0, _tokens.token)('elevation.surface', 'white'), (0, _tokens.token)('elevation.surface.overlay', 'white'), (0, _tokens.token)('elevation.shadow.overflow', "0 6px 4px -4px ".concat(N40A)), _styles.TableSharedCssClassName.TABLE_CONTAINER, _styles.TableSharedCssClassName.TABLE_CONTAINER);
|
|
58
56
|
};
|
|
59
57
|
|
|
60
58
|
var FixedTableDiv = function FixedTableDiv(props) {
|
|
61
59
|
var top = props.top,
|
|
62
60
|
wrapperWidth = props.wrapperWidth,
|
|
63
61
|
mode = props.mode;
|
|
64
|
-
var fixedTableCss = [fixedTableDivStaticStyles(top, wrapperWidth),
|
|
65
|
-
|
|
62
|
+
var fixedTableCss = [fixedTableDivStaticStyles(top, wrapperWidth), modeSpecficStyles === null || modeSpecficStyles === void 0 ? void 0 : modeSpecficStyles[mode]];
|
|
63
|
+
var attrs = {
|
|
64
|
+
mode: mode
|
|
65
|
+
};
|
|
66
|
+
return (0, _react2.jsx)("div", (0, _extends2.default)({}, attrs, {
|
|
67
|
+
"data-testid": "sticky-table-fixed",
|
|
66
68
|
css: fixedTableCss
|
|
67
|
-
}, props.children);
|
|
69
|
+
}), props.children);
|
|
68
70
|
};
|
|
69
71
|
|
|
70
72
|
exports.FixedTableDiv = FixedTableDiv;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.renderDocument = void 0;
|
|
7
9
|
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
13
|
+
|
|
8
14
|
var _schemaDefault = require("@atlaskit/adf-schema/schema-default");
|
|
9
15
|
|
|
10
16
|
var _validator = require("@atlaskit/editor-common/validator");
|
|
@@ -32,6 +38,138 @@ var withStopwatch = function withStopwatch(cb) {
|
|
|
32
38
|
};
|
|
33
39
|
};
|
|
34
40
|
|
|
41
|
+
var _validation = function _validation(doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent) {
|
|
42
|
+
var result;
|
|
43
|
+
|
|
44
|
+
if (useSpecBasedValidator) {
|
|
45
|
+
// link mark on mediaSingle is deprecated, need to move link mark to child media node
|
|
46
|
+
// https://product-fabric.atlassian.net/browse/ED-14043
|
|
47
|
+
var _transformMediaLinkMa = (0, _adfUtils.transformMediaLinkMarks)(doc),
|
|
48
|
+
transformedAdf = _transformMediaLinkMa.transformedAdf,
|
|
49
|
+
isTransformed = _transformMediaLinkMa.isTransformed;
|
|
50
|
+
|
|
51
|
+
if (isTransformed && dispatchAnalyticsEvent) {
|
|
52
|
+
dispatchAnalyticsEvent({
|
|
53
|
+
action: _enums.ACTION.MEDIA_LINK_TRANSFORMED,
|
|
54
|
+
actionSubject: _enums.ACTION_SUBJECT.RENDERER,
|
|
55
|
+
eventType: _enums.EVENT_TYPE.OPERATIONAL
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
result = (0, _utils.validateADFEntity)(schema, transformedAdf || doc, dispatchAnalyticsEvent);
|
|
60
|
+
} else {
|
|
61
|
+
result = (0, _validator.getValidDocument)(doc, schema, adfStage);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (!result) {
|
|
65
|
+
return result;
|
|
66
|
+
} // ProseMirror always require a child under doc
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
if (result.type === 'doc' && useSpecBasedValidator) {
|
|
70
|
+
if (Array.isArray(result.content) && result.content.length === 0) {
|
|
71
|
+
result.content.push({
|
|
72
|
+
type: 'paragraph',
|
|
73
|
+
content: []
|
|
74
|
+
});
|
|
75
|
+
} // Just making sure doc is always valid
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
if (!result.version) {
|
|
79
|
+
result.version = 1;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return result;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
var memoValidation = (0, _memoizeOne.default)(_validation, function (newArgs, lastArgs) {
|
|
87
|
+
var _newArgs = (0, _slicedToArray2.default)(newArgs, 4),
|
|
88
|
+
newDoc = _newArgs[0],
|
|
89
|
+
newSchema = _newArgs[1],
|
|
90
|
+
newADFStage = _newArgs[2],
|
|
91
|
+
newUseSpecValidator = _newArgs[3];
|
|
92
|
+
|
|
93
|
+
var _lastArgs = (0, _slicedToArray2.default)(lastArgs, 4),
|
|
94
|
+
oldDoc = _lastArgs[0],
|
|
95
|
+
oldSchema = _lastArgs[1],
|
|
96
|
+
oldADFStage = _lastArgs[2],
|
|
97
|
+
oldUseSpecValidator = _lastArgs[3]; // we're ignoring changes to dispatchAnalyticsEvent in this check
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
var result = areDocsEqual(newDoc, oldDoc) && newSchema === oldSchema && newADFStage === oldADFStage && newUseSpecValidator === oldUseSpecValidator;
|
|
101
|
+
return result;
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
var areDocsEqual = function areDocsEqual(docA, docB) {
|
|
105
|
+
if (docA === docB) {
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (typeof docA === 'string' && typeof docB === 'string') {
|
|
110
|
+
return docA === docB;
|
|
111
|
+
} // PMNode
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
if (docA.type && docA.toJSON && docB.type && docB.toJSON) {
|
|
115
|
+
return JSON.stringify(docA.toJSON()) === JSON.stringify(docB.toJSON());
|
|
116
|
+
} // Object
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
return JSON.stringify(docA) === JSON.stringify(docB);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
var _serializeFragment = function _serializeFragment(serializer, doc) {
|
|
123
|
+
return serializer.serializeFragment(doc.content);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
var memoSerializeFragment = (0, _memoizeOne.default)(_serializeFragment, function (newArgs, lastArgs) {
|
|
127
|
+
var _newArgs2 = (0, _slicedToArray2.default)(newArgs, 2),
|
|
128
|
+
newSerializer = _newArgs2[0],
|
|
129
|
+
newDoc = _newArgs2[1];
|
|
130
|
+
|
|
131
|
+
var _lastArgs2 = (0, _slicedToArray2.default)(lastArgs, 2),
|
|
132
|
+
oldSerializer = _lastArgs2[0],
|
|
133
|
+
oldDoc = _lastArgs2[1];
|
|
134
|
+
|
|
135
|
+
return newSerializer === oldSerializer && areDocsEqual(newDoc, oldDoc);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
var _createNodeAndCheck = function _createNodeAndCheck(schema, doc, dispatchAnalyticsEvent) {
|
|
139
|
+
var pmNode = schema.nodeFromJSON(doc);
|
|
140
|
+
|
|
141
|
+
try {
|
|
142
|
+
pmNode.check();
|
|
143
|
+
} catch (err) {
|
|
144
|
+
if (dispatchAnalyticsEvent) {
|
|
145
|
+
dispatchAnalyticsEvent({
|
|
146
|
+
action: _enums.ACTION.INVALID_PROSEMIRROR_DOCUMENT,
|
|
147
|
+
actionSubject: _enums.ACTION_SUBJECT.RENDERER,
|
|
148
|
+
attributes: {
|
|
149
|
+
platform: _events.PLATFORM.WEB,
|
|
150
|
+
error: err === null || err === void 0 ? void 0 : err.toString()
|
|
151
|
+
},
|
|
152
|
+
eventType: _enums.EVENT_TYPE.OPERATIONAL
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
return pmNode;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
var memoCreateNodeAndCheck = (0, _memoizeOne.default)(_createNodeAndCheck, function (newArgs, lastArgs) {
|
|
161
|
+
// ignore dispatchAnalyticsEvent
|
|
162
|
+
var _newArgs3 = (0, _slicedToArray2.default)(newArgs, 2),
|
|
163
|
+
newSchema = _newArgs3[0],
|
|
164
|
+
newDoc = _newArgs3[1];
|
|
165
|
+
|
|
166
|
+
var _lastArgs3 = (0, _slicedToArray2.default)(lastArgs, 2),
|
|
167
|
+
oldSchema = _lastArgs3[0],
|
|
168
|
+
oldDoc = _lastArgs3[1];
|
|
169
|
+
|
|
170
|
+
return newSchema === oldSchema && areDocsEqual(newDoc, oldDoc);
|
|
171
|
+
});
|
|
172
|
+
|
|
35
173
|
var renderDocument = function renderDocument(doc, serializer) {
|
|
36
174
|
var schema = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _schemaDefault.defaultSchema;
|
|
37
175
|
var adfStage = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'final';
|
|
@@ -45,25 +183,7 @@ var renderDocument = function renderDocument(doc, serializer) {
|
|
|
45
183
|
};
|
|
46
184
|
|
|
47
185
|
var _withStopwatch = withStopwatch(function () {
|
|
48
|
-
|
|
49
|
-
// link mark on mediaSingle is deprecated, need to move link mark to child media node
|
|
50
|
-
// https://product-fabric.atlassian.net/browse/ED-14043
|
|
51
|
-
var _transformMediaLinkMa = (0, _adfUtils.transformMediaLinkMarks)(doc),
|
|
52
|
-
transformedAdf = _transformMediaLinkMa.transformedAdf,
|
|
53
|
-
isTransformed = _transformMediaLinkMa.isTransformed;
|
|
54
|
-
|
|
55
|
-
if (isTransformed && dispatchAnalyticsEvent) {
|
|
56
|
-
dispatchAnalyticsEvent({
|
|
57
|
-
action: _enums.ACTION.MEDIA_LINK_TRANSFORMED,
|
|
58
|
-
actionSubject: _enums.ACTION_SUBJECT.RENDERER,
|
|
59
|
-
eventType: _enums.EVENT_TYPE.OPERATIONAL
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return (0, _utils.validateADFEntity)(schema, transformedAdf || doc, dispatchAnalyticsEvent);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return (0, _validator.getValidDocument)(doc, schema, adfStage);
|
|
186
|
+
return memoValidation(doc, schema, adfStage, useSpecBasedValidator, dispatchAnalyticsEvent);
|
|
67
187
|
}),
|
|
68
188
|
validDoc = _withStopwatch.output,
|
|
69
189
|
sanitizeTime = _withStopwatch.time; // save sanitize time to stats
|
|
@@ -76,43 +196,10 @@ var renderDocument = function renderDocument(doc, serializer) {
|
|
|
76
196
|
stat: stat,
|
|
77
197
|
result: null
|
|
78
198
|
};
|
|
79
|
-
} // ProseMirror always require a child under doc
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (validDoc.type === 'doc' && useSpecBasedValidator) {
|
|
83
|
-
if (Array.isArray(validDoc.content) && validDoc.content.length === 0) {
|
|
84
|
-
validDoc.content.push({
|
|
85
|
-
type: 'paragraph',
|
|
86
|
-
content: []
|
|
87
|
-
});
|
|
88
|
-
} // Just making sure doc is always valid
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (!validDoc.version) {
|
|
92
|
-
validDoc.version = 1;
|
|
93
|
-
}
|
|
94
199
|
}
|
|
95
200
|
|
|
96
201
|
var _withStopwatch2 = withStopwatch(function () {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
try {
|
|
100
|
-
pmNode.check();
|
|
101
|
-
} catch (err) {
|
|
102
|
-
if (dispatchAnalyticsEvent) {
|
|
103
|
-
dispatchAnalyticsEvent({
|
|
104
|
-
action: _enums.ACTION.INVALID_PROSEMIRROR_DOCUMENT,
|
|
105
|
-
actionSubject: _enums.ACTION_SUBJECT.RENDERER,
|
|
106
|
-
attributes: {
|
|
107
|
-
platform: _events.PLATFORM.WEB,
|
|
108
|
-
error: err === null || err === void 0 ? void 0 : err.toString()
|
|
109
|
-
},
|
|
110
|
-
eventType: _enums.EVENT_TYPE.OPERATIONAL
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
return pmNode;
|
|
202
|
+
return memoCreateNodeAndCheck(schema, validDoc, dispatchAnalyticsEvent);
|
|
116
203
|
}),
|
|
117
204
|
node = _withStopwatch2.output,
|
|
118
205
|
buildTreeTime = _withStopwatch2.time; // save build tree time to stats
|
|
@@ -121,7 +208,7 @@ var renderDocument = function renderDocument(doc, serializer) {
|
|
|
121
208
|
stat.buildTreeTime = buildTreeTime;
|
|
122
209
|
|
|
123
210
|
var _withStopwatch3 = withStopwatch(function () {
|
|
124
|
-
return serializer
|
|
211
|
+
return memoSerializeFragment(serializer, node);
|
|
125
212
|
}),
|
|
126
213
|
result = _withStopwatch3.output,
|
|
127
214
|
serializeTime = _withStopwatch3.time; // save serialize tree time to stats
|
|
@@ -132,17 +132,13 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
132
132
|
createAnalyticsEvent(event).fire(channel);
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getSchema", function () {
|
|
136
|
-
var _this$props = _this.props,
|
|
137
|
-
schema = _this$props.schema,
|
|
138
|
-
adfStage = _this$props.adfStage;
|
|
139
|
-
|
|
135
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getSchema", (0, _memoizeOne.default)(function (schema, adfStage) {
|
|
140
136
|
if (schema) {
|
|
141
137
|
return schema;
|
|
142
138
|
}
|
|
143
139
|
|
|
144
140
|
return (0, _schemaDefault.getSchemaBasedOnStage)(adfStage);
|
|
145
|
-
});
|
|
141
|
+
}));
|
|
146
142
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onMouseDownEditView", function () {
|
|
147
143
|
// When the user is deselecting text on the screen by clicking, if they are clicking outside
|
|
148
144
|
// the current selection, by the time the onclick handler is called the window.getSelection()
|
|
@@ -293,22 +289,22 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
293
289
|
value: function render() {
|
|
294
290
|
var _this3 = this;
|
|
295
291
|
|
|
296
|
-
var _this$
|
|
297
|
-
document = _this$
|
|
298
|
-
onComplete = _this$
|
|
299
|
-
onError = _this$
|
|
300
|
-
appearance = _this$
|
|
301
|
-
adfStage = _this$
|
|
302
|
-
allowDynamicTextSizing = _this$
|
|
303
|
-
truncated = _this$
|
|
304
|
-
maxHeight = _this$
|
|
305
|
-
fadeOutHeight = _this$
|
|
306
|
-
enableSsrInlineScripts = _this$
|
|
307
|
-
allowHeadingAnchorLinks = _this$
|
|
308
|
-
allowPlaceholderText = _this$
|
|
309
|
-
allowColumnSorting = _this$
|
|
310
|
-
allowCopyToClipboard = _this$
|
|
311
|
-
allowCustomPanels = _this$
|
|
292
|
+
var _this$props = this.props,
|
|
293
|
+
document = _this$props.document,
|
|
294
|
+
onComplete = _this$props.onComplete,
|
|
295
|
+
onError = _this$props.onError,
|
|
296
|
+
appearance = _this$props.appearance,
|
|
297
|
+
adfStage = _this$props.adfStage,
|
|
298
|
+
allowDynamicTextSizing = _this$props.allowDynamicTextSizing,
|
|
299
|
+
truncated = _this$props.truncated,
|
|
300
|
+
maxHeight = _this$props.maxHeight,
|
|
301
|
+
fadeOutHeight = _this$props.fadeOutHeight,
|
|
302
|
+
enableSsrInlineScripts = _this$props.enableSsrInlineScripts,
|
|
303
|
+
allowHeadingAnchorLinks = _this$props.allowHeadingAnchorLinks,
|
|
304
|
+
allowPlaceholderText = _this$props.allowPlaceholderText,
|
|
305
|
+
allowColumnSorting = _this$props.allowColumnSorting,
|
|
306
|
+
allowCopyToClipboard = _this$props.allowCopyToClipboard,
|
|
307
|
+
allowCustomPanels = _this$props.allowCustomPanels;
|
|
312
308
|
var allowNestedHeaderLinks = (0, _links.isNestedHeaderLinksEnabled)(allowHeadingAnchorLinks);
|
|
313
309
|
/**
|
|
314
310
|
* Handle clicks inside renderer. If the click isn't on media, in the media picker, or on a
|
|
@@ -358,7 +354,7 @@ var Renderer = /*#__PURE__*/function (_PureComponent) {
|
|
|
358
354
|
try {
|
|
359
355
|
var _this$featureFlags, _this$featureFlags$fe, _this$featureFlags$fe2;
|
|
360
356
|
|
|
361
|
-
var schema = this.getSchema();
|
|
357
|
+
var schema = this.getSchema(this.props.schema, this.props.adfStage);
|
|
362
358
|
|
|
363
359
|
var _renderDocument = (0, _.renderDocument)(document, this.serializer, schema, adfStage, this.props.useSpecBasedValidator, this.id, this.fireAnalyticsEvent, this.props.unsupportedContentLevelsTracking, this.props.appearance),
|
|
364
360
|
result = _renderDocument.result,
|
|
@@ -21,6 +21,8 @@ var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
|
|
|
21
21
|
|
|
22
22
|
var _typography = require("@atlaskit/theme/typography");
|
|
23
23
|
|
|
24
|
+
var _tokens = require("@atlaskit/tokens");
|
|
25
|
+
|
|
24
26
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
25
27
|
|
|
26
28
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
@@ -94,7 +96,7 @@ var tableSortableColumnStyle = function tableSortableColumnStyle(_ref2) {
|
|
|
94
96
|
headingsCss = "\n /**\n * When the sort button is enabled we want the heading's copy link button\n * to reserve space so that it can prematurely wrap to avoid the button\n * being displayed underneath the sort button (hidden or obscured).\n *\n * The two buttons fight each other since the sort button is displayed\n * on hover of the <th /> and the copy link button is displayed on hover\n * of the heading.\n *\n * Note that this can break the WYSIWYG experience in the case where\n * a heading fills the width of the table cell and the only thing which\n * wraps is the copy link button. This is hopefully a rare fringe case.\n */\n .".concat(_headingAnchor.HeadingAnchorWrapperClassName, " {\n position: unset;\n }\n > {\n h1, h2, h3, h4, h5, h6 {\n margin-right: 30px;\n }\n }\n ");
|
|
95
97
|
}
|
|
96
98
|
|
|
97
|
-
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n padding: 0;\n\n .", " {\n width: 100%;\n height: 100%;\n cursor: pointer;\n padding: ", "px;\n border-width: 1.5px;\n border-style: solid;\n border-color: transparent;\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n @supports selector(:focus-visible) {\n &:focus {\n outline: unset;\n }\n &:focus-visible {\n border-color: ", ";\n }\n }\n\n ", "\n }\n\n &.", "\n .", " {\n cursor: default;\n }\n\n .", " {\n margin: 0;\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n }\n\n .", " {\n opacity: 0;\n }\n\n &:hover {\n .", " {\n opacity: 1;\n }\n }\n }\n "])), _consts.RendererCssClassName.SORTABLE_COLUMN, _consts.RendererCssClassName.SORTABLE_COLUMN_BUTTON, _styles.tableCellPadding, colors.B300, headingsCss, _consts.RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED, _consts.RendererCssClassName.SORTABLE_COLUMN_BUTTON, _consts.RendererCssClassName.SORTABLE_COLUMN_ICON, _consts.RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, _consts.RendererCssClassName.SORTABLE_COLUMN_NO_ORDER);
|
|
99
|
+
return (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n padding: 0;\n\n .", " {\n width: 100%;\n height: 100%;\n cursor: pointer;\n padding: ", "px;\n border-width: 1.5px;\n border-style: solid;\n border-color: transparent;\n\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n @supports selector(:focus-visible) {\n &:focus {\n outline: unset;\n }\n &:focus-visible {\n border-color: ", ";\n }\n }\n\n ", "\n }\n\n &.", "\n .", " {\n cursor: default;\n }\n\n .", " {\n margin: 0;\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n }\n\n .", " {\n opacity: 0;\n }\n\n &:hover {\n .", " {\n opacity: 1;\n }\n }\n }\n "])), _consts.RendererCssClassName.SORTABLE_COLUMN, _consts.RendererCssClassName.SORTABLE_COLUMN_BUTTON, _styles.tableCellPadding, (0, _tokens.token)('color.border.focused', colors.B300), headingsCss, _consts.RendererCssClassName.SORTABLE_COLUMN_NOT_ALLOWED, _consts.RendererCssClassName.SORTABLE_COLUMN_BUTTON, _consts.RendererCssClassName.SORTABLE_COLUMN_ICON, _consts.RendererCssClassName.SORTABLE_COLUMN_NO_ORDER, _consts.RendererCssClassName.SORTABLE_COLUMN_NO_ORDER);
|
|
98
100
|
};
|
|
99
101
|
|
|
100
102
|
var fullPageStyles = function fullPageStyles(_ref3, _ref4) {
|
|
@@ -124,42 +126,42 @@ var rendererStyles = function rendererStyles(wrapperProps) {
|
|
|
124
126
|
var themeProps = {
|
|
125
127
|
theme: theme
|
|
126
128
|
};
|
|
127
|
-
return (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n .", "::after {\n // we add a clearfix after ak-renderer-document in order to\n // contain internal floats (such as media images that are \"wrap-left\")\n // to just the renderer (and not spill outside of it)\n content: '';\n visibility: hidden;\n display: block;\n height: 0;\n clear: both;\n }\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped\n + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped\n + .rich-media-wrapped\n + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n /* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n }\n\n ", "\n\n .", " .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after,\n &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-child {\n height: 100%;\n\n td,\n th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid\n ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th,\n .sticky td {\n box-shadow: 0px 1px\n ", ",\n 0px -0.5px ", ",\n inset -1px 0px ", ",\n 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard,\n .copy-to-clipboard:focus {\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n }\n "])), (0, _editorSharedStyles.editorFontSize)(themeProps), (0, _components.themed)({
|
|
128
|
-
light: colors.N800,
|
|
129
|
-
dark: '#B8C7E0'
|
|
130
|
-
})(themeProps), _consts.RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), colors.B400, colors.B300, colors.placeholderText(themeProps), _styles.whitespaceSharedStyles, _styles.blockquoteSharedStyles, (0, _styles.headingsSharedStyles)(themeProps), (0, _styles.ruleSharedStyles)(themeProps), _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.blockMarksSharedStyles, (0, _styles.codeMarkSharedStyles)(themeProps), _styles.shadowSharedStyle, _styles.dateSharedStyle, _styles.textColorStyles, _styles.tasksAndDecisionsStyles, _styles.smartCardSharedStyles, (0, _constants.fontFamily)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
|
|
131
|
-
light: colors.N30A,
|
|
132
|
-
dark: colors.DN70
|
|
129
|
+
return (0, _react.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-size: ", "px;\n line-height: 1.5rem;\n color: ", ";\n\n .", "::after {\n // we add a clearfix after ak-renderer-document in order to\n // contain internal floats (such as media images that are \"wrap-left\")\n // to just the renderer (and not spill outside of it)\n content: '';\n visibility: hidden;\n display: block;\n height: 0;\n clear: both;\n }\n\n ", "\n ", "\n\n & h1 {\n ", "\n }\n\n & h2 {\n ", "\n }\n\n & h3 {\n ", "\n }\n\n & h4 {\n ", "\n }\n\n & h5 {\n ", "\n }\n\n & h6 {\n ", "\n }\n\n & span.akActionMark {\n color: ", ";\n text-decoration: none;\n\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n\n &:active {\n color: ", ";\n }\n }\n\n & span.akActionMark {\n cursor: pointer;\n }\n\n & span[data-placeholder] {\n color: ", ";\n }\n\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", "\n\n & .UnknownBlock {\n font-family: ", ";\n font-size: ", ";\n font-weight: 400;\n white-space: pre-wrap;\n word-wrap: break-word;\n }\n\n & span.date-node {\n background: ", ";\n border-radius: ", "px;\n color: ", ";\n padding: 2px 4px;\n margin: 0 1px;\n transition: background 0.3s;\n }\n\n & span.date-node-highlighted {\n background: ", ";\n color: ", ";\n }\n\n & .renderer-image {\n max-width: 100%;\n display: block;\n margin: ", "px 0;\n }\n\n .", ".rich-media-wrapped\n + .", ":not(.rich-media-wrapped) {\n clear: both;\n }\n\n & .code-block,\n & blockquote,\n & hr,\n & > div > div:not(.rich-media-wrapped),\n .", ".rich-media-wrapped\n + .rich-media-wrapped\n + *:not(.rich-media-wrapped),\n .", ".rich-media-wrapped + div:not(.rich-media-wrapped),\n .", ".image-align-start,\n .", ".image-center,\n .", ".image-align-end {\n clear: both;\n }\n\n & .rich-media-wrapped {\n & + h1,\n & + h2,\n & + h3,\n & + h4,\n & + h5,\n & + h6 {\n margin-top: 8px;\n }\n }\n\n ", "\n /* plugin styles */\n ", " &\n div[class^='image-wrap-'] + div[class^='image-wrap-'] {\n margin-left: 0;\n margin-right: 0;\n }\n\n /* Breakout for tables and extensions */\n .", " > {\n * .", " {\n width: 100% !important;\n left: 0 !important;\n }\n\n * .", " {\n overflow-x: auto;\n }\n\n & .", ":first-child {\n margin-top: 0;\n }\n }\n\n .", " {\n .", " {\n margin-top: ", ";\n }\n\n .", " {\n margin-left: 50%;\n transform: translateX(-50%);\n }\n\n .", " {\n overflow-x: auto;\n }\n }\n\n ", "\n\n .", " .", " {\n z-index: 0;\n transition: all 0.1s linear;\n display: flex; /* needed to avoid position: fixed jumpiness in Chrome */\n\n /** Shadow overrides */\n &.", "::after,\n &.", "::before {\n top: ", "px;\n height: calc(100% - ", "px);\n z-index: ", ";\n }\n\n /**\n * A hack for making all the <th /> heights equal in case some have shorter\n * content than others.\n *\n * This is done to make sort buttons fill entire <th />.\n */\n table {\n height: 1px; /* will be ignored */\n ", ";\n margin-left: 0;\n margin-right: 0;\n }\n\n table tr:first-child {\n height: 100%;\n\n td,\n th {\n position: relative;\n }\n }\n\n table[data-number-column='true'] {\n .", " {\n background-color: ", ";\n border-right: 1px solid\n ", ";\n width: ", "px;\n text-align: center;\n color: ", ";\n font-size: ", ";\n }\n\n .fixed .", " {\n border-right: 0px none;\n }\n }\n }\n\n tr[data-header-row].fixed {\n position: fixed !important;\n display: flex;\n overflow: hidden;\n z-index: ", ";\n\n border-right: 1px solid\n ", ";\n border-bottom: 1px solid\n ", ";\n\n /* this is to compensate for the table border */\n transform: translateX(-1px);\n }\n\n .sticky > th {\n z-index: ", ";\n position: sticky !important;\n top: 0;\n }\n\n /* Make the number column header sticky */\n .sticky > td {\n position: sticky !important;\n top: 0;\n }\n\n /* add border for position: sticky\n and work around background-clip: padding-box\n bug for FF causing box-shadow bug in Chrome */\n .sticky th,\n .sticky td {\n box-shadow: 0px 1px\n ", ",\n 0px -0.5px ", ",\n inset -1px 0px ", ",\n 0px -1px ", ";\n }\n\n /* this will remove jumpiness caused in Chrome for sticky headers */\n .fixed + tr {\n min-height: 0px;\n }\n\n /*\n * We wrap CodeBlock in a grid to prevent it from overflowing the container of the renderer.\n * See ED-4159.\n */\n & .code-block {\n max-width: 100%;\n /* -ms- properties are necessary until MS supports the latest version of the grid spec */\n /* stylelint-disable value-no-vendor-prefix, declaration-block-no-duplicate-properties */\n display: -ms-grid;\n display: grid;\n -ms-grid-columns: auto 1fr;\n /* stylelint-enable */\n\n grid-template-columns: minmax(0, 1fr);\n position: relative;\n border-radius: ", "px;\n\n /*\n * The overall renderer has word-wrap: break; which causes issues with\n * code block line numbers in Safari / iOS.\n */\n word-wrap: normal;\n\n & > span {\n /* stylelint-disable value-no-vendor-prefix */\n -ms-grid-row: 1;\n -ms-grid-column: 2;\n /* stylelint-enable */\n grid-column: 1;\n }\n }\n\n & .MediaGroup,\n & .code-block {\n margin-top: ", ";\n\n &:first-child {\n margin-top: 0;\n }\n\n &:hover button.copy-to-clipboard,\n .copy-to-clipboard:focus {\n opacity: 1;\n position: absolute;\n height: 32px;\n width: 32px;\n right: 6px;\n top: 4px;\n padding: 2px;\n }\n }\n\n ", ";\n & [data-layout-section] {\n margin-top: ", "px;\n & > div + div {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n & > div + div {\n margin-left: 0;\n }\n }\n }\n "])), (0, _editorSharedStyles.editorFontSize)(themeProps), (0, _components.themed)({
|
|
130
|
+
light: (0, _tokens.token)('color.text', colors.N800),
|
|
131
|
+
dark: (0, _tokens.token)('color.text', '#B8C7E0')
|
|
132
|
+
})(themeProps), _consts.RendererCssClassName.DOCUMENT, fullPageStyles(wrapperProps, themeProps), fullWidthStyles(wrapperProps), headingAnchorStyle('h1'), headingAnchorStyle('h2'), headingAnchorStyle('h3'), headingAnchorStyle('h4'), headingAnchorStyle('h5'), headingAnchorStyle('h6'), (0, _tokens.token)('color.link', colors.B400), (0, _tokens.token)('color.link', colors.B300), (0, _tokens.token)('color.link.pressed', colors.B500), colors.placeholderText(themeProps), _styles.whitespaceSharedStyles, _styles.blockquoteSharedStyles, (0, _styles.headingsSharedStyles)(themeProps), (0, _styles.ruleSharedStyles)(themeProps), _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.blockMarksSharedStyles, (0, _styles.codeMarkSharedStyles)(themeProps), _styles.shadowSharedStyle, _styles.dateSharedStyle, _styles.textColorStyles, _styles.tasksAndDecisionsStyles, _styles.smartCardSharedStyles, (0, _constants.fontFamily)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
|
|
133
|
+
light: (0, _tokens.token)('color.background.neutral', colors.N30A),
|
|
134
|
+
dark: (0, _tokens.token)('color.background.neutral', colors.DN70)
|
|
133
135
|
})(themeProps), (0, _constants.borderRadius)(), (0, _components.themed)({
|
|
134
|
-
light: colors.N800,
|
|
135
|
-
dark: colors.DN600
|
|
136
|
-
})(themeProps), colors.R50, colors.R500, (0, _constants.gridSize)() * 3, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), _styles.mediaSingleSharedStyle, _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, _consts.RendererCssClassName.EXTENSION, _consts.RendererCssClassName.DOCUMENT, _consts.RendererCssClassName.EXTENSION, _editorSharedStyles.blockNodesVerticalMargin, _consts.RendererCssClassName.EXTENSION_CENTER_ALIGN, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, (0, _styles.tableSharedStyle)(themeProps), _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _ui.shadowClassNames.RIGHT_SHADOW, _ui.shadowClassNames.LEFT_SHADOW, _styles.tableMarginTop - 1, _styles.tableMarginTop, _editorSharedStyles.akEditorStickyHeaderZIndex, tableSortableColumnStyle(wrapperProps), _consts.RendererCssClassName.NUMBER_COLUMN, (0, _components.themed)({
|
|
137
|
-
light: _editorSharedStyles.akEditorTableToolbar,
|
|
138
|
-
dark: _editorSharedStyles.akEditorTableToolbarDark
|
|
136
|
+
light: (0, _tokens.token)('color.text', colors.N800),
|
|
137
|
+
dark: (0, _tokens.token)('color.text', colors.DN600)
|
|
138
|
+
})(themeProps), (0, _tokens.token)('color.background.danger', colors.R50), (0, _tokens.token)('color.text.danger', colors.R500), (0, _constants.gridSize)() * 3, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, _styles.richMediaClassName, alignedHeadingAnchorStyle(wrapperProps), _styles.mediaSingleSharedStyle, _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _consts.RendererCssClassName.EXTENSION_OVERFLOW_CONTAINER, _consts.RendererCssClassName.EXTENSION, _consts.RendererCssClassName.DOCUMENT, _consts.RendererCssClassName.EXTENSION, _editorSharedStyles.blockNodesVerticalMargin, _consts.RendererCssClassName.EXTENSION_CENTER_ALIGN, _styles.TableSharedCssClassName.TABLE_NODE_WRAPPER, (0, _styles.tableSharedStyle)(themeProps), _consts.RendererCssClassName.DOCUMENT, _styles.TableSharedCssClassName.TABLE_CONTAINER, _ui.shadowClassNames.RIGHT_SHADOW, _ui.shadowClassNames.LEFT_SHADOW, _styles.tableMarginTop - 1, _styles.tableMarginTop, _editorSharedStyles.akEditorStickyHeaderZIndex, tableSortableColumnStyle(wrapperProps), _consts.RendererCssClassName.NUMBER_COLUMN, (0, _components.themed)({
|
|
139
|
+
light: (0, _tokens.token)('color.background.neutral', _editorSharedStyles.akEditorTableToolbar),
|
|
140
|
+
dark: (0, _tokens.token)('color.background.neutral', _editorSharedStyles.akEditorTableToolbarDark)
|
|
139
141
|
})(themeProps), (0, _components.themed)({
|
|
140
|
-
light: _editorSharedStyles.akEditorTableBorder,
|
|
141
|
-
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
142
|
+
light: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorder),
|
|
143
|
+
dark: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorderDark)
|
|
142
144
|
})(themeProps), _editorSharedStyles.akEditorTableNumberColumnWidth, (0, _components.themed)({
|
|
143
|
-
light: colors.N200,
|
|
144
|
-
dark: colors.DN400
|
|
145
|
+
light: (0, _tokens.token)('color.text.subtlest', colors.N200),
|
|
146
|
+
dark: (0, _tokens.token)('color.text.subtlest', colors.DN400)
|
|
145
147
|
})(themeProps), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), _consts.RendererCssClassName.NUMBER_COLUMN, _editorSharedStyles.akEditorStickyHeaderZIndex, (0, _components.themed)({
|
|
146
|
-
light: _editorSharedStyles.akEditorTableBorder,
|
|
147
|
-
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
148
|
+
light: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorder),
|
|
149
|
+
dark: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorderDark)
|
|
148
150
|
})(themeProps), (0, _components.themed)({
|
|
149
|
-
light: _editorSharedStyles.akEditorTableBorder,
|
|
150
|
-
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
151
|
+
light: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorder),
|
|
152
|
+
dark: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorderDark)
|
|
151
153
|
})(themeProps), _editorSharedStyles.akEditorStickyHeaderZIndex, (0, _components.themed)({
|
|
152
|
-
light: _editorSharedStyles.akEditorTableBorder,
|
|
153
|
-
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
154
|
+
light: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorder),
|
|
155
|
+
dark: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorderDark)
|
|
154
156
|
})(themeProps), (0, _components.themed)({
|
|
155
|
-
light: _editorSharedStyles.akEditorTableBorder,
|
|
156
|
-
dark: _editorSharedStyles.akEditorTableBorderDark
|
|
157
|
+
light: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorder),
|
|
158
|
+
dark: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableBorderDark)
|
|
157
159
|
})(themeProps), (0, _components.themed)({
|
|
158
|
-
light: _editorSharedStyles.akEditorTableToolbar,
|
|
159
|
-
dark: _editorSharedStyles.akEditorTableToolbarDark
|
|
160
|
+
light: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableToolbar),
|
|
161
|
+
dark: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableToolbarDark)
|
|
160
162
|
})(themeProps), (0, _components.themed)({
|
|
161
|
-
light: _editorSharedStyles.akEditorTableToolbar,
|
|
162
|
-
dark: _editorSharedStyles.akEditorTableToolbarDark
|
|
163
|
+
light: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableToolbar),
|
|
164
|
+
dark: (0, _tokens.token)('color.border', _editorSharedStyles.akEditorTableToolbarDark)
|
|
163
165
|
})(themeProps), (0, _constants.borderRadius)(), _editorSharedStyles.blockNodesVerticalMargin, _styles.columnLayoutSharedStyle, (0, _constants.gridSize)() * 2.5, (0, _constants.gridSize)() * 4, _editorSharedStyles.gridMediumMaxWidth);
|
|
164
166
|
};
|
|
165
167
|
};
|