@atlaskit/editor-core 221.1.3 → 221.2.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 +20 -0
- package/dist/cjs/ui/Appearance/Comment/FixedToolbar-compiled.compiled.css +20 -0
- package/dist/cjs/ui/Appearance/Comment/FixedToolbar-compiled.js +35 -0
- package/dist/cjs/ui/Appearance/Comment/FixedToolbar-emotion.js +94 -0
- package/dist/cjs/ui/Appearance/Comment/StickyToolbar-compiled.compiled.css +25 -0
- package/dist/cjs/ui/Appearance/Comment/StickyToolbar-compiled.js +66 -0
- package/dist/cjs/ui/Appearance/Comment/StickyToolbar-emotion.js +131 -0
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +14 -134
- package/dist/cjs/ui/Toolbar/ToolbarComponentsWrapper-compiled.compiled.css +2 -0
- package/dist/cjs/ui/Toolbar/ToolbarComponentsWrapper-compiled.js +29 -0
- package/dist/cjs/ui/Toolbar/ToolbarComponentsWrapper-emotion.js +36 -0
- package/dist/cjs/ui/Toolbar/ToolbarInner.js +9 -14
- package/dist/cjs/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.compiled.css +2 -0
- package/dist/cjs/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.js +29 -0
- package/dist/cjs/ui/Toolbar/ToolbarSizeDetectorWrapper-emotion.js +32 -0
- package/dist/cjs/ui/Toolbar/ToolbarWithSizeDetector.js +21 -19
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/Appearance/Comment/FixedToolbar-compiled.compiled.css +20 -0
- package/dist/es2019/ui/Appearance/Comment/FixedToolbar-compiled.js +26 -0
- package/dist/es2019/ui/Appearance/Comment/FixedToolbar-emotion.js +91 -0
- package/dist/es2019/ui/Appearance/Comment/StickyToolbar-compiled.compiled.css +25 -0
- package/dist/es2019/ui/Appearance/Comment/StickyToolbar-compiled.js +51 -0
- package/dist/es2019/ui/Appearance/Comment/StickyToolbar-emotion.js +128 -0
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +10 -133
- package/dist/es2019/ui/Toolbar/ToolbarComponentsWrapper-compiled.compiled.css +2 -0
- package/dist/es2019/ui/Toolbar/ToolbarComponentsWrapper-compiled.js +20 -0
- package/dist/es2019/ui/Toolbar/ToolbarComponentsWrapper-emotion.js +28 -0
- package/dist/es2019/ui/Toolbar/ToolbarInner.js +6 -17
- package/dist/es2019/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.compiled.css +2 -0
- package/dist/es2019/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.js +20 -0
- package/dist/es2019/ui/Toolbar/ToolbarSizeDetectorWrapper-emotion.js +24 -0
- package/dist/es2019/ui/Toolbar/ToolbarWithSizeDetector.js +18 -19
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/Appearance/Comment/FixedToolbar-compiled.compiled.css +20 -0
- package/dist/esm/ui/Appearance/Comment/FixedToolbar-compiled.js +28 -0
- package/dist/esm/ui/Appearance/Comment/FixedToolbar-emotion.js +86 -0
- package/dist/esm/ui/Appearance/Comment/StickyToolbar-compiled.compiled.css +25 -0
- package/dist/esm/ui/Appearance/Comment/StickyToolbar-compiled.js +58 -0
- package/dist/esm/ui/Appearance/Comment/StickyToolbar-emotion.js +124 -0
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +14 -132
- package/dist/esm/ui/Toolbar/ToolbarComponentsWrapper-compiled.compiled.css +2 -0
- package/dist/esm/ui/Toolbar/ToolbarComponentsWrapper-compiled.js +21 -0
- package/dist/esm/ui/Toolbar/ToolbarComponentsWrapper-emotion.js +28 -0
- package/dist/esm/ui/Toolbar/ToolbarInner.js +8 -16
- package/dist/esm/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.compiled.css +2 -0
- package/dist/esm/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.js +21 -0
- package/dist/esm/ui/Toolbar/ToolbarSizeDetectorWrapper-emotion.js +25 -0
- package/dist/esm/ui/Toolbar/ToolbarWithSizeDetector.js +21 -18
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/Appearance/Comment/FixedToolbar-compiled.d.ts +20 -0
- package/dist/types/ui/Appearance/Comment/FixedToolbar-emotion.d.ts +19 -0
- package/dist/types/ui/Appearance/Comment/StickyToolbar-compiled.d.ts +22 -0
- package/dist/types/ui/Appearance/Comment/StickyToolbar-emotion.d.ts +21 -0
- package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +1 -2
- package/dist/types/ui/Toolbar/ToolbarComponentsWrapper-compiled.d.ts +17 -0
- package/dist/types/ui/Toolbar/ToolbarComponentsWrapper-emotion.d.ts +17 -0
- package/dist/types/ui/Toolbar/ToolbarInner.d.ts +1 -6
- package/dist/types/ui/Toolbar/ToolbarSizeDetectorWrapper-compiled.d.ts +17 -0
- package/dist/types/ui/Toolbar/ToolbarSizeDetectorWrapper-emotion.d.ts +17 -0
- package/dist/types/ui/Toolbar/ToolbarWithSizeDetector.d.ts +2 -2
- package/package.json +11 -11
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ToolbarComponentsWrapperEmotion = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _react = require("@emotion/react");
|
|
10
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
|
+
/**
|
|
12
|
+
* @jsxRuntime classic
|
|
13
|
+
* @jsx jsx
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Emotion fallback branch of the `platform_editor_core_non_ecc_static_css` experiment.
|
|
17
|
+
* Used via `componentWithCondition` in `ToolbarInner.tsx`.
|
|
18
|
+
*
|
|
19
|
+
* Cleanup: delete this file once the experiment has shipped.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- intentional: emotion fallback for compiled migration
|
|
23
|
+
|
|
24
|
+
var toolbarComponentsWrapperEmotionStyles = (0, _react.css)((0, _defineProperty2.default)({
|
|
25
|
+
display: 'flex'
|
|
26
|
+
}, "@media (max-width: ".concat(_editorSharedStyles.akEditorMobileMaxWidth, "px)"), {
|
|
27
|
+
justifyContent: 'space-between'
|
|
28
|
+
}));
|
|
29
|
+
var ToolbarComponentsWrapperEmotion = exports.ToolbarComponentsWrapperEmotion = function ToolbarComponentsWrapperEmotion(_ref) {
|
|
30
|
+
var children = _ref.children,
|
|
31
|
+
dataVc = _ref['data-vc'];
|
|
32
|
+
return (0, _react.jsx)("div", {
|
|
33
|
+
css: toolbarComponentsWrapperEmotionStyles,
|
|
34
|
+
"data-vc": dataVc
|
|
35
|
+
}, children);
|
|
36
|
+
};
|
|
@@ -10,22 +10,18 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
10
10
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
11
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
12
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
13
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
var _react2 = require("@emotion/react");
|
|
16
14
|
var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
|
|
17
15
|
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
18
|
-
var
|
|
16
|
+
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
17
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
18
|
+
var _ToolbarComponentsWrapperCompiled = require("./ToolbarComponentsWrapper-compiled");
|
|
19
|
+
var _ToolbarComponentsWrapperEmotion = require("./ToolbarComponentsWrapper-emotion");
|
|
19
20
|
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)); }
|
|
20
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var toolbarComponentsWrapper = (0, _react2.css)((0, _defineProperty2.default)({
|
|
25
|
-
display: 'flex'
|
|
26
|
-
}, "@media (max-width: ".concat(_editorSharedStyles.akEditorMobileMaxWidth, "px)"), {
|
|
27
|
-
justifyContent: 'space-between'
|
|
28
|
-
}));
|
|
21
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
|
+
var ToolbarComponentsWrapperMigration = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
|
|
23
|
+
return (0, _expValEquals.expValEquals)('platform_editor_core_non_ecc_static_css', 'isEnabled', true);
|
|
24
|
+
}, _ToolbarComponentsWrapperCompiled.ToolbarComponentsWrapperCompiled, _ToolbarComponentsWrapperEmotion.ToolbarComponentsWrapperEmotion);
|
|
29
25
|
|
|
30
26
|
// Ignored via go/ees005
|
|
31
27
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
@@ -66,8 +62,7 @@ var ToolbarInner = exports.ToolbarInner = /*#__PURE__*/function (_React$Componen
|
|
|
66
62
|
// Hiding toolbar in SSR until the dependency of screen width is resolved in SSR environment.
|
|
67
63
|
return null;
|
|
68
64
|
}
|
|
69
|
-
return
|
|
70
|
-
css: toolbarComponentsWrapper,
|
|
65
|
+
return /*#__PURE__*/_react.default.createElement(ToolbarComponentsWrapperMigration, {
|
|
71
66
|
"data-vc": "toolbar-inner"
|
|
72
67
|
}, items.map(function (component, key) {
|
|
73
68
|
var element = component({
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* ToolbarSizeDetectorWrapper-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
/**
|
|
3
|
+
* Compiled branch of the `platform_editor_core_non_ecc_static_css` experiment.
|
|
4
|
+
* Used via `componentWithCondition` in `ToolbarWithSizeDetector.tsx`.
|
|
5
|
+
*
|
|
6
|
+
* Cleanup: delete this file once the experiment has shipped.
|
|
7
|
+
*/
|
|
8
|
+
"use strict";
|
|
9
|
+
|
|
10
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
11
|
+
Object.defineProperty(exports, "__esModule", {
|
|
12
|
+
value: true
|
|
13
|
+
});
|
|
14
|
+
exports.ToolbarSizeDetectorWrapperCompiled = void 0;
|
|
15
|
+
require("./ToolbarSizeDetectorWrapper-compiled.compiled.css");
|
|
16
|
+
var React = _interopRequireWildcard(require("react"));
|
|
17
|
+
var _runtime = require("@compiled/react/runtime");
|
|
18
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
19
|
+
var toolbarSizeDetectorWrapperCompiledStyles = {
|
|
20
|
+
root: "_1bsb1osq _kqswh2mm"
|
|
21
|
+
};
|
|
22
|
+
var ToolbarSizeDetectorWrapperCompiled = exports.ToolbarSizeDetectorWrapperCompiled = function ToolbarSizeDetectorWrapperCompiled(_ref) {
|
|
23
|
+
var children = _ref.children,
|
|
24
|
+
style = _ref.style;
|
|
25
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
26
|
+
style: style,
|
|
27
|
+
className: (0, _runtime.ax)([toolbarSizeDetectorWrapperCompiledStyles.root])
|
|
28
|
+
}, children);
|
|
29
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ToolbarSizeDetectorWrapperEmotion = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
8
|
+
/**
|
|
9
|
+
* @jsxRuntime classic
|
|
10
|
+
* @jsx jsx
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Emotion fallback branch of the `platform_editor_core_non_ecc_static_css` experiment.
|
|
14
|
+
* Used via `componentWithCondition` in `ToolbarWithSizeDetector.tsx`.
|
|
15
|
+
*
|
|
16
|
+
* Cleanup: delete this file once the experiment has shipped.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- intentional: emotion fallback for compiled migration
|
|
20
|
+
|
|
21
|
+
var toolbarSizeDetectorWrapperEmotionStyles = (0, _react.css)({
|
|
22
|
+
width: '100%',
|
|
23
|
+
position: 'relative'
|
|
24
|
+
});
|
|
25
|
+
var ToolbarSizeDetectorWrapperEmotion = exports.ToolbarSizeDetectorWrapperEmotion = function ToolbarSizeDetectorWrapperEmotion(_ref) {
|
|
26
|
+
var children = _ref.children,
|
|
27
|
+
style = _ref.style;
|
|
28
|
+
return (0, _react.jsx)("div", {
|
|
29
|
+
css: toolbarSizeDetectorWrapperEmotionStyles,
|
|
30
|
+
style: style
|
|
31
|
+
}, children);
|
|
32
|
+
};
|
|
@@ -8,27 +8,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.ToolbarWithSizeDetector = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
-
var _react2 = require("@emotion/react");
|
|
12
11
|
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
13
12
|
var _types = require("@atlaskit/editor-common/types");
|
|
13
|
+
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
14
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
15
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
15
16
|
var _widthDetector = require("@atlaskit/width-detector");
|
|
16
17
|
var _isFullPage = require("../../utils/is-full-page");
|
|
17
18
|
var _hooks = require("./hooks");
|
|
18
19
|
var _Toolbar = require("./Toolbar");
|
|
19
20
|
var _toolbarSize = require("./toolbar-size");
|
|
21
|
+
var _ToolbarSizeDetectorWrapperCompiled = require("./ToolbarSizeDetectorWrapper-compiled");
|
|
22
|
+
var _ToolbarSizeDetectorWrapperEmotion = require("./ToolbarSizeDetectorWrapper-emotion");
|
|
20
23
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
|
|
27
|
-
|
|
28
|
-
var toolbar = (0, _react2.css)({
|
|
29
|
-
width: '100%',
|
|
30
|
-
position: 'relative'
|
|
31
|
-
});
|
|
24
|
+
var ToolbarSizeDetectorWrapperMigration = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
|
|
25
|
+
return (0, _expValEquals.expValEquals)('platform_editor_core_non_ecc_static_css', 'isEnabled', true);
|
|
26
|
+
}, _ToolbarSizeDetectorWrapperCompiled.ToolbarSizeDetectorWrapperCompiled, _ToolbarSizeDetectorWrapperEmotion.ToolbarSizeDetectorWrapperEmotion);
|
|
32
27
|
var ToolbarWithSizeDetector = exports.ToolbarWithSizeDetector = function ToolbarWithSizeDetector(props) {
|
|
33
28
|
var ref = _react.default.useRef(null);
|
|
34
29
|
var _React$useState = _react.default.useState(undefined),
|
|
@@ -54,14 +49,21 @@ var ToolbarWithSizeDetector = exports.ToolbarWithSizeDetector = function Toolbar
|
|
|
54
49
|
return isPreviewPanelResponsivenessEnabled ? 'fit-content' : '254px';
|
|
55
50
|
}
|
|
56
51
|
}, [props.appearance, props.hasMinWidth, props.twoLineEditorToolbar]);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
style: {
|
|
52
|
+
var memoizedWrapperStyle = (0, _react.useMemo)(function () {
|
|
53
|
+
return {
|
|
60
54
|
minWidth: minWidthValue
|
|
61
|
-
}
|
|
62
|
-
},
|
|
55
|
+
};
|
|
56
|
+
}, [minWidthValue]);
|
|
57
|
+
var wrapperStyle = (0, _expValEquals.expValEquals)('platform_editor_core_non_ecc_static_css', 'isEnabled', true) ? memoizedWrapperStyle : {
|
|
58
|
+
minWidth: minWidthValue
|
|
59
|
+
};
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(ToolbarSizeDetectorWrapperMigration
|
|
61
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- minWidth is computed dynamically from props.hasMinWidth, props.appearance, props.twoLineEditorToolbar, and the platform_editor_preview_panel_responsiveness experiment, so it cannot be expressed as a static css value.
|
|
62
|
+
, {
|
|
63
|
+
style: wrapperStyle
|
|
64
|
+
}, /*#__PURE__*/_react.default.createElement(_widthDetector.WidthObserver, {
|
|
63
65
|
setWidth: setWidth
|
|
64
|
-
}), props.editorView && toolbarSize ?
|
|
66
|
+
}), props.editorView && toolbarSize ? /*#__PURE__*/_react.default.createElement(_Toolbar.Toolbar, {
|
|
65
67
|
toolbarSize: toolbarSize,
|
|
66
68
|
items: props.items,
|
|
67
69
|
editorView: props.editorView,
|
|
@@ -77,7 +79,7 @@ var ToolbarWithSizeDetector = exports.ToolbarWithSizeDetector = function Toolbar
|
|
|
77
79
|
containerElement: props.containerElement,
|
|
78
80
|
hasMinWidth: props.hasMinWidth,
|
|
79
81
|
twoLineEditorToolbar: props.twoLineEditorToolbar
|
|
80
|
-
}) :
|
|
82
|
+
}) : /*#__PURE__*/_react.default.createElement("div", {
|
|
81
83
|
ref: ref
|
|
82
84
|
}));
|
|
83
85
|
};
|
|
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.name = void 0;
|
|
7
7
|
var name = exports.name = "@atlaskit/editor-core";
|
|
8
8
|
// eslint-disable-next-line @atlaskit/volt-strict-mode/no-multiple-exports
|
|
9
|
-
var version = exports.version = "221.
|
|
9
|
+
var version = exports.version = "221.2.0";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko12c2{border-radius:var(--ds-radius-medium,6px) var(--ds-radius-medium,6px) 0 0}
|
|
3
|
+
._2rko15b0{border-radius:var(--ds-radius-xlarge,9pt) var(--ds-radius-xlarge,9pt) 0 0}
|
|
4
|
+
._2rko1cku{border-radius:var(--ds-radius-small,3px) var(--ds-radius-small,3px) 0 0}._10ytglyw.show-keyline{box-shadow:none}
|
|
5
|
+
._16qsglyw{box-shadow:none}
|
|
6
|
+
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
7
|
+
._19bvv47k{padding-left:var(--ds-space-250,20px)}
|
|
8
|
+
._1cuzidpf .block-type-btn{padding-left:0}
|
|
9
|
+
._1e0c1txw{display:flex}
|
|
10
|
+
._1khpidpf >div>div:first-of-type:not(style){margin-left:0}
|
|
11
|
+
._3pwj1osq span svg{max-width:100%}
|
|
12
|
+
._4cvr1h6o{align-items:center}
|
|
13
|
+
._4t3i1wug{height:auto}
|
|
14
|
+
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
15
|
+
._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
|
|
16
|
+
._kqswh2mm{position:relative}
|
|
17
|
+
._lg5oidpf >div>style:first-of-type+*{margin-left:0}
|
|
18
|
+
._n3tdidpf{padding-bottom:0}
|
|
19
|
+
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
20
|
+
@media (max-width:490px){._1q27esu3>div>div:first-of-type>div:nth-of-type(2){justify-content:flex-end}._16ec1txw>div>div:first-of-type>div:nth-of-type(2){display:flex}._1uq61sxn>div{flex-direction:column-reverse}._cnpmh9n0>div{align-items:end}._1djy1txw>div{display:flex}._17mgesu3>div{justify-content:flex-end}}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* FixedToolbar-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
/**
|
|
3
|
+
* Compiled branch of the `platform_editor_core_non_ecc_static_css` experiment.
|
|
4
|
+
* Used via `componentWithCondition` in `Toolbar.tsx`.
|
|
5
|
+
*
|
|
6
|
+
* Cleanup: delete this file once the experiment has shipped.
|
|
7
|
+
*/
|
|
8
|
+
import "./FixedToolbar-compiled.compiled.css";
|
|
9
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
|
+
const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
|
|
14
|
+
const fixedToolbarCompiledStyles = {
|
|
15
|
+
mainToolbarWrapper: "_kqswh2mm _4cvr1h6o _ca0qu2gc _u5f3u2gc _n3tdidpf _19bvv47k _1e0c1txw _4t3i1wug _bfhkvuon _16qsglyw _1khpidpf _lg5oidpf _1cuzidpf",
|
|
16
|
+
mainToolbarWithoutLeftPadding: "_ca0qu2gc _u5f3u2gc _n3tdidpf _19bvu2gc",
|
|
17
|
+
mainToolbarTwoLine: "_1uq61sxn _cnpmh9n0 _1djy1txw _17mgesu3 _1q27esu3 _16ec1txw",
|
|
18
|
+
mainToolbarWrapperVisualRefresh: "_3pwj1osq",
|
|
19
|
+
mainToolbarWithRadius: "_2rko1cku",
|
|
20
|
+
mainToolbarRadius: "_2rko12c2",
|
|
21
|
+
editorModernisationToolbar: "_2rko15b0 _10ytglyw"
|
|
22
|
+
};
|
|
23
|
+
export const FixedToolbarCompiled = props => /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
"data-testid": "ak-editor-main-toolbar",
|
|
25
|
+
className: ax([fixedToolbarCompiledStyles.mainToolbarWrapper, props.twoLineEditorToolbar && fixedToolbarCompiledStyles.mainToolbarTwoLine, fixedToolbarCompiledStyles.mainToolbarWrapperVisualRefresh, props.isNewToolbarEnabled && fixedToolbarCompiledStyles.mainToolbarWithoutLeftPadding, !expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && fg('platform_editor_comments_border_radius') && fixedToolbarCompiledStyles.mainToolbarWithRadius, expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && fixedToolbarCompiledStyles.mainToolbarRadius, props.isEditorModernisationEnabled && fixedToolbarCompiledStyles.editorModernisationToolbar])
|
|
26
|
+
}, props.children);
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Emotion fallback branch of the `platform_editor_core_non_ecc_static_css` experiment.
|
|
7
|
+
* Used via `componentWithCondition` in `Toolbar.tsx`.
|
|
8
|
+
*
|
|
9
|
+
* Cleanup: delete this file once the experiment has shipped.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- intentional: emotion fallback for compiled migration
|
|
13
|
+
import { css, jsx } from '@emotion/react';
|
|
14
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
16
|
+
const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
|
|
17
|
+
const mainToolbarWrapperStyleNew = css({
|
|
18
|
+
position: 'relative',
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-100, 8px)"} 0`,
|
|
21
|
+
display: 'flex',
|
|
22
|
+
height: 'auto',
|
|
23
|
+
backgroundColor: "var(--ds-surface, #FFFFFF)",
|
|
24
|
+
boxShadow: 'none',
|
|
25
|
+
paddingLeft: "var(--ds-space-250, 20px)",
|
|
26
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
27
|
+
'> div': {
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
29
|
+
'> div:first-of-type:not(style), > style:first-of-type + *': {
|
|
30
|
+
marginLeft: 0
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
34
|
+
'.block-type-btn': {
|
|
35
|
+
paddingLeft: 0
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
/** keep default padding for entire toolbar */
|
|
40
|
+
const mainToolbarWithoutLeftPadding = css({
|
|
41
|
+
padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-100, 8px)"} 0`
|
|
42
|
+
});
|
|
43
|
+
const mainToolbarTwoLineStylesNew = css({
|
|
44
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
45
|
+
'& > div': {
|
|
46
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
47
|
+
[`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
|
|
48
|
+
flexDirection: 'column-reverse',
|
|
49
|
+
alignItems: 'end',
|
|
50
|
+
display: 'flex',
|
|
51
|
+
justifyContent: 'flex-end'
|
|
52
|
+
},
|
|
53
|
+
/* make this more explicit for a toolbar */
|
|
54
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
55
|
+
'> div:first-of-type': {
|
|
56
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
57
|
+
[`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
|
|
58
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
59
|
+
'> div:nth-of-type(2)': {
|
|
60
|
+
justifyContent: 'flex-end',
|
|
61
|
+
display: 'flex'
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const mainToolbarWrapperStylesVisualRefresh = css({
|
|
68
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
69
|
+
'span svg': {
|
|
70
|
+
maxWidth: '100%'
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
const mainToolbarWithRadiusStyle = css({
|
|
74
|
+
borderRadius: `${"var(--ds-radius-small, 3px)"} ${"var(--ds-radius-small, 3px)"} 0 0`
|
|
75
|
+
});
|
|
76
|
+
const mainToolbarRadius = css({
|
|
77
|
+
borderRadius: `${"var(--ds-radius-medium, 6px)"} ${"var(--ds-radius-medium, 6px)"} 0 0`
|
|
78
|
+
});
|
|
79
|
+
const editorModernisationToolbarStyle = css({
|
|
80
|
+
borderRadius: `${"var(--ds-radius-xlarge, 12px)"} ${"var(--ds-radius-xlarge, 12px)"} 0 0`,
|
|
81
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
82
|
+
'&.show-keyline': {
|
|
83
|
+
boxShadow: 'none'
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
export const FixedToolbarEmotion = props =>
|
|
87
|
+
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
88
|
+
jsx("div", {
|
|
89
|
+
css: [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, mainToolbarWrapperStylesVisualRefresh, props.isNewToolbarEnabled && mainToolbarWithoutLeftPadding, !expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && fg('platform_editor_comments_border_radius') && mainToolbarWithRadiusStyle, expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && mainToolbarRadius, props.isEditorModernisationEnabled && editorModernisationToolbarStyle],
|
|
90
|
+
"data-testid": "ak-editor-main-toolbar"
|
|
91
|
+
}, props.children);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko12c2{border-radius:var(--ds-radius-medium,6px) var(--ds-radius-medium,6px) 0 0}
|
|
3
|
+
._2rko15b0{border-radius:var(--ds-radius-xlarge,9pt) var(--ds-radius-xlarge,9pt) 0 0}
|
|
4
|
+
._2rko1cku{border-radius:var(--ds-radius-small,3px) var(--ds-radius-small,3px) 0 0}
|
|
5
|
+
._v56416gf{transition:box-shadow .2s ease-in-out}._10ytglyw.show-keyline{box-shadow:none}
|
|
6
|
+
._10ytl2q5.show-keyline{box-shadow:0 2px 0 0 var(--ds-background-accent-gray-subtlest,#f0f1f2)}
|
|
7
|
+
._16qsglyw{box-shadow:none}
|
|
8
|
+
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
9
|
+
._19bvv47k{padding-left:var(--ds-space-250,20px)}
|
|
10
|
+
._1cuzidpf .block-type-btn{padding-left:0}
|
|
11
|
+
._1e0c1txw{display:flex}
|
|
12
|
+
._1khpidpf >div>div:first-of-type:not(style){margin-left:0}
|
|
13
|
+
._1pbybfng{z-index:500}
|
|
14
|
+
._3pwj1osq span svg{max-width:100%}
|
|
15
|
+
._4cvr1h6o{align-items:center}
|
|
16
|
+
._4t3i1wug{height:auto}
|
|
17
|
+
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
18
|
+
._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
|
|
19
|
+
._kqsw1if8{position:sticky}
|
|
20
|
+
._kqswh2mm{position:relative}
|
|
21
|
+
._lg5oidpf >div>style:first-of-type+*{margin-left:0}
|
|
22
|
+
._n3tdidpf{padding-bottom:0}
|
|
23
|
+
._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
|
|
24
|
+
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
25
|
+
@media (max-width:490px){._1q27esu3>div>div:first-of-type>div:nth-of-type(2){justify-content:flex-end}._16ec1txw>div>div:first-of-type>div:nth-of-type(2){display:flex}._1uq61sxn>div{flex-direction:column-reverse}._cnpmh9n0>div{align-items:end}._1djy1txw>div{display:flex}._17mgesu3>div{justify-content:flex-end}}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* StickyToolbar-compiled.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
/**
|
|
3
|
+
* Compiled branch of the `platform_editor_core_non_ecc_static_css` experiment.
|
|
4
|
+
* Used via `componentWithCondition` in `Toolbar.tsx`.
|
|
5
|
+
*
|
|
6
|
+
* Cleanup: delete this file once the experiment has shipped.
|
|
7
|
+
*/
|
|
8
|
+
import "./StickyToolbar-compiled.compiled.css";
|
|
9
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
10
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
13
|
+
const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
|
|
14
|
+
const akEditorMenuZIndex = 500;
|
|
15
|
+
const akEditorToolbarKeylineHeight = 2;
|
|
16
|
+
const stickyToolbarCompiledStyles = {
|
|
17
|
+
mainToolbarWrapper: "_kqswh2mm _4cvr1h6o _ca0qu2gc _u5f3u2gc _n3tdidpf _19bvv47k _1e0c1txw _4t3i1wug _bfhkvuon _16qsglyw _1khpidpf _lg5oidpf _1cuzidpf",
|
|
18
|
+
mainToolbarWithPadding: "_ca0qu2gc _u5f3u2gc _n3tdu2gc _19bvu2gc",
|
|
19
|
+
mainToolbarTwoLine: "_1uq61sxn _cnpmh9n0 _1djy1txw _17mgesu3 _1q27esu3 _16ec1txw",
|
|
20
|
+
mainToolbarWrapperVisualRefresh: "_3pwj1osq",
|
|
21
|
+
mainToolbarWithRadius: "_2rko1cku",
|
|
22
|
+
mainToolbarRadius: "_2rko12c2",
|
|
23
|
+
editorModernisationToolbar: "_2rko15b0 _10ytglyw",
|
|
24
|
+
stickyToolbarWrapper: "_v56416gf _kqsw1if8 _n3tdu2gc _1pbybfng _10ytl2q5"
|
|
25
|
+
};
|
|
26
|
+
export const StickyToolbarCompiled = props => {
|
|
27
|
+
const [top, setTop] = useState(0);
|
|
28
|
+
|
|
29
|
+
// ED-15802: if externalToolbarRef is passed in, set top to externalToolbarRef?.current?.clientHeight
|
|
30
|
+
// else if offsetTop is a number set top to offsetTop
|
|
31
|
+
// otherwise top is 0 as initial state
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
var _props$externalToolba, _props$externalToolba2;
|
|
34
|
+
if ((_props$externalToolba = props.externalToolbarRef) !== null && _props$externalToolba !== void 0 && (_props$externalToolba2 = _props$externalToolba.current) !== null && _props$externalToolba2 !== void 0 && _props$externalToolba2.clientHeight) {
|
|
35
|
+
setTop(props.externalToolbarRef.current.clientHeight);
|
|
36
|
+
} else {
|
|
37
|
+
setTop(props.offsetTop || 0);
|
|
38
|
+
}
|
|
39
|
+
}, [props.externalToolbarRef, props.offsetTop]);
|
|
40
|
+
const wrapperStyle = useMemo(() => ({
|
|
41
|
+
top: `${top}px`
|
|
42
|
+
}), [top]);
|
|
43
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/enforce-style-prop -- top is computed dynamically from externalToolbarRef height / offsetTop and cannot be a static css value
|
|
45
|
+
style: wrapperStyle,
|
|
46
|
+
"data-testid": "ak-editor-main-toolbar"
|
|
47
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
48
|
+
,
|
|
49
|
+
className: ax([stickyToolbarCompiledStyles.mainToolbarWrapper, props.twoLineEditorToolbar && stickyToolbarCompiledStyles.mainToolbarTwoLine, stickyToolbarCompiledStyles.mainToolbarWrapperVisualRefresh, stickyToolbarCompiledStyles.stickyToolbarWrapper, props.isNewToolbarEnabled && stickyToolbarCompiledStyles.mainToolbarWithPadding, expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && stickyToolbarCompiledStyles.mainToolbarRadius, !expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && fg('platform_editor_comments_border_radius') && stickyToolbarCompiledStyles.mainToolbarWithRadius, props.isEditorModernisationEnabled && stickyToolbarCompiledStyles.editorModernisationToolbar, 'show-keyline'])
|
|
50
|
+
}, props.children);
|
|
51
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @jsxRuntime classic
|
|
3
|
+
* @jsx jsx
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Emotion fallback branch of the `platform_editor_core_non_ecc_static_css` experiment.
|
|
7
|
+
* Used via `componentWithCondition` in `Toolbar.tsx`.
|
|
8
|
+
*
|
|
9
|
+
* Cleanup: delete this file once the experiment has shipped.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { useEffect, useState } from 'react';
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- intentional: emotion fallback for compiled migration
|
|
15
|
+
import { css, jsx } from '@emotion/react';
|
|
16
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
18
|
+
const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
|
|
19
|
+
const akEditorMenuZIndex = 500;
|
|
20
|
+
const akEditorToolbarKeylineHeight = 2;
|
|
21
|
+
const mainToolbarWrapperStyleNew = css({
|
|
22
|
+
position: 'relative',
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-100, 8px)"} 0`,
|
|
25
|
+
display: 'flex',
|
|
26
|
+
height: 'auto',
|
|
27
|
+
backgroundColor: "var(--ds-surface, #FFFFFF)",
|
|
28
|
+
boxShadow: 'none',
|
|
29
|
+
paddingLeft: "var(--ds-space-250, 20px)",
|
|
30
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
31
|
+
'> div': {
|
|
32
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
33
|
+
'> div:first-of-type:not(style), > style:first-of-type + *': {
|
|
34
|
+
marginLeft: 0
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
38
|
+
'.block-type-btn': {
|
|
39
|
+
paddingLeft: 0
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const mainToolbarWithPadding = css({
|
|
43
|
+
padding: `${"var(--ds-space-100, 8px)"}`
|
|
44
|
+
});
|
|
45
|
+
const mainToolbarTwoLineStylesNew = css({
|
|
46
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
47
|
+
'& > div': {
|
|
48
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
49
|
+
[`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
|
|
50
|
+
flexDirection: 'column-reverse',
|
|
51
|
+
alignItems: 'end',
|
|
52
|
+
display: 'flex',
|
|
53
|
+
justifyContent: 'flex-end'
|
|
54
|
+
},
|
|
55
|
+
/* make this more explicit for a toolbar */
|
|
56
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
57
|
+
'> div:first-of-type': {
|
|
58
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values
|
|
59
|
+
[`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
|
|
60
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors
|
|
61
|
+
'> div:nth-of-type(2)': {
|
|
62
|
+
justifyContent: 'flex-end',
|
|
63
|
+
display: 'flex'
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
const mainToolbarWrapperStylesVisualRefresh = css({
|
|
70
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
71
|
+
'span svg': {
|
|
72
|
+
maxWidth: '100%'
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
const mainToolbarWithRadiusStyle = css({
|
|
76
|
+
borderRadius: `${"var(--ds-radius-small, 3px)"} ${"var(--ds-radius-small, 3px)"} 0 0`
|
|
77
|
+
});
|
|
78
|
+
const mainToolbarRadius = css({
|
|
79
|
+
borderRadius: `${"var(--ds-radius-medium, 6px)"} ${"var(--ds-radius-medium, 6px)"} 0 0`
|
|
80
|
+
});
|
|
81
|
+
const editorModernisationToolbarStyle = css({
|
|
82
|
+
borderRadius: `${"var(--ds-radius-xlarge, 12px)"} ${"var(--ds-radius-xlarge, 12px)"} 0 0`,
|
|
83
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
84
|
+
'&.show-keyline': {
|
|
85
|
+
boxShadow: 'none'
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
const stickyToolbarWrapperStyleNew = css({
|
|
89
|
+
position: 'sticky',
|
|
90
|
+
paddingBottom: "var(--ds-space-100, 8px)",
|
|
91
|
+
zIndex: akEditorMenuZIndex,
|
|
92
|
+
transition: 'box-shadow ease-in-out 0.2s',
|
|
93
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
94
|
+
'&.show-keyline': {
|
|
95
|
+
boxShadow: `0 ${akEditorToolbarKeylineHeight}px 0 0 ${"var(--ds-background-accent-gray-subtlest, #F0F1F2)"}`
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
export const StickyToolbarEmotion = props => {
|
|
99
|
+
const [top, setTop] = useState(0);
|
|
100
|
+
|
|
101
|
+
// ED-15802: if externalToolbarRef is passed in, set top to externalToolbarRef?.current?.clientHeight
|
|
102
|
+
// else if offsetTop is a number set top to offsetTop
|
|
103
|
+
// otherwise top is 0 as initial state
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
var _props$externalToolba, _props$externalToolba2;
|
|
106
|
+
if ((_props$externalToolba = props.externalToolbarRef) !== null && _props$externalToolba !== void 0 && (_props$externalToolba2 = _props$externalToolba.current) !== null && _props$externalToolba2 !== void 0 && _props$externalToolba2.clientHeight) {
|
|
107
|
+
setTop(props.externalToolbarRef.current.clientHeight);
|
|
108
|
+
} else {
|
|
109
|
+
setTop(props.offsetTop || 0);
|
|
110
|
+
}
|
|
111
|
+
}, [props.externalToolbarRef, props.offsetTop]);
|
|
112
|
+
const wrapperStyle = {
|
|
113
|
+
top: `${top}px`
|
|
114
|
+
};
|
|
115
|
+
return (
|
|
116
|
+
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
117
|
+
jsx("div", {
|
|
118
|
+
css: [mainToolbarWrapperStyleNew, props.twoLineEditorToolbar && mainToolbarTwoLineStylesNew, mainToolbarWrapperStylesVisualRefresh, stickyToolbarWrapperStyleNew, props.isNewToolbarEnabled && mainToolbarWithPadding, expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && mainToolbarRadius, !expValEquals('platform_editor_comment_editor_border_radius', 'isEnabled', true) && fg('platform_editor_comments_border_radius') && mainToolbarWithRadiusStyle, props.isEditorModernisationEnabled && editorModernisationToolbarStyle]
|
|
119
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview, @atlaskit/ui-styling-standard/enforce-style-prop -- top is computed dynamically from externalToolbarRef height / offsetTop and cannot be a static css value
|
|
120
|
+
,
|
|
121
|
+
style: wrapperStyle,
|
|
122
|
+
"data-testid": "ak-editor-main-toolbar"
|
|
123
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
124
|
+
,
|
|
125
|
+
className: 'show-keyline'
|
|
126
|
+
}, props.children)
|
|
127
|
+
);
|
|
128
|
+
};
|