@lumiastream/ui 0.5.7 → 0.5.9

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
@@ -4138,7 +4138,9 @@ function seInnerAutoFit(widget, innerCss, mode) {
4138
4138
  const isInnerAutoWidth = innerCss?.width === "auto";
4139
4139
  const isInnerAutoHeight = innerCss?.height === "auto";
4140
4140
  if (mode === "width-drives-both") {
4141
- if (!isInnerAutoWidth) return {};
4141
+ if (!innerCss) return {};
4142
+ const innerWidth = innerCss.width;
4143
+ if (innerWidth === "100" || innerWidth === "100%") return {};
4142
4144
  return { objectFit: "contain", autoWidth: true, autoHeight: true };
4143
4145
  }
4144
4146
  if (!isInnerAutoWidth && !isInnerAutoHeight) return {};
@@ -5121,10 +5123,10 @@ function defaultChatboxBackgroundForSeTheme(seTheme) {
5121
5123
  const t = (seTheme ?? "").toString().toLowerCase();
5122
5124
  if (!t || t === "default") return "transparent";
5123
5125
  if (t === "custom") return "transparent";
5126
+ if (t.includes("white")) return "#ffffff";
5124
5127
  if (t.includes("glass") || t.includes("transparent") || t.includes("flipin") || t.includes("bubble") || t.includes("bubbly"))
5125
5128
  return "transparent";
5126
- if (t.includes("white") || t.includes("light") || t.includes("clean") && !t.includes("dark"))
5127
- return "transparent";
5129
+ if (t.includes("light") || t.includes("clean") && !t.includes("dark")) return "transparent";
5128
5130
  if (t.includes("dark") || t.includes("boxy") || t.includes("checker") || t.includes("black"))
5129
5131
  return "#1e1e1e";
5130
5132
  return "#1e1e1e";
@@ -5194,11 +5196,18 @@ function mapChatbox(widget, ctx) {
5194
5196
  } else if (rawColor != null) {
5195
5197
  moduleCss.color = rawColor;
5196
5198
  }
5197
- const textShadow = messageWins("text-shadow");
5198
- if (textShadow != null) moduleCss.textShadow = textShadow;
5199
+ const messageTextShadow = messageCss["text-shadow"];
5200
+ if (typeof messageTextShadow === "string" && messageTextShadow.length > 0) {
5201
+ moduleCss.textShadow = messageTextShadow;
5202
+ }
5199
5203
  const textAlign = messageWins("text-align");
5200
5204
  if (textAlign != null) moduleCss.textAlign = textAlign;
5201
- if (textCss["font-weight"] != null) moduleCss.fontWeight = textCss["font-weight"];
5205
+ const messageFontWeight = messageCss["font-weight"];
5206
+ if (typeof messageFontWeight === "string" && messageFontWeight.length > 0) {
5207
+ moduleCss.fontWeight = messageFontWeight;
5208
+ } else if (typeof messageFontWeight === "number") {
5209
+ moduleCss.fontWeight = messageFontWeight;
5210
+ }
5202
5211
  if (textCss["line-height"] != null) moduleCss.lineHeight = textCss["line-height"];
5203
5212
  const messageBackground = typeof messageCss["background"] === "string" && messageCss["background"].length > 0 ? messageCss["background"] : defaultChatboxBackgroundForSeTheme(v.theme);
5204
5213
  moduleCss.background = messageBackground;
@@ -5216,7 +5225,13 @@ function mapChatbox(widget, ctx) {
5216
5225
  fadeOutAfterDelay: fadeOutSeconds > 0,
5217
5226
  fadeOutDelayTime: fadeOutSeconds,
5218
5227
  showAvatar: true,
5219
- breakLine: false,
5228
+ // SE's `.chat-line` renders with `word-break: break-word` and inline
5229
+ // badges/emotes flowing inline-with-wrap. Lumia's chatbox container
5230
+ // already has `word-break: break-word` + `overflow-wrap: anywhere`,
5231
+ // and `breakLine: true` adds the `flex-wrap: wrap; align-items: center`
5232
+ // layout that lets badges/emotes wrap alongside text — which is what
5233
+ // SE does. Forcing `false` here was suppressing wrap on long lines.
5234
+ breakLine: true,
5220
5235
  ...accentColor ? {
5221
5236
  chatboxStreamingSite: {
5222
5237
  ...chatboxDefaults.chatboxStreamingSite,
@@ -5746,7 +5761,11 @@ function mapTimer(widget, ctx) {
5746
5761
  {
5747
5762
  // Carry the streamer's SE text styling (font/size/color/shadow) so an
5748
5763
  // imported countdown doesn't render in Lumia's default Roboto/24px.
5749
- css: mapSeTextCssToModuleCss(widget),
5764
+ // scaleWithContainer: SE renders the countdown at the literal font-size and lets
5765
+ // `widget { overflow:hidden }` clip the overflow (visually masked by the canvas-level
5766
+ // transform). Lumia has no equivalent clip on the layer, so a 150px font in a 162px
5767
+ // box overflows visibly. Opt the imported timer into Lumia's container-query auto-fit.
5768
+ css: { ...mapSeTextCssToModuleCss(widget), scaleWithContainer: true },
5750
5769
  content: {
5751
5770
  version: 1,
5752
5771
  type: "countdown",
package/dist/se-import.js CHANGED
@@ -1058,7 +1058,9 @@ function seInnerAutoFit(widget, innerCss, mode) {
1058
1058
  const isInnerAutoWidth = innerCss?.width === "auto";
1059
1059
  const isInnerAutoHeight = innerCss?.height === "auto";
1060
1060
  if (mode === "width-drives-both") {
1061
- if (!isInnerAutoWidth) return {};
1061
+ if (!innerCss) return {};
1062
+ const innerWidth = innerCss.width;
1063
+ if (innerWidth === "100" || innerWidth === "100%") return {};
1062
1064
  return { objectFit: "contain", autoWidth: true, autoHeight: true };
1063
1065
  }
1064
1066
  if (!isInnerAutoWidth && !isInnerAutoHeight) return {};
@@ -2041,10 +2043,10 @@ function defaultChatboxBackgroundForSeTheme(seTheme) {
2041
2043
  const t = (seTheme ?? "").toString().toLowerCase();
2042
2044
  if (!t || t === "default") return "transparent";
2043
2045
  if (t === "custom") return "transparent";
2046
+ if (t.includes("white")) return "#ffffff";
2044
2047
  if (t.includes("glass") || t.includes("transparent") || t.includes("flipin") || t.includes("bubble") || t.includes("bubbly"))
2045
2048
  return "transparent";
2046
- if (t.includes("white") || t.includes("light") || t.includes("clean") && !t.includes("dark"))
2047
- return "transparent";
2049
+ if (t.includes("light") || t.includes("clean") && !t.includes("dark")) return "transparent";
2048
2050
  if (t.includes("dark") || t.includes("boxy") || t.includes("checker") || t.includes("black"))
2049
2051
  return "#1e1e1e";
2050
2052
  return "#1e1e1e";
@@ -2114,11 +2116,18 @@ function mapChatbox(widget, ctx) {
2114
2116
  } else if (rawColor != null) {
2115
2117
  moduleCss.color = rawColor;
2116
2118
  }
2117
- const textShadow = messageWins("text-shadow");
2118
- if (textShadow != null) moduleCss.textShadow = textShadow;
2119
+ const messageTextShadow = messageCss["text-shadow"];
2120
+ if (typeof messageTextShadow === "string" && messageTextShadow.length > 0) {
2121
+ moduleCss.textShadow = messageTextShadow;
2122
+ }
2119
2123
  const textAlign = messageWins("text-align");
2120
2124
  if (textAlign != null) moduleCss.textAlign = textAlign;
2121
- if (textCss["font-weight"] != null) moduleCss.fontWeight = textCss["font-weight"];
2125
+ const messageFontWeight = messageCss["font-weight"];
2126
+ if (typeof messageFontWeight === "string" && messageFontWeight.length > 0) {
2127
+ moduleCss.fontWeight = messageFontWeight;
2128
+ } else if (typeof messageFontWeight === "number") {
2129
+ moduleCss.fontWeight = messageFontWeight;
2130
+ }
2122
2131
  if (textCss["line-height"] != null) moduleCss.lineHeight = textCss["line-height"];
2123
2132
  const messageBackground = typeof messageCss["background"] === "string" && messageCss["background"].length > 0 ? messageCss["background"] : defaultChatboxBackgroundForSeTheme(v.theme);
2124
2133
  moduleCss.background = messageBackground;
@@ -2136,7 +2145,13 @@ function mapChatbox(widget, ctx) {
2136
2145
  fadeOutAfterDelay: fadeOutSeconds > 0,
2137
2146
  fadeOutDelayTime: fadeOutSeconds,
2138
2147
  showAvatar: true,
2139
- breakLine: false,
2148
+ // SE's `.chat-line` renders with `word-break: break-word` and inline
2149
+ // badges/emotes flowing inline-with-wrap. Lumia's chatbox container
2150
+ // already has `word-break: break-word` + `overflow-wrap: anywhere`,
2151
+ // and `breakLine: true` adds the `flex-wrap: wrap; align-items: center`
2152
+ // layout that lets badges/emotes wrap alongside text — which is what
2153
+ // SE does. Forcing `false` here was suppressing wrap on long lines.
2154
+ breakLine: true,
2140
2155
  ...accentColor ? {
2141
2156
  chatboxStreamingSite: {
2142
2157
  ...chatboxDefaults.chatboxStreamingSite,
@@ -2666,7 +2681,11 @@ function mapTimer(widget, ctx) {
2666
2681
  {
2667
2682
  // Carry the streamer's SE text styling (font/size/color/shadow) so an
2668
2683
  // imported countdown doesn't render in Lumia's default Roboto/24px.
2669
- css: mapSeTextCssToModuleCss(widget),
2684
+ // scaleWithContainer: SE renders the countdown at the literal font-size and lets
2685
+ // `widget { overflow:hidden }` clip the overflow (visually masked by the canvas-level
2686
+ // transform). Lumia has no equivalent clip on the layer, so a 150px font in a 162px
2687
+ // box overflows visibly. Opt the imported timer into Lumia's container-query auto-fit.
2688
+ css: { ...mapSeTextCssToModuleCss(widget), scaleWithContainer: true },
2670
2689
  content: {
2671
2690
  version: 1,
2672
2691
  type: "countdown",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/ui",
3
- "version": "0.5.7",
3
+ "version": "0.5.9",
4
4
  "author": "Lumia Stream",
5
5
  "license": "ISC",
6
6
  "description": "Lumia UI Kit",