@finos/legend-cube-builder 0.0.0-stage → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +5 -2
  3. package/lib/__lib__/LegendCubeCommand.d.ts +26 -0
  4. package/lib/__lib__/LegendCubeCommand.d.ts.map +1 -0
  5. package/lib/__lib__/LegendCubeCommand.js +40 -0
  6. package/lib/__lib__/LegendCubeCommand.js.map +1 -0
  7. package/lib/__lib__/LegendCubeHelpText.d.ts +19 -0
  8. package/lib/__lib__/LegendCubeHelpText.d.ts.map +1 -0
  9. package/lib/__lib__/LegendCubeHelpText.js +27 -0
  10. package/lib/__lib__/LegendCubeHelpText.js.map +1 -0
  11. package/lib/__lib__/LegendCubeLabels.d.ts +68 -0
  12. package/lib/__lib__/LegendCubeLabels.d.ts.map +1 -0
  13. package/lib/__lib__/LegendCubeLabels.js +109 -0
  14. package/lib/__lib__/LegendCubeLabels.js.map +1 -0
  15. package/lib/__lib__/LegendCubeTesting.d.ts +33 -0
  16. package/lib/__lib__/LegendCubeTesting.d.ts.map +1 -0
  17. package/lib/__lib__/LegendCubeTesting.js +34 -0
  18. package/lib/__lib__/LegendCubeTesting.js.map +1 -0
  19. package/lib/__test-utils__/CubeCanvasTestUtils.d.ts +24 -0
  20. package/lib/__test-utils__/CubeCanvasTestUtils.d.ts.map +1 -0
  21. package/lib/__test-utils__/CubeCanvasTestUtils.js +37 -0
  22. package/lib/__test-utils__/CubeCanvasTestUtils.js.map +1 -0
  23. package/lib/__test-utils__/CubeEngineTestSupport.d.ts +41 -0
  24. package/lib/__test-utils__/CubeEngineTestSupport.d.ts.map +1 -0
  25. package/lib/__test-utils__/CubeEngineTestSupport.js +76 -0
  26. package/lib/__test-utils__/CubeEngineTestSupport.js.map +1 -0
  27. package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts +31 -0
  28. package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts.map +1 -0
  29. package/lib/__test-utils__/CubeNorthwindTestQueries.js +102 -0
  30. package/lib/__test-utils__/CubeNorthwindTestQueries.js.map +1 -0
  31. package/lib/__test-utils__/CubePageTestUtils.d.ts +33 -0
  32. package/lib/__test-utils__/CubePageTestUtils.d.ts.map +1 -0
  33. package/lib/__test-utils__/CubePageTestUtils.js +68 -0
  34. package/lib/__test-utils__/CubePageTestUtils.js.map +1 -0
  35. package/lib/__test-utils__/CubeTestApplication.d.ts +30 -0
  36. package/lib/__test-utils__/CubeTestApplication.d.ts.map +1 -0
  37. package/lib/__test-utils__/CubeTestApplication.js +57 -0
  38. package/lib/__test-utils__/CubeTestApplication.js.map +1 -0
  39. package/lib/__test-utils__/FakeCubeEngine.d.ts +41 -0
  40. package/lib/__test-utils__/FakeCubeEngine.d.ts.map +1 -0
  41. package/lib/__test-utils__/FakeCubeEngine.js +85 -0
  42. package/lib/__test-utils__/FakeCubeEngine.js.map +1 -0
  43. package/lib/components/CubeButton.d.ts +20 -0
  44. package/lib/components/CubeButton.d.ts.map +1 -0
  45. package/lib/components/CubeButton.js +24 -0
  46. package/lib/components/CubeButton.js.map +1 -0
  47. package/lib/components/CubeEditor.d.ts +31 -0
  48. package/lib/components/CubeEditor.d.ts.map +1 -0
  49. package/lib/components/CubeEditor.js +90 -0
  50. package/lib/components/CubeEditor.js.map +1 -0
  51. package/lib/components/CubeNodeIcon.d.ts +23 -0
  52. package/lib/components/CubeNodeIcon.d.ts.map +1 -0
  53. package/lib/components/CubeNodeIcon.js +32 -0
  54. package/lib/components/CubeNodeIcon.js.map +1 -0
  55. package/lib/components/canvas/CubeCanvas.d.ts +37 -0
  56. package/lib/components/canvas/CubeCanvas.d.ts.map +1 -0
  57. package/lib/components/canvas/CubeCanvas.js +135 -0
  58. package/lib/components/canvas/CubeCanvas.js.map +1 -0
  59. package/lib/components/canvas/CubeCanvasContext.d.ts +19 -0
  60. package/lib/components/canvas/CubeCanvasContext.d.ts.map +1 -0
  61. package/lib/components/canvas/CubeCanvasContext.js +22 -0
  62. package/lib/components/canvas/CubeCanvasContext.js.map +1 -0
  63. package/lib/components/canvas/CubeCanvasContextMenu.d.ts +28 -0
  64. package/lib/components/canvas/CubeCanvasContextMenu.d.ts.map +1 -0
  65. package/lib/components/canvas/CubeCanvasContextMenu.js +35 -0
  66. package/lib/components/canvas/CubeCanvasContextMenu.js.map +1 -0
  67. package/lib/components/canvas/CubeCanvasDnd.d.ts +43 -0
  68. package/lib/components/canvas/CubeCanvasDnd.d.ts.map +1 -0
  69. package/lib/components/canvas/CubeCanvasDnd.js +51 -0
  70. package/lib/components/canvas/CubeCanvasDnd.js.map +1 -0
  71. package/lib/components/canvas/CubeCanvasEdge.d.ts +24 -0
  72. package/lib/components/canvas/CubeCanvasEdge.d.ts.map +1 -0
  73. package/lib/components/canvas/CubeCanvasEdge.js +33 -0
  74. package/lib/components/canvas/CubeCanvasEdge.js.map +1 -0
  75. package/lib/components/canvas/CubeCanvasElements.d.ts +64 -0
  76. package/lib/components/canvas/CubeCanvasElements.d.ts.map +1 -0
  77. package/lib/components/canvas/CubeCanvasElements.js +96 -0
  78. package/lib/components/canvas/CubeCanvasElements.js.map +1 -0
  79. package/lib/components/canvas/CubeCanvasLayout.d.ts +32 -0
  80. package/lib/components/canvas/CubeCanvasLayout.d.ts.map +1 -0
  81. package/lib/components/canvas/CubeCanvasLayout.js +63 -0
  82. package/lib/components/canvas/CubeCanvasLayout.js.map +1 -0
  83. package/lib/components/canvas/CubeCanvasNode.d.ts +29 -0
  84. package/lib/components/canvas/CubeCanvasNode.d.ts.map +1 -0
  85. package/lib/components/canvas/CubeCanvasNode.js +72 -0
  86. package/lib/components/canvas/CubeCanvasNode.js.map +1 -0
  87. package/lib/components/editors/CubeColumnPicker.d.ts +40 -0
  88. package/lib/components/editors/CubeColumnPicker.d.ts.map +1 -0
  89. package/lib/components/editors/CubeColumnPicker.js +51 -0
  90. package/lib/components/editors/CubeColumnPicker.js.map +1 -0
  91. package/lib/components/editors/CubeFilterEditor.d.ts +26 -0
  92. package/lib/components/editors/CubeFilterEditor.d.ts.map +1 -0
  93. package/lib/components/editors/CubeFilterEditor.js +90 -0
  94. package/lib/components/editors/CubeFilterEditor.js.map +1 -0
  95. package/lib/components/editors/CubeJoinEditor.d.ts +26 -0
  96. package/lib/components/editors/CubeJoinEditor.d.ts.map +1 -0
  97. package/lib/components/editors/CubeJoinEditor.js +76 -0
  98. package/lib/components/editors/CubeJoinEditor.js.map +1 -0
  99. package/lib/components/editors/CubeNodeEditorPanel.d.ts +29 -0
  100. package/lib/components/editors/CubeNodeEditorPanel.d.ts.map +1 -0
  101. package/lib/components/editors/CubeNodeEditorPanel.js +71 -0
  102. package/lib/components/editors/CubeNodeEditorPanel.js.map +1 -0
  103. package/lib/components/editors/CubeNodeEditorRegistry.d.ts +44 -0
  104. package/lib/components/editors/CubeNodeEditorRegistry.d.ts.map +1 -0
  105. package/lib/components/editors/CubeNodeEditorRegistry.js +30 -0
  106. package/lib/components/editors/CubeNodeEditorRegistry.js.map +1 -0
  107. package/lib/components/editors/CubeSourceEditor.d.ts +25 -0
  108. package/lib/components/editors/CubeSourceEditor.d.ts.map +1 -0
  109. package/lib/components/editors/CubeSourceEditor.js +42 -0
  110. package/lib/components/editors/CubeSourceEditor.js.map +1 -0
  111. package/lib/components/editors/CubeValueEditor.d.ts +40 -0
  112. package/lib/components/editors/CubeValueEditor.d.ts.map +1 -0
  113. package/lib/components/editors/CubeValueEditor.js +177 -0
  114. package/lib/components/editors/CubeValueEditor.js.map +1 -0
  115. package/lib/components/grid/CubeGridRegion.d.ts +23 -0
  116. package/lib/components/grid/CubeGridRegion.d.ts.map +1 -0
  117. package/lib/components/grid/CubeGridRegion.js +94 -0
  118. package/lib/components/grid/CubeGridRegion.js.map +1 -0
  119. package/lib/components/grid/CubeGridValues.d.ts +25 -0
  120. package/lib/components/grid/CubeGridValues.d.ts.map +1 -0
  121. package/lib/components/grid/CubeGridValues.js +95 -0
  122. package/lib/components/grid/CubeGridValues.js.map +1 -0
  123. package/lib/components/grid/CubeResultGrid.d.ts +26 -0
  124. package/lib/components/grid/CubeResultGrid.d.ts.map +1 -0
  125. package/lib/components/grid/CubeResultGrid.js +50 -0
  126. package/lib/components/grid/CubeResultGrid.js.map +1 -0
  127. package/lib/components/palette/CubePalette.d.ts +29 -0
  128. package/lib/components/palette/CubePalette.d.ts.map +1 -0
  129. package/lib/components/palette/CubePalette.js +73 -0
  130. package/lib/components/palette/CubePalette.js.map +1 -0
  131. package/lib/components/show-pure/CubeShowPureDialog.d.ts +23 -0
  132. package/lib/components/show-pure/CubeShowPureDialog.d.ts.map +1 -0
  133. package/lib/components/show-pure/CubeShowPureDialog.js +37 -0
  134. package/lib/components/show-pure/CubeShowPureDialog.js.map +1 -0
  135. package/lib/components/source-picker/CubeSourcePicker.d.ts +22 -0
  136. package/lib/components/source-picker/CubeSourcePicker.d.ts.map +1 -0
  137. package/lib/components/source-picker/CubeSourcePicker.js +89 -0
  138. package/lib/components/source-picker/CubeSourcePicker.js.map +1 -0
  139. package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts +26 -0
  140. package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts.map +1 -0
  141. package/lib/components/spec-transfer/CubeSpecTransferDialog.js +45 -0
  142. package/lib/components/spec-transfer/CubeSpecTransferDialog.js.map +1 -0
  143. package/lib/graph-manager/CubeEngine.d.ts +115 -0
  144. package/lib/graph-manager/CubeEngine.d.ts.map +1 -0
  145. package/lib/graph-manager/CubeEngine.js +61 -0
  146. package/lib/graph-manager/CubeEngine.js.map +1 -0
  147. package/lib/graph-manager/CubeModelOutlineHelper.d.ts +25 -0
  148. package/lib/graph-manager/CubeModelOutlineHelper.d.ts.map +1 -0
  149. package/lib/graph-manager/CubeModelOutlineHelper.js +24 -0
  150. package/lib/graph-manager/CubeModelOutlineHelper.js.map +1 -0
  151. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts +26 -0
  152. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts.map +1 -0
  153. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js +22 -0
  154. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js.map +1 -0
  155. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts +27 -0
  156. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts.map +1 -0
  157. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js +76 -0
  158. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js.map +1 -0
  159. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts +27 -0
  160. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts.map +1 -0
  161. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js +82 -0
  162. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js.map +1 -0
  163. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts +32 -0
  164. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts.map +1 -0
  165. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js +195 -0
  166. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js.map +1 -0
  167. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts +20 -0
  168. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts.map +1 -0
  169. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js +121 -0
  170. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js.map +1 -0
  171. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts +24 -0
  172. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts.map +1 -0
  173. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js +43 -0
  174. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js.map +1 -0
  175. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts +45 -0
  176. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts.map +1 -0
  177. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js +171 -0
  178. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js.map +1 -0
  179. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts +22 -0
  180. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts.map +1 -0
  181. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js +79 -0
  182. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js.map +1 -0
  183. package/lib/index.css +17 -0
  184. package/lib/index.css.map +1 -0
  185. package/lib/index.d.ts +25 -0
  186. package/lib/index.d.ts.map +1 -0
  187. package/lib/index.js +24 -0
  188. package/lib/index.js.map +1 -0
  189. package/lib/stores/CubeEditorState.d.ts +206 -0
  190. package/lib/stores/CubeEditorState.d.ts.map +1 -0
  191. package/lib/stores/CubeEditorState.js +551 -0
  192. package/lib/stores/CubeEditorState.js.map +1 -0
  193. package/lib/stores/CubeExecutionState.d.ts +67 -0
  194. package/lib/stores/CubeExecutionState.d.ts.map +1 -0
  195. package/lib/stores/CubeExecutionState.js +196 -0
  196. package/lib/stores/CubeExecutionState.js.map +1 -0
  197. package/lib/stores/CubeHost.d.ts +31 -0
  198. package/lib/stores/CubeHost.d.ts.map +1 -0
  199. package/lib/stores/CubeHost.js +17 -0
  200. package/lib/stores/CubeHost.js.map +1 -0
  201. package/lib/stores/CubeNodeEditorState.d.ts +85 -0
  202. package/lib/stores/CubeNodeEditorState.d.ts.map +1 -0
  203. package/lib/stores/CubeNodeEditorState.js +207 -0
  204. package/lib/stores/CubeNodeEditorState.js.map +1 -0
  205. package/lib/stores/CubeShowPureState.d.ts +38 -0
  206. package/lib/stores/CubeShowPureState.d.ts.map +1 -0
  207. package/lib/stores/CubeShowPureState.js +83 -0
  208. package/lib/stores/CubeShowPureState.js.map +1 -0
  209. package/lib/stores/CubeSourcePickerState.d.ts +98 -0
  210. package/lib/stores/CubeSourcePickerState.d.ts.map +1 -0
  211. package/lib/stores/CubeSourcePickerState.js +334 -0
  212. package/lib/stores/CubeSourcePickerState.js.map +1 -0
  213. package/lib/stores/CubeSpecTransferState.d.ts +60 -0
  214. package/lib/stores/CubeSpecTransferState.d.ts.map +1 -0
  215. package/lib/stores/CubeSpecTransferState.js +167 -0
  216. package/lib/stores/CubeSpecTransferState.js.map +1 -0
  217. package/lib/stores/LocalModelCatalog.d.ts +37 -0
  218. package/lib/stores/LocalModelCatalog.d.ts.map +1 -0
  219. package/lib/stores/LocalModelCatalog.js +49 -0
  220. package/lib/stores/LocalModelCatalog.js.map +1 -0
  221. package/lib/stores/editors/CubeFilterDraft.d.ts +61 -0
  222. package/lib/stores/editors/CubeFilterDraft.d.ts.map +1 -0
  223. package/lib/stores/editors/CubeFilterDraft.js +186 -0
  224. package/lib/stores/editors/CubeFilterDraft.js.map +1 -0
  225. package/lib/stores/editors/CubeJoinDraft.d.ts +63 -0
  226. package/lib/stores/editors/CubeJoinDraft.d.ts.map +1 -0
  227. package/lib/stores/editors/CubeJoinDraft.js +136 -0
  228. package/lib/stores/editors/CubeJoinDraft.js.map +1 -0
  229. package/lib/stores/editors/CubeNodeDraft.d.ts +38 -0
  230. package/lib/stores/editors/CubeNodeDraft.d.ts.map +1 -0
  231. package/lib/stores/editors/CubeNodeDraft.js +35 -0
  232. package/lib/stores/editors/CubeNodeDraft.js.map +1 -0
  233. package/lib/stores/editors/CubeNodeDraftRegistry.d.ts +29 -0
  234. package/lib/stores/editors/CubeNodeDraftRegistry.d.ts.map +1 -0
  235. package/lib/stores/editors/CubeNodeDraftRegistry.js +33 -0
  236. package/lib/stores/editors/CubeNodeDraftRegistry.js.map +1 -0
  237. package/lib/stores/fixtures/CubeNorthwindModel.d.ts +23 -0
  238. package/lib/stores/fixtures/CubeNorthwindModel.d.ts.map +1 -0
  239. package/lib/stores/fixtures/CubeNorthwindModel.js +338 -0
  240. package/lib/stores/fixtures/CubeNorthwindModel.js.map +1 -0
  241. package/package.json +81 -3
  242. package/src/__lib__/LegendCubeCommand.ts +44 -0
  243. package/src/__lib__/LegendCubeHelpText.ts +38 -0
  244. package/src/__lib__/LegendCubeLabels.ts +141 -0
  245. package/src/__lib__/LegendCubeTesting.ts +33 -0
  246. package/src/__test-utils__/CubeCanvasTestUtils.ts +53 -0
  247. package/src/__test-utils__/CubeEngineTestSupport.ts +137 -0
  248. package/src/__test-utils__/CubeNorthwindTestQueries.ts +165 -0
  249. package/src/__test-utils__/CubePageTestUtils.tsx +96 -0
  250. package/src/__test-utils__/CubeTestApplication.ts +82 -0
  251. package/src/__test-utils__/FakeCubeEngine.ts +139 -0
  252. package/src/components/CubeButton.tsx +35 -0
  253. package/src/components/CubeEditor.tsx +239 -0
  254. package/src/components/CubeNodeIcon.tsx +47 -0
  255. package/src/components/canvas/CubeCanvas.tsx +260 -0
  256. package/src/components/canvas/CubeCanvasContext.ts +31 -0
  257. package/src/components/canvas/CubeCanvasContextMenu.tsx +89 -0
  258. package/src/components/canvas/CubeCanvasDnd.ts +82 -0
  259. package/src/components/canvas/CubeCanvasEdge.tsx +57 -0
  260. package/src/components/canvas/CubeCanvasElements.ts +150 -0
  261. package/src/components/canvas/CubeCanvasLayout.ts +88 -0
  262. package/src/components/canvas/CubeCanvasNode.tsx +141 -0
  263. package/src/components/editors/CubeColumnPicker.tsx +114 -0
  264. package/src/components/editors/CubeFilterEditor.tsx +309 -0
  265. package/src/components/editors/CubeJoinEditor.tsx +224 -0
  266. package/src/components/editors/CubeNodeEditorPanel.tsx +204 -0
  267. package/src/components/editors/CubeNodeEditorRegistry.ts +61 -0
  268. package/src/components/editors/CubeSourceEditor.tsx +116 -0
  269. package/src/components/editors/CubeValueEditor.tsx +332 -0
  270. package/src/components/grid/CubeGridRegion.tsx +274 -0
  271. package/src/components/grid/CubeGridValues.ts +125 -0
  272. package/src/components/grid/CubeResultGrid.tsx +84 -0
  273. package/src/components/palette/CubePalette.tsx +177 -0
  274. package/src/components/show-pure/CubeShowPureDialog.tsx +101 -0
  275. package/src/components/source-picker/CubeSourcePicker.tsx +304 -0
  276. package/src/components/spec-transfer/CubeSpecTransferDialog.tsx +157 -0
  277. package/src/graph-manager/CubeEngine.ts +155 -0
  278. package/src/graph-manager/CubeModelOutlineHelper.ts +32 -0
  279. package/src/graph-manager/protocol/pure/CubeEngineBuilder.ts +34 -0
  280. package/src/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.ts +109 -0
  281. package/src/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.ts +115 -0
  282. package/src/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.ts +257 -0
  283. package/src/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.ts +157 -0
  284. package/src/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.ts +58 -0
  285. package/src/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.ts +278 -0
  286. package/src/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.ts +124 -0
  287. package/src/index.ts +41 -0
  288. package/src/stores/CubeEditorState.ts +702 -0
  289. package/src/stores/CubeExecutionState.ts +255 -0
  290. package/src/stores/CubeHost.ts +32 -0
  291. package/src/stores/CubeNodeEditorState.ts +255 -0
  292. package/src/stores/CubeShowPureState.ts +96 -0
  293. package/src/stores/CubeSourcePickerState.ts +426 -0
  294. package/src/stores/CubeSpecTransferState.ts +198 -0
  295. package/src/stores/LocalModelCatalog.ts +70 -0
  296. package/src/stores/editors/CubeFilterDraft.ts +241 -0
  297. package/src/stores/editors/CubeJoinDraft.ts +197 -0
  298. package/src/stores/editors/CubeNodeDraft.ts +46 -0
  299. package/src/stores/editors/CubeNodeDraftRegistry.ts +49 -0
  300. package/src/stores/fixtures/CubeNorthwindModel.ts +355 -0
  301. package/tsconfig.json +118 -0
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { jest } from '@jest/globals';
17
+ import { Schema } from '@finos/legend-cube';
18
+ import { CubeEngineError, CubeEngineErrorKind, } from '../graph-manager/CubeEngine.js';
19
+ import { CUSTOMERS_COLUMNS, NORTHWIND_DATABASE, NORTHWIND_RUNTIME, ORDERS_COLUMNS, } from './CubeNorthwindTestQueries.js';
20
+ // A CubeEngine for jsdom tests (PLAN §11.1 M1.8a): canned answers, no network.
21
+ // Each method is a jest.fn, kept in its own variable so tests can read its
22
+ // calls or change its answer.
23
+ /** Northwind as the fake knows it: two tables, one runtime keyed by the database */
24
+ export const FAKE_NORTHWIND_OUTLINE = {
25
+ databases: [
26
+ {
27
+ path: NORTHWIND_DATABASE,
28
+ schemas: [
29
+ {
30
+ name: 'NORTHWIND',
31
+ tables: [
32
+ {
33
+ name: 'ORDERS',
34
+ isView: false,
35
+ columnCount: ORDERS_COLUMNS.length,
36
+ flags: [],
37
+ untypedColumns: [],
38
+ },
39
+ {
40
+ name: 'CUSTOMERS',
41
+ isView: false,
42
+ columnCount: CUSTOMERS_COLUMNS.length,
43
+ flags: [],
44
+ untypedColumns: [],
45
+ },
46
+ ],
47
+ },
48
+ ],
49
+ },
50
+ ],
51
+ runtimes: [{ path: NORTHWIND_RUNTIME, storePaths: [NORTHWIND_DATABASE] }],
52
+ };
53
+ /** The schemas the fake gives, keyed by `<schema>.<table>` as the outline names them */
54
+ export const FAKE_NORTHWIND_SCHEMAS = new Map([
55
+ ['NORTHWIND.ORDERS', new Schema(ORDERS_COLUMNS)],
56
+ ['NORTHWIND.CUSTOMERS', new Schema(CUSTOMERS_COLUMNS)],
57
+ ]);
58
+ export const EMPTY_CUBE_RESULT = {
59
+ columns: [],
60
+ rows: [],
61
+ sql: [],
62
+ durationMs: 0,
63
+ };
64
+ /** A fresh fake: build one per test, since jest.fn keeps its calls across tests */
65
+ export const createFakeCubeEngine = (answers = {}) => {
66
+ const schemas = answers.schemas ?? FAKE_NORTHWIND_SCHEMAS;
67
+ const loadModel = jest.fn(async () => Promise.resolve(answers.outline ?? FAKE_NORTHWIND_OUTLINE));
68
+ const resolveSchemas = jest.fn(async (_model, accessors) => Promise.resolve(new Map([...accessors].map(([nodeId, [, schema, table]]) => [
69
+ nodeId,
70
+ schemas.get(`${schema}.${table}`) ??
71
+ new CubeEngineError(CubeEngineErrorKind.COMPILE, `The table "${schema}.${table}" can't be found`, nodeId),
72
+ ]))));
73
+ const typeLambdas = jest.fn(async () => Promise.resolve(new Map()));
74
+ const execute = jest.fn(async () => Promise.resolve(answers.result ?? EMPTY_CUBE_RESULT));
75
+ const renderPure = jest.fn(async () => Promise.resolve(answers.pure ?? ''));
76
+ return {
77
+ engine: { loadModel, resolveSchemas, typeLambdas, execute, renderPure },
78
+ loadModel,
79
+ resolveSchemas,
80
+ typeLambdas,
81
+ execute,
82
+ renderPure,
83
+ };
84
+ };
85
+ //# sourceMappingURL=FakeCubeEngine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FakeCubeEngine.js","sourceRoot":"","sources":["../../src/__test-utils__/FakeCubeEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC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EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE;QACvE,SAAS;QACT,cAAc;QACd,WAAW;QACX,OAAO;QACP,UAAU;KACX,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /** A small text button in the page's toolbars and lists, coloured by the theme's tokens */
17
+ export declare const CubeButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & {
18
+ primary?: boolean;
19
+ }>;
20
+ //# sourceMappingURL=CubeButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeButton.d.ts","sourceRoot":"","sources":["../../src/components/CubeButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,2FAA2F;AAC3F,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAC/B,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CActE,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * Copyright (c) 2026-present, Goldman Sachs
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { clsx } from '@finos/legend-art';
18
+ /** A small text button in the page's toolbars and lists, coloured by the theme's tokens */
19
+ export const CubeButton = ({ className, primary, ...props }) => (_jsx("button", { ...props,
20
+ // these buttons never submit a form
21
+ type: "button", className: clsx('h-6 shrink-0 rounded-sm border px-2 text-base enabled:cursor-pointer disabled:cursor-not-allowed disabled:text-[var(--color-text-disabled)]', primary
22
+ ? 'border-[var(--color-accent)] bg-[var(--color-accent)] text-[var(--color-text-on-accent)] enabled:hover:bg-[var(--color-accent-hover)] disabled:border-[var(--color-border-default)] disabled:bg-[var(--color-bg-panel-header)]'
23
+ : 'border-[var(--color-border-default)] bg-[var(--color-bg-elevated)] text-[var(--color-text-primary)] enabled:hover:bg-[var(--color-bg-hover)]', className) }));
24
+ //# sourceMappingURL=CubeButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeButton.js","sourceRoot":"","sources":["../../src/components/CubeButton.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,2FAA2F;AAC3F,MAAM,CAAC,MAAM,UAAU,GAEnB,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE,CAAC,CACxC,oBACM,KAAK;IACT,oCAAoC;IACpC,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,IAAI,CACb,6IAA6I,EAC7I,OAAO;QACL,CAAC,CAAC,gOAAgO;QAClO,CAAC,CAAC,8IAA8I,EAClJ,SAAS,CACV,GACD,CACH,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { CubeDocument } from '@finos/legend-cube';
17
+ import type { CubeHost } from '../stores/CubeHost.js';
18
+ /**
19
+ * The Legend Cube page: the query above, its results below, both always
20
+ * shown (PLAN §7.1); hiding the graph leaves its header. The host gives it
21
+ * the engine, the models and the application store; the page's state lives
22
+ * as long as the page.
23
+ */
24
+ export declare const CubeEditor: ((props: {
25
+ host: CubeHost;
26
+ /** The cube to open; an empty one by default */
27
+ initialDocument?: CubeDocument | undefined;
28
+ }) => import("react/jsx-runtime").JSX.Element) & {
29
+ displayName: string;
30
+ };
31
+ //# sourceMappingURL=CubeEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeEditor.d.ts","sourceRoot":"","sources":["../../src/components/CubeEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAUH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAavD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AA6ItD;;;;;GAKG;AACH,eAAO,MAAM,UAAU,WACb;IACN,IAAI,EAAE,QAAQ,CAAC;IACf,gDAAgD;IAChD,eAAe,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CAC5C;;CAiDF,CAAC"}
@@ -0,0 +1,90 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Copyright (c) 2026-present, Goldman Sachs
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { getCollapsiblePanelGroupProps, PanelLoadingIndicator, ResizablePanel, ResizablePanelGroup, ResizablePanelSplitter, } from '@finos/legend-art';
18
+ import { useCommands } from '@finos/legend-application';
19
+ import { flowResult } from 'mobx';
20
+ import { observer } from 'mobx-react-lite';
21
+ import { useEffect, useState } from 'react';
22
+ import { UNDO_SHORTCUT_LABEL } from '../__lib__/LegendCubeCommand.js';
23
+ import { CUBE_PENDING_LABEL, formatDisabledReasons, READ_ONLY_CUBE_TITLE, UNSAVED_CUBE_NAME, } from '../__lib__/LegendCubeLabels.js';
24
+ import { LEGEND_CUBE_TEST_ID } from '../__lib__/LegendCubeTesting.js';
25
+ import { CubeEditorState } from '../stores/CubeEditorState.js';
26
+ import { CubeButton } from './CubeButton.js';
27
+ import { CubeCanvas } from './canvas/CubeCanvas.js';
28
+ import { CubeNodeEditorPanel } from './editors/CubeNodeEditorPanel.js';
29
+ import { CubeGridRegion } from './grid/CubeGridRegion.js';
30
+ import { CubePalette } from './palette/CubePalette.js';
31
+ import { CubeShowPureDialog } from './show-pure/CubeShowPureDialog.js';
32
+ import { CubeSourcePicker } from './source-picker/CubeSourcePicker.js';
33
+ import { CubeSpecTransferDialog } from './spec-transfer/CubeSpecTransferDialog.js';
34
+ /** The graph never takes more of the window's height than this, so the results stay in view (spec §17.3) */
35
+ const MAX_GRAPH_SHARE_OF_WINDOW = 0.6;
36
+ /** How wide the node editor opens, in pixels */
37
+ const NODE_EDITOR_WIDTH = 400;
38
+ /** The tallest the graph region may be, following the window's height */
39
+ const useMaxGraphHeight = () => {
40
+ const [windowHeight, setWindowHeight] = useState(() => window.innerHeight);
41
+ useEffect(() => {
42
+ const onResize = () => setWindowHeight(window.innerHeight);
43
+ window.addEventListener('resize', onResize);
44
+ return () => window.removeEventListener('resize', onResize);
45
+ }, []);
46
+ return Math.round(windowHeight * MAX_GRAPH_SHARE_OF_WINDOW);
47
+ };
48
+ /**
49
+ * The graph region's header, above the graph and the results: the cube's
50
+ * name, its actions, its pending and read-only notes, and its dialogs. It
51
+ * stays when the graph is hidden; its buttons wrap when the page is narrow.
52
+ */
53
+ const CubeGraphHeader = observer((props) => {
54
+ const { editorState } = props;
55
+ const { readOnly } = editorState;
56
+ const { showGraph } = editorState.document.meta.presentation;
57
+ return (_jsxs("div", { className: "flex shrink-0 flex-col bg-[var(--color-bg-panel)]", "data-testid": LEGEND_CUBE_TEST_ID.GRAPH_REGION, children: [_jsxs("div", { className: "flex min-h-8 shrink-0 flex-wrap items-center gap-2 border-b border-[var(--color-border-default)] bg-[var(--color-bg-panel-header)] px-2 py-1", children: [_jsx("span", { className: "min-w-24 flex-1 truncate text-lg font-medium", children: editorState.document.name ?? UNSAVED_CUBE_NAME }), editorState.isResolvingSources && (_jsx("span", { className: "shrink-0 text-base text-[var(--color-text-secondary)]", children: CUBE_PENDING_LABEL.RESOLVING_SOURCE })), _jsx(CubeButton, { title: readOnly ? READ_ONLY_CUBE_TITLE : undefined, disabled: readOnly, onClick: () => editorState.sourcePicker.open(), children: "Add table" }), _jsx(CubeButton, { title: readOnly
58
+ ? READ_ONLY_CUBE_TITLE
59
+ : `Undo the last change (${UNDO_SHORTCUT_LABEL})`, disabled: !editorState.canUndo, onClick: () => editorState.undo(), children: "Undo" }), _jsx(CubeButton, { title: editorState.execution.canExecute
60
+ ? 'Show the Pure query that Execute runs'
61
+ : formatDisabledReasons(editorState.execution.disabledReasons), disabled: !editorState.execution.canExecute, onClick: () => {
62
+ flowResult(editorState.showPure.open()).catch(editorState.host.applicationStore.alertUnhandledError);
63
+ }, children: "Show Pure" }), _jsx(CubeButton, { title: readOnly
64
+ ? READ_ONLY_CUBE_TITLE
65
+ : "Show the cube's spec, to copy or download", disabled: readOnly, onClick: () => editorState.specTransfer.openExport(), children: "Export (dev)" }), _jsx(CubeButton, { title: "Open a cube from its spec, in place of this one", onClick: () => editorState.specTransfer.openImport(), children: "Import (dev)" }), _jsx(CubeButton, { title: showGraph
66
+ ? 'Hide the graph, leaving more room for the results'
67
+ : 'Show the graph', onClick: () => editorState.setShowGraph(!showGraph), children: showGraph ? 'Hide graph' : 'Show graph' })] }), _jsx(PanelLoadingIndicator, { isLoading: editorState.isResolvingSources }), readOnly && (_jsxs("div", { className: "shrink-0 border-b border-[var(--color-border-default)] bg-[var(--color-status-warn-bg)] px-2 py-1 text-base text-[var(--color-status-warn)]", role: "status", children: [READ_ONLY_CUBE_TITLE, ". You can view and run it."] })), editorState.nodeEditor.notice && (_jsxs("div", { className: "flex shrink-0 items-center gap-2 border-b border-[var(--color-border-default)] bg-[var(--color-status-warn-bg)] px-2 py-1 text-base text-[var(--color-status-warn)]", role: "status", "data-testid": LEGEND_CUBE_TEST_ID.EDITOR_NOTICE, children: [_jsx("span", { className: "min-w-0 flex-1", children: editorState.nodeEditor.notice }), _jsx(CubeButton, { onClick: () => editorState.nodeEditor.dismissNotice(), children: "Dismiss" })] })), _jsx(CubeSourcePicker, { editorState: editorState }), _jsx(CubeSpecTransferDialog, { editorState: editorState }), _jsx(CubeShowPureDialog, { editorState: editorState })] }));
68
+ });
69
+ /**
70
+ * The Legend Cube page: the query above, its results below, both always
71
+ * shown (PLAN §7.1); hiding the graph leaves its header. The host gives it
72
+ * the engine, the models and the application store; the page's state lives
73
+ * as long as the page.
74
+ */
75
+ export const CubeEditor = observer((props) => {
76
+ const [editorState] = useState(() => new CubeEditorState(props.host, props.initialDocument));
77
+ useEffect(() => () => editorState.dispose(), [editorState]);
78
+ useCommands(editorState);
79
+ const maxGraphHeight = useMaxGraphHeight();
80
+ const isEditorOpen = editorState.nodeEditor.nodeId !== undefined;
81
+ const editorPanel = getCollapsiblePanelGroupProps(!isEditorOpen, {
82
+ size: NODE_EDITOR_WIDTH,
83
+ });
84
+ const { showGraph } = editorState.document.meta.presentation;
85
+ // hiding the graph collapses its panel: the header and the results stay
86
+ // where they are, so the grid keeps its state
87
+ const graphPanel = getCollapsiblePanelGroupProps(!showGraph);
88
+ return (_jsxs("div", { className: "legend-cube flex bg-[var(--color-bg-app)] text-[var(--color-text-primary)]", "data-testid": LEGEND_CUBE_TEST_ID.EDITOR, children: [_jsx(CubePalette, { editorState: editorState }), _jsxs(ResizablePanelGroup, { orientation: "vertical", children: [_jsx(ResizablePanel, { ...editorPanel.remainingPanel, minSize: 320, children: _jsxs("div", { className: "flex h-full min-w-0 flex-1 flex-col", children: [_jsx(CubeGraphHeader, { editorState: editorState }), _jsxs(ResizablePanelGroup, { orientation: "horizontal", children: [_jsx(ResizablePanel, { ...graphPanel.collapsiblePanel, minSize: showGraph ? 96 : 0, maxSize: maxGraphHeight, children: showGraph && _jsx(CubeCanvas, { editorState: editorState }) }), _jsx(ResizablePanelSplitter, { className: showGraph ? '' : 'hidden' }), _jsx(ResizablePanel, { ...graphPanel.remainingPanel, minSize: 96, children: _jsx(CubeGridRegion, { editorState: editorState }) })] })] }) }), _jsx(ResizablePanelSplitter, { className: isEditorOpen ? '' : 'hidden' }), _jsx(ResizablePanel, { ...editorPanel.collapsiblePanel, direction: -1, children: _jsx(CubeNodeEditorPanel, { editorState: editorState }) })] })] }));
89
+ });
90
+ //# sourceMappingURL=CubeEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeEditor.js","sourceRoot":"","sources":["../../src/components/CubeEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,cAAc,EACd,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAA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AM,aAEvC,KAAC,WAAW,IAAC,WAAW,EAAE,WAAW,GAAI,EACzC,MAAC,mBAAmB,IAAC,WAAW,EAAC,UAAU,aACzC,KAAC,cAAc,OAAK,WAAW,CAAC,cAAc,EAAE,OAAO,EAAE,GAAG,YAC1D,eAAK,SAAS,EAAC,qCAAqC,aAClD,KAAC,eAAe,IAAC,WAAW,EAAE,WAAW,GAAI,EAC7C,MAAC,mBAAmB,IAAC,WAAW,EAAC,YAAY,aAC3C,KAAC,cAAc,OACT,UAAU,CAAC,gBAAgB,EAC/B,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAC3B,OAAO,EAAE,cAAc,YAEtB,SAAS,IAAI,KAAC,UAAU,IAAC,WAAW,EAAE,WAAW,GAAI,GACvC,EACjB,KAAC,sBAAsB,IAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAI,EAChE,KAAC,cAAc,OAAK,UAAU,CAAC,cAAc,EAAE,OAAO,EAAE,EAAE,YACxD,KAAC,cAAc,IAAC,WAAW,EAAE,WAAW,GAAI,GAC7B,IACG,IAClB,GACS,EACjB,KAAC,sBAAsB,IAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAI,EACnE,KAAC,cAAc,OAAK,WAAW,CAAC,gBAAgB,EAAE,SAAS,EAAE,CAAC,CAAC,YAC7D,KAAC,mBAAmB,IAAC,WAAW,EAAE,WAAW,GAAI,GAClC,IACG,IAClB,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /** Whether a node definition's icon name maps to an icon, rather than the question mark */
17
+ export declare const hasCubeNodeIcon: (name: string) => boolean;
18
+ /** A node type's icon; an unknown name, or an Unknown node, gets a question mark */
19
+ export declare const CubeNodeIcon: React.FC<{
20
+ icon: string | undefined;
21
+ className?: string;
22
+ }>;
23
+ //# sourceMappingURL=CubeNodeIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeNodeIcon.d.ts","sourceRoot":"","sources":["../../src/components/CubeNodeIcon.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAmBH,2FAA2F;AAC3F,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,KAAG,OACd,CAAC;AAElC,oFAAoF;AACpF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAKA,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * Copyright (c) 2026-present, Goldman Sachs
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { ArrowsJoinIcon, clsx, FilterIcon, QuestionSquareIcon, TableIcon, } from '@finos/legend-art';
18
+ /** The icon of each icon name a node definition gives (`NodeDefinition.icon`) */
19
+ const NODE_ICONS = {
20
+ table: TableIcon,
21
+ filter: FilterIcon,
22
+ join: ArrowsJoinIcon,
23
+ };
24
+ /** Whether a node definition's icon name maps to an icon, rather than the question mark */
25
+ export const hasCubeNodeIcon = (name) => Object.hasOwn(NODE_ICONS, name);
26
+ /** A node type's icon; an unknown name, or an Unknown node, gets a question mark */
27
+ export const CubeNodeIcon = (props) => {
28
+ const { icon, className } = props;
29
+ const Icon = (icon === undefined ? undefined : NODE_ICONS[icon]) ?? QuestionSquareIcon;
30
+ return _jsx(Icon, { className: clsx(className) });
31
+ };
32
+ //# sourceMappingURL=CubeNodeIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeNodeIcon.js","sourceRoot":"","sources":["../../src/components/CubeNodeIcon.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,cAAc,EACd,IAAI,EACJ,UAAU,EACV,kBAAkB,EAClB,SAAS,GACV,MAAM,mBAAmB,CAAC;AAE3B,iFAAiF;AACjF,MAAM,UAAU,GAEZ;IACF,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE,UAAU;IAClB,IAAI,EAAE,cAAc;CACrB,CAAC;AAEF,2FAA2F;AAC3F,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,IAAY,EAAW,EAAE,CACvD,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AAElC,oFAAoF;AACpF,MAAM,CAAC,MAAM,YAAY,GAGpB,CAAC,KAAK,EAAE,EAAE;IACb,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAClC,MAAM,IAAI,GACR,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,kBAAkB,CAAC;IAC5E,OAAO,KAAC,IAAI,IAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,GAAI,CAAC;AAC9C,CAAC,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { Query } from '@finos/legend-cube';
17
+ import { type Connection as FlowConnection, type Edge } from '@xyflow/react';
18
+ import '@xyflow/react/dist/style.css';
19
+ import type { CubeEditorState } from '../../stores/CubeEditorState.js';
20
+ /**
21
+ * Whether dragging from one handle to another may connect the two nodes: out
22
+ * of a node's output, into a free input port that the query lets it feed
23
+ */
24
+ export declare const isCubeCanvasConnectionValid: (query: Query, connection: FlowConnection | Edge) => boolean;
25
+ /**
26
+ * The query as a graph, laid out left to right (spec §17.3). Click a node to
27
+ * edit it, Ctrl or Cmd-click it to run the query up to it, drag from a node's
28
+ * output to another node's input to connect them. A palette item dropped
29
+ * around the nodes is added unconnected. Right-click it, or a node, for the
30
+ * context menu.
31
+ */
32
+ export declare const CubeCanvas: ((props: {
33
+ editorState: CubeEditorState;
34
+ }) => import("react/jsx-runtime").JSX.Element) & {
35
+ displayName: string;
36
+ };
37
+ //# sourceMappingURL=CubeCanvas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeCanvas.d.ts","sourceRoot":"","sources":["../../../src/components/canvas/CubeCanvas.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAEL,KAAK,UAAU,IAAI,cAAc,EAEjC,KAAK,IAAI,EAOV,MAAM,eAAe,CAAC;AAGvB,OAAO,8BAA8B,CAAC;AAKtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AA6BvE;;;GAGG;AACH,eAAO,MAAM,2BAA2B,GACtC,OAAO,KAAK,EACZ,YAAY,cAAc,GAAG,IAAI,KAChC,OAOA,CAAC;AAmHJ;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,WACb;IAAE,WAAW,EAAE,eAAe,CAAA;CAAE;;CAuDzC,CAAC"}
@@ -0,0 +1,135 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Copyright (c) 2026-present, Goldman Sachs
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { ContextMenu } from '@finos/legend-art';
18
+ import { noop } from '@finos/legend-shared';
19
+ import { Background, Controls, MiniMap, ReactFlow, ReactFlowProvider, useNodesInitialized, useReactFlow, useStore, } from '@xyflow/react';
20
+ // imported here, not in the builder's stylesheet, so it loads with the Cube
21
+ // page's chunk: Query's reactflow 11 lineage viewer uses the same class names
22
+ import '@xyflow/react/dist/style.css';
23
+ import { observer } from 'mobx-react-lite';
24
+ import { useEffect, useMemo, useRef } from 'react';
25
+ import { useDrop } from 'react-dnd';
26
+ import { LEGEND_CUBE_TEST_ID } from '../../__lib__/LegendCubeTesting.js';
27
+ import { buildCubeCanvasEdges, buildCubeCanvasNodes, CUBE_CANVAS_EDGE_TYPE, CUBE_CANVAS_NODE_TYPE, CUBE_OUTPUT_HANDLE_ID, } from './CubeCanvasElements.js';
28
+ import { CubeCanvasContext } from './CubeCanvasContext.js';
29
+ import { CubeCanvasContextMenu } from './CubeCanvasContextMenu.js';
30
+ import { CUBE_DND_TYPE, dropOnCubeCanvas, } from './CubeCanvasDnd.js';
31
+ import { CubeCanvasEdge } from './CubeCanvasEdge.js';
32
+ import { layoutCubeQuery } from './CubeCanvasLayout.js';
33
+ import { CubeCanvasNode } from './CubeCanvasNode.js';
34
+ // React Flow re-renders every node when these change identity
35
+ const NODE_TYPES = { [CUBE_CANVAS_NODE_TYPE]: CubeCanvasNode };
36
+ const EDGE_TYPES = { [CUBE_CANVAS_EDGE_TYPE]: CubeCanvasEdge };
37
+ const PRO_OPTIONS = { hideAttribution: true };
38
+ /** Small, so it covers little of a short canvas */
39
+ const MINI_MAP_STYLE = { width: 120, height: 80 };
40
+ const FIT_VIEW_OPTIONS = { padding: 0.2, maxZoom: 1 };
41
+ /**
42
+ * Whether dragging from one handle to another may connect the two nodes: out
43
+ * of a node's output, into a free input port that the query lets it feed
44
+ */
45
+ export const isCubeCanvasConnectionValid = (query, connection) => connection.sourceHandle === CUBE_OUTPUT_HANDLE_ID &&
46
+ typeof connection.targetHandle === 'string' &&
47
+ query.canConnect(connection.source, connection.target, connection.targetHandle);
48
+ const CubeCanvasFlow = observer((props) => {
49
+ const { editorState } = props;
50
+ const { query } = editorState.document;
51
+ const { readOnly } = editorState;
52
+ const { fitView } = useReactFlow();
53
+ const positions = useMemo(() => layoutCubeQuery(query), [query]);
54
+ const nodes = useMemo(() => buildCubeCanvasNodes(query, positions), [query, positions]);
55
+ const edges = useMemo(() => buildCubeCanvasEdges(query), [query]);
56
+ // the view fits the graph again whenever the layout moves a node, or the
57
+ // canvas gets wider or narrower (e.g. the node editor opens beside it),
58
+ // once React Flow has measured every node: it fits only measured ones
59
+ const layoutSignature = useMemo(() => JSON.stringify([...positions]), [positions]);
60
+ const nodesInitialized = useNodesInitialized();
61
+ const canvasWidth = useStore((state) => state.width);
62
+ useEffect(() => {
63
+ if (!nodesInitialized) {
64
+ return undefined;
65
+ }
66
+ const timer = window.setTimeout(() => {
67
+ fitView(FIT_VIEW_OPTIONS).catch(noop());
68
+ }, 0);
69
+ return () => window.clearTimeout(timer);
70
+ }, [layoutSignature, canvasWidth, nodesInitialized, fitView]);
71
+ return (_jsxs(ReactFlow, { nodes: nodes, edges: edges, nodeTypes: NODE_TYPES, edgeTypes: EDGE_TYPES,
72
+ // the layout places the nodes; nothing is selected or deleted in React Flow
73
+ nodesDraggable: false, nodesConnectable: !readOnly, elementsSelectable: false, deleteKeyCode: null, selectionKeyCode: null, multiSelectionKeyCode: null, onNodeClick: (event, flowNode) => {
74
+ // a click on a handle starts or ends a connection, not a node click
75
+ if (event.target instanceof Element &&
76
+ event.target.closest('.react-flow__handle')) {
77
+ return;
78
+ }
79
+ if (event.ctrlKey || event.metaKey) {
80
+ editorState.select(flowNode.id);
81
+ }
82
+ else {
83
+ editorState.nodeEditor.open(flowNode.id);
84
+ }
85
+ },
86
+ // React Flow's own keyboard help speaks of selecting, moving and
87
+ // deleting nodes, which Cube doesn't do; Enter and Space open a node's
88
+ // editor instead, and Ctrl or Cmd with them select it
89
+ disableKeyboardA11y: true, edgesFocusable: false, onKeyDown: (event) => {
90
+ const target = event.target;
91
+ const nodeId = target instanceof HTMLElement &&
92
+ target.classList.contains('react-flow__node')
93
+ ? target.dataset.id
94
+ : undefined;
95
+ if (nodeId === undefined ||
96
+ (event.key !== 'Enter' && event.key !== ' ')) {
97
+ return;
98
+ }
99
+ event.preventDefault();
100
+ if (event.ctrlKey || event.metaKey) {
101
+ editorState.select(nodeId);
102
+ }
103
+ else {
104
+ editorState.nodeEditor.open(nodeId);
105
+ }
106
+ }, isValidConnection: (connection) => !readOnly && isCubeCanvasConnectionValid(query, connection), onConnect: (connection) => {
107
+ if (connection.targetHandle) {
108
+ editorState.connect(connection.source, connection.target, connection.targetHandle);
109
+ }
110
+ }, colorMode: editorState.host.applicationStore.layoutService
111
+ .TEMPORARY__isLightColorThemeEnabled
112
+ ? 'light'
113
+ : 'dark', proOptions: PRO_OPTIONS, fitView: true, fitViewOptions: FIT_VIEW_OPTIONS, minZoom: 0.2, maxZoom: 1.5, children: [_jsx(Background, {}), _jsx(Controls, { showInteractive: false }), _jsx(MiniMap, { pannable: true, zoomable: true, style: MINI_MAP_STYLE })] }));
114
+ });
115
+ /**
116
+ * The query as a graph, laid out left to right (spec §17.3). Click a node to
117
+ * edit it, Ctrl or Cmd-click it to run the query up to it, drag from a node's
118
+ * output to another node's input to connect them. A palette item dropped
119
+ * around the nodes is added unconnected. Right-click it, or a node, for the
120
+ * context menu.
121
+ */
122
+ export const CubeCanvas = observer((props) => {
123
+ const { editorState } = props;
124
+ const ref = useRef(null);
125
+ const [, dropConnector] = useDrop(() => ({
126
+ accept: [CUBE_DND_TYPE.PALETTE_ITEM],
127
+ canDrop: () => !editorState.readOnly,
128
+ // a node under the pointer, whether it took the drop or refused it,
129
+ // keeps it from the canvas
130
+ drop: (item, monitor) => dropOnCubeCanvas(editorState, item, monitor.didDrop() || !monitor.isOver({ shallow: true })),
131
+ }), [editorState]);
132
+ dropConnector(ref);
133
+ return (_jsx("div", { ref: ref, className: "relative h-full w-full", "data-testid": LEGEND_CUBE_TEST_ID.CANVAS, children: _jsx(ContextMenu, { className: "h-full w-full", content: _jsx(CubeCanvasContextMenu, { editorState: editorState }), menuProps: { elevation: 7 }, children: editorState.document.query.isEmpty ? (_jsx("div", { className: "flex h-full items-center justify-center p-4 text-base text-[var(--color-text-secondary)]", children: _jsxs("span", { children: ["No tables yet:", ' ', _jsx("button", { className: "text-[var(--color-accent)] underline disabled:text-[var(--color-text-disabled)] disabled:no-underline", disabled: editorState.readOnly, onClick: () => editorState.sourcePicker.open(), children: "add a table" }), ' ', "to start."] }) })) : (_jsx(CubeCanvasContext.Provider, { value: editorState, children: _jsx(ReactFlowProvider, { children: _jsx(CubeCanvasFlow, { editorState: editorState }) }) })) }) }));
134
+ });
135
+ //# sourceMappingURL=CubeCanvas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeCanvas.js","sourceRoot":"","sources":["../../../src/components/canvas/CubeCanvas.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EACL,UAAU,EAEV,QAAQ,EAER,OAAO,EACP,SAAS,EACT,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,4EAA4E;AAC5E,8EAA8E;AAC9E,OAAO,8BAA8B,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,GAGtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACL,aAAa,EAEb,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,8DAA8D;AAC9D,MAAM,UAAU,GAAG,EAAE,CAAC,qBAAqB,CAAC,EAAE,cAAc,EAAE,CAAC;AAC/D,MAAM,UAAU,GAAG,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xD;KACJ,CAAC,EACF,CAAC,WAAW,CAAC,CACd,CAAC;IACF,aAAa,CAAC,GAAG,CAAC,CAAC;IACnB,OAAO,CACL,cACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAC,wBAAwB,iBACrB,mBAAmB,CAAC,MAAM,YAEvC,KAAC,WAAW,IACV,SAAS,EAAC,eAAe,EACzB,OAAO,EAAE,KAAC,qBAAqB,IAAC,WAAW,EAAE,WAAW,GAAI,EAC5D,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,YAE1B,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CACpC,cAAK,SAAS,EAAC,0FAA0F,YACvG,6CACiB,GAAG,EAClB,iBACE,SAAS,EAAC,uGAAuG,EACjH,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAC9B,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,YAAY,CAAC,IAAI,EAAE,4BAGvC,EAAC,GAAG,iBAER,GACH,CACP,CAAC,CAAC,CAAC,CACF,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,WAAW,YAC5C,KAAC,iBAAiB,cAChB,KAAC,cAAc,IAAC,WAAW,EAAE,WAAW,GAAI,GAC1B,GACO,CAC9B,GACW,GACV,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { CubeEditorState } from '../../stores/CubeEditorState.js';
17
+ export declare const CubeCanvasContext: import("react").Context<CubeEditorState | undefined>;
18
+ export declare const useCubeCanvasEditorState: () => CubeEditorState;
19
+ //# sourceMappingURL=CubeCanvasContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeCanvasContext.d.ts","sourceRoot":"","sources":["../../../src/components/canvas/CubeCanvasContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAIvE,eAAO,MAAM,iBAAiB,sDAE7B,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAO,eAIzC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { guaranteeNonNullable } from '@finos/legend-shared';
17
+ import { createContext, useContext } from 'react';
18
+ // React Flow renders the canvas's nodes itself, so they reach the page's
19
+ // state through a context rather than props
20
+ export const CubeCanvasContext = createContext(undefined);
21
+ export const useCubeCanvasEditorState = () => guaranteeNonNullable(useContext(CubeCanvasContext), `A canvas node must be rendered inside the Cube canvas`);
22
+ //# sourceMappingURL=CubeCanvasContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeCanvasContext.js","sourceRoot":"","sources":["../../../src/components/canvas/CubeCanvasContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGlD,yEAAyE;AACzE,4CAA4C;AAC5C,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAC5C,SAAS,CACV,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAoB,EAAE,CAC5D,oBAAoB,CAClB,UAAU,CAAC,iBAAiB,CAAC,EAC7B,uDAAuD,CACxD,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { CubeEditorState } from '../../stores/CubeEditorState.js';
17
+ /**
18
+ * The canvas's context menu (spec §17.4): the palette, then what can be done
19
+ * to the node it was opened on. On a node, a palette item is added after it;
20
+ * around the nodes, on its own. Every item shows, disabled when it can't be
21
+ * done, so Swap Inputs can be found. The node comes through props: a menu
22
+ * opened around the nodes has none.
23
+ */
24
+ export declare const CubeCanvasContextMenu: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Omit<{
25
+ editorState: CubeEditorState;
26
+ nodeId?: string | undefined;
27
+ } & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>>;
28
+ //# sourceMappingURL=CubeCanvasContextMenu.d.ts.map