@lumiastream/ui 0.2.8-alpha.23 → 0.2.8-alpha.25

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
@@ -3114,7 +3114,7 @@ var resolveChatterProfileUrlWithResolvers = async ({
3114
3114
  };
3115
3115
 
3116
3116
  // src/se-import/index.ts
3117
- import { nanoid as nanoid3 } from "nanoid";
3117
+ import { nanoid as nanoid4 } from "nanoid";
3118
3118
 
3119
3119
  // src/se-import/translate.ts
3120
3120
  var SE_TO_LUMIA_PLACEHOLDER = {
@@ -4062,6 +4062,7 @@ function mapGoal(widget, ctx) {
4062
4062
  }
4063
4063
 
4064
4064
  // src/se-import/mappers/custom.ts
4065
+ import { nanoid as nanoid2 } from "nanoid";
4065
4066
  var SOURCE_TO_LUMIA_FIELD_TYPE = {
4066
4067
  text: "input",
4067
4068
  number: "number",
@@ -4121,15 +4122,28 @@ function mapCustom(widget, ctx) {
4121
4122
  };
4122
4123
  const fields = parse(v.fields) ?? v.fields;
4123
4124
  const fieldData = parse(v.fieldData) ?? v.fieldData;
4125
+ const widgetProvider = widget.provider;
4126
+ const provider = widgetProvider === "kick" || widgetProvider === "youtube" || widgetProvider === "twitch" ? widgetProvider : ctx?.provider ?? "twitch";
4124
4127
  return buildUnit(widget, "custom", {
4125
4128
  content: {
4126
- codeId: String(widget.id),
4129
+ // SE widget ids are integers unique only within a single SE overlay
4130
+ // (1, 2, 3…). Using them as Lumia codeIds would collide across
4131
+ // imports — codeId is the scoping key for variables, storage, and
4132
+ // event listeners. Mint a fresh nanoid so every imported widget
4133
+ // has its own scope.
4134
+ codeId: nanoid2(),
4127
4135
  html: v.html ?? "",
4128
4136
  css: v.css ?? "",
4129
4137
  js: v.js ?? "",
4130
4138
  configs: translateConfigs(fields),
4131
4139
  data: fieldData ?? {},
4132
- flavor: "streamelements"
4140
+ flavor: "streamelements",
4141
+ // Native field on the Custom module content. The compatibility
4142
+ // shim in Embed.tsx reads this to pick the right listener-name
4143
+ // mapping table when forwarding Lumia events into the iframe as
4144
+ // `onEventReceived` payloads. Default 'twitch' matches the shim's
4145
+ // historical default so legacy imports keep working.
4146
+ sourceProvider: provider
4133
4147
  }
4134
4148
  }, ctx);
4135
4149
  }
@@ -4664,7 +4678,21 @@ function mapTimer(widget, ctx) {
4664
4678
  if (v.seconds !== false) clockBits.push("{{seconds}}");
4665
4679
  if (clockBits.length) parts.push(clockBits.join(":"));
4666
4680
  }
4681
+ const seTextCss = widget.text?.css ?? {};
4682
+ const asStr = (v2, fallback) => typeof v2 === "string" && v2.length > 0 ? v2 : fallback;
4683
+ const asNum = (v2, fallback) => typeof v2 === "number" && Number.isFinite(v2) ? v2 : typeof v2 === "string" && v2.length > 0 ? v2 : fallback;
4684
+ const moduleCss = {
4685
+ lineHeight: asNum(seTextCss["line-height"], 1),
4686
+ fontSize: asNum(seTextCss["font-size"], 24),
4687
+ textAlign: asStr(seTextCss["text-align"], "center"),
4688
+ fontFamily: asStr(seTextCss["font-family"], "Roboto"),
4689
+ fontWeight: asStr(seTextCss["font-weight"], "bold"),
4690
+ color: asStr(seTextCss.color, "#ffffff"),
4691
+ textShadow: asStr(seTextCss["text-shadow"], "rgb(0, 0, 0) 1px 1px 1px"),
4692
+ background: "transparent"
4693
+ };
4667
4694
  return buildUnit(widget, "timer", {
4695
+ css: moduleCss,
4668
4696
  content: {
4669
4697
  version: 1,
4670
4698
  type: "countdown",
@@ -4673,6 +4701,7 @@ function mapTimer(widget, ctx) {
4673
4701
  showMilliseconds: false,
4674
4702
  endAnimation: "",
4675
4703
  hideAfter: 0,
4704
+ highlightColor: "inherit",
4676
4705
  messageAfterCountdown: translateSeText(v.messageAfterCountdown ?? ""),
4677
4706
  changeMessageAfter: !!v.changeMessageAfterCountdown,
4678
4707
  countDate: hasValidAbsoluteDate && (!!v.exactTime || !!v.datePicker || !!absoluteDate),
@@ -5494,7 +5523,7 @@ function guessMime(name) {
5494
5523
  }
5495
5524
 
5496
5525
  // src/se-import/transplant.ts
5497
- import { nanoid as nanoid2 } from "nanoid";
5526
+ import { nanoid as nanoid3 } from "nanoid";
5498
5527
  function cloneModuleForTransplant(srcModule, newId) {
5499
5528
  const clonedContent = srcModule.content ? structuredClone(srcModule.content) : srcModule.content;
5500
5529
  if (srcModule.settings?.type === "custom" && clonedContent) {
@@ -5512,7 +5541,7 @@ function transplantLayer(source, sourceLayerId) {
5512
5541
  const srcLayer = layers.find((l) => l.id === sourceLayerId);
5513
5542
  const srcModule = modules[sourceLayerId];
5514
5543
  if (!srcLayer || !srcModule) return null;
5515
- const rootNewId = nanoid2();
5544
+ const rootNewId = nanoid3();
5516
5545
  if (srcLayer.type !== "group") {
5517
5546
  const layer = { ...srcLayer, id: rootNewId };
5518
5547
  const module = cloneModuleForTransplant(srcModule, rootNewId);
@@ -5530,7 +5559,7 @@ function transplantLayer(source, sourceLayerId) {
5530
5559
  if (seen.has(child.id)) continue;
5531
5560
  seen.add(child.id);
5532
5561
  descendants.push(child);
5533
- idRemap.set(child.id, nanoid2());
5562
+ idRemap.set(child.id, nanoid3());
5534
5563
  if (child.type === "group") queue.push(child.id);
5535
5564
  }
5536
5565
  }
@@ -8294,7 +8323,7 @@ function importSEBootstrap(bootstrap) {
8294
8323
  if (w.type !== "se-widget-group") continue;
8295
8324
  const uid = w.variables?.uid;
8296
8325
  if (typeof uid !== "string") continue;
8297
- const lumiaGroupId = nanoid3();
8326
+ const lumiaGroupId = nanoid4();
8298
8327
  seUidToLumiaGroupId[uid] = lumiaGroupId;
8299
8328
  groupWidgetByUid[uid] = w;
8300
8329
  }
package/dist/se-import.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/se-import/index.ts
2
- import { nanoid as nanoid3 } from "nanoid";
2
+ import { nanoid as nanoid4 } from "nanoid";
3
3
 
4
4
  // src/se-import/translate.ts
5
5
  var SE_TO_LUMIA_PLACEHOLDER = {
@@ -947,6 +947,7 @@ function mapGoal(widget, ctx) {
947
947
  }
948
948
 
949
949
  // src/se-import/mappers/custom.ts
950
+ import { nanoid as nanoid2 } from "nanoid";
950
951
  var SOURCE_TO_LUMIA_FIELD_TYPE = {
951
952
  text: "input",
952
953
  number: "number",
@@ -1006,15 +1007,28 @@ function mapCustom(widget, ctx) {
1006
1007
  };
1007
1008
  const fields = parse(v.fields) ?? v.fields;
1008
1009
  const fieldData = parse(v.fieldData) ?? v.fieldData;
1010
+ const widgetProvider = widget.provider;
1011
+ const provider = widgetProvider === "kick" || widgetProvider === "youtube" || widgetProvider === "twitch" ? widgetProvider : ctx?.provider ?? "twitch";
1009
1012
  return buildUnit(widget, "custom", {
1010
1013
  content: {
1011
- codeId: String(widget.id),
1014
+ // SE widget ids are integers unique only within a single SE overlay
1015
+ // (1, 2, 3…). Using them as Lumia codeIds would collide across
1016
+ // imports — codeId is the scoping key for variables, storage, and
1017
+ // event listeners. Mint a fresh nanoid so every imported widget
1018
+ // has its own scope.
1019
+ codeId: nanoid2(),
1012
1020
  html: v.html ?? "",
1013
1021
  css: v.css ?? "",
1014
1022
  js: v.js ?? "",
1015
1023
  configs: translateConfigs(fields),
1016
1024
  data: fieldData ?? {},
1017
- flavor: "streamelements"
1025
+ flavor: "streamelements",
1026
+ // Native field on the Custom module content. The compatibility
1027
+ // shim in Embed.tsx reads this to pick the right listener-name
1028
+ // mapping table when forwarding Lumia events into the iframe as
1029
+ // `onEventReceived` payloads. Default 'twitch' matches the shim's
1030
+ // historical default so legacy imports keep working.
1031
+ sourceProvider: provider
1018
1032
  }
1019
1033
  }, ctx);
1020
1034
  }
@@ -1549,7 +1563,21 @@ function mapTimer(widget, ctx) {
1549
1563
  if (v.seconds !== false) clockBits.push("{{seconds}}");
1550
1564
  if (clockBits.length) parts.push(clockBits.join(":"));
1551
1565
  }
1566
+ const seTextCss = widget.text?.css ?? {};
1567
+ const asStr = (v2, fallback) => typeof v2 === "string" && v2.length > 0 ? v2 : fallback;
1568
+ const asNum = (v2, fallback) => typeof v2 === "number" && Number.isFinite(v2) ? v2 : typeof v2 === "string" && v2.length > 0 ? v2 : fallback;
1569
+ const moduleCss = {
1570
+ lineHeight: asNum(seTextCss["line-height"], 1),
1571
+ fontSize: asNum(seTextCss["font-size"], 24),
1572
+ textAlign: asStr(seTextCss["text-align"], "center"),
1573
+ fontFamily: asStr(seTextCss["font-family"], "Roboto"),
1574
+ fontWeight: asStr(seTextCss["font-weight"], "bold"),
1575
+ color: asStr(seTextCss.color, "#ffffff"),
1576
+ textShadow: asStr(seTextCss["text-shadow"], "rgb(0, 0, 0) 1px 1px 1px"),
1577
+ background: "transparent"
1578
+ };
1552
1579
  return buildUnit(widget, "timer", {
1580
+ css: moduleCss,
1553
1581
  content: {
1554
1582
  version: 1,
1555
1583
  type: "countdown",
@@ -1558,6 +1586,7 @@ function mapTimer(widget, ctx) {
1558
1586
  showMilliseconds: false,
1559
1587
  endAnimation: "",
1560
1588
  hideAfter: 0,
1589
+ highlightColor: "inherit",
1561
1590
  messageAfterCountdown: translateSeText(v.messageAfterCountdown ?? ""),
1562
1591
  changeMessageAfter: !!v.changeMessageAfterCountdown,
1563
1592
  countDate: hasValidAbsoluteDate && (!!v.exactTime || !!v.datePicker || !!absoluteDate),
@@ -2379,7 +2408,7 @@ function guessMime(name) {
2379
2408
  }
2380
2409
 
2381
2410
  // src/se-import/transplant.ts
2382
- import { nanoid as nanoid2 } from "nanoid";
2411
+ import { nanoid as nanoid3 } from "nanoid";
2383
2412
  function cloneModuleForTransplant(srcModule, newId) {
2384
2413
  const clonedContent = srcModule.content ? structuredClone(srcModule.content) : srcModule.content;
2385
2414
  if (srcModule.settings?.type === "custom" && clonedContent) {
@@ -2397,7 +2426,7 @@ function transplantLayer(source, sourceLayerId) {
2397
2426
  const srcLayer = layers.find((l) => l.id === sourceLayerId);
2398
2427
  const srcModule = modules[sourceLayerId];
2399
2428
  if (!srcLayer || !srcModule) return null;
2400
- const rootNewId = nanoid2();
2429
+ const rootNewId = nanoid3();
2401
2430
  if (srcLayer.type !== "group") {
2402
2431
  const layer = { ...srcLayer, id: rootNewId };
2403
2432
  const module = cloneModuleForTransplant(srcModule, rootNewId);
@@ -2415,7 +2444,7 @@ function transplantLayer(source, sourceLayerId) {
2415
2444
  if (seen.has(child.id)) continue;
2416
2445
  seen.add(child.id);
2417
2446
  descendants.push(child);
2418
- idRemap.set(child.id, nanoid2());
2447
+ idRemap.set(child.id, nanoid3());
2419
2448
  if (child.type === "group") queue.push(child.id);
2420
2449
  }
2421
2450
  }
@@ -7164,7 +7193,7 @@ function importSEBootstrap(bootstrap) {
7164
7193
  if (w.type !== "se-widget-group") continue;
7165
7194
  const uid = w.variables?.uid;
7166
7195
  if (typeof uid !== "string") continue;
7167
- const lumiaGroupId = nanoid3();
7196
+ const lumiaGroupId = nanoid4();
7168
7197
  seUidToLumiaGroupId[uid] = lumiaGroupId;
7169
7198
  groupWidgetByUid[uid] = w;
7170
7199
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/ui",
3
- "version": "0.2.8-alpha.23",
3
+ "version": "0.2.8-alpha.25",
4
4
  "author": "Lumia Stream",
5
5
  "license": "ISC",
6
6
  "description": "Lumia UI Kit",