@lumiastream/ui 0.6.4 → 0.6.6-beta.1

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
@@ -5759,6 +5759,11 @@ function mapTrain(widget, ctx) {
5759
5759
  { width: 540, height: 60 }
5760
5760
  );
5761
5761
  }
5762
+ function seTimerWantsContainerScaling(widget) {
5763
+ const fontSize = widget.text?.css?.["font-size"];
5764
+ if (typeof fontSize !== "string") return false;
5765
+ return /\d\s*(vw|vh|vmin|vmax|cqw|cqh|cqi|cqb)\s*$/i.test(fontSize.trim());
5766
+ }
5762
5767
  function mapTimer(widget, ctx) {
5763
5768
  const v = widget.variables ?? {};
5764
5769
  const textValue = typeof widget.text?.value === "string" ? widget.text.value : void 0;
@@ -5828,13 +5833,7 @@ function mapTimer(widget, ctx) {
5828
5833
  widget,
5829
5834
  "timer",
5830
5835
  {
5831
- // Carry the streamer's SE text styling (font/size/color/shadow) so an
5832
- // imported countdown doesn't render in Lumia's default Roboto/24px.
5833
- // scaleWithContainer: SE renders the countdown at the literal font-size and lets
5834
- // `widget { overflow:hidden }` clip the overflow (visually masked by the canvas-level
5835
- // transform). Lumia has no equivalent clip on the layer, so a 150px font in a 162px
5836
- // box overflows visibly. Opt the imported timer into Lumia's container-query auto-fit.
5837
- css: { ...mapSeTextCssToModuleCss(widget), scaleWithContainer: true },
5836
+ css: { ...mapSeTextCssToModuleCss(widget), ...seTimerWantsContainerScaling(widget) ? { scaleWithContainer: "true" } : {} },
5838
5837
  content: {
5839
5838
  version: 1,
5840
5839
  type: "countdown",
package/dist/se-import.js CHANGED
@@ -2679,6 +2679,11 @@ function mapTrain(widget, ctx) {
2679
2679
  { width: 540, height: 60 }
2680
2680
  );
2681
2681
  }
2682
+ function seTimerWantsContainerScaling(widget) {
2683
+ const fontSize = widget.text?.css?.["font-size"];
2684
+ if (typeof fontSize !== "string") return false;
2685
+ return /\d\s*(vw|vh|vmin|vmax|cqw|cqh|cqi|cqb)\s*$/i.test(fontSize.trim());
2686
+ }
2682
2687
  function mapTimer(widget, ctx) {
2683
2688
  const v = widget.variables ?? {};
2684
2689
  const textValue = typeof widget.text?.value === "string" ? widget.text.value : void 0;
@@ -2748,13 +2753,7 @@ function mapTimer(widget, ctx) {
2748
2753
  widget,
2749
2754
  "timer",
2750
2755
  {
2751
- // Carry the streamer's SE text styling (font/size/color/shadow) so an
2752
- // imported countdown doesn't render in Lumia's default Roboto/24px.
2753
- // scaleWithContainer: SE renders the countdown at the literal font-size and lets
2754
- // `widget { overflow:hidden }` clip the overflow (visually masked by the canvas-level
2755
- // transform). Lumia has no equivalent clip on the layer, so a 150px font in a 162px
2756
- // box overflows visibly. Opt the imported timer into Lumia's container-query auto-fit.
2757
- css: { ...mapSeTextCssToModuleCss(widget), scaleWithContainer: true },
2756
+ css: { ...mapSeTextCssToModuleCss(widget), ...seTimerWantsContainerScaling(widget) ? { scaleWithContainer: "true" } : {} },
2758
2757
  content: {
2759
2758
  version: 1,
2760
2759
  type: "countdown",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/ui",
3
- "version": "0.6.4",
3
+ "version": "0.6.6-beta.1",
4
4
  "author": "Lumia Stream",
5
5
  "license": "ISC",
6
6
  "description": "Lumia UI Kit",