@oxy.so/bloom 19.11.0 → 21.0.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/docs/adoption-matrix.mdx +1 -1
- package/docs/agent-avatar.mdx +20 -0
- package/docs/agent-creator.mdx +20 -12
- package/docs/multi-agent-chat.mdx +5 -0
- package/docs/task-catalog.json +1 -1
- package/docs/task-catalog.mdx +1 -1
- package/lib/commonjs/agent-avatar/character.js +27 -0
- package/lib/commonjs/agent-avatar/character.js.map +1 -1
- package/lib/commonjs/agent-avatar/index.js +6 -0
- package/lib/commonjs/agent-avatar/index.js.map +1 -1
- package/lib/commonjs/agent-creator/AgentCreatorBase.js +31 -24
- package/lib/commonjs/agent-creator/AgentCreatorBase.js.map +1 -1
- package/lib/commonjs/agent-creator/paint.js +59 -0
- package/lib/commonjs/agent-creator/paint.js.map +1 -0
- package/lib/commonjs/agent-creator/use-character-history.js +12 -9
- package/lib/commonjs/agent-creator/use-character-history.js.map +1 -1
- package/lib/commonjs/avatar/Avatar.js +12 -4
- package/lib/commonjs/avatar/Avatar.js.map +1 -1
- package/lib/commonjs/avatar/account.js +9 -3
- package/lib/commonjs/avatar/account.js.map +1 -1
- package/lib/commonjs/multi-agent-chat/Marketplace.js +1 -1
- package/lib/commonjs/multi-agent-chat/Marketplace.js.map +1 -1
- package/lib/commonjs/multi-agent-chat/MultiAgentChatBase.js +6 -6
- package/lib/commonjs/multi-agent-chat/MultiAgentChatBase.js.map +1 -1
- package/lib/commonjs/multi-agent-chat/SelectedAgentPreview.js +2 -1
- package/lib/commonjs/multi-agent-chat/SelectedAgentPreview.js.map +1 -1
- package/lib/commonjs/multi-agent-chat/data.js +58 -39
- package/lib/commonjs/multi-agent-chat/data.js.map +1 -1
- package/lib/commonjs/multi-agent-chat/marketplace-data.js +21 -27
- package/lib/commonjs/multi-agent-chat/marketplace-data.js.map +1 -1
- package/lib/module/agent-avatar/character.js +26 -0
- package/lib/module/agent-avatar/character.js.map +1 -1
- package/lib/module/agent-avatar/index.js +1 -1
- package/lib/module/agent-avatar/index.js.map +1 -1
- package/lib/module/agent-creator/AgentCreatorBase.js +31 -24
- package/lib/module/agent-creator/AgentCreatorBase.js.map +1 -1
- package/lib/module/agent-creator/paint.js +53 -0
- package/lib/module/agent-creator/paint.js.map +1 -0
- package/lib/module/agent-creator/use-character-history.js +7 -4
- package/lib/module/agent-creator/use-character-history.js.map +1 -1
- package/lib/module/avatar/Avatar.js +12 -4
- package/lib/module/avatar/Avatar.js.map +1 -1
- package/lib/module/avatar/account.js +9 -3
- package/lib/module/avatar/account.js.map +1 -1
- package/lib/module/multi-agent-chat/Marketplace.js +2 -2
- package/lib/module/multi-agent-chat/Marketplace.js.map +1 -1
- package/lib/module/multi-agent-chat/MultiAgentChatBase.js +7 -7
- package/lib/module/multi-agent-chat/MultiAgentChatBase.js.map +1 -1
- package/lib/module/multi-agent-chat/SelectedAgentPreview.js +2 -1
- package/lib/module/multi-agent-chat/SelectedAgentPreview.js.map +1 -1
- package/lib/module/multi-agent-chat/data.js +58 -40
- package/lib/module/multi-agent-chat/data.js.map +1 -1
- package/lib/module/multi-agent-chat/marketplace-data.js +21 -27
- package/lib/module/multi-agent-chat/marketplace-data.js.map +1 -1
- package/lib/typescript/commonjs/agent-avatar/character.d.ts +14 -0
- package/lib/typescript/commonjs/agent-avatar/character.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-avatar/index.d.ts +1 -1
- package/lib/typescript/commonjs/agent-avatar/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-creator/AgentCreatorBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-creator/paint.d.ts +25 -0
- package/lib/typescript/commonjs/agent-creator/paint.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-creator/types.d.ts +11 -0
- package/lib/typescript/commonjs/agent-creator/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-creator/use-character-history.d.ts +6 -2
- package/lib/typescript/commonjs/agent-creator/use-character-history.d.ts.map +1 -1
- package/lib/typescript/commonjs/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/commonjs/avatar/account.d.ts +4 -2
- package/lib/typescript/commonjs/avatar/account.d.ts.map +1 -1
- package/lib/typescript/commonjs/avatar/types.d.ts +5 -0
- package/lib/typescript/commonjs/avatar/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/multi-agent-chat/Marketplace.d.ts.map +1 -1
- package/lib/typescript/commonjs/multi-agent-chat/MultiAgentChatBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/multi-agent-chat/SelectedAgentPreview.d.ts +1 -1
- package/lib/typescript/commonjs/multi-agent-chat/SelectedAgentPreview.d.ts.map +1 -1
- package/lib/typescript/commonjs/multi-agent-chat/data.d.ts +4 -1
- package/lib/typescript/commonjs/multi-agent-chat/data.d.ts.map +1 -1
- package/lib/typescript/commonjs/multi-agent-chat/marketplace-data.d.ts +3 -0
- package/lib/typescript/commonjs/multi-agent-chat/marketplace-data.d.ts.map +1 -1
- package/lib/typescript/module/agent-avatar/character.d.ts +14 -0
- package/lib/typescript/module/agent-avatar/character.d.ts.map +1 -1
- package/lib/typescript/module/agent-avatar/index.d.ts +1 -1
- package/lib/typescript/module/agent-avatar/index.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/AgentCreatorBase.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/paint.d.ts +25 -0
- package/lib/typescript/module/agent-creator/paint.d.ts.map +1 -0
- package/lib/typescript/module/agent-creator/types.d.ts +11 -0
- package/lib/typescript/module/agent-creator/types.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/use-character-history.d.ts +6 -2
- package/lib/typescript/module/agent-creator/use-character-history.d.ts.map +1 -1
- package/lib/typescript/module/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/module/avatar/account.d.ts +4 -2
- package/lib/typescript/module/avatar/account.d.ts.map +1 -1
- package/lib/typescript/module/avatar/types.d.ts +5 -0
- package/lib/typescript/module/avatar/types.d.ts.map +1 -1
- package/lib/typescript/module/multi-agent-chat/Marketplace.d.ts.map +1 -1
- package/lib/typescript/module/multi-agent-chat/MultiAgentChatBase.d.ts.map +1 -1
- package/lib/typescript/module/multi-agent-chat/SelectedAgentPreview.d.ts +1 -1
- package/lib/typescript/module/multi-agent-chat/SelectedAgentPreview.d.ts.map +1 -1
- package/lib/typescript/module/multi-agent-chat/data.d.ts +4 -1
- package/lib/typescript/module/multi-agent-chat/data.d.ts.map +1 -1
- package/lib/typescript/module/multi-agent-chat/marketplace-data.d.ts +3 -0
- package/lib/typescript/module/multi-agent-chat/marketplace-data.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/agent-avatar/character.ts +30 -0
- package/src/agent-avatar/index.ts +1 -0
- package/src/agent-creator/AgentCreatorBase.tsx +30 -24
- package/src/agent-creator/paint.ts +58 -0
- package/src/agent-creator/types.ts +11 -0
- package/src/agent-creator/use-character-history.ts +8 -4
- package/src/avatar/Avatar.tsx +13 -3
- package/src/avatar/account.ts +9 -3
- package/src/avatar/types.ts +5 -0
- package/src/multi-agent-chat/Marketplace.tsx +6 -2
- package/src/multi-agent-chat/MultiAgentChatBase.tsx +7 -6
- package/src/multi-agent-chat/SelectedAgentPreview.tsx +2 -2
- package/src/multi-agent-chat/data.ts +60 -27
- package/src/multi-agent-chat/marketplace-data.ts +28 -9
package/docs/adoption-matrix.mdx
CHANGED
|
@@ -325,7 +325,7 @@ None.
|
|
|
325
325
|
| `tenancy` | `@oxy.so/bloom/tenancy` + barrel | universal | `tenancy.mdx` | yes | 5 | | reads | | |
|
|
326
326
|
| `text-field` | `@oxy.so/bloom/text-field` + barrel | universal | `text-field.mdx` | yes | 27 | reads | reads | | |
|
|
327
327
|
| `textarea` | `@oxy.so/bloom/textarea` + barrel | universal | `textarea.mdx` | yes | 6 | reads | reads | | n/a¹ |
|
|
328
|
-
| `theme` | `@oxy.so/bloom/theme` + barrel | web fork | `theme.mdx` | yes |
|
|
328
|
+
| `theme` | `@oxy.so/bloom/theme` + barrel | web fork | `theme.mdx` | yes | 695 | | | n/a¹ | reads |
|
|
329
329
|
| `theme-toggle` | `@oxy.so/bloom/theme-toggle` + barrel | universal | `theme-toggle.mdx` | yes | 2 | n/a¹ | | | |
|
|
330
330
|
| `toast` | `@oxy.so/bloom/toast` + barrel | universal | `toast.mdx` | yes | 21 | | | | |
|
|
331
331
|
| `tooltip` | `@oxy.so/bloom/tooltip` + barrel | web fork | `tooltip.mdx` | yes | 8 | | reads | | |
|
package/docs/agent-avatar.mdx
CHANGED
|
@@ -97,6 +97,26 @@ in current choices or templates.
|
|
|
97
97
|
`bodyColor` and the other way round; the two are never held together.
|
|
98
98
|
- `characterFromLegacy(saved)` migrates an avatar saved before 10 (see
|
|
99
99
|
[Migrating to 10.0](/docs/migrating-to-10.0)).
|
|
100
|
+
- `avatarCharacterInColor(character, color)` paints a character in its ACCOUNT's colour:
|
|
101
|
+
`color` is what Oxy stores as `User.color`: a Bloom colour preset key or a hex (`#rrggbb`,
|
|
102
|
+
`#rgb`), both ordinary account colours. The body takes the preset's identity seed, or the hex,
|
|
103
|
+
lifted to the skin floor, as `bodyColor` (so a hex an editor wrote back paints exactly itself); every part is kept and `color` is dropped. A colour that does not resolve
|
|
104
|
+
(`null`, `undefined`, an unknown key) returns the character unchanged. This is the one place a
|
|
105
|
+
account colour becomes an avatar paint: a bot is drawn in the colour its profile is themed with.
|
|
106
|
+
|
|
107
|
+
### A bot is drawn in its account's colour
|
|
108
|
+
|
|
109
|
+
An agent's colour belongs to its account, not to its character. Store the character's parts
|
|
110
|
+
(no `color`, no `bodyColor`) and paint it at the edge:
|
|
111
|
+
|
|
112
|
+
```tsx
|
|
113
|
+
<AgentAvatar character={avatarCharacterInColor(agent.character, agent.account.color)} />
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
`Avatar` does it for you: a `kind: 'bot'` account (`<Avatar account={user} />`) is drawn as its
|
|
117
|
+
`character` painted in the account's `color` (`AvatarAccount.color`). Without a colour the
|
|
118
|
+
character's own paint (or its preset's) applies, and a character with no paint at all falls back to
|
|
119
|
+
the account's image and initials as any undrawable character does.
|
|
100
120
|
|
|
101
121
|
### Which animation plays
|
|
102
122
|
|
package/docs/agent-creator.mdx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: AgentCreator
|
|
3
|
-
description: Controlled agent profile editor with a live SVG avatar, eye orbit, shape arc,
|
|
3
|
+
description: Controlled agent profile editor with a live SVG avatar, eye orbit, shape arc, the agent's account colour, and speech preferences.
|
|
4
4
|
order: 105
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AgentCreator
|
|
8
8
|
|
|
9
|
-
A controlled editor for an agent's name, label, description, appearance and response preferences. The host owns the agent, saving, and the surrounding panel. The implementation is shared across web, iOS and Android; the platform entry points bind Bloom's existing select and popover surfaces.
|
|
9
|
+
A controlled editor for an agent's name, label, description, colour, appearance and response preferences. The host owns the agent, saving, and the surrounding panel. The implementation is shared across web, iOS and Android; the platform entry points bind Bloom's existing select and popover surfaces.
|
|
10
10
|
|
|
11
11
|
```tsx
|
|
12
12
|
import { useState } from 'react';
|
|
@@ -15,6 +15,7 @@ import { AgentCreator, type AgentCreatorAgent } from '@oxy.so/bloom/agent-creato
|
|
|
15
15
|
const [agent, setAgent] = useState<AgentCreatorAgent>({
|
|
16
16
|
id: 'designer', name: 'Designer', label: 'Design', description: '',
|
|
17
17
|
avatar: { preset: 'blue_beret' },
|
|
18
|
+
color: 'lagoon',
|
|
18
19
|
});
|
|
19
20
|
|
|
20
21
|
<AgentCreator agent={agent} onChange={setAgent} onClose={closePanel} />;
|
|
@@ -24,10 +25,15 @@ Mount under `BloomProvider` and give the editor a bounded height. Layout classes
|
|
|
24
25
|
|
|
25
26
|
## Appearance
|
|
26
27
|
|
|
27
|
-
`agent.avatar` is an `AvatarCharacter` ([Agent Avatar](/docs/agent-avatar))
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
`agent.avatar` is an `AvatarCharacter` ([Agent Avatar](/docs/agent-avatar)) without a colour of its
|
|
29
|
+
own: `{ preset }` or complete parts. `agent.color` is the agent's colour, its ACCOUNT's (`User.color`
|
|
30
|
+
in Oxy: a Bloom colour preset key or a `#rrggbb`, any colour), and it is the only colour the editor
|
|
31
|
+
knows: every character it draws is painted in it (`avatarCharacterInColor`), and every character
|
|
32
|
+
it hands back carries its parts and no paint (`color` and `bodyColor` are dropped, undo and redo
|
|
33
|
+
included). A colour Bloom cannot resolve leaves a character's own paint (or its preset's); a
|
|
34
|
+
character with neither is drawn in the first named swatch. Every part control writes one edit through
|
|
35
|
+
`updateAvatarCharacter`, so the saved character is always written out in full: choosing a body
|
|
36
|
+
keeps the face and the hat.
|
|
31
37
|
|
|
32
38
|
The preview is 162px. The editor, eye chips and shape silhouettes use the shared production SVG
|
|
33
39
|
renderer. No hosted character engine is required. The controlled `AvatarCharacter`
|
|
@@ -35,16 +41,16 @@ contract and the profile/preferences layout are unchanged.
|
|
|
35
41
|
|
|
36
42
|
- **Shape arc:** 28 distinct silhouettes, including the 13 flat forms, in one 210px circular track (an unbounded index, spring, drag and wheel). Press a silhouette; arrows, Home and End select on web. Crossing between bodies retains the mounted avatar. RTL reverses horizontal movement.
|
|
37
43
|
- **Eye orbit:** the 12 current eye styles, including Todd and Clippo. Each body defines its own eye positions and size, so every style follows the layout of the shape it sits on.
|
|
38
|
-
- **
|
|
44
|
+
- **Colour:** nine glossy named swatches (`CHARACTER_COLORS`) and a custom `#rrggbb` picker behind the rainbow swatch. Either writes the ACCOUNT's colour: `onChange({ ...agent, color })` with the hex lifted to the avatar skin floor (`normalizeAvatarSkinColor`), so the stored colour is exactly the drawn one. Any colour can be chosen; nothing restricts it to presets. A named swatch is active when its lifted hex equals the body hex of `agent.color`; the custom swatch is active, showing that colour, when it equals none of the nine (a preset key, say). The custom picker opens on the body hex. A colour change is not a character edit and does not enter the undo history.
|
|
39
45
|
- **Template, eyewear and accessory:** Bloom Select rows. Templates (`CHARACTER_TEMPLATES`) are creation choices, complete characters that start Felipe orange with sleepy eyes where the saved `blue_beret` preset is blue with oval ones; a character that is exactly one shows its name, and any edit shows Custom.
|
|
40
46
|
|
|
41
47
|
Upright eye chips orbit at a 116px radius; dragging or a mouse wheel rotates the orbit. Hover, focus, backgrounding and reduced motion pause automatic movement. The shape selector uses a 210px circular track, an unbounded index, spring, drag and wheel geometry. Choose a silhouette by pressing it; keyboard arrows, Home and End select shapes on web. BloomProvider’s direction reverses horizontal movement in RTL.
|
|
42
48
|
|
|
43
49
|
Appearance selection updates immediately. While the selected geometry is being prepared, a localized live status announces the work; an older asynchronous response cannot replace the latest selection. Only the two neighboring silhouette recipes are prepared during idle time, rather than loading the entire catalog.
|
|
44
50
|
|
|
45
|
-
Undo and redo retain up to 50 immutable character snapshots without changing the name, description, or speech preferences.
|
|
51
|
+
Undo and redo retain up to 50 immutable character snapshots without changing the name, description, colour, or speech preferences. Characters compare by their parts, so a change of paint alone is no edit. Restore original returns to the character at the start of this editing session and can itself be undone. Switching agent IDs or receiving a genuinely external character replacement starts a new baseline; controlled echoes and profile-only changes retain history. On web, Ctrl/Cmd+Z and redo shortcuts work inside the editor without intercepting text input undo.
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
The custom picker contains a saturation/brightness field, hue rail and hex entry. The visible field and every committed hex use the shared minimum skin lightness (L* 45); typing a darker hex shows its permitted normalized value. HSV state preserves the selected hue while dragging through gray; invalid hex input writes nothing. The sampled SVG field is memoized separately, so saturation/brightness dragging moves the thumb without rebuilding the color field. A preset key paints the body its identity seed, lifted the same way, so the avatar is drawn in the colour the agent's profile is themed with. Speech, colour and appearance edits preserve the agent’s identity and unrelated fields.
|
|
48
54
|
|
|
49
55
|
Equivalent legacy shape IDs share one editor choice. Opening a saved avatar only aliases its selected chip; it never rewrites its shape or template. Selecting a different silhouette writes the chosen canonical ID. Catalog comparison stories retain all saved IDs for compatibility inspection.
|
|
50
56
|
|
|
@@ -90,10 +96,12 @@ Fixed labels, hints and accessible control names use the `AGENT_CREATOR_MESSAGES
|
|
|
90
96
|
|
|
91
97
|
Profile inputs, textarea, select, switch, segmented control, close control and popover reuse Bloom’s current primitives. Original layout and interaction class chains are retained. Bloom’s active palette and materials supply their colors. The custom HSV picker reads `Field` membership: disabling the enclosing field disables its gestures, keyboard updates and hex input; field errors and descriptions associate with its inputs.
|
|
92
98
|
|
|
93
|
-
The original rainbow artwork and glossy color artwork are retained.
|
|
99
|
+
The original rainbow artwork and glossy color artwork are retained.
|
|
100
|
+
|
|
101
|
+
Web applies the original shape mask and scroll blur; native uses SVG clipping and edge gradients for CSS effects its renderer cannot express. Native gesture hit areas remain rectangular, and native scroll fades do not apply a backdrop blur. These adaptations need device verification.
|
|
94
102
|
|
|
95
103
|
## Validation boundary
|
|
96
104
|
|
|
97
|
-
Tests verify profile and avatar edits preserve unrelated data, preference updates, host speech preview,
|
|
105
|
+
Tests verify profile and avatar edits preserve unrelated data, preference updates, host speech preview, colour changes written as the account's hex, paintless characters, canonical shape choices, SVG rendering selection for every preview, and availability without a hosted engine. Jest does not execute gesture arbitration or the Reanimated frame loop; motion, wheel hit testing, custom picker dragging, and native speech providers require browser/device verification.
|
|
98
106
|
|
|
99
|
-
Track listeners retain their DOM attachment and read current callbacks; changing profile text does not rebuild shape/eye choices.
|
|
107
|
+
Track listeners retain their DOM attachment and read current callbacks; changing profile text does not rebuild shape/eye choices. Tests also cover callback replacement, wheel removal, disabled pending gestures, unmount cancellation and translated choice updates.
|
|
@@ -53,6 +53,11 @@ edits for host persistence. The workspace persists in `storage` — the same
|
|
|
53
53
|
`localStorage` on the web; native keeps session state unless one is passed.
|
|
54
54
|
Invalid stored data falls back to the initial demo.
|
|
55
55
|
|
|
56
|
+
An agent is an [`AgentCreatorAgent`](./agent-creator.mdx): its `avatar` holds the character's
|
|
57
|
+
parts and its `color` (an account colour: a Bloom colour preset key or a `#rrggbb`) is its colour. Every avatar the workspace draws
|
|
58
|
+
for an agent, the marketplace's bots included, is `avatarCharacterInColor(agent.avatar,
|
|
59
|
+
agent.color)`. A workspace saved before agents had a colour restores them in `blue`.
|
|
60
|
+
|
|
56
61
|
`defaultEditorId` initially opens an agent's editor on desktop. On compact
|
|
57
62
|
layouts the editor becomes the selected panel; its back action returns to the
|
|
58
63
|
conversation. `voices` and `onPreviewVoice` connect a native speech provider;
|
package/docs/task-catalog.json
CHANGED
package/docs/task-catalog.mdx
CHANGED
|
@@ -8,7 +8,7 @@ order: 1
|
|
|
8
8
|
|
|
9
9
|
# Choose an API by task
|
|
10
10
|
|
|
11
|
-
This guide belongs to **@oxy.so/bloom
|
|
11
|
+
This guide belongs to **@oxy.so/bloom 21.0.0**. Read it from the installed package alongside [the structured index](./task-catalog.json). A source build version is not a registry-publication receipt. Use the containing package’s manifest for exact peer ranges.
|
|
12
12
|
|
|
13
13
|
Start under the application’s BloomProvider and follow [getting started](./getting-started.mdx) for CSS, fonts and platform setup. These examples accept domain content/actions and require a bounded host. They do not add a provider per route. For document scrolling, follow [the host contract](./compose-layouts.mdx); Expo’s bounded reset must not silently prevent document overflow.
|
|
14
14
|
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.avatarBodyHex = avatarBodyHex;
|
|
7
|
+
exports.avatarCharacterInColor = avatarCharacterInColor;
|
|
7
8
|
exports.avatarCharacterOf = avatarCharacterOf;
|
|
8
9
|
exports.parseAvatarCharacter = parseAvatarCharacter;
|
|
9
10
|
exports.resolveAvatarCharacter = resolveAvatarCharacter;
|
|
@@ -12,6 +13,7 @@ exports.updateAvatarCharacter = updateAvatarCharacter;
|
|
|
12
13
|
var _catalogIds = require("./catalog-ids.js");
|
|
13
14
|
var _characterColors = require("./character-colors.js");
|
|
14
15
|
var _skinColor = require("./skin-color.js");
|
|
16
|
+
var _colorPresets = require("../theme/color-presets.js");
|
|
15
17
|
var _characterPresetDefaults = require("./character-preset-defaults.js");
|
|
16
18
|
/**
|
|
17
19
|
* A character: what an avatar IS, in one flat shape. Every field is optional because a
|
|
@@ -180,6 +182,31 @@ function updateAvatarCharacter(character, patch) {
|
|
|
180
182
|
return next;
|
|
181
183
|
}
|
|
182
184
|
|
|
185
|
+
/**
|
|
186
|
+
* A character painted in its account's colour.
|
|
187
|
+
*
|
|
188
|
+
* `color` is the colour of the account the character stands for, as Oxy stores `User.color`: a
|
|
189
|
+
* Bloom colour preset key (`'lagoon'`) or a hex (`'#ff8b67'`, `'#f80'`), both ordinary account
|
|
190
|
+
* colours. A preset paints the body its identity seed, a hex paints it that hex, each lifted to the
|
|
191
|
+
* avatar skin floor (`normalizeAvatarSkinColor`), so a hex an editor wrote back comes out exactly as
|
|
192
|
+
* written. This is the one place an account colour becomes an avatar paint.
|
|
193
|
+
*
|
|
194
|
+
* The result carries `bodyColor` and no `color`; every part is kept. A colour that does not resolve
|
|
195
|
+
* (`null`, `undefined`, an unknown key) returns the character unchanged, so its own paint (or its
|
|
196
|
+
* preset's) applies.
|
|
197
|
+
*/
|
|
198
|
+
function avatarCharacterInColor(character, color) {
|
|
199
|
+
const resolved = (0, _colorPresets.resolveProfileColor)(color);
|
|
200
|
+
if (resolved === undefined) return character;
|
|
201
|
+
const seed = resolved.colorPreset === undefined ? resolved.seed : _colorPresets.APP_COLOR_PRESETS[resolved.colorPreset].hex;
|
|
202
|
+
const painted = {
|
|
203
|
+
...character
|
|
204
|
+
};
|
|
205
|
+
delete painted.color;
|
|
206
|
+
painted.bodyColor = (0, _skinColor.normalizeAvatarSkinColor)(seed);
|
|
207
|
+
return painted;
|
|
208
|
+
}
|
|
209
|
+
|
|
183
210
|
/** The body paint as `#rrggbb`, whichever way it was named. */
|
|
184
211
|
function avatarBodyHex(resolved) {
|
|
185
212
|
return 'bodyColor' in resolved.paint ? resolved.paint.bodyColor : _characterColors.CHARACTER_COLORS[resolved.paint.color];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_catalogIds","require","_characterColors","_skinColor","_characterPresetDefaults","PARTS","KEYS","Set","NEVER_AUTHORED","oneOf","list","value","what","includes","Error","String","resolveAvatarCharacter","character","preset","undefined","AVATAR_PRESETS","base","CHARACTER_PRESET_DEFAULTS","part","name","shape","AVATAR_SHAPES","eyes","AVATAR_EYES","eyewear","AVATAR_EYEWEAR","requestedAccessory","AVATAR_ACCESSORIES","accessory","hex","test","normalizeAvatarSkinColor","paint","bodyColor","color","AVATAR_COLORS","eyeSpacing","Number","isFinite","authored","has","every","tryResolveAvatarCharacter","Array","isArray","parseAvatarCharacter","unknown","Object","keys","find","key","candidate","rest","avatarCharacterOf","resolved","updateAvatarCharacter","patch","parts","next","avatarBodyHex","CHARACTER_COLORS"],"sourceRoot":"../../../src","sources":["agent-avatar/character.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_catalogIds","require","_characterColors","_skinColor","_colorPresets","_characterPresetDefaults","PARTS","KEYS","Set","NEVER_AUTHORED","oneOf","list","value","what","includes","Error","String","resolveAvatarCharacter","character","preset","undefined","AVATAR_PRESETS","base","CHARACTER_PRESET_DEFAULTS","part","name","shape","AVATAR_SHAPES","eyes","AVATAR_EYES","eyewear","AVATAR_EYEWEAR","requestedAccessory","AVATAR_ACCESSORIES","accessory","hex","test","normalizeAvatarSkinColor","paint","bodyColor","color","AVATAR_COLORS","eyeSpacing","Number","isFinite","authored","has","every","tryResolveAvatarCharacter","Array","isArray","parseAvatarCharacter","unknown","Object","keys","find","key","candidate","rest","avatarCharacterOf","resolved","updateAvatarCharacter","patch","parts","next","avatarCharacterInColor","resolveProfileColor","seed","colorPreset","APP_COLOR_PRESETS","painted","avatarBodyHex","CHARACTER_COLORS"],"sourceRoot":"../../../src","sources":["agent-avatar/character.ts"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAcA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,w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AO,WAAW,IAAIA,QAAQ,CAACtB,KAAK,GAChCsB,QAAQ,CAACtB,KAAK,CAACC,SAAS,GACxBiC,iCAAgB,CAACZ,QAAQ,CAACtB,KAAK,CAACE,KAAK,CAAC;AAC5C","ignoreList":[]}
|
|
@@ -75,6 +75,12 @@ Object.defineProperty(exports, "avatarBodyHex", {
|
|
|
75
75
|
return _character.avatarBodyHex;
|
|
76
76
|
}
|
|
77
77
|
});
|
|
78
|
+
Object.defineProperty(exports, "avatarCharacterInColor", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () {
|
|
81
|
+
return _character.avatarCharacterInColor;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
78
84
|
Object.defineProperty(exports, "avatarCharacterOf", {
|
|
79
85
|
enumerable: true,
|
|
80
86
|
get: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_AgentAvatar","require","_AgentAvatarProvider","_context","_useAvatarRendererCapabilities","_character","_legacyCharacter","_catalogIds","_svgCatalog","_vectorLoader"],"sourceRoot":"../../../src","sources":["agent-avatar/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_AgentAvatar","require","_AgentAvatarProvider","_context","_useAvatarRendererCapabilities","_character","_legacyCharacter","_catalogIds","_svgCatalog","_vectorLoader"],"sourceRoot":"../../../src","sources":["agent-avatar/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,8BAAA,GAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAJ,OAAA;AASA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAgBA,IAAAO,WAAA,GAAAP,OAAA;AAKA,IAAAQ,aAAA,GAAAR,OAAA","ignoreList":[]}
|
|
@@ -9,6 +9,8 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _useCharacterHistory = require("./use-character-history.js");
|
|
10
10
|
var _useVectorGeometryPreparation = require("../agent-avatar/use-vector-geometry-preparation.js");
|
|
11
11
|
var _index = require("../agent-avatar/index.js");
|
|
12
|
+
var _skinColor = require("../agent-avatar/skin-color.js");
|
|
13
|
+
var _paint = require("./paint.js");
|
|
12
14
|
var _shapeChoices = require("./shape-choices.js");
|
|
13
15
|
var _buttonGroup = require("../button-group");
|
|
14
16
|
var _RiArrowGoBackLine = require("../icons/remix/RiArrowGoBackLine.js");
|
|
@@ -106,37 +108,50 @@ function AgentCreatorBase(props) {
|
|
|
106
108
|
node?.addEventListener('keydown', keydown);
|
|
107
109
|
return () => node?.removeEventListener('keydown', keydown);
|
|
108
110
|
}, []);
|
|
109
|
-
// Every control
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
const
|
|
113
|
-
const
|
|
111
|
+
// Every control draws the character in the agent's colour and writes one edit to the saved
|
|
112
|
+
// one; the history keeps the parts and drops the paint.
|
|
113
|
+
const painted = (0, _react.useMemo)(() => (0, _paint.drawnCharacter)(avatar, agent.color), [avatar, agent.color]);
|
|
114
|
+
const character = (0, _react.useMemo)(() => (0, _index.resolveAvatarCharacter)(painted), [painted]);
|
|
115
|
+
const edit = patch => history.change((0, _index.updateAvatarCharacter)(painted, patch));
|
|
114
116
|
const bodyHex = (0, _index.avatarBodyHex)(character);
|
|
117
|
+
// The colour control writes the ACCOUNT's colour, as the hex the avatar is drawn in.
|
|
118
|
+
const colorHex = (0, _paint.accountBodyHex)(agent.color);
|
|
119
|
+
const namedColor = _constants.CHARACTER_OPTIONS.color.find(([id]) => (0, _skinColor.normalizeAvatarSkinColor)(_constants.CHARACTER_COLORS[id]) === colorHex)?.[0];
|
|
120
|
+
const customHex = namedColor === undefined ? colorHex : undefined;
|
|
121
|
+
const changeColor = hex => {
|
|
122
|
+
if (!/^#[0-9a-f]{6}$/i.test(hex)) return;
|
|
123
|
+
const color = (0, _skinColor.normalizeAvatarSkinColor)(hex);
|
|
124
|
+
if (color === (0, _paint.accountBodyHex)(latest.current.agent.color)) return;
|
|
125
|
+
latest.current.onChange({
|
|
126
|
+
...latest.current.agent,
|
|
127
|
+
color
|
|
128
|
+
});
|
|
129
|
+
};
|
|
115
130
|
const shapeChoices = (0, _react.useMemo)(() => _constants.CHARACTER_OPTIONS.shape.map(([id, title]) => ({
|
|
116
131
|
id,
|
|
117
132
|
label: id in messages.shapes ? messages.shapes[id] : messages.characterOption('shape', id, title),
|
|
118
|
-
character: (0, _index.updateAvatarCharacter)(
|
|
133
|
+
character: (0, _index.updateAvatarCharacter)(painted, {
|
|
119
134
|
shape: id
|
|
120
135
|
})
|
|
121
|
-
})), [
|
|
136
|
+
})), [painted, messages]);
|
|
122
137
|
const nearby = (0, _react.useMemo)(() => {
|
|
123
138
|
const index = _constants.CHARACTER_OPTIONS.shape.findIndex(([id]) => id === (0, _shapeChoices.editorShapeId)(character.shape));
|
|
124
139
|
return [index - 1, index + 1].flatMap(i => {
|
|
125
140
|
const next = _constants.CHARACTER_OPTIONS.shape[i];
|
|
126
|
-
return next ? [(0, _index.updateAvatarCharacter)(
|
|
141
|
+
return next ? [(0, _index.updateAvatarCharacter)(painted, {
|
|
127
142
|
shape: next[0]
|
|
128
143
|
})] : [];
|
|
129
144
|
});
|
|
130
|
-
}, [
|
|
145
|
+
}, [painted, character.shape]);
|
|
131
146
|
(0, _useVectorGeometryPreparation.useVectorGeometryPreparation)(nearby);
|
|
132
147
|
const eyeChoices = (0, _react.useMemo)(() => _constants.CHARACTER_OPTIONS.eyes.map(([id, title]) => ({
|
|
133
148
|
id,
|
|
134
149
|
label: messages.characterOption('eyes', id, title),
|
|
135
|
-
character: (0, _index.updateAvatarCharacter)(
|
|
150
|
+
character: (0, _index.updateAvatarCharacter)(painted, {
|
|
136
151
|
eyes: id
|
|
137
152
|
}),
|
|
138
153
|
disabled: false
|
|
139
|
-
})), [
|
|
154
|
+
})), [painted, messages]);
|
|
140
155
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_context2.AgentCreatorCopyContext.Provider, {
|
|
141
156
|
value: copy,
|
|
142
157
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_surfaceLevels.SurfaceLevelProvider, {
|
|
@@ -228,7 +243,7 @@ function AgentCreatorBase(props) {
|
|
|
228
243
|
}]
|
|
229
244
|
},
|
|
230
245
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_index.AgentAvatar, {
|
|
231
|
-
character:
|
|
246
|
+
character: painted,
|
|
232
247
|
size: 162,
|
|
233
248
|
interactive: true,
|
|
234
249
|
renderer: "svg",
|
|
@@ -282,7 +297,7 @@ function AgentCreatorBase(props) {
|
|
|
282
297
|
boxShadow: '0 1px 2px rgba(0,0,0,.05)'
|
|
283
298
|
},
|
|
284
299
|
children: [_constants.CHARACTER_OPTIONS.color.map(([id, title]) => {
|
|
285
|
-
const active =
|
|
300
|
+
const active = namedColor === id;
|
|
286
301
|
const hex = _constants.CHARACTER_COLORS[id];
|
|
287
302
|
const disabled = false;
|
|
288
303
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styledPrimitives.StyledPressable, {
|
|
@@ -295,9 +310,7 @@ function AgentCreatorBase(props) {
|
|
|
295
310
|
disabled
|
|
296
311
|
},
|
|
297
312
|
disabled: disabled,
|
|
298
|
-
onPress: () =>
|
|
299
|
-
color: id
|
|
300
|
-
}),
|
|
313
|
+
onPress: () => changeColor(hex),
|
|
301
314
|
className: "relative shrink-0 cursor-pointer overflow-hidden rounded-full transition-transform duration-150 ease-out hover:scale-110 outline-none focus-visible:ring-2 focus-visible:ring-border-focus-ring focus-visible:ring-offset-2 size-[26px]",
|
|
302
315
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_GlossArt.GlossArt, {
|
|
303
316
|
center: hex,
|
|
@@ -330,19 +343,13 @@ function AgentCreatorBase(props) {
|
|
|
330
343
|
className: "w-[248px] rounded-3xl p-2.5",
|
|
331
344
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CustomColorPicker.CustomColorPicker, {
|
|
332
345
|
value: bodyHex,
|
|
333
|
-
|
|
334
|
-
onInteractionEnd: history.end,
|
|
335
|
-
onChange: hex => {
|
|
336
|
-
if (/^#[0-9a-f]{6}$/i.test(hex)) edit({
|
|
337
|
-
bodyColor: hex.toLowerCase()
|
|
338
|
-
});
|
|
339
|
-
}
|
|
346
|
+
onChange: changeColor
|
|
340
347
|
}, agent.id)
|
|
341
348
|
})]
|
|
342
349
|
})]
|
|
343
350
|
})
|
|
344
351
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CharacterControls.CharacterControls, {
|
|
345
|
-
character:
|
|
352
|
+
character: painted,
|
|
346
353
|
onChange: history.change
|
|
347
354
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styledPrimitives.StyledView, {
|
|
348
355
|
className: "mt-[15px] overflow-hidden rounded-2xl bg-background-secondary-default ps-3",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNative","_useCharacterHistory","_useVectorGeometryPreparation","_index","_shapeChoices","_buttonGroup","_RiArrowGoBackLine","_RiArrowGoForwardLine","_CloseButton","_useIsRtl","_styledPrimitives","_index2","_index3","_useTheme","_index4","_AgentCreatorField","_AgentPreferencesPanel","_CharacterControls","_CustomColorPicker","_EmotionPicker","_GlossArt","_PageHeader","_context","_surfaceLevels","_useSurfaceBacking","_ShapeArc","_constants","_context2","_jsxRuntime","AgentCreatorBase","props","directionProps","useDirectionProps","messages","useAgentCreatorMessages","agent","onChange","onClose","className","style","isWithinDialog","useDialogContext","colors","useTheme","backing","useSurfaceBacking","background","Screen","ScreenScrollView","Popover","PopoverTrigger","PopoverContent","useAgentCreatorBindings","latest","useRef","current","copy","useMemo","locale","labels","changePreferences","useCallback","next","preferences","preferencesPanel","showPreferences","jsx","AgentPreferencesPanel","voices","onPreviewVoice","history","useCharacterHistory","avatar","character","editor","preparing","setPreparing","useState","keyboard","useEffect","Platform","OS","node","keydown","event","target","defaultPrevented","isComposing","isContentEditable","closest","metaKey","ctrlKey","altKey","key","toLowerCase","shiftKey","canUndo","preventDefault","undo","canRedo","redo","addEventListener","removeEventListener","resolveAvatarCharacter","edit","patch","change","updateAvatarCharacter","paintColor","paint","color","undefined","customHex","bodyColor","bodyHex","avatarBodyHex","shapeChoices","CHARACTER_OPTIONS","shape","map","id","title","label","shapes","characterOption","nearby","index","findIndex","editorShapeId","flatMap","i","useVectorGeometryPreparation","eyeChoices","eyes","disabled","AgentCreatorCopyContext","Provider","value","children","SurfaceLevelProvider","level","fill","StyledView","ref","accessibilityLabel","flex","minHeight","backgroundColor","vars","scroll","documentScroll","contentClearance","header","PageHeader","name","newBot","titleAlign","sticky","safeArea","leading","jsxs","ButtonGroup","avatarHistory","ButtonGroupItem","iconOnly","leadingIcon","RiArrowGoBackLine","undoAvatar","onPress","RiArrowGoForwardLine","redoAvatar","actions","CloseButton","size","closeEditor","details","contentContainerStyle","paddingStart","paddingEnd","paddingBottom","pointerEvents","position","left","top","transform","translateX","zIndex","EmotionPicker","choices","onSelect","AgentAvatar","interactive","renderer","onLoadingChange","livePreview","newAgent","right","bottom","ShapeArc","alignItems","testID","Text","accessibilityLiveRegion","role","variant","preparingAvatar","flexShrink","collapsable","card","borderColor","border","boxShadow","active","hex","CHARACTER_COLORS","StyledPressable","accessibilityRole","avatarColorLabel","accessibilityState","selected","GlossArt","center","edge","asChild","customColor","Boolean","rainbow","align","minWidth","maxWidth","CustomColorPicker","onInteractionStart","begin","onInteractionEnd","end","test","CharacterControls","backgroundSecondary","AgentCreatorField","divider","TextFieldInput","nameInput","maxLength","onChangeText","placeholder","labelInput","labelPlaceholder","description","multiline","Textarea","descriptionInput","rows","resize","fieldStyle","height","descriptionPlaceholder","sections"],"source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CACL,CAAC,EACZ5G,KAAK,CAACkO,QAAQ,EACdhM,gBAAgB;UAAA,CACD;QAAC,CACb;MAAC,CACC;IAAC,CACO;EAAC,CACS,CAAC;AAEvC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","require","_reactNative","_useCharacterHistory","_useVectorGeometryPreparation","_index","_skinColor","_paint","_shapeChoices","_buttonGroup","_RiArrowGoBackLine","_RiArrowGoForwardLine","_CloseButton","_useIsRtl","_styledPrimitives","_index2","_index3","_useTheme","_index4","_AgentCreatorField","_AgentPreferencesPanel","_CharacterControls","_CustomColorPicker","_EmotionPicker","_GlossArt","_PageHeader","_context","_surfaceLevels","_useSurfaceBacking","_ShapeArc","_constants","_context2","_jsxRuntime","AgentCreatorBase","props","directionProps","useDirectionProps","messages","useAgentCreatorMessages","agent","onChange","onClose","className","style","isWithinDialog","useDialogContext","colors","useTheme","backing","useSurfaceBacking","background","Screen","ScreenScrollView","Popover","PopoverTrigger","PopoverContent","useAgentCreatorBindings","latest","useRef","current","copy","useMemo","locale","labels","changePreferences","useCallback","next","preferences","preferencesPanel","showPreferences","jsx","AgentPreferencesPanel","voices","onPreviewVoice","history","useCharacterHistory","avatar","character","editor","preparing","setPreparing","useState","keyboard","useEffect","Platform","OS","node","keydown","event","target","defaultPrevented","isComposing","isContentEditable","closest","metaKey","ctrlKey","altKey","key","toLowerCase","shiftKey","canUndo","preventDefault","undo","canRedo","redo","addEventListener","removeEventListener","painted","drawnCharacter","color","resolveAvatarCharacter","edit","patch","change","updateAvatarCharacter","bodyHex","avatarBodyHex","colorHex","accountBodyHex","namedColor","CHARACTER_OPTIONS","find","id","normalizeAvatarSkinColor","CHARACTER_COLORS","customHex","undefined","changeColor","hex","test","shapeChoices","shape","map","title","label","shapes","characterOption","nearby","index","findIndex","editorShapeId","flatMap","i","useVectorGeometryPreparation","eyeChoices","eyes","disabled","AgentCreatorCopyContext","Provider","value","children","SurfaceLevelProvider","level","fill","StyledView","ref","accessibilityLabel","flex","minHeight","backgroundColor","vars","scroll","documentScroll","contentClearance","header","PageHeader","name","newBot","titleAlign","sticky","safeArea","leading","jsxs","ButtonGroup","avatarHistory","ButtonGroupItem","iconOnly","leadingIcon","RiArrowGoBackLine","undoAvatar","onPress","RiArrowGoForwardLine","redoAvatar","actions","CloseButton","size","closeEditor","details","contentContainerStyle","paddingStart","paddingEnd","paddingBottom","pointerEvents","position","left","top","transform","translateX","zIndex","EmotionPicker","choices","onSelect","AgentAvatar","interactive","renderer","onLoadingChange","livePreview","newAgent","right","bottom","ShapeArc","alignItems","testID","Text","accessibilityLiveRegion","role","variant","preparingAvatar","flexShrink","collapsable","card","borderColor","border","boxShadow","active","StyledPressable","accessibilityRole","avatarColorLabel","accessibilityState","selected","GlossArt","center","edge","asChild","customColor","Boolean","rainbow","align","minWidth","maxWidth","CustomColorPicker","CharacterControls","backgroundSecondary","AgentCreatorField","divider","TextFieldInput","nameInput","maxLength","onChangeText","placeholder","labelInput","labelPlaceholder","description","multiline","Textarea","descriptionInput","rows","resize","fieldStyle","height","descriptionPlaceholder","sections"],"sourceRoot":"../../../src","sources":["agent-creator/AgentCreatorBase.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAF,OAAA;AACA,IAAAG,6BAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAMA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,GAAAR,OAAA;AACA,IAAAS,kBAAA,GAAAT,OAAA;AACA,IAAAU,qBAAA,GAAAV,OAAA;AACA,IAAAW,YAAA,GAAAX,OAAA;AACA,IAAAY,SAAA,GAAAZ,OAAA;AACA,IAAAa,iBAAA,GAAAb,OAAA;AACA,IAAAc,OAAA,GAAAd,OAAA;AACA,IAAAe,OAAA,GAAAf,OAA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AA,CACD;QAAC,CACb;MAAC,CACC;IAAC,CACO;EAAC,CACS,CAAC;AAEvC","ignoreList":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.accountBodyHex = accountBodyHex;
|
|
7
|
+
exports.characterPartsKey = characterPartsKey;
|
|
8
|
+
exports.drawnCharacter = drawnCharacter;
|
|
9
|
+
exports.withoutPaint = withoutPaint;
|
|
10
|
+
var _character = require("../agent-avatar/character.js");
|
|
11
|
+
var _characterColors = require("../agent-avatar/character-colors.js");
|
|
12
|
+
/**
|
|
13
|
+
* The creator's colour is the agent's account colour (`agent.color`), never the character's: a
|
|
14
|
+
* character it hands back carries its parts and no paint, and every character it draws is painted
|
|
15
|
+
* in the account's colour here.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/** A character without its paint: what the creator emits. */
|
|
19
|
+
function withoutPaint(character) {
|
|
20
|
+
const parts = {
|
|
21
|
+
...character
|
|
22
|
+
};
|
|
23
|
+
delete parts.color;
|
|
24
|
+
delete parts.bodyColor;
|
|
25
|
+
return parts;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** What a character with no paint and no resolvable colour wears: the first named swatch. */
|
|
29
|
+
const FALLBACK_COLOR = _characterColors.CHARACTER_COLORS.pink;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The character as the creator draws it: in the agent's colour (a preset key or a `#rrggbb`). A
|
|
33
|
+
* colour Bloom cannot resolve leaves the character's own paint (or its preset's); a character with
|
|
34
|
+
* neither wears the first named swatch, so nothing it draws is undrawable.
|
|
35
|
+
*/
|
|
36
|
+
function drawnCharacter(character, color) {
|
|
37
|
+
const painted = (0, _character.avatarCharacterInColor)(character, color);
|
|
38
|
+
if ((0, _character.tryResolveAvatarCharacter)(painted)) return painted;
|
|
39
|
+
return (0, _character.avatarCharacterInColor)(character, FALLBACK_COLOR);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The body paint an account colour draws, `#rrggbb`, or `undefined` for a colour that does not
|
|
44
|
+
* resolve. Read through `avatarCharacterInColor`, the one mapping from a colour to a paint.
|
|
45
|
+
*/
|
|
46
|
+
function accountBodyHex(color) {
|
|
47
|
+
return (0, _character.avatarCharacterInColor)({}, color).bodyColor;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* What a character IS, for comparing two of them: its resolved parts, paint left out (the paint is
|
|
52
|
+
* the account's). Two spellings of one character (a preset, or its parts written out) compare equal.
|
|
53
|
+
*/
|
|
54
|
+
function characterPartsKey(character) {
|
|
55
|
+
const parts = (0, _character.resolveAvatarCharacter)(drawnCharacter(character, undefined));
|
|
56
|
+
delete parts.paint;
|
|
57
|
+
return JSON.stringify(parts);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=paint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_character","require","_characterColors","withoutPaint","character","parts","color","bodyColor","FALLBACK_COLOR","CHARACTER_COLORS","pink","drawnCharacter","painted","avatarCharacterInColor","tryResolveAvatarCharacter","accountBodyHex","characterPartsKey","resolveAvatarCharacter","undefined","paint","JSON","stringify"],"sourceRoot":"../../../src","sources":["agent-creator/paint.ts"],"mappings":";;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAMA,IAAAC,gBAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACO,SAASE,YAAYA,CAACC,SAA0B,EAAmB;EACxE,MAAMC,KAAsB,GAAG;IAAE,GAAGD;EAAU,CAAC;EAC/C,OAAOC,KAAK,CAACC,KAAK;EAClB,OAAOD,KAAK,CAACE,SAAS;EACtB,OAAOF,KAAK;AACd;;AAEA;AACA,MAAMG,cAAc,GAAGC,iCAAgB,CAACC,IAAI;;AAE5C;AACA;AACA;AACA;AACA;AACO,SAASC,cAAcA,CAC5BP,SAA0B,EAC1BE,KAAgC,EACf;EACjB,MAAMM,OAAO,GAAG,IAAAC,iCAAsB,EAACT,SAAS,EAAEE,KAAK,CAAC;EACxD,IAAI,IAAAQ,oCAAyB,EAACF,OAAO,CAAC,EAAE,OAAOA,OAAO;EACtD,OAAO,IAAAC,iCAAsB,EAACT,SAAS,EAAEI,cAAc,CAAC;AAC1D;;AAEA;AACA;AACA;AACA;AACO,SAASO,cAAcA,CAACT,KAAgC,EAAsB;EACnF,OAAO,IAAAO,iCAAsB,EAAC,CAAC,CAAC,EAAEP,KAAK,CAAC,CAACC,SAAS;AACpD;;AAEA;AACA;AACA;AACA;AACO,SAASS,iBAAiBA,CAACZ,SAA0B,EAAU;EACpE,MAAMC,KAAyD,GAAG,IAAAY,iCAAsB,EACtFN,cAAc,CAACP,SAAS,EAAEc,SAAS,CACrC,CAAC;EACD,OAAOb,KAAK,CAACc,KAAK;EAClB,OAAOC,IAAI,CAACC,SAAS,CAAChB,KAAK,CAAC;AAC9B","ignoreList":[]}
|
|
@@ -5,15 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useCharacterHistory = useCharacterHistory;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
var
|
|
9
|
-
const key = value => JSON.stringify((0, _character.resolveAvatarCharacter)(value));
|
|
8
|
+
var _paint = require("./paint.js");
|
|
10
9
|
const snapshot = value => Object.freeze({
|
|
11
10
|
...value
|
|
12
11
|
});
|
|
13
12
|
const LIMIT = 50;
|
|
14
13
|
const createHistory = agent => ({
|
|
15
14
|
id: agent.id,
|
|
16
|
-
propKey:
|
|
15
|
+
propKey: (0, _paint.characterPartsKey)(agent.avatar),
|
|
17
16
|
current: snapshot(agent.avatar),
|
|
18
17
|
past: [],
|
|
19
18
|
future: [],
|
|
@@ -21,7 +20,11 @@ const createHistory = agent => ({
|
|
|
21
20
|
transaction: undefined
|
|
22
21
|
});
|
|
23
22
|
|
|
24
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* Character-only history. Parent echoes acknowledge edits; unrelated profile data never enters
|
|
25
|
+
* history. Characters compare by their parts and are emitted without paint: the colour is the
|
|
26
|
+
* agent's (`agent.color`), not the character's, so a colour change is not a character edit.
|
|
27
|
+
*/
|
|
25
28
|
function useCharacterHistory(agent, onChange) {
|
|
26
29
|
const latest = (0, _react.useRef)({
|
|
27
30
|
agent,
|
|
@@ -34,7 +37,7 @@ function useCharacterHistory(agent, onChange) {
|
|
|
34
37
|
const [, render] = (0, _react.useState)(0);
|
|
35
38
|
const state = (0, _react.useRef)(null);
|
|
36
39
|
state.current ??= createHistory(agent);
|
|
37
|
-
const incoming =
|
|
40
|
+
const incoming = (0, _paint.characterPartsKey)(agent.avatar),
|
|
38
41
|
s = state.current;
|
|
39
42
|
if (s.id !== agent.id || s.propKey !== incoming) {
|
|
40
43
|
if (s.id !== agent.id || !s.pending.has(incoming)) {
|
|
@@ -49,8 +52,8 @@ function useCharacterHistory(agent, onChange) {
|
|
|
49
52
|
}
|
|
50
53
|
const emit = (0, _react.useCallback)(value => {
|
|
51
54
|
const s = state.current;
|
|
52
|
-
s.current = snapshot(value);
|
|
53
|
-
s.pending.add(
|
|
55
|
+
s.current = snapshot((0, _paint.withoutPaint)(value));
|
|
56
|
+
s.pending.add((0, _paint.characterPartsKey)(value));
|
|
54
57
|
// Only unacknowledged own writes are retained, with a fixed bound during deferred parent updates.
|
|
55
58
|
if (s.pending.size > 128) s.pending.delete(s.pending.values().next().value);
|
|
56
59
|
render(v => v + 1);
|
|
@@ -63,13 +66,13 @@ function useCharacterHistory(agent, onChange) {
|
|
|
63
66
|
const s = state.current,
|
|
64
67
|
start = s.transaction;
|
|
65
68
|
s.transaction = undefined;
|
|
66
|
-
if (!start ||
|
|
69
|
+
if (!start || (0, _paint.characterPartsKey)(start) === (0, _paint.characterPartsKey)(s.current)) return;
|
|
67
70
|
s.past = [...s.past, start].slice(-LIMIT);
|
|
68
71
|
render(v => v + 1);
|
|
69
72
|
}, []);
|
|
70
73
|
const change = (0, _react.useCallback)(value => {
|
|
71
74
|
const s = state.current;
|
|
72
|
-
if (
|
|
75
|
+
if ((0, _paint.characterPartsKey)(value) === (0, _paint.characterPartsKey)(s.current)) return;
|
|
73
76
|
if (!s.transaction) s.past = [...s.past, s.current].slice(-LIMIT);
|
|
74
77
|
s.future = [];
|
|
75
78
|
emit(value);
|