@atlaskit/editor-plugin-insert-block 2.2.5 → 2.2.7
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/plugin.js +2 -2
- package/dist/cjs/ui/ToolbarInsertBlock/index.js +9 -4
- package/dist/cjs/ui/ToolbarInsertBlock/item.js +4 -4
- package/dist/es2019/plugin.js +2 -2
- package/dist/es2019/ui/ToolbarInsertBlock/index.js +8 -3
- package/dist/es2019/ui/ToolbarInsertBlock/item.js +2 -2
- package/dist/esm/plugin.js +2 -2
- package/dist/esm/ui/ToolbarInsertBlock/index.js +9 -4
- package/dist/esm/ui/ToolbarInsertBlock/item.js +2 -2
- package/dist/types/ui/ToolbarInsertBlock/types.d.ts +4 -1
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/types.d.ts +4 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 2.2.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#147461](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/147461)
|
|
8
|
+
[`acef010cdb706`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/acef010cdb706) -
|
|
9
|
+
[ux] [ED-25164] Pass mounting point to media insert plugin for correct toolbar popup positioning
|
|
10
|
+
|
|
11
|
+
## 2.2.6
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#147410](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/147410)
|
|
16
|
+
[`7300bd8281c70`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7300bd8281c70) -
|
|
17
|
+
Updated icon usage to new endpoints
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 2.2.5
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/cjs/plugin.js
CHANGED
|
@@ -336,13 +336,13 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
|
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
var emojiProvider = getEmojiProvider();
|
|
339
|
-
var onShowMediaPicker = function onShowMediaPicker(
|
|
339
|
+
var onShowMediaPicker = function onShowMediaPicker(mountInfo) {
|
|
340
340
|
if (!mediaState) {
|
|
341
341
|
return;
|
|
342
342
|
}
|
|
343
343
|
if ((0, _experiments.editorExperiment)('add-media-from-url', true)) {
|
|
344
344
|
var _pluginInjectionApi$c, _pluginInjectionApi$m;
|
|
345
|
-
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(
|
|
345
|
+
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));
|
|
346
346
|
} else {
|
|
347
347
|
mediaState.showMediaPicker();
|
|
348
348
|
}
|
|
@@ -75,10 +75,10 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
75
75
|
function ToolbarInsertBlock() {
|
|
76
76
|
var _this;
|
|
77
77
|
(0, _classCallCheck2.default)(this, ToolbarInsertBlock);
|
|
78
|
-
for (var _len = arguments.length,
|
|
79
|
-
|
|
78
|
+
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
79
|
+
_args[_key] = arguments[_key];
|
|
80
80
|
}
|
|
81
|
-
_this = _super.call.apply(_super, [this].concat(
|
|
81
|
+
_this = _super.call.apply(_super, [this].concat(_args));
|
|
82
82
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "tableButtonRef", /*#__PURE__*/_react.default.createRef());
|
|
83
83
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "tableSelectorButtonRef", /*#__PURE__*/_react.default.createRef());
|
|
84
84
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "unregisterToggleDropdownMenuOptions", null);
|
|
@@ -372,7 +372,12 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
372
372
|
onShowMediaPicker = _this$props5.onShowMediaPicker,
|
|
373
373
|
dispatchAnalyticsEvent = _this$props5.dispatchAnalyticsEvent;
|
|
374
374
|
if (onShowMediaPicker) {
|
|
375
|
-
|
|
375
|
+
var _this$props$popupsMou;
|
|
376
|
+
var args = _this.mediaButtonRef ? {
|
|
377
|
+
ref: _this.mediaButtonRef,
|
|
378
|
+
mountPoint: (_this$props$popupsMou = _this.props.popupsMountPoint) !== null && _this$props$popupsMou !== void 0 ? _this$props$popupsMou : _this.mediaButtonRef
|
|
379
|
+
} : undefined;
|
|
380
|
+
onShowMediaPicker(args);
|
|
376
381
|
if (dispatchAnalyticsEvent) {
|
|
377
382
|
dispatchAnalyticsEvent({
|
|
378
383
|
action: _analytics.ACTION.OPENED,
|
|
@@ -11,7 +11,7 @@ var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
|
11
11
|
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
12
12
|
var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
|
|
13
13
|
var _fieldText = _interopRequireDefault(require("@atlaskit/icon-lab/core/field-text"));
|
|
14
|
-
var
|
|
14
|
+
var _lozenge = _interopRequireDefault(require("@atlaskit/icon-lab/core/lozenge"));
|
|
15
15
|
var _angleBracketsEditorCode = _interopRequireDefault(require("@atlaskit/icon/core/migration/angle-brackets--editor-code"));
|
|
16
16
|
var _calendarEditorDate = _interopRequireDefault(require("@atlaskit/icon/core/migration/calendar--editor-date"));
|
|
17
17
|
var _decisionEditorDecision = _interopRequireDefault(require("@atlaskit/icon/core/migration/decision--editor-decision"));
|
|
@@ -28,7 +28,7 @@ var _showMoreHorizontalEditorMore = _interopRequireDefault(require("@atlaskit/ic
|
|
|
28
28
|
var _task = _interopRequireDefault(require("@atlaskit/icon/core/task"));
|
|
29
29
|
var _task2 = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/task"));
|
|
30
30
|
var _text = _interopRequireDefault(require("@atlaskit/icon/glyph/media-services/text"));
|
|
31
|
-
var
|
|
31
|
+
var _status = _interopRequireDefault(require("@atlaskit/icon/glyph/status"));
|
|
32
32
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down"));
|
|
33
33
|
var _chevronRightChevronRightCircle = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-right--chevron-right-circle"));
|
|
34
34
|
var _shallowEquals = require("./shallow-equals");
|
|
@@ -270,11 +270,11 @@ var status = exports.status = mem(function (init) {
|
|
|
270
270
|
disabled: init.disabled,
|
|
271
271
|
name: 'status',
|
|
272
272
|
Icon: function Icon() {
|
|
273
|
-
return (0, _react2.jsx)(
|
|
273
|
+
return (0, _react2.jsx)(_lozenge.default, {
|
|
274
274
|
label: "",
|
|
275
275
|
color: "currentColor",
|
|
276
276
|
spacing: "spacious",
|
|
277
|
-
LEGACY_fallbackIcon:
|
|
277
|
+
LEGACY_fallbackIcon: _status.default
|
|
278
278
|
});
|
|
279
279
|
}
|
|
280
280
|
});
|
package/dist/es2019/plugin.js
CHANGED
|
@@ -331,13 +331,13 @@ function ToolbarInsertBlockWithInjectionApi({
|
|
|
331
331
|
}
|
|
332
332
|
};
|
|
333
333
|
const emojiProvider = getEmojiProvider();
|
|
334
|
-
const onShowMediaPicker =
|
|
334
|
+
const onShowMediaPicker = mountInfo => {
|
|
335
335
|
if (!mediaState) {
|
|
336
336
|
return;
|
|
337
337
|
}
|
|
338
338
|
if (editorExperiment('add-media-from-url', true)) {
|
|
339
339
|
var _pluginInjectionApi$c, _pluginInjectionApi$m;
|
|
340
|
-
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(
|
|
340
|
+
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));
|
|
341
341
|
} else {
|
|
342
342
|
mediaState.showMediaPicker();
|
|
343
343
|
}
|
|
@@ -73,8 +73,8 @@ css`
|
|
|
73
73
|
`;
|
|
74
74
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
75
75
|
export class ToolbarInsertBlock extends React.PureComponent {
|
|
76
|
-
constructor(...
|
|
77
|
-
super(...
|
|
76
|
+
constructor(..._args) {
|
|
77
|
+
super(..._args);
|
|
78
78
|
_defineProperty(this, "tableButtonRef", /*#__PURE__*/React.createRef());
|
|
79
79
|
_defineProperty(this, "tableSelectorButtonRef", /*#__PURE__*/React.createRef());
|
|
80
80
|
_defineProperty(this, "unregisterToggleDropdownMenuOptions", null);
|
|
@@ -386,7 +386,12 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
386
386
|
dispatchAnalyticsEvent
|
|
387
387
|
} = this.props;
|
|
388
388
|
if (onShowMediaPicker) {
|
|
389
|
-
|
|
389
|
+
var _this$props$popupsMou;
|
|
390
|
+
const args = this.mediaButtonRef ? {
|
|
391
|
+
ref: this.mediaButtonRef,
|
|
392
|
+
mountPoint: (_this$props$popupsMou = this.props.popupsMountPoint) !== null && _this$props$popupsMou !== void 0 ? _this$props$popupsMou : this.mediaButtonRef
|
|
393
|
+
} : undefined;
|
|
394
|
+
onShowMediaPicker(args);
|
|
390
395
|
if (dispatchAnalyticsEvent) {
|
|
391
396
|
dispatchAnalyticsEvent({
|
|
392
397
|
action: ACTION.OPENED,
|
|
@@ -10,7 +10,7 @@ import memoizeOne from 'memoize-one';
|
|
|
10
10
|
import { addLink, getAriaKeyshortcuts, toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
11
11
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
12
12
|
import FieldTextIcon from '@atlaskit/icon-lab/core/field-text';
|
|
13
|
-
import
|
|
13
|
+
import LozengeIcon from '@atlaskit/icon-lab/core/lozenge';
|
|
14
14
|
import AngleBracketsIcon from '@atlaskit/icon/core/migration/angle-brackets--editor-code';
|
|
15
15
|
import CalendarIcon from '@atlaskit/icon/core/migration/calendar--editor-date';
|
|
16
16
|
import DecisionIcon from '@atlaskit/icon/core/migration/decision--editor-decision';
|
|
@@ -218,7 +218,7 @@ export const status = mem(init => from({
|
|
|
218
218
|
tooltipDescription: init.tooltipDescription,
|
|
219
219
|
disabled: init.disabled,
|
|
220
220
|
name: 'status',
|
|
221
|
-
Icon: () => jsx(
|
|
221
|
+
Icon: () => jsx(LozengeIcon, {
|
|
222
222
|
label: "",
|
|
223
223
|
color: "currentColor",
|
|
224
224
|
spacing: "spacious",
|
package/dist/esm/plugin.js
CHANGED
|
@@ -326,13 +326,13 @@ function ToolbarInsertBlockWithInjectionApi(_ref3) {
|
|
|
326
326
|
}
|
|
327
327
|
};
|
|
328
328
|
var emojiProvider = getEmojiProvider();
|
|
329
|
-
var onShowMediaPicker = function onShowMediaPicker(
|
|
329
|
+
var onShowMediaPicker = function onShowMediaPicker(mountInfo) {
|
|
330
330
|
if (!mediaState) {
|
|
331
331
|
return;
|
|
332
332
|
}
|
|
333
333
|
if (editorExperiment('add-media-from-url', true)) {
|
|
334
334
|
var _pluginInjectionApi$c, _pluginInjectionApi$m;
|
|
335
|
-
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(
|
|
335
|
+
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));
|
|
336
336
|
} else {
|
|
337
337
|
mediaState.showMediaPicker();
|
|
338
338
|
}
|
|
@@ -66,10 +66,10 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
66
66
|
function ToolbarInsertBlock() {
|
|
67
67
|
var _this;
|
|
68
68
|
_classCallCheck(this, ToolbarInsertBlock);
|
|
69
|
-
for (var _len = arguments.length,
|
|
70
|
-
|
|
69
|
+
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
70
|
+
_args[_key] = arguments[_key];
|
|
71
71
|
}
|
|
72
|
-
_this = _super.call.apply(_super, [this].concat(
|
|
72
|
+
_this = _super.call.apply(_super, [this].concat(_args));
|
|
73
73
|
_defineProperty(_assertThisInitialized(_this), "tableButtonRef", /*#__PURE__*/React.createRef());
|
|
74
74
|
_defineProperty(_assertThisInitialized(_this), "tableSelectorButtonRef", /*#__PURE__*/React.createRef());
|
|
75
75
|
_defineProperty(_assertThisInitialized(_this), "unregisterToggleDropdownMenuOptions", null);
|
|
@@ -363,7 +363,12 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
363
363
|
onShowMediaPicker = _this$props5.onShowMediaPicker,
|
|
364
364
|
dispatchAnalyticsEvent = _this$props5.dispatchAnalyticsEvent;
|
|
365
365
|
if (onShowMediaPicker) {
|
|
366
|
-
|
|
366
|
+
var _this$props$popupsMou;
|
|
367
|
+
var args = _this.mediaButtonRef ? {
|
|
368
|
+
ref: _this.mediaButtonRef,
|
|
369
|
+
mountPoint: (_this$props$popupsMou = _this.props.popupsMountPoint) !== null && _this$props$popupsMou !== void 0 ? _this$props$popupsMou : _this.mediaButtonRef
|
|
370
|
+
} : undefined;
|
|
371
|
+
onShowMediaPicker(args);
|
|
367
372
|
if (dispatchAnalyticsEvent) {
|
|
368
373
|
dispatchAnalyticsEvent({
|
|
369
374
|
action: ACTION.OPENED,
|
|
@@ -10,7 +10,7 @@ import memoizeOne from 'memoize-one';
|
|
|
10
10
|
import { addLink, getAriaKeyshortcuts, toggleTable, tooltip } from '@atlaskit/editor-common/keymaps';
|
|
11
11
|
import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
|
|
12
12
|
import FieldTextIcon from '@atlaskit/icon-lab/core/field-text';
|
|
13
|
-
import
|
|
13
|
+
import LozengeIcon from '@atlaskit/icon-lab/core/lozenge';
|
|
14
14
|
import AngleBracketsIcon from '@atlaskit/icon/core/migration/angle-brackets--editor-code';
|
|
15
15
|
import CalendarIcon from '@atlaskit/icon/core/migration/calendar--editor-date';
|
|
16
16
|
import DecisionIcon from '@atlaskit/icon/core/migration/decision--editor-decision';
|
|
@@ -262,7 +262,7 @@ export var status = mem(function (init) {
|
|
|
262
262
|
disabled: init.disabled,
|
|
263
263
|
name: 'status',
|
|
264
264
|
Icon: function Icon() {
|
|
265
|
-
return jsx(
|
|
265
|
+
return jsx(LozengeIcon, {
|
|
266
266
|
label: "",
|
|
267
267
|
color: "currentColor",
|
|
268
268
|
spacing: "spacious",
|
|
@@ -42,7 +42,10 @@ export interface Props {
|
|
|
42
42
|
insertMenuItems?: MenuItem[];
|
|
43
43
|
showElementBrowserLink?: boolean;
|
|
44
44
|
showSeparator?: boolean;
|
|
45
|
-
onShowMediaPicker?: (
|
|
45
|
+
onShowMediaPicker?: (mountInfo?: {
|
|
46
|
+
ref: HTMLElement;
|
|
47
|
+
mountPoint: HTMLElement;
|
|
48
|
+
}) => void;
|
|
46
49
|
onInsertBlockType?: (name: string) => Command;
|
|
47
50
|
onInsertMacroFromMacroBrowser?: (macroProvider: MacroProvider, node?: PMNode, isEditing?: boolean) => (view: EditorView) => void;
|
|
48
51
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
|
@@ -42,7 +42,10 @@ export interface Props {
|
|
|
42
42
|
insertMenuItems?: MenuItem[];
|
|
43
43
|
showElementBrowserLink?: boolean;
|
|
44
44
|
showSeparator?: boolean;
|
|
45
|
-
onShowMediaPicker?: (
|
|
45
|
+
onShowMediaPicker?: (mountInfo?: {
|
|
46
|
+
ref: HTMLElement;
|
|
47
|
+
mountPoint: HTMLElement;
|
|
48
|
+
}) => void;
|
|
46
49
|
onInsertBlockType?: (name: string) => Command;
|
|
47
50
|
onInsertMacroFromMacroBrowser?: (macroProvider: MacroProvider, node?: PMNode, isEditing?: boolean) => (view: EditorView) => void;
|
|
48
51
|
dispatchAnalyticsEvent?: DispatchAnalyticsEvent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.7",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"@atlaskit/editor-shared-styles": "^3.0.0",
|
|
61
61
|
"@atlaskit/emoji": "^67.8.0",
|
|
62
62
|
"@atlaskit/heading": "2.4.6",
|
|
63
|
-
"@atlaskit/icon": "^22.
|
|
64
|
-
"@atlaskit/icon-lab": "^0.
|
|
63
|
+
"@atlaskit/icon": "^22.20.0",
|
|
64
|
+
"@atlaskit/icon-lab": "^1.0.0",
|
|
65
65
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
66
66
|
"@atlaskit/primitives": "^12.2.0",
|
|
67
67
|
"@atlaskit/theme": "^13.0.0",
|