@ankhorage/zora 28.10.1 → 28.11.1

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 (377) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +1 -1
  3. package/dist/capabilities/index.js +2 -1
  4. package/dist/capabilities/index.js.map +3 -3
  5. package/dist/constants/authoring.d.ts +3 -3
  6. package/dist/constants/authoring.d.ts.map +1 -1
  7. package/dist/constants/authoring.js +1 -0
  8. package/dist/constants/authoring.js.map +1 -1
  9. package/dist/features/accordion/accordionItemMeta.d.ts +1 -1
  10. package/dist/features/bottom-sheet/bottomSheetMeta.d.ts +1 -1
  11. package/dist/features/calendar/adapters/inbound/Calendar.d.ts.map +1 -1
  12. package/dist/features/calendar/adapters/inbound/Calendar.js +91 -7
  13. package/dist/features/calendar/adapters/inbound/Calendar.js.map +1 -1
  14. package/dist/features/card/cardMeta.d.ts +1 -1
  15. package/dist/features/card/mediaCardMeta.d.ts +1 -1
  16. package/dist/features/card/postCardMeta.d.ts +1 -1
  17. package/dist/features/chat/messageBubbleMeta.d.ts +1 -1
  18. package/dist/features/dialog/dialogMeta.d.ts +2 -2
  19. package/dist/features/flow/adapters/inbound/FlowCanvas.d.ts +5 -0
  20. package/dist/features/flow/adapters/inbound/FlowCanvas.d.ts.map +1 -0
  21. package/dist/features/flow/adapters/inbound/FlowCanvas.js +261 -0
  22. package/dist/features/flow/adapters/inbound/FlowCanvas.js.map +1 -0
  23. package/dist/features/flow/application/createFlowEditorController.d.ts +13 -0
  24. package/dist/features/flow/application/createFlowEditorController.d.ts.map +1 -0
  25. package/dist/features/flow/application/createFlowEditorController.js +86 -0
  26. package/dist/features/flow/application/createFlowEditorController.js.map +1 -0
  27. package/dist/features/flow/application/getFlowPortAnchor.d.ts +10 -0
  28. package/dist/features/flow/application/getFlowPortAnchor.d.ts.map +1 -0
  29. package/dist/features/flow/application/getFlowPortAnchor.js +18 -0
  30. package/dist/features/flow/application/getFlowPortAnchor.js.map +1 -0
  31. package/dist/features/flow/application/mapFlowViewport.d.ts +10 -0
  32. package/dist/features/flow/application/mapFlowViewport.d.ts.map +1 -0
  33. package/dist/features/flow/application/mapFlowViewport.js +22 -0
  34. package/dist/features/flow/application/mapFlowViewport.js.map +1 -0
  35. package/dist/features/flow/public.d.ts +3 -0
  36. package/dist/features/flow/public.d.ts.map +1 -0
  37. package/dist/features/flow/public.js +2 -0
  38. package/dist/features/flow/public.js.map +1 -0
  39. package/dist/features/gradient/gradientMeta.d.ts +1 -1
  40. package/dist/features/graph-node/adapters/inbound/GraphNode.d.ts +5 -0
  41. package/dist/features/graph-node/adapters/inbound/GraphNode.d.ts.map +1 -0
  42. package/dist/features/graph-node/adapters/inbound/GraphNode.js +190 -0
  43. package/dist/features/graph-node/adapters/inbound/GraphNode.js.map +1 -0
  44. package/dist/features/graph-node/getGraphNodePortGeometry.d.ts +17 -0
  45. package/dist/features/graph-node/getGraphNodePortGeometry.d.ts.map +1 -0
  46. package/dist/features/graph-node/getGraphNodePortGeometry.js +23 -0
  47. package/dist/features/graph-node/getGraphNodePortGeometry.js.map +1 -0
  48. package/dist/features/graph-node/public.d.ts +3 -0
  49. package/dist/features/graph-node/public.d.ts.map +1 -0
  50. package/dist/features/graph-node/public.js +2 -0
  51. package/dist/features/graph-node/public.js.map +1 -0
  52. package/dist/features/grid-view/adapters/inbound/GridView.d.ts +1 -1
  53. package/dist/features/grid-view/adapters/inbound/GridView.d.ts.map +1 -1
  54. package/dist/features/grid-view/adapters/inbound/GridView.js +105 -41
  55. package/dist/features/grid-view/adapters/inbound/GridView.js.map +1 -1
  56. package/dist/features/grid-view/application/createGridScrollSync.d.ts +2 -5
  57. package/dist/features/grid-view/application/createGridScrollSync.d.ts.map +1 -1
  58. package/dist/features/grid-view/application/createGridScrollSync.js +109 -45
  59. package/dist/features/grid-view/application/createGridScrollSync.js.map +1 -1
  60. package/dist/features/grid-view/public.d.ts +1 -1
  61. package/dist/features/grid-view/public.d.ts.map +1 -1
  62. package/dist/features/grid-view/public.js.map +1 -1
  63. package/dist/features/keyboard-avoiding-view/keyboardAvoidingViewMeta.d.ts +1 -1
  64. package/dist/features/layout/gridMeta.d.ts +1 -1
  65. package/dist/features/layout/screenMeta.d.ts +1 -1
  66. package/dist/features/layout/scrollViewMeta.d.ts +1 -1
  67. package/dist/features/layout/utils/createScrollGestureLock.d.ts.map +1 -1
  68. package/dist/features/layout/utils/createScrollGestureLock.js +4 -0
  69. package/dist/features/layout/utils/createScrollGestureLock.js.map +1 -1
  70. package/dist/features/layout/viewMeta.d.ts +1 -1
  71. package/dist/features/list/flatListMeta.d.ts +1 -1
  72. package/dist/features/list/sectionListMeta.d.ts +1 -1
  73. package/dist/features/master-detail/masterDetailMeta.d.ts +1 -1
  74. package/dist/features/popover/popoverMeta.d.ts +1 -1
  75. package/dist/features/reader/meta.d.ts +2 -2
  76. package/dist/features/registry/bindableComponentMeta.d.ts +2 -2
  77. package/dist/features/scanner/meta.d.ts +2 -2
  78. package/dist/features/section/screenSectionMeta.d.ts +1 -1
  79. package/dist/features/surface/surfaceMeta.d.ts +1 -1
  80. package/dist/features/tabs/tabPanelMeta.d.ts +1 -1
  81. package/dist/features/theme/node.d.ts +5 -0
  82. package/dist/features/theme/node.d.ts.map +1 -0
  83. package/dist/features/theme/node.js +4 -0
  84. package/dist/features/theme/node.js.map +1 -0
  85. package/dist/features/theme/public.d.ts +2 -0
  86. package/dist/features/theme/public.d.ts.map +1 -1
  87. package/dist/features/theme/public.js +1 -0
  88. package/dist/features/theme/public.js.map +1 -1
  89. package/dist/features/time-grid/adapters/inbound/TimeGrid.d.ts +1 -1
  90. package/dist/features/time-grid/adapters/inbound/TimeGrid.d.ts.map +1 -1
  91. package/dist/features/time-grid/adapters/inbound/TimeGrid.js +45 -22
  92. package/dist/features/time-grid/adapters/inbound/TimeGrid.js.map +1 -1
  93. package/dist/types/color.d.ts +3 -3
  94. package/dist/types/color.d.ts.map +1 -1
  95. package/dist/types/color.js.map +1 -1
  96. package/dist/types/flow.d.ts +81 -0
  97. package/dist/types/flow.d.ts.map +1 -0
  98. package/dist/types/flow.js +2 -0
  99. package/dist/types/flow.js.map +1 -0
  100. package/dist/types/graph-node.d.ts +42 -0
  101. package/dist/types/graph-node.d.ts.map +1 -0
  102. package/dist/types/graph-node.js +2 -0
  103. package/dist/types/graph-node.js.map +1 -0
  104. package/dist/types/grid-view.d.ts +27 -3
  105. package/dist/types/grid-view.d.ts.map +1 -1
  106. package/dist/types/grid-view.js.map +1 -1
  107. package/dist/types/layout.d.ts +2 -0
  108. package/dist/types/layout.d.ts.map +1 -1
  109. package/dist/types/layout.js.map +1 -1
  110. package/dist/types/time-grid.d.ts +9 -0
  111. package/dist/types/time-grid.d.ts.map +1 -1
  112. package/dist/types/time-grid.js.map +1 -1
  113. package/package.json +24 -6
  114. package/src/constants/authoring.ts +1 -0
  115. package/src/features/calendar/adapters/inbound/Calendar.interaction.test.tsx +65 -4
  116. package/src/features/calendar/adapters/inbound/Calendar.tsx +172 -22
  117. package/src/features/flow/adapters/inbound/FlowCanvas.tsx +501 -0
  118. package/src/features/flow/application/createFlowEditorController.test.ts +146 -0
  119. package/src/features/flow/application/createFlowEditorController.ts +99 -0
  120. package/src/features/flow/application/getFlowPortAnchor.test.ts +23 -0
  121. package/src/features/flow/application/getFlowPortAnchor.ts +30 -0
  122. package/src/features/flow/application/mapFlowViewport.test.ts +11 -0
  123. package/src/features/flow/application/mapFlowViewport.ts +29 -0
  124. package/src/features/flow/public.test.ts +7 -0
  125. package/src/features/flow/public.ts +13 -0
  126. package/src/features/graph-node/adapters/inbound/GraphNode.test.tsx +80 -0
  127. package/src/features/graph-node/adapters/inbound/GraphNode.tsx +259 -0
  128. package/src/features/graph-node/getGraphNodePortGeometry.test.ts +35 -0
  129. package/src/features/graph-node/getGraphNodePortGeometry.ts +41 -0
  130. package/src/features/graph-node/public.test.ts +7 -0
  131. package/src/features/graph-node/public.ts +2 -0
  132. package/src/features/grid-view/adapters/inbound/GridView.nativeScrollSync.test.tsx +198 -7
  133. package/src/features/grid-view/adapters/inbound/GridView.tsx +248 -145
  134. package/src/features/grid-view/application/createGridScrollSync.test.ts +46 -17
  135. package/src/features/grid-view/application/createGridScrollSync.ts +100 -43
  136. package/src/features/grid-view/public.ts +6 -1
  137. package/src/features/layout/utils/createScrollGestureLock.ts +4 -0
  138. package/src/features/theme/application/use-cases/compileZoraTheme.test.ts +1 -1
  139. package/src/features/theme/node.ts +18 -0
  140. package/src/features/theme/public.ts +7 -0
  141. package/src/features/time-grid/adapters/inbound/TimeGrid.tsx +64 -21
  142. package/src/platformAcceptance.test.ts +15 -11
  143. package/src/types/color.ts +3 -3
  144. package/src/types/flow.ts +99 -0
  145. package/src/types/graph-node.ts +45 -0
  146. package/src/types/grid-view.ts +25 -3
  147. package/src/types/layout.ts +2 -0
  148. package/src/types/time-grid.ts +9 -0
  149. package/web-dist/chunks/{Accordion-9dq115tn.js → Accordion-064hgrct.js} +3 -3
  150. package/web-dist/chunks/{Accordion-wbf7gqrm.js → Accordion-2b3sd76b.js} +3 -3
  151. package/web-dist/chunks/{Accordion-k9n1yse4.js → Accordion-2kv6p7by.js} +10 -38
  152. package/web-dist/chunks/{Accordion-6gc0jw1n.js → Accordion-5x4cv0kv.js} +1 -1
  153. package/web-dist/chunks/{Accordion-r8swmfjm.js → Accordion-6d63tc7d.js} +1 -1
  154. package/web-dist/chunks/{Accordion-vbz1mjm6.js → Accordion-7eysykr1.js} +4 -4
  155. package/web-dist/chunks/{Accordion-q2yxtdzc.js → Accordion-95003ycq.js} +144 -27
  156. package/web-dist/chunks/{Accordion-hadw5304.js → Accordion-98886mbn.js} +1 -1
  157. package/web-dist/chunks/{Accordion-vtbs98r4.js → Accordion-a0hbjxg9.js} +4 -4
  158. package/web-dist/chunks/{Accordion-73p2mg3h.js → Accordion-a49s4ywn.js} +4 -4
  159. package/web-dist/chunks/{Accordion-tb0vc91c.js → Accordion-a8b6g53f.js} +4 -4
  160. package/web-dist/chunks/{Accordion-25v2vczc.js → Accordion-afxbyvwp.js} +3 -3
  161. package/web-dist/chunks/{Accordion-g5pvs1aa.js → Accordion-ajqj6ymg.js} +5 -5
  162. package/web-dist/chunks/{Accordion-w2kx944a.js → Accordion-ak6dvant.js} +3 -3
  163. package/web-dist/chunks/{Accordion-778fjjsh.js → Accordion-b1tqkxx6.js} +3 -3
  164. package/web-dist/chunks/{Accordion-rp9cjtpg.js → Accordion-bm30dkbw.js} +2 -2
  165. package/web-dist/chunks/{Accordion-rsw5jt7m.js → Accordion-cah5j61y.js} +2 -2
  166. package/web-dist/chunks/{Accordion-pr1tv6jx.js → Accordion-dfr26j8m.js} +1 -1
  167. package/web-dist/chunks/{Accordion-zmrbktd8.js → Accordion-dnfgtbq3.js} +8 -8
  168. package/web-dist/chunks/{Accordion-m3tq2vcc.js → Accordion-dy1j2a7p.js} +6 -6
  169. package/web-dist/chunks/{Accordion-7pgh8q4h.js → Accordion-e9jwetg7.js} +2 -2
  170. package/web-dist/chunks/{Accordion-gnkzvj03.js → Accordion-e9xmwxzp.js} +1 -1
  171. package/web-dist/chunks/{Accordion-q8ymmar7.js → Accordion-ek0hh2nx.js} +4 -4
  172. package/web-dist/chunks/{Accordion-2berhsg5.js → Accordion-et7xzm6k.js} +9 -9
  173. package/web-dist/chunks/Accordion-eysfka31.js +1590 -0
  174. package/web-dist/chunks/{Accordion-59x6e7bs.js → Accordion-gb3mfjmx.js} +43 -20
  175. package/web-dist/chunks/{Accordion-3xfqmr1r.js → Accordion-gy3bx3xa.js} +2 -2
  176. package/web-dist/chunks/{Accordion-tj4fe6wk.js → Accordion-h2rnzgyv.js} +3 -3
  177. package/web-dist/chunks/Accordion-hbwhya78.js +83 -0
  178. package/web-dist/chunks/{Accordion-t9w365ke.js → Accordion-hbwyj12m.js} +1 -1
  179. package/web-dist/chunks/Accordion-jkgd7dmf.js +1 -0
  180. package/web-dist/chunks/{Accordion-qwftammh.js → Accordion-kxjjp03t.js} +5 -5
  181. package/web-dist/chunks/Accordion-mkd3k28h.js +275 -0
  182. package/web-dist/chunks/{Accordion-xqkkfwkm.js → Accordion-nhf8zjt4.js} +2 -2
  183. package/web-dist/chunks/{Accordion-hg4db1sk.js → Accordion-p84h11ek.js} +4 -4
  184. package/web-dist/chunks/{Accordion-zhgty1ae.js → Accordion-pagdkp07.js} +3 -3
  185. package/web-dist/chunks/{Accordion-dv5c27w4.js → Accordion-pjbmmr20.js} +1 -1
  186. package/web-dist/chunks/{Accordion-7ayxbm7k.js → Accordion-pr4a281g.js} +1 -1
  187. package/web-dist/chunks/{Accordion-yca8r7kx.js → Accordion-qz6ddnmv.js} +3 -3
  188. package/web-dist/chunks/{Accordion-dcjzxzv3.js → Accordion-rv90tjqr.js} +2 -2
  189. package/web-dist/chunks/{Accordion-0zk0xp73.js → Accordion-snk6nggm.js} +326 -174
  190. package/web-dist/chunks/{Accordion-casb2ndy.js → Accordion-th7yhwhf.js} +5 -5
  191. package/web-dist/chunks/{Accordion-e6ettgh0.js → Accordion-vbh3xqv6.js} +2 -2
  192. package/web-dist/chunks/{Accordion-vdzyhtyd.js → Accordion-w4zh2nws.js} +8 -8
  193. package/web-dist/chunks/Accordion-w8zke8fa.js +37 -0
  194. package/web-dist/chunks/{Accordion-3e60xwvy.js → Accordion-wkqemqjw.js} +1 -1
  195. package/web-dist/chunks/{Accordion-vwqf8kn1.js → Accordion-x9sb23p3.js} +3 -3
  196. package/web-dist/chunks/{Accordion-xhkphta6.js → Accordion-y6sg47rv.js} +1 -1
  197. package/web-dist/chunks/{Accordion-mw8zh0vs.js → Accordion-yannd7r3.js} +4 -4
  198. package/web-dist/chunks/{Accordion-457amtv7.js → Accordion-z3m3wvfz.js} +6 -1580
  199. package/web-dist/chunks/{Accordion-pvcdvh3w.js → Accordion-zagrbkq1.js} +2 -2
  200. package/web-dist/chunks/{Accordion-2jcas7qq.js → Accordion-zays65re.js} +5 -5
  201. package/web-dist/chunks/{RichTextClient-w75r2x97.js → RichTextClient-qd6gmm0x.js} +12 -11
  202. package/web-dist/chunks/{Video.native-bb9g33nd.js → Video.native-7zsbp5vg.js} +7 -6
  203. package/web-dist/components/accordion/Accordion.js +6 -5
  204. package/web-dist/components/accordion-item/AccordionItem.js +6 -5
  205. package/web-dist/components/activity-indicator/ActivityIndicator.js +1 -1
  206. package/web-dist/components/app-bar/AppBar.js +8 -7
  207. package/web-dist/components/app-header/AppHeader.js +8 -7
  208. package/web-dist/components/app-shell/AppShell.js +3 -2
  209. package/web-dist/components/audio/Audio.js +6 -5
  210. package/web-dist/components/auth-screen/AuthScreen.js +11 -10
  211. package/web-dist/components/avatar/Avatar.js +6 -5
  212. package/web-dist/components/avatar-group/AvatarGroup.js +6 -5
  213. package/web-dist/components/badge/Badge.js +2 -2
  214. package/web-dist/components/barcode-scanner-view/BarcodeScannerView.js +11 -10
  215. package/web-dist/components/bottom-sheet/BottomSheet.js +4 -3
  216. package/web-dist/components/bottom-sheet-flat-list/BottomSheetFlatList.js +4 -3
  217. package/web-dist/components/bottom-sheet-scroll-view/BottomSheetScrollView.js +4 -3
  218. package/web-dist/components/bottom-sheet-section-list/BottomSheetSectionList.js +4 -3
  219. package/web-dist/components/bottom-sheet-view/BottomSheetView.js +4 -3
  220. package/web-dist/components/bottom-sheet-virtualized-list/BottomSheetVirtualizedList.js +4 -3
  221. package/web-dist/components/breadcrumbs/Breadcrumbs.js +6 -5
  222. package/web-dist/components/button/Button.js +4 -3
  223. package/web-dist/components/button-group/ButtonGroup.js +4 -3
  224. package/web-dist/components/calendar/Calendar.js +8 -7
  225. package/web-dist/components/camera-permission-view/CameraPermissionView.js +11 -10
  226. package/web-dist/components/card/Card.js +10 -9
  227. package/web-dist/components/card-back/CardBack.js +2 -2
  228. package/web-dist/components/card-hand/CardHand.js +2 -2
  229. package/web-dist/components/chat-list-item/ChatListItem.js +8 -7
  230. package/web-dist/components/checkbox/Checkbox.js +5 -4
  231. package/web-dist/components/checkbox-group/CheckboxGroup.js +5 -4
  232. package/web-dist/components/chess-board/ChessBoard.js +4 -3
  233. package/web-dist/components/chip/Chip.js +6 -5
  234. package/web-dist/components/chip-group/ChipGroup.js +6 -5
  235. package/web-dist/components/collection-editor/CollectionEditor.js +10 -9
  236. package/web-dist/components/color-hue-scale/ColorHueScale.js +17 -15
  237. package/web-dist/components/color-picker/ColorPicker.js +17 -15
  238. package/web-dist/components/color-picker/ColorPicker.types-0.d.ts +3 -3
  239. package/web-dist/components/color-tone/ColorTone.js +17 -15
  240. package/web-dist/components/color-tone/ColorTone.types-0.d.ts +3 -3
  241. package/web-dist/components/color-wheel/ColorWheel.js +17 -15
  242. package/web-dist/components/color-wheel/ColorWheel.types-0.d.ts +1 -1
  243. package/web-dist/components/content-rail/ContentRail.js +5 -4
  244. package/web-dist/components/data-table/DataTable.js +16 -15
  245. package/web-dist/components/date-picker/DatePicker.js +10 -9
  246. package/web-dist/components/dialog/Dialog.js +5 -4
  247. package/web-dist/components/divider/Divider.js +3 -2
  248. package/web-dist/components/empty-state/EmptyState.js +11 -10
  249. package/web-dist/components/explorer/Explorer.js +8 -7
  250. package/web-dist/components/field/Field.js +5 -4
  251. package/web-dist/components/file-explorer/FileExplorer.js +8 -7
  252. package/web-dist/components/flat-list/FlatList.js +6 -5
  253. package/web-dist/components/flow-canvas/FlowCanvas.d.ts +7 -0
  254. package/web-dist/components/flow-canvas/FlowCanvas.dependency-0.d.ts +27 -0
  255. package/web-dist/components/flow-canvas/FlowCanvas.dependency-1.d.ts +3 -0
  256. package/web-dist/components/flow-canvas/FlowCanvas.js +513 -0
  257. package/web-dist/components/flow-canvas/FlowCanvas.types-0.d.ts +92 -0
  258. package/web-dist/components/flow-canvas/index.d.ts +2 -0
  259. package/web-dist/components/flow-canvas/index.js +2 -0
  260. package/web-dist/components/forgot-password-form/ForgotPasswordForm.js +11 -10
  261. package/web-dist/components/form/Form.js +7 -6
  262. package/web-dist/components/form-actions/FormActions.js +7 -6
  263. package/web-dist/components/form-error/FormError.js +7 -6
  264. package/web-dist/components/game/Game.js +4 -3
  265. package/web-dist/components/game-entity/GameEntity.js +4 -3
  266. package/web-dist/components/game-field/GameField.js +4 -3
  267. package/web-dist/components/game-input-zone/GameInputZone.js +4 -3
  268. package/web-dist/components/game-measurement-probe/GameMeasurementProbe.js +4 -3
  269. package/web-dist/components/game-overlay/GameOverlay.js +4 -3
  270. package/web-dist/components/gradient/Gradient.js +4 -3
  271. package/web-dist/components/gradient-renderer-provider/GradientRendererProvider.js +4 -3
  272. package/web-dist/components/graph-node/GraphNode.d.ts +7 -0
  273. package/web-dist/components/graph-node/GraphNode.dependency-0.d.ts +27 -0
  274. package/web-dist/components/graph-node/GraphNode.dependency-1.d.ts +3 -0
  275. package/web-dist/components/graph-node/GraphNode.dependency-2.d.ts +5 -0
  276. package/web-dist/components/graph-node/GraphNode.js +20 -0
  277. package/web-dist/components/graph-node/GraphNode.types-0.d.ts +46 -0
  278. package/web-dist/components/graph-node/index.d.ts +2 -0
  279. package/web-dist/components/graph-node/index.js +2 -0
  280. package/web-dist/components/grid/Grid.js +3 -2
  281. package/web-dist/components/grid-line-overlay/GridLineOverlay.js +2 -2
  282. package/web-dist/components/grid-ruler/GridRuler.js +2 -2
  283. package/web-dist/components/grid-view/GridView.d.ts +1 -1
  284. package/web-dist/components/grid-view/GridView.js +2 -1
  285. package/web-dist/components/grid-view/GridView.types-0.d.ts +21 -0
  286. package/web-dist/components/heading/Heading.js +2 -2
  287. package/web-dist/components/hero/Hero.js +10 -9
  288. package/web-dist/components/icon/Icon.js +2 -2
  289. package/web-dist/components/icon-button/IconButton.js +4 -3
  290. package/web-dist/components/image/Image.js +5 -4
  291. package/web-dist/components/keyboard-avoiding-view/KeyboardAvoidingView.js +2 -2
  292. package/web-dist/components/link/Link.js +2 -2
  293. package/web-dist/components/list/List.js +6 -5
  294. package/web-dist/components/list-item/ListItem.js +6 -5
  295. package/web-dist/components/list-section/ListSection.js +6 -5
  296. package/web-dist/components/master-detail/MasterDetail.js +3 -2
  297. package/web-dist/components/matrix-grid/MatrixGrid.js +5 -4
  298. package/web-dist/components/media-card/MediaCard.js +10 -9
  299. package/web-dist/components/media-explorer/MediaExplorer.js +8 -7
  300. package/web-dist/components/message-bubble/MessageBubble.js +8 -7
  301. package/web-dist/components/metric-card/MetricCard.js +10 -9
  302. package/web-dist/components/missing-element/MissingElement.js +5 -4
  303. package/web-dist/components/o-auth-provider-button/OAuthProviderButton.js +11 -10
  304. package/web-dist/components/o-auth-provider-list/OAuthProviderList.js +11 -10
  305. package/web-dist/components/opening-book/OpeningBook.js +4 -3
  306. package/web-dist/components/otp-form/OtpForm.js +11 -10
  307. package/web-dist/components/pagination/Pagination.js +5 -4
  308. package/web-dist/components/palette-item/PaletteItem.js +10 -9
  309. package/web-dist/components/playing-card/PlayingCard.js +2 -2
  310. package/web-dist/components/poker-training-table/PokerTrainingTable.js +2 -2
  311. package/web-dist/components/popover/Popover.js +1 -1
  312. package/web-dist/components/popover-menu/PopoverMenu.js +5 -4
  313. package/web-dist/components/post-card/PostCard.js +10 -9
  314. package/web-dist/components/product-card/ProductCard.js +10 -9
  315. package/web-dist/components/progress/Progress.js +5 -4
  316. package/web-dist/components/progress-ring/ProgressRing.js +5 -4
  317. package/web-dist/components/radio/Radio.js +6 -5
  318. package/web-dist/components/radio-group/RadioGroup.js +6 -5
  319. package/web-dist/components/rating/Rating.js +4 -3
  320. package/web-dist/components/reader/Reader.js +11 -10
  321. package/web-dist/components/rich-text/RichText.js +3 -3
  322. package/web-dist/components/runtime-authoring-overlay/RuntimeAuthoringOverlay.js +4 -3
  323. package/web-dist/components/scan-overlay/ScanOverlay.js +11 -10
  324. package/web-dist/components/screen/Screen.js +3 -2
  325. package/web-dist/components/screen-section/ScreenSection.js +5 -4
  326. package/web-dist/components/scroll-view/ScrollView.js +3 -2
  327. package/web-dist/components/search-input/SearchInput.js +6 -5
  328. package/web-dist/components/section-header/SectionHeader.js +5 -4
  329. package/web-dist/components/section-list/SectionList.js +6 -5
  330. package/web-dist/components/select/Select.js +11 -10
  331. package/web-dist/components/selectable-item/SelectableItem.js +4 -3
  332. package/web-dist/components/selection-provider/SelectionProvider.js +4 -3
  333. package/web-dist/components/sign-in-form/SignInForm.js +11 -10
  334. package/web-dist/components/sign-up-form/SignUpForm.js +11 -10
  335. package/web-dist/components/skeleton/Skeleton.js +13 -12
  336. package/web-dist/components/skeleton-card/SkeletonCard.js +13 -12
  337. package/web-dist/components/skeleton-list/SkeletonList.js +13 -12
  338. package/web-dist/components/skeleton-text/SkeletonText.js +13 -12
  339. package/web-dist/components/spatial-grid/SpatialGrid.js +2 -1
  340. package/web-dist/components/surface/Surface.js +2 -2
  341. package/web-dist/components/switch/Switch.js +1 -1
  342. package/web-dist/components/tab/Tab.js +2 -2
  343. package/web-dist/components/tab-list/TabList.js +2 -2
  344. package/web-dist/components/tab-panel/TabPanel.js +2 -2
  345. package/web-dist/components/tabletop-table/TabletopTable.js +2 -2
  346. package/web-dist/components/tabs/Tabs.js +2 -2
  347. package/web-dist/components/text/Text.js +2 -2
  348. package/web-dist/components/text-input/TextInput.js +5 -4
  349. package/web-dist/components/theme-mode-toggle/ThemeModeToggle.js +4 -3
  350. package/web-dist/components/tile-grid/TileGrid.js +2 -1
  351. package/web-dist/components/time-grid/TimeGrid.d.ts +1 -1
  352. package/web-dist/components/time-grid/TimeGrid.dependency-2.d.ts +13 -0
  353. package/web-dist/components/time-grid/TimeGrid.js +3 -2
  354. package/web-dist/components/time-grid/TimeGrid.types-0.d.ts +10 -0
  355. package/web-dist/components/time-picker/TimePicker.js +7 -6
  356. package/web-dist/components/timeline/Timeline.js +6 -5
  357. package/web-dist/components/toast/Toast.js +2 -2
  358. package/web-dist/components/toast-provider/ToastProvider.js +2 -2
  359. package/web-dist/components/toolbar/Toolbar.js +11 -10
  360. package/web-dist/components/tree-item/TreeItem.js +9 -8
  361. package/web-dist/components/uploader/Uploader.js +13 -12
  362. package/web-dist/components/video/Video.js +7 -6
  363. package/web-dist/components/view/View.js +3 -2
  364. package/web-dist/components/zora-provider/ZoraProvider.d.ts +7 -0
  365. package/web-dist/components/zora-provider/ZoraProvider.dependency-0.d.ts +15 -0
  366. package/web-dist/components/zora-provider/ZoraProvider.js +11 -0
  367. package/web-dist/components/zora-provider/ZoraProvider.types-0.d.ts +19 -0
  368. package/web-dist/components/zora-provider/index.d.ts +2 -0
  369. package/web-dist/components/zora-provider/index.js +2 -0
  370. package/web-dist/components/zora-theme-scope/ZoraThemeScope.d.ts +14 -0
  371. package/web-dist/components/zora-theme-scope/ZoraThemeScope.js +11 -0
  372. package/web-dist/components/zora-theme-scope/ZoraThemeScope.types-0.d.ts +3 -0
  373. package/web-dist/components/zora-theme-scope/index.d.ts +2 -0
  374. package/web-dist/components/zora-theme-scope/index.js +2 -0
  375. package/web-dist/components/zora-web-style-sheet/ZoraWebStyleSheet.js +3 -2
  376. package/web-dist/manifest.json +1059 -832
  377. package/web-dist/runtime/ZoraProvider.js +4 -80
@@ -0,0 +1,261 @@
1
+ import { viewportToWorld, } from '@ankhorage/grid-view';
2
+ import React from 'react';
3
+ import { Pressable, Text, View } from 'react-native';
4
+ import Svg, { Path } from 'react-native-svg';
5
+ import { getGraphNodePortGeometry } from '../../../graph-node/getGraphNodePortGeometry.js';
6
+ import { GraphNode } from '../../../graph-node/public.js';
7
+ import { GridView } from '../../../grid-view/public.js';
8
+ import { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope.js';
9
+ import { useZoraTheme } from '../../../theme/composition/useZoraTheme.js';
10
+ import { createFlowEditorController } from '../../application/createFlowEditorController.js';
11
+ import { getDeterministicFlowNodeHeight, getDeterministicFlowPortAnchor, getFlowPortAnchor, getFlowPortAnchorKey, } from '../../application/getFlowPortAnchor.js';
12
+ import { flowViewportToGrid, gridViewportToFlow } from '../../application/mapFlowViewport.js';
13
+ const WORLD_PADDING = 2000;
14
+ /** Render the controlled, accessible process-editor canvas shared by React Native and React Native Web. */
15
+ export const FlowCanvas = withZoraThemeScope(FlowCanvasInner);
16
+ /** Compose controlled flow interactions on the canonical GridView viewport. */
17
+ function FlowCanvasInner(props) {
18
+ const propsRef = React.useRef(props);
19
+ const controllerRef = React.useRef(createFlowEditorController(props));
20
+ const pendingSourceRef = React.useRef(null);
21
+ React.useLayoutEffect(() => {
22
+ propsRef.current = props;
23
+ controllerRef.current = createFlowEditorController(props);
24
+ }, [props]);
25
+ const [localAnchors, setLocalAnchors] = React.useState(new Map());
26
+ const [nodeHeights, setNodeHeights] = React.useState(new Map());
27
+ const [size, setSize] = React.useState({ height: 0, width: 0 });
28
+ const { theme } = useZoraTheme();
29
+ const selectedNodeIdSet = React.useMemo(() => new Set(props.selectedNodeIds ?? []), [props.selectedNodeIds]);
30
+ const minZoom = props.minZoom ?? 0.5;
31
+ const maxZoom = props.maxZoom ?? 2;
32
+ const gridViewport = React.useMemo(() => flowViewportToGrid(props.viewport, size), [props.viewport, size]);
33
+ const items = React.useMemo(() => props.nodes.map((node) => ({
34
+ height: nodeHeights.get(node.id) ?? getDeterministicFlowNodeHeight(node),
35
+ id: node.id,
36
+ width: getGraphNodePortGeometry({ ports: node.ports }).width,
37
+ x: node.position.x,
38
+ y: node.position.y,
39
+ })), [nodeHeights, props.nodes]);
40
+ const world = React.useMemo(() => createWorldBounds(items, gridViewport), [gridViewport, items]);
41
+ const constraints = React.useMemo(() => ({ world }), [world]);
42
+ const nodeById = React.useMemo(() => new Map(props.nodes.map((node) => [node.id, node])), [props.nodes]);
43
+ const selectPort = React.useCallback((address) => {
44
+ const { current } = propsRef;
45
+ const port = current.nodes
46
+ .find((node) => node.id === address.nodeId)
47
+ ?.ports.find((item) => item.id === address.portId);
48
+ if (!port || current.readOnly)
49
+ return;
50
+ const pendingSource = pendingSourceRef.current;
51
+ if (pendingSource === null) {
52
+ if (port.direction === 'output')
53
+ pendingSourceRef.current = address;
54
+ return;
55
+ }
56
+ const rejection = controllerRef.current.connect(pendingSource, address);
57
+ if (rejection)
58
+ current.onConnectionRejected?.(pendingSource, address, rejection);
59
+ pendingSourceRef.current = null;
60
+ }, []);
61
+ const setZoom = React.useCallback((zoom) => {
62
+ const { current } = propsRef;
63
+ controllerRef.current.setViewport({
64
+ ...current.viewport,
65
+ zoom: Math.max(minZoom, Math.min(maxZoom, zoom)),
66
+ });
67
+ }, [maxZoom, minZoom]);
68
+ const setPortAnchor = React.useCallback((address, anchor) => {
69
+ const key = getFlowPortAnchorKey(address);
70
+ setLocalAnchors((current) => {
71
+ const previous = current.get(key);
72
+ if (previous?.x === anchor.x && previous.y === anchor.y)
73
+ return current;
74
+ return new Map(current).set(key, anchor);
75
+ });
76
+ }, []);
77
+ const setNodeHeight = React.useCallback((nodeId, height) => {
78
+ setNodeHeights((current) => current.get(nodeId) === height ? current : new Map(current).set(nodeId, height));
79
+ }, []);
80
+ const publishViewport = React.useCallback((next) => controllerRef.current.setViewport(gridViewportToFlow(next)), []);
81
+ const viewportRef = React.useRef(gridViewport);
82
+ React.useLayoutEffect(() => {
83
+ viewportRef.current = gridViewport;
84
+ }, [gridViewport]);
85
+ const moveNode = React.useCallback((nodeId, delta) => {
86
+ const grid = viewportRef.current;
87
+ const origin = viewportToWorld({ x: 0, y: 0 }, grid);
88
+ const target = viewportToWorld(delta, grid);
89
+ controllerRef.current.moveNode(nodeId, { x: target.x - origin.x, y: target.y - origin.y });
90
+ }, []);
91
+ const disconnect = React.useCallback((connectionId) => propsRef.current.onDisconnect?.(connectionId), []);
92
+ /*** Request deletion from the controlled host for the current selection. */
93
+ const deleteSelectedNodes = React.useCallback(() => controllerRef.current.deleteNodes(propsRef.current.selectedNodeIds ?? []), []);
94
+ const renderNode = (item) => {
95
+ const node = nodeById.get(item.id);
96
+ if (!node)
97
+ return null;
98
+ const selected = selectedNodeIdSet.has(node.id);
99
+ return (<View style={{
100
+ transform: [{ scale: props.viewport.zoom }],
101
+ transformOrigin: 'top left',
102
+ width: getGraphNodePortGeometry({ ports: node.ports }).width,
103
+ }} onLayout={(event) => setNodeHeight(node.id, event.nativeEvent.layout.height)}>
104
+ <GraphNode description={node.description} disabled={node.disabled} ports={node.ports.map((port) => ({
105
+ ...port,
106
+ testID: `flow-port-${node.id}-${port.id}`,
107
+ }))} readOnly={props.readOnly === true} selected={selected} testID={`flow-node-${node.id}`} title={node.title} width={getGraphNodePortGeometry({ ports: node.ports }).width} onMove={(delta) => moveNode(node.id, delta)} onPortLayout={(portId, anchor) => setPortAnchor({ nodeId: node.id, portId }, anchor)} onPortPress={(portId) => selectPort({ nodeId: node.id, portId })} onPress={() => controllerRef.current.selectNode(node.id)}>
108
+ {props.renderNode?.(node, { selected })}
109
+ </GraphNode>
110
+ </View>);
111
+ };
112
+ return (<View style={{
113
+ backgroundColor: theme.semantics.neutral.surfaceHover,
114
+ borderColor: theme.semantics.neutral.divider,
115
+ borderRadius: 14,
116
+ borderWidth: 1,
117
+ flex: 1,
118
+ minHeight: 360,
119
+ overflow: 'hidden',
120
+ }} testID={props.testID}>
121
+ <FlowToolbar canRedo={props.canRedo === true} canUndo={props.canUndo === true} canDelete={(props.selectedNodeIds?.length ?? 0) > 0} readOnly={props.readOnly === true} onDelete={deleteSelectedNodes} onRedo={props.onRedo} onUndo={props.onUndo} onZoomIn={() => setZoom(props.viewport.zoom + 0.1)} onZoomOut={() => setZoom(props.viewport.zoom - 0.1)}/>
122
+ <View onLayout={(event) => setSize({
123
+ height: Math.round(event.nativeEvent.layout.height),
124
+ width: Math.round(event.nativeEvent.layout.width),
125
+ })} testID={props.testID ? `${props.testID}-viewport` : undefined} style={{ backgroundColor: theme.semantics.surface.default, flex: 1, minHeight: 300 }}>
126
+ {size.width > 0 && size.height > 0 ? (<GridView contentHeight={world.height} contentWidth={world.width} height={size.height} items={items} renderItem={renderNode} renderWorldLayer={(layer) => (<FlowEdges anchors={localAnchors} connections={props.connections} layer={layer} nodes={nodeById} readOnly={props.readOnly === true} onDisconnect={disconnect}/>)} testID={props.testID ? `${props.testID}-grid` : undefined} viewport={gridViewport} viewportConstraints={constraints} viewportControls="hidden" width={size.width} zoomLimits={{ maxX: maxZoom, maxY: maxZoom, minX: minZoom, minY: minZoom }} onViewportChange={publishViewport}/>) : null}
127
+ </View>
128
+ <FlowPalette items={props.paletteItems} readOnly={props.readOnly === true} onInsert={props.onInsert}/>
129
+ </View>);
130
+ }
131
+ /** Bound the world to the nodes plus generous space and always include the supplied viewport. */
132
+ function createWorldBounds(items, viewport) {
133
+ const visibleWidth = viewport.width / viewport.pixelsPerUnitX;
134
+ const visibleHeight = viewport.height / viewport.pixelsPerUnitY;
135
+ let minX = viewport.offsetX;
136
+ let minY = viewport.offsetY;
137
+ let maxX = viewport.offsetX + visibleWidth;
138
+ let maxY = viewport.offsetY + visibleHeight;
139
+ for (const item of items) {
140
+ minX = Math.min(minX, item.x - WORLD_PADDING);
141
+ minY = Math.min(minY, item.y - WORLD_PADDING);
142
+ maxX = Math.max(maxX, item.x + item.width + WORLD_PADDING);
143
+ maxY = Math.max(maxY, item.y + item.height + WORLD_PADDING);
144
+ }
145
+ return { height: maxY - minY, width: maxX - minX, x: minX, y: minY };
146
+ }
147
+ /** Present keyboard-accessible viewport and history controls. */
148
+ function FlowToolbar(props) {
149
+ const { theme } = useZoraTheme();
150
+ return (<View style={{
151
+ backgroundColor: theme.semantics.surface.default,
152
+ borderBottomColor: theme.semantics.neutral.divider,
153
+ borderBottomWidth: 1,
154
+ flexDirection: 'row',
155
+ flexWrap: 'wrap',
156
+ gap: 8,
157
+ padding: 10,
158
+ width: '100%',
159
+ }}>
160
+ <FlowControl label="Zoom out" onPress={props.onZoomOut}/>
161
+ <FlowControl label="Zoom in" onPress={props.onZoomIn}/>
162
+ <FlowControl disabled={props.readOnly || !props.canDelete} label="Delete selected nodes" onPress={props.onDelete}/>
163
+ <FlowControl disabled={props.readOnly || !props.canUndo} label="Undo" onPress={props.onUndo}/>
164
+ <FlowControl disabled={props.readOnly || !props.canRedo} label="Redo" onPress={props.onRedo}/>
165
+ </View>);
166
+ }
167
+ /** Render one focusable command control. */
168
+ function FlowControl(props) {
169
+ const { theme } = useZoraTheme();
170
+ return (<Pressable accessibilityLabel={props.label} accessibilityRole="button" accessibilityState={{ disabled: props.disabled }} disabled={props.disabled} style={{
171
+ backgroundColor: props.disabled
172
+ ? theme.semantics.neutral.surfaceHover
173
+ : theme.semantics.neutral.surface,
174
+ borderColor: props.disabled ? theme.semantics.neutral.divider : theme.colors.primary,
175
+ borderRadius: 9,
176
+ borderWidth: 1,
177
+ justifyContent: 'center',
178
+ minHeight: 44,
179
+ minWidth: 44,
180
+ paddingHorizontal: 10,
181
+ paddingVertical: 7,
182
+ }} onPress={props.onPress}>
183
+ <Text style={{
184
+ color: props.disabled ? theme.semantics.neutral.textMuted : theme.colors.primary,
185
+ fontSize: 12,
186
+ fontWeight: '700',
187
+ }}>
188
+ {props.label}
189
+ </Text>
190
+ </Pressable>);
191
+ }
192
+ /** Render Bezier edges in the same world coordinates as the nodes they join. */
193
+ const FlowEdges = React.memo(function FlowEdges(props) {
194
+ const { theme } = useZoraTheme();
195
+ const { layer } = props;
196
+ const resolve = (address) => {
197
+ const node = props.nodes.get(address.nodeId);
198
+ if (!node)
199
+ return undefined;
200
+ const deterministic = getDeterministicFlowPortAnchor(node, address);
201
+ if (!deterministic)
202
+ return undefined;
203
+ const local = getFlowPortAnchor(props.anchors, address) ?? deterministic;
204
+ return {
205
+ x: layer.origin.x + (node.position.x + local.x) * layer.pixelsPerUnitX,
206
+ y: layer.origin.y + (node.position.y + local.y) * layer.pixelsPerUnitY,
207
+ };
208
+ };
209
+ const edges = props.connections.map((connection) => ({
210
+ connection,
211
+ source: resolve(connection.source),
212
+ target: resolve(connection.target),
213
+ }));
214
+ return (<>
215
+ <Svg height={layer.height} pointerEvents="none" style={{ left: 0, position: 'absolute', top: 0 }} width={layer.width}>
216
+ {edges.map((edge) => (<FlowEdgePath key={edge.connection.id} source={edge.source} stroke={theme.colors.primary} target={edge.target} testID={`flow-edge-${edge.connection.id}`}/>))}
217
+ </Svg>
218
+ {edges.map((edge) => (<FlowEdgeControl key={edge.connection.id} connection={edge.connection} onDisconnect={props.onDisconnect} readOnly={props.readOnly} source={edge.source} target={edge.target}/>))}
219
+ </>);
220
+ });
221
+ /** Render one edge path only when either endpoint's measured geometry changes. */
222
+ const FlowEdgePath = React.memo(function FlowEdgePath(props) {
223
+ if (!props.source || !props.target)
224
+ return null;
225
+ const controlDistance = Math.max(48, Math.abs(props.target.x - props.source.x) / 2);
226
+ return (<Path d={`M ${props.source.x} ${props.source.y} C ${props.source.x + controlDistance} ${props.source.y}, ${props.target.x - controlDistance} ${props.target.y}, ${props.target.x} ${props.target.y}`} fill="none" stroke={props.stroke} strokeWidth={3} testID={props.testID}/>);
227
+ });
228
+ /** Keep each accessible disconnect target aligned with its two measured endpoints. */
229
+ const FlowEdgeControl = React.memo(function FlowEdgeControl(props) {
230
+ if (!props.source || !props.target)
231
+ return null;
232
+ return (<Pressable accessibilityHint="Disconnect this flow connection" accessibilityLabel={props.connection.label ?? `Connection ${props.connection.id}`} accessibilityRole="button" accessibilityState={{ disabled: props.readOnly }} disabled={props.readOnly} style={{
233
+ height: 44,
234
+ left: (props.source.x + props.target.x) / 2 - 22,
235
+ position: 'absolute',
236
+ top: (props.source.y + props.target.y) / 2 - 22,
237
+ width: 44,
238
+ zIndex: 1,
239
+ }} onPress={() => props.onDisconnect?.(props.connection.id)}/>);
240
+ });
241
+ /** Render controlled palette insertion requests. */
242
+ function FlowPalette(props) {
243
+ const { theme } = useZoraTheme();
244
+ if (!props.items?.length)
245
+ return null;
246
+ return (<View accessibilityLabel="Flow palette" style={{ backgroundColor: theme.colors.primary, gap: 8, padding: 12 }}>
247
+ {props.items.map((item) => (<Pressable key={item.id} accessibilityHint="Insert this node" accessibilityLabel={item.title} accessibilityRole="button" accessibilityState={{ disabled: props.readOnly || item.disabled }} disabled={props.readOnly || item.disabled} style={{
248
+ backgroundColor: theme.semantics.neutral.surface,
249
+ borderRadius: 8,
250
+ justifyContent: 'center',
251
+ minHeight: 44,
252
+ padding: 10,
253
+ }} onPress={() => props.onInsert?.(item.id)}>
254
+ <Text style={{ color: theme.semantics.neutral.text, fontWeight: '700' }}>
255
+ {item.title}
256
+ </Text>
257
+ {item.description ? (<Text style={{ color: theme.semantics.neutral.textMuted }}>{item.description}</Text>) : null}
258
+ </Pressable>))}
259
+ </View>);
260
+ }
261
+ //# sourceMappingURL=FlowCanvas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlowCanvas.js","sourceRoot":"","sources":["../../../../../src/features/flow/adapters/inbound/FlowCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,eAAe,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAS7C,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,EACL,8BAA8B,EAC9B,8BAA8B,EAC9B,iBAAiB,EACjB,oBAAoB,GACrB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAE3F,MAAM,aAAa,GAAG,IAAI,CAAC;AAE3B,2GAA2G;AAC3G,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC,eAAe,CAAC,CAAC;AAE9D,+EAA+E;AAC/E,SAAS,eAAe,CAAC,KAAsB;IAC7C,MAAM,QAAQ,GAAG,K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zC;UAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CACtE;YAAA,CAAC,IAAI,CAAC,KAAK,CACb;UAAA,EAAE,IAAI,CACN;UAAA,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAClB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,CACrF,CAAC,CAAC,CAAC,IAAI,CACV;QAAA,EAAE,SAAS,CAAC,CACb,CAAC,CACJ;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC","sourcesContent":["import {\n type GridPoint,\n type GridRect,\n type GridRectItem,\n type GridViewport,\n type GridViewportConstraints,\n viewportToWorld,\n} from '@ankhorage/grid-view';\nimport React from 'react';\nimport { Pressable, Text, View } from 'react-native';\nimport Svg, { Path } from 'react-native-svg';\n\nimport type {\n FlowCanvasProps,\n FlowNodeData,\n FlowPoint,\n FlowPortAddress,\n} from '../../../../types/flow';\nimport type { GridWorldLayerContext } from '../../../../types/grid-view';\nimport { getGraphNodePortGeometry } from '../../../graph-node/getGraphNodePortGeometry';\nimport { GraphNode } from '../../../graph-node/public';\nimport { GridView } from '../../../grid-view/public';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\nimport { useZoraTheme } from '../../../theme/composition/useZoraTheme';\nimport { createFlowEditorController } from '../../application/createFlowEditorController';\nimport {\n getDeterministicFlowNodeHeight,\n getDeterministicFlowPortAnchor,\n getFlowPortAnchor,\n getFlowPortAnchorKey,\n} from '../../application/getFlowPortAnchor';\nimport { flowViewportToGrid, gridViewportToFlow } from '../../application/mapFlowViewport';\n\nconst WORLD_PADDING = 2000;\n\n/** Render the controlled, accessible process-editor canvas shared by React Native and React Native Web. */\nexport const FlowCanvas = withZoraThemeScope(FlowCanvasInner);\n\n/** Compose controlled flow interactions on the canonical GridView viewport. */\nfunction FlowCanvasInner(props: FlowCanvasProps) {\n const propsRef = React.useRef(props);\n const controllerRef = React.useRef(createFlowEditorController(props));\n const pendingSourceRef = React.useRef<FlowPortAddress | null>(null);\n React.useLayoutEffect(() => {\n propsRef.current = props;\n controllerRef.current = createFlowEditorController(props);\n }, [props]);\n const [localAnchors, setLocalAnchors] = React.useState<ReadonlyMap<string, FlowPoint>>(new Map());\n const [nodeHeights, setNodeHeights] = React.useState<ReadonlyMap<string, number>>(new Map());\n const [size, setSize] = React.useState({ height: 0, width: 0 });\n const { theme } = useZoraTheme();\n const selectedNodeIdSet = React.useMemo(\n () => new Set(props.selectedNodeIds ?? []),\n [props.selectedNodeIds],\n );\n const minZoom = props.minZoom ?? 0.5;\n const maxZoom = props.maxZoom ?? 2;\n const gridViewport = React.useMemo(\n () => flowViewportToGrid(props.viewport, size),\n [props.viewport, size],\n );\n const items = React.useMemo(\n (): readonly GridRectItem[] =>\n props.nodes.map((node) => ({\n height: nodeHeights.get(node.id) ?? getDeterministicFlowNodeHeight(node),\n id: node.id,\n width: getGraphNodePortGeometry({ ports: node.ports }).width,\n x: node.position.x,\n y: node.position.y,\n })),\n [nodeHeights, props.nodes],\n );\n const world = React.useMemo(() => createWorldBounds(items, gridViewport), [gridViewport, items]);\n const constraints = React.useMemo((): GridViewportConstraints => ({ world }), [world]);\n const nodeById = React.useMemo(\n () => new Map(props.nodes.map((node) => [node.id, node])),\n [props.nodes],\n );\n const selectPort = React.useCallback((address: FlowPortAddress) => {\n const { current } = propsRef;\n const port = current.nodes\n .find((node) => node.id === address.nodeId)\n ?.ports.find((item) => item.id === address.portId);\n if (!port || current.readOnly) return;\n const pendingSource = pendingSourceRef.current;\n if (pendingSource === null) {\n if (port.direction === 'output') pendingSourceRef.current = address;\n return;\n }\n const rejection = controllerRef.current.connect(pendingSource, address);\n if (rejection) current.onConnectionRejected?.(pendingSource, address, rejection);\n pendingSourceRef.current = null;\n }, []);\n const setZoom = React.useCallback(\n (zoom: number) => {\n const { current } = propsRef;\n controllerRef.current.setViewport({\n ...current.viewport,\n zoom: Math.max(minZoom, Math.min(maxZoom, zoom)),\n });\n },\n [maxZoom, minZoom],\n );\n const setPortAnchor = React.useCallback((address: FlowPortAddress, anchor: FlowPoint) => {\n const key = getFlowPortAnchorKey(address);\n setLocalAnchors((current) => {\n const previous = current.get(key);\n if (previous?.x === anchor.x && previous.y === anchor.y) return current;\n return new Map(current).set(key, anchor);\n });\n }, []);\n const setNodeHeight = React.useCallback((nodeId: string, height: number) => {\n setNodeHeights((current) =>\n current.get(nodeId) === height ? current : new Map(current).set(nodeId, height),\n );\n }, []);\n const publishViewport = React.useCallback(\n (next: GridViewport) => controllerRef.current.setViewport(gridViewportToFlow(next)),\n [],\n );\n const viewportRef = React.useRef(gridViewport);\n React.useLayoutEffect(() => {\n viewportRef.current = gridViewport;\n }, [gridViewport]);\n const moveNode = React.useCallback((nodeId: string, delta: GridPoint) => {\n const grid = viewportRef.current;\n const origin = viewportToWorld({ x: 0, y: 0 }, grid);\n const target = viewportToWorld(delta, grid);\n controllerRef.current.moveNode(nodeId, { x: target.x - origin.x, y: target.y - origin.y });\n }, []);\n const disconnect = React.useCallback(\n (connectionId: string) => propsRef.current.onDisconnect?.(connectionId),\n [],\n );\n /*** Request deletion from the controlled host for the current selection. */\n const deleteSelectedNodes = React.useCallback(\n () => controllerRef.current.deleteNodes(propsRef.current.selectedNodeIds ?? []),\n [],\n );\n const renderNode = (item: GridRectItem) => {\n const node = nodeById.get(item.id);\n if (!node) return null;\n const selected = selectedNodeIdSet.has(node.id);\n return (\n <View\n style={{\n transform: [{ scale: props.viewport.zoom }],\n transformOrigin: 'top left',\n width: getGraphNodePortGeometry({ ports: node.ports }).width,\n }}\n onLayout={(event) => setNodeHeight(node.id, event.nativeEvent.layout.height)}\n >\n <GraphNode\n description={node.description}\n disabled={node.disabled}\n ports={node.ports.map((port) => ({\n ...port,\n testID: `flow-port-${node.id}-${port.id}`,\n }))}\n readOnly={props.readOnly === true}\n selected={selected}\n testID={`flow-node-${node.id}`}\n title={node.title}\n width={getGraphNodePortGeometry({ ports: node.ports }).width}\n onMove={(delta) => moveNode(node.id, delta)}\n onPortLayout={(portId, anchor) => setPortAnchor({ nodeId: node.id, portId }, anchor)}\n onPortPress={(portId) => selectPort({ nodeId: node.id, portId })}\n onPress={() => controllerRef.current.selectNode(node.id)}\n >\n {props.renderNode?.(node, { selected })}\n </GraphNode>\n </View>\n );\n };\n\n return (\n <View\n style={{\n backgroundColor: theme.semantics.neutral.surfaceHover,\n borderColor: theme.semantics.neutral.divider,\n borderRadius: 14,\n borderWidth: 1,\n flex: 1,\n minHeight: 360,\n overflow: 'hidden',\n }}\n testID={props.testID}\n >\n <FlowToolbar\n canRedo={props.canRedo === true}\n canUndo={props.canUndo === true}\n canDelete={(props.selectedNodeIds?.length ?? 0) > 0}\n readOnly={props.readOnly === true}\n onDelete={deleteSelectedNodes}\n onRedo={props.onRedo}\n onUndo={props.onUndo}\n onZoomIn={() => setZoom(props.viewport.zoom + 0.1)}\n onZoomOut={() => setZoom(props.viewport.zoom - 0.1)}\n />\n <View\n onLayout={(event) =>\n setSize({\n height: Math.round(event.nativeEvent.layout.height),\n width: Math.round(event.nativeEvent.layout.width),\n })\n }\n testID={props.testID ? `${props.testID}-viewport` : undefined}\n style={{ backgroundColor: theme.semantics.surface.default, flex: 1, minHeight: 300 }}\n >\n {size.width > 0 && size.height > 0 ? (\n <GridView\n contentHeight={world.height}\n contentWidth={world.width}\n height={size.height}\n items={items}\n renderItem={renderNode}\n renderWorldLayer={(layer) => (\n <FlowEdges\n anchors={localAnchors}\n connections={props.connections}\n layer={layer}\n nodes={nodeById}\n readOnly={props.readOnly === true}\n onDisconnect={disconnect}\n />\n )}\n testID={props.testID ? `${props.testID}-grid` : undefined}\n viewport={gridViewport}\n viewportConstraints={constraints}\n viewportControls=\"hidden\"\n width={size.width}\n zoomLimits={{ maxX: maxZoom, maxY: maxZoom, minX: minZoom, minY: minZoom }}\n onViewportChange={publishViewport}\n />\n ) : null}\n </View>\n <FlowPalette\n items={props.paletteItems}\n readOnly={props.readOnly === true}\n onInsert={props.onInsert}\n />\n </View>\n );\n}\n\n/** Bound the world to the nodes plus generous space and always include the supplied viewport. */\nfunction createWorldBounds(items: readonly GridRectItem[], viewport: GridViewport): GridRect {\n const visibleWidth = viewport.width / viewport.pixelsPerUnitX;\n const visibleHeight = viewport.height / viewport.pixelsPerUnitY;\n let minX = viewport.offsetX;\n let minY = viewport.offsetY;\n let maxX = viewport.offsetX + visibleWidth;\n let maxY = viewport.offsetY + visibleHeight;\n for (const item of items) {\n minX = Math.min(minX, item.x - WORLD_PADDING);\n minY = Math.min(minY, item.y - WORLD_PADDING);\n maxX = Math.max(maxX, item.x + item.width + WORLD_PADDING);\n maxY = Math.max(maxY, item.y + item.height + WORLD_PADDING);\n }\n return { height: maxY - minY, width: maxX - minX, x: minX, y: minY };\n}\n\ninterface FlowToolbarProps {\n readonly canDelete: boolean;\n readonly canUndo: boolean;\n readonly canRedo: boolean;\n readonly readOnly: boolean;\n readonly onDelete: () => void;\n readonly onUndo: (() => void) | undefined;\n readonly onRedo: (() => void) | undefined;\n readonly onZoomIn: () => void;\n readonly onZoomOut: () => void;\n}\n\n/** Present keyboard-accessible viewport and history controls. */\nfunction FlowToolbar(props: FlowToolbarProps) {\n const { theme } = useZoraTheme();\n return (\n <View\n style={{\n backgroundColor: theme.semantics.surface.default,\n borderBottomColor: theme.semantics.neutral.divider,\n borderBottomWidth: 1,\n flexDirection: 'row',\n flexWrap: 'wrap',\n gap: 8,\n padding: 10,\n width: '100%',\n }}\n >\n <FlowControl label=\"Zoom out\" onPress={props.onZoomOut} />\n <FlowControl label=\"Zoom in\" onPress={props.onZoomIn} />\n <FlowControl\n disabled={props.readOnly || !props.canDelete}\n label=\"Delete selected nodes\"\n onPress={props.onDelete}\n />\n <FlowControl\n disabled={props.readOnly || !props.canUndo}\n label=\"Undo\"\n onPress={props.onUndo}\n />\n <FlowControl\n disabled={props.readOnly || !props.canRedo}\n label=\"Redo\"\n onPress={props.onRedo}\n />\n </View>\n );\n}\n\n/** Render one focusable command control. */\nfunction FlowControl(props: {\n readonly label: string;\n readonly disabled?: boolean;\n readonly onPress?: () => void;\n}) {\n const { theme } = useZoraTheme();\n return (\n <Pressable\n accessibilityLabel={props.label}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: props.disabled }}\n disabled={props.disabled}\n style={{\n backgroundColor: props.disabled\n ? theme.semantics.neutral.surfaceHover\n : theme.semantics.neutral.surface,\n borderColor: props.disabled ? theme.semantics.neutral.divider : theme.colors.primary,\n borderRadius: 9,\n borderWidth: 1,\n justifyContent: 'center',\n minHeight: 44,\n minWidth: 44,\n paddingHorizontal: 10,\n paddingVertical: 7,\n }}\n onPress={props.onPress}\n >\n <Text\n style={{\n color: props.disabled ? theme.semantics.neutral.textMuted : theme.colors.primary,\n fontSize: 12,\n fontWeight: '700',\n }}\n >\n {props.label}\n </Text>\n </Pressable>\n );\n}\n\n/** Render Bezier edges in the same world coordinates as the nodes they join. */\nconst FlowEdges = React.memo(function FlowEdges(props: {\n readonly anchors: ReadonlyMap<string, FlowPoint>;\n readonly connections: FlowCanvasProps['connections'];\n readonly layer: GridWorldLayerContext;\n readonly nodes: ReadonlyMap<string, FlowNodeData>;\n readonly readOnly: boolean;\n readonly onDisconnect: FlowCanvasProps['onDisconnect'];\n}) {\n const { theme } = useZoraTheme();\n const { layer } = props;\n const resolve = (address: FlowPortAddress): FlowPoint | undefined => {\n const node = props.nodes.get(address.nodeId);\n if (!node) return undefined;\n const deterministic = getDeterministicFlowPortAnchor(node, address);\n if (!deterministic) return undefined;\n const local = getFlowPortAnchor(props.anchors, address) ?? deterministic;\n return {\n x: layer.origin.x + (node.position.x + local.x) * layer.pixelsPerUnitX,\n y: layer.origin.y + (node.position.y + local.y) * layer.pixelsPerUnitY,\n };\n };\n const edges = props.connections.map((connection) => ({\n connection,\n source: resolve(connection.source),\n target: resolve(connection.target),\n }));\n return (\n <>\n <Svg\n height={layer.height}\n pointerEvents=\"none\"\n style={{ left: 0, position: 'absolute', top: 0 }}\n width={layer.width}\n >\n {edges.map((edge) => (\n <FlowEdgePath\n key={edge.connection.id}\n source={edge.source}\n stroke={theme.colors.primary}\n target={edge.target}\n testID={`flow-edge-${edge.connection.id}`}\n />\n ))}\n </Svg>\n {edges.map((edge) => (\n <FlowEdgeControl\n key={edge.connection.id}\n connection={edge.connection}\n onDisconnect={props.onDisconnect}\n readOnly={props.readOnly}\n source={edge.source}\n target={edge.target}\n />\n ))}\n </>\n );\n});\n\n/** Render one edge path only when either endpoint's measured geometry changes. */\nconst FlowEdgePath = React.memo(function FlowEdgePath(props: {\n readonly source: FlowPoint | undefined;\n readonly stroke: string;\n readonly target: FlowPoint | undefined;\n readonly testID: string;\n}) {\n if (!props.source || !props.target) return null;\n const controlDistance = Math.max(48, Math.abs(props.target.x - props.source.x) / 2);\n return (\n <Path\n d={`M ${props.source.x} ${props.source.y} C ${props.source.x + controlDistance} ${props.source.y}, ${props.target.x - controlDistance} ${props.target.y}, ${props.target.x} ${props.target.y}`}\n fill=\"none\"\n stroke={props.stroke}\n strokeWidth={3}\n testID={props.testID}\n />\n );\n});\n\n/** Keep each accessible disconnect target aligned with its two measured endpoints. */\nconst FlowEdgeControl = React.memo(function FlowEdgeControl(props: {\n readonly connection: FlowCanvasProps['connections'][number];\n readonly onDisconnect: FlowCanvasProps['onDisconnect'];\n readonly readOnly: boolean;\n readonly source: FlowPoint | undefined;\n readonly target: FlowPoint | undefined;\n}) {\n if (!props.source || !props.target) return null;\n return (\n <Pressable\n accessibilityHint=\"Disconnect this flow connection\"\n accessibilityLabel={props.connection.label ?? `Connection ${props.connection.id}`}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: props.readOnly }}\n disabled={props.readOnly}\n style={{\n height: 44,\n left: (props.source.x + props.target.x) / 2 - 22,\n position: 'absolute',\n top: (props.source.y + props.target.y) / 2 - 22,\n width: 44,\n zIndex: 1,\n }}\n onPress={() => props.onDisconnect?.(props.connection.id)}\n />\n );\n});\n\n/** Render controlled palette insertion requests. */\nfunction FlowPalette(props: {\n readonly items: FlowCanvasProps['paletteItems'];\n readonly readOnly: boolean;\n readonly onInsert: FlowCanvasProps['onInsert'];\n}) {\n const { theme } = useZoraTheme();\n if (!props.items?.length) return null;\n return (\n <View\n accessibilityLabel=\"Flow palette\"\n style={{ backgroundColor: theme.colors.primary, gap: 8, padding: 12 }}\n >\n {props.items.map((item) => (\n <Pressable\n key={item.id}\n accessibilityHint=\"Insert this node\"\n accessibilityLabel={item.title}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled: props.readOnly || item.disabled }}\n disabled={props.readOnly || item.disabled}\n style={{\n backgroundColor: theme.semantics.neutral.surface,\n borderRadius: 8,\n justifyContent: 'center',\n minHeight: 44,\n padding: 10,\n }}\n onPress={() => props.onInsert?.(item.id)}\n >\n <Text style={{ color: theme.semantics.neutral.text, fontWeight: '700' }}>\n {item.title}\n </Text>\n {item.description ? (\n <Text style={{ color: theme.semantics.neutral.textMuted }}>{item.description}</Text>\n ) : null}\n </Pressable>\n ))}\n </View>\n );\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import type { FlowCanvasProps, FlowConnectionRejection, FlowPortAddress, FlowViewport } from '../../../types/flow';
2
+ /** Create deterministic controlled-flow interaction callbacks without retaining editor state. */
3
+ export declare function createFlowEditorController(props: FlowCanvasProps): {
4
+ connect: (source: FlowPortAddress, target: FlowPortAddress) => FlowConnectionRejection | undefined;
5
+ deleteNodes: (nodeIds: readonly string[]) => void;
6
+ moveNode: (nodeId: string, delta: {
7
+ readonly x: number;
8
+ readonly y: number;
9
+ }) => void;
10
+ selectNode: (nodeId: string) => void;
11
+ setViewport: (viewport: FlowViewport) => void | undefined;
12
+ };
13
+ //# sourceMappingURL=createFlowEditorController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createFlowEditorController.d.ts","sourceRoot":"","sources":["../../../../src/features/flow/application/createFlowEditorController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,uBAAuB,EAGvB,eAAe,EACf,YAAY,EACb,MAAM,qBAAqB,CAAC;AAE7B,iGAAiG;AACjG,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,eAAe;sBAkBtC,eAAe,UAAU,eAAe;2BAOnC,SAAS,MAAM,EAAE;uBApBrB,MAAM,SAAS;QAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;KAAE;yBAJvD,MAAM;4BAgBH,YAAY;EAkB5C"}
@@ -0,0 +1,86 @@
1
+ /** Create deterministic controlled-flow interaction callbacks without retaining editor state. */
2
+ export function createFlowEditorController(props) {
3
+ const selectNode = (nodeId) => {
4
+ if (props.readOnly || props.nodes.find((node) => node.id === nodeId)?.disabled)
5
+ return;
6
+ props.onNodeSelectionChange?.([nodeId]);
7
+ };
8
+ const moveNode = (nodeId, delta) => {
9
+ if (props.readOnly)
10
+ return;
11
+ const node = props.nodes.find((candidate) => candidate.id === nodeId);
12
+ if (!node || node.disabled)
13
+ return;
14
+ props.onNodesMove?.(props.nodes.map((candidate) => candidate.id === nodeId
15
+ ? { ...candidate, position: movePosition(candidate, delta) }
16
+ : candidate));
17
+ };
18
+ const setViewport = (viewport) => props.onViewportChange?.(viewport);
19
+ const connect = (source, target) => {
20
+ const rejection = connectionRejection(props.nodes, source, target);
21
+ if (props.readOnly || rejection)
22
+ return rejection;
23
+ props.onConnect?.(source, target);
24
+ return undefined;
25
+ };
26
+ /*** Deliver a controlled deletion request for the currently enabled nodes. */
27
+ const deleteNodes = (nodeIds) => {
28
+ if (props.readOnly || nodeIds.length === 0)
29
+ return;
30
+ const enabledNodeIds = nodeIds.filter((nodeId) => {
31
+ const node = props.nodes.find((candidate) => candidate.id === nodeId);
32
+ return node !== undefined && !node.disabled;
33
+ });
34
+ if (enabledNodeIds.length > 0)
35
+ props.onNodesDelete?.(enabledNodeIds);
36
+ };
37
+ return { connect, deleteNodes, moveNode, selectNode, setViewport };
38
+ }
39
+ /** Move only the caller-owned coordinate of a node. */
40
+ function movePosition(node, delta) {
41
+ return { x: node.position.x + delta.x, y: node.position.y + delta.y };
42
+ }
43
+ /** Validates a connection at the Canvas boundary without introducing workflow-engine ownership. */
44
+ function connectionRejection(nodes, source, target) {
45
+ if (source.nodeId === target.nodeId)
46
+ return 'connection_requires_distinct_nodes';
47
+ const sourcePort = findPort(nodes, source);
48
+ const targetPort = findPort(nodes, target);
49
+ if (sourcePort?.direction !== 'output' || targetPort?.direction !== 'input') {
50
+ return 'connection_requires_output_to_input';
51
+ }
52
+ if (sourcePort.disabled || targetPort.disabled)
53
+ return 'connection_targets_disabled_port';
54
+ return compatibleDataSchemas(sourcePort.data, targetPort.data)
55
+ ? undefined
56
+ : 'connection_types_incompatible';
57
+ }
58
+ /** Compares only portable schema references or primitive shapes available to the presentation layer. */
59
+ function compatibleDataSchemas(source, target) {
60
+ const sourceReference = source?.schemaRef?.id ?? source?.schema?.ref?.id;
61
+ const targetReference = target?.schemaRef?.id ?? target?.schema?.ref?.id;
62
+ if (sourceReference && targetReference)
63
+ return sourceReference === targetReference;
64
+ if (sourceReference || targetReference)
65
+ return false;
66
+ const sourceTypes = schemaTypes(source?.schema?.type);
67
+ const targetTypes = schemaTypes(target?.schema?.type);
68
+ if (sourceTypes.length === 0 || targetTypes.length === 0)
69
+ return true;
70
+ return sourceTypes.some((type) => targetTypes.includes(type));
71
+ }
72
+ /** Normalizes a Contracts schema's primitive type union before comparing its declared alternatives. */
73
+ function schemaTypes(type) {
74
+ if (typeof type === 'string')
75
+ return [type];
76
+ return Array.isArray(type) && type.every((candidate) => typeof candidate === 'string')
77
+ ? type
78
+ : [];
79
+ }
80
+ /** Locate one port through its public address. */
81
+ function findPort(nodes, address) {
82
+ return nodes
83
+ .find((node) => node.id === address.nodeId)
84
+ ?.ports.find((port) => port.id === address.portId);
85
+ }
86
+ //# sourceMappingURL=createFlowEditorController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createFlowEditorController.js","sourceRoot":"","sources":["../../../../src/features/flow/application/createFlowEditorController.ts"],"names":[],"mappings":"AASA,iGAAiG;AACjG,MAAM,UAAU,0BAA0B,CAAC,KAAsB;IAC/D,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,EAAE;QACpC,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,MAAM,CAAC,EAAE,QAAQ;YAAE,OAAO;QACvF,KAAK,CAAC,qBAAqB,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC;IACF,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAE,KAAiD,EAAE,EAAE;QACrF,IAAI,KAAK,CAAC,QAAQ;YAAE,OAAO;QAC3B,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,MAAM,CAAC,CAAC;QACtE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ;YAAE,OAAO;QACnC,KAAK,CAAC,WAAW,EAAE,CACjB,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAC5B,SAAS,CAAC,EAAE,KAAK,MAAM;YACrB,CAAC,CAAC,EAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,YAAY,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE;YAC5D,CAAC,CAAC,SAAS,CACd,CACF,CAAC;IACJ,CAAC,CAAC;IACF,MAAM,WAAW,GAAG,CAAC,QAAsB,EAAE,EAAE,CA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EAAE,IAAI,CAAC,CAAC;IACtD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtE,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AAChE,CAAC;AAED,uGAAuG;AACvG,SAAS,WAAW,CAAC,IAAa;IAChC,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,OAAO,SAAS,KAAK,QAAQ,CAAC;QACpF,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,EAAE,CAAC;AACT,CAAC;AAED,kDAAkD;AAClD,SAAS,QAAQ,CAAC,KAA8B,EAAE,OAAwB;IACxE,OAAO,KAAK;SACT,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC;QAC3C,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AACvD,CAAC","sourcesContent":["import type {\n FlowCanvasProps,\n FlowConnectionRejection,\n FlowNodeData,\n FlowPort,\n FlowPortAddress,\n FlowViewport,\n} from '../../../types/flow';\n\n/** Create deterministic controlled-flow interaction callbacks without retaining editor state. */\nexport function createFlowEditorController(props: FlowCanvasProps) {\n const selectNode = (nodeId: string) => {\n if (props.readOnly || props.nodes.find((node) => node.id === nodeId)?.disabled) return;\n props.onNodeSelectionChange?.([nodeId]);\n };\n const moveNode = (nodeId: string, delta: { readonly x: number; readonly y: number }) => {\n if (props.readOnly) return;\n const node = props.nodes.find((candidate) => candidate.id === nodeId);\n if (!node || node.disabled) return;\n props.onNodesMove?.(\n props.nodes.map((candidate) =>\n candidate.id === nodeId\n ? { ...candidate, position: movePosition(candidate, delta) }\n : candidate,\n ),\n );\n };\n const setViewport = (viewport: FlowViewport) => props.onViewportChange?.(viewport);\n const connect = (source: FlowPortAddress, target: FlowPortAddress) => {\n const rejection = connectionRejection(props.nodes, source, target);\n if (props.readOnly || rejection) return rejection;\n props.onConnect?.(source, target);\n return undefined;\n };\n /*** Deliver a controlled deletion request for the currently enabled nodes. */\n const deleteNodes = (nodeIds: readonly string[]) => {\n if (props.readOnly || nodeIds.length === 0) return;\n const enabledNodeIds = nodeIds.filter((nodeId) => {\n const node = props.nodes.find((candidate) => candidate.id === nodeId);\n return node !== undefined && !node.disabled;\n });\n if (enabledNodeIds.length > 0) props.onNodesDelete?.(enabledNodeIds);\n };\n\n return { connect, deleteNodes, moveNode, selectNode, setViewport };\n}\n\n/** Move only the caller-owned coordinate of a node. */\nfunction movePosition(\n node: FlowNodeData,\n delta: { readonly x: number; readonly y: number },\n): FlowNodeData['position'] {\n return { x: node.position.x + delta.x, y: node.position.y + delta.y };\n}\n\n/** Validates a connection at the Canvas boundary without introducing workflow-engine ownership. */\nfunction connectionRejection(\n nodes: readonly FlowNodeData[],\n source: FlowPortAddress,\n target: FlowPortAddress,\n): FlowConnectionRejection | undefined {\n if (source.nodeId === target.nodeId) return 'connection_requires_distinct_nodes';\n const sourcePort = findPort(nodes, source);\n const targetPort = findPort(nodes, target);\n if (sourcePort?.direction !== 'output' || targetPort?.direction !== 'input') {\n return 'connection_requires_output_to_input';\n }\n if (sourcePort.disabled || targetPort.disabled) return 'connection_targets_disabled_port';\n return compatibleDataSchemas(sourcePort.data, targetPort.data)\n ? undefined\n : 'connection_types_incompatible';\n}\n\n/** Compares only portable schema references or primitive shapes available to the presentation layer. */\nfunction compatibleDataSchemas(source: FlowPort['data'], target: FlowPort['data']): boolean {\n const sourceReference = source?.schemaRef?.id ?? source?.schema?.ref?.id;\n const targetReference = target?.schemaRef?.id ?? target?.schema?.ref?.id;\n if (sourceReference && targetReference) return sourceReference === targetReference;\n if (sourceReference || targetReference) return false;\n const sourceTypes = schemaTypes(source?.schema?.type);\n const targetTypes = schemaTypes(target?.schema?.type);\n if (sourceTypes.length === 0 || targetTypes.length === 0) return true;\n return sourceTypes.some((type) => targetTypes.includes(type));\n}\n\n/** Normalizes a Contracts schema's primitive type union before comparing its declared alternatives. */\nfunction schemaTypes(type: unknown): readonly string[] {\n if (typeof type === 'string') return [type];\n return Array.isArray(type) && type.every((candidate) => typeof candidate === 'string')\n ? type\n : [];\n}\n\n/** Locate one port through its public address. */\nfunction findPort(nodes: readonly FlowNodeData[], address: FlowPortAddress): FlowPort | undefined {\n return nodes\n .find((node) => node.id === address.nodeId)\n ?.ports.find((port) => port.id === address.portId);\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import type { FlowNodeData, FlowPoint, FlowPortAddress } from '../../../types/flow';
2
+ /*** Creates the stable local key used for one rendered port measurement. */
3
+ export declare function getFlowPortAnchorKey(address: FlowPortAddress): string;
4
+ /*** Resolves the stable canvas coordinate measured at the center of a rendered flow port. */
5
+ export declare function getFlowPortAnchor(anchors: ReadonlyMap<string, FlowPoint>, address: FlowPortAddress): FlowPoint | undefined;
6
+ /*** Supplies stable GraphNode port geometry before virtualization has mounted and measured a node. */
7
+ export declare function getDeterministicFlowPortAnchor(node: FlowNodeData, address: FlowPortAddress): FlowPoint | undefined;
8
+ /*** Provides a deterministic virtualized item height until GraphNode reports its real layout. */
9
+ export declare function getDeterministicFlowNodeHeight(node: FlowNodeData): number;
10
+ //# sourceMappingURL=getFlowPortAnchor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFlowPortAnchor.d.ts","sourceRoot":"","sources":["../../../../src/features/flow/application/getFlowPortAnchor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGpF,4EAA4E;AAC5E,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,UAE5D;AAED,6FAA6F;AAC7F,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,EACvC,OAAO,EAAE,eAAe,GACvB,SAAS,GAAG,SAAS,CAEvB;AAED,sGAAsG;AACtG,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,eAAe,GACvB,SAAS,GAAG,SAAS,CAIvB;AAED,iGAAiG;AACjG,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAEzE"}
@@ -0,0 +1,18 @@
1
+ import { getGraphNodePortGeometry } from '../../graph-node/getGraphNodePortGeometry.js';
2
+ /*** Creates the stable local key used for one rendered port measurement. */
3
+ export function getFlowPortAnchorKey(address) {
4
+ return JSON.stringify([address.nodeId, address.portId]);
5
+ }
6
+ /*** Resolves the stable canvas coordinate measured at the center of a rendered flow port. */
7
+ export function getFlowPortAnchor(anchors, address) {
8
+ return anchors.get(getFlowPortAnchorKey(address));
9
+ }
10
+ /*** Supplies stable GraphNode port geometry before virtualization has mounted and measured a node. */
11
+ export function getDeterministicFlowPortAnchor(node, address) {
12
+ return getGraphNodePortGeometry({ ports: node.ports }).ports.find((port) => port.id === address.portId)?.anchor;
13
+ }
14
+ /*** Provides a deterministic virtualized item height until GraphNode reports its real layout. */
15
+ export function getDeterministicFlowNodeHeight(node) {
16
+ return getGraphNodePortGeometry({ ports: node.ports }).height;
17
+ }
18
+ //# sourceMappingURL=getFlowPortAnchor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFlowPortAnchor.js","sourceRoot":"","sources":["../../../../src/features/flow/application/getFlowPortAnchor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAErF,4EAA4E;AAC5E,MAAM,UAAU,oBAAoB,CAAC,OAAwB;IAC3D,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED,6FAA6F;AAC7F,MAAM,UAAU,iBAAiB,CAC/B,OAAuC,EACvC,OAAwB;IAExB,OAAO,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,8BAA8B,CAC5C,IAAkB,EAClB,OAAwB;IAExB,OAAO,wBAAwB,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAC/D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,OAAO,CAAC,MAAM,CACrC,EAAE,MAAM,CAAC;AACZ,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,8BAA8B,CAAC,IAAkB;IAC/D,OAAO,wBAAwB,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;AAChE,CAAC","sourcesContent":["import type { FlowNodeData, FlowPoint, FlowPortAddress } from '../../../types/flow';\nimport { getGraphNodePortGeometry } from '../../graph-node/getGraphNodePortGeometry';\n\n/*** Creates the stable local key used for one rendered port measurement. */\nexport function getFlowPortAnchorKey(address: FlowPortAddress) {\n return JSON.stringify([address.nodeId, address.portId]);\n}\n\n/*** Resolves the stable canvas coordinate measured at the center of a rendered flow port. */\nexport function getFlowPortAnchor(\n anchors: ReadonlyMap<string, FlowPoint>,\n address: FlowPortAddress,\n): FlowPoint | undefined {\n return anchors.get(getFlowPortAnchorKey(address));\n}\n\n/*** Supplies stable GraphNode port geometry before virtualization has mounted and measured a node. */\nexport function getDeterministicFlowPortAnchor(\n node: FlowNodeData,\n address: FlowPortAddress,\n): FlowPoint | undefined {\n return getGraphNodePortGeometry({ ports: node.ports }).ports.find(\n (port) => port.id === address.portId,\n )?.anchor;\n}\n\n/*** Provides a deterministic virtualized item height until GraphNode reports its real layout. */\nexport function getDeterministicFlowNodeHeight(node: FlowNodeData): number {\n return getGraphNodePortGeometry({ ports: node.ports }).height;\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import type { GridViewport } from '@ankhorage/grid-view';
2
+ import type { FlowViewport } from '../../../types/flow';
3
+ /*** Map the public flow pan/zoom shape onto the canonical grid viewport at the single boundary. */
4
+ export declare function flowViewportToGrid(viewport: FlowViewport, size: {
5
+ readonly width: number;
6
+ readonly height: number;
7
+ }): GridViewport;
8
+ /*** Map a canonical grid viewport back to the public flow pan/zoom shape. */
9
+ export declare function gridViewportToFlow(viewport: GridViewport): FlowViewport;
10
+ //# sourceMappingURL=mapFlowViewport.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapFlowViewport.d.ts","sourceRoot":"","sources":["../../../../src/features/flow/application/mapFlowViewport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,mGAAmG;AACnG,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,YAAY,EACtB,IAAI,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACxD,YAAY,CASd;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,YAAY,GAAG,YAAY,CAQvE"}
@@ -0,0 +1,22 @@
1
+ /*** Map the public flow pan/zoom shape onto the canonical grid viewport at the single boundary. */
2
+ export function flowViewportToGrid(viewport, size) {
3
+ return {
4
+ height: size.height,
5
+ offsetX: -viewport.pan.x / viewport.zoom,
6
+ offsetY: -viewport.pan.y / viewport.zoom,
7
+ pixelsPerUnitX: viewport.zoom,
8
+ pixelsPerUnitY: viewport.zoom,
9
+ width: size.width,
10
+ };
11
+ }
12
+ /*** Map a canonical grid viewport back to the public flow pan/zoom shape. */
13
+ export function gridViewportToFlow(viewport) {
14
+ return {
15
+ pan: {
16
+ x: viewport.offsetX === 0 ? 0 : -viewport.offsetX * viewport.pixelsPerUnitX,
17
+ y: viewport.offsetY === 0 ? 0 : -viewport.offsetY * viewport.pixelsPerUnitY,
18
+ },
19
+ zoom: viewport.pixelsPerUnitX,
20
+ };
21
+ }
22
+ //# sourceMappingURL=mapFlowViewport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mapFlowViewport.js","sourceRoot":"","sources":["../../../../src/features/flow/application/mapFlowViewport.ts"],"names":[],"mappings":"AAIA,mGAAmG;AACnG,MAAM,UAAU,kBAAkB,CAChC,QAAsB,EACtB,IAAyD;IAEzD,OAAO;QACL,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,OAAO,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI;QACxC,OAAO,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI;QACxC,cAAc,EAAE,QAAQ,CAAC,IAAI;QAC7B,cAAc,EAAE,QAAQ,CAAC,IAAI;QAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;KAClB,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,kBAAkB,CAAC,QAAsB;IACvD,OAAO;QACL,GAAG,EAAE;YACH,CAAC,EAAE,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,cAAc;YAC3E,CAAC,EAAE,QAAQ,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,cAAc;SAC5E;QACD,IAAI,EAAE,QAAQ,CAAC,cAAc;KAC9B,CAAC;AACJ,CAAC","sourcesContent":["import type { GridViewport } from '@ankhorage/grid-view';\n\nimport type { FlowViewport } from '../../../types/flow';\n\n/*** Map the public flow pan/zoom shape onto the canonical grid viewport at the single boundary. */\nexport function flowViewportToGrid(\n viewport: FlowViewport,\n size: { readonly width: number; readonly height: number },\n): GridViewport {\n return {\n height: size.height,\n offsetX: -viewport.pan.x / viewport.zoom,\n offsetY: -viewport.pan.y / viewport.zoom,\n pixelsPerUnitX: viewport.zoom,\n pixelsPerUnitY: viewport.zoom,\n width: size.width,\n };\n}\n\n/*** Map a canonical grid viewport back to the public flow pan/zoom shape. */\nexport function gridViewportToFlow(viewport: GridViewport): FlowViewport {\n return {\n pan: {\n x: viewport.offsetX === 0 ? 0 : -viewport.offsetX * viewport.pixelsPerUnitX,\n y: viewport.offsetY === 0 ? 0 : -viewport.offsetY * viewport.pixelsPerUnitY,\n },\n zoom: viewport.pixelsPerUnitX,\n };\n}\n"]}
@@ -0,0 +1,3 @@
1
+ export type { FlowCanvasProps, FlowConnection, FlowConnectionRejection, FlowNodeData, FlowNodeRenderState, FlowPaletteItem, FlowPoint, FlowPort, FlowPortAddress, FlowViewport, } from '../../types/flow';
2
+ export { FlowCanvas } from './adapters/inbound/FlowCanvas';
3
+ //# sourceMappingURL=public.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../../src/features/flow/public.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,eAAe,EACf,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { FlowCanvas } from './adapters/inbound/FlowCanvas.js';
2
+ //# sourceMappingURL=public.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public.js","sourceRoot":"","sources":["../../../src/features/flow/public.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC","sourcesContent":["export type {\n FlowCanvasProps,\n FlowConnection,\n FlowConnectionRejection,\n FlowNodeData,\n FlowNodeRenderState,\n FlowPaletteItem,\n FlowPoint,\n FlowPort,\n FlowPortAddress,\n FlowViewport,\n} from '../../types/flow';\nexport { FlowCanvas } from './adapters/inbound/FlowCanvas';\n"]}
@@ -3,7 +3,7 @@ export declare const gradientMeta: {
3
3
  readonly category: "component";
4
4
  readonly description: "Renders a host-backed gradient container for nested manifest content.";
5
5
  readonly directManifestNode: true;
6
- readonly allowedChildren: readonly ["ActivityIndicator", "Audio", "AuthScreen", "ForgotPasswordForm", "OAuthProviderButton", "OAuthProviderList", "OtpForm", "SignInForm", "SignUpForm", "Accordion", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "DatePicker", "Dialog", "Pagination", "Rating", "SearchInput", "Tabs", "Toolbar", "Skeleton", "SkeletonCard", "SkeletonList", "SkeletonText", "IconButton", "Uploader", "MediaExplorer", "FileExplorer", "FlatList", "SectionList", "BottomSheet", "Popover", "Select", "ProductCard", "View", "ScrollView", "Grid", "Gradient", "Divider", "Text", "Heading", "Icon", "Image", "Hero", "KeyboardAvoidingView", "Link", "MasterDetail", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "RichText", "TimePicker", "Timeline", "Form", "Card", "EmptyState", "SectionHeader", "PostCard", "ChatListItem", "MessageBubble", "ProgressRing", "Reader", "ContentRail", "MissingElement", "Video"];
6
+ readonly allowedChildren: readonly ["ActivityIndicator", "Audio", "AuthScreen", "ForgotPasswordForm", "OAuthProviderButton", "OAuthProviderList", "OtpForm", "SignInForm", "SignUpForm", "Accordion", "Surface", "Avatar", "AvatarGroup", "Badge", "MediaCard", "MetricCard", "Chip", "ChipGroup", "DataTable", "DatePicker", "Dialog", "Pagination", "Rating", "SearchInput", "Tabs", "Toolbar", "Skeleton", "SkeletonCard", "SkeletonList", "SkeletonText", "IconButton", "Uploader", "MediaExplorer", "FileExplorer", "FlatList", "SectionList", "BottomSheet", "Popover", "Select", "ProductCard", "View", "ScrollView", "Grid", "Gradient", "Divider", "Text", "Heading", "Icon", "Image", "Hero", "KeyboardAvoidingView", "Link", "MasterDetail", "Button", "ButtonGroup", "RadioGroup", "ThemeModeToggle", "TextInput", "RichText", "TimePicker", "Timeline", "Form", "Card", "EmptyState", "SectionHeader", "PostCard", "ChatListItem", "MessageBubble", "Progress", "ProgressRing", "Reader", "ContentRail", "MissingElement", "Video"];
7
7
  readonly blueprint: {
8
8
  readonly label: "Gradient";
9
9
  };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { GraphNodeProps } from '../../../../types/graph-node';
3
+ /*** Presents one generic node with composed content, optional ports and controlled interactions. */
4
+ export declare const GraphNode: React.MemoExoticComponent<(props: GraphNodeProps) => React.ReactElement | null>;
5
+ //# sourceMappingURL=GraphNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/graph-node/adapters/inbound/GraphNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAcnF,oGAAoG;AACpG,eAAO,MAAM,SAAS,iFAAiD,CAAC"}