@lumiastream/ui 0.2.8-alpha.24 → 0.2.8-alpha.26

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
@@ -3502,6 +3502,25 @@ function seLayoutUsesPushText(seLayout) {
3502
3502
 
3503
3503
  // src/se-import/mappers/build.ts
3504
3504
  import { nanoid } from "nanoid";
3505
+ function mapSeTextCssToModuleCss(widget, defaults = {}) {
3506
+ const seTextCss = widget.text?.css ?? {};
3507
+ const asStr = (v, fallback) => typeof v === "string" && v.length > 0 ? v : fallback;
3508
+ const asNumOrStr = (v, fallback) => {
3509
+ if (typeof v === "number" && Number.isFinite(v)) return v;
3510
+ if (typeof v === "string" && v.length > 0) return v;
3511
+ return fallback;
3512
+ };
3513
+ return {
3514
+ lineHeight: asNumOrStr(seTextCss["line-height"], defaults.lineHeight ?? 1),
3515
+ fontSize: asNumOrStr(seTextCss["font-size"], defaults.fontSize ?? 24),
3516
+ textAlign: asStr(seTextCss["text-align"], defaults.textAlign ?? "center"),
3517
+ fontFamily: asStr(seTextCss["font-family"], defaults.fontFamily ?? "Roboto"),
3518
+ fontWeight: asStr(seTextCss["font-weight"], defaults.fontWeight ?? "bold"),
3519
+ color: asStr(seTextCss.color, defaults.color ?? "#ffffff"),
3520
+ textShadow: asStr(seTextCss["text-shadow"], defaults.textShadow ?? "rgb(0, 0, 0) 1px 1px 1px"),
3521
+ background: defaults.background ?? "transparent"
3522
+ };
3523
+ }
3505
3524
  function buildUnit(widget, lumiaType, moduleExtras, ctx) {
3506
3525
  const id = nanoid();
3507
3526
  const defaults = LUMIA_DEFAULT_SIZES[lumiaType] ?? { width: 400, height: 400 };
@@ -3998,7 +4017,6 @@ function mapGoal(widget, ctx) {
3998
4017
  const v = widget.variables ?? {};
3999
4018
  const listener = v.goalListener ?? (typeof widget.listener === "string" ? widget.listener : null);
4000
4019
  const charity = charityGoalVariables(widget.type);
4001
- const seTextCss = widget.text?.css ?? {};
4002
4020
  return buildUnit(widget, "goal", {
4003
4021
  content: {
4004
4022
  version: 1,
@@ -4041,23 +4059,16 @@ function mapGoal(widget, ctx) {
4041
4059
  simpleDesign: !!v.simpleDesign
4042
4060
  })
4043
4061
  },
4044
- css: {
4045
- // `borderRadius` / `borderStyle` / `borderWidth` / `borderColor`
4046
- // used to be set here too, but the Goal renderer applies its own
4047
- // border + borderRadius via inline `style={…}` on the .goal-bar
4048
- // div (see Goal/index.tsx:123,127,155) sourced from
4049
- // `content.border` and `content.borderRadius`. Writing them to
4050
- // module.css just plopped useless transparent-0px rules on the
4051
- // outer .overlay-module wrapper.
4052
- lineHeight: seTextCss["line-height"] ?? 1,
4053
- fontSize: seTextCss["font-size"] ?? 30,
4054
- textAlign: seTextCss["text-align"] ?? "center",
4055
- fontFamily: seTextCss["font-family"] ?? "Roboto",
4056
- fontWeight: seTextCss["font-weight"] ?? "bold",
4057
- color: seTextCss.color ?? "#ffffff",
4058
- textShadow: seTextCss["text-shadow"] ?? "rgb(0, 0, 0) 1px 1px 1px",
4059
- background: "transparent"
4060
- }
4062
+ // `borderRadius` / `borderStyle` / `borderWidth` / `borderColor`
4063
+ // used to be set on `css` too, but the Goal renderer applies its
4064
+ // own border + borderRadius via inline `style={…}` on the .goal-bar
4065
+ // div (see Goal/index.tsx:123,127,155) sourced from
4066
+ // `content.border` and `content.borderRadius`. Writing them to
4067
+ // module.css just plopped useless transparent-0px rules on the
4068
+ // outer .overlay-module wrapper. SE charity goals commonly use
4069
+ // 24-30px Nunito/Roboto — fontSize default of 30 mirrors the
4070
+ // previous hardcoded fallback.
4071
+ css: mapSeTextCssToModuleCss(widget, { fontSize: 30 })
4061
4072
  }, ctx);
4062
4073
  }
4063
4074
 
@@ -4542,16 +4553,11 @@ function mapCredits(widget, ctx) {
4542
4553
  amount: v.amount
4543
4554
  })
4544
4555
  },
4545
- css: {
4546
- fontSize: 30,
4547
- lineHeight: 1,
4548
- fontFamily: "Roboto",
4549
- fontWeight: "normal",
4550
- color: "#ffffff",
4551
- textShadow: "",
4552
- textAlign: "center",
4553
- background: "transparent"
4554
- }
4556
+ // Credits renders scrolling section headers + per-event lines; the
4557
+ // renderer reads font/size/weight/color from module.css. Pull from SE's
4558
+ // text.css so an imported credits widget keeps the streamer's chosen
4559
+ // font and weight — defaults match the prior hardcoded fallbacks.
4560
+ css: mapSeTextCssToModuleCss(widget, { fontSize: 30, fontWeight: "normal", textShadow: "" })
4555
4561
  }, ctx);
4556
4562
  }
4557
4563
  function inferSlideshowMediaType(mime, url) {
@@ -4679,6 +4685,9 @@ function mapTimer(widget, ctx) {
4679
4685
  if (clockBits.length) parts.push(clockBits.join(":"));
4680
4686
  }
4681
4687
  return buildUnit(widget, "timer", {
4688
+ // Carry the streamer's SE text styling (font/size/color/shadow) so an
4689
+ // imported countdown doesn't render in Lumia's default Roboto/24px.
4690
+ css: mapSeTextCssToModuleCss(widget),
4682
4691
  content: {
4683
4692
  version: 1,
4684
4693
  type: "countdown",
@@ -4687,6 +4696,7 @@ function mapTimer(widget, ctx) {
4687
4696
  showMilliseconds: false,
4688
4697
  endAnimation: "",
4689
4698
  hideAfter: 0,
4699
+ highlightColor: "inherit",
4690
4700
  messageAfterCountdown: translateSeText(v.messageAfterCountdown ?? ""),
4691
4701
  changeMessageAfter: !!v.changeMessageAfterCountdown,
4692
4702
  countDate: hasValidAbsoluteDate && (!!v.exactTime || !!v.datePicker || !!absoluteDate),
package/dist/se-import.js CHANGED
@@ -387,6 +387,25 @@ function seLayoutUsesPushText(seLayout) {
387
387
 
388
388
  // src/se-import/mappers/build.ts
389
389
  import { nanoid } from "nanoid";
390
+ function mapSeTextCssToModuleCss(widget, defaults = {}) {
391
+ const seTextCss = widget.text?.css ?? {};
392
+ const asStr = (v, fallback) => typeof v === "string" && v.length > 0 ? v : fallback;
393
+ const asNumOrStr = (v, fallback) => {
394
+ if (typeof v === "number" && Number.isFinite(v)) return v;
395
+ if (typeof v === "string" && v.length > 0) return v;
396
+ return fallback;
397
+ };
398
+ return {
399
+ lineHeight: asNumOrStr(seTextCss["line-height"], defaults.lineHeight ?? 1),
400
+ fontSize: asNumOrStr(seTextCss["font-size"], defaults.fontSize ?? 24),
401
+ textAlign: asStr(seTextCss["text-align"], defaults.textAlign ?? "center"),
402
+ fontFamily: asStr(seTextCss["font-family"], defaults.fontFamily ?? "Roboto"),
403
+ fontWeight: asStr(seTextCss["font-weight"], defaults.fontWeight ?? "bold"),
404
+ color: asStr(seTextCss.color, defaults.color ?? "#ffffff"),
405
+ textShadow: asStr(seTextCss["text-shadow"], defaults.textShadow ?? "rgb(0, 0, 0) 1px 1px 1px"),
406
+ background: defaults.background ?? "transparent"
407
+ };
408
+ }
390
409
  function buildUnit(widget, lumiaType, moduleExtras, ctx) {
391
410
  const id = nanoid();
392
411
  const defaults = LUMIA_DEFAULT_SIZES[lumiaType] ?? { width: 400, height: 400 };
@@ -883,7 +902,6 @@ function mapGoal(widget, ctx) {
883
902
  const v = widget.variables ?? {};
884
903
  const listener = v.goalListener ?? (typeof widget.listener === "string" ? widget.listener : null);
885
904
  const charity = charityGoalVariables(widget.type);
886
- const seTextCss = widget.text?.css ?? {};
887
905
  return buildUnit(widget, "goal", {
888
906
  content: {
889
907
  version: 1,
@@ -926,23 +944,16 @@ function mapGoal(widget, ctx) {
926
944
  simpleDesign: !!v.simpleDesign
927
945
  })
928
946
  },
929
- css: {
930
- // `borderRadius` / `borderStyle` / `borderWidth` / `borderColor`
931
- // used to be set here too, but the Goal renderer applies its own
932
- // border + borderRadius via inline `style={…}` on the .goal-bar
933
- // div (see Goal/index.tsx:123,127,155) sourced from
934
- // `content.border` and `content.borderRadius`. Writing them to
935
- // module.css just plopped useless transparent-0px rules on the
936
- // outer .overlay-module wrapper.
937
- lineHeight: seTextCss["line-height"] ?? 1,
938
- fontSize: seTextCss["font-size"] ?? 30,
939
- textAlign: seTextCss["text-align"] ?? "center",
940
- fontFamily: seTextCss["font-family"] ?? "Roboto",
941
- fontWeight: seTextCss["font-weight"] ?? "bold",
942
- color: seTextCss.color ?? "#ffffff",
943
- textShadow: seTextCss["text-shadow"] ?? "rgb(0, 0, 0) 1px 1px 1px",
944
- background: "transparent"
945
- }
947
+ // `borderRadius` / `borderStyle` / `borderWidth` / `borderColor`
948
+ // used to be set on `css` too, but the Goal renderer applies its
949
+ // own border + borderRadius via inline `style={…}` on the .goal-bar
950
+ // div (see Goal/index.tsx:123,127,155) sourced from
951
+ // `content.border` and `content.borderRadius`. Writing them to
952
+ // module.css just plopped useless transparent-0px rules on the
953
+ // outer .overlay-module wrapper. SE charity goals commonly use
954
+ // 24-30px Nunito/Roboto — fontSize default of 30 mirrors the
955
+ // previous hardcoded fallback.
956
+ css: mapSeTextCssToModuleCss(widget, { fontSize: 30 })
946
957
  }, ctx);
947
958
  }
948
959
 
@@ -1427,16 +1438,11 @@ function mapCredits(widget, ctx) {
1427
1438
  amount: v.amount
1428
1439
  })
1429
1440
  },
1430
- css: {
1431
- fontSize: 30,
1432
- lineHeight: 1,
1433
- fontFamily: "Roboto",
1434
- fontWeight: "normal",
1435
- color: "#ffffff",
1436
- textShadow: "",
1437
- textAlign: "center",
1438
- background: "transparent"
1439
- }
1441
+ // Credits renders scrolling section headers + per-event lines; the
1442
+ // renderer reads font/size/weight/color from module.css. Pull from SE's
1443
+ // text.css so an imported credits widget keeps the streamer's chosen
1444
+ // font and weight — defaults match the prior hardcoded fallbacks.
1445
+ css: mapSeTextCssToModuleCss(widget, { fontSize: 30, fontWeight: "normal", textShadow: "" })
1440
1446
  }, ctx);
1441
1447
  }
1442
1448
  function inferSlideshowMediaType(mime, url) {
@@ -1564,6 +1570,9 @@ function mapTimer(widget, ctx) {
1564
1570
  if (clockBits.length) parts.push(clockBits.join(":"));
1565
1571
  }
1566
1572
  return buildUnit(widget, "timer", {
1573
+ // Carry the streamer's SE text styling (font/size/color/shadow) so an
1574
+ // imported countdown doesn't render in Lumia's default Roboto/24px.
1575
+ css: mapSeTextCssToModuleCss(widget),
1567
1576
  content: {
1568
1577
  version: 1,
1569
1578
  type: "countdown",
@@ -1572,6 +1581,7 @@ function mapTimer(widget, ctx) {
1572
1581
  showMilliseconds: false,
1573
1582
  endAnimation: "",
1574
1583
  hideAfter: 0,
1584
+ highlightColor: "inherit",
1575
1585
  messageAfterCountdown: translateSeText(v.messageAfterCountdown ?? ""),
1576
1586
  changeMessageAfter: !!v.changeMessageAfterCountdown,
1577
1587
  countDate: hasValidAbsoluteDate && (!!v.exactTime || !!v.datePicker || !!absoluteDate),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/ui",
3
- "version": "0.2.8-alpha.24",
3
+ "version": "0.2.8-alpha.26",
4
4
  "author": "Lumia Stream",
5
5
  "license": "ISC",
6
6
  "description": "Lumia UI Kit",