@felbrasil/dreamy 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (450) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +69 -2
  3. package/dist/api.d.ts +1 -0
  4. package/dist/api.js +2 -0
  5. package/dist/api.js.map +7 -0
  6. package/dist/chunks/chunk-72DMUKP3.js +1470 -0
  7. package/dist/chunks/chunk-72DMUKP3.js.map +7 -0
  8. package/dist/chunks/chunk-VZMBE5MV.js +5936 -0
  9. package/dist/chunks/chunk-VZMBE5MV.js.map +7 -0
  10. package/dist/chunks/chunk-ZU72KKME.js +8600 -0
  11. package/dist/chunks/chunk-ZU72KKME.js.map +7 -0
  12. package/dist/core.d.ts +1 -0
  13. package/dist/core.js +34 -0
  14. package/dist/core.js.map +7 -0
  15. package/dist/dreamy_evaluator.wasm +0 -0
  16. package/dist/evaluator.d.ts +1 -0
  17. package/dist/evaluator.js +52 -0
  18. package/dist/evaluator.js.map +7 -0
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.js +7280 -0
  21. package/dist/index.js.map +7 -0
  22. package/dist/styles.css +1 -0
  23. package/dist/types/api/src/commands/command.d.ts +7 -0
  24. package/dist/types/api/src/commands/decal-commands.d.ts +35 -0
  25. package/dist/types/api/src/commands/palette-commands.d.ts +14 -0
  26. package/dist/types/api/src/commands/rig-commands.d.ts +229 -0
  27. package/dist/types/api/src/commands/scene-commands.d.ts +64 -0
  28. package/dist/types/api/src/commands/sculpt-commands.d.ts +111 -0
  29. package/dist/types/api/src/commands/stamp-spec.d.ts +3 -0
  30. package/dist/types/api/src/commands/target.d.ts +8 -0
  31. package/dist/types/api/src/creation-api.d.ts +52 -0
  32. package/dist/types/api/src/events/creation-event.d.ts +7 -0
  33. package/dist/types/api/src/events/decal-events.d.ts +20 -0
  34. package/dist/types/api/src/events/event-of.d.ts +6 -0
  35. package/dist/types/api/src/events/palette-events.d.ts +8 -0
  36. package/dist/types/api/src/events/rig-events.d.ts +161 -0
  37. package/dist/types/api/src/events/scene-events.d.ts +34 -0
  38. package/dist/types/api/src/events/sculpt-events.d.ts +53 -0
  39. package/dist/types/api/src/id.d.ts +1 -0
  40. package/dist/types/api/src/index.d.ts +31 -0
  41. package/dist/types/api/src/model/creation.d.ts +22 -0
  42. package/dist/types/api/src/model/decal.d.ts +48 -0
  43. package/dist/types/api/src/model/look.d.ts +56 -0
  44. package/dist/types/api/src/model/math.d.ts +18 -0
  45. package/dist/types/api/src/model/palette.d.ts +11 -0
  46. package/dist/types/api/src/model/rig.d.ts +125 -0
  47. package/dist/types/api/src/model/scene-object.d.ts +22 -0
  48. package/dist/types/api/src/model/sculpt.d.ts +13 -0
  49. package/dist/types/api/src/model/stamp.d.ts +53 -0
  50. package/dist/types/api/src/model/wing.d.ts +35 -0
  51. package/dist/types/api/src/ports/basic-ports.d.ts +7 -0
  52. package/dist/types/api/src/ports/evaluator.d.ts +62 -0
  53. package/dist/types/api/src/ports/persistence.d.ts +89 -0
  54. package/dist/types/api/src/ports/viewport.d.ts +125 -0
  55. package/dist/types/core/src/apply/body-part-added.d.ts +2 -0
  56. package/dist/types/core/src/apply/body-part-removed.d.ts +2 -0
  57. package/dist/types/core/src/apply/bone-removed.d.ts +3 -0
  58. package/dist/types/core/src/apply/bone-renamed.d.ts +2 -0
  59. package/dist/types/core/src/apply/bone-reparented.d.ts +2 -0
  60. package/dist/types/core/src/apply/bone-sizes-set.d.ts +3 -0
  61. package/dist/types/core/src/apply/bone-tags-set.d.ts +2 -0
  62. package/dist/types/core/src/apply/bone-transforms-set.d.ts +6 -0
  63. package/dist/types/core/src/apply/bones-added.d.ts +2 -0
  64. package/dist/types/core/src/apply/creature-generated.d.ts +3 -0
  65. package/dist/types/core/src/apply/decal-removed.d.ts +2 -0
  66. package/dist/types/core/src/apply/decals-added.d.ts +2 -0
  67. package/dist/types/core/src/apply/design-deleted.d.ts +2 -0
  68. package/dist/types/core/src/apply/design-saved.d.ts +2 -0
  69. package/dist/types/core/src/apply/flat-wings-set.d.ts +2 -0
  70. package/dist/types/core/src/apply/object-renamed.d.ts +2 -0
  71. package/dist/types/core/src/apply/object-reparented.d.ts +2 -0
  72. package/dist/types/core/src/apply/object-transforms-set.d.ts +2 -0
  73. package/dist/types/core/src/apply/objects-deleted.d.ts +2 -0
  74. package/dist/types/core/src/apply/objects-duplicated.d.ts +3 -0
  75. package/dist/types/core/src/apply/palette-color-set.d.ts +2 -0
  76. package/dist/types/core/src/apply/palette-reset.d.ts +2 -0
  77. package/dist/types/core/src/apply/part-grafted.d.ts +3 -0
  78. package/dist/types/core/src/apply/part-slot-swapped.d.ts +3 -0
  79. package/dist/types/core/src/apply/pivot-set.d.ts +2 -0
  80. package/dist/types/core/src/apply/pose-preset-applied.d.ts +3 -0
  81. package/dist/types/core/src/apply/pose-reset.d.ts +3 -0
  82. package/dist/types/core/src/apply/premade-applied.d.ts +3 -0
  83. package/dist/types/core/src/apply/region-blend-set.d.ts +3 -0
  84. package/dist/types/core/src/apply/rig-created.d.ts +2 -0
  85. package/dist/types/core/src/apply/rig-mirror-set.d.ts +2 -0
  86. package/dist/types/core/src/apply/rig-mode-set.d.ts +2 -0
  87. package/dist/types/core/src/apply/sculpt-created.d.ts +2 -0
  88. package/dist/types/core/src/apply/sculpt-look-set.d.ts +3 -0
  89. package/dist/types/core/src/apply/smear-group-set.d.ts +2 -0
  90. package/dist/types/core/src/apply/stamp-placements-set.d.ts +2 -0
  91. package/dist/types/core/src/apply/stamp-props-set.d.ts +2 -0
  92. package/dist/types/core/src/apply/stamps-added.d.ts +2 -0
  93. package/dist/types/core/src/apply/stamps-removed.d.ts +2 -0
  94. package/dist/types/core/src/apply/symmetry-set-for-all.d.ts +2 -0
  95. package/dist/types/core/src/atoms/check/check.d.ts +7 -0
  96. package/dist/types/core/src/atoms/decal/decal-limits.d.ts +6 -0
  97. package/dist/types/core/src/atoms/decal/decal-problem.d.ts +4 -0
  98. package/dist/types/core/src/atoms/decal/design-problem.d.ts +4 -0
  99. package/dist/types/core/src/atoms/look/catalogs.d.ts +9 -0
  100. package/dist/types/core/src/atoms/look/default-look.d.ts +4 -0
  101. package/dist/types/core/src/atoms/look/look-problem.d.ts +7 -0
  102. package/dist/types/core/src/atoms/look/merge-look.d.ts +3 -0
  103. package/dist/types/core/src/atoms/math/mat4.d.ts +14 -0
  104. package/dist/types/core/src/atoms/math/quat.d.ts +18 -0
  105. package/dist/types/core/src/atoms/math/transform.d.ts +7 -0
  106. package/dist/types/core/src/atoms/math/vec3.d.ts +18 -0
  107. package/dist/types/core/src/atoms/palette/default-palette.d.ts +4 -0
  108. package/dist/types/core/src/atoms/palette/is-color-ref.d.ts +2 -0
  109. package/dist/types/core/src/atoms/palette/poc-color-ref.d.ts +6 -0
  110. package/dist/types/core/src/atoms/rig/bone-matrices.d.ts +8 -0
  111. package/dist/types/core/src/atoms/rig/bone-region.d.ts +8 -0
  112. package/dist/types/core/src/atoms/rig/bone-role.d.ts +11 -0
  113. package/dist/types/core/src/atoms/rig/bone-size.d.ts +7 -0
  114. package/dist/types/core/src/atoms/rig/compose-local.d.ts +6 -0
  115. package/dist/types/core/src/atoms/rig/find-rig.d.ts +11 -0
  116. package/dist/types/core/src/atoms/rig/mirror-partner.d.ts +3 -0
  117. package/dist/types/core/src/atoms/rig/mirror-sculpt.d.ts +9 -0
  118. package/dist/types/core/src/atoms/rig/mirror-transform.d.ts +9 -0
  119. package/dist/types/core/src/atoms/rig/partner-target.d.ts +3 -0
  120. package/dist/types/core/src/atoms/rig/pose-presets.d.ts +11 -0
  121. package/dist/types/core/src/atoms/rig/pose-rule.d.ts +48 -0
  122. package/dist/types/core/src/atoms/rig/pose-template-rules.d.ts +8 -0
  123. package/dist/types/core/src/atoms/rig/rebase-pose.d.ts +6 -0
  124. package/dist/types/core/src/atoms/rig/resize-bones.d.ts +12 -0
  125. package/dist/types/core/src/atoms/rig/rig-extent.d.ts +3 -0
  126. package/dist/types/core/src/atoms/rig/side-from-name.d.ts +7 -0
  127. package/dist/types/core/src/atoms/rig/size-frame.d.ts +18 -0
  128. package/dist/types/core/src/atoms/rig/with-slot-parts.d.ts +9 -0
  129. package/dist/types/core/src/atoms/scene/copy-with-new-ids.d.ts +7 -0
  130. package/dist/types/core/src/atoms/scene/object-tree.d.ts +8 -0
  131. package/dist/types/core/src/atoms/scene/place-in-order.d.ts +7 -0
  132. package/dist/types/core/src/atoms/scene/unique-name.d.ts +4 -0
  133. package/dist/types/core/src/atoms/scene/world-matrix.d.ts +4 -0
  134. package/dist/types/core/src/atoms/sculpt/all-sculpts.d.ts +3 -0
  135. package/dist/types/core/src/atoms/sculpt/is-wing-target.d.ts +3 -0
  136. package/dist/types/core/src/atoms/sculpt/target-sculpt.d.ts +10 -0
  137. package/dist/types/core/src/atoms/sculpt/update-target.d.ts +8 -0
  138. package/dist/types/core/src/atoms/stamp/apply-stamp-props.d.ts +11 -0
  139. package/dist/types/core/src/atoms/stamp/clamp-symmetry.d.ts +11 -0
  140. package/dist/types/core/src/atoms/stamp/clean-props.d.ts +3 -0
  141. package/dist/types/core/src/atoms/stamp/emptied-groups.d.ts +3 -0
  142. package/dist/types/core/src/atoms/stamp/move-locked-groups.d.ts +12 -0
  143. package/dist/types/core/src/atoms/stamp/normalize-base.d.ts +6 -0
  144. package/dist/types/core/src/atoms/stamp/resolve-stamp-props.d.ts +14 -0
  145. package/dist/types/core/src/atoms/stamp/smear.d.ts +15 -0
  146. package/dist/types/core/src/atoms/stamp/stamp-problem.d.ts +7 -0
  147. package/dist/types/core/src/atoms/wing/wing-problem.d.ts +6 -0
  148. package/dist/types/core/src/create-creation-api.d.ts +12 -0
  149. package/dist/types/core/src/decide.d.ts +4 -0
  150. package/dist/types/core/src/empty-creation.d.ts +2 -0
  151. package/dist/types/core/src/fold.d.ts +6 -0
  152. package/dist/types/core/src/index.d.ts +9 -0
  153. package/dist/types/core/src/molecules/add-body-part.d.ts +8 -0
  154. package/dist/types/core/src/molecules/add-bone.d.ts +8 -0
  155. package/dist/types/core/src/molecules/add-decals.d.ts +4 -0
  156. package/dist/types/core/src/molecules/add-stamps.d.ts +8 -0
  157. package/dist/types/core/src/molecules/apply-pose-preset.d.ts +4 -0
  158. package/dist/types/core/src/molecules/apply-premade.d.ts +9 -0
  159. package/dist/types/core/src/molecules/auto-tag-sides.d.ts +4 -0
  160. package/dist/types/core/src/molecules/create-rig.d.ts +4 -0
  161. package/dist/types/core/src/molecules/create-sculpt.d.ts +4 -0
  162. package/dist/types/core/src/molecules/delete-design.d.ts +4 -0
  163. package/dist/types/core/src/molecules/delete-objects.d.ts +4 -0
  164. package/dist/types/core/src/molecules/duplicate-objects.d.ts +6 -0
  165. package/dist/types/core/src/molecules/generate-creature.d.ts +7 -0
  166. package/dist/types/core/src/molecules/graft-part.d.ts +4 -0
  167. package/dist/types/core/src/molecules/mirror-objects.d.ts +7 -0
  168. package/dist/types/core/src/molecules/molecule.d.ts +17 -0
  169. package/dist/types/core/src/molecules/remove-body-part.d.ts +3 -0
  170. package/dist/types/core/src/molecules/remove-bone.d.ts +4 -0
  171. package/dist/types/core/src/molecules/remove-decal.d.ts +3 -0
  172. package/dist/types/core/src/molecules/remove-smear-group.d.ts +4 -0
  173. package/dist/types/core/src/molecules/remove-stamps.d.ts +4 -0
  174. package/dist/types/core/src/molecules/rename-bone.d.ts +3 -0
  175. package/dist/types/core/src/molecules/rename-object.d.ts +3 -0
  176. package/dist/types/core/src/molecules/reparent-bone.d.ts +4 -0
  177. package/dist/types/core/src/molecules/reparent-object.d.ts +4 -0
  178. package/dist/types/core/src/molecules/reset-palette.d.ts +3 -0
  179. package/dist/types/core/src/molecules/reset-pose.d.ts +3 -0
  180. package/dist/types/core/src/molecules/save-design.d.ts +4 -0
  181. package/dist/types/core/src/molecules/set-bone-sizes.d.ts +8 -0
  182. package/dist/types/core/src/molecules/set-bone-tags.d.ts +4 -0
  183. package/dist/types/core/src/molecules/set-bone-transforms.d.ts +7 -0
  184. package/dist/types/core/src/molecules/set-flat-wings.d.ts +4 -0
  185. package/dist/types/core/src/molecules/set-object-transforms.d.ts +3 -0
  186. package/dist/types/core/src/molecules/set-palette-color.d.ts +3 -0
  187. package/dist/types/core/src/molecules/set-pivot.d.ts +3 -0
  188. package/dist/types/core/src/molecules/set-region-blend.d.ts +4 -0
  189. package/dist/types/core/src/molecules/set-rig-mirror.d.ts +3 -0
  190. package/dist/types/core/src/molecules/set-rig-mode.d.ts +3 -0
  191. package/dist/types/core/src/molecules/set-sculpt-look.d.ts +7 -0
  192. package/dist/types/core/src/molecules/set-smear-group.d.ts +4 -0
  193. package/dist/types/core/src/molecules/set-stamp-placements.d.ts +4 -0
  194. package/dist/types/core/src/molecules/set-stamp-props.d.ts +3 -0
  195. package/dist/types/core/src/molecules/set-symmetry-for-all.d.ts +4 -0
  196. package/dist/types/core/src/molecules/swap-part-slot.d.ts +7 -0
  197. package/dist/types/core/src/premades/ant-bake.d.ts +2 -0
  198. package/dist/types/core/src/premades/bake-authoring.d.ts +35 -0
  199. package/dist/types/core/src/premades/bake-types.d.ts +65 -0
  200. package/dist/types/core/src/premades/baked-part-for.d.ts +11 -0
  201. package/dist/types/core/src/premades/bee-bake.d.ts +2 -0
  202. package/dist/types/core/src/premades/bird-bake.d.ts +2 -0
  203. package/dist/types/core/src/premades/body-stamps-for-bone.d.ts +14 -0
  204. package/dist/types/core/src/premades/bone-tree.d.ts +15 -0
  205. package/dist/types/core/src/premades/build-premade-rig.d.ts +23 -0
  206. package/dist/types/core/src/premades/build-template.d.ts +6 -0
  207. package/dist/types/core/src/premades/centipede-bake.d.ts +2 -0
  208. package/dist/types/core/src/premades/coat-stamps.d.ts +3 -0
  209. package/dist/types/core/src/premades/crab-bake.d.ts +2 -0
  210. package/dist/types/core/src/premades/dragon-bake.d.ts +2 -0
  211. package/dist/types/core/src/premades/face-decals.d.ts +17 -0
  212. package/dist/types/core/src/premades/fish-bake.d.ts +2 -0
  213. package/dist/types/core/src/premades/fit-part-slot.d.ts +21 -0
  214. package/dist/types/core/src/premades/generate-creature.d.ts +21 -0
  215. package/dist/types/core/src/premades/gorilla-bake.d.ts +2 -0
  216. package/dist/types/core/src/premades/graft-slot.d.ts +34 -0
  217. package/dist/types/core/src/premades/humanoid-bake.d.ts +2 -0
  218. package/dist/types/core/src/premades/insect6-bake.d.ts +2 -0
  219. package/dist/types/core/src/premades/jellyfish-bake.d.ts +2 -0
  220. package/dist/types/core/src/premades/lizard-bake.d.ts +2 -0
  221. package/dist/types/core/src/premades/make-baked-part.d.ts +9 -0
  222. package/dist/types/core/src/premades/make-body-part.d.ts +9 -0
  223. package/dist/types/core/src/premades/make-flat-part.d.ts +13 -0
  224. package/dist/types/core/src/premades/part-context.d.ts +20 -0
  225. package/dist/types/core/src/premades/part-kits.d.ts +36 -0
  226. package/dist/types/core/src/premades/part-slots.d.ts +17 -0
  227. package/dist/types/core/src/premades/part-stamp.d.ts +13 -0
  228. package/dist/types/core/src/premades/part-styles.d.ts +44 -0
  229. package/dist/types/core/src/premades/premade-fit.d.ts +18 -0
  230. package/dist/types/core/src/premades/premade-infos.d.ts +3 -0
  231. package/dist/types/core/src/premades/reseat-attachments.d.ts +31 -0
  232. package/dist/types/core/src/premades/rig-builder.d.ts +51 -0
  233. package/dist/types/core/src/premades/rodent-bake.d.ts +2 -0
  234. package/dist/types/core/src/premades/scorpion-bake.d.ts +2 -0
  235. package/dist/types/core/src/premades/shark-bake.d.ts +2 -0
  236. package/dist/types/core/src/premades/sitter-bake.d.ts +3 -0
  237. package/dist/types/core/src/premades/skeleton-bakes.d.ts +4 -0
  238. package/dist/types/core/src/premades/snake-bake.d.ts +2 -0
  239. package/dist/types/core/src/premades/spider-bake.d.ts +2 -0
  240. package/dist/types/core/src/premades/stamps-box.d.ts +9 -0
  241. package/dist/types/core/src/premades/style-for-bone.d.ts +7 -0
  242. package/dist/types/core/src/premades/swap-slot.d.ts +13 -0
  243. package/dist/types/core/src/premades/template-catalog.d.ts +20 -0
  244. package/dist/types/core/src/premades/template-color.d.ts +9 -0
  245. package/dist/types/core/src/premades/turtle-bake.d.ts +2 -0
  246. package/dist/types/core/src/premades/variants/aquatic-variants.d.ts +16 -0
  247. package/dist/types/core/src/premades/variants/coat-variants.d.ts +7 -0
  248. package/dist/types/core/src/premades/variants/ear-variants.d.ts +8 -0
  249. package/dist/types/core/src/premades/variants/fantasy-more-variants.d.ts +3 -0
  250. package/dist/types/core/src/premades/variants/fantasy-variants.d.ts +17 -0
  251. package/dist/types/core/src/premades/variants/head-variants.d.ts +9 -0
  252. package/dist/types/core/src/premades/variants/horn-variants.d.ts +7 -0
  253. package/dist/types/core/src/premades/variants/index.d.ts +10 -0
  254. package/dist/types/core/src/premades/variants/land-variants.d.ts +3 -0
  255. package/dist/types/core/src/premades/variants/leg-variants.d.ts +7 -0
  256. package/dist/types/core/src/premades/variants/part-variant.d.ts +14 -0
  257. package/dist/types/core/src/premades/variants/tail-variants.d.ts +6 -0
  258. package/dist/types/core/src/premades/variants/variant-authoring.d.ts +29 -0
  259. package/dist/types/core/src/premades/whale-bake.d.ts +2 -0
  260. package/dist/types/core/src/premades/wing-defaults.d.ts +4 -0
  261. package/dist/types/core/src/premades/wing-frame.d.ts +10 -0
  262. package/dist/types/core/src/premades/wolf-bake.d.ts +2 -0
  263. package/dist/types/core/src/premades/worm-bake.d.ts +2 -0
  264. package/dist/types/evaluator/src/abi.d.ts +64 -0
  265. package/dist/types/evaluator/src/chunks.d.ts +53 -0
  266. package/dist/types/evaluator/src/index.d.ts +11 -0
  267. package/dist/types/evaluator/src/prep/colors.d.ts +11 -0
  268. package/dist/types/evaluator/src/prep/mat3.d.ts +13 -0
  269. package/dist/types/evaluator/src/prep/pack.d.ts +23 -0
  270. package/dist/types/evaluator/src/prep/props.d.ts +16 -0
  271. package/dist/types/evaluator/src/prep/symmetry.d.ts +23 -0
  272. package/dist/types/evaluator/src/reference/core.d.ts +3 -0
  273. package/dist/types/evaluator/src/reference/mesher.d.ts +22 -0
  274. package/dist/types/evaluator/src/reference/skin.d.ts +8 -0
  275. package/dist/types/evaluator/src/session.d.ts +21 -0
  276. package/dist/types/evaluator/src/wasm/core.d.ts +9 -0
  277. package/dist/types/evaluator/src/worker/client.d.ts +28 -0
  278. package/dist/types/evaluator/src/worker/host.d.ts +8 -0
  279. package/dist/types/evaluator/src/worker/protocol.d.ts +39 -0
  280. package/dist/types/evaluator/src/worker/spawn.d.ts +6 -0
  281. package/dist/types/evaluator/src/worker/worker-inline.d.ts +1 -0
  282. package/dist/types/evaluator/src/worker/worker.d.ts +1 -0
  283. package/dist/types/module/src/index.d.ts +2 -0
  284. package/dist/types/module/src/ui/atoms/action-button.d.ts +10 -0
  285. package/dist/types/module/src/ui/atoms/badge.d.ts +9 -0
  286. package/dist/types/module/src/ui/atoms/checkbox.d.ts +6 -0
  287. package/dist/types/module/src/ui/atoms/color-input.d.ts +10 -0
  288. package/dist/types/module/src/ui/atoms/hex-chip.d.ts +5 -0
  289. package/dist/types/module/src/ui/atoms/icon-button.d.ts +14 -0
  290. package/dist/types/module/src/ui/atoms/icon.d.ts +8 -0
  291. package/dist/types/module/src/ui/atoms/kbd.d.ts +4 -0
  292. package/dist/types/module/src/ui/atoms/match-button.d.ts +10 -0
  293. package/dist/types/module/src/ui/atoms/number-input.d.ts +11 -0
  294. package/dist/types/module/src/ui/atoms/pill-button.d.ts +11 -0
  295. package/dist/types/module/src/ui/atoms/range-input.d.ts +17 -0
  296. package/dist/types/module/src/ui/atoms/select-input.d.ts +12 -0
  297. package/dist/types/module/src/ui/atoms/separator.d.ts +2 -0
  298. package/dist/types/module/src/ui/atoms/side-button.d.ts +13 -0
  299. package/dist/types/module/src/ui/atoms/swatch.d.ts +13 -0
  300. package/dist/types/module/src/ui/atoms/tool-button.d.ts +22 -0
  301. package/dist/types/module/src/ui/hooks/editor-actions.d.ts +50 -0
  302. package/dist/types/module/src/ui/hooks/editor-context.d.ts +37 -0
  303. package/dist/types/module/src/ui/hooks/use-compact.d.ts +2 -0
  304. package/dist/types/module/src/ui/hooks/use-editor-controller.d.ts +17 -0
  305. package/dist/types/module/src/ui/hooks/use-keyboard.d.ts +11 -0
  306. package/dist/types/module/src/ui/lib/catalog.d.ts +76 -0
  307. package/dist/types/module/src/ui/lib/colors.d.ts +15 -0
  308. package/dist/types/module/src/ui/lib/decals.d.ts +6 -0
  309. package/dist/types/module/src/ui/lib/design-geometry.d.ts +60 -0
  310. package/dist/types/module/src/ui/lib/math.d.ts +18 -0
  311. package/dist/types/module/src/ui/lib/placement.d.ts +8 -0
  312. package/dist/types/module/src/ui/lib/scene.d.ts +51 -0
  313. package/dist/types/module/src/ui/lib/symmetry.d.ts +5 -0
  314. package/dist/types/module/src/ui/lib/targets.d.ts +28 -0
  315. package/dist/types/module/src/ui/lib/view-state.d.ts +74 -0
  316. package/dist/types/module/src/ui/molecules/axis-pill.d.ts +7 -0
  317. package/dist/types/module/src/ui/molecules/color-field.d.ts +14 -0
  318. package/dist/types/module/src/ui/molecules/count-stepper.d.ts +9 -0
  319. package/dist/types/module/src/ui/molecules/floating-panel.d.ts +26 -0
  320. package/dist/types/module/src/ui/molecules/help-row.d.ts +8 -0
  321. package/dist/types/module/src/ui/molecules/inline-edit.d.ts +9 -0
  322. package/dist/types/module/src/ui/molecules/list-row.d.ts +25 -0
  323. package/dist/types/module/src/ui/molecules/modal.d.ts +11 -0
  324. package/dist/types/module/src/ui/molecules/mode-pill.d.ts +7 -0
  325. package/dist/types/module/src/ui/molecules/scroll-row.d.ts +10 -0
  326. package/dist/types/module/src/ui/molecules/slider-row.d.ts +16 -0
  327. package/dist/types/module/src/ui/molecules/swatch-row.d.ts +11 -0
  328. package/dist/types/module/src/ui/molecules/tab-bar.d.ts +9 -0
  329. package/dist/types/module/src/ui/molecules/toolbar-pill.d.ts +7 -0
  330. package/dist/types/module/src/ui/molecules/toolbar.d.ts +10 -0
  331. package/dist/types/module/src/ui/molecules/vec3-field.d.ts +10 -0
  332. package/dist/types/module/src/ui/organisms/bone-panel.d.ts +2 -0
  333. package/dist/types/module/src/ui/organisms/bone-size-sliders.d.ts +9 -0
  334. package/dist/types/module/src/ui/organisms/category-bar.d.ts +2 -0
  335. package/dist/types/module/src/ui/organisms/decal-bar.d.ts +2 -0
  336. package/dist/types/module/src/ui/organisms/decal-editor.d.ts +2 -0
  337. package/dist/types/module/src/ui/organisms/fleck-style-tab.d.ts +7 -0
  338. package/dist/types/module/src/ui/organisms/git-sync-panel.d.ts +10 -0
  339. package/dist/types/module/src/ui/organisms/help-panel.d.ts +2 -0
  340. package/dist/types/module/src/ui/organisms/material-tab.d.ts +3 -0
  341. package/dist/types/module/src/ui/organisms/object-list-panel.d.ts +2 -0
  342. package/dist/types/module/src/ui/organisms/palette-panel.d.ts +2 -0
  343. package/dist/types/module/src/ui/organisms/parts-tab.d.ts +26 -0
  344. package/dist/types/module/src/ui/organisms/pattern-tab.d.ts +3 -0
  345. package/dist/types/module/src/ui/organisms/pose-tab.d.ts +8 -0
  346. package/dist/types/module/src/ui/organisms/premade-picker.d.ts +2 -0
  347. package/dist/types/module/src/ui/organisms/properties-panel.d.ts +2 -0
  348. package/dist/types/module/src/ui/organisms/region-blends.d.ts +5 -0
  349. package/dist/types/module/src/ui/organisms/rendering-bar.d.ts +5 -0
  350. package/dist/types/module/src/ui/organisms/rig-bar.d.ts +2 -0
  351. package/dist/types/module/src/ui/organisms/scenes-modal.d.ts +2 -0
  352. package/dist/types/module/src/ui/organisms/select-hint.d.ts +2 -0
  353. package/dist/types/module/src/ui/organisms/shape-list-panel.d.ts +2 -0
  354. package/dist/types/module/src/ui/organisms/side-dock.d.ts +4 -0
  355. package/dist/types/module/src/ui/organisms/stamp-bar.d.ts +2 -0
  356. package/dist/types/module/src/ui/organisms/stamp-props-panel.d.ts +2 -0
  357. package/dist/types/module/src/ui/organisms/stamp-size-panel.d.ts +4 -0
  358. package/dist/types/module/src/ui/organisms/stats-badge.d.ts +2 -0
  359. package/dist/types/module/src/ui/organisms/style-bar.d.ts +2 -0
  360. package/dist/types/module/src/ui/organisms/symmetry-bar.d.ts +2 -0
  361. package/dist/types/module/src/ui/organisms/toast.d.ts +2 -0
  362. package/dist/types/module/src/ui/organisms/token-guide.d.ts +5 -0
  363. package/dist/types/module/src/ui/organisms/touch-mods.d.ts +2 -0
  364. package/dist/types/module/src/ui/organisms/transform-bar.d.ts +2 -0
  365. package/dist/types/module/src/ui/organisms/transform-tab.d.ts +2 -0
  366. package/dist/types/module/src/ui/organisms/utilities-bar.d.ts +2 -0
  367. package/dist/types/module/src/ui/organisms/viewport-host.d.ts +2 -0
  368. package/dist/types/module/src/ui/organisms/voxel-panel.d.ts +2 -0
  369. package/dist/types/module/src/ui/organisms/wing-tab.d.ts +10 -0
  370. package/dist/types/module/src/ui/pages/editor-page.d.ts +9 -0
  371. package/dist/types/module/src/ui/templates/editor-shell.d.ts +2 -0
  372. package/dist/types/studio/src/browser-files.d.ts +3 -0
  373. package/dist/types/studio/src/clock.d.ts +2 -0
  374. package/dist/types/studio/src/creation-file.d.ts +21 -0
  375. package/dist/types/studio/src/git-remote.d.ts +36 -0
  376. package/dist/types/studio/src/git-sync.d.ts +33 -0
  377. package/dist/types/studio/src/ids.d.ts +3 -0
  378. package/dist/types/studio/src/index.d.ts +15 -0
  379. package/dist/types/studio/src/indexed-db-library.d.ts +2 -0
  380. package/dist/types/studio/src/library-persistence.d.ts +29 -0
  381. package/dist/types/studio/src/library-sync.d.ts +29 -0
  382. package/dist/types/studio/src/preferences.d.ts +9 -0
  383. package/dist/types/studio/src/seed.d.ts +3 -0
  384. package/dist/types/studio/src/studio.d.ts +17 -0
  385. package/dist/types/viewport/src/create-viewport.d.ts +10 -0
  386. package/dist/types/viewport/src/decals/builtin-art.d.ts +19 -0
  387. package/dist/types/viewport/src/decals/builtin-docs.d.ts +7 -0
  388. package/dist/types/viewport/src/decals/decal-atlas.d.ts +37 -0
  389. package/dist/types/viewport/src/decals/decal-catalog.d.ts +17 -0
  390. package/dist/types/viewport/src/decals/decal-glsl.d.ts +2 -0
  391. package/dist/types/viewport/src/decals/decal-limits.d.ts +11 -0
  392. package/dist/types/viewport/src/decals/decal-uniforms.d.ts +40 -0
  393. package/dist/types/viewport/src/decals/design-raster.d.ts +8 -0
  394. package/dist/types/viewport/src/decals/interior-thumbs.d.ts +6 -0
  395. package/dist/types/viewport/src/index.d.ts +1 -0
  396. package/dist/types/viewport/src/interaction/bone-tool.d.ts +13 -0
  397. package/dist/types/viewport/src/interaction/bones-visible.d.ts +7 -0
  398. package/dist/types/viewport/src/interaction/cursor.d.ts +3 -0
  399. package/dist/types/viewport/src/interaction/decal-tool.d.ts +18 -0
  400. package/dist/types/viewport/src/interaction/esc-hold.d.ts +13 -0
  401. package/dist/types/viewport/src/interaction/ghost-geometry.d.ts +6 -0
  402. package/dist/types/viewport/src/interaction/gizmo.d.ts +34 -0
  403. package/dist/types/viewport/src/interaction/interaction-context.d.ts +41 -0
  404. package/dist/types/viewport/src/interaction/marquee.d.ts +8 -0
  405. package/dist/types/viewport/src/interaction/pivot-helper.d.ts +13 -0
  406. package/dist/types/viewport/src/interaction/select-tool.d.ts +30 -0
  407. package/dist/types/viewport/src/interaction/selection-boxes.d.ts +11 -0
  408. package/dist/types/viewport/src/interaction/stamp-tool.d.ts +41 -0
  409. package/dist/types/viewport/src/interaction/stamp-wires.d.ts +18 -0
  410. package/dist/types/viewport/src/interaction/surface-hit.d.ts +14 -0
  411. package/dist/types/viewport/src/materials/fleck-material.d.ts +69 -0
  412. package/dist/types/viewport/src/materials/global-uniforms.d.ts +15 -0
  413. package/dist/types/viewport/src/materials/skin.d.ts +18 -0
  414. package/dist/types/viewport/src/materials/wing-material.d.ts +21 -0
  415. package/dist/types/viewport/src/math/colors.d.ts +29 -0
  416. package/dist/types/viewport/src/math/convert.d.ts +15 -0
  417. package/dist/types/viewport/src/math/decal-pose.d.ts +7 -0
  418. package/dist/types/viewport/src/math/lod.d.ts +16 -0
  419. package/dist/types/viewport/src/math/picking.d.ts +32 -0
  420. package/dist/types/viewport/src/math/pixel-palette.d.ts +15 -0
  421. package/dist/types/viewport/src/math/screen.d.ts +26 -0
  422. package/dist/types/viewport/src/math/skeleton-math.d.ts +32 -0
  423. package/dist/types/viewport/src/math/smear.d.ts +20 -0
  424. package/dist/types/viewport/src/math/symmetry.d.ts +21 -0
  425. package/dist/types/viewport/src/objects/default-look.d.ts +3 -0
  426. package/dist/types/viewport/src/objects/mesh-driver.d.ts +26 -0
  427. package/dist/types/viewport/src/objects/mesh-key.d.ts +8 -0
  428. package/dist/types/viewport/src/objects/rig-view.d.ts +31 -0
  429. package/dist/types/viewport/src/objects/scene-views.d.ts +53 -0
  430. package/dist/types/viewport/src/objects/sculpt-view.d.ts +66 -0
  431. package/dist/types/viewport/src/objects/view-context.d.ts +19 -0
  432. package/dist/types/viewport/src/objects/wing-view.d.ts +27 -0
  433. package/dist/types/viewport/src/rig/bone-viz.d.ts +13 -0
  434. package/dist/types/viewport/src/scene/camera-motion.d.ts +10 -0
  435. package/dist/types/viewport/src/scene/camera-sun.d.ts +3 -0
  436. package/dist/types/viewport/src/scene/environment.d.ts +3 -0
  437. package/dist/types/viewport/src/scene/frame-camera.d.ts +10 -0
  438. package/dist/types/viewport/src/scene/play-mode.d.ts +9 -0
  439. package/dist/types/viewport/src/scene/render-pipeline.d.ts +26 -0
  440. package/dist/types/viewport/src/scene/render-settings.d.ts +18 -0
  441. package/dist/types/viewport/src/scene/resolve-frag.d.ts +3 -0
  442. package/dist/types/viewport/src/scene/stage.d.ts +38 -0
  443. package/dist/types/viewport/src/scene/stress-test.d.ts +6 -0
  444. package/dist/types/viewport/src/wings/wing-mesh.d.ts +19 -0
  445. package/dist/types/viewport/src/wings/wing-outlines.d.ts +32 -0
  446. package/dist/types/viewport/src/wings/wing-pattern.d.ts +7 -0
  447. package/dist/viewport.d.ts +1 -0
  448. package/dist/viewport.js +8 -0
  449. package/dist/viewport.js.map +7 -0
  450. package/package.json +74 -4
@@ -0,0 +1,32 @@
1
+ import type { Bone, Id, Vec3 } from "../../../api/src/index.js";
2
+ import { Matrix4, Vector3 } from "three";
3
+ /** 64 mat4 per array (uBones, uSeg): the shader's uniform budget. */
4
+ export declare const MAX_BONES = 64;
5
+ export type RigMatrices = {
6
+ /** Bone id → slot in the GPU arrays (rig order, at most 64). */
7
+ readonly index: ReadonlyMap<Id, number>;
8
+ readonly bindGlobal: readonly Matrix4[];
9
+ /** The displayed pose (the bind pose itself in rig mode or while a part is sculpted). */
10
+ readonly shownGlobal: readonly Matrix4[];
11
+ readonly heads: readonly Vector3[];
12
+ };
13
+ export declare const identityArray: <T extends Float32Array<ArrayBufferLike>>(out: T) => T;
14
+ export declare function rigMatrices(allBones: readonly Bone[], showPose: boolean): RigMatrices;
15
+ /** Children of each bone (slots), in rig order. */
16
+ export declare function childSlots(bones: readonly Bone[], index: ReadonlyMap<Id, number>): number[][];
17
+ /** Skinned body: FinalMatrix = shown global × inverse bind, per slot. */
18
+ export declare function writeSkinMatrices(m: RigMatrices, out: Float32Array): void;
19
+ /**
20
+ * Rigid body parts (the POC's Skeleton.updateSegments): one matrix per bone that aims the part at its primary
21
+ * child (longest bind segment), stretches it along the bone and scales its thickness across. No blending, so
22
+ * nothing twists or shears. Identity when shown = bind and the bone has no size; a bone's size (length, thickness)
23
+ * scales its part on top: its child joints already sit `length` times farther, so the part stretches to meet them.
24
+ */
25
+ export declare function writeSegmentMatrices(bones: readonly Bone[], m: RigMatrices, out: Float32Array): void;
26
+ /** Auto-weight input (evaluator.skinWeights): per bone its bind head and each child's head. */
27
+ export declare function skinBones(bones: readonly Bone[], m: RigMatrices): {
28
+ head: Vec3;
29
+ childHeads: Vec3[];
30
+ }[];
31
+ /** World-free local transform of a bone from a target global (gizmo drags): parentGlobal⁻¹ × target. */
32
+ export declare function localFromGlobal(parentGlobal: Matrix4 | undefined, target: Matrix4): Matrix4;
@@ -0,0 +1,20 @@
1
+ /** Smear stroke spacing (the POC's input.js): dabs every 0.4 × stamp size, at most 24 per pointer move. */
2
+ export declare const SMEAR_SPACING_FACTOR = 0.4;
3
+ export declare const SMEAR_MAX_DABS_PER_MOVE = 24;
4
+ export type P3 = {
5
+ readonly x: number;
6
+ readonly y: number;
7
+ readonly z: number;
8
+ };
9
+ export declare const smearSpacing: (size: number) => number;
10
+ /**
11
+ * Dab points for one pointer move from the last dab to the cursor: evenly spaced on the segment, ending on the
12
+ * cursor. Empty while the cursor is closer than one spacing (the stroke waits).
13
+ */
14
+ export declare function smearDabs(last: P3, target: P3, size: number): P3[];
15
+ /** A small brush gets a proportionally small blend so dabs don't melt into one blob (local size × 0.5). */
16
+ export declare const smearBlend: (sculptBlend: number, localSize: {
17
+ x: number;
18
+ y: number;
19
+ z: number;
20
+ }) => number;
@@ -0,0 +1,21 @@
1
+ import type { Pivot, Symmetry, SymmetryAxis } from "../../../api/src/index.js";
2
+ import { Matrix4, Quaternion, Vector3 } from "three";
3
+ /**
4
+ * Kaleidoscope instances (the POC's symmetry.js). The viewport only previews copies (ghost brush, selected
5
+ * shape wires); the evaluator bakes them. Copy k is the source rotated k · 360 / N about each axis
6
+ * (composed X, Y, Z); N = 2 on an axis mirrors across that axis' plane.
7
+ */
8
+ export declare const SYM_MAX_N = 12;
9
+ export declare const SYM_MAX_INSTANCES = 128;
10
+ export declare const symAxesOf: (axes: readonly SymmetryAxis[] | undefined) => SymmetryAxis[];
11
+ /** N clamped to 1–12 and to N^(#axes) ≤ 128. */
12
+ export declare function symClampN(n: number, axes: readonly SymmetryAxis[] | undefined): number;
13
+ /** Every non-identity linear part of the symmetry group (read-only, cached). */
14
+ export declare function symInstanceMatrices(n: number, axes: readonly SymmetryAxis[] | undefined): readonly Matrix4[];
15
+ export type Placement = {
16
+ position: Vector3;
17
+ quaternion: Quaternion;
18
+ scale: Vector3;
19
+ };
20
+ /** Instance placements of one shape about the sculpt-local pivot (identity excluded). */
21
+ export declare function symInstances(src: Placement, pivot: Pivot, sym: Symmetry | undefined): Placement[];
@@ -0,0 +1,3 @@
1
+ import type { ColorRef, SculptLook } from "../../../api/src/index.js";
2
+ /** The POC's new-sculpt defaults (createNewSculptObject), for view-only sculpts (stress test). */
3
+ export declare const defaultLook: (color: ColorRef) => SculptLook;
@@ -0,0 +1,26 @@
1
+ import type { Evaluator, MeshRequest, MeshResult, Palette, Sculpt, SkinRequest, SkinResult } from "../../../api/src/index.js";
2
+ /**
3
+ * Talks to the evaluator: one request per key (object, part or rig body), newest wins (results of older
4
+ * requests are dropped), identical requests are skipped. The view keeps its last mesh until the new one lands.
5
+ */
6
+ export declare class MeshDriver {
7
+ private readonly evaluator;
8
+ private readonly last;
9
+ private seq;
10
+ private inFlight;
11
+ lastMs: number;
12
+ private disposed;
13
+ constructor(evaluator: Evaluator);
14
+ get busy(): number;
15
+ /** Requests a mesh unless the same content at the same resolution was already requested for this key. */
16
+ mesh(key: string, sculpt: Sculpt, palette: Palette, resolution: number, content: string, done: (r: MeshResult) => void, view?: MeshRequest["view"], viewSig?: string): void;
17
+ /** Auto weights for a skinned body, newest wins like meshes. */
18
+ skin(req: SkinRequest, done: (r: SkinResult) => void): void;
19
+ /** Forget a key (the object is gone): pending work is dropped. */
20
+ forget(key: string): void;
21
+ /** Force the next request of a key through (e.g. after a resolution change). */
22
+ invalidate(key: string): void;
23
+ dispose(): void;
24
+ /** Drop pending results but stay usable (the viewport can be mounted again after dispose). */
25
+ reset(): void;
26
+ }
@@ -0,0 +1,8 @@
1
+ import type { ColorRef, Palette, Sculpt } from "../../../api/src/index.js";
2
+ /** Palette refs a sculpt's mesh colors depend on (stamps, smear groups, the look's color and foundation). */
3
+ export declare function meshColorRefs(s: Sculpt): ColorRef[];
4
+ /**
5
+ * Everything the mesh depends on, as a string: stamps, smear groups, pivot (symmetry copies), the look's colors /
6
+ * material / blend, and the palette colors it uses. Decals, flecks and patterns are shader-only: no remesh.
7
+ */
8
+ export declare function meshContentKey(s: Sculpt, palette: Palette): string;
@@ -0,0 +1,31 @@
1
+ import type { Id, Rig } from "../../../api/src/index.js";
2
+ import { Group } from "three";
3
+ import { type RigMatrices } from "../math/skeleton-math.js";
4
+ import { type SkinUniforms } from "../materials/skin.js";
5
+ import { SculptView } from "./sculpt-view.js";
6
+ import type { ViewContext } from "./view-context.js";
7
+ import { WingView } from "./wing-view.js";
8
+ export declare const partKey: (objectId: Id, boneId: Id) => string;
9
+ export declare const bodyKey: (objectId: Id) => string;
10
+ /**
11
+ * A rig on screen: its skeleton's GPU matrices (uBones for the skinned body, uSeg for rigid parts), its body
12
+ * parts (sculpts or flat wings, in the rig's bind space) and its own skinned body. The group is rig space.
13
+ */
14
+ export declare class RigView {
15
+ readonly id: Id;
16
+ private readonly ctx;
17
+ readonly group: Group<import("three").Object3DEventMap>;
18
+ readonly skin: SkinUniforms;
19
+ readonly parts: Map<string, SculptView | WingView>;
20
+ body: SculptView | null;
21
+ rig: Rig | null;
22
+ matrices: RigMatrices | null;
23
+ private bonesKey;
24
+ constructor(id: Id, ctx: ViewContext);
25
+ /** `showPose`: pose mode and not held at bind (a part of this rig is being sculpted). */
26
+ set(rig: Rig, showPose: boolean): void;
27
+ private autoSkinning;
28
+ /** Every sculpt view of the rig (body first, then sculpt parts). */
29
+ sculptViews(): SculptView[];
30
+ dispose(): void;
31
+ }
@@ -0,0 +1,53 @@
1
+ import type { Creation, Id, SceneObject, SculptTarget, Vec3 as Vec3Like } from "../../../api/src/index.js";
2
+ import { Box3, Vector3, type Group, type Object3D } from "three";
3
+ import { RigView } from "./rig-view.js";
4
+ import { SculptView } from "./sculpt-view.js";
5
+ import type { ViewContext } from "./view-context.js";
6
+ import { WingView } from "./wing-view.js";
7
+ export type ObjectView = {
8
+ readonly object: SceneObject;
9
+ readonly view: SculptView | RigView;
10
+ };
11
+ /** What a picked mesh belongs to. */
12
+ export type MeshOwner = {
13
+ readonly objectId: Id;
14
+ readonly boneId?: Id;
15
+ readonly view: SculptView | WingView;
16
+ };
17
+ export declare const targetKey: (t: SculptTarget) => string;
18
+ /**
19
+ * Keeps one view per scene object in step with the creation (plus view-only objects: the stress test). Objects nest
20
+ * like the creation's tree; rig parts and bodies live in their rig's group.
21
+ */
22
+ export declare class SceneViews {
23
+ private readonly root;
24
+ private readonly ctx;
25
+ readonly views: Map<string, ObjectView>;
26
+ constructor(root: Group, ctx: ViewContext);
27
+ /** `heldRigId`: the rig whose part / body is being sculpted shows its bind pose. */
28
+ sync(creation: Creation, extra: readonly SceneObject[], heldRigId: Id | undefined): void;
29
+ /** Refresh everything against a new palette (looks, decals, meshes). */
30
+ refreshPalette(): void;
31
+ sculptView(t: SculptTarget): SculptView | undefined;
32
+ group(id: Id): Group | undefined;
33
+ /** Union of an object's meshed sculpt bounds (its own sculpt, or a rig's body and sculpt parts), in object space. */
34
+ contentBounds(id: Id): {
35
+ center: Vec3Like;
36
+ halfSize: Vec3Like;
37
+ } | undefined;
38
+ /**
39
+ * Objects' bounds in world space as drawn: sculpts by their meshes, a rig's rigid parts and wings through their
40
+ * bones' segment matrices (so a pose moves them), its skinned body by its bind bounds. Empty until something has
41
+ * meshed.
42
+ */
43
+ worldBounds(ids: readonly Id[]): Box3;
44
+ /** Up to `max` points of objects' drawn surfaces in world space (mesh vertices, posed as the bounds are). */
45
+ worldPoints(ids: readonly Id[], max?: number): Vector3[];
46
+ allSculptViews(): SculptView[];
47
+ allWingViews(): WingView[];
48
+ /** Meshes that can be clicked (optionally only those of some objects). */
49
+ pickables(only?: ReadonlySet<Id>): Object3D[];
50
+ ownerOf(mesh: Object3D): MeshOwner | undefined;
51
+ triangles(): number;
52
+ dispose(): void;
53
+ }
@@ -0,0 +1,66 @@
1
+ import type { Decal, MeshRequest, Sculpt } from "../../../api/src/index.js";
2
+ import { Box3, BufferGeometry, Group, Mesh, type MeshStandardMaterial, Vector3 } from "three";
3
+ import { type DecalUniforms } from "../decals/decal-uniforms.js";
4
+ import { type FleckUniforms } from "../materials/fleck-material.js";
5
+ import { type SkinUniforms } from "../materials/skin.js";
6
+ import type { ViewContext } from "./view-context.js";
7
+ /** How a sculpt's vertices follow a rig: not at all, rigidly with one bone (a part), or by auto weights (a body). */
8
+ export type Skinning = {
9
+ readonly kind: "none";
10
+ } | {
11
+ readonly kind: "rigid";
12
+ readonly slot: number;
13
+ } | {
14
+ readonly kind: "auto";
15
+ readonly version: string;
16
+ readonly weights: (positions: Float32Array, done: (idx: Float32Array, wt: Float32Array) => void) => void;
17
+ };
18
+ /**
19
+ * One sculpt on screen (a sculpt object, a rig's body or a sculpt body part): the mesh from the evaluator with the
20
+ * fleck material, its decals and its LOD. The group is the sculpt's local (bind) space.
21
+ */
22
+ export declare class SculptView {
23
+ readonly key: string;
24
+ private readonly ctx;
25
+ private readonly skin;
26
+ private skinning;
27
+ readonly group: Group<import("three").Object3DEventMap>;
28
+ readonly mesh: Mesh<BufferGeometry, MeshStandardMaterial>;
29
+ readonly fleck: FleckUniforms;
30
+ readonly decal: DecalUniforms;
31
+ sculpt: Sculpt | null;
32
+ /** Shown instead of `sculpt` while a drag previews (gizmo, smear). */
33
+ private preview;
34
+ private dropPreview;
35
+ bounds: Box3 | null;
36
+ private view;
37
+ private viewSig;
38
+ resolution: number;
39
+ private decalKey;
40
+ private lookKey;
41
+ /** The bone slot a rigid part follows (its segment matrix), if it's one. */
42
+ get rigidSlot(): number | undefined;
43
+ constructor(key: string, ctx: ViewContext, skin: SkinUniforms, skinning: Skinning);
44
+ /** The sculpt shown now (the drag preview while there is one). */
45
+ get shown(): Sculpt | null;
46
+ setSkinning(s: Skinning): void;
47
+ set(sculpt: Sculpt): void;
48
+ /** A committed drag: keep showing the preview until the creation that includes it arrives (no flicker). */
49
+ clearPreviewOnNextSet(): void;
50
+ setPreview(sculpt: Sculpt | null): void;
51
+ /** Re-applies look, decals and (if needed) the mesh against the current palette. */
52
+ refresh(): void;
53
+ /** Chunked LOD view for a large standalone sculpt (camera in sculpt space, quantized signature). */
54
+ setView(view: MeshRequest["view"] | undefined, sig: string): void;
55
+ setResolution(res: number): void;
56
+ private remesh;
57
+ private install;
58
+ private applyLook;
59
+ /** Decals never remesh: they are uniforms over the mesh. */
60
+ applyDecals(decals: readonly Decal[], force?: boolean): void;
61
+ setGrayscale(v: number): void;
62
+ /** Interior rooms need the camera in this sculpt's space. */
63
+ updateLocalCamera(cameraWorld: Vector3): void;
64
+ triangles(): number;
65
+ dispose(): void;
66
+ }
@@ -0,0 +1,19 @@
1
+ import type { Palette } from "../../../api/src/index.js";
2
+ import type { Texture } from "three";
3
+ import type { DecalAtlas } from "../decals/decal-atlas.js";
4
+ import type { GlobalUniforms } from "../materials/global-uniforms.js";
5
+ import type { MeshDriver } from "./mesh-driver.js";
6
+ /** What every object view shares within one viewport. */
7
+ export type ViewContext = {
8
+ readonly globals: GlobalUniforms;
9
+ readonly atlas: DecalAtlas;
10
+ readonly driver: MeshDriver;
11
+ readonly env: Texture | null;
12
+ palette: Palette;
13
+ /** LOD levels from the base voxel resolution, finest first. */
14
+ levels: readonly number[];
15
+ /** Mesh arrived / geometry changed (triangle count, picking caches). */
16
+ changed(): void;
17
+ /** A user-facing warning (e.g. the kaleidoscope cap dropped copies). */
18
+ warn(message: string): void;
19
+ };
@@ -0,0 +1,27 @@
1
+ import type { FlatWing, Material } from "../../../api/src/index.js";
2
+ import { BufferGeometry, Group, Mesh, type MeshStandardMaterial } from "three";
3
+ import { type SkinUniforms } from "../materials/skin.js";
4
+ import { type WingUniforms } from "../materials/wing-material.js";
5
+ import type { ViewContext } from "./view-context.js";
6
+ /** A flat wing body part: outline triangulated in its frame, pattern painted on a canvas, rigid to its bone. */
7
+ export declare class WingView {
8
+ readonly key: string;
9
+ private readonly ctx;
10
+ private slot;
11
+ readonly group: Group<import("three").Object3DEventMap>;
12
+ readonly mesh: Mesh<BufferGeometry, MeshStandardMaterial>;
13
+ /** Contour line, pixel art only: keeps a wing seen edge-on a continuous stroke instead of scattered pixels. */
14
+ private readonly edge;
15
+ readonly uniforms: WingUniforms;
16
+ private readonly canvas;
17
+ private readonly texture;
18
+ private texKey;
19
+ private geoKey;
20
+ /** The bone slot the wing follows (its segment matrix). */
21
+ get segmentSlot(): number;
22
+ constructor(key: string, ctx: ViewContext, skin: SkinUniforms, slot: number);
23
+ set(wing: FlatWing, material: Material, slot: number): void;
24
+ setGrayscale(v: number): void;
25
+ triangles(): number;
26
+ dispose(): void;
27
+ }
@@ -0,0 +1,13 @@
1
+ import type { Id } from "../../../api/src/index.js";
2
+ import { Group, type Matrix4 } from "three";
3
+ import { type RigMatrices } from "../math/skeleton-math.js";
4
+ import type { Bone } from "../../../api/src/index.js";
5
+ /** Bone overlay of one rig (the POC's skeleton viz): segments parent → child and a dot per joint, drawn on top. */
6
+ export declare class BoneViz {
7
+ readonly root: Group<import("three").Object3DEventMap>;
8
+ private readonly line;
9
+ private readonly points;
10
+ constructor();
11
+ update(rigWorld: Matrix4, bones: readonly Bone[], m: RigMatrices, rigMode: boolean, selected: Id | undefined): void;
12
+ dispose(): void;
13
+ }
@@ -0,0 +1,10 @@
1
+ import { Vector3 } from "three";
2
+ import type { Stage } from "./stage.js";
3
+ /** WASD / arrow keys slide the camera and its orbit target over the floor plane (12 units / s). */
4
+ export declare function moveCameraOnFloor(stage: Stage, keys: ReadonlySet<string>, delta: number): void;
5
+ /** Double-click focus: eases the orbit target to a point in 280 ms, keeping the view direction and distance. */
6
+ export declare class CameraTween {
7
+ private tween;
8
+ focus(stage: Stage, to: Vector3): void;
9
+ update(stage: Stage): void;
10
+ }
@@ -0,0 +1,3 @@
1
+ import { type Stage } from "./stage.js";
2
+ /** Camera sun: the sun sits top-front-left of the view and aims at the orbit target; off = the fixed world sun. */
3
+ export declare function updateCameraSun(stage: Stage, on: boolean): void;
@@ -0,0 +1,3 @@
1
+ import { type Texture, type WebGLRenderer } from "three";
2
+ /** One-off PMREM environment for the sculpt materials: gradient sky over a green ground (the POC's scene.js). */
3
+ export declare function createSculptEnvironment(renderer: WebGLRenderer): Texture;
@@ -0,0 +1,10 @@
1
+ import type { FrameOptions } from "../../../api/src/index.js";
2
+ import { Vector3, type Box3 } from "three";
3
+ import type { Stage } from "./stage.js";
4
+ /**
5
+ * Fits objects in the view like CSS `object-fit: contain`, in 3D. The camera keeps its angle (or takes `direction`)
6
+ * and moves so the silhouette of `points` exactly fills, on its limiting side, a centred area of `aspect` (as large as
7
+ * the view allows, less the padding), centred in it. Starts from the bounding box and refines on the points' actual
8
+ * projection (perspective makes the box loose), a few rounds.
9
+ */
10
+ export declare function frameContain(stage: Stage, box: Box3, points: readonly Vector3[], options?: FrameOptions): void;
@@ -0,0 +1,9 @@
1
+ import type { Stage } from "./stage.js";
2
+ /** Play mode: a ball the player rolls with WASD and Space over the floor; the camera follows. Writes nothing. */
3
+ export declare class PlayMode {
4
+ private ball;
5
+ private readonly velocity;
6
+ get active(): boolean;
7
+ set(stage: Stage, on: boolean): void;
8
+ update(stage: Stage, keys: ReadonlySet<string>): void;
9
+ }
@@ -0,0 +1,26 @@
1
+ import type { Palette, ViewPreferences } from "../../../api/src/index.js";
2
+ import { Object3D } from "three";
3
+ import type { GlobalUniforms } from "../materials/global-uniforms.js";
4
+ import { type Stage } from "./stage.js";
5
+ /**
6
+ * Normal rendering at screen resolution with nothing special on is a plain render. Anything else (the POC's
7
+ * renderPost): the world into an offscreen target of the chosen size (linear, with depth and a "kind" in alpha),
8
+ * a full-screen resolve to the canvas, then the editor helpers on top at screen resolution.
9
+ */
10
+ export declare class RenderPipeline {
11
+ private readonly stage;
12
+ private readonly globals;
13
+ private target;
14
+ private targetKey;
15
+ private readonly quadMat;
16
+ private readonly quadScene;
17
+ private readonly quadCam;
18
+ private paletteKey;
19
+ private readonly size;
20
+ constructor(stage: Stage, globals: GlobalUniforms);
21
+ render(prefs: ViewPreferences, palette: Palette, keep: readonly Object3D[] | null, isolated: boolean): void;
22
+ private hideUnselected;
23
+ private ensureTarget;
24
+ private setPalette;
25
+ dispose(): void;
26
+ }
@@ -0,0 +1,18 @@
1
+ import type { ViewPreferences } from "../../../api/src/index.js";
2
+ /** Nominal size each preset fits into; the render keeps the view's aspect ratio inside it. */
3
+ export declare const RENDER_RES: Record<ViewPreferences["renderResolution"], readonly [number, number] | null>;
4
+ /** Filtered; HD and below are nearest neighbour. */
5
+ export declare const RENDER_SMOOTH_RES: readonly ViewPreferences["renderResolution"][];
6
+ export declare const PIXEL_SHADE_BELOW: number;
7
+ /** Only well-lit faces reach the light tone (was 1.55, which lit most of a creature's upper half). */
8
+ export declare const PIXEL_LIGHT_ABOVE: number;
9
+ /** Gloss (1 − roughness) above which the light tone turns teeth-white: only truly shiny surfaces, not every
10
+ * roughness ≤ 0.5 part (the fleck shader clamps roughness to ≥ 0.4, so flecked sculpts keep their palette light). */
11
+ export declare const PIXEL_GLOSS_WHITE = 0.8;
12
+ export declare const PIXEL_DITHER = 0.45;
13
+ export declare const PIXEL_EDGE = 0.02;
14
+ export declare const PIXEL_MAX_PALETTE = 12;
15
+ /** Largest size with the canvas' aspect ratio that fits inside the preset's nominal size. */
16
+ export declare function renderFitSize(res: ViewPreferences["renderResolution"], w: number, h: number): [number, number];
17
+ /** Pixel art has no translucency: coverage (texture alpha × opacity) at or above this draws solid, below it is dropped. */
18
+ export declare const PIXEL_ALPHA_CUT = 0.2;
@@ -0,0 +1,3 @@
1
+ /** Full-screen resolve of the offscreen world pass (the POC's rendering.js): tone mapping + sRGB, or pixel-art
2
+ palette cel shading, dithering and depth outlines; background or a checkerboard behind transparent pixels. */
3
+ export declare const RESOLVE_FRAG = "\nuniform sampler2D tColor;\nuniform sampler2D tDepth;\nuniform vec2 uSize;\nuniform float uNear;\nuniform float uFar;\nuniform float uExposure;\nuniform float uDpr;\nuniform float uPixel;\nuniform float uChecker;\nuniform vec3 uBg;\nuniform int uPalCount;\nuniform vec3 uPalRaw[12];\nuniform vec3 uPalBase[12];\nuniform vec3 uPalLight[12];\nuniform vec3 uPalShade[12];\nuniform vec3 uTeeth;\nuniform vec3 uInk;\nuniform float uEdge;\nuniform float uTone1;\nuniform float uTone2;\nuniform float uDither;\nuniform float uGlossWhite;\nvarying vec2 vUv;\n\n// same curves three.js applies to a material's output on screen\nvec3 RRTAndODTFit(vec3 v) {\n vec3 a = v * (v + 0.0245786) - 0.000090537;\n vec3 b = v * (0.983729 * v + 0.4329510) + 0.238081;\n return a / b;\n}\nvec3 acesFilmic(vec3 color) {\n const mat3 inMat = mat3(vec3(0.59719, 0.07600, 0.02840), vec3(0.35458, 0.90834, 0.13383), vec3(0.04823, 0.01566, 0.83777));\n const mat3 outMat = mat3(vec3(1.60475, -0.10208, -0.00327), vec3(-0.53108, 1.10813, -0.07276), vec3(-0.07367, -0.00605, 1.07602));\n color *= uExposure / 0.6;\n color = inMat * color;\n color = RRTAndODTFit(color);\n color = outMat * color;\n return clamp(color, 0.0, 1.0);\n}\nvec3 toSRGB(vec3 c) {\n return mix(pow(c, vec3(0.41666)) * 1.055 - vec3(0.055), c * 12.92, vec3(lessThanEqual(c, vec3(0.0031308))));\n}\n\nfloat bayer2(vec2 a) { a = floor(a); return fract(a.x / 2.0 + a.y * a.y * 0.75); }\nfloat bayer4(vec2 a) { return bayer2(0.5 * a) * 0.25 + bayer2(a); }\n\nvec2 pixUv(vec2 p) { return (clamp(p, vec2(0.0), uSize - 1.0) + 0.5) / uSize; }\n\n// 1 / view-space depth: planes are linear in it across the screen, so a flat floor seen at a glancing\n// angle gives no edge while a real depth step does\nfloat invZ(vec2 p) {\n float d = texture2D(tDepth, pixUv(p)).r;\n float z = 2.0 * uNear * uFar / (uFar + uNear - (2.0 * d - 1.0) * (uFar - uNear));\n return 1.0 / z;\n}\nfloat kindAt(vec2 p) { return texture2D(tColor, pixUv(p)).a; }\n\n// A pixel is outline when a neighbour (4-connected) is clearly nearer than the surface around it and\n// that nearer neighbour is an object (not the ground): the line sits on the far side, outside the shape.\nbool outlineAt(vec2 p) {\n float w0 = invZ(p);\n for (int i = 0; i < 4; i++) {\n vec2 dir = (i == 0) ? vec2(1.0, 0.0) : ((i == 1) ? vec2(0.0, 1.0) : ((i == 2) ? vec2(-1.0, 0.0) : vec2(0.0, -1.0)));\n float wq = invZ(p + dir);\n float wq2 = invZ(p - dir);\n if (wq + wq2 - 2.0 * w0 > uEdge * max(wq, wq2)) {\n float nearer = (wq >= wq2) ? kindAt(p + dir) : kindAt(p - dir);\n if (nearer > 0.4) return true;\n }\n }\n return false;\n}\n\nvec3 celShade(vec3 c, float gloss, vec2 p) {\n // Pixels from black decals or unlit black surfaces render directly as solid ink\n if (max(c.r, max(c.g, c.b)) < 0.05) return uInk;\n\n vec3 base = vec3(0.0), light = vec3(0.0), shade = vec3(0.0);\n float bestScore = 1e9;\n float bestS = 1.0;\n float cl = length(c) + 0.02;\n for (int i = 0; i < 12; i++) {\n if (i >= uPalCount) break;\n vec3 P = uPalRaw[i];\n float s = clamp(dot(c, P) / max(dot(P, P), 0.0001), 0.2, 4.0);\n float score = length(c - s * P) / cl + 0.12 * abs(log2(s / 1.25));\n if (score < bestScore) {\n bestScore = score; bestS = s;\n base = uPalBase[i]; light = uPalLight[i]; shade = uPalShade[i];\n }\n }\n\n // Black from the palette stays flat: no teeth-white specular, no dithering, no stepping\n if (length(base - uInk) < 0.05 || length(base) < 0.10) return uInk;\n\n if (gloss > uGlossWhite) light = uTeeth; // only shiny materials catch teeth-white light\n float tau = log2(bestS) + (bayer4(p) - 0.47) * uDither;\n if (tau > uTone2) return light;\n if (tau > uTone1) return base;\n return shade;\n}\n\nvoid main() {\n vec2 p = floor(vUv * uSize);\n vec4 s = texture2D(tColor, (uPixel > 0.5) ? (p + 0.5) / uSize : vUv);\n vec3 bg = uBg;\n if (uChecker > 0.5) {\n vec2 g = floor(gl_FragCoord.xy / (9.0 * uDpr));\n bg = (mod(g.x + g.y, 2.0) < 0.5) ? vec3(0.96) : vec3(0.78);\n }\n vec3 col = bg;\n if (uPixel < 0.5) {\n if (s.a > 0.05) col = toSRGB(acesFilmic(s.rgb));\n } else {\n if (s.a > 0.05) {\n // Decal pixel: render flat and clean (no scene light, no shadows, no glossiness)\n // We use a broader threshold to catch blended light/shadow modifier pixels\n if (s.a >= 0.45 && s.a <= 0.50) {\n // Ensure pure black decals stay flat black, others render their flat color\n if (max(s.r, max(s.g, s.b)) < 0.05) col = uInk;\n else col = s.rgb;\n } else {\n float gloss = (s.a < 0.4) ? 0.0 : clamp((1.0 - s.a) * 2.0, 0.0, 1.0);\n col = celShade(s.rgb, gloss, p);\n }\n }\n if (outlineAt(p)) col = uInk;\n }\n gl_FragColor = vec4(col, 1.0);\n}\n";
@@ -0,0 +1,38 @@
1
+ import { DirectionalLight, Group, Mesh, MeshStandardMaterial, PerspectiveCamera, Scene, SphereGeometry, Vector3, WebGLRenderer, type Texture } from "three";
2
+ import { OrbitControls } from "three/examples/jsm/controls/OrbitControls.js";
3
+ import type { GlobalUniforms } from "../materials/global-uniforms.js";
4
+ export declare const SKY = 11455479;
5
+ export declare const SKY_ISOLATED = 8950950;
6
+ export declare const GROUND = 8832893;
7
+ export declare const GROUND_ISOLATED = 7041664;
8
+ export declare const DEFAULT_SUN_POS: Vector3;
9
+ export declare const LIGHT: {
10
+ readonly ambient: 0.3;
11
+ readonly hemisphere: 0.25;
12
+ readonly sun: 0.8;
13
+ readonly exposure: 1;
14
+ };
15
+ export declare const DEFAULT_CAMERA: Vector3;
16
+ export declare const DEFAULT_TARGET: Vector3;
17
+ /**
18
+ * The POC's scene.js init. three r186 lights are physically based, so the POC's (legacy) intensities are
19
+ * multiplied by π; light / ground / fog colors are raw hex / 255 like the POC; the background is the exact hex.
20
+ */
21
+ export type Stage = {
22
+ readonly renderer: WebGLRenderer;
23
+ readonly scene: Scene;
24
+ readonly camera: PerspectiveCamera;
25
+ readonly orbit: OrbitControls;
26
+ /** What the picture is made of: objects, ground, lights, the play ball. */
27
+ readonly world: Group;
28
+ /** Objects of the creation (the views' roots). */
29
+ readonly objects: Group;
30
+ /** Editor helpers drawn on top: gizmos, ghosts, wires, bone dots. */
31
+ readonly ui: Group;
32
+ readonly sun: DirectionalLight;
33
+ readonly ground: Mesh<SphereGeometry, MeshStandardMaterial>;
34
+ readonly env: Texture;
35
+ setIsolation(on: boolean): void;
36
+ dispose(): void;
37
+ };
38
+ export declare function createStage(host: HTMLElement, globals: GlobalUniforms): Stage;
@@ -0,0 +1,6 @@
1
+ import type { SculptObject } from "../../../api/src/index.js";
2
+ /**
3
+ * Stress test (the POC's modes.js): 24 compound sculpts on a 5 × 5 grid around the origin. View-only objects:
4
+ * meshed and drawn like the creation's, never written to it, never selectable.
5
+ */
6
+ export declare function stressTestObjects(rnd?: () => number): SculptObject[];
@@ -0,0 +1,19 @@
1
+ import type { WingFrame } from "../../../api/src/index.js";
2
+ import { BufferGeometry } from "three";
3
+ /** Triangulates a wing outline in its frame (rig bind space): origin + x · span axis + y · chord axis. */
4
+ export declare function buildWingGeometry(pts: readonly (readonly [number, number])[], frame: WingFrame, box: {
5
+ x0: number;
6
+ y0: number;
7
+ side: number;
8
+ }): BufferGeometry;
9
+ /**
10
+ * The wing's contour as a line loop for pixel art. A wing seen nearly edge-on is thinner than one offscreen pixel,
11
+ * so its triangles hit only scattered pixel centers; a line always rasterizes at least one pixel wide, and the
12
+ * contour's projection covers the whole edge-on wing. Texture coordinates are pulled slightly inward so the
13
+ * line takes the membrane's color, not the antialiased transparent rim.
14
+ */
15
+ export declare function buildWingEdgeGeometry(pts: readonly (readonly [number, number])[], frame: WingFrame, box: {
16
+ x0: number;
17
+ y0: number;
18
+ side: number;
19
+ }): BufferGeometry;
@@ -0,0 +1,32 @@
1
+ import type { FlatWing, WingOutline } from "../../../api/src/index.js";
2
+ type Seg = readonly number[];
3
+ type Pt = readonly [number, number];
4
+ /** A preset: fore and hind outlines; a membrane wing (bat) also has a wrist and finger tips the veins follow. */
5
+ export type WingPreset = {
6
+ readonly name: string;
7
+ readonly fore: readonly Seg[];
8
+ readonly hind: readonly Seg[];
9
+ readonly wrist?: Pt;
10
+ readonly fingers?: readonly Pt[];
11
+ };
12
+ /**
13
+ * Outline presets in wing units (the POC's wings.js): x from the root (0) along the span to the tip (~1), y
14
+ * across the chord, positive = backwards. [moveTo, ...bezier triples]; fore and hind shapes per preset.
15
+ */
16
+ export declare const WING_OUTLINES: Record<WingOutline, WingPreset>;
17
+ export type WingShapeParams = Pick<FlatWing, "outline" | "part" | "span" | "chord" | "tail">;
18
+ /** The outline as 2D points in wing units, after span / chord / tail (hindwing tails spike out of the back margin). */
19
+ export declare function wingOutlinePoints(w: WingShapeParams): [number, number][];
20
+ /** The square the pattern texture covers: the outline's bounds, centered in a square of its longest side. */
21
+ export declare function wingTextureBox(pts: readonly (readonly [number, number])[]): {
22
+ x0: number;
23
+ y0: number;
24
+ side: number;
25
+ };
26
+ /** Seeded PRNG (mulberry32) so a wing's pattern is the same on every repaint. */
27
+ export declare function wingRng(seed: number): () => number;
28
+ /** The seed a wing's pattern draws from: fore and hind wings of one seed differ. */
29
+ export declare const wingPatternSeed: (w: Pick<FlatWing, "seed" | "part">) => number;
30
+ /** Repaint key: the texture is only repainted when the pattern, outline or the colors it uses change. */
31
+ export declare function wingPatternKey(w: FlatWing, hex: (ref: FlatWing["base"]) => number): string;
32
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { FlatWing } from "../../../api/src/index.js";
2
+ /** Paints the wing's procedural pattern in wing units (the root is the focal point, so fore and hind agree). */
3
+ export declare function paintWingPattern(canvas: HTMLCanvasElement, w: FlatWing, pts: readonly (readonly [number, number])[], box: {
4
+ x0: number;
5
+ y0: number;
6
+ side: number;
7
+ }, css: (ref: FlatWing["base"]) => string): void;
@@ -0,0 +1 @@
1
+ export * from "./types/viewport/src/index.js";
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import {
3
+ createViewport
4
+ } from "./chunks/chunk-VZMBE5MV.js";
5
+ export {
6
+ createViewport
7
+ };
8
+ //# sourceMappingURL=viewport.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }