@atlaskit/editor-plugin-insert-block 7.0.12 → 7.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -7
- package/dist/cjs/insertBlockPlugin.js +2 -6
- package/dist/cjs/ui/ToolbarInsertBlock/index.js +1 -1
- package/dist/cjs/ui/toolbar-components/EmojiButton.js +5 -4
- package/dist/cjs/ui/toolbar-components/InsertButton.js +2 -6
- package/dist/cjs/ui/toolbar-components/MediaButton.js +2 -3
- package/dist/es2019/insertBlockPlugin.js +2 -6
- package/dist/es2019/ui/ToolbarInsertBlock/index.js +1 -1
- package/dist/es2019/ui/toolbar-components/EmojiButton.js +7 -5
- package/dist/es2019/ui/toolbar-components/InsertButton.js +2 -6
- package/dist/es2019/ui/toolbar-components/MediaButton.js +2 -3
- package/dist/esm/insertBlockPlugin.js +2 -6
- package/dist/esm/ui/ToolbarInsertBlock/index.js +1 -1
- package/dist/esm/ui/toolbar-components/EmojiButton.js +6 -5
- package/dist/esm/ui/toolbar-components/InsertButton.js +2 -6
- package/dist/esm/ui/toolbar-components/MediaButton.js +2 -3
- package/dist/types/ui/toolbar-components/EmojiButton.d.ts +1 -1
- package/dist/types-ts4.5/ui/toolbar-components/EmojiButton.d.ts +1 -1
- package/package.json +25 -28
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 7.0.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`2bdec5e9ec1c9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2bdec5e9ec1c9) -
|
|
8
|
+
[EDITOR-442] Cleans up FG platform_editor_add_media_from_url_rollout
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 7.0.13
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 7.0.12
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -232,7 +246,6 @@
|
|
|
232
246
|
|
|
233
247
|
- [`286abb4d35eba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/286abb4d35eba) -
|
|
234
248
|
[ux] [ED-28960] Finish full page primary toolbar migration
|
|
235
|
-
|
|
236
249
|
- Align with design update (separator, gap, height, icon size)
|
|
237
250
|
- Add keyboard shortcut to focus toolbar and arrow key navigation
|
|
238
251
|
- Address accessibility
|
|
@@ -356,7 +369,6 @@
|
|
|
356
369
|
shared context or singletons.
|
|
357
370
|
|
|
358
371
|
**HOW TO ADJUST:**
|
|
359
|
-
|
|
360
372
|
- Consumers must now explicitly install `@atlaskit/editor-common` in their own project if they use
|
|
361
373
|
any of these editor plugins.
|
|
362
374
|
- Ensure the version you install matches the version required by the plugins.
|
|
@@ -1478,7 +1490,6 @@
|
|
|
1478
1490
|
|
|
1479
1491
|
- [`193f8c85e1a39`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/193f8c85e1a39) -
|
|
1480
1492
|
[ux] [ED-24635]
|
|
1481
|
-
|
|
1482
1493
|
- Disable Turn into dropdown options when wrapping is not supported
|
|
1483
1494
|
- Update expand icon so that it can show disabled status
|
|
1484
1495
|
- Update Turn into icon to show active status when dropdown is open
|
|
@@ -1499,7 +1510,6 @@
|
|
|
1499
1510
|
[`705fe39cae267`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/705fe39cae267) -
|
|
1500
1511
|
[ED-24597] Update to log `platform_editor_basic_text_transformations` exposure event only for
|
|
1501
1512
|
users meet all of 3 checks:
|
|
1502
|
-
|
|
1503
1513
|
- Are enrolled to the experiment
|
|
1504
1514
|
- Have AI disabled
|
|
1505
1515
|
- Make top level text selection
|
|
@@ -1896,7 +1906,6 @@
|
|
|
1896
1906
|
## WHAT?:
|
|
1897
1907
|
|
|
1898
1908
|
Removing feature flags:
|
|
1899
|
-
|
|
1900
1909
|
- singleLayout
|
|
1901
1910
|
- newInsertionBehaviour
|
|
1902
1911
|
- interactiveExpand
|
|
@@ -1910,7 +1919,6 @@
|
|
|
1910
1919
|
maintenance burden
|
|
1911
1920
|
|
|
1912
1921
|
## HOW to update your code:
|
|
1913
|
-
|
|
1914
1922
|
- If you were using the feature flag - the behaviour is now default and you can remove the flags
|
|
1915
1923
|
- If you were not using the feature flag - the behaviour is now default.
|
|
1916
1924
|
- If you have opted out of using the feature flag - we have been careful to ensure no-one has
|
|
@@ -2207,7 +2215,6 @@
|
|
|
2207
2215
|
- [#43646](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43646)
|
|
2208
2216
|
[`d43f8e9402f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d43f8e9402f) - Make
|
|
2209
2217
|
feature flags plugin optional in all plugins including:
|
|
2210
|
-
|
|
2211
2218
|
- analytics
|
|
2212
2219
|
- base
|
|
2213
2220
|
- card
|
|
@@ -294,15 +294,11 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
|
294
294
|
exposure: true
|
|
295
295
|
}) ? emojiProviderPromise : getEmojiProvider();
|
|
296
296
|
var onShowMediaPicker = function onShowMediaPicker(mountInfo) {
|
|
297
|
+
var _pluginInjectionApi$c, _pluginInjectionApi$m;
|
|
297
298
|
if (!showMediaPicker) {
|
|
298
299
|
return;
|
|
299
300
|
}
|
|
300
|
-
|
|
301
|
-
var _pluginInjectionApi$c, _pluginInjectionApi$m;
|
|
302
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 || _pluginInjectionApi$c.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.commands.showMediaInsertPopup(mountInfo));
|
|
303
|
-
} else {
|
|
304
|
-
showMediaPicker();
|
|
305
|
-
}
|
|
301
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 || _pluginInjectionApi$c.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.commands.showMediaInsertPopup(mountInfo));
|
|
306
302
|
};
|
|
307
303
|
return /*#__PURE__*/_react.default.createElement(_ToolbarInsertBlock.default, {
|
|
308
304
|
showElementBrowser: showElementBrowser || false,
|
|
@@ -367,7 +367,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
367
367
|
dispatchAnalyticsEvent({
|
|
368
368
|
action: _analytics.ACTION.OPENED,
|
|
369
369
|
actionSubject: _analytics.ACTION_SUBJECT.PICKER,
|
|
370
|
-
actionSubjectId:
|
|
370
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.PICKER_MEDIA,
|
|
371
371
|
attributes: {
|
|
372
372
|
inputMethod: inputMethod
|
|
373
373
|
},
|
|
@@ -16,13 +16,14 @@ var _useEmojiPickerPopup = require("./hooks/useEmojiPickerPopup");
|
|
|
16
16
|
var _EmojiPickerPopup = require("./popups/EmojiPickerPopup");
|
|
17
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); }
|
|
18
18
|
var EmojiButton = exports.EmojiButton = function EmojiButton(_ref) {
|
|
19
|
-
var api = _ref.api
|
|
20
|
-
popupsMountPoint = _ref.popupsMountPoint,
|
|
21
|
-
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
22
|
-
popupsScrollableElement = _ref.popupsScrollableElement;
|
|
19
|
+
var api = _ref.api;
|
|
23
20
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
24
21
|
formatMessage = _useIntl.formatMessage;
|
|
25
22
|
var emojiButtonRef = (0, _react.useRef)(null);
|
|
23
|
+
var _useToolbarUI = (0, _editorToolbar.useToolbarUI)(),
|
|
24
|
+
popupsMountPoint = _useToolbarUI.popupsMountPoint,
|
|
25
|
+
popupsBoundariesElement = _useToolbarUI.popupsBoundariesElement,
|
|
26
|
+
popupsScrollableElement = _useToolbarUI.popupsScrollableElement;
|
|
26
27
|
var _useSharedPluginState = (0, _hooks.useSharedPluginStateWithSelector)(api, ['emoji', 'typeAhead'], function (states) {
|
|
27
28
|
var _states$emojiState, _states$emojiState2, _states$typeAheadStat;
|
|
28
29
|
return {
|
|
@@ -136,12 +136,8 @@ var InsertButton = exports.InsertButton = function InsertButton(_ref) {
|
|
|
136
136
|
break;
|
|
137
137
|
case 'media':
|
|
138
138
|
if (showMediaPicker) {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(api === null || api === void 0 || (_api$mediaInsert = api.mediaInsert) === null || _api$mediaInsert === void 0 ? void 0 : _api$mediaInsert.commands.showMediaInsertPopup());
|
|
142
|
-
} else {
|
|
143
|
-
showMediaPicker();
|
|
144
|
-
}
|
|
139
|
+
var _api$core2, _api$mediaInsert;
|
|
140
|
+
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(api === null || api === void 0 || (_api$mediaInsert = api.mediaInsert) === null || _api$mediaInsert === void 0 ? void 0 : _api$mediaInsert.commands.showMediaInsertPopup());
|
|
145
141
|
}
|
|
146
142
|
break;
|
|
147
143
|
case 'mention':
|
|
@@ -11,7 +11,6 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
11
11
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
12
12
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
13
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
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); }
|
|
16
15
|
var MediaButton = exports.MediaButton = function MediaButton(_ref) {
|
|
17
16
|
var api = _ref.api;
|
|
@@ -37,7 +36,7 @@ var MediaButton = exports.MediaButton = function MediaButton(_ref) {
|
|
|
37
36
|
if (!showMediaPicker) {
|
|
38
37
|
return;
|
|
39
38
|
}
|
|
40
|
-
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
|
|
39
|
+
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) {
|
|
41
40
|
var _api$core, _api$mediaInsert2;
|
|
42
41
|
var mountInfo = mediaButtonRef.current ? {
|
|
43
42
|
ref: mediaButtonRef.current,
|
|
@@ -50,7 +49,7 @@ var MediaButton = exports.MediaButton = function MediaButton(_ref) {
|
|
|
50
49
|
api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.fireAnalyticsEvent({
|
|
51
50
|
action: _analytics.ACTION.OPENED,
|
|
52
51
|
actionSubject: _analytics.ACTION_SUBJECT.PICKER,
|
|
53
|
-
actionSubjectId:
|
|
52
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.PICKER_MEDIA,
|
|
54
53
|
attributes: {
|
|
55
54
|
inputMethod: _analytics.INPUT_METHOD.TOOLBAR
|
|
56
55
|
},
|
|
@@ -280,15 +280,11 @@ function ToolbarInsertBlockWithInjectionApi({
|
|
|
280
280
|
exposure: true
|
|
281
281
|
}) ? emojiProviderPromise : getEmojiProvider();
|
|
282
282
|
const onShowMediaPicker = mountInfo => {
|
|
283
|
+
var _pluginInjectionApi$c, _pluginInjectionApi$m;
|
|
283
284
|
if (!showMediaPicker) {
|
|
284
285
|
return;
|
|
285
286
|
}
|
|
286
|
-
|
|
287
|
-
var _pluginInjectionApi$c, _pluginInjectionApi$m;
|
|
288
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$m = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.commands.showMediaInsertPopup(mountInfo));
|
|
289
|
-
} else {
|
|
290
|
-
showMediaPicker();
|
|
291
|
-
}
|
|
287
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$m = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.commands.showMediaInsertPopup(mountInfo));
|
|
292
288
|
};
|
|
293
289
|
return /*#__PURE__*/React.createElement(ToolbarInsertBlock, {
|
|
294
290
|
showElementBrowser: showElementBrowser || false,
|
|
@@ -386,7 +386,7 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
386
386
|
dispatchAnalyticsEvent({
|
|
387
387
|
action: ACTION.OPENED,
|
|
388
388
|
actionSubject: ACTION_SUBJECT.PICKER,
|
|
389
|
-
actionSubjectId:
|
|
389
|
+
actionSubjectId: ACTION_SUBJECT_ID.PICKER_MEDIA,
|
|
390
390
|
attributes: {
|
|
391
391
|
inputMethod
|
|
392
392
|
},
|
|
@@ -3,20 +3,22 @@ import { useIntl } from 'react-intl-next';
|
|
|
3
3
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
4
|
import { ToolTipContent, insertEmoji } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
|
-
import { ToolbarButton, ToolbarTooltip, EmojiIcon } from '@atlaskit/editor-toolbar';
|
|
6
|
+
import { ToolbarButton, ToolbarTooltip, EmojiIcon, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
7
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
8
|
import { useEmojiPickerPopup } from './hooks/useEmojiPickerPopup';
|
|
9
9
|
import { EmojiPickerPopup } from './popups/EmojiPickerPopup';
|
|
10
10
|
export const EmojiButton = ({
|
|
11
|
-
api
|
|
12
|
-
popupsMountPoint,
|
|
13
|
-
popupsBoundariesElement,
|
|
14
|
-
popupsScrollableElement
|
|
11
|
+
api
|
|
15
12
|
}) => {
|
|
16
13
|
const {
|
|
17
14
|
formatMessage
|
|
18
15
|
} = useIntl();
|
|
19
16
|
const emojiButtonRef = useRef(null);
|
|
17
|
+
const {
|
|
18
|
+
popupsMountPoint,
|
|
19
|
+
popupsBoundariesElement,
|
|
20
|
+
popupsScrollableElement
|
|
21
|
+
} = useToolbarUI();
|
|
20
22
|
const {
|
|
21
23
|
emojiProviderSelector,
|
|
22
24
|
emojiProviderPromise,
|
|
@@ -128,12 +128,8 @@ export const InsertButton = ({
|
|
|
128
128
|
break;
|
|
129
129
|
case 'media':
|
|
130
130
|
if (showMediaPicker) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
api === null || api === void 0 ? void 0 : (_api$core2 = api.core) === null || _api$core2 === void 0 ? void 0 : _api$core2.actions.execute(api === null || api === void 0 ? void 0 : (_api$mediaInsert = api.mediaInsert) === null || _api$mediaInsert === void 0 ? void 0 : _api$mediaInsert.commands.showMediaInsertPopup());
|
|
134
|
-
} else {
|
|
135
|
-
showMediaPicker();
|
|
136
|
-
}
|
|
131
|
+
var _api$core2, _api$mediaInsert;
|
|
132
|
+
api === null || api === void 0 ? void 0 : (_api$core2 = api.core) === null || _api$core2 === void 0 ? void 0 : _api$core2.actions.execute(api === null || api === void 0 ? void 0 : (_api$mediaInsert = api.mediaInsert) === null || _api$mediaInsert === void 0 ? void 0 : _api$mediaInsert.commands.showMediaInsertPopup());
|
|
137
133
|
}
|
|
138
134
|
break;
|
|
139
135
|
case 'mention':
|
|
@@ -4,7 +4,6 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
|
|
|
4
4
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
5
5
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { ToolbarButton, ToolbarTooltip, ImageIcon } from '@atlaskit/editor-toolbar';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
export const MediaButton = ({
|
|
9
8
|
api
|
|
10
9
|
}) => {
|
|
@@ -32,7 +31,7 @@ export const MediaButton = ({
|
|
|
32
31
|
if (!showMediaPicker) {
|
|
33
32
|
return;
|
|
34
33
|
}
|
|
35
|
-
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
|
|
34
|
+
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) {
|
|
36
35
|
var _api$core, _api$mediaInsert2;
|
|
37
36
|
const mountInfo = mediaButtonRef.current ? {
|
|
38
37
|
ref: mediaButtonRef.current,
|
|
@@ -45,7 +44,7 @@ export const MediaButton = ({
|
|
|
45
44
|
api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.fireAnalyticsEvent({
|
|
46
45
|
action: ACTION.OPENED,
|
|
47
46
|
actionSubject: ACTION_SUBJECT.PICKER,
|
|
48
|
-
actionSubjectId:
|
|
47
|
+
actionSubjectId: ACTION_SUBJECT_ID.PICKER_MEDIA,
|
|
49
48
|
attributes: {
|
|
50
49
|
inputMethod: INPUT_METHOD.TOOLBAR
|
|
51
50
|
},
|
|
@@ -284,15 +284,11 @@ function ToolbarInsertBlockWithInjectionApi(_ref4) {
|
|
|
284
284
|
exposure: true
|
|
285
285
|
}) ? emojiProviderPromise : getEmojiProvider();
|
|
286
286
|
var onShowMediaPicker = function onShowMediaPicker(mountInfo) {
|
|
287
|
+
var _pluginInjectionApi$c, _pluginInjectionApi$m;
|
|
287
288
|
if (!showMediaPicker) {
|
|
288
289
|
return;
|
|
289
290
|
}
|
|
290
|
-
|
|
291
|
-
var _pluginInjectionApi$c, _pluginInjectionApi$m;
|
|
292
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 || _pluginInjectionApi$c.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.commands.showMediaInsertPopup(mountInfo));
|
|
293
|
-
} else {
|
|
294
|
-
showMediaPicker();
|
|
295
|
-
}
|
|
291
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.core) === null || _pluginInjectionApi$c === void 0 || _pluginInjectionApi$c.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m = pluginInjectionApi.mediaInsert) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.commands.showMediaInsertPopup(mountInfo));
|
|
296
292
|
};
|
|
297
293
|
return /*#__PURE__*/React.createElement(ToolbarInsertBlock, {
|
|
298
294
|
showElementBrowser: showElementBrowser || false,
|
|
@@ -361,7 +361,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
361
361
|
dispatchAnalyticsEvent({
|
|
362
362
|
action: ACTION.OPENED,
|
|
363
363
|
actionSubject: ACTION_SUBJECT.PICKER,
|
|
364
|
-
actionSubjectId:
|
|
364
|
+
actionSubjectId: ACTION_SUBJECT_ID.PICKER_MEDIA,
|
|
365
365
|
attributes: {
|
|
366
366
|
inputMethod: inputMethod
|
|
367
367
|
},
|
|
@@ -3,18 +3,19 @@ import { useIntl } from 'react-intl-next';
|
|
|
3
3
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
4
4
|
import { ToolTipContent, insertEmoji } from '@atlaskit/editor-common/keymaps';
|
|
5
5
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
|
-
import { ToolbarButton, ToolbarTooltip, EmojiIcon } from '@atlaskit/editor-toolbar';
|
|
6
|
+
import { ToolbarButton, ToolbarTooltip, EmojiIcon, useToolbarUI } from '@atlaskit/editor-toolbar';
|
|
7
7
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
8
8
|
import { useEmojiPickerPopup } from './hooks/useEmojiPickerPopup';
|
|
9
9
|
import { EmojiPickerPopup } from './popups/EmojiPickerPopup';
|
|
10
10
|
export var EmojiButton = function EmojiButton(_ref) {
|
|
11
|
-
var api = _ref.api
|
|
12
|
-
popupsMountPoint = _ref.popupsMountPoint,
|
|
13
|
-
popupsBoundariesElement = _ref.popupsBoundariesElement,
|
|
14
|
-
popupsScrollableElement = _ref.popupsScrollableElement;
|
|
11
|
+
var api = _ref.api;
|
|
15
12
|
var _useIntl = useIntl(),
|
|
16
13
|
formatMessage = _useIntl.formatMessage;
|
|
17
14
|
var emojiButtonRef = useRef(null);
|
|
15
|
+
var _useToolbarUI = useToolbarUI(),
|
|
16
|
+
popupsMountPoint = _useToolbarUI.popupsMountPoint,
|
|
17
|
+
popupsBoundariesElement = _useToolbarUI.popupsBoundariesElement,
|
|
18
|
+
popupsScrollableElement = _useToolbarUI.popupsScrollableElement;
|
|
18
19
|
var _useSharedPluginState = useSharedPluginStateWithSelector(api, ['emoji', 'typeAhead'], function (states) {
|
|
19
20
|
var _states$emojiState, _states$emojiState2, _states$typeAheadStat;
|
|
20
21
|
return {
|
|
@@ -128,12 +128,8 @@ export var InsertButton = function InsertButton(_ref) {
|
|
|
128
128
|
break;
|
|
129
129
|
case 'media':
|
|
130
130
|
if (showMediaPicker) {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(api === null || api === void 0 || (_api$mediaInsert = api.mediaInsert) === null || _api$mediaInsert === void 0 ? void 0 : _api$mediaInsert.commands.showMediaInsertPopup());
|
|
134
|
-
} else {
|
|
135
|
-
showMediaPicker();
|
|
136
|
-
}
|
|
131
|
+
var _api$core2, _api$mediaInsert;
|
|
132
|
+
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(api === null || api === void 0 || (_api$mediaInsert = api.mediaInsert) === null || _api$mediaInsert === void 0 ? void 0 : _api$mediaInsert.commands.showMediaInsertPopup());
|
|
137
133
|
}
|
|
138
134
|
break;
|
|
139
135
|
case 'mention':
|
|
@@ -4,7 +4,6 @@ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } f
|
|
|
4
4
|
import { useSharedPluginStateWithSelector } from '@atlaskit/editor-common/hooks';
|
|
5
5
|
import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { ToolbarButton, ToolbarTooltip, ImageIcon } from '@atlaskit/editor-toolbar';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
export var MediaButton = function MediaButton(_ref) {
|
|
9
8
|
var api = _ref.api;
|
|
10
9
|
var _useIntl = useIntl(),
|
|
@@ -29,7 +28,7 @@ export var MediaButton = function MediaButton(_ref) {
|
|
|
29
28
|
if (!showMediaPicker) {
|
|
30
29
|
return;
|
|
31
30
|
}
|
|
32
|
-
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
|
|
31
|
+
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) {
|
|
33
32
|
var _api$core, _api$mediaInsert2;
|
|
34
33
|
var mountInfo = mediaButtonRef.current ? {
|
|
35
34
|
ref: mediaButtonRef.current,
|
|
@@ -42,7 +41,7 @@ export var MediaButton = function MediaButton(_ref) {
|
|
|
42
41
|
api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.fireAnalyticsEvent({
|
|
43
42
|
action: ACTION.OPENED,
|
|
44
43
|
actionSubject: ACTION_SUBJECT.PICKER,
|
|
45
|
-
actionSubjectId:
|
|
44
|
+
actionSubjectId: ACTION_SUBJECT_ID.PICKER_MEDIA,
|
|
46
45
|
attributes: {
|
|
47
46
|
inputMethod: INPUT_METHOD.TOOLBAR
|
|
48
47
|
},
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { BaseToolbarButtonProps } from './shared/types';
|
|
3
|
-
export declare const EmojiButton: ({ api
|
|
3
|
+
export declare const EmojiButton: ({ api }: BaseToolbarButtonProps) => React.JSX.Element | null;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { BaseToolbarButtonProps } from './shared/types';
|
|
3
|
-
export declare const EmojiButton: ({ api
|
|
3
|
+
export declare const EmojiButton: ({ api }: BaseToolbarButtonProps) => React.JSX.Element | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.14",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,32 +30,32 @@
|
|
|
30
30
|
"atlaskit:src": "src/index.ts",
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/button": "^23.5.0",
|
|
33
|
-
"@atlaskit/editor-plugin-analytics": "^6.
|
|
34
|
-
"@atlaskit/editor-plugin-block-type": "^10.
|
|
35
|
-
"@atlaskit/editor-plugin-code-block": "^8.
|
|
33
|
+
"@atlaskit/editor-plugin-analytics": "^6.2.0",
|
|
34
|
+
"@atlaskit/editor-plugin-block-type": "^10.2.0",
|
|
35
|
+
"@atlaskit/editor-plugin-code-block": "^8.1.0",
|
|
36
36
|
"@atlaskit/editor-plugin-connectivity": "^6.0.0",
|
|
37
|
-
"@atlaskit/editor-plugin-date": "^8.
|
|
38
|
-
"@atlaskit/editor-plugin-emoji": "^7.
|
|
39
|
-
"@atlaskit/editor-plugin-expand": "^7.
|
|
40
|
-
"@atlaskit/editor-plugin-extension": "^9.
|
|
37
|
+
"@atlaskit/editor-plugin-date": "^8.1.0",
|
|
38
|
+
"@atlaskit/editor-plugin-emoji": "^7.4.0",
|
|
39
|
+
"@atlaskit/editor-plugin-expand": "^7.2.0",
|
|
40
|
+
"@atlaskit/editor-plugin-extension": "^9.1.0",
|
|
41
41
|
"@atlaskit/editor-plugin-feature-flags": "^5.0.0",
|
|
42
|
-
"@atlaskit/editor-plugin-hyperlink": "^8.
|
|
42
|
+
"@atlaskit/editor-plugin-hyperlink": "^8.1.0",
|
|
43
43
|
"@atlaskit/editor-plugin-image-upload": "^6.0.0",
|
|
44
|
-
"@atlaskit/editor-plugin-layout": "^6.
|
|
45
|
-
"@atlaskit/editor-plugin-media": "^8.
|
|
46
|
-
"@atlaskit/editor-plugin-media-insert": "^
|
|
47
|
-
"@atlaskit/editor-plugin-mentions": "^8.
|
|
48
|
-
"@atlaskit/editor-plugin-metrics": "^7.
|
|
49
|
-
"@atlaskit/editor-plugin-panel": "^8.
|
|
50
|
-
"@atlaskit/editor-plugin-placeholder-text": "^7.
|
|
44
|
+
"@atlaskit/editor-plugin-layout": "^6.1.0",
|
|
45
|
+
"@atlaskit/editor-plugin-media": "^8.2.0",
|
|
46
|
+
"@atlaskit/editor-plugin-media-insert": "^13.1.0",
|
|
47
|
+
"@atlaskit/editor-plugin-mentions": "^8.2.0",
|
|
48
|
+
"@atlaskit/editor-plugin-metrics": "^7.1.0",
|
|
49
|
+
"@atlaskit/editor-plugin-panel": "^8.1.0",
|
|
50
|
+
"@atlaskit/editor-plugin-placeholder-text": "^7.1.0",
|
|
51
51
|
"@atlaskit/editor-plugin-primary-toolbar": "^7.0.0",
|
|
52
52
|
"@atlaskit/editor-plugin-quick-insert": "^6.0.0",
|
|
53
|
-
"@atlaskit/editor-plugin-rule": "^6.
|
|
54
|
-
"@atlaskit/editor-plugin-status": "^7.
|
|
55
|
-
"@atlaskit/editor-plugin-table": "^15.
|
|
56
|
-
"@atlaskit/editor-plugin-tasks-and-decisions": "^9.
|
|
53
|
+
"@atlaskit/editor-plugin-rule": "^6.1.0",
|
|
54
|
+
"@atlaskit/editor-plugin-status": "^7.1.0",
|
|
55
|
+
"@atlaskit/editor-plugin-table": "^15.2.0",
|
|
56
|
+
"@atlaskit/editor-plugin-tasks-and-decisions": "^9.1.0",
|
|
57
57
|
"@atlaskit/editor-plugin-toolbar": "^3.3.0",
|
|
58
|
-
"@atlaskit/editor-plugin-type-ahead": "^6.
|
|
58
|
+
"@atlaskit/editor-plugin-type-ahead": "^6.5.0",
|
|
59
59
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
60
60
|
"@atlaskit/editor-shared-styles": "^3.7.0",
|
|
61
61
|
"@atlaskit/editor-toolbar": "^0.15.0",
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"@atlaskit/icon": "^28.5.0",
|
|
66
66
|
"@atlaskit/icon-lab": "^5.10.0",
|
|
67
67
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
68
|
-
"@atlaskit/primitives": "^
|
|
68
|
+
"@atlaskit/primitives": "^16.0.0",
|
|
69
69
|
"@atlaskit/theme": "^21.0.0",
|
|
70
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
71
|
-
"@atlaskit/tokens": "^
|
|
70
|
+
"@atlaskit/tmp-editor-statsig": "^13.13.0",
|
|
71
|
+
"@atlaskit/tokens": "^7.0.0",
|
|
72
72
|
"@atlaskit/tooltip": "^20.5.0",
|
|
73
73
|
"@babel/runtime": "^7.0.0",
|
|
74
74
|
"@emotion/react": "^11.7.1",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"react-virtualized": "^9.22.6"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
|
-
"@atlaskit/editor-common": "^110.
|
|
81
|
+
"@atlaskit/editor-common": "^110.14.0",
|
|
82
82
|
"react": "^18.2.0",
|
|
83
83
|
"react-dom": "^18.2.0",
|
|
84
84
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -133,9 +133,6 @@
|
|
|
133
133
|
"platform_editor_ease_of_use_metrics": {
|
|
134
134
|
"type": "boolean"
|
|
135
135
|
},
|
|
136
|
-
"platform_editor_add_media_from_url_rollout": {
|
|
137
|
-
"type": "boolean"
|
|
138
|
-
},
|
|
139
136
|
"platform_editor_refactor_view_more": {
|
|
140
137
|
"type": "boolean"
|
|
141
138
|
},
|