storion 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +705 -573
- package/dist/async/async.d.ts +87 -0
- package/dist/async/async.d.ts.map +1 -0
- package/dist/async/index.d.ts +13 -0
- package/dist/async/index.d.ts.map +1 -0
- package/dist/async/index.js +451 -0
- package/dist/async/types.d.ts +275 -0
- package/dist/async/types.d.ts.map +1 -0
- package/dist/collection.d.ts +42 -0
- package/dist/collection.d.ts.map +1 -0
- package/dist/core/container.d.ts +33 -2
- package/dist/core/container.d.ts.map +1 -1
- package/dist/core/createResolver.d.ts +47 -0
- package/dist/core/createResolver.d.ts.map +1 -0
- package/dist/core/equality.d.ts +23 -3
- package/dist/core/equality.d.ts.map +1 -1
- package/dist/core/fnWrapper.d.ts +54 -0
- package/dist/core/fnWrapper.d.ts.map +1 -0
- package/dist/core/pick.d.ts +6 -6
- package/dist/core/pick.d.ts.map +1 -1
- package/dist/core/store.d.ts +8 -8
- package/dist/core/store.d.ts.map +1 -1
- package/dist/core/storeContext.d.ts +63 -0
- package/dist/core/storeContext.d.ts.map +1 -0
- package/dist/devtools/controller.d.ts +4 -0
- package/dist/devtools/controller.d.ts.map +1 -0
- package/dist/devtools/index.d.ts +16 -0
- package/dist/devtools/index.d.ts.map +1 -0
- package/dist/devtools/index.js +229 -0
- package/dist/devtools/middleware.d.ts +22 -0
- package/dist/devtools/middleware.d.ts.map +1 -0
- package/dist/devtools/types.d.ts +116 -0
- package/dist/devtools/types.d.ts.map +1 -0
- package/dist/devtools-panel/DevtoolsPanel.d.ts +17 -0
- package/dist/devtools-panel/DevtoolsPanel.d.ts.map +1 -0
- package/dist/devtools-panel/components/CompareModal.d.ts +10 -0
- package/dist/devtools-panel/components/CompareModal.d.ts.map +1 -0
- package/dist/devtools-panel/components/EventEntry.d.ts +14 -0
- package/dist/devtools-panel/components/EventEntry.d.ts.map +1 -0
- package/dist/devtools-panel/components/EventFilterBar.d.ts +10 -0
- package/dist/devtools-panel/components/EventFilterBar.d.ts.map +1 -0
- package/dist/devtools-panel/components/EventsTab.d.ts +15 -0
- package/dist/devtools-panel/components/EventsTab.d.ts.map +1 -0
- package/dist/devtools-panel/components/ResizeHandle.d.ts +8 -0
- package/dist/devtools-panel/components/ResizeHandle.d.ts.map +1 -0
- package/dist/devtools-panel/components/StoreEntry.d.ts +13 -0
- package/dist/devtools-panel/components/StoreEntry.d.ts.map +1 -0
- package/dist/devtools-panel/components/StoresTab.d.ts +12 -0
- package/dist/devtools-panel/components/StoresTab.d.ts.map +1 -0
- package/dist/devtools-panel/components/TabLayout.d.ts +48 -0
- package/dist/devtools-panel/components/TabLayout.d.ts.map +1 -0
- package/dist/devtools-panel/components/icons.d.ts +27 -0
- package/dist/devtools-panel/components/icons.d.ts.map +1 -0
- package/dist/devtools-panel/components/index.d.ts +15 -0
- package/dist/devtools-panel/components/index.d.ts.map +1 -0
- package/dist/devtools-panel/hooks.d.ts +23 -0
- package/dist/devtools-panel/hooks.d.ts.map +1 -0
- package/dist/devtools-panel/index.d.ts +25 -0
- package/dist/devtools-panel/index.d.ts.map +1 -0
- package/dist/devtools-panel/index.js +3326 -0
- package/dist/devtools-panel/mount.d.ts +41 -0
- package/dist/devtools-panel/mount.d.ts.map +1 -0
- package/dist/devtools-panel/styles.d.ts +50 -0
- package/dist/devtools-panel/styles.d.ts.map +1 -0
- package/dist/devtools-panel/types.d.ts +15 -0
- package/dist/devtools-panel/types.d.ts.map +1 -0
- package/dist/devtools-panel/utils.d.ts +21 -0
- package/dist/devtools-panel/utils.d.ts.map +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/is.d.ts +69 -0
- package/dist/is.d.ts.map +1 -0
- package/dist/react/create.d.ts +1 -1
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +209 -33
- package/dist/react/useLocalStore.d.ts.map +1 -1
- package/dist/react/useStore.d.ts +2 -2
- package/dist/react/useStore.d.ts.map +1 -1
- package/dist/react/withStore.d.ts +140 -0
- package/dist/react/withStore.d.ts.map +1 -0
- package/dist/{index-rLf6DusB.js → store-XP2pujaJ.js} +537 -740
- package/dist/storion.js +740 -9
- package/dist/trigger.d.ts +40 -0
- package/dist/trigger.d.ts.map +1 -0
- package/dist/types.d.ts +516 -50
- package/dist/types.d.ts.map +1 -1
- package/package.json +13 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { StateBase, ActionsBase, StoreSpec, StoreInstance, Resolver, StoreContext, Focus, FocusOptions } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Internal focus context for creating focus instances.
|
|
5
|
+
*/
|
|
6
|
+
export interface FocusContext<TState extends StateBase> {
|
|
7
|
+
/** Get current state */
|
|
8
|
+
getState: () => TState;
|
|
9
|
+
/** Update state with immer-style updater */
|
|
10
|
+
update: (updater: (draft: TState) => void) => void;
|
|
11
|
+
/** Subscribe to state changes */
|
|
12
|
+
subscribe: (listener: () => void) => VoidFunction;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Options for creating store context.
|
|
16
|
+
*/
|
|
17
|
+
export interface CreateStoreContextOptions<TState extends StateBase, TActions extends ActionsBase> {
|
|
18
|
+
/** The store specification */
|
|
19
|
+
spec: StoreSpec<TState, TActions>;
|
|
20
|
+
/** The resolver for dependencies */
|
|
21
|
+
resolver: Resolver;
|
|
22
|
+
/** Get current mutable state */
|
|
23
|
+
getMutableState: () => TState;
|
|
24
|
+
/** Update state using immer */
|
|
25
|
+
update: (updater: ((draft: TState) => void) | Partial<TState>) => void;
|
|
26
|
+
/** Subscribe to store changes */
|
|
27
|
+
subscribe: (listener: () => void) => VoidFunction;
|
|
28
|
+
/** Check if property is dirty */
|
|
29
|
+
dirty: (prop?: keyof TState) => boolean;
|
|
30
|
+
/** Reset state to initial */
|
|
31
|
+
reset: () => void;
|
|
32
|
+
/** Get the store instance (may be null during setup) */
|
|
33
|
+
getInstance: () => StoreInstance<TState, TActions> | null;
|
|
34
|
+
/** Callback when dependency is resolved */
|
|
35
|
+
onDependency?: (instance: StoreInstance<any, any>) => void;
|
|
36
|
+
/** Register a callback to run when parent store disposes */
|
|
37
|
+
onDispose?: (callback: () => void) => void;
|
|
38
|
+
/** Check if in setup phase */
|
|
39
|
+
isSetupPhase: () => boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Create a focus for a nested state path.
|
|
43
|
+
*
|
|
44
|
+
* @param focusCtx - Focus context with state access
|
|
45
|
+
* @param path - Dot-notation path to focus on
|
|
46
|
+
* @param options - Focus options (fallback, equality)
|
|
47
|
+
*/
|
|
48
|
+
export declare function createFocus<TState extends StateBase, TValue>(focusCtx: FocusContext<TState>, path: string, options?: FocusOptions<TValue>): Focus<TValue>;
|
|
49
|
+
/**
|
|
50
|
+
* Create a store context for the setup function.
|
|
51
|
+
*
|
|
52
|
+
* The context provides:
|
|
53
|
+
* - state: Mutable reactive state proxy
|
|
54
|
+
* - get(): Get other store's state and actions
|
|
55
|
+
* - create(): Create a child store with automatic disposal
|
|
56
|
+
* - update(): Update state with immer or partial object
|
|
57
|
+
* - focus(): Create lens-like accessor for nested paths
|
|
58
|
+
* - mixin(): Compose reusable mixins
|
|
59
|
+
* - dirty(): Check if state has been modified
|
|
60
|
+
* - reset(): Reset state to initial values
|
|
61
|
+
*/
|
|
62
|
+
export declare function createStoreContext<TState extends StateBase, TActions extends ActionsBase>(options: CreateStoreContextOptions<TState, TActions>): StoreContext<TState>;
|
|
63
|
+
//# sourceMappingURL=storeContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storeContext.d.ts","sourceRoot":"","sources":["../../src/core/storeContext.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,YAAY,EAGjB,KAAK,KAAK,EACV,KAAK,YAAY,EAElB,MAAM,UAAU,CAAC;AASlB;;GAEG;AACH,MAAM,WAAW,YAAY,CAAC,MAAM,SAAS,SAAS;IACpD,wBAAwB;IACxB,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,4CAA4C;IAC5C,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,CAAC;IACnD,iCAAiC;IACjC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,YAAY,CAAC;CACnD;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB,CACxC,MAAM,SAAS,SAAS,EACxB,QAAQ,SAAS,WAAW;IAE5B,8BAA8B;IAC9B,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAClC,oCAAoC;IACpC,QAAQ,EAAE,QAAQ,CAAC;IACnB,gCAAgC;IAChC,eAAe,EAAE,MAAM,MAAM,CAAC;IAC9B,+BAA+B;IAC/B,MAAM,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IACvE,iCAAiC;IACjC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,YAAY,CAAC;IAClD,iCAAiC;IACjC,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,MAAM,KAAK,OAAO,CAAC;IACxC,6BAA6B;IAC7B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,wDAAwD;IACxD,WAAW,EAAE,MAAM,aAAa,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,IAAI,CAAC;IAC1D,2CAA2C;IAC3C,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,KAAK,IAAI,CAAC;IAC3D,4DAA4D;IAC5D,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAC3C,8BAA8B;IAC9B,YAAY,EAAE,MAAM,OAAO,CAAC;CAC7B;AAkBD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,MAAM,SAAS,SAAS,EAAE,MAAM,EAC1D,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC,EAC9B,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,GAC7B,KAAK,CAAC,MAAM,CAAC,CAsHf;AA2CD;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,SAAS,SAAS,EACxB,QAAQ,SAAS,WAAW,EAC5B,OAAO,EAAE,yBAAyB,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,CA6J5E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/devtools/controller.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EACV,kBAAkB,EAKnB,MAAM,SAAS,CAAC;AAOjB,wBAAgB,wBAAwB,CACtC,UAAU,GAAE,MAAU,GACrB,kBAAkB,CAsMpB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storion Devtools
|
|
3
|
+
*
|
|
4
|
+
* @example
|
|
5
|
+
* ```ts
|
|
6
|
+
* import { container } from "storion";
|
|
7
|
+
* import { devtoolsMiddleware } from "storion/devtools";
|
|
8
|
+
*
|
|
9
|
+
* const app = container({
|
|
10
|
+
* middleware: [devtoolsMiddleware()],
|
|
11
|
+
* });
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export { devtoolsMiddleware, getDevtoolsController } from './middleware';
|
|
15
|
+
export type { DevtoolsController, DevtoolsStoreEntry, DevtoolsMiddlewareOptions, StateSnapshot, DevtoolsEvent, DevtoolsEventType, } from './types';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/devtools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACzE,YAAY,EACV,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,aAAa,EACb,aAAa,EACb,iBAAiB,GAClB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { e as emitter, c as createStoreInstance, S as STORION_TYPE } from "../store-XP2pujaJ.js";
|
|
2
|
+
let snapshotIdCounter = 0;
|
|
3
|
+
let eventIdCounter = 0;
|
|
4
|
+
const DEFAULT_MAX_EVENTS = 200;
|
|
5
|
+
function createDevtoolsController(maxHistory = 5) {
|
|
6
|
+
const stores = /* @__PURE__ */ new Map();
|
|
7
|
+
const events = [];
|
|
8
|
+
const changeEmitter = emitter();
|
|
9
|
+
const notifyChange = () => {
|
|
10
|
+
changeEmitter.emit();
|
|
11
|
+
};
|
|
12
|
+
const addEvent = (type, target, extra, data) => {
|
|
13
|
+
events.push({
|
|
14
|
+
id: ++eventIdCounter,
|
|
15
|
+
timestamp: Date.now(),
|
|
16
|
+
type,
|
|
17
|
+
target,
|
|
18
|
+
extra,
|
|
19
|
+
data
|
|
20
|
+
});
|
|
21
|
+
while (events.length > controller.maxEvents) {
|
|
22
|
+
events.shift();
|
|
23
|
+
}
|
|
24
|
+
notifyChange();
|
|
25
|
+
};
|
|
26
|
+
const controller = {
|
|
27
|
+
version: "1.0.0",
|
|
28
|
+
maxHistory,
|
|
29
|
+
maxEvents: DEFAULT_MAX_EVENTS,
|
|
30
|
+
getStores() {
|
|
31
|
+
return Array.from(stores.values());
|
|
32
|
+
},
|
|
33
|
+
getStore(id) {
|
|
34
|
+
return stores.get(id);
|
|
35
|
+
},
|
|
36
|
+
getEvents() {
|
|
37
|
+
return [...events];
|
|
38
|
+
},
|
|
39
|
+
clearEvents() {
|
|
40
|
+
events.length = 0;
|
|
41
|
+
notifyChange();
|
|
42
|
+
},
|
|
43
|
+
recordEvent(type, target, extra, data) {
|
|
44
|
+
addEvent(type, target, extra, data);
|
|
45
|
+
},
|
|
46
|
+
revertToSnapshot(storeId, snapshotId) {
|
|
47
|
+
const entry = stores.get(storeId);
|
|
48
|
+
if (!entry) return false;
|
|
49
|
+
const snapshotIndex = entry.history.findIndex((s) => s.id === snapshotId);
|
|
50
|
+
if (snapshotIndex === -1) return false;
|
|
51
|
+
const snapshot = entry.history[snapshotIndex];
|
|
52
|
+
const actions = entry.instance.actions;
|
|
53
|
+
if (typeof actions.__revertState === "function") {
|
|
54
|
+
entry.history = entry.history.slice(0, snapshotIndex);
|
|
55
|
+
actions.__revertState(snapshot.state);
|
|
56
|
+
notifyChange();
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
},
|
|
61
|
+
takeSnapshot(storeId) {
|
|
62
|
+
const entry = stores.get(storeId);
|
|
63
|
+
if (!entry) return void 0;
|
|
64
|
+
const snapshot = createSnapshot(entry.instance.state, "manual");
|
|
65
|
+
addSnapshot(entry, snapshot);
|
|
66
|
+
notifyChange();
|
|
67
|
+
return snapshot;
|
|
68
|
+
},
|
|
69
|
+
clearHistory(storeId) {
|
|
70
|
+
const entry = stores.get(storeId);
|
|
71
|
+
if (entry) {
|
|
72
|
+
entry.history = [];
|
|
73
|
+
notifyChange();
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
clear() {
|
|
77
|
+
stores.clear();
|
|
78
|
+
notifyChange();
|
|
79
|
+
},
|
|
80
|
+
subscribe(listener) {
|
|
81
|
+
return changeEmitter.on(listener);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
controller._registerStore = (entry) => {
|
|
85
|
+
const fullEntry = {
|
|
86
|
+
...entry,
|
|
87
|
+
history: []
|
|
88
|
+
};
|
|
89
|
+
const snapshot = createSnapshot(entry.state, "init");
|
|
90
|
+
fullEntry.history.push(snapshot);
|
|
91
|
+
stores.set(entry.id, fullEntry);
|
|
92
|
+
addEvent("create", entry.id, entry.name);
|
|
93
|
+
notifyChange();
|
|
94
|
+
};
|
|
95
|
+
controller._unregisterStore = (id) => {
|
|
96
|
+
if (stores.has(id)) {
|
|
97
|
+
addEvent("dispose", id);
|
|
98
|
+
stores.delete(id);
|
|
99
|
+
notifyChange();
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
controller._recordStateChange = (id, state, action, actionArgs) => {
|
|
103
|
+
const entry = stores.get(id);
|
|
104
|
+
if (!entry) return;
|
|
105
|
+
const changedKeys = [];
|
|
106
|
+
for (const key of Object.keys(state)) {
|
|
107
|
+
if (entry.state[key] !== state[key]) {
|
|
108
|
+
changedKeys.push(key);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (changedKeys.length === 0) return;
|
|
112
|
+
entry.state = state;
|
|
113
|
+
const snapshot = createSnapshot(state, action, actionArgs);
|
|
114
|
+
addSnapshot(entry, snapshot);
|
|
115
|
+
if (action) {
|
|
116
|
+
addEvent("dispatch", id, action, { args: actionArgs, changed: changedKeys });
|
|
117
|
+
} else {
|
|
118
|
+
addEvent("change", id, changedKeys.join(", "), { changed: changedKeys });
|
|
119
|
+
}
|
|
120
|
+
notifyChange();
|
|
121
|
+
};
|
|
122
|
+
function createSnapshot(state, action, actionArgs) {
|
|
123
|
+
return {
|
|
124
|
+
id: ++snapshotIdCounter,
|
|
125
|
+
timestamp: Date.now(),
|
|
126
|
+
state: { ...state },
|
|
127
|
+
// Shallow copy
|
|
128
|
+
action,
|
|
129
|
+
actionArgs
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function addSnapshot(entry, snapshot) {
|
|
133
|
+
entry.history.push(snapshot);
|
|
134
|
+
while (entry.history.length > controller.maxHistory) {
|
|
135
|
+
entry.history.shift();
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return controller;
|
|
139
|
+
}
|
|
140
|
+
function devtoolsMiddleware(options = {}) {
|
|
141
|
+
const {
|
|
142
|
+
maxHistory = 5,
|
|
143
|
+
windowObject = typeof window !== "undefined" ? window : void 0
|
|
144
|
+
} = options;
|
|
145
|
+
let controller;
|
|
146
|
+
if (windowObject) {
|
|
147
|
+
const key = "__STORION_DEVTOOLS__";
|
|
148
|
+
if (!windowObject[key]) {
|
|
149
|
+
controller = createDevtoolsController(maxHistory);
|
|
150
|
+
windowObject[key] = controller;
|
|
151
|
+
} else {
|
|
152
|
+
controller = windowObject[key];
|
|
153
|
+
}
|
|
154
|
+
} else {
|
|
155
|
+
controller = createDevtoolsController(maxHistory);
|
|
156
|
+
}
|
|
157
|
+
const registerStore = controller._registerStore;
|
|
158
|
+
const unregisterStore = controller._unregisterStore;
|
|
159
|
+
const recordStateChange = controller._recordStateChange;
|
|
160
|
+
return (spec, next) => {
|
|
161
|
+
const originalSetup = spec.options.setup;
|
|
162
|
+
const modifiedOptions = {
|
|
163
|
+
...spec.options,
|
|
164
|
+
setup: (context) => {
|
|
165
|
+
const originalActions = originalSetup(context);
|
|
166
|
+
const devtoolsActions = {
|
|
167
|
+
__revertState: (newState) => {
|
|
168
|
+
context.update(() => newState);
|
|
169
|
+
},
|
|
170
|
+
__takeSnapshot: () => {
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
return {
|
|
174
|
+
...originalActions,
|
|
175
|
+
...devtoolsActions
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
const modifiedSpec = function(resolver) {
|
|
180
|
+
return createStoreInstance(modifiedSpec, resolver, {});
|
|
181
|
+
};
|
|
182
|
+
Object.defineProperties(modifiedSpec, {
|
|
183
|
+
[STORION_TYPE]: { value: "store.spec", enumerable: false },
|
|
184
|
+
name: { value: spec.name, enumerable: true, writable: false },
|
|
185
|
+
options: { value: modifiedOptions, enumerable: true, writable: false }
|
|
186
|
+
});
|
|
187
|
+
const instance = next(modifiedSpec);
|
|
188
|
+
registerStore({
|
|
189
|
+
id: instance.id,
|
|
190
|
+
name: spec.name,
|
|
191
|
+
state: { ...instance.state },
|
|
192
|
+
disposed: false,
|
|
193
|
+
instance,
|
|
194
|
+
createdAt: Date.now(),
|
|
195
|
+
meta: spec.options.meta
|
|
196
|
+
});
|
|
197
|
+
let lastAction = null;
|
|
198
|
+
const unsubscribeActions = instance.subscribe("@*", (event) => {
|
|
199
|
+
const { next: next2 } = event;
|
|
200
|
+
if (typeof next2.name === "string" && next2.name.startsWith("__")) return;
|
|
201
|
+
lastAction = { name: next2.name, args: next2.args };
|
|
202
|
+
});
|
|
203
|
+
const unsubscribeState = instance.subscribe(() => {
|
|
204
|
+
recordStateChange(
|
|
205
|
+
instance.id,
|
|
206
|
+
{ ...instance.state },
|
|
207
|
+
lastAction == null ? void 0 : lastAction.name,
|
|
208
|
+
lastAction == null ? void 0 : lastAction.args
|
|
209
|
+
);
|
|
210
|
+
lastAction = null;
|
|
211
|
+
});
|
|
212
|
+
instance.onDispose(() => {
|
|
213
|
+
unsubscribeActions();
|
|
214
|
+
unsubscribeState();
|
|
215
|
+
unregisterStore(instance.id);
|
|
216
|
+
});
|
|
217
|
+
return instance;
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
function getDevtoolsController() {
|
|
221
|
+
if (typeof window !== "undefined") {
|
|
222
|
+
return window.__STORION_DEVTOOLS__;
|
|
223
|
+
}
|
|
224
|
+
return void 0;
|
|
225
|
+
}
|
|
226
|
+
export {
|
|
227
|
+
devtoolsMiddleware,
|
|
228
|
+
getDevtoolsController
|
|
229
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { StoreMiddleware } from '../types';
|
|
2
|
+
import { DevtoolsController, DevtoolsMiddlewareOptions } from './types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Create the devtools middleware.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* import { container } from "storion";
|
|
10
|
+
* import { devtoolsMiddleware } from "storion/devtools";
|
|
11
|
+
*
|
|
12
|
+
* const app = container({
|
|
13
|
+
* middleware: [devtoolsMiddleware()],
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function devtoolsMiddleware(options?: DevtoolsMiddlewareOptions): StoreMiddleware;
|
|
18
|
+
/**
|
|
19
|
+
* Get the devtools controller from window.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getDevtoolsController(): DevtoolsController | undefined;
|
|
22
|
+
//# sourceMappingURL=middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/devtools/middleware.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,eAAe,EAKhB,MAAM,UAAU,CAAC;AAIlB,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EAE1B,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,yBAA8B,GACtC,eAAe,CA+HjB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,GAAG,SAAS,CAKtE"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { StoreInstance } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Types of events tracked by devtools.
|
|
5
|
+
*/
|
|
6
|
+
export type DevtoolsEventType = "change" | "create" | "dispose" | "dispatch" | "error";
|
|
7
|
+
/**
|
|
8
|
+
* A devtools event entry.
|
|
9
|
+
*/
|
|
10
|
+
export interface DevtoolsEvent {
|
|
11
|
+
/** Unique event ID */
|
|
12
|
+
id: number;
|
|
13
|
+
/** Timestamp when event occurred */
|
|
14
|
+
timestamp: number;
|
|
15
|
+
/** Event type */
|
|
16
|
+
type: DevtoolsEventType;
|
|
17
|
+
/** Target - "window" or store ID */
|
|
18
|
+
target: string;
|
|
19
|
+
/** Extra info (action name, error message, changed keys, etc.) */
|
|
20
|
+
extra?: string;
|
|
21
|
+
/** Full data for copy (error stack, state diff, etc.) */
|
|
22
|
+
data?: unknown;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A snapshot of store state at a point in time.
|
|
26
|
+
*/
|
|
27
|
+
export interface StateSnapshot {
|
|
28
|
+
/** Unique snapshot ID */
|
|
29
|
+
id: number;
|
|
30
|
+
/** Timestamp when snapshot was taken */
|
|
31
|
+
timestamp: number;
|
|
32
|
+
/** The state at this point */
|
|
33
|
+
state: Record<string, unknown>;
|
|
34
|
+
/** Action that triggered this change (if any) */
|
|
35
|
+
action?: string;
|
|
36
|
+
/** Arguments passed to the action */
|
|
37
|
+
actionArgs?: unknown[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Store entry in devtools.
|
|
41
|
+
*/
|
|
42
|
+
export interface DevtoolsStoreEntry {
|
|
43
|
+
/** Store ID */
|
|
44
|
+
id: string;
|
|
45
|
+
/** Store spec name */
|
|
46
|
+
name: string;
|
|
47
|
+
/** Current state */
|
|
48
|
+
state: Record<string, unknown>;
|
|
49
|
+
/** State history (last N snapshots) */
|
|
50
|
+
history: StateSnapshot[];
|
|
51
|
+
/** Whether the store is disposed */
|
|
52
|
+
disposed: boolean;
|
|
53
|
+
/** Store instance reference */
|
|
54
|
+
instance: StoreInstance<any, any>;
|
|
55
|
+
/** Timestamp when store was created */
|
|
56
|
+
createdAt: number;
|
|
57
|
+
/** Store meta from spec options */
|
|
58
|
+
meta?: Record<string, unknown>;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Devtools controller exposed to window.
|
|
62
|
+
*/
|
|
63
|
+
export interface DevtoolsController {
|
|
64
|
+
/** Version of the devtools */
|
|
65
|
+
version: string;
|
|
66
|
+
/** Get all tracked stores */
|
|
67
|
+
getStores(): DevtoolsStoreEntry[];
|
|
68
|
+
/** Get a specific store by ID */
|
|
69
|
+
getStore(id: string): DevtoolsStoreEntry | undefined;
|
|
70
|
+
/** Revert a store to a specific snapshot */
|
|
71
|
+
revertToSnapshot(storeId: string, snapshotId: number): boolean;
|
|
72
|
+
/** Take a manual snapshot of a store */
|
|
73
|
+
takeSnapshot(storeId: string): StateSnapshot | undefined;
|
|
74
|
+
/** Clear history for a store */
|
|
75
|
+
clearHistory(storeId: string): void;
|
|
76
|
+
/** Clear all stores and history */
|
|
77
|
+
clear(): void;
|
|
78
|
+
/** Subscribe to store changes */
|
|
79
|
+
subscribe(listener: () => void): () => void;
|
|
80
|
+
/** Max history entries per store */
|
|
81
|
+
maxHistory: number;
|
|
82
|
+
/** Get all tracked events */
|
|
83
|
+
getEvents(): DevtoolsEvent[];
|
|
84
|
+
/** Clear all events */
|
|
85
|
+
clearEvents(): void;
|
|
86
|
+
/** Record an event */
|
|
87
|
+
recordEvent(type: DevtoolsEventType, target: string, extra?: string, data?: unknown): void;
|
|
88
|
+
/** Max events to keep */
|
|
89
|
+
maxEvents: number;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Devtools middleware options.
|
|
93
|
+
*/
|
|
94
|
+
export interface DevtoolsMiddlewareOptions {
|
|
95
|
+
/** Name for the devtools instance (default: "storion") */
|
|
96
|
+
name?: string;
|
|
97
|
+
/** Maximum history entries per store (default: 5) */
|
|
98
|
+
maxHistory?: number;
|
|
99
|
+
/** Custom window object (for testing) */
|
|
100
|
+
windowObject?: typeof globalThis;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Internal actions injected by devtools middleware.
|
|
104
|
+
*/
|
|
105
|
+
export interface DevtoolsActions {
|
|
106
|
+
/** Revert state to a previous snapshot */
|
|
107
|
+
__revertState: (newState: Record<string, unknown>) => void;
|
|
108
|
+
/** Take a snapshot of current state */
|
|
109
|
+
__takeSnapshot: () => void;
|
|
110
|
+
}
|
|
111
|
+
declare global {
|
|
112
|
+
interface Window {
|
|
113
|
+
__STORION_DEVTOOLS__?: DevtoolsController;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/devtools/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DevtoolsController } from '../devtools/types';
|
|
2
|
+
import { clearDevtoolsSettings } from './hooks';
|
|
3
|
+
|
|
4
|
+
export { clearDevtoolsSettings };
|
|
5
|
+
export type PanelPosition = "left" | "bottom" | "right";
|
|
6
|
+
export interface DevtoolsPanelProps {
|
|
7
|
+
controller: DevtoolsController;
|
|
8
|
+
position?: PanelPosition;
|
|
9
|
+
onPositionChange?: (position: PanelPosition) => void;
|
|
10
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
11
|
+
onTransparencyChange?: (transparent: boolean) => void;
|
|
12
|
+
onResize?: (size: number) => void;
|
|
13
|
+
initialSize?: number;
|
|
14
|
+
initialCollapsed?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function DevtoolsPanel({ controller, position: initialPosition, onPositionChange, onCollapsedChange, onTransparencyChange, onResize, initialSize, initialCollapsed, }: DevtoolsPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=DevtoolsPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevtoolsPanel.d.ts","sourceRoot":"","sources":["../../src/devtools-panel/DevtoolsPanel.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,kBAAkB,EAInB,MAAM,mBAAmB,CAAC;AAgB3B,OAAO,EAAsB,qBAAqB,EAAc,MAAM,SAAS,CAAC;AAEhF,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAMjC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAExD,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,kBAAkB,CAAC;IAC/B,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IACrD,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,oBAAoB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IACtD,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,QAAQ,EAAE,eAAwB,EAClC,gBAAgB,EAChB,iBAAiB,EACjB,oBAAoB,EACpB,QAAQ,EACR,WAAiB,EACjB,gBAAwB,GACzB,EAAE,kBAAkB,2CA0RpB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StateSnapshot } from '../../devtools/types';
|
|
2
|
+
|
|
3
|
+
export interface CompareModalProps {
|
|
4
|
+
storeId: string;
|
|
5
|
+
snapshot: StateSnapshot;
|
|
6
|
+
currentState: Record<string, unknown>;
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function CompareModal({ storeId, snapshot, currentState, onClose, }: CompareModalProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=CompareModal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompareModal.d.ts","sourceRoot":"","sources":["../../../src/devtools-panel/components/CompareModal.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAI1D,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,aAAa,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,EAC3B,OAAO,EACP,QAAQ,EACR,YAAY,EACZ,OAAO,GACR,EAAE,iBAAiB,2CAmHnB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DevtoolsEvent, DevtoolsEventType } from '../../devtools/types';
|
|
2
|
+
|
|
3
|
+
export declare const EVENT_TYPE_LABELS: Record<DevtoolsEventType, {
|
|
4
|
+
label: string;
|
|
5
|
+
color: string;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const ALL_EVENT_TYPES: DevtoolsEventType[];
|
|
8
|
+
export interface EventEntryProps {
|
|
9
|
+
event: DevtoolsEvent;
|
|
10
|
+
onTargetClick?: (storeId: string) => void;
|
|
11
|
+
onReplay?: (event: DevtoolsEvent) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const EventEntry: import('react').NamedExoticComponent<EventEntryProps>;
|
|
14
|
+
//# sourceMappingURL=EventEntry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventEntry.d.ts","sourceRoot":"","sources":["../../../src/devtools-panel/components/EventEntry.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAK7E,eAAO,MAAM,iBAAiB,EAAE,MAAM,CACpC,iBAAiB,EACjB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAOjC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,iBAAiB,EAM9C,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,aAAa,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;CAC3C;AAED,eAAO,MAAM,UAAU,uDA0ErB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DevtoolsEventType } from '../../devtools/types';
|
|
2
|
+
|
|
3
|
+
export interface EventFilterBarProps {
|
|
4
|
+
/** null means "All" is selected (no filtering) */
|
|
5
|
+
activeFilters: Set<DevtoolsEventType> | null;
|
|
6
|
+
onFilterChange: (filters: Set<DevtoolsEventType> | null) => void;
|
|
7
|
+
onClear: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function EventFilterBar({ activeFilters, onFilterChange, onClear, }: EventFilterBarProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=EventFilterBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventFilterBar.d.ts","sourceRoot":"","sources":["../../../src/devtools-panel/components/EventFilterBar.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAI9D,MAAM,WAAW,mBAAmB;IAClC,kDAAkD;IAClD,aAAa,EAAE,GAAG,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;IAC7C,cAAc,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,iBAAiB,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACjE,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,cAAc,CAAC,EAC7B,aAAa,EACb,cAAc,EACd,OAAO,GACR,EAAE,mBAAmB,2CAuErB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DevtoolsController, DevtoolsEvent, DevtoolsEventType } from '../../devtools/types';
|
|
2
|
+
|
|
3
|
+
export interface EventsTabProps {
|
|
4
|
+
controller: DevtoolsController;
|
|
5
|
+
events: DevtoolsEvent[];
|
|
6
|
+
/** Controlled search query from parent */
|
|
7
|
+
searchQuery: string;
|
|
8
|
+
onSearchQueryChange: (query: string) => void;
|
|
9
|
+
/** Controlled filters from parent */
|
|
10
|
+
filters: Set<DevtoolsEventType> | null;
|
|
11
|
+
onFiltersChange: (filters: Set<DevtoolsEventType> | null) => void;
|
|
12
|
+
onNavigateToStore: (storeId: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function EventsTab({ controller, events, searchQuery, onSearchQueryChange, filters, onFiltersChange, onNavigateToStore, }: EventsTabProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
//# sourceMappingURL=EventsTab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventsTab.d.ts","sourceRoot":"","sources":["../../../src/devtools-panel/components/EventsTab.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACb,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAK9B,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,kBAAkB,CAAC;IAC/B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,0CAA0C;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,qCAAqC;IACrC,OAAO,EAAE,GAAG,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;IACvC,eAAe,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,iBAAiB,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IAClE,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9C;AAED,wBAAgB,SAAS,CAAC,EACxB,UAAU,EACV,MAAM,EACN,WAAW,EACX,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,iBAAiB,GAClB,EAAE,cAAc,2CAyGhB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PanelPosition } from '../DevtoolsPanel';
|
|
2
|
+
|
|
3
|
+
export interface ResizeHandleProps {
|
|
4
|
+
position: PanelPosition;
|
|
5
|
+
onResize: (delta: number) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function ResizeHandle({ position, onResize }: ResizeHandleProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
//# sourceMappingURL=ResizeHandle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResizeHandle.d.ts","sourceRoot":"","sources":["../../../src/devtools-panel/components/ResizeHandle.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAyGrE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DevtoolsStoreEntry, StateSnapshot } from '../../devtools/types';
|
|
2
|
+
|
|
3
|
+
export interface StoreEntryProps {
|
|
4
|
+
entry: DevtoolsStoreEntry;
|
|
5
|
+
onRevert: (snapshotId: number) => void;
|
|
6
|
+
onShowEvents?: (storeId: string) => void;
|
|
7
|
+
onCompare?: (storeId: string, snapshot: StateSnapshot) => void;
|
|
8
|
+
onStateEdit?: (storeId: string, newState: Record<string, unknown>) => void;
|
|
9
|
+
flash?: boolean;
|
|
10
|
+
forceExpanded?: boolean | null;
|
|
11
|
+
}
|
|
12
|
+
export declare const StoreEntry: import('react').NamedExoticComponent<StoreEntryProps>;
|
|
13
|
+
//# sourceMappingURL=StoreEntry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoreEntry.d.ts","sourceRoot":"","sources":["../../../src/devtools-panel/components/StoreEntry.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAgB9E,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,kBAAkB,CAAC;IAC1B,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;IAC/D,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAC3E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAChC;AAED,eAAO,MAAM,UAAU,uDAgTrB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DevtoolsController, DevtoolsStoreEntry } from '../../devtools/types';
|
|
2
|
+
|
|
3
|
+
export interface StoresTabProps {
|
|
4
|
+
controller: DevtoolsController;
|
|
5
|
+
stores: DevtoolsStoreEntry[];
|
|
6
|
+
/** Controlled search query from parent */
|
|
7
|
+
searchQuery: string;
|
|
8
|
+
onSearchQueryChange: (query: string) => void;
|
|
9
|
+
onNavigateToEvents: (storeId: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function StoresTab({ controller, stores, searchQuery, onSearchQueryChange, onNavigateToEvents, }: StoresTabProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=StoresTab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StoresTab.d.ts","sourceRoot":"","sources":["../../../src/devtools-panel/components/StoresTab.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAEnB,MAAM,sBAAsB,CAAC;AAO9B,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,kBAAkB,CAAC;IAC/B,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,0CAA0C;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C;AAED,wBAAgB,SAAS,CAAC,EACxB,UAAU,EACV,MAAM,EACN,WAAW,EACX,mBAAmB,EACnB,kBAAkB,GACnB,EAAE,cAAc,2CA0MhB"}
|