@lumiastream/ui 0.2.8-alpha.28 → 0.2.8-alpha.29

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
@@ -3597,9 +3597,10 @@ function mapSeTextCssToModuleCss(widget, defaults = {}) {
3597
3597
  background: defaults.background ?? "transparent"
3598
3598
  };
3599
3599
  }
3600
- function buildUnit(widget, lumiaType, moduleExtras, ctx) {
3600
+ var READOUT_AUTO_FALLBACK_SIZE = { width: 400, height: 50 };
3601
+ function buildUnit(widget, lumiaType, moduleExtras, ctx, sizeOverride) {
3601
3602
  const id = nanoid();
3602
- const defaults = LUMIA_DEFAULT_SIZES[lumiaType] ?? { width: 400, height: 400 };
3603
+ const defaults = sizeOverride ?? LUMIA_DEFAULT_SIZES[lumiaType] ?? { width: 400, height: 400 };
3603
3604
  const bounds = seCssToBounds(widget.css, defaults, ctx?.canvas);
3604
3605
  const layer = {
3605
3606
  id,
@@ -3712,20 +3713,30 @@ function mapReadout(widget, fallbackVar, ctx) {
3712
3713
  const inheritsText = userTemplate.trim().length > 0 && /\{[a-zA-Z]/.test(userTemplate);
3713
3714
  const value = inheritsText ? translateSeText(userTemplate, listener, void 0, ctx?.provider, { context: "static" }) : `{{${variable}}}`;
3714
3715
  const seCss = widget.text?.css ?? {};
3715
- return buildUnit(widget, "text", {
3716
- content: { value, highlightColor: "inherit" },
3717
- css: {
3718
- fontSize: seCss["font-size"] ?? 28,
3719
- textAlign: seCss["text-align"] ?? "center",
3720
- fontFamily: seCss["font-family"] ?? "Roboto",
3721
- fontWeight: seCss["font-weight"] ?? "bold",
3722
- color: seCss["color"] ?? "#ffffff",
3723
- textShadow: seCss["text-shadow"] ?? "rgb(0, 0, 0) 1px 1px 1px",
3724
- lineHeight: seCss["line-height"] ?? 1,
3725
- background: "transparent",
3726
- ...seExtraTextCss(seCss, widget.text?.scrolling)
3727
- }
3728
- }, ctx);
3716
+ return buildUnit(
3717
+ widget,
3718
+ "text",
3719
+ {
3720
+ content: { value, highlightColor: "inherit" },
3721
+ css: {
3722
+ fontSize: seCss["font-size"] ?? 28,
3723
+ textAlign: seCss["text-align"] ?? "center",
3724
+ fontFamily: seCss["font-family"] ?? "Roboto",
3725
+ fontWeight: seCss["font-weight"] ?? "bold",
3726
+ color: seCss["color"] ?? "#ffffff",
3727
+ textShadow: seCss["text-shadow"] ?? "rgb(0, 0, 0) 1px 1px 1px",
3728
+ lineHeight: seCss["line-height"] ?? 1,
3729
+ background: "transparent",
3730
+ ...seExtraTextCss(seCss, widget.text?.scrolling)
3731
+ }
3732
+ },
3733
+ ctx,
3734
+ // SE readouts ship `width:auto; height:auto`. Override the generic
3735
+ // `text` 600×200 fallback with a single-line-friendly size so the
3736
+ // imported layer doesn't render as a half-canvas rectangle when the
3737
+ // rendered content is one line of 24px text.
3738
+ READOUT_AUTO_FALLBACK_SIZE
3739
+ );
3729
3740
  }
3730
3741
 
3731
3742
  // src/se-import/mappers/provider-alerts.ts
package/dist/se-import.js CHANGED
@@ -482,9 +482,10 @@ function mapSeTextCssToModuleCss(widget, defaults = {}) {
482
482
  background: defaults.background ?? "transparent"
483
483
  };
484
484
  }
485
- function buildUnit(widget, lumiaType, moduleExtras, ctx) {
485
+ var READOUT_AUTO_FALLBACK_SIZE = { width: 400, height: 50 };
486
+ function buildUnit(widget, lumiaType, moduleExtras, ctx, sizeOverride) {
486
487
  const id = nanoid();
487
- const defaults = LUMIA_DEFAULT_SIZES[lumiaType] ?? { width: 400, height: 400 };
488
+ const defaults = sizeOverride ?? LUMIA_DEFAULT_SIZES[lumiaType] ?? { width: 400, height: 400 };
488
489
  const bounds = seCssToBounds(widget.css, defaults, ctx?.canvas);
489
490
  const layer = {
490
491
  id,
@@ -597,20 +598,30 @@ function mapReadout(widget, fallbackVar, ctx) {
597
598
  const inheritsText = userTemplate.trim().length > 0 && /\{[a-zA-Z]/.test(userTemplate);
598
599
  const value = inheritsText ? translateSeText(userTemplate, listener, void 0, ctx?.provider, { context: "static" }) : `{{${variable}}}`;
599
600
  const seCss = widget.text?.css ?? {};
600
- return buildUnit(widget, "text", {
601
- content: { value, highlightColor: "inherit" },
602
- css: {
603
- fontSize: seCss["font-size"] ?? 28,
604
- textAlign: seCss["text-align"] ?? "center",
605
- fontFamily: seCss["font-family"] ?? "Roboto",
606
- fontWeight: seCss["font-weight"] ?? "bold",
607
- color: seCss["color"] ?? "#ffffff",
608
- textShadow: seCss["text-shadow"] ?? "rgb(0, 0, 0) 1px 1px 1px",
609
- lineHeight: seCss["line-height"] ?? 1,
610
- background: "transparent",
611
- ...seExtraTextCss(seCss, widget.text?.scrolling)
612
- }
613
- }, ctx);
601
+ return buildUnit(
602
+ widget,
603
+ "text",
604
+ {
605
+ content: { value, highlightColor: "inherit" },
606
+ css: {
607
+ fontSize: seCss["font-size"] ?? 28,
608
+ textAlign: seCss["text-align"] ?? "center",
609
+ fontFamily: seCss["font-family"] ?? "Roboto",
610
+ fontWeight: seCss["font-weight"] ?? "bold",
611
+ color: seCss["color"] ?? "#ffffff",
612
+ textShadow: seCss["text-shadow"] ?? "rgb(0, 0, 0) 1px 1px 1px",
613
+ lineHeight: seCss["line-height"] ?? 1,
614
+ background: "transparent",
615
+ ...seExtraTextCss(seCss, widget.text?.scrolling)
616
+ }
617
+ },
618
+ ctx,
619
+ // SE readouts ship `width:auto; height:auto`. Override the generic
620
+ // `text` 600×200 fallback with a single-line-friendly size so the
621
+ // imported layer doesn't render as a half-canvas rectangle when the
622
+ // rendered content is one line of 24px text.
623
+ READOUT_AUTO_FALLBACK_SIZE
624
+ );
614
625
  }
615
626
 
616
627
  // src/se-import/mappers/provider-alerts.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/ui",
3
- "version": "0.2.8-alpha.28",
3
+ "version": "0.2.8-alpha.29",
4
4
  "author": "Lumia Stream",
5
5
  "license": "ISC",
6
6
  "description": "Lumia UI Kit",