@worktile/theia 2.3.0-next.1 → 2.3.0
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/bundles/worktile-theia.umd.js +144 -471
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/constants/default.d.ts +0 -2
- package/editor.component.d.ts +0 -2
- package/editor.module.d.ts +24 -26
- package/esm2015/constants/default.js +1 -2
- package/esm2015/editor.component.js +17 -14
- package/esm2015/editor.module.js +3 -6
- package/esm2015/interfaces/editor.js +1 -1
- package/esm2015/plugins/align/align.editor.js +6 -2
- package/esm2015/plugins/image/image.component.js +13 -8
- package/esm2015/utils/dom.js +5 -3
- package/esm2015/utils/index.js +3 -1
- package/fesm2015/worktile-theia.js +137 -462
- package/fesm2015/worktile-theia.js.map +1 -1
- package/interfaces/editor.d.ts +1 -6
- package/package.json +1 -1
- package/plugins/image/image.component.scss +0 -7
- package/plugins/table/components/table.component.scss +2 -2
- package/styles/editor.scss +160 -133
- package/styles/index.scss +1 -2
- package/styles/typo.scss +12 -1
- package/utils/index.d.ts +2 -0
- package/esm2015/plugins/dnd/component/dnd.component.js +0 -254
- package/esm2015/plugins/dnd/utils/get-current-target.js +0 -19
- package/esm2015/plugins/dnd/utils/get-hover-direction.js +0 -13
- package/esm2015/plugins/dnd/utils/is-valid-drag.js +0 -38
- package/esm2015/plugins/dnd/utils/move-drag-node.js +0 -30
- package/esm2015/plugins/dnd/utils/remove-drop-thumb-line.js +0 -10
- package/plugins/dnd/component/dnd.component.d.ts +0 -42
- package/plugins/dnd/component/dnd.component.scss +0 -60
- package/plugins/dnd/utils/get-current-target.d.ts +0 -2
- package/plugins/dnd/utils/get-hover-direction.d.ts +0 -3
- package/plugins/dnd/utils/is-valid-drag.d.ts +0 -3
- package/plugins/dnd/utils/move-drag-node.d.ts +0 -2
- package/plugins/dnd/utils/remove-drop-thumb-line.d.ts +0 -2
package/interfaces/editor.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ import { ElementOptionsInfo } from './valid-children-types';
|
|
|
5
5
|
import { Predicate } from '../utils/match';
|
|
6
6
|
import { ToolbarOption } from './toolbar';
|
|
7
7
|
import { FontSizes } from '../constants/node-types';
|
|
8
|
-
import { CustomElement } from '../custom-types';
|
|
9
8
|
export interface TheEditor extends AngularEditor, HistoryEditor {
|
|
10
9
|
renderElement: (element: Element) => ViewType;
|
|
11
10
|
renderLeaf: (text: Text) => ViewType;
|
|
@@ -75,10 +74,10 @@ export interface TheOptions {
|
|
|
75
74
|
placeholderDecorate?: (editor: Editor) => SlatePlaceholder[];
|
|
76
75
|
inlineToobarVisible?: boolean;
|
|
77
76
|
quickInsertVisible?: boolean;
|
|
78
|
-
dragAndDrop?: boolean;
|
|
79
77
|
scrollContainer?: string;
|
|
80
78
|
maxHeight?: number;
|
|
81
79
|
fontSize?: FontSizes;
|
|
80
|
+
richMedia?: boolean;
|
|
82
81
|
toolbar?: ToolbarOption;
|
|
83
82
|
disablePlugins?: string[];
|
|
84
83
|
extraElementOptions?: ElementOptionsInfo[];
|
|
@@ -123,7 +122,3 @@ export interface DomEventDataInfo {
|
|
|
123
122
|
text?: string;
|
|
124
123
|
json?: Node[];
|
|
125
124
|
}
|
|
126
|
-
export interface DragNode {
|
|
127
|
-
node: CustomElement;
|
|
128
|
-
path: Path;
|
|
129
|
-
}
|
package/package.json
CHANGED
|
@@ -340,11 +340,11 @@ $control-corner-width: 12px;
|
|
|
340
340
|
display: block;
|
|
341
341
|
|
|
342
342
|
.danger.thy-icon-nav-link:hover {
|
|
343
|
-
|
|
343
|
+
@include remove-link-hover();
|
|
344
344
|
}
|
|
345
345
|
|
|
346
346
|
.thy-icon-nav .thy-icon-nav-link {
|
|
347
|
-
margin-right:
|
|
347
|
+
margin-right: $thy-icon-nav-link-margin-right;
|
|
348
348
|
|
|
349
349
|
&:last-child {
|
|
350
350
|
margin-right: 0;
|
package/styles/editor.scss
CHANGED
|
@@ -61,139 +61,140 @@ $thy-icon-nav-link-margin-right: 5px;
|
|
|
61
61
|
overflow-y: scroll;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
64
|
+
}
|
|
65
|
+
.the-editor-typo{
|
|
66
|
+
// list style
|
|
67
|
+
ul,
|
|
68
|
+
ol,
|
|
69
|
+
li {
|
|
70
|
+
list-style: inherit;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
ol {
|
|
74
|
+
list-style-type: decimal;
|
|
75
|
+
|
|
76
|
+
ol {
|
|
77
|
+
list-style-type: lower-alpha;
|
|
78
|
+
|
|
79
|
+
ol {
|
|
80
|
+
list-style-type: lower-roman;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
ul {
|
|
86
|
+
list-style-type: disc;
|
|
87
|
+
|
|
88
|
+
ul {
|
|
89
|
+
list-style-type: circle;
|
|
90
|
+
|
|
91
|
+
ul {
|
|
92
|
+
list-style-type: square;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
[the-underlined][the-strike] {
|
|
98
|
+
text-decoration: underline line-through;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[the-strike] {
|
|
102
|
+
text-decoration: line-through;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
[the-underlined] {
|
|
106
|
+
text-decoration: underline;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[the-italic] {
|
|
110
|
+
font-style: italic;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
[the-bold] {
|
|
114
|
+
font-weight: bold;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
[the-code-line] {
|
|
118
|
+
margin: 0 4px;
|
|
119
|
+
padding: 2px 3px;
|
|
120
|
+
border: 1px solid $gray-300;
|
|
121
|
+
border-radius: 2px;
|
|
122
|
+
font-family: monospace;
|
|
123
|
+
font-size: inherit;
|
|
124
|
+
background-color: rgba(243, 243, 243, 0.8);
|
|
125
|
+
line-height: inherit;
|
|
126
|
+
word-wrap: break-word;
|
|
127
|
+
text-indent: 0;
|
|
128
|
+
color: $gray-700;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.leaf-with-placeholder {
|
|
132
|
+
background-color: $white;
|
|
133
|
+
|
|
134
|
+
&[data-slate-leaf=true] {
|
|
135
|
+
width: 12em;;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
[data-slate-placeholder] {
|
|
139
|
+
color: initial;
|
|
140
|
+
font-weight: initial;
|
|
141
|
+
font-style: initial;
|
|
142
|
+
text-decoration: initial;
|
|
143
|
+
background-color: initial;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// list: fontSize, li marginLeft, multiDigit li marginLeft
|
|
147
|
+
@each $size, $liMl, $liMultiDigitMl in (12, 13, 14, 15, 16, 18, 20, (24 null 35px), (28 null 42px), (32 33px 50px), (40 40px 62px), (48 50px 78px)) {
|
|
148
|
+
[the-font-size="#{$size}"] {
|
|
149
|
+
font-size: #{$size}px;
|
|
150
|
+
line-height: $font-size-line-height;
|
|
151
|
+
}
|
|
152
|
+
.slate-element-list-item {
|
|
153
|
+
&.font-size-#{$size} {
|
|
154
|
+
&::marker {
|
|
155
|
+
font-size: #{$size}px;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
.slate-element-numbered-list {
|
|
160
|
+
.slate-element-list-item {
|
|
161
|
+
&.font-size-#{$size} {
|
|
162
|
+
margin-left: $liMl;
|
|
163
|
+
|
|
164
|
+
&[data-multi-digit] {
|
|
165
|
+
margin-left: $liMultiDigitMl;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
.slate-element-bulleted-list {
|
|
171
|
+
.slate-element-list-item {
|
|
172
|
+
&.font-size-#{$size} {
|
|
173
|
+
@if $size == 40 {
|
|
174
|
+
margin-left: 2.2em;
|
|
175
|
+
}
|
|
176
|
+
@if $size == 48 {
|
|
177
|
+
margin-left: 2.5em;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// indent
|
|
185
|
+
@for $i from 1 through 17 {
|
|
186
|
+
[the-indent="#{$i}"] {
|
|
187
|
+
padding-left: $i * 2em;
|
|
188
|
+
}
|
|
189
|
+
// list
|
|
190
|
+
ol[the-level="#{$i}"],
|
|
191
|
+
ul[the-level="#{$i}"] {
|
|
192
|
+
margin-left: $i * 2em;
|
|
193
|
+
}
|
|
194
|
+
.the-check-item[the-level="#{$i}"] {
|
|
195
|
+
padding-left: calc(#{$i * 2em} + 2em);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
197
198
|
}
|
|
198
199
|
|
|
199
200
|
.the-nav-split-line {
|
|
@@ -281,6 +282,32 @@ $thy-icon-nav-link-margin-right: 5px;
|
|
|
281
282
|
}
|
|
282
283
|
}
|
|
283
284
|
|
|
285
|
+
.the-block-toolbar {
|
|
286
|
+
.thy-popover-container {
|
|
287
|
+
min-width: auto;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
.the-block-toolbar-popover {
|
|
293
|
+
display: flex;
|
|
294
|
+
padding: 5px 10px;
|
|
295
|
+
background: $white;
|
|
296
|
+
box-shadow: $box-shadow;
|
|
297
|
+
|
|
298
|
+
.thy-icon-nav .thy-icon-nav-link {
|
|
299
|
+
margin-right: $thy-icon-nav-link-margin-right;
|
|
300
|
+
|
|
301
|
+
&:last-child {
|
|
302
|
+
margin-right: 0;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
&.remove-link:hover {
|
|
306
|
+
@include remove-link-hover();
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
284
311
|
@mixin the-toolbar-active {
|
|
285
312
|
.thy-icon-nav-link.thy-popover-origin-active,
|
|
286
313
|
.the-toolbar-dropdown-container.thy-popover-origin-active .thy-icon-nav-link {
|
package/styles/index.scss
CHANGED
|
@@ -18,5 +18,4 @@
|
|
|
18
18
|
@import '../plugins/quick-insert/components/quick-insert.component.scss';
|
|
19
19
|
@import '../plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.scss';
|
|
20
20
|
@import '../plugins/font-size/toolbar-item.component.scss';
|
|
21
|
-
@import '../plugins/inline-code/inline-code.component.scss';
|
|
22
|
-
@import '../plugins/dnd/component/dnd.component.scss'
|
|
21
|
+
@import '../plugins/inline-code/inline-code.component.scss';
|
package/styles/typo.scss
CHANGED
|
@@ -19,7 +19,13 @@ $nav-item-margin: 5px;
|
|
|
19
19
|
$selection-background: rgba($color: $primary, $alpha: 0.3);
|
|
20
20
|
$font-size-line-height: 1.5;
|
|
21
21
|
|
|
22
|
+
@mixin remove-link-hover {
|
|
23
|
+
color: $danger;
|
|
24
|
+
background: hsla(0,100%,73%,.1);
|
|
25
|
+
}
|
|
26
|
+
|
|
22
27
|
.the-editor-typo {
|
|
28
|
+
display: flow-root;
|
|
23
29
|
font-size: $the-font-size-base;
|
|
24
30
|
min-height: 250px;
|
|
25
31
|
padding: 28px 30px;
|
|
@@ -112,6 +118,9 @@ $font-size-line-height: 1.5;
|
|
|
112
118
|
text-indent: 0;
|
|
113
119
|
color: $gray-700;
|
|
114
120
|
}
|
|
121
|
+
.slate-element-hr{
|
|
122
|
+
display: block;
|
|
123
|
+
}
|
|
115
124
|
.slate-element-hr,
|
|
116
125
|
.slate-element-code,
|
|
117
126
|
.slate-element-image,
|
|
@@ -168,7 +177,7 @@ $font-size-line-height: 1.5;
|
|
|
168
177
|
}
|
|
169
178
|
}
|
|
170
179
|
.remove-link.thy-icon-nav-link:hover {
|
|
171
|
-
|
|
180
|
+
@include remove-link-hover();
|
|
172
181
|
}
|
|
173
182
|
|
|
174
183
|
// 处理 block-card 图文混排
|
|
@@ -195,6 +204,7 @@ $font-size-line-height: 1.5;
|
|
|
195
204
|
}
|
|
196
205
|
&[layout="wrap-left"] {
|
|
197
206
|
float: left;
|
|
207
|
+
z-index: 1;
|
|
198
208
|
|
|
199
209
|
.image-content {
|
|
200
210
|
margin: 0 12px 0 auto;
|
|
@@ -202,6 +212,7 @@ $font-size-line-height: 1.5;
|
|
|
202
212
|
}
|
|
203
213
|
&[layout="wrap-right"] {
|
|
204
214
|
float: right;
|
|
215
|
+
z-index: 1;
|
|
205
216
|
|
|
206
217
|
.image-content {
|
|
207
218
|
margin: 0 auto 0 12px;
|