@gustavolmo/react-window-manager 0.3.0 → 0.3.1
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/dist/index.js
CHANGED
|
@@ -120,9 +120,9 @@ var wsApi = {
|
|
|
120
120
|
return wsWindow;
|
|
121
121
|
},
|
|
122
122
|
isBelowBreakPoint: () => {
|
|
123
|
-
const
|
|
123
|
+
const wsRect = wsApi.getRect();
|
|
124
124
|
const breakPoint = useWorkspaceState.getState().responsiveBreak;
|
|
125
|
-
return
|
|
125
|
+
return wsRect.innerWidth < responsiveBreakInPx(breakPoint);
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
var responsiveBreakInPx = (breakPoint) => {
|
|
@@ -580,6 +580,7 @@ function WindowLayout({
|
|
|
580
580
|
defaultDock = "default",
|
|
581
581
|
style
|
|
582
582
|
}) {
|
|
583
|
+
const { ref: wsRef } = useWorkspaceState();
|
|
583
584
|
const windowRef = useRef(null);
|
|
584
585
|
const {
|
|
585
586
|
windowId,
|
|
@@ -600,7 +601,7 @@ function WindowLayout({
|
|
|
600
601
|
return;
|
|
601
602
|
}
|
|
602
603
|
dockingRoutes[defaultDock](winId);
|
|
603
|
-
}, [setSelf, windowRef, resetFlag]);
|
|
604
|
+
}, [setSelf, windowRef, resetFlag, wsRef]);
|
|
604
605
|
const dockingRoutes = {
|
|
605
606
|
right: dockApi.dockWindowRight,
|
|
606
607
|
left: dockApi.dockWindowLeft,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/window-manager/registration/window-store-factory.tsx","../src/window-manager/internal/features/window-layout.tsx","../src/window-manager/internal/assets/svg-win-icons.tsx","../src/window-manager/internal/features/cursor/cursor-state.ts","../src/window-manager/internal/features/resizing/resizing-controls.tsx","../src/window-manager/internal/features/workspace/workspace-state.ts","../src/window-manager/internal/features/workspace/workspace-api.ts","../src/window-manager/internal/features/resizing/resizing-api.ts","../src/window-manager/internal/features/stack/stack-api.ts","../src/window-manager/internal/features/grid/grid-api.ts","../src/window-manager/internal/features/drag/drag-handle.tsx","../src/window-manager/internal/features/window-button.tsx","../src/window-manager/internal/features/docking/docking-api.ts","../src/window-manager/rwm.ts","../src/window-manager/workspace-layout.tsx","../src/window-manager/internal/features/docking/docking-controls.tsx","../src/window-manager/internal/features/cursor/cursor-move-listener.tsx","../src/window-manager/internal/features/view-port/view-port-resize-listener.tsx"],"sourcesContent":["import { create, StoreApi, UseBoundStore } from 'zustand'\r\nimport { RefObject } from 'react'\r\nimport {\r\n Coord,\r\n ResizeState,\r\n WindowRegistration,\r\n WindowStates,\r\n WindowStore,\r\n} from '../model/window-types'\r\nimport WindowLayout, { WindowLayoutProps } from '../internal/features/window-layout'\r\nimport WindowButton, { WindowButtonProps } from '../internal/features/window-button'\r\nimport { useWorkspaceState } from '../internal/features/workspace/workspace-state'\r\n\r\nconst windownMinWidth = 232\r\nconst windownMinHeight = 128\r\n\r\n/** @howToUse use the syntax `windowRegistry[<winId>]()` to access a store */\r\nexport const windowRegistry: Record<string, UseBoundStore<StoreApi<WindowStore>>> = {}\r\n\r\n/**\r\n * @return `id` auto generated id at the root of the window component.`id` can be used in `windowRegistry` to access the state store associated to this window instnace\r\n * @return\r\n * `store` zustand state store associated to this window instnace\r\n * @return\r\n * `window` JSX component representing an interactive window\r\n * @return\r\n * `button` JSX component that control this window */\r\nexport const createWindowStore = (): WindowRegistration => {\r\n const zIndexAtLaunch = Object.keys(windowRegistry).length + 1\r\n const windowInstanceId = `react-dynamic-window-instance${Object.keys(windowRegistry).length}`\r\n\r\n const storeInstance = create<WindowStore>((set, get) => ({\r\n windowId: windowInstanceId,\r\n\r\n self: undefined,\r\n setSelf: (ref: RefObject<HTMLDivElement | null>) => set({ self: ref }),\r\n\r\n WIN_MIN_WIDTH: windownMinWidth,\r\n setWIN_MIN_WIDTH: (w: number) => set({ WIN_MIN_WIDTH: w }),\r\n\r\n WIN_MIN_HEIGHT: windownMinHeight,\r\n setWIN_MIN_HEIGHT: (h: number) => set({ WIN_MIN_HEIGHT: h }),\r\n\r\n isActive: false,\r\n setIsActive: (isActive: boolean) => {\r\n useWorkspaceState.getState().setActiveWindowId(get().windowId)\r\n set({ isActive: isActive })\r\n },\r\n\r\n resetFlag: false,\r\n reset: () => set({ resetFlag: !get().resetFlag, isWindowClosed: true }),\r\n\r\n zIndex: zIndexAtLaunch,\r\n setZIndex: (newIndex: number) => set({ zIndex: newIndex }),\r\n\r\n winVisualState: 'demaximized',\r\n setWinVisualState: (newState: WindowStates) => set({ winVisualState: newState }),\r\n\r\n isWindowClosed: true,\r\n setisWindowClosed: (isClosed: boolean) => set({ isWindowClosed: isClosed }),\r\n\r\n winCoord: { pointX: 40, pointY: 40 },\r\n setWinCoord: (newWinCoord: Coord) =>\r\n set({ winCoord: { pointX: newWinCoord.pointX, pointY: newWinCoord.pointY } }),\r\n\r\n winWidth: windownMinWidth,\r\n setWinWidth: (newWinWidth: number) => set({ winWidth: newWinWidth }),\r\n\r\n winHeight: windownMinHeight,\r\n setWinHeight: (newWinHeight: number) => set({ winHeight: newWinHeight }),\r\n\r\n resizeAction: false,\r\n setResizeAction: (updatedIsResizing: ResizeState) => set({ resizeAction: updatedIsResizing }),\r\n\r\n isDragging: false,\r\n setIsDragging: (updatedIsDragging: boolean) => set({ isDragging: updatedIsDragging }),\r\n }))\r\n\r\n windowRegistry[windowInstanceId] = storeInstance\r\n\r\n return {\r\n id: storeInstance.getState().windowId,\r\n\r\n store: storeInstance,\r\n\r\n Window: (props: Omit<WindowLayoutProps, 'winId'>) => (\r\n <WindowLayout {...props} winId={windowInstanceId} />\r\n ),\r\n\r\n Button: (props: Omit<WindowButtonProps, 'winId'>) => (\r\n <WindowButton {...props} winId={windowInstanceId} />\r\n ),\r\n }\r\n}\r\n","import { useEffect, useRef } from 'react'\r\nimport { IconWinMinimize, IconWinDemaximize, IconWinMaximize } from '../assets/svg-win-icons'\r\nimport ResizingControls from './resizing/resizing-controls'\r\nimport { windowRegistry } from '../../registration/window-store-factory'\r\nimport { stackApi } from './stack/stack-api'\r\nimport { dockApi } from './docking/docking-api'\r\nimport { wsApi } from './workspace/workspace-api'\r\nimport DragHandle from './drag/drag-handle'\r\n\r\ntype DockPosition =\r\n | 'right'\r\n | 'left'\r\n | 'full'\r\n | 'top'\r\n | 'bottom'\r\n | 'top-right'\r\n | 'top-left'\r\n | 'bottom-right'\r\n | 'bottom-left'\r\n | 'default'\r\n\r\nexport type WindowLayoutProps = {\r\n children: React.ReactNode\r\n windowName: string | React.ReactNode\r\n winId: string\r\n navbarChildren?: React.ReactNode\r\n defaultDock?: DockPosition\r\n\r\n /** @note use CSS values such as hex or supported color names */\r\n style?: {\r\n navBackgroundColor?: string\r\n windowBackgroundColor?: string\r\n navControlsColor?: string\r\n }\r\n}\r\n\r\nexport default function WindowLayout({\r\n children,\r\n windowName,\r\n navbarChildren,\r\n winId,\r\n defaultDock = 'default',\r\n style,\r\n}: WindowLayoutProps) {\r\n const windowRef = useRef<HTMLDivElement>(null)\r\n const {\r\n windowId,\r\n zIndex,\r\n isActive,\r\n setSelf,\r\n\r\n resetFlag,\r\n\r\n winVisualState,\r\n\r\n isWindowClosed,\r\n\r\n winCoord,\r\n\r\n winWidth,\r\n winHeight,\r\n } = windowRegistry[winId]()\r\n\r\n useEffect(() => {\r\n setSelf(windowRef)\r\n\r\n if (wsApi.isBelowBreakPoint()) {\r\n dockApi.maximizeWindow(winId)\r\n return\r\n }\r\n\r\n dockingRoutes[defaultDock](winId)\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [setSelf, windowRef, resetFlag])\r\n\r\n const dockingRoutes: Record<DockPosition, (winId: string) => void> = {\r\n right: dockApi.dockWindowRight,\r\n left: dockApi.dockWindowLeft,\r\n full: dockApi.maximizeWindow,\r\n top: dockApi.dockWindowTop,\r\n bottom: dockApi.dockWindowBottom,\r\n 'top-right': dockApi.dockWindowTopRight,\r\n 'top-left': dockApi.dockWindowTopLeft,\r\n 'bottom-right': dockApi.dockWindowBottomRight,\r\n 'bottom-left': dockApi.dockWindowBottomLeft,\r\n default: dockApi.demaximizeWindow,\r\n }\r\n\r\n const maximizeControl =\r\n winVisualState === 'maximized' ? (\r\n <button\r\n className={`block hover:bg-gray-500 hover:bg-opacity-10 px-5 h-full`}\r\n onClick={() => dockApi.demaximizeWindow(winId)}\r\n >\r\n <IconWinDemaximize color={style?.navControlsColor} />\r\n </button>\r\n ) : (\r\n <button\r\n className={`block hover:bg-gray-500 hover:bg-opacity-10 px-5 h-full`}\r\n onClick={() => dockApi.maximizeWindow(winId)}\r\n >\r\n <IconWinMaximize color={style?.navControlsColor} />\r\n </button>\r\n )\r\n\r\n const closeControl = (\r\n <button\r\n className=\"hover:bg-red-500 hover:bg-opacity-20 px-5 h-full\"\r\n onClick={() => dockApi.closeWindow(winId)}\r\n >\r\n <IconWinMinimize color={style?.navControlsColor} />\r\n </button>\r\n )\r\n\r\n return (\r\n <>\r\n <div\r\n id={windowId}\r\n ref={windowRef}\r\n className={`fixed bg-white shadow-lg border border-zinc-600 rounded-sm overflow-hidden`}\r\n onMouseDown={() => stackApi.bringTargetWindowToFront(windowId)}\r\n style={{\r\n backgroundColor: style?.windowBackgroundColor,\r\n top: `${winCoord.pointY}px`,\r\n left: `${winCoord.pointX}px`,\r\n width: `${winWidth}px`,\r\n height: `${winHeight}px`,\r\n zIndex: `${zIndex}`,\r\n\r\n /* MINIMIZE LOGIC */\r\n transition: 'transform 0.2s ease-in-out, opacity 0.3s ease-in-out',\r\n opacity: isWindowClosed ? 0 : 1,\r\n transform: isWindowClosed\r\n ? `translate(${wsApi.getRect().innerWidth / 2 - winCoord.pointX - winWidth / 2}px,\r\n ${wsApi.getRect().innerHeight - winCoord.pointY - winHeight / 2}px) scale(0.02)`\r\n : '',\r\n }}\r\n >\r\n <nav\r\n style={{\r\n backgroundColor: style?.navBackgroundColor,\r\n }}\r\n className={`\r\n h-[32px] w-full flex items-center bg-neutral-800\r\n ${isActive ? 'brightness-100 opacity-100' : 'brightness-75 opacity-80'}`}\r\n >\r\n <div className=\"w-fit shrink-0 h-8 px-2 text-white flex items-center text-sm truncate\">\r\n {windowName}\r\n </div>\r\n\r\n <div className=\"h-8 px-2 text-white flex items-center text-sm truncate\">\r\n {navbarChildren}\r\n </div>\r\n\r\n <DragHandle winId={winId} />\r\n\r\n {!wsApi.isBelowBreakPoint() && maximizeControl}\r\n {closeControl}\r\n </nav>\r\n\r\n {!wsApi.isBelowBreakPoint() && <ResizingControls winId={winId} />}\r\n\r\n {/* Offset the navbar => 'h-[calc(100%-32px)]' */}\r\n <div className={`relative w-full h-[calc(100%-32px)] overflow-auto`}>{children}</div>\r\n </div>{' '}\r\n </>\r\n )\r\n}\r\n","type Props = {\r\n color?: string\r\n}\r\n\r\nexport function IconWinMaximize({color}: Props) {\r\n return (\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n width={24}\r\n height={24}\r\n strokeWidth={1.5}\r\n stroke={color ? color : '#cccccc'}\r\n color={color ? color : '#cccccc'}\r\n className=\"size-6\"\r\n >\r\n <path\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n d=\"M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z\"\r\n />\r\n </svg>\r\n )\r\n}\r\n\r\nexport function IconWinDemaximize({color}: Props) {\r\n return (\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n width={24}\r\n height={24}\r\n strokeWidth={1.5}\r\n stroke={color ? color : '#cccccc'}\r\n color={color ? color : '#cccccc'}\r\n className=\"size-6\"\r\n >\r\n <path\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n d=\"M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6\"\r\n />\r\n </svg>\r\n )\r\n}\r\n\r\nexport function IconWinMinimize({color}: Props) {\r\n return (\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n width={24}\r\n height={24}\r\n strokeWidth={1.5}\r\n stroke={color ? color : '#cccccc'}\r\n color={color ? color : '#cccccc'}\r\n className=\"size-6\"\r\n >\r\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\" />\r\n </svg>\r\n )\r\n}\r\n","import { create } from 'zustand'\r\n\r\ntype CursorState = {\r\n x: number\r\n y: number\r\n setX: (x: number) => void\r\n setY: (y: number) => void\r\n}\r\n\r\nexport const useCursorState = create<CursorState>((set) => ({\r\n x: 10,\r\n y: 10,\r\n setX: (newX: number) => set({ x: newX }),\r\n setY: (newY: number) => set({ y: newY }),\r\n}))\r\n","import { ResizeState } from '../../../model/window-types'\r\nimport { useCursorState } from '../cursor/cursor-state'\r\nimport { useEffect } from 'react'\r\nimport { windowRegistry } from '../../../registration/window-store-factory'\r\nimport { resizeApi } from './resizing-api'\r\nimport { gridApi } from '../grid/grid-api'\r\n\r\ntype Props = {\r\n winId: string\r\n}\r\n\r\nexport default function ResizingControls({ winId }: Props) {\r\n const { x, y } = useCursorState()\r\n const { winCoord, winWidth, winHeight, resizeAction } = windowRegistry[winId]()\r\n\r\n useEffect(() => {\r\n resizeApi.dispatchResizeAction(winId)\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [resizeAction, x, y])\r\n\r\n const handleResizeClick = (resizeAction: ResizeState) => {\r\n resizeApi.setResizeAction(winId, resizeAction)\r\n gridApi.orchestrateGridResize(winId)\r\n }\r\n\r\n return (\r\n <>\r\n <span\r\n onMouseUp={() => handleResizeClick(false)}\r\n onMouseDown={() => handleResizeClick('e')}\r\n id=\"win-resize-right-width\"\r\n className=\"fixed w-2 opacity-60 cursor-w-resize z-10\"\r\n style={{\r\n top: `${winCoord.pointY}px`,\r\n left: `${winCoord.pointX + winWidth - 4}px`,\r\n height: `${winHeight}px`,\r\n }}\r\n ></span>\r\n <span\r\n onMouseUp={() => handleResizeClick(false)}\r\n onMouseDown={() => handleResizeClick('w')}\r\n id=\"win-resize-left-width\"\r\n className=\"fixed w-2 opacity-60 cursor-w-resize z-10\"\r\n style={{\r\n top: `${winCoord.pointY}px`,\r\n left: `${winCoord.pointX - 4}px`,\r\n height: `${winHeight}px`,\r\n }}\r\n ></span>\r\n <span\r\n onMouseUp={() => handleResizeClick(false)}\r\n onMouseDown={() => handleResizeClick('s')}\r\n id=\"win-resize-bottom-height\"\r\n className=\"fixed h-2 opacity-60 cursor-s-resize z-10\"\r\n style={{\r\n top: `${winCoord.pointY + winHeight - 6}px`,\r\n left: `${winCoord.pointX}px`,\r\n width: `${winWidth}px`,\r\n }}\r\n ></span>\r\n <span\r\n onMouseUp={() => handleResizeClick(false)}\r\n onMouseDown={() => handleResizeClick('n')}\r\n id=\"win-resize-top-height\"\r\n className=\"fixed h-2 opacity-60 cursor-s-resize z-10\"\r\n style={{\r\n top: `${winCoord.pointY - 6}px`,\r\n left: `${winCoord.pointX}px`,\r\n width: `${winWidth}px`,\r\n }}\r\n ></span>\r\n <span\r\n onMouseUp={() => handleResizeClick(false)}\r\n onMouseDown={() => handleResizeClick('se')}\r\n id=\"win-resize-bottom-right-all\"\r\n className=\"fixed h-3 w-3 opacity-60 cursor-se-resize z-20\"\r\n style={{\r\n top: `${winCoord.pointY + winHeight - 8}px`,\r\n left: `${winCoord.pointX + winWidth - 8}px`,\r\n }}\r\n ></span>\r\n <span\r\n onMouseUp={() => handleResizeClick(false)}\r\n onMouseDown={() => handleResizeClick('sw')}\r\n id=\"win-resize-bottom-left-all\"\r\n className=\"fixed h-3 w-3 opacity-60 cursor-sw-resize z-20\"\r\n style={{\r\n top: `${winCoord.pointY + winHeight - 8}px`,\r\n left: `${winCoord.pointX - 8}px`,\r\n }}\r\n ></span>\r\n\r\n <span\r\n onMouseUp={() => handleResizeClick(false)}\r\n onMouseDown={() => handleResizeClick('ne')}\r\n id=\"win-resize-top-right-all\"\r\n className=\"fixed h-3 w-3 opacity-60 cursor-ne-resize z-20\"\r\n style={{\r\n top: `${winCoord.pointY - 6}px`,\r\n left: `${winCoord.pointX + winWidth - 6}px`,\r\n }}\r\n ></span>\r\n <span\r\n onMouseUp={() => handleResizeClick(false)}\r\n onMouseDown={() => handleResizeClick('nw')}\r\n id=\"win-resize-top-left-all\"\r\n className=\"fixed h-3 w-3 opacity-60 cursor-nw-resize z-20\"\r\n style={{\r\n top: `${winCoord.pointY - 6}px`,\r\n left: `${winCoord.pointX - 6}px`,\r\n }}\r\n ></span>\r\n </>\r\n )\r\n}\r\n","import { create } from 'zustand'\r\nimport { ResponsiveSizes, WorkspaceStore } from '../../../model/workspace-types'\r\n\r\nexport const useWorkspaceState = create<WorkspaceStore>((set) => ({\r\n ref: null,\r\n setRef: (newRef: HTMLElement | null) => set({ ref: newRef }),\r\n\r\n activeWindowId: 'react-dynamic-window-instance0',\r\n setActiveWindowId: (newId: string) => set({ activeWindowId: newId }),\r\n\r\n responsiveBreak: 'sm',\r\n setResponsiveBreak: (breakPoint: ResponsiveSizes) => set({ responsiveBreak: breakPoint }),\r\n}))\r\n","import { ResponsiveSizes, WorkspaceRect } from '../../../model/workspace-types'\r\nimport { useWorkspaceState } from './workspace-state'\r\n\r\nexport const wsApi = {\r\n getRect: (): WorkspaceRect => {\r\n const rect = useWorkspaceState.getState().ref?.getBoundingClientRect()\r\n\r\n const top = rect?.top ?? 0\r\n const left = rect?.left ?? 0\r\n const innerHeight = rect?.height ?? 0\r\n const innerWidth = rect?.width ?? 0\r\n\r\n const bottom = top + innerHeight\r\n const right = left + innerWidth\r\n\r\n const centerX = left + innerWidth / 2\r\n const centerY = top + innerHeight / 2\r\n\r\n const wsWindow = {\r\n top: top,\r\n left: left,\r\n innerHeight: innerHeight,\r\n innerWidth: innerWidth,\r\n bottom: bottom,\r\n right: right,\r\n centerX: centerX,\r\n centerY: centerY,\r\n }\r\n\r\n return wsWindow\r\n },\r\n\r\n isBelowBreakPoint: (): boolean => {\r\n const wSpace = wsApi.getRect()\r\n const breakPoint = useWorkspaceState.getState().responsiveBreak\r\n return wSpace.innerWidth < responsiveBreakInPx(breakPoint)\r\n },\r\n}\r\n\r\nconst responsiveBreakInPx = (breakPoint: ResponsiveSizes): number => {\r\n switch (breakPoint) {\r\n case 'sm':\r\n return 640\r\n case 'md':\r\n return 768\r\n case 'lg':\r\n return 1024\r\n case 'xl':\r\n return 1280\r\n case 'never':\r\n return 0\r\n case 'always':\r\n return Infinity\r\n default:\r\n return breakPoint\r\n }\r\n}\r\n","import { ResizeState, WindowStore } from '../../../model/window-types'\r\nimport { WorkspaceRect } from '../../../model/workspace-types'\r\nimport { windowRegistry } from '../../../registration/window-store-factory'\r\nimport { useCursorState } from '../cursor/cursor-state'\r\nimport { wsApi } from '../workspace/workspace-api'\r\n\r\ntype ResizeContext = {\r\n wsRect: WorkspaceRect\r\n win: WindowStore\r\n winBox: DOMRect | undefined\r\n x: number\r\n y: number\r\n}\r\n\r\nexport const resizeApi = {\r\n stopAllDragAndResize: () => {\r\n for (const key of Object.keys(windowRegistry)) {\r\n windowRegistry[key].getState().isDragging = false\r\n windowRegistry[key].getState().resizeAction = false\r\n }\r\n },\r\n\r\n setResizeAction: (winId: string, action: ResizeState) => {\r\n windowRegistry[winId].setState({ resizeAction: action })\r\n },\r\n\r\n dispatchResizeAction: (winId: string) => {\r\n const ctx = getDependencies(winId)\r\n if (!ctx.win.resizeAction) return\r\n\r\n ctx.win.setWinVisualState('demaximized')\r\n\r\n switch (ctx.win.resizeAction) {\r\n case 's':\r\n privateApi.resizeBottomWinHeight(ctx)\r\n break\r\n\r\n case 'n':\r\n privateApi.resizeTopWinHeight(ctx)\r\n break\r\n\r\n case 'e':\r\n privateApi.resizeRightWinWidth(ctx)\r\n break\r\n\r\n case 'w':\r\n privateApi.resizeLeftWinWidth(ctx)\r\n break\r\n\r\n case 'se':\r\n privateApi.resizeRightBottomWidthAndHeight(ctx)\r\n break\r\n\r\n case 'sw':\r\n privateApi.resizeLeftBottomWidthAndHeight(ctx)\r\n break\r\n\r\n case 'ne':\r\n privateApi.resizeRightTopWidthAndHeight(ctx)\r\n break\r\n\r\n case 'nw':\r\n privateApi.resizeLeftTopWidthAndHeight(ctx)\r\n break\r\n }\r\n },\r\n}\r\n\r\nconst privateApi = {\r\n resizeRightWinWidth: (resizeCtx: ResizeContext) => {\r\n const { wsRect, win, winBox, x, y } = resizeCtx\r\n\r\n if (!winBox) return\r\n\r\n const minWinWidth = x - winBox.left < win.WIN_MIN_WIDTH\r\n if (minWinWidth) return\r\n\r\n const cursorOutOfBounds = x > wsRect.right || x < wsRect.left\r\n if (cursorOutOfBounds) return\r\n\r\n const sizeDiff = x - winBox.right\r\n win.setWinWidth(win.winWidth + sizeDiff)\r\n },\r\n\r\n resizeLeftWinWidth: (resizeCtx: ResizeContext) => {\r\n const { wsRect, win, winBox, x, y } = resizeCtx\r\n if (!winBox) return\r\n\r\n const minWinWidth = winBox.right - x <= win.WIN_MIN_WIDTH\r\n if (minWinWidth) return\r\n\r\n const cursorOutOfBounds = x > wsRect.right || x < wsRect.left\r\n if (cursorOutOfBounds) return\r\n\r\n const sizeDiff = winBox.left - x\r\n win.setWinWidth(win.winWidth + sizeDiff)\r\n win.setWinCoord({ pointX: x, pointY: win.winCoord.pointY })\r\n },\r\n\r\n resizeTopWinHeight: (resizeCtx: ResizeContext) => {\r\n const { wsRect, win, winBox, x, y } = resizeCtx\r\n\r\n if (!winBox) return\r\n\r\n const minWinHeight = winBox.bottom - y <= win.WIN_MIN_HEIGHT\r\n if (minWinHeight) return\r\n\r\n const cursorOutOfBounds = y > wsRect.bottom || y < wsRect.top\r\n if (cursorOutOfBounds) return\r\n\r\n const sizeDiff = winBox.top - y\r\n win.setWinHeight(win.winHeight + sizeDiff)\r\n win.setWinCoord({ pointX: win.winCoord.pointX, pointY: y })\r\n },\r\n\r\n resizeBottomWinHeight: (resizeCtx: ResizeContext) => {\r\n const { wsRect, win, winBox, x, y } = resizeCtx\r\n if (!winBox) return\r\n\r\n const minWinHeight = y - winBox.top < win.WIN_MIN_HEIGHT\r\n if (minWinHeight) return\r\n\r\n const cursorOutOfBounds = y > wsRect.bottom || y < wsRect.top\r\n if (cursorOutOfBounds) return\r\n\r\n const sizeDiff = y - winBox.bottom\r\n win.setWinHeight(win.winHeight + sizeDiff)\r\n },\r\n\r\n resizeRightBottomWidthAndHeight: (resizeCtx: ResizeContext) => {\r\n privateApi.resizeRightWinWidth(resizeCtx)\r\n privateApi.resizeBottomWinHeight(resizeCtx)\r\n },\r\n\r\n resizeLeftBottomWidthAndHeight: (resizeCtx: ResizeContext) => {\r\n privateApi.resizeLeftWinWidth(resizeCtx)\r\n privateApi.resizeBottomWinHeight(resizeCtx)\r\n },\r\n\r\n resizeRightTopWidthAndHeight: (resizeCtx: ResizeContext) => {\r\n privateApi.resizeRightWinWidth(resizeCtx)\r\n privateApi.resizeTopWinHeight(resizeCtx)\r\n },\r\n\r\n /**\r\n * @note this specific case needs it's own logic instead of simply calling\r\n * resizeLeftWinWidth & resizeTopWinHeight. Since both manipulate\r\n * winWidth, winHeight and winCoord, one's logic will override the other\r\n */\r\n resizeLeftTopWidthAndHeight: (resizeCtx: ResizeContext) => {\r\n const { wsRect, win, winBox, x, y } = resizeCtx\r\n if (!winBox) return\r\n\r\n const cursorOutOfBoundsY = y > wsRect.bottom || y < wsRect.top\r\n const cursorOutOfBoundsX = x > wsRect.right || x < wsRect.left\r\n if (cursorOutOfBoundsY || cursorOutOfBoundsX) return\r\n\r\n const minWinHeight = winBox.bottom - y <= win.WIN_MIN_HEIGHT\r\n const minWinWidth = winBox.right - x <= win.WIN_MIN_WIDTH\r\n\r\n win.setWinCoord({\r\n pointX: minWinWidth ? win.winCoord.pointX : x,\r\n pointY: minWinHeight ? win.winCoord.pointY : y,\r\n })\r\n\r\n if (!minWinHeight) {\r\n const sizeDiffY = winBox.top - y\r\n win.setWinHeight(win.winHeight + sizeDiffY)\r\n }\r\n\r\n if (!minWinWidth) {\r\n const sizeDiffX = winBox.left - x\r\n win.setWinWidth(win.winWidth + sizeDiffX)\r\n }\r\n },\r\n}\r\n\r\nconst getDependencies = (winId: string): ResizeContext => {\r\n const wsRect = wsApi.getRect()\r\n const win = windowRegistry[winId].getState()\r\n const winBox = win.self?.current?.getBoundingClientRect()\r\n const { x, y } = useCursorState.getState()\r\n\r\n return { wsRect, win, winBox, x, y }\r\n}\r\n","import { windowRegistry } from '../../../registration/window-store-factory'\r\n\r\nexport const stackApi = {\r\n bringTargetWindowToFront: (targetId: string) => {\r\n const targetWindow = windowRegistry[targetId].getState()\r\n\r\n for (const key of Object.keys(windowRegistry)) {\r\n const window = windowRegistry[key].getState()\r\n\r\n if (window.windowId === targetWindow.windowId) {\r\n continue\r\n }\r\n\r\n window.setIsActive(false)\r\n if (window.zIndex >= targetWindow.zIndex) {\r\n window.setZIndex(window.zIndex - 1)\r\n }\r\n }\r\n\r\n targetWindow.setZIndex(Object.keys(windowRegistry).length)\r\n targetWindow.setIsActive(true)\r\n },\r\n\r\n getOpenedWindowCount: () => {\r\n let openWnidowCount = 0\r\n for (const key of Object.keys(windowRegistry))\r\n if (!windowRegistry[key].getState().isWindowClosed) openWnidowCount++\r\n\r\n return openWnidowCount\r\n },\r\n\r\n resetStack: () => {\r\n for (const key of Object.keys(windowRegistry)) {\r\n windowRegistry[key].getState().reset()\r\n }\r\n },\r\n}\r\n","import { windowRegistry } from '../../../registration/window-store-factory'\r\nimport { stackApi } from '../stack/stack-api'\r\n\r\nexport const gridApi = {\r\n orchestrateGridResize: (winId: string) => orchestrationGridResize(winId),\r\n}\r\n\r\n/**\r\n * @FixMe Most complex feature:\r\n * this function is a nice feature, needs to be written in a clearer way.\r\n * Multi-window tiling can be brittle\r\n * - isRemoteOutside needs refinement\r\n * - needs a stop if the other window stops moving\r\n * - stack should detect alignment\r\n * */\r\nconst orchestrationGridResize = (winId: string) => {\r\n const tolerance = 4\r\n const allowDistantResize = stackApi.getOpenedWindowCount() >= 3\r\n const thisWin = windowRegistry[winId].getState()\r\n const currentResize = thisWin.resizeAction\r\n\r\n for (const key of Object.keys(windowRegistry)) {\r\n const remoteWin = windowRegistry[key].getState()\r\n\r\n if (remoteWin.windowId === thisWin.windowId) {\r\n continue\r\n }\r\n\r\n const thisWinStartY = thisWin.winCoord.pointY\r\n const thisWinEndY = thisWin.winCoord.pointY + thisWin.winHeight\r\n const remoteWinStartY = remoteWin.winCoord.pointY\r\n const remoteWinEndY = remoteWin.winCoord.pointY + remoteWin.winHeight\r\n\r\n const thisWinStartX = thisWin.winCoord.pointX\r\n const thisWinEndX = thisWin.winCoord.pointX + thisWin.winWidth\r\n const remoteWinStartX = remoteWin.winCoord.pointX\r\n const remoteWinEndX = remoteWin.winCoord.pointX + remoteWin.winWidth\r\n\r\n const isRemoteOutside =\r\n remoteWinEndY !== thisWinEndY ||\r\n remoteWinEndX !== thisWinEndX ||\r\n remoteWinStartY !== thisWinStartY ||\r\n remoteWinStartX !== thisWinStartX\r\n /*\r\n * thisWin right edge <::::> remoteWin left edge || remoteWin is stacked */\r\n if (currentResize === 'e') {\r\n const isEdgeAlignedOnXAxis = Math.abs(thisWinEndX - remoteWinStartX) <= tolerance\r\n const isOverlapOnYAxis = thisWinStartY <= remoteWinEndY && thisWinEndY >= remoteWinStartY\r\n\r\n const isEdgeResize = allowDistantResize\r\n ? isEdgeAlignedOnXAxis\r\n : isEdgeAlignedOnXAxis && isOverlapOnYAxis\r\n if (isEdgeResize) {\r\n remoteWin.setResizeAction('w')\r\n }\r\n\r\n const isRemoteOnSameLane =\r\n Math.abs(thisWinEndX - remoteWinEndX) < tolerance &&\r\n Math.abs(thisWinStartX - remoteWinStartX) < tolerance\r\n const isRemoteEdgeConnected =\r\n Math.abs(thisWinEndY - remoteWinStartY) < tolerance ||\r\n Math.abs(thisWinStartY - remoteWinEndY) < tolerance\r\n\r\n const isStackResize = allowDistantResize\r\n ? isRemoteOnSameLane && isRemoteOutside\r\n : isRemoteOnSameLane && isRemoteEdgeConnected\r\n if (isStackResize) {\r\n remoteWin.setResizeAction('e')\r\n }\r\n }\r\n\r\n /*\r\n * thisWin left edge <::::> remoteWin right edge || remoteWin is stacked */\r\n if (currentResize === 'w') {\r\n const isEdgeAlignedOnXAxis = Math.abs(thisWinStartX - remoteWinEndX) <= tolerance\r\n const isOverlapOnYAxis = thisWinStartY <= remoteWinEndY && thisWinEndY >= remoteWinStartY\r\n\r\n const isEdgeResize = allowDistantResize\r\n ? isEdgeAlignedOnXAxis\r\n : isEdgeAlignedOnXAxis && isOverlapOnYAxis\r\n if (isEdgeResize) {\r\n remoteWin.setResizeAction('e')\r\n }\r\n\r\n const isRemoteOnSameLane =\r\n Math.abs(thisWinEndX - remoteWinEndX) < tolerance &&\r\n Math.abs(thisWinStartX - remoteWinStartX) < tolerance\r\n const isRemoteEdgeConnected =\r\n Math.abs(thisWinEndY - remoteWinStartY) < tolerance ||\r\n Math.abs(thisWinStartY - remoteWinEndY) < tolerance\r\n\r\n const isStackResize = allowDistantResize\r\n ? isRemoteOnSameLane && isRemoteOutside\r\n : isRemoteOnSameLane && isRemoteEdgeConnected\r\n if (isStackResize) {\r\n remoteWin.setResizeAction('w')\r\n }\r\n }\r\n\r\n /*\r\n * thisWin top edge <::::> remoteWin bottom edge || remoteWin is stacked */\r\n if (currentResize === 'n') {\r\n const isEdgeAlignedOnYAxis = Math.abs(thisWinStartY - remoteWinEndY) <= tolerance\r\n const isOverlapOnXAxis = thisWinStartX <= remoteWinEndX && thisWinEndX >= remoteWinStartX\r\n\r\n const isEdgeResize = allowDistantResize\r\n ? isEdgeAlignedOnYAxis\r\n : isEdgeAlignedOnYAxis && isOverlapOnXAxis\r\n if (isEdgeResize) {\r\n remoteWin.setResizeAction('s')\r\n }\r\n\r\n const isRemoteOnSameLane =\r\n Math.abs(thisWinEndY - remoteWinEndY) < tolerance &&\r\n Math.abs(thisWinStartY - remoteWinStartY) < tolerance\r\n const isRemoteEdgeConnected =\r\n Math.abs(thisWinEndX - remoteWinStartX) < tolerance ||\r\n Math.abs(thisWinStartX - remoteWinEndX) < tolerance\r\n\r\n const isStackResize = allowDistantResize\r\n ? isRemoteOnSameLane && isRemoteOutside\r\n : isRemoteOnSameLane && isRemoteEdgeConnected\r\n if (isStackResize) {\r\n remoteWin.setResizeAction('n')\r\n }\r\n }\r\n\r\n /*\r\n * thisWin bottom edge <::::> remoteWin top edge || remoteWin is stacked */\r\n if (currentResize === 's') {\r\n const isEdgeAlignedOnYAxis = Math.abs(thisWinEndY - remoteWinStartY) <= tolerance\r\n const isOverlapOnXAxis = thisWinStartX <= remoteWinEndX && thisWinEndX >= remoteWinStartX\r\n\r\n const isEdgeResize = allowDistantResize\r\n ? isEdgeAlignedOnYAxis\r\n : isEdgeAlignedOnYAxis && isOverlapOnXAxis\r\n if (isEdgeResize) {\r\n remoteWin.setResizeAction('n')\r\n }\r\n\r\n const isRemoteOnSameLane =\r\n Math.abs(thisWinEndY - remoteWinEndY) < tolerance &&\r\n Math.abs(thisWinStartY - remoteWinStartY) < tolerance\r\n const isRemoteEdgeConnected =\r\n Math.abs(thisWinEndX - remoteWinStartX) < tolerance ||\r\n Math.abs(thisWinStartX - remoteWinEndX) < tolerance\r\n\r\n const isStackResize = allowDistantResize\r\n ? isRemoteOnSameLane && isRemoteOutside\r\n : isRemoteOnSameLane && isRemoteEdgeConnected\r\n if (isStackResize) {\r\n remoteWin.setResizeAction('s')\r\n }\r\n }\r\n }\r\n}\r\n","import { useEffect, useState } from 'react'\r\nimport { dockApi } from '../docking/docking-api'\r\nimport { wsApi } from '../workspace/workspace-api'\r\nimport { windowRegistry } from '../../../registration/window-store-factory'\r\nimport { Coord } from '../../../model/window-types'\r\nimport { useCursorState } from '../cursor/cursor-state'\r\n\r\ntype Props = {\r\n winId: string\r\n}\r\n\r\nexport default function DragHandle({ winId }: Props) {\r\n const { x, y } = useCursorState()\r\n const { winVisualState, isDragging, winCoord, setWinCoord, setIsDragging } =\r\n windowRegistry[winId]()\r\n\r\n const [dragClickOffset, setDragClickOffset] = useState<Coord>({\r\n pointX: wsApi.getRect().left,\r\n pointY: wsApi.getRect().top,\r\n })\r\n\r\n useEffect(() => {\r\n if (wsApi.isBelowBreakPoint()) return\r\n if (!isDragging) return\r\n\r\n if (winVisualState === 'maximized') dockApi.demaximizeWindow(winId)\r\n\r\n const wsRect = wsApi.getRect()\r\n\r\n let adjustedX = x - dragClickOffset.pointX\r\n if (x > wsRect.right || x < wsRect.left) adjustedX = winCoord.pointX\r\n\r\n let adjustedY = y - dragClickOffset.pointY\r\n if (y > wsRect.bottom || y < wsRect.top) adjustedY = winCoord.pointY\r\n\r\n setWinCoord({ pointX: adjustedX, pointY: adjustedY })\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [isDragging, x, y])\r\n\r\n const startDrag = (isDragging: boolean) => {\r\n setDragClickOffset({ pointX: x - winCoord.pointX, pointY: y - winCoord.pointY })\r\n setIsDragging(isDragging)\r\n }\r\n\r\n return (\r\n <div\r\n onMouseDown={() => startDrag(true)}\r\n onMouseUp={() => startDrag(false)}\r\n onDoubleClick={() => dockApi.maximizeWindow(winId)}\r\n className=\"grow min-w-8 h-8 px-2 text-white flex items-center text-sm bg-white bg-opacity-0 hover:bg-opacity-5 mix-blend-difference\"\r\n ></div>\r\n )\r\n}\r\n","import { windowRegistry } from '../../registration/window-store-factory'\r\nimport { dockApi } from './docking/docking-api'\r\nimport { stackApi } from './stack/stack-api'\r\n\r\nexport type WindowButtonProps = {\r\n children: React.ReactNode\r\n winId: string\r\n className?: string\r\n /** @default 'brightness-[85%]' */\r\n isClosedClassName?: string\r\n /** @default 'brightness-150' */\r\n isOpenClassName?: string\r\n}\r\n\r\nexport default function WindowButton({\r\n children,\r\n winId,\r\n className,\r\n isClosedClassName = 'brightness-[85%]',\r\n isOpenClassName = 'brightness-150',\r\n}: WindowButtonProps) {\r\n const { isWindowClosed, windowId, isActive } = windowRegistry[winId]()\r\n\r\n const handleOpenCloseWin = () => {\r\n if (isWindowClosed) {\r\n stackApi.bringTargetWindowToFront(windowId)\r\n dockApi.openWindow(winId)\r\n return\r\n }\r\n\r\n if (isActive) dockApi.closeWindow(winId)\r\n stackApi.bringTargetWindowToFront(windowId)\r\n }\r\n\r\n return (\r\n <button\r\n id={`${windowId}_button`}\r\n onClick={handleOpenCloseWin}\r\n className={`\r\n ${className} \r\n ${isWindowClosed ? isClosedClassName : isOpenClassName}`}\r\n >\r\n {children}\r\n </button>\r\n )\r\n}\r\n","import { windowRegistry } from '../../../registration/window-store-factory'\r\nimport { wsApi } from '../workspace/workspace-api'\r\n\r\nexport const dockApi = {\r\n dockWindowRight: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().centerX, pointY: wsApi.getRect().top },\r\n winWidth: wsApi.getRect().innerWidth / 2,\r\n winHeight: wsApi.getRect().innerHeight,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n dockWindowLeft: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().left, pointY: wsApi.getRect().top },\r\n winWidth: wsApi.getRect().innerWidth / 2,\r\n winHeight: wsApi.getRect().innerHeight,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n dockWindowTop: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().left, pointY: wsApi.getRect().top },\r\n winWidth: wsApi.getRect().innerWidth,\r\n winHeight: wsApi.getRect().innerHeight / 2,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n dockWindowBottom: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().left, pointY: wsApi.getRect().centerY },\r\n winWidth: wsApi.getRect().innerWidth,\r\n winHeight: wsApi.getRect().innerHeight / 2,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n dockWindowBottomRight: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: {\r\n pointX: wsApi.getRect().centerX,\r\n pointY: wsApi.getRect().centerY,\r\n },\r\n winWidth: wsApi.getRect().innerWidth / 2,\r\n winHeight: wsApi.getRect().innerHeight / 2,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n dockWindowTopRight: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().centerX, pointY: wsApi.getRect().top },\r\n winWidth: wsApi.getRect().innerWidth / 2,\r\n winHeight: wsApi.getRect().innerHeight / 2,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n dockWindowBottomLeft: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().left, pointY: wsApi.getRect().centerY },\r\n winWidth: wsApi.getRect().innerWidth / 2,\r\n winHeight: wsApi.getRect().innerHeight / 2,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n dockWindowTopLeft: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().left, pointY: wsApi.getRect().top },\r\n winWidth: wsApi.getRect().innerWidth / 2,\r\n winHeight: wsApi.getRect().innerHeight / 2,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n maximizeWindow: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().left, pointY: wsApi.getRect().top },\r\n winHeight: wsApi.getRect().innerHeight,\r\n winWidth: wsApi.getRect().innerWidth,\r\n winVisualState: 'maximized',\r\n })\r\n },\r\n\r\n demaximizeWindow: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().left + 16, pointY: wsApi.getRect().top + 16 },\r\n winWidth: wsApi.getRect().innerWidth * 0.95,\r\n winHeight: wsApi.getRect().innerHeight * 0.75,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n closeWindow: (winId: string) => {\r\n windowRegistry[winId].setState({ isWindowClosed: true })\r\n },\r\n\r\n openWindow: (winId: string) => {\r\n const winState = windowRegistry[winId].getState()\r\n const winRef = winState.self\r\n if (winState.isWindowClosed && winRef?.current) {\r\n windowRegistry[winId].setState({ isWindowClosed: false })\r\n winRef.current.style.transform = 'translate(0, 0) scale(1)'\r\n }\r\n },\r\n}\r\n","import { dockApi } from \"./internal/features/docking/docking-api\"\r\nimport { resizeApi } from \"./internal/features/resizing/resizing-api\"\r\nimport { stackApi } from \"./internal/features/stack/stack-api\"\r\nimport { wsApi } from \"./internal/features/workspace/workspace-api\"\r\nimport { useWorkspaceState } from \"./internal/features/workspace/workspace-state\"\r\n\r\nconst rwm = {\r\n dockApi: dockApi,\r\n resizeApi: resizeApi,\r\n stackApi: stackApi,\r\n workspaceApi: wsApi,\r\n worskpaceState: useWorkspaceState\r\n}\r\n\r\nexport default rwm","import { useEffect, useRef } from 'react'\r\nimport {\r\n useWorkspaceState,\r\n} from './internal/features/workspace/workspace-state'\r\nimport DockingControls from './internal/features/docking/docking-controls'\r\nimport { resizeApi } from './internal/features/resizing/resizing-api'\r\nimport { CursorMoveListener } from './internal/features/cursor/cursor-move-listener'\r\nimport { ViewPortResizeListener } from './internal/features/view-port/view-port-resize-listener'\r\nimport { wsApi } from './internal/features/workspace/workspace-api'\r\nimport { ResponsiveSizes } from './model/workspace-types'\r\n\r\ntype Props = {\r\n children: React.ReactNode\r\n className?: string\r\n /**\r\n * Always relative to the WorkspaceLayout dimensions\r\n * @default 'sm'\r\n * @param sm uses mobile format at 640px\r\n * @param md uses mobile format at 768px\r\n * @param lg uses mobile format at 1024px\r\n * @param xl uses mobile format at 1280px\r\n * @param never never uses mobile format\r\n * @param always always uses mobile format\r\n * @param number set custom break point value in px */\r\n responsiveBreak?: ResponsiveSizes\r\n}\r\n\r\nexport default function WorkspaceLayout({ children, className, responsiveBreak = 'sm' }: Props) {\r\n const workspaceRef = useRef<HTMLElement | null>(null)\r\n const { setRef, setResponsiveBreak } = useWorkspaceState()\r\n\r\n useEffect(() => {\r\n setRef(workspaceRef.current)\r\n }, [])\r\n\r\n useEffect(() => {\r\n setResponsiveBreak(responsiveBreak)\r\n }, [responsiveBreak])\r\n\r\n return (\r\n <section\r\n ref={workspaceRef}\r\n onMouseLeave={resizeApi.stopAllDragAndResize}\r\n onMouseUp={resizeApi.stopAllDragAndResize}\r\n className={className ? className : 'fixed overflow-hidden h-full w-full touch-none'}\r\n >\r\n <ViewPortResizeListener />\r\n <CursorMoveListener />\r\n <div className=\" w-full h-full relative overflow-hidden\">\r\n {!wsApi.isBelowBreakPoint() && <DockingControls />}\r\n {children}\r\n </div>\r\n </section>\r\n )\r\n}\r\n","import { useState } from 'react'\r\nimport { windowRegistry } from '../../../registration/window-store-factory'\r\nimport { useWorkspaceState } from '../workspace/workspace-state'\r\nimport { dockApi } from './docking-api'\r\n\r\nexport default function DockingControls() {\r\n const [isHovering, setIsHovering] = useState(false)\r\n\r\n const { activeWindowId } = useWorkspaceState()\r\n const { isDragging } = windowRegistry[activeWindowId]()\r\n\r\n const cornerDockControl = (\r\n <div className={`flex xl:p-0 shrink-0 gap-0.5`}>\r\n <div className=\"flex flex-col justify-center gap-0.5\">\r\n <button\r\n className=\"hover:bg-zinc-300 border border-zinc-500 bg-zinc-600 w-10 h-6 rounded-sm\"\r\n onMouseUp={() => dockApi.dockWindowTopLeft(activeWindowId)}\r\n ></button>\r\n <button\r\n className=\"hover:bg-zinc-300 border border-zinc-500 bg-zinc-600 w-10 h-6 rounded-sm\"\r\n onMouseUp={() => dockApi.dockWindowBottomLeft(activeWindowId)}\r\n ></button>\r\n </div>\r\n <div className=\"flex flex-col justify-center gap-0.5\">\r\n <button\r\n className=\"hover:bg-zinc-300 border border-zinc-500 bg-zinc-600 w-10 h-6 rounded-sm\"\r\n onMouseUp={() => dockApi.dockWindowTopRight(activeWindowId)}\r\n ></button>\r\n <button\r\n className=\"hover:bg-zinc-300 border border-zinc-500 bg-zinc-600 w-10 h-6 rounded-sm\"\r\n onMouseUp={() => dockApi.dockWindowBottomRight(activeWindowId)}\r\n ></button>\r\n </div>\r\n </div>\r\n )\r\n\r\n const sideDideControl = (\r\n <div className={`flex shrink-0 items-center gap-0.5`}>\r\n <button\r\n className=\"hover:bg-zinc-300 border border-zinc-500 bg-zinc-600 w-8 h-12 rounded-sm\"\r\n onMouseUp={() => dockApi.dockWindowLeft(activeWindowId)}\r\n ></button>\r\n <button\r\n className=\"hover:bg-zinc-300 border border-zinc-500 bg-zinc-600 w-8 h-12 rounded-sm\"\r\n onMouseUp={() => dockApi.dockWindowRight(activeWindowId)}\r\n ></button>\r\n </div>\r\n )\r\n\r\n const horizontalDockControl = (\r\n <div className={`flex flex-col shrink-0 items-center gap-0.5`}>\r\n <button\r\n className=\"hover:bg-zinc-300 border border-zinc-500 bg-zinc-600 w-14 h-6 rounded-sm\"\r\n onMouseUp={() => dockApi.dockWindowTop(activeWindowId)}\r\n ></button>\r\n <button\r\n className=\"hover:bg-zinc-300 border border-zinc-500 bg-zinc-600 w-14 h-6 rounded-sm\"\r\n onMouseUp={() => dockApi.dockWindowBottom(activeWindowId)}\r\n ></button>\r\n </div>\r\n )\r\n\r\n const windowDockPannel = (\r\n <span\r\n className=\"pointer-events-auto px-4 pb-2\"\r\n onMouseOver={() => setIsHovering(true)}\r\n onMouseLeave={() => setIsHovering(false)}\r\n >\r\n <section\r\n className={`\r\n flex w-fit border border-zinc-600 border-t-0 rounded-b-md bg-zinc-800 \r\n overflow-hidden px-8 gap-4 h-full py-4 \r\n `}\r\n >\r\n {cornerDockControl}\r\n {horizontalDockControl}\r\n {sideDideControl}\r\n </section>\r\n </span>\r\n )\r\n\r\n /** @Note could easily add a drop on area to dock feature */\r\n return (\r\n <div\r\n className={`\r\n ${\r\n isDragging\r\n ? isHovering\r\n ? 'top-0 opacity-50'\r\n : 'top-[-68px] opacity-80'\r\n : 'top-[-104px] opacity-0'\r\n } \r\n transition-all duration-500\r\n absolute z-50 flex items-center justify-center \r\n w-full mx-auto pointer-events-none`}\r\n >\r\n {windowDockPannel}\r\n </div>\r\n )\r\n}\r\n","import { useEffect } from 'react'\r\nimport { useCursorState } from './cursor-state'\r\n\r\nexport function CursorMoveListener() {\r\n const { setX, setY } = useCursorState()\r\n\r\n useEffect(() => {\r\n const handleWindowPosition = (e: MouseEvent) => {\r\n e.preventDefault()\r\n setX(e.clientX)\r\n setY(e.clientY)\r\n }\r\n\r\n window.addEventListener('pointermove', handleWindowPosition)\r\n\r\n return () => window.removeEventListener('pointermove', handleWindowPosition)\r\n }, [setX, setY])\r\n\r\n return <></>\r\n}\r\n","import { useEffect } from 'react'\r\nimport { stackApi } from '../stack/stack-api'\r\n\r\nexport function ViewPortResizeListener() {\r\n useEffect(() => {\r\n window.addEventListener('resize', stackApi.resetStack)\r\n\r\n return () => window.removeEventListener('resize', stackApi.resetStack)\r\n }, [])\r\n\r\n return <></>\r\n}\r\n"],"mappings":";AAAA,SAAS,UAAAA,eAAuC;;;ACAhD,SAAS,aAAAC,YAAW,cAAc;;;ACiB5B;AAbC,SAAS,gBAAgB,EAAC,MAAK,GAAU;AAC9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,MAAK;AAAA,MACL,SAAQ;AAAA,MACR,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,QAAQ,QAAQ,QAAQ;AAAA,MACxB,OAAO,QAAQ,QAAQ;AAAA,MACvB,WAAU;AAAA,MAEV;AAAA,QAAC;AAAA;AAAA,UACC,eAAc;AAAA,UACd,gBAAe;AAAA,UACf,GAAE;AA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AAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL,cAAc,UAAU;AAAA,MACxB,WAAW,UAAU;AAAA,MACrB,WAAW,YAAY,YAAY;AAAA,MAEnC;AAAA,wBAAAD,MAAC,0BAAuB;AAAA,QACxB,gBAAAA,MAAC,sBAAmB;AAAA,QACpB,gBAAAC,MAAC,SAAI,WAAU,2CACZ;AAAA,WAAC,MAAM,kBAAkB,KAAK,gBAAAD,MAAC,mBAAgB;AAAA,UAC/C;AAAA,WACH;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["create","useEffect","create","window","jsx","resizeAction","useEffect","jsx","useEffect","isDragging","Fragment","jsx","jsxs","useEffect","jsx","jsx","create","useEffect","useRef","useState","jsx","jsxs","useState","useEffect","Fragment","jsx","useEffect","useEffect","Fragment","jsx","useEffect","jsx","jsxs","useRef","useEffect"]}
|
|
1
|
+
{"version":3,"sources":["../src/window-manager/registration/window-store-factory.tsx","../src/window-manager/internal/features/window-layout.tsx","../src/window-manager/internal/assets/svg-win-icons.tsx","../src/window-manager/internal/features/cursor/cursor-state.ts","../src/window-manager/internal/features/resizing/resizing-controls.tsx","../src/window-manager/internal/features/workspace/workspace-state.ts","../src/window-manager/internal/features/workspace/workspace-api.ts","../src/window-manager/internal/features/resizing/resizing-api.ts","../src/window-manager/internal/features/stack/stack-api.ts","../src/window-manager/internal/features/grid/grid-api.ts","../src/window-manager/internal/features/drag/drag-handle.tsx","../src/window-manager/internal/features/window-button.tsx","../src/window-manager/internal/features/docking/docking-api.ts","../src/window-manager/rwm.ts","../src/window-manager/workspace-layout.tsx","../src/window-manager/internal/features/docking/docking-controls.tsx","../src/window-manager/internal/features/cursor/cursor-move-listener.tsx","../src/window-manager/internal/features/view-port/view-port-resize-listener.tsx"],"sourcesContent":["import { create, StoreApi, UseBoundStore } from 'zustand'\r\nimport { RefObject } from 'react'\r\nimport {\r\n Coord,\r\n ResizeState,\r\n WindowRegistration,\r\n WindowStates,\r\n WindowStore,\r\n} from '../model/window-types'\r\nimport WindowLayout, { WindowLayoutProps } from '../internal/features/window-layout'\r\nimport WindowButton, { WindowButtonProps } from '../internal/features/window-button'\r\nimport { useWorkspaceState } from '../internal/features/workspace/workspace-state'\r\n\r\nconst windownMinWidth = 232\r\nconst windownMinHeight = 128\r\n\r\n/** @howToUse use the syntax `windowRegistry[<winId>]()` to access a store */\r\nexport const windowRegistry: Record<string, UseBoundStore<StoreApi<WindowStore>>> = {}\r\n\r\n/**\r\n * @return `id` auto generated id at the root of the window component.`id` can be used in `windowRegistry` to access the state store associated to this window instnace\r\n * @return\r\n * `store` zustand state store associated to this window instnace\r\n * @return\r\n * `window` JSX component representing an interactive window\r\n * @return\r\n * `button` JSX component that control this window */\r\nexport const createWindowStore = (): WindowRegistration => {\r\n const zIndexAtLaunch = Object.keys(windowRegistry).length + 1\r\n const windowInstanceId = `react-dynamic-window-instance${Object.keys(windowRegistry).length}`\r\n\r\n const storeInstance = create<WindowStore>((set, get) => ({\r\n windowId: windowInstanceId,\r\n\r\n self: undefined,\r\n setSelf: (ref: RefObject<HTMLDivElement | null>) => set({ self: ref }),\r\n\r\n WIN_MIN_WIDTH: windownMinWidth,\r\n setWIN_MIN_WIDTH: (w: number) => set({ WIN_MIN_WIDTH: w }),\r\n\r\n WIN_MIN_HEIGHT: windownMinHeight,\r\n setWIN_MIN_HEIGHT: (h: number) => set({ WIN_MIN_HEIGHT: h }),\r\n\r\n isActive: false,\r\n setIsActive: (isActive: boolean) => {\r\n useWorkspaceState.getState().setActiveWindowId(get().windowId)\r\n set({ isActive: isActive })\r\n },\r\n\r\n resetFlag: false,\r\n reset: () => set({ resetFlag: !get().resetFlag, isWindowClosed: true }),\r\n\r\n zIndex: zIndexAtLaunch,\r\n setZIndex: (newIndex: number) => set({ zIndex: newIndex }),\r\n\r\n winVisualState: 'demaximized',\r\n setWinVisualState: (newState: WindowStates) => set({ winVisualState: newState }),\r\n\r\n isWindowClosed: true,\r\n setisWindowClosed: (isClosed: boolean) => set({ isWindowClosed: isClosed }),\r\n\r\n winCoord: { pointX: 40, pointY: 40 },\r\n setWinCoord: (newWinCoord: Coord) =>\r\n set({ winCoord: { pointX: newWinCoord.pointX, pointY: newWinCoord.pointY } }),\r\n\r\n winWidth: windownMinWidth,\r\n setWinWidth: (newWinWidth: number) => set({ winWidth: newWinWidth }),\r\n\r\n winHeight: windownMinHeight,\r\n setWinHeight: (newWinHeight: number) => set({ winHeight: newWinHeight }),\r\n\r\n resizeAction: false,\r\n setResizeAction: (updatedIsResizing: ResizeState) => set({ resizeAction: updatedIsResizing }),\r\n\r\n isDragging: false,\r\n setIsDragging: (updatedIsDragging: boolean) => set({ isDragging: updatedIsDragging }),\r\n }))\r\n\r\n windowRegistry[windowInstanceId] = storeInstance\r\n\r\n return {\r\n id: storeInstance.getState().windowId,\r\n\r\n store: storeInstance,\r\n\r\n Window: (props: Omit<WindowLayoutProps, 'winId'>) => (\r\n <WindowLayout {...props} winId={windowInstanceId} />\r\n ),\r\n\r\n Button: (props: Omit<WindowButtonProps, 'winId'>) => (\r\n <WindowButton {...props} winId={windowInstanceId} />\r\n ),\r\n }\r\n}\r\n","import { useEffect, useRef } from 'react'\r\nimport { IconWinMinimize, IconWinDemaximize, IconWinMaximize } from '../assets/svg-win-icons'\r\nimport ResizingControls from './resizing/resizing-controls'\r\nimport { windowRegistry } from '../../registration/window-store-factory'\r\nimport { stackApi } from './stack/stack-api'\r\nimport { dockApi } from './docking/docking-api'\r\nimport { wsApi } from './workspace/workspace-api'\r\nimport DragHandle from './drag/drag-handle'\r\nimport { useWorkspaceState } from './workspace/workspace-state'\r\n\r\ntype DockPosition =\r\n | 'right'\r\n | 'left'\r\n | 'full'\r\n | 'top'\r\n | 'bottom'\r\n | 'top-right'\r\n | 'top-left'\r\n | 'bottom-right'\r\n | 'bottom-left'\r\n | 'default'\r\n\r\nexport type WindowLayoutProps = {\r\n children: React.ReactNode\r\n windowName: string | React.ReactNode\r\n winId: string\r\n navbarChildren?: React.ReactNode\r\n defaultDock?: DockPosition\r\n\r\n /** @note use CSS values such as hex or supported color names */\r\n style?: {\r\n navBackgroundColor?: string\r\n windowBackgroundColor?: string\r\n navControlsColor?: string\r\n }\r\n}\r\n\r\nexport default function WindowLayout({\r\n children,\r\n windowName,\r\n navbarChildren,\r\n winId,\r\n defaultDock = 'default',\r\n style,\r\n}: WindowLayoutProps) {\r\n const { ref: wsRef } = useWorkspaceState()\r\n const windowRef = useRef<HTMLDivElement>(null)\r\n const {\r\n windowId,\r\n zIndex,\r\n isActive,\r\n setSelf,\r\n\r\n resetFlag,\r\n\r\n winVisualState,\r\n\r\n isWindowClosed,\r\n\r\n winCoord,\r\n\r\n winWidth,\r\n winHeight,\r\n } = windowRegistry[winId]()\r\n\r\n useEffect(() => {\r\n setSelf(windowRef)\r\n\r\n if (wsApi.isBelowBreakPoint()) {\r\n dockApi.maximizeWindow(winId)\r\n return\r\n }\r\n\r\n dockingRoutes[defaultDock](winId)\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [setSelf, windowRef, resetFlag, wsRef])\r\n\r\n const dockingRoutes: Record<DockPosition, (winId: string) => void> = {\r\n right: dockApi.dockWindowRight,\r\n left: dockApi.dockWindowLeft,\r\n full: dockApi.maximizeWindow,\r\n top: dockApi.dockWindowTop,\r\n bottom: dockApi.dockWindowBottom,\r\n 'top-right': dockApi.dockWindowTopRight,\r\n 'top-left': dockApi.dockWindowTopLeft,\r\n 'bottom-right': dockApi.dockWindowBottomRight,\r\n 'bottom-left': dockApi.dockWindowBottomLeft,\r\n default: dockApi.demaximizeWindow,\r\n }\r\n\r\n const maximizeControl =\r\n winVisualState === 'maximized' ? (\r\n <button\r\n className={`block hover:bg-gray-500 hover:bg-opacity-10 px-5 h-full`}\r\n onClick={() => dockApi.demaximizeWindow(winId)}\r\n >\r\n <IconWinDemaximize color={style?.navControlsColor} />\r\n </button>\r\n ) : (\r\n <button\r\n className={`block hover:bg-gray-500 hover:bg-opacity-10 px-5 h-full`}\r\n onClick={() => dockApi.maximizeWindow(winId)}\r\n >\r\n <IconWinMaximize color={style?.navControlsColor} />\r\n </button>\r\n )\r\n\r\n const closeControl = (\r\n <button\r\n className=\"hover:bg-red-500 hover:bg-opacity-20 px-5 h-full\"\r\n onClick={() => dockApi.closeWindow(winId)}\r\n >\r\n <IconWinMinimize color={style?.navControlsColor} />\r\n </button>\r\n )\r\n\r\n return (\r\n <>\r\n <div\r\n id={windowId}\r\n ref={windowRef}\r\n className={`fixed bg-white shadow-lg border border-zinc-600 rounded-sm overflow-hidden`}\r\n onMouseDown={() => stackApi.bringTargetWindowToFront(windowId)}\r\n style={{\r\n backgroundColor: style?.windowBackgroundColor,\r\n top: `${winCoord.pointY}px`,\r\n left: `${winCoord.pointX}px`,\r\n width: `${winWidth}px`,\r\n height: `${winHeight}px`,\r\n zIndex: `${zIndex}`,\r\n\r\n /* MINIMIZE LOGIC */\r\n transition: 'transform 0.2s ease-in-out, opacity 0.3s ease-in-out',\r\n opacity: isWindowClosed ? 0 : 1,\r\n transform: isWindowClosed\r\n ? `translate(${wsApi.getRect().innerWidth / 2 - winCoord.pointX - winWidth / 2}px,\r\n ${wsApi.getRect().innerHeight - winCoord.pointY - winHeight / 2}px) scale(0.02)`\r\n : '',\r\n }}\r\n >\r\n <nav\r\n style={{\r\n backgroundColor: style?.navBackgroundColor,\r\n }}\r\n className={`\r\n h-[32px] w-full flex items-center bg-neutral-800\r\n ${isActive ? 'brightness-100 opacity-100' : 'brightness-75 opacity-80'}`}\r\n >\r\n <div className=\"w-fit shrink-0 h-8 px-2 text-white flex items-center text-sm truncate\">\r\n {windowName}\r\n </div>\r\n\r\n <div className=\"h-8 px-2 text-white flex items-center text-sm truncate\">\r\n {navbarChildren}\r\n </div>\r\n\r\n <DragHandle winId={winId} />\r\n\r\n {!wsApi.isBelowBreakPoint() && maximizeControl}\r\n {closeControl}\r\n </nav>\r\n\r\n {!wsApi.isBelowBreakPoint() && <ResizingControls winId={winId} />}\r\n\r\n {/* Offset the navbar => 'h-[calc(100%-32px)]' */}\r\n <div className={`relative w-full h-[calc(100%-32px)] overflow-auto`}>{children}</div>\r\n </div>{' '}\r\n </>\r\n )\r\n}\r\n","type Props = {\r\n color?: string\r\n}\r\n\r\nexport function IconWinMaximize({color}: Props) {\r\n return (\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n width={24}\r\n height={24}\r\n strokeWidth={1.5}\r\n stroke={color ? color : '#cccccc'}\r\n color={color ? color : '#cccccc'}\r\n className=\"size-6\"\r\n >\r\n <path\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n d=\"M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z\"\r\n />\r\n </svg>\r\n )\r\n}\r\n\r\nexport function IconWinDemaximize({color}: Props) {\r\n return (\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n width={24}\r\n height={24}\r\n strokeWidth={1.5}\r\n stroke={color ? color : '#cccccc'}\r\n color={color ? color : '#cccccc'}\r\n className=\"size-6\"\r\n >\r\n <path\r\n strokeLinecap=\"round\"\r\n strokeLinejoin=\"round\"\r\n d=\"M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6\"\r\n />\r\n </svg>\r\n )\r\n}\r\n\r\nexport function IconWinMinimize({color}: Props) {\r\n return (\r\n <svg\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n fill=\"none\"\r\n viewBox=\"0 0 24 24\"\r\n width={24}\r\n height={24}\r\n strokeWidth={1.5}\r\n stroke={color ? color : '#cccccc'}\r\n color={color ? color : '#cccccc'}\r\n className=\"size-6\"\r\n >\r\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\" />\r\n </svg>\r\n )\r\n}\r\n","import { create } from 'zustand'\r\n\r\ntype CursorState = {\r\n x: number\r\n y: number\r\n setX: (x: number) => void\r\n setY: (y: number) => void\r\n}\r\n\r\nexport const useCursorState = create<CursorState>((set) => ({\r\n x: 10,\r\n y: 10,\r\n setX: (newX: number) => set({ x: newX }),\r\n setY: (newY: number) => set({ y: newY }),\r\n}))\r\n","import { ResizeState } from '../../../model/window-types'\r\nimport { useCursorState } from '../cursor/cursor-state'\r\nimport { useEffect } from 'react'\r\nimport { windowRegistry } from '../../../registration/window-store-factory'\r\nimport { resizeApi } from './resizing-api'\r\nimport { gridApi } from '../grid/grid-api'\r\n\r\ntype Props = {\r\n winId: string\r\n}\r\n\r\nexport default function ResizingControls({ winId }: Props) {\r\n const { x, y } = useCursorState()\r\n const { winCoord, winWidth, winHeight, resizeAction } = windowRegistry[winId]()\r\n\r\n useEffect(() => {\r\n resizeApi.dispatchResizeAction(winId)\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [resizeAction, x, y])\r\n\r\n const handleResizeClick = (resizeAction: ResizeState) => {\r\n resizeApi.setResizeAction(winId, resizeAction)\r\n gridApi.orchestrateGridResize(winId)\r\n }\r\n\r\n return (\r\n <>\r\n <span\r\n onMouseUp={() => handleResizeClick(false)}\r\n onMouseDown={() => handleResizeClick('e')}\r\n id=\"win-resize-right-width\"\r\n className=\"fixed w-2 opacity-60 cursor-w-resize z-10\"\r\n style={{\r\n top: `${winCoord.pointY}px`,\r\n left: `${winCoord.pointX + winWidth - 4}px`,\r\n height: `${winHeight}px`,\r\n }}\r\n ></span>\r\n <span\r\n onMouseUp={() => handleResizeClick(false)}\r\n onMouseDown={() => handleResizeClick('w')}\r\n id=\"win-resize-left-width\"\r\n className=\"fixed w-2 opacity-60 cursor-w-resize z-10\"\r\n style={{\r\n top: `${winCoord.pointY}px`,\r\n left: `${winCoord.pointX - 4}px`,\r\n height: `${winHeight}px`,\r\n }}\r\n ></span>\r\n <span\r\n onMouseUp={() => handleResizeClick(false)}\r\n onMouseDown={() => handleResizeClick('s')}\r\n id=\"win-resize-bottom-height\"\r\n className=\"fixed h-2 opacity-60 cursor-s-resize z-10\"\r\n style={{\r\n top: `${winCoord.pointY + winHeight - 6}px`,\r\n left: `${winCoord.pointX}px`,\r\n width: `${winWidth}px`,\r\n }}\r\n ></span>\r\n <span\r\n onMouseUp={() => handleResizeClick(false)}\r\n onMouseDown={() => handleResizeClick('n')}\r\n id=\"win-resize-top-height\"\r\n className=\"fixed h-2 opacity-60 cursor-s-resize z-10\"\r\n style={{\r\n top: `${winCoord.pointY - 6}px`,\r\n left: `${winCoord.pointX}px`,\r\n width: `${winWidth}px`,\r\n }}\r\n ></span>\r\n <span\r\n onMouseUp={() => handleResizeClick(false)}\r\n onMouseDown={() => handleResizeClick('se')}\r\n id=\"win-resize-bottom-right-all\"\r\n className=\"fixed h-3 w-3 opacity-60 cursor-se-resize z-20\"\r\n style={{\r\n top: `${winCoord.pointY + winHeight - 8}px`,\r\n left: `${winCoord.pointX + winWidth - 8}px`,\r\n }}\r\n ></span>\r\n <span\r\n onMouseUp={() => handleResizeClick(false)}\r\n onMouseDown={() => handleResizeClick('sw')}\r\n id=\"win-resize-bottom-left-all\"\r\n className=\"fixed h-3 w-3 opacity-60 cursor-sw-resize z-20\"\r\n style={{\r\n top: `${winCoord.pointY + winHeight - 8}px`,\r\n left: `${winCoord.pointX - 8}px`,\r\n }}\r\n ></span>\r\n\r\n <span\r\n onMouseUp={() => handleResizeClick(false)}\r\n onMouseDown={() => handleResizeClick('ne')}\r\n id=\"win-resize-top-right-all\"\r\n className=\"fixed h-3 w-3 opacity-60 cursor-ne-resize z-20\"\r\n style={{\r\n top: `${winCoord.pointY - 6}px`,\r\n left: `${winCoord.pointX + winWidth - 6}px`,\r\n }}\r\n ></span>\r\n <span\r\n onMouseUp={() => handleResizeClick(false)}\r\n onMouseDown={() => handleResizeClick('nw')}\r\n id=\"win-resize-top-left-all\"\r\n className=\"fixed h-3 w-3 opacity-60 cursor-nw-resize z-20\"\r\n style={{\r\n top: `${winCoord.pointY - 6}px`,\r\n left: `${winCoord.pointX - 6}px`,\r\n }}\r\n ></span>\r\n </>\r\n )\r\n}\r\n","import { create } from 'zustand'\r\nimport { ResponsiveSizes, WorkspaceStore } from '../../../model/workspace-types'\r\n\r\nexport const useWorkspaceState = create<WorkspaceStore>((set) => ({\r\n ref: null,\r\n setRef: (newRef: HTMLElement | null) => set({ ref: newRef }),\r\n\r\n activeWindowId: 'react-dynamic-window-instance0',\r\n setActiveWindowId: (newId: string) => set({ activeWindowId: newId }),\r\n\r\n responsiveBreak: 'sm',\r\n setResponsiveBreak: (breakPoint: ResponsiveSizes) => set({ responsiveBreak: breakPoint }),\r\n}))\r\n","import { ResponsiveSizes, WorkspaceRect } from '../../../model/workspace-types'\r\nimport { useWorkspaceState } from './workspace-state'\r\n\r\nexport const wsApi = {\r\n getRect: (): WorkspaceRect => {\r\n const rect = useWorkspaceState.getState().ref?.getBoundingClientRect()\r\n\r\n const top = rect?.top ?? 0\r\n const left = rect?.left ?? 0\r\n const innerHeight = rect?.height ?? 0\r\n const innerWidth = rect?.width ?? 0\r\n\r\n const bottom = top + innerHeight\r\n const right = left + innerWidth\r\n\r\n const centerX = left + innerWidth / 2\r\n const centerY = top + innerHeight / 2\r\n\r\n const wsWindow = {\r\n top: top,\r\n left: left,\r\n innerHeight: innerHeight,\r\n innerWidth: innerWidth,\r\n bottom: bottom,\r\n right: right,\r\n centerX: centerX,\r\n centerY: centerY,\r\n }\r\n\r\n return wsWindow\r\n },\r\n\r\n isBelowBreakPoint: (): boolean => {\r\n const wsRect = wsApi.getRect()\r\n const breakPoint = useWorkspaceState.getState().responsiveBreak\r\n return wsRect.innerWidth < responsiveBreakInPx(breakPoint)\r\n },\r\n}\r\n\r\nconst responsiveBreakInPx = (breakPoint: ResponsiveSizes): number => {\r\n switch (breakPoint) {\r\n case 'sm':\r\n return 640\r\n case 'md':\r\n return 768\r\n case 'lg':\r\n return 1024\r\n case 'xl':\r\n return 1280\r\n case 'never':\r\n return 0\r\n case 'always':\r\n return Infinity\r\n default:\r\n return breakPoint\r\n }\r\n}\r\n","import { ResizeState, WindowStore } from '../../../model/window-types'\r\nimport { WorkspaceRect } from '../../../model/workspace-types'\r\nimport { windowRegistry } from '../../../registration/window-store-factory'\r\nimport { useCursorState } from '../cursor/cursor-state'\r\nimport { wsApi } from '../workspace/workspace-api'\r\n\r\ntype ResizeContext = {\r\n wsRect: WorkspaceRect\r\n win: WindowStore\r\n winBox: DOMRect | undefined\r\n x: number\r\n y: number\r\n}\r\n\r\nexport const resizeApi = {\r\n stopAllDragAndResize: () => {\r\n for (const key of Object.keys(windowRegistry)) {\r\n windowRegistry[key].getState().isDragging = false\r\n windowRegistry[key].getState().resizeAction = false\r\n }\r\n },\r\n\r\n setResizeAction: (winId: string, action: ResizeState) => {\r\n windowRegistry[winId].setState({ resizeAction: action })\r\n },\r\n\r\n dispatchResizeAction: (winId: string) => {\r\n const ctx = getDependencies(winId)\r\n if (!ctx.win.resizeAction) return\r\n\r\n ctx.win.setWinVisualState('demaximized')\r\n\r\n switch (ctx.win.resizeAction) {\r\n case 's':\r\n privateApi.resizeBottomWinHeight(ctx)\r\n break\r\n\r\n case 'n':\r\n privateApi.resizeTopWinHeight(ctx)\r\n break\r\n\r\n case 'e':\r\n privateApi.resizeRightWinWidth(ctx)\r\n break\r\n\r\n case 'w':\r\n privateApi.resizeLeftWinWidth(ctx)\r\n break\r\n\r\n case 'se':\r\n privateApi.resizeRightBottomWidthAndHeight(ctx)\r\n break\r\n\r\n case 'sw':\r\n privateApi.resizeLeftBottomWidthAndHeight(ctx)\r\n break\r\n\r\n case 'ne':\r\n privateApi.resizeRightTopWidthAndHeight(ctx)\r\n break\r\n\r\n case 'nw':\r\n privateApi.resizeLeftTopWidthAndHeight(ctx)\r\n break\r\n }\r\n },\r\n}\r\n\r\nconst privateApi = {\r\n resizeRightWinWidth: (resizeCtx: ResizeContext) => {\r\n const { wsRect, win, winBox, x, y } = resizeCtx\r\n\r\n if (!winBox) return\r\n\r\n const minWinWidth = x - winBox.left < win.WIN_MIN_WIDTH\r\n if (minWinWidth) return\r\n\r\n const cursorOutOfBounds = x > wsRect.right || x < wsRect.left\r\n if (cursorOutOfBounds) return\r\n\r\n const sizeDiff = x - winBox.right\r\n win.setWinWidth(win.winWidth + sizeDiff)\r\n },\r\n\r\n resizeLeftWinWidth: (resizeCtx: ResizeContext) => {\r\n const { wsRect, win, winBox, x, y } = resizeCtx\r\n if (!winBox) return\r\n\r\n const minWinWidth = winBox.right - x <= win.WIN_MIN_WIDTH\r\n if (minWinWidth) return\r\n\r\n const cursorOutOfBounds = x > wsRect.right || x < wsRect.left\r\n if (cursorOutOfBounds) return\r\n\r\n const sizeDiff = winBox.left - x\r\n win.setWinWidth(win.winWidth + sizeDiff)\r\n win.setWinCoord({ pointX: x, pointY: win.winCoord.pointY })\r\n },\r\n\r\n resizeTopWinHeight: (resizeCtx: ResizeContext) => {\r\n const { wsRect, win, winBox, x, y } = resizeCtx\r\n\r\n if (!winBox) return\r\n\r\n const minWinHeight = winBox.bottom - y <= win.WIN_MIN_HEIGHT\r\n if (minWinHeight) return\r\n\r\n const cursorOutOfBounds = y > wsRect.bottom || y < wsRect.top\r\n if (cursorOutOfBounds) return\r\n\r\n const sizeDiff = winBox.top - y\r\n win.setWinHeight(win.winHeight + sizeDiff)\r\n win.setWinCoord({ pointX: win.winCoord.pointX, pointY: y })\r\n },\r\n\r\n resizeBottomWinHeight: (resizeCtx: ResizeContext) => {\r\n const { wsRect, win, winBox, x, y } = resizeCtx\r\n if (!winBox) return\r\n\r\n const minWinHeight = y - winBox.top < win.WIN_MIN_HEIGHT\r\n if (minWinHeight) return\r\n\r\n const cursorOutOfBounds = y > wsRect.bottom || y < wsRect.top\r\n if (cursorOutOfBounds) return\r\n\r\n const sizeDiff = y - winBox.bottom\r\n win.setWinHeight(win.winHeight + sizeDiff)\r\n },\r\n\r\n resizeRightBottomWidthAndHeight: (resizeCtx: ResizeContext) => {\r\n privateApi.resizeRightWinWidth(resizeCtx)\r\n privateApi.resizeBottomWinHeight(resizeCtx)\r\n },\r\n\r\n resizeLeftBottomWidthAndHeight: (resizeCtx: ResizeContext) => {\r\n privateApi.resizeLeftWinWidth(resizeCtx)\r\n privateApi.resizeBottomWinHeight(resizeCtx)\r\n },\r\n\r\n resizeRightTopWidthAndHeight: (resizeCtx: ResizeContext) => {\r\n privateApi.resizeRightWinWidth(resizeCtx)\r\n privateApi.resizeTopWinHeight(resizeCtx)\r\n },\r\n\r\n /**\r\n * @note this specific case needs it's own logic instead of simply calling\r\n * resizeLeftWinWidth & resizeTopWinHeight. Since both manipulate\r\n * winWidth, winHeight and winCoord, one's logic will override the other\r\n */\r\n resizeLeftTopWidthAndHeight: (resizeCtx: ResizeContext) => {\r\n const { wsRect, win, winBox, x, y } = resizeCtx\r\n if (!winBox) return\r\n\r\n const cursorOutOfBoundsY = y > wsRect.bottom || y < wsRect.top\r\n const cursorOutOfBoundsX = x > wsRect.right || x < wsRect.left\r\n if (cursorOutOfBoundsY || cursorOutOfBoundsX) return\r\n\r\n const minWinHeight = winBox.bottom - y <= win.WIN_MIN_HEIGHT\r\n const minWinWidth = winBox.right - x <= win.WIN_MIN_WIDTH\r\n\r\n win.setWinCoord({\r\n pointX: minWinWidth ? win.winCoord.pointX : x,\r\n pointY: minWinHeight ? win.winCoord.pointY : y,\r\n })\r\n\r\n if (!minWinHeight) {\r\n const sizeDiffY = winBox.top - y\r\n win.setWinHeight(win.winHeight + sizeDiffY)\r\n }\r\n\r\n if (!minWinWidth) {\r\n const sizeDiffX = winBox.left - x\r\n win.setWinWidth(win.winWidth + sizeDiffX)\r\n }\r\n },\r\n}\r\n\r\nconst getDependencies = (winId: string): ResizeContext => {\r\n const wsRect = wsApi.getRect()\r\n const win = windowRegistry[winId].getState()\r\n const winBox = win.self?.current?.getBoundingClientRect()\r\n const { x, y } = useCursorState.getState()\r\n\r\n return { wsRect, win, winBox, x, y }\r\n}\r\n","import { windowRegistry } from '../../../registration/window-store-factory'\r\n\r\nexport const stackApi = {\r\n bringTargetWindowToFront: (targetId: string) => {\r\n const targetWindow = windowRegistry[targetId].getState()\r\n\r\n for (const key of Object.keys(windowRegistry)) {\r\n const window = windowRegistry[key].getState()\r\n\r\n if (window.windowId === targetWindow.windowId) {\r\n continue\r\n }\r\n\r\n window.setIsActive(false)\r\n if (window.zIndex >= targetWindow.zIndex) {\r\n window.setZIndex(window.zIndex - 1)\r\n }\r\n }\r\n\r\n targetWindow.setZIndex(Object.keys(windowRegistry).length)\r\n targetWindow.setIsActive(true)\r\n },\r\n\r\n getOpenedWindowCount: () => {\r\n let openWnidowCount = 0\r\n for (const key of Object.keys(windowRegistry))\r\n if (!windowRegistry[key].getState().isWindowClosed) openWnidowCount++\r\n\r\n return openWnidowCount\r\n },\r\n\r\n resetStack: () => {\r\n for (const key of Object.keys(windowRegistry)) {\r\n windowRegistry[key].getState().reset()\r\n }\r\n },\r\n}\r\n","import { windowRegistry } from '../../../registration/window-store-factory'\r\nimport { stackApi } from '../stack/stack-api'\r\n\r\nexport const gridApi = {\r\n orchestrateGridResize: (winId: string) => orchestrationGridResize(winId),\r\n}\r\n\r\n/**\r\n * @FixMe Most complex feature:\r\n * this function is a nice feature, needs to be written in a clearer way.\r\n * Multi-window tiling can be brittle\r\n * - isRemoteOutside needs refinement\r\n * - needs a stop if the other window stops moving\r\n * - stack should detect alignment\r\n * */\r\nconst orchestrationGridResize = (winId: string) => {\r\n const tolerance = 4\r\n const allowDistantResize = stackApi.getOpenedWindowCount() >= 3\r\n const thisWin = windowRegistry[winId].getState()\r\n const currentResize = thisWin.resizeAction\r\n\r\n for (const key of Object.keys(windowRegistry)) {\r\n const remoteWin = windowRegistry[key].getState()\r\n\r\n if (remoteWin.windowId === thisWin.windowId) {\r\n continue\r\n }\r\n\r\n const thisWinStartY = thisWin.winCoord.pointY\r\n const thisWinEndY = thisWin.winCoord.pointY + thisWin.winHeight\r\n const remoteWinStartY = remoteWin.winCoord.pointY\r\n const remoteWinEndY = remoteWin.winCoord.pointY + remoteWin.winHeight\r\n\r\n const thisWinStartX = thisWin.winCoord.pointX\r\n const thisWinEndX = thisWin.winCoord.pointX + thisWin.winWidth\r\n const remoteWinStartX = remoteWin.winCoord.pointX\r\n const remoteWinEndX = remoteWin.winCoord.pointX + remoteWin.winWidth\r\n\r\n const isRemoteOutside =\r\n remoteWinEndY !== thisWinEndY ||\r\n remoteWinEndX !== thisWinEndX ||\r\n remoteWinStartY !== thisWinStartY ||\r\n remoteWinStartX !== thisWinStartX\r\n /*\r\n * thisWin right edge <::::> remoteWin left edge || remoteWin is stacked */\r\n if (currentResize === 'e') {\r\n const isEdgeAlignedOnXAxis = Math.abs(thisWinEndX - remoteWinStartX) <= tolerance\r\n const isOverlapOnYAxis = thisWinStartY <= remoteWinEndY && thisWinEndY >= remoteWinStartY\r\n\r\n const isEdgeResize = allowDistantResize\r\n ? isEdgeAlignedOnXAxis\r\n : isEdgeAlignedOnXAxis && isOverlapOnYAxis\r\n if (isEdgeResize) {\r\n remoteWin.setResizeAction('w')\r\n }\r\n\r\n const isRemoteOnSameLane =\r\n Math.abs(thisWinEndX - remoteWinEndX) < tolerance &&\r\n Math.abs(thisWinStartX - remoteWinStartX) < tolerance\r\n const isRemoteEdgeConnected =\r\n Math.abs(thisWinEndY - remoteWinStartY) < tolerance ||\r\n Math.abs(thisWinStartY - remoteWinEndY) < tolerance\r\n\r\n const isStackResize = allowDistantResize\r\n ? isRemoteOnSameLane && isRemoteOutside\r\n : isRemoteOnSameLane && isRemoteEdgeConnected\r\n if (isStackResize) {\r\n remoteWin.setResizeAction('e')\r\n }\r\n }\r\n\r\n /*\r\n * thisWin left edge <::::> remoteWin right edge || remoteWin is stacked */\r\n if (currentResize === 'w') {\r\n const isEdgeAlignedOnXAxis = Math.abs(thisWinStartX - remoteWinEndX) <= tolerance\r\n const isOverlapOnYAxis = thisWinStartY <= remoteWinEndY && thisWinEndY >= remoteWinStartY\r\n\r\n const isEdgeResize = allowDistantResize\r\n ? isEdgeAlignedOnXAxis\r\n : isEdgeAlignedOnXAxis && isOverlapOnYAxis\r\n if (isEdgeResize) {\r\n remoteWin.setResizeAction('e')\r\n }\r\n\r\n const isRemoteOnSameLane =\r\n Math.abs(thisWinEndX - remoteWinEndX) < tolerance &&\r\n Math.abs(thisWinStartX - remoteWinStartX) < tolerance\r\n const isRemoteEdgeConnected =\r\n Math.abs(thisWinEndY - remoteWinStartY) < tolerance ||\r\n Math.abs(thisWinStartY - remoteWinEndY) < tolerance\r\n\r\n const isStackResize = allowDistantResize\r\n ? isRemoteOnSameLane && isRemoteOutside\r\n : isRemoteOnSameLane && isRemoteEdgeConnected\r\n if (isStackResize) {\r\n remoteWin.setResizeAction('w')\r\n }\r\n }\r\n\r\n /*\r\n * thisWin top edge <::::> remoteWin bottom edge || remoteWin is stacked */\r\n if (currentResize === 'n') {\r\n const isEdgeAlignedOnYAxis = Math.abs(thisWinStartY - remoteWinEndY) <= tolerance\r\n const isOverlapOnXAxis = thisWinStartX <= remoteWinEndX && thisWinEndX >= remoteWinStartX\r\n\r\n const isEdgeResize = allowDistantResize\r\n ? isEdgeAlignedOnYAxis\r\n : isEdgeAlignedOnYAxis && isOverlapOnXAxis\r\n if (isEdgeResize) {\r\n remoteWin.setResizeAction('s')\r\n }\r\n\r\n const isRemoteOnSameLane =\r\n Math.abs(thisWinEndY - remoteWinEndY) < tolerance &&\r\n Math.abs(thisWinStartY - remoteWinStartY) < tolerance\r\n const isRemoteEdgeConnected =\r\n Math.abs(thisWinEndX - remoteWinStartX) < tolerance ||\r\n Math.abs(thisWinStartX - remoteWinEndX) < tolerance\r\n\r\n const isStackResize = allowDistantResize\r\n ? isRemoteOnSameLane && isRemoteOutside\r\n : isRemoteOnSameLane && isRemoteEdgeConnected\r\n if (isStackResize) {\r\n remoteWin.setResizeAction('n')\r\n }\r\n }\r\n\r\n /*\r\n * thisWin bottom edge <::::> remoteWin top edge || remoteWin is stacked */\r\n if (currentResize === 's') {\r\n const isEdgeAlignedOnYAxis = Math.abs(thisWinEndY - remoteWinStartY) <= tolerance\r\n const isOverlapOnXAxis = thisWinStartX <= remoteWinEndX && thisWinEndX >= remoteWinStartX\r\n\r\n const isEdgeResize = allowDistantResize\r\n ? isEdgeAlignedOnYAxis\r\n : isEdgeAlignedOnYAxis && isOverlapOnXAxis\r\n if (isEdgeResize) {\r\n remoteWin.setResizeAction('n')\r\n }\r\n\r\n const isRemoteOnSameLane =\r\n Math.abs(thisWinEndY - remoteWinEndY) < tolerance &&\r\n Math.abs(thisWinStartY - remoteWinStartY) < tolerance\r\n const isRemoteEdgeConnected =\r\n Math.abs(thisWinEndX - remoteWinStartX) < tolerance ||\r\n Math.abs(thisWinStartX - remoteWinEndX) < tolerance\r\n\r\n const isStackResize = allowDistantResize\r\n ? isRemoteOnSameLane && isRemoteOutside\r\n : isRemoteOnSameLane && isRemoteEdgeConnected\r\n if (isStackResize) {\r\n remoteWin.setResizeAction('s')\r\n }\r\n }\r\n }\r\n}\r\n","import { useEffect, useState } from 'react'\r\nimport { dockApi } from '../docking/docking-api'\r\nimport { wsApi } from '../workspace/workspace-api'\r\nimport { windowRegistry } from '../../../registration/window-store-factory'\r\nimport { Coord } from '../../../model/window-types'\r\nimport { useCursorState } from '../cursor/cursor-state'\r\n\r\ntype Props = {\r\n winId: string\r\n}\r\n\r\nexport default function DragHandle({ winId }: Props) {\r\n const { x, y } = useCursorState()\r\n const { winVisualState, isDragging, winCoord, setWinCoord, setIsDragging } =\r\n windowRegistry[winId]()\r\n\r\n const [dragClickOffset, setDragClickOffset] = useState<Coord>({\r\n pointX: wsApi.getRect().left,\r\n pointY: wsApi.getRect().top,\r\n })\r\n\r\n useEffect(() => {\r\n if (wsApi.isBelowBreakPoint()) return\r\n if (!isDragging) return\r\n\r\n if (winVisualState === 'maximized') dockApi.demaximizeWindow(winId)\r\n\r\n const wsRect = wsApi.getRect()\r\n\r\n let adjustedX = x - dragClickOffset.pointX\r\n if (x > wsRect.right || x < wsRect.left) adjustedX = winCoord.pointX\r\n\r\n let adjustedY = y - dragClickOffset.pointY\r\n if (y > wsRect.bottom || y < wsRect.top) adjustedY = winCoord.pointY\r\n\r\n setWinCoord({ pointX: adjustedX, pointY: adjustedY })\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [isDragging, x, y])\r\n\r\n const startDrag = (isDragging: boolean) => {\r\n setDragClickOffset({ pointX: x - winCoord.pointX, pointY: y - winCoord.pointY })\r\n setIsDragging(isDragging)\r\n }\r\n\r\n return (\r\n <div\r\n onMouseDown={() => startDrag(true)}\r\n onMouseUp={() => startDrag(false)}\r\n onDoubleClick={() => dockApi.maximizeWindow(winId)}\r\n className=\"grow min-w-8 h-8 px-2 text-white flex items-center text-sm bg-white bg-opacity-0 hover:bg-opacity-5 mix-blend-difference\"\r\n ></div>\r\n )\r\n}\r\n","import { windowRegistry } from '../../registration/window-store-factory'\r\nimport { dockApi } from './docking/docking-api'\r\nimport { stackApi } from './stack/stack-api'\r\n\r\nexport type WindowButtonProps = {\r\n children: React.ReactNode\r\n winId: string\r\n className?: string\r\n /** @default 'brightness-[85%]' */\r\n isClosedClassName?: string\r\n /** @default 'brightness-150' */\r\n isOpenClassName?: string\r\n}\r\n\r\nexport default function WindowButton({\r\n children,\r\n winId,\r\n className,\r\n isClosedClassName = 'brightness-[85%]',\r\n isOpenClassName = 'brightness-150',\r\n}: WindowButtonProps) {\r\n const { isWindowClosed, windowId, isActive } = windowRegistry[winId]()\r\n\r\n const handleOpenCloseWin = () => {\r\n if (isWindowClosed) {\r\n stackApi.bringTargetWindowToFront(windowId)\r\n dockApi.openWindow(winId)\r\n return\r\n }\r\n\r\n if (isActive) dockApi.closeWindow(winId)\r\n stackApi.bringTargetWindowToFront(windowId)\r\n }\r\n\r\n return (\r\n <button\r\n id={`${windowId}_button`}\r\n onClick={handleOpenCloseWin}\r\n className={`\r\n ${className} \r\n ${isWindowClosed ? isClosedClassName : isOpenClassName}`}\r\n >\r\n {children}\r\n </button>\r\n )\r\n}\r\n","import { windowRegistry } from '../../../registration/window-store-factory'\r\nimport { wsApi } from '../workspace/workspace-api'\r\n\r\nexport const dockApi = {\r\n dockWindowRight: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().centerX, pointY: wsApi.getRect().top },\r\n winWidth: wsApi.getRect().innerWidth / 2,\r\n winHeight: wsApi.getRect().innerHeight,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n dockWindowLeft: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().left, pointY: wsApi.getRect().top },\r\n winWidth: wsApi.getRect().innerWidth / 2,\r\n winHeight: wsApi.getRect().innerHeight,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n dockWindowTop: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().left, pointY: wsApi.getRect().top },\r\n winWidth: wsApi.getRect().innerWidth,\r\n winHeight: wsApi.getRect().innerHeight / 2,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n dockWindowBottom: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().left, pointY: wsApi.getRect().centerY },\r\n winWidth: wsApi.getRect().innerWidth,\r\n winHeight: wsApi.getRect().innerHeight / 2,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n dockWindowBottomRight: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: {\r\n pointX: wsApi.getRect().centerX,\r\n pointY: wsApi.getRect().centerY,\r\n },\r\n winWidth: wsApi.getRect().innerWidth / 2,\r\n winHeight: wsApi.getRect().innerHeight / 2,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n dockWindowTopRight: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().centerX, pointY: wsApi.getRect().top },\r\n winWidth: wsApi.getRect().innerWidth / 2,\r\n winHeight: wsApi.getRect().innerHeight / 2,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n dockWindowBottomLeft: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().left, pointY: wsApi.getRect().centerY },\r\n winWidth: wsApi.getRect().innerWidth / 2,\r\n winHeight: wsApi.getRect().innerHeight / 2,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n dockWindowTopLeft: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().left, pointY: wsApi.getRect().top },\r\n winWidth: wsApi.getRect().innerWidth / 2,\r\n winHeight: wsApi.getRect().innerHeight / 2,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n maximizeWindow: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().left, pointY: wsApi.getRect().top },\r\n winHeight: wsApi.getRect().innerHeight,\r\n winWidth: wsApi.getRect().innerWidth,\r\n winVisualState: 'maximized',\r\n })\r\n },\r\n\r\n demaximizeWindow: (winId: string) => {\r\n windowRegistry[winId].setState({\r\n winCoord: { pointX: wsApi.getRect().left + 16, pointY: wsApi.getRect().top + 16 },\r\n winWidth: wsApi.getRect().innerWidth * 0.95,\r\n winHeight: wsApi.getRect().innerHeight * 0.75,\r\n winVisualState: 'demaximized',\r\n })\r\n },\r\n\r\n closeWindow: (winId: string) => {\r\n windowRegistry[winId].setState({ isWindowClosed: true })\r\n },\r\n\r\n openWindow: (winId: string) => {\r\n const winState = windowRegistry[winId].getState()\r\n const winRef = winState.self\r\n if (winState.isWindowClosed && winRef?.current) {\r\n windowRegistry[winId].setState({ isWindowClosed: false })\r\n winRef.current.style.transform = 'translate(0, 0) scale(1)'\r\n }\r\n },\r\n}\r\n","import { dockApi } from \"./internal/features/docking/docking-api\"\r\nimport { resizeApi } from \"./internal/features/resizing/resizing-api\"\r\nimport { stackApi } from \"./internal/features/stack/stack-api\"\r\nimport { wsApi } from \"./internal/features/workspace/workspace-api\"\r\nimport { useWorkspaceState } from \"./internal/features/workspace/workspace-state\"\r\n\r\nconst rwm = {\r\n dockApi: dockApi,\r\n resizeApi: resizeApi,\r\n stackApi: stackApi,\r\n workspaceApi: wsApi,\r\n worskpaceState: useWorkspaceState\r\n}\r\n\r\nexport default rwm","import { useEffect, useRef } from 'react'\r\nimport {\r\n useWorkspaceState,\r\n} from './internal/features/workspace/workspace-state'\r\nimport DockingControls from './internal/features/docking/docking-controls'\r\nimport { resizeApi } from './internal/features/resizing/resizing-api'\r\nimport { CursorMoveListener } from './internal/features/cursor/cursor-move-listener'\r\nimport { ViewPortResizeListener } from './internal/features/view-port/view-port-resize-listener'\r\nimport { wsApi } from './internal/features/workspace/workspace-api'\r\nimport { ResponsiveSizes } from './model/workspace-types'\r\n\r\ntype Props = {\r\n children: React.ReactNode\r\n className?: string\r\n /**\r\n * Always relative to the WorkspaceLayout dimensions\r\n * @default 'sm'\r\n * @param sm uses mobile format at 640px\r\n * @param md uses mobile format at 768px\r\n * @param lg uses mobile format at 1024px\r\n * @param xl uses mobile format at 1280px\r\n * @param never never uses mobile format\r\n * @param always always uses mobile format\r\n * @param number set custom break point value in px */\r\n responsiveBreak?: ResponsiveSizes\r\n}\r\n\r\nexport default function WorkspaceLayout({ children, className, responsiveBreak = 'sm' }: Props) {\r\n const workspaceRef = useRef<HTMLElement | null>(null)\r\n const { setRef, setResponsiveBreak } = useWorkspaceState()\r\n\r\n useEffect(() => {\r\n setRef(workspaceRef.current)\r\n }, [])\r\n\r\n useEffect(() => {\r\n setResponsiveBreak(responsiveBreak)\r\n }, [responsiveBreak])\r\n\r\n return (\r\n <section\r\n ref={workspaceRef}\r\n onMouseLeave={resizeApi.stopAllDragAndResize}\r\n onMouseUp={resizeApi.stopAllDragAndResize}\r\n className={className ? className : 'fixed overflow-hidden h-full w-full touch-none'}\r\n >\r\n <ViewPortResizeListener />\r\n <CursorMoveListener />\r\n <div className=\" w-full h-full relative overflow-hidden\">\r\n {!wsApi.isBelowBreakPoint() && <DockingControls />}\r\n {children}\r\n </div>\r\n </section>\r\n )\r\n}\r\n","import { useState } from 'react'\r\nimport { windowRegistry } from '../../../registration/window-store-factory'\r\nimport { useWorkspaceState } from '../workspace/workspace-state'\r\nimport { dockApi } from './docking-api'\r\n\r\nexport default function DockingControls() {\r\n const [isHovering, setIsHovering] = useState(false)\r\n\r\n const { activeWindowId } = useWorkspaceState()\r\n const { isDragging } = windowRegistry[activeWindowId]()\r\n\r\n const cornerDockControl = (\r\n <div className={`flex xl:p-0 shrink-0 gap-0.5`}>\r\n <div className=\"flex flex-col justify-center gap-0.5\">\r\n <button\r\n className=\"hover:bg-zinc-300 border border-zinc-500 bg-zinc-600 w-10 h-6 rounded-sm\"\r\n onMouseUp={() => dockApi.dockWindowTopLeft(activeWindowId)}\r\n ></button>\r\n <button\r\n className=\"hover:bg-zinc-300 border border-zinc-500 bg-zinc-600 w-10 h-6 rounded-sm\"\r\n onMouseUp={() => dockApi.dockWindowBottomLeft(activeWindowId)}\r\n ></button>\r\n </div>\r\n <div className=\"flex flex-col justify-center gap-0.5\">\r\n <button\r\n className=\"hover:bg-zinc-300 border border-zinc-500 bg-zinc-600 w-10 h-6 rounded-sm\"\r\n onMouseUp={() => dockApi.dockWindowTopRight(activeWindowId)}\r\n ></button>\r\n <button\r\n className=\"hover:bg-zinc-300 border border-zinc-500 bg-zinc-600 w-10 h-6 rounded-sm\"\r\n onMouseUp={() => dockApi.dockWindowBottomRight(activeWindowId)}\r\n ></button>\r\n </div>\r\n </div>\r\n )\r\n\r\n const sideDideControl = (\r\n <div className={`flex shrink-0 items-center gap-0.5`}>\r\n <button\r\n className=\"hover:bg-zinc-300 border border-zinc-500 bg-zinc-600 w-8 h-12 rounded-sm\"\r\n onMouseUp={() => dockApi.dockWindowLeft(activeWindowId)}\r\n ></button>\r\n <button\r\n className=\"hover:bg-zinc-300 border border-zinc-500 bg-zinc-600 w-8 h-12 rounded-sm\"\r\n onMouseUp={() => dockApi.dockWindowRight(activeWindowId)}\r\n ></button>\r\n </div>\r\n )\r\n\r\n const horizontalDockControl = (\r\n <div className={`flex flex-col shrink-0 items-center gap-0.5`}>\r\n <button\r\n className=\"hover:bg-zinc-300 border border-zinc-500 bg-zinc-600 w-14 h-6 rounded-sm\"\r\n onMouseUp={() => dockApi.dockWindowTop(activeWindowId)}\r\n ></button>\r\n <button\r\n className=\"hover:bg-zinc-300 border border-zinc-500 bg-zinc-600 w-14 h-6 rounded-sm\"\r\n onMouseUp={() => dockApi.dockWindowBottom(activeWindowId)}\r\n ></button>\r\n </div>\r\n )\r\n\r\n const windowDockPannel = (\r\n <span\r\n className=\"pointer-events-auto px-4 pb-2\"\r\n onMouseOver={() => setIsHovering(true)}\r\n onMouseLeave={() => setIsHovering(false)}\r\n >\r\n <section\r\n className={`\r\n flex w-fit border border-zinc-600 border-t-0 rounded-b-md bg-zinc-800 \r\n overflow-hidden px-8 gap-4 h-full py-4 \r\n `}\r\n >\r\n {cornerDockControl}\r\n {horizontalDockControl}\r\n {sideDideControl}\r\n </section>\r\n </span>\r\n )\r\n\r\n /** @Note could easily add a drop on area to dock feature */\r\n return (\r\n <div\r\n className={`\r\n ${\r\n isDragging\r\n ? isHovering\r\n ? 'top-0 opacity-50'\r\n : 'top-[-68px] opacity-80'\r\n : 'top-[-104px] opacity-0'\r\n } \r\n transition-all duration-500\r\n absolute z-50 flex items-center justify-center \r\n w-full mx-auto pointer-events-none`}\r\n >\r\n {windowDockPannel}\r\n </div>\r\n )\r\n}\r\n","import { useEffect } from 'react'\r\nimport { useCursorState } from './cursor-state'\r\n\r\nexport function CursorMoveListener() {\r\n const { setX, setY } = useCursorState()\r\n\r\n useEffect(() => {\r\n const handleWindowPosition = (e: MouseEvent) => {\r\n e.preventDefault()\r\n setX(e.clientX)\r\n setY(e.clientY)\r\n }\r\n\r\n window.addEventListener('pointermove', handleWindowPosition)\r\n\r\n return () => window.removeEventListener('pointermove', handleWindowPosition)\r\n }, [setX, setY])\r\n\r\n return <></>\r\n}\r\n","import { useEffect } from 'react'\r\nimport { stackApi } from '../stack/stack-api'\r\n\r\nexport function ViewPortResizeListener() {\r\n useEffect(() => {\r\n window.addEventListener('resize', stackApi.resetStack)\r\n\r\n return () => window.removeEventListener('resize', stackApi.resetStack)\r\n }, [])\r\n\r\n return <></>\r\n}\r\n"],"mappings":";AAAA,SAAS,UAAAA,eAAuC;;;ACAhD,SAAS,aAAAC,YAAW,cAAc;;;ACiB5B;AAbC,SAAS,gBAAgB,EAAC,MAAK,GAAU;AAC9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,MAAK;AAAA,MACL,SAAQ;AAAA,MACR,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,QAAQ,QAAQ,QAAQ;AAAA,MACxB,OAAO,QAAQ,QAAQ;AAAA,MACvB,WAAU;AAAA,MAEV;AAAA,QAAC;AAAA;AAAA,UACC,eAAc;AAAA,UACd,gBAAe;AAAA,UACf,GAAE;AAAA;AAAA,MACJ;AAAA;AAAA,EACF;AAEJ;AAEO,SAAS,kBAAkB,EAAC,MAAK,GAAU;AAChD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,MAAK;AAAA,MACL,SAAQ;AAAA,MACR,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,QAAQ,QAAQ,QAAQ;AAAA,MACxB,OAAO,QAAQ,QAAQ;AAAA,MACvB,WAAU;AAAA,MAEV;AAAA,QAAC;AAAA;AAAA,UACC,eAAc;AAAA,UACd,gBAAe;AAAA,UACf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A;AAAA,EACF;AAEJ;","names":["create","useEffect","create","window","jsx","resizeAction","useEffect","jsx","useEffect","isDragging","Fragment","jsx","jsxs","useEffect","jsx","jsx","create","useEffect","useRef","useState","jsx","jsxs","useState","useEffect","Fragment","jsx","useEffect","useEffect","Fragment","jsx","useEffect","jsx","jsxs","useRef","useEffect"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"window-layout.d.ts","sourceRoot":"","sources":["../../../../src/window-manager/internal/features/window-layout.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"window-layout.d.ts","sourceRoot":"","sources":["../../../../src/window-manager/internal/features/window-layout.tsx"],"names":[],"mappings":"AAUA,KAAK,YAAY,GACb,OAAO,GACP,MAAM,GACN,MAAM,GACN,KAAK,GACL,QAAQ,GACR,WAAW,GACX,UAAU,GACV,cAAc,GACd,aAAa,GACb,SAAS,CAAA;AAEb,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAA;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAChC,WAAW,CAAC,EAAE,YAAY,CAAA;IAE1B,gEAAgE;IAChE,KAAK,CAAC,EAAE;QACN,kBAAkB,CAAC,EAAE,MAAM,CAAA;QAC3B,qBAAqB,CAAC,EAAE,MAAM,CAAA;QAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAC1B,CAAA;CACF,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,QAAQ,EACR,UAAU,EACV,cAAc,EACd,KAAK,EACL,WAAuB,EACvB,KAAK,GACN,EAAE,iBAAiB,2CA6HnB"}
|