@aryacode/dsh-arya-image-gen 0.0.0-stage → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/NOTICE +24 -0
- package/README.md +292 -2
- package/cordis.patch.yml +5 -0
- package/docs/assets/readme/canvas-edit.webp +0 -0
- package/docs/assets/readme/canvas-generate.webp +0 -0
- package/docs/assets/readme/chat-example.webp +0 -0
- package/docs/assets/readme/chat-generate.webp +0 -0
- package/docs/assets/readme/comfyui-workflows.webp +0 -0
- package/docs/assets/readme/gallery-management.webp +0 -0
- package/docs/assets/readme/hero-arya-wide.webp +0 -0
- package/docs/assets/readme/hero-arya.webp +0 -0
- package/docs/assets/readme/inspiration-arya.webp +0 -0
- package/docs/assets/readme/inspiration-library.webp +0 -0
- package/docs/assets/readme/install-arya.webp +0 -0
- package/docs/assets/readme/multi-model-compare.webp +0 -0
- package/docs/assets/readme/other-features.webp +0 -0
- package/docs/assets/readme/plugin-detail.webp +0 -0
- package/docs/assets/readme/plugins-entry.webp +0 -0
- package/docs/assets/readme/regenerating.webp +0 -0
- package/docs/assets/readme/revision-switcher.webp +0 -0
- package/docs/assets/readme/studio-arya.webp +0 -0
- package/docs/assets/readme/studio-workbench.webp +0 -0
- package/docs/assets/readme/workflow-overview-en.webp +0 -0
- package/docs/assets/readme/workflow-overview.webp +0 -0
- package/docs/workflows/arya-qwen-image-pack.zip +0 -0
- package/docs/workflows/qwen-image-compose.json +1 -0
- package/docs/workflows/qwen-image-create.json +142 -0
- package/docs/workflows/qwen-image-cutout.json +142 -0
- package/docs/workflows/qwen-image-edit.json +1 -0
- package/docs/workflows/qwen-image-remove-bg.json +1 -0
- package/lib/agent-toolset.js +51 -0
- package/lib/client.js +127081 -0
- package/lib/index.js +28598 -0
- package/lib/types/agent-preset/billion-context.d.ts +150 -0
- package/lib/types/agent-preset/definition.d.ts +75 -0
- package/lib/types/agent-preset/persona.d.ts +10 -0
- package/lib/types/agent-preset/register.d.ts +40 -0
- package/lib/types/agent-preset/toolset.d.ts +36 -0
- package/lib/types/baoyu-compose.d.ts +59 -0
- package/lib/types/canvas-asset-route.d.ts +12 -0
- package/lib/types/canvas-state-route.d.ts +37 -0
- package/lib/types/canvas-state.d.ts +80 -0
- package/lib/types/canvas-tools.d.ts +44 -0
- package/lib/types/client/browser-image-utils.d.ts +23 -0
- package/lib/types/client/conversation-image-revisions.d.ts +24 -0
- package/lib/types/client/conversation-regenerate.d.ts +8 -0
- package/lib/types/client/gallery-store.d.ts +137 -0
- package/lib/types/client/gallery-view.d.ts +255 -0
- package/lib/types/client/generation-activity.d.ts +62 -0
- package/lib/types/client/image-cache.d.ts +26 -0
- package/lib/types/client/image-ref.d.ts +31 -0
- package/lib/types/client/image-result-node.d.ts +81 -0
- package/lib/types/client/index.d.ts +113 -0
- package/lib/types/client/inspiration-catalog-cache.d.ts +4 -0
- package/lib/types/client/inspiration-image-cache.d.ts +3 -0
- package/lib/types/client/inspiration-style.d.ts +1 -0
- package/lib/types/client/inspiration-view.d.ts +9 -0
- package/lib/types/client/multi-model-compare.d.ts +20 -0
- package/lib/types/client/settings-state.d.ts +12 -0
- package/lib/types/client/settings-write.d.ts +4 -0
- package/lib/types/client/studio-style.d.ts +1 -0
- package/lib/types/client/studio-view.d.ts +48 -0
- package/lib/types/client/tl/canvas-selection.d.ts +13 -0
- package/lib/types/client/tl/canvas-sync.d.ts +30 -0
- package/lib/types/client/tl/conversation-landings.d.ts +48 -0
- package/lib/types/client/tl/css-supports-shim.d.ts +21 -0
- package/lib/types/client/tl/gallery-canvas-button.d.ts +10 -0
- package/lib/types/client/tl/gallery-image-transfer.d.ts +12 -0
- package/lib/types/client/tl/studio-tl-canvas.d.ts +16 -0
- package/lib/types/client/tl/tl-brand-theme.d.ts +10 -0
- package/lib/types/client/tl/tl-brand-tokens.d.ts +24 -0
- package/lib/types/client/tl/tl-canvas-bridge.d.ts +39 -0
- package/lib/types/client/tl/tl-css.d.ts +2 -0
- package/lib/types/client/tl/tl-theme-css.d.ts +17 -0
- package/lib/types/comfyui-progress.d.ts +78 -0
- package/lib/types/comfyui-server-route.d.ts +10 -0
- package/lib/types/comfyui-server.d.ts +61 -0
- package/lib/types/comfyui-workflow.d.ts +80 -0
- package/lib/types/comfyui.d.ts +52 -0
- package/lib/types/config.d.ts +87 -0
- package/lib/types/fetch-diagnostics.d.ts +10 -0
- package/lib/types/generated/default-workflows.d.ts +16 -0
- package/lib/types/image-route.d.ts +35 -0
- package/lib/types/image-tool-context.d.ts +3 -0
- package/lib/types/import-route.d.ts +16 -0
- package/lib/types/index.d.ts +16 -0
- package/lib/types/inspiration-route.d.ts +6 -0
- package/lib/types/inspiration.d.ts +92 -0
- package/lib/types/progress-route.d.ts +10 -0
- package/lib/types/redact.d.ts +2 -0
- package/lib/types/reference-image.d.ts +56 -0
- package/lib/types/reference-import.d.ts +66 -0
- package/lib/types/save-generated.d.ts +83 -0
- package/lib/types/settings-health.d.ts +6 -0
- package/lib/types/shared.d.ts +519 -0
- package/lib/types/studio-route.d.ts +15 -0
- package/lib/types/studio.d.ts +14 -0
- package/lib/types/validate-workflows.d.ts +48 -0
- package/lib/types/workspace-save.d.ts +103 -0
- package/package.json +143 -5
- package/skills/arya-image-references/SKILL.md +74 -0
- package/skills/arya-image-workflows/SKILL.md +75 -0
- package/skills/install-arya-image-gen/SKILL.md +28 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import './tl/css-supports-shim.js';
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import { type SettingsScopeSnapshot } from './settings-state.js';
|
|
4
|
+
export type { SettingsScopeSnapshot } from './settings-state.js';
|
|
5
|
+
export interface SettingsScope<T> {
|
|
6
|
+
getSnapshot(): SettingsScopeSnapshot<T>;
|
|
7
|
+
subscribe(listener: () => void): () => void;
|
|
8
|
+
/** New hosts return true/false; legacy settings scopes resolve to void. */
|
|
9
|
+
set(field: string, value: unknown): Promise<boolean | void>;
|
|
10
|
+
}
|
|
11
|
+
import type { InjectFace, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
12
|
+
import { type ComfyUIWorkflowEntry } from '../shared.js';
|
|
13
|
+
import { type LocaleService } from './gallery-view.js';
|
|
14
|
+
import { type ImageResultPresentation } from './image-result-node.js';
|
|
15
|
+
interface CredentialInfo {
|
|
16
|
+
configured?: boolean;
|
|
17
|
+
source?: string;
|
|
18
|
+
writable?: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface CredentialResult {
|
|
21
|
+
ok: boolean;
|
|
22
|
+
value?: Readonly<Record<string, CredentialInfo>>;
|
|
23
|
+
}
|
|
24
|
+
interface CredentialMutationResult {
|
|
25
|
+
ok: boolean;
|
|
26
|
+
error?: {
|
|
27
|
+
message?: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
interface CredentialsRemote {
|
|
31
|
+
describe(refs: string[]): Promise<CredentialResult>;
|
|
32
|
+
set(ref: string, value: string): Promise<CredentialMutationResult>;
|
|
33
|
+
/** Present only on modern hosts; feature-detected before use; undefined while degraded. */
|
|
34
|
+
unset?: ((ref: string) => Promise<CredentialMutationResult>) | undefined;
|
|
35
|
+
}
|
|
36
|
+
/** Notifies the settings card whenever any credential reference changes on the host. */
|
|
37
|
+
interface CredentialEvents {
|
|
38
|
+
listen(callback: () => void): () => void;
|
|
39
|
+
}
|
|
40
|
+
interface SettingsFace {
|
|
41
|
+
scope: SettingsScope<ImageSettings>;
|
|
42
|
+
credentials: CredentialsRemote;
|
|
43
|
+
/** False while the host core exposes no credentials service; the key UI degrades but the card stays mounted. */
|
|
44
|
+
credentialsAvailable: () => boolean;
|
|
45
|
+
locale?: LocaleService | undefined;
|
|
46
|
+
credentialEvents?: CredentialEvents | undefined;
|
|
47
|
+
}
|
|
48
|
+
interface ImageCardFace {
|
|
49
|
+
locale?: LocaleService | undefined;
|
|
50
|
+
promoted: boolean;
|
|
51
|
+
}
|
|
52
|
+
type SettingsCardProps = PropsRuntime<'settings.plugins.tab'> & InjectFace<SettingsFace>;
|
|
53
|
+
type ImageCardProps = PropsRuntime<'tool.call.toolview'> & InjectFace<ImageCardFace>;
|
|
54
|
+
interface ImageResultNodeProps {
|
|
55
|
+
node: {
|
|
56
|
+
data: {
|
|
57
|
+
results: readonly ImageResultPresentation[];
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
locale?: LocaleService | undefined;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Required browser services. The settings form reader is deliberately absent:
|
|
64
|
+
* DSH 0.1.7 serves it as `configForms` (keyed by the Loader entry id) while
|
|
65
|
+
* 0.1.5/0.1.6 expose `settingsScope` (keyed by the legacy namespace), so it is
|
|
66
|
+
* probed at runtime in `apply`. A static inject of either name would park this
|
|
67
|
+
* fiber forever on hosts from the other generation — the issue #55 failure.
|
|
68
|
+
*/
|
|
69
|
+
export declare const inject: string[];
|
|
70
|
+
/** Mount the settings card, generated-image card, and native conversation gallery view. */
|
|
71
|
+
export declare function apply(ctx: Context): void;
|
|
72
|
+
/** Settings persisted by this card; the workbench and tools read the same fields. */
|
|
73
|
+
interface ImageSettings {
|
|
74
|
+
comfyuiBaseURL?: string;
|
|
75
|
+
comfyuiWorkflows?: ComfyUIWorkflowEntry[];
|
|
76
|
+
comfyuiActiveWorkflow?: string;
|
|
77
|
+
comfyuiActiveTextWorkflow?: string;
|
|
78
|
+
comfyuiActiveEditWorkflow?: string;
|
|
79
|
+
comfyuiWorkflowJson?: string;
|
|
80
|
+
comfyuiWorkflowName?: string;
|
|
81
|
+
comfyuiTimeoutMs?: number;
|
|
82
|
+
/** Optional request headers as a JSON object, e.g. a reverse-proxy token. */
|
|
83
|
+
comfyuiHeadersJson?: string;
|
|
84
|
+
comfyuiPythonExe?: string;
|
|
85
|
+
comfyuiServerDir?: string;
|
|
86
|
+
comfyuiExtraArgs?: string;
|
|
87
|
+
comfyuiAutoStart?: boolean;
|
|
88
|
+
comfyuiLaunchMode?: 'auto' | 'scheduled-task' | 'process';
|
|
89
|
+
comfyuiScheduledTaskName?: string;
|
|
90
|
+
saveToWorkspace?: boolean;
|
|
91
|
+
workspaceFolder?: string;
|
|
92
|
+
}
|
|
93
|
+
/** Mount the settings card, generated-image card, and native conversation gallery view. */
|
|
94
|
+
export declare function ImageGenerationSettingsCard(props: SettingsCardProps): JSX.Element;
|
|
95
|
+
/**
|
|
96
|
+
* The "Generating image" panel above the composer.
|
|
97
|
+
*
|
|
98
|
+
* Lives in the composer dock rather than in the tool card so it stays visible
|
|
99
|
+
* while the conversation shows the thinking row and the tool call is folded
|
|
100
|
+
* away. The thumbnail is the live ComfyUI latent preview; before the first
|
|
101
|
+
* frame arrives it is an animated canvas, so the panel still reads as work in
|
|
102
|
+
* progress instead of an empty box.
|
|
103
|
+
*/
|
|
104
|
+
export declare function GenerationDock(props: {
|
|
105
|
+
sessionId?: string;
|
|
106
|
+
locale?: LocaleService;
|
|
107
|
+
}): JSX.Element | null;
|
|
108
|
+
/** Keep the legacy Tool row for old DSH and hand modern results to the independent Chat node. */
|
|
109
|
+
export declare function GeneratedImageCard(props: ImageCardProps): import("react").JSX.Element;
|
|
110
|
+
/** Suppress the folded duplicate on modern hosts; render every image on legacy hosts. */
|
|
111
|
+
export declare function GeneratedImagesCard(props: ImageCardProps): import("react").JSX.Element;
|
|
112
|
+
/** Render modern image artifacts as final conversation output instead of Tool process content. */
|
|
113
|
+
export declare function PromotedImageResultNode(props: ImageResultNodeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Keep a manually refreshed public catalog available across plugin restarts. */
|
|
2
|
+
import type { InspirationCatalog } from '../inspiration.js';
|
|
3
|
+
export declare function loadCachedInspirationCatalog(): Promise<InspirationCatalog | undefined>;
|
|
4
|
+
export declare function saveCachedInspirationCatalog(catalog: InspirationCatalog): Promise<void>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function fetchInspirationImage(sourceId: string, caseId: string, rev?: string): Promise<Blob>;
|
|
2
|
+
export declare function evictInspirationImage(sourceId: string, caseId: string, rev?: string): Promise<void>;
|
|
3
|
+
export declare function clearInspirationImageCache(): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const INSPIRATION_STYLE = "\n.dsh-ig-inspiration{--inspiration-blue:#2f64f5;--inspiration-ink:#172033;--inspiration-muted:#718099;--inspiration-line:color-mix(in srgb,currentColor 11%,transparent);min-height:100%;padding:18px 24px 26px;background:radial-gradient(ellipse 80% 45% at 50% -20%,rgba(47,100,245,.12),transparent 70%),var(--dsw-alias-bg-layer-1,#fff);color:var(--foreground,var(--inspiration-ink));box-sizing:border-box}\n.dsh-ig-inspiration-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:18px}.dsh-ig-inspiration-head-actions{display:flex;align-items:center;gap:8px}.dsh-ig-inspiration-kicker{margin:0 0 4px;color:var(--inspiration-blue);font-size:11px;letter-spacing:.08em;font-weight:700;text-transform:uppercase}.dsh-ig-inspiration-head h1{margin:0;font-size:18px;letter-spacing:-.025em;line-height:1.25}.dsh-ig-inspiration-subtitle{margin:5px 0 0;color:var(--inspiration-muted);font-size:12px;line-height:1.5}.dsh-ig-inspiration-refresh,.dsh-ig-inspiration-clear-cache{height:32px;padding:0 11px;display:inline-flex;align-items:center;gap:6px;border:1px solid var(--inspiration-line);border-radius:7px;background:var(--dsw-alias-bg-layer-1,#fff);color:var(--inspiration-muted);font:inherit;font-size:12px;white-space:nowrap;cursor:pointer;transition:all .15s ease}.dsh-ig-inspiration-refresh:hover:not(:disabled){border-color:rgba(47,100,245,.42);color:var(--inspiration-blue);background:rgba(47,100,245,.04)}.dsh-ig-inspiration-clear-cache:hover:not(:disabled){border-color:rgba(239,68,68,.4);color:#ef4444;background:rgba(239,68,68,.04)}.dsh-ig-inspiration-refresh:disabled,.dsh-ig-inspiration-clear-cache:disabled{opacity:.55;cursor:wait}\n.dsh-ig-inspiration-toolbar{display:grid;grid-template-columns:minmax(180px,1fr) auto repeat(3,minmax(110px,140px));gap:8px;padding:10px;border:1px solid var(--inspiration-line);border-radius:10px;background:color-mix(in srgb,var(--dsw-alias-bg-layer-1,#fff) 90%,#edf2ff);margin-bottom:16px}.dsh-ig-inspiration-search{min-width:0;position:relative}.dsh-ig-inspiration-search svg{position:absolute;left:10px;top:50%;transform:translateY(-50%);color:#8995aa}.dsh-ig-inspiration-toolbar input,.dsh-ig-inspiration-toolbar select{width:100%;height:34px;box-sizing:border-box;border:1px solid transparent;border-radius:6px;background:var(--dsw-alias-bg-layer-1,#fff);color:inherit;padding:0 9px;font:inherit;font-size:12px;outline:none}.dsh-ig-inspiration-toolbar input{padding-left:31px}.dsh-ig-inspiration-toolbar input:focus,.dsh-ig-inspiration-toolbar select:focus{border-color:var(--inspiration-blue);box-shadow:0 0 0 3px rgba(47,100,245,.1)}\n.dsh-ig-inspiration-fav-filter{height:34px;padding:0 12px;display:inline-flex;align-items:center;gap:6px;border:1px solid var(--inspiration-line);border-radius:6px;background:var(--dsw-alias-bg-layer-1,#fff);color:var(--inspiration-muted);font:inherit;font-size:12px;cursor:pointer;white-space:nowrap;transition:all .15s ease}.dsh-ig-inspiration-fav-filter:hover{border-color:rgba(47,100,245,.4);color:var(--inspiration-blue)}.dsh-ig-inspiration-fav-filter.is-active{background:#eef3ff;border-color:var(--inspiration-blue);color:var(--inspiration-blue);font-weight:600}.fill-star{fill:currentColor}\n.dsh-ig-inspiration-catnav{position:sticky;top:0;z-index:6;display:flex;flex-wrap:wrap;gap:6px;margin:0 0 14px;padding:8px;border:1px solid var(--inspiration-line);border-radius:10px;background:color-mix(in srgb,var(--dsw-alias-bg-layer-1,#fff) 92%,#edf2ff);backdrop-filter:blur(8px)}\n.dsh-ig-inspiration-catnav-chip{height:26px;padding:0 11px;display:inline-flex;align-items:center;gap:6px;border:1px solid var(--inspiration-line);border-radius:999px;background:var(--dsw-alias-bg-layer-1,#fff);color:var(--inspiration-muted);font:inherit;font-size:11px;font-weight:600;cursor:pointer;white-space:nowrap;transition:all .15s ease}.dsh-ig-inspiration-catnav-chip em{font-style:normal;font-size:10px;opacity:.75}.dsh-ig-inspiration-catnav-chip:hover:not(:disabled){border-color:rgba(47,100,245,.46);color:var(--inspiration-blue)}.dsh-ig-inspiration-catnav-chip.is-active{border-color:var(--inspiration-blue);background:#eef3ff;color:var(--inspiration-blue)}.dsh-ig-inspiration-catnav-chip:disabled{opacity:.4;cursor:default}\n.dsh-ig-inspiration-group{margin:0}\n.dsh-ig-inspiration-group-head{position:sticky;top:48px;z-index:5;display:flex;align-items:center;gap:8px;margin:6px 0 10px;padding:7px 2px;font-size:12px;font-weight:700;letter-spacing:.02em;color:var(--inspiration-ink);background:color-mix(in srgb,var(--dsw-alias-bg-layer-1,#fff) 86%,transparent);backdrop-filter:blur(6px);scroll-margin-top:48px}.dsh-ig-inspiration-group-head em{font-style:normal;font-weight:600;font-size:10.5px;color:var(--inspiration-muted)}\n.dsh-ig-inspiration-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,310px);gap:18px;align-items:start}.dsh-ig-inspiration-summary{height:24px;display:flex;align-items:center;justify-content:space-between;color:var(--inspiration-muted);font-size:11.5px}.dsh-ig-inspiration-summary strong{color:inherit;font-weight:650}.dsh-ig-inspiration-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(185px,1fr));gap:12px}.dsh-ig-inspiration-card{position:relative;min-width:0;padding:0;border:1px solid var(--inspiration-line);border-radius:10px;overflow:hidden;background:var(--dsw-alias-bg-layer-1,#fff);text-align:left;cursor:pointer;transition:transform .16s ease,border-color .16s ease,box-shadow .16s ease;content-visibility:auto;contain-intrinsic-size:245px}.dsh-ig-inspiration-card:hover,.dsh-ig-inspiration-card.is-selected{border-color:rgba(47,100,245,.58);box-shadow:0 8px 22px rgba(37,62,123,.11)}.dsh-ig-inspiration-card:hover{transform:translateY(-2px)}.dsh-ig-inspiration-card.is-selected:after{content:'';position:absolute;inset:0;border:2px solid var(--inspiration-blue);border-radius:9px;pointer-events:none}.dsh-ig-inspiration-visual{aspect-ratio:1/1;position:relative;background:linear-gradient(135deg,#f0f4fc,#e3eafa);overflow:hidden}.dsh-ig-inspiration-visual img{width:100%;height:100%;object-fit:cover;display:block}.dsh-ig-inspiration-image-placeholder{height:100%;display:grid;place-items:center;color:#8a99b3}.dsh-ig-inspiration-image-placeholder.is-error{font-size:11px;padding:10px;text-align:center}.dsh-ig-inspiration-card-copy{padding:9px 10px 10px}.dsh-ig-inspiration-card-copy strong{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:17px}.dsh-ig-inspiration-card-copy span{display:block;margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--inspiration-muted);font-size:10.5px}.dsh-ig-inspiration-featured{position:absolute;top:8px;left:8px;display:inline-flex;align-items:center;gap:3px;padding:3px 6px;border-radius:999px;background:rgba(20,31,52,.72);backdrop-filter:blur(5px);color:#fff;font-size:10px;font-weight:600;z-index:1}.dsh-ig-inspiration-card-star{position:absolute;top:8px;right:8px;width:26px;height:26px;border-radius:50%;background:rgba(20,31,52,.6);backdrop-filter:blur(4px);border:none;color:#fff;display:grid;place-items:center;cursor:pointer;z-index:2;opacity:0;transition:opacity .15s,transform .15s}.dsh-ig-inspiration-card:hover .dsh-ig-inspiration-card-star,.dsh-ig-inspiration-card-star.is-favorited{opacity:1}.dsh-ig-inspiration-card-star.is-favorited{color:#f59e0b;background:rgba(20,31,52,.85)}.dsh-ig-inspiration-card-star:hover{transform:scale(1.15)}\n.dsh-ig-inspiration-empty{min-height:310px;display:grid;place-items:center;padding:30px;text-align:center;color:var(--inspiration-muted);border:1px dashed var(--inspiration-line);border-radius:10px;font-size:12px}\n.dsh-ig-inspiration-empty.is-catalog-error{display:flex;flex-direction:column;gap:12px;color:var(--inspiration-text)}\n.dsh-ig-inspiration-empty.is-catalog-error p{margin:0;font-size:13px;color:var(--inspiration-muted)}\n.dsh-ig-inspiration-toast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%);display:inline-flex;align-items:center;gap:7px;padding:9px 16px;border-radius:999px;background:rgba(15,23,42,.92);backdrop-filter:blur(8px);color:#fff;font-size:12px;font-weight:500;box-shadow:0 10px 30px rgba(0,0,0,.35);z-index:9999;animation:dsh-ig-slide-up .2s ease}\n.dsh-ig-inspiration-toast.is-error{background:rgba(185,28,28,.92)}\n@keyframes dsh-ig-slide-up{from{opacity:0;transform:translate(-50%,12px)}to{opacity:1;transform:translate(-50%,0)}}\n.dsh-ig-inspiration-modal-backdrop{position:fixed;inset:0;z-index:10001;background:rgba(15,23,42,.6);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;padding:16px;box-sizing:border-box}\n.dsh-ig-inspiration-modal{width:100%;max-width:400px;background:var(--dsw-alias-bg-layer-1,#fff);border:1px solid var(--inspiration-line);border-radius:12px;padding:22px;box-shadow:0 24px 60px rgba(0,0,0,.3);animation:dsh-ig-scale-in .15s ease}\n@keyframes dsh-ig-scale-in{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}\n.dsh-ig-inspiration-modal h3{margin:0 0 8px;font-size:15px;font-weight:650;color:inherit}\n.dsh-ig-inspiration-modal p{margin:0 0 20px;color:var(--inspiration-muted);font-size:12.5px;line-height:1.55}\n.dsh-ig-inspiration-modal-actions{display:flex;justify-content:flex-end;gap:10px}\n.dsh-ig-inspiration-modal-btn{height:34px;padding:0 14px;border-radius:7px;border:1px solid var(--inspiration-line);background:var(--dsw-alias-bg-layer-1,#fff);color:inherit;font:inherit;font-size:12px;font-weight:600;cursor:pointer;transition:all .15s ease}\n.dsh-ig-inspiration-modal-btn:hover{background:color-mix(in srgb,currentColor 6%,transparent)}\n.dsh-ig-inspiration-modal-btn.is-danger{background:#ef4444;border-color:#ef4444;color:#fff}\n.dsh-ig-inspiration-modal-btn.is-danger:hover{background:#dc2626}\n.dsh-ig-inspiration-modal-btn:disabled{opacity:.5;cursor:wait}\n.dsh-ig-inspiration-retry-btn{border:none;background:rgba(47,100,245,.08);color:var(--inspiration-blue);padding:6px 12px;border-radius:6px;font:inherit;font-size:11px;font-weight:600;cursor:pointer;transition:background .15s}\n.dsh-ig-inspiration-retry-btn:hover{background:rgba(47,100,245,.18)}\n.dsh-ig-inspiration-end-hint{display:flex;align-items:center;justify-content:center;padding:24px 0 16px;color:var(--inspiration-muted);font-size:12px}\n.dsh-ig-inspiration-inspector{position:sticky;top:0;overflow:hidden;border:1px solid var(--inspiration-line);border-radius:11px;background:var(--dsw-alias-bg-layer-1,#fff);box-shadow:0 9px 28px rgba(27,45,88,.06)}.dsh-ig-inspiration-inspector-empty{min-height:310px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;padding:22px;color:var(--inspiration-muted);font-size:12px;text-align:center}.dsh-ig-inspiration-inspector-image{aspect-ratio:16/10;background:#f1f4fa;position:relative;cursor:zoom-in}.dsh-ig-inspiration-inspector-image img{width:100%;height:100%;object-fit:cover}.dsh-ig-inspiration-inspector-zoom-hint{position:absolute;bottom:8px;right:8px;display:inline-flex;align-items:center;gap:4px;padding:4px 8px;border-radius:6px;background:rgba(15,23,42,.75);backdrop-filter:blur(5px);color:#fff;font-size:10.5px;font-weight:500;opacity:0;transition:opacity .15s ease;pointer-events:none}.dsh-ig-inspiration-inspector-image:hover .dsh-ig-inspiration-inspector-zoom-hint{opacity:1}.dsh-ig-inspiration-inspector-body{padding:14px}.dsh-ig-inspiration-inspector-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.dsh-ig-inspiration-inspector-body h2{margin:0;font-size:14px;line-height:1.4;flex:1}.dsh-ig-inspiration-inspector-fav{width:30px;height:30px;flex-shrink:0;border:1px solid var(--inspiration-line);border-radius:7px;background:var(--dsw-alias-bg-layer-1,#fff);color:var(--inspiration-muted);display:grid;place-items:center;cursor:pointer;transition:all .15s ease}.dsh-ig-inspiration-inspector-fav:hover{border-color:rgba(245,158,11,.4);color:#f59e0b}.dsh-ig-inspiration-inspector-fav.is-favorited{color:#f59e0b;border-color:rgba(245,158,11,.5);background:rgba(245,158,11,.08)}.dsh-ig-inspiration-origin{margin:5px 0 12px;color:var(--inspiration-muted);font-size:11px}.dsh-ig-inspiration-tags{display:flex;flex-wrap:wrap;gap:5px;margin:0 0 12px}.dsh-ig-inspiration-tags span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:3px 6px;border-radius:4px;background:#eef3ff;color:#3e5fb8;font-size:10px}.dsh-ig-inspiration-prompt-label{display:flex;align-items:center;justify-content:space-between;margin:0 0 6px;color:var(--inspiration-muted);font-size:10.5px;font-weight:650}.dsh-ig-inspiration-prompt{max-height:155px;margin:0;padding:9px;overflow:auto;white-space:pre-wrap;border:1px solid var(--inspiration-line);border-radius:7px;background:color-mix(in srgb,var(--dsw-alias-bg-layer-2,#f8fafc) 90%,#e9efff);font-size:11px;line-height:1.55;color:#526078}.dsh-ig-inspiration-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:12px}.dsh-ig-inspiration-actions button,.dsh-ig-inspiration-source-link{height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--inspiration-line);border-radius:7px;background:var(--dsw-alias-bg-layer-1,#fff);color:#536075;font:inherit;font-size:11.5px;font-weight:600;cursor:pointer;text-decoration:none}.dsh-ig-inspiration-actions button:hover,.dsh-ig-inspiration-source-link:hover{border-color:rgba(47,100,245,.46);color:var(--inspiration-blue)}.dsh-ig-inspiration-actions .dsh-ig-inspiration-use{grid-column:1/-1;border-color:var(--inspiration-blue);background:linear-gradient(135deg,#386cf6,#2758e7);color:#fff;box-shadow:0 7px 15px rgba(47,100,245,.2)}.dsh-ig-inspiration-actions .dsh-ig-inspiration-use:hover{color:#fff;transform:translateY(-1px)}\n.dsh-ig-inspiration-lightbox{position:fixed;inset:0;z-index:10000;background:rgba(8,12,22,.88);backdrop-filter:blur(8px);display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box}.dsh-ig-inspiration-lightbox-content{position:relative;max-width:90vw;max-height:90vh;display:flex;flex-direction:column;align-items:center}.dsh-ig-inspiration-lightbox-img-wrap{max-width:85vw;max-height:82vh;border-radius:10px;overflow:hidden;box-shadow:0 25px 60px rgba(0,0,0,.7);background:#05070d}.dsh-ig-inspiration-lightbox-img-wrap img{width:auto;height:auto;max-width:85vw;max-height:82vh;object-fit:contain;display:block}.dsh-ig-inspiration-lightbox-close{position:absolute;top:-16px;right:-16px;width:34px;height:34px;border-radius:50%;background:#1e293b;color:#fff;border:1px solid rgba(255,255,255,.2);cursor:pointer;display:grid;place-items:center;transition:background .15s,transform .15s;z-index:10}.dsh-ig-inspiration-lightbox-close:hover{background:#334155;transform:scale(1.1)}.dsh-ig-inspiration-lightbox-caption{margin-top:12px;color:rgba(255,255,255,.9);font-size:13px;font-weight:500;text-shadow:0 2px 4px rgba(0,0,0,.6)}\n.dsh-ig-inspiration-sources{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:10px}.dsh-ig-inspiration-source-chip{height:30px;padding:0 13px;display:inline-flex;align-items:center;border:1px solid var(--inspiration-line);border-radius:999px;background:var(--dsw-alias-bg-layer-1,#fff);color:var(--inspiration-muted);font:inherit;font-size:11.5px;font-weight:600;cursor:pointer;transition:all .15s ease}.dsh-ig-inspiration-source-chip:hover{border-color:rgba(47,100,245,.46);color:var(--inspiration-blue)}.dsh-ig-inspiration-source-chip.is-active{border-color:var(--inspiration-blue);background:linear-gradient(135deg,#386cf6,#2758e7);color:#fff;box-shadow:0 5px 12px rgba(47,100,245,.22)}\n.dsh-ig-inspiration-actions .dsh-ig-inspiration-use.is-secondary{grid-column:1/-1;border-color:rgba(47,100,245,.5);background:var(--dsw-alias-bg-layer-1,#fff);color:var(--inspiration-blue);box-shadow:none}.dsh-ig-inspiration-actions .dsh-ig-inspiration-use.is-secondary:hover{color:#2758e7;transform:translateY(-1px)}.dsh-ig-inspiration-actions .dsh-ig-inspiration-use.is-secondary:disabled{opacity:.6;cursor:wait;transform:none}\n@media(max-width:980px){.dsh-ig-inspiration-layout{grid-template-columns:1fr}.dsh-ig-inspiration-inspector{position:relative;top:auto}.dsh-ig-inspiration-inspector-empty{min-height:150px}.dsh-ig-inspiration-inspector-image{max-height:290px}.dsh-ig-inspiration-inspector-image img{object-fit:contain;background:#f1f4fa}}@media(max-width:700px){.dsh-ig-inspiration{padding:14px}.dsh-ig-inspiration-head{align-items:center}.dsh-ig-inspiration-toolbar{grid-template-columns:1fr 1fr}.dsh-ig-inspiration-search{grid-column:1/-1}.dsh-ig-inspiration-fav-filter{grid-column:1/-1}.dsh-ig-inspiration-grid{grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:9px}}@media(max-width:420px){.dsh-ig-inspiration-toolbar{grid-template-columns:1fr}.dsh-ig-inspiration-search{grid-column:auto}}\n\n.dsh-ig-inspiration-source-chip svg{flex-shrink:0}\n.dsh-ig-baoyu-panel{border:1px solid var(--inspiration-line);border-radius:11px;background:var(--dsw-alias-bg-layer-1,#fff);padding:18px;display:flex;flex-direction:column;gap:14px}\n.dsh-ig-baoyu-intro{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}\n.dsh-ig-baoyu-combos{font-size:12px;color:var(--inspiration-blue)}\n.dsh-ig-baoyu-hint{font-size:11px;color:var(--inspiration-muted)}\n.dsh-ig-baoyu-dim{display:flex;flex-direction:column;gap:7px}\n.dsh-ig-baoyu-dim-head{font-size:11px;font-weight:650;color:var(--inspiration-muted);letter-spacing:.02em}\n.dsh-ig-baoyu-chips{display:flex;flex-wrap:wrap;gap:6px}\n.dsh-ig-baoyu-chip{height:28px;padding:0 10px;display:inline-flex;align-items:center;gap:6px;border:1px solid var(--inspiration-line);border-radius:999px;background:var(--dsw-alias-bg-layer-1,#fff);color:#536075;font:inherit;font-size:11px;font-weight:600;cursor:pointer;transition:all .15s ease}\n.dsh-ig-baoyu-chip:hover{border-color:rgba(47,100,245,.46);color:var(--inspiration-blue)}\n.dsh-ig-baoyu-chip.is-active{border-color:var(--inspiration-blue);background:rgba(47,100,245,.09);color:var(--inspiration-blue)}\n.dsh-ig-baoyu-swatch{display:inline-flex;gap:2px}\n.dsh-ig-baoyu-swatch i{width:9px;height:9px;border-radius:50%;border:1px solid rgba(15,23,42,.15);display:block}\n.dsh-ig-baoyu-title-input{height:34px;flex:1;padding:0 11px;border:1px solid var(--inspiration-line);border-radius:7px;background:var(--dsw-alias-bg-layer-1,#fff);color:inherit;font:inherit;font-size:12px}\n.dsh-ig-baoyu-title-input:focus{outline:none;border-color:rgba(47,100,245,.55)}\n.dsh-ig-baoyu-title-input:disabled{opacity:.45}\n.dsh-ig-baoyu-required{color:#dc2626;font-size:11px}\n.dsh-ig-baoyu-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}\n.dsh-ig-baoyu-btn{height:34px;padding:0 14px;display:inline-flex;align-items:center;gap:6px;border:1px solid var(--inspiration-line);border-radius:7px;background:var(--dsw-alias-bg-layer-1,#fff);color:#536075;font:inherit;font-size:11.5px;font-weight:600;cursor:pointer;transition:all .15s ease}\n.dsh-ig-baoyu-btn:hover{border-color:rgba(47,100,245,.46);color:var(--inspiration-blue)}\n.dsh-ig-baoyu-btn:disabled{opacity:.5;cursor:not-allowed}\n.dsh-ig-baoyu-btn.is-primary{border-color:var(--inspiration-blue);background:linear-gradient(135deg,#386cf6,#2758e7);color:#fff;box-shadow:0 7px 15px rgba(47,100,245,.2)}\n.dsh-ig-baoyu-btn.is-primary:hover{color:#fff;transform:translateY(-1px)}\n.dsh-ig-baoyu-btn.is-primary:disabled{opacity:.5;cursor:not-allowed;transform:none}\n.dsh-ig-baoyu-preview-block{display:flex;flex-direction:column;gap:6px}\n.dsh-ig-baoyu-preview-head{font-size:11px;font-weight:650;color:var(--inspiration-muted)}\n.dsh-ig-baoyu-preview{max-height:260px;margin:0;padding:12px;overflow:auto;white-space:pre-wrap;border:1px solid var(--inspiration-line);border-radius:7px;background:color-mix(in srgb,var(--dsw-alias-bg-layer-2,#f8fafc) 90%,#e9efff);font-size:11px;line-height:1.6;color:#526078}\n";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import type { InspirationCatalog } from '../inspiration.js';
|
|
3
|
+
import type { LocaleService } from './gallery-view.js';
|
|
4
|
+
export declare const InspirationView: FC<{
|
|
5
|
+
locale?: LocaleService | undefined;
|
|
6
|
+
onUsePrompt(prompt: string): void;
|
|
7
|
+
onUseReference?: ((file: File, prompt: string) => void) | undefined;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function resolveActiveCatalog(bundled?: InspirationCatalog, cached?: InspirationCatalog): InspirationCatalog | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { StudioOption, StudioProviderProfile } from '../shared.js';
|
|
2
|
+
export interface ComparisonTarget {
|
|
3
|
+
profile: StudioProviderProfile;
|
|
4
|
+
ratio: string;
|
|
5
|
+
quality: string;
|
|
6
|
+
adjusted: boolean;
|
|
7
|
+
resolution?: string;
|
|
8
|
+
generationQuality?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Every workflow is a comparison target; the shared prompt runs on each. */
|
|
11
|
+
export declare function buildComparisonTargets(profiles: readonly StudioProviderProfile[], selectedTargets: readonly string[], ratio?: string, quality?: string, output?: {
|
|
12
|
+
resolution: string;
|
|
13
|
+
generationQuality: string;
|
|
14
|
+
}): ComparisonTarget[];
|
|
15
|
+
/** Start with two workflows, not every imported one, to keep runs bounded. */
|
|
16
|
+
export declare function initialComparisonProviders(profiles: readonly StudioProviderProfile[], activeWorkflow?: string, _activeChannel?: string): string[];
|
|
17
|
+
/** ComfyUI exposes no shared pickers; kept so the workbench UI compiles unchanged. */
|
|
18
|
+
export declare function comparisonOptionUnion(_profiles: readonly StudioProviderProfile[], _key: 'ratioOptions' | 'qualityOptions'): StudioOption[];
|
|
19
|
+
/** ComfyUI exposes no shared resolution or quality pickers. */
|
|
20
|
+
export declare function comparisonOutputOptions(_profiles: readonly StudioProviderProfile[], _ratio: string, _kind: 'resolution' | 'generationQuality'): StudioOption[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Preserve modern form states while accepting legacy scopes without status/mode. */
|
|
2
|
+
import { type SettingsHealth } from '../shared.js';
|
|
3
|
+
export interface SettingsScopeSnapshot<T> {
|
|
4
|
+
value: T | undefined;
|
|
5
|
+
writable: boolean;
|
|
6
|
+
status?: 'loading' | 'ready' | 'unavailable';
|
|
7
|
+
mode?: 'host' | 'memory';
|
|
8
|
+
}
|
|
9
|
+
export type SettingsState = 'ready' | 'loading' | 'remote' | 'unavailable' | 'readOnly' | 'incompatible';
|
|
10
|
+
export declare function settingsState(snapshot: SettingsScopeSnapshot<unknown>, health?: SettingsHealth): SettingsState;
|
|
11
|
+
/** A failed probe cannot identify the cause; keep the host's own form state. */
|
|
12
|
+
export declare function fetchSettingsHealth(signal: AbortSignal): Promise<SettingsHealth | undefined>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** DSH 0.1.7 resolves refused writes to false; older settings scopes resolve to void. */
|
|
2
|
+
export declare function writeSetting(scope: {
|
|
3
|
+
set(field: string, value: unknown): Promise<boolean | void>;
|
|
4
|
+
}, field: string, value: unknown, rejectedMessage: string): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const STUDIO_STYLE = "\n.dsh-ig-recent-select{display:block;width:100%;height:100%;padding:0;border:0;border-radius:inherit;background:transparent;cursor:pointer}\n.dsh-ig-recent-send{position:absolute;right:3px;bottom:3px;display:flex;align-items:center;justify-content:center;width:25px;height:25px;padding:0;border:1px solid var(--ig-line);border-radius:5px;background:var(--ig-bg-panel);cursor:pointer}\n.dsh-ig-recent-send:disabled{opacity:.45;cursor:not-allowed}\n.dsh-ig-gallery-page-body.is-workbench{flex:1 1 0;height:100%;min-height:0;padding:0;overflow:hidden;display:flex;flex-direction:column}\n.dsh-ig-workbench{--ig-blue:var(--dsw-alias-brand-primary-new-colorprimary-new-color,#2f64f5);--ig-blue-line:color-mix(in srgb,var(--ig-blue) 45%,transparent);--ig-line:var(--dsw-alias-border-l2,color-mix(in srgb,currentColor 11%,transparent));--ig-soft:color-mix(in srgb,currentColor 4%,transparent);--ig-fg:var(--dsw-alias-label-primary,var(--foreground,#182033));--ig-fg-2:var(--dsw-alias-label-secondary,#5a6478);--ig-fg-3:var(--dsw-alias-label-tertiary,#717b90);--ig-fg-cap:var(--dsw-alias-label-caption,#929bad);--ig-bg:var(--dsw-alias-bg-layer-1,var(--background,#fff));--ig-bg-panel:var(--dsw-alias-bg-layer-2,color-mix(in srgb,var(--background,#fff) 96%,#f5f7fb));--ig-bg-thumb:var(--dsw-alias-bg-skeleton,#eef1f7);--ig-danger:#b63737;--ig-warn:#8b671c;position:relative;display:flex;flex-direction:column;min-height:0;height:100%;overflow:hidden;padding:10px 12px 12px;color:var(--ig-fg);box-sizing:border-box;background:radial-gradient(circle at 60% -20%,rgba(63,104,246,.07),transparent 30%)}\nbody[data-ds-dark-theme] .dsh-ig-workbench{--ig-danger:#f08c8c;--ig-warn:#e5b76a}\n.dsh-ig-workbench *{box-sizing:border-box}.dsh-ig-workbench button,.dsh-ig-workbench select,.dsh-ig-workbench textarea{font:inherit;color:inherit}\n.dsh-ig-workbench-grid{display:grid;grid-template-columns:minmax(190px,238px) minmax(0,1fr) minmax(286px,340px);grid-template-rows:minmax(0,1fr);min-height:0;height:0;flex:1 1 0;border:1px solid var(--ig-line);border-radius:12px;overflow:hidden;background:var(--ig-bg);box-shadow:0 12px 32px rgba(30,42,76,.05);transition:grid-template-columns .2s ease}\n.dsh-ig-workbench-grid.is-sidebar-collapsed{grid-template-columns:minmax(0,1fr) minmax(286px,340px)}\n.dsh-ig-workbench-grid.is-generate-collapsed{grid-template-columns:minmax(190px,238px) minmax(0,1fr)}\n.dsh-ig-workbench-grid.is-sidebar-collapsed.is-generate-collapsed{grid-template-columns:minmax(0,1fr)}\n.dsh-ig-recent-panel,.dsh-ig-generate-panel{min-width:0;min-height:0;overflow:hidden;background:var(--ig-bg-panel)}.dsh-ig-recent-panel{display:flex;flex-direction:column;border-right:1px solid var(--ig-line)}\n.dsh-ig-panel-title{height:48px;flex:0 0 48px;padding:0 12px 0 14px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--ig-line);font-size:13px;font-weight:650}\n.dsh-ig-count-badge{font-size:11px;min-width:22px;text-align:center;padding:2px 6px;border-radius:999px;background:var(--ig-soft);color:var(--ig-fg-3);font-weight:500}\n.dsh-ig-collapse-btn{width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--ig-fg-3);cursor:pointer;transition:all .15s}\n.dsh-ig-collapse-btn:hover{border-color:var(--ig-line);background:var(--ig-soft);color:var(--ig-fg)}\n.dsh-ig-recent-scroll{flex:1 1 0;height:0;padding:8px;overflow-x:hidden;overflow-y:auto;min-height:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(78px,1fr));gap:6px;align-content:start}.dsh-ig-recent-empty{min-height:180px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:10px;color:var(--ig-fg-cap);text-align:center;font-size:12px;grid-column:1/-1}\n.dsh-ig-fav-folder-add{margin-left:auto;padding:0 5px;border:0;background:transparent;color:var(--ig-fg-3);font-size:12px;line-height:16px;cursor:pointer;border-radius:4px}.dsh-ig-fav-folder-add:hover{color:var(--ig-blue);background:var(--ig-bg-thumb)}\n.dsh-ig-fav-folders{display:flex;flex-wrap:wrap;gap:4px;margin:4px 0 6px}\n.dsh-ig-fav-folder-chip{display:inline-flex;align-items:center;gap:2px;padding:2px 6px;border:1px solid var(--ig-line);border-radius:999px;background:transparent;color:var(--ig-fg-3);font-size:10.5px}\n.dsh-ig-fav-folder-chip.is-active{border-color:var(--ig-blue-line);color:var(--ig-blue);background:color-mix(in srgb,var(--ig-blue) 10%,transparent)}\n.dsh-ig-fav-folder-chip>button:first-child{border:0;background:transparent;color:inherit;font-size:inherit;padding:0;cursor:pointer}\n.dsh-ig-fav-folder-del{border:0;background:transparent;color:var(--ig-fg-3);cursor:pointer;display:inline-flex;padding:0}.dsh-ig-fav-folder-del:hover{color:var(--ig-danger)}\n.dsh-ig-fav-folder-draft{display:flex;gap:4px;margin:2px 0 6px}\n.dsh-ig-fav-folder-draft input{flex:1;min-width:0;padding:3px 6px;border:1px solid var(--ig-line);border-radius:5px;background:var(--ig-bg);color:var(--ig-fg);font-size:11px}\n.dsh-ig-fav-folder-draft button{padding:3px 8px;border:1px solid var(--ig-line);border-radius:5px;background:transparent;color:var(--ig-fg-2);font-size:11px;cursor:pointer}\n.dsh-ig-fav-folder-draft button:first-of-type{border-color:var(--ig-blue-line);color:var(--ig-blue)}\n.dsh-ig-fav-dialog-wrap{position:fixed;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;background:rgba(15,20,34,.45)}\n.dsh-ig-fav-dialog{width:min(420px,92vw);max-height:70vh;overflow:auto;padding:14px;border-radius:10px;background:var(--ig-bg-panel);border:1px solid var(--ig-line);box-shadow:0 12px 32px rgba(10,14,26,.25);display:flex;flex-direction:column;gap:10px}\n.dsh-ig-fav-dialog-title{font-size:12.5px;font-weight:600;color:var(--ig-fg)}\n.dsh-ig-fav-dialog-textarea{width:100%;resize:vertical;padding:8px;border:1px solid var(--ig-line);border-radius:6px;background:var(--ig-bg);color:var(--ig-fg);font-size:12px;line-height:1.5}\n.dsh-ig-fav-dialog-folder-label{display:flex;align-items:center;gap:8px;font-size:11.5px;color:var(--ig-fg-2)}\n.dsh-ig-fav-dialog-folder-label select{flex:1;padding:4px 6px;border:1px solid var(--ig-line);border-radius:5px;background:var(--ig-bg);color:var(--ig-fg);font-size:11.5px}\n.dsh-ig-fav-dialog-actions{display:flex;gap:6px;justify-content:flex-end;flex-wrap:wrap}\n.dsh-ig-fav-dialog-actions button{padding:5px 12px;border:1px solid var(--ig-line);border-radius:6px;background:transparent;color:var(--ig-fg-2);font-size:12px;cursor:pointer}\n.dsh-ig-fav-dialog-actions button.is-primary{border-color:var(--ig-blue);background:var(--ig-blue);color:#fff}\n.dsh-ig-fav-dialog-folders{display:flex;flex-direction:column;gap:4px}\n.dsh-ig-fav-dialog-folders button{text-align:left;padding:6px 10px;border:1px solid var(--ig-line);border-radius:6px;background:transparent;color:var(--ig-fg-2);font-size:12px;cursor:pointer}\n.dsh-ig-fav-dialog-folders button:hover,.dsh-ig-fav-dialog-folders button.is-current{border-color:var(--ig-blue-line);color:var(--ig-blue);background:color-mix(in srgb,var(--ig-blue) 8%,transparent)}\n.dsh-ig-fav-del{position:absolute;top:-5px;right:-5px;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;padding:0;border:1px solid var(--ig-line);border-radius:50%;background:var(--ig-bg);color:var(--ig-fg-3);cursor:pointer;z-index:2;opacity:0;pointer-events:none;transition:opacity .12s,color .15s,border-color .15s}.dsh-ig-fav-del:hover{color:#d5495c;border-color:#e6a3ad}.dsh-ig-fav-prompt:hover .dsh-ig-fav-del,.dsh-ig-fav-del:focus-visible{opacity:1;pointer-events:auto}.dsh-ig-fav-del:focus-visible{outline:2px solid var(--ig-blue);outline-offset:1px}\n.dsh-ig-fav-prompt{position:relative;display:flex;align-items:flex-start;gap:2px}\n.dsh-ig-fav-prompt-text{flex:1;min-width:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-align:left;padding:5px 8px;border:1px solid var(--ig-line);border-radius:6px;background:transparent;font-size:11px;line-height:1.45;color:var(--ig-fg);cursor:pointer;transition:all .15s}.dsh-ig-fav-prompt-text:hover{border-color:var(--ig-blue-line);background:var(--ig-soft)}\n.dsh-ig-fav-save-btn{display:inline-flex;align-items:center;justify-content:center;padding:2px 4px;border:0;background:transparent;color:var(--ig-fg-cap);cursor:pointer;transition:color .15s}.dsh-ig-fav-save-btn:hover{color:#e8a33d}\n.dsh-ig-rail-tabs{flex:none;display:flex;gap:4px;padding:4px 8px 6px;border-bottom:1px solid var(--ig-line)}\n.dsh-ig-rail-tab{flex:1;height:26px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:6px;background:transparent;font-size:12px;color:var(--ig-fg-3);cursor:pointer;transition:all .15s}.dsh-ig-rail-tab:hover{background:var(--ig-soft);color:var(--ig-fg)}.dsh-ig-rail-tab.is-active{border-color:var(--ig-blue-line);background:var(--ig-soft);color:var(--ig-blue);font-weight:600}\n.dsh-ig-fav-scroll{flex:1 1 0;height:0;overflow-x:hidden;overflow-y:auto;min-height:0;padding:8px}\n.dsh-ig-fav-section-label{padding:4px 2px 6px;font-size:11px;font-weight:600;color:var(--ig-fg-3)}\n.dsh-ig-fav-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:6px}\n.dsh-ig-fav-empty{min-height:64px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;color:var(--ig-fg-cap);text-align:center;font-size:11px;border:1px dashed var(--ig-line);border-radius:8px;margin-bottom:8px;padding:8px}\n.dsh-ig-fav-prompts{display:flex;flex-direction:column;gap:4px}\n.dsh-ig-recent-item{position:relative;width:100%;aspect-ratio:1;align-self:start;padding:0;border:1px solid transparent;border-radius:8px;background:transparent;cursor:pointer;transition:border-color .16s,box-shadow .16s}.dsh-ig-recent-item:hover{border-color:var(--ig-blue-line);box-shadow:0 1px 4px rgba(30,42,76,.14)}.dsh-ig-recent-item.is-active{border-color:var(--ig-blue);box-shadow:0 0 0 2px rgba(47,100,245,.18)}.dsh-ig-recent-thumb{width:100%;height:100%;border-radius:7px;display:flex;align-items:center;justify-content:center;overflow:hidden;background:var(--ig-bg-thumb);color:var(--ig-fg-cap)}.dsh-ig-recent-thumb img{width:100%;height:100%;object-fit:cover}\n.dsh-ig-load-more{grid-column:1/-1;width:100%;height:32px;margin:4px 0 2px;display:flex;align-items:center;justify-content:center;border:1px dashed var(--ig-line);border-radius:7px;background:transparent;font-size:11px;color:var(--ig-fg-2);cursor:pointer;transition:background .15s,color .15s}.dsh-ig-load-more:hover{background:var(--ig-soft);color:var(--ig-blue);border-color:var(--ig-blue-line)}\n.dsh-ig-mini-btn{height:22px;padding:0 7px;display:inline-flex;align-items:center;gap:3px;border:1px solid var(--ig-line);border-radius:5px;background:var(--ig-bg);font-size:10.5px;font-weight:500;color:var(--ig-fg);cursor:pointer;transition:all .15s}.dsh-ig-mini-btn:hover{border-color:var(--ig-blue-line);color:var(--ig-blue);background:rgba(47,100,245,.06)}\n.dsh-ig-canvas-column{min-width:0;min-height:0;height:100%;overflow:hidden;display:flex;flex-direction:column;background:var(--dsw-alias-bg-layer-2,var(--ig-bg))}\n.dsh-ig-canvas-toolbar{height:46px;flex:0 0 46px;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;padding:0 14px;border-bottom:1px solid var(--ig-line)}\n.dsh-ig-canvas-toolbar-left,.dsh-ig-canvas-toolbar-right{display:flex;align-items:center;gap:6px;min-width:0}\n.dsh-ig-canvas-toolbar-left{justify-self:start}\n.dsh-ig-canvas-toolbar-right{justify-self:end}\n.dsh-ig-canvas-toolbar-center{display:flex;align-items:center;justify-self:center;gap:6px;min-width:0}\n.dsh-ig-toolbar-divider{width:1px;height:16px;background:var(--ig-line);flex-shrink:0;margin:0 2px}\n.dsh-ig-canvas-toolbar button{height:30px;min-width:30px;padding:0 9px;display:inline-flex;align-items:center;justify-content:center;gap:5px;border:1px solid var(--ig-line);border-radius:7px;background:var(--ig-bg);color:var(--ig-fg);font-size:11.5px;font-weight:500;cursor:pointer;transition:border-color .15s,background .15s,color .15s}\n.dsh-ig-canvas-toolbar button:hover{border-color:var(--ig-blue-line);background:rgba(47,100,245,.05);color:var(--ig-blue)}\n.dsh-ig-canvas-toolbar button.is-active{border-color:var(--ig-blue-line);background:rgba(47,100,245,.08);color:var(--ig-blue);font-weight:550}\n.dsh-ig-canvas-toolbar-center button.is-active{border-color:var(--ig-blue);background:rgba(47,100,245,.09);color:var(--ig-blue);font-weight:600;box-shadow:inset 0 0 0 1px rgba(47,100,245,.28)}\n.dsh-ig-zoom-display{font-size:11px;min-width:38px;text-align:center;color:var(--ig-fg-2);user-select:none;font-variant-numeric:tabular-nums}\n.dsh-ig-canvas-hint{flex:0 0 auto;display:flex;align-items:flex-start;gap:8px;padding:7px 12px;border-bottom:1px solid rgba(47,100,245,.14);background:rgba(47,100,245,.055);color:var(--ig-fg-2);font-size:11.5px;line-height:17px}.dsh-ig-canvas-hint>svg:first-child{flex-shrink:0;color:var(--ig-blue);margin-top:1px}.dsh-ig-canvas-hint>span{flex:1 1 0;min-width:0}.dsh-ig-canvas-hint>button{flex-shrink:0;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:5px;background:transparent;color:var(--ig-fg-cap);cursor:pointer;transition:background .15s,color .15s}.dsh-ig-canvas-hint>button:hover{background:rgba(47,100,245,.1);color:var(--ig-blue)}\n.dsh-ig-status-badge-wrap{position:relative;display:inline-flex;align-items:center}\n.dsh-ig-status-badge{height:30px;display:inline-flex;align-items:center;gap:7px;padding:0 10px;border:1px solid var(--ig-line);border-radius:7px;background:var(--ig-bg);cursor:pointer;user-select:none;transition:border-color .15s,background .15s,box-shadow .15s}\n.dsh-ig-status-badge:hover{border-color:var(--ig-blue-line);background:rgba(47,100,245,.04)}\n.dsh-ig-status-dot{width:7px;height:7px;min-width:7px;max-width:7px;border-radius:50%;flex-shrink:0;box-sizing:border-box}\n.dsh-ig-status-dot.is-ready{background:#10b981;box-shadow:0 0 0 2px rgba(16,185,129,.2)}\n.dsh-ig-status-dot.is-muted{background:#ef4444;box-shadow:0 0 0 2px rgba(239,68,68,.2)}\n.dsh-ig-status-text{font-size:11.5px;font-weight:500;color:var(--ig-fg);line-height:1}\n.dsh-ig-status-arrow{color:var(--ig-fg-cap);transition:transform .15s,color .15s}\n.dsh-ig-status-badge-wrap:hover .dsh-ig-status-arrow{transform:rotate(180deg);color:var(--ig-blue)}\n.dsh-ig-status-popover{position:absolute;left:0;top:calc(100% + 6px);width:260px;background:var(--ig-bg);border:1px solid var(--ig-line);border-radius:9px;box-shadow:0 12px 36px rgba(20,28,45,.14);padding:10px 12px;z-index:40;opacity:0;pointer-events:none;transform:translateY(4px);transition:opacity .15s cubic-bezier(.16,1,.3,1),transform .15s cubic-bezier(.16,1,.3,1)}\n.dsh-ig-status-badge-wrap:hover .dsh-ig-status-popover{opacity:1;pointer-events:auto;transform:translateY(0)}\n.dsh-ig-status-popover-title{display:flex;align-items:center;justify-content:space-between;font-size:10px;font-weight:650;color:var(--ig-fg-cap);margin-bottom:8px;letter-spacing:.02em;text-transform:uppercase}\n.dsh-ig-status-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:5px}\n.dsh-ig-status-list li{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border-radius:6px;transition:background .12s}\n.dsh-ig-status-list li.is-configured{background:rgba(16,185,129,.05);border:1px solid rgba(16,185,129,.12)}\n.dsh-ig-status-list li.is-missing{background:rgba(239,68,68,.04);border:1px solid rgba(239,68,68,.12);opacity:.75}\n.dsh-ig-status-item-name{display:flex;flex-direction:column;min-width:0}\n.dsh-ig-status-item-name strong{font-size:11.5px;font-weight:600;color:var(--ig-fg);line-height:16px}\n.dsh-ig-status-item-name small{font-size:9.5px;color:var(--ig-fg-cap);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:145px;line-height:14px}\n.dsh-ig-status-item-tag{font-size:10px;font-weight:600;padding:2px 6px;border-radius:4px;flex-shrink:0}\n.is-configured .dsh-ig-status-item-tag{color:#059669;background:rgba(16,185,129,.14)}\n.is-missing .dsh-ig-status-item-tag{color:#dc2626;background:rgba(239,68,68,.14)}\n.dsh-ig-canvas{position:relative;flex:1 1 0;height:0;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:24px;touch-action:none;user-select:none;cursor:grab;background-image:linear-gradient(45deg,rgba(114,128,156,.035) 25%,transparent 25%),linear-gradient(-45deg,rgba(114,128,156,.035) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(114,128,156,.035) 75%),linear-gradient(-45deg,transparent 75%,rgba(114,128,156,.035) 75%);background-size:24px 24px;background-position:0 0,0 12px,12px -12px,-12px 0}\n.dsh-ig-canvas.is-dragging,.dsh-ig-canvas.is-dragging *{cursor:grabbing!important}\n.dsh-ig-canvas img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;border-radius:10px;box-shadow:0 14px 45px rgba(25,35,63,.18);user-select:none;-webkit-user-drag:none;pointer-events:auto}\n.dsh-ig-canvas-empty,.dsh-ig-generating-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;color:var(--ig-fg-cap);font-size:12px;padding:26px;cursor:default}\n.dsh-ig-generating-state strong{font-size:15px;color:var(--ig-fg)}.dsh-ig-generating-state span{font-size:11px}.dsh-ig-generation-orbit{width:66px;height:66px;border-radius:50%;display:grid;place-items:center;color:var(--ig-blue);background:rgba(47,100,245,.09);box-shadow:0 0 0 10px rgba(47,100,245,.035);animation:dshIgPulse 1.8s ease-in-out infinite}\n.dsh-ig-result-strip{flex:0 0 auto;min-height:52px;padding:8px 14px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--ig-line)}.dsh-ig-result-strip>span{font-size:12px;font-weight:650}.dsh-ig-result-strip>div,.dsh-ig-result-actions>div{display:flex;gap:7px}.dsh-ig-result-strip button,.dsh-ig-result-actions button{height:32px;display:inline-flex;align-items:center;gap:6px;padding:0 10px;border:1px solid var(--ig-line);border-radius:7px;background:var(--ig-bg);font-size:11px;cursor:pointer}.dsh-ig-result-strip button:hover,.dsh-ig-result-actions button:hover{border-color:var(--ig-blue-line);color:var(--ig-blue)}.dsh-ig-result-actions{flex:0 0 auto;min-height:54px;padding:8px 14px;display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--ig-line)}.dsh-ig-result-actions p{margin:0;min-width:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:11.5px;line-height:18px;color:var(--ig-fg-2)}.dsh-ig-result-meta{flex:0 0 auto;min-height:32px;padding:6px 14px;display:flex;gap:13px;align-items:center;flex-wrap:wrap;border-top:1px solid var(--ig-line);font-size:10px;color:var(--ig-fg-cap)}.dsh-ig-result-meta span+span:before{content:'\u00B7';margin-right:13px}\n.dsh-ig-generate-panel{height:100%;display:flex;flex-direction:column;border-left:1px solid var(--ig-line);overflow:hidden}.dsh-ig-generator-form{flex:1 1 0;height:0;padding:15px;display:flex;flex-direction:column;gap:15px;overflow-x:hidden;overflow-y:auto;min-height:0}.dsh-ig-mode-switch{display:grid;grid-template-columns:1fr 1fr;gap:8px}.dsh-ig-mode-switch button{height:39px;border:1px solid var(--ig-line);border-radius:8px;background:var(--ig-bg);display:flex;align-items:center;justify-content:center;gap:7px;font-size:12px;cursor:pointer}.dsh-ig-mode-switch button.is-active{border-color:var(--ig-blue-line);color:var(--ig-blue);background:rgba(47,100,245,.065);box-shadow:inset 0 0 0 1px rgba(47,100,245,.1)}\n.dsh-ig-field{position:relative;display:flex;flex-direction:column;gap:7px}.dsh-ig-field>label,.dsh-ig-field-label label{font-size:11.5px;font-weight:630}.dsh-ig-field>label span{font-weight:400;color:var(--ig-fg-cap)}.dsh-ig-field-label{display:flex;align-items:center;justify-content:space-between}.dsh-ig-field-label b{color:#e14d4d}.dsh-ig-field-label button{border:0;background:transparent;color:var(--ig-fg-3);font-size:10.5px;cursor:pointer}.dsh-ig-field textarea{width:100%;height:112px;padding:11px 12px 22px;resize:vertical;border:1px solid var(--ig-line);border-radius:9px;background:var(--ig-bg);font-size:12px;line-height:19px;outline:none}.dsh-ig-field textarea:focus{border-color:var(--ig-blue);box-shadow:0 0 0 3px rgba(47,100,245,.09)}.dsh-ig-field>small{position:absolute;right:9px;bottom:7px;color:var(--ig-fg-cap);font-size:9.5px}.dsh-ig-field-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}.dsh-ig-field-select{display:flex;flex-direction:column;gap:6px;min-width:0}.dsh-ig-field-select>span{font-size:11px;font-weight:620}.dsh-ig-field-select select{width:100%;height:36px;padding:0 26px 0 9px;border:1px solid var(--ig-line);border-radius:8px;background:var(--ig-bg);font-size:11px;outline:none;text-overflow:ellipsis}.dsh-ig-field-select select:focus{border-color:var(--ig-blue)}.dsh-ig-count-row{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.dsh-ig-count-pill{height:34px;border:1px solid var(--ig-line);border-radius:7px;background:var(--ig-bg);font-size:12px;font-weight:600;color:var(--ig-fg-2);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .15s}.dsh-ig-count-pill:hover{border-color:var(--ig-blue-line);color:var(--ig-blue)}.dsh-ig-count-pill.is-active{border-color:var(--ig-blue);background:rgba(47,100,245,.08);color:var(--ig-blue);box-shadow:inset 0 0 0 1px var(--ig-blue)}\n.dsh-ig-generation-kind{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:3px;border:1px solid var(--ig-line);border-radius:9px;background:var(--ig-soft)}.dsh-ig-generation-kind button{height:31px;border:0;border-radius:6px;background:transparent;color:var(--ig-fg-3);font-size:11.5px;display:flex;align-items:center;justify-content:center;gap:6px;cursor:pointer;transition:background .15s,color .15s,box-shadow .15s}.dsh-ig-generation-kind button.is-active{background:var(--ig-bg);color:var(--ig-blue);font-weight:650;box-shadow:0 2px 8px rgba(30,42,76,.09)}\n.dsh-ig-compare-box{padding:10px;border:1px solid rgba(47,100,245,.2);border-radius:10px;background:linear-gradient(145deg,rgba(47,100,245,.055),rgba(99,102,241,.018));display:flex;flex-direction:column;gap:9px}.dsh-ig-compare-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.dsh-ig-compare-heading>div{min-width:0;display:flex;flex-direction:column;gap:2px}.dsh-ig-compare-heading strong{font-size:11.5px}.dsh-ig-compare-heading small{font-size:9.5px;color:var(--ig-fg-cap)}.dsh-ig-compare-heading>span{flex:none;padding:2px 6px;border-radius:999px;background:rgba(47,100,245,.11);color:var(--ig-blue);font-size:9.5px;font-weight:650}.dsh-ig-model-checks{display:flex;flex-direction:column;gap:6px}.dsh-ig-model-checks>button{min-height:43px;width:100%;padding:6px 7px;display:grid;grid-template-columns:18px minmax(0,1fr) auto;align-items:center;gap:7px;border:1px solid var(--ig-line);border-radius:8px;background:var(--ig-bg);text-align:left;cursor:pointer;transition:border-color .15s,background .15s,transform .15s}.dsh-ig-model-checks>button:hover{border-color:var(--ig-blue-line);transform:translateY(-1px)}.dsh-ig-model-checks>button.is-selected{border-color:var(--ig-blue-line);background:rgba(47,100,245,.055);box-shadow:inset 3px 0 0 var(--ig-blue)}.dsh-ig-model-checkmark{width:17px;height:17px;border:1px solid var(--ig-line);border-radius:5px;display:grid;place-items:center;color:#fff;background:var(--ig-bg)}.dsh-ig-model-checks>button.is-selected .dsh-ig-model-checkmark{border-color:var(--ig-blue);background:var(--ig-blue)}.dsh-ig-model-copy{display:flex;flex-direction:column;min-width:0}.dsh-ig-model-copy strong{font-size:11px;line-height:15px}.dsh-ig-model-copy small{max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ig-fg-cap);font-size:9.5px;line-height:14px}.dsh-ig-model-settings{display:flex;flex-direction:column;align-items:flex-end;gap:2px;color:var(--ig-fg-2);font-size:9.5px;white-space:nowrap}.dsh-ig-model-settings em{font-style:normal;color:var(--ig-warn);font-size:8.5px}.dsh-ig-compare-box>p{margin:0;color:var(--ig-fg-3);font-size:9.5px;line-height:14px}\n.dsh-ig-upload{height:92px;border:1px dashed var(--ig-line);border-radius:9px;background:color-mix(in srgb,var(--ig-bg) 55%,transparent);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;color:var(--ig-fg-3);cursor:pointer}.dsh-ig-upload strong{font-size:11px;font-weight:570}.dsh-ig-upload small{font-size:9.5px}.dsh-ig-upload:hover,.dsh-ig-upload.is-dragging{border-color:var(--ig-blue);background:rgba(47,100,245,.05);color:var(--ig-blue)}\n.dsh-ig-reference-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:8px}\n.dsh-ig-reference-card{position:relative;aspect-ratio:1;border-radius:8px;overflow:hidden;background:var(--ig-bg-thumb);border:1px solid var(--ig-line)}\n.dsh-ig-reference-card img{width:100%;height:100%;object-fit:cover}\n.dsh-ig-reference-card button{position:absolute;right:4px;top:4px;width:18px;height:18px;border:0;border-radius:50%;display:grid;place-items:center;background:rgba(20,28,45,.75);color:#fff;cursor:pointer;padding:0;transition:background .15s}\n.dsh-ig-reference-card button:hover{background:#ef4444}\n.dsh-ig-reference-add{aspect-ratio:1;border:1px dashed var(--ig-line);border-radius:8px;background:color-mix(in srgb,var(--ig-bg) 55%,transparent);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;color:var(--ig-fg-3);cursor:pointer;font-size:10px;transition:border-color .15s,color .15s,background .15s}\n.dsh-ig-reference-add:hover{border-color:var(--ig-blue);background:rgba(47,100,245,.05);color:var(--ig-blue)}\n.dsh-ig-reference-preview{position:relative;height:108px;border-radius:9px;overflow:hidden;background:var(--ig-bg-thumb)}.dsh-ig-reference-preview img{width:100%;height:100%;object-fit:contain}.dsh-ig-reference-preview button{position:absolute;right:7px;top:7px;width:25px;height:25px;border:0;border-radius:50%;display:grid;place-items:center;background:rgba(20,28,45,.72);color:#fff;cursor:pointer}\n.dsh-ig-inline-note,.dsh-ig-form-error{padding:9px 10px;border-radius:7px;font-size:10.5px;line-height:16px}.dsh-ig-inline-note{background:rgba(245,158,11,.1);color:var(--ig-warn);border:1px solid rgba(245,158,11,.35)}.dsh-ig-form-error{background:rgba(239,68,68,.08);color:var(--ig-danger);border:1px solid rgba(239,68,68,.3)}.dsh-ig-form-loading{height:70px;display:grid;place-items:center;color:var(--ig-blue)}\n.dsh-ig-config-error{padding:14px;display:flex;flex-direction:column;align-items:center;gap:10px;background:rgba(239,68,68,.07);border:1px solid rgba(239,68,68,.3);border-radius:8px;color:var(--ig-danger);font-size:11.5px;text-align:center}.dsh-ig-config-error p{margin:0;line-height:17px}.dsh-ig-config-error button{height:30px;display:inline-flex;align-items:center;gap:6px;padding:0 12px;border:1px solid rgba(239,68,68,.35);border-radius:6px;background:var(--ig-bg);color:var(--ig-danger);font-size:11.5px;font-weight:600;cursor:pointer}.dsh-ig-config-error button:hover{background:rgba(239,68,68,.12)}\n.dsh-ig-generate-button{height:42px;flex:0 0 auto;border:0;border-radius:8px;background:linear-gradient(135deg,#386cf6,#2758e7);color:#fff!important;display:flex;align-items:center;justify-content:center;gap:8px;font-size:12px;font-weight:650;cursor:pointer;box-shadow:0 8px 18px rgba(47,100,245,.22);transition:transform .16s,box-shadow .16s}.dsh-ig-generate-button:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 10px 24px rgba(47,100,245,.28)}.dsh-ig-generate-button:disabled{opacity:.55;cursor:not-allowed;box-shadow:none}\n.dsh-ig-generate-button.is-cancel{background:linear-gradient(135deg,#ef4444,#dc2626);box-shadow:0 8px 18px rgba(239,68,68,.25)}.dsh-ig-generate-button.is-cancel:hover{background:linear-gradient(135deg,#dc2626,#b91c1c);box-shadow:0 10px 24px rgba(239,68,68,.35)}.dsh-ig-progress{display:flex;flex-direction:column;gap:6px;border:1px solid #e2e8f0;border-radius:10px;padding:10px;background:#f8fafc}.dsh-ig-progress-head{display:flex;justify-content:space-between;font-size:11px;color:#475569;font-weight:650}.dsh-ig-progress-track{height:6px;border-radius:3px;background:#e2e8f0;overflow:hidden}.dsh-ig-progress-fill{height:100%;background:linear-gradient(90deg,#386cf6,#2fa8e0);transition:width .3s}.dsh-ig-progress-node{font-size:11px;color:#64748b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dsh-ig-progress-preview{width:100%;border-radius:8px;display:block;background:#fff}.dsh-ig-progress-canvas{position:relative;display:block;aspect-ratio:1/1;max-width:160px;border-radius:8px;overflow:hidden;background:linear-gradient(110deg,#eef2f9 20%,#dfe9fb 45%,#eef2f9 70%);background-size:220% 100%;animation:dsh-ig-gen-sweep 1.7s linear infinite}.dsh-ig-progress-shimmer{position:absolute;inset:0;background:radial-gradient(circle at 32% 28%,rgba(47,100,245,.18),transparent 62%);animation:dsh-ig-gen-breathe 2.6s ease-in-out infinite}\n@keyframes dsh-ig-gen-sweep{0%{background-position:130% 0}100%{background-position:-30% 0}}\n@keyframes dsh-ig-gen-breathe{50%{opacity:.4}}\n.dsh-ig-gen-dock{display:flex;align-items:center;gap:10px;width:min(100%,720px);margin:0 auto 8px;padding:8px 10px;box-sizing:border-box;border:1px solid var(--dsw-alias-border-l2,#e5e7eb);border-radius:12px;background:var(--dsw-alias-bg-layer-1,#fff);box-shadow:0 6px 18px rgba(20,32,64,.07)}\n.dsh-ig-gen-dock-thumb{position:relative;flex:none;width:46px;height:46px;border-radius:9px;overflow:hidden;background:linear-gradient(110deg,#eef2f9 20%,#dfe9fb 45%,#eef2f9 70%);background-size:220% 100%;animation:dsh-ig-gen-sweep 1.7s linear infinite}\n.dsh-ig-gen-dock-thumb img{width:100%;height:100%;object-fit:cover;display:block}\n.dsh-ig-gen-dock-shimmer{position:absolute;inset:0;background:radial-gradient(circle at 34% 30%,rgba(47,100,245,.2),transparent 64%);animation:dsh-ig-gen-breathe 2.6s ease-in-out infinite}\n.dsh-ig-gen-dock-steps{position:absolute;right:3px;bottom:3px;padding:1px 4px;border-radius:4px;background:rgba(15,23,42,.62);color:#fff;font-size:9px;line-height:12px;font-variant-numeric:tabular-nums}\n.dsh-ig-gen-dock-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}\n.dsh-ig-gen-dock-head{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11.5px;color:var(--dsw-alias-label-secondary,#4b5563)}\n.dsh-ig-gen-dock-head strong{font-weight:650;color:var(--dsw-alias-label-primary,#111827)}\n.dsh-ig-gen-dock-track{height:4px;border-radius:2px;background:var(--dsw-alias-bg-layer-3,#e9edf3);overflow:hidden}\n.dsh-ig-gen-dock-fill{height:100%;border-radius:2px;background:linear-gradient(90deg,#386cf6,#2fa8e0);transition:width .3s}\n.dsh-ig-gen-dock-detail{display:flex;align-items:center;gap:8px;min-width:0;font-size:10.5px;color:var(--dsw-alias-label-tertiary,#6b7280)}\n.dsh-ig-gen-dock-detail span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.dsh-ig-gen-dock-detail em{margin-left:auto;flex:none;max-width:40%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-style:normal;opacity:.82}\n.dsh-ig-details{padding:16px;margin:0;overflow:auto}.dsh-ig-details>div{padding:12px 0;border-bottom:1px solid var(--ig-line)}.dsh-ig-details dt{font-size:10.5px;color:var(--ig-fg-cap);margin-bottom:5px}.dsh-ig-details dd{margin:0;font-size:11.5px;line-height:18px;word-break:break-word}.dsh-ig-details-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;height:220px;padding:20px;color:var(--ig-fg-cap);font-size:11px;text-align:center}\n.dsh-ig-workbench-modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.45);backdrop-filter:blur(3px);z-index:999;display:grid;place-items:center;padding:16px}\n.dsh-ig-workbench-modal-box{width:100%;max-width:380px;background:var(--ig-bg);border-radius:12px;padding:20px;box-shadow:0 20px 48px rgba(0,0,0,.22);display:flex;flex-direction:column;gap:14px}\n.dsh-ig-workbench-modal-header{display:flex;align-items:center;gap:10px}\n.dsh-ig-workbench-modal-header strong{font-size:14px;font-weight:650;color:#b91c1c}\n.dsh-ig-workbench-modal-desc{font-size:12px;line-height:18px;color:var(--ig-fg-2);margin:0}\n.dsh-ig-workbench-modal-option{display:flex;align-items:center;gap:8px;font-size:11.5px;color:var(--ig-fg-2);cursor:pointer}\n.dsh-ig-workbench-modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}\n.dsh-ig-workbench-modal-actions button{height:32px;padding:0 14px;border-radius:7px;font-size:11.5px;font-weight:600;cursor:pointer}\n.dsh-ig-workbench-modal-cancel{border:1px solid var(--ig-line);background:var(--ig-bg);color:var(--ig-fg-2)}\n.dsh-ig-workbench-modal-cancel:hover{background:var(--ig-soft)}\n.dsh-ig-workbench-modal-danger{border:0;background:#dc2626;color:#fff}\n.dsh-ig-workbench-modal-danger:hover{background:#b91c1c}\n@keyframes dshIgPulse{50%{transform:scale(1.06);box-shadow:0 0 0 16px rgba(47,100,245,.025)}}\n.dsh-ig-workbench-toast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%);background:rgba(15,23,42,0.88);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);color:#fff;padding:8px 18px;border-radius:10px;font-size:12.5px;font-weight:500;box-shadow:0 12px 32px rgba(0,0,0,0.3);z-index:99999;animation:dshIgFade .15s ease-out;pointer-events:none}\n@keyframes dshIgFade{from{opacity:0;transform:translate(-50%,6px)}to{opacity:1;transform:translate(-50%,0)}}\n@media(max-width:1120px){.dsh-ig-workbench-grid{grid-template-columns:190px minmax(360px,1fr) 300px}.dsh-ig-result-actions button,.dsh-ig-result-strip button{padding:0 7px;font-size:10px;gap:4px}.dsh-ig-result-actions>div,.dsh-ig-result-strip>div{gap:5px}}\n@media(max-width:900px){.dsh-ig-gallery-page-body.is-workbench{height:auto;overflow:auto}.dsh-ig-workbench{height:auto;min-height:100%;overflow:visible;padding:12px}.dsh-ig-workbench-heading{height:auto;padding-bottom:12px;align-items:center}.dsh-ig-provider-quick>span{display:none}.dsh-ig-workbench-grid{height:auto;display:flex;flex:none;flex-direction:column;overflow:visible}.dsh-ig-recent-panel{height:auto;overflow:hidden;border-right:0;border-bottom:1px solid var(--ig-line)}.dsh-ig-recent-scroll{height:auto;display:flex;overflow-x:auto;overflow-y:hidden;padding:8px}.dsh-ig-fav-scroll{height:auto;flex:none;overflow:visible}.dsh-ig-recent-item{min-width:220px}.dsh-ig-canvas-column{height:auto;min-height:560px}.dsh-ig-generate-panel{height:auto;border-left:0;border-top:1px solid var(--ig-line);min-height:560px}.dsh-ig-generator-form{height:auto;overflow:visible}.dsh-ig-canvas{height:auto;min-height:360px}}\n@media(max-width:560px){.dsh-ig-workbench-heading>div{display:block}.dsh-ig-workbench-heading h1{font-size:15px}.dsh-ig-provider-quick select{min-width:128px;max-width:150px}.dsh-ig-canvas{padding:12px;min-height:300px}.dsh-ig-result-strip,.dsh-ig-result-actions{align-items:flex-start;flex-direction:column}.dsh-ig-result-strip>div,.dsh-ig-result-actions>div{width:100%}.dsh-ig-result-strip button,.dsh-ig-result-actions button{flex:1;justify-content:center}.dsh-ig-result-actions button span{display:inline}.dsh-ig-field-grid{grid-template-columns:1fr}.dsh-ig-result-meta span+span:before{display:none}}\n@media(prefers-reduced-motion:reduce){.dsh-ig-workbench *{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}\n.dsh-ig-field-label>span{display:flex;align-items:center;gap:5px}.dsh-ig-field-label .dsh-ig-find-inspiration{display:inline-flex;align-items:center;gap:3px;color:var(--ig-blue);font-weight:600}.dsh-ig-field-label .dsh-ig-find-inspiration:hover{color:color-mix(in srgb,var(--ig-blue) 78%,#fff)}\n.dsh-ig-workspace-filter-label{height:30px;display:inline-flex;align-items:center;gap:6px;padding:0 10px;border:1px solid var(--ig-line,rgba(0,0,0,.1));border-radius:7px;background:var(--ig-bg);font-size:11.5px;color:var(--ig-fg);cursor:pointer;user-select:none;transition:border-color .15s,background .15s}\n.dsh-ig-workspace-filter-label:hover{border-color:var(--ig-blue-line);background:rgba(47,100,245,.04)}\n.dsh-ig-workspace-checkbox{cursor:pointer;accent-color:#2f64f5;width:13.5px;height:13.5px;margin:0}\n.dsh-ig-workspace-filter-text{font-weight:500;white-space:nowrap}\n.dsh-ig-workspace-filter-badge{font-size:10px;font-weight:600;padding:1px 6px;border-radius:999px;background:color-mix(in srgb,currentColor 7%,transparent);color:var(--ig-fg-2);font-variant-numeric:tabular-nums}\n.dsh-ig-canvas-cluster{display:grid;gap:16px;align-items:center;justify-content:center;user-select:none;pointer-events:auto;flex-shrink:0}\n.dsh-ig-canvas-cluster[data-count=\"2\"]{grid-template-columns:repeat(2,1fr);max-width:880px}\n.dsh-ig-canvas-cluster[data-count=\"3\"],.dsh-ig-canvas-cluster[data-count=\"4\"]{grid-template-columns:repeat(2,1fr);max-width:760px}\n.dsh-ig-canvas-item{position:relative;display:flex;align-items:center;justify-content:center;border-radius:10px;cursor:pointer;transition:transform .12s ease-out}\n.dsh-ig-canvas-item img{display:block;max-width:100%;max-height:360px;width:auto;height:auto;object-fit:contain;border-radius:10px;box-shadow:0 10px 30px rgba(25,35,63,.16);user-select:none;-webkit-user-drag:none;pointer-events:auto;transition:box-shadow .15s,outline .15s}\n.dsh-ig-canvas-item:hover img{box-shadow:0 14px 40px rgba(47,100,245,.2)}\n.dsh-ig-canvas-item.is-active img{box-shadow:0 14px 40px rgba(47,100,245,.28)}\n.dsh-ig-canvas-item.is-checked img{outline:3px solid var(--ig-blue);outline-offset:2px;box-shadow:0 14px 40px rgba(47,100,245,.35)}\n.dsh-ig-canvas-badge{position:absolute;top:10px;left:10px;background:rgba(15,23,42,.7);color:#fff;font-size:11px;font-weight:700;padding:2px 7px;border-radius:5px;backdrop-filter:blur(4px);pointer-events:none;transition:background .15s;z-index:2}\n.dsh-ig-canvas-badge.is-model{max-width:calc(100% - 20px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}\n.dsh-ig-canvas-item.is-checked .dsh-ig-canvas-badge{background:var(--ig-blue)}\n.dsh-ig-canvas-check{position:absolute;top:10px;right:10px;width:22px;height:22px;border:1.5px solid rgba(255,255,255,.85);border-radius:50%;display:grid;place-items:center;background:rgba(15,23,42,.48);color:#fff;box-shadow:0 2px 8px rgba(15,23,42,.18);backdrop-filter:blur(4px);z-index:2;pointer-events:none}.dsh-ig-canvas-item.is-checked .dsh-ig-canvas-check{border-color:#fff;background:var(--ig-blue)}\n.dsh-ig-canvas-item-loading{width:260px;height:260px;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--ig-bg) 55%,transparent);border:1px solid var(--ig-line);border-radius:10px;color:var(--ig-fg-cap)}\n.dsh-ig-lightbox-nav{position:absolute;top:50%;transform:translateY(-50%);width:42px;height:42px;border-radius:50%;border:0;background:rgba(15,23,42,.65);color:#fff;display:grid;place-items:center;cursor:pointer;transition:background .15s,transform .15s;z-index:10;backdrop-filter:blur(4px)}\n.dsh-ig-lightbox-nav:hover{background:rgba(47,100,245,.85);transform:translateY(-50%) scale(1.08)}\n.dsh-ig-lightbox-nav.is-prev{left:18px}\n.dsh-ig-lightbox-nav.is-next{right:18px}\n.dsh-ig-save-gallery-btn{color:var(--ig-blue)!important;border-color:rgba(47,100,245,.35)!important;background:rgba(47,100,245,.06)!important}\n.dsh-ig-save-gallery-btn:hover{background:rgba(47,100,245,.12)!important}\n.dsh-ig-save-gallery-btn.is-saved{color:var(--ig-fg-2)!important;border-color:var(--ig-line)!important;background:transparent!important}\n\n/* tldraw infinite canvas surface (P0 spike) */\n.dsh-ig-tl-canvas{position:relative;flex:1 1 0;height:0;min-height:0;overflow:hidden;isolation:isolate}\n.dsh-ig-canvas-sync-status{position:absolute;z-index:500;bottom:48px;left:60px;right:16px;display:flex;align-items:center;justify-content:center;gap:8px;max-width:560px;margin:auto;padding:7px 12px;border:1px solid var(--ig-line);border-radius:10px;background:var(--ig-bg);color:var(--ig-fg-2);box-shadow:0 2px 8px #0001;font-size:12px;pointer-events:none}\n.dsh-ig-canvas-sync-status[data-phase='error']{color:var(--ig-danger);border-color:rgba(239,68,68,.4)}\n.dsh-ig-canvas-sync-status button{pointer-events:auto;flex-shrink:0;border:1px solid currentColor;border-radius:6px;padding:3px 9px;background:transparent;color:inherit;cursor:pointer}\n\n/* ---- Right-sidebar seat variant (DSH 0.1.5 'sidebar.right.pane.tab') ----\n The seat is a narrow panel beside the conversation column, not a full\n conversation tab. Specificity (0,2,0) outranks every viewport media query\n above, so these apply regardless of window size: tabs scroll instead of\n wrapping, the page fills the seat box, and the workbench grid shrinks its\n rail and generate-form columns. StudioView's narrow-width observer\n (ResizeObserver) folds the recent rail under 560px. */\n.dsh-ig-page-in-sidebar .dsh-ig-studio-tabs-bar{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin}\n.dsh-ig-page-in-sidebar .dsh-ig-studio-tab-btn{flex:0 0 auto;white-space:nowrap}\n.dsh-ig-page-in-sidebar .dsh-ig-gallery-page-body{padding:14px 14px 16px}\n.dsh-ig-page-in-sidebar .dsh-ig-workbench{padding:8px}\n.dsh-ig-page-in-sidebar .dsh-ig-workbench-grid{grid-template-columns:minmax(150px,190px) minmax(0,1fr) minmax(206px,264px)}\n.dsh-ig-page-in-sidebar .dsh-ig-workbench-grid.is-sidebar-collapsed{grid-template-columns:minmax(0,1fr) minmax(206px,264px)}\n.dsh-ig-page-in-sidebar .dsh-ig-workbench-grid.is-generate-collapsed{grid-template-columns:minmax(150px,190px) minmax(0,1fr)}\n.dsh-ig-page-in-sidebar .dsh-ig-workbench-grid.is-sidebar-collapsed.is-generate-collapsed{grid-template-columns:minmax(0,1fr)}\n.dsh-ig-field-grid.is-output-grid{grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}\n.dsh-ig-page-in-sidebar .dsh-ig-recent-item{min-width:0}\n.dsh-ig-page-in-sidebar .dsh-ig-generate-panel .dsh-ig-field-grid{grid-template-columns:1fr}\n.dsh-ig-page-in-sidebar .dsh-ig-tl-canvas{min-height:280px}\n";
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
|
|
3
|
+
import type { LocaleService } from './gallery-view.js';
|
|
4
|
+
export interface StudioReferenceItem {
|
|
5
|
+
id: string;
|
|
6
|
+
attachment?: ImageAttachmentRef;
|
|
7
|
+
file?: File;
|
|
8
|
+
previewUrl: string;
|
|
9
|
+
}
|
|
10
|
+
export interface StudioWorkspaceProps {
|
|
11
|
+
workspaceId?: string | undefined;
|
|
12
|
+
path?: string | undefined;
|
|
13
|
+
title?: string | undefined;
|
|
14
|
+
sessionIds?: readonly string[] | undefined;
|
|
15
|
+
}
|
|
16
|
+
export declare const StudioView: FC<{
|
|
17
|
+
locale?: LocaleService | undefined;
|
|
18
|
+
/** Host credential-change notifier; re-reads provider sign-in state silently. */
|
|
19
|
+
credentialEvents?: {
|
|
20
|
+
listen(callback: () => void): () => void;
|
|
21
|
+
} | undefined;
|
|
22
|
+
workspace?: StudioWorkspaceProps | null | undefined;
|
|
23
|
+
initialPrompt?: string | undefined;
|
|
24
|
+
/** Reference image applied once on arrival (e.g. an inspiration card used as 图生图 input). */
|
|
25
|
+
initialReference?: File | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Canvas surface opened first: 'preview' (single-image viewer, the default)
|
|
28
|
+
* or 'infinite' (the tldraw editor). The right-sidebar variant opens the
|
|
29
|
+
* infinite canvas directly - mirroring chat-generated images while the
|
|
30
|
+
* native conversation runs beside it is the point of the split.
|
|
31
|
+
*/
|
|
32
|
+
initialCanvasSurface?: 'preview' | 'infinite' | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* Show the one-time hint banner above the infinite canvas. Only the
|
|
35
|
+
* conversation-tab seat (no chat running beside the canvas) needs it - the
|
|
36
|
+
* right-sidebar variant IS the full experience, so the hint would be noise.
|
|
37
|
+
*/
|
|
38
|
+
showInfiniteCanvasHint?: boolean;
|
|
39
|
+
onInitialPromptApplied?(): void;
|
|
40
|
+
onInitialReferenceApplied?(): void;
|
|
41
|
+
onOpenInspiration?(): void;
|
|
42
|
+
}>;
|
|
43
|
+
export declare function useAttachmentImage(attachment: ImageAttachmentRef | undefined, shouldLoad?: boolean): {
|
|
44
|
+
url: string | null;
|
|
45
|
+
blob: Blob | null;
|
|
46
|
+
loading: boolean;
|
|
47
|
+
};
|
|
48
|
+
export declare function fileToBase64(file: File): Promise<string>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Editor, TLShape } from 'tldraw';
|
|
2
|
+
import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
|
|
3
|
+
/** Bound raster dimensions before exporting; large multi-image PNGs get a
|
|
4
|
+
* JPEG preview instead of being silently discarded. Originals are separate. */
|
|
5
|
+
export declare function exportSelectionPreview(editor: Editor, shapes: TLShape[], maxBytes: number, signal: AbortSignal): Promise<string>;
|
|
6
|
+
export declare function readCanvasImageLimit(signal: AbortSignal): Promise<number>;
|
|
7
|
+
export interface CanvasOriginalCacheEntry {
|
|
8
|
+
src: string | null;
|
|
9
|
+
attachment: ImageAttachmentRef;
|
|
10
|
+
}
|
|
11
|
+
/** Use tldraw's resolver for IndexedDB-backed imports, not just asset.props.src.
|
|
12
|
+
* Upload each original once per mount/source, with individual byte limits. */
|
|
13
|
+
export declare function syncCanvasOriginal(editor: Editor, shape: TLShape, maxBytes: number, signal: AbortSignal, cache: Map<string, CanvasOriginalCacheEntry>): Promise<ImageAttachmentRef>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live canvas-state sync from one tldraw surface to the host mirror.
|
|
3
|
+
*
|
|
4
|
+
* The conversation agent runs in the host process and cannot see the browser
|
|
5
|
+
* canvas, so this module is the canvas's voice: it watches the editor store,
|
|
6
|
+
* summarizes the page (shape inventory + selection) and pushes a compact
|
|
7
|
+
* snapshot to the canvas-state route. When the selection settles, it also
|
|
8
|
+
* exports a fallback PNG screenshot (persistent images may come from a
|
|
9
|
+
* different conversation), which the host
|
|
10
|
+
* turns into a durable attachment (view_canvas / edit_image
|
|
11
|
+
* source=canvas_selection read exactly that).
|
|
12
|
+
*
|
|
13
|
+
* Pushes are fire-and-forget: failures warn in the console and the next
|
|
14
|
+
* change retries. Duplicate snapshots (e.g. camera pans that change nothing
|
|
15
|
+
* in the summary) never hit the network.
|
|
16
|
+
*/
|
|
17
|
+
import type { Editor } from 'tldraw';
|
|
18
|
+
/**
|
|
19
|
+
* Start mirroring one editor into the host canvas-state route.
|
|
20
|
+
* Returns a disposer that stops listening and marks the instance offline.
|
|
21
|
+
*/
|
|
22
|
+
export interface CanvasSyncStatus {
|
|
23
|
+
phase: 'idle' | 'preparing' | 'ready' | 'error';
|
|
24
|
+
count: number;
|
|
25
|
+
error?: string;
|
|
26
|
+
}
|
|
27
|
+
export type CanvasSyncHandle = (() => void) & {
|
|
28
|
+
retry(): void;
|
|
29
|
+
};
|
|
30
|
+
export declare function startCanvasSync(editor: Editor, onStatus?: (status: CanvasSyncStatus) => void): CanvasSyncHandle;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
interface EventEntry {
|
|
2
|
+
readonly type: string;
|
|
3
|
+
readonly event: {
|
|
4
|
+
readonly type: string;
|
|
5
|
+
readonly seq: number;
|
|
6
|
+
readonly data: Record<string, unknown>;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
interface EventSource {
|
|
10
|
+
getSnapshot(): {
|
|
11
|
+
readonly entries: readonly EventEntry[];
|
|
12
|
+
readonly change: {
|
|
13
|
+
readonly kind: string;
|
|
14
|
+
readonly entries?: readonly EventEntry[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
subscribe(listener: () => void): () => void;
|
|
18
|
+
}
|
|
19
|
+
/** Small runtime face: older hosts may not expose the modern session feed. */
|
|
20
|
+
export interface CanvasSessions {
|
|
21
|
+
list: {
|
|
22
|
+
getSnapshot(): {
|
|
23
|
+
current?: string | undefined;
|
|
24
|
+
byId?: Readonly<Record<string, {
|
|
25
|
+
id: string;
|
|
26
|
+
retainedBy?: Readonly<Record<string, number>>;
|
|
27
|
+
}>>;
|
|
28
|
+
};
|
|
29
|
+
subscribe(listener: () => void): () => void;
|
|
30
|
+
};
|
|
31
|
+
binding(id: string): {
|
|
32
|
+
eventSource: EventSource;
|
|
33
|
+
} | undefined;
|
|
34
|
+
}
|
|
35
|
+
/** Runtime face of uiSession.adapter.current; absent on older hosts. */
|
|
36
|
+
export interface CanvasSessionSelection {
|
|
37
|
+
getSnapshot(): {
|
|
38
|
+
readonly key?: string | undefined;
|
|
39
|
+
} | undefined;
|
|
40
|
+
subscribe(listener: () => void): () => void;
|
|
41
|
+
}
|
|
42
|
+
/** Keep one landing subscription while the optional UI service loads or unloads. */
|
|
43
|
+
export declare function createCanvasSessionSelection(): CanvasSessionSelection & {
|
|
44
|
+
bind(source: CanvasSessionSelection): () => void;
|
|
45
|
+
};
|
|
46
|
+
/** Subscribe to live additions, never to card rendering or history replay. */
|
|
47
|
+
export declare function startConversationLandings(sessions: CanvasSessions, selection?: CanvasSessionSelection): () => void;
|
|
48
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS.supports shim for tldraw's module-scope environment probe (#40).
|
|
3
|
+
*
|
|
4
|
+
* @tldraw/editor's tlenv initialization runs at import time and calls
|
|
5
|
+
* CSS.supports("color", "color(display-p3 1 1 1)") guarded only by
|
|
6
|
+
* `typeof CSS !== "undefined"`. Environments that expose a `CSS` global
|
|
7
|
+
* without the `supports` method (embedded webviews with partial globals,
|
|
8
|
+
* browsers predating the API) therefore throw "CSS.supports is not a
|
|
9
|
+
* function" while DSH imports the client entry, which aborts the whole
|
|
10
|
+
* plugin load - the image tools and gallery die together with the canvas.
|
|
11
|
+
*
|
|
12
|
+
* This module must be the first import of the client entry so it evaluates
|
|
13
|
+
* before any tldraw code. It installs a conservative `supports()` returning
|
|
14
|
+
* false only when the method is genuinely missing; modern browsers are
|
|
15
|
+
* untouched (the probe already treats false as "no P3 / no backdrop filter",
|
|
16
|
+
* which only downgrades the canvas color space, not the plugin).
|
|
17
|
+
*/
|
|
18
|
+
/** Install a fallback `supports` on a CSS-like object when the method is missing. */
|
|
19
|
+
export declare function ensureCssSupports(cssLike: {
|
|
20
|
+
supports?: unknown;
|
|
21
|
+
}): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import type { GalleryItem } from '../gallery-store.js';
|
|
3
|
+
/** An explicit alternative to native dragging, including a visible unavailable state. */
|
|
4
|
+
export declare const GalleryCanvasButton: FC<{
|
|
5
|
+
item: GalleryItem;
|
|
6
|
+
lang: 'zh' | 'en';
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
onToast(message: string): void;
|
|
10
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { GalleryItem } from '../gallery-store.js';
|
|
2
|
+
import type { TlLandingItem } from './tl-canvas-bridge.js';
|
|
3
|
+
export declare const GALLERY_IMAGE_MIME = "application/x-dsh-image-gen-gallery-image";
|
|
4
|
+
type DragStart = {
|
|
5
|
+
dataTransfer: DataTransfer | null;
|
|
6
|
+
preventDefault(): void;
|
|
7
|
+
};
|
|
8
|
+
export declare function galleryLanding(item: GalleryItem): TlLandingItem;
|
|
9
|
+
/** A real file also works when the host drops custom MIME data between containers. */
|
|
10
|
+
export declare function startGalleryImageDrag(event: DragStart, item: GalleryItem, blob: Blob | null | undefined): boolean;
|
|
11
|
+
export declare function readGalleryImageDrop(transfer: Pick<DataTransfer, 'getData'>): TlLandingItem | undefined;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { type Editor } from 'tldraw';
|
|
3
|
+
import { type TlLandingItem } from './tl-canvas-bridge.js';
|
|
4
|
+
/** Reset canvas-owned data only. Gallery records and host attachments are untouched. */
|
|
5
|
+
export declare function clearStudioTlCanvases(): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Cancel in-editor selection on every mounted canvas, keeping shapes and sync
|
|
8
|
+
* untouched. Selection is interaction state tied to the surface: leaving the
|
|
9
|
+
* studio page cancels it so a stale selection can neither resurface on return
|
|
10
|
+
* nor linger in the host mirror.
|
|
11
|
+
*/
|
|
12
|
+
export declare function deselectStudioTlCanvases(): boolean;
|
|
13
|
+
export declare function landTlItems(editor: Editor, items: readonly TlLandingItem[], isActive: () => boolean, onUnreadable?: () => void): Promise<boolean>;
|
|
14
|
+
export declare const StudioTlCanvas: FC<{
|
|
15
|
+
lang?: 'zh' | 'en';
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Editor } from 'tldraw';
|
|
2
|
+
/** Apply the brand theme patch to a freshly mounted tldraw editor. */
|
|
3
|
+
export declare function applyBrandTheme(editor: Editor): void;
|
|
4
|
+
/**
|
|
5
|
+
* Match tldraw's light/dark canvas to the DSH host theme. The host publishes
|
|
6
|
+
* dark mode as the data-ds-dark-theme attribute on <body>; tldraw keeps its
|
|
7
|
+
* own persisted user preference, so apply the host value now and observe
|
|
8
|
+
* later flips. Returns the observer disposer.
|
|
9
|
+
*/
|
|
10
|
+
export declare function syncTldrawThemeWithHost(editor: Editor): () => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for the brand colors used across the tldraw surface.
|
|
3
|
+
*
|
|
4
|
+
* Consumed by tl-theme-css.ts (DOM chrome via CSS variables) and
|
|
5
|
+
* tl-brand-theme.ts (canvas renderer via the runtime theme patch), so
|
|
6
|
+
* re-tinting the surface is a one-file change instead of a hex hunt across
|
|
7
|
+
* two files. Values mirror the workbench tokens in studio-style.ts
|
|
8
|
+
* (`--ig-blue` and friends).
|
|
9
|
+
*/
|
|
10
|
+
/** Brand blue, shared with studio-style.ts `--ig-blue`. */
|
|
11
|
+
export declare const BRAND_BLUE = "#2f64f5";
|
|
12
|
+
/** Brand blue RGB components, for composing rgba() tints in one place. */
|
|
13
|
+
export declare const BRAND_BLUE_RGB = "47, 100, 245";
|
|
14
|
+
/** Brand blue tuned for dark surfaces. */
|
|
15
|
+
export declare const BRAND_BLUE_DARK = "#5b83f8";
|
|
16
|
+
/** Brand blue (dark) RGB components, for composing rgba() tints. */
|
|
17
|
+
export declare const BRAND_BLUE_DARK_RGB = "91, 131, 248";
|
|
18
|
+
/** Cool ink from the workbench foreground family. */
|
|
19
|
+
export declare const BRAND_INK = "#182033";
|
|
20
|
+
/** Flat canvas surface; also feeds export backgrounds, so it stays solid. */
|
|
21
|
+
export declare const CANVAS_BG = "#e6ebf5";
|
|
22
|
+
/** Canvas gradient stops (top and bottom); the mid stop is CANVAS_BG. */
|
|
23
|
+
export declare const CANVAS_BG_TOP = "#eef2fa";
|
|
24
|
+
export declare const CANVAS_BG_BOTTOM = "#dfe6f4";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One-shot delivery into the persistent canvas document. The first mounted
|
|
3
|
+
* editor handles a batch; tldraw synchronizes the document to other editors.
|
|
4
|
+
* Delivered items are removed, so deleting a shape never triggers a replay.
|
|
5
|
+
*/
|
|
6
|
+
import type { ImageAttachmentRef } from '@deepseek-ai/dsh-attachment';
|
|
7
|
+
export interface TlLandingItem {
|
|
8
|
+
/** Gallery item id; also used to dedupe shapes via shape.meta.galleryId. */
|
|
9
|
+
galleryId: string;
|
|
10
|
+
attachment: ImageAttachmentRef;
|
|
11
|
+
/** Live conversation delivery; discard unfinished delivery when all canvases close. */
|
|
12
|
+
fromConversation?: boolean;
|
|
13
|
+
/** Explicit history actions must not resume after the last canvas closes. */
|
|
14
|
+
onlyWhileCanvasOpen?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Generation provenance copied onto the landed shape's meta: the canvas
|
|
17
|
+
* digest then tells the model how each image was made, so "regenerate this"
|
|
18
|
+
* or "vary this" reuses the original prompt and model instead of guessing.
|
|
19
|
+
* All optional; shapes landed from older paths simply carry none.
|
|
20
|
+
*/
|
|
21
|
+
prompt?: string;
|
|
22
|
+
provider?: string;
|
|
23
|
+
model?: string;
|
|
24
|
+
}
|
|
25
|
+
type TlLandingConsumer = (items: readonly TlLandingItem[]) => Promise<boolean>;
|
|
26
|
+
/** History actions must not silently queue into a canvas that is not open. */
|
|
27
|
+
export declare function hasTlLandingConsumer(): boolean;
|
|
28
|
+
export declare function subscribeTlLandingAvailability(listener: () => void): () => void;
|
|
29
|
+
export declare function sendTlLandingToOpenCanvas(item: TlLandingItem): boolean;
|
|
30
|
+
/** Invalidates async landings that started before the user cleared the canvas. */
|
|
31
|
+
export declare function getTlLandingGeneration(): number;
|
|
32
|
+
export declare function clearTlLandings(): void;
|
|
33
|
+
/** Queue freshly generated images for the tldraw canvases. Safe to call anywhere. */
|
|
34
|
+
export declare function pushTlLandings(newItems: readonly TlLandingItem[]): void;
|
|
35
|
+
/** Conversation results are admitted only while a canvas is mounted. */
|
|
36
|
+
export declare function pushTlLandingsLive(items: readonly TlLandingItem[]): void;
|
|
37
|
+
/** Register a ready editor. False means it unmounted before committing. */
|
|
38
|
+
export declare function registerTlLandingConsumer(consumer: TlLandingConsumer): () => void;
|
|
39
|
+
export {};
|