@oxy.so/bloom 7.1.1 → 7.1.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/assets/character-runtime/README.md +114 -19
- package/assets/character-runtime/authored-parts.mjs +754 -0
- package/assets/character-runtime/catalog-parts.mjs +362 -0
- package/assets/character-runtime/character-recipe.mjs +247 -0
- package/assets/character-runtime/clippo-geometry.mjs +679 -0
- package/assets/character-runtime/controller-mode.mjs +208 -0
- package/assets/character-runtime/cyclops-geometry.mjs +180 -0
- package/assets/character-runtime/legacy-engine.mjs +406 -54
- package/assets/character-runtime/legacy-geometry.mjs +242 -85
- package/assets/character-runtime/legacy-worker.mjs +82 -23
- package/assets/character-runtime/managed-avatar.mjs +12 -17
- package/assets/character-runtime/migrated-contours.mjs +2067 -0
- package/assets/character-runtime/migrated-faces.mjs +59 -0
- package/assets/character-runtime/pose-transition.mjs +523 -0
- package/assets/character-runtime/preparation-cache.mjs +60 -0
- package/assets/character-runtime/render-budget.mjs +5 -3
- package/assets/character-runtime/render-errors.mjs +180 -0
- package/assets/character-runtime/resolution.mjs +10 -0
- package/assets/character-runtime/runtime.mjs +744 -295
- package/assets/character-runtime/sha256.mjs +44 -0
- package/assets/character-runtime/shared-programs.mjs +534 -0
- package/assets/character-runtime/shared-surface.mjs +490 -0
- package/assets/character-runtime/shared-textures.mjs +420 -0
- package/assets/character-runtime/thumbnails/eyes/todd.png +0 -0
- package/docs/adoption-matrix.mdx +2 -2
- package/docs/agent-avatar.mdx +45 -8
- package/docs/agent-creator.mdx +13 -3
- package/docs/bottom-sheet.mdx +1 -1
- package/lib/commonjs/agent-avatar/AgentAvatar.js +1 -1
- package/lib/commonjs/agent-avatar/AgentAvatar.js.map +1 -1
- package/lib/commonjs/agent-avatar/CharacterAvatar.js +2 -1
- package/lib/commonjs/agent-avatar/CharacterAvatar.js.map +1 -1
- package/lib/commonjs/agent-avatar/character-colors.js +19 -0
- package/lib/commonjs/agent-avatar/character-colors.js.map +1 -0
- package/lib/commonjs/agent-avatar/character-shapes.js +106 -0
- package/lib/commonjs/agent-avatar/character-shapes.js.map +1 -0
- package/lib/commonjs/agent-avatar/config-character.js +4 -0
- package/lib/commonjs/agent-avatar/config-character.js.map +1 -1
- package/lib/commonjs/agent-avatar/legacy-recipe.js +19 -6
- package/lib/commonjs/agent-avatar/legacy-recipe.js.map +1 -1
- package/lib/commonjs/agent-creator/AgentCreatorBase.js +67 -107
- package/lib/commonjs/agent-creator/AgentCreatorBase.js.map +1 -1
- package/lib/commonjs/agent-creator/CharacterControls.js +23 -5
- package/lib/commonjs/agent-creator/CharacterControls.js.map +1 -1
- package/lib/commonjs/agent-creator/ClippoArtwork.js +63 -0
- package/lib/commonjs/agent-creator/ClippoArtwork.js.map +1 -0
- package/lib/commonjs/agent-creator/CyclopsArtwork.js +45 -0
- package/lib/commonjs/agent-creator/CyclopsArtwork.js.map +1 -0
- package/lib/commonjs/agent-creator/EmotionPicker.js +8 -1
- package/lib/commonjs/agent-creator/EmotionPicker.js.map +1 -1
- package/lib/commonjs/agent-creator/ShapeSilhouette.js +8 -1
- package/lib/commonjs/agent-creator/ShapeSilhouette.js.map +1 -1
- package/lib/commonjs/agent-creator/ToddArtwork.js +29 -0
- package/lib/commonjs/agent-creator/ToddArtwork.js.map +1 -0
- package/lib/commonjs/agent-creator/constants.js +16 -17
- package/lib/commonjs/agent-creator/constants.js.map +1 -1
- package/lib/commonjs/agent-creator/messages.js +1 -1
- package/lib/commonjs/agent-creator/messages.js.map +1 -1
- package/lib/commonjs/bottom-sheet/BottomSheetBase.js +33 -49
- package/lib/commonjs/bottom-sheet/BottomSheetBase.js.map +1 -1
- package/lib/commonjs/dialog/DialogBottomSheet.js +1 -1
- package/lib/commonjs/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/commonjs/locale/translations/ar.js +1 -1
- package/lib/commonjs/locale/translations/ar.js.map +1 -1
- package/lib/commonjs/locale/translations/bn.js +1 -1
- package/lib/commonjs/locale/translations/bn.js.map +1 -1
- package/lib/commonjs/locale/translations/ca.js +1 -1
- package/lib/commonjs/locale/translations/ca.js.map +1 -1
- package/lib/commonjs/locale/translations/de.js +1 -1
- package/lib/commonjs/locale/translations/de.js.map +1 -1
- package/lib/commonjs/locale/translations/es.js +1 -1
- package/lib/commonjs/locale/translations/es.js.map +1 -1
- package/lib/commonjs/locale/translations/fr.js +1 -1
- package/lib/commonjs/locale/translations/fr.js.map +1 -1
- package/lib/commonjs/locale/translations/hi.js +1 -1
- package/lib/commonjs/locale/translations/hi.js.map +1 -1
- package/lib/commonjs/locale/translations/id.js +1 -1
- package/lib/commonjs/locale/translations/id.js.map +1 -1
- package/lib/commonjs/locale/translations/it.js +1 -1
- package/lib/commonjs/locale/translations/it.js.map +1 -1
- package/lib/commonjs/locale/translations/ja.js +1 -1
- package/lib/commonjs/locale/translations/ja.js.map +1 -1
- package/lib/commonjs/locale/translations/pt.js +1 -1
- package/lib/commonjs/locale/translations/pt.js.map +1 -1
- package/lib/commonjs/locale/translations/ru.js +1 -1
- package/lib/commonjs/locale/translations/ru.js.map +1 -1
- package/lib/commonjs/locale/translations/tr.js +1 -1
- package/lib/commonjs/locale/translations/tr.js.map +1 -1
- package/lib/commonjs/locale/translations/zh.js +1 -1
- package/lib/commonjs/locale/translations/zh.js.map +1 -1
- package/lib/commonjs/surface/SurfacePaint.js +17 -4
- package/lib/commonjs/surface/SurfacePaint.js.map +1 -1
- package/lib/module/agent-avatar/AgentAvatar.js +1 -1
- package/lib/module/agent-avatar/AgentAvatar.js.map +1 -1
- package/lib/module/agent-avatar/CharacterAvatar.js +2 -1
- package/lib/module/agent-avatar/CharacterAvatar.js.map +1 -1
- package/lib/module/agent-avatar/character-colors.js +15 -0
- package/lib/module/agent-avatar/character-colors.js.map +1 -0
- package/lib/module/agent-avatar/character-shapes.js +97 -0
- package/lib/module/agent-avatar/character-shapes.js.map +1 -0
- package/lib/module/agent-avatar/config-character.js +4 -0
- package/lib/module/agent-avatar/config-character.js.map +1 -1
- package/lib/module/agent-avatar/legacy-recipe.js +19 -6
- package/lib/module/agent-avatar/legacy-recipe.js.map +1 -1
- package/lib/module/agent-creator/AgentCreatorBase.js +69 -109
- package/lib/module/agent-creator/AgentCreatorBase.js.map +1 -1
- package/lib/module/agent-creator/CharacterControls.js +24 -6
- package/lib/module/agent-creator/CharacterControls.js.map +1 -1
- package/lib/module/agent-creator/ClippoArtwork.js +59 -0
- package/lib/module/agent-creator/ClippoArtwork.js.map +1 -0
- package/lib/module/agent-creator/CyclopsArtwork.js +41 -0
- package/lib/module/agent-creator/CyclopsArtwork.js.map +1 -0
- package/lib/module/agent-creator/EmotionPicker.js +8 -1
- package/lib/module/agent-creator/EmotionPicker.js.map +1 -1
- package/lib/module/agent-creator/ShapeSilhouette.js +8 -1
- package/lib/module/agent-creator/ShapeSilhouette.js.map +1 -1
- package/lib/module/agent-creator/ToddArtwork.js +25 -0
- package/lib/module/agent-creator/ToddArtwork.js.map +1 -0
- package/lib/module/agent-creator/constants.js +8 -16
- package/lib/module/agent-creator/constants.js.map +1 -1
- package/lib/module/agent-creator/messages.js +1 -1
- package/lib/module/agent-creator/messages.js.map +1 -1
- package/lib/module/bottom-sheet/BottomSheetBase.js +33 -49
- package/lib/module/bottom-sheet/BottomSheetBase.js.map +1 -1
- package/lib/module/dialog/DialogBottomSheet.js +1 -1
- package/lib/module/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/module/locale/translations/ar.js +1 -1
- package/lib/module/locale/translations/ar.js.map +1 -1
- package/lib/module/locale/translations/bn.js +1 -1
- package/lib/module/locale/translations/bn.js.map +1 -1
- package/lib/module/locale/translations/ca.js +1 -1
- package/lib/module/locale/translations/ca.js.map +1 -1
- package/lib/module/locale/translations/de.js +1 -1
- package/lib/module/locale/translations/de.js.map +1 -1
- package/lib/module/locale/translations/es.js +1 -1
- package/lib/module/locale/translations/es.js.map +1 -1
- package/lib/module/locale/translations/fr.js +1 -1
- package/lib/module/locale/translations/fr.js.map +1 -1
- package/lib/module/locale/translations/hi.js +1 -1
- package/lib/module/locale/translations/hi.js.map +1 -1
- package/lib/module/locale/translations/id.js +1 -1
- package/lib/module/locale/translations/id.js.map +1 -1
- package/lib/module/locale/translations/it.js +1 -1
- package/lib/module/locale/translations/it.js.map +1 -1
- package/lib/module/locale/translations/ja.js +1 -1
- package/lib/module/locale/translations/ja.js.map +1 -1
- package/lib/module/locale/translations/pt.js +1 -1
- package/lib/module/locale/translations/pt.js.map +1 -1
- package/lib/module/locale/translations/ru.js +1 -1
- package/lib/module/locale/translations/ru.js.map +1 -1
- package/lib/module/locale/translations/tr.js +1 -1
- package/lib/module/locale/translations/tr.js.map +1 -1
- package/lib/module/locale/translations/zh.js +1 -1
- package/lib/module/locale/translations/zh.js.map +1 -1
- package/lib/module/surface/SurfacePaint.js +18 -5
- package/lib/module/surface/SurfacePaint.js.map +1 -1
- package/lib/typescript/commonjs/agent-avatar/CharacterAvatar.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-avatar/character-colors.d.ts +13 -0
- package/lib/typescript/commonjs/agent-avatar/character-colors.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-avatar/character-shapes.d.ts +19 -0
- package/lib/typescript/commonjs/agent-avatar/character-shapes.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-avatar/config-character.d.ts +4 -0
- package/lib/typescript/commonjs/agent-avatar/config-character.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-avatar/legacy-recipe.d.ts +2 -10
- package/lib/typescript/commonjs/agent-avatar/legacy-recipe.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-creator/AgentCreatorBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-creator/CharacterControls.d.ts +2 -1
- package/lib/typescript/commonjs/agent-creator/CharacterControls.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-creator/ClippoArtwork.d.ts +6 -0
- package/lib/typescript/commonjs/agent-creator/ClippoArtwork.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-creator/CyclopsArtwork.d.ts +5 -0
- package/lib/typescript/commonjs/agent-creator/CyclopsArtwork.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-creator/EmotionPicker.d.ts +1 -0
- package/lib/typescript/commonjs/agent-creator/EmotionPicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-creator/ShapeSilhouette.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-creator/ToddArtwork.d.ts +6 -0
- package/lib/typescript/commonjs/agent-creator/ToddArtwork.d.ts.map +1 -0
- package/lib/typescript/commonjs/agent-creator/constants.d.ts +7 -15
- package/lib/typescript/commonjs/agent-creator/constants.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-creator/messages.d.ts.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/types.d.ts +1 -0
- package/lib/typescript/commonjs/bottom-sheet/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/surface/SurfacePaint.d.ts.map +1 -1
- package/lib/typescript/module/agent-avatar/CharacterAvatar.d.ts.map +1 -1
- package/lib/typescript/module/agent-avatar/character-colors.d.ts +13 -0
- package/lib/typescript/module/agent-avatar/character-colors.d.ts.map +1 -0
- package/lib/typescript/module/agent-avatar/character-shapes.d.ts +19 -0
- package/lib/typescript/module/agent-avatar/character-shapes.d.ts.map +1 -0
- package/lib/typescript/module/agent-avatar/config-character.d.ts +4 -0
- package/lib/typescript/module/agent-avatar/config-character.d.ts.map +1 -1
- package/lib/typescript/module/agent-avatar/legacy-recipe.d.ts +2 -10
- package/lib/typescript/module/agent-avatar/legacy-recipe.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/AgentCreatorBase.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/CharacterControls.d.ts +2 -1
- package/lib/typescript/module/agent-creator/CharacterControls.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/ClippoArtwork.d.ts +6 -0
- package/lib/typescript/module/agent-creator/ClippoArtwork.d.ts.map +1 -0
- package/lib/typescript/module/agent-creator/CyclopsArtwork.d.ts +5 -0
- package/lib/typescript/module/agent-creator/CyclopsArtwork.d.ts.map +1 -0
- package/lib/typescript/module/agent-creator/EmotionPicker.d.ts +1 -0
- package/lib/typescript/module/agent-creator/EmotionPicker.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/ShapeSilhouette.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/ToddArtwork.d.ts +6 -0
- package/lib/typescript/module/agent-creator/ToddArtwork.d.ts.map +1 -0
- package/lib/typescript/module/agent-creator/constants.d.ts +7 -15
- package/lib/typescript/module/agent-creator/constants.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/messages.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/types.d.ts +1 -0
- package/lib/typescript/module/bottom-sheet/types.d.ts.map +1 -1
- package/lib/typescript/module/surface/SurfacePaint.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/agent-avatar/AgentAvatar.tsx +1 -1
- package/src/agent-avatar/CharacterAvatar.tsx +4 -1
- package/src/agent-avatar/character-colors.ts +12 -0
- package/src/agent-avatar/character-shapes.ts +122 -0
- package/src/agent-avatar/config-character.ts +39 -6
- package/src/agent-avatar/legacy-recipe.ts +34 -6
- package/src/agent-creator/AgentCreatorBase.tsx +121 -152
- package/src/agent-creator/CharacterControls.tsx +39 -14
- package/src/agent-creator/ClippoArtwork.tsx +49 -0
- package/src/agent-creator/CyclopsArtwork.tsx +27 -0
- package/src/agent-creator/EmotionPicker.tsx +55 -16
- package/src/agent-creator/ShapeSilhouette.tsx +16 -1
- package/src/agent-creator/ToddArtwork.tsx +24 -0
- package/src/agent-creator/constants.ts +47 -14
- package/src/agent-creator/messages.ts +2 -1
- package/src/bottom-sheet/BottomSheetBase.tsx +24 -34
- package/src/bottom-sheet/types.ts +1 -0
- package/src/dialog/DialogBottomSheet.tsx +1 -1
- package/src/locale/translations/ar.ts +1 -1
- package/src/locale/translations/bn.ts +1 -1
- package/src/locale/translations/ca.ts +1 -1
- package/src/locale/translations/de.ts +1 -1
- package/src/locale/translations/es.ts +1 -1
- package/src/locale/translations/fr.ts +1 -1
- package/src/locale/translations/hi.ts +1 -1
- package/src/locale/translations/id.ts +1 -1
- package/src/locale/translations/it.ts +1 -1
- package/src/locale/translations/ja.ts +1 -1
- package/src/locale/translations/pt.ts +1 -1
- package/src/locale/translations/ru.ts +1 -1
- package/src/locale/translations/tr.ts +1 -1
- package/src/locale/translations/zh.ts +1 -1
- package/src/surface/SurfacePaint.tsx +14 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../src/agent-creator/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,sGAAsG;IACtG,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACzE,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,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.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAuBpE,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"BottomSheetBase.d.ts","sourceRoot":"","sources":["../../../../src/bottom-sheet/BottomSheetBase.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAkB/B,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAuBpE,eAAO,MAAM,eAAe,6FA4sB1B,CAAC"}
|
|
@@ -41,6 +41,7 @@ export interface BottomSheetProps {
|
|
|
41
41
|
*/
|
|
42
42
|
style?: StyleProp<AnimatedStyle<ViewStyle>>;
|
|
43
43
|
enableHandlePanningGesture?: boolean;
|
|
44
|
+
/** Veto user Back/backdrop/Escape/pan requests before closing; imperative dismiss bypasses it. */
|
|
44
45
|
onDismissAttempt?: () => boolean;
|
|
45
46
|
detached?: boolean;
|
|
46
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/bottom-sheet/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAkB,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACtG,OAAiB,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEzF,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ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AC;IACvC;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACxC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC9B;;;;OAIG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACjD;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,qBAAqB;IAClC,kEAAkE;IAClE,OAAO,EAAE,OAAO,CAAC;IACjB,gFAAgF;IAChF,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B;;;OAGG;IACH,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC1D,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC;CACrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SurfacePaint.d.ts","sourceRoot":"","sources":["../../../../src/surface/SurfacePaint.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,
|
|
1
|
+
{"version":3,"file":"SurfacePaint.d.ts","sourceRoot":"","sources":["../../../../src/surface/SurfacePaint.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,EAAsD,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAiBlG;;;;;GAKG;AACH,eAAO,MAAM,YAAY;YAQf,OAAO;aACN,MAAM;IACf,oEAAoE;WAC7D,MAAM;aACJ,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IAC/C,4EAA4E;YACpE,YAAY;gBACR,KAAK,GAAG,KAAK;EAqDzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@ export const AgentAvatar = memo(function AgentAvatar(props: AgentAvatarProps) {
|
|
|
12
12
|
props.config.character && props.config.character.preset !== 'bloom';
|
|
13
13
|
const legacy = runtimeUrl && !legacyRecipeUnsupported(props.config);
|
|
14
14
|
return beta || legacy ? (
|
|
15
|
-
<CharacterAvatar
|
|
15
|
+
<CharacterAvatar {...props} />
|
|
16
16
|
) : (
|
|
17
17
|
<ProceduralAvatar {...props} />
|
|
18
18
|
);
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
type CharacterWebViewHandle,
|
|
13
13
|
} from './character-webview';
|
|
14
14
|
import { legacyRecipe } from './legacy-recipe';
|
|
15
|
+
import { isMigratedCharacterShape } from './character-shapes';
|
|
15
16
|
import { AGENT_AVATAR_MESSAGES } from './messages';
|
|
16
17
|
import type { AgentAvatarProps } from './types';
|
|
17
18
|
|
|
@@ -203,7 +204,9 @@ export function CharacterAvatar(props: AgentAvatarProps) {
|
|
|
203
204
|
useEffect(() => setFailed(false), [runtimeUrl, config.character]);
|
|
204
205
|
const legacy = useMemo(
|
|
205
206
|
() =>
|
|
206
|
-
!config.character ||
|
|
207
|
+
!config.character ||
|
|
208
|
+
config.character.preset === 'bloom' ||
|
|
209
|
+
isMigratedCharacterShape(config.character.selections?.shape)
|
|
207
210
|
? legacyRecipe(config)
|
|
208
211
|
: undefined,
|
|
209
212
|
[config],
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** RGB swatches returned by the recovered engine's Color catalog. */
|
|
2
|
+
export const CHARACTER_COLORS = {
|
|
3
|
+
pink: '#fa70ab',
|
|
4
|
+
orchid: '#dd6adc',
|
|
5
|
+
violet: '#a25bff',
|
|
6
|
+
blue: '#4778ff',
|
|
7
|
+
cyan: '#00b1ff',
|
|
8
|
+
teal: '#04bb9f',
|
|
9
|
+
lime: '#b6d80b',
|
|
10
|
+
yellow: '#ffcc38',
|
|
11
|
+
coral: '#ff8066',
|
|
12
|
+
} as const;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { avatarHex } from './avatar-color';
|
|
2
|
+
import type { AvatarCharacterConfig } from './config-character';
|
|
3
|
+
import type { AvatarConfig } from './model';
|
|
4
|
+
|
|
5
|
+
export const NATIVE_CHARACTER_SHAPES = [
|
|
6
|
+
['clippo', 'Clippo'],
|
|
7
|
+
['todd', 'Todd'],
|
|
8
|
+
['circle', 'Circle'],
|
|
9
|
+
['rounded_triangle', 'Rounded triangle'],
|
|
10
|
+
['capsule', 'Capsule'],
|
|
11
|
+
['rounded_head_two_ears', 'Rounded head with two ears'],
|
|
12
|
+
['six_lobed_flower', 'Six lobed flower'],
|
|
13
|
+
['heart', 'Heart'],
|
|
14
|
+
['four_lobed_butterfly', 'Four lobed butterfly'],
|
|
15
|
+
['circle_two_ears', 'Circle with two ears'],
|
|
16
|
+
['twelve_scalloped_rosette', 'Twelve scalloped rosette'],
|
|
17
|
+
['rounded_cube', 'Hexagon'],
|
|
18
|
+
['rounded_diamond', 'Rounded diamond'],
|
|
19
|
+
] as const;
|
|
20
|
+
export const MIGRATED_CHARACTER_SHAPES = [
|
|
21
|
+
['slender', 'Slender'],
|
|
22
|
+
['pocket', 'Pocket'],
|
|
23
|
+
['petal', 'Petal'],
|
|
24
|
+
['star', 'Star'],
|
|
25
|
+
['cloud', 'Cloud'],
|
|
26
|
+
['shield', 'Shield'],
|
|
27
|
+
['pebble', 'Pebble'],
|
|
28
|
+
['squircle', 'Squircle'],
|
|
29
|
+
] as const;
|
|
30
|
+
export const CHARACTER_SHAPES = [
|
|
31
|
+
...NATIVE_CHARACTER_SHAPES,
|
|
32
|
+
...MIGRATED_CHARACTER_SHAPES,
|
|
33
|
+
] as const;
|
|
34
|
+
|
|
35
|
+
export function isMigratedCharacterShape(id: string | undefined): boolean {
|
|
36
|
+
return MIGRATED_CHARACTER_SHAPES.some(([shape]) => shape === id);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** The saved paper/blob fields remain readable; canonical shape IDs own new edits. */
|
|
40
|
+
export function currentCharacterShape(config: AvatarConfig): string {
|
|
41
|
+
if (config.character?.selections?.shape)
|
|
42
|
+
return config.character.selections.shape;
|
|
43
|
+
const shape = config.family === 'fold' ? config.foldShape : config.shape;
|
|
44
|
+
const equivalent: Partial<Record<string, string>> = {
|
|
45
|
+
triangle: 'rounded_triangle',
|
|
46
|
+
flower: 'six_lobed_flower',
|
|
47
|
+
diamond: 'rounded_diamond',
|
|
48
|
+
};
|
|
49
|
+
return equivalent[shape] ?? shape;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Geometry-only view of one of the eight migrated contours. */
|
|
53
|
+
export function characterShapeGeometry(config: AvatarConfig): AvatarConfig {
|
|
54
|
+
const shape = config.character?.selections?.shape;
|
|
55
|
+
if (!isMigratedCharacterShape(shape)) return config;
|
|
56
|
+
return shape === 'pebble' || shape === 'squircle'
|
|
57
|
+
? { ...config, family: 'blob', shape }
|
|
58
|
+
: {
|
|
59
|
+
...config,
|
|
60
|
+
family: 'fold',
|
|
61
|
+
foldShape: shape as AvatarConfig['foldShape'],
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** Retain effective authored parts while preparing the next body. An old recipe
|
|
66
|
+
* is promoted once, with its actual paint and contour rather than Felipe defaults.
|
|
67
|
+
*/
|
|
68
|
+
export function materializeCharacter(
|
|
69
|
+
config: AvatarConfig,
|
|
70
|
+
selected: Readonly<Record<string, string>> = {},
|
|
71
|
+
): AvatarCharacterConfig {
|
|
72
|
+
const saved = config.character;
|
|
73
|
+
if (!saved || saved.preset === 'bloom')
|
|
74
|
+
return {
|
|
75
|
+
...saved,
|
|
76
|
+
preset: 'legacy',
|
|
77
|
+
...(saved?.bodyColor
|
|
78
|
+
? { bodyColor: saved.bodyColor }
|
|
79
|
+
: !saved?.selections?.color
|
|
80
|
+
? { bodyColor: avatarHex(config) }
|
|
81
|
+
: {}),
|
|
82
|
+
selections: {
|
|
83
|
+
shape: currentCharacterShape(config),
|
|
84
|
+
eyes: 'oval',
|
|
85
|
+
eyewear: 'none',
|
|
86
|
+
accessory: 'none',
|
|
87
|
+
...saved?.selections,
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
const defaults: NonNullable<AvatarCharacterConfig['selections']> = {};
|
|
91
|
+
for (const part of ['eyes', 'eyewear', 'accessory'] as const)
|
|
92
|
+
if (selected[part]) defaults[part] = selected[part];
|
|
93
|
+
// These virtual parts are absent from the backing native catalog.
|
|
94
|
+
if (!defaults.eyes && saved.preset === 'clippo') defaults.eyes = 'clippo';
|
|
95
|
+
if (!defaults.eyes && saved.preset === 'lime_frog') defaults.eyes = 'todd';
|
|
96
|
+
if (!defaults.accessory && saved.preset === 'blue_beret')
|
|
97
|
+
defaults.accessory = 'felipe_beret';
|
|
98
|
+
return { ...saved, selections: { ...defaults, ...saved.selections } };
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** All 21 bodies change the same character recipe. Named paint and explicit RGB
|
|
102
|
+
* keep their precedence; a body never supplies a replacement color or face.
|
|
103
|
+
*/
|
|
104
|
+
export function createConfigForShape(
|
|
105
|
+
config: AvatarConfig,
|
|
106
|
+
shape: string,
|
|
107
|
+
selected: Readonly<Record<string, string>> = {},
|
|
108
|
+
): AvatarConfig {
|
|
109
|
+
if (!CHARACTER_SHAPES.some(([id]) => id === shape))
|
|
110
|
+
throw new Error('Unknown character shape.');
|
|
111
|
+
const character = materializeCharacter(config, selected);
|
|
112
|
+
if (!character.bodyColor && !character.selections?.color) {
|
|
113
|
+
if (character.preset === 'clippo') character.bodyColor = '#999b9d';
|
|
114
|
+
else if (selected.color)
|
|
115
|
+
character.selections = { ...character.selections, color: selected.color };
|
|
116
|
+
else if (selected.bodyColor) character.bodyColor = selected.bodyColor;
|
|
117
|
+
}
|
|
118
|
+
return characterShapeGeometry({
|
|
119
|
+
...config,
|
|
120
|
+
character: { ...character, selections: { ...character.selections, shape } },
|
|
121
|
+
});
|
|
122
|
+
}
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
/** Catalog parts extend the existing avatar recipe without discarding its shape or expression fields. */
|
|
2
|
-
export type AvatarCharacterCategory =
|
|
2
|
+
export type AvatarCharacterCategory =
|
|
3
|
+
'shape' | 'color' | 'eyes' | 'eyewear' | 'accessory';
|
|
3
4
|
|
|
4
5
|
export type AvatarCharacterConfig = {
|
|
6
|
+
/** Named catalog preset, including Clippo (`clippo`), or a saved renderer ID. */
|
|
5
7
|
preset: string;
|
|
8
|
+
/** Clippo's open wire body and ring eyes are independently selectable with ID `clippo`. */
|
|
6
9
|
selections?: Partial<Record<AvatarCharacterCategory, string>>;
|
|
7
10
|
/** Custom body RGB accepted by the original renderer, stored as lowercase #RRGGBB. */
|
|
8
11
|
bodyColor?: string;
|
|
12
|
+
/** @deprecated Retained when reading saved recipes; ignored by the renderer. Each shape owns its eye layout. */
|
|
13
|
+
eyeSpacing?: number;
|
|
9
14
|
};
|
|
10
15
|
|
|
11
|
-
const categories: readonly AvatarCharacterCategory[] = [
|
|
16
|
+
const categories: readonly AvatarCharacterCategory[] = [
|
|
17
|
+
'shape',
|
|
18
|
+
'color',
|
|
19
|
+
'eyes',
|
|
20
|
+
'eyewear',
|
|
21
|
+
'accessory',
|
|
22
|
+
];
|
|
12
23
|
const validId = (value: unknown): value is string =>
|
|
13
24
|
typeof value === 'string' && value.length > 0 && value.length <= 63;
|
|
14
25
|
|
|
@@ -19,22 +30,44 @@ export function parseCharacterConfig(value: unknown): AvatarCharacterConfig {
|
|
|
19
30
|
const candidate = value as Record<string, unknown>;
|
|
20
31
|
if (!validId(candidate.preset)) throw new Error('Invalid character preset.');
|
|
21
32
|
const result: AvatarCharacterConfig = { preset: candidate.preset };
|
|
33
|
+
if (candidate.eyeSpacing !== undefined) {
|
|
34
|
+
if (
|
|
35
|
+
typeof candidate.eyeSpacing !== 'number' ||
|
|
36
|
+
!Number.isFinite(candidate.eyeSpacing) ||
|
|
37
|
+
candidate.eyeSpacing < 0.5 ||
|
|
38
|
+
candidate.eyeSpacing > 1.5
|
|
39
|
+
)
|
|
40
|
+
throw new Error('Invalid character eye spacing.');
|
|
41
|
+
result.eyeSpacing = candidate.eyeSpacing;
|
|
42
|
+
}
|
|
22
43
|
if (candidate.bodyColor !== undefined) {
|
|
23
|
-
if (
|
|
44
|
+
if (
|
|
45
|
+
typeof candidate.bodyColor !== 'string' ||
|
|
46
|
+
candidate.bodyColor.length !== 7 ||
|
|
47
|
+
!/^#[0-9a-f]{6}$/i.test(candidate.bodyColor)
|
|
48
|
+
)
|
|
24
49
|
throw new Error('Invalid character body color.');
|
|
25
50
|
result.bodyColor = candidate.bodyColor.toLowerCase();
|
|
26
51
|
}
|
|
27
52
|
if (candidate.selections !== undefined) {
|
|
28
|
-
if (
|
|
53
|
+
if (
|
|
54
|
+
!candidate.selections ||
|
|
55
|
+
typeof candidate.selections !== 'object' ||
|
|
56
|
+
Array.isArray(candidate.selections)
|
|
57
|
+
)
|
|
29
58
|
throw new Error('Invalid character selections.');
|
|
30
59
|
const selections: NonNullable<AvatarCharacterConfig['selections']> = {};
|
|
31
60
|
for (const [category, id] of Object.entries(candidate.selections)) {
|
|
32
|
-
if (
|
|
61
|
+
if (
|
|
62
|
+
!categories.includes(category as AvatarCharacterCategory) ||
|
|
63
|
+
!validId(id)
|
|
64
|
+
)
|
|
33
65
|
throw new Error('Invalid character selection.');
|
|
34
66
|
selections[category as AvatarCharacterCategory] = id;
|
|
35
67
|
}
|
|
36
68
|
result.selections = selections;
|
|
37
69
|
}
|
|
38
|
-
if ('state' in candidate)
|
|
70
|
+
if ('state' in candidate)
|
|
71
|
+
throw new Error('Opaque character state is not supported.');
|
|
39
72
|
return result;
|
|
40
73
|
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { CHARACTER_COLORS } from './character-colors';
|
|
2
|
+
import {
|
|
3
|
+
characterShapeGeometry,
|
|
4
|
+
isMigratedCharacterShape,
|
|
5
|
+
} from './character-shapes';
|
|
1
6
|
import { avatarHex } from './avatar-color';
|
|
2
7
|
import { legacyContours } from './legacy-contours';
|
|
3
8
|
import type { AvatarConfig } from './model';
|
|
@@ -9,6 +14,7 @@ export type LegacyRecipe = {
|
|
|
9
14
|
points?: Point[];
|
|
10
15
|
shape?: string;
|
|
11
16
|
eyes: string;
|
|
17
|
+
eyeSpacing?: number;
|
|
12
18
|
selections?: Pick<
|
|
13
19
|
NonNullable<AvatarCharacterConfig['selections']>,
|
|
14
20
|
'eyewear' | 'accessory'
|
|
@@ -18,6 +24,8 @@ export type LegacyRecipe = {
|
|
|
18
24
|
|
|
19
25
|
/** Saved unsupported artwork stays readable without pretending it was migrated. */
|
|
20
26
|
export function legacyRecipeUnsupported(config: AvatarConfig): boolean {
|
|
27
|
+
if (isMigratedCharacterShape(config.character?.selections?.shape))
|
|
28
|
+
return false;
|
|
21
29
|
return (
|
|
22
30
|
config.family === 'alien' || config.family === 'mascot' || !config.face
|
|
23
31
|
);
|
|
@@ -74,6 +82,8 @@ export function radialContour(polygons: Point[][], samples = 256): Point[] {
|
|
|
74
82
|
|
|
75
83
|
/** Shared capability identity for the editor and the legacy engine adapter. */
|
|
76
84
|
export function legacyCharacterRecipe(config: AvatarConfig) {
|
|
85
|
+
if (config.character && config.character.preset !== 'bloom')
|
|
86
|
+
return config.character;
|
|
77
87
|
const customization =
|
|
78
88
|
config.character?.preset === 'bloom' ? config.character : undefined;
|
|
79
89
|
return {
|
|
@@ -88,7 +98,15 @@ export function legacyCharacterRecipe(config: AvatarConfig) {
|
|
|
88
98
|
? { accessory: customization.selections.accessory }
|
|
89
99
|
: {}),
|
|
90
100
|
},
|
|
91
|
-
bodyColor:
|
|
101
|
+
bodyColor:
|
|
102
|
+
customization?.bodyColor ??
|
|
103
|
+
CHARACTER_COLORS[
|
|
104
|
+
customization?.selections?.color as keyof typeof CHARACTER_COLORS
|
|
105
|
+
] ??
|
|
106
|
+
avatarHex(config),
|
|
107
|
+
...(customization?.eyeSpacing !== undefined
|
|
108
|
+
? { eyeSpacing: customization.eyeSpacing }
|
|
109
|
+
: {}),
|
|
92
110
|
};
|
|
93
111
|
}
|
|
94
112
|
|
|
@@ -102,14 +120,24 @@ export function legacyRecipe(
|
|
|
102
120
|
): LegacyRecipe {
|
|
103
121
|
if (legacyRecipeUnsupported(config))
|
|
104
122
|
throw new Error('Unsupported legacy 3D recipe');
|
|
105
|
-
const
|
|
123
|
+
const geometry = characterShapeGeometry(config);
|
|
124
|
+
const canonical = config.character && config.character.preset !== 'bloom';
|
|
125
|
+
const selectedShape = canonical
|
|
126
|
+
? config.character?.selections?.shape
|
|
127
|
+
: undefined;
|
|
128
|
+
const shape = isMigratedCharacterShape(selectedShape)
|
|
129
|
+
? undefined
|
|
130
|
+
: (selectedShape ?? legacyNativeShape(geometry));
|
|
106
131
|
const recipe = legacyCharacterRecipe(config);
|
|
107
|
-
const { eyewear, accessory } = recipe.selections;
|
|
132
|
+
const { eyewear, accessory } = recipe.selections ?? {};
|
|
108
133
|
return {
|
|
109
134
|
...(shape
|
|
110
135
|
? { shape }
|
|
111
|
-
: { points: radialContour(legacyContours(
|
|
112
|
-
eyes: recipe.selections
|
|
136
|
+
: { points: radialContour(legacyContours(geometry), samples) }),
|
|
137
|
+
eyes: recipe.selections?.eyes ?? 'oval',
|
|
138
|
+
...(recipe.eyeSpacing !== undefined
|
|
139
|
+
? { eyeSpacing: recipe.eyeSpacing }
|
|
140
|
+
: {}),
|
|
113
141
|
...(eyewear || accessory
|
|
114
142
|
? {
|
|
115
143
|
selections: {
|
|
@@ -118,6 +146,6 @@ export function legacyRecipe(
|
|
|
118
146
|
},
|
|
119
147
|
}
|
|
120
148
|
: {}),
|
|
121
|
-
patch: { bodyColor: recipe.bodyColor },
|
|
149
|
+
patch: { bodyColor: recipe.bodyColor ?? avatarHex(config) },
|
|
122
150
|
};
|
|
123
151
|
}
|