@seafile/seafile-editor 3.0.25 → 3.0.27
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.
|
@@ -17,6 +17,7 @@ const renderCheckListItem = (_ref, editor) => {
|
|
|
17
17
|
children,
|
|
18
18
|
element
|
|
19
19
|
} = _ref;
|
|
20
|
+
const isReadonly = (0, _slateReact.useReadOnly)();
|
|
20
21
|
const {
|
|
21
22
|
id,
|
|
22
23
|
checked = false
|
|
@@ -43,7 +44,8 @@ const renderCheckListItem = (_ref, editor) => {
|
|
|
43
44
|
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
44
45
|
type: "checkbox",
|
|
45
46
|
onChange: onChange,
|
|
46
|
-
checked: checked
|
|
47
|
+
checked: checked,
|
|
48
|
+
disabled: isReadonly
|
|
47
49
|
})), children);
|
|
48
50
|
};
|
|
49
51
|
var _default = exports.default = renderCheckListItem;
|
|
@@ -92,7 +92,8 @@ const getImagesUrlList = nodes => {
|
|
|
92
92
|
};
|
|
93
93
|
exports.getImagesUrlList = getImagesUrlList;
|
|
94
94
|
const handleUpdateFile = async (editor, file, insertPosition) => {
|
|
95
|
-
|
|
95
|
+
var _editor$api;
|
|
96
|
+
if (editor !== null && editor !== void 0 && (_editor$api = editor.api) !== null && _editor$api !== void 0 && _editor$api.uploadLocalImage) {
|
|
96
97
|
try {
|
|
97
98
|
const url = await editor.api.uploadLocalImage(file);
|
|
98
99
|
const title = file.name;
|
|
@@ -17,6 +17,7 @@ var _constants = require("../../../../constants");
|
|
|
17
17
|
require("./index.css");
|
|
18
18
|
const menuConfig = _menusConfig.MENUS_CONFIG_MAP[_elementTypes.IMAGE];
|
|
19
19
|
const ImageMenu = _ref => {
|
|
20
|
+
var _editor$api;
|
|
20
21
|
let {
|
|
21
22
|
readonly,
|
|
22
23
|
editor,
|
|
@@ -55,7 +56,7 @@ const ImageMenu = _ref => {
|
|
|
55
56
|
fade: false
|
|
56
57
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
57
58
|
className: "sf-insert-image-menu-popover-container sf-dropdown-menu-container"
|
|
58
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
59
|
+
}, (editor === null || editor === void 0 ? void 0 : (_editor$api = editor.api) === null || _editor$api === void 0 ? void 0 : _editor$api.uploadLocalImage) && /*#__PURE__*/_react.default.createElement("div", {
|
|
59
60
|
className: "sf-dropdown-menu-item",
|
|
60
61
|
onClick: openFileDIalog
|
|
61
62
|
}, t('Upload_local_image')), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -30,7 +30,8 @@ const useLinkClick = (editorId, server, callback) => {
|
|
|
30
30
|
let isValid = true;
|
|
31
31
|
if (!(0, _common.isUrl)(link)) {
|
|
32
32
|
isValid = false;
|
|
33
|
-
|
|
33
|
+
const validServer = server || window.location.origin;
|
|
34
|
+
if (link.startsWith('/') && (0, _common.isUrl)(validServer + link)) {
|
|
34
35
|
isValid = true;
|
|
35
36
|
}
|
|
36
37
|
if (!link.startsWith('/') && (link.startsWith('mailto:') || link.startsWith('tel:'))) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seafile/seafile-editor",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.27",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -115,7 +115,6 @@
|
|
|
115
115
|
"xtend": "4.0.2"
|
|
116
116
|
},
|
|
117
117
|
"overrides": {
|
|
118
|
-
"@xmldom/xmldom": "0.9.9",
|
|
119
118
|
"@tootallnate/once": "3.0.1"
|
|
120
119
|
}
|
|
121
120
|
}
|