@bigbinary/neeto-editor 1.40.0 → 1.40.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/dist/Attachments.js +17 -5
- package/dist/Attachments.js.map +1 -1
- package/dist/Editor.js +629 -508
- package/dist/Editor.js.map +1 -1
- package/dist/EditorContent.js +50 -41
- package/dist/EditorContent.js.map +1 -1
- package/dist/FormikEditor.js +91 -30
- package/dist/FormikEditor.js.map +1 -1
- package/dist/Menu.js +45 -5
- package/dist/Menu.js.map +1 -1
- package/dist/{chunk-b39dfdd8.js → chunk-27a003fe.js} +831 -708
- package/dist/{chunk-b39dfdd8.js.map → chunk-27a003fe.js.map} +1 -1
- package/dist/{chunk-6dabc0b1.js → chunk-54bb591c.js} +66 -43
- package/dist/{chunk-6dabc0b1.js.map → chunk-54bb591c.js.map} +1 -1
- package/dist/{chunk-52091cdb.js → chunk-91e5e60f.js} +186 -152
- package/dist/chunk-91e5e60f.js.map +1 -0
- package/dist/{chunk-c1e6a992.js → chunk-eafe8fe4.js} +24 -18
- package/dist/{chunk-c1e6a992.js.map → chunk-eafe8fe4.js.map} +1 -1
- package/dist/cjs/Attachments.cjs.js +17 -5
- package/dist/cjs/Attachments.cjs.js.map +1 -1
- package/dist/cjs/Editor.cjs.js +705 -548
- package/dist/cjs/Editor.cjs.js.map +1 -1
- package/dist/cjs/EditorContent.cjs.js +61 -50
- package/dist/cjs/EditorContent.cjs.js.map +1 -1
- package/dist/cjs/FormikEditor.cjs.js +94 -33
- package/dist/cjs/FormikEditor.cjs.js.map +1 -1
- package/dist/cjs/Menu.cjs.js +45 -5
- package/dist/cjs/Menu.cjs.js.map +1 -1
- package/dist/cjs/{chunk-d12e89fd.cjs.js → chunk-242eea5e.cjs.js} +1033 -874
- package/dist/cjs/{chunk-d12e89fd.cjs.js.map → chunk-242eea5e.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-d0720eac.cjs.js → chunk-391e4970.cjs.js} +214 -170
- package/dist/cjs/chunk-391e4970.cjs.js.map +1 -0
- package/dist/cjs/{chunk-3777ae13.cjs.js → chunk-969db227.cjs.js} +88 -60
- package/dist/cjs/{chunk-3777ae13.cjs.js.map → chunk-969db227.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-76a5f21a.cjs.js → chunk-ae47a2a1.cjs.js} +41 -31
- package/dist/cjs/{chunk-76a5f21a.cjs.js.map → chunk-ae47a2a1.cjs.js.map} +1 -1
- package/dist/cjs/index.cjs.js +65 -7
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/editor-stats.html +1 -1
- package/dist/index.js +65 -7
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
- package/dist/chunk-52091cdb.js.map +0 -1
- package/dist/cjs/chunk-d0720eac.cjs.js.map +0 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import _extends$1 from '@babel/runtime/helpers/extends';
|
|
2
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
2
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
4
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
5
|
-
import React__default, { forwardRef, createContext, useRef, useState, useEffect, useContext, memo, useCallback, useMemo } from 'react';
|
|
4
|
+
import React__default, { forwardRef, createContext, useRef, useState, useEffect, useContext, memo, useCallback, useMemo, createElement } from 'react';
|
|
6
5
|
import { isEmpty, fromPairs, prop, not, assoc, last } from 'ramda';
|
|
7
6
|
import { n } from './chunk-15c449f1.js';
|
|
8
7
|
import i18n, { t as t$1 } from 'i18next';
|
|
@@ -13,10 +12,36 @@ import classnames from 'classnames';
|
|
|
13
12
|
import { Y as YOUTUBE_URL_REGEXP, V as VIMEO_URL_REGEXP, L as LOOM_URL_REGEXP, N as NEETO_RECORD_URL_REGEXP, U as URL_REGEXP, E as EDITOR_OPTIONS, a as UNSPLASH_BASE_URL } from './chunk-edd8b9fe.js';
|
|
14
13
|
import { hyphenate, isNotPresent, noop, isNotEmpty, findBy } from '@bigbinary/neeto-cist';
|
|
15
14
|
import 'tippy.js/dist/svg-arrow.css';
|
|
16
|
-
import
|
|
17
|
-
import
|
|
15
|
+
import Link from '@bigbinary/neeto-icons/Link';
|
|
16
|
+
import Column from '@bigbinary/neeto-icons/Column';
|
|
17
|
+
import Dropdown$1 from '@bigbinary/neetoui/Dropdown';
|
|
18
18
|
import { useTranslation } from 'react-i18next';
|
|
19
|
+
import Close from '@bigbinary/neeto-icons/Close';
|
|
20
|
+
import Button$1 from '@bigbinary/neetoui/Button';
|
|
21
|
+
import { jsxs, jsx, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
19
22
|
import { withEventTargetValue } from '@bigbinary/neeto-commons-frontend/utils';
|
|
23
|
+
import Check from '@bigbinary/neeto-icons/Check';
|
|
24
|
+
import Label from '@bigbinary/neetoui/Label';
|
|
25
|
+
import Quote from '@bigbinary/neeto-icons/Quote';
|
|
26
|
+
import Attachment from '@bigbinary/neeto-icons/Attachment';
|
|
27
|
+
import CodeBlock from '@bigbinary/neeto-icons/CodeBlock';
|
|
28
|
+
import Code from '@bigbinary/neeto-icons/Code';
|
|
29
|
+
import Highlight from '@bigbinary/neeto-icons/Highlight';
|
|
30
|
+
import TextBold from '@bigbinary/neeto-icons/TextBold';
|
|
31
|
+
import TextCross from '@bigbinary/neeto-icons/TextCross';
|
|
32
|
+
import TextItalic from '@bigbinary/neeto-icons/TextItalic';
|
|
33
|
+
import Underline from '@bigbinary/neeto-icons/Underline';
|
|
34
|
+
import ListDot from '@bigbinary/neeto-icons/ListDot';
|
|
35
|
+
import ListNumber from '@bigbinary/neeto-icons/ListNumber';
|
|
36
|
+
import ImageUpload from '@bigbinary/neeto-icons/ImageUpload';
|
|
37
|
+
import Video from '@bigbinary/neeto-icons/Video';
|
|
38
|
+
import MediaVideo from '@bigbinary/neeto-icons/MediaVideo';
|
|
39
|
+
import Undo from '@bigbinary/neeto-icons/Undo';
|
|
40
|
+
import Redo from '@bigbinary/neeto-icons/Redo';
|
|
41
|
+
import Email from '@bigbinary/neeto-icons/Email';
|
|
42
|
+
import Avatar from '@bigbinary/neetoui/Avatar';
|
|
43
|
+
import Typography from '@bigbinary/neetoui/Typography';
|
|
44
|
+
import Smiley from '@bigbinary/neeto-icons/Smiley';
|
|
20
45
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
21
46
|
import _classCallCheck$1 from '@babel/runtime/helpers/classCallCheck';
|
|
22
47
|
import _createClass$1 from '@babel/runtime/helpers/createClass';
|
|
@@ -27,14 +52,24 @@ import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
|
27
52
|
import { Picker } from 'emoji-mart';
|
|
28
53
|
import axios from 'axios';
|
|
29
54
|
import { withImmutableActions, useOnClickOutside, withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
55
|
+
import Customize from '@bigbinary/neeto-icons/Customize';
|
|
56
|
+
import Refresh from '@bigbinary/neeto-icons/Refresh';
|
|
57
|
+
import Input from '@bigbinary/neetoui/Input';
|
|
30
58
|
import { HexColorPicker } from 'react-colorful';
|
|
31
59
|
import _objectWithoutProperties$1 from '@babel/runtime/helpers/objectWithoutProperties';
|
|
32
60
|
import DynamicVariables from '@bigbinary/neeto-molecules/DynamicVariables';
|
|
33
|
-
import
|
|
61
|
+
import Modal from '@bigbinary/neetoui/Modal';
|
|
62
|
+
import Tab from '@bigbinary/neetoui/Tab';
|
|
63
|
+
import { F as File, u as useFileUploader, b as useDropFiles, A as ALLOWED_IMAGE_TYPES, e as ALLOWED_VIDEO_TYPES, f as convertToFileSize, g as DEFAULT_IMAGE_UPLOAD_CONFIG, h as DEFAULT_VIDEO_UPLOAD_CONFIG, p as propTypesExports, i as getTabs } from './chunk-eafe8fe4.js';
|
|
64
|
+
import Tooltip from '@bigbinary/neetoui/Tooltip';
|
|
65
|
+
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
34
66
|
import { a as getAugmentedNamespace } from './chunk-65f73e5a.js';
|
|
67
|
+
import Checkbox from '@bigbinary/neetoui/Checkbox';
|
|
35
68
|
import { shallow } from 'zustand/shallow';
|
|
36
69
|
import { create } from 'zustand';
|
|
70
|
+
import MenuHorizontal from '@bigbinary/neeto-icons/MenuHorizontal';
|
|
37
71
|
import Tippy from '@tippyjs/react';
|
|
72
|
+
import File$1 from '@bigbinary/neeto-icons/File';
|
|
38
73
|
|
|
39
74
|
const domIndex = function (node) {
|
|
40
75
|
for (var index = 0;; index++) {
|
|
@@ -12072,33 +12107,39 @@ var EmbedOption = function EmbedOption(_ref) {
|
|
|
12072
12107
|
handleClose();
|
|
12073
12108
|
}
|
|
12074
12109
|
};
|
|
12075
|
-
return /*#__PURE__*/
|
|
12110
|
+
return /*#__PURE__*/jsxs(Modal, {
|
|
12076
12111
|
className: "ne-embed-modal-wrapper",
|
|
12077
12112
|
initialFocusRef: inputRef,
|
|
12078
12113
|
isOpen: isEmbedModalOpen,
|
|
12079
|
-
onClose: handleClose
|
|
12080
|
-
|
|
12081
|
-
|
|
12082
|
-
|
|
12083
|
-
|
|
12084
|
-
|
|
12085
|
-
|
|
12086
|
-
|
|
12087
|
-
|
|
12088
|
-
|
|
12089
|
-
|
|
12090
|
-
|
|
12091
|
-
|
|
12092
|
-
|
|
12093
|
-
|
|
12094
|
-
|
|
12095
|
-
|
|
12096
|
-
|
|
12097
|
-
|
|
12098
|
-
|
|
12099
|
-
|
|
12100
|
-
|
|
12101
|
-
|
|
12114
|
+
onClose: handleClose,
|
|
12115
|
+
children: [/*#__PURE__*/jsx(Modal.Header, {
|
|
12116
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
12117
|
+
style: "h2",
|
|
12118
|
+
children: t("neetoEditor.menu.embedVideo")
|
|
12119
|
+
})
|
|
12120
|
+
}), /*#__PURE__*/jsx(Modal.Body, {
|
|
12121
|
+
className: "ne-embed-modal space-y-2",
|
|
12122
|
+
children: /*#__PURE__*/jsx(Input, {
|
|
12123
|
+
"data-cy": "neeto-editor-embed-input",
|
|
12124
|
+
error: error && t("neetoEditor.error.invalidEmbedUrl"),
|
|
12125
|
+
label: t("neetoEditor.common.videoUrl"),
|
|
12126
|
+
ref: inputRef,
|
|
12127
|
+
size: "medium",
|
|
12128
|
+
type: "text",
|
|
12129
|
+
value: embedUrl,
|
|
12130
|
+
onChange: withEventTargetValue(handleChange),
|
|
12131
|
+
onKeyDown: handleKeyDown
|
|
12132
|
+
})
|
|
12133
|
+
}), /*#__PURE__*/jsx(Modal.Footer, {
|
|
12134
|
+
className: "space-x-2",
|
|
12135
|
+
children: /*#__PURE__*/jsx(Button$1, {
|
|
12136
|
+
"data-cy": "neeto-editor-embed-cancel",
|
|
12137
|
+
disabled: error || isEmpty(embedUrl),
|
|
12138
|
+
label: t("neetoEditor.common.embed"),
|
|
12139
|
+
onClick: handleEmbed
|
|
12140
|
+
})
|
|
12141
|
+
})]
|
|
12142
|
+
});
|
|
12102
12143
|
};
|
|
12103
12144
|
|
|
12104
12145
|
var fetch = function fetch() {
|
|
@@ -12108,8 +12149,8 @@ var emojiPickerApi = {
|
|
|
12108
12149
|
fetch: fetch
|
|
12109
12150
|
};
|
|
12110
12151
|
|
|
12111
|
-
function ownKeys$
|
|
12112
|
-
function _objectSpread$
|
|
12152
|
+
function ownKeys$b(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; }
|
|
12153
|
+
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12113
12154
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn$1(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12114
12155
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
12115
12156
|
var EmojiPickerMenu = /*#__PURE__*/function (_React$Component) {
|
|
@@ -12161,7 +12202,7 @@ var EmojiPickerMenu = /*#__PURE__*/function (_React$Component) {
|
|
|
12161
12202
|
return _createClass$1(EmojiPickerMenu, [{
|
|
12162
12203
|
key: "componentDidMount",
|
|
12163
12204
|
value: function componentDidMount() {
|
|
12164
|
-
new Picker(_objectSpread$
|
|
12205
|
+
new Picker(_objectSpread$b(_objectSpread$b({}, this.props), {}, {
|
|
12165
12206
|
onEmojiSelect: this.handleSelect,
|
|
12166
12207
|
style: {
|
|
12167
12208
|
maxWidth: "100%"
|
|
@@ -12177,7 +12218,7 @@ var EmojiPickerMenu = /*#__PURE__*/function (_React$Component) {
|
|
|
12177
12218
|
}, {
|
|
12178
12219
|
key: "render",
|
|
12179
12220
|
value: function render() {
|
|
12180
|
-
return /*#__PURE__*/
|
|
12221
|
+
return /*#__PURE__*/jsx("div", {
|
|
12181
12222
|
"data-cy": "neeto-editor-emoji-picker",
|
|
12182
12223
|
ref: this.ref,
|
|
12183
12224
|
style: {
|
|
@@ -12219,6 +12260,8 @@ var useEditorStore = create(withImmutableActions(function (set) {
|
|
|
12219
12260
|
};
|
|
12220
12261
|
}));
|
|
12221
12262
|
|
|
12263
|
+
function ownKeys$a(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; }
|
|
12264
|
+
function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$a(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12222
12265
|
var MenuButton = function MenuButton(_ref) {
|
|
12223
12266
|
var icon = _ref.icon,
|
|
12224
12267
|
command = _ref.command,
|
|
@@ -12237,7 +12280,7 @@ var MenuButton = function MenuButton(_ref) {
|
|
|
12237
12280
|
isActive = _useEditorStore.isActive,
|
|
12238
12281
|
_useEditorStore$disab = _useEditorStore.disabled,
|
|
12239
12282
|
disabled = _useEditorStore$disab === void 0 ? isButtonDisabled : _useEditorStore$disab;
|
|
12240
|
-
return /*#__PURE__*/
|
|
12283
|
+
return /*#__PURE__*/jsx(Button$1, _objectSpread$a({
|
|
12241
12284
|
disabled: disabled,
|
|
12242
12285
|
icon: icon,
|
|
12243
12286
|
className: "neeto-editor-fixed-menu__item",
|
|
@@ -12257,9 +12300,10 @@ var MenuItem$3 = Dropdown$1.MenuItem;
|
|
|
12257
12300
|
var SecondaryMenuTarget = function SecondaryMenuTarget(_ref) {
|
|
12258
12301
|
var Icon = _ref.icon,
|
|
12259
12302
|
label = _ref.label;
|
|
12260
|
-
return /*#__PURE__*/
|
|
12261
|
-
"data-cy": "neeto-editor-fixed-menu-".concat(hyphenate(label), "-option")
|
|
12262
|
-
|
|
12303
|
+
return /*#__PURE__*/jsxs(MenuItem$3.Button, {
|
|
12304
|
+
"data-cy": "neeto-editor-fixed-menu-".concat(hyphenate(label), "-option"),
|
|
12305
|
+
children: [/*#__PURE__*/jsx(Icon, {}), " ", label]
|
|
12306
|
+
});
|
|
12263
12307
|
};
|
|
12264
12308
|
|
|
12265
12309
|
var EmojiOption = function EmojiOption(_ref) {
|
|
@@ -12270,7 +12314,7 @@ var EmojiOption = function EmojiOption(_ref) {
|
|
|
12270
12314
|
_ref$isSecondaryMenu = _ref.isSecondaryMenu,
|
|
12271
12315
|
isSecondaryMenu = _ref$isSecondaryMenu === void 0 ? false : _ref$isSecondaryMenu,
|
|
12272
12316
|
label = _ref.label;
|
|
12273
|
-
return /*#__PURE__*/
|
|
12317
|
+
return /*#__PURE__*/jsx(Dropdown$1, {
|
|
12274
12318
|
buttonStyle: "text",
|
|
12275
12319
|
closeOnSelect: false,
|
|
12276
12320
|
dropdownProps: {
|
|
@@ -12289,7 +12333,7 @@ var EmojiOption = function EmojiOption(_ref) {
|
|
|
12289
12333
|
className: "neeto-editor-fixed-menu__item",
|
|
12290
12334
|
"data-cy": "neeto-editor-fixed-menu-emoji-option"
|
|
12291
12335
|
},
|
|
12292
|
-
customTarget: isSecondaryMenu && /*#__PURE__*/
|
|
12336
|
+
customTarget: isSecondaryMenu && /*#__PURE__*/jsx(SecondaryMenuTarget, {
|
|
12293
12337
|
label: label,
|
|
12294
12338
|
icon: Smiley
|
|
12295
12339
|
}),
|
|
@@ -12301,11 +12345,12 @@ var EmojiOption = function EmojiOption(_ref) {
|
|
|
12301
12345
|
return !active;
|
|
12302
12346
|
});
|
|
12303
12347
|
isSecondaryMenu && e.stopPropagation();
|
|
12304
|
-
}
|
|
12305
|
-
|
|
12306
|
-
|
|
12307
|
-
|
|
12308
|
-
|
|
12348
|
+
},
|
|
12349
|
+
children: /*#__PURE__*/jsx(EmojiPickerMenu, {
|
|
12350
|
+
editor: editor,
|
|
12351
|
+
setActive: setActive
|
|
12352
|
+
})
|
|
12353
|
+
});
|
|
12309
12354
|
};
|
|
12310
12355
|
var EmojiOption$1 = /*#__PURE__*/memo(EmojiOption);
|
|
12311
12356
|
|
|
@@ -12351,27 +12396,28 @@ var LinkOption = function LinkOption(_ref) {
|
|
|
12351
12396
|
handleClose();
|
|
12352
12397
|
}
|
|
12353
12398
|
};
|
|
12354
|
-
return /*#__PURE__*/
|
|
12399
|
+
return /*#__PURE__*/jsxs("div", {
|
|
12355
12400
|
className: "neeto-editor-bubble-menu__link",
|
|
12356
|
-
onKeyDown: handleKeyDown
|
|
12357
|
-
|
|
12358
|
-
|
|
12359
|
-
|
|
12360
|
-
|
|
12361
|
-
|
|
12362
|
-
|
|
12363
|
-
|
|
12364
|
-
|
|
12365
|
-
|
|
12366
|
-
|
|
12367
|
-
|
|
12368
|
-
|
|
12369
|
-
|
|
12370
|
-
|
|
12371
|
-
|
|
12372
|
-
|
|
12373
|
-
|
|
12374
|
-
|
|
12401
|
+
onKeyDown: handleKeyDown,
|
|
12402
|
+
children: [/*#__PURE__*/jsx("input", {
|
|
12403
|
+
autoFocus: true,
|
|
12404
|
+
className: "neeto-editor-bubble-menu-link__input",
|
|
12405
|
+
"data-cy": "neeto-editor-link-input",
|
|
12406
|
+
name: "url",
|
|
12407
|
+
placeholder: t("neetoEditor.placeholders.linkInput"),
|
|
12408
|
+
value: link,
|
|
12409
|
+
onChange: function onChange(_ref2) {
|
|
12410
|
+
var value = _ref2.target.value;
|
|
12411
|
+
return setLink(value);
|
|
12412
|
+
}
|
|
12413
|
+
}), /*#__PURE__*/jsx(Button$1, {
|
|
12414
|
+
"data-cy": "neeto-editor-link-cancel-button",
|
|
12415
|
+
icon: Close,
|
|
12416
|
+
size: "small",
|
|
12417
|
+
style: "secondary",
|
|
12418
|
+
onClick: handleReset
|
|
12419
|
+
})]
|
|
12420
|
+
});
|
|
12375
12421
|
};
|
|
12376
12422
|
|
|
12377
12423
|
var TableOption$2 = function TableOption(_ref) {
|
|
@@ -12396,46 +12442,54 @@ var TableOption$2 = function TableOption(_ref) {
|
|
|
12396
12442
|
setColumns(3);
|
|
12397
12443
|
handleClose();
|
|
12398
12444
|
};
|
|
12399
|
-
return /*#__PURE__*/
|
|
12400
|
-
className: "neeto-editor-bubble-menu__table"
|
|
12401
|
-
|
|
12402
|
-
|
|
12403
|
-
|
|
12404
|
-
|
|
12405
|
-
|
|
12406
|
-
|
|
12407
|
-
|
|
12408
|
-
|
|
12409
|
-
|
|
12410
|
-
|
|
12411
|
-
|
|
12412
|
-
|
|
12413
|
-
|
|
12414
|
-
|
|
12415
|
-
|
|
12416
|
-
|
|
12417
|
-
|
|
12418
|
-
|
|
12419
|
-
|
|
12420
|
-
|
|
12421
|
-
|
|
12422
|
-
|
|
12423
|
-
|
|
12424
|
-
|
|
12425
|
-
|
|
12426
|
-
|
|
12427
|
-
|
|
12428
|
-
|
|
12429
|
-
|
|
12430
|
-
|
|
12431
|
-
|
|
12432
|
-
|
|
12433
|
-
|
|
12434
|
-
|
|
12435
|
-
|
|
12436
|
-
|
|
12445
|
+
return /*#__PURE__*/jsxs("div", {
|
|
12446
|
+
className: "neeto-editor-bubble-menu__table",
|
|
12447
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
12448
|
+
className: "neeto-editor-bubble-menu__table__menu-item",
|
|
12449
|
+
children: [/*#__PURE__*/jsx(Label, {
|
|
12450
|
+
className: "neeto-editor-bubble-menu__table__input-label",
|
|
12451
|
+
children: t("neetoEditor.menu.rows")
|
|
12452
|
+
}), /*#__PURE__*/jsx("input", {
|
|
12453
|
+
autoFocus: true,
|
|
12454
|
+
"data-cy": "neeto-editor-fixed-menu-table-option-input",
|
|
12455
|
+
min: "1",
|
|
12456
|
+
placeholder: t("neetoEditor.placeholders.rows"),
|
|
12457
|
+
type: "number",
|
|
12458
|
+
value: rows,
|
|
12459
|
+
onChange: withEventTargetValue(setRows)
|
|
12460
|
+
})]
|
|
12461
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
12462
|
+
className: "neeto-editor-bubble-menu__table__menu-item",
|
|
12463
|
+
children: [/*#__PURE__*/jsx(Label, {
|
|
12464
|
+
className: "neeto-editor-bubble-menu__table__input-label",
|
|
12465
|
+
children: t("neetoEditor.menu.columns")
|
|
12466
|
+
}), /*#__PURE__*/jsx("input", {
|
|
12467
|
+
"data-cy": "neeto-editor-bubble-menu-table-option-input",
|
|
12468
|
+
min: "1",
|
|
12469
|
+
placeholder: t("neetoEditor.placeholders.columns"),
|
|
12470
|
+
type: "number",
|
|
12471
|
+
value: columns,
|
|
12472
|
+
onChange: withEventTargetValue(setColumns)
|
|
12473
|
+
})]
|
|
12474
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
12475
|
+
className: "neeto-editor-bubble-menu__table__buttons",
|
|
12476
|
+
children: [/*#__PURE__*/jsx(Button$1, {
|
|
12477
|
+
"data-cy": "neeto-editor-bubble-menu-table-option-create-button",
|
|
12478
|
+
icon: Check,
|
|
12479
|
+
style: "secondary",
|
|
12480
|
+
onClick: handleSubmit
|
|
12481
|
+
}), /*#__PURE__*/jsx(Button$1, {
|
|
12482
|
+
"data-cy": "neeto-editor-bubble-menu-table-option-create-button",
|
|
12483
|
+
icon: Close,
|
|
12484
|
+
style: "secondary",
|
|
12485
|
+
onClick: handleClose
|
|
12486
|
+
})]
|
|
12487
|
+
})]
|
|
12488
|
+
});
|
|
12437
12489
|
};
|
|
12438
12490
|
|
|
12491
|
+
function ownKeys$9(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; }
|
|
12492
|
+
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12439
12493
|
var createMenuOptions$2 = function createMenuOptions(_ref) {
|
|
12440
12494
|
var tooltips = _ref.tooltips,
|
|
12441
12495
|
editor = _ref.editor,
|
|
@@ -12672,10 +12726,9 @@ var renderOptionButton = function renderOptionButton(_ref4) {
|
|
|
12672
12726
|
active = _ref4.active,
|
|
12673
12727
|
optionName = _ref4.optionName,
|
|
12674
12728
|
highlight = _ref4.highlight;
|
|
12675
|
-
return /*#__PURE__*/
|
|
12729
|
+
return /*#__PURE__*/jsx(Button$1, _objectSpread$9({
|
|
12676
12730
|
"data-cy": "neeto-editor-bubble-menu-".concat(optionName, "-option"),
|
|
12677
12731
|
icon: Icon,
|
|
12678
|
-
key: optionName,
|
|
12679
12732
|
size: "small",
|
|
12680
12733
|
style: active ? "secondary" : "text",
|
|
12681
12734
|
tooltipProps: {
|
|
@@ -12685,7 +12738,7 @@ var renderOptionButton = function renderOptionButton(_ref4) {
|
|
|
12685
12738
|
delay: [500]
|
|
12686
12739
|
},
|
|
12687
12740
|
onClick: command
|
|
12688
|
-
}, generateFocusProps(highlight)));
|
|
12741
|
+
}, generateFocusProps(highlight)), optionName);
|
|
12689
12742
|
};
|
|
12690
12743
|
|
|
12691
12744
|
var Menu$4 = Dropdown$1.Menu,
|
|
@@ -12698,7 +12751,7 @@ var Mentions = function Mentions(_ref) {
|
|
|
12698
12751
|
isSecondaryMenu = _ref$isSecondaryMenu === void 0 ? false : _ref$isSecondaryMenu,
|
|
12699
12752
|
label = _ref.label;
|
|
12700
12753
|
if (isEmpty(mentions)) return null;
|
|
12701
|
-
return /*#__PURE__*/
|
|
12754
|
+
return /*#__PURE__*/jsx(Dropdown$1, {
|
|
12702
12755
|
buttonStyle: "text",
|
|
12703
12756
|
"data-cy": "neeto-editor-mention-option",
|
|
12704
12757
|
icon: Email,
|
|
@@ -12711,36 +12764,40 @@ var Mentions = function Mentions(_ref) {
|
|
|
12711
12764
|
},
|
|
12712
12765
|
className: "neeto-editor-fixed-menu__item"
|
|
12713
12766
|
},
|
|
12714
|
-
customTarget: isSecondaryMenu && /*#__PURE__*/
|
|
12767
|
+
customTarget: isSecondaryMenu && /*#__PURE__*/jsx(SecondaryMenuTarget, {
|
|
12715
12768
|
label: label,
|
|
12716
12769
|
icon: Email
|
|
12717
12770
|
}),
|
|
12718
12771
|
onClick: function onClick(e) {
|
|
12719
12772
|
return isSecondaryMenu && e.stopPropagation();
|
|
12720
|
-
}
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
|
|
12724
|
-
|
|
12725
|
-
|
|
12726
|
-
|
|
12727
|
-
|
|
12728
|
-
|
|
12729
|
-
|
|
12730
|
-
|
|
12731
|
-
|
|
12732
|
-
|
|
12733
|
-
|
|
12734
|
-
|
|
12735
|
-
|
|
12736
|
-
|
|
12737
|
-
|
|
12738
|
-
|
|
12739
|
-
|
|
12740
|
-
|
|
12741
|
-
|
|
12742
|
-
|
|
12743
|
-
|
|
12773
|
+
},
|
|
12774
|
+
children: /*#__PURE__*/jsx(Menu$4, {
|
|
12775
|
+
children: mentions.map(function (_ref2) {
|
|
12776
|
+
var key = _ref2.key,
|
|
12777
|
+
name = _ref2.name,
|
|
12778
|
+
imageUrl = _ref2.imageUrl;
|
|
12779
|
+
return /*#__PURE__*/jsxs(MenuItem$2.Button, {
|
|
12780
|
+
"data-cy": "neeto-editor-mention-option-".concat(key),
|
|
12781
|
+
onClick: function onClick() {
|
|
12782
|
+
return editor.commands.setMention({
|
|
12783
|
+
id: key,
|
|
12784
|
+
label: name
|
|
12785
|
+
});
|
|
12786
|
+
},
|
|
12787
|
+
children: [/*#__PURE__*/jsx(Avatar, {
|
|
12788
|
+
size: "small",
|
|
12789
|
+
user: {
|
|
12790
|
+
name: name,
|
|
12791
|
+
imageUrl: imageUrl
|
|
12792
|
+
}
|
|
12793
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
12794
|
+
style: "body2",
|
|
12795
|
+
children: name
|
|
12796
|
+
})]
|
|
12797
|
+
}, key);
|
|
12798
|
+
})
|
|
12799
|
+
})
|
|
12800
|
+
});
|
|
12744
12801
|
};
|
|
12745
12802
|
var Mentions$1 = /*#__PURE__*/memo(Mentions);
|
|
12746
12803
|
|
|
@@ -12784,7 +12841,7 @@ var TextColorOption = function TextColorOption(_ref) {
|
|
|
12784
12841
|
setColor(editor.getAttributes("textStyle").color);
|
|
12785
12842
|
setIsOpen(not);
|
|
12786
12843
|
};
|
|
12787
|
-
return /*#__PURE__*/
|
|
12844
|
+
return /*#__PURE__*/jsx(Dropdown$1, {
|
|
12788
12845
|
isOpen: isOpen,
|
|
12789
12846
|
buttonStyle: isOpen || color ? "secondary" : "text",
|
|
12790
12847
|
icon: Customize,
|
|
@@ -12796,56 +12853,59 @@ var TextColorOption = function TextColorOption(_ref) {
|
|
|
12796
12853
|
},
|
|
12797
12854
|
className: "neeto-editor-fixed-menu__item neeto-editor-text-color-option"
|
|
12798
12855
|
},
|
|
12799
|
-
customTarget: isSecondaryMenu && /*#__PURE__*/
|
|
12856
|
+
customTarget: isSecondaryMenu && /*#__PURE__*/jsx(SecondaryMenuTarget, {
|
|
12800
12857
|
label: label,
|
|
12801
12858
|
icon: Customize
|
|
12802
12859
|
}),
|
|
12803
|
-
onClick: openColorPicker
|
|
12804
|
-
|
|
12805
|
-
|
|
12806
|
-
|
|
12807
|
-
|
|
12808
|
-
|
|
12809
|
-
|
|
12810
|
-
|
|
12811
|
-
|
|
12812
|
-
|
|
12813
|
-
|
|
12814
|
-
|
|
12815
|
-
|
|
12816
|
-
|
|
12817
|
-
|
|
12818
|
-
|
|
12819
|
-
|
|
12820
|
-
|
|
12821
|
-
|
|
12822
|
-
|
|
12823
|
-
|
|
12824
|
-
|
|
12825
|
-
|
|
12826
|
-
|
|
12827
|
-
|
|
12828
|
-
|
|
12829
|
-
|
|
12830
|
-
|
|
12831
|
-
|
|
12832
|
-
|
|
12833
|
-
|
|
12834
|
-
|
|
12835
|
-
|
|
12836
|
-
|
|
12837
|
-
|
|
12838
|
-
|
|
12839
|
-
|
|
12840
|
-
|
|
12841
|
-
|
|
12842
|
-
|
|
12843
|
-
|
|
12844
|
-
|
|
12845
|
-
|
|
12846
|
-
|
|
12847
|
-
|
|
12848
|
-
|
|
12860
|
+
onClick: openColorPicker,
|
|
12861
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
12862
|
+
ref: dropdownWrapperRef,
|
|
12863
|
+
style: {
|
|
12864
|
+
"min-width": "236px"
|
|
12865
|
+
},
|
|
12866
|
+
onClick: function onClick(e) {
|
|
12867
|
+
e.stopPropagation();
|
|
12868
|
+
},
|
|
12869
|
+
children: [/*#__PURE__*/jsx(HexColorPicker, {
|
|
12870
|
+
color: color || "#000000",
|
|
12871
|
+
onChange: setColor
|
|
12872
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
12873
|
+
className: "neeto-editor-text-color-option__options-group",
|
|
12874
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
12875
|
+
autoFocus: true,
|
|
12876
|
+
className: "neeto-editor-text-color-option__options-group__input",
|
|
12877
|
+
placeholder: t("neetoEditor.placeholders.pickColor"),
|
|
12878
|
+
size: "small",
|
|
12879
|
+
value: color,
|
|
12880
|
+
onChange: withEventTargetValue(setColor),
|
|
12881
|
+
onClick: function onClick(event) {
|
|
12882
|
+
return event.stopPropagation();
|
|
12883
|
+
}
|
|
12884
|
+
}), /*#__PURE__*/jsx(Button$1, {
|
|
12885
|
+
icon: Check,
|
|
12886
|
+
size: "small",
|
|
12887
|
+
onClick: handleSave
|
|
12888
|
+
}), /*#__PURE__*/jsx(Button$1, {
|
|
12889
|
+
icon: Close,
|
|
12890
|
+
size: "small",
|
|
12891
|
+
style: "text",
|
|
12892
|
+
onClick: function onClick() {
|
|
12893
|
+
editor.commands.focus();
|
|
12894
|
+
setIsOpen(false);
|
|
12895
|
+
}
|
|
12896
|
+
}), /*#__PURE__*/jsx(Button$1, {
|
|
12897
|
+
icon: Refresh,
|
|
12898
|
+
size: "small",
|
|
12899
|
+
style: "text",
|
|
12900
|
+
tooltipProps: {
|
|
12901
|
+
content: t("neetoEditor.common.resetToDefault"),
|
|
12902
|
+
position: "top"
|
|
12903
|
+
},
|
|
12904
|
+
onClick: handleUnset
|
|
12905
|
+
})]
|
|
12906
|
+
})]
|
|
12907
|
+
})
|
|
12908
|
+
});
|
|
12849
12909
|
};
|
|
12850
12910
|
|
|
12851
12911
|
var Options = function Options(_ref) {
|
|
@@ -12895,7 +12955,7 @@ var Options = function Options(_ref) {
|
|
|
12895
12955
|
}, 1000);
|
|
12896
12956
|
};
|
|
12897
12957
|
if (isLinkOptionActive) {
|
|
12898
|
-
return /*#__PURE__*/
|
|
12958
|
+
return /*#__PURE__*/jsx(LinkOption, {
|
|
12899
12959
|
editor: editor,
|
|
12900
12960
|
handleAnimateInvalidLink: handleAnimateInvalidLink,
|
|
12901
12961
|
handleClose: function handleClose() {
|
|
@@ -12904,56 +12964,61 @@ var Options = function Options(_ref) {
|
|
|
12904
12964
|
});
|
|
12905
12965
|
}
|
|
12906
12966
|
if (isTableOptionActive) {
|
|
12907
|
-
return /*#__PURE__*/
|
|
12967
|
+
return /*#__PURE__*/jsx(TableOption$2, {
|
|
12908
12968
|
editor: editor,
|
|
12909
12969
|
handleClose: function handleClose() {
|
|
12910
12970
|
return setIsTableOptionActive(false);
|
|
12911
12971
|
}
|
|
12912
12972
|
});
|
|
12913
12973
|
}
|
|
12914
|
-
return /*#__PURE__*/
|
|
12915
|
-
|
|
12916
|
-
|
|
12917
|
-
|
|
12918
|
-
|
|
12919
|
-
|
|
12920
|
-
|
|
12921
|
-
|
|
12922
|
-
|
|
12923
|
-
|
|
12924
|
-
|
|
12925
|
-
|
|
12926
|
-
|
|
12927
|
-
|
|
12928
|
-
|
|
12929
|
-
|
|
12930
|
-
|
|
12931
|
-
|
|
12932
|
-
|
|
12933
|
-
|
|
12934
|
-
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
},
|
|
12939
|
-
|
|
12940
|
-
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
|
|
12946
|
-
|
|
12947
|
-
},
|
|
12948
|
-
|
|
12949
|
-
|
|
12950
|
-
|
|
12951
|
-
|
|
12952
|
-
|
|
12953
|
-
|
|
12954
|
-
|
|
12955
|
-
|
|
12956
|
-
|
|
12974
|
+
return /*#__PURE__*/jsxs(Fragment$1, {
|
|
12975
|
+
children: [/*#__PURE__*/jsx(Dropdown$1, {
|
|
12976
|
+
buttonSize: "small",
|
|
12977
|
+
buttonStyle: "text",
|
|
12978
|
+
label: nodeType,
|
|
12979
|
+
strategy: "fixed",
|
|
12980
|
+
children: /*#__PURE__*/jsx(Menu, {
|
|
12981
|
+
children: dropdownOptions.map(function (_ref2) {
|
|
12982
|
+
var optionName = _ref2.optionName,
|
|
12983
|
+
command = _ref2.command;
|
|
12984
|
+
return /*#__PURE__*/jsx(MenuItem.Button, {
|
|
12985
|
+
onClick: command,
|
|
12986
|
+
children: optionName
|
|
12987
|
+
}, optionName);
|
|
12988
|
+
})
|
|
12989
|
+
})
|
|
12990
|
+
}), fontStyleOptions.map(renderOptionButton), blockStyleOptions.map(renderOptionButton), isTextColorOptionActive && /*#__PURE__*/jsx(TextColorOption, {
|
|
12991
|
+
editor: editor,
|
|
12992
|
+
tooltipContent: tooltips.textColor || t("neetoEditor.menu.textColor")
|
|
12993
|
+
}), isEmojiActive && /*#__PURE__*/jsx(EmojiOption$1, {
|
|
12994
|
+
editor: editor,
|
|
12995
|
+
isActive: isEmojiPickerActive,
|
|
12996
|
+
setActive: setIsEmojiPickerActive,
|
|
12997
|
+
tooltipContent: tooltips.emoji || t("neetoEditor.menu.emoji")
|
|
12998
|
+
}), listStyleOptions.map(renderOptionButton), isLinkActive && renderOptionButton({
|
|
12999
|
+
Icon: Link,
|
|
13000
|
+
command: function command() {
|
|
13001
|
+
return setIsLinkOptionActive(true);
|
|
13002
|
+
},
|
|
13003
|
+
active: editor.isActive("link"),
|
|
13004
|
+
optionName: "link",
|
|
13005
|
+
highlight: false,
|
|
13006
|
+
tooltip: tooltips.link || t("neetoEditor.menu.link")
|
|
13007
|
+
}), isTableActive && renderOptionButton({
|
|
13008
|
+
Icon: Column,
|
|
13009
|
+
command: function command() {
|
|
13010
|
+
return setIsTableOptionActive(true);
|
|
13011
|
+
},
|
|
13012
|
+
active: editor.isActive("table"),
|
|
13013
|
+
optionName: "table",
|
|
13014
|
+
highlight: false,
|
|
13015
|
+
tooltip: tooltips.table || t("neetoEditor.menu.table")
|
|
13016
|
+
}), /*#__PURE__*/jsx(Mentions$1, {
|
|
13017
|
+
editor: editor,
|
|
13018
|
+
mentions: mentions,
|
|
13019
|
+
tooltipContent: tooltips.mention || t("neetoEditor.menu.mention")
|
|
13020
|
+
}), children]
|
|
13021
|
+
});
|
|
12957
13022
|
};
|
|
12958
13023
|
|
|
12959
13024
|
var Bubble = function Bubble(_ref) {
|
|
@@ -12990,89 +13055,102 @@ var Bubble = function Bubble(_ref) {
|
|
|
12990
13055
|
if (!editor || !isImageNodeSelected && noTextOptions) {
|
|
12991
13056
|
return null;
|
|
12992
13057
|
}
|
|
12993
|
-
return /*#__PURE__*/
|
|
12994
|
-
|
|
12995
|
-
|
|
12996
|
-
"neeto-editor-bubble-menu
|
|
12997
|
-
|
|
12998
|
-
|
|
12999
|
-
|
|
13000
|
-
|
|
13001
|
-
|
|
13002
|
-
|
|
13003
|
-
|
|
13058
|
+
return /*#__PURE__*/jsx("div", {
|
|
13059
|
+
children: /*#__PURE__*/jsx(BubbleMenu, {
|
|
13060
|
+
editor: editor,
|
|
13061
|
+
className: classnames("neeto-editor-bubble-menu", {
|
|
13062
|
+
"neeto-editor-bubble-menu-animate-shake": isInvalidLink
|
|
13063
|
+
}),
|
|
13064
|
+
tippyOptions: {
|
|
13065
|
+
arrow: roundArrow,
|
|
13066
|
+
zIndex: 99999,
|
|
13067
|
+
onHide: function onHide() {
|
|
13068
|
+
setIsLinkOptionActive(false);
|
|
13069
|
+
setIsTableOptionActive(false);
|
|
13070
|
+
},
|
|
13071
|
+
theme: "neeto-editor-bubble-menu",
|
|
13072
|
+
maxWidth: 500
|
|
13004
13073
|
},
|
|
13005
|
-
|
|
13006
|
-
|
|
13007
|
-
|
|
13008
|
-
|
|
13009
|
-
|
|
13010
|
-
|
|
13011
|
-
|
|
13012
|
-
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
}
|
|
13074
|
+
children: /*#__PURE__*/jsx(Options, {
|
|
13075
|
+
attachmentProps: attachmentProps,
|
|
13076
|
+
editor: editor,
|
|
13077
|
+
isEmojiPickerActive: isEmojiPickerActive,
|
|
13078
|
+
isLinkOptionActive: isLinkOptionActive,
|
|
13079
|
+
isTableOptionActive: isTableOptionActive,
|
|
13080
|
+
mentions: mentions,
|
|
13081
|
+
setIsEmbedModalOpen: setIsEmbedModalOpen,
|
|
13082
|
+
setIsEmojiPickerActive: setIsEmojiPickerActive,
|
|
13083
|
+
setIsInvalidLink: setIsInvalidLink,
|
|
13084
|
+
setIsLinkOptionActive: setIsLinkOptionActive,
|
|
13085
|
+
setIsTableOptionActive: setIsTableOptionActive,
|
|
13086
|
+
setMediaUploader: setMediaUploader,
|
|
13087
|
+
tooltips: tooltips,
|
|
13088
|
+
options: textOptions,
|
|
13089
|
+
children: children
|
|
13090
|
+
})
|
|
13091
|
+
})
|
|
13092
|
+
});
|
|
13024
13093
|
};
|
|
13025
13094
|
|
|
13026
13095
|
var EmptyMenu = function EmptyMenu() {
|
|
13027
|
-
return /*#__PURE__*/
|
|
13096
|
+
return /*#__PURE__*/jsx("div", {});
|
|
13028
13097
|
};
|
|
13029
13098
|
|
|
13030
13099
|
var Progress = withT(function (_ref) {
|
|
13031
13100
|
var t = _ref.t,
|
|
13032
13101
|
queuedFiles = _ref.queuedFiles,
|
|
13033
13102
|
cancelUpload = _ref.cancelUpload;
|
|
13034
|
-
return /*#__PURE__*/
|
|
13035
|
-
className: "ne-media-uploader__wrapper"
|
|
13036
|
-
|
|
13037
|
-
|
|
13038
|
-
|
|
13039
|
-
|
|
13040
|
-
|
|
13041
|
-
|
|
13042
|
-
|
|
13043
|
-
|
|
13044
|
-
|
|
13045
|
-
|
|
13046
|
-
|
|
13047
|
-
|
|
13048
|
-
|
|
13049
|
-
|
|
13050
|
-
|
|
13051
|
-
|
|
13052
|
-
|
|
13053
|
-
|
|
13054
|
-
|
|
13055
|
-
|
|
13056
|
-
|
|
13057
|
-
|
|
13058
|
-
|
|
13059
|
-
|
|
13060
|
-
|
|
13061
|
-
|
|
13062
|
-
|
|
13063
|
-
|
|
13064
|
-
|
|
13065
|
-
|
|
13066
|
-
|
|
13067
|
-
|
|
13068
|
-
|
|
13069
|
-
|
|
13070
|
-
|
|
13071
|
-
|
|
13072
|
-
|
|
13073
|
-
|
|
13074
|
-
|
|
13075
|
-
|
|
13103
|
+
return /*#__PURE__*/jsx("div", {
|
|
13104
|
+
className: "ne-media-uploader__wrapper",
|
|
13105
|
+
children: queuedFiles.map(function (_ref2) {
|
|
13106
|
+
var id = _ref2.id,
|
|
13107
|
+
filename = _ref2.filename,
|
|
13108
|
+
_ref2$progress = _ref2.progress,
|
|
13109
|
+
progress = _ref2$progress === void 0 ? 0 : _ref2$progress;
|
|
13110
|
+
return /*#__PURE__*/jsxs("div", {
|
|
13111
|
+
className: "ne-media-uploader__media",
|
|
13112
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
13113
|
+
className: "ne-media-uploader__media__cancel-button-wrapper",
|
|
13114
|
+
children: /*#__PURE__*/jsx(Button$1, {
|
|
13115
|
+
"data-cy": "neeto-editor-image-upload-cancel-button",
|
|
13116
|
+
icon: Close,
|
|
13117
|
+
iconSize: 18,
|
|
13118
|
+
size: "small",
|
|
13119
|
+
style: "text",
|
|
13120
|
+
onClick: function onClick() {
|
|
13121
|
+
return cancelUpload(id);
|
|
13122
|
+
}
|
|
13123
|
+
})
|
|
13124
|
+
}), /*#__PURE__*/jsx(File, {
|
|
13125
|
+
className: "ne-media-uploader__media__info__icon",
|
|
13126
|
+
fileName: filename
|
|
13127
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
13128
|
+
className: "ne-media-uploader__media__info",
|
|
13129
|
+
children: [/*#__PURE__*/jsxs(Typography, {
|
|
13130
|
+
style: "nano",
|
|
13131
|
+
children: [progress === 100 && t("neetoEditor.localUploader.completed"), progress !== 100 && /*#__PURE__*/jsxs(Fragment$1, {
|
|
13132
|
+
children: [progress, "%"]
|
|
13133
|
+
})]
|
|
13134
|
+
}), /*#__PURE__*/jsx("div", {
|
|
13135
|
+
className: "ne-media-uploader__media__progress",
|
|
13136
|
+
children: /*#__PURE__*/jsx("div", {
|
|
13137
|
+
className: "ne-media-uploader__media__progress-bar",
|
|
13138
|
+
style: {
|
|
13139
|
+
width: "".concat(progress, "%")
|
|
13140
|
+
}
|
|
13141
|
+
})
|
|
13142
|
+
}), /*#__PURE__*/jsx(Tooltip, {
|
|
13143
|
+
content: filename,
|
|
13144
|
+
position: "top",
|
|
13145
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
13146
|
+
style: "body3",
|
|
13147
|
+
children: filename
|
|
13148
|
+
})
|
|
13149
|
+
})]
|
|
13150
|
+
})]
|
|
13151
|
+
}, id);
|
|
13152
|
+
})
|
|
13153
|
+
});
|
|
13076
13154
|
});
|
|
13077
13155
|
|
|
13078
13156
|
var LocalUploader = function LocalUploader(_ref) {
|
|
@@ -13146,10 +13224,10 @@ var LocalUploader = function LocalUploader(_ref) {
|
|
|
13146
13224
|
return _ref4.apply(this, arguments);
|
|
13147
13225
|
};
|
|
13148
13226
|
}();
|
|
13149
|
-
return !isEmpty(queuedFiles) || isUploading ? /*#__PURE__*/
|
|
13227
|
+
return !isEmpty(queuedFiles) || isUploading ? /*#__PURE__*/jsx(Progress, {
|
|
13150
13228
|
cancelUpload: cancelUpload,
|
|
13151
13229
|
queuedFiles: queuedFiles
|
|
13152
|
-
}) : /*#__PURE__*/
|
|
13230
|
+
}) : /*#__PURE__*/jsxs("div", {
|
|
13153
13231
|
className: "ne-media-uploader__dnd",
|
|
13154
13232
|
"data-cy": "neeto-editor-media-uploader-dnd",
|
|
13155
13233
|
ref: dropTargetRef,
|
|
@@ -13157,25 +13235,28 @@ var LocalUploader = function LocalUploader(_ref) {
|
|
|
13157
13235
|
onClick: function onClick() {
|
|
13158
13236
|
var _fileInputRef$current;
|
|
13159
13237
|
return (_fileInputRef$current = fileInputRef.current) === null || _fileInputRef$current === void 0 ? void 0 : _fileInputRef$current.click();
|
|
13160
|
-
}
|
|
13161
|
-
|
|
13162
|
-
|
|
13163
|
-
|
|
13164
|
-
|
|
13165
|
-
|
|
13166
|
-
|
|
13167
|
-
|
|
13168
|
-
|
|
13169
|
-
|
|
13170
|
-
|
|
13171
|
-
|
|
13172
|
-
|
|
13173
|
-
|
|
13174
|
-
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13238
|
+
},
|
|
13239
|
+
children: [/*#__PURE__*/jsx("input", {
|
|
13240
|
+
multiple: true,
|
|
13241
|
+
className: "ne-media-uploader__dnd-input",
|
|
13242
|
+
"data-cy": "neeto-editor-media-uploader-input",
|
|
13243
|
+
ref: fileInputRef,
|
|
13244
|
+
type: "file",
|
|
13245
|
+
accept: isImage ? ALLOWED_IMAGE_TYPES.join(",") : ALLOWED_VIDEO_TYPES.join(","),
|
|
13246
|
+
onChange: handleAddFile
|
|
13247
|
+
}), /*#__PURE__*/jsx(ImageUpload, {
|
|
13248
|
+
className: "ne-media-uploader__dnd-icon",
|
|
13249
|
+
size: 24
|
|
13250
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
13251
|
+
style: "body2",
|
|
13252
|
+
children: t("neetoEditor.localUploader.dropFilesHere")
|
|
13253
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
13254
|
+
style: "body3",
|
|
13255
|
+
children: t("neetoEditor.localUploader.maxFileSize", {
|
|
13256
|
+
entity: convertToFileSize(uploadConfig.restrictions.maxFileSize)
|
|
13257
|
+
})
|
|
13258
|
+
})]
|
|
13259
|
+
});
|
|
13179
13260
|
};
|
|
13180
13261
|
|
|
13181
13262
|
var lib = {};
|
|
@@ -14052,80 +14133,90 @@ var UnsplashImagePicker = function UnsplashImagePicker(_ref) {
|
|
|
14052
14133
|
if (loading || !hasMore) return;
|
|
14053
14134
|
pageNo > 1 && fetchUnsplashPhotos(pageNo);
|
|
14054
14135
|
};
|
|
14055
|
-
var Loader = /*#__PURE__*/
|
|
14056
|
-
className: "neeto-editor-unsplash-gallery__loader"
|
|
14057
|
-
|
|
14058
|
-
|
|
14059
|
-
|
|
14060
|
-
|
|
14061
|
-
|
|
14062
|
-
|
|
14063
|
-
|
|
14064
|
-
|
|
14065
|
-
|
|
14066
|
-
|
|
14067
|
-
|
|
14068
|
-
|
|
14069
|
-
|
|
14070
|
-
|
|
14071
|
-
}), error && /*#__PURE__*/React.createElement("p", {
|
|
14072
|
-
className: "neeto-editor-unsplash-gallery__text",
|
|
14073
|
-
"data-cy": "neeto-editor-unsplash-image-picker-error"
|
|
14074
|
-
}, t("neetoEditor.unsplash.errorMessage")), !error && !loading && isNotPresent(images) && /*#__PURE__*/React.createElement("p", {
|
|
14075
|
-
className: "neeto-editor-unsplash-gallery__text",
|
|
14076
|
-
"data-cy": "neeto-editor-unsplash-image-picker-no-results-error"
|
|
14077
|
-
}, t("neetoEditor.unsplash.noResults")), !error && /*#__PURE__*/React.createElement("div", {
|
|
14078
|
-
className: "neeto-editor-unsplash-container"
|
|
14079
|
-
}, /*#__PURE__*/React.createElement(_default, {
|
|
14080
|
-
pack: true,
|
|
14081
|
-
position: true,
|
|
14082
|
-
className: "neeto-editor-unsplash-gallery",
|
|
14083
|
-
hasMore: hasMore,
|
|
14084
|
-
loadMore: loadMore,
|
|
14085
|
-
loader: Loader,
|
|
14086
|
-
ref: masonryRef,
|
|
14087
|
-
style: {
|
|
14088
|
-
width: "100%"
|
|
14089
|
-
},
|
|
14090
|
-
useWindow: false,
|
|
14091
|
-
sizes: [{
|
|
14092
|
-
columns: 3,
|
|
14093
|
-
gutter: 0
|
|
14094
|
-
}, {
|
|
14095
|
-
mq: "768px",
|
|
14096
|
-
columns: 3,
|
|
14097
|
-
gutter: 0
|
|
14098
|
-
}, {
|
|
14099
|
-
mq: "1024px",
|
|
14100
|
-
columns: 3,
|
|
14101
|
-
gutter: 0
|
|
14102
|
-
}]
|
|
14103
|
-
}, images && images.map(function (image, index) {
|
|
14104
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
14105
|
-
className: "neeto-editor-unsplash-gallery__item",
|
|
14106
|
-
"data-cy": "neeto-editor-unsplash-image-picker-result-".concat(index),
|
|
14107
|
-
key: index
|
|
14108
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
14109
|
-
className: "neeto-editor-unsplash-gallery__item-placeholder",
|
|
14110
|
-
style: {
|
|
14111
|
-
paddingBottom: "".concat(image.height / image.width * 100, "%")
|
|
14112
|
-
}
|
|
14113
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
14114
|
-
className: "neeto-editor-unsplash-gallery__item-inner",
|
|
14115
|
-
id: "unsplashImage".concat(index)
|
|
14116
|
-
}, /*#__PURE__*/React.createElement("img", {
|
|
14117
|
-
src: image.urls.regular,
|
|
14118
|
-
onClick: function onClick() {
|
|
14119
|
-
return onSubmit(image.urls.small);
|
|
14136
|
+
var Loader = /*#__PURE__*/jsx("div", {
|
|
14137
|
+
className: "neeto-editor-unsplash-gallery__loader",
|
|
14138
|
+
children: /*#__PURE__*/jsx(Spinner, {})
|
|
14139
|
+
});
|
|
14140
|
+
return /*#__PURE__*/jsxs("div", {
|
|
14141
|
+
className: "neeto-editor-unsplash-wrapper",
|
|
14142
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
14143
|
+
autoFocus: true,
|
|
14144
|
+
className: "neeto-editor-unsplash-search",
|
|
14145
|
+
"data-cy": "neeto-editor-unsplash-image-picker-search-input",
|
|
14146
|
+
name: "text",
|
|
14147
|
+
placeholder: t("neetoEditor.placeholders.searchUnsplash"),
|
|
14148
|
+
value: query,
|
|
14149
|
+
onChange: function onChange(_ref4) {
|
|
14150
|
+
var value = _ref4.target.value;
|
|
14151
|
+
setQuery(value);
|
|
14120
14152
|
}
|
|
14121
|
-
}), /*#__PURE__*/
|
|
14122
|
-
|
|
14123
|
-
|
|
14124
|
-
|
|
14125
|
-
},
|
|
14126
|
-
|
|
14127
|
-
|
|
14128
|
-
|
|
14153
|
+
}), error && /*#__PURE__*/jsx("p", {
|
|
14154
|
+
className: "neeto-editor-unsplash-gallery__text",
|
|
14155
|
+
"data-cy": "neeto-editor-unsplash-image-picker-error",
|
|
14156
|
+
children: t("neetoEditor.unsplash.errorMessage")
|
|
14157
|
+
}), !error && !loading && isNotPresent(images) && /*#__PURE__*/jsx("p", {
|
|
14158
|
+
className: "neeto-editor-unsplash-gallery__text",
|
|
14159
|
+
"data-cy": "neeto-editor-unsplash-image-picker-no-results-error",
|
|
14160
|
+
children: t("neetoEditor.unsplash.noResults")
|
|
14161
|
+
}), !error && /*#__PURE__*/jsxs("div", {
|
|
14162
|
+
className: "neeto-editor-unsplash-container",
|
|
14163
|
+
children: [/*#__PURE__*/jsx(_default, {
|
|
14164
|
+
pack: true,
|
|
14165
|
+
position: true,
|
|
14166
|
+
className: "neeto-editor-unsplash-gallery",
|
|
14167
|
+
hasMore: hasMore,
|
|
14168
|
+
loadMore: loadMore,
|
|
14169
|
+
loader: Loader,
|
|
14170
|
+
ref: masonryRef,
|
|
14171
|
+
style: {
|
|
14172
|
+
width: "100%"
|
|
14173
|
+
},
|
|
14174
|
+
useWindow: false,
|
|
14175
|
+
sizes: [{
|
|
14176
|
+
columns: 3,
|
|
14177
|
+
gutter: 0
|
|
14178
|
+
}, {
|
|
14179
|
+
mq: "768px",
|
|
14180
|
+
columns: 3,
|
|
14181
|
+
gutter: 0
|
|
14182
|
+
}, {
|
|
14183
|
+
mq: "1024px",
|
|
14184
|
+
columns: 3,
|
|
14185
|
+
gutter: 0
|
|
14186
|
+
}],
|
|
14187
|
+
children: images && images.map(function (image, index) {
|
|
14188
|
+
return /*#__PURE__*/jsx("div", {
|
|
14189
|
+
className: "neeto-editor-unsplash-gallery__item",
|
|
14190
|
+
"data-cy": "neeto-editor-unsplash-image-picker-result-".concat(index),
|
|
14191
|
+
children: /*#__PURE__*/jsx("div", {
|
|
14192
|
+
className: "neeto-editor-unsplash-gallery__item-placeholder",
|
|
14193
|
+
style: {
|
|
14194
|
+
paddingBottom: "".concat(image.height / image.width * 100, "%")
|
|
14195
|
+
},
|
|
14196
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
14197
|
+
className: "neeto-editor-unsplash-gallery__item-inner",
|
|
14198
|
+
id: "unsplashImage".concat(index),
|
|
14199
|
+
children: [/*#__PURE__*/jsx("img", {
|
|
14200
|
+
src: image.urls.regular,
|
|
14201
|
+
onClick: function onClick() {
|
|
14202
|
+
return onSubmit(image.urls.small);
|
|
14203
|
+
}
|
|
14204
|
+
}), /*#__PURE__*/jsxs("a", {
|
|
14205
|
+
href: "https://unsplash.com/@".concat(image.user.username),
|
|
14206
|
+
rel: "noreferrer",
|
|
14207
|
+
target: "_blank",
|
|
14208
|
+
children: [image.user.name, " "]
|
|
14209
|
+
})]
|
|
14210
|
+
})
|
|
14211
|
+
})
|
|
14212
|
+
}, index);
|
|
14213
|
+
})
|
|
14214
|
+
}), !hasMore && /*#__PURE__*/jsx("p", {
|
|
14215
|
+
className: "neeto-editor-unsplash-gallery__text",
|
|
14216
|
+
children: t("neetoEditor.unsplash.end")
|
|
14217
|
+
})]
|
|
14218
|
+
})]
|
|
14219
|
+
});
|
|
14129
14220
|
};
|
|
14130
14221
|
|
|
14131
14222
|
var URLForm = function URLForm(_ref) {
|
|
@@ -14149,28 +14240,29 @@ var URLForm = function URLForm(_ref) {
|
|
|
14149
14240
|
event.preventDefault();
|
|
14150
14241
|
URL_REGEXP.test(urlString) ? onSubmit(urlString) : setError(t("neetoEditor.error.invalidUrl"));
|
|
14151
14242
|
};
|
|
14152
|
-
return /*#__PURE__*/
|
|
14153
|
-
className: classnames("neeto-editor-url-form__wrapper", _defineProperty({}, className, className))
|
|
14154
|
-
|
|
14155
|
-
|
|
14156
|
-
|
|
14157
|
-
|
|
14158
|
-
|
|
14159
|
-
|
|
14160
|
-
|
|
14161
|
-
|
|
14162
|
-
|
|
14163
|
-
|
|
14164
|
-
|
|
14165
|
-
|
|
14166
|
-
|
|
14167
|
-
|
|
14168
|
-
|
|
14169
|
-
|
|
14170
|
-
|
|
14171
|
-
|
|
14172
|
-
|
|
14173
|
-
|
|
14243
|
+
return /*#__PURE__*/jsxs("div", {
|
|
14244
|
+
className: classnames("neeto-editor-url-form__wrapper", _defineProperty({}, className, className)),
|
|
14245
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
14246
|
+
autoFocus: true,
|
|
14247
|
+
"data-cy": "neeto-editor-media-upload-url-input",
|
|
14248
|
+
error: error,
|
|
14249
|
+
placeholder: placeholder,
|
|
14250
|
+
name: "url",
|
|
14251
|
+
value: urlString,
|
|
14252
|
+
onChange: function onChange(_ref2) {
|
|
14253
|
+
var value = _ref2.target.value;
|
|
14254
|
+
return setUrlString(value);
|
|
14255
|
+
},
|
|
14256
|
+
onFocus: function onFocus() {
|
|
14257
|
+
return setError("");
|
|
14258
|
+
}
|
|
14259
|
+
}), /*#__PURE__*/jsx(Button$1, {
|
|
14260
|
+
"data-cy": "neeto-editor-media-upload-url-submit",
|
|
14261
|
+
disabled: !urlString,
|
|
14262
|
+
label: buttonLabel,
|
|
14263
|
+
onClick: handleSubmit
|
|
14264
|
+
})]
|
|
14265
|
+
});
|
|
14174
14266
|
};
|
|
14175
14267
|
|
|
14176
14268
|
var MediaUploader = function MediaUploader(_ref) {
|
|
@@ -14231,41 +14323,46 @@ var MediaUploader = function MediaUploader(_ref) {
|
|
|
14231
14323
|
var handleKeydown = function handleKeydown(event) {
|
|
14232
14324
|
return not(isUploading) && event.key === "Escape" && handleClose();
|
|
14233
14325
|
};
|
|
14234
|
-
return /*#__PURE__*/
|
|
14326
|
+
return /*#__PURE__*/jsx(Modal, {
|
|
14235
14327
|
isOpen: isOpen,
|
|
14236
14328
|
className: "ne-media-uploader-modal",
|
|
14237
14329
|
closeButton: false,
|
|
14238
14330
|
closeOnOutsideClick: not(isUploading),
|
|
14239
14331
|
onClose: handleClose,
|
|
14240
|
-
onKeyDown: handleKeydown
|
|
14241
|
-
|
|
14242
|
-
|
|
14243
|
-
|
|
14244
|
-
|
|
14245
|
-
|
|
14246
|
-
|
|
14247
|
-
|
|
14248
|
-
|
|
14249
|
-
|
|
14250
|
-
|
|
14251
|
-
|
|
14252
|
-
|
|
14253
|
-
|
|
14254
|
-
|
|
14255
|
-
|
|
14256
|
-
|
|
14257
|
-
|
|
14258
|
-
|
|
14259
|
-
|
|
14260
|
-
|
|
14261
|
-
|
|
14262
|
-
|
|
14263
|
-
|
|
14264
|
-
|
|
14265
|
-
|
|
14266
|
-
|
|
14267
|
-
|
|
14268
|
-
|
|
14332
|
+
onKeyDown: handleKeydown,
|
|
14333
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
14334
|
+
className: "ne-media-uploader",
|
|
14335
|
+
children: [!isNotPresent(tabs) && /*#__PURE__*/jsx(Tab, {
|
|
14336
|
+
children: tabs.map(function (_ref3) {
|
|
14337
|
+
var key = _ref3.key,
|
|
14338
|
+
title = _ref3.title;
|
|
14339
|
+
return /*#__PURE__*/jsx(Tab.Item, {
|
|
14340
|
+
active: activeTab === key,
|
|
14341
|
+
"data-cy": "neeto-editor-media-uploader-".concat(key, "-tab"),
|
|
14342
|
+
onClick: function onClick() {
|
|
14343
|
+
return setActiveTab(key);
|
|
14344
|
+
},
|
|
14345
|
+
children: title
|
|
14346
|
+
}, key);
|
|
14347
|
+
})
|
|
14348
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
14349
|
+
className: "ne-media-uploader__content",
|
|
14350
|
+
children: [activeTab === "local" && /*#__PURE__*/jsx(LocalUploader, {
|
|
14351
|
+
insertMediaToEditor: insertMediaToEditor,
|
|
14352
|
+
setIsUploading: setIsUploading,
|
|
14353
|
+
isImage: mediaUploader.image,
|
|
14354
|
+
onClose: handleClose
|
|
14355
|
+
}), activeTab === "link" && /*#__PURE__*/jsx(URLForm, {
|
|
14356
|
+
placeholder: t("neetoEditor.placeholders.pasteLink"),
|
|
14357
|
+
buttonLabel: mediaUploader.image ? t("neetoEditor.localUploader.uploadImage") : t("neetoEditor.localUploader.uploadVideo"),
|
|
14358
|
+
onSubmit: handleSubmit
|
|
14359
|
+
}), activeTab === "unsplash" && /*#__PURE__*/jsx(UnsplashImagePicker, {
|
|
14360
|
+
unsplashApiKey: unsplashApiKey,
|
|
14361
|
+
onSubmit: handleSubmit
|
|
14362
|
+
})]
|
|
14363
|
+
})]
|
|
14364
|
+
})
|
|
14365
|
+
});
|
|
14269
14366
|
};
|
|
14270
14367
|
|
|
14271
14368
|
var LinkAddPopOver = function LinkAddPopOver(_ref) {
|
|
@@ -14371,126 +14468,132 @@ var LinkAddPopOver = function LinkAddPopOver(_ref) {
|
|
|
14371
14468
|
window.removeEventListener("wheel", removePopover);
|
|
14372
14469
|
};
|
|
14373
14470
|
}, []);
|
|
14374
|
-
return isAddLinkActive ? /*#__PURE__*/createPortal( /*#__PURE__*/
|
|
14375
|
-
|
|
14376
|
-
|
|
14377
|
-
|
|
14378
|
-
|
|
14379
|
-
|
|
14380
|
-
|
|
14381
|
-
|
|
14382
|
-
|
|
14383
|
-
|
|
14384
|
-
|
|
14385
|
-
|
|
14386
|
-
|
|
14387
|
-
|
|
14388
|
-
|
|
14389
|
-
|
|
14390
|
-
|
|
14391
|
-
|
|
14392
|
-
|
|
14393
|
-
|
|
14394
|
-
|
|
14395
|
-
|
|
14396
|
-
|
|
14397
|
-
|
|
14398
|
-
|
|
14399
|
-
|
|
14400
|
-
|
|
14401
|
-
|
|
14402
|
-
|
|
14403
|
-
|
|
14404
|
-
|
|
14405
|
-
|
|
14406
|
-
|
|
14407
|
-
|
|
14408
|
-
|
|
14409
|
-
|
|
14410
|
-
|
|
14411
|
-
|
|
14412
|
-
|
|
14413
|
-
|
|
14414
|
-
|
|
14415
|
-
|
|
14416
|
-
|
|
14417
|
-
|
|
14418
|
-
|
|
14419
|
-
|
|
14420
|
-
|
|
14421
|
-
|
|
14422
|
-
|
|
14423
|
-
|
|
14424
|
-
|
|
14425
|
-
|
|
14426
|
-
|
|
14427
|
-
|
|
14428
|
-
|
|
14429
|
-
|
|
14430
|
-
|
|
14431
|
-
|
|
14432
|
-
|
|
14433
|
-
|
|
14434
|
-
|
|
14435
|
-
|
|
14436
|
-
|
|
14437
|
-
|
|
14438
|
-
|
|
14439
|
-
|
|
14440
|
-
|
|
14441
|
-
|
|
14442
|
-
|
|
14443
|
-
|
|
14444
|
-
|
|
14471
|
+
return isAddLinkActive ? /*#__PURE__*/createPortal( /*#__PURE__*/jsxs(Fragment$1, {
|
|
14472
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
14473
|
+
className: "ne-link-arrow fade-in",
|
|
14474
|
+
style: {
|
|
14475
|
+
top: arrowPosition.top,
|
|
14476
|
+
left: arrowPosition.left
|
|
14477
|
+
}
|
|
14478
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
14479
|
+
className: "ne-link-popover fade-in",
|
|
14480
|
+
id: "ne-link-add-popover",
|
|
14481
|
+
ref: popoverRef,
|
|
14482
|
+
style: popoverStyle,
|
|
14483
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
14484
|
+
required: true,
|
|
14485
|
+
autoFocus: !isLinkTextPresent,
|
|
14486
|
+
"data-cy": "neeto-editor-add-link-text-input",
|
|
14487
|
+
label: t("neetoEditor.common.text"),
|
|
14488
|
+
placeholder: t("neetoEditor.placeholders.enterText"),
|
|
14489
|
+
size: "small",
|
|
14490
|
+
style: {
|
|
14491
|
+
width: "250px"
|
|
14492
|
+
},
|
|
14493
|
+
value: linkText,
|
|
14494
|
+
onChange: function onChange(_ref2) {
|
|
14495
|
+
var value = _ref2.target.value;
|
|
14496
|
+
return setLinkText(value);
|
|
14497
|
+
},
|
|
14498
|
+
onKeyDown: handleKeyDown
|
|
14499
|
+
}), /*#__PURE__*/jsx(Input, {
|
|
14500
|
+
error: error,
|
|
14501
|
+
required: true,
|
|
14502
|
+
autoFocus: isLinkTextPresent,
|
|
14503
|
+
className: "ne-link-popover__url-input",
|
|
14504
|
+
"data-cy": "neeto-editor-add-link-url-input",
|
|
14505
|
+
label: t("neetoEditor.common.url"),
|
|
14506
|
+
placeholder: t("neetoEditor.placeholders.url"),
|
|
14507
|
+
size: "small",
|
|
14508
|
+
style: {
|
|
14509
|
+
width: "250px"
|
|
14510
|
+
},
|
|
14511
|
+
value: linkUrl,
|
|
14512
|
+
onChange: function onChange(_ref3) {
|
|
14513
|
+
var value = _ref3.target.value;
|
|
14514
|
+
return setLinkUrl(value);
|
|
14515
|
+
},
|
|
14516
|
+
onFocus: function onFocus() {
|
|
14517
|
+
return setError("");
|
|
14518
|
+
},
|
|
14519
|
+
onKeyDown: handleKeyDown
|
|
14520
|
+
}), /*#__PURE__*/jsx(Checkbox, {
|
|
14521
|
+
checked: openInNewTab,
|
|
14522
|
+
className: "ne-link-popover__checkbox",
|
|
14523
|
+
"data-cy": "neeto-editor-add-link-open-in-new-tab-switch",
|
|
14524
|
+
label: t("neetoEditor.common.openInNewTab"),
|
|
14525
|
+
onChange: function onChange() {
|
|
14526
|
+
return setOpenInNewTab(not);
|
|
14527
|
+
}
|
|
14528
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
14529
|
+
className: "ne-link-popover__edit-prompt-buttons",
|
|
14530
|
+
children: [/*#__PURE__*/jsx(Button$1, {
|
|
14531
|
+
"data-cy": "neeto-editor-add-link",
|
|
14532
|
+
disabled: isSubmitDisabled,
|
|
14533
|
+
label: t("neetoEditor.common.done"),
|
|
14534
|
+
size: "small",
|
|
14535
|
+
onClick: handleAddLink
|
|
14536
|
+
}), /*#__PURE__*/jsx(Button$1, {
|
|
14537
|
+
"data-cy": "neeto-editor-link-popover-cancel",
|
|
14538
|
+
label: t("neetoEditor.common.cancel"),
|
|
14539
|
+
size: "small",
|
|
14540
|
+
style: "text",
|
|
14541
|
+
onClick: removePopover
|
|
14542
|
+
})]
|
|
14543
|
+
})]
|
|
14544
|
+
})]
|
|
14545
|
+
}), document.body) : null;
|
|
14445
14546
|
};
|
|
14446
14547
|
|
|
14447
14548
|
var _excluded$3 = ["type"];
|
|
14448
|
-
function ownKeys$
|
|
14449
|
-
function _objectSpread$
|
|
14549
|
+
function ownKeys$8(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; }
|
|
14550
|
+
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14450
14551
|
var Menu$3 = Dropdown$1.Menu,
|
|
14451
14552
|
MenuItem$1 = Dropdown$1.MenuItem;
|
|
14452
14553
|
var MoreMenu = function MoreMenu(_ref) {
|
|
14453
14554
|
var groups = _ref.groups,
|
|
14454
14555
|
editor = _ref.editor;
|
|
14455
|
-
return /*#__PURE__*/
|
|
14556
|
+
return /*#__PURE__*/jsx(Dropdown$1, {
|
|
14456
14557
|
buttonProps: {
|
|
14457
14558
|
className: "flex-shrink-0"
|
|
14458
14559
|
},
|
|
14459
14560
|
buttonStyle: "text",
|
|
14460
14561
|
icon: MenuHorizontal,
|
|
14461
|
-
strategy: "fixed"
|
|
14462
|
-
|
|
14463
|
-
|
|
14464
|
-
|
|
14465
|
-
|
|
14466
|
-
|
|
14467
|
-
|
|
14468
|
-
|
|
14469
|
-
|
|
14470
|
-
|
|
14471
|
-
|
|
14472
|
-
|
|
14473
|
-
|
|
14474
|
-
|
|
14475
|
-
|
|
14476
|
-
|
|
14477
|
-
|
|
14478
|
-
|
|
14479
|
-
|
|
14480
|
-
|
|
14481
|
-
|
|
14482
|
-
|
|
14483
|
-
|
|
14484
|
-
|
|
14485
|
-
|
|
14486
|
-
|
|
14487
|
-
|
|
14562
|
+
strategy: "fixed",
|
|
14563
|
+
children: /*#__PURE__*/jsx(Menu$3, {
|
|
14564
|
+
children: groups.map(function (group) {
|
|
14565
|
+
return group.map(function (_ref2) {
|
|
14566
|
+
var type = _ref2.type,
|
|
14567
|
+
props = _objectWithoutProperties$1(_ref2, _excluded$3);
|
|
14568
|
+
var Component = MENU_ELEMENTS[type];
|
|
14569
|
+
if (type === MENU_ELEMENT_TYPES.BUTTON) {
|
|
14570
|
+
var Icon = props.icon;
|
|
14571
|
+
return /*#__PURE__*/jsxs(MenuItem$1.Button, _objectSpread$8(_objectSpread$8({
|
|
14572
|
+
"data-cy": "neeto-editor-fixed-menu-".concat(props.optionName, "-option"),
|
|
14573
|
+
isActive: editor.isActive(props.optionName),
|
|
14574
|
+
tabIndex: "-1",
|
|
14575
|
+
onClick: props.command
|
|
14576
|
+
}, _objectSpread$8(_objectSpread$8(_objectSpread$8({}, generateFocusProps(props.highlight)), props), {}, {
|
|
14577
|
+
editor: editor
|
|
14578
|
+
})), {}, {
|
|
14579
|
+
children: [/*#__PURE__*/jsx(Icon, {}), " ", props.label]
|
|
14580
|
+
}), props.optionName);
|
|
14581
|
+
}
|
|
14582
|
+
return /*#__PURE__*/jsx(Component, _objectSpread$8(_objectSpread$8({}, _objectSpread$8(_objectSpread$8({}, props), {}, {
|
|
14583
|
+
editor: editor
|
|
14584
|
+
}, generateFocusProps(props.highlight))), {}, {
|
|
14585
|
+
isSecondaryMenu: true
|
|
14586
|
+
}), props.optionName);
|
|
14587
|
+
});
|
|
14588
|
+
})
|
|
14589
|
+
})
|
|
14590
|
+
});
|
|
14488
14591
|
};
|
|
14489
14592
|
|
|
14490
14593
|
var EDITOR_MARKS = [EDITOR_OPTIONS.UNDO, EDITOR_OPTIONS.REDO, "fontSizeOptions", EDITOR_OPTIONS.BOLD, EDITOR_OPTIONS.ITALIC, EDITOR_OPTIONS.UNDERLINE, EDITOR_OPTIONS.LINK, EDITOR_OPTIONS.STRIKETHROUGH, EDITOR_OPTIONS.HIGHLIGHT, "bulletList", "orderedList", "blockquote", EDITOR_OPTIONS.CODE, "codeBlock", EDITOR_OPTIONS.TABLE, EDITOR_OPTIONS.ATTACHMENTS, EDITOR_OPTIONS.IMAGE_UPLOAD, EDITOR_OPTIONS.VIDEO_UPLOAD, EDITOR_OPTIONS.VIDEO_EMBED, EDITOR_OPTIONS.TEXT_COLOR, EDITOR_OPTIONS.EMOJI, "mentions"];
|
|
14491
14594
|
|
|
14492
|
-
function ownKeys$
|
|
14493
|
-
function _objectSpread$
|
|
14595
|
+
function ownKeys$7(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; }
|
|
14596
|
+
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14494
14597
|
var useEditorState = function useEditorState(_ref) {
|
|
14495
14598
|
var editor = _ref.editor;
|
|
14496
14599
|
var _useEditorStore = useEditorStore(function (store) {
|
|
@@ -14526,7 +14629,7 @@ var useEditorState = function useEditorState(_ref) {
|
|
|
14526
14629
|
var redoOptionState = {
|
|
14527
14630
|
disabled: !editor.can().redo()
|
|
14528
14631
|
};
|
|
14529
|
-
var updatedMarksState = _objectSpread$
|
|
14632
|
+
var updatedMarksState = _objectSpread$7(_objectSpread$7({}, marksState), {}, _defineProperty(_defineProperty({}, EDITOR_OPTIONS.UNDO, undoOptionState), EDITOR_OPTIONS.REDO, redoOptionState));
|
|
14530
14633
|
setMarksState(updatedMarksState);
|
|
14531
14634
|
}, [marksState, setMarksState]);
|
|
14532
14635
|
useEffect(function () {
|
|
@@ -14544,8 +14647,8 @@ var useEditorState = function useEditorState(_ref) {
|
|
|
14544
14647
|
};
|
|
14545
14648
|
|
|
14546
14649
|
var _excluded$2 = ["type"];
|
|
14547
|
-
function ownKeys$
|
|
14548
|
-
function _objectSpread$
|
|
14650
|
+
function ownKeys$6(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; }
|
|
14651
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14549
14652
|
var Fixed = function Fixed(_ref) {
|
|
14550
14653
|
var editor = _ref.editor,
|
|
14551
14654
|
options = _ref.options,
|
|
@@ -14678,70 +14781,71 @@ var Fixed = function Fixed(_ref) {
|
|
|
14678
14781
|
label: variableName
|
|
14679
14782
|
}).run();
|
|
14680
14783
|
};
|
|
14681
|
-
return /*#__PURE__*/
|
|
14784
|
+
return /*#__PURE__*/jsxs("div", {
|
|
14682
14785
|
ref: menuContainerRef,
|
|
14683
14786
|
className: classnames("neeto-editor-fixed-menu", _defineProperty({
|
|
14684
14787
|
"neeto-editor-fixed-menu--independant": isIndependant
|
|
14685
|
-
}, className, className))
|
|
14686
|
-
|
|
14687
|
-
|
|
14688
|
-
|
|
14689
|
-
|
|
14690
|
-
|
|
14691
|
-
|
|
14692
|
-
|
|
14693
|
-
|
|
14694
|
-
|
|
14695
|
-
|
|
14696
|
-
|
|
14697
|
-
|
|
14698
|
-
|
|
14699
|
-
|
|
14700
|
-
}))
|
|
14701
|
-
|
|
14702
|
-
|
|
14703
|
-
|
|
14704
|
-
|
|
14705
|
-
|
|
14706
|
-
|
|
14707
|
-
|
|
14708
|
-
|
|
14709
|
-
|
|
14710
|
-
|
|
14711
|
-
|
|
14712
|
-
|
|
14713
|
-
|
|
14714
|
-
|
|
14715
|
-
|
|
14716
|
-
|
|
14788
|
+
}, className, className)),
|
|
14789
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
14790
|
+
className: "neeto-editor-fixed-menu__wrapper",
|
|
14791
|
+
"data-cy": "neeto-editor-fixed-menu-wrapper",
|
|
14792
|
+
ref: menuRef,
|
|
14793
|
+
children: [menuItems.map(function (group) {
|
|
14794
|
+
return group.map(function (_ref2) {
|
|
14795
|
+
var type = _ref2.type,
|
|
14796
|
+
props = _objectWithoutProperties$1(_ref2, _excluded$2);
|
|
14797
|
+
var Component = MENU_ELEMENTS[type];
|
|
14798
|
+
if (!Component) return null;
|
|
14799
|
+
return /*#__PURE__*/jsx(Component, _objectSpread$6({}, _objectSpread$6(_objectSpread$6({}, props), {}, {
|
|
14800
|
+
editor: editor
|
|
14801
|
+
})), props.optionName);
|
|
14802
|
+
});
|
|
14803
|
+
}), isNotEmpty(moreMenuItems) && /*#__PURE__*/jsx(MoreMenu, {
|
|
14804
|
+
editor: editor,
|
|
14805
|
+
groups: moreMenuItems
|
|
14806
|
+
}), children]
|
|
14807
|
+
}), !isEmpty(variables) && /*#__PURE__*/jsx("div", {
|
|
14808
|
+
className: "neeto-editor-fixed-menu__variables",
|
|
14809
|
+
"data-cy": "neeto-editor-fixed-menu-variables",
|
|
14810
|
+
children: /*#__PURE__*/jsx(DynamicVariables, {
|
|
14811
|
+
variables: variables,
|
|
14812
|
+
dropdownProps: {
|
|
14813
|
+
buttonSize: "small",
|
|
14814
|
+
buttonProps: {
|
|
14815
|
+
tooltipProps: {
|
|
14816
|
+
content: t("neetoEditor.menu.dynamicVariables"),
|
|
14817
|
+
position: "bottom"
|
|
14818
|
+
}
|
|
14819
|
+
}
|
|
14820
|
+
},
|
|
14821
|
+
onVariableClick: handleVariableClick
|
|
14822
|
+
})
|
|
14823
|
+
}), isAddLinkActive && /*#__PURE__*/jsx(LinkAddPopOver, {
|
|
14824
|
+
editor: editor,
|
|
14825
|
+
isAddLinkActive: isAddLinkActive,
|
|
14826
|
+
openLinkInNewTab: openLinkInNewTab,
|
|
14827
|
+
setIsAddLinkActive: setIsAddLinkActive
|
|
14828
|
+
}), isMediaUploaderActive && /*#__PURE__*/jsx(MediaUploader, {
|
|
14829
|
+
editor: editor,
|
|
14830
|
+
mediaUploader: mediaUploader,
|
|
14831
|
+
unsplashApiKey: unsplashApiKey,
|
|
14832
|
+
onClose: function onClose() {
|
|
14833
|
+
return setMediaUploader({
|
|
14834
|
+
image: false,
|
|
14835
|
+
video: false
|
|
14836
|
+
});
|
|
14717
14837
|
}
|
|
14718
|
-
},
|
|
14719
|
-
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
setIsAddLinkActive: setIsAddLinkActive
|
|
14725
|
-
}), isMediaUploaderActive && /*#__PURE__*/React.createElement(MediaUploader, {
|
|
14726
|
-
editor: editor,
|
|
14727
|
-
mediaUploader: mediaUploader,
|
|
14728
|
-
unsplashApiKey: unsplashApiKey,
|
|
14729
|
-
onClose: function onClose() {
|
|
14730
|
-
return setMediaUploader({
|
|
14731
|
-
image: false,
|
|
14732
|
-
video: false
|
|
14733
|
-
});
|
|
14734
|
-
}
|
|
14735
|
-
}), isEmbedOptionActive && /*#__PURE__*/React.createElement(EmbedOption, {
|
|
14736
|
-
editor: editor,
|
|
14737
|
-
isEmbedModalOpen: isEmbedModalOpen,
|
|
14738
|
-
setIsEmbedModalOpen: setIsEmbedModalOpen
|
|
14739
|
-
}));
|
|
14838
|
+
}), isEmbedOptionActive && /*#__PURE__*/jsx(EmbedOption, {
|
|
14839
|
+
editor: editor,
|
|
14840
|
+
isEmbedModalOpen: isEmbedModalOpen,
|
|
14841
|
+
setIsEmbedModalOpen: setIsEmbedModalOpen
|
|
14842
|
+
})]
|
|
14843
|
+
});
|
|
14740
14844
|
};
|
|
14741
14845
|
|
|
14742
14846
|
var _excluded$1 = ["icon", "onClick", "disabled", "className", "tooltipProps"];
|
|
14743
|
-
function ownKeys$
|
|
14744
|
-
function _objectSpread$
|
|
14847
|
+
function ownKeys$5(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; }
|
|
14848
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14745
14849
|
var Button = function Button(_ref) {
|
|
14746
14850
|
var _ref$icon = _ref.icon,
|
|
14747
14851
|
icon = _ref$icon === void 0 ? null : _ref$icon,
|
|
@@ -14753,27 +14857,30 @@ var Button = function Button(_ref) {
|
|
|
14753
14857
|
tooltipProps = _ref.tooltipProps,
|
|
14754
14858
|
otherProps = _objectWithoutProperties$1(_ref, _excluded$1);
|
|
14755
14859
|
var Icon = icon;
|
|
14756
|
-
return /*#__PURE__*/
|
|
14860
|
+
return /*#__PURE__*/jsx(Tooltip, _objectSpread$5(_objectSpread$5({
|
|
14757
14861
|
disabled: !tooltipProps,
|
|
14758
14862
|
onClick: function onClick() {
|
|
14759
14863
|
return _onClick();
|
|
14760
14864
|
}
|
|
14761
|
-
}, tooltipProps),
|
|
14762
|
-
|
|
14763
|
-
|
|
14764
|
-
|
|
14765
|
-
|
|
14766
|
-
|
|
14767
|
-
|
|
14768
|
-
|
|
14769
|
-
|
|
14770
|
-
|
|
14771
|
-
|
|
14865
|
+
}, tooltipProps), {}, {
|
|
14866
|
+
children: /*#__PURE__*/jsx("button", _objectSpread$5(_objectSpread$5({
|
|
14867
|
+
className: classnames("ne-headless-btn", _defineProperty({}, className, className)),
|
|
14868
|
+
type: "button"
|
|
14869
|
+
}, _objectSpread$5({
|
|
14870
|
+
disabled: disabled,
|
|
14871
|
+
onClick: _onClick
|
|
14872
|
+
}, otherProps)), {}, {
|
|
14873
|
+
children: icon && /*#__PURE__*/jsx(Icon, {
|
|
14874
|
+
"aria-hidden": "true",
|
|
14875
|
+
size: 18
|
|
14876
|
+
}, "2")
|
|
14877
|
+
}))
|
|
14878
|
+
}));
|
|
14772
14879
|
};
|
|
14773
14880
|
|
|
14774
14881
|
var _excluded = ["icon", "isOpen", "onClose", "children", "className", "onClick", "buttonProps"];
|
|
14775
|
-
function ownKeys$
|
|
14776
|
-
function _objectSpread$
|
|
14882
|
+
function ownKeys$4(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; }
|
|
14883
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14777
14884
|
var hideOnEsc = {
|
|
14778
14885
|
name: "hideOnEsc",
|
|
14779
14886
|
defaultValue: true,
|
|
@@ -14813,7 +14920,7 @@ var Dropdown = function Dropdown(_ref2) {
|
|
|
14813
14920
|
_useState2 = _slicedToArray(_useState, 2),
|
|
14814
14921
|
mounted = _useState2[0],
|
|
14815
14922
|
setMounted = _useState2[1];
|
|
14816
|
-
return /*#__PURE__*/
|
|
14923
|
+
return /*#__PURE__*/jsx(Tippy, _objectSpread$4(_objectSpread$4({
|
|
14817
14924
|
hideOnEsc: true,
|
|
14818
14925
|
interactive: true,
|
|
14819
14926
|
animation: false,
|
|
@@ -14831,9 +14938,10 @@ var Dropdown = function Dropdown(_ref2) {
|
|
|
14831
14938
|
trigger: "click",
|
|
14832
14939
|
visible: isOpen,
|
|
14833
14940
|
className: classnames("ne-headless-dropdown", _defineProperty({}, className, className)),
|
|
14834
|
-
content: mounted && /*#__PURE__*/
|
|
14835
|
-
className: "ne-headless-dropdown__popup"
|
|
14836
|
-
|
|
14941
|
+
content: mounted && /*#__PURE__*/jsx("div", {
|
|
14942
|
+
className: "ne-headless-dropdown__popup",
|
|
14943
|
+
children: children
|
|
14944
|
+
}),
|
|
14837
14945
|
onClickOutside: onClose,
|
|
14838
14946
|
onClose: onClose,
|
|
14839
14947
|
onHidden: function onHidden() {
|
|
@@ -14842,10 +14950,14 @@ var Dropdown = function Dropdown(_ref2) {
|
|
|
14842
14950
|
onMount: function onMount() {
|
|
14843
14951
|
return setMounted(true);
|
|
14844
14952
|
}
|
|
14845
|
-
}, otherProps),
|
|
14846
|
-
|
|
14847
|
-
|
|
14848
|
-
|
|
14953
|
+
}, otherProps), {}, {
|
|
14954
|
+
children: /*#__PURE__*/jsx("span", {
|
|
14955
|
+
children: /*#__PURE__*/jsx(Button, _objectSpread$4({}, _objectSpread$4({
|
|
14956
|
+
icon: icon,
|
|
14957
|
+
onClick: onClick
|
|
14958
|
+
}, buttonProps)))
|
|
14959
|
+
})
|
|
14960
|
+
}));
|
|
14849
14961
|
};
|
|
14850
14962
|
|
|
14851
14963
|
var Emoji = function Emoji(_ref) {
|
|
@@ -14853,7 +14965,7 @@ var Emoji = function Emoji(_ref) {
|
|
|
14853
14965
|
isActive = _ref.isActive,
|
|
14854
14966
|
setActive = _ref.setActive,
|
|
14855
14967
|
tooltipContent = _ref.tooltipContent;
|
|
14856
|
-
return /*#__PURE__*/
|
|
14968
|
+
return /*#__PURE__*/jsx(Dropdown, {
|
|
14857
14969
|
className: "ne-headless__emoji",
|
|
14858
14970
|
icon: Smiley,
|
|
14859
14971
|
isOpen: isActive,
|
|
@@ -14872,11 +14984,12 @@ var Emoji = function Emoji(_ref) {
|
|
|
14872
14984
|
},
|
|
14873
14985
|
onClose: function onClose() {
|
|
14874
14986
|
return setActive(false);
|
|
14875
|
-
}
|
|
14876
|
-
|
|
14877
|
-
|
|
14878
|
-
|
|
14879
|
-
|
|
14987
|
+
},
|
|
14988
|
+
children: /*#__PURE__*/jsx(EmojiPickerMenu, {
|
|
14989
|
+
editor: editor,
|
|
14990
|
+
setActive: setActive
|
|
14991
|
+
})
|
|
14992
|
+
});
|
|
14880
14993
|
};
|
|
14881
14994
|
|
|
14882
14995
|
var Option = function Option(_ref) {
|
|
@@ -14889,14 +15002,14 @@ var Option = function Option(_ref) {
|
|
|
14889
15002
|
setActive = _ref.setActive,
|
|
14890
15003
|
tooltip = _ref.tooltip;
|
|
14891
15004
|
if (optionName === EDITOR_OPTIONS.EMOJI) {
|
|
14892
|
-
return /*#__PURE__*/
|
|
15005
|
+
return /*#__PURE__*/jsx(Emoji, {
|
|
14893
15006
|
editor: editor,
|
|
14894
15007
|
isActive: isActive,
|
|
14895
15008
|
setActive: setActive,
|
|
14896
15009
|
tooltipContent: tooltip || "Emoji"
|
|
14897
15010
|
});
|
|
14898
15011
|
}
|
|
14899
|
-
return /*#__PURE__*/
|
|
15012
|
+
return /*#__PURE__*/jsx(Button, {
|
|
14900
15013
|
className: isActive ? "ne-headless-btn--active" : "",
|
|
14901
15014
|
disabled: disabled,
|
|
14902
15015
|
"data-cy": hyphenate(optionName),
|
|
@@ -14910,8 +15023,8 @@ var Option = function Option(_ref) {
|
|
|
14910
15023
|
});
|
|
14911
15024
|
};
|
|
14912
15025
|
|
|
14913
|
-
function ownKeys$
|
|
14914
|
-
function _objectSpread$
|
|
15026
|
+
function ownKeys$3(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; }
|
|
15027
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14915
15028
|
var t = i18n.t;
|
|
14916
15029
|
var createMenuOptions$1 = function createMenuOptions(_ref) {
|
|
14917
15030
|
var editor = _ref.editor,
|
|
@@ -15070,7 +15183,7 @@ var buildOptionsFromAddonCommands$1 = function buildOptionsFromAddonCommands(_re
|
|
|
15070
15183
|
var to = editor.state.selection.to;
|
|
15071
15184
|
return commands.map(function (option) {
|
|
15072
15185
|
var _option$active;
|
|
15073
|
-
return _objectSpread$
|
|
15186
|
+
return _objectSpread$3(_objectSpread$3({}, option), {}, {
|
|
15074
15187
|
active: (_option$active = option.active) === null || _option$active === void 0 ? void 0 : _option$active.call(option, {
|
|
15075
15188
|
editor: editor
|
|
15076
15189
|
}),
|
|
@@ -15112,6 +15225,8 @@ var buildMenuOptions$1 = function buildMenuOptions(_ref3) {
|
|
|
15112
15225
|
}).filter(Boolean);
|
|
15113
15226
|
};
|
|
15114
15227
|
|
|
15228
|
+
function ownKeys$2(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; }
|
|
15229
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15115
15230
|
var Headless = function Headless(_ref) {
|
|
15116
15231
|
var editor = _ref.editor,
|
|
15117
15232
|
options = _ref.options,
|
|
@@ -15147,24 +15262,25 @@ var Headless = function Headless(_ref) {
|
|
|
15147
15262
|
commands: addonCommands
|
|
15148
15263
|
});
|
|
15149
15264
|
var allOptions = [].concat(_toConsumableArray(menuOptions), _toConsumableArray(addonCommandOptions));
|
|
15150
|
-
return /*#__PURE__*/
|
|
15151
|
-
className: classnames("ne-headless", _defineProperty({}, className, className))
|
|
15152
|
-
|
|
15153
|
-
|
|
15265
|
+
return /*#__PURE__*/jsxs("div", {
|
|
15266
|
+
className: classnames("ne-headless", _defineProperty({}, className, className)),
|
|
15267
|
+
children: [allOptions.map(function (option) {
|
|
15268
|
+
return /*#__PURE__*/createElement(Option, _objectSpread$2({
|
|
15269
|
+
editor: editor,
|
|
15270
|
+
key: option.optionName
|
|
15271
|
+
}, option));
|
|
15272
|
+
}), children, isMediaUploaderActive && /*#__PURE__*/jsx(MediaUploader, {
|
|
15154
15273
|
editor: editor,
|
|
15155
|
-
|
|
15156
|
-
|
|
15157
|
-
|
|
15158
|
-
|
|
15159
|
-
|
|
15160
|
-
|
|
15161
|
-
|
|
15162
|
-
|
|
15163
|
-
|
|
15164
|
-
|
|
15165
|
-
});
|
|
15166
|
-
}
|
|
15167
|
-
}));
|
|
15274
|
+
mediaUploader: mediaUploader,
|
|
15275
|
+
unsplashApiKey: unsplashApiKey,
|
|
15276
|
+
onClose: function onClose() {
|
|
15277
|
+
return setMediaUploader({
|
|
15278
|
+
image: false,
|
|
15279
|
+
video: false
|
|
15280
|
+
});
|
|
15281
|
+
}
|
|
15282
|
+
})]
|
|
15283
|
+
});
|
|
15168
15284
|
};
|
|
15169
15285
|
|
|
15170
15286
|
var FONT_SIZE_OPTIONS = [{
|
|
@@ -15224,7 +15340,7 @@ var FontSizeOption = function FontSizeOption(_ref) {
|
|
|
15224
15340
|
return editor.chain().focus().setNode("paragraph").run();
|
|
15225
15341
|
})();
|
|
15226
15342
|
};
|
|
15227
|
-
return /*#__PURE__*/
|
|
15343
|
+
return /*#__PURE__*/jsx(Dropdown$1, {
|
|
15228
15344
|
autoWidth: true,
|
|
15229
15345
|
label: activeOption === null || activeOption === void 0 ? void 0 : activeOption.label,
|
|
15230
15346
|
placement: "bottom-start",
|
|
@@ -15243,21 +15359,25 @@ var FontSizeOption = function FontSizeOption(_ref) {
|
|
|
15243
15359
|
style: "text",
|
|
15244
15360
|
size: "small",
|
|
15245
15361
|
className: "neeto-editor-fixed-menu__item neeto-editor-font-size__wrapper"
|
|
15246
|
-
}
|
|
15247
|
-
|
|
15248
|
-
|
|
15249
|
-
|
|
15250
|
-
|
|
15251
|
-
|
|
15252
|
-
|
|
15253
|
-
|
|
15254
|
-
|
|
15255
|
-
|
|
15256
|
-
|
|
15257
|
-
|
|
15258
|
-
|
|
15259
|
-
|
|
15260
|
-
|
|
15362
|
+
},
|
|
15363
|
+
children: /*#__PURE__*/jsx(Menu$2, {
|
|
15364
|
+
children: FONT_SIZE_OPTIONS.map(function (_ref2) {
|
|
15365
|
+
var label = _ref2.label,
|
|
15366
|
+
value = _ref2.value,
|
|
15367
|
+
key = _ref2.key;
|
|
15368
|
+
return /*#__PURE__*/jsx(MenuItem.Button, {
|
|
15369
|
+
"data-cy": "neeto-editor-fixed-menu-font-size-option-".concat(key),
|
|
15370
|
+
onClick: function onClick() {
|
|
15371
|
+
return handleClick(value);
|
|
15372
|
+
},
|
|
15373
|
+
children: /*#__PURE__*/jsx(Typography, {
|
|
15374
|
+
style: key,
|
|
15375
|
+
children: label
|
|
15376
|
+
})
|
|
15377
|
+
}, value);
|
|
15378
|
+
})
|
|
15379
|
+
})
|
|
15380
|
+
});
|
|
15261
15381
|
};
|
|
15262
15382
|
var FontSizeOption$1 = /*#__PURE__*/memo(FontSizeOption);
|
|
15263
15383
|
|
|
@@ -15299,7 +15419,7 @@ var TableOption = function TableOption(_ref) {
|
|
|
15299
15419
|
isSecondaryMenu && e.stopPropagation();
|
|
15300
15420
|
setIsOpen(not);
|
|
15301
15421
|
};
|
|
15302
|
-
return /*#__PURE__*/
|
|
15422
|
+
return /*#__PURE__*/jsx(Dropdown$1, {
|
|
15303
15423
|
isOpen: isOpen,
|
|
15304
15424
|
buttonStyle: isOpen ? "secondary" : "text",
|
|
15305
15425
|
closeOnSelect: false,
|
|
@@ -15314,42 +15434,45 @@ var TableOption = function TableOption(_ref) {
|
|
|
15314
15434
|
},
|
|
15315
15435
|
className: "neeto-editor-fixed-menu__item"
|
|
15316
15436
|
},
|
|
15317
|
-
customTarget: isSecondaryMenu && /*#__PURE__*/
|
|
15437
|
+
customTarget: isSecondaryMenu && /*#__PURE__*/jsx(SecondaryMenuTarget, {
|
|
15318
15438
|
label: label,
|
|
15319
15439
|
icon: Column
|
|
15320
15440
|
}),
|
|
15321
15441
|
onClick: handleDropdownClick,
|
|
15322
|
-
onClose: handleClose
|
|
15323
|
-
|
|
15324
|
-
|
|
15325
|
-
|
|
15326
|
-
|
|
15327
|
-
|
|
15328
|
-
|
|
15329
|
-
|
|
15330
|
-
|
|
15331
|
-
|
|
15332
|
-
|
|
15333
|
-
|
|
15334
|
-
|
|
15335
|
-
|
|
15336
|
-
|
|
15337
|
-
|
|
15338
|
-
|
|
15339
|
-
|
|
15340
|
-
|
|
15341
|
-
|
|
15342
|
-
|
|
15343
|
-
|
|
15344
|
-
|
|
15345
|
-
|
|
15346
|
-
|
|
15347
|
-
|
|
15348
|
-
|
|
15349
|
-
|
|
15350
|
-
|
|
15351
|
-
|
|
15352
|
-
|
|
15442
|
+
onClose: handleClose,
|
|
15443
|
+
children: /*#__PURE__*/jsxs(Menu$1, {
|
|
15444
|
+
className: "neeto-editor-table__item",
|
|
15445
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
15446
|
+
autoFocus: true,
|
|
15447
|
+
"data-cy": "neeto-editor-fixed-menu-table-option-input",
|
|
15448
|
+
label: t("neetoEditor.menu.rows"),
|
|
15449
|
+
min: "1",
|
|
15450
|
+
placeholder: t("neetoEditor.placeholders.rows"),
|
|
15451
|
+
size: "small",
|
|
15452
|
+
type: "number",
|
|
15453
|
+
value: rows,
|
|
15454
|
+
onChange: withEventTargetValue(setRows)
|
|
15455
|
+
}), /*#__PURE__*/jsx(Input, {
|
|
15456
|
+
"data-cy": "neeto-editor-fixed-menu-table-option-input",
|
|
15457
|
+
label: t("neetoEditor.menu.columns"),
|
|
15458
|
+
min: "1",
|
|
15459
|
+
placeholder: t("neetoEditor.placeholders.rows"),
|
|
15460
|
+
size: "small",
|
|
15461
|
+
type: "number",
|
|
15462
|
+
value: columns,
|
|
15463
|
+
onChange: withEventTargetValue(setColumns)
|
|
15464
|
+
}), /*#__PURE__*/jsx("div", {
|
|
15465
|
+
className: "neeto-editor-table-menu__button",
|
|
15466
|
+
children: /*#__PURE__*/jsx(Button$1, {
|
|
15467
|
+
className: "mt-auto",
|
|
15468
|
+
"data-cy": "neeto-editor-fixed-menu-table-option-create-button",
|
|
15469
|
+
label: t("neetoEditor.common.create"),
|
|
15470
|
+
size: "small",
|
|
15471
|
+
onClick: handleSubmit
|
|
15472
|
+
})
|
|
15473
|
+
})]
|
|
15474
|
+
})
|
|
15475
|
+
});
|
|
15353
15476
|
};
|
|
15354
15477
|
var TableOption$1 = /*#__PURE__*/memo(TableOption);
|
|
15355
15478
|
|
|
@@ -15765,17 +15888,17 @@ var Menu = function Menu(props) {
|
|
|
15765
15888
|
document.removeEventListener("keydown", handleKeyDown);
|
|
15766
15889
|
};
|
|
15767
15890
|
}, []);
|
|
15768
|
-
return /*#__PURE__*/
|
|
15891
|
+
return /*#__PURE__*/jsx(MenuComponent, _objectSpread(_objectSpread({}, _objectSpread(_objectSpread({}, props), {}, {
|
|
15769
15892
|
attachmentProps: attachmentProps,
|
|
15770
15893
|
isEmojiPickerActive: isEmojiPickerActive,
|
|
15771
15894
|
mediaUploader: mediaUploader,
|
|
15772
15895
|
setIsEmojiPickerActive: setIsEmojiPickerActive,
|
|
15773
15896
|
setMediaUploader: setMediaUploader
|
|
15774
|
-
}), {
|
|
15897
|
+
})), {}, {
|
|
15775
15898
|
options: menuOptions,
|
|
15776
15899
|
unsplashApiKey: editorSecrets.unsplash
|
|
15777
15900
|
}));
|
|
15778
15901
|
};
|
|
15779
15902
|
|
|
15780
15903
|
export { resetFocussedNode as A, findParentNodeClosestToPos as B, BubbleMenu as C, DecorationSet as D, Extension as E, getLinkPopoverPosition as F, getMarkType as G, getMarkRange as H, InputRule as I, useEditor as J, EditorContent as K, MediaUploader as L, Menu as M, Node as N, EmbedOption as O, PasteRule as P, EditorView as Q, ReactNodeViewRenderer as R, Mark as a, markInputRule as b, markPasteRule as c, Decoration as d, callOrReturn as e, getExtensionField as f, getMarkAttributes as g, findChildren as h, NodeViewWrapper as i, NodeViewContent as j, keydownHandler as k, escapeForRegEx as l, mergeAttributes as m, nodeInputRule as n, ReactRenderer as o, EmojiPickerMenu as p, emojiPickerApi as q, combineTransactionSteps as r, getChangedRanges as s, textblockTypeInputRule as t, findChildrenInRange as u, validateUrl as v, wrappingInputRule as w, getMarksBetween as x, getAttributes as y, highlightFocussedNode as z };
|
|
15781
|
-
//# sourceMappingURL=chunk-
|
|
15904
|
+
//# sourceMappingURL=chunk-27a003fe.js.map
|