@atlaskit/editor-plugin-insert-block 9.0.9 → 9.0.11
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 +16 -0
- package/dist/cjs/insertBlockPlugin.js +3 -1
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +3 -1
- package/dist/cjs/ui/ToolbarInsertBlock/block-insert-element-browser.js +3 -1
- package/dist/cjs/ui/ToolbarInsertBlock/index.js +3 -1
- package/dist/cjs/ui/toolbar-components/EmojiButton.js +3 -1
- package/dist/cjs/ui/toolbar-components/InsertButton.js +3 -1
- package/dist/cjs/ui/toolbar-components/MediaButton.js +15 -4
- package/dist/cjs/ui/toolbar-components/popups/EmojiPickerPopup.js +3 -1
- package/dist/es2019/insertBlockPlugin.js +3 -1
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +3 -1
- package/dist/es2019/ui/ToolbarInsertBlock/block-insert-element-browser.js +3 -1
- package/dist/es2019/ui/ToolbarInsertBlock/index.js +3 -1
- package/dist/es2019/ui/toolbar-components/EmojiButton.js +3 -1
- package/dist/es2019/ui/toolbar-components/InsertButton.js +3 -1
- package/dist/es2019/ui/toolbar-components/MediaButton.js +17 -5
- package/dist/es2019/ui/toolbar-components/popups/EmojiPickerPopup.js +3 -1
- package/dist/esm/insertBlockPlugin.js +3 -1
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +3 -1
- package/dist/esm/ui/ToolbarInsertBlock/block-insert-element-browser.js +3 -1
- package/dist/esm/ui/ToolbarInsertBlock/index.js +3 -1
- package/dist/esm/ui/toolbar-components/EmojiButton.js +3 -1
- package/dist/esm/ui/toolbar-components/InsertButton.js +3 -1
- package/dist/esm/ui/toolbar-components/MediaButton.js +16 -5
- package/dist/esm/ui/toolbar-components/popups/EmojiPickerPopup.js +3 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 9.0.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`da1128b3090cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/da1128b3090cc) -
|
|
8
|
+
[EDITOR-5922] Update media picker to mount to popupsMountPoint (e.g. portal) if available so that
|
|
9
|
+
it is still visible when rendering outside of editor that has overflow hidden (e.g. resizable
|
|
10
|
+
editor)
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 9.0.10
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 9.0.9
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -167,7 +167,9 @@ var insertBlockPlugin = exports.insertBlockPlugin = function insertBlockPlugin(_
|
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
169
|
return /*#__PURE__*/_react.default.createElement(_providerFactory.WithProviders, {
|
|
170
|
-
providerFactory: providerFactory
|
|
170
|
+
providerFactory: providerFactory
|
|
171
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
172
|
+
,
|
|
171
173
|
providers: ['emojiProvider'],
|
|
172
174
|
renderNode: renderNode
|
|
173
175
|
});
|
|
@@ -108,7 +108,9 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
108
108
|
(0, _react.useLayoutEffect)(function () {
|
|
109
109
|
// Figure based on visuals to exclude the searchbar, padding/margin, and the ViewMore item.
|
|
110
110
|
var EXTRA_SPACE_EXCLUDING_ELEMENTLIST = 128;
|
|
111
|
-
var totalItemHeight =
|
|
111
|
+
var totalItemHeight =
|
|
112
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- Ignored via go/ees017 (to be fixed)
|
|
113
|
+
(0, _toConsumableArray2.default)(Array(itemCount)).reduce(function (sum, _, index) {
|
|
112
114
|
return sum + cache.rowHeight({
|
|
113
115
|
index: index
|
|
114
116
|
});
|
|
@@ -19,7 +19,9 @@ var BlockInsertElementBrowser = exports.BlockInsertElementBrowser = function Blo
|
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, props.open && /*#__PURE__*/_react.default.createElement(_ui.Popup, {
|
|
20
20
|
target: props.plusButtonRef,
|
|
21
21
|
fitHeight: _InsertMenu.DEFAULT_HEIGHT + FIT_HEIGHT_BUFFER,
|
|
22
|
-
fitWidth: 350
|
|
22
|
+
fitWidth: 350
|
|
23
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
24
|
+
,
|
|
23
25
|
offset: [0, 3],
|
|
24
26
|
mountTo: props.popupsMountPoint,
|
|
25
27
|
boundariesElement: props.popupsBoundariesElement,
|
|
@@ -593,7 +593,9 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
593
593
|
return (0, _react2.jsx)(_ui.Popup, {
|
|
594
594
|
target: ref.deref(),
|
|
595
595
|
fitHeight: 350,
|
|
596
|
-
fitWidth: 350
|
|
596
|
+
fitWidth: 350
|
|
597
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
598
|
+
,
|
|
597
599
|
offset: [0, 3],
|
|
598
600
|
mountTo: popupsMountPoint,
|
|
599
601
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -71,7 +71,9 @@ var EmojiButton = exports.EmojiButton = function EmojiButton(_ref) {
|
|
|
71
71
|
size: "small"
|
|
72
72
|
}),
|
|
73
73
|
ariaKeyshortcuts: "Shift+;",
|
|
74
|
-
ref: emojiButtonRef
|
|
74
|
+
ref: emojiButtonRef
|
|
75
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
76
|
+
,
|
|
75
77
|
onClick: function onClick() {
|
|
76
78
|
return emojiPickerPopup.toggle();
|
|
77
79
|
},
|
|
@@ -206,7 +206,9 @@ var InsertButton = exports.InsertButton = function InsertButton(_ref) {
|
|
|
206
206
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, insertMenuOpen && insertButtonRef.current && editorView && /*#__PURE__*/_react.default.createElement(_ui.Popup, {
|
|
207
207
|
target: insertButtonRef.current,
|
|
208
208
|
fitHeight: _InsertMenu.DEFAULT_HEIGHT + FIT_HEIGHT_BUFFER,
|
|
209
|
-
fitWidth: 350
|
|
209
|
+
fitWidth: 350
|
|
210
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
211
|
+
,
|
|
210
212
|
offset: [0, 3],
|
|
211
213
|
mountTo: popupsMountPoint,
|
|
212
214
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -13,11 +13,14 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
|
13
13
|
var _toolbar = require("@atlaskit/editor-common/toolbar");
|
|
14
14
|
var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
|
|
15
15
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
16
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
16
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
18
|
var MediaButton = exports.MediaButton = function MediaButton(_ref) {
|
|
18
19
|
var api = _ref.api;
|
|
19
20
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
20
21
|
formatMessage = _useIntl.formatMessage;
|
|
22
|
+
var _useToolbarUI = (0, _editorToolbar.useToolbarUI)(),
|
|
23
|
+
popupsMountPoint = _useToolbarUI.popupsMountPoint;
|
|
21
24
|
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['media', 'connectivity'], function (states) {
|
|
22
25
|
var _states$mediaState, _states$mediaState2, _states$connectivityS;
|
|
23
26
|
return {
|
|
@@ -40,11 +43,19 @@ var MediaButton = exports.MediaButton = function MediaButton(_ref) {
|
|
|
40
43
|
}
|
|
41
44
|
if (api !== null && api !== void 0 && (_api$mediaInsert = api.mediaInsert) !== null && _api$mediaInsert !== void 0 && (_api$mediaInsert = _api$mediaInsert.commands) !== null && _api$mediaInsert !== void 0 && _api$mediaInsert.showMediaInsertPopup) {
|
|
42
45
|
var _api$core, _api$mediaInsert2;
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
var ref = mediaButtonRef.current;
|
|
47
|
+
var mountInfoOld = ref ? {
|
|
48
|
+
ref: ref,
|
|
49
|
+
mountPoint: ref
|
|
46
50
|
} : undefined;
|
|
47
|
-
|
|
51
|
+
var mountInfo = ref !== null && ref !== void 0 && ref.parentElement ? {
|
|
52
|
+
ref: ref,
|
|
53
|
+
mountPoint: popupsMountPoint !== null && popupsMountPoint !== void 0 ? popupsMountPoint : ref.parentElement
|
|
54
|
+
} : undefined;
|
|
55
|
+
var resolvedMountInfo = (0, _experiments.editorExperiment)('platform_editor_fix_media_picker_hidden', true, {
|
|
56
|
+
exposure: true
|
|
57
|
+
}) ? mountInfo : mountInfoOld;
|
|
58
|
+
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$mediaInsert2 = api.mediaInsert) === null || _api$mediaInsert2 === void 0 ? void 0 : _api$mediaInsert2.commands.showMediaInsertPopup(resolvedMountInfo));
|
|
48
59
|
} else {
|
|
49
60
|
showMediaPicker();
|
|
50
61
|
}
|
|
@@ -36,7 +36,9 @@ var EmojiPickerPopup = exports.EmojiPickerPopup = function EmojiPickerPopup(_ref
|
|
|
36
36
|
return /*#__PURE__*/_react.default.createElement(_ui.Popup, {
|
|
37
37
|
target: targetRef.current,
|
|
38
38
|
fitHeight: 350,
|
|
39
|
-
fitWidth: 350
|
|
39
|
+
fitWidth: 350
|
|
40
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
41
|
+
,
|
|
40
42
|
offset: [0, 3],
|
|
41
43
|
mountTo: popupsMountPoint,
|
|
42
44
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -152,7 +152,9 @@ export const insertBlockPlugin = ({
|
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
return /*#__PURE__*/React.createElement(WithProviders, {
|
|
155
|
-
providerFactory: providerFactory
|
|
155
|
+
providerFactory: providerFactory
|
|
156
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
157
|
+
,
|
|
156
158
|
providers: ['emojiProvider'],
|
|
157
159
|
renderNode: renderNode
|
|
158
160
|
});
|
|
@@ -87,7 +87,9 @@ const InsertMenu = ({
|
|
|
87
87
|
useLayoutEffect(() => {
|
|
88
88
|
// Figure based on visuals to exclude the searchbar, padding/margin, and the ViewMore item.
|
|
89
89
|
const EXTRA_SPACE_EXCLUDING_ELEMENTLIST = 128;
|
|
90
|
-
const totalItemHeight =
|
|
90
|
+
const totalItemHeight =
|
|
91
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- Ignored via go/ees017 (to be fixed)
|
|
92
|
+
[...Array(itemCount)].reduce((sum, _, index) => sum + cache.rowHeight({
|
|
91
93
|
index
|
|
92
94
|
}), 0) + EXTRA_SPACE_EXCLUDING_ELEMENTLIST;
|
|
93
95
|
if (itemCount > 0 && totalItemHeight < DEFAULT_HEIGHT) {
|
|
@@ -10,7 +10,9 @@ export const BlockInsertElementBrowser = props => {
|
|
|
10
10
|
return /*#__PURE__*/React.createElement(React.Fragment, null, props.open && /*#__PURE__*/React.createElement(Popup, {
|
|
11
11
|
target: props.plusButtonRef,
|
|
12
12
|
fitHeight: DEFAULT_HEIGHT + FIT_HEIGHT_BUFFER,
|
|
13
|
-
fitWidth: 350
|
|
13
|
+
fitWidth: 350
|
|
14
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
15
|
+
,
|
|
14
16
|
offset: [0, 3],
|
|
15
17
|
mountTo: props.popupsMountPoint,
|
|
16
18
|
boundariesElement: props.popupsBoundariesElement,
|
|
@@ -660,7 +660,9 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
660
660
|
return jsx(Popup, {
|
|
661
661
|
target: ref.deref(),
|
|
662
662
|
fitHeight: 350,
|
|
663
|
-
fitWidth: 350
|
|
663
|
+
fitWidth: 350
|
|
664
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
665
|
+
,
|
|
664
666
|
offset: [0, 3],
|
|
665
667
|
mountTo: popupsMountPoint,
|
|
666
668
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -67,7 +67,9 @@ export const EmojiButton = ({
|
|
|
67
67
|
size: "small"
|
|
68
68
|
}),
|
|
69
69
|
ariaKeyshortcuts: "Shift+;",
|
|
70
|
-
ref: emojiButtonRef
|
|
70
|
+
ref: emojiButtonRef
|
|
71
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
72
|
+
,
|
|
71
73
|
onClick: () => emojiPickerPopup.toggle(),
|
|
72
74
|
isSelected: emojiPickerPopup.isOpen,
|
|
73
75
|
isDisabled: !isTypeAheadAllowed || !emojiProvider,
|
|
@@ -199,7 +199,9 @@ export const InsertButton = ({
|
|
|
199
199
|
return /*#__PURE__*/React.createElement(React.Fragment, null, insertMenuOpen && insertButtonRef.current && editorView && /*#__PURE__*/React.createElement(Popup, {
|
|
200
200
|
target: insertButtonRef.current,
|
|
201
201
|
fitHeight: DEFAULT_HEIGHT + FIT_HEIGHT_BUFFER,
|
|
202
|
-
fitWidth: 350
|
|
202
|
+
fitWidth: 350
|
|
203
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
204
|
+
,
|
|
203
205
|
offset: [0, 3],
|
|
204
206
|
mountTo: popupsMountPoint,
|
|
205
207
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -5,13 +5,17 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
5
5
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { TOOLBAR_BUTTON_TEST_ID } from '@atlaskit/editor-common/toolbar';
|
|
7
7
|
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
8
|
-
import { ToolbarButton, ToolbarTooltip, ImageIcon } from '@atlaskit/editor-toolbar';
|
|
8
|
+
import { ToolbarButton, ToolbarTooltip, ImageIcon, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
9
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
10
|
export const MediaButton = ({
|
|
10
11
|
api
|
|
11
12
|
}) => {
|
|
12
13
|
const {
|
|
13
14
|
formatMessage
|
|
14
15
|
} = useIntl();
|
|
16
|
+
const {
|
|
17
|
+
popupsMountPoint
|
|
18
|
+
} = useToolbarUI();
|
|
15
19
|
const {
|
|
16
20
|
showMediaPicker,
|
|
17
21
|
connectivityMode,
|
|
@@ -35,11 +39,19 @@ export const MediaButton = ({
|
|
|
35
39
|
}
|
|
36
40
|
if (api !== null && api !== void 0 && (_api$mediaInsert = api.mediaInsert) !== null && _api$mediaInsert !== void 0 && (_api$mediaInsert$comm = _api$mediaInsert.commands) !== null && _api$mediaInsert$comm !== void 0 && _api$mediaInsert$comm.showMediaInsertPopup) {
|
|
37
41
|
var _api$core, _api$mediaInsert2;
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
42
|
+
const ref = mediaButtonRef.current;
|
|
43
|
+
const mountInfoOld = ref ? {
|
|
44
|
+
ref,
|
|
45
|
+
mountPoint: ref
|
|
46
|
+
} : undefined;
|
|
47
|
+
const mountInfo = ref !== null && ref !== void 0 && ref.parentElement ? {
|
|
48
|
+
ref,
|
|
49
|
+
mountPoint: popupsMountPoint !== null && popupsMountPoint !== void 0 ? popupsMountPoint : ref.parentElement
|
|
41
50
|
} : undefined;
|
|
42
|
-
|
|
51
|
+
const resolvedMountInfo = editorExperiment('platform_editor_fix_media_picker_hidden', true, {
|
|
52
|
+
exposure: true
|
|
53
|
+
}) ? mountInfo : mountInfoOld;
|
|
54
|
+
api === null || api === void 0 ? void 0 : (_api$core = api.core) === null || _api$core === void 0 ? void 0 : _api$core.actions.execute(api === null || api === void 0 ? void 0 : (_api$mediaInsert2 = api.mediaInsert) === null || _api$mediaInsert2 === void 0 ? void 0 : _api$mediaInsert2.commands.showMediaInsertPopup(resolvedMountInfo));
|
|
43
55
|
} else {
|
|
44
56
|
showMediaPicker();
|
|
45
57
|
}
|
|
@@ -30,7 +30,9 @@ export const EmojiPickerPopup = ({
|
|
|
30
30
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
31
31
|
target: targetRef.current,
|
|
32
32
|
fitHeight: 350,
|
|
33
|
-
fitWidth: 350
|
|
33
|
+
fitWidth: 350
|
|
34
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
35
|
+
,
|
|
34
36
|
offset: [0, 3],
|
|
35
37
|
mountTo: popupsMountPoint,
|
|
36
38
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -157,7 +157,9 @@ export var insertBlockPlugin = function insertBlockPlugin(_ref) {
|
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
return /*#__PURE__*/React.createElement(WithProviders, {
|
|
160
|
-
providerFactory: providerFactory
|
|
160
|
+
providerFactory: providerFactory
|
|
161
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
162
|
+
,
|
|
161
163
|
providers: ['emojiProvider'],
|
|
162
164
|
renderNode: renderNode
|
|
163
165
|
});
|
|
@@ -105,7 +105,9 @@ var InsertMenu = function InsertMenu(_ref) {
|
|
|
105
105
|
useLayoutEffect(function () {
|
|
106
106
|
// Figure based on visuals to exclude the searchbar, padding/margin, and the ViewMore item.
|
|
107
107
|
var EXTRA_SPACE_EXCLUDING_ELEMENTLIST = 128;
|
|
108
|
-
var totalItemHeight =
|
|
108
|
+
var totalItemHeight =
|
|
109
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-expensive-computations-in-render -- Ignored via go/ees017 (to be fixed)
|
|
110
|
+
_toConsumableArray(Array(itemCount)).reduce(function (sum, _, index) {
|
|
109
111
|
return sum + cache.rowHeight({
|
|
110
112
|
index: index
|
|
111
113
|
});
|
|
@@ -10,7 +10,9 @@ export var BlockInsertElementBrowser = function BlockInsertElementBrowser(props)
|
|
|
10
10
|
return /*#__PURE__*/React.createElement(React.Fragment, null, props.open && /*#__PURE__*/React.createElement(Popup, {
|
|
11
11
|
target: props.plusButtonRef,
|
|
12
12
|
fitHeight: DEFAULT_HEIGHT + FIT_HEIGHT_BUFFER,
|
|
13
|
-
fitWidth: 350
|
|
13
|
+
fitWidth: 350
|
|
14
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
15
|
+
,
|
|
14
16
|
offset: [0, 3],
|
|
15
17
|
mountTo: props.popupsMountPoint,
|
|
16
18
|
boundariesElement: props.popupsBoundariesElement,
|
|
@@ -587,7 +587,9 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
587
587
|
return jsx(Popup, {
|
|
588
588
|
target: ref.deref(),
|
|
589
589
|
fitHeight: 350,
|
|
590
|
-
fitWidth: 350
|
|
590
|
+
fitWidth: 350
|
|
591
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
592
|
+
,
|
|
591
593
|
offset: [0, 3],
|
|
592
594
|
mountTo: popupsMountPoint,
|
|
593
595
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -63,7 +63,9 @@ export var EmojiButton = function EmojiButton(_ref) {
|
|
|
63
63
|
size: "small"
|
|
64
64
|
}),
|
|
65
65
|
ariaKeyshortcuts: "Shift+;",
|
|
66
|
-
ref: emojiButtonRef
|
|
66
|
+
ref: emojiButtonRef
|
|
67
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
68
|
+
,
|
|
67
69
|
onClick: function onClick() {
|
|
68
70
|
return emojiPickerPopup.toggle();
|
|
69
71
|
},
|
|
@@ -198,7 +198,9 @@ export var InsertButton = function InsertButton(_ref) {
|
|
|
198
198
|
return /*#__PURE__*/React.createElement(React.Fragment, null, insertMenuOpen && insertButtonRef.current && editorView && /*#__PURE__*/React.createElement(Popup, {
|
|
199
199
|
target: insertButtonRef.current,
|
|
200
200
|
fitHeight: DEFAULT_HEIGHT + FIT_HEIGHT_BUFFER,
|
|
201
|
-
fitWidth: 350
|
|
201
|
+
fitWidth: 350
|
|
202
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
203
|
+
,
|
|
202
204
|
offset: [0, 3],
|
|
203
205
|
mountTo: popupsMountPoint,
|
|
204
206
|
boundariesElement: popupsBoundariesElement,
|
|
@@ -5,11 +5,14 @@ import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks'
|
|
|
5
5
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { TOOLBAR_BUTTON_TEST_ID } from '@atlaskit/editor-common/toolbar';
|
|
7
7
|
import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
|
|
8
|
-
import { ToolbarButton, ToolbarTooltip, ImageIcon } from '@atlaskit/editor-toolbar';
|
|
8
|
+
import { ToolbarButton, ToolbarTooltip, ImageIcon, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
9
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
9
10
|
export var MediaButton = function MediaButton(_ref) {
|
|
10
11
|
var api = _ref.api;
|
|
11
12
|
var _useIntl = useIntl(),
|
|
12
13
|
formatMessage = _useIntl.formatMessage;
|
|
14
|
+
var _useToolbarUI = useToolbarUI(),
|
|
15
|
+
popupsMountPoint = _useToolbarUI.popupsMountPoint;
|
|
13
16
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['media', 'connectivity'], function (states) {
|
|
14
17
|
var _states$mediaState, _states$mediaState2, _states$connectivityS;
|
|
15
18
|
return {
|
|
@@ -32,11 +35,19 @@ export var MediaButton = function MediaButton(_ref) {
|
|
|
32
35
|
}
|
|
33
36
|
if (api !== null && api !== void 0 && (_api$mediaInsert = api.mediaInsert) !== null && _api$mediaInsert !== void 0 && (_api$mediaInsert = _api$mediaInsert.commands) !== null && _api$mediaInsert !== void 0 && _api$mediaInsert.showMediaInsertPopup) {
|
|
34
37
|
var _api$core, _api$mediaInsert2;
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
var ref = mediaButtonRef.current;
|
|
39
|
+
var mountInfoOld = ref ? {
|
|
40
|
+
ref: ref,
|
|
41
|
+
mountPoint: ref
|
|
38
42
|
} : undefined;
|
|
39
|
-
|
|
43
|
+
var mountInfo = ref !== null && ref !== void 0 && ref.parentElement ? {
|
|
44
|
+
ref: ref,
|
|
45
|
+
mountPoint: popupsMountPoint !== null && popupsMountPoint !== void 0 ? popupsMountPoint : ref.parentElement
|
|
46
|
+
} : undefined;
|
|
47
|
+
var resolvedMountInfo = editorExperiment('platform_editor_fix_media_picker_hidden', true, {
|
|
48
|
+
exposure: true
|
|
49
|
+
}) ? mountInfo : mountInfoOld;
|
|
50
|
+
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$mediaInsert2 = api.mediaInsert) === null || _api$mediaInsert2 === void 0 ? void 0 : _api$mediaInsert2.commands.showMediaInsertPopup(resolvedMountInfo));
|
|
40
51
|
} else {
|
|
41
52
|
showMediaPicker();
|
|
42
53
|
}
|
|
@@ -29,7 +29,9 @@ export var EmojiPickerPopup = function EmojiPickerPopup(_ref) {
|
|
|
29
29
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
30
30
|
target: targetRef.current,
|
|
31
31
|
fitHeight: 350,
|
|
32
|
-
fitWidth: 350
|
|
32
|
+
fitWidth: 350
|
|
33
|
+
// eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
|
|
34
|
+
,
|
|
33
35
|
offset: [0, 3],
|
|
34
36
|
mountTo: popupsMountPoint,
|
|
35
37
|
boundariesElement: popupsBoundariesElement,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.11",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@atlaskit/editor-plugin-hyperlink": "^10.0.0",
|
|
43
43
|
"@atlaskit/editor-plugin-image-upload": "^8.0.0",
|
|
44
44
|
"@atlaskit/editor-plugin-layout": "^8.0.0",
|
|
45
|
-
"@atlaskit/editor-plugin-media": "^10.
|
|
45
|
+
"@atlaskit/editor-plugin-media": "^10.1.0",
|
|
46
46
|
"@atlaskit/editor-plugin-media-insert": "^19.0.0",
|
|
47
47
|
"@atlaskit/editor-plugin-mentions": "^10.0.0",
|
|
48
48
|
"@atlaskit/editor-plugin-metrics": "^9.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/editor-plugin-rule": "^8.0.0",
|
|
54
54
|
"@atlaskit/editor-plugin-status": "^9.0.0",
|
|
55
55
|
"@atlaskit/editor-plugin-table": "^18.1.0",
|
|
56
|
-
"@atlaskit/editor-plugin-tasks-and-decisions": "^11.
|
|
56
|
+
"@atlaskit/editor-plugin-tasks-and-decisions": "^11.3.0",
|
|
57
57
|
"@atlaskit/editor-plugin-toolbar": "^5.1.0",
|
|
58
58
|
"@atlaskit/editor-plugin-type-ahead": "^8.0.0",
|
|
59
59
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@atlaskit/icon-lab": "^6.0.0",
|
|
66
66
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
67
67
|
"@atlaskit/theme": "^22.0.0",
|
|
68
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
68
|
+
"@atlaskit/tmp-editor-statsig": "^44.3.0",
|
|
69
69
|
"@atlaskit/tokens": "^11.1.0",
|
|
70
70
|
"@babel/runtime": "^7.0.0",
|
|
71
71
|
"@emotion/react": "^11.7.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"react-virtualized": "^9.22.6"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@atlaskit/editor-common": "^112.
|
|
78
|
+
"@atlaskit/editor-common": "^112.8.0",
|
|
79
79
|
"react": "^18.2.0",
|
|
80
80
|
"react-dom": "^18.2.0",
|
|
81
81
|
"react-intl-next": "npm:react-intl@^5.18.1"
|