@bigbinary/neeto-editor 1.47.51 → 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 +18 -12
- package/dist/Editor.js.map +1 -1
- package/dist/FormikEditor.js +1 -1
- package/dist/Menu.js +1 -1
- package/dist/{chunk-BuwZ56CV.js → chunk-DiadEIO-.js} +2 -2
- package/dist/{chunk-BuwZ56CV.js.map → chunk-DiadEIO-.js.map} +1 -1
- package/dist/cjs/Editor.cjs.js +18 -12
- package/dist/cjs/Editor.cjs.js.map +1 -1
- package/dist/cjs/FormikEditor.cjs.js +1 -1
- package/dist/cjs/Menu.cjs.js +1 -1
- package/dist/cjs/{chunk-D-D5oWUE.cjs.js → chunk-C8-dRWVT.cjs.js} +2 -2
- package/dist/cjs/{chunk-D-D5oWUE.cjs.js.map → chunk-C8-dRWVT.cjs.js.map} +1 -1
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/editor-stats.html +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/cjs/Editor.cjs.js
CHANGED
|
@@ -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-
|
|
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');
|
|
@@ -20812,10 +20812,13 @@ var LinkPopOver = function LinkPopOver(_ref) {
|
|
|
20812
20812
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
20813
20813
|
isLinkActive = _useState8[0],
|
|
20814
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];
|
|
20815
20819
|
var popoverRef = React.useRef(null);
|
|
20816
20820
|
var _useTranslation = reactI18next.useTranslation(),
|
|
20817
20821
|
t = _useTranslation.t;
|
|
20818
|
-
var linkAttributes = editor === null || editor === void 0 ? void 0 : editor.getAttributes("link");
|
|
20819
20822
|
var updatePopoverPosition = function updatePopoverPosition() {
|
|
20820
20823
|
if (!view) return;
|
|
20821
20824
|
var _getLinkPopoverPositi = Menu$4.getLinkPopoverPosition(editor, popoverRef),
|
|
@@ -20846,7 +20849,7 @@ var LinkPopOver = function LinkPopOver(_ref) {
|
|
|
20846
20849
|
if (ramda.equals(textContent, initialTextContent)) {
|
|
20847
20850
|
editor.chain().focus().extendMarkRange("link").setLink({
|
|
20848
20851
|
href: formattedUrl,
|
|
20849
|
-
target: openInNewTab ? "_blank" :
|
|
20852
|
+
target: openInNewTab ? "_blank" : "_self"
|
|
20850
20853
|
}).run();
|
|
20851
20854
|
setIsEditing(false);
|
|
20852
20855
|
return;
|
|
@@ -20864,7 +20867,7 @@ var LinkPopOver = function LinkPopOver(_ref) {
|
|
|
20864
20867
|
if (ramda.isNil(from) || ramda.isNil(to)) return;
|
|
20865
20868
|
var attrs = {
|
|
20866
20869
|
href: formattedUrl,
|
|
20867
|
-
target: openInNewTab ? "_blank" :
|
|
20870
|
+
target: openInNewTab ? "_blank" : "_self"
|
|
20868
20871
|
};
|
|
20869
20872
|
var linkMark = state.schema.marks.link.create(attrs);
|
|
20870
20873
|
var linkTextWithMark = state.schema.text(textContent, [linkMark]);
|
|
@@ -20891,16 +20894,19 @@ var LinkPopOver = function LinkPopOver(_ref) {
|
|
|
20891
20894
|
setIsLinkActive(isActive);
|
|
20892
20895
|
if (isActive) {
|
|
20893
20896
|
updatePopoverPosition();
|
|
20897
|
+
var currentLinkAttributes = editor === null || editor === void 0 ? void 0 : editor.getAttributes("link");
|
|
20898
|
+
setLinkAttributes(currentLinkAttributes);
|
|
20894
20899
|
}
|
|
20895
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]);
|
|
20896
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
|
+
};
|
|
20897
20907
|
return /*#__PURE__*/jsxRuntime.jsx(Form, {
|
|
20898
20908
|
formikProps: {
|
|
20899
|
-
initialValues:
|
|
20900
|
-
textContent: initialTextContent,
|
|
20901
|
-
urlString: (linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.href) || "",
|
|
20902
|
-
openInNewTab: (linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.target) === "_blank"
|
|
20903
|
-
},
|
|
20909
|
+
initialValues: initialValues,
|
|
20904
20910
|
onSubmit: handleSubmit,
|
|
20905
20911
|
validationSchema: constants$1.LINK_VALIDATION_SCHEMA
|
|
20906
20912
|
},
|
|
@@ -20960,14 +20966,14 @@ var LinkPopOver = function LinkPopOver(_ref) {
|
|
|
20960
20966
|
})]
|
|
20961
20967
|
});
|
|
20962
20968
|
}
|
|
20963
|
-
});
|
|
20969
|
+
}, "".concat(linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.href, "-").concat(linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.target));
|
|
20964
20970
|
};
|
|
20965
20971
|
var renderViewMode = function renderViewMode() {
|
|
20966
20972
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
20967
20973
|
children: [/*#__PURE__*/jsxRuntime.jsx("a", {
|
|
20968
20974
|
href: linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.href,
|
|
20969
|
-
rel: "noreferrer",
|
|
20970
|
-
target: "
|
|
20975
|
+
rel: "noreferrer noopener",
|
|
20976
|
+
target: (linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.target) || "_self",
|
|
20971
20977
|
children: linkAttributes === null || linkAttributes === void 0 ? void 0 : linkAttributes.href
|
|
20972
20978
|
}), " - ", /*#__PURE__*/jsxRuntime.jsx(Button, {
|
|
20973
20979
|
className: "ne-link-popover__option-button",
|