@atlaskit/editor-core 189.4.0 → 189.4.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 +7 -0
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/presets/universal.js +2 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/presets/universal.js +2 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/presets/universal.js +2 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/package.json +2 -1
- package/dist/cjs/plugins/insert-block/index.js +0 -165
- package/dist/cjs/plugins/insert-block/types.js +0 -5
- package/dist/cjs/plugins/insert-block/ui/ElementBrowser/InsertMenu.js +0 -152
- package/dist/cjs/plugins/insert-block/ui/ElementBrowser/types.js +0 -5
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +0 -42
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +0 -42
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +0 -66
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +0 -217
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +0 -49
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +0 -565
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/item.js +0 -250
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/messages.js +0 -12
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.js +0 -20
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.js +0 -30
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/styles.js +0 -11
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/types.js +0 -5
- package/dist/es2019/plugins/insert-block/index.js +0 -159
- package/dist/es2019/plugins/insert-block/types.js +0 -1
- package/dist/es2019/plugins/insert-block/ui/ElementBrowser/InsertMenu.js +0 -150
- package/dist/es2019/plugins/insert-block/ui/ElementBrowser/types.js +0 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +0 -35
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +0 -35
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +0 -59
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +0 -198
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +0 -37
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +0 -558
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/item.js +0 -201
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/messages.js +0 -1
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.js +0 -8
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.js +0 -22
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/styles.js +0 -16
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/types.js +0 -1
- package/dist/esm/plugins/insert-block/index.js +0 -158
- package/dist/esm/plugins/insert-block/types.js +0 -1
- package/dist/esm/plugins/insert-block/ui/ElementBrowser/InsertMenu.js +0 -146
- package/dist/esm/plugins/insert-block/ui/ElementBrowser/types.js +0 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.js +0 -35
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +0 -35
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.js +0 -59
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/create-items.js +0 -210
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.js +0 -41
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +0 -560
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/item.js +0 -243
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/messages.js +0 -1
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.js +0 -13
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.js +0 -24
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/styles.js +0 -4
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/types.js +0 -1
- package/dist/types/plugins/insert-block/index.d.ts +0 -16
- package/dist/types/plugins/insert-block/types.d.ts +0 -45
- package/dist/types/plugins/insert-block/ui/ElementBrowser/InsertMenu.d.ts +0 -4
- package/dist/types/plugins/insert-block/ui/ElementBrowser/types.d.ts +0 -22
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +0 -28
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +0 -18
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +0 -30
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -39
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +0 -16
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/index.d.ts +0 -46
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/item.d.ts +0 -34
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/messages.d.ts +0 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.d.ts +0 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.d.ts +0 -2
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/styles.d.ts +0 -1
- package/dist/types/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -59
- package/dist/types-ts4.5/plugins/insert-block/index.d.ts +0 -16
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +0 -45
- package/dist/types-ts4.5/plugins/insert-block/ui/ElementBrowser/InsertMenu.d.ts +0 -4
- package/dist/types-ts4.5/plugins/insert-block/ui/ElementBrowser/types.d.ts +0 -22
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +0 -28
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +0 -18
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/block-insert-menu.d.ts +0 -30
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/create-items.d.ts +0 -42
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/dropdown-button.d.ts +0 -16
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/index.d.ts +0 -46
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/item.d.ts +0 -34
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/messages.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/shallow-equals.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/sort-items.d.ts +0 -2
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/styles.d.ts +0 -1
- package/dist/types-ts4.5/plugins/insert-block/ui/ToolbarInsertBlock/types.d.ts +0 -59
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 189.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#43507](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43507) [`a9695768de6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a9695768de6) - Extracted insert block plugin code from editor-core to @atlaskit/editor-plugin-insert-block
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
3
10
|
## 189.4.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
@@ -82,12 +82,6 @@ Object.defineProperty(exports, "findReplacePlugin", {
|
|
|
82
82
|
return _findReplace.default;
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
|
-
Object.defineProperty(exports, "insertBlockPlugin", {
|
|
86
|
-
enumerable: true,
|
|
87
|
-
get: function get() {
|
|
88
|
-
return _insertBlock.default;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
85
|
Object.defineProperty(exports, "jiraIssuePlugin", {
|
|
92
86
|
enumerable: true,
|
|
93
87
|
get: function get() {
|
|
@@ -133,7 +127,6 @@ Object.defineProperty(exports, "viewUpdateSubscriptionPlugin", {
|
|
|
133
127
|
var _clearMarksOnChangeToEmptyDocument = _interopRequireDefault(require("./clear-marks-on-change-to-empty-document"));
|
|
134
128
|
var _collabEdit = _interopRequireDefault(require("./collab-edit"));
|
|
135
129
|
var _extension = _interopRequireDefault(require("./extension"));
|
|
136
|
-
var _insertBlock = _interopRequireDefault(require("./insert-block"));
|
|
137
130
|
var _jiraIssue = _interopRequireDefault(require("./jira-issue"));
|
|
138
131
|
var _toolbarListsIndentation = _interopRequireDefault(require("./toolbar-lists-indentation"));
|
|
139
132
|
var _paste = _interopRequireDefault(require("./paste"));
|
|
@@ -15,6 +15,7 @@ var _editorPluginTextColor = require("@atlaskit/editor-plugin-text-color");
|
|
|
15
15
|
var _editorPluginHistory = require("@atlaskit/editor-plugin-history");
|
|
16
16
|
var _editorPluginIndentation = require("@atlaskit/editor-plugin-indentation");
|
|
17
17
|
var _editorPluginStatus = require("@atlaskit/editor-plugin-status");
|
|
18
|
+
var _editorPluginInsertBlock = require("@atlaskit/editor-plugin-insert-block");
|
|
18
19
|
var _editorPluginDate = require("@atlaskit/editor-plugin-date");
|
|
19
20
|
var _editorPluginMaxContentSize = require("@atlaskit/editor-plugin-max-content-size");
|
|
20
21
|
var _editorPluginCaption = require("@atlaskit/editor-plugin-caption");
|
|
@@ -359,7 +360,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
359
360
|
}).add([_plugins.toolbarListsIndentationPlugin, {
|
|
360
361
|
showIndentationButtons: !!props.showIndentationButtons,
|
|
361
362
|
allowHeadingAndParagraphIndentation: !!props.allowIndentation
|
|
362
|
-
}]).add([
|
|
363
|
+
}]).add([_editorPluginInsertBlock.insertBlockPlugin, {
|
|
363
364
|
allowTables: !!props.allowTables,
|
|
364
365
|
allowExpand: isExpandInsertionEnabled(props),
|
|
365
366
|
insertMenuItems: props.insertMenuItems,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { default as clearMarksOnChangeToEmptyDocumentPlugin } from './clear-marks-on-change-to-empty-document';
|
|
2
2
|
export { default as collabEditPlugin } from './collab-edit';
|
|
3
3
|
export { default as extensionPlugin } from './extension';
|
|
4
|
-
export { default as insertBlockPlugin } from './insert-block';
|
|
5
4
|
export { default as jiraIssuePlugin } from './jira-issue';
|
|
6
5
|
export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
|
|
7
6
|
export { default as pastePlugin } from './paste';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin,
|
|
1
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, jiraIssuePlugin, toolbarListsIndentationPlugin, alignmentPlugin, customAutoformatPlugin, feedbackDialogPlugin, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin } from '../plugins';
|
|
2
2
|
import { tasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
|
|
3
3
|
import { panelPlugin } from '@atlaskit/editor-plugin-panel';
|
|
4
4
|
import { textColorPlugin } from '@atlaskit/editor-plugin-text-color';
|
|
5
5
|
import { historyPlugin } from '@atlaskit/editor-plugin-history';
|
|
6
6
|
import { indentationPlugin } from '@atlaskit/editor-plugin-indentation';
|
|
7
7
|
import { statusPlugin } from '@atlaskit/editor-plugin-status';
|
|
8
|
+
import { insertBlockPlugin } from '@atlaskit/editor-plugin-insert-block';
|
|
8
9
|
import { datePlugin } from '@atlaskit/editor-plugin-date';
|
|
9
10
|
import { maxContentSizePlugin } from '@atlaskit/editor-plugin-max-content-size';
|
|
10
11
|
import { captionPlugin } from '@atlaskit/editor-plugin-caption';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "189.4.
|
|
2
|
+
export const version = "189.4.1";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { default as clearMarksOnChangeToEmptyDocumentPlugin } from './clear-marks-on-change-to-empty-document';
|
|
2
2
|
export { default as collabEditPlugin } from './collab-edit';
|
|
3
3
|
export { default as extensionPlugin } from './extension';
|
|
4
|
-
export { default as insertBlockPlugin } from './insert-block';
|
|
5
4
|
export { default as jiraIssuePlugin } from './jira-issue';
|
|
6
5
|
export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
|
|
7
6
|
export { default as pastePlugin } from './paste';
|
|
@@ -2,13 +2,14 @@ import _typeof from "@babel/runtime/helpers/typeof";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin,
|
|
5
|
+
import { breakoutPlugin, collabEditPlugin, dataConsumerMarkPlugin, extensionPlugin, jiraIssuePlugin, toolbarListsIndentationPlugin, alignmentPlugin, customAutoformatPlugin, feedbackDialogPlugin, mobileDimensionsPlugin, findReplacePlugin, mobileSelectionPlugin, annotationPlugin, avatarGroupPlugin, viewUpdateSubscriptionPlugin, beforePrimaryToolbarPlugin, codeBidiWarningPlugin } from '../plugins';
|
|
6
6
|
import { tasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
|
|
7
7
|
import { panelPlugin } from '@atlaskit/editor-plugin-panel';
|
|
8
8
|
import { textColorPlugin } from '@atlaskit/editor-plugin-text-color';
|
|
9
9
|
import { historyPlugin } from '@atlaskit/editor-plugin-history';
|
|
10
10
|
import { indentationPlugin } from '@atlaskit/editor-plugin-indentation';
|
|
11
11
|
import { statusPlugin } from '@atlaskit/editor-plugin-status';
|
|
12
|
+
import { insertBlockPlugin } from '@atlaskit/editor-plugin-insert-block';
|
|
12
13
|
import { datePlugin } from '@atlaskit/editor-plugin-date';
|
|
13
14
|
import { maxContentSizePlugin } from '@atlaskit/editor-plugin-max-content-size';
|
|
14
15
|
import { captionPlugin } from '@atlaskit/editor-plugin-caption';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "189.4.
|
|
2
|
+
export var version = "189.4.1";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { default as clearMarksOnChangeToEmptyDocumentPlugin } from './clear-marks-on-change-to-empty-document';
|
|
2
2
|
export { default as collabEditPlugin } from './collab-edit';
|
|
3
3
|
export { default as extensionPlugin } from './extension';
|
|
4
|
-
export { default as insertBlockPlugin } from './insert-block';
|
|
5
4
|
export { default as jiraIssuePlugin } from './jira-issue';
|
|
6
5
|
export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
|
|
7
6
|
export { default as pastePlugin } from './paste';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { default as clearMarksOnChangeToEmptyDocumentPlugin } from './clear-marks-on-change-to-empty-document';
|
|
2
2
|
export { default as collabEditPlugin } from './collab-edit';
|
|
3
3
|
export { default as extensionPlugin } from './extension';
|
|
4
|
-
export { default as insertBlockPlugin } from './insert-block';
|
|
5
4
|
export { default as jiraIssuePlugin } from './jira-issue';
|
|
6
5
|
export { default as toolbarListsIndentationPlugin } from './toolbar-lists-indentation';
|
|
7
6
|
export { default as pastePlugin } from './paste';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "189.4.
|
|
3
|
+
"version": "189.4.1",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -85,6 +85,7 @@
|
|
|
85
85
|
"@atlaskit/editor-plugin-hyperlink": "^0.6.0",
|
|
86
86
|
"@atlaskit/editor-plugin-image-upload": "^0.2.0",
|
|
87
87
|
"@atlaskit/editor-plugin-indentation": "^0.2.0",
|
|
88
|
+
"@atlaskit/editor-plugin-insert-block": "^0.2.0",
|
|
88
89
|
"@atlaskit/editor-plugin-layout": "^0.1.0",
|
|
89
90
|
"@atlaskit/editor-plugin-list": "^1.3.0",
|
|
90
91
|
"@atlaskit/editor-plugin-max-content-size": "^0.1.0",
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _providerFactory = require("@atlaskit/editor-common/provider-factory");
|
|
10
|
-
var _ToolbarInsertBlock = _interopRequireDefault(require("./ui/ToolbarInsertBlock"));
|
|
11
|
-
var _consts = require("@atlaskit/editor-plugin-block-type/consts");
|
|
12
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
|
-
var _types = require("@atlaskit/editor-common/types");
|
|
14
|
-
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
15
|
-
var toolbarSizeToButtons = function toolbarSizeToButtons(toolbarSize) {
|
|
16
|
-
switch (toolbarSize) {
|
|
17
|
-
case _types.ToolbarSize.XXL:
|
|
18
|
-
case _types.ToolbarSize.XL:
|
|
19
|
-
case _types.ToolbarSize.L:
|
|
20
|
-
case _types.ToolbarSize.M:
|
|
21
|
-
return 7;
|
|
22
|
-
case _types.ToolbarSize.S:
|
|
23
|
-
return 2;
|
|
24
|
-
default:
|
|
25
|
-
return 0;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Wrapper over insertBlockTypeWithAnalytics to autobind toolbar input method
|
|
30
|
-
* @param name Block name
|
|
31
|
-
*/
|
|
32
|
-
function handleInsertBlockType(insertCodeBlock, insertPanel, insertBlockQuote) {
|
|
33
|
-
return function (name) {
|
|
34
|
-
if (name === _consts.CODE_BLOCK.name && insertCodeBlock) {
|
|
35
|
-
return insertCodeBlock(_analytics.INPUT_METHOD.TOOLBAR);
|
|
36
|
-
}
|
|
37
|
-
if (name === _consts.PANEL.name && insertPanel) {
|
|
38
|
-
return insertPanel(_analytics.INPUT_METHOD.TOOLBAR);
|
|
39
|
-
}
|
|
40
|
-
if (name === _consts.BLOCK_QUOTE.name && insertBlockQuote) {
|
|
41
|
-
return insertBlockQuote(_analytics.INPUT_METHOD.TOOLBAR);
|
|
42
|
-
}
|
|
43
|
-
return function () {
|
|
44
|
-
return false;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
var insertBlockPlugin = function insertBlockPlugin(_ref) {
|
|
49
|
-
var _api$featureFlags;
|
|
50
|
-
var _ref$config = _ref.config,
|
|
51
|
-
options = _ref$config === void 0 ? {} : _ref$config,
|
|
52
|
-
api = _ref.api;
|
|
53
|
-
var featureFlags = (api === null || api === void 0 || (_api$featureFlags = api.featureFlags) === null || _api$featureFlags === void 0 ? void 0 : _api$featureFlags.sharedState.currentState()) || {};
|
|
54
|
-
return {
|
|
55
|
-
name: 'insertBlock',
|
|
56
|
-
primaryToolbarComponent: function primaryToolbarComponent(_ref2) {
|
|
57
|
-
var editorView = _ref2.editorView,
|
|
58
|
-
editorActions = _ref2.editorActions,
|
|
59
|
-
dispatchAnalyticsEvent = _ref2.dispatchAnalyticsEvent,
|
|
60
|
-
providerFactory = _ref2.providerFactory,
|
|
61
|
-
popupsMountPoint = _ref2.popupsMountPoint,
|
|
62
|
-
popupsBoundariesElement = _ref2.popupsBoundariesElement,
|
|
63
|
-
popupsScrollableElement = _ref2.popupsScrollableElement,
|
|
64
|
-
toolbarSize = _ref2.toolbarSize,
|
|
65
|
-
disabled = _ref2.disabled,
|
|
66
|
-
isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing,
|
|
67
|
-
isLastItem = _ref2.isLastItem;
|
|
68
|
-
var renderNode = function renderNode(providers) {
|
|
69
|
-
return /*#__PURE__*/_react.default.createElement(ToolbarInsertBlockWithInjectionApi, {
|
|
70
|
-
pluginInjectionApi: api,
|
|
71
|
-
editorView: editorView,
|
|
72
|
-
editorActions: editorActions,
|
|
73
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
74
|
-
providerFactory: providerFactory,
|
|
75
|
-
popupsMountPoint: popupsMountPoint,
|
|
76
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
77
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
78
|
-
toolbarSize: toolbarSize,
|
|
79
|
-
disabled: disabled,
|
|
80
|
-
isToolbarReducedSpacing: isToolbarReducedSpacing,
|
|
81
|
-
isLastItem: isLastItem,
|
|
82
|
-
featureFlags: featureFlags,
|
|
83
|
-
providers: providers,
|
|
84
|
-
options: options
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
return /*#__PURE__*/_react.default.createElement(_providerFactory.WithProviders, {
|
|
88
|
-
providerFactory: providerFactory,
|
|
89
|
-
providers: ['emojiProvider'],
|
|
90
|
-
renderNode: renderNode
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
function ToolbarInsertBlockWithInjectionApi(_ref3) {
|
|
96
|
-
var _ref4, _ref5, _pluginInjectionApi$i, _pluginInjectionApi$c, _pluginInjectionApi$p, _pluginInjectionApi$b, _pluginInjectionApi$e;
|
|
97
|
-
var editorView = _ref3.editorView,
|
|
98
|
-
editorActions = _ref3.editorActions,
|
|
99
|
-
dispatchAnalyticsEvent = _ref3.dispatchAnalyticsEvent,
|
|
100
|
-
popupsMountPoint = _ref3.popupsMountPoint,
|
|
101
|
-
popupsBoundariesElement = _ref3.popupsBoundariesElement,
|
|
102
|
-
popupsScrollableElement = _ref3.popupsScrollableElement,
|
|
103
|
-
toolbarSize = _ref3.toolbarSize,
|
|
104
|
-
disabled = _ref3.disabled,
|
|
105
|
-
isToolbarReducedSpacing = _ref3.isToolbarReducedSpacing,
|
|
106
|
-
isLastItem = _ref3.isLastItem,
|
|
107
|
-
providers = _ref3.providers,
|
|
108
|
-
pluginInjectionApi = _ref3.pluginInjectionApi,
|
|
109
|
-
options = _ref3.options,
|
|
110
|
-
featureFlags = _ref3.featureFlags;
|
|
111
|
-
var buttons = toolbarSizeToButtons(toolbarSize);
|
|
112
|
-
var _useSharedPluginState = (0, _hooks.useSharedPluginState)(pluginInjectionApi, ['hyperlink', 'date', 'imageUpload', 'mention', 'emoji', 'blockType', 'media', 'typeAhead', 'placeholderText']),
|
|
113
|
-
dateState = _useSharedPluginState.dateState,
|
|
114
|
-
hyperlinkState = _useSharedPluginState.hyperlinkState,
|
|
115
|
-
imageUploadState = _useSharedPluginState.imageUploadState,
|
|
116
|
-
mentionState = _useSharedPluginState.mentionState,
|
|
117
|
-
emojiState = _useSharedPluginState.emojiState,
|
|
118
|
-
blockTypeState = _useSharedPluginState.blockTypeState,
|
|
119
|
-
mediaState = _useSharedPluginState.mediaState,
|
|
120
|
-
typeAheadState = _useSharedPluginState.typeAheadState,
|
|
121
|
-
placeholderTextState = _useSharedPluginState.placeholderTextState;
|
|
122
|
-
return /*#__PURE__*/_react.default.createElement(_ToolbarInsertBlock.default, {
|
|
123
|
-
pluginInjectionApi: pluginInjectionApi,
|
|
124
|
-
buttons: buttons,
|
|
125
|
-
isReducedSpacing: isToolbarReducedSpacing,
|
|
126
|
-
isDisabled: disabled,
|
|
127
|
-
isTypeAheadAllowed: Boolean(typeAheadState === null || typeAheadState === void 0 ? void 0 : typeAheadState.isAllowed),
|
|
128
|
-
editorView: editorView,
|
|
129
|
-
tableSupported: !!editorView.state.schema.nodes.table,
|
|
130
|
-
actionSupported: !!editorView.state.schema.nodes.taskItem,
|
|
131
|
-
mentionsSupported: !!(mentionState && mentionState.mentionProvider),
|
|
132
|
-
mentionsDisabled: !!(mentionState && !mentionState.canInsertMention),
|
|
133
|
-
decisionSupported: !!editorView.state.schema.nodes.decisionItem,
|
|
134
|
-
dateEnabled: !!dateState,
|
|
135
|
-
placeholderTextEnabled: placeholderTextState && placeholderTextState.allowInserting,
|
|
136
|
-
layoutSectionEnabled: Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.layout),
|
|
137
|
-
expandEnabled: !!options.allowExpand,
|
|
138
|
-
mediaUploadsEnabled: (_ref4 = mediaState && mediaState.allowsUploads) !== null && _ref4 !== void 0 ? _ref4 : undefined,
|
|
139
|
-
onShowMediaPicker: (_ref5 = mediaState && mediaState.showMediaPicker) !== null && _ref5 !== void 0 ? _ref5 : undefined,
|
|
140
|
-
mediaSupported: !!mediaState,
|
|
141
|
-
imageUploadSupported: !!(pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.imageUpload),
|
|
142
|
-
imageUploadEnabled: imageUploadState === null || imageUploadState === void 0 ? void 0 : imageUploadState.enabled,
|
|
143
|
-
handleImageUpload: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$i = pluginInjectionApi.imageUpload) === null || _pluginInjectionApi$i === void 0 ? void 0 : _pluginInjectionApi$i.actions.startUpload,
|
|
144
|
-
availableWrapperBlockTypes: blockTypeState && blockTypeState.availableWrapperBlockTypes,
|
|
145
|
-
linkSupported: !!hyperlinkState,
|
|
146
|
-
linkDisabled: !hyperlinkState || !hyperlinkState.canInsertLink || !!hyperlinkState.activeLinkMark,
|
|
147
|
-
emojiDisabled: !emojiState || !emojiState.emojiProvider,
|
|
148
|
-
emojiProvider: providers.emojiProvider,
|
|
149
|
-
nativeStatusSupported: options.nativeStatusSupported,
|
|
150
|
-
horizontalRuleEnabled: options.horizontalRuleEnabled,
|
|
151
|
-
onInsertBlockType: handleInsertBlockType(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c = pluginInjectionApi.codeBlock) === null || _pluginInjectionApi$c === void 0 ? void 0 : _pluginInjectionApi$c.actions.insertCodeBlock, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$p = pluginInjectionApi.panel) === null || _pluginInjectionApi$p === void 0 ? void 0 : _pluginInjectionApi$p.actions.insertPanel, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$b = pluginInjectionApi.blockType) === null || _pluginInjectionApi$b === void 0 ? void 0 : _pluginInjectionApi$b.actions.insertBlockQuote),
|
|
152
|
-
onInsertMacroFromMacroBrowser: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e = pluginInjectionApi.extension) === null || _pluginInjectionApi$e === void 0 ? void 0 : _pluginInjectionApi$e.actions.insertMacroFromMacroBrowser,
|
|
153
|
-
popupsMountPoint: popupsMountPoint,
|
|
154
|
-
popupsBoundariesElement: popupsBoundariesElement,
|
|
155
|
-
popupsScrollableElement: popupsScrollableElement,
|
|
156
|
-
insertMenuItems: options.insertMenuItems,
|
|
157
|
-
editorActions: editorActions,
|
|
158
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
159
|
-
replacePlusMenuWithElementBrowser: options.replacePlusMenuWithElementBrowser,
|
|
160
|
-
showElementBrowserLink: options.showElementBrowserLink,
|
|
161
|
-
showSeparator: !isLastItem && toolbarSize <= _types.ToolbarSize.S,
|
|
162
|
-
featureFlags: featureFlags
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
var _default = exports.default = insertBlockPlugin;
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
-
var _react = require("react");
|
|
13
|
-
var _react2 = require("@emotion/react");
|
|
14
|
-
var _theme = require("@atlaskit/theme");
|
|
15
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
16
|
-
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
17
|
-
var _uiReact = require("@atlaskit/editor-common/ui-react");
|
|
18
|
-
var _elementBrowser = require("@atlaskit/editor-common/element-browser");
|
|
19
|
-
var _excluded = ["children"];
|
|
20
|
-
var _templateObject, _templateObject2;
|
|
21
|
-
/** @jsx jsx */
|
|
22
|
-
// AFP-2532 TODO: Fix automatic suppressions below
|
|
23
|
-
// eslint-disable-next-line @atlassian/tangerine/import/entry-points
|
|
24
|
-
var InsertMenu = function InsertMenu(_ref) {
|
|
25
|
-
var _pluginInjectionApi$q6, _pluginInjectionApi$q7;
|
|
26
|
-
var editorView = _ref.editorView,
|
|
27
|
-
dropdownItems = _ref.dropdownItems,
|
|
28
|
-
showElementBrowserLink = _ref.showElementBrowserLink,
|
|
29
|
-
onInsert = _ref.onInsert,
|
|
30
|
-
toggleVisiblity = _ref.toggleVisiblity,
|
|
31
|
-
pluginInjectionApi = _ref.pluginInjectionApi;
|
|
32
|
-
var _useState = (0, _react.useState)(0),
|
|
33
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
34
|
-
itemCount = _useState2[0],
|
|
35
|
-
setItemCount = _useState2[1];
|
|
36
|
-
var transform = (0, _react.useCallback)(function (item) {
|
|
37
|
-
return {
|
|
38
|
-
title: item.content,
|
|
39
|
-
description: item.tooltipDescription,
|
|
40
|
-
keyshortcut: item.shortcut,
|
|
41
|
-
icon: function icon() {
|
|
42
|
-
return getSvgIconForItem({
|
|
43
|
-
name: item.value.name
|
|
44
|
-
}) || item.elemBefore;
|
|
45
|
-
},
|
|
46
|
-
/**
|
|
47
|
-
* @note This transformed items action is only used when a quick insert item has been
|
|
48
|
-
* called from the quick insert menu and a search has not been performed.
|
|
49
|
-
*/
|
|
50
|
-
action: function action() {
|
|
51
|
-
return onInsert({
|
|
52
|
-
item: item
|
|
53
|
-
});
|
|
54
|
-
},
|
|
55
|
-
// "insertInsertMenuItem" expects these 2 properties.
|
|
56
|
-
onClick: item.onClick,
|
|
57
|
-
value: item.value
|
|
58
|
-
};
|
|
59
|
-
}, [onInsert]);
|
|
60
|
-
var quickInsertDropdownItems = dropdownItems.map(transform);
|
|
61
|
-
var viewMoreItem = showElementBrowserLink ? quickInsertDropdownItems.pop() : undefined;
|
|
62
|
-
var onInsertItem = (0, _react.useCallback)(function (item) {
|
|
63
|
-
var _pluginInjectionApi$q;
|
|
64
|
-
toggleVisiblity();
|
|
65
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q === void 0 || _pluginInjectionApi$q.actions.insertItem(item)(editorView.state, editorView.dispatch);
|
|
66
|
-
}, [editorView, toggleVisiblity, pluginInjectionApi]);
|
|
67
|
-
var getItems = (0, _react.useCallback)(function (query, category) {
|
|
68
|
-
var result;
|
|
69
|
-
/**
|
|
70
|
-
* @warning The results if there is a query are not the same as the results if there is no query.
|
|
71
|
-
* For example: If you have a typed panel and then select the panel item then it will call a different action
|
|
72
|
-
* than is specified on the editor plugins quick insert
|
|
73
|
-
* @see above transform function for more details.
|
|
74
|
-
*/
|
|
75
|
-
if (query) {
|
|
76
|
-
var _pluginInjectionApi$q2, _pluginInjectionApi$q3;
|
|
77
|
-
result = (_pluginInjectionApi$q2 = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q3 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q3 === void 0 ? void 0 : _pluginInjectionApi$q3.actions.getSuggestions({
|
|
78
|
-
query: query,
|
|
79
|
-
category: category
|
|
80
|
-
})) !== null && _pluginInjectionApi$q2 !== void 0 ? _pluginInjectionApi$q2 : [];
|
|
81
|
-
} else {
|
|
82
|
-
var _pluginInjectionApi$q4, _pluginInjectionApi$q5;
|
|
83
|
-
var featuredQuickInsertSuggestions = (_pluginInjectionApi$q4 = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q5 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q5 === void 0 ? void 0 : _pluginInjectionApi$q5.actions.getSuggestions({
|
|
84
|
-
category: category,
|
|
85
|
-
featuredItems: true
|
|
86
|
-
})) !== null && _pluginInjectionApi$q4 !== void 0 ? _pluginInjectionApi$q4 : [];
|
|
87
|
-
result = quickInsertDropdownItems.concat(featuredQuickInsertSuggestions);
|
|
88
|
-
}
|
|
89
|
-
setItemCount(result.length);
|
|
90
|
-
return result;
|
|
91
|
-
}, [pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q6 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q6 === void 0 ? void 0 : _pluginInjectionApi$q6.actions, quickInsertDropdownItems]);
|
|
92
|
-
var emptyStateHandler = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q7 = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q7 === void 0 || (_pluginInjectionApi$q7 = _pluginInjectionApi$q7.sharedState.currentState()) === null || _pluginInjectionApi$q7 === void 0 ? void 0 : _pluginInjectionApi$q7.emptyStateHandler;
|
|
93
|
-
return (0, _react2.jsx)("div", {
|
|
94
|
-
css: insertMenuWrapper(itemCount)
|
|
95
|
-
}, (0, _react2.jsx)(ElementBrowserWrapper, {
|
|
96
|
-
handleClickOutside: toggleVisiblity,
|
|
97
|
-
handleEscapeKeydown: toggleVisiblity,
|
|
98
|
-
closeOnTab: true
|
|
99
|
-
}, (0, _react2.jsx)(_elementBrowser.ElementBrowser, {
|
|
100
|
-
mode: "inline",
|
|
101
|
-
getItems: getItems,
|
|
102
|
-
emptyStateHandler: emptyStateHandler,
|
|
103
|
-
onInsertItem: onInsertItem,
|
|
104
|
-
showSearch: true,
|
|
105
|
-
showCategories: false
|
|
106
|
-
// On page resize we want the InlineElementBrowser to show updated tools/overflow items
|
|
107
|
-
,
|
|
108
|
-
key: quickInsertDropdownItems.length,
|
|
109
|
-
viewMoreItem: viewMoreItem
|
|
110
|
-
})));
|
|
111
|
-
};
|
|
112
|
-
var getSvgIconForItem = function getSvgIconForItem(_ref2) {
|
|
113
|
-
var name = _ref2.name;
|
|
114
|
-
var Icon = {
|
|
115
|
-
codeblock: _quickInsert.IconCode,
|
|
116
|
-
panel: _quickInsert.IconPanel,
|
|
117
|
-
blockquote: _quickInsert.IconQuote,
|
|
118
|
-
decision: _quickInsert.IconDecision,
|
|
119
|
-
horizontalrule: _quickInsert.IconDivider,
|
|
120
|
-
expand: _quickInsert.IconExpand,
|
|
121
|
-
date: _quickInsert.IconDate,
|
|
122
|
-
status: _quickInsert.IconStatus
|
|
123
|
-
}[name];
|
|
124
|
-
return Icon ? (0, _react2.jsx)(Icon, {
|
|
125
|
-
label: ""
|
|
126
|
-
}) : undefined;
|
|
127
|
-
};
|
|
128
|
-
var getInsertMenuHeight = function getInsertMenuHeight(_ref3) {
|
|
129
|
-
var itemCount = _ref3.itemCount;
|
|
130
|
-
// Figure based on visuals to exclude the searchbar, padding/margin, and the ViewMore item.
|
|
131
|
-
var EXTRA_SPACE_EXCLUDING_ELEMENTLIST = 112;
|
|
132
|
-
if (itemCount > 0 && itemCount < 6) {
|
|
133
|
-
return itemCount * _elementBrowser.ELEMENT_ITEM_HEIGHT + EXTRA_SPACE_EXCLUDING_ELEMENTLIST;
|
|
134
|
-
}
|
|
135
|
-
return 560; // For showing 6 Elements.
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
var insertMenuWrapper = function insertMenuWrapper(itemCount) {
|
|
139
|
-
return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex-direction: column;\n width: 320px;\n height: ", "px;\n background-color: ", ";\n border-radius: ", "px;\n box-shadow: ", ";\n"])), getInsertMenuHeight({
|
|
140
|
-
itemCount: itemCount
|
|
141
|
-
}), "var(--ds-surface-overlay, ".concat(_colors.N0, ")"), (0, _theme.borderRadius)(), "var(--ds-shadow-overlay, ".concat("0 0 0 1px ".concat(_colors.N30A, ",\n 0 2px 1px ").concat(_colors.N30A, ",\n 0 0 20px -6px ").concat(_colors.N60A), ")"));
|
|
142
|
-
};
|
|
143
|
-
var flexWrapperStyles = (0, _react2.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n flex: 1;\n box-sizing: border-box;\n overflow: hidden;\n"])));
|
|
144
|
-
var FlexWrapper = function FlexWrapper(props) {
|
|
145
|
-
var children = props.children,
|
|
146
|
-
divProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
147
|
-
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
148
|
-
css: flexWrapperStyles
|
|
149
|
-
}, divProps), children);
|
|
150
|
-
};
|
|
151
|
-
var ElementBrowserWrapper = (0, _uiReact.withReactEditorViewOuterListeners)(FlexWrapper);
|
|
152
|
-
var _default = exports.default = InsertMenu;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.BlockInsertElementBrowser = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _ui = require("@atlaskit/editor-common/ui");
|
|
10
|
-
var _InsertMenu = _interopRequireDefault(require("../ElementBrowser/InsertMenu"));
|
|
11
|
-
var _dropdownButton = require("./dropdown-button");
|
|
12
|
-
var BlockInsertElementBrowser = exports.BlockInsertElementBrowser = function BlockInsertElementBrowser(props) {
|
|
13
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, props.open && /*#__PURE__*/_react.default.createElement(_ui.Popup, {
|
|
14
|
-
target: props.plusButtonRef,
|
|
15
|
-
fitHeight: 500,
|
|
16
|
-
fitWidth: 350,
|
|
17
|
-
offset: [0, 3],
|
|
18
|
-
mountTo: props.popupsMountPoint,
|
|
19
|
-
boundariesElement: props.popupsBoundariesElement,
|
|
20
|
-
scrollableElement: props.popupsScrollableElement,
|
|
21
|
-
preventOverflow: true,
|
|
22
|
-
alignX: "right"
|
|
23
|
-
}, /*#__PURE__*/_react.default.createElement(_InsertMenu.default, {
|
|
24
|
-
editorView: props.editorView,
|
|
25
|
-
dropdownItems: props.items,
|
|
26
|
-
onInsert: props.onInsert,
|
|
27
|
-
toggleVisiblity: props.togglePlusMenuVisibility,
|
|
28
|
-
showElementBrowserLink: props.showElementBrowserLink,
|
|
29
|
-
pluginInjectionApi: props.pluginInjectionApi
|
|
30
|
-
})), /*#__PURE__*/_react.default.createElement(_dropdownButton.DropDownButton, {
|
|
31
|
-
"aria-expanded": props.open,
|
|
32
|
-
"aria-haspopup": true,
|
|
33
|
-
handleRef: props.onRef,
|
|
34
|
-
selected: props.open,
|
|
35
|
-
disabled: props.disabled,
|
|
36
|
-
onClick: props.onClick,
|
|
37
|
-
onKeyDown: props.onKeyDown,
|
|
38
|
-
spacing: props.spacing,
|
|
39
|
-
label: props.label,
|
|
40
|
-
"aria-keyshortcuts": "/"
|
|
41
|
-
}));
|
|
42
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.BlockInsertMenuLegacy = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
10
|
-
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
11
|
-
var _dropdownButton = require("./dropdown-button");
|
|
12
|
-
var BlockInsertMenuLegacy = exports.BlockInsertMenuLegacy = function BlockInsertMenuLegacy(props) {
|
|
13
|
-
var items = props.items;
|
|
14
|
-
var dropdownItems = _react.default.useMemo(function () {
|
|
15
|
-
return [{
|
|
16
|
-
items: items
|
|
17
|
-
}];
|
|
18
|
-
}, [items]);
|
|
19
|
-
return /*#__PURE__*/_react.default.createElement(_uiMenu.DropdownMenuWithKeyboardNavigation, {
|
|
20
|
-
items: dropdownItems,
|
|
21
|
-
onItemActivated: props.onItemActivated,
|
|
22
|
-
onOpenChange: props.onOpenChange,
|
|
23
|
-
mountTo: props.popupsMountPoint,
|
|
24
|
-
boundariesElement: props.popupsBoundariesElement,
|
|
25
|
-
scrollableElement: props.popupsScrollableElement,
|
|
26
|
-
isOpen: props.open,
|
|
27
|
-
fitHeight: 188,
|
|
28
|
-
fitWidth: 175,
|
|
29
|
-
zIndex: _editorSharedStyles.akEditorMenuZIndex
|
|
30
|
-
}, /*#__PURE__*/_react.default.createElement(_dropdownButton.DropDownButton, {
|
|
31
|
-
"aria-expanded": props.open,
|
|
32
|
-
"aria-haspopup": true,
|
|
33
|
-
handleRef: props.onRef,
|
|
34
|
-
selected: props.open,
|
|
35
|
-
disabled: props.disabled,
|
|
36
|
-
onClick: props.onClick,
|
|
37
|
-
onKeyDown: props.onKeyDown,
|
|
38
|
-
spacing: props.spacing,
|
|
39
|
-
label: props.label,
|
|
40
|
-
"aria-keyshortcuts": "/"
|
|
41
|
-
}));
|
|
42
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.BlockInsertMenu = void 0;
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var _blockInsertElementBrowser = require("./block-insert-element-browser");
|
|
10
|
-
var _blockInsertMenuLegacy = require("./block-insert-menu-legacy");
|
|
11
|
-
var _dropdownButton = require("./dropdown-button");
|
|
12
|
-
var BlockInsertMenu = exports.BlockInsertMenu = function BlockInsertMenu(props) {
|
|
13
|
-
if (props.items.length === 0) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
if (props.disabled) {
|
|
17
|
-
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_dropdownButton.DropDownButton, {
|
|
18
|
-
"aria-expanded": props.open,
|
|
19
|
-
"aria-haspopup": true,
|
|
20
|
-
handleRef: props.onRef,
|
|
21
|
-
selected: props.open,
|
|
22
|
-
disabled: props.disabled,
|
|
23
|
-
onClick: props.onClick,
|
|
24
|
-
onKeyDown: props.onKeyDown,
|
|
25
|
-
spacing: props.spacing,
|
|
26
|
-
label: props.label,
|
|
27
|
-
"aria-keyshortcuts": "/"
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
if (props.replacePlusMenuWithElementBrowser) {
|
|
31
|
-
return /*#__PURE__*/_react.default.createElement(_blockInsertElementBrowser.BlockInsertElementBrowser, {
|
|
32
|
-
disabled: props.disabled,
|
|
33
|
-
editorView: props.editorView,
|
|
34
|
-
items: props.items,
|
|
35
|
-
label: props.label,
|
|
36
|
-
onClick: props.onClick,
|
|
37
|
-
onKeyDown: props.onKeyDown,
|
|
38
|
-
onInsert: props.onInsert,
|
|
39
|
-
onRef: props.onPlusButtonRef,
|
|
40
|
-
open: props.open,
|
|
41
|
-
plusButtonRef: props.plusButtonRef,
|
|
42
|
-
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
43
|
-
popupsMountPoint: props.popupsMountPoint,
|
|
44
|
-
popupsScrollableElement: props.popupsScrollableElement,
|
|
45
|
-
spacing: props.spacing,
|
|
46
|
-
togglePlusMenuVisibility: props.togglePlusMenuVisibility,
|
|
47
|
-
showElementBrowserLink: props.showElementBrowserLink,
|
|
48
|
-
pluginInjectionApi: props.pluginInjectionApi
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
return /*#__PURE__*/_react.default.createElement(_blockInsertMenuLegacy.BlockInsertMenuLegacy, {
|
|
52
|
-
disabled: props.disabled,
|
|
53
|
-
items: props.items,
|
|
54
|
-
label: props.label,
|
|
55
|
-
onClick: props.onClick,
|
|
56
|
-
onKeyDown: props.onKeyDown,
|
|
57
|
-
onItemActivated: props.onItemActivated,
|
|
58
|
-
onOpenChange: props.onOpenChange,
|
|
59
|
-
onRef: props.onRef,
|
|
60
|
-
open: props.open,
|
|
61
|
-
popupsBoundariesElement: props.popupsBoundariesElement,
|
|
62
|
-
popupsMountPoint: props.popupsMountPoint,
|
|
63
|
-
popupsScrollableElement: props.popupsScrollableElement,
|
|
64
|
-
spacing: props.spacing
|
|
65
|
-
});
|
|
66
|
-
};
|