Skip to content

Commit 87b914c

Browse files
committed
Format
1 parent ca274c9 commit 87b914c

File tree

18 files changed

+103
-105
lines changed

18 files changed

+103
-105
lines changed

libs/@hashintel/petrinaut/src/components/glass-panel.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export const GlassPanel: React.FC<GlassPanelProps> = ({
153153
resizeStartPosRef.current = isVertical ? event.clientY : event.clientX;
154154
resizeStartSizeRef.current = resizable.size;
155155
},
156-
[resizable]
156+
[resizable],
157157
);
158158

159159
const handleResizeMove = useCallback(
@@ -178,12 +178,12 @@ export const GlassPanel: React.FC<GlassPanelProps> = ({
178178

179179
const newSize = Math.max(
180180
minSize,
181-
Math.min(maxSize, resizeStartSizeRef.current + delta)
181+
Math.min(maxSize, resizeStartSizeRef.current + delta),
182182
);
183183

184184
onResize(newSize);
185185
},
186-
[isResizing, resizable]
186+
[isResizing, resizable],
187187
);
188188

189189
const handleResizeEnd = useCallback(() => {
@@ -218,7 +218,7 @@ export const GlassPanel: React.FC<GlassPanelProps> = ({
218218
onResize(newSize);
219219
}
220220
},
221-
[resizable]
221+
[resizable],
222222
);
223223

224224
// Global cursor and event listeners during resize

libs/@hashintel/petrinaut/src/state/editor-store.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export type EditorState = {
6060
draggingStateByNodeId: DraggingStateByNodeId;
6161
setDraggingStateByNodeId: (state: DraggingStateByNodeId) => void;
6262
updateDraggingStateByNodeId: (
63-
updater: (state: DraggingStateByNodeId) => DraggingStateByNodeId
63+
updater: (state: DraggingStateByNodeId) => DraggingStateByNodeId,
6464
) => void;
6565
resetDraggingState: () => void;
6666

@@ -119,7 +119,7 @@ export function createEditorStore() {
119119
isBottomPanelOpen: !state.isBottomPanelOpen,
120120
}),
121121
false,
122-
"toggleBottomPanel"
122+
"toggleBottomPanel",
123123
),
124124
bottomPanelHeight: DEFAULT_BOTTOM_PANEL_HEIGHT,
125125
setBottomPanelHeight: (height) =>
@@ -157,7 +157,7 @@ export function createEditorStore() {
157157
return { selectedItemIds: newSet };
158158
},
159159
false,
160-
{ type: "addSelectedItemId", id }
160+
{ type: "addSelectedItemId", id },
161161
),
162162
removeSelectedItemId: (id) =>
163163
set(
@@ -167,7 +167,7 @@ export function createEditorStore() {
167167
return { selectedItemIds: newSet };
168168
},
169169
false,
170-
{ type: "removeSelectedItemId", id }
170+
{ type: "removeSelectedItemId", id },
171171
),
172172
clearSelection: () =>
173173
set({ selectedItemIds: new Set() }, false, "clearSelection"),
@@ -178,15 +178,15 @@ export function createEditorStore() {
178178
set(
179179
{ draggingStateByNodeId: state },
180180
false,
181-
"setDraggingStateByNodeId"
181+
"setDraggingStateByNodeId",
182182
),
183183
updateDraggingStateByNodeId: (updater) =>
184184
set(
185185
(state) => ({
186186
draggingStateByNodeId: updater(state.draggingStateByNodeId),
187187
}),
188188
false,
189-
"updateDraggingStateByNodeId"
189+
"updateDraggingStateByNodeId",
190190
),
191191
resetDraggingState: () =>
192192
set({ draggingStateByNodeId: {} }, false, "resetDraggingState"),
@@ -207,12 +207,12 @@ export function createEditorStore() {
207207
draggingStateByNodeId: {},
208208
},
209209
false,
210-
{ type: "initializeEditorStore" }
210+
{ type: "initializeEditorStore" },
211211
);
212212
},
213213
// for some reason 'create' doesn't raise an error if a function in the type is missing
214-
} satisfies EditorState),
215-
{ name: "Editor Store" }
216-
)
214+
}) satisfies EditorState,
215+
{ name: "Editor Store" },
216+
),
217217
);
218218
}

libs/@hashintel/petrinaut/src/views/Editor/components/BottomBar/bottom-bar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ export const BottomBar: React.FC<BottomBarProps> = ({
6060
}) => {
6161
const isBottomPanelOpen = useEditorStore((state) => state.isBottomPanelOpen);
6262
const setBottomPanelOpen = useEditorStore(
63-
(state) => state.setBottomPanelOpen
63+
(state) => state.setBottomPanelOpen,
6464
);
6565
const setActiveBottomPanelTab = useEditorStore(
66-
(state) => state.setActiveBottomPanelTab
66+
(state) => state.setActiveBottomPanelTab,
6767
);
6868
const bottomPanelHeight = useEditorStore((state) => state.bottomPanelHeight);
6969

libs/@hashintel/petrinaut/src/views/Editor/components/BottomBar/simulation-controls.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ export const SimulationControls: React.FC<SimulationControlsProps> = ({
6868
const pause = useSimulationStore((state) => state.pause);
6969
const dt = useSimulationStore((state) => state.dt);
7070
const currentlyViewedFrame = useSimulationStore(
71-
(state) => state.currentlyViewedFrame
71+
(state) => state.currentlyViewedFrame,
7272
);
7373
const setCurrentlyViewedFrame = useSimulationStore(
74-
(state) => state.setCurrentlyViewedFrame
74+
(state) => state.setCurrentlyViewedFrame,
7575
);
7676

7777
const setBottomPanelOpen = useEditorStore(
78-
(state) => state.setBottomPanelOpen
78+
(state) => state.setBottomPanelOpen,
7979
);
8080
const setActiveBottomPanelTab = useEditorStore(
81-
(state) => state.setActiveBottomPanelTab
81+
(state) => state.setActiveBottomPanelTab,
8282
);
8383

8484
const isDisabled = disabled;

libs/@hashintel/petrinaut/src/views/Editor/components/BottomPanel/bottom-panel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export const BottomPanel: React.FC = () => {
107107
const leftSidebarWidth = useEditorStore((state) => state.leftSidebarWidth);
108108
const panelHeight = useEditorStore((state) => state.bottomPanelHeight);
109109
const setBottomPanelHeight = useEditorStore(
110-
(state) => state.setBottomPanelHeight
110+
(state) => state.setBottomPanelHeight,
111111
);
112112
const activeTab = useEditorStore((state) => state.activeBottomPanelTab);
113113
const setActiveTab = useEditorStore((state) => state.setActiveBottomPanelTab);

libs/@hashintel/petrinaut/src/views/Editor/components/BottomPanel/diagnostics-content.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { useSDCPNContext } from "../../../../state/sdcpn-provider";
1111
* Formats a TypeScript diagnostic message to a readable string
1212
*/
1313
const formatDiagnosticMessage = (
14-
messageText: string | ts.DiagnosticMessageChain
14+
messageText: string | ts.DiagnosticMessageChain,
1515
): string => {
1616
if (typeof messageText === "string") {
1717
return messageText;
@@ -91,19 +91,19 @@ export const DiagnosticsContent: React.FC = () => {
9191
const { checkResult, totalDiagnosticsCount } = useCheckerContext();
9292
const { petriNetDefinition } = useSDCPNContext();
9393
const setSelectedResourceId = useEditorStore(
94-
(state) => state.setSelectedResourceId
94+
(state) => state.setSelectedResourceId,
9595
);
9696
// Track collapsed entities (all expanded by default)
9797
const [collapsedEntities, setCollapsedEntities] = useState<Set<string>>(
98-
new Set()
98+
new Set(),
9999
);
100100

101101
// Handler to select an entity when clicking on a diagnostic
102102
const handleSelectEntity = useCallback(
103103
(entityId: string) => {
104104
setSelectedResourceId(entityId);
105105
},
106-
[setSelectedResourceId]
106+
[setSelectedResourceId],
107107
);
108108

109109
// Group diagnostics by entity (transition or differential equation)
@@ -119,14 +119,14 @@ export const DiagnosticsContent: React.FC = () => {
119119
if (item.itemType === "differential-equation") {
120120
entityType = "differential-equation";
121121
const de = petriNetDefinition.differentialEquations.find(
122-
(deItem) => deItem.id === entityId
122+
(deItem) => deItem.id === entityId,
123123
);
124124
entityName = de?.name ?? entityId;
125125
subType = null;
126126
} else {
127127
entityType = "transition";
128128
const transition = petriNetDefinition.transitions.find(
129-
(tr) => tr.id === entityId
129+
(tr) => tr.id === entityId,
130130
);
131131
entityName = transition?.name ?? entityId;
132132
subType = item.itemType === "transition-lambda" ? "lambda" : "kernel";

libs/@hashintel/petrinaut/src/views/Editor/components/BottomPanel/parameters-content.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,14 @@ export const ParametersContent: React.FC = () => {
121121
const globalMode = useEditorStore((state) => state.globalMode);
122122
const simulationState = useSimulationStore((state) => state.state);
123123
const selectedResourceId = useEditorStore(
124-
(state) => state.selectedResourceId
124+
(state) => state.selectedResourceId,
125125
);
126126
const setSelectedResourceId = useEditorStore(
127-
(state) => state.setSelectedResourceId
127+
(state) => state.setSelectedResourceId,
128128
);
129129
const parameterValues = useSimulationStore((state) => state.parameterValues);
130130
const setParameterValue = useSimulationStore(
131-
(state) => state.setParameterValue
131+
(state) => state.setParameterValue,
132132
);
133133

134134
const isSimulationNotRun =

libs/@hashintel/petrinaut/src/views/Editor/components/BottomPanel/simulation-settings-content.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,11 @@ export const SimulationSettingsContent: React.FC = () => {
197197
const dt = useSimulationStore((state) => state.dt);
198198
const setDt = useSimulationStore((state) => state.setDt);
199199
const setSelectedResourceId = useEditorStore(
200-
(state) => state.setSelectedResourceId
200+
(state) => state.setSelectedResourceId,
201201
);
202202
const parameterValues = useSimulationStore((state) => state.parameterValues);
203203
const setParameterValue = useSimulationStore(
204-
(state) => state.setParameterValue
204+
(state) => state.setParameterValue,
205205
);
206206

207207
const {

libs/@hashintel/petrinaut/src/views/Editor/components/LeftSideBar/left-sidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ export const LeftSideBar: React.FC<LeftSideBarProps> = ({
148148
}) => {
149149
const isOpen = useEditorStore((state) => state.isLeftSidebarOpen);
150150
const setLeftSidebarOpen = useEditorStore(
151-
(state) => state.setLeftSidebarOpen
151+
(state) => state.setLeftSidebarOpen,
152152
);
153153
const leftSidebarWidth = useEditorStore((state) => state.leftSidebarWidth);
154154
const setLeftSidebarWidth = useEditorStore(
155-
(state) => state.setLeftSidebarWidth
155+
(state) => state.setLeftSidebarWidth,
156156
);
157157

158158
return (

libs/@hashintel/petrinaut/src/views/Editor/components/PropertiesPanel/differential-equation-properties.tsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface DifferentialEquationPropertiesProps {
2525
globalMode: "edit" | "simulate";
2626
updateDifferentialEquation: (
2727
equationId: string,
28-
updateFn: (equation: DifferentialEquation) => void
28+
updateFn: (equation: DifferentialEquation) => void,
2929
) => void;
3030
}
3131

@@ -48,7 +48,7 @@ export const DifferentialEquationProperties: React.FC<
4848
const isReadOnly = globalMode === "simulate" || isSimulationRunning;
4949

5050
const associatedType = types.find(
51-
(type) => type.id === differentialEquation.colorId
51+
(type) => type.id === differentialEquation.colorId,
5252
);
5353

5454
// Find places that use this differential equation
@@ -74,7 +74,7 @@ export const DifferentialEquationProperties: React.FC<
7474
differentialEquation.id,
7575
(existingEquation) => {
7676
existingEquation.colorId = newTypeId;
77-
}
77+
},
7878
);
7979
}
8080
};
@@ -85,7 +85,7 @@ export const DifferentialEquationProperties: React.FC<
8585
differentialEquation.id,
8686
(existingEquation) => {
8787
existingEquation.colorId = pendingTypeId;
88-
}
88+
},
8989
);
9090
}
9191
setShowConfirmDialog(false);
@@ -124,7 +124,7 @@ export const DifferentialEquationProperties: React.FC<
124124
differentialEquation.id,
125125
(existingEquation) => {
126126
existingEquation.name = event.target.value;
127-
}
127+
},
128128
);
129129
}}
130130
disabled={isReadOnly}
@@ -392,18 +392,18 @@ export const DifferentialEquationProperties: React.FC<
392392
onClick: () => {
393393
// Get the associated type to generate appropriate default code
394394
const equationType = types.find(
395-
(t) => t.id === differentialEquation.colorId
395+
(t) => t.id === differentialEquation.colorId,
396396
);
397397

398398
updateDifferentialEquation(
399399
differentialEquation.id,
400400
(existingEquation) => {
401401
existingEquation.code = equationType
402402
? generateDefaultDifferentialEquationCode(
403-
equationType
403+
equationType,
404404
)
405405
: DEFAULT_DIFFERENTIAL_EQUATION_CODE;
406-
}
406+
},
407407
);
408408
},
409409
},
@@ -451,7 +451,7 @@ export const DifferentialEquationProperties: React.FC<
451451
differentialEquation.id,
452452
(existingEquation) => {
453453
existingEquation.code = newCode ?? "";
454-
}
454+
},
455455
);
456456
}}
457457
path={`inmemory://sdcpn/differential-equations/${differentialEquation.id}.ts`}

0 commit comments

Comments
 (0)