@wallarm-org/design-system 4.6.2 → 4.7.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.
Files changed (69) hide show
  1. package/dist/components/AgentAvatar/AgentAvatar.d.ts +45 -0
  2. package/dist/components/AgentAvatar/AgentAvatar.js +544 -0
  3. package/dist/components/AgentAvatar/AgentAvatarGroup.d.ts +12 -0
  4. package/dist/components/AgentAvatar/AgentAvatarGroup.js +25 -0
  5. package/dist/components/AgentAvatar/index.d.ts +4 -0
  6. package/dist/components/AgentAvatar/index.js +3 -0
  7. package/dist/components/AgentAvatar/useBakedLayers.d.ts +9 -0
  8. package/dist/components/AgentAvatar/useBakedLayers.js +75 -0
  9. package/dist/components/AgentAvatar/useCharacter.d.ts +39 -0
  10. package/dist/components/AgentAvatar/useCharacter.js +251 -0
  11. package/dist/components/AgentGlyph/AgentGlyph.d.ts +30 -0
  12. package/dist/components/AgentGlyph/AgentGlyph.js +192 -0
  13. package/dist/components/AgentGlyph/index.d.ts +4 -0
  14. package/dist/components/AgentGlyph/index.js +2 -0
  15. package/dist/components/AgentLookBuilder/index.d.ts +3 -0
  16. package/dist/components/AgentLookBuilder/index.js +2 -0
  17. package/dist/components/AgentLookBuilder/kit.d.ts +36 -0
  18. package/dist/components/AgentLookBuilder/kit.js +30 -0
  19. package/dist/components/Chat/ChatGreeting.d.ts +1 -1
  20. package/dist/components/Chat/ChatGreeting.js +95 -44
  21. package/dist/components/Chat/ChatHeaderTitle.d.ts +1 -1
  22. package/dist/components/Chat/ChatHeaderTitle.js +32 -29
  23. package/dist/components/WallySkeleton/WallySkeleton.js +92 -71
  24. package/dist/index.d.ts +2 -0
  25. package/dist/index.js +2 -0
  26. package/dist/lib/agent-characters/bake.d.ts +40 -0
  27. package/dist/lib/agent-characters/bake.js +220 -0
  28. package/dist/lib/agent-characters/canvas.d.ts +7 -0
  29. package/dist/lib/agent-characters/canvas.js +22 -0
  30. package/dist/lib/agent-characters/char.d.ts +32 -0
  31. package/dist/lib/agent-characters/char.js +375 -0
  32. package/dist/lib/agent-characters/color.d.ts +6 -0
  33. package/dist/lib/agent-characters/color.js +20 -0
  34. package/dist/lib/agent-characters/data.gen.d.ts +106 -0
  35. package/dist/lib/agent-characters/data.gen.js +3854 -0
  36. package/dist/lib/agent-characters/engine.d.ts +206 -0
  37. package/dist/lib/agent-characters/engine.js +1241 -0
  38. package/dist/lib/agent-characters/eyes.d.ts +18 -0
  39. package/dist/lib/agent-characters/eyes.js +132 -0
  40. package/dist/lib/agent-characters/geom.d.ts +23 -0
  41. package/dist/lib/agent-characters/geom.js +109 -0
  42. package/dist/lib/agent-characters/glyph.d.ts +21 -0
  43. package/dist/lib/agent-characters/glyph.js +126 -0
  44. package/dist/lib/agent-characters/look.d.ts +24 -0
  45. package/dist/lib/agent-characters/look.js +68 -0
  46. package/dist/lib/agent-characters/motion.d.ts +73 -0
  47. package/dist/lib/agent-characters/motion.js +1215 -0
  48. package/dist/lib/agent-characters/paths.d.ts +13 -0
  49. package/dist/lib/agent-characters/paths.js +118 -0
  50. package/dist/lib/agent-characters/places.d.ts +76 -0
  51. package/dist/lib/agent-characters/places.js +64 -0
  52. package/dist/lib/agent-characters/propOf.d.ts +7 -0
  53. package/dist/lib/agent-characters/propOf.js +20 -0
  54. package/dist/lib/agent-characters/props.d.ts +4 -0
  55. package/dist/lib/agent-characters/props.js +337 -0
  56. package/dist/lib/agent-characters/queue.d.ts +23 -0
  57. package/dist/lib/agent-characters/queue.js +73 -0
  58. package/dist/lib/agent-characters/runtime.d.ts +69 -0
  59. package/dist/lib/agent-characters/runtime.js +178 -0
  60. package/dist/lib/agent-characters/svg.d.ts +6 -0
  61. package/dist/lib/agent-characters/svg.js +6 -0
  62. package/dist/lib/agent-characters/worker.d.ts +6 -0
  63. package/dist/lib/agent-characters/worker.js +94 -0
  64. package/dist/metadata/components.json +689 -276
  65. package/dist/theme/components/agent-avatar.css +42 -0
  66. package/dist/theme/index.css +1 -0
  67. package/dist/utils/renderSvgNode.d.ts +4 -0
  68. package/dist/utils/renderSvgNode.js +12 -0
  69. package/package.json +2 -1
@@ -0,0 +1,206 @@
1
+ import type { AgentLook } from './data.gen.js';
2
+ import { type EyePose, type StateId } from './eyes.js';
3
+ import { shapeOf } from './geom.js';
4
+ import { type Ease, type Key } from './motion.js';
5
+ import { type LiveChar } from './runtime.js';
6
+ type Look = Pick<AgentLook, 'shape' | 'color' | 'eyes' | 'prop'>;
7
+ type Cue = Element | (() => Element | null | undefined) | null | undefined;
8
+ export interface CharacterOptions {
9
+ size: number;
10
+ state: StateId;
11
+ live: boolean;
12
+ /** Partial coverage: the crown from the first frame */
13
+ cover?: boolean;
14
+ /** the seed salt (the agent uid); the name part of the page's seed is empty */
15
+ salt: string;
16
+ /** Done and Hello return on their timers; required for greet() */
17
+ autoReturn?: boolean;
18
+ /** false disables the idle repertoire */
19
+ rep?: boolean;
20
+ /** the Set up control: an element or a function returning one */
21
+ cue?: Cue;
22
+ /** a state change the character made on its own (a one-shot returning, the landing ending, Cover all) */
23
+ onState?: (st: StateId, from: StateId) => void;
24
+ /** the state a one-shot returns to; the page always returns to On duty (D27: the data's state) */
25
+ returnTo?: () => StateId;
26
+ /** the grey veil layers are needed (Not set up, Inviting, the landing, the crown) */
27
+ requestVeil?: () => void;
28
+ /** Cover all's fill has ended and dropped the crown */
29
+ onCoverEnd?: () => void;
30
+ }
31
+ interface Clip {
32
+ keys: readonly Key[];
33
+ t0: number;
34
+ act?: 1;
35
+ inv?: 1;
36
+ perk?: 1;
37
+ beat?: 1;
38
+ hw?: 1;
39
+ tilt?: 1;
40
+ hop?: 1;
41
+ wob?: 1;
42
+ cvt?: 1;
43
+ kind?: string;
44
+ gaze?: boolean;
45
+ slow?: boolean;
46
+ rel?: number;
47
+ relMs?: number;
48
+ ease?: Ease;
49
+ onEnd?: (now: number) => void;
50
+ }
51
+ export declare class Character implements LiveChar {
52
+ readonly svg: SVGSVGElement;
53
+ readonly c: Look;
54
+ readonly S: ReturnType<typeof shapeOf>;
55
+ readonly o: CharacterOptions;
56
+ st: StateId;
57
+ visible: boolean;
58
+ rectDirty: boolean;
59
+ clips: Clip[];
60
+ /** the other characters of its row or list, for the look-around */
61
+ peers: Character[] | null;
62
+ fid: {
63
+ k: string;
64
+ px: number;
65
+ py: number;
66
+ } | null;
67
+ cover: boolean;
68
+ private readonly rt;
69
+ private readonly timers;
70
+ private disposed;
71
+ private readonly fig;
72
+ private readonly ef;
73
+ private readonly eg;
74
+ private readonly eyes;
75
+ private readonly vglow;
76
+ private readonly sha;
77
+ private readonly shc;
78
+ private readonly props;
79
+ private readonly pa;
80
+ private readonly beam;
81
+ private readonly glint;
82
+ private readonly stitch;
83
+ private readonly veilr;
84
+ private readonly E;
85
+ private readonly gx;
86
+ private readonly gy;
87
+ private readonly sq;
88
+ private readonly wt;
89
+ private blink;
90
+ private flicker;
91
+ private land;
92
+ private readonly r;
93
+ private readonly rate;
94
+ private readonly bias;
95
+ private readonly phase;
96
+ private nextBlink;
97
+ private nextGlance;
98
+ private nextHop;
99
+ private read;
100
+ private ghostT;
101
+ private figOp;
102
+ private readonly propScale;
103
+ private rect;
104
+ private rectE;
105
+ private readonly r2;
106
+ private nextBeat;
107
+ private nextAct;
108
+ private lastAct;
109
+ private pv;
110
+ private lastPg;
111
+ private hl;
112
+ private inv;
113
+ private doneT;
114
+ private covHT;
115
+ private covT;
116
+ private covY;
117
+ private cov;
118
+ private topping;
119
+ private reachN;
120
+ private lastReach;
121
+ private cueK;
122
+ private dbl;
123
+ private lt;
124
+ private lastD?;
125
+ private lastB?;
126
+ private lastT?;
127
+ private lastFo?;
128
+ private lastV?;
129
+ private lastSa?;
130
+ private lastSc?;
131
+ private lastPs?;
132
+ private lastPa?;
133
+ private lastBeam?;
134
+ private lastGl?;
135
+ private lastSo?;
136
+ constructor(svg: SVGSVGElement, c: Look, o: CharacterOptions);
137
+ /** setTimeout that dispose() clears */
138
+ private later;
139
+ private clear;
140
+ private isLive;
141
+ targets(st: StateId): EyePose;
142
+ private setTargets;
143
+ private snap;
144
+ private startBlink;
145
+ private returnTo;
146
+ private emit;
147
+ private applyState;
148
+ private requestVeil;
149
+ /** the grey felt shows for the ghost, "Inviting" and the crown */
150
+ private ghostCls;
151
+ /** "Partial coverage": the top of the head stays in the ghost's grey felt down to a crisp line */
152
+ setCover(onIn: boolean): void;
153
+ /** Cover all is filling the crown (it ends partial coverage on its own at 480 ms) */
154
+ get filling(): boolean;
155
+ /** "Cover all applications": the line rises to the top in 480 ms; Done at 360 ms, no grey after 480 ms */
156
+ coverAll(): void;
157
+ /** toward the centre of the Set up control; null when it is missing or hidden */
158
+ private cueDir;
159
+ /** hover or focus on the fix. "Inviting": turns to Set up and ends the timed invites. "Partial coverage": the
160
+ * line rises 35% after 150 ms */
161
+ cueHover(on: boolean): void;
162
+ /** "Inviting": three invites per view at most, one inviter per document, news first; true while an invite or a
163
+ * hover owns the gaze */
164
+ private invTick;
165
+ /** one hop and one wobble at a time */
166
+ private clipBusy;
167
+ hop(now: number, hgt?: number): void;
168
+ private releaseClips;
169
+ private helloClips;
170
+ /** product hook: an avatar says hello when its panel opens */
171
+ greet(): void;
172
+ private beat;
173
+ /** quieter when small */
174
+ private actGap;
175
+ private repOn;
176
+ /** builder: loop one behaviour, or back to "Auto" */
177
+ preview(k: string | null): void;
178
+ box(): {
179
+ x: number;
180
+ y: number;
181
+ };
182
+ /** toward one of the two nearest neighbours (peers), else a random side */
183
+ private lookDir;
184
+ private pick;
185
+ /** push one behaviour clip; returns its length in ms */
186
+ play(kind: string, now: number): number;
187
+ /** the idle scheduler; true while a behaviour owns the gaze */
188
+ private actTick;
189
+ /** from "Inviting" it starts grounded and solid, with its full shadow */
190
+ private startLanding;
191
+ private floatY;
192
+ /** a landing always finishes; the last pick applies at its end */
193
+ setState(st: StateId): void;
194
+ private life;
195
+ tick(now: number, dt: number, beat?: boolean): void;
196
+ /** anything that must stay at full frame rate */
197
+ private busy;
198
+ render(now: number): void;
199
+ /** Explicit unmount: every timer, the runtime registration and the inviter slot. */
200
+ dispose(): void;
201
+ }
202
+ /** The page's makeChar tail: the character on an SVG rendered from charTree(), live when asked and motion is on. */
203
+ export declare function createCharacter(svg: SVGSVGElement, c: Look, o: CharacterOptions): Character;
204
+ /** Adds a character to a row of neighbours (the page sets `peers` per row); returns how to leave it. */
205
+ export declare function joinPeers(row: Set<Character>, ch: Character): () => void;
206
+ export {};