@atlaskit/editor-core 191.0.9 → 191.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/ui/Appearance/Comment/Comment.js +6 -3
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +19 -6
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +6 -3
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +38 -6
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +6 -3
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +19 -6
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/Appearance/Comment/Toolbar.d.ts +2 -1
- package/dist/types-ts4.5/ui/Appearance/Comment/Toolbar.d.ts +2 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 191.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#64683](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64683) [`79c9857b9edb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/79c9857b9edb) - [ux] [EDF-73] - Added ability for products to toggle on two-line toolbar for comment editors
|
|
8
|
+
|
|
3
9
|
## 191.0.9
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -103,6 +103,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
103
103
|
//Alt + F9 to reach first element in this main toolbar
|
|
104
104
|
return event.altKey && (event.key === 'F9' || event.keyCode === 120);
|
|
105
105
|
};
|
|
106
|
+
var isTwoLineToolbarEnabled = !!customPrimaryToolbarComponents && !!(featureFlags !== null && featureFlags !== void 0 && featureFlags.twoLineEditorToolbar);
|
|
106
107
|
var handleEscape = function handleEscape(event) {
|
|
107
108
|
if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
108
109
|
editorView === null || editorView === void 0 || editorView.focus();
|
|
@@ -117,7 +118,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
117
118
|
className: "akEditor",
|
|
118
119
|
ref: _this.wrapperElementRef
|
|
119
120
|
}, (0, _react2.jsx)(_Toolbar2.MainToolbar, {
|
|
120
|
-
useStickyToolbar: useStickyToolbar
|
|
121
|
+
useStickyToolbar: useStickyToolbar,
|
|
122
|
+
twoLineEditorToolbar: isTwoLineToolbarEnabled
|
|
121
123
|
}, (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
|
|
122
124
|
editorView: editorView,
|
|
123
125
|
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
@@ -138,9 +140,10 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
138
140
|
popupsScrollableElement: popupsScrollableElement,
|
|
139
141
|
disabled: !!disabled,
|
|
140
142
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
141
|
-
containerElement: _this.containerElement
|
|
143
|
+
containerElement: _this.containerElement,
|
|
144
|
+
twoLineEditorToolbar: isTwoLineToolbarEnabled
|
|
142
145
|
}), (0, _react2.jsx)("div", {
|
|
143
|
-
css: _Toolbar2.mainToolbarCustomComponentsSlotStyle
|
|
146
|
+
css: (0, _Toolbar2.mainToolbarCustomComponentsSlotStyle)(isTwoLineToolbarEnabled)
|
|
144
147
|
}, customPrimaryToolbarComponents))), (0, _react2.jsx)(_Addon.ClickAreaBlock, {
|
|
145
148
|
editorView: editorView,
|
|
146
149
|
editorDisabled: disabled
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.mainToolbarCustomComponentsSlotStyle = exports.TableControlsPadding = exports.MainToolbar = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
10
11
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
@@ -18,7 +19,11 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
|
18
19
|
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); }
|
|
19
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(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; }
|
|
20
21
|
var TableControlsPadding = exports.TableControlsPadding = 20;
|
|
21
|
-
var
|
|
22
|
+
var MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
|
|
23
|
+
var mainToolbarWrapperStyle = function mainToolbarWrapperStyle() {
|
|
24
|
+
var isTwoLineEditorToolbar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
25
|
+
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n position: relative;\n align-items: center;\n padding: ", " ", " 0;\n display: flex;\n height: auto;\n background-color: ", ";\n box-shadow: none;\n padding-left: ", ";\n\n & > div {\n > :first-child:not(style),\n > style:first-child + * {\n margin-left: 0;\n }\n ", "\n }\n\n .block-type-btn {\n padding-left: 0;\n }\n"])), "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-surface, white)", "var(--ds-space-250, 20px)", isTwoLineEditorToolbar && "\n @media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px) {\n flex-direction: column-reverse;\n align-items: end;\n display: flex;\n justify-content: flex-end;\n }\n\n //make this more explicit for a toolbar\n > *:nth-child(1) {\n @media (max-width: ").concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px) {\n > div:nth-child(2) {\n justify-content: flex-end;\n display: flex;\n }\n }\n }\n "));
|
|
26
|
+
};
|
|
22
27
|
var stickyToolbarWrapperStyle = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n /* stylelint-disable declaration-block-no-duplicate-properties */\n position: relative;\n position: sticky;\n /* stylelint-enable declaration-block-no-duplicate-properties */\n padding-bottom: ", ";\n z-index: ", ";\n transition: box-shadow ease-in-out 0.2s;\n &.show-keyline {\n box-shadow: 0 ", "px 0 0\n ", ";\n }\n"])), "var(--ds-space-100, 8px)", _editorSharedStyles.akEditorMenuZIndex, _editorSharedStyles.akEditorToolbarKeylineHeight, "var(--ds-border, ".concat(_colors.N30, ")"));
|
|
23
28
|
var StickyToolbar = function StickyToolbar(props) {
|
|
24
29
|
var _useState = (0, _react.useState)(0),
|
|
@@ -38,14 +43,14 @@ var StickyToolbar = function StickyToolbar(props) {
|
|
|
38
43
|
}
|
|
39
44
|
}, [props.externalToolbarRef, props.offsetTop]);
|
|
40
45
|
return (0, _react2.jsx)("div", {
|
|
41
|
-
css: [mainToolbarWrapperStyle, stickyToolbarWrapperStyle, (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n top: ", "px;\n "])), top)],
|
|
46
|
+
css: [mainToolbarWrapperStyle(props.twoLineEditorToolbar), stickyToolbarWrapperStyle, (0, _react2.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n top: ", "px;\n "])), top)],
|
|
42
47
|
"data-testid": "ak-editor-main-toolbar",
|
|
43
48
|
className: 'show-keyline'
|
|
44
49
|
}, props.children);
|
|
45
50
|
};
|
|
46
51
|
var FixedToolbar = function FixedToolbar(props) {
|
|
47
52
|
return (0, _react2.jsx)("div", {
|
|
48
|
-
css: mainToolbarWrapperStyle,
|
|
53
|
+
css: mainToolbarWrapperStyle(props.twoLineEditorToolbar),
|
|
49
54
|
"data-testid": "ak-editor-main-toolbar"
|
|
50
55
|
}, props.children);
|
|
51
56
|
};
|
|
@@ -79,10 +84,18 @@ var getStickyParameters = function getStickyParameters(configuration) {
|
|
|
79
84
|
};
|
|
80
85
|
var MainToolbar = exports.MainToolbar = function MainToolbar(_ref) {
|
|
81
86
|
var useStickyToolbar = _ref.useStickyToolbar,
|
|
87
|
+
twoLineEditorToolbar = _ref.twoLineEditorToolbar,
|
|
82
88
|
children = _ref.children;
|
|
83
89
|
if (useStickyToolbar) {
|
|
84
|
-
return (0, _react2.jsx)(StickyToolbar, getStickyParameters(useStickyToolbar),
|
|
90
|
+
return (0, _react2.jsx)(StickyToolbar, (0, _extends2.default)({}, getStickyParameters(useStickyToolbar), {
|
|
91
|
+
twoLineEditorToolbar: twoLineEditorToolbar
|
|
92
|
+
}), children);
|
|
85
93
|
}
|
|
86
|
-
return (0, _react2.jsx)(FixedToolbar,
|
|
94
|
+
return (0, _react2.jsx)(FixedToolbar, {
|
|
95
|
+
twoLineEditorToolbar: twoLineEditorToolbar
|
|
96
|
+
}, children);
|
|
87
97
|
};
|
|
88
|
-
var mainToolbarCustomComponentsSlotStyle = exports.mainToolbarCustomComponentsSlotStyle =
|
|
98
|
+
var mainToolbarCustomComponentsSlotStyle = exports.mainToolbarCustomComponentsSlotStyle = function mainToolbarCustomComponentsSlotStyle() {
|
|
99
|
+
var isTwoLineEditorToolbar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
100
|
+
return (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n padding-right: ", ";\n ", "\n > div {\n display: flex;\n flex-shrink: 0;\n }\n"])), "var(--ds-space-250, 20px)", isTwoLineEditorToolbar && "\n @media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px) {\n {\n padding-right: 0;\n }\n }\n "));
|
|
101
|
+
};
|
|
@@ -128,6 +128,7 @@ class Editor extends React.Component {
|
|
|
128
128
|
//Alt + F9 to reach first element in this main toolbar
|
|
129
129
|
return event.altKey && (event.key === 'F9' || event.keyCode === 120);
|
|
130
130
|
};
|
|
131
|
+
const isTwoLineToolbarEnabled = !!customPrimaryToolbarComponents && !!(featureFlags !== null && featureFlags !== void 0 && featureFlags.twoLineEditorToolbar);
|
|
131
132
|
const handleEscape = event => {
|
|
132
133
|
if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
133
134
|
editorView === null || editorView === void 0 ? void 0 : editorView.focus();
|
|
@@ -144,7 +145,8 @@ class Editor extends React.Component {
|
|
|
144
145
|
className: "akEditor",
|
|
145
146
|
ref: this.wrapperElementRef
|
|
146
147
|
}, jsx(MainToolbar, {
|
|
147
|
-
useStickyToolbar: useStickyToolbar
|
|
148
|
+
useStickyToolbar: useStickyToolbar,
|
|
149
|
+
twoLineEditorToolbar: isTwoLineToolbarEnabled
|
|
148
150
|
}, jsx(ToolbarArrowKeyNavigationProvider, {
|
|
149
151
|
editorView: editorView,
|
|
150
152
|
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
@@ -165,9 +167,10 @@ class Editor extends React.Component {
|
|
|
165
167
|
popupsScrollableElement: popupsScrollableElement,
|
|
166
168
|
disabled: !!disabled,
|
|
167
169
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
168
|
-
containerElement: this.containerElement
|
|
170
|
+
containerElement: this.containerElement,
|
|
171
|
+
twoLineEditorToolbar: isTwoLineToolbarEnabled
|
|
169
172
|
}), jsx("div", {
|
|
170
|
-
css: mainToolbarCustomComponentsSlotStyle
|
|
173
|
+
css: mainToolbarCustomComponentsSlotStyle(isTwoLineToolbarEnabled)
|
|
171
174
|
}, customPrimaryToolbarComponents))), jsx(ClickAreaBlock, {
|
|
172
175
|
editorView: editorView,
|
|
173
176
|
editorDisabled: disabled
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
/** @jsx jsx */
|
|
2
3
|
|
|
3
4
|
import React, { useEffect, useState } from 'react';
|
|
@@ -5,7 +6,8 @@ import { css, jsx } from '@emotion/react';
|
|
|
5
6
|
import { N30 } from '@atlaskit/theme/colors';
|
|
6
7
|
import { akEditorToolbarKeylineHeight, akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
7
8
|
export const TableControlsPadding = 20;
|
|
8
|
-
const
|
|
9
|
+
const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
|
|
10
|
+
const mainToolbarWrapperStyle = (isTwoLineEditorToolbar = false) => css`
|
|
9
11
|
position: relative;
|
|
10
12
|
align-items: center;
|
|
11
13
|
padding: ${"var(--ds-space-100, 8px)"} ${"var(--ds-space-100, 8px)"} 0;
|
|
@@ -20,6 +22,24 @@ const mainToolbarWrapperStyle = css`
|
|
|
20
22
|
> style:first-child + * {
|
|
21
23
|
margin-left: 0;
|
|
22
24
|
}
|
|
25
|
+
${isTwoLineEditorToolbar && `
|
|
26
|
+
@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px) {
|
|
27
|
+
flex-direction: column-reverse;
|
|
28
|
+
align-items: end;
|
|
29
|
+
display: flex;
|
|
30
|
+
justify-content: flex-end;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//make this more explicit for a toolbar
|
|
34
|
+
> *:nth-child(1) {
|
|
35
|
+
@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px) {
|
|
36
|
+
> div:nth-child(2) {
|
|
37
|
+
justify-content: flex-end;
|
|
38
|
+
display: flex;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`}
|
|
23
43
|
}
|
|
24
44
|
|
|
25
45
|
.block-type-btn {
|
|
@@ -54,7 +74,7 @@ const StickyToolbar = props => {
|
|
|
54
74
|
}
|
|
55
75
|
}, [props.externalToolbarRef, props.offsetTop]);
|
|
56
76
|
return jsx("div", {
|
|
57
|
-
css: [mainToolbarWrapperStyle, stickyToolbarWrapperStyle, css`
|
|
77
|
+
css: [mainToolbarWrapperStyle(props.twoLineEditorToolbar), stickyToolbarWrapperStyle, css`
|
|
58
78
|
top: ${top}px;
|
|
59
79
|
`],
|
|
60
80
|
"data-testid": "ak-editor-main-toolbar",
|
|
@@ -62,7 +82,7 @@ const StickyToolbar = props => {
|
|
|
62
82
|
}, props.children);
|
|
63
83
|
};
|
|
64
84
|
const FixedToolbar = props => jsx("div", {
|
|
65
|
-
css: mainToolbarWrapperStyle,
|
|
85
|
+
css: mainToolbarWrapperStyle(props.twoLineEditorToolbar),
|
|
66
86
|
"data-testid": "ak-editor-main-toolbar"
|
|
67
87
|
}, props.children);
|
|
68
88
|
|
|
@@ -95,19 +115,31 @@ const getStickyParameters = configuration => {
|
|
|
95
115
|
};
|
|
96
116
|
export const MainToolbar = ({
|
|
97
117
|
useStickyToolbar,
|
|
118
|
+
twoLineEditorToolbar,
|
|
98
119
|
children
|
|
99
120
|
}) => {
|
|
100
121
|
if (useStickyToolbar) {
|
|
101
|
-
return jsx(StickyToolbar, getStickyParameters(useStickyToolbar),
|
|
122
|
+
return jsx(StickyToolbar, _extends({}, getStickyParameters(useStickyToolbar), {
|
|
123
|
+
twoLineEditorToolbar: twoLineEditorToolbar
|
|
124
|
+
}), children);
|
|
102
125
|
}
|
|
103
|
-
return jsx(FixedToolbar,
|
|
126
|
+
return jsx(FixedToolbar, {
|
|
127
|
+
twoLineEditorToolbar: twoLineEditorToolbar
|
|
128
|
+
}, children);
|
|
104
129
|
};
|
|
105
|
-
export const mainToolbarCustomComponentsSlotStyle = css`
|
|
130
|
+
export const mainToolbarCustomComponentsSlotStyle = (isTwoLineEditorToolbar = false) => css`
|
|
106
131
|
display: flex;
|
|
107
132
|
justify-content: flex-end;
|
|
108
133
|
align-items: center;
|
|
109
134
|
flex-grow: 1;
|
|
110
135
|
padding-right: ${"var(--ds-space-250, 20px)"};
|
|
136
|
+
${isTwoLineEditorToolbar && `
|
|
137
|
+
@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px) {
|
|
138
|
+
{
|
|
139
|
+
padding-right: 0;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
`}
|
|
111
143
|
> div {
|
|
112
144
|
display: flex;
|
|
113
145
|
flex-shrink: 0;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "191.0
|
|
2
|
+
export const version = "191.1.0";
|
|
@@ -93,6 +93,7 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
93
93
|
//Alt + F9 to reach first element in this main toolbar
|
|
94
94
|
return event.altKey && (event.key === 'F9' || event.keyCode === 120);
|
|
95
95
|
};
|
|
96
|
+
var isTwoLineToolbarEnabled = !!customPrimaryToolbarComponents && !!(featureFlags !== null && featureFlags !== void 0 && featureFlags.twoLineEditorToolbar);
|
|
96
97
|
var handleEscape = function handleEscape(event) {
|
|
97
98
|
if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
98
99
|
editorView === null || editorView === void 0 || editorView.focus();
|
|
@@ -107,7 +108,8 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
107
108
|
className: "akEditor",
|
|
108
109
|
ref: _this.wrapperElementRef
|
|
109
110
|
}, jsx(MainToolbar, {
|
|
110
|
-
useStickyToolbar: useStickyToolbar
|
|
111
|
+
useStickyToolbar: useStickyToolbar,
|
|
112
|
+
twoLineEditorToolbar: isTwoLineToolbarEnabled
|
|
111
113
|
}, jsx(ToolbarArrowKeyNavigationProvider, {
|
|
112
114
|
editorView: editorView,
|
|
113
115
|
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
@@ -128,9 +130,10 @@ var Editor = /*#__PURE__*/function (_React$Component) {
|
|
|
128
130
|
popupsScrollableElement: popupsScrollableElement,
|
|
129
131
|
disabled: !!disabled,
|
|
130
132
|
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
131
|
-
containerElement: _this.containerElement
|
|
133
|
+
containerElement: _this.containerElement,
|
|
134
|
+
twoLineEditorToolbar: isTwoLineToolbarEnabled
|
|
132
135
|
}), jsx("div", {
|
|
133
|
-
css: mainToolbarCustomComponentsSlotStyle
|
|
136
|
+
css: mainToolbarCustomComponentsSlotStyle(isTwoLineToolbarEnabled)
|
|
134
137
|
}, customPrimaryToolbarComponents))), jsx(ClickAreaBlock, {
|
|
135
138
|
editorView: editorView,
|
|
136
139
|
editorDisabled: disabled
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
4
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
@@ -9,7 +10,11 @@ import { css, jsx } from '@emotion/react';
|
|
|
9
10
|
import { N30 } from '@atlaskit/theme/colors';
|
|
10
11
|
import { akEditorToolbarKeylineHeight, akEditorMenuZIndex } from '@atlaskit/editor-shared-styles';
|
|
11
12
|
export var TableControlsPadding = 20;
|
|
12
|
-
var
|
|
13
|
+
var MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 490;
|
|
14
|
+
var mainToolbarWrapperStyle = function mainToolbarWrapperStyle() {
|
|
15
|
+
var isTwoLineEditorToolbar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
16
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: relative;\n align-items: center;\n padding: ", " ", " 0;\n display: flex;\n height: auto;\n background-color: ", ";\n box-shadow: none;\n padding-left: ", ";\n\n & > div {\n > :first-child:not(style),\n > style:first-child + * {\n margin-left: 0;\n }\n ", "\n }\n\n .block-type-btn {\n padding-left: 0;\n }\n"])), "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-surface, white)", "var(--ds-space-250, 20px)", isTwoLineEditorToolbar && "\n @media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px) {\n flex-direction: column-reverse;\n align-items: end;\n display: flex;\n justify-content: flex-end;\n }\n\n //make this more explicit for a toolbar\n > *:nth-child(1) {\n @media (max-width: ").concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px) {\n > div:nth-child(2) {\n justify-content: flex-end;\n display: flex;\n }\n }\n }\n "));
|
|
17
|
+
};
|
|
13
18
|
var stickyToolbarWrapperStyle = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n /* stylelint-disable declaration-block-no-duplicate-properties */\n position: relative;\n position: sticky;\n /* stylelint-enable declaration-block-no-duplicate-properties */\n padding-bottom: ", ";\n z-index: ", ";\n transition: box-shadow ease-in-out 0.2s;\n &.show-keyline {\n box-shadow: 0 ", "px 0 0\n ", ";\n }\n"])), "var(--ds-space-100, 8px)", akEditorMenuZIndex, akEditorToolbarKeylineHeight, "var(--ds-border, ".concat(N30, ")"));
|
|
14
19
|
var StickyToolbar = function StickyToolbar(props) {
|
|
15
20
|
var _useState = useState(0),
|
|
@@ -29,14 +34,14 @@ var StickyToolbar = function StickyToolbar(props) {
|
|
|
29
34
|
}
|
|
30
35
|
}, [props.externalToolbarRef, props.offsetTop]);
|
|
31
36
|
return jsx("div", {
|
|
32
|
-
css: [mainToolbarWrapperStyle, stickyToolbarWrapperStyle, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n top: ", "px;\n "])), top)],
|
|
37
|
+
css: [mainToolbarWrapperStyle(props.twoLineEditorToolbar), stickyToolbarWrapperStyle, css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n top: ", "px;\n "])), top)],
|
|
33
38
|
"data-testid": "ak-editor-main-toolbar",
|
|
34
39
|
className: 'show-keyline'
|
|
35
40
|
}, props.children);
|
|
36
41
|
};
|
|
37
42
|
var FixedToolbar = function FixedToolbar(props) {
|
|
38
43
|
return jsx("div", {
|
|
39
|
-
css: mainToolbarWrapperStyle,
|
|
44
|
+
css: mainToolbarWrapperStyle(props.twoLineEditorToolbar),
|
|
40
45
|
"data-testid": "ak-editor-main-toolbar"
|
|
41
46
|
}, props.children);
|
|
42
47
|
};
|
|
@@ -70,10 +75,18 @@ var getStickyParameters = function getStickyParameters(configuration) {
|
|
|
70
75
|
};
|
|
71
76
|
export var MainToolbar = function MainToolbar(_ref) {
|
|
72
77
|
var useStickyToolbar = _ref.useStickyToolbar,
|
|
78
|
+
twoLineEditorToolbar = _ref.twoLineEditorToolbar,
|
|
73
79
|
children = _ref.children;
|
|
74
80
|
if (useStickyToolbar) {
|
|
75
|
-
return jsx(StickyToolbar, getStickyParameters(useStickyToolbar),
|
|
81
|
+
return jsx(StickyToolbar, _extends({}, getStickyParameters(useStickyToolbar), {
|
|
82
|
+
twoLineEditorToolbar: twoLineEditorToolbar
|
|
83
|
+
}), children);
|
|
76
84
|
}
|
|
77
|
-
return jsx(FixedToolbar,
|
|
85
|
+
return jsx(FixedToolbar, {
|
|
86
|
+
twoLineEditorToolbar: twoLineEditorToolbar
|
|
87
|
+
}, children);
|
|
78
88
|
};
|
|
79
|
-
export var mainToolbarCustomComponentsSlotStyle =
|
|
89
|
+
export var mainToolbarCustomComponentsSlotStyle = function mainToolbarCustomComponentsSlotStyle() {
|
|
90
|
+
var isTwoLineEditorToolbar = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
91
|
+
return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: flex-end;\n align-items: center;\n flex-grow: 1;\n padding-right: ", ";\n ", "\n > div {\n display: flex;\n flex-shrink: 0;\n }\n"])), "var(--ds-space-250, 20px)", isTwoLineEditorToolbar && "\n @media (max-width: ".concat(MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT, "px) {\n {\n padding-right: 0;\n }\n }\n "));
|
|
92
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "191.0
|
|
2
|
+
export var version = "191.1.0";
|
|
@@ -3,7 +3,8 @@ import type { UseStickyToolbarType } from '@atlaskit/editor-common/ui';
|
|
|
3
3
|
export declare const TableControlsPadding = 20;
|
|
4
4
|
type MainToolbarProps = {
|
|
5
5
|
useStickyToolbar?: UseStickyToolbarType;
|
|
6
|
+
twoLineEditorToolbar?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export declare const MainToolbar: React.FC<MainToolbarProps>;
|
|
8
|
-
export declare const mainToolbarCustomComponentsSlotStyle: import("@emotion/react").SerializedStyles;
|
|
9
|
+
export declare const mainToolbarCustomComponentsSlotStyle: (isTwoLineEditorToolbar?: boolean) => import("@emotion/react").SerializedStyles;
|
|
9
10
|
export {};
|
|
@@ -3,7 +3,8 @@ import type { UseStickyToolbarType } from '@atlaskit/editor-common/ui';
|
|
|
3
3
|
export declare const TableControlsPadding = 20;
|
|
4
4
|
type MainToolbarProps = {
|
|
5
5
|
useStickyToolbar?: UseStickyToolbarType;
|
|
6
|
+
twoLineEditorToolbar?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export declare const MainToolbar: React.FC<MainToolbarProps>;
|
|
8
|
-
export declare const mainToolbarCustomComponentsSlotStyle: import("@emotion/react").SerializedStyles;
|
|
9
|
+
export declare const mainToolbarCustomComponentsSlotStyle: (isTwoLineEditorToolbar?: boolean) => import("@emotion/react").SerializedStyles;
|
|
9
10
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "191.0
|
|
3
|
+
"version": "191.1.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
"@atlaskit/analytics-listeners": "^8.9.0",
|
|
163
163
|
"@atlaskit/checkbox": "^13.0.0",
|
|
164
164
|
"@atlaskit/code": "^15.1.0",
|
|
165
|
-
"@atlaskit/collab-provider": "9.21.
|
|
165
|
+
"@atlaskit/collab-provider": "9.21.3",
|
|
166
166
|
"@atlaskit/dropdown-menu": "^12.1.0",
|
|
167
167
|
"@atlaskit/editor-extension-dropbox": "^0.4.0",
|
|
168
168
|
"@atlaskit/editor-palette": "1.5.2",
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
"@atlaskit/visual-regression": "*",
|
|
185
185
|
"@atlassian/adf-schema-json": "^1.0.7",
|
|
186
186
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
187
|
-
"@atlassian/editor-extension-link-create": "^1.
|
|
187
|
+
"@atlassian/editor-extension-link-create": "^1.2.0",
|
|
188
188
|
"@atlassian/feature-flags-test-utils": "^0.1.1",
|
|
189
189
|
"@atlassian/link-picker-plugins": "^24.0.0",
|
|
190
190
|
"@atlassian/search-provider": "2.4.11",
|