PluginProbe
Extendify / 3.1.4
Extendify v3.1.4
3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 0.7.0 All 126 releases
extendify / src / Agent / state / position.js

position.js in Extendify 3.1.4, at src/Agent/state/position.js

33 lines 721 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { create } from 'zustand';
2 import { devtools, persist } from 'zustand/middleware';
3
4 const DEFAULT_HEIGHT = 600;
5
6 const startingPosition = {
7 x: window.innerWidth - 410 - 20,
8 y: window.innerHeight - DEFAULT_HEIGHT,
9 width: 410,
10 height: DEFAULT_HEIGHT,
11 };
12
13 export const usePositionStore = create()(
14 persist(
15 devtools(
16 (set) => ({
17 ...startingPosition,
18 setSize: (width, height) => set({ width, height }),
19 setPosition: (x, y) => set({ x, y }),
20 resetPosition: () =>
21 set({
22 ...startingPosition,
23 y: window.innerHeight - DEFAULT_HEIGHT,
24 }),
25 }),
26 { name: 'Extendify Agent Position' },
27 ),
28 {
29 name: `extendify-agent-position-${window.extSharedData.siteId}`,
30 },
31 ),
32 );
33