@atlaskit/editor-core 188.11.4 → 188.12.1
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 +19 -0
- package/dist/cjs/labs/next/presets/universal.js +15 -3
- package/dist/cjs/plugins/annotation/index.js +12 -1
- package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +2 -1
- package/dist/cjs/plugins/annotation/pm-plugins/plugin-factory.js +5 -0
- package/dist/cjs/plugins/annotation/pm-plugins/reducer.js +2 -1
- package/dist/cjs/plugins/annotation/toolbar.js +2 -156
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +33 -31
- package/dist/cjs/plugins/layout/actions.js +20 -17
- package/dist/cjs/plugins/layout/index.js +6 -2
- package/dist/cjs/plugins/panel/index.js +1 -1
- package/dist/cjs/plugins/panel/toolbar.js +9 -7
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +0 -6
- package/dist/cjs/plugins/rank.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/index.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +104 -90
- package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -2
- package/dist/cjs/plugins/undo-redo/index.js +7 -16
- package/dist/cjs/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +59 -75
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/labs/next/presets/universal.js +14 -2
- package/dist/es2019/plugins/annotation/index.js +14 -1
- package/dist/es2019/plugins/annotation/pm-plugins/inline-comment.js +2 -1
- package/dist/es2019/plugins/annotation/pm-plugins/plugin-factory.js +6 -0
- package/dist/es2019/plugins/annotation/pm-plugins/reducer.js +2 -1
- package/dist/es2019/plugins/annotation/toolbar.js +1 -156
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +4 -3
- package/dist/es2019/plugins/layout/actions.js +4 -3
- package/dist/es2019/plugins/layout/index.js +63 -57
- package/dist/es2019/plugins/panel/index.js +1 -1
- package/dist/es2019/plugins/panel/toolbar.js +9 -7
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +1 -4
- package/dist/es2019/plugins/rank.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/index.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +22 -14
- package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -2
- package/dist/es2019/plugins/undo-redo/index.js +6 -17
- package/dist/es2019/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +60 -61
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/labs/next/presets/universal.js +14 -2
- package/dist/esm/plugins/annotation/index.js +12 -1
- package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +2 -1
- package/dist/esm/plugins/annotation/pm-plugins/plugin-factory.js +5 -0
- package/dist/esm/plugins/annotation/pm-plugins/reducer.js +2 -1
- package/dist/esm/plugins/annotation/toolbar.js +1 -156
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +33 -31
- package/dist/esm/plugins/layout/actions.js +15 -12
- package/dist/esm/plugins/layout/index.js +7 -3
- package/dist/esm/plugins/panel/index.js +1 -1
- package/dist/esm/plugins/panel/toolbar.js +9 -7
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +1 -6
- package/dist/esm/plugins/rank.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/index.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +104 -90
- package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -2
- package/dist/esm/plugins/undo-redo/index.js +6 -16
- package/dist/esm/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +56 -74
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/annotation/pm-plugins/types.d.ts +1 -0
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/insert-block/types.d.ts +3 -1
- package/dist/types/plugins/layout/actions.d.ts +2 -1
- package/dist/types/plugins/layout/index.d.ts +4 -0
- package/dist/types/plugins/panel/index.d.ts +2 -2
- package/dist/types/plugins/panel/toolbar.d.ts +5 -3
- package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +0 -1
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +7 -4
- package/dist/types/plugins/tasks-and-decisions/types.d.ts +5 -1
- package/dist/types/plugins/undo-redo/types.d.ts +2 -1
- package/dist/types/plugins/undo-redo/ui/ToolbarUndoRedo/index.d.ts +2 -6
- package/dist/types-ts4.5/plugins/annotation/pm-plugins/types.d.ts +1 -0
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +3 -1
- package/dist/types-ts4.5/plugins/layout/actions.d.ts +2 -1
- package/dist/types-ts4.5/plugins/layout/index.d.ts +4 -0
- package/dist/types-ts4.5/plugins/panel/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/panel/toolbar.d.ts +5 -3
- package/dist/types-ts4.5/plugins/paste/pm-plugins/analytics.d.ts +0 -1
- package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +7 -4
- package/dist/types-ts4.5/plugins/tasks-and-decisions/types.d.ts +3 -1
- package/dist/types-ts4.5/plugins/undo-redo/types.d.ts +3 -1
- package/dist/types-ts4.5/plugins/undo-redo/ui/ToolbarUndoRedo/index.d.ts +2 -6
- package/package.json +8 -3
- package/dist/cjs/plugins/history/actions.js +0 -10
- package/dist/cjs/plugins/history/index.js +0 -75
- package/dist/cjs/plugins/history/pm-history-types.js +0 -5
- package/dist/cjs/plugins/history/reducer.js +0 -18
- package/dist/cjs/plugins/history/types.js +0 -5
- package/dist/cjs/plugins/history/utils.js +0 -19
- package/dist/es2019/plugins/history/actions.js +0 -4
- package/dist/es2019/plugins/history/index.js +0 -61
- package/dist/es2019/plugins/history/pm-history-types.js +0 -1
- package/dist/es2019/plugins/history/reducer.js +0 -12
- package/dist/es2019/plugins/history/types.js +0 -1
- package/dist/es2019/plugins/history/utils.js +0 -11
- package/dist/esm/plugins/history/actions.js +0 -4
- package/dist/esm/plugins/history/index.js +0 -68
- package/dist/esm/plugins/history/pm-history-types.js +0 -1
- package/dist/esm/plugins/history/reducer.js +0 -12
- package/dist/esm/plugins/history/types.js +0 -1
- package/dist/esm/plugins/history/utils.js +0 -13
- package/dist/types/plugins/history/actions.d.ts +0 -8
- package/dist/types/plugins/history/index.d.ts +0 -13
- package/dist/types/plugins/history/pm-history-types.d.ts +0 -17
- package/dist/types/plugins/history/reducer.d.ts +0 -4
- package/dist/types/plugins/history/types.d.ts +0 -4
- package/dist/types/plugins/history/utils.d.ts +0 -4
- package/dist/types-ts4.5/plugins/history/actions.d.ts +0 -8
- package/dist/types-ts4.5/plugins/history/index.d.ts +0 -13
- package/dist/types-ts4.5/plugins/history/pm-history-types.d.ts +0 -17
- package/dist/types-ts4.5/plugins/history/reducer.d.ts +0 -4
- package/dist/types-ts4.5/plugins/history/types.d.ts +0 -4
- package/dist/types-ts4.5/plugins/history/utils.d.ts +0 -4
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
2
|
-
export const getPmHistoryPlugin = state => {
|
|
3
|
-
return state.plugins.find(plugin => plugin.key === pmHistoryPluginKey);
|
|
4
|
-
};
|
|
5
|
-
export const getPmHistoryPluginState = state => {
|
|
6
|
-
const pmHistoryPlugin = getPmHistoryPlugin(state);
|
|
7
|
-
if (!pmHistoryPlugin) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
return pmHistoryPlugin.getState(state);
|
|
11
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { pluginFactory } from '../../utils/plugin-state-factory';
|
|
2
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
import reducer from './reducer';
|
|
5
|
-
import { HistoryActionTypes } from './actions';
|
|
6
|
-
import { getPmHistoryPluginState } from './utils';
|
|
7
|
-
/**
|
|
8
|
-
* Plugin that keeps track of whether undo and redo are currently available
|
|
9
|
-
* This is needed so we can enable/disable controls appropriately
|
|
10
|
-
*
|
|
11
|
-
* Actual undo/redo functionality is handled by prosemirror-history:
|
|
12
|
-
* https://github.com/ProseMirror/prosemirror-history
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
export var historyPluginKey = new PluginKey('historyPlugin');
|
|
16
|
-
var getInitialState = function getInitialState() {
|
|
17
|
-
return {
|
|
18
|
-
canUndo: false,
|
|
19
|
-
canRedo: false
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
var _pluginFactory = pluginFactory(historyPluginKey, reducer),
|
|
23
|
-
createPluginState = _pluginFactory.createPluginState,
|
|
24
|
-
getPluginState = _pluginFactory.getPluginState;
|
|
25
|
-
var createPlugin = function createPlugin(dispatch) {
|
|
26
|
-
return new SafePlugin({
|
|
27
|
-
state: createPluginState(dispatch, getInitialState),
|
|
28
|
-
key: historyPluginKey,
|
|
29
|
-
appendTransaction: function appendTransaction(transactions, oldState, newState) {
|
|
30
|
-
if (transactions.find(function (tr) {
|
|
31
|
-
return tr.docChanged && tr.getMeta('addToHistory') !== false;
|
|
32
|
-
})) {
|
|
33
|
-
var pmHistoryPluginState = getPmHistoryPluginState(newState);
|
|
34
|
-
if (!pmHistoryPluginState) {
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
var canUndo = pmHistoryPluginState.done.eventCount > 0;
|
|
38
|
-
var canRedo = pmHistoryPluginState.undone.eventCount > 0;
|
|
39
|
-
var _getPluginState = getPluginState(newState),
|
|
40
|
-
prevCanUndo = _getPluginState.canUndo,
|
|
41
|
-
prevCanRedo = _getPluginState.canRedo;
|
|
42
|
-
if (canUndo !== prevCanUndo || canRedo !== prevCanRedo) {
|
|
43
|
-
var action = {
|
|
44
|
-
type: HistoryActionTypes.UPDATE,
|
|
45
|
-
canUndo: canUndo,
|
|
46
|
-
canRedo: canRedo
|
|
47
|
-
};
|
|
48
|
-
return newState.tr.setMeta(historyPluginKey, action);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
};
|
|
54
|
-
var historyPlugin = function historyPlugin() {
|
|
55
|
-
return {
|
|
56
|
-
name: 'history',
|
|
57
|
-
pmPlugins: function pmPlugins() {
|
|
58
|
-
return [{
|
|
59
|
-
name: 'history',
|
|
60
|
-
plugin: function plugin(_ref) {
|
|
61
|
-
var dispatch = _ref.dispatch;
|
|
62
|
-
return createPlugin(dispatch);
|
|
63
|
-
}
|
|
64
|
-
}];
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
export default historyPlugin;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { HistoryActionTypes } from './actions';
|
|
2
|
-
var reducer = function reducer(state, action) {
|
|
3
|
-
switch (action.type) {
|
|
4
|
-
case HistoryActionTypes.UPDATE:
|
|
5
|
-
return {
|
|
6
|
-
canUndo: action.canUndo,
|
|
7
|
-
canRedo: action.canRedo
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
return state;
|
|
11
|
-
};
|
|
12
|
-
export default reducer;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { pmHistoryPluginKey } from '@atlaskit/editor-common/utils';
|
|
2
|
-
export var getPmHistoryPlugin = function getPmHistoryPlugin(state) {
|
|
3
|
-
return state.plugins.find(function (plugin) {
|
|
4
|
-
return plugin.key === pmHistoryPluginKey;
|
|
5
|
-
});
|
|
6
|
-
};
|
|
7
|
-
export var getPmHistoryPluginState = function getPmHistoryPluginState(state) {
|
|
8
|
-
var pmHistoryPlugin = getPmHistoryPlugin(state);
|
|
9
|
-
if (!pmHistoryPlugin) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
return pmHistoryPlugin.getState(state);
|
|
13
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { HistoryPluginState } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* Plugin that keeps track of whether undo and redo are currently available
|
|
6
|
-
* This is needed so we can enable/disable controls appropriately
|
|
7
|
-
*
|
|
8
|
-
* Actual undo/redo functionality is handled by prosemirror-history:
|
|
9
|
-
* https://github.com/ProseMirror/prosemirror-history
|
|
10
|
-
*/
|
|
11
|
-
export declare const historyPluginKey: PluginKey<HistoryPluginState>;
|
|
12
|
-
declare const historyPlugin: NextEditorPlugin<'history'>;
|
|
13
|
-
export default historyPlugin;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { StepMap, Step } from '@atlaskit/editor-prosemirror/transform';
|
|
2
|
-
export interface PmHistoryItem {
|
|
3
|
-
map: StepMap;
|
|
4
|
-
step: Step;
|
|
5
|
-
}
|
|
6
|
-
export interface PmHistoryLeaf {
|
|
7
|
-
values: PmHistoryItem[];
|
|
8
|
-
length: number;
|
|
9
|
-
}
|
|
10
|
-
export interface PmHistoryBranch {
|
|
11
|
-
items: PmHistoryLeaf;
|
|
12
|
-
eventCount: number;
|
|
13
|
-
}
|
|
14
|
-
export interface PmHistoryPluginState {
|
|
15
|
-
done: PmHistoryBranch;
|
|
16
|
-
undone: PmHistoryBranch;
|
|
17
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Plugin, EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { PmHistoryPluginState } from './pm-history-types';
|
|
3
|
-
export declare const getPmHistoryPlugin: (state: EditorState) => Plugin | undefined;
|
|
4
|
-
export declare const getPmHistoryPluginState: (state: EditorState) => PmHistoryPluginState | undefined;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { HistoryPluginState } from './types';
|
|
4
|
-
/**
|
|
5
|
-
* Plugin that keeps track of whether undo and redo are currently available
|
|
6
|
-
* This is needed so we can enable/disable controls appropriately
|
|
7
|
-
*
|
|
8
|
-
* Actual undo/redo functionality is handled by prosemirror-history:
|
|
9
|
-
* https://github.com/ProseMirror/prosemirror-history
|
|
10
|
-
*/
|
|
11
|
-
export declare const historyPluginKey: PluginKey<HistoryPluginState>;
|
|
12
|
-
declare const historyPlugin: NextEditorPlugin<'history'>;
|
|
13
|
-
export default historyPlugin;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { StepMap, Step } from '@atlaskit/editor-prosemirror/transform';
|
|
2
|
-
export interface PmHistoryItem {
|
|
3
|
-
map: StepMap;
|
|
4
|
-
step: Step;
|
|
5
|
-
}
|
|
6
|
-
export interface PmHistoryLeaf {
|
|
7
|
-
values: PmHistoryItem[];
|
|
8
|
-
length: number;
|
|
9
|
-
}
|
|
10
|
-
export interface PmHistoryBranch {
|
|
11
|
-
items: PmHistoryLeaf;
|
|
12
|
-
eventCount: number;
|
|
13
|
-
}
|
|
14
|
-
export interface PmHistoryPluginState {
|
|
15
|
-
done: PmHistoryBranch;
|
|
16
|
-
undone: PmHistoryBranch;
|
|
17
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Plugin, EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { PmHistoryPluginState } from './pm-history-types';
|
|
3
|
-
export declare const getPmHistoryPlugin: (state: EditorState) => Plugin | undefined;
|
|
4
|
-
export declare const getPmHistoryPluginState: (state: EditorState) => PmHistoryPluginState | undefined;
|