@seafile/sdoc-editor 1.0.159 → 1.0.160
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.
|
@@ -52,7 +52,7 @@ class JSBridge {
|
|
|
52
52
|
if (typeof key !== 'string') {
|
|
53
53
|
throw new Error('Event type must be a string.');
|
|
54
54
|
}
|
|
55
|
-
if (typeof
|
|
55
|
+
if (typeof callback !== 'function') {
|
|
56
56
|
throw new Error('The handler function must be a function.');
|
|
57
57
|
}
|
|
58
58
|
this.eventHandlerMap[key] = callback;
|
|
@@ -10,7 +10,10 @@ var _jsBridge = _interopRequireDefault(require("./js-bridge"));
|
|
|
10
10
|
const updateOutlineValue = value => {
|
|
11
11
|
if (!value || !Array.isArray(value)) return;
|
|
12
12
|
const outlines = value === null || value === void 0 ? void 0 : value.filter(item => ['header1', 'header2', 'header3'].includes(item.type));
|
|
13
|
-
window.
|
|
13
|
+
if (!window.seadroid) {
|
|
14
|
+
window.seadroid = {};
|
|
15
|
+
}
|
|
16
|
+
window.seadroid['outlines'] = outlines;
|
|
14
17
|
};
|
|
15
18
|
exports.updateOutlineValue = updateOutlineValue;
|
|
16
19
|
const scrollToOutline = item => {
|