labellife-design-tool 2.5.7 → 2.7.0
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/README.md +42 -0
- package/dist/cjs/canvas/workspace.js +265 -9
- package/dist/cjs/canvas/workspace.js.map +1 -1
- package/dist/cjs/config.js +215 -0
- package/dist/cjs/config.js.map +1 -1
- package/dist/cjs/index.js +947 -15
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/model/store.js +854 -7
- package/dist/cjs/model/store.js.map +1 -1
- package/dist/cjs/side-panel/index.js +173 -0
- package/dist/cjs/side-panel/index.js.map +1 -1
- package/dist/cjs/side-panel/side-panel.js +173 -0
- package/dist/cjs/side-panel/side-panel.js.map +1 -1
- package/dist/cjs/toolbar/toolbar.js +173 -0
- package/dist/cjs/toolbar/toolbar.js.map +1 -1
- package/dist/esm/canvas/workspace.js +265 -9
- package/dist/esm/canvas/workspace.js.map +1 -1
- package/dist/esm/config.js +214 -1
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/index.js +946 -16
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/model/store.js +854 -7
- package/dist/esm/model/store.js.map +1 -1
- package/dist/esm/side-panel/index.js +173 -0
- package/dist/esm/side-panel/index.js.map +1 -1
- package/dist/esm/side-panel/side-panel.js +173 -0
- package/dist/esm/side-panel/side-panel.js.map +1 -1
- package/dist/esm/toolbar/toolbar.js +173 -0
- package/dist/esm/toolbar/toolbar.js.map +1 -1
- package/package.json +2 -2
|
@@ -424,6 +424,179 @@ function t(key, defaultValue) {
|
|
|
424
424
|
return defaultValue || key;
|
|
425
425
|
}
|
|
426
426
|
|
|
427
|
+
function clip(text, max) {
|
|
428
|
+
var s = String(text == null ? '' : text);
|
|
429
|
+
return s.length > max ? "".concat(s.slice(0, max), "\u2026") : s;
|
|
430
|
+
}
|
|
431
|
+
function imageSource(src) {
|
|
432
|
+
var s = String(src || '');
|
|
433
|
+
if (s.startsWith('data:') || s.startsWith('blob:')) return 'uploaded';
|
|
434
|
+
if (s.toLowerCase().includes('unsplash')) return 'stock photo';
|
|
435
|
+
return '';
|
|
436
|
+
}
|
|
437
|
+
var _short = function _short(v) {
|
|
438
|
+
var s = String(v == null ? '' : v);
|
|
439
|
+
return "".concat(s.length, ":").concat(s.slice(0, 40));
|
|
440
|
+
};
|
|
441
|
+
var isLocked = function isLocked(el) {
|
|
442
|
+
return el.draggable === false && el.resizable === false && el.contentEditable === false && el.styleEditable === false;
|
|
443
|
+
};
|
|
444
|
+
var quotedText = function quotedText(el, n, opts) {
|
|
445
|
+
return opts.includeTextContent && el.text ? "\"".concat(clip(el.text, opts.maxTextLength), "\"") : n;
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
// One row per property group: how to read its value, and how to word the change.
|
|
449
|
+
// A new property is one new row. `render(ctx)` returns (from, to) => sentence so a
|
|
450
|
+
// merged entry can be re-worded with its first `from` and last `to`.
|
|
451
|
+
var ROWS = [{
|
|
452
|
+
key: 'text',
|
|
453
|
+
props: ['text'],
|
|
454
|
+
render: function render(_ref8) {
|
|
455
|
+
var opts = _ref8.opts;
|
|
456
|
+
return function (f, t) {
|
|
457
|
+
return opts.includeTextContent ? "Changed the text \"".concat(clip(f, opts.maxTextLength), "\" to \"").concat(clip(t, opts.maxTextLength), "\".") : 'Changed the text.';
|
|
458
|
+
};
|
|
459
|
+
}
|
|
460
|
+
}, {
|
|
461
|
+
key: 'fontFamily',
|
|
462
|
+
props: ['fontFamily'],
|
|
463
|
+
render: function render(_ref9) {
|
|
464
|
+
var n = _ref9.n;
|
|
465
|
+
return function (f, t) {
|
|
466
|
+
return "Changed the font of ".concat(n, " to ").concat(t, ".");
|
|
467
|
+
};
|
|
468
|
+
}
|
|
469
|
+
}, {
|
|
470
|
+
key: 'fontSize',
|
|
471
|
+
props: ['fontSize'],
|
|
472
|
+
render: function render(_ref0) {
|
|
473
|
+
var n = _ref0.n;
|
|
474
|
+
return function (f, t) {
|
|
475
|
+
return "Changed the font size of ".concat(n, " from ").concat(f, " to ").concat(t, ".");
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
}, {
|
|
479
|
+
key: 'fill',
|
|
480
|
+
props: ['fill'],
|
|
481
|
+
render: function render(_ref1) {
|
|
482
|
+
var n = _ref1.n;
|
|
483
|
+
return function (f, t) {
|
|
484
|
+
return "Changed the colour of ".concat(n, " to ").concat(t, ".");
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
}, {
|
|
488
|
+
key: 'position',
|
|
489
|
+
props: ['x', 'y'],
|
|
490
|
+
render: function render(_ref10) {
|
|
491
|
+
var n = _ref10.n;
|
|
492
|
+
return function () {
|
|
493
|
+
return "Moved ".concat(n, ".");
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
}, {
|
|
497
|
+
key: 'size',
|
|
498
|
+
props: ['width', 'height'],
|
|
499
|
+
render: function render(_ref11) {
|
|
500
|
+
var n = _ref11.n;
|
|
501
|
+
return function () {
|
|
502
|
+
return "Resized ".concat(n, ".");
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
}, {
|
|
506
|
+
key: 'rotation',
|
|
507
|
+
props: ['rotation'],
|
|
508
|
+
render: function render(_ref12) {
|
|
509
|
+
var n = _ref12.n;
|
|
510
|
+
return function (f, t) {
|
|
511
|
+
return "Rotated ".concat(n, " to ").concat(t, " degrees.");
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
}, {
|
|
515
|
+
key: 'visible',
|
|
516
|
+
props: ['visible'],
|
|
517
|
+
render: function render(_ref13) {
|
|
518
|
+
var n = _ref13.n;
|
|
519
|
+
return function (f, t) {
|
|
520
|
+
return t ? "Showed ".concat(n, ".") : "Hid ".concat(n, ".");
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
}, {
|
|
524
|
+
key: 'lock',
|
|
525
|
+
props: ['draggable', 'resizable', 'contentEditable', 'styleEditable'],
|
|
526
|
+
value: isLocked,
|
|
527
|
+
render: function render(_ref14) {
|
|
528
|
+
var n = _ref14.n;
|
|
529
|
+
return function (f, t) {
|
|
530
|
+
return t ? "Locked ".concat(n, ".") : "Unlocked ".concat(n, ".");
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
}, {
|
|
534
|
+
key: 'crop',
|
|
535
|
+
props: ['cropX', 'cropY', 'cropWidth', 'cropHeight'],
|
|
536
|
+
render: function render(_ref15) {
|
|
537
|
+
var n = _ref15.n;
|
|
538
|
+
return function () {
|
|
539
|
+
return "Cropped ".concat(n, ".");
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
}, {
|
|
543
|
+
key: 'clipSrc',
|
|
544
|
+
props: ['clipSrc'],
|
|
545
|
+
render: function render(_ref16) {
|
|
546
|
+
var n = _ref16.n;
|
|
547
|
+
return function (f, t) {
|
|
548
|
+
return t ? "Applied a mask to ".concat(n, ".") : "Removed the mask from ".concat(n, ".");
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
}, {
|
|
552
|
+
key: 'curveEnabled',
|
|
553
|
+
props: ['curveEnabled'],
|
|
554
|
+
render: function render(_ref17) {
|
|
555
|
+
var n = _ref17.n,
|
|
556
|
+
next = _ref17.next,
|
|
557
|
+
opts = _ref17.opts;
|
|
558
|
+
return function (f, t) {
|
|
559
|
+
return t ? "Applied curved text to ".concat(quotedText(next, n, opts), ".") : "Removed the curve from ".concat(n, ".");
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
}, {
|
|
563
|
+
key: 'shadowEnabled',
|
|
564
|
+
props: ['shadowEnabled'],
|
|
565
|
+
render: function render(_ref18) {
|
|
566
|
+
var n = _ref18.n;
|
|
567
|
+
return function (f, t) {
|
|
568
|
+
return t ? "Added a shadow to ".concat(n, ".") : "Removed the shadow from ".concat(n, ".");
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
}, {
|
|
572
|
+
key: 'grayscaleEnabled',
|
|
573
|
+
props: ['grayscaleEnabled'],
|
|
574
|
+
render: function render(_ref19) {
|
|
575
|
+
var n = _ref19.n;
|
|
576
|
+
return function (f, t) {
|
|
577
|
+
return t ? "Made ".concat(n, " grayscale.") : "Removed the grayscale from ".concat(n, ".");
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
}, {
|
|
581
|
+
key: 'src',
|
|
582
|
+
props: ['src'],
|
|
583
|
+
value: function value(el) {
|
|
584
|
+
return _short(el.src);
|
|
585
|
+
},
|
|
586
|
+
render: function render(_ref20) {
|
|
587
|
+
var n = _ref20.n,
|
|
588
|
+
next = _ref20.next;
|
|
589
|
+
return function () {
|
|
590
|
+
var source = imageSource(next.src);
|
|
591
|
+
var note = source === 'uploaded' ? ' (uploaded by the user)' : source ? " (".concat(source, ")") : '';
|
|
592
|
+
return "Replaced ".concat(n).concat(note, ".");
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
}];
|
|
596
|
+
new Set(['id', 'type', 'custom', 'children'].concat(_toConsumableArray(ROWS.flatMap(function (r) {
|
|
597
|
+
return r.props;
|
|
598
|
+
}))));
|
|
599
|
+
|
|
427
600
|
// ── Unsplash proxy endpoints (used by background-panel.js) ───────────────────
|
|
428
601
|
// The host app supplies the full endpoint URLs; the library only appends the query string.
|
|
429
602
|
// Window-level singletons, same reasoning as translations/input-fields config above:
|