@buoy-gg/zustand 7.0.41 → 7.0.43
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/README.md +11 -76
- package/lib/commonjs/index.js +1 -105
- package/lib/commonjs/preset.js +1 -102
- package/lib/commonjs/zustand/components/ZustandActionButton.js +1 -118
- package/lib/commonjs/zustand/components/ZustandDetailViewToggle.js +1 -48
- package/lib/commonjs/zustand/components/ZustandEventFilterView.js +1 -43
- package/lib/commonjs/zustand/components/ZustandIcon.js +1 -18
- package/lib/commonjs/zustand/components/ZustandModal.js +1 -772
- package/lib/commonjs/zustand/components/ZustandStateChangeItem.js +1 -117
- package/lib/commonjs/zustand/components/ZustandStateDetailContent.js +1 -372
- package/lib/commonjs/zustand/components/ZustandStateInfoView.js +1 -488
- package/lib/commonjs/zustand/components/ZustandStoreBrowser.js +1 -204
- package/lib/commonjs/zustand/components/ZustandStoreDetailContent.js +1 -471
- package/lib/commonjs/zustand/hooks/useZustandStateChanges.js +1 -74
- package/lib/commonjs/zustand/sync/zustandSyncAdapter.js +1 -418
- package/lib/commonjs/zustand/types/index.js +1 -1
- package/lib/commonjs/zustand/utils/buoyZustandMiddleware.js +1 -284
- package/lib/commonjs/zustand/utils/editableState.js +1 -146
- package/lib/commonjs/zustand/utils/snapshotProvider.js +1 -209
- package/lib/commonjs/zustand/utils/testIDs.js +1 -82
- package/lib/commonjs/zustand/utils/zustandStateStore.js +1 -379
- package/lib/module/index.js +1 -90
- package/lib/module/preset.js +1 -98
- package/lib/module/zustand/components/ZustandActionButton.js +1 -114
- package/lib/module/zustand/components/ZustandDetailViewToggle.js +1 -43
- package/lib/module/zustand/components/ZustandEventFilterView.js +1 -39
- package/lib/module/zustand/components/ZustandIcon.js +1 -11
- package/lib/module/zustand/components/ZustandModal.js +1 -767
- package/lib/module/zustand/components/ZustandStateChangeItem.js +1 -113
- package/lib/module/zustand/components/ZustandStateDetailContent.js +1 -368
- package/lib/module/zustand/components/ZustandStateInfoView.js +1 -483
- package/lib/module/zustand/components/ZustandStoreBrowser.js +1 -200
- package/lib/module/zustand/components/ZustandStoreDetailContent.js +1 -469
- package/lib/module/zustand/hooks/useZustandStateChanges.js +1 -70
- package/lib/module/zustand/sync/zustandSyncAdapter.js +1 -415
- package/lib/module/zustand/types/index.js +1 -1
- package/lib/module/zustand/utils/buoyZustandMiddleware.js +1 -278
- package/lib/module/zustand/utils/editableState.js +1 -138
- package/lib/module/zustand/utils/snapshotProvider.js +1 -209
- package/lib/module/zustand/utils/testIDs.js +1 -74
- package/lib/module/zustand/utils/zustandStateStore.js +1 -375
- package/lib/web/index.mjs +2 -3
- package/package.json +4 -7
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/preset.d.ts.map +0 -1
- package/lib/typescript/zustand/components/ZustandActionButton.d.ts.map +0 -1
- package/lib/typescript/zustand/components/ZustandDetailViewToggle.d.ts.map +0 -1
- package/lib/typescript/zustand/components/ZustandEventFilterView.d.ts.map +0 -1
- package/lib/typescript/zustand/components/ZustandIcon.d.ts.map +0 -1
- package/lib/typescript/zustand/components/ZustandModal.d.ts.map +0 -1
- package/lib/typescript/zustand/components/ZustandStateChangeItem.d.ts.map +0 -1
- package/lib/typescript/zustand/components/ZustandStateDetailContent.d.ts.map +0 -1
- package/lib/typescript/zustand/components/ZustandStateInfoView.d.ts.map +0 -1
- package/lib/typescript/zustand/components/ZustandStoreBrowser.d.ts.map +0 -1
- package/lib/typescript/zustand/components/ZustandStoreDetailContent.d.ts.map +0 -1
- package/lib/typescript/zustand/hooks/useZustandStateChanges.d.ts.map +0 -1
- package/lib/typescript/zustand/sync/zustandSyncAdapter.d.ts.map +0 -1
- package/lib/typescript/zustand/types/index.d.ts.map +0 -1
- package/lib/typescript/zustand/utils/buoyZustandMiddleware.d.ts.map +0 -1
- package/lib/typescript/zustand/utils/editableState.d.ts.map +0 -1
- package/lib/typescript/zustand/utils/snapshotProvider.d.ts.map +0 -1
- package/lib/typescript/zustand/utils/testIDs.d.ts.map +0 -1
- package/lib/typescript/zustand/utils/zustandStateStore.d.ts.map +0 -1
|
@@ -1,114 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* ZustandActionButton
|
|
5
|
-
*
|
|
6
|
-
* Generic action button for Zustand DevTools footer.
|
|
7
|
-
* Mirrors ReduxActionButton.tsx
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { TouchableOpacity, Text, View, StyleSheet } from "react-native";
|
|
11
|
-
import { night, monoFont } from "@buoy-gg/shared-ui";
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
const buttonConfigs = {
|
|
14
|
-
copy: {
|
|
15
|
-
color: night.color.accent,
|
|
16
|
-
backgroundColor: night.color.accentSoft,
|
|
17
|
-
borderColor: night.color.accentBorder,
|
|
18
|
-
textColor: night.color.accent
|
|
19
|
-
},
|
|
20
|
-
reset: {
|
|
21
|
-
color: night.color.warning,
|
|
22
|
-
backgroundColor: night.color.warningSoft,
|
|
23
|
-
borderColor: night.color.warning + "40",
|
|
24
|
-
textColor: night.color.warning
|
|
25
|
-
},
|
|
26
|
-
clear: {
|
|
27
|
-
color: night.color.danger,
|
|
28
|
-
backgroundColor: night.color.dangerSoft,
|
|
29
|
-
borderColor: night.color.danger + "40",
|
|
30
|
-
textColor: night.color.danger
|
|
31
|
-
},
|
|
32
|
-
jump: {
|
|
33
|
-
color: night.color.warning,
|
|
34
|
-
backgroundColor: night.color.warningSoft,
|
|
35
|
-
borderColor: night.color.warning + "40",
|
|
36
|
-
textColor: night.color.warning
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
export function ZustandActionButton({
|
|
40
|
-
onPress,
|
|
41
|
-
text,
|
|
42
|
-
type,
|
|
43
|
-
disabled = false,
|
|
44
|
-
testID
|
|
45
|
-
}) {
|
|
46
|
-
const config = buttonConfigs[type];
|
|
47
|
-
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
48
|
-
disabled: disabled,
|
|
49
|
-
onPress: onPress,
|
|
50
|
-
style: [styles.button, {
|
|
51
|
-
backgroundColor: disabled ? night.color.textTertiary + "1A" : config.backgroundColor,
|
|
52
|
-
borderColor: disabled ? night.color.textTertiary + "33" : config.borderColor,
|
|
53
|
-
opacity: disabled ? 0.5 : 1
|
|
54
|
-
}],
|
|
55
|
-
activeOpacity: 0.7,
|
|
56
|
-
testID: testID,
|
|
57
|
-
accessibilityRole: "button",
|
|
58
|
-
accessibilityLabel: text,
|
|
59
|
-
accessibilityState: {
|
|
60
|
-
disabled
|
|
61
|
-
},
|
|
62
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
63
|
-
style: [styles.dot, {
|
|
64
|
-
backgroundColor: disabled ? night.color.textTertiary : config.color
|
|
65
|
-
}]
|
|
66
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
67
|
-
style: [styles.text, {
|
|
68
|
-
color: disabled ? night.color.textTertiary : config.textColor
|
|
69
|
-
}],
|
|
70
|
-
children: text
|
|
71
|
-
})]
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
const styles = StyleSheet.create({
|
|
75
|
-
button: {
|
|
76
|
-
flexDirection: "row",
|
|
77
|
-
alignItems: "center",
|
|
78
|
-
justifyContent: "center",
|
|
79
|
-
borderRadius: 6,
|
|
80
|
-
borderWidth: 1,
|
|
81
|
-
paddingHorizontal: 12,
|
|
82
|
-
paddingVertical: 6,
|
|
83
|
-
height: 25,
|
|
84
|
-
minWidth: 80,
|
|
85
|
-
shadowOffset: {
|
|
86
|
-
width: 0,
|
|
87
|
-
height: 1
|
|
88
|
-
},
|
|
89
|
-
shadowOpacity: 0.2,
|
|
90
|
-
shadowRadius: 2,
|
|
91
|
-
elevation: 2
|
|
92
|
-
},
|
|
93
|
-
dot: {
|
|
94
|
-
width: 5,
|
|
95
|
-
height: 5,
|
|
96
|
-
borderRadius: 3,
|
|
97
|
-
marginRight: 6,
|
|
98
|
-
shadowColor: night.color.text,
|
|
99
|
-
shadowOffset: {
|
|
100
|
-
width: 0,
|
|
101
|
-
height: 0
|
|
102
|
-
},
|
|
103
|
-
shadowOpacity: 0.6,
|
|
104
|
-
shadowRadius: 2
|
|
105
|
-
},
|
|
106
|
-
text: {
|
|
107
|
-
fontSize: 10,
|
|
108
|
-
fontWeight: "600",
|
|
109
|
-
letterSpacing: 0.5,
|
|
110
|
-
textTransform: "uppercase",
|
|
111
|
-
fontFamily: monoFont,
|
|
112
|
-
height: 12
|
|
113
|
-
}
|
|
114
|
-
});
|
|
1
|
+
"use strict";import{TouchableOpacity as s,Text as d,View as g,StyleSheet as h}from"react-native";import{night as o,monoFont as u}from"@buoy-gg/shared-ui";import{jsx as n,jsxs as f}from"react/jsx-runtime";const C={copy:{color:o.color.accent,backgroundColor:o.color.accentSoft,borderColor:o.color.accentBorder,textColor:o.color.accent},reset:{color:o.color.warning,backgroundColor:o.color.warningSoft,borderColor:o.color.warning+"40",textColor:o.color.warning},clear:{color:o.color.danger,backgroundColor:o.color.dangerSoft,borderColor:o.color.danger+"40",textColor:o.color.danger},jump:{color:o.color.warning,backgroundColor:o.color.warningSoft,borderColor:o.color.warning+"40",textColor:o.color.warning}};export function ZustandActionButton({onPress:i,text:c,type:l,disabled:r=false,testID:a}){const t=C[l];return f(s,{disabled:r,onPress:i,style:[e.button,{backgroundColor:r?o.color.textTertiary+"1A":t.backgroundColor,borderColor:r?o.color.textTertiary+"33":t.borderColor,opacity:r?.5:1}],activeOpacity:.7,testID:a,accessibilityRole:"button",accessibilityLabel:c,accessibilityState:{disabled:r},children:[n(g,{style:[e.dot,{backgroundColor:r?o.color.textTertiary:t.color}]}),n(d,{style:[e.text,{color:r?o.color.textTertiary:t.textColor}],children:c})]})}const e=h.create({button:{flexDirection:"row",alignItems:"center",justifyContent:"center",borderRadius:6,borderWidth:1,paddingHorizontal:12,paddingVertical:6,height:25,minWidth:80,shadowOffset:{width:0,height:1},shadowOpacity:.2,shadowRadius:2,elevation:2},dot:{width:5,height:5,borderRadius:3,marginRight:6,shadowColor:o.color.text,shadowOffset:{width:0,height:0},shadowOpacity:.6,shadowRadius:2},text:{fontSize:10,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:u,height:12}});
|
|
@@ -1,43 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* ZustandDetailViewToggle
|
|
5
|
-
*
|
|
6
|
-
* Three-card toggle for switching between Change, State, and Diff views.
|
|
7
|
-
* The cards themselves are the shared `DetailViewToggle`; this file owns
|
|
8
|
-
* the zustand view list and testID prefix.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import React, { memo } from "react";
|
|
12
|
-
import { DetailViewToggle, FileText, Database, GitBranch } from "@buoy-gg/shared-ui";
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
const VIEWS = [{
|
|
15
|
-
key: "change",
|
|
16
|
-
label: "CHANGE",
|
|
17
|
-
description: "View change details",
|
|
18
|
-
icon: FileText
|
|
19
|
-
}, {
|
|
20
|
-
key: "state",
|
|
21
|
-
label: "STATE",
|
|
22
|
-
description: "View current state",
|
|
23
|
-
icon: Database
|
|
24
|
-
}, {
|
|
25
|
-
key: "diff",
|
|
26
|
-
label: "DIFF",
|
|
27
|
-
description: "Compare changes",
|
|
28
|
-
icon: GitBranch
|
|
29
|
-
}];
|
|
30
|
-
const DIFF_DISABLED = ["diff"];
|
|
31
|
-
export const ZustandDetailViewToggle = /*#__PURE__*/memo(function ZustandDetailViewToggle({
|
|
32
|
-
activeView,
|
|
33
|
-
onViewChange,
|
|
34
|
-
diffDisabled = false
|
|
35
|
-
}) {
|
|
36
|
-
return /*#__PURE__*/_jsx(DetailViewToggle, {
|
|
37
|
-
views: VIEWS,
|
|
38
|
-
activeView: activeView,
|
|
39
|
-
onViewChange: onViewChange,
|
|
40
|
-
disabledKeys: diffDisabled ? DIFF_DISABLED : undefined,
|
|
41
|
-
testIDPrefix: "buoy-zustand"
|
|
42
|
-
});
|
|
43
|
-
});
|
|
1
|
+
"use strict";import m,{memo as a}from"react";import{DetailViewToggle as n,FileText as o,Database as s,GitBranch as c}from"@buoy-gg/shared-ui";import{jsx as r}from"react/jsx-runtime";const l=[{key:"change",label:"CHANGE",description:"View change details",icon:o},{key:"state",label:"STATE",description:"View current state",icon:s},{key:"diff",label:"DIFF",description:"Compare changes",icon:c}];const d=["diff"];export const ZustandDetailViewToggle=a(function f({activeView:e,onViewChange:i,diffDisabled:t=false}){return r(n,{views:l,activeView:e,onViewChange:i,disabledKeys:t?d:void 0,testIDPrefix:"buoy-zustand"})});
|
|
@@ -1,39 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* ZustandEventFilterView
|
|
5
|
-
*
|
|
6
|
-
* The shared `EntityFilterView` with zustand's nouns: registered stores you
|
|
7
|
-
* can tap to hide, active store-name patterns, and how it works.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { useMemo } from "react";
|
|
11
|
-
import { EntityFilterView } from "@buoy-gg/shared-ui";
|
|
12
|
-
import { zustandStateStore } from "../utils/zustandStateStore";
|
|
13
|
-
import { ZUSTAND_TEST_ID, slugForTestID } from "../utils/testIDs";
|
|
14
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
const EXAMPLES = ["• auth → hides authStore from stores & events", "• temp → hides tempStore, tempUserStore", "• cart → hides cartStore from both tabs"];
|
|
16
|
-
export function ZustandEventFilterView({
|
|
17
|
-
ignoredPatterns,
|
|
18
|
-
onTogglePattern,
|
|
19
|
-
onAddPattern,
|
|
20
|
-
stores
|
|
21
|
-
}) {
|
|
22
|
-
const entities = useMemo(() => stores.map(store => ({
|
|
23
|
-
name: store.name,
|
|
24
|
-
color: zustandStateStore.getStoreColor(store.name)
|
|
25
|
-
})), [stores]);
|
|
26
|
-
return /*#__PURE__*/_jsx(EntityFilterView, {
|
|
27
|
-
entities: entities,
|
|
28
|
-
ignoredPatterns: ignoredPatterns,
|
|
29
|
-
onTogglePattern: onTogglePattern,
|
|
30
|
-
onAddPattern: onAddPattern,
|
|
31
|
-
entityNoun: "STORES",
|
|
32
|
-
entitySingular: "store",
|
|
33
|
-
entityKey: "store",
|
|
34
|
-
testIDPrefix: ZUSTAND_TEST_ID,
|
|
35
|
-
slug: slugForTestID,
|
|
36
|
-
howItWorks: "Patterns hide matching stores from both the Stores tab and the Events tab. Tap a store above to quickly add it as a filter.",
|
|
37
|
-
examples: EXAMPLES
|
|
38
|
-
});
|
|
39
|
-
}
|
|
1
|
+
"use strict";import{useMemo as n}from"react";import{EntityFilterView as a}from"@buoy-gg/shared-ui";import{zustandStateStore as m}from"../utils/zustandStateStore";import{ZUSTAND_TEST_ID as S,slugForTestID as u}from"../utils/testIDs";import{jsx as d}from"react/jsx-runtime";const h=["\u2022 auth \u2192 hides authStore from stores & events","\u2022 temp \u2192 hides tempStore, tempUserStore","\u2022 cart \u2192 hides cartStore from both tabs"];export function ZustandEventFilterView({ignoredPatterns:o,onTogglePattern:r,onAddPattern:s,stores:t}){const i=n(()=>t.map(e=>({name:e.name,color:m.getStoreColor(e.name)})),[t]);return d(a,{entities:i,ignoredPatterns:o,onTogglePattern:r,onAddPattern:s,entityNoun:"STORES",entitySingular:"store",entityKey:"store",testIDPrefix:S,slug:u,howItWorks:"Patterns hide matching stores from both the Stores tab and the Events tab. Tap a store above to quickly add it as a filter.",examples:h})}
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* ZustandIcon — re-exported from the Buoy Icon Format.
|
|
5
|
-
*
|
|
6
|
-
* The artwork lives in shared/icons/zustand.json and is generated into
|
|
7
|
-
* @buoy-gg/floating-tools-core, so React Native, the desktop dashboard and
|
|
8
|
-
* Flutter all render the same drawing. Edit the JSON, then `pnpm icons`.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export { ZustandIcon, ZUSTAND_ICON_COLOR } from "@buoy-gg/shared-ui";
|
|
1
|
+
"use strict";export{ZustandIcon,ZUSTAND_ICON_COLOR}from"@buoy-gg/shared-ui";
|