@atlaskit/editor-core 187.18.1 → 187.19.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 +13 -0
- package/dist/cjs/labs/next/presets/default.js +2 -1
- package/dist/cjs/labs/next/presets/universal.js +2 -1
- package/dist/cjs/plugins/base/index.js +0 -7
- package/dist/cjs/plugins/code-block/index.js +1 -1
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +98 -95
- package/dist/cjs/plugins/composition/index.js +33 -0
- package/dist/cjs/plugins/{base/pm-plugins/composition.js → composition/pm-plugins/main.js} +8 -14
- package/dist/cjs/plugins/{image-upload → composition}/pm-plugins/plugin-key.js +3 -3
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/paste/pm-plugins/main.js +2 -6
- package/dist/cjs/plugins/placeholder/index.js +2 -2
- package/dist/cjs/utils/clipboard.js +5 -27
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/labs/next/presets/default.js +2 -1
- package/dist/es2019/labs/next/presets/universal.js +2 -1
- package/dist/es2019/plugins/base/index.js +0 -5
- package/dist/es2019/plugins/code-block/index.js +1 -1
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +107 -104
- package/dist/es2019/plugins/composition/index.js +23 -0
- package/dist/es2019/plugins/{base/pm-plugins/composition.js → composition/pm-plugins/main.js} +7 -12
- package/dist/es2019/plugins/{image-upload → composition}/pm-plugins/plugin-key.js +1 -1
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/paste/pm-plugins/main.js +2 -2
- package/dist/es2019/plugins/placeholder/index.js +2 -2
- package/dist/es2019/utils/clipboard.js +0 -16
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/labs/next/presets/default.js +2 -1
- package/dist/esm/labs/next/presets/universal.js +2 -1
- package/dist/esm/plugins/base/index.js +0 -7
- package/dist/esm/plugins/code-block/index.js +1 -1
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +98 -95
- package/dist/esm/plugins/composition/index.js +25 -0
- package/dist/esm/plugins/{base/pm-plugins/composition.js → composition/pm-plugins/main.js} +7 -12
- package/dist/esm/plugins/{image-upload → composition}/pm-plugins/plugin-key.js +1 -1
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/paste/pm-plugins/main.js +2 -2
- package/dist/esm/plugins/placeholder/index.js +2 -2
- package/dist/esm/utils/clipboard.js +4 -23
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/labs/next/presets/default.d.ts +16 -0
- package/dist/types/plugins/code-block/index.d.ts +6 -4
- package/dist/types/plugins/code-block/pm-plugins/ide-ux.d.ts +4 -2
- package/dist/types/plugins/composition/index.d.ts +8 -0
- package/dist/types/plugins/composition/pm-plugins/main.d.ts +4 -0
- package/dist/types/plugins/composition/pm-plugins/plugin-key.d.ts +6 -0
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/insert-block/index.d.ts +1 -1
- package/dist/types/plugins/placeholder/index.d.ts +2 -1
- package/dist/types/utils/clipboard.d.ts +0 -3
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +20 -0
- package/dist/types-ts4.5/plugins/code-block/index.d.ts +6 -4
- package/dist/types-ts4.5/plugins/code-block/pm-plugins/ide-ux.d.ts +4 -2
- package/dist/types-ts4.5/plugins/composition/index.d.ts +8 -0
- package/dist/types-ts4.5/plugins/composition/pm-plugins/main.d.ts +4 -0
- package/dist/types-ts4.5/plugins/composition/pm-plugins/plugin-key.d.ts +6 -0
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/placeholder/index.d.ts +3 -1
- package/dist/types-ts4.5/utils/clipboard.d.ts +0 -3
- package/package.json +4 -3
- package/dist/cjs/plugins/image-upload/index.js +0 -45
- package/dist/cjs/plugins/image-upload/pm-plugins/actions.js +0 -19
- package/dist/cjs/plugins/image-upload/pm-plugins/commands-toolbar.js +0 -19
- package/dist/cjs/plugins/image-upload/pm-plugins/commands.js +0 -40
- package/dist/cjs/plugins/image-upload/pm-plugins/input-rule.js +0 -31
- package/dist/cjs/plugins/image-upload/pm-plugins/main.js +0 -194
- package/dist/cjs/plugins/image-upload/types.js +0 -5
- package/dist/cjs/plugins/image-upload/utils.js +0 -40
- package/dist/cjs/utils/drag-drop.js +0 -19
- package/dist/es2019/plugins/image-upload/index.js +0 -34
- package/dist/es2019/plugins/image-upload/pm-plugins/actions.js +0 -8
- package/dist/es2019/plugins/image-upload/pm-plugins/commands-toolbar.js +0 -12
- package/dist/es2019/plugins/image-upload/pm-plugins/commands.js +0 -28
- package/dist/es2019/plugins/image-upload/pm-plugins/input-rule.js +0 -25
- package/dist/es2019/plugins/image-upload/pm-plugins/main.js +0 -159
- package/dist/es2019/plugins/image-upload/types.js +0 -1
- package/dist/es2019/plugins/image-upload/utils.js +0 -38
- package/dist/es2019/utils/drag-drop.js +0 -9
- package/dist/esm/plugins/image-upload/index.js +0 -37
- package/dist/esm/plugins/image-upload/pm-plugins/actions.js +0 -12
- package/dist/esm/plugins/image-upload/pm-plugins/commands-toolbar.js +0 -12
- package/dist/esm/plugins/image-upload/pm-plugins/commands.js +0 -32
- package/dist/esm/plugins/image-upload/pm-plugins/input-rule.js +0 -23
- package/dist/esm/plugins/image-upload/pm-plugins/main.js +0 -186
- package/dist/esm/plugins/image-upload/types.js +0 -1
- package/dist/esm/plugins/image-upload/utils.js +0 -31
- package/dist/esm/utils/drag-drop.js +0 -11
- package/dist/types/plugins/base/pm-plugins/composition.d.ts +0 -9
- package/dist/types/plugins/image-upload/index.d.ts +0 -16
- package/dist/types/plugins/image-upload/pm-plugins/actions.d.ts +0 -3
- package/dist/types/plugins/image-upload/pm-plugins/commands-toolbar.d.ts +0 -3
- package/dist/types/plugins/image-upload/pm-plugins/commands.d.ts +0 -5
- package/dist/types/plugins/image-upload/pm-plugins/input-rule.d.ts +0 -5
- package/dist/types/plugins/image-upload/pm-plugins/main.d.ts +0 -4
- package/dist/types/plugins/image-upload/pm-plugins/plugin-key.d.ts +0 -3
- package/dist/types/plugins/image-upload/types.d.ts +0 -18
- package/dist/types/plugins/image-upload/utils.d.ts +0 -5
- package/dist/types/utils/drag-drop.d.ts +0 -2
- package/dist/types-ts4.5/plugins/base/pm-plugins/composition.d.ts +0 -9
- package/dist/types-ts4.5/plugins/image-upload/index.d.ts +0 -16
- package/dist/types-ts4.5/plugins/image-upload/pm-plugins/actions.d.ts +0 -3
- package/dist/types-ts4.5/plugins/image-upload/pm-plugins/commands-toolbar.d.ts +0 -3
- package/dist/types-ts4.5/plugins/image-upload/pm-plugins/commands.d.ts +0 -5
- package/dist/types-ts4.5/plugins/image-upload/pm-plugins/input-rule.d.ts +0 -5
- package/dist/types-ts4.5/plugins/image-upload/pm-plugins/main.d.ts +0 -4
- package/dist/types-ts4.5/plugins/image-upload/pm-plugins/plugin-key.d.ts +0 -3
- package/dist/types-ts4.5/plugins/image-upload/types.d.ts +0 -18
- package/dist/types-ts4.5/plugins/image-upload/utils.d.ts +0 -5
- package/dist/types-ts4.5/utils/drag-drop.d.ts +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 187.19.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`7cb6ec49e68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7cb6ec49e68) - Decouple `composition` plugin from `base` plugin
|
|
8
|
+
|
|
9
|
+
## 187.18.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`079e7748c62`](https://bitbucket.org/atlassian/atlassian-frontend/commits/079e7748c62) - Extracted `editor-plugin-image-upload` from `editor-core`.
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 187.18.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -26,6 +26,7 @@ var _plugins = require("../../../plugins");
|
|
|
26
26
|
var _editorPluginAnalytics = require("@atlaskit/editor-plugin-analytics");
|
|
27
27
|
var _placeholder = _interopRequireDefault(require("../../../plugins/placeholder"));
|
|
28
28
|
var _annotation = _interopRequireDefault(require("../../../plugins/annotation"));
|
|
29
|
+
var _composition = _interopRequireDefault(require("../../../plugins/composition"));
|
|
29
30
|
var _quickInsert = _interopRequireDefault(require("../../../plugins/quick-insert"));
|
|
30
31
|
var _selection = _interopRequireDefault(require("../../../plugins/selection"));
|
|
31
32
|
var _codeBlock = _interopRequireDefault(require("../../../plugins/code-block"));
|
|
@@ -61,7 +62,7 @@ function createDefaultPreset(options) {
|
|
|
61
62
|
}]);
|
|
62
63
|
}
|
|
63
64
|
return builder;
|
|
64
|
-
}).add([_paste.default, options.paste]).add(_clipboard.default).add(_editorPluginFocus.focusPlugin).add([_base.default, options.base]).add(_editorPluginDecorations.decorationsPlugin).maybeAdd(_undoRedo.default, function (p, builder) {
|
|
65
|
+
}).add([_paste.default, options.paste]).add(_clipboard.default).add(_editorPluginFocus.focusPlugin).add(_composition.default).add([_base.default, options.base]).add(_editorPluginDecorations.decorationsPlugin).maybeAdd(_undoRedo.default, function (p, builder) {
|
|
65
66
|
var _options$featureFlags;
|
|
66
67
|
// The undo redo plugin needs to be add before the blockTypePlugin
|
|
67
68
|
if ((_options$featureFlags = options.featureFlags) !== null && _options$featureFlags !== void 0 && _options$featureFlags.undoRedoButtons) {
|
|
@@ -9,6 +9,7 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _api = require("../../../selection-api/api");
|
|
11
11
|
var _plugins = require("../../../plugins");
|
|
12
|
+
var _editorPluginImageUpload = require("@atlaskit/editor-plugin-image-upload");
|
|
12
13
|
var _editorPluginGuideline = require("@atlaskit/editor-plugin-guideline");
|
|
13
14
|
var _editorPluginContextPanel = require("@atlaskit/editor-plugin-context-panel");
|
|
14
15
|
var _editorPluginGrid = require("@atlaskit/editor-plugin-grid");
|
|
@@ -183,7 +184,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
183
184
|
return builder.add([plugin, props.onSave]);
|
|
184
185
|
}
|
|
185
186
|
return builder;
|
|
186
|
-
}).maybeAdd(
|
|
187
|
+
}).maybeAdd(_editorPluginImageUpload.imageUploadPlugin, function (plugin, builder) {
|
|
187
188
|
if (props.legacyImageUploadProvider) {
|
|
188
189
|
return builder.add(plugin);
|
|
189
190
|
}
|
|
@@ -19,7 +19,6 @@ var _inlineCursorTarget = _interopRequireDefault(require("./pm-plugins/inline-cu
|
|
|
19
19
|
var _scrollGutter = _interopRequireDefault(require("./pm-plugins/scroll-gutter"));
|
|
20
20
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
21
21
|
var _frozenEditor = _interopRequireDefault(require("./pm-plugins/frozen-editor"));
|
|
22
|
-
var _composition = _interopRequireDefault(require("./pm-plugins/composition"));
|
|
23
22
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
24
23
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
24
|
// Chrome >= 88
|
|
@@ -112,12 +111,6 @@ var basePlugin = function basePlugin(options, api) {
|
|
|
112
111
|
return (0, _disableSpellChecking.default)(featureFlags);
|
|
113
112
|
}
|
|
114
113
|
});
|
|
115
|
-
plugins.push({
|
|
116
|
-
name: 'compositionPlugin',
|
|
117
|
-
plugin: function plugin() {
|
|
118
|
-
return (0, _composition.default)();
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
114
|
return plugins;
|
|
122
115
|
},
|
|
123
116
|
nodes: function nodes() {
|
|
@@ -15,113 +15,116 @@ var _bracketHandling = require("../ide-ux/bracket-handling");
|
|
|
15
15
|
var _quoteHandling = require("../ide-ux/quote-handling");
|
|
16
16
|
var _lineHandling = require("../ide-ux/line-handling");
|
|
17
17
|
var _commands = require("../ide-ux/commands");
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var afterText = (0, _lineHandling.getEndOfCurrentLine)(state).text;
|
|
27
|
-
|
|
28
|
-
// If text is a closing bracket/quote and we've already inserted it, move the selection after
|
|
29
|
-
if ((0, _pairedCharacterHandling.isCursorBeforeClosingCharacter)(afterText) && (0, _pairedCharacterHandling.isClosingCharacter)(text) && afterText.startsWith(text)) {
|
|
30
|
-
dispatch((0, _utils.setTextSelection)(to + text.length)(state.tr));
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// Automatically add right-hand side bracket when user types the left bracket
|
|
35
|
-
if ((0, _bracketHandling.shouldAutoCloseBracket)(beforeText, afterText)) {
|
|
36
|
-
var _getAutoClosingBracke = (0, _bracketHandling.getAutoClosingBracketInfo)(beforeText + text, afterText),
|
|
37
|
-
left = _getAutoClosingBracke.left,
|
|
38
|
-
right = _getAutoClosingBracke.right;
|
|
39
|
-
if (left && right) {
|
|
40
|
-
var bracketPair = state.schema.text(text + right);
|
|
41
|
-
var tr = state.tr.replaceWith(from, to, bracketPair);
|
|
42
|
-
dispatch((0, _utils.setTextSelection)(from + text.length)(tr));
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Automatically add closing quote when user types a starting quote
|
|
48
|
-
if ((0, _quoteHandling.shouldAutoCloseQuote)(beforeText, afterText)) {
|
|
49
|
-
var _getAutoClosingQuoteI = (0, _quoteHandling.getAutoClosingQuoteInfo)(beforeText + text, afterText),
|
|
50
|
-
leftQuote = _getAutoClosingQuoteI.left,
|
|
51
|
-
rightQuote = _getAutoClosingQuoteI.right;
|
|
52
|
-
if (leftQuote && rightQuote) {
|
|
53
|
-
var quotePair = state.schema.text(text + rightQuote);
|
|
54
|
-
var _tr = state.tr.replaceWith(from, to, quotePair);
|
|
55
|
-
dispatch((0, _utils.setTextSelection)(from + text.length)(_tr));
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return false;
|
|
61
|
-
},
|
|
62
|
-
handleKeyDown: (0, _keymap.keydownHandler)({
|
|
63
|
-
Backspace: function Backspace(state, dispatch) {
|
|
64
|
-
if ((0, _lineHandling.isCursorInsideCodeBlock)(state)) {
|
|
65
|
-
var $cursor = (0, _utils2.getCursor)(state.selection);
|
|
18
|
+
var ideUX = function ideUX(pluginInjectionApi) {
|
|
19
|
+
return new _safePlugin.SafePlugin({
|
|
20
|
+
props: {
|
|
21
|
+
handleTextInput: function handleTextInput(view, from, to, text) {
|
|
22
|
+
var state = view.state,
|
|
23
|
+
dispatch = view.dispatch;
|
|
24
|
+
var compositionPluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.composition.sharedState.currentState();
|
|
25
|
+
if ((0, _lineHandling.isCursorInsideCodeBlock)(state) && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
|
|
66
26
|
var beforeText = (0, _lineHandling.getStartOfCurrentLine)(state).text;
|
|
67
27
|
var afterText = (0, _lineHandling.getEndOfCurrentLine)(state).text;
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (leftBracket && rightBracket && hasTrailingMatchingBracket && dispatch) {
|
|
73
|
-
dispatch(state.tr.delete($cursor.pos - leftBracket.length, $cursor.pos + rightBracket.length));
|
|
28
|
+
|
|
29
|
+
// If text is a closing bracket/quote and we've already inserted it, move the selection after
|
|
30
|
+
if ((0, _pairedCharacterHandling.isCursorBeforeClosingCharacter)(afterText) && (0, _pairedCharacterHandling.isClosingCharacter)(text) && afterText.startsWith(text)) {
|
|
31
|
+
dispatch((0, _utils.setTextSelection)(to + text.length)(state.tr));
|
|
74
32
|
return true;
|
|
75
33
|
}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
34
|
+
|
|
35
|
+
// Automatically add right-hand side bracket when user types the left bracket
|
|
36
|
+
if ((0, _bracketHandling.shouldAutoCloseBracket)(beforeText, afterText)) {
|
|
37
|
+
var _getAutoClosingBracke = (0, _bracketHandling.getAutoClosingBracketInfo)(beforeText + text, afterText),
|
|
38
|
+
left = _getAutoClosingBracke.left,
|
|
39
|
+
right = _getAutoClosingBracke.right;
|
|
40
|
+
if (left && right) {
|
|
41
|
+
var bracketPair = state.schema.text(text + right);
|
|
42
|
+
var tr = state.tr.replaceWith(from, to, bracketPair);
|
|
43
|
+
dispatch((0, _utils.setTextSelection)(from + text.length)(tr));
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
83
46
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (
|
|
91
|
-
|
|
47
|
+
|
|
48
|
+
// Automatically add closing quote when user types a starting quote
|
|
49
|
+
if ((0, _quoteHandling.shouldAutoCloseQuote)(beforeText, afterText)) {
|
|
50
|
+
var _getAutoClosingQuoteI = (0, _quoteHandling.getAutoClosingQuoteInfo)(beforeText + text, afterText),
|
|
51
|
+
leftQuote = _getAutoClosingQuoteI.left,
|
|
52
|
+
rightQuote = _getAutoClosingQuoteI.right;
|
|
53
|
+
if (leftQuote && rightQuote) {
|
|
54
|
+
var quotePair = state.schema.text(text + rightQuote);
|
|
55
|
+
var _tr = state.tr.replaceWith(from, to, quotePair);
|
|
56
|
+
dispatch((0, _utils.setTextSelection)(from + text.length)(_tr));
|
|
92
57
|
return true;
|
|
93
58
|
}
|
|
94
59
|
}
|
|
95
60
|
}
|
|
96
61
|
return false;
|
|
97
62
|
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
63
|
+
handleKeyDown: (0, _keymap.keydownHandler)({
|
|
64
|
+
Backspace: function Backspace(state, dispatch) {
|
|
65
|
+
if ((0, _lineHandling.isCursorInsideCodeBlock)(state)) {
|
|
66
|
+
var $cursor = (0, _utils2.getCursor)(state.selection);
|
|
67
|
+
var beforeText = (0, _lineHandling.getStartOfCurrentLine)(state).text;
|
|
68
|
+
var afterText = (0, _lineHandling.getEndOfCurrentLine)(state).text;
|
|
69
|
+
var _getAutoClosingBracke2 = (0, _bracketHandling.getAutoClosingBracketInfo)(beforeText, afterText),
|
|
70
|
+
leftBracket = _getAutoClosingBracke2.left,
|
|
71
|
+
rightBracket = _getAutoClosingBracke2.right,
|
|
72
|
+
hasTrailingMatchingBracket = _getAutoClosingBracke2.hasTrailingMatchingBracket;
|
|
73
|
+
if (leftBracket && rightBracket && hasTrailingMatchingBracket && dispatch) {
|
|
74
|
+
dispatch(state.tr.delete($cursor.pos - leftBracket.length, $cursor.pos + rightBracket.length));
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
var _getAutoClosingQuoteI2 = (0, _quoteHandling.getAutoClosingQuoteInfo)(beforeText, afterText),
|
|
78
|
+
leftQuote = _getAutoClosingQuoteI2.left,
|
|
79
|
+
rightQuote = _getAutoClosingQuoteI2.right,
|
|
80
|
+
hasTrailingMatchingQuote = _getAutoClosingQuoteI2.hasTrailingMatchingQuote;
|
|
81
|
+
if (leftQuote && rightQuote && hasTrailingMatchingQuote && dispatch) {
|
|
82
|
+
dispatch(state.tr.delete($cursor.pos - leftQuote.length, $cursor.pos + rightQuote.length));
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
var _getLineInfo = (0, _lineHandling.getLineInfo)(beforeText),
|
|
86
|
+
_getLineInfo$indentTo = _getLineInfo.indentToken,
|
|
87
|
+
size = _getLineInfo$indentTo.size,
|
|
88
|
+
token = _getLineInfo$indentTo.token,
|
|
89
|
+
indentText = _getLineInfo.indentText;
|
|
90
|
+
if (beforeText === indentText) {
|
|
91
|
+
if (indentText.endsWith(token.repeat(size)) && dispatch) {
|
|
92
|
+
dispatch(state.tr.delete($cursor.pos - (size - indentText.length % size || size), $cursor.pos));
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
103
97
|
return false;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
98
|
+
},
|
|
99
|
+
Enter: (0, _utils3.filterCommand)(_lineHandling.isSelectionEntirelyInsideCodeBlock, _commands.insertNewlineWithIndent),
|
|
100
|
+
'Mod-]': (0, _utils3.filterCommand)(_lineHandling.isSelectionEntirelyInsideCodeBlock, _commands.indent),
|
|
101
|
+
'Mod-[': (0, _utils3.filterCommand)(_lineHandling.isSelectionEntirelyInsideCodeBlock, _commands.outdent),
|
|
102
|
+
Tab: (0, _utils3.filterCommand)(_lineHandling.isSelectionEntirelyInsideCodeBlock, function (state, dispatch) {
|
|
103
|
+
if (!dispatch) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
if ((0, _lineHandling.isCursorInsideCodeBlock)(state)) {
|
|
107
|
+
return (0, _commands.insertIndent)(state, dispatch);
|
|
108
|
+
}
|
|
109
|
+
return (0, _commands.indent)(state, dispatch);
|
|
110
|
+
}),
|
|
111
|
+
'Shift-Tab': (0, _utils3.filterCommand)(_lineHandling.isSelectionEntirelyInsideCodeBlock, _commands.outdent),
|
|
112
|
+
'Mod-a': function ModA(state, dispatch) {
|
|
113
|
+
if ((0, _lineHandling.isSelectionEntirelyInsideCodeBlock)(state)) {
|
|
114
|
+
var _state$selection = state.selection,
|
|
115
|
+
$from = _state$selection.$from,
|
|
116
|
+
$to = _state$selection.$to;
|
|
117
|
+
var isFullCodeBlockSelection = $from.parentOffset === 0 && $to.parentOffset === $to.parent.nodeSize - 2;
|
|
118
|
+
if (!isFullCodeBlockSelection && dispatch) {
|
|
119
|
+
dispatch(state.tr.setSelection(_state.TextSelection.create(state.doc, $from.start(), $to.end())));
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
120
122
|
}
|
|
123
|
+
return false;
|
|
121
124
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
var _default = ideUX;
|
|
127
130
|
exports.default = _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _main = _interopRequireDefault(require("./pm-plugins/main"));
|
|
9
|
+
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
10
|
+
var composition = function composition() {
|
|
11
|
+
return {
|
|
12
|
+
name: 'composition',
|
|
13
|
+
getSharedState: function getSharedState(editorState) {
|
|
14
|
+
var _pluginKey$getState;
|
|
15
|
+
if (!editorState) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
isComposing: !!((_pluginKey$getState = _pluginKey.pluginKey.getState(editorState)) !== null && _pluginKey$getState !== void 0 && _pluginKey$getState.isComposing)
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
pmPlugins: function pmPlugins() {
|
|
23
|
+
return [{
|
|
24
|
+
name: 'composition',
|
|
25
|
+
plugin: function plugin() {
|
|
26
|
+
return (0, _main.default)();
|
|
27
|
+
}
|
|
28
|
+
}];
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
var _default = composition;
|
|
33
|
+
exports.default = _default;
|
|
@@ -3,22 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
8
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
10
|
-
var
|
|
11
|
-
var isComposing = function isComposing(state) {
|
|
12
|
-
var _compositionPluginKey;
|
|
13
|
-
return !!((_compositionPluginKey = compositionPluginKey.getState(state)) !== null && _compositionPluginKey !== void 0 && _compositionPluginKey.isComposing);
|
|
14
|
-
};
|
|
15
|
-
exports.isComposing = isComposing;
|
|
9
|
+
var _pluginKey = require("./plugin-key");
|
|
16
10
|
var isLinux = function isLinux() {
|
|
17
11
|
return navigator.userAgent.indexOf('Linux') >= 0;
|
|
18
12
|
};
|
|
19
13
|
var _default = function _default() {
|
|
20
14
|
return new _safePlugin.SafePlugin({
|
|
21
|
-
key:
|
|
15
|
+
key: _pluginKey.pluginKey,
|
|
22
16
|
state: {
|
|
23
17
|
init: function init() {
|
|
24
18
|
return {
|
|
@@ -27,7 +21,7 @@ var _default = function _default() {
|
|
|
27
21
|
};
|
|
28
22
|
},
|
|
29
23
|
apply: function apply(tr, value) {
|
|
30
|
-
var isComposing = tr.getMeta(
|
|
24
|
+
var isComposing = tr.getMeta(_pluginKey.pluginKey);
|
|
31
25
|
var zeroWidthSpacePos = tr.getMeta('zeroWidthSpacePos');
|
|
32
26
|
if (typeof isComposing === 'undefined') {
|
|
33
27
|
return value;
|
|
@@ -42,7 +36,7 @@ var _default = function _default() {
|
|
|
42
36
|
handleDOMEvents: {
|
|
43
37
|
compositionstart: function compositionstart(view, event) {
|
|
44
38
|
var tr = view.state.tr;
|
|
45
|
-
tr.setMeta(
|
|
39
|
+
tr.setMeta(_pluginKey.pluginKey, true);
|
|
46
40
|
|
|
47
41
|
// only apply for linux and cursor is at start of line
|
|
48
42
|
if (isLinux() && view.state.selection.$from.parentOffset === 0) {
|
|
@@ -56,10 +50,10 @@ var _default = function _default() {
|
|
|
56
50
|
},
|
|
57
51
|
compositionend: function compositionend(view, event) {
|
|
58
52
|
var tr = view.state.tr;
|
|
59
|
-
tr.setMeta(
|
|
53
|
+
tr.setMeta(_pluginKey.pluginKey, false);
|
|
60
54
|
if (isLinux()) {
|
|
61
|
-
var
|
|
62
|
-
var zeroWidthSpacePos = (
|
|
55
|
+
var _pluginKey$getState;
|
|
56
|
+
var zeroWidthSpacePos = (_pluginKey$getState = _pluginKey.pluginKey.getState(view.state)) === null || _pluginKey$getState === void 0 ? void 0 : _pluginKey$getState.zeroWidthSpacePos;
|
|
63
57
|
if (typeof zeroWidthSpacePos !== 'undefined') {
|
|
64
58
|
tr.deleteRange(zeroWidthSpacePos, zeroWidthSpacePos + 1);
|
|
65
59
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.pluginKey = void 0;
|
|
7
7
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
-
var
|
|
9
|
-
exports.
|
|
8
|
+
var pluginKey = new _state.PluginKey('compositionPlugin');
|
|
9
|
+
exports.pluginKey = pluginKey;
|
|
@@ -191,12 +191,6 @@ Object.defineProperty(exports, "historyPlugin", {
|
|
|
191
191
|
return _history.default;
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
|
-
Object.defineProperty(exports, "imageUploadPlugin", {
|
|
195
|
-
enumerable: true,
|
|
196
|
-
get: function get() {
|
|
197
|
-
return _imageUpload.default;
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
194
|
Object.defineProperty(exports, "indentationPlugin", {
|
|
201
195
|
enumerable: true,
|
|
202
196
|
get: function get() {
|
|
@@ -388,7 +382,6 @@ var _emoji = _interopRequireDefault(require("./emoji"));
|
|
|
388
382
|
var _extension = _interopRequireDefault(require("./extension"));
|
|
389
383
|
var _fakeTextCursor = _interopRequireDefault(require("./fake-text-cursor"));
|
|
390
384
|
var _helpDialog = _interopRequireDefault(require("./help-dialog"));
|
|
391
|
-
var _imageUpload = _interopRequireDefault(require("./image-upload"));
|
|
392
385
|
var _insertBlock = _interopRequireDefault(require("./insert-block"));
|
|
393
386
|
var _jiraIssue = _interopRequireDefault(require("./jira-issue"));
|
|
394
387
|
var _layout = _interopRequireDefault(require("./layout"));
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -21,7 +20,7 @@ var _editorMarkdownTransformer = require("@atlaskit/editor-markdown-transformer"
|
|
|
21
20
|
var _card = require("@atlaskit/editor-common/card");
|
|
22
21
|
var _slice = require("../../../utils/slice");
|
|
23
22
|
var _extensions = require("@atlaskit/editor-common/extensions");
|
|
24
|
-
var
|
|
23
|
+
var _paste = require("@atlaskit/editor-common/paste");
|
|
25
24
|
var _mediaSingle = require("../../media/utils/media-single");
|
|
26
25
|
var _util = require("../util");
|
|
27
26
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -33,7 +32,6 @@ var _analytics2 = require("../../analytics");
|
|
|
33
32
|
var _utils4 = require("../../../utils");
|
|
34
33
|
var _mediaCommon = require("../../media/utils/media-common");
|
|
35
34
|
var _commands = require("../commands");
|
|
36
|
-
var _paste = require("@atlaskit/editor-common/paste");
|
|
37
35
|
var _utils5 = require("../../tasks-and-decisions/utils");
|
|
38
36
|
var _utils6 = require("../../annotation/utils");
|
|
39
37
|
var _clipboardTextSerializer = require("./clipboard-text-serializer");
|
|
@@ -42,8 +40,6 @@ var _utils7 = require("@atlaskit/editor-tables/utils");
|
|
|
42
40
|
var _step = require("../../../utils/step");
|
|
43
41
|
var _pluginFactory = require("./plugin-factory");
|
|
44
42
|
var _utils8 = require("@atlaskit/editor-prosemirror/utils");
|
|
45
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
46
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
47
43
|
function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pluginInjectionApi, cardOptions, sanitizePrivateContent, providerFactory) {
|
|
48
44
|
var atlassianMarkDownParser = new _editorMarkdownTransformer.MarkdownTransformer(schema, _paste.md);
|
|
49
45
|
function getMarkdownSlice(text, openStart, openEnd) {
|
|
@@ -134,7 +130,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
134
130
|
if ((_text = text) !== null && _text !== void 0 && _text.includes('\r')) {
|
|
135
131
|
text = text.replace(/\r/g, '');
|
|
136
132
|
}
|
|
137
|
-
var isPastedFile =
|
|
133
|
+
var isPastedFile = (0, _paste.isPastedFile)(event);
|
|
138
134
|
var isPlainText = text && !html;
|
|
139
135
|
var isRichText = !!html;
|
|
140
136
|
|
|
@@ -11,7 +11,6 @@ var _utils = require("@atlaskit/editor-common/utils");
|
|
|
11
11
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
12
12
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
13
13
|
var _utils2 = require("../type-ahead/utils");
|
|
14
|
-
var _composition = require("../base/pm-plugins/composition");
|
|
15
14
|
var pluginKey = new _state.PluginKey('placeholderPlugin');
|
|
16
15
|
exports.pluginKey = pluginKey;
|
|
17
16
|
function getPlaceholderState(editorState) {
|
|
@@ -108,7 +107,8 @@ function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api) {
|
|
|
108
107
|
hasPlaceholder = _getPlaceholderState.hasPlaceholder,
|
|
109
108
|
placeholderText = _getPlaceholderState.placeholderText,
|
|
110
109
|
pos = _getPlaceholderState.pos;
|
|
111
|
-
|
|
110
|
+
var compositionPluginState = api === null || api === void 0 ? void 0 : api.dependencies.composition.sharedState.currentState();
|
|
111
|
+
if (hasPlaceholder && placeholderText && pos !== undefined && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
|
|
112
112
|
return createPlaceholderDecoration(editorState, placeholderText, pos);
|
|
113
113
|
}
|
|
114
114
|
return;
|
|
@@ -5,35 +5,13 @@ var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
9
|
-
exports.isClipboardEvent = exports.copyToClipboard = exports.copyHTMLToClipboardPolyfill = exports.copyHTMLToClipboard = void 0;
|
|
10
|
-
exports.isPastedFile = isPastedFile;
|
|
8
|
+
exports.copyToClipboard = exports.copyHTMLToClipboardPolyfill = exports.copyHTMLToClipboard = void 0;
|
|
11
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
12
10
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
14
12
|
var clipboard = _interopRequireWildcard(require("clipboard-polyfill"));
|
|
15
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
-
function checkClipboardTypes(type, item) {
|
|
18
|
-
var isDOMStringList = function isDOMStringList(t) {
|
|
19
|
-
return !t.indexOf && !!t.contains;
|
|
20
|
-
};
|
|
21
|
-
return isDOMStringList(type) ? type.contains(item) : type.indexOf(item) > -1;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// Typeguard Function
|
|
25
|
-
var isClipboardEvent = function isClipboardEvent(event) {
|
|
26
|
-
return 'clipboardData' in event;
|
|
27
|
-
};
|
|
28
|
-
exports.isClipboardEvent = isClipboardEvent;
|
|
29
|
-
function isPastedFile(rawEvent) {
|
|
30
|
-
var _ref = rawEvent,
|
|
31
|
-
clipboardData = _ref.clipboardData;
|
|
32
|
-
if (!clipboardData) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
return checkClipboardTypes(clipboardData.types, 'Files');
|
|
36
|
-
}
|
|
37
15
|
var isClipboardApiSupported = function isClipboardApiSupported() {
|
|
38
16
|
return !!navigator.clipboard && typeof navigator.clipboard.writeText === 'function';
|
|
39
17
|
};
|
|
@@ -41,7 +19,7 @@ var isIEClipboardApiSupported = function isIEClipboardApiSupported() {
|
|
|
41
19
|
return window.clipboardData && typeof window.clipboardData.setData === 'function';
|
|
42
20
|
};
|
|
43
21
|
var copyToClipboard = /*#__PURE__*/function () {
|
|
44
|
-
var
|
|
22
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(textToCopy) {
|
|
45
23
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
46
24
|
while (1) switch (_context.prev = _context.next) {
|
|
47
25
|
case 0:
|
|
@@ -89,12 +67,12 @@ var copyToClipboard = /*#__PURE__*/function () {
|
|
|
89
67
|
}, _callee, null, [[1, 6], [12, 17]]);
|
|
90
68
|
}));
|
|
91
69
|
return function copyToClipboard(_x) {
|
|
92
|
-
return
|
|
70
|
+
return _ref.apply(this, arguments);
|
|
93
71
|
};
|
|
94
72
|
}();
|
|
95
73
|
exports.copyToClipboard = copyToClipboard;
|
|
96
74
|
var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
97
|
-
var
|
|
75
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(elementToCopy, plainTextToCopy) {
|
|
98
76
|
var data;
|
|
99
77
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
100
78
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -137,7 +115,7 @@ var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
|
137
115
|
}, _callee2, null, [[1, 7]]);
|
|
138
116
|
}));
|
|
139
117
|
return function copyHTMLToClipboard(_x2, _x3) {
|
|
140
|
-
return
|
|
118
|
+
return _ref2.apply(this, arguments);
|
|
141
119
|
};
|
|
142
120
|
}();
|
|
143
121
|
|
|
@@ -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.19.0";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
package/dist/cjs/version.json
CHANGED
|
@@ -20,6 +20,7 @@ import { analyticsPlugin as deprecatedAnalyticsPlugin } from '../../../plugins';
|
|
|
20
20
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
21
21
|
import placeholderPlugin from '../../../plugins/placeholder';
|
|
22
22
|
import annotationPlugin from '../../../plugins/annotation';
|
|
23
|
+
import compositionPlugin from '../../../plugins/composition';
|
|
23
24
|
import quickInsertPlugin from '../../../plugins/quick-insert';
|
|
24
25
|
import selectionPlugin from '../../../plugins/selection';
|
|
25
26
|
import codeBlockPlugin from '../../../plugins/code-block';
|
|
@@ -57,7 +58,7 @@ export function createDefaultPreset(options) {
|
|
|
57
58
|
}]);
|
|
58
59
|
}
|
|
59
60
|
return builder;
|
|
60
|
-
}).add([pastePlugin, options.paste]).add(clipboardPlugin).add(focusPlugin).add([basePlugin, options.base]).add(decorationsPlugin).maybeAdd(undoRedoPlugin, (p, builder) => {
|
|
61
|
+
}).add([pastePlugin, options.paste]).add(clipboardPlugin).add(focusPlugin).add(compositionPlugin).add([basePlugin, options.base]).add(decorationsPlugin).maybeAdd(undoRedoPlugin, (p, builder) => {
|
|
61
62
|
var _options$featureFlags;
|
|
62
63
|
// The undo redo plugin needs to be add before the blockTypePlugin
|
|
63
64
|
if ((_options$featureFlags = options.featureFlags) !== null && _options$featureFlags !== void 0 && _options$featureFlags.undoRedoButtons) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createEditorSelectionAPI } from '../../../selection-api/api';
|
|
2
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin,
|
|
2
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, datePlugin, emojiPlugin, extensionPlugin, fragmentMarkPlugin, helpDialogPlugin, insertBlockPlugin, jiraIssuePlugin, layoutPlugin, listPlugin, toolbarListsIndentationPlugin, macroPlugin, maxContentSizePlugin, mediaPlugin, mentionsPlugin, panelPlugin, placeholderTextPlugin, rulePlugin, saveOnEnterPlugin, tasksAndDecisionsPlugin, textColorPlugin, statusPlugin, alignmentPlugin, indentationPlugin, customAutoformatPlugin, feedbackDialogPlugin, historyPlugin, expandPlugin, isExpandInsertionEnabled, scrollIntoViewPlugin, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, captionPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin, copyButtonPlugin, borderPlugin } from '../../../plugins';
|
|
3
|
+
import { imageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
|
|
3
4
|
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
4
5
|
import { contextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
5
6
|
import { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
@@ -11,7 +11,6 @@ import inlineCursorTargetPlugin from './pm-plugins/inline-cursor-target';
|
|
|
11
11
|
import scrollGutter from './pm-plugins/scroll-gutter';
|
|
12
12
|
import { keymap } from '@atlaskit/editor-common/keymaps';
|
|
13
13
|
import frozenEditor from './pm-plugins/frozen-editor';
|
|
14
|
-
import compositionPlugin from './pm-plugins/composition';
|
|
15
14
|
// Chrome >= 88
|
|
16
15
|
export const isChromeWithSelectionBug = browser.chrome && browser.chrome_version >= 88;
|
|
17
16
|
const basePlugin = (options, api) => {
|
|
@@ -85,10 +84,6 @@ const basePlugin = (options, api) => {
|
|
|
85
84
|
name: 'disableSpellcheckingPlugin',
|
|
86
85
|
plugin: () => disableSpellcheckingPlugin(featureFlags)
|
|
87
86
|
});
|
|
88
|
-
plugins.push({
|
|
89
|
-
name: 'compositionPlugin',
|
|
90
|
-
plugin: () => compositionPlugin()
|
|
91
|
-
});
|
|
92
87
|
return plugins;
|
|
93
88
|
},
|
|
94
89
|
nodes() {
|