@atlaskit/editor-core 187.39.0 → 187.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/cjs/create-editor/feature-flags-from-props.js +5 -6
- package/dist/cjs/keymaps/index.js +6 -0
- package/dist/cjs/labs/next/presets/universal.js +1 -6
- package/dist/cjs/plugins/floating-toolbar/index.js +1 -1
- package/dist/cjs/plugins/floating-toolbar/ui/ScrollButtons.js +3 -1
- package/dist/cjs/plugins/help-dialog/ui/index.js +16 -0
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +24 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/feature-flags-from-props.js +5 -6
- package/dist/es2019/keymaps/index.js +1 -1
- package/dist/es2019/labs/next/presets/universal.js +1 -6
- package/dist/es2019/plugins/floating-toolbar/index.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/ui/ScrollButtons.js +3 -1
- package/dist/es2019/plugins/help-dialog/ui/index.js +15 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +29 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/feature-flags-from-props.js +5 -6
- package/dist/esm/keymaps/index.js +1 -1
- package/dist/esm/labs/next/presets/universal.js +1 -6
- package/dist/esm/plugins/floating-toolbar/index.js +1 -1
- package/dist/esm/plugins/floating-toolbar/ui/ScrollButtons.js +3 -1
- package/dist/esm/plugins/help-dialog/ui/index.js +17 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +24 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/keymaps/index.d.ts +1 -1
- package/dist/types-ts4.5/keymaps/index.d.ts +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 187.40.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`705d8ec0641`](https://bitbucket.org/atlassian/atlassian-frontend/commits/705d8ec0641) - [ux] Added a new shortcut (⌘ + Opt + ⏎) for Check/Uncheck Action item
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 187.39.4
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`dca155209d9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dca155209d9) - ED-15094 Feature flag clean up for copy button
|
|
18
|
+
|
|
3
19
|
## 187.39.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -32,7 +32,7 @@ function getSpellCheck(featureFlags) {
|
|
|
32
32
|
* which is used by both current and archv3 editors.
|
|
33
33
|
*/
|
|
34
34
|
function createFeatureFlagsFromProps(props) {
|
|
35
|
-
var _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$collabEdit, _props$collabEdit2, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29
|
|
35
|
+
var _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$collabEdit, _props$collabEdit2, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29;
|
|
36
36
|
var normalizedFeatureFlags = (0, _normalizeFeatureFlags.normalizeFeatureFlags)(props.featureFlags);
|
|
37
37
|
return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
|
|
38
38
|
newInsertionBehaviour: props.allowNewInsertionBehaviour,
|
|
@@ -58,14 +58,13 @@ function createFeatureFlagsFromProps(props) {
|
|
|
58
58
|
chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags19 = props.featureFlags) === null || _props$featureFlags19 === void 0 ? void 0 : _props$featureFlags19.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
|
|
59
59
|
showHoverPreview: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.showHoverPreview) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.showHoverPreview) : false),
|
|
60
60
|
indentationButtonsInTheToolbar: typeof props.showIndentationButtons === 'boolean' ? props.showIndentationButtons : Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.indentationButtonsInTheToolbar) : false)),
|
|
61
|
-
|
|
62
|
-
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
61
|
+
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
63
62
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
|
|
64
63
|
// Including fallback to props.featureFlags so that mobile feature flags
|
|
65
64
|
// are included (they are not kebab cased)
|
|
66
|
-
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$
|
|
67
|
-
useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$
|
|
65
|
+
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags25 = props.featureFlags) === null || _props$featureFlags25 === void 0 ? void 0 : _props$featureFlags25.restartNumberedLists) === true,
|
|
66
|
+
useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.useSomewhatSemanticTextColorNames) : false)),
|
|
68
67
|
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
69
|
-
preventPopupOverflow: Boolean(typeof ((_props$
|
|
68
|
+
preventPopupOverflow: Boolean(typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29['prevent-popup-overflow']) : false)
|
|
70
69
|
});
|
|
71
70
|
}
|
|
@@ -495,6 +495,12 @@ Object.defineProperty(exports, "toggleTable", {
|
|
|
495
495
|
return _keymaps.toggleTable;
|
|
496
496
|
}
|
|
497
497
|
});
|
|
498
|
+
Object.defineProperty(exports, "toggleTaskItemCheckbox", {
|
|
499
|
+
enumerable: true,
|
|
500
|
+
get: function get() {
|
|
501
|
+
return _keymaps.toggleTaskItemCheckbox;
|
|
502
|
+
}
|
|
503
|
+
});
|
|
498
504
|
Object.defineProperty(exports, "toggleUnderline", {
|
|
499
505
|
enumerable: true,
|
|
500
506
|
get: function get() {
|
|
@@ -395,11 +395,6 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
395
395
|
return builder;
|
|
396
396
|
}).add([_plugins.codeBidiWarningPlugin, {
|
|
397
397
|
appearance: appearance
|
|
398
|
-
}]).
|
|
399
|
-
if (featureFlags.floatingToolbarCopyButton) {
|
|
400
|
-
return builder.add(plugin);
|
|
401
|
-
}
|
|
402
|
-
return builder;
|
|
403
|
-
});
|
|
398
|
+
}]).add(_plugins.copyButtonPlugin);
|
|
404
399
|
return finalPreset;
|
|
405
400
|
}
|
|
@@ -244,7 +244,7 @@ function ContentComponent(_ref5) {
|
|
|
244
244
|
var _ref7 = floatingToolbarData || {},
|
|
245
245
|
confirmDialogForItem = _ref7.confirmDialogForItem;
|
|
246
246
|
var confirmButtonItem = confirmDialogForItem ? toolbarItems[confirmDialogForItem] : undefined;
|
|
247
|
-
var scrollable =
|
|
247
|
+
var scrollable = config.scrollable;
|
|
248
248
|
var confirmDialogOptions = typeof (confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog) === 'function' ? confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog() : confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog;
|
|
249
249
|
return /*#__PURE__*/_react.default.createElement(_ErrorBoundary.ErrorBoundary, {
|
|
250
250
|
component: _analytics.ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN,
|
|
@@ -120,8 +120,10 @@ var ScrollButtons = function ScrollButtons(_ref) {
|
|
|
120
120
|
(0, _react.useEffect)(function () {
|
|
121
121
|
var scrollContainerRefCurrent = scrollContainerRef.current;
|
|
122
122
|
if (scrollContainerRefCurrent) {
|
|
123
|
+
var _scrollContainerRefCu;
|
|
123
124
|
// reset scroll position when switching from one node with toolbar to another
|
|
124
|
-
|
|
125
|
+
// scroll to made optional as it may not be rendered in testing env
|
|
126
|
+
(_scrollContainerRefCu = scrollContainerRefCurrent.scrollTo) === null || _scrollContainerRefCu === void 0 ? void 0 : _scrollContainerRefCu.call(scrollContainerRefCurrent, {
|
|
125
127
|
left: 0
|
|
126
128
|
});
|
|
127
129
|
}
|
|
@@ -55,6 +55,11 @@ var messages = (0, _reactIntlNext.defineMessages)({
|
|
|
55
55
|
defaultMessage: 'Paste plain text',
|
|
56
56
|
description: ''
|
|
57
57
|
},
|
|
58
|
+
CheckUncheckActionItem: {
|
|
59
|
+
id: 'fabric.editor.checkUncheckActionItem',
|
|
60
|
+
defaultMessage: 'Toggle action item',
|
|
61
|
+
description: 'For Check/Uncheck Action item use shortcut'
|
|
62
|
+
},
|
|
58
63
|
altText: {
|
|
59
64
|
id: 'fabric.editor.altText',
|
|
60
65
|
defaultMessage: 'Alt text',
|
|
@@ -386,6 +391,12 @@ var otherFormatting = function otherFormatting(_ref3) {
|
|
|
386
391
|
keymap: function keymap() {
|
|
387
392
|
return _keymaps.addInlineComment;
|
|
388
393
|
}
|
|
394
|
+
}, {
|
|
395
|
+
name: formatMessage(messages.CheckUncheckActionItem),
|
|
396
|
+
type: 'checkbox',
|
|
397
|
+
keymap: function keymap() {
|
|
398
|
+
return _keymaps.toggleTaskItemCheckbox;
|
|
399
|
+
}
|
|
389
400
|
}];
|
|
390
401
|
};
|
|
391
402
|
var imageAutoFormat = {
|
|
@@ -445,6 +456,11 @@ var getComponentFromKeymap = function getComponentFromKeymap(keymap) {
|
|
|
445
456
|
css: _styles.codeLg,
|
|
446
457
|
key: "".concat(keyParts, "-").concat(index)
|
|
447
458
|
}, part);
|
|
459
|
+
} else if (part.toLowerCase() === 'enter') {
|
|
460
|
+
return (0, _react2.jsx)("span", {
|
|
461
|
+
css: _styles.codeSm,
|
|
462
|
+
key: "".concat(keyParts, "-").concat(index)
|
|
463
|
+
}, '⏎');
|
|
448
464
|
}
|
|
449
465
|
return (0, _react2.jsx)("span", {
|
|
450
466
|
css: _styles.codeSm,
|
|
@@ -11,6 +11,7 @@ var _commands = require("@atlaskit/editor-prosemirror/commands");
|
|
|
11
11
|
var _keymap = require("@atlaskit/editor-prosemirror/keymap");
|
|
12
12
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
13
13
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
|
+
var _steps = require("@atlaskit/adf-schema/steps");
|
|
14
15
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
15
16
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
16
17
|
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
@@ -19,6 +20,7 @@ var _commands2 = require("../commands");
|
|
|
19
20
|
var _commands3 = require("./commands");
|
|
20
21
|
var _helpers = require("./helpers");
|
|
21
22
|
var _utils3 = require("../utils");
|
|
23
|
+
var _keymaps = require("../../../keymaps");
|
|
22
24
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23
25
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24
26
|
var indentationAnalytics = function indentationAnalytics(curIndentLevel, direction, inputMethod) {
|
|
@@ -314,6 +316,26 @@ var enter = (0, _utils2.filterCommand)(_helpers.isInsideTaskOrDecisionItem, (0,
|
|
|
314
316
|
}
|
|
315
317
|
return true;
|
|
316
318
|
}));
|
|
319
|
+
var cmdOptEnter = (0, _utils2.filterCommand)(_helpers.isInsideTaskOrDecisionItem, function (state, dispatch) {
|
|
320
|
+
var selection = state.selection,
|
|
321
|
+
schema = state.schema;
|
|
322
|
+
var taskItem = schema.nodes.taskItem;
|
|
323
|
+
var $from = selection.$from;
|
|
324
|
+
var node = $from.node($from.depth);
|
|
325
|
+
var nodeType = node && node.type;
|
|
326
|
+
var nodePos = $from.before($from.depth);
|
|
327
|
+
if (nodeType === taskItem) {
|
|
328
|
+
var tr = state.tr;
|
|
329
|
+
tr.step(new _steps.SetAttrsStep(nodePos, {
|
|
330
|
+
state: node.attrs.state === 'TODO' ? 'DONE' : 'TODO',
|
|
331
|
+
localId: node.attrs.localId
|
|
332
|
+
}));
|
|
333
|
+
if (tr && dispatch) {
|
|
334
|
+
dispatch(tr);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return true;
|
|
338
|
+
});
|
|
317
339
|
function keymapPlugin(schema, allowNestedTasks, consumeTabs) {
|
|
318
340
|
var indentHandlers = {
|
|
319
341
|
'Shift-Tab': (0, _utils2.filterCommand)([_helpers.isInsideTaskOrDecisionItem, function (state) {
|
|
@@ -331,12 +353,12 @@ function keymapPlugin(schema, allowNestedTasks, consumeTabs) {
|
|
|
331
353
|
'Shift-Tab': _helpers.isInsideTaskOrDecisionItem,
|
|
332
354
|
Tab: _helpers.isInsideTaskOrDecisionItem
|
|
333
355
|
} : {};
|
|
334
|
-
var keymaps = _objectSpread({
|
|
356
|
+
var keymaps = _objectSpread((0, _defineProperty2.default)({
|
|
335
357
|
Backspace: backspace,
|
|
336
358
|
Delete: deleteForwards,
|
|
337
359
|
'Ctrl-d': deleteForwards,
|
|
338
360
|
Enter: enter
|
|
339
|
-
}, allowNestedTasks ? indentHandlers : defaultHandlers);
|
|
361
|
+
}, _keymaps.toggleTaskItemCheckbox.common, cmdOptEnter), allowNestedTasks ? indentHandlers : defaultHandlers);
|
|
340
362
|
return (0, _keymap.keymap)(keymaps);
|
|
341
363
|
}
|
|
342
364
|
var _default = keymapPlugin;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "187.
|
|
9
|
+
var version = "187.40.0";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
@@ -21,7 +21,7 @@ function getSpellCheck(featureFlags) {
|
|
|
21
21
|
* which is used by both current and archv3 editors.
|
|
22
22
|
*/
|
|
23
23
|
export function createFeatureFlagsFromProps(props) {
|
|
24
|
-
var _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$collabEdit, _props$collabEdit2, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29
|
|
24
|
+
var _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$collabEdit, _props$collabEdit2, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29;
|
|
25
25
|
const normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
26
26
|
return {
|
|
27
27
|
...normalizedFeatureFlags,
|
|
@@ -48,14 +48,13 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
48
48
|
chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags19 = props.featureFlags) === null || _props$featureFlags19 === void 0 ? void 0 : _props$featureFlags19.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
|
|
49
49
|
showHoverPreview: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.showHoverPreview) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.showHoverPreview) : false),
|
|
50
50
|
indentationButtonsInTheToolbar: typeof props.showIndentationButtons === 'boolean' ? props.showIndentationButtons : Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.indentationButtonsInTheToolbar) : false)),
|
|
51
|
-
|
|
52
|
-
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
51
|
+
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
53
52
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
|
|
54
53
|
// Including fallback to props.featureFlags so that mobile feature flags
|
|
55
54
|
// are included (they are not kebab cased)
|
|
56
|
-
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$
|
|
57
|
-
useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$
|
|
55
|
+
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags25 = props.featureFlags) === null || _props$featureFlags25 === void 0 ? void 0 : _props$featureFlags25.restartNumberedLists) === true,
|
|
56
|
+
useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.useSomewhatSemanticTextColorNames) : false)),
|
|
58
57
|
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
59
|
-
preventPopupOverflow: Boolean(typeof ((_props$
|
|
58
|
+
preventPopupOverflow: Boolean(typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29['prevent-popup-overflow']) : false)
|
|
60
59
|
};
|
|
61
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { addAltText, navToEditorToolbar, navToFloatingToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, pastePlainText, clearFormatting, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, ctrlBackSpace, toggleBulletList, toggleBlockQuote, insertNewLine, shiftBackspace, splitCodeBlock, splitListItem, insertRule, undo, moveUp, moveDown, moveLeft, moveRight, indentList, outdentList, redo, openHelp, addLink, addInlineComment, submit, enter, shiftEnter, tab, indent, outdent, backspace, deleteKey, forwardDelete, space, escape, nextCell, previousCell, shiftTab, toggleTable, addRowBefore, addRowAfter, addColumnAfter, addColumnBefore, cut, copy, paste, altPaste, find, alignLeft, tooltip, ToolTipContent, findKeymapByDescription, findShortcutByDescription, findShortcutByKeymap, makeKeymap, makeKeyMapWithCommon, bindKeymapWithCommand, findKeyMapForBrowser, DOWN, HEADING_KEYS, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, LEFT, RIGHT, UP } from '@atlaskit/editor-common/keymaps';
|
|
1
|
+
export { addAltText, navToEditorToolbar, navToFloatingToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, pastePlainText, clearFormatting, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, toggleTaskItemCheckbox, ctrlBackSpace, toggleBulletList, toggleBlockQuote, insertNewLine, shiftBackspace, splitCodeBlock, splitListItem, insertRule, undo, moveUp, moveDown, moveLeft, moveRight, indentList, outdentList, redo, openHelp, addLink, addInlineComment, submit, enter, shiftEnter, tab, indent, outdent, backspace, deleteKey, forwardDelete, space, escape, nextCell, previousCell, shiftTab, toggleTable, addRowBefore, addRowAfter, addColumnAfter, addColumnBefore, cut, copy, paste, altPaste, find, alignLeft, tooltip, ToolTipContent, findKeymapByDescription, findShortcutByDescription, findShortcutByKeymap, makeKeymap, makeKeyMapWithCommon, bindKeymapWithCommand, findKeyMapForBrowser, DOWN, HEADING_KEYS, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, LEFT, RIGHT, UP } from '@atlaskit/editor-common/keymaps';
|
|
@@ -392,11 +392,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
392
392
|
return builder;
|
|
393
393
|
}).add([codeBidiWarningPlugin, {
|
|
394
394
|
appearance
|
|
395
|
-
}]).
|
|
396
|
-
if (featureFlags.floatingToolbarCopyButton) {
|
|
397
|
-
return builder.add(plugin);
|
|
398
|
-
}
|
|
399
|
-
return builder;
|
|
400
|
-
});
|
|
395
|
+
}]).add(copyButtonPlugin);
|
|
401
396
|
return finalPreset;
|
|
402
397
|
}
|
|
@@ -232,7 +232,7 @@ function ContentComponent({
|
|
|
232
232
|
confirmDialogForItem
|
|
233
233
|
} = floatingToolbarData || {};
|
|
234
234
|
const confirmButtonItem = confirmDialogForItem ? toolbarItems[confirmDialogForItem] : undefined;
|
|
235
|
-
const scrollable =
|
|
235
|
+
const scrollable = config.scrollable;
|
|
236
236
|
const confirmDialogOptions = typeof (confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog) === 'function' ? confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog() : confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog;
|
|
237
237
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
238
238
|
component: ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN,
|
|
@@ -106,8 +106,10 @@ export const ScrollButtons = ({
|
|
|
106
106
|
useEffect(() => {
|
|
107
107
|
const scrollContainerRefCurrent = scrollContainerRef.current;
|
|
108
108
|
if (scrollContainerRefCurrent) {
|
|
109
|
+
var _scrollContainerRefCu;
|
|
109
110
|
// reset scroll position when switching from one node with toolbar to another
|
|
110
|
-
|
|
111
|
+
// scroll to made optional as it may not be rendered in testing env
|
|
112
|
+
(_scrollContainerRefCu = scrollContainerRefCurrent.scrollTo) === null || _scrollContainerRefCu === void 0 ? void 0 : _scrollContainerRefCu.call(scrollContainerRefCurrent, {
|
|
111
113
|
left: 0
|
|
112
114
|
});
|
|
113
115
|
}
|
|
@@ -7,7 +7,7 @@ import { browser } from '@atlaskit/editor-common/utils';
|
|
|
7
7
|
import CrossIcon from '@atlaskit/icon/glyph/cross';
|
|
8
8
|
import AkModalDialog, { ModalTransition, useModal } from '@atlaskit/modal-dialog';
|
|
9
9
|
import { header, footer, contentWrapper, line, content, row, codeSm, codeMd, codeLg, title, column, dialogHeader } from './styles';
|
|
10
|
-
import { navToFloatingToolbar, navToEditorToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, insertRule, addLink, setNormalText, alignLeft, clearFormatting, undo, redo, pastePlainText, addInlineComment, toggleCode, openHelp, toggleBulletList, toggleBlockQuote } from '@atlaskit/editor-common/keymaps';
|
|
10
|
+
import { navToFloatingToolbar, navToEditorToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, insertRule, addLink, setNormalText, alignLeft, clearFormatting, undo, redo, pastePlainText, addInlineComment, toggleTaskItemCheckbox, toggleCode, openHelp, toggleBulletList, toggleBlockQuote } from '@atlaskit/editor-common/keymaps';
|
|
11
11
|
import ToolbarButton from '../../../ui/ToolbarButton';
|
|
12
12
|
import { toolbarMessages, listMessages } from '@atlaskit/editor-common/messages';
|
|
13
13
|
import { messages as insertBlockMessages } from '../../insert-block/ui/ToolbarInsertBlock/messages';
|
|
@@ -43,6 +43,11 @@ const messages = defineMessages({
|
|
|
43
43
|
defaultMessage: 'Paste plain text',
|
|
44
44
|
description: ''
|
|
45
45
|
},
|
|
46
|
+
CheckUncheckActionItem: {
|
|
47
|
+
id: 'fabric.editor.checkUncheckActionItem',
|
|
48
|
+
defaultMessage: 'Toggle action item',
|
|
49
|
+
description: 'For Check/Uncheck Action item use shortcut'
|
|
50
|
+
},
|
|
46
51
|
altText: {
|
|
47
52
|
id: 'fabric.editor.altText',
|
|
48
53
|
defaultMessage: 'Alt text',
|
|
@@ -277,6 +282,10 @@ const otherFormatting = ({
|
|
|
277
282
|
name: formatMessage(annotationMessages.createComment),
|
|
278
283
|
type: 'annotation',
|
|
279
284
|
keymap: () => addInlineComment
|
|
285
|
+
}, {
|
|
286
|
+
name: formatMessage(messages.CheckUncheckActionItem),
|
|
287
|
+
type: 'checkbox',
|
|
288
|
+
keymap: () => toggleTaskItemCheckbox
|
|
280
289
|
}];
|
|
281
290
|
const imageAutoFormat = {
|
|
282
291
|
name: 'Image',
|
|
@@ -327,6 +336,11 @@ export const getComponentFromKeymap = keymap => {
|
|
|
327
336
|
css: codeLg,
|
|
328
337
|
key: `${keyParts}-${index}`
|
|
329
338
|
}, part);
|
|
339
|
+
} else if (part.toLowerCase() === 'enter') {
|
|
340
|
+
return jsx("span", {
|
|
341
|
+
css: codeSm,
|
|
342
|
+
key: `${keyParts}-${index}`
|
|
343
|
+
}, '⏎');
|
|
330
344
|
}
|
|
331
345
|
return jsx("span", {
|
|
332
346
|
css: codeSm,
|
|
@@ -2,6 +2,7 @@ import { autoJoin, chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
|
2
2
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
3
3
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
+
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
5
6
|
import { findParentNodeOfType, findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
6
7
|
import { uuid } from '@atlaskit/adf-schema';
|
|
7
8
|
import { filterCommand as filter, isEmptySelectionAtStart, isEmptySelectionAtEnd, deleteEmptyParagraphAndMoveBlockUp } from '@atlaskit/editor-common/utils';
|
|
@@ -10,6 +11,7 @@ import { insertTaskDecisionWithAnalytics } from '../commands';
|
|
|
10
11
|
import { joinAtCut, liftSelection, wrapSelectionInTaskList } from './commands';
|
|
11
12
|
import { getBlockRange, getCurrentIndentLevel, isActionOrDecisionItem, isActionOrDecisionList, isEmptyTaskDecision, isInsideTask, isInsideTaskOrDecisionItem, liftBlock, walkOut, getTaskItemIndex, isInsideDecision, isTable } from './helpers';
|
|
12
13
|
import { normalizeTaskItemsSelection } from '../utils';
|
|
14
|
+
import { toggleTaskItemCheckbox } from '../../../keymaps';
|
|
13
15
|
const indentationAnalytics = (curIndentLevel, direction, inputMethod) => ({
|
|
14
16
|
action: ACTION.FORMATTED,
|
|
15
17
|
actionSubject: ACTION_SUBJECT.TEXT,
|
|
@@ -312,6 +314,32 @@ const enter = filter(isInsideTaskOrDecisionItem, chainCommands(filter(isEmptyTas
|
|
|
312
314
|
}
|
|
313
315
|
return true;
|
|
314
316
|
}));
|
|
317
|
+
const cmdOptEnter = filter(isInsideTaskOrDecisionItem, (state, dispatch) => {
|
|
318
|
+
const {
|
|
319
|
+
selection,
|
|
320
|
+
schema
|
|
321
|
+
} = state;
|
|
322
|
+
const {
|
|
323
|
+
taskItem
|
|
324
|
+
} = schema.nodes;
|
|
325
|
+
const {
|
|
326
|
+
$from
|
|
327
|
+
} = selection;
|
|
328
|
+
const node = $from.node($from.depth);
|
|
329
|
+
const nodeType = node && node.type;
|
|
330
|
+
const nodePos = $from.before($from.depth);
|
|
331
|
+
if (nodeType === taskItem) {
|
|
332
|
+
const tr = state.tr;
|
|
333
|
+
tr.step(new SetAttrsStep(nodePos, {
|
|
334
|
+
state: node.attrs.state === 'TODO' ? 'DONE' : 'TODO',
|
|
335
|
+
localId: node.attrs.localId
|
|
336
|
+
}));
|
|
337
|
+
if (tr && dispatch) {
|
|
338
|
+
dispatch(tr);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return true;
|
|
342
|
+
});
|
|
315
343
|
export function keymapPlugin(schema, allowNestedTasks, consumeTabs) {
|
|
316
344
|
const indentHandlers = {
|
|
317
345
|
'Shift-Tab': filter([isInsideTaskOrDecisionItem, state => !shouldLetTabThroughInTable(state)], (state, dispatch) => getUnindentCommand(INPUT_METHOD.KEYBOARD)(state, dispatch) || !!consumeTabs),
|
|
@@ -326,6 +354,7 @@ export function keymapPlugin(schema, allowNestedTasks, consumeTabs) {
|
|
|
326
354
|
Delete: deleteForwards,
|
|
327
355
|
'Ctrl-d': deleteForwards,
|
|
328
356
|
Enter: enter,
|
|
357
|
+
[toggleTaskItemCheckbox.common]: cmdOptEnter,
|
|
329
358
|
...(allowNestedTasks ? indentHandlers : defaultHandlers)
|
|
330
359
|
};
|
|
331
360
|
return keymap(keymaps);
|
|
@@ -25,7 +25,7 @@ function getSpellCheck(featureFlags) {
|
|
|
25
25
|
* which is used by both current and archv3 editors.
|
|
26
26
|
*/
|
|
27
27
|
export function createFeatureFlagsFromProps(props) {
|
|
28
|
-
var _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$collabEdit, _props$collabEdit2, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29
|
|
28
|
+
var _props$allowLayouts, _props$performanceTra, _props$performanceTra2, _props$allowExtension, _props$featureFlags, _props$featureFlags2, _props$featureFlags3, _props$featureFlags4, _props$featureFlags5, _props$featureFlags6, _props$featureFlags7, _props$featureFlags8, _props$featureFlags9, _props$featureFlags10, _props$featureFlags11, _props$featureFlags12, _props$featureFlags13, _props$featureFlags14, _props$featureFlags15, _props$featureFlags16, _props$featureFlags17, _props$featureFlags18, _props$collabEdit, _props$collabEdit2, _props$featureFlags19, _props$featureFlags20, _props$featureFlags21, _props$featureFlags22, _props$featureFlags23, _props$featureFlags24, _props$featureFlags25, _props$featureFlags26, _props$featureFlags27, _props$featureFlags28, _props$featureFlags29;
|
|
29
29
|
var normalizedFeatureFlags = normalizeFeatureFlags(props.featureFlags);
|
|
30
30
|
return _objectSpread(_objectSpread({}, normalizedFeatureFlags), {}, {
|
|
31
31
|
newInsertionBehaviour: props.allowNewInsertionBehaviour,
|
|
@@ -51,14 +51,13 @@ export function createFeatureFlagsFromProps(props) {
|
|
|
51
51
|
chromeCursorHandlerFixedVersion: typeof ((_props$featureFlags19 = props.featureFlags) === null || _props$featureFlags19 === void 0 ? void 0 : _props$featureFlags19.chromeCursorHandlerFixedVersion) === 'string' ? Number(props.featureFlags.chromeCursorHandlerFixedVersion) || undefined : undefined,
|
|
52
52
|
showHoverPreview: Boolean(typeof ((_props$featureFlags20 = props.featureFlags) === null || _props$featureFlags20 === void 0 ? void 0 : _props$featureFlags20.showHoverPreview) === 'boolean' ? !!((_props$featureFlags21 = props.featureFlags) !== null && _props$featureFlags21 !== void 0 && _props$featureFlags21.showHoverPreview) : false),
|
|
53
53
|
indentationButtonsInTheToolbar: typeof props.showIndentationButtons === 'boolean' ? props.showIndentationButtons : Boolean(typeof normalizedFeatureFlags.indentationButtonsInTheToolbar === 'boolean' && !!normalizedFeatureFlags.indentationButtonsInTheToolbar || (typeof ((_props$featureFlags22 = props.featureFlags) === null || _props$featureFlags22 === void 0 ? void 0 : _props$featureFlags22.indentationButtonsInTheToolbar) === 'boolean' ? !!((_props$featureFlags23 = props.featureFlags) !== null && _props$featureFlags23 !== void 0 && _props$featureFlags23.indentationButtonsInTheToolbar) : false)),
|
|
54
|
-
|
|
55
|
-
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
54
|
+
floatingToolbarLinkSettingsButton: typeof ((_props$featureFlags24 = props.featureFlags) === null || _props$featureFlags24 === void 0 ? void 0 : _props$featureFlags24['floating-toolbar-link-settings-button']) === 'string' ? props.featureFlags['floating-toolbar-link-settings-button'] || undefined : undefined,
|
|
56
55
|
disableSpellcheckByBrowser: getSpellCheck(props.featureFlags),
|
|
57
56
|
// Including fallback to props.featureFlags so that mobile feature flags
|
|
58
57
|
// are included (they are not kebab cased)
|
|
59
|
-
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$
|
|
60
|
-
useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$
|
|
58
|
+
restartNumberedLists: normalizedFeatureFlags.restartNumberedLists === true || ((_props$featureFlags25 = props.featureFlags) === null || _props$featureFlags25 === void 0 ? void 0 : _props$featureFlags25.restartNumberedLists) === true,
|
|
59
|
+
useSomewhatSemanticTextColorNames: Boolean(typeof normalizedFeatureFlags.useSomewhatSemanticTextColorNames === 'boolean' && !!normalizedFeatureFlags.useSomewhatSemanticTextColorNames || (typeof ((_props$featureFlags26 = props.featureFlags) === null || _props$featureFlags26 === void 0 ? void 0 : _props$featureFlags26.useSomewhatSemanticTextColorNames) === 'boolean' ? !!((_props$featureFlags27 = props.featureFlags) !== null && _props$featureFlags27 !== void 0 && _props$featureFlags27.useSomewhatSemanticTextColorNames) : false)),
|
|
61
60
|
lpLinkPickerFocusTrap: Boolean(normalizedFeatureFlags.lpLinkPickerFocusTrap),
|
|
62
|
-
preventPopupOverflow: Boolean(typeof ((_props$
|
|
61
|
+
preventPopupOverflow: Boolean(typeof ((_props$featureFlags28 = props.featureFlags) === null || _props$featureFlags28 === void 0 ? void 0 : _props$featureFlags28['prevent-popup-overflow']) === 'boolean' ? !!((_props$featureFlags29 = props.featureFlags) !== null && _props$featureFlags29 !== void 0 && _props$featureFlags29['prevent-popup-overflow']) : false)
|
|
63
62
|
});
|
|
64
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { addAltText, navToEditorToolbar, navToFloatingToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, pastePlainText, clearFormatting, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, ctrlBackSpace, toggleBulletList, toggleBlockQuote, insertNewLine, shiftBackspace, splitCodeBlock, splitListItem, insertRule, undo, moveUp, moveDown, moveLeft, moveRight, indentList, outdentList, redo, openHelp, addLink, addInlineComment, submit, enter, shiftEnter, tab, indent, outdent, backspace, deleteKey, forwardDelete, space, escape, nextCell, previousCell, shiftTab, toggleTable, addRowBefore, addRowAfter, addColumnAfter, addColumnBefore, cut, copy, paste, altPaste, find, alignLeft, tooltip, ToolTipContent, findKeymapByDescription, findShortcutByDescription, findShortcutByKeymap, makeKeymap, makeKeyMapWithCommon, bindKeymapWithCommand, findKeyMapForBrowser, DOWN, HEADING_KEYS, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, LEFT, RIGHT, UP } from '@atlaskit/editor-common/keymaps';
|
|
1
|
+
export { addAltText, navToEditorToolbar, navToFloatingToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, pastePlainText, clearFormatting, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, toggleTaskItemCheckbox, ctrlBackSpace, toggleBulletList, toggleBlockQuote, insertNewLine, shiftBackspace, splitCodeBlock, splitListItem, insertRule, undo, moveUp, moveDown, moveLeft, moveRight, indentList, outdentList, redo, openHelp, addLink, addInlineComment, submit, enter, shiftEnter, tab, indent, outdent, backspace, deleteKey, forwardDelete, space, escape, nextCell, previousCell, shiftTab, toggleTable, addRowBefore, addRowAfter, addColumnAfter, addColumnBefore, cut, copy, paste, altPaste, find, alignLeft, tooltip, ToolTipContent, findKeymapByDescription, findShortcutByDescription, findShortcutByKeymap, makeKeymap, makeKeyMapWithCommon, bindKeymapWithCommand, findKeyMapForBrowser, DOWN, HEADING_KEYS, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, LEFT, RIGHT, UP } from '@atlaskit/editor-common/keymaps';
|
|
@@ -388,11 +388,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
388
388
|
return builder;
|
|
389
389
|
}).add([codeBidiWarningPlugin, {
|
|
390
390
|
appearance: appearance
|
|
391
|
-
}]).
|
|
392
|
-
if (featureFlags.floatingToolbarCopyButton) {
|
|
393
|
-
return builder.add(plugin);
|
|
394
|
-
}
|
|
395
|
-
return builder;
|
|
396
|
-
});
|
|
391
|
+
}]).add(copyButtonPlugin);
|
|
397
392
|
return finalPreset;
|
|
398
393
|
}
|
|
@@ -234,7 +234,7 @@ function ContentComponent(_ref5) {
|
|
|
234
234
|
var _ref7 = floatingToolbarData || {},
|
|
235
235
|
confirmDialogForItem = _ref7.confirmDialogForItem;
|
|
236
236
|
var confirmButtonItem = confirmDialogForItem ? toolbarItems[confirmDialogForItem] : undefined;
|
|
237
|
-
var scrollable =
|
|
237
|
+
var scrollable = config.scrollable;
|
|
238
238
|
var confirmDialogOptions = typeof (confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog) === 'function' ? confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog() : confirmButtonItem === null || confirmButtonItem === void 0 ? void 0 : confirmButtonItem.confirmDialog;
|
|
239
239
|
return /*#__PURE__*/React.createElement(ErrorBoundary, {
|
|
240
240
|
component: ACTION_SUBJECT.FLOATING_TOOLBAR_PLUGIN,
|
|
@@ -110,8 +110,10 @@ export var ScrollButtons = function ScrollButtons(_ref) {
|
|
|
110
110
|
useEffect(function () {
|
|
111
111
|
var scrollContainerRefCurrent = scrollContainerRef.current;
|
|
112
112
|
if (scrollContainerRefCurrent) {
|
|
113
|
+
var _scrollContainerRefCu;
|
|
113
114
|
// reset scroll position when switching from one node with toolbar to another
|
|
114
|
-
|
|
115
|
+
// scroll to made optional as it may not be rendered in testing env
|
|
116
|
+
(_scrollContainerRefCu = scrollContainerRefCurrent.scrollTo) === null || _scrollContainerRefCu === void 0 ? void 0 : _scrollContainerRefCu.call(scrollContainerRefCurrent, {
|
|
115
117
|
left: 0
|
|
116
118
|
});
|
|
117
119
|
}
|
|
@@ -8,7 +8,7 @@ import { browser } from '@atlaskit/editor-common/utils';
|
|
|
8
8
|
import CrossIcon from '@atlaskit/icon/glyph/cross';
|
|
9
9
|
import AkModalDialog, { ModalTransition, useModal } from '@atlaskit/modal-dialog';
|
|
10
10
|
import { header, footer, contentWrapper, line, content, row, codeSm, codeMd, codeLg, title, column, dialogHeader } from './styles';
|
|
11
|
-
import { navToFloatingToolbar, navToEditorToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, insertRule, addLink, setNormalText, alignLeft, clearFormatting, undo, redo, pastePlainText, addInlineComment, toggleCode, openHelp, toggleBulletList, toggleBlockQuote } from '@atlaskit/editor-common/keymaps';
|
|
11
|
+
import { navToFloatingToolbar, navToEditorToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, insertRule, addLink, setNormalText, alignLeft, clearFormatting, undo, redo, pastePlainText, addInlineComment, toggleTaskItemCheckbox, toggleCode, openHelp, toggleBulletList, toggleBlockQuote } from '@atlaskit/editor-common/keymaps';
|
|
12
12
|
import ToolbarButton from '../../../ui/ToolbarButton';
|
|
13
13
|
import { toolbarMessages, listMessages } from '@atlaskit/editor-common/messages';
|
|
14
14
|
import { messages as insertBlockMessages } from '../../insert-block/ui/ToolbarInsertBlock/messages';
|
|
@@ -44,6 +44,11 @@ var messages = defineMessages({
|
|
|
44
44
|
defaultMessage: 'Paste plain text',
|
|
45
45
|
description: ''
|
|
46
46
|
},
|
|
47
|
+
CheckUncheckActionItem: {
|
|
48
|
+
id: 'fabric.editor.checkUncheckActionItem',
|
|
49
|
+
defaultMessage: 'Toggle action item',
|
|
50
|
+
description: 'For Check/Uncheck Action item use shortcut'
|
|
51
|
+
},
|
|
47
52
|
altText: {
|
|
48
53
|
id: 'fabric.editor.altText',
|
|
49
54
|
defaultMessage: 'Alt text',
|
|
@@ -374,6 +379,12 @@ var otherFormatting = function otherFormatting(_ref3) {
|
|
|
374
379
|
keymap: function keymap() {
|
|
375
380
|
return addInlineComment;
|
|
376
381
|
}
|
|
382
|
+
}, {
|
|
383
|
+
name: formatMessage(messages.CheckUncheckActionItem),
|
|
384
|
+
type: 'checkbox',
|
|
385
|
+
keymap: function keymap() {
|
|
386
|
+
return toggleTaskItemCheckbox;
|
|
387
|
+
}
|
|
377
388
|
}];
|
|
378
389
|
};
|
|
379
390
|
var imageAutoFormat = {
|
|
@@ -432,6 +443,11 @@ export var getComponentFromKeymap = function getComponentFromKeymap(keymap) {
|
|
|
432
443
|
css: codeLg,
|
|
433
444
|
key: "".concat(keyParts, "-").concat(index)
|
|
434
445
|
}, part);
|
|
446
|
+
} else if (part.toLowerCase() === 'enter') {
|
|
447
|
+
return jsx("span", {
|
|
448
|
+
css: codeSm,
|
|
449
|
+
key: "".concat(keyParts, "-").concat(index)
|
|
450
|
+
}, '⏎');
|
|
435
451
|
}
|
|
436
452
|
return jsx("span", {
|
|
437
453
|
css: codeSm,
|
|
@@ -5,6 +5,7 @@ import { autoJoin, chainCommands } from '@atlaskit/editor-prosemirror/commands';
|
|
|
5
5
|
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
6
6
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
7
7
|
import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
8
|
+
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
8
9
|
import { findParentNodeOfType, findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
9
10
|
import { uuid } from '@atlaskit/adf-schema';
|
|
10
11
|
import { filterCommand as filter, isEmptySelectionAtStart, isEmptySelectionAtEnd, deleteEmptyParagraphAndMoveBlockUp } from '@atlaskit/editor-common/utils';
|
|
@@ -13,6 +14,7 @@ import { insertTaskDecisionWithAnalytics } from '../commands';
|
|
|
13
14
|
import { joinAtCut, liftSelection, wrapSelectionInTaskList } from './commands';
|
|
14
15
|
import { getBlockRange, getCurrentIndentLevel, isActionOrDecisionItem, isActionOrDecisionList, isEmptyTaskDecision, isInsideTask, isInsideTaskOrDecisionItem, liftBlock, walkOut, getTaskItemIndex, isInsideDecision, isTable } from './helpers';
|
|
15
16
|
import { normalizeTaskItemsSelection } from '../utils';
|
|
17
|
+
import { toggleTaskItemCheckbox } from '../../../keymaps';
|
|
16
18
|
var indentationAnalytics = function indentationAnalytics(curIndentLevel, direction, inputMethod) {
|
|
17
19
|
return {
|
|
18
20
|
action: ACTION.FORMATTED,
|
|
@@ -304,6 +306,26 @@ var enter = filter(isInsideTaskOrDecisionItem, chainCommands(filter(isEmptyTaskD
|
|
|
304
306
|
}
|
|
305
307
|
return true;
|
|
306
308
|
}));
|
|
309
|
+
var cmdOptEnter = filter(isInsideTaskOrDecisionItem, function (state, dispatch) {
|
|
310
|
+
var selection = state.selection,
|
|
311
|
+
schema = state.schema;
|
|
312
|
+
var taskItem = schema.nodes.taskItem;
|
|
313
|
+
var $from = selection.$from;
|
|
314
|
+
var node = $from.node($from.depth);
|
|
315
|
+
var nodeType = node && node.type;
|
|
316
|
+
var nodePos = $from.before($from.depth);
|
|
317
|
+
if (nodeType === taskItem) {
|
|
318
|
+
var tr = state.tr;
|
|
319
|
+
tr.step(new SetAttrsStep(nodePos, {
|
|
320
|
+
state: node.attrs.state === 'TODO' ? 'DONE' : 'TODO',
|
|
321
|
+
localId: node.attrs.localId
|
|
322
|
+
}));
|
|
323
|
+
if (tr && dispatch) {
|
|
324
|
+
dispatch(tr);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return true;
|
|
328
|
+
});
|
|
307
329
|
export function keymapPlugin(schema, allowNestedTasks, consumeTabs) {
|
|
308
330
|
var indentHandlers = {
|
|
309
331
|
'Shift-Tab': filter([isInsideTaskOrDecisionItem, function (state) {
|
|
@@ -321,12 +343,12 @@ export function keymapPlugin(schema, allowNestedTasks, consumeTabs) {
|
|
|
321
343
|
'Shift-Tab': isInsideTaskOrDecisionItem,
|
|
322
344
|
Tab: isInsideTaskOrDecisionItem
|
|
323
345
|
} : {};
|
|
324
|
-
var keymaps = _objectSpread({
|
|
346
|
+
var keymaps = _objectSpread(_defineProperty({
|
|
325
347
|
Backspace: backspace,
|
|
326
348
|
Delete: deleteForwards,
|
|
327
349
|
'Ctrl-d': deleteForwards,
|
|
328
350
|
Enter: enter
|
|
329
|
-
}, allowNestedTasks ? indentHandlers : defaultHandlers);
|
|
351
|
+
}, toggleTaskItemCheckbox.common, cmdOptEnter), allowNestedTasks ? indentHandlers : defaultHandlers);
|
|
330
352
|
return keymap(keymaps);
|
|
331
353
|
}
|
|
332
354
|
export default keymapPlugin;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { addAltText, navToEditorToolbar, navToFloatingToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, pastePlainText, clearFormatting, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, ctrlBackSpace, toggleBulletList, toggleBlockQuote, insertNewLine, shiftBackspace, splitCodeBlock, splitListItem, insertRule, undo, moveUp, moveDown, moveLeft, moveRight, indentList, outdentList, redo, openHelp, addLink, addInlineComment, submit, enter, shiftEnter, tab, indent, outdent, backspace, deleteKey, forwardDelete, space, escape, nextCell, previousCell, shiftTab, toggleTable, addRowBefore, addRowAfter, addColumnAfter, addColumnBefore, cut, copy, paste, altPaste, find, alignLeft, tooltip, ToolTipContent, findKeymapByDescription, findShortcutByDescription, findShortcutByKeymap, makeKeymap, makeKeyMapWithCommon, bindKeymapWithCommand, findKeyMapForBrowser, DOWN, HEADING_KEYS, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, LEFT, RIGHT, UP, } from '@atlaskit/editor-common/keymaps';
|
|
1
|
+
export { addAltText, navToEditorToolbar, navToFloatingToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, pastePlainText, clearFormatting, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, toggleTaskItemCheckbox, ctrlBackSpace, toggleBulletList, toggleBlockQuote, insertNewLine, shiftBackspace, splitCodeBlock, splitListItem, insertRule, undo, moveUp, moveDown, moveLeft, moveRight, indentList, outdentList, redo, openHelp, addLink, addInlineComment, submit, enter, shiftEnter, tab, indent, outdent, backspace, deleteKey, forwardDelete, space, escape, nextCell, previousCell, shiftTab, toggleTable, addRowBefore, addRowAfter, addColumnAfter, addColumnBefore, cut, copy, paste, altPaste, find, alignLeft, tooltip, ToolTipContent, findKeymapByDescription, findShortcutByDescription, findShortcutByKeymap, makeKeymap, makeKeyMapWithCommon, bindKeymapWithCommand, findKeyMapForBrowser, DOWN, HEADING_KEYS, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, LEFT, RIGHT, UP, } from '@atlaskit/editor-common/keymaps';
|
|
2
2
|
export type { Keymap } from '@atlaskit/editor-common/keymaps';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { addAltText, navToEditorToolbar, navToFloatingToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, pastePlainText, clearFormatting, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, ctrlBackSpace, toggleBulletList, toggleBlockQuote, insertNewLine, shiftBackspace, splitCodeBlock, splitListItem, insertRule, undo, moveUp, moveDown, moveLeft, moveRight, indentList, outdentList, redo, openHelp, addLink, addInlineComment, submit, enter, shiftEnter, tab, indent, outdent, backspace, deleteKey, forwardDelete, space, escape, nextCell, previousCell, shiftTab, toggleTable, addRowBefore, addRowAfter, addColumnAfter, addColumnBefore, cut, copy, paste, altPaste, find, alignLeft, tooltip, ToolTipContent, findKeymapByDescription, findShortcutByDescription, findShortcutByKeymap, makeKeymap, makeKeyMapWithCommon, bindKeymapWithCommand, findKeyMapForBrowser, DOWN, HEADING_KEYS, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, LEFT, RIGHT, UP, } from '@atlaskit/editor-common/keymaps';
|
|
1
|
+
export { addAltText, navToEditorToolbar, navToFloatingToolbar, toggleBold, toggleItalic, toggleUnderline, toggleStrikethrough, toggleSubscript, toggleSuperscript, toggleCode, pastePlainText, clearFormatting, setNormalText, toggleHeading1, toggleHeading2, toggleHeading3, toggleHeading4, toggleHeading5, toggleHeading6, toggleOrderedList, toggleTaskItemCheckbox, ctrlBackSpace, toggleBulletList, toggleBlockQuote, insertNewLine, shiftBackspace, splitCodeBlock, splitListItem, insertRule, undo, moveUp, moveDown, moveLeft, moveRight, indentList, outdentList, redo, openHelp, addLink, addInlineComment, submit, enter, shiftEnter, tab, indent, outdent, backspace, deleteKey, forwardDelete, space, escape, nextCell, previousCell, shiftTab, toggleTable, addRowBefore, addRowAfter, addColumnAfter, addColumnBefore, cut, copy, paste, altPaste, find, alignLeft, tooltip, ToolTipContent, findKeymapByDescription, findShortcutByDescription, findShortcutByKeymap, makeKeymap, makeKeyMapWithCommon, bindKeymapWithCommand, findKeyMapForBrowser, DOWN, HEADING_KEYS, KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, LEFT, RIGHT, UP, } from '@atlaskit/editor-common/keymaps';
|
|
2
2
|
export type { Keymap } from '@atlaskit/editor-common/keymaps';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "187.
|
|
3
|
+
"version": "187.40.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@atlaskit/code": "^14.6.0",
|
|
56
56
|
"@atlaskit/date": "^0.10.0",
|
|
57
57
|
"@atlaskit/datetime-picker": "^12.9.0",
|
|
58
|
-
"@atlaskit/editor-common": "^74.
|
|
58
|
+
"@atlaskit/editor-common": "^74.57.0",
|
|
59
59
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
60
60
|
"@atlaskit/editor-markdown-transformer": "^5.2.5",
|
|
61
61
|
"@atlaskit/editor-palette": "1.5.1",
|
|
@@ -108,12 +108,12 @@
|
|
|
108
108
|
"@atlaskit/radio": "^5.6.0",
|
|
109
109
|
"@atlaskit/section-message": "^6.4.0",
|
|
110
110
|
"@atlaskit/select": "^16.5.0",
|
|
111
|
-
"@atlaskit/smart-card": "^26.
|
|
111
|
+
"@atlaskit/smart-card": "^26.23.0",
|
|
112
112
|
"@atlaskit/smart-user-picker": "^6.3.0",
|
|
113
113
|
"@atlaskit/spinner": "^15.5.0",
|
|
114
114
|
"@atlaskit/status": "^1.3.0",
|
|
115
115
|
"@atlaskit/tabs": "^13.4.0",
|
|
116
|
-
"@atlaskit/task-decision": "^17.
|
|
116
|
+
"@atlaskit/task-decision": "^17.8.0",
|
|
117
117
|
"@atlaskit/textarea": "^4.7.0",
|
|
118
118
|
"@atlaskit/textfield": "^5.6.0",
|
|
119
119
|
"@atlaskit/theme": "^12.6.0",
|