@infinite-canvas-tutorial/webcomponents
Version:
WebComponents UI implementation
29 lines • 1.02 kB
JavaScript
import { createContext } from '@lit/context';
import { Pen, ThemeMode, } from '@infinite-canvas-tutorial/ecs';
export var Task;
(function (Task) {
Task["SHOW_LAYERS_PANEL"] = "show-layers-panel";
Task["SHOW_PROPERTIES_PANEL"] = "show-properties-panel";
})(Task || (Task = {}));
export const appStateContext = createContext(Symbol('appAtate'));
export const nodesContext = createContext(Symbol('nodes'));
export const apiContext = createContext(Symbol('api'));
export const getDefaultAppState = () => {
return {
// TODO: Flatten theme
theme: {
mode: ThemeMode.LIGHT,
colors: {
[ThemeMode.LIGHT]: {},
[ThemeMode.DARK]: {},
},
},
cameraZoom: 1,
penbarAll: [Pen.HAND, Pen.SELECT, Pen.DRAW_RECT],
penbarSelected: [Pen.HAND],
taskbarAll: [Task.SHOW_LAYERS_PANEL, Task.SHOW_PROPERTIES_PANEL],
taskbarSelected: [],
layersSelected: [],
};
};
//# sourceMappingURL=context.js.map