@atlaskit/editor-plugin-insert-block 2.4.16 → 2.4.17
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 +9 -0
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +2 -2
- package/dist/cjs/ui/ToolbarInsertBlock/block-insert-element-browser.js +10 -2
- package/dist/cjs/ui/ToolbarInsertBlock/index.js +2 -3
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -1
- package/dist/es2019/ui/ToolbarInsertBlock/block-insert-element-browser.js +7 -2
- package/dist/es2019/ui/ToolbarInsertBlock/index.js +2 -3
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -1
- package/dist/esm/ui/ToolbarInsertBlock/block-insert-element-browser.js +7 -2
- package/dist/esm/ui/ToolbarInsertBlock/index.js +2 -3
- package/dist/types/ui/ElementBrowser/InsertMenu.d.ts +1 -0
- package/dist/types-ts4.5/ui/ElementBrowser/InsertMenu.d.ts +1 -0
- package/package.json +11 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-insert-block
|
|
2
2
|
|
|
3
|
+
## 2.4.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#171281](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/171281)
|
|
8
|
+
[`10b213d7981fe`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/10b213d7981fe) -
|
|
9
|
+
Prefer the plus menu button placement on the bottom where there is insufficient room on the top.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 2.4.16
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.default = void 0;
|
|
7
|
+
exports.default = exports.DEFAULT_HEIGHT = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
@@ -28,7 +28,7 @@ var _excluded = ["children"];
|
|
|
28
28
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
29
29
|
// AFP-2532 TODO: Fix automatic suppressions below
|
|
30
30
|
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
31
|
-
var DEFAULT_HEIGHT = 560;
|
|
31
|
+
var DEFAULT_HEIGHT = exports.DEFAULT_HEIGHT = 560;
|
|
32
32
|
var InsertMenu = function InsertMenu(_ref) {
|
|
33
33
|
var _pluginInjectionApi$q7, _pluginInjectionApi$q8;
|
|
34
34
|
var editorView = _ref.editorView,
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.BlockInsertElementBrowser = void 0;
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
10
|
-
var
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
|
+
var _InsertMenu = _interopRequireWildcard(require("../ElementBrowser/InsertMenu"));
|
|
11
13
|
var _dropdownButton = require("./dropdown-button");
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
15
|
+
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; }
|
|
16
|
+
// This determines how the popup should fit. We prefer the insert menu
|
|
17
|
+
// opening on the bottom as we have a search bar and should only open on
|
|
18
|
+
// top if there is more than sufficient room.
|
|
19
|
+
var FIT_HEIGHT_BUFFER = 100;
|
|
12
20
|
var BlockInsertElementBrowser = exports.BlockInsertElementBrowser = function BlockInsertElementBrowser(props) {
|
|
13
21
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, props.open && /*#__PURE__*/_react.default.createElement(_ui.Popup, {
|
|
14
22
|
target: props.plusButtonRef,
|
|
15
|
-
fitHeight: 500,
|
|
23
|
+
fitHeight: (0, _platformFeatureFlags.fg)('platform_editor_consistent_insert_menu') ? _InsertMenu.DEFAULT_HEIGHT + FIT_HEIGHT_BUFFER : 500,
|
|
16
24
|
fitWidth: 350,
|
|
17
25
|
offset: [0, 3],
|
|
18
26
|
mountTo: props.popupsMountPoint,
|
|
@@ -357,9 +357,8 @@ var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_Re
|
|
|
357
357
|
var _pluginInjectionApi$l;
|
|
358
358
|
var _this$props4 = _this.props,
|
|
359
359
|
editorView = _this$props4.editorView,
|
|
360
|
-
pluginInjectionApi = _this$props4.pluginInjectionApi
|
|
361
|
-
|
|
362
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$l = pluginInjectionApi.layout) === null || _pluginInjectionApi$l === void 0 || _pluginInjectionApi$l.actions.insertLayoutColumns(inputMethod, intl.formatMessage)(editorView.state, editorView.dispatch);
|
|
360
|
+
pluginInjectionApi = _this$props4.pluginInjectionApi;
|
|
361
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$l = pluginInjectionApi.layout) === null || _pluginInjectionApi$l === void 0 || _pluginInjectionApi$l.actions.insertLayoutColumns(inputMethod)(editorView.state, editorView.dispatch);
|
|
363
362
|
return true;
|
|
364
363
|
});
|
|
365
364
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createStatus", function (inputMethod) {
|
|
@@ -19,7 +19,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
19
19
|
import { borderRadius } from '@atlaskit/theme';
|
|
20
20
|
import { N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
21
21
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
22
|
-
const DEFAULT_HEIGHT = 560;
|
|
22
|
+
export const DEFAULT_HEIGHT = 560;
|
|
23
23
|
const InsertMenu = ({
|
|
24
24
|
editorView,
|
|
25
25
|
dropdownItems,
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
3
|
-
import
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import InsertMenu, { DEFAULT_HEIGHT } from '../ElementBrowser/InsertMenu';
|
|
4
5
|
import { DropDownButton } from './dropdown-button';
|
|
6
|
+
// This determines how the popup should fit. We prefer the insert menu
|
|
7
|
+
// opening on the bottom as we have a search bar and should only open on
|
|
8
|
+
// top if there is more than sufficient room.
|
|
9
|
+
const FIT_HEIGHT_BUFFER = 100;
|
|
5
10
|
export const BlockInsertElementBrowser = props => {
|
|
6
11
|
return /*#__PURE__*/React.createElement(React.Fragment, null, props.open && /*#__PURE__*/React.createElement(Popup, {
|
|
7
12
|
target: props.plusButtonRef,
|
|
8
|
-
fitHeight: 500,
|
|
13
|
+
fitHeight: fg('platform_editor_consistent_insert_menu') ? DEFAULT_HEIGHT + FIT_HEIGHT_BUFFER : 500,
|
|
9
14
|
fitWidth: 350,
|
|
10
15
|
offset: [0, 3],
|
|
11
16
|
mountTo: props.popupsMountPoint,
|
|
@@ -367,10 +367,9 @@ export class ToolbarInsertBlock extends React.PureComponent {
|
|
|
367
367
|
var _pluginInjectionApi$l;
|
|
368
368
|
const {
|
|
369
369
|
editorView,
|
|
370
|
-
pluginInjectionApi
|
|
371
|
-
intl
|
|
370
|
+
pluginInjectionApi
|
|
372
371
|
} = this.props;
|
|
373
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$l = pluginInjectionApi.layout) === null || _pluginInjectionApi$l === void 0 ? void 0 : _pluginInjectionApi$l.actions.insertLayoutColumns(inputMethod
|
|
372
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$l = pluginInjectionApi.layout) === null || _pluginInjectionApi$l === void 0 ? void 0 : _pluginInjectionApi$l.actions.insertLayoutColumns(inputMethod)(editorView.state, editorView.dispatch);
|
|
374
373
|
return true;
|
|
375
374
|
});
|
|
376
375
|
_defineProperty(this, "createStatus", inputMethod => {
|
|
@@ -23,7 +23,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
23
23
|
import { borderRadius } from '@atlaskit/theme';
|
|
24
24
|
import { N0, N30A, N60A } from '@atlaskit/theme/colors';
|
|
25
25
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
26
|
-
var DEFAULT_HEIGHT = 560;
|
|
26
|
+
export var DEFAULT_HEIGHT = 560;
|
|
27
27
|
var InsertMenu = function InsertMenu(_ref) {
|
|
28
28
|
var _pluginInjectionApi$q7, _pluginInjectionApi$q8;
|
|
29
29
|
var editorView = _ref.editorView,
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
3
|
-
import
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import InsertMenu, { DEFAULT_HEIGHT } from '../ElementBrowser/InsertMenu';
|
|
4
5
|
import { DropDownButton } from './dropdown-button';
|
|
6
|
+
// This determines how the popup should fit. We prefer the insert menu
|
|
7
|
+
// opening on the bottom as we have a search bar and should only open on
|
|
8
|
+
// top if there is more than sufficient room.
|
|
9
|
+
var FIT_HEIGHT_BUFFER = 100;
|
|
5
10
|
export var BlockInsertElementBrowser = function BlockInsertElementBrowser(props) {
|
|
6
11
|
return /*#__PURE__*/React.createElement(React.Fragment, null, props.open && /*#__PURE__*/React.createElement(Popup, {
|
|
7
12
|
target: props.plusButtonRef,
|
|
8
|
-
fitHeight: 500,
|
|
13
|
+
fitHeight: fg('platform_editor_consistent_insert_menu') ? DEFAULT_HEIGHT + FIT_HEIGHT_BUFFER : 500,
|
|
9
14
|
fitWidth: 350,
|
|
10
15
|
offset: [0, 3],
|
|
11
16
|
mountTo: props.popupsMountPoint,
|
|
@@ -348,9 +348,8 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
348
348
|
var _pluginInjectionApi$l;
|
|
349
349
|
var _this$props4 = _this.props,
|
|
350
350
|
editorView = _this$props4.editorView,
|
|
351
|
-
pluginInjectionApi = _this$props4.pluginInjectionApi
|
|
352
|
-
|
|
353
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$l = pluginInjectionApi.layout) === null || _pluginInjectionApi$l === void 0 || _pluginInjectionApi$l.actions.insertLayoutColumns(inputMethod, intl.formatMessage)(editorView.state, editorView.dispatch);
|
|
351
|
+
pluginInjectionApi = _this$props4.pluginInjectionApi;
|
|
352
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$l = pluginInjectionApi.layout) === null || _pluginInjectionApi$l === void 0 || _pluginInjectionApi$l.actions.insertLayoutColumns(inputMethod)(editorView.state, editorView.dispatch);
|
|
354
353
|
return true;
|
|
355
354
|
});
|
|
356
355
|
_defineProperty(_assertThisInitialized(_this), "createStatus", function (inputMethod) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import type { InsertMenuProps } from './types';
|
|
3
|
+
export declare const DEFAULT_HEIGHT = 560;
|
|
3
4
|
declare const InsertMenu: ({ editorView, dropdownItems, showElementBrowserLink, onInsert, toggleVisiblity, pluginInjectionApi, isFullPageAppearance, }: InsertMenuProps) => jsx.JSX.Element;
|
|
4
5
|
export default InsertMenu;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import type { InsertMenuProps } from './types';
|
|
3
|
+
export declare const DEFAULT_HEIGHT = 560;
|
|
3
4
|
declare const InsertMenu: ({ editorView, dropdownItems, showElementBrowserLink, onInsert, toggleVisiblity, pluginInjectionApi, isFullPageAppearance, }: InsertMenuProps) => jsx.JSX.Element;
|
|
4
5
|
export default InsertMenu;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-insert-block",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.17",
|
|
4
4
|
"description": "Insert block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/button": "^20.3.0",
|
|
35
|
-
"@atlaskit/editor-common": "^95.
|
|
35
|
+
"@atlaskit/editor-common": "^95.10.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.10.0",
|
|
37
37
|
"@atlaskit/editor-plugin-block-type": "^4.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-code-block": "^3.5.0",
|
|
@@ -54,20 +54,20 @@
|
|
|
54
54
|
"@atlaskit/editor-plugin-quick-insert": "^1.7.0",
|
|
55
55
|
"@atlaskit/editor-plugin-rule": "^1.9.0",
|
|
56
56
|
"@atlaskit/editor-plugin-status": "^2.5.0",
|
|
57
|
-
"@atlaskit/editor-plugin-table": "^8.
|
|
57
|
+
"@atlaskit/editor-plugin-table": "^8.2.0",
|
|
58
58
|
"@atlaskit/editor-plugin-tasks-and-decisions": "^2.12.0",
|
|
59
|
-
"@atlaskit/editor-plugin-type-ahead": "^1.
|
|
60
|
-
"@atlaskit/editor-prosemirror": "6.
|
|
59
|
+
"@atlaskit/editor-plugin-type-ahead": "^1.11.0",
|
|
60
|
+
"@atlaskit/editor-prosemirror": "6.2.1",
|
|
61
61
|
"@atlaskit/editor-shared-styles": "^3.2.0",
|
|
62
62
|
"@atlaskit/emoji": "^67.11.0",
|
|
63
|
-
"@atlaskit/heading": "
|
|
64
|
-
"@atlaskit/icon": "^22.
|
|
63
|
+
"@atlaskit/heading": "4.0.0",
|
|
64
|
+
"@atlaskit/icon": "^22.28.0",
|
|
65
65
|
"@atlaskit/icon-lab": "^1.2.0",
|
|
66
66
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
67
67
|
"@atlaskit/primitives": "^13.3.0",
|
|
68
68
|
"@atlaskit/theme": "^14.0.0",
|
|
69
69
|
"@atlaskit/tmp-editor-statsig": "^2.21.0",
|
|
70
|
-
"@atlaskit/tokens": "^2.
|
|
70
|
+
"@atlaskit/tokens": "^2.4.0",
|
|
71
71
|
"@atlaskit/tooltip": "18.9.3",
|
|
72
72
|
"@babel/runtime": "^7.0.0",
|
|
73
73
|
"@emotion/react": "^11.7.1",
|
|
@@ -127,6 +127,9 @@
|
|
|
127
127
|
"platform_editor_toolbar_responsive_fixes": {
|
|
128
128
|
"type": "boolean"
|
|
129
129
|
},
|
|
130
|
+
"platform_editor_consistent_insert_menu": {
|
|
131
|
+
"type": "boolean"
|
|
132
|
+
},
|
|
130
133
|
"platform_editor_reduce_element_browser_padding": {
|
|
131
134
|
"type": "boolean"
|
|
132
135
|
}
|