@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
@@ -1 +1,112 @@
1
- "use strict";import{TouchableOpacity,Text,View,StyleSheet}from"react-native";import{buoyColors}from"@buoy-gg/shared-ui";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const buttonConfigs={copy:{color:buoyColors.primary,backgroundColor:buoyColors.primary+"15",borderColor:buoyColors.primary+"40",textColor:buoyColors.primary},reset:{color:buoyColors.warning,backgroundColor:buoyColors.warning+"15",borderColor:buoyColors.warning+"40",textColor:buoyColors.warning},clear:{color:buoyColors.error,backgroundColor:buoyColors.error+"15",borderColor:buoyColors.error+"40",textColor:buoyColors.error},jump:{color:buoyColors.warning,backgroundColor:buoyColors.warning+"15",borderColor:buoyColors.warning+"40",textColor:buoyColors.warning}};export function ZustandActionButton({onPress:o,text:r,type:t,disabled:e=!1}){const s=buttonConfigs[t];return _jsxs(TouchableOpacity,{disabled:e,onPress:o,style:[styles.button,{backgroundColor:e?buoyColors.textMuted+"1A":s.backgroundColor,borderColor:e?buoyColors.textMuted+"33":s.borderColor,opacity:e?.5:1}],activeOpacity:.7,accessibilityRole:"button",accessibilityLabel:r,accessibilityState:{disabled:e},children:[_jsx(View,{style:[styles.dot,{backgroundColor:e?buoyColors.textMuted:s.color}]}),_jsx(Text,{style:[styles.text,{color:e?buoyColors.textMuted:s.textColor}],children:r})]})}const styles=StyleSheet.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:buoyColors.text,shadowOffset:{width:0,height:0},shadowOpacity:.6,shadowRadius:2},text:{fontSize:10,fontWeight:"600",letterSpacing:.5,textTransform:"uppercase",fontFamily:"monospace",height:12}});
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 { buoyColors } from "@buoy-gg/shared-ui";
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ const buttonConfigs = {
14
+ copy: {
15
+ color: buoyColors.primary,
16
+ backgroundColor: buoyColors.primary + "15",
17
+ borderColor: buoyColors.primary + "40",
18
+ textColor: buoyColors.primary
19
+ },
20
+ reset: {
21
+ color: buoyColors.warning,
22
+ backgroundColor: buoyColors.warning + "15",
23
+ borderColor: buoyColors.warning + "40",
24
+ textColor: buoyColors.warning
25
+ },
26
+ clear: {
27
+ color: buoyColors.error,
28
+ backgroundColor: buoyColors.error + "15",
29
+ borderColor: buoyColors.error + "40",
30
+ textColor: buoyColors.error
31
+ },
32
+ jump: {
33
+ color: buoyColors.warning,
34
+ backgroundColor: buoyColors.warning + "15",
35
+ borderColor: buoyColors.warning + "40",
36
+ textColor: buoyColors.warning
37
+ }
38
+ };
39
+ export function ZustandActionButton({
40
+ onPress,
41
+ text,
42
+ type,
43
+ disabled = false
44
+ }) {
45
+ const config = buttonConfigs[type];
46
+ return /*#__PURE__*/_jsxs(TouchableOpacity, {
47
+ disabled: disabled,
48
+ onPress: onPress,
49
+ style: [styles.button, {
50
+ backgroundColor: disabled ? buoyColors.textMuted + "1A" : config.backgroundColor,
51
+ borderColor: disabled ? buoyColors.textMuted + "33" : config.borderColor,
52
+ opacity: disabled ? 0.5 : 1
53
+ }],
54
+ activeOpacity: 0.7,
55
+ accessibilityRole: "button",
56
+ accessibilityLabel: text,
57
+ accessibilityState: {
58
+ disabled
59
+ },
60
+ children: [/*#__PURE__*/_jsx(View, {
61
+ style: [styles.dot, {
62
+ backgroundColor: disabled ? buoyColors.textMuted : config.color
63
+ }]
64
+ }), /*#__PURE__*/_jsx(Text, {
65
+ style: [styles.text, {
66
+ color: disabled ? buoyColors.textMuted : config.textColor
67
+ }],
68
+ children: text
69
+ })]
70
+ });
71
+ }
72
+ const styles = StyleSheet.create({
73
+ button: {
74
+ flexDirection: "row",
75
+ alignItems: "center",
76
+ justifyContent: "center",
77
+ borderRadius: 6,
78
+ borderWidth: 1,
79
+ paddingHorizontal: 12,
80
+ paddingVertical: 6,
81
+ height: 25,
82
+ minWidth: 80,
83
+ shadowOffset: {
84
+ width: 0,
85
+ height: 1
86
+ },
87
+ shadowOpacity: 0.2,
88
+ shadowRadius: 2,
89
+ elevation: 2
90
+ },
91
+ dot: {
92
+ width: 5,
93
+ height: 5,
94
+ borderRadius: 3,
95
+ marginRight: 6,
96
+ shadowColor: buoyColors.text,
97
+ shadowOffset: {
98
+ width: 0,
99
+ height: 0
100
+ },
101
+ shadowOpacity: 0.6,
102
+ shadowRadius: 2
103
+ },
104
+ text: {
105
+ fontSize: 10,
106
+ fontWeight: "600",
107
+ letterSpacing: 0.5,
108
+ textTransform: "uppercase",
109
+ fontFamily: "monospace",
110
+ height: 12
111
+ }
112
+ });
@@ -1 +1,129 @@
1
- "use strict";import React,{memo}from"react";import{View,Text,TouchableOpacity,StyleSheet}from"react-native";import{macOSColors,FileText,Database,GitBranch}from"@buoy-gg/shared-ui";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";const VIEW_CONFIGS=[{key:"change",label:"CHANGE",description:"View change details",icon:FileText,activeColor:macOSColors.semantic.warning},{key:"state",label:"STATE",description:"View current state",icon:Database,activeColor:macOSColors.semantic.info},{key:"diff",label:"DIFF",description:"Compare changes",icon:GitBranch,activeColor:macOSColors.semantic.success}];export const ZustandDetailViewToggle=memo(function({activeView:e,onViewChange:o,diffDisabled:t=!1}){return _jsx(View,{style:styles.container,children:VIEW_CONFIGS.map(a=>{const r=e===a.key,c="diff"===a.key&&t,s=a.icon;return _jsxs(TouchableOpacity,{style:[styles.card,r&&[styles.cardActive,{borderColor:a.activeColor}],c&&styles.cardDisabled],onPress:()=>!c&&o(a.key),activeOpacity:c?1:.8,disabled:c,children:[_jsxs(View,{style:styles.cardContent,children:[_jsx(s,{size:14,color:r?a.activeColor:c?macOSColors.text.muted:macOSColors.text.secondary}),_jsx(Text,{style:[styles.cardLabel,r&&[styles.cardLabelActive,{color:a.activeColor}],c&&styles.cardLabelDisabled],children:a.label})]}),_jsx(Text,{style:[styles.cardDescription,r&&styles.cardDescriptionActive,c&&styles.cardDescriptionDisabled],children:a.description})]},a.key)})})});const styles=StyleSheet.create({container:{flexDirection:"row",gap:8,padding:14,backgroundColor:macOSColors.background.base},card:{flex:1,backgroundColor:macOSColors.background.card,borderRadius:12,borderWidth:1,borderColor:macOSColors.border.default,padding:10,gap:4},cardActive:{borderWidth:1.5,backgroundColor:"rgba(0, 184, 230, 0.05)",shadowColor:macOSColors.semantic.info,shadowOffset:{width:0,height:2},shadowOpacity:.1,shadowRadius:8,elevation:3},cardDisabled:{opacity:.5},cardContent:{flexDirection:"row",alignItems:"center",gap:6},cardLabel:{fontSize:10,fontWeight:"700",letterSpacing:.5,color:macOSColors.text.secondary},cardLabelActive:{color:macOSColors.text.primary},cardLabelDisabled:{color:macOSColors.text.muted},cardDescription:{fontSize:9,color:macOSColors.text.muted,lineHeight:12},cardDescriptionActive:{color:macOSColors.text.secondary},cardDescriptionDisabled:{color:macOSColors.text.muted}});
1
+ "use strict";
2
+
3
+ /**
4
+ * ZustandDetailViewToggle
5
+ *
6
+ * Three-card toggle for switching between Change, State, and Diff views.
7
+ * Mirrors ReduxDetailViewToggle.tsx
8
+ */
9
+
10
+ import React, { memo } from "react";
11
+ import { View, Text, TouchableOpacity, StyleSheet } from "react-native";
12
+ import { macOSColors, FileText, Database, GitBranch } from "@buoy-gg/shared-ui";
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ const VIEW_CONFIGS = [{
15
+ key: "change",
16
+ label: "CHANGE",
17
+ description: "View change details",
18
+ icon: FileText,
19
+ activeColor: macOSColors.semantic.warning
20
+ }, {
21
+ key: "state",
22
+ label: "STATE",
23
+ description: "View current state",
24
+ icon: Database,
25
+ activeColor: macOSColors.semantic.info
26
+ }, {
27
+ key: "diff",
28
+ label: "DIFF",
29
+ description: "Compare changes",
30
+ icon: GitBranch,
31
+ activeColor: macOSColors.semantic.success
32
+ }];
33
+ export const ZustandDetailViewToggle = /*#__PURE__*/memo(function ZustandDetailViewToggle({
34
+ activeView,
35
+ onViewChange,
36
+ diffDisabled = false
37
+ }) {
38
+ return /*#__PURE__*/_jsx(View, {
39
+ style: styles.container,
40
+ children: VIEW_CONFIGS.map(config => {
41
+ const isActive = activeView === config.key;
42
+ const isDisabled = config.key === "diff" && diffDisabled;
43
+ const IconComponent = config.icon;
44
+ return /*#__PURE__*/_jsxs(TouchableOpacity, {
45
+ style: [styles.card, isActive && [styles.cardActive, {
46
+ borderColor: config.activeColor
47
+ }], isDisabled && styles.cardDisabled],
48
+ onPress: () => !isDisabled && onViewChange(config.key),
49
+ activeOpacity: isDisabled ? 1 : 0.8,
50
+ disabled: isDisabled,
51
+ children: [/*#__PURE__*/_jsxs(View, {
52
+ style: styles.cardContent,
53
+ children: [/*#__PURE__*/_jsx(IconComponent, {
54
+ size: 14,
55
+ color: isActive ? config.activeColor : isDisabled ? macOSColors.text.muted : macOSColors.text.secondary
56
+ }), /*#__PURE__*/_jsx(Text, {
57
+ style: [styles.cardLabel, isActive && [styles.cardLabelActive, {
58
+ color: config.activeColor
59
+ }], isDisabled && styles.cardLabelDisabled],
60
+ children: config.label
61
+ })]
62
+ }), /*#__PURE__*/_jsx(Text, {
63
+ style: [styles.cardDescription, isActive && styles.cardDescriptionActive, isDisabled && styles.cardDescriptionDisabled],
64
+ children: config.description
65
+ })]
66
+ }, config.key);
67
+ })
68
+ });
69
+ });
70
+ const styles = StyleSheet.create({
71
+ container: {
72
+ flexDirection: "row",
73
+ gap: 8,
74
+ padding: 14,
75
+ backgroundColor: macOSColors.background.base
76
+ },
77
+ card: {
78
+ flex: 1,
79
+ backgroundColor: macOSColors.background.card,
80
+ borderRadius: 12,
81
+ borderWidth: 1,
82
+ borderColor: macOSColors.border.default,
83
+ padding: 10,
84
+ gap: 4
85
+ },
86
+ cardActive: {
87
+ borderWidth: 1.5,
88
+ backgroundColor: "rgba(0, 184, 230, 0.05)",
89
+ shadowColor: macOSColors.semantic.info,
90
+ shadowOffset: {
91
+ width: 0,
92
+ height: 2
93
+ },
94
+ shadowOpacity: 0.1,
95
+ shadowRadius: 8,
96
+ elevation: 3
97
+ },
98
+ cardDisabled: {
99
+ opacity: 0.5
100
+ },
101
+ cardContent: {
102
+ flexDirection: "row",
103
+ alignItems: "center",
104
+ gap: 6
105
+ },
106
+ cardLabel: {
107
+ fontSize: 10,
108
+ fontWeight: "700",
109
+ letterSpacing: 0.5,
110
+ color: macOSColors.text.secondary
111
+ },
112
+ cardLabelActive: {
113
+ color: macOSColors.text.primary
114
+ },
115
+ cardLabelDisabled: {
116
+ color: macOSColors.text.muted
117
+ },
118
+ cardDescription: {
119
+ fontSize: 9,
120
+ color: macOSColors.text.muted,
121
+ lineHeight: 12
122
+ },
123
+ cardDescriptionActive: {
124
+ color: macOSColors.text.secondary
125
+ },
126
+ cardDescriptionDisabled: {
127
+ color: macOSColors.text.muted
128
+ }
129
+ });
@@ -1 +1,287 @@
1
- "use strict";import{useState}from"react";import{View,Text,StyleSheet,TouchableOpacity,ScrollView}from"react-native";import{Filter,X,SectionHeader,AddFilterButton,AddFilterInput,macOSColors,buoyColors}from"@buoy-gg/shared-ui";import{zustandStateStore}from"../utils/zustandStateStore";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function getStoreColorForPattern(e,o){const t=o.find(o=>o.name.toLowerCase()===e.toLowerCase());return t?zustandStateStore.getStoreColor(t.name):null}function isStoreFiltered(e,o){return Array.from(o).some(o=>e.name.toLowerCase().includes(o.toLowerCase()))}export function ZustandEventFilterView({ignoredPatterns:e,onTogglePattern:o,onAddPattern:t,stores:r}){const[s,n]=useState(!1),[l,i]=useState("");return _jsxs(ScrollView,{style:styles.container,contentContainerStyle:styles.scrollContent,showsVerticalScrollIndicator:!1,children:[r.length>0&&_jsxs(View,{style:styles.section,children:[_jsxs(SectionHeader,{children:[_jsx(SectionHeader.Title,{children:"REGISTERED STORES"}),_jsx(SectionHeader.Badge,{count:r.length,color:buoyColors.primary})]}),_jsx(ScrollView,{style:styles.storeList,contentContainerStyle:styles.storeListContent,showsVerticalScrollIndicator:!0,nestedScrollEnabled:!0,children:r.map(o=>{const r=zustandStateStore.getStoreColor(o.name),s=isStoreFiltered(o,e);return _jsxs(TouchableOpacity,{style:[styles.storeRow,s&&styles.storeRowFiltered],onPress:()=>t(o.name),disabled:s,children:[_jsx(View,{style:[styles.storeDot,{backgroundColor:s?macOSColors.text.disabled:r}]}),_jsx(Text,{style:[styles.storeRowText,s&&styles.storeRowTextFiltered,!s&&{color:r}],numberOfLines:1,children:o.name}),_jsx(Text,s?{style:styles.filteredLabel,children:"hidden"}:{style:[styles.addLabel,{color:r+"99"}],children:"+ hide"})]},o.name)})})]}),_jsxs(View,{style:styles.section,children:[_jsxs(SectionHeader,{children:[_jsx(SectionHeader.Icon,{icon:Filter,color:buoyColors.primary,size:12}),_jsx(SectionHeader.Title,{children:"STORE NAME FILTERS"}),e.size>0&&_jsx(SectionHeader.Badge,{count:e.size,color:buoyColors.primary})]}),_jsx(View,{style:styles.addInputWrapper,children:s?_jsx(AddFilterInput,{value:l,onChange:i,onSubmit:()=>{const e=l.trim();e&&(t(e),i(""),n(!1))},onCancel:()=>{n(!1),i("")},placeholder:"Enter store name pattern to hide...",color:buoyColors.primary}):_jsx(AddFilterButton,{onPress:()=>n(!0),color:buoyColors.primary,label:"Add store name pattern"})}),e.size>0&&_jsx(View,{style:styles.patternList,children:Array.from(e).map(e=>{const t=getStoreColorForPattern(e,r);return _jsxs(TouchableOpacity,{style:styles.patternRow,onPress:()=>o(e),activeOpacity:.8,children:[t?_jsx(View,{style:[styles.storeDot,{backgroundColor:t}]}):null,_jsx(Text,{style:[styles.patternText,t?{color:t}:null],numberOfLines:1,children:e}),_jsx(X,{size:12,color:buoyColors.primary+"80"})]},e)})})]}),_jsxs(View,{style:styles.section,children:[_jsxs(SectionHeader,{children:[_jsx(SectionHeader.Icon,{icon:Filter,color:buoyColors.textSecondary,size:12}),_jsx(SectionHeader.Title,{children:"HOW EVENT FILTERS WORK"})]}),_jsx(Text,{style:styles.howItWorksText,children:"Patterns hide matching stores from both the Stores tab and the Events tab. Tap a store above to quickly add it as a filter."}),_jsxs(View,{style:styles.examplesContainer,children:[_jsx(Text,{style:styles.examplesTitle,children:"EXAMPLES:"}),["• auth → hides authStore from stores & events","• temp → hides tempStore, tempUserStore","• cart → hides cartStore from both tabs"].map(e=>_jsx(Text,{style:styles.exampleItem,children:e},e))]})]})]})}const styles=StyleSheet.create({container:{flex:1,backgroundColor:buoyColors.base},scrollContent:{paddingTop:16,paddingHorizontal:16,paddingBottom:24,gap:16},section:{backgroundColor:buoyColors.card,borderRadius:16,borderWidth:1,borderColor:buoyColors.border,overflow:"hidden"},storeList:{maxHeight:180},storeListContent:{paddingHorizontal:16,paddingTop:8,paddingBottom:16,gap:10},storeRow:{flexDirection:"row",alignItems:"center",gap:10,paddingVertical:10,paddingHorizontal:12,backgroundColor:buoyColors.hover,borderRadius:8,borderWidth:1,borderColor:buoyColors.border},storeRowFiltered:{opacity:.45},storeDot:{width:7,height:7,borderRadius:3.5},storeRowText:{flex:1,fontSize:12,fontWeight:"600",fontFamily:"monospace"},storeRowTextFiltered:{color:macOSColors.text.muted,textDecorationLine:"line-through"},filteredLabel:{fontSize:10,fontWeight:"500",color:macOSColors.text.disabled,fontFamily:"monospace"},addLabel:{fontSize:10,fontWeight:"600",fontFamily:"monospace"},addInputWrapper:{paddingHorizontal:16,paddingTop:8,paddingBottom:8},patternList:{paddingHorizontal:16,paddingBottom:16,gap:8},patternRow:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:10,paddingHorizontal:12,backgroundColor:buoyColors.hover,borderRadius:8,borderWidth:1,borderColor:buoyColors.border,gap:8},patternText:{flex:1,fontSize:12,fontFamily:"monospace",color:buoyColors.text},howItWorksText:{fontSize:11,color:buoyColors.textSecondary,lineHeight:16,marginTop:8,paddingHorizontal:16,fontFamily:"monospace"},examplesContainer:{paddingTop:8,paddingHorizontal:16,paddingBottom:16,borderTopWidth:1,borderTopColor:buoyColors.border,marginTop:12},examplesTitle:{fontSize:10,fontWeight:"600",color:buoyColors.textMuted,fontFamily:"monospace",letterSpacing:.5,marginBottom:6},exampleItem:{fontSize:10,color:buoyColors.textMuted,fontFamily:"monospace",lineHeight:16}});
1
+ "use strict";
2
+
3
+ import { useState } from "react";
4
+ import { View, Text, StyleSheet, TouchableOpacity, ScrollView } from "react-native";
5
+ import { Filter, X, SectionHeader, AddFilterButton, AddFilterInput, macOSColors, buoyColors } from "@buoy-gg/shared-ui";
6
+ import { zustandStateStore } from "../utils/zustandStateStore";
7
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
8
+ /** Returns the store color for a given pattern if it exactly matches a registered store name */
9
+ function getStoreColorForPattern(pattern, stores) {
10
+ const match = stores.find(s => s.name.toLowerCase() === pattern.toLowerCase());
11
+ return match ? zustandStateStore.getStoreColor(match.name) : null;
12
+ }
13
+
14
+ /** True if any active pattern filters out this store */
15
+ function isStoreFiltered(store, ignoredPatterns) {
16
+ return Array.from(ignoredPatterns).some(p => store.name.toLowerCase().includes(p.toLowerCase()));
17
+ }
18
+ export function ZustandEventFilterView({
19
+ ignoredPatterns,
20
+ onTogglePattern,
21
+ onAddPattern,
22
+ stores
23
+ }) {
24
+ const [showAddInput, setShowAddInput] = useState(false);
25
+ const [inputValue, setInputValue] = useState("");
26
+ const handleAddPattern = () => {
27
+ const trimmed = inputValue.trim();
28
+ if (trimmed) {
29
+ onAddPattern(trimmed);
30
+ setInputValue("");
31
+ setShowAddInput(false);
32
+ }
33
+ };
34
+ return /*#__PURE__*/_jsxs(ScrollView, {
35
+ style: styles.container,
36
+ contentContainerStyle: styles.scrollContent,
37
+ showsVerticalScrollIndicator: false,
38
+ children: [stores.length > 0 && /*#__PURE__*/_jsxs(View, {
39
+ style: styles.section,
40
+ children: [/*#__PURE__*/_jsxs(SectionHeader, {
41
+ children: [/*#__PURE__*/_jsx(SectionHeader.Title, {
42
+ children: "REGISTERED STORES"
43
+ }), /*#__PURE__*/_jsx(SectionHeader.Badge, {
44
+ count: stores.length,
45
+ color: buoyColors.primary
46
+ })]
47
+ }), /*#__PURE__*/_jsx(ScrollView, {
48
+ style: styles.storeList,
49
+ contentContainerStyle: styles.storeListContent,
50
+ showsVerticalScrollIndicator: true,
51
+ nestedScrollEnabled: true,
52
+ children: stores.map(store => {
53
+ const storeColor = zustandStateStore.getStoreColor(store.name);
54
+ const filtered = isStoreFiltered(store, ignoredPatterns);
55
+ return /*#__PURE__*/_jsxs(TouchableOpacity, {
56
+ style: [styles.storeRow, filtered && styles.storeRowFiltered],
57
+ onPress: () => onAddPattern(store.name),
58
+ disabled: filtered,
59
+ children: [/*#__PURE__*/_jsx(View, {
60
+ style: [styles.storeDot, {
61
+ backgroundColor: filtered ? macOSColors.text.disabled : storeColor
62
+ }]
63
+ }), /*#__PURE__*/_jsx(Text, {
64
+ style: [styles.storeRowText, filtered && styles.storeRowTextFiltered, !filtered && {
65
+ color: storeColor
66
+ }],
67
+ numberOfLines: 1,
68
+ children: store.name
69
+ }), filtered ? /*#__PURE__*/_jsx(Text, {
70
+ style: styles.filteredLabel,
71
+ children: "hidden"
72
+ }) : /*#__PURE__*/_jsx(Text, {
73
+ style: [styles.addLabel, {
74
+ color: storeColor + "99"
75
+ }],
76
+ children: "+ hide"
77
+ })]
78
+ }, store.name);
79
+ })
80
+ })]
81
+ }), /*#__PURE__*/_jsxs(View, {
82
+ style: styles.section,
83
+ children: [/*#__PURE__*/_jsxs(SectionHeader, {
84
+ children: [/*#__PURE__*/_jsx(SectionHeader.Icon, {
85
+ icon: Filter,
86
+ color: buoyColors.primary,
87
+ size: 12
88
+ }), /*#__PURE__*/_jsx(SectionHeader.Title, {
89
+ children: "STORE NAME FILTERS"
90
+ }), ignoredPatterns.size > 0 && /*#__PURE__*/_jsx(SectionHeader.Badge, {
91
+ count: ignoredPatterns.size,
92
+ color: buoyColors.primary
93
+ })]
94
+ }), /*#__PURE__*/_jsx(View, {
95
+ style: styles.addInputWrapper,
96
+ children: !showAddInput ? /*#__PURE__*/_jsx(AddFilterButton, {
97
+ onPress: () => setShowAddInput(true),
98
+ color: buoyColors.primary,
99
+ label: "Add store name pattern"
100
+ }) : /*#__PURE__*/_jsx(AddFilterInput, {
101
+ value: inputValue,
102
+ onChange: setInputValue,
103
+ onSubmit: handleAddPattern,
104
+ onCancel: () => {
105
+ setShowAddInput(false);
106
+ setInputValue("");
107
+ },
108
+ placeholder: "Enter store name pattern to hide...",
109
+ color: buoyColors.primary
110
+ })
111
+ }), ignoredPatterns.size > 0 && /*#__PURE__*/_jsx(View, {
112
+ style: styles.patternList,
113
+ children: Array.from(ignoredPatterns).map(pattern => {
114
+ const storeColor = getStoreColorForPattern(pattern, stores);
115
+ return /*#__PURE__*/_jsxs(TouchableOpacity, {
116
+ style: styles.patternRow,
117
+ onPress: () => onTogglePattern(pattern),
118
+ activeOpacity: 0.8,
119
+ children: [storeColor ? /*#__PURE__*/_jsx(View, {
120
+ style: [styles.storeDot, {
121
+ backgroundColor: storeColor
122
+ }]
123
+ }) : null, /*#__PURE__*/_jsx(Text, {
124
+ style: [styles.patternText, storeColor ? {
125
+ color: storeColor
126
+ } : null],
127
+ numberOfLines: 1,
128
+ children: pattern
129
+ }), /*#__PURE__*/_jsx(X, {
130
+ size: 12,
131
+ color: buoyColors.primary + "80"
132
+ })]
133
+ }, pattern);
134
+ })
135
+ })]
136
+ }), /*#__PURE__*/_jsxs(View, {
137
+ style: styles.section,
138
+ children: [/*#__PURE__*/_jsxs(SectionHeader, {
139
+ children: [/*#__PURE__*/_jsx(SectionHeader.Icon, {
140
+ icon: Filter,
141
+ color: buoyColors.textSecondary,
142
+ size: 12
143
+ }), /*#__PURE__*/_jsx(SectionHeader.Title, {
144
+ children: "HOW EVENT FILTERS WORK"
145
+ })]
146
+ }), /*#__PURE__*/_jsx(Text, {
147
+ style: styles.howItWorksText,
148
+ children: "Patterns hide matching stores from both the Stores tab and the Events tab. Tap a store above to quickly add it as a filter."
149
+ }), /*#__PURE__*/_jsxs(View, {
150
+ style: styles.examplesContainer,
151
+ children: [/*#__PURE__*/_jsx(Text, {
152
+ style: styles.examplesTitle,
153
+ children: "EXAMPLES:"
154
+ }), ["• auth → hides authStore from stores & events", "• temp → hides tempStore, tempUserStore", "• cart → hides cartStore from both tabs"].map(ex => /*#__PURE__*/_jsx(Text, {
155
+ style: styles.exampleItem,
156
+ children: ex
157
+ }, ex))]
158
+ })]
159
+ })]
160
+ });
161
+ }
162
+ const styles = StyleSheet.create({
163
+ container: {
164
+ flex: 1,
165
+ backgroundColor: buoyColors.base
166
+ },
167
+ scrollContent: {
168
+ paddingTop: 16,
169
+ paddingHorizontal: 16,
170
+ paddingBottom: 24,
171
+ gap: 16
172
+ },
173
+ section: {
174
+ backgroundColor: buoyColors.card,
175
+ borderRadius: 16,
176
+ borderWidth: 1,
177
+ borderColor: buoyColors.border,
178
+ overflow: "hidden"
179
+ },
180
+ storeList: {
181
+ maxHeight: 180
182
+ },
183
+ storeListContent: {
184
+ paddingHorizontal: 16,
185
+ paddingTop: 8,
186
+ paddingBottom: 16,
187
+ gap: 10
188
+ },
189
+ storeRow: {
190
+ flexDirection: "row",
191
+ alignItems: "center",
192
+ gap: 10,
193
+ paddingVertical: 10,
194
+ paddingHorizontal: 12,
195
+ backgroundColor: buoyColors.hover,
196
+ borderRadius: 8,
197
+ borderWidth: 1,
198
+ borderColor: buoyColors.border
199
+ },
200
+ storeRowFiltered: {
201
+ opacity: 0.45
202
+ },
203
+ storeDot: {
204
+ width: 7,
205
+ height: 7,
206
+ borderRadius: 3.5
207
+ },
208
+ storeRowText: {
209
+ flex: 1,
210
+ fontSize: 12,
211
+ fontWeight: "600",
212
+ fontFamily: "monospace"
213
+ },
214
+ storeRowTextFiltered: {
215
+ color: macOSColors.text.muted,
216
+ textDecorationLine: "line-through"
217
+ },
218
+ filteredLabel: {
219
+ fontSize: 10,
220
+ fontWeight: "500",
221
+ color: macOSColors.text.disabled,
222
+ fontFamily: "monospace"
223
+ },
224
+ addLabel: {
225
+ fontSize: 10,
226
+ fontWeight: "600",
227
+ fontFamily: "monospace"
228
+ },
229
+ addInputWrapper: {
230
+ paddingHorizontal: 16,
231
+ paddingTop: 8,
232
+ paddingBottom: 8
233
+ },
234
+ patternList: {
235
+ paddingHorizontal: 16,
236
+ paddingBottom: 16,
237
+ gap: 8
238
+ },
239
+ patternRow: {
240
+ flexDirection: "row",
241
+ alignItems: "center",
242
+ justifyContent: "space-between",
243
+ paddingVertical: 10,
244
+ paddingHorizontal: 12,
245
+ backgroundColor: buoyColors.hover,
246
+ borderRadius: 8,
247
+ borderWidth: 1,
248
+ borderColor: buoyColors.border,
249
+ gap: 8
250
+ },
251
+ patternText: {
252
+ flex: 1,
253
+ fontSize: 12,
254
+ fontFamily: "monospace",
255
+ color: buoyColors.text
256
+ },
257
+ howItWorksText: {
258
+ fontSize: 11,
259
+ color: buoyColors.textSecondary,
260
+ lineHeight: 16,
261
+ marginTop: 8,
262
+ paddingHorizontal: 16,
263
+ fontFamily: "monospace"
264
+ },
265
+ examplesContainer: {
266
+ paddingTop: 8,
267
+ paddingHorizontal: 16,
268
+ paddingBottom: 16,
269
+ borderTopWidth: 1,
270
+ borderTopColor: buoyColors.border,
271
+ marginTop: 12
272
+ },
273
+ examplesTitle: {
274
+ fontSize: 10,
275
+ fontWeight: "600",
276
+ color: buoyColors.textMuted,
277
+ fontFamily: "monospace",
278
+ letterSpacing: 0.5,
279
+ marginBottom: 6
280
+ },
281
+ exampleItem: {
282
+ fontSize: 10,
283
+ color: buoyColors.textMuted,
284
+ fontFamily: "monospace",
285
+ lineHeight: 16
286
+ }
287
+ });
@@ -1 +1,32 @@
1
- "use strict";import{View}from"react-native";import{Text}from"react-native";import{jsx as _jsx}from"react/jsx-runtime";const ZUSTAND_ICON_COLOR="#463B3F";export function ZustandIcon({size:t,color:e}){return _jsx(View,{style:{width:t,height:t,justifyContent:"center",alignItems:"center"},children:_jsx(Text,{style:{fontSize:.75*t,color:e||"#463B3F",fontWeight:"700"},children:"Z"})})}export{ZUSTAND_ICON_COLOR};
1
+ "use strict";
2
+
3
+ /**
4
+ * Zustand DevTools icon
5
+ */
6
+
7
+ import { View } from "react-native";
8
+ import { Text } from "react-native";
9
+ import { jsx as _jsx } from "react/jsx-runtime";
10
+ const ZUSTAND_ICON_COLOR = "#463B3F";
11
+ export function ZustandIcon({
12
+ size,
13
+ color
14
+ }) {
15
+ return /*#__PURE__*/_jsx(View, {
16
+ style: {
17
+ width: size,
18
+ height: size,
19
+ justifyContent: "center",
20
+ alignItems: "center"
21
+ },
22
+ children: /*#__PURE__*/_jsx(Text, {
23
+ style: {
24
+ fontSize: size * 0.75,
25
+ color: color || ZUSTAND_ICON_COLOR,
26
+ fontWeight: "700"
27
+ },
28
+ children: "Z"
29
+ })
30
+ });
31
+ }
32
+ export { ZUSTAND_ICON_COLOR };