@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.
Files changed (36) hide show
  1. package/bundles/worktile-theia.umd.js +144 -471
  2. package/bundles/worktile-theia.umd.js.map +1 -1
  3. package/constants/default.d.ts +0 -2
  4. package/editor.component.d.ts +0 -2
  5. package/editor.module.d.ts +24 -26
  6. package/esm2015/constants/default.js +1 -2
  7. package/esm2015/editor.component.js +17 -14
  8. package/esm2015/editor.module.js +3 -6
  9. package/esm2015/interfaces/editor.js +1 -1
  10. package/esm2015/plugins/align/align.editor.js +6 -2
  11. package/esm2015/plugins/image/image.component.js +13 -8
  12. package/esm2015/utils/dom.js +5 -3
  13. package/esm2015/utils/index.js +3 -1
  14. package/fesm2015/worktile-theia.js +137 -462
  15. package/fesm2015/worktile-theia.js.map +1 -1
  16. package/interfaces/editor.d.ts +1 -6
  17. package/package.json +1 -1
  18. package/plugins/image/image.component.scss +0 -7
  19. package/plugins/table/components/table.component.scss +2 -2
  20. package/styles/editor.scss +160 -133
  21. package/styles/index.scss +1 -2
  22. package/styles/typo.scss +12 -1
  23. package/utils/index.d.ts +2 -0
  24. package/esm2015/plugins/dnd/component/dnd.component.js +0 -254
  25. package/esm2015/plugins/dnd/utils/get-current-target.js +0 -19
  26. package/esm2015/plugins/dnd/utils/get-hover-direction.js +0 -13
  27. package/esm2015/plugins/dnd/utils/is-valid-drag.js +0 -38
  28. package/esm2015/plugins/dnd/utils/move-drag-node.js +0 -30
  29. package/esm2015/plugins/dnd/utils/remove-drop-thumb-line.js +0 -10
  30. package/plugins/dnd/component/dnd.component.d.ts +0 -42
  31. package/plugins/dnd/component/dnd.component.scss +0 -60
  32. package/plugins/dnd/utils/get-current-target.d.ts +0 -2
  33. package/plugins/dnd/utils/get-hover-direction.d.ts +0 -3
  34. package/plugins/dnd/utils/is-valid-drag.d.ts +0 -3
  35. package/plugins/dnd/utils/move-drag-node.d.ts +0 -2
  36. package/plugins/dnd/utils/remove-drop-thumb-line.d.ts +0 -2
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worktile/theia",
3
- "version": "2.3.0-next.1",
3
+ "version": "2.3.0",
4
4
  "description": "theia editor",
5
5
  "author": "YanDong <nanianqiumo@foxmail.com>",
6
6
  "homepage": "https://github.com/atinc/theia#readme",
@@ -192,10 +192,3 @@
192
192
  }
193
193
  }
194
194
  }
195
-
196
- .the-image-toolbar {
197
-
198
- .thy-icon-nav .thy-icon-nav-link {
199
- margin-right: 5px;
200
- }
201
- }
@@ -340,11 +340,11 @@ $control-corner-width: 12px;
340
340
  display: block;
341
341
 
342
342
  .danger.thy-icon-nav-link:hover {
343
- color: $danger;
343
+ @include remove-link-hover();
344
344
  }
345
345
 
346
346
  .thy-icon-nav .thy-icon-nav-link {
347
- margin-right: 5px;
347
+ margin-right: $thy-icon-nav-link-margin-right;
348
348
 
349
349
  &:last-child {
350
350
  margin-right: 0;
@@ -61,139 +61,140 @@ $thy-icon-nav-link-margin-right: 5px;
61
61
  overflow-y: scroll;
62
62
  }
63
63
  }
64
-
65
- // list style
66
- ul,
67
- ol,
68
- li {
69
- list-style: inherit;
70
- }
71
-
72
- ol {
73
- list-style-type: decimal;
74
-
75
- ol {
76
- list-style-type: lower-alpha;
77
-
78
- ol {
79
- list-style-type: lower-roman;
80
- }
81
- }
82
- }
83
-
84
- ul {
85
- list-style-type: disc;
86
-
87
- ul {
88
- list-style-type: circle;
89
-
90
- ul {
91
- list-style-type: square;
92
- }
93
- }
94
- }
95
-
96
- [the-underlined][the-strike] {
97
- text-decoration: underline line-through;
98
- }
99
-
100
- [the-strike] {
101
- text-decoration: line-through;
102
- }
103
-
104
- [the-underlined] {
105
- text-decoration: underline;
106
- }
107
-
108
- [the-italic] {
109
- font-style: italic;
110
- }
111
-
112
- [the-bold] {
113
- font-weight: bold;
114
- }
115
-
116
- [the-code-line] {
117
- margin: 0 4px;
118
- padding: 2px 3px;
119
- border: 1px solid $gray-300;
120
- border-radius: 2px;
121
- font-family: monospace;
122
- font-size: inherit;
123
- background-color: rgba(243, 243, 243, 0.8);
124
- line-height: inherit;
125
- word-wrap: break-word;
126
- text-indent: 0;
127
- color: $gray-700;
128
- }
129
-
130
- .leaf-with-placeholder {
131
- background-color: $white;
132
-
133
- &[data-slate-leaf=true] {
134
- width: 12em;;
135
- }
136
- }
137
- [data-slate-placeholder] {
138
- color: initial;
139
- font-weight: initial;
140
- font-style: initial;
141
- text-decoration: initial;
142
- background-color: initial;
143
- }
144
-
145
- // list: fontSize, li marginLeft, multiDigit li marginLeft
146
- @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)) {
147
- [the-font-size="#{$size}"] {
148
- font-size: #{$size}px;
149
- line-height: $font-size-line-height;
150
- }
151
- .slate-element-list-item {
152
- &.font-size-#{$size} {
153
- &::marker {
154
- font-size: #{$size}px;
155
- }
156
- }
157
- }
158
- .slate-element-numbered-list {
159
- .slate-element-list-item {
160
- &.font-size-#{$size} {
161
- margin-left: $liMl;
162
-
163
- &[data-multi-digit] {
164
- margin-left: $liMultiDigitMl;
165
- }
166
- }
167
- }
168
- }
169
- .slate-element-bulleted-list {
170
- .slate-element-list-item {
171
- &.font-size-#{$size} {
172
- @if $size == 40 {
173
- margin-left: 2.2em;
174
- }
175
- @if $size == 48 {
176
- margin-left: 2.5em;
177
- }
178
- }
179
- }
180
- }
181
- }
182
-
183
- // indent
184
- @for $i from 1 through 17 {
185
- [the-indent="#{$i}"] {
186
- padding-left: $i * 2em;
187
- }
188
- // list
189
- ol[the-level="#{$i}"],
190
- ul[the-level="#{$i}"] {
191
- margin-left: $i * 2em;
192
- }
193
- .the-check-item[the-level="#{$i}"] {
194
- padding-left: calc(#{$i * 2em} + 2em);
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
- color: $danger;
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;
package/utils/index.d.ts CHANGED
@@ -4,3 +4,5 @@ export * from './get-toolbar-class';
4
4
  export * from './create-empty-paragraph';
5
5
  export * from './common';
6
6
  export * from './is-clean-empty-paragraph';
7
+ export * from './merge-element-options';
8
+ export * from './dom';