@atlaskit/editor-plugin-insert-block 0.3.6 → 1.0.1
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 +13 -1
- package/dist/cjs/ui/ToolbarInsertBlock/table-selector-popup-with-listeners.js +1 -0
- package/dist/es2019/ui/ToolbarInsertBlock/index.js +13 -1
- package/dist/es2019/ui/ToolbarInsertBlock/table-selector-popup-with-listeners.js +1 -0
- package/dist/esm/ui/ToolbarInsertBlock/index.js +13 -1
- package/dist/esm/ui/ToolbarInsertBlock/table-selector-popup-with-listeners.js +1 -0
- package/dist/types/ui/ToolbarInsertBlock/table-selector-popup-with-listeners.d.ts +1 -0
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/table-selector-popup-with-listeners.d.ts +1 -0
- package/package.json +19 -19
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#72440](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72440) [`eee41a9f4bda`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/eee41a9f4bda) - [ux] Ensures that when a table is inserted via popup, the table has a blinking cursor.
|
|
8
|
+
|
|
9
|
+
## 1.0.0
|
|
10
|
+
|
|
11
|
+
### Major Changes
|
|
12
|
+
|
|
13
|
+
- [#72386](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/72386) [`0c52b0be40c1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0c52b0be40c1) - This changeset exists to bump all editor plugins that currently don't have a major version. This is to address an issue with Jira plugin consumption.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 0.3.6
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -541,13 +541,25 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
541
541
|
var _this$props13 = this.props,
|
|
542
542
|
popupsMountPoint = _this$props13.popupsMountPoint,
|
|
543
543
|
popupsBoundariesElement = _this$props13.popupsBoundariesElement,
|
|
544
|
-
popupsScrollableElement = _this$props13.popupsScrollableElement
|
|
544
|
+
popupsScrollableElement = _this$props13.popupsScrollableElement,
|
|
545
|
+
pluginInjectionApi = _this$props13.pluginInjectionApi;
|
|
545
546
|
var ref = (_this$tableButtonRef$ = this.tableButtonRef.current) !== null && _this$tableButtonRef$ !== void 0 ? _this$tableButtonRef$ : undefined;
|
|
546
547
|
if (!isTableSelectorOpen) {
|
|
547
548
|
return null;
|
|
548
549
|
}
|
|
550
|
+
|
|
551
|
+
// We use focusTrap in the Popup. When we insert a table via popup,
|
|
552
|
+
// the popup closes, focusTrap gets destroyed and the popup detaches.
|
|
553
|
+
// The focus gets set to the body element. onUnmount method sets focus on the editor right before the
|
|
554
|
+
// Popup will be unmounted to ensure that the new table has a selection with a blinking cursor.
|
|
555
|
+
// So we can start typing right away.
|
|
556
|
+
var onUnmount = function onUnmount() {
|
|
557
|
+
var _pluginInjectionApi$c7;
|
|
558
|
+
return pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c7 = pluginInjectionApi.core) === null || _pluginInjectionApi$c7 === void 0 || (_pluginInjectionApi$c7 = _pluginInjectionApi$c7.actions) === null || _pluginInjectionApi$c7 === void 0 ? void 0 : _pluginInjectionApi$c7.focus();
|
|
559
|
+
};
|
|
549
560
|
return (0, _react2.jsx)(_tableSelectorPopupWithListeners.default, {
|
|
550
561
|
target: ref,
|
|
562
|
+
onUnmount: onUnmount,
|
|
551
563
|
onSelection: this.handleSelectedTableSize,
|
|
552
564
|
popupsMountPoint: popupsMountPoint,
|
|
553
565
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
@@ -232,6 +232,7 @@ var TableSelectorPopup = exports.TableSelectorPopup = function TableSelectorPopu
|
|
|
232
232
|
boundariesElement: props.popupsBoundariesElement,
|
|
233
233
|
scrollableElement: props.popupsScrollableElement,
|
|
234
234
|
focusTrap: true,
|
|
235
|
+
onUnmount: props.onUnmount,
|
|
235
236
|
zIndex: _editorSharedStyles.akEditorMenuZIndex
|
|
236
237
|
}, (0, _react2.jsx)("div", {
|
|
237
238
|
css: tableSelectorPopupWrapperStyles,
|
|
@@ -597,14 +597,26 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
597
597
|
const {
|
|
598
598
|
popupsMountPoint,
|
|
599
599
|
popupsBoundariesElement,
|
|
600
|
-
popupsScrollableElement
|
|
600
|
+
popupsScrollableElement,
|
|
601
|
+
pluginInjectionApi
|
|
601
602
|
} = this.props;
|
|
602
603
|
const ref = (_this$tableButtonRef$ = this.tableButtonRef.current) !== null && _this$tableButtonRef$ !== void 0 ? _this$tableButtonRef$ : undefined;
|
|
603
604
|
if (!isTableSelectorOpen) {
|
|
604
605
|
return null;
|
|
605
606
|
}
|
|
607
|
+
|
|
608
|
+
// We use focusTrap in the Popup. When we insert a table via popup,
|
|
609
|
+
// the popup closes, focusTrap gets destroyed and the popup detaches.
|
|
610
|
+
// The focus gets set to the body element. onUnmount method sets focus on the editor right before the
|
|
611
|
+
// Popup will be unmounted to ensure that the new table has a selection with a blinking cursor.
|
|
612
|
+
// So we can start typing right away.
|
|
613
|
+
const onUnmount = () => {
|
|
614
|
+
var _pluginInjectionApi$c7, _pluginInjectionApi$c8;
|
|
615
|
+
return pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c7 = pluginInjectionApi.core) === null || _pluginInjectionApi$c7 === void 0 ? void 0 : (_pluginInjectionApi$c8 = _pluginInjectionApi$c7.actions) === null || _pluginInjectionApi$c8 === void 0 ? void 0 : _pluginInjectionApi$c8.focus();
|
|
616
|
+
};
|
|
606
617
|
return jsx(TableSelectorPopup, {
|
|
607
618
|
target: ref,
|
|
619
|
+
onUnmount: onUnmount,
|
|
608
620
|
onSelection: this.handleSelectedTableSize,
|
|
609
621
|
popupsMountPoint: popupsMountPoint,
|
|
610
622
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
@@ -222,6 +222,7 @@ export const TableSelectorPopup = props => {
|
|
|
222
222
|
boundariesElement: props.popupsBoundariesElement,
|
|
223
223
|
scrollableElement: props.popupsScrollableElement,
|
|
224
224
|
focusTrap: true,
|
|
225
|
+
onUnmount: props.onUnmount,
|
|
225
226
|
zIndex: akEditorMenuZIndex
|
|
226
227
|
}, jsx("div", {
|
|
227
228
|
css: tableSelectorPopupWrapperStyles,
|
|
@@ -531,13 +531,25 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
531
531
|
var _this$props13 = this.props,
|
|
532
532
|
popupsMountPoint = _this$props13.popupsMountPoint,
|
|
533
533
|
popupsBoundariesElement = _this$props13.popupsBoundariesElement,
|
|
534
|
-
popupsScrollableElement = _this$props13.popupsScrollableElement
|
|
534
|
+
popupsScrollableElement = _this$props13.popupsScrollableElement,
|
|
535
|
+
pluginInjectionApi = _this$props13.pluginInjectionApi;
|
|
535
536
|
var ref = (_this$tableButtonRef$ = this.tableButtonRef.current) !== null && _this$tableButtonRef$ !== void 0 ? _this$tableButtonRef$ : undefined;
|
|
536
537
|
if (!isTableSelectorOpen) {
|
|
537
538
|
return null;
|
|
538
539
|
}
|
|
540
|
+
|
|
541
|
+
// We use focusTrap in the Popup. When we insert a table via popup,
|
|
542
|
+
// the popup closes, focusTrap gets destroyed and the popup detaches.
|
|
543
|
+
// The focus gets set to the body element. onUnmount method sets focus on the editor right before the
|
|
544
|
+
// Popup will be unmounted to ensure that the new table has a selection with a blinking cursor.
|
|
545
|
+
// So we can start typing right away.
|
|
546
|
+
var onUnmount = function onUnmount() {
|
|
547
|
+
var _pluginInjectionApi$c7;
|
|
548
|
+
return pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c7 = pluginInjectionApi.core) === null || _pluginInjectionApi$c7 === void 0 || (_pluginInjectionApi$c7 = _pluginInjectionApi$c7.actions) === null || _pluginInjectionApi$c7 === void 0 ? void 0 : _pluginInjectionApi$c7.focus();
|
|
549
|
+
};
|
|
539
550
|
return jsx(TableSelectorPopup, {
|
|
540
551
|
target: ref,
|
|
552
|
+
onUnmount: onUnmount,
|
|
541
553
|
onSelection: this.handleSelectedTableSize,
|
|
542
554
|
popupsMountPoint: popupsMountPoint,
|
|
543
555
|
popupsBoundariesElement: popupsBoundariesElement,
|
|
@@ -224,6 +224,7 @@ export var TableSelectorPopup = function TableSelectorPopup(props) {
|
|
|
224
224
|
boundariesElement: props.popupsBoundariesElement,
|
|
225
225
|
scrollableElement: props.popupsScrollableElement,
|
|
226
226
|
focusTrap: true,
|
|
227
|
+
onUnmount: props.onUnmount,
|
|
227
228
|
zIndex: akEditorMenuZIndex
|
|
228
229
|
}, jsx("div", {
|
|
229
230
|
css: tableSelectorPopupWrapperStyles,
|
|
@@ -3,6 +3,7 @@ import { jsx } from '@emotion/react';
|
|
|
3
3
|
import type { OnTableSizeSelection } from './table-selector-popup';
|
|
4
4
|
type SimpleEventHandler<T> = (event: T) => void;
|
|
5
5
|
export interface TableSelectorPopupProps {
|
|
6
|
+
onUnmount?: () => void;
|
|
6
7
|
onSelection: OnTableSizeSelection;
|
|
7
8
|
target?: HTMLElement;
|
|
8
9
|
popupsMountPoint?: HTMLElement;
|
|
@@ -3,6 +3,7 @@ import { jsx } from '@emotion/react';
|
|
|
3
3
|
import type { OnTableSizeSelection } from './table-selector-popup';
|
|
4
4
|
type SimpleEventHandler<T> = (event: T) => void;
|
|
5
5
|
export interface TableSelectorPopupProps {
|
|
6
|
+
onUnmount?: () => void;
|
|
6
7
|
onSelection: OnTableSizeSelection;
|
|
7
8
|
target?: HTMLElement;
|
|
8
9
|
popupsMountPoint?: HTMLElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,34 +34,34 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/editor-common": "^77.4.0",
|
|
37
|
-
"@atlaskit/editor-plugin-analytics": "^0.
|
|
37
|
+
"@atlaskit/editor-plugin-analytics": "^1.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-block-type": "^3.0.0",
|
|
39
|
-
"@atlaskit/editor-plugin-code-block": "^
|
|
40
|
-
"@atlaskit/editor-plugin-date": "^0.
|
|
39
|
+
"@atlaskit/editor-plugin-code-block": "^1.0.0",
|
|
40
|
+
"@atlaskit/editor-plugin-date": "^1.0.0",
|
|
41
41
|
"@atlaskit/editor-plugin-emoji": "^1.1.0",
|
|
42
|
-
"@atlaskit/editor-plugin-expand": "^0.
|
|
43
|
-
"@atlaskit/editor-plugin-extension": "^0.
|
|
42
|
+
"@atlaskit/editor-plugin-expand": "^1.0.0",
|
|
43
|
+
"@atlaskit/editor-plugin-extension": "^1.0.0",
|
|
44
44
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
45
|
-
"@atlaskit/editor-plugin-hyperlink": "^0.
|
|
46
|
-
"@atlaskit/editor-plugin-image-upload": "^0.
|
|
47
|
-
"@atlaskit/editor-plugin-layout": "^
|
|
48
|
-
"@atlaskit/editor-plugin-media": "^0.
|
|
49
|
-
"@atlaskit/editor-plugin-mentions": "^0.
|
|
50
|
-
"@atlaskit/editor-plugin-panel": "^0.
|
|
51
|
-
"@atlaskit/editor-plugin-placeholder-text": "^
|
|
52
|
-
"@atlaskit/editor-plugin-quick-insert": "^0.
|
|
53
|
-
"@atlaskit/editor-plugin-rule": "^
|
|
54
|
-
"@atlaskit/editor-plugin-status": "^0.
|
|
45
|
+
"@atlaskit/editor-plugin-hyperlink": "^1.0.0",
|
|
46
|
+
"@atlaskit/editor-plugin-image-upload": "^1.0.0",
|
|
47
|
+
"@atlaskit/editor-plugin-layout": "^1.0.0",
|
|
48
|
+
"@atlaskit/editor-plugin-media": "^1.0.0",
|
|
49
|
+
"@atlaskit/editor-plugin-mentions": "^1.0.0",
|
|
50
|
+
"@atlaskit/editor-plugin-panel": "^1.0.0",
|
|
51
|
+
"@atlaskit/editor-plugin-placeholder-text": "^1.0.0",
|
|
52
|
+
"@atlaskit/editor-plugin-quick-insert": "^1.0.0",
|
|
53
|
+
"@atlaskit/editor-plugin-rule": "^1.0.0",
|
|
54
|
+
"@atlaskit/editor-plugin-status": "^1.0.0",
|
|
55
55
|
"@atlaskit/editor-plugin-table": "^7.3.0",
|
|
56
|
-
"@atlaskit/editor-plugin-tasks-and-decisions": "^0.
|
|
57
|
-
"@atlaskit/editor-plugin-type-ahead": "^0.
|
|
56
|
+
"@atlaskit/editor-plugin-tasks-and-decisions": "^1.0.0",
|
|
57
|
+
"@atlaskit/editor-plugin-type-ahead": "^1.0.0",
|
|
58
58
|
"@atlaskit/editor-prosemirror": "3.0.0",
|
|
59
59
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
60
60
|
"@atlaskit/emoji": "^67.6.0",
|
|
61
61
|
"@atlaskit/icon": "^22.0.0",
|
|
62
62
|
"@atlaskit/primitives": "^2.0.0",
|
|
63
63
|
"@atlaskit/theme": "^12.6.0",
|
|
64
|
-
"@atlaskit/tokens": "^1.
|
|
64
|
+
"@atlaskit/tokens": "^1.37.0",
|
|
65
65
|
"@babel/runtime": "^7.0.0",
|
|
66
66
|
"@emotion/react": "^11.7.1",
|
|
67
67
|
"bind-event-listener": "^2.1.1",
|