@bigbinary/neeto-editor 1.47.61 → 1.47.63
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/Editor.js +25 -20
- package/dist/Editor.js.map +1 -1
- package/dist/cjs/Editor.cjs.js +25 -20
- package/dist/cjs/Editor.cjs.js.map +1 -1
- package/dist/editor-stats.html +1 -1
- package/package.json +1 -1
package/dist/cjs/Editor.cjs.js
CHANGED
|
@@ -6,7 +6,7 @@ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
|
6
6
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var Menu$4 = require('./chunk-DNZfIRp3.cjs.js');
|
|
9
|
-
var classnames
|
|
9
|
+
var classnames = require('classnames');
|
|
10
10
|
var constants = require('./chunk-Cd5HlrFr.cjs.js');
|
|
11
11
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
12
12
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
@@ -151,7 +151,7 @@ var ErrorWrapper = function ErrorWrapper(_ref) {
|
|
|
151
151
|
children = _ref.children,
|
|
152
152
|
className = _ref.className;
|
|
153
153
|
var isError = !neetoCist.isNotPresent(error);
|
|
154
|
-
var wrapperClasses = classnames
|
|
154
|
+
var wrapperClasses = classnames(_defineProperty({
|
|
155
155
|
"neeto-editor-error": isError
|
|
156
156
|
}, className, className));
|
|
157
157
|
var getErrorMessage = function getErrorMessage() {
|
|
@@ -288,12 +288,16 @@ var useDeletedArticles = function useDeletedArticles(editor) {
|
|
|
288
288
|
deletedArticleIds = _useState2[0],
|
|
289
289
|
setDeletedArticleIds = _useState2[1];
|
|
290
290
|
var _useFetchKbArticles = useFetchKbArticles({
|
|
291
|
-
searchTerm: ""
|
|
291
|
+
searchTerm: "",
|
|
292
|
+
reactQueryOptions: {
|
|
293
|
+
enabled: !!editor
|
|
294
|
+
}
|
|
292
295
|
}),
|
|
293
296
|
_useFetchKbArticles$d = _useFetchKbArticles.data,
|
|
294
297
|
allArticles = _useFetchKbArticles$d === void 0 ? [] : _useFetchKbArticles$d,
|
|
295
298
|
isCheckingDeleted = _useFetchKbArticles.isLoading;
|
|
296
299
|
var checkAllArticles = function checkAllArticles() {
|
|
300
|
+
if (!editor) return;
|
|
297
301
|
var articleIdsInEditor = extractKbArticleIds(editor);
|
|
298
302
|
if (ramda.isEmpty(articleIdsInEditor)) {
|
|
299
303
|
setDeletedArticleIds(new Set());
|
|
@@ -308,7 +312,7 @@ var useDeletedArticles = function useDeletedArticles(editor) {
|
|
|
308
312
|
React.useEffect(function () {
|
|
309
313
|
if (!editor || ramda.isEmpty(allArticles)) return;
|
|
310
314
|
checkAllArticles();
|
|
311
|
-
}, [allArticles]);
|
|
315
|
+
}, [allArticles, editor]);
|
|
312
316
|
return {
|
|
313
317
|
deletedArticleIds: deletedArticleIds,
|
|
314
318
|
isCheckingDeleted: isCheckingDeleted,
|
|
@@ -10097,7 +10101,7 @@ var EmojiSuggestionMenu = /*#__PURE__*/function (_React$Component) {
|
|
|
10097
10101
|
children: [this.state.isLoading && /*#__PURE__*/jsxRuntime.jsx(Spinner, {}), !this.state.isLoading && (neetoCist.isNotEmpty(this.state.emojiSuggestions) ? this.state.emojiSuggestions.map(function (emoji, index) {
|
|
10098
10102
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
10099
10103
|
"data-cy": "neeto-editor-emoji-suggestion-".concat(emoji.id),
|
|
10100
|
-
className: classnames
|
|
10104
|
+
className: classnames("neeto-editor-emoji-suggestion__item", {
|
|
10101
10105
|
"neeto-editor-emoji-suggestion__item--selected": index === _this2.state.selectedIndex
|
|
10102
10106
|
}),
|
|
10103
10107
|
onClick: function onClick() {
|
|
@@ -11137,7 +11141,7 @@ var ImagePreviewModal = function ImagePreviewModal(_ref) {
|
|
|
11137
11141
|
}), /*#__PURE__*/jsxRuntime.jsx("img", {
|
|
11138
11142
|
alt: "Preview",
|
|
11139
11143
|
src: previewUrl,
|
|
11140
|
-
className: classnames
|
|
11144
|
+
className: classnames({
|
|
11141
11145
|
"display-none": isLoading || ramda.isNil(previewUrl)
|
|
11142
11146
|
}),
|
|
11143
11147
|
onLoad: handleImageLoad
|
|
@@ -11299,7 +11303,7 @@ var ImageComponent = function ImageComponent(_ref) {
|
|
|
11299
11303
|
if (neetoCist.isNotPresent(src) && neetoCist.isNotPresent(alt)) return null;
|
|
11300
11304
|
return /*#__PURE__*/jsxRuntime.jsxs(Menu$4.NodeViewWrapper, {
|
|
11301
11305
|
"data-cy": "neeto-editor-image-wrapper",
|
|
11302
|
-
className: classnames
|
|
11306
|
+
className: classnames("neeto-editor__image-wrapper", "neeto-editor__image--".concat(align), {
|
|
11303
11307
|
"neeto-editor__image--bordered": border
|
|
11304
11308
|
}),
|
|
11305
11309
|
children: [/*#__PURE__*/jsxRuntime.jsxs("figure", {
|
|
@@ -11337,7 +11341,7 @@ var ImageComponent = function ImageComponent(_ref) {
|
|
|
11337
11341
|
children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
|
|
11338
11342
|
}), /*#__PURE__*/jsxRuntime.jsx(Menu$4.NodeViewContent, {
|
|
11339
11343
|
as: "figcaption",
|
|
11340
|
-
className: classnames
|
|
11344
|
+
className: classnames({
|
|
11341
11345
|
"is-empty": ramda.isEmpty(caption)
|
|
11342
11346
|
}),
|
|
11343
11347
|
style: {
|
|
@@ -14181,7 +14185,7 @@ var MentionList = /*#__PURE__*/function (_React$Component) {
|
|
|
14181
14185
|
return /*#__PURE__*/jsxRuntime.jsxs(MenuItem.Button, {
|
|
14182
14186
|
"data-cy": "neeto-editor-mention-list-".concat(name),
|
|
14183
14187
|
type: "button",
|
|
14184
|
-
className: classnames
|
|
14188
|
+
className: classnames("neeto-editor-mentions__item", {
|
|
14185
14189
|
active: index === selectedIndex
|
|
14186
14190
|
}),
|
|
14187
14191
|
onClick: function onClick() {
|
|
@@ -14666,7 +14670,7 @@ var MenuItem$1 = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
|
14666
14670
|
return /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
14667
14671
|
ref: ref,
|
|
14668
14672
|
"data-cy": "neeto-editor-command-list-item-".concat(index),
|
|
14669
|
-
className: classnames
|
|
14673
|
+
className: classnames("neeto-editor-slash-commands__item", {
|
|
14670
14674
|
active: index === selectedIndex
|
|
14671
14675
|
}),
|
|
14672
14676
|
onClick: selectItem,
|
|
@@ -20456,7 +20460,7 @@ var VideoComponent = function VideoComponent(_ref) {
|
|
|
20456
20460
|
};
|
|
20457
20461
|
if (neetoCist.isNotPresent(src)) return null;
|
|
20458
20462
|
return /*#__PURE__*/jsxRuntime.jsx(Menu$4.NodeViewWrapper, {
|
|
20459
|
-
className: classnames
|
|
20463
|
+
className: classnames("neeto-editor__image-wrapper", "neeto-editor__image--".concat(align), {
|
|
20460
20464
|
"neeto-editor__image--bordered": border
|
|
20461
20465
|
}),
|
|
20462
20466
|
children: /*#__PURE__*/jsxRuntime.jsxs("figure", {
|
|
@@ -20489,7 +20493,7 @@ var VideoComponent = function VideoComponent(_ref) {
|
|
|
20489
20493
|
}))
|
|
20490
20494
|
}), /*#__PURE__*/jsxRuntime.jsx(Menu$4.NodeViewContent, {
|
|
20491
20495
|
as: "figcaption",
|
|
20492
|
-
className: classnames
|
|
20496
|
+
className: classnames({
|
|
20493
20497
|
"is-empty": ramda.isEmpty(caption)
|
|
20494
20498
|
}),
|
|
20495
20499
|
style: {
|
|
@@ -20661,11 +20665,11 @@ var renderEmbedHTML = function renderEmbedHTML(node, HTMLAttributes, options) {
|
|
|
20661
20665
|
border = _node$attrs.border,
|
|
20662
20666
|
aspectRatio = _node$attrs.aspectRatio;
|
|
20663
20667
|
return ["div", {
|
|
20664
|
-
"class": classnames
|
|
20668
|
+
"class": classnames("neeto-editor__video-wrapper", "neeto-editor__video--".concat(align), {
|
|
20665
20669
|
"neeto-editor__video--bordered": border
|
|
20666
20670
|
})
|
|
20667
20671
|
}, ["div", {
|
|
20668
|
-
"class": classnames
|
|
20672
|
+
"class": classnames("neeto-editor__video-iframe", {
|
|
20669
20673
|
"neeto-editor-aspect-1-1": aspectRatio === "1/1",
|
|
20670
20674
|
"neeto-editor-aspect-16-9": aspectRatio === "16/9",
|
|
20671
20675
|
"neeto-editor-aspect-9-16": aspectRatio === "9/16",
|
|
@@ -20686,7 +20690,7 @@ var renderUploadHTML = function renderUploadHTML(node, HTMLAttributes, options)
|
|
|
20686
20690
|
vidwidth = _node$attrs2.vidwidth,
|
|
20687
20691
|
border = _node$attrs2.border;
|
|
20688
20692
|
var wrapperDivAttrs = {
|
|
20689
|
-
"class": classnames
|
|
20693
|
+
"class": classnames("neeto-editor__image-wrapper", "neeto-editor__image--".concat(align), {
|
|
20690
20694
|
"neeto-editor__image--bordered": border
|
|
20691
20695
|
})
|
|
20692
20696
|
};
|
|
@@ -21475,7 +21479,7 @@ var KbArticleView = reactUtils.withT(function (_ref) {
|
|
|
21475
21479
|
href: linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.href,
|
|
21476
21480
|
rel: "noreferrer",
|
|
21477
21481
|
target: "_blank",
|
|
21478
|
-
className: classnames
|
|
21482
|
+
className: classnames("ne-link-popover__kb-article-link", {
|
|
21479
21483
|
"ne-link-popover__kb-article-link--deleted": isDeleted
|
|
21480
21484
|
}),
|
|
21481
21485
|
onClick: function onClick(event) {
|
|
@@ -21991,6 +21995,7 @@ var Editor = function Editor(_ref, ref) {
|
|
|
21991
21995
|
isAttachmentsUploading = _useState2[0],
|
|
21992
21996
|
setIsAttachmentsUploading = _useState2[1];
|
|
21993
21997
|
var wrapperRef = React.useRef(null);
|
|
21998
|
+
var isArticleOptActive = addons.includes(constants.EDITOR_OPTIONS.NEETO_KB_ARTICLE);
|
|
21994
21999
|
var isAttachmentsActive = addons.includes(constants.EDITOR_OPTIONS.ATTACHMENTS);
|
|
21995
22000
|
var isMediaUploaderActive = addons.includes(constants.EDITOR_OPTIONS.IMAGE_UPLOAD) || addons.includes(constants.EDITOR_OPTIONS.VIDEO_UPLOAD);
|
|
21996
22001
|
var isFixedMenuActive = menuType === "fixed";
|
|
@@ -22058,7 +22063,7 @@ var Editor = function Editor(_ref, ref) {
|
|
|
22058
22063
|
useEditorWarnings({
|
|
22059
22064
|
initialValue: initialValue
|
|
22060
22065
|
});
|
|
22061
|
-
var editorClasses = classnames
|
|
22066
|
+
var editorClasses = classnames("neeto-editor", _defineProperty({
|
|
22062
22067
|
"fixed-menu-active": isFixedMenuActive,
|
|
22063
22068
|
"bubble-menu-active": isBubbleMenuActive,
|
|
22064
22069
|
"placeholder-active": isPlaceholderActive,
|
|
@@ -22113,7 +22118,7 @@ var Editor = function Editor(_ref, ref) {
|
|
|
22113
22118
|
};
|
|
22114
22119
|
}
|
|
22115
22120
|
});
|
|
22116
|
-
var deletedArticlesHook = useDeletedArticles(editor);
|
|
22121
|
+
var deletedArticlesHook = useDeletedArticles(isArticleOptActive ? editor : null);
|
|
22117
22122
|
|
|
22118
22123
|
/* Make editor object available to the parent */
|
|
22119
22124
|
React.useImperativeHandle(ref, function () {
|
|
@@ -22150,7 +22155,7 @@ var Editor = function Editor(_ref, ref) {
|
|
|
22150
22155
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
22151
22156
|
"data-cy": "neeto-editor-wrapper",
|
|
22152
22157
|
ref: wrapperRef,
|
|
22153
|
-
className: classnames
|
|
22158
|
+
className: classnames(_defineProperty(_defineProperty({}, className, className), "ne-attachments__wrapper", isAttachmentsActive)),
|
|
22154
22159
|
children: [label && /*#__PURE__*/jsxRuntime.jsx(Label, {
|
|
22155
22160
|
required: required,
|
|
22156
22161
|
className: "neeto-ui-mb-2",
|
|
@@ -22196,7 +22201,7 @@ var Editor = function Editor(_ref, ref) {
|
|
|
22196
22201
|
isIndependent: false,
|
|
22197
22202
|
ref: addAttachmentsRef,
|
|
22198
22203
|
setIsUploading: setIsAttachmentsUploading,
|
|
22199
|
-
className: classnames
|
|
22204
|
+
className: classnames("ne-attachments--integrated", _defineProperty({}, attachmentsClassName, attachmentsClassName)),
|
|
22200
22205
|
onChange: onChangeAttachments
|
|
22201
22206
|
}, otherAttachmentProps)), (editor === null || editor === void 0 ? void 0 : editor.isActive("link")) && /*#__PURE__*/jsxRuntime.jsx(LinkPopOver, {
|
|
22202
22207
|
deletedArticlesHook: deletedArticlesHook,
|