@bigbinary/neeto-editor 1.47.61 → 1.47.62

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 CHANGED
@@ -268,12 +268,16 @@ var useDeletedArticles = function useDeletedArticles(editor) {
268
268
  deletedArticleIds = _useState2[0],
269
269
  setDeletedArticleIds = _useState2[1];
270
270
  var _useFetchKbArticles = useFetchKbArticles({
271
- searchTerm: ""
271
+ searchTerm: "",
272
+ reactQueryOptions: {
273
+ enabled: !!editor
274
+ }
272
275
  }),
273
276
  _useFetchKbArticles$d = _useFetchKbArticles.data,
274
277
  allArticles = _useFetchKbArticles$d === void 0 ? [] : _useFetchKbArticles$d,
275
278
  isCheckingDeleted = _useFetchKbArticles.isLoading;
276
279
  var checkAllArticles = function checkAllArticles() {
280
+ if (!editor) return;
277
281
  var articleIdsInEditor = extractKbArticleIds(editor);
278
282
  if (isEmpty$1(articleIdsInEditor)) {
279
283
  setDeletedArticleIds(new Set());
@@ -288,7 +292,7 @@ var useDeletedArticles = function useDeletedArticles(editor) {
288
292
  useEffect(function () {
289
293
  if (!editor || isEmpty$1(allArticles)) return;
290
294
  checkAllArticles();
291
- }, [allArticles]);
295
+ }, [allArticles, editor]);
292
296
  return {
293
297
  deletedArticleIds: deletedArticleIds,
294
298
  isCheckingDeleted: isCheckingDeleted,
@@ -21971,6 +21975,7 @@ var Editor = function Editor(_ref, ref) {
21971
21975
  isAttachmentsUploading = _useState2[0],
21972
21976
  setIsAttachmentsUploading = _useState2[1];
21973
21977
  var wrapperRef = useRef(null);
21978
+ var isArticleOptActive = addons.includes(EDITOR_OPTIONS.NEETO_KB_ARTICLE);
21974
21979
  var isAttachmentsActive = addons.includes(EDITOR_OPTIONS.ATTACHMENTS);
21975
21980
  var isMediaUploaderActive = addons.includes(EDITOR_OPTIONS.IMAGE_UPLOAD) || addons.includes(EDITOR_OPTIONS.VIDEO_UPLOAD);
21976
21981
  var isFixedMenuActive = menuType === "fixed";
@@ -22093,7 +22098,7 @@ var Editor = function Editor(_ref, ref) {
22093
22098
  };
22094
22099
  }
22095
22100
  });
22096
- var deletedArticlesHook = useDeletedArticles(editor);
22101
+ var deletedArticlesHook = useDeletedArticles(isArticleOptActive ? editor : null);
22097
22102
 
22098
22103
  /* Make editor object available to the parent */
22099
22104
  useImperativeHandle(ref, function () {