@nice2dev/ui-graphics 1.3.15 → 1.3.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/animation/AnimatedPerson.js +470 -143
  3. package/dist/cjs/animation/AnimationEditor.js +289 -101
  4. package/dist/cjs/animation/Audience.js +83 -61
  5. package/dist/cjs/animation/BodyRenderer.js +69 -28
  6. package/dist/cjs/animation/animationHelper.js +281 -288
  7. package/dist/cjs/animation/characterTypes.js +200 -203
  8. package/dist/cjs/animation/choreoDSL.js +205 -219
  9. package/dist/cjs/animation/choreography.js +4 -32
  10. package/dist/cjs/animation/karaokeIntegration.js +68 -77
  11. package/dist/cjs/animation/lottieExport.js +108 -114
  12. package/dist/cjs/animation/motionPath.js +225 -248
  13. package/dist/cjs/animation/physics.js +227 -254
  14. package/dist/cjs/animation/rig/RigPlayer.js +53 -56
  15. package/dist/cjs/animation/rig/RiggedBody.js +71 -26
  16. package/dist/cjs/animation/rig/choreoRigBridge.js +72 -77
  17. package/dist/cjs/animation/rig/ik.js +13 -18
  18. package/dist/cjs/animation/rig/poseOps.js +34 -41
  19. package/dist/cjs/animation/rig/presets.js +64 -72
  20. package/dist/cjs/animation/rig/rigMath.js +25 -32
  21. package/dist/cjs/animation/rig/rigTypes.js +59 -63
  22. package/dist/cjs/animation/shapes/arms.js +31 -13
  23. package/dist/cjs/animation/shapes/eyes.js +129 -47
  24. package/dist/cjs/animation/shapes/hair.js +72 -45
  25. package/dist/cjs/animation/shapes/heads.js +131 -57
  26. package/dist/cjs/animation/shapes/headwear.js +47 -38
  27. package/dist/cjs/animation/shapes/legs.js +31 -13
  28. package/dist/cjs/animation/shapes/mouths.js +120 -44
  29. package/dist/cjs/animation/shapes/noses.js +80 -25
  30. package/dist/cjs/animation/shapes/outfits.js +101 -39
  31. package/dist/cjs/animation/shapes/torsos.js +15 -11
  32. package/dist/cjs/animation/spineExport.js +103 -121
  33. package/dist/cjs/core/LocalUI.js +108 -43
  34. package/dist/cjs/core/NiceBrushEngine.js +758 -552
  35. package/dist/cjs/core/collaboration.js +249 -251
  36. package/dist/cjs/core/colorBlindness.js +100 -115
  37. package/dist/cjs/core/dragDrop.js +155 -158
  38. package/dist/cjs/core/editorAsk.js +51 -41
  39. package/dist/cjs/core/fixes.js +140 -171
  40. package/dist/cjs/core/gridGuides.js +166 -201
  41. package/dist/cjs/core/historyVisual.js +156 -135
  42. package/dist/cjs/core/i18n.js +13 -14
  43. package/dist/cjs/core/integrations.js +238 -249
  44. package/dist/cjs/core/minimap.js +149 -151
  45. package/dist/cjs/core/plugins.js +98 -113
  46. package/dist/cjs/core/rtl.js +71 -83
  47. package/dist/cjs/core/shortcuts.js +196 -225
  48. package/dist/cjs/core/theme.js +142 -149
  49. package/dist/cjs/core/yjsCollaboration.js +232 -293
  50. package/dist/cjs/design/design-tools.js +12 -22
  51. package/dist/cjs/font/NiceFontEditor.js +877 -316
  52. package/dist/cjs/font/fontFormatUtils.js +388 -448
  53. package/dist/cjs/game/GameAsset2dEditor.js +1201 -392
  54. package/dist/cjs/game/GameAsset2dEditor.module.css.js +146 -5
  55. package/dist/cjs/game/gameAssetTypes.js +7 -16
  56. package/dist/cjs/game/gameAssetUtils.js +390 -413
  57. package/dist/cjs/game/useGameAssetEditor.js +820 -763
  58. package/dist/cjs/index.js +81 -84
  59. package/dist/cjs/nice2dev-ui-graphics.css +1 -1
  60. package/dist/cjs/node_modules/lib0/array.js +8 -70
  61. package/dist/cjs/node_modules/lib0/binary.js +3 -20
  62. package/dist/cjs/node_modules/lib0/broadcastchannel.js +24 -86
  63. package/dist/cjs/node_modules/lib0/buffer.js +15 -82
  64. package/dist/cjs/node_modules/lib0/conditions.js +3 -16
  65. package/dist/cjs/node_modules/lib0/decoding.js +108 -287
  66. package/dist/cjs/node_modules/lib0/dom.js +14 -44
  67. package/dist/cjs/node_modules/lib0/encoding.js +68 -418
  68. package/dist/cjs/node_modules/lib0/environment.js +26 -92
  69. package/dist/cjs/node_modules/lib0/error.js +5 -29
  70. package/dist/cjs/node_modules/lib0/function.js +27 -66
  71. package/dist/cjs/node_modules/lib0/iterator.js +8 -33
  72. package/dist/cjs/node_modules/lib0/logging.common.js +12 -22
  73. package/dist/cjs/node_modules/lib0/logging.js +32 -71
  74. package/dist/cjs/node_modules/lib0/map.js +16 -86
  75. package/dist/cjs/node_modules/lib0/math.js +3 -32
  76. package/dist/cjs/node_modules/lib0/number.js +4 -15
  77. package/dist/cjs/node_modules/lib0/object.js +14 -88
  78. package/dist/cjs/node_modules/lib0/observable.js +38 -78
  79. package/dist/cjs/node_modules/lib0/pair.js +3 -20
  80. package/dist/cjs/node_modules/lib0/prng.js +8 -77
  81. package/dist/cjs/node_modules/lib0/promise.js +6 -30
  82. package/dist/cjs/node_modules/lib0/random.js +8 -23
  83. package/dist/cjs/node_modules/lib0/schema.js +313 -687
  84. package/dist/cjs/node_modules/lib0/set.js +3 -10
  85. package/dist/cjs/node_modules/lib0/storage.js +20 -55
  86. package/dist/cjs/node_modules/lib0/string.js +17 -72
  87. package/dist/cjs/node_modules/lib0/symbol.js +2 -12
  88. package/dist/cjs/node_modules/lib0/time.js +2 -15
  89. package/dist/cjs/node_modules/lib0/trait/equality.js +3 -28
  90. package/dist/cjs/node_modules/lib0/url.js +4 -18
  91. package/dist/cjs/node_modules/lib0/webcrypto.js +2 -5
  92. package/dist/cjs/node_modules/y-protocols/auth.js +5 -19
  93. package/dist/cjs/node_modules/y-protocols/awareness.js +53 -116
  94. package/dist/cjs/node_modules/y-protocols/sync.js +16 -103
  95. package/dist/cjs/node_modules/y-websocket/src/y-websocket.js +77 -219
  96. package/dist/cjs/node_modules/yjs/dist/yjs.js +2128 -4868
  97. package/dist/cjs/photo/FilterThumb.js +37 -25
  98. package/dist/cjs/photo/NiceAITools.js +679 -467
  99. package/dist/cjs/photo/PhotoEditor.js +34 -20
  100. package/dist/cjs/photo/PhotoEditor.module.css.js +296 -5
  101. package/dist/cjs/photo/PhotoEditorCanvas.js +250 -91
  102. package/dist/cjs/photo/PhotoEditorLeftPanel.js +1086 -224
  103. package/dist/cjs/photo/PhotoEditorToolbar.js +135 -19
  104. package/dist/cjs/photo/photoEditorActions.js +89 -72
  105. package/dist/cjs/photo/photoEditorTypes.js +29 -32
  106. package/dist/cjs/photo/photoFilters.js +959 -985
  107. package/dist/cjs/photo/photoOverlays.js +899 -945
  108. package/dist/cjs/photo/photoSelection.js +427 -499
  109. package/dist/cjs/photo/usePhotoEditor.js +739 -741
  110. package/dist/cjs/pixel/HSVPicker.js +191 -175
  111. package/dist/cjs/pixel/PixelEditor.js +159 -48
  112. package/dist/cjs/pixel/PixelEditor.module.css.js +209 -5
  113. package/dist/cjs/pixel/PixelEditorCanvas.js +29 -16
  114. package/dist/cjs/pixel/PixelEditorMenuBar.js +160 -162
  115. package/dist/cjs/pixel/PixelEditorRightPanel.js +377 -45
  116. package/dist/cjs/pixel/PixelEditorStatusBar.js +47 -20
  117. package/dist/cjs/pixel/PixelEditorTimeline.js +106 -23
  118. package/dist/cjs/pixel/PixelEditorToolbar.js +99 -21
  119. package/dist/cjs/pixel/SpriteGeneratorPanel.js +483 -303
  120. package/dist/cjs/pixel/animalGeneratorPresets.js +776 -601
  121. package/dist/cjs/pixel/asepriteFormat.js +511 -560
  122. package/dist/cjs/pixel/buildingGeneratorPresets.js +693 -520
  123. package/dist/cjs/pixel/characterGeneratorPresets.js +644 -544
  124. package/dist/cjs/pixel/pixel-pro.js +52 -63
  125. package/dist/cjs/pixel/pixelEditorExports.js +388 -428
  126. package/dist/cjs/pixel/pixelEditorTypes.js +91 -108
  127. package/dist/cjs/pixel/pixelEditorUtils.js +519 -561
  128. package/dist/cjs/pixel/spriteGeneratorCore.js +206 -257
  129. package/dist/cjs/pixel/usePixelEditor.js +1321 -1343
  130. package/dist/cjs/texture/Nice3DTexturePainter.js +707 -440
  131. package/dist/cjs/ui/NiceUIDesigner.js +954 -527
  132. package/dist/cjs/vector/NiceSvgToCode.js +586 -446
  133. package/dist/cjs/vector/VectorEditor.js +290 -117
  134. package/dist/cjs/vector/VectorEditor.module.css.js +86 -5
  135. package/dist/cjs/vector/VectorEditorMenuBar.js +333 -275
  136. package/dist/cjs/vector/VectorEditorRightPanel.js +1094 -371
  137. package/dist/cjs/vector/VectorEditorShapeRenderer.js +198 -60
  138. package/dist/cjs/vector/VectorEditorStatusBar.js +39 -13
  139. package/dist/cjs/vector/useVectorEditor.js +848 -889
  140. package/dist/cjs/vector/vectorAnimation.js +110 -137
  141. package/dist/cjs/vector/vectorBooleanOps.js +398 -485
  142. package/dist/cjs/vector/vectorEditorExport.js +201 -203
  143. package/dist/cjs/vector/vectorEditorImport.js +173 -189
  144. package/dist/cjs/vector/vectorEditorTypes.js +42 -49
  145. package/dist/cjs/vector/vectorGradients.js +151 -174
  146. package/dist/cjs/vector/vectorIconExport.js +52 -59
  147. package/dist/cjs/vector/vectorIconImport.js +169 -219
  148. package/dist/esm/animation/AnimatedPerson.js +470 -141
  149. package/dist/esm/animation/AnimationEditor.js +290 -100
  150. package/dist/esm/animation/Audience.js +83 -59
  151. package/dist/esm/animation/BodyRenderer.js +71 -25
  152. package/dist/esm/animation/animationHelper.js +284 -287
  153. package/dist/esm/animation/characterTypes.js +204 -202
  154. package/dist/esm/animation/choreoDSL.js +212 -218
  155. package/dist/esm/animation/choreography.js +8 -31
  156. package/dist/esm/animation/karaokeIntegration.js +74 -76
  157. package/dist/esm/animation/lottieExport.js +112 -113
  158. package/dist/esm/animation/motionPath.js +235 -247
  159. package/dist/esm/animation/physics.js +235 -253
  160. package/dist/esm/animation/rig/RigPlayer.js +53 -54
  161. package/dist/esm/animation/rig/RiggedBody.js +71 -24
  162. package/dist/esm/animation/rig/choreoRigBridge.js +74 -76
  163. package/dist/esm/animation/rig/ik.js +14 -17
  164. package/dist/esm/animation/rig/poseOps.js +37 -40
  165. package/dist/esm/animation/rig/presets.js +70 -71
  166. package/dist/esm/animation/rig/rigMath.js +28 -31
  167. package/dist/esm/animation/rig/rigTypes.js +62 -62
  168. package/dist/esm/animation/shapes/arms.js +32 -12
  169. package/dist/esm/animation/shapes/eyes.js +135 -46
  170. package/dist/esm/animation/shapes/hair.js +80 -44
  171. package/dist/esm/animation/shapes/heads.js +140 -56
  172. package/dist/esm/animation/shapes/headwear.js +54 -37
  173. package/dist/esm/animation/shapes/legs.js +32 -12
  174. package/dist/esm/animation/shapes/mouths.js +127 -43
  175. package/dist/esm/animation/shapes/noses.js +87 -24
  176. package/dist/esm/animation/shapes/outfits.js +106 -38
  177. package/dist/esm/animation/shapes/torsos.js +16 -10
  178. package/dist/esm/animation/spineExport.js +106 -120
  179. package/dist/esm/core/LocalUI.js +111 -42
  180. package/dist/esm/core/NiceBrushEngine.js +761 -551
  181. package/dist/esm/core/collaboration.js +255 -250
  182. package/dist/esm/core/colorBlindness.js +106 -114
  183. package/dist/esm/core/dragDrop.js +157 -157
  184. package/dist/esm/core/editorAsk.js +53 -40
  185. package/dist/esm/core/fixes.js +145 -170
  186. package/dist/esm/core/gridGuides.js +178 -200
  187. package/dist/esm/core/historyVisual.js +158 -134
  188. package/dist/esm/core/i18n.js +15 -13
  189. package/dist/esm/core/integrations.js +244 -248
  190. package/dist/esm/core/minimap.js +151 -150
  191. package/dist/esm/core/plugins.js +102 -112
  192. package/dist/esm/core/rtl.js +77 -82
  193. package/dist/esm/core/shortcuts.js +200 -224
  194. package/dist/esm/core/theme.js +150 -148
  195. package/dist/esm/core/yjsCollaboration.js +240 -292
  196. package/dist/esm/design/design-tools.js +13 -21
  197. package/dist/esm/font/NiceFontEditor.js +880 -315
  198. package/dist/esm/font/fontFormatUtils.js +394 -447
  199. package/dist/esm/game/GameAsset2dEditor.js +1202 -391
  200. package/dist/esm/game/GameAsset2dEditor.module.css.js +146 -3
  201. package/dist/esm/game/gameAssetTypes.js +8 -15
  202. package/dist/esm/game/gameAssetUtils.js +408 -412
  203. package/dist/esm/game/useGameAssetEditor.js +821 -762
  204. package/dist/esm/index.js +332 -69
  205. package/dist/esm/nice2dev-ui-graphics.css +1 -1
  206. package/dist/esm/node_modules/lib0/array.js +15 -69
  207. package/dist/esm/node_modules/lib0/binary.js +14 -19
  208. package/dist/esm/node_modules/lib0/broadcastchannel.js +27 -85
  209. package/dist/esm/node_modules/lib0/buffer.js +20 -80
  210. package/dist/esm/node_modules/lib0/conditions.js +4 -15
  211. package/dist/esm/node_modules/lib0/decoding.js +128 -286
  212. package/dist/esm/node_modules/lib0/dom.js +20 -43
  213. package/dist/esm/node_modules/lib0/encoding.js +90 -415
  214. package/dist/esm/node_modules/lib0/environment.js +33 -91
  215. package/dist/esm/node_modules/lib0/error.js +8 -28
  216. package/dist/esm/node_modules/lib0/function.js +31 -65
  217. package/dist/esm/node_modules/lib0/iterator.js +11 -32
  218. package/dist/esm/node_modules/lib0/logging.common.js +22 -21
  219. package/dist/esm/node_modules/lib0/logging.js +44 -70
  220. package/dist/esm/node_modules/lib0/map.js +21 -85
  221. package/dist/esm/node_modules/lib0/math.js +9 -31
  222. package/dist/esm/node_modules/lib0/number.js +7 -14
  223. package/dist/esm/node_modules/lib0/object.js +26 -87
  224. package/dist/esm/node_modules/lib0/observable.js +40 -77
  225. package/dist/esm/node_modules/lib0/pair.js +5 -19
  226. package/dist/esm/node_modules/lib0/prng.js +15 -76
  227. package/dist/esm/node_modules/lib0/promise.js +7 -29
  228. package/dist/esm/node_modules/lib0/random.js +10 -22
  229. package/dist/esm/node_modules/lib0/schema.js +367 -686
  230. package/dist/esm/node_modules/lib0/set.js +4 -9
  231. package/dist/esm/node_modules/lib0/storage.js +23 -54
  232. package/dist/esm/node_modules/lib0/string.js +26 -71
  233. package/dist/esm/node_modules/lib0/symbol.js +3 -11
  234. package/dist/esm/node_modules/lib0/time.js +3 -14
  235. package/dist/esm/node_modules/lib0/trait/equality.js +5 -27
  236. package/dist/esm/node_modules/lib0/url.js +5 -17
  237. package/dist/esm/node_modules/lib0/webcrypto.js +3 -4
  238. package/dist/esm/node_modules/y-protocols/auth.js +7 -18
  239. package/dist/esm/node_modules/y-protocols/awareness.js +58 -115
  240. package/dist/esm/node_modules/y-protocols/sync.js +26 -102
  241. package/dist/esm/node_modules/y-websocket/src/y-websocket.js +82 -218
  242. package/dist/esm/node_modules/yjs/dist/yjs.js +2263 -4899
  243. package/dist/esm/photo/FilterThumb.js +37 -23
  244. package/dist/esm/photo/NiceAITools.js +685 -466
  245. package/dist/esm/photo/PhotoEditor.js +34 -18
  246. package/dist/esm/photo/PhotoEditor.module.css.js +296 -3
  247. package/dist/esm/photo/PhotoEditorCanvas.js +250 -89
  248. package/dist/esm/photo/PhotoEditorLeftPanel.js +1086 -222
  249. package/dist/esm/photo/PhotoEditorToolbar.js +135 -17
  250. package/dist/esm/photo/photoEditorActions.js +93 -71
  251. package/dist/esm/photo/photoEditorTypes.js +32 -31
  252. package/dist/esm/photo/photoFilters.js +967 -984
  253. package/dist/esm/photo/photoOverlays.js +913 -944
  254. package/dist/esm/photo/photoSelection.js +438 -498
  255. package/dist/esm/photo/usePhotoEditor.js +740 -740
  256. package/dist/esm/pixel/HSVPicker.js +192 -174
  257. package/dist/esm/pixel/PixelEditor.js +160 -47
  258. package/dist/esm/pixel/PixelEditor.module.css.js +209 -3
  259. package/dist/esm/pixel/PixelEditorCanvas.js +29 -14
  260. package/dist/esm/pixel/PixelEditorMenuBar.js +160 -160
  261. package/dist/esm/pixel/PixelEditorRightPanel.js +377 -43
  262. package/dist/esm/pixel/PixelEditorStatusBar.js +47 -18
  263. package/dist/esm/pixel/PixelEditorTimeline.js +106 -21
  264. package/dist/esm/pixel/PixelEditorToolbar.js +99 -19
  265. package/dist/esm/pixel/SpriteGeneratorPanel.js +483 -301
  266. package/dist/esm/pixel/animalGeneratorPresets.js +782 -600
  267. package/dist/esm/pixel/asepriteFormat.js +517 -559
  268. package/dist/esm/pixel/buildingGeneratorPresets.js +699 -519
  269. package/dist/esm/pixel/characterGeneratorPresets.js +650 -543
  270. package/dist/esm/pixel/pixel-pro.js +53 -62
  271. package/dist/esm/pixel/pixelEditorExports.js +397 -427
  272. package/dist/esm/pixel/pixelEditorTypes.js +103 -107
  273. package/dist/esm/pixel/pixelEditorUtils.js +551 -560
  274. package/dist/esm/pixel/spriteGeneratorCore.js +223 -256
  275. package/dist/esm/pixel/usePixelEditor.js +1322 -1342
  276. package/dist/esm/texture/Nice3DTexturePainter.js +709 -439
  277. package/dist/esm/ui/NiceUIDesigner.js +957 -526
  278. package/dist/esm/vector/NiceSvgToCode.js +589 -445
  279. package/dist/esm/vector/VectorEditor.js +291 -116
  280. package/dist/esm/vector/VectorEditor.module.css.js +86 -3
  281. package/dist/esm/vector/VectorEditorMenuBar.js +333 -273
  282. package/dist/esm/vector/VectorEditorRightPanel.js +1094 -369
  283. package/dist/esm/vector/VectorEditorShapeRenderer.js +199 -59
  284. package/dist/esm/vector/VectorEditorStatusBar.js +39 -11
  285. package/dist/esm/vector/useVectorEditor.js +849 -888
  286. package/dist/esm/vector/vectorAnimation.js +115 -136
  287. package/dist/esm/vector/vectorBooleanOps.js +401 -484
  288. package/dist/esm/vector/vectorEditorExport.js +207 -202
  289. package/dist/esm/vector/vectorEditorImport.js +174 -188
  290. package/dist/esm/vector/vectorEditorTypes.js +50 -48
  291. package/dist/esm/vector/vectorGradients.js +158 -173
  292. package/dist/esm/vector/vectorIconExport.js +53 -58
  293. package/dist/esm/vector/vectorIconImport.js +171 -218
  294. package/package.json +9 -15
@@ -1,158 +1,487 @@
1
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
- import { motion } from 'framer-motion';
3
- import { useMemo, useEffect } from 'react';
4
- import { useNiceTranslation } from '../core/i18n.js';
5
- import { usePersonControls, playPose } from './animationHelper.js';
6
- import { DEFAULT_CHARACTER, pick } from './characterTypes.js';
7
-
8
- const NiceAnimatedPerson = ({ id, name, size, score = 10, startPose = 'idle', onReady, character, config, pose, width,
9
- // height intentionally ignored — kept on the type for API symmetry.
10
- // colors prop is destructured for API completeness but not yet fully wired into character defaults.
11
- }) => {
12
- var _a, _b, _c, _d, _e;
13
- const { t } = useNiceTranslation();
14
- const fx = usePersonControls();
15
- const effectiveStartPose = pose !== null && pose !== void 0 ? pose : startPose;
16
- const effectiveCharacter = character !== null && character !== void 0 ? character : config;
17
- const effectiveSize = width !== null && width !== void 0 ? width : size;
18
- const cfg = useMemo(() => ({ ...DEFAULT_CHARACTER, ...(effectiveCharacter !== null && effectiveCharacter !== void 0 ? effectiveCharacter : {}) }), [effectiveCharacter]);
19
- useEffect(() => {
20
- onReady === null || onReady === void 0 ? void 0 : onReady(fx);
21
- void playPose(fx, effectiveStartPose, {});
22
- }, [fx, onReady, effectiveStartPose]);
23
- const W = (_c = (_b = (_a = cfg.size) !== null && _a !== void 0 ? _a : effectiveSize) !== null && _b !== void 0 ? _b : DEFAULT_CHARACTER.size) !== null && _c !== void 0 ? _c : 180;
24
- const skin = pick(cfg.face.colors, 0, 'var(--anim-skin, #FFD2B3)');
25
- return (jsx(motion.div, { id: id, style: { width: W, height: W * 1.35, overflow: 'visible' }, animate: fx.root, children: jsxs("svg", { viewBox: "0 0 180 240", width: "100%", height: "100%", role: "img", "aria-label": (_e = (_d = cfg.name) !== null && _d !== void 0 ? _d : name) !== null && _e !== void 0 ? _e : t('animatedPerson.juror', 'Juror'), children: [jsxs(motion.g, { animate: fx.body, children: [jsx("rect", { x: "68", y: "158", width: "14", height: "46", rx: "6", fill: pick(cfg.outfit.colors, 1, 'var(--anim-outfit-leg, #334155)') }), jsx("ellipse", { cx: "75", cy: "204", rx: "10", ry: "5", fill: pick(cfg.outfit.colors, 1, 'var(--anim-outfit-leg-shadow, #1E293B)') }), jsx("rect", { x: "98", y: "158", width: "14", height: "46", rx: "6", fill: pick(cfg.outfit.colors, 1, 'var(--anim-outfit-leg, #334155)') }), jsx("ellipse", { cx: "105", cy: "204", rx: "10", ry: "5", fill: pick(cfg.outfit.colors, 1, 'var(--anim-outfit-leg-shadow, #1E293B)') })] }), jsx(motion.g, { animate: fx.body, children: renderOutfit(cfg.outfit) }), jsx("rect", { x: "84", y: "82", width: "12", height: "12", rx: "4", fill: skin }), jsxs(motion.g, { animate: fx.leftArm, style: { transformOrigin: '64px 96px' }, children: [jsx("rect", { x: "36", y: "96", width: "16", height: "36", rx: "7", fill: skin }), jsx("circle", { cx: "44", cy: "136", r: "7", fill: skin })] }), jsxs(motion.g, { animate: fx.rightArm, style: { transformOrigin: '116px 96px' }, children: [jsx("rect", { x: "128", y: "96", width: "16", height: "36", rx: "7", fill: skin }), jsx("circle", { cx: "136", cy: "136", r: "7", fill: skin }), jsxs(motion.g, { animate: fx.card, children: [jsx("rect", { x: "126", y: "50", width: "42", height: "30", rx: "4", fill: "var(--nice-color-surface, #fff)", stroke: "var(--nice-text-primary, #111)", strokeWidth: 1.2 }), jsx("text", { x: "147", y: "70", textAnchor: "middle", fontSize: "16", fontWeight: 700, fill: "var(--nice-text-primary, #111)", children: String(score) })] }), renderProp(cfg.prop)] }), jsxs(motion.g, { animate: fx.head, children: [renderHairBack(cfg.hair), renderFace(cfg.face), jsx(motion.g, { animate: fx.eyes, children: renderEyes(cfg.eyes) }), renderNose(cfg.nose), jsx(motion.g, { animate: fx.mouth, children: renderMouth(cfg.mouth) }), renderHeadwear(cfg.headwear)] }), jsxs(motion.g, { animate: fx.curse, initial: { opacity: 0 }, children: [jsx("rect", { x: "62", y: "10", width: "56", height: "22", rx: "8", fill: "var(--nice-text-primary, #111)" }), jsx("text", { x: "90", y: "26", textAnchor: "middle", fontSize: "12", fill: "var(--nice-text-inverse, #fff)", children: "#!%&*" }), jsx("path", { d: "M82 32 l4 8 l4 -8", fill: "var(--nice-text-primary, #111)" })] })] }) }));
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { motion } from "framer-motion";
3
+ import { useMemo, useEffect } from "react";
4
+ import { useNiceTranslation } from "../core/i18n.js";
5
+ import { usePersonControls, playPose } from "./animationHelper.js";
6
+ import { DEFAULT_CHARACTER, pick } from "./characterTypes.js";
7
+ const NiceAnimatedPerson = ({
8
+ id,
9
+ name,
10
+ size,
11
+ score = 10,
12
+ startPose = "idle",
13
+ onReady,
14
+ character,
15
+ config,
16
+ pose,
17
+ width
18
+ // height intentionally ignored — kept on the type for API symmetry.
19
+ // colors prop is destructured for API completeness but not yet fully wired into character defaults.
20
+ }) => {
21
+ const { t } = useNiceTranslation();
22
+ const fx = usePersonControls();
23
+ const effectiveStartPose = pose ?? startPose;
24
+ const effectiveCharacter = character ?? config;
25
+ const effectiveSize = width ?? size;
26
+ const cfg = useMemo(
27
+ () => ({ ...DEFAULT_CHARACTER, ...effectiveCharacter ?? {} }),
28
+ [effectiveCharacter]
29
+ );
30
+ useEffect(() => {
31
+ onReady?.(fx);
32
+ void playPose(fx, effectiveStartPose, {});
33
+ }, [fx, onReady, effectiveStartPose]);
34
+ const W = cfg.size ?? effectiveSize ?? DEFAULT_CHARACTER.size ?? 180;
35
+ const skin = pick(cfg.face.colors, 0, "var(--anim-skin, #FFD2B3)");
36
+ return /* @__PURE__ */ jsx(
37
+ motion.div,
38
+ {
39
+ id,
40
+ style: { width: W, height: W * 1.35, overflow: "visible" },
41
+ animate: fx.root,
42
+ children: /* @__PURE__ */ jsxs(
43
+ "svg",
44
+ {
45
+ viewBox: "0 0 180 240",
46
+ width: "100%",
47
+ height: "100%",
48
+ role: "img",
49
+ "aria-label": cfg.name ?? name ?? t("animatedPerson.juror", "Juror"),
50
+ children: [
51
+ /* @__PURE__ */ jsxs(motion.g, { animate: fx.body, children: [
52
+ /* @__PURE__ */ jsx(
53
+ "rect",
54
+ {
55
+ x: "68",
56
+ y: "158",
57
+ width: "14",
58
+ height: "46",
59
+ rx: "6",
60
+ fill: pick(cfg.outfit.colors, 1, "var(--anim-outfit-leg, #334155)")
61
+ }
62
+ ),
63
+ /* @__PURE__ */ jsx(
64
+ "ellipse",
65
+ {
66
+ cx: "75",
67
+ cy: "204",
68
+ rx: "10",
69
+ ry: "5",
70
+ fill: pick(cfg.outfit.colors, 1, "var(--anim-outfit-leg-shadow, #1E293B)")
71
+ }
72
+ ),
73
+ /* @__PURE__ */ jsx(
74
+ "rect",
75
+ {
76
+ x: "98",
77
+ y: "158",
78
+ width: "14",
79
+ height: "46",
80
+ rx: "6",
81
+ fill: pick(cfg.outfit.colors, 1, "var(--anim-outfit-leg, #334155)")
82
+ }
83
+ ),
84
+ /* @__PURE__ */ jsx(
85
+ "ellipse",
86
+ {
87
+ cx: "105",
88
+ cy: "204",
89
+ rx: "10",
90
+ ry: "5",
91
+ fill: pick(cfg.outfit.colors, 1, "var(--anim-outfit-leg-shadow, #1E293B)")
92
+ }
93
+ )
94
+ ] }),
95
+ /* @__PURE__ */ jsx(motion.g, { animate: fx.body, children: renderOutfit(cfg.outfit) }),
96
+ /* @__PURE__ */ jsx("rect", { x: "84", y: "82", width: "12", height: "12", rx: "4", fill: skin }),
97
+ /* @__PURE__ */ jsxs(motion.g, { animate: fx.leftArm, style: { transformOrigin: "64px 96px" }, children: [
98
+ /* @__PURE__ */ jsx("rect", { x: "36", y: "96", width: "16", height: "36", rx: "7", fill: skin }),
99
+ /* @__PURE__ */ jsx("circle", { cx: "44", cy: "136", r: "7", fill: skin })
100
+ ] }),
101
+ /* @__PURE__ */ jsxs(motion.g, { animate: fx.rightArm, style: { transformOrigin: "116px 96px" }, children: [
102
+ /* @__PURE__ */ jsx("rect", { x: "128", y: "96", width: "16", height: "36", rx: "7", fill: skin }),
103
+ /* @__PURE__ */ jsx("circle", { cx: "136", cy: "136", r: "7", fill: skin }),
104
+ /* @__PURE__ */ jsxs(motion.g, { animate: fx.card, children: [
105
+ /* @__PURE__ */ jsx(
106
+ "rect",
107
+ {
108
+ x: "126",
109
+ y: "50",
110
+ width: "42",
111
+ height: "30",
112
+ rx: "4",
113
+ fill: "var(--nice-color-surface, #fff)",
114
+ stroke: "var(--nice-text-primary, #111)",
115
+ strokeWidth: 1.2
116
+ }
117
+ ),
118
+ /* @__PURE__ */ jsx(
119
+ "text",
120
+ {
121
+ x: "147",
122
+ y: "70",
123
+ textAnchor: "middle",
124
+ fontSize: "16",
125
+ fontWeight: 700,
126
+ fill: "var(--nice-text-primary, #111)",
127
+ children: String(score)
128
+ }
129
+ )
130
+ ] }),
131
+ renderProp(cfg.prop)
132
+ ] }),
133
+ /* @__PURE__ */ jsxs(motion.g, { animate: fx.head, children: [
134
+ renderHairBack(cfg.hair),
135
+ renderFace(cfg.face),
136
+ /* @__PURE__ */ jsx(motion.g, { animate: fx.eyes, children: renderEyes(cfg.eyes) }),
137
+ renderNose(cfg.nose),
138
+ /* @__PURE__ */ jsx(motion.g, { animate: fx.mouth, children: renderMouth(cfg.mouth) }),
139
+ renderHeadwear(cfg.headwear)
140
+ ] }),
141
+ /* @__PURE__ */ jsxs(motion.g, { animate: fx.curse, initial: { opacity: 0 }, children: [
142
+ /* @__PURE__ */ jsx("rect", { x: "62", y: "10", width: "56", height: "22", rx: "8", fill: "var(--nice-text-primary, #111)" }),
143
+ /* @__PURE__ */ jsx(
144
+ "text",
145
+ {
146
+ x: "90",
147
+ y: "26",
148
+ textAnchor: "middle",
149
+ fontSize: "12",
150
+ fill: "var(--nice-text-inverse, #fff)",
151
+ children: "#!%&*"
152
+ }
153
+ ),
154
+ /* @__PURE__ */ jsx("path", { d: "M82 32 l4 8 l4 -8", fill: "var(--nice-text-primary, #111)" })
155
+ ] })
156
+ ]
157
+ }
158
+ )
159
+ }
160
+ );
26
161
  };
27
- /* ---------------- RENDERERS (redesigned proportions) ---------------- */
28
162
  function renderOutfit(cfg) {
29
- const base = pick(cfg.colors, 0, 'var(--anim-shirt, #3B82F6)');
30
- const accent = pick(cfg.colors, 1, base);
31
- const stroke = pick(cfg.colors, 2, 'var(--anim-stroke, #111)');
32
- switch (cfg.variant) {
33
- case 'hoodie':
34
- return (jsxs("g", { children: [jsx("rect", { x: "52", y: "92", width: "76", height: "66", rx: "16", fill: base, stroke: stroke, strokeWidth: 1 }), jsx("path", { d: "M52 102 Q90 72 128 102", fill: accent, opacity: 0.2 }), jsx("ellipse", { cx: "90", cy: "94", rx: "18", ry: "6", fill: accent, opacity: 0.3 })] }));
35
- case 'suit':
36
- return (jsxs("g", { children: [jsx("rect", { x: "52", y: "92", width: "76", height: "66", rx: "12", fill: base, stroke: stroke, strokeWidth: 1 }), jsx("path", { d: "M90 92 L72 118 L90 110 L108 118 Z", fill: accent, opacity: 0.75 }), jsx("rect", { x: "88", y: "110", width: "4", height: "48", fill: '#fff', opacity: 0.8 }), jsx("circle", { cx: "90", cy: "120", r: "2", fill: stroke }), jsx("circle", { cx: "90", cy: "134", r: "2", fill: stroke })] }));
37
- case 'dress':
38
- return (jsxs("g", { children: [jsx("rect", { x: "52", y: "92", width: "76", height: "56", rx: "14", fill: base, stroke: stroke, strokeWidth: 1 }), jsx("path", { d: "M52 148 L128 148 L136 168 L44 168 Z", fill: accent })] }));
39
- case 'tee':
40
- default:
41
- return (jsxs("g", { children: [jsx("rect", { x: "52", y: "92", width: "76", height: "66", rx: "14", fill: base, stroke: stroke, strokeWidth: 1 }), jsx("path", { d: "M82 92 L90 100 L98 92", fill: "none", stroke: stroke, strokeWidth: 1, opacity: 0.4 })] }));
42
- }
163
+ const base = pick(cfg.colors, 0, "var(--anim-shirt, #3B82F6)");
164
+ const accent = pick(cfg.colors, 1, base);
165
+ const stroke = pick(cfg.colors, 2, "var(--anim-stroke, #111)");
166
+ switch (cfg.variant) {
167
+ case "hoodie":
168
+ return /* @__PURE__ */ jsxs("g", { children: [
169
+ /* @__PURE__ */ jsx(
170
+ "rect",
171
+ {
172
+ x: "52",
173
+ y: "92",
174
+ width: "76",
175
+ height: "66",
176
+ rx: "16",
177
+ fill: base,
178
+ stroke,
179
+ strokeWidth: 1
180
+ }
181
+ ),
182
+ /* @__PURE__ */ jsx("path", { d: "M52 102 Q90 72 128 102", fill: accent, opacity: 0.2 }),
183
+ /* @__PURE__ */ jsx("ellipse", { cx: "90", cy: "94", rx: "18", ry: "6", fill: accent, opacity: 0.3 })
184
+ ] });
185
+ case "suit":
186
+ return /* @__PURE__ */ jsxs("g", { children: [
187
+ /* @__PURE__ */ jsx(
188
+ "rect",
189
+ {
190
+ x: "52",
191
+ y: "92",
192
+ width: "76",
193
+ height: "66",
194
+ rx: "12",
195
+ fill: base,
196
+ stroke,
197
+ strokeWidth: 1
198
+ }
199
+ ),
200
+ /* @__PURE__ */ jsx("path", { d: "M90 92 L72 118 L90 110 L108 118 Z", fill: accent, opacity: 0.75 }),
201
+ /* @__PURE__ */ jsx("rect", { x: "88", y: "110", width: "4", height: "48", fill: "#fff", opacity: 0.8 }),
202
+ /* @__PURE__ */ jsx("circle", { cx: "90", cy: "120", r: "2", fill: stroke }),
203
+ /* @__PURE__ */ jsx("circle", { cx: "90", cy: "134", r: "2", fill: stroke })
204
+ ] });
205
+ case "dress":
206
+ return /* @__PURE__ */ jsxs("g", { children: [
207
+ /* @__PURE__ */ jsx(
208
+ "rect",
209
+ {
210
+ x: "52",
211
+ y: "92",
212
+ width: "76",
213
+ height: "56",
214
+ rx: "14",
215
+ fill: base,
216
+ stroke,
217
+ strokeWidth: 1
218
+ }
219
+ ),
220
+ /* @__PURE__ */ jsx("path", { d: "M52 148 L128 148 L136 168 L44 168 Z", fill: accent })
221
+ ] });
222
+ case "tee":
223
+ default:
224
+ return /* @__PURE__ */ jsxs("g", { children: [
225
+ /* @__PURE__ */ jsx(
226
+ "rect",
227
+ {
228
+ x: "52",
229
+ y: "92",
230
+ width: "76",
231
+ height: "66",
232
+ rx: "14",
233
+ fill: base,
234
+ stroke,
235
+ strokeWidth: 1
236
+ }
237
+ ),
238
+ /* @__PURE__ */ jsx(
239
+ "path",
240
+ {
241
+ d: "M82 92 L90 100 L98 92",
242
+ fill: "none",
243
+ stroke,
244
+ strokeWidth: 1,
245
+ opacity: 0.4
246
+ }
247
+ )
248
+ ] });
249
+ }
43
250
  }
44
251
  function renderHairBack(cfg) {
45
- const base = pick(cfg.colors, 0, 'var(--anim-hair, #1F2937)');
46
- const hi = pick(cfg.colors, 1, base);
47
- switch (cfg.variant) {
48
- case 'long':
49
- return (jsxs("g", { children: [jsx("path", { d: "M60 46 Q90 22 120 46 L120 76 Q90 92 60 76 Z", fill: base }), jsx("path", { d: "M90 46 Q92 56 102 62", stroke: hi, strokeWidth: 2.5, opacity: 0.35 })] }));
50
- case 'curly':
51
- return (jsxs("g", { children: [jsx("path", { d: "M66 40 q10 -14 22 0 q10 -14 22 0 l0 12 q-32 12 -64 0 Z", fill: base }), jsx("circle", { cx: "66", cy: "44", r: "5", fill: base }), jsx("circle", { cx: "114", cy: "44", r: "5", fill: base })] }));
52
- case 'mohawk':
53
- return jsx("path", { d: "M82 28 L98 28 L100 50 L80 50 Z", fill: base });
54
- case 'short':
55
- return jsx("path", { d: "M68 47 C78 24, 102 24, 112 47 L68 47 Z", fill: base });
56
- case 'none':
57
- default:
58
- return null;
59
- }
252
+ const base = pick(cfg.colors, 0, "var(--anim-hair, #1F2937)");
253
+ const hi = pick(cfg.colors, 1, base);
254
+ switch (cfg.variant) {
255
+ case "long":
256
+ return /* @__PURE__ */ jsxs("g", { children: [
257
+ /* @__PURE__ */ jsx("path", { d: "M60 46 Q90 22 120 46 L120 76 Q90 92 60 76 Z", fill: base }),
258
+ /* @__PURE__ */ jsx("path", { d: "M90 46 Q92 56 102 62", stroke: hi, strokeWidth: 2.5, opacity: 0.35 })
259
+ ] });
260
+ case "curly":
261
+ return /* @__PURE__ */ jsxs("g", { children: [
262
+ /* @__PURE__ */ jsx("path", { d: "M66 40 q10 -14 22 0 q10 -14 22 0 l0 12 q-32 12 -64 0 Z", fill: base }),
263
+ /* @__PURE__ */ jsx("circle", { cx: "66", cy: "44", r: "5", fill: base }),
264
+ /* @__PURE__ */ jsx("circle", { cx: "114", cy: "44", r: "5", fill: base })
265
+ ] });
266
+ case "mohawk":
267
+ return /* @__PURE__ */ jsx("path", { d: "M82 28 L98 28 L100 50 L80 50 Z", fill: base });
268
+ case "short":
269
+ return /* @__PURE__ */ jsx("path", { d: "M68 47 C78 24, 102 24, 112 47 L68 47 Z", fill: base });
270
+ case "none":
271
+ default:
272
+ return null;
273
+ }
60
274
  }
61
275
  function renderFace(cfg) {
62
- const skin = pick(cfg.colors, 0, 'var(--anim-skin, #FFD2B3)');
63
- const shadow = pick(cfg.colors, 1, skin);
64
- const stroke = pick(cfg.colors, 2, 'var(--anim-stroke, #111)');
65
- switch (cfg.variant) {
66
- case 'oval':
67
- return (jsxs("g", { children: [jsx("ellipse", { cx: "90", cy: "60", rx: "26", ry: "28", fill: skin, stroke: stroke, strokeWidth: 1 }), jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })] }));
68
- case 'square':
69
- return (jsxs("g", { children: [jsx("rect", { x: "64", y: "36", width: "52", height: "48", rx: "12", fill: skin, stroke: stroke, strokeWidth: 1 }), jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })] }));
70
- case 'heart':
71
- return (jsxs("g", { children: [jsx("path", { d: "M90 36 q-18 10 -18 26 q0 16 18 26 q18 -10 18 -26 q0 -16 -18 -26 Z", fill: skin, stroke: stroke, strokeWidth: 1 }), jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })] }));
72
- case 'round':
73
- default:
74
- return (jsxs("g", { children: [jsx("circle", { cx: "90", cy: "60", r: "26", fill: skin, stroke: stroke, strokeWidth: 1 }), jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })] }));
75
- }
276
+ const skin = pick(cfg.colors, 0, "var(--anim-skin, #FFD2B3)");
277
+ const shadow = pick(cfg.colors, 1, skin);
278
+ const stroke = pick(cfg.colors, 2, "var(--anim-stroke, #111)");
279
+ switch (cfg.variant) {
280
+ case "oval":
281
+ return /* @__PURE__ */ jsxs("g", { children: [
282
+ /* @__PURE__ */ jsx("ellipse", { cx: "90", cy: "60", rx: "26", ry: "28", fill: skin, stroke, strokeWidth: 1 }),
283
+ /* @__PURE__ */ jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })
284
+ ] });
285
+ case "square":
286
+ return /* @__PURE__ */ jsxs("g", { children: [
287
+ /* @__PURE__ */ jsx(
288
+ "rect",
289
+ {
290
+ x: "64",
291
+ y: "36",
292
+ width: "52",
293
+ height: "48",
294
+ rx: "12",
295
+ fill: skin,
296
+ stroke,
297
+ strokeWidth: 1
298
+ }
299
+ ),
300
+ /* @__PURE__ */ jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })
301
+ ] });
302
+ case "heart":
303
+ return /* @__PURE__ */ jsxs("g", { children: [
304
+ /* @__PURE__ */ jsx(
305
+ "path",
306
+ {
307
+ d: "M90 36 q-18 10 -18 26 q0 16 18 26 q18 -10 18 -26 q0 -16 -18 -26 Z",
308
+ fill: skin,
309
+ stroke,
310
+ strokeWidth: 1
311
+ }
312
+ ),
313
+ /* @__PURE__ */ jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })
314
+ ] });
315
+ case "round":
316
+ default:
317
+ return /* @__PURE__ */ jsxs("g", { children: [
318
+ /* @__PURE__ */ jsx("circle", { cx: "90", cy: "60", r: "26", fill: skin, stroke, strokeWidth: 1 }),
319
+ /* @__PURE__ */ jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })
320
+ ] });
321
+ }
76
322
  }
77
323
  function renderEyes(cfg) {
78
- const base = pick(cfg.colors, 0, 'var(--anim-eye-base, #111)');
79
- switch (cfg.variant) {
80
- case 'oval':
81
- return (jsxs(Fragment, { children: [jsx("ellipse", { cx: "80", cy: "56", rx: "4.5", ry: "3.5", fill: base }), jsx("ellipse", { cx: "100", cy: "56", rx: "4.5", ry: "3.5", fill: base }), jsx("circle", { cx: "81.5", cy: "55", r: "1.2", fill: '#fff', opacity: 0.7 }), jsx("circle", { cx: "101.5", cy: "55", r: "1.2", fill: '#fff', opacity: 0.7 })] }));
82
- case 'laugh':
83
- return (jsxs(Fragment, { children: [jsx("path", { d: "M76 56 q4 -4 8 0", stroke: base, strokeWidth: 2.5, fill: "none", strokeLinecap: "round" }), jsx("path", { d: "M96 56 q4 -4 8 0", stroke: base, strokeWidth: 2.5, fill: "none", strokeLinecap: "round" })] }));
84
- case 'wink':
85
- return (jsxs(Fragment, { children: [jsx("circle", { cx: "80", cy: "56", r: "3.5", fill: base }), jsx("circle", { cx: "81.5", cy: "55", r: "1", fill: '#fff', opacity: 0.7 }), jsx("path", { d: "M96 56 l8 0", stroke: base, strokeWidth: 2.5, strokeLinecap: "round" })] }));
86
- case 'sleepy':
87
- return (jsxs(Fragment, { children: [jsx("path", { d: "M76 56 l8 0", stroke: base, strokeWidth: 2.5, strokeLinecap: "round" }), jsx("path", { d: "M96 56 l8 0", stroke: base, strokeWidth: 2.5, strokeLinecap: "round" })] }));
88
- case 'dot':
89
- default:
90
- return (jsxs(Fragment, { children: [jsx("circle", { cx: "80", cy: "56", r: "3.5", fill: base }), jsx("circle", { cx: "100", cy: "56", r: "3.5", fill: base }), jsx("circle", { cx: "81.5", cy: "55", r: "1", fill: '#fff', opacity: 0.7 }), jsx("circle", { cx: "101.5", cy: "55", r: "1", fill: '#fff', opacity: 0.7 })] }));
91
- }
324
+ const base = pick(cfg.colors, 0, "var(--anim-eye-base, #111)");
325
+ switch (cfg.variant) {
326
+ case "oval":
327
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
328
+ /* @__PURE__ */ jsx("ellipse", { cx: "80", cy: "56", rx: "4.5", ry: "3.5", fill: base }),
329
+ /* @__PURE__ */ jsx("ellipse", { cx: "100", cy: "56", rx: "4.5", ry: "3.5", fill: base }),
330
+ /* @__PURE__ */ jsx("circle", { cx: "81.5", cy: "55", r: "1.2", fill: "#fff", opacity: 0.7 }),
331
+ /* @__PURE__ */ jsx("circle", { cx: "101.5", cy: "55", r: "1.2", fill: "#fff", opacity: 0.7 })
332
+ ] });
333
+ case "laugh":
334
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
335
+ /* @__PURE__ */ jsx(
336
+ "path",
337
+ {
338
+ d: "M76 56 q4 -4 8 0",
339
+ stroke: base,
340
+ strokeWidth: 2.5,
341
+ fill: "none",
342
+ strokeLinecap: "round"
343
+ }
344
+ ),
345
+ /* @__PURE__ */ jsx(
346
+ "path",
347
+ {
348
+ d: "M96 56 q4 -4 8 0",
349
+ stroke: base,
350
+ strokeWidth: 2.5,
351
+ fill: "none",
352
+ strokeLinecap: "round"
353
+ }
354
+ )
355
+ ] });
356
+ case "wink":
357
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
358
+ /* @__PURE__ */ jsx("circle", { cx: "80", cy: "56", r: "3.5", fill: base }),
359
+ /* @__PURE__ */ jsx("circle", { cx: "81.5", cy: "55", r: "1", fill: "#fff", opacity: 0.7 }),
360
+ /* @__PURE__ */ jsx("path", { d: "M96 56 l8 0", stroke: base, strokeWidth: 2.5, strokeLinecap: "round" })
361
+ ] });
362
+ case "sleepy":
363
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
364
+ /* @__PURE__ */ jsx("path", { d: "M76 56 l8 0", stroke: base, strokeWidth: 2.5, strokeLinecap: "round" }),
365
+ /* @__PURE__ */ jsx("path", { d: "M96 56 l8 0", stroke: base, strokeWidth: 2.5, strokeLinecap: "round" })
366
+ ] });
367
+ case "dot":
368
+ default:
369
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
370
+ /* @__PURE__ */ jsx("circle", { cx: "80", cy: "56", r: "3.5", fill: base }),
371
+ /* @__PURE__ */ jsx("circle", { cx: "100", cy: "56", r: "3.5", fill: base }),
372
+ /* @__PURE__ */ jsx("circle", { cx: "81.5", cy: "55", r: "1", fill: "#fff", opacity: 0.7 }),
373
+ /* @__PURE__ */ jsx("circle", { cx: "101.5", cy: "55", r: "1", fill: "#fff", opacity: 0.7 })
374
+ ] });
375
+ }
92
376
  }
93
377
  function renderNose(cfg) {
94
- const base = pick(cfg.colors, 0, 'var(--anim-nose, #111)');
95
- switch (cfg.variant) {
96
- case 'triangle':
97
- return jsx("path", { d: "M90 62 l-4 8 h8 Z", fill: base, opacity: 0.6 });
98
- case 'round':
99
- return jsx("circle", { cx: "90", cy: "66", r: "3", fill: base, opacity: 0.6 });
100
- case 'line':
101
- default:
102
- return jsx("rect", { x: "89", y: "62", width: "2", height: "8", fill: base, rx: "1", opacity: 0.5 });
103
- }
378
+ const base = pick(cfg.colors, 0, "var(--anim-nose, #111)");
379
+ switch (cfg.variant) {
380
+ case "triangle":
381
+ return /* @__PURE__ */ jsx("path", { d: "M90 62 l-4 8 h8 Z", fill: base, opacity: 0.6 });
382
+ case "round":
383
+ return /* @__PURE__ */ jsx("circle", { cx: "90", cy: "66", r: "3", fill: base, opacity: 0.6 });
384
+ case "line":
385
+ default:
386
+ return /* @__PURE__ */ jsx("rect", { x: "89", y: "62", width: "2", height: "8", fill: base, rx: "1", opacity: 0.5 });
387
+ }
104
388
  }
105
389
  function renderMouth(cfg) {
106
- const base = pick(cfg.colors, 0, 'var(--anim-mouth-base, #111)');
107
- const tooth = pick(cfg.colors, 1, 'var(--white, #fff)');
108
- switch (cfg.variant) {
109
- case 'frown':
110
- return (jsx("path", { d: "M80 76 q10 -6 20 0", stroke: base, strokeWidth: 2.5, fill: "none", strokeLinecap: "round" }));
111
- case 'open':
112
- return jsx("ellipse", { cx: "90", cy: "76", rx: "7", ry: "5", fill: base });
113
- case 'flat':
114
- return jsx("rect", { x: "82", y: "75", width: "16", height: "2.5", rx: "1.25", fill: base });
115
- case 'o':
116
- return jsx("circle", { cx: "90", cy: "76", r: "4", fill: base });
117
- case 'teeth':
118
- return (jsxs("g", { children: [jsx("rect", { x: "82", y: "74", width: "16", height: "7", rx: "3", fill: base }), jsx("rect", { x: "84", y: "75", width: "12", height: "3", rx: "1", fill: tooth })] }));
119
- case 'smile':
120
- default:
121
- return (jsx("path", { d: "M80 76 q10 8 20 0", stroke: base, strokeWidth: 2.5, fill: "none", strokeLinecap: "round" }));
122
- }
390
+ const base = pick(cfg.colors, 0, "var(--anim-mouth-base, #111)");
391
+ const tooth = pick(cfg.colors, 1, "var(--white, #fff)");
392
+ switch (cfg.variant) {
393
+ case "frown":
394
+ return /* @__PURE__ */ jsx(
395
+ "path",
396
+ {
397
+ d: "M80 76 q10 -6 20 0",
398
+ stroke: base,
399
+ strokeWidth: 2.5,
400
+ fill: "none",
401
+ strokeLinecap: "round"
402
+ }
403
+ );
404
+ case "open":
405
+ return /* @__PURE__ */ jsx("ellipse", { cx: "90", cy: "76", rx: "7", ry: "5", fill: base });
406
+ case "flat":
407
+ return /* @__PURE__ */ jsx("rect", { x: "82", y: "75", width: "16", height: "2.5", rx: "1.25", fill: base });
408
+ case "o":
409
+ return /* @__PURE__ */ jsx("circle", { cx: "90", cy: "76", r: "4", fill: base });
410
+ case "teeth":
411
+ return /* @__PURE__ */ jsxs("g", { children: [
412
+ /* @__PURE__ */ jsx("rect", { x: "82", y: "74", width: "16", height: "7", rx: "3", fill: base }),
413
+ /* @__PURE__ */ jsx("rect", { x: "84", y: "75", width: "12", height: "3", rx: "1", fill: tooth })
414
+ ] });
415
+ case "smile":
416
+ default:
417
+ return /* @__PURE__ */ jsx(
418
+ "path",
419
+ {
420
+ d: "M80 76 q10 8 20 0",
421
+ stroke: base,
422
+ strokeWidth: 2.5,
423
+ fill: "none",
424
+ strokeLinecap: "round"
425
+ }
426
+ );
427
+ }
123
428
  }
124
429
  function renderHeadwear(cfg) {
125
- const base = pick(cfg.colors, 0, 'var(--anim-headwear-base, #111)');
126
- const accent = pick(cfg.colors, 1, base);
127
- switch (cfg.variant) {
128
- case 'cap':
129
- return (jsxs("g", { children: [jsx("path", { d: "M68 44 q22 -18 44 0 l-6 4 q-18 -10 -28 0 Z", fill: base }), jsx("rect", { x: "60", y: "44", width: "52", height: "5", rx: "2", fill: base })] }));
130
- case 'headphones':
131
- return (jsxs("g", { children: [jsx("path", { d: "M66 56 q0 -24 24 -24 q24 0 24 24", stroke: base, strokeWidth: 5, fill: "none" }), jsx("rect", { x: "58", y: "52", width: "12", height: "16", rx: "4", fill: accent }), jsx("rect", { x: "110", y: "52", width: "12", height: "16", rx: "4", fill: accent })] }));
132
- case 'hat':
133
- return (jsxs("g", { children: [jsx("rect", { x: "62", y: "38", width: "56", height: "8", rx: "3", fill: base }), jsx("rect", { x: "72", y: "30", width: "36", height: "10", rx: "3", fill: base })] }));
134
- case 'crown':
135
- return jsx("path", { d: "M72 42 l6 12 l6 -10 l6 10 l6 -10 l6 12 v6 h-30 Z", fill: base });
136
- case 'none':
137
- default:
138
- return null;
139
- }
430
+ const base = pick(cfg.colors, 0, "var(--anim-headwear-base, #111)");
431
+ const accent = pick(cfg.colors, 1, base);
432
+ switch (cfg.variant) {
433
+ case "cap":
434
+ return /* @__PURE__ */ jsxs("g", { children: [
435
+ /* @__PURE__ */ jsx("path", { d: "M68 44 q22 -18 44 0 l-6 4 q-18 -10 -28 0 Z", fill: base }),
436
+ /* @__PURE__ */ jsx("rect", { x: "60", y: "44", width: "52", height: "5", rx: "2", fill: base })
437
+ ] });
438
+ case "headphones":
439
+ return /* @__PURE__ */ jsxs("g", { children: [
440
+ /* @__PURE__ */ jsx("path", { d: "M66 56 q0 -24 24 -24 q24 0 24 24", stroke: base, strokeWidth: 5, fill: "none" }),
441
+ /* @__PURE__ */ jsx("rect", { x: "58", y: "52", width: "12", height: "16", rx: "4", fill: accent }),
442
+ /* @__PURE__ */ jsx("rect", { x: "110", y: "52", width: "12", height: "16", rx: "4", fill: accent })
443
+ ] });
444
+ case "hat":
445
+ return /* @__PURE__ */ jsxs("g", { children: [
446
+ /* @__PURE__ */ jsx("rect", { x: "62", y: "38", width: "56", height: "8", rx: "3", fill: base }),
447
+ /* @__PURE__ */ jsx("rect", { x: "72", y: "30", width: "36", height: "10", rx: "3", fill: base })
448
+ ] });
449
+ case "crown":
450
+ return /* @__PURE__ */ jsx("path", { d: "M72 42 l6 12 l6 -10 l6 10 l6 -10 l6 12 v6 h-30 Z", fill: base });
451
+ case "none":
452
+ default:
453
+ return null;
454
+ }
140
455
  }
141
456
  function renderProp(cfg) {
142
- const base = pick(cfg.colors, 0, 'var(--anim-prop-base, #111)');
143
- const accent = pick(cfg.colors, 1, 'var(--anim-prop-accent, #666)');
144
- const light = pick(cfg.colors, 2, 'var(--anim-prop-light, #CCC)');
145
- switch (cfg.variant) {
146
- case 'mic':
147
- return (jsxs("g", { transform: "translate(140,90)", children: [jsx("rect", { x: "0", y: "0", width: "4", height: "16", rx: "2", fill: accent }), jsx("circle", { cx: "2", cy: "-2", r: "6", fill: base, stroke: light, strokeWidth: 1 })] }));
148
- case 'clipboard':
149
- return (jsxs("g", { transform: "translate(140,86)", children: [jsx("rect", { x: "-6", y: "-2", width: "20", height: "26", rx: "3", fill: light, stroke: base }), jsx("rect", { x: "0", y: "-6", width: "8", height: "6", rx: "2", fill: base })] }));
150
- case 'star':
151
- return (jsx("g", { transform: "translate(140,86)", children: jsx("path", { d: "M8 0 L10 6 L16 6 L11 10 L13 16 L8 12 L3 16 L5 10 L0 6 L6 6 Z", fill: accent, stroke: base }) }));
152
- case 'none':
153
- default:
154
- return null;
155
- }
457
+ const base = pick(cfg.colors, 0, "var(--anim-prop-base, #111)");
458
+ const accent = pick(cfg.colors, 1, "var(--anim-prop-accent, #666)");
459
+ const light = pick(cfg.colors, 2, "var(--anim-prop-light, #CCC)");
460
+ switch (cfg.variant) {
461
+ case "mic":
462
+ return /* @__PURE__ */ jsxs("g", { transform: "translate(140,90)", children: [
463
+ /* @__PURE__ */ jsx("rect", { x: "0", y: "0", width: "4", height: "16", rx: "2", fill: accent }),
464
+ /* @__PURE__ */ jsx("circle", { cx: "2", cy: "-2", r: "6", fill: base, stroke: light, strokeWidth: 1 })
465
+ ] });
466
+ case "clipboard":
467
+ return /* @__PURE__ */ jsxs("g", { transform: "translate(140,86)", children: [
468
+ /* @__PURE__ */ jsx("rect", { x: "-6", y: "-2", width: "20", height: "26", rx: "3", fill: light, stroke: base }),
469
+ /* @__PURE__ */ jsx("rect", { x: "0", y: "-6", width: "8", height: "6", rx: "2", fill: base })
470
+ ] });
471
+ case "star":
472
+ return /* @__PURE__ */ jsx("g", { transform: "translate(140,86)", children: /* @__PURE__ */ jsx(
473
+ "path",
474
+ {
475
+ d: "M8 0 L10 6 L16 6 L11 10 L13 16 L8 12 L3 16 L5 10 L0 6 L6 6 Z",
476
+ fill: accent,
477
+ stroke: base
478
+ }
479
+ ) });
480
+ case "none":
481
+ default:
482
+ return null;
483
+ }
156
484
  }
157
-
158
- export { NiceAnimatedPerson as default };
485
+ export {
486
+ NiceAnimatedPerson as default
487
+ };