@atlaskit/editor-core 189.3.14 → 189.3.15
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 +10 -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/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 -17
- package/dist/cjs/presets/context.js +5 -3
- package/dist/cjs/presets/universal.js +12 -3
- 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/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 -1
- package/dist/es2019/presets/context.js +2 -2
- package/dist/es2019/presets/universal.js +10 -1
- 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/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 -1
- package/dist/esm/presets/context.js +2 -2
- package/dist/esm/presets/universal.js +9 -1
- 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/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 -1
- package/dist/types/plugins/insert-block/types.d.ts +1 -1
- package/dist/types/plugins/mobile-dimensions/index.d.ts +2 -1
- package/dist/types/presets/context.d.ts +2 -2
- 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/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 -1
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/mobile-dimensions/index.d.ts +2 -1
- package/dist/types-ts4.5/presets/context.d.ts +2 -2
- 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 +3 -7
- 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/types.js +0 -5
- 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/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/types.js +0 -1
- 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/types.js +0 -1
- 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/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-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
|
@@ -1,77 +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 || (_element$classList = element.classList) === null || _element$classList === void 0 ? void 0 : _element$classList.contains(className));
|
|
12
|
-
}
|
|
13
|
-
export var createPlugin = function createPlugin(dispatch, getIntl) {
|
|
14
|
-
var appearance = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'full-page';
|
|
15
|
-
var useLongPressSelection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
16
|
-
var featureFlags = arguments.length > 4 ? arguments[4] : undefined;
|
|
17
|
-
var api = arguments.length > 5 ? arguments[5] : undefined;
|
|
18
|
-
var state = createPluginState(dispatch, {});
|
|
19
|
-
var isMobile = appearance === 'mobile';
|
|
20
|
-
return new SafePlugin({
|
|
21
|
-
state: state,
|
|
22
|
-
key: pluginKey,
|
|
23
|
-
props: {
|
|
24
|
-
nodeViews: {
|
|
25
|
-
expand: ExpandNodeView({
|
|
26
|
-
getIntl: getIntl,
|
|
27
|
-
isMobile: isMobile,
|
|
28
|
-
featureFlags: featureFlags,
|
|
29
|
-
api: api
|
|
30
|
-
}),
|
|
31
|
-
nestedExpand: ExpandNodeView({
|
|
32
|
-
getIntl: getIntl,
|
|
33
|
-
isMobile: isMobile,
|
|
34
|
-
featureFlags: featureFlags,
|
|
35
|
-
api: api
|
|
36
|
-
})
|
|
37
|
-
},
|
|
38
|
-
handleKeyDown: function handleKeyDown(_view, event) {
|
|
39
|
-
return containsClass(event.target, expandClassNames.titleContainer);
|
|
40
|
-
},
|
|
41
|
-
handleKeyPress: function handleKeyPress(_view, event) {
|
|
42
|
-
return containsClass(event.target, expandClassNames.titleContainer);
|
|
43
|
-
},
|
|
44
|
-
handleScrollToSelection: function handleScrollToSelection() {
|
|
45
|
-
return containsClass(document.activeElement, expandClassNames.titleInput);
|
|
46
|
-
},
|
|
47
|
-
handleClickOn: createSelectionClickHandler(['expand', 'nestedExpand'], function (target) {
|
|
48
|
-
return target.classList.contains(expandClassNames.prefix);
|
|
49
|
-
}, {
|
|
50
|
-
useLongPressSelection: useLongPressSelection
|
|
51
|
-
})
|
|
52
|
-
},
|
|
53
|
-
// @see ED-8027 to follow up on this work-around
|
|
54
|
-
filterTransaction: function filterTransaction(tr) {
|
|
55
|
-
if (containsClass(document.activeElement, expandClassNames.titleInput) && tr.selectionSet && (!tr.steps.length || tr.isGeneric)) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
return true;
|
|
59
|
-
},
|
|
60
|
-
view: function view(editorView) {
|
|
61
|
-
var domAtPos = editorView.domAtPos.bind(editorView);
|
|
62
|
-
return {
|
|
63
|
-
update: function update(view) {
|
|
64
|
-
var state = view.state,
|
|
65
|
-
dispatch = view.dispatch;
|
|
66
|
-
var node = findExpand(state);
|
|
67
|
-
if (node) {
|
|
68
|
-
var expandRef = findDomRefAtPos(node.pos, domAtPos);
|
|
69
|
-
if (getPluginState(state).expandRef !== expandRef) {
|
|
70
|
-
setExpandRef(expandRef)(state, dispatch);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
};
|
|
@@ -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 var pluginKey = new PluginKey('expandPlugin');
|
|
5
|
-
var _pluginFactory = pluginFactory(pluginKey, reducer),
|
|
6
|
-
createPluginState = _pluginFactory.createPluginState,
|
|
7
|
-
createCommand = _pluginFactory.createCommand,
|
|
8
|
-
getPluginState = _pluginFactory.getPluginState;
|
|
9
|
-
export { createPluginState, createCommand, getPluginState };
|
|
@@ -1,13 +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
|
-
export default (function (pluginState, action) {
|
|
5
|
-
switch (action.type) {
|
|
6
|
-
case 'SET_EXPAND_REF':
|
|
7
|
-
return _objectSpread(_objectSpread({}, pluginState), {}, {
|
|
8
|
-
expandRef: action.data.ref
|
|
9
|
-
});
|
|
10
|
-
default:
|
|
11
|
-
return pluginState;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
@@ -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 var getToolbarConfig = function getToolbarConfig(api) {
|
|
6
|
-
return function (state, _ref) {
|
|
7
|
-
var _api$decorations$acti, _api$decorations, _api$analytics;
|
|
8
|
-
var formatMessage = _ref.formatMessage;
|
|
9
|
-
var _ref2 = (_api$decorations$acti = api === null || api === 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 : {},
|
|
10
|
-
hoverDecoration = _ref2.hoverDecoration;
|
|
11
|
-
var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
12
|
-
var _getPluginState = getPluginState(state),
|
|
13
|
-
expandRef = _getPluginState.expandRef;
|
|
14
|
-
if (expandRef) {
|
|
15
|
-
var _state$schema$nodes = state.schema.nodes,
|
|
16
|
-
nestedExpand = _state$schema$nodes.nestedExpand,
|
|
17
|
-
expand = _state$schema$nodes.expand;
|
|
18
|
-
return {
|
|
19
|
-
title: 'Expand toolbar',
|
|
20
|
-
getDomRef: function getDomRef() {
|
|
21
|
-
return expandRef;
|
|
22
|
-
},
|
|
23
|
-
nodeType: [nestedExpand, expand],
|
|
24
|
-
offset: [0, 6],
|
|
25
|
-
items: [{
|
|
26
|
-
type: 'copy-button',
|
|
27
|
-
items: [{
|
|
28
|
-
state: state,
|
|
29
|
-
formatMessage: formatMessage,
|
|
30
|
-
nodeType: [nestedExpand, expand]
|
|
31
|
-
}, {
|
|
32
|
-
type: 'separator'
|
|
33
|
-
}]
|
|
34
|
-
}, {
|
|
35
|
-
id: 'editor.expand.delete',
|
|
36
|
-
type: 'button',
|
|
37
|
-
appearance: 'danger',
|
|
38
|
-
focusEditoronEnter: true,
|
|
39
|
-
icon: RemoveIcon,
|
|
40
|
-
onClick: deleteExpand(editorAnalyticsAPI),
|
|
41
|
-
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration([nestedExpand, expand], true),
|
|
42
|
-
onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration([nestedExpand, expand], false),
|
|
43
|
-
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration([nestedExpand, expand], true),
|
|
44
|
-
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration([nestedExpand, expand], false),
|
|
45
|
-
title: formatMessage(commonMessages.remove),
|
|
46
|
-
tabIndex: null
|
|
47
|
-
}]
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
return;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
5
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
|
-
var _excluded = ["buttonStyles"];
|
|
10
|
-
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; }
|
|
11
|
-
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; }
|
|
12
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
13
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
|
-
/** @jsx jsx */
|
|
15
|
-
import React, { useCallback } from 'react';
|
|
16
|
-
import { jsx } from '@emotion/react';
|
|
17
|
-
import Button from '@atlaskit/button/custom-theme-button';
|
|
18
|
-
import { expandMessages, expandLayoutWrapperStyle, ExpandLayoutWrapperWithRef } from '@atlaskit/editor-common/ui';
|
|
19
|
-
import { akEditorSwoopCubicBezier } from '@atlaskit/editor-shared-styles';
|
|
20
|
-
import ChevronRightIcon from '@atlaskit/icon/glyph/chevron-right';
|
|
21
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
22
|
-
import { expandClassNames } from './class-names';
|
|
23
|
-
export var withTooltip = function withTooltip(WrapperComponent) {
|
|
24
|
-
return /*#__PURE__*/function (_React$Component) {
|
|
25
|
-
_inherits(WithSortableColumn, _React$Component);
|
|
26
|
-
var _super = _createSuper(WithSortableColumn);
|
|
27
|
-
function WithSortableColumn(props) {
|
|
28
|
-
_classCallCheck(this, WithSortableColumn);
|
|
29
|
-
return _super.call(this, props);
|
|
30
|
-
}
|
|
31
|
-
_createClass(WithSortableColumn, [{
|
|
32
|
-
key: "render",
|
|
33
|
-
value: function render() {
|
|
34
|
-
var label = this.props.label;
|
|
35
|
-
return jsx(Tooltip, {
|
|
36
|
-
content: label,
|
|
37
|
-
position: "top",
|
|
38
|
-
tag: ExpandLayoutWrapperWithRef
|
|
39
|
-
}, jsx(WrapperComponent, this.props));
|
|
40
|
-
}
|
|
41
|
-
}]);
|
|
42
|
-
return WithSortableColumn;
|
|
43
|
-
}(React.Component);
|
|
44
|
-
};
|
|
45
|
-
export var CustomButton = function CustomButton(props) {
|
|
46
|
-
var label = props.label,
|
|
47
|
-
allowInteractiveExpand = props.allowInteractiveExpand;
|
|
48
|
-
var useTheme = useCallback(function (currentTheme, themeProps) {
|
|
49
|
-
var _currentTheme = currentTheme(themeProps),
|
|
50
|
-
buttonStyles = _currentTheme.buttonStyles,
|
|
51
|
-
rest = _objectWithoutProperties(_currentTheme, _excluded);
|
|
52
|
-
return _objectSpread({
|
|
53
|
-
buttonStyles: _objectSpread(_objectSpread({}, buttonStyles), {}, {
|
|
54
|
-
height: '100%',
|
|
55
|
-
'& svg': {
|
|
56
|
-
transform: props.expanded ? 'transform: rotate(90deg);' : 'transform: rotate(0deg);',
|
|
57
|
-
transition: "transform 0.2s ".concat(akEditorSwoopCubicBezier, ";")
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
}, rest);
|
|
61
|
-
}, [props]);
|
|
62
|
-
return jsx(Button, {
|
|
63
|
-
appearance: "subtle",
|
|
64
|
-
className: expandClassNames.iconContainer,
|
|
65
|
-
iconBefore: jsx(ChevronRightIcon, {
|
|
66
|
-
label: label
|
|
67
|
-
}),
|
|
68
|
-
shouldFitContainer: true,
|
|
69
|
-
theme: useTheme,
|
|
70
|
-
isDisabled: !allowInteractiveExpand
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
var ButtonWithTooltip = withTooltip(CustomButton);
|
|
74
|
-
var ButtonWithoutTooltip = CustomButton;
|
|
75
|
-
export var ExpandIconButton = function ExpandIconButton(props) {
|
|
76
|
-
var expanded = props.expanded,
|
|
77
|
-
intl = props.intl;
|
|
78
|
-
var message = expanded ? expandMessages.collapseNode : expandMessages.expandNode;
|
|
79
|
-
var label = intl && intl.formatMessage(message) || message.defaultMessage;
|
|
80
|
-
// check to ensure device supports any-hover
|
|
81
|
-
var supportsAnyHover = !!window.matchMedia ? window.matchMedia('(any-hover: hover)').matches !== window.matchMedia('(any-hover: none)').matches : false;
|
|
82
|
-
var hoverEventCheck = supportsAnyHover ? window.matchMedia('(any-hover: hover)').matches : true;
|
|
83
|
-
|
|
84
|
-
// hoverEventCheck is to disable tooltips for mobile to prevent incorrect hover state causing issues on iOS
|
|
85
|
-
if (props.allowInteractiveExpand && hoverEventCheck) {
|
|
86
|
-
return jsx(ButtonWithTooltip, _extends({
|
|
87
|
-
label: label
|
|
88
|
-
}, props));
|
|
89
|
-
}
|
|
90
|
-
return jsx("div", {
|
|
91
|
-
css: expandLayoutWrapperStyle
|
|
92
|
-
}, jsx(ButtonWithoutTooltip, _extends({
|
|
93
|
-
label: label
|
|
94
|
-
}, props)));
|
|
95
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
var prefix = 'ak-editor-expand';
|
|
2
|
-
export var expandClassNames = {
|
|
3
|
-
prefix: prefix,
|
|
4
|
-
expanded: "".concat(prefix, "__expanded"),
|
|
5
|
-
titleContainer: "".concat(prefix, "__title-container"),
|
|
6
|
-
inputContainer: "".concat(prefix, "__input-container"),
|
|
7
|
-
iconContainer: "".concat(prefix, "__icon-container"),
|
|
8
|
-
icon: "".concat(prefix, "__icon"),
|
|
9
|
-
titleInput: "".concat(prefix, "__title-input"),
|
|
10
|
-
content: "".concat(prefix, "__content"),
|
|
11
|
-
type: function type(_type) {
|
|
12
|
-
return "".concat(prefix, "__type-").concat(_type);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { findExpand, transformSliceToRemoveOpenExpand, transformSliceNestedExpandToExpand } from '@atlaskit/editor-common/transforms';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { Node as PMNode, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
|
-
export declare const setExpandRef: (ref?: HTMLDivElement | null) => Command;
|
|
6
|
-
export declare const deleteExpandAtPos: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (expandNodePos: number, expandNode: PMNode) => Command;
|
|
7
|
-
export declare const deleteExpand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
8
|
-
export declare const updateExpandTitle: (title: string, pos: number, nodeType: NodeType) => Command;
|
|
9
|
-
export declare const toggleExpandExpanded: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (pos: number, nodeType: NodeType) => Command;
|
|
10
|
-
export declare const createExpandNode: (state: EditorState) => PMNode | null;
|
|
11
|
-
export declare const insertExpand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
12
|
-
export declare const focusTitle: (pos: number) => Command;
|
|
13
|
-
export declare const setSelectionInsideExpand: (expandPos: number) => Command;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { NextEditorPlugin, EditorProps } from '../../types';
|
|
2
|
-
import { insertExpand } from './commands';
|
|
3
|
-
import type { LongPressSelectionPluginOptions, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
5
|
-
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
6
|
-
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
7
|
-
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
8
|
-
interface ExpandPluginOptions extends LongPressSelectionPluginOptions {
|
|
9
|
-
allowInsertion?: boolean;
|
|
10
|
-
appearance?: EditorProps['appearance'];
|
|
11
|
-
}
|
|
12
|
-
export type ExpandPlugin = NextEditorPlugin<'expand', {
|
|
13
|
-
pluginConfiguration: ExpandPluginOptions | undefined;
|
|
14
|
-
dependencies: [
|
|
15
|
-
FeatureFlagsPlugin,
|
|
16
|
-
DecorationsPlugin,
|
|
17
|
-
SelectionPlugin,
|
|
18
|
-
OptionalPlugin<AnalyticsPlugin>
|
|
19
|
-
];
|
|
20
|
-
actions: {
|
|
21
|
-
insertExpand: ReturnType<typeof insertExpand>;
|
|
22
|
-
};
|
|
23
|
-
}>;
|
|
24
|
-
declare const expandPlugin: ExpandPlugin;
|
|
25
|
-
interface ExpandEditorProps {
|
|
26
|
-
allowExpand?: EditorProps['allowExpand'];
|
|
27
|
-
}
|
|
28
|
-
export default expandPlugin;
|
|
29
|
-
export type { ExpandPluginState } from './types';
|
|
30
|
-
export declare function isExpandInsertionEnabled({ allowExpand }: ExpandEditorProps): boolean;
|
|
31
|
-
export { pluginKey } from './pm-plugins/plugin-factory';
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl-next';
|
|
2
|
-
import type { EditorView, NodeView, Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import type { getPosHandlerNode, getPosHandler } from '../../../nodeviews/';
|
|
5
|
-
import type { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
-
import type expandPlugin from '../index';
|
|
7
|
-
import type { SetSelectionRelativeToNode } from '@atlaskit/editor-common/selection';
|
|
8
|
-
export declare class ExpandNodeView implements NodeView {
|
|
9
|
-
private selectNearNode;
|
|
10
|
-
node: PmNode;
|
|
11
|
-
view: EditorView;
|
|
12
|
-
dom: HTMLElement;
|
|
13
|
-
contentDOM?: HTMLElement;
|
|
14
|
-
icon?: HTMLElement | null;
|
|
15
|
-
input?: HTMLInputElement | null;
|
|
16
|
-
titleContainer?: HTMLElement | null;
|
|
17
|
-
content?: HTMLElement | null;
|
|
18
|
-
getPos: getPosHandlerNode;
|
|
19
|
-
intl: IntlShape;
|
|
20
|
-
allowInteractiveExpand: boolean;
|
|
21
|
-
isMobile: boolean;
|
|
22
|
-
featureFlags: FeatureFlags;
|
|
23
|
-
api: ExtractInjectionAPI<typeof expandPlugin> | undefined;
|
|
24
|
-
constructor(node: PmNode, view: EditorView, getPos: getPosHandlerNode, getIntl: () => IntlShape, isMobile: boolean, featureFlags: FeatureFlags, selectNearNode: SetSelectionRelativeToNode | undefined, api: ExtractInjectionAPI<typeof expandPlugin> | undefined);
|
|
25
|
-
private initHandlers;
|
|
26
|
-
private focusTitle;
|
|
27
|
-
private handleIconKeyDown;
|
|
28
|
-
private renderIcon;
|
|
29
|
-
private isAllowInteractiveExpandEnabled;
|
|
30
|
-
private handleClick;
|
|
31
|
-
private handleInput;
|
|
32
|
-
private handleFocus;
|
|
33
|
-
private handleTitleKeydown;
|
|
34
|
-
private deleteExpand;
|
|
35
|
-
private toggleExpand;
|
|
36
|
-
private moveToOutsideOfTitle;
|
|
37
|
-
private isCollapsed;
|
|
38
|
-
private setRightGapCursor;
|
|
39
|
-
private setLeftGapCursor;
|
|
40
|
-
private handleArrowRightFromTitle;
|
|
41
|
-
private handleArrowLeftFromTitle;
|
|
42
|
-
stopEvent(event: Event): boolean;
|
|
43
|
-
ignoreMutation(mutationRecord: MutationRecord | {
|
|
44
|
-
type: 'selection';
|
|
45
|
-
target: Element;
|
|
46
|
-
}): boolean;
|
|
47
|
-
update(node: PmNode, _decorations: readonly Decoration[]): boolean;
|
|
48
|
-
destroy(): void;
|
|
49
|
-
}
|
|
50
|
-
export default function ({ getIntl, isMobile, featureFlags, api, }: {
|
|
51
|
-
getIntl: () => IntlShape;
|
|
52
|
-
isMobile: boolean;
|
|
53
|
-
featureFlags: FeatureFlags;
|
|
54
|
-
api: ExtractInjectionAPI<typeof expandPlugin> | undefined;
|
|
55
|
-
}): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type expandPlugin from '../index';
|
|
4
|
-
export declare function expandKeymap(api: ExtractInjectionAPI<typeof expandPlugin> | undefined): SafePlugin;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { Dispatch } from '../../../event-dispatcher';
|
|
3
|
-
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { IntlShape } from 'react-intl-next';
|
|
5
|
-
import type { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
-
import type expandPlugin from '../index';
|
|
7
|
-
export declare function containsClass(element: Element | null, className: string): boolean;
|
|
8
|
-
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, featureFlags: FeatureFlags, api: ExtractInjectionAPI<typeof expandPlugin> | undefined) => SafePlugin<import("../types").ExpandPluginState>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
export declare const pluginKey: PluginKey<any>;
|
|
3
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("..").ExpandPluginState | ((state: import("prosemirror-state").EditorState) => import("..").ExpandPluginState)) => import("prosemirror-state").SafeStateField<import("..").ExpandPluginState>, createCommand: <A = import("../types").ExpandPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("..").ExpandPluginState;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { jsx } from '@emotion/react';
|
|
4
|
-
import { IntlShape } from 'react-intl-next';
|
|
5
|
-
interface ExpandIconButtonProps {
|
|
6
|
-
allowInteractiveExpand: boolean;
|
|
7
|
-
expanded: boolean;
|
|
8
|
-
intl?: IntlShape;
|
|
9
|
-
}
|
|
10
|
-
interface ExpandIconButtonWithLabelProps extends ExpandIconButtonProps {
|
|
11
|
-
label: string;
|
|
12
|
-
}
|
|
13
|
-
export declare const withTooltip: (WrapperComponent: React.ElementType) => {
|
|
14
|
-
new (props: ExpandIconButtonWithLabelProps): {
|
|
15
|
-
render(): jsx.JSX.Element;
|
|
16
|
-
context: any;
|
|
17
|
-
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<ExpandIconButtonWithLabelProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
18
|
-
forceUpdate(callback?: (() => void) | undefined): void;
|
|
19
|
-
readonly props: Readonly<ExpandIconButtonWithLabelProps> & Readonly<{
|
|
20
|
-
children?: React.ReactNode;
|
|
21
|
-
}>;
|
|
22
|
-
state: Readonly<{}>;
|
|
23
|
-
refs: {
|
|
24
|
-
[key: string]: React.ReactInstance;
|
|
25
|
-
};
|
|
26
|
-
componentDidMount?(): void;
|
|
27
|
-
shouldComponentUpdate?(nextProps: Readonly<ExpandIconButtonWithLabelProps>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
28
|
-
componentWillUnmount?(): void;
|
|
29
|
-
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
30
|
-
getSnapshotBeforeUpdate?(prevProps: Readonly<ExpandIconButtonWithLabelProps>, prevState: Readonly<{}>): any;
|
|
31
|
-
componentDidUpdate?(prevProps: Readonly<ExpandIconButtonWithLabelProps>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
32
|
-
componentWillMount?(): void;
|
|
33
|
-
UNSAFE_componentWillMount?(): void;
|
|
34
|
-
componentWillReceiveProps?(nextProps: Readonly<ExpandIconButtonWithLabelProps>, nextContext: any): void;
|
|
35
|
-
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<ExpandIconButtonWithLabelProps>, nextContext: any): void;
|
|
36
|
-
componentWillUpdate?(nextProps: Readonly<ExpandIconButtonWithLabelProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
37
|
-
UNSAFE_componentWillUpdate?(nextProps: Readonly<ExpandIconButtonWithLabelProps>, nextState: Readonly<{}>, nextContext: any): void;
|
|
38
|
-
};
|
|
39
|
-
contextType?: React.Context<any> | undefined;
|
|
40
|
-
};
|
|
41
|
-
export declare const CustomButton: (props: ExpandIconButtonWithLabelProps) => jsx.JSX.Element;
|
|
42
|
-
export declare const ExpandIconButton: (props: ExpandIconButtonProps) => jsx.JSX.Element;
|
|
43
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { findExpand, transformSliceToRemoveOpenExpand, transformSliceNestedExpandToExpand, } from '@atlaskit/editor-common/transforms';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { Node as PMNode, NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type { Command } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
|
-
export declare const setExpandRef: (ref?: HTMLDivElement | null) => Command;
|
|
6
|
-
export declare const deleteExpandAtPos: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (expandNodePos: number, expandNode: PMNode) => Command;
|
|
7
|
-
export declare const deleteExpand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
8
|
-
export declare const updateExpandTitle: (title: string, pos: number, nodeType: NodeType) => Command;
|
|
9
|
-
export declare const toggleExpandExpanded: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (pos: number, nodeType: NodeType) => Command;
|
|
10
|
-
export declare const createExpandNode: (state: EditorState) => PMNode | null;
|
|
11
|
-
export declare const insertExpand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
12
|
-
export declare const focusTitle: (pos: number) => Command;
|
|
13
|
-
export declare const setSelectionInsideExpand: (expandPos: number) => Command;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { NextEditorPlugin, EditorProps } from '../../types';
|
|
2
|
-
import { insertExpand } from './commands';
|
|
3
|
-
import type { LongPressSelectionPluginOptions, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
5
|
-
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
6
|
-
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
7
|
-
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
8
|
-
interface ExpandPluginOptions extends LongPressSelectionPluginOptions {
|
|
9
|
-
allowInsertion?: boolean;
|
|
10
|
-
appearance?: EditorProps['appearance'];
|
|
11
|
-
}
|
|
12
|
-
export type ExpandPlugin = NextEditorPlugin<'expand', {
|
|
13
|
-
pluginConfiguration: ExpandPluginOptions | undefined;
|
|
14
|
-
dependencies: [
|
|
15
|
-
FeatureFlagsPlugin,
|
|
16
|
-
DecorationsPlugin,
|
|
17
|
-
SelectionPlugin,
|
|
18
|
-
OptionalPlugin<AnalyticsPlugin>
|
|
19
|
-
];
|
|
20
|
-
actions: {
|
|
21
|
-
insertExpand: ReturnType<typeof insertExpand>;
|
|
22
|
-
};
|
|
23
|
-
}>;
|
|
24
|
-
declare const expandPlugin: ExpandPlugin;
|
|
25
|
-
interface ExpandEditorProps {
|
|
26
|
-
allowExpand?: EditorProps['allowExpand'];
|
|
27
|
-
}
|
|
28
|
-
export default expandPlugin;
|
|
29
|
-
export type { ExpandPluginState } from './types';
|
|
30
|
-
export declare function isExpandInsertionEnabled({ allowExpand }: ExpandEditorProps): boolean;
|
|
31
|
-
export { pluginKey } from './pm-plugins/plugin-factory';
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl-next';
|
|
2
|
-
import type { EditorView, NodeView, Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
4
|
-
import type { getPosHandlerNode, getPosHandler } from '../../../nodeviews/';
|
|
5
|
-
import type { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
-
import type expandPlugin from '../index';
|
|
7
|
-
import type { SetSelectionRelativeToNode } from '@atlaskit/editor-common/selection';
|
|
8
|
-
export declare class ExpandNodeView implements NodeView {
|
|
9
|
-
private selectNearNode;
|
|
10
|
-
node: PmNode;
|
|
11
|
-
view: EditorView;
|
|
12
|
-
dom: HTMLElement;
|
|
13
|
-
contentDOM?: HTMLElement;
|
|
14
|
-
icon?: HTMLElement | null;
|
|
15
|
-
input?: HTMLInputElement | null;
|
|
16
|
-
titleContainer?: HTMLElement | null;
|
|
17
|
-
content?: HTMLElement | null;
|
|
18
|
-
getPos: getPosHandlerNode;
|
|
19
|
-
intl: IntlShape;
|
|
20
|
-
allowInteractiveExpand: boolean;
|
|
21
|
-
isMobile: boolean;
|
|
22
|
-
featureFlags: FeatureFlags;
|
|
23
|
-
api: ExtractInjectionAPI<typeof expandPlugin> | undefined;
|
|
24
|
-
constructor(node: PmNode, view: EditorView, getPos: getPosHandlerNode, getIntl: () => IntlShape, isMobile: boolean, featureFlags: FeatureFlags, selectNearNode: SetSelectionRelativeToNode | undefined, api: ExtractInjectionAPI<typeof expandPlugin> | undefined);
|
|
25
|
-
private initHandlers;
|
|
26
|
-
private focusTitle;
|
|
27
|
-
private handleIconKeyDown;
|
|
28
|
-
private renderIcon;
|
|
29
|
-
private isAllowInteractiveExpandEnabled;
|
|
30
|
-
private handleClick;
|
|
31
|
-
private handleInput;
|
|
32
|
-
private handleFocus;
|
|
33
|
-
private handleTitleKeydown;
|
|
34
|
-
private deleteExpand;
|
|
35
|
-
private toggleExpand;
|
|
36
|
-
private moveToOutsideOfTitle;
|
|
37
|
-
private isCollapsed;
|
|
38
|
-
private setRightGapCursor;
|
|
39
|
-
private setLeftGapCursor;
|
|
40
|
-
private handleArrowRightFromTitle;
|
|
41
|
-
private handleArrowLeftFromTitle;
|
|
42
|
-
stopEvent(event: Event): boolean;
|
|
43
|
-
ignoreMutation(mutationRecord: MutationRecord | {
|
|
44
|
-
type: 'selection';
|
|
45
|
-
target: Element;
|
|
46
|
-
}): boolean;
|
|
47
|
-
update(node: PmNode, _decorations: readonly Decoration[]): boolean;
|
|
48
|
-
destroy(): void;
|
|
49
|
-
}
|
|
50
|
-
export default function ({ getIntl, isMobile, featureFlags, api, }: {
|
|
51
|
-
getIntl: () => IntlShape;
|
|
52
|
-
isMobile: boolean;
|
|
53
|
-
featureFlags: FeatureFlags;
|
|
54
|
-
api: ExtractInjectionAPI<typeof expandPlugin> | undefined;
|
|
55
|
-
}): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type expandPlugin from '../index';
|
|
4
|
-
export declare function expandKeymap(api: ExtractInjectionAPI<typeof expandPlugin> | undefined): SafePlugin;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { Dispatch } from '../../../event-dispatcher';
|
|
3
|
-
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { IntlShape } from 'react-intl-next';
|
|
5
|
-
import type { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
-
import type expandPlugin from '../index';
|
|
7
|
-
export declare function containsClass(element: Element | null, className: string): boolean;
|
|
8
|
-
export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorAppearance | undefined, useLongPressSelection: boolean | undefined, featureFlags: FeatureFlags, api: ExtractInjectionAPI<typeof expandPlugin> | undefined) => SafePlugin<import("../types").ExpandPluginState>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
export declare const pluginKey: PluginKey<any>;
|
|
3
|
-
export declare const createPluginState: (dispatch: import("@atlaskit/editor-common/event-dispatcher").Dispatch<any>, initialState: import("..").ExpandPluginState | ((state: import("prosemirror-state").EditorState) => import("..").ExpandPluginState)) => import("prosemirror-state").SafeStateField<import("..").ExpandPluginState>, createCommand: <A = import("../types").ExpandPluginAction>(action: A | ((state: Readonly<import("prosemirror-state").EditorState>) => false | A), transform?: ((tr: import("prosemirror-state").Transaction, state: import("prosemirror-state").EditorState) => import("prosemirror-state").Transaction) | undefined) => import("@atlaskit/editor-common/types").Command, getPluginState: (state: import("prosemirror-state").EditorState) => import("..").ExpandPluginState;
|