jodit 3.9.3 → 3.10.2
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/.idea/workspace.xml +306 -295
- package/CHANGELOG.MD +349 -119
- package/build/jodit.css +675 -538
- package/build/jodit.es2018.css +536 -436
- package/build/jodit.es2018.en.css +536 -436
- package/build/jodit.es2018.en.js +1529 -738
- package/build/jodit.es2018.en.min.css +1 -1
- package/build/jodit.es2018.en.min.js +1 -1
- package/build/jodit.es2018.js +1533 -742
- package/build/jodit.es2018.min.css +1 -1
- package/build/jodit.es2018.min.js +1 -1
- package/build/jodit.js +2598 -1680
- package/build/jodit.min.css +2 -2
- package/build/jodit.min.js +1 -1
- package/index.d.ts +10 -0
- package/package.json +10 -10
- package/src/config.ts +19 -20
- package/src/core/component/component.ts +16 -15
- package/src/core/component/statuses.ts +6 -6
- package/src/core/dom.ts +16 -4
- package/src/core/events/event-emitter.ts +4 -2
- package/src/core/global.ts +13 -2
- package/src/core/helpers/append-script.ts +14 -0
- package/src/core/helpers/selector.ts +8 -3
- package/src/core/helpers/size/index.ts +1 -0
- package/src/core/helpers/size/object-size.ts +22 -0
- package/src/core/selection/select.ts +1 -0
- package/src/core/selection/style/api/{get-closest-wrapper.ts → extract.ts} +26 -43
- package/src/core/selection/style/api/finite-state-machine.ts +66 -0
- package/src/core/selection/style/api/index.ts +12 -5
- package/src/core/selection/style/api/{check-special-elements.ts → is-inside-invisible-element.ts} +1 -1
- package/src/core/selection/style/api/is-suit-element.ts +12 -1
- package/src/core/selection/style/api/toggle/toggle-css.ts +134 -0
- package/src/core/selection/style/api/toggle/toggle-ordered-list.ts +49 -0
- package/src/core/selection/style/api/toggle-commit-styles.ts +27 -0
- package/src/core/selection/style/api/wrap-and-commit-style.ts +68 -0
- package/src/core/selection/style/api/wrap-ordered-list.ts +37 -0
- package/src/core/selection/style/api/wrap-unwrapped-text.ts +1 -4
- package/src/core/selection/style/apply-style.ts +161 -97
- package/src/core/selection/style/commit-style.ts +13 -0
- package/src/core/storage/engines/local-storage-provider.ts +9 -3
- package/src/core/storage/engines/memory-storage-provider.ts +6 -3
- package/src/core/storage/storage.ts +7 -4
- package/src/core/ui/button/button/button.less +10 -8
- package/src/core/ui/button/button/button.ts +9 -9
- package/src/core/ui/button/group/group.ts +2 -2
- package/src/core/ui/element.ts +4 -3
- package/src/core/ui/form/block/block.ts +1 -1
- package/src/core/ui/form/form.ts +8 -0
- package/src/core/ui/form/inputs/area/area.less +5 -0
- package/src/core/ui/form/inputs/area/area.ts +22 -1
- package/src/core/ui/form/inputs/checkbox/checkbox.less +50 -0
- package/src/core/ui/form/inputs/checkbox/checkbox.ts +48 -4
- package/src/core/ui/form/inputs/input/input.less +1 -1
- package/src/core/ui/form/inputs/input/input.ts +14 -4
- package/src/core/ui/helpers/buttons.ts +14 -6
- package/src/core/ui/icon.ts +3 -1
- package/src/core/ui/index.ts +1 -3
- package/src/core/ui/list/group.less +8 -2
- package/src/core/ui/list/group.ts +2 -2
- package/src/{modules/file-browser/consts.ts → core/ui/list/index.ts} +4 -4
- package/src/core/ui/list/list.less +10 -1
- package/src/core/ui/list/list.ts +20 -3
- package/src/core/ui/{separator.ts → list/separator.ts} +2 -2
- package/src/core/ui/list/spacer.ts +15 -0
- package/src/core/ui/popup/popup.less +5 -3
- package/src/core/ui/popup/popup.ts +53 -1
- package/src/core/view/view-with-toolbar.ts +6 -1
- package/src/jodit.ts +17 -14
- package/src/modules/dialog/dialog.less +1 -16
- package/src/modules/dialog/dialog.ts +10 -3
- package/src/modules/file-browser/builders/context-menu.ts +29 -22
- package/src/modules/file-browser/config.ts +10 -2
- package/src/modules/file-browser/file-browser.ts +50 -29
- package/src/modules/file-browser/listeners/native-listeners.ts +37 -19
- package/src/modules/file-browser/listeners/state-listeners.ts +48 -22
- package/src/modules/file-browser/styles/file-browser.less +4 -291
- package/src/modules/file-browser/styles/preview.less +11 -8
- package/src/modules/file-browser/ui/files/files.less +174 -0
- package/src/modules/file-browser/ui/files/files.ts +14 -0
- package/src/modules/file-browser/ui/index.ts +8 -0
- package/src/modules/file-browser/ui/tree/tree.less +118 -0
- package/src/modules/file-browser/ui/tree/tree.ts +14 -0
- package/src/modules/status-bar/status-bar.less +27 -1
- package/src/modules/status-bar/status-bar.ts +15 -1
- package/src/modules/toolbar/collection/collection.ts +17 -8
- package/src/modules/toolbar/collection/editor-collection.ts +27 -2
- package/src/modules/widget/file-selector/file-selector.ts +1 -1
- package/src/modules/widget/tabs/tabs.less +2 -1
- package/src/modules/widget/tabs/tabs.ts +5 -3
- package/src/plugins/add-new-line/add-new-line.ts +1 -0
- package/src/plugins/bold.ts +2 -2
- package/src/plugins/clipboard/drag-and-drop.ts +4 -1
- package/src/plugins/clipboard/paste/paste.ts +1 -1
- package/src/plugins/font.ts +11 -1
- package/src/plugins/image/image-properties/image-properties.ts +7 -0
- package/src/plugins/index.ts +1 -0
- package/src/plugins/inline-popup/config/config.ts +1 -0
- package/src/plugins/inline-popup/config/items/toolbar.ts +33 -0
- package/src/plugins/inline-popup/inline-popup.ts +17 -0
- package/src/plugins/keyboard/delete.ts +30 -8
- package/src/plugins/link/template.ts +2 -2
- package/src/plugins/mobile.ts +10 -14
- package/src/plugins/ordered-list.ts +40 -1
- package/src/plugins/powered-by-jodit.ts +39 -0
- package/src/plugins/print/preview.ts +103 -48
- package/src/plugins/resizer/resizer.less +10 -7
- package/src/plugins/resizer/resizer.ts +12 -14
- package/src/plugins/size/resize-handler.ts +4 -1
- package/src/plugins/size/size.less +2 -19
- package/src/plugins/size/size.ts +6 -1
- package/src/plugins/source/const.ts +7 -0
- package/src/plugins/source/editor/engines/ace.ts +5 -0
- package/src/plugins/source/source.ts +33 -7
- package/src/plugins/sticky/sticky.ts +2 -0
- package/src/styles/icons/index.ts +2 -0
- package/src/styles/icons/resize-handler.svg +4 -0
- package/src/styles/jodit.less +6 -0
- package/src/styles/mixins.less +20 -0
- package/src/styles/themes/dark.less +11 -1
- package/src/types/ajax.d.ts +0 -1
- package/src/types/file-browser.d.ts +13 -1
- package/src/types/jodit.d.ts +4 -1
- package/src/types/popup.d.ts +1 -0
- package/src/types/select.d.ts +2 -0
- package/src/types/storage.ts +3 -3
- package/src/types/style.d.ts +8 -0
- package/src/types/toolbar.d.ts +9 -2
- package/src/types/types.d.ts +1 -1
- package/src/types/ui.d.ts +23 -4
- package/src/types/view.d.ts +1 -0
- package/types/core/component/component.d.ts +10 -5
- package/types/core/component/statuses.d.ts +6 -6
- package/types/core/dom.d.ts +3 -2
- package/types/core/helpers/append-script.d.ts +1 -0
- package/types/core/helpers/selector.d.ts +2 -3
- package/types/core/helpers/size/index.d.ts +1 -0
- package/types/core/helpers/size/object-size.d.ts +7 -0
- package/types/core/selection/style/api/{get-closest-wrapper.d.ts → extract.d.ts} +6 -5
- package/types/core/selection/style/api/finite-state-machine.d.ts +21 -0
- package/types/core/selection/style/api/index.d.ts +12 -5
- package/types/core/selection/style/api/{check-special-elements.d.ts → is-inside-invisible-element.d.ts} +1 -1
- package/types/core/selection/style/api/is-suit-element.d.ts +9 -0
- package/types/core/selection/style/api/toggle/toggle-css.d.ts +11 -0
- package/types/core/selection/style/api/toggle/toggle-ordered-list.d.ts +11 -0
- package/types/core/selection/style/api/{toggle-styles.d.ts → toggle-commit-styles.d.ts} +1 -3
- package/types/core/selection/style/api/{post-process-list-element.d.ts → wrap-and-commit-style.d.ts} +3 -3
- package/types/core/selection/style/api/wrap-ordered-list.d.ts +12 -0
- package/types/core/selection/style/apply-style.d.ts +1 -4
- package/types/core/selection/style/commit-style.d.ts +7 -0
- package/types/core/storage/engines/local-storage-provider.d.ts +3 -3
- package/types/core/storage/engines/memory-storage-provider.d.ts +3 -3
- package/types/core/storage/storage.d.ts +3 -3
- package/types/core/ui/button/button/button.d.ts +3 -3
- package/types/core/ui/form/form.d.ts +1 -0
- package/types/core/ui/form/inputs/area/area.d.ts +7 -1
- package/types/core/ui/form/inputs/checkbox/checkbox.d.ts +10 -3
- package/types/core/ui/helpers/buttons.d.ts +2 -2
- package/types/core/ui/icon.d.ts +1 -1
- package/types/core/ui/index.d.ts +1 -3
- package/types/core/ui/list/group.d.ts +2 -1
- package/types/core/ui/list/index.d.ts +9 -0
- package/types/core/ui/{separator.d.ts → list/separator.d.ts} +1 -1
- package/types/core/ui/list/spacer.d.ts +9 -0
- package/types/core/ui/popup/popup.d.ts +2 -1
- package/types/core/view/view-with-toolbar.d.ts +4 -2
- package/types/jodit.d.ts +6 -6
- package/types/modules/file-browser/file-browser.d.ts +3 -2
- package/types/modules/file-browser/listeners/native-listeners.d.ts +5 -1
- package/types/modules/file-browser/ui/files/files.d.ts +10 -0
- package/types/modules/file-browser/ui/index.d.ts +7 -0
- package/types/modules/file-browser/ui/tree/tree.d.ts +10 -0
- package/types/modules/status-bar/status-bar.d.ts +6 -1
- package/types/modules/toolbar/button/button.d.ts +1 -1
- package/types/modules/toolbar/collection/collection.d.ts +5 -2
- package/types/modules/toolbar/collection/editor-collection.d.ts +9 -1
- package/types/modules/widget/tabs/tabs.d.ts +2 -1
- package/types/plugins/index.d.ts +1 -0
- package/types/plugins/inline-popup/inline-popup.d.ts +4 -0
- package/types/plugins/keyboard/delete.d.ts +2 -0
- package/types/plugins/ordered-list.d.ts +8 -1
- package/types/plugins/powered-by-jodit.d.ts +12 -0
- package/types/plugins/source/const.d.ts +6 -0
- package/types/plugins/source/editor/engines/ace.d.ts +1 -0
- package/types/plugins/source/source.d.ts +1 -0
- package/types/styles/icons/index.d.ts +2 -1
- package/types/types/storage.d.ts +3 -3
- package/types/types/{ajax.d.ts → types/ajax.d.ts} +0 -1
- package/types/types/{async.d.ts → types/async.d.ts} +0 -0
- package/types/types/{context.d.ts → types/context.d.ts} +0 -0
- package/types/types/{core.ts → types/core.ts} +0 -0
- package/types/types/{create.d.ts → types/create.d.ts} +0 -0
- package/types/types/{dialog.d.ts → types/dialog.d.ts} +0 -0
- package/types/types/{events.d.ts → types/events.d.ts} +0 -0
- package/types/types/{file-browser.d.ts → types/file-browser.d.ts} +13 -1
- package/types/types/{form.d.ts → types/form.d.ts} +0 -0
- package/types/types/{index.d.ts → types/index.d.ts} +0 -0
- package/types/types/{jodit.d.ts → types/jodit.d.ts} +4 -1
- package/types/types/{observe.d.ts → types/observe.d.ts} +0 -0
- package/types/types/{plugin.d.ts → types/plugin.d.ts} +0 -0
- package/types/types/{popup.d.ts → types/popup.d.ts} +1 -0
- package/types/types/{select.d.ts → types/select.d.ts} +2 -0
- package/types/types/{source.d.ts → types/source.d.ts} +0 -0
- package/types/types/{storage.ts → types/storage.ts} +3 -3
- package/types/types/{style.d.ts → types/style.d.ts} +8 -0
- package/types/types/{toolbar.d.ts → types/toolbar.d.ts} +9 -2
- package/types/types/{traits.d.ts → types/traits.d.ts} +0 -0
- package/types/types/{types.d.ts → types/types.d.ts} +1 -1
- package/types/types/{ui.d.ts → types/ui.d.ts} +23 -4
- package/types/types/{uploader.d.ts → types/uploader.d.ts} +0 -0
- package/types/types/{view.d.ts → types/view.d.ts} +1 -0
- package/src/core/selection/style/api/post-process-list-element.ts +0 -33
- package/src/core/selection/style/api/toggle-styles.ts +0 -74
- package/types/modules/file-browser/consts.d.ts +0 -8
|
@@ -4,10 +4,14 @@
|
|
|
4
4
|
* Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type {
|
|
7
|
+
import type {
|
|
8
|
+
HTMLTagNames,
|
|
9
|
+
IFileBrowserItem,
|
|
10
|
+
Nullable,
|
|
11
|
+
IDictionary
|
|
12
|
+
} from '../../../types';
|
|
8
13
|
import type { FileBrowser } from '../file-browser';
|
|
9
14
|
import { ctrlKey, attr } from '../../../core/helpers';
|
|
10
|
-
import { F_CLASS, ITEM_CLASS } from '../consts';
|
|
11
15
|
import contextMenu from '../builders/context-menu';
|
|
12
16
|
import { Dom } from '../../../core/dom';
|
|
13
17
|
|
|
@@ -18,20 +22,26 @@ export const getItem = (
|
|
|
18
22
|
): Nullable<HTMLElement> =>
|
|
19
23
|
Dom.closest(node as Node, elm => Dom.isTag(elm, tag), root);
|
|
20
24
|
|
|
25
|
+
export const elementToItem = (
|
|
26
|
+
elm: HTMLElement,
|
|
27
|
+
elementsMap: IDictionary<{
|
|
28
|
+
elm: HTMLElement;
|
|
29
|
+
item: IFileBrowserItem;
|
|
30
|
+
}>
|
|
31
|
+
): IFileBrowserItem | void => {
|
|
32
|
+
const { key } = elm.dataset,
|
|
33
|
+
{ item } = elementsMap[key || ''];
|
|
34
|
+
|
|
35
|
+
return item;
|
|
36
|
+
};
|
|
37
|
+
|
|
21
38
|
export function nativeListeners(this: FileBrowser): void {
|
|
22
39
|
let dragElement: false | HTMLElement = false;
|
|
23
40
|
|
|
24
41
|
const self = this;
|
|
25
42
|
|
|
26
|
-
const elementToItem = (elm: HTMLElement): IFileBrowserItem | void => {
|
|
27
|
-
const { key } = elm.dataset,
|
|
28
|
-
{ item } = self.elementsMap[key || ''];
|
|
29
|
-
|
|
30
|
-
return item;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
43
|
self.e
|
|
34
|
-
.on(self.tree, 'dragstart', (e: MouseEvent): void => {
|
|
44
|
+
.on(self.tree.container, 'dragstart', (e: MouseEvent): void => {
|
|
35
45
|
const a = getItem(e.target, self.dialog.container);
|
|
36
46
|
|
|
37
47
|
if (!a) {
|
|
@@ -42,20 +52,26 @@ export function nativeListeners(this: FileBrowser): void {
|
|
|
42
52
|
dragElement = a;
|
|
43
53
|
}
|
|
44
54
|
})
|
|
45
|
-
.on(self.tree, 'drop', (e: MouseEvent): boolean | void => {
|
|
55
|
+
.on(self.tree.container, 'drop', (e: MouseEvent): boolean | void => {
|
|
46
56
|
if ((self.o.moveFile || self.o.moveFolder) && dragElement) {
|
|
47
57
|
let path = attr(dragElement, '-path') || '';
|
|
48
58
|
|
|
49
59
|
// move folder
|
|
50
60
|
if (
|
|
51
61
|
!self.o.moveFolder &&
|
|
52
|
-
dragElement.classList.contains(
|
|
62
|
+
dragElement.classList.contains(
|
|
63
|
+
this.tree.getFullElName('item')
|
|
64
|
+
)
|
|
53
65
|
) {
|
|
54
66
|
return false;
|
|
55
67
|
}
|
|
56
68
|
|
|
57
69
|
// move file
|
|
58
|
-
if (
|
|
70
|
+
if (
|
|
71
|
+
dragElement.classList.contains(
|
|
72
|
+
this.files.getFullElName('item')
|
|
73
|
+
)
|
|
74
|
+
) {
|
|
59
75
|
path += attr(dragElement, '-name');
|
|
60
76
|
|
|
61
77
|
if (!self.o.moveFile) {
|
|
@@ -74,7 +90,9 @@ export function nativeListeners(this: FileBrowser): void {
|
|
|
74
90
|
path,
|
|
75
91
|
attr(a, '-path') || '',
|
|
76
92
|
attr(a, '-source') || '',
|
|
77
|
-
dragElement.classList.contains(
|
|
93
|
+
dragElement.classList.contains(
|
|
94
|
+
this.files.getFullElName('item')
|
|
95
|
+
)
|
|
78
96
|
)
|
|
79
97
|
.then(() => {
|
|
80
98
|
self.loadTree();
|
|
@@ -83,20 +101,20 @@ export function nativeListeners(this: FileBrowser): void {
|
|
|
83
101
|
dragElement = false;
|
|
84
102
|
}
|
|
85
103
|
})
|
|
86
|
-
.on(self.files, 'contextmenu', contextMenu(self))
|
|
87
|
-
.on(self.files, 'click', (e: MouseEvent): void => {
|
|
104
|
+
.on(self.files.container, 'contextmenu', contextMenu(self))
|
|
105
|
+
.on(self.files.container, 'click', (e: MouseEvent): void => {
|
|
88
106
|
if (!ctrlKey(e)) {
|
|
89
107
|
this.state.activeElements = [];
|
|
90
108
|
}
|
|
91
109
|
})
|
|
92
|
-
.on(self.files, 'click', (e: MouseEvent): false | void => {
|
|
110
|
+
.on(self.files.container, 'click', (e: MouseEvent): false | void => {
|
|
93
111
|
const a = getItem(e.target, self.dialog.container);
|
|
94
112
|
|
|
95
113
|
if (!a) {
|
|
96
114
|
return;
|
|
97
115
|
}
|
|
98
116
|
|
|
99
|
-
const item = elementToItem(a);
|
|
117
|
+
const item = elementToItem(a, self.elementsMap);
|
|
100
118
|
|
|
101
119
|
if (!item) {
|
|
102
120
|
return;
|
|
@@ -115,7 +133,7 @@ export function nativeListeners(this: FileBrowser): void {
|
|
|
115
133
|
|
|
116
134
|
return false;
|
|
117
135
|
})
|
|
118
|
-
.on(self.files, 'dragstart', (e: MouseEvent) => {
|
|
136
|
+
.on(self.files.container, 'dragstart', (e: MouseEvent) => {
|
|
119
137
|
if (self.o.moveFile) {
|
|
120
138
|
const a = getItem(e.target, self.dialog.container);
|
|
121
139
|
|
|
@@ -6,13 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
import type { IFileBrowserItem } from '../../../types';
|
|
8
8
|
import type { FileBrowser } from '../file-browser';
|
|
9
|
-
import { F_CLASS, ITEM_CLASS } from '../consts';
|
|
10
9
|
import { Dom } from '../../../core/dom';
|
|
11
10
|
import { normalizePath } from '../../../core/helpers/normalize';
|
|
12
11
|
import { Button } from '../../../core/ui';
|
|
13
12
|
|
|
14
|
-
const DEFAULT_SOURCE_NAME = 'default'
|
|
15
|
-
ITEM_ACTIVE_CLASS = ITEM_CLASS + '_active_true';
|
|
13
|
+
const DEFAULT_SOURCE_NAME = 'default';
|
|
16
14
|
|
|
17
15
|
/**
|
|
18
16
|
* Convert state to view
|
|
@@ -49,6 +47,15 @@ export function stateListeners(this: FileBrowser): void {
|
|
|
49
47
|
.on(
|
|
50
48
|
['change.currentPath', 'change.currentSource'],
|
|
51
49
|
this.async.debounce(() => {
|
|
50
|
+
if (
|
|
51
|
+
this.o.saveStateInStorage &&
|
|
52
|
+
this.o.saveStateInStorage.storeLastOpenedFolder
|
|
53
|
+
) {
|
|
54
|
+
this.storage
|
|
55
|
+
.set('currentPath', this.state.currentPath)
|
|
56
|
+
.set('currentSource', this.state.currentSource);
|
|
57
|
+
}
|
|
58
|
+
|
|
52
59
|
this.loadTree();
|
|
53
60
|
}, this.defaultTimeout)
|
|
54
61
|
)
|
|
@@ -57,7 +64,10 @@ export function stateListeners(this: FileBrowser): void {
|
|
|
57
64
|
const key = item.uniqueHashKey,
|
|
58
65
|
{ elm } = elementsMap[key];
|
|
59
66
|
|
|
60
|
-
elm &&
|
|
67
|
+
elm &&
|
|
68
|
+
elm.classList.remove(
|
|
69
|
+
files.getFullElName('item', 'active', true)
|
|
70
|
+
);
|
|
61
71
|
});
|
|
62
72
|
})
|
|
63
73
|
|
|
@@ -68,35 +78,45 @@ export function stateListeners(this: FileBrowser): void {
|
|
|
68
78
|
const key = item.uniqueHashKey,
|
|
69
79
|
{ elm } = elementsMap[key];
|
|
70
80
|
|
|
71
|
-
elm &&
|
|
81
|
+
elm &&
|
|
82
|
+
elm.classList.add(
|
|
83
|
+
files.getFullElName('item', 'active', true)
|
|
84
|
+
);
|
|
72
85
|
});
|
|
73
86
|
})
|
|
74
87
|
|
|
75
88
|
.on('change.view', () => {
|
|
76
|
-
files.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
89
|
+
files.setMod('view', state.view);
|
|
90
|
+
if (
|
|
91
|
+
this.o.saveStateInStorage &&
|
|
92
|
+
this.o.saveStateInStorage.storeView
|
|
93
|
+
) {
|
|
94
|
+
this.storage.set('view', state.view);
|
|
95
|
+
}
|
|
81
96
|
})
|
|
82
97
|
|
|
83
98
|
.on('change.sortBy', () => {
|
|
84
|
-
|
|
99
|
+
if (
|
|
100
|
+
this.o.saveStateInStorage &&
|
|
101
|
+
this.o.saveStateInStorage.storeSortBy
|
|
102
|
+
) {
|
|
103
|
+
this.storage.set('sortBy', state.sortBy);
|
|
104
|
+
}
|
|
85
105
|
})
|
|
86
106
|
|
|
87
107
|
.on(
|
|
88
108
|
'change.elements',
|
|
89
109
|
this.async.debounce(() => {
|
|
90
|
-
Dom.detach(files);
|
|
110
|
+
Dom.detach(files.container);
|
|
91
111
|
|
|
92
112
|
if (state.elements.length) {
|
|
93
113
|
state.elements.forEach(item => {
|
|
94
|
-
this.files.appendChild(getDomElement(item));
|
|
114
|
+
this.files.container.appendChild(getDomElement(item));
|
|
95
115
|
});
|
|
96
116
|
} else {
|
|
97
|
-
files.appendChild(
|
|
117
|
+
files.container.appendChild(
|
|
98
118
|
create.div(
|
|
99
|
-
|
|
119
|
+
this.componentName + '_no-files_true',
|
|
100
120
|
this.i18n('There are no files')
|
|
101
121
|
)
|
|
102
122
|
);
|
|
@@ -107,20 +127,23 @@ export function stateListeners(this: FileBrowser): void {
|
|
|
107
127
|
.on(
|
|
108
128
|
'change.sources',
|
|
109
129
|
this.async.debounce(() => {
|
|
110
|
-
Dom.detach(this.tree);
|
|
130
|
+
Dom.detach(this.tree.container);
|
|
111
131
|
|
|
112
132
|
state.sources.forEach(source => {
|
|
113
133
|
const sourceName = source.name;
|
|
114
134
|
|
|
115
135
|
if (sourceName && sourceName !== DEFAULT_SOURCE_NAME) {
|
|
116
|
-
this.tree.appendChild(
|
|
117
|
-
create.div(
|
|
136
|
+
this.tree.container.appendChild(
|
|
137
|
+
create.div(
|
|
138
|
+
this.tree.getFullElName('source-title'),
|
|
139
|
+
sourceName
|
|
140
|
+
)
|
|
118
141
|
);
|
|
119
142
|
}
|
|
120
143
|
|
|
121
144
|
source.folders.forEach((name: string) => {
|
|
122
145
|
const folderElm = create.a(
|
|
123
|
-
|
|
146
|
+
this.tree.getFullElName('item'),
|
|
124
147
|
{
|
|
125
148
|
draggable: 'draggable',
|
|
126
149
|
href: '#',
|
|
@@ -132,7 +155,10 @@ export function stateListeners(this: FileBrowser): void {
|
|
|
132
155
|
'data-source': sourceName,
|
|
133
156
|
'data-source-path': source.path
|
|
134
157
|
},
|
|
135
|
-
create.span(
|
|
158
|
+
create.span(
|
|
159
|
+
this.tree.getFullElName('item-title'),
|
|
160
|
+
name
|
|
161
|
+
)
|
|
136
162
|
);
|
|
137
163
|
|
|
138
164
|
const action =
|
|
@@ -149,7 +175,7 @@ export function stateListeners(this: FileBrowser): void {
|
|
|
149
175
|
|
|
150
176
|
this.e.on(folderElm, 'click', action('openFolder'));
|
|
151
177
|
|
|
152
|
-
this.tree.appendChild(folderElm);
|
|
178
|
+
this.tree.container.appendChild(folderElm);
|
|
153
179
|
|
|
154
180
|
if (name === '..' || name === '.') {
|
|
155
181
|
return;
|
|
@@ -206,7 +232,7 @@ export function stateListeners(this: FileBrowser): void {
|
|
|
206
232
|
});
|
|
207
233
|
});
|
|
208
234
|
|
|
209
|
-
this.tree.
|
|
235
|
+
this.tree.append(button);
|
|
210
236
|
}
|
|
211
237
|
});
|
|
212
238
|
}, this.defaultTimeout)
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
height: 100%;
|
|
21
21
|
font-family: var(--font-default);
|
|
22
22
|
|
|
23
|
-
&
|
|
23
|
+
&_no-files_true {
|
|
24
24
|
padding: var(--padding-default);
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
width: 100%;
|
|
36
36
|
height: 100%;
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
div {
|
|
39
39
|
position: absolute;
|
|
40
40
|
top: 50%;
|
|
41
41
|
left: 50%;
|
|
@@ -62,302 +62,15 @@
|
|
|
62
62
|
visibility: hidden;
|
|
63
63
|
word-break: break-all;
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
&_success_true {
|
|
66
66
|
color: #c5c5c5;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
&_active_true {
|
|
70
70
|
opacity: 1;
|
|
71
71
|
visibility: visible;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
&__tree,
|
|
76
|
-
&__files {
|
|
77
|
-
position: relative;
|
|
78
|
-
display: none;
|
|
79
|
-
height: 100%;
|
|
80
|
-
vertical-align: top;
|
|
81
|
-
|
|
82
|
-
.jodit-button {
|
|
83
|
-
border-radius: 0;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&.jodit-filebrowser_active {
|
|
87
|
-
display: flex;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.scrollbarSlim();
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
&__tree.jodit-filebrowser_active {
|
|
94
|
-
z-index: 2;
|
|
95
|
-
width: var(--first_column);
|
|
96
|
-
min-width: 200px;
|
|
97
|
-
max-width: 290px;
|
|
98
|
-
flex-direction: column;
|
|
99
|
-
|
|
100
|
-
@media (max-width: @screen-xs) {
|
|
101
|
-
width: auto;
|
|
102
|
-
max-width: 100%;
|
|
103
|
-
height: 100px;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
background-color: var(--color-background-filebrowser-folders);
|
|
107
|
-
overflow-y: auto;
|
|
108
|
-
|
|
109
|
-
&::-webkit-scrollbar {
|
|
110
|
-
width: calc(var(--padding-default) / 2);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
&::-webkit-scrollbar-track {
|
|
114
|
-
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
&::-webkit-scrollbar-thumb {
|
|
118
|
-
background-color: rgba(127, 127, 127, 0.5);
|
|
119
|
-
outline: 1px solid slategrey;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.jodit-filebrowser__source-title {
|
|
123
|
-
position: relative;
|
|
124
|
-
display: block;
|
|
125
|
-
padding: 2px 4px;
|
|
126
|
-
border-bottom: 1px solid #484848;
|
|
127
|
-
background: #5a5a5a;
|
|
128
|
-
color: #969696;
|
|
129
|
-
font-size: 12px;
|
|
130
|
-
user-select: none;
|
|
131
|
-
word-break: break-all;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
--text-color: #b1b1b1;
|
|
135
|
-
|
|
136
|
-
.jodit-filebrowser__tree-item {
|
|
137
|
-
position: relative;
|
|
138
|
-
display: flex;
|
|
139
|
-
min-height: 38px;
|
|
140
|
-
align-items: center;
|
|
141
|
-
justify-content: space-between;
|
|
142
|
-
padding: calc(var(--padding-default) / 2) var(--padding-default);
|
|
143
|
-
border-bottom: 1px solid #474747;
|
|
144
|
-
color: var(--text-color);
|
|
145
|
-
text-decoration: none;
|
|
146
|
-
transition: background-color 0.2s ease 0s;
|
|
147
|
-
word-break: break-all;
|
|
148
|
-
|
|
149
|
-
&-title {
|
|
150
|
-
flex: 1;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.jodit-icon_folder {
|
|
154
|
-
display: flex;
|
|
155
|
-
width: calc(var(--icon-size) + 4px);
|
|
156
|
-
height: calc(var(--icon-size) + 4px);
|
|
157
|
-
|
|
158
|
-
align-items: center;
|
|
159
|
-
justify-content: center;
|
|
160
|
-
|
|
161
|
-
margin-left: calc(var(--padding-default) / 2);
|
|
162
|
-
|
|
163
|
-
opacity: 0.3;
|
|
164
|
-
|
|
165
|
-
& svg {
|
|
166
|
-
width: var(--icon-size);
|
|
167
|
-
height: var(--icon-size);
|
|
168
|
-
fill: var(--text-color) !important;
|
|
169
|
-
stroke: var(--text-color) !important;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
&:hover {
|
|
173
|
-
background: #696969;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
&:hover {
|
|
178
|
-
background-color: var(--color-background-button-hover);
|
|
179
|
-
color: #222;
|
|
180
|
-
|
|
181
|
-
i.jodit-icon_folder {
|
|
182
|
-
opacity: 0.6;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
&__files.jodit-filebrowser_active {
|
|
189
|
-
width: 100%;
|
|
190
|
-
flex-wrap: wrap;
|
|
191
|
-
align-content: flex-start;
|
|
192
|
-
padding: calc(var(--padding-default) / 2);
|
|
193
|
-
overflow-y: auto;
|
|
194
|
-
|
|
195
|
-
.jodit-filebrowser__source-title {
|
|
196
|
-
position: relative;
|
|
197
|
-
display: block;
|
|
198
|
-
padding: var(--padding-default);
|
|
199
|
-
margin: calc(var(--padding-default) * -1);
|
|
200
|
-
margin-bottom: 0;
|
|
201
|
-
background: #5a5a5a;
|
|
202
|
-
color: #969696;
|
|
203
|
-
font-size: 16px;
|
|
204
|
-
user-select: none;
|
|
205
|
-
word-break: break-all;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
a + .jodit-filebrowser__source-title {
|
|
209
|
-
margin-top: var(--padding-default);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
.jodit-filebrowser__files-item {
|
|
213
|
-
position: relative;
|
|
214
|
-
|
|
215
|
-
display: flex;
|
|
216
|
-
overflow: hidden;
|
|
217
|
-
width: var(--col_size);
|
|
218
|
-
height: var(--col_size);
|
|
219
|
-
|
|
220
|
-
align-items: center;
|
|
221
|
-
justify-content: center;
|
|
222
|
-
|
|
223
|
-
border: 1px solid var(--color-border);
|
|
224
|
-
margin: calc(var(--padding-default) / 2);
|
|
225
|
-
font-size: 0;
|
|
226
|
-
|
|
227
|
-
@media (max-width: @screen-xs) {
|
|
228
|
-
width: calc(50% - var(--padding-default));
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
text-align: center;
|
|
232
|
-
transition: border 0.1s linear, bottom 0.1s linear;
|
|
233
|
-
|
|
234
|
-
img {
|
|
235
|
-
max-width: 100%;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
&:hover {
|
|
239
|
-
border-color: #433b5c;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
&_active_true {
|
|
243
|
-
border-color: var(--color-border-selected);
|
|
244
|
-
background-color: var(--color-border-active);
|
|
245
|
-
|
|
246
|
-
.jodit-filebrowser__files-item-info {
|
|
247
|
-
background-color: var(--color-border-active);
|
|
248
|
-
color: white;
|
|
249
|
-
text-shadow: none;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
&-info {
|
|
254
|
-
position: absolute;
|
|
255
|
-
right: 0;
|
|
256
|
-
bottom: 0;
|
|
257
|
-
left: 0;
|
|
258
|
-
overflow: visible;
|
|
259
|
-
padding: 0.3em 0.6em;
|
|
260
|
-
background-color: var(--info-background);
|
|
261
|
-
color: rgb(51, 51, 51);
|
|
262
|
-
font-size: 14px;
|
|
263
|
-
line-height: 16px;
|
|
264
|
-
opacity: 0.85;
|
|
265
|
-
text-align: left;
|
|
266
|
-
text-shadow: rgb(238, 238, 238) 0 1px 0;
|
|
267
|
-
transition: opacity 400ms ease;
|
|
268
|
-
white-space: normal;
|
|
269
|
-
|
|
270
|
-
> span {
|
|
271
|
-
display: block;
|
|
272
|
-
overflow: hidden;
|
|
273
|
-
font-size: 0.75em;
|
|
274
|
-
text-overflow: ellipsis;
|
|
275
|
-
white-space: nowrap;
|
|
276
|
-
|
|
277
|
-
&.jodit-filebrowser__files-item-info-filename {
|
|
278
|
-
font-size: 0.9em;
|
|
279
|
-
font-weight: bold;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
&:hover:not(.jodit-filebrowser__files-item_active_true) {
|
|
285
|
-
.jodit-filebrowser__files-item-info {
|
|
286
|
-
bottom: -100px;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
&.jodit-filebrowser__files_view_list {
|
|
292
|
-
scroll-behavior: smooth;
|
|
293
|
-
|
|
294
|
-
a {
|
|
295
|
-
display: block;
|
|
296
|
-
width: 100%;
|
|
297
|
-
height: 26px;
|
|
298
|
-
border-width: 0 0 1px 0;
|
|
299
|
-
margin: 0;
|
|
300
|
-
line-height: 26px;
|
|
301
|
-
text-align: left;
|
|
302
|
-
white-space: nowrap;
|
|
303
|
-
|
|
304
|
-
img {
|
|
305
|
-
display: inline-block;
|
|
306
|
-
min-width: 16px;
|
|
307
|
-
max-width: 16px;
|
|
308
|
-
margin-left: 4px;
|
|
309
|
-
vertical-align: middle;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
.jodit-filebrowser__files-item-info {
|
|
313
|
-
position: static;
|
|
314
|
-
display: inline-block;
|
|
315
|
-
width: ~'calc(100% - 20px)';
|
|
316
|
-
height: 100%;
|
|
317
|
-
padding: 0;
|
|
318
|
-
margin-left: 4px;
|
|
319
|
-
background-color: transparent;
|
|
320
|
-
font-size: 0;
|
|
321
|
-
line-height: inherit;
|
|
322
|
-
vertical-align: middle;
|
|
323
|
-
|
|
324
|
-
> span {
|
|
325
|
-
display: inline-block;
|
|
326
|
-
height: 100%;
|
|
327
|
-
font-size: 12px;
|
|
328
|
-
|
|
329
|
-
&.jodit-filebrowser__files-item-info-filename {
|
|
330
|
-
width: 50%;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
&.jodit-filebrowser__files-item-info-filesize {
|
|
334
|
-
width: 25%;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
&.jodit-filebrowser__files-item-info-filechanged {
|
|
338
|
-
width: 25%;
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
&:hover {
|
|
344
|
-
background-color: #433b5c;
|
|
345
|
-
|
|
346
|
-
.jodit-filebrowser__files-item-info {
|
|
347
|
-
color: #fff;
|
|
348
|
-
text-shadow: none;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
&::before {
|
|
353
|
-
display: inline-block;
|
|
354
|
-
height: 100%;
|
|
355
|
-
content: '';
|
|
356
|
-
vertical-align: middle;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
74
|
}
|
|
362
75
|
|
|
363
76
|
.jodit_draghover {
|
|
@@ -6,18 +6,20 @@
|
|
|
6
6
|
|
|
7
7
|
@import (reference) '../../../styles/variables';
|
|
8
8
|
|
|
9
|
-
.jodit-
|
|
9
|
+
.jodit-filebrowser-preview {
|
|
10
10
|
position: relative;
|
|
11
11
|
display: flex;
|
|
12
12
|
|
|
13
|
-
min-width:
|
|
14
|
-
max-width: 1000px;
|
|
15
|
-
|
|
13
|
+
min-width: 400px;
|
|
14
|
+
max-width: min(100%, 1000px);
|
|
15
|
+
height: 100%;
|
|
16
|
+
min-height: min(100%, 500px);
|
|
16
17
|
max-height: 100%;
|
|
17
18
|
|
|
18
19
|
align-items: center;
|
|
19
20
|
justify-content: center;
|
|
20
21
|
|
|
22
|
+
margin: auto;
|
|
21
23
|
text-align: center;
|
|
22
24
|
|
|
23
25
|
@media (max-width: @screen-sm) {
|
|
@@ -28,20 +30,21 @@
|
|
|
28
30
|
max-height: 100%;
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
&
|
|
33
|
+
&__box {
|
|
32
34
|
display: flex;
|
|
33
35
|
flex-grow: 1;
|
|
34
36
|
align-items: center;
|
|
35
37
|
justify-content: center;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
&
|
|
40
|
+
&__navigation {
|
|
39
41
|
position: absolute;
|
|
40
42
|
top: 0;
|
|
41
43
|
left: 0;
|
|
42
44
|
height: 100%;
|
|
45
|
+
cursor: pointer;
|
|
43
46
|
|
|
44
|
-
|
|
47
|
+
&_arrow_next {
|
|
45
48
|
right: 0;
|
|
46
49
|
left: auto;
|
|
47
50
|
}
|
|
@@ -51,8 +54,8 @@
|
|
|
51
54
|
top: 50%;
|
|
52
55
|
width: 45px;
|
|
53
56
|
height: 45px;
|
|
54
|
-
margin-top: -22px;
|
|
55
57
|
fill: #9e9ba7;
|
|
58
|
+
transform: translateY(-50%);
|
|
56
59
|
transition: fill 0.3s linear;
|
|
57
60
|
}
|
|
58
61
|
|