@dabble/patches 0.8.10 → 0.8.11

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.
@@ -16,7 +16,7 @@ import './BranchClientStore.js';
16
16
  * - docs<{ docId: string; committedRev: number; deleted?: boolean }> (primary key: docId) [shared with OT]
17
17
  * - snapshots<{ docId: string; rev: number; state: any }> (primary key: docId) [shared with OT]
18
18
  * - committedOps<{ docId: string; op: string; path: string; from?: string; value?: any }> (primary key: [docId, path])
19
- * - pendingOps<{ docId: string; path: string; op: string; ts: number; value: any }> (primary key: [docId, path])
19
+ * - pendingOps<{ docId: string; path: string; op: string; ts: number; value: any; soft?: boolean }> (primary key: [docId, path])
20
20
  * - sendingChanges<{ docId: string; change: Change }> (primary key: docId)
21
21
  *
22
22
  * This store manages field-level operations for LWW conflict resolution:
@@ -109,7 +109,8 @@ class LWWIndexedDBStore {
109
109
  op: op.op,
110
110
  path: op.path,
111
111
  value: op.value,
112
- ts: op.ts
112
+ ts: op.ts,
113
+ ...op.soft ? { soft: true } : void 0
113
114
  }));
114
115
  state = applyPatch(state, pendingOps2, { partial: true });
115
116
  }
@@ -188,7 +189,8 @@ class LWWIndexedDBStore {
188
189
  op: op.op,
189
190
  path: op.path,
190
191
  value: op.value,
191
- ts: op.ts
192
+ ts: op.ts,
193
+ ...op.soft ? { soft: true } : void 0
192
194
  }));
193
195
  }
194
196
  async savePendingOps(docId, ops, pathsToDelete) {
@@ -211,7 +213,8 @@ class LWWIndexedDBStore {
211
213
  path: op.path,
212
214
  op: op.op,
213
215
  ts: op.ts ?? Date.now(),
214
- value: op.value
216
+ value: op.value,
217
+ ...op.soft ? { soft: true } : void 0
215
218
  })
216
219
  )
217
220
  );
@@ -285,7 +288,8 @@ class LWWIndexedDBStore {
285
288
  op: op.op,
286
289
  path: op.path,
287
290
  value: op.value,
288
- ts: op.ts
291
+ ts: op.ts,
292
+ ...op.soft ? { soft: true } : void 0
289
293
  }));
290
294
  return [createChange(baseRev, baseRev + 1, opsArray)];
291
295
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dabble/patches",
3
- "version": "0.8.10",
3
+ "version": "0.8.11",
4
4
  "description": "Immutable JSON Patch implementation based on RFC 6902 supporting operational transformation and last-writer-wins",
5
5
  "author": "Jacob Wright <jacwright@gmail.com>",
6
6
  "bugs": {