@tixyel/streamelements 7.11.0 → 7.12.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/dist/index.d.ts CHANGED
@@ -3621,6 +3621,7 @@ declare class SEHelper {
3621
3621
  * @param text - The long text to split into multiple fields
3622
3622
  * @param maxLabelLength - The maximum length for each field label (default is 31 characters, which is the maximum allowed by StreamElements)
3623
3623
  * @returns An object containing the generated StreamElements custom field schemas with split labels
3624
+ * @example
3624
3625
  */
3625
3626
  splitFieldLabel(keyPrefix: string, text: string, maxLabelLength?: number): {
3626
3627
  [k: string]: StreamElements.CustomField.Schema;
package/dist/index.es.js CHANGED
@@ -10434,7 +10434,19 @@ var j = class {
10434
10434
  label: a.capitalize(d),
10435
10435
  value: l
10436
10436
  };
10437
- else if ([
10437
+ else if (["gradient"].some((e) => n.endsWith(e))) {
10438
+ let t = l.match(ae);
10439
+ t && (e[`${n}-gradient`] = {
10440
+ type: "hidden",
10441
+ label: "• Gradient colors"
10442
+ }, t.forEach((t, r) => {
10443
+ e[`${n}-gradient-${r}`] = {
10444
+ type: "colorpicker",
10445
+ label: a.capitalize(d) + ` ${s.translate(r + 1, "suffix")} color`,
10446
+ value: t
10447
+ };
10448
+ }));
10449
+ } else if ([
10438
10450
  "size",
10439
10451
  "width",
10440
10452
  "height",
@@ -10466,11 +10478,15 @@ var j = class {
10466
10478
  800: "Extra Bold 800",
10467
10479
  900: "Black 900"
10468
10480
  }
10469
- } : n.endsWith("font-family") && (e[n] = {
10481
+ } : n.endsWith("font-family") ? e[n] = {
10470
10482
  type: "googleFont",
10471
10483
  label: a.capitalize(d),
10472
10484
  value: l.split(",")[0].trim().replaceAll("'", "")
10473
- });
10485
+ } : e[n] = {
10486
+ type: "text",
10487
+ label: a.capitalize(d),
10488
+ value: String(l)
10489
+ };
10474
10490
  break;
10475
10491
  case "value":
10476
10492
  if (o.validate(l)) e[n] = {
@@ -10480,16 +10496,16 @@ var j = class {
10480
10496
  };
10481
10497
  else if (l.startsWith("linear-gradient(") || l.startsWith("radial-gradient(")) {
10482
10498
  let t = l.match(ae);
10483
- t && t.forEach((t, r) => {
10484
- e[`${n}-gradient`] = {
10485
- type: "hidden",
10486
- label: "• Gradient colors"
10487
- }, e[`${n}-gradient-${r}`] = {
10499
+ t && (e[`${n}-gradient`] = {
10500
+ type: "hidden",
10501
+ label: "• Gradient colors"
10502
+ }, t.forEach((t, r) => {
10503
+ e[`${n}-gradient-${r}`] = {
10488
10504
  type: "colorpicker",
10489
10505
  label: a.capitalize(d) + ` ${s.translate(r + 1, "suffix")} color`,
10490
10506
  value: t
10491
10507
  };
10492
- });
10508
+ }));
10493
10509
  } else if (l.endsWith("px")) {
10494
10510
  var f = c[n + "-min"] ? parseFloat(c[n + "-min"]) : void 0, p = c[n + "-max"] ? parseFloat(c[n + "-max"]) : void 0, m = c[n + "-step"] ? parseFloat(c[n + "-step"]) : void 0;
10495
10511
  e[n] = {
@@ -10513,7 +10529,7 @@ var j = class {
10513
10529
  } else if (isNaN(parseFloat(l))) e[n] = {
10514
10530
  type: "text",
10515
10531
  label: a.capitalize(d),
10516
- value: l
10532
+ value: String(l)
10517
10533
  };
10518
10534
  else {
10519
10535
  var f = c[n + "-min"] ? parseFloat(c[n + "-min"]) : void 0, p = c[n + "-max"] ? parseFloat(c[n + "-max"]) : void 0, m = c[n + "-step"] ? parseFloat(c[n + "-step"]) : void 0;