react-design-editor 0.0.55 → 0.0.56
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/lib/handlers/Handler.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="lodash" />
|
|
2
|
-
import Handler from './Handler';
|
|
3
2
|
import { FabricObject } from '../utils';
|
|
4
|
-
|
|
3
|
+
import Handler from './Handler';
|
|
4
|
+
export declare type TransactionType = 'add' | 'remove' | 'modified' | 'moved' | 'scaled' | 'rotated' | 'skewed' | 'group' | 'ungroup' | 'paste' | 'bringForward' | 'bringToFront' | 'sendBackwards' | 'sendToBack' | 'redo' | 'undo';
|
|
5
5
|
export interface TransactionTransform {
|
|
6
6
|
scaleX?: number;
|
|
7
7
|
scaleY?: number;
|
package/lib/objects/Gif.js
CHANGED
|
@@ -2,33 +2,37 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const fabric_1 = require("fabric");
|
|
4
4
|
require("gifler");
|
|
5
|
-
const Gif = fabric_1.fabric.util.createClass(fabric_1.fabric.
|
|
5
|
+
const Gif = fabric_1.fabric.util.createClass(fabric_1.fabric.Image, {
|
|
6
6
|
type: 'gif',
|
|
7
7
|
superType: 'image',
|
|
8
8
|
gifCanvas: null,
|
|
9
|
+
gifler: undefined,
|
|
9
10
|
isStarted: false,
|
|
10
11
|
initialize(options) {
|
|
11
12
|
options = options || {};
|
|
12
|
-
this.callSuper('initialize', options);
|
|
13
13
|
this.gifCanvas = document.createElement('canvas');
|
|
14
|
+
this.callSuper('initialize', this.gifCanvas, options);
|
|
14
15
|
},
|
|
15
16
|
drawFrame(ctx, frame) {
|
|
16
17
|
// update canvas size
|
|
17
18
|
this.gifCanvas.width = frame.width;
|
|
18
19
|
this.gifCanvas.height = frame.height;
|
|
19
20
|
// update canvas that we are using for fabric.js
|
|
20
|
-
ctx.drawImage(frame.buffer,
|
|
21
|
+
ctx.drawImage(frame.buffer, 0, 0);
|
|
22
|
+
this.canvas?.renderAll();
|
|
21
23
|
},
|
|
22
24
|
_render(ctx) {
|
|
23
25
|
this.callSuper('_render', ctx);
|
|
26
|
+
this.dirty = true;
|
|
24
27
|
if (!this.isStarted) {
|
|
25
28
|
this.isStarted = true;
|
|
26
|
-
window
|
|
29
|
+
this.gifler = window
|
|
27
30
|
// @ts-ignore
|
|
28
|
-
.gifler('
|
|
29
|
-
.
|
|
31
|
+
.gifler('https://themadcreator.github.io/gifler/assets/gif/nyan.gif')
|
|
32
|
+
// .gifler('./images/sample/earth.gif')
|
|
33
|
+
.frames(this.gifCanvas, (context, frame) => {
|
|
30
34
|
this.isStarted = true;
|
|
31
|
-
this.drawFrame(
|
|
35
|
+
this.drawFrame(context, frame);
|
|
32
36
|
});
|
|
33
37
|
}
|
|
34
38
|
},
|
package/lib/objects/Svg.js
CHANGED
|
@@ -43,8 +43,8 @@ const Svg = fabric_1.fabric.util.createClass(fabric_1.fabric.Group, {
|
|
|
43
43
|
this.add(createdObj);
|
|
44
44
|
}
|
|
45
45
|
this.set({
|
|
46
|
-
fill: options.fill
|
|
47
|
-
stroke: options.stroke
|
|
46
|
+
fill: options.fill,
|
|
47
|
+
stroke: options.stroke,
|
|
48
48
|
});
|
|
49
49
|
this.setCoords();
|
|
50
50
|
if (this.canvas) {
|