@fairfox/polly 0.67.0 → 0.69.0

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/src/mesh.js CHANGED
@@ -1419,13 +1419,13 @@ class MeshSignalingClient {
1419
1419
 
1420
1420
  // src/shared/lib/mesh-state.ts
1421
1421
  import {
1422
- Automerge,
1422
+ Automerge as Automerge3,
1423
1423
  interpretAsDocumentId
1424
1424
  } from "@automerge/automerge-repo/slim";
1425
1425
  import nacl3 from "tweetnacl";
1426
1426
 
1427
1427
  // src/shared/lib/crdt-specialised.ts
1428
- import { Counter, updateText } from "@automerge/automerge-repo/slim";
1428
+ import { Automerge, Counter, updateText } from "@automerge/automerge-repo/slim";
1429
1429
  import { effect, signal } from "@preact/signals";
1430
1430
 
1431
1431
  // src/shared/lib/migrate-primitive.ts
@@ -1650,6 +1650,14 @@ function createSpecialisedPrimitive(config) {
1650
1650
  loaded,
1651
1651
  get handle() {
1652
1652
  return currentHandle;
1653
+ },
1654
+ get changeCount() {
1655
+ if (!currentHandle)
1656
+ return;
1657
+ const doc = currentHandle.doc();
1658
+ if (!doc)
1659
+ return;
1660
+ return Automerge.getAllChanges(doc).length;
1653
1661
  }
1654
1662
  };
1655
1663
  }
@@ -1720,6 +1728,7 @@ function $crdtList(key, initialValue, options) {
1720
1728
  }
1721
1729
 
1722
1730
  // src/shared/lib/crdt-state.ts
1731
+ import { Automerge as Automerge2 } from "@automerge/automerge-repo/slim";
1723
1732
  import { effect as effect2, signal as signal2 } from "@preact/signals";
1724
1733
  function $crdtState(options) {
1725
1734
  if (migrationRegistry.isMarked(options.key, options.primitive)) {
@@ -1853,6 +1862,14 @@ function $crdtState(options) {
1853
1862
  loaded,
1854
1863
  get handle() {
1855
1864
  return currentHandle;
1865
+ },
1866
+ get changeCount() {
1867
+ if (!currentHandle)
1868
+ return;
1869
+ const doc = currentHandle.doc();
1870
+ if (!doc)
1871
+ return;
1872
+ return Automerge2.getAllChanges(doc).length;
1856
1873
  }
1857
1874
  };
1858
1875
  }
@@ -2084,17 +2101,17 @@ function deriveSeedActor(documentId) {
2084
2101
  function seedDocumentBytes(documentId, initialDoc) {
2085
2102
  const disable = typeof process !== "undefined" && process.env?.["POLLY_113_DISABLE_FIX"] === "1";
2086
2103
  if (disable) {
2087
- return Automerge.save(Automerge.from(initialDoc));
2104
+ return Automerge3.save(Automerge3.from(initialDoc));
2088
2105
  }
2089
2106
  const actor = deriveSeedActor(documentId);
2090
- const empty = Automerge.init({ actor });
2091
- const seeded = Automerge.change(empty, { time: 0 }, (d) => {
2107
+ const empty = Automerge3.init({ actor });
2108
+ const seeded = Automerge3.change(empty, { time: 0 }, (d) => {
2092
2109
  const source = initialDoc;
2093
2110
  for (const key of Object.keys(source)) {
2094
2111
  d[key] = source[key];
2095
2112
  }
2096
2113
  });
2097
- return Automerge.save(seeded);
2114
+ return Automerge3.save(seeded);
2098
2115
  }
2099
2116
  async function loadOrSeed(repo, documentId, initialDoc, docIdString, setExitReason) {
2100
2117
  const loadPromise = repo.storageSubsystem?.loadDoc(documentId);
@@ -3965,4 +3982,4 @@ export {
3965
3982
  $meshCounter
3966
3983
  };
3967
3984
 
3968
- //# debugId=4774A427A7ED246964756E2164756E21
3985
+ //# debugId=516309C916BB154F64756E2164756E21