@bigbinary/neeto-editor 1.47.50 → 1.47.52

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
@@ -4,7 +4,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
4
4
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
5
5
  import * as React from 'react';
6
6
  import React__default, { memo, useEffect, useState, useRef, useCallback, createElement, forwardRef, useImperativeHandle } from 'react';
7
- import { E as Extension, a as Mark, m as mergeAttributes, b as markInputRule, c as markPasteRule, D as DecorationSet, d as Decoration, g as getMarkAttributes, N as Node, w as wrappingInputRule, t as textblockTypeInputRule, k as keydownHandler, e as callOrReturn, f as getExtensionField, i as isNodeSelection, n as nodeInputRule, h as getNodeType, j as getNodeAtPosition, l as isNodeActive, o as isAtStartOfNode, p as isAtEndOfNode, C as CALLOUT_TYPES, q as NodeViewWrapper, r as NodeViewContent, R as ReactNodeViewRenderer, s as findChildren, u as escapeForRegEx, v as ReactRenderer, x as EmojiPickerMenu, y as emojiPickerApi, z as combineTransactionSteps, A as getChangedRanges, B as findChildrenInRange, F as getMarksBetween, G as getAttributes, I as InputRule, H as highlightFocussedNode, J as resetFocussedNode, K as findParentNodeClosestToPos, P as PasteRule, L as BubbleMenu, O as getLinkPopoverPosition, Q as getMarkType, S as getMarkRange, T as useEditor, U as useEditorState, M as Menu$4, V as EditorContent, W as MediaUploader, X as LinkAddPopOver, Y as EditorView } from './chunk-C-0Q1FN5.js';
7
+ import { E as Extension, a as Mark, m as mergeAttributes, b as markInputRule, c as markPasteRule, D as DecorationSet, d as Decoration, g as getMarkAttributes, N as Node, w as wrappingInputRule, t as textblockTypeInputRule, k as keydownHandler, e as callOrReturn, f as getExtensionField, i as isNodeSelection, n as nodeInputRule, h as getNodeType, j as getNodeAtPosition, l as isNodeActive, o as isAtStartOfNode, p as isAtEndOfNode, C as CALLOUT_TYPES, q as NodeViewWrapper, r as NodeViewContent, R as ReactNodeViewRenderer, s as findChildren, u as escapeForRegEx, v as ReactRenderer, x as EmojiPickerMenu, y as emojiPickerApi, z as combineTransactionSteps, A as getChangedRanges, B as findChildrenInRange, F as getMarksBetween, G as getAttributes, I as InputRule, H as highlightFocussedNode, J as resetFocussedNode, K as findParentNodeClosestToPos, P as PasteRule, L as BubbleMenu, O as getLinkPopoverPosition, Q as getMarkType, S as getMarkRange, T as useEditor, U as useEditorState, M as Menu$4, V as EditorContent, W as MediaUploader, X as LinkAddPopOver, Y as EditorView } from './chunk-DiadEIO-.js';
8
8
  import classnames from 'classnames';
9
9
  import { D as DIRECT_UPLOAD_ENDPOINT, E as EDITOR_OPTIONS, C as COMBINED_REGEX, a as EDITOR_SIZES } from './chunk-7IwD_Poi.js';
10
10
  import { isNotPresent, findBy, isNotEmpty, isPresent, noop as noop$1, slugify } from '@bigbinary/neeto-cist';
@@ -20704,11 +20704,12 @@ var TableActionMenu = function TableActionMenu(_ref) {
20704
20704
  appendTo: function appendTo() {
20705
20705
  return document.body;
20706
20706
  },
20707
+ className: "neeto-editor-table-bubble-menu__dropdown",
20707
20708
  closeOnSelect: false,
20708
20709
  position: "bottom-start",
20709
20710
  strategy: "fixed",
20710
20711
  buttonProps: {
20711
- className: "neeto-editor-table-bubble-menu__item neeto-ui-ml-2",
20712
+ className: "neeto-editor-table-bubble-menu__dropdown-item",
20712
20713
  icon: Down,
20713
20714
  iconPosition: "right",
20714
20715
  iconSize: 16,
@@ -20722,7 +20723,7 @@ var TableActionMenu = function TableActionMenu(_ref) {
20722
20723
  }
20723
20724
  },
20724
20725
  children: /*#__PURE__*/jsx(Menu, {
20725
- className: "neeto-ui-gap-1 flex items-center justify-center",
20726
+ className: "neeto-ui-flex neeto-ui-items-center neeto-ui-justify-center",
20726
20727
  children: (_action$items = action.items) === null || _action$items === void 0 ? void 0 : _action$items.map(function (_ref3) {
20727
20728
  var type = _ref3.type,
20728
20729
  command = _ref3.command,
@@ -20730,6 +20731,7 @@ var TableActionMenu = function TableActionMenu(_ref) {
20730
20731
  var IconComponent = alignmentIcons[type];
20731
20732
  return /*#__PURE__*/jsx(MenuItem, {
20732
20733
  children: /*#__PURE__*/jsx(Button, {
20734
+ className: "neeto-editor-table-bubble-menu__item",
20733
20735
  icon: IconComponent,
20734
20736
  style: "text",
20735
20737
  tooltipProps: {
@@ -20790,10 +20792,13 @@ var LinkPopOver = function LinkPopOver(_ref) {
20790
20792
  _useState8 = _slicedToArray(_useState7, 2),
20791
20793
  isLinkActive = _useState8[0],
20792
20794
  setIsLinkActive = _useState8[1];
20795
+ var _useState9 = useState(editor === null || editor === void 0 ? void 0 : editor.getAttributes("link")),
20796
+ _useState10 = _slicedToArray(_useState9, 2),
20797
+ linkAttributes = _useState10[0],
20798
+ setLinkAttributes = _useState10[1];
20793
20799
  var popoverRef = useRef(null);
20794
20800
  var _useTranslation = useTranslation(),
20795
20801
  t = _useTranslation.t;
20796
- var linkAttributes = editor === null || editor === void 0 ? void 0 : editor.getAttributes("link");
20797
20802
  var updatePopoverPosition = function updatePopoverPosition() {
20798
20803
  if (!view) return;
20799
20804
  var _getLinkPopoverPositi = getLinkPopoverPosition(editor, popoverRef),
@@ -20824,7 +20829,7 @@ var LinkPopOver = function LinkPopOver(_ref) {
20824
20829
  if (equals(textContent, initialTextContent)) {
20825
20830
  editor.chain().focus().extendMarkRange("link").setLink({
20826
20831
  href: formattedUrl,
20827
- target: openInNewTab ? "_blank" : null
20832
+ target: openInNewTab ? "_blank" : "_self"
20828
20833
  }).run();
20829
20834
  setIsEditing(false);
20830
20835
  return;
@@ -20842,7 +20847,7 @@ var LinkPopOver = function LinkPopOver(_ref) {
20842
20847
  if (isNil(from) || isNil(to)) return;
20843
20848
  var attrs = {
20844
20849
  href: formattedUrl,
20845
- target: openInNewTab ? "_blank" : null
20850
+ target: openInNewTab ? "_blank" : "_self"
20846
20851
  };
20847
20852
  var linkMark = state.schema.marks.link.create(attrs);
20848
20853
  var linkTextWithMark = state.schema.text(textContent, [linkMark]);
@@ -20869,16 +20874,19 @@ var LinkPopOver = function LinkPopOver(_ref) {
20869
20874
  setIsLinkActive(isActive);
20870
20875
  if (isActive) {
20871
20876
  updatePopoverPosition();
20877
+ var currentLinkAttributes = editor === null || editor === void 0 ? void 0 : editor.getAttributes("link");
20878
+ setLinkAttributes(currentLinkAttributes);
20872
20879
  }
20873
20880
  }, [view === null || view === void 0 || (_view$state2 = view.state) === null || _view$state2 === void 0 || (_view$state2 = _view$state2.selection) === null || _view$state2 === void 0 || (_view$state2 = _view$state2.$from) === null || _view$state2 === void 0 ? void 0 : _view$state2.pos, isEditing]);
20874
20881
  var renderEditingMode = function renderEditingMode() {
20882
+ var initialValues = {
20883
+ textContent: initialTextContent,
20884
+ urlString: (linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.href) || "",
20885
+ openInNewTab: (linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.target) === "_blank"
20886
+ };
20875
20887
  return /*#__PURE__*/jsx(Form, {
20876
20888
  formikProps: {
20877
- initialValues: {
20878
- textContent: initialTextContent,
20879
- urlString: (linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.href) || "",
20880
- openInNewTab: (linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.target) === "_blank"
20881
- },
20889
+ initialValues: initialValues,
20882
20890
  onSubmit: handleSubmit,
20883
20891
  validationSchema: LINK_VALIDATION_SCHEMA
20884
20892
  },
@@ -20938,14 +20946,14 @@ var LinkPopOver = function LinkPopOver(_ref) {
20938
20946
  })]
20939
20947
  });
20940
20948
  }
20941
- });
20949
+ }, "".concat(linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.href, "-").concat(linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.target));
20942
20950
  };
20943
20951
  var renderViewMode = function renderViewMode() {
20944
20952
  return /*#__PURE__*/jsxs(Fragment, {
20945
20953
  children: [/*#__PURE__*/jsx("a", {
20946
20954
  href: linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.href,
20947
- rel: "noreferrer",
20948
- target: "_blank",
20955
+ rel: "noreferrer noopener",
20956
+ target: (linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.target) || "_self",
20949
20957
  children: linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.href
20950
20958
  }), " - ", /*#__PURE__*/jsx(Button, {
20951
20959
  className: "ne-link-popover__option-button",