@yorkie-js/react 0.6.27 → 0.6.28

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.
@@ -7086,6 +7086,10 @@ const _DeactivateClientRequest = class _DeactivateClientRequest extends Message
7086
7086
  * @generated from field: string client_id = 1;
7087
7087
  */
7088
7088
  __publicField(this, "clientId", "");
7089
+ /**
7090
+ * @generated from field: bool synchronous = 2;
7091
+ */
7092
+ __publicField(this, "synchronous", false);
7089
7093
  proto3.util.initPartial(data, this);
7090
7094
  }
7091
7095
  static fromBinary(bytes, options) {
@@ -7110,6 +7114,13 @@ __publicField(_DeactivateClientRequest, "fields", proto3.util.newFieldList(() =>
7110
7114
  kind: "scalar",
7111
7115
  T: 9
7112
7116
  /* ScalarType.STRING */
7117
+ },
7118
+ {
7119
+ no: 2,
7120
+ name: "synchronous",
7121
+ kind: "scalar",
7122
+ T: 8
7123
+ /* ScalarType.BOOL */
7113
7124
  }
7114
7125
  ]));
7115
7126
  let DeactivateClientRequest = _DeactivateClientRequest;
@@ -21372,6 +21383,22 @@ class Document {
21372
21383
  const p = this.presences.get(this.changeID.getActorID());
21373
21384
  return p ? deepcopy(p) : {};
21374
21385
  }
21386
+ /**
21387
+ * `getOthersPresences` returns the presences of all other clients.
21388
+ */
21389
+ getOthersPresences() {
21390
+ const others = [];
21391
+ const myClientID = this.changeID.getActorID();
21392
+ for (const clientID of this.onlineClients) {
21393
+ if (clientID !== myClientID && this.presences.has(clientID)) {
21394
+ others.push({
21395
+ clientID,
21396
+ presence: deepcopy(this.presences.get(clientID))
21397
+ });
21398
+ }
21399
+ }
21400
+ return others;
21401
+ }
21375
21402
  /**
21376
21403
  * `getPresence` returns the presence of the given clientID.
21377
21404
  */
@@ -21383,16 +21410,6 @@ class Document {
21383
21410
  const p = this.presences.get(clientID);
21384
21411
  return p ? deepcopy(p) : void 0;
21385
21412
  }
21386
- /**
21387
- * `getPresenceForTest` returns the presence of the given clientID
21388
- * regardless of whether the client is online or not.
21389
- *
21390
- * @internal
21391
- */
21392
- getPresenceForTest(clientID) {
21393
- const p = this.presences.get(clientID);
21394
- return p ? deepcopy(p) : void 0;
21395
- }
21396
21413
  /**
21397
21414
  * `getPresences` returns the presences of online clients.
21398
21415
  */
@@ -21412,6 +21429,16 @@ class Document {
21412
21429
  }
21413
21430
  return presences;
21414
21431
  }
21432
+ /**
21433
+ * `getPresenceForTest` returns the presence of the given clientID
21434
+ * regardless of whether the client is online or not.
21435
+ *
21436
+ * @internal
21437
+ */
21438
+ getPresenceForTest(clientID) {
21439
+ const p = this.presences.get(clientID);
21440
+ return p ? deepcopy(p) : void 0;
21441
+ }
21415
21442
  /**
21416
21443
  * `getSelfForTest` returns the client that has attached this document.
21417
21444
  *
@@ -21686,7 +21713,7 @@ function createAuthInterceptor(apiKey, token) {
21686
21713
  };
21687
21714
  }
21688
21715
  const name$1 = "@yorkie-js/sdk";
21689
- const version$1 = "0.6.27";
21716
+ const version$1 = "0.6.28";
21690
21717
  const pkg$1 = {
21691
21718
  name: name$1,
21692
21719
  version: version$1
@@ -21839,15 +21866,20 @@ class Client {
21839
21866
  * immediately using `fetch` with the `keepalive` option enabled. This is
21840
21867
  * useful for ensuring the deactivation request completes even if the page is
21841
21868
  * being unloaded, such as in `beforeunload` or `unload` event listeners.
21869
+ * If synchronous is true, the server will wait for all pending operations to
21870
+ * complete before deactivating.
21842
21871
  */
21843
- deactivate(options = { keepalive: false }) {
21872
+ deactivate(options = { keepalive: false, synchronous: false }) {
21844
21873
  if (this.status === "deactivated") {
21845
21874
  return Promise.resolve();
21846
21875
  }
21847
21876
  const task = async () => {
21848
21877
  try {
21849
21878
  await this.rpcClient.deactivateClient(
21850
- { clientId: this.id },
21879
+ {
21880
+ clientId: this.id,
21881
+ synchronous: options.synchronous
21882
+ },
21851
21883
  { headers: { "x-shard-key": `${this.apiKey}/${this.key}` } }
21852
21884
  );
21853
21885
  this.deactivateInternal();
@@ -22577,7 +22609,7 @@ if (typeof globalThis !== "undefined") {
22577
22609
  };
22578
22610
  }
22579
22611
  const name = "@yorkie-js/react";
22580
- const version = "0.6.27";
22612
+ const version = "0.6.28";
22581
22613
  const pkg = {
22582
22614
  name,
22583
22615
  version