Add pending apps and frontend components
- apps/captain-mobile: Mobile API service - apps/flow-ui: Flow UI application - apps/mindlink: Mindlink application - apps/storage: Storage API and workers - apps/tzzr-cli: TZZR CLI tool - deck-frontend/backups: Historical TypeScript versions - hst-frontend: Standalone HST frontend Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
35
deck-frontend/backups/20260113_211524/src/state/index.ts
Normal file
35
deck-frontend/backups/20260113_211524/src/state/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import { createStore } from './store.ts';
|
||||
import type { AppState, EdgeType } from '@/types/index.ts';
|
||||
import { EDGE_COLORS } from '@/config/index.ts';
|
||||
|
||||
const initialState: AppState = {
|
||||
base: 'hst',
|
||||
lang: 'es',
|
||||
view: 'grid',
|
||||
search: '',
|
||||
group: 'all',
|
||||
library: 'all',
|
||||
libraryMembers: new Set(),
|
||||
selectionMode: false,
|
||||
selected: new Set(),
|
||||
selectedTag: null,
|
||||
tags: [],
|
||||
hstTags: [],
|
||||
groups: [],
|
||||
libraries: [],
|
||||
graphEdges: [],
|
||||
treeEdges: [],
|
||||
graphFilters: {
|
||||
cats: new Set(['hst'] as const),
|
||||
edges: new Set(Object.keys(EDGE_COLORS) as EdgeType[])
|
||||
},
|
||||
graphSettings: {
|
||||
nodeSize: 20,
|
||||
linkDist: 80,
|
||||
showImg: true,
|
||||
showLbl: true
|
||||
}
|
||||
};
|
||||
|
||||
export const store = createStore(initialState);
|
||||
export { createStore } from './store.ts';
|
||||
27
deck-frontend/backups/20260113_211524/src/state/store.ts
Normal file
27
deck-frontend/backups/20260113_211524/src/state/store.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
type Listener<T> = (state: T, prevState: T) => void;
|
||||
|
||||
export interface Store<T extends object> {
|
||||
getState: () => Readonly<T>;
|
||||
setState: (partial: Partial<T>) => void;
|
||||
subscribe: (listener: Listener<T>) => () => void;
|
||||
}
|
||||
|
||||
export function createStore<T extends object>(initialState: T): Store<T> {
|
||||
let state = { ...initialState };
|
||||
const listeners = new Set<Listener<T>>();
|
||||
|
||||
return {
|
||||
getState: (): Readonly<T> => state,
|
||||
|
||||
setState: (partial: Partial<T>): void => {
|
||||
const prevState = state;
|
||||
state = { ...state, ...partial };
|
||||
listeners.forEach(fn => fn(state, prevState));
|
||||
},
|
||||
|
||||
subscribe: (listener: Listener<T>): (() => void) => {
|
||||
listeners.add(listener);
|
||||
return () => listeners.delete(listener);
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user