@hocuspocus/provider 1.0.0-alpha.26 → 1.0.0-alpha.27

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.
@@ -2057,6 +2057,7 @@ class HocuspocusProvider extends EventEmitter {
2057
2057
  };
2058
2058
  this.connectionAttempt = null;
2059
2059
  this.setOptions(options);
2060
+ this.options.document = options.document ? options.document : new Y__namespace.Doc();
2060
2061
  this.options.awareness = options.awareness ? options.awareness : new Awareness(this.document);
2061
2062
  this.options.WebSocketPolyfill = options.WebSocketPolyfill ? options.WebSocketPolyfill : WebSocket;
2062
2063
  this.on('open', this.options.onOpen);
@@ -2408,6 +2409,22 @@ class HocuspocusProvider extends EventEmitter {
2408
2409
  }
2409
2410
  }
2410
2411
 
2412
+ class HocuspocusCloudProvider extends HocuspocusProvider {
2413
+ constructor(options) {
2414
+ if (!options.url) {
2415
+ options.url = 'wss://connect.hocuspocus.cloud';
2416
+ }
2417
+ if (options.key) {
2418
+ if (!options.parameters) {
2419
+ options.parameters = {};
2420
+ }
2421
+ options.parameters.key = options.key;
2422
+ }
2423
+ super(options);
2424
+ }
2425
+ }
2426
+
2427
+ exports.HocuspocusCloudProvider = HocuspocusCloudProvider;
2411
2428
  exports.HocuspocusProvider = HocuspocusProvider;
2412
2429
  exports.awarenessStatesToArray = awarenessStatesToArray;
2413
2430
  //# sourceMappingURL=hocuspocus-provider.cjs.map