@atlaskit/editor-plugin-insert-block 3.2.10 → 3.2.12
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 +12 -0
- package/dist/cjs/insertBlockPlugin.js +1 -2
- package/dist/cjs/ui/ToolbarInsertBlock/block-insert-element-browser.js +1 -2
- package/dist/cjs/ui/ToolbarInsertBlock/index.js +18 -18
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +4 -4
- package/dist/esm/ui/ToolbarInsertBlock/index.js +18 -18
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -18,8 +18,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
|
18
18
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
19
19
|
var _toggleInsertBlock = require("./pm-plugins/toggleInsertBlock");
|
|
20
20
|
var _ToolbarInsertBlock = _interopRequireDefault(require("./ui/ToolbarInsertBlock"));
|
|
21
|
-
function
|
|
22
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
+
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); }
|
|
23
22
|
// Ignored via go/ees005
|
|
24
23
|
// eslint-disable-next-line import/no-named-as-default
|
|
25
24
|
|
|
@@ -10,8 +10,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
10
10
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
11
11
|
var _InsertMenu = _interopRequireWildcard(require("../ElementBrowser/InsertMenu"));
|
|
12
12
|
var _dropdownButton = require("./dropdown-button");
|
|
13
|
-
function
|
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
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); }
|
|
15
14
|
// This determines how the popup should fit. We prefer the insert menu
|
|
16
15
|
// opening on the bottom as we have a search bar and should only open on
|
|
17
16
|
// top if there is more than sufficient room.
|
|
@@ -431,10 +431,10 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
431
431
|
(0, _defineProperty2.default)(_this, "onItemActivated", function (_ref4) {
|
|
432
432
|
var item = _ref4.item,
|
|
433
433
|
inputMethod = _ref4.inputMethod;
|
|
434
|
-
var _this$
|
|
435
|
-
editorView = _this$
|
|
436
|
-
handleImageUpload = _this$
|
|
437
|
-
expandEnabled = _this$
|
|
434
|
+
var _this$props0 = _this.props,
|
|
435
|
+
editorView = _this$props0.editorView,
|
|
436
|
+
handleImageUpload = _this$props0.handleImageUpload,
|
|
437
|
+
expandEnabled = _this$props0.expandEnabled;
|
|
438
438
|
|
|
439
439
|
// need to do this before inserting nodes so scrollIntoView works properly
|
|
440
440
|
if (!editorView.hasFocus()) {
|
|
@@ -575,11 +575,11 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
575
575
|
value: function renderPopup() {
|
|
576
576
|
var _this2 = this;
|
|
577
577
|
var emojiPickerOpen = this.state.emojiPickerOpen;
|
|
578
|
-
var _this$
|
|
579
|
-
popupsMountPoint = _this$
|
|
580
|
-
popupsBoundariesElement = _this$
|
|
581
|
-
popupsScrollableElement = _this$
|
|
582
|
-
emojiProvider = _this$
|
|
578
|
+
var _this$props1 = this.props,
|
|
579
|
+
popupsMountPoint = _this$props1.popupsMountPoint,
|
|
580
|
+
popupsBoundariesElement = _this$props1.popupsBoundariesElement,
|
|
581
|
+
popupsScrollableElement = _this$props1.popupsScrollableElement,
|
|
582
|
+
emojiProvider = _this$props1.emojiProvider;
|
|
583
583
|
var dropdownEmoji = this.state.dropdownItems.some(function (_ref6) {
|
|
584
584
|
var name = _ref6.value.name;
|
|
585
585
|
return name === 'emoji';
|
|
@@ -620,11 +620,11 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
620
620
|
var _this$state = this.state,
|
|
621
621
|
isTableSelectorOpen = _this$state.isTableSelectorOpen,
|
|
622
622
|
isTableSelectorOpenedByKeyboard = _this$state.isTableSelectorOpenedByKeyboard;
|
|
623
|
-
var _this$
|
|
624
|
-
popupsMountPoint = _this$
|
|
625
|
-
popupsBoundariesElement = _this$
|
|
626
|
-
popupsScrollableElement = _this$
|
|
627
|
-
pluginInjectionApi = _this$
|
|
623
|
+
var _this$props10 = this.props,
|
|
624
|
+
popupsMountPoint = _this$props10.popupsMountPoint,
|
|
625
|
+
popupsBoundariesElement = _this$props10.popupsBoundariesElement,
|
|
626
|
+
popupsScrollableElement = _this$props10.popupsScrollableElement,
|
|
627
|
+
pluginInjectionApi = _this$props10.pluginInjectionApi;
|
|
628
628
|
var ref = (_this$tableButtonRef$ = this.tableButtonRef.current) !== null && _this$tableButtonRef$ !== void 0 ? _this$tableButtonRef$ : undefined;
|
|
629
629
|
if (!isTableSelectorOpen) {
|
|
630
630
|
return null;
|
|
@@ -677,10 +677,10 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
677
677
|
dropdownItems = _this$state2.dropdownItems,
|
|
678
678
|
emojiPickerOpen = _this$state2.emojiPickerOpen,
|
|
679
679
|
isTableSelectorOpen = _this$state2.isTableSelectorOpen;
|
|
680
|
-
var _this$
|
|
681
|
-
isDisabled = _this$
|
|
682
|
-
isReducedSpacing = _this$
|
|
683
|
-
editorAppearance = _this$
|
|
680
|
+
var _this$props11 = this.props,
|
|
681
|
+
isDisabled = _this$props11.isDisabled,
|
|
682
|
+
isReducedSpacing = _this$props11.isReducedSpacing,
|
|
683
|
+
editorAppearance = _this$props11.editorAppearance;
|
|
684
684
|
var isFullPageAppearance = ['full-page', 'full-width'].includes(editorAppearance !== null && editorAppearance !== void 0 ? editorAppearance : '');
|
|
685
685
|
var isTableButtonVisible = buttons.some(function (_ref7) {
|
|
686
686
|
var value = _ref7.value;
|
|
@@ -41,7 +41,7 @@ const InsertMenu = ({
|
|
|
41
41
|
pluginInjectionApi,
|
|
42
42
|
isFullPageAppearance
|
|
43
43
|
}) => {
|
|
44
|
-
var _pluginInjectionApi$q8, _pluginInjectionApi$q9, _pluginInjectionApi$
|
|
44
|
+
var _pluginInjectionApi$q8, _pluginInjectionApi$q9, _pluginInjectionApi$q0;
|
|
45
45
|
const [itemCount, setItemCount] = useState(0);
|
|
46
46
|
const [height, setHeight] = useState(DEFAULT_HEIGHT);
|
|
47
47
|
const cache = useMemo(() => {
|
|
@@ -127,11 +127,11 @@ const InsertMenu = ({
|
|
|
127
127
|
setItemCount(result.length);
|
|
128
128
|
return result;
|
|
129
129
|
}, [pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$q8 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q8 === void 0 ? void 0 : _pluginInjectionApi$q8.actions, quickInsertDropdownItems, connectivityMode]);
|
|
130
|
-
const emptyStateHandler = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$q9 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q9 === void 0 ? void 0 : (_pluginInjectionApi$
|
|
130
|
+
const emptyStateHandler = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$q9 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q9 === void 0 ? void 0 : (_pluginInjectionApi$q0 = _pluginInjectionApi$q9.sharedState.currentState()) === null || _pluginInjectionApi$q0 === void 0 ? void 0 : _pluginInjectionApi$q0.emptyStateHandler;
|
|
131
131
|
const onViewMore = useCallback(() => {
|
|
132
|
-
var _pluginInjectionApi$c, _pluginInjectionApi$
|
|
132
|
+
var _pluginInjectionApi$c, _pluginInjectionApi$q1;
|
|
133
133
|
toggleVisiblity();
|
|
134
|
-
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$
|
|
134
|
+
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$q1 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q1 === void 0 ? void 0 : _pluginInjectionApi$q1.commands.openElementBrowserModal);
|
|
135
135
|
}, [pluginInjectionApi, toggleVisiblity]);
|
|
136
136
|
return (
|
|
137
137
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
@@ -425,10 +425,10 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
425
425
|
_defineProperty(_this, "onItemActivated", function (_ref4) {
|
|
426
426
|
var item = _ref4.item,
|
|
427
427
|
inputMethod = _ref4.inputMethod;
|
|
428
|
-
var _this$
|
|
429
|
-
editorView = _this$
|
|
430
|
-
handleImageUpload = _this$
|
|
431
|
-
expandEnabled = _this$
|
|
428
|
+
var _this$props0 = _this.props,
|
|
429
|
+
editorView = _this$props0.editorView,
|
|
430
|
+
handleImageUpload = _this$props0.handleImageUpload,
|
|
431
|
+
expandEnabled = _this$props0.expandEnabled;
|
|
432
432
|
|
|
433
433
|
// need to do this before inserting nodes so scrollIntoView works properly
|
|
434
434
|
if (!editorView.hasFocus()) {
|
|
@@ -569,11 +569,11 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
569
569
|
value: function renderPopup() {
|
|
570
570
|
var _this2 = this;
|
|
571
571
|
var emojiPickerOpen = this.state.emojiPickerOpen;
|
|
572
|
-
var _this$
|
|
573
|
-
popupsMountPoint = _this$
|
|
574
|
-
popupsBoundariesElement = _this$
|
|
575
|
-
popupsScrollableElement = _this$
|
|
576
|
-
emojiProvider = _this$
|
|
572
|
+
var _this$props1 = this.props,
|
|
573
|
+
popupsMountPoint = _this$props1.popupsMountPoint,
|
|
574
|
+
popupsBoundariesElement = _this$props1.popupsBoundariesElement,
|
|
575
|
+
popupsScrollableElement = _this$props1.popupsScrollableElement,
|
|
576
|
+
emojiProvider = _this$props1.emojiProvider;
|
|
577
577
|
var dropdownEmoji = this.state.dropdownItems.some(function (_ref6) {
|
|
578
578
|
var name = _ref6.value.name;
|
|
579
579
|
return name === 'emoji';
|
|
@@ -614,11 +614,11 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
614
614
|
var _this$state = this.state,
|
|
615
615
|
isTableSelectorOpen = _this$state.isTableSelectorOpen,
|
|
616
616
|
isTableSelectorOpenedByKeyboard = _this$state.isTableSelectorOpenedByKeyboard;
|
|
617
|
-
var _this$
|
|
618
|
-
popupsMountPoint = _this$
|
|
619
|
-
popupsBoundariesElement = _this$
|
|
620
|
-
popupsScrollableElement = _this$
|
|
621
|
-
pluginInjectionApi = _this$
|
|
617
|
+
var _this$props10 = this.props,
|
|
618
|
+
popupsMountPoint = _this$props10.popupsMountPoint,
|
|
619
|
+
popupsBoundariesElement = _this$props10.popupsBoundariesElement,
|
|
620
|
+
popupsScrollableElement = _this$props10.popupsScrollableElement,
|
|
621
|
+
pluginInjectionApi = _this$props10.pluginInjectionApi;
|
|
622
622
|
var ref = (_this$tableButtonRef$ = this.tableButtonRef.current) !== null && _this$tableButtonRef$ !== void 0 ? _this$tableButtonRef$ : undefined;
|
|
623
623
|
if (!isTableSelectorOpen) {
|
|
624
624
|
return null;
|
|
@@ -671,10 +671,10 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
671
671
|
dropdownItems = _this$state2.dropdownItems,
|
|
672
672
|
emojiPickerOpen = _this$state2.emojiPickerOpen,
|
|
673
673
|
isTableSelectorOpen = _this$state2.isTableSelectorOpen;
|
|
674
|
-
var _this$
|
|
675
|
-
isDisabled = _this$
|
|
676
|
-
isReducedSpacing = _this$
|
|
677
|
-
editorAppearance = _this$
|
|
674
|
+
var _this$props11 = this.props,
|
|
675
|
+
isDisabled = _this$props11.isDisabled,
|
|
676
|
+
isReducedSpacing = _this$props11.isReducedSpacing,
|
|
677
|
+
editorAppearance = _this$props11.editorAppearance;
|
|
678
678
|
var isFullPageAppearance = ['full-page', 'full-width'].includes(editorAppearance !== null && editorAppearance !== void 0 ? editorAppearance : '');
|
|
679
679
|
var isTableButtonVisible = buttons.some(function (_ref7) {
|
|
680
680
|
var value = _ref7.value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.12",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/button": "^23.2.0",
|
|
37
|
-
"@atlaskit/editor-common": "^106.
|
|
37
|
+
"@atlaskit/editor-common": "^106.5.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
39
39
|
"@atlaskit/editor-plugin-block-type": "^5.1.0",
|
|
40
40
|
"@atlaskit/editor-plugin-code-block": "^4.4.0",
|
|
41
41
|
"@atlaskit/editor-plugin-connectivity": "^2.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-date": "^4.3.0",
|
|
43
43
|
"@atlaskit/editor-plugin-emoji": "^3.7.0",
|
|
44
|
-
"@atlaskit/editor-plugin-expand": "^3.
|
|
45
|
-
"@atlaskit/editor-plugin-extension": "^5.
|
|
44
|
+
"@atlaskit/editor-plugin-expand": "^3.3.0",
|
|
45
|
+
"@atlaskit/editor-plugin-extension": "^5.5.0",
|
|
46
46
|
"@atlaskit/editor-plugin-feature-flags": "^1.4.0",
|
|
47
47
|
"@atlaskit/editor-plugin-hyperlink": "^4.4.0",
|
|
48
48
|
"@atlaskit/editor-plugin-image-upload": "^2.0.0",
|
|
49
|
-
"@atlaskit/editor-plugin-layout": "^2.
|
|
49
|
+
"@atlaskit/editor-plugin-layout": "^2.9.0",
|
|
50
50
|
"@atlaskit/editor-plugin-media": "^3.0.0",
|
|
51
|
-
"@atlaskit/editor-plugin-media-insert": "^
|
|
51
|
+
"@atlaskit/editor-plugin-media-insert": "^7.0.0",
|
|
52
52
|
"@atlaskit/editor-plugin-mentions": "^4.7.0",
|
|
53
53
|
"@atlaskit/editor-plugin-metrics": "^3.4.0",
|
|
54
54
|
"@atlaskit/editor-plugin-panel": "^4.4.0",
|
|
@@ -57,21 +57,21 @@
|
|
|
57
57
|
"@atlaskit/editor-plugin-quick-insert": "^2.5.0",
|
|
58
58
|
"@atlaskit/editor-plugin-rule": "^2.1.0",
|
|
59
59
|
"@atlaskit/editor-plugin-status": "^3.1.0",
|
|
60
|
-
"@atlaskit/editor-plugin-table": "^10.
|
|
60
|
+
"@atlaskit/editor-plugin-table": "^10.12.0",
|
|
61
61
|
"@atlaskit/editor-plugin-tasks-and-decisions": "^5.1.0",
|
|
62
62
|
"@atlaskit/editor-plugin-type-ahead": "^2.7.0",
|
|
63
63
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
64
64
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
65
|
-
"@atlaskit/emoji": "^69.
|
|
65
|
+
"@atlaskit/emoji": "^69.3.0",
|
|
66
66
|
"@atlaskit/heading": "^5.2.0",
|
|
67
67
|
"@atlaskit/icon": "^26.4.0",
|
|
68
|
-
"@atlaskit/icon-lab": "^4.
|
|
68
|
+
"@atlaskit/icon-lab": "^4.18.0",
|
|
69
69
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
70
70
|
"@atlaskit/primitives": "^14.8.0",
|
|
71
71
|
"@atlaskit/theme": "^18.0.0",
|
|
72
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
73
|
-
"@atlaskit/tokens": "^
|
|
74
|
-
"@atlaskit/tooltip": "^20.
|
|
72
|
+
"@atlaskit/tmp-editor-statsig": "^6.0.0",
|
|
73
|
+
"@atlaskit/tokens": "^5.1.0",
|
|
74
|
+
"@atlaskit/tooltip": "^20.3.0",
|
|
75
75
|
"@babel/runtime": "^7.0.0",
|
|
76
76
|
"@emotion/react": "^11.7.1",
|
|
77
77
|
"bind-event-listener": "^3.0.0",
|