@mmstack/primitives 22.6.0 → 22.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmstack/primitives",
3
- "version": "22.6.0",
3
+ "version": "22.6.1",
4
4
  "keywords": [
5
5
  "angular",
6
6
  "signals",
@@ -2283,7 +2283,7 @@ type PointerDragState = {
2283
2283
  /**
2284
2284
  * The element the gesture started on: the `handleSelector` match when one is
2285
2285
  * set (so a single delegated listener can tell which child started the drag),
2286
- * otherwise the listener's element. `null` when idle.
2286
+ * otherwise the pressed element itself (`event.target`). `null` when idle.
2287
2287
  */
2288
2288
  origin: HTMLElement | null;
2289
2289
  /**
@@ -3498,6 +3498,23 @@ type MaybePromise<T> = T | Promise<T>;
3498
3498
  * del: (k) => table.delete(k),
3499
3499
  * };
3500
3500
  * ```
3501
+ *
3502
+ * The backend is also the seam for cross-cutting storage concerns like encryption: wrap any
3503
+ * backend in a decorator (get/set may be async, so WebCrypto fits here — `serialize` is sync
3504
+ * by design and is for shape, not for the storage medium). Versioning and migration still work
3505
+ * because the version envelope is inspected on what the backend RETURNS, i.e. after decryption:
3506
+ *
3507
+ * ```ts
3508
+ * const encrypted = (inner: AsyncStore, cipher: MyCipher): AsyncStore => ({
3509
+ * get: async (k) => {
3510
+ * const raw = await inner.get(k);
3511
+ * return raw === undefined ? undefined : cipher.decrypt(raw);
3512
+ * },
3513
+ * set: async (k, v) => inner.set(k, await cipher.encrypt(v)),
3514
+ * del: (k) => inner.del(k),
3515
+ * });
3516
+ * providePersistedStoreOptions({ store: encrypted(idbKeyval, cipher) });
3517
+ * ```
3501
3518
  */
3502
3519
  type AsyncStore = {
3503
3520
  get(key: string): MaybePromise<unknown>;