@lumiastream/ui 0.5.5 → 0.5.6

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
@@ -4091,13 +4091,15 @@ function seExtraTextCss(seCss, scrolling) {
4091
4091
  extra.WebkitTextStrokeWidth = seCss["-webkit-text-stroke-width"];
4092
4092
  if (seCss["letter-spacing"] != null) extra.letterSpacing = seCss["letter-spacing"];
4093
4093
  if (seCss["word-spacing"] != null) extra.wordSpacing = seCss["word-spacing"];
4094
- if (scrolling?.enabled) {
4095
- extra.scroll = true;
4096
- const speed = Number(scrolling.speed);
4097
- if (Number.isFinite(speed) && speed > 0) extra.scrollSpeed = speed * 600;
4098
- }
4094
+ if (scrolling?.enabled) extra.scroll = true;
4099
4095
  return extra;
4100
4096
  }
4097
+ function seMarqueeSpeedPxPerSec(scrolling) {
4098
+ if (!scrolling?.enabled) return void 0;
4099
+ const speed = Number(scrolling.speed);
4100
+ if (!Number.isFinite(speed) || speed <= 0) return void 0;
4101
+ return speed * 12;
4102
+ }
4101
4103
  function mapText(widget, ctx) {
4102
4104
  const value = translateSeText(
4103
4105
  widget.text?.value ?? "",
@@ -4107,13 +4109,15 @@ function mapText(widget, ctx) {
4107
4109
  { context: "static" }
4108
4110
  );
4109
4111
  const seCss = widget.text?.css ?? {};
4112
+ const marqueeSpeed = seMarqueeSpeedPxPerSec(widget.text?.scrolling);
4110
4113
  return buildUnit(
4111
4114
  widget,
4112
4115
  "text",
4113
4116
  {
4114
4117
  content: {
4115
4118
  value,
4116
- highlightColor: "inherit"
4119
+ highlightColor: "inherit",
4120
+ ...marqueeSpeed != null ? { marqueeSpeed } : {}
4117
4121
  },
4118
4122
  css: {
4119
4123
  fontSize: seCss["font-size"] ?? 24,
@@ -4224,11 +4228,16 @@ function mapReadout(widget, fallbackVar, ctx) {
4224
4228
  context: "static"
4225
4229
  }) : `{{${variable}}}`;
4226
4230
  const seCss = widget.text?.css ?? {};
4231
+ const marqueeSpeed = seMarqueeSpeedPxPerSec(widget.text?.scrolling);
4227
4232
  return buildUnit(
4228
4233
  widget,
4229
4234
  "text",
4230
4235
  {
4231
- content: { value, highlightColor: "inherit" },
4236
+ content: {
4237
+ value,
4238
+ highlightColor: "inherit",
4239
+ ...marqueeSpeed != null ? { marqueeSpeed } : {}
4240
+ },
4232
4241
  css: {
4233
4242
  fontSize: seCss["font-size"] ?? 28,
4234
4243
  textAlign: seCss["text-align"] ?? "center",
package/dist/se-import.js CHANGED
@@ -1011,13 +1011,15 @@ function seExtraTextCss(seCss, scrolling) {
1011
1011
  extra.WebkitTextStrokeWidth = seCss["-webkit-text-stroke-width"];
1012
1012
  if (seCss["letter-spacing"] != null) extra.letterSpacing = seCss["letter-spacing"];
1013
1013
  if (seCss["word-spacing"] != null) extra.wordSpacing = seCss["word-spacing"];
1014
- if (scrolling?.enabled) {
1015
- extra.scroll = true;
1016
- const speed = Number(scrolling.speed);
1017
- if (Number.isFinite(speed) && speed > 0) extra.scrollSpeed = speed * 600;
1018
- }
1014
+ if (scrolling?.enabled) extra.scroll = true;
1019
1015
  return extra;
1020
1016
  }
1017
+ function seMarqueeSpeedPxPerSec(scrolling) {
1018
+ if (!scrolling?.enabled) return void 0;
1019
+ const speed = Number(scrolling.speed);
1020
+ if (!Number.isFinite(speed) || speed <= 0) return void 0;
1021
+ return speed * 12;
1022
+ }
1021
1023
  function mapText(widget, ctx) {
1022
1024
  const value = translateSeText(
1023
1025
  widget.text?.value ?? "",
@@ -1027,13 +1029,15 @@ function mapText(widget, ctx) {
1027
1029
  { context: "static" }
1028
1030
  );
1029
1031
  const seCss = widget.text?.css ?? {};
1032
+ const marqueeSpeed = seMarqueeSpeedPxPerSec(widget.text?.scrolling);
1030
1033
  return buildUnit(
1031
1034
  widget,
1032
1035
  "text",
1033
1036
  {
1034
1037
  content: {
1035
1038
  value,
1036
- highlightColor: "inherit"
1039
+ highlightColor: "inherit",
1040
+ ...marqueeSpeed != null ? { marqueeSpeed } : {}
1037
1041
  },
1038
1042
  css: {
1039
1043
  fontSize: seCss["font-size"] ?? 24,
@@ -1144,11 +1148,16 @@ function mapReadout(widget, fallbackVar, ctx) {
1144
1148
  context: "static"
1145
1149
  }) : `{{${variable}}}`;
1146
1150
  const seCss = widget.text?.css ?? {};
1151
+ const marqueeSpeed = seMarqueeSpeedPxPerSec(widget.text?.scrolling);
1147
1152
  return buildUnit(
1148
1153
  widget,
1149
1154
  "text",
1150
1155
  {
1151
- content: { value, highlightColor: "inherit" },
1156
+ content: {
1157
+ value,
1158
+ highlightColor: "inherit",
1159
+ ...marqueeSpeed != null ? { marqueeSpeed } : {}
1160
+ },
1152
1161
  css: {
1153
1162
  fontSize: seCss["font-size"] ?? 28,
1154
1163
  textAlign: seCss["text-align"] ?? "center",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/ui",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "author": "Lumia Stream",
5
5
  "license": "ISC",
6
6
  "description": "Lumia UI Kit",