@buoy-gg/storage 7.0.29 → 7.0.31

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 (41) hide show
  1. package/lib/commonjs/storage/components/GameUIStorageBrowser.js +92 -21
  2. package/lib/commonjs/storage/components/StorageBrowserMode.js +8 -2
  3. package/lib/commonjs/storage/components/StorageKeyDetailScreen.js +572 -0
  4. package/lib/commonjs/storage/components/StorageKeyRow.js +21 -2
  5. package/lib/commonjs/storage/components/StorageKeySection.js +44 -21
  6. package/lib/commonjs/storage/components/StorageModalWithTabs.js +24 -2
  7. package/lib/commonjs/storage/components/StorageSaveNotice.js +171 -0
  8. package/lib/commonjs/storage/components/StorageValueEditModal.js +11 -364
  9. package/lib/commonjs/storage/hooks/useKeyEditor.js +12 -85
  10. package/lib/commonjs/storage/hooks/useTreeDraft.js +7 -100
  11. package/lib/module/storage/components/GameUIStorageBrowser.js +94 -23
  12. package/lib/module/storage/components/StorageBrowserMode.js +8 -2
  13. package/lib/module/storage/components/StorageKeyDetailScreen.js +570 -0
  14. package/lib/module/storage/components/StorageKeyRow.js +20 -3
  15. package/lib/module/storage/components/StorageKeySection.js +43 -21
  16. package/lib/module/storage/components/StorageModalWithTabs.js +24 -2
  17. package/lib/module/storage/components/StorageSaveNotice.js +168 -0
  18. package/lib/module/storage/components/StorageValueEditModal.js +13 -366
  19. package/lib/module/storage/hooks/useKeyEditor.js +14 -87
  20. package/lib/module/storage/hooks/useTreeDraft.js +9 -102
  21. package/lib/typescript/storage/components/GameUIStorageBrowser.d.ts +13 -2
  22. package/lib/typescript/storage/components/GameUIStorageBrowser.d.ts.map +1 -1
  23. package/lib/typescript/storage/components/StorageBrowserMode.d.ts +7 -2
  24. package/lib/typescript/storage/components/StorageBrowserMode.d.ts.map +1 -1
  25. package/lib/typescript/storage/components/StorageKeyDetailScreen.d.ts +46 -0
  26. package/lib/typescript/storage/components/StorageKeyDetailScreen.d.ts.map +1 -0
  27. package/lib/typescript/storage/components/StorageKeyRow.d.ts +9 -0
  28. package/lib/typescript/storage/components/StorageKeyRow.d.ts.map +1 -1
  29. package/lib/typescript/storage/components/StorageKeySection.d.ts +19 -1
  30. package/lib/typescript/storage/components/StorageKeySection.d.ts.map +1 -1
  31. package/lib/typescript/storage/components/StorageModalWithTabs.d.ts.map +1 -1
  32. package/lib/typescript/storage/components/StorageSaveNotice.d.ts +6 -0
  33. package/lib/typescript/storage/components/StorageSaveNotice.d.ts.map +1 -0
  34. package/lib/typescript/storage/components/StorageValueEditModal.d.ts +9 -31
  35. package/lib/typescript/storage/components/StorageValueEditModal.d.ts.map +1 -1
  36. package/lib/typescript/storage/hooks/useKeyEditor.d.ts +7 -31
  37. package/lib/typescript/storage/hooks/useKeyEditor.d.ts.map +1 -1
  38. package/lib/typescript/storage/hooks/useTreeDraft.d.ts +7 -66
  39. package/lib/typescript/storage/hooks/useTreeDraft.d.ts.map +1 -1
  40. package/lib/typescript/storage/sync/storageSyncAdapter.d.ts +1 -1
  41. package/package.json +5 -5
@@ -1,4 +1,4 @@
1
- import { RequiredStorageKey } from "../types";
1
+ import { RequiredStorageKey, StorageKeyInfo } from "../types";
2
2
  import type { StorageFilterType, StorageTypeFilter } from "./StorageFilterCards";
3
3
  import { MutableRefObject } from "react";
4
4
  interface StorageBrowserModeProps {
@@ -29,11 +29,16 @@ interface StorageBrowserModeProps {
29
29
  /** Backend filter, shared with the Events tab. */
30
30
  storageTypeFilter?: StorageTypeFilter;
31
31
  onStorageTypeFilterChange?: (type: StorageTypeFilter) => void;
32
+ /** Detail-screen control, lifted to the modal (RQ interaction) — see
33
+ * GameUIStorageBrowser. */
34
+ detailKey?: StorageKeyInfo | null;
35
+ onOpenKey?: (storageKey: StorageKeyInfo) => void;
36
+ onCloseDetail?: () => void;
32
37
  }
33
38
  /**
34
39
  * Storage browser mode component
35
40
  * Displays storage keys with game UI styled interface
36
41
  */
37
- export declare function StorageBrowserMode({ requiredStorageKeys, showFilters, ignoredPatterns, onTogglePattern, onAddPattern, searchQuery, storageDataRef, eventCountByKey, lastWriteByKey, onViewHistory, enabledStorageTypes, statusFilter, onStatusFilterChange, onStatusCountsChange, pinnedKeys, onTogglePin, applySafeAreaInset, storageTypeFilter, onStorageTypeFilterChange, }: StorageBrowserModeProps): import("react").JSX.Element;
42
+ export declare function StorageBrowserMode({ requiredStorageKeys, showFilters, ignoredPatterns, onTogglePattern, onAddPattern, searchQuery, storageDataRef, eventCountByKey, lastWriteByKey, onViewHistory, enabledStorageTypes, statusFilter, onStatusFilterChange, onStatusCountsChange, pinnedKeys, onTogglePin, applySafeAreaInset, storageTypeFilter, onStorageTypeFilterChange, detailKey, onOpenKey, onCloseDetail, }: StorageBrowserModeProps): import("react").JSX.Element;
38
43
  export {};
39
44
  //# sourceMappingURL=StorageBrowserMode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StorageBrowserMode.d.ts","sourceRoot":"","sources":["../../../../src/storage/components/StorageBrowserMode.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAEzC,UAAU,uBAAuB;IAC/B,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC9B,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,CAAC;IACzC,eAAe,CAAC,EAAE,MAAM,CAAC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MAAM,CAAC,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,yEAAyE;IACzE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,kDAAkD;IAClD,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,yBAAyB,CAAC,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC9D;+BAC2B;IAC3B,SAAS,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,IAAI,CAAC;IACjD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,mBAAwB,EACxB,WAAmB,EACnB,eAA2B,EAC3B,eAAe,EACf,YAAY,EACZ,WAAgB,EAChB,cAAc,EACd,eAAe,EACf,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,SAAS,EACT,SAAS,EACT,aAAa,GACd,EAAE,uBAAuB,+BA2BzB"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * One storage key, on a screen of its own — the React Query detail-screen
3
+ * shape (and the Zustand tool's twin), pointed at a stored value.
4
+ *
5
+ * Tapping a key card opens this instead of expanding in place. Top to bottom:
6
+ *
7
+ * 1. VALUE EDITOR — the shared LiveExplorer. No draft, no Save: an edit
8
+ * re-serializes the whole value and writes it as you make it. Typing
9
+ * commits on a short debounce (~300ms, flushed on blur) so a word is one
10
+ * storage write, not one per keystroke — storage writes hit disk and
11
+ * land in the events timeline, which is the one way this tool differs
12
+ * from RQ's unlogged cache writes. A scalar key is just the root leaf's
13
+ * input; a boolean key is a one-tap toggle.
14
+ * 2. KEY DETAILS — what the expanded card used to say: status, backend,
15
+ * MMKV instance, updates (with the road to history), schema diagnostics.
16
+ * 3. RAW VALUE — the serialized string exactly as the backend holds it.
17
+ * 4. The card's housekeeping actions: pin, hide, delete.
18
+ *
19
+ * THE ROUND-TRIP WRINKLE zustand doesn't have: a storage write is async —
20
+ * write, device event, snapshot, refreshed prop. Between an edit and its
21
+ * echo, `storageKey.value` is STALE, so basing the next edit on the prop
22
+ * would silently revert the previous one (edit qty, then name, and qty snaps
23
+ * back). `lastWrittenRef` holds the most recent written document and is the
24
+ * base for every edit until the prop catches up to it — last-write-wins
25
+ * against the app, exactly once, and never against the editor itself.
26
+ */
27
+ import type { StorageKeyInfo } from "../types";
28
+ interface StorageKeyDetailScreenProps {
29
+ storageKey: StorageKeyInfo;
30
+ /** Why this key can't be edited (read-only instance, buffer, biometric). */
31
+ editBlockedReason?: string | null;
32
+ /** Number of recorded events for this key. */
33
+ eventCount?: number;
34
+ /** Performs the write. Rejecting shows the reason and keeps the screen. */
35
+ onSave: (raw: string) => Promise<void>;
36
+ onViewHistory?: () => void;
37
+ onDeleteKey?: (storageKey: StorageKeyInfo) => void;
38
+ onHideKey?: (storageKey: StorageKeyInfo) => void;
39
+ isPinned?: boolean;
40
+ onTogglePin?: (key: string) => void;
41
+ /** Pad past the home indicator (bottom sheet); off in a floating window. */
42
+ applySafeAreaInset?: boolean;
43
+ }
44
+ export declare function StorageKeyDetailScreen({ storageKey, editBlockedReason, eventCount, onSave, onViewHistory, onDeleteKey, onHideKey, isPinned, onTogglePin, applySafeAreaInset, }: StorageKeyDetailScreenProps): import("react").JSX.Element;
45
+ export {};
46
+ //# sourceMappingURL=StorageKeyDetailScreen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageKeyDetailScreen.d.ts","sourceRoot":"","sources":["../../../../src/storage/components/StorageKeyDetailScreen.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AA+BH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAwC/C,UAAU,2BAA2B;IACnC,UAAU,EAAE,cAAc,CAAC;IAC3B,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,IAAI,CAAC;IACnD,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,4EAA4E;IAC5E,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,wBAAgB,sBAAsB,CAAC,EACrC,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,MAAM,EACN,aAAa,EACb,WAAW,EACX,SAAS,EACT,QAAgB,EAChB,WAAW,EACX,kBAAkB,GACnB,EAAE,2BAA2B,+BAyV7B"}
@@ -46,6 +46,15 @@ interface StorageKeyRowProps {
46
46
  /** Why this key can't be edited (read-only instance, buffer, biometric). */
47
47
  editBlockedReason?: string | null;
48
48
  }
49
+ /** Exported for the key DETAIL screen, so card and detail can't disagree
50
+ * about what a status is called or what color it wears. */
51
+ export declare const getStatusConfig: (status: StorageKeyInfo["status"]) => {
52
+ label: string;
53
+ color: string;
54
+ sublabel: string;
55
+ };
49
56
  export declare const StorageKeyRow: import("react").NamedExoticComponent<StorageKeyRowProps>;
57
+ /** Exported for the key DETAIL screen — same reason as getStatusConfig. */
58
+ export declare const getStorageTypeColor: (storageType: StorageKeyInfo["storageType"]) => string;
50
59
  export {};
51
60
  //# sourceMappingURL=StorageKe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;CAyC/D,CAAC;AAaF,eAAO,MAAM,aAAa,0DAuTxB,CAAC;AAEH,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB,GAAI,aAAa,cAAc,CAAC,aAAa,CAAC,WAW7E,CAAC"}
@@ -1,4 +1,10 @@
1
+ import { View } from "react-native";
1
2
  import { StorageKeyInfo } from "../types";
3
+ /**
4
+ * Identifies a ROW, not a key name — the same name routinely exists in more
5
+ * than one backend. Shared with the browser so both sides agree on the id.
6
+ */
7
+ export declare function storageRowId(storageKey: StorageKeyInfo): string;
2
8
  interface StorageKeySectionProps {
3
9
  title: string;
4
10
  count: number;
@@ -29,6 +35,18 @@ interface StorageKeySectionProps {
29
35
  onDeleteKey?: (storageKey: StorageKeyInfo) => void;
30
36
  /** Per-key reason editing is impossible (read-only / buffer / biometric). */
31
37
  editBlockedFor?: (storageKey: StorageKeyInfo) => string | null;
38
+ /**
39
+ * Reports each row's mounted native node (null on unmount), keyed by
40
+ * `storageRowId`. Lets the browser scroll a row back into view after the
41
+ * editor overlay closes.
42
+ */
43
+ onRowRef?: (id: string, node: View | null) => void;
44
+ /**
45
+ * Open a key's DETAIL screen on tap — the React Query interaction. When
46
+ * provided, tapping a card navigates instead of expanding in place (the
47
+ * expansion path stays for hosts that don't pass this).
48
+ */
49
+ onOpenKey?: (storageKey: StorageKeyInfo) => void;
32
50
  }
33
51
  /**
34
52
  * Storage key section component following composition principles [[rule3]]
@@ -38,6 +56,6 @@ interface StorageKeySectionProps {
38
56
  * - Prefer Composition over Configuration: Reuses patterns from EnvVarSection
39
57
  * - Extract Reusable Logic: Shares expansion state management pattern
40
58
  */
41
- export declare function StorageKeySection({ title, count, keys, emptyMessage, headerColor, isSelectMode, selectedKeys, onSelectionChange, eventCountByKey, onViewHistory, onHideKey, pinnedKeys, onTogglePin, onEditKey, onToggleKey, onDeleteKey, editBlockedFor, }: StorageKeySectionProps): import("react").JSX.Element | null;
59
+ export declare function StorageKeySection({ title, count, keys, emptyMessage, headerColor, isSelectMode, selectedKeys, onSelectionChange, eventCountByKey, onViewHistory, onHideKey, pinnedKeys, onTogglePin, onEditKey, onToggleKey, onDeleteKey, editBlockedFor, onRowRef, onOpenKey, }: StorageKeySectionProps): import("react").JSX.Element | null;
42
60
  export {};
43
61
  //# sourceMappingURL=StorageKeySection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StorageKeySection.d.ts","sourceRoot":"","sources":["../../../../src/storage/components/StorageKeySection.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAK1C,UAAU,sBAAsB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,cAAc,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mEAAmE;IACnE,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,sCAAsC;IACtC,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5E,gCAAgC;IAChC,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACzC,sDAAsD;IACtD,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,2DAA2D;IAC3D,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,IAAI,CAAC;IACjD,8BAA8B;IAC9B,UAAU,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,kCAAkC;IAClC,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,0EAA0E;IAC1E,SAAS,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,IAAI,CAAC;IACjD,wEAAwE;IACxE,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,IAAI,CAAC;IACnD,gFAAgF;IAChF,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,IAAI,CAAC;IACnD,6EAA6E;IAC7E,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,MAAM,GAAG,IAAI,CAAC;CAChE;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,KAAK,EACL,IAAI,EACJ,YAAY,EACZ,WAAW,EACX,YAAoB,EACpB,YAAwB,EACxB,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,EACT,WAAW,EACX,WAAW,EACX,cAAc,GACf,EAAE,sBAAsB,sCAsFxB"}
1
+ {"version":3,"file":"StorageKeySection.d.ts","sourceRoot":"","sources":["../../../../src/storage/components/StorageKeySection.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAoB,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAK1C;;;GAGG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,cAAc,GAAG,MAAM,CAI/D;AAED,UAAU,sBAAsB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,cAAc,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mEAAmE;IACnE,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,sCAAsC;IACtC,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5E,gCAAgC;IAChC,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version":3,"file":"StorageModalWithTabs.d.ts","sourceRoot":"","sources":["../../../../src/storage/components/StorageModalWithTabs.tsx"],"names":[],"mappings":"AAgCA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAY9C,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAchF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAqC,CAAC;AAExE,UAAU,yBAAyB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,KAAK,IAAI,CAAC;IACvC,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC3C;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,GAAG,QAAQ,KAAK,IAAI,CAAC;IAClD;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CAC/C;AAqBD,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,OAAO,EACP,MAAM,EACN,UAAU,EACV,2BAAmC,EACnC,mBAAwB,EACxB,MAAc,EACd,WAAW,EACX,SAAS,EACT,aAAa,GACd,EAAE,yBAAyB,sCAygC3B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,KAAK,GAAE,IAAI,CAAC,yBAAyB,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAM,+BAG9E"}
1
+ {"version":3,"file":"StorageModalWithTabs.d.ts","sourceRoot":"","sources":["../../../../src/storage/components/StorageModalWithTabs.tsx"],"names":[],"mappings":"AAgCA,OAAO,EAAE,kBAAkB,EAAkB,MAAM,UAAU,CAAC;AAY9D,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAchF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAqC,CAAC;AAExE,UAAU,yBAAyB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,GAAG,KAAK,IAAI,CAAC;IACvC,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC3C;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,SAAS,GAAG,QAAQ,KAAK,IAAI,CAAC;IAClD;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC;CAC/C;AAqBD,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,OAAO,EACP,MAAM,EACN,UAAU,EACV,2BAAmC,EACnC,mBAAwB,EACxB,MAAc,EACd,WAAW,EACX,SAAS,EACT,aAAa,GACd,EAAE,yBAAyB,sCA8hC3B;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,KAAK,GAAE,IAAI,CAAC,yBAAyB,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAM,+BAG9E"}
@@ -0,0 +1,6 @@
1
+ export interface StorageSaveNoticeProps {
2
+ /** Called once the toast has faded out, so the host can unmount it. */
3
+ onDone: () => void;
4
+ }
5
+ export declare function StorageSaveNotice({ onDone }: StorageSaveNoticeProps): import("react").JSX.Element;
6
+ //# sourceMappingURL=StorageSaveNotice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StorageSaveNotice.d.ts","sourceRoot":"","sources":["../../../../src/storage/components/StorageSaveNotice.tsx"],"names":[],"mappings":"AAoCA,MAAM,WAAW,sBAAsB;IACrC,uEAAuE;IACvE,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,MAAM,EAAE,EAAE,sBAAsB,+BAwEnE"}
@@ -1,36 +1,14 @@
1
1
  /**
2
- * Editing one value: a panel at the top of the screen, with Cancel and Save.
2
+ * Storage's value-typing panel.
3
3
  *
4
- * This started as a pushed full screen and that was more ceremony than the task
5
- * deserves — changing one string is the most ordinary thing in this tool, and
6
- * it shouldn't cost a navigation. A modal is what people expect, and the reason
7
- * it's pinned to the TOP rather than centred is the keyboard: a centred panel
8
- * gets shoved up or covered the moment the field focuses, and a bottom sheet is
9
- * simply underneath it. At the top it stays put and stays readable.
10
- *
11
- * The field is multiline for anything textual. Stored values are routinely
12
- * tokens, URLs and serialized blobs, and a single line shows you roughly forty
13
- * characters of them, scrolling sideways — which is how you edit the wrong part
14
- * of a string without noticing.
15
- *
16
- * Type is preserved by construction: the ORIGINAL value's type picks the editor
17
- * AND decides how the draft is read back, so editing a number can only produce
18
- * a number. Raw JSON — the escape hatch for containers — re-checks the parsed
19
- * result and refuses a different shape.
20
- *
21
- * Nothing here writes. `onSave` hands the value to whoever owns it.
4
+ * The panel itself — top-pinned so the keyboard can't reach it, type preserved
5
+ * by construction, raw-JSON shape check — lives in shared-ui's
6
+ * {@link ValueEditModal}, shared with the Zustand store editor. This wrapper
7
+ * only pins storage's testID namespace so the Detox suite's handles
8
+ * (`buoy-storage-value-input`, `-save`, …) stay exactly what they were.
22
9
  */
23
- interface StorageValueEditModalProps {
24
- /** Path into the value being edited — labels the panel, never used to write. */
25
- path: string[];
26
- value: unknown;
27
- onSave: (next: unknown) => void;
28
- onCancel: () => void;
29
- /** "Save" when this writes, "Apply" when it only updates a draft. */
30
- saveLabel?: string;
31
- /** Disables the controls while a write is in flight. */
32
- busy?: boolean;
33
- }
34
- export declare function StorageValueEditModal({ path, value, onSave, onCancel, saveLabel, busy, }: StorageValueEditModalProps): import("react").JSX.Element;
10
+ import { type ValueEditModalProps } from "@buoy-gg/shared-ui/dataViewer";
11
+ type StorageValueEditModalProps = Omit<ValueEditModalProps, "testIDPrefix">;
12
+ export declare function StorageValueEditModal(props: StorageValueEditModalProps): import("react").JSX.Element;
35
13
  export {};
36
14
  //# sourceMappingURL=StorageValueEditModal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StorageValueEditModal.d.ts","sourceRoot":"","sources":["../../../../src/storage/components/StorageValueEditModal.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAcH,UAAU,0BAA0B;IAClC,gFAAgF;IAChF,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAChC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAkCD,wBAAgB,qBAAqB,CAAC,EACpC,IAAI,EACJ,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAkB,EAClB,IAAY,GACb,EAAE,0BAA0B,+BA2H5B"}
1
+ {"version":3,"file":"StorageValueEditModal.d.ts","sourceRoot":"","sources":["../../../../src/storage/components/StorageValueEditModal.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,+BAA+B,CAAC;AAEvC,KAAK,0BAA0B,GAAG,IAAI,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;AAE5E,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,+BAEtE"}
@@ -1,37 +1,13 @@
1
1
  /**
2
- * Everything editing a key involves, minus how it looks.
2
+ * Storage's view of the shared tree editor.
3
3
  *
4
- * The phone and the dashboard run the same editor: one buffered draft, one
5
- * write on save, a selection the structural actions operate on, a modal for
6
- * typing a value, and a guard so closing can't silently drop unsaved work.
7
- * What differs is presentation — thumb-sized tiles under a full screen versus
8
- * chips docked in a panel — which is a rendering concern and nothing more.
9
- *
10
- * Keeping the rules here means the two surfaces can't drift on the things that
11
- * would actually hurt: whether a boolean opens an editor, whether a failed
12
- * write closes the editor anyway, what "dirty" means.
4
+ * Everything editing a key involves — buffered draft, selection, value modal,
5
+ * dirty-close guard — lives in shared-ui's `useTreeEditor`, shared with the
6
+ * Zustand store editor so the two can't drift. Storage's single write takes
7
+ * the SERIALIZED value, so this wrapper is exactly the stringify.
13
8
  */
14
- import { type DataTreeSelection } from "@buoy-gg/shared-ui/dataViewer";
15
- import { type TreeDraft } from "./useTreeDraft";
16
- export interface KeyEditor {
17
- draft: TreeDraft;
18
- /** The tree row the structural actions apply to. */
19
- selection: DataTreeSelection | null;
20
- setSelection: (selection: DataTreeSelection | null) => void;
21
- /** Which node the value modal is open on. Null means it's closed. */
22
- valuePath: string[] | null;
23
- /** Open the value modal — or, for a boolean, just flip it. */
24
- openValueEditor: (path: string[]) => void;
25
- closeValueEditor: () => void;
26
- /** Take the modal's result into the draft. */
27
- applyValue: (next: unknown) => void;
28
- /** Open the modal on the whole value — the manual/raw JSON escape hatch. */
29
- openRawEditor: () => void;
30
- /** Leave, resolving unsaved work first. */
31
- requestClose: () => void;
32
- /** Write, and leave only if the write landed. */
33
- saveAndClose: () => void;
34
- }
9
+ import { type TreeEditor } from "@buoy-gg/shared-ui/dataViewer";
10
+ export type KeyEditor = TreeEditor;
35
11
  export interface KeyEditorOptions {
36
12
  /** The value as storage holds it, already un-stringified. */
37
13
  value: unknown;
@@ -1 +1 @@
1
- {"version":3,"file":"useKeyEditor.d.ts","sourceRoot":"","sources":["../../../../src/storage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,GAAG,SAAS,CA2E9B"}
1
+ {"version":3,"file":"useKeyEditor.d.ts","sourceRoot":"","sources":["../../../../src/storage/hooks/useKeyEditor.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAEL,KAAK,UAAU,EAChB,MAAM,+BAA+B,CAAC;AAEvC,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC;AAEnC,MAAM,WAAW,gBAAgB;IAC/B,6DAA6D;IAC7D,KAAK,EAAE,OAAO,CAAC;IACf,qEAAqE;IACrE,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;IACH,cAAc,EAAE,CAAC,OAAO,EAAE;QACxB,IAAI,EAAE,MAAM,IAAI,CAAC;QACjB,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,KAAK,IAAI,CAAC;CACZ;AAED,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,IAAI,EACJ,OAAO,EACP,cAAc,GACf,EAAE,gBAAgB,GAAG,SAAS,CAM9B"}
@@ -1,72 +1,13 @@
1
1
  /**
2
- * A local draft of a storage value, edited in place and written ONCE.
2
+ * Storage's view of the shared buffered tree draft.
3
3
  *
4
- * Applying each tree op straight to the device was the obvious first cut and it
5
- * behaves badly for two compounding reasons:
6
- *
7
- * 1. **Every op is a round trip.** The write lands, the device emits a storage
8
- * event, a snapshot comes back, and the browser re-reads every backend — so
9
- * a six-tap reorder is six writes and six full refreshes. The tree rebuilds
10
- * under the user mid-gesture.
11
- * 2. **The highlight and the value fall out of step.** Selection is local and
12
- * moves instantly; the value it points at only catches up when the round
13
- * trip completes, so for a beat the highlight sits on the old contents.
14
- *
15
- * Optimistic updates — the React Query pattern of rendering the expected result
16
- * and reconciling later — fix (2) but not (1): they still write per change.
17
- * Buffering fixes both, and it's what every editor that owns a document does
18
- * (a form's dirty state, an IDE's unsaved buffer, JSON Editor's in-memory doc
19
- * with an explicit save).
20
- *
21
- * The trade is that the buffer can go stale if the app writes the same key
22
- * while you're editing. That's the same last-write-wins a text editor has, and
23
- * `isDirty` at least makes it visible that you're holding unsaved changes.
4
+ * The draft itself lives in shared-ui (`useTreeDraft` there — one editor for
5
+ * storage keys and zustand stores, so the rules can't drift). Storage's write
6
+ * path takes the SERIALIZED value — `setItem(key, raw)` — so this wrapper is
7
+ * exactly the stringify.
24
8
  */
25
- import { type JsonOp } from "@buoy-gg/shared-ui/dataViewer";
26
- export interface TreeDraft {
27
- /** True while the tree is in edit mode. */
28
- isEditing: boolean;
29
- /** What the tree should render — the draft while editing, else the live value. */
30
- value: unknown;
31
- /** True when the draft differs from what's stored. */
32
- isDirty: boolean;
33
- /** True while the single write is in flight. */
34
- isSaving: boolean;
35
- /** Error from the last save attempt, or null. */
36
- error: string | null;
37
- /** Where the tree should move its highlight after the last op. */
38
- selectPath: string[] | null | undefined;
39
- begin: () => void;
40
- /** Apply one op to the DRAFT. Nothing is written. */
41
- apply: (op: JsonOp) => void;
42
- /**
43
- * Move the highlight explicitly, for the ops that CREATE a node.
44
- * `selectionPathAfterOp` handles the ones that move or delete a node, but it
45
- * can't handle these — it doesn't see the container, so it can't know an
46
- * append landed at index 3.
47
- */
48
- selectAt: (path: string[]) => void;
49
- /**
50
- * Write the draft to storage and leave edit mode. No-op write when clean.
51
- *
52
- * Resolves `true` when the value is safely stored and `false` when the write
53
- * was refused — it never rejects, because a failed save is a state this hook
54
- * handles (it keeps edit mode open and sets `error`). Callers that navigate
55
- * away on save MUST check the result, or they'll close over a draft that was
56
- * never written and show the user nothing.
57
- */
58
- commit: () => Promise<boolean>;
59
- /**
60
- * Throw the draft away — back to the value as stored, still editing.
61
- *
62
- * Deliberately NOT "leave edit mode": Discard sits next to Save in the
63
- * commit row and leaves you on the editor. Dropping out of edit mode there
64
- * left a screen that looked fine and silently swallowed every subsequent
65
- * edit — `value` fell back to the live value, `isDirty` was pinned false,
66
- * and Save never came back, because nothing re-enters edit mode after mount.
67
- */
68
- discard: () => void;
69
- }
9
+ import { type TreeDraft } from "@buoy-gg/shared-ui/dataViewer";
10
+ export type { TreeDraft };
70
11
  /**
71
12
  * @param liveValue the value as storage currently holds it (already parsed)
72
13
  * @param save persists the serialized draft; rejecting keeps edit mode open
@@ -1 +1 @@
1
- {"version":3,"file":"useTreeDraft.d.ts","sourceRoot":"","sources":["../../../../src/storage/hooks/useTreeDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAqC,KAAK,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAE/F,MAAM,WAAW,SAAS;IACxB,2CAA2C;IAC3C,SAAS,EAAE,OAAO,CAAC;IACnB,kFAAkF;IAClF,KAAK,EAAE,OAAO,CAAC;IACf,sDAAsD;IACtD,OAAO,EAAE,OAAO,CAAC;IACjB,gDAAgD;IAChD,QAAQ,EAAE,OAAO,CAAC;IAClB,iDAAiD;IACjD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,kEAAkE;IAClE,UAAU,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC;IAExC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,qDAAqD;IACrD,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnC;;;;;;;;OAQG;IACH,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/B;;;;;;;;OAQG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,OAAO,EAClB,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GACpC,SAAS,CAsFX"}
1
+ {"version":3,"file":"useTreeDraft.d.ts","sourceRoot":"","sources":["../../../../src/storage/hooks/useTreeDraft.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAEL,KAAK,SAAS,EACf,MAAM,+BAA+B,CAAC;AAEvC,YAAY,EAAE,SAAS,EAAE,CAAC;AAE1B;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,OAAO,EAClB,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GACpC,SAAS,CAMX"}
@@ -89,7 +89,7 @@ export declare const storageSyncAdapter: {
89
89
  /** Undo one event, addressed by the `id` the store assigned it. */
90
90
  "timeTravel.undo": (params?: unknown) => Promise<{
91
91
  undone: boolean;
92
- action: "mergeItem" | "multiSet" | "multiRemove" | "clear" | "setItem" | "removeItem" | "multiMerge";
92
+ action: "mergeItem" | "multiSet" | "multiRemove" | "setItem" | "removeItem" | "clear" | "multiMerge";
93
93
  key: string | undefined;
94
94
  }>;
95
95
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/storage",
3
- "version": "7.0.29",
3
+ "version": "7.0.31",
4
4
  "description": "Browse & edit AsyncStorage, MMKV & SecureStore inside your React Native app, with change history. Part of Buoy devtools.",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -29,11 +29,11 @@
29
29
  "**/snapshotProvider.ts"
30
30
  ],
31
31
  "dependencies": {
32
- "@buoy-gg/floating-tools-core": "^7.0.29",
33
- "@buoy-gg/shared-ui": "^7.0.29"
32
+ "@buoy-gg/floating-tools-core": "^7.0.31",
33
+ "@buoy-gg/shared-ui": "^7.0.31"
34
34
  },
35
35
  "peerDependencies": {
36
- "@buoy-gg/license": "7.0.29",
36
+ "@buoy-gg/license": "7.0.31",
37
37
  "@react-native-async-storage/async-storage": "^2.0.0 || ^3.1.0",
38
38
  "react": "*",
39
39
  "react-native": "*"
@@ -43,7 +43,7 @@
43
43
  "@types/react": "^19.1.0",
44
44
  "@types/react-native": "^0.73.0",
45
45
  "typescript": "~5.8.3",
46
- "@buoy-gg/license": "^7.0.29"
46
+ "@buoy-gg/license": "^7.0.31"
47
47
  },
48
48
  "react-native-builder-bob": {
49
49
  "source": "src",