@atlaskit/editor-plugin-panel 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/nodeviews/panel.js +32 -9
- package/dist/cjs/plugin.js +3 -2
- package/dist/cjs/pm-plugins/main.js +2 -2
- package/dist/es2019/nodeviews/panel.js +27 -9
- package/dist/es2019/plugin.js +3 -2
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/esm/nodeviews/panel.js +32 -9
- package/dist/esm/plugin.js +3 -2
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/types/nodeviews/panel.d.ts +6 -2
- package/dist/types/pm-plugins/main.d.ts +2 -1
- package/dist/types-ts4.5/nodeviews/panel.d.ts +6 -2
- package/dist/types-ts4.5/pm-plugins/main.d.ts +2 -1
- package/package.json +8 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-panel
|
|
2
2
|
|
|
3
|
+
## 3.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#163321](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/163321)
|
|
8
|
+
[`9cbf3468984dc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9cbf3468984dc) -
|
|
9
|
+
ED-25609: migrates expand plugin ReactDOM references to portalprovider
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.1.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#160699](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/160699)
|
|
17
|
+
[`3f6d3eca921ed`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3f6d3eca921ed) -
|
|
18
|
+
ED-25575: migrate panel plugin node rendering to portals
|
|
19
|
+
|
|
3
20
|
## 3.1.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -9,6 +9,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
12
|
+
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
12
13
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
13
14
|
var _emoji = require("@atlaskit/editor-common/emoji");
|
|
14
15
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
@@ -17,6 +18,7 @@ var _panel = require("@atlaskit/editor-common/panel");
|
|
|
17
18
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
18
19
|
var _consts = require("@atlaskit/editor-shared-styles/consts");
|
|
19
20
|
var _hint = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/hint"));
|
|
21
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
22
|
var _utils = require("../utils");
|
|
21
23
|
var panelIcons = exports.panelIcons = {
|
|
22
24
|
info: _icons.PanelInfoIcon,
|
|
@@ -60,12 +62,15 @@ var PanelIcon = exports.PanelIcon = function PanelIcon(props) {
|
|
|
60
62
|
});
|
|
61
63
|
};
|
|
62
64
|
var PanelNodeView = /*#__PURE__*/function () {
|
|
63
|
-
function PanelNodeView(node, view, getPos, pluginOptions, api, providerFactory) {
|
|
65
|
+
function PanelNodeView(node, view, getPos, pluginOptions, api, nodeViewPortalProviderAPI, providerFactory) {
|
|
66
|
+
var _this = this;
|
|
64
67
|
(0, _classCallCheck2.default)(this, PanelNodeView);
|
|
68
|
+
this.nodeViewPortalProviderAPI = nodeViewPortalProviderAPI;
|
|
65
69
|
this.providerFactory = providerFactory;
|
|
66
70
|
this.pluginOptions = pluginOptions;
|
|
67
71
|
this.view = view;
|
|
68
72
|
this.node = node;
|
|
73
|
+
this.key = (0, _v.default)();
|
|
69
74
|
var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, (0, _utils.panelAttrsToDom)(node.attrs, pluginOptions.allowCustomPanel || false)),
|
|
70
75
|
dom = _DOMSerializer$render.dom,
|
|
71
76
|
contentDOM = _DOMSerializer$render.contentDOM;
|
|
@@ -78,12 +83,23 @@ var PanelNodeView = /*#__PURE__*/function () {
|
|
|
78
83
|
}
|
|
79
84
|
// set contentEditable as false to be able to select the custom panels with keyboard
|
|
80
85
|
this.icon.contentEditable = 'false';
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
86
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_react18_plugin_portalprovider')) {
|
|
87
|
+
this.nodeViewPortalProviderAPI.render(function () {
|
|
88
|
+
return /*#__PURE__*/_react.default.createElement(PanelIcon, {
|
|
89
|
+
pluginInjectionApi: api,
|
|
90
|
+
allowCustomPanel: pluginOptions.allowCustomPanel,
|
|
91
|
+
panelAttributes: node.attrs,
|
|
92
|
+
providerFactory: _this.providerFactory
|
|
93
|
+
});
|
|
94
|
+
}, this.icon, this.key);
|
|
95
|
+
} else {
|
|
96
|
+
_reactDom.default.render( /*#__PURE__*/_react.default.createElement(PanelIcon, {
|
|
97
|
+
pluginInjectionApi: api,
|
|
98
|
+
allowCustomPanel: pluginOptions.allowCustomPanel,
|
|
99
|
+
panelAttributes: node.attrs,
|
|
100
|
+
providerFactory: this.providerFactory
|
|
101
|
+
}), this.icon);
|
|
102
|
+
}
|
|
87
103
|
}
|
|
88
104
|
(0, _createClass2.default)(PanelNodeView, [{
|
|
89
105
|
key: "ignoreMutation",
|
|
@@ -97,11 +113,18 @@ var PanelNodeView = /*#__PURE__*/function () {
|
|
|
97
113
|
var isInsideIcon = this.icon.contains(mutation.target);
|
|
98
114
|
return isIcon || isInsideIcon;
|
|
99
115
|
}
|
|
116
|
+
}, {
|
|
117
|
+
key: "destroy",
|
|
118
|
+
value: function destroy() {
|
|
119
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_react18_plugin_portalprovider')) {
|
|
120
|
+
this.nodeViewPortalProviderAPI.remove(this.key);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
100
123
|
}]);
|
|
101
124
|
return PanelNodeView;
|
|
102
125
|
}();
|
|
103
|
-
var getPanelNodeView = exports.getPanelNodeView = function getPanelNodeView(pluginOptions, api, providerFactory) {
|
|
126
|
+
var getPanelNodeView = exports.getPanelNodeView = function getPanelNodeView(pluginOptions, api, nodeViewPortalProviderAPI, providerFactory) {
|
|
104
127
|
return function (node, view, getPos) {
|
|
105
|
-
return new PanelNodeView(node, view, getPos, pluginOptions, api, providerFactory);
|
|
128
|
+
return new PanelNodeView(node, view, getPos, pluginOptions, api, nodeViewPortalProviderAPI, providerFactory);
|
|
106
129
|
};
|
|
107
130
|
};
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -33,8 +33,9 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
33
33
|
name: 'panel',
|
|
34
34
|
plugin: function plugin(_ref2) {
|
|
35
35
|
var providerFactory = _ref2.providerFactory,
|
|
36
|
-
dispatch = _ref2.dispatch
|
|
37
|
-
|
|
36
|
+
dispatch = _ref2.dispatch,
|
|
37
|
+
nodeViewPortalProviderAPI = _ref2.nodeViewPortalProviderAPI;
|
|
38
|
+
return (0, _main.createPlugin)(dispatch, providerFactory, options, api, nodeViewPortalProviderAPI);
|
|
38
39
|
}
|
|
39
40
|
}, {
|
|
40
41
|
name: 'panelKeyMap',
|
|
@@ -10,7 +10,7 @@ var _selection = require("@atlaskit/editor-common/selection");
|
|
|
10
10
|
var _panel2 = require("../nodeviews/panel");
|
|
11
11
|
var _types = require("../types");
|
|
12
12
|
var _utils = require("../utils");
|
|
13
|
-
var createPlugin = exports.createPlugin = function createPlugin(dispatch, providerFactory, pluginOptions, api) {
|
|
13
|
+
var createPlugin = exports.createPlugin = function createPlugin(dispatch, providerFactory, pluginOptions, api, nodeViewPortalProviderAPI) {
|
|
14
14
|
var _pluginOptions$useLon = pluginOptions.useLongPressSelection,
|
|
15
15
|
useLongPressSelection = _pluginOptions$useLon === void 0 ? false : _pluginOptions$useLon;
|
|
16
16
|
return new _safePlugin.SafePlugin({
|
|
@@ -25,7 +25,7 @@ var createPlugin = exports.createPlugin = function createPlugin(dispatch, provid
|
|
|
25
25
|
},
|
|
26
26
|
props: {
|
|
27
27
|
nodeViews: {
|
|
28
|
-
panel: (0, _panel2.getPanelNodeView)(pluginOptions, api, providerFactory)
|
|
28
|
+
panel: (0, _panel2.getPanelNodeView)(pluginOptions, api, nodeViewPortalProviderAPI, providerFactory)
|
|
29
29
|
},
|
|
30
30
|
handleClickOn: (0, _selection.createSelectionClickHandler)(['panel'], function (target) {
|
|
31
31
|
return !!target.closest(".".concat(_panel.PanelSharedCssClassName.prefix));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom';
|
|
3
|
+
import uuid from 'uuid/v4';
|
|
3
4
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
4
5
|
import { Emoji } from '@atlaskit/editor-common/emoji';
|
|
5
6
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
@@ -8,6 +9,7 @@ import { PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
|
|
|
8
9
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
9
10
|
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
|
|
10
11
|
import TipIcon from '@atlaskit/icon/glyph/editor/hint';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
13
|
import { panelAttrsToDom } from '../utils';
|
|
12
14
|
export const panelIcons = {
|
|
13
15
|
info: PanelInfoIcon,
|
|
@@ -55,11 +57,13 @@ export const PanelIcon = props => {
|
|
|
55
57
|
});
|
|
56
58
|
};
|
|
57
59
|
class PanelNodeView {
|
|
58
|
-
constructor(node, view, getPos, pluginOptions, api, providerFactory) {
|
|
60
|
+
constructor(node, view, getPos, pluginOptions, api, nodeViewPortalProviderAPI, providerFactory) {
|
|
61
|
+
this.nodeViewPortalProviderAPI = nodeViewPortalProviderAPI;
|
|
59
62
|
this.providerFactory = providerFactory;
|
|
60
63
|
this.pluginOptions = pluginOptions;
|
|
61
64
|
this.view = view;
|
|
62
65
|
this.node = node;
|
|
66
|
+
this.key = uuid();
|
|
63
67
|
const {
|
|
64
68
|
dom,
|
|
65
69
|
contentDOM
|
|
@@ -73,12 +77,21 @@ class PanelNodeView {
|
|
|
73
77
|
}
|
|
74
78
|
// set contentEditable as false to be able to select the custom panels with keyboard
|
|
75
79
|
this.icon.contentEditable = 'false';
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
if (fg('platform_editor_react18_plugin_portalprovider')) {
|
|
81
|
+
this.nodeViewPortalProviderAPI.render(() => /*#__PURE__*/React.createElement(PanelIcon, {
|
|
82
|
+
pluginInjectionApi: api,
|
|
83
|
+
allowCustomPanel: pluginOptions.allowCustomPanel,
|
|
84
|
+
panelAttributes: node.attrs,
|
|
85
|
+
providerFactory: this.providerFactory
|
|
86
|
+
}), this.icon, this.key);
|
|
87
|
+
} else {
|
|
88
|
+
ReactDOM.render( /*#__PURE__*/React.createElement(PanelIcon, {
|
|
89
|
+
pluginInjectionApi: api,
|
|
90
|
+
allowCustomPanel: pluginOptions.allowCustomPanel,
|
|
91
|
+
panelAttributes: node.attrs,
|
|
92
|
+
providerFactory: this.providerFactory
|
|
93
|
+
}), this.icon);
|
|
94
|
+
}
|
|
82
95
|
}
|
|
83
96
|
ignoreMutation(mutation) {
|
|
84
97
|
// ignore mutation if it caused by the icon.
|
|
@@ -90,7 +103,12 @@ class PanelNodeView {
|
|
|
90
103
|
const isInsideIcon = this.icon.contains(mutation.target);
|
|
91
104
|
return isIcon || isInsideIcon;
|
|
92
105
|
}
|
|
106
|
+
destroy() {
|
|
107
|
+
if (fg('platform_editor_react18_plugin_portalprovider')) {
|
|
108
|
+
this.nodeViewPortalProviderAPI.remove(this.key);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
93
111
|
}
|
|
94
|
-
export const getPanelNodeView = (pluginOptions, api, providerFactory) => (node, view, getPos) => {
|
|
95
|
-
return new PanelNodeView(node, view, getPos, pluginOptions, api, providerFactory);
|
|
112
|
+
export const getPanelNodeView = (pluginOptions, api, nodeViewPortalProviderAPI, providerFactory) => (node, view, getPos) => {
|
|
113
|
+
return new PanelNodeView(node, view, getPos, pluginOptions, api, nodeViewPortalProviderAPI, providerFactory);
|
|
96
114
|
};
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -25,8 +25,9 @@ const panelPlugin = ({
|
|
|
25
25
|
name: 'panel',
|
|
26
26
|
plugin: ({
|
|
27
27
|
providerFactory,
|
|
28
|
-
dispatch
|
|
29
|
-
|
|
28
|
+
dispatch,
|
|
29
|
+
nodeViewPortalProviderAPI
|
|
30
|
+
}) => createPlugin(dispatch, providerFactory, options, api, nodeViewPortalProviderAPI)
|
|
30
31
|
}, {
|
|
31
32
|
name: 'panelKeyMap',
|
|
32
33
|
plugin: () => keymap()
|
|
@@ -4,7 +4,7 @@ import { createSelectionClickHandler } from '@atlaskit/editor-common/selection';
|
|
|
4
4
|
import { getPanelNodeView } from '../nodeviews/panel';
|
|
5
5
|
import { pluginKey } from '../types';
|
|
6
6
|
import { handleCut } from '../utils';
|
|
7
|
-
export const createPlugin = (dispatch, providerFactory, pluginOptions, api) => {
|
|
7
|
+
export const createPlugin = (dispatch, providerFactory, pluginOptions, api, nodeViewPortalProviderAPI) => {
|
|
8
8
|
const {
|
|
9
9
|
useLongPressSelection = false
|
|
10
10
|
} = pluginOptions;
|
|
@@ -18,7 +18,7 @@ export const createPlugin = (dispatch, providerFactory, pluginOptions, api) => {
|
|
|
18
18
|
},
|
|
19
19
|
props: {
|
|
20
20
|
nodeViews: {
|
|
21
|
-
panel: getPanelNodeView(pluginOptions, api, providerFactory)
|
|
21
|
+
panel: getPanelNodeView(pluginOptions, api, nodeViewPortalProviderAPI, providerFactory)
|
|
22
22
|
},
|
|
23
23
|
handleClickOn: createSelectionClickHandler(['panel'], target => !!target.closest(`.${PanelSharedCssClassName.prefix}`), {
|
|
24
24
|
useLongPressSelection
|
|
@@ -2,6 +2,7 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import ReactDOM from 'react-dom';
|
|
5
|
+
import uuid from 'uuid/v4';
|
|
5
6
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
6
7
|
import { Emoji } from '@atlaskit/editor-common/emoji';
|
|
7
8
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
@@ -10,6 +11,7 @@ import { PanelSharedCssClassName } from '@atlaskit/editor-common/panel';
|
|
|
10
11
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
11
12
|
import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
|
|
12
13
|
import TipIcon from '@atlaskit/icon/glyph/editor/hint';
|
|
14
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
15
|
import { panelAttrsToDom } from '../utils';
|
|
14
16
|
export var panelIcons = {
|
|
15
17
|
info: PanelInfoIcon,
|
|
@@ -53,12 +55,15 @@ export var PanelIcon = function PanelIcon(props) {
|
|
|
53
55
|
});
|
|
54
56
|
};
|
|
55
57
|
var PanelNodeView = /*#__PURE__*/function () {
|
|
56
|
-
function PanelNodeView(node, view, getPos, pluginOptions, api, providerFactory) {
|
|
58
|
+
function PanelNodeView(node, view, getPos, pluginOptions, api, nodeViewPortalProviderAPI, providerFactory) {
|
|
59
|
+
var _this = this;
|
|
57
60
|
_classCallCheck(this, PanelNodeView);
|
|
61
|
+
this.nodeViewPortalProviderAPI = nodeViewPortalProviderAPI;
|
|
58
62
|
this.providerFactory = providerFactory;
|
|
59
63
|
this.pluginOptions = pluginOptions;
|
|
60
64
|
this.view = view;
|
|
61
65
|
this.node = node;
|
|
66
|
+
this.key = uuid();
|
|
62
67
|
var _DOMSerializer$render = DOMSerializer.renderSpec(document, panelAttrsToDom(node.attrs, pluginOptions.allowCustomPanel || false)),
|
|
63
68
|
dom = _DOMSerializer$render.dom,
|
|
64
69
|
contentDOM = _DOMSerializer$render.contentDOM;
|
|
@@ -71,12 +76,23 @@ var PanelNodeView = /*#__PURE__*/function () {
|
|
|
71
76
|
}
|
|
72
77
|
// set contentEditable as false to be able to select the custom panels with keyboard
|
|
73
78
|
this.icon.contentEditable = 'false';
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
if (fg('platform_editor_react18_plugin_portalprovider')) {
|
|
80
|
+
this.nodeViewPortalProviderAPI.render(function () {
|
|
81
|
+
return /*#__PURE__*/React.createElement(PanelIcon, {
|
|
82
|
+
pluginInjectionApi: api,
|
|
83
|
+
allowCustomPanel: pluginOptions.allowCustomPanel,
|
|
84
|
+
panelAttributes: node.attrs,
|
|
85
|
+
providerFactory: _this.providerFactory
|
|
86
|
+
});
|
|
87
|
+
}, this.icon, this.key);
|
|
88
|
+
} else {
|
|
89
|
+
ReactDOM.render( /*#__PURE__*/React.createElement(PanelIcon, {
|
|
90
|
+
pluginInjectionApi: api,
|
|
91
|
+
allowCustomPanel: pluginOptions.allowCustomPanel,
|
|
92
|
+
panelAttributes: node.attrs,
|
|
93
|
+
providerFactory: this.providerFactory
|
|
94
|
+
}), this.icon);
|
|
95
|
+
}
|
|
80
96
|
}
|
|
81
97
|
_createClass(PanelNodeView, [{
|
|
82
98
|
key: "ignoreMutation",
|
|
@@ -90,11 +106,18 @@ var PanelNodeView = /*#__PURE__*/function () {
|
|
|
90
106
|
var isInsideIcon = this.icon.contains(mutation.target);
|
|
91
107
|
return isIcon || isInsideIcon;
|
|
92
108
|
}
|
|
109
|
+
}, {
|
|
110
|
+
key: "destroy",
|
|
111
|
+
value: function destroy() {
|
|
112
|
+
if (fg('platform_editor_react18_plugin_portalprovider')) {
|
|
113
|
+
this.nodeViewPortalProviderAPI.remove(this.key);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
93
116
|
}]);
|
|
94
117
|
return PanelNodeView;
|
|
95
118
|
}();
|
|
96
|
-
export var getPanelNodeView = function getPanelNodeView(pluginOptions, api, providerFactory) {
|
|
119
|
+
export var getPanelNodeView = function getPanelNodeView(pluginOptions, api, nodeViewPortalProviderAPI, providerFactory) {
|
|
97
120
|
return function (node, view, getPos) {
|
|
98
|
-
return new PanelNodeView(node, view, getPos, pluginOptions, api, providerFactory);
|
|
121
|
+
return new PanelNodeView(node, view, getPos, pluginOptions, api, nodeViewPortalProviderAPI, providerFactory);
|
|
99
122
|
};
|
|
100
123
|
};
|
package/dist/esm/plugin.js
CHANGED
|
@@ -26,8 +26,9 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
26
26
|
name: 'panel',
|
|
27
27
|
plugin: function plugin(_ref2) {
|
|
28
28
|
var providerFactory = _ref2.providerFactory,
|
|
29
|
-
dispatch = _ref2.dispatch
|
|
30
|
-
|
|
29
|
+
dispatch = _ref2.dispatch,
|
|
30
|
+
nodeViewPortalProviderAPI = _ref2.nodeViewPortalProviderAPI;
|
|
31
|
+
return createPlugin(dispatch, providerFactory, options, api, nodeViewPortalProviderAPI);
|
|
31
32
|
}
|
|
32
33
|
}, {
|
|
33
34
|
name: 'panelKeyMap',
|
|
@@ -4,7 +4,7 @@ import { createSelectionClickHandler } from '@atlaskit/editor-common/selection';
|
|
|
4
4
|
import { getPanelNodeView } from '../nodeviews/panel';
|
|
5
5
|
import { pluginKey } from '../types';
|
|
6
6
|
import { handleCut } from '../utils';
|
|
7
|
-
export var createPlugin = function createPlugin(dispatch, providerFactory, pluginOptions, api) {
|
|
7
|
+
export var createPlugin = function createPlugin(dispatch, providerFactory, pluginOptions, api, nodeViewPortalProviderAPI) {
|
|
8
8
|
var _pluginOptions$useLon = pluginOptions.useLongPressSelection,
|
|
9
9
|
useLongPressSelection = _pluginOptions$useLon === void 0 ? false : _pluginOptions$useLon;
|
|
10
10
|
return new SafePlugin({
|
|
@@ -19,7 +19,7 @@ export var createPlugin = function createPlugin(dispatch, providerFactory, plugi
|
|
|
19
19
|
},
|
|
20
20
|
props: {
|
|
21
21
|
nodeViews: {
|
|
22
|
-
panel: getPanelNodeView(pluginOptions, api, providerFactory)
|
|
22
|
+
panel: getPanelNodeView(pluginOptions, api, nodeViewPortalProviderAPI, providerFactory)
|
|
23
23
|
},
|
|
24
24
|
handleClickOn: createSelectionClickHandler(['panel'], function (target) {
|
|
25
25
|
return !!target.closest(".".concat(PanelSharedCssClassName.prefix));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PanelAttributes } from '@atlaskit/adf-schema';
|
|
3
3
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
4
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
4
5
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
6
|
import type { ExtractInjectionAPI, getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
6
7
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -26,12 +27,15 @@ declare class PanelNodeView {
|
|
|
26
27
|
getPos: getPosHandlerNode;
|
|
27
28
|
view: EditorView;
|
|
28
29
|
providerFactory?: ProviderFactory;
|
|
30
|
+
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
29
31
|
pluginOptions: PanelPluginOptions;
|
|
30
|
-
|
|
32
|
+
key: string;
|
|
33
|
+
constructor(node: Node, view: EditorView, getPos: getPosHandlerNode, pluginOptions: PanelPluginOptions, api: ExtractInjectionAPI<PanelPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, providerFactory?: ProviderFactory);
|
|
31
34
|
ignoreMutation(mutation: MutationRecord | {
|
|
32
35
|
type: 'selection';
|
|
33
36
|
target: Element;
|
|
34
37
|
}): boolean;
|
|
38
|
+
destroy(): void;
|
|
35
39
|
}
|
|
36
|
-
export declare const getPanelNodeView: (pluginOptions: PanelPluginOptions, api: ExtractInjectionAPI<PanelPlugin> | undefined, providerFactory?: ProviderFactory) => (node: Node, view: EditorView, getPos: getPosHandler) => PanelNodeView;
|
|
40
|
+
export declare const getPanelNodeView: (pluginOptions: PanelPluginOptions, api: ExtractInjectionAPI<PanelPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, providerFactory?: ProviderFactory) => (node: Node, view: EditorView, getPos: getPosHandler) => PanelNodeView;
|
|
37
41
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
3
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
5
|
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
@@ -9,4 +10,4 @@ export type PanelOptions = {
|
|
|
9
10
|
emojiId?: string;
|
|
10
11
|
emojiText?: string;
|
|
11
12
|
};
|
|
12
|
-
export declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, pluginOptions: PanelPluginOptions, api: ExtractInjectionAPI<PanelPlugin> | undefined) => SafePlugin<any>;
|
|
13
|
+
export declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, pluginOptions: PanelPluginOptions, api: ExtractInjectionAPI<PanelPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { PanelAttributes } from '@atlaskit/adf-schema';
|
|
3
3
|
import { PanelType } from '@atlaskit/adf-schema';
|
|
4
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
4
5
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
6
|
import type { ExtractInjectionAPI, getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
6
7
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -26,12 +27,15 @@ declare class PanelNodeView {
|
|
|
26
27
|
getPos: getPosHandlerNode;
|
|
27
28
|
view: EditorView;
|
|
28
29
|
providerFactory?: ProviderFactory;
|
|
30
|
+
nodeViewPortalProviderAPI: PortalProviderAPI;
|
|
29
31
|
pluginOptions: PanelPluginOptions;
|
|
30
|
-
|
|
32
|
+
key: string;
|
|
33
|
+
constructor(node: Node, view: EditorView, getPos: getPosHandlerNode, pluginOptions: PanelPluginOptions, api: ExtractInjectionAPI<PanelPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, providerFactory?: ProviderFactory);
|
|
31
34
|
ignoreMutation(mutation: MutationRecord | {
|
|
32
35
|
type: 'selection';
|
|
33
36
|
target: Element;
|
|
34
37
|
}): boolean;
|
|
38
|
+
destroy(): void;
|
|
35
39
|
}
|
|
36
|
-
export declare const getPanelNodeView: (pluginOptions: PanelPluginOptions, api: ExtractInjectionAPI<PanelPlugin> | undefined, providerFactory?: ProviderFactory) => (node: Node, view: EditorView, getPos: getPosHandler) => PanelNodeView;
|
|
40
|
+
export declare const getPanelNodeView: (pluginOptions: PanelPluginOptions, api: ExtractInjectionAPI<PanelPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI, providerFactory?: ProviderFactory) => (node: Node, view: EditorView, getPos: getPosHandler) => PanelNodeView;
|
|
37
41
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
|
|
2
|
+
import { type PortalProviderAPI } from '@atlaskit/editor-common/portal';
|
|
2
3
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
3
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
5
|
import { type ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
@@ -9,4 +10,4 @@ export type PanelOptions = {
|
|
|
9
10
|
emojiId?: string;
|
|
10
11
|
emojiText?: string;
|
|
11
12
|
};
|
|
12
|
-
export declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, pluginOptions: PanelPluginOptions, api: ExtractInjectionAPI<PanelPlugin> | undefined) => SafePlugin<any>;
|
|
13
|
+
export declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, pluginOptions: PanelPluginOptions, api: ExtractInjectionAPI<PanelPlugin> | undefined, nodeViewPortalProviderAPI: PortalProviderAPI) => SafePlugin<any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-panel",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"description": "Panel plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/adf-schema": "^44.2.0",
|
|
35
|
-
"@atlaskit/editor-common": "^94.
|
|
35
|
+
"@atlaskit/editor-common": "^94.19.0",
|
|
36
36
|
"@atlaskit/editor-palette": "1.6.3",
|
|
37
37
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
38
38
|
"@atlaskit/editor-plugin-decorations": "^1.3.0",
|
|
@@ -43,8 +43,9 @@
|
|
|
43
43
|
"@atlaskit/icon": "^22.24.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
45
45
|
"@atlaskit/theme": "^14.0.0",
|
|
46
|
-
"@atlaskit/tmp-editor-statsig": "^2.
|
|
47
|
-
"@babel/runtime": "^7.0.0"
|
|
46
|
+
"@atlaskit/tmp-editor-statsig": "^2.14.0",
|
|
47
|
+
"@babel/runtime": "^7.0.0",
|
|
48
|
+
"uuid": "^3.1.0"
|
|
48
49
|
},
|
|
49
50
|
"peerDependencies": {
|
|
50
51
|
"react": "^16.8.0 || ^17.0.0 || ~18.2.0",
|
|
@@ -90,6 +91,9 @@
|
|
|
90
91
|
"platform-feature-flags": {
|
|
91
92
|
"platform_editor_remove_copy_button_from_view_mode": {
|
|
92
93
|
"type": "boolean"
|
|
94
|
+
},
|
|
95
|
+
"platform_editor_react18_plugin_portalprovider": {
|
|
96
|
+
"type": "boolean"
|
|
93
97
|
}
|
|
94
98
|
},
|
|
95
99
|
"stricter": {
|