@atlaskit/editor-plugin-insert-block 0.1.1 → 0.2.0
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/.eslintrc.js +26 -0
- package/CHANGELOG.md +6 -0
- package/dist/cjs/index.js +8 -1
- package/dist/cjs/plugin.js +164 -0
- package/dist/cjs/types.js +5 -0
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +166 -0
- package/dist/cjs/ui/ElementBrowser/types.js +5 -0
- package/dist/cjs/ui/ToolbarInsertBlock/block-insert-element-browser.js +42 -0
- package/dist/cjs/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +42 -0
- package/dist/cjs/ui/ToolbarInsertBlock/block-insert-menu.js +66 -0
- package/dist/cjs/ui/ToolbarInsertBlock/create-items.js +217 -0
- package/dist/cjs/ui/ToolbarInsertBlock/dropdown-button.js +52 -0
- package/dist/cjs/ui/ToolbarInsertBlock/index.js +570 -0
- package/dist/cjs/ui/ToolbarInsertBlock/item.js +252 -0
- package/dist/cjs/ui/ToolbarInsertBlock/messages.js +12 -0
- package/dist/cjs/ui/ToolbarInsertBlock/shallow-equals.js +20 -0
- package/dist/cjs/ui/ToolbarInsertBlock/sort-items.js +30 -0
- package/dist/cjs/ui/ToolbarInsertBlock/styles.js +11 -0
- package/dist/cjs/ui/ToolbarInsertBlock/types.js +5 -0
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/plugin.js +158 -0
- package/dist/es2019/types.js +1 -0
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +153 -0
- package/dist/es2019/ui/ElementBrowser/types.js +1 -0
- package/dist/es2019/ui/ToolbarInsertBlock/block-insert-element-browser.js +35 -0
- package/dist/es2019/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +35 -0
- package/dist/es2019/ui/ToolbarInsertBlock/block-insert-menu.js +59 -0
- package/dist/es2019/ui/ToolbarInsertBlock/create-items.js +198 -0
- package/dist/es2019/ui/ToolbarInsertBlock/dropdown-button.js +39 -0
- package/dist/es2019/ui/ToolbarInsertBlock/index.js +562 -0
- package/dist/es2019/ui/ToolbarInsertBlock/item.js +202 -0
- package/dist/es2019/ui/ToolbarInsertBlock/messages.js +1 -0
- package/dist/es2019/ui/ToolbarInsertBlock/shallow-equals.js +8 -0
- package/dist/es2019/ui/ToolbarInsertBlock/sort-items.js +22 -0
- package/dist/es2019/ui/ToolbarInsertBlock/styles.js +16 -0
- package/dist/es2019/ui/ToolbarInsertBlock/types.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/plugin.js +157 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +160 -0
- package/dist/esm/ui/ElementBrowser/types.js +1 -0
- package/dist/esm/ui/ToolbarInsertBlock/block-insert-element-browser.js +35 -0
- package/dist/esm/ui/ToolbarInsertBlock/block-insert-menu-legacy.js +35 -0
- package/dist/esm/ui/ToolbarInsertBlock/block-insert-menu.js +59 -0
- package/dist/esm/ui/ToolbarInsertBlock/create-items.js +210 -0
- package/dist/esm/ui/ToolbarInsertBlock/dropdown-button.js +44 -0
- package/dist/esm/ui/ToolbarInsertBlock/index.js +564 -0
- package/dist/esm/ui/ToolbarInsertBlock/item.js +244 -0
- package/dist/esm/ui/ToolbarInsertBlock/messages.js +1 -0
- package/dist/esm/ui/ToolbarInsertBlock/shallow-equals.js +13 -0
- package/dist/esm/ui/ToolbarInsertBlock/sort-items.js +24 -0
- package/dist/esm/ui/ToolbarInsertBlock/styles.js +4 -0
- package/dist/esm/ui/ToolbarInsertBlock/types.js +1 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/plugin.d.ts +16 -0
- package/dist/types/types.d.ts +45 -0
- package/dist/types/ui/ElementBrowser/InsertMenu.d.ts +4 -0
- package/dist/types/ui/ElementBrowser/types.d.ts +22 -0
- package/dist/types/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +28 -0
- package/dist/types/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +21 -0
- package/dist/types/ui/ToolbarInsertBlock/block-insert-menu.d.ts +33 -0
- package/dist/types/ui/ToolbarInsertBlock/create-items.d.ts +39 -0
- package/dist/types/ui/ToolbarInsertBlock/dropdown-button.d.ts +16 -0
- package/dist/types/ui/ToolbarInsertBlock/index.d.ts +46 -0
- package/dist/types/ui/ToolbarInsertBlock/item.d.ts +35 -0
- package/dist/types/ui/ToolbarInsertBlock/messages.d.ts +1 -0
- package/dist/types/ui/ToolbarInsertBlock/shallow-equals.d.ts +1 -0
- package/dist/types/ui/ToolbarInsertBlock/sort-items.d.ts +2 -0
- package/dist/types/ui/ToolbarInsertBlock/styles.d.ts +1 -0
- package/dist/types/ui/ToolbarInsertBlock/types.d.ts +59 -0
- package/dist/types-ts4.5/index.d.ts +2 -1
- package/dist/types-ts4.5/plugin.d.ts +16 -0
- package/dist/types-ts4.5/types.d.ts +45 -0
- package/dist/types-ts4.5/ui/ElementBrowser/InsertMenu.d.ts +4 -0
- package/dist/types-ts4.5/ui/ElementBrowser/types.d.ts +22 -0
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/block-insert-element-browser.d.ts +28 -0
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/block-insert-menu-legacy.d.ts +21 -0
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/block-insert-menu.d.ts +33 -0
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/create-items.d.ts +42 -0
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/dropdown-button.d.ts +16 -0
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/index.d.ts +46 -0
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/item.d.ts +35 -0
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/messages.d.ts +1 -0
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/shallow-equals.d.ts +1 -0
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/sort-items.d.ts +2 -0
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/styles.d.ts +1 -0
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/types.d.ts +59 -0
- package/package.json +37 -9
- package/report.api.md +82 -1
- package/tmp/api-report-tmp.d.ts +76 -0
|
@@ -0,0 +1,570 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = exports.ToolbarInsertBlock = void 0;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
12
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
+
var _react = _interopRequireDefault(require("react"));
|
|
17
|
+
var _react2 = require("@emotion/react");
|
|
18
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
19
|
+
var _reactIntlNext = require("react-intl-next");
|
|
20
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
21
|
+
var _styles = require("@atlaskit/editor-common/styles");
|
|
22
|
+
var _ui = require("@atlaskit/editor-common/ui");
|
|
23
|
+
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
|
24
|
+
var _uiReact = require("@atlaskit/editor-common/ui-react");
|
|
25
|
+
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
26
|
+
var _picker = require("@atlaskit/emoji/picker");
|
|
27
|
+
var _blockInsertMenu = require("./block-insert-menu");
|
|
28
|
+
var _createItems3 = require("./create-items");
|
|
29
|
+
var _messages = require("./messages");
|
|
30
|
+
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; }
|
|
31
|
+
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) { (0, _defineProperty2.default)(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; }
|
|
32
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
33
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
34
|
+
/**
|
|
35
|
+
* Checks if an element is detached (i.e. not in the current document)
|
|
36
|
+
*/
|
|
37
|
+
var isDetachedElement = function isDetachedElement(el) {
|
|
38
|
+
return !document.body.contains(el);
|
|
39
|
+
};
|
|
40
|
+
var noop = function noop() {};
|
|
41
|
+
var EmojiPickerWithListeners = (0, _uiReact.withReactEditorViewOuterListeners)(_picker.EmojiPicker);
|
|
42
|
+
|
|
43
|
+
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
44
|
+
var ToolbarInsertBlock = exports.ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
45
|
+
(0, _inherits2.default)(ToolbarInsertBlock, _React$PureComponent);
|
|
46
|
+
var _super = _createSuper(ToolbarInsertBlock);
|
|
47
|
+
function ToolbarInsertBlock() {
|
|
48
|
+
var _this;
|
|
49
|
+
(0, _classCallCheck2.default)(this, ToolbarInsertBlock);
|
|
50
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
51
|
+
args[_key] = arguments[_key];
|
|
52
|
+
}
|
|
53
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
54
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "state", {
|
|
55
|
+
isPlusMenuOpen: false,
|
|
56
|
+
emojiPickerOpen: false,
|
|
57
|
+
isOpenedByKeyboard: false,
|
|
58
|
+
buttons: [],
|
|
59
|
+
dropdownItems: []
|
|
60
|
+
});
|
|
61
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onOpenChange", function (attrs) {
|
|
62
|
+
var state = {
|
|
63
|
+
isPlusMenuOpen: attrs.isPlusMenuOpen,
|
|
64
|
+
emojiPickerOpen: _this.state.emojiPickerOpen
|
|
65
|
+
};
|
|
66
|
+
if (_this.state.emojiPickerOpen && !attrs.open) {
|
|
67
|
+
state.emojiPickerOpen = false;
|
|
68
|
+
}
|
|
69
|
+
_this.setState(state, function () {
|
|
70
|
+
var dispatchAnalyticsEvent = _this.props.dispatchAnalyticsEvent;
|
|
71
|
+
if (!dispatchAnalyticsEvent) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
var isPlusMenuOpen = _this.state.isPlusMenuOpen;
|
|
75
|
+
if (isPlusMenuOpen) {
|
|
76
|
+
return dispatchAnalyticsEvent({
|
|
77
|
+
action: _analytics.ACTION.OPENED,
|
|
78
|
+
actionSubject: _analytics.ACTION_SUBJECT.PLUS_MENU,
|
|
79
|
+
eventType: _analytics.EVENT_TYPE.UI
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return dispatchAnalyticsEvent({
|
|
83
|
+
action: _analytics.ACTION.CLOSED,
|
|
84
|
+
actionSubject: _analytics.ACTION_SUBJECT.PLUS_MENU,
|
|
85
|
+
eventType: _analytics.EVENT_TYPE.UI
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "togglePlusMenuVisibility", function (event) {
|
|
90
|
+
var isPlusMenuOpen = _this.state.isPlusMenuOpen;
|
|
91
|
+
_this.onOpenChange({
|
|
92
|
+
isPlusMenuOpen: !isPlusMenuOpen
|
|
93
|
+
});
|
|
94
|
+
if ((event === null || event === void 0 ? void 0 : event.key) === 'Escape') {
|
|
95
|
+
var _ref;
|
|
96
|
+
(_ref = _this.plusButtonRef || _this.dropdownButtonRef) === null || _ref === void 0 || _ref.focus();
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toggleEmojiPicker", function () {
|
|
100
|
+
var inputMethod = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _analytics.INPUT_METHOD.TOOLBAR;
|
|
101
|
+
_this.setState(function (prevState) {
|
|
102
|
+
return {
|
|
103
|
+
emojiPickerOpen: !prevState.emojiPickerOpen
|
|
104
|
+
};
|
|
105
|
+
}, function () {
|
|
106
|
+
if (_this.state.emojiPickerOpen) {
|
|
107
|
+
var dispatchAnalyticsEvent = _this.props.dispatchAnalyticsEvent;
|
|
108
|
+
if (dispatchAnalyticsEvent) {
|
|
109
|
+
dispatchAnalyticsEvent({
|
|
110
|
+
action: _analytics.ACTION.OPENED,
|
|
111
|
+
actionSubject: _analytics.ACTION_SUBJECT.PICKER,
|
|
112
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.PICKER_EMOJI,
|
|
113
|
+
attributes: {
|
|
114
|
+
inputMethod: inputMethod
|
|
115
|
+
},
|
|
116
|
+
eventType: _analytics.EVENT_TYPE.UI
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleEmojiPressEscape", function () {
|
|
123
|
+
var _this$emojiButtonRef;
|
|
124
|
+
_this.toggleEmojiPicker(_analytics.INPUT_METHOD.KEYBOARD);
|
|
125
|
+
(_this$emojiButtonRef = _this.emojiButtonRef) === null || _this$emojiButtonRef === void 0 || _this$emojiButtonRef.focus();
|
|
126
|
+
});
|
|
127
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleEmojiClickOutside", function (e) {
|
|
128
|
+
// Ignore click events for detached elements.
|
|
129
|
+
// Workaround for FS-1322 - where two onClicks fire - one when the upload button is
|
|
130
|
+
// still in the document, and one once it's detached. Does not always occur, and
|
|
131
|
+
// may be a side effect of a react render optimisation
|
|
132
|
+
if (e.target && !isDetachedElement(e.target)) {
|
|
133
|
+
_this.toggleEmojiPicker(_analytics.INPUT_METHOD.TOOLBAR);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleEmojiButtonRef", function (button) {
|
|
137
|
+
var ref = _reactDom.default.findDOMNode(button);
|
|
138
|
+
if (ref) {
|
|
139
|
+
_this.emojiButtonRef = ref;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handlePlusButtonRef", function (button) {
|
|
143
|
+
var ref = _reactDom.default.findDOMNode(button);
|
|
144
|
+
if (ref) {
|
|
145
|
+
_this.plusButtonRef = ref;
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleDropDownButtonRef", function (button) {
|
|
149
|
+
var ref = _reactDom.default.findDOMNode(button);
|
|
150
|
+
if (ref) {
|
|
151
|
+
_this.dropdownButtonRef = ref;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleClick", function () {
|
|
155
|
+
_this.togglePlusMenuVisibility();
|
|
156
|
+
});
|
|
157
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleOpenByKeyboard", function (event) {
|
|
158
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
159
|
+
_this.setState(_objectSpread(_objectSpread({}, _this.state), {}, {
|
|
160
|
+
isOpenedByKeyboard: true
|
|
161
|
+
}));
|
|
162
|
+
event.preventDefault();
|
|
163
|
+
_this.togglePlusMenuVisibility();
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "toggleLinkPanel", function (inputMethod) {
|
|
167
|
+
var _pluginInjectionApi$c, _pluginInjectionApi$h;
|
|
168
|
+
var pluginInjectionApi = _this.props.pluginInjectionApi;
|
|
169
|
+
return (_pluginInjectionApi$c = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$h = pluginInjectionApi.hyperlink) === null || _pluginInjectionApi$h === void 0 ? void 0 : _pluginInjectionApi$h.commands.showLinkToolbar(inputMethod))) !== null && _pluginInjectionApi$c !== void 0 ? _pluginInjectionApi$c : false;
|
|
170
|
+
});
|
|
171
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertMention", function (inputMethod) {
|
|
172
|
+
var _pluginInjectionApi$m, _pluginInjectionApi$m2;
|
|
173
|
+
var _this$props = _this.props,
|
|
174
|
+
editorView = _this$props.editorView,
|
|
175
|
+
pluginInjectionApi = _this$props.pluginInjectionApi;
|
|
176
|
+
if (!editorView) {
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
var pluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m = pluginInjectionApi.mention) === null || _pluginInjectionApi$m === void 0 ? void 0 : _pluginInjectionApi$m.sharedState.currentState();
|
|
180
|
+
if (pluginState && pluginState.canInsertMention === false) {
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
return Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$m2 = pluginInjectionApi.mention) === null || _pluginInjectionApi$m2 === void 0 || (_pluginInjectionApi$m2 = _pluginInjectionApi$m2.actions) === null || _pluginInjectionApi$m2 === void 0 ? void 0 : _pluginInjectionApi$m2.openTypeAhead(inputMethod));
|
|
184
|
+
});
|
|
185
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertTable", function (inputMethod) {
|
|
186
|
+
var _pluginInjectionApi$t, _pluginInjectionApi$t2, _pluginInjectionApi$t3, _pluginInjectionApi$t4;
|
|
187
|
+
var _this$props2 = _this.props,
|
|
188
|
+
pluginInjectionApi = _this$props2.pluginInjectionApi,
|
|
189
|
+
editorView = _this$props2.editorView;
|
|
190
|
+
var state = editorView.state,
|
|
191
|
+
dispatch = editorView.dispatch;
|
|
192
|
+
return (_pluginInjectionApi$t = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$t2 = pluginInjectionApi.table) === null || _pluginInjectionApi$t2 === void 0 || (_pluginInjectionApi$t3 = (_pluginInjectionApi$t4 = _pluginInjectionApi$t2.actions).insertTable) === null || _pluginInjectionApi$t3 === void 0 ? void 0 : _pluginInjectionApi$t3.call(_pluginInjectionApi$t4, {
|
|
193
|
+
action: _analytics.ACTION.INSERTED,
|
|
194
|
+
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
195
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.TABLE,
|
|
196
|
+
attributes: {
|
|
197
|
+
inputMethod: inputMethod
|
|
198
|
+
},
|
|
199
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
200
|
+
})(state, dispatch)) !== null && _pluginInjectionApi$t !== void 0 ? _pluginInjectionApi$t : false;
|
|
201
|
+
});
|
|
202
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createDate", function (inputMethod) {
|
|
203
|
+
var _pluginInjectionApi$d;
|
|
204
|
+
var pluginInjectionApi = _this.props.pluginInjectionApi;
|
|
205
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$d = pluginInjectionApi.date) === null || _pluginInjectionApi$d === void 0 || (_pluginInjectionApi$d = _pluginInjectionApi$d.commands) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.insertDate({
|
|
206
|
+
inputMethod: inputMethod
|
|
207
|
+
}));
|
|
208
|
+
return true;
|
|
209
|
+
});
|
|
210
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createPlaceholderText", function () {
|
|
211
|
+
var _pluginInjectionApi$p;
|
|
212
|
+
var _this$props3 = _this.props,
|
|
213
|
+
editorView = _this$props3.editorView,
|
|
214
|
+
pluginInjectionApi = _this$props3.pluginInjectionApi;
|
|
215
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$p = pluginInjectionApi.placeholderText) === null || _pluginInjectionApi$p === void 0 || _pluginInjectionApi$p.actions.showPlaceholderFloatingToolbar(editorView.state, editorView.dispatch);
|
|
216
|
+
return true;
|
|
217
|
+
});
|
|
218
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertLayoutColumns", function (inputMethod) {
|
|
219
|
+
var _pluginInjectionApi$l;
|
|
220
|
+
var _this$props4 = _this.props,
|
|
221
|
+
editorView = _this$props4.editorView,
|
|
222
|
+
pluginInjectionApi = _this$props4.pluginInjectionApi;
|
|
223
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$l = pluginInjectionApi.layout) === null || _pluginInjectionApi$l === void 0 || _pluginInjectionApi$l.actions.insertLayoutColumns(inputMethod)(editorView.state, editorView.dispatch);
|
|
224
|
+
return true;
|
|
225
|
+
});
|
|
226
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "createStatus", function (inputMethod) {
|
|
227
|
+
var _pluginInjectionApi$s, _pluginInjectionApi$s2;
|
|
228
|
+
var _this$props5 = _this.props,
|
|
229
|
+
pluginInjectionApi = _this$props5.pluginInjectionApi,
|
|
230
|
+
editorView = _this$props5.editorView;
|
|
231
|
+
return (_pluginInjectionApi$s = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$s2 = pluginInjectionApi.status) === null || _pluginInjectionApi$s2 === void 0 || (_pluginInjectionApi$s2 = _pluginInjectionApi$s2.actions) === null || _pluginInjectionApi$s2 === void 0 ? void 0 : _pluginInjectionApi$s2.updateStatus(inputMethod)(editorView.state, editorView.dispatch)) !== null && _pluginInjectionApi$s !== void 0 ? _pluginInjectionApi$s : false;
|
|
232
|
+
});
|
|
233
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "openMediaPicker", function (inputMethod) {
|
|
234
|
+
var _this$props6 = _this.props,
|
|
235
|
+
onShowMediaPicker = _this$props6.onShowMediaPicker,
|
|
236
|
+
dispatchAnalyticsEvent = _this$props6.dispatchAnalyticsEvent;
|
|
237
|
+
if (onShowMediaPicker) {
|
|
238
|
+
onShowMediaPicker();
|
|
239
|
+
if (dispatchAnalyticsEvent) {
|
|
240
|
+
dispatchAnalyticsEvent({
|
|
241
|
+
action: _analytics.ACTION.OPENED,
|
|
242
|
+
actionSubject: _analytics.ACTION_SUBJECT.PICKER,
|
|
243
|
+
actionSubjectId: _analytics.ACTION_SUBJECT_ID.PICKER_CLOUD,
|
|
244
|
+
attributes: {
|
|
245
|
+
inputMethod: inputMethod
|
|
246
|
+
},
|
|
247
|
+
eventType: _analytics.EVENT_TYPE.UI
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return true;
|
|
252
|
+
});
|
|
253
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertTaskDecision", function (name, inputMethod) {
|
|
254
|
+
return function () {
|
|
255
|
+
var _pluginInjectionApi$t5, _pluginInjectionApi$t6;
|
|
256
|
+
var _this$props7 = _this.props,
|
|
257
|
+
_this$props7$editorVi = _this$props7.editorView,
|
|
258
|
+
state = _this$props7$editorVi.state,
|
|
259
|
+
dispatch = _this$props7$editorVi.dispatch,
|
|
260
|
+
pluginInjectionApi = _this$props7.pluginInjectionApi;
|
|
261
|
+
var listType = name === 'action' ? 'taskList' : 'decisionList';
|
|
262
|
+
return (_pluginInjectionApi$t5 = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$t6 = pluginInjectionApi.taskDecision) === null || _pluginInjectionApi$t6 === void 0 ? void 0 : _pluginInjectionApi$t6.actions.insertTaskDecision(listType, inputMethod)(state, dispatch)) !== null && _pluginInjectionApi$t5 !== void 0 ? _pluginInjectionApi$t5 : false;
|
|
263
|
+
};
|
|
264
|
+
});
|
|
265
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertHorizontalRule", function (inputMethod) {
|
|
266
|
+
var _pluginInjectionApi$r, _pluginInjectionApi$r2;
|
|
267
|
+
var _this$props8 = _this.props,
|
|
268
|
+
_this$props8$editorVi = _this$props8.editorView,
|
|
269
|
+
state = _this$props8$editorVi.state,
|
|
270
|
+
dispatch = _this$props8$editorVi.dispatch,
|
|
271
|
+
pluginInjectionApi = _this$props8.pluginInjectionApi;
|
|
272
|
+
return (_pluginInjectionApi$r = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$r2 = pluginInjectionApi.rule) === null || _pluginInjectionApi$r2 === void 0 ? void 0 : _pluginInjectionApi$r2.actions.insertHorizontalRule(inputMethod)(state, dispatch)) !== null && _pluginInjectionApi$r !== void 0 ? _pluginInjectionApi$r : false;
|
|
273
|
+
});
|
|
274
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertExpand", function () {
|
|
275
|
+
var _pluginInjectionApi$e, _pluginInjectionApi$e2;
|
|
276
|
+
var _this$props9 = _this.props,
|
|
277
|
+
_this$props9$editorVi = _this$props9.editorView,
|
|
278
|
+
state = _this$props9$editorVi.state,
|
|
279
|
+
dispatch = _this$props9$editorVi.dispatch,
|
|
280
|
+
pluginInjectionApi = _this$props9.pluginInjectionApi;
|
|
281
|
+
return (_pluginInjectionApi$e = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$e2 = pluginInjectionApi.expand) === null || _pluginInjectionApi$e2 === void 0 ? void 0 : _pluginInjectionApi$e2.actions.insertExpand(state, dispatch)) !== null && _pluginInjectionApi$e !== void 0 ? _pluginInjectionApi$e : false;
|
|
282
|
+
});
|
|
283
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertBlockType", function (itemName) {
|
|
284
|
+
return function () {
|
|
285
|
+
var _this$props10 = _this.props,
|
|
286
|
+
editorView = _this$props10.editorView,
|
|
287
|
+
onInsertBlockType = _this$props10.onInsertBlockType;
|
|
288
|
+
var state = editorView.state,
|
|
289
|
+
dispatch = editorView.dispatch;
|
|
290
|
+
onInsertBlockType(itemName)(state, dispatch);
|
|
291
|
+
return true;
|
|
292
|
+
};
|
|
293
|
+
});
|
|
294
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleSelectedEmoji", function (emojiId) {
|
|
295
|
+
var _pluginInjectionApi$e3;
|
|
296
|
+
var pluginInjectionApi = _this.props.pluginInjectionApi;
|
|
297
|
+
_this.props.editorView.focus();
|
|
298
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute((_pluginInjectionApi$e3 = pluginInjectionApi.emoji) === null || _pluginInjectionApi$e3 === void 0 ? void 0 : _pluginInjectionApi$e3.commands.insertEmoji(emojiId, _analytics.INPUT_METHOD.PICKER));
|
|
299
|
+
_this.toggleEmojiPicker();
|
|
300
|
+
return true;
|
|
301
|
+
});
|
|
302
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "openElementBrowser", function () {
|
|
303
|
+
var _pluginInjectionApi$q;
|
|
304
|
+
var pluginInjectionApi = _this.props.pluginInjectionApi;
|
|
305
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || pluginInjectionApi.core.actions.execute(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$q = pluginInjectionApi.quickInsert) === null || _pluginInjectionApi$q === void 0 ? void 0 : _pluginInjectionApi$q.commands.openElementBrowserModal);
|
|
306
|
+
});
|
|
307
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onItemActivated", function (_ref2) {
|
|
308
|
+
var item = _ref2.item,
|
|
309
|
+
inputMethod = _ref2.inputMethod;
|
|
310
|
+
var _this$props11 = _this.props,
|
|
311
|
+
editorView = _this$props11.editorView,
|
|
312
|
+
editorActions = _this$props11.editorActions,
|
|
313
|
+
handleImageUpload = _this$props11.handleImageUpload,
|
|
314
|
+
expandEnabled = _this$props11.expandEnabled;
|
|
315
|
+
|
|
316
|
+
// need to do this before inserting nodes so scrollIntoView works properly
|
|
317
|
+
if (!editorView.hasFocus()) {
|
|
318
|
+
editorView.focus();
|
|
319
|
+
}
|
|
320
|
+
switch (item.value.name) {
|
|
321
|
+
case 'link':
|
|
322
|
+
_this.toggleLinkPanel(inputMethod);
|
|
323
|
+
break;
|
|
324
|
+
case 'table':
|
|
325
|
+
_this.insertTable(inputMethod);
|
|
326
|
+
break;
|
|
327
|
+
case 'image upload':
|
|
328
|
+
if (handleImageUpload) {
|
|
329
|
+
var state = editorView.state,
|
|
330
|
+
dispatch = editorView.dispatch;
|
|
331
|
+
handleImageUpload()(state, dispatch);
|
|
332
|
+
}
|
|
333
|
+
break;
|
|
334
|
+
case 'media':
|
|
335
|
+
_this.openMediaPicker(inputMethod);
|
|
336
|
+
break;
|
|
337
|
+
case 'mention':
|
|
338
|
+
_this.insertMention(inputMethod);
|
|
339
|
+
break;
|
|
340
|
+
case 'emoji':
|
|
341
|
+
_this.toggleEmojiPicker(inputMethod);
|
|
342
|
+
break;
|
|
343
|
+
case 'codeblock':
|
|
344
|
+
case 'blockquote':
|
|
345
|
+
case 'panel':
|
|
346
|
+
_this.insertBlockType(item.value.name)();
|
|
347
|
+
break;
|
|
348
|
+
case 'action':
|
|
349
|
+
case 'decision':
|
|
350
|
+
_this.insertTaskDecision(item.value.name, inputMethod)();
|
|
351
|
+
break;
|
|
352
|
+
case 'horizontalrule':
|
|
353
|
+
_this.insertHorizontalRule(inputMethod);
|
|
354
|
+
break;
|
|
355
|
+
case 'macro':
|
|
356
|
+
_this.openElementBrowser();
|
|
357
|
+
break;
|
|
358
|
+
case 'date':
|
|
359
|
+
_this.createDate(inputMethod);
|
|
360
|
+
break;
|
|
361
|
+
case 'placeholder text':
|
|
362
|
+
_this.createPlaceholderText();
|
|
363
|
+
break;
|
|
364
|
+
case 'layout':
|
|
365
|
+
_this.insertLayoutColumns(inputMethod);
|
|
366
|
+
break;
|
|
367
|
+
case 'status':
|
|
368
|
+
_this.createStatus(inputMethod);
|
|
369
|
+
break;
|
|
370
|
+
|
|
371
|
+
// https://product-fabric.atlassian.net/browse/ED-8053
|
|
372
|
+
// @ts-ignore: OK to fallthrough to default
|
|
373
|
+
case 'expand':
|
|
374
|
+
if (expandEnabled) {
|
|
375
|
+
_this.insertExpand();
|
|
376
|
+
break;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// eslint-disable-next-line no-fallthrough
|
|
380
|
+
default:
|
|
381
|
+
if (item && item.onClick && editorActions) {
|
|
382
|
+
item.onClick(editorActions);
|
|
383
|
+
break;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
_this.setState({
|
|
387
|
+
isPlusMenuOpen: false
|
|
388
|
+
});
|
|
389
|
+
});
|
|
390
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertToolbarMenuItem", function (btn) {
|
|
391
|
+
return _this.onItemActivated({
|
|
392
|
+
item: btn,
|
|
393
|
+
inputMethod: _analytics.INPUT_METHOD.TOOLBAR
|
|
394
|
+
});
|
|
395
|
+
});
|
|
396
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "insertInsertMenuItem", function (_ref3) {
|
|
397
|
+
var item = _ref3.item;
|
|
398
|
+
return _this.onItemActivated({
|
|
399
|
+
item: item,
|
|
400
|
+
inputMethod: _analytics.INPUT_METHOD.INSERT_MENU
|
|
401
|
+
});
|
|
402
|
+
});
|
|
403
|
+
return _this;
|
|
404
|
+
}
|
|
405
|
+
(0, _createClass2.default)(ToolbarInsertBlock, [{
|
|
406
|
+
key: "componentDidUpdate",
|
|
407
|
+
value: function componentDidUpdate(prevProps) {
|
|
408
|
+
// If number of visible buttons changed, close emoji picker
|
|
409
|
+
if (prevProps.buttons !== this.props.buttons) {
|
|
410
|
+
this.setState({
|
|
411
|
+
emojiPickerOpen: false
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
if (this.state.isOpenedByKeyboard) {
|
|
415
|
+
var _this$dropdownButtonR;
|
|
416
|
+
var downArrowEvent = new KeyboardEvent('keydown', {
|
|
417
|
+
bubbles: true,
|
|
418
|
+
key: 'ArrowDown'
|
|
419
|
+
});
|
|
420
|
+
(_this$dropdownButtonR = this.dropdownButtonRef) === null || _this$dropdownButtonR === void 0 || _this$dropdownButtonR.dispatchEvent(downArrowEvent);
|
|
421
|
+
this.setState(_objectSpread(_objectSpread({}, this.state), {}, {
|
|
422
|
+
isOpenedByKeyboard: false
|
|
423
|
+
}));
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}, {
|
|
427
|
+
key: "renderPopup",
|
|
428
|
+
value: function renderPopup() {
|
|
429
|
+
var emojiPickerOpen = this.state.emojiPickerOpen;
|
|
430
|
+
var _this$props12 = this.props,
|
|
431
|
+
popupsMountPoint = _this$props12.popupsMountPoint,
|
|
432
|
+
popupsBoundariesElement = _this$props12.popupsBoundariesElement,
|
|
433
|
+
popupsScrollableElement = _this$props12.popupsScrollableElement,
|
|
434
|
+
emojiProvider = _this$props12.emojiProvider,
|
|
435
|
+
replacePlusMenuWithElementBrowser = _this$props12.replacePlusMenuWithElementBrowser;
|
|
436
|
+
var dropdownEmoji = this.state.dropdownItems.some(function (_ref4) {
|
|
437
|
+
var name = _ref4.value.name;
|
|
438
|
+
return name === 'emoji';
|
|
439
|
+
});
|
|
440
|
+
var dropDownButtonRef = replacePlusMenuWithElementBrowser ? this.plusButtonRef : this.dropdownButtonRef;
|
|
441
|
+
var ref = dropdownEmoji ? dropDownButtonRef : this.emojiButtonRef;
|
|
442
|
+
if (!emojiPickerOpen || !ref || !emojiProvider) {
|
|
443
|
+
return null;
|
|
444
|
+
}
|
|
445
|
+
return (0, _react2.jsx)(_ui.Popup, {
|
|
446
|
+
target: ref,
|
|
447
|
+
fitHeight: 350,
|
|
448
|
+
fitWidth: 350,
|
|
449
|
+
offset: [0, 3],
|
|
450
|
+
mountTo: popupsMountPoint,
|
|
451
|
+
boundariesElement: popupsBoundariesElement,
|
|
452
|
+
scrollableElement: popupsScrollableElement,
|
|
453
|
+
focusTrap: true,
|
|
454
|
+
zIndex: _editorSharedStyles.akEditorMenuZIndex
|
|
455
|
+
}, (0, _react2.jsx)(EmojiPickerWithListeners, {
|
|
456
|
+
emojiProvider: emojiProvider,
|
|
457
|
+
onSelection: this.handleSelectedEmoji,
|
|
458
|
+
handleClickOutside: this.handleEmojiClickOutside,
|
|
459
|
+
handleEscapeKeydown: this.handleEmojiPressEscape
|
|
460
|
+
}));
|
|
461
|
+
}
|
|
462
|
+
}, {
|
|
463
|
+
key: "render",
|
|
464
|
+
value: function render() {
|
|
465
|
+
var _this2 = this,
|
|
466
|
+
_this$props$isDisable,
|
|
467
|
+
_this$props$replacePl;
|
|
468
|
+
var _this$state = this.state,
|
|
469
|
+
buttons = _this$state.buttons,
|
|
470
|
+
dropdownItems = _this$state.dropdownItems,
|
|
471
|
+
emojiPickerOpen = _this$state.emojiPickerOpen;
|
|
472
|
+
var _this$props13 = this.props,
|
|
473
|
+
isDisabled = _this$props13.isDisabled,
|
|
474
|
+
isReducedSpacing = _this$props13.isReducedSpacing;
|
|
475
|
+
if (buttons.length === 0 && dropdownItems.length === 0) {
|
|
476
|
+
return null;
|
|
477
|
+
}
|
|
478
|
+
return (
|
|
479
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
480
|
+
(0, _react2.jsx)("span", {
|
|
481
|
+
css: _styles.buttonGroupStyle
|
|
482
|
+
}, buttons.map(function (btn) {
|
|
483
|
+
return (0, _react2.jsx)(_uiMenu.ToolbarButton, {
|
|
484
|
+
item: btn,
|
|
485
|
+
testId: String(btn.content),
|
|
486
|
+
ref: btn.value.name === 'emoji' ? _this2.handleEmojiButtonRef : noop,
|
|
487
|
+
key: btn.value.name,
|
|
488
|
+
spacing: isReducedSpacing ? 'none' : 'default',
|
|
489
|
+
disabled: isDisabled || btn.isDisabled,
|
|
490
|
+
iconBefore: btn.elemBefore,
|
|
491
|
+
selected: btn.value.name === 'emoji' && emojiPickerOpen || btn.isActive,
|
|
492
|
+
title: btn.title,
|
|
493
|
+
"aria-label": btn['aria-label'],
|
|
494
|
+
"aria-haspopup": btn['aria-haspopup'],
|
|
495
|
+
"aria-keyshortcuts": btn['aria-keyshortcuts'],
|
|
496
|
+
onItemClick: _this2.insertToolbarMenuItem
|
|
497
|
+
});
|
|
498
|
+
}), (0, _react2.jsx)("span", {
|
|
499
|
+
css: _styles.wrapperStyle
|
|
500
|
+
}, this.renderPopup(), (0, _react2.jsx)(_blockInsertMenu.BlockInsertMenu, {
|
|
501
|
+
popupsMountPoint: this.props.popupsMountPoint,
|
|
502
|
+
popupsBoundariesElement: this.props.popupsBoundariesElement,
|
|
503
|
+
popupsScrollableElement: this.props.popupsScrollableElement,
|
|
504
|
+
disabled: (_this$props$isDisable = this.props.isDisabled) !== null && _this$props$isDisable !== void 0 ? _this$props$isDisable : false,
|
|
505
|
+
editorView: this.props.editorView,
|
|
506
|
+
spacing: this.props.isReducedSpacing ? 'none' : 'default',
|
|
507
|
+
label: this.props.intl.formatMessage(_messages.messages.insertMenu),
|
|
508
|
+
open: this.state.isPlusMenuOpen,
|
|
509
|
+
plusButtonRef: this.plusButtonRef,
|
|
510
|
+
items: this.state.dropdownItems,
|
|
511
|
+
onRef: this.handleDropDownButtonRef,
|
|
512
|
+
onPlusButtonRef: this.handlePlusButtonRef,
|
|
513
|
+
onClick: this.handleClick,
|
|
514
|
+
onKeyDown: this.handleOpenByKeyboard,
|
|
515
|
+
onItemActivated: this.insertInsertMenuItem,
|
|
516
|
+
onInsert: this.insertInsertMenuItem,
|
|
517
|
+
onOpenChange: this.onOpenChange,
|
|
518
|
+
togglePlusMenuVisibility: this.togglePlusMenuVisibility,
|
|
519
|
+
replacePlusMenuWithElementBrowser: (_this$props$replacePl = this.props.replacePlusMenuWithElementBrowser) !== null && _this$props$replacePl !== void 0 ? _this$props$replacePl : false,
|
|
520
|
+
showElementBrowserLink: this.props.showElementBrowserLink || false,
|
|
521
|
+
pluginInjectionApi: this.props.pluginInjectionApi
|
|
522
|
+
})), this.props.showSeparator && (0, _react2.jsx)("span", {
|
|
523
|
+
css: _styles.separatorStyles
|
|
524
|
+
}))
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
}], [{
|
|
528
|
+
key: "getDerivedStateFromProps",
|
|
529
|
+
value: function getDerivedStateFromProps(props, state) {
|
|
530
|
+
var _createItems = (0, _createItems3.createItems)({
|
|
531
|
+
isTypeAheadAllowed: props.isTypeAheadAllowed,
|
|
532
|
+
tableSupported: props.tableSupported,
|
|
533
|
+
mediaUploadsEnabled: props.mediaUploadsEnabled,
|
|
534
|
+
mediaSupported: props.mediaSupported,
|
|
535
|
+
imageUploadSupported: props.imageUploadSupported,
|
|
536
|
+
imageUploadEnabled: props.imageUploadEnabled,
|
|
537
|
+
mentionsSupported: props.mentionsSupported,
|
|
538
|
+
mentionsDisabled: props.mentionsDisabled,
|
|
539
|
+
actionSupported: props.actionSupported,
|
|
540
|
+
decisionSupported: props.decisionSupported,
|
|
541
|
+
linkSupported: props.linkSupported,
|
|
542
|
+
linkDisabled: props.linkDisabled,
|
|
543
|
+
emojiDisabled: props.emojiDisabled,
|
|
544
|
+
nativeStatusSupported: props.nativeStatusSupported,
|
|
545
|
+
dateEnabled: props.dateEnabled,
|
|
546
|
+
placeholderTextEnabled: props.placeholderTextEnabled,
|
|
547
|
+
horizontalRuleEnabled: props.horizontalRuleEnabled,
|
|
548
|
+
layoutSectionEnabled: props.layoutSectionEnabled,
|
|
549
|
+
expandEnabled: props.expandEnabled,
|
|
550
|
+
showElementBrowserLink: props.showElementBrowserLink,
|
|
551
|
+
emojiProvider: props.emojiProvider,
|
|
552
|
+
availableWrapperBlockTypes: props.availableWrapperBlockTypes,
|
|
553
|
+
insertMenuItems: props.insertMenuItems,
|
|
554
|
+
schema: props.editorView.state.schema,
|
|
555
|
+
numberOfButtons: props.buttons,
|
|
556
|
+
formatMessage: props.intl.formatMessage,
|
|
557
|
+
isNewMenuEnabled: props.replacePlusMenuWithElementBrowser
|
|
558
|
+
}),
|
|
559
|
+
_createItems2 = (0, _slicedToArray2.default)(_createItems, 2),
|
|
560
|
+
buttons = _createItems2[0],
|
|
561
|
+
dropdownItems = _createItems2[1];
|
|
562
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
563
|
+
buttons: buttons,
|
|
564
|
+
dropdownItems: dropdownItems
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
}]);
|
|
568
|
+
return ToolbarInsertBlock;
|
|
569
|
+
}(_react.default.PureComponent);
|
|
570
|
+
var _default = exports.default = (0, _reactIntlNext.injectIntl)(ToolbarInsertBlock);
|