|
| 1 | +/** |
| 2 | + * Published `createUi()` config types, kept framework-free so the node |
| 3 | + * entry's declaration rollup (`dist/index.d.mts`) never pulls in Vue's type |
| 4 | + * surface. Client modules that need these types import them *from* here |
| 5 | + * (never the reverse) — see `client/state/branding.ts`, |
| 6 | + * `client/embedded/visibility.ts`. |
| 7 | + */ |
| 8 | + |
| 9 | +/** |
| 10 | + * A logo asset — a single URL/data-URI, or per-color-scheme variants. The dark |
| 11 | + * variant falls back to the light one when only `light` is given (or a bare |
| 12 | + * string is used for both). |
| 13 | + */ |
| 14 | +export type BrandingLogo = string | { light: string, dark: string } |
| 15 | + |
| 16 | +/** |
| 17 | + * Consumer-facing branding for the reference hub-ui. Every field is optional |
| 18 | + * and falls back to devframe's own identity. Published as |
| 19 | + * `ConnectionMeta.configs.ui.branding` via `createUi({ branding })`, and |
| 20 | + * read from the one connection handshake the dock already performs — |
| 21 | + * `ConnectionMeta` has its own cross-realm propagation (see |
| 22 | + * `DEVFRAME_CONNECTION_KEY`), so branding needs no globals or query params |
| 23 | + * of its own. |
| 24 | + */ |
| 25 | +export interface DevframeBranding { |
| 26 | + /** Product name — the wordmark, window titles, and all user-visible copy. */ |
| 27 | + productName?: string |
| 28 | + /** Logo mark (URL / data-URI), rendered via `<img>`. */ |
| 29 | + logo?: BrandingLogo |
| 30 | + /** Optional standalone wordmark image; when absent, mark + productName text is composed. */ |
| 31 | + wordmark?: BrandingLogo |
| 32 | + /** Brand color; feeds `--devframe-primary` and the whole primary ramp. */ |
| 33 | + primaryColor?: string |
| 34 | + /** Short line for the auth screen and the standalone meta description. */ |
| 35 | + tagline?: string |
| 36 | + /** Favicon URL — applied on the standalone viewer and the popped-out window only. */ |
| 37 | + favicon?: string |
| 38 | + /** Window/tab title; defaults to `productName`. */ |
| 39 | + windowTitle?: string |
| 40 | +} |
| 41 | + |
| 42 | +/** |
| 43 | + * The reference UI's dock-bar rendering preferences, set via |
| 44 | + * `createUi({ dockPreferences })` and published as |
| 45 | + * `ConnectionMeta.configs.ui.dockPreferences`. Read by the embedded dock and |
| 46 | + * the standalone viewer at boot. |
| 47 | + * |
| 48 | + * Like the float/edge dock mode, these seed user-overridable state — the |
| 49 | + * config sets the default, the visitor's own choice wins from then on. |
| 50 | + */ |
| 51 | +export interface DevframeDockPreferences { |
| 52 | + /** |
| 53 | + * The top-level dock-bar **category** ordering — a map of category id → |
| 54 | + * ordering weight (lower sorts earlier), merged beneath |
| 55 | + * `DEFAULT_CATEGORIES_ORDER`. |
| 56 | + */ |
| 57 | + categoryOrder?: Record<string, number> |
| 58 | + /** |
| 59 | + * Preferred inline-item capacity for the floating dock bar before entries |
| 60 | + * overflow. Edge mode ignores it — it shows every entry with no cutoff. |
| 61 | + */ |
| 62 | + maxVisibleItems?: number |
| 63 | + /** Seeds a first-run visitor's dock mode (float vs edge). */ |
| 64 | + defaultMode?: 'float' | 'edge' |
| 65 | + /** Seeds a first-run visitor's dock position. */ |
| 66 | + defaultPosition?: 'left' | 'right' | 'top' | 'bottom' |
| 67 | +} |
| 68 | + |
| 69 | +/** |
| 70 | + * How the embedded floating dock reveals itself on a fresh page — the |
| 71 | + * reference UI's port of Nuxt DevTools' opt-in overlay, published as |
| 72 | + * `ConnectionMeta.configs.ui.embeddedVisibility` and set via |
| 73 | + * `createUi({ embeddedVisibility })`. |
| 74 | + * |
| 75 | + * - `normal` (default) — the dock is shown immediately. |
| 76 | + * - `passive` — the dock starts hidden and a console hint offers the reveal |
| 77 | + * shortcut; revealing persists per-origin, so later sessions on this |
| 78 | + * browser start shown. The "Hide" command returns to passive. |
| 79 | + * - `hidden` — the dock starts hidden and the shortcut reveals it for the |
| 80 | + * current session only; nothing is persisted. |
| 81 | + * |
| 82 | + * Whatever the policy, the reveal state is a user-overridable preference — |
| 83 | + * the same shape as the float/edge dock mode: the config seeds it, the |
| 84 | + * visitor's own reveal/hide wins from then on. |
| 85 | + */ |
| 86 | +export type EmbeddedVisibility = 'normal' | 'passive' | 'hidden' |
0 commit comments