@atlaskit/editor-core 204.4.6 → 204.4.8
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 +21 -0
- package/dist/cjs/actions/index.js +49 -44
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +1 -6
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +5 -7
- package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +17 -9
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/actions/index.js +2 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +2 -7
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +5 -7
- package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +16 -8
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/actions/index.js +49 -44
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +2 -7
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +6 -8
- package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +16 -8
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/actions/index.d.ts +2 -2
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +3 -4
- package/dist/types-ts4.5/actions/index.d.ts +2 -2
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +3 -4
- package/package.json +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 204.4.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#124114](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/124114)
|
|
8
|
+
[`a0b9383dc1bf3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a0b9383dc1bf3) -
|
|
9
|
+
CEPS-362: add reason to getResolvedEditorState call chain, to allow collab provider/NCS to
|
|
10
|
+
differentiate between draft sync and publish use cases
|
|
11
|
+
- [#125450](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/125450)
|
|
12
|
+
[`e3e99633b852e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e3e99633b852e) -
|
|
13
|
+
[ux] ED-26944 fix indentation in list for non macro bodied extension
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 204.4.7
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- [#125634](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/125634)
|
|
21
|
+
[`4e091d2d7760a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4e091d2d7760a) -
|
|
22
|
+
[ux] ED-26999 fix primary toolbar spacing under editor controls feature
|
|
23
|
+
|
|
3
24
|
## 204.4.6
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -55,50 +55,55 @@ var EditorActions = exports.default = /*#__PURE__*/function () {
|
|
|
55
55
|
* refers to the latest state of editor with confirmed
|
|
56
56
|
* steps.
|
|
57
57
|
*/
|
|
58
|
-
(0, _defineProperty2.default)(this, "getResolvedEditorState", /*#__PURE__*/
|
|
59
|
-
var
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
58
|
+
(0, _defineProperty2.default)(this, "getResolvedEditorState", /*#__PURE__*/function () {
|
|
59
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(reason) {
|
|
60
|
+
var _this$getFeatureFlags, useNativeCollabPlugin, editorValue, editorView, collabEditState;
|
|
61
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
62
|
+
while (1) switch (_context.prev = _context.next) {
|
|
63
|
+
case 0:
|
|
64
|
+
_this$getFeatureFlags = _this.getFeatureFlags(), useNativeCollabPlugin = _this$getFeatureFlags.useNativeCollabPlugin;
|
|
65
|
+
if (_this.editorView) {
|
|
66
|
+
_context.next = 3;
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
throw new Error('Called getResolvedEditorState before editorView is ready');
|
|
70
|
+
case 3:
|
|
71
|
+
if (useNativeCollabPlugin) {
|
|
72
|
+
_context.next = 10;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
_context.next = 6;
|
|
76
|
+
return _this.getValue();
|
|
77
|
+
case 6:
|
|
78
|
+
editorValue = _context.sent;
|
|
79
|
+
if (editorValue) {
|
|
80
|
+
_context.next = 9;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
throw new Error('editorValue is undefined');
|
|
84
|
+
case 9:
|
|
85
|
+
return _context.abrupt("return", {
|
|
86
|
+
content: editorValue,
|
|
87
|
+
title: null,
|
|
88
|
+
stepVersion: -1
|
|
89
|
+
});
|
|
90
|
+
case 10:
|
|
91
|
+
editorView = _this.editorView;
|
|
92
|
+
_context.next = 13;
|
|
93
|
+
return (0, _action.getEditorValueWithMedia)(editorView);
|
|
94
|
+
case 13:
|
|
95
|
+
collabEditState = fakePluginKey.getState(editorView.state);
|
|
96
|
+
return _context.abrupt("return", collabEditState === null || collabEditState === void 0 ? void 0 : collabEditState.getFinalAcknowledgedState(reason));
|
|
97
|
+
case 15:
|
|
98
|
+
case "end":
|
|
99
|
+
return _context.stop();
|
|
100
|
+
}
|
|
101
|
+
}, _callee);
|
|
102
|
+
}));
|
|
103
|
+
return function (_x) {
|
|
104
|
+
return _ref.apply(this, arguments);
|
|
105
|
+
};
|
|
106
|
+
}());
|
|
102
107
|
}
|
|
103
108
|
return (0, _createClass2.default)(EditorActions, [{
|
|
104
109
|
key: "_privateGetEditorView",
|
|
@@ -109,13 +109,8 @@ var FullPageEditor = exports.FullPageEditor = function FullPageEditor(props) {
|
|
|
109
109
|
}
|
|
110
110
|
var popupsBoundariesElement = props.popupsBoundariesElement || (scrollContentContainerRef === null || scrollContentContainerRef === void 0 || (_scrollContentContain = scrollContentContainerRef.current) === null || _scrollContentContain === void 0 ? void 0 : _scrollContentContain.containerArea) || undefined;
|
|
111
111
|
return (0, _react2.jsx)(_ui.ContextPanelWidthProvider, null, (0, _react2.jsx)("div", {
|
|
112
|
-
css: [
|
|
113
112
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
114
|
-
_StyledComponents.fullPageEditorWrapper
|
|
115
|
-
exposure: true
|
|
116
|
-
}) &&
|
|
117
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
118
|
-
_StyledComponents.primaryToolbarReservedSpace]
|
|
113
|
+
css: _StyledComponents.fullPageEditorWrapper
|
|
119
114
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
120
115
|
,
|
|
121
116
|
className: "akEditor",
|
|
@@ -82,15 +82,13 @@ var Content = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
|
82
82
|
editorView: props.editorView,
|
|
83
83
|
editorDisabled: props.disabled
|
|
84
84
|
}, (0, _react2.jsx)("div", {
|
|
85
|
-
css:
|
|
85
|
+
css: (0, _toConsumableArray2.default)((0, _StyledComponents.editorContentAreaStyle)({
|
|
86
86
|
fullWidthMode: fullWidthMode,
|
|
87
|
-
layoutMaxWidth: theme.layoutMaxWidth
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}) &&
|
|
91
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
92
|
-
_StyledComponents.contentAreaReducedHeaderSpace]),
|
|
87
|
+
layoutMaxWidth: theme.layoutMaxWidth,
|
|
88
|
+
isEditorToolbarHidden: props.isEditorToolbarHidden
|
|
89
|
+
})),
|
|
93
90
|
"data-editor-editable-content": true,
|
|
91
|
+
"data-editor-primary-toolbar-hidden": props.isEditorToolbarHidden && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') ? 'true' : undefined,
|
|
94
92
|
role: "region",
|
|
95
93
|
"aria-label": props.intl.formatMessage(_messages.fullPageMessages.editableContentLabel),
|
|
96
94
|
ref: contentAreaRef
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.sidebarArea = exports.
|
|
7
|
+
exports.sidebarArea = exports.fullPageEditorWrapper = exports.editorContentGutterStyle = exports.editorContentAreaStyle = exports.editorContentAreaHideContainer = exports.contentAreaWrapper = exports.contentAreaHeightNoToolbar = exports.contentArea = exports.ScrollContainer = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
@@ -13,6 +13,7 @@ var _consts = require("@atlaskit/editor-plugins/table/ui/consts");
|
|
|
13
13
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
14
14
|
var _scrollbar = require("@atlaskit/editor-shared-styles/scrollbar");
|
|
15
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
16
17
|
var _ContentStyles = require("../../ContentStyles");
|
|
17
18
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
18
19
|
|
|
@@ -148,8 +149,15 @@ var editorContentAreaContainerStyle = function editorContentAreaContainerStyle()
|
|
|
148
149
|
};
|
|
149
150
|
var editorContentAreaStyle = exports.editorContentAreaStyle = function editorContentAreaStyle(_ref) {
|
|
150
151
|
var layoutMaxWidth = _ref.layoutMaxWidth,
|
|
151
|
-
fullWidthMode = _ref.fullWidthMode
|
|
152
|
-
|
|
152
|
+
fullWidthMode = _ref.fullWidthMode,
|
|
153
|
+
isEditorToolbarHidden = _ref.isEditorToolbarHidden;
|
|
154
|
+
return [editorContentArea, !fullWidthMode && editorContentAreaWithLayoutWith(layoutMaxWidth), editorContentAreaContainerStyle(), (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1', {
|
|
155
|
+
exposure: true
|
|
156
|
+
}) &&
|
|
157
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
158
|
+
contentAreaReducedHeaderSpace, isEditorToolbarHidden && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1') &&
|
|
159
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
160
|
+
contentAreaReservedPrimaryToolbarSpace];
|
|
153
161
|
};
|
|
154
162
|
var editorContentAreaWithLayoutWith = function editorContentAreaWithLayoutWith(layoutMaxWidth) {
|
|
155
163
|
return (0, _react.css)({
|
|
@@ -222,17 +230,17 @@ var editorContentGutterStyle = exports.editorContentGutterStyle = function edito
|
|
|
222
230
|
});
|
|
223
231
|
};
|
|
224
232
|
|
|
225
|
-
// An additional
|
|
226
|
-
//
|
|
233
|
+
// An additional spacing applied at the top of the content area reserving space when the primary toolbar
|
|
234
|
+
// is hidden – this avoids layout shift when the toolbar is toggled under the editor controls feature
|
|
227
235
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
228
|
-
var
|
|
236
|
+
var contentAreaReservedPrimaryToolbarSpace = (0, _react.css)({
|
|
229
237
|
// extra 1px to account for the bottom border on the toolbar
|
|
230
|
-
|
|
238
|
+
marginTop: "calc(".concat("var(--ds-space-500, 40px)", " + 1px)")
|
|
231
239
|
});
|
|
232
240
|
|
|
233
|
-
// A reduced top
|
|
241
|
+
// A reduced top spacing applied to the content area to compensate for the reserved space at the top
|
|
234
242
|
// of the page when the primary toolbar is hidden under the editor controls feature
|
|
235
243
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
236
|
-
var contentAreaReducedHeaderSpace =
|
|
244
|
+
var contentAreaReducedHeaderSpace = (0, _react.css)({
|
|
237
245
|
paddingTop: "var(--ds-space-400, 32px)"
|
|
238
246
|
});
|
|
@@ -43,7 +43,7 @@ export default class EditorActions {
|
|
|
43
43
|
* refers to the latest state of editor with confirmed
|
|
44
44
|
* steps.
|
|
45
45
|
*/
|
|
46
|
-
_defineProperty(this, "getResolvedEditorState", async
|
|
46
|
+
_defineProperty(this, "getResolvedEditorState", async reason => {
|
|
47
47
|
const {
|
|
48
48
|
useNativeCollabPlugin
|
|
49
49
|
} = this.getFeatureFlags();
|
|
@@ -64,7 +64,7 @@ export default class EditorActions {
|
|
|
64
64
|
const editorView = this.editorView;
|
|
65
65
|
await getEditorValueWithMedia(editorView);
|
|
66
66
|
const collabEditState = fakePluginKey.getState(editorView.state);
|
|
67
|
-
return collabEditState === null || collabEditState === void 0 ? void 0 : collabEditState.getFinalAcknowledgedState();
|
|
67
|
+
return collabEditState === null || collabEditState === void 0 ? void 0 : collabEditState.getFinalAcknowledgedState(reason);
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
static from(view, eventDispatcher, transformer) {
|
|
@@ -13,7 +13,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
|
|
|
13
13
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
14
14
|
import { FullPageContentArea } from './FullPageContentArea';
|
|
15
15
|
import { FullPageToolbar } from './FullPageToolbar';
|
|
16
|
-
import { fullPageEditorWrapper
|
|
16
|
+
import { fullPageEditorWrapper } from './StyledComponents';
|
|
17
17
|
const useShowKeyline = contentAreaRef => {
|
|
18
18
|
const [showKeyline, setShowKeyline] = useState(false);
|
|
19
19
|
useEffect(() => {
|
|
@@ -93,13 +93,8 @@ export const FullPageEditor = props => {
|
|
|
93
93
|
}
|
|
94
94
|
const popupsBoundariesElement = props.popupsBoundariesElement || (scrollContentContainerRef === null || scrollContentContainerRef === void 0 ? void 0 : (_scrollContentContain = scrollContentContainerRef.current) === null || _scrollContentContain === void 0 ? void 0 : _scrollContentContain.containerArea) || undefined;
|
|
95
95
|
return jsx(ContextPanelWidthProvider, null, jsx("div", {
|
|
96
|
-
css: [
|
|
97
96
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
98
|
-
fullPageEditorWrapper
|
|
99
|
-
exposure: true
|
|
100
|
-
}) &&
|
|
101
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
102
|
-
primaryToolbarReservedSpace]
|
|
97
|
+
css: fullPageEditorWrapper
|
|
103
98
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
104
99
|
,
|
|
105
100
|
className: "akEditor",
|
|
@@ -16,7 +16,7 @@ import ClickAreaBlock from '../../Addon/ClickAreaBlock';
|
|
|
16
16
|
import { contentComponentClickWrapper } from '../../Addon/ClickAreaBlock/contentComponentWrapper';
|
|
17
17
|
import { ContextPanel } from '../../ContextPanel';
|
|
18
18
|
import PluginSlot from '../../PluginSlot';
|
|
19
|
-
import { contentArea, contentAreaHeightNoToolbar,
|
|
19
|
+
import { contentArea, contentAreaHeightNoToolbar, contentAreaWrapper, editorContentAreaStyle, editorContentGutterStyle, ScrollContainer, sidebarArea } from './StyledComponents';
|
|
20
20
|
export const CONTENT_AREA_TEST_ID = 'ak-editor-fp-content-area';
|
|
21
21
|
export const EDITOR_CONTAINER = 'ak-editor-container';
|
|
22
22
|
const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
@@ -72,13 +72,11 @@ const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
72
72
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
73
73
|
...editorContentAreaStyle({
|
|
74
74
|
fullWidthMode,
|
|
75
|
-
layoutMaxWidth: theme.layoutMaxWidth
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}) &&
|
|
79
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
80
|
-
contentAreaReducedHeaderSpace],
|
|
75
|
+
layoutMaxWidth: theme.layoutMaxWidth,
|
|
76
|
+
isEditorToolbarHidden: props.isEditorToolbarHidden
|
|
77
|
+
})],
|
|
81
78
|
"data-editor-editable-content": true,
|
|
79
|
+
"data-editor-primary-toolbar-hidden": props.isEditorToolbarHidden && editorExperiment('platform_editor_controls', 'variant1') ? 'true' : undefined,
|
|
82
80
|
role: "region",
|
|
83
81
|
"aria-label": props.intl.formatMessage(messages.editableContentLabel),
|
|
84
82
|
ref: contentAreaRef
|
|
@@ -6,6 +6,7 @@ import { tableMarginFullWidthMode } from '@atlaskit/editor-plugins/table/ui/cons
|
|
|
6
6
|
import { FULL_PAGE_EDITOR_TOOLBAR_HEIGHT, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, akEditorSwoopCubicBezier, akLayoutGutterOffset } from '@atlaskit/editor-shared-styles';
|
|
7
7
|
import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
10
|
import { createEditorContentStyle } from '../../ContentStyles';
|
|
10
11
|
|
|
11
12
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
@@ -136,8 +137,15 @@ const editorContentAreaContainerStyle = () => css({
|
|
|
136
137
|
});
|
|
137
138
|
export const editorContentAreaStyle = ({
|
|
138
139
|
layoutMaxWidth,
|
|
139
|
-
fullWidthMode
|
|
140
|
-
|
|
140
|
+
fullWidthMode,
|
|
141
|
+
isEditorToolbarHidden
|
|
142
|
+
}) => [editorContentArea, !fullWidthMode && editorContentAreaWithLayoutWith(layoutMaxWidth), editorContentAreaContainerStyle(), editorExperiment('platform_editor_controls', 'variant1', {
|
|
143
|
+
exposure: true
|
|
144
|
+
}) &&
|
|
145
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
146
|
+
contentAreaReducedHeaderSpace, isEditorToolbarHidden && editorExperiment('platform_editor_controls', 'variant1') &&
|
|
147
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
148
|
+
contentAreaReservedPrimaryToolbarSpace];
|
|
141
149
|
const editorContentAreaWithLayoutWith = layoutMaxWidth => css({
|
|
142
150
|
// this restricts max width
|
|
143
151
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
@@ -212,17 +220,17 @@ export const editorContentGutterStyle = () => {
|
|
|
212
220
|
});
|
|
213
221
|
};
|
|
214
222
|
|
|
215
|
-
// An additional
|
|
216
|
-
//
|
|
223
|
+
// An additional spacing applied at the top of the content area reserving space when the primary toolbar
|
|
224
|
+
// is hidden – this avoids layout shift when the toolbar is toggled under the editor controls feature
|
|
217
225
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
218
|
-
|
|
226
|
+
const contentAreaReservedPrimaryToolbarSpace = css({
|
|
219
227
|
// extra 1px to account for the bottom border on the toolbar
|
|
220
|
-
|
|
228
|
+
marginTop: `calc(${"var(--ds-space-500, 40px)"} + 1px)`
|
|
221
229
|
});
|
|
222
230
|
|
|
223
|
-
// A reduced top
|
|
231
|
+
// A reduced top spacing applied to the content area to compensate for the reserved space at the top
|
|
224
232
|
// of the page when the primary toolbar is hidden under the editor controls feature
|
|
225
233
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
226
|
-
|
|
234
|
+
const contentAreaReducedHeaderSpace = css({
|
|
227
235
|
paddingTop: "var(--ds-space-400, 32px)"
|
|
228
236
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "204.4.
|
|
2
|
+
export const version = "204.4.8";
|
|
@@ -49,50 +49,55 @@ var EditorActions = /*#__PURE__*/function () {
|
|
|
49
49
|
* refers to the latest state of editor with confirmed
|
|
50
50
|
* steps.
|
|
51
51
|
*/
|
|
52
|
-
_defineProperty(this, "getResolvedEditorState", /*#__PURE__*/
|
|
53
|
-
var
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
52
|
+
_defineProperty(this, "getResolvedEditorState", /*#__PURE__*/function () {
|
|
53
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(reason) {
|
|
54
|
+
var _this$getFeatureFlags, useNativeCollabPlugin, editorValue, editorView, collabEditState;
|
|
55
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
56
|
+
while (1) switch (_context.prev = _context.next) {
|
|
57
|
+
case 0:
|
|
58
|
+
_this$getFeatureFlags = _this.getFeatureFlags(), useNativeCollabPlugin = _this$getFeatureFlags.useNativeCollabPlugin;
|
|
59
|
+
if (_this.editorView) {
|
|
60
|
+
_context.next = 3;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
throw new Error('Called getResolvedEditorState before editorView is ready');
|
|
64
|
+
case 3:
|
|
65
|
+
if (useNativeCollabPlugin) {
|
|
66
|
+
_context.next = 10;
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
_context.next = 6;
|
|
70
|
+
return _this.getValue();
|
|
71
|
+
case 6:
|
|
72
|
+
editorValue = _context.sent;
|
|
73
|
+
if (editorValue) {
|
|
74
|
+
_context.next = 9;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
throw new Error('editorValue is undefined');
|
|
78
|
+
case 9:
|
|
79
|
+
return _context.abrupt("return", {
|
|
80
|
+
content: editorValue,
|
|
81
|
+
title: null,
|
|
82
|
+
stepVersion: -1
|
|
83
|
+
});
|
|
84
|
+
case 10:
|
|
85
|
+
editorView = _this.editorView;
|
|
86
|
+
_context.next = 13;
|
|
87
|
+
return getEditorValueWithMedia(editorView);
|
|
88
|
+
case 13:
|
|
89
|
+
collabEditState = fakePluginKey.getState(editorView.state);
|
|
90
|
+
return _context.abrupt("return", collabEditState === null || collabEditState === void 0 ? void 0 : collabEditState.getFinalAcknowledgedState(reason));
|
|
91
|
+
case 15:
|
|
92
|
+
case "end":
|
|
93
|
+
return _context.stop();
|
|
94
|
+
}
|
|
95
|
+
}, _callee);
|
|
96
|
+
}));
|
|
97
|
+
return function (_x) {
|
|
98
|
+
return _ref.apply(this, arguments);
|
|
99
|
+
};
|
|
100
|
+
}());
|
|
96
101
|
}
|
|
97
102
|
return _createClass(EditorActions, [{
|
|
98
103
|
key: "_privateGetEditorView",
|
|
@@ -14,7 +14,7 @@ import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared
|
|
|
14
14
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
15
15
|
import { FullPageContentArea } from './FullPageContentArea';
|
|
16
16
|
import { FullPageToolbar } from './FullPageToolbar';
|
|
17
|
-
import { fullPageEditorWrapper
|
|
17
|
+
import { fullPageEditorWrapper } from './StyledComponents';
|
|
18
18
|
var useShowKeyline = function useShowKeyline(contentAreaRef) {
|
|
19
19
|
var _useState = useState(false),
|
|
20
20
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -98,13 +98,8 @@ export var FullPageEditor = function FullPageEditor(props) {
|
|
|
98
98
|
}
|
|
99
99
|
var popupsBoundariesElement = props.popupsBoundariesElement || (scrollContentContainerRef === null || scrollContentContainerRef === void 0 || (_scrollContentContain = scrollContentContainerRef.current) === null || _scrollContentContain === void 0 ? void 0 : _scrollContentContain.containerArea) || undefined;
|
|
100
100
|
return jsx(ContextPanelWidthProvider, null, jsx("div", {
|
|
101
|
-
css: [
|
|
102
101
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
103
|
-
fullPageEditorWrapper
|
|
104
|
-
exposure: true
|
|
105
|
-
}) &&
|
|
106
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
107
|
-
primaryToolbarReservedSpace]
|
|
102
|
+
css: fullPageEditorWrapper
|
|
108
103
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
109
104
|
,
|
|
110
105
|
className: "akEditor",
|
|
@@ -17,7 +17,7 @@ import ClickAreaBlock from '../../Addon/ClickAreaBlock';
|
|
|
17
17
|
import { contentComponentClickWrapper } from '../../Addon/ClickAreaBlock/contentComponentWrapper';
|
|
18
18
|
import { ContextPanel } from '../../ContextPanel';
|
|
19
19
|
import PluginSlot from '../../PluginSlot';
|
|
20
|
-
import { contentArea, contentAreaHeightNoToolbar,
|
|
20
|
+
import { contentArea, contentAreaHeightNoToolbar, contentAreaWrapper, editorContentAreaStyle, editorContentGutterStyle, ScrollContainer, sidebarArea } from './StyledComponents';
|
|
21
21
|
export var CONTENT_AREA_TEST_ID = 'ak-editor-fp-content-area';
|
|
22
22
|
export var EDITOR_CONTAINER = 'ak-editor-container';
|
|
23
23
|
var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -71,15 +71,13 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
71
71
|
editorView: props.editorView,
|
|
72
72
|
editorDisabled: props.disabled
|
|
73
73
|
}, jsx("div", {
|
|
74
|
-
css:
|
|
74
|
+
css: _toConsumableArray(editorContentAreaStyle({
|
|
75
75
|
fullWidthMode: fullWidthMode,
|
|
76
|
-
layoutMaxWidth: theme.layoutMaxWidth
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}) &&
|
|
80
|
-
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
81
|
-
contentAreaReducedHeaderSpace]),
|
|
76
|
+
layoutMaxWidth: theme.layoutMaxWidth,
|
|
77
|
+
isEditorToolbarHidden: props.isEditorToolbarHidden
|
|
78
|
+
})),
|
|
82
79
|
"data-editor-editable-content": true,
|
|
80
|
+
"data-editor-primary-toolbar-hidden": props.isEditorToolbarHidden && editorExperiment('platform_editor_controls', 'variant1') ? 'true' : undefined,
|
|
83
81
|
role: "region",
|
|
84
82
|
"aria-label": props.intl.formatMessage(messages.editableContentLabel),
|
|
85
83
|
ref: contentAreaRef
|
|
@@ -7,6 +7,7 @@ import { tableMarginFullWidthMode } from '@atlaskit/editor-plugins/table/ui/cons
|
|
|
7
7
|
import { FULL_PAGE_EDITOR_TOOLBAR_HEIGHT, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic, akEditorSwoopCubicBezier, akLayoutGutterOffset } from '@atlaskit/editor-shared-styles';
|
|
8
8
|
import { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
10
11
|
import { createEditorContentStyle } from '../../ContentStyles';
|
|
11
12
|
|
|
12
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
@@ -141,8 +142,15 @@ var editorContentAreaContainerStyle = function editorContentAreaContainerStyle()
|
|
|
141
142
|
};
|
|
142
143
|
export var editorContentAreaStyle = function editorContentAreaStyle(_ref) {
|
|
143
144
|
var layoutMaxWidth = _ref.layoutMaxWidth,
|
|
144
|
-
fullWidthMode = _ref.fullWidthMode
|
|
145
|
-
|
|
145
|
+
fullWidthMode = _ref.fullWidthMode,
|
|
146
|
+
isEditorToolbarHidden = _ref.isEditorToolbarHidden;
|
|
147
|
+
return [editorContentArea, !fullWidthMode && editorContentAreaWithLayoutWith(layoutMaxWidth), editorContentAreaContainerStyle(), editorExperiment('platform_editor_controls', 'variant1', {
|
|
148
|
+
exposure: true
|
|
149
|
+
}) &&
|
|
150
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
151
|
+
contentAreaReducedHeaderSpace, isEditorToolbarHidden && editorExperiment('platform_editor_controls', 'variant1') &&
|
|
152
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
153
|
+
contentAreaReservedPrimaryToolbarSpace];
|
|
146
154
|
};
|
|
147
155
|
var editorContentAreaWithLayoutWith = function editorContentAreaWithLayoutWith(layoutMaxWidth) {
|
|
148
156
|
return css({
|
|
@@ -215,17 +223,17 @@ export var editorContentGutterStyle = function editorContentGutterStyle() {
|
|
|
215
223
|
});
|
|
216
224
|
};
|
|
217
225
|
|
|
218
|
-
// An additional
|
|
219
|
-
//
|
|
226
|
+
// An additional spacing applied at the top of the content area reserving space when the primary toolbar
|
|
227
|
+
// is hidden – this avoids layout shift when the toolbar is toggled under the editor controls feature
|
|
220
228
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
221
|
-
|
|
229
|
+
var contentAreaReservedPrimaryToolbarSpace = css({
|
|
222
230
|
// extra 1px to account for the bottom border on the toolbar
|
|
223
|
-
|
|
231
|
+
marginTop: "calc(".concat("var(--ds-space-500, 40px)", " + 1px)")
|
|
224
232
|
});
|
|
225
233
|
|
|
226
|
-
// A reduced top
|
|
234
|
+
// A reduced top spacing applied to the content area to compensate for the reserved space at the top
|
|
227
235
|
// of the page when the primary toolbar is hidden under the editor controls feature
|
|
228
236
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
229
|
-
|
|
237
|
+
var contentAreaReducedHeaderSpace = css({
|
|
230
238
|
paddingTop: "var(--ds-space-400, 32px)"
|
|
231
239
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "204.4.
|
|
2
|
+
export var version = "204.4.8";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AnalyticsEventPayload } from '@atlaskit/analytics-next/AnalyticsEvent';
|
|
2
2
|
import type { ResolvedEditorState } from '@atlaskit/editor-common/collab';
|
|
3
3
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
|
-
import type { ContextUpdateHandler, EditorActionsOptions, FeatureFlags, ReplaceRawValue, Transformer } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { ContextUpdateHandler, EditorActionsOptions, FeatureFlags, ReplaceRawValue, GetResolvedEditorStateReason, Transformer } from '@atlaskit/editor-common/types';
|
|
5
5
|
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
export default class EditorActions<T = any> implements EditorActionsOptions<T> {
|
|
@@ -64,5 +64,5 @@ export default class EditorActions<T = any> implements EditorActionsOptions<T> {
|
|
|
64
64
|
* refers to the latest state of editor with confirmed
|
|
65
65
|
* steps.
|
|
66
66
|
*/
|
|
67
|
-
getResolvedEditorState: () => Promise<ResolvedEditorState | undefined>;
|
|
67
|
+
getResolvedEditorState: (reason: GetResolvedEditorStateReason) => Promise<ResolvedEditorState | undefined>;
|
|
68
68
|
}
|
|
@@ -13,10 +13,9 @@ export declare const contentAreaWrapper: import("@emotion/react").SerializedStyl
|
|
|
13
13
|
export declare const contentAreaHeightNoToolbar: import("@emotion/react").SerializedStyles;
|
|
14
14
|
export declare const sidebarArea: import("@emotion/react").SerializedStyles;
|
|
15
15
|
export declare const editorContentAreaHideContainer: import("@emotion/react").SerializedStyles;
|
|
16
|
-
export declare const editorContentAreaStyle: ({ layoutMaxWidth, fullWidthMode, }: {
|
|
16
|
+
export declare const editorContentAreaStyle: ({ layoutMaxWidth, fullWidthMode, isEditorToolbarHidden, }: {
|
|
17
17
|
layoutMaxWidth: number;
|
|
18
18
|
fullWidthMode: boolean;
|
|
19
|
-
|
|
19
|
+
isEditorToolbarHidden?: boolean | undefined;
|
|
20
|
+
}) => (false | import("@emotion/react").SerializedStyles | undefined)[];
|
|
20
21
|
export declare const editorContentGutterStyle: () => import("@emotion/react").SerializedStyles;
|
|
21
|
-
export declare const primaryToolbarReservedSpace: import("@emotion/react").SerializedStyles;
|
|
22
|
-
export declare const contentAreaReducedHeaderSpace: import("@emotion/react").SerializedStyles;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AnalyticsEventPayload } from '@atlaskit/analytics-next/AnalyticsEvent';
|
|
2
2
|
import type { ResolvedEditorState } from '@atlaskit/editor-common/collab';
|
|
3
3
|
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
|
-
import type { ContextUpdateHandler, EditorActionsOptions, FeatureFlags, ReplaceRawValue, Transformer } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { ContextUpdateHandler, EditorActionsOptions, FeatureFlags, ReplaceRawValue, GetResolvedEditorStateReason, Transformer } from '@atlaskit/editor-common/types';
|
|
5
5
|
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
7
|
export default class EditorActions<T = any> implements EditorActionsOptions<T> {
|
|
@@ -64,5 +64,5 @@ export default class EditorActions<T = any> implements EditorActionsOptions<T> {
|
|
|
64
64
|
* refers to the latest state of editor with confirmed
|
|
65
65
|
* steps.
|
|
66
66
|
*/
|
|
67
|
-
getResolvedEditorState: () => Promise<ResolvedEditorState | undefined>;
|
|
67
|
+
getResolvedEditorState: (reason: GetResolvedEditorStateReason) => Promise<ResolvedEditorState | undefined>;
|
|
68
68
|
}
|
|
@@ -13,10 +13,9 @@ export declare const contentAreaWrapper: import("@emotion/react").SerializedStyl
|
|
|
13
13
|
export declare const contentAreaHeightNoToolbar: import("@emotion/react").SerializedStyles;
|
|
14
14
|
export declare const sidebarArea: import("@emotion/react").SerializedStyles;
|
|
15
15
|
export declare const editorContentAreaHideContainer: import("@emotion/react").SerializedStyles;
|
|
16
|
-
export declare const editorContentAreaStyle: ({ layoutMaxWidth, fullWidthMode, }: {
|
|
16
|
+
export declare const editorContentAreaStyle: ({ layoutMaxWidth, fullWidthMode, isEditorToolbarHidden, }: {
|
|
17
17
|
layoutMaxWidth: number;
|
|
18
18
|
fullWidthMode: boolean;
|
|
19
|
-
|
|
19
|
+
isEditorToolbarHidden?: boolean | undefined;
|
|
20
|
+
}) => (false | import("@emotion/react").SerializedStyles | undefined)[];
|
|
20
21
|
export declare const editorContentGutterStyle: () => import("@emotion/react").SerializedStyles;
|
|
21
|
-
export declare const primaryToolbarReservedSpace: import("@emotion/react").SerializedStyles;
|
|
22
|
-
export declare const contentAreaReducedHeaderSpace: import("@emotion/react").SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "204.4.
|
|
3
|
+
"version": "204.4.8",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/mention": "^24.1.0",
|
|
60
60
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
61
61
|
"@atlaskit/react-ufo": "^3.4.0",
|
|
62
|
-
"@atlaskit/task-decision": "^19.
|
|
62
|
+
"@atlaskit/task-decision": "^19.1.0",
|
|
63
63
|
"@atlaskit/tmp-editor-statsig": "^3.6.0",
|
|
64
64
|
"@atlaskit/tokens": "^4.4.0",
|
|
65
65
|
"@atlaskit/tooltip": "^20.0.0",
|
|
@@ -539,6 +539,10 @@
|
|
|
539
539
|
"type": "boolean",
|
|
540
540
|
"referenceOnly": true
|
|
541
541
|
},
|
|
542
|
+
"platform_editor_non_macros_list_indent_fix": {
|
|
543
|
+
"type": "boolean",
|
|
544
|
+
"referenceOnly": true
|
|
545
|
+
},
|
|
542
546
|
"platform_editor_remove_drag_handle_fix": {
|
|
543
547
|
"type": "boolean",
|
|
544
548
|
"referenceOnly": true
|