@huaweidevtools/aishell-dsh-brand 0.0.1-beta.2 → 0.0.1-beta.4
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 +1 -1
- package/README.md +16 -2
- package/lib/client.js +1404 -33
- package/lib/types/client/Brand.d.ts +39 -2
- package/lib/types/client/SuggestionCards.d.ts +94 -0
- package/lib/types/client/aishell-mark.d.ts +22 -0
- package/lib/types/client/autoplay.d.ts +67 -0
- package/lib/types/client/carousel.d.ts +96 -0
- package/lib/types/client/favicon-shadow.d.ts +55 -0
- package/lib/types/client/hero-content.d.ts +70 -0
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/locales.d.ts +66 -0
- package/lib/types/client/running-mark-shadow.d.ts +45 -0
- package/lib/types/client/running-text-shadow.d.ts +52 -0
- package/lib/types/client/suggestion-icons.d.ts +45 -0
- package/lib/types/client/suggestions.d.ts +118 -0
- package/package.json +10 -6
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inline SVG artwork for the suggestion cards.
|
|
3
|
+
*
|
|
4
|
+
* Inline rather than an icon dependency: the strip draws four shapes, and a
|
|
5
|
+
* dependency would add a package, a version to track, and a bundle face to
|
|
6
|
+
* keep in step with the host.
|
|
7
|
+
*
|
|
8
|
+
* Every path is drawn on a 24×24 viewBox with `currentColor`, so a card
|
|
9
|
+
* decides the colour by setting `color` and nothing here hard-codes a theme
|
|
10
|
+
* value.
|
|
11
|
+
*
|
|
12
|
+
* ## Shape rules, learned by getting them wrong
|
|
13
|
+
*
|
|
14
|
+
* The first draft drew "deploy" as a box with an arrow leaving it — which
|
|
15
|
+
* reads as SHARE or export, the one meaning this card must not carry. A
|
|
16
|
+
* glyph in a row of four is read at a glance and out of context, so each one
|
|
17
|
+
* has to be recognisable on its own:
|
|
18
|
+
*
|
|
19
|
+
* - nothing may resemble the share glyph (box + outward arrow) or the
|
|
20
|
+
* external-link glyph (box + arrow through a corner);
|
|
21
|
+
* - every shape is closed and filled-ish in silhouette, because outlines
|
|
22
|
+
* at 20px in a row of four blur into each other;
|
|
23
|
+
* - no glyph carries more than three strokes, so they stay distinguishable
|
|
24
|
+
* at the size they are actually drawn.
|
|
25
|
+
*
|
|
26
|
+
* These rules are not machine-checked: rendering the glyphs needs
|
|
27
|
+
* `react-dom/server`, which this repo does not depend on, and vitest here
|
|
28
|
+
* collects only `.spec.ts` (not `.tsx`). The browser harness in
|
|
29
|
+
* `scripts/render-check/` is what actually puts them on screen.
|
|
30
|
+
*
|
|
31
|
+
* @module @huaweidevtools/aishell-dsh-brand/client/suggestion-icons
|
|
32
|
+
*/
|
|
33
|
+
import type { ReactNode } from 'react';
|
|
34
|
+
import type { SuggestionIcon } from './suggestions.ts';
|
|
35
|
+
/** Props shared by every glyph. */
|
|
36
|
+
interface IconProps {
|
|
37
|
+
/** Rendered size in px; the cards use 20. */
|
|
38
|
+
readonly size?: number;
|
|
39
|
+
}
|
|
40
|
+
/** Resolve one icon key to its glyph. */
|
|
41
|
+
export declare function SuggestionIconArt({ icon, size, }: IconProps & {
|
|
42
|
+
readonly icon: SuggestionIcon;
|
|
43
|
+
}): ReactNode;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=suggestion-icons.d.ts.map
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The New-Session example cards, and the shapes they need.
|
|
3
|
+
*
|
|
4
|
+
* One array drives the whole strip: add or reorder a card by editing
|
|
5
|
+
* `SUGGESTIONS` and adding its three keys to `locales.ts`, and nothing else.
|
|
6
|
+
* The row renders whatever it is given — three or fewer display side by side
|
|
7
|
+
* with no arrows, more than three become a carousel.
|
|
8
|
+
*
|
|
9
|
+
* ## This file holds no copy
|
|
10
|
+
*
|
|
11
|
+
* Every string a person reads — the card title, its one-line gloss, and the
|
|
12
|
+
* prompt a click inserts — lives in `locales.ts`, addressed by the keys here.
|
|
13
|
+
* A card whose text were inlined would be readable in exactly one language,
|
|
14
|
+
* and the prompt it inserted would start a conversation in that language no
|
|
15
|
+
* matter what the reader's locale was.
|
|
16
|
+
*
|
|
17
|
+
* The three keys per card are separate rather than one blob because the
|
|
18
|
+
* surfaces differ: the card shows `title` and `gloss` (both clamped — one
|
|
19
|
+
* line and two lines — so a long string ellipsizes instead of breaking the
|
|
20
|
+
* row), while `prompt` goes to the composer and is never displayed on the
|
|
21
|
+
* card. A prompt that only restates its title makes the click pointless;
|
|
22
|
+
* written as a pair, the prompt carries the context and the expected output
|
|
23
|
+
* that make the first message worth sending without editing.
|
|
24
|
+
*
|
|
25
|
+
* ## Sizing, when editing copy
|
|
26
|
+
*
|
|
27
|
+
* Three cards share one row, which at the default column leaves roughly 150px
|
|
28
|
+
* per title — about seven CJK glyphs, or noticeably more Latin ones. Measured
|
|
29
|
+
* against the shipped set: every title fits at 560px and above, and all four
|
|
30
|
+
* clip below ~460px. Keep them within a couple of characters of each other —
|
|
31
|
+
* the longest one is otherwise the only card that ever shows an ellipsis,
|
|
32
|
+
* which reads as a bug rather than as a long name.
|
|
33
|
+
*
|
|
34
|
+
* @module @huaweidevtools/aishell-dsh-brand/client/suggestions
|
|
35
|
+
*/
|
|
36
|
+
import type { AishellBrandLocaleKey } from './locales.ts';
|
|
37
|
+
/** One example card: what it looks like, and what a click inserts. */
|
|
38
|
+
export interface Suggestion {
|
|
39
|
+
/**
|
|
40
|
+
* Stable identity for React keys and for the carousel's position maths.
|
|
41
|
+
* Not shown to anyone — it names the dictionary key prefix, so renaming it
|
|
42
|
+
* means renaming three keys in `locales.ts`.
|
|
43
|
+
*/
|
|
44
|
+
readonly id: string;
|
|
45
|
+
/** Icon key resolved by {@link SuggestionIconArt}. */
|
|
46
|
+
readonly icon: SuggestionIcon;
|
|
47
|
+
/** The tile colour, measured to work in both themes. See {@link SuggestionHue}. */
|
|
48
|
+
readonly hue: SuggestionHue;
|
|
49
|
+
/** Dictionary key for the card's one-line title. */
|
|
50
|
+
readonly titleKey: AishellBrandLocaleKey;
|
|
51
|
+
/** Dictionary key for the line under the title. */
|
|
52
|
+
readonly glossKey: AishellBrandLocaleKey;
|
|
53
|
+
/** Dictionary key for the text inserted into the composer. */
|
|
54
|
+
readonly promptKey: AishellBrandLocaleKey;
|
|
55
|
+
}
|
|
56
|
+
/** The icon set this strip can draw. Keys are local to this plugin. */
|
|
57
|
+
export type SuggestionIcon = 'cloud' | 'deploy' | 'architecture' | 'cost';
|
|
58
|
+
/**
|
|
59
|
+
* The tile colour for one card, as the shell's own token names.
|
|
60
|
+
*
|
|
61
|
+
* ## Why each card carries its own hue
|
|
62
|
+
*
|
|
63
|
+
* The first version drew every icon in one accent, on the reasoning that four
|
|
64
|
+
* hues beside the brand mark would read as noise. That was a guess, and the
|
|
65
|
+
* shell contradicts it: `FileTypeIcon` gives every item in a row its own hue
|
|
66
|
+
* (`code` blue, `excel` green, `folder` amber, `image` violet), which is the
|
|
67
|
+
* same situation — a row of small glyphs read at a glance — and it chooses
|
|
68
|
+
* per-item colour. Colour is what makes such a row scannable rather than a
|
|
69
|
+
* wall of identical tiles.
|
|
70
|
+
*
|
|
71
|
+
* ## These are STATIC tokens, not the semantic ones
|
|
72
|
+
*
|
|
73
|
+
* `--dsw-alias-state-success-primary` and friends mean "the operation
|
|
74
|
+
* succeeded" / "this needs attention". A card about cost is not a warning, so
|
|
75
|
+
* borrowing the warning colour would be a lie the palette tells. The `static`
|
|
76
|
+
* family is the one intended for decorative identity, which is exactly what a
|
|
77
|
+
* card's hue is — and `FileTypeIcon` reaches for the same family.
|
|
78
|
+
*
|
|
79
|
+
* ## The values were chosen by measurement, in both themes
|
|
80
|
+
*
|
|
81
|
+
* Violet is the exception: the design platform ships NO violet token, so
|
|
82
|
+
* `FileTypeIcon` defines one locally (`rgb(139, 118, 246)`) for its own
|
|
83
|
+
* artwork. The same value is reused here rather than inventing a second one,
|
|
84
|
+
* and it is the only literal colour in this plugin.
|
|
85
|
+
*
|
|
86
|
+
* The four were picked to clear three bars at once, in both themes:
|
|
87
|
+
*
|
|
88
|
+
* - glyph on its tile >= 4.5 — measured 5.42 at worst (violet);
|
|
89
|
+
* - tile against the card >= 1.6 — measured 2.05 at worst;
|
|
90
|
+
* - worst pairwise colour distance >= 30 (CIE76 dE) — measured 38.7.
|
|
91
|
+
*
|
|
92
|
+
* The last bar is the one that matters for "four colours, not one blur": an
|
|
93
|
+
* obvious-looking pick like blue + violet measures only 17.5 apart, which is
|
|
94
|
+
* why this is measured rather than eyeballed.
|
|
95
|
+
*/
|
|
96
|
+
export interface SuggestionHue {
|
|
97
|
+
/**
|
|
98
|
+
* The tile fill. A SOLID hue, with the glyph in `--dsw-alias-label-primary-
|
|
99
|
+
* foreground` on top.
|
|
100
|
+
*
|
|
101
|
+
* A tint of the hue was the first attempt and it measured badly: a glyph
|
|
102
|
+
* drawn in a hue on top of a tint of that same hue has almost nothing to
|
|
103
|
+
* separate them, so the contrast was 1.8–2.8 — and RAISING the tint made it
|
|
104
|
+
* worse, since more of the hue behind the glyph means less difference from
|
|
105
|
+
* it. A solid tile puts the glyph on full-strength colour instead, which
|
|
106
|
+
* measured 5.4–9.9 for the same hues.
|
|
107
|
+
*/
|
|
108
|
+
readonly tile: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* The cards, in display order.
|
|
112
|
+
*
|
|
113
|
+
* Order matters only for the ring's starting window: the strip opens on the
|
|
114
|
+
* first {@link VISIBLE} cards, so the first entries are the ones a person
|
|
115
|
+
* sees without pressing an arrow.
|
|
116
|
+
*/
|
|
117
|
+
export declare const SUGGESTIONS: readonly Suggestion[];
|
|
118
|
+
//# sourceMappingURL=suggestions.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huaweidevtools/aishell-dsh-brand",
|
|
3
3
|
"description": "AI Shell brand reskin for DSH web — replaces sidebar and hero brand marks with AI Shell SVG",
|
|
4
|
-
"version": "0.0.1-beta.
|
|
4
|
+
"version": "0.0.1-beta.4",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"inject": [
|
|
31
31
|
"@deepseek-ai/dsh-client-ui-renderer",
|
|
32
32
|
"@deepseek-ai/dsh-client-ui-sidebar",
|
|
33
|
-
"@deepseek-ai/dsh-client-ui-conversation"
|
|
33
|
+
"@deepseek-ai/dsh-client-ui-conversation",
|
|
34
|
+
"@deepseek-ai/dsh-client-locale"
|
|
34
35
|
],
|
|
35
36
|
"platform": "web"
|
|
36
37
|
},
|
|
@@ -44,12 +45,15 @@
|
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
47
|
"@deepseek-ai/cordis": "^4.0.4",
|
|
47
|
-
"@deepseek-ai/dsh-client-
|
|
48
|
-
"@deepseek-ai/dsh-client-ui-
|
|
49
|
-
"@deepseek-ai/dsh-client-ui-
|
|
50
|
-
"@deepseek-ai/dsh-client-ui-
|
|
48
|
+
"@deepseek-ai/dsh-client-locale": "0.2.0-rc.1 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1",
|
|
49
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.2.0-rc.1 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1",
|
|
50
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.0-rc.1 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1",
|
|
51
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "0.2.0-rc.1 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1",
|
|
52
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.0-rc.1 || 0.2.1-rc.1 || 0.2.1-rc.2 || 0.2.1",
|
|
51
53
|
"@types/react": "~18.3.1",
|
|
54
|
+
"@types/react-dom": "~18.3.1",
|
|
52
55
|
"react": "^18.2.0",
|
|
56
|
+
"react-dom": "^18.2.0",
|
|
53
57
|
"tsdown": "^0.10.0",
|
|
54
58
|
"typescript": "^5.7.0"
|
|
55
59
|
},
|