@atlaskit/editor-core 187.25.1 → 187.25.3
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 -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/plugins/quick-insert/commands.js +0 -3
- 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/plugins/quick-insert/commands.js +0 -2
- 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/plugins/quick-insert/commands.js +0 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/editor-next/hooks/useProviderFactory.d.ts +1 -1
- package/dist/types/editor-next/utils/handleProviders.d.ts +1 -2
- package/dist/types/index.d.ts +10 -3
- package/dist/types/labs/next/presets/default.d.ts +9 -10
- package/dist/types/plugins/code-block/index.d.ts +1 -1
- package/dist/types/plugins/placeholder/index.d.ts +1 -1
- package/dist/types/plugins/quick-insert/api.d.ts +1 -1
- package/dist/types/plugins/quick-insert/commands.d.ts +1 -1
- package/dist/types/plugins/quick-insert/index.d.ts +6 -5
- package/dist/types/plugins/quick-insert/plugin-key.d.ts +1 -1
- package/dist/types/plugins/quick-insert/search.d.ts +2 -2
- package/dist/types/plugins/quick-insert/types.d.ts +2 -22
- package/dist/types/types/editor-props.d.ts +1 -2
- package/dist/types/utils/prepare-quick-insert-provider.d.ts +4 -4
- package/dist/types-ts4.5/editor-next/hooks/useProviderFactory.d.ts +1 -1
- package/dist/types-ts4.5/editor-next/utils/handleProviders.d.ts +1 -2
- package/dist/types-ts4.5/index.d.ts +10 -3
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +9 -10
- 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/dist/types-ts4.5/plugins/quick-insert/api.d.ts +1 -1
- package/dist/types-ts4.5/plugins/quick-insert/commands.d.ts +1 -1
- package/dist/types-ts4.5/plugins/quick-insert/index.d.ts +6 -5
- package/dist/types-ts4.5/plugins/quick-insert/plugin-key.d.ts +1 -1
- package/dist/types-ts4.5/plugins/quick-insert/search.d.ts +2 -2
- package/dist/types-ts4.5/plugins/quick-insert/types.d.ts +2 -22
- package/dist/types-ts4.5/types/editor-props.d.ts +1 -2
- package/dist/types-ts4.5/utils/prepare-quick-insert-provider.d.ts +4 -4
- package/package.json +2 -1
- package/report.api.md +15 -48
- package/tmp/api-report-tmp.d.ts +15 -46
- 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
|
@@ -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;
|