Files
windmill/frontend/src/lib/components/flow_builder.ts
T
070dc488e6 fix: make in-app navigation targets real links for new-tab clicks (#12202)
* fix: open list rows in a new tab on middle and ctrl/cmd-click

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test: cover openOnNewTabClick nested-control and modifier handling

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor: drop the JS new-tab handler from run rows, keep only real links

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: make in-app navigation targets real links across the frontend

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: share one modified-click predicate and keep run args out of edit links

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: decode group deep-link hashes before matching names

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: encode group names in deep-link hashes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep converted link rows in their text colour and palette links out of tab order

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: clear the resource-type hash on close, close run menus on middle-click

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: run portalled picker and palette link handlers before sveltekit follows the href

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: encode native-trigger ids in deep-link hashes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
2026-11-04 22:25:24 +01:00

84 lines
4.0 KiB
TypeScript

import type { Flow, OpenFlow } from '$lib/gen'
import type { StateStore } from '$lib/utils'
import type { FlowState } from './flows/flowState'
import type { Trigger } from './triggers/utils'
import type { DiffDrawerI } from './diff_drawer'
import type { FlowBuilderWhitelabelCustomUi } from './custom_ui'
import type { ScheduleTrigger } from './triggers'
import type { stepState } from './stepHistoryLoader.svelte'
import type { WorkspaceItem } from './workspacePicker'
export type FlowBuilderProps = {
initialPath?: string
/** The draft row's own path (the URL path). For a draft-only flow `initialPath` is
* re-seeded from the draft's `draft_path` so the topbar shows the pending name, so
* it can't be used to resolve what is actually deployed. */
userDraftPath?: string
/** Moves the draft's base to the head and keeps its content; offered in the diff
* drawer while the draft is behind, and called with the version the drawer shows
* as head. */
onTakeLatest?: (head?: string) => void | Promise<void>
pathStoreInit?: string | undefined
newFlow: boolean
selectedId: string | undefined
initialArgs?: Record<string, any>
loading?: boolean
flowStore: StateStore<OpenFlow>
flowStateStore: StateStore<FlowState>
savedFlow?: Flow & { no_deployed?: boolean }
diffDrawer?: DiffDrawerI | undefined
customUi?: FlowBuilderWhitelabelCustomUi
disableAi?: boolean
disabledFlowInputs?: boolean
savedPrimarySchedule?: ScheduleTrigger | undefined // used to set the primary schedule in the legacy primaryScheduleStore
version?: number | undefined
/** flow_version the draft was forked from (as text, like `draft_base`); when
* set, the deploy-time staleness check compares it (not the load-time head
* `version`) against the latest. */
draftBaseVersion?: string | undefined
draftTriggersFromUrl?: Trigger[] | undefined
selectedTriggerIndexFromUrl?: number | undefined
children?: import('svelte').Snippet
loadedFromHistoryFromUrl?: {
flowJobInitial: boolean | undefined
stepsState: Record<string, stepState>
}
noInitial?: boolean
liveEditorDraftStoragePath?: string
// Indicator-only draft key overrides. When the flow editor is embedded
// (e.g. the sessions preview) its autosave runs under a different
// (workspace, path) than `$workspaceStore`/`liveEditorDraftStoragePath`
// (a forked workspace, and a path this component doesn't own). These let
// the host point the `AutosaveIndicator` at the key its own autosave uses,
// WITHOUT repurposing `liveEditorDraftStoragePath` (which still drives this
// component's setLiveEditorDraft/flush). Undefined → fall back, so the
// full-page editor is unaffected.
autosaveWorkspace?: string
autosavePath?: string
onDeploy?: ({ path }: { path: string }) => void
onDeployError?: ({ error }: { error: any }) => void
onDetails?: ({ path }: { path: string }) => void
/** Makes "Exit & see details" a link, so it opens in a new tab on middle/ctrl-click. Wins over `onDetails`. */
detailsHref?: (path: string) => string
onHistoryRestore?: () => void
onNavigate?: (item: WorkspaceItem) => void
// Threaded to the `AutosaveIndicator` popover so its "Reset to
// deployed" button can do the same thing the load-time toast offers.
onResetToDeployed?: () => void | Promise<void>
// See ScriptBuilderProps — same semantics for the flow editor's
// indicator.
loadedFromDraft?: boolean
othersDraftsCount?: number
onOpenOthersDrafts?: () => void
// Fired whenever a test run is started from the flow editor, with the
// preview job id. Used by whitelabel embedders to track test jobs.
onTestJob?: (e: { jobId: string }) => void
// Condensed top bar: smaller (sm) buttons, a shorter bar, and the
// EditorHeader's path/breadcrumb row dropped (summary only). Used by the
// session preview to save vertical room.
condensedHeader?: boolean
/** The editor's path/summary and actions go to the route's page header instead of a bar of
* its own. Only the full-page editor sets it; embedders keep their own bar. */
ownsPageHeader?: boolean
}