@leapfrog/interactive-canvas 1.14.1 → 1.14.2
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/index.d.ts
CHANGED
|
@@ -51,3 +51,4 @@ export * from "./abstract-interactive-canvas";
|
|
|
51
51
|
export * from "./headless-interactive-canvas";
|
|
52
52
|
export * from "./interactive-canvas";
|
|
53
53
|
export * from "./interactive-canvas.interface";
|
|
54
|
+
export { ExtendedFabricTextbox } from "./object/impl/extended-fabric-textbox.interface";
|
|
@@ -2251,14 +2251,14 @@ var Text = /** @class */ (function (_super) {
|
|
|
2251
2251
|
* @inheritDoc
|
|
2252
2252
|
*/
|
|
2253
2253
|
Text.prototype.getOrderedListMargin = function () {
|
|
2254
|
-
var _this_1 = this;
|
|
2255
2254
|
if (!this.isOrderedList())
|
|
2256
2255
|
return 0;
|
|
2257
|
-
var
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2256
|
+
var orderedListMarkerEntities = this.fabricObject._orderedListMarkerEntities;
|
|
2257
|
+
var max = _(orderedListMarkerEntities)
|
|
2258
|
+
.filter(function (x) { return !!x; })
|
|
2259
|
+
.map(function (x) { return x.getBoundingRect(true, true).width; })
|
|
2260
|
+
.max();
|
|
2261
|
+
return (max * 1.2) || 0;
|
|
2262
2262
|
};
|
|
2263
2263
|
/**
|
|
2264
2264
|
* @override
|
|
@@ -2342,7 +2342,7 @@ var Text = /** @class */ (function (_super) {
|
|
|
2342
2342
|
* @inheritDoc
|
|
2343
2343
|
*/
|
|
2344
2344
|
Text.prototype.isOrderedList = function () {
|
|
2345
|
-
return this.fabricObject.
|
|
2345
|
+
return this.fabricObject._isOrderedList || false;
|
|
2346
2346
|
};
|
|
2347
2347
|
/**
|
|
2348
2348
|
* @override
|
|
@@ -2350,8 +2350,8 @@ var Text = /** @class */ (function (_super) {
|
|
|
2350
2350
|
*/
|
|
2351
2351
|
Text.prototype.enableOrderedList = function () {
|
|
2352
2352
|
this.disableBullets();
|
|
2353
|
-
this.fabricObject
|
|
2354
|
-
this.fabricObject.
|
|
2353
|
+
this.fabricObject.objectCaching = false;
|
|
2354
|
+
this.fabricObject._isOrderedList = true;
|
|
2355
2355
|
this.notifyCanvasOfTextChanges();
|
|
2356
2356
|
this.redraw();
|
|
2357
2357
|
};
|
|
@@ -2360,8 +2360,8 @@ var Text = /** @class */ (function (_super) {
|
|
|
2360
2360
|
* @inheritDoc
|
|
2361
2361
|
*/
|
|
2362
2362
|
Text.prototype.disableOrderedList = function () {
|
|
2363
|
-
this.
|
|
2364
|
-
delete this.fabricObject.
|
|
2363
|
+
this.removeOrderedListMarkers();
|
|
2364
|
+
delete this.fabricObject._isOrderedList;
|
|
2365
2365
|
this.notifyCanvasOfTextChanges();
|
|
2366
2366
|
this.redraw();
|
|
2367
2367
|
};
|
|
@@ -2370,7 +2370,8 @@ var Text = /** @class */ (function (_super) {
|
|
|
2370
2370
|
* @inheritDoc
|
|
2371
2371
|
*/
|
|
2372
2372
|
Text.prototype.setOrderedListStart = function (start) {
|
|
2373
|
-
this.fabricObject.
|
|
2373
|
+
this.fabricObject._orderedListStart = start;
|
|
2374
|
+
this.notifyCanvasOfTextChanges();
|
|
2374
2375
|
this.redraw();
|
|
2375
2376
|
};
|
|
2376
2377
|
/**
|
|
@@ -2378,7 +2379,7 @@ var Text = /** @class */ (function (_super) {
|
|
|
2378
2379
|
* @inheritDoc
|
|
2379
2380
|
*/
|
|
2380
2381
|
Text.prototype.getOrderedListStart = function () {
|
|
2381
|
-
return this.fabricObject.
|
|
2382
|
+
return this.fabricObject._orderedListStart || 1;
|
|
2382
2383
|
};
|
|
2383
2384
|
Text.prototype.getSizeIncreaseSinceCreation = function () {
|
|
2384
2385
|
return Math.max(0, this.fabricObject.height - this.baseComponentHeight);
|
|
@@ -2392,12 +2393,12 @@ var Text = /** @class */ (function (_super) {
|
|
|
2392
2393
|
this.fabricObject["objectCaching"] = true;
|
|
2393
2394
|
}
|
|
2394
2395
|
};
|
|
2395
|
-
Text.prototype.
|
|
2396
|
+
Text.prototype.removeOrderedListMarkers = function () {
|
|
2396
2397
|
var _this_1 = this;
|
|
2397
|
-
if (this.fabricObject.
|
|
2398
|
-
var
|
|
2399
|
-
delete this.fabricObject
|
|
2400
|
-
each(
|
|
2398
|
+
if (this.fabricObject._isOrderedList) {
|
|
2399
|
+
var markerEntities = this.fabricObject._orderedListMarkerEntities;
|
|
2400
|
+
delete this.fabricObject._orderedListMarkerEntities;
|
|
2401
|
+
each(markerEntities, function (marker) { return _this_1.canvas.removeFabricObject(marker); });
|
|
2401
2402
|
this.fabricObject["objectCaching"] = true;
|
|
2402
2403
|
}
|
|
2403
2404
|
};
|
|
@@ -2405,7 +2406,7 @@ var Text = /** @class */ (function (_super) {
|
|
|
2405
2406
|
var _this = this;
|
|
2406
2407
|
if (this.data.bulleted)
|
|
2407
2408
|
this.enableBullets();
|
|
2408
|
-
if (this.fabricObject.
|
|
2409
|
+
if (this.fabricObject._isOrderedList)
|
|
2409
2410
|
this.enableOrderedList();
|
|
2410
2411
|
var originalRender = this.fabricObject["_render"];
|
|
2411
2412
|
var fabric = this.canvas.fabric;
|
|
@@ -2468,22 +2469,21 @@ var Text = /** @class */ (function (_super) {
|
|
|
2468
2469
|
setTimeout(canvas_1.renderAll.bind(canvas_1));
|
|
2469
2470
|
}
|
|
2470
2471
|
}
|
|
2471
|
-
if (fabricText
|
|
2472
|
-
|
|
2473
|
-
var
|
|
2474
|
-
var activeLineNumbers_1 = {};
|
|
2472
|
+
if (fabricText._isOrderedList) {
|
|
2473
|
+
var existingMarkers_1 = fabricText._orderedListMarkerEntities || [];
|
|
2474
|
+
var activeMarkers_1 = [];
|
|
2475
2475
|
each(fabricText._textLines, function (textLine, lineIndex) {
|
|
2476
2476
|
if (textLine.length) {
|
|
2477
2477
|
// Start of real lines will have offset 0 in styleMap
|
|
2478
2478
|
var styleMap = fabricText._styleMap[lineIndex];
|
|
2479
2479
|
if (styleMap.offset === 0) {
|
|
2480
|
-
if (
|
|
2481
|
-
// Reuse existing
|
|
2482
|
-
|
|
2480
|
+
if (existingMarkers_1[lineIndex]) {
|
|
2481
|
+
// Reuse existing marker for this line
|
|
2482
|
+
activeMarkers_1[lineIndex] = existingMarkers_1[lineIndex];
|
|
2483
2483
|
}
|
|
2484
2484
|
else {
|
|
2485
|
-
// Create new
|
|
2486
|
-
|
|
2485
|
+
// Create new marker for this line
|
|
2486
|
+
activeMarkers_1[lineIndex] = new fabric.Textbox(lineIndex + ".", {
|
|
2487
2487
|
left: 0,
|
|
2488
2488
|
top: 0,
|
|
2489
2489
|
fill: fabricText.fill,
|
|
@@ -2500,24 +2500,28 @@ var Text = /** @class */ (function (_super) {
|
|
|
2500
2500
|
}
|
|
2501
2501
|
}
|
|
2502
2502
|
});
|
|
2503
|
-
// Add/Remove
|
|
2503
|
+
// Add/Remove markers from canvas
|
|
2504
2504
|
var canvas_2 = fabricText.canvas;
|
|
2505
2505
|
var canvasDirty_2 = false;
|
|
2506
2506
|
canvas_2.renderOnAddRemove = false;
|
|
2507
|
-
each(
|
|
2508
|
-
if (!
|
|
2509
|
-
|
|
2507
|
+
each(activeMarkers_1, function (marker) {
|
|
2508
|
+
if (!marker)
|
|
2509
|
+
return;
|
|
2510
|
+
if (!canvas_2.contains(marker)) {
|
|
2511
|
+
canvas_2.add(marker);
|
|
2510
2512
|
canvasDirty_2 = true;
|
|
2511
2513
|
}
|
|
2512
2514
|
});
|
|
2513
|
-
each(
|
|
2514
|
-
if (!
|
|
2515
|
-
|
|
2515
|
+
each(existingMarkers_1, function (marker, key) {
|
|
2516
|
+
if (!marker)
|
|
2517
|
+
return;
|
|
2518
|
+
if (!activeMarkers_1[key]) {
|
|
2519
|
+
canvas_2.remove(marker);
|
|
2516
2520
|
canvasDirty_2 = true;
|
|
2517
2521
|
}
|
|
2518
2522
|
});
|
|
2519
2523
|
canvas_2.renderOnAddRemove = true;
|
|
2520
|
-
fabricText
|
|
2524
|
+
fabricText._orderedListMarkerEntities = activeMarkers_1;
|
|
2521
2525
|
if (canvasDirty_2) {
|
|
2522
2526
|
// Fabric doesn't like it when you add new things within render so use a sneaky timeout to delay render
|
|
2523
2527
|
setTimeout(canvas_2.renderAll.bind(canvas_2));
|
|
@@ -2548,24 +2552,25 @@ var Text = /** @class */ (function (_super) {
|
|
|
2548
2552
|
top: fabricText.top + yOffset + bulletCenterOffset[1]
|
|
2549
2553
|
});
|
|
2550
2554
|
}
|
|
2551
|
-
var
|
|
2552
|
-
|
|
2553
|
-
|
|
2555
|
+
var orderedListMarkerEntities = fabricText._orderedListMarkerEntities;
|
|
2556
|
+
var xShift = -_this.getOrderedListMargin() + 1;
|
|
2557
|
+
if (orderedListMarkerEntities && orderedListMarkerEntities[lineIndex]) {
|
|
2558
|
+
var entry = orderedListMarkerEntities[lineIndex];
|
|
2554
2559
|
var fontSize = this.getValueOfPropertyAt(lineIndex, 0, "fontSize");
|
|
2555
2560
|
var fontFamily = this.getValueOfPropertyAt(lineIndex, 0, "fontFamily");
|
|
2556
2561
|
var color = this.getValueOfPropertyAt(lineIndex, 0, "fill");
|
|
2557
2562
|
var angle = fabricText.angle;
|
|
2558
2563
|
var theta = angle * Math.PI / 180;
|
|
2559
|
-
var xShift = -fontSize * 1.5;
|
|
2560
2564
|
var yShift = (fabricText.height / 2) + top - fontSize - 1;
|
|
2561
2565
|
var xOffset = (xShift * Math.cos(theta)) - (yShift * Math.sin(theta));
|
|
2562
2566
|
var yOffset = (xShift * Math.sin(theta)) + (yShift * Math.cos(theta));
|
|
2563
2567
|
var lineNumber = _this.getOrderedListStart();
|
|
2564
2568
|
for (var i = 0; i < lineIndex; i++) {
|
|
2565
|
-
if (
|
|
2569
|
+
if (orderedListMarkerEntities[i])
|
|
2566
2570
|
lineNumber++;
|
|
2567
2571
|
}
|
|
2568
2572
|
entry.set({
|
|
2573
|
+
width: 1,
|
|
2569
2574
|
fontSize: fontSize,
|
|
2570
2575
|
fontFamily: fontFamily,
|
|
2571
2576
|
fill: color,
|
|
@@ -3478,7 +3483,7 @@ var AbstractInteractiveCanvas = /** @class */ (function () {
|
|
|
3478
3483
|
var objects = _(this.objects$.value)
|
|
3479
3484
|
.map(function (x) { return x.persist(); })
|
|
3480
3485
|
.value();
|
|
3481
|
-
var includedProperties = ["id", "
|
|
3486
|
+
var includedProperties = ["id", "_isOrderedList", "_orderedListStart"];
|
|
3482
3487
|
var json = this.fabricCanvas.toJSON(includedProperties);
|
|
3483
3488
|
return {
|
|
3484
3489
|
dimensions: this.dimensions$.value,
|
|
@@ -2253,14 +2253,14 @@ var Text = /** @class */ (function (_super) {
|
|
|
2253
2253
|
* @inheritDoc
|
|
2254
2254
|
*/
|
|
2255
2255
|
Text.prototype.getOrderedListMargin = function () {
|
|
2256
|
-
var _this_1 = this;
|
|
2257
2256
|
if (!this.isOrderedList())
|
|
2258
2257
|
return 0;
|
|
2259
|
-
var
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2258
|
+
var orderedListMarkerEntities = this.fabricObject._orderedListMarkerEntities;
|
|
2259
|
+
var max = _(orderedListMarkerEntities)
|
|
2260
|
+
.filter(function (x) { return !!x; })
|
|
2261
|
+
.map(function (x) { return x.getBoundingRect(true, true).width; })
|
|
2262
|
+
.max();
|
|
2263
|
+
return (max * 1.2) || 0;
|
|
2264
2264
|
};
|
|
2265
2265
|
/**
|
|
2266
2266
|
* @override
|
|
@@ -2344,7 +2344,7 @@ var Text = /** @class */ (function (_super) {
|
|
|
2344
2344
|
* @inheritDoc
|
|
2345
2345
|
*/
|
|
2346
2346
|
Text.prototype.isOrderedList = function () {
|
|
2347
|
-
return this.fabricObject.
|
|
2347
|
+
return this.fabricObject._isOrderedList || false;
|
|
2348
2348
|
};
|
|
2349
2349
|
/**
|
|
2350
2350
|
* @override
|
|
@@ -2352,8 +2352,8 @@ var Text = /** @class */ (function (_super) {
|
|
|
2352
2352
|
*/
|
|
2353
2353
|
Text.prototype.enableOrderedList = function () {
|
|
2354
2354
|
this.disableBullets();
|
|
2355
|
-
this.fabricObject
|
|
2356
|
-
this.fabricObject.
|
|
2355
|
+
this.fabricObject.objectCaching = false;
|
|
2356
|
+
this.fabricObject._isOrderedList = true;
|
|
2357
2357
|
this.notifyCanvasOfTextChanges();
|
|
2358
2358
|
this.redraw();
|
|
2359
2359
|
};
|
|
@@ -2362,8 +2362,8 @@ var Text = /** @class */ (function (_super) {
|
|
|
2362
2362
|
* @inheritDoc
|
|
2363
2363
|
*/
|
|
2364
2364
|
Text.prototype.disableOrderedList = function () {
|
|
2365
|
-
this.
|
|
2366
|
-
delete this.fabricObject.
|
|
2365
|
+
this.removeOrderedListMarkers();
|
|
2366
|
+
delete this.fabricObject._isOrderedList;
|
|
2367
2367
|
this.notifyCanvasOfTextChanges();
|
|
2368
2368
|
this.redraw();
|
|
2369
2369
|
};
|
|
@@ -2372,7 +2372,8 @@ var Text = /** @class */ (function (_super) {
|
|
|
2372
2372
|
* @inheritDoc
|
|
2373
2373
|
*/
|
|
2374
2374
|
Text.prototype.setOrderedListStart = function (start) {
|
|
2375
|
-
this.fabricObject.
|
|
2375
|
+
this.fabricObject._orderedListStart = start;
|
|
2376
|
+
this.notifyCanvasOfTextChanges();
|
|
2376
2377
|
this.redraw();
|
|
2377
2378
|
};
|
|
2378
2379
|
/**
|
|
@@ -2380,7 +2381,7 @@ var Text = /** @class */ (function (_super) {
|
|
|
2380
2381
|
* @inheritDoc
|
|
2381
2382
|
*/
|
|
2382
2383
|
Text.prototype.getOrderedListStart = function () {
|
|
2383
|
-
return this.fabricObject.
|
|
2384
|
+
return this.fabricObject._orderedListStart || 1;
|
|
2384
2385
|
};
|
|
2385
2386
|
Text.prototype.getSizeIncreaseSinceCreation = function () {
|
|
2386
2387
|
return Math.max(0, this.fabricObject.height - this.baseComponentHeight);
|
|
@@ -2394,12 +2395,12 @@ var Text = /** @class */ (function (_super) {
|
|
|
2394
2395
|
this.fabricObject["objectCaching"] = true;
|
|
2395
2396
|
}
|
|
2396
2397
|
};
|
|
2397
|
-
Text.prototype.
|
|
2398
|
+
Text.prototype.removeOrderedListMarkers = function () {
|
|
2398
2399
|
var _this_1 = this;
|
|
2399
|
-
if (this.fabricObject.
|
|
2400
|
-
var
|
|
2401
|
-
delete this.fabricObject
|
|
2402
|
-
_.each(
|
|
2400
|
+
if (this.fabricObject._isOrderedList) {
|
|
2401
|
+
var markerEntities = this.fabricObject._orderedListMarkerEntities;
|
|
2402
|
+
delete this.fabricObject._orderedListMarkerEntities;
|
|
2403
|
+
_.each(markerEntities, function (marker) { return _this_1.canvas.removeFabricObject(marker); });
|
|
2403
2404
|
this.fabricObject["objectCaching"] = true;
|
|
2404
2405
|
}
|
|
2405
2406
|
};
|
|
@@ -2407,7 +2408,7 @@ var Text = /** @class */ (function (_super) {
|
|
|
2407
2408
|
var _this = this;
|
|
2408
2409
|
if (this.data.bulleted)
|
|
2409
2410
|
this.enableBullets();
|
|
2410
|
-
if (this.fabricObject.
|
|
2411
|
+
if (this.fabricObject._isOrderedList)
|
|
2411
2412
|
this.enableOrderedList();
|
|
2412
2413
|
var originalRender = this.fabricObject["_render"];
|
|
2413
2414
|
var fabric = this.canvas.fabric;
|
|
@@ -2470,22 +2471,21 @@ var Text = /** @class */ (function (_super) {
|
|
|
2470
2471
|
setTimeout(canvas_1.renderAll.bind(canvas_1));
|
|
2471
2472
|
}
|
|
2472
2473
|
}
|
|
2473
|
-
if (fabricText
|
|
2474
|
-
|
|
2475
|
-
var
|
|
2476
|
-
var activeLineNumbers_1 = {};
|
|
2474
|
+
if (fabricText._isOrderedList) {
|
|
2475
|
+
var existingMarkers_1 = fabricText._orderedListMarkerEntities || [];
|
|
2476
|
+
var activeMarkers_1 = [];
|
|
2477
2477
|
_.each(fabricText._textLines, function (textLine, lineIndex) {
|
|
2478
2478
|
if (textLine.length) {
|
|
2479
2479
|
// Start of real lines will have offset 0 in styleMap
|
|
2480
2480
|
var styleMap = fabricText._styleMap[lineIndex];
|
|
2481
2481
|
if (styleMap.offset === 0) {
|
|
2482
|
-
if (
|
|
2483
|
-
// Reuse existing
|
|
2484
|
-
|
|
2482
|
+
if (existingMarkers_1[lineIndex]) {
|
|
2483
|
+
// Reuse existing marker for this line
|
|
2484
|
+
activeMarkers_1[lineIndex] = existingMarkers_1[lineIndex];
|
|
2485
2485
|
}
|
|
2486
2486
|
else {
|
|
2487
|
-
// Create new
|
|
2488
|
-
|
|
2487
|
+
// Create new marker for this line
|
|
2488
|
+
activeMarkers_1[lineIndex] = new fabric.Textbox(lineIndex + ".", {
|
|
2489
2489
|
left: 0,
|
|
2490
2490
|
top: 0,
|
|
2491
2491
|
fill: fabricText.fill,
|
|
@@ -2502,24 +2502,28 @@ var Text = /** @class */ (function (_super) {
|
|
|
2502
2502
|
}
|
|
2503
2503
|
}
|
|
2504
2504
|
});
|
|
2505
|
-
// Add/Remove
|
|
2505
|
+
// Add/Remove markers from canvas
|
|
2506
2506
|
var canvas_2 = fabricText.canvas;
|
|
2507
2507
|
var canvasDirty_2 = false;
|
|
2508
2508
|
canvas_2.renderOnAddRemove = false;
|
|
2509
|
-
_.each(
|
|
2510
|
-
if (!
|
|
2511
|
-
|
|
2509
|
+
_.each(activeMarkers_1, function (marker) {
|
|
2510
|
+
if (!marker)
|
|
2511
|
+
return;
|
|
2512
|
+
if (!canvas_2.contains(marker)) {
|
|
2513
|
+
canvas_2.add(marker);
|
|
2512
2514
|
canvasDirty_2 = true;
|
|
2513
2515
|
}
|
|
2514
2516
|
});
|
|
2515
|
-
_.each(
|
|
2516
|
-
if (!
|
|
2517
|
-
|
|
2517
|
+
_.each(existingMarkers_1, function (marker, key) {
|
|
2518
|
+
if (!marker)
|
|
2519
|
+
return;
|
|
2520
|
+
if (!activeMarkers_1[key]) {
|
|
2521
|
+
canvas_2.remove(marker);
|
|
2518
2522
|
canvasDirty_2 = true;
|
|
2519
2523
|
}
|
|
2520
2524
|
});
|
|
2521
2525
|
canvas_2.renderOnAddRemove = true;
|
|
2522
|
-
fabricText
|
|
2526
|
+
fabricText._orderedListMarkerEntities = activeMarkers_1;
|
|
2523
2527
|
if (canvasDirty_2) {
|
|
2524
2528
|
// Fabric doesn't like it when you add new things within render so use a sneaky timeout to delay render
|
|
2525
2529
|
setTimeout(canvas_2.renderAll.bind(canvas_2));
|
|
@@ -2550,24 +2554,25 @@ var Text = /** @class */ (function (_super) {
|
|
|
2550
2554
|
top: fabricText.top + yOffset + bulletCenterOffset[1]
|
|
2551
2555
|
});
|
|
2552
2556
|
}
|
|
2553
|
-
var
|
|
2554
|
-
|
|
2555
|
-
|
|
2557
|
+
var orderedListMarkerEntities = fabricText._orderedListMarkerEntities;
|
|
2558
|
+
var xShift = -_this.getOrderedListMargin() + 1;
|
|
2559
|
+
if (orderedListMarkerEntities && orderedListMarkerEntities[lineIndex]) {
|
|
2560
|
+
var entry = orderedListMarkerEntities[lineIndex];
|
|
2556
2561
|
var fontSize = this.getValueOfPropertyAt(lineIndex, 0, "fontSize");
|
|
2557
2562
|
var fontFamily = this.getValueOfPropertyAt(lineIndex, 0, "fontFamily");
|
|
2558
2563
|
var color = this.getValueOfPropertyAt(lineIndex, 0, "fill");
|
|
2559
2564
|
var angle = fabricText.angle;
|
|
2560
2565
|
var theta = angle * Math.PI / 180;
|
|
2561
|
-
var xShift = -fontSize * 1.5;
|
|
2562
2566
|
var yShift = (fabricText.height / 2) + top - fontSize - 1;
|
|
2563
2567
|
var xOffset = (xShift * Math.cos(theta)) - (yShift * Math.sin(theta));
|
|
2564
2568
|
var yOffset = (xShift * Math.sin(theta)) + (yShift * Math.cos(theta));
|
|
2565
2569
|
var lineNumber = _this.getOrderedListStart();
|
|
2566
2570
|
for (var i = 0; i < lineIndex; i++) {
|
|
2567
|
-
if (
|
|
2571
|
+
if (orderedListMarkerEntities[i])
|
|
2568
2572
|
lineNumber++;
|
|
2569
2573
|
}
|
|
2570
2574
|
entry.set({
|
|
2575
|
+
width: 1,
|
|
2571
2576
|
fontSize: fontSize,
|
|
2572
2577
|
fontFamily: fontFamily,
|
|
2573
2578
|
fill: color,
|
|
@@ -3478,7 +3483,7 @@ var AbstractInteractiveCanvas = /** @class */ (function () {
|
|
|
3478
3483
|
var objects = _(this.objects$.value)
|
|
3479
3484
|
.map(function (x) { return x.persist(); })
|
|
3480
3485
|
.value();
|
|
3481
|
-
var includedProperties = ["id", "
|
|
3486
|
+
var includedProperties = ["id", "_isOrderedList", "_orderedListStart"];
|
|
3482
3487
|
var json = this.fabricCanvas.toJSON(includedProperties);
|
|
3483
3488
|
return {
|
|
3484
3489
|
dimensions: this.dimensions$.value,
|
|
@@ -4,6 +4,7 @@ import { ICanvasObject } from "../canvas-object.interface";
|
|
|
4
4
|
import { AbstractCanvasObject } from "../abstract-canvas-object";
|
|
5
5
|
import { CanvasObjectData } from "../canvas-object-data";
|
|
6
6
|
import { fabric } from "fabric";
|
|
7
|
+
import { ExtendedFabricTextbox } from "./extended-fabric-textbox.interface";
|
|
7
8
|
/**
|
|
8
9
|
* Text field. Displays customizable text.
|
|
9
10
|
*/
|
|
@@ -49,7 +50,7 @@ export interface IText extends ICanvasObject, IMutableColor, IMutableText, IMuta
|
|
|
49
50
|
*/
|
|
50
51
|
getOrderedListMargin(): number;
|
|
51
52
|
}
|
|
52
|
-
export declare class Text extends AbstractCanvasObject<
|
|
53
|
+
export declare class Text extends AbstractCanvasObject<ExtendedFabricTextbox> implements IText {
|
|
53
54
|
private readonly fontLibrary;
|
|
54
55
|
private baseComponentHeight;
|
|
55
56
|
private readonly text$;
|
|
@@ -297,7 +298,7 @@ export declare class Text extends AbstractCanvasObject<fabric.Textbox> implement
|
|
|
297
298
|
getOrderedListStart(): number;
|
|
298
299
|
getSizeIncreaseSinceCreation(): number;
|
|
299
300
|
private removeBullets;
|
|
300
|
-
private
|
|
301
|
+
private removeOrderedListMarkers;
|
|
301
302
|
private applyBulletListMonkeyPatches;
|
|
302
303
|
/**
|
|
303
304
|
* @override
|