@atlaskit/editor-plugin-quick-insert 6.0.0 → 6.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 +6 -0
- package/dist/cjs/ui/ModalElementBrowser/ModalElementBrowser.js +2 -38
- package/dist/es2019/ui/ModalElementBrowser/ModalElementBrowser.js +2 -36
- package/dist/esm/ui/ModalElementBrowser/ModalElementBrowser.js +2 -38
- package/dist/types/ui/ModalElementBrowser/ModalElementBrowser.d.ts +2 -7
- package/dist/types-ts4.5/ui/ModalElementBrowser/ModalElementBrowser.d.ts +2 -7
- package/package.json +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.default = exports.MODAL_WRAPPER_PADDING = void 0;
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
-
var _react =
|
|
10
|
+
var _react = require("react");
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _reactIntlNext = require("react-intl-next");
|
|
13
13
|
var _button = _interopRequireDefault(require("@atlaskit/button"));
|
|
@@ -15,7 +15,6 @@ var _elementBrowser = require("@atlaskit/editor-common/element-browser");
|
|
|
15
15
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
16
16
|
var _questionCircle = _interopRequireDefault(require("@atlaskit/icon/core/migration/question-circle"));
|
|
17
17
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
18
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
19
18
|
var _colors = require("@atlaskit/theme/colors");
|
|
20
19
|
var _categories = require("./categories");
|
|
21
20
|
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); }
|
|
@@ -58,7 +57,6 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
|
|
|
58
57
|
setSelectedItem = _useState2[1];
|
|
59
58
|
var helpUrl = props.helpUrl,
|
|
60
59
|
intl = props.intl,
|
|
61
|
-
onClose = props.onClose,
|
|
62
60
|
onInsertItemFn = props.onInsertItem;
|
|
63
61
|
var onSelectItem = (0, _react.useCallback)(function (item) {
|
|
64
62
|
setSelectedItem(item);
|
|
@@ -77,14 +75,6 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
|
|
|
77
75
|
beforeElement: helpUrl ? HelpLink(helpUrl, intl.formatMessage(_quickInsert.messages.help)) : undefined
|
|
78
76
|
});
|
|
79
77
|
}, [onInsertItem, selectedItem, helpUrl, intl]);
|
|
80
|
-
|
|
81
|
-
// remove when cleaning up platform_editor_modal_element_browser_a11y
|
|
82
|
-
// Since Modal uses stackIndex it's shouldCloseOnEscapePress prop doesn't work.
|
|
83
|
-
var onKeyDown = (0, _react.useCallback)(function (e) {
|
|
84
|
-
if (e.key === 'Escape') {
|
|
85
|
-
onClose();
|
|
86
|
-
}
|
|
87
|
-
}, [onClose]);
|
|
88
78
|
var RenderBody = (0, _react.useCallback)(function () {
|
|
89
79
|
return (0, _react2.jsx)("div", {
|
|
90
80
|
css: wrapperStyles
|
|
@@ -99,7 +89,7 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
|
|
|
99
89
|
emptyStateHandler: props.emptyStateHandler
|
|
100
90
|
}));
|
|
101
91
|
}, [props.intl, props.getItems, onSelectItem, onInsertItem, props.emptyStateHandler]);
|
|
102
|
-
return (0,
|
|
92
|
+
return (0, _react2.jsx)("div", {
|
|
103
93
|
"data-editor-popup": true
|
|
104
94
|
}, (0, _react2.jsx)(_modalDialog.ModalTransition, null, props.isOpen && (0, _react2.jsx)(_modalDialog.default, {
|
|
105
95
|
testId: "element-browser-modal-dialog",
|
|
@@ -110,35 +100,9 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
|
|
|
110
100
|
height: "664px",
|
|
111
101
|
width: "x-large",
|
|
112
102
|
shouldReturnFocus: props.shouldReturnFocus
|
|
113
|
-
}, (0, _react2.jsx)(RenderBody, null), (0, _react2.jsx)(RenderFooter, null)))) :
|
|
114
|
-
// eslint-disable-next-line jsx-a11y/no-static-element-interactions, @atlassian/a11y/interactive-element-not-keyboard-focusable
|
|
115
|
-
(0, _react2.jsx)("div", {
|
|
116
|
-
"data-editor-popup": true,
|
|
117
|
-
onClick: onModalClick,
|
|
118
|
-
onKeyDown: onKeyDown
|
|
119
|
-
}, (0, _react2.jsx)(_modalDialog.ModalTransition, null, props.isOpen && (0, _react2.jsx)(_modalDialog.default, {
|
|
120
|
-
testId: "element-browser-modal-dialog",
|
|
121
|
-
stackIndex: 0,
|
|
122
|
-
key: "element-browser-modal",
|
|
123
|
-
onClose: props.onClose,
|
|
124
|
-
onCloseComplete: props.onCloseComplete,
|
|
125
|
-
height: "664px",
|
|
126
|
-
width: "x-large",
|
|
127
|
-
autoFocus: false,
|
|
128
|
-
shouldReturnFocus: props.shouldReturnFocus
|
|
129
|
-
// defaults to true and doesn't work along with stackIndex=1.
|
|
130
|
-
// packages/design-system/modal-dialog/src/components/Content.tsx Line 287
|
|
131
|
-
,
|
|
132
|
-
shouldCloseOnEscapePress: false
|
|
133
103
|
}, (0, _react2.jsx)(RenderBody, null), (0, _react2.jsx)(RenderFooter, null))));
|
|
134
104
|
};
|
|
135
105
|
ModalElementBrowser.displayName = 'ModalElementBrowser';
|
|
136
|
-
|
|
137
|
-
// remove when cleaning up platform_editor_modal_element_browser_a11y
|
|
138
|
-
// Prevent ModalElementBrowser click propagation through to the editor.
|
|
139
|
-
var onModalClick = function onModalClick(e) {
|
|
140
|
-
return e.stopPropagation();
|
|
141
|
-
};
|
|
142
106
|
var Footer = function Footer(_ref) {
|
|
143
107
|
var onInsert = _ref.onInsert,
|
|
144
108
|
beforeElement = _ref.beforeElement;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import { useCallback, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
@@ -12,7 +12,6 @@ import { ElementBrowser } from '@atlaskit/editor-common/element-browser';
|
|
|
12
12
|
import { messages } from '@atlaskit/editor-common/quick-insert';
|
|
13
13
|
import QuestionCircleIcon from '@atlaskit/icon/core/migration/question-circle';
|
|
14
14
|
import Modal, { ModalTransition, useModal } from '@atlaskit/modal-dialog';
|
|
15
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
15
|
import { N0 } from '@atlaskit/theme/colors';
|
|
17
16
|
import { getCategories } from './categories';
|
|
18
17
|
export const MODAL_WRAPPER_PADDING = 16;
|
|
@@ -45,7 +44,6 @@ const ModalElementBrowser = props => {
|
|
|
45
44
|
const {
|
|
46
45
|
helpUrl,
|
|
47
46
|
intl,
|
|
48
|
-
onClose,
|
|
49
47
|
onInsertItem: onInsertItemFn
|
|
50
48
|
} = props;
|
|
51
49
|
const onSelectItem = useCallback(item => {
|
|
@@ -61,14 +59,6 @@ const ModalElementBrowser = props => {
|
|
|
61
59
|
onInsert: () => onInsertItem(selectedItem),
|
|
62
60
|
beforeElement: helpUrl ? HelpLink(helpUrl, intl.formatMessage(messages.help)) : undefined
|
|
63
61
|
}), [onInsertItem, selectedItem, helpUrl, intl]);
|
|
64
|
-
|
|
65
|
-
// remove when cleaning up platform_editor_modal_element_browser_a11y
|
|
66
|
-
// Since Modal uses stackIndex it's shouldCloseOnEscapePress prop doesn't work.
|
|
67
|
-
const onKeyDown = useCallback(e => {
|
|
68
|
-
if (e.key === 'Escape') {
|
|
69
|
-
onClose();
|
|
70
|
-
}
|
|
71
|
-
}, [onClose]);
|
|
72
62
|
const RenderBody = useCallback(() => jsx("div", {
|
|
73
63
|
css: wrapperStyles
|
|
74
64
|
}, jsx(ElementBrowser, {
|
|
@@ -81,7 +71,7 @@ const ModalElementBrowser = props => {
|
|
|
81
71
|
onInsertItem: onInsertItem,
|
|
82
72
|
emptyStateHandler: props.emptyStateHandler
|
|
83
73
|
})), [props.intl, props.getItems, onSelectItem, onInsertItem, props.emptyStateHandler]);
|
|
84
|
-
return
|
|
74
|
+
return jsx("div", {
|
|
85
75
|
"data-editor-popup": true
|
|
86
76
|
}, jsx(ModalTransition, null, props.isOpen && jsx(Modal, {
|
|
87
77
|
testId: "element-browser-modal-dialog",
|
|
@@ -92,33 +82,9 @@ const ModalElementBrowser = props => {
|
|
|
92
82
|
height: "664px",
|
|
93
83
|
width: "x-large",
|
|
94
84
|
shouldReturnFocus: props.shouldReturnFocus
|
|
95
|
-
}, jsx(RenderBody, null), jsx(RenderFooter, null)))) :
|
|
96
|
-
// eslint-disable-next-line jsx-a11y/no-static-element-interactions, @atlassian/a11y/interactive-element-not-keyboard-focusable
|
|
97
|
-
jsx("div", {
|
|
98
|
-
"data-editor-popup": true,
|
|
99
|
-
onClick: onModalClick,
|
|
100
|
-
onKeyDown: onKeyDown
|
|
101
|
-
}, jsx(ModalTransition, null, props.isOpen && jsx(Modal, {
|
|
102
|
-
testId: "element-browser-modal-dialog",
|
|
103
|
-
stackIndex: 0,
|
|
104
|
-
key: "element-browser-modal",
|
|
105
|
-
onClose: props.onClose,
|
|
106
|
-
onCloseComplete: props.onCloseComplete,
|
|
107
|
-
height: "664px",
|
|
108
|
-
width: "x-large",
|
|
109
|
-
autoFocus: false,
|
|
110
|
-
shouldReturnFocus: props.shouldReturnFocus
|
|
111
|
-
// defaults to true and doesn't work along with stackIndex=1.
|
|
112
|
-
// packages/design-system/modal-dialog/src/components/Content.tsx Line 287
|
|
113
|
-
,
|
|
114
|
-
shouldCloseOnEscapePress: false
|
|
115
85
|
}, jsx(RenderBody, null), jsx(RenderFooter, null))));
|
|
116
86
|
};
|
|
117
87
|
ModalElementBrowser.displayName = 'ModalElementBrowser';
|
|
118
|
-
|
|
119
|
-
// remove when cleaning up platform_editor_modal_element_browser_a11y
|
|
120
|
-
// Prevent ModalElementBrowser click propagation through to the editor.
|
|
121
|
-
const onModalClick = e => e.stopPropagation();
|
|
122
88
|
const Footer = ({
|
|
123
89
|
onInsert,
|
|
124
90
|
beforeElement
|
|
@@ -3,7 +3,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
3
3
|
* @jsxRuntime classic
|
|
4
4
|
* @jsx jsx
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import { useCallback, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { css, jsx } from '@emotion/react';
|
|
@@ -13,7 +13,6 @@ import { ElementBrowser } from '@atlaskit/editor-common/element-browser';
|
|
|
13
13
|
import { messages } from '@atlaskit/editor-common/quick-insert';
|
|
14
14
|
import QuestionCircleIcon from '@atlaskit/icon/core/migration/question-circle';
|
|
15
15
|
import Modal, { ModalTransition, useModal } from '@atlaskit/modal-dialog';
|
|
16
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
16
|
import { N0 } from '@atlaskit/theme/colors';
|
|
18
17
|
import { getCategories } from './categories';
|
|
19
18
|
export var MODAL_WRAPPER_PADDING = 16;
|
|
@@ -48,7 +47,6 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
|
|
|
48
47
|
setSelectedItem = _useState2[1];
|
|
49
48
|
var helpUrl = props.helpUrl,
|
|
50
49
|
intl = props.intl,
|
|
51
|
-
onClose = props.onClose,
|
|
52
50
|
onInsertItemFn = props.onInsertItem;
|
|
53
51
|
var onSelectItem = useCallback(function (item) {
|
|
54
52
|
setSelectedItem(item);
|
|
@@ -67,14 +65,6 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
|
|
|
67
65
|
beforeElement: helpUrl ? HelpLink(helpUrl, intl.formatMessage(messages.help)) : undefined
|
|
68
66
|
});
|
|
69
67
|
}, [onInsertItem, selectedItem, helpUrl, intl]);
|
|
70
|
-
|
|
71
|
-
// remove when cleaning up platform_editor_modal_element_browser_a11y
|
|
72
|
-
// Since Modal uses stackIndex it's shouldCloseOnEscapePress prop doesn't work.
|
|
73
|
-
var onKeyDown = useCallback(function (e) {
|
|
74
|
-
if (e.key === 'Escape') {
|
|
75
|
-
onClose();
|
|
76
|
-
}
|
|
77
|
-
}, [onClose]);
|
|
78
68
|
var RenderBody = useCallback(function () {
|
|
79
69
|
return jsx("div", {
|
|
80
70
|
css: wrapperStyles
|
|
@@ -89,7 +79,7 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
|
|
|
89
79
|
emptyStateHandler: props.emptyStateHandler
|
|
90
80
|
}));
|
|
91
81
|
}, [props.intl, props.getItems, onSelectItem, onInsertItem, props.emptyStateHandler]);
|
|
92
|
-
return
|
|
82
|
+
return jsx("div", {
|
|
93
83
|
"data-editor-popup": true
|
|
94
84
|
}, jsx(ModalTransition, null, props.isOpen && jsx(Modal, {
|
|
95
85
|
testId: "element-browser-modal-dialog",
|
|
@@ -100,35 +90,9 @@ var ModalElementBrowser = function ModalElementBrowser(props) {
|
|
|
100
90
|
height: "664px",
|
|
101
91
|
width: "x-large",
|
|
102
92
|
shouldReturnFocus: props.shouldReturnFocus
|
|
103
|
-
}, jsx(RenderBody, null), jsx(RenderFooter, null)))) :
|
|
104
|
-
// eslint-disable-next-line jsx-a11y/no-static-element-interactions, @atlassian/a11y/interactive-element-not-keyboard-focusable
|
|
105
|
-
jsx("div", {
|
|
106
|
-
"data-editor-popup": true,
|
|
107
|
-
onClick: onModalClick,
|
|
108
|
-
onKeyDown: onKeyDown
|
|
109
|
-
}, jsx(ModalTransition, null, props.isOpen && jsx(Modal, {
|
|
110
|
-
testId: "element-browser-modal-dialog",
|
|
111
|
-
stackIndex: 0,
|
|
112
|
-
key: "element-browser-modal",
|
|
113
|
-
onClose: props.onClose,
|
|
114
|
-
onCloseComplete: props.onCloseComplete,
|
|
115
|
-
height: "664px",
|
|
116
|
-
width: "x-large",
|
|
117
|
-
autoFocus: false,
|
|
118
|
-
shouldReturnFocus: props.shouldReturnFocus
|
|
119
|
-
// defaults to true and doesn't work along with stackIndex=1.
|
|
120
|
-
// packages/design-system/modal-dialog/src/components/Content.tsx Line 287
|
|
121
|
-
,
|
|
122
|
-
shouldCloseOnEscapePress: false
|
|
123
93
|
}, jsx(RenderBody, null), jsx(RenderFooter, null))));
|
|
124
94
|
};
|
|
125
95
|
ModalElementBrowser.displayName = 'ModalElementBrowser';
|
|
126
|
-
|
|
127
|
-
// remove when cleaning up platform_editor_modal_element_browser_a11y
|
|
128
|
-
// Prevent ModalElementBrowser click propagation through to the editor.
|
|
129
|
-
var onModalClick = function onModalClick(e) {
|
|
130
|
-
return e.stopPropagation();
|
|
131
|
-
};
|
|
132
96
|
var Footer = function Footer(_ref) {
|
|
133
97
|
var onInsert = _ref.onInsert,
|
|
134
98
|
beforeElement = _ref.beforeElement;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
1
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
7
2
|
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
8
3
|
import type { EmptyStateHandler } from '@atlaskit/editor-common/types';
|
|
@@ -17,7 +12,7 @@ export interface Props {
|
|
|
17
12
|
onInsertItem: (item: QuickInsertItem) => void;
|
|
18
13
|
shouldReturnFocus?: boolean;
|
|
19
14
|
}
|
|
20
|
-
declare const _default:
|
|
21
|
-
WrappedComponent:
|
|
15
|
+
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
16
|
+
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps>;
|
|
22
17
|
};
|
|
23
18
|
export default _default;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
import React from 'react';
|
|
6
1
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
7
2
|
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
8
3
|
import type { EmptyStateHandler } from '@atlaskit/editor-common/types';
|
|
@@ -17,7 +12,7 @@ export interface Props {
|
|
|
17
12
|
onInsertItem: (item: QuickInsertItem) => void;
|
|
18
13
|
shouldReturnFocus?: boolean;
|
|
19
14
|
}
|
|
20
|
-
declare const _default:
|
|
21
|
-
WrappedComponent:
|
|
15
|
+
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
16
|
+
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps>;
|
|
22
17
|
};
|
|
23
18
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-quick-insert",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "Quick insert plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,19 +32,19 @@
|
|
|
32
32
|
"@atlaskit/button": "^23.4.0",
|
|
33
33
|
"@atlaskit/editor-plugin-connectivity": "^6.0.0",
|
|
34
34
|
"@atlaskit/editor-plugin-metrics": "^7.0.0",
|
|
35
|
-
"@atlaskit/editor-plugin-type-ahead": "^6.
|
|
35
|
+
"@atlaskit/editor-plugin-type-ahead": "^6.1.0",
|
|
36
36
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
37
37
|
"@atlaskit/icon": "^28.3.0",
|
|
38
38
|
"@atlaskit/modal-dialog": "^14.4.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
40
40
|
"@atlaskit/theme": "^21.0.0",
|
|
41
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
42
|
-
"@atlaskit/tokens": "^6.
|
|
41
|
+
"@atlaskit/tmp-editor-statsig": "^13.0.0",
|
|
42
|
+
"@atlaskit/tokens": "^6.4.0",
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
44
44
|
"@emotion/react": "^11.7.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@atlaskit/editor-common": "^110.
|
|
47
|
+
"@atlaskit/editor-common": "^110.4.0",
|
|
48
48
|
"react": "^18.2.0",
|
|
49
49
|
"react-dom": "^18.2.0",
|
|
50
50
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -103,9 +103,6 @@
|
|
|
103
103
|
},
|
|
104
104
|
"platform_editor_controls_fix_view_more_in_comment": {
|
|
105
105
|
"type": "boolean"
|
|
106
|
-
},
|
|
107
|
-
"platform_editor_modal_element_browser_a11y": {
|
|
108
|
-
"type": "boolean"
|
|
109
106
|
}
|
|
110
107
|
}
|
|
111
108
|
}
|