@nice2dev/ui-graphics 1.3.14 → 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 +13 -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,160 +1,487 @@
1
- 'use strict';
2
-
3
- var jsxRuntime = require('react/jsx-runtime');
4
- var framerMotion = require('framer-motion');
5
- var React = require('react');
6
- var i18n = require('../core/i18n.js');
7
- var animationHelper = require('./animationHelper.js');
8
- var characterTypes = require('./characterTypes.js');
9
-
10
- const NiceAnimatedPerson = ({ id, name, size, score = 10, startPose = 'idle', onReady, character, config, pose, width,
11
- // height intentionally ignored — kept on the type for API symmetry.
12
- // colors prop is destructured for API completeness but not yet fully wired into character defaults.
13
- }) => {
14
- var _a, _b, _c, _d, _e;
15
- const { t } = i18n.useNiceTranslation();
16
- const fx = animationHelper.usePersonControls();
17
- const effectiveStartPose = pose !== null && pose !== void 0 ? pose : startPose;
18
- const effectiveCharacter = character !== null && character !== void 0 ? character : config;
19
- const effectiveSize = width !== null && width !== void 0 ? width : size;
20
- const cfg = React.useMemo(() => ({ ...characterTypes.DEFAULT_CHARACTER, ...(effectiveCharacter !== null && effectiveCharacter !== void 0 ? effectiveCharacter : {}) }), [effectiveCharacter]);
21
- React.useEffect(() => {
22
- onReady === null || onReady === void 0 ? void 0 : onReady(fx);
23
- void animationHelper.playPose(fx, effectiveStartPose, {});
24
- }, [fx, onReady, effectiveStartPose]);
25
- const W = (_c = (_b = (_a = cfg.size) !== null && _a !== void 0 ? _a : effectiveSize) !== null && _b !== void 0 ? _b : characterTypes.DEFAULT_CHARACTER.size) !== null && _c !== void 0 ? _c : 180;
26
- const skin = characterTypes.pick(cfg.face.colors, 0, 'var(--anim-skin, #FFD2B3)');
27
- return (jsxRuntime.jsx(framerMotion.motion.div, { id: id, style: { width: W, height: W * 1.35, overflow: 'visible' }, animate: fx.root, children: jsxRuntime.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: [jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.body, children: [jsxRuntime.jsx("rect", { x: "68", y: "158", width: "14", height: "46", rx: "6", fill: characterTypes.pick(cfg.outfit.colors, 1, 'var(--anim-outfit-leg, #334155)') }), jsxRuntime.jsx("ellipse", { cx: "75", cy: "204", rx: "10", ry: "5", fill: characterTypes.pick(cfg.outfit.colors, 1, 'var(--anim-outfit-leg-shadow, #1E293B)') }), jsxRuntime.jsx("rect", { x: "98", y: "158", width: "14", height: "46", rx: "6", fill: characterTypes.pick(cfg.outfit.colors, 1, 'var(--anim-outfit-leg, #334155)') }), jsxRuntime.jsx("ellipse", { cx: "105", cy: "204", rx: "10", ry: "5", fill: characterTypes.pick(cfg.outfit.colors, 1, 'var(--anim-outfit-leg-shadow, #1E293B)') })] }), jsxRuntime.jsx(framerMotion.motion.g, { animate: fx.body, children: renderOutfit(cfg.outfit) }), jsxRuntime.jsx("rect", { x: "84", y: "82", width: "12", height: "12", rx: "4", fill: skin }), jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.leftArm, style: { transformOrigin: '64px 96px' }, children: [jsxRuntime.jsx("rect", { x: "36", y: "96", width: "16", height: "36", rx: "7", fill: skin }), jsxRuntime.jsx("circle", { cx: "44", cy: "136", r: "7", fill: skin })] }), jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.rightArm, style: { transformOrigin: '116px 96px' }, children: [jsxRuntime.jsx("rect", { x: "128", y: "96", width: "16", height: "36", rx: "7", fill: skin }), jsxRuntime.jsx("circle", { cx: "136", cy: "136", r: "7", fill: skin }), jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.card, children: [jsxRuntime.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 }), jsxRuntime.jsx("text", { x: "147", y: "70", textAnchor: "middle", fontSize: "16", fontWeight: 700, fill: "var(--nice-text-primary, #111)", children: String(score) })] }), renderProp(cfg.prop)] }), jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.head, children: [renderHairBack(cfg.hair), renderFace(cfg.face), jsxRuntime.jsx(framerMotion.motion.g, { animate: fx.eyes, children: renderEyes(cfg.eyes) }), renderNose(cfg.nose), jsxRuntime.jsx(framerMotion.motion.g, { animate: fx.mouth, children: renderMouth(cfg.mouth) }), renderHeadwear(cfg.headwear)] }), jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.curse, initial: { opacity: 0 }, children: [jsxRuntime.jsx("rect", { x: "62", y: "10", width: "56", height: "22", rx: "8", fill: "var(--nice-text-primary, #111)" }), jsxRuntime.jsx("text", { x: "90", y: "26", textAnchor: "middle", fontSize: "12", fill: "var(--nice-text-inverse, #fff)", children: "#!%&*" }), jsxRuntime.jsx("path", { d: "M82 32 l4 8 l4 -8", fill: "var(--nice-text-primary, #111)" })] })] }) }));
1
+ "use strict";
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const framerMotion = require("framer-motion");
5
+ const React = require("react");
6
+ const i18n = require("../core/i18n.js");
7
+ const animationHelper = require("./animationHelper.js");
8
+ const characterTypes = require("./characterTypes.js");
9
+ const NiceAnimatedPerson = ({
10
+ id,
11
+ name,
12
+ size,
13
+ score = 10,
14
+ startPose = "idle",
15
+ onReady,
16
+ character,
17
+ config,
18
+ pose,
19
+ width
20
+ // height intentionally ignored — kept on the type for API symmetry.
21
+ // colors prop is destructured for API completeness but not yet fully wired into character defaults.
22
+ }) => {
23
+ const { t } = i18n.useNiceTranslation();
24
+ const fx = animationHelper.usePersonControls();
25
+ const effectiveStartPose = pose ?? startPose;
26
+ const effectiveCharacter = character ?? config;
27
+ const effectiveSize = width ?? size;
28
+ const cfg = React.useMemo(
29
+ () => ({ ...characterTypes.DEFAULT_CHARACTER, ...effectiveCharacter ?? {} }),
30
+ [effectiveCharacter]
31
+ );
32
+ React.useEffect(() => {
33
+ onReady?.(fx);
34
+ void animationHelper.playPose(fx, effectiveStartPose, {});
35
+ }, [fx, onReady, effectiveStartPose]);
36
+ const W = cfg.size ?? effectiveSize ?? characterTypes.DEFAULT_CHARACTER.size ?? 180;
37
+ const skin = characterTypes.pick(cfg.face.colors, 0, "var(--anim-skin, #FFD2B3)");
38
+ return /* @__PURE__ */ jsxRuntime.jsx(
39
+ framerMotion.motion.div,
40
+ {
41
+ id,
42
+ style: { width: W, height: W * 1.35, overflow: "visible" },
43
+ animate: fx.root,
44
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
45
+ "svg",
46
+ {
47
+ viewBox: "0 0 180 240",
48
+ width: "100%",
49
+ height: "100%",
50
+ role: "img",
51
+ "aria-label": cfg.name ?? name ?? t("animatedPerson.juror", "Juror"),
52
+ children: [
53
+ /* @__PURE__ */ jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.body, children: [
54
+ /* @__PURE__ */ jsxRuntime.jsx(
55
+ "rect",
56
+ {
57
+ x: "68",
58
+ y: "158",
59
+ width: "14",
60
+ height: "46",
61
+ rx: "6",
62
+ fill: characterTypes.pick(cfg.outfit.colors, 1, "var(--anim-outfit-leg, #334155)")
63
+ }
64
+ ),
65
+ /* @__PURE__ */ jsxRuntime.jsx(
66
+ "ellipse",
67
+ {
68
+ cx: "75",
69
+ cy: "204",
70
+ rx: "10",
71
+ ry: "5",
72
+ fill: characterTypes.pick(cfg.outfit.colors, 1, "var(--anim-outfit-leg-shadow, #1E293B)")
73
+ }
74
+ ),
75
+ /* @__PURE__ */ jsxRuntime.jsx(
76
+ "rect",
77
+ {
78
+ x: "98",
79
+ y: "158",
80
+ width: "14",
81
+ height: "46",
82
+ rx: "6",
83
+ fill: characterTypes.pick(cfg.outfit.colors, 1, "var(--anim-outfit-leg, #334155)")
84
+ }
85
+ ),
86
+ /* @__PURE__ */ jsxRuntime.jsx(
87
+ "ellipse",
88
+ {
89
+ cx: "105",
90
+ cy: "204",
91
+ rx: "10",
92
+ ry: "5",
93
+ fill: characterTypes.pick(cfg.outfit.colors, 1, "var(--anim-outfit-leg-shadow, #1E293B)")
94
+ }
95
+ )
96
+ ] }),
97
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.g, { animate: fx.body, children: renderOutfit(cfg.outfit) }),
98
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "84", y: "82", width: "12", height: "12", rx: "4", fill: skin }),
99
+ /* @__PURE__ */ jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.leftArm, style: { transformOrigin: "64px 96px" }, children: [
100
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "36", y: "96", width: "16", height: "36", rx: "7", fill: skin }),
101
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "44", cy: "136", r: "7", fill: skin })
102
+ ] }),
103
+ /* @__PURE__ */ jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.rightArm, style: { transformOrigin: "116px 96px" }, children: [
104
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "128", y: "96", width: "16", height: "36", rx: "7", fill: skin }),
105
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "136", cy: "136", r: "7", fill: skin }),
106
+ /* @__PURE__ */ jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.card, children: [
107
+ /* @__PURE__ */ jsxRuntime.jsx(
108
+ "rect",
109
+ {
110
+ x: "126",
111
+ y: "50",
112
+ width: "42",
113
+ height: "30",
114
+ rx: "4",
115
+ fill: "var(--nice-color-surface, #fff)",
116
+ stroke: "var(--nice-text-primary, #111)",
117
+ strokeWidth: 1.2
118
+ }
119
+ ),
120
+ /* @__PURE__ */ jsxRuntime.jsx(
121
+ "text",
122
+ {
123
+ x: "147",
124
+ y: "70",
125
+ textAnchor: "middle",
126
+ fontSize: "16",
127
+ fontWeight: 700,
128
+ fill: "var(--nice-text-primary, #111)",
129
+ children: String(score)
130
+ }
131
+ )
132
+ ] }),
133
+ renderProp(cfg.prop)
134
+ ] }),
135
+ /* @__PURE__ */ jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.head, children: [
136
+ renderHairBack(cfg.hair),
137
+ renderFace(cfg.face),
138
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.g, { animate: fx.eyes, children: renderEyes(cfg.eyes) }),
139
+ renderNose(cfg.nose),
140
+ /* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.g, { animate: fx.mouth, children: renderMouth(cfg.mouth) }),
141
+ renderHeadwear(cfg.headwear)
142
+ ] }),
143
+ /* @__PURE__ */ jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.curse, initial: { opacity: 0 }, children: [
144
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "62", y: "10", width: "56", height: "22", rx: "8", fill: "var(--nice-text-primary, #111)" }),
145
+ /* @__PURE__ */ jsxRuntime.jsx(
146
+ "text",
147
+ {
148
+ x: "90",
149
+ y: "26",
150
+ textAnchor: "middle",
151
+ fontSize: "12",
152
+ fill: "var(--nice-text-inverse, #fff)",
153
+ children: "#!%&*"
154
+ }
155
+ ),
156
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M82 32 l4 8 l4 -8", fill: "var(--nice-text-primary, #111)" })
157
+ ] })
158
+ ]
159
+ }
160
+ )
161
+ }
162
+ );
28
163
  };
29
- /* ---------------- RENDERERS (redesigned proportions) ---------------- */
30
164
  function renderOutfit(cfg) {
31
- const base = characterTypes.pick(cfg.colors, 0, 'var(--anim-shirt, #3B82F6)');
32
- const accent = characterTypes.pick(cfg.colors, 1, base);
33
- const stroke = characterTypes.pick(cfg.colors, 2, 'var(--anim-stroke, #111)');
34
- switch (cfg.variant) {
35
- case 'hoodie':
36
- return (jsxRuntime.jsxs("g", { children: [jsxRuntime.jsx("rect", { x: "52", y: "92", width: "76", height: "66", rx: "16", fill: base, stroke: stroke, strokeWidth: 1 }), jsxRuntime.jsx("path", { d: "M52 102 Q90 72 128 102", fill: accent, opacity: 0.2 }), jsxRuntime.jsx("ellipse", { cx: "90", cy: "94", rx: "18", ry: "6", fill: accent, opacity: 0.3 })] }));
37
- case 'suit':
38
- return (jsxRuntime.jsxs("g", { children: [jsxRuntime.jsx("rect", { x: "52", y: "92", width: "76", height: "66", rx: "12", fill: base, stroke: stroke, strokeWidth: 1 }), jsxRuntime.jsx("path", { d: "M90 92 L72 118 L90 110 L108 118 Z", fill: accent, opacity: 0.75 }), jsxRuntime.jsx("rect", { x: "88", y: "110", width: "4", height: "48", fill: '#fff', opacity: 0.8 }), jsxRuntime.jsx("circle", { cx: "90", cy: "120", r: "2", fill: stroke }), jsxRuntime.jsx("circle", { cx: "90", cy: "134", r: "2", fill: stroke })] }));
39
- case 'dress':
40
- return (jsxRuntime.jsxs("g", { children: [jsxRuntime.jsx("rect", { x: "52", y: "92", width: "76", height: "56", rx: "14", fill: base, stroke: stroke, strokeWidth: 1 }), jsxRuntime.jsx("path", { d: "M52 148 L128 148 L136 168 L44 168 Z", fill: accent })] }));
41
- case 'tee':
42
- default:
43
- return (jsxRuntime.jsxs("g", { children: [jsxRuntime.jsx("rect", { x: "52", y: "92", width: "76", height: "66", rx: "14", fill: base, stroke: stroke, strokeWidth: 1 }), jsxRuntime.jsx("path", { d: "M82 92 L90 100 L98 92", fill: "none", stroke: stroke, strokeWidth: 1, opacity: 0.4 })] }));
44
- }
165
+ const base = characterTypes.pick(cfg.colors, 0, "var(--anim-shirt, #3B82F6)");
166
+ const accent = characterTypes.pick(cfg.colors, 1, base);
167
+ const stroke = characterTypes.pick(cfg.colors, 2, "var(--anim-stroke, #111)");
168
+ switch (cfg.variant) {
169
+ case "hoodie":
170
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
171
+ /* @__PURE__ */ jsxRuntime.jsx(
172
+ "rect",
173
+ {
174
+ x: "52",
175
+ y: "92",
176
+ width: "76",
177
+ height: "66",
178
+ rx: "16",
179
+ fill: base,
180
+ stroke,
181
+ strokeWidth: 1
182
+ }
183
+ ),
184
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M52 102 Q90 72 128 102", fill: accent, opacity: 0.2 }),
185
+ /* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "90", cy: "94", rx: "18", ry: "6", fill: accent, opacity: 0.3 })
186
+ ] });
187
+ case "suit":
188
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
189
+ /* @__PURE__ */ jsxRuntime.jsx(
190
+ "rect",
191
+ {
192
+ x: "52",
193
+ y: "92",
194
+ width: "76",
195
+ height: "66",
196
+ rx: "12",
197
+ fill: base,
198
+ stroke,
199
+ strokeWidth: 1
200
+ }
201
+ ),
202
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M90 92 L72 118 L90 110 L108 118 Z", fill: accent, opacity: 0.75 }),
203
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "88", y: "110", width: "4", height: "48", fill: "#fff", opacity: 0.8 }),
204
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "90", cy: "120", r: "2", fill: stroke }),
205
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "90", cy: "134", r: "2", fill: stroke })
206
+ ] });
207
+ case "dress":
208
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
209
+ /* @__PURE__ */ jsxRuntime.jsx(
210
+ "rect",
211
+ {
212
+ x: "52",
213
+ y: "92",
214
+ width: "76",
215
+ height: "56",
216
+ rx: "14",
217
+ fill: base,
218
+ stroke,
219
+ strokeWidth: 1
220
+ }
221
+ ),
222
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M52 148 L128 148 L136 168 L44 168 Z", fill: accent })
223
+ ] });
224
+ case "tee":
225
+ default:
226
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
227
+ /* @__PURE__ */ jsxRuntime.jsx(
228
+ "rect",
229
+ {
230
+ x: "52",
231
+ y: "92",
232
+ width: "76",
233
+ height: "66",
234
+ rx: "14",
235
+ fill: base,
236
+ stroke,
237
+ strokeWidth: 1
238
+ }
239
+ ),
240
+ /* @__PURE__ */ jsxRuntime.jsx(
241
+ "path",
242
+ {
243
+ d: "M82 92 L90 100 L98 92",
244
+ fill: "none",
245
+ stroke,
246
+ strokeWidth: 1,
247
+ opacity: 0.4
248
+ }
249
+ )
250
+ ] });
251
+ }
45
252
  }
46
253
  function renderHairBack(cfg) {
47
- const base = characterTypes.pick(cfg.colors, 0, 'var(--anim-hair, #1F2937)');
48
- const hi = characterTypes.pick(cfg.colors, 1, base);
49
- switch (cfg.variant) {
50
- case 'long':
51
- return (jsxRuntime.jsxs("g", { children: [jsxRuntime.jsx("path", { d: "M60 46 Q90 22 120 46 L120 76 Q90 92 60 76 Z", fill: base }), jsxRuntime.jsx("path", { d: "M90 46 Q92 56 102 62", stroke: hi, strokeWidth: 2.5, opacity: 0.35 })] }));
52
- case 'curly':
53
- return (jsxRuntime.jsxs("g", { children: [jsxRuntime.jsx("path", { d: "M66 40 q10 -14 22 0 q10 -14 22 0 l0 12 q-32 12 -64 0 Z", fill: base }), jsxRuntime.jsx("circle", { cx: "66", cy: "44", r: "5", fill: base }), jsxRuntime.jsx("circle", { cx: "114", cy: "44", r: "5", fill: base })] }));
54
- case 'mohawk':
55
- return jsxRuntime.jsx("path", { d: "M82 28 L98 28 L100 50 L80 50 Z", fill: base });
56
- case 'short':
57
- return jsxRuntime.jsx("path", { d: "M68 47 C78 24, 102 24, 112 47 L68 47 Z", fill: base });
58
- case 'none':
59
- default:
60
- return null;
61
- }
254
+ const base = characterTypes.pick(cfg.colors, 0, "var(--anim-hair, #1F2937)");
255
+ const hi = characterTypes.pick(cfg.colors, 1, base);
256
+ switch (cfg.variant) {
257
+ case "long":
258
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
259
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M60 46 Q90 22 120 46 L120 76 Q90 92 60 76 Z", fill: base }),
260
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M90 46 Q92 56 102 62", stroke: hi, strokeWidth: 2.5, opacity: 0.35 })
261
+ ] });
262
+ case "curly":
263
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
264
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M66 40 q10 -14 22 0 q10 -14 22 0 l0 12 q-32 12 -64 0 Z", fill: base }),
265
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "66", cy: "44", r: "5", fill: base }),
266
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "114", cy: "44", r: "5", fill: base })
267
+ ] });
268
+ case "mohawk":
269
+ return /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M82 28 L98 28 L100 50 L80 50 Z", fill: base });
270
+ case "short":
271
+ return /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M68 47 C78 24, 102 24, 112 47 L68 47 Z", fill: base });
272
+ case "none":
273
+ default:
274
+ return null;
275
+ }
62
276
  }
63
277
  function renderFace(cfg) {
64
- const skin = characterTypes.pick(cfg.colors, 0, 'var(--anim-skin, #FFD2B3)');
65
- const shadow = characterTypes.pick(cfg.colors, 1, skin);
66
- const stroke = characterTypes.pick(cfg.colors, 2, 'var(--anim-stroke, #111)');
67
- switch (cfg.variant) {
68
- case 'oval':
69
- return (jsxRuntime.jsxs("g", { children: [jsxRuntime.jsx("ellipse", { cx: "90", cy: "60", rx: "26", ry: "28", fill: skin, stroke: stroke, strokeWidth: 1 }), jsxRuntime.jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })] }));
70
- case 'square':
71
- return (jsxRuntime.jsxs("g", { children: [jsxRuntime.jsx("rect", { x: "64", y: "36", width: "52", height: "48", rx: "12", fill: skin, stroke: stroke, strokeWidth: 1 }), jsxRuntime.jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })] }));
72
- case 'heart':
73
- return (jsxRuntime.jsxs("g", { children: [jsxRuntime.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 }), jsxRuntime.jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })] }));
74
- case 'round':
75
- default:
76
- return (jsxRuntime.jsxs("g", { children: [jsxRuntime.jsx("circle", { cx: "90", cy: "60", r: "26", fill: skin, stroke: stroke, strokeWidth: 1 }), jsxRuntime.jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })] }));
77
- }
278
+ const skin = characterTypes.pick(cfg.colors, 0, "var(--anim-skin, #FFD2B3)");
279
+ const shadow = characterTypes.pick(cfg.colors, 1, skin);
280
+ const stroke = characterTypes.pick(cfg.colors, 2, "var(--anim-stroke, #111)");
281
+ switch (cfg.variant) {
282
+ case "oval":
283
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
284
+ /* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "90", cy: "60", rx: "26", ry: "28", fill: skin, stroke, strokeWidth: 1 }),
285
+ /* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })
286
+ ] });
287
+ case "square":
288
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
289
+ /* @__PURE__ */ jsxRuntime.jsx(
290
+ "rect",
291
+ {
292
+ x: "64",
293
+ y: "36",
294
+ width: "52",
295
+ height: "48",
296
+ rx: "12",
297
+ fill: skin,
298
+ stroke,
299
+ strokeWidth: 1
300
+ }
301
+ ),
302
+ /* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })
303
+ ] });
304
+ case "heart":
305
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
306
+ /* @__PURE__ */ jsxRuntime.jsx(
307
+ "path",
308
+ {
309
+ d: "M90 36 q-18 10 -18 26 q0 16 18 26 q18 -10 18 -26 q0 -16 -18 -26 Z",
310
+ fill: skin,
311
+ stroke,
312
+ strokeWidth: 1
313
+ }
314
+ ),
315
+ /* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })
316
+ ] });
317
+ case "round":
318
+ default:
319
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
320
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "90", cy: "60", r: "26", fill: skin, stroke, strokeWidth: 1 }),
321
+ /* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })
322
+ ] });
323
+ }
78
324
  }
79
325
  function renderEyes(cfg) {
80
- const base = characterTypes.pick(cfg.colors, 0, 'var(--anim-eye-base, #111)');
81
- switch (cfg.variant) {
82
- case 'oval':
83
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("ellipse", { cx: "80", cy: "56", rx: "4.5", ry: "3.5", fill: base }), jsxRuntime.jsx("ellipse", { cx: "100", cy: "56", rx: "4.5", ry: "3.5", fill: base }), jsxRuntime.jsx("circle", { cx: "81.5", cy: "55", r: "1.2", fill: '#fff', opacity: 0.7 }), jsxRuntime.jsx("circle", { cx: "101.5", cy: "55", r: "1.2", fill: '#fff', opacity: 0.7 })] }));
84
- case 'laugh':
85
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("path", { d: "M76 56 q4 -4 8 0", stroke: base, strokeWidth: 2.5, fill: "none", strokeLinecap: "round" }), jsxRuntime.jsx("path", { d: "M96 56 q4 -4 8 0", stroke: base, strokeWidth: 2.5, fill: "none", strokeLinecap: "round" })] }));
86
- case 'wink':
87
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("circle", { cx: "80", cy: "56", r: "3.5", fill: base }), jsxRuntime.jsx("circle", { cx: "81.5", cy: "55", r: "1", fill: '#fff', opacity: 0.7 }), jsxRuntime.jsx("path", { d: "M96 56 l8 0", stroke: base, strokeWidth: 2.5, strokeLinecap: "round" })] }));
88
- case 'sleepy':
89
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("path", { d: "M76 56 l8 0", stroke: base, strokeWidth: 2.5, strokeLinecap: "round" }), jsxRuntime.jsx("path", { d: "M96 56 l8 0", stroke: base, strokeWidth: 2.5, strokeLinecap: "round" })] }));
90
- case 'dot':
91
- default:
92
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("circle", { cx: "80", cy: "56", r: "3.5", fill: base }), jsxRuntime.jsx("circle", { cx: "100", cy: "56", r: "3.5", fill: base }), jsxRuntime.jsx("circle", { cx: "81.5", cy: "55", r: "1", fill: '#fff', opacity: 0.7 }), jsxRuntime.jsx("circle", { cx: "101.5", cy: "55", r: "1", fill: '#fff', opacity: 0.7 })] }));
93
- }
326
+ const base = characterTypes.pick(cfg.colors, 0, "var(--anim-eye-base, #111)");
327
+ switch (cfg.variant) {
328
+ case "oval":
329
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
330
+ /* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "80", cy: "56", rx: "4.5", ry: "3.5", fill: base }),
331
+ /* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "100", cy: "56", rx: "4.5", ry: "3.5", fill: base }),
332
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "81.5", cy: "55", r: "1.2", fill: "#fff", opacity: 0.7 }),
333
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "101.5", cy: "55", r: "1.2", fill: "#fff", opacity: 0.7 })
334
+ ] });
335
+ case "laugh":
336
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
337
+ /* @__PURE__ */ jsxRuntime.jsx(
338
+ "path",
339
+ {
340
+ d: "M76 56 q4 -4 8 0",
341
+ stroke: base,
342
+ strokeWidth: 2.5,
343
+ fill: "none",
344
+ strokeLinecap: "round"
345
+ }
346
+ ),
347
+ /* @__PURE__ */ jsxRuntime.jsx(
348
+ "path",
349
+ {
350
+ d: "M96 56 q4 -4 8 0",
351
+ stroke: base,
352
+ strokeWidth: 2.5,
353
+ fill: "none",
354
+ strokeLinecap: "round"
355
+ }
356
+ )
357
+ ] });
358
+ case "wink":
359
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
360
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "80", cy: "56", r: "3.5", fill: base }),
361
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "81.5", cy: "55", r: "1", fill: "#fff", opacity: 0.7 }),
362
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M96 56 l8 0", stroke: base, strokeWidth: 2.5, strokeLinecap: "round" })
363
+ ] });
364
+ case "sleepy":
365
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
366
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M76 56 l8 0", stroke: base, strokeWidth: 2.5, strokeLinecap: "round" }),
367
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M96 56 l8 0", stroke: base, strokeWidth: 2.5, strokeLinecap: "round" })
368
+ ] });
369
+ case "dot":
370
+ default:
371
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
372
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "80", cy: "56", r: "3.5", fill: base }),
373
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "100", cy: "56", r: "3.5", fill: base }),
374
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "81.5", cy: "55", r: "1", fill: "#fff", opacity: 0.7 }),
375
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "101.5", cy: "55", r: "1", fill: "#fff", opacity: 0.7 })
376
+ ] });
377
+ }
94
378
  }
95
379
  function renderNose(cfg) {
96
- const base = characterTypes.pick(cfg.colors, 0, 'var(--anim-nose, #111)');
97
- switch (cfg.variant) {
98
- case 'triangle':
99
- return jsxRuntime.jsx("path", { d: "M90 62 l-4 8 h8 Z", fill: base, opacity: 0.6 });
100
- case 'round':
101
- return jsxRuntime.jsx("circle", { cx: "90", cy: "66", r: "3", fill: base, opacity: 0.6 });
102
- case 'line':
103
- default:
104
- return jsxRuntime.jsx("rect", { x: "89", y: "62", width: "2", height: "8", fill: base, rx: "1", opacity: 0.5 });
105
- }
380
+ const base = characterTypes.pick(cfg.colors, 0, "var(--anim-nose, #111)");
381
+ switch (cfg.variant) {
382
+ case "triangle":
383
+ return /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M90 62 l-4 8 h8 Z", fill: base, opacity: 0.6 });
384
+ case "round":
385
+ return /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "90", cy: "66", r: "3", fill: base, opacity: 0.6 });
386
+ case "line":
387
+ default:
388
+ return /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "89", y: "62", width: "2", height: "8", fill: base, rx: "1", opacity: 0.5 });
389
+ }
106
390
  }
107
391
  function renderMouth(cfg) {
108
- const base = characterTypes.pick(cfg.colors, 0, 'var(--anim-mouth-base, #111)');
109
- const tooth = characterTypes.pick(cfg.colors, 1, 'var(--white, #fff)');
110
- switch (cfg.variant) {
111
- case 'frown':
112
- return (jsxRuntime.jsx("path", { d: "M80 76 q10 -6 20 0", stroke: base, strokeWidth: 2.5, fill: "none", strokeLinecap: "round" }));
113
- case 'open':
114
- return jsxRuntime.jsx("ellipse", { cx: "90", cy: "76", rx: "7", ry: "5", fill: base });
115
- case 'flat':
116
- return jsxRuntime.jsx("rect", { x: "82", y: "75", width: "16", height: "2.5", rx: "1.25", fill: base });
117
- case 'o':
118
- return jsxRuntime.jsx("circle", { cx: "90", cy: "76", r: "4", fill: base });
119
- case 'teeth':
120
- return (jsxRuntime.jsxs("g", { children: [jsxRuntime.jsx("rect", { x: "82", y: "74", width: "16", height: "7", rx: "3", fill: base }), jsxRuntime.jsx("rect", { x: "84", y: "75", width: "12", height: "3", rx: "1", fill: tooth })] }));
121
- case 'smile':
122
- default:
123
- return (jsxRuntime.jsx("path", { d: "M80 76 q10 8 20 0", stroke: base, strokeWidth: 2.5, fill: "none", strokeLinecap: "round" }));
124
- }
392
+ const base = characterTypes.pick(cfg.colors, 0, "var(--anim-mouth-base, #111)");
393
+ const tooth = characterTypes.pick(cfg.colors, 1, "var(--white, #fff)");
394
+ switch (cfg.variant) {
395
+ case "frown":
396
+ return /* @__PURE__ */ jsxRuntime.jsx(
397
+ "path",
398
+ {
399
+ d: "M80 76 q10 -6 20 0",
400
+ stroke: base,
401
+ strokeWidth: 2.5,
402
+ fill: "none",
403
+ strokeLinecap: "round"
404
+ }
405
+ );
406
+ case "open":
407
+ return /* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "90", cy: "76", rx: "7", ry: "5", fill: base });
408
+ case "flat":
409
+ return /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "82", y: "75", width: "16", height: "2.5", rx: "1.25", fill: base });
410
+ case "o":
411
+ return /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "90", cy: "76", r: "4", fill: base });
412
+ case "teeth":
413
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
414
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "82", y: "74", width: "16", height: "7", rx: "3", fill: base }),
415
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "84", y: "75", width: "12", height: "3", rx: "1", fill: tooth })
416
+ ] });
417
+ case "smile":
418
+ default:
419
+ return /* @__PURE__ */ jsxRuntime.jsx(
420
+ "path",
421
+ {
422
+ d: "M80 76 q10 8 20 0",
423
+ stroke: base,
424
+ strokeWidth: 2.5,
425
+ fill: "none",
426
+ strokeLinecap: "round"
427
+ }
428
+ );
429
+ }
125
430
  }
126
431
  function renderHeadwear(cfg) {
127
- const base = characterTypes.pick(cfg.colors, 0, 'var(--anim-headwear-base, #111)');
128
- const accent = characterTypes.pick(cfg.colors, 1, base);
129
- switch (cfg.variant) {
130
- case 'cap':
131
- return (jsxRuntime.jsxs("g", { children: [jsxRuntime.jsx("path", { d: "M68 44 q22 -18 44 0 l-6 4 q-18 -10 -28 0 Z", fill: base }), jsxRuntime.jsx("rect", { x: "60", y: "44", width: "52", height: "5", rx: "2", fill: base })] }));
132
- case 'headphones':
133
- return (jsxRuntime.jsxs("g", { children: [jsxRuntime.jsx("path", { d: "M66 56 q0 -24 24 -24 q24 0 24 24", stroke: base, strokeWidth: 5, fill: "none" }), jsxRuntime.jsx("rect", { x: "58", y: "52", width: "12", height: "16", rx: "4", fill: accent }), jsxRuntime.jsx("rect", { x: "110", y: "52", width: "12", height: "16", rx: "4", fill: accent })] }));
134
- case 'hat':
135
- return (jsxRuntime.jsxs("g", { children: [jsxRuntime.jsx("rect", { x: "62", y: "38", width: "56", height: "8", rx: "3", fill: base }), jsxRuntime.jsx("rect", { x: "72", y: "30", width: "36", height: "10", rx: "3", fill: base })] }));
136
- case 'crown':
137
- return jsxRuntime.jsx("path", { d: "M72 42 l6 12 l6 -10 l6 10 l6 -10 l6 12 v6 h-30 Z", fill: base });
138
- case 'none':
139
- default:
140
- return null;
141
- }
432
+ const base = characterTypes.pick(cfg.colors, 0, "var(--anim-headwear-base, #111)");
433
+ const accent = characterTypes.pick(cfg.colors, 1, base);
434
+ switch (cfg.variant) {
435
+ case "cap":
436
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
437
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M68 44 q22 -18 44 0 l-6 4 q-18 -10 -28 0 Z", fill: base }),
438
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "60", y: "44", width: "52", height: "5", rx: "2", fill: base })
439
+ ] });
440
+ case "headphones":
441
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
442
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M66 56 q0 -24 24 -24 q24 0 24 24", stroke: base, strokeWidth: 5, fill: "none" }),
443
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "58", y: "52", width: "12", height: "16", rx: "4", fill: accent }),
444
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "110", y: "52", width: "12", height: "16", rx: "4", fill: accent })
445
+ ] });
446
+ case "hat":
447
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
448
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "62", y: "38", width: "56", height: "8", rx: "3", fill: base }),
449
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "72", y: "30", width: "36", height: "10", rx: "3", fill: base })
450
+ ] });
451
+ case "crown":
452
+ return /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M72 42 l6 12 l6 -10 l6 10 l6 -10 l6 12 v6 h-30 Z", fill: base });
453
+ case "none":
454
+ default:
455
+ return null;
456
+ }
142
457
  }
143
458
  function renderProp(cfg) {
144
- const base = characterTypes.pick(cfg.colors, 0, 'var(--anim-prop-base, #111)');
145
- const accent = characterTypes.pick(cfg.colors, 1, 'var(--anim-prop-accent, #666)');
146
- const light = characterTypes.pick(cfg.colors, 2, 'var(--anim-prop-light, #CCC)');
147
- switch (cfg.variant) {
148
- case 'mic':
149
- return (jsxRuntime.jsxs("g", { transform: "translate(140,90)", children: [jsxRuntime.jsx("rect", { x: "0", y: "0", width: "4", height: "16", rx: "2", fill: accent }), jsxRuntime.jsx("circle", { cx: "2", cy: "-2", r: "6", fill: base, stroke: light, strokeWidth: 1 })] }));
150
- case 'clipboard':
151
- return (jsxRuntime.jsxs("g", { transform: "translate(140,86)", children: [jsxRuntime.jsx("rect", { x: "-6", y: "-2", width: "20", height: "26", rx: "3", fill: light, stroke: base }), jsxRuntime.jsx("rect", { x: "0", y: "-6", width: "8", height: "6", rx: "2", fill: base })] }));
152
- case 'star':
153
- return (jsxRuntime.jsx("g", { transform: "translate(140,86)", children: jsxRuntime.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 }) }));
154
- case 'none':
155
- default:
156
- return null;
157
- }
459
+ const base = characterTypes.pick(cfg.colors, 0, "var(--anim-prop-base, #111)");
460
+ const accent = characterTypes.pick(cfg.colors, 1, "var(--anim-prop-accent, #666)");
461
+ const light = characterTypes.pick(cfg.colors, 2, "var(--anim-prop-light, #CCC)");
462
+ switch (cfg.variant) {
463
+ case "mic":
464
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: "translate(140,90)", children: [
465
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "0", y: "0", width: "4", height: "16", rx: "2", fill: accent }),
466
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "2", cy: "-2", r: "6", fill: base, stroke: light, strokeWidth: 1 })
467
+ ] });
468
+ case "clipboard":
469
+ return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: "translate(140,86)", children: [
470
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "-6", y: "-2", width: "20", height: "26", rx: "3", fill: light, stroke: base }),
471
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "0", y: "-6", width: "8", height: "6", rx: "2", fill: base })
472
+ ] });
473
+ case "star":
474
+ return /* @__PURE__ */ jsxRuntime.jsx("g", { transform: "translate(140,86)", children: /* @__PURE__ */ jsxRuntime.jsx(
475
+ "path",
476
+ {
477
+ d: "M8 0 L10 6 L16 6 L11 10 L13 16 L8 12 L3 16 L5 10 L0 6 L6 6 Z",
478
+ fill: accent,
479
+ stroke: base
480
+ }
481
+ ) });
482
+ case "none":
483
+ default:
484
+ return null;
485
+ }
158
486
  }
159
-
160
- module.exports = NiceAnimatedPerson;
487
+ exports.default = NiceAnimatedPerson;