@atlaskit/editor-core 194.0.0 → 194.0.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 +16 -0
- package/dist/cjs/ui/Appearance/Comment/Comment.js +10 -210
- package/dist/cjs/ui/ContentStyles/expand.js +4 -3
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +6 -195
- package/dist/es2019/ui/ContentStyles/expand.js +4 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +8 -212
- package/dist/esm/ui/ContentStyles/expand.js +4 -3
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/create-editor/create-preset.d.ts +1 -0
- package/dist/types/presets/universal.d.ts +1 -0
- package/dist/types/presets/useUniversalPreset.d.ts +1 -0
- package/dist/types/types/editor-props.d.ts +14 -4
- package/dist/types-ts4.5/create-editor/create-preset.d.ts +1 -0
- package/dist/types-ts4.5/presets/universal.d.ts +1 -0
- package/dist/types-ts4.5/presets/useUniversalPreset.d.ts +1 -0
- package/dist/types-ts4.5/types/editor-props.d.ts +14 -4
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 194.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#117148](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117148)
|
|
8
|
+
[`e90581362187a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e90581362187a) -
|
|
9
|
+
remove overflow hidden from expand node
|
|
10
|
+
|
|
11
|
+
## 194.0.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#117063](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117063)
|
|
16
|
+
[`dbb832d0b1929`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dbb832d0b1929) -
|
|
17
|
+
clean up FF platform.editor.media.alluploadsfinished-dispatch-update_ivtow
|
|
18
|
+
|
|
3
19
|
## 194.0.0
|
|
4
20
|
|
|
5
21
|
### Major Changes
|
|
@@ -7,13 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.CommentEditorWithIntl = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
13
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
14
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
15
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
16
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
18
11
|
var _react2 = require("@emotion/react");
|
|
19
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
@@ -39,8 +32,10 @@ var _WithFlash = _interopRequireDefault(require("../../WithFlash"));
|
|
|
39
32
|
var _Toolbar2 = require("./Toolbar");
|
|
40
33
|
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); }
|
|
41
34
|
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; }
|
|
42
|
-
|
|
43
|
-
|
|
35
|
+
/** @jsx jsx */
|
|
36
|
+
|
|
37
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
38
|
+
|
|
44
39
|
var CommentEditorMargin = 14;
|
|
45
40
|
var commentEditorStyles = (0, _react2.css)({
|
|
46
41
|
display: 'flex',
|
|
@@ -62,7 +57,7 @@ var commentEditorStyles = (0, _react2.css)({
|
|
|
62
57
|
var ContentArea = (0, _ContentStyles.createEditorContentStyle)((0, _react2.css)({
|
|
63
58
|
flexGrow: 1,
|
|
64
59
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
65
|
-
overflowX: (0, _platformFeatureFlags.
|
|
60
|
+
overflowX: (0, _platformFeatureFlags.fg)('platform.editor.table-sticky-scrollbar') ? 'clip' : 'hidden',
|
|
66
61
|
lineHeight: '24px',
|
|
67
62
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
68
63
|
'.ProseMirror': {
|
|
@@ -88,204 +83,12 @@ var secondaryToolbarStyles = (0, _react2.css)({
|
|
|
88
83
|
padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-025, 2px)")
|
|
89
84
|
});
|
|
90
85
|
var appearance = 'comment';
|
|
91
|
-
var Editor =
|
|
92
|
-
(0, _inherits2.default)(Editor, _React$Component);
|
|
93
|
-
var _super = _createSuper(Editor);
|
|
94
|
-
function Editor(props) {
|
|
95
|
-
var _this;
|
|
96
|
-
(0, _classCallCheck2.default)(this, Editor);
|
|
97
|
-
_this = _super.call(this, props);
|
|
98
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "appearance", 'comment');
|
|
99
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "containerElement", null);
|
|
100
|
-
// Wrapper container for toolbar and content area
|
|
101
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "wrapperElementRef", /*#__PURE__*/_react.default.createRef());
|
|
102
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleSave", function () {
|
|
103
|
-
if (_this.props.editorView && _this.props.onSave) {
|
|
104
|
-
_this.props.onSave(_this.props.editorView);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleCancel", function () {
|
|
108
|
-
if (_this.props.editorView && _this.props.onCancel) {
|
|
109
|
-
_this.props.onCancel(_this.props.editorView);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderChrome", function (_ref) {
|
|
113
|
-
var maxContentSize = _ref.maxContentSize,
|
|
114
|
-
mediaState = _ref.mediaState,
|
|
115
|
-
primaryToolbarState = _ref.primaryToolbarState;
|
|
116
|
-
var _this$props = _this.props,
|
|
117
|
-
editorDOMElement = _this$props.editorDOMElement,
|
|
118
|
-
editorView = _this$props.editorView,
|
|
119
|
-
editorActions = _this$props.editorActions,
|
|
120
|
-
eventDispatcher = _this$props.eventDispatcher,
|
|
121
|
-
providerFactory = _this$props.providerFactory,
|
|
122
|
-
contentComponents = _this$props.contentComponents,
|
|
123
|
-
customContentComponents = _this$props.customContentComponents,
|
|
124
|
-
customPrimaryToolbarComponents = _this$props.customPrimaryToolbarComponents,
|
|
125
|
-
primaryToolbarComponentsProp = _this$props.primaryToolbarComponents,
|
|
126
|
-
customSecondaryToolbarComponents = _this$props.customSecondaryToolbarComponents,
|
|
127
|
-
popupsMountPoint = _this$props.popupsMountPoint,
|
|
128
|
-
popupsBoundariesElement = _this$props.popupsBoundariesElement,
|
|
129
|
-
popupsScrollableElement = _this$props.popupsScrollableElement,
|
|
130
|
-
maxHeight = _this$props.maxHeight,
|
|
131
|
-
_this$props$minHeight = _this$props.minHeight,
|
|
132
|
-
minHeight = _this$props$minHeight === void 0 ? 150 : _this$props$minHeight,
|
|
133
|
-
onSave = _this$props.onSave,
|
|
134
|
-
onCancel = _this$props.onCancel,
|
|
135
|
-
disabled = _this$props.disabled,
|
|
136
|
-
dispatchAnalyticsEvent = _this$props.dispatchAnalyticsEvent,
|
|
137
|
-
intl = _this$props.intl,
|
|
138
|
-
useStickyToolbar = _this$props.useStickyToolbar,
|
|
139
|
-
pluginHooks = _this$props.pluginHooks,
|
|
140
|
-
featureFlags = _this$props.featureFlags;
|
|
141
|
-
var maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
|
|
142
|
-
var showSecondaryToolbar = !!onSave || !!onCancel || !!customSecondaryToolbarComponents;
|
|
143
|
-
var isShortcutToFocusToolbar = function isShortcutToFocusToolbar(event) {
|
|
144
|
-
//Alt + F9 to reach first element in this main toolbar
|
|
145
|
-
return event.altKey && (event.key === 'F9' || event.keyCode === 120);
|
|
146
|
-
};
|
|
147
|
-
var isTwoLineToolbarEnabled = !!customPrimaryToolbarComponents && !!(featureFlags !== null && featureFlags !== void 0 && featureFlags.twoLineEditorToolbar);
|
|
148
|
-
var handleEscape = function handleEscape(event) {
|
|
149
|
-
if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
150
|
-
editorView === null || editorView === void 0 || editorView.focus();
|
|
151
|
-
}
|
|
152
|
-
event.preventDefault();
|
|
153
|
-
event.stopPropagation();
|
|
154
|
-
};
|
|
155
|
-
var primaryToolbarComponents = primaryToolbarComponentsProp;
|
|
156
|
-
if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
|
|
157
|
-
primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
|
|
158
|
-
}
|
|
159
|
-
return (0, _react2.jsx)(_WithFlash.default, {
|
|
160
|
-
animate: maxContentSizeReached
|
|
161
|
-
}, (0, _react2.jsx)("div", {
|
|
162
|
-
css: [commentEditorStyles,
|
|
163
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
164
|
-
(0, _react2.css)({
|
|
165
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
166
|
-
minHeight: "".concat(minHeight, "px")
|
|
167
|
-
})]
|
|
168
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
169
|
-
,
|
|
170
|
-
className: "akEditor",
|
|
171
|
-
ref: _this.wrapperElementRef
|
|
172
|
-
}, (0, _react2.jsx)(_Toolbar2.MainToolbar, {
|
|
173
|
-
useStickyToolbar: useStickyToolbar,
|
|
174
|
-
twoLineEditorToolbar: isTwoLineToolbarEnabled
|
|
175
|
-
}, (0, _react2.jsx)(_uiMenu.ToolbarArrowKeyNavigationProvider, {
|
|
176
|
-
editorView: editorView,
|
|
177
|
-
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
178
|
-
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
179
|
-
handleEscape: handleEscape,
|
|
180
|
-
editorAppearance: _this.appearance,
|
|
181
|
-
useStickyToolbar: useStickyToolbar,
|
|
182
|
-
intl: intl
|
|
183
|
-
}, (0, _react2.jsx)(_Toolbar.default, {
|
|
184
|
-
editorView: editorView,
|
|
185
|
-
editorActions: editorActions,
|
|
186
|
-
eventDispatcher: eventDispatcher,
|
|
187
|
-
providerFactory: providerFactory,
|
|
188
|
-
appearance: _this.appearance,
|
|
189
|
-
items: primaryToolbarComponents,
|
|
190
|
-
popupsMountPoint: popupsMountPoint,
|
|
191
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
192
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
193
|
-
disabled: !!disabled,
|
|
194
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
195
|
-
containerElement: _this.containerElement,
|
|
196
|
-
twoLineEditorToolbar: isTwoLineToolbarEnabled
|
|
197
|
-
}), (0, _react2.jsx)("div", {
|
|
198
|
-
css: (0, _Toolbar2.mainToolbarCustomComponentsSlotStyle)(isTwoLineToolbarEnabled)
|
|
199
|
-
}, customPrimaryToolbarComponents))), (0, _react2.jsx)(_Addon.ClickAreaBlock, {
|
|
200
|
-
editorView: editorView,
|
|
201
|
-
editorDisabled: disabled
|
|
202
|
-
}, (0, _react2.jsx)(_ui.WidthConsumer, null, function (_ref2) {
|
|
203
|
-
var width = _ref2.width;
|
|
204
|
-
return (0, _react2.jsx)(ContentArea, {
|
|
205
|
-
ref: function ref(_ref3) {
|
|
206
|
-
return _this.containerElement = _ref3;
|
|
207
|
-
},
|
|
208
|
-
css: maxHeight ?
|
|
209
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
210
|
-
(0, _react2.css)({
|
|
211
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
212
|
-
maxHeight: "".concat(maxHeight, "px")
|
|
213
|
-
}) : null
|
|
214
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
215
|
-
,
|
|
216
|
-
className: (0, _classnames.default)('ak-editor-content-area', {
|
|
217
|
-
'less-margin': width < _editorSharedStyles.akEditorMobileBreakoutPoint
|
|
218
|
-
}),
|
|
219
|
-
featureFlags: featureFlags
|
|
220
|
-
}, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, (0, _react2.jsx)(_PluginSlot.default, {
|
|
221
|
-
editorView: editorView,
|
|
222
|
-
editorActions: editorActions,
|
|
223
|
-
eventDispatcher: eventDispatcher,
|
|
224
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
225
|
-
providerFactory: providerFactory,
|
|
226
|
-
appearance: _this.appearance,
|
|
227
|
-
items: contentComponents,
|
|
228
|
-
popupsMountPoint: popupsMountPoint,
|
|
229
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
230
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
231
|
-
containerElement: _this.containerElement,
|
|
232
|
-
disabled: !!disabled,
|
|
233
|
-
wrapperElement: _this.wrapperElementRef.current,
|
|
234
|
-
pluginHooks: pluginHooks
|
|
235
|
-
}), editorDOMElement, customContentComponents && 'after' in customContentComponents ? customContentComponents.after : null);
|
|
236
|
-
}))), showSecondaryToolbar && (0, _react2.jsx)("div", {
|
|
237
|
-
css: secondaryToolbarStyles,
|
|
238
|
-
"data-testid": "ak-editor-secondary-toolbar"
|
|
239
|
-
}, (0, _react2.jsx)(_buttonGroup.default, null, !!onSave && (0, _react2.jsx)(_new.default, {
|
|
240
|
-
appearance: "primary",
|
|
241
|
-
onClick: _this.handleSave,
|
|
242
|
-
testId: "comment-save-button",
|
|
243
|
-
isDisabled: disabled || mediaState && !mediaState.allUploadsFinished
|
|
244
|
-
}, intl.formatMessage(_messages.default.saveButton)), !!onCancel && (0, _react2.jsx)(_new.default, {
|
|
245
|
-
appearance: "subtle",
|
|
246
|
-
onClick: _this.handleCancel,
|
|
247
|
-
isDisabled: disabled
|
|
248
|
-
}, intl.formatMessage(_messages.default.cancelButton))), (0, _react2.jsx)("span", {
|
|
249
|
-
style: {
|
|
250
|
-
flexGrow: 1
|
|
251
|
-
}
|
|
252
|
-
}), customSecondaryToolbarComponents));
|
|
253
|
-
});
|
|
254
|
-
if (props.innerRef) {
|
|
255
|
-
_this.wrapperElementRef = props.innerRef;
|
|
256
|
-
}
|
|
257
|
-
return _this;
|
|
258
|
-
}
|
|
259
|
-
(0, _createClass2.default)(Editor, [{
|
|
260
|
-
key: "render",
|
|
261
|
-
value: function render() {
|
|
262
|
-
return (0, _react2.jsx)(RenderWithPluginState, {
|
|
263
|
-
renderChrome: this.renderChrome
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
}]);
|
|
267
|
-
return Editor;
|
|
268
|
-
}(_react.default.Component);
|
|
269
|
-
(0, _defineProperty2.default)(Editor, "displayName", 'CommentEditorAppearance');
|
|
270
|
-
function RenderWithPluginState(_ref4) {
|
|
271
|
-
var renderChrome = _ref4.renderChrome;
|
|
86
|
+
var Editor = function Editor(props) {
|
|
272
87
|
var api = (0, _context.usePresetContext)();
|
|
273
88
|
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(api, ['media', 'maxContentSize', 'primaryToolbar']),
|
|
274
89
|
mediaState = _useSharedPluginState.mediaState,
|
|
275
90
|
maxContentSizeState = _useSharedPluginState.maxContentSizeState,
|
|
276
91
|
primaryToolbarState = _useSharedPluginState.primaryToolbarState;
|
|
277
|
-
return (0, _react2.jsx)(_react.Fragment, null, renderChrome({
|
|
278
|
-
maxContentSize: maxContentSizeState,
|
|
279
|
-
mediaState: mediaState !== null && mediaState !== void 0 ? mediaState : undefined,
|
|
280
|
-
primaryToolbarState: primaryToolbarState
|
|
281
|
-
}));
|
|
282
|
-
}
|
|
283
|
-
var EditorNext = function EditorNext(props) {
|
|
284
|
-
var api = (0, _context.usePresetContext)();
|
|
285
|
-
var _useSharedPluginState2 = (0, _hooks.useSharedPluginState)(api, ['media', 'maxContentSize', 'primaryToolbar']),
|
|
286
|
-
mediaState = _useSharedPluginState2.mediaState,
|
|
287
|
-
maxContentSizeState = _useSharedPluginState2.maxContentSizeState,
|
|
288
|
-
primaryToolbarState = _useSharedPluginState2.primaryToolbarState;
|
|
289
92
|
var editorDOMElement = props.editorDOMElement,
|
|
290
93
|
editorView = props.editorView,
|
|
291
94
|
editorActions = props.editorActions,
|
|
@@ -400,8 +203,8 @@ var EditorNext = function EditorNext(props) {
|
|
|
400
203
|
}, customPrimaryToolbarComponents))), (0, _react2.jsx)(_Addon.ClickAreaBlock, {
|
|
401
204
|
editorView: editorView,
|
|
402
205
|
editorDisabled: disabled
|
|
403
|
-
}, (0, _react2.jsx)(_ui.WidthConsumer, null, function (
|
|
404
|
-
var width =
|
|
206
|
+
}, (0, _react2.jsx)(_ui.WidthConsumer, null, function (_ref) {
|
|
207
|
+
var width = _ref.width;
|
|
405
208
|
return (0, _react2.jsx)(ContentArea, {
|
|
406
209
|
ref: containerElement,
|
|
407
210
|
css: maxHeight ?
|
|
@@ -450,8 +253,5 @@ var EditorNext = function EditorNext(props) {
|
|
|
450
253
|
}
|
|
451
254
|
}), customSecondaryToolbarComponents));
|
|
452
255
|
};
|
|
453
|
-
|
|
454
|
-
var
|
|
455
|
-
var CommentEditorOldWithIntl = (0, _reactIntlNext.injectIntl)(Editor);
|
|
456
|
-
var ExportComp = (0, _platformFeatureFlags.getBooleanFF)('platform.editor.media.alluploadsfinished-dispatch-update_ivtow') ? CommentEditorNextWithIntl : CommentEditorOldWithIntl;
|
|
457
|
-
var CommentEditorWithIntl = exports.CommentEditorWithIntl = ExportComp;
|
|
256
|
+
Editor.displayName = 'CommentEditorAppearance';
|
|
257
|
+
var CommentEditorWithIntl = exports.CommentEditorWithIntl = (0, _reactIntlNext.injectIntl)(Editor);
|
|
@@ -10,6 +10,7 @@ var _react = require("@emotion/react");
|
|
|
10
10
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
11
11
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
12
12
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
14
15
|
var _templateObject; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
16
|
var EXPAND_SELECTED_BACKGROUND = "var(--ds-background-neutral-subtle, rgba(255, 255, 255, 0.6))";
|
|
@@ -24,11 +25,11 @@ var DANGER_STATE_BORDER_COLOR = "var(--ds-border-danger, ".concat(_colors.R300,
|
|
|
24
25
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
25
26
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
26
27
|
var expandStyles = exports.expandStyles = function expandStyles() {
|
|
27
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " > div {\n\t\tdisplay: flex;\n\t}\n\n\t.", " {\n\t\t", "\n\t\
|
|
28
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " > div {\n\t\tdisplay: flex;\n\t}\n\n\t.", " {\n\t\t", "\n\t\t", "\n\n\t\tcursor: pointer;\n\t\tbox-sizing: border-box;\n\n\t\ttd > & {\n\t\t\tmargin-top: 0;\n\t\t}\n\n\t\t.", " svg {\n\t\t\t", ";\n\t\t\ttransform: rotate(90deg);\n\t\t}\n\n\t\t&.", ":not(.danger) {\n\t\t\t", "\n\t\t}\n\n\t\t&.danger {\n\t\t\tbackground: ", ";\n\t\t\tborder-color: ", ";\n\t\t}\n\t}\n\n\t.ProseMirror\n\t\t> .", ",\n\t\t.", "\n\t\t> .", " {\n\t\tmargin-left: -", "px;\n\t\tmargin-right: -", "px;\n\t}\n\n\t.", " {\n\t\t", "\n\t\tcursor: text;\n\t\tpadding-top: 0px;\n\t\t", "\n\t}\n\n\t.", " {\n\t\t", "\n\t}\n\n\t.", " {\n\t\t", ";\n\t\talign-items: center;\n\t\toverflow: visible;\n\t}\n\n\t.", " {\n\t\tbackground: ", ";\n\t\tborder-color: ", ";\n\n\t\t.", " {\n\t\t\tpadding-top: ", ";\n\t\t}\n\t}\n\n\t.", " {\n\t\twidth: 100%;\n\t}\n\n\t/* stylelint-disable property-no-unknown, value-keyword-case */\n\t.", ":(.", ") {\n\t\t.expand-content-wrapper {\n\t\t\theight: auto;\n\t\t}\n\t}\n\t/* stylelint-enable property-no-unknown, value-keyword-case */\n\n\t.", ":not(.", ") {\n\t\t.ak-editor-expand__content {\n\t\t\tposition: absolute;\n\t\t\theight: 1px;\n\t\t\twidth: 1px;\n\t\t\toverflow: hidden;\n\t\t\tclip: rect(1px, 1px, 1px, 1px);\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t.", " svg {\n\t\t\t", ";\n\t\t\ttransform: rotate(0deg);\n\t\t}\n\n\t\t&:not(.", "):not(.danger) {\n\t\t\tbackground: transparent;\n\t\t\tborder-color: transparent;\n\n\t\t\t&:hover {\n\t\t\t\tborder-color: ", ";\n\t\t\t\tbackground: ", ";\n\t\t\t}\n\t\t}\n\t}\n"])), _styles.expandClassNames.icon, _styles.expandClassNames.prefix, _ui.sharedExpandStyles.containerStyles({
|
|
28
29
|
expanded: false,
|
|
29
30
|
focused: false
|
|
30
|
-
})(), _styles.expandClassNames.iconContainer, EXPAND_ICON_COLOR(), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket, _editorSharedStyles.SelectionStyle.Border]), DANGER_STATE_BACKGROUND_COLOR, DANGER_STATE_BORDER_COLOR, _styles.expandClassNames.type('expand'), _styles.BreakoutCssClassName.BREAKOUT_MARK_DOM, _styles.expandClassNames.type('expand'), _editorSharedStyles.akLayoutGutterOffset, _editorSharedStyles.akLayoutGutterOffset, _styles.expandClassNames.content, _ui.sharedExpandStyles.contentStyles({
|
|
31
|
+
})(), !(0, _platformFeatureFlags.fg)('platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2') && "overflow: hidden;", _styles.expandClassNames.iconContainer, EXPAND_ICON_COLOR(), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket, _editorSharedStyles.SelectionStyle.Border]), DANGER_STATE_BACKGROUND_COLOR, DANGER_STATE_BORDER_COLOR, _styles.expandClassNames.type('expand'), _styles.BreakoutCssClassName.BREAKOUT_MARK_DOM, _styles.expandClassNames.type('expand'), _editorSharedStyles.akLayoutGutterOffset, _editorSharedStyles.akLayoutGutterOffset, _styles.expandClassNames.content, _ui.sharedExpandStyles.contentStyles({
|
|
31
32
|
expanded: false,
|
|
32
33
|
focused: false
|
|
33
|
-
})(), _styles.expandClassNames.titleInput, _ui.sharedExpandStyles.titleInputStyles(), _styles.expandClassNames.titleContainer, _ui.sharedExpandStyles.titleContainerStyles(), _styles.expandClassNames.expanded, EXPAND_SELECTED_BACKGROUND, "var(--ds-border, ".concat(_colors.N40A, ")"), _styles.expandClassNames.content, "var(--ds-space-100, 8px)", _styles.expandClassNames.inputContainer, _styles.expandClassNames.prefix, _styles.expandClassNames.expanded, _styles.expandClassNames.prefix, _styles.expandClassNames.expanded, _styles.expandClassNames.iconContainer, EXPAND_ICON_COLOR(), _editorSharedStyles.akEditorSelectedNodeClassName, "var(--ds-border, ".concat(_colors.N50A, ")"), EXPAND_SELECTED_BACKGROUND);
|
|
34
|
+
})(), (0, _platformFeatureFlags.fg)('platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2') && "overflow-x: clip;", _styles.expandClassNames.titleInput, _ui.sharedExpandStyles.titleInputStyles(), _styles.expandClassNames.titleContainer, _ui.sharedExpandStyles.titleContainerStyles(), _styles.expandClassNames.expanded, EXPAND_SELECTED_BACKGROUND, "var(--ds-border, ".concat(_colors.N40A, ")"), _styles.expandClassNames.content, "var(--ds-space-100, 8px)", _styles.expandClassNames.inputContainer, _styles.expandClassNames.prefix, _styles.expandClassNames.expanded, _styles.expandClassNames.prefix, _styles.expandClassNames.expanded, _styles.expandClassNames.iconContainer, EXPAND_ICON_COLOR(), _editorSharedStyles.akEditorSelectedNodeClassName, "var(--ds-border, ".concat(_colors.N50A, ")"), EXPAND_SELECTED_BACKGROUND);
|
|
34
35
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
1
|
/** @jsx jsx */
|
|
3
|
-
import React, {
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
4
3
|
|
|
5
4
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
5
|
import { css, jsx } from '@emotion/react';
|
|
@@ -14,7 +13,7 @@ import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
|
14
13
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
15
14
|
import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
16
15
|
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
17
|
-
import {
|
|
16
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
17
|
import { N100 } from '@atlaskit/theme/colors';
|
|
19
18
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
20
19
|
import messages from '../../../messages';
|
|
@@ -46,7 +45,7 @@ const commentEditorStyles = css({
|
|
|
46
45
|
const ContentArea = createEditorContentStyle(css({
|
|
47
46
|
flexGrow: 1,
|
|
48
47
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
49
|
-
overflowX:
|
|
48
|
+
overflowX: fg('platform.editor.table-sticky-scrollbar') ? 'clip' : 'hidden',
|
|
50
49
|
lineHeight: '24px',
|
|
51
50
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
52
51
|
'.ProseMirror': {
|
|
@@ -72,192 +71,7 @@ const secondaryToolbarStyles = css({
|
|
|
72
71
|
padding: `${"var(--ds-space-150, 12px)"} ${"var(--ds-space-025, 2px)"}`
|
|
73
72
|
});
|
|
74
73
|
const appearance = 'comment';
|
|
75
|
-
|
|
76
|
-
constructor(props) {
|
|
77
|
-
super(props);
|
|
78
|
-
_defineProperty(this, "appearance", 'comment');
|
|
79
|
-
_defineProperty(this, "containerElement", null);
|
|
80
|
-
// Wrapper container for toolbar and content area
|
|
81
|
-
_defineProperty(this, "wrapperElementRef", /*#__PURE__*/React.createRef());
|
|
82
|
-
_defineProperty(this, "handleSave", () => {
|
|
83
|
-
if (this.props.editorView && this.props.onSave) {
|
|
84
|
-
this.props.onSave(this.props.editorView);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
_defineProperty(this, "handleCancel", () => {
|
|
88
|
-
if (this.props.editorView && this.props.onCancel) {
|
|
89
|
-
this.props.onCancel(this.props.editorView);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
_defineProperty(this, "renderChrome", ({
|
|
93
|
-
maxContentSize,
|
|
94
|
-
mediaState,
|
|
95
|
-
primaryToolbarState
|
|
96
|
-
}) => {
|
|
97
|
-
const {
|
|
98
|
-
editorDOMElement,
|
|
99
|
-
editorView,
|
|
100
|
-
editorActions,
|
|
101
|
-
eventDispatcher,
|
|
102
|
-
providerFactory,
|
|
103
|
-
contentComponents,
|
|
104
|
-
customContentComponents,
|
|
105
|
-
customPrimaryToolbarComponents,
|
|
106
|
-
primaryToolbarComponents: primaryToolbarComponentsProp,
|
|
107
|
-
customSecondaryToolbarComponents,
|
|
108
|
-
popupsMountPoint,
|
|
109
|
-
popupsBoundariesElement,
|
|
110
|
-
popupsScrollableElement,
|
|
111
|
-
maxHeight,
|
|
112
|
-
minHeight = 150,
|
|
113
|
-
onSave,
|
|
114
|
-
onCancel,
|
|
115
|
-
disabled,
|
|
116
|
-
dispatchAnalyticsEvent,
|
|
117
|
-
intl,
|
|
118
|
-
useStickyToolbar,
|
|
119
|
-
pluginHooks,
|
|
120
|
-
featureFlags
|
|
121
|
-
} = this.props;
|
|
122
|
-
const maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
|
|
123
|
-
const showSecondaryToolbar = !!onSave || !!onCancel || !!customSecondaryToolbarComponents;
|
|
124
|
-
const isShortcutToFocusToolbar = event => {
|
|
125
|
-
//Alt + F9 to reach first element in this main toolbar
|
|
126
|
-
return event.altKey && (event.key === 'F9' || event.keyCode === 120);
|
|
127
|
-
};
|
|
128
|
-
const isTwoLineToolbarEnabled = !!customPrimaryToolbarComponents && !!(featureFlags !== null && featureFlags !== void 0 && featureFlags.twoLineEditorToolbar);
|
|
129
|
-
const handleEscape = event => {
|
|
130
|
-
if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
131
|
-
editorView === null || editorView === void 0 ? void 0 : editorView.focus();
|
|
132
|
-
}
|
|
133
|
-
event.preventDefault();
|
|
134
|
-
event.stopPropagation();
|
|
135
|
-
};
|
|
136
|
-
let primaryToolbarComponents = primaryToolbarComponentsProp;
|
|
137
|
-
if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
|
|
138
|
-
primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
|
|
139
|
-
}
|
|
140
|
-
return jsx(WithFlash, {
|
|
141
|
-
animate: maxContentSizeReached
|
|
142
|
-
}, jsx("div", {
|
|
143
|
-
css: [commentEditorStyles,
|
|
144
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
145
|
-
css({
|
|
146
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
147
|
-
minHeight: `${minHeight}px`
|
|
148
|
-
})]
|
|
149
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
150
|
-
,
|
|
151
|
-
className: "akEditor",
|
|
152
|
-
ref: this.wrapperElementRef
|
|
153
|
-
}, jsx(MainToolbar, {
|
|
154
|
-
useStickyToolbar: useStickyToolbar,
|
|
155
|
-
twoLineEditorToolbar: isTwoLineToolbarEnabled
|
|
156
|
-
}, jsx(ToolbarArrowKeyNavigationProvider, {
|
|
157
|
-
editorView: editorView,
|
|
158
|
-
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
159
|
-
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
160
|
-
handleEscape: handleEscape,
|
|
161
|
-
editorAppearance: this.appearance,
|
|
162
|
-
useStickyToolbar: useStickyToolbar,
|
|
163
|
-
intl: intl
|
|
164
|
-
}, jsx(Toolbar, {
|
|
165
|
-
editorView: editorView,
|
|
166
|
-
editorActions: editorActions,
|
|
167
|
-
eventDispatcher: eventDispatcher,
|
|
168
|
-
providerFactory: providerFactory,
|
|
169
|
-
appearance: this.appearance,
|
|
170
|
-
items: primaryToolbarComponents,
|
|
171
|
-
popupsMountPoint: popupsMountPoint,
|
|
172
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
173
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
174
|
-
disabled: !!disabled,
|
|
175
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
176
|
-
containerElement: this.containerElement,
|
|
177
|
-
twoLineEditorToolbar: isTwoLineToolbarEnabled
|
|
178
|
-
}), jsx("div", {
|
|
179
|
-
css: mainToolbarCustomComponentsSlotStyle(isTwoLineToolbarEnabled)
|
|
180
|
-
}, customPrimaryToolbarComponents))), jsx(ClickAreaBlock, {
|
|
181
|
-
editorView: editorView,
|
|
182
|
-
editorDisabled: disabled
|
|
183
|
-
}, jsx(WidthConsumer, null, ({
|
|
184
|
-
width
|
|
185
|
-
}) => {
|
|
186
|
-
return jsx(ContentArea, {
|
|
187
|
-
ref: ref => this.containerElement = ref,
|
|
188
|
-
css: maxHeight ?
|
|
189
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
190
|
-
css({
|
|
191
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
192
|
-
maxHeight: `${maxHeight}px`
|
|
193
|
-
}) : null
|
|
194
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
195
|
-
,
|
|
196
|
-
className: classnames('ak-editor-content-area', {
|
|
197
|
-
'less-margin': width < akEditorMobileBreakoutPoint
|
|
198
|
-
}),
|
|
199
|
-
featureFlags: featureFlags
|
|
200
|
-
}, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, jsx(PluginSlot, {
|
|
201
|
-
editorView: editorView,
|
|
202
|
-
editorActions: editorActions,
|
|
203
|
-
eventDispatcher: eventDispatcher,
|
|
204
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
205
|
-
providerFactory: providerFactory,
|
|
206
|
-
appearance: this.appearance,
|
|
207
|
-
items: contentComponents,
|
|
208
|
-
popupsMountPoint: popupsMountPoint,
|
|
209
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
210
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
211
|
-
containerElement: this.containerElement,
|
|
212
|
-
disabled: !!disabled,
|
|
213
|
-
wrapperElement: this.wrapperElementRef.current,
|
|
214
|
-
pluginHooks: pluginHooks
|
|
215
|
-
}), editorDOMElement, customContentComponents && 'after' in customContentComponents ? customContentComponents.after : null);
|
|
216
|
-
}))), showSecondaryToolbar && jsx("div", {
|
|
217
|
-
css: secondaryToolbarStyles,
|
|
218
|
-
"data-testid": "ak-editor-secondary-toolbar"
|
|
219
|
-
}, jsx(ButtonGroup, null, !!onSave && jsx(Button, {
|
|
220
|
-
appearance: "primary",
|
|
221
|
-
onClick: this.handleSave,
|
|
222
|
-
testId: "comment-save-button",
|
|
223
|
-
isDisabled: disabled || mediaState && !mediaState.allUploadsFinished
|
|
224
|
-
}, intl.formatMessage(messages.saveButton)), !!onCancel && jsx(Button, {
|
|
225
|
-
appearance: "subtle",
|
|
226
|
-
onClick: this.handleCancel,
|
|
227
|
-
isDisabled: disabled
|
|
228
|
-
}, intl.formatMessage(messages.cancelButton))), jsx("span", {
|
|
229
|
-
style: {
|
|
230
|
-
flexGrow: 1
|
|
231
|
-
}
|
|
232
|
-
}), customSecondaryToolbarComponents));
|
|
233
|
-
});
|
|
234
|
-
if (props.innerRef) {
|
|
235
|
-
this.wrapperElementRef = props.innerRef;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
render() {
|
|
239
|
-
return jsx(RenderWithPluginState, {
|
|
240
|
-
renderChrome: this.renderChrome
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
_defineProperty(Editor, "displayName", 'CommentEditorAppearance');
|
|
245
|
-
function RenderWithPluginState({
|
|
246
|
-
renderChrome
|
|
247
|
-
}) {
|
|
248
|
-
const api = usePresetContext();
|
|
249
|
-
const {
|
|
250
|
-
mediaState,
|
|
251
|
-
maxContentSizeState,
|
|
252
|
-
primaryToolbarState
|
|
253
|
-
} = useSharedPluginState(api, ['media', 'maxContentSize', 'primaryToolbar']);
|
|
254
|
-
return jsx(Fragment, null, renderChrome({
|
|
255
|
-
maxContentSize: maxContentSizeState,
|
|
256
|
-
mediaState: mediaState !== null && mediaState !== void 0 ? mediaState : undefined,
|
|
257
|
-
primaryToolbarState
|
|
258
|
-
}));
|
|
259
|
-
}
|
|
260
|
-
const EditorNext = props => {
|
|
74
|
+
const Editor = props => {
|
|
261
75
|
const api = usePresetContext();
|
|
262
76
|
const {
|
|
263
77
|
mediaState,
|
|
@@ -423,8 +237,5 @@ const EditorNext = props => {
|
|
|
423
237
|
}
|
|
424
238
|
}), customSecondaryToolbarComponents));
|
|
425
239
|
};
|
|
426
|
-
|
|
427
|
-
const
|
|
428
|
-
const CommentEditorOldWithIntl = injectIntl(Editor);
|
|
429
|
-
const ExportComp = getBooleanFF('platform.editor.media.alluploadsfinished-dispatch-update_ivtow') ? CommentEditorNextWithIntl : CommentEditorOldWithIntl;
|
|
430
|
-
export const CommentEditorWithIntl = ExportComp;
|
|
240
|
+
Editor.displayName = 'CommentEditorAppearance';
|
|
241
|
+
export const CommentEditorWithIntl = injectIntl(Editor);
|
|
@@ -3,6 +3,7 @@ import { css } from '@emotion/react';
|
|
|
3
3
|
import { BreakoutCssClassName, expandClassNames } from '@atlaskit/editor-common/styles';
|
|
4
4
|
import { sharedExpandStyles } from '@atlaskit/editor-common/ui';
|
|
5
5
|
import { akEditorSelectedNodeClassName, akLayoutGutterOffset, getSelectionStyles, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { N100A, N40A, N50A, R300, R50 } from '@atlaskit/theme/colors';
|
|
7
8
|
const EXPAND_SELECTED_BACKGROUND = "var(--ds-background-neutral-subtle, rgba(255, 255, 255, 0.6))";
|
|
8
9
|
const EXPAND_ICON_COLOR = () => css({
|
|
@@ -23,7 +24,8 @@ export const expandStyles = () => css`
|
|
|
23
24
|
expanded: false,
|
|
24
25
|
focused: false
|
|
25
26
|
})()}
|
|
26
|
-
overflow: hidden
|
|
27
|
+
${!fg('platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2') && `overflow: hidden;`}
|
|
28
|
+
|
|
27
29
|
cursor: pointer;
|
|
28
30
|
box-sizing: border-box;
|
|
29
31
|
|
|
@@ -61,6 +63,7 @@ export const expandStyles = () => css`
|
|
|
61
63
|
})()}
|
|
62
64
|
cursor: text;
|
|
63
65
|
padding-top: 0px;
|
|
66
|
+
${fg('platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2') && `overflow-x: clip;`}
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
.${expandClassNames.titleInput} {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "194.0.
|
|
2
|
+
export const version = "194.0.4";
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
2
|
/** @jsx jsx */
|
|
12
|
-
import React, {
|
|
3
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
13
4
|
|
|
14
5
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
15
6
|
import { css, jsx } from '@emotion/react';
|
|
@@ -23,7 +14,7 @@ import { WidthConsumer } from '@atlaskit/editor-common/ui';
|
|
|
23
14
|
import { ToolbarArrowKeyNavigationProvider } from '@atlaskit/editor-common/ui-menu';
|
|
24
15
|
import { tableCommentEditorStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
25
16
|
import { akEditorMobileBreakoutPoint } from '@atlaskit/editor-shared-styles';
|
|
26
|
-
import {
|
|
17
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
27
18
|
import { N100 } from '@atlaskit/theme/colors';
|
|
28
19
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
29
20
|
import messages from '../../../messages';
|
|
@@ -55,7 +46,7 @@ var commentEditorStyles = css({
|
|
|
55
46
|
var ContentArea = createEditorContentStyle(css({
|
|
56
47
|
flexGrow: 1,
|
|
57
48
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
58
|
-
overflowX:
|
|
49
|
+
overflowX: fg('platform.editor.table-sticky-scrollbar') ? 'clip' : 'hidden',
|
|
59
50
|
lineHeight: '24px',
|
|
60
51
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
61
52
|
'.ProseMirror': {
|
|
@@ -81,204 +72,12 @@ var secondaryToolbarStyles = css({
|
|
|
81
72
|
padding: "var(--ds-space-150, 12px)".concat(" ", "var(--ds-space-025, 2px)")
|
|
82
73
|
});
|
|
83
74
|
var appearance = 'comment';
|
|
84
|
-
var Editor =
|
|
85
|
-
_inherits(Editor, _React$Component);
|
|
86
|
-
var _super = _createSuper(Editor);
|
|
87
|
-
function Editor(props) {
|
|
88
|
-
var _this;
|
|
89
|
-
_classCallCheck(this, Editor);
|
|
90
|
-
_this = _super.call(this, props);
|
|
91
|
-
_defineProperty(_assertThisInitialized(_this), "appearance", 'comment');
|
|
92
|
-
_defineProperty(_assertThisInitialized(_this), "containerElement", null);
|
|
93
|
-
// Wrapper container for toolbar and content area
|
|
94
|
-
_defineProperty(_assertThisInitialized(_this), "wrapperElementRef", /*#__PURE__*/React.createRef());
|
|
95
|
-
_defineProperty(_assertThisInitialized(_this), "handleSave", function () {
|
|
96
|
-
if (_this.props.editorView && _this.props.onSave) {
|
|
97
|
-
_this.props.onSave(_this.props.editorView);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
_defineProperty(_assertThisInitialized(_this), "handleCancel", function () {
|
|
101
|
-
if (_this.props.editorView && _this.props.onCancel) {
|
|
102
|
-
_this.props.onCancel(_this.props.editorView);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
_defineProperty(_assertThisInitialized(_this), "renderChrome", function (_ref) {
|
|
106
|
-
var maxContentSize = _ref.maxContentSize,
|
|
107
|
-
mediaState = _ref.mediaState,
|
|
108
|
-
primaryToolbarState = _ref.primaryToolbarState;
|
|
109
|
-
var _this$props = _this.props,
|
|
110
|
-
editorDOMElement = _this$props.editorDOMElement,
|
|
111
|
-
editorView = _this$props.editorView,
|
|
112
|
-
editorActions = _this$props.editorActions,
|
|
113
|
-
eventDispatcher = _this$props.eventDispatcher,
|
|
114
|
-
providerFactory = _this$props.providerFactory,
|
|
115
|
-
contentComponents = _this$props.contentComponents,
|
|
116
|
-
customContentComponents = _this$props.customContentComponents,
|
|
117
|
-
customPrimaryToolbarComponents = _this$props.customPrimaryToolbarComponents,
|
|
118
|
-
primaryToolbarComponentsProp = _this$props.primaryToolbarComponents,
|
|
119
|
-
customSecondaryToolbarComponents = _this$props.customSecondaryToolbarComponents,
|
|
120
|
-
popupsMountPoint = _this$props.popupsMountPoint,
|
|
121
|
-
popupsBoundariesElement = _this$props.popupsBoundariesElement,
|
|
122
|
-
popupsScrollableElement = _this$props.popupsScrollableElement,
|
|
123
|
-
maxHeight = _this$props.maxHeight,
|
|
124
|
-
_this$props$minHeight = _this$props.minHeight,
|
|
125
|
-
minHeight = _this$props$minHeight === void 0 ? 150 : _this$props$minHeight,
|
|
126
|
-
onSave = _this$props.onSave,
|
|
127
|
-
onCancel = _this$props.onCancel,
|
|
128
|
-
disabled = _this$props.disabled,
|
|
129
|
-
dispatchAnalyticsEvent = _this$props.dispatchAnalyticsEvent,
|
|
130
|
-
intl = _this$props.intl,
|
|
131
|
-
useStickyToolbar = _this$props.useStickyToolbar,
|
|
132
|
-
pluginHooks = _this$props.pluginHooks,
|
|
133
|
-
featureFlags = _this$props.featureFlags;
|
|
134
|
-
var maxContentSizeReached = Boolean(maxContentSize === null || maxContentSize === void 0 ? void 0 : maxContentSize.maxContentSizeReached);
|
|
135
|
-
var showSecondaryToolbar = !!onSave || !!onCancel || !!customSecondaryToolbarComponents;
|
|
136
|
-
var isShortcutToFocusToolbar = function isShortcutToFocusToolbar(event) {
|
|
137
|
-
//Alt + F9 to reach first element in this main toolbar
|
|
138
|
-
return event.altKey && (event.key === 'F9' || event.keyCode === 120);
|
|
139
|
-
};
|
|
140
|
-
var isTwoLineToolbarEnabled = !!customPrimaryToolbarComponents && !!(featureFlags !== null && featureFlags !== void 0 && featureFlags.twoLineEditorToolbar);
|
|
141
|
-
var handleEscape = function handleEscape(event) {
|
|
142
|
-
if (!(editorView !== null && editorView !== void 0 && editorView.hasFocus())) {
|
|
143
|
-
editorView === null || editorView === void 0 || editorView.focus();
|
|
144
|
-
}
|
|
145
|
-
event.preventDefault();
|
|
146
|
-
event.stopPropagation();
|
|
147
|
-
};
|
|
148
|
-
var primaryToolbarComponents = primaryToolbarComponentsProp;
|
|
149
|
-
if (Array.isArray(primaryToolbarState === null || primaryToolbarState === void 0 ? void 0 : primaryToolbarState.components) && Array.isArray(primaryToolbarComponents)) {
|
|
150
|
-
primaryToolbarComponents = primaryToolbarState.components.concat(primaryToolbarComponents);
|
|
151
|
-
}
|
|
152
|
-
return jsx(WithFlash, {
|
|
153
|
-
animate: maxContentSizeReached
|
|
154
|
-
}, jsx("div", {
|
|
155
|
-
css: [commentEditorStyles,
|
|
156
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
157
|
-
css({
|
|
158
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
159
|
-
minHeight: "".concat(minHeight, "px")
|
|
160
|
-
})]
|
|
161
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
162
|
-
,
|
|
163
|
-
className: "akEditor",
|
|
164
|
-
ref: _this.wrapperElementRef
|
|
165
|
-
}, jsx(MainToolbar, {
|
|
166
|
-
useStickyToolbar: useStickyToolbar,
|
|
167
|
-
twoLineEditorToolbar: isTwoLineToolbarEnabled
|
|
168
|
-
}, jsx(ToolbarArrowKeyNavigationProvider, {
|
|
169
|
-
editorView: editorView,
|
|
170
|
-
childComponentSelector: "[data-testid='ak-editor-main-toolbar']",
|
|
171
|
-
isShortcutToFocusToolbar: isShortcutToFocusToolbar,
|
|
172
|
-
handleEscape: handleEscape,
|
|
173
|
-
editorAppearance: _this.appearance,
|
|
174
|
-
useStickyToolbar: useStickyToolbar,
|
|
175
|
-
intl: intl
|
|
176
|
-
}, jsx(Toolbar, {
|
|
177
|
-
editorView: editorView,
|
|
178
|
-
editorActions: editorActions,
|
|
179
|
-
eventDispatcher: eventDispatcher,
|
|
180
|
-
providerFactory: providerFactory,
|
|
181
|
-
appearance: _this.appearance,
|
|
182
|
-
items: primaryToolbarComponents,
|
|
183
|
-
popupsMountPoint: popupsMountPoint,
|
|
184
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
185
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
186
|
-
disabled: !!disabled,
|
|
187
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
188
|
-
containerElement: _this.containerElement,
|
|
189
|
-
twoLineEditorToolbar: isTwoLineToolbarEnabled
|
|
190
|
-
}), jsx("div", {
|
|
191
|
-
css: mainToolbarCustomComponentsSlotStyle(isTwoLineToolbarEnabled)
|
|
192
|
-
}, customPrimaryToolbarComponents))), jsx(ClickAreaBlock, {
|
|
193
|
-
editorView: editorView,
|
|
194
|
-
editorDisabled: disabled
|
|
195
|
-
}, jsx(WidthConsumer, null, function (_ref2) {
|
|
196
|
-
var width = _ref2.width;
|
|
197
|
-
return jsx(ContentArea, {
|
|
198
|
-
ref: function ref(_ref3) {
|
|
199
|
-
return _this.containerElement = _ref3;
|
|
200
|
-
},
|
|
201
|
-
css: maxHeight ?
|
|
202
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
203
|
-
css({
|
|
204
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
205
|
-
maxHeight: "".concat(maxHeight, "px")
|
|
206
|
-
}) : null
|
|
207
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
208
|
-
,
|
|
209
|
-
className: classnames('ak-editor-content-area', {
|
|
210
|
-
'less-margin': width < akEditorMobileBreakoutPoint
|
|
211
|
-
}),
|
|
212
|
-
featureFlags: featureFlags
|
|
213
|
-
}, customContentComponents && 'before' in customContentComponents ? customContentComponents.before : customContentComponents, jsx(PluginSlot, {
|
|
214
|
-
editorView: editorView,
|
|
215
|
-
editorActions: editorActions,
|
|
216
|
-
eventDispatcher: eventDispatcher,
|
|
217
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
218
|
-
providerFactory: providerFactory,
|
|
219
|
-
appearance: _this.appearance,
|
|
220
|
-
items: contentComponents,
|
|
221
|
-
popupsMountPoint: popupsMountPoint,
|
|
222
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
223
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
224
|
-
containerElement: _this.containerElement,
|
|
225
|
-
disabled: !!disabled,
|
|
226
|
-
wrapperElement: _this.wrapperElementRef.current,
|
|
227
|
-
pluginHooks: pluginHooks
|
|
228
|
-
}), editorDOMElement, customContentComponents && 'after' in customContentComponents ? customContentComponents.after : null);
|
|
229
|
-
}))), showSecondaryToolbar && jsx("div", {
|
|
230
|
-
css: secondaryToolbarStyles,
|
|
231
|
-
"data-testid": "ak-editor-secondary-toolbar"
|
|
232
|
-
}, jsx(ButtonGroup, null, !!onSave && jsx(Button, {
|
|
233
|
-
appearance: "primary",
|
|
234
|
-
onClick: _this.handleSave,
|
|
235
|
-
testId: "comment-save-button",
|
|
236
|
-
isDisabled: disabled || mediaState && !mediaState.allUploadsFinished
|
|
237
|
-
}, intl.formatMessage(messages.saveButton)), !!onCancel && jsx(Button, {
|
|
238
|
-
appearance: "subtle",
|
|
239
|
-
onClick: _this.handleCancel,
|
|
240
|
-
isDisabled: disabled
|
|
241
|
-
}, intl.formatMessage(messages.cancelButton))), jsx("span", {
|
|
242
|
-
style: {
|
|
243
|
-
flexGrow: 1
|
|
244
|
-
}
|
|
245
|
-
}), customSecondaryToolbarComponents));
|
|
246
|
-
});
|
|
247
|
-
if (props.innerRef) {
|
|
248
|
-
_this.wrapperElementRef = props.innerRef;
|
|
249
|
-
}
|
|
250
|
-
return _this;
|
|
251
|
-
}
|
|
252
|
-
_createClass(Editor, [{
|
|
253
|
-
key: "render",
|
|
254
|
-
value: function render() {
|
|
255
|
-
return jsx(RenderWithPluginState, {
|
|
256
|
-
renderChrome: this.renderChrome
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
}]);
|
|
260
|
-
return Editor;
|
|
261
|
-
}(React.Component);
|
|
262
|
-
_defineProperty(Editor, "displayName", 'CommentEditorAppearance');
|
|
263
|
-
function RenderWithPluginState(_ref4) {
|
|
264
|
-
var renderChrome = _ref4.renderChrome;
|
|
75
|
+
var Editor = function Editor(props) {
|
|
265
76
|
var api = usePresetContext();
|
|
266
77
|
var _useSharedPluginState = useSharedPluginState(api, ['media', 'maxContentSize', 'primaryToolbar']),
|
|
267
78
|
mediaState = _useSharedPluginState.mediaState,
|
|
268
79
|
maxContentSizeState = _useSharedPluginState.maxContentSizeState,
|
|
269
80
|
primaryToolbarState = _useSharedPluginState.primaryToolbarState;
|
|
270
|
-
return jsx(Fragment, null, renderChrome({
|
|
271
|
-
maxContentSize: maxContentSizeState,
|
|
272
|
-
mediaState: mediaState !== null && mediaState !== void 0 ? mediaState : undefined,
|
|
273
|
-
primaryToolbarState: primaryToolbarState
|
|
274
|
-
}));
|
|
275
|
-
}
|
|
276
|
-
var EditorNext = function EditorNext(props) {
|
|
277
|
-
var api = usePresetContext();
|
|
278
|
-
var _useSharedPluginState2 = useSharedPluginState(api, ['media', 'maxContentSize', 'primaryToolbar']),
|
|
279
|
-
mediaState = _useSharedPluginState2.mediaState,
|
|
280
|
-
maxContentSizeState = _useSharedPluginState2.maxContentSizeState,
|
|
281
|
-
primaryToolbarState = _useSharedPluginState2.primaryToolbarState;
|
|
282
81
|
var editorDOMElement = props.editorDOMElement,
|
|
283
82
|
editorView = props.editorView,
|
|
284
83
|
editorActions = props.editorActions,
|
|
@@ -393,8 +192,8 @@ var EditorNext = function EditorNext(props) {
|
|
|
393
192
|
}, customPrimaryToolbarComponents))), jsx(ClickAreaBlock, {
|
|
394
193
|
editorView: editorView,
|
|
395
194
|
editorDisabled: disabled
|
|
396
|
-
}, jsx(WidthConsumer, null, function (
|
|
397
|
-
var width =
|
|
195
|
+
}, jsx(WidthConsumer, null, function (_ref) {
|
|
196
|
+
var width = _ref.width;
|
|
398
197
|
return jsx(ContentArea, {
|
|
399
198
|
ref: containerElement,
|
|
400
199
|
css: maxHeight ?
|
|
@@ -443,8 +242,5 @@ var EditorNext = function EditorNext(props) {
|
|
|
443
242
|
}
|
|
444
243
|
}), customSecondaryToolbarComponents));
|
|
445
244
|
};
|
|
446
|
-
|
|
447
|
-
var
|
|
448
|
-
var CommentEditorOldWithIntl = injectIntl(Editor);
|
|
449
|
-
var ExportComp = getBooleanFF('platform.editor.media.alluploadsfinished-dispatch-update_ivtow') ? CommentEditorNextWithIntl : CommentEditorOldWithIntl;
|
|
450
|
-
export var CommentEditorWithIntl = ExportComp;
|
|
245
|
+
Editor.displayName = 'CommentEditorAppearance';
|
|
246
|
+
export var CommentEditorWithIntl = injectIntl(Editor);
|
|
@@ -5,6 +5,7 @@ import { css } from '@emotion/react';
|
|
|
5
5
|
import { BreakoutCssClassName, expandClassNames } from '@atlaskit/editor-common/styles';
|
|
6
6
|
import { sharedExpandStyles } from '@atlaskit/editor-common/ui';
|
|
7
7
|
import { akEditorSelectedNodeClassName, akLayoutGutterOffset, getSelectionStyles, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { N100A, N40A, N50A, R300, R50 } from '@atlaskit/theme/colors';
|
|
9
10
|
var EXPAND_SELECTED_BACKGROUND = "var(--ds-background-neutral-subtle, rgba(255, 255, 255, 0.6))";
|
|
10
11
|
var EXPAND_ICON_COLOR = function EXPAND_ICON_COLOR() {
|
|
@@ -18,11 +19,11 @@ var DANGER_STATE_BORDER_COLOR = "var(--ds-border-danger, ".concat(R300, ")");
|
|
|
18
19
|
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
19
20
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
20
21
|
export var expandStyles = function expandStyles() {
|
|
21
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t.", " > div {\n\t\tdisplay: flex;\n\t}\n\n\t.", " {\n\t\t", "\n\t\
|
|
22
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t.", " > div {\n\t\tdisplay: flex;\n\t}\n\n\t.", " {\n\t\t", "\n\t\t", "\n\n\t\tcursor: pointer;\n\t\tbox-sizing: border-box;\n\n\t\ttd > & {\n\t\t\tmargin-top: 0;\n\t\t}\n\n\t\t.", " svg {\n\t\t\t", ";\n\t\t\ttransform: rotate(90deg);\n\t\t}\n\n\t\t&.", ":not(.danger) {\n\t\t\t", "\n\t\t}\n\n\t\t&.danger {\n\t\t\tbackground: ", ";\n\t\t\tborder-color: ", ";\n\t\t}\n\t}\n\n\t.ProseMirror\n\t\t> .", ",\n\t\t.", "\n\t\t> .", " {\n\t\tmargin-left: -", "px;\n\t\tmargin-right: -", "px;\n\t}\n\n\t.", " {\n\t\t", "\n\t\tcursor: text;\n\t\tpadding-top: 0px;\n\t\t", "\n\t}\n\n\t.", " {\n\t\t", "\n\t}\n\n\t.", " {\n\t\t", ";\n\t\talign-items: center;\n\t\toverflow: visible;\n\t}\n\n\t.", " {\n\t\tbackground: ", ";\n\t\tborder-color: ", ";\n\n\t\t.", " {\n\t\t\tpadding-top: ", ";\n\t\t}\n\t}\n\n\t.", " {\n\t\twidth: 100%;\n\t}\n\n\t/* stylelint-disable property-no-unknown, value-keyword-case */\n\t.", ":(.", ") {\n\t\t.expand-content-wrapper {\n\t\t\theight: auto;\n\t\t}\n\t}\n\t/* stylelint-enable property-no-unknown, value-keyword-case */\n\n\t.", ":not(.", ") {\n\t\t.ak-editor-expand__content {\n\t\t\tposition: absolute;\n\t\t\theight: 1px;\n\t\t\twidth: 1px;\n\t\t\toverflow: hidden;\n\t\t\tclip: rect(1px, 1px, 1px, 1px);\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t.", " svg {\n\t\t\t", ";\n\t\t\ttransform: rotate(0deg);\n\t\t}\n\n\t\t&:not(.", "):not(.danger) {\n\t\t\tbackground: transparent;\n\t\t\tborder-color: transparent;\n\n\t\t\t&:hover {\n\t\t\t\tborder-color: ", ";\n\t\t\t\tbackground: ", ";\n\t\t\t}\n\t\t}\n\t}\n"])), expandClassNames.icon, expandClassNames.prefix, sharedExpandStyles.containerStyles({
|
|
22
23
|
expanded: false,
|
|
23
24
|
focused: false
|
|
24
|
-
})(), expandClassNames.iconContainer, EXPAND_ICON_COLOR(), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.Border]), DANGER_STATE_BACKGROUND_COLOR, DANGER_STATE_BORDER_COLOR, expandClassNames.type('expand'), BreakoutCssClassName.BREAKOUT_MARK_DOM, expandClassNames.type('expand'), akLayoutGutterOffset, akLayoutGutterOffset, expandClassNames.content, sharedExpandStyles.contentStyles({
|
|
25
|
+
})(), !fg('platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2') && "overflow: hidden;", expandClassNames.iconContainer, EXPAND_ICON_COLOR(), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.Border]), DANGER_STATE_BACKGROUND_COLOR, DANGER_STATE_BORDER_COLOR, expandClassNames.type('expand'), BreakoutCssClassName.BREAKOUT_MARK_DOM, expandClassNames.type('expand'), akLayoutGutterOffset, akLayoutGutterOffset, expandClassNames.content, sharedExpandStyles.contentStyles({
|
|
25
26
|
expanded: false,
|
|
26
27
|
focused: false
|
|
27
|
-
})(), expandClassNames.titleInput, sharedExpandStyles.titleInputStyles(), expandClassNames.titleContainer, sharedExpandStyles.titleContainerStyles(), expandClassNames.expanded, EXPAND_SELECTED_BACKGROUND, "var(--ds-border, ".concat(N40A, ")"), expandClassNames.content, "var(--ds-space-100, 8px)", expandClassNames.inputContainer, expandClassNames.prefix, expandClassNames.expanded, expandClassNames.prefix, expandClassNames.expanded, expandClassNames.iconContainer, EXPAND_ICON_COLOR(), akEditorSelectedNodeClassName, "var(--ds-border, ".concat(N50A, ")"), EXPAND_SELECTED_BACKGROUND);
|
|
28
|
+
})(), fg('platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2') && "overflow-x: clip;", expandClassNames.titleInput, sharedExpandStyles.titleInputStyles(), expandClassNames.titleContainer, sharedExpandStyles.titleContainerStyles(), expandClassNames.expanded, EXPAND_SELECTED_BACKGROUND, "var(--ds-border, ".concat(N40A, ")"), expandClassNames.content, "var(--ds-space-100, 8px)", expandClassNames.inputContainer, expandClassNames.prefix, expandClassNames.expanded, expandClassNames.prefix, expandClassNames.expanded, expandClassNames.iconContainer, EXPAND_ICON_COLOR(), akEditorSelectedNodeClassName, "var(--ds-border, ".concat(N50A, ")"), EXPAND_SELECTED_BACKGROUND);
|
|
28
29
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "194.0.
|
|
2
|
+
export var version = "194.0.4";
|
|
@@ -979,6 +979,7 @@ export declare function createPreset(props: EditorProps, prevProps?: EditorProps
|
|
|
979
979
|
};
|
|
980
980
|
commands: {
|
|
981
981
|
removeStatus: (showStatusPickerAt: number) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
982
|
+
insertStatus: (inputMethod?: import("@atlaskit/editor-common/analytics").INPUT_METHOD.INSERT_MENU | import("@atlaskit/editor-common/analytics").INPUT_METHOD.QUICK_INSERT | import("@atlaskit/editor-common/analytics").INPUT_METHOD.TOOLBAR | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
982
983
|
};
|
|
983
984
|
sharedState: import("@atlaskit/editor-plugin-status").StatusState | undefined;
|
|
984
985
|
}, import("@atlaskit/editor-plugin-status").StatusPluginOptions | undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"customAutoformat", {}, undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"card", {
|
|
@@ -996,6 +996,7 @@ export default function createUniversalPreset(appearance: EditorAppearance | und
|
|
|
996
996
|
};
|
|
997
997
|
commands: {
|
|
998
998
|
removeStatus: (showStatusPickerAt: number) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
999
|
+
insertStatus: (inputMethod?: import("@atlaskit/editor-common/analytics").INPUT_METHOD.INSERT_MENU | import("@atlaskit/editor-common/analytics").INPUT_METHOD.QUICK_INSERT | import("@atlaskit/editor-common/analytics").INPUT_METHOD.TOOLBAR | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
999
1000
|
};
|
|
1000
1001
|
sharedState: import("@atlaskit/editor-plugins/status").StatusState | undefined;
|
|
1001
1002
|
}, import("@atlaskit/editor-plugins/status").StatusPluginOptions | undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"customAutoformat", {}, undefined> | undefined, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"card", {
|
|
@@ -982,6 +982,7 @@ export default function useUniversalPreset({ props }: PresetProps): import("@atl
|
|
|
982
982
|
};
|
|
983
983
|
commands: {
|
|
984
984
|
removeStatus: (showStatusPickerAt: number) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
985
|
+
insertStatus: (inputMethod?: import("@atlaskit/editor-common/analytics").INPUT_METHOD.INSERT_MENU | import("@atlaskit/editor-common/analytics").INPUT_METHOD.QUICK_INSERT | import("@atlaskit/editor-common/analytics").INPUT_METHOD.TOOLBAR | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
985
986
|
};
|
|
986
987
|
sharedState: import("@atlaskit/editor-plugin-status").StatusState | undefined;
|
|
987
988
|
}, import("@atlaskit/editor-plugin-status").StatusPluginOptions | undefined> | undefined, import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"customAutoformat", {}, undefined> | undefined, import("@atlaskit/editor-plugin-clear-marks-on-empty-doc").ClearMarksOnEmptyDocPlugin<"card", {
|
|
@@ -149,10 +149,6 @@ export interface EditorSharedPropsWithPlugins {
|
|
|
149
149
|
collabEdit?: CollabEditOptions;
|
|
150
150
|
primaryToolbarComponents?: PrimaryToolbarComponents;
|
|
151
151
|
allowUndoRedoButtons?: boolean;
|
|
152
|
-
/**
|
|
153
|
-
* Configure and extend editor linking behaviour
|
|
154
|
-
*/
|
|
155
|
-
linking?: LinkingOptions;
|
|
156
152
|
hideAvatarGroup?: boolean;
|
|
157
153
|
}
|
|
158
154
|
export interface EditorProps extends EditorBaseProps, EditorPluginFeatureProps, EditorSharedPropsWithPlugins, EditorProviderProps {
|
|
@@ -181,6 +177,16 @@ export interface EditorNextProps extends EditorBaseProps, EditorSharedPropsWithP
|
|
|
181
177
|
* Configuration of this parameter should be done via `editor-plugin-placeholder` or the `default` preset.
|
|
182
178
|
*/
|
|
183
179
|
placeholderBracketHint?: string;
|
|
180
|
+
/**
|
|
181
|
+
* @deprecated
|
|
182
|
+
* This prop does nothing and will be removed soon.
|
|
183
|
+
* Configuration of this parameter should be done via `editor-plugin-card` or the `universal` preset.
|
|
184
|
+
*
|
|
185
|
+
* Example:
|
|
186
|
+
* // In preset creation you can pass the props passed to the editor like this:
|
|
187
|
+
* preset.add([cardPlugin, { ...linking.smartLinks, linkPicker: linking.linkPicker }])
|
|
188
|
+
*/
|
|
189
|
+
linking?: LinkingOptions;
|
|
184
190
|
}
|
|
185
191
|
export interface EditorProviderProps {
|
|
186
192
|
activityProvider?: Promise<ActivityProvider>;
|
|
@@ -285,4 +291,8 @@ export interface EditorPluginFeatureProps {
|
|
|
285
291
|
textFormatting?: TextFormattingOptions;
|
|
286
292
|
placeholder?: string;
|
|
287
293
|
placeholderBracketHint?: string;
|
|
294
|
+
/**
|
|
295
|
+
* Configure and extend editor linking behaviour
|
|
296
|
+
*/
|
|
297
|
+
linking?: LinkingOptions;
|
|
288
298
|
}
|
|
@@ -1277,6 +1277,7 @@ export declare function createPreset(props: EditorProps, prevProps?: EditorProps
|
|
|
1277
1277
|
};
|
|
1278
1278
|
commands: {
|
|
1279
1279
|
removeStatus: (showStatusPickerAt: number) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
1280
|
+
insertStatus: (inputMethod?: import("@atlaskit/editor-common/analytics").INPUT_METHOD.INSERT_MENU | import("@atlaskit/editor-common/analytics").INPUT_METHOD.QUICK_INSERT | import("@atlaskit/editor-common/analytics").INPUT_METHOD.TOOLBAR | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
1280
1281
|
};
|
|
1281
1282
|
sharedState: import("@atlaskit/editor-plugin-status").StatusState | undefined;
|
|
1282
1283
|
}, import("@atlaskit/editor-plugin-status").StatusPluginOptions | undefined> | undefined,
|
|
@@ -1294,6 +1294,7 @@ export default function createUniversalPreset(appearance: EditorAppearance | und
|
|
|
1294
1294
|
};
|
|
1295
1295
|
commands: {
|
|
1296
1296
|
removeStatus: (showStatusPickerAt: number) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
1297
|
+
insertStatus: (inputMethod?: import("@atlaskit/editor-common/analytics").INPUT_METHOD.INSERT_MENU | import("@atlaskit/editor-common/analytics").INPUT_METHOD.QUICK_INSERT | import("@atlaskit/editor-common/analytics").INPUT_METHOD.TOOLBAR | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
1297
1298
|
};
|
|
1298
1299
|
sharedState: import("@atlaskit/editor-plugins/status").StatusState | undefined;
|
|
1299
1300
|
}, import("@atlaskit/editor-plugins/status").StatusPluginOptions | undefined> | undefined,
|
|
@@ -1280,6 +1280,7 @@ export default function useUniversalPreset({ props }: PresetProps): import("@atl
|
|
|
1280
1280
|
};
|
|
1281
1281
|
commands: {
|
|
1282
1282
|
removeStatus: (showStatusPickerAt: number) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
1283
|
+
insertStatus: (inputMethod?: import("@atlaskit/editor-common/analytics").INPUT_METHOD.INSERT_MENU | import("@atlaskit/editor-common/analytics").INPUT_METHOD.QUICK_INSERT | import("@atlaskit/editor-common/analytics").INPUT_METHOD.TOOLBAR | undefined) => import("@atlaskit/editor-common/types").EditorCommand;
|
|
1283
1284
|
};
|
|
1284
1285
|
sharedState: import("@atlaskit/editor-plugin-status").StatusState | undefined;
|
|
1285
1286
|
}, import("@atlaskit/editor-plugin-status").StatusPluginOptions | undefined> | undefined,
|
|
@@ -149,10 +149,6 @@ export interface EditorSharedPropsWithPlugins {
|
|
|
149
149
|
collabEdit?: CollabEditOptions;
|
|
150
150
|
primaryToolbarComponents?: PrimaryToolbarComponents;
|
|
151
151
|
allowUndoRedoButtons?: boolean;
|
|
152
|
-
/**
|
|
153
|
-
* Configure and extend editor linking behaviour
|
|
154
|
-
*/
|
|
155
|
-
linking?: LinkingOptions;
|
|
156
152
|
hideAvatarGroup?: boolean;
|
|
157
153
|
}
|
|
158
154
|
export interface EditorProps extends EditorBaseProps, EditorPluginFeatureProps, EditorSharedPropsWithPlugins, EditorProviderProps {
|
|
@@ -181,6 +177,16 @@ export interface EditorNextProps extends EditorBaseProps, EditorSharedPropsWithP
|
|
|
181
177
|
* Configuration of this parameter should be done via `editor-plugin-placeholder` or the `default` preset.
|
|
182
178
|
*/
|
|
183
179
|
placeholderBracketHint?: string;
|
|
180
|
+
/**
|
|
181
|
+
* @deprecated
|
|
182
|
+
* This prop does nothing and will be removed soon.
|
|
183
|
+
* Configuration of this parameter should be done via `editor-plugin-card` or the `universal` preset.
|
|
184
|
+
*
|
|
185
|
+
* Example:
|
|
186
|
+
* // In preset creation you can pass the props passed to the editor like this:
|
|
187
|
+
* preset.add([cardPlugin, { ...linking.smartLinks, linkPicker: linking.linkPicker }])
|
|
188
|
+
*/
|
|
189
|
+
linking?: LinkingOptions;
|
|
184
190
|
}
|
|
185
191
|
export interface EditorProviderProps {
|
|
186
192
|
activityProvider?: Promise<ActivityProvider>;
|
|
@@ -285,4 +291,8 @@ export interface EditorPluginFeatureProps {
|
|
|
285
291
|
textFormatting?: TextFormattingOptions;
|
|
286
292
|
placeholder?: string;
|
|
287
293
|
placeholderBracketHint?: string;
|
|
294
|
+
/**
|
|
295
|
+
* Configure and extend editor linking behaviour
|
|
296
|
+
*/
|
|
297
|
+
linking?: LinkingOptions;
|
|
288
298
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "194.0.
|
|
3
|
+
"version": "194.0.4",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -217,9 +217,6 @@
|
|
|
217
217
|
"platform.editor.media.preview-in-full-page": {
|
|
218
218
|
"type": "boolean"
|
|
219
219
|
},
|
|
220
|
-
"platform.editor.media.alluploadsfinished-dispatch-update_ivtow": {
|
|
221
|
-
"type": "boolean"
|
|
222
|
-
},
|
|
223
220
|
"platform.editor.inline_extension.extended_lcqdn": {
|
|
224
221
|
"type": "boolean",
|
|
225
222
|
"referenceOnly": "true"
|
|
@@ -347,8 +344,7 @@
|
|
|
347
344
|
"type": "boolean"
|
|
348
345
|
},
|
|
349
346
|
"platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2": {
|
|
350
|
-
"type": "boolean"
|
|
351
|
-
"referenceOnly": "true"
|
|
347
|
+
"type": "boolean"
|
|
352
348
|
},
|
|
353
349
|
"platform_editor_tables_padding_increase": {
|
|
354
350
|
"type": "boolean",
|
|
@@ -365,6 +361,10 @@
|
|
|
365
361
|
"platform.editor.linking-preferences-url-atlassian-context": {
|
|
366
362
|
"type": "boolean",
|
|
367
363
|
"referenceOnly": true
|
|
364
|
+
},
|
|
365
|
+
"platform_editor_get_card_provider_from_config": {
|
|
366
|
+
"type": "boolean",
|
|
367
|
+
"referenceOnly": true
|
|
368
368
|
}
|
|
369
369
|
},
|
|
370
370
|
"stricter": {
|