@lumiastream/ui 0.3.5 → 0.3.6

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.js CHANGED
@@ -4654,7 +4654,11 @@ var SOURCE_TO_LUMIA_FIELD_TYPE = {
4654
4654
  // SE-side trigger buttons → native action button.
4655
4655
  button: "actionbutton"
4656
4656
  };
4657
- var RESERVED_FIELD_KEYS = /* @__PURE__ */ new Set(["widgetName", "widgetAuthor", "widgetDuration"]);
4657
+ var RESERVED_FIELD_KEYS = /* @__PURE__ */ new Set([
4658
+ "widgetName",
4659
+ "widgetAuthor",
4660
+ "widgetDuration"
4661
+ ]);
4658
4662
  function translateConfigs(sourceFields) {
4659
4663
  if (!sourceFields) return [];
4660
4664
  return Object.entries(sourceFields).filter(([key]) => !RESERVED_FIELD_KEYS.has(key)).map(([key, f]) => {
@@ -4671,6 +4675,20 @@ function translateConfigs(sourceFields) {
4671
4675
  options: f.options
4672
4676
  };
4673
4677
  if (sourceType === "hidden") base.hidden = true;
4678
+ if (sourceType === "slider") {
4679
+ const sliderOptions = { ...f.options ?? {} };
4680
+ if (f.min != null && sliderOptions.min == null)
4681
+ sliderOptions.min = f.min;
4682
+ if (f.max != null && sliderOptions.max == null)
4683
+ sliderOptions.max = f.max;
4684
+ if (f.step != null && sliderOptions.step == null)
4685
+ sliderOptions.step = f.step;
4686
+ if (f.prefix != null && sliderOptions.prefix == null)
4687
+ sliderOptions.prefix = f.prefix;
4688
+ if (f.suffix != null && sliderOptions.suffix == null)
4689
+ sliderOptions.suffix = f.suffix;
4690
+ base.options = sliderOptions;
4691
+ }
4674
4692
  return base;
4675
4693
  });
4676
4694
  }
@@ -4689,28 +4707,33 @@ function mapCustom(widget, ctx) {
4689
4707
  const fieldData = parse(v.fieldData) ?? v.fieldData;
4690
4708
  const widgetProvider = widget.provider;
4691
4709
  const provider = widgetProvider === "kick" || widgetProvider === "youtube" || widgetProvider === "twitch" ? widgetProvider : ctx?.provider ?? "twitch";
4692
- return buildUnit(widget, "custom", {
4693
- content: {
4694
- // SE widget ids are integers unique only within a single SE overlay
4695
- // (1, 2, 3…). Using them as Lumia codeIds would collide across
4696
- // imports — codeId is the scoping key for variables, storage, and
4697
- // event listeners. Mint a fresh nanoid so every imported widget
4698
- // has its own scope.
4699
- codeId: nanoid2(),
4700
- html: v.html ?? "",
4701
- css: v.css ?? "",
4702
- js: v.js ?? "",
4703
- configs: translateConfigs(fields),
4704
- data: fieldData ?? {},
4705
- flavor: "streamelements",
4706
- // Native field on the Custom module content. The compatibility
4707
- // shim in Embed.tsx reads this to pick the right listener-name
4708
- // mapping table when forwarding Lumia events into the iframe as
4709
- // `onEventReceived` payloads. Default 'twitch' matches the shim's
4710
- // historical default so legacy imports keep working.
4711
- sourceProvider: provider
4712
- }
4713
- }, ctx);
4710
+ return buildUnit(
4711
+ widget,
4712
+ "custom",
4713
+ {
4714
+ content: {
4715
+ // SE widget ids are integers unique only within a single SE overlay
4716
+ // (1, 2, 3…). Using them as Lumia codeIds would collide across
4717
+ // imports — codeId is the scoping key for variables, storage, and
4718
+ // event listeners. Mint a fresh nanoid so every imported widget
4719
+ // has its own scope.
4720
+ codeId: nanoid2(),
4721
+ html: v.html ?? "",
4722
+ css: v.css ?? "",
4723
+ js: v.js ?? "",
4724
+ configs: translateConfigs(fields),
4725
+ data: fieldData ?? {},
4726
+ flavor: "streamelements",
4727
+ // Native field on the Custom module content. The compatibility
4728
+ // shim in Embed.tsx reads this to pick the right listener-name
4729
+ // mapping table when forwarding Lumia events into the iframe as
4730
+ // `onEventReceived` payloads. Default 'twitch' matches the shim's
4731
+ // historical default so legacy imports keep working.
4732
+ sourceProvider: provider
4733
+ }
4734
+ },
4735
+ ctx
4736
+ );
4714
4737
  }
4715
4738
 
4716
4739
  // src/se-import/mappers/misc.ts
package/dist/se-import.js CHANGED
@@ -1527,7 +1527,11 @@ var SOURCE_TO_LUMIA_FIELD_TYPE = {
1527
1527
  // SE-side trigger buttons → native action button.
1528
1528
  button: "actionbutton"
1529
1529
  };
1530
- var RESERVED_FIELD_KEYS = /* @__PURE__ */ new Set(["widgetName", "widgetAuthor", "widgetDuration"]);
1530
+ var RESERVED_FIELD_KEYS = /* @__PURE__ */ new Set([
1531
+ "widgetName",
1532
+ "widgetAuthor",
1533
+ "widgetDuration"
1534
+ ]);
1531
1535
  function translateConfigs(sourceFields) {
1532
1536
  if (!sourceFields) return [];
1533
1537
  return Object.entries(sourceFields).filter(([key]) => !RESERVED_FIELD_KEYS.has(key)).map(([key, f]) => {
@@ -1544,6 +1548,20 @@ function translateConfigs(sourceFields) {
1544
1548
  options: f.options
1545
1549
  };
1546
1550
  if (sourceType === "hidden") base.hidden = true;
1551
+ if (sourceType === "slider") {
1552
+ const sliderOptions = { ...f.options ?? {} };
1553
+ if (f.min != null && sliderOptions.min == null)
1554
+ sliderOptions.min = f.min;
1555
+ if (f.max != null && sliderOptions.max == null)
1556
+ sliderOptions.max = f.max;
1557
+ if (f.step != null && sliderOptions.step == null)
1558
+ sliderOptions.step = f.step;
1559
+ if (f.prefix != null && sliderOptions.prefix == null)
1560
+ sliderOptions.prefix = f.prefix;
1561
+ if (f.suffix != null && sliderOptions.suffix == null)
1562
+ sliderOptions.suffix = f.suffix;
1563
+ base.options = sliderOptions;
1564
+ }
1547
1565
  return base;
1548
1566
  });
1549
1567
  }
@@ -1562,28 +1580,33 @@ function mapCustom(widget, ctx) {
1562
1580
  const fieldData = parse(v.fieldData) ?? v.fieldData;
1563
1581
  const widgetProvider = widget.provider;
1564
1582
  const provider = widgetProvider === "kick" || widgetProvider === "youtube" || widgetProvider === "twitch" ? widgetProvider : ctx?.provider ?? "twitch";
1565
- return buildUnit(widget, "custom", {
1566
- content: {
1567
- // SE widget ids are integers unique only within a single SE overlay
1568
- // (1, 2, 3…). Using them as Lumia codeIds would collide across
1569
- // imports — codeId is the scoping key for variables, storage, and
1570
- // event listeners. Mint a fresh nanoid so every imported widget
1571
- // has its own scope.
1572
- codeId: nanoid2(),
1573
- html: v.html ?? "",
1574
- css: v.css ?? "",
1575
- js: v.js ?? "",
1576
- configs: translateConfigs(fields),
1577
- data: fieldData ?? {},
1578
- flavor: "streamelements",
1579
- // Native field on the Custom module content. The compatibility
1580
- // shim in Embed.tsx reads this to pick the right listener-name
1581
- // mapping table when forwarding Lumia events into the iframe as
1582
- // `onEventReceived` payloads. Default 'twitch' matches the shim's
1583
- // historical default so legacy imports keep working.
1584
- sourceProvider: provider
1585
- }
1586
- }, ctx);
1583
+ return buildUnit(
1584
+ widget,
1585
+ "custom",
1586
+ {
1587
+ content: {
1588
+ // SE widget ids are integers unique only within a single SE overlay
1589
+ // (1, 2, 3…). Using them as Lumia codeIds would collide across
1590
+ // imports — codeId is the scoping key for variables, storage, and
1591
+ // event listeners. Mint a fresh nanoid so every imported widget
1592
+ // has its own scope.
1593
+ codeId: nanoid2(),
1594
+ html: v.html ?? "",
1595
+ css: v.css ?? "",
1596
+ js: v.js ?? "",
1597
+ configs: translateConfigs(fields),
1598
+ data: fieldData ?? {},
1599
+ flavor: "streamelements",
1600
+ // Native field on the Custom module content. The compatibility
1601
+ // shim in Embed.tsx reads this to pick the right listener-name
1602
+ // mapping table when forwarding Lumia events into the iframe as
1603
+ // `onEventReceived` payloads. Default 'twitch' matches the shim's
1604
+ // historical default so legacy imports keep working.
1605
+ sourceProvider: provider
1606
+ }
1607
+ },
1608
+ ctx
1609
+ );
1587
1610
  }
1588
1611
 
1589
1612
  // src/se-import/mappers/misc.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/ui",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "author": "Lumia Stream",
5
5
  "license": "ISC",
6
6
  "description": "Lumia UI Kit",
@@ -128,7 +128,7 @@
128
128
  "vitest": "^4.1.6"
129
129
  },
130
130
  "dependencies": {
131
- "@lumiastream/lumia-translations": "1.15.9",
131
+ "@lumiastream/lumia-translations": "1.16.0",
132
132
  "@lumiastream/lumia-types": "^3.3.7-alpha.2",
133
133
  "classnames": "^2.5.1",
134
134
  "globals": "^17.4.0",