@atlaskit/editor-core 189.1.11 → 189.1.13
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 +14 -0
- package/dist/cjs/plugins/index.js +0 -14
- package/dist/cjs/plugins/insert-block/index.js +6 -10
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +40 -38
- package/dist/cjs/presets/universal.js +4 -2
- package/dist/cjs/ui/ContentStyles/index.js +1 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/index.js +0 -2
- package/dist/es2019/plugins/insert-block/index.js +5 -9
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +4 -3
- package/dist/es2019/presets/universal.js +3 -1
- package/dist/es2019/ui/ContentStyles/index.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/index.js +0 -2
- package/dist/esm/plugins/insert-block/index.js +5 -9
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +40 -38
- package/dist/esm/presets/universal.js +3 -1
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/index.d.ts +0 -2
- package/dist/types/plugins/insert-block/types.d.ts +4 -2
- package/dist/types/types/editor-props.d.ts +2 -2
- package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +1 -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-ts4.5/types/editor-props.d.ts +2 -2
- package/dist/types-ts4.5/ui/ConfigPanel/ConfigPanel.d.ts +1 -1
- package/package.json +4 -2
- package/report.api.md +2 -16
- package/tmp/api-report-tmp.d.ts +2 -16
- package/dist/cjs/plugins/layout/actions.js +0 -345
- package/dist/cjs/plugins/layout/index.js +0 -91
- package/dist/cjs/plugins/layout/pm-plugins/main.js +0 -148
- package/dist/cjs/plugins/layout/pm-plugins/plugin-key.js +0 -8
- package/dist/cjs/plugins/layout/pm-plugins/types.js +0 -5
- package/dist/cjs/plugins/layout/toolbar-messages.js +0 -39
- package/dist/cjs/plugins/layout/toolbar.js +0 -116
- package/dist/cjs/plugins/layout/types.js +0 -5
- package/dist/cjs/plugins/placeholder-text/actions.js +0 -35
- package/dist/cjs/plugins/placeholder-text/fake-text-cursor/cursor.js +0 -107
- package/dist/cjs/plugins/placeholder-text/index.js +0 -20
- package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +0 -89
- package/dist/cjs/plugins/placeholder-text/plugin-key.js +0 -8
- package/dist/cjs/plugins/placeholder-text/plugin.js +0 -267
- package/dist/cjs/plugins/placeholder-text/selection-utils.js +0 -14
- package/dist/cjs/plugins/placeholder-text/styles.js +0 -13
- package/dist/cjs/plugins/placeholder-text/types.js +0 -5
- package/dist/cjs/plugins/placeholder-text/ui/FloatingToolbar/index.js +0 -86
- package/dist/cjs/plugins/placeholder-text/ui/FloatingToolbar/styles.js +0 -15
- package/dist/cjs/plugins/placeholder-text/ui/FloatingToolbar/utils.js +0 -54
- package/dist/cjs/plugins/placeholder-text/ui/PlaceholderFloatingToolbar/index.js +0 -89
- package/dist/es2019/plugins/layout/actions.js +0 -328
- package/dist/es2019/plugins/layout/index.js +0 -75
- package/dist/es2019/plugins/layout/pm-plugins/main.js +0 -142
- package/dist/es2019/plugins/layout/pm-plugins/plugin-key.js +0 -2
- package/dist/es2019/plugins/layout/pm-plugins/types.js +0 -1
- package/dist/es2019/plugins/layout/toolbar-messages.js +0 -33
- package/dist/es2019/plugins/layout/toolbar.js +0 -101
- package/dist/es2019/plugins/layout/types.js +0 -1
- package/dist/es2019/plugins/placeholder-text/actions.js +0 -27
- package/dist/es2019/plugins/placeholder-text/fake-text-cursor/cursor.js +0 -77
- package/dist/es2019/plugins/placeholder-text/index.js +0 -2
- package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +0 -77
- package/dist/es2019/plugins/placeholder-text/plugin-key.js +0 -2
- package/dist/es2019/plugins/placeholder-text/plugin.js +0 -247
- package/dist/es2019/plugins/placeholder-text/selection-utils.js +0 -8
- package/dist/es2019/plugins/placeholder-text/styles.js +0 -52
- package/dist/es2019/plugins/placeholder-text/types.js +0 -1
- package/dist/es2019/plugins/placeholder-text/ui/FloatingToolbar/index.js +0 -45
- package/dist/es2019/plugins/placeholder-text/ui/FloatingToolbar/styles.js +0 -15
- package/dist/es2019/plugins/placeholder-text/ui/FloatingToolbar/utils.js +0 -41
- package/dist/es2019/plugins/placeholder-text/ui/PlaceholderFloatingToolbar/index.js +0 -60
- package/dist/esm/plugins/layout/actions.js +0 -336
- package/dist/esm/plugins/layout/index.js +0 -79
- package/dist/esm/plugins/layout/pm-plugins/main.js +0 -141
- package/dist/esm/plugins/layout/pm-plugins/plugin-key.js +0 -2
- package/dist/esm/plugins/layout/pm-plugins/types.js +0 -1
- package/dist/esm/plugins/layout/toolbar-messages.js +0 -33
- package/dist/esm/plugins/layout/toolbar.js +0 -109
- package/dist/esm/plugins/layout/types.js +0 -1
- package/dist/esm/plugins/placeholder-text/actions.js +0 -29
- package/dist/esm/plugins/placeholder-text/fake-text-cursor/cursor.js +0 -100
- package/dist/esm/plugins/placeholder-text/index.js +0 -2
- package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +0 -82
- package/dist/esm/plugins/placeholder-text/plugin-key.js +0 -2
- package/dist/esm/plugins/placeholder-text/plugin.js +0 -259
- package/dist/esm/plugins/placeholder-text/selection-utils.js +0 -8
- package/dist/esm/plugins/placeholder-text/styles.js +0 -6
- package/dist/esm/plugins/placeholder-text/types.js +0 -1
- package/dist/esm/plugins/placeholder-text/ui/FloatingToolbar/index.js +0 -63
- package/dist/esm/plugins/placeholder-text/ui/FloatingToolbar/styles.js +0 -8
- package/dist/esm/plugins/placeholder-text/ui/FloatingToolbar/utils.js +0 -48
- package/dist/esm/plugins/placeholder-text/ui/PlaceholderFloatingToolbar/index.js +0 -79
- package/dist/types/plugins/layout/actions.d.ts +0 -22
- package/dist/types/plugins/layout/index.d.ts +0 -15
- package/dist/types/plugins/layout/pm-plugins/main.d.ts +0 -6
- package/dist/types/plugins/layout/pm-plugins/plugin-key.d.ts +0 -3
- package/dist/types/plugins/layout/pm-plugins/types.d.ts +0 -14
- package/dist/types/plugins/layout/toolbar-messages.d.ts +0 -32
- package/dist/types/plugins/layout/toolbar.d.ts +0 -6
- package/dist/types/plugins/layout/types.d.ts +0 -13
- package/dist/types/plugins/placeholder-text/actions.d.ts +0 -4
- package/dist/types/plugins/placeholder-text/fake-text-cursor/cursor.d.ts +0 -30
- package/dist/types/plugins/placeholder-text/index.d.ts +0 -3
- package/dist/types/plugins/placeholder-text/placeholder-text-nodeview.d.ts +0 -17
- package/dist/types/plugins/placeholder-text/plugin-key.d.ts +0 -3
- package/dist/types/plugins/placeholder-text/plugin.d.ts +0 -7
- package/dist/types/plugins/placeholder-text/selection-utils.d.ts +0 -2
- package/dist/types/plugins/placeholder-text/styles.d.ts +0 -1
- package/dist/types/plugins/placeholder-text/types.d.ts +0 -18
- package/dist/types/plugins/placeholder-text/ui/FloatingToolbar/index.d.ts +0 -28
- package/dist/types/plugins/placeholder-text/ui/FloatingToolbar/styles.d.ts +0 -1
- package/dist/types/plugins/placeholder-text/ui/FloatingToolbar/utils.d.ts +0 -13
- package/dist/types/plugins/placeholder-text/ui/PlaceholderFloatingToolbar/index.d.ts +0 -25
- package/dist/types-ts4.5/plugins/layout/actions.d.ts +0 -22
- package/dist/types-ts4.5/plugins/layout/index.d.ts +0 -18
- package/dist/types-ts4.5/plugins/layout/pm-plugins/main.d.ts +0 -6
- package/dist/types-ts4.5/plugins/layout/pm-plugins/plugin-key.d.ts +0 -3
- package/dist/types-ts4.5/plugins/layout/pm-plugins/types.d.ts +0 -14
- package/dist/types-ts4.5/plugins/layout/toolbar-messages.d.ts +0 -32
- package/dist/types-ts4.5/plugins/layout/toolbar.d.ts +0 -6
- package/dist/types-ts4.5/plugins/layout/types.d.ts +0 -13
- package/dist/types-ts4.5/plugins/placeholder-text/actions.d.ts +0 -4
- package/dist/types-ts4.5/plugins/placeholder-text/fake-text-cursor/cursor.d.ts +0 -30
- package/dist/types-ts4.5/plugins/placeholder-text/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/placeholder-text/placeholder-text-nodeview.d.ts +0 -17
- package/dist/types-ts4.5/plugins/placeholder-text/plugin-key.d.ts +0 -3
- package/dist/types-ts4.5/plugins/placeholder-text/plugin.d.ts +0 -7
- package/dist/types-ts4.5/plugins/placeholder-text/selection-utils.d.ts +0 -2
- package/dist/types-ts4.5/plugins/placeholder-text/styles.d.ts +0 -1
- package/dist/types-ts4.5/plugins/placeholder-text/types.d.ts +0 -18
- package/dist/types-ts4.5/plugins/placeholder-text/ui/FloatingToolbar/index.d.ts +0 -28
- package/dist/types-ts4.5/plugins/placeholder-text/ui/FloatingToolbar/styles.d.ts +0 -1
- package/dist/types-ts4.5/plugins/placeholder-text/ui/FloatingToolbar/utils.d.ts +0 -13
- package/dist/types-ts4.5/plugins/placeholder-text/ui/PlaceholderFloatingToolbar/index.d.ts +0 -25
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2;
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
5
|
-
import { N0, N50A, N60A } from '@atlaskit/theme/colors';
|
|
6
|
-
export var container = function container(height) {
|
|
7
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border-radius: ", "px;\n box-shadow: ", ";\n display: flex;\n align-items: center;\n box-sizing: border-box;\n padding: ", " ", ";\n background-color: ", ";\n ", ";\n"])), borderRadius(), "var(--ds-shadow-overlay, ".concat("0 12px 24px -6px ".concat(N50A, ", 0 0 1px ").concat(N60A), ")"), "var(--ds-space-050, 4px)", "var(--ds-space-100, 8px)", "var(--ds-background-input, ".concat(N0, ")"), height ? css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: ", "px;\n "])), height) : '');
|
|
8
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
var getCursorHeightFrom = function getCursorHeightFrom(node) {
|
|
2
|
-
return parseFloat(window.getComputedStyle(node, undefined).lineHeight || '');
|
|
3
|
-
};
|
|
4
|
-
export var getOffsetParent = function getOffsetParent(editorViewDom, popupsMountPoint) {
|
|
5
|
-
return popupsMountPoint ? popupsMountPoint.offsetParent : editorViewDom.offsetParent;
|
|
6
|
-
};
|
|
7
|
-
export var getNearestNonTextNode = function getNearestNonTextNode(node) {
|
|
8
|
-
return node.nodeType === Node.TEXT_NODE ? node.parentNode : node;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* We need to translate the co-ordinates because `coordsAtPos` returns co-ordinates
|
|
13
|
-
* relative to `window`. And, also need to adjust the cursor container height.
|
|
14
|
-
* (0, 0)
|
|
15
|
-
* +--------------------- [window] ---------------------+
|
|
16
|
-
* | (left, top) +-------- [Offset Parent] --------+ |
|
|
17
|
-
* | {coordsAtPos} | [Cursor] <- cursorHeight | |
|
|
18
|
-
* | | [FloatingToolbar] | |
|
|
19
|
-
*/
|
|
20
|
-
var convertFixedCoordinatesToAbsolutePositioning = function convertFixedCoordinatesToAbsolutePositioning(coordinates, offsetParent, cursorHeight) {
|
|
21
|
-
var _offsetParent$getBoun = offsetParent.getBoundingClientRect(),
|
|
22
|
-
offsetParentLeft = _offsetParent$getBoun.left,
|
|
23
|
-
offsetParentTop = _offsetParent$getBoun.top,
|
|
24
|
-
offsetParentHeight = _offsetParent$getBoun.height;
|
|
25
|
-
return {
|
|
26
|
-
left: coordinates.left - offsetParentLeft,
|
|
27
|
-
right: coordinates.right - offsetParentLeft,
|
|
28
|
-
top: coordinates.top - (offsetParentTop - cursorHeight) + offsetParent.scrollTop,
|
|
29
|
-
bottom: offsetParentHeight - (coordinates.top - (offsetParentTop - cursorHeight) - offsetParent.scrollTop)
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
export var handlePositionCalculatedWith = function handlePositionCalculatedWith(offsetParent, node, getCurrentFixedCoordinates) {
|
|
33
|
-
return function (position) {
|
|
34
|
-
if (!offsetParent) {
|
|
35
|
-
return position;
|
|
36
|
-
}
|
|
37
|
-
var target = getNearestNonTextNode(node);
|
|
38
|
-
var cursorHeight = getCursorHeightFrom(target);
|
|
39
|
-
var fixedCoordinates = getCurrentFixedCoordinates();
|
|
40
|
-
var absoluteCoordinates = convertFixedCoordinatesToAbsolutePositioning(fixedCoordinates, offsetParent, cursorHeight);
|
|
41
|
-
return {
|
|
42
|
-
left: position.left ? absoluteCoordinates.left : undefined,
|
|
43
|
-
right: position.right ? absoluteCoordinates.right : undefined,
|
|
44
|
-
top: position.top ? absoluteCoordinates.top : undefined,
|
|
45
|
-
bottom: position.bottom ? absoluteCoordinates.bottom : undefined
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
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); }; }
|
|
9
|
-
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; } }
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import { defineMessages, injectIntl } from 'react-intl-next';
|
|
12
|
-
import { PanelTextInput } from '@atlaskit/editor-common/ui';
|
|
13
|
-
import FloatingToolbar, { handlePositionCalculatedWith, getOffsetParent, getNearestNonTextNode } from '../FloatingToolbar';
|
|
14
|
-
export var messages = defineMessages({
|
|
15
|
-
placeholderTextPlaceholder: {
|
|
16
|
-
id: 'fabric.editor.placeholderTextPlaceholder',
|
|
17
|
-
defaultMessage: 'Add placeholder text',
|
|
18
|
-
description: ''
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
var PlaceholderFloatingToolbar = /*#__PURE__*/function (_React$Component) {
|
|
22
|
-
_inherits(PlaceholderFloatingToolbar, _React$Component);
|
|
23
|
-
var _super = _createSuper(PlaceholderFloatingToolbar);
|
|
24
|
-
function PlaceholderFloatingToolbar() {
|
|
25
|
-
var _this;
|
|
26
|
-
_classCallCheck(this, PlaceholderFloatingToolbar);
|
|
27
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
28
|
-
args[_key] = arguments[_key];
|
|
29
|
-
}
|
|
30
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
31
|
-
_defineProperty(_assertThisInitialized(_this), "handleSubmit", function (value) {
|
|
32
|
-
if (value) {
|
|
33
|
-
_this.props.insertPlaceholder(value);
|
|
34
|
-
_this.props.setFocusInEditor();
|
|
35
|
-
} else {
|
|
36
|
-
_this.props.hidePlaceholderFloatingToolbar();
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
_defineProperty(_assertThisInitialized(_this), "handleBlur", function () {
|
|
40
|
-
_this.props.hidePlaceholderFloatingToolbar();
|
|
41
|
-
});
|
|
42
|
-
return _this;
|
|
43
|
-
}
|
|
44
|
-
_createClass(PlaceholderFloatingToolbar, [{
|
|
45
|
-
key: "render",
|
|
46
|
-
value: function render() {
|
|
47
|
-
var _this$props = this.props,
|
|
48
|
-
getNodeFromPos = _this$props.getNodeFromPos,
|
|
49
|
-
showInsertPanelAt = _this$props.showInsertPanelAt,
|
|
50
|
-
editorViewDOM = _this$props.editorViewDOM,
|
|
51
|
-
popupsMountPoint = _this$props.popupsMountPoint,
|
|
52
|
-
getFixedCoordinatesFromPos = _this$props.getFixedCoordinatesFromPos,
|
|
53
|
-
popupsBoundariesElement = _this$props.popupsBoundariesElement,
|
|
54
|
-
formatMessage = _this$props.intl.formatMessage;
|
|
55
|
-
var target = getNodeFromPos(showInsertPanelAt);
|
|
56
|
-
var offsetParent = getOffsetParent(editorViewDOM, popupsMountPoint);
|
|
57
|
-
var getFixedCoordinates = function getFixedCoordinates() {
|
|
58
|
-
return getFixedCoordinatesFromPos(showInsertPanelAt);
|
|
59
|
-
};
|
|
60
|
-
var handlePositionCalculated = handlePositionCalculatedWith(offsetParent, target, getFixedCoordinates);
|
|
61
|
-
return /*#__PURE__*/React.createElement(FloatingToolbar, {
|
|
62
|
-
target: getNearestNonTextNode(target),
|
|
63
|
-
onPositionCalculated: handlePositionCalculated,
|
|
64
|
-
popupsMountPoint: popupsMountPoint,
|
|
65
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
66
|
-
fitHeight: 32,
|
|
67
|
-
offset: [0, 12]
|
|
68
|
-
}, /*#__PURE__*/React.createElement(PanelTextInput, {
|
|
69
|
-
placeholder: formatMessage(messages.placeholderTextPlaceholder),
|
|
70
|
-
onSubmit: this.handleSubmit,
|
|
71
|
-
onBlur: this.handleBlur,
|
|
72
|
-
autoFocus: true,
|
|
73
|
-
width: 300
|
|
74
|
-
}));
|
|
75
|
-
}
|
|
76
|
-
}]);
|
|
77
|
-
return PlaceholderFloatingToolbar;
|
|
78
|
-
}(React.Component);
|
|
79
|
-
export default injectIntl(PlaceholderFloatingToolbar);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import type { Change, PresetLayout } from './types';
|
|
5
|
-
import type { TOOLBAR_MENU_TYPE, Command } from '@atlaskit/editor-common/types';
|
|
6
|
-
export declare const ONE_COL_LAYOUTS: PresetLayout[];
|
|
7
|
-
export declare const TWO_COL_LAYOUTS: PresetLayout[];
|
|
8
|
-
export declare const THREE_COL_LAYOUTS: PresetLayout[];
|
|
9
|
-
/**
|
|
10
|
-
* Finds layout preset based on the width attrs of all the layoutColumn nodes
|
|
11
|
-
* inside the layoutSection node
|
|
12
|
-
*/
|
|
13
|
-
export declare const getPresetLayout: (section: Node) => PresetLayout | undefined;
|
|
14
|
-
export declare const getSelectedLayout: (maybeLayoutSection: Node | undefined, current: PresetLayout) => PresetLayout;
|
|
15
|
-
export declare const createDefaultLayoutSection: (state: EditorState) => Node;
|
|
16
|
-
export declare const insertLayoutColumns: Command;
|
|
17
|
-
export declare const insertLayoutColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: TOOLBAR_MENU_TYPE) => Command;
|
|
18
|
-
export declare function forceSectionToPresetLayout(state: EditorState, node: Node, pos: number, presetLayout: PresetLayout): Transaction;
|
|
19
|
-
export declare const setPresetLayout: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (layout: PresetLayout) => Command;
|
|
20
|
-
export declare const fixColumnSizes: (changedTr: Transaction, state: EditorState) => Change | undefined;
|
|
21
|
-
export declare const fixColumnStructure: (state: EditorState) => Transaction | undefined;
|
|
22
|
-
export declare const deleteActiveLayoutNode: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { insertLayoutColumnsWithAnalytics } from './actions';
|
|
3
|
-
import { pluginKey } from './pm-plugins/plugin-key';
|
|
4
|
-
import type { LayoutPluginOptions } from './types';
|
|
5
|
-
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
6
|
-
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
7
|
-
export { pluginKey };
|
|
8
|
-
export type LayoutPlugin = NextEditorPlugin<'layout', {
|
|
9
|
-
pluginConfiguration: LayoutPluginOptions | undefined;
|
|
10
|
-
dependencies: [DecorationsPlugin, OptionalPlugin<AnalyticsPlugin>];
|
|
11
|
-
actions: {
|
|
12
|
-
insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
|
|
13
|
-
};
|
|
14
|
-
}>;
|
|
15
|
-
export declare const layoutPlugin: LayoutPlugin;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { LayoutState } from './types';
|
|
3
|
-
import type { LayoutPluginOptions } from '../types';
|
|
4
|
-
export declare const DEFAULT_LAYOUT = "two_equal";
|
|
5
|
-
declare const _default: (options: LayoutPluginOptions) => SafePlugin<LayoutState>;
|
|
6
|
-
export default _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { PresetLayout } from '../types';
|
|
3
|
-
export type LayoutState = {
|
|
4
|
-
pos: number | null;
|
|
5
|
-
allowBreakout: boolean;
|
|
6
|
-
addSidebarLayouts: boolean;
|
|
7
|
-
selectedLayout: PresetLayout | undefined;
|
|
8
|
-
allowSingleColumnLayout: boolean;
|
|
9
|
-
};
|
|
10
|
-
export type Change = {
|
|
11
|
-
from: number;
|
|
12
|
-
to: number;
|
|
13
|
-
slice: Slice;
|
|
14
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export declare const toolbarMessages: {
|
|
2
|
-
singleColumn: {
|
|
3
|
-
id: string;
|
|
4
|
-
defaultMessage: string;
|
|
5
|
-
description: string;
|
|
6
|
-
};
|
|
7
|
-
twoColumns: {
|
|
8
|
-
id: string;
|
|
9
|
-
defaultMessage: string;
|
|
10
|
-
description: string;
|
|
11
|
-
};
|
|
12
|
-
threeColumns: {
|
|
13
|
-
id: string;
|
|
14
|
-
defaultMessage: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
rightSidebar: {
|
|
18
|
-
id: string;
|
|
19
|
-
defaultMessage: string;
|
|
20
|
-
description: string;
|
|
21
|
-
};
|
|
22
|
-
leftSidebar: {
|
|
23
|
-
id: string;
|
|
24
|
-
defaultMessage: string;
|
|
25
|
-
description: string;
|
|
26
|
-
};
|
|
27
|
-
threeColumnsWithSidebars: {
|
|
28
|
-
id: string;
|
|
29
|
-
defaultMessage: string;
|
|
30
|
-
description: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl-next';
|
|
2
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { FloatingToolbarConfig, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { LayoutPlugin } from './';
|
|
5
|
-
export declare const layoutToolbarTitle = "Layout floating controls";
|
|
6
|
-
export declare const buildToolbar: (state: EditorState, intl: IntlShape, pos: number, _allowBreakout: boolean, addSidebarLayouts: boolean, allowSingleColumnLayout: boolean, api: ExtractInjectionAPI<LayoutPlugin> | undefined) => FloatingToolbarConfig | undefined;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
|
|
3
|
-
export interface LayoutPluginOptions extends LongPressSelectionPluginOptions {
|
|
4
|
-
allowBreakout?: boolean;
|
|
5
|
-
UNSAFE_addSidebarLayouts?: boolean;
|
|
6
|
-
UNSAFE_allowSingleColumnLayout?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export type PresetLayout = 'single' | 'two_equal' | 'three_equal' | 'two_right_sidebar' | 'two_left_sidebar' | 'three_with_sidebars';
|
|
9
|
-
export interface Change {
|
|
10
|
-
from: number;
|
|
11
|
-
to: number;
|
|
12
|
-
slice: Slice;
|
|
13
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
export declare const showPlaceholderFloatingToolbar: (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
|
|
3
|
-
export declare const insertPlaceholderTextAtSelection: (value: string) => (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
|
|
4
|
-
export declare const hidePlaceholderFloatingToolbar: (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { EditorState, SelectionBookmark, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { Node, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
-
import type { Mappable } from '@atlaskit/editor-prosemirror/transform';
|
|
7
|
-
export declare class FakeTextCursorBookmark {
|
|
8
|
-
pos: undefined | number;
|
|
9
|
-
visible: boolean;
|
|
10
|
-
constructor(pos: number);
|
|
11
|
-
map(mapping: Mappable): FakeTextCursorBookmark;
|
|
12
|
-
resolve(doc: Node): Selection;
|
|
13
|
-
}
|
|
14
|
-
export declare class FakeTextCursorSelection extends Selection {
|
|
15
|
-
constructor($pos: ResolvedPos);
|
|
16
|
-
map(doc: Node, mapping: Mappable): Selection;
|
|
17
|
-
static content(): Slice;
|
|
18
|
-
eq(other: Selection): boolean;
|
|
19
|
-
toJSON(): {
|
|
20
|
-
type: string;
|
|
21
|
-
pos: number;
|
|
22
|
-
};
|
|
23
|
-
static fromJSON(doc: Node, json: {
|
|
24
|
-
pos: number;
|
|
25
|
-
}): Selection;
|
|
26
|
-
getBookmark(): SelectionBookmark;
|
|
27
|
-
}
|
|
28
|
-
export declare const addFakeTextCursor: (state: EditorState, dispatch: (tr: Transaction) => void) => void;
|
|
29
|
-
export declare const removeFakeTextCursor: (state: EditorState, dispatch: (tr: Transaction) => void) => void;
|
|
30
|
-
export declare const drawFakeTextCursor: (state: EditorState) => DecorationSet | null;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { NodeView, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type { getPosHandler } from '@atlaskit/editor-common/react-node-view';
|
|
4
|
-
type PmMutationRecord = MutationRecord | {
|
|
5
|
-
type: 'selection';
|
|
6
|
-
target: Element;
|
|
7
|
-
};
|
|
8
|
-
export declare class PlaceholderTextNodeView implements NodeView {
|
|
9
|
-
private readonly node;
|
|
10
|
-
private readonly view;
|
|
11
|
-
private readonly getPos;
|
|
12
|
-
readonly dom: Node;
|
|
13
|
-
constructor(node: PMNode, view: EditorView, getPos: getPosHandler);
|
|
14
|
-
stopEvent(e: Event): boolean;
|
|
15
|
-
ignoreMutation(record: PmMutationRecord): boolean;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
4
|
-
import type { PlaceholderTextOptions, PlaceholderTextPlugin, PlaceholderTextPluginState } from './types';
|
|
5
|
-
export declare function createPlugin(dispatch: Dispatch<PlaceholderTextPluginState>, options: PlaceholderTextOptions, api: ExtractInjectionAPI<PlaceholderTextPlugin> | undefined): SafePlugin | undefined;
|
|
6
|
-
declare const placeholderTextPlugin: PlaceholderTextPlugin;
|
|
7
|
-
export default placeholderTextPlugin;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const placeholderTextStyles: import("@emotion/react").SerializedStyles;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
3
|
-
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
-
export interface PlaceholderTextOptions {
|
|
5
|
-
allowInserting?: boolean;
|
|
6
|
-
}
|
|
7
|
-
export interface PlaceholderTextPluginState {
|
|
8
|
-
showInsertPanelAt: number | null;
|
|
9
|
-
allowInserting: boolean;
|
|
10
|
-
}
|
|
11
|
-
export type PlaceholderTextPlugin = NextEditorPlugin<'placeholderText', {
|
|
12
|
-
dependencies: [
|
|
13
|
-
OptionalPlugin<typeof analyticsPlugin>,
|
|
14
|
-
OptionalPlugin<TypeAheadPlugin>
|
|
15
|
-
];
|
|
16
|
-
pluginConfiguration: PlaceholderTextOptions;
|
|
17
|
-
sharedState: PlaceholderTextPluginState | undefined;
|
|
18
|
-
}>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */
|
|
2
|
-
import { jsx } from '@emotion/react';
|
|
3
|
-
import { PureComponent } from 'react';
|
|
4
|
-
export type Coordinates = {
|
|
5
|
-
left?: number;
|
|
6
|
-
right?: number;
|
|
7
|
-
top?: number;
|
|
8
|
-
bottom?: number;
|
|
9
|
-
};
|
|
10
|
-
export type PositionOffset = Coordinates;
|
|
11
|
-
export interface Props {
|
|
12
|
-
zIndex?: number;
|
|
13
|
-
className?: string;
|
|
14
|
-
target?: HTMLElement;
|
|
15
|
-
popupsMountPoint?: HTMLElement;
|
|
16
|
-
popupsBoundariesElement?: HTMLElement;
|
|
17
|
-
offset?: number[];
|
|
18
|
-
fitWidth?: number;
|
|
19
|
-
fitHeight?: number;
|
|
20
|
-
absoluteOffset?: PositionOffset;
|
|
21
|
-
alignX?: 'left' | 'center' | 'right';
|
|
22
|
-
alignY?: 'bottom' | 'top';
|
|
23
|
-
onPositionCalculated?: (position: Coordinates) => any;
|
|
24
|
-
}
|
|
25
|
-
export { handlePositionCalculatedWith, getOffsetParent, getNearestNonTextNode, } from './utils';
|
|
26
|
-
export default class FloatingToolbar extends PureComponent<Props, any> {
|
|
27
|
-
render(): jsx.JSX.Element | null;
|
|
28
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const container: (height?: number) => import("@emotion/react").SerializedStyles;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const getOffsetParent: (editorViewDom: HTMLElement, popupsMountPoint?: HTMLElement) => HTMLElement;
|
|
2
|
-
export declare const getNearestNonTextNode: (node: Node) => HTMLElement;
|
|
3
|
-
export declare const handlePositionCalculatedWith: (offsetParent: HTMLElement, node: Node, getCurrentFixedCoordinates: () => any) => (position: {
|
|
4
|
-
top?: number;
|
|
5
|
-
left?: number;
|
|
6
|
-
bottom?: number;
|
|
7
|
-
right?: number;
|
|
8
|
-
}) => {
|
|
9
|
-
top?: number | undefined;
|
|
10
|
-
left?: number | undefined;
|
|
11
|
-
bottom?: number | undefined;
|
|
12
|
-
right?: number | undefined;
|
|
13
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
|
-
import type { Coordinates } from '../FloatingToolbar';
|
|
4
|
-
export declare const messages: {
|
|
5
|
-
placeholderTextPlaceholder: {
|
|
6
|
-
id: string;
|
|
7
|
-
defaultMessage: string;
|
|
8
|
-
description: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export interface Props {
|
|
12
|
-
getNodeFromPos: (pos: number) => Node;
|
|
13
|
-
getFixedCoordinatesFromPos: (pos: number) => Coordinates;
|
|
14
|
-
insertPlaceholder: (value: string) => void;
|
|
15
|
-
hidePlaceholderFloatingToolbar: () => void;
|
|
16
|
-
setFocusInEditor: () => void;
|
|
17
|
-
showInsertPanelAt: number;
|
|
18
|
-
editorViewDOM: HTMLElement;
|
|
19
|
-
popupsMountPoint?: HTMLElement;
|
|
20
|
-
popupsBoundariesElement?: HTMLElement;
|
|
21
|
-
}
|
|
22
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
23
|
-
WrappedComponent: React.ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
24
|
-
};
|
|
25
|
-
export default _default;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import type { Change, PresetLayout } from './types';
|
|
5
|
-
import type { TOOLBAR_MENU_TYPE, Command } from '@atlaskit/editor-common/types';
|
|
6
|
-
export declare const ONE_COL_LAYOUTS: PresetLayout[];
|
|
7
|
-
export declare const TWO_COL_LAYOUTS: PresetLayout[];
|
|
8
|
-
export declare const THREE_COL_LAYOUTS: PresetLayout[];
|
|
9
|
-
/**
|
|
10
|
-
* Finds layout preset based on the width attrs of all the layoutColumn nodes
|
|
11
|
-
* inside the layoutSection node
|
|
12
|
-
*/
|
|
13
|
-
export declare const getPresetLayout: (section: Node) => PresetLayout | undefined;
|
|
14
|
-
export declare const getSelectedLayout: (maybeLayoutSection: Node | undefined, current: PresetLayout) => PresetLayout;
|
|
15
|
-
export declare const createDefaultLayoutSection: (state: EditorState) => Node;
|
|
16
|
-
export declare const insertLayoutColumns: Command;
|
|
17
|
-
export declare const insertLayoutColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: TOOLBAR_MENU_TYPE) => Command;
|
|
18
|
-
export declare function forceSectionToPresetLayout(state: EditorState, node: Node, pos: number, presetLayout: PresetLayout): Transaction;
|
|
19
|
-
export declare const setPresetLayout: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (layout: PresetLayout) => Command;
|
|
20
|
-
export declare const fixColumnSizes: (changedTr: Transaction, state: EditorState) => Change | undefined;
|
|
21
|
-
export declare const fixColumnStructure: (state: EditorState) => Transaction | undefined;
|
|
22
|
-
export declare const deleteActiveLayoutNode: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { insertLayoutColumnsWithAnalytics } from './actions';
|
|
3
|
-
import { pluginKey } from './pm-plugins/plugin-key';
|
|
4
|
-
import type { LayoutPluginOptions } from './types';
|
|
5
|
-
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
6
|
-
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
7
|
-
export { pluginKey };
|
|
8
|
-
export type LayoutPlugin = NextEditorPlugin<'layout', {
|
|
9
|
-
pluginConfiguration: LayoutPluginOptions | undefined;
|
|
10
|
-
dependencies: [
|
|
11
|
-
DecorationsPlugin,
|
|
12
|
-
OptionalPlugin<AnalyticsPlugin>
|
|
13
|
-
];
|
|
14
|
-
actions: {
|
|
15
|
-
insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
|
|
16
|
-
};
|
|
17
|
-
}>;
|
|
18
|
-
export declare const layoutPlugin: LayoutPlugin;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { LayoutState } from './types';
|
|
3
|
-
import type { LayoutPluginOptions } from '../types';
|
|
4
|
-
export declare const DEFAULT_LAYOUT = "two_equal";
|
|
5
|
-
declare const _default: (options: LayoutPluginOptions) => SafePlugin<LayoutState>;
|
|
6
|
-
export default _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { PresetLayout } from '../types';
|
|
3
|
-
export type LayoutState = {
|
|
4
|
-
pos: number | null;
|
|
5
|
-
allowBreakout: boolean;
|
|
6
|
-
addSidebarLayouts: boolean;
|
|
7
|
-
selectedLayout: PresetLayout | undefined;
|
|
8
|
-
allowSingleColumnLayout: boolean;
|
|
9
|
-
};
|
|
10
|
-
export type Change = {
|
|
11
|
-
from: number;
|
|
12
|
-
to: number;
|
|
13
|
-
slice: Slice;
|
|
14
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export declare const toolbarMessages: {
|
|
2
|
-
singleColumn: {
|
|
3
|
-
id: string;
|
|
4
|
-
defaultMessage: string;
|
|
5
|
-
description: string;
|
|
6
|
-
};
|
|
7
|
-
twoColumns: {
|
|
8
|
-
id: string;
|
|
9
|
-
defaultMessage: string;
|
|
10
|
-
description: string;
|
|
11
|
-
};
|
|
12
|
-
threeColumns: {
|
|
13
|
-
id: string;
|
|
14
|
-
defaultMessage: string;
|
|
15
|
-
description: string;
|
|
16
|
-
};
|
|
17
|
-
rightSidebar: {
|
|
18
|
-
id: string;
|
|
19
|
-
defaultMessage: string;
|
|
20
|
-
description: string;
|
|
21
|
-
};
|
|
22
|
-
leftSidebar: {
|
|
23
|
-
id: string;
|
|
24
|
-
defaultMessage: string;
|
|
25
|
-
description: string;
|
|
26
|
-
};
|
|
27
|
-
threeColumnsWithSidebars: {
|
|
28
|
-
id: string;
|
|
29
|
-
defaultMessage: string;
|
|
30
|
-
description: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl-next';
|
|
2
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { FloatingToolbarConfig, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
4
|
-
import type { LayoutPlugin } from './';
|
|
5
|
-
export declare const layoutToolbarTitle = "Layout floating controls";
|
|
6
|
-
export declare const buildToolbar: (state: EditorState, intl: IntlShape, pos: number, _allowBreakout: boolean, addSidebarLayouts: boolean, allowSingleColumnLayout: boolean, api: ExtractInjectionAPI<LayoutPlugin> | undefined) => FloatingToolbarConfig | undefined;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
-
import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
|
|
3
|
-
export interface LayoutPluginOptions extends LongPressSelectionPluginOptions {
|
|
4
|
-
allowBreakout?: boolean;
|
|
5
|
-
UNSAFE_addSidebarLayouts?: boolean;
|
|
6
|
-
UNSAFE_allowSingleColumnLayout?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export type PresetLayout = 'single' | 'two_equal' | 'three_equal' | 'two_right_sidebar' | 'two_left_sidebar' | 'three_with_sidebars';
|
|
9
|
-
export interface Change {
|
|
10
|
-
from: number;
|
|
11
|
-
to: number;
|
|
12
|
-
slice: Slice;
|
|
13
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
export declare const showPlaceholderFloatingToolbar: (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
|
|
3
|
-
export declare const insertPlaceholderTextAtSelection: (value: string) => (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
|
|
4
|
-
export declare const hidePlaceholderFloatingToolbar: (state: EditorState, dispatch: (tr: Transaction) => void) => boolean;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { EditorState, SelectionBookmark, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
import type { Node, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
5
|
-
import { Slice } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
-
import type { Mappable } from '@atlaskit/editor-prosemirror/transform';
|
|
7
|
-
export declare class FakeTextCursorBookmark {
|
|
8
|
-
pos: undefined | number;
|
|
9
|
-
visible: boolean;
|
|
10
|
-
constructor(pos: number);
|
|
11
|
-
map(mapping: Mappable): FakeTextCursorBookmark;
|
|
12
|
-
resolve(doc: Node): Selection;
|
|
13
|
-
}
|
|
14
|
-
export declare class FakeTextCursorSelection extends Selection {
|
|
15
|
-
constructor($pos: ResolvedPos);
|
|
16
|
-
map(doc: Node, mapping: Mappable): Selection;
|
|
17
|
-
static content(): Slice;
|
|
18
|
-
eq(other: Selection): boolean;
|
|
19
|
-
toJSON(): {
|
|
20
|
-
type: string;
|
|
21
|
-
pos: number;
|
|
22
|
-
};
|
|
23
|
-
static fromJSON(doc: Node, json: {
|
|
24
|
-
pos: number;
|
|
25
|
-
}): Selection;
|
|
26
|
-
getBookmark(): SelectionBookmark;
|
|
27
|
-
}
|
|
28
|
-
export declare const addFakeTextCursor: (state: EditorState, dispatch: (tr: Transaction) => void) => void;
|
|
29
|
-
export declare const removeFakeTextCursor: (state: EditorState, dispatch: (tr: Transaction) => void) => void;
|
|
30
|
-
export declare const drawFakeTextCursor: (state: EditorState) => DecorationSet | null;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { NodeView, EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
|
-
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
-
import type { getPosHandler } from '@atlaskit/editor-common/react-node-view';
|
|
4
|
-
type PmMutationRecord = MutationRecord | {
|
|
5
|
-
type: 'selection';
|
|
6
|
-
target: Element;
|
|
7
|
-
};
|
|
8
|
-
export declare class PlaceholderTextNodeView implements NodeView {
|
|
9
|
-
private readonly node;
|
|
10
|
-
private readonly view;
|
|
11
|
-
private readonly getPos;
|
|
12
|
-
readonly dom: Node;
|
|
13
|
-
constructor(node: PMNode, view: EditorView, getPos: getPosHandler);
|
|
14
|
-
stopEvent(e: Event): boolean;
|
|
15
|
-
ignoreMutation(record: PmMutationRecord): boolean;
|
|
16
|
-
}
|
|
17
|
-
export {};
|