@atlaskit/editor-core 187.18.2 → 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 +6 -0
- package/dist/cjs/labs/next/presets/default.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/composition/pm-plugins/plugin-key.js +9 -0
- package/dist/cjs/plugins/placeholder/index.js +2 -2
- 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/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/composition/pm-plugins/plugin-key.js +2 -0
- package/dist/es2019/plugins/placeholder/index.js +2 -2
- 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/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/composition/pm-plugins/plugin-key.js +2 -0
- package/dist/esm/plugins/placeholder/index.js +2 -2
- 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/placeholder/index.d.ts +2 -1
- 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/placeholder/index.d.ts +3 -1
- package/package.json +1 -1
- package/dist/types/plugins/base/pm-plugins/composition.d.ts +0 -9
- package/dist/types-ts4.5/plugins/base/pm-plugins/composition.d.ts +0 -9
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
2
|
import { ZERO_WIDTH_SPACE } from '@atlaskit/editor-common/utils';
|
|
4
|
-
|
|
5
|
-
export var isComposing = function isComposing(state) {
|
|
6
|
-
var _compositionPluginKey;
|
|
7
|
-
return !!((_compositionPluginKey = compositionPluginKey.getState(state)) !== null && _compositionPluginKey !== void 0 && _compositionPluginKey.isComposing);
|
|
8
|
-
};
|
|
3
|
+
import { pluginKey } from './plugin-key';
|
|
9
4
|
var isLinux = function isLinux() {
|
|
10
5
|
return navigator.userAgent.indexOf('Linux') >= 0;
|
|
11
6
|
};
|
|
12
7
|
export default (function () {
|
|
13
8
|
return new SafePlugin({
|
|
14
|
-
key:
|
|
9
|
+
key: pluginKey,
|
|
15
10
|
state: {
|
|
16
11
|
init: function init() {
|
|
17
12
|
return {
|
|
@@ -20,7 +15,7 @@ export default (function () {
|
|
|
20
15
|
};
|
|
21
16
|
},
|
|
22
17
|
apply: function apply(tr, value) {
|
|
23
|
-
var isComposing = tr.getMeta(
|
|
18
|
+
var isComposing = tr.getMeta(pluginKey);
|
|
24
19
|
var zeroWidthSpacePos = tr.getMeta('zeroWidthSpacePos');
|
|
25
20
|
if (typeof isComposing === 'undefined') {
|
|
26
21
|
return value;
|
|
@@ -35,7 +30,7 @@ export default (function () {
|
|
|
35
30
|
handleDOMEvents: {
|
|
36
31
|
compositionstart: function compositionstart(view, event) {
|
|
37
32
|
var tr = view.state.tr;
|
|
38
|
-
tr.setMeta(
|
|
33
|
+
tr.setMeta(pluginKey, true);
|
|
39
34
|
|
|
40
35
|
// only apply for linux and cursor is at start of line
|
|
41
36
|
if (isLinux() && view.state.selection.$from.parentOffset === 0) {
|
|
@@ -49,10 +44,10 @@ export default (function () {
|
|
|
49
44
|
},
|
|
50
45
|
compositionend: function compositionend(view, event) {
|
|
51
46
|
var tr = view.state.tr;
|
|
52
|
-
tr.setMeta(
|
|
47
|
+
tr.setMeta(pluginKey, false);
|
|
53
48
|
if (isLinux()) {
|
|
54
|
-
var
|
|
55
|
-
var zeroWidthSpacePos = (
|
|
49
|
+
var _pluginKey$getState;
|
|
50
|
+
var zeroWidthSpacePos = (_pluginKey$getState = pluginKey.getState(view.state)) === null || _pluginKey$getState === void 0 ? void 0 : _pluginKey$getState.zeroWidthSpacePos;
|
|
56
51
|
if (typeof zeroWidthSpacePos !== 'undefined') {
|
|
57
52
|
tr.deleteRange(zeroWidthSpacePos, zeroWidthSpacePos + 1);
|
|
58
53
|
}
|
|
@@ -4,7 +4,6 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
|
4
4
|
import { DecorationSet, Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
5
5
|
export var pluginKey = new PluginKey('placeholderPlugin');
|
|
6
6
|
import { isTypeAheadOpen } from '../type-ahead/utils';
|
|
7
|
-
import { isComposing } from '../base/pm-plugins/composition';
|
|
8
7
|
function getPlaceholderState(editorState) {
|
|
9
8
|
return pluginKey.getState(editorState);
|
|
10
9
|
}
|
|
@@ -98,7 +97,8 @@ export function createPlugin(defaultPlaceholderText, bracketPlaceholderText, api
|
|
|
98
97
|
hasPlaceholder = _getPlaceholderState.hasPlaceholder,
|
|
99
98
|
placeholderText = _getPlaceholderState.placeholderText,
|
|
100
99
|
pos = _getPlaceholderState.pos;
|
|
101
|
-
|
|
100
|
+
var compositionPluginState = api === null || api === void 0 ? void 0 : api.dependencies.composition.sharedState.currentState();
|
|
101
|
+
if (hasPlaceholder && placeholderText && pos !== undefined && !(compositionPluginState !== null && compositionPluginState !== void 0 && compositionPluginState.isComposing)) {
|
|
102
102
|
return createPlaceholderDecoration(editorState, placeholderText, pos);
|
|
103
103
|
}
|
|
104
104
|
return;
|
package/dist/esm/version.json
CHANGED
|
@@ -49,6 +49,10 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
49
49
|
hoverDecoration: (nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
50
50
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
51
51
|
};
|
|
52
|
+
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
53
|
+
sharedState: import("../../../plugins/composition").CompositionState | undefined;
|
|
54
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
55
|
+
sharedState: import("../../../plugins/composition").CompositionState | undefined;
|
|
52
56
|
}>, import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
53
57
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
54
58
|
sharedState: {
|
|
@@ -92,6 +96,10 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
92
96
|
hoverDecoration: (nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
93
97
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
94
98
|
};
|
|
99
|
+
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
100
|
+
sharedState: import("../../../plugins/composition").CompositionState | undefined;
|
|
101
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
102
|
+
sharedState: import("../../../plugins/composition").CompositionState | undefined;
|
|
95
103
|
}>, import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
96
104
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
97
105
|
sharedState: {
|
|
@@ -412,6 +420,10 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
412
420
|
hoverDecoration: (nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
413
421
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
414
422
|
};
|
|
423
|
+
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
424
|
+
sharedState: import("../../../plugins/composition").CompositionState | undefined;
|
|
425
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
426
|
+
sharedState: import("../../../plugins/composition").CompositionState | undefined;
|
|
415
427
|
}>, import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
416
428
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
417
429
|
sharedState: {
|
|
@@ -455,6 +467,10 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
455
467
|
hoverDecoration: (nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
456
468
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
457
469
|
};
|
|
470
|
+
}>, (config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
471
|
+
sharedState: import("../../../plugins/composition").CompositionState | undefined;
|
|
472
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
473
|
+
sharedState: import("../../../plugins/composition").CompositionState | undefined;
|
|
458
474
|
}>, import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
459
475
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
460
476
|
sharedState: {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { CodeBlockOptions } from './types';
|
|
3
|
-
import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
4
|
-
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
1
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { CodeBlockOptions } from './types';
|
|
3
|
+
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
4
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
5
|
+
import type compositionPlugin from '../composition';
|
|
5
6
|
declare const codeBlockPlugin: NextEditorPlugin<'codeBlock', {
|
|
6
7
|
pluginConfiguration: CodeBlockOptions;
|
|
7
8
|
dependencies: [
|
|
8
9
|
typeof decorationsPlugin,
|
|
10
|
+
typeof compositionPlugin,
|
|
9
11
|
OptionalPlugin<typeof analyticsPlugin>
|
|
10
12
|
];
|
|
11
13
|
}>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import type codeBlockPlugin from '../';
|
|
3
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
+
declare const ideUX: (pluginInjectionApi: ExtractInjectionAPI<typeof codeBlockPlugin> | undefined) => SafePlugin<any>;
|
|
5
|
+
export default ideUX;
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -5,6 +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 '../composition';
|
|
8
9
|
export declare const placeholderTestId = "placeholder-test-id";
|
|
9
10
|
export declare function createPlaceholderDecoration(editorState: EditorState, placeholderText: string, pos?: number): DecorationSet;
|
|
10
11
|
export declare function createPlugin(defaultPlaceholderText?: string, bracketPlaceholderText?: string, api?: ExtractInjectionAPI<typeof placeholderPlugin>): SafePlugin | undefined;
|
|
@@ -14,6 +15,6 @@ export interface PlaceholderPluginOptions {
|
|
|
14
15
|
}
|
|
15
16
|
declare const placeholderPlugin: NextEditorPlugin<'placeholder', {
|
|
16
17
|
pluginConfiguration: PlaceholderPluginOptions | undefined;
|
|
17
|
-
dependencies: [typeof focusPlugin];
|
|
18
|
+
dependencies: [typeof focusPlugin, typeof compositionPlugin];
|
|
18
19
|
}>;
|
|
19
20
|
export default placeholderPlugin;
|
|
@@ -66,6 +66,11 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
66
66
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
67
67
|
};
|
|
68
68
|
}>,
|
|
69
|
+
(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
70
|
+
sharedState: import("../../../plugins/composition").CompositionState | undefined;
|
|
71
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
72
|
+
sharedState: import("../../../plugins/composition").CompositionState | undefined;
|
|
73
|
+
}>,
|
|
69
74
|
import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
70
75
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
71
76
|
sharedState: {
|
|
@@ -116,6 +121,11 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
116
121
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
117
122
|
};
|
|
118
123
|
}>,
|
|
124
|
+
(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
125
|
+
sharedState: import("../../../plugins/composition").CompositionState | undefined;
|
|
126
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
127
|
+
sharedState: import("../../../plugins/composition").CompositionState | undefined;
|
|
128
|
+
}>,
|
|
119
129
|
import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
120
130
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
121
131
|
sharedState: {
|
|
@@ -507,6 +517,11 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
507
517
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
508
518
|
};
|
|
509
519
|
}>,
|
|
520
|
+
(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
521
|
+
sharedState: import("../../../plugins/composition").CompositionState | undefined;
|
|
522
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
523
|
+
sharedState: import("../../../plugins/composition").CompositionState | undefined;
|
|
524
|
+
}>,
|
|
510
525
|
import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
511
526
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
512
527
|
sharedState: {
|
|
@@ -557,6 +572,11 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
557
572
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
558
573
|
};
|
|
559
574
|
}>,
|
|
575
|
+
(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
576
|
+
sharedState: import("../../../plugins/composition").CompositionState | undefined;
|
|
577
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
578
|
+
sharedState: import("../../../plugins/composition").CompositionState | undefined;
|
|
579
|
+
}>,
|
|
560
580
|
import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
561
581
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
562
582
|
sharedState: {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { CodeBlockOptions } from './types';
|
|
3
|
-
import { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
4
|
-
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
1
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { CodeBlockOptions } from './types';
|
|
3
|
+
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
4
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
5
|
+
import type compositionPlugin from '../composition';
|
|
5
6
|
declare const codeBlockPlugin: NextEditorPlugin<'codeBlock', {
|
|
6
7
|
pluginConfiguration: CodeBlockOptions;
|
|
7
8
|
dependencies: [
|
|
8
9
|
typeof decorationsPlugin,
|
|
10
|
+
typeof compositionPlugin,
|
|
9
11
|
OptionalPlugin<typeof analyticsPlugin>
|
|
10
12
|
];
|
|
11
13
|
}>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import type codeBlockPlugin from '../';
|
|
3
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
+
declare const ideUX: (pluginInjectionApi: ExtractInjectionAPI<typeof codeBlockPlugin> | undefined) => SafePlugin<any>;
|
|
5
|
+
export default ideUX;
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -5,6 +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 '../composition';
|
|
8
9
|
export declare const placeholderTestId = "placeholder-test-id";
|
|
9
10
|
export declare function createPlaceholderDecoration(editorState: EditorState, placeholderText: string, pos?: number): DecorationSet;
|
|
10
11
|
export declare function createPlugin(defaultPlaceholderText?: string, bracketPlaceholderText?: string, api?: ExtractInjectionAPI<typeof placeholderPlugin>): SafePlugin | undefined;
|
|
@@ -15,7 +16,8 @@ export interface PlaceholderPluginOptions {
|
|
|
15
16
|
declare const placeholderPlugin: NextEditorPlugin<'placeholder', {
|
|
16
17
|
pluginConfiguration: PlaceholderPluginOptions | undefined;
|
|
17
18
|
dependencies: [
|
|
18
|
-
typeof focusPlugin
|
|
19
|
+
typeof focusPlugin,
|
|
20
|
+
typeof compositionPlugin
|
|
19
21
|
];
|
|
20
22
|
}>;
|
|
21
23
|
export default placeholderPlugin;
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
interface CompositionPluginState {
|
|
4
|
-
isComposing: boolean;
|
|
5
|
-
zeroWidthSpacePos?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare const isComposing: (state: EditorState) => boolean;
|
|
8
|
-
declare const _default: () => SafePlugin<CompositionPluginState>;
|
|
9
|
-
export default _default;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
interface CompositionPluginState {
|
|
4
|
-
isComposing: boolean;
|
|
5
|
-
zeroWidthSpacePos?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare const isComposing: (state: EditorState) => boolean;
|
|
8
|
-
declare const _default: () => SafePlugin<CompositionPluginState>;
|
|
9
|
-
export default _default;
|