@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.
@@ -5,7 +5,7 @@ var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
5
5
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
6
6
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
7
7
  var React = require('react');
8
- var Menu$4 = require('./chunk-C8WnTgx_.cjs.js');
8
+ var Menu$4 = require('./chunk-C8-dRWVT.cjs.js');
9
9
  var classnames = require('classnames');
10
10
  var constants = require('./chunk-D1TqtxZX.cjs.js');
11
11
  var neetoCist = require('@bigbinary/neeto-cist');
@@ -20724,11 +20724,12 @@ var TableActionMenu = function TableActionMenu(_ref) {
20724
20724
  appendTo: function appendTo() {
20725
20725
  return document.body;
20726
20726
  },
20727
+ className: "neeto-editor-table-bubble-menu__dropdown",
20727
20728
  closeOnSelect: false,
20728
20729
  position: "bottom-start",
20729
20730
  strategy: "fixed",
20730
20731
  buttonProps: {
20731
- className: "neeto-editor-table-bubble-menu__item neeto-ui-ml-2",
20732
+ className: "neeto-editor-table-bubble-menu__dropdown-item",
20732
20733
  icon: Down,
20733
20734
  iconPosition: "right",
20734
20735
  iconSize: 16,
@@ -20742,7 +20743,7 @@ var TableActionMenu = function TableActionMenu(_ref) {
20742
20743
  }
20743
20744
  },
20744
20745
  children: /*#__PURE__*/jsxRuntime.jsx(Menu, {
20745
- className: "neeto-ui-gap-1 flex items-center justify-center",
20746
+ className: "neeto-ui-flex neeto-ui-items-center neeto-ui-justify-center",
20746
20747
  children: (_action$items = action.items) === null || _action$items === void 0 ? void 0 : _action$items.map(function (_ref3) {
20747
20748
  var type = _ref3.type,
20748
20749
  command = _ref3.command,
@@ -20750,6 +20751,7 @@ var TableActionMenu = function TableActionMenu(_ref) {
20750
20751
  var IconComponent = alignmentIcons[type];
20751
20752
  return /*#__PURE__*/jsxRuntime.jsx(MenuItem, {
20752
20753
  children: /*#__PURE__*/jsxRuntime.jsx(Button, {
20754
+ className: "neeto-editor-table-bubble-menu__item",
20753
20755
  icon: IconComponent,
20754
20756
  style: "text",
20755
20757
  tooltipProps: {
@@ -20810,10 +20812,13 @@ var LinkPopOver = function LinkPopOver(_ref) {
20810
20812
  _useState8 = _slicedToArray(_useState7, 2),
20811
20813
  isLinkActive = _useState8[0],
20812
20814
  setIsLinkActive = _useState8[1];
20815
+ var _useState9 = React.useState(editor === null || editor === void 0 ? void 0 : editor.getAttributes("link")),
20816
+ _useState10 = _slicedToArray(_useState9, 2),
20817
+ linkAttributes = _useState10[0],
20818
+ setLinkAttributes = _useState10[1];
20813
20819
  var popoverRef = React.useRef(null);
20814
20820
  var _useTranslation = reactI18next.useTranslation(),
20815
20821
  t = _useTranslation.t;
20816
- var linkAttributes = editor === null || editor === void 0 ? void 0 : editor.getAttributes("link");
20817
20822
  var updatePopoverPosition = function updatePopoverPosition() {
20818
20823
  if (!view) return;
20819
20824
  var _getLinkPopoverPositi = Menu$4.getLinkPopoverPosition(editor, popoverRef),
@@ -20844,7 +20849,7 @@ var LinkPopOver = function LinkPopOver(_ref) {
20844
20849
  if (ramda.equals(textContent, initialTextContent)) {
20845
20850
  editor.chain().focus().extendMarkRange("link").setLink({
20846
20851
  href: formattedUrl,
20847
- target: openInNewTab ? "_blank" : null
20852
+ target: openInNewTab ? "_blank" : "_self"
20848
20853
  }).run();
20849
20854
  setIsEditing(false);
20850
20855
  return;
@@ -20862,7 +20867,7 @@ var LinkPopOver = function LinkPopOver(_ref) {
20862
20867
  if (ramda.isNil(from) || ramda.isNil(to)) return;
20863
20868
  var attrs = {
20864
20869
  href: formattedUrl,
20865
- target: openInNewTab ? "_blank" : null
20870
+ target: openInNewTab ? "_blank" : "_self"
20866
20871
  };
20867
20872
  var linkMark = state.schema.marks.link.create(attrs);
20868
20873
  var linkTextWithMark = state.schema.text(textContent, [linkMark]);
@@ -20889,16 +20894,19 @@ var LinkPopOver = function LinkPopOver(_ref) {
20889
20894
  setIsLinkActive(isActive);
20890
20895
  if (isActive) {
20891
20896
  updatePopoverPosition();
20897
+ var currentLinkAttributes = editor === null || editor === void 0 ? void 0 : editor.getAttributes("link");
20898
+ setLinkAttributes(currentLinkAttributes);
20892
20899
  }
20893
20900
  }, [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]);
20894
20901
  var renderEditingMode = function renderEditingMode() {
20902
+ var initialValues = {
20903
+ textContent: initialTextContent,
20904
+ urlString: (linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.href) || "",
20905
+ openInNewTab: (linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.target) === "_blank"
20906
+ };
20895
20907
  return /*#__PURE__*/jsxRuntime.jsx(Form, {
20896
20908
  formikProps: {
20897
- initialValues: {
20898
- textContent: initialTextContent,
20899
- urlString: (linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.href) || "",
20900
- openInNewTab: (linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.target) === "_blank"
20901
- },
20909
+ initialValues: initialValues,
20902
20910
  onSubmit: handleSubmit,
20903
20911
  validationSchema: constants$1.LINK_VALIDATION_SCHEMA
20904
20912
  },
@@ -20958,14 +20966,14 @@ var LinkPopOver = function LinkPopOver(_ref) {
20958
20966
  })]
20959
20967
  });
20960
20968
  }
20961
- });
20969
+ }, "".concat(linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.href, "-").concat(linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.target));
20962
20970
  };
20963
20971
  var renderViewMode = function renderViewMode() {
20964
20972
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
20965
20973
  children: [/*#__PURE__*/jsxRuntime.jsx("a", {
20966
20974
  href: linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.href,
20967
- rel: "noreferrer",
20968
- target: "_blank",
20975
+ rel: "noreferrer noopener",
20976
+ target: (linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.target) || "_self",
20969
20977
  children: linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.href
20970
20978
  }), " - ", /*#__PURE__*/jsxRuntime.jsx(Button, {
20971
20979
  className: "ne-link-popover__option-button",