@innovastudio/contentbuilder 1.5.30 → 1.5.31

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@innovastudio/contentbuilder",
3
3
  "type": "module",
4
- "version": "1.5.30",
4
+ "version": "1.5.31",
5
5
  "description": "",
6
6
  "main": "public/contentbuilder/contentbuilder.esm.js",
7
7
  "files": [
@@ -83411,6 +83411,37 @@ class Draggable {
83411
83411
  }
83412
83412
  }
83413
83413
  updateBlockStyle(target) {
83414
+ // Block placement should must not 50% outside the container
83415
+ const container = target.closest('.box-canvas');
83416
+ let containerHeight = container.offsetHeight;
83417
+ let containerWidth = container.offsetWidth;
83418
+ /*
83419
+ if(target.offsetTop + target.offsetHeight>=containerHeight) {
83420
+ target.style.top = containerHeight-target.offsetHeight +'px';
83421
+ }
83422
+ if(target.offsetTop<=0) {
83423
+ target.style.top = '0px';
83424
+ }
83425
+ if(target.offsetLeft + target.offsetWidth>=åcontainerWidth) {
83426
+ target.style.left = (containerWidth-target.offsetWidth) +'px';
83427
+ }
83428
+ if(target.offsetLeft<=0) {
83429
+ target.style.left = '0px';
83430
+ }
83431
+ */
83432
+ if (target.offsetTop + target.offsetHeight <= target.offsetHeight / 2) {
83433
+ target.style.top = '0px';
83434
+ }
83435
+ if (containerHeight - target.offsetTop <= target.offsetHeight / 2) {
83436
+ target.style.top = containerHeight - target.offsetHeight + 'px';
83437
+ }
83438
+ if (target.offsetLeft + target.offsetWidth <= target.offsetWidth / 2) {
83439
+ target.style.left = '0px';
83440
+ }
83441
+ if (containerWidth - target.offsetLeft <= target.offsetWidth / 2) {
83442
+ target.style.left = containerWidth - target.offsetWidth + 'px';
83443
+ }
83444
+
83414
83445
  // Replace with ruler's alignment
83415
83446
  if (this.ruler.rulerTop !== null) target.style.top = this.ruler.rulerTop + 'px';
83416
83447
  if (this.ruler.rulerBottom !== null) target.style.top = this.ruler.rulerBottom - target.offsetHeight + 'px'; //new