Skip to content

Commit 213f48c

Browse files
committed
moved event.ts into state/
1 parent b08cbad commit 213f48c

File tree

11 files changed

+12
-11
lines changed

11 files changed

+12
-11
lines changed

dashi/src/lib/actions/handleComponentChange.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { store } from "@/lib/store";
22
import { type ContribPoint } from "@/lib/types/model/extension";
33
import { type CallbackRequest } from "@/lib/types/model/callback";
4-
import { type ComponentChangeEvent } from "@/lib/types/model/event";
4+
import { type ComponentChangeEvent } from "@/lib/types/state/event";
55
import { getInputValues } from "@/lib/actions/helpers/getInputValues";
66
import { applyStateChangeRequests } from "@/lib/actions/helpers/applyStateChangeRequests";
77
import { invokeCallbacks } from "@/lib/actions/helpers/invokeCallbacks";
@@ -64,6 +64,7 @@ function getCallbackRequests(
6464
equalObjPaths(input.property, changeEvent.property),
6565
);
6666
if (inputIndex >= 0) {
67+
// Collect triggered callback
6768
callbackRequests.push({
6869
contribPoint,
6970
contribIndex,

dashi/src/lib/components/Box.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import MuiBox from "@mui/material/Box";
22

33
import { type BoxState } from "@/lib/types/state/component";
4-
import { type ComponentChangeHandler } from "@/lib/types/model/event";
4+
import { type ComponentChangeHandler } from "@/lib/types/state/event";
55
import { ComponentChildren } from "./ComponentChildren";
66

77
export interface BoxProps extends Omit<BoxState, "type"> {

dashi/src/lib/components/Button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { type MouseEvent } from "react";
22
import MuiButton from "@mui/material/Button";
33

44
import { type ButtonState } from "@/lib/types/state/component";
5-
import { type ComponentChangeHandler } from "@/lib/types/model/event";
5+
import { type ComponentChangeHandler } from "@/lib/types/state/event";
66

77
export interface ButtonProps extends Omit<ButtonState, "type"> {
88
onChange: ComponentChangeHandler;

dashi/src/lib/components/Checkbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import MuiFormControl from "@mui/material/FormControl";
44
import MuiFormControlLabel from "@mui/material/FormControlLabel";
55

66
import { type CheckboxState } from "@/lib/types/state/component";
7-
import { type ComponentChangeHandler } from "@/lib/types/model/event";
7+
import { type ComponentChangeHandler } from "@/lib/types/state/event";
88

99
export interface CheckboxProps extends Omit<CheckboxState, "type"> {
1010
onChange: ComponentChangeHandler;

dashi/src/lib/components/Component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type ComponentState } from "@/lib/types/state/component";
2-
import { type ComponentChangeHandler } from "@/lib/types/model/event";
2+
import { type ComponentChangeHandler } from "@/lib/types/state/event";
33
import { Button, type ButtonProps } from "./Button";
44
import { Box, type BoxProps } from "./Box";
55
import { Checkbox, type CheckboxProps } from "./Checkbox";

dashi/src/lib/components/ComponentChildren.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type ComponentChangeHandler } from "@/lib/types/model/event";
1+
import { type ComponentChangeHandler } from "@/lib/types/state/event";
22
import { type ComponentState } from "@/lib/types/state/component";
33
import { Component } from "./Component";
44

dashi/src/lib/components/Dropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import MenuItem from "@mui/material/MenuItem";
44
import Select, { type SelectChangeEvent } from "@mui/material/Select";
55

66
import { type DropdownState } from "@/lib/types/state/component";
7-
import { type ComponentChangeHandler } from "@/lib/types/model/event";
7+
import { type ComponentChangeHandler } from "@/lib/types/state/event";
88

99
export interface DropdownProps extends Omit<DropdownState, "type"> {
1010
onChange: ComponentChangeHandler;

dashi/src/lib/components/Plot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { VegaLite } from "react-vega";
22

33
import { type PlotState } from "@/lib/types/state/component";
4-
import { type ComponentChangeHandler } from "@/lib/types/model/event";
4+
import { type ComponentChangeHandler } from "@/lib/types/state/event";
55

66
export interface PlotProps extends Omit<PlotState, "type"> {
77
onChange: ComponentChangeHandler;

dashi/src/lib/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export { type ComponentState } from "@/lib/types/state/component";
55
export {
66
type ComponentChangeEvent,
77
type ComponentChangeHandler,
8-
} from "@/lib/types/model/event";
8+
} from "@/lib/types/state/event";
99
// Actions (store changes)
1010
export { initializeContributions } from "@/lib/actions/initializeContributions";
1111
export { handleComponentChange } from "@/lib/actions/handleComponentChange";

dashi/src/lib/types/model/callback.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Input, Output } from "@/lib/types/model/channel";
1+
import type { Input, Output } from "./channel";
22

33
export interface Callback {
44
function: CbFunction;
@@ -62,7 +62,7 @@ export interface CallbackRef {
6262
export interface InputRef {
6363
/**
6464
* The index of the input of a callback.
65-
* Used to store the input that triggered the callback.
65+
* Records the input that triggered the callback.
6666
*/
6767
inputIndex: number;
6868
}

0 commit comments

Comments
 (0)