import { isSortable } from "@dnd-kit/react/sortable"; import type { TimelineStep } from "@thorium/.server/classes/Plugins/TimelineStep"; import { AddBlockButton } from "@thorium/components/timelineBuilder/AddBlockMenu"; import { DefinedVariableProvider, useDefinedVariables, } from "@thorium/components/timelineBuilder/DefinedVariableContext"; import { SortableBlocks } from "@thorium/components/timelineBuilder/SortableBlocks"; import type { TimelineBlock } from "@thorium/components/timelineBuilder/TimelineBlockTypes"; import { q } from "@thorium/context/AppContext"; import { toast } from "@thorium/context/ToastContext"; import { InterpolateInfo } from "@thorium/routes/config/reports/InterpolateInfo"; import { reportVariableNames } from "@thorium/routes/config/reports/reportAvailableVariables"; import { trainingVariableNames } from "@thorium/routes/config/trainings/trainingAvailableVariables"; import { usePrompt } from "@thorium/ui/AlertDialog"; import Button from "@thorium/ui/Button"; import InfoTip from "@thorium/ui/InfoTip"; import Input from "@thorium/ui/Input"; import { SortableList } from "@thorium/ui/SortableItem"; import TagInput from "@thorium/ui/TagInput"; import { parseSchema } from "@thorium/utils/zodAutoForm"; import { parseSchema as parseJsonSchema } from "json-schema-to-zod"; import { Suspense } from "react"; import { Button as RAButton } from "react-aria-components"; export function TimelineStepEditor({ pluginId, timelineId, timelineType, step, }: { pluginId: string; timelineId: string; timelineType: "reports" | "missions" | "trainings"; step: TimelineStep; }) { const stepId = step.id; const variables = timelineType === "reports" ? reportVariableNames : timelineType === "trainings" ? trainingVariableNames : []; const getActionPresetValues = useGetActionPresetValue(timelineType); return (
Compose blocks together to create the logic for your timeline step. Get entity references, store properties in variables, and execute actions.
The following variables are available:
No blocks added to step.
These blocks will be executed immediately, including any checks, to evaluate if the timeline is available to be used. Leave blank to always include this timeline.
The following variables are available:
No prerequisite blocks.