@lumiastream/ui 0.3.1 → 0.3.3

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.
Files changed (3) hide show
  1. package/dist/index.js +238 -102
  2. package/dist/se-import.js +236 -100
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -4196,9 +4196,11 @@ function mapGoal(widget, ctx) {
4196
4196
  source: charity ? charity.source : sourceFromListener(listener),
4197
4197
  image: "",
4198
4198
  audio: { decrement: "", increment: "", goal: "", goalFailed: "", volume: 1 },
4199
- // `null` (rather than `''`) is the cleaner contract — Goal/index.tsx:11's
4200
- // `isGoalExpired` treats any falsy as not-expired so both work at render time,
4201
- // but `null` survives JSON round-trips without ambiguity ('' vs unset).
4199
+ // `null` (rather than `''`) is the cleaner contract — `formatEndsIn`
4200
+ // in Goal/index.tsx treats both as "no deadline" so both work at
4201
+ // render time, but `null` survives JSON round-trips without
4202
+ // ambiguity ('' vs unset). The Goal module no longer hides itself
4203
+ // when the date passes; the "Ends in…" sublabel just disappears.
4202
4204
  endDate: v.endDate ?? null,
4203
4205
  goalAnimation: "",
4204
4206
  goalAnimationLoop: true,
@@ -4570,31 +4572,7 @@ var SE_LISTENER_TO_LUMIA_CATEGORY = {
4570
4572
  "superchat-recent": "superchats",
4571
4573
  "hypetrain-latest": "hypetrain"
4572
4574
  };
4573
- var ALL_LUMIA_EVENTLIST_CATEGORIES = [
4574
- "redemption",
4575
- "follower",
4576
- "bits",
4577
- "kicks",
4578
- "extension",
4579
- "points",
4580
- "donation",
4581
- "subscribers",
4582
- "gifts",
4583
- "hosts",
4584
- "raids",
4585
- "hypetrain",
4586
- "spells",
4587
- "retweets",
4588
- "likes",
4589
- "purchases",
4590
- "superstickers",
4591
- "superchats",
4592
- "stars",
4593
- "fans",
4594
- "shares",
4595
- "raffles"
4596
- ];
4597
- function computeListenerFilters(seListeners, explicitListener) {
4575
+ function computeAllowedEventsFromSEListeners(seListeners, explicitListener) {
4598
4576
  const enabled = [];
4599
4577
  if (seListeners && typeof seListeners === "object" && !Array.isArray(seListeners)) {
4600
4578
  for (const [k, v] of Object.entries(
@@ -4608,14 +4586,21 @@ function computeListenerFilters(seListeners, explicitListener) {
4608
4586
  if (typeof explicitListener === "string" && explicitListener && !enabled.includes(explicitListener)) {
4609
4587
  enabled.push(explicitListener);
4610
4588
  }
4611
- if (enabled.length === 0) return [];
4612
- const allowed = /* @__PURE__ */ new Set();
4589
+ if (enabled.length === 0) return void 0;
4590
+ const allowedCategories = /* @__PURE__ */ new Set();
4613
4591
  for (const listener of enabled) {
4614
4592
  const category = SE_LISTENER_TO_LUMIA_CATEGORY[listener];
4615
- if (category) allowed.add(category);
4616
- }
4617
- if (allowed.size === 0) return [];
4618
- return ALL_LUMIA_EVENTLIST_CATEGORIES.filter((c) => !allowed.has(c));
4593
+ if (category) allowedCategories.add(category);
4594
+ }
4595
+ if (allowedCategories.size === 0) return [];
4596
+ const allowedAlerts = [];
4597
+ Object.keys(LumiaMapAlertTypeToEventListType).forEach((alertKey) => {
4598
+ const mappedCategory = LumiaMapAlertTypeToEventListType[alertKey];
4599
+ if (mappedCategory && allowedCategories.has(mappedCategory)) {
4600
+ allowedAlerts.push(alertKey);
4601
+ }
4602
+ });
4603
+ return allowedAlerts;
4619
4604
  }
4620
4605
  function seScrollSpeedToMarqueeDurationSec(seSpeed) {
4621
4606
  const n = typeof seSpeed === "number" && Number.isFinite(seSpeed) ? seSpeed : 6;
@@ -4629,7 +4614,10 @@ function seTemplateToMarqueeTemplate(seTemplate) {
4629
4614
  }
4630
4615
  function mapEventList(widget, ctx) {
4631
4616
  const v = widget.variables ?? {};
4632
- const filters = computeListenerFilters(widget.listeners, widget.listener);
4617
+ const allowedEvents = computeAllowedEventsFromSEListeners(
4618
+ widget.listeners,
4619
+ widget.listener
4620
+ );
4633
4621
  const maxItems = v.visibleEvents ?? v.visibleItems ?? 5;
4634
4622
  const seText = widget.text;
4635
4623
  const scrolling = seText?.scrolling;
@@ -4653,10 +4641,11 @@ function mapEventList(widget, ctx) {
4653
4641
  // legacy field name kept for back-compat
4654
4642
  themeBgOpacity: v.themeBgOpacity ?? 0,
4655
4643
  highlight: v.highlight,
4656
- // `filters` is a blacklist: every category here is HIDDEN. Empty = show all.
4657
- filters,
4658
- // `sites` is a platform blacklist (same shape). Default to "no platforms hidden".
4659
- sites: [],
4644
+ // `allowedEvents` alertbox-style whitelist of LumiaAlertValues
4645
+ // strings. Computed from SE's enabled listeners; `undefined` means
4646
+ // the importer didn't see any listener config and we defer to the
4647
+ // eventlist's default (show every mapped alert).
4648
+ ...allowedEvents !== void 0 ? { allowedEvents } : {},
4660
4649
  // Eventlist Manager assumes these objects exist; provide an empty stub so
4661
4650
  // imported overlays render without throwing. The marquee theme reads
4662
4651
  // `itemTemplate` off either currentThemeConfig or themeConfig — stash
@@ -5860,7 +5849,13 @@ var READOUT_TYPES = {
5860
5849
  // twitch_session_chat_count, so we render it as a text layer with the variable inline.
5861
5850
  "se-widget-botcounter": "twitch_session_chat_count"
5862
5851
  };
5863
- var SEASONAL_IMAGE_TYPES = /* @__PURE__ */ new Set(["se-widget-halloween", "se-widget-xmas", "se-widget-valentine", "se-widget-easter", "se-widget-world-cup"]);
5852
+ var SEASONAL_IMAGE_TYPES = /* @__PURE__ */ new Set([
5853
+ "se-widget-halloween",
5854
+ "se-widget-xmas",
5855
+ "se-widget-valentine",
5856
+ "se-widget-easter",
5857
+ "se-widget-world-cup"
5858
+ ]);
5864
5859
  var GOAL_TYPES = /* @__PURE__ */ new Set([
5865
5860
  "se-widget-follower-goal",
5866
5861
  "se-widget-subscriber-goal",
@@ -5871,59 +5866,212 @@ var GOAL_TYPES = /* @__PURE__ */ new Set([
5871
5866
  "se-widget-tiltify-goal",
5872
5867
  "se-widget-merch-goal"
5873
5868
  ]);
5874
- var EVENTLIST_TYPES = /* @__PURE__ */ new Set(["se-widget-event-list", "se-widget-follower-recent", "se-widget-subscriber-recent", "se-widget-cheer-recent", "se-widget-tip-recent"]);
5869
+ var EVENTLIST_TYPES = /* @__PURE__ */ new Set([
5870
+ "se-widget-event-list",
5871
+ "se-widget-follower-recent",
5872
+ "se-widget-subscriber-recent",
5873
+ "se-widget-cheer-recent",
5874
+ "se-widget-tip-recent"
5875
+ ]);
5875
5876
  function dispatch(widget, ctx) {
5876
5877
  const t = widget.type;
5877
- console.log("[SE-IMPORT] dispatch widget", {
5878
- seType: t,
5879
- name: widget.name,
5880
- listener: widget.listener,
5881
- listeners: widget.listeners,
5882
- variableKeys: widget.variables ? Object.keys(widget.variables) : [],
5883
- hasCss: !!widget.css
5884
- });
5885
5878
  if (isWidgetFlaggedOff(t)) {
5886
- return { unit: mapUnsupportedAsText(widget, ctx), status: "placeholder", lumiaType: "text", flaggedOff: true };
5879
+ return {
5880
+ unit: mapUnsupportedAsText(widget, ctx),
5881
+ status: "placeholder",
5882
+ lumiaType: "text",
5883
+ flaggedOff: true
5884
+ };
5887
5885
  }
5888
- if (t === "text") return { unit: mapText(widget, ctx), status: "direct", lumiaType: "text" };
5889
- if (t === "image") return { unit: mapImage(widget, ctx), status: "direct", lumiaType: "image" };
5890
- if (t === "video") return { unit: mapVideo(widget, ctx), status: "direct", lumiaType: "video" };
5886
+ if (t === "text")
5887
+ return { unit: mapText(widget, ctx), status: "direct", lumiaType: "text" };
5888
+ if (t === "image")
5889
+ return {
5890
+ unit: mapImage(widget, ctx),
5891
+ status: "direct",
5892
+ lumiaType: "image"
5893
+ };
5894
+ if (t === "video")
5895
+ return {
5896
+ unit: mapVideo(widget, ctx),
5897
+ status: "direct",
5898
+ lumiaType: "video"
5899
+ };
5891
5900
  if (t in READOUT_TYPES) {
5892
- return { unit: mapReadout(widget, READOUT_TYPES[t], ctx), status: "direct", lumiaType: "text" };
5901
+ return {
5902
+ unit: mapReadout(widget, READOUT_TYPES[t], ctx),
5903
+ status: "direct",
5904
+ lumiaType: "text"
5905
+ };
5893
5906
  }
5894
- if (GOAL_TYPES.has(t)) return { unit: mapGoal(widget, ctx), status: "direct", lumiaType: "goal" };
5907
+ if (GOAL_TYPES.has(t))
5908
+ return { unit: mapGoal(widget, ctx), status: "direct", lumiaType: "goal" };
5895
5909
  if ((t === "se-widget-alert-box" || t === "se-widget-alert-box-merch") && hasSECustomCode(widget)) {
5896
- return { unit: mapUnsupportedAsText(widget, ctx), status: "placeholder", lumiaType: "text", flaggedOff: true };
5897
- }
5898
- if (t === "se-widget-alert-box") return { unit: mapAlertBox(widget, {}, ctx), status: "direct", lumiaType: "alert" };
5899
- if (t === "se-widget-alert-box-merch") return { unit: mapAlertBox(widget, { onlyEvents: ["merch"] }, ctx), status: "direct", lumiaType: "alert" };
5900
- if (t === "se-widget-donor-drive-alert") return { unit: mapSingleAlert(widget, "donordrive-donation", ctx), status: "direct", lumiaType: "alert" };
5901
- if (t === "se-widget-extralife-alert") return { unit: mapSingleAlert(widget, "extralife-donation", ctx), status: "direct", lumiaType: "alert" };
5902
- if (t === "se-widget-tiltify-alert") return { unit: mapSingleAlert(widget, "tiltify-campaignDonation", ctx), status: "direct", lumiaType: "alert" };
5903
- if (EVENTLIST_TYPES.has(t)) return { unit: mapEventList(widget, ctx), status: "direct", lumiaType: "eventlist" };
5904
- if (t === "se-widget-top-tippers-list") return { unit: mapViewerProfilesLeaderboard(widget, "tips", ctx), status: "direct", lumiaType: "viewerprofiles" };
5905
- if (t === "se-widget-top-cheerers-list") return { unit: mapViewerProfilesLeaderboard(widget, "cheers", ctx), status: "direct", lumiaType: "viewerprofiles" };
5906
- if (t === "se-widget-top-gifters-list") return { unit: mapViewerProfilesLeaderboard(widget, "gifts", ctx), status: "direct", lumiaType: "viewerprofiles" };
5907
- if (t === "se-widget-credit-roll") return { unit: mapCredits(widget, ctx), status: "partial", lumiaType: "credits" };
5908
- if (t === "se-widget-twitch-chat") return { unit: mapChatbox(widget, ctx), status: "partial", lumiaType: "chatbox" };
5909
- if (t === "se-widget-image-rotator" || t === "se-widget-merch-products-rotator") return { unit: mapSlideshow(widget, ctx), status: t === "se-widget-merch-products-rotator" ? "partial" : "direct", lumiaType: "slideshow" };
5910
- if (t === "se-widget-countdown") return { unit: mapTimer(widget, ctx), status: "partial", lumiaType: "timer" };
5911
- if (t === "se-widget-current-song") return { unit: mapNowPlaying(widget, ctx), status: "partial", lumiaType: "nowplaying" };
5912
- if (t === "se-widget-kappagen") return { unit: mapKappagen(widget, ctx), status: "partial", lumiaType: "emotealert" };
5913
- if (t === "se-widget-emote-wall") return { unit: mapEmoteWall(widget, ctx), status: "partial", lumiaType: "emotebox" };
5914
- if (t === "se-widget-giveaway") return { unit: mapGiveaway(widget, ctx), status: "direct", lumiaType: "raffle" };
5915
- if (t === "se-widget-media-share") return { unit: mapMediaShare(widget, ctx), status: "partial", lumiaType: "songrequest" };
5916
- if (t === "se-widget-hype-cup") return { unit: mapHypeCup(widget, ctx), status: "partial", lumiaType: "tipjar" };
5917
- if (t === "se-widget-bit-boss") return { unit: mapStreamBoss(widget, ctx), status: "partial", lumiaType: "streamboss" };
5918
- if (t === "se-widget-hype-train") return { unit: mapHypetrain(widget, ctx), status: "partial", lumiaType: "hypetrain" };
5910
+ return {
5911
+ unit: mapUnsupportedAsText(widget, ctx),
5912
+ status: "placeholder",
5913
+ lumiaType: "text",
5914
+ flaggedOff: true
5915
+ };
5916
+ }
5917
+ if (t === "se-widget-alert-box")
5918
+ return {
5919
+ unit: mapAlertBox(widget, {}, ctx),
5920
+ status: "direct",
5921
+ lumiaType: "alert"
5922
+ };
5923
+ if (t === "se-widget-alert-box-merch")
5924
+ return {
5925
+ unit: mapAlertBox(widget, { onlyEvents: ["merch"] }, ctx),
5926
+ status: "direct",
5927
+ lumiaType: "alert"
5928
+ };
5929
+ if (t === "se-widget-donor-drive-alert")
5930
+ return {
5931
+ unit: mapSingleAlert(widget, "donordrive-donation", ctx),
5932
+ status: "direct",
5933
+ lumiaType: "alert"
5934
+ };
5935
+ if (t === "se-widget-extralife-alert")
5936
+ return {
5937
+ unit: mapSingleAlert(widget, "extralife-donation", ctx),
5938
+ status: "direct",
5939
+ lumiaType: "alert"
5940
+ };
5941
+ if (t === "se-widget-tiltify-alert")
5942
+ return {
5943
+ unit: mapSingleAlert(widget, "tiltify-campaignDonation", ctx),
5944
+ status: "direct",
5945
+ lumiaType: "alert"
5946
+ };
5947
+ if (EVENTLIST_TYPES.has(t))
5948
+ return {
5949
+ unit: mapEventList(widget, ctx),
5950
+ status: "direct",
5951
+ lumiaType: "eventlist"
5952
+ };
5953
+ if (t === "se-widget-top-tippers-list")
5954
+ return {
5955
+ unit: mapViewerProfilesLeaderboard(widget, "tips", ctx),
5956
+ status: "direct",
5957
+ lumiaType: "viewerprofiles"
5958
+ };
5959
+ if (t === "se-widget-top-cheerers-list")
5960
+ return {
5961
+ unit: mapViewerProfilesLeaderboard(widget, "cheers", ctx),
5962
+ status: "direct",
5963
+ lumiaType: "viewerprofiles"
5964
+ };
5965
+ if (t === "se-widget-top-gifters-list")
5966
+ return {
5967
+ unit: mapViewerProfilesLeaderboard(widget, "gifts", ctx),
5968
+ status: "direct",
5969
+ lumiaType: "viewerprofiles"
5970
+ };
5971
+ if (t === "se-widget-credit-roll")
5972
+ return {
5973
+ unit: mapCredits(widget, ctx),
5974
+ status: "partial",
5975
+ lumiaType: "credits"
5976
+ };
5977
+ if (t === "se-widget-twitch-chat")
5978
+ return {
5979
+ unit: mapChatbox(widget, ctx),
5980
+ status: "partial",
5981
+ lumiaType: "chatbox"
5982
+ };
5983
+ if (t === "se-widget-image-rotator" || t === "se-widget-merch-products-rotator")
5984
+ return {
5985
+ unit: mapSlideshow(widget, ctx),
5986
+ status: t === "se-widget-merch-products-rotator" ? "partial" : "direct",
5987
+ lumiaType: "slideshow"
5988
+ };
5989
+ if (t === "se-widget-countdown")
5990
+ return {
5991
+ unit: mapTimer(widget, ctx),
5992
+ status: "partial",
5993
+ lumiaType: "timer"
5994
+ };
5995
+ if (t === "se-widget-current-song")
5996
+ return {
5997
+ unit: mapNowPlaying(widget, ctx),
5998
+ status: "partial",
5999
+ lumiaType: "nowplaying"
6000
+ };
6001
+ if (t === "se-widget-kappagen")
6002
+ return {
6003
+ unit: mapKappagen(widget, ctx),
6004
+ status: "partial",
6005
+ lumiaType: "emotealert"
6006
+ };
6007
+ if (t === "se-widget-emote-wall")
6008
+ return {
6009
+ unit: mapEmoteWall(widget, ctx),
6010
+ status: "partial",
6011
+ lumiaType: "emotebox"
6012
+ };
6013
+ if (t === "se-widget-giveaway")
6014
+ return {
6015
+ unit: mapGiveaway(widget, ctx),
6016
+ status: "direct",
6017
+ lumiaType: "raffle"
6018
+ };
6019
+ if (t === "se-widget-media-share")
6020
+ return {
6021
+ unit: mapMediaShare(widget, ctx),
6022
+ status: "partial",
6023
+ lumiaType: "songrequest"
6024
+ };
6025
+ if (t === "se-widget-hype-cup")
6026
+ return {
6027
+ unit: mapHypeCup(widget, ctx),
6028
+ status: "partial",
6029
+ lumiaType: "tipjar"
6030
+ };
6031
+ if (t === "se-widget-bit-boss")
6032
+ return {
6033
+ unit: mapStreamBoss(widget, ctx),
6034
+ status: "partial",
6035
+ lumiaType: "streamboss"
6036
+ };
6037
+ if (t === "se-widget-hype-train")
6038
+ return {
6039
+ unit: mapHypetrain(widget, ctx),
6040
+ status: "partial",
6041
+ lumiaType: "hypetrain"
6042
+ };
5919
6043
  if (t === "se-widget-custom-event-list" && isHypetrainCustomWidget(widget)) {
5920
- return { unit: mapHypetrain(widget, ctx), status: "partial", lumiaType: "hypetrain" };
6044
+ return {
6045
+ unit: mapHypetrain(widget, ctx),
6046
+ status: "partial",
6047
+ lumiaType: "hypetrain"
6048
+ };
5921
6049
  }
5922
- if (t === "se-widget-custom-event-list") return { unit: mapCustom(widget, ctx), status: "partial", lumiaType: "custom" };
5923
- if (t === "se-widget-snow") return { unit: mapSnow(widget, ctx), status: "direct", lumiaType: "video" };
5924
- if (t === "se-widget-halloween-2019") return { unit: mapSlideshow(widget, ctx), status: "direct", lumiaType: "slideshow" };
5925
- if (SEASONAL_IMAGE_TYPES.has(t)) return { unit: mapImage(widget, ctx), status: "direct", lumiaType: "image" };
5926
- return { unit: mapUnsupportedAsText(widget, ctx), status: "placeholder", lumiaType: "text" };
6050
+ if (t === "se-widget-custom-event-list")
6051
+ return {
6052
+ unit: mapCustom(widget, ctx),
6053
+ status: "partial",
6054
+ lumiaType: "custom"
6055
+ };
6056
+ if (t === "se-widget-snow")
6057
+ return { unit: mapSnow(widget, ctx), status: "direct", lumiaType: "video" };
6058
+ if (t === "se-widget-halloween-2019")
6059
+ return {
6060
+ unit: mapSlideshow(widget, ctx),
6061
+ status: "direct",
6062
+ lumiaType: "slideshow"
6063
+ };
6064
+ if (SEASONAL_IMAGE_TYPES.has(t))
6065
+ return {
6066
+ unit: mapImage(widget, ctx),
6067
+ status: "direct",
6068
+ lumiaType: "image"
6069
+ };
6070
+ return {
6071
+ unit: mapUnsupportedAsText(widget, ctx),
6072
+ status: "placeholder",
6073
+ lumiaType: "text"
6074
+ };
5927
6075
  }
5928
6076
  function recordCoverage(coverage, result, seType) {
5929
6077
  const existing = coverage.mappings.find((m) => m.seType === seType);
@@ -5931,7 +6079,12 @@ function recordCoverage(coverage, result, seType) {
5931
6079
  existing.count += 1;
5932
6080
  return;
5933
6081
  }
5934
- coverage.mappings.push({ seType, lumiaType: result.lumiaType, status: result.status, count: 1 });
6082
+ coverage.mappings.push({
6083
+ seType,
6084
+ lumiaType: result.lumiaType,
6085
+ status: result.status,
6086
+ count: 1
6087
+ });
5935
6088
  }
5936
6089
 
5937
6090
  // src/se-import/assets.ts
@@ -9016,17 +9169,6 @@ function importSEBootstrap(bootstrap) {
9016
9169
  notes: []
9017
9170
  };
9018
9171
  const provider = readBootstrapProvider(bootstrap);
9019
- console.log("[SE-IMPORT] bootstrap received", {
9020
- overlayId: seOverlay?._id,
9021
- name: seOverlay?.name,
9022
- canvas: {
9023
- width: seOverlay?.settings?.width,
9024
- height: seOverlay?.settings?.height
9025
- },
9026
- widgetCount: widgets.length,
9027
- widgetTypes: widgets.map((w) => w.type),
9028
- provider
9029
- });
9030
9172
  const importCanvas = {
9031
9173
  width: seOverlay?.settings?.width ?? 1920,
9032
9174
  height: seOverlay?.settings?.height ?? 1080
@@ -9178,12 +9320,6 @@ function importSEBootstrap(bootstrap) {
9178
9320
  layers_count: layers.length,
9179
9321
  hasFullSettings: true
9180
9322
  };
9181
- console.log("[SE-IMPORT] import complete", {
9182
- overlayName: overlay.name,
9183
- layerCount: overlay.layers_count,
9184
- coverage,
9185
- reviewItemCount: reviewItems.length
9186
- });
9187
9323
  return { overlay, coverage, reviewItems };
9188
9324
  }
9189
9325
  function applyReviewAction(result, moduleId, action, payload) {
package/dist/se-import.js CHANGED
@@ -1081,9 +1081,11 @@ function mapGoal(widget, ctx) {
1081
1081
  source: charity ? charity.source : sourceFromListener(listener),
1082
1082
  image: "",
1083
1083
  audio: { decrement: "", increment: "", goal: "", goalFailed: "", volume: 1 },
1084
- // `null` (rather than `''`) is the cleaner contract — Goal/index.tsx:11's
1085
- // `isGoalExpired` treats any falsy as not-expired so both work at render time,
1086
- // but `null` survives JSON round-trips without ambiguity ('' vs unset).
1084
+ // `null` (rather than `''`) is the cleaner contract — `formatEndsIn`
1085
+ // in Goal/index.tsx treats both as "no deadline" so both work at
1086
+ // render time, but `null` survives JSON round-trips without
1087
+ // ambiguity ('' vs unset). The Goal module no longer hides itself
1088
+ // when the date passes; the "Ends in…" sublabel just disappears.
1087
1089
  endDate: v.endDate ?? null,
1088
1090
  goalAnimation: "",
1089
1091
  goalAnimationLoop: true,
@@ -1455,31 +1457,7 @@ var SE_LISTENER_TO_LUMIA_CATEGORY = {
1455
1457
  "superchat-recent": "superchats",
1456
1458
  "hypetrain-latest": "hypetrain"
1457
1459
  };
1458
- var ALL_LUMIA_EVENTLIST_CATEGORIES = [
1459
- "redemption",
1460
- "follower",
1461
- "bits",
1462
- "kicks",
1463
- "extension",
1464
- "points",
1465
- "donation",
1466
- "subscribers",
1467
- "gifts",
1468
- "hosts",
1469
- "raids",
1470
- "hypetrain",
1471
- "spells",
1472
- "retweets",
1473
- "likes",
1474
- "purchases",
1475
- "superstickers",
1476
- "superchats",
1477
- "stars",
1478
- "fans",
1479
- "shares",
1480
- "raffles"
1481
- ];
1482
- function computeListenerFilters(seListeners, explicitListener) {
1460
+ function computeAllowedEventsFromSEListeners(seListeners, explicitListener) {
1483
1461
  const enabled = [];
1484
1462
  if (seListeners && typeof seListeners === "object" && !Array.isArray(seListeners)) {
1485
1463
  for (const [k, v] of Object.entries(
@@ -1493,14 +1471,21 @@ function computeListenerFilters(seListeners, explicitListener) {
1493
1471
  if (typeof explicitListener === "string" && explicitListener && !enabled.includes(explicitListener)) {
1494
1472
  enabled.push(explicitListener);
1495
1473
  }
1496
- if (enabled.length === 0) return [];
1497
- const allowed = /* @__PURE__ */ new Set();
1474
+ if (enabled.length === 0) return void 0;
1475
+ const allowedCategories = /* @__PURE__ */ new Set();
1498
1476
  for (const listener of enabled) {
1499
1477
  const category = SE_LISTENER_TO_LUMIA_CATEGORY[listener];
1500
- if (category) allowed.add(category);
1478
+ if (category) allowedCategories.add(category);
1501
1479
  }
1502
- if (allowed.size === 0) return [];
1503
- return ALL_LUMIA_EVENTLIST_CATEGORIES.filter((c) => !allowed.has(c));
1480
+ if (allowedCategories.size === 0) return [];
1481
+ const allowedAlerts = [];
1482
+ Object.keys(LumiaMapAlertTypeToEventListType).forEach((alertKey) => {
1483
+ const mappedCategory = LumiaMapAlertTypeToEventListType[alertKey];
1484
+ if (mappedCategory && allowedCategories.has(mappedCategory)) {
1485
+ allowedAlerts.push(alertKey);
1486
+ }
1487
+ });
1488
+ return allowedAlerts;
1504
1489
  }
1505
1490
  function seScrollSpeedToMarqueeDurationSec(seSpeed) {
1506
1491
  const n = typeof seSpeed === "number" && Number.isFinite(seSpeed) ? seSpeed : 6;
@@ -1514,7 +1499,10 @@ function seTemplateToMarqueeTemplate(seTemplate) {
1514
1499
  }
1515
1500
  function mapEventList(widget, ctx) {
1516
1501
  const v = widget.variables ?? {};
1517
- const filters = computeListenerFilters(widget.listeners, widget.listener);
1502
+ const allowedEvents = computeAllowedEventsFromSEListeners(
1503
+ widget.listeners,
1504
+ widget.listener
1505
+ );
1518
1506
  const maxItems = v.visibleEvents ?? v.visibleItems ?? 5;
1519
1507
  const seText = widget.text;
1520
1508
  const scrolling = seText?.scrolling;
@@ -1538,10 +1526,11 @@ function mapEventList(widget, ctx) {
1538
1526
  // legacy field name kept for back-compat
1539
1527
  themeBgOpacity: v.themeBgOpacity ?? 0,
1540
1528
  highlight: v.highlight,
1541
- // `filters` is a blacklist: every category here is HIDDEN. Empty = show all.
1542
- filters,
1543
- // `sites` is a platform blacklist (same shape). Default to "no platforms hidden".
1544
- sites: [],
1529
+ // `allowedEvents` alertbox-style whitelist of LumiaAlertValues
1530
+ // strings. Computed from SE's enabled listeners; `undefined` means
1531
+ // the importer didn't see any listener config and we defer to the
1532
+ // eventlist's default (show every mapped alert).
1533
+ ...allowedEvents !== void 0 ? { allowedEvents } : {},
1545
1534
  // Eventlist Manager assumes these objects exist; provide an empty stub so
1546
1535
  // imported overlays render without throwing. The marquee theme reads
1547
1536
  // `itemTemplate` off either currentThemeConfig or themeConfig — stash
@@ -2745,7 +2734,13 @@ var READOUT_TYPES = {
2745
2734
  // twitch_session_chat_count, so we render it as a text layer with the variable inline.
2746
2735
  "se-widget-botcounter": "twitch_session_chat_count"
2747
2736
  };
2748
- var SEASONAL_IMAGE_TYPES = /* @__PURE__ */ new Set(["se-widget-halloween", "se-widget-xmas", "se-widget-valentine", "se-widget-easter", "se-widget-world-cup"]);
2737
+ var SEASONAL_IMAGE_TYPES = /* @__PURE__ */ new Set([
2738
+ "se-widget-halloween",
2739
+ "se-widget-xmas",
2740
+ "se-widget-valentine",
2741
+ "se-widget-easter",
2742
+ "se-widget-world-cup"
2743
+ ]);
2749
2744
  var GOAL_TYPES = /* @__PURE__ */ new Set([
2750
2745
  "se-widget-follower-goal",
2751
2746
  "se-widget-subscriber-goal",
@@ -2756,59 +2751,212 @@ var GOAL_TYPES = /* @__PURE__ */ new Set([
2756
2751
  "se-widget-tiltify-goal",
2757
2752
  "se-widget-merch-goal"
2758
2753
  ]);
2759
- var EVENTLIST_TYPES = /* @__PURE__ */ new Set(["se-widget-event-list", "se-widget-follower-recent", "se-widget-subscriber-recent", "se-widget-cheer-recent", "se-widget-tip-recent"]);
2754
+ var EVENTLIST_TYPES = /* @__PURE__ */ new Set([
2755
+ "se-widget-event-list",
2756
+ "se-widget-follower-recent",
2757
+ "se-widget-subscriber-recent",
2758
+ "se-widget-cheer-recent",
2759
+ "se-widget-tip-recent"
2760
+ ]);
2760
2761
  function dispatch(widget, ctx) {
2761
2762
  const t = widget.type;
2762
- console.log("[SE-IMPORT] dispatch widget", {
2763
- seType: t,
2764
- name: widget.name,
2765
- listener: widget.listener,
2766
- listeners: widget.listeners,
2767
- variableKeys: widget.variables ? Object.keys(widget.variables) : [],
2768
- hasCss: !!widget.css
2769
- });
2770
2763
  if (isWidgetFlaggedOff(t)) {
2771
- return { unit: mapUnsupportedAsText(widget, ctx), status: "placeholder", lumiaType: "text", flaggedOff: true };
2764
+ return {
2765
+ unit: mapUnsupportedAsText(widget, ctx),
2766
+ status: "placeholder",
2767
+ lumiaType: "text",
2768
+ flaggedOff: true
2769
+ };
2772
2770
  }
2773
- if (t === "text") return { unit: mapText(widget, ctx), status: "direct", lumiaType: "text" };
2774
- if (t === "image") return { unit: mapImage(widget, ctx), status: "direct", lumiaType: "image" };
2775
- if (t === "video") return { unit: mapVideo(widget, ctx), status: "direct", lumiaType: "video" };
2771
+ if (t === "text")
2772
+ return { unit: mapText(widget, ctx), status: "direct", lumiaType: "text" };
2773
+ if (t === "image")
2774
+ return {
2775
+ unit: mapImage(widget, ctx),
2776
+ status: "direct",
2777
+ lumiaType: "image"
2778
+ };
2779
+ if (t === "video")
2780
+ return {
2781
+ unit: mapVideo(widget, ctx),
2782
+ status: "direct",
2783
+ lumiaType: "video"
2784
+ };
2776
2785
  if (t in READOUT_TYPES) {
2777
- return { unit: mapReadout(widget, READOUT_TYPES[t], ctx), status: "direct", lumiaType: "text" };
2786
+ return {
2787
+ unit: mapReadout(widget, READOUT_TYPES[t], ctx),
2788
+ status: "direct",
2789
+ lumiaType: "text"
2790
+ };
2778
2791
  }
2779
- if (GOAL_TYPES.has(t)) return { unit: mapGoal(widget, ctx), status: "direct", lumiaType: "goal" };
2792
+ if (GOAL_TYPES.has(t))
2793
+ return { unit: mapGoal(widget, ctx), status: "direct", lumiaType: "goal" };
2780
2794
  if ((t === "se-widget-alert-box" || t === "se-widget-alert-box-merch") && hasSECustomCode(widget)) {
2781
- return { unit: mapUnsupportedAsText(widget, ctx), status: "placeholder", lumiaType: "text", flaggedOff: true };
2795
+ return {
2796
+ unit: mapUnsupportedAsText(widget, ctx),
2797
+ status: "placeholder",
2798
+ lumiaType: "text",
2799
+ flaggedOff: true
2800
+ };
2782
2801
  }
2783
- if (t === "se-widget-alert-box") return { unit: mapAlertBox(widget, {}, ctx), status: "direct", lumiaType: "alert" };
2784
- if (t === "se-widget-alert-box-merch") return { unit: mapAlertBox(widget, { onlyEvents: ["merch"] }, ctx), status: "direct", lumiaType: "alert" };
2785
- if (t === "se-widget-donor-drive-alert") return { unit: mapSingleAlert(widget, "donordrive-donation", ctx), status: "direct", lumiaType: "alert" };
2786
- if (t === "se-widget-extralife-alert") return { unit: mapSingleAlert(widget, "extralife-donation", ctx), status: "direct", lumiaType: "alert" };
2787
- if (t === "se-widget-tiltify-alert") return { unit: mapSingleAlert(widget, "tiltify-campaignDonation", ctx), status: "direct", lumiaType: "alert" };
2788
- if (EVENTLIST_TYPES.has(t)) return { unit: mapEventList(widget, ctx), status: "direct", lumiaType: "eventlist" };
2789
- if (t === "se-widget-top-tippers-list") return { unit: mapViewerProfilesLeaderboard(widget, "tips", ctx), status: "direct", lumiaType: "viewerprofiles" };
2790
- if (t === "se-widget-top-cheerers-list") return { unit: mapViewerProfilesLeaderboard(widget, "cheers", ctx), status: "direct", lumiaType: "viewerprofiles" };
2791
- if (t === "se-widget-top-gifters-list") return { unit: mapViewerProfilesLeaderboard(widget, "gifts", ctx), status: "direct", lumiaType: "viewerprofiles" };
2792
- if (t === "se-widget-credit-roll") return { unit: mapCredits(widget, ctx), status: "partial", lumiaType: "credits" };
2793
- if (t === "se-widget-twitch-chat") return { unit: mapChatbox(widget, ctx), status: "partial", lumiaType: "chatbox" };
2794
- if (t === "se-widget-image-rotator" || t === "se-widget-merch-products-rotator") return { unit: mapSlideshow(widget, ctx), status: t === "se-widget-merch-products-rotator" ? "partial" : "direct", lumiaType: "slideshow" };
2795
- if (t === "se-widget-countdown") return { unit: mapTimer(widget, ctx), status: "partial", lumiaType: "timer" };
2796
- if (t === "se-widget-current-song") return { unit: mapNowPlaying(widget, ctx), status: "partial", lumiaType: "nowplaying" };
2797
- if (t === "se-widget-kappagen") return { unit: mapKappagen(widget, ctx), status: "partial", lumiaType: "emotealert" };
2798
- if (t === "se-widget-emote-wall") return { unit: mapEmoteWall(widget, ctx), status: "partial", lumiaType: "emotebox" };
2799
- if (t === "se-widget-giveaway") return { unit: mapGiveaway(widget, ctx), status: "direct", lumiaType: "raffle" };
2800
- if (t === "se-widget-media-share") return { unit: mapMediaShare(widget, ctx), status: "partial", lumiaType: "songrequest" };
2801
- if (t === "se-widget-hype-cup") return { unit: mapHypeCup(widget, ctx), status: "partial", lumiaType: "tipjar" };
2802
- if (t === "se-widget-bit-boss") return { unit: mapStreamBoss(widget, ctx), status: "partial", lumiaType: "streamboss" };
2803
- if (t === "se-widget-hype-train") return { unit: mapHypetrain(widget, ctx), status: "partial", lumiaType: "hypetrain" };
2802
+ if (t === "se-widget-alert-box")
2803
+ return {
2804
+ unit: mapAlertBox(widget, {}, ctx),
2805
+ status: "direct",
2806
+ lumiaType: "alert"
2807
+ };
2808
+ if (t === "se-widget-alert-box-merch")
2809
+ return {
2810
+ unit: mapAlertBox(widget, { onlyEvents: ["merch"] }, ctx),
2811
+ status: "direct",
2812
+ lumiaType: "alert"
2813
+ };
2814
+ if (t === "se-widget-donor-drive-alert")
2815
+ return {
2816
+ unit: mapSingleAlert(widget, "donordrive-donation", ctx),
2817
+ status: "direct",
2818
+ lumiaType: "alert"
2819
+ };
2820
+ if (t === "se-widget-extralife-alert")
2821
+ return {
2822
+ unit: mapSingleAlert(widget, "extralife-donation", ctx),
2823
+ status: "direct",
2824
+ lumiaType: "alert"
2825
+ };
2826
+ if (t === "se-widget-tiltify-alert")
2827
+ return {
2828
+ unit: mapSingleAlert(widget, "tiltify-campaignDonation", ctx),
2829
+ status: "direct",
2830
+ lumiaType: "alert"
2831
+ };
2832
+ if (EVENTLIST_TYPES.has(t))
2833
+ return {
2834
+ unit: mapEventList(widget, ctx),
2835
+ status: "direct",
2836
+ lumiaType: "eventlist"
2837
+ };
2838
+ if (t === "se-widget-top-tippers-list")
2839
+ return {
2840
+ unit: mapViewerProfilesLeaderboard(widget, "tips", ctx),
2841
+ status: "direct",
2842
+ lumiaType: "viewerprofiles"
2843
+ };
2844
+ if (t === "se-widget-top-cheerers-list")
2845
+ return {
2846
+ unit: mapViewerProfilesLeaderboard(widget, "cheers", ctx),
2847
+ status: "direct",
2848
+ lumiaType: "viewerprofiles"
2849
+ };
2850
+ if (t === "se-widget-top-gifters-list")
2851
+ return {
2852
+ unit: mapViewerProfilesLeaderboard(widget, "gifts", ctx),
2853
+ status: "direct",
2854
+ lumiaType: "viewerprofiles"
2855
+ };
2856
+ if (t === "se-widget-credit-roll")
2857
+ return {
2858
+ unit: mapCredits(widget, ctx),
2859
+ status: "partial",
2860
+ lumiaType: "credits"
2861
+ };
2862
+ if (t === "se-widget-twitch-chat")
2863
+ return {
2864
+ unit: mapChatbox(widget, ctx),
2865
+ status: "partial",
2866
+ lumiaType: "chatbox"
2867
+ };
2868
+ if (t === "se-widget-image-rotator" || t === "se-widget-merch-products-rotator")
2869
+ return {
2870
+ unit: mapSlideshow(widget, ctx),
2871
+ status: t === "se-widget-merch-products-rotator" ? "partial" : "direct",
2872
+ lumiaType: "slideshow"
2873
+ };
2874
+ if (t === "se-widget-countdown")
2875
+ return {
2876
+ unit: mapTimer(widget, ctx),
2877
+ status: "partial",
2878
+ lumiaType: "timer"
2879
+ };
2880
+ if (t === "se-widget-current-song")
2881
+ return {
2882
+ unit: mapNowPlaying(widget, ctx),
2883
+ status: "partial",
2884
+ lumiaType: "nowplaying"
2885
+ };
2886
+ if (t === "se-widget-kappagen")
2887
+ return {
2888
+ unit: mapKappagen(widget, ctx),
2889
+ status: "partial",
2890
+ lumiaType: "emotealert"
2891
+ };
2892
+ if (t === "se-widget-emote-wall")
2893
+ return {
2894
+ unit: mapEmoteWall(widget, ctx),
2895
+ status: "partial",
2896
+ lumiaType: "emotebox"
2897
+ };
2898
+ if (t === "se-widget-giveaway")
2899
+ return {
2900
+ unit: mapGiveaway(widget, ctx),
2901
+ status: "direct",
2902
+ lumiaType: "raffle"
2903
+ };
2904
+ if (t === "se-widget-media-share")
2905
+ return {
2906
+ unit: mapMediaShare(widget, ctx),
2907
+ status: "partial",
2908
+ lumiaType: "songrequest"
2909
+ };
2910
+ if (t === "se-widget-hype-cup")
2911
+ return {
2912
+ unit: mapHypeCup(widget, ctx),
2913
+ status: "partial",
2914
+ lumiaType: "tipjar"
2915
+ };
2916
+ if (t === "se-widget-bit-boss")
2917
+ return {
2918
+ unit: mapStreamBoss(widget, ctx),
2919
+ status: "partial",
2920
+ lumiaType: "streamboss"
2921
+ };
2922
+ if (t === "se-widget-hype-train")
2923
+ return {
2924
+ unit: mapHypetrain(widget, ctx),
2925
+ status: "partial",
2926
+ lumiaType: "hypetrain"
2927
+ };
2804
2928
  if (t === "se-widget-custom-event-list" && isHypetrainCustomWidget(widget)) {
2805
- return { unit: mapHypetrain(widget, ctx), status: "partial", lumiaType: "hypetrain" };
2929
+ return {
2930
+ unit: mapHypetrain(widget, ctx),
2931
+ status: "partial",
2932
+ lumiaType: "hypetrain"
2933
+ };
2806
2934
  }
2807
- if (t === "se-widget-custom-event-list") return { unit: mapCustom(widget, ctx), status: "partial", lumiaType: "custom" };
2808
- if (t === "se-widget-snow") return { unit: mapSnow(widget, ctx), status: "direct", lumiaType: "video" };
2809
- if (t === "se-widget-halloween-2019") return { unit: mapSlideshow(widget, ctx), status: "direct", lumiaType: "slideshow" };
2810
- if (SEASONAL_IMAGE_TYPES.has(t)) return { unit: mapImage(widget, ctx), status: "direct", lumiaType: "image" };
2811
- return { unit: mapUnsupportedAsText(widget, ctx), status: "placeholder", lumiaType: "text" };
2935
+ if (t === "se-widget-custom-event-list")
2936
+ return {
2937
+ unit: mapCustom(widget, ctx),
2938
+ status: "partial",
2939
+ lumiaType: "custom"
2940
+ };
2941
+ if (t === "se-widget-snow")
2942
+ return { unit: mapSnow(widget, ctx), status: "direct", lumiaType: "video" };
2943
+ if (t === "se-widget-halloween-2019")
2944
+ return {
2945
+ unit: mapSlideshow(widget, ctx),
2946
+ status: "direct",
2947
+ lumiaType: "slideshow"
2948
+ };
2949
+ if (SEASONAL_IMAGE_TYPES.has(t))
2950
+ return {
2951
+ unit: mapImage(widget, ctx),
2952
+ status: "direct",
2953
+ lumiaType: "image"
2954
+ };
2955
+ return {
2956
+ unit: mapUnsupportedAsText(widget, ctx),
2957
+ status: "placeholder",
2958
+ lumiaType: "text"
2959
+ };
2812
2960
  }
2813
2961
  function recordCoverage(coverage, result, seType) {
2814
2962
  const existing = coverage.mappings.find((m) => m.seType === seType);
@@ -2816,7 +2964,12 @@ function recordCoverage(coverage, result, seType) {
2816
2964
  existing.count += 1;
2817
2965
  return;
2818
2966
  }
2819
- coverage.mappings.push({ seType, lumiaType: result.lumiaType, status: result.status, count: 1 });
2967
+ coverage.mappings.push({
2968
+ seType,
2969
+ lumiaType: result.lumiaType,
2970
+ status: result.status,
2971
+ count: 1
2972
+ });
2820
2973
  }
2821
2974
 
2822
2975
  // src/se-import/assets.ts
@@ -7886,17 +8039,6 @@ function importSEBootstrap(bootstrap) {
7886
8039
  notes: []
7887
8040
  };
7888
8041
  const provider = readBootstrapProvider(bootstrap);
7889
- console.log("[SE-IMPORT] bootstrap received", {
7890
- overlayId: seOverlay?._id,
7891
- name: seOverlay?.name,
7892
- canvas: {
7893
- width: seOverlay?.settings?.width,
7894
- height: seOverlay?.settings?.height
7895
- },
7896
- widgetCount: widgets.length,
7897
- widgetTypes: widgets.map((w) => w.type),
7898
- provider
7899
- });
7900
8042
  const importCanvas = {
7901
8043
  width: seOverlay?.settings?.width ?? 1920,
7902
8044
  height: seOverlay?.settings?.height ?? 1080
@@ -8048,12 +8190,6 @@ function importSEBootstrap(bootstrap) {
8048
8190
  layers_count: layers.length,
8049
8191
  hasFullSettings: true
8050
8192
  };
8051
- console.log("[SE-IMPORT] import complete", {
8052
- overlayName: overlay.name,
8053
- layerCount: overlay.layers_count,
8054
- coverage,
8055
- reviewItemCount: reviewItems.length
8056
- });
8057
8193
  return { overlay, coverage, reviewItems };
8058
8194
  }
8059
8195
  function applyReviewAction(result, moduleId, action, payload) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lumiastream/ui",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "author": "Lumia Stream",
5
5
  "license": "ISC",
6
6
  "description": "Lumia UI Kit",