fix: break promoted widget import cycle

Amp-Thread-ID: https://ampcode.com/threads/T-019e1d98-44cc-7459-bcc5-cc4f0d3b4268
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
DrJKL
2026-05-12 12:28:05 -07:00
parent f8c02e71af
commit bad2f2c4c8
3 changed files with 18 additions and 10 deletions

View File

@@ -39,6 +39,12 @@ export interface PromotedWidgetView extends IBaseWidget {
hydrateHostValue(value: IBaseWidget['value']): void
}
export function getPromotedWidgetHostStateName(
widget: PromotedWidgetView
): string {
return [widget.name, widget.sourceNodeId, widget.sourceWidgetName].join(':')
}
export function isPromotedWidgetView(
widget: IBaseWidget
): widget is PromotedWidgetView {

View File

@@ -22,17 +22,17 @@ import {
import { matchPromotedInput } from '@/core/graph/subgraph/matchPromotedInput'
import { hasWidgetNode } from '@/core/graph/subgraph/widgetNodeTypeGuard'
import { isPromotedWidgetView } from './promotedWidgetTypes'
import {
getPromotedWidgetHostStateName,
isPromotedWidgetView
} from './promotedWidgetTypes'
import type { PromotedWidgetView as IPromotedWidgetView } from './promotedWidgetTypes'
export type { PromotedWidgetView } from './promotedWidgetTypes'
export { isPromotedWidgetView } from './promotedWidgetTypes'
export function getPromotedWidgetHostStateName(
widget: IPromotedWidgetView
): string {
return [widget.name, widget.sourceNodeId, widget.sourceWidgetName].join(':')
}
export {
getPromotedWidgetHostStateName,
isPromotedWidgetView
} from './promotedWidgetTypes'
interface SubgraphSlotRef {
name: string

View File

@@ -1,7 +1,9 @@
import * as Sentry from '@sentry/vue'
import type { PromotedWidgetSource } from '@/core/graph/subgraph/promotedWidgetTypes'
import { isPromotedWidgetView } from '@/core/graph/subgraph/promotedWidgetTypes'
import { getPromotedWidgetHostStateName } from '@/core/graph/subgraph/promotedWidgetView'
import {
getPromotedWidgetHostStateName,
isPromotedWidgetView
} from '@/core/graph/subgraph/promotedWidgetTypes'
import { t } from '@/i18n'
import type {
IContextMenuValue,