@atlaskit/editor-core 189.3.14 → 189.3.16
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 +17 -0
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/cjs/plugins/analytics/index.js +0 -6
- package/dist/cjs/plugins/analytics/utils.js +0 -29
- package/dist/cjs/plugins/breakout/index.js +3 -3
- package/dist/cjs/plugins/breakout/ui/LayoutButton.js +4 -4
- package/dist/cjs/plugins/extension/extension-api.js +3 -3
- package/dist/cjs/plugins/extension/index.js +14 -3
- package/dist/cjs/plugins/{macro → extension/pm-plugins/macro}/actions.js +3 -4
- package/dist/cjs/plugins/{macro → extension/pm-plugins/macro}/index.js +2 -18
- package/dist/cjs/plugins/extension/toolbar.js +1 -1
- package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +32 -30
- package/dist/cjs/plugins/find-replace/commands-with-analytics.js +85 -71
- package/dist/cjs/plugins/find-replace/index.js +5 -2
- package/dist/cjs/plugins/find-replace/keymap.js +4 -4
- package/dist/cjs/plugins/index.js +1 -24
- package/dist/cjs/plugins/insert-block/index.js +36 -53
- package/dist/cjs/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.js +3 -9
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +3 -3
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +4 -5
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/item.js +7 -8
- package/dist/cjs/plugins/paste/handlers.js +3 -3
- package/dist/cjs/plugins/paste/pm-plugins/main.js +4 -4
- package/dist/cjs/presets/context.js +5 -3
- package/dist/cjs/presets/universal.js +12 -8
- package/dist/cjs/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
- package/dist/cjs/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +11 -8
- package/dist/cjs/ui/ContentStyles/index.js +4 -4
- package/dist/cjs/ui/ToolbarFeedback/index.js +1 -1
- package/dist/cjs/use-preset.js +0 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/es2019/plugins/analytics/index.js +1 -1
- package/dist/es2019/plugins/analytics/utils.js +0 -24
- package/dist/es2019/plugins/breakout/index.js +1 -1
- package/dist/es2019/plugins/breakout/ui/LayoutButton.js +1 -1
- package/dist/es2019/plugins/extension/extension-api.js +2 -2
- package/dist/es2019/plugins/extension/index.js +13 -3
- package/dist/es2019/plugins/{macro → extension/pm-plugins/macro}/actions.js +2 -2
- package/dist/es2019/plugins/{macro → extension/pm-plugins/macro}/index.js +1 -14
- package/dist/es2019/plugins/extension/toolbar.js +1 -1
- package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +20 -19
- package/dist/es2019/plugins/find-replace/commands-with-analytics.js +15 -15
- package/dist/es2019/plugins/find-replace/index.js +7 -2
- package/dist/es2019/plugins/find-replace/keymap.js +4 -4
- package/dist/es2019/plugins/index.js +0 -2
- package/dist/es2019/plugins/insert-block/index.js +19 -36
- package/dist/es2019/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.js +4 -8
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -2
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -3
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/item.js +2 -2
- package/dist/es2019/plugins/paste/handlers.js +4 -3
- package/dist/es2019/plugins/paste/pm-plugins/main.js +4 -4
- package/dist/es2019/presets/context.js +2 -2
- package/dist/es2019/presets/universal.js +10 -6
- package/dist/es2019/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
- package/dist/es2019/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +9 -4
- package/dist/es2019/ui/ContentStyles/index.js +1 -1
- package/dist/es2019/ui/ToolbarFeedback/index.js +2 -2
- package/dist/es2019/use-preset.js +0 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/esm/plugins/analytics/index.js +1 -1
- package/dist/esm/plugins/analytics/utils.js +0 -28
- package/dist/esm/plugins/breakout/index.js +1 -1
- package/dist/esm/plugins/breakout/ui/LayoutButton.js +1 -1
- package/dist/esm/plugins/extension/extension-api.js +2 -2
- package/dist/esm/plugins/extension/index.js +14 -3
- package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/actions.js +2 -2
- package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/index.js +1 -17
- package/dist/esm/plugins/extension/toolbar.js +1 -1
- package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +32 -30
- package/dist/esm/plugins/find-replace/commands-with-analytics.js +84 -70
- package/dist/esm/plugins/find-replace/index.js +5 -2
- package/dist/esm/plugins/find-replace/keymap.js +4 -4
- package/dist/esm/plugins/index.js +0 -2
- package/dist/esm/plugins/insert-block/index.js +36 -53
- package/dist/esm/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.js +4 -10
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +1 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +2 -2
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -3
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/item.js +2 -2
- package/dist/esm/plugins/paste/handlers.js +4 -3
- package/dist/esm/plugins/paste/pm-plugins/main.js +4 -4
- package/dist/esm/presets/context.js +2 -2
- package/dist/esm/presets/universal.js +9 -6
- package/dist/esm/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +3 -2
- package/dist/esm/{plugins/expand/ui/styles.js → ui/ContentStyles/expand.js} +9 -4
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/ui/ToolbarFeedback/index.js +1 -1
- package/dist/esm/use-preset.js +0 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/analytics/index.d.ts +1 -1
- package/dist/types/plugins/analytics/utils.d.ts +0 -11
- package/dist/types/plugins/extension/extension-api.d.ts +1 -1
- package/dist/{types-ts4.5/plugins → types/plugins/extension/pm-plugins}/macro/index.d.ts +1 -4
- package/dist/types/plugins/extension/pm-plugins/macro/types.d.ts +4 -0
- package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -2
- package/dist/types/plugins/find-replace/commands-with-analytics.d.ts +9 -9
- package/dist/types/plugins/find-replace/index.d.ts +5 -3
- package/dist/types/plugins/find-replace/keymap.d.ts +2 -1
- package/dist/types/plugins/index.d.ts +0 -2
- package/dist/types/plugins/insert-block/types.d.ts +4 -2
- package/dist/{types-ts4.5 → types/plugins/insert-block}/ui/ElementBrowser/types.d.ts +2 -2
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -2
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -1
- package/dist/types/plugins/mobile-dimensions/index.d.ts +2 -1
- package/dist/types/plugins/paste/handlers.d.ts +2 -1
- package/dist/types/presets/context.d.ts +2 -2
- package/dist/types/presets/default.d.ts +8 -0
- package/dist/types/presets/universal.d.ts +5 -0
- package/dist/types/{plugins/expand/ui/styles.d.ts → ui/ContentStyles/expand.d.ts} +1 -1
- package/dist/types-ts4.5/plugins/analytics/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/analytics/utils.d.ts +0 -11
- package/dist/types-ts4.5/plugins/extension/extension-api.d.ts +1 -1
- package/dist/{types/plugins → types-ts4.5/plugins/extension/pm-plugins}/macro/index.d.ts +1 -4
- package/dist/types-ts4.5/plugins/extension/pm-plugins/macro/types.d.ts +4 -0
- package/dist/types-ts4.5/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -2
- package/dist/types-ts4.5/plugins/find-replace/commands-with-analytics.d.ts +9 -9
- package/dist/types-ts4.5/plugins/find-replace/index.d.ts +6 -3
- package/dist/types-ts4.5/plugins/find-replace/keymap.d.ts +2 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -2
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +4 -2
- package/dist/{types → types-ts4.5/plugins/insert-block}/ui/ElementBrowser/types.d.ts +2 -2
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -2
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -1
- package/dist/types-ts4.5/plugins/mobile-dimensions/index.d.ts +2 -1
- package/dist/types-ts4.5/plugins/paste/handlers.d.ts +2 -1
- package/dist/types-ts4.5/presets/context.d.ts +2 -2
- package/dist/types-ts4.5/presets/default.d.ts +8 -0
- package/dist/types-ts4.5/presets/universal.d.ts +5 -0
- package/dist/types-ts4.5/{plugins/expand/ui/styles.d.ts → ui/ContentStyles/expand.d.ts} +1 -1
- package/package.json +5 -9
- package/dist/cjs/plugins/breakout/constants.js +0 -10
- package/dist/cjs/plugins/expand/commands.js +0 -184
- package/dist/cjs/plugins/expand/index.js +0 -111
- package/dist/cjs/plugins/expand/nodeviews/index.js +0 -485
- package/dist/cjs/plugins/expand/pm-plugins/keymap.js +0 -171
- package/dist/cjs/plugins/expand/pm-plugins/main.js +0 -85
- package/dist/cjs/plugins/expand/pm-plugins/plugin-factory.js +0 -15
- package/dist/cjs/plugins/expand/reducer.js +0 -20
- package/dist/cjs/plugins/expand/toolbar.js +0 -59
- package/dist/cjs/plugins/expand/ui/ExpandIconButton.js +0 -104
- package/dist/cjs/plugins/expand/ui/class-names.js +0 -20
- package/dist/cjs/plugins/expand/utils.js +0 -24
- package/dist/cjs/ui/ElementBrowser/types.js +0 -5
- package/dist/es2019/plugins/breakout/constants.js +0 -4
- package/dist/es2019/plugins/expand/commands.js +0 -161
- package/dist/es2019/plugins/expand/index.js +0 -95
- package/dist/es2019/plugins/expand/nodeviews/index.js +0 -475
- package/dist/es2019/plugins/expand/pm-plugins/keymap.js +0 -197
- package/dist/es2019/plugins/expand/pm-plugins/main.js +0 -73
- package/dist/es2019/plugins/expand/pm-plugins/plugin-factory.js +0 -9
- package/dist/es2019/plugins/expand/reducer.js +0 -11
- package/dist/es2019/plugins/expand/toolbar.js +0 -52
- package/dist/es2019/plugins/expand/ui/ExpandIconButton.js +0 -85
- package/dist/es2019/plugins/expand/ui/class-names.js +0 -12
- package/dist/es2019/plugins/expand/utils.js +0 -1
- package/dist/esm/plugins/breakout/constants.js +0 -4
- package/dist/esm/plugins/expand/commands.js +0 -177
- package/dist/esm/plugins/expand/index.js +0 -97
- package/dist/esm/plugins/expand/nodeviews/index.js +0 -477
- package/dist/esm/plugins/expand/pm-plugins/keymap.js +0 -165
- package/dist/esm/plugins/expand/pm-plugins/main.js +0 -77
- package/dist/esm/plugins/expand/pm-plugins/plugin-factory.js +0 -9
- package/dist/esm/plugins/expand/reducer.js +0 -13
- package/dist/esm/plugins/expand/toolbar.js +0 -52
- package/dist/esm/plugins/expand/ui/ExpandIconButton.js +0 -95
- package/dist/esm/plugins/expand/ui/class-names.js +0 -14
- package/dist/esm/plugins/expand/utils.js +0 -1
- package/dist/esm/plugins/macro/types.js +0 -1
- package/dist/esm/ui/ElementBrowser/types.js +0 -1
- package/dist/types/plugins/breakout/constants.d.ts +0 -4
- package/dist/types/plugins/expand/commands.d.ts +0 -13
- package/dist/types/plugins/expand/index.d.ts +0 -31
- package/dist/types/plugins/expand/nodeviews/index.d.ts +0 -55
- package/dist/types/plugins/expand/pm-plugins/keymap.d.ts +0 -4
- package/dist/types/plugins/expand/pm-plugins/main.d.ts +0 -8
- package/dist/types/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -3
- package/dist/types/plugins/expand/reducer.d.ts +0 -3
- package/dist/types/plugins/expand/toolbar.d.ts +0 -3
- package/dist/types/plugins/expand/types.d.ts +0 -9
- package/dist/types/plugins/expand/ui/ExpandIconButton.d.ts +0 -43
- package/dist/types/plugins/expand/ui/class-names.d.ts +0 -11
- package/dist/types/plugins/expand/utils.d.ts +0 -1
- package/dist/types/plugins/macro/types.d.ts +0 -4
- package/dist/types-ts4.5/plugins/breakout/constants.d.ts +0 -4
- package/dist/types-ts4.5/plugins/expand/commands.d.ts +0 -13
- package/dist/types-ts4.5/plugins/expand/index.d.ts +0 -31
- package/dist/types-ts4.5/plugins/expand/nodeviews/index.d.ts +0 -55
- package/dist/types-ts4.5/plugins/expand/pm-plugins/keymap.d.ts +0 -4
- package/dist/types-ts4.5/plugins/expand/pm-plugins/main.d.ts +0 -8
- package/dist/types-ts4.5/plugins/expand/pm-plugins/plugin-factory.d.ts +0 -3
- package/dist/types-ts4.5/plugins/expand/reducer.d.ts +0 -3
- package/dist/types-ts4.5/plugins/expand/toolbar.d.ts +0 -3
- package/dist/types-ts4.5/plugins/expand/types.d.ts +0 -9
- package/dist/types-ts4.5/plugins/expand/ui/ExpandIconButton.d.ts +0 -43
- package/dist/types-ts4.5/plugins/expand/ui/class-names.d.ts +0 -11
- package/dist/types-ts4.5/plugins/expand/utils.d.ts +0 -1
- package/dist/types-ts4.5/plugins/macro/types.d.ts +0 -4
- /package/dist/cjs/plugins/{macro → extension/pm-plugins/macro}/plugin-key.js +0 -0
- /package/dist/cjs/plugins/{expand → extension/pm-plugins/macro}/types.js +0 -0
- /package/dist/cjs/plugins/{macro → insert-block/ui/ElementBrowser}/types.js +0 -0
- /package/dist/es2019/plugins/{macro → extension/pm-plugins/macro}/plugin-key.js +0 -0
- /package/dist/es2019/plugins/{expand → extension/pm-plugins/macro}/types.js +0 -0
- /package/dist/es2019/plugins/{macro → insert-block/ui/ElementBrowser}/types.js +0 -0
- /package/dist/esm/plugins/{macro → extension/pm-plugins/macro}/plugin-key.js +0 -0
- /package/dist/{es2019/ui/ElementBrowser → esm/plugins/extension/pm-plugins/macro}/types.js +0 -0
- /package/dist/esm/plugins/{expand → insert-block/ui/ElementBrowser}/types.js +0 -0
- /package/dist/types/plugins/{macro → extension/pm-plugins/macro}/actions.d.ts +0 -0
- /package/dist/types/plugins/{macro → extension/pm-plugins/macro}/plugin-key.d.ts +0 -0
- /package/dist/types/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.d.ts +0 -0
- /package/dist/types-ts4.5/plugins/{macro → extension/pm-plugins/macro}/actions.d.ts +0 -0
- /package/dist/types-ts4.5/plugins/{macro → extension/pm-plugins/macro}/plugin-key.d.ts +0 -0
- /package/dist/types-ts4.5/{ui → plugins/insert-block/ui}/ElementBrowser/InsertMenu.d.ts +0 -0
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
|
-
import { createSelectionClickHandler } from '@atlaskit/editor-common/selection';
|
|
4
|
-
import ExpandNodeView from '../nodeviews';
|
|
5
|
-
import { setExpandRef } from '../commands';
|
|
6
|
-
import { findExpand } from '../utils';
|
|
7
|
-
import { expandClassNames } from '../ui/class-names';
|
|
8
|
-
import { getPluginState, createPluginState, pluginKey } from './plugin-factory';
|
|
9
|
-
export function containsClass(element, className) {
|
|
10
|
-
var _element$classList;
|
|
11
|
-
return Boolean(element === null || element === void 0 ? void 0 : (_element$classList = element.classList) === null || _element$classList === void 0 ? void 0 : _element$classList.contains(className));
|
|
12
|
-
}
|
|
13
|
-
export const createPlugin = (dispatch, getIntl, appearance = 'full-page', useLongPressSelection = false, featureFlags, api) => {
|
|
14
|
-
const state = createPluginState(dispatch, {});
|
|
15
|
-
const isMobile = appearance === 'mobile';
|
|
16
|
-
return new SafePlugin({
|
|
17
|
-
state: state,
|
|
18
|
-
key: pluginKey,
|
|
19
|
-
props: {
|
|
20
|
-
nodeViews: {
|
|
21
|
-
expand: ExpandNodeView({
|
|
22
|
-
getIntl,
|
|
23
|
-
isMobile,
|
|
24
|
-
featureFlags,
|
|
25
|
-
api
|
|
26
|
-
}),
|
|
27
|
-
nestedExpand: ExpandNodeView({
|
|
28
|
-
getIntl,
|
|
29
|
-
isMobile,
|
|
30
|
-
featureFlags,
|
|
31
|
-
api
|
|
32
|
-
})
|
|
33
|
-
},
|
|
34
|
-
handleKeyDown(_view, event) {
|
|
35
|
-
return containsClass(event.target, expandClassNames.titleContainer);
|
|
36
|
-
},
|
|
37
|
-
handleKeyPress(_view, event) {
|
|
38
|
-
return containsClass(event.target, expandClassNames.titleContainer);
|
|
39
|
-
},
|
|
40
|
-
handleScrollToSelection() {
|
|
41
|
-
return containsClass(document.activeElement, expandClassNames.titleInput);
|
|
42
|
-
},
|
|
43
|
-
handleClickOn: createSelectionClickHandler(['expand', 'nestedExpand'], target => target.classList.contains(expandClassNames.prefix), {
|
|
44
|
-
useLongPressSelection
|
|
45
|
-
})
|
|
46
|
-
},
|
|
47
|
-
// @see ED-8027 to follow up on this work-around
|
|
48
|
-
filterTransaction(tr) {
|
|
49
|
-
if (containsClass(document.activeElement, expandClassNames.titleInput) && tr.selectionSet && (!tr.steps.length || tr.isGeneric)) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
return true;
|
|
53
|
-
},
|
|
54
|
-
view: editorView => {
|
|
55
|
-
const domAtPos = editorView.domAtPos.bind(editorView);
|
|
56
|
-
return {
|
|
57
|
-
update: view => {
|
|
58
|
-
const {
|
|
59
|
-
state,
|
|
60
|
-
dispatch
|
|
61
|
-
} = view;
|
|
62
|
-
const node = findExpand(state);
|
|
63
|
-
if (node) {
|
|
64
|
-
const expandRef = findDomRefAtPos(node.pos, domAtPos);
|
|
65
|
-
if (getPluginState(state).expandRef !== expandRef) {
|
|
66
|
-
setExpandRef(expandRef)(state, dispatch);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { pluginFactory } from '../../../utils/plugin-state-factory';
|
|
3
|
-
import reducer from '../reducer';
|
|
4
|
-
export const pluginKey = new PluginKey('expandPlugin');
|
|
5
|
-
export const {
|
|
6
|
-
createPluginState,
|
|
7
|
-
createCommand,
|
|
8
|
-
getPluginState
|
|
9
|
-
} = pluginFactory(pluginKey, reducer);
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
2
|
-
import commonMessages from '../../messages';
|
|
3
|
-
import { deleteExpand } from './commands';
|
|
4
|
-
import { getPluginState } from './pm-plugins/plugin-factory';
|
|
5
|
-
export const getToolbarConfig = api => (state, {
|
|
6
|
-
formatMessage
|
|
7
|
-
}) => {
|
|
8
|
-
var _api$decorations$acti, _api$decorations, _api$analytics;
|
|
9
|
-
const {
|
|
10
|
-
hoverDecoration
|
|
11
|
-
} = (_api$decorations$acti = api === null || api === void 0 ? void 0 : (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions) !== null && _api$decorations$acti !== void 0 ? _api$decorations$acti : {};
|
|
12
|
-
const editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
13
|
-
const {
|
|
14
|
-
expandRef
|
|
15
|
-
} = getPluginState(state);
|
|
16
|
-
if (expandRef) {
|
|
17
|
-
const {
|
|
18
|
-
nestedExpand,
|
|
19
|
-
expand
|
|
20
|
-
} = state.schema.nodes;
|
|
21
|
-
return {
|
|
22
|
-
title: 'Expand toolbar',
|
|
23
|
-
getDomRef: () => expandRef,
|
|
24
|
-
nodeType: [nestedExpand, expand],
|
|
25
|
-
offset: [0, 6],
|
|
26
|
-
items: [{
|
|
27
|
-
type: 'copy-button',
|
|
28
|
-
items: [{
|
|
29
|
-
state,
|
|
30
|
-
formatMessage,
|
|
31
|
-
nodeType: [nestedExpand, expand]
|
|
32
|
-
}, {
|
|
33
|
-
type: 'separator'
|
|
34
|
-
}]
|
|
35
|
-
}, {
|
|
36
|
-
id: 'editor.expand.delete',
|
|
37
|
-
type: 'button',
|
|
38
|
-
appearance: 'danger',
|
|
39
|
-
focusEditoronEnter: true,
|
|
40
|
-
icon: RemoveIcon,
|
|
41
|
-
onClick: deleteExpand(editorAnalyticsAPI),
|
|
42
|
-
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration([nestedExpand, expand], true),
|
|
43
|
-
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration([nestedExpand, expand], false),
|
|
44
|
-
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration([nestedExpand, expand], true),
|
|
45
|
-
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration([nestedExpand, expand], false),
|
|
46
|
-
title: formatMessage(commonMessages.remove),
|
|
47
|
-
tabIndex: null
|
|
48
|
-
}]
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
return;
|
|
52
|
-
};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
/** @jsx jsx */
|
|
3
|
-
import React, { useCallback } from 'react';
|
|
4
|
-
import { jsx } from '@emotion/react';
|
|
5
|
-
import Button from '@atlaskit/button/custom-theme-button';
|
|
6
|
-
import { expandMessages, expandLayoutWrapperStyle, ExpandLayoutWrapperWithRef } from '@atlaskit/editor-common/ui';
|
|
7
|
-
import { akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
|
|
8
|
-
import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
|
|
9
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
10
|
-
import { expandClassNames } from './class-names';
|
|
11
|
-
export const withTooltip = WrapperComponent => {
|
|
12
|
-
return class WithSortableColumn extends React.Component {
|
|
13
|
-
constructor(props) {
|
|
14
|
-
super(props);
|
|
15
|
-
}
|
|
16
|
-
render() {
|
|
17
|
-
const {
|
|
18
|
-
label
|
|
19
|
-
} = this.props;
|
|
20
|
-
return jsx(Tooltip, {
|
|
21
|
-
content: label,
|
|
22
|
-
position: "top",
|
|
23
|
-
tag: ExpandLayoutWrapperWithRef
|
|
24
|
-
}, jsx(WrapperComponent, this.props));
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export const CustomButton = props => {
|
|
29
|
-
const {
|
|
30
|
-
label,
|
|
31
|
-
allowInteractiveExpand
|
|
32
|
-
} = props;
|
|
33
|
-
const useTheme = useCallback((currentTheme, themeProps) => {
|
|
34
|
-
const {
|
|
35
|
-
buttonStyles,
|
|
36
|
-
...rest
|
|
37
|
-
} = currentTheme(themeProps);
|
|
38
|
-
return {
|
|
39
|
-
buttonStyles: {
|
|
40
|
-
...buttonStyles,
|
|
41
|
-
height: '100%',
|
|
42
|
-
'& svg': {
|
|
43
|
-
transform: props.expanded ? 'transform: rotate(90deg);' : 'transform: rotate(0deg);',
|
|
44
|
-
transition: `transform 0.2s ${akEditorSwoopCubicBezier};`
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
...rest
|
|
48
|
-
};
|
|
49
|
-
}, [props]);
|
|
50
|
-
return jsx(Button, {
|
|
51
|
-
appearance: "subtle",
|
|
52
|
-
className: expandClassNames.iconContainer,
|
|
53
|
-
iconBefore: jsx(ChevronRightIcon, {
|
|
54
|
-
label: label
|
|
55
|
-
}),
|
|
56
|
-
shouldFitContainer: true,
|
|
57
|
-
theme: useTheme,
|
|
58
|
-
isDisabled: !allowInteractiveExpand
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
const ButtonWithTooltip = withTooltip(CustomButton);
|
|
62
|
-
const ButtonWithoutTooltip = CustomButton;
|
|
63
|
-
export const ExpandIconButton = props => {
|
|
64
|
-
const {
|
|
65
|
-
expanded,
|
|
66
|
-
intl
|
|
67
|
-
} = props;
|
|
68
|
-
const message = expanded ? expandMessages.collapseNode : expandMessages.expandNode;
|
|
69
|
-
const label = intl && intl.formatMessage(message) || message.defaultMessage;
|
|
70
|
-
// check to ensure device supports any-hover
|
|
71
|
-
const supportsAnyHover = !!window.matchMedia ? window.matchMedia('(any-hover: hover)').matches !== window.matchMedia('(any-hover: none)').matches : false;
|
|
72
|
-
const hoverEventCheck = supportsAnyHover ? window.matchMedia('(any-hover: hover)').matches : true;
|
|
73
|
-
|
|
74
|
-
// hoverEventCheck is to disable tooltips for mobile to prevent incorrect hover state causing issues on iOS
|
|
75
|
-
if (props.allowInteractiveExpand && hoverEventCheck) {
|
|
76
|
-
return jsx(ButtonWithTooltip, _extends({
|
|
77
|
-
label: label
|
|
78
|
-
}, props));
|
|
79
|
-
}
|
|
80
|
-
return jsx("div", {
|
|
81
|
-
css: expandLayoutWrapperStyle
|
|
82
|
-
}, jsx(ButtonWithoutTooltip, _extends({
|
|
83
|
-
label: label
|
|
84
|
-
}, props)));
|
|
85
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const prefix = 'ak-editor-expand';
|
|
2
|
-
export const expandClassNames = {
|
|
3
|
-
prefix,
|
|
4
|
-
expanded: `${prefix}__expanded`,
|
|
5
|
-
titleContainer: `${prefix}__title-container`,
|
|
6
|
-
inputContainer: `${prefix}__input-container`,
|
|
7
|
-
iconContainer: `${prefix}__icon-container`,
|
|
8
|
-
icon: `${prefix}__icon`,
|
|
9
|
-
titleInput: `${prefix}__title-input`,
|
|
10
|
-
content: `${prefix}__content`,
|
|
11
|
-
type: type => `${prefix}__type-${type}`
|
|
12
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { findExpand, transformSliceToRemoveOpenExpand, transformSliceNestedExpandToExpand } from '@atlaskit/editor-common/transforms';
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
5
|
-
import { findTable } from '@atlaskit/editor-tables/utils';
|
|
6
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, INPUT_METHOD, EVENT_TYPE, PLATFORMS, MODE } from '@atlaskit/editor-common/analytics';
|
|
7
|
-
import { GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
|
|
8
|
-
import { findExpand } from './utils';
|
|
9
|
-
import { createCommand } from './pm-plugins/plugin-factory';
|
|
10
|
-
import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
|
|
11
|
-
import { safeInsert } from '@atlaskit/editor-prosemirror/utils';
|
|
12
|
-
export var setExpandRef = function setExpandRef(ref) {
|
|
13
|
-
return createCommand({
|
|
14
|
-
type: 'SET_EXPAND_REF',
|
|
15
|
-
data: {
|
|
16
|
-
ref: ref
|
|
17
|
-
}
|
|
18
|
-
}, function (tr) {
|
|
19
|
-
return tr.setMeta('addToHistory', false);
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
export var deleteExpandAtPos = function deleteExpandAtPos(editorAnalyticsAPI) {
|
|
23
|
-
return function (expandNodePos, expandNode) {
|
|
24
|
-
return function (state, dispatch) {
|
|
25
|
-
if (!expandNode || isNaN(expandNodePos)) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
var payload = {
|
|
29
|
-
action: ACTION.DELETED,
|
|
30
|
-
actionSubject: expandNode.type === state.schema.nodes.expand ? ACTION_SUBJECT.EXPAND : ACTION_SUBJECT.NESTED_EXPAND,
|
|
31
|
-
attributes: {
|
|
32
|
-
inputMethod: INPUT_METHOD.TOOLBAR
|
|
33
|
-
},
|
|
34
|
-
eventType: EVENT_TYPE.TRACK
|
|
35
|
-
};
|
|
36
|
-
if (expandNode && dispatch) {
|
|
37
|
-
var tr = state.tr;
|
|
38
|
-
tr.delete(expandNodePos, expandNodePos + expandNode.nodeSize);
|
|
39
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
|
|
40
|
-
dispatch(tr);
|
|
41
|
-
}
|
|
42
|
-
return true;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
export var deleteExpand = function deleteExpand(editorAnalyticsAPI) {
|
|
47
|
-
return function (state, dispatch) {
|
|
48
|
-
var expandNode = findExpand(state);
|
|
49
|
-
if (!expandNode) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
return deleteExpandAtPos(editorAnalyticsAPI)(expandNode.pos, expandNode.node)(state, dispatch);
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
export var updateExpandTitle = function updateExpandTitle(title, pos, nodeType) {
|
|
56
|
-
return function (state, dispatch) {
|
|
57
|
-
var node = state.doc.nodeAt(pos);
|
|
58
|
-
if (node && node.type === nodeType && dispatch) {
|
|
59
|
-
var tr = state.tr;
|
|
60
|
-
tr.setNodeMarkup(pos, node.type, _objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
61
|
-
title: title
|
|
62
|
-
}), node.marks);
|
|
63
|
-
dispatch(tr);
|
|
64
|
-
}
|
|
65
|
-
return true;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
export var toggleExpandExpanded = function toggleExpandExpanded(editorAnalyticsAPI) {
|
|
69
|
-
return function (pos, nodeType) {
|
|
70
|
-
return function (state, dispatch) {
|
|
71
|
-
var node = state.doc.nodeAt(pos);
|
|
72
|
-
if (node && node.type === nodeType && dispatch) {
|
|
73
|
-
var tr = state.tr;
|
|
74
|
-
var isExpandedNext = !node.attrs.__expanded;
|
|
75
|
-
tr.setNodeMarkup(pos, node.type, _objectSpread(_objectSpread({}, node.attrs), {}, {
|
|
76
|
-
__expanded: isExpandedNext
|
|
77
|
-
}), node.marks);
|
|
78
|
-
|
|
79
|
-
// If we're going to collapse the expand and our cursor is currently inside
|
|
80
|
-
// Move to a right gap cursor, if the toolbar is interacted (or an API),
|
|
81
|
-
// it will insert below rather than inside (which will be invisible).
|
|
82
|
-
if (isExpandedNext === false && findExpand(state)) {
|
|
83
|
-
tr.setSelection(new GapCursorSelection(tr.doc.resolve(pos + node.nodeSize), Side.RIGHT));
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// log when people open/close expands
|
|
87
|
-
// TODO: ED-8523 make platform/mode global attributes?
|
|
88
|
-
var payload = {
|
|
89
|
-
action: ACTION.TOGGLE_EXPAND,
|
|
90
|
-
actionSubject: nodeType === state.schema.nodes.expand ? ACTION_SUBJECT.EXPAND : ACTION_SUBJECT.NESTED_EXPAND,
|
|
91
|
-
attributes: {
|
|
92
|
-
platform: PLATFORMS.WEB,
|
|
93
|
-
mode: MODE.EDITOR,
|
|
94
|
-
expanded: isExpandedNext
|
|
95
|
-
},
|
|
96
|
-
eventType: EVENT_TYPE.TRACK
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
// `isRemote` meta prevents this step from being
|
|
100
|
-
// sync'd between sessions in collab edit
|
|
101
|
-
tr.setMeta('isRemote', true);
|
|
102
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
|
|
103
|
-
dispatch(tr);
|
|
104
|
-
}
|
|
105
|
-
return true;
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
// Creates either an expand or a nestedExpand node based on the current selection
|
|
111
|
-
export var createExpandNode = function createExpandNode(state) {
|
|
112
|
-
var _state$schema$nodes = state.schema.nodes,
|
|
113
|
-
expand = _state$schema$nodes.expand,
|
|
114
|
-
nestedExpand = _state$schema$nodes.nestedExpand;
|
|
115
|
-
var expandType = findTable(state.selection) ? nestedExpand : expand;
|
|
116
|
-
return expandType.createAndFill({});
|
|
117
|
-
};
|
|
118
|
-
export var insertExpand = function insertExpand(editorAnalyticsAPI) {
|
|
119
|
-
return function (state, dispatch) {
|
|
120
|
-
var expandNode = createExpandNode(state);
|
|
121
|
-
if (!expandNode) {
|
|
122
|
-
return false;
|
|
123
|
-
}
|
|
124
|
-
var tr = state.selection.empty ? safeInsert(expandNode)(state.tr).scrollIntoView() : createWrapSelectionTransaction({
|
|
125
|
-
state: state,
|
|
126
|
-
type: expandNode.type
|
|
127
|
-
});
|
|
128
|
-
var payload = {
|
|
129
|
-
action: ACTION.INSERTED,
|
|
130
|
-
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
131
|
-
actionSubjectId: (expandNode === null || expandNode === void 0 ? void 0 : expandNode.type) === state.schema.nodes.expand ? ACTION_SUBJECT_ID.EXPAND : ACTION_SUBJECT_ID.NESTED_EXPAND,
|
|
132
|
-
attributes: {
|
|
133
|
-
inputMethod: INPUT_METHOD.INSERT_MENU
|
|
134
|
-
},
|
|
135
|
-
eventType: EVENT_TYPE.TRACK
|
|
136
|
-
};
|
|
137
|
-
if (dispatch && expandNode) {
|
|
138
|
-
editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.attachAnalyticsEvent(payload)(tr);
|
|
139
|
-
dispatch(tr);
|
|
140
|
-
}
|
|
141
|
-
return true;
|
|
142
|
-
};
|
|
143
|
-
};
|
|
144
|
-
export var focusTitle = function focusTitle(pos) {
|
|
145
|
-
return function (state, dispatch, editorView) {
|
|
146
|
-
if (editorView) {
|
|
147
|
-
var dom = editorView.domAtPos(pos);
|
|
148
|
-
var expandWrapper = dom.node.parentElement;
|
|
149
|
-
if (expandWrapper) {
|
|
150
|
-
setSelectionInsideExpand(pos)(state, dispatch, editorView);
|
|
151
|
-
var input = expandWrapper.querySelector('input');
|
|
152
|
-
if (input) {
|
|
153
|
-
input.focus();
|
|
154
|
-
return true;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return false;
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
// Used to clear any node or cell selection when expand title is focused
|
|
163
|
-
export var setSelectionInsideExpand = function setSelectionInsideExpand(expandPos) {
|
|
164
|
-
return function (state, dispatch, editorView) {
|
|
165
|
-
if (editorView) {
|
|
166
|
-
if (!editorView.hasFocus()) {
|
|
167
|
-
editorView.focus();
|
|
168
|
-
}
|
|
169
|
-
var sel = Selection.findFrom(editorView.state.doc.resolve(expandPos), 1, true);
|
|
170
|
-
if (sel && dispatch) {
|
|
171
|
-
dispatch(editorView.state.tr.setSelection(sel));
|
|
172
|
-
}
|
|
173
|
-
return true;
|
|
174
|
-
}
|
|
175
|
-
return false;
|
|
176
|
-
};
|
|
177
|
-
};
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import _typeof from "@babel/runtime/helpers/typeof";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { expand, nestedExpand } from '@atlaskit/adf-schema';
|
|
4
|
-
import { createPlugin } from './pm-plugins/main';
|
|
5
|
-
import { expandKeymap } from './pm-plugins/keymap';
|
|
6
|
-
import { IconExpand } from '@atlaskit/editor-common/quick-insert';
|
|
7
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
8
|
-
import { getToolbarConfig } from './toolbar';
|
|
9
|
-
import { createExpandNode, insertExpand } from './commands';
|
|
10
|
-
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
|
-
import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
|
|
12
|
-
var expandPlugin = function expandPlugin(_ref) {
|
|
13
|
-
var _api$featureFlags, _api$analytics;
|
|
14
|
-
var _ref$config = _ref.config,
|
|
15
|
-
options = _ref$config === void 0 ? {} : _ref$config,
|
|
16
|
-
api = _ref.api;
|
|
17
|
-
var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
18
|
-
return {
|
|
19
|
-
name: 'expand',
|
|
20
|
-
nodes: function nodes() {
|
|
21
|
-
return [{
|
|
22
|
-
name: 'expand',
|
|
23
|
-
node: expand
|
|
24
|
-
}, {
|
|
25
|
-
name: 'nestedExpand',
|
|
26
|
-
node: nestedExpand
|
|
27
|
-
}];
|
|
28
|
-
},
|
|
29
|
-
actions: {
|
|
30
|
-
insertExpand: insertExpand(api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions)
|
|
31
|
-
},
|
|
32
|
-
pmPlugins: function pmPlugins() {
|
|
33
|
-
return [{
|
|
34
|
-
name: 'expand',
|
|
35
|
-
plugin: function plugin(_ref2) {
|
|
36
|
-
var dispatch = _ref2.dispatch,
|
|
37
|
-
getIntl = _ref2.getIntl;
|
|
38
|
-
return createPlugin(dispatch, getIntl, options.appearance, options.useLongPressSelection, featureFlags, api);
|
|
39
|
-
}
|
|
40
|
-
}, {
|
|
41
|
-
name: 'expandKeymap',
|
|
42
|
-
plugin: function plugin() {
|
|
43
|
-
return expandKeymap(api);
|
|
44
|
-
}
|
|
45
|
-
}];
|
|
46
|
-
},
|
|
47
|
-
pluginsOptions: {
|
|
48
|
-
floatingToolbar: getToolbarConfig(api),
|
|
49
|
-
quickInsert: function quickInsert(_ref3) {
|
|
50
|
-
var formatMessage = _ref3.formatMessage;
|
|
51
|
-
if (options && options.allowInsertion !== true) {
|
|
52
|
-
return [];
|
|
53
|
-
}
|
|
54
|
-
return [{
|
|
55
|
-
id: 'expand',
|
|
56
|
-
title: formatMessage(messages.expand),
|
|
57
|
-
description: formatMessage(messages.expandDescription),
|
|
58
|
-
keywords: ['accordion', 'collapse'],
|
|
59
|
-
priority: 600,
|
|
60
|
-
icon: function icon() {
|
|
61
|
-
return /*#__PURE__*/React.createElement(IconExpand, null);
|
|
62
|
-
},
|
|
63
|
-
action: function action(insert, state) {
|
|
64
|
-
var _api$analytics2;
|
|
65
|
-
var node = createExpandNode(state);
|
|
66
|
-
if (!node) {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
var tr = state.selection.empty ? insert(node) : createWrapSelectionTransaction({
|
|
70
|
-
state: state,
|
|
71
|
-
type: node.type
|
|
72
|
-
});
|
|
73
|
-
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent({
|
|
74
|
-
action: ACTION.INSERTED,
|
|
75
|
-
actionSubject: ACTION_SUBJECT.DOCUMENT,
|
|
76
|
-
actionSubjectId: node.type === state.schema.nodes.nestedExpand ? ACTION_SUBJECT_ID.NESTED_EXPAND : ACTION_SUBJECT_ID.EXPAND,
|
|
77
|
-
attributes: {
|
|
78
|
-
inputMethod: INPUT_METHOD.QUICK_INSERT
|
|
79
|
-
},
|
|
80
|
-
eventType: EVENT_TYPE.TRACK
|
|
81
|
-
})(tr);
|
|
82
|
-
return tr;
|
|
83
|
-
}
|
|
84
|
-
}];
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
export default expandPlugin;
|
|
90
|
-
export function isExpandInsertionEnabled(_ref4) {
|
|
91
|
-
var allowExpand = _ref4.allowExpand;
|
|
92
|
-
if (allowExpand && _typeof(allowExpand) === 'object') {
|
|
93
|
-
return !!allowExpand.allowInsertion;
|
|
94
|
-
}
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
export { pluginKey } from './pm-plugins/plugin-factory';
|