@buoy-gg/zustand 7.0.38 → 7.0.39

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 (62) hide show
  1. package/lib/commonjs/index.js +105 -1
  2. package/lib/commonjs/preset.js +102 -1
  3. package/lib/commonjs/zustand/components/ZustandActionButton.js +118 -1
  4. package/lib/commonjs/zustand/components/ZustandDetailViewToggle.js +48 -1
  5. package/lib/commonjs/zustand/components/ZustandEventFilterView.js +43 -1
  6. package/lib/commonjs/zustand/components/ZustandIcon.js +18 -1
  7. package/lib/commonjs/zustand/components/ZustandModal.js +772 -1
  8. package/lib/commonjs/zustand/components/ZustandStateChangeItem.js +117 -1
  9. package/lib/commonjs/zustand/components/ZustandStateDetailContent.js +372 -1
  10. package/lib/commonjs/zustand/components/ZustandStateInfoView.js +488 -1
  11. package/lib/commonjs/zustand/components/ZustandStoreBrowser.js +204 -1
  12. package/lib/commonjs/zustand/components/ZustandStoreDetailContent.js +471 -1
  13. package/lib/commonjs/zustand/components/ZustandStoreEditorScreen.js +393 -1
  14. package/lib/commonjs/zustand/hooks/useZustandStateChanges.js +74 -1
  15. package/lib/commonjs/zustand/sync/zustandSyncAdapter.js +382 -1
  16. package/lib/commonjs/zustand/utils/buoyZustandMiddleware.js +284 -1
  17. package/lib/commonjs/zustand/utils/editableState.js +146 -1
  18. package/lib/commonjs/zustand/utils/snapshotProvider.js +209 -1
  19. package/lib/commonjs/zustand/utils/testIDs.js +82 -1
  20. package/lib/commonjs/zustand/utils/zustandStateStore.js +379 -1
  21. package/lib/module/index.js +90 -1
  22. package/lib/module/preset.js +98 -1
  23. package/lib/module/zustand/components/ZustandActionButton.js +114 -1
  24. package/lib/module/zustand/components/ZustandDetailViewToggle.js +43 -1
  25. package/lib/module/zustand/components/ZustandEventFilterView.js +39 -1
  26. package/lib/module/zustand/components/ZustandIcon.js +11 -1
  27. package/lib/module/zustand/components/ZustandModal.js +767 -1
  28. package/lib/module/zustand/components/ZustandStateChangeItem.js +113 -1
  29. package/lib/module/zustand/components/ZustandStateDetailContent.js +368 -1
  30. package/lib/module/zustand/components/ZustandStateInfoView.js +483 -1
  31. package/lib/module/zustand/components/ZustandStoreBrowser.js +200 -1
  32. package/lib/module/zustand/components/ZustandStoreDetailContent.js +469 -1
  33. package/lib/module/zustand/components/ZustandStoreEditorScreen.js +389 -1
  34. package/lib/module/zustand/hooks/useZustandStateChanges.js +70 -1
  35. package/lib/module/zustand/sync/zustandSyncAdapter.js +380 -1
  36. package/lib/module/zustand/utils/buoyZustandMiddleware.js +278 -1
  37. package/lib/module/zustand/utils/editableState.js +138 -1
  38. package/lib/module/zustand/utils/snapshotProvider.js +209 -1
  39. package/lib/module/zustand/utils/testIDs.js +74 -1
  40. package/lib/module/zustand/utils/zustandStateStore.js +375 -1
  41. package/lib/typescript/index.d.ts.map +1 -0
  42. package/lib/typescript/preset.d.ts.map +1 -0
  43. package/lib/typescript/zustand/components/ZustandActionButton.d.ts.map +1 -0
  44. package/lib/typescript/zustand/components/ZustandDetailViewToggle.d.ts.map +1 -0
  45. package/lib/typescript/zustand/components/ZustandEventFilterView.d.ts.map +1 -0
  46. package/lib/typescript/zustand/components/ZustandIcon.d.ts.map +1 -0
  47. package/lib/typescript/zustand/components/ZustandModal.d.ts.map +1 -0
  48. package/lib/typescript/zustand/components/ZustandStateChangeItem.d.ts.map +1 -0
  49. package/lib/typescript/zustand/components/ZustandStateDetailContent.d.ts.map +1 -0
  50. package/lib/typescript/zustand/components/ZustandStateInfoView.d.ts.map +1 -0
  51. package/lib/typescript/zustand/components/ZustandStoreBrowser.d.ts.map +1 -0
  52. package/lib/typescript/zustand/components/ZustandStoreDetailContent.d.ts.map +1 -0
  53. package/lib/typescript/zustand/components/ZustandStoreEditorScreen.d.ts.map +1 -0
  54. package/lib/typescript/zustand/hooks/useZustandStateChanges.d.ts.map +1 -0
  55. package/lib/typescript/zustand/sync/zustandSyncAdapter.d.ts.map +1 -0
  56. package/lib/typescript/zustand/types/index.d.ts.map +1 -0
  57. package/lib/typescript/zustand/utils/buoyZustandMiddleware.d.ts.map +1 -0
  58. package/lib/typescript/zustand/utils/editableState.d.ts.map +1 -0
  59. package/lib/typescript/zustand/utils/snapshotProvider.d.ts.map +1 -0
  60. package/lib/typescript/zustand/utils/testIDs.d.ts.map +1 -0
  61. package/lib/typescript/zustand/utils/zustandStateStore.d.ts.map +1 -0
  62. package/package.json +3 -3
@@ -1 +1,483 @@
1
- "use strict";import React,{memo,useCallback,useState,useEffect}from"react";import{View,Text,StyleSheet,ScrollView}from"react-native";import{buoyColors,night,Clock,AlertTriangle,Zap,Info,Box,Database,parseValue,ProUpgradeModal,copyToClipboard,InfoRow,monoFont}from"@buoy-gg/shared-ui";import{useIsPro}from"@buoy-gg/license";import{DataViewer}from"@buoy-gg/shared-ui/dataViewer";import{ZustandActionButton}from"./ZustandActionButton";import{zustandStateStore}from"../utils/zustandStateStore";import{ZUSTAND_TEST_ID}from"../utils/testIDs";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function getCategoryInfo(e){switch(e){case"replace":return{label:"REPLACE",color:buoyColors.warning,bgColor:buoyColors.warning+"26"};case"persist":return{label:"PERSIST",color:buoyColors.info,bgColor:buoyColors.info+"26"};case"initial":return{label:"INITIAL",color:night.color.textTertiary,bgColor:night.color.textTertiary+"26"};default:return{label:"SET STATE",color:buoyColors.success,bgColor:buoyColors.success+"26"}}}function formatDuration(e){return void 0===e?"N/A":e<1?"<1ms":`${e.toFixed(1)}ms`}function SectionHeader({icon:e,title:t,badge:o,testID:r}){return _jsxs(View,{style:styles.sectionHeader,testID:r,children:[_jsxs(View,{style:styles.sectionHeaderLeft,children:[_jsx(e,{size:14,color:night.color.accent}),_jsx(Text,{style:styles.sectionTitle,children:t})]}),o]})}function formatTime(e){const t=new Date(e);return`${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}:${t.getSeconds().toString().padStart(2,"0")}.${t.getMilliseconds().toString().padStart(3,"0")}`}export const ZustandStateInfoView=memo(function({change:e}){const t=useIsPro(),[o,r]=useState(!1);useEffect(()=>{o&&t&&r(!1)},[o,t]);const a=getCategoryInfo(e.category),s=void 0!==e.partial&&"(updater fn)"!==e.partial,n=e.changedKeys.length>0,i=zustandStateStore.getStoreColor(e.storeName),l=useCallback(async()=>{t?await copyToClipboard(e.nextState):r(!0)},[e.nextState,t]),c=useCallback(()=>{const t=zustandStateStore.getStore(e.storeName);if(t?.api.getInitialState){const e=t.api.getInitialState();t.api.setState(e,!0)}},[e.storeName]),d=useCallback(()=>{const t=zustandStateStore.getStore(e.storeName);t&&t.api.setState(e.nextState,!0)},[e.storeName,e.nextState]);return _jsxs(ScrollView,{style:styles.container,contentContainerStyle:styles.contentContainer,showsVerticalScrollIndicator:!1,testID:`${ZUSTAND_TEST_ID}-detail-scroll`,children:[_jsxs(View,{style:styles.card,testID:`${ZUSTAND_TEST_ID}-info-card`,children:[_jsx(SectionHeader,{icon:Info,title:"CHANGE INFO"}),_jsxs(View,{style:styles.cardContent,children:[_jsx(InfoRow,{label:"Store",value:e.storeName,mono:!0,valueColor:i,testID:`${ZUSTAND_TEST_ID}-info-store`}),_jsx(InfoRow,{label:"Time",value:formatTime(e.timestamp),mono:!0,testID:`${ZUSTAND_TEST_ID}-info-time`}),_jsxs(View,{style:styles.badgeRow,children:[_jsx(View,{style:[styles.categoryBadge,{backgroundColor:a.bgColor}],children:_jsx(Text,{style:[styles.categoryText,{color:a.color}],testID:`${ZUSTAND_TEST_ID}-info-category`,children:a.label})}),_jsxs(View,{style:[styles.durationBadge,e.isSlowUpdate&&styles.durationBadgeSlow],children:[_jsx(Clock,{size:10,color:e.isSlowUpdate?buoyColors.error:night.color.textSecondary}),_jsx(Text,{style:[styles.durationText,e.isSlowUpdate&&styles.durationTextSlow],testID:`${ZUSTAND_TEST_ID}-info-duration`,children:formatDuration(e.duration)}),e.isSlowUpdate&&_jsx(AlertTriangle,{size:10,color:buoyColors.error})]}),e.hasStateChange?_jsxs(View,{style:styles.changesBadge,children:[_jsx(Zap,{size:10,color:buoyColors.success}),_jsx(Text,{style:styles.changesText,testID:`${ZUSTAND_TEST_ID}-info-changes`,children:e.diffSummary||"changed"})]}):_jsx(View,{style:styles.noChangesBadge,children:_jsx(Text,{style:styles.noChangesText,testID:`${ZUSTAND_TEST_ID}-info-no-changes`,children:"no change"})}),e.isPersisted&&_jsxs(View,{style:styles.persistBadge,children:[_jsx(Database,{size:10,color:buoyColors.info}),_jsx(Text,{style:styles.persistText,testID:`${ZUSTAND_TEST_ID}-info-persisted`,children:"PERSISTED"})]})]})]})]}),n&&_jsxs(View,{style:styles.card,testID:`${ZUSTAND_TEST_ID}-keys-card`,children:[_jsx(SectionHeader,{icon:Zap,title:"CHANGED KEYS",badge:_jsx(View,{style:styles.countBadge,children:_jsx(Text,{style:styles.countText,testID:`${ZUSTAND_TEST_ID}-keys-count`,children:e.changedKeys.length})})}),_jsx(View,{style:styles.cardContent,children:_jsx(View,{style:styles.keysContainer,children:e.changedKeys.map(e=>_jsx(View,{style:styles.keyBadge,children:_jsx(Text,{style:styles.keyText,testID:`${ZUSTAND_TEST_ID}-key-${e}`,children:e})},e))})})]}),s&&_jsxs(View,{style:styles.card,testID:`${ZUSTAND_TEST_ID}-partial-card`,children:[_jsx(SectionHeader,{icon:Box,title:"PARTIAL (setState argument)",badge:_jsx(View,{style:styles.typeBadge,children:_jsx(Text,{style:styles.typeText,testID:`${ZUSTAND_TEST_ID}-partial-type`,children:Array.isArray(e.partial)?"ARRAY":"object"==typeof e.partial?"OBJECT":String(typeof e.partial).toUpperCase()})})}),_jsx(View,{style:styles.dataViewerContainer,children:_jsx(DataViewer,{title:"",data:parseValue(e.partial),showTypeFilter:!0,rawMode:!0,initialExpanded:!0})})]}),"(updater fn)"===e.partial&&_jsxs(View,{style:styles.card,testID:`${ZUSTAND_TEST_ID}-updater-card`,children:[_jsx(SectionHeader,{icon:Box,title:"SET STATE CALL"}),_jsxs(View,{style:styles.cardContent,children:[_jsx(Text,{style:styles.updaterText,children:"Called with an updater function: set((state) => ...)"}),_jsx(Text,{style:styles.updaterSubtext,children:"The partial value is computed at runtime from the previous state. See the DIFF tab to view the resulting changes."})]})]}),_jsxs(View,{style:styles.actionsGrid,children:[_jsx(ZustandActionButton,{type:"jump",text:"JUMP",onPress:d,testID:`${ZUSTAND_TEST_ID}-jump`}),_jsx(ZustandActionButton,{type:"reset",text:"RESET STORE",onPress:c,testID:`${ZUSTAND_TEST_ID}-reset`}),_jsx(ZustandActionButton,{type:"copy",text:"COPY STATE",onPress:l,testID:`${ZUSTAND_TEST_ID}-copy-state`})]}),_jsx(ProUpgradeModal,{visible:o,onClose:()=>r(!1),featureName:"Copy"})]})});const styles=StyleSheet.create({container:{flex:1},contentContainer:{padding:8,paddingBottom:100,gap:16},card:{backgroundColor:night.color.surface,borderRadius:6,borderWidth:1,borderColor:night.color.accentBorderStrong,overflow:"hidden",shadowColor:night.color.accent,shadowOffset:{width:0,height:0},shadowOpacity:.1,shadowRadius:6},sectionHeader:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingHorizontal:12,paddingVertical:10,borderBottomWidth:1,borderBottomColor:night.color.accentBorder,backgroundColor:night.color.accentSoft},sectionHeaderLeft:{flexDirection:"row",alignItems:"center",gap:6},sectionTitle:{fontSize:12,fontWeight:"600",letterSpacing:.5,color:night.color.accent,fontFamily:monoFont},cardContent:{padding:14,gap:10},badgeRow:{flexDirection:"row",flexWrap:"wrap",gap:8,marginTop:6},categoryBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4},categoryText:{fontSize:9,fontWeight:"700",letterSpacing:.3},durationBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:night.color.surfaceElevated},durationBadgeSlow:{backgroundColor:buoyColors.error+"26"},durationText:{fontSize:9,fontWeight:"600",color:night.color.textSecondary,fontFamily:monoFont},durationTextSlow:{color:buoyColors.error},changesBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:buoyColors.success+"26"},changesText:{fontSize:9,fontWeight:"600",color:buoyColors.success},noChangesBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:night.color.surfaceElevated},noChangesText:{fontSize:9,fontWeight:"600",color:night.color.textTertiary},persistBadge:{flexDirection:"row",alignItems:"center",gap:4,paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:buoyColors.info+"26"},persistText:{fontSize:9,fontWeight:"700",color:buoyColors.info,letterSpacing:.3},keysContainer:{flexDirection:"row",flexWrap:"wrap",gap:6},keyBadge:{paddingHorizontal:8,paddingVertical:4,borderRadius:4,backgroundColor:night.color.accentSoft,borderWidth:1,borderColor:night.color.accentBorder},keyText:{fontSize:11,fontWeight:"600",color:night.color.accent,fontFamily:monoFont},countBadge:{paddingHorizontal:8,paddingVertical:3,borderRadius:4,backgroundColor:night.color.accentFill},countText:{fontSize:9,fontWeight:"700",color:night.color.accent,fontFamily:monoFont},typeBadge:{paddingHorizontal:6,paddingVertical:2,borderRadius:3,backgroundColor:night.color.surfaceElevated},typeText:{fontSize:8,fontWeight:"600",color:night.color.textTertiary,fontFamily:monoFont},dataViewerContainer:{backgroundColor:night.color.bg,minHeight:60},updaterText:{fontSize:12,color:night.color.text,fontFamily:monoFont},updaterSubtext:{fontSize:11,color:night.color.textTertiary,lineHeight:16,marginTop:4},actionsGrid:{flexDirection:"row",flexWrap:"wrap",gap:12,justifyContent:"flex-start"}});
1
+ "use strict";
2
+
3
+ /**
4
+ * ZustandStateInfoView
5
+ *
6
+ * Displays comprehensive state change information including:
7
+ * - Change metadata (store, category, duration)
8
+ * - Partial data passed to setState
9
+ * - Changed keys list
10
+ *
11
+ * Mirrors ReduxActionInfoView.tsx
12
+ */
13
+
14
+ import React, { memo, useCallback, useState, useEffect } from "react";
15
+ import { View, Text, StyleSheet, ScrollView } from "react-native";
16
+ import { buoyColors, night, Clock, AlertTriangle, Zap, Info, Box, Database, parseValue, ProUpgradeModal, copyToClipboard, InfoRow, monoFont } from "@buoy-gg/shared-ui";
17
+ import { useIsPro } from "@buoy-gg/license";
18
+ import { DataViewer } from "@buoy-gg/shared-ui/dataViewer";
19
+ import { ZustandActionButton } from "./ZustandActionButton";
20
+ import { zustandStateStore } from "../utils/zustandStateStore";
21
+ import { ZUSTAND_TEST_ID } from "../utils/testIDs";
22
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
+ function getCategoryInfo(category) {
24
+ switch (category) {
25
+ case "replace":
26
+ return {
27
+ label: "REPLACE",
28
+ color: buoyColors.warning,
29
+ bgColor: buoyColors.warning + "26"
30
+ };
31
+ case "persist":
32
+ return {
33
+ label: "PERSIST",
34
+ color: buoyColors.info,
35
+ bgColor: buoyColors.info + "26"
36
+ };
37
+ case "initial":
38
+ return {
39
+ label: "INITIAL",
40
+ color: night.color.textTertiary,
41
+ bgColor: night.color.textTertiary + "26"
42
+ };
43
+ default:
44
+ return {
45
+ label: "SET STATE",
46
+ color: buoyColors.success,
47
+ bgColor: buoyColors.success + "26"
48
+ };
49
+ }
50
+ }
51
+ function formatDuration(duration) {
52
+ if (duration === undefined) return "N/A";
53
+ if (duration < 1) return "<1ms";
54
+ return `${duration.toFixed(1)}ms`;
55
+ }
56
+ function SectionHeader({
57
+ icon: Icon,
58
+ title,
59
+ badge,
60
+ testID
61
+ }) {
62
+ return /*#__PURE__*/_jsxs(View, {
63
+ style: styles.sectionHeader,
64
+ testID: testID,
65
+ children: [/*#__PURE__*/_jsxs(View, {
66
+ style: styles.sectionHeaderLeft,
67
+ children: [/*#__PURE__*/_jsx(Icon, {
68
+ size: 14,
69
+ color: night.color.accent
70
+ }), /*#__PURE__*/_jsx(Text, {
71
+ style: styles.sectionTitle,
72
+ children: title
73
+ })]
74
+ }), badge]
75
+ });
76
+ }
77
+ function formatTime(timestamp) {
78
+ const date = new Date(timestamp);
79
+ const hours = date.getHours().toString().padStart(2, "0");
80
+ const minutes = date.getMinutes().toString().padStart(2, "0");
81
+ const seconds = date.getSeconds().toString().padStart(2, "0");
82
+ const ms = date.getMilliseconds().toString().padStart(3, "0");
83
+ return `${hours}:${minutes}:${seconds}.${ms}`;
84
+ }
85
+ export const ZustandStateInfoView = /*#__PURE__*/memo(function ZustandStateInfoView({
86
+ change
87
+ }) {
88
+ const isPro = useIsPro();
89
+ const [showProModal, setShowProModal] = useState(false);
90
+ useEffect(() => {
91
+ if (showProModal && isPro) {
92
+ setShowProModal(false);
93
+ }
94
+ }, [showProModal, isPro]);
95
+ const categoryInfo = getCategoryInfo(change.category);
96
+ const hasPartial = change.partial !== undefined && change.partial !== "(updater fn)";
97
+ const hasChangedKeys = change.changedKeys.length > 0;
98
+ const storeColor = zustandStateStore.getStoreColor(change.storeName);
99
+ const handleCopyState = useCallback(async () => {
100
+ if (!isPro) {
101
+ setShowProModal(true);
102
+ return;
103
+ }
104
+ await copyToClipboard(change.nextState);
105
+ }, [change.nextState, isPro]);
106
+ const handleResetStore = useCallback(() => {
107
+ const storeInfo = zustandStateStore.getStore(change.storeName);
108
+ if (storeInfo?.api.getInitialState) {
109
+ const initialState = storeInfo.api.getInitialState();
110
+ storeInfo.api.setState(initialState, true);
111
+ }
112
+ }, [change.storeName]);
113
+ const handleJumpToState = useCallback(() => {
114
+ const storeInfo = zustandStateStore.getStore(change.storeName);
115
+ if (storeInfo) {
116
+ storeInfo.api.setState(change.nextState, true);
117
+ }
118
+ }, [change.storeName, change.nextState]);
119
+ return /*#__PURE__*/_jsxs(ScrollView, {
120
+ style: styles.container,
121
+ contentContainerStyle: styles.contentContainer,
122
+ showsVerticalScrollIndicator: false,
123
+ testID: `${ZUSTAND_TEST_ID}-detail-scroll`,
124
+ children: [/*#__PURE__*/_jsxs(View, {
125
+ style: styles.card,
126
+ testID: `${ZUSTAND_TEST_ID}-info-card`,
127
+ children: [/*#__PURE__*/_jsx(SectionHeader, {
128
+ icon: Info,
129
+ title: "CHANGE INFO"
130
+ }), /*#__PURE__*/_jsxs(View, {
131
+ style: styles.cardContent,
132
+ children: [/*#__PURE__*/_jsx(InfoRow, {
133
+ label: "Store",
134
+ value: change.storeName,
135
+ mono: true,
136
+ valueColor: storeColor,
137
+ testID: `${ZUSTAND_TEST_ID}-info-store`
138
+ }), /*#__PURE__*/_jsx(InfoRow, {
139
+ label: "Time",
140
+ value: formatTime(change.timestamp),
141
+ mono: true,
142
+ testID: `${ZUSTAND_TEST_ID}-info-time`
143
+ }), /*#__PURE__*/_jsxs(View, {
144
+ style: styles.badgeRow,
145
+ children: [/*#__PURE__*/_jsx(View, {
146
+ style: [styles.categoryBadge, {
147
+ backgroundColor: categoryInfo.bgColor
148
+ }],
149
+ children: /*#__PURE__*/_jsx(Text, {
150
+ style: [styles.categoryText, {
151
+ color: categoryInfo.color
152
+ }],
153
+ testID: `${ZUSTAND_TEST_ID}-info-category`,
154
+ children: categoryInfo.label
155
+ })
156
+ }), /*#__PURE__*/_jsxs(View, {
157
+ style: [styles.durationBadge, change.isSlowUpdate && styles.durationBadgeSlow],
158
+ children: [/*#__PURE__*/_jsx(Clock, {
159
+ size: 10,
160
+ color: change.isSlowUpdate ? buoyColors.error : night.color.textSecondary
161
+ }), /*#__PURE__*/_jsx(Text, {
162
+ style: [styles.durationText, change.isSlowUpdate && styles.durationTextSlow],
163
+ testID: `${ZUSTAND_TEST_ID}-info-duration`,
164
+ children: formatDuration(change.duration)
165
+ }), change.isSlowUpdate && /*#__PURE__*/_jsx(AlertTriangle, {
166
+ size: 10,
167
+ color: buoyColors.error
168
+ })]
169
+ }), change.hasStateChange ? /*#__PURE__*/_jsxs(View, {
170
+ style: styles.changesBadge,
171
+ children: [/*#__PURE__*/_jsx(Zap, {
172
+ size: 10,
173
+ color: buoyColors.success
174
+ }), /*#__PURE__*/_jsx(Text, {
175
+ style: styles.changesText,
176
+ testID: `${ZUSTAND_TEST_ID}-info-changes`,
177
+ children: change.diffSummary || "changed"
178
+ })]
179
+ }) : /*#__PURE__*/_jsx(View, {
180
+ style: styles.noChangesBadge,
181
+ children: /*#__PURE__*/_jsx(Text, {
182
+ style: styles.noChangesText,
183
+ testID: `${ZUSTAND_TEST_ID}-info-no-changes`,
184
+ children: "no change"
185
+ })
186
+ }), change.isPersisted && /*#__PURE__*/_jsxs(View, {
187
+ style: styles.persistBadge,
188
+ children: [/*#__PURE__*/_jsx(Database, {
189
+ size: 10,
190
+ color: buoyColors.info
191
+ }), /*#__PURE__*/_jsx(Text, {
192
+ style: styles.persistText,
193
+ testID: `${ZUSTAND_TEST_ID}-info-persisted`,
194
+ children: "PERSISTED"
195
+ })]
196
+ })]
197
+ })]
198
+ })]
199
+ }), hasChangedKeys && /*#__PURE__*/_jsxs(View, {
200
+ style: styles.card,
201
+ testID: `${ZUSTAND_TEST_ID}-keys-card`,
202
+ children: [/*#__PURE__*/_jsx(SectionHeader, {
203
+ icon: Zap,
204
+ title: "CHANGED KEYS",
205
+ badge: /*#__PURE__*/_jsx(View, {
206
+ style: styles.countBadge,
207
+ children: /*#__PURE__*/_jsx(Text, {
208
+ style: styles.countText,
209
+ testID: `${ZUSTAND_TEST_ID}-keys-count`,
210
+ children: change.changedKeys.length
211
+ })
212
+ })
213
+ }), /*#__PURE__*/_jsx(View, {
214
+ style: styles.cardContent,
215
+ children: /*#__PURE__*/_jsx(View, {
216
+ style: styles.keysContainer,
217
+ children: change.changedKeys.map(key => /*#__PURE__*/_jsx(View, {
218
+ style: styles.keyBadge,
219
+ children: /*#__PURE__*/_jsx(Text, {
220
+ style: styles.keyText,
221
+ testID: `${ZUSTAND_TEST_ID}-key-${key}`,
222
+ children: key
223
+ })
224
+ }, key))
225
+ })
226
+ })]
227
+ }), hasPartial && /*#__PURE__*/_jsxs(View, {
228
+ style: styles.card,
229
+ testID: `${ZUSTAND_TEST_ID}-partial-card`,
230
+ children: [/*#__PURE__*/_jsx(SectionHeader, {
231
+ icon: Box,
232
+ title: "PARTIAL (setState argument)",
233
+ badge: /*#__PURE__*/_jsx(View, {
234
+ style: styles.typeBadge,
235
+ children: /*#__PURE__*/_jsx(Text, {
236
+ style: styles.typeText,
237
+ testID: `${ZUSTAND_TEST_ID}-partial-type`,
238
+ children: Array.isArray(change.partial) ? "ARRAY" : typeof change.partial === "object" ? "OBJECT" : String(typeof change.partial).toUpperCase()
239
+ })
240
+ })
241
+ }), /*#__PURE__*/_jsx(View, {
242
+ style: styles.dataViewerContainer,
243
+ children: /*#__PURE__*/_jsx(DataViewer, {
244
+ title: "",
245
+ data: parseValue(change.partial),
246
+ showTypeFilter: true,
247
+ rawMode: true,
248
+ initialExpanded: true
249
+ })
250
+ })]
251
+ }), change.partial === "(updater fn)" && /*#__PURE__*/_jsxs(View, {
252
+ style: styles.card,
253
+ testID: `${ZUSTAND_TEST_ID}-updater-card`,
254
+ children: [/*#__PURE__*/_jsx(SectionHeader, {
255
+ icon: Box,
256
+ title: "SET STATE CALL"
257
+ }), /*#__PURE__*/_jsxs(View, {
258
+ style: styles.cardContent,
259
+ children: [/*#__PURE__*/_jsx(Text, {
260
+ style: styles.updaterText,
261
+ children: "Called with an updater function: set((state) => ...)"
262
+ }), /*#__PURE__*/_jsx(Text, {
263
+ style: styles.updaterSubtext,
264
+ children: "The partial value is computed at runtime from the previous state. See the DIFF tab to view the resulting changes."
265
+ })]
266
+ })]
267
+ }), /*#__PURE__*/_jsxs(View, {
268
+ style: styles.actionsGrid,
269
+ children: [/*#__PURE__*/_jsx(ZustandActionButton, {
270
+ type: "jump",
271
+ text: "JUMP",
272
+ onPress: handleJumpToState,
273
+ testID: `${ZUSTAND_TEST_ID}-jump`
274
+ }), /*#__PURE__*/_jsx(ZustandActionButton, {
275
+ type: "reset",
276
+ text: "RESET STORE",
277
+ onPress: handleResetStore,
278
+ testID: `${ZUSTAND_TEST_ID}-reset`
279
+ }), /*#__PURE__*/_jsx(ZustandActionButton, {
280
+ type: "copy",
281
+ text: "COPY STATE",
282
+ onPress: handleCopyState,
283
+ testID: `${ZUSTAND_TEST_ID}-copy-state`
284
+ })]
285
+ }), /*#__PURE__*/_jsx(ProUpgradeModal, {
286
+ visible: showProModal,
287
+ onClose: () => setShowProModal(false),
288
+ featureName: "Copy"
289
+ })]
290
+ });
291
+ });
292
+ const styles = StyleSheet.create({
293
+ container: {
294
+ flex: 1
295
+ },
296
+ contentContainer: {
297
+ padding: 8,
298
+ paddingBottom: 100,
299
+ gap: 16
300
+ },
301
+ card: {
302
+ backgroundColor: night.color.surface,
303
+ borderRadius: 6,
304
+ borderWidth: 1,
305
+ borderColor: night.color.accentBorderStrong,
306
+ overflow: "hidden",
307
+ shadowColor: night.color.accent,
308
+ shadowOffset: {
309
+ width: 0,
310
+ height: 0
311
+ },
312
+ shadowOpacity: 0.1,
313
+ shadowRadius: 6
314
+ },
315
+ sectionHeader: {
316
+ flexDirection: "row",
317
+ alignItems: "center",
318
+ justifyContent: "space-between",
319
+ paddingHorizontal: 12,
320
+ paddingVertical: 10,
321
+ borderBottomWidth: 1,
322
+ borderBottomColor: night.color.accentBorder,
323
+ backgroundColor: night.color.accentSoft
324
+ },
325
+ sectionHeaderLeft: {
326
+ flexDirection: "row",
327
+ alignItems: "center",
328
+ gap: 6
329
+ },
330
+ sectionTitle: {
331
+ fontSize: 12,
332
+ fontWeight: "600",
333
+ letterSpacing: 0.5,
334
+ color: night.color.accent,
335
+ fontFamily: monoFont
336
+ },
337
+ cardContent: {
338
+ padding: 14,
339
+ gap: 10
340
+ },
341
+ badgeRow: {
342
+ flexDirection: "row",
343
+ flexWrap: "wrap",
344
+ gap: 8,
345
+ marginTop: 6
346
+ },
347
+ categoryBadge: {
348
+ paddingHorizontal: 8,
349
+ paddingVertical: 3,
350
+ borderRadius: 4
351
+ },
352
+ categoryText: {
353
+ fontSize: 9,
354
+ fontWeight: "700",
355
+ letterSpacing: 0.3
356
+ },
357
+ durationBadge: {
358
+ flexDirection: "row",
359
+ alignItems: "center",
360
+ gap: 4,
361
+ paddingHorizontal: 8,
362
+ paddingVertical: 3,
363
+ borderRadius: 4,
364
+ backgroundColor: night.color.surfaceElevated
365
+ },
366
+ durationBadgeSlow: {
367
+ backgroundColor: buoyColors.error + "26"
368
+ },
369
+ durationText: {
370
+ fontSize: 9,
371
+ fontWeight: "600",
372
+ color: night.color.textSecondary,
373
+ fontFamily: monoFont
374
+ },
375
+ durationTextSlow: {
376
+ color: buoyColors.error
377
+ },
378
+ changesBadge: {
379
+ flexDirection: "row",
380
+ alignItems: "center",
381
+ gap: 4,
382
+ paddingHorizontal: 8,
383
+ paddingVertical: 3,
384
+ borderRadius: 4,
385
+ backgroundColor: buoyColors.success + "26"
386
+ },
387
+ changesText: {
388
+ fontSize: 9,
389
+ fontWeight: "600",
390
+ color: buoyColors.success
391
+ },
392
+ noChangesBadge: {
393
+ paddingHorizontal: 8,
394
+ paddingVertical: 3,
395
+ borderRadius: 4,
396
+ backgroundColor: night.color.surfaceElevated
397
+ },
398
+ noChangesText: {
399
+ fontSize: 9,
400
+ fontWeight: "600",
401
+ color: night.color.textTertiary
402
+ },
403
+ persistBadge: {
404
+ flexDirection: "row",
405
+ alignItems: "center",
406
+ gap: 4,
407
+ paddingHorizontal: 8,
408
+ paddingVertical: 3,
409
+ borderRadius: 4,
410
+ backgroundColor: buoyColors.info + "26"
411
+ },
412
+ persistText: {
413
+ fontSize: 9,
414
+ fontWeight: "700",
415
+ color: buoyColors.info,
416
+ letterSpacing: 0.3
417
+ },
418
+ keysContainer: {
419
+ flexDirection: "row",
420
+ flexWrap: "wrap",
421
+ gap: 6
422
+ },
423
+ keyBadge: {
424
+ paddingHorizontal: 8,
425
+ paddingVertical: 4,
426
+ borderRadius: 4,
427
+ backgroundColor: night.color.accentSoft,
428
+ borderWidth: 1,
429
+ borderColor: night.color.accentBorder
430
+ },
431
+ keyText: {
432
+ fontSize: 11,
433
+ fontWeight: "600",
434
+ color: night.color.accent,
435
+ fontFamily: monoFont
436
+ },
437
+ countBadge: {
438
+ paddingHorizontal: 8,
439
+ paddingVertical: 3,
440
+ borderRadius: 4,
441
+ backgroundColor: night.color.accentFill
442
+ },
443
+ countText: {
444
+ fontSize: 9,
445
+ fontWeight: "700",
446
+ color: night.color.accent,
447
+ fontFamily: monoFont
448
+ },
449
+ typeBadge: {
450
+ paddingHorizontal: 6,
451
+ paddingVertical: 2,
452
+ borderRadius: 3,
453
+ backgroundColor: night.color.surfaceElevated
454
+ },
455
+ typeText: {
456
+ fontSize: 8,
457
+ fontWeight: "600",
458
+ color: night.color.textTertiary,
459
+ fontFamily: monoFont
460
+ },
461
+ dataViewerContainer: {
462
+ // Inset display panel — darker than the card, the night track color.
463
+ backgroundColor: night.color.bg,
464
+ minHeight: 60
465
+ },
466
+ updaterText: {
467
+ fontSize: 12,
468
+ color: night.color.text,
469
+ fontFamily: monoFont
470
+ },
471
+ updaterSubtext: {
472
+ fontSize: 11,
473
+ color: night.color.textTertiary,
474
+ lineHeight: 16,
475
+ marginTop: 4
476
+ },
477
+ actionsGrid: {
478
+ flexDirection: "row",
479
+ flexWrap: "wrap",
480
+ gap: 12,
481
+ justifyContent: "flex-start"
482
+ }
483
+ });