dochub-sdk 0.1.306 → 0.1.308
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/classes/vue2/Editor.ts +10 -10
- package/interfaces/editors.ts +2 -1
- package/package.json +1 -1
package/classes/vue2/Editor.ts
CHANGED
@@ -16,34 +16,34 @@ export class DocHubEditorProto extends DocHubComponentProto {
|
|
16
16
|
|
17
17
|
constructor(...params) {
|
18
18
|
super(...params);
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
this.$on(EditorEvents.save, this.onSave);
|
20
|
+
this.$on(EditorEvents.saveAs, this.onSaveAs);
|
21
|
+
this.$on(EditorEvents.goto, this.onGoTo);
|
22
22
|
}
|
23
23
|
|
24
24
|
destroyed(): void {
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
this.$off(EditorEvents.save, this.onSave);
|
26
|
+
this.$off(EditorEvents.saveAs, this.onSaveAs);
|
27
|
+
this.$off(EditorEvents.goto, this.onGoTo);
|
28
28
|
}
|
29
29
|
|
30
30
|
/**
|
31
31
|
* Вызывается при необходимости перейти в редакторе на заданную область
|
32
32
|
* @param location
|
33
33
|
*/
|
34
|
-
onGoTo(location: string | RegExp) {
|
34
|
+
async onGoTo(location: string | RegExp): Promise<void> {
|
35
35
|
console.warn('Goto function is not implemented', location);
|
36
36
|
}
|
37
37
|
/**
|
38
38
|
* Вызывается при необходимости сохранить результат редактирования
|
39
39
|
*/
|
40
|
-
onSave() {
|
40
|
+
async onSave(): Promise<void> {
|
41
41
|
console.warn('Save function is not implemented');
|
42
42
|
}
|
43
43
|
/**
|
44
44
|
* Вызывается при необходимости сохранить результат в файле с иным названием
|
45
45
|
*/
|
46
|
-
onSaveAs(uri: string) {
|
47
|
-
console.warn('Save as function is not implemented');
|
46
|
+
async onSaveAs(uri: string): Promise<void> {
|
47
|
+
console.warn('Save as function is not implemented', uri);
|
48
48
|
}
|
49
49
|
}
|
package/interfaces/editors.ts
CHANGED
@@ -67,7 +67,8 @@ export enum EditorEvents {
|
|
67
67
|
*/
|
68
68
|
save = '#edit-save', // Требует произвести сохранение
|
69
69
|
saveAs = '#edit-save-as', // Требует произвести сохранение с новым именем
|
70
|
-
goto = '#edit-goto'
|
70
|
+
goto = '#edit-goto', // Требует перейти в указанное пространство
|
71
|
+
create = '#edit-create', // Требует создать файл или объект
|
71
72
|
};
|
72
73
|
/**
|
73
74
|
* Тип редактора
|