@atlaskit/editor-core 187.25.1 → 187.25.2
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 +7 -0
- package/dist/cjs/labs/next/presets/default.js +2 -2
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +2 -1
- package/dist/cjs/plugins/placeholder/index.js +6 -5
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +2 -1
- package/dist/es2019/plugins/placeholder/index.js +6 -5
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +2 -1
- package/dist/esm/plugins/placeholder/index.js +6 -5
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/labs/next/presets/default.d.ts +8 -8
- package/dist/types/plugins/code-block/index.d.ts +1 -1
- package/dist/types/plugins/placeholder/index.d.ts +1 -1
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +8 -8
- package/dist/types-ts4.5/plugins/code-block/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/placeholder/index.d.ts +1 -1
- package/package.json +2 -1
- package/dist/cjs/plugins/composition/index.js +0 -33
- package/dist/cjs/plugins/composition/pm-plugins/main.js +0 -69
- package/dist/cjs/plugins/composition/pm-plugins/plugin-key.js +0 -9
- package/dist/es2019/plugins/composition/index.js +0 -23
- package/dist/es2019/plugins/composition/pm-plugins/main.js +0 -60
- package/dist/es2019/plugins/composition/pm-plugins/plugin-key.js +0 -2
- package/dist/esm/plugins/composition/index.js +0 -25
- package/dist/esm/plugins/composition/pm-plugins/main.js +0 -62
- package/dist/esm/plugins/composition/pm-plugins/plugin-key.js +0 -2
- package/dist/types/plugins/composition/index.d.ts +0 -8
- package/dist/types/plugins/composition/pm-plugins/main.d.ts +0 -4
- package/dist/types/plugins/composition/pm-plugins/plugin-key.d.ts +0 -6
- package/dist/types-ts4.5/plugins/composition/index.d.ts +0 -8
- package/dist/types-ts4.5/plugins/composition/pm-plugins/main.d.ts +0 -4
- package/dist/types-ts4.5/plugins/composition/pm-plugins/plugin-key.d.ts +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -26,7 +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
|
|
29
|
+
var _editorPluginComposition = require("@atlaskit/editor-plugin-composition");
|
|
30
30
|
var _quickInsert = _interopRequireDefault(require("../../../plugins/quick-insert"));
|
|
31
31
|
var _selection = _interopRequireDefault(require("../../../plugins/selection"));
|
|
32
32
|
var _codeBlock = _interopRequireDefault(require("../../../plugins/code-block"));
|
|
@@ -62,7 +62,7 @@ function createDefaultPreset(options) {
|
|
|
62
62
|
}]);
|
|
63
63
|
}
|
|
64
64
|
return builder;
|
|
65
|
-
}).add([_paste.default, options.paste]).add(_clipboard.default).add(_editorPluginFocus.focusPlugin).add(
|
|
65
|
+
}).add([_paste.default, options.paste]).add(_clipboard.default).add(_editorPluginFocus.focusPlugin).add(_editorPluginComposition.compositionPlugin).add([_base.default, options.base]).add(_editorPluginDecorations.decorationsPlugin).maybeAdd(_undoRedo.default, function (p, builder) {
|
|
66
66
|
var _options$featureFlags;
|
|
67
67
|
// The undo redo plugin needs to be add before the blockTypePlugin
|
|
68
68
|
if ((_options$featureFlags = options.featureFlags) !== null && _options$featureFlags !== void 0 && _options$featureFlags.undoRedoButtons) {
|
|
@@ -19,9 +19,10 @@ var ideUX = function ideUX(pluginInjectionApi) {
|
|
|
19
19
|
return new _safePlugin.SafePlugin({
|
|
20
20
|
props: {
|
|
21
21
|
handleTextInput: function handleTextInput(view, from, to, text) {
|
|
22
|
+
var _pluginInjectionApi$d;
|
|
22
23
|
var state = view.state,
|
|
23
24
|
dispatch = view.dispatch;
|
|
24
|
-
var compositionPluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.composition.sharedState.currentState();
|
|
25
|
+
var compositionPluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.composition) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.sharedState.currentState();
|
|
25
26
|
if ((0, _lineHandling.isCursorInsideCodeBlock)(state) && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
|
|
26
27
|
var beforeText = (0, _lineHandling.getStartOfCurrentLine)(state).text;
|
|
27
28
|
var afterText = (0, _lineHandling.getEndOfCurrentLine)(state).text;
|
|
@@ -83,13 +83,13 @@ function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api) {
|
|
|
83
83
|
key: pluginKey,
|
|
84
84
|
state: {
|
|
85
85
|
init: function init(_, state) {
|
|
86
|
-
var _api$dependencies$foc;
|
|
87
|
-
return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$dependencies$foc = api.dependencies.focus.sharedState.currentState()) === null || _api$dependencies$
|
|
86
|
+
var _api$dependencies$foc, _api$dependencies$foc2;
|
|
87
|
+
return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$dependencies$foc = api.dependencies.focus) === null || _api$dependencies$foc === void 0 ? void 0 : (_api$dependencies$foc2 = _api$dependencies$foc.sharedState.currentState()) === null || _api$dependencies$foc2 === void 0 ? void 0 : _api$dependencies$foc2.hasFocus), state, defaultPlaceholderText, bracketPlaceholderText);
|
|
88
88
|
},
|
|
89
89
|
apply: function apply(tr, _oldPluginState, _oldEditorState, newEditorState) {
|
|
90
|
-
var _api$dependencies$
|
|
90
|
+
var _api$dependencies$foc3, _api$dependencies$foc4;
|
|
91
91
|
var meta = tr.getMeta(pluginKey);
|
|
92
|
-
var isEditorFocused = Boolean(api === null || api === void 0 ? void 0 : (_api$dependencies$
|
|
92
|
+
var isEditorFocused = Boolean(api === null || api === void 0 ? void 0 : (_api$dependencies$foc3 = api.dependencies.focus) === null || _api$dependencies$foc3 === void 0 ? void 0 : (_api$dependencies$foc4 = _api$dependencies$foc3.sharedState.currentState()) === null || _api$dependencies$foc4 === void 0 ? void 0 : _api$dependencies$foc4.hasFocus);
|
|
93
93
|
if (meta) {
|
|
94
94
|
if (meta.removePlaceholder) {
|
|
95
95
|
return emptyPlaceholder;
|
|
@@ -103,11 +103,12 @@ function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api) {
|
|
|
103
103
|
},
|
|
104
104
|
props: {
|
|
105
105
|
decorations: function decorations(editorState) {
|
|
106
|
+
var _api$dependencies$com;
|
|
106
107
|
var _getPlaceholderState = getPlaceholderState(editorState),
|
|
107
108
|
hasPlaceholder = _getPlaceholderState.hasPlaceholder,
|
|
108
109
|
placeholderText = _getPlaceholderState.placeholderText,
|
|
109
110
|
pos = _getPlaceholderState.pos;
|
|
110
|
-
var compositionPluginState = api === null || api === void 0 ? void 0 : api.dependencies.composition.sharedState.currentState();
|
|
111
|
+
var compositionPluginState = api === null || api === void 0 ? void 0 : (_api$dependencies$com = api.dependencies.composition) === null || _api$dependencies$com === void 0 ? void 0 : _api$dependencies$com.sharedState.currentState();
|
|
111
112
|
if (hasPlaceholder && placeholderText && pos !== undefined && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
|
|
112
113
|
return createPlaceholderDecoration(editorState, placeholderText, pos);
|
|
113
114
|
}
|
|
@@ -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.25.
|
|
9
|
+
var version = "187.25.2";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
@@ -20,7 +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 '
|
|
23
|
+
import { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
24
24
|
import quickInsertPlugin from '../../../plugins/quick-insert';
|
|
25
25
|
import selectionPlugin from '../../../plugins/selection';
|
|
26
26
|
import codeBlockPlugin from '../../../plugins/code-block';
|
|
@@ -13,11 +13,12 @@ const ideUX = pluginInjectionApi => {
|
|
|
13
13
|
return new SafePlugin({
|
|
14
14
|
props: {
|
|
15
15
|
handleTextInput(view, from, to, text) {
|
|
16
|
+
var _pluginInjectionApi$d;
|
|
16
17
|
const {
|
|
17
18
|
state,
|
|
18
19
|
dispatch
|
|
19
20
|
} = view;
|
|
20
|
-
const compositionPluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.composition.sharedState.currentState();
|
|
21
|
+
const compositionPluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.composition) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.sharedState.currentState();
|
|
21
22
|
if (isCursorInsideCodeBlock(state) && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
|
|
22
23
|
const beforeText = getStartOfCurrentLine(state).text;
|
|
23
24
|
const afterText = getEndOfCurrentLine(state).text;
|
|
@@ -74,13 +74,13 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
|
|
|
74
74
|
key: pluginKey,
|
|
75
75
|
state: {
|
|
76
76
|
init: (_, state) => {
|
|
77
|
-
var _api$dependencies$foc;
|
|
78
|
-
return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$dependencies$foc = api.dependencies.focus.sharedState.currentState()) === null || _api$dependencies$
|
|
77
|
+
var _api$dependencies$foc, _api$dependencies$foc2;
|
|
78
|
+
return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$dependencies$foc = api.dependencies.focus) === null || _api$dependencies$foc === void 0 ? void 0 : (_api$dependencies$foc2 = _api$dependencies$foc.sharedState.currentState()) === null || _api$dependencies$foc2 === void 0 ? void 0 : _api$dependencies$foc2.hasFocus), state, defaultPlaceholderText, bracketPlaceholderText);
|
|
79
79
|
},
|
|
80
80
|
apply: (tr, _oldPluginState, _oldEditorState, newEditorState) => {
|
|
81
|
-
var _api$dependencies$
|
|
81
|
+
var _api$dependencies$foc3, _api$dependencies$foc4;
|
|
82
82
|
const meta = tr.getMeta(pluginKey);
|
|
83
|
-
const isEditorFocused = Boolean(api === null || api === void 0 ? void 0 : (_api$dependencies$
|
|
83
|
+
const isEditorFocused = Boolean(api === null || api === void 0 ? void 0 : (_api$dependencies$foc3 = api.dependencies.focus) === null || _api$dependencies$foc3 === void 0 ? void 0 : (_api$dependencies$foc4 = _api$dependencies$foc3.sharedState.currentState()) === null || _api$dependencies$foc4 === void 0 ? void 0 : _api$dependencies$foc4.hasFocus);
|
|
84
84
|
if (meta) {
|
|
85
85
|
if (meta.removePlaceholder) {
|
|
86
86
|
return emptyPlaceholder;
|
|
@@ -94,12 +94,13 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
|
|
|
94
94
|
},
|
|
95
95
|
props: {
|
|
96
96
|
decorations(editorState) {
|
|
97
|
+
var _api$dependencies$com;
|
|
97
98
|
const {
|
|
98
99
|
hasPlaceholder,
|
|
99
100
|
placeholderText,
|
|
100
101
|
pos
|
|
101
102
|
} = getPlaceholderState(editorState);
|
|
102
|
-
const compositionPluginState = api === null || api === void 0 ? void 0 : api.dependencies.composition.sharedState.currentState();
|
|
103
|
+
const compositionPluginState = api === null || api === void 0 ? void 0 : (_api$dependencies$com = api.dependencies.composition) === null || _api$dependencies$com === void 0 ? void 0 : _api$dependencies$com.sharedState.currentState();
|
|
103
104
|
if (hasPlaceholder && placeholderText && pos !== undefined && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
|
|
104
105
|
return createPlaceholderDecoration(editorState, placeholderText, pos);
|
|
105
106
|
}
|
|
@@ -20,7 +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 '
|
|
23
|
+
import { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
24
24
|
import quickInsertPlugin from '../../../plugins/quick-insert';
|
|
25
25
|
import selectionPlugin from '../../../plugins/selection';
|
|
26
26
|
import codeBlockPlugin from '../../../plugins/code-block';
|
|
@@ -13,9 +13,10 @@ var ideUX = function ideUX(pluginInjectionApi) {
|
|
|
13
13
|
return new SafePlugin({
|
|
14
14
|
props: {
|
|
15
15
|
handleTextInput: function handleTextInput(view, from, to, text) {
|
|
16
|
+
var _pluginInjectionApi$d;
|
|
16
17
|
var state = view.state,
|
|
17
18
|
dispatch = view.dispatch;
|
|
18
|
-
var compositionPluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.dependencies.composition.sharedState.currentState();
|
|
19
|
+
var compositionPluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.composition) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.sharedState.currentState();
|
|
19
20
|
if (isCursorInsideCodeBlock(state) && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
|
|
20
21
|
var beforeText = getStartOfCurrentLine(state).text;
|
|
21
22
|
var afterText = getEndOfCurrentLine(state).text;
|
|
@@ -73,13 +73,13 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
|
|
|
73
73
|
key: pluginKey,
|
|
74
74
|
state: {
|
|
75
75
|
init: function init(_, state) {
|
|
76
|
-
var _api$dependencies$foc;
|
|
77
|
-
return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$dependencies$foc = api.dependencies.focus.sharedState.currentState()) === null || _api$dependencies$
|
|
76
|
+
var _api$dependencies$foc, _api$dependencies$foc2;
|
|
77
|
+
return createPlaceHolderStateFrom(Boolean(api === null || api === void 0 ? void 0 : (_api$dependencies$foc = api.dependencies.focus) === null || _api$dependencies$foc === void 0 ? void 0 : (_api$dependencies$foc2 = _api$dependencies$foc.sharedState.currentState()) === null || _api$dependencies$foc2 === void 0 ? void 0 : _api$dependencies$foc2.hasFocus), state, defaultPlaceholderText, bracketPlaceholderText);
|
|
78
78
|
},
|
|
79
79
|
apply: function apply(tr, _oldPluginState, _oldEditorState, newEditorState) {
|
|
80
|
-
var _api$dependencies$
|
|
80
|
+
var _api$dependencies$foc3, _api$dependencies$foc4;
|
|
81
81
|
var meta = tr.getMeta(pluginKey);
|
|
82
|
-
var isEditorFocused = Boolean(api === null || api === void 0 ? void 0 : (_api$dependencies$
|
|
82
|
+
var isEditorFocused = Boolean(api === null || api === void 0 ? void 0 : (_api$dependencies$foc3 = api.dependencies.focus) === null || _api$dependencies$foc3 === void 0 ? void 0 : (_api$dependencies$foc4 = _api$dependencies$foc3.sharedState.currentState()) === null || _api$dependencies$foc4 === void 0 ? void 0 : _api$dependencies$foc4.hasFocus);
|
|
83
83
|
if (meta) {
|
|
84
84
|
if (meta.removePlaceholder) {
|
|
85
85
|
return emptyPlaceholder;
|
|
@@ -93,11 +93,12 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
|
|
|
93
93
|
},
|
|
94
94
|
props: {
|
|
95
95
|
decorations: function decorations(editorState) {
|
|
96
|
+
var _api$dependencies$com;
|
|
96
97
|
var _getPlaceholderState = getPlaceholderState(editorState),
|
|
97
98
|
hasPlaceholder = _getPlaceholderState.hasPlaceholder,
|
|
98
99
|
placeholderText = _getPlaceholderState.placeholderText,
|
|
99
100
|
pos = _getPlaceholderState.pos;
|
|
100
|
-
var compositionPluginState = api === null || api === void 0 ? void 0 : api.dependencies.composition.sharedState.currentState();
|
|
101
|
+
var compositionPluginState = api === null || api === void 0 ? void 0 : (_api$dependencies$com = api.dependencies.composition) === null || _api$dependencies$com === void 0 ? void 0 : _api$dependencies$com.sharedState.currentState();
|
|
101
102
|
if (hasPlaceholder && placeholderText && pos !== undefined && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
|
|
102
103
|
return createPlaceholderDecoration(editorState, placeholderText, pos);
|
|
103
104
|
}
|
|
@@ -50,9 +50,9 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
50
50
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
51
51
|
};
|
|
52
52
|
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
53
|
-
sharedState: import("
|
|
53
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
54
54
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
55
|
-
sharedState: import("
|
|
55
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
56
56
|
}>, import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
57
57
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
58
58
|
sharedState: {
|
|
@@ -97,9 +97,9 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
97
97
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
98
98
|
};
|
|
99
99
|
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
100
|
-
sharedState: import("
|
|
100
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
101
101
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
102
|
-
sharedState: import("
|
|
102
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
103
103
|
}>, import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
104
104
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
105
105
|
sharedState: {
|
|
@@ -435,9 +435,9 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
435
435
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
436
436
|
};
|
|
437
437
|
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
438
|
-
sharedState: import("
|
|
438
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
439
439
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
440
|
-
sharedState: import("
|
|
440
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
441
441
|
}>, import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
442
442
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
443
443
|
sharedState: {
|
|
@@ -482,9 +482,9 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
482
482
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
483
483
|
};
|
|
484
484
|
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
485
|
-
sharedState: import("
|
|
485
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
486
486
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
487
|
-
sharedState: import("
|
|
487
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
488
488
|
}>, import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
489
489
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
490
490
|
sharedState: {
|
|
@@ -2,7 +2,7 @@ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/t
|
|
|
2
2
|
import type { CodeBlockOptions } from './types';
|
|
3
3
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
4
4
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
5
|
-
import type compositionPlugin from '
|
|
5
|
+
import type { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
6
6
|
declare const codeBlockPlugin: NextEditorPlugin<'codeBlock', {
|
|
7
7
|
pluginConfiguration: CodeBlockOptions;
|
|
8
8
|
dependencies: [
|
|
@@ -5,7 +5,7 @@ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
|
5
5
|
import type { NextEditorPlugin, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { focusPlugin } from '@atlaskit/editor-plugin-focus';
|
|
7
7
|
export declare const pluginKey: PluginKey<any>;
|
|
8
|
-
import type compositionPlugin from '
|
|
8
|
+
import type { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
9
9
|
export declare const placeholderTestId = "placeholder-test-id";
|
|
10
10
|
export declare function createPlaceholderDecoration(editorState: EditorState, placeholderText: string, pos?: number): DecorationSet;
|
|
11
11
|
export declare function createPlugin(defaultPlaceholderText?: string, bracketPlaceholderText?: string, api?: ExtractInjectionAPI<typeof placeholderPlugin>): SafePlugin | undefined;
|
|
@@ -67,9 +67,9 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
67
67
|
};
|
|
68
68
|
}>,
|
|
69
69
|
(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
70
|
-
sharedState: import("
|
|
70
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
71
71
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
72
|
-
sharedState: import("
|
|
72
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
73
73
|
}>,
|
|
74
74
|
import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
75
75
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
@@ -122,9 +122,9 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
122
122
|
};
|
|
123
123
|
}>,
|
|
124
124
|
(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
125
|
-
sharedState: import("
|
|
125
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
126
126
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
127
|
-
sharedState: import("
|
|
127
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
128
128
|
}>,
|
|
129
129
|
import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
130
130
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
@@ -532,9 +532,9 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
532
532
|
};
|
|
533
533
|
}>,
|
|
534
534
|
(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
535
|
-
sharedState: import("
|
|
535
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
536
536
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
537
|
-
sharedState: import("
|
|
537
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
538
538
|
}>,
|
|
539
539
|
import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
540
540
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
@@ -587,9 +587,9 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
587
587
|
};
|
|
588
588
|
}>,
|
|
589
589
|
(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
590
|
-
sharedState: import("
|
|
590
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
591
591
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
592
|
-
sharedState: import("
|
|
592
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
593
593
|
}>,
|
|
594
594
|
import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
595
595
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
@@ -2,7 +2,7 @@ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/t
|
|
|
2
2
|
import type { CodeBlockOptions } from './types';
|
|
3
3
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
4
4
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
5
|
-
import type compositionPlugin from '
|
|
5
|
+
import type { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
6
6
|
declare const codeBlockPlugin: NextEditorPlugin<'codeBlock', {
|
|
7
7
|
pluginConfiguration: CodeBlockOptions;
|
|
8
8
|
dependencies: [
|
|
@@ -5,7 +5,7 @@ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
|
5
5
|
import type { NextEditorPlugin, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { focusPlugin } from '@atlaskit/editor-plugin-focus';
|
|
7
7
|
export declare const pluginKey: PluginKey<any>;
|
|
8
|
-
import type compositionPlugin from '
|
|
8
|
+
import type { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
9
9
|
export declare const placeholderTestId = "placeholder-test-id";
|
|
10
10
|
export declare function createPlaceholderDecoration(editorState: EditorState, placeholderText: string, pos?: number): DecorationSet;
|
|
11
11
|
export declare function createPlugin(defaultPlaceholderText?: string, bracketPlaceholderText?: string, api?: ExtractInjectionAPI<typeof placeholderPlugin>): SafePlugin | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "187.25.
|
|
3
|
+
"version": "187.25.2",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"@atlaskit/editor-palette": "1.5.1",
|
|
62
62
|
"@atlaskit/editor-plugin-analytics": "^0.1.0",
|
|
63
63
|
"@atlaskit/editor-plugin-card": "^0.4.0",
|
|
64
|
+
"@atlaskit/editor-plugin-composition": "^0.0.1",
|
|
64
65
|
"@atlaskit/editor-plugin-content-insertion": "^0.0.8",
|
|
65
66
|
"@atlaskit/editor-plugin-context-panel": "^0.1.0",
|
|
66
67
|
"@atlaskit/editor-plugin-decorations": "^0.1.0",
|
|
@@ -1,33 +0,0 @@
|
|
|
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;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
|
-
var _pluginKey = require("./plugin-key");
|
|
10
|
-
var isLinux = function isLinux() {
|
|
11
|
-
return navigator.userAgent.indexOf('Linux') >= 0;
|
|
12
|
-
};
|
|
13
|
-
var _default = function _default() {
|
|
14
|
-
return new _safePlugin.SafePlugin({
|
|
15
|
-
key: _pluginKey.pluginKey,
|
|
16
|
-
state: {
|
|
17
|
-
init: function init() {
|
|
18
|
-
return {
|
|
19
|
-
isComposing: false,
|
|
20
|
-
zeroWidthSpacePos: undefined
|
|
21
|
-
};
|
|
22
|
-
},
|
|
23
|
-
apply: function apply(tr, value) {
|
|
24
|
-
var isComposing = tr.getMeta(_pluginKey.pluginKey);
|
|
25
|
-
var zeroWidthSpacePos = tr.getMeta('zeroWidthSpacePos');
|
|
26
|
-
if (typeof isComposing === 'undefined') {
|
|
27
|
-
return value;
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
isComposing: isComposing,
|
|
31
|
-
zeroWidthSpacePos: zeroWidthSpacePos
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
props: {
|
|
36
|
-
handleDOMEvents: {
|
|
37
|
-
compositionstart: function compositionstart(view, event) {
|
|
38
|
-
var tr = view.state.tr;
|
|
39
|
-
tr.setMeta(_pluginKey.pluginKey, true);
|
|
40
|
-
|
|
41
|
-
// only apply for linux and cursor is at start of line
|
|
42
|
-
if (isLinux() && view.state.selection.$from.parentOffset === 0) {
|
|
43
|
-
tr.insertText(_utils.ZERO_WIDTH_SPACE);
|
|
44
|
-
|
|
45
|
-
// remember the position of inserted zero width space
|
|
46
|
-
tr.setMeta('zeroWidthSpacePos', view.state.selection.$from.pos);
|
|
47
|
-
}
|
|
48
|
-
view.dispatch(tr);
|
|
49
|
-
return false;
|
|
50
|
-
},
|
|
51
|
-
compositionend: function compositionend(view, event) {
|
|
52
|
-
var tr = view.state.tr;
|
|
53
|
-
tr.setMeta(_pluginKey.pluginKey, false);
|
|
54
|
-
if (isLinux()) {
|
|
55
|
-
var _pluginKey$getState;
|
|
56
|
-
var zeroWidthSpacePos = (_pluginKey$getState = _pluginKey.pluginKey.getState(view.state)) === null || _pluginKey$getState === void 0 ? void 0 : _pluginKey$getState.zeroWidthSpacePos;
|
|
57
|
-
if (typeof zeroWidthSpacePos !== 'undefined') {
|
|
58
|
-
tr.deleteRange(zeroWidthSpacePos, zeroWidthSpacePos + 1);
|
|
59
|
-
}
|
|
60
|
-
tr.setMeta('zeroWidthSpacePos', undefined);
|
|
61
|
-
}
|
|
62
|
-
view.dispatch(tr);
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
exports.default = _default;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.pluginKey = void 0;
|
|
7
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
-
var pluginKey = new _state.PluginKey('compositionPlugin');
|
|
9
|
-
exports.pluginKey = pluginKey;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import createPlugin from './pm-plugins/main';
|
|
2
|
-
import { pluginKey } from './pm-plugins/plugin-key';
|
|
3
|
-
const composition = () => {
|
|
4
|
-
return {
|
|
5
|
-
name: 'composition',
|
|
6
|
-
getSharedState(editorState) {
|
|
7
|
-
var _pluginKey$getState;
|
|
8
|
-
if (!editorState) {
|
|
9
|
-
return undefined;
|
|
10
|
-
}
|
|
11
|
-
return {
|
|
12
|
-
isComposing: !!((_pluginKey$getState = pluginKey.getState(editorState)) !== null && _pluginKey$getState !== void 0 && _pluginKey$getState.isComposing)
|
|
13
|
-
};
|
|
14
|
-
},
|
|
15
|
-
pmPlugins() {
|
|
16
|
-
return [{
|
|
17
|
-
name: 'composition',
|
|
18
|
-
plugin: () => createPlugin()
|
|
19
|
-
}];
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export default composition;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
|
|
3
|
-
import { pluginKey } from './plugin-key';
|
|
4
|
-
const isLinux = () => navigator.userAgent.indexOf('Linux') >= 0;
|
|
5
|
-
export default (() => new SafePlugin({
|
|
6
|
-
key: pluginKey,
|
|
7
|
-
state: {
|
|
8
|
-
init: () => ({
|
|
9
|
-
isComposing: false,
|
|
10
|
-
zeroWidthSpacePos: undefined
|
|
11
|
-
}),
|
|
12
|
-
apply: (tr, value) => {
|
|
13
|
-
const isComposing = tr.getMeta(pluginKey);
|
|
14
|
-
const zeroWidthSpacePos = tr.getMeta('zeroWidthSpacePos');
|
|
15
|
-
if (typeof isComposing === 'undefined') {
|
|
16
|
-
return value;
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
isComposing,
|
|
20
|
-
zeroWidthSpacePos
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
props: {
|
|
25
|
-
handleDOMEvents: {
|
|
26
|
-
compositionstart: (view, event) => {
|
|
27
|
-
const {
|
|
28
|
-
tr
|
|
29
|
-
} = view.state;
|
|
30
|
-
tr.setMeta(pluginKey, true);
|
|
31
|
-
|
|
32
|
-
// only apply for linux and cursor is at start of line
|
|
33
|
-
if (isLinux() && view.state.selection.$from.parentOffset === 0) {
|
|
34
|
-
tr.insertText(ZERO_WIDTH_SPACE);
|
|
35
|
-
|
|
36
|
-
// remember the position of inserted zero width space
|
|
37
|
-
tr.setMeta('zeroWidthSpacePos', view.state.selection.$from.pos);
|
|
38
|
-
}
|
|
39
|
-
view.dispatch(tr);
|
|
40
|
-
return false;
|
|
41
|
-
},
|
|
42
|
-
compositionend: (view, event) => {
|
|
43
|
-
const {
|
|
44
|
-
tr
|
|
45
|
-
} = view.state;
|
|
46
|
-
tr.setMeta(pluginKey, false);
|
|
47
|
-
if (isLinux()) {
|
|
48
|
-
var _pluginKey$getState;
|
|
49
|
-
const zeroWidthSpacePos = (_pluginKey$getState = pluginKey.getState(view.state)) === null || _pluginKey$getState === void 0 ? void 0 : _pluginKey$getState.zeroWidthSpacePos;
|
|
50
|
-
if (typeof zeroWidthSpacePos !== 'undefined') {
|
|
51
|
-
tr.deleteRange(zeroWidthSpacePos, zeroWidthSpacePos + 1);
|
|
52
|
-
}
|
|
53
|
-
tr.setMeta('zeroWidthSpacePos', undefined);
|
|
54
|
-
}
|
|
55
|
-
view.dispatch(tr);
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}));
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import createPlugin from './pm-plugins/main';
|
|
2
|
-
import { pluginKey } from './pm-plugins/plugin-key';
|
|
3
|
-
var composition = function composition() {
|
|
4
|
-
return {
|
|
5
|
-
name: 'composition',
|
|
6
|
-
getSharedState: function getSharedState(editorState) {
|
|
7
|
-
var _pluginKey$getState;
|
|
8
|
-
if (!editorState) {
|
|
9
|
-
return undefined;
|
|
10
|
-
}
|
|
11
|
-
return {
|
|
12
|
-
isComposing: !!((_pluginKey$getState = pluginKey.getState(editorState)) !== null && _pluginKey$getState !== void 0 && _pluginKey$getState.isComposing)
|
|
13
|
-
};
|
|
14
|
-
},
|
|
15
|
-
pmPlugins: function pmPlugins() {
|
|
16
|
-
return [{
|
|
17
|
-
name: 'composition',
|
|
18
|
-
plugin: function plugin() {
|
|
19
|
-
return createPlugin();
|
|
20
|
-
}
|
|
21
|
-
}];
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
export default composition;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
|
|
3
|
-
import { pluginKey } from './plugin-key';
|
|
4
|
-
var isLinux = function isLinux() {
|
|
5
|
-
return navigator.userAgent.indexOf('Linux') >= 0;
|
|
6
|
-
};
|
|
7
|
-
export default (function () {
|
|
8
|
-
return new SafePlugin({
|
|
9
|
-
key: pluginKey,
|
|
10
|
-
state: {
|
|
11
|
-
init: function init() {
|
|
12
|
-
return {
|
|
13
|
-
isComposing: false,
|
|
14
|
-
zeroWidthSpacePos: undefined
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
apply: function apply(tr, value) {
|
|
18
|
-
var isComposing = tr.getMeta(pluginKey);
|
|
19
|
-
var zeroWidthSpacePos = tr.getMeta('zeroWidthSpacePos');
|
|
20
|
-
if (typeof isComposing === 'undefined') {
|
|
21
|
-
return value;
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
isComposing: isComposing,
|
|
25
|
-
zeroWidthSpacePos: zeroWidthSpacePos
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
props: {
|
|
30
|
-
handleDOMEvents: {
|
|
31
|
-
compositionstart: function compositionstart(view, event) {
|
|
32
|
-
var tr = view.state.tr;
|
|
33
|
-
tr.setMeta(pluginKey, true);
|
|
34
|
-
|
|
35
|
-
// only apply for linux and cursor is at start of line
|
|
36
|
-
if (isLinux() && view.state.selection.$from.parentOffset === 0) {
|
|
37
|
-
tr.insertText(ZERO_WIDTH_SPACE);
|
|
38
|
-
|
|
39
|
-
// remember the position of inserted zero width space
|
|
40
|
-
tr.setMeta('zeroWidthSpacePos', view.state.selection.$from.pos);
|
|
41
|
-
}
|
|
42
|
-
view.dispatch(tr);
|
|
43
|
-
return false;
|
|
44
|
-
},
|
|
45
|
-
compositionend: function compositionend(view, event) {
|
|
46
|
-
var tr = view.state.tr;
|
|
47
|
-
tr.setMeta(pluginKey, false);
|
|
48
|
-
if (isLinux()) {
|
|
49
|
-
var _pluginKey$getState;
|
|
50
|
-
var zeroWidthSpacePos = (_pluginKey$getState = pluginKey.getState(view.state)) === null || _pluginKey$getState === void 0 ? void 0 : _pluginKey$getState.zeroWidthSpacePos;
|
|
51
|
-
if (typeof zeroWidthSpacePos !== 'undefined') {
|
|
52
|
-
tr.deleteRange(zeroWidthSpacePos, zeroWidthSpacePos + 1);
|
|
53
|
-
}
|
|
54
|
-
tr.setMeta('zeroWidthSpacePos', undefined);
|
|
55
|
-
}
|
|
56
|
-
view.dispatch(tr);
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
export type CompositionState = {
|
|
3
|
-
isComposing: boolean;
|
|
4
|
-
};
|
|
5
|
-
declare const composition: NextEditorPlugin<'composition', {
|
|
6
|
-
sharedState: CompositionState | undefined;
|
|
7
|
-
}>;
|
|
8
|
-
export default composition;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
export type CompositionState = {
|
|
3
|
-
isComposing: boolean;
|
|
4
|
-
};
|
|
5
|
-
declare const composition: NextEditorPlugin<'composition', {
|
|
6
|
-
sharedState: CompositionState | undefined;
|
|
7
|
-
}>;
|
|
8
|
-
export default composition;
|