@atlaskit/editor-core 187.17.2 → 187.17.5
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/.eslintrc.js +0 -6
- package/CHANGELOG.md +13 -0
- package/dist/cjs/labs/next/presets/default.js +2 -1
- package/dist/cjs/plugins/base/index.js +5 -12
- package/dist/cjs/plugins/media/index.js +3 -2
- package/dist/cjs/plugins/media/next-plugin-type.js +5 -0
- package/dist/cjs/plugins/media/ui/MediaPicker/index.js +35 -26
- package/dist/cjs/plugins/placeholder/index.js +10 -9
- package/dist/cjs/plugins/text-formatting/commands/clear-formatting.js +1 -1
- 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 -6
- package/dist/es2019/plugins/media/index.js +3 -2
- package/dist/es2019/plugins/media/next-plugin-type.js +1 -0
- package/dist/es2019/plugins/media/ui/MediaPicker/index.js +37 -26
- package/dist/es2019/plugins/placeholder/index.js +13 -11
- package/dist/es2019/plugins/text-formatting/commands/clear-formatting.js +1 -1
- 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 +5 -12
- package/dist/esm/plugins/media/index.js +3 -2
- package/dist/esm/plugins/media/next-plugin-type.js +1 -0
- package/dist/esm/plugins/media/ui/MediaPicker/index.js +35 -26
- package/dist/esm/plugins/placeholder/index.js +11 -11
- package/dist/esm/plugins/text-formatting/commands/clear-formatting.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/media/index.d.ts +3 -26
- package/dist/types/plugins/media/next-plugin-type.d.ts +27 -0
- package/dist/types/plugins/media/ui/MediaPicker/index.d.ts +4 -2
- package/dist/types/plugins/placeholder/index.d.ts +4 -2
- package/dist/types-ts4.5/plugins/media/index.d.ts +3 -26
- package/dist/types-ts4.5/plugins/media/next-plugin-type.d.ts +27 -0
- package/dist/types-ts4.5/plugins/media/ui/MediaPicker/index.d.ts +4 -2
- package/dist/types-ts4.5/plugins/placeholder/index.d.ts +6 -2
- package/package.json +3 -2
- package/report.api.md +23 -18
- package/tmp/api-report-tmp.d.ts +20 -15
- package/dist/cjs/plugins/base/pm-plugins/focus-handler.js +0 -56
- package/dist/es2019/plugins/base/pm-plugins/focus-handler.js +0 -44
- package/dist/esm/plugins/base/pm-plugins/focus-handler.js +0 -48
- package/dist/types/plugins/base/pm-plugins/focus-handler.d.ts +0 -6
- package/dist/types-ts4.5/plugins/base/pm-plugins/focus-handler.d.ts +0 -6
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
export var focusStateKey = new PluginKey('focusStatePlugin');
|
|
4
|
-
export default (function (dispatch) {
|
|
5
|
-
return new SafePlugin({
|
|
6
|
-
key: focusStateKey,
|
|
7
|
-
state: {
|
|
8
|
-
init: function init() {
|
|
9
|
-
return true;
|
|
10
|
-
},
|
|
11
|
-
apply: function apply(tr, wasEditorFocused) {
|
|
12
|
-
var meta = tr.getMeta(focusStateKey);
|
|
13
|
-
if (typeof meta === 'boolean') {
|
|
14
|
-
if (meta !== wasEditorFocused) {
|
|
15
|
-
dispatch(focusStateKey, meta);
|
|
16
|
-
return meta;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return wasEditorFocused;
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
props: {
|
|
23
|
-
handleDOMEvents: {
|
|
24
|
-
click: function click(view) {
|
|
25
|
-
var isEditorFocused = focusStateKey.getState(view.state);
|
|
26
|
-
if (!isEditorFocused) {
|
|
27
|
-
view.dispatch(view.state.tr.setMeta(focusStateKey, view.hasFocus()));
|
|
28
|
-
}
|
|
29
|
-
return false;
|
|
30
|
-
},
|
|
31
|
-
focus: function focus(view) {
|
|
32
|
-
var isEditorFocused = focusStateKey.getState(view.state);
|
|
33
|
-
if (!isEditorFocused) {
|
|
34
|
-
view.dispatch(view.state.tr.setMeta(focusStateKey, true));
|
|
35
|
-
}
|
|
36
|
-
return false;
|
|
37
|
-
},
|
|
38
|
-
blur: function blur(view) {
|
|
39
|
-
var isEditorFocused = focusStateKey.getState(view.state);
|
|
40
|
-
if (isEditorFocused) {
|
|
41
|
-
view.dispatch(view.state.tr.setMeta(focusStateKey, false));
|
|
42
|
-
}
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { Dispatch } from '../../../event-dispatcher';
|
|
4
|
-
export declare const focusStateKey: PluginKey<any>;
|
|
5
|
-
declare const _default: (dispatch: Dispatch) => SafePlugin<any>;
|
|
6
|
-
export default _default;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { Dispatch } from '../../../event-dispatcher';
|
|
4
|
-
export declare const focusStateKey: PluginKey<any>;
|
|
5
|
-
declare const _default: (dispatch: Dispatch) => SafePlugin<any>;
|
|
6
|
-
export default _default;
|