@buoy-gg/zustand 3.0.1 → 3.0.2

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.
Files changed (64) hide show
  1. package/lib/commonjs/index.js +98 -1
  2. package/lib/commonjs/preset.js +102 -1
  3. package/lib/commonjs/zustand/components/ZustandActionButton.js +116 -1
  4. package/lib/commonjs/zustand/components/ZustandDetailViewToggle.js +134 -1
  5. package/lib/commonjs/zustand/components/ZustandEventFilterView.js +291 -1
  6. package/lib/commonjs/zustand/components/ZustandIcon.js +35 -1
  7. package/lib/commonjs/zustand/components/ZustandModal.js +603 -1
  8. package/lib/commonjs/zustand/components/ZustandStateChangeItem.js +165 -1
  9. package/lib/commonjs/zustand/components/ZustandStateDetailContent.js +352 -1
  10. package/lib/commonjs/zustand/components/ZustandStateInfoView.js +508 -1
  11. package/lib/commonjs/zustand/components/ZustandStoreBrowser.js +323 -1
  12. package/lib/commonjs/zustand/components/index.js +73 -1
  13. package/lib/commonjs/zustand/hooks/index.js +12 -1
  14. package/lib/commonjs/zustand/hooks/useZustandStateChanges.js +92 -1
  15. package/lib/commonjs/zustand/index.js +99 -1
  16. package/lib/commonjs/zustand/sync/zustandSyncAdapter.js +48 -0
  17. package/lib/commonjs/zustand/utils/buoyZustandMiddleware.js +220 -1
  18. package/lib/commonjs/zustand/utils/index.js +31 -1
  19. package/lib/commonjs/zustand/utils/zustandStateStore.js +457 -1
  20. package/lib/module/index.js +85 -1
  21. package/lib/module/preset.js +98 -1
  22. package/lib/module/zustand/components/ZustandActionButton.js +112 -1
  23. package/lib/module/zustand/components/ZustandDetailViewToggle.js +129 -1
  24. package/lib/module/zustand/components/ZustandEventFilterView.js +287 -1
  25. package/lib/module/zustand/components/ZustandIcon.js +32 -1
  26. package/lib/module/zustand/components/ZustandModal.js +599 -1
  27. package/lib/module/zustand/components/ZustandStateChangeItem.js +161 -1
  28. package/lib/module/zustand/components/ZustandStateDetailContent.js +348 -1
  29. package/lib/module/zustand/components/ZustandStateInfoView.js +503 -1
  30. package/lib/module/zustand/components/ZustandStoreBrowser.js +319 -1
  31. package/lib/module/zustand/components/index.js +10 -1
  32. package/lib/module/zustand/hooks/index.js +3 -1
  33. package/lib/module/zustand/hooks/useZustandStateChanges.js +88 -1
  34. package/lib/module/zustand/index.js +12 -1
  35. package/lib/module/zustand/sync/zustandSyncAdapter.js +44 -0
  36. package/lib/module/zustand/utils/buoyZustandMiddleware.js +214 -1
  37. package/lib/module/zustand/utils/index.js +4 -1
  38. package/lib/module/zustand/utils/zustandStateStore.js +453 -1
  39. package/lib/typescript/index.d.ts +2 -1
  40. package/lib/typescript/index.d.ts.map +1 -0
  41. package/lib/typescript/preset.d.ts.map +1 -0
  42. package/lib/typescript/zustand/components/ZustandActionButton.d.ts.map +1 -0
  43. package/lib/typescript/zustand/components/ZustandDetailViewToggle.d.ts.map +1 -0
  44. package/lib/typescript/zustand/components/ZustandEventFilterView.d.ts.map +1 -0
  45. package/lib/typescript/zustand/components/ZustandIcon.d.ts.map +1 -0
  46. package/lib/typescript/zustand/components/ZustandModal.d.ts.map +1 -0
  47. package/lib/typescript/zustand/components/ZustandStateChangeItem.d.ts.map +1 -0
  48. package/lib/typescript/zustand/components/ZustandStateDetailContent.d.ts.map +1 -0
  49. package/lib/typescript/zustand/components/ZustandStateInfoView.d.ts.map +1 -0
  50. package/lib/typescript/zustand/components/ZustandStoreBrowser.d.ts +8 -1
  51. package/lib/typescript/zustand/components/ZustandStoreBrowser.d.ts.map +1 -0
  52. package/lib/typescript/zustand/components/index.d.ts.map +1 -0
  53. package/lib/typescript/zustand/hooks/index.d.ts.map +1 -0
  54. package/lib/typescript/zustand/hooks/useZustandStateChanges.d.ts.map +1 -0
  55. package/lib/typescript/zustand/index.d.ts.map +1 -0
  56. package/lib/typescript/zustand/sync/zustandSyncAdapter.d.ts +26 -0
  57. package/lib/typescript/zustand/sync/zustandSyncAdapter.d.ts.map +1 -0
  58. package/lib/typescript/zustand/types/index.d.ts +12 -0
  59. package/lib/typescript/zustand/types/index.d.ts.map +1 -0
  60. package/lib/typescript/zustand/utils/buoyZustandMiddleware.d.ts.map +1 -0
  61. package/lib/typescript/zustand/utils/index.d.ts.map +1 -0
  62. package/lib/typescript/zustand/utils/zustandStateStore.d.ts +35 -1
  63. package/lib/typescript/zustand/utils/zustandStateStore.d.ts.map +1 -0
  64. package/package.json +3 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZustandActionButton.d.ts","sourceRoot":"","sources":["../../../../src/zustand/components/ZustandActionButton.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;CAyBlB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,aAAa,CAAC;AAEpD,UAAU,wBAAwB;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,IAAI,EACJ,IAAI,EACJ,QAAgB,GACjB,EAAE,wBAAwB,+BA0C1B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZustandDetailViewToggle.d.ts","sourceRoot":"","sources":["../../../../src/zustand/components/ZustandDetailViewToggle.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAe,MAAM,OAAO,CAAC;AAIpC,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAWhE,UAAU,4BAA4B;IACpC,UAAU,EAAE,qBAAqB,CAAC;IAClC,YAAY,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACpD,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AA0BD,eAAO,MAAM,uBAAuB,0DAiElC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZustandEventFilterView.d.ts","sourceRoot":"","sources":["../../../../src/zustand/components/ZustandEventFilterView.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGjD,UAAU,2BAA2B;IACnC,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,YAAY,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,MAAM,EAAE,gBAAgB,EAAE,CAAC;CAC5B;AAuBD,wBAAgB,sBAAsB,CAAC,EACrC,eAAe,EACf,eAAe,EACf,YAAY,EACZ,MAAM,GACP,EAAE,2BAA2B,+BAgL7B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZustandIcon.d.ts","sourceRoot":"","sources":["../../../../src/zustand/components/ZustandIcon.tsx"],"names":[],"mappings":"AAAA;;GAEG;AAKH,QAAA,MAAM,kBAAkB,YAAY,CAAC;AAErC,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,KAAK,GACN,EAAE;IACD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,+BAqBA;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZustandModal.d.ts","sourceRoot":"","sources":["../../../../src/zustand/components/ZustandModal.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA2CH,OAAO,KAAK,EAAE,iBAAiB,EAAsB,MAAM,UAAU,CAAC;AAqBtE,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,OAAO,EACP,MAAM,EACN,UAAU,EACV,2BAAmC,GACpC,EAAE,iBAAiB,sCAuhBnB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZustandStateChangeItem.d.ts","sourceRoot":"","sources":["../../../../src/zustand/components/ZustandStateChangeItem.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,kBAAkB,EAAuB,MAAM,UAAU,CAAC;AAGxE,UAAU,2BAA2B;IACnC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,CAAC,MAAM,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAC/C;AAwFD,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,OAAO,GACR,EAAE,2BAA2B,+BAgD7B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZustandStateDetailContent.d.ts","sourceRoot":"","sources":["../../../../src/zustand/components/ZustandStateDetailContent.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAiBH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AASnD,UAAU,8BAA8B;IACtC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAyCD,wBAAgB,yBAAyB,CAAC,EACxC,MAAM,EACN,OAAO,EACP,aAAa,EACb,aAAa,EACb,qBAA6B,GAC9B,EAAE,8BAA8B,+BA6LhC;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,MAAM,EACN,OAAO,EACP,aAAa,EACb,aAAa,GACd,EAAE;IACD,MAAM,EAAE,kBAAkB,CAAC;IAC3B,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC,sCAmBA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZustandStateInfoView.d.ts","sourceRoot":"","sources":["../../../../src/zustand/components/ZustandStateInfoView.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAiD,MAAM,OAAO,CAAC;AAgBtE,OAAO,KAAK,EAAE,kBAAkB,EAAuB,MAAM,UAAU,CAAC;AAIxE,UAAU,yBAAyB;IACjC,MAAM,EAAE,kBAAkB,CAAC;CAC5B;AAmGD,eAAO,MAAM,oBAAoB,uDAmO/B,CAAC"}
@@ -12,7 +12,14 @@ interface ZustandStoreBrowserProps {
12
12
  stores: ZustandStoreInfo[];
13
13
  searchQuery: string;
14
14
  onViewHistory: (storeName: string) => void;
15
+ /**
16
+ * True while we're still waiting for the device's first stores snapshot.
17
+ * Lets the browser show a loading state instead of the "no stores"
18
+ * empty state on first load (stores arrive a few seconds after the
19
+ * watch handshake).
20
+ */
21
+ isLoading?: boolean;
15
22
  }
16
- export declare function ZustandStoreBrowser({ stores, searchQuery, onViewHistory, }: ZustandStoreBrowserProps): import("react").JSX.Element;
23
+ export declare function ZustandStoreBrowser({ stores, searchQuery, onViewHistory, isLoading, }: ZustandStoreBrowserProps): import("react").JSX.Element;
17
24
  export {};
18
25
  //# sourceMappingURL=ZustandStoreBrowser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ZustandStoreBrowser.d.ts","sourceRoot":"","sources":["../../../../src/zustand/components/ZustandStoreBrowser.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAsBH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGjD,UAAU,wBAAwB;IAChC,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAkHD,wBAAgB,mBAAmB,CAAC,EAClC,MAAM,EACN,WAAW,EACX,aAAa,EACb,SAAiB,GAClB,EAAE,wBAAwB,+BA4F1B"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/zustand/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EACL,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,YAAY,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/zustand/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,YAAY,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useZustandStateChanges.d.ts","sourceRoot":"","sources":["../../../../src/zustand/hooks/useZustandStateChanges.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACd,MAAM,UAAU,CAAC;AAGlB,MAAM,WAAW,4BAA4B;IAC3C,iCAAiC;IACjC,YAAY,EAAE,kBAAkB,EAAE,CAAC;IACnC,qDAAqD;IACrD,eAAe,EAAE,kBAAkB,EAAE,CAAC;IACtC,8BAA8B;IAC9B,MAAM,EAAE,aAAa,CAAC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,2BAA2B,CAAC;AAC9D,OAAO,EACL,WAAW,EACX,YAAY,EACZ,mBAAmB,GACpB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,4BAA4B,GAC7B,MAAM,SAAS,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Sync adapter for the zustand tool, consumed by @buoy-gg/external-sync's
3
+ * `useExternalSync` (structurally matches its ToolSyncAdapter interface so
4
+ * this package doesn't need a dependency on it).
5
+ *
6
+ * State changes are captured by the middleware (watchStores/buoyDevTools),
7
+ * independent of whether a dashboard is watching — subscribing here only
8
+ * streams what the store already records. The snapshot carries both the
9
+ * change timeline and the store registry (with each store's current state)
10
+ * so the dashboard can render the store browser.
11
+ *
12
+ * The `setState` action powers remote time-travel/reset from the dashboard.
13
+ */
14
+ export declare const zustandSyncAdapter: {
15
+ version: number;
16
+ getSnapshot: () => {
17
+ changes: import("..").ZustandStateChange[];
18
+ stores: import("../types").ZustandStoreSnapshot[];
19
+ };
20
+ subscribe: (onChange: () => void) => () => void;
21
+ actions: {
22
+ clearEvents: () => void;
23
+ setState: (params: unknown) => void;
24
+ };
25
+ };
26
+ //# sourceMappingURL=zustandSyncAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zustandSyncAdapter.d.ts","sourceRoot":"","sources":["../../../../src/zustand/sync/zustandSyncAdapter.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB;;;;;;0BAMP,MAAM,IAAI;;;2BAYX,OAAO;;CAQ7B,CAAC"}
@@ -42,6 +42,18 @@ export interface ZustandStoreInfo {
42
42
  persistName?: string;
43
43
  color: string;
44
44
  }
45
+ /**
46
+ * Serializable snapshot of a tracked store — registry metadata plus current
47
+ * state, without the live `api` handles. Used by the external-sync adapter.
48
+ */
49
+ export interface ZustandStoreSnapshot {
50
+ name: string;
51
+ stateChangeCount: number;
52
+ isPersisted: boolean;
53
+ persistName?: string;
54
+ color: string;
55
+ currentState: unknown;
56
+ }
45
57
  /**
46
58
  * Filter options
47
59
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/zustand/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAC3B,UAAU,GACV,SAAS,GACT,SAAS,GACT,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IAGjB,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE;QACH,QAAQ,EAAE,MAAM,OAAO,CAAC;QACxB,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC;QAChC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;QACxD,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;KACnF,CAAC;IACF,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buoyZustandMiddleware.d.ts","sourceRoot":"","sources":["../../../../src/zustand/utils/buoyZustandMiddleware.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AA6B7D,4DAA4D;AAC5D,UAAU,gBAAgB;IACx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AAmB,CACjC,KAAK,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,GACtC,OAAO,CAET"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/zustand/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,mBAAmB,GACpB,MAAM,yBAAyB,CAAC"}
@@ -3,15 +3,18 @@
3
3
  *
4
4
  * Mirrors the architecture of reduxActionStore.ts from @buoy-gg/redux
5
5
  */
6
- import type { ZustandStateChange, ZustandStoreInfo, ZustandFilter, StateChangeCategory } from "../types";
6
+ import type { ZustandStateChange, ZustandStoreInfo, ZustandStoreSnapshot, ZustandFilter, StateChangeCategory } from "../types";
7
7
  declare class ZustandStateStore {
8
8
  private stateChanges;
9
9
  private stores;
10
10
  private listeners;
11
11
  private storeListeners;
12
+ private clearListeners;
12
13
  private maxChanges;
13
14
  private idCounter;
14
15
  private isEnabled;
16
+ private captureSuppressed;
17
+ private remoteSetStateHandler;
15
18
  addStateChange(params: {
16
19
  storeName: string;
17
20
  partial: unknown;
@@ -25,6 +28,37 @@ declare class ZustandStateStore {
25
28
  getStateChanges(): ZustandStateChange[];
26
29
  getStateChangeById(id: string): ZustandStateChange | undefined;
27
30
  clearStateChanges(): void;
31
+ /**
32
+ * Listen for clearStateChanges() calls. Used in remote mirror mode to
33
+ * forward a clear performed in the dashboard UI to the synced device.
34
+ */
35
+ onClear(listener: () => void): () => void;
36
+ /**
37
+ * Permanently suppress local capture. Use when this store acts as a mirror
38
+ * of a remote device's state changes (e.g. the desktop dashboard): data
39
+ * arrives via replaceFromSnapshot() and local middleware must never record.
40
+ */
41
+ disableCapture(): void;
42
+ /** Whether the store is in remote mirror mode (capture suppressed). */
43
+ isCaptureSuppressed(): boolean;
44
+ /**
45
+ * Serializable snapshot of the tracked stores (registry metadata plus each
46
+ * store's current state). Used by the sync adapter on the device side —
47
+ * the live `api` handles can't go over the wire.
48
+ */
49
+ getStoreSnapshots(): ZustandStoreSnapshot[];
50
+ /**
51
+ * Handler invoked when the UI calls setState on a mirrored store (e.g.
52
+ * time-travel from the dashboard). Forward it to the synced device.
53
+ */
54
+ setRemoteSetStateHandler(handler: ((storeName: string, partial: unknown, replace?: boolean) => void) | null): void;
55
+ /**
56
+ * Replace the entire mirror contents from a synced device snapshot. The
57
+ * rebuilt registry entries get stub `api` handles: getState() serves the
58
+ * snapshotted state, setState() forwards to the remote handler. Respects
59
+ * the enabled flag so the UI's pause button freezes the mirror.
60
+ */
61
+ replaceFromSnapshot(changes: ZustandStateChange[], storeSnapshots: ZustandStoreSnapshot[]): void;
28
62
  registerStore(name: string, api: ZustandStoreInfo["api"], options?: {
29
63
  isPersisted?: boolean;
30
64
  persistName?: string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zustandStateStore.d.ts","sourceRoot":"","sources":["../../../../src/zustand/utils/zustandStateStore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACpB,MAAM,UAAU,CAAC;AA6KlB,cAAM,iBAAiB;IACrB,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,MAAM,CAA4C;IAC1D,OAAO,CAAC,SAAS,CAA2D;IAC5E,OAAO,CAAC,cAAc,CACV;IACZ,OAAO,CAAC,cAAc,CAA8B;IACpD,OAAO,CAAC,UAAU,CAAO;IACzB,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,qBAAqB,CAEb;IAIhB,cAAc,CAAC,MAAM,EAAE;QACrB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,OAAO,C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,EAAE,aAAa,GAAG,kBAAkB,EAAE;IA4B/D,QAAQ;;;;;;;IAwBR,mBAAmB,IAAI,MAAM,EAAE;IAM/B,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIlC,UAAU,IAAI,OAAO;IAIrB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAUhC,SAAS,CACP,QAAQ,EAAE,CAAC,OAAO,EAAE,kBAAkB,EAAE,KAAK,IAAI,GAChD,MAAM,IAAI;IAOb,iBAAiB,CACf,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,IAAI,GAC7C,MAAM,IAAI;IAOb,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,oBAAoB;CAI7B;AAED,eAAO,MAAM,iBAAiB,mBAA0B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/zustand",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Zustand store DevTools for React Native",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -26,8 +26,8 @@
26
26
  ],
27
27
  "sideEffects": false,
28
28
  "dependencies": {
29
- "@buoy-gg/license": "3.0.1",
30
- "@buoy-gg/shared-ui": "3.0.1"
29
+ "@buoy-gg/license": "3.0.2",
30
+ "@buoy-gg/shared-ui": "3.0.2"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "react": "*",