@buoy-gg/shared-ui 7.0.15 → 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.
Files changed (121) hide show
  1. package/lib/commonjs/JsModal.web.js +1588 -0
  2. package/lib/commonjs/env/EnvironmentIndicator.web.js +114 -0
  3. package/lib/commonjs/env/EnvironmentSelectorInline.web.js +178 -0
  4. package/lib/commonjs/hooks/index.js +7 -0
  5. package/lib/commonjs/hooks/safe-area-impl.js +1 -1
  6. package/lib/commonjs/hooks/usePersistedState.js +71 -0
  7. package/lib/commonjs/icons/index.js +28 -0
  8. package/lib/commonjs/index.js +45 -3
  9. package/lib/commonjs/storage/devToolsStorageKeys.js +22 -0
  10. package/lib/commonjs/stores/ignoredPatternsCore.js +68 -0
  11. package/lib/commonjs/stores/ignoredPatternsStore.js +16 -52
  12. package/lib/commonjs/stores/ignoredPatternsStore.web.js +236 -0
  13. package/lib/commonjs/stores/index.js +1 -1
  14. package/lib/commonjs/ui/components/ModalHeader.js +69 -0
  15. package/lib/commonjs/ui/components/ToolButton.js +90 -0
  16. package/lib/commonjs/ui/components/index.js +7 -0
  17. package/lib/commonjs/ui/gameUI/constants/gameUIColors.js +5 -3
  18. package/lib/commonjs/ui/index.js +8 -0
  19. package/lib/commonjs/ui/toolTheme.js +96 -0
  20. package/lib/commonjs/utils/index.js +38 -0
  21. package/lib/commonjs/utils/stateSnapshotRegistry.js +62 -0
  22. package/lib/module/JsModal.web.js +1586 -0
  23. package/lib/module/env/EnvironmentIndicator.web.js +108 -0
  24. package/lib/module/env/EnvironmentSelectorInline.web.js +173 -0
  25. package/lib/module/hooks/index.js +1 -0
  26. package/lib/module/hooks/safe-area-impl.js +1 -1
  27. package/lib/module/hooks/usePersistedState.js +68 -0
  28. package/lib/module/icons/index.js +2 -0
  29. package/lib/module/index.js +7 -3
  30. package/lib/module/storage/devToolsStorageKeys.js +22 -0
  31. package/lib/module/stores/ignoredPatternsCore.js +62 -0
  32. package/lib/module/stores/ignoredPatternsStore.js +5 -51
  33. package/lib/module/stores/ignoredPatternsStore.web.js +221 -0
  34. package/lib/module/stores/index.js +1 -1
  35. package/lib/module/ui/components/ModalHeader.js +70 -2
  36. package/lib/module/ui/components/ToolButton.js +86 -0
  37. package/lib/module/ui/components/index.js +1 -0
  38. package/lib/module/ui/gameUI/constants/gameUIColors.js +4 -2
  39. package/lib/module/ui/index.js +3 -0
  40. package/lib/module/ui/toolTheme.js +93 -0
  41. package/lib/module/utils/index.js +2 -0
  42. package/lib/module/utils/stateSnapshotRegistry.js +55 -0
  43. package/lib/typescript/commonjs/JsModal.web.d.ts +138 -0
  44. package/lib/typescript/commonjs/JsModal.web.d.ts.map +1 -0
  45. package/lib/typescript/commonjs/env/EnvironmentIndicator.web.d.ts +16 -0
  46. package/lib/typescript/commonjs/env/EnvironmentIndicator.web.d.ts.map +1 -0
  47. package/lib/typescript/commonjs/env/EnvironmentSelectorInline.web.d.ts +8 -0
  48. package/lib/typescript/commonjs/env/EnvironmentSelectorInline.web.d.ts.map +1 -0
  49. package/lib/typescript/commonjs/hooks/index.d.ts +1 -0
  50. package/lib/typescript/commonjs/hooks/index.d.ts.map +1 -1
  51. package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
  52. package/lib/typescript/commonjs/hooks/usePersistedState.d.ts +16 -0
  53. package/lib/typescript/commonjs/hooks/usePersistedState.d.ts.map +1 -0
  54. package/lib/typescript/commonjs/icons/index.d.ts +2 -0
  55. package/lib/typescript/commonjs/icons/index.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/index.d.ts +1 -1
  57. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  58. package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts +19 -0
  59. package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/stores/ignoredPatternsCore.d.ts +37 -0
  61. package/lib/typescript/commonjs/stores/ignoredPatternsCore.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/stores/ignoredPatternsStore.d.ts +3 -27
  63. package/lib/typescript/commonjs/stores/ignoredPatternsStore.d.ts.map +1 -1
  64. package/lib/typescript/commonjs/stores/ignoredPatternsStore.web.d.ts +72 -0
  65. package/lib/typescript/commonjs/stores/ignoredPatternsStore.web.d.ts.map +1 -0
  66. package/lib/typescript/commonjs/ui/components/ModalHeader.d.ts +13 -1
  67. package/lib/typescript/commonjs/ui/components/ModalHeader.d.ts.map +1 -1
  68. package/lib/typescript/commonjs/ui/components/ToolButton.d.ts +24 -0
  69. package/lib/typescript/commonjs/ui/components/ToolButton.d.ts.map +1 -0
  70. package/lib/typescript/commonjs/ui/components/index.d.ts +4 -0
  71. package/lib/typescript/commonjs/ui/components/index.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/ui/gameUI/constants/gameUIColors.d.ts +56 -0
  73. package/lib/typescript/commonjs/ui/gameUI/constants/gameUIColors.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/ui/index.d.ts +1 -0
  75. package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
  76. package/lib/typescript/commonjs/ui/toolTheme.d.ts +68 -0
  77. package/lib/typescript/commonjs/ui/toolTheme.d.ts.map +1 -0
  78. package/lib/typescript/commonjs/utils/index.d.ts +2 -0
  79. package/lib/typescript/commonjs/utils/index.d.ts.map +1 -1
  80. package/lib/typescript/commonjs/utils/stateSnapshotRegistry.d.ts +67 -0
  81. package/lib/typescript/commonjs/utils/stateSnapshotRegistry.d.ts.map +1 -0
  82. package/lib/typescript/module/JsModal.web.d.ts +138 -0
  83. package/lib/typescript/module/JsModal.web.d.ts.map +1 -0
  84. package/lib/typescript/module/env/EnvironmentIndicator.web.d.ts +16 -0
  85. package/lib/typescript/module/env/EnvironmentIndicator.web.d.ts.map +1 -0
  86. package/lib/typescript/module/env/EnvironmentSelectorInline.web.d.ts +8 -0
  87. package/lib/typescript/module/env/EnvironmentSelectorInline.web.d.ts.map +1 -0
  88. package/lib/typescript/module/hooks/index.d.ts +1 -0
  89. package/lib/typescript/module/hooks/index.d.ts.map +1 -1
  90. package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
  91. package/lib/typescript/module/hooks/usePersistedState.d.ts +16 -0
  92. package/lib/typescript/module/hooks/usePersistedState.d.ts.map +1 -0
  93. package/lib/typescript/module/icons/index.d.ts +2 -0
  94. package/lib/typescript/module/icons/index.d.ts.map +1 -1
  95. package/lib/typescript/module/index.d.ts +1 -1
  96. package/lib/typescript/module/index.d.ts.map +1 -1
  97. package/lib/typescript/module/storage/devToolsStorageKeys.d.ts +19 -0
  98. package/lib/typescript/module/storage/devToolsStorageKeys.d.ts.map +1 -1
  99. package/lib/typescript/module/stores/ignoredPatternsCore.d.ts +37 -0
  100. package/lib/typescript/module/stores/ignoredPatternsCore.d.ts.map +1 -0
  101. package/lib/typescript/module/stores/ignoredPatternsStore.d.ts +3 -27
  102. package/lib/typescript/module/stores/ignoredPatternsStore.d.ts.map +1 -1
  103. package/lib/typescript/module/stores/ignoredPatternsStore.web.d.ts +72 -0
  104. package/lib/typescript/module/stores/ignoredPatternsStore.web.d.ts.map +1 -0
  105. package/lib/typescript/module/ui/components/ModalHeader.d.ts +13 -1
  106. package/lib/typescript/module/ui/components/ModalHeader.d.ts.map +1 -1
  107. package/lib/typescript/module/ui/components/ToolButton.d.ts +24 -0
  108. package/lib/typescript/module/ui/components/ToolButton.d.ts.map +1 -0
  109. package/lib/typescript/module/ui/components/index.d.ts +4 -0
  110. package/lib/typescript/module/ui/components/index.d.ts.map +1 -1
  111. package/lib/typescript/module/ui/gameUI/constants/gameUIColors.d.ts +56 -0
  112. package/lib/typescript/module/ui/gameUI/constants/gameUIColors.d.ts.map +1 -1
  113. package/lib/typescript/module/ui/index.d.ts +1 -0
  114. package/lib/typescript/module/ui/index.d.ts.map +1 -1
  115. package/lib/typescript/module/ui/toolTheme.d.ts +68 -0
  116. package/lib/typescript/module/ui/toolTheme.d.ts.map +1 -0
  117. package/lib/typescript/module/utils/index.d.ts +2 -0
  118. package/lib/typescript/module/utils/index.d.ts.map +1 -1
  119. package/lib/typescript/module/utils/stateSnapshotRegistry.d.ts +67 -0
  120. package/lib/typescript/module/utils/stateSnapshotRegistry.d.ts.map +1 -0
  121. package/package.json +4 -4
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EnvironmentIndicator = EnvironmentIndicator;
7
+ exports.getEnvironmentConfig = getEnvironmentConfig;
8
+ var _gameUIColors = require("../ui/gameUI/constants/gameUIColors.js");
9
+ var _types = require("../types/types.js");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ /**
12
+ * EnvironmentIndicator — Web (React DOM) twin of EnvironmentIndicator.tsx.
13
+ * Same env→color/label map and layout; lucide glyph icons are omitted from
14
+ * the badge on native too (dot + label only), so parity holds.
15
+ */
16
+
17
+ function getEnvironmentConfig(environment) {
18
+ switch ((0, _types.normalizeEnvironment)(String(environment))) {
19
+ case 'dev':
20
+ return {
21
+ label: 'DEV',
22
+ backgroundColor: _gameUIColors.gameUIColors.warning
23
+ };
24
+ case 'qa':
25
+ return {
26
+ label: 'QA',
27
+ backgroundColor: _gameUIColors.gameUIColors.optional
28
+ };
29
+ case 'staging':
30
+ return {
31
+ label: 'STAGING',
32
+ backgroundColor: _gameUIColors.gameUIColors.success
33
+ };
34
+ case 'prod':
35
+ return {
36
+ label: 'PROD',
37
+ backgroundColor: _gameUIColors.gameUIColors.error
38
+ };
39
+ case 'local':
40
+ default:
41
+ return {
42
+ label: 'LOCAL',
43
+ backgroundColor: _gameUIColors.gameUIColors.info
44
+ };
45
+ }
46
+ }
47
+ function ChevronDownGlyph({
48
+ color
49
+ }) {
50
+ // native: ChevronDown size 12 from shared lucide icons
51
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
52
+ width: 12,
53
+ height: 12,
54
+ viewBox: "0 0 24 24",
55
+ "aria-hidden": "true",
56
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
57
+ d: "M6 9l6 6 6-6",
58
+ fill: "none",
59
+ stroke: color,
60
+ strokeWidth: "2",
61
+ strokeLinecap: "round",
62
+ strokeLinejoin: "round"
63
+ })
64
+ });
65
+ }
66
+ function EnvironmentIndicator({
67
+ environment,
68
+ interactive = false,
69
+ onPress
70
+ }) {
71
+ const envConfig = getEnvironmentConfig(environment);
72
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
73
+ onClick: interactive ? onPress : undefined,
74
+ "aria-label": `Environment: ${envConfig.label}`,
75
+ style: {
76
+ display: 'flex',
77
+ flexDirection: 'row',
78
+ alignItems: 'center',
79
+ // native: paddingVertical 6, paddingLeft 8, paddingRight interactive?4:8
80
+ padding: `6px ${interactive ? 4 : 8}px 6px 8px`,
81
+ flexShrink: 0,
82
+ background: 'none',
83
+ border: 'none',
84
+ cursor: interactive ? 'pointer' : 'default'
85
+ },
86
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
87
+ style: {
88
+ width: 8,
89
+ height: 8,
90
+ borderRadius: 4,
91
+ backgroundColor: envConfig.backgroundColor,
92
+ marginRight: 6,
93
+ // native: shadowOpacity 0.6, shadowRadius 4 glow
94
+ boxShadow: `0 0 4px ${envConfig.backgroundColor}99`
95
+ }
96
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
97
+ style: {
98
+ fontSize: 11,
99
+ fontWeight: 600,
100
+ color: _gameUIColors.gameUIColors.primaryLight,
101
+ letterSpacing: 0.5
102
+ },
103
+ children: envConfig.label
104
+ }), interactive && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
105
+ style: {
106
+ marginLeft: 2,
107
+ display: 'flex'
108
+ },
109
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronDownGlyph, {
110
+ color: "#7A8599"
111
+ })
112
+ })]
113
+ });
114
+ }
@@ -0,0 +1,178 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EnvironmentSelectorInline = EnvironmentSelectorInline;
7
+ var _react = require("react");
8
+ var _gameUIColors = require("../ui/gameUI/constants/gameUIColors.js");
9
+ var _EnvironmentIndicatorWeb = require("./EnvironmentIndicator.web.js");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ /**
12
+ * EnvironmentSelectorInline — Web (React DOM) twin of
13
+ * EnvironmentSelectorInline.tsx: the interactive environment badge that
14
+ * expands a drop-UP panel (absolute bottom:100%, opens upward so the bubble
15
+ * layout doesn't shift). Same geometry: OPTION_HEIGHT 36, 200ms animation,
16
+ * selected row gets a green check.
17
+ */
18
+
19
+ const OPTION_HEIGHT = 36; // native EnvironmentSelectorInline OPTION_HEIGHT
20
+
21
+ function ChevronUpGlyph({
22
+ color,
23
+ flipped
24
+ }) {
25
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
26
+ width: 10,
27
+ height: 10,
28
+ viewBox: "0 0 24 24",
29
+ "aria-hidden": "true",
30
+ style: {
31
+ transform: flipped ? 'rotate(180deg)' : 'rotate(0deg)',
32
+ transition: 'transform 200ms ease' // native: 200ms rotation
33
+ },
34
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
35
+ d: "M18 15l-6-6-6 6",
36
+ fill: "none",
37
+ stroke: color,
38
+ strokeWidth: "2",
39
+ strokeLinecap: "round",
40
+ strokeLinejoin: "round"
41
+ })
42
+ });
43
+ }
44
+ function CheckGlyph() {
45
+ // native: Check size 12 color #4AFF9F strokeWidth 3
46
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
47
+ width: 12,
48
+ height: 12,
49
+ viewBox: "0 0 24 24",
50
+ "aria-hidden": "true",
51
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
52
+ d: "M20 6L9 17l-5-5",
53
+ fill: "none",
54
+ stroke: "#4AFF9F",
55
+ strokeWidth: "3",
56
+ strokeLinecap: "round",
57
+ strokeLinejoin: "round"
58
+ })
59
+ });
60
+ }
61
+ function EnvironmentSelectorInline({
62
+ currentEnvironment,
63
+ availableEnvironments,
64
+ onSelect
65
+ }) {
66
+ const [expanded, setExpanded] = (0, _react.useState)(false);
67
+ const [hoveredEnv, setHoveredEnv] = (0, _react.useState)(null);
68
+ const current = (0, _EnvironmentIndicatorWeb.getEnvironmentConfig)(currentEnvironment);
69
+ const panelHeight = availableEnvironments.length * OPTION_HEIGHT;
70
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
71
+ style: {
72
+ position: 'relative',
73
+ zIndex: 1000,
74
+ flexShrink: 0
75
+ },
76
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
77
+ style: {
78
+ position: 'absolute',
79
+ bottom: '100%',
80
+ left: 0,
81
+ right: 0,
82
+ height: expanded ? panelHeight : 0,
83
+ opacity: expanded ? 1 : 0,
84
+ overflow: 'hidden',
85
+ transition: 'height 200ms ease, opacity 200ms ease',
86
+ backgroundColor: 'rgba(8,12,21,0.95)',
87
+ border: '1px solid #00B8E666',
88
+ borderBottomWidth: 0,
89
+ borderTopLeftRadius: 6,
90
+ borderTopRightRadius: 6,
91
+ boxShadow: '0 -4px 8px rgba(0,0,0,0.3)'
92
+ },
93
+ children: availableEnvironments.map(env => {
94
+ const config = (0, _EnvironmentIndicatorWeb.getEnvironmentConfig)(env);
95
+ const isSelected = String(env).toLowerCase() === String(currentEnvironment).toLowerCase();
96
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
97
+ onClick: () => {
98
+ setExpanded(false);
99
+ onSelect(env);
100
+ },
101
+ onMouseEnter: () => setHoveredEnv(String(env)),
102
+ onMouseLeave: () => setHoveredEnv(null),
103
+ style: {
104
+ display: 'flex',
105
+ alignItems: 'center',
106
+ justifyContent: 'space-between',
107
+ width: '100%',
108
+ height: OPTION_HEIGHT,
109
+ padding: '0 10px',
110
+ background: isSelected ? 'rgba(128,128,128,0.1)' : hoveredEnv === String(env) ? 'rgba(128,128,128,0.2)' : 'none',
111
+ border: 'none',
112
+ cursor: 'pointer'
113
+ },
114
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
115
+ style: {
116
+ display: 'flex',
117
+ alignItems: 'center'
118
+ },
119
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
120
+ style: {
121
+ width: 6,
122
+ height: 6,
123
+ borderRadius: 3,
124
+ backgroundColor: config.backgroundColor,
125
+ marginRight: 8
126
+ }
127
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
128
+ style: {
129
+ fontSize: 10,
130
+ fontWeight: 600,
131
+ color: _gameUIColors.gameUIColors.primaryLight,
132
+ letterSpacing: 0.5
133
+ },
134
+ children: config.label
135
+ })]
136
+ }), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)(CheckGlyph, {})]
137
+ }, String(env));
138
+ })
139
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("button", {
140
+ onClick: () => setExpanded(e => !e),
141
+ "aria-expanded": expanded,
142
+ "aria-label": `Environment: ${current.label}. Click to switch.`,
143
+ style: {
144
+ display: 'flex',
145
+ alignItems: 'center',
146
+ gap: 6,
147
+ padding: '6px 6px 6px 8px',
148
+ borderRadius: 6,
149
+ // native: expanded trigger fuses with panel (squared top corners)
150
+ borderTopLeftRadius: expanded ? 0 : 6,
151
+ borderTopRightRadius: expanded ? 0 : 6,
152
+ backgroundColor: expanded ? 'rgba(8,12,21,0.95)' : 'transparent',
153
+ border: 'none',
154
+ cursor: 'pointer'
155
+ },
156
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
157
+ style: {
158
+ width: 8,
159
+ height: 8,
160
+ borderRadius: 4,
161
+ backgroundColor: current.backgroundColor,
162
+ boxShadow: `0 0 4px ${current.backgroundColor}99`
163
+ }
164
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
165
+ style: {
166
+ fontSize: 11,
167
+ fontWeight: 600,
168
+ color: _gameUIColors.gameUIColors.primaryLight,
169
+ letterSpacing: 0.5
170
+ },
171
+ children: current.label
172
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(ChevronUpGlyph, {
173
+ color: "#7A8599",
174
+ flipped: expanded
175
+ })]
176
+ })]
177
+ });
178
+ }
@@ -33,6 +33,12 @@ Object.defineProperty(exports, "useFilterManager", {
33
33
  return _useFilterManager.useFilterManager;
34
34
  }
35
35
  });
36
+ Object.defineProperty(exports, "usePersistedState", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _usePersistedState.usePersistedState;
40
+ }
41
+ });
36
42
  Object.defineProperty(exports, "useSafeAreaInsets", {
37
43
  enumerable: true,
38
44
  get: function () {
@@ -40,5 +46,6 @@ Object.defineProperty(exports, "useSafeAreaInsets", {
40
46
  }
41
47
  });
42
48
  var _useFilterManager = require("./useFilterManager.js");
49
+ var _usePersistedState = require("./usePersistedState.js");
43
50
  var _useSafeAreaInsets = require("./useSafeAreaInsets.js");
44
51
  var _useDeviceInfo = require("./useDeviceInfo.js");
@@ -7,7 +7,7 @@ exports.useNativeSafeAreaInsets = exports.safeAreaType = exports.hasSafeAreaPack
7
7
  /**
8
8
  * Auto-generated safe area implementation
9
9
  * Detected: none
10
- * Generated at: 2026-08-05T21:40:54.216Z
10
+ * Generated at: 2026-08-07T14:32:36.664Z
11
11
  *
12
12
  * DO NOT EDIT - This file is generated by scripts/detect-safe-area.js
13
13
  *
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.usePersistedState = usePersistedState;
7
+ var _react = require("react");
8
+ var _persistentStorage = require("../utils/persistentStorage.js");
9
+ /**
10
+ * Per-key cache so remounts (and multiple consumers of the same key) render
11
+ * the last-known value immediately instead of flashing the default while the
12
+ * async backend loads again.
13
+ */
14
+ const hydratedCache = new Map();
15
+
16
+ /**
17
+ * `useState` persisted through `persistentStorage` (FileSystem → AsyncStorage
18
+ * → memory). Replaces the load-then-`hasLoaded`-guard `useEffect` pattern
19
+ * every tool used to hand-roll.
20
+ *
21
+ * Values are JSON-serialized; the default is returned until hydration
22
+ * completes (subsequent mounts of the same key hydrate synchronously from an
23
+ * in-memory cache). The third tuple element reports hydration so callers can
24
+ * defer writes that must not clobber a not-yet-loaded value.
25
+ *
26
+ * ```tsx
27
+ * const [tab, setTab, tabHydrated] = usePersistedState("@react_buoy_custom_flags_tab", "flags");
28
+ * ```
29
+ */
30
+ function usePersistedState(key, defaultValue) {
31
+ const [value, setValue] = (0, _react.useState)(() => hydratedCache.has(key) ? hydratedCache.get(key) : defaultValue);
32
+ const [hydrated, setHydrated] = (0, _react.useState)(() => hydratedCache.has(key));
33
+ const keyRef = (0, _react.useRef)(key);
34
+ keyRef.current = key;
35
+ (0, _react.useEffect)(() => {
36
+ if (hydratedCache.has(key)) {
37
+ setValue(hydratedCache.get(key));
38
+ setHydrated(true);
39
+ return;
40
+ }
41
+ let cancelled = false;
42
+ _persistentStorage.persistentStorage.getItem(key).then(raw => {
43
+ if (cancelled) return;
44
+ if (raw != null) {
45
+ try {
46
+ const parsed = JSON.parse(raw);
47
+ hydratedCache.set(key, parsed);
48
+ setValue(parsed);
49
+ } catch {
50
+ // Corrupt payload — fall back to the default and let the next
51
+ // write repair it.
52
+ }
53
+ }
54
+ setHydrated(true);
55
+ }).catch(() => {
56
+ if (!cancelled) setHydrated(true);
57
+ });
58
+ return () => {
59
+ cancelled = true;
60
+ };
61
+ }, [key]);
62
+ const set = (0, _react.useCallback)(next => {
63
+ setValue(prev => {
64
+ const resolved = typeof next === "function" ? next(prev) : next;
65
+ hydratedCache.set(keyRef.current, resolved);
66
+ _persistentStorage.persistentStorage.setItem(keyRef.current, JSON.stringify(resolved)).catch(() => {});
67
+ return resolved;
68
+ });
69
+ }, []);
70
+ return [value, set, hydrated];
71
+ }
@@ -10,8 +10,12 @@ var _exportNames = {
10
10
  ENV_ICON_COLOR: true,
11
11
  ConsoleIcon: true,
12
12
  CONSOLE_ICON_COLOR: true,
13
+ TimeMachineIcon: true,
14
+ TIME_MACHINE_ICON_COLOR: true,
13
15
  ImagesIcon: true,
14
16
  IMAGES_ICON_COLOR: true,
17
+ AssetsIcon: true,
18
+ ASSETS_ICON_COLOR: true,
15
19
  ImpersonateIcon: true,
16
20
  IMPERSONATE_ICON_COLOR: true,
17
21
  ImageOverlayIcon: true,
@@ -36,6 +40,18 @@ var _exportNames = {
36
40
  BenchmarkIcon: true,
37
41
  IconBackground: true
38
42
  };
43
+ Object.defineProperty(exports, "ASSETS_ICON_COLOR", {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _floatingToolsCore.ASSETS_ICON_COLOR;
47
+ }
48
+ });
49
+ Object.defineProperty(exports, "AssetsIcon", {
50
+ enumerable: true,
51
+ get: function () {
52
+ return _floatingToolsCore.AssetsIcon;
53
+ }
54
+ });
39
55
  Object.defineProperty(exports, "BenchmarkIcon", {
40
56
  enumerable: true,
41
57
  get: function () {
@@ -204,6 +220,18 @@ Object.defineProperty(exports, "StorageStackIcon", {
204
220
  return _StorageStackIcon.StorageStackIcon;
205
221
  }
206
222
  });
223
+ Object.defineProperty(exports, "TIME_MACHINE_ICON_COLOR", {
224
+ enumerable: true,
225
+ get: function () {
226
+ return _floatingToolsCore.TIME_MACHINE_ICON_COLOR;
227
+ }
228
+ });
229
+ Object.defineProperty(exports, "TimeMachineIcon", {
230
+ enumerable: true,
231
+ get: function () {
232
+ return _floatingToolsCore.TimeMachineIcon;
233
+ }
234
+ });
207
235
  Object.defineProperty(exports, "WifiCircuitIcon", {
208
236
  enumerable: true,
209
237
  get: function () {
@@ -29,6 +29,12 @@ var _exportNames = {
29
29
  getCachedOptionalModule: true,
30
30
  setRenderCaptureProvider: true,
31
31
  getRenderCaptureProvider: true,
32
+ registerStateSnapshotProvider: true,
33
+ getStateSnapshotProviders: true,
34
+ getStateSnapshotProvider: true,
35
+ subscribeToStateSnapshotProviders: true,
36
+ superJsonSerialize: true,
37
+ superJsonDeserialize: true,
32
38
  reloadApp: true,
33
39
  scheduleReloadApp: true,
34
40
  resolveReloadStrategy: true,
@@ -248,6 +254,18 @@ Object.defineProperty(exports, "getSafeRouter", {
248
254
  return _index3.getSafeRouter;
249
255
  }
250
256
  });
257
+ Object.defineProperty(exports, "getStateSnapshotProvider", {
258
+ enumerable: true,
259
+ get: function () {
260
+ return _index3.getStateSnapshotProvider;
261
+ }
262
+ });
263
+ Object.defineProperty(exports, "getStateSnapshotProviders", {
264
+ enumerable: true,
265
+ get: function () {
266
+ return _index3.getStateSnapshotProviders;
267
+ }
268
+ });
251
269
  Object.defineProperty(exports, "getStorageBackendType", {
252
270
  enumerable: true,
253
271
  get: function () {
@@ -380,6 +398,12 @@ Object.defineProperty(exports, "refreshGameUIColors", {
380
398
  return _gameUIColors.refreshGameUIColors;
381
399
  }
382
400
  });
401
+ Object.defineProperty(exports, "registerStateSnapshotProvider", {
402
+ enumerable: true,
403
+ get: function () {
404
+ return _index3.registerStateSnapshotProvider;
405
+ }
406
+ });
383
407
  Object.defineProperty(exports, "reloadApp", {
384
408
  enumerable: true,
385
409
  get: function () {
@@ -410,6 +434,12 @@ Object.defineProperty(exports, "setRenderCaptureProvider", {
410
434
  return _index3.setRenderCaptureProvider;
411
435
  }
412
436
  });
437
+ Object.defineProperty(exports, "subscribeToStateSnapshotProviders", {
438
+ enumerable: true,
439
+ get: function () {
440
+ return _index3.subscribeToStateSnapshotProviders;
441
+ }
442
+ });
413
443
  Object.defineProperty(exports, "subscribeToSubscriberCountChanges", {
414
444
  enumerable: true,
415
445
  get: function () {
@@ -422,6 +452,18 @@ Object.defineProperty(exports, "subscriberCountNotifier", {
422
452
  return _index3.subscriberCountNotifier;
423
453
  }
424
454
  });
455
+ Object.defineProperty(exports, "superJsonDeserialize", {
456
+ enumerable: true,
457
+ get: function () {
458
+ return _index3.superJsonDeserialize;
459
+ }
460
+ });
461
+ Object.defineProperty(exports, "superJsonSerialize", {
462
+ enumerable: true,
463
+ get: function () {
464
+ return _index3.superJsonSerialize;
465
+ }
466
+ });
425
467
  Object.defineProperty(exports, "truncateText", {
426
468
  enumerable: true,
427
469
  get: function () {
@@ -599,12 +641,12 @@ Object.keys(_index0).forEach(function (key) {
599
641
  });
600
642
  });
601
643
  var _index1 = require("./hooks/index.js");
602
- var _JsModal = require("./JsModal.js");
644
+ var _JsModal = require("./JsModal");
603
645
  var _gameUIColors = require("./ui/gameUI/constants/gameUIColors.js");
604
646
  var _macOSDesignSystemColors = require("./ui/gameUI/constants/macOSDesignSystemColors.js");
605
- var _EnvironmentIndicator = require("./env/EnvironmentIndicator.js");
647
+ var _EnvironmentIndicator = require("./env/EnvironmentIndicator");
606
648
  var _EnvironmentSelector = require("./env/EnvironmentSelector.js");
607
- var _EnvironmentSelectorInline = require("./env/EnvironmentSelectorInline.js");
649
+ var _EnvironmentSelectorInline = require("./env/EnvironmentSelectorInline");
608
650
  var _types = require("./types/types.js");
609
651
  var _index10 = require("./context/index.js");
610
652
  var _index11 = require("./history/index.js");
@@ -38,6 +38,28 @@ const devToolsStorageKeys = exports.devToolsStorageKeys = {
38
38
  dimensions: () => `${devToolsStorageKeys.modal.root()}_dimensions`,
39
39
  hintAcknowledged: () => `${devToolsStorageKeys.modal.root()}_hint_acknowledged`
40
40
  },
41
+ /**
42
+ * Namespace factory for third-party custom tools. Keys share the
43
+ * `@react_buoy` prefix, so `isDevToolsStorageKey` filtering (and the Storage
44
+ * tool's internal-key handling) covers custom-tool persistence for free.
45
+ *
46
+ * ```ts
47
+ * const keys = devToolsStorageKeys.custom("feature-flags");
48
+ * keys.modal(); // "@react_buoy_custom_feature-flags_modal"
49
+ * keys.key("overrides"); // "@react_buoy_custom_feature-flags_overrides"
50
+ * ```
51
+ */
52
+ custom: toolId => {
53
+ const root = `${devToolsStorageKeys.base}_custom_${toolId}`;
54
+ return {
55
+ root: () => root,
56
+ /** JsModal `persistenceKey` for this tool's window dimensions. */
57
+ modal: () => `${root}_modal`,
58
+ settings: () => `${root}_settings`,
59
+ /** Arbitrary tool-scoped key. */
60
+ key: suffix => `${root}_${suffix}`
61
+ };
62
+ },
41
63
  /**
42
64
  * Settings-related storage keys
43
65
  */
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DEFAULT_IGNORED_PATTERNS = void 0;
7
+ exports.isUrlIgnored = isUrlIgnored;
8
+ exports.urlMatchesIgnoredPattern = urlMatchesIgnoredPattern;
9
+ /**
10
+ * Pure, dependency-free part of the ignored-patterns feature — split from
11
+ * ignoredPatternsStore.ts so web consumers (which shim `@buoy-gg/shared-ui`
12
+ * and must not pull the store's relative `../utils/persistentStorage` import
13
+ * with its expo/async-storage requires into the bundle graph) can share the
14
+ * exact matching semantics. The store imports and re-exports everything here;
15
+ * the native barrel is unchanged.
16
+ */
17
+
18
+ /**
19
+ * How a pattern matches a URL:
20
+ *
21
+ * - `contains`: case-insensitive substring match on the full URL (legacy behavior).
22
+ * - `exact`: smart equality — if pattern starts with `/`, matches URL.pathname;
23
+ * if it starts with `http://`/`https://`, matches origin+pathname; otherwise
24
+ * matches URL.host.
25
+ */
26
+
27
+ /** A single exclude pattern with its match mode. */
28
+
29
+ /** Patterns hidden by default — Buoy's own license API traffic. */
30
+ const DEFAULT_IGNORED_PATTERNS = exports.DEFAULT_IGNORED_PATTERNS = [{
31
+ value: "api.keygen.sh",
32
+ mode: "contains"
33
+ }];
34
+
35
+ /**
36
+ * Returns true when `url` matches the ignored `pattern` according to its mode.
37
+ *
38
+ * `contains` → case-insensitive substring on the full URL (legacy behavior).
39
+ * `exact` → smart equality: pattern starting with `/` compares URL.pathname,
40
+ * full URLs compare origin+pathname (ignoring query/hash), bare
41
+ * values compare URL.host. Falls back to literal equality if URL
42
+ * parsing fails (e.g. relative URLs).
43
+ */
44
+ function urlMatchesIgnoredPattern(url, pattern) {
45
+ const lowerUrl = url.toLowerCase();
46
+ const lowerValue = pattern.value.toLowerCase();
47
+ if (pattern.mode === "contains") {
48
+ return lowerUrl.includes(lowerValue);
49
+ }
50
+ try {
51
+ const parsed = new URL(url);
52
+ if (lowerValue.startsWith("/")) {
53
+ return parsed.pathname.toLowerCase() === lowerValue;
54
+ }
55
+ if (lowerValue.startsWith("http://") || lowerValue.startsWith("https://")) {
56
+ return `${parsed.origin}${parsed.pathname}`.toLowerCase() === lowerValue;
57
+ }
58
+ return parsed.host.toLowerCase() === lowerValue;
59
+ } catch {
60
+ return lowerUrl === lowerValue;
61
+ }
62
+ }
63
+
64
+ /** Convenience: does `url` match ANY of the ignored `patterns`? */
65
+ function isUrlIgnored(url, patterns) {
66
+ if (!url || patterns.length === 0) return false;
67
+ return patterns.some(pattern => urlMatchesIgnoredPattern(url, pattern));
68
+ }