Skip to content

Commit d2d47c8

Browse files
committed
doc strings
1 parent 5097c9c commit d2d47c8

4 files changed

Lines changed: 23 additions & 0 deletions

File tree

app/lib/node-editor/hooks/useContextMenu.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ import {
1212
useUndoHotkey,
1313
} from "./useShortcuts";
1414

15+
/**
16+
* Custom hook to manage context menus in a node editor.
17+
* It provides handlers for pane, node, and selection context menus,
18+
* as well as dimensions and visibility management.
19+
*/
1520
export function useContextMenu() {
1621
const [paneContextMenu, setPaneContextMenu] = useState<{
1722
x: number;

app/lib/node-editor/hooks/useFlow.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ const selector = (state: {
3333
highlightDuplicateNodes: state.highlightDuplicateNodes,
3434
});
3535

36+
/**
37+
* Custom hook to manage the flow of nodes and edges in a React Flow instance.
38+
* It provides handlers for node and edge changes, connections, and deletion.
39+
*/
3640
export function useFlow() {
3741
const { getIntersectingNodes, getNode, getNodes, getEdges } = useReactFlow();
3842
const { nodes, edges, setNodes, setEdges, highlightDuplicateNodes } =

app/lib/node-editor/hooks/useGameobjectSelect.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ import { useState } from "react";
88

99
import type { GameObject } from "~/lib/game/game-objects";
1010

11+
/**
12+
* Custom hook to manage game object selection in a node editor.
13+
* It provides handlers for selecting, deselecting, and reordering game objects.
14+
*
15+
* @param items - List of game objects to select from.
16+
* @param initialSelection - Initial selection of game objects.
17+
* @param id - Identifier for the node being edited.
18+
*/
1119
export function useGameobjectSelect(
1220
items: GameObject[],
1321
initialSelection: GameObject[],

app/lib/node-editor/hooks/useMac.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import { useEffect, useState } from "react";
22

3+
/**
4+
* Custom hook to determine if the user's operating system is macOS.
5+
* It checks the user agent string to identify macOS and excludes iOS devices.
6+
*
7+
* @returns {boolean} - True if the OS is macOS, false otherwise.
8+
*/
39
const useIsMac = () => {
410
const [isMac, setIsMacOS] = useState(false);
511

0 commit comments

Comments
 (0)