saltfish 0.3.33 → 0.3.34

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.
@@ -903,8 +903,8 @@ const playerStateMachineConfig = {
903
903
  "TRANSITION_TO_STEP": { target: "playing" },
904
904
  "MINIMIZE": { target: "minimized" }
905
905
  },
906
- entry: ["logStateEntry", "startMutedLoopedVideo", "hideVideoControls", "showPlayButton", "enablePlayButtonProminent"],
907
- exit: ["disablePlayButtonProminent", "showVideoControls"]
906
+ entry: ["logStateEntry", "enterCompactMode", "startMutedLoopedVideo", "hideVideoControls", "showPlayButton", "enablePlayButtonProminent"],
907
+ exit: ["disablePlayButtonProminent", "showVideoControls", "exitCompactMode"]
908
908
  },
909
909
  "idleMode": {
910
910
  on: {
@@ -913,7 +913,7 @@ const playerStateMachineConfig = {
913
913
  "MINIMIZE": { target: "minimized" }
914
914
  },
915
915
  entry: ["logStateEntry", "startIdleModeVideo", "hideVideoControls", "showPlayButton", "enablePlayButtonProminent"],
916
- exit: ["disablePlayButtonProminent", "showVideoControls"]
916
+ exit: ["disablePlayButtonProminent", "showVideoControls", "exitCompactMode"]
917
917
  },
918
918
  "error": {
919
919
  on: {
@@ -2843,15 +2843,15 @@ class PlaylistOrchestrator {
2843
2843
  this.managers.cursorManager.setColor(updatedStore.manifest.cursorColor);
2844
2844
  }
2845
2845
  const isTriggeredAutomatically = finalOptions._triggeredByTriggerManager === true;
2846
- const isFirstStep = updatedStore.currentStepId === ((_e = updatedStore.manifest.steps[0]) == null ? void 0 : _e.id);
2847
- if (updatedStore.manifest.compactFirstStep && isFirstStep && isTriggeredAutomatically) {
2848
- const playerElement = this.managers.uiManager.getPlayerElement();
2849
- playerElement == null ? void 0 : playerElement.classList.add("sf-player--compact");
2850
- if (updatedStore.manifest.compactLabel) {
2851
- this.managers.uiManager.showCompactLabel(updatedStore.manifest.compactLabel);
2852
- }
2853
- }
2854
2846
  if (updatedStore.manifest.idleMode && isTriggeredAutomatically) {
2847
+ const isFirstStep = updatedStore.currentStepId === ((_e = updatedStore.manifest.steps[0]) == null ? void 0 : _e.id);
2848
+ if (updatedStore.manifest.compactFirstStep && isFirstStep) {
2849
+ const playerElement = this.managers.uiManager.getPlayerElement();
2850
+ playerElement == null ? void 0 : playerElement.classList.add("sf-player--compact");
2851
+ if (updatedStore.manifest.compactLabel) {
2852
+ this.managers.uiManager.showCompactLabel(updatedStore.manifest.compactLabel);
2853
+ }
2854
+ }
2855
2855
  store.setIdleMode();
2856
2856
  } else {
2857
2857
  store.play();
@@ -2974,6 +2974,12 @@ class StateMachineActionHandler {
2974
2974
  disablePlayButtonProminent: () => {
2975
2975
  this.handleDisablePlayButtonProminent();
2976
2976
  },
2977
+ enterCompactMode: () => {
2978
+ this.handleEnterCompactMode();
2979
+ },
2980
+ exitCompactMode: () => {
2981
+ this.handleExitCompactMode();
2982
+ },
2977
2983
  triggerPlaylistDismissed: () => {
2978
2984
  this.handleTriggerPlaylistDismissed();
2979
2985
  },
@@ -3194,9 +3200,6 @@ class StateMachineActionHandler {
3194
3200
  }
3195
3201
  }
3196
3202
  this.managers.uiManager.updatePosition();
3197
- const playerElement = this.managers.uiManager.getPlayerElement();
3198
- playerElement == null ? void 0 : playerElement.classList.remove("sf-player--compact");
3199
- this.managers.uiManager.hideCompactLabel();
3200
3203
  this.managers.uiManager.showPlayer();
3201
3204
  const videoUrl = this.getVideoUrl(currentStep);
3202
3205
  const isAudioFallback = this.isUsingAudioFallback(currentStep);
@@ -3460,6 +3463,24 @@ class StateMachineActionHandler {
3460
3463
  handleDisablePlayButtonProminent() {
3461
3464
  this.managers.uiManager.disablePlayButtonProminent();
3462
3465
  }
3466
+ handleEnterCompactMode() {
3467
+ var _a, _b, _c, _d;
3468
+ const store = getSaltfishStore();
3469
+ const isFirstStep = store.manifest && store.currentStepId === ((_a = store.manifest.steps[0]) == null ? void 0 : _a.id);
3470
+ const shouldBeCompact = isFirstStep && ((_b = store.manifest) == null ? void 0 : _b.compactFirstStep) && ((_c = store.playlistOptions) == null ? void 0 : _c._triggeredByTriggerManager);
3471
+ if (shouldBeCompact) {
3472
+ const playerElement = this.managers.uiManager.getPlayerElement();
3473
+ playerElement == null ? void 0 : playerElement.classList.add("sf-player--compact");
3474
+ if ((_d = store.manifest) == null ? void 0 : _d.compactLabel) {
3475
+ this.managers.uiManager.showCompactLabel(store.manifest.compactLabel);
3476
+ }
3477
+ }
3478
+ }
3479
+ handleExitCompactMode() {
3480
+ const playerElement = this.managers.uiManager.getPlayerElement();
3481
+ playerElement == null ? void 0 : playerElement.classList.remove("sf-player--compact");
3482
+ this.managers.uiManager.hideCompactLabel();
3483
+ }
3463
3484
  handleTriggerPlaylistDismissed() {
3464
3485
  const store = getSaltfishStore();
3465
3486
  if (store.manifest && this.managers.eventManager) {
@@ -11751,7 +11772,7 @@ const SaltfishPlayer$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
11751
11772
  __proto__: null,
11752
11773
  SaltfishPlayer
11753
11774
  }, Symbol.toStringTag, { value: "Module" }));
11754
- const version = "0.3.33";
11775
+ const version = "0.3.34";
11755
11776
  const packageJson = {
11756
11777
  version
11757
11778
  };