saltfish 0.3.2 → 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.
- package/dist/managers/InteractionManager.d.ts.map +1 -1
- package/dist/managers/StorageManager.d.ts +13 -1
- package/dist/managers/StorageManager.d.ts.map +1 -1
- package/dist/player.js +2 -2
- package/dist/player.min.js +2 -2
- package/dist/saltfish-playlist-player.es.js +27 -8
- package/dist/saltfish-playlist-player.umd.js +1 -1
- package/package.json +1 -1
|
@@ -982,12 +982,29 @@ const CSS_CLASSES = {
|
|
|
982
982
|
ERROR_DISPLAY_MESSAGE: "sf-error-display__message",
|
|
983
983
|
LOADING_SPINNER: "sf-loading-spinner"
|
|
984
984
|
};
|
|
985
|
-
class
|
|
985
|
+
const _StorageManager = class _StorageManager {
|
|
986
986
|
constructor() {
|
|
987
987
|
__publicField(this, "isLocalStorageAvailable");
|
|
988
988
|
this.isLocalStorageAvailable = this.checkLocalStorageAvailability();
|
|
989
989
|
if (!this.isLocalStorageAvailable) ;
|
|
990
990
|
}
|
|
991
|
+
/**
|
|
992
|
+
* Get the singleton instance of StorageManager
|
|
993
|
+
* @returns The StorageManager instance
|
|
994
|
+
*/
|
|
995
|
+
static getInstance() {
|
|
996
|
+
if (!_StorageManager.instance) {
|
|
997
|
+
_StorageManager.instance = new _StorageManager();
|
|
998
|
+
}
|
|
999
|
+
return _StorageManager.instance;
|
|
1000
|
+
}
|
|
1001
|
+
/**
|
|
1002
|
+
* Reset the singleton instance (useful for testing)
|
|
1003
|
+
* @internal
|
|
1004
|
+
*/
|
|
1005
|
+
static resetInstance() {
|
|
1006
|
+
_StorageManager.instance = null;
|
|
1007
|
+
}
|
|
991
1008
|
/**
|
|
992
1009
|
* Check if localStorage is available and working
|
|
993
1010
|
*/
|
|
@@ -1223,8 +1240,10 @@ class StorageManager {
|
|
|
1223
1240
|
keys
|
|
1224
1241
|
};
|
|
1225
1242
|
}
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1243
|
+
};
|
|
1244
|
+
__publicField(_StorageManager, "instance", null);
|
|
1245
|
+
let StorageManager = _StorageManager;
|
|
1246
|
+
const storageManager = StorageManager.getInstance();
|
|
1228
1247
|
const createInitialContext = () => ({
|
|
1229
1248
|
currentStep: null,
|
|
1230
1249
|
error: null
|
|
@@ -7425,7 +7444,7 @@ class InteractionManager {
|
|
|
7425
7444
|
__publicField(this, "scrollIndicator", null);
|
|
7426
7445
|
__publicField(this, "domEventListeners", /* @__PURE__ */ new Map());
|
|
7427
7446
|
__publicField(this, "storeUnsubscribe", null);
|
|
7428
|
-
__publicField(this, "storageManager",
|
|
7447
|
+
__publicField(this, "storageManager", StorageManager.getInstance());
|
|
7429
7448
|
/**
|
|
7430
7449
|
* Handles the video90PercentReached event
|
|
7431
7450
|
* @param _event - The custom event dispatched when video reaches 90%
|
|
@@ -8240,7 +8259,7 @@ class SessionManager {
|
|
|
8240
8259
|
__publicField(this, "sessionId");
|
|
8241
8260
|
__publicField(this, "currentRunId", null);
|
|
8242
8261
|
__publicField(this, "storageManager");
|
|
8243
|
-
this.storageManager = storageManager2 ||
|
|
8262
|
+
this.storageManager = storageManager2 || StorageManager.getInstance();
|
|
8244
8263
|
this.sessionId = this.getOrCreateSession();
|
|
8245
8264
|
log(`SessionManager: Initialized with sessionId: ${this.sessionId}`);
|
|
8246
8265
|
}
|
|
@@ -9873,7 +9892,7 @@ class PlaylistManager {
|
|
|
9873
9892
|
__publicField(this, "playlistLoader");
|
|
9874
9893
|
__publicField(this, "storageManager");
|
|
9875
9894
|
this.playlistLoader = new PlaylistLoader();
|
|
9876
|
-
this.storageManager = storageManager2 ||
|
|
9895
|
+
this.storageManager = storageManager2 || StorageManager.getInstance();
|
|
9877
9896
|
if (eventManager) {
|
|
9878
9897
|
this.setEventManager(eventManager);
|
|
9879
9898
|
}
|
|
@@ -10964,7 +10983,7 @@ class ManagerFactory {
|
|
|
10964
10983
|
* Create all manager instances with proper dependencies
|
|
10965
10984
|
*/
|
|
10966
10985
|
createManagers() {
|
|
10967
|
-
const storageManager2 =
|
|
10986
|
+
const storageManager2 = StorageManager.getInstance();
|
|
10968
10987
|
const sessionManager = new SessionManager(storageManager2);
|
|
10969
10988
|
const shadowDOMManager = new ShadowDOMManager();
|
|
10970
10989
|
const videoManager = new VideoManager();
|
|
@@ -11215,7 +11234,7 @@ const SaltfishPlayer$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.de
|
|
|
11215
11234
|
__proto__: null,
|
|
11216
11235
|
SaltfishPlayer
|
|
11217
11236
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
11218
|
-
const version = "0.3.
|
|
11237
|
+
const version = "0.3.3";
|
|
11219
11238
|
const packageJson = {
|
|
11220
11239
|
version
|
|
11221
11240
|
};
|