@oxy.so/bloom 21.3.0 → 21.4.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/agent-avatar.mdx +1 -1
- package/docs/getting-started.mdx +4 -0
- package/docs/task-catalog.json +2 -1
- package/docs/task-catalog.mdx +1 -1
- package/lib/commonjs/agent-avatar/portrait-svg.js +16 -10
- package/lib/commonjs/agent-avatar/portrait-svg.js.map +1 -1
- package/lib/module/agent-avatar/portrait-svg.js +16 -10
- package/lib/module/agent-avatar/portrait-svg.js.map +1 -1
- package/lib/typescript/commonjs/agent-avatar/portrait-svg.d.ts +5 -4
- package/lib/typescript/commonjs/agent-avatar/portrait-svg.d.ts.map +1 -1
- package/lib/typescript/module/agent-avatar/portrait-svg.d.ts +5 -4
- package/lib/typescript/module/agent-avatar/portrait-svg.d.ts.map +1 -1
- package/package.json +3 -2
- package/src/agent-avatar/portrait-svg.ts +16 -10
package/docs/agent-avatar.mdx
CHANGED
|
@@ -575,7 +575,7 @@ Code that cannot render React (an API making a bot's profile photo, an image car
|
|
|
575
575
|
character with `@oxy.so/bloom/agent-avatar/svg`: `renderAgentAvatarSvg(character, options)` answers
|
|
576
576
|
the same still frame `VectorStaticPortrait` draws, as an SVG string, and `renderAgentAvatarPicture
|
|
577
577
|
(character, color)` a profile picture (painted in the account colour, centred with room for a
|
|
578
|
-
circular crop, on a much lighter tint of that colour
|
|
578
|
+
circular crop, on a much, much lighter tint of that colour; only a body nearly as light gets a darker tint, so the character is always visible).
|
|
579
579
|
Rasterize it with whatever the server has. The entry imports no React or React Native; it draws from
|
|
580
580
|
the full catalog unless `catalog` is passed.
|
|
581
581
|
|
package/docs/getting-started.mdx
CHANGED
|
@@ -17,6 +17,10 @@ package's `peerDependencies` and `peerDependenciesMeta` distinguish required and
|
|
|
17
17
|
optional packages. A permissive peer range is not proof that every combination
|
|
18
18
|
has been tested. Do not install arbitrary latest native peers into an older SDK.
|
|
19
19
|
|
|
20
|
+
A server that uses only a server-safe entry (`@oxy.so/bloom/agent-avatar/svg`, which draws
|
|
21
|
+
a character as SVG with no React in its import graph) installs Bloom with peers omitted
|
|
22
|
+
(`bun install --omit=peer`): none of Bloom's own dependencies needs React Native or Expo.
|
|
23
|
+
|
|
20
24
|
- **Expo / Metro:** use the SDK-compatible dependencies and the app-preset setup below.
|
|
21
25
|
- **Vite web:** use the complete [Vite host recipe](./vite.mdx), including dependency
|
|
22
26
|
transforms. Typechecking alone cannot validate worklets or CSS.
|
package/docs/task-catalog.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"package": {
|
|
4
4
|
"name": "@oxy.so/bloom",
|
|
5
|
-
"version": "21.
|
|
5
|
+
"version": "21.4.0",
|
|
6
6
|
"peers": {
|
|
7
7
|
"@lottiefiles/dotlottie-react": ">=0.13.0",
|
|
8
8
|
"@react-native-community/netinfo": ">=11.1.0",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"react": ">=18.0.0",
|
|
23
23
|
"react-dom": ">=18.0.0",
|
|
24
24
|
"react-native": ">=0.73.0",
|
|
25
|
+
"react-native-css": ">=3.1.0-rc.0",
|
|
25
26
|
"react-native-gesture-handler": ">=2.16.1",
|
|
26
27
|
"react-native-keyboard-controller": ">=1.11.4",
|
|
27
28
|
"react-native-pager-view": ">=6.0.0",
|
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 21.
|
|
11
|
+
This guide belongs to **@oxy.so/bloom 21.4.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
|
|
|
@@ -60,26 +60,32 @@ async function renderAgentAvatarSvg(character, options = {}) {
|
|
|
60
60
|
return vectorFrameToSvg(frame, options);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
/**
|
|
64
|
-
const
|
|
65
|
-
/**
|
|
66
|
-
|
|
63
|
+
/** How light the background is: a much, much lighter tint of the body's own colour. */
|
|
64
|
+
const PICTURE_LIGHT_TONE = 97;
|
|
65
|
+
/**
|
|
66
|
+
* The least contrast with the body at which that light tint still shows the character (a lime or
|
|
67
|
+
* a pure green on its own pale tint reads clearly; a pale yellow or a white would vanish).
|
|
68
|
+
*/
|
|
69
|
+
const PICTURE_MIN_CONTRAST = 1.25;
|
|
70
|
+
/** The contrast a body too light for the tint gets instead, from a darker tint of its hue. */
|
|
71
|
+
const PICTURE_FALLBACK_CONTRAST = 1.6;
|
|
67
72
|
/** The tint keeps the body's hue, softened so it reads as a background and not a second colour. */
|
|
68
73
|
const PICTURE_MAX_CHROMA = 20;
|
|
69
74
|
|
|
70
75
|
/**
|
|
71
|
-
* The background a character's picture stands on: its body colour's own hue
|
|
72
|
-
* tint (tone
|
|
73
|
-
*
|
|
74
|
-
*
|
|
76
|
+
* The background a character's picture stands on: its body colour's own hue in a much, much
|
|
77
|
+
* lighter tint (tone 97 of a softened tonal palette, as Bloom's themes derive their surfaces),
|
|
78
|
+
* for every colour that still shows against it, light ones included. Only a body nearly as light
|
|
79
|
+
* as that (a pale yellow, a white) gets a darker tint of its hue instead, so the character is
|
|
80
|
+
* never the same as what it stands on.
|
|
75
81
|
*/
|
|
76
82
|
function avatarPictureBackground(bodyHex) {
|
|
77
83
|
const body = _hct.Hct.fromInt((0, _colorUtils.argbFromHex)(bodyHex));
|
|
78
84
|
const palette = _tonalPalette.TonalPalette.fromHueAndChroma(body.hue, Math.min(body.chroma, PICTURE_MAX_CHROMA));
|
|
79
|
-
if ((0, _contrast.ratioOfTones)(body.tone, PICTURE_LIGHT_TONE) >=
|
|
85
|
+
if ((0, _contrast.ratioOfTones)(body.tone, PICTURE_LIGHT_TONE) >= PICTURE_MIN_CONTRAST) {
|
|
80
86
|
return (0, _colorUtils.hexFromArgb)(palette.tone(PICTURE_LIGHT_TONE));
|
|
81
87
|
}
|
|
82
|
-
const dark = (0, _contrast.darker)(body.tone,
|
|
88
|
+
const dark = (0, _contrast.darker)(body.tone, PICTURE_FALLBACK_CONTRAST);
|
|
83
89
|
return (0, _colorUtils.hexFromArgb)(palette.tone(dark < 0 ? 0 : dark));
|
|
84
90
|
}
|
|
85
91
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_colorUtils","require","_contrast","_hct","_tonalPalette","_character","_vectorAssets","_vectorPortrait","_vectorViewbox","ESCAPES","attr","value","String","replace","c","vectorFrameToSvg","frame","options","size","cx","cy","cw","ch","avatarViewBox","viewBox","split","map","Number","margin","Math","max","box","n","round","join","clips","paths","flatMap","path","clip","undefined","id","background","parts","d","fill","opacity","fillOpacity","stroke","push","strokeWidth","renderAgentAvatarSvg","character","loadVectorPortrait","catalog","vectorAssetLoader","
|
|
1
|
+
{"version":3,"names":["_colorUtils","require","_contrast","_hct","_tonalPalette","_character","_vectorAssets","_vectorPortrait","_vectorViewbox","ESCAPES","attr","value","String","replace","c","vectorFrameToSvg","frame","options","size","cx","cy","cw","ch","avatarViewBox","viewBox","split","map","Number","margin","Math","max","box","n","round","join","clips","paths","flatMap","path","clip","undefined","id","background","parts","d","fill","opacity","fillOpacity","stroke","push","strokeWidth","renderAgentAvatarSvg","character","loadVectorPortrait","catalog","vectorAssetLoader","PICTURE_LIGHT_TONE","PICTURE_MIN_CONTRAST","PICTURE_FALLBACK_CONTRAST","PICTURE_MAX_CHROMA","avatarPictureBackground","bodyHex","body","Hct","fromInt","argbFromHex","palette","TonalPalette","fromHueAndChroma","hue","min","chroma","ratioOfTones","tone","hexFromArgb","dark","darker","PICTURE_MARGIN","renderAgentAvatarPicture","color","painted","avatarCharacterInColor","avatarBodyHex","resolveAvatarCharacter"],"sourceRoot":"../../../src","sources":["agent-avatar/portrait-svg.ts"],"mappings":";;;;;;;;;AASA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAMA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AAEA,IAAAO,cAAA,GAAAP,OAAA;AAtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA8BA,MAAMQ,OAA+B,GAAG;EACtC,GAAG,EAAE,OAAO;EACZ,GAAG,EAAE,MAAM;EACX,GAAG,EAAE,MAAM;EACX,GAAG,EAAE,QAAQ;EACb,GAAG,EAAE;AACP,CAAC;AACD,MAAMC,IAAI,GAAIC,KAAsB,IAAKC,MAAM,CAACD,KAAK,CAAC,CAACE,OAAO,CAAC,UAAU,EAAGC,CAAC,IAAKL,OAAO,CAACK,CAAC,CAAC,IAAIA,CAAC,CAAC;;AAElG;AACO,SAASC,gBAAgBA,CAACC,KAAkB,EAAEC,OAA8B,GAAG,CAAC,CAAC,EAAU;EAChG,MAAMC,IAAI,GAAGD,OAAO,CAACC,IAAI,IAAI,GAAG;EAChC,MAAM,CAACC,EAAE,GAAG,CAAC,EAAEC,EAAE,GAAG,CAAC,EAAEC,EAAE,GAAG,GAAG,EAAEC,EAAE,GAAG,GAAG,CAAC,GAAG,IAAAC,4BAAa,EAACP,KAAK,CAACQ,OAAO,CAAC,CACtEC,KAAK,CAAC,KAAK,CAAC,CACZC,GAAG,CAACC,MAAM,CAAC;EACd,MAAMC,MAAM,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEb,OAAO,CAACW,MAAM,IAAI,CAAC,CAAC;EAC/C,MAAMG,GAAG,GAAG,CACV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9C,MAAMK,OAAO,GAAGC,0BAAY,CAACC,gBAAgB,CAC3CN,IAAI,CAACO,GAAG,EACRxC,IAAI,CAACyC,GAAG,CAACR,IAAI,CAACS,MAAM,EAAEZ,kBAAkB,CAC1C,CAAC;EACD,IAAI,IAAAa,sBAAY,EAACV,IAAI,CAACW,IAAI,EAAEjB,kBAAkB,CAAC,IAAIC,oBAAoB,EAAE;IACvE,OAAO,IAAAiB,uBAAW,EAACR,OAAO,CAACO,IAAI,CAACjB,kBAAkB,CAAC,CAAC;EACtD;EACA,MAAMmB,IAAI,GAAG,IAAAC,gBAAM,EAACd,IAAI,CAACW,IAAI,EAAEf,yBAAyB,CAAC;EACzD,OAAO,IAAAgB,uBAAW,EAACR,OAAO,CAACO,IAAI,CAACE,IAAI,GAAG,CAAC,GAAG,CAAC,GAAGA,IAAI,CAAC,CAAC;AACvD;;AAEA;AACA,MAAME,cAAc,GAAG,IAAI;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACO,eAAeC,wBAAwBA,CAC5C1B,SAA0B,EAC1B2B,KAAgC,EAChC9D,OAAwD,GAAG,CAAC,CAAC,EAC5C;EACjB,MAAM+D,OAAO,GAAG,IAAAC,iCAAsB,EAAC7B,SAAS,EAAE2B,KAAK,CAAC;EACxD,MAAMrC,UAAU,GAAGkB,uBAAuB,CAAC,IAAAsB,wBAAa,EAAC,IAAAC,iCAAsB,EAACH,OAAO,CAAC,CAAC,CAAC;EAC1F,OAAO7B,oBAAoB,CAAC6B,OAAO,EAAE;IAAE,GAAG/D,OAAO;IAAEyB,UAAU;IAAEd,MAAM,EAAEiD;EAAe,CAAC,CAAC;AAC1F","ignoreList":[]}
|
|
@@ -52,26 +52,32 @@ export async function renderAgentAvatarSvg(character, options = {}) {
|
|
|
52
52
|
return vectorFrameToSvg(frame, options);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
/**
|
|
56
|
-
const
|
|
57
|
-
/**
|
|
58
|
-
|
|
55
|
+
/** How light the background is: a much, much lighter tint of the body's own colour. */
|
|
56
|
+
const PICTURE_LIGHT_TONE = 97;
|
|
57
|
+
/**
|
|
58
|
+
* The least contrast with the body at which that light tint still shows the character (a lime or
|
|
59
|
+
* a pure green on its own pale tint reads clearly; a pale yellow or a white would vanish).
|
|
60
|
+
*/
|
|
61
|
+
const PICTURE_MIN_CONTRAST = 1.25;
|
|
62
|
+
/** The contrast a body too light for the tint gets instead, from a darker tint of its hue. */
|
|
63
|
+
const PICTURE_FALLBACK_CONTRAST = 1.6;
|
|
59
64
|
/** The tint keeps the body's hue, softened so it reads as a background and not a second colour. */
|
|
60
65
|
const PICTURE_MAX_CHROMA = 20;
|
|
61
66
|
|
|
62
67
|
/**
|
|
63
|
-
* The background a character's picture stands on: its body colour's own hue
|
|
64
|
-
* tint (tone
|
|
65
|
-
*
|
|
66
|
-
*
|
|
68
|
+
* The background a character's picture stands on: its body colour's own hue in a much, much
|
|
69
|
+
* lighter tint (tone 97 of a softened tonal palette, as Bloom's themes derive their surfaces),
|
|
70
|
+
* for every colour that still shows against it, light ones included. Only a body nearly as light
|
|
71
|
+
* as that (a pale yellow, a white) gets a darker tint of its hue instead, so the character is
|
|
72
|
+
* never the same as what it stands on.
|
|
67
73
|
*/
|
|
68
74
|
export function avatarPictureBackground(bodyHex) {
|
|
69
75
|
const body = Hct.fromInt(argbFromHex(bodyHex));
|
|
70
76
|
const palette = TonalPalette.fromHueAndChroma(body.hue, Math.min(body.chroma, PICTURE_MAX_CHROMA));
|
|
71
|
-
if (ratioOfTones(body.tone, PICTURE_LIGHT_TONE) >=
|
|
77
|
+
if (ratioOfTones(body.tone, PICTURE_LIGHT_TONE) >= PICTURE_MIN_CONTRAST) {
|
|
72
78
|
return hexFromArgb(palette.tone(PICTURE_LIGHT_TONE));
|
|
73
79
|
}
|
|
74
|
-
const dark = darker(body.tone,
|
|
80
|
+
const dark = darker(body.tone, PICTURE_FALLBACK_CONTRAST);
|
|
75
81
|
return hexFromArgb(palette.tone(dark < 0 ? 0 : dark));
|
|
76
82
|
}
|
|
77
83
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["argbFromHex","hexFromArgb","darker","ratioOfTones","Hct","TonalPalette","avatarBodyHex","avatarCharacterInColor","resolveAvatarCharacter","vectorAssetLoader","loadVectorPortrait","avatarViewBox","ESCAPES","attr","value","String","replace","c","vectorFrameToSvg","frame","options","size","cx","cy","cw","ch","viewBox","split","map","Number","margin","Math","max","box","n","round","join","clips","paths","flatMap","path","clip","undefined","id","background","parts","d","fill","opacity","fillOpacity","stroke","push","strokeWidth","renderAgentAvatarSvg","character","catalog","
|
|
1
|
+
{"version":3,"names":["argbFromHex","hexFromArgb","darker","ratioOfTones","Hct","TonalPalette","avatarBodyHex","avatarCharacterInColor","resolveAvatarCharacter","vectorAssetLoader","loadVectorPortrait","avatarViewBox","ESCAPES","attr","value","String","replace","c","vectorFrameToSvg","frame","options","size","cx","cy","cw","ch","viewBox","split","map","Number","margin","Math","max","box","n","round","join","clips","paths","flatMap","path","clip","undefined","id","background","parts","d","fill","opacity","fillOpacity","stroke","push","strokeWidth","renderAgentAvatarSvg","character","catalog","PICTURE_LIGHT_TONE","PICTURE_MIN_CONTRAST","PICTURE_FALLBACK_CONTRAST","PICTURE_MAX_CHROMA","avatarPictureBackground","bodyHex","body","fromInt","palette","fromHueAndChroma","hue","min","chroma","tone","dark","PICTURE_MARGIN","renderAgentAvatarPicture","color","painted"],"sourceRoot":"../../../src","sources":["agent-avatar/portrait-svg.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAW,EAAEC,WAAW,QAAQ,sCAAmC;AAC5E,SAASC,MAAM,EAAEC,YAAY,QAAQ,mCAAgC;AACrE,SAASC,GAAG,QAAQ,8BAA2B;AAC/C,SAASC,YAAY,QAAQ,wCAAqC;AAClE,SACEC,aAAa,EACbC,sBAAsB,EACtBC,sBAAsB,QAEjB,gBAAa;AACpB,SAASC,iBAAiB,QAAQ,oB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CAAC4D,IAAI,CAACO,IAAI,EAAEX,yBAAyB,CAAC;EACzD,OAAOzD,WAAW,CAAC+D,OAAO,CAACK,IAAI,CAACC,IAAI,GAAG,CAAC,GAAG,CAAC,GAAGA,IAAI,CAAC,CAAC;AACvD;;AAEA;AACA,MAAMC,cAAc,GAAG,IAAI;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,wBAAwBA,CAC5ClB,SAA0B,EAC1BmB,KAAgC,EAChCrD,OAAwD,GAAG,CAAC,CAAC,EAC5C;EACjB,MAAMsD,OAAO,GAAGnE,sBAAsB,CAAC+C,SAAS,EAAEmB,KAAK,CAAC;EACxD,MAAM7B,UAAU,GAAGgB,uBAAuB,CAACtD,aAAa,CAACE,sBAAsB,CAACkE,OAAO,CAAC,CAAC,CAAC;EAC1F,OAAOrB,oBAAoB,CAACqB,OAAO,EAAE;IAAE,GAAGtD,OAAO;IAAEwB,UAAU;IAAEd,MAAM,EAAEyC;EAAe,CAAC,CAAC;AAC1F","ignoreList":[]}
|
|
@@ -18,10 +18,11 @@ export declare function vectorFrameToSvg(frame: VectorFrame, options?: AgentAvat
|
|
|
18
18
|
/** The character, at rest, as an SVG document. */
|
|
19
19
|
export declare function renderAgentAvatarSvg(character: AvatarCharacter, options?: AgentAvatarSvgOptions): Promise<string>;
|
|
20
20
|
/**
|
|
21
|
-
* The background a character's picture stands on: its body colour's own hue
|
|
22
|
-
* tint (tone
|
|
23
|
-
*
|
|
24
|
-
*
|
|
21
|
+
* The background a character's picture stands on: its body colour's own hue in a much, much
|
|
22
|
+
* lighter tint (tone 97 of a softened tonal palette, as Bloom's themes derive their surfaces),
|
|
23
|
+
* for every colour that still shows against it, light ones included. Only a body nearly as light
|
|
24
|
+
* as that (a pale yellow, a white) gets a darker tint of its hue instead, so the character is
|
|
25
|
+
* never the same as what it stands on.
|
|
25
26
|
*/
|
|
26
27
|
export declare function avatarPictureBackground(bodyHex: string): string;
|
|
27
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portrait-svg.d.ts","sourceRoot":"","sources":["../../../../src/agent-avatar/portrait-svg.ts"],"names":[],"mappings":"AAaA,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGrE,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAWD,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,GAAE,qBAA0B,GAAG,MAAM,CAgDhG;AAED,kDAAkD;AAClD,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,eAAe,EAC1B,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,MAAM,CAAC,CAGjB;
|
|
1
|
+
{"version":3,"file":"portrait-svg.d.ts","sourceRoot":"","sources":["../../../../src/agent-avatar/portrait-svg.ts"],"names":[],"mappings":"AAaA,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGrE,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAWD,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,GAAE,qBAA0B,GAAG,MAAM,CAgDhG;AAED,kDAAkD;AAClD,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,eAAe,EAC1B,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,MAAM,CAAC,CAGjB;AAcD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAW/D;AAKD;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,OAAO,GAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAM,GAC5D,OAAO,CAAC,MAAM,CAAC,CAIjB"}
|
|
@@ -18,10 +18,11 @@ export declare function vectorFrameToSvg(frame: VectorFrame, options?: AgentAvat
|
|
|
18
18
|
/** The character, at rest, as an SVG document. */
|
|
19
19
|
export declare function renderAgentAvatarSvg(character: AvatarCharacter, options?: AgentAvatarSvgOptions): Promise<string>;
|
|
20
20
|
/**
|
|
21
|
-
* The background a character's picture stands on: its body colour's own hue
|
|
22
|
-
* tint (tone
|
|
23
|
-
*
|
|
24
|
-
*
|
|
21
|
+
* The background a character's picture stands on: its body colour's own hue in a much, much
|
|
22
|
+
* lighter tint (tone 97 of a softened tonal palette, as Bloom's themes derive their surfaces),
|
|
23
|
+
* for every colour that still shows against it, light ones included. Only a body nearly as light
|
|
24
|
+
* as that (a pale yellow, a white) gets a darker tint of its hue instead, so the character is
|
|
25
|
+
* never the same as what it stands on.
|
|
25
26
|
*/
|
|
26
27
|
export declare function avatarPictureBackground(bodyHex: string): string;
|
|
27
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portrait-svg.d.ts","sourceRoot":"","sources":["../../../../src/agent-avatar/portrait-svg.ts"],"names":[],"mappings":"AAaA,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,gBAAa,CAAC;AAGrB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GjB;AAcD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAW/D;AAKD;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,SAAS,EAAE,eAAe,EAC1B,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,OAAO,GAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAM,GAC5D,OAAO,CAAC,MAAM,CAAC,CAIjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxy.so/bloom",
|
|
3
|
-
"version": "21.
|
|
3
|
+
"version": "21.4.0",
|
|
4
4
|
"packageManager": "bun@1.4.3",
|
|
5
5
|
"description": "Bloom UI — Oxy ecosystem component library for React Native + Expo + Web",
|
|
6
6
|
"main": "lib/commonjs/index.js",
|
|
@@ -4579,6 +4579,7 @@
|
|
|
4579
4579
|
"react-dom": "19.3.0",
|
|
4580
4580
|
"react-native": "0.88.1",
|
|
4581
4581
|
"react-native-builder-bob": "^0.44.1",
|
|
4582
|
+
"react-native-css": "3.1.0-rc.0",
|
|
4582
4583
|
"react-native-gesture-handler": "~3.3.0",
|
|
4583
4584
|
"react-native-reanimated": "4.7.1",
|
|
4584
4585
|
"react-native-safe-area-context": "~5.11.1",
|
|
@@ -4613,6 +4614,7 @@
|
|
|
4613
4614
|
"react": ">=18.0.0",
|
|
4614
4615
|
"react-dom": ">=18.0.0",
|
|
4615
4616
|
"react-native": ">=0.73.0",
|
|
4617
|
+
"react-native-css": ">=3.1.0-rc.0",
|
|
4616
4618
|
"react-native-gesture-handler": ">=2.16.1",
|
|
4617
4619
|
"react-native-keyboard-controller": ">=1.11.4",
|
|
4618
4620
|
"react-native-pager-view": ">=6.0.0",
|
|
@@ -4698,7 +4700,6 @@
|
|
|
4698
4700
|
},
|
|
4699
4701
|
"dependencies": {
|
|
4700
4702
|
"@tanstack/react-virtual": "^3.14.23",
|
|
4701
|
-
"react-native-css": "3.1.0-rc.0",
|
|
4702
4703
|
"react-remove-scroll-bar": "^2.3.8"
|
|
4703
4704
|
},
|
|
4704
4705
|
"overrides": {
|
|
@@ -105,18 +105,24 @@ export async function renderAgentAvatarSvg(
|
|
|
105
105
|
return vectorFrameToSvg(frame, options);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
/**
|
|
109
|
-
const
|
|
110
|
-
/**
|
|
111
|
-
|
|
108
|
+
/** How light the background is: a much, much lighter tint of the body's own colour. */
|
|
109
|
+
const PICTURE_LIGHT_TONE = 97;
|
|
110
|
+
/**
|
|
111
|
+
* The least contrast with the body at which that light tint still shows the character (a lime or
|
|
112
|
+
* a pure green on its own pale tint reads clearly; a pale yellow or a white would vanish).
|
|
113
|
+
*/
|
|
114
|
+
const PICTURE_MIN_CONTRAST = 1.25;
|
|
115
|
+
/** The contrast a body too light for the tint gets instead, from a darker tint of its hue. */
|
|
116
|
+
const PICTURE_FALLBACK_CONTRAST = 1.6;
|
|
112
117
|
/** The tint keeps the body's hue, softened so it reads as a background and not a second colour. */
|
|
113
118
|
const PICTURE_MAX_CHROMA = 20;
|
|
114
119
|
|
|
115
120
|
/**
|
|
116
|
-
* The background a character's picture stands on: its body colour's own hue
|
|
117
|
-
* tint (tone
|
|
118
|
-
*
|
|
119
|
-
*
|
|
121
|
+
* The background a character's picture stands on: its body colour's own hue in a much, much
|
|
122
|
+
* lighter tint (tone 97 of a softened tonal palette, as Bloom's themes derive their surfaces),
|
|
123
|
+
* for every colour that still shows against it, light ones included. Only a body nearly as light
|
|
124
|
+
* as that (a pale yellow, a white) gets a darker tint of its hue instead, so the character is
|
|
125
|
+
* never the same as what it stands on.
|
|
120
126
|
*/
|
|
121
127
|
export function avatarPictureBackground(bodyHex: string): string {
|
|
122
128
|
const body = Hct.fromInt(argbFromHex(bodyHex));
|
|
@@ -124,10 +130,10 @@ export function avatarPictureBackground(bodyHex: string): string {
|
|
|
124
130
|
body.hue,
|
|
125
131
|
Math.min(body.chroma, PICTURE_MAX_CHROMA),
|
|
126
132
|
);
|
|
127
|
-
if (ratioOfTones(body.tone, PICTURE_LIGHT_TONE) >=
|
|
133
|
+
if (ratioOfTones(body.tone, PICTURE_LIGHT_TONE) >= PICTURE_MIN_CONTRAST) {
|
|
128
134
|
return hexFromArgb(palette.tone(PICTURE_LIGHT_TONE));
|
|
129
135
|
}
|
|
130
|
-
const dark = darker(body.tone,
|
|
136
|
+
const dark = darker(body.tone, PICTURE_FALLBACK_CONTRAST);
|
|
131
137
|
return hexFromArgb(palette.tone(dark < 0 ? 0 : dark));
|
|
132
138
|
}
|
|
133
139
|
|