@ydesign/react-editor 0.0.2 → 0.0.4
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/LICENSE +1 -1
- package/dist/app.css +2 -2
- package/dist/app.d.ts +4 -4
- package/dist/app.js +2 -2
- package/dist/canvas/workspace-canvas.d.ts +4 -0
- package/dist/canvas/workspace.d.ts +4 -0
- package/dist/chunk-3TO57JPN.js +1 -0
- package/dist/chunk-3TTTJUTT.js +1 -0
- package/dist/chunk-4FFLRF6N.js +1 -0
- package/dist/{chunk-V5RJX32O.js → chunk-4HEMGHOQ.js} +1 -1
- package/dist/chunk-4LUZF4CB.js +2 -0
- package/dist/chunk-53KFBGJB.js +16 -0
- package/dist/chunk-5C2MNUBC.js +1 -0
- package/dist/chunk-7NNOHYKX.js +15 -0
- package/dist/chunk-AGNRQAPA.js +1 -0
- package/dist/chunk-APQPKBER.js +1 -0
- package/dist/chunk-CB23VFSC.js +1 -0
- package/dist/chunk-CMH73CYQ.js +27 -0
- package/dist/chunk-COQ4GO5N.js +1 -0
- package/dist/{chunk-GMISU6MD.js → chunk-CS6Z4TQU.js} +1 -1
- package/dist/chunk-EOBIVNFF.js +1 -0
- package/dist/chunk-FXO52BV7.js +1 -0
- package/dist/chunk-IQ7O55C5.js +42 -0
- package/dist/chunk-KLZXBPXI.js +1 -0
- package/dist/chunk-LCE6Z46D.js +3 -0
- package/dist/chunk-M4S26KQG.js +1 -0
- package/dist/chunk-MQZE5LZU.js +1 -0
- package/dist/chunk-MXZ6RXT3.js +1 -0
- package/dist/chunk-OV74NBJ5.js +45 -0
- package/dist/{chunk-FIAIYSJ7.js → chunk-PSXS4WMN.js} +1 -1
- package/dist/chunk-Q2L6VKFI.js +9 -0
- package/dist/chunk-RVXI723F.js +1 -0
- package/dist/{chunk-LW2W4B2N.js → chunk-VXTF2OL2.js} +3 -3
- package/dist/{chunk-JWQ2DUXA.js → chunk-WCHGSVUC.js} +1 -1
- package/dist/chunk-WGX437MN.js +9 -0
- package/dist/chunk-XK24AOVW.js +54 -0
- package/dist/chunk-XM3RPIUS.js +9 -0
- package/dist/chunk-XPAHGJGK.js +1 -0
- package/dist/{chunk-3HQUN5MA.js → chunk-YRJUN267.js} +1 -1
- package/dist/config.d.ts +52 -1
- package/dist/config.js +1 -0
- package/dist/hooks/use-duplicate-element.d.ts +4 -0
- package/dist/hooks/use-lock.d.ts +4 -0
- package/dist/hooks/use-remove-element.d.ts +4 -0
- package/dist/lib/utils.js +1 -1
- package/dist/model/store.d.ts +64 -38
- package/dist/model/store.js +1 -1
- package/dist/project.d.ts +10 -1
- package/dist/project.js +1 -1
- package/dist/side-panel/background-panel.d.ts +10 -3
- package/dist/side-panel/background-panel.js +1 -1
- package/dist/side-panel/images-grid.d.ts +25 -0
- package/dist/side-panel/images-grid.js +1 -0
- package/dist/side-panel/index.d.ts +4 -0
- package/dist/side-panel/index.js +1 -1
- package/dist/side-panel/layers-panel.d.ts +8 -2
- package/dist/side-panel/layers-panel.js +1 -1
- package/dist/side-panel/photos-panel.d.ts +4 -0
- package/dist/side-panel/shapes-panel.d.ts +4 -0
- package/dist/side-panel/shapes-panel.js +1 -1
- package/dist/side-panel/side-panel.d.ts +4 -0
- package/dist/side-panel/side-panel.js +1 -1
- package/dist/side-panel/size-panel.d.ts +8 -2
- package/dist/side-panel/size-panel.js +1 -1
- package/dist/side-panel/tab-button.js +1 -1
- package/dist/side-panel/templates-panel.d.ts +8 -2
- package/dist/side-panel/templates-panel.js +1 -1
- package/dist/side-panel/text-panel.d.ts +8 -2
- package/dist/side-panel/text-panel.js +1 -1
- package/dist/side-panel/upload-panel.d.ts +4 -0
- package/dist/toolbar/default-toolbar.d.ts +10 -1
- package/dist/toolbar/default-toolbar.js +1 -1
- package/dist/toolbar/download-button.d.ts +4 -0
- package/dist/toolbar/duplicate-button.d.ts +4 -0
- package/dist/toolbar/element-container.js +1 -1
- package/dist/toolbar/figure-toolbar.d.ts +33 -0
- package/dist/toolbar/figure-toolbar.js +1 -0
- package/dist/toolbar/filters-picker.d.ts +4 -0
- package/dist/toolbar/filters-picker.js +1 -1
- package/dist/toolbar/flip-button.d.ts +4 -0
- package/dist/toolbar/flip-button.js +1 -1
- package/dist/toolbar/group-button.d.ts +4 -0
- package/dist/toolbar/group-button.js +1 -1
- package/dist/toolbar/history-buttons.d.ts +4 -0
- package/dist/toolbar/history-buttons.js +1 -1
- package/dist/toolbar/image-eraser-pen.d.ts +4 -1
- package/dist/toolbar/image-eraser-pen.js +1 -1
- package/dist/toolbar/image-remove-background.d.ts +4 -1
- package/dist/toolbar/image-remove-background.js +1 -1
- package/dist/toolbar/image-toolbar.d.ts +12 -2
- package/dist/toolbar/image-toolbar.js +1 -1
- package/dist/toolbar/lock-button.d.ts +4 -0
- package/dist/toolbar/opacity-picker.d.ts +4 -0
- package/dist/toolbar/opacity-picker.js +1 -1
- package/dist/toolbar/position-picker.d.ts +4 -0
- package/dist/toolbar/remove-button.d.ts +4 -0
- package/dist/toolbar/text-ai-write.js +1 -1
- package/dist/toolbar/text-toolbar.d.ts +4 -0
- package/dist/toolbar/text-toolbar.js +1 -1
- package/dist/toolbar/toolbar.d.ts +6 -2
- package/dist/toolbar/toolbar.js +1 -1
- package/dist/toolbar/zoom-buttons.d.ts +4 -0
- package/dist/toolbar/zoom-buttons.js +2 -2
- package/dist/topbar/file-menu.d.ts +14 -0
- package/dist/topbar/file-menu.js +1 -0
- package/dist/topbar/topbar.d.ts +16 -0
- package/dist/topbar/topbar.js +28 -0
- package/dist/utils/figure-to-svg.d.ts +36 -0
- package/dist/utils/figure-to-svg.js +1 -0
- package/dist/utils/image.d.ts +9 -3
- package/dist/utils/image.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/screen.js +1 -1
- package/dist/utils/svg.d.ts +3 -0
- package/dist/utils/svg.js +1 -0
- package/dist/utils/text.d.ts +3 -0
- package/dist/utils/text.js +1 -0
- package/dist/utils/unit.d.ts +18 -0
- package/dist/utils/unit.js +1 -0
- package/package.json +12 -10
- package/dist/chunk-2AWYWIIK.js +0 -1
- package/dist/chunk-55FJG4FK.js +0 -1
- package/dist/chunk-5MWZMSER.js +0 -1
- package/dist/chunk-6LFGFFHI.js +0 -1
- package/dist/chunk-7LU5UGIG.js +0 -16
- package/dist/chunk-E7ZSWHPU.js +0 -1
- package/dist/chunk-EMAFC3HG.js +0 -1
- package/dist/chunk-JW76IC3E.js +0 -1
- package/dist/chunk-M33EDDXB.js +0 -1
- package/dist/chunk-QJBRJELT.js +0 -1
- package/dist/chunk-TE6HYOIP.js +0 -7
- package/dist/chunk-TX4BNXQC.js +0 -1
- package/dist/chunk-U7HIFGXC.js +0 -1
- package/dist/chunk-V6ZZKUTN.js +0 -1
- package/dist/chunk-WIM26GEM.js +0 -1
- package/dist/chunk-XDLFQXMN.js +0 -54
- package/dist/chunk-XZAP76LL.js +0 -1
package/dist/model/store.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import * as fabric from 'fabric';
|
|
2
|
+
import * as mobx_state_tree_dist_internal from 'mobx-state-tree/dist/internal';
|
|
1
3
|
import * as mobx_state_tree from 'mobx-state-tree';
|
|
2
4
|
import { Instance } from 'mobx-state-tree';
|
|
3
|
-
import { Editor } from '@ydesign/core';
|
|
5
|
+
import { Editor, FabricObject } from '@ydesign/core';
|
|
6
|
+
import { FONT } from '../utils/fonts.js';
|
|
7
|
+
import 'mobx';
|
|
4
8
|
|
|
5
9
|
interface ExportOptions {
|
|
6
10
|
multiplier: number;
|
|
@@ -13,24 +17,7 @@ interface ExportOptions {
|
|
|
13
17
|
height?: number;
|
|
14
18
|
filter?: (object: any) => boolean;
|
|
15
19
|
}
|
|
16
|
-
|
|
17
|
-
id: string;
|
|
18
|
-
type: string;
|
|
19
|
-
locked?: boolean;
|
|
20
|
-
[key: string]: any;
|
|
21
|
-
}
|
|
22
|
-
type ElementType = (BaseElement & {
|
|
23
|
-
type: 'textbox';
|
|
24
|
-
text: string;
|
|
25
|
-
}) | (BaseElement & {
|
|
26
|
-
type: 'image';
|
|
27
|
-
src: string;
|
|
28
|
-
}) | (BaseElement & {
|
|
29
|
-
type: 'group';
|
|
30
|
-
objects: ElementsArray;
|
|
31
|
-
}) | BaseElement;
|
|
32
|
-
type ElementsArray = ElementType[];
|
|
33
|
-
declare const forEveryChild: (e: any, callback: (e: ElementType) => boolean | void) => void;
|
|
20
|
+
declare const forEveryChild: (node: any, cb: any) => void;
|
|
34
21
|
declare const Font: mobx_state_tree.IModelType<{
|
|
35
22
|
fontFamily: mobx_state_tree.ISimpleType<string>;
|
|
36
23
|
name: mobx_state_tree.IOptionalIType<mobx_state_tree.ISimpleType<string>, [undefined]>;
|
|
@@ -64,6 +51,7 @@ declare const Store: mobx_state_tree.IModelType<{
|
|
|
64
51
|
rulesVisible: mobx_state_tree.IType<boolean | undefined, boolean, boolean>;
|
|
65
52
|
openedSidePanel: mobx_state_tree.IType<string | undefined, string, string>;
|
|
66
53
|
selectedElementsIds: mobx_state_tree.IArrayType<mobx_state_tree.ISimpleType<string>>;
|
|
54
|
+
backgroundColor: mobx_state_tree.IOptionalIType<mobx_state_tree_dist_internal.IUnionType<[mobx_state_tree.ISimpleType<string>, mobx_state_tree.IType<Record<string, any>, Record<string, any>, Record<string, any>>]>, [undefined]>;
|
|
67
55
|
fonts: mobx_state_tree.IArrayType<mobx_state_tree.IModelType<{
|
|
68
56
|
fontFamily: mobx_state_tree.ISimpleType<string>;
|
|
69
57
|
name: mobx_state_tree.IOptionalIType<mobx_state_tree.ISimpleType<string>, [undefined]>;
|
|
@@ -79,28 +67,40 @@ declare const Store: mobx_state_tree.IModelType<{
|
|
|
79
67
|
}>, mobx_state_tree._NotCustomized>>;
|
|
80
68
|
editor: mobx_state_tree.IType<Editor | null | undefined, Editor | null, Editor | null>;
|
|
81
69
|
custom: mobx_state_tree.IType<any, any, any>;
|
|
82
|
-
objects: mobx_state_tree.IType<any, any, any>;
|
|
70
|
+
objects: mobx_state_tree.IType<any[] | null | undefined, any[], any[]>;
|
|
83
71
|
_key: mobx_state_tree.IType<string | undefined, string, string>;
|
|
84
72
|
_updateTrigger: mobx_state_tree.IType<number | undefined, number, number>;
|
|
85
73
|
_updateHistory: mobx_state_tree.IType<number | undefined, number, number>;
|
|
86
74
|
_updateFontSize: mobx_state_tree.IType<number | undefined, number, number>;
|
|
87
75
|
}, {
|
|
88
|
-
readonly selectedElements:
|
|
76
|
+
readonly selectedElements: FabricObject[];
|
|
89
77
|
} & {
|
|
90
|
-
readonly selectedShapes:
|
|
78
|
+
readonly selectedShapes: FabricObject<Partial<fabric.FabricObjectProps>, fabric.SerializedObjectProps, fabric.ObjectEvents>[];
|
|
79
|
+
find(callback: (e: any) => boolean): any;
|
|
80
|
+
getElementById(): void;
|
|
91
81
|
} & {
|
|
92
82
|
_setEditor(editor: Editor): void;
|
|
93
83
|
_triggerUpdate(): void;
|
|
94
84
|
_historyUpdate(): void;
|
|
95
85
|
_fontSizeUpdate(): void;
|
|
96
86
|
} & {
|
|
87
|
+
set(e: FabricObject, options: any): void;
|
|
88
|
+
setUnit({ unit, dpi }: {
|
|
89
|
+
unit: any;
|
|
90
|
+
dpi: any;
|
|
91
|
+
}): void;
|
|
97
92
|
setObjects(objects: any): void;
|
|
98
93
|
selectElements(ids: string[]): void;
|
|
99
94
|
openSidePanel(t: string): void;
|
|
100
95
|
deleteElements(ids: string[]): void;
|
|
101
96
|
setScale(scale: number): void;
|
|
102
97
|
clone(): void;
|
|
103
|
-
addElement(): void;
|
|
98
|
+
addElement(options: any): void;
|
|
99
|
+
setSize({ width, height, useMagic }: {
|
|
100
|
+
width: number;
|
|
101
|
+
height: number;
|
|
102
|
+
useMagic?: boolean;
|
|
103
|
+
}): void;
|
|
104
104
|
setupEditorListeners(): void;
|
|
105
105
|
} & {
|
|
106
106
|
_forEachElementUp(ids: Array<string>, callback: Function): void;
|
|
@@ -126,8 +126,8 @@ declare const Store: mobx_state_tree.IModelType<{
|
|
|
126
126
|
loadJSON: (data: any) => Promise<void>;
|
|
127
127
|
clear(): void;
|
|
128
128
|
} & {
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
removeFont(fontFamily: string): void;
|
|
130
|
+
addFont(font: FONT): void;
|
|
131
131
|
/**
|
|
132
132
|
* 加载字体(注入 CSS 并等待字体可用)
|
|
133
133
|
* @param fontFamily - 字体名称
|
|
@@ -151,6 +151,7 @@ declare function createStore({ key }: StoreProps): mobx_state_tree.ModelInstance
|
|
|
151
151
|
rulesVisible: mobx_state_tree.IType<boolean | undefined, boolean, boolean>;
|
|
152
152
|
openedSidePanel: mobx_state_tree.IType<string | undefined, string, string>;
|
|
153
153
|
selectedElementsIds: mobx_state_tree.IArrayType<mobx_state_tree.ISimpleType<string>>;
|
|
154
|
+
backgroundColor: mobx_state_tree.IOptionalIType<mobx_state_tree_dist_internal.IUnionType<[mobx_state_tree.ISimpleType<string>, mobx_state_tree.IType<Record<string, any>, Record<string, any>, Record<string, any>>]>, [undefined]>;
|
|
154
155
|
fonts: mobx_state_tree.IArrayType<mobx_state_tree.IModelType<{
|
|
155
156
|
fontFamily: mobx_state_tree.ISimpleType<string>;
|
|
156
157
|
name: mobx_state_tree.IOptionalIType<mobx_state_tree.ISimpleType<string>, [undefined]>;
|
|
@@ -166,28 +167,40 @@ declare function createStore({ key }: StoreProps): mobx_state_tree.ModelInstance
|
|
|
166
167
|
}>, mobx_state_tree._NotCustomized>>;
|
|
167
168
|
editor: mobx_state_tree.IType<Editor | null | undefined, Editor | null, Editor | null>;
|
|
168
169
|
custom: mobx_state_tree.IType<any, any, any>;
|
|
169
|
-
objects: mobx_state_tree.IType<any, any, any>;
|
|
170
|
+
objects: mobx_state_tree.IType<any[] | null | undefined, any[], any[]>;
|
|
170
171
|
_key: mobx_state_tree.IType<string | undefined, string, string>;
|
|
171
172
|
_updateTrigger: mobx_state_tree.IType<number | undefined, number, number>;
|
|
172
173
|
_updateHistory: mobx_state_tree.IType<number | undefined, number, number>;
|
|
173
174
|
_updateFontSize: mobx_state_tree.IType<number | undefined, number, number>;
|
|
174
175
|
}> & {
|
|
175
|
-
readonly selectedElements:
|
|
176
|
+
readonly selectedElements: FabricObject[];
|
|
176
177
|
} & {
|
|
177
|
-
readonly selectedShapes:
|
|
178
|
+
readonly selectedShapes: FabricObject<Partial<fabric.FabricObjectProps>, fabric.SerializedObjectProps, fabric.ObjectEvents>[];
|
|
179
|
+
find(callback: (e: any) => boolean): any;
|
|
180
|
+
getElementById(): void;
|
|
178
181
|
} & {
|
|
179
182
|
_setEditor(editor: Editor): void;
|
|
180
183
|
_triggerUpdate(): void;
|
|
181
184
|
_historyUpdate(): void;
|
|
182
185
|
_fontSizeUpdate(): void;
|
|
183
186
|
} & {
|
|
187
|
+
set(e: FabricObject, options: any): void;
|
|
188
|
+
setUnit({ unit, dpi }: {
|
|
189
|
+
unit: any;
|
|
190
|
+
dpi: any;
|
|
191
|
+
}): void;
|
|
184
192
|
setObjects(objects: any): void;
|
|
185
193
|
selectElements(ids: string[]): void;
|
|
186
194
|
openSidePanel(t: string): void;
|
|
187
195
|
deleteElements(ids: string[]): void;
|
|
188
196
|
setScale(scale: number): void;
|
|
189
197
|
clone(): void;
|
|
190
|
-
addElement(): void;
|
|
198
|
+
addElement(options: any): void;
|
|
199
|
+
setSize({ width, height, useMagic }: {
|
|
200
|
+
width: number;
|
|
201
|
+
height: number;
|
|
202
|
+
useMagic?: boolean;
|
|
203
|
+
}): void;
|
|
191
204
|
setupEditorListeners(): void;
|
|
192
205
|
} & {
|
|
193
206
|
_forEachElementUp(ids: Array<string>, callback: Function): void;
|
|
@@ -213,8 +226,8 @@ declare function createStore({ key }: StoreProps): mobx_state_tree.ModelInstance
|
|
|
213
226
|
loadJSON: (data: any) => Promise<void>;
|
|
214
227
|
clear(): void;
|
|
215
228
|
} & {
|
|
216
|
-
|
|
217
|
-
|
|
229
|
+
removeFont(fontFamily: string): void;
|
|
230
|
+
addFont(font: FONT): void;
|
|
218
231
|
/**
|
|
219
232
|
* 加载字体(注入 CSS 并等待字体可用)
|
|
220
233
|
* @param fontFamily - 字体名称
|
|
@@ -233,6 +246,7 @@ declare function createStore({ key }: StoreProps): mobx_state_tree.ModelInstance
|
|
|
233
246
|
rulesVisible: mobx_state_tree.IType<boolean | undefined, boolean, boolean>;
|
|
234
247
|
openedSidePanel: mobx_state_tree.IType<string | undefined, string, string>;
|
|
235
248
|
selectedElementsIds: mobx_state_tree.IArrayType<mobx_state_tree.ISimpleType<string>>;
|
|
249
|
+
backgroundColor: mobx_state_tree.IOptionalIType<mobx_state_tree_dist_internal.IUnionType<[mobx_state_tree.ISimpleType<string>, mobx_state_tree.IType<Record<string, any>, Record<string, any>, Record<string, any>>]>, [undefined]>;
|
|
236
250
|
fonts: mobx_state_tree.IArrayType<mobx_state_tree.IModelType<{
|
|
237
251
|
fontFamily: mobx_state_tree.ISimpleType<string>;
|
|
238
252
|
name: mobx_state_tree.IOptionalIType<mobx_state_tree.ISimpleType<string>, [undefined]>;
|
|
@@ -248,28 +262,40 @@ declare function createStore({ key }: StoreProps): mobx_state_tree.ModelInstance
|
|
|
248
262
|
}>, mobx_state_tree._NotCustomized>>;
|
|
249
263
|
editor: mobx_state_tree.IType<Editor | null | undefined, Editor | null, Editor | null>;
|
|
250
264
|
custom: mobx_state_tree.IType<any, any, any>;
|
|
251
|
-
objects: mobx_state_tree.IType<any, any, any>;
|
|
265
|
+
objects: mobx_state_tree.IType<any[] | null | undefined, any[], any[]>;
|
|
252
266
|
_key: mobx_state_tree.IType<string | undefined, string, string>;
|
|
253
267
|
_updateTrigger: mobx_state_tree.IType<number | undefined, number, number>;
|
|
254
268
|
_updateHistory: mobx_state_tree.IType<number | undefined, number, number>;
|
|
255
269
|
_updateFontSize: mobx_state_tree.IType<number | undefined, number, number>;
|
|
256
270
|
}, {
|
|
257
|
-
readonly selectedElements:
|
|
271
|
+
readonly selectedElements: FabricObject[];
|
|
258
272
|
} & {
|
|
259
|
-
readonly selectedShapes:
|
|
273
|
+
readonly selectedShapes: FabricObject<Partial<fabric.FabricObjectProps>, fabric.SerializedObjectProps, fabric.ObjectEvents>[];
|
|
274
|
+
find(callback: (e: any) => boolean): any;
|
|
275
|
+
getElementById(): void;
|
|
260
276
|
} & {
|
|
261
277
|
_setEditor(editor: Editor): void;
|
|
262
278
|
_triggerUpdate(): void;
|
|
263
279
|
_historyUpdate(): void;
|
|
264
280
|
_fontSizeUpdate(): void;
|
|
265
281
|
} & {
|
|
282
|
+
set(e: FabricObject, options: any): void;
|
|
283
|
+
setUnit({ unit, dpi }: {
|
|
284
|
+
unit: any;
|
|
285
|
+
dpi: any;
|
|
286
|
+
}): void;
|
|
266
287
|
setObjects(objects: any): void;
|
|
267
288
|
selectElements(ids: string[]): void;
|
|
268
289
|
openSidePanel(t: string): void;
|
|
269
290
|
deleteElements(ids: string[]): void;
|
|
270
291
|
setScale(scale: number): void;
|
|
271
292
|
clone(): void;
|
|
272
|
-
addElement(): void;
|
|
293
|
+
addElement(options: any): void;
|
|
294
|
+
setSize({ width, height, useMagic }: {
|
|
295
|
+
width: number;
|
|
296
|
+
height: number;
|
|
297
|
+
useMagic?: boolean;
|
|
298
|
+
}): void;
|
|
273
299
|
setupEditorListeners(): void;
|
|
274
300
|
} & {
|
|
275
301
|
_forEachElementUp(ids: Array<string>, callback: Function): void;
|
|
@@ -295,8 +321,8 @@ declare function createStore({ key }: StoreProps): mobx_state_tree.ModelInstance
|
|
|
295
321
|
loadJSON: (data: any) => Promise<void>;
|
|
296
322
|
clear(): void;
|
|
297
323
|
} & {
|
|
298
|
-
|
|
299
|
-
|
|
324
|
+
removeFont(fontFamily: string): void;
|
|
325
|
+
addFont(font: FONT): void;
|
|
300
326
|
/**
|
|
301
327
|
* 加载字体(注入 CSS 并等待字体可用)
|
|
302
328
|
* @param fontFamily - 字体名称
|
|
@@ -304,4 +330,4 @@ declare function createStore({ key }: StoreProps): mobx_state_tree.ModelInstance
|
|
|
304
330
|
loadFont(fontFamily: string): Promise<void[]>;
|
|
305
331
|
}, mobx_state_tree._NotCustomized, mobx_state_tree._NotCustomized>>;
|
|
306
332
|
|
|
307
|
-
export { type
|
|
333
|
+
export { type ExportOptions, Font, Store, type StoreProps, type StoreType, createStore, createStore as default, forEveryChild };
|
package/dist/model/store.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as u}from"../chunk-P5I43V7X.js";import{a as l,h as p,i as m,m as g}from"../chunk-WJT6VPDR.js";import"../chunk-O2XFH626.js";import{types as i,cast as y,flow as b,destroy as f}from"mobx-state-tree";var c=(e,t)=>{if(e?.objects)for(let r of e.objects){if(t(r)===!0)break;c(r,t)}},E=i.model("Font",{fontFamily:i.string,name:i.optional(i.string,""),url:i.optional(i.string,""),img:i.optional(i.string,""),styles:i.frozen()}).preProcessSnapshot(e=>Object.assign(Object.assign({},e),{fontFamily:e.fontFamily||e.name})),h=i.model("Store",{name:"yitu-design",width:1080,height:1080,scale:1,scaleToFit:1,unit:"px",dpi:72,bleed:0,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",selectedElementsIds:i.array(i.string),backgroundColor:i.optional(i.union(i.string,i.frozen()),"#fff"),fonts:i.array(E),editor:i.frozen(null),custom:i.frozen(),objects:i.frozen([]),_key:"",_updateTrigger:0,_updateHistory:0,_updateFontSize:0}).views(e=>({get selectedElements(){let t=e._updateTrigger;return console.log("_trigger\u90FD\u53D8\u5316\u662F\u89E6\u53D1\u805A\u7126\u5143\u7D20\u7684\u5237\u65B0 ---> ",t,e.selectedElementsIds.toJSON()),e.selectedElementsIds.map(r=>e.editor?.objectsHandler.findOneById(r))}})).views(e=>({get selectedShapes(){let t=[];return c({objects:e.selectedElements},r=>{r?.type!=="group"&&t.push(r)}),t},find(t){let r,a=e.editor?.customCanvas.canvas.getObjects();if(a)return c({objects:a},o=>{if(!r&&t(o))return r=o,!0}),r},getElementById(){}})).actions(e=>({_setEditor(t){e.editor=t},_triggerUpdate(){e._updateTrigger=e._updateTrigger+1},_historyUpdate(){e._updateHistory=e._updateHistory+1},_fontSizeUpdate(){e._updateFontSize=e._updateFontSize+1}})).actions(e=>({set(t,r){e.editor?.objectsHandler.update(r,t.id)},setUnit({unit:t,dpi:r}){e.unit=t||e.unit,e.dpi=r||e.dpi},setObjects(t){e.objects=t},selectElements(t){e.selectedElementsIds=y(t)},openSidePanel(t){e.openedSidePanel!==t&&(e.openedSidePanel=t)},deleteElements(t){t.forEach(r=>{e.editor?.objectsHandler.remove(r)})},setScale(t){e.scale=t},clone(){e.editor?.objectsHandler.clone()},addElement(t){console.log("\u6DFB\u52A0json\u6570\u636E",t),e.editor?.objectsHandler.addJson(t)},setSize({width:t,height:r,useMagic:a}){console.log("\u8BBE\u7F6E\u753B\u5E03\u5C3A\u5BF8: ---> ",t,r,a),e.width=t,e.height=r,e.editor?.workareaHandler.setSize({width:t,height:r})},setupEditorListeners(){e.editor&&(e.editor.on("object:modified",()=>{e._triggerUpdate()}),e.editor.on("history:change",()=>{e._historyUpdate()}),e.editor.on("textbox:modified",()=>{e._fontSizeUpdate()}))}})).actions(e=>({_forEachElementUp(t,r){if(!e.editor)return;let a=e.editor.layerHandler.getEffectiveLayers(),o=t.map(n=>({id:n,index:a.findIndex(d=>d.id===n)}));o.sort((n,d)=>d.index-n.index);for(let{index:n}of o){if(n==-1)continue;let d=n<a.length-1&&a[n+1],s=t.indexOf(d?.id)>=0;n===a.length-1||s||r(n)}},_forEachElementDown(t,r){if(!e.editor)return;let a=e.editor.layerHandler.getEffectiveLayers(),o=t.map(n=>({id:n,index:a.findIndex(d=>d.id===n)}));o.sort((n,d)=>d.index-n.index);for(let{index:n}of o){if(n==-1)continue;let d=n>0&&a[n-1],s=t.indexOf(d?.id)>=0;n===0||s||r(n)}return!1}})).actions(e=>({canMoveElementsUp(t){let r=!1;return e._forEachElementUp(t,()=>{r=!0}),r},moveElementsUp(t){if(!e.editor)return;let r=e.editor.layerHandler.getEffectiveLayers();[...t].map(o=>({id:o,index:r.findIndex(n=>n.id===o)})).filter(o=>o.index!==-1).sort((o,n)=>n.index-o.index).map(o=>o.id).forEach(o=>{e.editor?.layerHandler.bringForward(o)}),e._triggerUpdate()},canMoveElementsTop(t){return this.canMoveElementsUp(t)},moveElementsTop(t){e.editor&&(t.forEach(r=>{e.editor?.layerHandler.bringToFront(r)}),e._triggerUpdate())},canMoveElementsDown(t){let r=!1;return e._forEachElementDown(t,()=>{r=!0}),r},moveElementsDown(t){if(!e.editor)return;let r=e.editor.layerHandler.getEffectiveLayers();[...t].map(o=>({id:o,index:r.findIndex(n=>n.id===o)})).filter(o=>o.index!==-1).sort((o,n)=>o.index-n.index).map(o=>o.id).forEach(o=>{e.editor?.layerHandler.sendBackwards(o)}),e._triggerUpdate()},canMoveElementsBottom(t){return this.canMoveElementsDown(t)},moveElementsBottom(t){e.editor&&(t.forEach(r=>{e.editor?.layerHandler.sendToBack(r)}),e._triggerUpdate())},setElementZIndex(){}})).actions(e=>({async toDataURL(t){return e.editor?.rendererHandler.toDataURL(t)},async toBlob(t){return e.editor?.rendererHandler.toBlob(t)},async saveAsImage(t){if(!e.editor)return;let{fileName:r,...a}=t||{multiplier:1},o=await e.editor.rendererHandler.toBlob(a);o&&u(o,r||"yitu."+a.format)},toJSON(){return e.editor?.rendererHandler.toJSON()},toObject(){return e.editor?.rendererHandler.toObject()},loadJSON:b(function*(t){if(!e.editor)return;let r=yield e.editor.sceneHandler.importFromJSON(t);r&&(e.width=r.width,e.height=r.height,e.backgroundColor=r.fill)}),clear(){}})).actions(e=>({removeFont(t){e.fonts.filter(r=>r.fontFamily===t).forEach(r=>{f(r)})},addFont(t){this.removeFont(t.fontFamily),e.fonts.push(t),this.loadFont(t.fontFamily)},async loadFont(t){let r=e.fonts.find(n=>n.fontFamily===t)||l.find(n=>n.fontFamily===t),o=[{fontStyle:"normal",fontWeight:"normal"},{fontStyle:"normal",fontWeight:"bold"}];return r?(r.styles&&(o=r.styles.map(n=>({fontStyle:n.fontStyle||"normal",fontWeight:n.fontWeight||"normal"}))),m(r)):g(t),Promise.all(o.map(n=>p(t,n.fontStyle,n.fontWeight)))}}));function x({key:e}){return h.create({_key:e})}var v=x;export{E as Font,h as Store,x as createStore,v as default,c as forEveryChild};
|
package/dist/project.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { StoreType } from './model/store.js';
|
|
3
3
|
import { FONT } from './utils/fonts.js';
|
|
4
|
+
import 'fabric';
|
|
5
|
+
import 'mobx-state-tree/dist/internal';
|
|
4
6
|
import 'mobx-state-tree';
|
|
5
7
|
import '@ydesign/core';
|
|
6
8
|
import 'mobx';
|
|
@@ -10,6 +12,12 @@ interface ProjectOptions {
|
|
|
10
12
|
}
|
|
11
13
|
declare class Project {
|
|
12
14
|
store: StoreType;
|
|
15
|
+
status: string;
|
|
16
|
+
name: string;
|
|
17
|
+
id: string;
|
|
18
|
+
user: {};
|
|
19
|
+
skipSaving: boolean;
|
|
20
|
+
cloudEnabled: boolean;
|
|
13
21
|
constructor({ store }: ProjectOptions);
|
|
14
22
|
firstLoad(data?: any): Promise<void>;
|
|
15
23
|
getGlobalFont(fonts?: FONT[]): Promise<FONT[]>;
|
|
@@ -17,5 +25,6 @@ declare class Project {
|
|
|
17
25
|
declare const ProjectContext: react.Context<Project | null>;
|
|
18
26
|
declare const useProject: () => Project;
|
|
19
27
|
declare const createProject: (options: ProjectOptions) => Project;
|
|
28
|
+
type ProjectType = InstanceType<typeof Project>;
|
|
20
29
|
|
|
21
|
-
export { ProjectContext, createProject, createProject as default, useProject };
|
|
30
|
+
export { ProjectContext, type ProjectType, createProject, createProject as default, useProject };
|
package/dist/project.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d
|
|
1
|
+
import{a,b,c,d}from"./chunk-KLZXBPXI.js";import"./chunk-WJT6VPDR.js";import"./chunk-O2XFH626.js";export{a as ProjectContext,c as createProject,d as default,b as useProject};
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { StoreType } from '../model/store.js';
|
|
3
|
+
import 'fabric';
|
|
4
|
+
import 'mobx-state-tree/dist/internal';
|
|
3
5
|
import 'mobx-state-tree';
|
|
4
6
|
import '@ydesign/core';
|
|
7
|
+
import '../utils/fonts.js';
|
|
8
|
+
import 'mobx';
|
|
5
9
|
|
|
6
|
-
declare const
|
|
10
|
+
declare const setBackgroundColorsPreset: (newColors: string[]) => void;
|
|
11
|
+
declare const BackgroundPanel: (({ store }: {
|
|
7
12
|
store: StoreType;
|
|
8
|
-
}) => react_jsx_runtime.JSX.Element
|
|
13
|
+
}) => react_jsx_runtime.JSX.Element) & {
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
9
16
|
|
|
10
|
-
export { BackgroundPanel };
|
|
17
|
+
export { BackgroundPanel, setBackgroundColorsPreset };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-WGX437MN.js";import"../chunk-APQPKBER.js";import"../chunk-OQ6HU62L.js";import"../chunk-YRJUN267.js";import"../chunk-RVXI723F.js";import"../chunk-IQ7O55C5.js";import"../chunk-WCHGSVUC.js";import"../chunk-O2XFH626.js";export{b as BackgroundPanel,a as setBackgroundColorsPreset};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { FabricObject } from '@ydesign/core';
|
|
3
|
+
|
|
4
|
+
type Props<ImageType> = {
|
|
5
|
+
images: ImageType[] | undefined;
|
|
6
|
+
onSelect: (image: ImageType, pos?: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
}, element?: FabricObject | undefined, event?: any) => void;
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
getPreview: (image: ImageType) => string;
|
|
12
|
+
loadMore?: false | undefined | null | (() => void);
|
|
13
|
+
getCredit?: (image: ImageType) => any;
|
|
14
|
+
getImageClassName?: (image: ImageType) => string;
|
|
15
|
+
rowsNumber?: number;
|
|
16
|
+
crossOrigin?: string;
|
|
17
|
+
shadowEnabled?: boolean;
|
|
18
|
+
itemHeight?: number;
|
|
19
|
+
spacing?: number;
|
|
20
|
+
error?: any;
|
|
21
|
+
hideNoResults?: boolean;
|
|
22
|
+
};
|
|
23
|
+
declare const ImagesGrid: <ImageType>({ images, rowsNumber, isLoading, getPreview, getCredit, getImageClassName, onSelect, crossOrigin, shadowEnabled, itemHeight, error, hideNoResults, spacing, }: Props<ImageType>) => react_jsx_runtime.JSX.Element;
|
|
24
|
+
|
|
25
|
+
export { ImagesGrid };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"../chunk-IQ7O55C5.js";import"../chunk-WCHGSVUC.js";import"../chunk-O2XFH626.js";export{a as ImagesGrid};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
export { BackgroundSection, DEFAULT_SECTIONS, LayersSection, PhotosSection, Section, ShapesSection, default as SidePanel, SizeSection, TemplatesSection, TextSection, UploadSection } from './side-panel.js';
|
|
2
2
|
export { SectionTab } from './tab-button.js';
|
|
3
3
|
import '../model/store.js';
|
|
4
|
+
import 'fabric';
|
|
5
|
+
import 'mobx-state-tree/dist/internal';
|
|
4
6
|
import 'mobx-state-tree';
|
|
5
7
|
import '@ydesign/core';
|
|
8
|
+
import '../utils/fonts.js';
|
|
9
|
+
import 'mobx';
|
|
6
10
|
import 'react/jsx-runtime';
|
package/dist/side-panel/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r,b as e,c as f,d as m,e as p,f as t,g as x,h as a,i as b,j as c}from"../chunk-
|
|
1
|
+
import{a as r,b as e,c as f,d as m,e as p,f as t,g as x,h as a,i as b,j as c}from"../chunk-XK24AOVW.js";import"../chunk-XM3RPIUS.js";import"../chunk-Q2L6VKFI.js";import"../chunk-5C2MNUBC.js";import{a as o}from"../chunk-VXTF2OL2.js";import"../chunk-OV74NBJ5.js";import"../chunk-CMH73CYQ.js";import"../chunk-DBQHEZPG.js";import"../chunk-MXZ6RXT3.js";import"../chunk-WGX437MN.js";import"../chunk-APQPKBER.js";import"../chunk-OQ6HU62L.js";import"../chunk-YRJUN267.js";import"../chunk-RVXI723F.js";import"../chunk-IQ7O55C5.js";import"../chunk-WCHGSVUC.js";import"../chunk-AGNRQAPA.js";import"../chunk-4LUZF4CB.js";import"../chunk-DJBTBRPS.js";import"../chunk-MQZE5LZU.js";import"../chunk-7NNOHYKX.js";import"../chunk-O2XFH626.js";export{t as BackgroundSection,b as DEFAULT_SECTIONS,x as LayersSection,f as PhotosSection,o as SectionTab,m as ShapesSection,c as SidePanel,a as SizeSection,r as TemplatesSection,e as TextSection,p as UploadSection};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { StoreType } from '../model/store.js';
|
|
3
|
+
import 'fabric';
|
|
4
|
+
import 'mobx-state-tree/dist/internal';
|
|
3
5
|
import 'mobx-state-tree';
|
|
4
6
|
import '@ydesign/core';
|
|
7
|
+
import '../utils/fonts.js';
|
|
8
|
+
import 'mobx';
|
|
5
9
|
|
|
6
|
-
declare const LayersPanel: ({ store }: {
|
|
10
|
+
declare const LayersPanel: (({ store }: {
|
|
7
11
|
store: StoreType;
|
|
8
|
-
}) => react_jsx_runtime.JSX.Element
|
|
12
|
+
}) => react_jsx_runtime.JSX.Element) & {
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
9
15
|
|
|
10
16
|
export { LayersPanel };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-AGNRQAPA.js";import"../chunk-4LUZF4CB.js";import"../chunk-O2XFH626.js";export{a as LayersPanel};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { StoreType } from '../model/store.js';
|
|
3
|
+
import 'fabric';
|
|
4
|
+
import 'mobx-state-tree/dist/internal';
|
|
3
5
|
import 'mobx-state-tree';
|
|
4
6
|
import '@ydesign/core';
|
|
7
|
+
import '../utils/fonts.js';
|
|
8
|
+
import 'mobx';
|
|
5
9
|
|
|
6
10
|
declare const PhotosPanel: ({ store }: {
|
|
7
11
|
store: StoreType;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { StoreType } from '../model/store.js';
|
|
3
|
+
import 'fabric';
|
|
4
|
+
import 'mobx-state-tree/dist/internal';
|
|
3
5
|
import 'mobx-state-tree';
|
|
4
6
|
import '@ydesign/core';
|
|
7
|
+
import '../utils/fonts.js';
|
|
8
|
+
import 'mobx';
|
|
5
9
|
|
|
6
10
|
declare const ShapesPanel: ({ store }: {
|
|
7
11
|
store: StoreType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-XM3RPIUS.js";import"../chunk-MXZ6RXT3.js";import"../chunk-MQZE5LZU.js";import"../chunk-7NNOHYKX.js";import"../chunk-O2XFH626.js";export{a as ShapesPanel};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { StoreType } from '../model/store.js';
|
|
2
2
|
export { SectionTab } from './tab-button.js';
|
|
3
|
+
import 'fabric';
|
|
4
|
+
import 'mobx-state-tree/dist/internal';
|
|
3
5
|
import 'mobx-state-tree';
|
|
4
6
|
import '@ydesign/core';
|
|
7
|
+
import '../utils/fonts.js';
|
|
8
|
+
import 'mobx';
|
|
5
9
|
import 'react/jsx-runtime';
|
|
6
10
|
|
|
7
11
|
interface SectionTabProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l}from"../chunk-
|
|
1
|
+
import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i,i as j,j as k,k as l}from"../chunk-XK24AOVW.js";import"../chunk-XM3RPIUS.js";import"../chunk-Q2L6VKFI.js";import"../chunk-5C2MNUBC.js";import{a}from"../chunk-VXTF2OL2.js";import"../chunk-OV74NBJ5.js";import"../chunk-CMH73CYQ.js";import"../chunk-DBQHEZPG.js";import"../chunk-MXZ6RXT3.js";import"../chunk-WGX437MN.js";import"../chunk-APQPKBER.js";import"../chunk-OQ6HU62L.js";import"../chunk-YRJUN267.js";import"../chunk-RVXI723F.js";import"../chunk-IQ7O55C5.js";import"../chunk-WCHGSVUC.js";import"../chunk-AGNRQAPA.js";import"../chunk-4LUZF4CB.js";import"../chunk-DJBTBRPS.js";import"../chunk-MQZE5LZU.js";import"../chunk-7NNOHYKX.js";import"../chunk-O2XFH626.js";export{g as BackgroundSection,j as DEFAULT_SECTIONS,h as LayersSection,d as PhotosSection,a as SectionTab,e as ShapesSection,k as SidePanel,i as SizeSection,b as TemplatesSection,c as TextSection,f as UploadSection,l as default};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { StoreType } from '../model/store.js';
|
|
3
|
+
import 'fabric';
|
|
4
|
+
import 'mobx-state-tree/dist/internal';
|
|
3
5
|
import 'mobx-state-tree';
|
|
4
6
|
import '@ydesign/core';
|
|
7
|
+
import '../utils/fonts.js';
|
|
8
|
+
import 'mobx';
|
|
5
9
|
|
|
6
|
-
declare const SizePanel: ({ store }: {
|
|
10
|
+
declare const SizePanel: (({ store }: {
|
|
7
11
|
store: StoreType;
|
|
8
|
-
}) => react_jsx_runtime.JSX.Element
|
|
12
|
+
}) => react_jsx_runtime.JSX.Element) & {
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
9
15
|
|
|
10
16
|
export { SizePanel };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-Q2L6VKFI.js";import"../chunk-5C2MNUBC.js";import"../chunk-O2XFH626.js";export{a as SizePanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-VXTF2OL2.js";import"../chunk-O2XFH626.js";export{a as SectionTab};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { StoreType } from '../model/store.js';
|
|
3
|
+
import 'fabric';
|
|
4
|
+
import 'mobx-state-tree/dist/internal';
|
|
3
5
|
import 'mobx-state-tree';
|
|
4
6
|
import '@ydesign/core';
|
|
7
|
+
import '../utils/fonts.js';
|
|
8
|
+
import 'mobx';
|
|
5
9
|
|
|
6
|
-
declare const TemplatesPanel: ({ store }: {
|
|
10
|
+
declare const TemplatesPanel: (({ store }: {
|
|
7
11
|
store: StoreType;
|
|
8
|
-
}) => react_jsx_runtime.JSX.Element
|
|
12
|
+
}) => react_jsx_runtime.JSX.Element) & {
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
9
15
|
|
|
10
16
|
export { TemplatesPanel };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-OV74NBJ5.js";import"../chunk-IQ7O55C5.js";import"../chunk-WCHGSVUC.js";import"../chunk-O2XFH626.js";export{a as TemplatesPanel};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { StoreType } from '../model/store.js';
|
|
3
|
+
import 'fabric';
|
|
4
|
+
import 'mobx-state-tree/dist/internal';
|
|
3
5
|
import 'mobx-state-tree';
|
|
4
6
|
import '@ydesign/core';
|
|
7
|
+
import '../utils/fonts.js';
|
|
8
|
+
import 'mobx';
|
|
5
9
|
|
|
6
|
-
declare const TextPanel: ({ store }: {
|
|
10
|
+
declare const TextPanel: (({ store }: {
|
|
7
11
|
store: StoreType;
|
|
8
|
-
}) => react_jsx_runtime.JSX.Element
|
|
12
|
+
}) => react_jsx_runtime.JSX.Element) & {
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
9
15
|
|
|
10
16
|
export { TextPanel };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-CMH73CYQ.js";import"../chunk-IQ7O55C5.js";import"../chunk-WCHGSVUC.js";import"../chunk-O2XFH626.js";export{a as TextPanel};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { StoreType } from '../model/store.js';
|
|
3
|
+
import 'fabric';
|
|
4
|
+
import 'mobx-state-tree/dist/internal';
|
|
3
5
|
import 'mobx-state-tree';
|
|
4
6
|
import '@ydesign/core';
|
|
7
|
+
import '../utils/fonts.js';
|
|
8
|
+
import 'mobx';
|
|
5
9
|
|
|
6
10
|
declare const UploadPanel: ({ store }: {
|
|
7
11
|
store: StoreType;
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { StoreType } from '../model/store.js';
|
|
3
|
+
import 'fabric';
|
|
4
|
+
import 'mobx-state-tree/dist/internal';
|
|
3
5
|
import 'mobx-state-tree';
|
|
4
6
|
import '@ydesign/core';
|
|
7
|
+
import '../utils/fonts.js';
|
|
8
|
+
import 'mobx';
|
|
5
9
|
|
|
10
|
+
declare const BackgroundPicker: (({ store }: {
|
|
11
|
+
store: StoreType;
|
|
12
|
+
}) => react_jsx_runtime.JSX.Element) & {
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
6
15
|
type PageProps = {
|
|
7
16
|
store: StoreType;
|
|
8
17
|
components?: any;
|
|
9
18
|
};
|
|
10
19
|
declare const DefaultToolbar: ({ store, components }: PageProps) => react_jsx_runtime.JSX.Element;
|
|
11
20
|
|
|
12
|
-
export { DefaultToolbar, DefaultToolbar as default };
|
|
21
|
+
export { BackgroundPicker, DefaultToolbar, DefaultToolbar as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b,c}from"../chunk-APQPKBER.js";import"../chunk-OQ6HU62L.js";import"../chunk-YRJUN267.js";import"../chunk-RVXI723F.js";import"../chunk-WCHGSVUC.js";import"../chunk-O2XFH626.js";export{a as BackgroundPicker,b as DefaultToolbar,c as default};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { StoreType } from '../model/store.js';
|
|
3
|
+
import 'fabric';
|
|
4
|
+
import 'mobx-state-tree/dist/internal';
|
|
3
5
|
import 'mobx-state-tree';
|
|
4
6
|
import '@ydesign/core';
|
|
7
|
+
import '../utils/fonts.js';
|
|
8
|
+
import 'mobx';
|
|
5
9
|
|
|
6
10
|
declare const DownloadButton: ({ store }: {
|
|
7
11
|
store: StoreType;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { StoreType } from '../model/store.js';
|
|
3
|
+
import 'fabric';
|
|
4
|
+
import 'mobx-state-tree/dist/internal';
|
|
3
5
|
import 'mobx-state-tree';
|
|
4
6
|
import '@ydesign/core';
|
|
7
|
+
import '../utils/fonts.js';
|
|
8
|
+
import 'mobx';
|
|
5
9
|
|
|
6
10
|
declare const DuplicateButton: (({ store }: {
|
|
7
11
|
store: StoreType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../chunk-
|
|
1
|
+
import{a,b}from"../chunk-YRJUN267.js";import"../chunk-WCHGSVUC.js";import"../chunk-O2XFH626.js";export{b as ElementContainer,a as extendToolbar};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { StoreType } from '../model/store.js';
|
|
3
|
+
import { FabricObject } from '@ydesign/core';
|
|
4
|
+
import 'fabric';
|
|
5
|
+
import 'mobx-state-tree/dist/internal';
|
|
6
|
+
import 'mobx-state-tree';
|
|
7
|
+
import '../utils/fonts.js';
|
|
8
|
+
import 'mobx';
|
|
9
|
+
|
|
10
|
+
type Props = {
|
|
11
|
+
store: StoreType;
|
|
12
|
+
components?: any;
|
|
13
|
+
};
|
|
14
|
+
type ButtonProps = {
|
|
15
|
+
element?: FabricObject;
|
|
16
|
+
store: StoreType;
|
|
17
|
+
elements: FabricObject[];
|
|
18
|
+
};
|
|
19
|
+
declare const getFillKey: (fill: any) => string;
|
|
20
|
+
declare const FigureFill: (({ store, elements }: ButtonProps) => react_jsx_runtime.JSX.Element) & {
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
declare const FigureSettings: (({ store, element }: ButtonProps) => react_jsx_runtime.JSX.Element) & {
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
declare const FigureStroke: (({ store, elements }: ButtonProps) => react_jsx_runtime.JSX.Element | null) & {
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
declare const FigureToolbar: (({ store, components }: Props) => react_jsx_runtime.JSX.Element) & {
|
|
30
|
+
displayName: string;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { FigureFill, FigureSettings, FigureStroke, FigureToolbar, getFillKey };
|