@atlaskit/editor-core 183.1.6 → 184.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +7 -3
- package/CHANGELOG.md +29 -0
- package/dist/cjs/labs/next/full-page.js +2 -6
- package/dist/cjs/labs/next/presets/create-stub-internal-apis.js +4 -2
- package/dist/cjs/labs/next/presets/default.js +2 -2
- package/dist/cjs/labs/next/presets/universal.js +2 -1
- package/dist/cjs/plugins/breakout/index.js +54 -35
- package/dist/cjs/plugins/card/toolbar.js +4 -3
- package/dist/cjs/plugins/collab-edit/plugin-state.js +2 -3
- package/dist/cjs/plugins/copy-button/commands.js +8 -1
- package/dist/cjs/plugins/extension/index.js +1 -1
- package/dist/cjs/plugins/extension/nodeviews/extension.js +5 -3
- package/dist/cjs/plugins/extension/pm-plugins/main.js +6 -6
- package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +34 -4
- package/dist/cjs/plugins/extension/ui/Extension/ExtensionComponent.js +4 -2
- package/dist/cjs/plugins/extension/ui/Extension/index.js +4 -2
- package/dist/cjs/plugins/help-dialog/index.js +12 -8
- package/dist/cjs/plugins/index.js +0 -14
- package/dist/cjs/plugins/layout/pm-plugins/main.js +0 -1
- package/dist/cjs/plugins/media/index.js +15 -5
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/index.js +22 -14
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +53 -34
- package/dist/cjs/plugins/media/styles.js +1 -1
- package/dist/cjs/plugins/media/toolbar/index.js +4 -3
- package/dist/cjs/plugins/paste/pm-plugins/main.js +7 -1
- package/dist/cjs/test-utils.js +6 -1
- package/dist/cjs/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +2 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +1 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +2 -2
- package/dist/cjs/ui/ColorPickerButton/index.js +2 -2
- package/dist/cjs/ui/ConfigPanel/Fields/ColorPicker.js +6 -10
- package/dist/cjs/ui/ContentStyles/index.js +9 -10
- package/dist/cjs/ui/ContextPanel/index.js +67 -56
- package/dist/cjs/ui/MediaAndEmbedsToolbar/index.js +10 -11
- package/dist/cjs/ui/Resizer/index.js +8 -8
- package/dist/cjs/ui/WidthEmitter/index.js +10 -4
- package/dist/cjs/ui/styles.js +6 -0
- package/dist/cjs/utils/clipboard.js +18 -11
- package/dist/cjs/utils/performance/instrumented-plugin.js +14 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/labs/next/full-page.js +2 -5
- package/dist/es2019/labs/next/presets/create-stub-internal-apis.js +4 -2
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/labs/next/presets/universal.js +2 -1
- package/dist/es2019/plugins/breakout/index.js +48 -31
- package/dist/es2019/plugins/card/toolbar.js +4 -3
- package/dist/es2019/plugins/collab-edit/plugin-state.js +2 -4
- package/dist/es2019/plugins/copy-button/commands.js +9 -2
- package/dist/es2019/plugins/extension/index.js +1 -1
- package/dist/es2019/plugins/extension/nodeviews/extension.js +5 -3
- package/dist/es2019/plugins/extension/pm-plugins/main.js +4 -4
- package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +38 -2
- package/dist/es2019/plugins/extension/ui/Extension/ExtensionComponent.js +4 -2
- package/dist/es2019/plugins/extension/ui/Extension/index.js +4 -2
- package/dist/es2019/plugins/help-dialog/index.js +14 -9
- package/dist/es2019/plugins/index.js +0 -2
- package/dist/es2019/plugins/layout/pm-plugins/main.js +0 -1
- package/dist/es2019/plugins/media/index.js +15 -5
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/index.js +21 -10
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +53 -33
- package/dist/es2019/plugins/media/styles.js +1 -7
- package/dist/es2019/plugins/media/toolbar/index.js +4 -4
- package/dist/es2019/plugins/paste/pm-plugins/main.js +7 -1
- package/dist/es2019/test-utils.js +6 -1
- package/dist/es2019/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +1 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +1 -1
- package/dist/es2019/ui/ColorPickerButton/index.js +2 -2
- package/dist/es2019/ui/ConfigPanel/Fields/ColorPicker.js +5 -10
- package/dist/es2019/ui/ContentStyles/index.js +1 -2
- package/dist/es2019/ui/ContextPanel/index.js +66 -43
- package/dist/es2019/ui/MediaAndEmbedsToolbar/index.js +8 -9
- package/dist/es2019/ui/Resizer/index.js +1 -1
- package/dist/es2019/ui/WidthEmitter/index.js +10 -4
- package/dist/es2019/ui/styles.js +6 -0
- package/dist/es2019/utils/clipboard.js +12 -7
- package/dist/es2019/utils/performance/instrumented-plugin.js +15 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/labs/next/full-page.js +2 -5
- package/dist/esm/labs/next/presets/create-stub-internal-apis.js +4 -2
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/labs/next/presets/universal.js +2 -1
- package/dist/esm/plugins/breakout/index.js +54 -35
- package/dist/esm/plugins/card/toolbar.js +4 -3
- package/dist/esm/plugins/collab-edit/plugin-state.js +2 -3
- package/dist/esm/plugins/copy-button/commands.js +9 -2
- package/dist/esm/plugins/extension/index.js +1 -1
- package/dist/esm/plugins/extension/nodeviews/extension.js +5 -3
- package/dist/esm/plugins/extension/pm-plugins/main.js +6 -6
- package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +33 -2
- package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +4 -2
- package/dist/esm/plugins/extension/ui/Extension/index.js +4 -2
- package/dist/esm/plugins/help-dialog/index.js +12 -8
- package/dist/esm/plugins/index.js +0 -2
- package/dist/esm/plugins/layout/pm-plugins/main.js +0 -1
- package/dist/esm/plugins/media/index.js +15 -5
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/index.js +22 -14
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +54 -35
- package/dist/esm/plugins/media/styles.js +2 -2
- package/dist/esm/plugins/media/toolbar/index.js +4 -3
- package/dist/esm/plugins/paste/pm-plugins/main.js +7 -1
- package/dist/esm/test-utils.js +6 -1
- package/dist/esm/ui/Appearance/Comment/Comment.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +1 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +1 -1
- package/dist/esm/ui/ColorPickerButton/index.js +2 -2
- package/dist/esm/ui/ConfigPanel/Fields/ColorPicker.js +5 -10
- package/dist/esm/ui/ContentStyles/index.js +1 -2
- package/dist/esm/ui/ContextPanel/index.js +64 -53
- package/dist/esm/ui/MediaAndEmbedsToolbar/index.js +10 -11
- package/dist/esm/ui/Resizer/index.js +1 -1
- package/dist/esm/ui/WidthEmitter/index.js +10 -4
- package/dist/esm/ui/styles.js +6 -0
- package/dist/esm/utils/clipboard.js +16 -10
- package/dist/esm/utils/performance/instrumented-plugin.js +14 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +1 -1
- package/dist/types/create-editor/get-plugins.d.ts +2 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/plugins/breakout/index.d.ts +4 -0
- package/dist/types/plugins/breakout/ui/LayoutButton.d.ts +1 -1
- package/dist/types/plugins/card/index.d.ts +2 -2
- package/dist/types/plugins/collab-edit/actions.d.ts +3 -2
- package/dist/types/plugins/collab-edit/events/handlers.d.ts +3 -3
- package/dist/types/plugins/collab-edit/events/initialize.d.ts +1 -1
- package/dist/types/plugins/collab-edit/events/send-transaction.d.ts +1 -1
- package/dist/types/plugins/collab-edit/index.d.ts +0 -1
- package/dist/types/plugins/collab-edit/native-collab-provider-plugin.d.ts +2 -2
- package/dist/types/plugins/collab-edit/participants.d.ts +1 -1
- package/dist/types/plugins/collab-edit/plugin.d.ts +0 -2
- package/dist/types/plugins/collab-edit/types.d.ts +1 -3
- package/dist/types/plugins/collab-edit/ui/to-avatar.d.ts +1 -1
- package/dist/types/plugins/collab-edit/utils.d.ts +2 -1
- package/dist/types/plugins/extension/index.d.ts +2 -1
- package/dist/types/plugins/extension/nodeviews/extension.d.ts +4 -1
- package/dist/types/plugins/extension/pm-plugins/main.d.ts +3 -1
- package/dist/types/plugins/extension/ui/Extension/Extension/index.d.ts +6 -0
- package/dist/types/plugins/extension/ui/Extension/ExtensionComponent.d.ts +3 -0
- package/dist/types/plugins/extension/ui/Extension/index.d.ts +3 -0
- package/dist/types/plugins/help-dialog/index.d.ts +3 -1
- package/dist/types/plugins/index.d.ts +0 -3
- package/dist/types/plugins/media/index.d.ts +12 -2
- package/dist/types/plugins/media/nodeviews/mediaNodeView/index.d.ts +4 -2
- package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types/plugins/media/nodeviews/types.d.ts +2 -1
- package/dist/types/plugins/media/toolbar/index.d.ts +3 -1
- package/dist/types/plugins/media/ui/ResizableMediaSingle/types.d.ts +2 -2
- package/dist/types/test-utils.d.ts +3 -1
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types/ui/ColorPickerButton/index.d.ts +3 -3
- package/dist/types/ui/ContextPanel/index.d.ts +3 -4
- package/dist/types/ui/MediaAndEmbedsToolbar/index.d.ts +3 -1
- package/dist/types/ui/PluginSlot/index.d.ts +1 -1
- package/dist/types/ui/Resizer/types.d.ts +2 -2
- package/dist/types/utils/clipboard.d.ts +1 -0
- package/dist/types-ts4.5/actions/index.d.ts +1 -1
- package/dist/types-ts4.5/create-editor/get-plugins.d.ts +2 -0
- package/dist/types-ts4.5/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/breakout/index.d.ts +6 -0
- package/dist/types-ts4.5/plugins/breakout/ui/LayoutButton.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/collab-edit/actions.d.ts +3 -2
- package/dist/types-ts4.5/plugins/collab-edit/events/handlers.d.ts +3 -3
- package/dist/types-ts4.5/plugins/collab-edit/events/initialize.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/events/send-transaction.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/collab-edit/native-collab-provider-plugin.d.ts +2 -2
- package/dist/types-ts4.5/plugins/collab-edit/participants.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/plugin.d.ts +0 -2
- package/dist/types-ts4.5/plugins/collab-edit/types.d.ts +1 -3
- package/dist/types-ts4.5/plugins/collab-edit/ui/to-avatar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/utils.d.ts +2 -1
- package/dist/types-ts4.5/plugins/extension/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/extension/nodeviews/extension.d.ts +4 -1
- package/dist/types-ts4.5/plugins/extension/pm-plugins/main.d.ts +3 -1
- package/dist/types-ts4.5/plugins/extension/ui/Extension/Extension/index.d.ts +6 -0
- package/dist/types-ts4.5/plugins/extension/ui/Extension/ExtensionComponent.d.ts +3 -0
- package/dist/types-ts4.5/plugins/extension/ui/Extension/index.d.ts +3 -0
- package/dist/types-ts4.5/plugins/help-dialog/index.d.ts +5 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/media/index.d.ts +9 -2
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaNodeView/index.d.ts +4 -2
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/nodeviews/types.d.ts +2 -1
- package/dist/types-ts4.5/plugins/media/toolbar/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/types.d.ts +2 -2
- package/dist/types-ts4.5/test-utils.d.ts +3 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
- package/dist/types-ts4.5/ui/ColorPickerButton/index.d.ts +3 -3
- package/dist/types-ts4.5/ui/ContextPanel/index.d.ts +3 -4
- package/dist/types-ts4.5/ui/MediaAndEmbedsToolbar/index.d.ts +3 -1
- package/dist/types-ts4.5/ui/PluginSlot/index.d.ts +1 -1
- package/dist/types-ts4.5/ui/Resizer/types.d.ts +2 -2
- package/dist/types-ts4.5/utils/clipboard.d.ts +1 -0
- package/package.json +25 -23
- package/report.api.md +15 -63
- package/dist/cjs/plugins/collab-edit/provider/index.js +0 -5
- package/dist/cjs/plugins/collab-edit/provider/types.js +0 -5
- package/dist/cjs/plugins/grid/index.js +0 -207
- package/dist/cjs/plugins/grid/styles.js +0 -16
- package/dist/cjs/plugins/grid/types.js +0 -5
- package/dist/cjs/plugins/width/index.js +0 -88
- package/dist/cjs/ui/ContextPanel/context.js +0 -89
- package/dist/es2019/plugins/collab-edit/provider/index.js +0 -1
- package/dist/es2019/plugins/collab-edit/provider/types.js +0 -1
- package/dist/es2019/plugins/grid/index.js +0 -168
- package/dist/es2019/plugins/grid/styles.js +0 -36
- package/dist/es2019/plugins/grid/types.js +0 -1
- package/dist/es2019/plugins/width/index.js +0 -72
- package/dist/es2019/ui/ContextPanel/context.js +0 -65
- package/dist/esm/plugins/collab-edit/provider/index.js +0 -1
- package/dist/esm/plugins/collab-edit/provider/types.js +0 -1
- package/dist/esm/plugins/grid/index.js +0 -191
- package/dist/esm/plugins/grid/styles.js +0 -7
- package/dist/esm/plugins/grid/types.js +0 -1
- package/dist/esm/plugins/width/index.js +0 -78
- package/dist/esm/ui/ContextPanel/context.js +0 -79
- package/dist/types/plugins/collab-edit/provider/index.d.ts +0 -1
- package/dist/types/plugins/collab-edit/provider/types.d.ts +0 -1
- package/dist/types/plugins/grid/index.d.ts +0 -25
- package/dist/types/plugins/grid/styles.d.ts +0 -2
- package/dist/types/plugins/grid/types.d.ts +0 -7
- package/dist/types/plugins/width/index.d.ts +0 -18
- package/dist/types/ui/ContextPanel/context.d.ts +0 -24
- package/dist/types-ts4.5/plugins/collab-edit/provider/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/collab-edit/provider/types.d.ts +0 -1
- package/dist/types-ts4.5/plugins/grid/index.d.ts +0 -27
- package/dist/types-ts4.5/plugins/grid/styles.d.ts +0 -2
- package/dist/types-ts4.5/plugins/grid/types.d.ts +0 -7
- package/dist/types-ts4.5/plugins/width/index.d.ts +0 -18
- package/dist/types-ts4.5/ui/ContextPanel/context.d.ts +0 -24
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
4
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
5
|
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
@@ -7,6 +8,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
7
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
10
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
11
|
+
var _excluded = ["actions"];
|
|
10
12
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
11
13
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
14
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -18,10 +20,9 @@ import { css, jsx } from '@emotion/react';
|
|
|
18
20
|
import Transition from 'react-transition-group/Transition';
|
|
19
21
|
import { N30 } from '@atlaskit/theme/colors';
|
|
20
22
|
import { akEditorSwoopCubicBezier, akEditorDefaultLayoutWidth, akEditorWideLayoutWidth, akEditorBreakoutPadding, akEditorContextPanelWidth, ATLASSIAN_NAVIGATION_HEIGHT } from '@atlaskit/editor-shared-styles';
|
|
21
|
-
import { ContextPanelConsumer } from '
|
|
23
|
+
import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
22
24
|
import WithPluginState from '../WithPluginState';
|
|
23
25
|
import { pluginKey as contextPanelPluginKey } from '../../plugins/context-panel';
|
|
24
|
-
import { pluginKey as widthPluginKey } from '../../plugins/width';
|
|
25
26
|
import WithEditorActions from '../WithEditorActions';
|
|
26
27
|
import { getChildBreakoutModes } from '../../utils/document';
|
|
27
28
|
var ANIM_SPEED_MS = 500;
|
|
@@ -57,6 +58,13 @@ export var SwappableContentArea = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
57
58
|
mounted: false,
|
|
58
59
|
currentPluginContent: undefined
|
|
59
60
|
});
|
|
61
|
+
_defineProperty(_assertThisInitialized(_this), "focusEditor", function () {
|
|
62
|
+
var editorView = _this.props.editorView;
|
|
63
|
+
if (editorView && !editorView.hasFocus()) {
|
|
64
|
+
var _editorView$focus;
|
|
65
|
+
(_editorView$focus = editorView.focus) === null || _editorView$focus === void 0 ? void 0 : _editorView$focus.call(editorView);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
60
68
|
_defineProperty(_assertThisInitialized(_this), "showPluginContent", function () {
|
|
61
69
|
var pluginContent = _this.props.pluginContent;
|
|
62
70
|
var currentPluginContent = _this.state.currentPluginContent;
|
|
@@ -82,7 +90,8 @@ export var SwappableContentArea = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
82
90
|
timeout: _this.state.mounted ? ANIM_SPEED_MS : 0,
|
|
83
91
|
in: isVisible,
|
|
84
92
|
mountOnEnter: true,
|
|
85
|
-
unmountOnExit: true
|
|
93
|
+
unmountOnExit: true,
|
|
94
|
+
onExiting: _this.focusEditor
|
|
86
95
|
}, children);
|
|
87
96
|
});
|
|
88
97
|
return _this;
|
|
@@ -114,8 +123,9 @@ export var SwappableContentArea = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
114
123
|
var broadcastWidth = _ref.broadcastWidth,
|
|
115
124
|
broadcastPosition = _ref.broadcastPosition,
|
|
116
125
|
positionedOverEditor = _ref.positionedOverEditor;
|
|
126
|
+
var contextPanelWidth = visible ? width : 0;
|
|
117
127
|
var newPosition = editorWidth ? shouldPanelBePositionedOverEditor(editorWidth, width) : false;
|
|
118
|
-
broadcastWidth(
|
|
128
|
+
broadcastWidth(contextPanelWidth);
|
|
119
129
|
(newPosition && visible) !== positionedOverEditor && broadcastPosition(newPosition && visible);
|
|
120
130
|
return jsx("div", {
|
|
121
131
|
css: [panel, !visible && panelHidden,
|
|
@@ -146,55 +156,56 @@ export var SwappableContentArea = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
146
156
|
}]);
|
|
147
157
|
return SwappableContentArea;
|
|
148
158
|
}(React.PureComponent);
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
159
|
+
|
|
160
|
+
// TODO: ED-17837 We have this workaround because we do
|
|
161
|
+
// not have access to the pluginInjectionApi at this location.
|
|
162
|
+
// It might be that we need to inject the pluginInjectionApi
|
|
163
|
+
// via context so that we can use it in this file (similar to
|
|
164
|
+
// WithEditorActions). To be investigated further.
|
|
165
|
+
// @ts-ignore
|
|
166
|
+
var widthPluginKey = {
|
|
167
|
+
key: 'widthPlugin$',
|
|
168
|
+
getState: function getState(state) {
|
|
169
|
+
return state['widthPlugin$'];
|
|
155
170
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
width: 0,
|
|
180
|
-
containerWidth: 0,
|
|
181
|
-
lineLength: akEditorDefaultLayoutWidth
|
|
182
|
-
} : _ref2$widthState;
|
|
183
|
-
var firstContent = contextPanel && contextPanel.contents.find(Boolean);
|
|
184
|
-
var editorWidth = _objectSpread(_objectSpread({}, widthState), {}, {
|
|
185
|
-
contentBreakoutModes: editorView ? getChildBreakoutModes(editorView.state.doc, editorView.state.schema) : []
|
|
186
|
-
});
|
|
187
|
-
return jsx(SwappableContentArea, _extends({}, _this3.props, {
|
|
188
|
-
editorView: editorView,
|
|
189
|
-
pluginContent: firstContent,
|
|
190
|
-
editorWidth: editorWidth
|
|
191
|
-
}));
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
}
|
|
171
|
+
};
|
|
172
|
+
function ContextPanelWithActions(_ref2) {
|
|
173
|
+
var actions = _ref2.actions,
|
|
174
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
175
|
+
var eventDispatcher = actions._privateGetEventDispatcher();
|
|
176
|
+
var editorView = actions._privateGetEditorView();
|
|
177
|
+
if (!eventDispatcher) {
|
|
178
|
+
return jsx(SwappableContentArea, _extends({
|
|
179
|
+
editorView: editorView
|
|
180
|
+
}, props));
|
|
181
|
+
}
|
|
182
|
+
return jsx(WithPluginState, {
|
|
183
|
+
eventDispatcher: eventDispatcher,
|
|
184
|
+
plugins: {
|
|
185
|
+
contextPanel: contextPanelPluginKey,
|
|
186
|
+
widthState: widthPluginKey
|
|
187
|
+
},
|
|
188
|
+
render: function render(_ref3) {
|
|
189
|
+
var contextPanel = _ref3.contextPanel,
|
|
190
|
+
widthState = _ref3.widthState;
|
|
191
|
+
var firstContent = contextPanel && contextPanel.contents.find(Boolean);
|
|
192
|
+
var editorWidth = _objectSpread(_objectSpread({}, widthState), {}, {
|
|
193
|
+
contentBreakoutModes: editorView ? getChildBreakoutModes(editorView.state.doc, editorView.state.schema) : []
|
|
195
194
|
});
|
|
195
|
+
return jsx(SwappableContentArea, _extends({}, props, {
|
|
196
|
+
editorView: editorView,
|
|
197
|
+
pluginContent: firstContent,
|
|
198
|
+
editorWidth: editorWidth
|
|
199
|
+
}));
|
|
196
200
|
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
export default function ContextPanel(props) {
|
|
204
|
+
return jsx(WithEditorActions, {
|
|
205
|
+
render: function render(actions) {
|
|
206
|
+
return jsx(ContextPanelWithActions, _extends({
|
|
207
|
+
actions: actions
|
|
208
|
+
}, props));
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}
|
|
@@ -10,7 +10,6 @@ import EditorAlignImageLeft from '@atlaskit/icon/glyph/editor/align-image-left';
|
|
|
10
10
|
import EditorAlignImageRight from '@atlaskit/icon/glyph/editor/align-image-right';
|
|
11
11
|
import EditorAlignImageCenter from '@atlaskit/icon/glyph/editor/align-image-center';
|
|
12
12
|
import { alignAttributes } from '../../utils/rich-media-utils';
|
|
13
|
-
import { pluginKey as widthPluginKey } from '../../plugins/width';
|
|
14
13
|
import { DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
15
14
|
import { addAnalytics } from '../../plugins/analytics/utils';
|
|
16
15
|
import { ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, ACTION } from '../../plugins/analytics';
|
|
@@ -61,7 +60,7 @@ var getNodeWidth = function getNodeWidth(node, schema) {
|
|
|
61
60
|
}
|
|
62
61
|
return node.firstChild && node.firstChild.attrs.width || node.attrs.width;
|
|
63
62
|
};
|
|
64
|
-
var makeAlign = function makeAlign(layout, nodeType) {
|
|
63
|
+
var makeAlign = function makeAlign(layout, nodeType, widthPluginDependencyApi) {
|
|
65
64
|
return function (state, dispatch) {
|
|
66
65
|
var _ref = state.selection,
|
|
67
66
|
node = _ref.node;
|
|
@@ -70,7 +69,7 @@ var makeAlign = function makeAlign(layout, nodeType) {
|
|
|
70
69
|
if (!dispatch) {
|
|
71
70
|
return false;
|
|
72
71
|
}
|
|
73
|
-
var widthPluginState =
|
|
72
|
+
var widthPluginState = widthPluginDependencyApi === null || widthPluginDependencyApi === void 0 ? void 0 : widthPluginDependencyApi.sharedState.currentState();
|
|
74
73
|
if (!node || node.type !== nodeType || !widthPluginState) {
|
|
75
74
|
return false;
|
|
76
75
|
}
|
|
@@ -100,7 +99,7 @@ var makeAlign = function makeAlign(layout, nodeType) {
|
|
|
100
99
|
return true;
|
|
101
100
|
};
|
|
102
101
|
};
|
|
103
|
-
var mapIconsToToolbarItem = function mapIconsToToolbarItem(icons, layout, intl, nodeType) {
|
|
102
|
+
var mapIconsToToolbarItem = function mapIconsToToolbarItem(icons, layout, intl, nodeType, widthPluginDependencyApi) {
|
|
104
103
|
return icons.map(function (toolbarItem) {
|
|
105
104
|
var id = toolbarItem.id,
|
|
106
105
|
value = toolbarItem.value;
|
|
@@ -110,7 +109,7 @@ var mapIconsToToolbarItem = function mapIconsToToolbarItem(icons, layout, intl,
|
|
|
110
109
|
icon: toolbarItem.icon,
|
|
111
110
|
title: intl.formatMessage(layoutToMessages[value]),
|
|
112
111
|
selected: layout === value,
|
|
113
|
-
onClick: makeAlign(value, nodeType)
|
|
112
|
+
onClick: makeAlign(value, nodeType, widthPluginDependencyApi)
|
|
114
113
|
};
|
|
115
114
|
});
|
|
116
115
|
};
|
|
@@ -118,17 +117,17 @@ var shouldHideLayoutToolbar = function shouldHideLayoutToolbar(selection, _ref2,
|
|
|
118
117
|
var nodes = _ref2.nodes;
|
|
119
118
|
return hasParentNodeOfType([nodes.bodiedExtension, nodes.listItem, nodes.expand, nodes.nestedExpand].concat(_toConsumableArray(allowResizingInTables ? [] : [nodes.table])).filter(Boolean))(selection);
|
|
120
119
|
};
|
|
121
|
-
var buildLayoutButtons = function buildLayoutButtons(state, intl, nodeType, allowResizing, allowResizingInTables) {
|
|
122
|
-
var allowWrapping = arguments.length >
|
|
123
|
-
var allowAlignment = arguments.length >
|
|
120
|
+
var buildLayoutButtons = function buildLayoutButtons(state, intl, nodeType, widthPluginDependencyApi, allowResizing, allowResizingInTables) {
|
|
121
|
+
var allowWrapping = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true;
|
|
122
|
+
var allowAlignment = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : true;
|
|
124
123
|
var selection = state.selection;
|
|
125
124
|
if (!(selection instanceof NodeSelection) || !selection.node || !nodeType || shouldHideLayoutToolbar(selection, state.schema, allowResizingInTables)) {
|
|
126
125
|
return [];
|
|
127
126
|
}
|
|
128
127
|
var layout = selection.node.attrs.layout;
|
|
129
|
-
var alignmentToolbarItems = allowAlignment ? mapIconsToToolbarItem(alignmentIcons, layout, intl, nodeType) : [];
|
|
130
|
-
var wrappingToolbarItems = allowWrapping ? mapIconsToToolbarItem(wrappingIcons, layout, intl, nodeType) : [];
|
|
131
|
-
var breakOutToolbarItems = !allowResizing ? mapIconsToToolbarItem(breakoutIcons, layout, intl, nodeType) : [];
|
|
128
|
+
var alignmentToolbarItems = allowAlignment ? mapIconsToToolbarItem(alignmentIcons, layout, intl, nodeType, widthPluginDependencyApi) : [];
|
|
129
|
+
var wrappingToolbarItems = allowWrapping ? mapIconsToToolbarItem(wrappingIcons, layout, intl, nodeType, widthPluginDependencyApi) : [];
|
|
130
|
+
var breakOutToolbarItems = !allowResizing ? mapIconsToToolbarItem(breakoutIcons, layout, intl, nodeType, widthPluginDependencyApi) : [];
|
|
132
131
|
var items = [].concat(_toConsumableArray(alignmentToolbarItems), _toConsumableArray(getSeparatorBetweenAlignmentAndWrapping(allowAlignment, allowWrapping)), _toConsumableArray(wrappingToolbarItems), _toConsumableArray(getSeparatorBeforeBreakoutItems(allowAlignment, allowWrapping, allowResizing)), _toConsumableArray(breakOutToolbarItems));
|
|
133
132
|
return items;
|
|
134
133
|
};
|
|
@@ -10,7 +10,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import classnames from 'classnames';
|
|
12
12
|
import { Resizable } from 're-resizable';
|
|
13
|
-
import { gridTypeForLayout } from '
|
|
13
|
+
import { gridTypeForLayout } from '@atlaskit/editor-common/utils';
|
|
14
14
|
import { snapTo, handleSides } from './utils';
|
|
15
15
|
import { richMediaClassName } from '@atlaskit/editor-common/styles';
|
|
16
16
|
import { akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles';
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import React, {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import React, { useContext, useEffect, useState } from 'react';
|
|
3
|
+
import { ContextPanel, WidthContext } from '@atlaskit/editor-common/ui';
|
|
4
|
+
// TODO: ED-17870 This workaround will be removed here.
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
var widthPluginKey = {
|
|
7
|
+
key: 'widthPlugin$',
|
|
8
|
+
getState: function getState(state) {
|
|
9
|
+
return state['widthPlugin$'];
|
|
10
|
+
}
|
|
11
|
+
};
|
|
6
12
|
// Why do we need this? Why not just use the width from the context directly rather than this?
|
|
7
13
|
// Well my friend - some of the VR tests break, seemingly due to the fact that existing behaviour
|
|
8
14
|
// assumes the initial value is 0, the width from context may not start from 0 however.
|
package/dist/esm/ui/styles.js
CHANGED
|
@@ -5,7 +5,13 @@ import { N30 } from '@atlaskit/theme/colors';
|
|
|
5
5
|
export { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
6
6
|
export { scrollbarStyles } from '@atlaskit/editor-shared-styles/scrollbar';
|
|
7
7
|
export var buttonGroupStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n align-items: center;\n\n & > div {\n display: flex;\n }\n"])));
|
|
8
|
+
|
|
9
|
+
// This style is copied to packages/editor/editor-plugin-ai/src/ui/components/AtlassianIntelligenceToolbarButton/styles.tsx
|
|
10
|
+
// If you make change here, change in above file as well.
|
|
8
11
|
export var separatorStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: ", ";\n width: 1px;\n height: 24px;\n display: inline-block;\n margin: 0 8px;\n user-select: none;\n"])), "var(--ds-border, ".concat(N30, ")"));
|
|
12
|
+
|
|
13
|
+
// This style is copied to packages/editor/editor-plugin-ai/src/ui/components/AtlassianIntelligenceToolbarButton/styles.tsx
|
|
14
|
+
// If you make change here, change in above file as well.
|
|
9
15
|
export var wrapperStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n\n > div,\n > span {\n display: flex;\n }\n\n > div > div {\n display: flex;\n }\n\n margin-left: 0;\n min-width: auto;\n"])));
|
|
10
16
|
export var wrapperSmallStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-left: 4px;\n min-width: 40px;\n"])));
|
|
11
17
|
export var expandIconWrapperStyle = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-left: -8px;\n"])));
|
|
@@ -75,7 +75,7 @@ export var copyToClipboard = /*#__PURE__*/function () {
|
|
|
75
75
|
}();
|
|
76
76
|
export var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
77
77
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(elementToCopy, plainTextToCopy) {
|
|
78
|
-
var data
|
|
78
|
+
var data;
|
|
79
79
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
80
80
|
while (1) switch (_context2.prev = _context2.next) {
|
|
81
81
|
case 0:
|
|
@@ -102,17 +102,13 @@ export var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
|
102
102
|
_context2.t0 = _context2["catch"](1);
|
|
103
103
|
throw new Error('Clipboard api is not supported');
|
|
104
104
|
case 10:
|
|
105
|
-
_context2.next =
|
|
105
|
+
_context2.next = 13;
|
|
106
106
|
break;
|
|
107
107
|
case 12:
|
|
108
|
-
//
|
|
108
|
+
// ED-17083 extension copy seems have issue with ClipboardItem API
|
|
109
109
|
// Hence of use of this polyfill
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
dt.setData('text/plain', plainTextToCopy || elementToCopy.innerText);
|
|
113
|
-
dt.setData('text/html', elementToCopy.innerHTML);
|
|
114
|
-
Clipboard.write(dt);
|
|
115
|
-
case 17:
|
|
110
|
+
copyHTMLToClipboardPolyfill(elementToCopy, plainTextToCopy);
|
|
111
|
+
case 13:
|
|
116
112
|
case "end":
|
|
117
113
|
return _context2.stop();
|
|
118
114
|
}
|
|
@@ -121,4 +117,14 @@ export var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
|
121
117
|
return function copyHTMLToClipboard(_x2, _x3) {
|
|
122
118
|
return _ref3.apply(this, arguments);
|
|
123
119
|
};
|
|
124
|
-
}();
|
|
120
|
+
}();
|
|
121
|
+
|
|
122
|
+
// At the time of development, Firefox doesn't support ClipboardItem API
|
|
123
|
+
// Hence of use of this polyfill
|
|
124
|
+
export var copyHTMLToClipboardPolyfill = function copyHTMLToClipboardPolyfill(elementToCopy, plainTextToCopy) {
|
|
125
|
+
var Clipboard = clipboard;
|
|
126
|
+
var dt = new Clipboard.DT();
|
|
127
|
+
dt.setData('text/plain', plainTextToCopy || elementToCopy.innerText);
|
|
128
|
+
dt.setData('text/html', elementToCopy.innerHTML);
|
|
129
|
+
Clipboard.write(dt);
|
|
130
|
+
};
|
|
@@ -54,18 +54,30 @@ export var InstrumentedPlugin = /*#__PURE__*/function (_SafePlugin) {
|
|
|
54
54
|
return result;
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
+
var _uiTracking$samplingR = uiTracking.samplingRate,
|
|
58
|
+
uiTrackingSamplingRate = _uiTracking$samplingR === void 0 ? 100 : _uiTracking$samplingR;
|
|
57
59
|
if (uiTracking.enabled && spec.view) {
|
|
58
60
|
var originalView = spec.view.bind(spec);
|
|
59
61
|
spec.view = function (editorView) {
|
|
60
62
|
var self = _assertThisInitialized(_this);
|
|
61
63
|
var measure = "\uD83E\uDD89".concat(self.key, "::view::update");
|
|
62
64
|
var view = originalView(editorView);
|
|
65
|
+
var uiTrackingSamplingCounter = 0;
|
|
63
66
|
if (view.update) {
|
|
64
67
|
var originalUpdate = view.update;
|
|
65
68
|
view.update = function (view, state) {
|
|
66
|
-
|
|
69
|
+
var shouldTrack = uiTrackingSamplingRate && uiTrackingSamplingCounter === 0;
|
|
70
|
+
if (shouldTrack) {
|
|
71
|
+
startMeasure(measure);
|
|
72
|
+
}
|
|
67
73
|
originalUpdate(view, state);
|
|
68
|
-
|
|
74
|
+
if (shouldTrack) {
|
|
75
|
+
stopMeasure(measure, function () {});
|
|
76
|
+
}
|
|
77
|
+
uiTrackingSamplingCounter++;
|
|
78
|
+
if (uiTrackingSamplingRate && uiTrackingSamplingCounter >= uiTrackingSamplingRate) {
|
|
79
|
+
uiTrackingSamplingCounter = 0;
|
|
80
|
+
}
|
|
69
81
|
};
|
|
70
82
|
}
|
|
71
83
|
return view;
|
package/dist/esm/version.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Node } from 'prosemirror-model';
|
|
2
2
|
import { ContextUpdateHandler, EditorActionsOptions, ReplaceRawValue } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { AnalyticsEventPayload } from '@atlaskit/analytics-next/AnalyticsEvent';
|
|
4
|
-
import { ResolvedEditorState } from '@atlaskit/
|
|
4
|
+
import type { ResolvedEditorState } from '@atlaskit/collab-provider';
|
|
5
5
|
import type { FeatureFlags, Transformer } from '@atlaskit/editor-common/types';
|
|
6
6
|
import { EditorView } from 'prosemirror-view';
|
|
7
7
|
import { EventDispatcher } from '../event-dispatcher';
|
|
@@ -7,6 +7,7 @@ import { MarkConfig, NodeConfig } from '../types/pm-config';
|
|
|
7
7
|
import { EditorReactContext } from '../types/editor-react-context';
|
|
8
8
|
import { FeatureFlags } from '../types/feature-flags';
|
|
9
9
|
import { IntlShape } from 'react-intl-next';
|
|
10
|
+
import { UIComponentFactory } from '@atlaskit/editor-common/types';
|
|
10
11
|
export type LightPMPluginFactoryParams = {
|
|
11
12
|
schema: Schema;
|
|
12
13
|
dispatch: Dispatch;
|
|
@@ -36,6 +37,7 @@ export interface LightEditorPlugin {
|
|
|
36
37
|
marks?: () => MarkConfig[];
|
|
37
38
|
nodes?: () => NodeConfig[];
|
|
38
39
|
pmPlugins?: (pluginOptions?: any) => Array<LightPMPlugin>;
|
|
40
|
+
contentComponent?: UIComponentFactory;
|
|
39
41
|
pluginsOptions?: Record<string, any>;
|
|
40
42
|
onEditorViewStateUpdated?: OnEditorViewStateUpdated;
|
|
41
43
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ export { EmojiResource } from '@atlaskit/emoji/resource';
|
|
|
13
13
|
export { default as mediaPlugin, insertMediaSingleNode } from './plugins/media';
|
|
14
14
|
export type { MediaProvider, MediaState, CustomMediaPicker, } from './plugins/media';
|
|
15
15
|
export type { MediaOptions } from './plugins/media/types';
|
|
16
|
-
export type { CollabEditProvider } from './plugins/collab-edit';
|
|
17
16
|
export { AbstractMentionResource, MentionResource, PresenceResource, } from '@atlaskit/mention/resource';
|
|
18
17
|
export type { MentionProvider, PresenceProvider, } from '@atlaskit/mention/resource';
|
|
19
18
|
export { TeamMentionResource } from '@atlaskit/mention/team-resource';
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
3
|
+
import { BreakoutPluginState } from './types';
|
|
2
4
|
interface BreakoutPluginOptions {
|
|
3
5
|
allowBreakoutButton?: boolean;
|
|
4
6
|
}
|
|
5
7
|
declare const breakoutPlugin: NextEditorPlugin<'breakout', {
|
|
6
8
|
pluginConfiguration: BreakoutPluginOptions | undefined;
|
|
9
|
+
dependencies: [typeof widthPlugin];
|
|
10
|
+
sharedState: Partial<BreakoutPluginState>;
|
|
7
11
|
}>;
|
|
8
12
|
export default breakoutPlugin;
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import { EditorView } from 'prosemirror-view';
|
|
5
5
|
import { Node as PMNode } from 'prosemirror-model';
|
|
6
|
-
interface Props {
|
|
6
|
+
export interface Props {
|
|
7
7
|
editorView: EditorView;
|
|
8
8
|
mountPoint?: HTMLElement;
|
|
9
9
|
node: PMNode | null;
|
|
@@ -2,9 +2,9 @@ import { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
|
2
2
|
import { CardPluginOptions } from './types';
|
|
3
3
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
4
4
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
5
|
-
import type widthPlugin from '
|
|
5
|
+
import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
6
6
|
import type basePlugin from '../base';
|
|
7
|
-
import type gridPlugin from '
|
|
7
|
+
import type { gridPlugin } from '@atlaskit/editor-plugin-grid';
|
|
8
8
|
declare const cardPlugin: NextEditorPlugin<'card', {
|
|
9
9
|
pluginConfiguration: CardPluginOptions;
|
|
10
10
|
dependencies: [
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Selection } from 'prosemirror-state';
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
|
-
import { CollabEventInitData, CollabEventRemoteData, CollabEventConnectionData, CollabEventPresenceData,
|
|
3
|
+
import type { CollabEventInitData, CollabEventRemoteData, CollabEventConnectionData, CollabEventPresenceData, CollabTelepointerPayload, CollabSendableSelection } from '@atlaskit/collab-provider';
|
|
4
|
+
import { PrivateCollabEditOptions } from './types';
|
|
4
5
|
export declare const handleInit: (initData: CollabEventInitData, view: EditorView, options?: PrivateCollabEditOptions) => void;
|
|
5
6
|
export declare const handleConnection: (connectionData: CollabEventConnectionData, view: EditorView) => void;
|
|
6
7
|
export declare const handlePresence: (presenceData: CollabEventPresenceData, view: EditorView) => void;
|
|
7
8
|
export declare const applyRemoteData: (remoteData: CollabEventRemoteData, view: EditorView, options: PrivateCollabEditOptions) => void;
|
|
8
9
|
export declare const applyRemoteSteps: (json: any[], view: EditorView, userIds?: (number | string)[], options?: PrivateCollabEditOptions) => void;
|
|
9
|
-
export declare const handleTelePointer: (telepointerData:
|
|
10
|
+
export declare const handleTelePointer: (telepointerData: CollabTelepointerPayload, view: EditorView) => void;
|
|
10
11
|
export declare const getSendableSelection: (selection: Selection) => CollabSendableSelection;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EditorView } from 'prosemirror-view';
|
|
2
|
-
import type { CollabEventInitData, CollabEventConnectionData, CollabEventPresenceData,
|
|
2
|
+
import type { CollabEventInitData, CollabEventConnectionData, CollabEventPresenceData, CollabTelepointerPayload, CollabEventRemoteData, CollabEventLocalStepData, CollabEditProvider } from '@atlaskit/collab-provider';
|
|
3
3
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import { PrivateCollabEditOptions } from '../types';
|
|
5
5
|
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
@@ -12,7 +12,7 @@ export interface CollabHandlers {
|
|
|
12
12
|
connectedHandler: (data: CollabEventConnectionData) => void;
|
|
13
13
|
dataHandler: (data: CollabEventRemoteData) => void;
|
|
14
14
|
presenceHandler: (data: CollabEventPresenceData) => void;
|
|
15
|
-
telepointerHandler: (data:
|
|
15
|
+
telepointerHandler: (data: CollabTelepointerPayload) => void;
|
|
16
16
|
localStepsHandler: (data: CollabEventLocalStepData) => void;
|
|
17
17
|
errorHandler: (error: any) => void;
|
|
18
18
|
entityHandler: ({ entity }: {
|
|
@@ -20,4 +20,4 @@ export interface CollabHandlers {
|
|
|
20
20
|
}) => void;
|
|
21
21
|
}
|
|
22
22
|
export type Cleanup = () => void;
|
|
23
|
-
export declare const subscribe: (currentDeps_0: EditorView<any>, currentDeps_1: CollabEditProvider<import("@atlaskit/
|
|
23
|
+
export declare const subscribe: (currentDeps_0: EditorView<any>, currentDeps_1: CollabEditProvider<import("@atlaskit/collab-provider").CollabEvents>, currentDeps_2: PrivateCollabEditOptions, currentDeps_3: FeatureFlags, currentDeps_4?: ProviderFactory | undefined) => Cleanup;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EditorView } from 'prosemirror-view';
|
|
2
2
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import { CollabEditProvider } from '
|
|
3
|
+
import type { CollabEditProvider } from '@atlaskit/collab-provider';
|
|
4
4
|
import { PrivateCollabEditOptions } from '../types';
|
|
5
5
|
import { Cleanup } from './handlers';
|
|
6
6
|
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import { pluginKey } from './plugin';
|
|
3
3
|
import { CollabEditOptions, PrivateCollabEditOptions } from './types';
|
|
4
|
-
export type { CollabEditProvider } from './provider';
|
|
5
4
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
6
5
|
export { pluginKey };
|
|
7
6
|
export type { CollabEditOptions };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
2
|
import { EditorState } from 'prosemirror-state';
|
|
3
|
-
import type { CollabEditProvider } from '@atlaskit/
|
|
3
|
+
import type { CollabEditProvider } from '@atlaskit/collab-provider';
|
|
4
4
|
export declare const nativeCollabProviderPlugin: ({ providerPromise, }: {
|
|
5
5
|
providerPromise: Promise<CollabEditProvider>;
|
|
6
|
-
}) => SafePlugin<CollabEditProvider<import("@atlaskit/
|
|
6
|
+
}) => SafePlugin<CollabEditProvider<import("@atlaskit/collab-provider").CollabEvents> | null, any>;
|
|
7
7
|
export declare const getCollabProvider: (editorState: EditorState) => CollabEditProvider | null;
|
|
@@ -2,10 +2,8 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
|
2
2
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
3
3
|
import { Dispatch } from '../../event-dispatcher';
|
|
4
4
|
import { PrivateCollabEditOptions, ProviderCallback } from './types';
|
|
5
|
-
import { CollabEditProvider } from './provider';
|
|
6
5
|
import { PluginState } from './plugin-state';
|
|
7
6
|
import { pluginKey } from './plugin-key';
|
|
8
7
|
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
9
8
|
export { PluginState, pluginKey };
|
|
10
|
-
export type { CollabEditProvider };
|
|
11
9
|
export declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, collabProviderCallback: ProviderCallback, options: PrivateCollabEditOptions, featureFlags: FeatureFlags) => SafePlugin<any, any>;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { Providers } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import type { CollabEditProvider } from '@atlaskit/
|
|
3
|
+
import type { CollabEditProvider, SyncUpErrorFunction } from '@atlaskit/collab-provider';
|
|
4
4
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
5
|
-
import { SyncUpErrorFunction } from '@atlaskit/editor-common/types';
|
|
6
|
-
export type { CollabParticipant, CollabEventInitData, CollabEventRemoteData, CollabEventConnectionData, CollabEventPresenceData, CollabEventTelepointerData, CollabSendableSelection, } from '@atlaskit/editor-common/collab';
|
|
7
5
|
export type InviteToEditComponentProps = {
|
|
8
6
|
children: ReactElement<InviteToEditButtonProps>;
|
|
9
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AvatarProps } from '@atlaskit/avatar-group';
|
|
2
|
-
import { CollabParticipant } from '
|
|
2
|
+
import type { CollabParticipant } from '@atlaskit/collab-provider';
|
|
3
3
|
declare const _default: import("memoize-one").MemoizedFn<(participant: CollabParticipant) => AvatarProps>;
|
|
4
4
|
export default _default;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EditorState } from 'prosemirror-state';
|
|
2
2
|
import { EditorView, Decoration, DecorationSet } from 'prosemirror-view';
|
|
3
|
-
import {
|
|
3
|
+
import type { CollabParticipant } from '@atlaskit/collab-provider';
|
|
4
|
+
import { CollabEditOptions } from './types';
|
|
4
5
|
export interface Color {
|
|
5
6
|
solid: string;
|
|
6
7
|
selection: string;
|
|
@@ -2,6 +2,7 @@ import { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
|
2
2
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
3
3
|
import { NextEditorPlugin, EditorAppearance } from '../../types';
|
|
4
4
|
import { LongPressSelectionPluginOptions } from '../selection/types';
|
|
5
|
+
import { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
5
6
|
interface ExtensionPluginOptions extends LongPressSelectionPluginOptions {
|
|
6
7
|
allowAutoSave?: boolean;
|
|
7
8
|
breakoutEnabled?: boolean;
|
|
@@ -10,6 +11,6 @@ interface ExtensionPluginOptions extends LongPressSelectionPluginOptions {
|
|
|
10
11
|
}
|
|
11
12
|
declare const extensionPlugin: NextEditorPlugin<'extension', {
|
|
12
13
|
pluginConfiguration: ExtensionPluginOptions | undefined;
|
|
13
|
-
dependencies: [typeof featureFlagsPlugin];
|
|
14
|
+
dependencies: [typeof featureFlagsPlugin, typeof widthPlugin];
|
|
14
15
|
}>;
|
|
15
16
|
export default extensionPlugin;
|
|
@@ -3,10 +3,12 @@ import { EditorView, NodeView } from 'prosemirror-view';
|
|
|
3
3
|
import { Node as PmNode } from 'prosemirror-model';
|
|
4
4
|
import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
5
5
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
6
|
+
import { PluginInjectionAPIWithDependency } from '@atlaskit/editor-common/types';
|
|
6
7
|
import { EditorAppearance } from '../../../types/editor-appearance';
|
|
7
8
|
import { ForwardRef, getPosHandler, ReactNodeView } from '../../../nodeviews';
|
|
8
9
|
import { PortalProviderAPI } from '../../../ui/PortalProvider';
|
|
9
10
|
import { EventDispatcher } from '../../../event-dispatcher';
|
|
11
|
+
import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
10
12
|
interface ExtensionNodeViewOptions {
|
|
11
13
|
appearance?: EditorAppearance;
|
|
12
14
|
}
|
|
@@ -22,7 +24,8 @@ export declare class ExtensionNode extends ReactNodeView {
|
|
|
22
24
|
providerFactory: ProviderFactory;
|
|
23
25
|
extensionHandlers: ExtensionHandlers;
|
|
24
26
|
extensionNodeViewOptions?: ExtensionNodeViewOptions;
|
|
27
|
+
pluginInjectionApi: PluginInjectionAPIWithDependency<typeof widthPlugin> | undefined;
|
|
25
28
|
}, forwardRef: ForwardRef): JSX.Element;
|
|
26
29
|
}
|
|
27
|
-
export default function ExtensionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, extensionNodeViewOptions: ExtensionNodeViewOptions): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
30
|
+
export default function ExtensionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, extensionNodeViewOptions: ExtensionNodeViewOptions, pluginInjectionApi: PluginInjectionAPIWithDependency<typeof widthPlugin> | undefined): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
|
|
28
31
|
export {};
|