@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,196 @@
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 { isSchemasError } from '@finos/legend-cube';
17
+ import { assertErrorThrown } from '@finos/legend-shared';
18
+ import { action, computed, flow, makeObservable, observable } from 'mobx';
19
+ import { CubeEngineError, CubeEngineErrorKind, } from '../graph-manager/CubeEngine.js';
20
+ /**
21
+ * The first error found walking up from the capture node, named by its node.
22
+ * A node that is invalid only because an input is gets passed over for that
23
+ * input's own error.
24
+ */
25
+ const findUpstreamError = (query, validity, captureId) => {
26
+ const visit = (nodeId) => {
27
+ const node = query.getNode(nodeId);
28
+ if (!node) {
29
+ return undefined;
30
+ }
31
+ for (const inputId of query.getInputIds(nodeId)) {
32
+ const error = inputId === undefined ? undefined : visit(inputId);
33
+ if (error) {
34
+ return error;
35
+ }
36
+ }
37
+ const error = (validity.get(nodeId) ?? []).find((message) => !isSchemasError(message));
38
+ return error === undefined ? undefined : `${node.describe()}: ${error}`;
39
+ };
40
+ return (visit(captureId) ?? 'The node to run, or one of its inputs, has errors.');
41
+ };
42
+ /**
43
+ * Runs the query up to its capture node (PLAN §8.2, §9). Execution is
44
+ * explicit; while a run is in flight Execute becomes Stop, and only the latest
45
+ * run's answer is applied (Settled before M1.8).
46
+ */
47
+ export class CubeExecutionState {
48
+ editorState;
49
+ result;
50
+ error;
51
+ /** The abort controller of the run in flight, if any */
52
+ runController;
53
+ runCount = 0;
54
+ constructor(editorState) {
55
+ makeObservable(this, {
56
+ result: observable.ref,
57
+ error: observable.ref,
58
+ runController: observable.ref,
59
+ isRunning: computed,
60
+ isStale: computed,
61
+ disabledReasons: computed,
62
+ canExecute: computed,
63
+ execute: flow,
64
+ clearError: action,
65
+ stop: action,
66
+ reset: action,
67
+ });
68
+ this.editorState = editorState;
69
+ }
70
+ get isRunning() {
71
+ return this.runController !== undefined;
72
+ }
73
+ /** The shown result no longer matches the query or the row limit; it is kept until the next run */
74
+ get isStale() {
75
+ return (this.result !== undefined &&
76
+ !this.isRunning &&
77
+ (this.result.query !== this.editorState.document.query ||
78
+ this.result.rowLimit !== this.editorState.rowLimit));
79
+ }
80
+ /**
81
+ * Why Execute is unavailable, if it is: it needs a source, a model and a
82
+ * runtime, and a valid capture node whose inputs are all valid. Invalid
83
+ * nodes elsewhere don't matter (PLAN §10.3).
84
+ */
85
+ get disabledReasons() {
86
+ const { document, emitter, analysis } = this.editorState;
87
+ const { query, context } = document;
88
+ if (!query.nodes.length) {
89
+ return ['Add a table first.'];
90
+ }
91
+ const reasons = [];
92
+ if (!context) {
93
+ reasons.push('The cube has no model.');
94
+ }
95
+ else if (!context.runtime) {
96
+ reasons.push('The cube has no runtime.');
97
+ }
98
+ const captureId = query.selected;
99
+ if (captureId === undefined) {
100
+ reasons.push('Select the node to run.');
101
+ }
102
+ else if (!emitter.canEmit(captureId)) {
103
+ reasons.push(findUpstreamError(query, analysis.validity, captureId));
104
+ }
105
+ return reasons;
106
+ }
107
+ get canExecute() {
108
+ return !this.disabledReasons.length;
109
+ }
110
+ *execute() {
111
+ if (this.isRunning || !this.canExecute) {
112
+ return;
113
+ }
114
+ const { document, emitter, analysis, rowLimit, host } = this.editorState;
115
+ const { query, context } = document;
116
+ // checked by canExecute
117
+ const captureId = query.selected;
118
+ const model = context?.model;
119
+ const runtime = context?.runtime;
120
+ const schema = analysis.schemas.get(captureId);
121
+ if (!model || !runtime || !schema) {
122
+ return;
123
+ }
124
+ const lambda = emitter.emitExecutionLambda({ rowLimit, runtime });
125
+ const controller = new AbortController();
126
+ this.runController = controller;
127
+ this.error = undefined;
128
+ this.editorState.clearHostIssues();
129
+ try {
130
+ const response = (yield host.engine.execute(model, lambda, {
131
+ abortController: controller,
132
+ }));
133
+ if (this.runController !== controller) {
134
+ return;
135
+ }
136
+ // rows are read by position, so the engine's columns must be the query's
137
+ if (response.columns.length !== schema.columns.length) {
138
+ throw new CubeEngineError(CubeEngineErrorKind.EXECUTION, `The engine returned ${response.columns.length} columns, but the query has ${schema.columns.length}`, captureId);
139
+ }
140
+ const misplaced = schema.columns.findIndex((column, position) => response.columns[position] !== column.name);
141
+ if (misplaced !== -1) {
142
+ throw new CubeEngineError(CubeEngineErrorKind.EXECUTION, `The engine returned the column "${response.columns[misplaced]}" at position ${misplaced + 1}, but the query has "${schema.columns[misplaced]?.name}" there`, captureId);
143
+ }
144
+ const limited = response.rows.length > rowLimit;
145
+ this.result = {
146
+ id: ++this.runCount,
147
+ query,
148
+ schema,
149
+ rows: limited ? response.rows.slice(0, rowLimit) : response.rows,
150
+ rowLimit,
151
+ limited,
152
+ sql: response.sql,
153
+ durationMs: response.durationMs,
154
+ };
155
+ }
156
+ catch (error) {
157
+ // a stopped or replaced run shows nothing
158
+ if (this.runController !== controller || controller.signal.aborted) {
159
+ return;
160
+ }
161
+ assertErrorThrown(error);
162
+ const engineError = error instanceof CubeEngineError
163
+ ? error
164
+ : new CubeEngineError(CubeEngineErrorKind.EXECUTION, error.message, captureId);
165
+ // the rows of an earlier run are never shown as this run's
166
+ this.result = undefined;
167
+ // an error belongs to the query it came from: one that changed while
168
+ // the run was in flight drops it, as an edit after the run would
169
+ if (this.editorState.document.query === query) {
170
+ this.error = engineError;
171
+ this.editorState.setHostIssue(engineError.nodeId ?? captureId, engineError);
172
+ }
173
+ }
174
+ finally {
175
+ if (this.runController === controller) {
176
+ this.runController = undefined;
177
+ }
178
+ }
179
+ }
180
+ /** Drops the last run's error: it described a query the cube no longer has */
181
+ clearError() {
182
+ this.error = undefined;
183
+ }
184
+ /** Cancels the run in flight; it shows no result and no error */
185
+ stop() {
186
+ this.runController?.abort();
187
+ this.runController = undefined;
188
+ }
189
+ /** Stops any run and forgets the last one's rows and error, e.g. when another cube is opened */
190
+ reset() {
191
+ this.stop();
192
+ this.result = undefined;
193
+ this.error = undefined;
194
+ }
195
+ }
196
+ //# sourceMappingURL=CubeExecutionState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeExecutionState.js","sourceRoot":"","sources":["../../src/stores/CubeExecutionState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAA2B,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAoB,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC1E,OAAO,EACL,eAAe,EACf,mBAAmB,GAGpB,MAAM,gCAAgC,CAAC;AAoBxC;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,CACxB,KAAY,EACZ,QAAgD,EAChD,SAAiB,EACT,EAAE;IACV,MAAM,KAAK,GAAG,CAAC,MAAc,EAAsB,EAAE;QACnD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACnC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,KAAK,MAAM,OAAO,IAAI,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;YAChD,MAAM,KAAK,GAAG,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACjE,IAAI,KAAK,EAAE,CA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AAC;YACzB,MAAM,WAAW,GACf,KAAK,YAAY,eAAe;gBAC9B,CAAC,CAAC,KAAK;gBACP,CAAC,CAAC,IAAI,eAAe,CACjB,mBAAmB,CAAC,SAAS,EAC7B,KAAK,CAAC,OAAO,EACb,SAAS,CACV,CAAC;YACR,2DAA2D;YAC3D,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;YACxB,qEAAqE;YACrE,iEAAiE;YACjE,IAAI,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;gBAC9C,IAAI,CAAC,KAAK,GAAG,WAAW,CAAC;gBACzB,IAAI,CAAC,WAAW,CAAC,YAAY,CAC3B,WAAW,CAAC,MAAM,IAAI,SAAS,EAC/B,WAAW,CACZ,CAAC;YACJ,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,IAAI,IAAI,CAAC,aAAa,KAAK,UAAU,EAAE,CAAC;gBACtC,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;YACjC,CAAC;QACH,CAAC;IACH,CAAC;IAED,8EAA8E;IAC9E,UAAU;QACR,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACzB,CAAC;IAED,iEAAiE;IACjE,IAAI;QACF,IAAI,CAAC,aAAa,EAAE,KAAK,EAAE,CAAC;QAC5B,IAAI,CAAC,aAAa,GAAG,SAAS,CAAC;IACjC,CAAC;IAED,gGAAgG;IAChG,KAAK;QACH,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACzB,CAAC;CACF"}
@@ -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 { GenericLegendApplicationStore } from '@finos/legend-application';
17
+ import type { CubeEngine } from '../graph-manager/CubeEngine.js';
18
+ import type { LocalModelCatalog } from './LocalModelCatalog.js';
19
+ /**
20
+ * What the application hosting the Cube page gives it (PLAN §3.5, Settled
21
+ * before M1.8). The host chooses the engine and the models; Cube keeps no
22
+ * auth, config or telemetry of its own and uses the host's application store
23
+ * for commands, user data, the clipboard, the theme, notifications, alerts and
24
+ * telemetry.
25
+ */
26
+ export interface CubeHost {
27
+ readonly applicationStore: GenericLegendApplicationStore;
28
+ readonly engine: CubeEngine;
29
+ readonly modelCatalog: LocalModelCatalog;
30
+ }
31
+ //# sourceMappingURL=CubeHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeHost.d.ts","sourceRoot":"","sources":["../../src/stores/CubeHost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,gBAAgB,EAAE,6BAA6B,CAAC;IACzD,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,iBAAiB,CAAC;CAC1C"}
@@ -0,0 +1,17 @@
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
+ export {};
17
+ //# sourceMappingURL=CubeHost.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeHost.js","sourceRoot":"","sources":["../../src/stores/CubeHost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
@@ -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 type { NodeRegistry, QueryNode } from '@finos/legend-cube';
17
+ import { CUBE_EDITOR_CLOSED_REASON } from '../__lib__/LegendCubeLabels.js';
18
+ import type { CubeEditorState } from './CubeEditorState.js';
19
+ import type { CubeNodeDraft } from './editors/CubeNodeDraft.js';
20
+ /**
21
+ * Whether two nodes of the same id save the same: their own fields, as the
22
+ * spec stores them, and the keys this version doesn't know. A node of a type
23
+ * the registry doesn't know is the same only as itself.
24
+ */
25
+ export declare const isSameNodeContent: (registry: NodeRegistry, a: QueryNode, b: QueryNode) => boolean;
26
+ /**
27
+ * The node editor in the side panel (PLAN §7.4, spec §17.5). Opening it
28
+ * never changes which node Execute runs. Edits go to a draft, and only Apply,
29
+ * or closing the panel, stores them, as one undo step; Cancel drops them.
30
+ *
31
+ * The panel follows the cube (user's choice, 2026-10-07): when the node it
32
+ * shows is replaced or removed underneath it, by Undo, a re-check or a
33
+ * Remove, a panel with edits closes without applying them and says so; one
34
+ * without edits shows the new node, or closes when the node is gone.
35
+ */
36
+ export declare class CubeNodeEditorState {
37
+ readonly editorState: CubeEditorState;
38
+ /** The id of the node the panel shows, while it is open */
39
+ nodeId: string | undefined;
40
+ /** The key of the node the draft was made from */
41
+ private nodeKey;
42
+ draft: CubeNodeDraft | undefined;
43
+ /** Why the panel closed by itself, until it opens again or is dismissed */
44
+ notice: string | undefined;
45
+ private readonly disposeSync;
46
+ constructor(editorState: CubeEditorState);
47
+ /** The node the panel shows, as the cube has it now */
48
+ get node(): QueryNode | undefined;
49
+ /** The node Apply would store, built once per edit */
50
+ get edited(): QueryNode | undefined;
51
+ /** The draft saves differently from the node it was made from */
52
+ get hasChanges(): boolean;
53
+ /** Opens the panel on a node, closing (and so applying) the one it showed */
54
+ open(nodeId: string): void;
55
+ /**
56
+ * Stores the draft in place of the node, as one undo step, and goes on
57
+ * editing the stored node. Does nothing without changes, or while the cube
58
+ * is read-only.
59
+ */
60
+ apply(): void;
61
+ get canSwapInputs(): boolean;
62
+ /**
63
+ * Swaps the node's two inputs (a Join's Swap Inputs, spec §17.6), applying
64
+ * the draft first, as one undo step, then goes on editing the swapped
65
+ * node, whose settings followed its inputs
66
+ */
67
+ swapInputs(): void;
68
+ /** Applies the draft, then closes the panel (spec §17.5: edits commit on close) */
69
+ close(): void;
70
+ /** Closes the panel, dropping the draft */
71
+ cancel(): void;
72
+ /**
73
+ * Closes the panel without applying the draft, e.g. when another cube is
74
+ * opened, saying so when that drops edits
75
+ */
76
+ discard(reason: CUBE_EDITOR_CLOSED_REASON): void;
77
+ dismissNotice(): void;
78
+ /** Stops following the cube; call when the page closes */
79
+ dispose(): void;
80
+ private bind;
81
+ private reset;
82
+ /** Runs whenever the node with the panel's id is another object, or gone */
83
+ private sync;
84
+ }
85
+ //# sourceMappingURL=CubeNodeEditorState.d.ts.map
@@ -0,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AAI;IAKb,2CAA2C;IAC3C,MAAM,IAAI,IAAI;IAId;;;OAGG;IACH,OAAO,CAAC,MAAM,EAAE,yBAAyB,GAAG,IAAI;IAQhD,aAAa,IAAI,IAAI;IAIrB,0DAA0D;IAC1D,OAAO,IAAI,IAAI;IAIf,OAAO,CAAC,IAAI;IAMZ,OAAO,CAAC,KAAK;IAMb,4EAA4E;IAC5E,OAAO,CAAC,IAAI;CAiBb"}
@@ -0,0 +1,207 @@
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 { action, computed, makeObservable, observable, reaction, } from 'mobx';
17
+ import { CUBE_EDITOR_CLOSED_REASON, getEditorClosedNotice, } from '../__lib__/LegendCubeLabels.js';
18
+ import { createCubeNodeDraft } from './editors/CubeNodeDraftRegistry.js';
19
+ /**
20
+ * Whether two nodes of the same id save the same: their own fields, as the
21
+ * spec stores them, and the keys this version doesn't know. A node of a type
22
+ * the registry doesn't know is the same only as itself.
23
+ */
24
+ export const isSameNodeContent = (registry, a, b) => {
25
+ if (a === b) {
26
+ return true;
27
+ }
28
+ const definition = registry.get(a.type);
29
+ return (definition !== undefined &&
30
+ a.type === b.type &&
31
+ JSON.stringify([definition.spec.encode(a), a.rest]) ===
32
+ JSON.stringify([definition.spec.encode(b), b.rest]));
33
+ };
34
+ /**
35
+ * The node editor in the side panel (PLAN §7.4, spec §17.5). Opening it
36
+ * never changes which node Execute runs. Edits go to a draft, and only Apply,
37
+ * or closing the panel, stores them, as one undo step; Cancel drops them.
38
+ *
39
+ * The panel follows the cube (user's choice, 2026-10-07): when the node it
40
+ * shows is replaced or removed underneath it, by Undo, a re-check or a
41
+ * Remove, a panel with edits closes without applying them and says so; one
42
+ * without edits shows the new node, or closes when the node is gone.
43
+ */
44
+ export class CubeNodeEditorState {
45
+ editorState;
46
+ /** The id of the node the panel shows, while it is open */
47
+ nodeId;
48
+ /** The key of the node the draft was made from */
49
+ nodeKey;
50
+ draft;
51
+ /** Why the panel closed by itself, until it opens again or is dismissed */
52
+ notice;
53
+ disposeSync;
54
+ constructor(editorState) {
55
+ makeObservable(this, {
56
+ nodeId: observable,
57
+ nodeKey: observable,
58
+ draft: observable.ref,
59
+ notice: observable,
60
+ node: computed,
61
+ edited: computed,
62
+ hasChanges: computed,
63
+ open: action,
64
+ canSwapInputs: computed,
65
+ apply: action,
66
+ swapInputs: action,
67
+ close: action,
68
+ cancel: action,
69
+ discard: action,
70
+ dismissNotice: action,
71
+ sync: action,
72
+ });
73
+ this.editorState = editorState;
74
+ this.disposeSync = reaction(() => this.node, () => this.sync());
75
+ }
76
+ /** The node the panel shows, as the cube has it now */
77
+ get node() {
78
+ return this.nodeId === undefined
79
+ ? undefined
80
+ : this.editorState.document.query.getNode(this.nodeId);
81
+ }
82
+ /** The node Apply would store, built once per edit */
83
+ get edited() {
84
+ return this.draft?.build();
85
+ }
86
+ /** The draft saves differently from the node it was made from */
87
+ get hasChanges() {
88
+ const { draft, edited } = this;
89
+ return (draft !== undefined &&
90
+ edited !== undefined &&
91
+ !isSameNodeContent(this.editorState.registry, edited, draft.original));
92
+ }
93
+ /** Opens the panel on a node, closing (and so applying) the one it showed */
94
+ open(nodeId) {
95
+ if (nodeId === this.nodeId) {
96
+ this.notice = undefined;
97
+ return;
98
+ }
99
+ const node = this.editorState.document.query.getNode(nodeId);
100
+ if (!node) {
101
+ return;
102
+ }
103
+ this.close();
104
+ this.notice = undefined;
105
+ this.bind(node);
106
+ }
107
+ /**
108
+ * Stores the draft in place of the node, as one undo step, and goes on
109
+ * editing the stored node. Does nothing without changes, or while the cube
110
+ * is read-only.
111
+ */
112
+ apply() {
113
+ const { node, edited } = this;
114
+ if (!node ||
115
+ !edited ||
116
+ node.key !== this.nodeKey ||
117
+ !this.hasChanges ||
118
+ this.editorState.readOnly) {
119
+ return;
120
+ }
121
+ const { query } = this.editorState.document;
122
+ if (query.canReplace(edited)) {
123
+ this.editorState.applyQuery(query.replace(edited));
124
+ this.bind(edited);
125
+ }
126
+ }
127
+ get canSwapInputs() {
128
+ const { node } = this;
129
+ return (node !== undefined &&
130
+ !this.editorState.readOnly &&
131
+ this.editorState.document.query.canSwapInputs(node.id));
132
+ }
133
+ /**
134
+ * Swaps the node's two inputs (a Join's Swap Inputs, spec §17.6), applying
135
+ * the draft first, as one undo step, then goes on editing the swapped
136
+ * node, whose settings followed its inputs
137
+ */
138
+ swapInputs() {
139
+ const { node, edited } = this;
140
+ if (!node || !edited || node.key !== this.nodeKey || !this.canSwapInputs) {
141
+ return;
142
+ }
143
+ let { query } = this.editorState.document;
144
+ if (this.hasChanges && query.canReplace(edited)) {
145
+ query = query.replace(edited);
146
+ }
147
+ query = query.swapInputs(node.id);
148
+ this.editorState.applyQuery(query);
149
+ this.bind(query.getNode(node.id) ?? node);
150
+ }
151
+ /** Applies the draft, then closes the panel (spec §17.5: edits commit on close) */
152
+ close() {
153
+ this.apply();
154
+ this.reset();
155
+ }
156
+ /** Closes the panel, dropping the draft */
157
+ cancel() {
158
+ this.reset();
159
+ }
160
+ /**
161
+ * Closes the panel without applying the draft, e.g. when another cube is
162
+ * opened, saying so when that drops edits
163
+ */
164
+ discard(reason) {
165
+ const { nodeId } = this;
166
+ if (nodeId !== undefined && this.hasChanges) {
167
+ this.notice = getEditorClosedNotice(nodeId, reason);
168
+ }
169
+ this.reset();
170
+ }
171
+ dismissNotice() {
172
+ this.notice = undefined;
173
+ }
174
+ /** Stops following the cube; call when the page closes */
175
+ dispose() {
176
+ this.disposeSync();
177
+ }
178
+ bind(node) {
179
+ this.nodeId = node.id;
180
+ this.nodeKey = node.key;
181
+ this.draft = createCubeNodeDraft(node, this.editorState);
182
+ }
183
+ reset() {
184
+ this.nodeId = undefined;
185
+ this.nodeKey = undefined;
186
+ this.draft = undefined;
187
+ }
188
+ /** Runs whenever the node with the panel's id is another object, or gone */
189
+ sync() {
190
+ const { node } = this;
191
+ if (this.nodeId === undefined || node?.key === this.nodeKey) {
192
+ return;
193
+ }
194
+ if (this.hasChanges) {
195
+ this.discard(node
196
+ ? CUBE_EDITOR_CLOSED_REASON.NODE_CHANGED
197
+ : CUBE_EDITOR_CLOSED_REASON.NODE_REMOVED);
198
+ }
199
+ else if (node) {
200
+ this.bind(node);
201
+ }
202
+ else {
203
+ this.reset();
204
+ }
205
+ }
206
+ }
207
+ //# sourceMappingURL=CubeNodeEditorState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeNodeEditorState.js","sourceRoot":"","sources":["../../src/stores/CubeNodeEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,MAAM,EACN,QAAQ,EAER,cAAc,EACd,UAAU,EACV,QAAQ,GACT,MAAM,MAAM,CAAC;AACd,OAAO,EACL,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,QAAsB,EACtB,CAAY,EACZ,CAAY,EACH,EAAE;IACX,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACxC,OAAO,CACL,UAAU,KAAK,SAAS;QACxB,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI;QACjB,IAAI,CAAC,SAAS,CAAC,CAAC,UA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AI,CAAC,OAAO,CACV,IAAI;gBACF,CAAC,CAAC,yBAAyB,CAAC,YAAY;gBACxC,CAAC,CAAC,yBAAyB,CAAC,YAAY,CAC3C,CAAC;QACJ,CAAC;aAAM,IAAI,IAAI,EAAE,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,38 @@
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 { GeneratorFn } from '@finos/legend-shared';
17
+ import { CubeEngineError } from '../graph-manager/CubeEngine.js';
18
+ import type { CubeEditorState } from './CubeEditorState.js';
19
+ /**
20
+ * Show Pure: the Pure text of what Execute would run, the capture node's
21
+ * execution lambda with the row limit, as the engine renders it. For display
22
+ * only: the text is never parsed back (PLAN §8.7).
23
+ */
24
+ export declare class CubeShowPureState {
25
+ readonly editorState: CubeEditorState;
26
+ isOpen: boolean;
27
+ text: string | undefined;
28
+ /** Why the engine couldn't render the query; shown in the dialog */
29
+ error: CubeEngineError | undefined;
30
+ isRendering: boolean;
31
+ /** Counts renders, so one that finishes after the dialog closed is dropped */
32
+ private request;
33
+ constructor(editorState: CubeEditorState);
34
+ /** Opens the dialog and renders the query; does nothing when Execute can't run */
35
+ open(): GeneratorFn<void>;
36
+ close(): void;
37
+ }
38
+ //# sourceMappingURL=CubeShowPureState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeShowPureState.d.ts","sourceRoot":"","sources":["../../src/stores/CubeShowPureState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EACL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;GAIG;AACH,qBAAa,iBAAiB;IAC5B,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC;IAEtC,MAAM,UAAS;IACf,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,oEAAoE;IACpE,KAAK,EAAE,eAAe,GAAG,SAAS,CAAC;IACnC,WAAW,UAAS;IACpB,8EAA8E;IAC9E,OAAO,CAAC,OAAO,CAAK;gBAER,WAAW,EAAE,eAAe;IAYxC,kFAAkF;IACjF,IAAI,IAAI,WAAW,CAAC,IAAI,CAAC;IAmC1B,KAAK,IAAI,IAAI;CAOd"}