@malloy-publisher/sdk 0.9.7 → 0.9.8
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/README.md +117 -17
- package/dist/{RenderedResult-qnpbr4tc.cjs.js → RenderedResult-BrvrMDAP.cjs.js} +1 -1
- package/dist/{RenderedResult-CkUS04tl.es.js → RenderedResult-DZj-FnOJ.es.js} +2 -2
- package/dist/{ServerProvider-DnLLeXEX.es.js → ServerProvider-B_bPAsu2.es.js} +583 -398
- package/dist/ServerProvider-DuEOzwPc.cjs.js +1 -0
- package/dist/builder/index.cjs.js +93 -93
- package/dist/builder/index.es.js +4630 -4562
- package/dist/builder-entry.d.ts +13 -12
- package/dist/client/api.d.ts +472 -94
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +105 -95
- package/dist/components/Dashboard/DashboardTile.d.ts +3 -1
- package/dist/components/Dashboard/DashboardView.d.ts +1 -3
- package/dist/components/Dashboard/index.d.ts +0 -2
- package/dist/components/DocumentCreate/createDocument.d.ts +29 -9
- package/dist/components/DocumentCreate/documentPath.d.ts +21 -6
- package/dist/components/DocumentCreate/guards.d.ts +2 -3
- package/dist/components/DocumentCreate/index.d.ts +2 -3
- package/dist/components/DocumentCreate/newNotebook.d.ts +14 -5
- package/dist/components/DocumentStorage/BrowserDocumentStorage.d.ts +6 -0
- package/dist/components/DocumentStorage/DocumentStorage.d.ts +52 -24
- package/dist/components/Loading.d.ts +1 -1
- package/dist/components/Package/DataSchemaDialog.d.ts +26 -0
- package/dist/components/Package/NewDocumentDialog.d.ts +19 -10
- package/dist/components/Package/Package.d.ts +14 -9
- package/dist/components/Package/documentLocation.d.ts +66 -23
- package/dist/components/Package/index.d.ts +3 -2
- package/dist/components/Package/reportQueries.d.ts +8 -0
- package/dist/components/Package/useDocumentLocation.d.ts +36 -6
- package/dist/components/Package/useDraftLayout.d.ts +20 -0
- package/dist/components/Report/CellReport.d.ts +89 -0
- package/dist/components/Report/LinearReport.d.ts +18 -0
- package/dist/components/Report/Report.d.ts +62 -0
- package/dist/components/Report/index.d.ts +2 -0
- package/dist/components/Report/telemetry.d.ts +163 -0
- package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderDialogs.d.ts +2 -2
- package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderGrid.d.ts +2 -2
- package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderHeader.d.ts +5 -4
- package/dist/components/{DashboardBuilder → ReportBuilder}/BuilderToolbar.d.ts +5 -1
- package/dist/components/{DashboardBuilder → ReportBuilder}/EditorSurface.d.ts +10 -7
- package/dist/components/{DashboardBuilder/DashboardBuilder.d.ts → ReportBuilder/ReportBuilder.d.ts} +17 -8
- package/dist/components/{DashboardBuilder/DashboardEditor.d.ts → ReportBuilder/ReportEditor.d.ts} +41 -14
- package/dist/components/ReportBuilder/builderReport.d.ts +14 -0
- package/dist/components/{DashboardBuilder → ReportBuilder}/catalog.d.ts +8 -5
- package/dist/components/{DashboardBuilder → ReportBuilder}/document.d.ts +3 -4
- package/dist/components/{DashboardBuilder → ReportBuilder}/documentSession.d.ts +1 -1
- package/dist/components/{DashboardBuilder → ReportBuilder}/imports.d.ts +5 -1
- package/dist/components/{DashboardBuilder → ReportBuilder}/malloyTree.d.ts +9 -0
- package/dist/components/{DashboardBuilder → ReportBuilder}/newDashboard.d.ts +7 -1
- package/dist/components/{DashboardBuilder → ReportBuilder}/readDocument.d.ts +7 -5
- package/dist/components/{DashboardBuilder → ReportBuilder}/readForEditor.d.ts +1 -1
- package/dist/components/ReportBuilder/reportTag.d.ts +52 -0
- package/dist/components/{DashboardBuilder → ReportBuilder}/spliceDocument.d.ts +1 -7
- package/dist/components/{DashboardBuilder → ReportBuilder}/useBuilderSelection.d.ts +2 -2
- package/dist/components/{DashboardBuilder → ReportBuilder}/useControlBindings.d.ts +2 -2
- package/dist/components/ReportBuilder/useEditorCatalog.d.ts +25 -0
- package/dist/components/{DashboardBuilder → ReportBuilder}/useHostCopy.d.ts +5 -3
- package/dist/components/{DashboardBuilder → ReportBuilder}/useOpenedDocument.d.ts +7 -5
- package/dist/components/{DashboardBuilder/useDashboardEditor.d.ts → ReportBuilder/useReportEditor.d.ts} +3 -7
- package/dist/components/{DashboardBuilder → ReportBuilder}/useSaveChannel.d.ts +6 -4
- package/dist/components/{DashboardBuilder → ReportBuilder}/useTileEditing.d.ts +2 -2
- package/dist/components/ServerProvider.d.ts +2 -1
- package/dist/components/drill/resolveDrill.d.ts +8 -1
- package/dist/components/drill/useDrillSelf.d.ts +4 -2
- package/dist/components/index.d.ts +2 -1
- package/dist/components/{Dashboard → legacy}/Dashboard.d.ts +15 -9
- package/dist/components/legacy/MalloynbCells.d.ts +13 -0
- package/dist/components/legacy/Notebook.d.ts +15 -0
- package/dist/components/{DashboardBuilder → legacy}/NotebookEditor.d.ts +3 -3
- package/dist/components/legacy/builderNames.d.ts +10 -0
- package/dist/components/legacy/index.d.ts +11 -0
- package/dist/components/legacy/kindAdapter.d.ts +11 -0
- package/dist/components/legacy/kindTypedDrafts.d.ts +10 -0
- package/dist/components/legacy/nameAlias.d.ts +44 -0
- package/dist/components/legacy/queryKeys.d.ts +8 -0
- package/dist/index.cjs.js +19 -19
- package/dist/index.es.js +7984 -7452
- package/dist/text/index.es.js +2 -2
- package/dist/{text-entry-CA0LZ1xL.es.js → text-entry-72YFLeNk.es.js} +10 -10
- package/dist/useCompiledDocument-oocN5cGE.cjs.js +141 -0
- package/dist/{useCompiledDocument-Bf72Ob5v.es.js → useCompiledDocument-x0B2RAH3.es.js} +4593 -4395
- package/package.json +2 -2
- package/src/builder-entry.ts +32 -24
- package/src/components/Dashboard/DashboardTile.tsx +17 -0
- package/src/components/Dashboard/DashboardView.spec.tsx +0 -21
- package/src/components/Dashboard/DashboardView.tsx +8 -24
- package/src/components/Dashboard/dropValueUrlTags.spec.ts +1 -4
- package/src/components/Dashboard/index.ts +0 -2
- package/src/components/DocumentCreate/createDocument.spec.ts +346 -53
- package/src/components/DocumentCreate/createDocument.ts +143 -63
- package/src/components/DocumentCreate/documentPath.ts +41 -12
- package/src/components/DocumentCreate/guards.ts +7 -15
- package/src/components/DocumentCreate/index.ts +3 -7
- package/src/components/DocumentCreate/newNotebook.spec.ts +113 -43
- package/src/components/DocumentCreate/newNotebook.ts +32 -10
- package/src/components/DocumentStorage/BrowserDocumentStorage.spec.ts +130 -28
- package/src/components/DocumentStorage/BrowserDocumentStorage.ts +78 -40
- package/src/components/DocumentStorage/DocumentStorage.contract.spec.tsx +426 -0
- package/src/components/DocumentStorage/DocumentStorage.ts +57 -24
- package/src/components/Home/AddEnvironmentDialog.tsx +1 -1
- package/src/components/Home/Home.tsx +1 -1
- package/src/components/Loading.tsx +1 -1
- package/src/components/Model/SourcesExplorer.tsx +1 -1
- package/src/components/Notebook/NotebookCell.tsx +6 -5
- package/src/components/Notebook/cellKind.spec.ts +15 -7
- package/src/components/Package/DataSchemaDialog.spec.tsx +85 -0
- package/src/components/Package/DataSchemaDialog.tsx +367 -0
- package/src/components/Package/NewDocumentDialog.spec.tsx +145 -88
- package/src/components/Package/NewDocumentDialog.tsx +93 -48
- package/src/components/Package/Package.artifacts.spec.tsx +79 -60
- package/src/components/Package/Package.create.spec.tsx +126 -112
- package/src/components/Package/Package.notebooks.spec.tsx +46 -27
- package/src/components/Package/Package.spec.tsx +43 -30
- package/src/components/Package/Package.tsx +173 -292
- package/src/components/Package/documentLocation.spec.ts +145 -50
- package/src/components/Package/documentLocation.ts +118 -39
- package/src/components/Package/index.ts +12 -3
- package/src/components/Package/reportQueries.ts +25 -0
- package/src/components/Package/useDocumentLocation.spec.ts +58 -0
- package/src/components/Package/useDocumentLocation.ts +90 -32
- package/src/components/Package/useDraftLayout.spec.tsx +143 -0
- package/src/components/Package/useDraftLayout.ts +81 -0
- package/src/components/Prose.spec.tsx +3 -3
- package/src/components/RenderedResult/RenderedResult.tsx +1 -1
- package/src/components/Report/CellReport.spec.tsx +155 -0
- package/src/components/{Notebook/Notebook.tsx → Report/CellReport.tsx} +178 -220
- package/src/components/Report/LinearReport.tsx +71 -0
- package/src/components/Report/Report.spec.tsx +238 -0
- package/src/components/Report/Report.telemetry.spec.tsx +292 -0
- package/src/components/Report/Report.tsx +277 -0
- package/src/components/Report/index.ts +12 -0
- package/src/components/Report/telemetry.spec.ts +90 -0
- package/src/components/Report/telemetry.ts +250 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/BuilderDialogs.tsx +5 -5
- package/src/components/{DashboardBuilder → ReportBuilder}/BuilderGrid.tsx +2 -2
- package/src/components/{DashboardBuilder → ReportBuilder}/BuilderHeader.tsx +6 -7
- package/src/components/{DashboardBuilder → ReportBuilder}/BuilderToolbar.tsx +33 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/DrillDialog.tsx +2 -2
- package/src/components/{DashboardBuilder → ReportBuilder}/EditorSurface.tsx +67 -107
- package/src/components/{DashboardBuilder → ReportBuilder}/FilterDialog.tsx +3 -4
- package/src/components/{DashboardBuilder/DashboardBuilder.charts.spec.tsx → ReportBuilder/ReportBuilder.charts.spec.tsx} +4 -4
- package/src/components/{DashboardBuilder/DashboardBuilder.exit.spec.tsx → ReportBuilder/ReportBuilder.exit.spec.tsx} +5 -5
- package/src/components/{DashboardBuilder/DashboardBuilder.inline.spec.tsx → ReportBuilder/ReportBuilder.inline.spec.tsx} +4 -4
- package/src/components/ReportBuilder/ReportBuilder.layoutSwitch.spec.tsx +145 -0
- package/src/components/{DashboardBuilder/DashboardBuilder.notebook.spec.tsx → ReportBuilder/ReportBuilder.notebook.spec.tsx} +22 -21
- package/src/components/{DashboardBuilder/DashboardBuilder.openDraft.spec.tsx → ReportBuilder/ReportBuilder.openDraft.spec.tsx} +3 -3
- package/src/components/{DashboardBuilder/DashboardBuilder.sources.spec.tsx → ReportBuilder/ReportBuilder.sources.spec.tsx} +19 -8
- package/src/components/{DashboardBuilder/DashboardBuilder.spec.tsx → ReportBuilder/ReportBuilder.spec.tsx} +34 -34
- package/src/components/{DashboardBuilder/DashboardBuilder.textTiles.spec.tsx → ReportBuilder/ReportBuilder.textTiles.spec.tsx} +5 -5
- package/src/components/{DashboardBuilder/DashboardBuilder.tsx → ReportBuilder/ReportBuilder.tsx} +46 -21
- package/src/components/{DashboardBuilder/DashboardEditor.authoritative.spec.tsx → ReportBuilder/ReportEditor.authoritative.spec.tsx} +28 -20
- package/src/components/{DashboardBuilder/DashboardEditor.emptyStart.spec.tsx → ReportBuilder/ReportEditor.emptyStart.spec.tsx} +19 -11
- package/src/components/{DashboardBuilder/DashboardEditor.filterTag.spec.tsx → ReportBuilder/ReportEditor.filterTag.spec.tsx} +7 -7
- package/src/components/{DashboardBuilder/DashboardEditor.notebook.spec.tsx → ReportBuilder/ReportEditor.notebook.spec.tsx} +70 -49
- package/src/components/{DashboardBuilder/DashboardEditor.package.spec.tsx → ReportBuilder/ReportEditor.package.spec.tsx} +52 -8
- package/src/components/{DashboardBuilder/DashboardEditor.resourceUri.spec.tsx → ReportBuilder/ReportEditor.resourceUri.spec.tsx} +50 -18
- package/src/components/{DashboardBuilder/DashboardEditor.spec.tsx → ReportBuilder/ReportEditor.spec.tsx} +65 -20
- package/src/components/{DashboardBuilder/DashboardEditor.textSource.spec.tsx → ReportBuilder/ReportEditor.textSource.spec.tsx} +6 -6
- package/src/components/{DashboardBuilder/DashboardEditor.tsx → ReportBuilder/ReportEditor.tsx} +92 -35
- package/src/components/{DashboardBuilder → ReportBuilder}/addTile.compile.spec.ts +1 -3
- package/src/components/{DashboardBuilder → ReportBuilder}/addTileToDocument.spec.ts +1 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/artifactBlock.spec.ts +21 -29
- package/src/components/ReportBuilder/builderReport.ts +53 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/catalog.spec.ts +28 -10
- package/src/components/{DashboardBuilder → ReportBuilder}/catalog.ts +17 -10
- package/src/components/{DashboardBuilder → ReportBuilder}/controls.spec.ts +1 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/document.ts +4 -7
- package/src/components/{DashboardBuilder → ReportBuilder}/documentSession.spec.ts +5 -5
- package/src/components/{DashboardBuilder → ReportBuilder}/documentSession.ts +1 -1
- package/src/components/{DashboardBuilder → ReportBuilder}/imports.spec.ts +6 -2
- package/src/components/{DashboardBuilder → ReportBuilder}/imports.ts +8 -4
- package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.chart.spec.ts +1 -1
- package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.convert.spec.ts +9 -13
- package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.read.spec.ts +15 -15
- package/src/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.ts +7 -2
- package/src/components/{DashboardBuilder → ReportBuilder}/malloyTree.ts +25 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/newDashboard.spec.ts +12 -4
- package/src/components/{DashboardBuilder → ReportBuilder}/newDashboard.ts +11 -24
- package/src/components/{DashboardBuilder → ReportBuilder}/preview.spec.ts +1 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/readDocument.spec.ts +64 -36
- package/src/components/{DashboardBuilder → ReportBuilder}/readDocument.ts +33 -32
- package/src/components/ReportBuilder/readForEditor.spec.ts +96 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/readForEditor.ts +3 -11
- package/src/components/ReportBuilder/reportTag.ts +108 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.imports.spec.ts +28 -1
- package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.spec.ts +32 -3
- package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.ts +37 -60
- package/src/components/{DashboardBuilder → ReportBuilder}/tagParse.spec.ts +3 -3
- package/src/components/{DashboardBuilder → ReportBuilder}/testing/artifactTagParity.json +2 -2
- package/src/components/ReportBuilder/testing/drillResolution.json +279 -0
- package/src/components/ReportBuilder/testing/reportLayoutParity.json +125 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/textTiles.spec.ts +66 -143
- package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderSelection.ts +2 -2
- package/src/components/{DashboardBuilder → ReportBuilder}/useControlBindings.ts +2 -2
- package/src/components/ReportBuilder/useEditorCatalog.spec.tsx +156 -0
- package/src/components/ReportBuilder/useEditorCatalog.ts +119 -0
- package/src/components/{DashboardBuilder → ReportBuilder}/useHostCopy.ts +7 -5
- package/src/components/{DashboardBuilder → ReportBuilder}/useOpenedDocument.ts +56 -35
- package/src/components/{DashboardBuilder/useDashboardEditor.spec.ts → ReportBuilder/useReportEditor.spec.ts} +6 -6
- package/src/components/{DashboardBuilder/useDashboardEditor.ts → ReportBuilder/useReportEditor.ts} +6 -17
- package/src/components/{DashboardBuilder → ReportBuilder}/useSaveChannel.ts +36 -35
- package/src/components/{DashboardBuilder → ReportBuilder}/useTileEditing.ts +2 -2
- package/src/components/ServerProvider.tsx +2 -0
- package/src/components/drill/resolveDrill.ts +9 -2
- package/src/components/drill/useDrill.tsx +1 -0
- package/src/components/drill/useDrillSelf.spec.tsx +60 -7
- package/src/components/drill/useDrillSelf.ts +29 -12
- package/src/components/index.ts +2 -1
- package/src/components/{Dashboard → legacy}/Dashboard.spec.tsx +1 -1
- package/src/components/{Dashboard → legacy}/Dashboard.tsx +40 -28
- package/src/components/legacy/MalloynbCells.tsx +88 -0
- package/src/components/{Notebook → legacy}/Notebook.served.spec.tsx +17 -13
- package/src/components/{Notebook → legacy}/Notebook.spec.tsx +24 -20
- package/src/components/legacy/Notebook.tsx +44 -0
- package/src/components/{DashboardBuilder → legacy}/NotebookEditor.tsx +7 -4
- package/src/components/legacy/builderNames.ts +25 -0
- package/src/components/legacy/index.ts +20 -0
- package/src/components/legacy/kindAdapter.ts +19 -0
- package/src/components/legacy/kindTypedDrafts.ts +34 -0
- package/src/components/legacy/nameAlias.spec.ts +124 -0
- package/src/components/legacy/nameAlias.ts +95 -0
- package/src/components/legacy/queryKeys.ts +26 -0
- package/src/hooks/useGivensState.spec.ts +9 -9
- package/src/mainEntry.spec.ts +1 -1
- package/src/textEntry.spec.ts +9 -9
- package/src/utils/formatting.spec.ts +5 -5
- package/src/utils/parsing.spec.ts +1 -1
- package/src/utils/parsing.ts +1 -1
- package/dist/ServerProvider-Gj-im5VD.cjs.js +0 -1
- package/dist/components/Dashboard/telemetry.d.ts +0 -73
- package/dist/components/DashboardBuilder/builderReport.d.ts +0 -13
- package/dist/components/DashboardBuilder/telemetry.d.ts +0 -43
- package/dist/components/DocumentCreate/events.d.ts +0 -10
- package/dist/components/Notebook/Notebook.d.ts +0 -52
- package/dist/components/Notebook/index.d.ts +0 -1
- package/dist/useCompiledDocument-tBejqZ7s.cjs.js +0 -142
- package/src/components/Dashboard/telemetry.ts +0 -75
- package/src/components/DashboardBuilder/builderReport.ts +0 -74
- package/src/components/DashboardBuilder/readForEditor.spec.ts +0 -80
- package/src/components/DashboardBuilder/telemetry.ts +0 -47
- package/src/components/DashboardBuilder/testing/documentKindRule.json +0 -40
- package/src/components/DocumentCreate/events.ts +0 -15
- package/src/components/Notebook/index.ts +0 -4
- /package/dist/components/{DashboardBuilder → ReportBuilder}/AddTileDialog.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/ChartPicker.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/DrillDialog.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/FilterDialog.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/FilterStrip.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/InlineMarkdown.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/InlineText.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/SourceViewPicker.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/TextTileBody.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/TileFrame.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/TileMenu.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/addTileToDocument.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/annotationText.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/changedTile.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/chartLine.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/controls.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/inlineEdit.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/layout.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/legacyNotebook.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/loadMalloy.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/openDraft.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/preview.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/sortable.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/spliceResult.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/tagParse.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/testing/fixtures.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/testing/inline.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/testing/resize.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/tileDisplayTitle.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useBuilderSession.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useConversionConfirm.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useDocumentEditor.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useDraft.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useExitGuard.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useFilterForm.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useOpenDraftCommit.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useTileReorder.d.ts +0 -0
- /package/dist/components/{DashboardBuilder → ReportBuilder}/useTileResize.d.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/AddTileDialog.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/AddTileDialog.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/ChartPicker.render.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/ChartPicker.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/ChartPicker.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/FilterStrip.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/InlineMarkdown.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/InlineText.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/SourceViewPicker.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/TextTileBody.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/TileFrame.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/TileMenu.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/__test__/inventory.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/addTileToDocument.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/annotationText.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/annotationText.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/artifactTagParity.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/catalog.aggregate.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/changedTile.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/changedTile.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/chartLine.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/chartLine.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/controls.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/emptyStart.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/inlineEdit.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/invariants.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/keepRowStructure.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/layout.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/loadMalloy.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/loadMalloy.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/malloyTree.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/moveIntoGap.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/openDraft.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/preview.shapes.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/preview.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/scannerShapes.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/sortable.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/sortable.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/spliceDocument.chart.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/spliceResult.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/statementExtent.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/tagParse.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/testing/fixtures.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/testing/inline.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/testing/resize.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/testing/urlRenderTags.json +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/tileDisplayTitle.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderSession.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderSession.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.overlay.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useBuilderShortcuts.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useConversionConfirm.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useDocumentEditor.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useDocumentEditor.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useDraft.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useExitGuard.spec.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useExitGuard.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useFilterForm.existing.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useFilterForm.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useFilterForm.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useOpenDraftCommit.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useTileReorder.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useTileReorder.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useTileResize.spec.tsx +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/useTileResize.ts +0 -0
- /package/src/components/{DashboardBuilder → ReportBuilder}/withGaps.spec.ts +0 -0
- /package/src/components/{Notebook → legacy}/Notebook.layout.spec.tsx +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { TileChrome } from '../Dashboard/TileCard';
|
|
3
|
-
import {
|
|
3
|
+
import { ReportEditorHandle } from './useReportEditor';
|
|
4
4
|
/**
|
|
5
5
|
* The document's title, with the builder's actions on its line, and its
|
|
6
6
|
* description beneath: both edited where they stand, as the reader sees them.
|
|
7
7
|
*/
|
|
8
|
-
export declare function BuilderHeader({ editor,
|
|
9
|
-
editor:
|
|
10
|
-
|
|
8
|
+
export declare function BuilderHeader({ editor, documentSlug, chrome, actions, descriptionSelected, selectDescription, }: {
|
|
9
|
+
editor: ReportEditorHandle;
|
|
10
|
+
/** Kept for callers; the title reads the same in either layout. */
|
|
11
|
+
notebook?: boolean;
|
|
11
12
|
/** The name a reader's view titles an untitled document with. */
|
|
12
13
|
documentSlug: string | undefined;
|
|
13
14
|
chrome: TileChrome;
|
|
@@ -35,5 +35,9 @@ export interface BuilderToolbarProps {
|
|
|
35
35
|
* Console leaves from its own header and passes nothing.
|
|
36
36
|
*/
|
|
37
37
|
onExit?: () => void;
|
|
38
|
+
/** The report's layout, for the switch. Absent, no switch is drawn. */
|
|
39
|
+
layout?: "grid" | "linear";
|
|
40
|
+
/** Switch the layout: rewrites `layout=` in the tag and nothing else. */
|
|
41
|
+
onLayoutChange?: (layout: "grid" | "linear") => void;
|
|
38
42
|
}
|
|
39
|
-
export declare function BuilderToolbar({ canUndo, canRedo, onUndo, onRedo, dirty, saving, onSave, savesTo, saveLabel, saveButton, actions, onAddTile, onExit, }: BuilderToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export declare function BuilderToolbar({ canUndo, canRedo, onUndo, onRedo, dirty, saving, onSave, savesTo, saveLabel, saveButton, actions, onAddTile, onExit, layout, onLayoutChange, }: BuilderToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { Given } from '../../client';
|
|
2
|
-
import {
|
|
2
|
+
import { ReportLayout } from '../Package/documentLocation';
|
|
3
|
+
import { DashboardDocument } from './document';
|
|
3
4
|
import { SavesTo } from './documentSession';
|
|
4
|
-
import { TextSourceOptions } from './
|
|
5
|
-
import {
|
|
6
|
-
export declare function EditorSurface({ textSource,
|
|
5
|
+
import { TextSourceOptions } from './ReportEditor';
|
|
6
|
+
import { ReportEventHandler } from '../Report/telemetry';
|
|
7
|
+
export declare function EditorSurface({ textSource, modelGivens, environmentName, packageName, modelPath, versionId, opened, replaces, onSave, onDirtyChange, onExit, allowLayoutChange, onEvent, savesTo, saveLabel, note, }: {
|
|
7
8
|
textSource?: TextSourceOptions;
|
|
8
|
-
kind: DocumentKind;
|
|
9
9
|
/** The model's own givens, for a cell-format notebook whose manifest the server cannot build until it is saved. */
|
|
10
10
|
modelGivens?: Given[];
|
|
11
11
|
environmentName: string;
|
|
12
12
|
packageName: string;
|
|
13
13
|
modelPath: string;
|
|
14
|
+
/** A display label; the editor keys on `modelPath`. */
|
|
14
15
|
slug: string;
|
|
15
16
|
versionId?: string;
|
|
16
17
|
opened: {
|
|
@@ -23,10 +24,12 @@ export declare function EditorSurface({ textSource, kind, modelGivens, environme
|
|
|
23
24
|
generation: number;
|
|
24
25
|
};
|
|
25
26
|
replaces?: string;
|
|
26
|
-
|
|
27
|
+
/** Save the text, with the layout the document has as it is saved. */
|
|
28
|
+
onSave?: (source: string, layout: ReportLayout) => Promise<void>;
|
|
27
29
|
onDirtyChange: (dirty: boolean) => void;
|
|
28
30
|
onExit?: () => void;
|
|
29
|
-
|
|
31
|
+
allowLayoutChange?: boolean;
|
|
32
|
+
onEvent?: ReportEventHandler;
|
|
30
33
|
savesTo: SavesTo;
|
|
31
34
|
saveLabel?: string;
|
|
32
35
|
note: string;
|
package/dist/components/{DashboardBuilder/DashboardBuilder.d.ts → ReportBuilder/ReportBuilder.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { TileChrome, TileHeadingSlots } from '../Dashboard/TileCard';
|
|
3
3
|
import { SavesTo } from './documentSession';
|
|
4
|
-
import {
|
|
4
|
+
import { ReportEventHandler } from '../Report/telemetry';
|
|
5
5
|
import { BuilderGiven } from './controls';
|
|
6
6
|
import { PackageCatalog } from './catalog';
|
|
7
7
|
import { DashboardDocument, QueryTile } from './document';
|
|
@@ -37,7 +37,7 @@ export type { BuilderGiven } from './controls';
|
|
|
37
37
|
*
|
|
38
38
|
* Tiles are added from the package's catalog and removed from their menu.
|
|
39
39
|
*/
|
|
40
|
-
export interface
|
|
40
|
+
export interface ReportBuilderProps {
|
|
41
41
|
/** The file being edited. */
|
|
42
42
|
source: string;
|
|
43
43
|
/** The document that file produced. */
|
|
@@ -111,8 +111,12 @@ export interface DashboardBuilderProps {
|
|
|
111
111
|
* go. Absent, a drill can only filter this dashboard.
|
|
112
112
|
*/
|
|
113
113
|
dashboards?: string[];
|
|
114
|
-
/**
|
|
115
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Saves, refusals and layout switches, for the host to log; see
|
|
116
|
+
* `ReportEvent`. Each is stamped with `modelPath` (empty when the builder
|
|
117
|
+
* was given none) and the document's layout as it stands.
|
|
118
|
+
*/
|
|
119
|
+
onEvent?: ReportEventHandler;
|
|
116
120
|
/**
|
|
117
121
|
* The document is a conversion of a cell-format notebook: `from` is the text
|
|
118
122
|
* on disk, `to` the layout text it converts to. Save writes `to` with the
|
|
@@ -144,10 +148,8 @@ export interface DashboardBuilderProps {
|
|
|
144
148
|
saveLabel?: string;
|
|
145
149
|
/** The file a save overwrites when `source` is a draft of it, so Undo save restores that file rather than the draft. */
|
|
146
150
|
replaces?: string;
|
|
147
|
-
/** The document's file within the package
|
|
151
|
+
/** The document's file within the package: the name an untitled document is shown under, and what a new tile is written beside. */
|
|
148
152
|
modelPath?: string;
|
|
149
|
-
/** The document is held as text, which the server reads by its tags rather than its folder: the tag always carries `kind=`. */
|
|
150
|
-
explicitKind?: boolean;
|
|
151
153
|
/** Set for a document held as text: the sources it sees without an `import`. A tile on one of them adds no import. */
|
|
152
154
|
visibleSources?: readonly string[];
|
|
153
155
|
/**
|
|
@@ -163,5 +165,12 @@ export interface DashboardBuilderProps {
|
|
|
163
165
|
toolbar?: ReactNode;
|
|
164
166
|
/** Leave the builder, opted into: draws Close, which asks first when edits are unsaved. */
|
|
165
167
|
onExit?: () => void;
|
|
168
|
+
/**
|
|
169
|
+
* Whether the toolbar offers the Linear / Grid layout switch. Default
|
|
170
|
+
* true. A host that files a report by its layout passes false, so an
|
|
171
|
+
* author cannot change a layout the host files by. A document held as text
|
|
172
|
+
* never gets the switch.
|
|
173
|
+
*/
|
|
174
|
+
allowLayoutChange?: boolean;
|
|
166
175
|
}
|
|
167
|
-
export declare function
|
|
176
|
+
export declare function ReportBuilder({ source, document, onSave, onChange, onDirtyChange, onExit, allowLayoutChange, renderTile, controls, givens, catalog, toolbar, dashboards, onEvent, conversion, savesTo, saveLabel, replaces, modelPath, visibleSources, addFilterDisabledReason, }: ReportBuilderProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/components/{DashboardBuilder/DashboardEditor.d.ts → ReportBuilder/ReportEditor.d.ts}
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HostGivenValue } from '../../hooks/givenValue';
|
|
2
|
-
import {
|
|
3
|
-
import { DocumentKind } from '
|
|
2
|
+
import { ReportEventHandler } from '../Report/telemetry';
|
|
3
|
+
import { DocumentKind } from '../legacy/kindAdapter';
|
|
4
|
+
import { ReportLayout } from '../Package/documentLocation';
|
|
4
5
|
/**
|
|
5
6
|
* The builder, opened on a package dashboard, with everything a host has to
|
|
6
7
|
* supply already wired: the file's text and manifest from the server, a live
|
|
@@ -19,10 +20,24 @@ import { DocumentKind } from './document';
|
|
|
19
20
|
* editor (its value is written into each tile's query) but reaches the package
|
|
20
21
|
* only when the file is saved into it.
|
|
21
22
|
*/
|
|
22
|
-
export type
|
|
23
|
+
export type ReportEditorProps = ({
|
|
23
24
|
/** `publisher://environments/{env}/packages/{pkg}`, optionally `?versionId=`. */
|
|
24
25
|
resourceUri: string;
|
|
25
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* The report's package path, `sales/q3.malloy`: its identity, and what
|
|
28
|
+
* the editor is keyed by. Give this.
|
|
29
|
+
*/
|
|
30
|
+
path: string;
|
|
31
|
+
/** A display label; default the path's basename. */
|
|
32
|
+
dashboard?: string;
|
|
33
|
+
} | {
|
|
34
|
+
/** `publisher://environments/{env}/packages/{pkg}`, optionally `?versionId=`. */
|
|
35
|
+
resourceUri: string;
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated Pass `path`. The report's basename, which opens
|
|
38
|
+
* `<kind>s/<name>.malloy` (`dashboards/` unless `kind` says
|
|
39
|
+
* `notebook`) when no `path` is given.
|
|
40
|
+
*/
|
|
26
41
|
dashboard: string;
|
|
27
42
|
} | {
|
|
28
43
|
/** @deprecated Pass `resourceUri` and `dashboard` instead. */
|
|
@@ -36,20 +51,25 @@ export type DashboardEditorProps = ({
|
|
|
36
51
|
dashboardName: string;
|
|
37
52
|
}) & {
|
|
38
53
|
/**
|
|
39
|
-
* What the editor does — opened, saved, refused
|
|
40
|
-
* count; see `
|
|
54
|
+
* What the editor does — opened, failed to load, saved, refused, switched
|
|
55
|
+
* layout — for the host to log or count; see `ReportEvent`.
|
|
41
56
|
*/
|
|
42
|
-
onEvent?:
|
|
57
|
+
onEvent?: ReportEventHandler;
|
|
43
58
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
59
|
+
* The report's layout as the host knows it before the text is read: from
|
|
60
|
+
* the package's listing, or for a draft the layout its store recorded.
|
|
61
|
+
* Default `grid`. It decides what is read when the editor opens (a linear
|
|
62
|
+
* report's copy is read back only from an authoritative store) and is what
|
|
63
|
+
* a save records until the text says otherwise; once open, the document's
|
|
64
|
+
* own tag decides how it is drawn, what a save records and which events it
|
|
65
|
+
* reports, and the layout switch changes that.
|
|
47
66
|
*/
|
|
67
|
+
layout?: ReportLayout;
|
|
68
|
+
/** @deprecated Pass `layout`: `dashboard` is grid, `notebook` linear. */
|
|
48
69
|
kind?: DocumentKind;
|
|
49
70
|
/**
|
|
50
|
-
* The
|
|
51
|
-
*
|
|
52
|
-
* the kind comes from the file's own tag, so a document may sit in either.
|
|
71
|
+
* The report's file within the package, wherever it lives: its identity.
|
|
72
|
+
* Without it, the deprecated name forms open `<kind>s/<name>.malloy`.
|
|
53
73
|
*/
|
|
54
74
|
path?: string;
|
|
55
75
|
/**
|
|
@@ -69,6 +89,13 @@ export type DashboardEditorProps = ({
|
|
|
69
89
|
onExit?: () => void;
|
|
70
90
|
/** Edit a document held as text; see {@link TextSourceOptions}. */
|
|
71
91
|
textSource?: TextSourceOptions;
|
|
92
|
+
/**
|
|
93
|
+
* Whether the toolbar offers the Linear / Grid layout switch. Default
|
|
94
|
+
* true. A host that files a report by its layout passes false, so an
|
|
95
|
+
* author cannot change a layout the host files by. A document held as text
|
|
96
|
+
* never gets the switch.
|
|
97
|
+
*/
|
|
98
|
+
allowLayoutChange?: boolean;
|
|
72
99
|
};
|
|
73
100
|
/**
|
|
74
101
|
* Open a document the host keeps as TEXT, rather than a file in a package.
|
|
@@ -89,4 +116,4 @@ export interface TextSourceOptions {
|
|
|
89
116
|
/** The values for the givens the host sets: sent with the compile and with each tile that reads one. */
|
|
90
117
|
givens?: Record<string, HostGivenValue>;
|
|
91
118
|
}
|
|
92
|
-
export declare function
|
|
119
|
+
export declare function ReportEditor(props: ReportEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReportLayout } from '../Package/documentLocation';
|
|
2
|
+
import { ReportEventHandler, SavesTo } from '../Report/telemetry';
|
|
3
|
+
import { SessionReport } from './useBuilderSession';
|
|
4
|
+
/**
|
|
5
|
+
* What the builder's session says about a save, as `report.*` events stamped
|
|
6
|
+
* with the report's path and the document's layout as it stands.
|
|
7
|
+
*/
|
|
8
|
+
export declare const builderReport: ({ size, path, layout, savesTo, onEvent, }: {
|
|
9
|
+
size: number;
|
|
10
|
+
path: string;
|
|
11
|
+
layout: ReportLayout;
|
|
12
|
+
savesTo: SavesTo;
|
|
13
|
+
onEvent: ReportEventHandler | undefined;
|
|
14
|
+
}) => SessionReport;
|
|
@@ -62,9 +62,12 @@ export declare function chartOf(annotations: string[] | undefined): string | und
|
|
|
62
62
|
*/
|
|
63
63
|
export declare function filterableFields(catalog: PackageCatalog | undefined, source: string | undefined): CatalogField[] | undefined;
|
|
64
64
|
/**
|
|
65
|
-
* A
|
|
66
|
-
* real ones. Offering a
|
|
67
|
-
*
|
|
65
|
+
* A report file is itself a model, so the models endpoint may list it beside
|
|
66
|
+
* the real ones. Offering a report's own tile views as things to put on a
|
|
67
|
+
* report would be circular, so they are left out, by the paths the package's
|
|
68
|
+
* report listing names: where a file lives never says whether it is a report.
|
|
68
69
|
*/
|
|
69
|
-
export declare const
|
|
70
|
-
export declare function buildCatalog(models: CompiledModel[]
|
|
70
|
+
export declare const isReportModel: (path: string | undefined, reportPaths: ReadonlySet<string>) => boolean;
|
|
71
|
+
export declare function buildCatalog(models: CompiledModel[],
|
|
72
|
+
/** The package's report paths (`GET …/reports`), left out of the catalog. */
|
|
73
|
+
reportPaths?: ReadonlySet<string>): PackageCatalog;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReportLayout } from '../Package/documentLocation';
|
|
1
2
|
import { ChartState } from './chartLine';
|
|
2
3
|
/** One `import` line. The file needs both forms, and for different reasons. */
|
|
3
4
|
export type DashboardImport =
|
|
@@ -217,11 +218,9 @@ export interface DashboardDimension {
|
|
|
217
218
|
name: string;
|
|
218
219
|
expression: string;
|
|
219
220
|
}
|
|
220
|
-
/** Which surface the file is: a notebook is the same file with one column. */
|
|
221
|
-
export type DocumentKind = "dashboard" | "notebook";
|
|
222
221
|
export interface DashboardDocument {
|
|
223
|
-
/**
|
|
224
|
-
|
|
222
|
+
/** The report's layout, as its tag decides it: a linear report is the same file drawn as one column. */
|
|
223
|
+
layout: ReportLayout;
|
|
225
224
|
title: string;
|
|
226
225
|
/** The narrative header, as markdown. Emitted as `##"` lines. */
|
|
227
226
|
description?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { QueryClient, QueryKey } from '@tanstack/react-query';
|
|
2
2
|
import { Workspace } from '../DocumentStorage';
|
|
3
3
|
import { ApiClients } from '../ServerProvider';
|
|
4
|
-
import { SavesTo } from '../
|
|
4
|
+
import { SavesTo } from '../Report/telemetry';
|
|
5
5
|
export type { SavesTo };
|
|
6
6
|
/**
|
|
7
7
|
* The record when one declares itself, and otherwise the first writeable
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { DashboardDocument, DashboardImport } from './document';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* How the report at `documentPath` names the model at `modelPath`: relative to
|
|
4
|
+
* the report's own folder, with no leading `./` (`"storefront.malloy"` beside
|
|
5
|
+
* it, `"../storefront.malloy"` from one folder down).
|
|
6
|
+
*/
|
|
3
7
|
export declare function importPathOf(modelPath: string, documentPath: string): string;
|
|
4
8
|
/**
|
|
5
9
|
* Whether the file can already see `name`: it extends it, imports it by name,
|
|
@@ -155,6 +155,8 @@ export interface ParsedMalloy {
|
|
|
155
155
|
givens: TreeGiven[];
|
|
156
156
|
/** The closed floating `(markdown)` / `(text)` blocks, in file order. */
|
|
157
157
|
textBlocks: TreeTextBlock[];
|
|
158
|
+
/** The file's own model-level notes (`##` lines and `##|` blocks), as written; a report's tag is read from these. */
|
|
159
|
+
modelNotes: string[];
|
|
158
160
|
/** The comment token on `line`, if the line ends with one. */
|
|
159
161
|
trailingComment(line: number): Span | undefined;
|
|
160
162
|
/**
|
|
@@ -215,6 +217,13 @@ export type Ctx = Record<string, unknown> & {
|
|
|
215
217
|
};
|
|
216
218
|
/** A rule context we can take a range from; terminals and empties are not. */
|
|
217
219
|
export declare const isRule: (c: Ctx | undefined) => boolean;
|
|
220
|
+
/**
|
|
221
|
+
* The model-level notes of a parse: each top-level statement's own
|
|
222
|
+
* `docAnnotations`, as written, a `##|` block without its closer. The
|
|
223
|
+
* server's `modelNotesOfParse` reads the same notes, so a report's tag is
|
|
224
|
+
* read from the same text on both sides.
|
|
225
|
+
*/
|
|
226
|
+
export declare function readModelNotes(r: Reader, root: Ctx): string[];
|
|
218
227
|
export declare class Reader {
|
|
219
228
|
readonly text: string;
|
|
220
229
|
private readonly map;
|
|
@@ -16,4 +16,10 @@ export interface NewDashboard {
|
|
|
16
16
|
export declare function slugFor(title: string): string;
|
|
17
17
|
/** Why this dashboard cannot be written as a file, or undefined when it can. */
|
|
18
18
|
export declare function newDashboardProblem({ title, modelPath, source, view, }: NewDashboard): string | undefined;
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* A new grid report; see `newReportSource`, which writes both layouts from
|
|
21
|
+
* one template.
|
|
22
|
+
*/
|
|
23
|
+
export declare function newDashboardSource(dashboard: NewDashboard,
|
|
24
|
+
/** The package path the report is written at; the import is relative to it. Default: the root. */
|
|
25
|
+
reportPath?: string): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DashboardDocument, LocalGiven } from './document';
|
|
2
2
|
import { ParsedMalloy } from './malloyTree';
|
|
3
3
|
/**
|
|
4
|
-
* Read a
|
|
4
|
+
* Read a report file (either layout, anywhere in the package) into a {@link DashboardDocument}.
|
|
5
5
|
*
|
|
6
6
|
* PURE: source text in, document out. No server, no schema, no connection.
|
|
7
7
|
* `Malloy.parse` needs none of those — only `Malloy.compile` does — so this runs
|
|
@@ -29,7 +29,7 @@ export interface ReadFailure {
|
|
|
29
29
|
reason: string;
|
|
30
30
|
/** 1-based, for a message that can point at the line. */
|
|
31
31
|
line?: number;
|
|
32
|
-
/** The file is a
|
|
32
|
+
/** The file is a linear report in the run-cell format, which `convertLegacyNotebook` turns into a tile layout. */
|
|
33
33
|
legacyNotebook?: true;
|
|
34
34
|
}
|
|
35
35
|
export type ReadResult = {
|
|
@@ -102,7 +102,9 @@ type ParseTags = (lines: string[]) => {
|
|
|
102
102
|
*/
|
|
103
103
|
export declare function localGivens(parsed: ParsedMalloy, lines: string[], parse: ParseTags): LocalGiven[] | undefined;
|
|
104
104
|
/** Refuses rather than throws: `Tag.text()` throws on a malformed date literal such as `@2024-13-01`, and dropping the value would lose it on the next save. */
|
|
105
|
-
export declare function readDashboardDocument(sourceText: string,
|
|
106
|
-
/**
|
|
107
|
-
|
|
105
|
+
export declare function readDashboardDocument(sourceText: string,
|
|
106
|
+
/** The file's path. Kept for callers; where a report lives never decides its layout. */
|
|
107
|
+
_modelPath?: string,
|
|
108
|
+
/** Kept for callers: text held by a host is read by the same rule as a file. */
|
|
109
|
+
_textHeld?: boolean): Promise<ReadResult>;
|
|
108
110
|
export {};
|
|
@@ -13,4 +13,4 @@ export type EditorOpen = {
|
|
|
13
13
|
reason: string;
|
|
14
14
|
};
|
|
15
15
|
/** Read `text` for the builder, converting a cell-format notebook rather than refusing it. */
|
|
16
|
-
export declare function readForEditor(text: string
|
|
16
|
+
export declare function readForEditor(text: string): Promise<EditorOpen>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ReportLayout } from '../Package/documentLocation';
|
|
2
|
+
/**
|
|
3
|
+
* What a file's model-level notes make it, by the server's rule
|
|
4
|
+
* (`readReportTag`, `docs/reports-design.md` §1, §2):
|
|
5
|
+
*
|
|
6
|
+
* - `none`: no model-level `## artifact` note, so not a report.
|
|
7
|
+
* - `unparsed`: an artifact note the tag parser rejects, so not a report.
|
|
8
|
+
* - `kind-removed`: the tag sets the removed `kind=`, so not a report.
|
|
9
|
+
* - `report`: a report, with its layout.
|
|
10
|
+
*/
|
|
11
|
+
export type ReportTag = {
|
|
12
|
+
status: "none";
|
|
13
|
+
} | {
|
|
14
|
+
status: "unparsed";
|
|
15
|
+
errors: string[];
|
|
16
|
+
} | {
|
|
17
|
+
status: "kind-removed";
|
|
18
|
+
kind: string;
|
|
19
|
+
} | {
|
|
20
|
+
status: "report";
|
|
21
|
+
layout: ReportLayout;
|
|
22
|
+
};
|
|
23
|
+
type Parsed = {
|
|
24
|
+
tag: TagReads;
|
|
25
|
+
log: Array<{
|
|
26
|
+
message: string;
|
|
27
|
+
}>;
|
|
28
|
+
};
|
|
29
|
+
type TagReads = {
|
|
30
|
+
tag(key: string): TagReads | undefined;
|
|
31
|
+
text(key: string): string | undefined;
|
|
32
|
+
has(key: string): boolean;
|
|
33
|
+
};
|
|
34
|
+
/** Why a `kind=` tag makes no report, and the fix: the server's message, word for word. */
|
|
35
|
+
export declare const kindRemovedReason: (kind: string) => string;
|
|
36
|
+
/**
|
|
37
|
+
* The one reader of a report's tag in the SDK, over a file's model-level
|
|
38
|
+
* notes (`ParsedMalloy.modelNotes`). The server's `readReportTag` is the same
|
|
39
|
+
* rule over the same notes; `reportLayoutParity.json` holds the two together.
|
|
40
|
+
*
|
|
41
|
+
* The layout, first match wins: `layout=grid|linear`; else grid when the tag
|
|
42
|
+
* lists `tiles` (an empty list counts) or a model-level `dashboard { … }` grid
|
|
43
|
+
* tag is present; else linear.
|
|
44
|
+
*/
|
|
45
|
+
export declare function readReportTag(modelNotes: readonly string[], parseAnnotation: (lines: string[]) => Parsed): ReportTag;
|
|
46
|
+
/**
|
|
47
|
+
* {@link readReportTag} over raw text, parsed for its notes and nothing else:
|
|
48
|
+
* the answer for a file whatever else is wrong with it, as the server reads a
|
|
49
|
+
* file that does not compile.
|
|
50
|
+
*/
|
|
51
|
+
export declare function readReportTagOfText(text: string): Promise<ReportTag>;
|
|
52
|
+
export {};
|
|
@@ -13,7 +13,7 @@ import { spliceFailed, SpliceFailure, SpliceResult } from './spliceResult';
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function syntaxErrors(text: string): Promise<string[]>;
|
|
15
15
|
/**
|
|
16
|
-
* Write a change back into a
|
|
16
|
+
* Write a change back into a report file by PATCHING it.
|
|
17
17
|
*
|
|
18
18
|
* The builder does not regenerate the file. It rewrites the bytes it owns and
|
|
19
19
|
* leaves every other byte exactly where it was, which is what lets it edit a
|
|
@@ -57,12 +57,6 @@ export declare const tileFileKey: (t: DashboardTile) => string;
|
|
|
57
57
|
/** Why a text tile's markdown cannot be written into a block, or undefined when it can: the writer's refusals, for an editor to show live. */
|
|
58
58
|
export declare function markdownProblem(markdown: string): string | undefined;
|
|
59
59
|
export interface SpliceOptions {
|
|
60
|
-
/** Lets `requested.kind` differ from the file's: the one edit that switches a dashboard to a notebook or back. */
|
|
61
|
-
changeKind?: boolean;
|
|
62
|
-
/** The file's path within the package; a dashboard under `notebooks/` is tagged `kind=dashboard` rather than left untagged. */
|
|
63
|
-
modelPath?: string;
|
|
64
|
-
/** Write `kind=dashboard` too, whatever the folder: for a document held as text, which the server reads by its tags and not by a folder. */
|
|
65
|
-
explicitKind?: boolean;
|
|
66
60
|
/** The sources a document held as text sees without an `import`: its run model's. */
|
|
67
61
|
visibleSources?: readonly string[];
|
|
68
62
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RefObject } from 'react';
|
|
2
2
|
import { DashboardDocument } from './document';
|
|
3
|
-
import {
|
|
3
|
+
import { ReportEditorHandle } from './useReportEditor';
|
|
4
4
|
import { SaveOutcome, LastSave } from './useDocumentEditor';
|
|
5
5
|
/**
|
|
6
6
|
* The builder's selection, and the flash that points at what undo and redo
|
|
@@ -12,7 +12,7 @@ import { SaveOutcome, LastSave } from './useDocumentEditor';
|
|
|
12
12
|
* author is already looking at what they changed.
|
|
13
13
|
*/
|
|
14
14
|
export declare function useBuilderSelection({ editor, gridBox, }: {
|
|
15
|
-
editor:
|
|
15
|
+
editor: ReportEditorHandle;
|
|
16
16
|
/** The grid's box, searched for the changed tile to scroll to. */
|
|
17
17
|
gridBox: RefObject<HTMLDivElement | null>;
|
|
18
18
|
}): {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { PackageCatalog, CatalogField } from './catalog';
|
|
2
2
|
import { BuilderControl, BuilderGiven, MappingRow } from './controls';
|
|
3
3
|
import { DashboardDocument, LocalGiven, QueryTile } from './document';
|
|
4
|
-
import {
|
|
4
|
+
import { ReportEditorHandle } from './useReportEditor';
|
|
5
5
|
import { Dispatch, SetStateAction } from 'react';
|
|
6
6
|
/**
|
|
7
7
|
* The document's controls, the fields each tile may bind one to, and the
|
|
8
8
|
* filter window that edits them — the one place a filter is configured.
|
|
9
9
|
*/
|
|
10
10
|
export declare function useControlBindings({ editor, opened, givens, catalog, }: {
|
|
11
|
-
editor:
|
|
11
|
+
editor: ReportEditorHandle;
|
|
12
12
|
/** The document as the host opened it, before any edit here. */
|
|
13
13
|
opened: DashboardDocument;
|
|
14
14
|
/** The givens the host resolved across the model and its imports. */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ListedReport } from '../Package/documentLocation';
|
|
2
|
+
import { PackageCatalog } from './catalog';
|
|
3
|
+
/**
|
|
4
|
+
* The catalog a report's builder offers: every source the package publishes,
|
|
5
|
+
* less the reports (offering a report's own tile views would be circular) and
|
|
6
|
+
* this file. A tile runs against this file and may read only the package
|
|
7
|
+
* surface; files off it are not readable anyway (their model GET is 404).
|
|
8
|
+
*
|
|
9
|
+
* Nothing cached depends on the listing or on `modelPath`: the model listing
|
|
10
|
+
* is cached per package version, and each model under its own path, so the
|
|
11
|
+
* exclusions are applied on render and always follow the current listing and
|
|
12
|
+
* path. A listing that failed and then recovered, or a second report opened
|
|
13
|
+
* from the same cache, never inherits what a first read left out. The models
|
|
14
|
+
* excluded now are not fetched, so the builder never re-reads its own file or
|
|
15
|
+
* another report. Undefined until the listing and every model it needs have
|
|
16
|
+
* answered.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useEditorCatalog({ environmentName, packageName, versionId, modelPath, reports, reportsSettled, }: {
|
|
19
|
+
environmentName: string;
|
|
20
|
+
packageName: string;
|
|
21
|
+
versionId?: string;
|
|
22
|
+
modelPath: string;
|
|
23
|
+
reports: readonly ListedReport[];
|
|
24
|
+
reportsSettled: boolean;
|
|
25
|
+
}): PackageCatalog | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DocumentStorage, Workspace } from '../DocumentStorage';
|
|
2
|
-
import {
|
|
2
|
+
import { ReportLayout } from '../Package/documentLocation';
|
|
3
3
|
import { Dispatch, SetStateAction } from 'react';
|
|
4
4
|
/**
|
|
5
5
|
* The host's copy of the document, if one was saved earlier: which workspace
|
|
@@ -8,9 +8,11 @@ import { Dispatch, SetStateAction } from 'react';
|
|
|
8
8
|
* Read once per document, from the host's {@link DocumentStorage}. A host
|
|
9
9
|
* without one has nothing to read, so the answer is in at once.
|
|
10
10
|
*/
|
|
11
|
-
export declare function useHostCopy({ storage,
|
|
11
|
+
export declare function useHostCopy({ storage, layout, notebook, environmentName, packageName, modelPath, }: {
|
|
12
12
|
storage: DocumentStorage | undefined;
|
|
13
|
-
|
|
13
|
+
/** The layout the report opened with; a read finds the copy at its path whatever its layout. */
|
|
14
|
+
layout: ReportLayout;
|
|
15
|
+
/** The report opened linear: only an authoritative store's copy of it is read. */
|
|
14
16
|
notebook: boolean;
|
|
15
17
|
environmentName: string;
|
|
16
18
|
packageName: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { MutableRefObject, Dispatch, SetStateAction, RefObject } from 'react';
|
|
2
2
|
import { Workspace } from '../DocumentStorage';
|
|
3
3
|
import { DashboardDocument } from './document';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { ReportLayout } from '../Package/documentLocation';
|
|
5
|
+
import { ReportEventHandler } from '../Report/telemetry';
|
|
6
|
+
export declare const LEGACY_REFUSAL = "a .malloynb notebook is read, not edited. Fix: rewrite it as a `.malloy` report to edit it here.";
|
|
6
7
|
/** The document the builder is on, and what it was opened from. */
|
|
7
8
|
export interface OpenedDocument {
|
|
8
9
|
source: string;
|
|
@@ -24,7 +25,7 @@ export interface OpenedDocument {
|
|
|
24
25
|
* refusal), and keeps a newer version behind a banner rather than loading it
|
|
25
26
|
* over work the reader has not saved.
|
|
26
27
|
*/
|
|
27
|
-
export declare function useOpenedDocument({ workspace, draft, draftChecked, readFailure, packageText, fetchedAt, packageSettled, modelPath, notebook, noun,
|
|
28
|
+
export declare function useOpenedDocument({ workspace, draft, draftChecked, readFailure, packageText, fetchedAt, packageSettled, modelPath, layout, notebook, noun, legacyFormat, textHeld, startedAt, onEventRef, }: {
|
|
28
29
|
workspace: Workspace | undefined;
|
|
29
30
|
/** The host's copy, if one was read. */
|
|
30
31
|
draft: string | undefined;
|
|
@@ -38,15 +39,16 @@ export declare function useOpenedDocument({ workspace, draft, draftChecked, read
|
|
|
38
39
|
/** Whether the package's fetch has succeeded and is not refetching. */
|
|
39
40
|
packageSettled: boolean;
|
|
40
41
|
modelPath: string;
|
|
42
|
+
/** The layout the host opened it as: what a failure before the text is read reports. */
|
|
43
|
+
layout: ReportLayout;
|
|
41
44
|
notebook: boolean;
|
|
42
45
|
noun: string;
|
|
43
|
-
refusedEvent: "notebook.open_refused" | "dashboard.open_refused";
|
|
44
46
|
legacyFormat: boolean;
|
|
45
47
|
/** The document is held as text by the host: there is no package file to fall back on. */
|
|
46
48
|
textHeld: boolean;
|
|
47
49
|
/** When the open was asked for, so "opened" can say how long it took. */
|
|
48
50
|
startedAt: MutableRefObject<number>;
|
|
49
|
-
onEventRef: MutableRefObject<
|
|
51
|
+
onEventRef: MutableRefObject<ReportEventHandler | undefined>;
|
|
50
52
|
}): {
|
|
51
53
|
authoritative: boolean;
|
|
52
54
|
blockedOnRecord: boolean;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DashboardDocument } from './document';
|
|
2
2
|
import { DocumentEditor, SaveHandler, SaveOutcome } from './useDocumentEditor';
|
|
3
|
-
export type
|
|
3
|
+
export type ReportEditorHandle = DocumentEditor<DashboardDocument>;
|
|
4
4
|
export type { SaveOutcome };
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function useReportEditor(options: {
|
|
6
6
|
/** The file as read from storage. */
|
|
7
7
|
source: string;
|
|
8
8
|
/** The document that file produced. */
|
|
@@ -20,10 +20,6 @@ export declare function useDashboardEditor(options: {
|
|
|
20
20
|
};
|
|
21
21
|
/** The file a save overwrites when `source` is a draft of it ({@link DocumentEditorOptions.replaces}). */
|
|
22
22
|
replaces?: string;
|
|
23
|
-
/** The file's path within the package. */
|
|
24
|
-
modelPath?: string;
|
|
25
|
-
/** The document is held as text: a kind switch always writes `kind=`. */
|
|
26
|
-
explicitKind?: boolean;
|
|
27
23
|
/** The sources a document held as text sees without an `import`. */
|
|
28
24
|
visibleSources?: readonly string[];
|
|
29
|
-
}):
|
|
25
|
+
}): ReportEditorHandle;
|
|
@@ -2,7 +2,7 @@ import { QueryClient } from '@tanstack/react-query';
|
|
|
2
2
|
import { Dispatch, MutableRefObject, SetStateAction } from 'react';
|
|
3
3
|
import { DocumentStorage, Workspace } from '../DocumentStorage';
|
|
4
4
|
import { useServer } from '../ServerProvider';
|
|
5
|
-
import {
|
|
5
|
+
import { ReportLayout } from '../Package/documentLocation';
|
|
6
6
|
import { OpenedDocument } from './useOpenedDocument';
|
|
7
7
|
import { SavesTo } from './documentSession';
|
|
8
8
|
/**
|
|
@@ -10,10 +10,12 @@ import { SavesTo } from './documentSession';
|
|
|
10
10
|
* package, and what each write does to the editor's idea of which text is
|
|
11
11
|
* open, which was seen, and what the next save is spliced against.
|
|
12
12
|
*/
|
|
13
|
-
export declare function useSaveChannel({ storage, workspace,
|
|
13
|
+
export declare function useSaveChannel({ storage, workspace, layout, notebook, environmentName, packageName, modelPath, versionId, apiClients, queryClient, mutable, textHeld, readFailure, authoritative, resume, setResume, setOpened, setDraft, setOffered, setSeen, setWrote, savedHashRef, packageBaseRef, fetchedAtRef, }: {
|
|
14
14
|
storage: DocumentStorage | undefined;
|
|
15
15
|
workspace: Workspace | undefined;
|
|
16
|
-
|
|
16
|
+
/** The layout the report opened with: what a save records until the document says otherwise. */
|
|
17
|
+
layout: ReportLayout;
|
|
18
|
+
/** The report opened linear: its record is read back only from an authoritative store. */
|
|
17
19
|
notebook: boolean;
|
|
18
20
|
environmentName: string;
|
|
19
21
|
packageName: string;
|
|
@@ -41,7 +43,7 @@ export declare function useSaveChannel({ storage, workspace, kind, notebook, env
|
|
|
41
43
|
packageBaseRef: MutableRefObject<string | undefined>;
|
|
42
44
|
fetchedAtRef: MutableRefObject<number>;
|
|
43
45
|
}): {
|
|
44
|
-
save: (source: string) => Promise<void>;
|
|
46
|
+
save: (source: string, layout?: ReportLayout) => Promise<void>;
|
|
45
47
|
savesTo: SavesTo;
|
|
46
48
|
writer: "package" | "storage";
|
|
47
49
|
pinnedPackageSave: boolean;
|