@liveblocks/core 1.2.4 → 1.3.1

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/index.js CHANGED
@@ -1,6 +1,12 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/version.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ // src/version.ts
2
8
  var PKG_NAME = "@liveblocks/core";
3
- var PKG_VERSION = "1.2.4";
9
+ var PKG_VERSION = "1.3.1";
4
10
  var PKG_FORMAT = "cjs";
5
11
 
6
12
  // src/dupe-detection.ts
@@ -150,6 +156,13 @@ function makeEventSource() {
150
156
  }
151
157
 
152
158
  // src/lib/fancy-console.ts
159
+ var fancy_console_exports = {};
160
+ __export(fancy_console_exports, {
161
+ error: () => error2,
162
+ errorWithTitle: () => errorWithTitle,
163
+ warn: () => warn,
164
+ warnWithTitle: () => warnWithTitle
165
+ });
153
166
  var badge = "background:#0e0d12;border-radius:9999px;color:#fff;padding:3px 7px;font-family:sans-serif;font-weight:600;";
154
167
  var bold = "font-weight:600";
155
168
  function wrap(method) {
@@ -624,6 +637,11 @@ var ServerMsgCode = /* @__PURE__ */ ((ServerMsgCode2) => {
624
637
  ServerMsgCode2[ServerMsgCode2["UPDATE_STORAGE"] = 201] = "UPDATE_STORAGE";
625
638
  ServerMsgCode2[ServerMsgCode2["REJECT_STORAGE_OP"] = 299] = "REJECT_STORAGE_OP";
626
639
  ServerMsgCode2[ServerMsgCode2["UPDATE_YDOC"] = 300] = "UPDATE_YDOC";
640
+ ServerMsgCode2[ServerMsgCode2["THREAD_CREATED"] = 400] = "THREAD_CREATED";
641
+ ServerMsgCode2[ServerMsgCode2["THREAD_METADATA_UPDATED"] = 401] = "THREAD_METADATA_UPDATED";
642
+ ServerMsgCode2[ServerMsgCode2["COMMENT_CREATED"] = 402] = "COMMENT_CREATED";
643
+ ServerMsgCode2[ServerMsgCode2["COMMENT_EDITED"] = 403] = "COMMENT_EDITED";
644
+ ServerMsgCode2[ServerMsgCode2["COMMENT_DELETED"] = 404] = "COMMENT_DELETED";
627
645
  return ServerMsgCode2;
628
646
  })(ServerMsgCode || {});
629
647
 
@@ -1152,10 +1170,10 @@ function createConnectionStateMachine(delegates, options) {
1152
1170
  };
1153
1171
  }
1154
1172
  var ManagedSocket = class {
1155
- constructor(delegates, enableDebugLogging = false) {
1173
+ constructor(delegates, enableDebugLogging = false, waitForActorId = true) {
1156
1174
  const { machine, events, cleanups } = createConnectionStateMachine(
1157
1175
  delegates,
1158
- { waitForActorId: true, enableDebugLogging }
1176
+ { waitForActorId, enableDebugLogging }
1159
1177
  );
1160
1178
  this.machine = machine;
1161
1179
  this.events = events;
@@ -1237,6 +1255,9 @@ var ManagedSocket = class {
1237
1255
  function canWriteStorage(scopes) {
1238
1256
  return scopes.includes("room:write" /* Write */);
1239
1257
  }
1258
+ function canComment(scopes) {
1259
+ return scopes.includes("comments:write" /* CommentsWrite */) || scopes.includes("room:write" /* Write */);
1260
+ }
1240
1261
  function isValidAuthTokenPayload(data) {
1241
1262
  return isPlainObject(data) && (data.k === "acc" /* ACCESS_TOKEN */ || data.k === "id" /* ID_TOKEN */ || data.k === "sec-legacy" /* SECRET_LEGACY */);
1242
1263
  }
@@ -1647,6 +1668,149 @@ function errorIf(condition, message) {
1647
1668
  }
1648
1669
  }
1649
1670
 
1671
+ // src/comments/index.ts
1672
+ function getAuthBearerHeaderFromAuthValue(authValue) {
1673
+ if (authValue.type === "public") {
1674
+ return authValue.publicApiKey;
1675
+ } else {
1676
+ return authValue.token.raw;
1677
+ }
1678
+ }
1679
+ function createCommentsApi(roomId, getAuthValue, { serverEndpoint }) {
1680
+ async function fetchJson(endpoint, options) {
1681
+ const response = await fetchApi(roomId, endpoint, options);
1682
+ if (!response.ok) {
1683
+ if (response.status >= 400 && response.status < 600) {
1684
+ let errorMessage = "";
1685
+ try {
1686
+ const errorBody = await response.json();
1687
+ errorMessage = errorBody.message;
1688
+ } catch (error3) {
1689
+ errorMessage = response.statusText;
1690
+ }
1691
+ throw new Error(
1692
+ `Request failed with status ${response.status}: ${errorMessage}`
1693
+ );
1694
+ }
1695
+ }
1696
+ let body;
1697
+ try {
1698
+ body = await response.json();
1699
+ } catch (e3) {
1700
+ body = {};
1701
+ }
1702
+ return body;
1703
+ }
1704
+ async function fetchApi(roomId2, endpoint, options) {
1705
+ const authValue = await getAuthValue();
1706
+ const url = `${serverEndpoint}/c/rooms/${roomId2}${endpoint}`;
1707
+ return await fetch(url, {
1708
+ ...options,
1709
+ headers: {
1710
+ ..._optionalChain([options, 'optionalAccess', _43 => _43.headers]),
1711
+ Authorization: `Bearer ${getAuthBearerHeaderFromAuthValue(authValue)}`
1712
+ }
1713
+ });
1714
+ }
1715
+ async function getThreads() {
1716
+ const response = await fetchApi(roomId, "/threads");
1717
+ if (response.ok) {
1718
+ const json = await response.json();
1719
+ return json.data;
1720
+ } else if (response.status === 404) {
1721
+ return [];
1722
+ } else {
1723
+ throw new Error("There was an error while getting threads.");
1724
+ }
1725
+ }
1726
+ function createThread({
1727
+ metadata,
1728
+ body,
1729
+ commentId,
1730
+ threadId
1731
+ }) {
1732
+ return fetchJson("/threads", {
1733
+ method: "POST",
1734
+ headers: {
1735
+ "Content-Type": "application/json"
1736
+ },
1737
+ body: JSON.stringify({
1738
+ id: threadId,
1739
+ comment: {
1740
+ id: commentId,
1741
+ body
1742
+ },
1743
+ metadata
1744
+ })
1745
+ });
1746
+ }
1747
+ function editThreadMetadata({
1748
+ metadata,
1749
+ threadId
1750
+ }) {
1751
+ return fetchJson(
1752
+ `/threads/${threadId}/metadata`,
1753
+ {
1754
+ method: "POST",
1755
+ headers: {
1756
+ "Content-Type": "application/json"
1757
+ },
1758
+ body: JSON.stringify(metadata)
1759
+ }
1760
+ );
1761
+ }
1762
+ function createComment({
1763
+ threadId,
1764
+ commentId,
1765
+ body
1766
+ }) {
1767
+ return fetchJson(`/threads/${threadId}/comments`, {
1768
+ method: "POST",
1769
+ headers: {
1770
+ "Content-Type": "application/json"
1771
+ },
1772
+ body: JSON.stringify({
1773
+ id: commentId,
1774
+ body
1775
+ })
1776
+ });
1777
+ }
1778
+ function editComment({
1779
+ threadId,
1780
+ commentId,
1781
+ body
1782
+ }) {
1783
+ return fetchJson(
1784
+ `/threads/${threadId}/comments/${commentId}`,
1785
+ {
1786
+ method: "POST",
1787
+ headers: {
1788
+ "Content-Type": "application/json"
1789
+ },
1790
+ body: JSON.stringify({
1791
+ body
1792
+ })
1793
+ }
1794
+ );
1795
+ }
1796
+ async function deleteComment({
1797
+ threadId,
1798
+ commentId
1799
+ }) {
1800
+ await fetchJson(`/threads/${threadId}/comments/${commentId}`, {
1801
+ method: "DELETE"
1802
+ });
1803
+ }
1804
+ return {
1805
+ getThreads,
1806
+ createThread,
1807
+ editThreadMetadata,
1808
+ createComment,
1809
+ editComment,
1810
+ deleteComment
1811
+ };
1812
+ }
1813
+
1650
1814
  // src/lib/position.ts
1651
1815
  var MIN_CODE = 32;
1652
1816
  var MAX_CODE = 126;
@@ -2008,7 +2172,7 @@ var LiveRegister = class _LiveRegister extends AbstractCrdt {
2008
2172
  return [
2009
2173
  {
2010
2174
  type: 8 /* CREATE_REGISTER */,
2011
- opId: _optionalChain([pool, 'optionalAccess', _43 => _43.generateOpId, 'call', _44 => _44()]),
2175
+ opId: _optionalChain([pool, 'optionalAccess', _44 => _44.generateOpId, 'call', _45 => _45()]),
2012
2176
  id: this._id,
2013
2177
  parentId,
2014
2178
  parentKey,
@@ -2099,7 +2263,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
2099
2263
  const ops = [];
2100
2264
  const op = {
2101
2265
  id: this._id,
2102
- opId: _optionalChain([pool, 'optionalAccess', _45 => _45.generateOpId, 'call', _46 => _46()]),
2266
+ opId: _optionalChain([pool, 'optionalAccess', _46 => _46.generateOpId, 'call', _47 => _47()]),
2103
2267
  type: 2 /* CREATE_LIST */,
2104
2268
  parentId,
2105
2269
  parentKey
@@ -2367,7 +2531,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
2367
2531
  _applyInsertUndoRedo(op) {
2368
2532
  const { id, parentKey: key } = op;
2369
2533
  const child = creationOpToLiveNode(op);
2370
- if (_optionalChain([this, 'access', _47 => _47._pool, 'optionalAccess', _48 => _48.getNode, 'call', _49 => _49(id)]) !== void 0) {
2534
+ if (_optionalChain([this, 'access', _48 => _48._pool, 'optionalAccess', _49 => _49.getNode, 'call', _50 => _50(id)]) !== void 0) {
2371
2535
  return { modified: false };
2372
2536
  }
2373
2537
  child._attach(id, nn(this._pool));
@@ -2375,8 +2539,8 @@ var LiveList = class _LiveList extends AbstractCrdt {
2375
2539
  const existingItemIndex = this._indexOfPosition(key);
2376
2540
  let newKey = key;
2377
2541
  if (existingItemIndex !== -1) {
2378
- const before2 = _optionalChain([this, 'access', _50 => _50._items, 'access', _51 => _51[existingItemIndex], 'optionalAccess', _52 => _52._parentPos]);
2379
- const after2 = _optionalChain([this, 'access', _53 => _53._items, 'access', _54 => _54[existingItemIndex + 1], 'optionalAccess', _55 => _55._parentPos]);
2542
+ const before2 = _optionalChain([this, 'access', _51 => _51._items, 'access', _52 => _52[existingItemIndex], 'optionalAccess', _53 => _53._parentPos]);
2543
+ const after2 = _optionalChain([this, 'access', _54 => _54._items, 'access', _55 => _55[existingItemIndex + 1], 'optionalAccess', _56 => _56._parentPos]);
2380
2544
  newKey = makePosition(before2, after2);
2381
2545
  child._setParentLink(this, newKey);
2382
2546
  }
@@ -2391,7 +2555,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
2391
2555
  _applySetUndoRedo(op) {
2392
2556
  const { id, parentKey: key } = op;
2393
2557
  const child = creationOpToLiveNode(op);
2394
- if (_optionalChain([this, 'access', _56 => _56._pool, 'optionalAccess', _57 => _57.getNode, 'call', _58 => _58(id)]) !== void 0) {
2558
+ if (_optionalChain([this, 'access', _57 => _57._pool, 'optionalAccess', _58 => _58.getNode, 'call', _59 => _59(id)]) !== void 0) {
2395
2559
  return { modified: false };
2396
2560
  }
2397
2561
  this._unacknowledgedSets.set(key, nn(op.opId));
@@ -2513,7 +2677,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
2513
2677
  } else {
2514
2678
  this._items[existingItemIndex]._setParentLink(
2515
2679
  this,
2516
- makePosition(newKey, _optionalChain([this, 'access', _59 => _59._items, 'access', _60 => _60[existingItemIndex + 1], 'optionalAccess', _61 => _61._parentPos]))
2680
+ makePosition(newKey, _optionalChain([this, 'access', _60 => _60._items, 'access', _61 => _61[existingItemIndex + 1], 'optionalAccess', _62 => _62._parentPos]))
2517
2681
  );
2518
2682
  const previousIndex = this._items.indexOf(child);
2519
2683
  child._setParentLink(this, newKey);
@@ -2539,7 +2703,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
2539
2703
  if (existingItemIndex !== -1) {
2540
2704
  this._items[existingItemIndex]._setParentLink(
2541
2705
  this,
2542
- makePosition(newKey, _optionalChain([this, 'access', _62 => _62._items, 'access', _63 => _63[existingItemIndex + 1], 'optionalAccess', _64 => _64._parentPos]))
2706
+ makePosition(newKey, _optionalChain([this, 'access', _63 => _63._items, 'access', _64 => _64[existingItemIndex + 1], 'optionalAccess', _65 => _65._parentPos]))
2543
2707
  );
2544
2708
  }
2545
2709
  child._setParentLink(this, newKey);
@@ -2558,7 +2722,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
2558
2722
  if (existingItemIndex !== -1) {
2559
2723
  this._items[existingItemIndex]._setParentLink(
2560
2724
  this,
2561
- makePosition(newKey, _optionalChain([this, 'access', _65 => _65._items, 'access', _66 => _66[existingItemIndex + 1], 'optionalAccess', _67 => _67._parentPos]))
2725
+ makePosition(newKey, _optionalChain([this, 'access', _66 => _66._items, 'access', _67 => _67[existingItemIndex + 1], 'optionalAccess', _68 => _68._parentPos]))
2562
2726
  );
2563
2727
  }
2564
2728
  child._setParentLink(this, newKey);
@@ -2586,7 +2750,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
2586
2750
  if (existingItemIndex !== -1) {
2587
2751
  this._items[existingItemIndex]._setParentLink(
2588
2752
  this,
2589
- makePosition(newKey, _optionalChain([this, 'access', _68 => _68._items, 'access', _69 => _69[existingItemIndex + 1], 'optionalAccess', _70 => _70._parentPos]))
2753
+ makePosition(newKey, _optionalChain([this, 'access', _69 => _69._items, 'access', _70 => _70[existingItemIndex + 1], 'optionalAccess', _71 => _71._parentPos]))
2590
2754
  );
2591
2755
  }
2592
2756
  child._setParentLink(this, newKey);
@@ -2644,7 +2808,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
2644
2808
  * @param element The element to add to the end of the LiveList.
2645
2809
  */
2646
2810
  push(element) {
2647
- _optionalChain([this, 'access', _71 => _71._pool, 'optionalAccess', _72 => _72.assertStorageIsWritable, 'call', _73 => _73()]);
2811
+ _optionalChain([this, 'access', _72 => _72._pool, 'optionalAccess', _73 => _73.assertStorageIsWritable, 'call', _74 => _74()]);
2648
2812
  return this.insert(element, this.length);
2649
2813
  }
2650
2814
  /**
@@ -2653,7 +2817,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
2653
2817
  * @param index The index at which you want to insert the element.
2654
2818
  */
2655
2819
  insert(element, index) {
2656
- _optionalChain([this, 'access', _74 => _74._pool, 'optionalAccess', _75 => _75.assertStorageIsWritable, 'call', _76 => _76()]);
2820
+ _optionalChain([this, 'access', _75 => _75._pool, 'optionalAccess', _76 => _76.assertStorageIsWritable, 'call', _77 => _77()]);
2657
2821
  if (index < 0 || index > this._items.length) {
2658
2822
  throw new Error(
2659
2823
  `Cannot insert list item at index "${index}". index should be between 0 and ${this._items.length}`
@@ -2683,7 +2847,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
2683
2847
  * @param targetIndex The index where the element should be after moving.
2684
2848
  */
2685
2849
  move(index, targetIndex) {
2686
- _optionalChain([this, 'access', _77 => _77._pool, 'optionalAccess', _78 => _78.assertStorageIsWritable, 'call', _79 => _79()]);
2850
+ _optionalChain([this, 'access', _78 => _78._pool, 'optionalAccess', _79 => _79.assertStorageIsWritable, 'call', _80 => _80()]);
2687
2851
  if (targetIndex < 0) {
2688
2852
  throw new Error("targetIndex cannot be less than 0");
2689
2853
  }
@@ -2741,7 +2905,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
2741
2905
  * @param index The index of the element to delete
2742
2906
  */
2743
2907
  delete(index) {
2744
- _optionalChain([this, 'access', _80 => _80._pool, 'optionalAccess', _81 => _81.assertStorageIsWritable, 'call', _82 => _82()]);
2908
+ _optionalChain([this, 'access', _81 => _81._pool, 'optionalAccess', _82 => _82.assertStorageIsWritable, 'call', _83 => _83()]);
2745
2909
  if (index < 0 || index >= this._items.length) {
2746
2910
  throw new Error(
2747
2911
  `Cannot delete list item at index "${index}". index should be between 0 and ${this._items.length - 1}`
@@ -2774,7 +2938,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
2774
2938
  }
2775
2939
  }
2776
2940
  clear() {
2777
- _optionalChain([this, 'access', _83 => _83._pool, 'optionalAccess', _84 => _84.assertStorageIsWritable, 'call', _85 => _85()]);
2941
+ _optionalChain([this, 'access', _84 => _84._pool, 'optionalAccess', _85 => _85.assertStorageIsWritable, 'call', _86 => _86()]);
2778
2942
  if (this._pool) {
2779
2943
  const ops = [];
2780
2944
  const reverseOps = [];
@@ -2808,7 +2972,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
2808
2972
  }
2809
2973
  }
2810
2974
  set(index, item) {
2811
- _optionalChain([this, 'access', _86 => _86._pool, 'optionalAccess', _87 => _87.assertStorageIsWritable, 'call', _88 => _88()]);
2975
+ _optionalChain([this, 'access', _87 => _87._pool, 'optionalAccess', _88 => _88.assertStorageIsWritable, 'call', _89 => _89()]);
2812
2976
  if (index < 0 || index >= this._items.length) {
2813
2977
  throw new Error(
2814
2978
  `Cannot set list item at index "${index}". index should be between 0 and ${this._items.length - 1}`
@@ -2956,7 +3120,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
2956
3120
  _shiftItemPosition(index, key) {
2957
3121
  const shiftedPosition = makePosition(
2958
3122
  key,
2959
- this._items.length > index + 1 ? _optionalChain([this, 'access', _89 => _89._items, 'access', _90 => _90[index + 1], 'optionalAccess', _91 => _91._parentPos]) : void 0
3123
+ this._items.length > index + 1 ? _optionalChain([this, 'access', _90 => _90._items, 'access', _91 => _91[index + 1], 'optionalAccess', _92 => _92._parentPos]) : void 0
2960
3124
  );
2961
3125
  this._items[index]._setParentLink(this, shiftedPosition);
2962
3126
  }
@@ -3082,7 +3246,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
3082
3246
  const ops = [];
3083
3247
  const op = {
3084
3248
  id: this._id,
3085
- opId: _optionalChain([pool, 'optionalAccess', _92 => _92.generateOpId, 'call', _93 => _93()]),
3249
+ opId: _optionalChain([pool, 'optionalAccess', _93 => _93.generateOpId, 'call', _94 => _94()]),
3086
3250
  type: 7 /* CREATE_MAP */,
3087
3251
  parentId,
3088
3252
  parentKey
@@ -3229,7 +3393,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
3229
3393
  * @param value The value of the element to add. Should be serializable to JSON.
3230
3394
  */
3231
3395
  set(key, value) {
3232
- _optionalChain([this, 'access', _94 => _94._pool, 'optionalAccess', _95 => _95.assertStorageIsWritable, 'call', _96 => _96()]);
3396
+ _optionalChain([this, 'access', _95 => _95._pool, 'optionalAccess', _96 => _96.assertStorageIsWritable, 'call', _97 => _97()]);
3233
3397
  const oldValue = this._map.get(key);
3234
3398
  if (oldValue) {
3235
3399
  oldValue._detach();
@@ -3275,7 +3439,7 @@ var LiveMap = class _LiveMap extends AbstractCrdt {
3275
3439
  * @returns true if an element existed and has been removed, or false if the element does not exist.
3276
3440
  */
3277
3441
  delete(key) {
3278
- _optionalChain([this, 'access', _97 => _97._pool, 'optionalAccess', _98 => _98.assertStorageIsWritable, 'call', _99 => _99()]);
3442
+ _optionalChain([this, 'access', _98 => _98._pool, 'optionalAccess', _99 => _99.assertStorageIsWritable, 'call', _100 => _100()]);
3279
3443
  const item = this._map.get(key);
3280
3444
  if (item === void 0) {
3281
3445
  return false;
@@ -3449,7 +3613,7 @@ var LiveObject = class _LiveObject extends AbstractCrdt {
3449
3613
  if (this._id === void 0) {
3450
3614
  throw new Error("Cannot serialize item is not attached");
3451
3615
  }
3452
- const opId = _optionalChain([pool, 'optionalAccess', _100 => _100.generateOpId, 'call', _101 => _101()]);
3616
+ const opId = _optionalChain([pool, 'optionalAccess', _101 => _101.generateOpId, 'call', _102 => _102()]);
3453
3617
  const ops = [];
3454
3618
  const op = parentId !== void 0 && parentKey !== void 0 ? {
3455
3619
  type: 4 /* CREATE_OBJECT */,
@@ -3730,7 +3894,7 @@ var LiveObject = class _LiveObject extends AbstractCrdt {
3730
3894
  * @param value The value of the property to add
3731
3895
  */
3732
3896
  set(key, value) {
3733
- _optionalChain([this, 'access', _102 => _102._pool, 'optionalAccess', _103 => _103.assertStorageIsWritable, 'call', _104 => _104()]);
3897
+ _optionalChain([this, 'access', _103 => _103._pool, 'optionalAccess', _104 => _104.assertStorageIsWritable, 'call', _105 => _105()]);
3734
3898
  this.update({ [key]: value });
3735
3899
  }
3736
3900
  /**
@@ -3745,7 +3909,7 @@ var LiveObject = class _LiveObject extends AbstractCrdt {
3745
3909
  * @param key The key of the property to delete
3746
3910
  */
3747
3911
  delete(key) {
3748
- _optionalChain([this, 'access', _105 => _105._pool, 'optionalAccess', _106 => _106.assertStorageIsWritable, 'call', _107 => _107()]);
3912
+ _optionalChain([this, 'access', _106 => _106._pool, 'optionalAccess', _107 => _107.assertStorageIsWritable, 'call', _108 => _108()]);
3749
3913
  const keyAsString = key;
3750
3914
  const oldValue = this._map.get(keyAsString);
3751
3915
  if (oldValue === void 0) {
@@ -3798,7 +3962,7 @@ var LiveObject = class _LiveObject extends AbstractCrdt {
3798
3962
  * @param patch The object used to overrides properties
3799
3963
  */
3800
3964
  update(patch) {
3801
- _optionalChain([this, 'access', _108 => _108._pool, 'optionalAccess', _109 => _109.assertStorageIsWritable, 'call', _110 => _110()]);
3965
+ _optionalChain([this, 'access', _109 => _109._pool, 'optionalAccess', _110 => _110.assertStorageIsWritable, 'call', _111 => _111()]);
3802
3966
  if (this._pool === void 0 || this._id === void 0) {
3803
3967
  for (const key in patch) {
3804
3968
  const newValue = patch[key];
@@ -4190,19 +4354,6 @@ var ClientMsgCode = /* @__PURE__ */ ((ClientMsgCode2) => {
4190
4354
  return ClientMsgCode2;
4191
4355
  })(ClientMsgCode || {});
4192
4356
 
4193
- // src/lib/LegacyArray.ts
4194
- function asArrayWithLegacyMethods(arr) {
4195
- Object.defineProperty(arr, "count", {
4196
- value: arr.length,
4197
- enumerable: false
4198
- });
4199
- Object.defineProperty(arr, "toArray", {
4200
- value: () => arr,
4201
- enumerable: false
4202
- });
4203
- return freeze(arr);
4204
- }
4205
-
4206
4357
  // src/refs/ImmutableRef.ts
4207
4358
  function merge(target, patch) {
4208
4359
  let updated = false;
@@ -4249,6 +4400,7 @@ function makeUser(conn, presence) {
4249
4400
  id,
4250
4401
  info,
4251
4402
  canWrite,
4403
+ canComment: canComment(conn.scopes),
4252
4404
  isReadOnly: !canWrite,
4253
4405
  // Deprecated, kept for backward-compatibility
4254
4406
  presence
@@ -4275,7 +4427,7 @@ var OthersRef = class extends ImmutableRef {
4275
4427
  (connectionId) => this.getUser(Number(connectionId))
4276
4428
  )
4277
4429
  );
4278
- return asArrayWithLegacyMethods(users);
4430
+ return users;
4279
4431
  }
4280
4432
  clearOthers() {
4281
4433
  this._connections = /* @__PURE__ */ new Map();
@@ -4602,14 +4754,14 @@ function createRoom(options, config) {
4602
4754
  } else {
4603
4755
  batchUpdates(() => {
4604
4756
  addToUndoStack(reverse, doNotBatchUpdates);
4605
- context.redoStack = [];
4757
+ context.redoStack.length = 0;
4606
4758
  dispatchOps(ops);
4607
4759
  notify({ storageUpdates }, doNotBatchUpdates);
4608
4760
  });
4609
4761
  }
4610
4762
  },
4611
4763
  assertStorageIsWritable: () => {
4612
- const scopes = _optionalChain([context, 'access', _111 => _111.dynamicSessionInfo, 'access', _112 => _112.current, 'optionalAccess', _113 => _113.scopes]);
4764
+ const scopes = _optionalChain([context, 'access', _112 => _112.dynamicSessionInfo, 'access', _113 => _113.current, 'optionalAccess', _114 => _114.scopes]);
4613
4765
  if (scopes === void 0) {
4614
4766
  return;
4615
4767
  }
@@ -4636,19 +4788,20 @@ function createRoom(options, config) {
4636
4788
  history: makeEventSource(),
4637
4789
  storageDidLoad: makeEventSource(),
4638
4790
  storageStatus: makeEventSource(),
4639
- ydoc: makeEventSource()
4791
+ ydoc: makeEventSource(),
4792
+ comments: makeEventSource()
4640
4793
  };
4641
4794
  function sendMessages(messageOrMessages) {
4642
4795
  const message = JSON.stringify(messageOrMessages);
4643
4796
  if (config.unstable_fallbackToHTTP) {
4644
4797
  const size = new TextEncoder().encode(message).length;
4645
4798
  if (size > MAX_MESSAGE_SIZE && // TODO: support public api key auth in REST API
4646
- _optionalChain([managedSocket, 'access', _114 => _114.authValue, 'optionalAccess', _115 => _115.type]) === "secret" && config.httpSendEndpoint) {
4799
+ _optionalChain([managedSocket, 'access', _115 => _115.authValue, 'optionalAccess', _116 => _116.type]) === "secret" && config.httpSendEndpoint) {
4647
4800
  void httpSend(
4648
4801
  message,
4649
4802
  managedSocket.authValue.token.raw,
4650
4803
  config.httpSendEndpoint,
4651
- _optionalChain([config, 'access', _116 => _116.polyfills, 'optionalAccess', _117 => _117.fetch])
4804
+ _optionalChain([config, 'access', _117 => _117.polyfills, 'optionalAccess', _118 => _118.fetch])
4652
4805
  ).then((resp) => {
4653
4806
  if (!resp.ok && resp.status === 403) {
4654
4807
  managedSocket.reconnect();
@@ -4677,6 +4830,7 @@ function createRoom(options, config) {
4677
4830
  info: staticSession.userInfo,
4678
4831
  presence: myPresence,
4679
4832
  canWrite,
4833
+ canComment: canComment(dynamicSession.scopes),
4680
4834
  isReadOnly: !canWrite
4681
4835
  // Deprecated, kept for backward-compatibility
4682
4836
  };
@@ -4906,7 +5060,7 @@ function createRoom(options, config) {
4906
5060
  }
4907
5061
  context.myPresence.patch(patch);
4908
5062
  if (context.activeBatch) {
4909
- if (_optionalChain([options2, 'optionalAccess', _118 => _118.addToHistory])) {
5063
+ if (_optionalChain([options2, 'optionalAccess', _119 => _119.addToHistory])) {
4910
5064
  context.activeBatch.reverseOps.unshift({
4911
5065
  type: "presence",
4912
5066
  data: oldValues
@@ -4916,7 +5070,7 @@ function createRoom(options, config) {
4916
5070
  } else {
4917
5071
  flushNowOrSoon();
4918
5072
  batchUpdates(() => {
4919
- if (_optionalChain([options2, 'optionalAccess', _119 => _119.addToHistory])) {
5073
+ if (_optionalChain([options2, 'optionalAccess', _120 => _120.addToHistory])) {
4920
5074
  addToUndoStack(
4921
5075
  [{ type: "presence", data: oldValues }],
4922
5076
  doNotBatchUpdates
@@ -5093,7 +5247,7 @@ function createRoom(options, config) {
5093
5247
  const unacknowledgedOps = new Map(context.unacknowledgedOps);
5094
5248
  createOrUpdateRootFromMessage(message, doNotBatchUpdates);
5095
5249
  applyAndSendOps(unacknowledgedOps, doNotBatchUpdates);
5096
- _optionalChain([_resolveStoragePromise, 'optionalCall', _120 => _120()]);
5250
+ _optionalChain([_resolveStoragePromise, 'optionalCall', _121 => _121()]);
5097
5251
  notifyStorageStatus();
5098
5252
  eventHub.storageDidLoad.notify();
5099
5253
  break;
@@ -5116,7 +5270,7 @@ function createRoom(options, config) {
5116
5270
  if (process.env.NODE_ENV !== "production") {
5117
5271
  const traces = /* @__PURE__ */ new Set();
5118
5272
  for (const opId of message.opIds) {
5119
- const trace = _optionalChain([context, 'access', _121 => _121.opStackTraces, 'optionalAccess', _122 => _122.get, 'call', _123 => _123(opId)]);
5273
+ const trace = _optionalChain([context, 'access', _122 => _122.opStackTraces, 'optionalAccess', _123 => _123.get, 'call', _124 => _124(opId)]);
5120
5274
  if (trace) {
5121
5275
  traces.add(trace);
5122
5276
  }
@@ -5135,6 +5289,14 @@ ${Array.from(traces).join("\n\n")}`
5135
5289
  }
5136
5290
  break;
5137
5291
  }
5292
+ case 400 /* THREAD_CREATED */:
5293
+ case 401 /* THREAD_METADATA_UPDATED */:
5294
+ case 402 /* COMMENT_CREATED */:
5295
+ case 403 /* COMMENT_EDITED */:
5296
+ case 404 /* COMMENT_DELETED */: {
5297
+ eventHub.comments.notify(message);
5298
+ break;
5299
+ }
5138
5300
  }
5139
5301
  }
5140
5302
  notify(updates, doNotBatchUpdates);
@@ -5322,6 +5484,10 @@ ${Array.from(traces).join("\n\n")}`
5322
5484
  }
5323
5485
  flushNowOrSoon();
5324
5486
  }
5487
+ function clear() {
5488
+ context.undoStack.length = 0;
5489
+ context.redoStack.length = 0;
5490
+ }
5325
5491
  function batch(callback) {
5326
5492
  if (context.activeBatch) {
5327
5493
  return callback();
@@ -5346,7 +5512,7 @@ ${Array.from(traces).join("\n\n")}`
5346
5512
  addToUndoStack(currentBatch.reverseOps, doNotBatchUpdates);
5347
5513
  }
5348
5514
  if (currentBatch.ops.length > 0) {
5349
- context.redoStack = [];
5515
+ context.redoStack.length = 0;
5350
5516
  }
5351
5517
  if (currentBatch.ops.length > 0) {
5352
5518
  dispatchOps(currentBatch.ops);
@@ -5401,14 +5567,18 @@ ${Array.from(traces).join("\n\n")}`
5401
5567
  history: eventHub.history.observable,
5402
5568
  storageDidLoad: eventHub.storageDidLoad.observable,
5403
5569
  storageStatus: eventHub.storageStatus.observable,
5404
- ydoc: eventHub.ydoc.observable
5570
+ ydoc: eventHub.ydoc.observable,
5571
+ comments: eventHub.comments.observable
5405
5572
  };
5573
+ const commentsApi = createCommentsApi(config.roomId, delegates.authenticate, {
5574
+ serverEndpoint: "https://api.liveblocks.io/v2"
5575
+ });
5406
5576
  return Object.defineProperty(
5407
5577
  {
5408
5578
  /* NOTE: Exposing __internal here only to allow testing implementation details in unit tests */
5409
5579
  __internal: {
5410
5580
  get presenceBuffer() {
5411
- return deepClone(_nullishCoalesce(_optionalChain([context, 'access', _124 => _124.buffer, 'access', _125 => _125.presenceUpdates, 'optionalAccess', _126 => _126.data]), () => ( null)));
5581
+ return deepClone(_nullishCoalesce(_optionalChain([context, 'access', _125 => _125.buffer, 'access', _126 => _126.presenceUpdates, 'optionalAccess', _127 => _127.data]), () => ( null)));
5412
5582
  },
5413
5583
  // prettier-ignore
5414
5584
  get undoStack() {
@@ -5446,6 +5616,7 @@ ${Array.from(traces).join("\n\n")}`
5446
5616
  redo,
5447
5617
  canUndo,
5448
5618
  canRedo,
5619
+ clear,
5449
5620
  pause: pauseHistory,
5450
5621
  resume: resumeHistory
5451
5622
  },
@@ -5460,7 +5631,8 @@ ${Array.from(traces).join("\n\n")}`
5460
5631
  getSelf: () => self.current,
5461
5632
  // Presence
5462
5633
  getPresence: () => context.myPresence.current,
5463
- getOthers: () => context.others.current
5634
+ getOthers: () => context.others.current,
5635
+ ...commentsApi
5464
5636
  },
5465
5637
  // Explictly make the __internal field non-enumerable, to avoid aggressive
5466
5638
  // freezing when used with Immer
@@ -5539,7 +5711,7 @@ function makeClassicSubscribeFn(events) {
5539
5711
  }
5540
5712
  if (isLiveNode(first)) {
5541
5713
  const node = first;
5542
- if (_optionalChain([options, 'optionalAccess', _127 => _127.isDeep])) {
5714
+ if (_optionalChain([options, 'optionalAccess', _128 => _128.isDeep])) {
5543
5715
  const storageCallback = second;
5544
5716
  return subscribeToLiveStructureDeeply(node, storageCallback);
5545
5717
  } else {
@@ -5640,12 +5812,12 @@ function createClient(options) {
5640
5812
  createSocket: makeCreateSocketDelegateForRoom(
5641
5813
  roomId,
5642
5814
  getServerFromClientOptions(clientOptions),
5643
- _optionalChain([clientOptions, 'access', _128 => _128.polyfills, 'optionalAccess', _129 => _129.WebSocket])
5815
+ _optionalChain([clientOptions, 'access', _129 => _129.polyfills, 'optionalAccess', _130 => _130.WebSocket])
5644
5816
  ),
5645
5817
  authenticate: makeAuthDelegateForRoom(roomId, authManager)
5646
5818
  })),
5647
5819
  enableDebugLogging: clientOptions.enableDebugLogging,
5648
- unstable_batchedUpdates: _optionalChain([options2, 'optionalAccess', _130 => _130.unstable_batchedUpdates]),
5820
+ unstable_batchedUpdates: _optionalChain([options2, 'optionalAccess', _131 => _131.unstable_batchedUpdates]),
5649
5821
  liveblocksServer: getServerFromClientOptions(clientOptions),
5650
5822
  httpSendEndpoint: buildLiveblocksHttpSendEndpoint(
5651
5823
  clientOptions,
@@ -5660,7 +5832,7 @@ function createClient(options) {
5660
5832
  const shouldConnect = _nullishCoalesce(options2.shouldInitiallyConnect, () => ( true));
5661
5833
  if (shouldConnect) {
5662
5834
  if (typeof atob === "undefined") {
5663
- if (_optionalChain([clientOptions, 'access', _131 => _131.polyfills, 'optionalAccess', _132 => _132.atob]) === void 0) {
5835
+ if (_optionalChain([clientOptions, 'access', _132 => _132.polyfills, 'optionalAccess', _133 => _133.atob]) === void 0) {
5664
5836
  throw new Error(
5665
5837
  "You need to polyfill atob to use the client in your environment. Please follow the instructions at https://liveblocks.io/docs/errors/liveblocks-client/atob-polyfill"
5666
5838
  );
@@ -5943,12 +6115,12 @@ function legacy_patchImmutableNode(state, path, update) {
5943
6115
  }
5944
6116
  const newState = Object.assign({}, state);
5945
6117
  for (const key in update.updates) {
5946
- if (_optionalChain([update, 'access', _133 => _133.updates, 'access', _134 => _134[key], 'optionalAccess', _135 => _135.type]) === "update") {
6118
+ if (_optionalChain([update, 'access', _134 => _134.updates, 'access', _135 => _135[key], 'optionalAccess', _136 => _136.type]) === "update") {
5947
6119
  const val = update.node.get(key);
5948
6120
  if (val !== void 0) {
5949
6121
  newState[key] = lsonToJson(val);
5950
6122
  }
5951
- } else if (_optionalChain([update, 'access', _136 => _136.updates, 'access', _137 => _137[key], 'optionalAccess', _138 => _138.type]) === "delete") {
6123
+ } else if (_optionalChain([update, 'access', _137 => _137.updates, 'access', _138 => _138[key], 'optionalAccess', _139 => _139.type]) === "delete") {
5952
6124
  delete newState[key];
5953
6125
  }
5954
6126
  }
@@ -6009,12 +6181,12 @@ function legacy_patchImmutableNode(state, path, update) {
6009
6181
  }
6010
6182
  const newState = Object.assign({}, state);
6011
6183
  for (const key in update.updates) {
6012
- if (_optionalChain([update, 'access', _139 => _139.updates, 'access', _140 => _140[key], 'optionalAccess', _141 => _141.type]) === "update") {
6184
+ if (_optionalChain([update, 'access', _140 => _140.updates, 'access', _141 => _141[key], 'optionalAccess', _142 => _142.type]) === "update") {
6013
6185
  const value = update.node.get(key);
6014
6186
  if (value !== void 0) {
6015
6187
  newState[key] = lsonToJson(value);
6016
6188
  }
6017
- } else if (_optionalChain([update, 'access', _142 => _142.updates, 'access', _143 => _143[key], 'optionalAccess', _144 => _144.type]) === "delete") {
6189
+ } else if (_optionalChain([update, 'access', _143 => _143.updates, 'access', _144 => _144[key], 'optionalAccess', _145 => _145.type]) === "delete") {
6018
6190
  delete newState[key];
6019
6191
  }
6020
6192
  }
@@ -6085,6 +6257,222 @@ function shallow(a, b) {
6085
6257
  return shallowObj(a, b);
6086
6258
  }
6087
6259
 
6260
+ // src/lib/AsyncCache.ts
6261
+ var noop = () => {
6262
+ };
6263
+ function isShallowEqual(a, b) {
6264
+ if (a.isLoading !== b.isLoading || a.data === void 0 !== (b.data === void 0) || a.error === void 0 !== (b.error === void 0)) {
6265
+ return false;
6266
+ } else {
6267
+ return shallow(a.data, b.data) && shallow(a.error, b.error);
6268
+ }
6269
+ }
6270
+ function createCacheItem(key, defaultAsyncFunction, options) {
6271
+ let asyncFunction = defaultAsyncFunction;
6272
+ const context = {
6273
+ isInvalid: true
6274
+ };
6275
+ let state = { isLoading: false };
6276
+ let previousState = { isLoading: false };
6277
+ const eventSource2 = makeEventSource();
6278
+ function notify() {
6279
+ const isEqual = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _146 => _146.isStateEqual]), () => ( isShallowEqual));
6280
+ if (!isEqual(previousState, state)) {
6281
+ previousState = state;
6282
+ eventSource2.notify(state);
6283
+ }
6284
+ }
6285
+ async function resolve() {
6286
+ if (!context.promise) {
6287
+ return;
6288
+ }
6289
+ try {
6290
+ const data = await context.promise;
6291
+ context.isInvalid = false;
6292
+ state = {
6293
+ isLoading: false,
6294
+ data
6295
+ };
6296
+ } catch (error3) {
6297
+ state = {
6298
+ isLoading: false,
6299
+ data: state.data,
6300
+ error: error3
6301
+ };
6302
+ }
6303
+ context.promise = void 0;
6304
+ notify();
6305
+ }
6306
+ async function revalidate() {
6307
+ context.isInvalid = true;
6308
+ return get();
6309
+ }
6310
+ async function get() {
6311
+ if (context.isInvalid) {
6312
+ if (!context.promise) {
6313
+ context.isInvalid = true;
6314
+ context.promise = asyncFunction(key);
6315
+ state = { isLoading: true, data: state.data };
6316
+ notify();
6317
+ }
6318
+ await resolve();
6319
+ }
6320
+ return getState();
6321
+ }
6322
+ function getState() {
6323
+ return state;
6324
+ }
6325
+ function setAsyncFunction(overrideAsyncFunction) {
6326
+ asyncFunction = overrideAsyncFunction;
6327
+ }
6328
+ return {
6329
+ ...eventSource2.observable,
6330
+ setAsyncFunction,
6331
+ get,
6332
+ getState,
6333
+ revalidate
6334
+ };
6335
+ }
6336
+ function createAsyncCache(asyncFunction, options) {
6337
+ const cache = /* @__PURE__ */ new Map();
6338
+ function create(key, overrideAsyncFunction) {
6339
+ let cacheItem = cache.get(key);
6340
+ if (cacheItem) {
6341
+ if (overrideAsyncFunction) {
6342
+ cacheItem.setAsyncFunction(overrideAsyncFunction);
6343
+ }
6344
+ return cacheItem;
6345
+ }
6346
+ cacheItem = createCacheItem(
6347
+ key,
6348
+ _nullishCoalesce(overrideAsyncFunction, () => ( asyncFunction)),
6349
+ options
6350
+ );
6351
+ cache.set(key, cacheItem);
6352
+ return cacheItem;
6353
+ }
6354
+ function get(key) {
6355
+ return create(key).get();
6356
+ }
6357
+ function getState(key) {
6358
+ return _optionalChain([cache, 'access', _147 => _147.get, 'call', _148 => _148(key), 'optionalAccess', _149 => _149.getState, 'call', _150 => _150()]);
6359
+ }
6360
+ function revalidate(key) {
6361
+ return create(key).revalidate();
6362
+ }
6363
+ function subscribe(key, callback) {
6364
+ return _nullishCoalesce(create(key).subscribe(callback), () => ( noop));
6365
+ }
6366
+ function subscribeOnce(key, callback) {
6367
+ return _nullishCoalesce(create(key).subscribeOnce(callback), () => ( noop));
6368
+ }
6369
+ function has(key) {
6370
+ return cache.has(key);
6371
+ }
6372
+ function clear() {
6373
+ cache.clear();
6374
+ }
6375
+ return {
6376
+ create,
6377
+ get,
6378
+ getState,
6379
+ revalidate,
6380
+ subscribe,
6381
+ subscribeOnce,
6382
+ has,
6383
+ clear
6384
+ };
6385
+ }
6386
+
6387
+ // src/lib/Poller.ts
6388
+ function makePoller(callback) {
6389
+ let context = {
6390
+ state: "stopped",
6391
+ timeoutHandle: null,
6392
+ interval: null,
6393
+ lastScheduledAt: null,
6394
+ remainingInterval: null
6395
+ };
6396
+ function poll() {
6397
+ if (context.state === "running") {
6398
+ schedule(context.interval);
6399
+ }
6400
+ void callback();
6401
+ }
6402
+ function schedule(interval) {
6403
+ context = {
6404
+ state: "running",
6405
+ interval: context.state !== "stopped" ? context.interval : interval,
6406
+ lastScheduledAt: performance.now(),
6407
+ timeoutHandle: setTimeout(poll, interval),
6408
+ remainingInterval: null
6409
+ };
6410
+ }
6411
+ function scheduleRemaining(remaining) {
6412
+ if (context.state !== "paused") {
6413
+ return;
6414
+ }
6415
+ context = {
6416
+ state: "running",
6417
+ interval: context.interval,
6418
+ lastScheduledAt: context.lastScheduledAt,
6419
+ timeoutHandle: setTimeout(poll, remaining),
6420
+ remainingInterval: null
6421
+ };
6422
+ }
6423
+ function start(interval) {
6424
+ if (context.state === "running") {
6425
+ return;
6426
+ }
6427
+ schedule(interval);
6428
+ }
6429
+ function restart(interval) {
6430
+ stop();
6431
+ start(interval);
6432
+ }
6433
+ function pause() {
6434
+ if (context.state !== "running") {
6435
+ return;
6436
+ }
6437
+ clearTimeout(context.timeoutHandle);
6438
+ context = {
6439
+ state: "paused",
6440
+ interval: context.interval,
6441
+ lastScheduledAt: context.lastScheduledAt,
6442
+ timeoutHandle: null,
6443
+ remainingInterval: context.interval - (performance.now() - context.lastScheduledAt)
6444
+ };
6445
+ }
6446
+ function resume() {
6447
+ if (context.state !== "paused") {
6448
+ return;
6449
+ }
6450
+ scheduleRemaining(context.remainingInterval);
6451
+ }
6452
+ function stop() {
6453
+ if (context.state === "stopped") {
6454
+ return;
6455
+ }
6456
+ if (context.timeoutHandle) {
6457
+ clearTimeout(context.timeoutHandle);
6458
+ }
6459
+ context = {
6460
+ state: "stopped",
6461
+ interval: null,
6462
+ lastScheduledAt: null,
6463
+ timeoutHandle: null,
6464
+ remainingInterval: null
6465
+ };
6466
+ }
6467
+ return {
6468
+ start,
6469
+ restart,
6470
+ pause,
6471
+ resume,
6472
+ stop
6473
+ };
6474
+ }
6475
+
6088
6476
  // src/index.ts
6089
6477
  detectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);
6090
6478
 
@@ -6123,5 +6511,9 @@ detectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);
6123
6511
 
6124
6512
 
6125
6513
 
6126
- exports.ClientMsgCode = ClientMsgCode; exports.CrdtType = CrdtType; exports.LiveList = LiveList; exports.LiveMap = LiveMap; exports.LiveObject = LiveObject; exports.OpCode = OpCode; exports.ServerMsgCode = ServerMsgCode; exports.WebsocketCloseCodes = WebsocketCloseCodes; exports.asArrayWithLegacyMethods = asArrayWithLegacyMethods; exports.asPos = asPos; exports.assert = assert; exports.assertNever = assertNever; exports.b64decode = b64decode; exports.createClient = createClient; exports.deprecate = deprecate; exports.deprecateIf = deprecateIf; exports.detectDupes = detectDupes; exports.errorIf = errorIf; exports.freeze = freeze; exports.isChildCrdt = isChildCrdt; exports.isJsonArray = isJsonArray; exports.isJsonObject = isJsonObject; exports.isJsonScalar = isJsonScalar; exports.isPlainObject = isPlainObject; exports.isRootCrdt = isRootCrdt; exports.legacy_patchImmutableObject = legacy_patchImmutableObject; exports.lsonToJson = lsonToJson; exports.makePosition = makePosition; exports.nn = nn; exports.patchLiveObjectKey = patchLiveObjectKey; exports.shallow = shallow; exports.throwUsageError = throwUsageError; exports.toPlainLson = toPlainLson; exports.tryParseJson = tryParseJson; exports.withTimeout = withTimeout;
6514
+
6515
+
6516
+
6517
+
6518
+ exports.ClientMsgCode = ClientMsgCode; exports.CrdtType = CrdtType; exports.LiveList = LiveList; exports.LiveMap = LiveMap; exports.LiveObject = LiveObject; exports.OpCode = OpCode; exports.ServerMsgCode = ServerMsgCode; exports.WebsocketCloseCodes = WebsocketCloseCodes; exports.asPos = asPos; exports.assert = assert; exports.assertNever = assertNever; exports.b64decode = b64decode; exports.console = fancy_console_exports; exports.createAsyncCache = createAsyncCache; exports.createClient = createClient; exports.createCommentsApi = createCommentsApi; exports.deprecate = deprecate; exports.deprecateIf = deprecateIf; exports.detectDupes = detectDupes; exports.errorIf = errorIf; exports.freeze = freeze; exports.isChildCrdt = isChildCrdt; exports.isJsonArray = isJsonArray; exports.isJsonObject = isJsonObject; exports.isJsonScalar = isJsonScalar; exports.isPlainObject = isPlainObject; exports.isRootCrdt = isRootCrdt; exports.legacy_patchImmutableObject = legacy_patchImmutableObject; exports.lsonToJson = lsonToJson; exports.makeEventSource = makeEventSource; exports.makePoller = makePoller; exports.makePosition = makePosition; exports.nn = nn; exports.patchLiveObjectKey = patchLiveObjectKey; exports.shallow = shallow; exports.throwUsageError = throwUsageError; exports.toPlainLson = toPlainLson; exports.tryParseJson = tryParseJson; exports.withTimeout = withTimeout;
6127
6519
  //# sourceMappingURL=index.js.map