@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.
- package/LICENSE +201 -0
- package/README.md +64 -2
- package/docs/adding-an-operation.md +92 -0
- package/docs/hosting.md +79 -0
- package/docs/testing.md +83 -0
- package/lib/__lib__/LegendCubeCommand.d.ts +26 -0
- package/lib/__lib__/LegendCubeCommand.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeCommand.js +40 -0
- package/lib/__lib__/LegendCubeCommand.js.map +1 -0
- package/lib/__lib__/LegendCubeHelpText.d.ts +19 -0
- package/lib/__lib__/LegendCubeHelpText.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeHelpText.js +35 -0
- package/lib/__lib__/LegendCubeHelpText.js.map +1 -0
- package/lib/__lib__/LegendCubeLabels.d.ts +87 -0
- package/lib/__lib__/LegendCubeLabels.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeLabels.js +128 -0
- package/lib/__lib__/LegendCubeLabels.js.map +1 -0
- package/lib/__lib__/LegendCubeTesting.d.ts +33 -0
- package/lib/__lib__/LegendCubeTesting.d.ts.map +1 -0
- package/lib/__lib__/LegendCubeTesting.js +34 -0
- package/lib/__lib__/LegendCubeTesting.js.map +1 -0
- package/lib/__test-utils__/CubeCanvasTestUtils.d.ts +24 -0
- package/lib/__test-utils__/CubeCanvasTestUtils.d.ts.map +1 -0
- package/lib/__test-utils__/CubeCanvasTestUtils.js +37 -0
- package/lib/__test-utils__/CubeCanvasTestUtils.js.map +1 -0
- package/lib/__test-utils__/CubeEngineTestSupport.d.ts +47 -0
- package/lib/__test-utils__/CubeEngineTestSupport.d.ts.map +1 -0
- package/lib/__test-utils__/CubeEngineTestSupport.js +106 -0
- package/lib/__test-utils__/CubeEngineTestSupport.js.map +1 -0
- package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts +31 -0
- package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts.map +1 -0
- package/lib/__test-utils__/CubeNorthwindTestQueries.js +102 -0
- package/lib/__test-utils__/CubeNorthwindTestQueries.js.map +1 -0
- package/lib/__test-utils__/CubeOperationsTestUtils.d.ts +42 -0
- package/lib/__test-utils__/CubeOperationsTestUtils.d.ts.map +1 -0
- package/lib/__test-utils__/CubeOperationsTestUtils.js +92 -0
- package/lib/__test-utils__/CubeOperationsTestUtils.js.map +1 -0
- package/lib/__test-utils__/CubePageTestUtils.d.ts +33 -0
- package/lib/__test-utils__/CubePageTestUtils.d.ts.map +1 -0
- package/lib/__test-utils__/CubePageTestUtils.js +68 -0
- package/lib/__test-utils__/CubePageTestUtils.js.map +1 -0
- package/lib/__test-utils__/CubeTestApplication.d.ts +30 -0
- package/lib/__test-utils__/CubeTestApplication.d.ts.map +1 -0
- package/lib/__test-utils__/CubeTestApplication.js +57 -0
- package/lib/__test-utils__/CubeTestApplication.js.map +1 -0
- package/lib/__test-utils__/FakeCubeEngine.d.ts +41 -0
- package/lib/__test-utils__/FakeCubeEngine.d.ts.map +1 -0
- package/lib/__test-utils__/FakeCubeEngine.js +91 -0
- package/lib/__test-utils__/FakeCubeEngine.js.map +1 -0
- package/lib/components/CubeButton.d.ts +20 -0
- package/lib/components/CubeButton.d.ts.map +1 -0
- package/lib/components/CubeButton.js +24 -0
- package/lib/components/CubeButton.js.map +1 -0
- package/lib/components/CubeEditor.d.ts +31 -0
- package/lib/components/CubeEditor.d.ts.map +1 -0
- package/lib/components/CubeEditor.js +90 -0
- package/lib/components/CubeEditor.js.map +1 -0
- package/lib/components/CubeNodeIcon.d.ts +23 -0
- package/lib/components/CubeNodeIcon.d.ts.map +1 -0
- package/lib/components/CubeNodeIcon.js +42 -0
- package/lib/components/CubeNodeIcon.js.map +1 -0
- package/lib/components/canvas/CubeCanvas.d.ts +37 -0
- package/lib/components/canvas/CubeCanvas.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvas.js +137 -0
- package/lib/components/canvas/CubeCanvas.js.map +1 -0
- package/lib/components/canvas/CubeCanvasContext.d.ts +19 -0
- package/lib/components/canvas/CubeCanvasContext.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasContext.js +22 -0
- package/lib/components/canvas/CubeCanvasContext.js.map +1 -0
- package/lib/components/canvas/CubeCanvasContextMenu.d.ts +28 -0
- package/lib/components/canvas/CubeCanvasContextMenu.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasContextMenu.js +35 -0
- package/lib/components/canvas/CubeCanvasContextMenu.js.map +1 -0
- package/lib/components/canvas/CubeCanvasDnd.d.ts +43 -0
- package/lib/components/canvas/CubeCanvasDnd.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasDnd.js +51 -0
- package/lib/components/canvas/CubeCanvasDnd.js.map +1 -0
- package/lib/components/canvas/CubeCanvasEdge.d.ts +24 -0
- package/lib/components/canvas/CubeCanvasEdge.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasEdge.js +33 -0
- package/lib/components/canvas/CubeCanvasEdge.js.map +1 -0
- package/lib/components/canvas/CubeCanvasElements.d.ts +66 -0
- package/lib/components/canvas/CubeCanvasElements.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasElements.js +97 -0
- package/lib/components/canvas/CubeCanvasElements.js.map +1 -0
- package/lib/components/canvas/CubeCanvasLayout.d.ts +32 -0
- package/lib/components/canvas/CubeCanvasLayout.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasLayout.js +63 -0
- package/lib/components/canvas/CubeCanvasLayout.js.map +1 -0
- package/lib/components/canvas/CubeCanvasNode.d.ts +29 -0
- package/lib/components/canvas/CubeCanvasNode.d.ts.map +1 -0
- package/lib/components/canvas/CubeCanvasNode.js +75 -0
- package/lib/components/canvas/CubeCanvasNode.js.map +1 -0
- package/lib/components/editors/CubeColumnPicker.d.ts +47 -0
- package/lib/components/editors/CubeColumnPicker.d.ts.map +1 -0
- package/lib/components/editors/CubeColumnPicker.js +56 -0
- package/lib/components/editors/CubeColumnPicker.js.map +1 -0
- package/lib/components/editors/CubeDistinctEditor.d.ts +23 -0
- package/lib/components/editors/CubeDistinctEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeDistinctEditor.js +24 -0
- package/lib/components/editors/CubeDistinctEditor.js.map +1 -0
- package/lib/components/editors/CubeFilterEditor.d.ts +26 -0
- package/lib/components/editors/CubeFilterEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeFilterEditor.js +90 -0
- package/lib/components/editors/CubeFilterEditor.js.map +1 -0
- package/lib/components/editors/CubeIntegerField.d.ts +29 -0
- package/lib/components/editors/CubeIntegerField.d.ts.map +1 -0
- package/lib/components/editors/CubeIntegerField.js +30 -0
- package/lib/components/editors/CubeIntegerField.js.map +1 -0
- package/lib/components/editors/CubeJoinEditor.d.ts +26 -0
- package/lib/components/editors/CubeJoinEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeJoinEditor.js +84 -0
- package/lib/components/editors/CubeJoinEditor.js.map +1 -0
- package/lib/components/editors/CubeNodeEditorPanel.d.ts +29 -0
- package/lib/components/editors/CubeNodeEditorPanel.d.ts.map +1 -0
- package/lib/components/editors/CubeNodeEditorPanel.js +72 -0
- package/lib/components/editors/CubeNodeEditorPanel.js.map +1 -0
- package/lib/components/editors/CubeNodeEditorRegistry.d.ts +44 -0
- package/lib/components/editors/CubeNodeEditorRegistry.d.ts.map +1 -0
- package/lib/components/editors/CubeNodeEditorRegistry.js +43 -0
- package/lib/components/editors/CubeNodeEditorRegistry.js.map +1 -0
- package/lib/components/editors/CubeRenameEditor.d.ts +26 -0
- package/lib/components/editors/CubeRenameEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeRenameEditor.js +58 -0
- package/lib/components/editors/CubeRenameEditor.js.map +1 -0
- package/lib/components/editors/CubeRestrictEditor.d.ts +26 -0
- package/lib/components/editors/CubeRestrictEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeRestrictEditor.js +23 -0
- package/lib/components/editors/CubeRestrictEditor.js.map +1 -0
- package/lib/components/editors/CubeRowCountEditor.d.ts +25 -0
- package/lib/components/editors/CubeRowCountEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeRowCountEditor.js +38 -0
- package/lib/components/editors/CubeRowCountEditor.js.map +1 -0
- package/lib/components/editors/CubeSliceEditor.d.ts +25 -0
- package/lib/components/editors/CubeSliceEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeSliceEditor.js +40 -0
- package/lib/components/editors/CubeSliceEditor.js.map +1 -0
- package/lib/components/editors/CubeSortEditor.d.ts +27 -0
- package/lib/components/editors/CubeSortEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeSortEditor.js +72 -0
- package/lib/components/editors/CubeSortEditor.js.map +1 -0
- package/lib/components/editors/CubeSourceEditor.d.ts +25 -0
- package/lib/components/editors/CubeSourceEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeSourceEditor.js +41 -0
- package/lib/components/editors/CubeSourceEditor.js.map +1 -0
- package/lib/components/editors/CubeValueEditor.d.ts +40 -0
- package/lib/components/editors/CubeValueEditor.d.ts.map +1 -0
- package/lib/components/editors/CubeValueEditor.js +178 -0
- package/lib/components/editors/CubeValueEditor.js.map +1 -0
- package/lib/components/grid/CubeGridRegion.d.ts +23 -0
- package/lib/components/grid/CubeGridRegion.d.ts.map +1 -0
- package/lib/components/grid/CubeGridRegion.js +94 -0
- package/lib/components/grid/CubeGridRegion.js.map +1 -0
- package/lib/components/grid/CubeGridValues.d.ts +25 -0
- package/lib/components/grid/CubeGridValues.d.ts.map +1 -0
- package/lib/components/grid/CubeGridValues.js +95 -0
- package/lib/components/grid/CubeGridValues.js.map +1 -0
- package/lib/components/grid/CubeResultGrid.d.ts +39 -0
- package/lib/components/grid/CubeResultGrid.d.ts.map +1 -0
- package/lib/components/grid/CubeResultGrid.js +86 -0
- package/lib/components/grid/CubeResultGrid.js.map +1 -0
- package/lib/components/palette/CubePalette.d.ts +29 -0
- package/lib/components/palette/CubePalette.d.ts.map +1 -0
- package/lib/components/palette/CubePalette.js +73 -0
- package/lib/components/palette/CubePalette.js.map +1 -0
- package/lib/components/show-pure/CubeShowPureDialog.d.ts +23 -0
- package/lib/components/show-pure/CubeShowPureDialog.d.ts.map +1 -0
- package/lib/components/show-pure/CubeShowPureDialog.js +37 -0
- package/lib/components/show-pure/CubeShowPureDialog.js.map +1 -0
- package/lib/components/source-picker/CubeSourcePicker.d.ts +22 -0
- package/lib/components/source-picker/CubeSourcePicker.d.ts.map +1 -0
- package/lib/components/source-picker/CubeSourcePicker.js +89 -0
- package/lib/components/source-picker/CubeSourcePicker.js.map +1 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts +26 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts.map +1 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.js +45 -0
- package/lib/components/spec-transfer/CubeSpecTransferDialog.js.map +1 -0
- package/lib/graph-manager/CubeEngine.d.ts +128 -0
- package/lib/graph-manager/CubeEngine.d.ts.map +1 -0
- package/lib/graph-manager/CubeEngine.js +61 -0
- package/lib/graph-manager/CubeEngine.js.map +1 -0
- package/lib/graph-manager/CubeModelOutlineHelper.d.ts +33 -0
- package/lib/graph-manager/CubeModelOutlineHelper.d.ts.map +1 -0
- package/lib/graph-manager/CubeModelOutlineHelper.js +45 -0
- package/lib/graph-manager/CubeModelOutlineHelper.js.map +1 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts +26 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js +22 -0
- package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts +27 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js +76 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts +27 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js +82 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts +32 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js +195 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts +20 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js +174 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts +24 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js +43 -0
- package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts +45 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js +171 -0
- package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts +22 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts.map +1 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js +79 -0
- package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js.map +1 -0
- package/lib/index.css +17 -0
- package/lib/index.css.map +1 -0
- package/lib/index.d.ts +25 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +24 -0
- package/lib/index.js.map +1 -0
- package/lib/stores/CubeEditorState.d.ts +236 -0
- package/lib/stores/CubeEditorState.d.ts.map +1 -0
- package/lib/stores/CubeEditorState.js +632 -0
- package/lib/stores/CubeEditorState.js.map +1 -0
- package/lib/stores/CubeExecutionState.d.ts +67 -0
- package/lib/stores/CubeExecutionState.d.ts.map +1 -0
- package/lib/stores/CubeExecutionState.js +212 -0
- package/lib/stores/CubeExecutionState.js.map +1 -0
- package/lib/stores/CubeGridQuickActions.d.ts +40 -0
- package/lib/stores/CubeGridQuickActions.d.ts.map +1 -0
- package/lib/stores/CubeGridQuickActions.js +86 -0
- package/lib/stores/CubeGridQuickActions.js.map +1 -0
- package/lib/stores/CubeHost.d.ts +31 -0
- package/lib/stores/CubeHost.d.ts.map +1 -0
- package/lib/stores/CubeHost.js +17 -0
- package/lib/stores/CubeHost.js.map +1 -0
- package/lib/stores/CubeNodeEditorState.d.ts +103 -0
- package/lib/stores/CubeNodeEditorState.d.ts.map +1 -0
- package/lib/stores/CubeNodeEditorState.js +262 -0
- package/lib/stores/CubeNodeEditorState.js.map +1 -0
- package/lib/stores/CubeShowPureState.d.ts +41 -0
- package/lib/stores/CubeShowPureState.d.ts.map +1 -0
- package/lib/stores/CubeShowPureState.js +100 -0
- package/lib/stores/CubeShowPureState.js.map +1 -0
- package/lib/stores/CubeSourcePickerState.d.ts +98 -0
- package/lib/stores/CubeSourcePickerState.d.ts.map +1 -0
- package/lib/stores/CubeSourcePickerState.js +334 -0
- package/lib/stores/CubeSourcePickerState.js.map +1 -0
- package/lib/stores/CubeSpecTransferState.d.ts +60 -0
- package/lib/stores/CubeSpecTransferState.d.ts.map +1 -0
- package/lib/stores/CubeSpecTransferState.js +167 -0
- package/lib/stores/CubeSpecTransferState.js.map +1 -0
- package/lib/stores/LocalModelCatalog.d.ts +37 -0
- package/lib/stores/LocalModelCatalog.d.ts.map +1 -0
- package/lib/stores/LocalModelCatalog.js +49 -0
- package/lib/stores/LocalModelCatalog.js.map +1 -0
- package/lib/stores/editors/CubeFilterDraft.d.ts +61 -0
- package/lib/stores/editors/CubeFilterDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeFilterDraft.js +186 -0
- package/lib/stores/editors/CubeFilterDraft.js.map +1 -0
- package/lib/stores/editors/CubeIntegerText.d.ts +24 -0
- package/lib/stores/editors/CubeIntegerText.d.ts.map +1 -0
- package/lib/stores/editors/CubeIntegerText.js +33 -0
- package/lib/stores/editors/CubeIntegerText.js.map +1 -0
- package/lib/stores/editors/CubeJoinDraft.d.ts +71 -0
- package/lib/stores/editors/CubeJoinDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeJoinDraft.js +145 -0
- package/lib/stores/editors/CubeJoinDraft.js.map +1 -0
- package/lib/stores/editors/CubeNodeDraft.d.ts +38 -0
- package/lib/stores/editors/CubeNodeDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeNodeDraft.js +35 -0
- package/lib/stores/editors/CubeNodeDraft.js.map +1 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.d.ts +35 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.d.ts.map +1 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.js +55 -0
- package/lib/stores/editors/CubeNodeDraftRegistry.js.map +1 -0
- package/lib/stores/editors/CubeRenameDraft.d.ts +44 -0
- package/lib/stores/editors/CubeRenameDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeRenameDraft.js +79 -0
- package/lib/stores/editors/CubeRenameDraft.js.map +1 -0
- package/lib/stores/editors/CubeRestrictDraft.d.ts +37 -0
- package/lib/stores/editors/CubeRestrictDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeRestrictDraft.js +73 -0
- package/lib/stores/editors/CubeRestrictDraft.js.map +1 -0
- package/lib/stores/editors/CubeRowCountDraft.d.ts +42 -0
- package/lib/stores/editors/CubeRowCountDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeRowCountDraft.js +55 -0
- package/lib/stores/editors/CubeRowCountDraft.js.map +1 -0
- package/lib/stores/editors/CubeSliceDraft.d.ts +42 -0
- package/lib/stores/editors/CubeSliceDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeSliceDraft.js +72 -0
- package/lib/stores/editors/CubeSliceDraft.js.map +1 -0
- package/lib/stores/editors/CubeSortDraft.d.ts +49 -0
- package/lib/stores/editors/CubeSortDraft.d.ts.map +1 -0
- package/lib/stores/editors/CubeSortDraft.js +99 -0
- package/lib/stores/editors/CubeSortDraft.js.map +1 -0
- package/lib/stores/fixtures/CubeNorthwindModel.d.ts +23 -0
- package/lib/stores/fixtures/CubeNorthwindModel.d.ts.map +1 -0
- package/lib/stores/fixtures/CubeNorthwindModel.js +338 -0
- package/lib/stores/fixtures/CubeNorthwindModel.js.map +1 -0
- package/package.json +81 -3
- package/src/__lib__/LegendCubeCommand.ts +44 -0
- package/src/__lib__/LegendCubeHelpText.ts +58 -0
- package/src/__lib__/LegendCubeLabels.ts +171 -0
- package/src/__lib__/LegendCubeTesting.ts +33 -0
- package/src/__test-utils__/CubeCanvasTestUtils.ts +53 -0
- package/src/__test-utils__/CubeEngineTestSupport.ts +172 -0
- package/src/__test-utils__/CubeNorthwindTestQueries.ts +165 -0
- package/src/__test-utils__/CubeOperationsTestUtils.ts +177 -0
- package/src/__test-utils__/CubePageTestUtils.tsx +96 -0
- package/src/__test-utils__/CubeTestApplication.ts +82 -0
- package/src/__test-utils__/FakeCubeEngine.ts +145 -0
- package/src/components/CubeButton.tsx +35 -0
- package/src/components/CubeEditor.tsx +239 -0
- package/src/components/CubeNodeIcon.tsx +64 -0
- package/src/components/canvas/CubeCanvas.tsx +262 -0
- package/src/components/canvas/CubeCanvasContext.ts +31 -0
- package/src/components/canvas/CubeCanvasContextMenu.tsx +89 -0
- package/src/components/canvas/CubeCanvasDnd.ts +82 -0
- package/src/components/canvas/CubeCanvasEdge.tsx +57 -0
- package/src/components/canvas/CubeCanvasElements.ts +153 -0
- package/src/components/canvas/CubeCanvasLayout.ts +88 -0
- package/src/components/canvas/CubeCanvasNode.tsx +149 -0
- package/src/components/editors/CubeColumnPicker.tsx +138 -0
- package/src/components/editors/CubeDistinctEditor.tsx +28 -0
- package/src/components/editors/CubeFilterEditor.tsx +309 -0
- package/src/components/editors/CubeIntegerField.tsx +51 -0
- package/src/components/editors/CubeJoinEditor.tsx +247 -0
- package/src/components/editors/CubeNodeEditorPanel.tsx +215 -0
- package/src/components/editors/CubeNodeEditorRegistry.ts +81 -0
- package/src/components/editors/CubeRenameEditor.tsx +143 -0
- package/src/components/editors/CubeRestrictEditor.tsx +103 -0
- package/src/components/editors/CubeRowCountEditor.tsx +53 -0
- package/src/components/editors/CubeSliceEditor.tsx +69 -0
- package/src/components/editors/CubeSortEditor.tsx +206 -0
- package/src/components/editors/CubeSourceEditor.tsx +106 -0
- package/src/components/editors/CubeValueEditor.tsx +333 -0
- package/src/components/grid/CubeGridRegion.tsx +275 -0
- package/src/components/grid/CubeGridValues.ts +125 -0
- package/src/components/grid/CubeResultGrid.tsx +138 -0
- package/src/components/palette/CubePalette.tsx +177 -0
- package/src/components/show-pure/CubeShowPureDialog.tsx +101 -0
- package/src/components/source-picker/CubeSourcePicker.tsx +304 -0
- package/src/components/spec-transfer/CubeSpecTransferDialog.tsx +157 -0
- package/src/graph-manager/CubeEngine.ts +169 -0
- package/src/graph-manager/CubeModelOutlineHelper.ts +58 -0
- package/src/graph-manager/protocol/pure/CubeEngineBuilder.ts +34 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.ts +109 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.ts +115 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.ts +257 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.ts +243 -0
- package/src/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.ts +58 -0
- package/src/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.ts +278 -0
- package/src/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.ts +127 -0
- package/src/index.ts +41 -0
- package/src/stores/CubeEditorState.ts +807 -0
- package/src/stores/CubeExecutionState.ts +288 -0
- package/src/stores/CubeGridQuickActions.ts +129 -0
- package/src/stores/CubeHost.ts +32 -0
- package/src/stores/CubeNodeEditorState.ts +324 -0
- package/src/stores/CubeShowPureState.ts +118 -0
- package/src/stores/CubeSourcePickerState.ts +426 -0
- package/src/stores/CubeSpecTransferState.ts +198 -0
- package/src/stores/LocalModelCatalog.ts +70 -0
- package/src/stores/editors/CubeFilterDraft.ts +241 -0
- package/src/stores/editors/CubeIntegerText.ts +34 -0
- package/src/stores/editors/CubeJoinDraft.ts +224 -0
- package/src/stores/editors/CubeNodeDraft.ts +46 -0
- package/src/stores/editors/CubeNodeDraftRegistry.ts +83 -0
- package/src/stores/editors/CubeRenameDraft.ts +110 -0
- package/src/stores/editors/CubeRestrictDraft.ts +83 -0
- package/src/stores/editors/CubeRowCountDraft.ts +69 -0
- package/src/stores/editors/CubeSliceDraft.ts +87 -0
- package/src/stores/editors/CubeSortDraft.ts +135 -0
- package/src/stores/fixtures/CubeNorthwindModel.ts +355 -0
- package/tsconfig.json +133 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { clsx } from '@finos/legend-art';
|
|
18
|
+
import { DataGrid, } from '@finos/legend-lego/data-grid';
|
|
19
|
+
import { memo, useCallback, useMemo } from 'react';
|
|
20
|
+
import { NULL_CELL_TEXT } from '../../__lib__/LegendCubeLabels.js';
|
|
21
|
+
import { LEGEND_CUBE_TEST_ID } from '../../__lib__/LegendCubeTesting.js';
|
|
22
|
+
import { getCubeGridQuickActions } from '../../stores/CubeGridQuickActions.js';
|
|
23
|
+
import { compareCellValues, isNumericFamily } from './CubeGridValues.js';
|
|
24
|
+
/** A column's id in the grid: its position, as `c<position>` */
|
|
25
|
+
const COLUMN_ID_PREFIX = 'c';
|
|
26
|
+
/**
|
|
27
|
+
* The grid's context menu (spec §12.4): on a cell, its quick actions, then
|
|
28
|
+
* ag-grid's own items, which M7 curates; elsewhere ag-grid's only. Read when
|
|
29
|
+
* the menu opens, so it reflects the cube and the run as they are then.
|
|
30
|
+
*/
|
|
31
|
+
export const getCubeGridContextMenuItems = (editorState, params) => {
|
|
32
|
+
const defaultItems = params.defaultItems ?? [];
|
|
33
|
+
const colId = params.column?.getColId();
|
|
34
|
+
if (!colId?.startsWith(COLUMN_ID_PREFIX)) {
|
|
35
|
+
return defaultItems;
|
|
36
|
+
}
|
|
37
|
+
const position = Number(colId.slice(COLUMN_ID_PREFIX.length));
|
|
38
|
+
const cell = params.node?.data?.[position] ?? null;
|
|
39
|
+
const actions = getCubeGridQuickActions(editorState, position, cell);
|
|
40
|
+
if (!actions.length) {
|
|
41
|
+
return defaultItems;
|
|
42
|
+
}
|
|
43
|
+
return [
|
|
44
|
+
...actions.map((quickAction) => {
|
|
45
|
+
const tooltip = quickAction.disabledReason ?? quickAction.hint;
|
|
46
|
+
return {
|
|
47
|
+
name: quickAction.label,
|
|
48
|
+
disabled: quickAction.disabledReason !== undefined,
|
|
49
|
+
...(tooltip === undefined ? {} : { tooltip }),
|
|
50
|
+
action: () => quickAction.apply(),
|
|
51
|
+
};
|
|
52
|
+
}),
|
|
53
|
+
'separator',
|
|
54
|
+
...defaultItems,
|
|
55
|
+
];
|
|
56
|
+
};
|
|
57
|
+
const CubeCell = (props) => props.value === null || props.value === undefined ? (_jsx("span", { className: "text-[var(--color-text-muted)]", children: NULL_CELL_TEXT })) : (_jsx(_Fragment, { children: String(props.value) }));
|
|
58
|
+
/**
|
|
59
|
+
* The rows of a run (PLAN §9): columns from Cube's own schema of the capture
|
|
60
|
+
* node, by position, so any column name works. Numbers are right-aligned and
|
|
61
|
+
* shown and sorted exactly as the engine wrote them. A cell's context menu
|
|
62
|
+
* offers the quick actions (`getCubeGridContextMenuItems`).
|
|
63
|
+
*/
|
|
64
|
+
export const CubeResultGrid = memo((props) => {
|
|
65
|
+
const { editorState, result, darkMode } = props;
|
|
66
|
+
const getContextMenuItems = useCallback((params) => getCubeGridContextMenuItems(editorState, params), [editorState]);
|
|
67
|
+
const columnDefs = useMemo(() => result.schema.columns.map((column, position) => {
|
|
68
|
+
const numeric = isNumericFamily(column.type.family);
|
|
69
|
+
return {
|
|
70
|
+
colId: `${COLUMN_ID_PREFIX}${position}`,
|
|
71
|
+
headerName: column.name,
|
|
72
|
+
headerTooltip: `${column.type.displayName}${column.nullable ? '?' : ''} (${column.type.fullName})`,
|
|
73
|
+
valueGetter: (params) => params.data?.[position] ?? null,
|
|
74
|
+
cellRenderer: CubeCell,
|
|
75
|
+
...(numeric
|
|
76
|
+
? { type: 'rightAligned', comparator: compareCellValues }
|
|
77
|
+
: {}),
|
|
78
|
+
};
|
|
79
|
+
}), [result]);
|
|
80
|
+
return (_jsx("div", { className: clsx('h-full w-full', {
|
|
81
|
+
'ag-theme-balham': !darkMode,
|
|
82
|
+
'ag-theme-balham-dark': darkMode,
|
|
83
|
+
}), "data-testid": LEGEND_CUBE_TEST_ID.RESULT_GRID, children: _jsx(DataGrid, { rowData: result.rows, columnDefs: columnDefs, suppressFieldDotNotation: true, tooltipShowDelay: 500, getContextMenuItems: getContextMenuItems }) }));
|
|
84
|
+
});
|
|
85
|
+
CubeResultGrid.displayName = 'CubeResultGrid';
|
|
86
|
+
//# sourceMappingURL=CubeResultGrid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeResultGrid.js","sourceRoot":"","sources":["../../../src/components/grid/CubeResultGrid.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EACL,QAAQ,GAMT,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAIzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAIzE,gEAAgE;AAChE,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAE7B;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,WAA4B,EAC5B,MAAkD,EACU,EAAE;IAC9D,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,IAAI,EAAE,CAAC;IAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC;IACxC,IAAI,CAAC,KAAK,EAAE,U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,iBACW,mBAAmB,CAAC,WAAW,YAE5C,KAAC,QAAQ,IACP,OAAO,EAAE,MAAM,CAAC,IAAiB,EACjC,UAAU,EAAE,UAAU,EACtB,wBAAwB,EAAE,IAAI,EAC9B,gBAAgB,EAAE,GAAG,EACrB,mBAAmB,EAAE,mBAAmB,GACxC,GACE,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AACF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { CubeEditorState } from '../../stores/CubeEditorState.js';
|
|
17
|
+
/** Shown in the palette while the cube has no node yet (spec §17.2, worded for the canvas) */
|
|
18
|
+
export declare const PALETTE_EMPTY_HINT = "Drag items onto the canvas.";
|
|
19
|
+
/**
|
|
20
|
+
* The sidebar of node types to add (spec §17.2): the sources, then the
|
|
21
|
+
* transforms in menu order, read from the registry, as the context menu is.
|
|
22
|
+
* Collapsed, it shows icons only; that choice is kept per user.
|
|
23
|
+
*/
|
|
24
|
+
export declare const CubePalette: ((props: {
|
|
25
|
+
editorState: CubeEditorState;
|
|
26
|
+
}) => import("react/jsx-runtime").JSX.Element) & {
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=CubePalette.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubePalette.d.ts","sourceRoot":"","sources":["../../../src/components/palette/CubePalette.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOvE,8FAA8F;AAC9F,eAAO,MAAM,kBAAkB,gCAAgC,CAAC;AA+EhE;;;;GAIG;AACH,eAAO,MAAM,WAAW,WACd;IAAE,WAAW,EAAE,eAAe,CAAA;CAAE;;CA4DzC,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { ChevronLeftIcon, ChevronRightIcon, clsx } from '@finos/legend-art';
|
|
18
|
+
import { observer } from 'mobx-react-lite';
|
|
19
|
+
import { useRef } from 'react';
|
|
20
|
+
import { useDrag } from 'react-dnd';
|
|
21
|
+
import { READ_ONLY_CUBE_TITLE } from '../../__lib__/LegendCubeLabels.js';
|
|
22
|
+
import { LEGEND_CUBE_TEST_ID } from '../../__lib__/LegendCubeTesting.js';
|
|
23
|
+
import { CUBE_DND_TYPE, } from '../canvas/CubeCanvasDnd.js';
|
|
24
|
+
import { CubeNodeIcon } from '../CubeNodeIcon.js';
|
|
25
|
+
/** Shown in the palette while the cube has no node yet (spec §17.2, worded for the canvas) */
|
|
26
|
+
export const PALETTE_EMPTY_HINT = 'Drag items onto the canvas.';
|
|
27
|
+
/** What an item does, for its tooltip */
|
|
28
|
+
const describeItem = (definition) => definition.kind === 'source'
|
|
29
|
+
? 'Click, or drop it on the canvas, to pick a table'
|
|
30
|
+
: 'Drag it onto a node to add it after that node, or onto the canvas to add it on its own; click to add it on its own';
|
|
31
|
+
const CubePaletteItem = observer((props) => {
|
|
32
|
+
const { editorState, definition, collapsed } = props;
|
|
33
|
+
const { readOnly } = editorState;
|
|
34
|
+
const ref = useRef(null);
|
|
35
|
+
const [, dragConnector] = useDrag(() => ({
|
|
36
|
+
type: CUBE_DND_TYPE.PALETTE_ITEM,
|
|
37
|
+
item: { nodeType: definition.type },
|
|
38
|
+
canDrag: () => !editorState.readOnly,
|
|
39
|
+
}), [editorState, definition.type]);
|
|
40
|
+
dragConnector(ref);
|
|
41
|
+
const label = `${definition.label}${definition.beta ? ' (BETA)' : ''}`;
|
|
42
|
+
const add = () => {
|
|
43
|
+
if (!readOnly) {
|
|
44
|
+
editorState.addNode(definition.type);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return (
|
|
48
|
+
// a div, not a button: browsers won't drag a button
|
|
49
|
+
_jsxs("div", { ref: ref, role: "button", tabIndex: readOnly ? -1 : 0, "aria-disabled": readOnly, "aria-label": label, className: clsx('flex h-8 shrink-0 items-center gap-2 px-3 text-base', readOnly
|
|
50
|
+
? 'cursor-not-allowed text-[var(--color-text-disabled)]'
|
|
51
|
+
: 'cursor-grab hover:bg-[var(--color-bg-hover)]'), title: readOnly
|
|
52
|
+
? READ_ONLY_CUBE_TITLE
|
|
53
|
+
: collapsed
|
|
54
|
+
? `${label}: ${describeItem(definition)}`
|
|
55
|
+
: describeItem(definition), onClick: add, onKeyDown: (event) => {
|
|
56
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
add();
|
|
59
|
+
}
|
|
60
|
+
}, "data-testid": LEGEND_CUBE_TEST_ID.PALETTE_ITEM, children: [_jsx(CubeNodeIcon, { icon: definition.icon, className: "shrink-0 text-[var(--color-text-secondary)]" }), !collapsed && (_jsx("span", { className: "min-w-0 flex-1 truncate", children: definition.label })), !collapsed && definition.beta && (_jsx("span", { className: "shrink-0 rounded-sm bg-[var(--color-accent)] px-1 text-xs font-medium text-[var(--color-text-on-accent)]", children: "BETA" }))] }));
|
|
61
|
+
});
|
|
62
|
+
/**
|
|
63
|
+
* The sidebar of node types to add (spec §17.2): the sources, then the
|
|
64
|
+
* transforms in menu order, read from the registry, as the context menu is.
|
|
65
|
+
* Collapsed, it shows icons only; that choice is kept per user.
|
|
66
|
+
*/
|
|
67
|
+
export const CubePalette = observer((props) => {
|
|
68
|
+
const { editorState } = props;
|
|
69
|
+
const collapsed = editorState.isPaletteCollapsed;
|
|
70
|
+
const { registry } = editorState;
|
|
71
|
+
return (_jsxs("div", { className: clsx('flex h-full shrink-0 flex-col border-r border-[var(--color-border-default)] bg-[var(--color-bg-panel)]', collapsed ? 'w-10' : 'w-56'), "data-testid": LEGEND_CUBE_TEST_ID.PALETTE, children: [_jsxs("div", { className: "flex h-8 shrink-0 items-center border-b border-[var(--color-border-default)] bg-[var(--color-bg-panel-header)] px-2", children: [!collapsed && (_jsx("span", { className: "min-w-0 flex-1 truncate text-base font-medium", children: "Add to the query" })), _jsx("button", { className: "flex h-6 w-6 shrink-0 items-center justify-center text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)]", title: collapsed ? 'Expand the palette' : 'Collapse the palette', onClick: () => editorState.setPaletteCollapsed(!collapsed), children: collapsed ? _jsx(ChevronRightIcon, {}) : _jsx(ChevronLeftIcon, {}) })] }), _jsxs("div", { className: "flex min-h-0 shrink flex-col overflow-auto py-1", role: "group", "aria-label": "Palette", children: [registry.sources.map((definition) => (_jsx(CubePaletteItem, { editorState: editorState, definition: definition, collapsed: collapsed }, definition.type))), _jsx("div", { className: "mx-2 my-1 shrink-0 border-t border-[var(--color-border-default)]", role: "separator" }), registry.transforms.map((definition) => (_jsx(CubePaletteItem, { editorState: editorState, definition: definition, collapsed: collapsed }, definition.type)))] }), !collapsed && editorState.document.query.isEmpty && (_jsx("div", { className: "shrink-0 px-3 py-2 text-sm text-[var(--color-text-muted)]", children: PALETTE_EMPTY_HINT }))] }));
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=CubePalette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubePalette.js","sourceRoot":"","sources":["../../../src/components/palette/CubePalette.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EACL,aAAa,GAEd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,8FAA8F;AAC9F,MAAM,CAAC,MAAM,kBAAkB,GAAG,6BAA6B,CAAC;AAEhE,yCAAyC;AACzC,MAAM,YAAY,GAAG,CAAC,UAA6B,EAAU,EAAE,CAC7D,UAAU,CAAC,IAAI,KAAK,QAAQ;IAC1B,CAAC,CAAC,kDAAkD;IACpD,CAAC,CAAC,oHAAoH,CAAC;AAE3H,MAAM,eAAe,GAAG,QAAQ,CAC9B,CAAC,KAIA,EAAE,EAAE;IACH,MAAM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AE,GAAG,EAAE,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,SAAS,CAAC,YAEzD,SAAS,CAAC,CAAC,CAAC,KAAC,gBAAgB,KAAG,CAAC,CAAC,CAAC,KAAC,eAAe,KAAG,GAChD,IACL,EACN,eACE,SAAS,EAAC,iDAAiD,EAC3D,IAAI,EAAC,OAAO,gBACD,SAAS,aAEnB,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CACpC,KAAC,eAAe,IAEd,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,IAHf,UAAU,CAAC,IAAI,CAIpB,CACH,CAAC,EACF,cACE,SAAS,EAAC,kEAAkE,EAC5E,IAAI,EAAC,WAAW,GAChB,EACD,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CACvC,KAAC,eAAe,IAEd,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,IAHf,UAAU,CAAC,IAAI,CAIpB,CACH,CAAC,IACE,EACL,CAAC,SAAS,IAAI,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,IAAI,CACnD,cAAK,SAAS,EAAC,2DAA2D,YACvE,kBAAkB,GACf,CACP,IACG,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { CubeEditorState } from '../../stores/CubeEditorState.js';
|
|
17
|
+
/** The Pure text of what Execute would run, read-only, with Copy */
|
|
18
|
+
export declare const CubeShowPureDialog: ((props: {
|
|
19
|
+
editorState: CubeEditorState;
|
|
20
|
+
}) => import("react/jsx-runtime").JSX.Element) & {
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=CubeShowPureDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeShowPureDialog.d.ts","sourceRoot":"","sources":["../../../src/components/show-pure/CubeShowPureDialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAaH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAEvE,oEAAoE;AACpE,eAAO,MAAM,kBAAkB,WACrB;IAAE,WAAW,EAAE,eAAe,CAAA;CAAE;;CAqEzC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { Dialog, Modal, ModalBody, ModalFooter, ModalFooterButton, ModalHeader, PanelLoadingIndicator, } from '@finos/legend-art';
|
|
18
|
+
import { observer } from 'mobx-react-lite';
|
|
19
|
+
import { CUBE_PENDING_LABEL } from '../../__lib__/LegendCubeLabels.js';
|
|
20
|
+
/** The Pure text of what Execute would run, read-only, with Copy */
|
|
21
|
+
export const CubeShowPureDialog = observer((props) => {
|
|
22
|
+
const { editorState } = props;
|
|
23
|
+
const showPure = editorState.showPure;
|
|
24
|
+
const { applicationStore } = editorState.host;
|
|
25
|
+
const darkMode = !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled;
|
|
26
|
+
const { text, error } = showPure;
|
|
27
|
+
return (_jsx(Dialog, { open: showPure.isOpen, onClose: () => showPure.close(), children: _jsxs(Modal, { darkMode: darkMode, className: "w-[800px] max-w-full", children: [_jsx(ModalHeader, { children: _jsx("div", { className: "modal__title", children: "Pure query" }) }), _jsx(PanelLoadingIndicator, { isLoading: showPure.isRendering }), _jsx(ModalBody, { children: _jsxs("div", { className: "flex flex-col gap-2", children: [showPure.isRendering && (_jsx("div", { className: "text-base text-[var(--color-text-secondary)]", children: CUBE_PENDING_LABEL.RENDERING_QUERY })), text !== undefined && (_jsx("pre", { className: "max-h-[60vh] overflow-auto whitespace-pre rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] p-2 font-mono text-sm text-[var(--color-text-primary)]", "aria-label": "Pure query", children: text })), error && (_jsx("div", { className: "whitespace-pre-wrap break-words text-base text-[var(--color-status-error)]", role: "alert", children: error.detail }))] }) }), _jsxs(ModalFooter, { children: [_jsx(ModalFooterButton, { darkMode: darkMode, formatText: false, text: "Copy to Clipboard", disabled: text === undefined, onClick: () => {
|
|
28
|
+
if (text !== undefined) {
|
|
29
|
+
applicationStore.clipboardService
|
|
30
|
+
.copyTextToClipboard(text, {
|
|
31
|
+
notifySuccessMessage: 'Pure query copied to the clipboard',
|
|
32
|
+
})
|
|
33
|
+
.catch(applicationStore.alertUnhandledError);
|
|
34
|
+
}
|
|
35
|
+
} }), _jsx(ModalFooterButton, { darkMode: darkMode, formatText: false, type: "secondary", text: "Close", onClick: () => showPure.close() })] })] }) }));
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=CubeShowPureDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeShowPureDialog.js","sourceRoot":"","sources":["../../../src/components/show-pure/CubeShowPureDialog.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,MAAM,EACN,KAAK,EACL,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAGvE,oEAAoE;AACpE,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CACxC,CAAC,KAAuC,EAAE,EAAE;IAC1C,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAC9B,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;IACtC,MAAM,EAAE,gBAAgB,EAAE,GAAG,WAAW,CAAC,IAAI,CAAC;IAC9C,MAAM,QAAQ,GACZ,CAAC,gBAAgB,CAAC,aAAa,CAAC,mCAAmC,CAAC;IACtE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;IAEjC,OAAO,CACL,KAAC,MAAM,IAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,YAC5D,MAAC,KAAK,IAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAC,sBAAsB,aACzD,KAAC,WAAW,cACV,cAAK,SAAS,EAAC,cAAc,2BA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
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { CubeEditorState } from '../../stores/CubeEditorState.js';
|
|
17
|
+
export declare const CubeSourcePicker: ((props: {
|
|
18
|
+
editorState: CubeEditorState;
|
|
19
|
+
}) => import("react/jsx-runtime").JSX.Element) & {
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=CubeSourcePicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeSourcePicker.d.ts","sourceRoot":"","sources":["../../../src/components/source-picker/CubeSourcePicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoBH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AA4CvE,eAAO,MAAM,gBAAgB,WACnB;IAAE,WAAW,EAAE,eAAe,CAAA;CAAE;;CAgOzC,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { clsx, Dialog, Modal, ModalBody, ModalFooter, ModalFooterButton, ModalHeader, PanelLoadingIndicator, } from '@finos/legend-art';
|
|
18
|
+
import { getRelationalDisplayName } from '@finos/legend-cube';
|
|
19
|
+
import { flowResult } from 'mobx';
|
|
20
|
+
import { observer } from 'mobx-react-lite';
|
|
21
|
+
import { useId } from 'react';
|
|
22
|
+
import { CUBE_PENDING_LABEL, CUBE_TABLE_FLAG_LABELS, } from '../../__lib__/LegendCubeLabels.js';
|
|
23
|
+
import { isTableSelectable } from '../../stores/CubeSourcePickerState.js';
|
|
24
|
+
import { CubeButton } from '../CubeButton.js';
|
|
25
|
+
/** One step of the picker: a labelled list of choices, read-only when the cube fixes it */
|
|
26
|
+
const CubePickerStep = ({ label, value, options, disabled, onChange }) => {
|
|
27
|
+
const id = useId();
|
|
28
|
+
return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("label", { className: "w-20 shrink-0 text-base", htmlFor: id, children: label }), _jsxs("select", { id: id, className: "h-7 min-w-0 flex-1 rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] px-1 text-base text-[var(--color-text-primary)] disabled:text-[var(--color-text-secondary)]", value: value ?? '', disabled: Boolean(disabled) || !options.length, onChange: (event) => onChange(event.target.value || undefined), children: [value === undefined && _jsx("option", { value: "", children: "Choose\u2026" }), options.map((option) => (_jsx("option", { value: option.value, children: option.label }, option.value)))] })] }));
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Adds a table to the cube (PLAN §6.2.7): a minimal dialog, which M3
|
|
32
|
+
* redesigns. The table lands with its schema; the first one fixes the cube's
|
|
33
|
+
* model and runtime.
|
|
34
|
+
*/
|
|
35
|
+
/** The Model option that offers a text box for Pure text */
|
|
36
|
+
const PASTE_MODEL_OPTION = 'paste';
|
|
37
|
+
export const CubeSourcePicker = observer((props) => {
|
|
38
|
+
const { editorState } = props;
|
|
39
|
+
const picker = editorState.sourcePicker;
|
|
40
|
+
const { applicationStore } = editorState.host;
|
|
41
|
+
const darkMode = !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled;
|
|
42
|
+
const isFixed = picker.fixedContext !== undefined;
|
|
43
|
+
const fixedModelLabel = picker.models.find((model) => JSON.stringify(model.model) ===
|
|
44
|
+
JSON.stringify(picker.fixedContext?.model))?.label ?? "The cube's model";
|
|
45
|
+
const confirm = () => {
|
|
46
|
+
flowResult(picker.confirm()).catch(applicationStore.alertUnhandledError);
|
|
47
|
+
};
|
|
48
|
+
return (_jsx(Dialog, { open: picker.isOpen, onClose: () => picker.close(), children: _jsxs(Modal, { darkMode: darkMode, className: "w-[640px] max-w-full", children: [_jsx(ModalHeader, { children: _jsx("div", { className: "modal__title", children: "Add a table" }) }), _jsx(PanelLoadingIndicator, { isLoading: picker.isLoadingModel || picker.isResolving }), _jsx(ModalBody, { children: _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(CubePickerStep, { label: "Model", value: isFixed
|
|
49
|
+
? 'fixed'
|
|
50
|
+
: picker.isPastingModel
|
|
51
|
+
? PASTE_MODEL_OPTION
|
|
52
|
+
: picker.models.find((model) => model.model === picker.model)?.id, options: isFixed
|
|
53
|
+
? [{ value: 'fixed', label: fixedModelLabel }]
|
|
54
|
+
: [
|
|
55
|
+
...picker.models.map((model) => ({
|
|
56
|
+
value: model.id,
|
|
57
|
+
label: model.label,
|
|
58
|
+
})),
|
|
59
|
+
{
|
|
60
|
+
value: PASTE_MODEL_OPTION,
|
|
61
|
+
label: 'Paste Pure model…',
|
|
62
|
+
},
|
|
63
|
+
], disabled: isFixed, onChange: (id) => {
|
|
64
|
+
if (id === PASTE_MODEL_OPTION) {
|
|
65
|
+
picker.startPastingModel();
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const model = picker.models.find((candidate) => candidate.id === id);
|
|
69
|
+
if (model) {
|
|
70
|
+
flowResult(picker.selectModel(model.model)).catch(applicationStore.alertUnhandledError);
|
|
71
|
+
}
|
|
72
|
+
} }), picker.isPastingModel && !isFixed && (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("textarea", { className: "h-40 w-full resize-y rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] p-1 font-mono text-sm text-[var(--color-text-primary)]", "aria-label": "Pure model", placeholder: '###Relational\nDatabase my::Database ( … )\n\n###Runtime\nRuntime my::Runtime { … }', spellCheck: false, value: picker.pastedModelText, onChange: (event) => picker.setPastedModelText(event.target.value) }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(CubeButton, { disabled: !picker.pastedModelText.trim() || picker.isLoadingModel, onClick: () => {
|
|
73
|
+
flowResult(picker.loadPastedModel()).catch(applicationStore.alertUnhandledError);
|
|
74
|
+
}, children: "Load model" }), _jsx("span", { className: "text-sm text-[var(--color-text-muted)]", children: "The cube keeps the model's text, which counts towards the 1 MiB a cube spec can hold." })] })] })), picker.isLoadingModel && (_jsx("div", { className: "text-base text-[var(--color-text-secondary)]", children: CUBE_PENDING_LABEL.LOADING_MODEL })), _jsx(CubePickerStep, { label: "Database", value: picker.databasePath, options: picker.databases.map((database) => ({
|
|
75
|
+
value: database.path,
|
|
76
|
+
label: database.path,
|
|
77
|
+
})), disabled: picker.fixedDatabasePath !== undefined, onChange: (path) => picker.selectDatabase(path) }), _jsx(CubePickerStep, { label: "Runtime", value: picker.runtimePath, options: picker.runtimes.map((runtime) => ({
|
|
78
|
+
value: runtime.path,
|
|
79
|
+
label: runtime.path,
|
|
80
|
+
})), disabled: picker.fixedContext?.runtime !== undefined, onChange: (path) => picker.selectRuntime(path) }), _jsx(CubePickerStep, { label: "Schema", value: picker.schemaName, options: picker.schemas.map((schema) => ({
|
|
81
|
+
value: schema.name,
|
|
82
|
+
label: getRelationalDisplayName(schema.name),
|
|
83
|
+
})), onChange: (name) => picker.selectSchema(name) }), picker.schemaName !== undefined && (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("input", { className: "h-7 rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] px-1 text-base text-[var(--color-text-primary)]", placeholder: "Search tables", "aria-label": "Search tables", value: picker.tableSearch, onChange: (event) => picker.setTableSearch(event.target.value) }), _jsx("ul", { className: "h-56 overflow-auto rounded-sm border border-[var(--color-border-subtle)]", "aria-label": "Tables", children: picker.tables.map((table) => {
|
|
84
|
+
const selectable = isTableSelectable(table);
|
|
85
|
+
const isPicked = picker.tableName === table.name;
|
|
86
|
+
return (_jsx("li", { children: _jsxs("button", { type: "button", className: clsx('flex w-full items-center gap-2 px-2 py-1 text-left text-base enabled:hover:bg-[var(--color-bg-hover)] disabled:cursor-not-allowed disabled:text-[var(--color-text-disabled)]', { 'bg-[var(--color-bg-selected)]': isPicked }), "aria-pressed": isPicked, disabled: !selectable, onClick: () => picker.selectTable(table.name), children: [_jsx("span", { className: "min-w-0 flex-1 truncate", children: getRelationalDisplayName(table.name) }), table.flags.map((flag) => (_jsx("span", { className: "rounded-sm bg-[var(--color-status-warn-bg)] px-1 text-sm text-[var(--color-status-warn)]", title: CUBE_TABLE_FLAG_LABELS[flag].description, children: CUBE_TABLE_FLAG_LABELS[flag].label }, flag))), _jsxs("span", { className: "shrink-0 text-sm text-[var(--color-text-muted)]", children: [table.columnCount, " columns"] })] }) }, table.name));
|
|
87
|
+
}) })] })), picker.isResolving && (_jsx("div", { className: "text-base text-[var(--color-text-secondary)]", children: CUBE_PENDING_LABEL.RESOLVING_SOURCE })), picker.error !== undefined && (_jsx("div", { className: "text-base text-[var(--color-status-error)]", role: "alert", children: picker.error }))] }) }), _jsxs(ModalFooter, { children: [_jsx(ModalFooterButton, { darkMode: darkMode, formatText: false, text: "Add", disabled: !picker.canConfirm, onClick: confirm }), _jsx(ModalFooterButton, { darkMode: darkMode, formatText: false, type: "secondary", text: "Cancel", onClick: () => picker.close() })] })] }) }));
|
|
88
|
+
});
|
|
89
|
+
//# sourceMappingURL=CubeSourcePicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeSourcePicker.js","sourceRoot":"","sources":["../../../src/components/source-picker/CubeSourcePicker.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,IAAI,EACJ,MAAM,EACN,KAAK,EACL,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EACL,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,2FAA2F;AAC3F,MAAM,cAAc,GAMf,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;IACrD,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IACnB,OAAO,CACL,eAAK,SAAS,EAAC,yBAAyB,aACtC,gBAAO,SAAS,EAAC,yBAAyB,EAAC,OAAO,EAAE,EAAE,YACnD,KAAK,GACA,EACR,kBACE,EAAE,EAAE,EAAE,EACN,SAAS,EAAC,kMAAkM,EAC5M,KAAK,EAAE,KAAK,IAAI,EAAE,EAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAC9C,QAAQ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,SAAS,IAAI,CAC7B,cACE,SAAS,EAAC,4CAA4C,EACtD,IAAI,EAAC,OAAO,YAEX,MAAM,CAAC,KAAK,GACT,CACP,IACG,GACI,EACZ,MAAC,WAAW,eACV,KAAC,iBAAiB,IAChB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,KAAK,EACjB,IAAI,EAAC,KAAK,EACV,QAAQ,EAAE,CAAC,MAAM,CAAC,UAAU,EAC5B,OAAO,EAAE,OAAO,GAChB,EACF,KAAC,iBAAiB,IAChB,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,KAAK,EACjB,IAAI,EAAC,WAAW,EAChB,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,GAC7B,IACU,IACR,GACD,CACV,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { CubeEditorState } from '../../stores/CubeEditorState.js';
|
|
17
|
+
/**
|
|
18
|
+
* Export and Import of the cube's saved spec, as text to copy, download,
|
|
19
|
+
* paste or read from a file (PLAN §10.3; developer tools until M8).
|
|
20
|
+
*/
|
|
21
|
+
export declare const CubeSpecTransferDialog: ((props: {
|
|
22
|
+
editorState: CubeEditorState;
|
|
23
|
+
}) => import("react/jsx-runtime").JSX.Element) & {
|
|
24
|
+
displayName: string;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=CubeSpecTransferDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeSpecTransferDialog.d.ts","sourceRoot":"","sources":["../../../src/components/spec-transfer/CubeSpecTransferDialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAaH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAMvE;;;GAGG;AACH,eAAO,MAAM,sBAAsB,WACzB;IAAE,WAAW,EAAE,eAAe,CAAA;CAAE;;CAsHzC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2026-present, Goldman Sachs
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import { Dialog, Modal, ModalBody, ModalFooter, ModalFooterButton, ModalHeader, PanelLoadingIndicator, } from '@finos/legend-art';
|
|
18
|
+
import { flowResult } from 'mobx';
|
|
19
|
+
import { observer } from 'mobx-react-lite';
|
|
20
|
+
import { CUBE_SPEC_TRANSFER_MODE } from '../../stores/CubeSpecTransferState.js';
|
|
21
|
+
const TEXT_AREA_CLASS_NAME = 'h-80 w-full resize-none rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] p-1 font-mono text-sm text-[var(--color-text-primary)]';
|
|
22
|
+
/**
|
|
23
|
+
* Export and Import of the cube's saved spec, as text to copy, download,
|
|
24
|
+
* paste or read from a file (PLAN §10.3; developer tools until M8).
|
|
25
|
+
*/
|
|
26
|
+
export const CubeSpecTransferDialog = observer((props) => {
|
|
27
|
+
const { editorState } = props;
|
|
28
|
+
const transfer = editorState.specTransfer;
|
|
29
|
+
const { applicationStore } = editorState.host;
|
|
30
|
+
const darkMode = !applicationStore.layoutService.TEMPORARY__isLightColorThemeEnabled;
|
|
31
|
+
const isExport = transfer.mode === CUBE_SPEC_TRANSFER_MODE.EXPORT;
|
|
32
|
+
return (_jsx(Dialog, { open: transfer.mode !== undefined, onClose: () => transfer.close(), children: _jsxs(Modal, { darkMode: darkMode, className: "w-[720px] max-w-full", children: [_jsx(ModalHeader, { children: _jsx("div", { className: "modal__title", children: isExport ? 'Export spec (dev)' : 'Import spec (dev)' }) }), _jsx(PanelLoadingIndicator, { isLoading: transfer.isReadingFile }), _jsx(ModalBody, { children: _jsxs("div", { className: "flex flex-col gap-2", children: [isExport ? (transfer.exportText !== undefined && (_jsx("textarea", { className: TEXT_AREA_CLASS_NAME, "aria-label": "Cube spec", readOnly: true, value: transfer.exportText }))) : (_jsxs(_Fragment, { children: [_jsx("div", { className: "text-base text-[var(--color-text-secondary)]", children: "Paste a cube spec, or choose a .cube.json file. The spec replaces this cube; Undo brings it back." }), _jsx("input", { className: "text-base", type: "file", accept: ".json,application/json", "aria-label": "Spec file", onChange: (event) => {
|
|
33
|
+
const file = event.target.files?.[0];
|
|
34
|
+
// the same file can be chosen again
|
|
35
|
+
event.target.value = '';
|
|
36
|
+
if (file) {
|
|
37
|
+
flowResult(transfer.readImportFile(file)).catch(applicationStore.alertUnhandledError);
|
|
38
|
+
}
|
|
39
|
+
} }), _jsx("textarea", { className: TEXT_AREA_CLASS_NAME, "aria-label": "Cube spec", placeholder: "Cube spec", spellCheck: false, value: transfer.importText, onChange: (event) => transfer.setImportText(event.target.value) })] })), transfer.error !== undefined && (_jsx("div", { className: "break-words text-base text-[var(--color-status-error)]", role: "alert", children: transfer.error }))] }) }), _jsxs(ModalFooter, { children: [isExport ? (_jsxs(_Fragment, { children: [_jsx(ModalFooterButton, { darkMode: darkMode, formatText: false, text: "Copy", disabled: transfer.exportText === undefined, onClick: () => {
|
|
40
|
+
transfer
|
|
41
|
+
.copyExport()
|
|
42
|
+
.catch(applicationStore.alertUnhandledError);
|
|
43
|
+
} }), _jsx(ModalFooterButton, { darkMode: darkMode, formatText: false, text: "Download", disabled: transfer.exportText === undefined, onClick: () => transfer.downloadExport() })] })) : (_jsx(ModalFooterButton, { darkMode: darkMode, formatText: false, text: "Import", disabled: !transfer.importText.trim() || transfer.isReadingFile, onClick: () => transfer.importSpec() })), _jsx(ModalFooterButton, { darkMode: darkMode, formatText: false, type: "secondary", text: isExport ? 'Close' : 'Cancel', onClick: () => transfer.close() })] })] }) }));
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=CubeSpecTransferDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubeSpecTransferDialog.js","sourceRoot":"","sources":["../../../src/components/spec-transfer/CubeSpecTransferDialog.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,MAAM,EACN,KAAK,EACL,SAAS,EACT,WAAW,EACX,iBAAiB,EACjB,WAAW,EACX,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,MAAM,oBAAoB,GACxB,kKAAkK,CAAC;AAErK;;;GAGG;AACH,M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