@shware/workflow-ui 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 (363) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +180 -2
  3. package/dist/assets/iphone-17-pro-DzaacWSl.png +0 -0
  4. package/dist/assets/pixel-10-pro-back-7MDj1_lz.webp +0 -0
  5. package/dist/assets/pixel-10-pro-mask-Bi1deQ9Y.webp +0 -0
  6. package/dist/cli.d.mts +1 -0
  7. package/dist/cli.mjs +673 -0
  8. package/dist/cli.mjs.map +1 -0
  9. package/dist/config.d.mts +247 -0
  10. package/dist/config.d.mts.map +1 -0
  11. package/dist/config.mjs +27 -0
  12. package/dist/config.mjs.map +1 -0
  13. package/dist/index.d.mts +451 -0
  14. package/dist/index.d.mts.map +1 -0
  15. package/dist/index.mjs +2722 -0
  16. package/dist/index.mjs.map +1 -0
  17. package/dist/postgres.d.mts +34 -0
  18. package/dist/postgres.d.mts.map +1 -0
  19. package/dist/postgres.mjs +313 -0
  20. package/dist/postgres.mjs.map +1 -0
  21. package/package.json +93 -3
  22. package/src/app/assets/devices/iphone-17-pro.png +0 -0
  23. package/src/app/assets/devices/pixel-10-pro-back.webp +0 -0
  24. package/src/app/assets/devices/pixel-10-pro-mask.webp +0 -0
  25. package/src/app/assets/flags/AC.svg +1 -0
  26. package/src/app/assets/flags/AD.svg +1 -0
  27. package/src/app/assets/flags/AE.svg +1 -0
  28. package/src/app/assets/flags/AF.svg +1 -0
  29. package/src/app/assets/flags/AG.svg +1 -0
  30. package/src/app/assets/flags/AI.svg +1 -0
  31. package/src/app/assets/flags/AL.svg +1 -0
  32. package/src/app/assets/flags/AM.svg +1 -0
  33. package/src/app/assets/flags/AO.svg +1 -0
  34. package/src/app/assets/flags/AQ.svg +1 -0
  35. package/src/app/assets/flags/AR.svg +1 -0
  36. package/src/app/assets/flags/AS.svg +1 -0
  37. package/src/app/assets/flags/AT.svg +1 -0
  38. package/src/app/assets/flags/AU.svg +1 -0
  39. package/src/app/assets/flags/AW.svg +1 -0
  40. package/src/app/assets/flags/AX.svg +1 -0
  41. package/src/app/assets/flags/AZ.svg +1 -0
  42. package/src/app/assets/flags/BA.svg +1 -0
  43. package/src/app/assets/flags/BB.svg +1 -0
  44. package/src/app/assets/flags/BD.svg +1 -0
  45. package/src/app/assets/flags/BE.svg +1 -0
  46. package/src/app/assets/flags/BF.svg +1 -0
  47. package/src/app/assets/flags/BG.svg +1 -0
  48. package/src/app/assets/flags/BH.svg +1 -0
  49. package/src/app/assets/flags/BI.svg +1 -0
  50. package/src/app/assets/flags/BJ.svg +1 -0
  51. package/src/app/assets/flags/BL.svg +1 -0
  52. package/src/app/assets/flags/BM.svg +1 -0
  53. package/src/app/assets/flags/BN.svg +1 -0
  54. package/src/app/assets/flags/BO.svg +1 -0
  55. package/src/app/assets/flags/BQ-BO.svg +1 -0
  56. package/src/app/assets/flags/BQ-SA.svg +1 -0
  57. package/src/app/assets/flags/BQ-SE.svg +1 -0
  58. package/src/app/assets/flags/BQ.svg +1 -0
  59. package/src/app/assets/flags/BR.svg +1 -0
  60. package/src/app/assets/flags/BS.svg +1 -0
  61. package/src/app/assets/flags/BT.svg +1 -0
  62. package/src/app/assets/flags/BV.svg +1 -0
  63. package/src/app/assets/flags/BW.svg +1 -0
  64. package/src/app/assets/flags/BY.svg +1 -0
  65. package/src/app/assets/flags/BZ.svg +1 -0
  66. package/src/app/assets/flags/CA.svg +1 -0
  67. package/src/app/assets/flags/CC.svg +1 -0
  68. package/src/app/assets/flags/CD.svg +1 -0
  69. package/src/app/assets/flags/CF.svg +1 -0
  70. package/src/app/assets/flags/CG.svg +1 -0
  71. package/src/app/assets/flags/CH.svg +1 -0
  72. package/src/app/assets/flags/CI.svg +1 -0
  73. package/src/app/assets/flags/CK.svg +1 -0
  74. package/src/app/assets/flags/CL.svg +1 -0
  75. package/src/app/assets/flags/CM.svg +1 -0
  76. package/src/app/assets/flags/CN.svg +1 -0
  77. package/src/app/assets/flags/CO.svg +1 -0
  78. package/src/app/assets/flags/CR.svg +1 -0
  79. package/src/app/assets/flags/CU.svg +1 -0
  80. package/src/app/assets/flags/CV.svg +1 -0
  81. package/src/app/assets/flags/CW.svg +1 -0
  82. package/src/app/assets/flags/CX.svg +1 -0
  83. package/src/app/assets/flags/CY.svg +1 -0
  84. package/src/app/assets/flags/CZ.svg +1 -0
  85. package/src/app/assets/flags/DE.svg +1 -0
  86. package/src/app/assets/flags/DJ.svg +1 -0
  87. package/src/app/assets/flags/DK.svg +1 -0
  88. package/src/app/assets/flags/DM.svg +1 -0
  89. package/src/app/assets/flags/DO.svg +1 -0
  90. package/src/app/assets/flags/DZ.svg +1 -0
  91. package/src/app/assets/flags/EC.svg +1 -0
  92. package/src/app/assets/flags/EE.svg +1 -0
  93. package/src/app/assets/flags/EG.svg +1 -0
  94. package/src/app/assets/flags/EH.svg +1 -0
  95. package/src/app/assets/flags/ER.svg +1 -0
  96. package/src/app/assets/flags/ES-CT.svg +1 -0
  97. package/src/app/assets/flags/ES.svg +1 -0
  98. package/src/app/assets/flags/ET.svg +1 -0
  99. package/src/app/assets/flags/EU.svg +1 -0
  100. package/src/app/assets/flags/FI.svg +1 -0
  101. package/src/app/assets/flags/FJ.svg +1 -0
  102. package/src/app/assets/flags/FK.svg +1 -0
  103. package/src/app/assets/flags/FM.svg +1 -0
  104. package/src/app/assets/flags/FO.svg +1 -0
  105. package/src/app/assets/flags/FR.svg +1 -0
  106. package/src/app/assets/flags/GA.svg +1 -0
  107. package/src/app/assets/flags/GB-ENG.svg +1 -0
  108. package/src/app/assets/flags/GB-NIR.svg +1 -0
  109. package/src/app/assets/flags/GB-SCT.svg +1 -0
  110. package/src/app/assets/flags/GB-WLS.svg +1 -0
  111. package/src/app/assets/flags/GB.svg +1 -0
  112. package/src/app/assets/flags/GD.svg +1 -0
  113. package/src/app/assets/flags/GE.svg +1 -0
  114. package/src/app/assets/flags/GF.svg +1 -0
  115. package/src/app/assets/flags/GG.svg +1 -0
  116. package/src/app/assets/flags/GH.svg +1 -0
  117. package/src/app/assets/flags/GI.svg +1 -0
  118. package/src/app/assets/flags/GL.svg +1 -0
  119. package/src/app/assets/flags/GM.svg +1 -0
  120. package/src/app/assets/flags/GN.svg +1 -0
  121. package/src/app/assets/flags/GP.svg +1 -0
  122. package/src/app/assets/flags/GQ.svg +1 -0
  123. package/src/app/assets/flags/GR.svg +1 -0
  124. package/src/app/assets/flags/GS.svg +1 -0
  125. package/src/app/assets/flags/GT.svg +1 -0
  126. package/src/app/assets/flags/GU.svg +1 -0
  127. package/src/app/assets/flags/GW.svg +1 -0
  128. package/src/app/assets/flags/GY.svg +1 -0
  129. package/src/app/assets/flags/HK.svg +1 -0
  130. package/src/app/assets/flags/HM.svg +1 -0
  131. package/src/app/assets/flags/HN.svg +1 -0
  132. package/src/app/assets/flags/HR.svg +1 -0
  133. package/src/app/assets/flags/HT.svg +1 -0
  134. package/src/app/assets/flags/HU.svg +1 -0
  135. package/src/app/assets/flags/IC.svg +1 -0
  136. package/src/app/assets/flags/ID.svg +1 -0
  137. package/src/app/assets/flags/IE.svg +1 -0
  138. package/src/app/assets/flags/IL.svg +1 -0
  139. package/src/app/assets/flags/IM.svg +1 -0
  140. package/src/app/assets/flags/IN.svg +1 -0
  141. package/src/app/assets/flags/IO.svg +1 -0
  142. package/src/app/assets/flags/IQ.svg +1 -0
  143. package/src/app/assets/flags/IR.svg +1 -0
  144. package/src/app/assets/flags/IS.svg +1 -0
  145. package/src/app/assets/flags/IT.svg +1 -0
  146. package/src/app/assets/flags/JE.svg +1 -0
  147. package/src/app/assets/flags/JM.svg +1 -0
  148. package/src/app/assets/flags/JO.svg +1 -0
  149. package/src/app/assets/flags/JP.svg +1 -0
  150. package/src/app/assets/flags/KE.svg +1 -0
  151. package/src/app/assets/flags/KG.svg +1 -0
  152. package/src/app/assets/flags/KH.svg +1 -0
  153. package/src/app/assets/flags/KI.svg +1 -0
  154. package/src/app/assets/flags/KM.svg +1 -0
  155. package/src/app/assets/flags/KN.svg +1 -0
  156. package/src/app/assets/flags/KP.svg +1 -0
  157. package/src/app/assets/flags/KR.svg +1 -0
  158. package/src/app/assets/flags/KW.svg +1 -0
  159. package/src/app/assets/flags/KY.svg +1 -0
  160. package/src/app/assets/flags/KZ.svg +1 -0
  161. package/src/app/assets/flags/LA.svg +1 -0
  162. package/src/app/assets/flags/LB.svg +1 -0
  163. package/src/app/assets/flags/LC.svg +1 -0
  164. package/src/app/assets/flags/LI.svg +1 -0
  165. package/src/app/assets/flags/LK.svg +1 -0
  166. package/src/app/assets/flags/LR.svg +1 -0
  167. package/src/app/assets/flags/LS.svg +1 -0
  168. package/src/app/assets/flags/LT.svg +1 -0
  169. package/src/app/assets/flags/LU.svg +1 -0
  170. package/src/app/assets/flags/LV.svg +1 -0
  171. package/src/app/assets/flags/LY.svg +1 -0
  172. package/src/app/assets/flags/MA.svg +1 -0
  173. package/src/app/assets/flags/MC.svg +1 -0
  174. package/src/app/assets/flags/MD.svg +1 -0
  175. package/src/app/assets/flags/ME.svg +1 -0
  176. package/src/app/assets/flags/MF.svg +1 -0
  177. package/src/app/assets/flags/MG.svg +1 -0
  178. package/src/app/assets/flags/MH.svg +1 -0
  179. package/src/app/assets/flags/MK.svg +1 -0
  180. package/src/app/assets/flags/ML.svg +1 -0
  181. package/src/app/assets/flags/MM.svg +1 -0
  182. package/src/app/assets/flags/MN.svg +1 -0
  183. package/src/app/assets/flags/MO.svg +1 -0
  184. package/src/app/assets/flags/MP.svg +1 -0
  185. package/src/app/assets/flags/MQ.svg +1 -0
  186. package/src/app/assets/flags/MR.svg +1 -0
  187. package/src/app/assets/flags/MS.svg +1 -0
  188. package/src/app/assets/flags/MT.svg +1 -0
  189. package/src/app/assets/flags/MU.svg +1 -0
  190. package/src/app/assets/flags/MV.svg +1 -0
  191. package/src/app/assets/flags/MW.svg +1 -0
  192. package/src/app/assets/flags/MX.svg +1 -0
  193. package/src/app/assets/flags/MY.svg +1 -0
  194. package/src/app/assets/flags/MZ.svg +1 -0
  195. package/src/app/assets/flags/NA.svg +1 -0
  196. package/src/app/assets/flags/NC.svg +1 -0
  197. package/src/app/assets/flags/NE.svg +1 -0
  198. package/src/app/assets/flags/NF.svg +1 -0
  199. package/src/app/assets/flags/NG.svg +1 -0
  200. package/src/app/assets/flags/NI.svg +1 -0
  201. package/src/app/assets/flags/NL.svg +1 -0
  202. package/src/app/assets/flags/NO.svg +1 -0
  203. package/src/app/assets/flags/NP.svg +1 -0
  204. package/src/app/assets/flags/NR.svg +1 -0
  205. package/src/app/assets/flags/NU.svg +1 -0
  206. package/src/app/assets/flags/NZ.svg +1 -0
  207. package/src/app/assets/flags/OM.svg +1 -0
  208. package/src/app/assets/flags/PA.svg +1 -0
  209. package/src/app/assets/flags/PE.svg +1 -0
  210. package/src/app/assets/flags/PF.svg +1 -0
  211. package/src/app/assets/flags/PG.svg +1 -0
  212. package/src/app/assets/flags/PH.svg +1 -0
  213. package/src/app/assets/flags/PK.svg +1 -0
  214. package/src/app/assets/flags/PL.svg +1 -0
  215. package/src/app/assets/flags/PM.svg +1 -0
  216. package/src/app/assets/flags/PN.svg +1 -0
  217. package/src/app/assets/flags/PR.svg +1 -0
  218. package/src/app/assets/flags/PS.svg +1 -0
  219. package/src/app/assets/flags/PT.svg +1 -0
  220. package/src/app/assets/flags/PW.svg +1 -0
  221. package/src/app/assets/flags/PY.svg +1 -0
  222. package/src/app/assets/flags/QA.svg +1 -0
  223. package/src/app/assets/flags/RE.svg +1 -0
  224. package/src/app/assets/flags/README.md +6 -0
  225. package/src/app/assets/flags/RO.svg +1 -0
  226. package/src/app/assets/flags/RS.svg +1 -0
  227. package/src/app/assets/flags/RU.svg +1 -0
  228. package/src/app/assets/flags/RW.svg +1 -0
  229. package/src/app/assets/flags/SA.svg +1 -0
  230. package/src/app/assets/flags/SB.svg +1 -0
  231. package/src/app/assets/flags/SC.svg +1 -0
  232. package/src/app/assets/flags/SD.svg +1 -0
  233. package/src/app/assets/flags/SE.svg +1 -0
  234. package/src/app/assets/flags/SG.svg +1 -0
  235. package/src/app/assets/flags/SH.svg +1 -0
  236. package/src/app/assets/flags/SI.svg +1 -0
  237. package/src/app/assets/flags/SJ.svg +1 -0
  238. package/src/app/assets/flags/SK.svg +1 -0
  239. package/src/app/assets/flags/SL.svg +1 -0
  240. package/src/app/assets/flags/SM.svg +1 -0
  241. package/src/app/assets/flags/SN.svg +1 -0
  242. package/src/app/assets/flags/SO.svg +1 -0
  243. package/src/app/assets/flags/SR.svg +1 -0
  244. package/src/app/assets/flags/SS.svg +1 -0
  245. package/src/app/assets/flags/ST.svg +1 -0
  246. package/src/app/assets/flags/SV.svg +1 -0
  247. package/src/app/assets/flags/SX.svg +1 -0
  248. package/src/app/assets/flags/SY.svg +1 -0
  249. package/src/app/assets/flags/SZ.svg +1 -0
  250. package/src/app/assets/flags/TA.svg +1 -0
  251. package/src/app/assets/flags/TC.svg +1 -0
  252. package/src/app/assets/flags/TD.svg +1 -0
  253. package/src/app/assets/flags/TF.svg +1 -0
  254. package/src/app/assets/flags/TG.svg +1 -0
  255. package/src/app/assets/flags/TH.svg +1 -0
  256. package/src/app/assets/flags/TJ.svg +1 -0
  257. package/src/app/assets/flags/TK.svg +1 -0
  258. package/src/app/assets/flags/TL.svg +1 -0
  259. package/src/app/assets/flags/TM.svg +1 -0
  260. package/src/app/assets/flags/TN.svg +1 -0
  261. package/src/app/assets/flags/TO.svg +1 -0
  262. package/src/app/assets/flags/TR.svg +1 -0
  263. package/src/app/assets/flags/TT.svg +1 -0
  264. package/src/app/assets/flags/TV.svg +1 -0
  265. package/src/app/assets/flags/TW.svg +1 -0
  266. package/src/app/assets/flags/TZ.svg +1 -0
  267. package/src/app/assets/flags/UA.svg +1 -0
  268. package/src/app/assets/flags/UG.svg +1 -0
  269. package/src/app/assets/flags/UM.svg +1 -0
  270. package/src/app/assets/flags/US.svg +1 -0
  271. package/src/app/assets/flags/UY.svg +1 -0
  272. package/src/app/assets/flags/UZ.svg +1 -0
  273. package/src/app/assets/flags/VA.svg +1 -0
  274. package/src/app/assets/flags/VC.svg +1 -0
  275. package/src/app/assets/flags/VE.svg +1 -0
  276. package/src/app/assets/flags/VG.svg +1 -0
  277. package/src/app/assets/flags/VI.svg +1 -0
  278. package/src/app/assets/flags/VN.svg +1 -0
  279. package/src/app/assets/flags/VU.svg +1 -0
  280. package/src/app/assets/flags/WF.svg +1 -0
  281. package/src/app/assets/flags/WS.svg +1 -0
  282. package/src/app/assets/flags/XA.svg +1 -0
  283. package/src/app/assets/flags/XC.svg +1 -0
  284. package/src/app/assets/flags/XK.svg +1 -0
  285. package/src/app/assets/flags/XO.svg +1 -0
  286. package/src/app/assets/flags/YE.svg +1 -0
  287. package/src/app/assets/flags/YT.svg +1 -0
  288. package/src/app/assets/flags/ZA.svg +1 -0
  289. package/src/app/assets/flags/ZM.svg +1 -0
  290. package/src/app/assets/flags/ZW.svg +1 -0
  291. package/src/app/email-preview.ts +46 -0
  292. package/src/app/index.css +203 -0
  293. package/src/app/index.html +12 -0
  294. package/src/app/integrations/i18n/react-i18next.d.ts +11 -0
  295. package/src/app/integrations/i18n/root-provider.tsx +62 -0
  296. package/src/app/integrations/tanstack-query/devtools.tsx +6 -0
  297. package/src/app/integrations/tanstack-query/root-provider.tsx +37 -0
  298. package/src/app/integrations/theme/root-provider.tsx +75 -0
  299. package/src/app/integrations/toast/toast-provider.tsx +46 -0
  300. package/src/app/locales/en-US/common.ts +268 -0
  301. package/src/app/locales/zh-CN/common.ts +263 -0
  302. package/src/app/main.tsx +40 -0
  303. package/src/app/page-chrome.tsx +79 -0
  304. package/src/app/router.tsx +40 -0
  305. package/src/app/routes/__root.tsx +293 -0
  306. package/src/app/routes/emails.tsx +199 -0
  307. package/src/app/routes/home.tsx +87 -0
  308. package/src/app/routes/index.ts +19 -0
  309. package/src/app/routes/metrics.tsx +541 -0
  310. package/src/app/routes/segment-overview.tsx +211 -0
  311. package/src/app/routes/segments.tsx +236 -0
  312. package/src/app/routes/settings.tsx +90 -0
  313. package/src/app/routes/workflows.tsx +348 -0
  314. package/src/app/studio.ts +16 -0
  315. package/src/app/svg.d.ts +17 -0
  316. package/src/app/virtual-config.d.ts +6 -0
  317. package/src/cli.ts +110 -0
  318. package/src/components/avatar.tsx +57 -0
  319. package/src/components/breadcrumb.tsx +49 -0
  320. package/src/components/button/index.tsx +86 -0
  321. package/src/components/channel-icon.ts +39 -0
  322. package/src/components/chat-markup.tsx +109 -0
  323. package/src/components/corner-shape.ts +13 -0
  324. package/src/components/date-range.tsx +181 -0
  325. package/src/components/discord-preview.tsx +165 -0
  326. package/src/components/dropdown/index.tsx +172 -0
  327. package/src/components/email-defaults.tsx +40 -0
  328. package/src/components/email-list.tsx +149 -0
  329. package/src/components/email-thumbnail.tsx +123 -0
  330. package/src/components/flag.tsx +40 -0
  331. package/src/components/input/index.tsx +40 -0
  332. package/src/components/input/search-input.tsx +24 -0
  333. package/src/components/layout.ts +403 -0
  334. package/src/components/menu/index.tsx +118 -0
  335. package/src/components/metric-card.tsx +321 -0
  336. package/src/components/modal/index.tsx +70 -0
  337. package/src/components/nav-drawer.tsx +84 -0
  338. package/src/components/node-inspector.tsx +242 -0
  339. package/src/components/profile-drawer.tsx +331 -0
  340. package/src/components/push-preview.tsx +470 -0
  341. package/src/components/push-thumbnail.tsx +78 -0
  342. package/src/components/segment-list.tsx +184 -0
  343. package/src/components/select/index.tsx +70 -0
  344. package/src/components/series-chart.tsx +120 -0
  345. package/src/components/slack-preview.tsx +223 -0
  346. package/src/components/sparkline.tsx +58 -0
  347. package/src/components/tabs/index.tsx +45 -0
  348. package/src/components/template-refs.ts +110 -0
  349. package/src/components/templates-page.tsx +601 -0
  350. package/src/components/textarea/index.tsx +37 -0
  351. package/src/components/thumbnail-window.tsx +65 -0
  352. package/src/components/workflow-canvas.tsx +503 -0
  353. package/src/components/workflow-list.tsx +231 -0
  354. package/src/config.ts +288 -0
  355. package/src/generate.ts +56 -0
  356. package/src/index.ts +35 -0
  357. package/src/postgres.ts +415 -0
  358. package/src/server/project.ts +290 -0
  359. package/src/server.ts +500 -0
  360. package/src/utils/cn.ts +6 -0
  361. package/src/utils/label.ts +12 -0
  362. package/src/utils/lookup.ts +11 -0
  363. package/src/utils/template-content.ts +213 -0
@@ -0,0 +1,231 @@
1
+ import type { NodeIR, WorkflowIR } from '@shware/workflow';
2
+ import { clsx } from 'clsx';
3
+ import { AlarmClock, Mail, Workflow as WorkflowIcon } from 'lucide-react';
4
+ import { useTranslation } from 'react-i18next';
5
+ import type { WorkflowReport } from '../config';
6
+ import { displayName } from '../utils/label';
7
+ import { superellipse } from './corner-shape';
8
+ import { Sparkline } from './sparkline';
9
+
10
+ /**
11
+ * The workflows list: one row per definition with its shape (how many
12
+ * messages, how many waits) and the funnel from the stats source, all inside
13
+ * a single card.
14
+ *
15
+ * One card of rows rather than a card per workflow: the four funnel numbers
16
+ * are only worth showing because they can be read down a column, and a grid
17
+ * of tiles breaks exactly that. Below `md` there are no columns left to align,
18
+ * so a row folds into title-then-stats instead.
19
+ */
20
+ export interface WorkflowListProps {
21
+ /** Local definitions, keyed by the id used in the URL. */
22
+ items: { key: string; ir: WorkflowIR }[];
23
+ reports?: WorkflowReport[];
24
+ onOpen: (key: string) => void;
25
+ }
26
+
27
+ /** Count message and delay nodes across the whole tree, arms included. */
28
+ function countNodes(nodes: readonly NodeIR[], acc = { messages: 0, delays: 0 }) {
29
+ for (const node of nodes) {
30
+ if (node.type === 'message') acc.messages++;
31
+ if (node.type === 'delay' || node.type === 'random_delay' || node.type === 'wait_until') {
32
+ acc.delays++;
33
+ }
34
+ if (node.type === 'branch') {
35
+ for (const branchCase of node.cases) countNodes(branchCase.flow, acc);
36
+ if (node.otherwise) countNodes(node.otherwise, acc);
37
+ }
38
+ if (node.type === 'cohort') for (const arm of node.arms) countNodes(arm.flow, acc);
39
+ if (node.type === 'wait_until' && Array.isArray(node.onTimeout)) {
40
+ countNodes(node.onTimeout, acc);
41
+ }
42
+ }
43
+ return acc;
44
+ }
45
+
46
+ const compact = (value: number) =>
47
+ value >= 1000
48
+ ? `${(value / 1000).toFixed(2).replace(/0+$/, '').replace(/\.$/, '')}k`
49
+ : `${value}`;
50
+
51
+ const rate = (part: number | undefined, whole: number | undefined) =>
52
+ part === undefined || whole === undefined || whole === 0
53
+ ? '—'
54
+ : `${((part / whole) * 100).toFixed(1)}%`;
55
+
56
+ const COLUMNS = ['delivered', 'opened', 'clicked', 'converted'] as const;
57
+
58
+ /*
59
+ * Not pinned: the app header is the only sticky chrome, so the head scrolls
60
+ * away with the rows and needs no opaque fill of its own. The radii stay —
61
+ * the card has no `overflow` to clip with, so its top corners are cut here.
62
+ */
63
+ const HEAD_CELL = 'border-border border-b py-3 first:rounded-tl-2xl last:rounded-tr-2xl';
64
+
65
+ /*
66
+ * Stacked, every cell is inset by the row's own padding instead of its own,
67
+ * so the four metrics line up with the title above them and the row's hover
68
+ * fill still reaches the card's edges.
69
+ */
70
+ const CELL = 'border-border border-b py-4 max-md:border-b-0 max-md:px-3';
71
+
72
+ /*
73
+ * The studio's palette is monochrome; colour is reserved for state. Running /
74
+ * draft is state, so it keeps green and grey.
75
+ */
76
+
77
+ export function WorkflowList({ items, reports, onOpen }: WorkflowListProps) {
78
+ const { t } = useTranslation();
79
+ const byId = new Map((reports ?? []).map((report) => [report.id, report]));
80
+
81
+ return (
82
+ /*
83
+ * No `overflow` on the card, deliberately: any value at all turns it into
84
+ * a scrollport of its own and draws a second bar inset inside the border —
85
+ * the page is the one scroller (see __root). Nothing clips, so the corners
86
+ * are re-cut on the first and last cells below.
87
+ */
88
+ <div className="border-border bg-card rounded-2xl border" style={superellipse}>
89
+ {/* Below `md` the table leaves table layout entirely and each row lays
90
+ itself out as a four-column grid — see the row classes. */}
91
+ <table className="w-full table-fixed border-separate border-spacing-0 text-sm max-md:block">
92
+ <thead className="max-md:hidden">
93
+ <tr className="text-muted text-left text-xs font-medium">
94
+ <th className={clsx(HEAD_CELL, 'min-w-0 px-6')} style={superellipse}>
95
+ {t('common.name')}
96
+ </th>
97
+ <th className={clsx(HEAD_CELL, 'w-28 px-3')} style={superellipse} />
98
+ {COLUMNS.map((column) => (
99
+ <th key={column} className={clsx(HEAD_CELL, 'w-28 px-3')} style={superellipse}>
100
+ {t(`workflows.columns.${column}`)}
101
+ </th>
102
+ ))}
103
+ </tr>
104
+ </thead>
105
+ <tbody className="max-md:block">
106
+ {items.map(({ key, ir }) => {
107
+ const shape = countNodes(ir.flow);
108
+ const report = byId.get(ir.id);
109
+ const values: Record<(typeof COLUMNS)[number], string> = {
110
+ delivered: report?.delivered === undefined ? '—' : compact(report.delivered),
111
+ opened: rate(report?.opened, report?.delivered),
112
+ clicked: rate(report?.clicked, report?.delivered),
113
+ converted: rate(report?.converted, report?.entered),
114
+ };
115
+
116
+ return (
117
+ <tr
118
+ key={key}
119
+ onClick={() => onOpen(key)}
120
+ className={clsx(
121
+ 'cursor-pointer align-top [&>td]:transition-colors',
122
+ /*
123
+ * Laid out as a table the hover fill has to live on the
124
+ * cells: a row box paints its background underneath them,
125
+ * where no cell radius reaches it, so the last row would
126
+ * poke square grey corners out of the card. Stacked, the row
127
+ * is an ordinary grid box and takes fill and radius itself.
128
+ */
129
+ 'md:hover:[&>td]:bg-hover md:last:[&>td]:border-b-0',
130
+ 'md:last:[&>td:first-child]:rounded-bl-2xl md:last:[&>td:last-child]:rounded-br-2xl',
131
+ /* Stacked: title / status / the metrics two by two
132
+ — four across a phone leaves no room for a label, let
133
+ alone the sparkline under it. */
134
+ 'border-border max-md:hover:bg-hover max-md:grid max-md:grid-cols-6',
135
+ 'max-md:border-b max-md:px-3 max-md:first:rounded-t-2xl',
136
+ 'max-md:last:rounded-b-2xl max-md:last:border-b-0'
137
+ )}
138
+ style={superellipse}
139
+ >
140
+ <td
141
+ className={clsx(CELL, 'px-6 max-md:order-1 max-md:col-span-6 max-md:pb-2')}
142
+ style={superellipse}
143
+ >
144
+ <div className="flex items-start gap-3">
145
+ <WorkflowIcon className="text-muted mt-0.5 size-4 shrink-0" strokeWidth={2} />
146
+ <div className="min-w-0">
147
+ <div
148
+ className={clsx(
149
+ 'truncate font-medium',
150
+ ir.meta?.name === undefined ? 'text-muted italic' : 'text-primary'
151
+ )}
152
+ >
153
+ {displayName(ir.meta?.name, t('common.untitled'))}
154
+ </div>
155
+ {/*
156
+ Below md these two step back out of the title's indent
157
+ (the 16px icon plus its 12px gap). The stacked rows under
158
+ them — status, then the funnel — start at the card's edge,
159
+ so keeping the indent here left a notch down the side.
160
+ */}
161
+ {ir.meta?.description !== undefined && (
162
+ <p className="text-muted mt-1 truncate text-sm max-md:-ml-7">
163
+ {ir.meta.description}
164
+ </p>
165
+ )}
166
+ <div className="text-muted mt-2 flex items-center gap-3 text-xs max-md:-ml-7">
167
+ <span className="flex items-center gap-1">
168
+ <Mail className="size-3.5" strokeWidth={2} />
169
+ {shape.messages}
170
+ </span>
171
+ <span className="flex items-center gap-1">
172
+ <AlarmClock className="size-3.5" strokeWidth={2} />
173
+ {shape.delays}
174
+ </span>
175
+ </div>
176
+ </div>
177
+ </div>
178
+ </td>
179
+
180
+ {/* Second in the DOM so the desktop column order holds; `order`
181
+ moves it under the title once the row is a grid. */}
182
+ <td
183
+ className={clsx(
184
+ CELL,
185
+ 'px-3 max-md:order-3 max-md:col-span-6 max-md:pt-0 max-md:pb-3'
186
+ )}
187
+ style={superellipse}
188
+ >
189
+ <span
190
+ className={clsx(
191
+ 'inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap',
192
+ report
193
+ ? 'bg-green-50 text-green-700 dark:bg-green-400/10 dark:text-green-300'
194
+ : 'bg-selected text-muted'
195
+ )}
196
+ >
197
+ <span
198
+ className={clsx(
199
+ 'size-1.5 rounded-full',
200
+ report ? 'bg-green-500' : 'bg-muted'
201
+ )}
202
+ />
203
+ {report ? t('status.running') : t('status.draft')}
204
+ </span>
205
+ </td>
206
+
207
+ {COLUMNS.map((column) => (
208
+ <td
209
+ key={column}
210
+ className={clsx(
211
+ CELL,
212
+ 'px-3 max-md:order-4 max-md:col-span-3 max-md:pt-0 max-md:pb-4'
213
+ )}
214
+ style={superellipse}
215
+ >
216
+ {/* The head is gone when stacked, so each figure names itself. */}
217
+ <div className="text-muted mb-1 truncate text-xs md:hidden">
218
+ {t(`workflows.columns.${column}`)}
219
+ </div>
220
+ <div className="tabular-nums">{values[column]}</div>
221
+ <Sparkline values={report?.series?.[column] ?? []} className="mt-1" />
222
+ </td>
223
+ ))}
224
+ </tr>
225
+ );
226
+ })}
227
+ </tbody>
228
+ </table>
229
+ </div>
230
+ );
231
+ }
package/src/config.ts ADDED
@@ -0,0 +1,288 @@
1
+ import type {
2
+ DiscordTemplate,
3
+ EmailTemplate,
4
+ PushTemplate,
5
+ SegmentIR,
6
+ SlackTemplate,
7
+ WorkflowIR,
8
+ } from '@shware/workflow';
9
+
10
+ /**
11
+ * The studio's own types: the stats source it reads numbers from
12
+ * (`workflow.stats.ts`, `defineStats`) and the shape the app receives from the
13
+ * dev server. The project itself is `@shware/workflow`'s `defineConfig({...})`
14
+ * in workflow.config.ts — the studio reads it, it defines nothing of its own.
15
+ */
16
+
17
+ /** Node id → how many users currently sit on that node. */
18
+ export type NodeStats = Record<string, number>;
19
+
20
+ /** Per-workflow totals for the list and metrics views. */
21
+ export interface WorkflowReport {
22
+ /** The workflow's id, matching `WorkflowIR.id`. */
23
+ id: string;
24
+ entered: number;
25
+ completed: number;
26
+ /** Reached the goal (a conversion). */
27
+ converted: number;
28
+ /** Currently in flight. */
29
+ active: number;
30
+ /** Messages delivered; rates below are computed against it. */
31
+ delivered?: number;
32
+ opened?: number;
33
+ clicked?: number;
34
+ /** Recent daily counts, oldest first — drives the sparklines in the list. */
35
+ series?: {
36
+ delivered?: number[];
37
+ opened?: number[];
38
+ clicked?: number[];
39
+ converted?: number[];
40
+ };
41
+ }
42
+
43
+ /* ------------------------------ Overview query ------------------------------ */
44
+
45
+ /**
46
+ * The channel dimension analytics reports on.
47
+ *
48
+ * Deliberately *not* the DSL's `ChannelIR`. That enum says what the author
49
+ * asked for ("send a push"); this says where the message actually landed, and
50
+ * the two do not line up: one `push` node fans out to iOS and Android, whose
51
+ * delivery and open behaviour differ enough that reading them summed hides the
52
+ * problem you opened this page to find. Going the other way, a project can
53
+ * report on a transport the DSL has no builder for yet — a webhook — without
54
+ * the IR having to grow a node type first.
55
+ *
56
+ * So the mapping is many-to-many and belongs to whoever measures delivery, not
57
+ * to the compiler. In-product surfaces (`in_app`, `survey`) are absent on
58
+ * purpose: they have no transport receipt, no open pixel and no unsubscribe,
59
+ * so none of the funnel below is defined for them.
60
+ */
61
+ export type MetricChannel =
62
+ | 'email'
63
+ | 'push_ios'
64
+ | 'push_android'
65
+ | 'push_web'
66
+ | 'slack'
67
+ | 'discord'
68
+ | 'sms'
69
+ | 'webhook';
70
+
71
+ /** Every channel, in the order the studio's pickers list them. */
72
+ export const METRIC_CHANNELS = [
73
+ 'email',
74
+ 'push_ios',
75
+ 'push_android',
76
+ 'push_web',
77
+ 'slack',
78
+ 'discord',
79
+ 'sms',
80
+ 'webhook',
81
+ ] as const satisfies readonly MetricChannel[];
82
+
83
+ /** Bucket width for a time series. */
84
+ export type Granularity = 'day' | 'week' | 'month';
85
+
86
+ /**
87
+ * What every Overview panel is scoped by. Dates are ISO `YYYY-MM-DD` and both
88
+ * ends are inclusive — a report reads "Aug 21 to Sep 19", not "up to but
89
+ * excluding Sep 20".
90
+ */
91
+ export interface StatsRange {
92
+ from: string;
93
+ to: string;
94
+ /** Absent means every channel summed. */
95
+ channel?: MetricChannel;
96
+ }
97
+
98
+ /** A range plus the bucket width, for the time series behind the chart cards. */
99
+ export interface MetricsQuery extends StatsRange {
100
+ granularity: Granularity;
101
+ }
102
+
103
+ /**
104
+ * One bucket of a workflow's delivery funnel.
105
+ *
106
+ * `sent` and `delivered` are two different facts and the UI shows both: sent is
107
+ * what we handed the transport, delivered is what it accepted. The gap between
108
+ * them is the bounce rate, which is invisible if you only keep one of them —
109
+ * which is why `delivered` was not simply renamed when the Sent card arrived.
110
+ *
111
+ * Opens and clicks carry an optional human/machine split. Not every transport
112
+ * can tell the two apart — most have nothing to tell apart — so the halves are
113
+ * optional, and the studio plots three lines only for a query whose every
114
+ * bucket reports them. Where they are reported, `opened` must equal
115
+ * `openedHuman + openedMachine` and `clicked` its own pair: the studio rates
116
+ * all three against one denominator so the lines add up on screen, and a
117
+ * source that recounts the halves independently would draw a chart that
118
+ * visibly does not.
119
+ */
120
+ export interface MetricPoint {
121
+ /** Bucket start, ISO `YYYY-MM-DD`; used verbatim on the x axis. */
122
+ date: string;
123
+ sent: number;
124
+ delivered: number;
125
+ opened: number;
126
+ /**
127
+ * Opens a person caused. The rest is infrastructure: Apple's Mail Privacy
128
+ * Protection prefetches the tracking pixel for everything it relays, whether
129
+ * or not the mail is ever read, and Gmail's image proxy caches it — which is
130
+ * why a raw open rate has been unusable as a measure of attention since 2021.
131
+ */
132
+ openedHuman?: number;
133
+ /** Opens attributed to a proxy, relay or scanner rather than a reader. */
134
+ openedMachine?: number;
135
+ clicked: number;
136
+ /** Clicks a person caused. */
137
+ clickedHuman?: number;
138
+ /** Clicks attributed to a link prefetcher or a security scanner following links. */
139
+ clickedMachine?: number;
140
+ /** Users who entered the workflow in this bucket: the conversion rate's denominator. */
141
+ entered: number;
142
+ /**
143
+ * Of the users who entered in this bucket, those who reached the goal — counted against their
144
+ * entry, not the day they converted, so `converted / entered` is a share of one cohort and
145
+ * never passes 100%.
146
+ */
147
+ converted: number;
148
+ }
149
+
150
+ /** One destination URL and how often it was clicked over the queried range. */
151
+ export interface LinkStat {
152
+ /** The URL as it appears in the message, before any click-tracking rewrite. */
153
+ url: string;
154
+ clicks: number;
155
+ }
156
+
157
+ /**
158
+ * One message node's funnel over the queried range.
159
+ *
160
+ * Identity is the node id, not the template: the same template sent twice in a
161
+ * flow is two rows, because "which send underperforms" is the question this
162
+ * table answers. No display name here — the studio already holds the IR and the
163
+ * template registries, so it resolves the label itself and this stays about
164
+ * numbers.
165
+ */
166
+ export interface MessageStat {
167
+ /** IR node id (the structural path), pinpointing the send site. */
168
+ nodeId: string;
169
+ /** Template registry key; the row links to it. */
170
+ template: string;
171
+ channel: MetricChannel;
172
+ sent: number;
173
+ /** Accepted by the transport — `sent` minus bounces. */
174
+ delivered: number;
175
+ opened: number;
176
+ clicked: number;
177
+ /** Opt-outs attributed to this send. */
178
+ unsubscribed: number;
179
+ }
180
+
181
+ /**
182
+ * How many users a segment currently holds, and how that has moved.
183
+ *
184
+ * A segment's definition is code, but its size is not derivable from code at
185
+ * all — it is a fact about the user base, and the only thing that tells you
186
+ * whether a condition matches the population you meant.
187
+ */
188
+ export interface SegmentReport {
189
+ /** The segment's id, matching `SegmentIR.id`. */
190
+ id: string;
191
+ /** Users in the segment right now. */
192
+ size: number;
193
+ /** Recent daily sizes, oldest first — drives the sparkline in the list. */
194
+ series?: number[];
195
+ }
196
+
197
+ /**
198
+ * One person in the audience. `id` and the timestamps are the columns every
199
+ * project has; everything else it knows about them lives in `properties`,
200
+ * because a profile's shape is the user's schema, not ours.
201
+ */
202
+ export interface Profile {
203
+ id: string;
204
+ email?: string;
205
+ /** ISO timestamp; rendered as a date. */
206
+ createdAt?: string;
207
+ /** Whatever the project stores — the same keys the DSL's `u.xxx` references. */
208
+ properties?: Record<string, unknown>;
209
+ }
210
+
211
+ /** One page of profiles, plus the total so the UI can say "showing N of M". */
212
+ export interface ProfilePage {
213
+ profiles: Profile[];
214
+ total: number;
215
+ }
216
+
217
+ /** Paging window for a profile query. */
218
+ export interface ProfileQuery {
219
+ limit: number;
220
+ offset: number;
221
+ }
222
+
223
+ /**
224
+ * Where runtime numbers come from. Without one the studio renders the reports
225
+ * view in demo mode and says so — it never passes mock data off as real.
226
+ */
227
+ export interface StatsSource {
228
+ /** Totals per workflow. */
229
+ reports?: () => Promise<WorkflowReport[]> | WorkflowReport[];
230
+ /** Size per segment. */
231
+ segments?: () => Promise<SegmentReport[]> | SegmentReport[];
232
+ /** Who is in one segment right now, a page at a time. */
233
+ profiles?: (segmentName: string, query: ProfileQuery) => Promise<ProfilePage> | ProfilePage;
234
+ /** Users waiting on each node of one workflow (drives the canvas badges). */
235
+ nodeStats?: (workflowName: string) => Promise<NodeStats> | NodeStats;
236
+ /** Time series behind the Overview's chart cards, bucketed as asked. */
237
+ metrics?: (workflowName: string, query: MetricsQuery) => Promise<MetricPoint[]> | MetricPoint[];
238
+ /** Most-clicked destinations across the whole workflow, any order. */
239
+ links?: (workflowName: string, query: StatsRange) => Promise<LinkStat[]> | LinkStat[];
240
+ /** Per-send funnel, one row per message node. */
241
+ messages?: (workflowName: string, query: StatsRange) => Promise<MessageStat[]> | MessageStat[];
242
+ }
243
+
244
+ /**
245
+ * Identity helper for `workflow.stats.ts` — the studio's optional runtime
246
+ * data source, kept apart from the project: the project describes what is
247
+ * deployed, this is how the studio reads numbers about it. It runs on the
248
+ * studio's dev server (Node), so it can query the project's database or API
249
+ * with credentials from the environment; the page calls it over HTTP, and
250
+ * every answer must be JSON.
251
+ */
252
+ export function defineStats(stats: StatsSource): StatsSource {
253
+ return stats;
254
+ }
255
+
256
+ /** Why the studio has nothing to show: the project failed to load, or to compile. */
257
+ export interface StudioError {
258
+ /** `compile`: compileConfig refused it (the message names the workflow and node). */
259
+ kind: 'load' | 'compile';
260
+ message: string;
261
+ }
262
+
263
+ /**
264
+ * What the app actually receives from the virtual config module. Everything
265
+ * here is either compiled output (workflow and segment IR, from the same
266
+ * `compileConfig` the Worker deploys) or preview-safe template data — the
267
+ * project object itself never reaches the browser.
268
+ */
269
+ export interface ResolvedStudioConfig {
270
+ title?: string;
271
+ /** Compiled workflows, keyed by workflow name (empty when `error` is set). */
272
+ workflows: Record<string, WorkflowIR>;
273
+ /** The project's email registry (empty if none). */
274
+ emails: Record<string, EmailTemplate>;
275
+ /** The project's push registry (empty if none). */
276
+ pushes: Record<string, PushTemplate>;
277
+ /** The project's Discord webhook registry (empty if none). */
278
+ discords: Record<string, DiscordTemplate>;
279
+ /** The project's Slack webhook registry (empty if none). */
280
+ slacks: Record<string, SlackTemplate>;
281
+ /** Compiled named segments. */
282
+ segments: SegmentIR[];
283
+ /** The project's envelope (`emails.from` / `replyTo`), formatted as `Name <email>`. */
284
+ emailDefaults: { from?: string; replyTo?: string };
285
+ /** Set when the project failed to load or compile; the shell shows it instead of the views. */
286
+ error?: StudioError;
287
+ stats?: StatsSource;
288
+ }
@@ -0,0 +1,56 @@
1
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
2
+ import { dirname, relative, resolve } from 'node:path';
3
+ import { type JourneyConfig, isConfig } from '@shware/workflow';
4
+ import { renderDrizzleSchema } from '@shware/workflow/store';
5
+ import { runnerImport } from 'vite';
6
+ import { findConfig } from './server';
7
+
8
+ /**
9
+ * `workflow-ui generate` — the engine's Postgres tables as one drizzle file, on the schema the
10
+ * project's `database.schema` names (`workflow` by default). The host re-exports the file from
11
+ * its drizzle schema and lets drizzle-kit write the migration, so the migration history stays the
12
+ * host's. `--check` exits non-zero when the file on disk differs (CI, after an SDK upgrade).
13
+ */
14
+
15
+ export interface GenerateOptions {
16
+ cwd?: string;
17
+ config?: string;
18
+ out: string;
19
+ check?: boolean;
20
+ }
21
+
22
+ export type GenerateResult = 'written' | 'unchanged' | 'outdated';
23
+
24
+ /** The host's formatter may rewrap the file, change quotes or trailing commas: not a difference. */
25
+ function normalize(source: string): string {
26
+ return (
27
+ source
28
+ .replace(/"/g, "'")
29
+ .replace(/\s+/g, ' ')
30
+ // Spaces around punctuation, and trailing commas, are the formatter's choice
31
+ .replace(/ ?([{}()[\],;:=<>.]) ?/g, '$1')
32
+ .replace(/,([}\])])/g, '$1')
33
+ .trim()
34
+ );
35
+ }
36
+
37
+ export async function generateSchema(options: GenerateOptions): Promise<GenerateResult> {
38
+ const cwd = options.cwd ?? process.cwd();
39
+ const configPath = findConfig(cwd, options.config);
40
+ const { module } = await runnerImport<{ default?: unknown }>(configPath);
41
+ if (!isConfig(module.default)) {
42
+ throw new Error(
43
+ `workflow-ui: ${relative(cwd, configPath)} must \`export default defineConfig({...})\``
44
+ );
45
+ }
46
+ const config: JourneyConfig = module.default;
47
+ const file = renderDrizzleSchema(config.database?.schema);
48
+
49
+ const out = resolve(cwd, options.out);
50
+ const current = existsSync(out) ? readFileSync(out, 'utf8') : undefined;
51
+ if (current !== undefined && normalize(current) === normalize(file)) return 'unchanged';
52
+ if (options.check) return 'outdated';
53
+ mkdirSync(dirname(out), { recursive: true });
54
+ writeFileSync(out, file);
55
+ return 'written';
56
+ }
package/src/index.ts ADDED
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Components for embedding the studio views in your own app. The CLI
3
+ * (`workflow-ui`) composes exactly these — nothing is held back for it.
4
+ */
5
+ export * from './config';
6
+ export { Button } from './components/button';
7
+ export type { Size as ButtonSize } from './components/button';
8
+ export { superellipse } from './components/corner-shape';
9
+ export { WorkflowCanvas } from './components/workflow-canvas';
10
+ export type { WorkflowCanvasProps } from './components/workflow-canvas';
11
+ export { TemplatesPage } from './components/templates-page';
12
+ export type { TemplatePreview, TemplatesPageProps } from './components/templates-page';
13
+ export { PushPreview } from './components/push-preview';
14
+ export type { PushPreviewProps } from './components/push-preview';
15
+ export { WorkflowList } from './components/workflow-list';
16
+ export type { WorkflowListProps } from './components/workflow-list';
17
+ export { MetricCard } from './components/metric-card';
18
+ export type { MetricCardProps, MetricSeries, Trend } from './components/metric-card';
19
+ export { DateRangePicker, formatDay, isoDay, lastDays, parseIsoDay } from './components/date-range';
20
+ export type { DateRange } from './components/date-range';
21
+ export { ALL_CHANNELS_ICON, CHANNEL_ICON, channelIcon } from './components/channel-icon';
22
+ export { Avatar } from './components/avatar';
23
+ export type { AvatarProps } from './components/avatar';
24
+ export { Sparkline } from './components/sparkline';
25
+ export type { SparklineProps } from './components/sparkline';
26
+ export { collectTemplateRefs, collectTemplates } from './components/template-refs';
27
+ export type { TemplateRefInfo, TemplateUsage } from './components/template-refs';
28
+ export { layout, CARD_SIZE, ICON_SIZE } from './components/layout';
29
+ export type {
30
+ CanvasEdge,
31
+ CanvasNode,
32
+ CanvasNodeData,
33
+ NodeCategory,
34
+ NodeIcon,
35
+ } from './components/layout';