@anu3ev/fabric-image-editor 0.7.16 → 0.7.18
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/main.js +160 -134
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1493,7 +1493,7 @@ var z = {
|
|
|
1493
1493
|
bottom: .28
|
|
1494
1494
|
}
|
|
1495
1495
|
}
|
|
1496
|
-
],
|
|
1496
|
+
], G = "circle", se = "center", ce = "middle", le = {};
|
|
1497
1497
|
for (let e = 0; e < oe.length; e += 1) {
|
|
1498
1498
|
let t = oe[e];
|
|
1499
1499
|
le[t.key] = t;
|
|
@@ -1737,7 +1737,7 @@ var Be = class e extends l {
|
|
|
1737
1737
|
this.set({
|
|
1738
1738
|
objectCaching: !1,
|
|
1739
1739
|
shapeComposite: !0
|
|
1740
|
-
}), this.shapeTextAutoExpand === void 0 && (this.shapeTextAutoExpand = !0), this.shapeAlignHorizontal === void 0 && (this.shapeAlignHorizontal =
|
|
1740
|
+
}), this.shapeTextAutoExpand === void 0 && (this.shapeTextAutoExpand = !0), this.shapeAlignHorizontal === void 0 && (this.shapeAlignHorizontal = se), this.shapeAlignVertical === void 0 && (this.shapeAlignVertical = ce);
|
|
1741
1741
|
let e = xe({ padding: {
|
|
1742
1742
|
top: this.shapePaddingTop,
|
|
1743
1743
|
right: this.shapePaddingRight,
|
|
@@ -5377,7 +5377,7 @@ var pr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
|
|
|
5377
5377
|
finalWidth: D,
|
|
5378
5378
|
finalHeight: O
|
|
5379
5379
|
});
|
|
5380
|
-
r.shapeManualBaseWidth = k.width, r.shapeManualBaseHeight = k.height;
|
|
5380
|
+
r.shapeManualBaseWidth = k.width, r.shapeManualBaseHeight = k.height, _ && w && (r.shapeTextAutoExpand = !1);
|
|
5381
5381
|
let A = i?.baseRounding ?? Math.max(0, r.shapeRounding ?? 0);
|
|
5382
5382
|
r.shapeRounding = Math.max(0, A * Math.min(y, b));
|
|
5383
5383
|
let j = e._resolveUserPadding({ group: r }), M = e._resolveInternalShapeTextInset({
|
|
@@ -6142,108 +6142,132 @@ var pr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
|
|
|
6142
6142
|
this.lifecycleController.finishTextUpdate({ textNode: n });
|
|
6143
6143
|
}, this.editor = e, Ve(), this.scalingController = new hr({ canvas: e.canvas }), this.editingController = new gr({ canvas: e.canvas }), this.editingPlacements = /* @__PURE__ */ new WeakMap(), this.lifecycleController = new _r({ canvas: e.canvas }), this.internalTextUpdates = /* @__PURE__ */ new WeakSet(), this._bindEvents();
|
|
6144
6144
|
}
|
|
6145
|
-
async add({ presetKey: e =
|
|
6145
|
+
async add({ presetKey: e = G, options: t = {} } = {}) {
|
|
6146
6146
|
let n = de({ presetKey: e });
|
|
6147
6147
|
if (!n) return null;
|
|
6148
|
-
let {
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
})
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
}), T = p ?? "middle", E = this._resolveShapeStyle({
|
|
6155
|
-
options: t,
|
|
6156
|
-
fallback: null
|
|
6157
|
-
}), O = xe({ padding: m }), k = ({ width: e, height: t }) => Te({
|
|
6158
|
-
baseInset: me({
|
|
6159
|
-
preset: b,
|
|
6160
|
-
width: e,
|
|
6161
|
-
height: t
|
|
6162
|
-
}),
|
|
6163
|
-
stroke: E.stroke,
|
|
6164
|
-
strokeWidth: E.strokeWidth
|
|
6165
|
-
}), A = Te({
|
|
6166
|
-
baseInset: me({
|
|
6167
|
-
preset: b,
|
|
6168
|
-
width: x,
|
|
6169
|
-
height: S
|
|
6170
|
-
}),
|
|
6171
|
-
stroke: E.stroke,
|
|
6172
|
-
strokeWidth: E.strokeWidth
|
|
6173
|
-
}), j = we({
|
|
6174
|
-
base: A,
|
|
6175
|
-
addition: O
|
|
6176
|
-
}), M = Ee({ padding: m }), N = this._createTextNode({
|
|
6177
|
-
text: u,
|
|
6178
|
-
textStyle: d,
|
|
6179
|
-
width: x,
|
|
6180
|
-
align: w,
|
|
6181
|
-
opacity: E.opacity
|
|
6182
|
-
}), P = this._resolveShapeLayoutWidth({
|
|
6183
|
-
text: N,
|
|
6184
|
-
currentWidth: x,
|
|
6185
|
-
manualWidth: x,
|
|
6186
|
-
shapeTextAutoExpandEnabled: C,
|
|
6187
|
-
padding: j,
|
|
6188
|
-
resolvePaddingForWidth: ({ width: e }) => we({
|
|
6189
|
-
base: k({
|
|
6190
|
-
width: e,
|
|
6191
|
-
height: S
|
|
6192
|
-
}),
|
|
6193
|
-
addition: O
|
|
6194
|
-
})
|
|
6195
|
-
}), F = await un({
|
|
6196
|
-
preset: b,
|
|
6197
|
-
width: P,
|
|
6198
|
-
height: S,
|
|
6199
|
-
style: E,
|
|
6200
|
-
rounding: h
|
|
6201
|
-
}), I = this._createShapeGroup({
|
|
6202
|
-
id: y ?? `shape-${D()}`,
|
|
6203
|
-
presetKey: b.key,
|
|
6204
|
-
presetCanRound: ge({ preset: b }),
|
|
6205
|
-
shape: F,
|
|
6206
|
-
text: N,
|
|
6207
|
-
width: P,
|
|
6208
|
-
height: S,
|
|
6209
|
-
manualWidth: x,
|
|
6210
|
-
manualHeight: S,
|
|
6211
|
-
shapeTextAutoExpand: C,
|
|
6212
|
-
alignH: w,
|
|
6213
|
-
alignV: T,
|
|
6214
|
-
padding: O,
|
|
6215
|
-
internalShapeTextInset: A,
|
|
6216
|
-
changedPadding: M,
|
|
6217
|
-
style: E,
|
|
6218
|
-
rounding: h
|
|
6219
|
-
}), L = {
|
|
6220
|
-
shape: I,
|
|
6221
|
-
presetKey: b.key,
|
|
6148
|
+
let { left: r, top: i, originX: a, originY: o, withoutAdding: s, withoutSelection: c, withoutSave: l } = t, u = await this._createShapeGroupForAdd({
|
|
6149
|
+
basePreset: n,
|
|
6150
|
+
options: t
|
|
6151
|
+
}), d = {
|
|
6152
|
+
shape: u,
|
|
6153
|
+
presetKey: u.shapePresetKey ?? n.key,
|
|
6222
6154
|
options: t
|
|
6223
6155
|
};
|
|
6224
|
-
if (
|
|
6156
|
+
if (r === void 0 && i === void 0) this.editor.canvasManager.centerObjectToMontageArea({ object: u });
|
|
6225
6157
|
else {
|
|
6226
6158
|
let e = this.editor.canvasManager.resolveObjectPlacement({
|
|
6227
|
-
object:
|
|
6228
|
-
left:
|
|
6229
|
-
top:
|
|
6230
|
-
originX:
|
|
6231
|
-
originY:
|
|
6159
|
+
object: u,
|
|
6160
|
+
left: r,
|
|
6161
|
+
top: i,
|
|
6162
|
+
originX: a,
|
|
6163
|
+
originY: o,
|
|
6232
6164
|
fallbackPoint: this.editor.canvasManager.getMontageAreaSceneCenter()
|
|
6233
6165
|
});
|
|
6234
6166
|
this.editor.canvasManager.applyObjectPlacement({
|
|
6235
|
-
object:
|
|
6167
|
+
object: u,
|
|
6236
6168
|
placement: e
|
|
6237
6169
|
});
|
|
6238
6170
|
}
|
|
6239
|
-
if (
|
|
6171
|
+
if (s) return this.editor.canvas.fire("editor:shape-added", d), u;
|
|
6240
6172
|
this._beginMutation();
|
|
6241
6173
|
try {
|
|
6242
|
-
this.editor.canvas.add(
|
|
6174
|
+
this.editor.canvas.add(u), c || this.editor.canvas.setActiveObject(u), this.editor.canvas.requestRenderAll();
|
|
6243
6175
|
} finally {
|
|
6244
|
-
this._endMutation({ withoutSave:
|
|
6176
|
+
this._endMutation({ withoutSave: l });
|
|
6177
|
+
}
|
|
6178
|
+
return this.editor.canvas.fire("editor:shape-added", d), u;
|
|
6179
|
+
}
|
|
6180
|
+
async _createShapeGroupForAdd({ basePreset: e, options: t }) {
|
|
6181
|
+
let { width: n, height: r, preserveAspectRatio: i, shapeTextAutoExpand: a, text: o, textStyle: s, alignH: c, alignV: l, textPadding: u, rounding: d, id: f } = t, p = de({ presetKey: fe({
|
|
6182
|
+
preset: e,
|
|
6183
|
+
rounding: d
|
|
6184
|
+
}) }) ?? e, { width: m, height: h } = p, g = !!i, _ = Math.max(1, n ?? m), v = Math.max(1, r ?? h), y, b;
|
|
6185
|
+
if (g) {
|
|
6186
|
+
y = n === void 0 ? void 0 : Math.max(1, n), b = r === void 0 ? void 0 : Math.max(1, r);
|
|
6187
|
+
let e = this._resolveAspectRatioFittedDimensions({
|
|
6188
|
+
targetWidth: y,
|
|
6189
|
+
targetHeight: b,
|
|
6190
|
+
aspectWidth: m,
|
|
6191
|
+
aspectHeight: h
|
|
6192
|
+
});
|
|
6193
|
+
_ = e.width, v = e.height;
|
|
6245
6194
|
}
|
|
6246
|
-
|
|
6195
|
+
let x = a !== !1, S = this._resolveHorizontalAlign({
|
|
6196
|
+
explicitAlign: c,
|
|
6197
|
+
textStyle: s
|
|
6198
|
+
}), C = l ?? "middle", w = this._resolveShapeStyle({
|
|
6199
|
+
options: t,
|
|
6200
|
+
fallback: null
|
|
6201
|
+
}), T = xe({ padding: u }), E = ({ width: e, height: t }) => Te({
|
|
6202
|
+
baseInset: me({
|
|
6203
|
+
preset: p,
|
|
6204
|
+
width: e,
|
|
6205
|
+
height: t
|
|
6206
|
+
}),
|
|
6207
|
+
stroke: w.stroke,
|
|
6208
|
+
strokeWidth: w.strokeWidth
|
|
6209
|
+
}), O = Te({
|
|
6210
|
+
baseInset: me({
|
|
6211
|
+
preset: p,
|
|
6212
|
+
width: _,
|
|
6213
|
+
height: v
|
|
6214
|
+
}),
|
|
6215
|
+
stroke: w.stroke,
|
|
6216
|
+
strokeWidth: w.strokeWidth
|
|
6217
|
+
}), k = we({
|
|
6218
|
+
base: O,
|
|
6219
|
+
addition: T
|
|
6220
|
+
}), A = Ee({ padding: u }), j = this._createTextNode({
|
|
6221
|
+
text: o,
|
|
6222
|
+
textStyle: s,
|
|
6223
|
+
width: _,
|
|
6224
|
+
align: S,
|
|
6225
|
+
opacity: w.opacity
|
|
6226
|
+
}), M = _;
|
|
6227
|
+
g || (M = this._resolveShapeLayoutWidth({
|
|
6228
|
+
text: j,
|
|
6229
|
+
currentWidth: _,
|
|
6230
|
+
manualWidth: _,
|
|
6231
|
+
shapeTextAutoExpandEnabled: x,
|
|
6232
|
+
padding: k,
|
|
6233
|
+
resolvePaddingForWidth: ({ width: e }) => we({
|
|
6234
|
+
base: E({
|
|
6235
|
+
width: e,
|
|
6236
|
+
height: v
|
|
6237
|
+
}),
|
|
6238
|
+
addition: T
|
|
6239
|
+
})
|
|
6240
|
+
}));
|
|
6241
|
+
let N = await un({
|
|
6242
|
+
preset: p,
|
|
6243
|
+
width: M,
|
|
6244
|
+
height: v,
|
|
6245
|
+
style: w,
|
|
6246
|
+
rounding: d
|
|
6247
|
+
});
|
|
6248
|
+
return this._createShapeGroup({
|
|
6249
|
+
id: f ?? `shape-${D()}`,
|
|
6250
|
+
presetKey: p.key,
|
|
6251
|
+
presetCanRound: ge({ preset: p }),
|
|
6252
|
+
shape: N,
|
|
6253
|
+
text: j,
|
|
6254
|
+
width: M,
|
|
6255
|
+
height: v,
|
|
6256
|
+
manualWidth: _,
|
|
6257
|
+
manualHeight: v,
|
|
6258
|
+
replaceBoxWidth: y,
|
|
6259
|
+
replaceBoxHeight: b,
|
|
6260
|
+
preserveAspectRatio: g,
|
|
6261
|
+
shapeTextAutoExpand: x,
|
|
6262
|
+
alignH: S,
|
|
6263
|
+
alignV: C,
|
|
6264
|
+
padding: T,
|
|
6265
|
+
internalShapeTextInset: O,
|
|
6266
|
+
resolveInternalShapeTextInset: E,
|
|
6267
|
+
changedPadding: A,
|
|
6268
|
+
style: w,
|
|
6269
|
+
rounding: d
|
|
6270
|
+
});
|
|
6247
6271
|
}
|
|
6248
6272
|
async update({ target: e, presetKey: t, options: n = {} } = {}) {
|
|
6249
6273
|
let r = this._resolveShapeGroup({ target: e });
|
|
@@ -6314,21 +6338,21 @@ var pr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
|
|
|
6314
6338
|
top: 0,
|
|
6315
6339
|
originX: "left",
|
|
6316
6340
|
originY: "top"
|
|
6317
|
-
}, oe = U,
|
|
6341
|
+
}, oe = U, G = this._createTextNode({
|
|
6318
6342
|
text: oe.textCaseRaw ?? U.text ?? "",
|
|
6319
6343
|
textStyle: this._resolveCurrentTextStyle({ textNode: U }),
|
|
6320
6344
|
width: Math.max(1, U.width ?? S.width),
|
|
6321
6345
|
align: L
|
|
6322
6346
|
});
|
|
6323
|
-
|
|
6324
|
-
textNode:
|
|
6347
|
+
G.set(ae), this._applyTextUpdates({
|
|
6348
|
+
textNode: G,
|
|
6325
6349
|
text: p,
|
|
6326
6350
|
textStyle: m,
|
|
6327
6351
|
align: L
|
|
6328
6352
|
});
|
|
6329
|
-
let
|
|
6330
|
-
|
|
6331
|
-
text:
|
|
6353
|
+
let se = l === void 0 && u === void 0 && t === void 0 && f === void 0 && v === void 0 && p === void 0 && !this._hasShapeTextSizeAffectingStyleChanges({ textStyle: m }), ce = _ !== void 0 && se, le = F, ue = I;
|
|
6354
|
+
se ? (le = S.width, ue = S.height) : N || (le = this._resolveShapeLayoutWidth({
|
|
6355
|
+
text: G,
|
|
6332
6356
|
currentWidth: F,
|
|
6333
6357
|
manualWidth: V,
|
|
6334
6358
|
shapeTextAutoExpandEnabled: E,
|
|
@@ -6489,27 +6513,27 @@ var pr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
|
|
|
6489
6513
|
}
|
|
6490
6514
|
return this.lifecycleController.fireUpdated({ lifecycle: c }), a;
|
|
6491
6515
|
}
|
|
6492
|
-
setOpacity({ target: e, opacity: t,
|
|
6493
|
-
let
|
|
6494
|
-
if (!r) return null;
|
|
6495
|
-
let { shape: i, text: a } = q({ group: r });
|
|
6516
|
+
setOpacity({ target: e, opacity: t, applyToText: n = !0, withoutSave: r }) {
|
|
6517
|
+
let i = this._resolveShapeGroup({ target: e });
|
|
6496
6518
|
if (!i) return null;
|
|
6497
|
-
let o =
|
|
6498
|
-
|
|
6519
|
+
let { shape: a, text: o } = q({ group: i });
|
|
6520
|
+
if (!a) return null;
|
|
6521
|
+
let s = this.lifecycleController.createContext({
|
|
6522
|
+
group: i,
|
|
6499
6523
|
source: "opacity",
|
|
6500
6524
|
target: e,
|
|
6501
|
-
withoutSave:
|
|
6525
|
+
withoutSave: r
|
|
6502
6526
|
});
|
|
6503
6527
|
this._beginMutation();
|
|
6504
6528
|
try {
|
|
6505
6529
|
Zt({
|
|
6506
|
-
shape:
|
|
6530
|
+
shape: a,
|
|
6507
6531
|
style: { opacity: t }
|
|
6508
|
-
}),
|
|
6532
|
+
}), n && o && (o.set({ opacity: t }), o.setCoords()), i.shapeOpacity = t, i.setCoords(), this.lifecycleController.fireBefore({ lifecycle: s }), this.editor.canvas.requestRenderAll();
|
|
6509
6533
|
} finally {
|
|
6510
|
-
this._endMutation({ withoutSave:
|
|
6534
|
+
this._endMutation({ withoutSave: r });
|
|
6511
6535
|
}
|
|
6512
|
-
return this.lifecycleController.fireUpdated({ lifecycle:
|
|
6536
|
+
return this.lifecycleController.fireUpdated({ lifecycle: s }), i;
|
|
6513
6537
|
}
|
|
6514
6538
|
getTextNode({ target: e } = {}) {
|
|
6515
6539
|
let t = this._resolveShapeGroup({ target: e });
|
|
@@ -6604,8 +6628,8 @@ var pr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
|
|
|
6604
6628
|
let { canvas: e } = this.editor;
|
|
6605
6629
|
e.on("object:scaling", this._handleObjectScaling), e.on("object:modified", this._handleObjectModified), e.on("mouse:move", this._handleMouseMove), e.on("mouse:down", this._handleMouseDown), e.on("mouse:up", this._handleMouseUp), e.on("text:editing:entered", this._handleTextEditingEntered), e.on("text:editing:exited", this._handleTextEditingExited), e.on("text:changed", this._handleTextChanged), e.on("editor:before:text-updated", this._handleBeforeTextUpdated), e.on("editor:text-updated", this._handleTextUpdated);
|
|
6606
6630
|
}
|
|
6607
|
-
_createShapeGroup({ id: e, presetKey: t, presetCanRound: n, shape: r, text: i, width: a, height: o, manualWidth: s, manualHeight: c,
|
|
6608
|
-
let
|
|
6631
|
+
_createShapeGroup({ id: e, presetKey: t, presetCanRound: n, shape: r, text: i, width: a, height: o, manualWidth: s, manualHeight: c, replaceBoxWidth: l, replaceBoxHeight: u, preserveAspectRatio: d, shapeTextAutoExpand: f, alignH: p, alignV: m, padding: h, internalShapeTextInset: g, resolveInternalShapeTextInset: _, changedPadding: v, style: y, rounding: b }) {
|
|
6632
|
+
let x = new Be([r, i], {
|
|
6609
6633
|
originX: "center",
|
|
6610
6634
|
originY: "center",
|
|
6611
6635
|
left: 0,
|
|
@@ -6613,35 +6637,37 @@ var pr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
|
|
|
6613
6637
|
lockScalingFlip: !0,
|
|
6614
6638
|
centeredScaling: !1,
|
|
6615
6639
|
objectCaching: !1
|
|
6616
|
-
}),
|
|
6617
|
-
return
|
|
6618
|
-
group:
|
|
6640
|
+
}), S = x;
|
|
6641
|
+
return S.id = e, this._applyShapeGroupMetadata({
|
|
6642
|
+
group: x,
|
|
6619
6643
|
presetKey: t,
|
|
6620
6644
|
presetCanRound: n,
|
|
6621
6645
|
width: a,
|
|
6622
6646
|
height: o,
|
|
6623
6647
|
manualWidth: s,
|
|
6624
6648
|
manualHeight: c,
|
|
6625
|
-
shapeTextAutoExpand:
|
|
6626
|
-
alignH:
|
|
6627
|
-
alignV:
|
|
6628
|
-
padding:
|
|
6629
|
-
style:
|
|
6630
|
-
rounding:
|
|
6631
|
-
}),
|
|
6632
|
-
group:
|
|
6649
|
+
shapeTextAutoExpand: f,
|
|
6650
|
+
alignH: p,
|
|
6651
|
+
alignV: m,
|
|
6652
|
+
padding: h,
|
|
6653
|
+
style: y,
|
|
6654
|
+
rounding: b
|
|
6655
|
+
}), x.rehydrateRuntimeState(), Ge({ group: x }), Oe({ text: i }), On({
|
|
6656
|
+
group: x,
|
|
6633
6657
|
shape: r,
|
|
6634
6658
|
text: i,
|
|
6635
6659
|
width: a,
|
|
6636
6660
|
height: o,
|
|
6637
|
-
alignH:
|
|
6638
|
-
alignV:
|
|
6639
|
-
padding:
|
|
6640
|
-
shapeTextAutoExpandEnabled:
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6661
|
+
alignH: p,
|
|
6662
|
+
alignV: m,
|
|
6663
|
+
padding: h,
|
|
6664
|
+
shapeTextAutoExpandEnabled: f,
|
|
6665
|
+
preserveAspectRatio: d,
|
|
6666
|
+
internalShapeTextInset: g,
|
|
6667
|
+
resolveInternalShapeTextInset: _,
|
|
6668
|
+
montageAreaWidth: d ? this._resolveMontageAreaWidth() : void 0,
|
|
6669
|
+
changedPadding: v
|
|
6670
|
+
}), d && (x.shapeManualBaseWidth = Math.max(1, x.shapeBaseWidth ?? a), x.shapeManualBaseHeight = Math.max(1, x.shapeBaseHeight ?? o)), x.shapeReplaceBoxWidth = Math.max(1, l ?? 0, x.shapeBaseWidth ?? a), x.shapeReplaceBoxHeight = Math.max(1, u ?? 0, x.shapeBaseHeight ?? o), this._detachShapeGroupAutoLayout({ group: x }), x;
|
|
6645
6671
|
}
|
|
6646
6672
|
_applyShapeGroupMetadata({ group: e, presetKey: t, presetCanRound: n, width: r, height: i, manualWidth: a, manualHeight: o, replaceBoxWidth: s, replaceBoxHeight: c, shapeTextAutoExpand: l, alignH: u, alignV: d, padding: f, style: p, rounding: m }) {
|
|
6647
6673
|
let h = p.strokeDashArray ? p.strokeDashArray.slice() : p.strokeDashArray ?? null;
|
|
@@ -6906,7 +6932,7 @@ var pr = ({ group: e, shape: t, text: n, layout: r, alignH: i, scaleX: a, scaleY
|
|
|
6906
6932
|
_resolveHorizontalAlign({ explicitAlign: e, textStyle: t }) {
|
|
6907
6933
|
if (e) return e;
|
|
6908
6934
|
let n = t?.align;
|
|
6909
|
-
return n === "left" || n === "center" || n === "right" || n === "justify" ? n :
|
|
6935
|
+
return n === "left" || n === "center" || n === "right" || n === "justify" ? n : se;
|
|
6910
6936
|
}
|
|
6911
6937
|
_hasShapeTextSizeAffectingStyleChanges({ textStyle: e }) {
|
|
6912
6938
|
if (!e) return !1;
|
|
@@ -8745,16 +8771,16 @@ var ci = class {
|
|
|
8745
8771
|
}) : null, H = {}, ie = {}, U = {}, W, ae, oe = Mr({
|
|
8746
8772
|
textbox: s,
|
|
8747
8773
|
range: B
|
|
8748
|
-
}),
|
|
8749
|
-
if (h !== void 0 && (V && (ie.fontFamily = h),
|
|
8774
|
+
}), G = !B || oe, se = !B;
|
|
8775
|
+
if (h !== void 0 && (V && (ie.fontFamily = h), G && (z.fontFamily = h, se && (U.fontFamily = h))), g !== void 0 && (V && (ie.fontSize = g), G && (z.fontSize = g, se && (U.fontSize = g))), _ !== void 0) {
|
|
8750
8776
|
let e = _ ? "bold" : "normal";
|
|
8751
|
-
B && (H.fontWeight = e),
|
|
8777
|
+
B && (H.fontWeight = e), G && (z.fontWeight = e, se && (U.fontWeight = e));
|
|
8752
8778
|
}
|
|
8753
8779
|
if (v !== void 0) {
|
|
8754
8780
|
let e = v ? "italic" : "normal";
|
|
8755
|
-
B && (H.fontStyle = e),
|
|
8781
|
+
B && (H.fontStyle = e), G && (z.fontStyle = e, se && (U.fontStyle = e));
|
|
8756
8782
|
}
|
|
8757
|
-
if (y !== void 0 && (B && (H.underline = y),
|
|
8783
|
+
if (y !== void 0 && (B && (H.underline = y), G && (z.underline = y, se && (U.underline = y))), x !== void 0 && (B && (H.linethrough = x), G && (z.linethrough = x, se && (U.linethrough = x))), S !== void 0 && (z.textAlign = S), C !== void 0 && (B && (H.fill = C), G && (z.fill = C, se && (U.fill = C))), w !== void 0 || T !== void 0) {
|
|
8758
8784
|
let e = B ? Pr({
|
|
8759
8785
|
textbox: s,
|
|
8760
8786
|
range: B,
|
|
@@ -8767,7 +8793,7 @@ var ci = class {
|
|
|
8767
8793
|
ae = Ir({ width: T ?? e ?? s.strokeWidth ?? 0 }), W = Fr({
|
|
8768
8794
|
strokeColor: w ?? t ?? s.stroke ?? void 0,
|
|
8769
8795
|
width: ae
|
|
8770
|
-
}), B && (H.stroke = W, H.strokeWidth = ae),
|
|
8796
|
+
}), B && (H.stroke = W, H.strokeWidth = ae), G && (z.stroke = W, z.strokeWidth = ae, se && (U.stroke = W, U.strokeWidth = ae));
|
|
8771
8797
|
}
|
|
8772
8798
|
E !== void 0 && (z.opacity = E), D !== void 0 && (z.backgroundColor = D), O !== void 0 && (z.backgroundOpacity = O), k !== void 0 && (z.paddingTop = k), A !== void 0 && (z.paddingRight = A), j !== void 0 && (z.paddingBottom = j), M !== void 0 && (z.paddingLeft = M), N !== void 0 && (z.radiusTopLeft = N), P !== void 0 && (z.radiusTopRight = P), F !== void 0 && (z.radiusBottomRight = F), I !== void 0 && (z.radiusBottomLeft = I);
|
|
8773
8799
|
let ce = s.textCaseRaw ?? c, le = !!s.uppercase, ue = p !== void 0, de = ue ? p ?? "" : ce, fe = b ?? le, pe = fe !== le;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anu3ev/fabric-image-editor",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.18",
|
|
4
4
|
"description": "TypeScript image editor library built on FabricJS, allowing you to create instances with an integrated montage area and providing an API to modify and manage state.",
|
|
5
5
|
"module": "dist/main.js",
|
|
6
6
|
"files": [
|