@bigbinary/neeto-editor 1.47.77 → 1.47.78
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 +3 -3
- package/dist/Editor.js +6 -6
- package/dist/EditorContent.js +2 -2
- package/dist/FormikEditor.js +6 -6
- package/dist/Menu.js +5 -5
- package/dist/{chunk-CkQeBm6A.js → chunk-BOAmmpv4.js} +3 -3
- package/dist/{chunk-CkQeBm6A.js.map → chunk-BOAmmpv4.js.map} +1 -1
- package/dist/{chunk-Bo7NcVuL.js → chunk-CXmkXuF3.js} +61 -97
- package/dist/chunk-CXmkXuF3.js.map +1 -0
- package/dist/{chunk-B5YaLVE-.js → chunk-CZULBD4z.js} +4 -4
- package/dist/{chunk-B5YaLVE-.js.map → chunk-CZULBD4z.js.map} +1 -1
- package/dist/{chunk-BNHtPaDh.js → chunk-DADua5Hs.js} +4 -4
- package/dist/{chunk-BNHtPaDh.js.map → chunk-DADua5Hs.js.map} +1 -1
- package/dist/{chunk-DDwycKmK.js → chunk-DNMH2cJJ.js} +2 -2
- package/dist/{chunk-DDwycKmK.js.map → chunk-DNMH2cJJ.js.map} +1 -1
- package/dist/{chunk-CF5f8-fy.js → chunk-DxGDZoUl.js} +2 -2
- package/dist/{chunk-CF5f8-fy.js.map → chunk-DxGDZoUl.js.map} +1 -1
- package/dist/{chunk-W4Qa_gr3.js → chunk-V3YZX4m4.js} +4 -17
- package/dist/chunk-V3YZX4m4.js.map +1 -0
- package/dist/cjs/Attachments.cjs.js +2 -2
- package/dist/cjs/Editor.cjs.js +4 -4
- package/dist/cjs/Editor.cjs.js.map +1 -1
- package/dist/cjs/FormikEditor.cjs.js +3 -3
- package/dist/cjs/Menu.cjs.js +2 -2
- package/dist/cjs/{chunk-rjsFR0-b.cjs.js → chunk-BWh2yM_t.cjs.js} +3 -3
- package/dist/cjs/{chunk-rjsFR0-b.cjs.js.map → chunk-BWh2yM_t.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-seb1zfr-.cjs.js → chunk-D6gUFJOw.cjs.js} +3 -3
- package/dist/cjs/{chunk-seb1zfr-.cjs.js.map → chunk-D6gUFJOw.cjs.js.map} +1 -1
- package/dist/cjs/{chunk-B6RMsqti.cjs.js → chunk-Ew36msGi.cjs.js} +2 -16
- package/dist/cjs/chunk-Ew36msGi.cjs.js.map +1 -0
- package/dist/cjs/{chunk-CS245CXd.cjs.js → chunk-pQ98WW7j.cjs.js} +58 -93
- package/dist/cjs/chunk-pQ98WW7j.cjs.js.map +1 -0
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/constants.js +2 -2
- package/dist/editor-stats.html +1 -1
- package/dist/index.js +6 -6
- package/dist/utils.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-Bo7NcVuL.js.map +0 -1
- package/dist/chunk-W4Qa_gr3.js.map +0 -1
- package/dist/cjs/chunk-B6RMsqti.cjs.js.map +0 -1
- package/dist/cjs/chunk-CS245CXd.cjs.js.map +0 -1
|
@@ -11,11 +11,11 @@ import TextH3 from '@bigbinary/neeto-icons/TextH3';
|
|
|
11
11
|
import TextH4 from '@bigbinary/neeto-icons/TextH4';
|
|
12
12
|
import TextH5 from '@bigbinary/neeto-icons/TextH5';
|
|
13
13
|
import TextP from '@bigbinary/neeto-icons/TextP';
|
|
14
|
-
import { T as TextSelection, N as NodeSelection, S as Selection, b as Slice, d as dropPoint, D as DOMSerializer, F as Fragment, c as DOMParser, A as AllSelection, M as Mark$1, P as Plugin, R as ReplaceError, e as MarkType, l as liftTarget$2, r as replaceStep$1, f as ReplaceStep$2, g as canJoin$2, j as joinPoint$1, h as canSplit$2, k as ReplaceAroundStep$2, m as findWrapping$2, n as NodeRange, o as PluginKey, p as Schema, E as EditorState, v as validateAndFormatUrl } from './chunk-
|
|
14
|
+
import { T as TextSelection, N as NodeSelection, S as Selection, b as Slice, d as dropPoint, D as DOMSerializer, F as Fragment, c as DOMParser, A as AllSelection, M as Mark$1, P as Plugin, R as ReplaceError, e as MarkType, l as liftTarget$2, r as replaceStep$1, f as ReplaceStep$2, g as canJoin$2, j as joinPoint$1, h as canSplit$2, k as ReplaceAroundStep$2, m as findWrapping$2, n as NodeRange, o as PluginKey, p as Schema, E as EditorState, v as validateAndFormatUrl } from './chunk-BOAmmpv4.js';
|
|
15
15
|
import tippy, { roundArrow } from 'tippy.js';
|
|
16
16
|
import ReactDOM, { flushSync, createPortal } from 'react-dom';
|
|
17
17
|
import classnames from 'classnames';
|
|
18
|
-
import {
|
|
18
|
+
import { U as URL_VALIDATORS, A as ALL_PROTOCOL_URL_REGEXP, E as EDITOR_OPTIONS } from './chunk-DNMH2cJJ.js';
|
|
19
19
|
import { findBy, hyphenate, isNotPresent, noop, isNotEmpty, filterBy } from '@bigbinary/neeto-cist';
|
|
20
20
|
import 'tippy.js/dist/svg-arrow.css';
|
|
21
21
|
import Link from '@bigbinary/neeto-icons/Link';
|
|
@@ -67,7 +67,7 @@ import { ImageUploader } from '@bigbinary/neeto-image-uploader-frontend';
|
|
|
67
67
|
import Modal from '@bigbinary/neetoui/Modal';
|
|
68
68
|
import Tab from '@bigbinary/neetoui/Tab';
|
|
69
69
|
import Toastr from '@bigbinary/neetoui/Toastr';
|
|
70
|
-
import { F as File, u as useFileUploader, b as useDropFiles, A as ALLOWED_IMAGE_TYPES, c as ALLOWED_VIDEO_TYPES, e as convertToFileSize, D as DEFAULT_IMAGE_UPLOAD_CONFIG, f as DEFAULT_VIDEO_UPLOAD_CONFIG, V as VIDEO_EMBED_FORM_VALIDATION_SCHEMA, g as getTabs,
|
|
70
|
+
import { F as File, u as useFileUploader, b as useDropFiles, A as ALLOWED_IMAGE_TYPES, c as ALLOWED_VIDEO_TYPES, e as convertToFileSize, D as DEFAULT_IMAGE_UPLOAD_CONFIG, f as DEFAULT_VIDEO_UPLOAD_CONFIG, V as VIDEO_EMBED_FORM_VALIDATION_SCHEMA, g as getTabs, d as directUploadsApi } from './chunk-V3YZX4m4.js';
|
|
71
71
|
import Tooltip from '@bigbinary/neetoui/Tooltip';
|
|
72
72
|
import Form from '@bigbinary/neetoui/formik/Form';
|
|
73
73
|
import Input$1 from '@bigbinary/neetoui/formik/Input';
|
|
@@ -86,7 +86,7 @@ import Success from '@bigbinary/neeto-icons/misc/Success';
|
|
|
86
86
|
import MenuHorizontal from '@bigbinary/neeto-icons/MenuHorizontal';
|
|
87
87
|
import DynamicVariables from '@bigbinary/neeto-molecules/DynamicVariables';
|
|
88
88
|
import Tippy from '@tippyjs/react';
|
|
89
|
-
import { D as DEFAULT_EDITOR_OPTIONS } from './chunk-
|
|
89
|
+
import { D as DEFAULT_EDITOR_OPTIONS } from './chunk-DxGDZoUl.js';
|
|
90
90
|
|
|
91
91
|
const domIndex = function (node) {
|
|
92
92
|
for (var index = 0;; index++) {
|
|
@@ -15732,6 +15732,16 @@ var generateFocusProps = function generateFocusProps() {
|
|
|
15732
15732
|
return highlight ? focusProps : {};
|
|
15733
15733
|
};
|
|
15734
15734
|
|
|
15735
|
+
var validateUrl = function validateUrl(url) {
|
|
15736
|
+
if (!url) return false;
|
|
15737
|
+
for (var _i = 0, _Object$values = Object.values(URL_VALIDATORS); _i < _Object$values.length; _i++) {
|
|
15738
|
+
var validator = _Object$values[_i];
|
|
15739
|
+
var result = validator(url);
|
|
15740
|
+
if (result) return result;
|
|
15741
|
+
}
|
|
15742
|
+
return false;
|
|
15743
|
+
};
|
|
15744
|
+
|
|
15735
15745
|
/** @type {import("neetocommons/react-utils").ZustandStoreHook} */
|
|
15736
15746
|
var useEditorStore = create(withImmutableActions(function (set) {
|
|
15737
15747
|
return {
|
|
@@ -16887,69 +16897,28 @@ var LocalUploader = function LocalUploader(_ref) {
|
|
|
16887
16897
|
});
|
|
16888
16898
|
};
|
|
16889
16899
|
|
|
16890
|
-
var
|
|
16891
|
-
var
|
|
16892
|
-
|
|
16893
|
-
|
|
16894
|
-
onSubmit = _ref.onSubmit,
|
|
16895
|
-
_ref$className = _ref.className,
|
|
16896
|
-
className = _ref$className === void 0 ? "" : _ref$className;
|
|
16900
|
+
var VideoEmbedForm = function VideoEmbedForm(_ref) {
|
|
16901
|
+
var onEmbedVideo = _ref.onEmbedVideo,
|
|
16902
|
+
onAttachVideo = _ref.onAttachVideo,
|
|
16903
|
+
onClose = _ref.onClose;
|
|
16897
16904
|
var _useTranslation = useTranslation(),
|
|
16898
16905
|
t = _useTranslation.t;
|
|
16899
|
-
var
|
|
16900
|
-
|
|
16901
|
-
|
|
16902
|
-
|
|
16903
|
-
|
|
16904
|
-
|
|
16905
|
-
|
|
16906
|
-
|
|
16907
|
-
var handleSubmit = function handleSubmit(event) {
|
|
16908
|
-
event.preventDefault();
|
|
16909
|
-
URL_REGEXP.test(urlString) ? onSubmit(urlString) : setError(t("neetoEditor.error.invalidUrl"));
|
|
16906
|
+
var initialValues = {
|
|
16907
|
+
url: ""
|
|
16908
|
+
};
|
|
16909
|
+
var onSubmit = function onSubmit(_ref2) {
|
|
16910
|
+
var url = _ref2.url;
|
|
16911
|
+
var embedUrl = validateUrl(url); // False when current url is not "embeddable"
|
|
16912
|
+
if (embedUrl) onEmbedVideo(embedUrl);else onAttachVideo(url);
|
|
16913
|
+
onClose();
|
|
16910
16914
|
};
|
|
16911
|
-
return /*#__PURE__*/jsxs("div", {
|
|
16912
|
-
className: classnames("neeto-editor-url-form__wrapper", _defineProperty({}, className, className)),
|
|
16913
|
-
children: [/*#__PURE__*/jsx(Input, {
|
|
16914
|
-
error: error,
|
|
16915
|
-
placeholder: placeholder,
|
|
16916
|
-
autoFocus: true,
|
|
16917
|
-
"data-cy": "neeto-editor-media-upload-url-input",
|
|
16918
|
-
name: "url",
|
|
16919
|
-
value: urlString,
|
|
16920
|
-
onChange: function onChange(_ref2) {
|
|
16921
|
-
var value = _ref2.target.value;
|
|
16922
|
-
return setUrlString(value);
|
|
16923
|
-
},
|
|
16924
|
-
onFocus: function onFocus() {
|
|
16925
|
-
return setError("");
|
|
16926
|
-
}
|
|
16927
|
-
}), /*#__PURE__*/jsx(Button$1, {
|
|
16928
|
-
"data-cy": "neeto-editor-media-upload-url-submit",
|
|
16929
|
-
disabled: !urlString,
|
|
16930
|
-
label: buttonLabel,
|
|
16931
|
-
size: "small",
|
|
16932
|
-
onClick: handleSubmit
|
|
16933
|
-
})]
|
|
16934
|
-
});
|
|
16935
|
-
};
|
|
16936
|
-
|
|
16937
|
-
var VideoEmbedForm = withT(function (_ref) {
|
|
16938
|
-
var t = _ref.t,
|
|
16939
|
-
_onSubmit = _ref.onSubmit,
|
|
16940
|
-
onCancel = _ref.onCancel;
|
|
16941
16915
|
return /*#__PURE__*/jsx("div", {
|
|
16942
16916
|
className: "ne-video-embed-form",
|
|
16943
16917
|
children: /*#__PURE__*/jsx(Form, {
|
|
16944
16918
|
formikProps: {
|
|
16945
|
-
initialValues:
|
|
16946
|
-
|
|
16947
|
-
|
|
16948
|
-
onSubmit: function onSubmit(_ref2) {
|
|
16949
|
-
var videoUrl = _ref2.videoUrl;
|
|
16950
|
-
return _onSubmit(videoUrl);
|
|
16951
|
-
},
|
|
16952
|
-
validationSchema: VIDEO_EMBED_FORM_VALIDATION_SCHEMA
|
|
16919
|
+
initialValues: initialValues,
|
|
16920
|
+
validationSchema: VIDEO_EMBED_FORM_VALIDATION_SCHEMA,
|
|
16921
|
+
onSubmit: onSubmit
|
|
16953
16922
|
},
|
|
16954
16923
|
children: function children(_ref3) {
|
|
16955
16924
|
var dirty = _ref3.dirty,
|
|
@@ -16963,7 +16932,7 @@ var VideoEmbedForm = withT(function (_ref) {
|
|
|
16963
16932
|
unlimitedChars: true,
|
|
16964
16933
|
"data-cy": "neeto-editor-video-embed-input",
|
|
16965
16934
|
label: t("neetoEditor.common.videoUrl"),
|
|
16966
|
-
name: "
|
|
16935
|
+
name: "url",
|
|
16967
16936
|
placeholder: t("neetoEditor.placeholders.embedUrl"),
|
|
16968
16937
|
size: "medium",
|
|
16969
16938
|
type: "text"
|
|
@@ -16975,7 +16944,7 @@ var VideoEmbedForm = withT(function (_ref) {
|
|
|
16975
16944
|
size: "small",
|
|
16976
16945
|
onClick: function onClick() {
|
|
16977
16946
|
resetForm();
|
|
16978
|
-
|
|
16947
|
+
onClose();
|
|
16979
16948
|
}
|
|
16980
16949
|
},
|
|
16981
16950
|
submitButtonProps: {
|
|
@@ -16990,7 +16959,7 @@ var VideoEmbedForm = withT(function (_ref) {
|
|
|
16990
16959
|
}
|
|
16991
16960
|
})
|
|
16992
16961
|
});
|
|
16993
|
-
}
|
|
16962
|
+
};
|
|
16994
16963
|
|
|
16995
16964
|
var MediaUploader = function MediaUploader(_ref) {
|
|
16996
16965
|
var mediaUploader = _ref.mediaUploader,
|
|
@@ -17019,23 +16988,8 @@ var MediaUploader = function MediaUploader(_ref) {
|
|
|
17019
16988
|
setActiveTab("local");
|
|
17020
16989
|
editor.commands.focus();
|
|
17021
16990
|
};
|
|
17022
|
-
var handleSubmit = function handleSubmit(url) {
|
|
17023
|
-
insertMediaToEditor({
|
|
17024
|
-
url: url,
|
|
17025
|
-
alt: "image"
|
|
17026
|
-
});
|
|
17027
|
-
handleClose();
|
|
17028
|
-
};
|
|
17029
|
-
var handleVideoEmbed = function handleVideoEmbed(url) {
|
|
17030
|
-
var validatedUrl = validateUrl(url);
|
|
17031
|
-
if (validatedUrl) {
|
|
17032
|
-
editor.chain().focus().setExternalVideo({
|
|
17033
|
-
src: validatedUrl
|
|
17034
|
-
}).run();
|
|
17035
|
-
handleClose();
|
|
17036
|
-
}
|
|
17037
|
-
};
|
|
17038
16991
|
var insertMediaToEditor = function insertMediaToEditor(file) {
|
|
16992
|
+
if (!editor) return;
|
|
17039
16993
|
var url = file.url,
|
|
17040
16994
|
_file$filename = file.filename,
|
|
17041
16995
|
filename = _file$filename === void 0 ? "image" : _file$filename,
|
|
@@ -17057,7 +17011,7 @@ var MediaUploader = function MediaUploader(_ref) {
|
|
|
17057
17011
|
return commands.insertContentAt(safePosition, "<p></p>");
|
|
17058
17012
|
}).run();
|
|
17059
17013
|
};
|
|
17060
|
-
var
|
|
17014
|
+
var onUploadComplete = /*#__PURE__*/function () {
|
|
17061
17015
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(file) {
|
|
17062
17016
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
17063
17017
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -17083,10 +17037,23 @@ var MediaUploader = function MediaUploader(_ref) {
|
|
|
17083
17037
|
}
|
|
17084
17038
|
}, _callee, null, [[0, 7]]);
|
|
17085
17039
|
}));
|
|
17086
|
-
return function
|
|
17040
|
+
return function onUploadComplete(_x) {
|
|
17087
17041
|
return _ref3.apply(this, arguments);
|
|
17088
17042
|
};
|
|
17089
17043
|
}();
|
|
17044
|
+
var onAttachVideo = function onAttachVideo(url) {
|
|
17045
|
+
var file = {
|
|
17046
|
+
url: url,
|
|
17047
|
+
alt: "image"
|
|
17048
|
+
};
|
|
17049
|
+
insertMediaToEditor(file);
|
|
17050
|
+
};
|
|
17051
|
+
var onEmbedVideo = function onEmbedVideo(url) {
|
|
17052
|
+
if (!editor) return;
|
|
17053
|
+
editor.chain().focus().setExternalVideo({
|
|
17054
|
+
src: url
|
|
17055
|
+
}).run();
|
|
17056
|
+
};
|
|
17090
17057
|
return /*#__PURE__*/jsx(Modal, {
|
|
17091
17058
|
isOpen: isOpen,
|
|
17092
17059
|
className: "ne-media-uploader-modal",
|
|
@@ -17114,26 +17081,23 @@ var MediaUploader = function MediaUploader(_ref) {
|
|
|
17114
17081
|
children: title
|
|
17115
17082
|
}, key);
|
|
17116
17083
|
})
|
|
17117
|
-
}), /*#__PURE__*/
|
|
17084
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
17118
17085
|
className: "ne-media-uploader__content",
|
|
17119
|
-
children: mediaUploader.image
|
|
17120
|
-
|
|
17121
|
-
|
|
17122
|
-
})
|
|
17123
|
-
children: [activeTab === "local" &&
|
|
17086
|
+
children: [mediaUploader.image && /*#__PURE__*/jsx(ImageUploader, {
|
|
17087
|
+
onUploadComplete: onUploadComplete,
|
|
17088
|
+
className: "ne-media-uploader__image-uploader"
|
|
17089
|
+
}), mediaUploader.video && /*#__PURE__*/jsxs(Fragment$1, {
|
|
17090
|
+
children: [activeTab === "local" && /*#__PURE__*/jsx(LocalUploader, {
|
|
17124
17091
|
insertMediaToEditor: insertMediaToEditor,
|
|
17125
17092
|
setIsUploading: setIsUploading,
|
|
17126
17093
|
isImage: false,
|
|
17127
17094
|
onClose: handleClose
|
|
17128
|
-
}), activeTab === "
|
|
17129
|
-
|
|
17130
|
-
|
|
17131
|
-
|
|
17132
|
-
}), activeTab === "embed" && mediaUploader.video && /*#__PURE__*/jsx(VideoEmbedForm, {
|
|
17133
|
-
onCancel: handleClose,
|
|
17134
|
-
onSubmit: handleVideoEmbed
|
|
17095
|
+
}), activeTab === "embed" && /*#__PURE__*/jsx(VideoEmbedForm, {
|
|
17096
|
+
onAttachVideo: onAttachVideo,
|
|
17097
|
+
onEmbedVideo: onEmbedVideo,
|
|
17098
|
+
onClose: handleClose
|
|
17135
17099
|
})]
|
|
17136
|
-
})
|
|
17100
|
+
})]
|
|
17137
17101
|
})]
|
|
17138
17102
|
})
|
|
17139
17103
|
});
|
|
@@ -18963,5 +18927,5 @@ var Menu = function Menu(props) {
|
|
|
18963
18927
|
}));
|
|
18964
18928
|
};
|
|
18965
18929
|
|
|
18966
|
-
export { getChangedRanges as A, findChildrenInRange as B, CALLOUT_TYPES as C, DecorationSet as D, Extension as E, getMarksBetween as F, getAttributes as G, highlightFocussedNode as H, InputRule as I, resetFocussedNode as J, findParentNodeClosestToPos as K,
|
|
18967
|
-
//# sourceMappingURL=chunk-
|
|
18930
|
+
export { getChangedRanges as A, findChildrenInRange as B, CALLOUT_TYPES as C, DecorationSet as D, Extension as E, getMarksBetween as F, getAttributes as G, highlightFocussedNode as H, InputRule as I, resetFocussedNode as J, findParentNodeClosestToPos as K, validateUrl as L, Menu as M, Node as N, BubbleMenu as O, PasteRule as P, getLinkPopoverPosition as Q, ReactNodeViewRenderer as R, getMarkType as S, getMarkRange as T, useEditor as U, useEditorState$1 as V, MenuDynamicVariables as W, EditorContent as X, MediaUploader as Y, LinkAddPopOver as Z, EditorView as _, Mark as a, markInputRule as b, markPasteRule as c, Decoration as d, callOrReturn as e, getExtensionField as f, getMarkAttributes as g, getNodeType as h, isNodeSelection as i, getNodeAtPosition as j, keydownHandler as k, isNodeActive as l, mergeAttributes as m, nodeInputRule as n, isAtStartOfNode as o, isAtEndOfNode as p, NodeViewWrapper as q, NodeViewContent as r, findChildren as s, textblockTypeInputRule as t, escapeForRegEx as u, ReactRenderer as v, wrappingInputRule as w, EmojiPickerMenu as x, emojiPickerApi as y, combineTransactionSteps as z };
|
|
18931
|
+
//# sourceMappingURL=chunk-CXmkXuF3.js.map
|