@atlaskit/editor-plugin-insert-block 1.1.8 → 1.2.0
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/ui/ToolbarInsertBlock/index.js +9 -3
- package/dist/cjs/ui/ToolbarInsertBlock/styles.js +11 -4
- package/dist/es2019/ui/ToolbarInsertBlock/index.js +5 -0
- package/dist/es2019/ui/ToolbarInsertBlock/styles.js +10 -14
- package/dist/esm/ui/ToolbarInsertBlock/index.js +9 -3
- package/dist/esm/ui/ToolbarInsertBlock/styles.js +11 -3
- package/package.json +26 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#91934](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91934) [`b76a78c6a199`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b76a78c6a199) - bumped editor-prosemirror version to 4.0.0
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 1.1.9
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#85055](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/85055) [`0eb5901fd1e7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0eb5901fd1e7) - Fix the editor not focusing after inserting an emoji from the toolbar.
|
|
18
|
+
|
|
3
19
|
## 1.1.8
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -500,6 +500,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
500
500
|
}, {
|
|
501
501
|
key: "renderPopup",
|
|
502
502
|
value: function renderPopup() {
|
|
503
|
+
var _this2 = this;
|
|
503
504
|
var emojiPickerOpen = this.state.emojiPickerOpen;
|
|
504
505
|
var _this$props12 = this.props,
|
|
505
506
|
popupsMountPoint = _this$props12.popupsMountPoint,
|
|
@@ -516,6 +517,10 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
516
517
|
if (!emojiPickerOpen || !ref || !emojiProvider) {
|
|
517
518
|
return null;
|
|
518
519
|
}
|
|
520
|
+
var onUnmount = function onUnmount() {
|
|
521
|
+
var _this2$props$pluginIn;
|
|
522
|
+
return (_this2$props$pluginIn = _this2.props.pluginInjectionApi) === null || _this2$props$pluginIn === void 0 || (_this2$props$pluginIn = _this2$props$pluginIn.core) === null || _this2$props$pluginIn === void 0 || (_this2$props$pluginIn = _this2$props$pluginIn.actions) === null || _this2$props$pluginIn === void 0 ? void 0 : _this2$props$pluginIn.focus();
|
|
523
|
+
};
|
|
519
524
|
return (0, _react2.jsx)(_ui.Popup, {
|
|
520
525
|
target: ref,
|
|
521
526
|
fitHeight: 350,
|
|
@@ -524,6 +529,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
524
529
|
mountTo: popupsMountPoint,
|
|
525
530
|
boundariesElement: popupsBoundariesElement,
|
|
526
531
|
scrollableElement: popupsScrollableElement,
|
|
532
|
+
onUnmount: onUnmount,
|
|
527
533
|
focusTrap: true,
|
|
528
534
|
zIndex: _editorSharedStyles.akEditorMenuZIndex
|
|
529
535
|
}, (0, _react2.jsx)(EmojiPickerWithListeners, {
|
|
@@ -574,7 +580,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
574
580
|
}, {
|
|
575
581
|
key: "render",
|
|
576
582
|
value: function render() {
|
|
577
|
-
var
|
|
583
|
+
var _this3 = this,
|
|
578
584
|
_tableButton,
|
|
579
585
|
_tableButton2,
|
|
580
586
|
_tableButton3,
|
|
@@ -632,7 +638,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
632
638
|
return (0, _react2.jsx)(_uiMenu.ToolbarButton, {
|
|
633
639
|
item: btn,
|
|
634
640
|
testId: String(btn.content),
|
|
635
|
-
ref: btn.value.name === 'emoji' ?
|
|
641
|
+
ref: btn.value.name === 'emoji' ? _this3.handleEmojiButtonRef : noop,
|
|
636
642
|
key: btn.value.name,
|
|
637
643
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
638
644
|
disabled: isDisabled || btn.isDisabled,
|
|
@@ -642,7 +648,7 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
642
648
|
"aria-label": btn['aria-label'],
|
|
643
649
|
"aria-haspopup": btn['aria-haspopup'],
|
|
644
650
|
"aria-keyshortcuts": btn['aria-keyshortcuts'],
|
|
645
|
-
onItemClick:
|
|
651
|
+
onItemClick: _this3.insertToolbarMenuItem
|
|
646
652
|
});
|
|
647
653
|
}), this.props.tableSelectorSupported && (0, _react2.jsx)("div", {
|
|
648
654
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.triggerWrapper = void 0;
|
|
8
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
7
|
var _react = require("@emotion/react");
|
|
10
|
-
var
|
|
11
|
-
|
|
8
|
+
var triggerWrapper = exports.triggerWrapper = (0, _react.css)({
|
|
9
|
+
width: '42px',
|
|
10
|
+
display: 'flex',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
'> div, > span': {
|
|
13
|
+
display: 'flex'
|
|
14
|
+
},
|
|
15
|
+
'> div > div': {
|
|
16
|
+
display: 'flex'
|
|
17
|
+
}
|
|
18
|
+
});
|
|
@@ -573,6 +573,10 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
573
573
|
if (!emojiPickerOpen || !ref || !emojiProvider) {
|
|
574
574
|
return null;
|
|
575
575
|
}
|
|
576
|
+
const onUnmount = () => {
|
|
577
|
+
var _this$props$pluginInj, _this$props$pluginInj2, _this$props$pluginInj3;
|
|
578
|
+
return (_this$props$pluginInj = this.props.pluginInjectionApi) === null || _this$props$pluginInj === void 0 ? void 0 : (_this$props$pluginInj2 = _this$props$pluginInj.core) === null || _this$props$pluginInj2 === void 0 ? void 0 : (_this$props$pluginInj3 = _this$props$pluginInj2.actions) === null || _this$props$pluginInj3 === void 0 ? void 0 : _this$props$pluginInj3.focus();
|
|
579
|
+
};
|
|
576
580
|
return jsx(Popup, {
|
|
577
581
|
target: ref,
|
|
578
582
|
fitHeight: 350,
|
|
@@ -581,6 +585,7 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
581
585
|
mountTo: popupsMountPoint,
|
|
582
586
|
boundariesElement: popupsBoundariesElement,
|
|
583
587
|
scrollableElement: popupsScrollableElement,
|
|
588
|
+
onUnmount: onUnmount,
|
|
584
589
|
focusTrap: true,
|
|
585
590
|
zIndex: akEditorMenuZIndex
|
|
586
591
|
}, jsx(EmojiPickerWithListeners, {
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
|
-
export const triggerWrapper = css
|
|
3
|
-
width: 42px
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
>
|
|
10
|
-
display: flex
|
|
2
|
+
export const triggerWrapper = css({
|
|
3
|
+
width: '42px',
|
|
4
|
+
display: 'flex',
|
|
5
|
+
alignItems: 'center',
|
|
6
|
+
'> div, > span': {
|
|
7
|
+
display: 'flex'
|
|
8
|
+
},
|
|
9
|
+
'> div > div': {
|
|
10
|
+
display: 'flex'
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
> div > div {
|
|
14
|
-
display: flex;
|
|
15
|
-
}
|
|
16
|
-
`;
|
|
12
|
+
});
|
|
@@ -490,6 +490,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
490
490
|
}, {
|
|
491
491
|
key: "renderPopup",
|
|
492
492
|
value: function renderPopup() {
|
|
493
|
+
var _this2 = this;
|
|
493
494
|
var emojiPickerOpen = this.state.emojiPickerOpen;
|
|
494
495
|
var _this$props12 = this.props,
|
|
495
496
|
popupsMountPoint = _this$props12.popupsMountPoint,
|
|
@@ -506,6 +507,10 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
506
507
|
if (!emojiPickerOpen || !ref || !emojiProvider) {
|
|
507
508
|
return null;
|
|
508
509
|
}
|
|
510
|
+
var onUnmount = function onUnmount() {
|
|
511
|
+
var _this2$props$pluginIn;
|
|
512
|
+
return (_this2$props$pluginIn = _this2.props.pluginInjectionApi) === null || _this2$props$pluginIn === void 0 || (_this2$props$pluginIn = _this2$props$pluginIn.core) === null || _this2$props$pluginIn === void 0 || (_this2$props$pluginIn = _this2$props$pluginIn.actions) === null || _this2$props$pluginIn === void 0 ? void 0 : _this2$props$pluginIn.focus();
|
|
513
|
+
};
|
|
509
514
|
return jsx(Popup, {
|
|
510
515
|
target: ref,
|
|
511
516
|
fitHeight: 350,
|
|
@@ -514,6 +519,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
514
519
|
mountTo: popupsMountPoint,
|
|
515
520
|
boundariesElement: popupsBoundariesElement,
|
|
516
521
|
scrollableElement: popupsScrollableElement,
|
|
522
|
+
onUnmount: onUnmount,
|
|
517
523
|
focusTrap: true,
|
|
518
524
|
zIndex: akEditorMenuZIndex
|
|
519
525
|
}, jsx(EmojiPickerWithListeners, {
|
|
@@ -564,7 +570,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
564
570
|
}, {
|
|
565
571
|
key: "render",
|
|
566
572
|
value: function render() {
|
|
567
|
-
var
|
|
573
|
+
var _this3 = this,
|
|
568
574
|
_tableButton,
|
|
569
575
|
_tableButton2,
|
|
570
576
|
_tableButton3,
|
|
@@ -622,7 +628,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
622
628
|
return jsx(ToolbarButton, {
|
|
623
629
|
item: btn,
|
|
624
630
|
testId: String(btn.content),
|
|
625
|
-
ref: btn.value.name === 'emoji' ?
|
|
631
|
+
ref: btn.value.name === 'emoji' ? _this3.handleEmojiButtonRef : noop,
|
|
626
632
|
key: btn.value.name,
|
|
627
633
|
spacing: isReducedSpacing ? 'none' : 'default',
|
|
628
634
|
disabled: isDisabled || btn.isDisabled,
|
|
@@ -632,7 +638,7 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
632
638
|
"aria-label": btn['aria-label'],
|
|
633
639
|
"aria-haspopup": btn['aria-haspopup'],
|
|
634
640
|
"aria-keyshortcuts": btn['aria-keyshortcuts'],
|
|
635
|
-
onItemClick:
|
|
641
|
+
onItemClick: _this3.insertToolbarMenuItem
|
|
636
642
|
});
|
|
637
643
|
}), this.props.tableSelectorSupported && jsx("div", {
|
|
638
644
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
1
|
import { css } from '@emotion/react';
|
|
4
|
-
export var triggerWrapper = css(
|
|
2
|
+
export var triggerWrapper = css({
|
|
3
|
+
width: '42px',
|
|
4
|
+
display: 'flex',
|
|
5
|
+
alignItems: 'center',
|
|
6
|
+
'> div, > span': {
|
|
7
|
+
display: 'flex'
|
|
8
|
+
},
|
|
9
|
+
'> div > div': {
|
|
10
|
+
display: 'flex'
|
|
11
|
+
}
|
|
12
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,34 +33,34 @@
|
|
|
33
33
|
".": "./src/index.ts"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@atlaskit/editor-common": "^78.
|
|
37
|
-
"@atlaskit/editor-plugin-analytics": "^1.
|
|
38
|
-
"@atlaskit/editor-plugin-block-type": "^3.
|
|
39
|
-
"@atlaskit/editor-plugin-code-block": "^1.
|
|
40
|
-
"@atlaskit/editor-plugin-date": "^1.
|
|
41
|
-
"@atlaskit/editor-plugin-emoji": "^1.
|
|
42
|
-
"@atlaskit/editor-plugin-expand": "^1.
|
|
43
|
-
"@atlaskit/editor-plugin-extension": "^1.
|
|
44
|
-
"@atlaskit/editor-plugin-hyperlink": "^1.
|
|
45
|
-
"@atlaskit/editor-plugin-image-upload": "^1.
|
|
46
|
-
"@atlaskit/editor-plugin-layout": "^1.
|
|
47
|
-
"@atlaskit/editor-plugin-media": "^1.
|
|
48
|
-
"@atlaskit/editor-plugin-mentions": "^1.
|
|
49
|
-
"@atlaskit/editor-plugin-panel": "^1.
|
|
50
|
-
"@atlaskit/editor-plugin-placeholder-text": "^1.
|
|
51
|
-
"@atlaskit/editor-plugin-quick-insert": "^1.
|
|
52
|
-
"@atlaskit/editor-plugin-rule": "^1.
|
|
53
|
-
"@atlaskit/editor-plugin-status": "^1.
|
|
54
|
-
"@atlaskit/editor-plugin-table": "^7.
|
|
55
|
-
"@atlaskit/editor-plugin-tasks-and-decisions": "^1.
|
|
56
|
-
"@atlaskit/editor-plugin-type-ahead": "^1.
|
|
57
|
-
"@atlaskit/editor-prosemirror": "
|
|
36
|
+
"@atlaskit/editor-common": "^78.31.0",
|
|
37
|
+
"@atlaskit/editor-plugin-analytics": "^1.1.0",
|
|
38
|
+
"@atlaskit/editor-plugin-block-type": "^3.1.0",
|
|
39
|
+
"@atlaskit/editor-plugin-code-block": "^1.2.0",
|
|
40
|
+
"@atlaskit/editor-plugin-date": "^1.1.0",
|
|
41
|
+
"@atlaskit/editor-plugin-emoji": "^1.2.0",
|
|
42
|
+
"@atlaskit/editor-plugin-expand": "^1.6.0",
|
|
43
|
+
"@atlaskit/editor-plugin-extension": "^1.3.0",
|
|
44
|
+
"@atlaskit/editor-plugin-hyperlink": "^1.6.0",
|
|
45
|
+
"@atlaskit/editor-plugin-image-upload": "^1.1.0",
|
|
46
|
+
"@atlaskit/editor-plugin-layout": "^1.1.0",
|
|
47
|
+
"@atlaskit/editor-plugin-media": "^1.16.0",
|
|
48
|
+
"@atlaskit/editor-plugin-mentions": "^1.1.0",
|
|
49
|
+
"@atlaskit/editor-plugin-panel": "^1.1.0",
|
|
50
|
+
"@atlaskit/editor-plugin-placeholder-text": "^1.1.0",
|
|
51
|
+
"@atlaskit/editor-plugin-quick-insert": "^1.1.0",
|
|
52
|
+
"@atlaskit/editor-plugin-rule": "^1.2.0",
|
|
53
|
+
"@atlaskit/editor-plugin-status": "^1.1.0",
|
|
54
|
+
"@atlaskit/editor-plugin-table": "^7.8.0",
|
|
55
|
+
"@atlaskit/editor-plugin-tasks-and-decisions": "^1.1.0",
|
|
56
|
+
"@atlaskit/editor-plugin-type-ahead": "^1.1.0",
|
|
57
|
+
"@atlaskit/editor-prosemirror": "4.0.0",
|
|
58
58
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
59
59
|
"@atlaskit/emoji": "^67.6.0",
|
|
60
60
|
"@atlaskit/icon": "^22.1.0",
|
|
61
|
-
"@atlaskit/primitives": "^5.
|
|
62
|
-
"@atlaskit/theme": "^12.
|
|
63
|
-
"@atlaskit/tokens": "^1.
|
|
61
|
+
"@atlaskit/primitives": "^5.5.0",
|
|
62
|
+
"@atlaskit/theme": "^12.7.0",
|
|
63
|
+
"@atlaskit/tokens": "^1.43.0",
|
|
64
64
|
"@babel/runtime": "^7.0.0",
|
|
65
65
|
"@emotion/react": "^11.7.1",
|
|
66
66
|
"bind-event-listener": "^2.1.1",
|