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
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
@import (reference) '../../../../styles/variables';
|
|
2
|
+
@import (reference) '../../../../styles/mixins';
|
|
3
|
+
|
|
4
|
+
.jodit-filebrowser-files {
|
|
5
|
+
position: relative;
|
|
6
|
+
display: none;
|
|
7
|
+
height: 100%;
|
|
8
|
+
vertical-align: top;
|
|
9
|
+
|
|
10
|
+
.jodit-button {
|
|
11
|
+
border-radius: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&_active_true {
|
|
15
|
+
display: flex;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.scrollbarSlim();
|
|
19
|
+
|
|
20
|
+
&_active_true {
|
|
21
|
+
width: 100%;
|
|
22
|
+
flex-wrap: wrap;
|
|
23
|
+
align-content: flex-start;
|
|
24
|
+
padding: calc(var(--padding-default) / 2);
|
|
25
|
+
overflow-y: auto;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&__item {
|
|
29
|
+
position: relative;
|
|
30
|
+
|
|
31
|
+
display: flex;
|
|
32
|
+
overflow: hidden;
|
|
33
|
+
width: var(--col_size);
|
|
34
|
+
height: var(--col_size);
|
|
35
|
+
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
|
|
39
|
+
border: 1px solid var(--color-border);
|
|
40
|
+
margin: calc(var(--padding-default) / 2);
|
|
41
|
+
font-size: 0;
|
|
42
|
+
|
|
43
|
+
@media (max-width: @screen-xs) {
|
|
44
|
+
width: calc(50% - var(--padding-default));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
text-align: center;
|
|
48
|
+
transition: border 0.1s linear, bottom 0.1s linear;
|
|
49
|
+
|
|
50
|
+
img {
|
|
51
|
+
max-width: 100%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:hover {
|
|
55
|
+
border-color: #433b5c;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&_active_true {
|
|
59
|
+
border-color: var(--color-border-selected);
|
|
60
|
+
background-color: var(--color-border-active);
|
|
61
|
+
|
|
62
|
+
.jodit-filebrowser-files__item-info {
|
|
63
|
+
background-color: var(--color-border-active);
|
|
64
|
+
color: white;
|
|
65
|
+
text-shadow: none;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&-info {
|
|
70
|
+
position: absolute;
|
|
71
|
+
right: 0;
|
|
72
|
+
bottom: 0;
|
|
73
|
+
left: 0;
|
|
74
|
+
overflow: visible;
|
|
75
|
+
padding: 0.3em 0.6em;
|
|
76
|
+
background-color: var(--info-background);
|
|
77
|
+
color: rgb(51, 51, 51);
|
|
78
|
+
font-size: 14px;
|
|
79
|
+
line-height: 16px;
|
|
80
|
+
opacity: 0.85;
|
|
81
|
+
text-align: left;
|
|
82
|
+
text-shadow: rgb(238, 238, 238) 0 1px 0;
|
|
83
|
+
transition: opacity 400ms ease;
|
|
84
|
+
white-space: normal;
|
|
85
|
+
|
|
86
|
+
> span {
|
|
87
|
+
display: block;
|
|
88
|
+
overflow: hidden;
|
|
89
|
+
font-size: 0.75em;
|
|
90
|
+
text-overflow: ellipsis;
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
|
|
93
|
+
&.jodit-filebrowser-files__item-info-filename {
|
|
94
|
+
font-size: 0.9em;
|
|
95
|
+
font-weight: bold;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&:hover:not(&_active_true) &-info {
|
|
101
|
+
bottom: -100px;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&_view_list {
|
|
106
|
+
scroll-behavior: smooth;
|
|
107
|
+
|
|
108
|
+
a {
|
|
109
|
+
display: block;
|
|
110
|
+
width: 100%;
|
|
111
|
+
height: 26px;
|
|
112
|
+
border-width: 0 0 1px 0;
|
|
113
|
+
margin: 0;
|
|
114
|
+
line-height: 26px;
|
|
115
|
+
text-align: left;
|
|
116
|
+
white-space: nowrap;
|
|
117
|
+
|
|
118
|
+
img {
|
|
119
|
+
display: inline-block;
|
|
120
|
+
min-width: 16px;
|
|
121
|
+
max-width: 16px;
|
|
122
|
+
margin-left: 4px;
|
|
123
|
+
vertical-align: middle;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.jodit-filebrowser-files__item-info {
|
|
127
|
+
position: static;
|
|
128
|
+
display: inline-block;
|
|
129
|
+
width: ~'calc(100% - 20px)';
|
|
130
|
+
height: 100%;
|
|
131
|
+
padding: 0;
|
|
132
|
+
margin-left: 4px;
|
|
133
|
+
background-color: transparent;
|
|
134
|
+
font-size: 0;
|
|
135
|
+
line-height: inherit;
|
|
136
|
+
vertical-align: middle;
|
|
137
|
+
|
|
138
|
+
> span {
|
|
139
|
+
display: inline-block;
|
|
140
|
+
height: 100%;
|
|
141
|
+
font-size: 12px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&-filename {
|
|
145
|
+
width: 50%;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&-filesize {
|
|
149
|
+
width: 25%;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
&-filechanged {
|
|
153
|
+
width: 25%;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&:hover {
|
|
158
|
+
background-color: #433b5c;
|
|
159
|
+
|
|
160
|
+
.jodit-filebrowser-files__item-info {
|
|
161
|
+
color: #fff;
|
|
162
|
+
text-shadow: none;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&::before {
|
|
167
|
+
display: inline-block;
|
|
168
|
+
height: 100%;
|
|
169
|
+
content: '';
|
|
170
|
+
vertical-align: middle;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import './files.less';
|
|
8
|
+
import { UIGroup } from '../../../../core/ui';
|
|
9
|
+
|
|
10
|
+
export class FileBrowserFiles extends UIGroup {
|
|
11
|
+
override className(): string {
|
|
12
|
+
return 'FilebrowserFiles';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export * from './files/files';
|
|
8
|
+
export * from './tree/tree';
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
@import (reference) '../../../../styles/variables';
|
|
2
|
+
@import (reference) '../../../../styles/mixins';
|
|
3
|
+
|
|
4
|
+
.jodit-filebrowser-tree {
|
|
5
|
+
position: relative;
|
|
6
|
+
display: none;
|
|
7
|
+
height: 100%;
|
|
8
|
+
vertical-align: top;
|
|
9
|
+
|
|
10
|
+
.jodit-button {
|
|
11
|
+
border-radius: 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&_active_true {
|
|
15
|
+
display: flex;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.scrollbarSlim();
|
|
19
|
+
|
|
20
|
+
&_active_true {
|
|
21
|
+
z-index: 2;
|
|
22
|
+
width: var(--first_column);
|
|
23
|
+
min-width: 200px;
|
|
24
|
+
max-width: 290px;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
|
|
27
|
+
@media (max-width: @screen-xs) {
|
|
28
|
+
width: auto;
|
|
29
|
+
max-width: 100%;
|
|
30
|
+
height: 100px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
background-color: var(--color-background-filebrowser-folders);
|
|
34
|
+
overflow-y: auto;
|
|
35
|
+
|
|
36
|
+
&::-webkit-scrollbar {
|
|
37
|
+
width: calc(var(--padding-default) / 2);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&::-webkit-scrollbar-track {
|
|
41
|
+
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&::-webkit-scrollbar-thumb {
|
|
45
|
+
background-color: rgba(127, 127, 127, 0.5);
|
|
46
|
+
outline: 1px solid slategrey;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
--text-color: #b1b1b1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&__item {
|
|
53
|
+
position: relative;
|
|
54
|
+
display: flex;
|
|
55
|
+
min-height: 38px;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
padding: calc(var(--padding-default) / 2) var(--padding-default);
|
|
59
|
+
border-bottom: 1px solid #474747;
|
|
60
|
+
color: var(--text-color);
|
|
61
|
+
text-decoration: none;
|
|
62
|
+
transition: background-color 0.2s ease 0s;
|
|
63
|
+
word-break: break-all;
|
|
64
|
+
|
|
65
|
+
&-title {
|
|
66
|
+
flex: 1;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.jodit-icon_folder {
|
|
70
|
+
display: flex;
|
|
71
|
+
width: calc(var(--icon-size) + 4px);
|
|
72
|
+
height: calc(var(--icon-size) + 4px);
|
|
73
|
+
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: center;
|
|
76
|
+
|
|
77
|
+
margin-left: calc(var(--padding-default) / 2);
|
|
78
|
+
|
|
79
|
+
opacity: 0.3;
|
|
80
|
+
|
|
81
|
+
& svg {
|
|
82
|
+
width: var(--icon-size);
|
|
83
|
+
height: var(--icon-size);
|
|
84
|
+
fill: var(--text-color) !important;
|
|
85
|
+
stroke: var(--text-color) !important;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&:hover {
|
|
89
|
+
background: #696969;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&:hover {
|
|
94
|
+
background-color: var(--color-background-button-hover);
|
|
95
|
+
color: #222;
|
|
96
|
+
|
|
97
|
+
i.jodit-icon_folder {
|
|
98
|
+
opacity: 0.6;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&__source-title {
|
|
104
|
+
position: relative;
|
|
105
|
+
display: block;
|
|
106
|
+
padding: 2px 4px;
|
|
107
|
+
border-bottom: 1px solid #484848;
|
|
108
|
+
background: #5a5a5a;
|
|
109
|
+
color: #969696;
|
|
110
|
+
font-size: 12px;
|
|
111
|
+
user-select: none;
|
|
112
|
+
word-break: break-all;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
a + &__source-title {
|
|
116
|
+
margin-top: var(--padding-default);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2021 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import './tree.less';
|
|
8
|
+
import { UIGroup } from '../../../../core/ui';
|
|
9
|
+
|
|
10
|
+
export class FileBrowserTree extends UIGroup {
|
|
11
|
+
override className(): string {
|
|
12
|
+
return 'FilebrowserTree';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -10,12 +10,24 @@
|
|
|
10
10
|
.jodit-status-bar {
|
|
11
11
|
display: flex;
|
|
12
12
|
overflow: hidden;
|
|
13
|
+
height: 20px;
|
|
14
|
+
|
|
13
15
|
align-items: center;
|
|
14
16
|
justify-content: flex-start;
|
|
17
|
+
|
|
15
18
|
padding: 0 calc(var(--padding-default) / 2);
|
|
19
|
+
|
|
20
|
+
&_resize-handle_true {
|
|
21
|
+
padding-right: 14px;
|
|
22
|
+
}
|
|
23
|
+
|
|
16
24
|
background-color: var(--color-panel);
|
|
17
25
|
border-radius: 0 0 var(--border-radius-default) var(--border-radius-default);
|
|
26
|
+
|
|
27
|
+
color: var(--color-text-icons);
|
|
28
|
+
|
|
18
29
|
font-size: var(--font-size-small);
|
|
30
|
+
text-transform: uppercase;
|
|
19
31
|
|
|
20
32
|
&::before {
|
|
21
33
|
flex: auto;
|
|
@@ -48,11 +60,25 @@
|
|
|
48
60
|
|
|
49
61
|
&:hover {
|
|
50
62
|
background-color: var(--color-background-gray);
|
|
51
|
-
color: var(--color-text);
|
|
52
63
|
text-decoration: none;
|
|
53
64
|
}
|
|
54
65
|
}
|
|
55
66
|
}
|
|
67
|
+
|
|
68
|
+
a.jodit-status-bar-link {
|
|
69
|
+
cursor: pointer;
|
|
70
|
+
|
|
71
|
+
&,
|
|
72
|
+
&:hover,
|
|
73
|
+
&:visited {
|
|
74
|
+
background-color: transparent;
|
|
75
|
+
color: var(--color-text-icons);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&:hover {
|
|
79
|
+
text-decoration: underline;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
56
82
|
}
|
|
57
83
|
|
|
58
84
|
.jodit-workplace + .jodit-status-bar:not(:empty) {
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
import './status-bar.less';
|
|
8
8
|
|
|
9
|
-
import type { IJodit, IStatusBar } from '../../types';
|
|
9
|
+
import type { IJodit, IStatusBar, IDictionary } from '../../types';
|
|
10
10
|
import { ViewComponent, STATUSES } from '../../core/component';
|
|
11
11
|
import { Dom } from '../../core/dom';
|
|
12
|
+
import { Mods } from '../../core/traits';
|
|
12
13
|
|
|
13
14
|
export class StatusBar extends ViewComponent<IJodit> implements IStatusBar {
|
|
14
15
|
className(): string {
|
|
@@ -38,6 +39,19 @@ export class StatusBar extends ViewComponent<IJodit> implements IStatusBar {
|
|
|
38
39
|
return !this.container.classList.contains('jodit_hidden');
|
|
39
40
|
}
|
|
40
41
|
|
|
42
|
+
readonly mods: IDictionary<string | boolean | null> = {};
|
|
43
|
+
|
|
44
|
+
/** @see [[Mods.setMod]] */
|
|
45
|
+
setMod(name: string, value: string | boolean | null): this {
|
|
46
|
+
Mods.setMod.call(this, name, value);
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** @see [[Mods.getMod]] */
|
|
51
|
+
getMod(name: string): string | boolean | null {
|
|
52
|
+
return Mods.getMod.call(this, name);
|
|
53
|
+
}
|
|
54
|
+
|
|
41
55
|
/**
|
|
42
56
|
* Height of statusbar
|
|
43
57
|
*/
|
|
@@ -14,17 +14,19 @@ import type {
|
|
|
14
14
|
IControlTypeStrong,
|
|
15
15
|
IViewBased,
|
|
16
16
|
ButtonsGroups,
|
|
17
|
-
CanUndef
|
|
17
|
+
CanUndef,
|
|
18
|
+
IViewWithToolbar,
|
|
19
|
+
IBound
|
|
18
20
|
} from '../../../types/';
|
|
19
21
|
|
|
20
|
-
import {
|
|
22
|
+
import { error, isFunction } from '../../../core/helpers/';
|
|
21
23
|
|
|
22
24
|
import { UIList } from '../../../core/ui';
|
|
23
25
|
import { makeButton } from '../factory';
|
|
24
26
|
import { component, autobind } from '../../../core/decorators';
|
|
25
27
|
|
|
26
28
|
@component
|
|
27
|
-
export class ToolbarCollection<T extends
|
|
29
|
+
export class ToolbarCollection<T extends IViewWithToolbar = IViewWithToolbar>
|
|
28
30
|
extends UIList<T>
|
|
29
31
|
implements IToolbarCollection
|
|
30
32
|
{
|
|
@@ -58,10 +60,6 @@ export class ToolbarCollection<T extends IViewBased = IViewBased>
|
|
|
58
60
|
* Button should be active
|
|
59
61
|
*/
|
|
60
62
|
shouldBeActive(button: IToolbarButton): boolean | undefined {
|
|
61
|
-
if (isJoditObject(this.j) && !this.j.editorIsActive) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
63
|
if (isFunction(button.control.isActive)) {
|
|
66
64
|
return button.control.isActive(this.j, button.control, button);
|
|
67
65
|
}
|
|
@@ -136,11 +134,22 @@ export class ToolbarCollection<T extends IViewBased = IViewBased>
|
|
|
136
134
|
|
|
137
135
|
private initEvents() {
|
|
138
136
|
this.j.e
|
|
139
|
-
// .on(this.j.ow, 'mousedown touchend', this.closeAllPopups)
|
|
140
137
|
.on(this.listenEvents, this.update)
|
|
141
138
|
.on('afterSetMode focus', this.immediateUpdate);
|
|
142
139
|
}
|
|
143
140
|
|
|
141
|
+
hide(): void {
|
|
142
|
+
this.container.remove();
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
show(): void {
|
|
146
|
+
this.appendTo(this.j.toolbarContainer);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
showInline(bound?: IBound): void {
|
|
150
|
+
throw error('The method is not implemented for this class.');
|
|
151
|
+
}
|
|
152
|
+
|
|
144
153
|
/** @override **/
|
|
145
154
|
override build(
|
|
146
155
|
items: ButtonsGroups,
|
|
@@ -11,9 +11,10 @@ import type {
|
|
|
11
11
|
IDictionary,
|
|
12
12
|
IToolbarButton,
|
|
13
13
|
IViewBased,
|
|
14
|
-
IJodit
|
|
14
|
+
IJodit,
|
|
15
|
+
IBound
|
|
15
16
|
} from '../../../types';
|
|
16
|
-
import { css, isFunction } from '../../../core/helpers';
|
|
17
|
+
import { css, isFunction, isJoditObject } from '../../../core/helpers';
|
|
17
18
|
import { component } from '../../../core/decorators';
|
|
18
19
|
|
|
19
20
|
@component
|
|
@@ -41,6 +42,10 @@ export class ToolbarEditorCollection extends ToolbarCollection<IJodit> {
|
|
|
41
42
|
|
|
42
43
|
/** @override */
|
|
43
44
|
override shouldBeActive(button: IToolbarButton): boolean {
|
|
45
|
+
if (isJoditObject(this.j) && !this.j.editorIsActive) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
|
|
44
49
|
const active = super.shouldBeActive(button);
|
|
45
50
|
|
|
46
51
|
if (active !== undefined) {
|
|
@@ -160,4 +165,24 @@ export class ToolbarEditorCollection extends ToolbarCollection<IJodit> {
|
|
|
160
165
|
|
|
161
166
|
Dom.appendChildFirst(container, input);
|
|
162
167
|
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Show the inline toolbar inside WYSIWYG editor.
|
|
171
|
+
* @param bound - you can set the place for displaying the toolbar,
|
|
172
|
+
* or the place will be in the place of the cursor
|
|
173
|
+
*/
|
|
174
|
+
override showInline(bound?: IBound): void {
|
|
175
|
+
this.jodit.e.fire('showInlineToolbar', bound);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
override hide(): void {
|
|
179
|
+
this.jodit.e.fire('hidePopup');
|
|
180
|
+
super.hide();
|
|
181
|
+
this.jodit.e.fire('toggleToolbar');
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
override show(): void {
|
|
185
|
+
super.show();
|
|
186
|
+
this.jodit.e.fire('toggleToolbar');
|
|
187
|
+
}
|
|
163
188
|
}
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
|
|
20
20
|
> * {
|
|
21
21
|
margin-left: calc(var(--padding-default) / 2);
|
|
22
|
+
cursor: pointer;
|
|
22
23
|
|
|
23
24
|
&:only-of-type {
|
|
24
25
|
width: 100%;
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
min-width: 80px;
|
|
44
45
|
|
|
45
46
|
&_columns_3 {
|
|
46
|
-
width: 100% / 3;
|
|
47
|
+
width: calc(100% / 3);
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
&_columns_2 {
|
|
@@ -8,12 +8,12 @@ import './tabs.less';
|
|
|
8
8
|
|
|
9
9
|
import type { IDictionary, IJodit, IUIButton } from '../../../types';
|
|
10
10
|
import { $$, isFunction } from '../../../core/helpers';
|
|
11
|
-
import { Button } from '../../../core/ui';
|
|
11
|
+
import { Button, UIElement } from '../../../core/ui';
|
|
12
12
|
|
|
13
13
|
export interface TabOption {
|
|
14
14
|
icon?: string;
|
|
15
15
|
name: string;
|
|
16
|
-
content: HTMLElement | (() => void);
|
|
16
|
+
content: HTMLElement | (() => void) | UIElement;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -70,7 +70,9 @@ export const TabsWidget = (
|
|
|
70
70
|
);
|
|
71
71
|
|
|
72
72
|
if (!isFunction(content)) {
|
|
73
|
-
tab.appendChild(
|
|
73
|
+
tab.appendChild(
|
|
74
|
+
content instanceof UIElement ? content.container : content
|
|
75
|
+
);
|
|
74
76
|
} else {
|
|
75
77
|
tab.appendChild(editor.c.div('jodit-tab_empty'));
|
|
76
78
|
}
|
package/src/plugins/bold.ts
CHANGED
|
@@ -40,7 +40,7 @@ Config.prototype.controls.underline = {
|
|
|
40
40
|
tagRegExp: /^(u)$/i,
|
|
41
41
|
tags: ['u'],
|
|
42
42
|
css: {
|
|
43
|
-
'text-decoration': 'underline'
|
|
43
|
+
'text-decoration-line': 'underline'
|
|
44
44
|
},
|
|
45
45
|
tooltip: 'Underline'
|
|
46
46
|
} as IControlType;
|
|
@@ -49,7 +49,7 @@ Config.prototype.controls.strikethrough = {
|
|
|
49
49
|
tagRegExp: /^(s)$/i,
|
|
50
50
|
tags: ['s'],
|
|
51
51
|
css: {
|
|
52
|
-
'text-decoration': 'line-through'
|
|
52
|
+
'text-decoration-line': 'line-through'
|
|
53
53
|
},
|
|
54
54
|
tooltip: 'Strike through'
|
|
55
55
|
} as IControlType;
|
|
@@ -15,6 +15,7 @@ import { attr, ctrlKey, dataBind } from '../../core/helpers';
|
|
|
15
15
|
import { Plugin } from '../../core/plugin';
|
|
16
16
|
import { getDataTransfer } from './paste/helpers';
|
|
17
17
|
import { autobind, throttle } from '../../core/decorators';
|
|
18
|
+
import { FileBrowserFiles } from '../../modules/file-browser/ui';
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Process drag and drop image from FileBrowser and movev image inside the editor
|
|
@@ -68,7 +69,9 @@ export class DragAndDrop extends Plugin {
|
|
|
68
69
|
|
|
69
70
|
if (
|
|
70
71
|
Dom.isElement(target) &&
|
|
71
|
-
target.classList.contains(
|
|
72
|
+
target.classList.contains(
|
|
73
|
+
FileBrowserFiles.prototype.getFullElName('item')
|
|
74
|
+
)
|
|
72
75
|
) {
|
|
73
76
|
target = target.querySelector('img') as HTMLElement;
|
|
74
77
|
}
|
package/src/plugins/font.ts
CHANGED
|
@@ -114,7 +114,17 @@ Config.prototype.controls.font = {
|
|
|
114
114
|
},
|
|
115
115
|
|
|
116
116
|
childTemplate: (editor, key: string, value: string) => {
|
|
117
|
-
|
|
117
|
+
let isAvailable = false;
|
|
118
|
+
|
|
119
|
+
try {
|
|
120
|
+
isAvailable =
|
|
121
|
+
key.indexOf('dings') === -1 &&
|
|
122
|
+
document.fonts.check(`16px ${key}`, value);
|
|
123
|
+
} catch {}
|
|
124
|
+
|
|
125
|
+
return `<span style="${
|
|
126
|
+
isAvailable ? `font-family: ${key}!important;` : ''
|
|
127
|
+
}">${value}</span>`;
|
|
118
128
|
},
|
|
119
129
|
|
|
120
130
|
data: {
|
|
@@ -851,6 +851,13 @@ export class imageProperties extends Plugin {
|
|
|
851
851
|
}
|
|
852
852
|
|
|
853
853
|
if (editor.o.image.openOnDblClick) {
|
|
854
|
+
if (
|
|
855
|
+
this.j.e.fire('openOnDblClick', image) ===
|
|
856
|
+
false
|
|
857
|
+
) {
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
860
|
+
|
|
854
861
|
self.state.image = image;
|
|
855
862
|
|
|
856
863
|
if (!editor.o.readonly) {
|
package/src/plugins/index.ts
CHANGED
|
@@ -34,6 +34,7 @@ export { link } from './link/link';
|
|
|
34
34
|
export * from './media';
|
|
35
35
|
export { mobile } from './mobile';
|
|
36
36
|
export { orderedList } from './ordered-list';
|
|
37
|
+
export { poweredByJodit } from './powered-by-jodit';
|
|
37
38
|
export { placeholder } from './placeholder/placeholder';
|
|
38
39
|
export { redoUndo } from './redo-undo';
|
|
39
40
|
export { resizer } from './resizer/resizer';
|
|
@@ -34,6 +34,7 @@ Config.prototype.popup = {
|
|
|
34
34
|
a: require('./items/a').default,
|
|
35
35
|
img: require('./items/img').default,
|
|
36
36
|
cells: require('./items/cells').default,
|
|
37
|
+
toolbar: require('./items/toolbar').default,
|
|
37
38
|
jodit: require('./items/iframe').default,
|
|
38
39
|
'jodit-media': require('./items/iframe').default,
|
|
39
40
|
selection: [
|