@buoy-gg/shared-ui 7.0.16 → 7.0.17
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/lib/commonjs/hooks/index.js +7 -0
- package/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/hooks/usePersistedState.js +71 -0
- package/lib/commonjs/icons/index.js +14 -0
- package/lib/commonjs/index.js +42 -0
- package/lib/commonjs/storage/devToolsStorageKeys.js +22 -0
- package/lib/commonjs/ui/components/ModalHeader.js +69 -0
- package/lib/commonjs/ui/components/ToolButton.js +90 -0
- package/lib/commonjs/ui/components/index.js +7 -0
- package/lib/commonjs/ui/index.js +8 -0
- package/lib/commonjs/ui/toolTheme.js +96 -0
- package/lib/commonjs/utils/index.js +38 -0
- package/lib/commonjs/utils/stateSnapshotRegistry.js +62 -0
- package/lib/module/hooks/index.js +1 -0
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/hooks/usePersistedState.js +68 -0
- package/lib/module/icons/index.js +1 -0
- package/lib/module/index.js +4 -0
- package/lib/module/storage/devToolsStorageKeys.js +22 -0
- package/lib/module/ui/components/ModalHeader.js +70 -2
- package/lib/module/ui/components/ToolButton.js +86 -0
- package/lib/module/ui/components/index.js +1 -0
- package/lib/module/ui/index.js +3 -0
- package/lib/module/ui/toolTheme.js +93 -0
- package/lib/module/utils/index.js +2 -0
- package/lib/module/utils/stateSnapshotRegistry.js +55 -0
- package/lib/typescript/commonjs/hooks/index.d.ts +1 -0
- package/lib/typescript/commonjs/hooks/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/hooks/usePersistedState.d.ts +16 -0
- package/lib/typescript/commonjs/hooks/usePersistedState.d.ts.map +1 -0
- package/lib/typescript/commonjs/icons/index.d.ts +1 -0
- package/lib/typescript/commonjs/icons/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts +19 -0
- package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ModalHeader.d.ts +13 -1
- package/lib/typescript/commonjs/ui/components/ModalHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ToolButton.d.ts +24 -0
- package/lib/typescript/commonjs/ui/components/ToolButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/index.d.ts +4 -0
- package/lib/typescript/commonjs/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +1 -0
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/toolTheme.d.ts +68 -0
- package/lib/typescript/commonjs/ui/toolTheme.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/index.d.ts +2 -0
- package/lib/typescript/commonjs/utils/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/stateSnapshotRegistry.d.ts +67 -0
- package/lib/typescript/commonjs/utils/stateSnapshotRegistry.d.ts.map +1 -0
- package/lib/typescript/module/hooks/index.d.ts +1 -0
- package/lib/typescript/module/hooks/index.d.ts.map +1 -1
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/hooks/usePersistedState.d.ts +16 -0
- package/lib/typescript/module/hooks/usePersistedState.d.ts.map +1 -0
- package/lib/typescript/module/icons/index.d.ts +1 -0
- package/lib/typescript/module/icons/index.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/storage/devToolsStorageKeys.d.ts +19 -0
- package/lib/typescript/module/storage/devToolsStorageKeys.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ModalHeader.d.ts +13 -1
- package/lib/typescript/module/ui/components/ModalHeader.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ToolButton.d.ts +24 -0
- package/lib/typescript/module/ui/components/ToolButton.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/index.d.ts +4 -0
- package/lib/typescript/module/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +1 -0
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/toolTheme.d.ts +68 -0
- package/lib/typescript/module/ui/toolTheme.d.ts.map +1 -0
- package/lib/typescript/module/utils/index.d.ts +2 -0
- package/lib/typescript/module/utils/index.d.ts.map +1 -1
- package/lib/typescript/module/utils/stateSnapshotRegistry.d.ts +67 -0
- package/lib/typescript/module/utils/stateSnapshotRegistry.d.ts.map +1 -0
- package/package.json +4 -4
|
@@ -7,6 +7,8 @@ export { getValueType, isPrimitive, isJsonSerializable, isValidJson, getConstruc
|
|
|
7
7
|
export { parseValue, formatValue, getTypeColor, truncateText, flattenObject, formatPath, } from "./valueFormatting";
|
|
8
8
|
export { loadOptionalModule, getCachedOptionalModule } from "./loadOptionalModule";
|
|
9
9
|
export { setRenderCaptureProvider, getRenderCaptureProvider, type RenderCaptureProvider, type RenderCaptureSummary, type RenderCaptureTopComponent, } from "./renderCaptureRegistry";
|
|
10
|
+
export { registerStateSnapshotProvider, getStateSnapshotProviders, getStateSnapshotProvider, subscribeToStateSnapshotProviders, type StateSnapshotProvider, type StateSnapshotProviderStatus, type StateSnapshotCapture, type StateSnapshotRestoreResult, } from "./stateSnapshotRegistry";
|
|
11
|
+
export { serialize as superJsonSerialize, deserialize as superJsonDeserialize, type SuperJSONResult, } from "./minimalSuperJSON";
|
|
10
12
|
export { reloadApp, scheduleReloadApp, resolveReloadStrategy, REMOTE_RELOAD_DELAY_MS, type ReloadStrategy, type ResolvedReloadStrategy, } from "./reloadApp";
|
|
11
13
|
export { Subscribable, type SubscribableListener } from "./subscribable";
|
|
12
14
|
export { subscriberCountNotifier, subscribeToSubscriberCountChanges, notifySubscriberCountChange, } from "./subscriberCountNotifier";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,GAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,sBAAsB,GAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,aAAa,EACb,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,eAAe,GACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACnF,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,GAC/B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,6BAA6B,EAC7B,yBAAyB,EACzB,wBAAwB,EACxB,iCAAiC,EACjC,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,GAChC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,SAAS,IAAI,kBAAkB,EAC/B,WAAW,IAAI,oBAAoB,EACnC,KAAK,eAAe,GACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,sBAAsB,GAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,KAAK,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EACL,uBAAuB,EACvB,iCAAiC,EACjC,2BAA2B,GAC5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,aAAa,EACb,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-package bridge for app-state snapshot & restore (Time Machine).
|
|
3
|
+
*
|
|
4
|
+
* Each state tool (`@buoy-gg/storage`, `@buoy-gg/redux`, `@buoy-gg/zustand`,
|
|
5
|
+
* `@buoy-gg/jotai`, `@buoy-gg/react-query`) registers a provider here at
|
|
6
|
+
* module init (or from its app-lifetime sync hook); `@buoy-gg/time-machine`
|
|
7
|
+
* consumes the registry. Neither side imports the other — same
|
|
8
|
+
* optional-capability pattern as renderCaptureRegistry.
|
|
9
|
+
*
|
|
10
|
+
* Apps can also register custom providers for state Buoy doesn't know about.
|
|
11
|
+
*/
|
|
12
|
+
export interface StateSnapshotProviderStatus {
|
|
13
|
+
canCapture: boolean;
|
|
14
|
+
canRestore: boolean;
|
|
15
|
+
/** Human-actionable reason when a capability is unavailable. */
|
|
16
|
+
detail?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface StateSnapshotCapture {
|
|
19
|
+
/**
|
|
20
|
+
* Raw JS value tree. May contain Date/Map/Set/etc. (the vault serializes
|
|
21
|
+
* with superjson) but MUST NOT contain functions — providers strip them
|
|
22
|
+
* and record how to re-graft on restore inside their own data envelope.
|
|
23
|
+
*/
|
|
24
|
+
data: unknown;
|
|
25
|
+
warnings: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface StateSnapshotRestoreResult {
|
|
28
|
+
/** True when the state verifiably changed (or was verified already-equal). */
|
|
29
|
+
ok: boolean;
|
|
30
|
+
/** Keys / stores / atoms / queries written. */
|
|
31
|
+
applied: number;
|
|
32
|
+
/** Items that could not be restored, with a reason each. */
|
|
33
|
+
skipped: {
|
|
34
|
+
id: string;
|
|
35
|
+
reason: string;
|
|
36
|
+
}[];
|
|
37
|
+
warnings: string[];
|
|
38
|
+
}
|
|
39
|
+
export interface StateSnapshotProvider {
|
|
40
|
+
/** Stable source id, e.g. "storage" | "redux" | "zustand" | "jotai" | "query". */
|
|
41
|
+
id: string;
|
|
42
|
+
/** Display name, e.g. "Storage", "React Query". */
|
|
43
|
+
label: string;
|
|
44
|
+
/** Cheap capability probe — drives UI gating and restore-mode suggestions. */
|
|
45
|
+
status(): StateSnapshotProviderStatus;
|
|
46
|
+
capture(): Promise<StateSnapshotCapture>;
|
|
47
|
+
restore(data: unknown): Promise<StateSnapshotRestoreResult>;
|
|
48
|
+
/**
|
|
49
|
+
* Optional: wipe this source to fresh-install state. Used by the
|
|
50
|
+
* "restore baseline" flow (typically followed by a JS reload so in-memory
|
|
51
|
+
* stores rebuild themselves from the wiped persisted state).
|
|
52
|
+
*/
|
|
53
|
+
clear?(): Promise<StateSnapshotRestoreResult>;
|
|
54
|
+
}
|
|
55
|
+
type Listener = () => void;
|
|
56
|
+
/**
|
|
57
|
+
* Register a provider. Last registration wins for a given id.
|
|
58
|
+
* Returns an unregister function (only removes the provider if it is still
|
|
59
|
+
* the registered one for that id).
|
|
60
|
+
*/
|
|
61
|
+
export declare function registerStateSnapshotProvider(provider: StateSnapshotProvider): () => void;
|
|
62
|
+
export declare function getStateSnapshotProviders(): StateSnapshotProvider[];
|
|
63
|
+
export declare function getStateSnapshotProvider(id: string): StateSnapshotProvider | null;
|
|
64
|
+
/** Notifies when providers register/unregister (query registers late). */
|
|
65
|
+
export declare function subscribeToStateSnapshotProviders(listener: Listener): () => void;
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=stateSnapshotRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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AM,GACT,qBAAqB,GAAG,IAAI,CAE9B;AAED,0EAA0E;AAC1E,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,QAAQ,GACjB,MAAM,IAAI,CAKZ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@buoy-gg/shared-ui",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.17",
|
|
4
4
|
"description": "Shared UI components, hooks, and utilities",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -136,10 +136,10 @@
|
|
|
136
136
|
],
|
|
137
137
|
"sideEffects": false,
|
|
138
138
|
"dependencies": {
|
|
139
|
-
"@buoy-gg/floating-tools-core": "^7.0.
|
|
139
|
+
"@buoy-gg/floating-tools-core": "^7.0.17"
|
|
140
140
|
},
|
|
141
141
|
"peerDependencies": {
|
|
142
|
-
"@buoy-gg/license": "7.0.
|
|
142
|
+
"@buoy-gg/license": "7.0.17",
|
|
143
143
|
"@react-native-clipboard/clipboard": "*",
|
|
144
144
|
"expo-clipboard": "*",
|
|
145
145
|
"expo-file-system": "*",
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"expo-clipboard": "~7.1.5",
|
|
168
168
|
"react-native-safe-area-context": "^5.6.2",
|
|
169
169
|
"typescript": "~5.8.3",
|
|
170
|
-
"@buoy-gg/license": "^7.0.
|
|
170
|
+
"@buoy-gg/license": "^7.0.17"
|
|
171
171
|
},
|
|
172
172
|
"react-native-builder-bob": {
|
|
173
173
|
"source": "src",
|