mce 0.13.5 → 0.13.7

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.
@@ -1,15 +1,17 @@
1
1
  import type { OrientedBoundingBox } from '../types';
2
2
  import { Editor } from '../editor';
3
3
  type __VLS_Slots = {
4
- selector?: (props: {
4
+ 'selector'?: (props: {
5
5
  box: OrientedBoundingBox;
6
6
  }) => void;
7
- transformer?: (props: {
7
+ 'transformer'?: (props: {
8
8
  box: Partial<OrientedBoundingBox>;
9
9
  }) => void;
10
- floatbar?: () => void;
11
- drawboard?: () => void;
12
- default?: () => void;
10
+ 'floatbar'?: () => void;
11
+ 'floatbar-top'?: () => void;
12
+ 'floatbar-bottom'?: () => void;
13
+ 'drawboard'?: () => void;
14
+ 'default'?: () => void;
13
15
  };
14
16
  declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
15
17
  editor: typeof Editor;
@@ -4,10 +4,7 @@ type __VLS_Slots = {} & {
4
4
  default?: (props: typeof __VLS_7) => any;
5
5
  };
6
6
  declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
7
- location: {
8
- type: import("vue").PropType<import("@floating-ui/vue").Side | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | "bottom-end" | "bottom-start">;
9
- default: NonNullable<import("@floating-ui/vue").Side | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | "bottom-end" | "bottom-start">;
10
- };
7
+ location: import("vue").PropType<import("@floating-ui/vue").Side | import("@floating-ui/vue").AlignedPlacement>;
11
8
  offset: {
12
9
  type: import("vue").PropType<number>;
13
10
  default: number;
@@ -30,10 +27,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
30
27
  }>, {
31
28
  updateLocation: typeof updateLocation;
32
29
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
33
- location: {
34
- type: import("vue").PropType<import("@floating-ui/vue").Side | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | "bottom-end" | "bottom-start">;
35
- default: NonNullable<import("@floating-ui/vue").Side | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | "bottom-end" | "bottom-start">;
36
- };
30
+ location: import("vue").PropType<import("@floating-ui/vue").Side | import("@floating-ui/vue").AlignedPlacement>;
37
31
  offset: {
38
32
  type: import("vue").PropType<number>;
39
33
  default: number;
@@ -55,7 +49,6 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
55
49
  };
56
50
  }>> & Readonly<{}>, {
57
51
  offset: number;
58
- location: import("@floating-ui/vue").Side | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | "bottom-end" | "bottom-start";
59
52
  attach: string | boolean | Element | null | undefined;
60
53
  middlewares: any[] | ("shift" | "flip" | "offset")[];
61
54
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,89 @@
1
+ import type { ImageFillCropRect } from 'modern-idoc';
2
+ /**
3
+ * TODO 撤回无法重渲
4
+ */
5
+ type __VLS_Props = {
6
+ image: string;
7
+ minScale?: number;
8
+ maxScale?: number;
9
+ };
10
+ declare function ok(): void;
11
+ declare function cancel(): void;
12
+ declare function applySourceTransformToStyle(): void;
13
+ type __VLS_ModelProps = {
14
+ /**
15
+ * CropRect (value are based on CropRect !!!)
16
+ *
17
+ * @example
18
+ *
19
+ * cropRect: { left: 0.3, top: 0.3, right: 0.3, bottom: 0.3 }
20
+ *
21
+ * Before:
22
+ *
23
+ * View (Source)
24
+ * |---0---|
25
+ * | |
26
+ * 0 0
27
+ * | |
28
+ * |---0---|
29
+ *
30
+ * After:
31
+ *
32
+ * Source
33
+ * |----- 0 -----|
34
+ * | View |
35
+ * | |--0.3--| |
36
+ * | | | |
37
+ * 0 0.3 0.3 0
38
+ * | | | |
39
+ * | |--0.3--| |
40
+ * | |
41
+ * |----- 0 -----|
42
+ */
43
+ modelValue?: ImageFillCropRect;
44
+ 'style'?: Record<string, any>;
45
+ };
46
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
47
+ declare var __VLS_5: {
48
+ scale: number;
49
+ ok: typeof ok;
50
+ cancel: typeof cancel;
51
+ applySourceTransformToStyle: typeof applySourceTransformToStyle;
52
+ };
53
+ type __VLS_Slots = {} & {
54
+ default?: (props: typeof __VLS_5) => any;
55
+ };
56
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
57
+ end: () => any;
58
+ start: () => any;
59
+ "update:modelValue": (value: ImageFillCropRect) => any;
60
+ "update:transform": (args_0: {
61
+ left: number;
62
+ top: number;
63
+ width: number;
64
+ height: number;
65
+ }) => any;
66
+ "update:style": (value: Record<string, any>) => any;
67
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
68
+ onEnd?: (() => any) | undefined;
69
+ onStart?: (() => any) | undefined;
70
+ "onUpdate:modelValue"?: ((value: ImageFillCropRect) => any) | undefined;
71
+ "onUpdate:transform"?: ((args_0: {
72
+ left: number;
73
+ top: number;
74
+ width: number;
75
+ height: number;
76
+ }) => any) | undefined;
77
+ "onUpdate:style"?: ((value: Record<string, any>) => any) | undefined;
78
+ }>, {
79
+ minScale: number;
80
+ maxScale: number;
81
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
82
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
83
+ declare const _default: typeof __VLS_export;
84
+ export default _default;
85
+ type __VLS_WithSlots<T, S> = T & {
86
+ new (): {
87
+ $slots: S;
88
+ };
89
+ };
@@ -1,3 +1,2 @@
1
1
  import { Editor } from '../editor';
2
2
  export declare function useEditor(): Editor;
3
- export declare function provideEditor(editor?: Editor): Editor;
package/dist/editor.d.ts CHANGED
@@ -4,6 +4,7 @@ import type { App, InjectionKey } from 'vue';
4
4
  import { Observable } from 'modern-idoc';
5
5
  export interface Options extends Mce.Options {
6
6
  debug?: boolean;
7
+ showMadeWith?: boolean;
7
8
  plugins?: Plugin[];
8
9
  configCacheInLocal?: boolean;
9
10
  }
@@ -14,6 +15,7 @@ export interface Events extends Mce.Events, ObservableEvents {
14
15
  export declare class Editor extends Observable<Events> {
15
16
  static injectionKey: InjectionKey<Editor>;
16
17
  debug: import("vue").Ref<boolean, boolean>;
18
+ showMadeWith: import("vue").Ref<boolean, boolean>;
17
19
  config: RemovableRef<Mce.Config>;
18
20
  onEmit?: <K extends keyof Events & string>(event: K, ...args: Events[K]) => void;
19
21
  plugins: Map<string, PluginObject>;
package/dist/index.css CHANGED
@@ -150,12 +150,117 @@
150
150
  overflow: hidden;
151
151
  text-overflow: ellipsis;
152
152
  background-color: rgba(var(--mce-theme-surface), 1);
153
+ }.mce-floatbar {
154
+ overflow: visible;
155
+ }.mce-transformable {
156
+ left: 0;
157
+ top: 0;
158
+ }
159
+ .mce-transformable__svg {
160
+ position: absolute;
161
+ left: 0;
162
+ top: 0;
163
+ width: 100%;
164
+ height: 100%;
165
+ overflow: visible;
166
+ pointer-events: none;
167
+ color: rgb(var(--mce-theme-primary));
168
+ stroke: currentColor;
169
+ }
170
+ .mce-transformable__diagonal {
171
+ stroke-width: 1px;
172
+ stroke-dasharray: 2px;
173
+ visibility: hidden;
174
+ }
175
+ .mce-transformable__rect {
176
+ stroke-width: 1px;
177
+ }
178
+ .mce-transformable__handle {
179
+ fill: white;
180
+ stroke-width: 1px;
181
+ pointer-events: none;
182
+ }
183
+ .mce-transformable__handle-rect {
184
+ stroke-width: 1px;
185
+ fill: transparent;
186
+ stroke: transparent;
187
+ }
188
+ .mce-transformable__tip {
189
+ position: absolute;
190
+ bottom: 0;
191
+ left: 50%;
192
+ transform: translate(-50%, calc(100% + 8px));
193
+ background-color: rgb(var(--mce-theme-primary));
194
+ color: rgb(var(--mce-theme-on-primary));
195
+ font-size: 12px;
196
+ padding: 2px 4px;
197
+ border-radius: 3px;
198
+ text-wrap: nowrap;
199
+ }
200
+ .mce-transformable--dashed .mce-transformable__rect {
201
+ stroke-dasharray: 4px;
202
+ }
203
+ .mce-transformable--resizing .mce-transformable__diagonal {
204
+ visibility: visible;
205
+ }
206
+ .mce-transformable--moving .mce-transformable__handle {
207
+ visibility: hidden;
208
+ }
209
+ .mce-transformable--moving .mce-transformable__handle-rect {
210
+ visibility: hidden;
211
+ }
212
+ .mce-transformable--moving .mce-transformable__rect {
213
+ opacity: 0.4;
214
+ stroke-width: 0.5px;
215
+ }
216
+ .mce-transformable--moving .mce-transformable__svg-slot {
217
+ opacity: 0.4;
218
+ stroke-width: 0.5px;
219
+ }
220
+ .mce-transformable--hide-ui .mce-transformable__handle {
221
+ visibility: hidden;
222
+ }
223
+ .mce-transformable--hide-ui .mce-transformable__handle-rect {
224
+ visibility: hidden;
225
+ }
226
+ .mce-transformable--hide-ui .mce-transformable__rect {
227
+ visibility: hidden;
228
+ }.mce-cropper {
229
+ pointer-events: auto;
230
+ position: absolute;
231
+ left: 0;
232
+ top: 0;
233
+ width: 100%;
234
+ height: 100%;
235
+ }
236
+ .mce-cropper__source {
237
+ position: absolute;
238
+ width: 100%;
239
+ height: 100%;
240
+ transform-origin: top left;
241
+ }
242
+ .mce-cropper__source canvas {
243
+ position: absolute;
244
+ width: 100%;
245
+ height: 100%;
246
+ }
247
+ .mce-cropper__transformable {
248
+ position: absolute;
249
+ color: rgba(var(--mce-theme-primary), 1);
250
+ opacity: 0.5;
251
+ }
252
+ .mce-cropper__transformable_rect {
253
+ width: 100%;
254
+ height: 100%;
153
255
  }.mce-frame {
154
256
  position: absolute;
155
257
  }
156
258
  .mce-frame--outline {
157
259
  outline: 1px solid rgba(0, 0, 0, 0.168627451);
158
260
  }
261
+ .mce-frame--hover .mce-frame__name > div, .mce-frame--selected .mce-frame__name > div {
262
+ opacity: 1;
263
+ }
159
264
  .mce-frame__name {
160
265
  position: absolute;
161
266
  top: 0;
@@ -172,18 +277,22 @@
172
277
  position: relative;
173
278
  min-width: 28px;
174
279
  box-sizing: content-box;
175
- color: rgba(var(--mce-theme-on-surface), 0.8);
280
+ color: rgb(var(--mce-theme-on-surface));
281
+ opacity: 0.5;
176
282
  }
177
283
  .mce-frame__name > input {
178
284
  position: absolute;
179
285
  left: 0;
180
286
  top: 0;
181
- outline: none;
287
+ padding: 0;
182
288
  width: 100%;
183
289
  height: 100%;
184
- border: 1px solid rgba(0, 0, 0, 0.168627451);
185
- border-radius: 4px;
290
+ border: none;
291
+ outline: 1px solid rgb(var(--mce-theme-primary));
186
292
  cursor: default;
293
+ font-size: inherit;
294
+ font-weight: inherit;
295
+ border-radius: 2px;
187
296
  }.mce-back-selected-aera {
188
297
  pointer-events: auto !important;
189
298
  position: absolute;
@@ -355,6 +464,26 @@
355
464
  }
356
465
  .mce-layers:hover .mce-layer:not(.mce-layer--root) .mce-layer__expand {
357
466
  opacity: 1;
467
+ }.mce-made-with {
468
+ pointer-events: auto !important;
469
+ position: absolute;
470
+ right: 18px;
471
+ bottom: 18px;
472
+ opacity: 0.38;
473
+ color: #000;
474
+ text-align: center;
475
+ font-size: 12px;
476
+ line-height: 1;
477
+ border: 2px solid currentColor;
478
+ padding: 2px 4px;
479
+ border-radius: 4px;
480
+ box-sizing: border-box;
481
+ font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
482
+ text-decoration: none;
483
+ }
484
+ .mce-made-with div:last-child {
485
+ font-weight: bold;
486
+ letter-spacing: 1px;
358
487
  }.mce-tooltip {
359
488
  background: rgb(var(--mce-theme-surface-variant));
360
489
  color: rgb(var(--mce-theme-on-surface-variant));
@@ -450,80 +579,10 @@
450
579
  }
451
580
  .mce-scrollbar__thumb--active, .mce-scrollbar__thumb:hover {
452
581
  background-color: rgba(var(--mce-theme-on-background), var(--mce-medium-emphasis-opacity));
453
- }.mce-transformable {
454
- left: 0;
455
- top: 0;
456
- }
457
- .mce-transformable__svg {
458
- position: absolute;
459
- left: 0;
460
- top: 0;
461
- width: 100%;
462
- height: 100%;
463
- overflow: visible;
464
- pointer-events: none;
465
- color: rgb(var(--mce-theme-primary));
466
- stroke: currentColor;
467
- }
468
- .mce-transformable__diagonal {
469
- stroke-width: 1px;
470
- stroke-dasharray: 2px;
471
- visibility: hidden;
472
- }
473
- .mce-transformable__rect {
474
- stroke-width: 1px;
475
- }
476
- .mce-transformable__handle {
477
- fill: white;
478
- stroke-width: 1px;
479
- pointer-events: none;
480
- }
481
- .mce-transformable__handle-rect {
482
- stroke-width: 1px;
483
- fill: transparent;
484
- stroke: transparent;
485
- }
486
- .mce-transformable__tip {
582
+ }.mce-selector__slot {
487
583
  position: absolute;
488
- bottom: 0;
489
- left: 50%;
490
- transform: translate(-50%, calc(100% + 8px));
491
- background-color: rgb(var(--mce-theme-primary));
492
- color: rgb(var(--mce-theme-on-primary));
493
- font-size: 12px;
494
- padding: 2px 4px;
495
- border-radius: 3px;
496
- text-wrap: nowrap;
497
- }
498
- .mce-transformable--dashed .mce-transformable__rect {
499
- stroke-dasharray: 4px;
500
584
  }
501
- .mce-transformable--resizing .mce-transformable__diagonal {
502
- visibility: visible;
503
- }
504
- .mce-transformable--moving .mce-transformable__handle {
505
- visibility: hidden;
506
- }
507
- .mce-transformable--moving .mce-transformable__handle-rect {
508
- visibility: hidden;
509
- }
510
- .mce-transformable--moving .mce-transformable__rect {
511
- opacity: 0.4;
512
- stroke-width: 0.5px;
513
- }
514
- .mce-transformable--moving .mce-transformable__svg-slot {
515
- opacity: 0.4;
516
- stroke-width: 0.5px;
517
- }
518
- .mce-transformable--hide-ui .mce-transformable__handle {
519
- visibility: hidden;
520
- }
521
- .mce-transformable--hide-ui .mce-transformable__handle-rect {
522
- visibility: hidden;
523
- }
524
- .mce-transformable--hide-ui .mce-transformable__rect {
525
- visibility: hidden;
526
- }.mce-parent-element-obb {
585
+ .mce-selector__parent-element {
527
586
  position: absolute;
528
587
  pointer-events: none;
529
588
  border-width: 1px;
@@ -531,18 +590,18 @@
531
590
  color: rgba(var(--mce-theme-primary), 1);
532
591
  opacity: 0.5;
533
592
  }
534
- .mce-selected-area {
593
+ .mce-selector__selected-area {
535
594
  position: absolute;
536
595
  border-width: 1px;
537
596
  border-style: solid;
538
597
  color: rgba(var(--mce-theme-primary), 1);
539
598
  background-color: rgba(var(--mce-theme-primary), 0.1);
540
599
  }
541
- .mce-selection-obb {
600
+ .mce-selector__transform {
542
601
  position: absolute;
543
602
  color: rgba(var(--mce-theme-primary), 1);
544
603
  }
545
- .mce-element-obb {
604
+ .mce-selector__element {
546
605
  position: absolute;
547
606
  border-width: 1px;
548
607
  border-style: solid;
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import './typed-global.d.ts';
2
2
  import './typed-plugins.d.ts';
3
3
  export { default as EditorLayout } from './components/EditorLayout.vue';
4
4
  export { default as EditorLayers } from './components/Layers.vue';
5
+ export { default as Cropper } from './components/shared/Cropper.vue';
5
6
  export { default as Dialog } from './components/shared/Dialog.vue';
6
7
  export { default as EditorLayoutItem } from './components/shared/LayoutItem.vue';
7
8
  export { default as Menu } from './components/shared/Menu.vue';