@celljs/ta 4.15.0 → 4.15.2

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 (249) hide show
  1. package/dist/cli.mjs +79 -4
  2. package/dist/gateway.mjs +1320 -178
  3. package/dist/pi/CHANGELOG.md +15 -0
  4. package/dist/pi/package.json +1 -1
  5. package/dist/pi/packages/ta-3d/README.en.md +11 -0
  6. package/dist/pi/packages/ta-3d/README.md +11 -0
  7. package/dist/pi/packages/ta-3d/extension/index.mjs +120 -0
  8. package/dist/pi/packages/ta-3d/lib/extension.d.ts +15 -0
  9. package/dist/pi/packages/ta-3d/lib/extension.js +24 -0
  10. package/dist/pi/packages/ta-3d/lib/i18n.d.ts +19 -0
  11. package/dist/pi/packages/ta-3d/lib/i18n.js +50 -0
  12. package/dist/pi/packages/ta-3d/lib/index.d.ts +7 -0
  13. package/dist/pi/packages/ta-3d/lib/index.js +22 -0
  14. package/dist/pi/packages/ta-3d/lib/react.d.ts +8 -0
  15. package/dist/pi/packages/ta-3d/lib/react.js +8 -0
  16. package/dist/pi/packages/ta-3d/lib/scene-card.d.ts +4 -0
  17. package/dist/pi/packages/ta-3d/lib/scene-card.js +60 -0
  18. package/dist/pi/packages/ta-3d/lib/scene-prompt.d.ts +7 -0
  19. package/dist/pi/packages/ta-3d/lib/scene-prompt.js +15 -0
  20. package/dist/pi/packages/ta-3d/lib/scene-protocol.d.ts +5 -0
  21. package/dist/pi/packages/ta-3d/lib/scene-protocol.js +8 -0
  22. package/dist/pi/packages/ta-3d/lib/scene-spec.d.ts +59 -0
  23. package/dist/pi/packages/ta-3d/lib/scene-spec.js +141 -0
  24. package/dist/pi/packages/ta-3d/lib/scene-view.d.ts +57 -0
  25. package/dist/pi/packages/ta-3d/lib/scene-view.js +339 -0
  26. package/dist/pi/packages/ta-3d/lib/style.d.ts +4 -0
  27. package/dist/pi/packages/ta-3d/lib/style.js +33 -0
  28. package/dist/pi/packages/ta-3d/package.json +58 -0
  29. package/dist/pi/packages/ta-3d/web/index.js +660 -0
  30. package/dist/pi/packages/ta-agents/README.en.md +2 -2
  31. package/dist/pi/packages/ta-agents/README.md +2 -2
  32. package/dist/pi/packages/ta-agents/extension/index.mjs +198 -6
  33. package/dist/pi/packages/ta-agents/lib/acp-agent.d.ts +4 -0
  34. package/dist/pi/packages/ta-agents/lib/acp-agent.js +20 -2
  35. package/dist/pi/packages/ta-agents/lib/acp-protocol.d.ts +14 -5
  36. package/dist/pi/packages/ta-agents/lib/acp-protocol.js +7 -0
  37. package/dist/pi/packages/ta-agents/lib/agent-bindings.d.ts +13 -0
  38. package/dist/pi/packages/ta-agents/lib/agent-bindings.js +29 -4
  39. package/dist/pi/packages/ta-agents/lib/agent-prompt.d.ts +2 -0
  40. package/dist/pi/packages/ta-agents/lib/agent-prompt.js +5 -0
  41. package/dist/pi/packages/ta-agents/lib/agent-session.d.ts +16 -4
  42. package/dist/pi/packages/ta-agents/lib/agent-session.js +34 -4
  43. package/dist/pi/packages/ta-agents/lib/agent-sign-in.d.ts +28 -0
  44. package/dist/pi/packages/ta-agents/lib/agent-sign-in.js +62 -0
  45. package/dist/pi/packages/ta-agents/lib/agent-streamer.d.ts +7 -0
  46. package/dist/pi/packages/ta-agents/lib/agent-streamer.js +40 -3
  47. package/dist/pi/packages/ta-agents/lib/extension.js +12 -0
  48. package/dist/pi/packages/ta-agents/lib/texts.d.ts +43 -0
  49. package/dist/pi/packages/ta-agents/lib/texts.js +47 -0
  50. package/dist/pi/packages/ta-agents/package.json +1 -1
  51. package/dist/pi/packages/ta-bots/host/index.mjs +35 -4
  52. package/dist/pi/packages/ta-bots/lib/bot-service.d.ts +6 -0
  53. package/dist/pi/packages/ta-bots/lib/bot-service.js +27 -2
  54. package/dist/pi/packages/ta-bots/lib/bot-store.d.ts +8 -1
  55. package/dist/pi/packages/ta-bots/lib/bot-store.js +16 -2
  56. package/dist/pi/packages/ta-bots/lib/weixin-channel.js +3 -1
  57. package/dist/pi/packages/ta-bots/package.json +1 -1
  58. package/dist/pi/packages/ta-changes/package.json +1 -1
  59. package/dist/pi/packages/ta-channels/host/index.mjs +3 -0
  60. package/dist/pi/packages/ta-channels/package.json +1 -1
  61. package/dist/pi/packages/ta-computer-use/package.json +1 -1
  62. package/dist/pi/packages/ta-cron/lib/tasks-view.js +4 -2
  63. package/dist/pi/packages/ta-cron/package.json +1 -1
  64. package/dist/pi/packages/ta-cron/web/index.js +8 -4
  65. package/dist/pi/packages/ta-extensions/package.json +1 -1
  66. package/dist/pi/packages/ta-extensions/web/index.js +2 -0
  67. package/dist/pi/packages/ta-games/package.json +1 -1
  68. package/dist/pi/packages/ta-glance/extension/index.mjs +1 -0
  69. package/dist/pi/packages/ta-glance/lib/glance-prompt.d.ts +1 -1
  70. package/dist/pi/packages/ta-glance/lib/glance-prompt.js +1 -0
  71. package/dist/pi/packages/ta-glance/package.json +1 -1
  72. package/dist/pi/packages/ta-initiative/lib/inbox.js +47 -29
  73. package/dist/pi/packages/ta-initiative/lib/style.d.ts +1 -1
  74. package/dist/pi/packages/ta-initiative/lib/style.js +27 -14
  75. package/dist/pi/packages/ta-initiative/package.json +1 -1
  76. package/dist/pi/packages/ta-initiative/web/index.js +92 -50
  77. package/dist/pi/packages/ta-launcher/package.json +1 -1
  78. package/dist/pi/packages/ta-manual/package.json +1 -1
  79. package/dist/pi/packages/ta-moments/extension/index.mjs +2 -0
  80. package/dist/pi/packages/ta-moments/host/index.mjs +2 -0
  81. package/dist/pi/packages/ta-moments/package.json +1 -1
  82. package/dist/pi/packages/ta-moments/web/index.js +2 -0
  83. package/dist/pi/packages/ta-nearby/lib/page.js +1 -1
  84. package/dist/pi/packages/ta-nearby/package.json +1 -1
  85. package/dist/pi/packages/ta-nearby/web/index.js +3 -4
  86. package/dist/pi/packages/ta-notify/lib/settings.js +9 -2
  87. package/dist/pi/packages/ta-notify/package.json +1 -1
  88. package/dist/pi/packages/ta-notify/web/index.js +18 -6
  89. package/dist/pi/packages/ta-plot/README.en.md +12 -0
  90. package/dist/pi/packages/ta-plot/README.md +12 -0
  91. package/dist/pi/packages/ta-plot/extension/index.mjs +121 -0
  92. package/dist/pi/packages/ta-plot/lib/extension.d.ts +15 -0
  93. package/dist/pi/packages/ta-plot/lib/extension.js +24 -0
  94. package/dist/pi/packages/ta-plot/lib/i18n.d.ts +14 -0
  95. package/dist/pi/packages/ta-plot/lib/i18n.js +30 -0
  96. package/dist/pi/packages/ta-plot/lib/index.d.ts +7 -0
  97. package/dist/pi/packages/ta-plot/lib/index.js +25 -0
  98. package/dist/pi/packages/ta-plot/lib/plot-expression.d.ts +16 -0
  99. package/dist/pi/packages/ta-plot/lib/plot-expression.js +209 -0
  100. package/dist/pi/packages/ta-plot/lib/plot-painter.d.ts +28 -0
  101. package/dist/pi/packages/ta-plot/lib/plot-painter.js +208 -0
  102. package/dist/pi/packages/ta-plot/lib/plot-prompt.d.ts +7 -0
  103. package/dist/pi/packages/ta-plot/lib/plot-prompt.js +16 -0
  104. package/dist/pi/packages/ta-plot/lib/plot-protocol.d.ts +7 -0
  105. package/dist/pi/packages/ta-plot/lib/plot-protocol.js +10 -0
  106. package/dist/pi/packages/ta-plot/lib/plot-scene.d.ts +65 -0
  107. package/dist/pi/packages/ta-plot/lib/plot-scene.js +427 -0
  108. package/dist/pi/packages/ta-plot/lib/plot-spec.d.ts +86 -0
  109. package/dist/pi/packages/ta-plot/lib/plot-spec.js +165 -0
  110. package/dist/pi/packages/ta-plot/lib/plot-view.d.ts +4 -0
  111. package/dist/pi/packages/ta-plot/lib/plot-view.js +205 -0
  112. package/dist/pi/packages/ta-plot/lib/react.d.ts +8 -0
  113. package/dist/pi/packages/ta-plot/lib/react.js +8 -0
  114. package/dist/pi/packages/ta-plot/lib/style.d.ts +4 -0
  115. package/dist/pi/packages/ta-plot/lib/style.js +47 -0
  116. package/dist/pi/packages/ta-plot/package.json +57 -0
  117. package/dist/pi/packages/ta-plot/web/index.js +1320 -0
  118. package/dist/pi/packages/ta-recall/package.json +1 -1
  119. package/dist/pi/packages/ta-rooms/lib/doubles-view.js +8 -1
  120. package/dist/pi/packages/ta-rooms/lib/style.d.ts +1 -1
  121. package/dist/pi/packages/ta-rooms/lib/style.js +1 -0
  122. package/dist/pi/packages/ta-rooms/package.json +1 -1
  123. package/dist/pi/packages/ta-rooms/web/index.js +17 -5
  124. package/dist/pi/packages/ta-share/lib/share-dialog.js +3 -1
  125. package/dist/pi/packages/ta-share/lib/style.d.ts +1 -1
  126. package/dist/pi/packages/ta-share/lib/style.js +1 -0
  127. package/dist/pi/packages/ta-share/package.json +1 -1
  128. package/dist/pi/packages/ta-share/web/index.js +6 -2
  129. package/dist/pi/packages/ta-sync/lib/panel.js +4 -1
  130. package/dist/pi/packages/ta-sync/lib/style.d.ts +1 -1
  131. package/dist/pi/packages/ta-sync/lib/style.js +1 -0
  132. package/dist/pi/packages/ta-sync/package.json +1 -1
  133. package/dist/pi/packages/ta-sync/web/index.js +9 -3
  134. package/dist/pi/packages/ta-sync-cloud/package.json +1 -1
  135. package/dist/pi/packages/ta-team/lib/dialogs.js +6 -3
  136. package/dist/pi/packages/ta-team/package.json +1 -1
  137. package/dist/pi/packages/ta-team/web/index.js +11 -6
  138. package/dist/pi/packages/ta-workspace/package.json +1 -1
  139. package/dist/pi/packages/ta-workspace/web/index.js +2 -0
  140. package/dist/public/assets/{abnfDiagram-S7VZAUFO-sclOP11q.js → abnfDiagram-S7VZAUFO-Dd51Bqbx.js} +1 -1
  141. package/dist/public/assets/{architecture-WOLXFQ4H-Bitg4Dpy.js → architecture-WOLXFQ4H-BbG3_x7_.js} +1 -1
  142. package/dist/public/assets/{architectureDiagram-YGSQEFNW-Hc0W5khF.js → architectureDiagram-YGSQEFNW-DbJO4t8I.js} +1 -1
  143. package/dist/public/assets/{blockDiagram-APKKGZFW-D2ZWatLV.js → blockDiagram-APKKGZFW-BwtrHF1f.js} +1 -1
  144. package/dist/public/assets/{browser-D-etIMuL.js → browser-CTbeNBsA.js} +1 -1
  145. package/dist/public/assets/{c4Diagram-KJ2TOQU5-CWEcyfwV.js → c4Diagram-KJ2TOQU5-CfBe5A0H.js} +1 -1
  146. package/dist/public/assets/{chunk-6MUBBAK2-CWbrJHxK.js → chunk-6MUBBAK2-C7R0mhrg.js} +1 -1
  147. package/dist/public/assets/{chunk-AXFCVDMN-DJQdD4iX.js → chunk-AXFCVDMN-VQgQruZT.js} +1 -1
  148. package/dist/public/assets/{chunk-BG4553SI-CYiiJcBj.js → chunk-BG4553SI-CkUi_vD5.js} +1 -1
  149. package/dist/public/assets/{chunk-DQASFODM-NrNC1UeX.js → chunk-DQASFODM-BAQq7ktk.js} +1 -1
  150. package/dist/public/assets/{chunk-HFQBQIA3-BIHXOwS2.js → chunk-HFQBQIA3-B1oF8lB7.js} +1 -1
  151. package/dist/public/assets/{chunk-KQLB2F66-CcU_AFwQ.js → chunk-KQLB2F66-DE5amcgT.js} +1 -1
  152. package/dist/public/assets/{chunk-KS47KZWR-DGfNbbcL.js → chunk-KS47KZWR-ev9S_csp.js} +1 -1
  153. package/dist/public/assets/{chunk-LEVMRMFU-B4PSS_Pp.js → chunk-LEVMRMFU-ziqnRvTG.js} +1 -1
  154. package/dist/public/assets/{chunk-M57EVK23-1555_mm4.js → chunk-M57EVK23-DaqPdEKA.js} +1 -1
  155. package/dist/public/assets/{chunk-OY52VR5R-zbNEbYJ8.js → chunk-OY52VR5R-DFOG8j6z.js} +1 -1
  156. package/dist/public/assets/{chunk-QB3YPZ4I-C-nNDGuN.js → chunk-QB3YPZ4I-eg35JLLN.js} +1 -1
  157. package/dist/public/assets/{chunk-R3KSYZAL-DcXXuhbl.js → chunk-R3KSYZAL-J73nie-R.js} +1 -1
  158. package/dist/public/assets/{chunk-STOXU5M4-Bb77QkUj.js → chunk-STOXU5M4-B8EvDZvB.js} +1 -1
  159. package/dist/public/assets/{chunk-TU62E6Q5-D8IJkNq5.js → chunk-TU62E6Q5-DyCM007V.js} +1 -1
  160. package/dist/public/assets/{chunk-X4PVCEUW-BzejexgB.js → chunk-X4PVCEUW-BBGeCNmA.js} +1 -1
  161. package/dist/public/assets/{chunk-XXDRQBXY-D2GPHyll.js → chunk-XXDRQBXY-CAtJ2Wph.js} +1 -1
  162. package/dist/public/assets/{classDiagram-v2-L25IHNXF-CUEzxxI8.js → classDiagram-v2-L25IHNXF-DhQM6yHy.js} +1 -1
  163. package/dist/public/assets/{cose-bilkent-JH36ORCC-CJdgJyUw.js → cose-bilkent-JH36ORCC-AqIcHabu.js} +1 -1
  164. package/dist/public/assets/cynefin-EF2NZ3EQ-yFytgtiy.js +1 -0
  165. package/dist/public/assets/{cynefinDiagram-L36ESFBY-D0F_9jN8.js → cynefinDiagram-L36ESFBY-7SyXzhRd.js} +1 -1
  166. package/dist/public/assets/{d3-selection-BoARy1rP.js → d3-selection-DsahLieG.js} +1 -1
  167. package/dist/public/assets/{dagre-SPEB5RXH-CzI5gZOv.js → dagre-SPEB5RXH-DalaGtMS.js} +1 -1
  168. package/dist/public/assets/{diagram-3B7GL73J-BCtNcE7M.js → diagram-3B7GL73J-BcY-qB9G.js} +1 -1
  169. package/dist/public/assets/{diagram-DNEMPZML-DV9U4KeH.js → diagram-DNEMPZML-NV7fbe0h.js} +1 -1
  170. package/dist/public/assets/{diagram-L3MUGCDN-DHU45Sd4.js → diagram-L3MUGCDN-BPx4GHoj.js} +1 -1
  171. package/dist/public/assets/{diagram-LA4NIPWU-Ba5oVP56.js → diagram-LA4NIPWU-BeUxqmw1.js} +1 -1
  172. package/dist/public/assets/{diagram-MHCOC4E2-B1Nk6qet.js → diagram-MHCOC4E2-Dlg1S5na.js} +1 -1
  173. package/dist/public/assets/{diagram-XPFHEONP-DFwA3q09.js → diagram-XPFHEONP-DQhRoMkK.js} +1 -1
  174. package/dist/public/assets/{dist-Col1xVDT.js → dist-CQU8zJh_.js} +1 -1
  175. package/dist/public/assets/{ebnfDiagram-UZSYDL2S-BuBgxBJ2.js → ebnfDiagram-UZSYDL2S-gVEs3Um2.js} +1 -1
  176. package/dist/public/assets/{editor.api-BLlyFz5x.js → editor.api-SQ1snuat.js} +1 -1
  177. package/dist/public/assets/{elk-XV6XMXQE-BPEI--zX.js → elk-XV6XMXQE-CHtlrPwu.js} +1 -1
  178. package/dist/public/assets/{erDiagram-EYBAPDEH-Cci0kYUw.js → erDiagram-EYBAPDEH-B0xok726.js} +1 -1
  179. package/dist/public/assets/{eventmodeling-K75KTNOO-B0eT5X1_.js → eventmodeling-K75KTNOO-CFwphA0e.js} +1 -1
  180. package/dist/public/assets/flowDiagram-MALGAFMO-Cwye_DsX.js +1 -0
  181. package/dist/public/assets/{freemarker2-CAZGFA3W.js → freemarker2-DJKO-X2B.js} +1 -1
  182. package/dist/public/assets/{ganttDiagram-23REXITY-DEm85e1I.js → ganttDiagram-23REXITY-B5wVGN1A.js} +1 -1
  183. package/dist/public/assets/gitGraph-VSP46ZUC-BYzb--zb.js +1 -0
  184. package/dist/public/assets/{gitGraphDiagram-STJD7YCW-DJAZD2LR.js → gitGraphDiagram-STJD7YCW-DEjNU1R_.js} +1 -1
  185. package/dist/public/assets/{handlebars-Agkl4nGr.js → handlebars-ChVN7JPd.js} +1 -1
  186. package/dist/public/assets/{html-Cu-CsqZI.js → html-CQ0znKSa.js} +1 -1
  187. package/dist/public/assets/{index-TeLHaE4u.js → index-CLlacdXR.js} +2 -2
  188. package/dist/public/assets/info-OHQRW6UA-na0qX3JP.js +1 -0
  189. package/dist/public/assets/{infoDiagram-KBXO4MBG-4zHsBnIy.js → infoDiagram-KBXO4MBG-CJtrS72M.js} +1 -1
  190. package/dist/public/assets/{ishikawaDiagram-M35NCXHK-Bg8OYLGr.js → ishikawaDiagram-M35NCXHK-qYI1QBsK.js} +1 -1
  191. package/dist/public/assets/{javascript-BdMDRX8l.js → javascript-B-DHbkyI.js} +1 -1
  192. package/dist/public/assets/{journeyDiagram-OPLOXDXO-B2xtzmpE.js → journeyDiagram-OPLOXDXO-BOQ2y2ZZ.js} +1 -1
  193. package/dist/public/assets/{jsonMode-Dg92qQvX.js → jsonMode-XuGC5N_z.js} +1 -1
  194. package/dist/public/assets/{kanban-definition-BZKZHSQY-DQ4N7t_w.js → kanban-definition-BZKZHSQY-BJ64tKdP.js} +1 -1
  195. package/dist/public/assets/{liquid-BydEnYkh.js → liquid-B0Ujylzc.js} +1 -1
  196. package/dist/public/assets/{mdx-XZXeM7ll.js → mdx-B19-V510.js} +1 -1
  197. package/dist/public/assets/{mermaid-parser.core-H24--uw9.js → mermaid-parser.core-Scb01iBq.js} +3 -3
  198. package/dist/public/assets/{mermaid.core-BmCrSjUU.js → mermaid.core-BMuvs7us.js} +4 -4
  199. package/dist/public/assets/{mindmap-definition-I2QAS2VK-CGQXKItp.js → mindmap-definition-I2QAS2VK-BYfOS3XN.js} +1 -1
  200. package/dist/public/assets/module-B3SKdB70.js +1 -0
  201. package/dist/public/assets/module-DOrYVZ7B.js +2615 -0
  202. package/dist/public/assets/{monaco-DP8M_Ttp.js → monaco-Bbe2os7m.js} +3 -3
  203. package/dist/public/assets/packet-JDAUHWVQ-jhCd70vR.js +1 -0
  204. package/dist/public/assets/{pegDiagram-FD4XPPHP-CXKRGFUs.js → pegDiagram-FD4XPPHP-D-Vlq9Gm.js} +1 -1
  205. package/dist/public/assets/pie-XZMESJXO-DV0NJFsI.js +1 -0
  206. package/dist/public/assets/{pieDiagram-J4AKIIQI-9XEDP1wR.js → pieDiagram-J4AKIIQI-_-94-aMD.js} +1 -1
  207. package/dist/public/assets/{python-C-0PA82u.js → python-CWnMIOYq.js} +1 -1
  208. package/dist/public/assets/{quadrantDiagram-XTYBLID2-C-uxTp-5.js → quadrantDiagram-XTYBLID2-BhFUbUYz.js} +1 -1
  209. package/dist/public/assets/radar-ABXABTNO-Co-Hlf34.js +1 -0
  210. package/dist/public/assets/railroad-I3PHUGI6-DKMPEjDD.js +1 -0
  211. package/dist/public/assets/{railroad-abnf-LNEFI6M7-CTft_ST0.js → railroad-abnf-LNEFI6M7-yUa9GGCQ.js} +1 -1
  212. package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-DfRJhL7G.js → railroad-ebnf-DWYD2UWJ-xY4YiL8M.js} +1 -1
  213. package/dist/public/assets/{railroad-peg-JR7BVNR7-DFePx4YD.js → railroad-peg-JR7BVNR7-BYFYCUAQ.js} +1 -1
  214. package/dist/public/assets/{railroadDiagram-MRQ6NCDL-BmK1KUsT.js → railroadDiagram-MRQ6NCDL-C9FVhj0k.js} +1 -1
  215. package/dist/public/assets/{razor-DEKNSiT7.js → razor-bDtpN6EJ.js} +1 -1
  216. package/dist/public/assets/{requirementDiagram-Y7LWUY3S-Ds27pS9Y.js → requirementDiagram-Y7LWUY3S-DLmAg-6C.js} +1 -1
  217. package/dist/public/assets/{sankeyDiagram-WGJFYUXA-e2OTzBma.js → sankeyDiagram-WGJFYUXA-Bl5IpDk4.js} +1 -1
  218. package/dist/public/assets/{sequenceDiagram-5NDRBG5M-BcoIpxF6.js → sequenceDiagram-5NDRBG5M-Z-N0OiT_.js} +1 -1
  219. package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-CNr67mC9.js → stateDiagram-v2-FJ4FJNEA-ctKQz8Mo.js} +1 -1
  220. package/dist/public/assets/{swimlanes-UMQ2AFYF-DKPgHCev.js → swimlanes-UMQ2AFYF-CWLKnALg.js} +1 -1
  221. package/dist/public/assets/swimlanesDiagram-OMPLPG4O-CU76xJSu.js +8 -0
  222. package/dist/public/assets/{timeline-definition-SEUHKTQE-BcCmuE6C.js → timeline-definition-SEUHKTQE-DP8Ph_d6.js} +1 -1
  223. package/dist/public/assets/treeView-D4JQ5SDB-JMMnu_MW.js +1 -0
  224. package/dist/public/assets/treemap-SAJKECNS-CPlAD3X1.js +1 -0
  225. package/dist/public/assets/{typescript-B1Uk3m6A.js → typescript-CGpNlLbn.js} +1 -1
  226. package/dist/public/assets/{usecaseDiagram-AFA6YXN4-BpCD8dP7.js → usecaseDiagram-AFA6YXN4-DvFjNj3J.js} +1 -1
  227. package/dist/public/assets/{vennDiagram-NNMJR3RB-CQjX5_-8.js → vennDiagram-NNMJR3RB-3m2F2H-I.js} +1 -1
  228. package/dist/public/assets/wardley-7MLQ67FV-Dhc8wpLp.js +1 -0
  229. package/dist/public/assets/{wardleyDiagram-S7YFUSEH-D7gYo9fV.js → wardleyDiagram-S7YFUSEH-CsMntu16.js} +1 -1
  230. package/dist/public/assets/{xml-DBh_LekU.js → xml-ByiLoakX.js} +1 -1
  231. package/dist/public/assets/{xychartDiagram-GGNKY7IX-B_1aOZKU.js → xychartDiagram-GGNKY7IX-C80rxvM0.js} +1 -1
  232. package/dist/public/assets/{yaml-BE55tHva.js → yaml-Cz2Af5Rj.js} +1 -1
  233. package/dist/public/index.html +1 -1
  234. package/dist/serve/index.mjs +2589 -757
  235. package/package.json +39 -37
  236. package/dist/public/assets/cynefin-EF2NZ3EQ-DBnkPRHn.js +0 -1
  237. package/dist/public/assets/flowDiagram-MALGAFMO-CmMdmAxj.js +0 -1
  238. package/dist/public/assets/gitGraph-VSP46ZUC-DKo3OVhR.js +0 -1
  239. package/dist/public/assets/info-OHQRW6UA-tKl26QqM.js +0 -1
  240. package/dist/public/assets/module-1mERtQ0Z.js +0 -1
  241. package/dist/public/assets/module-BxIQdJqY.js +0 -2449
  242. package/dist/public/assets/packet-JDAUHWVQ-CnBx3hR7.js +0 -1
  243. package/dist/public/assets/pie-XZMESJXO-hogxgeR2.js +0 -1
  244. package/dist/public/assets/radar-ABXABTNO-CdWiN8Cw.js +0 -1
  245. package/dist/public/assets/railroad-I3PHUGI6-DnYOBI5V.js +0 -1
  246. package/dist/public/assets/swimlanesDiagram-OMPLPG4O-U0uzjboz.js +0 -8
  247. package/dist/public/assets/treeView-D4JQ5SDB-4ppY0Rs5.js +0 -1
  248. package/dist/public/assets/treemap-SAJKECNS-CAvLAs7q.js +0 -1
  249. package/dist/public/assets/wardley-7MLQ67FV-D_F3qmRJ.js +0 -1
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SceneSpec = exports.SHAPES = void 0;
4
+ exports.SHAPES = ['box', 'sphere', 'cylinder', 'cone', 'torus', 'plane', 'capsule', 'line', 'arrow', 'model', 'group'];
5
+ const MAX_OBJECTS = 400;
6
+ const MAX_DEPTH = 6;
7
+ const MAX_POINTS = 500;
8
+ var SceneSpec;
9
+ (function (SceneSpec) {
10
+ /** Throws an Error that says what is wrong for a block it cannot draw. */
11
+ function read(code) {
12
+ var _a;
13
+ const spec = object(JSON.parse(code));
14
+ if (!spec) {
15
+ throw new Error('A scene is a JSON object');
16
+ }
17
+ const count = { objects: 0 };
18
+ const objects = things(spec.objects, 0, count);
19
+ if (!objects.length) {
20
+ throw new Error('A scene has no objects');
21
+ }
22
+ const camera = object(spec.camera);
23
+ const position = camera ? vec(camera.position) : undefined;
24
+ const models = [];
25
+ let moving = false;
26
+ walk(objects, thing => {
27
+ if (thing.src) {
28
+ models.push(thing.src);
29
+ moving = true;
30
+ }
31
+ moving || (moving = thing.bob > 0 || thing.spin.some(Boolean));
32
+ });
33
+ const rotate = spec.rotate !== false;
34
+ return {
35
+ title: text(spec.title),
36
+ background: color(spec.background),
37
+ camera: position ? { position, target: (_a = vec(camera === null || camera === void 0 ? void 0 : camera.target)) !== null && _a !== void 0 ? _a : [0, 0, 0] } : undefined,
38
+ rotate,
39
+ ground: spec.ground !== false,
40
+ objects,
41
+ moving: moving || rotate,
42
+ models,
43
+ };
44
+ }
45
+ SceneSpec.read = read;
46
+ function walk(objects, visit) {
47
+ for (const thing of objects) {
48
+ visit(thing);
49
+ walk(thing.children, visit);
50
+ }
51
+ }
52
+ SceneSpec.walk = walk;
53
+ })(SceneSpec || (exports.SceneSpec = SceneSpec = {}));
54
+ function things(value, depth, count) {
55
+ if (!Array.isArray(value) || depth > MAX_DEPTH) {
56
+ return [];
57
+ }
58
+ const read = [];
59
+ for (const item of value) {
60
+ const spec = object(item);
61
+ if (!spec || count.objects >= MAX_OBJECTS) {
62
+ continue;
63
+ }
64
+ count.objects++;
65
+ read.push(thing(spec, depth, count));
66
+ }
67
+ return read;
68
+ }
69
+ function thing(spec, depth, count) {
70
+ var _a, _b, _c, _d, _e;
71
+ const children = things(spec.children, depth + 1, count);
72
+ const src = path((_a = spec.src) !== null && _a !== void 0 ? _a : spec.model);
73
+ const named = exports.SHAPES.find(shape => shape === spec.shape);
74
+ const shape = named !== null && named !== void 0 ? named : (src ? 'model' : children.length ? 'group' : 'box');
75
+ if (shape === 'model' && !src) {
76
+ throw new Error('A model has no src');
77
+ }
78
+ const points = (Array.isArray(spec.points) ? spec.points : [])
79
+ .slice(0, MAX_POINTS)
80
+ .map(vec)
81
+ .filter((point) => !!point);
82
+ if ((shape === 'line' || shape === 'arrow') && points.length < 2) {
83
+ throw new Error(`A ${shape} needs two points`);
84
+ }
85
+ const scale = typeof spec.scale === 'number' && spec.scale > 0 ? [spec.scale, spec.scale, spec.scale] : ((_b = vec(spec.scale)) !== null && _b !== void 0 ? _b : [1, 1, 1]);
86
+ return {
87
+ shape,
88
+ size: size(spec.size),
89
+ radius: positive(spec.radius, 0.5),
90
+ height: positive(spec.height, 1),
91
+ tube: positive(spec.tube, 0.15),
92
+ position: (_c = vec(spec.position)) !== null && _c !== void 0 ? _c : [0, 0, 0],
93
+ rotation: (_d = vec(spec.rotation)) !== null && _d !== void 0 ? _d : [0, 0, 0],
94
+ scale,
95
+ color: color(spec.color),
96
+ opacity: Number.isFinite(spec.opacity) ? Math.min(Math.max(spec.opacity, 0.05), 1) : 1,
97
+ metal: unit(spec.metal, 0.1),
98
+ rough: unit(spec.rough, 0.5),
99
+ wireframe: !!spec.wireframe,
100
+ label: text(spec.label),
101
+ points,
102
+ src: shape === 'model' ? src : undefined,
103
+ spin: (_e = vec(spec.spin)) !== null && _e !== void 0 ? _e : [0, 0, 0],
104
+ bob: Number.isFinite(spec.bob) ? Math.min(Math.max(spec.bob, 0), 100) : 0,
105
+ children,
106
+ };
107
+ }
108
+ function object(value) {
109
+ return value && typeof value === 'object' && !Array.isArray(value) ? value : undefined;
110
+ }
111
+ function text(value) {
112
+ return typeof value === 'string' && value ? value.slice(0, 80) : undefined;
113
+ }
114
+ /** A CSS color of a few characters: a name, #hex, rgb() or hsl(); anything else is left out. */
115
+ function color(value) {
116
+ return typeof value === 'string' && /^(#[0-9a-f]{3,8}|[a-z]{3,20}|(rgb|hsl)a?\([\d\s.,%]+\))$/i.test(value.trim()) ? value.trim() : undefined;
117
+ }
118
+ /** A path of the workspace, relative or absolute; not a URL of the web. */
119
+ function path(value) {
120
+ return typeof value === 'string' && value && value.length < 500 && !/^[a-z][\w+.-]*:/i.test(value) ? value : undefined;
121
+ }
122
+ function vec(value) {
123
+ if (Array.isArray(value) && value.length === 3 && value.every(Number.isFinite)) {
124
+ return [value[0], value[1], value[2]];
125
+ }
126
+ return undefined;
127
+ }
128
+ function size(value) {
129
+ if (typeof value === 'number' && value > 0) {
130
+ return [value, value, value];
131
+ }
132
+ const read = vec(value);
133
+ return read && read.every(part => part > 0) ? read : [1, 1, 1];
134
+ }
135
+ function positive(value, fallback) {
136
+ return typeof value === 'number' && value > 0 && Number.isFinite(value) ? value : fallback;
137
+ }
138
+ function unit(value, fallback) {
139
+ return typeof value === 'number' && Number.isFinite(value) ? Math.min(Math.max(value, 0), 1) : fallback;
140
+ }
141
+ //# sourceMappingURL=scene-spec.js.map
@@ -0,0 +1,57 @@
1
+ import type { Game3DContext, Game3DLoop, GamePage } from '@celljs/ta-web/lib/browser/extension/web-extension-api';
2
+ import type * as Three from 'three';
3
+ import type { Scene, SceneObject, Vec3 } from './scene-spec';
4
+ export declare const PALETTE: string[];
5
+ /** What a scene asks of the card: the URL of a model of the workspace, and where to say one did not load. */
6
+ export interface SceneHost {
7
+ modelUrl(src: string): Promise<string>;
8
+ failed(src: string, error: unknown): void;
9
+ }
10
+ /**
11
+ * A scene of a `ta-3d` block, built with the Three.js of the page (`ui.Game3D`): its shapes, lines, arrows and models
12
+ * of the workspace, lit, with a soft shadow under it, the camera fit to it unless the block placed it; it turns
13
+ * slowly until the user drags it. Models load after the shapes are shown, and the camera fits again then.
14
+ */
15
+ export declare class SceneView implements Game3DLoop {
16
+ protected readonly context: Game3DContext;
17
+ protected readonly scene: Scene;
18
+ protected readonly host: SceneHost;
19
+ protected readonly THREE: typeof Three;
20
+ protected readonly root: Three.Group;
21
+ protected readonly controls: InstanceType<Game3DContext['OrbitControls']>;
22
+ protected readonly sun: Three.DirectionalLight;
23
+ protected readonly ground: Three.Mesh;
24
+ protected readonly moving: {
25
+ object: Three.Object3D;
26
+ spin: Vec3;
27
+ bob: number;
28
+ y: number;
29
+ phase: number;
30
+ }[];
31
+ protected readonly mixers: Three.AnimationMixer[];
32
+ protected readonly labels: Three.Sprite[];
33
+ /** Until the user turns it: the camera follows what loads. */
34
+ protected fitted: boolean;
35
+ protected disposed: boolean;
36
+ constructor(context: Game3DContext, scene: Scene, host: SceneHost);
37
+ protected build(thing: SceneObject, inherited: string): Three.Object3D;
38
+ protected geometry(thing: SceneObject): Three.BufferGeometry;
39
+ protected material(thing: SceneObject, color: string): Three.Material;
40
+ /** A line through its points as a thin tube; an arrow, a shaft and a head from the first point to the last. */
41
+ protected path(thing: SceneObject, color: string): Three.Object3D;
42
+ /** How high over its middle a label of a thing goes. */
43
+ protected top(thing: SceneObject): number;
44
+ /** A model of the workspace into `holder`: fit into the largest side of its size, centered, its first animation playing. */
45
+ protected load(thing: SceneObject, holder: Three.Group): Promise<void>;
46
+ /** The camera and the shadow fit to what is shown. */
47
+ protected fit(): void;
48
+ update(seconds: number, elapsed: number): void;
49
+ page(page: GamePage): void;
50
+ dispose(): void;
51
+ /** A wheel scrolls the conversation; a pinch (Ctrl with the wheel, as a trackpad sends it) zooms. */
52
+ protected readonly wheel: (event: WheelEvent) => void;
53
+ /** A word that always faces the camera, over what it names. */
54
+ static label(THREE: typeof Three, text: string): Three.Sprite;
55
+ static texture(THREE: typeof Three, text: string, color: string): Three.CanvasTexture;
56
+ }
57
+ //# sourceMappingURL=scene-view.d.ts.map
@@ -0,0 +1,339 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SceneView = exports.PALETTE = void 0;
4
+ exports.PALETTE = ['#4f8cff', '#ff7a59', '#2bb673', '#b36bff', '#f5b400', '#00b8d9', '#e8578f', '#8a94a6'];
5
+ const DEGREE = Math.PI / 180;
6
+ /**
7
+ * A scene of a `ta-3d` block, built with the Three.js of the page (`ui.Game3D`): its shapes, lines, arrows and models
8
+ * of the workspace, lit, with a soft shadow under it, the camera fit to it unless the block placed it; it turns
9
+ * slowly until the user drags it. Models load after the shapes are shown, and the camera fits again then.
10
+ */
11
+ class SceneView {
12
+ constructor(context, scene, host) {
13
+ this.context = context;
14
+ this.scene = scene;
15
+ this.host = host;
16
+ this.moving = [];
17
+ this.mixers = [];
18
+ this.labels = [];
19
+ /** Until the user turns it: the camera follows what loads. */
20
+ this.fitted = true;
21
+ this.disposed = false;
22
+ /** A wheel scrolls the conversation; a pinch (Ctrl with the wheel, as a trackpad sends it) zooms. */
23
+ this.wheel = (event) => {
24
+ if (!event.ctrlKey) {
25
+ return;
26
+ }
27
+ event.preventDefault();
28
+ const { camera } = this.context;
29
+ const target = this.controls.target;
30
+ const offset = camera.position.clone().sub(target);
31
+ const distance = Math.min(Math.max(offset.length() * Math.exp(event.deltaY * 0.01), this.controls.minDistance), this.controls.maxDistance);
32
+ camera.position.copy(target).add(offset.setLength(distance));
33
+ this.fitted = false;
34
+ };
35
+ const THREE = context.THREE;
36
+ this.THREE = THREE;
37
+ const { renderer, element } = context;
38
+ renderer.shadowMap.enabled = true;
39
+ renderer.shadowMap.type = THREE.PCFSoftShadowMap;
40
+ if (scene.background) {
41
+ context.scene.background = new THREE.Color(scene.background);
42
+ }
43
+ const camera = context.camera;
44
+ camera.fov = 40;
45
+ camera.near = 0.01;
46
+ camera.far = 1000;
47
+ camera.updateProjectionMatrix();
48
+ this.controls = new context.OrbitControls(camera, element);
49
+ this.controls.enableDamping = true;
50
+ this.controls.enableZoom = false;
51
+ this.controls.autoRotateSpeed = 0.8;
52
+ this.controls.addEventListener('start', () => {
53
+ this.controls.autoRotate = false;
54
+ this.fitted = false;
55
+ });
56
+ element.addEventListener('wheel', this.wheel, { passive: false });
57
+ context.scene.add(new THREE.HemisphereLight(0xffffff, 0x556070, 1.7));
58
+ this.sun = new THREE.DirectionalLight(0xffffff, 1.8);
59
+ this.sun.castShadow = true;
60
+ this.sun.shadow.mapSize.set(1024, 1024);
61
+ this.sun.shadow.bias = -0.0005;
62
+ context.scene.add(this.sun, this.sun.target);
63
+ const fill = new THREE.DirectionalLight(0xffffff, 0.5);
64
+ fill.position.set(-3, 1, -2);
65
+ context.scene.add(fill);
66
+ this.ground = new THREE.Mesh(new THREE.CircleGeometry(1, 48), new THREE.ShadowMaterial({ opacity: 0.18 }));
67
+ this.ground.rotation.x = -Math.PI / 2;
68
+ this.ground.receiveShadow = true;
69
+ this.ground.visible = scene.ground;
70
+ context.scene.add(this.ground);
71
+ this.root = new THREE.Group();
72
+ context.scene.add(this.root);
73
+ scene.objects.forEach((thing, index) => {
74
+ this.root.add(this.build(thing, exports.PALETTE[index % exports.PALETTE.length]));
75
+ });
76
+ if (scene.camera) {
77
+ this.fitted = false;
78
+ camera.position.set(...scene.camera.position);
79
+ this.controls.target.set(...scene.camera.target);
80
+ }
81
+ this.fit();
82
+ this.page(context.page);
83
+ }
84
+ build(thing, inherited) {
85
+ var _a;
86
+ const { THREE } = this;
87
+ const color = (_a = thing.color) !== null && _a !== void 0 ? _a : inherited;
88
+ let object;
89
+ if (thing.shape === 'group' || thing.shape === 'model') {
90
+ const group = new THREE.Group();
91
+ object = group;
92
+ thing.children.forEach((child, index) => {
93
+ group.add(this.build(child, child.color ? color : thing.color ? color : exports.PALETTE[(exports.PALETTE.indexOf(inherited) + index) % exports.PALETTE.length]));
94
+ });
95
+ if (thing.shape === 'model' && thing.src) {
96
+ void this.load(thing, group);
97
+ }
98
+ }
99
+ else if (thing.shape === 'line' || thing.shape === 'arrow') {
100
+ object = this.path(thing, color);
101
+ }
102
+ else {
103
+ object = new THREE.Mesh(this.geometry(thing), this.material(thing, color));
104
+ object.castShadow = true;
105
+ object.receiveShadow = true;
106
+ thing.children.forEach(child => {
107
+ var _a;
108
+ object.add(this.build(child, (_a = child.color) !== null && _a !== void 0 ? _a : color));
109
+ });
110
+ }
111
+ object.position.set(...thing.position);
112
+ object.rotation.set(thing.rotation[0] * DEGREE, thing.rotation[1] * DEGREE, thing.rotation[2] * DEGREE);
113
+ object.scale.set(...thing.scale);
114
+ if (thing.label) {
115
+ const label = SceneView.label(THREE, thing.label);
116
+ label.position.set(0, this.top(thing), 0);
117
+ object.add(label);
118
+ this.labels.push(label);
119
+ }
120
+ if (thing.bob || thing.spin.some(Boolean)) {
121
+ this.moving.push({ object, spin: thing.spin, bob: thing.bob, y: thing.position[1], phase: this.moving.length * 0.7 });
122
+ }
123
+ return object;
124
+ }
125
+ geometry(thing) {
126
+ const { THREE } = this;
127
+ const [w, h, d] = thing.size;
128
+ switch (thing.shape) {
129
+ case 'sphere':
130
+ return new THREE.SphereGeometry(thing.radius, 48, 32);
131
+ case 'cylinder':
132
+ return new THREE.CylinderGeometry(thing.radius, thing.radius, thing.height, 48);
133
+ case 'cone':
134
+ return new THREE.ConeGeometry(thing.radius, thing.height, 48);
135
+ case 'torus':
136
+ return new THREE.TorusGeometry(thing.radius, thing.tube, 24, 96);
137
+ case 'capsule':
138
+ return new THREE.CapsuleGeometry(thing.radius, thing.height, 12, 32);
139
+ case 'plane':
140
+ return new THREE.PlaneGeometry(w, d === 1 && h !== 1 ? h : d);
141
+ default:
142
+ return new THREE.BoxGeometry(w, h, d);
143
+ }
144
+ }
145
+ material(thing, color) {
146
+ return new this.THREE.MeshStandardMaterial({
147
+ color,
148
+ metalness: thing.metal,
149
+ roughness: thing.rough,
150
+ transparent: thing.opacity < 1,
151
+ opacity: thing.opacity,
152
+ wireframe: thing.wireframe,
153
+ side: thing.shape === 'plane' ? this.THREE.DoubleSide : this.THREE.FrontSide,
154
+ });
155
+ }
156
+ /** A line through its points as a thin tube; an arrow, a shaft and a head from the first point to the last. */
157
+ path(thing, color) {
158
+ const { THREE } = this;
159
+ const points = thing.points.map(point => new THREE.Vector3(...point));
160
+ const material = this.material(thing, color);
161
+ if (thing.shape === 'line') {
162
+ const path = new THREE.CurvePath();
163
+ for (let i = 1; i < points.length; i++) {
164
+ path.add(new THREE.LineCurve3(points[i - 1], points[i]));
165
+ }
166
+ const mesh = new THREE.Mesh(new THREE.TubeGeometry(path, Math.min(points.length * 4, 2000), Math.min(thing.radius, 0.03), 8), material);
167
+ mesh.castShadow = true;
168
+ return mesh;
169
+ }
170
+ const from = points[0];
171
+ const to = points[points.length - 1];
172
+ const length = from.distanceTo(to) || 1;
173
+ const radius = Math.min(thing.radius, length * 0.035);
174
+ const head = Math.min(length * 0.3, radius * 7);
175
+ const arrow = new THREE.Group();
176
+ const shaft = new THREE.Mesh(new THREE.CylinderGeometry(radius, radius, length - head, 16), material);
177
+ shaft.position.y = (length - head) / 2;
178
+ const tip = new THREE.Mesh(new THREE.ConeGeometry(radius * 2.6, head, 24), material);
179
+ tip.position.y = length - head / 2;
180
+ shaft.castShadow = tip.castShadow = true;
181
+ arrow.add(shaft, tip);
182
+ arrow.position.copy(from);
183
+ arrow.quaternion.setFromUnitVectors(new THREE.Vector3(0, 1, 0), to.clone().sub(from).normalize());
184
+ const holder = new THREE.Group();
185
+ holder.add(arrow);
186
+ return holder;
187
+ }
188
+ /** How high over its middle a label of a thing goes. */
189
+ top(thing) {
190
+ switch (thing.shape) {
191
+ case 'sphere':
192
+ case 'torus':
193
+ return thing.radius + 0.18;
194
+ case 'cylinder':
195
+ case 'cone':
196
+ return thing.height / 2 + 0.18;
197
+ case 'capsule':
198
+ return thing.height / 2 + thing.radius + 0.18;
199
+ case 'line':
200
+ case 'arrow':
201
+ return Math.max(...thing.points.map(point => point[1])) + 0.18;
202
+ default:
203
+ return thing.size[1] / 2 + 0.18;
204
+ }
205
+ }
206
+ /** A model of the workspace into `holder`: fit into the largest side of its size, centered, its first animation playing. */
207
+ async load(thing, holder) {
208
+ const src = thing.src;
209
+ try {
210
+ const url = await this.host.modelUrl(src);
211
+ const loader = new this.context.GLTFLoader();
212
+ const gltf = await loader.loadAsync(url);
213
+ if (this.disposed) {
214
+ return;
215
+ }
216
+ const model = gltf.scene;
217
+ model.updateMatrixWorld(true);
218
+ const box = new this.THREE.Box3().setFromObject(model, true);
219
+ const extent = box.getSize(new this.THREE.Vector3());
220
+ const largest = Math.max(extent.x, extent.y, extent.z) || 1;
221
+ model.scale.multiplyScalar(Math.max(...thing.size) / largest);
222
+ model.updateMatrixWorld(true);
223
+ const center = new this.THREE.Box3().setFromObject(model, true).getCenter(new this.THREE.Vector3());
224
+ model.position.sub(center);
225
+ model.traverse(child => {
226
+ if (child.isMesh) {
227
+ child.castShadow = true;
228
+ child.receiveShadow = true;
229
+ }
230
+ });
231
+ holder.add(model);
232
+ if (gltf.animations.length) {
233
+ const mixer = new this.THREE.AnimationMixer(model);
234
+ mixer.clipAction(gltf.animations[0]).play();
235
+ this.mixers.push(mixer);
236
+ }
237
+ this.fit();
238
+ }
239
+ catch (error) {
240
+ this.host.failed(src, error);
241
+ }
242
+ }
243
+ /** The camera and the shadow fit to what is shown. */
244
+ fit() {
245
+ const { THREE } = this;
246
+ this.root.updateMatrixWorld(true);
247
+ const box = new THREE.Box3();
248
+ this.root.traverse(child => {
249
+ if (child.isMesh) {
250
+ box.expandByObject(child, true);
251
+ }
252
+ });
253
+ if (box.isEmpty()) {
254
+ box.set(new THREE.Vector3(-1, -1, -1), new THREE.Vector3(1, 1, 1));
255
+ }
256
+ const sphere = box.getBoundingSphere(new THREE.Sphere());
257
+ const radius = Math.max(sphere.radius, 0.1);
258
+ this.ground.position.set(sphere.center.x, box.min.y - radius * 0.002, sphere.center.z);
259
+ this.ground.scale.setScalar(radius * 2.2);
260
+ this.sun.position.copy(sphere.center).add(new THREE.Vector3(radius * 1.2, radius * 2.5, radius * 1.6));
261
+ this.sun.target.position.copy(sphere.center);
262
+ const shadow = this.sun.shadow.camera;
263
+ Object.assign(shadow, { left: -radius * 1.6, right: radius * 1.6, top: radius * 1.6, bottom: -radius * 1.6, near: 0.01, far: radius * 8 });
264
+ shadow.updateProjectionMatrix();
265
+ this.controls.minDistance = radius * 0.6;
266
+ this.controls.maxDistance = radius * 12;
267
+ if (!this.fitted) {
268
+ return;
269
+ }
270
+ const camera = this.context.camera;
271
+ const distance = (radius / Math.sin((camera.fov * DEGREE) / 2)) * 1.08;
272
+ this.controls.target.copy(sphere.center);
273
+ camera.position.copy(sphere.center).add(new THREE.Vector3(1, 0.65, 1.25).normalize().multiplyScalar(distance));
274
+ camera.near = distance / 100;
275
+ camera.far = distance * 20;
276
+ camera.updateProjectionMatrix();
277
+ }
278
+ update(seconds, elapsed) {
279
+ for (const { object, spin, bob, y, phase } of this.moving) {
280
+ object.rotation.x += spin[0] * DEGREE * seconds;
281
+ object.rotation.y += spin[1] * DEGREE * seconds;
282
+ object.rotation.z += spin[2] * DEGREE * seconds;
283
+ if (bob) {
284
+ object.position.y = y + Math.sin(elapsed * 2 + phase) * bob;
285
+ }
286
+ }
287
+ for (const mixer of this.mixers) {
288
+ mixer.update(seconds);
289
+ }
290
+ this.controls.update();
291
+ }
292
+ page(page) {
293
+ this.controls.autoRotate = this.scene.rotate && !page.reduceMotion;
294
+ const color = `#${page.colors.text.toString(16).padStart(6, '0')}`;
295
+ for (const label of this.labels) {
296
+ const old = label.material.map;
297
+ label.material.map = SceneView.texture(this.THREE, String(label.userData.text), color);
298
+ old === null || old === void 0 ? void 0 : old.dispose();
299
+ }
300
+ }
301
+ dispose() {
302
+ this.disposed = true;
303
+ this.context.element.removeEventListener('wheel', this.wheel);
304
+ this.controls.dispose();
305
+ }
306
+ /** A word that always faces the camera, over what it names. */
307
+ static label(THREE, text) {
308
+ var _a;
309
+ const sprite = new THREE.Sprite(new THREE.SpriteMaterial({ map: SceneView.texture(THREE, text, '#888888'), depthTest: false, transparent: true }));
310
+ sprite.userData.text = text;
311
+ const image = (_a = sprite.material.map) === null || _a === void 0 ? void 0 : _a.image;
312
+ const height = 0.16;
313
+ sprite.scale.set((height * image.width) / image.height, height, 1);
314
+ sprite.renderOrder = 10;
315
+ return sprite;
316
+ }
317
+ static texture(THREE, text, color) {
318
+ var _a;
319
+ const canvas = document.createElement('canvas');
320
+ const context = canvas.getContext('2d');
321
+ const font = '600 40px system-ui, sans-serif';
322
+ if (context) {
323
+ context.font = font;
324
+ }
325
+ canvas.width = Math.ceil(((_a = context === null || context === void 0 ? void 0 : context.measureText(text).width) !== null && _a !== void 0 ? _a : 40) + 16);
326
+ canvas.height = 56;
327
+ if (context) {
328
+ context.font = font;
329
+ context.fillStyle = color;
330
+ context.textBaseline = 'middle';
331
+ context.fillText(text, 8, 28);
332
+ }
333
+ const texture = new THREE.CanvasTexture(canvas);
334
+ texture.colorSpace = THREE.SRGBColorSpace;
335
+ return texture;
336
+ }
337
+ }
338
+ exports.SceneView = SceneView;
339
+ //# sourceMappingURL=scene-view.js.map
@@ -0,0 +1,4 @@
1
+ /** The styles of the package; only the --ta-* variables of the page, so they follow its theme. */
2
+ export declare const STYLE = "\n/* A scene of a reply (```ta-3d): a title, the view, what did not load, a hint under it. */\n.t3d-card {\n margin: 2px 0 12px;\n padding: 12px;\n max-width: 560px;\n border: 1px solid var(--ta-border);\n border-radius: 12px;\n background: var(--ta-card);\n color: var(--ta-text);\n font-size: calc(13px * var(--ta-font-scale, 1));\n line-height: 1.5;\n}\n.t3d-title { font-weight: 600; margin-bottom: 8px; }\n.t3d-view { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; cursor: grab; touch-action: none; }\n.t3d-view:active { cursor: grabbing; }\n.t3d-view > * { position: absolute; inset: 0; }\n.t3d-hint, .t3d-failed { margin-top: 6px; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale, 1)); }\n.t3d-writing { display: flex; align-items: center; gap: 8px; color: var(--ta-muted); }\n";
3
+ export declare function injectStyle(): () => void;
4
+ //# sourceMappingURL=style.d.ts.map
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STYLE = void 0;
4
+ exports.injectStyle = injectStyle;
5
+ /** The styles of the package; only the --ta-* variables of the page, so they follow its theme. */
6
+ exports.STYLE = `
7
+ /* A scene of a reply (\`\`\`ta-3d): a title, the view, what did not load, a hint under it. */
8
+ .t3d-card {
9
+ margin: 2px 0 12px;
10
+ padding: 12px;
11
+ max-width: 560px;
12
+ border: 1px solid var(--ta-border);
13
+ border-radius: 12px;
14
+ background: var(--ta-card);
15
+ color: var(--ta-text);
16
+ font-size: calc(13px * var(--ta-font-scale, 1));
17
+ line-height: 1.5;
18
+ }
19
+ .t3d-title { font-weight: 600; margin-bottom: 8px; }
20
+ .t3d-view { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; cursor: grab; touch-action: none; }
21
+ .t3d-view:active { cursor: grabbing; }
22
+ .t3d-view > * { position: absolute; inset: 0; }
23
+ .t3d-hint, .t3d-failed { margin-top: 6px; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale, 1)); }
24
+ .t3d-writing { display: flex; align-items: center; gap: 8px; color: var(--ta-muted); }
25
+ `;
26
+ function injectStyle() {
27
+ const element = document.createElement('style');
28
+ element.dataset.taPackage = 'ta-3d';
29
+ element.textContent = exports.STYLE;
30
+ document.head.appendChild(element);
31
+ return () => element.remove();
32
+ }
33
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@celljs/ta-3d",
3
+ "version": "4.15.2",
4
+ "description": "A pi package for Ta: 3D scenes and models of replies, drawn by the 3D engine of the page and turned by dragging",
5
+ "keywords": [
6
+ "pi-package"
7
+ ],
8
+ "homepage": "https://github.com/cellbang/ta",
9
+ "bugs": {
10
+ "url": "https://github.com/cellbang/ta/issues"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/cellbang/cell.git"
15
+ },
16
+ "license": "MIT",
17
+ "files": [
18
+ "web",
19
+ "extension",
20
+ "!**/*.map"
21
+ ],
22
+ "scripts": {
23
+ "build": "tsc -b && bun build web-src/index.tsx --format esm --target browser --outfile web/index.js && bun build web-src/extension.ts --format esm --target node --outfile extension/index.mjs",
24
+ "clean": "rm -rf lib web extension *.tsbuildinfo",
25
+ "test": "bun test ./lib",
26
+ "watch": "tsc -b -w --preserveWatchOutput"
27
+ },
28
+ "devDependencies": {
29
+ "@celljs/ta-protocol": "workspace:*",
30
+ "@celljs/ta-web": "workspace:*",
31
+ "@types/react": "^19.3.0",
32
+ "@types/three": "^0.187.0"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "pi": {
38
+ "title": {
39
+ "en": "3D view",
40
+ "zh-CN": "3D 展示",
41
+ "zh-TW": "3D 展示",
42
+ "ja-JP": "3D ビュー"
43
+ },
44
+ "summary": {
45
+ "en": "Shows what Ta describes in 3D in the reply: a model of the workspace (glTF), or a scene of shapes (a structure, a layout, a molecule), turned by dragging.",
46
+ "zh-CN": "回复里直接用 3D 展示:工作区里的模型(glTF),或用基本形状搭出的场景(结构、布局、分子),拖动就能转着看。",
47
+ "zh-TW": "回覆裡直接用 3D 展示:工作區裡的模型(glTF),或用基本形狀搭出的場景(結構、佈局、分子),拖動就能轉著看。",
48
+ "ja-JP": "返信の中で 3D で見せます:ワークスペースのモデル(glTF)や、基本形状で組んだシーン(構造、レイアウト、分子)を、ドラッグで回して見られます。"
49
+ },
50
+ "icon": "Box",
51
+ "web": [
52
+ "./web/index.js"
53
+ ],
54
+ "extensions": [
55
+ "./extension/index.mjs"
56
+ ]
57
+ }
58
+ }