react-design-editor 0.0.52 → 0.0.54
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/dist/react-design-editor.js +25 -11
- package/dist/react-design-editor.min.js +1 -1
- package/lib/handlers/EventHandler.js +4 -2
- package/lib/handlers/Handler.d.ts +6 -0
- package/lib/handlers/Handler.js +3 -1
- package/lib/handlers/ZoomHandler.d.ts +3 -2
- package/lib/handlers/ZoomHandler.js +4 -3
- package/package.json +1 -1
|
@@ -193676,9 +193676,12 @@ var TransactionHandler_TransactionHandler = /*#__PURE__*/createClass_default()(f
|
|
|
193676
193676
|
var ZoomHandler_ZoomHandler = /*#__PURE__*/createClass_default()(function ZoomHandler(handler) {
|
|
193677
193677
|
var _this = this;
|
|
193678
193678
|
|
|
193679
|
+
var zoomStep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.05;
|
|
193680
|
+
|
|
193679
193681
|
classCallCheck_default()(this, ZoomHandler);
|
|
193680
193682
|
|
|
193681
193683
|
this.handler = void 0;
|
|
193684
|
+
this._zoomStep = void 0;
|
|
193682
193685
|
|
|
193683
193686
|
this.zoomToPoint = function (point, zoom) {
|
|
193684
193687
|
var _this$handler = _this.handler,
|
|
@@ -193759,7 +193762,7 @@ var ZoomHandler_ZoomHandler = /*#__PURE__*/createClass_default()(function ZoomHa
|
|
|
193759
193762
|
this.zoomIn = function () {
|
|
193760
193763
|
var zoomRatio = _this.handler.canvas.getZoom();
|
|
193761
193764
|
|
|
193762
|
-
zoomRatio +=
|
|
193765
|
+
zoomRatio += _this._zoomStep;
|
|
193763
193766
|
|
|
193764
193767
|
var center = _this.handler.canvas.getCenter();
|
|
193765
193768
|
|
|
@@ -193769,7 +193772,7 @@ var ZoomHandler_ZoomHandler = /*#__PURE__*/createClass_default()(function ZoomHa
|
|
|
193769
193772
|
this.zoomOut = function () {
|
|
193770
193773
|
var zoomRatio = _this.handler.canvas.getZoom();
|
|
193771
193774
|
|
|
193772
|
-
zoomRatio -=
|
|
193775
|
+
zoomRatio -= _this._zoomStep;
|
|
193773
193776
|
|
|
193774
193777
|
var center = _this.handler.canvas.getCenter();
|
|
193775
193778
|
|
|
@@ -193831,6 +193834,7 @@ var ZoomHandler_ZoomHandler = /*#__PURE__*/createClass_default()(function ZoomHa
|
|
|
193831
193834
|
};
|
|
193832
193835
|
|
|
193833
193836
|
this.handler = handler;
|
|
193837
|
+
this._zoomStep = zoomStep;
|
|
193834
193838
|
}
|
|
193835
193839
|
/**
|
|
193836
193840
|
* Zoom to point
|
|
@@ -200150,9 +200154,9 @@ var EventHandler_EventHandler = /*#__PURE__*/function () {
|
|
|
200150
200154
|
var zoomRatio = _this.handler.canvas.getZoom();
|
|
200151
200155
|
|
|
200152
200156
|
if (delta > 0) {
|
|
200153
|
-
zoomRatio -=
|
|
200157
|
+
zoomRatio -= _this.handler.zoomStep;
|
|
200154
200158
|
} else {
|
|
200155
|
-
zoomRatio +=
|
|
200159
|
+
zoomRatio += _this.handler.zoomStep;
|
|
200156
200160
|
}
|
|
200157
200161
|
|
|
200158
200162
|
_this.handler.zoomHandler.zoomToPoint(new fabric["fabric"].Point(_this.handler.canvas.getWidth() / 2, _this.handler.canvas.getHeight() / 2), zoomRatio);
|
|
@@ -200542,6 +200546,8 @@ var EventHandler_EventHandler = /*#__PURE__*/function () {
|
|
|
200542
200546
|
});
|
|
200543
200547
|
|
|
200544
200548
|
if (filteredObjects.length === 1) {
|
|
200549
|
+
var _this$handler$onAdd, _this$handler3;
|
|
200550
|
+
|
|
200545
200551
|
var obj = filteredObjects[0];
|
|
200546
200552
|
|
|
200547
200553
|
if (typeof obj.cloneable !== 'undefined' && !obj.cloneable) {
|
|
@@ -200556,7 +200562,11 @@ var EventHandler_EventHandler = /*#__PURE__*/function () {
|
|
|
200556
200562
|
_this.handler.canvas.setActiveObject(createdObj);
|
|
200557
200563
|
|
|
200558
200564
|
_this.handler.canvas.requestRenderAll();
|
|
200565
|
+
|
|
200566
|
+
(_this$handler$onAdd = (_this$handler3 = _this.handler).onAdd) === null || _this$handler$onAdd === void 0 ? void 0 : _this$handler$onAdd.call(_this$handler3, createdObj);
|
|
200559
200567
|
} else {
|
|
200568
|
+
var _this$handler$onAdd2, _this$handler4;
|
|
200569
|
+
|
|
200560
200570
|
var nodes = [];
|
|
200561
200571
|
var targets = [];
|
|
200562
200572
|
objects.forEach(function (obj) {
|
|
@@ -200587,6 +200597,8 @@ var EventHandler_EventHandler = /*#__PURE__*/function () {
|
|
|
200587
200597
|
_this.handler.canvas.setActiveObject(activeSelection);
|
|
200588
200598
|
|
|
200589
200599
|
_this.handler.canvas.requestRenderAll();
|
|
200600
|
+
|
|
200601
|
+
(_this$handler$onAdd2 = (_this$handler4 = _this.handler).onAdd) === null || _this$handler$onAdd2 === void 0 ? void 0 : _this$handler$onAdd2.call(_this$handler4, activeSelection);
|
|
200590
200602
|
}
|
|
200591
200603
|
|
|
200592
200604
|
if (!_this.handler.transactionHandler.active) {
|
|
@@ -200642,9 +200654,9 @@ var EventHandler_EventHandler = /*#__PURE__*/function () {
|
|
|
200642
200654
|
}();
|
|
200643
200655
|
|
|
200644
200656
|
this.keydown = function (e) {
|
|
200645
|
-
var _this$
|
|
200646
|
-
keyEvent = _this$
|
|
200647
|
-
editable = _this$
|
|
200657
|
+
var _this$handler5 = _this.handler,
|
|
200658
|
+
keyEvent = _this$handler5.keyEvent,
|
|
200659
|
+
editable = _this$handler5.editable;
|
|
200648
200660
|
|
|
200649
200661
|
if (!Object.keys(keyEvent).length) {
|
|
200650
200662
|
return;
|
|
@@ -200764,9 +200776,9 @@ var EventHandler_EventHandler = /*#__PURE__*/function () {
|
|
|
200764
200776
|
|
|
200765
200777
|
this.contextmenu = function (e) {
|
|
200766
200778
|
e.preventDefault();
|
|
200767
|
-
var _this$
|
|
200768
|
-
editable = _this$
|
|
200769
|
-
onContext = _this$
|
|
200779
|
+
var _this$handler6 = _this.handler,
|
|
200780
|
+
editable = _this$handler6.editable,
|
|
200781
|
+
onContext = _this$handler6.onContext;
|
|
200770
200782
|
|
|
200771
200783
|
if (editable && onContext) {
|
|
200772
200784
|
var target = _this.handler.canvas.findTarget(e, false);
|
|
@@ -201742,6 +201754,7 @@ var Handler_Handler = /*#__PURE__*/function () {
|
|
|
201742
201754
|
this.interactionMode = void 0;
|
|
201743
201755
|
this.minZoom = void 0;
|
|
201744
201756
|
this.maxZoom = void 0;
|
|
201757
|
+
this.zoomStep = 0.05;
|
|
201745
201758
|
this.propertiesToInclude = defaults_namespaceObject.propertiesToInclude;
|
|
201746
201759
|
this.workareaOption = defaults_namespaceObject.workareaOption;
|
|
201747
201760
|
this.canvasOption = defaults_namespaceObject.canvasOption;
|
|
@@ -201809,6 +201822,7 @@ var Handler_Handler = /*#__PURE__*/function () {
|
|
|
201809
201822
|
_this.interactionMode = options.interactionMode;
|
|
201810
201823
|
_this.minZoom = options.minZoom;
|
|
201811
201824
|
_this.maxZoom = options.maxZoom;
|
|
201825
|
+
_this.zoomStep = options.zoomStep || 0.05;
|
|
201812
201826
|
_this.zoomEnabled = options.zoomEnabled;
|
|
201813
201827
|
_this.width = options.width;
|
|
201814
201828
|
_this.height = options.height;
|
|
@@ -201857,7 +201871,7 @@ var Handler_Handler = /*#__PURE__*/function () {
|
|
|
201857
201871
|
_this.animationHandler = new handlers_AnimationHandler(_this);
|
|
201858
201872
|
_this.contextmenuHandler = new handlers_ContextmenuHandler(_this);
|
|
201859
201873
|
_this.tooltipHandler = new handlers_TooltipHandler(_this);
|
|
201860
|
-
_this.zoomHandler = new handlers_ZoomHandler(_this);
|
|
201874
|
+
_this.zoomHandler = new handlers_ZoomHandler(_this, _this.zoomStep);
|
|
201861
201875
|
_this.interactionHandler = new handlers_InteractionHandler(_this);
|
|
201862
201876
|
_this.transactionHandler = new handlers_TransactionHandler(_this);
|
|
201863
201877
|
_this.gridHandler = new handlers_GridHandler(_this);
|