@atlaskit/renderer 114.3.0 → 114.3.2
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 +12 -0
- package/afm-cc/tsconfig.json +3 -0
- package/dist/cjs/react/marks/alignment.js +13 -1
- package/dist/cjs/react/nodes/codeBlock/components/codeBlockContainer.js +36 -13
- package/dist/cjs/react/nodes/codeBlock/components/lightWeightCodeBlock.js +165 -5
- package/dist/cjs/react/nodes/layoutColumn.js +18 -1
- package/dist/cjs/react/nodes/media/index.js +75 -32
- package/dist/cjs/react/nodes/mediaSingle/index.js +9 -2
- package/dist/cjs/react/nodes/multiBodiedExtension.js +83 -4
- package/dist/cjs/react/nodes/panel.js +162 -2
- package/dist/cjs/react/nodes/table/sticky.js +51 -1
- package/dist/cjs/ui/Expand.js +124 -8
- package/dist/cjs/ui/Renderer/index.js +1 -1
- package/dist/cjs/ui/annotations/draft/component.js +27 -7
- package/dist/cjs/ui/annotations/element/mark.js +85 -6
- package/dist/es2019/react/marks/alignment.js +13 -1
- package/dist/es2019/react/nodes/codeBlock/components/codeBlockContainer.js +69 -13
- package/dist/es2019/react/nodes/codeBlock/components/lightWeightCodeBlock.js +194 -4
- package/dist/es2019/react/nodes/layoutColumn.js +27 -1
- package/dist/es2019/react/nodes/media/index.js +49 -15
- package/dist/es2019/react/nodes/mediaSingle/index.js +9 -2
- package/dist/es2019/react/nodes/multiBodiedExtension.js +83 -4
- package/dist/es2019/react/nodes/panel.js +162 -2
- package/dist/es2019/react/nodes/table/sticky.js +64 -1
- package/dist/es2019/ui/Expand.js +125 -8
- package/dist/es2019/ui/Renderer/index.js +1 -1
- package/dist/es2019/ui/annotations/draft/component.js +28 -7
- package/dist/es2019/ui/annotations/element/mark.js +96 -6
- package/dist/esm/react/marks/alignment.js +13 -1
- package/dist/esm/react/nodes/codeBlock/components/codeBlockContainer.js +36 -13
- package/dist/esm/react/nodes/codeBlock/components/lightWeightCodeBlock.js +164 -4
- package/dist/esm/react/nodes/layoutColumn.js +18 -1
- package/dist/esm/react/nodes/media/index.js +75 -32
- package/dist/esm/react/nodes/mediaSingle/index.js +9 -2
- package/dist/esm/react/nodes/multiBodiedExtension.js +83 -4
- package/dist/esm/react/nodes/panel.js +163 -3
- package/dist/esm/react/nodes/table/sticky.js +51 -1
- package/dist/esm/ui/Expand.js +125 -9
- package/dist/esm/ui/Renderer/index.js +1 -1
- package/dist/esm/ui/annotations/draft/component.js +28 -7
- package/dist/esm/ui/annotations/element/mark.js +85 -7
- package/dist/types/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +5 -1
- package/dist/types/ui/annotations/draft/component.d.ts +0 -4
- package/dist/types-ts4.5/react/nodes/codeBlock/components/lightWeightCodeBlock.d.ts +5 -1
- package/dist/types-ts4.5/ui/annotations/draft/component.d.ts +0 -4
- package/package.json +5 -4
- package/dist/cjs/react/nodes/mediaSingle/styles.js +0 -24
- package/dist/es2019/react/nodes/mediaSingle/styles.js +0 -18
- package/dist/esm/react/nodes/mediaSingle/styles.js +0 -18
- package/dist/types/react/nodes/mediaSingle/styles.d.ts +0 -2
- package/dist/types-ts4.5/react/nodes/mediaSingle/styles.d.ts +0 -2
package/CHANGELOG.md
CHANGED
package/afm-cc/tsconfig.json
CHANGED
|
@@ -10,13 +10,14 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
13
|
+
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
13
14
|
var _templateObject;
|
|
14
15
|
/**
|
|
15
16
|
* @jsxRuntime classic
|
|
16
17
|
* @jsx jsx
|
|
17
18
|
*/
|
|
18
19
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
19
|
-
var
|
|
20
|
+
var MarkWrapperOld = function MarkWrapperOld(props) {
|
|
20
21
|
var styles = props['data-align'] ? // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression
|
|
21
22
|
(0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t\t\t\ttext-align: ", ";\n\t\t\t"])), _adfSchema.alignmentPositionMap[props['data-align']]) : '';
|
|
22
23
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
@@ -26,6 +27,17 @@ var MarkWrapper = function MarkWrapper(props) {
|
|
|
26
27
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
27
28
|
}, props), props.children);
|
|
28
29
|
};
|
|
30
|
+
var MarkWrapperNew = function MarkWrapperNew(props) {
|
|
31
|
+
var dataAlign = props['data-align'] ? _adfSchema.alignmentPositionMap[props['data-align']] : undefined;
|
|
32
|
+
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
33
|
+
style: {
|
|
34
|
+
textAlign: dataAlign
|
|
35
|
+
}
|
|
36
|
+
// Ignored via go/ees005
|
|
37
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
38
|
+
}, props), props.children);
|
|
39
|
+
};
|
|
40
|
+
var MarkWrapper = (0, _platformFeatureFlagsReact.componentWithFG)('platform_editor_emotion_refactor_renderer', MarkWrapperNew, MarkWrapperOld);
|
|
29
41
|
function Alignment(props) {
|
|
30
42
|
return (0, _react2.jsx)(MarkWrapper
|
|
31
43
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
@@ -5,12 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
10
|
var _react = require("@emotion/react");
|
|
10
11
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
12
|
var _colors = require("@atlaskit/theme/colors");
|
|
12
13
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
13
14
|
var _codeBlockButtonContainer = _interopRequireDefault(require("./codeBlockButtonContainer"));
|
|
15
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
16
|
var _templateObject;
|
|
15
17
|
/**
|
|
16
18
|
* @jsxRuntime classic
|
|
@@ -18,9 +20,32 @@ var _templateObject;
|
|
|
18
20
|
*/
|
|
19
21
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
20
22
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
21
|
-
var
|
|
23
|
+
var codeBlockStyleOverridesOld = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\ttab-size: 4;\n\tbackground-color: ", ";\n\n\t&:hover {\n\t\tbutton {\n\t\t\topacity: 1;\n\t\t}\n\t}\n\n\tbutton {\n\t\topacity: 0;\n\t\ttransition: opacity 0.2s ease 0s;\n\t}\n\n\t", " {\n\t\tfont-size: ", ";\n\t\tline-height: 1.5rem;\n\t\tbackground-image: ", ";\n\t\tbackground-attachment: local, local, local, local, scroll, scroll, scroll, scroll;\n\t\tbackground-position:\n\t\t\t0 0,\n\t\t\t0 0,\n\t\t\t100% 0,\n\t\t\t100% 0,\n\t\t\t100% 0,\n\t\t\t100% 0,\n\t\t\t0 0,\n\t\t\t0 0;\n\t}\n"])), "var(--ds-surface-raised, ".concat(_colors.N20, ")"), _styles.CodeBlockSharedCssClassName.DS_CODEBLOCK, (0, _editorSharedStyles.relativeFontSizeToBase16)(14), (0, _editorSharedStyles.overflowShadow)({
|
|
22
24
|
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
23
25
|
}));
|
|
26
|
+
var codeBlockStyleOverridesNew = (0, _react.css)((0, _defineProperty2.default)({
|
|
27
|
+
tabSize: 4,
|
|
28
|
+
backgroundColor: "var(--ds-surface-raised, ".concat(_colors.N20, ")"),
|
|
29
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
30
|
+
button: {
|
|
31
|
+
opacity: 0,
|
|
32
|
+
transition: 'opacity 0.2s ease 0s'
|
|
33
|
+
},
|
|
34
|
+
'&:hover': {
|
|
35
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
36
|
+
button: {
|
|
37
|
+
opacity: 1
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}, "".concat(_styles.CodeBlockSharedCssClassName.DS_CODEBLOCK), {
|
|
41
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
42
|
+
fontSize: "".concat(14 / 16, "rem"),
|
|
43
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
44
|
+
lineHeight: '1.5rem',
|
|
45
|
+
backgroundImage: "linear-gradient(\n\t\t\tto right,\n\t\t\t".concat("var(--ds-background-neutral, #091E420F)", " ", "var(--ds-space-300, 24px)", ",\n\t\t\ttransparent ", "var(--ds-space-300, 24px)", "\n\t\t\t),linear-gradient(\n\t\t\tto right,\n\t\t\t", "var(--ds-surface-raised, #FFFFFF)", " ", "var(--ds-space-300, 24px)", ",\n\t\t\ttransparent ", "var(--ds-space-300, 24px)", "\n\t\t\t),linear-gradient(\n\t\t\tto left,\n\t\t\t", "var(--ds-background-neutral, #091E420F)", " ", "var(--ds-space-100, 8px)", ",\n\t\t\ttransparent ", "var(--ds-space-100, 8px)", "\n\t\t\t),linear-gradient(\n\t\t\tto left,\n\t\t\t", "var(--ds-surface-raised, #FFFFFF)", " ", "var(--ds-space-100, 8px)", ",\n\t\t\ttransparent ", "var(--ds-space-100, 8px)", "\n\t\t\t),linear-gradient(\n\t\t\tto left,\n\t\t\t", "var(--ds-shadow-overflow-spread, #091e4229)", " 0,\n\t\t\t", "var(--ds-UNSAFE-transparent, transparent)", " ", "var(--ds-space-100, 8px)", "\n\t\t\t),linear-gradient(\n\t\t\tto left,\n\t\t\t", "var(--ds-shadow-overflow-perimeter, #091e421f)", " 0,\n\t\t\t", "var(--ds-UNSAFE-transparent, transparent)", " ", "var(--ds-space-100, 8px)", "\n\t\t\t),linear-gradient(\n\t\t\tto right,\n\t\t\t", "var(--ds-shadow-overflow-spread, #091e4229)", " 0,\n\t\t\t", "var(--ds-UNSAFE-transparent, transparent)", " ", "var(--ds-space-100, 8px)", "\n\t\t\t),linear-gradient(\n\t\t\tto right,\n\t\t\t", "var(--ds-shadow-overflow-perimeter, #091e421f)", " 0,\n\t\t\t", "var(--ds-UNSAFE-transparent, transparent)", " ", "var(--ds-space-100, 8px)", "\n\t\t\t)"),
|
|
46
|
+
backgroundAttachment: 'local, local, local, local, scroll, scroll, scroll, scroll',
|
|
47
|
+
backgroundPosition: '0 0, 0 0, 100% 0, 100% 0, 100% 0, 100% 0, 0 0, 0 0'
|
|
48
|
+
}));
|
|
24
49
|
var CodeBlockContainer = function CodeBlockContainer(_ref) {
|
|
25
50
|
var allowCopyToClipboard = _ref.allowCopyToClipboard,
|
|
26
51
|
allowWrapCodeBlock = _ref.allowWrapCodeBlock,
|
|
@@ -29,18 +54,16 @@ var CodeBlockContainer = function CodeBlockContainer(_ref) {
|
|
|
29
54
|
setWrapLongLines = _ref.setWrapLongLines,
|
|
30
55
|
text = _ref.text,
|
|
31
56
|
wrapLongLines = _ref.wrapLongLines;
|
|
32
|
-
return (
|
|
57
|
+
return (0, _react.jsx)("div", {
|
|
33
58
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}), children)
|
|
44
|
-
);
|
|
59
|
+
className: className,
|
|
60
|
+
css: (0, _platformFeatureFlags.fg)('platform_editor_emotion_refactor_renderer') ? codeBlockStyleOverridesNew : codeBlockStyleOverridesOld
|
|
61
|
+
}, (0, _react.jsx)(_codeBlockButtonContainer.default, {
|
|
62
|
+
allowCopyToClipboard: allowCopyToClipboard,
|
|
63
|
+
allowWrapCodeBlock: allowWrapCodeBlock,
|
|
64
|
+
setWrapLongLines: setWrapLongLines,
|
|
65
|
+
text: text,
|
|
66
|
+
wrapLongLines: wrapLongLines
|
|
67
|
+
}), children);
|
|
45
68
|
};
|
|
46
69
|
var _default = exports.default = CodeBlockContainer;
|
|
@@ -7,13 +7,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.getLightWeightCodeBlockStylesForRootRendererStyleSheet = exports.default = exports.LightWeightCodeBlockCssClassName = void 0;
|
|
9
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _react2 = require("@emotion/react");
|
|
12
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
13
14
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
14
|
-
var
|
|
15
|
+
var _useBidiWarnings3 = require("../../../hooks/use-bidi-warnings");
|
|
15
16
|
var _consts = require("../../../../consts");
|
|
17
|
+
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
16
18
|
var _templateObject, _templateObject2;
|
|
19
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-imported-style-values */
|
|
20
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-unsafe-values */
|
|
21
|
+
/* eslint-disable @atlaskit/ui-styling-standard/no-nested-selectors */
|
|
17
22
|
/**
|
|
18
23
|
* @jsxRuntime classic
|
|
19
24
|
* @jsx jsx
|
|
@@ -21,11 +26,119 @@ var _templateObject, _templateObject2;
|
|
|
21
26
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
22
27
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
23
28
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
|
+
var codeBlockSharedStylesNew = (0, _react2.css)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, ".".concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPED, "\n\t\t> .").concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "\n\t\t> .").concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT), {
|
|
30
|
+
marginRight: "var(--ds-space-100, 8px)",
|
|
31
|
+
code: {
|
|
32
|
+
display: 'block',
|
|
33
|
+
wordBreak: 'break-word',
|
|
34
|
+
whiteSpace: 'pre-wrap'
|
|
35
|
+
}
|
|
36
|
+
}), ".".concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "\n\t\t> .").concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT), {
|
|
37
|
+
display: 'flex',
|
|
38
|
+
flex: 1,
|
|
39
|
+
code: {
|
|
40
|
+
flexGrow: 1,
|
|
41
|
+
whiteSpace: 'pre'
|
|
42
|
+
}
|
|
43
|
+
}), ".".concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({
|
|
44
|
+
position: 'relative',
|
|
45
|
+
backgroundColor: "var(--ds-surface-raised, #FFFFFF)",
|
|
46
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
47
|
+
margin: "".concat(_editorSharedStyles.blockNodesVerticalMargin, " 0 0 0"),
|
|
48
|
+
fontFamily: "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)",
|
|
49
|
+
minWidth: "".concat(_editorSharedStyles.akEditorTableCellMinWidth, "px"),
|
|
50
|
+
cursor: 'pointer',
|
|
51
|
+
clear: 'both',
|
|
52
|
+
'--ds--code--bg-color': 'transparent',
|
|
53
|
+
'.code-block-gutter-pseudo-element::before': {
|
|
54
|
+
content: '"attr(data-label)"'
|
|
55
|
+
},
|
|
56
|
+
/* This is necessary to allow for arrow key navigation in/out of code blocks in Firefox. */
|
|
57
|
+
whiteSpace: 'normal'
|
|
58
|
+
}, ".".concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_START), {
|
|
59
|
+
position: 'absolute',
|
|
60
|
+
visibility: 'hidden',
|
|
61
|
+
height: '1.5rem',
|
|
62
|
+
top: '0px',
|
|
63
|
+
left: '0px'
|
|
64
|
+
}), "".concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_END), {
|
|
65
|
+
position: 'absolute',
|
|
66
|
+
visibility: 'hidden',
|
|
67
|
+
height: '1.5rem',
|
|
68
|
+
bottom: '0px',
|
|
69
|
+
right: '0px'
|
|
70
|
+
}), ".".concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER), {
|
|
71
|
+
position: 'relative',
|
|
72
|
+
backgroundColor: "var(--ds-background-neutral, #091E420F)",
|
|
73
|
+
display: 'flex',
|
|
74
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
75
|
+
width: '100%',
|
|
76
|
+
counterReset: 'line',
|
|
77
|
+
overflowX: 'auto',
|
|
78
|
+
backgroundImage: 'var(--ak-renderer-codeblock-content-wrapper-bg-img)',
|
|
79
|
+
backgroundRepeat: 'no-repeat',
|
|
80
|
+
backgroundAttachment: 'local, local, local, local, scroll, scroll, scroll, scroll',
|
|
81
|
+
backgroundSize: "var(--ds-space-300, 24px)".concat(" 100%,\n\t\t\t\t", "var(--ds-space-300, 24px)", " 100%,\n\t\t\t\t", "var(--ds-space-100, 8px)", " 100%,\n\t\t\t\t", "var(--ds-space-100, 8px)", " 100%,\n\t\t\t\t", "var(--ds-space-100, 8px)", " 100%,\n\t\t\t\t1px 100%,\n\t\t\t\t", "var(--ds-space-100, 8px)", " 100%,\n\t\t\t\t1px 100%"),
|
|
82
|
+
backgroundPosition: "0 0,\n\t\t\t\t0 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t0 0,\n\t\t\t\t0 0",
|
|
83
|
+
/* Be careful if refactoring this; it is needed to keep arrow key navigation in Firefox consistent with other browsers. */
|
|
84
|
+
overflowY: 'hidden'
|
|
85
|
+
}), ".".concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER), {
|
|
86
|
+
backgroundColor: "var(--ds-background-neutral, #091E420F)",
|
|
87
|
+
position: 'relative',
|
|
88
|
+
width: 'var(--lineNumberGutterWidth, 2rem)',
|
|
89
|
+
padding: "var(--ds-space-100, 8px)",
|
|
90
|
+
flexShrink: 0,
|
|
91
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
92
|
+
fontSize: "".concat(14 / 16, "rem"),
|
|
93
|
+
boxSizing: 'content-box'
|
|
94
|
+
}), ".".concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "::before"), {
|
|
95
|
+
content: '"1"',
|
|
96
|
+
visibility: 'hidden',
|
|
97
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
98
|
+
fontSize: "".concat(14 / 16, "rem"),
|
|
99
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
100
|
+
lineHeight: '1.5rem'
|
|
101
|
+
}), ".".concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT), {
|
|
102
|
+
code: {
|
|
103
|
+
tabSize: 4,
|
|
104
|
+
cursor: 'text',
|
|
105
|
+
color: "var(--ds-text, #172B4D)",
|
|
106
|
+
borderRadius: "var(--ds-border-radius, 3px)",
|
|
107
|
+
margin: "var(--ds-space-100, 8px)",
|
|
108
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
109
|
+
fontSize: "".concat(14 / 16, "rem"),
|
|
110
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
111
|
+
lineHeight: '1.5rem'
|
|
112
|
+
}
|
|
113
|
+
}), ".".concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER_LINE_NUMBER_WIDGET), {
|
|
114
|
+
pointerEvents: 'none',
|
|
115
|
+
userSelect: 'none',
|
|
116
|
+
width: 'var(--lineNumberGutterWidth, 2rem)',
|
|
117
|
+
left: 0,
|
|
118
|
+
position: 'absolute',
|
|
119
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
120
|
+
fontSize: "".concat(14 / 16, "rem"),
|
|
121
|
+
padding: "0px ".concat("var(--ds-space-100, 8px)"),
|
|
122
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
123
|
+
lineHeight: '1.5rem',
|
|
124
|
+
textAlign: 'right',
|
|
125
|
+
color: "var(--ds-text-subtlest, #505F79)",
|
|
126
|
+
boxSizing: 'content-box'
|
|
127
|
+
})));
|
|
128
|
+
|
|
24
129
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
25
|
-
var
|
|
130
|
+
var lightWeightCodeBlockStylesOld = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\tcursor: text;\n\t}\n"])), _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER);
|
|
131
|
+
var lightWeightCodeBlockStylesNew = (0, _react2.css)((0, _defineProperty2.default)({}, ".".concat(_styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER), {
|
|
132
|
+
cursor: 'text'
|
|
133
|
+
}));
|
|
26
134
|
var LightWeightCodeBlockCssClassName = exports.LightWeightCodeBlockCssClassName = {
|
|
27
135
|
CONTAINER: 'light-weight-code-block'
|
|
28
136
|
};
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @private
|
|
140
|
+
* @deprecated styles are moved to RendererStyleContainer
|
|
141
|
+
*/
|
|
29
142
|
var getLightWeightCodeBlockStylesForRootRendererStyleSheet = exports.getLightWeightCodeBlockStylesForRootRendererStyleSheet = function getLightWeightCodeBlockStylesForRootRendererStyleSheet() {
|
|
30
143
|
// We overwrite the rule that clears margin-top for first nested codeblocks, as
|
|
31
144
|
// our lightweight codeblock dom structure will always nest the codeblock inside
|
|
@@ -36,7 +149,7 @@ var getLightWeightCodeBlockStylesForRootRendererStyleSheet = exports.getLightWei
|
|
|
36
149
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
|
|
37
150
|
return (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\t\t.", "\n\t\t\t> .", "\n\t\t\t.", " {\n\t\t\tmargin-top: ", ";\n\t\t}\n\t"])), _consts.RendererCssClassName.DOCUMENT, LightWeightCodeBlockCssClassName.CONTAINER, _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, _editorSharedStyles.blockNodesVerticalMargin);
|
|
38
151
|
};
|
|
39
|
-
var
|
|
152
|
+
var LightWeightCodeBlockOld = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
40
153
|
var text = _ref.text,
|
|
41
154
|
_ref$codeBidiWarningT = _ref.codeBidiWarningTooltipEnabled,
|
|
42
155
|
codeBidiWarningTooltipEnabled = _ref$codeBidiWarningT === void 0 ? true : _ref$codeBidiWarningT,
|
|
@@ -44,7 +157,7 @@ var LightWeightCodeBlock = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
|
|
|
44
157
|
var textRows = (0, _react.useMemo)(function () {
|
|
45
158
|
return (text !== null && text !== void 0 ? text : '').split('\n');
|
|
46
159
|
}, [text]);
|
|
47
|
-
var _useBidiWarnings = (0,
|
|
160
|
+
var _useBidiWarnings = (0, _useBidiWarnings3.useBidiWarnings)({
|
|
48
161
|
enableWarningTooltip: codeBidiWarningTooltipEnabled
|
|
49
162
|
}),
|
|
50
163
|
renderBidiWarnings = _useBidiWarnings.renderBidiWarnings;
|
|
@@ -55,7 +168,53 @@ var LightWeightCodeBlock = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
|
|
|
55
168
|
ref: ref
|
|
56
169
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
57
170
|
,
|
|
58
|
-
css: [(0, _styles.codeBlockSharedStyles)(),
|
|
171
|
+
css: [(0, _styles.codeBlockSharedStyles)(), lightWeightCodeBlockStylesOld]
|
|
172
|
+
}, (0, _react2.jsx)("div", {
|
|
173
|
+
className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER
|
|
174
|
+
}, (0, _react2.jsx)("div", {
|
|
175
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
176
|
+
className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER
|
|
177
|
+
}, (0, _react2.jsx)("div", {
|
|
178
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
179
|
+
className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER
|
|
180
|
+
}, textRows.map(function (_, index) {
|
|
181
|
+
return (
|
|
182
|
+
// Ignored via go/ees005
|
|
183
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
184
|
+
(0, _react2.jsx)("span", {
|
|
185
|
+
key: index
|
|
186
|
+
})
|
|
187
|
+
);
|
|
188
|
+
})), (0, _react2.jsx)("div", {
|
|
189
|
+
className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
|
|
190
|
+
}, (0, _react2.jsx)("code", null, renderBidiWarnings(text))))));
|
|
191
|
+
});
|
|
192
|
+
var LightWeightCodeBlockNew = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
193
|
+
var text = _ref2.text,
|
|
194
|
+
_ref2$codeBidiWarning = _ref2.codeBidiWarningTooltipEnabled,
|
|
195
|
+
codeBidiWarningTooltipEnabled = _ref2$codeBidiWarning === void 0 ? true : _ref2$codeBidiWarning,
|
|
196
|
+
className = _ref2.className;
|
|
197
|
+
var textRows = (0, _react.useMemo)(function () {
|
|
198
|
+
return (text !== null && text !== void 0 ? text : '').split('\n');
|
|
199
|
+
}, [text]);
|
|
200
|
+
var _useBidiWarnings2 = (0, _useBidiWarnings3.useBidiWarnings)({
|
|
201
|
+
enableWarningTooltip: codeBidiWarningTooltipEnabled
|
|
202
|
+
}),
|
|
203
|
+
renderBidiWarnings = _useBidiWarnings2.renderBidiWarnings;
|
|
204
|
+
var classNames = [LightWeightCodeBlockCssClassName.CONTAINER, className].join(' ');
|
|
205
|
+
var codeBlockBackgroundImage = (0, _editorSharedStyles.overflowShadow)({
|
|
206
|
+
leftCoverWidth: "var(--ds-space-300, 24px)"
|
|
207
|
+
});
|
|
208
|
+
return (0, _react2.jsx)("div", {
|
|
209
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
210
|
+
className: classNames,
|
|
211
|
+
ref: ref
|
|
212
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
213
|
+
,
|
|
214
|
+
css: [codeBlockSharedStylesNew, lightWeightCodeBlockStylesNew],
|
|
215
|
+
style: {
|
|
216
|
+
'--ak-renderer-codeblock-content-wrapper-bg-img': codeBlockBackgroundImage
|
|
217
|
+
}
|
|
59
218
|
}, (0, _react2.jsx)("div", {
|
|
60
219
|
className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER
|
|
61
220
|
}, (0, _react2.jsx)("div", {
|
|
@@ -76,4 +235,5 @@ var LightWeightCodeBlock = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, r
|
|
|
76
235
|
className: _styles.CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
|
|
77
236
|
}, (0, _react2.jsx)("code", null, renderBidiWarnings(text))))));
|
|
78
237
|
});
|
|
238
|
+
var LightWeightCodeBlock = (0, _platformFeatureFlagsReact.componentWithFG)('platform_editor_emotion_refactor_renderer', LightWeightCodeBlockNew, LightWeightCodeBlockOld);
|
|
79
239
|
var _default = exports.default = LightWeightCodeBlock;
|
|
@@ -5,9 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = LayoutSection;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _react2 = require("@emotion/react");
|
|
10
11
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
13
|
/**
|
|
12
14
|
* @jsxRuntime classic
|
|
13
15
|
* @jsx jsx
|
|
@@ -15,6 +17,21 @@ var _ui = require("@atlaskit/editor-common/ui");
|
|
|
15
17
|
|
|
16
18
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
17
19
|
|
|
20
|
+
// localized styles, was from clearNextSiblingMarginTopStyle in @atlaskit/editor-common/ui
|
|
21
|
+
var clearNextSiblingMarginTopStyleNew = (0, _react2.css)({
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
23
|
+
'& + *': {
|
|
24
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
25
|
+
marginTop: '0 !important'
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// localized styles, was from clearNextSiblingBlockMarkMarginTopStyle in @atlaskit/editor-common/ui
|
|
30
|
+
var clearNextSiblingBlockMarkMarginTopStyleNew = (0, _react2.css)((0, _defineProperty2.default)({}, "+ .fabric-editor-block-mark > p,\n\t + .fabric-editor-block-mark > h1,\n\t + .fabric-editor-block-mark > h2,\n\t + .fabric-editor-block-mark > h3,\n\t + .fabric-editor-block-mark > h4,\n\t + .fabric-editor-block-mark > h5,\n\t + .fabric-editor-block-mark > h6\n\t", {
|
|
31
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766
|
|
32
|
+
marginTop: '0 !important'
|
|
33
|
+
}));
|
|
34
|
+
|
|
18
35
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
19
36
|
var layoutColumnClearMarginTopStyles = (0, _react2.css)(
|
|
20
37
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
@@ -29,6 +46,6 @@ function LayoutSection(props) {
|
|
|
29
46
|
flexBasis: "".concat(props.width, "%")
|
|
30
47
|
}
|
|
31
48
|
}, (0, _react2.jsx)(_ui.WidthProvider, null, (0, _react2.jsx)("div", {
|
|
32
|
-
css: layoutColumnClearMarginTopStyles
|
|
49
|
+
css: (0, _platformFeatureFlags.fg)('platform_editor_emotion_refactor_renderer') ? [clearNextSiblingMarginTopStyleNew, clearNextSiblingBlockMarkMarginTopStyleNew] : layoutColumnClearMarginTopStyles
|
|
33
50
|
}), props.children));
|
|
34
51
|
}
|
|
@@ -37,9 +37,10 @@ var _useInlineCommentsFilter = require("../../../ui/annotations/hooks/use-inline
|
|
|
37
37
|
var _useInlineCommentSubscriber = require("../../../ui/annotations/hooks/use-inline-comment-subscriber");
|
|
38
38
|
var _types = require("@atlaskit/editor-common/types");
|
|
39
39
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
40
|
+
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
40
41
|
var _excluded = ["marks", "mediaSingleElement", "isDrafting"],
|
|
41
42
|
_excluded2 = ["marks", "mediaSingleElement", "isDrafting"];
|
|
42
|
-
var _templateObject
|
|
43
|
+
var _templateObject;
|
|
43
44
|
/**
|
|
44
45
|
* @jsxRuntime classic
|
|
45
46
|
* @jsx jsx
|
|
@@ -52,14 +53,32 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
52
53
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
53
54
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
54
55
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
var linkStyle = (0, _react2.css)({
|
|
57
|
+
position: 'absolute',
|
|
58
|
+
background: 'transparent',
|
|
59
|
+
top: 0,
|
|
60
|
+
right: 0,
|
|
61
|
+
bottom: 0,
|
|
62
|
+
left: 0,
|
|
63
|
+
cursor: 'pointer',
|
|
64
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
65
|
+
width: '100% !important',
|
|
66
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
67
|
+
height: '100% !important'
|
|
68
|
+
});
|
|
57
69
|
|
|
58
70
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Ignored via go/DSP-18766
|
|
59
|
-
var
|
|
60
|
-
return (0, _react2.css)(
|
|
71
|
+
var borderStyleOld = function borderStyleOld(color, width) {
|
|
72
|
+
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tposition: absolute;\n\twidth: 100% !important;\n\theight: 100% !important;\n\tborder-radius: ", "px;\n\tbox-shadow: 0 0 0 ", "px ", ";\n"])), width, width, color);
|
|
61
73
|
};
|
|
62
|
-
var
|
|
74
|
+
var borderStyleNew = (0, _react2.css)({
|
|
75
|
+
position: 'absolute',
|
|
76
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
77
|
+
width: '100% !important',
|
|
78
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles
|
|
79
|
+
height: '100% !important'
|
|
80
|
+
});
|
|
81
|
+
var MediaBorderOld = function MediaBorderOld(_ref) {
|
|
63
82
|
var _mark$attrs$color, _mark$attrs$size;
|
|
64
83
|
var mark = _ref.mark,
|
|
65
84
|
children = _ref.children;
|
|
@@ -75,15 +94,39 @@ var MediaBorder = function MediaBorder(_ref) {
|
|
|
75
94
|
"data-size": borderWidth
|
|
76
95
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
77
96
|
,
|
|
78
|
-
css:
|
|
97
|
+
css: borderStyleOld(paletteColorValue, borderWidth)
|
|
79
98
|
}, (0, _react2.jsx)(_ui.MediaBorderGapFiller, {
|
|
80
99
|
borderColor: borderColor
|
|
81
100
|
}), children);
|
|
82
101
|
};
|
|
83
|
-
var
|
|
102
|
+
var MediaBorderNew = function MediaBorderNew(_ref2) {
|
|
103
|
+
var _mark$attrs$color2, _mark$attrs$size2;
|
|
84
104
|
var mark = _ref2.mark,
|
|
85
|
-
children = _ref2.children
|
|
86
|
-
|
|
105
|
+
children = _ref2.children;
|
|
106
|
+
if (!mark) {
|
|
107
|
+
return (0, _react2.jsx)(_react.Fragment, null, children);
|
|
108
|
+
}
|
|
109
|
+
var borderColor = (_mark$attrs$color2 = mark === null || mark === void 0 ? void 0 : mark.attrs.color) !== null && _mark$attrs$color2 !== void 0 ? _mark$attrs$color2 : '';
|
|
110
|
+
var borderWidth = (_mark$attrs$size2 = mark === null || mark === void 0 ? void 0 : mark.attrs.size) !== null && _mark$attrs$size2 !== void 0 ? _mark$attrs$size2 : 0;
|
|
111
|
+
var paletteColorValue = (0, _editorPalette.hexToEditorBorderPaletteColor)(borderColor) || borderColor;
|
|
112
|
+
return (0, _react2.jsx)("div", {
|
|
113
|
+
"data-mark-type": "border",
|
|
114
|
+
"data-color": borderColor,
|
|
115
|
+
"data-size": borderWidth,
|
|
116
|
+
css: borderStyleNew,
|
|
117
|
+
style: {
|
|
118
|
+
borderRadius: "".concat(borderWidth, "px"),
|
|
119
|
+
boxShadow: "0 0 0 ".concat(borderWidth, "px ").concat(paletteColorValue)
|
|
120
|
+
}
|
|
121
|
+
}, (0, _react2.jsx)(_ui.MediaBorderGapFiller, {
|
|
122
|
+
borderColor: borderColor
|
|
123
|
+
}), children);
|
|
124
|
+
};
|
|
125
|
+
var MediaBorder = (0, _platformFeatureFlagsReact.componentWithFG)('platform_editor_emotion_refactor_renderer', MediaBorderNew, MediaBorderOld);
|
|
126
|
+
var MediaLink = function MediaLink(_ref3) {
|
|
127
|
+
var mark = _ref3.mark,
|
|
128
|
+
children = _ref3.children,
|
|
129
|
+
onClick = _ref3.onClick;
|
|
87
130
|
if (!mark) {
|
|
88
131
|
return (0, _react2.jsx)(_react.Fragment, null, children);
|
|
89
132
|
}
|
|
@@ -96,9 +139,9 @@ var MediaLink = function MediaLink(_ref2) {
|
|
|
96
139
|
css: linkStyle
|
|
97
140
|
}, children);
|
|
98
141
|
};
|
|
99
|
-
var MediaAnnotation = function MediaAnnotation(
|
|
100
|
-
var mark =
|
|
101
|
-
children =
|
|
142
|
+
var MediaAnnotation = function MediaAnnotation(_ref4) {
|
|
143
|
+
var mark = _ref4.mark,
|
|
144
|
+
children = _ref4.children;
|
|
102
145
|
if (!mark) {
|
|
103
146
|
return (0, _react2.jsx)(_react.Fragment, null, children);
|
|
104
147
|
}
|
|
@@ -116,10 +159,10 @@ var MediaAnnotation = function MediaAnnotation(_ref3) {
|
|
|
116
159
|
useBlockLevel: true
|
|
117
160
|
}, children);
|
|
118
161
|
};
|
|
119
|
-
var _MediaAnnotations = function MediaAnnotations(
|
|
120
|
-
var
|
|
121
|
-
marks =
|
|
122
|
-
children =
|
|
162
|
+
var _MediaAnnotations = function MediaAnnotations(_ref5) {
|
|
163
|
+
var _ref5$marks = _ref5.marks,
|
|
164
|
+
marks = _ref5$marks === void 0 ? [] : _ref5$marks,
|
|
165
|
+
children = _ref5.children;
|
|
123
166
|
// Early Exit
|
|
124
167
|
if (marks.length === 0) {
|
|
125
168
|
return (0, _react2.jsx)(_react.Fragment, null, children);
|
|
@@ -136,13 +179,13 @@ var _MediaAnnotations = function MediaAnnotations(_ref4) {
|
|
|
136
179
|
}, children) : (0, _react2.jsx)(_react.Fragment, null, children)));
|
|
137
180
|
};
|
|
138
181
|
var CommentBadge = (0, _reactIntlNext.injectIntl)(_mediaSingle.CommentBadge);
|
|
139
|
-
var CommentBadgeWrapper = function CommentBadgeWrapper(
|
|
182
|
+
var CommentBadgeWrapper = function CommentBadgeWrapper(_ref6) {
|
|
140
183
|
var _marks$map;
|
|
141
|
-
var marks =
|
|
142
|
-
mediaSingleElement =
|
|
143
|
-
|
|
144
|
-
isDrafting =
|
|
145
|
-
rest = (0, _objectWithoutProperties2.default)(
|
|
184
|
+
var marks = _ref6.marks,
|
|
185
|
+
mediaSingleElement = _ref6.mediaSingleElement,
|
|
186
|
+
_ref6$isDrafting = _ref6.isDrafting,
|
|
187
|
+
isDrafting = _ref6$isDrafting === void 0 ? false : _ref6$isDrafting,
|
|
188
|
+
rest = (0, _objectWithoutProperties2.default)(_ref6, _excluded);
|
|
146
189
|
var _useState = (0, _react.useState)('default'),
|
|
147
190
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
148
191
|
status = _useState2[0],
|
|
@@ -219,13 +262,13 @@ var CommentBadgeWrapper = function CommentBadgeWrapper(_ref5) {
|
|
|
219
262
|
* when clean up platform_editor_add_media_from_url feature flag
|
|
220
263
|
*/
|
|
221
264
|
|
|
222
|
-
var CommentBadgeNextWrapper = function CommentBadgeNextWrapper(
|
|
265
|
+
var CommentBadgeNextWrapper = function CommentBadgeNextWrapper(_ref7) {
|
|
223
266
|
var _marks$map2;
|
|
224
|
-
var marks =
|
|
225
|
-
mediaSingleElement =
|
|
226
|
-
|
|
227
|
-
isDrafting =
|
|
228
|
-
rest = (0, _objectWithoutProperties2.default)(
|
|
267
|
+
var marks = _ref7.marks,
|
|
268
|
+
mediaSingleElement = _ref7.mediaSingleElement,
|
|
269
|
+
_ref7$isDrafting = _ref7.isDrafting,
|
|
270
|
+
isDrafting = _ref7$isDrafting === void 0 ? false : _ref7$isDrafting,
|
|
271
|
+
rest = (0, _objectWithoutProperties2.default)(_ref7, _excluded2);
|
|
229
272
|
var _useState5 = (0, _react.useState)('default'),
|
|
230
273
|
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
231
274
|
status = _useState6[0],
|
|
@@ -345,9 +388,9 @@ var Media = /*#__PURE__*/function (_PureComponent) {
|
|
|
345
388
|
mediaWidth: width,
|
|
346
389
|
mediaHeight: height,
|
|
347
390
|
useMinimumZIndex: true
|
|
348
|
-
}, function (
|
|
349
|
-
var badgeSize =
|
|
350
|
-
visible =
|
|
391
|
+
}, function (_ref9) {
|
|
392
|
+
var badgeSize = _ref9.badgeSize,
|
|
393
|
+
visible = _ref9.visible;
|
|
351
394
|
return (0, _react2.jsx)(_react.default.Fragment, null, (0, _platformFeatureFlags.fg)('platform_editor_hide_external_media_badge') ? visible && (0, _react2.jsx)(_mediaSingle.ExternalImageBadge, {
|
|
352
395
|
badgeSize: badgeSize,
|
|
353
396
|
type: _this.props.type,
|
|
@@ -14,7 +14,6 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
14
14
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
15
15
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
16
16
|
var _style = require("../../../ui/Renderer/style");
|
|
17
|
-
var _styles = require("./styles");
|
|
18
17
|
var _AnnotationRangeContext = require("../../../ui/annotations/contexts/AnnotationRangeContext");
|
|
19
18
|
var _AnnotationHoverContext = require("../../../ui/annotations/contexts/AnnotationHoverContext");
|
|
20
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -28,6 +27,14 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
28
27
|
|
|
29
28
|
var DEFAULT_WIDTH = 250;
|
|
30
29
|
var DEFAULT_HEIGHT = 200;
|
|
30
|
+
var uiMediaSingleBaseStyles = (0, _react2.css)({
|
|
31
|
+
transition: 'all 0.1s linear'
|
|
32
|
+
});
|
|
33
|
+
var uiMediaSingleLayoutStyles = (0, _react2.css)({
|
|
34
|
+
// eslint-disable-next-line @atlaskit/design-system/use-tokens-space
|
|
35
|
+
marginLeft: '50%',
|
|
36
|
+
transform: 'translateX(-50%)'
|
|
37
|
+
});
|
|
31
38
|
var isMediaElement = function isMediaElement(media) {
|
|
32
39
|
if (!media) {
|
|
33
40
|
return false;
|
|
@@ -222,7 +229,7 @@ var MediaSingleWithChildren = function MediaSingleWithChildren(props) {
|
|
|
222
229
|
featureFlags: featureFlags,
|
|
223
230
|
mediaSingleElement: ref.current
|
|
224
231
|
});
|
|
225
|
-
var uiMediaSingleStyles = layout === 'full-width' || layout === 'wide' ? [
|
|
232
|
+
var uiMediaSingleStyles = layout === 'full-width' || layout === 'wide' ? [uiMediaSingleBaseStyles, uiMediaSingleLayoutStyles] : [uiMediaSingleBaseStyles];
|
|
226
233
|
return (0, _react2.jsx)(_ui.MediaSingle, {
|
|
227
234
|
css: uiMediaSingleStyles,
|
|
228
235
|
handleMediaSingleRef: ref,
|