@bigbinary/neeto-editor-frontend 2.0.6 → 2.0.7
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/.ready +1 -1
- package/dist/Attachments.js +3 -4
- package/dist/Attachments.js.map +1 -1
- package/dist/Editor.js +89 -94
- package/dist/Editor.js.map +1 -1
- package/dist/EditorContent.js +4 -4
- package/dist/EditorContent.js.map +1 -1
- package/dist/FormikEditor.js +7 -7
- package/dist/FormikEditor.js.map +1 -1
- package/dist/Menu.js +3 -4
- package/dist/Menu.js.map +1 -1
- package/dist/{chunk-C4efob7L.js → chunk-BGx6BSFw.js} +82 -82
- package/dist/chunk-BGx6BSFw.js.map +1 -0
- package/dist/{chunk-CxFukRwo.js → chunk-BVW5D3k5.js} +11 -13
- package/dist/{chunk-CxFukRwo.js.map → chunk-BVW5D3k5.js.map} +1 -1
- package/dist/{chunk-CJfLgMJF.js → chunk-BV_wep_Y.js} +4 -5
- package/dist/{chunk-CJfLgMJF.js.map → chunk-BV_wep_Y.js.map} +1 -1
- package/dist/{chunk-jiUuXPs1.js → chunk-BfQ_Kj4i.js} +4 -5
- package/dist/{chunk-jiUuXPs1.js.map → chunk-BfQ_Kj4i.js.map} +1 -1
- package/dist/{chunk-C893rdfW.js → chunk-Byc0nnPW.js} +63 -63
- package/dist/chunk-Byc0nnPW.js.map +1 -0
- package/dist/{chunk-Qg4uQqj3.js → chunk-CTLN7kYv.js} +7 -7
- package/dist/{chunk-Qg4uQqj3.js.map → chunk-CTLN7kYv.js.map} +1 -1
- package/dist/{chunk-9vP3rEtI.js → chunk-CrQm8ki8.js} +9 -9
- package/dist/{chunk-9vP3rEtI.js.map → chunk-CrQm8ki8.js.map} +1 -1
- package/dist/{chunk-CA9DTddx.js → chunk-CxFTIgDS.js} +35 -40
- package/dist/chunk-CxFTIgDS.js.map +1 -0
- package/dist/{chunk-C6Wn4nia.js → chunk-D_Lgx0N7.js} +35 -40
- package/dist/chunk-D_Lgx0N7.js.map +1 -0
- package/dist/{chunk-aCTMceVU.js → chunk-DbtYYDYF.js} +9 -9
- package/dist/{chunk-aCTMceVU.js.map → chunk-DbtYYDYF.js.map} +1 -1
- package/dist/{chunk-Dm4Qt79M.js → chunk-DhFieQe2.js} +82 -82
- package/dist/chunk-DhFieQe2.js.map +1 -0
- package/dist/chunk-Di3ipdfT.js.map +1 -1
- package/dist/{chunk-fDmcpgqx.js → chunk-DxmX0drN.js} +2 -2
- package/dist/{chunk-fDmcpgqx.js.map → chunk-DxmX0drN.js.map} +1 -1
- package/dist/{chunk-2yDx3K8L.js → chunk-MLCxAQf7.js} +63 -63
- package/dist/chunk-MLCxAQf7.js.map +1 -0
- package/dist/{chunk-D3QbacSt.js → chunk-OP-lX765.js} +44 -50
- package/dist/{chunk-D3QbacSt.js.map → chunk-OP-lX765.js.map} +1 -1
- package/dist/chunk-UwzgbfZD.js.map +1 -1
- package/dist/cjs/Attachments.cjs.js +3 -4
- package/dist/cjs/Attachments.cjs.js.map +1 -1
- package/dist/cjs/Editor.cjs.js +89 -95
- package/dist/cjs/Editor.cjs.js.map +1 -1
- package/dist/cjs/EditorContent.cjs.js +4 -4
- package/dist/cjs/EditorContent.cjs.js.map +1 -1
- package/dist/cjs/FormikEditor.cjs.js +7 -7
- package/dist/cjs/FormikEditor.cjs.js.map +1 -1
- package/dist/cjs/Menu.cjs.js +3 -4
- package/dist/cjs/Menu.cjs.js.map +1 -1
- package/dist/cjs/{chunk-WeNbd2ic.cjs.js → chunk--47DtZYn.cjs.js} +82 -83
- package/dist/cjs/chunk--47DtZYn.cjs.js.map +1 -0
- package/dist/cjs/{chunk-B7RhUrgV.cjs.js → chunk-9oA3Y9DG.cjs.js} +11 -14
- package/dist/cjs/{chunk-B7RhUrgV.cjs.js.map → chunk-9oA3Y9DG.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-BL4O70ER.cjs.js → chunk-BAse0j9m.cjs.js} +4 -5
- package/dist/cjs/{chunk-BL4O70ER.cjs.js.map → chunk-BAse0j9m.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-Bm1Dzh4r.cjs.js → chunk-BPLEmkMA.cjs.js} +34 -40
- package/dist/cjs/chunk-BPLEmkMA.cjs.js.map +1 -0
- package/dist/cjs/{chunk-D3Unocnm.cjs.js → chunk-Bde8Sbb1.cjs.js} +44 -51
- package/dist/cjs/{chunk-D3Unocnm.cjs.js.map → chunk-Bde8Sbb1.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-BKvkHB8E.cjs.js → chunk-Bsk_FDUA.cjs.js} +7 -7
- package/dist/cjs/{chunk-BKvkHB8E.cjs.js.map → chunk-Bsk_FDUA.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-DXsX8co9.cjs.js → chunk-BwE6pvh2.cjs.js} +2 -2
- package/dist/cjs/{chunk-DXsX8co9.cjs.js.map → chunk-BwE6pvh2.cjs.js.map} +1 -1
- package/dist/cjs/chunk-BxKa_XOs.cjs.js.map +1 -1
- package/dist/cjs/{chunk-B1X-JIj8.cjs.js → chunk-CHk_Gq2n.cjs.js} +34 -40
- package/dist/cjs/chunk-CHk_Gq2n.cjs.js.map +1 -0
- package/dist/cjs/{chunk-CesnwG-V.cjs.js → chunk-CkdAygKd.cjs.js} +9 -9
- package/dist/cjs/{chunk-CesnwG-V.cjs.js.map → chunk-CkdAygKd.cjs.js.map} +1 -1
- package/dist/cjs/chunk-CohcWDmm.cjs.js.map +1 -1
- package/dist/cjs/{chunk-DBQBe3dq.cjs.js → chunk-CwtiYxqr.cjs.js} +9 -9
- package/dist/cjs/{chunk-DBQBe3dq.cjs.js.map → chunk-CwtiYxqr.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-DRTgn9TG.cjs.js → chunk-D53HfRZd.cjs.js} +62 -63
- package/dist/cjs/chunk-D53HfRZd.cjs.js.map +1 -0
- package/dist/cjs/{chunk-UyXI9oIp.cjs.js → chunk-D86ONI5s.cjs.js} +4 -5
- package/dist/cjs/{chunk-UyXI9oIp.cjs.js.map → chunk-D86ONI5s.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-TCCIxl2A.cjs.js → chunk-D9InNR1-.cjs.js} +62 -63
- package/dist/cjs/chunk-D9InNR1-.cjs.js.map +1 -0
- package/dist/cjs/{chunk-BETPWBif.cjs.js → chunk-DGPpvE8O.cjs.js} +82 -83
- package/dist/cjs/chunk-DGPpvE8O.cjs.js.map +1 -0
- package/dist/cjs/index.cjs.js +10 -10
- package/dist/cjs/utils.cjs.js +3 -3
- package/dist/cjs/v2/Attachments.cjs.js +3 -4
- package/dist/cjs/v2/Attachments.cjs.js.map +1 -1
- package/dist/cjs/v2/Editor.cjs.js +88 -94
- package/dist/cjs/v2/Editor.cjs.js.map +1 -1
- package/dist/cjs/v2/EditorContent.cjs.js +3 -3
- package/dist/cjs/v2/FormikEditor.cjs.js +7 -7
- package/dist/cjs/v2/FormikEditor.cjs.js.map +1 -1
- package/dist/cjs/v2/Menu.cjs.js +3 -4
- package/dist/cjs/v2/Menu.cjs.js.map +1 -1
- package/dist/cjs/v2/index.cjs.js +9 -9
- package/dist/cjs/v2/utils.cjs.js +3 -3
- package/dist/editor-content.min.css +1 -1
- package/dist/editor-output-pdf-email.css +1 -1
- package/dist/editor-output.js +1 -1
- package/dist/editor-stats.html +1 -1
- package/dist/index.js +10 -10
- package/dist/utils.js +3 -3
- package/dist/v2/Attachments.js +3 -4
- package/dist/v2/Attachments.js.map +1 -1
- package/dist/v2/Editor.js +88 -93
- package/dist/v2/Editor.js.map +1 -1
- package/dist/v2/EditorContent.js +3 -3
- package/dist/v2/FormikEditor.js +7 -7
- package/dist/v2/FormikEditor.js.map +1 -1
- package/dist/v2/Menu.js +3 -4
- package/dist/v2/Menu.js.map +1 -1
- package/dist/v2/editor-content-styles.js +1 -1
- package/dist/v2/editor-content.min.css +1 -1
- package/dist/v2/index.js +9 -9
- package/dist/v2/styles.css +1 -1
- package/dist/v2/styles.js +1 -1
- package/dist/v2/utils.js +3 -3
- package/package.json +101 -100
- package/dist/chunk-2yDx3K8L.js.map +0 -1
- package/dist/chunk-C4efob7L.js.map +0 -1
- package/dist/chunk-C6Wn4nia.js.map +0 -1
- package/dist/chunk-C893rdfW.js.map +0 -1
- package/dist/chunk-CA9DTddx.js.map +0 -1
- package/dist/chunk-Dm4Qt79M.js.map +0 -1
- package/dist/cjs/chunk-B1X-JIj8.cjs.js.map +0 -1
- package/dist/cjs/chunk-BETPWBif.cjs.js.map +0 -1
- package/dist/cjs/chunk-Bm1Dzh4r.cjs.js.map +0 -1
- package/dist/cjs/chunk-DRTgn9TG.cjs.js.map +0 -1
- package/dist/cjs/chunk-TCCIxl2A.cjs.js.map +0 -1
- package/dist/cjs/chunk-WeNbd2ic.cjs.js.map +0 -1
package/dist/v2/Editor.js
CHANGED
|
@@ -9,14 +9,14 @@ import classnames from 'classnames';
|
|
|
9
9
|
import { isNotPresent, findBy, isNotEmpty, isPresent, noop, slugify } from '@bigbinary/neeto-cist';
|
|
10
10
|
import { useOnClickOutside, withT, useFuncDebounce } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
|
|
11
11
|
import { createPortal } from 'react-dom';
|
|
12
|
-
import { B as BulletList$1, s as src_default, a as src_default$1, R as Resizable, b as src_default$2, L as Link$1, c as scrollHandler, d as src_default$3, O as OrderedList$1, e as src_default$4, f as fuzzySearch, T as Table$2, g as TaskList, h as TaskItem, i as getVideoDimension, C as CharacterCount, j as src_default$5, k as src_default$6, l as safeSplitBlock, m as safeListKeymap, n as TextStyle, o as src_default$7, F as Focus, p as src_default$8, q as TableRow, r as TableHeader, t as TableCell, u as Color, v as ListItem, w as src_default$9, x as src_default$a, y as useFetchKbArticles, J as useEditorWarnings, K as useDeletedArticles } from '../chunk-
|
|
12
|
+
import { B as BulletList$1, s as src_default, a as src_default$1, R as Resizable, b as src_default$2, L as Link$1, c as scrollHandler, d as src_default$3, O as OrderedList$1, e as src_default$4, f as fuzzySearch, T as Table$2, g as TaskList, h as TaskItem, i as getVideoDimension, C as CharacterCount, j as src_default$5, k as src_default$6, l as safeSplitBlock, m as safeListKeymap, n as TextStyle, o as src_default$7, F as Focus, p as src_default$8, q as TableRow, r as TableHeader, t as TableCell, u as Color, v as ListItem, w as src_default$9, x as src_default$a, y as useFetchKbArticles, J as useEditorWarnings, K as useDeletedArticles } from '../chunk-BVW5D3k5.js';
|
|
13
13
|
import { D as DIRECT_UPLOAD_ENDPOINT, E as EDITOR_OPTIONS, C as COMBINED_REGEX, a as EDITOR_SIZES } from '../chunk-UwzgbfZD.js';
|
|
14
14
|
import '../chunk-CNIDH-FD.js';
|
|
15
15
|
import { is, intersection, difference, union, isEmpty, isNil, mergeRight, assoc, equals } from 'ramda';
|
|
16
16
|
import ReactDOM from 'react-dom/server';
|
|
17
|
-
import { l as lowlight, d as decodeHtmlEntities, r as removeEmptyTags } from '../chunk-
|
|
17
|
+
import { l as lowlight, d as decodeHtmlEntities, r as removeEmptyTags } from '../chunk-CTLN7kYv.js';
|
|
18
18
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
19
|
-
import { C as CALLOUT_TYPES, E as EmojiPickerMenu, g as getSuggestionAppendTo, v as validateUrl, b as buildLevelsFromOptions, c as getLinkPopoverPosition, L as LINK_VALIDATION_SCHEMA, d as validateAndFormatUrl, D as DEFAULT_EDITOR_OPTIONS, e as getEditorStyles, M as Menu$3, f as MenuDynamicVariables, h as MediaUploader, j as LinkAddPopOver, k as transformPastedHTML, l as handlePaste, m as clipboardTextParser, s as setInitialPosition } from '../chunk-
|
|
19
|
+
import { C as CALLOUT_TYPES, E as EmojiPickerMenu, g as getSuggestionAppendTo, v as validateUrl, b as buildLevelsFromOptions, c as getLinkPopoverPosition, L as LINK_VALIDATION_SCHEMA, d as validateAndFormatUrl, D as DEFAULT_EDITOR_OPTIONS, e as getEditorStyles, M as Menu$3, f as MenuDynamicVariables, h as MediaUploader, j as LinkAddPopOver, k as transformPastedHTML, l as handlePaste, m as clipboardTextParser, s as setInitialPosition } from '../chunk-Byc0nnPW.js';
|
|
20
20
|
import Megaphone from '@bigbinary/neeto-icons/misc/Megaphone';
|
|
21
21
|
import { m as PluginKey, P as Plugin, a as Selection, S as Slice, F as Fragment$1, T as TextSelection } from '../chunk-DgZGzqPs.js';
|
|
22
22
|
import { ChevronDown, Highlighter, X, Ratio, Ellipsis, AlignLeft, AlignCenter, AlignRight, RectangleHorizontal, RectangleVertical, Square, SquareDashed, Trash2, Minus as Minus$1, Plus, BookOpen, Pencil } from 'lucide-react';
|
|
@@ -24,7 +24,7 @@ import CopyToClipboardButton from '@bigbinary/neeto-molecules/v2/CopyToClipboard
|
|
|
24
24
|
import { useTranslation } from 'react-i18next';
|
|
25
25
|
import { t } from 'i18next';
|
|
26
26
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
27
|
-
import
|
|
27
|
+
import '@babel/runtime/helpers/readOnlyError';
|
|
28
28
|
import tippy from 'tippy.js';
|
|
29
29
|
import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
|
|
30
30
|
import _createClass from '@babel/runtime/helpers/createClass';
|
|
@@ -33,7 +33,7 @@ import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
|
|
|
33
33
|
import _inherits from '@babel/runtime/helpers/inherits';
|
|
34
34
|
import { init, SearchIndex } from 'emoji-mart';
|
|
35
35
|
import { globalProps } from '@bigbinary/neeto-commons-frontend/v2/initializers';
|
|
36
|
-
import { D as DirectUpload } from '../chunk-
|
|
36
|
+
import { D as DirectUpload } from '../chunk-OP-lX765.js';
|
|
37
37
|
import Tippy from '@tippyjs/react';
|
|
38
38
|
import TextP from '@bigbinary/neeto-icons/TextP';
|
|
39
39
|
import TextH1 from '@bigbinary/neeto-icons/TextH1';
|
|
@@ -59,11 +59,11 @@ import Link$2 from '@bigbinary/neeto-icons/Link';
|
|
|
59
59
|
import Attachment from '@bigbinary/neeto-icons/Attachment';
|
|
60
60
|
import MessageSquare from '@bigbinary/neeto-icons/MessageSquare';
|
|
61
61
|
import File from '@bigbinary/neeto-icons/File';
|
|
62
|
-
import { h as DEFAULT_ASPECT_RATIO } from '../chunk-
|
|
62
|
+
import { h as DEFAULT_ASPECT_RATIO } from '../chunk-CxFTIgDS.js';
|
|
63
63
|
import _typeof from '@babel/runtime/helpers/typeof';
|
|
64
64
|
import Search from '@bigbinary/neeto-molecules/v2/Search';
|
|
65
65
|
import { Form, Input as Input$1 } from '@bigbinary/neeto-atoms/formik';
|
|
66
|
-
import { A as Attachments } from '../chunk-
|
|
66
|
+
import { A as Attachments } from '../chunk-BGx6BSFw.js';
|
|
67
67
|
import 'axios';
|
|
68
68
|
import '@bigbinary/neeto-commons-frontend/react-utils';
|
|
69
69
|
import 'zustand';
|
|
@@ -666,26 +666,27 @@ var CodeBlock = src_default.extend({
|
|
|
666
666
|
defaultLanguage: "plaintext"
|
|
667
667
|
});
|
|
668
668
|
|
|
669
|
+
function _regenerator$2() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2$2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = false, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = true, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), true), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2$2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2$2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2$2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2$2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2$2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2$2(u), _regeneratorDefine2$2(u, o, "Generator"), _regeneratorDefine2$2(u, n, function () { return this; }), _regeneratorDefine2$2(u, "toString", function () { return "[object Generator]"; }), (_regenerator$2 = function _regenerator() { return { w: i, m: f }; })(); }
|
|
670
|
+
function _regeneratorDefine2$2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2$2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2$2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2$2(e, r, n, t); }
|
|
669
671
|
var CustomCommands = Extension.create({
|
|
670
672
|
name: "paste-unformatted",
|
|
671
673
|
addCommands: function addCommands() {
|
|
672
674
|
return {
|
|
673
675
|
pasteUnformatted: function pasteUnformatted() {
|
|
674
676
|
return /*#__PURE__*/function () {
|
|
675
|
-
var _ref2 = _asyncToGenerator(/*#__PURE__*/
|
|
677
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator$2().m(function _callee(_ref) {
|
|
676
678
|
var editor, text;
|
|
677
|
-
return
|
|
678
|
-
while (1) switch (_context.
|
|
679
|
+
return _regenerator$2().w(function (_context) {
|
|
680
|
+
while (1) switch (_context.n) {
|
|
679
681
|
case 0:
|
|
680
682
|
editor = _ref.editor;
|
|
681
|
-
_context.
|
|
683
|
+
_context.n = 1;
|
|
682
684
|
return navigator.clipboard.readText();
|
|
683
|
-
case
|
|
684
|
-
text = _context.
|
|
685
|
+
case 1:
|
|
686
|
+
text = _context.v;
|
|
685
687
|
editor.commands.insertContent(text);
|
|
686
|
-
case
|
|
687
|
-
|
|
688
|
-
return _context.stop();
|
|
688
|
+
case 2:
|
|
689
|
+
return _context.a(2);
|
|
689
690
|
}
|
|
690
691
|
}, _callee);
|
|
691
692
|
}));
|
|
@@ -847,6 +848,8 @@ var filterEmojiSuggestions = function filterEmojiSuggestions(suggestions, freque
|
|
|
847
848
|
}).slice(0, 5);
|
|
848
849
|
};
|
|
849
850
|
|
|
851
|
+
function _regenerator$1() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2$1(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = false, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = true, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), true), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2$1(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2$1(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2$1(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2$1(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2$1(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2$1(u), _regeneratorDefine2$1(u, o, "Generator"), _regeneratorDefine2$1(u, n, function () { return this; }), _regeneratorDefine2$1(u, "toString", function () { return "[object Generator]"; }), (_regenerator$1 = function _regenerator() { return { w: i, m: f }; })(); }
|
|
852
|
+
function _regeneratorDefine2$1(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2$1 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2$1(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2$1(e, r, n, t); }
|
|
850
853
|
function _callSuper$3(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
851
854
|
function _isNativeReflectConstruct$3() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
852
855
|
var EmojiSuggestionMenu = /*#__PURE__*/function (_React$Component) {
|
|
@@ -863,90 +866,82 @@ var EmojiSuggestionMenu = /*#__PURE__*/function (_React$Component) {
|
|
|
863
866
|
emojiSuggestions: [],
|
|
864
867
|
frequentlyUsedEmojis: {}
|
|
865
868
|
});
|
|
866
|
-
_defineProperty(_this, "fetchEmojiData", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
869
|
+
_defineProperty(_this, "fetchEmojiData", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator$1().m(function _callee() {
|
|
867
870
|
var _yield$emojiPickerApi, data;
|
|
868
|
-
return
|
|
869
|
-
while (1) switch (_context.
|
|
871
|
+
return _regenerator$1().w(function (_context) {
|
|
872
|
+
while (1) switch (_context.p = _context.n) {
|
|
870
873
|
case 0:
|
|
871
874
|
_this.setState({
|
|
872
875
|
isLoading: true
|
|
873
876
|
});
|
|
874
|
-
_context.
|
|
875
|
-
_context.
|
|
877
|
+
_context.p = 1;
|
|
878
|
+
_context.n = 2;
|
|
876
879
|
return emojiPickerApi.fetch();
|
|
877
|
-
case
|
|
878
|
-
_yield$emojiPickerApi = _context.
|
|
880
|
+
case 2:
|
|
881
|
+
_yield$emojiPickerApi = _context.v;
|
|
879
882
|
data = _yield$emojiPickerApi.data;
|
|
880
883
|
_this.setState({
|
|
881
884
|
isLoading: false
|
|
882
885
|
});
|
|
883
|
-
return _context.
|
|
884
|
-
case
|
|
885
|
-
_context.
|
|
886
|
-
_context.
|
|
886
|
+
return _context.a(2, data);
|
|
887
|
+
case 3:
|
|
888
|
+
_context.p = 3;
|
|
889
|
+
_context.v;
|
|
887
890
|
_this.setState({
|
|
888
891
|
isLoading: false
|
|
889
892
|
});
|
|
890
|
-
return _context.
|
|
891
|
-
case 14:
|
|
892
|
-
case "end":
|
|
893
|
-
return _context.stop();
|
|
893
|
+
return _context.a(2, {});
|
|
894
894
|
}
|
|
895
|
-
}, _callee, null, [[1,
|
|
895
|
+
}, _callee, null, [[1, 3]]);
|
|
896
896
|
})));
|
|
897
897
|
// eslint-disable-next-line require-await
|
|
898
|
-
_defineProperty(_this, "searchEmoji", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
899
|
-
return
|
|
900
|
-
while (1) switch (_context2.
|
|
898
|
+
_defineProperty(_this, "searchEmoji", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator$1().m(function _callee2() {
|
|
899
|
+
return _regenerator$1().w(function (_context2) {
|
|
900
|
+
while (1) switch (_context2.n) {
|
|
901
901
|
case 0:
|
|
902
|
-
return _context2.
|
|
903
|
-
case 1:
|
|
904
|
-
case "end":
|
|
905
|
-
return _context2.stop();
|
|
902
|
+
return _context2.a(2, _this.props.query ? SearchIndex.search(_this.props.query) : []);
|
|
906
903
|
}
|
|
907
904
|
}, _callee2);
|
|
908
905
|
})));
|
|
909
|
-
_defineProperty(_this, "searchEmojiAndSetState", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
906
|
+
_defineProperty(_this, "searchEmojiAndSetState", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator$1().m(function _callee3() {
|
|
910
907
|
var suggestions, frequentlyUsedEmojis;
|
|
911
|
-
return
|
|
912
|
-
while (1) switch (_context3.
|
|
908
|
+
return _regenerator$1().w(function (_context3) {
|
|
909
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
913
910
|
case 0:
|
|
914
|
-
_context3.
|
|
915
|
-
_context3.
|
|
911
|
+
_context3.p = 0;
|
|
912
|
+
_context3.n = 1;
|
|
916
913
|
return _this.searchEmoji();
|
|
917
|
-
case
|
|
918
|
-
suggestions = _context3.
|
|
914
|
+
case 1:
|
|
915
|
+
suggestions = _context3.v;
|
|
919
916
|
frequentlyUsedEmojis = _this.state.frequentlyUsedEmojis;
|
|
920
917
|
_this.setState({
|
|
921
918
|
emojiSuggestions: filterEmojiSuggestions(suggestions, frequentlyUsedEmojis)
|
|
922
919
|
});
|
|
923
|
-
_context3.
|
|
920
|
+
_context3.n = 3;
|
|
924
921
|
break;
|
|
925
|
-
case
|
|
926
|
-
_context3.
|
|
927
|
-
_context3.
|
|
922
|
+
case 2:
|
|
923
|
+
_context3.p = 2;
|
|
924
|
+
_context3.v;
|
|
928
925
|
_this.setState({
|
|
929
926
|
emojiSuggestions: []
|
|
930
927
|
});
|
|
931
|
-
case
|
|
932
|
-
|
|
933
|
-
return _context3.stop();
|
|
928
|
+
case 3:
|
|
929
|
+
return _context3.a(2);
|
|
934
930
|
}
|
|
935
|
-
}, _callee3, null, [[0,
|
|
931
|
+
}, _callee3, null, [[0, 2]]);
|
|
936
932
|
})));
|
|
937
|
-
_defineProperty(_this, "setEditorState", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/
|
|
933
|
+
_defineProperty(_this, "setEditorState", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator$1().m(function _callee4() {
|
|
938
934
|
var suggestions;
|
|
939
|
-
return
|
|
940
|
-
while (1) switch (_context4.
|
|
935
|
+
return _regenerator$1().w(function (_context4) {
|
|
936
|
+
while (1) switch (_context4.n) {
|
|
941
937
|
case 0:
|
|
942
|
-
_context4.
|
|
938
|
+
_context4.n = 1;
|
|
943
939
|
return _this.searchEmoji();
|
|
944
|
-
case
|
|
945
|
-
suggestions = _context4.
|
|
940
|
+
case 1:
|
|
941
|
+
suggestions = _context4.v;
|
|
946
942
|
_this.props.editor.chain().focus().deleteRange(_this.props.range).setEmoji(suggestions[0]).run();
|
|
947
|
-
case
|
|
948
|
-
|
|
949
|
-
return _context4.stop();
|
|
943
|
+
case 2:
|
|
944
|
+
return _context4.a(2);
|
|
950
945
|
}
|
|
951
946
|
}, _callee4);
|
|
952
947
|
})));
|
|
@@ -1522,30 +1517,31 @@ var ImageComponent = function ImageComponent(_ref) {
|
|
|
1522
1517
|
};
|
|
1523
1518
|
|
|
1524
1519
|
var _excluded$4 = ["caption"];
|
|
1520
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = false, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = true, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), true), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
1521
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
1525
1522
|
var upload = /*#__PURE__*/function () {
|
|
1526
|
-
var _ref = _asyncToGenerator(/*#__PURE__*/
|
|
1523
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(file, url) {
|
|
1527
1524
|
var _response$data, uploader, response;
|
|
1528
|
-
return
|
|
1529
|
-
while (1) switch (_context.
|
|
1525
|
+
return _regenerator().w(function (_context) {
|
|
1526
|
+
while (1) switch (_context.n) {
|
|
1530
1527
|
case 0:
|
|
1531
1528
|
if (!(file.size <= globalProps.endUserUploadedFileSizeLimitInMb * 1024 * 1024)) {
|
|
1532
|
-
_context.
|
|
1529
|
+
_context.n = 2;
|
|
1533
1530
|
break;
|
|
1534
1531
|
}
|
|
1535
1532
|
uploader = new DirectUpload({
|
|
1536
1533
|
file: file,
|
|
1537
1534
|
url: url
|
|
1538
1535
|
});
|
|
1539
|
-
_context.
|
|
1536
|
+
_context.n = 1;
|
|
1540
1537
|
return uploader.create();
|
|
1541
|
-
case
|
|
1542
|
-
response = _context.
|
|
1543
|
-
return _context.
|
|
1544
|
-
case
|
|
1538
|
+
case 1:
|
|
1539
|
+
response = _context.v;
|
|
1540
|
+
return _context.a(2, ((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.blob_url) || response.blob_url);
|
|
1541
|
+
case 2:
|
|
1545
1542
|
throw new Error(LARGE_IMAGE_ERROR);
|
|
1546
|
-
case
|
|
1547
|
-
|
|
1548
|
-
return _context.stop();
|
|
1543
|
+
case 3:
|
|
1544
|
+
return _context.a(2);
|
|
1549
1545
|
}
|
|
1550
1546
|
}, _callee);
|
|
1551
1547
|
}));
|
|
@@ -1766,13 +1762,13 @@ var ImageExtension = Node.create({
|
|
|
1766
1762
|
event.preventDefault();
|
|
1767
1763
|
var currentPos = pos;
|
|
1768
1764
|
images.forEach(/*#__PURE__*/function () {
|
|
1769
|
-
var _ref5 = _asyncToGenerator(/*#__PURE__*/
|
|
1770
|
-
var emptyImageNode, id, tr, url, imageNode, _view$state2, _tr, doc, nodePos, _doc, _tr2;
|
|
1771
|
-
return
|
|
1772
|
-
while (1) switch (_context2.
|
|
1765
|
+
var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(image) {
|
|
1766
|
+
var emptyImageNode, id, tr, url, imageNode, _view$state2, _tr, doc, nodePos, _doc, _tr2, _t;
|
|
1767
|
+
return _regenerator().w(function (_context2) {
|
|
1768
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
1773
1769
|
case 0:
|
|
1774
1770
|
id = Math.random().toString(36).substring(7);
|
|
1775
|
-
_context2.
|
|
1771
|
+
_context2.p = 1;
|
|
1776
1772
|
emptyImageNode = schema.nodes.image.create({
|
|
1777
1773
|
id: id,
|
|
1778
1774
|
src: "",
|
|
@@ -1780,10 +1776,10 @@ var ImageExtension = Node.create({
|
|
|
1780
1776
|
});
|
|
1781
1777
|
tr = view.state.tr.insert(currentPos, emptyImageNode).setMeta("addToHistory", false);
|
|
1782
1778
|
view.dispatch(tr);
|
|
1783
|
-
_context2.
|
|
1779
|
+
_context2.n = 2;
|
|
1784
1780
|
return upload(image, DIRECT_UPLOAD_ENDPOINT);
|
|
1785
|
-
case
|
|
1786
|
-
url = _context2.
|
|
1781
|
+
case 2:
|
|
1782
|
+
url = _context2.v;
|
|
1787
1783
|
if (url) {
|
|
1788
1784
|
imageNode = schema.nodes.image.create({
|
|
1789
1785
|
id: id,
|
|
@@ -1804,13 +1800,13 @@ var ImageExtension = Node.create({
|
|
|
1804
1800
|
view.dispatch(_tr);
|
|
1805
1801
|
}
|
|
1806
1802
|
}
|
|
1807
|
-
_context2.
|
|
1803
|
+
_context2.n = 4;
|
|
1808
1804
|
break;
|
|
1809
|
-
case
|
|
1810
|
-
_context2.
|
|
1811
|
-
|
|
1805
|
+
case 3:
|
|
1806
|
+
_context2.p = 3;
|
|
1807
|
+
_t = _context2.v;
|
|
1812
1808
|
// eslint-disable-next-line no-console
|
|
1813
|
-
console.error("Failed to insert the image",
|
|
1809
|
+
console.error("Failed to insert the image", _t);
|
|
1814
1810
|
_doc = view.state.doc;
|
|
1815
1811
|
_tr2 = view.state.tr;
|
|
1816
1812
|
_doc.descendants(function (node, pos) {
|
|
@@ -1821,18 +1817,17 @@ var ImageExtension = Node.create({
|
|
|
1821
1817
|
return true;
|
|
1822
1818
|
});
|
|
1823
1819
|
view.dispatch(_tr2);
|
|
1824
|
-
if (
|
|
1820
|
+
if (_t.message === LARGE_IMAGE_ERROR) {
|
|
1825
1821
|
Toastr.error(t("neetoEditor.error.imageSizeIsShouldBeLess", {
|
|
1826
1822
|
limit: globalProps.endUserUploadedFileSizeLimitInMb
|
|
1827
1823
|
}));
|
|
1828
1824
|
} else {
|
|
1829
1825
|
Toastr.error(t("neetoEditor.error.imageUploadFailed"));
|
|
1830
1826
|
}
|
|
1831
|
-
case
|
|
1832
|
-
|
|
1833
|
-
return _context2.stop();
|
|
1827
|
+
case 4:
|
|
1828
|
+
return _context2.a(2);
|
|
1834
1829
|
}
|
|
1835
|
-
}, _callee2, null, [[1,
|
|
1830
|
+
}, _callee2, null, [[1, 3]]);
|
|
1836
1831
|
}));
|
|
1837
1832
|
return function (_x3) {
|
|
1838
1833
|
return _ref5.apply(this, arguments);
|