@lumiastream/ui 0.2.8-alpha.25 → 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 +37 -42
- package/dist/se-import.js +37 -42
- package/package.json +1 -1
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
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
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
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
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) {
|
|
@@ -4678,21 +4684,10 @@ function mapTimer(widget, ctx) {
|
|
|
4678
4684
|
if (v.seconds !== false) clockBits.push("{{seconds}}");
|
|
4679
4685
|
if (clockBits.length) parts.push(clockBits.join(":"));
|
|
4680
4686
|
}
|
|
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
|
-
};
|
|
4694
4687
|
return buildUnit(widget, "timer", {
|
|
4695
|
-
|
|
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),
|
|
4696
4691
|
content: {
|
|
4697
4692
|
version: 1,
|
|
4698
4693
|
type: "countdown",
|
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
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
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
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
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) {
|
|
@@ -1563,21 +1569,10 @@ function mapTimer(widget, ctx) {
|
|
|
1563
1569
|
if (v.seconds !== false) clockBits.push("{{seconds}}");
|
|
1564
1570
|
if (clockBits.length) parts.push(clockBits.join(":"));
|
|
1565
1571
|
}
|
|
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
|
-
};
|
|
1579
1572
|
return buildUnit(widget, "timer", {
|
|
1580
|
-
|
|
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),
|
|
1581
1576
|
content: {
|
|
1582
1577
|
version: 1,
|
|
1583
1578
|
type: "countdown",
|