@ostendis/grapesjs-preset-ostendis-adv 1.2.2 → 1.2.4

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.
@@ -22142,6 +22142,24 @@ var __assign = (undefined && undefined.__assign) || function () {
22142
22142
  },
22143
22143
  attributes: { class: "fa-brands fa-square-x-twitter" },
22144
22144
  });
22145
+ Blocks.add("tiktok", {
22146
+ label: opts.t9n.tiktokBlkLabelSite,
22147
+ category: opts.t9n.smSitesCategoryLabel,
22148
+ content: {
22149
+ type: "link",
22150
+ style: {
22151
+ display: "inline-block",
22152
+ margin: "3px",
22153
+ "text-decoration": "none",
22154
+ },
22155
+ attributes: {
22156
+ href: "https://www.tiktok.com/",
22157
+ target: "_blank",
22158
+ },
22159
+ components: "<div style=\"display:flex; justify-content: center; align-items: center; width:28px; height:28px; font-size:28px; color:#293133;\">\n <i class=\"fa-brands fa-tiktok\"></i>\n </div>",
22160
+ },
22161
+ attributes: { class: "fa-brands fa-tiktok" },
22162
+ });
22145
22163
  // Social Media Share blocks
22146
22164
  Blocks.add("facebookShare", {
22147
22165
  label: opts.t9n.facebookBlkLabelShare,
@@ -22446,15 +22464,21 @@ __webpack_require__.r(__webpack_exports__);
22446
22464
  });
22447
22465
  // Scale the new range
22448
22466
  DomComponents.addType("scale", {
22449
- isComponent: function (el) { return el.tagName === "DIV" && el.classList.contains("scale"); },
22467
+ isComponent: function (el) {
22468
+ return (el.tagName === "DIV" &&
22469
+ (el.getAttribute("data-scale") === "true" ||
22470
+ el.classList.contains("scale")));
22471
+ },
22450
22472
  model: {
22451
22473
  defaults: {
22452
22474
  tagName: "div",
22453
22475
  attributes: {
22454
- class: "scale",
22476
+ "data-scale": "true",
22455
22477
  "data-percent": "66",
22456
22478
  "data-fcolor": "#3b5998",
22457
22479
  "data-bgcolor": "#CCCCCC",
22480
+ "aria-label": "66 %",
22481
+ role: "img",
22458
22482
  },
22459
22483
  style: {
22460
22484
  "box-sizing": "border-box",
@@ -22462,7 +22486,7 @@ __webpack_require__.r(__webpack_exports__);
22462
22486
  height: "20px",
22463
22487
  "max-width": "100%",
22464
22488
  border: "0px solid #666666",
22465
- background: "linear-gradient(to right,#3b5998 66%, #CCCCCC 66%);",
22489
+ background: "linear-gradient(to right, #3b5998 66%, #CCCCCC 66%)",
22466
22490
  },
22467
22491
  traits: [
22468
22492
  {
@@ -22491,22 +22515,38 @@ __webpack_require__.r(__webpack_exports__);
22491
22515
  ],
22492
22516
  },
22493
22517
  init: function () {
22494
- var scaleAttr = this.getAttributes();
22495
- this.set("percent", scaleAttr["data-percent"]);
22496
- this.set("bgcolor", scaleAttr["data-bgcolor"]);
22497
- this.set("fcolor", scaleAttr["data-fcolor"]);
22518
+ var _a;
22519
+ var attr = this.getAttributes();
22520
+ var el = (_a = this.view) === null || _a === void 0 ? void 0 : _a.el;
22521
+ var p = parseInt(attr["data-percent"]);
22522
+ var f = attr["data-fcolor"];
22523
+ var b = attr["data-bgcolor"];
22524
+ if (isNaN(p))
22525
+ p = 66;
22526
+ if (!f)
22527
+ f = "#3b5998";
22528
+ if (!b)
22529
+ b = "#CCCCCC";
22530
+ this.set("percent", Math.max(0, Math.min(100, p)));
22531
+ this.set("bgcolor", b);
22532
+ this.set("fcolor", f);
22498
22533
  this.on("change:percent", this.updateScale);
22499
22534
  this.on("change:bgcolor", this.updateScale);
22500
22535
  this.on("change:fcolor", this.updateScale);
22501
22536
  },
22502
22537
  updateScale: function () {
22503
- var p = this.get("percent");
22504
- var b = this.get("bgcolor");
22505
- var f = this.get("fcolor");
22538
+ var p = parseInt(this.get("percent"));
22539
+ var f = this.get("fcolor") || "#3b5998";
22540
+ var b = this.get("bgcolor") || "#CCCCCC";
22541
+ if (isNaN(p))
22542
+ p = 0;
22543
+ p = Math.max(0, Math.min(100, p));
22506
22544
  this.set("attributes", {
22545
+ "data-scale": "true",
22507
22546
  "data-percent": p,
22508
- "data-bgcolor": b,
22509
22547
  "data-fcolor": f,
22548
+ "data-bgcolor": b,
22549
+ "aria-label": "".concat(p, " %"),
22510
22550
  });
22511
22551
  this.addStyle({
22512
22552
  background: "linear-gradient(to right, ".concat(f, " ").concat(p, "%, ").concat(b, " ").concat(p, "%)"),
@@ -23148,6 +23188,7 @@ var ostTrans = {
23148
23188
  linkedinBlkLabelSite: "LinkedIn link",
23149
23189
  xingBlkLabelSite: "Xing link",
23150
23190
  twitterBlkLabelSite: "Twitter link",
23191
+ tiktokBlkLabelSite: "TikTok link",
23151
23192
  facebookBlkLabelShare: "Facebook share",
23152
23193
  linkedinBlkLabelShare: "LinkedIn share",
23153
23194
  xingBlkLabelShare: "Xing share",