@seafile/sdoc-editor 1.0.66-beta → 1.0.66
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/basic-sdk/constants/index.js +1 -15
- package/dist/basic-sdk/editor/sdoc-editor.js +1 -2
- package/dist/hooks/index.js +1 -14
- package/dist/pages/simple-editor.js +3 -6
- package/package.json +1 -1
- package/public/media/sdoc-editor-font/iconfont.eot +0 -0
- package/public/media/sdoc-editor-font/iconfont.svg +0 -4
- package/public/media/sdoc-editor-font/iconfont.ttf +0 -0
- package/public/media/sdoc-editor-font/iconfont.woff +0 -0
- package/public/media/sdoc-editor-font/iconfont.woff2 +0 -0
- package/public/media/sdoc-editor-font.css +6 -14
- package/dist/basic-sdk/constants/plugin.js +0 -14
- package/dist/components/doc-operations/plugins-operations.js +0 -43
- package/dist/hooks/use-plugins.js +0 -47
|
@@ -4,23 +4,9 @@ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWild
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.PAGE_EDIT_AREA_WIDTH = exports.MODIFY_TYPE = exports.INTERNAL_EVENT = exports.DOCUMENT_PLUGIN_EDITOR = exports.DIFF_VIEWER = exports.COMMENT_EDITOR_EDIT_AREA_WIDTH = exports.COMMENT_EDITOR = void 0;
|
|
8
|
-
Object.defineProperty(exports, "PLUGIN_BTN_POSITION", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
get: function () {
|
|
11
|
-
return _plugin.PLUGIN_BTN_POSITION;
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(exports, "PLUGIN_DISPLAY_TYPE", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
get: function () {
|
|
17
|
-
return _plugin.PLUGIN_DISPLAY_TYPE;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
exports.Z_INDEX = exports.WIKI_EDITOR = exports.REVISION_DIFF_VALUE = exports.REVISION_DIFF_KEY = exports.REBASE_TYPES = exports.REBASE_TYPE = exports.REBASE_ORIGIN = exports.REBASE_MARK_KEY = exports.REBASE_MARKS = void 0;
|
|
7
|
+
exports.Z_INDEX = exports.WIKI_EDITOR = exports.REVISION_DIFF_VALUE = exports.REVISION_DIFF_KEY = exports.REBASE_TYPES = exports.REBASE_TYPE = exports.REBASE_ORIGIN = exports.REBASE_MARK_KEY = exports.REBASE_MARKS = exports.PAGE_EDIT_AREA_WIDTH = exports.MODIFY_TYPE = exports.INTERNAL_EVENT = exports.DOCUMENT_PLUGIN_EDITOR = exports.DIFF_VIEWER = exports.COMMENT_EDITOR_EDIT_AREA_WIDTH = exports.COMMENT_EDITOR = void 0;
|
|
21
8
|
var Z_INDEX = _interopRequireWildcard(require("./z-index"));
|
|
22
9
|
exports.Z_INDEX = Z_INDEX;
|
|
23
|
-
var _plugin = require("./plugin");
|
|
24
10
|
const INTERNAL_EVENT = exports.INTERNAL_EVENT = {
|
|
25
11
|
CANCEL_TABLE_SELECT_RANGE: 'cancel_table_select_range',
|
|
26
12
|
SET_TABLE_SELECT_RANGE: 'set_table_select_range',
|
|
@@ -32,8 +32,7 @@ const SdocEditor = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
32
32
|
isReloading,
|
|
33
33
|
showComment,
|
|
34
34
|
isShowHeaderToolbar = true,
|
|
35
|
-
showOutline = true
|
|
36
|
-
plugins = []
|
|
35
|
+
showOutline = true
|
|
37
36
|
} = _ref;
|
|
38
37
|
const validEditor = (0, _react.useMemo)(() => {
|
|
39
38
|
if (propsEditor) return propsEditor;
|
package/dist/hooks/index.js
CHANGED
|
@@ -9,12 +9,6 @@ Object.defineProperty(exports, "CollaboratorsProvider", {
|
|
|
9
9
|
return _useCollaborators.CollaboratorsProvider;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "PluginsProvider", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _usePlugins.PluginsProvider;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
12
|
Object.defineProperty(exports, "useCollaborators", {
|
|
19
13
|
enumerable: true,
|
|
20
14
|
get: function () {
|
|
@@ -27,12 +21,5 @@ Object.defineProperty(exports, "useDocument", {
|
|
|
27
21
|
return _useDocument.useDocument;
|
|
28
22
|
}
|
|
29
23
|
});
|
|
30
|
-
Object.defineProperty(exports, "usePlugins", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _usePlugins.usePlugins;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
24
|
var _useCollaborators = require("./use-collaborators");
|
|
37
|
-
var _useDocument = require("./use-document");
|
|
38
|
-
var _usePlugins = require("./use-plugins");
|
|
25
|
+
var _useDocument = require("./use-document");
|
|
@@ -26,8 +26,7 @@ const SimpleEditor = _ref => {
|
|
|
26
26
|
showComment,
|
|
27
27
|
showDocOperations = true,
|
|
28
28
|
showFileTags = true,
|
|
29
|
-
t
|
|
30
|
-
plugins = []
|
|
29
|
+
t
|
|
31
30
|
} = _ref;
|
|
32
31
|
_context.default.initApi();
|
|
33
32
|
const editorRef = (0, _react.useRef)(null);
|
|
@@ -141,9 +140,7 @@ const SimpleEditor = _ref => {
|
|
|
141
140
|
className: "error-tip"
|
|
142
141
|
}, t(errorMessage)));
|
|
143
142
|
}
|
|
144
|
-
return /*#__PURE__*/_react.default.createElement(_errorBoundary.default, null, /*#__PURE__*/_react.default.createElement(
|
|
145
|
-
plugins: plugins
|
|
146
|
-
}, /*#__PURE__*/_react.default.createElement(_layout.default, null, /*#__PURE__*/_react.default.createElement(_layout.Header, null, /*#__PURE__*/_react.default.createElement(_docInfo.default, {
|
|
143
|
+
return /*#__PURE__*/_react.default.createElement(_errorBoundary.default, null, /*#__PURE__*/_react.default.createElement(_layout.default, null, /*#__PURE__*/_react.default.createElement(_layout.Header, null, /*#__PURE__*/_react.default.createElement(_docInfo.default, {
|
|
147
144
|
isStarred: isStarred,
|
|
148
145
|
isDraft: isDraft,
|
|
149
146
|
showFileTags: showFileTags,
|
|
@@ -156,6 +153,6 @@ const SimpleEditor = _ref => {
|
|
|
156
153
|
handleViewChangesToggle: handleViewChangesToggle,
|
|
157
154
|
handleRevisionMerged: handleRevisionMerged,
|
|
158
155
|
handleRevisionPublished: handleRevisionPublished
|
|
159
|
-
})), /*#__PURE__*/_react.default.createElement(_layout.Content, null, renderEditor())))
|
|
156
|
+
})), /*#__PURE__*/_react.default.createElement(_layout.Content, null, renderEditor())));
|
|
160
157
|
};
|
|
161
158
|
var _default = exports.default = (0, _reactI18next.withTranslation)('sdoc-editor')(SimpleEditor);
|
package/package.json
CHANGED
|
Binary file
|
|
@@ -14,10 +14,6 @@
|
|
|
14
14
|
/>
|
|
15
15
|
<missing-glyph />
|
|
16
16
|
|
|
17
|
-
<glyph glyph-name="sdoc-info" unicode="" d="M512 896c281.6 0 512-230.4 512-512s-230.4-512-512-512S0 102.4 0 384 230.4 896 512 896z m0-96C281.6 800 96 614.4 96 384s185.6-416 416-416 416 185.6 416 416c0 108.8-44.8 217.6-121.6 294.4S620.8 800 512 800z m32-352c19.2 0 32-12.8 32-32v-256c0-19.2-12.8-32-32-32h-64c-19.2 0-32 12.8-32 32V416c0 19.2 12.8 32 32 32h64z m-19.2 192c9.6 0 16-3.2 22.4-9.6 3.2-3.2 6.4-6.4 9.6-6.4 25.6-25.6 25.6-64 0-89.6-3.2-3.2-6.4-6.4-9.6-6.4-6.4-3.2-16-6.4-22.4-9.6h-25.6c-9.6 0-16 3.2-22.4 9.6-3.2 3.2-6.4 6.4-9.6 6.4-25.6 25.6-25.6 64 0 89.6 3.2 3.2 6.4 6.4 9.6 6.4 6.4 3.2 16 6.4 22.4 9.6h25.6z" horiz-adv-x="1024" />
|
|
18
|
-
|
|
19
|
-
<glyph glyph-name="sdoc-inline-code" unicode="" d="M1024 384l-272-288-67.2 70.4 204.8 217.6-204.8 217.6L752 672l272-288zM0 384l272-288 67.2 70.4L134.4 384l204.8 217.6L272 672 0 384z m451.2-512l-99.2 3.2L579.2 896h99.2l-227.2-1024z" horiz-adv-x="1024" />
|
|
20
|
-
|
|
21
17
|
<glyph glyph-name="sdoc-sort" unicode="" d="M294.4 790.4l201.6-204.8c19.2-19.2 19.2-51.2 0-73.6-19.2-19.2-51.2-19.2-70.4 0L320 620.8v-604.8c0-25.6-22.4-48-48-48S224-9.6 224 16V620.8L118.4 512c-19.2-19.2-48-19.2-67.2-3.2l-3.2 3.2c-19.2 19.2-19.2 51.2 0 73.6l201.6 204.8c12.8 12.8 32 12.8 44.8 0zM752 800c25.6 0 48-22.4 48-48v-604.8l105.6 108.8c19.2 19.2 51.2 19.2 70.4 0 19.2-19.2 19.2-51.2 0-73.6l-201.6-204.8c-12.8-12.8-32-12.8-44.8 0l-201.6 204.8c-19.2 19.2-19.2 51.2 0 73.6l3.2 3.2c19.2 16 48 16 67.2-3.2l105.6-108.8V752c0 25.6 22.4 48 48 48z" horiz-adv-x="1024" />
|
|
22
18
|
|
|
23
19
|
<glyph glyph-name="sdoc-set-up" unicode="" d="M598.52384 809.6l12.8-92.8 6.4-38.4 35.2-16c12.8-6.4 28.8-16 41.6-25.6l32-19.2 35.2 12.8 92.8 35.2 86.4-140.8-76.8-54.4-32-25.6 3.2-38.4v-44.8l-3.2-38.4 32-25.6 76.8-57.6-83.2-140.8-92.8 35.2-35.2 12.8-32-19.2c-12.8-9.6-28.8-19.2-41.6-25.6l-35.2-16-6.4-38.4-12.8-92.8h-172.8l-12.8 92.8-6.4 38.4-35.2 16c-12.8 6.4-28.8 16-41.6 25.6l-32 19.2-35.2-12.8-92.8-35.2-86.4 140.8L160.12384 297.6l32 25.6-3.2 38.4V384v22.4l3.2 38.4-32 25.6-76.8 57.6 83.2 140.8 92.8-35.2 35.2-12.8 32 19.2c12.8 9.6 28.8 19.2 41.6 25.6l35.2 16 6.4 38.4 12.8 92.8h176m12.8 83.2H416.12384c-32 0-57.6-22.4-60.8-51.2l-16-105.6c-19.2-9.6-35.2-19.2-54.4-32L182.52384 748.8c-9.6 3.2-16 3.2-22.4 3.2-22.4 0-41.6-9.6-54.4-28.8L6.52384 560c-12.8-28.8-6.4-60.8 16-80l86.4-67.2c0-9.6-3.2-22.4-3.2-28.8 0-9.6 0-19.2 3.2-28.8L22.52384 288c-22.4-19.2-28.8-51.2-16-76.8l96-163.2c9.6-19.2 32-32 54.4-32 6.4 0 12.8 0 22.4 3.2l102.4 41.6c16-12.8 35.2-22.4 54.4-28.8l16-105.6c3.2-28.8 28.8-51.2 60.8-51.2H608.12384c32 0 57.6 22.4 60.8 51.2l16 105.6c19.2 9.6 35.2 19.2 54.4 28.8l102.4-41.6c6.4-3.2 16-3.2 22.4-3.2 22.4 0 41.6 9.6 54.4 28.8l99.2 166.4c16 25.6 9.6 57.6-16 76.8l-86.4 67.2c0 9.6 3.2 19.2 3.2 28.8s0 22.4-3.2 28.8l86.4 67.2c22.4 19.2 28.8 51.2 16 76.8l-96 163.2c-9.6 19.2-32 32-54.4 32-6.4 0-12.8 0-22.4-3.2l-102.4-41.6c-16 12.8-35.2 22.4-54.4 28.8L672.12384 844.8C665.72384 873.6 640.12384 896 611.32384 896zM512.12384 512c70.4 0 128-57.6 128-128s-57.6-128-128-128-128 57.6-128 128 57.6 128 128 128m0 86.4a214.4 214.4 0 1 1 0-428.8 214.4 214.4 0 0 1 0 428.8z" horiz-adv-x="1026" />
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
@font-face {
|
|
2
2
|
font-family: "sdocfont"; /* Project id 4097705 */
|
|
3
|
-
src: url('./sdoc-editor-font/iconfont.eot?t=
|
|
4
|
-
src: url('./sdoc-editor-font/iconfont.eot?t=
|
|
5
|
-
url('./sdoc-editor-font/iconfont.woff2?t=
|
|
6
|
-
url('./sdoc-editor-font/iconfont.woff?t=
|
|
7
|
-
url('./sdoc-editor-font/iconfont.ttf?t=
|
|
8
|
-
url('./sdoc-editor-font/iconfont.svg?t=
|
|
3
|
+
src: url('./sdoc-editor-font/iconfont.eot?t=1722915152576'); /* IE9 */
|
|
4
|
+
src: url('./sdoc-editor-font/iconfont.eot?t=1722915152576#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
|
5
|
+
url('./sdoc-editor-font/iconfont.woff2?t=1722915152576') format('woff2'),
|
|
6
|
+
url('./sdoc-editor-font/iconfont.woff?t=1722915152576') format('woff'),
|
|
7
|
+
url('./sdoc-editor-font/iconfont.ttf?t=1722915152576') format('truetype'),
|
|
8
|
+
url('./sdoc-editor-font/iconfont.svg?t=1722915152576#sdocfont') format('svg');
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.sdocfont {
|
|
@@ -16,14 +16,6 @@
|
|
|
16
16
|
-moz-osx-font-smoothing: grayscale;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.sdoc-info:before {
|
|
20
|
-
content: "\e677";
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.sdoc-inline-code:before {
|
|
24
|
-
content: "\e676";
|
|
25
|
-
}
|
|
26
|
-
|
|
27
19
|
.sdoc-sort:before {
|
|
28
20
|
content: "\e674";
|
|
29
21
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.PLUGIN_DISPLAY_TYPE = exports.PLUGIN_BTN_POSITION = void 0;
|
|
7
|
-
const PLUGIN_DISPLAY_TYPE = exports.PLUGIN_DISPLAY_TYPE = {
|
|
8
|
-
INLAY_RIGHT: 'inlay-right',
|
|
9
|
-
DIALOG: 'dialog'
|
|
10
|
-
};
|
|
11
|
-
const PLUGIN_BTN_POSITION = exports.PLUGIN_BTN_POSITION = {
|
|
12
|
-
MORE_MENU: 'more-menu',
|
|
13
|
-
DEFAULT: 'default'
|
|
14
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
-
var _hooks = require("../../hooks");
|
|
12
|
-
var _mouseEvent = require("../../basic-sdk/utils/mouse-event");
|
|
13
|
-
const PluginsOperations = _ref => {
|
|
14
|
-
let {} = _ref;
|
|
15
|
-
const {
|
|
16
|
-
plugins,
|
|
17
|
-
updateDisplayPluginKey
|
|
18
|
-
} = (0, _hooks.usePlugins)();
|
|
19
|
-
const onClick = (0, _react.useCallback)((event, pluginKey) => {
|
|
20
|
-
(0, _mouseEvent.eventStopPropagation)(event);
|
|
21
|
-
updateDisplayPluginKey(pluginKey);
|
|
22
|
-
}, []);
|
|
23
|
-
return plugins.map(plugin => {
|
|
24
|
-
const {
|
|
25
|
-
key,
|
|
26
|
-
icon
|
|
27
|
-
} = plugin;
|
|
28
|
-
let iconDom = '';
|
|
29
|
-
if (typeof icon !== 'string') {
|
|
30
|
-
iconDom = icon;
|
|
31
|
-
} else {
|
|
32
|
-
iconDom = /*#__PURE__*/_react.default.createElement("i", {
|
|
33
|
-
className: (0, _classnames.default)('sdocfont', icon)
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
return /*#__PURE__*/_react.default.createElement("span", {
|
|
37
|
-
className: "op-item sdoc-plugin-operation-btn-container",
|
|
38
|
-
onClick: e => onClick(e, key),
|
|
39
|
-
key: key
|
|
40
|
-
}, iconDom);
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
var _default = exports.default = PluginsOperations;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.usePlugins = exports.PluginsProvider = void 0;
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
var _basicSdk = require("../basic-sdk");
|
|
10
|
-
var _constants = require("../basic-sdk/constants");
|
|
11
|
-
const PluginsContext = /*#__PURE__*/_react.default.createContext(null);
|
|
12
|
-
const PluginsProvider = _ref => {
|
|
13
|
-
let {
|
|
14
|
-
plugins,
|
|
15
|
-
children
|
|
16
|
-
} = _ref;
|
|
17
|
-
const [displayKey, setDisplayKey] = (0, _react.useState)('');
|
|
18
|
-
const updateDisplayPluginKey = (0, _react.useCallback)(key => {
|
|
19
|
-
console.log('updateDisplayPluginKey: ', key);
|
|
20
|
-
if (!key || displayKey === key) {
|
|
21
|
-
setDisplayKey('');
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const plugin = plugins.find(plugin => plugin.key === key);
|
|
25
|
-
if (plugin.display_type === _constants.PLUGIN_DISPLAY_TYPE.INLAY_RIGHT) {
|
|
26
|
-
const eventBus = _basicSdk.EventBus.getInstance();
|
|
27
|
-
eventBus.dispatch(_constants.INTERNAL_EVENT.COMMENT_LIST_CLICK);
|
|
28
|
-
setDisplayKey(key);
|
|
29
|
-
}
|
|
30
|
-
}, [displayKey, plugins]);
|
|
31
|
-
return /*#__PURE__*/_react.default.createElement(PluginsContext.Provider, {
|
|
32
|
-
value: {
|
|
33
|
-
plugins,
|
|
34
|
-
displayPluginKey: displayKey,
|
|
35
|
-
updateDisplayPluginKey
|
|
36
|
-
}
|
|
37
|
-
}, children);
|
|
38
|
-
};
|
|
39
|
-
exports.PluginsProvider = PluginsProvider;
|
|
40
|
-
const usePlugins = () => {
|
|
41
|
-
const context = (0, _react.useContext)(PluginsContext);
|
|
42
|
-
if (!context) {
|
|
43
|
-
throw new Error('\'PluginsContext\' is null');
|
|
44
|
-
}
|
|
45
|
-
return context;
|
|
46
|
-
};
|
|
47
|
-
exports.usePlugins = usePlugins;
|