@atlaskit/editor-core 193.2.6 → 193.3.4
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 +17 -0
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +23 -3
- package/dist/cjs/presets/universal.js +0 -1
- package/dist/cjs/ui/Addon/ClickAreaMobile/index.js +4 -5
- package/dist/cjs/ui/Addon/Dropdown/styles.js +9 -4
- package/dist/cjs/ui/Addon/DropdownItem/styles.js +15 -4
- package/dist/cjs/ui/Appearance/Chromeless.js +26 -6
- package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/cjs/ui/Appearance/Comment/Toolbar.js +20 -14
- package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +66 -12
- package/dist/cjs/ui/AppearanceComponents/Mobile.js +15 -4
- package/dist/cjs/ui/ChromeCollapsed/styles.js +23 -4
- package/dist/cjs/ui/ContentStyles/date.js +1 -0
- package/dist/cjs/ui/ContentStyles/extension.js +1 -1
- package/dist/cjs/ui/ContentStyles/index.js +3 -0
- package/dist/cjs/ui/ContentStyles/layout.js +1 -0
- package/dist/cjs/ui/ContentStyles/media.js +1 -1
- package/dist/cjs/ui/ContentStyles/status.js +1 -0
- package/dist/cjs/ui/ContentStyles/tasks-and-decisions.js +1 -1
- package/dist/cjs/ui/ContextPanel/index.js +24 -8
- package/dist/cjs/ui/PluginSlot/index.js +4 -5
- package/dist/cjs/ui/Toolbar/ToolbarInner.js +7 -5
- package/dist/cjs/ui/WithFlash/index.js +7 -4
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +23 -35
- package/dist/es2019/presets/universal.js +0 -1
- package/dist/es2019/ui/Addon/ClickAreaMobile/index.js +3 -4
- package/dist/es2019/ui/Addon/Dropdown/styles.js +9 -9
- package/dist/es2019/ui/Addon/DropdownItem/styles.js +14 -15
- package/dist/es2019/ui/Appearance/Chromeless.js +23 -25
- package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/es2019/ui/Appearance/Comment/Toolbar.js +16 -11
- package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +68 -81
- package/dist/es2019/ui/AppearanceComponents/Mobile.js +12 -13
- package/dist/es2019/ui/ChromeCollapsed/styles.js +21 -23
- package/dist/es2019/ui/ContentStyles/date.js +1 -0
- package/dist/es2019/ui/ContentStyles/expand.js +1 -2
- package/dist/es2019/ui/ContentStyles/extension.js +1 -1
- package/dist/es2019/ui/ContentStyles/index.js +5 -3
- package/dist/es2019/ui/ContentStyles/layout.js +2 -0
- package/dist/es2019/ui/ContentStyles/media.js +1 -1
- package/dist/es2019/ui/ContentStyles/status.js +2 -0
- package/dist/es2019/ui/ContentStyles/tasks-and-decisions.js +1 -1
- package/dist/es2019/ui/ContextPanel/index.js +23 -23
- package/dist/es2019/ui/PluginSlot/index.js +3 -3
- package/dist/es2019/ui/Toolbar/ToolbarInner.js +5 -6
- package/dist/es2019/ui/WithFlash/index.js +7 -4
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +23 -3
- package/dist/esm/presets/universal.js +0 -1
- package/dist/esm/ui/Addon/ClickAreaMobile/index.js +3 -3
- package/dist/esm/ui/Addon/Dropdown/styles.js +9 -3
- package/dist/esm/ui/Addon/DropdownItem/styles.js +15 -3
- package/dist/esm/ui/Appearance/Chromeless.js +25 -4
- package/dist/esm/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/esm/ui/Appearance/Comment/Toolbar.js +20 -14
- package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +66 -12
- package/dist/esm/ui/AppearanceComponents/Mobile.js +13 -3
- package/dist/esm/ui/ChromeCollapsed/styles.js +23 -3
- package/dist/esm/ui/ContentStyles/date.js +1 -0
- package/dist/esm/ui/ContentStyles/expand.js +1 -2
- package/dist/esm/ui/ContentStyles/extension.js +1 -1
- package/dist/esm/ui/ContentStyles/index.js +5 -3
- package/dist/esm/ui/ContentStyles/layout.js +2 -0
- package/dist/esm/ui/ContentStyles/media.js +1 -1
- package/dist/esm/ui/ContentStyles/status.js +2 -0
- package/dist/esm/ui/ContentStyles/tasks-and-decisions.js +1 -1
- package/dist/esm/ui/ContextPanel/index.js +23 -6
- package/dist/esm/ui/PluginSlot/index.js +3 -3
- package/dist/esm/ui/Toolbar/ToolbarInner.js +6 -3
- package/dist/esm/ui/WithFlash/index.js +7 -4
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/create-editor/ErrorBoundary.d.ts +1 -1
- package/dist/types/create-editor/WithEditorView.d.ts +2 -2
- package/dist/types/create-editor/get-ui-component.d.ts +1 -1
- package/dist/types/types/extension-config.d.ts +0 -1
- package/dist/types/ui/Toolbar/Toolbar.d.ts +2 -2
- package/dist/types/ui/Toolbar/ToolbarWithSizeDetector.d.ts +2 -3
- package/dist/types-ts4.5/create-editor/ErrorBoundary.d.ts +1 -1
- package/dist/types-ts4.5/create-editor/WithEditorView.d.ts +2 -2
- package/dist/types-ts4.5/create-editor/get-ui-component.d.ts +1 -1
- package/dist/types-ts4.5/types/extension-config.d.ts +0 -1
- package/dist/types-ts4.5/ui/Toolbar/Toolbar.d.ts +2 -2
- package/dist/types-ts4.5/ui/Toolbar/ToolbarWithSizeDetector.d.ts +2 -3
- package/package.json +14 -9
|
@@ -17,7 +17,6 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
17
17
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
18
18
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
19
19
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
20
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
21
20
|
var _react = _interopRequireWildcard(require("react"));
|
|
22
21
|
var _react2 = require("@emotion/react");
|
|
23
22
|
var _Transition = _interopRequireDefault(require("react-transition-group/Transition"));
|
|
@@ -30,20 +29,22 @@ var _document = require("../../utils/document");
|
|
|
30
29
|
var _WithEditorActions = _interopRequireDefault(require("../WithEditorActions"));
|
|
31
30
|
var _WithPluginState = _interopRequireDefault(require("../WithPluginState"));
|
|
32
31
|
var _excluded = ["actions"];
|
|
33
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
34
|
-
/** @jsx jsx */
|
|
35
32
|
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); }
|
|
36
33
|
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 && Object.prototype.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; }
|
|
37
34
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
38
35
|
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; }
|
|
39
36
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
40
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
37
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
|
|
41
38
|
var ANIM_SPEED_MS = 500;
|
|
42
39
|
var EDITOR_WIDTH = _editorSharedStyles.akEditorDefaultLayoutWidth + _editorSharedStyles.akEditorBreakoutPadding;
|
|
43
40
|
var WIDE_EDITOR_WIDTH = _editorSharedStyles.akEditorWideLayoutWidth + _editorSharedStyles.akEditorBreakoutPadding;
|
|
44
41
|
var FULLWIDTH_MODE = 'full-width';
|
|
45
42
|
var WIDE_MODE = 'wide';
|
|
46
|
-
var absolutePanelStyles = (0, _react2.css)(
|
|
43
|
+
var absolutePanelStyles = (0, _react2.css)({
|
|
44
|
+
position: 'absolute',
|
|
45
|
+
right: 0,
|
|
46
|
+
height: "calc(100% - ".concat(_editorSharedStyles.ATLASSIAN_NAVIGATION_HEIGHT, ")")
|
|
47
|
+
});
|
|
47
48
|
var checkTableExistsInDoc = function checkTableExistsInDoc(editorView) {
|
|
48
49
|
var tableNodeSchema = editorView.state.schema.nodes.table;
|
|
49
50
|
var findResult = (0, _utils.findChildrenByType)(editorView.state.doc, tableNodeSchema);
|
|
@@ -69,9 +70,24 @@ var shouldPanelBePositionedOverEditor = exports.shouldPanelBePositionedOverEdito
|
|
|
69
70
|
return editorNotFullWidth && (hasSpaceForPanel || hasSpaceForWideBreakoutsAndPanel) && !isTableInDoc;
|
|
70
71
|
}
|
|
71
72
|
};
|
|
72
|
-
var panelHidden = (0, _react2.css)(
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
var panelHidden = (0, _react2.css)({
|
|
74
|
+
width: 0
|
|
75
|
+
});
|
|
76
|
+
var panel = exports.panel = (0, _react2.css)({
|
|
77
|
+
width: "".concat(_editorSharedStyles.akEditorContextPanelWidth, "px"),
|
|
78
|
+
height: '100%',
|
|
79
|
+
transition: "width ".concat(ANIM_SPEED_MS, "ms ").concat(_editorSharedStyles.akEditorSwoopCubicBezier),
|
|
80
|
+
overflow: 'hidden',
|
|
81
|
+
boxShadow: "inset 2px 0 0 0 ".concat("var(--ds-border, ".concat(_colors.N30, ")"))
|
|
82
|
+
});
|
|
83
|
+
var content = exports.content = (0, _react2.css)({
|
|
84
|
+
transition: "width 600ms ".concat(_editorSharedStyles.akEditorSwoopCubicBezier),
|
|
85
|
+
boxSizing: 'border-box',
|
|
86
|
+
padding: "var(--ds-space-200, 16px)".concat(" ", "var(--ds-space-200, 16px)", " 0px"),
|
|
87
|
+
width: "".concat(_editorSharedStyles.akEditorContextPanelWidth, "px"),
|
|
88
|
+
height: '100%',
|
|
89
|
+
overflowY: 'auto'
|
|
90
|
+
});
|
|
75
91
|
var SwappableContentArea = exports.SwappableContentArea = /*#__PURE__*/function (_React$PureComponent) {
|
|
76
92
|
(0, _inherits2.default)(SwappableContentArea, _React$PureComponent);
|
|
77
93
|
var _super = _createSuper(SwappableContentArea);
|
|
@@ -12,18 +12,17 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
12
12
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
16
15
|
var _react = _interopRequireDefault(require("react"));
|
|
17
16
|
var _react2 = require("@emotion/react");
|
|
18
17
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
19
18
|
var _utils = require("../../utils");
|
|
20
19
|
var _ErrorBoundary = require("../ErrorBoundary");
|
|
21
20
|
var _mountPluginHooks = require("./mount-plugin-hooks");
|
|
22
|
-
var _templateObject;
|
|
23
|
-
/** @jsx jsx */
|
|
24
21
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
25
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
26
|
-
var pluginsComponentsWrapper = (0, _react2.css)(
|
|
22
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
|
|
23
|
+
var pluginsComponentsWrapper = (0, _react2.css)({
|
|
24
|
+
display: 'flex'
|
|
25
|
+
});
|
|
27
26
|
var PluginSlot = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
28
27
|
(0, _inherits2.default)(PluginSlot, _React$Component);
|
|
29
28
|
var _super = _createSuper(PluginSlot);
|
|
@@ -10,15 +10,17 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
10
10
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
11
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
12
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
-
var
|
|
13
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
var _react2 = require("@emotion/react");
|
|
16
16
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
17
|
-
var _templateObject;
|
|
18
|
-
/** @jsx jsx */
|
|
19
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
20
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
21
|
-
var toolbarComponentsWrapper = (0, _react2.css)(
|
|
18
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /** @jsx jsx */
|
|
19
|
+
var toolbarComponentsWrapper = (0, _react2.css)((0, _defineProperty2.default)({
|
|
20
|
+
display: 'flex'
|
|
21
|
+
}, "@media (max-width: ".concat(_editorSharedStyles.akEditorMobileMaxWidth, "px)"), {
|
|
22
|
+
justifyContent: 'space-between'
|
|
23
|
+
}));
|
|
22
24
|
var ToolbarInner = exports.ToolbarInner = /*#__PURE__*/function (_React$Component) {
|
|
23
25
|
(0, _inherits2.default)(ToolbarInner, _React$Component);
|
|
24
26
|
var _super = _createSuper(ToolbarInner);
|
|
@@ -64,10 +64,13 @@ var WithFlash = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
|
64
64
|
animate = _this$props.animate,
|
|
65
65
|
children = _this$props.children;
|
|
66
66
|
this.toggle = animate && !this.toggle;
|
|
67
|
-
return (
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
return (
|
|
68
|
+
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
69
|
+
(0, _react2.jsx)("div", {
|
|
70
|
+
css: animate ? flashWrapperAnimated : flashWrapper,
|
|
71
|
+
className: this.toggle ? '-flash' : ''
|
|
72
|
+
}, children)
|
|
73
|
+
);
|
|
71
74
|
}
|
|
72
75
|
}]);
|
|
73
76
|
return WithFlash;
|
|
@@ -5,43 +5,31 @@ import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
|
|
|
5
5
|
// For reasoning behind styles, see comments in:
|
|
6
6
|
// ./getInlineNodeViewProducer -> portalChildren()
|
|
7
7
|
|
|
8
|
-
export const InlineNodeViewSharedStyles = css
|
|
9
|
-
|
|
10
|
-
display: inline
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
& > *:not(.zeroWidthSpaceContainer) {
|
|
19
|
-
white-space: pre-wrap;
|
|
8
|
+
export const InlineNodeViewSharedStyles = css({
|
|
9
|
+
[`.${inlineNodeViewClassname}`]: {
|
|
10
|
+
display: 'inline',
|
|
11
|
+
userSelect: 'all',
|
|
12
|
+
whiteSpace: 'nowrap',
|
|
13
|
+
'& > *:not(.zeroWidthSpaceContainer)': {
|
|
14
|
+
whiteSpace: 'pre-wrap'
|
|
15
|
+
},
|
|
16
|
+
'& > .assistive': {
|
|
17
|
+
userSelect: 'none'
|
|
20
18
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/** Remove browser deafult selections style. This prevents
|
|
27
|
-
unexpected visual artefacts in Safari when navigating
|
|
28
|
-
with the keyboard or making range selections. */
|
|
29
|
-
&.ua-safari {
|
|
30
|
-
.${inlineNodeViewClassname} {
|
|
31
|
-
::selection,
|
|
32
|
-
*::selection {
|
|
33
|
-
background: transparent;
|
|
19
|
+
},
|
|
20
|
+
'&.ua-safari': {
|
|
21
|
+
[`.${inlineNodeViewClassname}`]: {
|
|
22
|
+
'::selection, *::selection': {
|
|
23
|
+
background: 'transparent'
|
|
34
24
|
}
|
|
35
25
|
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
::after {
|
|
44
|
-
content: '${ZERO_WIDTH_SPACE}';
|
|
26
|
+
},
|
|
27
|
+
[`&.ua-chrome .${inlineNodeViewClassname} > span`]: {
|
|
28
|
+
userSelect: 'none'
|
|
29
|
+
},
|
|
30
|
+
[`.${inlineNodeViewClassname}AddZeroWidthSpace`]: {
|
|
31
|
+
'::after': {
|
|
32
|
+
content: `'${ZERO_WIDTH_SPACE}'`
|
|
45
33
|
}
|
|
46
34
|
}
|
|
47
|
-
|
|
35
|
+
});
|
|
@@ -146,7 +146,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
146
146
|
allowCustomPanelEdit: typeof props.allowPanel === 'object' ? props.allowPanel.allowCustomPanelEdit : false
|
|
147
147
|
}], Boolean(props.allowPanel)).maybeAdd(contextPanelPlugin, Boolean(isFullPage)).maybeAdd([extensionPlugin, {
|
|
148
148
|
breakoutEnabled: appearance === 'full-page' && (typeof props.allowExtension === 'object' ? props.allowExtension.allowBreakout : true) !== false,
|
|
149
|
-
allowAutoSave: typeof props.allowExtension === 'object' ? props.allowExtension.allowAutoSave : false,
|
|
150
149
|
extensionHandlers: props.extensionHandlers,
|
|
151
150
|
useLongPressSelection: false,
|
|
152
151
|
appearance
|
|
@@ -12,10 +12,9 @@ import { clickAreaClickHandler } from '../click-area-helper';
|
|
|
12
12
|
const clickWrapper = ({
|
|
13
13
|
isExpanded,
|
|
14
14
|
minHeight
|
|
15
|
-
}) => css
|
|
16
|
-
height: 100
|
|
17
|
-
|
|
18
|
-
`;
|
|
15
|
+
}) => css({
|
|
16
|
+
height: '100%'
|
|
17
|
+
}, isExpanded && minHeight ? `min-height: ${minHeight}px` : '');
|
|
19
18
|
/**
|
|
20
19
|
* Click Area is responsible for improving UX by ensuring the user
|
|
21
20
|
* can always tap beneath the content area, to insert more content.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { N60A } from '@atlaskit/theme/colors';
|
|
3
3
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
4
|
-
export const dropdown = css
|
|
5
|
-
display: flex
|
|
6
|
-
|
|
7
|
-
background:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
padding:
|
|
12
|
-
|
|
4
|
+
export const dropdown = css({
|
|
5
|
+
display: 'flex',
|
|
6
|
+
flexDirection: 'column',
|
|
7
|
+
background: "var(--ds-surface-overlay, white)",
|
|
8
|
+
borderRadius: `${borderRadius()}px`,
|
|
9
|
+
boxShadow: `var(--ds-shadow-overlay, ${`0 4px 8px -2px ${N60A}, 0 0 1px ${N60A}`})`,
|
|
10
|
+
boxSizing: 'border-box',
|
|
11
|
+
padding: `${"var(--ds-space-050, 4px)"} 0`
|
|
12
|
+
});
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { N20, N800 } from '@atlaskit/theme/colors';
|
|
3
|
-
export const dropdownItem = css
|
|
4
|
-
display: flex
|
|
5
|
-
|
|
6
|
-
cursor: pointer
|
|
7
|
-
|
|
8
|
-
padding:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
export const dropdownItem = css({
|
|
4
|
+
display: 'flex',
|
|
5
|
+
alignItems: 'center',
|
|
6
|
+
cursor: 'pointer',
|
|
7
|
+
textDecoration: 'none',
|
|
8
|
+
padding: `${"var(--ds-space-100, 8px)"} ${"var(--ds-space-400, 32px)"} ${"var(--ds-space-100, 8px)"} ${"var(--ds-space-150, 12px)"}`,
|
|
9
|
+
color: `var(--ds-text, ${N800})`,
|
|
10
|
+
'> span': {
|
|
11
|
+
display: 'flex',
|
|
12
|
+
marginRight: "var(--ds-space-100, 8px)"
|
|
13
|
+
},
|
|
14
|
+
'&:hover': {
|
|
15
|
+
backgroundColor: `var(--ds-background-neutral-subtle-hovered, ${N20})`
|
|
14
16
|
}
|
|
15
|
-
|
|
16
|
-
background-color: ${`var(--ds-background-neutral-subtle-hovered, ${N20})`};
|
|
17
|
-
}
|
|
18
|
-
`;
|
|
17
|
+
});
|
|
@@ -8,28 +8,26 @@ import { createEditorContentStyle } from '../ContentStyles';
|
|
|
8
8
|
import PluginSlot from '../PluginSlot';
|
|
9
9
|
import { scrollbarStyles } from '../styles';
|
|
10
10
|
import WithFlash from '../WithFlash';
|
|
11
|
-
const chromelessEditor = css
|
|
12
|
-
|
|
13
|
-
height: auto
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
& > :last-child {
|
|
29
|
-
padding-bottom: 0.5em;
|
|
11
|
+
const chromelessEditor = css({
|
|
12
|
+
lineHeight: '20px',
|
|
13
|
+
height: 'auto',
|
|
14
|
+
overflowX: 'hidden',
|
|
15
|
+
overflowY: 'auto'
|
|
16
|
+
}, scrollbarStyles, {
|
|
17
|
+
maxWidth: 'inherit',
|
|
18
|
+
boxSizing: 'border-box',
|
|
19
|
+
wordWrap: 'break-word',
|
|
20
|
+
'div > .ProseMirror': {
|
|
21
|
+
outline: 'none',
|
|
22
|
+
whiteSpace: 'pre-wrap',
|
|
23
|
+
padding: 0,
|
|
24
|
+
margin: 0,
|
|
25
|
+
'& > :last-child': {
|
|
26
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
27
|
+
paddingBottom: '0.5em'
|
|
30
28
|
}
|
|
31
29
|
}
|
|
32
|
-
|
|
30
|
+
});
|
|
33
31
|
const ContentArea = createEditorContentStyle();
|
|
34
32
|
ContentArea.displayName = 'ContentArea';
|
|
35
33
|
export default class Editor extends React.Component {
|
|
@@ -62,11 +60,11 @@ export default class Editor extends React.Component {
|
|
|
62
60
|
return jsx(WithFlash, {
|
|
63
61
|
animate: maxContentSizeReached
|
|
64
62
|
}, jsx("div", {
|
|
65
|
-
css: [chromelessEditor, maxHeight && css
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
css: [chromelessEditor, maxHeight && css({
|
|
64
|
+
maxHeight: `${maxHeight}px`
|
|
65
|
+
}), css({
|
|
66
|
+
minHeight: `${minHeight}px`
|
|
67
|
+
})],
|
|
70
68
|
"data-testid": "chromeless-editor",
|
|
71
69
|
ref: ref => this.containerElement = ref
|
|
72
70
|
}, jsx(ContentArea, {
|
|
@@ -13,7 +13,7 @@ import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-me
|
|
|
13
13
|
import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
14
14
|
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
15
15
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
16
|
-
import {
|
|
16
|
+
import { N40 } from '@atlaskit/theme/colors';
|
|
17
17
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
18
18
|
import messages from '../../../messages';
|
|
19
19
|
import { usePresetContext } from '../../../presets/context';
|
|
@@ -33,7 +33,7 @@ const commentEditorStyle = css({
|
|
|
33
33
|
minWidth: '272px',
|
|
34
34
|
height: 'auto',
|
|
35
35
|
backgroundColor: "var(--ds-background-input, white)",
|
|
36
|
-
border: `1px solid ${`var(--ds-border
|
|
36
|
+
border: `1px solid ${`var(--ds-border, ${N40})`}`,
|
|
37
37
|
boxSizing: 'border-box',
|
|
38
38
|
borderRadius: `${borderRadius()}px`,
|
|
39
39
|
maxWidth: 'inherit',
|
|
@@ -75,18 +75,23 @@ const StickyToolbar = props => {
|
|
|
75
75
|
setTop(props.offsetTop || 0);
|
|
76
76
|
}
|
|
77
77
|
}, [props.externalToolbarRef, props.offsetTop]);
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
78
|
+
return (
|
|
79
|
+
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
80
|
+
jsx("div", {
|
|
81
|
+
css: [mainToolbarWrapperStyle(props.twoLineEditorToolbar), stickyToolbarWrapperStyle]
|
|
82
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage/preview
|
|
83
|
+
,
|
|
84
|
+
style: {
|
|
85
|
+
top: `${top}px`
|
|
86
|
+
},
|
|
87
|
+
"data-testid": "ak-editor-main-toolbar",
|
|
88
|
+
className: 'show-keyline'
|
|
89
|
+
}, props.children)
|
|
90
|
+
);
|
|
88
91
|
};
|
|
89
|
-
const FixedToolbar = props =>
|
|
92
|
+
const FixedToolbar = props =>
|
|
93
|
+
// eslint-disable-next-line @atlaskit/design-system/prefer-primitives
|
|
94
|
+
jsx("div", {
|
|
90
95
|
css: mainToolbarWrapperStyle(props.twoLineEditorToolbar),
|
|
91
96
|
"data-testid": "ak-editor-main-toolbar"
|
|
92
97
|
}, props.children);
|
|
@@ -4,93 +4,80 @@ export const MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT = 868;
|
|
|
4
4
|
const toolbarLineHeight = 56;
|
|
5
5
|
|
|
6
6
|
// box-shadow is overriden by the mainToolbar
|
|
7
|
-
const mainToolbarWithKeyline = css
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
height: calc(${toolbarLineHeight}px * 2);
|
|
7
|
+
const mainToolbarWithKeyline = css({
|
|
8
|
+
boxShadow: `0 ${akEditorToolbarKeylineHeight}px 0 0 ${"var(--ds-background-accent-gray-subtlest, #F1F2F4)"}`
|
|
9
|
+
});
|
|
10
|
+
const mainToolbarTwoLineStyle = css({
|
|
11
|
+
[`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
|
|
12
|
+
flexWrap: 'wrap',
|
|
13
|
+
height: `calc(${toolbarLineHeight}px * 2)`
|
|
15
14
|
}
|
|
16
|
-
|
|
17
|
-
const mainToolbar = css
|
|
18
|
-
position: relative
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
transition: box-shadow 200ms ${akEditorSwoopCubicBezier}
|
|
22
|
-
|
|
23
|
-
display: flex
|
|
24
|
-
height:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
@media (max-width: ${akEditorMobileMaxWidth}px) {
|
|
34
|
-
display: grid;
|
|
35
|
-
height: calc(${toolbarLineHeight}px * 2);
|
|
15
|
+
});
|
|
16
|
+
const mainToolbar = css({
|
|
17
|
+
position: 'relative',
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
boxShadow: 'none',
|
|
20
|
+
transition: `box-shadow 200ms ${akEditorSwoopCubicBezier}`,
|
|
21
|
+
zIndex: akEditorFloatingDialogZIndex,
|
|
22
|
+
display: 'flex',
|
|
23
|
+
height: `${toolbarLineHeight}px`,
|
|
24
|
+
flexShrink: 0,
|
|
25
|
+
backgroundColor: "var(--ds-surface, white)",
|
|
26
|
+
'& object': {
|
|
27
|
+
height: '0 !important'
|
|
28
|
+
},
|
|
29
|
+
[`@media (max-width: ${akEditorMobileMaxWidth}px)`]: {
|
|
30
|
+
display: 'grid',
|
|
31
|
+
height: `calc(${toolbarLineHeight}px * 2)`
|
|
36
32
|
}
|
|
37
|
-
|
|
33
|
+
});
|
|
38
34
|
export const mainToolbarStyle = (showKeyline, twoLineEditorToolbar) => [mainToolbar, showKeyline && mainToolbarWithKeyline, twoLineEditorToolbar && mainToolbarTwoLineStyle];
|
|
39
|
-
export const mainToolbarIconBeforeStyle = css
|
|
40
|
-
margin:
|
|
41
|
-
height:
|
|
42
|
-
width:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
export const mainToolbarIconBeforeStyle = css({
|
|
36
|
+
margin: "var(--ds-space-200, 16px)",
|
|
37
|
+
height: "var(--ds-space-400, 32px)",
|
|
38
|
+
width: "var(--ds-space-400, 32px)",
|
|
39
|
+
[`@media (max-width: ${akEditorMobileMaxWidth}px)`]: {
|
|
40
|
+
gridColumn: 1,
|
|
41
|
+
gridRow: 1
|
|
46
42
|
}
|
|
47
|
-
|
|
48
|
-
const mainToolbarFirstChild = css
|
|
49
|
-
display: flex
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
grid-row: 1;
|
|
43
|
+
});
|
|
44
|
+
const mainToolbarFirstChild = css({
|
|
45
|
+
display: 'flex',
|
|
46
|
+
flexGrow: 1,
|
|
47
|
+
[`@media (max-width: ${akEditorMobileMaxWidth}px)`]: {
|
|
48
|
+
gridColumn: 1,
|
|
49
|
+
gridRow: 1
|
|
55
50
|
}
|
|
56
|
-
|
|
57
|
-
const mainToolbarFirstChildTowLine = css
|
|
58
|
-
|
|
59
|
-
flex: 1 1 100
|
|
60
|
-
height:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// shrink more than the size of its contents. This will prevent the
|
|
64
|
-
// find/replace icon from being overlapped during a confluence
|
|
65
|
-
// publish operation
|
|
66
|
-
min-width: fit-content;
|
|
51
|
+
});
|
|
52
|
+
const mainToolbarFirstChildTowLine = css({
|
|
53
|
+
[`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
|
|
54
|
+
flex: '1 1 100%',
|
|
55
|
+
height: `${toolbarLineHeight}px`,
|
|
56
|
+
justifyContent: 'flex-end',
|
|
57
|
+
minWidth: 'fit-content'
|
|
67
58
|
}
|
|
68
|
-
|
|
59
|
+
});
|
|
69
60
|
export const mainToolbarFirstChildStyle = twoLineEditorToolbar => [mainToolbarFirstChild, twoLineEditorToolbar && mainToolbarFirstChildTowLine];
|
|
70
|
-
const mainToolbarSecondChild = css
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
flex: 1 1 100%;
|
|
82
|
-
margin: auto;
|
|
83
|
-
height: ${toolbarLineHeight}px;
|
|
84
|
-
min-width: 0;
|
|
61
|
+
const mainToolbarSecondChild = css({
|
|
62
|
+
minWidth: 'fit-content'
|
|
63
|
+
});
|
|
64
|
+
const mainToolbarSecondChildTwoLine = css({
|
|
65
|
+
[`@media (max-width: ${MAXIMUM_TWO_LINE_TOOLBAR_BREAKPOINT}px)`]: {
|
|
66
|
+
display: 'flex',
|
|
67
|
+
flexGrow: 1,
|
|
68
|
+
flex: '1 1 100%',
|
|
69
|
+
margin: 'auto',
|
|
70
|
+
height: `${toolbarLineHeight}px`,
|
|
71
|
+
minWidth: 0
|
|
85
72
|
}
|
|
86
|
-
|
|
73
|
+
});
|
|
87
74
|
export const mainToolbarSecondChildStyle = twoLineEditorToolbar => [mainToolbarSecondChild, twoLineEditorToolbar && mainToolbarSecondChildTwoLine];
|
|
88
|
-
export const nonCustomToolbarWrapperStyle = css
|
|
89
|
-
|
|
90
|
-
display: flex
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
export const customToolbarWrapperStyle = css
|
|
94
|
-
|
|
95
|
-
display: flex
|
|
96
|
-
|
|
75
|
+
export const nonCustomToolbarWrapperStyle = css({
|
|
76
|
+
alignItems: 'center',
|
|
77
|
+
display: 'flex',
|
|
78
|
+
flexGrow: 1
|
|
79
|
+
});
|
|
80
|
+
export const customToolbarWrapperStyle = css({
|
|
81
|
+
alignItems: 'center',
|
|
82
|
+
display: 'flex'
|
|
83
|
+
});
|
|
@@ -12,20 +12,19 @@ import WithFlash from '../WithFlash';
|
|
|
12
12
|
|
|
13
13
|
// Copied from packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/types.ts
|
|
14
14
|
|
|
15
|
-
const mobileEditor = css
|
|
16
|
-
|
|
17
|
-
width: 100
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
margin: 0;
|
|
15
|
+
const mobileEditor = css({
|
|
16
|
+
minHeight: '30px',
|
|
17
|
+
width: '100%',
|
|
18
|
+
maxWidth: 'inherit',
|
|
19
|
+
boxSizing: 'border-box',
|
|
20
|
+
wordWrap: 'break-word',
|
|
21
|
+
'div > .ProseMirror': {
|
|
22
|
+
outline: 'none',
|
|
23
|
+
whiteSpace: 'pre-wrap',
|
|
24
|
+
padding: 0,
|
|
25
|
+
margin: 0
|
|
27
26
|
}
|
|
28
|
-
|
|
27
|
+
});
|
|
29
28
|
const ContentArea = createEditorContentStyle();
|
|
30
29
|
ContentArea.displayName = 'ContentArea';
|
|
31
30
|
export const MobileAppearance = /*#__PURE__*/forwardRef(function MobileAppearance({
|