@lumiastream/ui 0.5.4 → 0.5.5

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
@@ -1050,25 +1050,41 @@ function mapText(widget, ctx) {
1050
1050
  ctx
1051
1051
  );
1052
1052
  }
1053
+ function seInnerAutoFit(widget, innerCss, mode) {
1054
+ const isInnerAutoWidth = innerCss?.width === "auto";
1055
+ const isInnerAutoHeight = innerCss?.height === "auto";
1056
+ if (mode === "width-drives-both") {
1057
+ if (!isInnerAutoWidth) return {};
1058
+ return { objectFit: "contain", autoWidth: true, autoHeight: true };
1059
+ }
1060
+ if (!isInnerAutoWidth && !isInnerAutoHeight) return {};
1061
+ const result = { objectFit: "contain" };
1062
+ if (isInnerAutoWidth && !isExplicitPxSize(widget.css?.width))
1063
+ result.autoWidth = true;
1064
+ if (isInnerAutoHeight && !isExplicitPxSize(widget.css?.height))
1065
+ result.autoHeight = true;
1066
+ return result;
1067
+ }
1068
+ function applySeAutoFitBounds(unit, fit) {
1069
+ const bounds = unit.layer.bounds;
1070
+ if (fit.autoWidth) bounds.autoWidth = true;
1071
+ if (fit.autoHeight) bounds.autoHeight = true;
1072
+ }
1053
1073
  function mapImage(widget, ctx) {
1074
+ const fit = seInnerAutoFit(widget, widget.image?.css, "inner-axis-gated");
1054
1075
  const unit = buildUnit(
1055
1076
  widget,
1056
1077
  "image",
1057
1078
  {
1058
1079
  content: {
1059
1080
  src: widget.image?.src ?? "",
1060
- loop: true
1081
+ loop: true,
1082
+ ...fit.objectFit ? { objectFit: fit.objectFit } : {}
1061
1083
  }
1062
1084
  },
1063
1085
  ctx
1064
1086
  );
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;
1087
+ applySeAutoFitBounds(unit, fit);
1072
1088
  return unit;
1073
1089
  }
1074
1090
  function isExplicitPxSize(value) {
@@ -1082,8 +1098,7 @@ function isExplicitPxSize(value) {
1082
1098
  return Number.isFinite(parsed) && parsed > 0;
1083
1099
  }
1084
1100
  function mapVideo(widget, ctx) {
1085
- const innerWidth = widget.video?.css?.width;
1086
- const isInnerAutoWidth = innerWidth === "auto";
1101
+ const fit = seInnerAutoFit(widget, widget.video?.css, "width-drives-both");
1087
1102
  const unit = buildUnit(
1088
1103
  widget,
1089
1104
  "video",
@@ -1092,19 +1107,13 @@ function mapVideo(widget, ctx) {
1092
1107
  src: widget.video?.src ?? "",
1093
1108
  volume: widget.video?.volume ?? 0.5,
1094
1109
  loop: true,
1095
- muted: false,
1096
- ...isInnerAutoWidth ? { objectFit: "contain" } : {}
1110
+ muted: false
1097
1111
  }
1098
1112
  },
1099
1113
  ctx
1100
1114
  );
1101
- const bounds = unit.layer.bounds;
1102
- if (isInnerAutoWidth) {
1103
- bounds.autoWidth = true;
1104
- bounds.autoHeight = true;
1105
- } else {
1106
- bounds.autoHeight = true;
1107
- }
1115
+ applySeAutoFitBounds(unit, fit);
1116
+ unit.layer.bounds.autoHeight = true;
1108
1117
  return unit;
1109
1118
  }
1110
1119
  var LUMIA_SNOW_WEBM = "https://storage.lumiastream.com/overlays/global/seasonal/snow.webm";
@@ -2303,7 +2312,11 @@ function mapEventList(widget, ctx) {
2303
2312
  ...isMarquee ? { marqueeItemGap: 24 } : {},
2304
2313
  showAlertIcon: !isMarquee,
2305
2314
  showSiteIcon: !isMarquee,
2306
- showUserAvatar: true,
2315
+ // SE event lists are text-only (`{name}: {amount}` rows for tip-recent,
2316
+ // follower-recent, etc.) — no avatar column. Mirror that on import so
2317
+ // the streamer's layout matches what they had in SE; they can re-enable
2318
+ // avatars from the Eventlist settings panel if they want.
2319
+ showUserAvatar: false,
2307
2320
  showDetailedText: false,
2308
2321
  hideAlertMessage: false
2309
2322
  }
@@ -4502,9 +4515,6 @@ var LSInput = forwardRef(
4502
4515
  inputAfterText,
4503
4516
  maxWidth,
4504
4517
  className = "",
4505
- InputProps: inputPropsProp,
4506
- InputLabelProps: inputLabelPropsProp,
4507
- inputProps: htmlInputPropsProp,
4508
4518
  slotProps: slotPropsProp,
4509
4519
  onChange,
4510
4520
  onChangeStart,
@@ -4539,25 +4549,11 @@ var LSInput = forwardRef(
4539
4549
  onChange?.(event, sanitizedValue);
4540
4550
  onChangeEnd?.(event, sanitizedValue);
4541
4551
  };
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
- };
4552
+ const callerInputSlot = slotPropsProp?.input ?? {};
4553
+ const callerHtmlInputSlot = slotPropsProp?.htmlInput ?? {};
4554
+ const callerInputLabelSlot = slotPropsProp?.inputLabel ?? {};
4555
+ 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);
4556
+ 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
4557
  const helperContent = helperText ?? (typeof error === "string" ? error : "");
4562
4558
  const hasError = typeof error === "string" ? true : Boolean(error);
4563
4559
  const resolvedMaxWidth = maxWidth ?? style?.maxWidth;
@@ -4565,20 +4561,24 @@ var LSInput = forwardRef(
4565
4561
  const slotProps = {
4566
4562
  ...slotPropsProp ?? {},
4567
4563
  input: {
4568
- ...slotPropsProp?.input ?? {},
4569
- ...inputSlotProps,
4564
+ ...callerInputSlot,
4565
+ startAdornment: resolvedStartAdornment,
4566
+ endAdornment: resolvedEndAdornment,
4567
+ readOnly: rest.readOnly ?? callerInputSlot.readOnly,
4570
4568
  sx: {
4571
- ...slotPropsProp?.input?.sx ?? {},
4572
- ...inputSlotProps.sx
4569
+ ...callerInputSlot.sx ?? {},
4570
+ "& input, & textarea": {
4571
+ textAlign: centerText ? "center" : void 0,
4572
+ color: textColor ?? void 0
4573
+ }
4573
4574
  }
4574
4575
  },
4575
4576
  inputLabel: {
4576
- ...slotPropsProp?.inputLabel ?? {},
4577
- ...inputLabelProps
4577
+ shrink: true,
4578
+ ...callerInputLabelSlot
4578
4579
  },
4579
4580
  htmlInput: {
4580
- ...slotPropsProp?.htmlInput ?? {},
4581
- ...htmlInputPropsProp ?? {}
4581
+ ...callerHtmlInputSlot
4582
4582
  }
4583
4583
  };
4584
4584
  const TextFieldComponent = TextField;
@@ -4768,15 +4768,15 @@ var LSSliderInput = ({
4768
4768
  onChange: (_event, nextValue) => handleInputChange({ target: { value: nextValue ?? "" } }),
4769
4769
  value: displayValue ?? "",
4770
4770
  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"
4771
+ slotProps: {
4772
+ ...inputProps?.slotProps ?? {},
4773
+ htmlInput: {
4774
+ ...inputProps?.slotProps?.htmlInput ?? {},
4775
+ min: displayMinimum,
4776
+ max: displayMaximum,
4777
+ step: displayStep,
4778
+ inputMode: stepPrecision > 0 ? "decimal" : "numeric"
4779
+ }
4780
4780
  },
4781
4781
  fullWidth: hideSlider ? fullWidth : false,
4782
4782
  $noMinHeight: false,
@@ -4840,6 +4840,16 @@ var LSSelect = ({
4840
4840
  border: "1px solid var(--neutralDark4)",
4841
4841
  borderRadius: "var(--radius, 1rem)",
4842
4842
  boxShadow: "0 16px 32px rgba(0, 0, 0, 0.32)",
4843
+ "& .MuiList-root": {
4844
+ backgroundColor: "var(--neutralDark2)"
4845
+ },
4846
+ "& .MuiListSubheader-root": {
4847
+ backgroundColor: "var(--neutralDark1)",
4848
+ color: "var(--neutralLight2)"
4849
+ },
4850
+ "& .MuiMenuItem-root": {
4851
+ color: "var(--neutralLight1)"
4852
+ },
4843
4853
  ...MenuProps?.slotProps?.paper?.sx
4844
4854
  }
4845
4855
  },
@@ -4851,28 +4861,6 @@ var LSSelect = ({
4851
4861
  ...MenuProps?.slotProps?.list?.sx
4852
4862
  }
4853
4863
  }
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
4864
  }
4877
4865
  };
4878
4866
  return /* @__PURE__ */ jsxs2(
@@ -4985,14 +4973,7 @@ LSDatePicker.displayName = "LSDatePicker";
4985
4973
  import { KeyboardArrowDown } from "@mui/icons-material";
4986
4974
  import Autocomplete from "@mui/material/Autocomplete";
4987
4975
  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";
4976
+ import { memo, startTransition, useEffect as useEffect3, useMemo as useMemo2, useRef as useRef2, useState as useState3 } from "react";
4996
4977
  import { jsx as jsx8 } from "react/jsx-runtime";
4997
4978
  var LSFontPicker = memo(function LSFontPicker2({
4998
4979
  value,
@@ -5050,9 +5031,7 @@ var LSFontPicker = memo(function LSFontPicker2({
5050
5031
  popupIcon: /* @__PURE__ */ jsx8(KeyboardArrowDown, {}),
5051
5032
  isOptionEqualToValue: (option, selectedValue) => option === selectedValue,
5052
5033
  onChange: (_event, newValue) => {
5053
- handleValueChange(
5054
- typeof newValue === "string" ? newValue : `${newValue ?? ""}`
5055
- );
5034
+ handleValueChange(typeof newValue === "string" ? newValue : `${newValue ?? ""}`);
5056
5035
  },
5057
5036
  onInputChange: (_event, newInputValue, reason) => {
5058
5037
  if (reason === "input" || reason === "clear") {
@@ -5109,11 +5088,7 @@ var LSFontPicker = memo(function LSFontPicker2({
5109
5088
  );
5110
5089
  },
5111
5090
  renderInput: (params) => {
5112
- const {
5113
- InputLabelProps: paramsInputLabelProps,
5114
- InputProps: paramsInputProps,
5115
- ...restParams
5116
- } = params;
5091
+ const { slotProps: paramsSlotProps = {}, ...restParams } = params;
5117
5092
  return /* @__PURE__ */ jsx8(
5118
5093
  TextFieldComponent,
5119
5094
  {
@@ -5130,12 +5105,16 @@ var LSFontPicker = memo(function LSFontPicker2({
5130
5105
  }
5131
5106
  },
5132
5107
  slotProps: {
5108
+ ...paramsSlotProps,
5133
5109
  inputLabel: {
5134
- shrink: true,
5135
- ...paramsInputLabelProps ?? {}
5110
+ ...paramsSlotProps.inputLabel ?? {},
5111
+ shrink: true
5136
5112
  },
5137
5113
  input: {
5138
- ...paramsInputProps ?? {}
5114
+ ...paramsSlotProps.input ?? {}
5115
+ },
5116
+ htmlInput: {
5117
+ ...paramsSlotProps.htmlInput ?? {}
5139
5118
  }
5140
5119
  }
5141
5120
  }
@@ -5179,7 +5158,8 @@ import { forwardRef as forwardRef4 } from "react";
5179
5158
  import { jsx as jsx11 } from "react/jsx-runtime";
5180
5159
  var LSTextField = forwardRef4(
5181
5160
  (props, ref) => {
5182
- const { InputLabelProps, InputProps, slotProps, ...rest } = props;
5161
+ const { slotProps, ...rest } = props;
5162
+ const paramsInputLabel = slotProps?.inputLabel ?? {};
5183
5163
  return /* @__PURE__ */ jsx11(
5184
5164
  TextField3,
5185
5165
  {
@@ -5188,18 +5168,9 @@ var LSTextField = forwardRef4(
5188
5168
  className: "mui-ls-input",
5189
5169
  slotProps: {
5190
5170
  ...slotProps ?? {},
5191
- input: {
5192
- ...slotProps?.input ?? {},
5193
- ...InputProps ?? {},
5194
- sx: {
5195
- ...slotProps?.input?.sx ?? {},
5196
- ...InputProps?.sx ?? {}
5197
- }
5198
- },
5199
5171
  inputLabel: {
5200
- ...slotProps?.inputLabel ?? {},
5201
- shrink: true,
5202
- ...InputLabelProps ?? {}
5172
+ ...paramsInputLabel,
5173
+ shrink: true
5203
5174
  }
5204
5175
  },
5205
5176
  ref
@@ -6352,14 +6323,12 @@ var VariableInputTextField = forwardRef5(
6352
6323
  containerRef,
6353
6324
  showVariableIcon
6354
6325
  }, ref) => {
6355
- const inputPropsInputProps = inputProps?.InputProps ?? {};
6356
- const paramsInputProps = params?.InputProps ?? {};
6357
- const inputPropsSlotInputProps = inputProps?.slotProps?.input ?? {};
6358
- const paramsSlotInputProps = params?.slotProps?.input ?? {};
6326
+ const inputPropsSlotInput = inputProps?.slotProps?.input ?? {};
6327
+ const paramsSlotInput = params?.slotProps?.input ?? {};
6359
6328
  const explicitStartAdornment = inputProps?.startAdornment;
6360
6329
  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;
6330
+ const startAdornment = paramsSlotInput.startAdornment ?? inputPropsSlotInput.startAdornment ?? resolvedExplicitStartAdornment;
6331
+ const endAdornment = paramsSlotInput.endAdornment ?? inputPropsSlotInput.endAdornment;
6363
6332
  return /* @__PURE__ */ jsx12(
6364
6333
  LSTextField,
6365
6334
  {
@@ -6381,31 +6350,27 @@ var VariableInputTextField = forwardRef5(
6381
6350
  onChange: onChange ? (e) => onChange(e.target.value) : void 0,
6382
6351
  ...inputProps,
6383
6352
  ...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
- ] })
6353
+ slotProps: {
6354
+ ...inputProps?.slotProps ?? {},
6355
+ ...params?.slotProps ?? {},
6356
+ input: {
6357
+ ...inputPropsSlotInput,
6358
+ ...paramsSlotInput,
6359
+ startAdornment,
6360
+ endAdornment: /* @__PURE__ */ jsxs5(Fragment3, { children: [
6361
+ endAdornment ?? null,
6362
+ showVariableIcon ? /* @__PURE__ */ jsx12(Tooltip, { title: t("chatbot.allowed-variables", "Allowed Variables"), children: /* @__PURE__ */ jsx12(
6363
+ InputAdornment2,
6364
+ {
6365
+ position: "end",
6366
+ onClick: clickedVariableIcon,
6367
+ ref: containerRef,
6368
+ className: "ls-variable-input-adornment",
6369
+ children: "{}"
6370
+ }
6371
+ ) }) : null
6372
+ ] })
6373
+ }
6409
6374
  },
6410
6375
  inputRef: ref
6411
6376
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/ui",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "author": "Lumia Stream",
5
5
  "license": "ISC",
6
6
  "description": "Lumia UI Kit",