@buoy-gg/redux 7.0.40 → 7.0.42

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 (79) hide show
  1. package/README.md +11 -102
  2. package/lib/commonjs/index.js +1 -256
  3. package/lib/commonjs/preset.js +1 -90
  4. package/lib/commonjs/redux/components/ReduxActionButton.js +1 -131
  5. package/lib/commonjs/redux/components/ReduxActionDetailContent.js +1 -437
  6. package/lib/commonjs/redux/components/ReduxActionDetailView.js +1 -401
  7. package/lib/commonjs/redux/components/ReduxActionInfoView.js +1 -836
  8. package/lib/commonjs/redux/components/ReduxActionItem.js +1 -334
  9. package/lib/commonjs/redux/components/ReduxAutoInstrument.js +1 -20
  10. package/lib/commonjs/redux/components/ReduxDetailViewToggle.js +1 -50
  11. package/lib/commonjs/redux/components/ReduxIcon.js +1 -18
  12. package/lib/commonjs/redux/components/ReduxModal.js +1 -703
  13. package/lib/commonjs/redux/hooks/reduxPeer.js +1 -0
  14. package/lib/commonjs/redux/hooks/reduxPeer.web.js +1 -0
  15. package/lib/commonjs/redux/hooks/useAutoInstrumentRedux.js +1 -187
  16. package/lib/commonjs/redux/hooks/useReduxActions.js +1 -58
  17. package/lib/commonjs/redux/sync/reduxSyncAdapter.js +1 -191
  18. package/lib/commonjs/redux/types/index.js +1 -1
  19. package/lib/commonjs/redux/utils/activeStoreRegistry.js +1 -104
  20. package/lib/commonjs/redux/utils/autoInstrument.js +1 -231
  21. package/lib/commonjs/redux/utils/buoyReduxMiddleware.js +1 -202
  22. package/lib/commonjs/redux/utils/createReduxHistoryAdapter.js +1 -146
  23. package/lib/commonjs/redux/utils/devtoolsHook.js +1 -152
  24. package/lib/commonjs/redux/utils/reduxActionStore.js +1 -473
  25. package/lib/commonjs/redux/utils/snapshotProvider.js +1 -158
  26. package/lib/commonjs/redux/utils/testIDs.js +1 -75
  27. package/lib/module/index.js +1 -125
  28. package/lib/module/preset.js +1 -87
  29. package/lib/module/redux/components/ReduxActionButton.js +1 -128
  30. package/lib/module/redux/components/ReduxActionDetailContent.js +1 -433
  31. package/lib/module/redux/components/ReduxActionDetailView.js +1 -397
  32. package/lib/module/redux/components/ReduxActionInfoView.js +1 -831
  33. package/lib/module/redux/components/ReduxActionItem.js +1 -330
  34. package/lib/module/redux/components/ReduxAutoInstrument.js +1 -17
  35. package/lib/module/redux/components/ReduxDetailViewToggle.js +1 -45
  36. package/lib/module/redux/components/ReduxIcon.js +1 -8
  37. package/lib/module/redux/components/ReduxModal.js +1 -698
  38. package/lib/module/redux/hooks/reduxPeer.js +1 -0
  39. package/lib/module/redux/hooks/reduxPeer.web.js +1 -0
  40. package/lib/module/redux/hooks/useAutoInstrumentRedux.js +1 -183
  41. package/lib/module/redux/hooks/useReduxActions.js +1 -54
  42. package/lib/module/redux/sync/reduxSyncAdapter.js +1 -188
  43. package/lib/module/redux/types/index.js +1 -1
  44. package/lib/module/redux/utils/activeStoreRegistry.js +1 -92
  45. package/lib/module/redux/utils/autoInstrument.js +1 -201
  46. package/lib/module/redux/utils/buoyReduxMiddleware.js +1 -188
  47. package/lib/module/redux/utils/createReduxHistoryAdapter.js +1 -142
  48. package/lib/module/redux/utils/devtoolsHook.js +1 -145
  49. package/lib/module/redux/utils/reduxActionStore.js +1 -465
  50. package/lib/module/redux/utils/snapshotProvider.js +1 -157
  51. package/lib/module/redux/utils/testIDs.js +1 -68
  52. package/lib/typescript/redux/hooks/reduxPeer.d.ts +3 -0
  53. package/lib/typescript/redux/hooks/reduxPeer.web.d.ts +2 -0
  54. package/lib/typescript/redux/hooks/useAutoInstrumentRedux.d.ts +3 -15
  55. package/lib/web/index.mjs +1 -0
  56. package/package.json +36 -13
  57. package/lib/typescript/index.d.ts.map +0 -1
  58. package/lib/typescript/preset.d.ts.map +0 -1
  59. package/lib/typescript/redux/components/ReduxActionButton.d.ts.map +0 -1
  60. package/lib/typescript/redux/components/ReduxActionDetailContent.d.ts.map +0 -1
  61. package/lib/typescript/redux/components/ReduxActionDetailView.d.ts.map +0 -1
  62. package/lib/typescript/redux/components/ReduxActionInfoView.d.ts.map +0 -1
  63. package/lib/typescript/redux/components/ReduxActionItem.d.ts.map +0 -1
  64. package/lib/typescript/redux/components/ReduxAutoInstrument.d.ts.map +0 -1
  65. package/lib/typescript/redux/components/ReduxDetailViewToggle.d.ts.map +0 -1
  66. package/lib/typescript/redux/components/ReduxIcon.d.ts.map +0 -1
  67. package/lib/typescript/redux/components/ReduxModal.d.ts.map +0 -1
  68. package/lib/typescript/redux/hooks/useAutoInstrumentRedux.d.ts.map +0 -1
  69. package/lib/typescript/redux/hooks/useReduxActions.d.ts.map +0 -1
  70. package/lib/typescript/redux/sync/reduxSyncAdapter.d.ts.map +0 -1
  71. package/lib/typescript/redux/types/index.d.ts.map +0 -1
  72. package/lib/typescript/redux/utils/activeStoreRegistry.d.ts.map +0 -1
  73. package/lib/typescript/redux/utils/autoInstrument.d.ts.map +0 -1
  74. package/lib/typescript/redux/utils/buoyReduxMiddleware.d.ts.map +0 -1
  75. package/lib/typescript/redux/utils/createReduxHistoryAdapter.d.ts.map +0 -1
  76. package/lib/typescript/redux/utils/devtoolsHook.d.ts.map +0 -1
  77. package/lib/typescript/redux/utils/reduxActionStore.d.ts.map +0 -1
  78. package/lib/typescript/redux/utils/snapshotProvider.d.ts.map +0 -1
  79. package/lib/typescript/redux/utils/testIDs.d.ts.map +0 -1
@@ -1,158 +1 @@
1
- "use strict";
2
-
3
- var _sharedUi = require("@buoy-gg/shared-ui");
4
- var _activeStoreRegistry = require("./activeStoreRegistry");
5
- var _buoyReduxMiddleware = require("./buoyReduxMiddleware");
6
- /**
7
- * Time Machine snapshot provider for Redux.
8
- *
9
- * Registered into @buoy-gg/shared-ui's stateSnapshotRegistry at module init;
10
- * consumed by @buoy-gg/time-machine.
11
- *
12
- * Restore rides the existing `@@buoy/JUMP_TO_STATE` full-state-replace action:
13
- * - enhancer path: always handled (wrapReducer).
14
- * - middleware path: handled ONLY when the app wrapped its root reducer in
15
- * `withBuoyDevTools()` — unverifiable statically, so restore verifies by
16
- * reference identity after dispatch (the wrapped reducer returns the payload
17
- * object itself).
18
- * - patch path: never handled; restore is reported as unavailable up front.
19
- */
20
-
21
- const ENABLE_HINT = "enable restore by using the Buoy enhancer or wrapping your root reducer in withBuoyDevTools()";
22
- function status() {
23
- const {
24
- mechanism,
25
- hasStore,
26
- diagnostic
27
- } = (0, _activeStoreRegistry.getInstrumentationStatus)();
28
- if (!hasStore) {
29
- return {
30
- canCapture: false,
31
- canRestore: false,
32
- detail: diagnostic === "no-react-redux" ? "react-redux not installed" : diagnostic === "no-provider" ? "No Redux <Provider> found" : "No Redux store instrumented"
33
- };
34
- }
35
- if (mechanism === "patch") {
36
- return {
37
- canCapture: true,
38
- canRestore: false,
39
- detail: `Auto-instrumented store cannot be restored — ${ENABLE_HINT}`
40
- };
41
- }
42
- return {
43
- canCapture: true,
44
- canRestore: true,
45
- detail: mechanism === "middleware" ? "Restore requires withBuoyDevTools(rootReducer) — verified at restore time" : undefined
46
- };
47
- }
48
- async function capture() {
49
- const store = (0, _activeStoreRegistry.getActiveStore)();
50
- if (!store) {
51
- return {
52
- data: null,
53
- warnings: ["no Redux store instrumented"]
54
- };
55
- }
56
- return {
57
- data: {
58
- state: store.getState()
59
- },
60
- warnings: []
61
- };
62
- }
63
- async function restore(data, options) {
64
- const snapshot = data;
65
- const store = (0, _activeStoreRegistry.getActiveStore)();
66
- if (!store || snapshot === undefined || snapshot === null) {
67
- return (0, _sharedUi.skippedRestore)("redux", store ? "empty redux snapshot" : "no Redux store instrumented");
68
- }
69
- const {
70
- mechanism
71
- } = (0, _activeStoreRegistry.getInstrumentationStatus)();
72
- if (mechanism === "patch") {
73
- return (0, _sharedUi.skippedRestore)("redux", `restore unavailable on auto-instrumented stores — ${ENABLE_HINT}`);
74
- }
75
- // Untouched slices keep their LIVE values inside the jump payload, so the
76
- // full-state replace leaves them alone. A slice is untouched when it's
77
- // explicitly excluded OR outside the includeKeys scope.
78
- const scope = (0, _sharedUi.createRestoreScope)(options);
79
- const excluded = Object.keys(snapshot.state ?? {}).filter(k => !scope.touch(k));
80
- let payload = snapshot.state;
81
- if (excluded.length > 0) {
82
- const live = store.getState();
83
- const merged = {
84
- ...snapshot.state
85
- };
86
- for (const slice of excluded) merged[slice] = live?.[slice];
87
- payload = merged;
88
- }
89
- store.dispatch({
90
- type: _buoyReduxMiddleware.BUOY_JUMP_TO_STATE,
91
- payload
92
- });
93
- // The wrapped reducer returns the payload object itself, so reference
94
- // identity proves the jump was actually handled (and not silently ignored
95
- // by an unwrapped middleware-path reducer).
96
- if (store.getState() === payload) {
97
- const warnings = excluded.length > 0 ? [`${excluded.length} slice(s) excluded by you`] : [];
98
- return {
99
- ok: true,
100
- applied: 1,
101
- skipped: [],
102
- warnings
103
- };
104
- }
105
- return (0, _sharedUi.skippedRestore)("redux", `store ignored the state jump — ${ENABLE_HINT}`);
106
- }
107
-
108
- /** Per-slice restore preview. `base` omitted = compare against the live store. */
109
- async function previewItems(target, base) {
110
- const targetState = target?.state;
111
- const liveMode = base === undefined;
112
- const store = (0, _activeStoreRegistry.getActiveStore)();
113
- const baseState = liveMode ? store?.getState() : base?.state;
114
- const items = [];
115
- const notes = [];
116
-
117
- // Restore-capability gate — a diff restore can't apply must say so, not
118
- // render as a green change.
119
- let wontApplyReason;
120
- if (liveMode) {
121
- const {
122
- mechanism,
123
- hasStore
124
- } = (0, _activeStoreRegistry.getInstrumentationStatus)();
125
- if (!hasStore) wontApplyReason = "no Redux store instrumented";else if (mechanism === "patch") {
126
- wontApplyReason = `auto-instrumented store cannot be restored — ${ENABLE_HINT}`;
127
- }
128
- }
129
- const oldObj = baseState ?? {};
130
- const newObj = targetState ?? {};
131
- for (const key of (0, _sharedUi.unionKeys)(oldObj, newObj)) {
132
- let item = (0, _sharedUi.classifyPreviewItem)({
133
- key,
134
- label: key,
135
- oldValue: oldObj[key],
136
- newValue: newObj[key],
137
- inOld: Object.prototype.hasOwnProperty.call(oldObj, key),
138
- inNew: Object.prototype.hasOwnProperty.call(newObj, key)
139
- }, {
140
- tooLargeReason: "slice too large to render a diff — restore still applies it"
141
- });
142
- if (wontApplyReason) item = (0, _sharedUi.wontApply)(item, wontApplyReason);
143
- items.push(item);
144
- }
145
- if (wontApplyReason) notes.push(`Redux restore unavailable: ${wontApplyReason}`);
146
- return {
147
- items,
148
- notes
149
- };
150
- }
151
- (0, _sharedUi.registerStateSnapshotProvider)({
152
- id: "redux",
153
- label: "Redux",
154
- status,
155
- capture,
156
- restore,
157
- previewItems
158
- });
1
+ "use strict";var _sharedUi=require("@buoy-gg/shared-ui");var _activeStoreRegistry=require("./activeStoreRegistry");var _buoyReduxMiddleware=require("./buoyReduxMiddleware");const ENABLE_HINT="enable restore by using the Buoy enhancer or wrapping your root reducer in withBuoyDevTools()";function status(){const{mechanism:r,hasStore:a,diagnostic:t}=(0,_activeStoreRegistry.getInstrumentationStatus)();if(!a){return{canCapture:false,canRestore:false,detail:t==="no-react-redux"?"react-redux not installed":t==="no-provider"?"No Redux <Provider> found":"No Redux store instrumented"}}if(r==="patch"){return{canCapture:true,canRestore:false,detail:`Auto-instrumented store cannot be restored \u2014 ${ENABLE_HINT}`}}return{canCapture:true,canRestore:true,detail:r==="middleware"?"Restore requires withBuoyDevTools(rootReducer) \u2014 verified at restore time":void 0}}async function capture(){const r=(0,_activeStoreRegistry.getActiveStore)();if(!r){return{data:null,warnings:["no Redux store instrumented"]}}return{data:{state:r.getState()},warnings:[]}}async function restore(r,a){const t=r;const n=(0,_activeStoreRegistry.getActiveStore)();if(!n||t===void 0||t===null){return(0,_sharedUi.skippedRestore)("redux",n?"empty redux snapshot":"no Redux store instrumented")}const{mechanism:l}=(0,_activeStoreRegistry.getInstrumentationStatus)();if(l==="patch"){return(0,_sharedUi.skippedRestore)("redux",`restore unavailable on auto-instrumented stores \u2014 ${ENABLE_HINT}`)}const p=(0,_sharedUi.createRestoreScope)(a);const s=Object.keys(t.state??{}).filter(e=>!p.touch(e));let i=t.state;if(s.length>0){const e=n.getState();const u={...t.state};for(const d of s)u[d]=e?.[d];i=u}n.dispatch({type:_buoyReduxMiddleware.BUOY_JUMP_TO_STATE,payload:i});if(n.getState()===i){const e=s.length>0?[`${s.length} slice(s) excluded by you`]:[];return{ok:true,applied:1,skipped:[],warnings:e}}return(0,_sharedUi.skippedRestore)("redux",`store ignored the state jump \u2014 ${ENABLE_HINT}`)}async function previewItems(r,a){const t=r?.state;const n=a===void 0;const l=(0,_activeStoreRegistry.getActiveStore)();const p=n?l?.getState():a?.state;const s=[];const i=[];let e;if(n){const{mechanism:o,hasStore:c}=(0,_activeStoreRegistry.getInstrumentationStatus)();if(!c)e="no Redux store instrumented";else if(o==="patch"){e=`auto-instrumented store cannot be restored \u2014 ${ENABLE_HINT}`}}const u=p??{};const d=t??{};for(const o of(0,_sharedUi.unionKeys)(u,d)){let c=(0,_sharedUi.classifyPreviewItem)({key:o,label:o,oldValue:u[o],newValue:d[o],inOld:Object.prototype.hasOwnProperty.call(u,o),inNew:Object.prototype.hasOwnProperty.call(d,o)},{tooLargeReason:"slice too large to render a diff \u2014 restore still applies it"});if(e)c=(0,_sharedUi.wontApply)(c,e);s.push(c)}if(e)i.push(`Redux restore unavailable: ${e}`);return{items:s,notes:i}}(0,_sharedUi.registerStateSnapshotProvider)({id:"redux",label:"Redux",status,capture,restore,previewItems});
@@ -1,75 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.REDUX_TEST_ID = void 0;
7
- exports.actionRowTestID = actionRowTestID;
8
- exports.buildActionRowTestIDs = buildActionRowTestIDs;
9
- exports.slugForTestID = slugForTestID;
10
- /**
11
- * Redux tool test handles.
12
- *
13
- * Every tappable and every value the e2e suite reads back is addressed
14
- * `buoy-redux-<thing>`. One rule in here needs explaining, because it is the
15
- * opposite of what the Events tool does and the difference is not cosmetic:
16
- *
17
- * **A redux row's handle carries an ORDINAL.** The Events tool can address a
18
- * row by what it is about, because an event is a thing that happened to a
19
- * named subject — one key, one URL, one atom. A redux action is not: an app
20
- * dispatches `counter/increment` fifty times and every one of them is a
21
- * separate, equally real row. Addressing them by type alone would give fifty
22
- * views one handle, and Detox fails a *matcher* that hits more than one
23
- * element — so the suite would break on `toExist()`, before any assertion,
24
- * with an error that says nothing about duplicate actions.
25
- *
26
- * So the handle is `buoy-redux-row-<slug(type)>-<n>`, where n counts back from
27
- * the newest row of that type (1 = newest). It is deliberately relative to the
28
- * list rather than absolute: an action has no identity of its own that a host
29
- * could know in advance — `id` is a timestamp plus a per-process counter, and
30
- * the counter's value depends on how many actions the app happened to dispatch
31
- * before the test looked. What a test CAN know is "the increment I just fired
32
- * is the newest increment", which is exactly what `-1` means.
33
- *
34
- * The consequence, and it is the same one the Events tool documents for its
35
- * positional-free handles: read and tap in one beat. A row's ordinal changes
36
- * the moment another action of that type arrives.
37
- *
38
- * The suite mirrors these rules in CommonJS (`example-dev-build/utils/
39
- * reduxBench.js`) and asserts the two agree — Detox runs in Node on the host
40
- * and cannot import TypeScript.
41
- */
42
-
43
- /** Prefix every handle in this tool shares. */
44
- const REDUX_TEST_ID = exports.REDUX_TEST_ID = "buoy-redux";
45
-
46
- /** `counter/increment` → `counter-increment`. Shared with every Buoy tool. */
47
- function slugForTestID(value) {
48
- return String(value ?? "").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || "unknown";
49
- }
50
-
51
- /**
52
- * Handle for one action row: `buoy-redux-row-counter-increment-1`.
53
- *
54
- * `ordinal` is 1-based and counts back from the newest row of this type.
55
- */
56
- function actionRowTestID(type, ordinal) {
57
- return `${REDUX_TEST_ID}-row-${slugForTestID(type)}-${ordinal}`;
58
- }
59
-
60
- /**
61
- * Row handle per action id for one rendered list, newest-first.
62
- *
63
- * Built once for the whole list rather than per row, because an ordinal is a
64
- * fact about the list and a row cannot compute its own.
65
- */
66
- function buildActionRowTestIDs(actions) {
67
- const seen = new Map();
68
- const handles = new Map();
69
- for (const action of actions) {
70
- const ordinal = (seen.get(action.type) ?? 0) + 1;
71
- seen.set(action.type, ordinal);
72
- handles.set(action.id, actionRowTestID(action.type, ordinal));
73
- }
74
- return handles;
75
- }
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.REDUX_TEST_ID=void 0;exports.actionRowTestID=actionRowTestID;exports.buildActionRowTestIDs=buildActionRowTestIDs;exports.slugForTestID=slugForTestID;const REDUX_TEST_ID=exports.REDUX_TEST_ID="buoy-redux";function slugForTestID(e){return String(e??"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"unknown"}function actionRowTestID(e,t){return`${REDUX_TEST_ID}-row-${slugForTestID(e)}-${t}`}function buildActionRowTestIDs(e){const t=new Map;const n=new Map;for(const o of e){const s=(t.get(o.type)??0)+1;t.set(o.type,s);n.set(o.id,actionRowTestID(o.type,s))}return n}
@@ -1,125 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * @buoy-gg/redux
5
- *
6
- * Redux Toolkit DevTools for React Native
7
- *
8
- * PUBLIC API - Only these exports are supported for external use.
9
- * Internal stores are not exported to prevent bypassing the tool's
10
- * intended usage patterns.
11
- *
12
- * ZERO-CONFIG: Just install this package - that's it!
13
- * The Redux DevTools automatically instruments your store when
14
- * FloatingDevTools mounts. No middleware, no configuration needed.
15
- *
16
- * @example Zero-config setup (just install and use!)
17
- * ```tsx
18
- * // 1. Install: npm install @buoy-gg/redux
19
- *
20
- * // 2. Your existing Redux setup (NO CHANGES NEEDED!)
21
- * const store = configureStore({ reducer: rootReducer });
22
- *
23
- * // 3. Your app with FloatingDevTools (Redux tool auto-detected!)
24
- * <Provider store={store}>
25
- * <App />
26
- * <FloatingDevTools /> // Redux tool appears automatically!
27
- * </Provider>
28
- * ```
29
- *
30
- * That's it! The Redux tool will auto-detect your store and capture actions.
31
- *
32
- * HOW CAPTURE WORKS (in priority order):
33
- * 1. ENHANCER — importing this package claims the official Redux DevTools
34
- * global (`__REDUX_DEVTOOLS_EXTENSION_COMPOSE__`), which RTK checks by
35
- * default. If this package loads before your store module, Buoy is inside
36
- * the store from creation: FULL capture (thunk/RTK Query actions included)
37
- * and real time travel. To guarantee this ordering, make
38
- * `import '@buoy-gg/redux';` the FIRST import of your app entry.
39
- * 2. MIDDLEWARE — add `buoyReduxMiddleware` for explicit full capture.
40
- * 3. PATCH — otherwise, `FloatingDevTools` binds the store at first mount by
41
- * patching store.dispatch. Top-level dispatches only (thunk-internal
42
- * actions bypass a dispatch patch — that's a Redux architecture fact).
43
- *
44
- * @example Advanced: Manual middleware (explicit full capture)
45
- * ```tsx
46
- * import { buoyReduxMiddleware, withBuoyDevTools } from '@buoy-gg/redux';
47
- *
48
- * const store = configureStore({
49
- * reducer: withBuoyDevTools(rootReducer), // Enables time-travel
50
- * middleware: (getDefaultMiddleware) =>
51
- * getDefaultMiddleware().concat(buoyReduxMiddleware),
52
- * });
53
- * ```
54
- */
55
-
56
- // Side-effect: registers the Time Machine snapshot provider
57
- import "./redux/utils/snapshotProvider";
58
-
59
- // SIDE EFFECT (must stay first): claim the Redux DevTools global so stores
60
- // created after this module loads get the full-capture enhancer. Dev-only,
61
- // never overrides an existing claimant. See ./redux/utils/devtoolsHook.ts.
62
- import "./redux/utils/devtoolsHook";
63
-
64
- // =============================================================================
65
- // PRESET (Primary entry point for users)
66
- // =============================================================================
67
- export { reduxToolPreset, createReduxTool } from "./preset";
68
-
69
- // =============================================================================
70
- // MIDDLEWARE (Optional - for manual setup if preferred over auto-instrumentation)
71
- // =============================================================================
72
- export { buoyReduxMiddleware, createBuoyReduxMiddleware, withBuoyDevTools, jumpToState, replayAction, BUOY_JUMP_TO_STATE, BUOY_REPLAY_ACTION } from "./redux/utils/buoyReduxMiddleware";
73
-
74
- // =============================================================================
75
- // AUTO-INSTRUMENTATION (For programmatic store instrumentation)
76
- // =============================================================================
77
- export { instrumentStore, uninstrumentStore, isStoreInstrumented, isAutoInstrumentActive, getActiveStore, getInstrumentationStatus, registerReduxStore } from "./redux/utils/autoInstrument";
78
- // Store-creation-time capture (the primary, full-capture path). Claimed as a
79
- // module side effect above; exported for tests/advanced hosts.
80
- export { buoyDevtoolsEnhancer, claimDevtoolsHook, isDevtoolsHookClaimed } from "./redux/utils/devtoolsHook";
81
-
82
- // =============================================================================
83
- // HISTORY ADAPTER (For universal history devtools)
84
- // =============================================================================
85
- export { createReduxHistoryAdapter, reduxHistoryAdapter } from "./redux/utils/createReduxHistoryAdapter";
86
-
87
- // =============================================================================
88
- // EXTERNAL SYNC (Adapter for @buoy-gg/external-sync's useExternalSync)
89
- // =============================================================================
90
- export { reduxSyncAdapter } from "./redux/sync/reduxSyncAdapter";
91
-
92
- // =============================================================================
93
- // HOOKS (For consuming Redux action data)
94
- // =============================================================================
95
- export { useReduxActions } from "./redux/hooks/useReduxActions";
96
- // Auto-instrumentation hooks (for advanced use cases)
97
- export { useAutoInstrumentRedux, useReduxAvailability } from "./redux/hooks/useAutoInstrumentRedux";
98
- // =============================================================================
99
- // COMPONENTS (For custom UI implementations)
100
- // =============================================================================
101
- // `ReduxToolView` is the same tool rendered inline (header bar + body + footer)
102
- // instead of inside a JsModal — for hosts that show tools in a panel.
103
- export { ReduxModal, ReduxToolView, FREE_TIER_ACTION_LIMIT } from "./redux/components/ReduxModal";
104
- export { ReduxActionItem } from "./redux/components/ReduxActionItem";
105
- export { ReduxActionDetailView } from "./redux/components/ReduxActionDetailView";
106
- export { ReduxActionDetailContent, ReduxActionDetailFooter } from "./redux/components/ReduxActionDetailContent";
107
- export { ReduxIcon } from "./redux/components/ReduxIcon";
108
- // Headless startup instrumentation — auto-rendered by @buoy-gg/core's
109
- // FloatingDevTools; exported for hosts that mount devtools their own way.
110
- export { ReduxAutoInstrument } from "./redux/components/ReduxAutoInstrument";
111
-
112
- // =============================================================================
113
- // TEST HANDLES (shared with the e2e suite and the website's live tour)
114
- // =============================================================================
115
- export { REDUX_TEST_ID, actionRowTestID, buildActionRowTestIDs, slugForTestID } from "./redux/utils/testIDs";
116
-
117
- // =============================================================================
118
- // TYPES
119
- // =============================================================================
120
-
121
- // =============================================================================
122
- // INTERNAL EXPORTS (For @buoy-gg/* packages only - not part of public API)
123
- // =============================================================================
124
- /** @internal */
125
- export { reduxActionStore } from "./redux/utils/reduxActionStore";
1
+ "use strict";import"./redux/utils/snapshotProvider";import"./redux/utils/devtoolsHook";export{reduxToolPreset,createReduxTool}from"./preset";export{buoyReduxMiddleware,createBuoyReduxMiddleware,withBuoyDevTools,jumpToState,replayAction,BUOY_JUMP_TO_STATE,BUOY_REPLAY_ACTION}from"./redux/utils/buoyReduxMiddleware";export{instrumentStore,uninstrumentStore,isStoreInstrumented,isAutoInstrumentActive,getActiveStore,getInstrumentationStatus,registerReduxStore}from"./redux/utils/autoInstrument";export{buoyDevtoolsEnhancer,claimDevtoolsHook,isDevtoolsHookClaimed}from"./redux/utils/devtoolsHook";export{createReduxHistoryAdapter,reduxHistoryAdapter}from"./redux/utils/createReduxHistoryAdapter";export{reduxSyncAdapter}from"./redux/sync/reduxSyncAdapter";export{useReduxActions}from"./redux/hooks/useReduxActions";export{useAutoInstrumentRedux,useReduxAvailability}from"./redux/hooks/useAutoInstrumentRedux";export{ReduxModal,ReduxToolView,FREE_TIER_ACTION_LIMIT}from"./redux/components/ReduxModal";export{ReduxActionItem}from"./redux/components/ReduxActionItem";export{ReduxActionDetailView}from"./redux/components/ReduxActionDetailView";export{ReduxActionDetailContent,ReduxActionDetailFooter}from"./redux/components/ReduxActionDetailContent";export{ReduxIcon}from"./redux/components/ReduxIcon";export{ReduxAutoInstrument}from"./redux/components/ReduxAutoInstrument";export{REDUX_TEST_ID,actionRowTestID,buildActionRowTestIDs,slugForTestID}from"./redux/utils/testIDs";export{reduxActionStore}from"./redux/utils/reduxActionStore";
@@ -1,87 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * Pre-configured Redux DevTools preset for FloatingDevTools
5
- *
6
- * ZERO-CONFIG: This preset is auto-discovered by FloatingDevTools!
7
- * You do NOT need to import or configure anything - just install @buoy-gg/redux
8
- * and the Redux tool will appear automatically in your FloatingDevTools.
9
- *
10
- * @example Automatic (recommended - no code needed!)
11
- * ```tsx
12
- * // Just install: npm install @buoy-gg/redux
13
- * // The Redux tool appears automatically in FloatingDevTools!
14
- *
15
- * <Provider store={store}>
16
- * <App />
17
- * <FloatingDevTools /> // Redux tool is auto-detected
18
- * </Provider>
19
- * ```
20
- *
21
- * @example Manual (only for custom configuration)
22
- * ```tsx
23
- * import { createReduxTool } from '@buoy-gg/redux';
24
- *
25
- * // Only use this if you need to customize the tool
26
- * const customReduxTool = createReduxTool({
27
- * name: "STATE",
28
- * iconColor: "#9945FF",
29
- * });
30
- *
31
- * <FloatingDevTools apps={[customReduxTool]} />
32
- * ```
33
- */
34
-
35
- import { ReduxModal } from "./redux/components/ReduxModal";
36
- import { ReduxIcon } from "./redux/components/ReduxIcon";
37
- import { createToolFactory, defineToolPreset } from "@buoy-gg/shared-ui";
38
-
39
- /**
40
- * Pre-configured Redux DevTools preset for FloatingDevTools.
41
- * Includes:
42
- * - Live action monitoring
43
- * - Action/state inspection
44
- * - State diff visualization
45
- * - Filter by action type
46
- */
47
- import { jsx as _jsx } from "react/jsx-runtime";
48
- export const reduxToolPreset = defineToolPreset({
49
- id: "redux",
50
- name: "REDUX",
51
- description: "Redux action & state inspector",
52
- slot: "both",
53
- icon: ({
54
- size
55
- }) => /*#__PURE__*/_jsx(ReduxIcon, {
56
- size: size
57
- }),
58
- component: ReduxModal,
59
- props: {
60
- enableSharedModalDimensions: false
61
- }
62
- });
63
-
64
- /**
65
- * Create a custom Redux DevTools configuration.
66
- * Use this if you want to override default settings.
67
- *
68
- * @example
69
- * ```tsx
70
- * import { createReduxTool } from '@buoy-gg/redux';
71
- *
72
- * const myReduxTool = createReduxTool({
73
- * name: "STATE",
74
- * iconColor: "#9945FF", // Purple color
75
- * });
76
- * ```
77
- */
78
- export const createReduxTool = createToolFactory(reduxToolPreset, options => ({
79
- enableSharedModalDimensions: options.enableSharedModalDimensions ?? false
80
- }), options => ({
81
- icon: ({
82
- size
83
- }) => /*#__PURE__*/_jsx(ReduxIcon, {
84
- size: size,
85
- color: options.iconColor
86
- })
87
- }));
1
+ "use strict";import{ReduxModal as t}from"./redux/components/ReduxModal";import{ReduxIcon as e}from"./redux/components/ReduxIcon";import{createToolFactory as i,defineToolPreset as n}from"@buoy-gg/shared-ui";import{jsx as r}from"react/jsx-runtime";export const reduxToolPreset=n({id:"redux",name:"REDUX",description:"Redux action & state inspector",slot:"both",icon:({size:o})=>r(e,{size:o}),component:t,props:{enableSharedModalDimensions:false}});export const createReduxTool=i(reduxToolPreset,o=>({enableSharedModalDimensions:o.enableSharedModalDimensions??false}),o=>({icon:({size:s})=>r(e,{size:s,color:o.iconColor})}));
@@ -1,128 +1 @@
1
- "use strict";
2
-
3
- /**
4
- * ReduxActionButton
5
- *
6
- * Generic action button for Redux DevTools footer
7
- * Matches React Query DevTools ActionButton styling
8
- */
9
-
10
- import { TouchableOpacity, Text, View, StyleSheet } from "react-native";
11
- import { night, monoFont } from "@buoy-gg/shared-ui";
12
-
13
- // Button color configurations matching React Query pattern
14
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
- const buttonConfigs = {
16
- replay: {
17
- color: night.color.accent,
18
- backgroundColor: night.color.accent + "15",
19
- borderColor: night.color.accent + "40",
20
- textColor: night.color.accent
21
- },
22
- copy: {
23
- color: night.color.accent,
24
- backgroundColor: night.color.accent + "15",
25
- borderColor: night.color.accent + "40",
26
- textColor: night.color.accent
27
- },
28
- jump: {
29
- color: night.color.warning,
30
- backgroundColor: night.color.warning + "15",
31
- borderColor: night.color.warning + "40",
32
- textColor: night.color.warning
33
- },
34
- skip: {
35
- color: night.color.textSecondary,
36
- backgroundColor: night.color.textSecondary + "26",
37
- borderColor: night.color.textSecondary + "59",
38
- textColor: night.color.textSecondary
39
- },
40
- clear: {
41
- color: night.color.danger,
42
- backgroundColor: night.color.danger + "15",
43
- borderColor: night.color.danger + "40",
44
- textColor: night.color.danger
45
- },
46
- diff: {
47
- color: night.color.info,
48
- backgroundColor: night.color.info + "15",
49
- borderColor: night.color.info + "40",
50
- textColor: night.color.info
51
- }
52
- };
53
- export function ReduxActionButton({
54
- onPress,
55
- text,
56
- type,
57
- disabled = false,
58
- testID
59
- }) {
60
- const config = buttonConfigs[type];
61
- return /*#__PURE__*/_jsxs(TouchableOpacity, {
62
- testID: testID,
63
- disabled: disabled,
64
- onPress: onPress,
65
- style: [styles.button, {
66
- backgroundColor: disabled ? night.color.textTertiary + "1A" : config.backgroundColor,
67
- borderColor: disabled ? night.color.textTertiary + "33" : config.borderColor,
68
- opacity: disabled ? 0.5 : 1
69
- }],
70
- activeOpacity: 0.7,
71
- accessibilityRole: "button",
72
- accessibilityLabel: text,
73
- accessibilityState: {
74
- disabled
75
- },
76
- children: [/*#__PURE__*/_jsx(View, {
77
- style: [styles.dot, {
78
- backgroundColor: disabled ? night.color.textTertiary : config.color
79
- }]
80
- }), /*#__PURE__*/_jsx(Text, {
81
- style: [styles.text, {
82
- color: disabled ? night.color.textTertiary : config.textColor
83
- }],
84
- children: text
85
- })]
86
- });
87
- }
88
- const styles = StyleSheet.create({
89
- button: {
90
- flexDirection: "row",
91
- alignItems: "center",
92
- justifyContent: "center",
93
- borderRadius: 6,
94
- borderWidth: 1,
95
- paddingHorizontal: 12,
96
- paddingVertical: 6,
97
- height: 25,
98
- minWidth: 80,
99
- shadowOffset: {
100
- width: 0,
101
- height: 1
102
- },
103
- shadowOpacity: 0.2,
104
- shadowRadius: 2,
105
- elevation: 2
106
- },
107
- dot: {
108
- width: 5,
109
- height: 5,
110
- borderRadius: 3,
111
- marginRight: 6,
112
- shadowColor: night.color.text,
113
- shadowOffset: {
114
- width: 0,
115
- height: 0
116
- },
117
- shadowOpacity: 0.6,
118
- shadowRadius: 2
119
- },
120
- text: {
121
- fontSize: 10,
122
- fontWeight: "600",
123
- letterSpacing: 0.5,
124
- textTransform: "uppercase",
125
- fontFamily: monoFont,
126
- height: 12
127
- }
128
- });
1
+ "use strict";import{TouchableOpacity as d,Text as s,View as g,StyleSheet as h}from"react-native";import{night as o,monoFont as C}from"@buoy-gg/shared-ui";import{jsx as l,jsxs as u}from"react/jsx-runtime";const x={replay:{color:o.color.accent,backgroundColor:o.color.accent+"15",borderColor:o.color.accent+"40",textColor:o.color.accent},copy:{color:o.color.accent,backgroundColor:o.color.accent+"15",borderColor:o.color.accent+"40",textColor:o.color.accent},jump:{color:o.color.warning,backgroundColor:o.color.warning+"15",borderColor:o.color.warning+"40",textColor:o.color.warning},skip:{color:o.color.textSecondary,backgroundColor:o.color.textSecondary+"26",borderColor:o.color.textSecondary+"59",textColor:o.color.textSecondary},clear:{color:o.color.danger,backgroundColor:o.color.danger+"15",borderColor:o.color.danger+"40",textColor:o.color.danger},diff:{color:o.color.info,backgroundColor:o.color.info+"15",borderColor:o.color.info+"40",textColor:o.color.info}};export function ReduxActionButton({onPress:n,text:c,type:a,disabled:r=false,testID:i}){const t=x[a];return u(d,{testID:i,disabled:r,onPress:n,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,accessibilityRole:"button",accessibilityLabel:c,accessibilityState:{disabled:r},children:[l(g,{style:[e.dot,{backgroundColor:r?o.color.textTertiary:t.color}]}),l(s,{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:C,height:12}});