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

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 (379) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +64 -2
  3. package/docs/adding-an-operation.md +92 -0
  4. package/docs/hosting.md +79 -0
  5. package/docs/testing.md +83 -0
  6. package/lib/__lib__/LegendCubeCommand.d.ts +26 -0
  7. package/lib/__lib__/LegendCubeCommand.d.ts.map +1 -0
  8. package/lib/__lib__/LegendCubeCommand.js +40 -0
  9. package/lib/__lib__/LegendCubeCommand.js.map +1 -0
  10. package/lib/__lib__/LegendCubeHelpText.d.ts +19 -0
  11. package/lib/__lib__/LegendCubeHelpText.d.ts.map +1 -0
  12. package/lib/__lib__/LegendCubeHelpText.js +35 -0
  13. package/lib/__lib__/LegendCubeHelpText.js.map +1 -0
  14. package/lib/__lib__/LegendCubeLabels.d.ts +87 -0
  15. package/lib/__lib__/LegendCubeLabels.d.ts.map +1 -0
  16. package/lib/__lib__/LegendCubeLabels.js +128 -0
  17. package/lib/__lib__/LegendCubeLabels.js.map +1 -0
  18. package/lib/__lib__/LegendCubeTesting.d.ts +33 -0
  19. package/lib/__lib__/LegendCubeTesting.d.ts.map +1 -0
  20. package/lib/__lib__/LegendCubeTesting.js +34 -0
  21. package/lib/__lib__/LegendCubeTesting.js.map +1 -0
  22. package/lib/__test-utils__/CubeCanvasTestUtils.d.ts +24 -0
  23. package/lib/__test-utils__/CubeCanvasTestUtils.d.ts.map +1 -0
  24. package/lib/__test-utils__/CubeCanvasTestUtils.js +37 -0
  25. package/lib/__test-utils__/CubeCanvasTestUtils.js.map +1 -0
  26. package/lib/__test-utils__/CubeEngineTestSupport.d.ts +47 -0
  27. package/lib/__test-utils__/CubeEngineTestSupport.d.ts.map +1 -0
  28. package/lib/__test-utils__/CubeEngineTestSupport.js +106 -0
  29. package/lib/__test-utils__/CubeEngineTestSupport.js.map +1 -0
  30. package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts +31 -0
  31. package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts.map +1 -0
  32. package/lib/__test-utils__/CubeNorthwindTestQueries.js +102 -0
  33. package/lib/__test-utils__/CubeNorthwindTestQueries.js.map +1 -0
  34. package/lib/__test-utils__/CubeOperationsTestUtils.d.ts +42 -0
  35. package/lib/__test-utils__/CubeOperationsTestUtils.d.ts.map +1 -0
  36. package/lib/__test-utils__/CubeOperationsTestUtils.js +92 -0
  37. package/lib/__test-utils__/CubeOperationsTestUtils.js.map +1 -0
  38. package/lib/__test-utils__/CubePageTestUtils.d.ts +33 -0
  39. package/lib/__test-utils__/CubePageTestUtils.d.ts.map +1 -0
  40. package/lib/__test-utils__/CubePageTestUtils.js +68 -0
  41. package/lib/__test-utils__/CubePageTestUtils.js.map +1 -0
  42. package/lib/__test-utils__/CubeTestApplication.d.ts +30 -0
  43. package/lib/__test-utils__/CubeTestApplication.d.ts.map +1 -0
  44. package/lib/__test-utils__/CubeTestApplication.js +57 -0
  45. package/lib/__test-utils__/CubeTestApplication.js.map +1 -0
  46. package/lib/__test-utils__/FakeCubeEngine.d.ts +41 -0
  47. package/lib/__test-utils__/FakeCubeEngine.d.ts.map +1 -0
  48. package/lib/__test-utils__/FakeCubeEngine.js +91 -0
  49. package/lib/__test-utils__/FakeCubeEngine.js.map +1 -0
  50. package/lib/components/CubeButton.d.ts +20 -0
  51. package/lib/components/CubeButton.d.ts.map +1 -0
  52. package/lib/components/CubeButton.js +24 -0
  53. package/lib/components/CubeButton.js.map +1 -0
  54. package/lib/components/CubeEditor.d.ts +31 -0
  55. package/lib/components/CubeEditor.d.ts.map +1 -0
  56. package/lib/components/CubeEditor.js +90 -0
  57. package/lib/components/CubeEditor.js.map +1 -0
  58. package/lib/components/CubeNodeIcon.d.ts +23 -0
  59. package/lib/components/CubeNodeIcon.d.ts.map +1 -0
  60. package/lib/components/CubeNodeIcon.js +42 -0
  61. package/lib/components/CubeNodeIcon.js.map +1 -0
  62. package/lib/components/canvas/CubeCanvas.d.ts +37 -0
  63. package/lib/components/canvas/CubeCanvas.d.ts.map +1 -0
  64. package/lib/components/canvas/CubeCanvas.js +137 -0
  65. package/lib/components/canvas/CubeCanvas.js.map +1 -0
  66. package/lib/components/canvas/CubeCanvasContext.d.ts +19 -0
  67. package/lib/components/canvas/CubeCanvasContext.d.ts.map +1 -0
  68. package/lib/components/canvas/CubeCanvasContext.js +22 -0
  69. package/lib/components/canvas/CubeCanvasContext.js.map +1 -0
  70. package/lib/components/canvas/CubeCanvasContextMenu.d.ts +28 -0
  71. package/lib/components/canvas/CubeCanvasContextMenu.d.ts.map +1 -0
  72. package/lib/components/canvas/CubeCanvasContextMenu.js +35 -0
  73. package/lib/components/canvas/CubeCanvasContextMenu.js.map +1 -0
  74. package/lib/components/canvas/CubeCanvasDnd.d.ts +43 -0
  75. package/lib/components/canvas/CubeCanvasDnd.d.ts.map +1 -0
  76. package/lib/components/canvas/CubeCanvasDnd.js +51 -0
  77. package/lib/components/canvas/CubeCanvasDnd.js.map +1 -0
  78. package/lib/components/canvas/CubeCanvasEdge.d.ts +24 -0
  79. package/lib/components/canvas/CubeCanvasEdge.d.ts.map +1 -0
  80. package/lib/components/canvas/CubeCanvasEdge.js +33 -0
  81. package/lib/components/canvas/CubeCanvasEdge.js.map +1 -0
  82. package/lib/components/canvas/CubeCanvasElements.d.ts +66 -0
  83. package/lib/components/canvas/CubeCanvasElements.d.ts.map +1 -0
  84. package/lib/components/canvas/CubeCanvasElements.js +97 -0
  85. package/lib/components/canvas/CubeCanvasElements.js.map +1 -0
  86. package/lib/components/canvas/CubeCanvasLayout.d.ts +32 -0
  87. package/lib/components/canvas/CubeCanvasLayout.d.ts.map +1 -0
  88. package/lib/components/canvas/CubeCanvasLayout.js +63 -0
  89. package/lib/components/canvas/CubeCanvasLayout.js.map +1 -0
  90. package/lib/components/canvas/CubeCanvasNode.d.ts +29 -0
  91. package/lib/components/canvas/CubeCanvasNode.d.ts.map +1 -0
  92. package/lib/components/canvas/CubeCanvasNode.js +75 -0
  93. package/lib/components/canvas/CubeCanvasNode.js.map +1 -0
  94. package/lib/components/editors/CubeColumnPicker.d.ts +47 -0
  95. package/lib/components/editors/CubeColumnPicker.d.ts.map +1 -0
  96. package/lib/components/editors/CubeColumnPicker.js +56 -0
  97. package/lib/components/editors/CubeColumnPicker.js.map +1 -0
  98. package/lib/components/editors/CubeDistinctEditor.d.ts +23 -0
  99. package/lib/components/editors/CubeDistinctEditor.d.ts.map +1 -0
  100. package/lib/components/editors/CubeDistinctEditor.js +24 -0
  101. package/lib/components/editors/CubeDistinctEditor.js.map +1 -0
  102. package/lib/components/editors/CubeFilterEditor.d.ts +26 -0
  103. package/lib/components/editors/CubeFilterEditor.d.ts.map +1 -0
  104. package/lib/components/editors/CubeFilterEditor.js +90 -0
  105. package/lib/components/editors/CubeFilterEditor.js.map +1 -0
  106. package/lib/components/editors/CubeIntegerField.d.ts +29 -0
  107. package/lib/components/editors/CubeIntegerField.d.ts.map +1 -0
  108. package/lib/components/editors/CubeIntegerField.js +30 -0
  109. package/lib/components/editors/CubeIntegerField.js.map +1 -0
  110. package/lib/components/editors/CubeJoinEditor.d.ts +26 -0
  111. package/lib/components/editors/CubeJoinEditor.d.ts.map +1 -0
  112. package/lib/components/editors/CubeJoinEditor.js +84 -0
  113. package/lib/components/editors/CubeJoinEditor.js.map +1 -0
  114. package/lib/components/editors/CubeNodeEditorPanel.d.ts +29 -0
  115. package/lib/components/editors/CubeNodeEditorPanel.d.ts.map +1 -0
  116. package/lib/components/editors/CubeNodeEditorPanel.js +72 -0
  117. package/lib/components/editors/CubeNodeEditorPanel.js.map +1 -0
  118. package/lib/components/editors/CubeNodeEditorRegistry.d.ts +44 -0
  119. package/lib/components/editors/CubeNodeEditorRegistry.d.ts.map +1 -0
  120. package/lib/components/editors/CubeNodeEditorRegistry.js +43 -0
  121. package/lib/components/editors/CubeNodeEditorRegistry.js.map +1 -0
  122. package/lib/components/editors/CubeRenameEditor.d.ts +26 -0
  123. package/lib/components/editors/CubeRenameEditor.d.ts.map +1 -0
  124. package/lib/components/editors/CubeRenameEditor.js +58 -0
  125. package/lib/components/editors/CubeRenameEditor.js.map +1 -0
  126. package/lib/components/editors/CubeRestrictEditor.d.ts +26 -0
  127. package/lib/components/editors/CubeRestrictEditor.d.ts.map +1 -0
  128. package/lib/components/editors/CubeRestrictEditor.js +23 -0
  129. package/lib/components/editors/CubeRestrictEditor.js.map +1 -0
  130. package/lib/components/editors/CubeRowCountEditor.d.ts +25 -0
  131. package/lib/components/editors/CubeRowCountEditor.d.ts.map +1 -0
  132. package/lib/components/editors/CubeRowCountEditor.js +38 -0
  133. package/lib/components/editors/CubeRowCountEditor.js.map +1 -0
  134. package/lib/components/editors/CubeSliceEditor.d.ts +25 -0
  135. package/lib/components/editors/CubeSliceEditor.d.ts.map +1 -0
  136. package/lib/components/editors/CubeSliceEditor.js +40 -0
  137. package/lib/components/editors/CubeSliceEditor.js.map +1 -0
  138. package/lib/components/editors/CubeSortEditor.d.ts +27 -0
  139. package/lib/components/editors/CubeSortEditor.d.ts.map +1 -0
  140. package/lib/components/editors/CubeSortEditor.js +72 -0
  141. package/lib/components/editors/CubeSortEditor.js.map +1 -0
  142. package/lib/components/editors/CubeSourceEditor.d.ts +25 -0
  143. package/lib/components/editors/CubeSourceEditor.d.ts.map +1 -0
  144. package/lib/components/editors/CubeSourceEditor.js +41 -0
  145. package/lib/components/editors/CubeSourceEditor.js.map +1 -0
  146. package/lib/components/editors/CubeValueEditor.d.ts +40 -0
  147. package/lib/components/editors/CubeValueEditor.d.ts.map +1 -0
  148. package/lib/components/editors/CubeValueEditor.js +178 -0
  149. package/lib/components/editors/CubeValueEditor.js.map +1 -0
  150. package/lib/components/grid/CubeGridRegion.d.ts +23 -0
  151. package/lib/components/grid/CubeGridRegion.d.ts.map +1 -0
  152. package/lib/components/grid/CubeGridRegion.js +94 -0
  153. package/lib/components/grid/CubeGridRegion.js.map +1 -0
  154. package/lib/components/grid/CubeGridValues.d.ts +25 -0
  155. package/lib/components/grid/CubeGridValues.d.ts.map +1 -0
  156. package/lib/components/grid/CubeGridValues.js +95 -0
  157. package/lib/components/grid/CubeGridValues.js.map +1 -0
  158. package/lib/components/grid/CubeResultGrid.d.ts +39 -0
  159. package/lib/components/grid/CubeResultGrid.d.ts.map +1 -0
  160. package/lib/components/grid/CubeResultGrid.js +86 -0
  161. package/lib/components/grid/CubeResultGrid.js.map +1 -0
  162. package/lib/components/palette/CubePalette.d.ts +29 -0
  163. package/lib/components/palette/CubePalette.d.ts.map +1 -0
  164. package/lib/components/palette/CubePalette.js +73 -0
  165. package/lib/components/palette/CubePalette.js.map +1 -0
  166. package/lib/components/show-pure/CubeShowPureDialog.d.ts +23 -0
  167. package/lib/components/show-pure/CubeShowPureDialog.d.ts.map +1 -0
  168. package/lib/components/show-pure/CubeShowPureDialog.js +37 -0
  169. package/lib/components/show-pure/CubeShowPureDialog.js.map +1 -0
  170. package/lib/components/source-picker/CubeSourcePicker.d.ts +22 -0
  171. package/lib/components/source-picker/CubeSourcePicker.d.ts.map +1 -0
  172. package/lib/components/source-picker/CubeSourcePicker.js +89 -0
  173. package/lib/components/source-picker/CubeSourcePicker.js.map +1 -0
  174. package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts +26 -0
  175. package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts.map +1 -0
  176. package/lib/components/spec-transfer/CubeSpecTransferDialog.js +45 -0
  177. package/lib/components/spec-transfer/CubeSpecTransferDialog.js.map +1 -0
  178. package/lib/graph-manager/CubeEngine.d.ts +128 -0
  179. package/lib/graph-manager/CubeEngine.d.ts.map +1 -0
  180. package/lib/graph-manager/CubeEngine.js +61 -0
  181. package/lib/graph-manager/CubeEngine.js.map +1 -0
  182. package/lib/graph-manager/CubeModelOutlineHelper.d.ts +33 -0
  183. package/lib/graph-manager/CubeModelOutlineHelper.d.ts.map +1 -0
  184. package/lib/graph-manager/CubeModelOutlineHelper.js +45 -0
  185. package/lib/graph-manager/CubeModelOutlineHelper.js.map +1 -0
  186. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts +26 -0
  187. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts.map +1 -0
  188. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js +22 -0
  189. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js.map +1 -0
  190. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts +27 -0
  191. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts.map +1 -0
  192. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js +76 -0
  193. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js.map +1 -0
  194. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts +27 -0
  195. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts.map +1 -0
  196. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js +82 -0
  197. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js.map +1 -0
  198. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts +32 -0
  199. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts.map +1 -0
  200. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js +195 -0
  201. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js.map +1 -0
  202. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts +20 -0
  203. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts.map +1 -0
  204. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js +174 -0
  205. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js.map +1 -0
  206. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts +24 -0
  207. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts.map +1 -0
  208. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js +43 -0
  209. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js.map +1 -0
  210. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts +45 -0
  211. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts.map +1 -0
  212. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js +171 -0
  213. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js.map +1 -0
  214. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts +22 -0
  215. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts.map +1 -0
  216. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js +79 -0
  217. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js.map +1 -0
  218. package/lib/index.css +17 -0
  219. package/lib/index.css.map +1 -0
  220. package/lib/index.d.ts +25 -0
  221. package/lib/index.d.ts.map +1 -0
  222. package/lib/index.js +24 -0
  223. package/lib/index.js.map +1 -0
  224. package/lib/stores/CubeEditorState.d.ts +236 -0
  225. package/lib/stores/CubeEditorState.d.ts.map +1 -0
  226. package/lib/stores/CubeEditorState.js +632 -0
  227. package/lib/stores/CubeEditorState.js.map +1 -0
  228. package/lib/stores/CubeExecutionState.d.ts +67 -0
  229. package/lib/stores/CubeExecutionState.d.ts.map +1 -0
  230. package/lib/stores/CubeExecutionState.js +212 -0
  231. package/lib/stores/CubeExecutionState.js.map +1 -0
  232. package/lib/stores/CubeGridQuickActions.d.ts +40 -0
  233. package/lib/stores/CubeGridQuickActions.d.ts.map +1 -0
  234. package/lib/stores/CubeGridQuickActions.js +86 -0
  235. package/lib/stores/CubeGridQuickActions.js.map +1 -0
  236. package/lib/stores/CubeHost.d.ts +31 -0
  237. package/lib/stores/CubeHost.d.ts.map +1 -0
  238. package/lib/stores/CubeHost.js +17 -0
  239. package/lib/stores/CubeHost.js.map +1 -0
  240. package/lib/stores/CubeNodeEditorState.d.ts +103 -0
  241. package/lib/stores/CubeNodeEditorState.d.ts.map +1 -0
  242. package/lib/stores/CubeNodeEditorState.js +262 -0
  243. package/lib/stores/CubeNodeEditorState.js.map +1 -0
  244. package/lib/stores/CubeShowPureState.d.ts +41 -0
  245. package/lib/stores/CubeShowPureState.d.ts.map +1 -0
  246. package/lib/stores/CubeShowPureState.js +100 -0
  247. package/lib/stores/CubeShowPureState.js.map +1 -0
  248. package/lib/stores/CubeSourcePickerState.d.ts +98 -0
  249. package/lib/stores/CubeSourcePickerState.d.ts.map +1 -0
  250. package/lib/stores/CubeSourcePickerState.js +334 -0
  251. package/lib/stores/CubeSourcePickerState.js.map +1 -0
  252. package/lib/stores/CubeSpecTransferState.d.ts +60 -0
  253. package/lib/stores/CubeSpecTransferState.d.ts.map +1 -0
  254. package/lib/stores/CubeSpecTransferState.js +167 -0
  255. package/lib/stores/CubeSpecTransferState.js.map +1 -0
  256. package/lib/stores/LocalModelCatalog.d.ts +37 -0
  257. package/lib/stores/LocalModelCatalog.d.ts.map +1 -0
  258. package/lib/stores/LocalModelCatalog.js +49 -0
  259. package/lib/stores/LocalModelCatalog.js.map +1 -0
  260. package/lib/stores/editors/CubeFilterDraft.d.ts +61 -0
  261. package/lib/stores/editors/CubeFilterDraft.d.ts.map +1 -0
  262. package/lib/stores/editors/CubeFilterDraft.js +186 -0
  263. package/lib/stores/editors/CubeFilterDraft.js.map +1 -0
  264. package/lib/stores/editors/CubeIntegerText.d.ts +24 -0
  265. package/lib/stores/editors/CubeIntegerText.d.ts.map +1 -0
  266. package/lib/stores/editors/CubeIntegerText.js +33 -0
  267. package/lib/stores/editors/CubeIntegerText.js.map +1 -0
  268. package/lib/stores/editors/CubeJoinDraft.d.ts +71 -0
  269. package/lib/stores/editors/CubeJoinDraft.d.ts.map +1 -0
  270. package/lib/stores/editors/CubeJoinDraft.js +145 -0
  271. package/lib/stores/editors/CubeJoinDraft.js.map +1 -0
  272. package/lib/stores/editors/CubeNodeDraft.d.ts +38 -0
  273. package/lib/stores/editors/CubeNodeDraft.d.ts.map +1 -0
  274. package/lib/stores/editors/CubeNodeDraft.js +35 -0
  275. package/lib/stores/editors/CubeNodeDraft.js.map +1 -0
  276. package/lib/stores/editors/CubeNodeDraftRegistry.d.ts +35 -0
  277. package/lib/stores/editors/CubeNodeDraftRegistry.d.ts.map +1 -0
  278. package/lib/stores/editors/CubeNodeDraftRegistry.js +55 -0
  279. package/lib/stores/editors/CubeNodeDraftRegistry.js.map +1 -0
  280. package/lib/stores/editors/CubeRenameDraft.d.ts +44 -0
  281. package/lib/stores/editors/CubeRenameDraft.d.ts.map +1 -0
  282. package/lib/stores/editors/CubeRenameDraft.js +79 -0
  283. package/lib/stores/editors/CubeRenameDraft.js.map +1 -0
  284. package/lib/stores/editors/CubeRestrictDraft.d.ts +37 -0
  285. package/lib/stores/editors/CubeRestrictDraft.d.ts.map +1 -0
  286. package/lib/stores/editors/CubeRestrictDraft.js +73 -0
  287. package/lib/stores/editors/CubeRestrictDraft.js.map +1 -0
  288. package/lib/stores/editors/CubeRowCountDraft.d.ts +42 -0
  289. package/lib/stores/editors/CubeRowCountDraft.d.ts.map +1 -0
  290. package/lib/stores/editors/CubeRowCountDraft.js +55 -0
  291. package/lib/stores/editors/CubeRowCountDraft.js.map +1 -0
  292. package/lib/stores/editors/CubeSliceDraft.d.ts +42 -0
  293. package/lib/stores/editors/CubeSliceDraft.d.ts.map +1 -0
  294. package/lib/stores/editors/CubeSliceDraft.js +72 -0
  295. package/lib/stores/editors/CubeSliceDraft.js.map +1 -0
  296. package/lib/stores/editors/CubeSortDraft.d.ts +49 -0
  297. package/lib/stores/editors/CubeSortDraft.d.ts.map +1 -0
  298. package/lib/stores/editors/CubeSortDraft.js +99 -0
  299. package/lib/stores/editors/CubeSortDraft.js.map +1 -0
  300. package/lib/stores/fixtures/CubeNorthwindModel.d.ts +23 -0
  301. package/lib/stores/fixtures/CubeNorthwindModel.d.ts.map +1 -0
  302. package/lib/stores/fixtures/CubeNorthwindModel.js +338 -0
  303. package/lib/stores/fixtures/CubeNorthwindModel.js.map +1 -0
  304. package/package.json +81 -3
  305. package/src/__lib__/LegendCubeCommand.ts +44 -0
  306. package/src/__lib__/LegendCubeHelpText.ts +58 -0
  307. package/src/__lib__/LegendCubeLabels.ts +171 -0
  308. package/src/__lib__/LegendCubeTesting.ts +33 -0
  309. package/src/__test-utils__/CubeCanvasTestUtils.ts +53 -0
  310. package/src/__test-utils__/CubeEngineTestSupport.ts +172 -0
  311. package/src/__test-utils__/CubeNorthwindTestQueries.ts +165 -0
  312. package/src/__test-utils__/CubeOperationsTestUtils.ts +177 -0
  313. package/src/__test-utils__/CubePageTestUtils.tsx +96 -0
  314. package/src/__test-utils__/CubeTestApplication.ts +82 -0
  315. package/src/__test-utils__/FakeCubeEngine.ts +145 -0
  316. package/src/components/CubeButton.tsx +35 -0
  317. package/src/components/CubeEditor.tsx +239 -0
  318. package/src/components/CubeNodeIcon.tsx +64 -0
  319. package/src/components/canvas/CubeCanvas.tsx +262 -0
  320. package/src/components/canvas/CubeCanvasContext.ts +31 -0
  321. package/src/components/canvas/CubeCanvasContextMenu.tsx +89 -0
  322. package/src/components/canvas/CubeCanvasDnd.ts +82 -0
  323. package/src/components/canvas/CubeCanvasEdge.tsx +57 -0
  324. package/src/components/canvas/CubeCanvasElements.ts +153 -0
  325. package/src/components/canvas/CubeCanvasLayout.ts +88 -0
  326. package/src/components/canvas/CubeCanvasNode.tsx +149 -0
  327. package/src/components/editors/CubeColumnPicker.tsx +138 -0
  328. package/src/components/editors/CubeDistinctEditor.tsx +28 -0
  329. package/src/components/editors/CubeFilterEditor.tsx +309 -0
  330. package/src/components/editors/CubeIntegerField.tsx +51 -0
  331. package/src/components/editors/CubeJoinEditor.tsx +247 -0
  332. package/src/components/editors/CubeNodeEditorPanel.tsx +215 -0
  333. package/src/components/editors/CubeNodeEditorRegistry.ts +81 -0
  334. package/src/components/editors/CubeRenameEditor.tsx +143 -0
  335. package/src/components/editors/CubeRestrictEditor.tsx +103 -0
  336. package/src/components/editors/CubeRowCountEditor.tsx +53 -0
  337. package/src/components/editors/CubeSliceEditor.tsx +69 -0
  338. package/src/components/editors/CubeSortEditor.tsx +206 -0
  339. package/src/components/editors/CubeSourceEditor.tsx +106 -0
  340. package/src/components/editors/CubeValueEditor.tsx +333 -0
  341. package/src/components/grid/CubeGridRegion.tsx +275 -0
  342. package/src/components/grid/CubeGridValues.ts +125 -0
  343. package/src/components/grid/CubeResultGrid.tsx +138 -0
  344. package/src/components/palette/CubePalette.tsx +177 -0
  345. package/src/components/show-pure/CubeShowPureDialog.tsx +101 -0
  346. package/src/components/source-picker/CubeSourcePicker.tsx +304 -0
  347. package/src/components/spec-transfer/CubeSpecTransferDialog.tsx +157 -0
  348. package/src/graph-manager/CubeEngine.ts +169 -0
  349. package/src/graph-manager/CubeModelOutlineHelper.ts +58 -0
  350. package/src/graph-manager/protocol/pure/CubeEngineBuilder.ts +34 -0
  351. package/src/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.ts +109 -0
  352. package/src/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.ts +115 -0
  353. package/src/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.ts +257 -0
  354. package/src/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.ts +243 -0
  355. package/src/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.ts +58 -0
  356. package/src/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.ts +278 -0
  357. package/src/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.ts +127 -0
  358. package/src/index.ts +41 -0
  359. package/src/stores/CubeEditorState.ts +807 -0
  360. package/src/stores/CubeExecutionState.ts +288 -0
  361. package/src/stores/CubeGridQuickActions.ts +129 -0
  362. package/src/stores/CubeHost.ts +32 -0
  363. package/src/stores/CubeNodeEditorState.ts +324 -0
  364. package/src/stores/CubeShowPureState.ts +118 -0
  365. package/src/stores/CubeSourcePickerState.ts +426 -0
  366. package/src/stores/CubeSpecTransferState.ts +198 -0
  367. package/src/stores/LocalModelCatalog.ts +70 -0
  368. package/src/stores/editors/CubeFilterDraft.ts +241 -0
  369. package/src/stores/editors/CubeIntegerText.ts +34 -0
  370. package/src/stores/editors/CubeJoinDraft.ts +224 -0
  371. package/src/stores/editors/CubeNodeDraft.ts +46 -0
  372. package/src/stores/editors/CubeNodeDraftRegistry.ts +83 -0
  373. package/src/stores/editors/CubeRenameDraft.ts +110 -0
  374. package/src/stores/editors/CubeRestrictDraft.ts +83 -0
  375. package/src/stores/editors/CubeRowCountDraft.ts +69 -0
  376. package/src/stores/editors/CubeSliceDraft.ts +87 -0
  377. package/src/stores/editors/CubeSortDraft.ts +135 -0
  378. package/src/stores/fixtures/CubeNorthwindModel.ts +355 -0
  379. package/tsconfig.json +133 -0
@@ -0,0 +1,67 @@
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, type Schema } from '@finos/legend-cube';
17
+ import { type GeneratorFn } from '@finos/legend-shared';
18
+ import { CubeEngineError, type CubeResultValue } from '../graph-manager/CubeEngine.js';
19
+ import type { CubeEditorState } from './CubeEditorState.js';
20
+ /** What the grid shows of a run: the rows within the limit, under the schema the run was made with */
21
+ export interface CubeExecutionResult {
22
+ /** Counts the page's runs: the grid is built anew for each */
23
+ readonly id: number;
24
+ /** The query that ran: results are stale once the document holds another */
25
+ readonly query: Query;
26
+ /** The capture node's schema when the run started; the grid's columns, by position */
27
+ readonly schema: Schema;
28
+ /** At most `rowLimit` rows */
29
+ readonly rows: readonly (readonly CubeResultValue[])[];
30
+ readonly rowLimit: number;
31
+ /** The engine returned more than `rowLimit` rows */
32
+ readonly limited: boolean;
33
+ readonly sql: readonly string[];
34
+ readonly durationMs: number;
35
+ }
36
+ /**
37
+ * Runs the query up to its capture node (PLAN §8.2, §9). Execution is
38
+ * explicit; while a run is in flight Execute becomes Stop, and only the latest
39
+ * run's answer is applied (Settled before M1.8).
40
+ */
41
+ export declare class CubeExecutionState {
42
+ readonly editorState: CubeEditorState;
43
+ result: CubeExecutionResult | undefined;
44
+ error: CubeEngineError | undefined;
45
+ /** The abort controller of the run in flight, if any */
46
+ private runController;
47
+ private runCount;
48
+ constructor(editorState: CubeEditorState);
49
+ get isRunning(): boolean;
50
+ /** The shown result no longer matches the query or the row limit; it is kept until the next run */
51
+ get isStale(): boolean;
52
+ /**
53
+ * Why Execute is unavailable, if it is: it needs a source, a model and a
54
+ * runtime, and a valid capture node whose inputs are all valid. Invalid
55
+ * nodes elsewhere don't matter (PLAN §10.3).
56
+ */
57
+ get disabledReasons(): string[];
58
+ get canExecute(): boolean;
59
+ execute(): GeneratorFn<void>;
60
+ /** Drops the last run's error: it described a query the cube no longer has */
61
+ clearError(): void;
62
+ /** Cancels the run in flight; it shows no result and no error */
63
+ stop(): void;
64
+ /** Stops any run and forgets the last one's rows and error, e.g. when another cube is opened */
65
+ reset(): void;
66
+ }
67
+ //# sourceMappingURL=CubeExecutionState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeExecutionState.d.ts","sourceRoot":"","sources":["../../src/stores/CubeExecutionState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;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B;IAEA,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC;IA4G7B,8EAA8E;IAC9E,UAAU,IAAI,IAAI;IAIlB,iEAAiE;IACjE,IAAI,IAAI,IAAI;IAKZ,gGAAgG;IAChG,KAAK,IAAI,IAAI;CAKd"}
@@ -0,0 +1,212 @@
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, needsDatabaseType, } from '@finos/legend-cube';
17
+ import { assertErrorThrown } from '@finos/legend-shared';
18
+ import { action, computed, flow, flowResult, 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
+ // the run starts before any wait, so Stop works and a second F9 is ignored
125
+ const controller = new AbortController();
126
+ this.runController = controller;
127
+ this.error = undefined;
128
+ this.editorState.clearHostIssues();
129
+ try {
130
+ // a Drop, Slice, Limit or Distinct is written for the database it runs on
131
+ // (PLAN §11.4), which the model's outline gives: loaded once, waited
132
+ // for only then; the query, model and runtime are the ones captured
133
+ let databaseType;
134
+ if (needsDatabaseType(query, captureId)) {
135
+ yield flowResult(this.editorState.loadModelOutline(model));
136
+ if (this.runController !== controller || controller.signal.aborted) {
137
+ return;
138
+ }
139
+ databaseType = this.editorState.getRunDatabaseType(query, captureId, model, runtime);
140
+ }
141
+ const lambda = emitter.emitExecutionLambda({
142
+ rowLimit,
143
+ runtime,
144
+ databaseType,
145
+ });
146
+ const response = (yield host.engine.execute(model, lambda, {
147
+ abortController: controller,
148
+ }));
149
+ if (this.runController !== controller) {
150
+ return;
151
+ }
152
+ // rows are read by position, so the engine's columns must be the query's
153
+ if (response.columns.length !== schema.columns.length) {
154
+ throw new CubeEngineError(CubeEngineErrorKind.EXECUTION, `The engine returned ${response.columns.length} columns, but the query has ${schema.columns.length}`, captureId);
155
+ }
156
+ const misplaced = schema.columns.findIndex((column, position) => response.columns[position] !== column.name);
157
+ if (misplaced !== -1) {
158
+ 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);
159
+ }
160
+ const limited = response.rows.length > rowLimit;
161
+ this.result = {
162
+ id: ++this.runCount,
163
+ query,
164
+ schema,
165
+ rows: limited ? response.rows.slice(0, rowLimit) : response.rows,
166
+ rowLimit,
167
+ limited,
168
+ sql: response.sql,
169
+ durationMs: response.durationMs,
170
+ };
171
+ }
172
+ catch (error) {
173
+ // a stopped or replaced run shows nothing
174
+ if (this.runController !== controller || controller.signal.aborted) {
175
+ return;
176
+ }
177
+ assertErrorThrown(error);
178
+ const engineError = error instanceof CubeEngineError
179
+ ? error
180
+ : new CubeEngineError(CubeEngineErrorKind.EXECUTION, error.message, captureId);
181
+ // the rows of an earlier run are never shown as this run's
182
+ this.result = undefined;
183
+ // an error belongs to the query it came from: one that changed while
184
+ // the run was in flight drops it, as an edit after the run would
185
+ if (this.editorState.document.query === query) {
186
+ this.error = engineError;
187
+ this.editorState.setHostIssue(engineError.nodeId ?? captureId, engineError);
188
+ }
189
+ }
190
+ finally {
191
+ if (this.runController === controller) {
192
+ this.runController = undefined;
193
+ }
194
+ }
195
+ }
196
+ /** Drops the last run's error: it described a query the cube no longer has */
197
+ clearError() {
198
+ this.error = undefined;
199
+ }
200
+ /** Cancels the run in flight; it shows no result and no error */
201
+ stop() {
202
+ this.runController?.abort();
203
+ this.runController = undefined;
204
+ }
205
+ /** Stops any run and forgets the last one's rows and error, e.g. when another cube is opened */
206
+ reset() {
207
+ this.stop();
208
+ this.result = undefined;
209
+ this.error = undefined;
210
+ }
211
+ }
212
+ //# 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,EACL,cAAc,EACd,iBAAiB,GAGlB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAoB,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,cAAc,EACd,UAAU,GACX,MAAM,MAAM,CAAC;AACd,OAAO,EACL,eAAe,EACf,mBAAmB,GAGpB,MAAM,gCAAgC,CAAC;AAoBxC;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,CACxB,KAAY,EACZ,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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,40 @@
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 { CubeResultValue } from '../graph-manager/CubeEngine.js';
17
+ import type { CubeEditorState } from './CubeEditorState.js';
18
+ /** One of the grid's quick actions on a cell (spec §12.4) */
19
+ export interface CubeGridQuickAction {
20
+ /** e.g. `Sort by "SHIP_COUNTRY"` */
21
+ readonly label: string;
22
+ /** Why it can't be used, its tooltip then; `undefined` when it can */
23
+ readonly disabledReason: string | undefined;
24
+ /** A note shown as its tooltip when it can be used, e.g. on comparing floats */
25
+ readonly hint: string | undefined;
26
+ /** Adds its node after the node that runs, as one undo step; nothing runs */
27
+ readonly apply: () => void;
28
+ }
29
+ /**
30
+ * The quick actions on a cell of the shown rows (spec §12.4, PLAN §11.4):
31
+ * "Sort by" adds an ascending Sort on the cell's column, and "Filter by" an
32
+ * Equal on its value (Is Empty on a null), after the node that runs, which
33
+ * they replace as the node that runs. Both need the rows to be from the
34
+ * current query, no run in flight, and a cube that can change; "Sort by" a
35
+ * type that sorts, and "Filter by" a value its column's type can compare.
36
+ * Read when the menu opens; `[]` when the position is not a column of the
37
+ * shown rows.
38
+ */
39
+ export declare const getCubeGridQuickActions: (editorState: CubeEditorState, position: number, cell: CubeResultValue) => CubeGridQuickAction[];
40
+ //# sourceMappingURL=CubeGridQuickActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeGridQuickActions.d.ts","sourceRoot":"","sources":["../../src/stores/CubeGridQuickActions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAgBH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,6DAA6D;AAC7D,MAAM,WAAW,mBAAmB;IAClC,oCAAoC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5C,gFAAgF;IAChF,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,6EAA6E;IAC7E,QAAQ,CAAC,KAAK,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,GAClC,aAAa,eAAe,EAC5B,UAAU,MAAM,EAChB,MAAM,eAAe,KACpB,mBAAmB,EAqErB,CAAC"}
@@ -0,0 +1,86 @@
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 { buildQuickFilterRule, FilterOperator, Filter, isOperatorAvailable, isSortableType, Sort, TypeFamily, } from '@finos/legend-cube';
17
+ import { CUBE_QUICK_ACTION_DISABLED_REASON, FILTER_FLOAT_COMPARISON_HINT, READ_ONLY_CUBE_TITLE, } from '../__lib__/LegendCubeLabels.js';
18
+ /**
19
+ * The quick actions on a cell of the shown rows (spec §12.4, PLAN §11.4):
20
+ * "Sort by" adds an ascending Sort on the cell's column, and "Filter by" an
21
+ * Equal on its value (Is Empty on a null), after the node that runs, which
22
+ * they replace as the node that runs. Both need the rows to be from the
23
+ * current query, no run in flight, and a cube that can change; "Sort by" a
24
+ * type that sorts, and "Filter by" a value its column's type can compare.
25
+ * Read when the menu opens; `[]` when the position is not a column of the
26
+ * shown rows.
27
+ */
28
+ export const getCubeGridQuickActions = (editorState, position, cell) => {
29
+ const { execution, document } = editorState;
30
+ const { result } = execution;
31
+ const column = result?.schema.columns[position];
32
+ if (!result || !column) {
33
+ return [];
34
+ }
35
+ const { query } = document;
36
+ const afterId = query.selected;
37
+ const typeName = column.type.displayName;
38
+ const rule = buildQuickFilterRule(column.name, column.type, cell);
39
+ // what keeps both from being used, in order
40
+ const blocked = result.query !== query
41
+ ? CUBE_QUICK_ACTION_DISABLED_REASON.STALE_ROWS
42
+ : execution.isRunning
43
+ ? CUBE_QUICK_ACTION_DISABLED_REASON.RUNNING
44
+ : editorState.readOnly
45
+ ? READ_ONLY_CUBE_TITLE
46
+ : undefined;
47
+ const sortReason = blocked ??
48
+ (isSortableType(column.type)
49
+ ? undefined
50
+ : CUBE_QUICK_ACTION_DISABLED_REASON.notSortable(typeName));
51
+ const filterReason = blocked ??
52
+ (rule
53
+ ? undefined
54
+ : isOperatorAvailable(FilterOperator.EQUAL, column.type)
55
+ ? CUBE_QUICK_ACTION_DISABLED_REASON.UNREADABLE_VALUE
56
+ : CUBE_QUICK_ACTION_DISABLED_REASON.notComparable(typeName));
57
+ return [
58
+ {
59
+ label: `Sort by "${column.name}"`,
60
+ disabledReason: sortReason,
61
+ hint: undefined,
62
+ apply: () => {
63
+ // as the menu found it: nothing changed since it opened
64
+ if (sortReason === undefined && editorState.document.query === query) {
65
+ editorState.addConfiguredNode(Sort.byColumn(query.generateId(Sort.TYPE), column.name), afterId);
66
+ }
67
+ },
68
+ },
69
+ {
70
+ label: `Filter by "${column.name}"`,
71
+ disabledReason: filterReason,
72
+ hint: rule?.operator === FilterOperator.EQUAL &&
73
+ column.type.family === TypeFamily.FLOAT
74
+ ? FILTER_FLOAT_COMPARISON_HINT
75
+ : undefined,
76
+ apply: () => {
77
+ if (filterReason === undefined &&
78
+ rule &&
79
+ editorState.document.query === query) {
80
+ editorState.addConfiguredNode(new Filter(query.generateId(Filter.TYPE), rule), afterId);
81
+ }
82
+ },
83
+ },
84
+ ];
85
+ };
86
+ //# sourceMappingURL=CubeGridQuickActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeGridQuickActions.js","sourceRoot":"","sources":["../../src/stores/CubeGridQuickActions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,MAAM,EACN,mBAAmB,EACnB,cAAc,EACd,IAAI,EACJ,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B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CAAC,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 { 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,103 @@
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, type 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
+ /**
69
+ * The cube's query with the draft in place of its node, when it has
70
+ * changes, and the schemas of the node's inputs, which the draft doesn't
71
+ * change
72
+ */
73
+ private get queryWithEdits();
74
+ /**
75
+ * Whether the join being edited, edits included, can have the columns its
76
+ * inputs share renamed (spec §7.11's autofix, PLAN §11.4): its only problem
77
+ * is the duplicate rule, and the cube isn't read-only
78
+ */
79
+ get canRenameDuplicateColumns(): boolean;
80
+ /**
81
+ * Renames the columns the join's inputs share with a Rename before each
82
+ * input, applying the draft first, as one undo step, then goes on editing
83
+ * the join, whose keys follow the renames
84
+ */
85
+ renameDuplicateColumns(): void;
86
+ /** Applies the draft, then closes the panel (spec §17.5: edits commit on close) */
87
+ close(): void;
88
+ /** Closes the panel, dropping the draft */
89
+ cancel(): void;
90
+ /**
91
+ * Closes the panel without applying the draft, e.g. when another cube is
92
+ * opened, saying so when that drops edits
93
+ */
94
+ discard(reason: CUBE_EDITOR_CLOSED_REASON): void;
95
+ dismissNotice(): void;
96
+ /** Stops following the cube; call when the page closes */
97
+ dispose(): void;
98
+ private bind;
99
+ private reset;
100
+ /** Runs whenever the node with the panel's id is another object, or gone */
101
+ private sync;
102
+ }
103
+ //# sourceMappingURL=CubeNodeEditorState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeNodeEditorState.d.ts","sourceRoot":"","sources":["../../src/stores/CubeNodeEditorState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,YAAY,EAEjB,KAAK,SAAS,EAEf,MAAM,oBAAoB,CAAC;AAS5B,OAAO,EACL,yBAAyB,EAE1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAGhE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,YAAY,EACtB,GAAG,SAAS,EACZ,GAAG,SAAS,KACX,OAWF,CAAC;AAEF;;;;;;;;;GASG;AACH,qBAAa,mBAAmB;IAC9B,QAAQ,CAAC,WAAW,EAAE,eAAe,CAAC;IAEtC,2DAA2D;IAC3D,MAAM,EAAE,MAAM,GAAG,SAAS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