mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
feat: add ArtifactSlice and integrate artifact preview into skill editor tabs
Introduce a dedicated Zustand ArtifactSlice to manage artifact selection state with mutual exclusion against the main file tree. Artifact files from the sandbox can now be opened as tabs in the skill editor, rendered via a lightweight ArtifactContentPanel that reuses ReadOnlyFilePreview.
This commit is contained in:
@ -28,6 +28,20 @@ export const NODE_MENU_TYPE = {
|
||||
|
||||
export type NodeMenuType = (typeof NODE_MENU_TYPE)[keyof typeof NODE_MENU_TYPE]
|
||||
|
||||
export const ARTIFACT_TAB_PREFIX = 'artifact:' as const
|
||||
|
||||
export function isArtifactTab(tabId: string | null): boolean {
|
||||
return tabId?.startsWith(ARTIFACT_TAB_PREFIX) ?? false
|
||||
}
|
||||
|
||||
export function getArtifactPath(tabId: string): string {
|
||||
return tabId.slice(ARTIFACT_TAB_PREFIX.length)
|
||||
}
|
||||
|
||||
export function makeArtifactTabId(path: string): string {
|
||||
return `${ARTIFACT_TAB_PREFIX}${path}`
|
||||
}
|
||||
|
||||
export const SIDEBAR_MIN_WIDTH = 240
|
||||
export const SIDEBAR_MAX_WIDTH = 480
|
||||
export const SIDEBAR_DEFAULT_WIDTH = 320
|
||||
|
||||
Reference in New Issue
Block a user