@lumiastream/ui 0.5.4 → 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/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,
@@ -1050,25 +1054,41 @@ function mapText(widget, ctx) {
1050
1054
  ctx
1051
1055
  );
1052
1056
  }
1057
+ function seInnerAutoFit(widget, innerCss, mode) {
1058
+ const isInnerAutoWidth = innerCss?.width === "auto";
1059
+ const isInnerAutoHeight = innerCss?.height === "auto";
1060
+ if (mode === "width-drives-both") {
1061
+ if (!isInnerAutoWidth) return {};
1062
+ return { objectFit: "contain", autoWidth: true, autoHeight: true };
1063
+ }
1064
+ if (!isInnerAutoWidth && !isInnerAutoHeight) return {};
1065
+ const result = { objectFit: "contain" };
1066
+ if (isInnerAutoWidth && !isExplicitPxSize(widget.css?.width))
1067
+ result.autoWidth = true;
1068
+ if (isInnerAutoHeight && !isExplicitPxSize(widget.css?.height))
1069
+ result.autoHeight = true;
1070
+ return result;
1071
+ }
1072
+ function applySeAutoFitBounds(unit, fit) {
1073
+ const bounds = unit.layer.bounds;
1074
+ if (fit.autoWidth) bounds.autoWidth = true;
1075
+ if (fit.autoHeight) bounds.autoHeight = true;
1076
+ }
1053
1077
  function mapImage(widget, ctx) {
1078
+ const fit = seInnerAutoFit(widget, widget.image?.css, "inner-axis-gated");
1054
1079
  const unit = buildUnit(
1055
1080
  widget,
1056
1081
  "image",
1057
1082
  {
1058
1083
  content: {
1059
1084
  src: widget.image?.src ?? "",
1060
- loop: true
1085
+ loop: true,
1086
+ ...fit.objectFit ? { objectFit: fit.objectFit } : {}
1061
1087
  }
1062
1088
  },
1063
1089
  ctx
1064
1090
  );
1065
- const innerWidth = widget.image?.css?.width;
1066
- const innerHeight = widget.image?.css?.height;
1067
- const outerWidthExplicit = isExplicitPxSize(widget.css?.width);
1068
- const outerHeightExplicit = isExplicitPxSize(widget.css?.height);
1069
- const bounds = unit.layer.bounds;
1070
- if (innerWidth === "auto" && !outerWidthExplicit) bounds.autoWidth = true;
1071
- if (innerHeight === "auto" && !outerHeightExplicit) bounds.autoHeight = true;
1091
+ applySeAutoFitBounds(unit, fit);
1072
1092
  return unit;
1073
1093
  }
1074
1094
  function isExplicitPxSize(value) {
@@ -1082,8 +1102,7 @@ function isExplicitPxSize(value) {
1082
1102
  return Number.isFinite(parsed) && parsed > 0;
1083
1103
  }
1084
1104
  function mapVideo(widget, ctx) {
1085
- const innerWidth = widget.video?.css?.width;
1086
- const isInnerAutoWidth = innerWidth === "auto";
1105
+ const fit = seInnerAutoFit(widget, widget.video?.css, "width-drives-both");
1087
1106
  const unit = buildUnit(
1088
1107
  widget,
1089
1108
  "video",
@@ -1092,19 +1111,13 @@ function mapVideo(widget, ctx) {
1092
1111
  src: widget.video?.src ?? "",
1093
1112
  volume: widget.video?.volume ?? 0.5,
1094
1113
  loop: true,
1095
- muted: false,
1096
- ...isInnerAutoWidth ? { objectFit: "contain" } : {}
1114
+ muted: false
1097
1115
  }
1098
1116
  },
1099
1117
  ctx
1100
1118
  );
1101
- const bounds = unit.layer.bounds;
1102
- if (isInnerAutoWidth) {
1103
- bounds.autoWidth = true;
1104
- bounds.autoHeight = true;
1105
- } else {
1106
- bounds.autoHeight = true;
1107
- }
1119
+ applySeAutoFitBounds(unit, fit);
1120
+ unit.layer.bounds.autoHeight = true;
1108
1121
  return unit;
1109
1122
  }
1110
1123
  var LUMIA_SNOW_WEBM = "https://storage.lumiastream.com/overlays/global/seasonal/snow.webm";
@@ -1135,11 +1148,16 @@ function mapReadout(widget, fallbackVar, ctx) {
1135
1148
  context: "static"
1136
1149
  }) : `{{${variable}}}`;
1137
1150
  const seCss = widget.text?.css ?? {};
1151
+ const marqueeSpeed = seMarqueeSpeedPxPerSec(widget.text?.scrolling);
1138
1152
  return buildUnit(
1139
1153
  widget,
1140
1154
  "text",
1141
1155
  {
1142
- content: { value, highlightColor: "inherit" },
1156
+ content: {
1157
+ value,
1158
+ highlightColor: "inherit",
1159
+ ...marqueeSpeed != null ? { marqueeSpeed } : {}
1160
+ },
1143
1161
  css: {
1144
1162
  fontSize: seCss["font-size"] ?? 28,
1145
1163
  textAlign: seCss["text-align"] ?? "center",
@@ -2303,7 +2321,11 @@ function mapEventList(widget, ctx) {
2303
2321
  ...isMarquee ? { marqueeItemGap: 24 } : {},
2304
2322
  showAlertIcon: !isMarquee,
2305
2323
  showSiteIcon: !isMarquee,
2306
- showUserAvatar: true,
2324
+ // SE event lists are text-only (`{name}: {amount}` rows for tip-recent,
2325
+ // follower-recent, etc.) — no avatar column. Mirror that on import so
2326
+ // the streamer's layout matches what they had in SE; they can re-enable
2327
+ // avatars from the Eventlist settings panel if they want.
2328
+ showUserAvatar: false,
2307
2329
  showDetailedText: false,
2308
2330
  hideAlertMessage: false
2309
2331
  }
@@ -4502,9 +4524,6 @@ var LSInput = forwardRef(
4502
4524
  inputAfterText,
4503
4525
  maxWidth,
4504
4526
  className = "",
4505
- InputProps: inputPropsProp,
4506
- InputLabelProps: inputLabelPropsProp,
4507
- inputProps: htmlInputPropsProp,
4508
4527
  slotProps: slotPropsProp,
4509
4528
  onChange,
4510
4529
  onChangeStart,
@@ -4539,25 +4558,11 @@ var LSInput = forwardRef(
4539
4558
  onChange?.(event, sanitizedValue);
4540
4559
  onChangeEnd?.(event, sanitizedValue);
4541
4560
  };
4542
- const resolvedStartAdornment = inputPropsProp?.startAdornment ?? (startAdornment ? /* @__PURE__ */ jsx2(InputAdornment, { position: "start", children: startAdornment }) : inputBeforeText ? /* @__PURE__ */ jsx2(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx2("span", { className: "mui-ls-input-affix", children: inputBeforeText }) }) : void 0);
4543
- const resolvedEndAdornment = inputPropsProp?.endAdornment ?? (endAdornment ? /* @__PURE__ */ jsx2(InputAdornment, { position: "end", children: endAdornment }) : inputAfterText ? /* @__PURE__ */ jsx2(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx2("span", { className: "mui-ls-input-affix", children: inputAfterText }) }) : void 0);
4544
- const inputSlotProps = {
4545
- ...inputPropsProp,
4546
- startAdornment: resolvedStartAdornment,
4547
- endAdornment: resolvedEndAdornment,
4548
- readOnly: rest.readOnly ?? inputPropsProp?.readOnly,
4549
- sx: {
4550
- ...inputPropsProp?.sx ?? {},
4551
- "& input, & textarea": {
4552
- textAlign: centerText ? "center" : void 0,
4553
- color: textColor ?? void 0
4554
- }
4555
- }
4556
- };
4557
- const inputLabelProps = {
4558
- shrink: true,
4559
- ...inputLabelPropsProp
4560
- };
4561
+ const callerInputSlot = slotPropsProp?.input ?? {};
4562
+ const callerHtmlInputSlot = slotPropsProp?.htmlInput ?? {};
4563
+ const callerInputLabelSlot = slotPropsProp?.inputLabel ?? {};
4564
+ const resolvedStartAdornment = callerInputSlot.startAdornment ?? (startAdornment ? /* @__PURE__ */ jsx2(InputAdornment, { position: "start", children: startAdornment }) : inputBeforeText ? /* @__PURE__ */ jsx2(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx2("span", { className: "mui-ls-input-affix", children: inputBeforeText }) }) : void 0);
4565
+ const resolvedEndAdornment = callerInputSlot.endAdornment ?? (endAdornment ? /* @__PURE__ */ jsx2(InputAdornment, { position: "end", children: endAdornment }) : inputAfterText ? /* @__PURE__ */ jsx2(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx2("span", { className: "mui-ls-input-affix", children: inputAfterText }) }) : void 0);
4561
4566
  const helperContent = helperText ?? (typeof error === "string" ? error : "");
4562
4567
  const hasError = typeof error === "string" ? true : Boolean(error);
4563
4568
  const resolvedMaxWidth = maxWidth ?? style?.maxWidth;
@@ -4565,20 +4570,24 @@ var LSInput = forwardRef(
4565
4570
  const slotProps = {
4566
4571
  ...slotPropsProp ?? {},
4567
4572
  input: {
4568
- ...slotPropsProp?.input ?? {},
4569
- ...inputSlotProps,
4573
+ ...callerInputSlot,
4574
+ startAdornment: resolvedStartAdornment,
4575
+ endAdornment: resolvedEndAdornment,
4576
+ readOnly: rest.readOnly ?? callerInputSlot.readOnly,
4570
4577
  sx: {
4571
- ...slotPropsProp?.input?.sx ?? {},
4572
- ...inputSlotProps.sx
4578
+ ...callerInputSlot.sx ?? {},
4579
+ "& input, & textarea": {
4580
+ textAlign: centerText ? "center" : void 0,
4581
+ color: textColor ?? void 0
4582
+ }
4573
4583
  }
4574
4584
  },
4575
4585
  inputLabel: {
4576
- ...slotPropsProp?.inputLabel ?? {},
4577
- ...inputLabelProps
4586
+ shrink: true,
4587
+ ...callerInputLabelSlot
4578
4588
  },
4579
4589
  htmlInput: {
4580
- ...slotPropsProp?.htmlInput ?? {},
4581
- ...htmlInputPropsProp ?? {}
4590
+ ...callerHtmlInputSlot
4582
4591
  }
4583
4592
  };
4584
4593
  const TextFieldComponent = TextField;
@@ -4768,15 +4777,15 @@ var LSSliderInput = ({
4768
4777
  onChange: (_event, nextValue) => handleInputChange({ target: { value: nextValue ?? "" } }),
4769
4778
  value: displayValue ?? "",
4770
4779
  inputAfterText,
4771
- InputProps: {
4772
- ...inputProps?.InputProps ?? {},
4773
- name,
4774
- type: "number",
4775
- value: displayValue,
4776
- min: displayMinimum,
4777
- max: displayMaximum,
4778
- step: displayStep,
4779
- inputMode: stepPrecision > 0 ? "decimal" : "numeric"
4780
+ slotProps: {
4781
+ ...inputProps?.slotProps ?? {},
4782
+ htmlInput: {
4783
+ ...inputProps?.slotProps?.htmlInput ?? {},
4784
+ min: displayMinimum,
4785
+ max: displayMaximum,
4786
+ step: displayStep,
4787
+ inputMode: stepPrecision > 0 ? "decimal" : "numeric"
4788
+ }
4780
4789
  },
4781
4790
  fullWidth: hideSlider ? fullWidth : false,
4782
4791
  $noMinHeight: false,
@@ -4840,6 +4849,16 @@ var LSSelect = ({
4840
4849
  border: "1px solid var(--neutralDark4)",
4841
4850
  borderRadius: "var(--radius, 1rem)",
4842
4851
  boxShadow: "0 16px 32px rgba(0, 0, 0, 0.32)",
4852
+ "& .MuiList-root": {
4853
+ backgroundColor: "var(--neutralDark2)"
4854
+ },
4855
+ "& .MuiListSubheader-root": {
4856
+ backgroundColor: "var(--neutralDark1)",
4857
+ color: "var(--neutralLight2)"
4858
+ },
4859
+ "& .MuiMenuItem-root": {
4860
+ color: "var(--neutralLight1)"
4861
+ },
4843
4862
  ...MenuProps?.slotProps?.paper?.sx
4844
4863
  }
4845
4864
  },
@@ -4851,28 +4870,6 @@ var LSSelect = ({
4851
4870
  ...MenuProps?.slotProps?.list?.sx
4852
4871
  }
4853
4872
  }
4854
- },
4855
- PaperProps: {
4856
- ...MenuProps?.PaperProps ?? {},
4857
- sx: {
4858
- background: "var(--neutralDark2) !important",
4859
- backgroundColor: "var(--neutralDark2)",
4860
- color: "var(--neutralLight1)",
4861
- border: "1px solid var(--neutralDark4)",
4862
- borderRadius: "var(--radius, 1rem)",
4863
- boxShadow: "0 16px 32px rgba(0, 0, 0, 0.32)",
4864
- "& .MuiList-root": {
4865
- backgroundColor: "var(--neutralDark2)"
4866
- },
4867
- "& .MuiListSubheader-root": {
4868
- backgroundColor: "var(--neutralDark1)",
4869
- color: "var(--neutralLight2)"
4870
- },
4871
- "& .MuiMenuItem-root": {
4872
- color: "var(--neutralLight1)"
4873
- },
4874
- ...MenuProps?.PaperProps?.sx
4875
- }
4876
4873
  }
4877
4874
  };
4878
4875
  return /* @__PURE__ */ jsxs2(
@@ -4985,14 +4982,7 @@ LSDatePicker.displayName = "LSDatePicker";
4985
4982
  import { KeyboardArrowDown } from "@mui/icons-material";
4986
4983
  import Autocomplete from "@mui/material/Autocomplete";
4987
4984
  import TextField2 from "@mui/material/TextField";
4988
- import {
4989
- memo,
4990
- startTransition,
4991
- useEffect as useEffect3,
4992
- useMemo as useMemo2,
4993
- useRef as useRef2,
4994
- useState as useState3
4995
- } from "react";
4985
+ import { memo, startTransition, useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2, useState as useState3 } from "react";
4996
4986
  import { jsx as jsx8 } from "react/jsx-runtime";
4997
4987
  var LSFontPicker = memo(function LSFontPicker2({
4998
4988
  value,
@@ -5050,9 +5040,7 @@ var LSFontPicker = memo(function LSFontPicker2({
5050
5040
  popupIcon: /* @__PURE__ */ jsx8(KeyboardArrowDown, {}),
5051
5041
  isOptionEqualToValue: (option, selectedValue) => option === selectedValue,
5052
5042
  onChange: (_event, newValue) => {
5053
- handleValueChange(
5054
- typeof newValue === "string" ? newValue : `${newValue ?? ""}`
5055
- );
5043
+ handleValueChange(typeof newValue === "string" ? newValue : `${newValue ?? ""}`);
5056
5044
  },
5057
5045
  onInputChange: (_event, newInputValue, reason) => {
5058
5046
  if (reason === "input" || reason === "clear") {
@@ -5109,11 +5097,7 @@ var LSFontPicker = memo(function LSFontPicker2({
5109
5097
  );
5110
5098
  },
5111
5099
  renderInput: (params) => {
5112
- const {
5113
- InputLabelProps: paramsInputLabelProps,
5114
- InputProps: paramsInputProps,
5115
- ...restParams
5116
- } = params;
5100
+ const { slotProps: paramsSlotProps = {}, ...restParams } = params;
5117
5101
  return /* @__PURE__ */ jsx8(
5118
5102
  TextFieldComponent,
5119
5103
  {
@@ -5130,12 +5114,16 @@ var LSFontPicker = memo(function LSFontPicker2({
5130
5114
  }
5131
5115
  },
5132
5116
  slotProps: {
5117
+ ...paramsSlotProps,
5133
5118
  inputLabel: {
5134
- shrink: true,
5135
- ...paramsInputLabelProps ?? {}
5119
+ ...paramsSlotProps.inputLabel ?? {},
5120
+ shrink: true
5136
5121
  },
5137
5122
  input: {
5138
- ...paramsInputProps ?? {}
5123
+ ...paramsSlotProps.input ?? {}
5124
+ },
5125
+ htmlInput: {
5126
+ ...paramsSlotProps.htmlInput ?? {}
5139
5127
  }
5140
5128
  }
5141
5129
  }
@@ -5179,7 +5167,8 @@ import { forwardRef as forwardRef4 } from "react";
5179
5167
  import { jsx as jsx11 } from "react/jsx-runtime";
5180
5168
  var LSTextField = forwardRef4(
5181
5169
  (props, ref) => {
5182
- const { InputLabelProps, InputProps, slotProps, ...rest } = props;
5170
+ const { slotProps, ...rest } = props;
5171
+ const paramsInputLabel = slotProps?.inputLabel ?? {};
5183
5172
  return /* @__PURE__ */ jsx11(
5184
5173
  TextField3,
5185
5174
  {
@@ -5188,18 +5177,9 @@ var LSTextField = forwardRef4(
5188
5177
  className: "mui-ls-input",
5189
5178
  slotProps: {
5190
5179
  ...slotProps ?? {},
5191
- input: {
5192
- ...slotProps?.input ?? {},
5193
- ...InputProps ?? {},
5194
- sx: {
5195
- ...slotProps?.input?.sx ?? {},
5196
- ...InputProps?.sx ?? {}
5197
- }
5198
- },
5199
5180
  inputLabel: {
5200
- ...slotProps?.inputLabel ?? {},
5201
- shrink: true,
5202
- ...InputLabelProps ?? {}
5181
+ ...paramsInputLabel,
5182
+ shrink: true
5203
5183
  }
5204
5184
  },
5205
5185
  ref
@@ -6352,14 +6332,12 @@ var VariableInputTextField = forwardRef5(
6352
6332
  containerRef,
6353
6333
  showVariableIcon
6354
6334
  }, ref) => {
6355
- const inputPropsInputProps = inputProps?.InputProps ?? {};
6356
- const paramsInputProps = params?.InputProps ?? {};
6357
- const inputPropsSlotInputProps = inputProps?.slotProps?.input ?? {};
6358
- const paramsSlotInputProps = params?.slotProps?.input ?? {};
6335
+ const inputPropsSlotInput = inputProps?.slotProps?.input ?? {};
6336
+ const paramsSlotInput = params?.slotProps?.input ?? {};
6359
6337
  const explicitStartAdornment = inputProps?.startAdornment;
6360
6338
  const resolvedExplicitStartAdornment = explicitStartAdornment ? /* @__PURE__ */ jsx12(InputAdornment2, { position: "start", children: explicitStartAdornment }) : void 0;
6361
- const startAdornment = paramsInputProps.startAdornment ?? paramsSlotInputProps.startAdornment ?? inputPropsInputProps.startAdornment ?? inputPropsSlotInputProps.startAdornment ?? resolvedExplicitStartAdornment;
6362
- const endAdornment = paramsInputProps.endAdornment ?? paramsSlotInputProps.endAdornment ?? inputPropsInputProps.endAdornment ?? inputPropsSlotInputProps.endAdornment;
6339
+ const startAdornment = paramsSlotInput.startAdornment ?? inputPropsSlotInput.startAdornment ?? resolvedExplicitStartAdornment;
6340
+ const endAdornment = paramsSlotInput.endAdornment ?? inputPropsSlotInput.endAdornment;
6363
6341
  return /* @__PURE__ */ jsx12(
6364
6342
  LSTextField,
6365
6343
  {
@@ -6381,31 +6359,27 @@ var VariableInputTextField = forwardRef5(
6381
6359
  onChange: onChange ? (e) => onChange(e.target.value) : void 0,
6382
6360
  ...inputProps,
6383
6361
  ...params,
6384
- InputProps: {
6385
- ...inputPropsSlotInputProps,
6386
- ...inputPropsInputProps,
6387
- ...paramsSlotInputProps,
6388
- ...paramsInputProps,
6389
- startAdornment,
6390
- endAdornment: /* @__PURE__ */ jsxs5(Fragment3, { children: [
6391
- endAdornment ?? null,
6392
- showVariableIcon ? /* @__PURE__ */ jsx12(
6393
- Tooltip,
6394
- {
6395
- title: t("chatbot.allowed-variables", "Allowed Variables"),
6396
- children: /* @__PURE__ */ jsx12(
6397
- InputAdornment2,
6398
- {
6399
- position: "end",
6400
- onClick: clickedVariableIcon,
6401
- ref: containerRef,
6402
- className: "ls-variable-input-adornment",
6403
- children: "{}"
6404
- }
6405
- )
6406
- }
6407
- ) : null
6408
- ] })
6362
+ slotProps: {
6363
+ ...inputProps?.slotProps ?? {},
6364
+ ...params?.slotProps ?? {},
6365
+ input: {
6366
+ ...inputPropsSlotInput,
6367
+ ...paramsSlotInput,
6368
+ startAdornment,
6369
+ endAdornment: /* @__PURE__ */ jsxs5(Fragment3, { children: [
6370
+ endAdornment ?? null,
6371
+ showVariableIcon ? /* @__PURE__ */ jsx12(Tooltip, { title: t("chatbot.allowed-variables", "Allowed Variables"), children: /* @__PURE__ */ jsx12(
6372
+ InputAdornment2,
6373
+ {
6374
+ position: "end",
6375
+ onClick: clickedVariableIcon,
6376
+ ref: containerRef,
6377
+ className: "ls-variable-input-adornment",
6378
+ children: "{}"
6379
+ }
6380
+ ) }) : null
6381
+ ] })
6382
+ }
6409
6383
  },
6410
6384
  inputRef: ref
6411
6385
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/ui",
3
- "version": "0.5.4",
3
+ "version": "0.5.6",
4
4
  "author": "Lumia Stream",
5
5
  "license": "ISC",
6
6
  "description": "Lumia UI Kit",