@malloy-publisher/sdk 0.9.6 → 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-BUb2Xvr2.es.js → RenderedResult-DZj-FnOJ.es.js} +2 -2
- package/dist/{ServerProvider-C6QQVKPm.es.js → ServerProvider-B_bPAsu2.es.js} +595 -410
- 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 +489 -111
- 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-0sxonf6N.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 +6 -4
- 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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright (c) Credible Data Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import type { ReportLayout } from "../Package/documentLocation";
|
|
5
|
+
import { layoutOfKind } from "./kindAdapter";
|
|
6
|
+
|
|
7
|
+
/** The key the browser store used when a document's type was part of its key: `publisher:document:<dashboard|notebook>:<path>`. */
|
|
8
|
+
const KIND_TYPED_KEY = /^publisher:document:(dashboard|notebook):(.+)$/;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Move the browser's drafts saved under the old type-keyed scheme to the
|
|
12
|
+
* path-keyed one, so a draft saved before the change is still found. Each
|
|
13
|
+
* becomes the document at its path, its old type read as its layout, and the
|
|
14
|
+
* old key goes. `adopt` writes one and answers false when its path already
|
|
15
|
+
* holds a document: a path saved under both old types keeps the first moved,
|
|
16
|
+
* and the other is left where it was rather than overwritten.
|
|
17
|
+
*/
|
|
18
|
+
export function migrateKindTypedDrafts(
|
|
19
|
+
storage: Storage,
|
|
20
|
+
adopt: (path: string, layout: ReportLayout, content: string) => boolean,
|
|
21
|
+
): void {
|
|
22
|
+
const keys: string[] = [];
|
|
23
|
+
for (let i = 0; i < storage.length; i++) {
|
|
24
|
+
const key = storage.key(i);
|
|
25
|
+
if (key !== null && KIND_TYPED_KEY.test(key)) keys.push(key);
|
|
26
|
+
}
|
|
27
|
+
for (const key of keys) {
|
|
28
|
+
const [, kind, path] = KIND_TYPED_KEY.exec(key) as RegExpExecArray;
|
|
29
|
+
const content = storage.getItem(key);
|
|
30
|
+
if (content === null) continue;
|
|
31
|
+
if (adopt(path, layoutOfKind(kind as "dashboard" | "notebook"), content))
|
|
32
|
+
storage.removeItem(key);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// Copyright (c) Credible Data Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import { describe, expect, it } from "bun:test";
|
|
5
|
+
import {
|
|
6
|
+
documentRoute,
|
|
7
|
+
legacyAliasOf,
|
|
8
|
+
locateDocument,
|
|
9
|
+
locateReportByName,
|
|
10
|
+
} from "./nameAlias";
|
|
11
|
+
|
|
12
|
+
const REPORTS = [
|
|
13
|
+
{ path: "overview.malloy", layout: "grid" },
|
|
14
|
+
{ path: "dashboards/overview.malloy", layout: "grid" },
|
|
15
|
+
{ path: "notebooks/overview.malloy", layout: "linear" },
|
|
16
|
+
{ path: "sales/q3.malloy", layout: "linear", editable: false },
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
describe("locateReportByName", () => {
|
|
20
|
+
const pair = [
|
|
21
|
+
{ path: "dashboards/overview.malloy", layout: "grid" },
|
|
22
|
+
{ path: "notebooks/overview.malloy", layout: "linear" },
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
it("prefers the one grid report a dashboard and a notebook share the name with", () => {
|
|
26
|
+
expect(locateReportByName("overview", pair)).toEqual({
|
|
27
|
+
found: {
|
|
28
|
+
layout: "grid",
|
|
29
|
+
path: "dashboards/overview.malloy",
|
|
30
|
+
editable: true,
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("prefers linear for the notebooks alias", () => {
|
|
36
|
+
const found = locateReportByName("overview", pair, "linear");
|
|
37
|
+
expect("found" in found && found.found.path).toBe(
|
|
38
|
+
"notebooks/overview.malloy",
|
|
39
|
+
);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("takes a unique report of the other layout when none of the preferred one has it", () => {
|
|
43
|
+
const found = locateReportByName("q3", REPORTS, "grid");
|
|
44
|
+
expect("found" in found && found.found.path).toBe("sales/q3.malloy");
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("reports ambiguity, naming the paths sorted, rather than taking the first", () => {
|
|
48
|
+
expect(
|
|
49
|
+
locateReportByName("overview", [
|
|
50
|
+
{ path: "z/overview.malloy", layout: "grid" },
|
|
51
|
+
{ path: "a/overview.malloy", layout: "grid" },
|
|
52
|
+
]),
|
|
53
|
+
).toEqual({ ambiguous: ["a/overview.malloy", "z/overview.malloy"] });
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("says when nothing has the name", () => {
|
|
57
|
+
expect(locateReportByName("absent", REPORTS)).toEqual({ missing: true });
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
describe("locateDocument (deprecated)", () => {
|
|
62
|
+
it("finds a report by the name a folder route carries, preferring the route's layout", () => {
|
|
63
|
+
const pair = [
|
|
64
|
+
{ path: "dashboards/story.malloy", layout: "grid" },
|
|
65
|
+
{ path: "notebooks/story.malloy", layout: "linear" },
|
|
66
|
+
];
|
|
67
|
+
expect(
|
|
68
|
+
locateDocument({ kind: "notebook", slug: "story", reports: pair })
|
|
69
|
+
?.path,
|
|
70
|
+
).toBe("notebooks/story.malloy");
|
|
71
|
+
expect(
|
|
72
|
+
locateDocument({ kind: "dashboard", slug: "story", reports: pair })
|
|
73
|
+
?.path,
|
|
74
|
+
).toBe("dashboards/story.malloy");
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("is undefined for a name no listing has, or one it cannot tell apart", () => {
|
|
78
|
+
expect(
|
|
79
|
+
locateDocument({ kind: "dashboard", slug: "x", reports: REPORTS }),
|
|
80
|
+
).toBeUndefined();
|
|
81
|
+
expect(
|
|
82
|
+
locateDocument({
|
|
83
|
+
kind: "dashboard",
|
|
84
|
+
slug: "x",
|
|
85
|
+
reports: [
|
|
86
|
+
{ path: "a/x.malloy", layout: "linear" },
|
|
87
|
+
{ path: "b/x.malloy", layout: "linear" },
|
|
88
|
+
],
|
|
89
|
+
}),
|
|
90
|
+
).toBeUndefined();
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
describe("legacyAliasOf", () => {
|
|
95
|
+
it("reads an old by-name route, with the layout its folder preferred", () => {
|
|
96
|
+
expect(legacyAliasOf("dashboards/overview")).toEqual({
|
|
97
|
+
name: "overview",
|
|
98
|
+
prefer: "grid",
|
|
99
|
+
});
|
|
100
|
+
expect(legacyAliasOf("notebooks/story")).toEqual({
|
|
101
|
+
name: "story",
|
|
102
|
+
prefer: "linear",
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it("is undefined for any other route", () => {
|
|
107
|
+
for (const route of [
|
|
108
|
+
"overview",
|
|
109
|
+
"sales/q3",
|
|
110
|
+
"dashboards/a/b",
|
|
111
|
+
"dashboards/",
|
|
112
|
+
"reports/overview",
|
|
113
|
+
])
|
|
114
|
+
expect(legacyAliasOf(route)).toBeUndefined();
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
describe("documentRoute (deprecated)", () => {
|
|
119
|
+
it("leaves the deprecated folder route as it was", () => {
|
|
120
|
+
expect(documentRoute("env", "pkg", "notebook", "a#b")).toBe(
|
|
121
|
+
"/env/pkg/notebooks/a%23b",
|
|
122
|
+
);
|
|
123
|
+
});
|
|
124
|
+
});
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// Copyright (c) Credible Data Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The DEPRECATED basename lookup, for old links only: a Console URL of the
|
|
6
|
+
* form `dashboards/<name>` or `notebooks/<name>`, from before reports were
|
|
7
|
+
* addressed by their path. Nothing new is resolved by name: a `# drill`
|
|
8
|
+
* names a path (`resolveDrillTarget`).
|
|
9
|
+
*/
|
|
10
|
+
import {
|
|
11
|
+
documentSlug,
|
|
12
|
+
listedLayout,
|
|
13
|
+
locatedReport,
|
|
14
|
+
type ListedReport,
|
|
15
|
+
type LocatedDocument,
|
|
16
|
+
type ReportLayout,
|
|
17
|
+
} from "../Package/documentLocation";
|
|
18
|
+
import { layoutOfKind, type DocumentKind } from "./kindAdapter";
|
|
19
|
+
|
|
20
|
+
/** What a by-name lookup found. */
|
|
21
|
+
export type NameLookup =
|
|
22
|
+
| { found: LocatedDocument }
|
|
23
|
+
| { ambiguous: string[] }
|
|
24
|
+
| { missing: true };
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The report a basename names. A dashboard and a notebook could share one
|
|
28
|
+
* (`dashboards/overview.malloy` beside `notebooks/overview.malloy`), so the
|
|
29
|
+
* preferred layout is tried first: exactly one report of that layout with the
|
|
30
|
+
* name resolves. Failing that, exactly one report of either layout does.
|
|
31
|
+
* Anything else is ambiguous, and says which paths, rather than taking the
|
|
32
|
+
* first match.
|
|
33
|
+
*/
|
|
34
|
+
export function locateReportByName(
|
|
35
|
+
name: string,
|
|
36
|
+
reports: readonly ListedReport[],
|
|
37
|
+
prefer: ReportLayout = "grid",
|
|
38
|
+
): NameLookup {
|
|
39
|
+
const named = reports
|
|
40
|
+
.filter((r): r is ListedReport & { path: string } => !!r.path)
|
|
41
|
+
.filter((r) => documentSlug(r.path) === name);
|
|
42
|
+
const preferred = named.filter((r) => listedLayout(r) === prefer);
|
|
43
|
+
if (preferred.length === 1) return { found: locatedReport(preferred[0]) };
|
|
44
|
+
if (named.length === 1) return { found: locatedReport(named[0]) };
|
|
45
|
+
if (named.length === 0) return { missing: true };
|
|
46
|
+
return { ambiguous: named.map((r) => r.path).sort() };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const ALIAS_ROUTE = /^(dashboards|notebooks)\/([^/]+)$/;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* An old by-name route under a package, `dashboards/<name>` or
|
|
53
|
+
* `notebooks/<name>`: the name, and the layout its folder preferred. Undefined
|
|
54
|
+
* for any other route.
|
|
55
|
+
*/
|
|
56
|
+
export function legacyAliasOf(
|
|
57
|
+
routePath: string,
|
|
58
|
+
): { name: string; prefer: ReportLayout } | undefined {
|
|
59
|
+
const alias = ALIAS_ROUTE.exec(routePath);
|
|
60
|
+
if (!alias) return undefined;
|
|
61
|
+
return {
|
|
62
|
+
name: alias[2],
|
|
63
|
+
prefer: alias[1] === "dashboards" ? "grid" : "linear",
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated A report is addressed by its path; use `reportRoute`. The
|
|
69
|
+
* Console route of `dashboards/<slug>` or `notebooks/<slug>`, which now answer
|
|
70
|
+
* only as compatibility aliases.
|
|
71
|
+
*/
|
|
72
|
+
export const documentRoute = (
|
|
73
|
+
environmentName: string,
|
|
74
|
+
packageName: string,
|
|
75
|
+
kind: DocumentKind,
|
|
76
|
+
slug: string,
|
|
77
|
+
) => `/${environmentName}/${packageName}/${kind}s/${encodeURIComponent(slug)}`;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @deprecated Use `locateReport` with a path. Finds a report by the basename a
|
|
81
|
+
* `dashboards/<slug>` or `notebooks/<slug>` route names, preferring the
|
|
82
|
+
* route's own layout, and undefined when the name is missing or ambiguous.
|
|
83
|
+
*/
|
|
84
|
+
export function locateDocument({
|
|
85
|
+
kind,
|
|
86
|
+
slug,
|
|
87
|
+
reports,
|
|
88
|
+
}: {
|
|
89
|
+
kind: DocumentKind;
|
|
90
|
+
slug: string;
|
|
91
|
+
reports: readonly ListedReport[];
|
|
92
|
+
}): LocatedDocument | undefined {
|
|
93
|
+
const lookup = locateReportByName(slug, reports, layoutOfKind(kind));
|
|
94
|
+
return "found" in lookup ? lookup.found : undefined;
|
|
95
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Copyright (c) Credible Data Inc.
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
import type { QueryKey } from "@tanstack/react-query";
|
|
5
|
+
import { encodeResourceUri } from "../../utils/formatting";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The cache entries the deprecated report readers keep: the `Dashboard`
|
|
9
|
+
* wrapper's manifest, the old dashboard and notebook listings a host may
|
|
10
|
+
* still key on, and the `Notebook` wrapper's read, which it keys on the
|
|
11
|
+
* report's resource URI.
|
|
12
|
+
*/
|
|
13
|
+
export function legacyReportQueryKeys(
|
|
14
|
+
environmentName: string,
|
|
15
|
+
packageName: string,
|
|
16
|
+
modelPath?: string,
|
|
17
|
+
): QueryKey[] {
|
|
18
|
+
return [
|
|
19
|
+
["dashboards"],
|
|
20
|
+
["notebooks"],
|
|
21
|
+
["dashboard"],
|
|
22
|
+
...(modelPath === undefined
|
|
23
|
+
? []
|
|
24
|
+
: [[encodeResourceUri({ environmentName, packageName, modelPath })]]),
|
|
25
|
+
];
|
|
26
|
+
}
|
|
@@ -346,17 +346,17 @@ describe("useGivensState: swapping documents", () => {
|
|
|
346
346
|
onParamsChange: (next) => reported.push(next),
|
|
347
347
|
autorun: true,
|
|
348
348
|
}),
|
|
349
|
-
{ initialProps: { doc: "a.
|
|
349
|
+
{ initialProps: { doc: "a.malloy", params: {} } },
|
|
350
350
|
);
|
|
351
351
|
|
|
352
352
|
act(() => result.current.setGiven("REGION", "West"));
|
|
353
353
|
expect(entries(result.current.applied)).toEqual({ REGION: "West" });
|
|
354
354
|
|
|
355
355
|
// The host writes it to the URL and feeds it straight back in.
|
|
356
|
-
rerender({ doc: "a.
|
|
356
|
+
rerender({ doc: "a.malloy", params: { REGION: "West" } });
|
|
357
357
|
expect(entries(result.current.applied)).toEqual({ REGION: "West" });
|
|
358
358
|
|
|
359
|
-
rerender({ doc: "b.
|
|
359
|
+
rerender({ doc: "b.malloy", params: {} });
|
|
360
360
|
expect(entries(result.current.applied)).toEqual({});
|
|
361
361
|
expect(reported.at(-1)).toEqual({});
|
|
362
362
|
});
|
|
@@ -372,7 +372,7 @@ describe("useGivensState: swapping documents", () => {
|
|
|
372
372
|
useGivensState({
|
|
373
373
|
declaredTypes: props.types,
|
|
374
374
|
startingValues: { STATUS: "open" },
|
|
375
|
-
documentKey: "orders.
|
|
375
|
+
documentKey: "orders.malloy",
|
|
376
376
|
autorun: true,
|
|
377
377
|
}),
|
|
378
378
|
{
|
|
@@ -408,7 +408,7 @@ describe("useGivensState: swapping documents", () => {
|
|
|
408
408
|
["B", "string"],
|
|
409
409
|
]),
|
|
410
410
|
params: props.params,
|
|
411
|
-
documentKey: "orders.
|
|
411
|
+
documentKey: "orders.malloy",
|
|
412
412
|
autorun: true,
|
|
413
413
|
}),
|
|
414
414
|
{ initialProps: { params: { A: "1", B: "2" } } },
|
|
@@ -433,17 +433,17 @@ describe("useGivensState: swapping documents", () => {
|
|
|
433
433
|
documentKey: props.doc,
|
|
434
434
|
autorun: true,
|
|
435
435
|
}),
|
|
436
|
-
{ initialProps: { doc: "a.
|
|
436
|
+
{ initialProps: { doc: "a.malloy", params: {} } },
|
|
437
437
|
);
|
|
438
438
|
|
|
439
439
|
act(() => result.current.setGiven("REGION", "East"));
|
|
440
440
|
// The host echoes it into the URL, then the reader navigates away.
|
|
441
|
-
rerender({ doc: "a.
|
|
442
|
-
rerender({ doc: "b.
|
|
441
|
+
rerender({ doc: "a.malloy", params: { REGION: "East" } });
|
|
442
|
+
rerender({ doc: "b.malloy", params: {} });
|
|
443
443
|
expect(entries(result.current.applied)).toEqual({});
|
|
444
444
|
|
|
445
445
|
// Back to the first notebook from a link carrying no query string.
|
|
446
|
-
rerender({ doc: "a.
|
|
446
|
+
rerender({ doc: "a.malloy", params: {} });
|
|
447
447
|
expect(entries(result.current.applied)).toEqual({});
|
|
448
448
|
});
|
|
449
449
|
});
|
package/src/mainEntry.spec.ts
CHANGED
|
@@ -17,7 +17,7 @@ const SRC = import.meta.dir;
|
|
|
17
17
|
|
|
18
18
|
/** Builder-only modules: they pull in the Malloy parser, which the main entry must not reach. */
|
|
19
19
|
const BUILDER_ONLY =
|
|
20
|
-
/^components\/
|
|
20
|
+
/^components\/(ReportBuilder\/(legacyNotebook|ReportEditor|readDocument|spliceDocument|malloyTree|InlineText|InlineMarkdown)|legacy\/(NotebookEditor|builderNames))\./;
|
|
21
21
|
|
|
22
22
|
const EXTENSIONS = [".ts", ".tsx", "/index.ts", "/index.tsx"];
|
|
23
23
|
|
package/src/textEntry.spec.ts
CHANGED
|
@@ -44,7 +44,7 @@ describe("@malloy-publisher/sdk/text", () => {
|
|
|
44
44
|
fs.writeFileSync(
|
|
45
45
|
path.join(dir, "check.mjs"),
|
|
46
46
|
`import { artifactTag, splitSourceLines } from "./text.mjs";
|
|
47
|
-
const tag = artifactTag(splitSourceLines("x\\r\\n## artifact {
|
|
47
|
+
const tag = artifactTag(splitSourceLines("x\\r\\n## artifact { layout=linear }\\r\\nrun: a"));
|
|
48
48
|
console.log(JSON.stringify({ tag, document: typeof document }));`,
|
|
49
49
|
);
|
|
50
50
|
const run = Bun.spawnSync(["node", "check.mjs"], { cwd: dir });
|
|
@@ -54,7 +54,7 @@ console.log(JSON.stringify({ tag, document: typeof document }));`,
|
|
|
54
54
|
from: 1,
|
|
55
55
|
to: 1,
|
|
56
56
|
block: false,
|
|
57
|
-
text: "## artifact {
|
|
57
|
+
text: "## artifact { layout=linear }",
|
|
58
58
|
},
|
|
59
59
|
document: "undefined",
|
|
60
60
|
});
|
|
@@ -85,28 +85,28 @@ describe("artifactTag", () => {
|
|
|
85
85
|
const tagOf = (source: string) => artifactTag(splitSourceLines(source));
|
|
86
86
|
|
|
87
87
|
it("finds a one-line tag and a block tag, by line", () => {
|
|
88
|
-
expect(tagOf("##! x\n## artifact {
|
|
88
|
+
expect(tagOf("##! x\n## artifact { layout=grid }\nrun: a")).toEqual({
|
|
89
89
|
from: 1,
|
|
90
90
|
to: 1,
|
|
91
91
|
block: false,
|
|
92
|
-
text: "## artifact {
|
|
92
|
+
text: "## artifact { layout=grid }",
|
|
93
93
|
});
|
|
94
|
-
expect(tagOf("##| artifact {
|
|
94
|
+
expect(tagOf("##| artifact { layout=linear\n}\n|##\nrun: a")).toEqual({
|
|
95
95
|
from: 0,
|
|
96
96
|
to: 2,
|
|
97
97
|
block: true,
|
|
98
|
-
text: "##| artifact {
|
|
98
|
+
text: "##| artifact { layout=linear\n}",
|
|
99
99
|
});
|
|
100
100
|
});
|
|
101
101
|
|
|
102
102
|
it("reads the same tag from CRLF text", () => {
|
|
103
103
|
expect(
|
|
104
|
-
tagOf("##| artifact {
|
|
105
|
-
).toEqual(tagOf("##| artifact {
|
|
104
|
+
tagOf("##| artifact { layout=linear\r\n}\r\n|##\r\nrun: a"),
|
|
105
|
+
).toEqual(tagOf("##| artifact { layout=linear\n}\n|##\nrun: a"));
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
it("finds none in an untagged file or inside another block", () => {
|
|
109
109
|
expect(tagOf("source: a is b")).toBeUndefined();
|
|
110
|
-
expect(tagOf('##|"\n## artifact {
|
|
110
|
+
expect(tagOf('##|"\n## artifact { layout=linear }\n|##')).toBeUndefined();
|
|
111
111
|
});
|
|
112
112
|
});
|
|
@@ -32,20 +32,20 @@ describe("parseResourceUri", () => {
|
|
|
32
32
|
|
|
33
33
|
it("should parse a modelPath URI", () => {
|
|
34
34
|
const resourceUri =
|
|
35
|
-
"publisher://environments/malloy-samples/packages/names/models/names1.
|
|
35
|
+
"publisher://environments/malloy-samples/packages/names/models/names1.malloy";
|
|
36
36
|
const parsedResource = parseResourceUri(resourceUri);
|
|
37
37
|
expect(parsedResource).toEqual({
|
|
38
38
|
environmentName: "malloy-samples",
|
|
39
39
|
packageName: "names",
|
|
40
40
|
connectionName: undefined,
|
|
41
|
-
modelPath: "names1.
|
|
41
|
+
modelPath: "names1.malloy",
|
|
42
42
|
versionId: undefined,
|
|
43
43
|
});
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
it("should throw an error if the resource URI has the wrong protocol", () => {
|
|
47
47
|
const resourceUri =
|
|
48
|
-
"http://environments/malloy-samples/packages/names/models/names1.
|
|
48
|
+
"http://environments/malloy-samples/packages/names/models/names1.malloy";
|
|
49
49
|
expect(() => parseResourceUri(resourceUri)).toThrow(
|
|
50
50
|
`Failed to parse resource URI: ${resourceUri}`,
|
|
51
51
|
);
|
|
@@ -117,11 +117,11 @@ describe("encodeResourceUri", () => {
|
|
|
117
117
|
environmentName: "malloy-samples",
|
|
118
118
|
packageName: "names",
|
|
119
119
|
connectionName: undefined,
|
|
120
|
-
modelPath: "names1.
|
|
120
|
+
modelPath: "names1.malloy",
|
|
121
121
|
versionId: undefined,
|
|
122
122
|
});
|
|
123
123
|
expect(resourceUri).toEqual(
|
|
124
|
-
"publisher://environments/malloy-samples/packages/names/models/names1.
|
|
124
|
+
"publisher://environments/malloy-samples/packages/names/models/names1.malloy",
|
|
125
125
|
);
|
|
126
126
|
});
|
|
127
127
|
|
|
@@ -27,7 +27,7 @@ describe("getEnvironmentDescription", () => {
|
|
|
27
27
|
it("should return a placeholder description if the README is empty", () => {
|
|
28
28
|
const readme = "";
|
|
29
29
|
expect(getEnvironmentDescription(readme)).toBe(
|
|
30
|
-
"Explore semantic models, run queries, and build
|
|
30
|
+
"Explore semantic models, run queries, and build reports",
|
|
31
31
|
);
|
|
32
32
|
});
|
|
33
33
|
});
|
package/src/utils/parsing.ts
CHANGED
|
@@ -6,7 +6,7 @@ export const getEnvironmentDescription = (
|
|
|
6
6
|
readme: string | undefined,
|
|
7
7
|
): string => {
|
|
8
8
|
if (!readme) {
|
|
9
|
-
return "Explore semantic models, run queries, and build
|
|
9
|
+
return "Explore semantic models, run queries, and build reports";
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
// Remove markdown formatting and get first paragraph
|