@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
package/README.md
CHANGED
|
@@ -19,9 +19,10 @@ The Publisher SDK (`@malloy-publisher/sdk`) is a comprehensive React component l
|
|
|
19
19
|
8. [Hooks](#hooks)
|
|
20
20
|
9. [Utilities](#utilities)
|
|
21
21
|
10. [Document Storage](#document-storage)
|
|
22
|
-
11. [
|
|
23
|
-
12. [
|
|
24
|
-
13. [
|
|
22
|
+
11. [Telemetry](#telemetry)
|
|
23
|
+
12. [Styling](#styling)
|
|
24
|
+
13. [Building a Custom Data App](#building-a-custom-data-app)
|
|
25
|
+
14. [API Reference](#api-reference)
|
|
25
26
|
|
|
26
27
|
---
|
|
27
28
|
|
|
@@ -949,8 +950,8 @@ store; a repo-backed host writes them to the package directory.
|
|
|
949
950
|
### DocumentStorage Interface
|
|
950
951
|
|
|
951
952
|
```tsx
|
|
952
|
-
/**
|
|
953
|
-
type DocumentType = "
|
|
953
|
+
/** A report's layout, recorded beside the document: metadata, not identity. */
|
|
954
|
+
type DocumentType = "grid" | "linear";
|
|
954
955
|
|
|
955
956
|
interface Workspace {
|
|
956
957
|
name: string;
|
|
@@ -969,8 +970,10 @@ interface Workspace {
|
|
|
969
970
|
|
|
970
971
|
interface DocumentLocator {
|
|
971
972
|
workspace: string;
|
|
973
|
+
/** The report's layout: a save records it, a listing reports it. */
|
|
972
974
|
type: DocumentType;
|
|
973
|
-
|
|
975
|
+
/** The identity: "<env>/<pkg>/<package path>", e.g. "env/pkg/sales/overview.malloy". */
|
|
976
|
+
path: string;
|
|
974
977
|
}
|
|
975
978
|
|
|
976
979
|
interface DocumentStorage {
|
|
@@ -980,13 +983,32 @@ interface DocumentStorage {
|
|
|
980
983
|
type?: DocumentType,
|
|
981
984
|
): Promise<DocumentLocator[]>;
|
|
982
985
|
getDocument(locator: DocumentLocator): Promise<string>;
|
|
986
|
+
/** Optional: the layout recorded for the one document at locator.path, without listing the workspace. */
|
|
987
|
+
getDocumentType?(
|
|
988
|
+
locator: Pick<DocumentLocator, "workspace" | "path">,
|
|
989
|
+
): Promise<DocumentType>;
|
|
983
990
|
saveDocument(locator: DocumentLocator, content: string): Promise<void>;
|
|
984
991
|
deleteDocument(locator: DocumentLocator): Promise<void>;
|
|
985
992
|
moveDocument(from: DocumentLocator, to: DocumentLocator): Promise<void>;
|
|
993
|
+
/** Optional: the package-relative path saveDocument(locator) really writes. */
|
|
994
|
+
resolveDocumentPath?(locator: DocumentLocator): string | Promise<string>;
|
|
986
995
|
}
|
|
987
996
|
```
|
|
988
997
|
|
|
989
|
-
|
|
998
|
+
**Creating a report into your store.** `createDocument` writes a new report at the **package root** by
|
|
999
|
+
default (`sales.malloy`, not `dashboards/sales.malloy`), or in the `directory` or at the `path` the caller
|
|
1000
|
+
gives, and always writes `layout=grid` or `layout=linear` in the artifact tag. It asks your store for the
|
|
1001
|
+
locator `<env>/<pkg>/<path>` and renders the file's imports relative to `<path>`. A store that files
|
|
1002
|
+
documents somewhere else, for example every grid report under `dashboards/<basename>`, implements
|
|
1003
|
+
`resolveDocumentPath(locator)` and returns the package-relative path `saveDocument` will really write:
|
|
1004
|
+
`createDocument` calls it before rendering, writes the imports for that path, skips a name whose real path
|
|
1005
|
+
the package already has, and returns that path as `CreatedDocument.path`. A store without it is assumed to
|
|
1006
|
+
write at the path asked for, as before.
|
|
1007
|
+
|
|
1008
|
+
`getDocumentType` is optional too: the SDK uses it to learn a draft's layout before opening it, and
|
|
1009
|
+
falls back to `listDocuments` (which reads the whole workspace) when a store leaves it out.
|
|
1010
|
+
|
|
1011
|
+
`getDocument`, `getDocumentType`, `deleteDocument` and `moveDocument` reject with `DocumentNotFoundError`
|
|
990
1012
|
when the document is not there, and with anything else when the backend could not be
|
|
991
1013
|
asked. The distinction is load-bearing rather than cosmetic: a failed read reported as
|
|
992
1014
|
"there is no document" reads as "the package is the only copy", and saving on that
|
|
@@ -994,13 +1016,24 @@ belief overwrites the copy that was actually there. Use `isDocumentNotFound(erro
|
|
|
994
1016
|
rather than `instanceof`, since the `es` and `cjs` builds carry their own copy of the
|
|
995
1017
|
class.
|
|
996
1018
|
|
|
997
|
-
A document is a string
|
|
998
|
-
|
|
999
|
-
|
|
1019
|
+
A document is a string, and **its path is its identity**: one path is one document. The `type` on
|
|
1020
|
+
its locator is the report's layout (`grid` or `linear`), metadata the store keeps beside the
|
|
1021
|
+
document. `saveDocument` and `moveDocument` record it (a layout switch saves the same path with the
|
|
1022
|
+
other layout, replacing the document), `listDocuments` reports it and may filter by it, and
|
|
1023
|
+
`getDocument` and `deleteDocument` find the document at `locator.path` whatever `type` says. Every
|
|
1024
|
+
method rejects when the document is not there, so a caller can tell "missing" from "empty".
|
|
1025
|
+
|
|
1026
|
+
A store written against the earlier contract, which keyed a document by `type` and `path` together
|
|
1027
|
+
with `type` `"dashboard"` or `"notebook"`, keys by `path` alone and records the layout instead:
|
|
1028
|
+
`grid` for what was `dashboard`, `linear` for what was `notebook`.
|
|
1000
1029
|
|
|
1001
1030
|
### BrowserDocumentStorage
|
|
1002
1031
|
|
|
1003
|
-
The default: one workspace named `Local`, private to this browser and origin.
|
|
1032
|
+
The default: one workspace named `Local`, private to this browser and origin. A document is kept
|
|
1033
|
+
under `publisher:report:<path>` with its layout. A draft saved under the earlier type-keyed scheme
|
|
1034
|
+
(`publisher:document:<dashboard|notebook>:<path>`) is moved to its path the first time the store is
|
|
1035
|
+
used, so it is still found; where a document is already at that path, the older copy is left where
|
|
1036
|
+
it was rather than written over it.
|
|
1004
1037
|
|
|
1005
1038
|
```tsx
|
|
1006
1039
|
import {
|
|
@@ -1017,8 +1050,8 @@ const storage = new BrowserDocumentStorage();
|
|
|
1017
1050
|
|
|
1018
1051
|
### A custom backend
|
|
1019
1052
|
|
|
1020
|
-
Implement the interface over whatever you have. For example, over a document API keyed by workspace
|
|
1021
|
-
|
|
1053
|
+
Implement the interface over whatever you have. For example, over a document API keyed by workspace
|
|
1054
|
+
and path, with the layout stored on the document:
|
|
1022
1055
|
|
|
1023
1056
|
```tsx
|
|
1024
1057
|
class ApiDocumentStorage implements DocumentStorage {
|
|
@@ -1071,6 +1104,25 @@ class ApiDocumentStorage implements DocumentStorage {
|
|
|
1071
1104
|
}
|
|
1072
1105
|
```
|
|
1073
1106
|
|
|
1107
|
+
### Hosts that file reports by layout
|
|
1108
|
+
|
|
1109
|
+
The builder (`ReportEditor` / `ReportBuilder` from `@malloy-publisher/sdk/builder`; `DashboardEditor` / `DashboardBuilder` are deprecated aliases) reads a report's
|
|
1110
|
+
layout from its text alone, never from where the file lives, in the same order the server uses, first match
|
|
1111
|
+
wins:
|
|
1112
|
+
|
|
1113
|
+
1. `layout=` in the model-level `## artifact` tag: `grid` or `linear`.
|
|
1114
|
+
2. Otherwise grid when the tag lists `tiles` (an empty list counts) or the file carries a model-level `dashboard { … }` grid tag.
|
|
1115
|
+
3. Otherwise linear.
|
|
1116
|
+
|
|
1117
|
+
A tag that sets the removed `kind=` makes no report, and the builder refuses to open it, naming the
|
|
1118
|
+
`layout=` to write. A file that writes `layout=` never depends on steps 2 and 3, and the builder and
|
|
1119
|
+
`createDocument` always write it. `readReportTagOfText(text)` from `@malloy-publisher/sdk/builder` gives
|
|
1120
|
+
the same answer for any text, for a host that files a document by its layout. The toolbar's Linear / Grid switch rewrites `layout=` and nothing else, so a host that ties a
|
|
1121
|
+
report's layout to where it keeps the file (every grid report under `dashboards/`, every linear one under
|
|
1122
|
+
`notebooks/`) passes `allowLayoutChange={false}` to hide the switch; otherwise an author can turn a file
|
|
1123
|
+
into the other layout without it moving. Default `true`. A document held as text (`textSource`) never
|
|
1124
|
+
gets the switch.
|
|
1125
|
+
|
|
1074
1126
|
### DocumentStorageProvider
|
|
1075
1127
|
|
|
1076
1128
|
```tsx
|
|
@@ -1086,15 +1138,63 @@ import {
|
|
|
1086
1138
|
// Inside a component:
|
|
1087
1139
|
function MyComponent() {
|
|
1088
1140
|
const { documentStorage } = useDocumentStorage();
|
|
1089
|
-
const
|
|
1141
|
+
const grids = await documentStorage.listDocuments(
|
|
1090
1142
|
{ name: "Local", writeable: true, description: "" },
|
|
1091
|
-
"
|
|
1143
|
+
"grid",
|
|
1092
1144
|
);
|
|
1093
1145
|
}
|
|
1094
1146
|
```
|
|
1095
1147
|
|
|
1096
1148
|
---
|
|
1097
1149
|
|
|
1150
|
+
## Telemetry
|
|
1151
|
+
|
|
1152
|
+
The report surfaces report what happens on them through an `onEvent` prop, for the host to log or count:
|
|
1153
|
+
`Report` (every layout), `ReportEditor` and `ReportBuilder` from `@malloy-publisher/sdk/builder`,
|
|
1154
|
+
`NewDocumentDialog`, `Package` (for its New report dialog), and the deprecated `Dashboard`. Every event is a
|
|
1155
|
+
`ReportEvent`, named `report.*`, and carries the report's package `path` and its `layout`; the host knows the
|
|
1156
|
+
environment and package and adds them when it logs.
|
|
1157
|
+
|
|
1158
|
+
| Event | Fields | Emitted by |
|
|
1159
|
+
| -------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
1160
|
+
| `report.opened` | `surface` (`view`/`edit`), `from` (`package`/`draft`/`record`), `tiles`, `durationMs` | `Report` once per report shown; the editor once per open |
|
|
1161
|
+
| `report.load_failed` | `surface`, `category`; `layout` only when known | `Report`, the editor |
|
|
1162
|
+
| `report.query_failed` | `tile` (index; absent for the run as a whole), `category` | a grid or linear tile, a `run:` cell |
|
|
1163
|
+
| `report.rows_shown` | `source`, `view`, `field`, `ok`, `durationMs` | the rows behind a value, on a grid or linear report |
|
|
1164
|
+
| `report.saved` | `tiles`, `structural`, `where`, `workspace?`, `converted?`, `durationMs` | the builder |
|
|
1165
|
+
| `report.save_refused` | `reason` | the builder |
|
|
1166
|
+
| `report.save_undone` | `tiles`, `structural`, `where`, `workspace?`, `durationMs` | the builder (Undo save) |
|
|
1167
|
+
| `report.save_undo_refused` | `reason` | the builder |
|
|
1168
|
+
| `report.created` | `where` (`package`/`host`), `durationMs` | `createDocument`, so `NewDocumentDialog` and `Package` |
|
|
1169
|
+
| `report.create_refused` | `reason` | `createDocument` |
|
|
1170
|
+
| `report.layout_changed` | `from`, `to` | the builder's Linear / Grid switch |
|
|
1171
|
+
| `report.drill` | `to` (`self`/`report`), `outcome` (`resolved`/`unresolved`/`unverified`/`malformed`) | `Report`: a `to=self` drill, or a drill to another report whose `onNavigate` returned an outcome |
|
|
1172
|
+
| `report.explored` | `tile` | reserved: nothing emits it yet |
|
|
1173
|
+
|
|
1174
|
+
`category` is a `ReportFailure` (`not_found`, `forbidden`, `invalid`, `unsupported`, `server`, `network`,
|
|
1175
|
+
`unknown`), never the error's message, which can carry a path or a value. A sink that throws is ignored, so
|
|
1176
|
+
telemetry never breaks a report. Inside a `Report`, a failed cell and a refused `to=self` drill are reported
|
|
1177
|
+
to `onEvent` instead of the browser console; with no `onEvent` they are still logged.
|
|
1178
|
+
|
|
1179
|
+
```tsx
|
|
1180
|
+
import { Report, type ReportEvent } from "@malloy-publisher/sdk";
|
|
1181
|
+
|
|
1182
|
+
const onEvent = (event: ReportEvent) =>
|
|
1183
|
+
analytics.track(event.type, {
|
|
1184
|
+
environment: "prod",
|
|
1185
|
+
package: "sales",
|
|
1186
|
+
...event,
|
|
1187
|
+
});
|
|
1188
|
+
|
|
1189
|
+
<Report
|
|
1190
|
+
resourceUri="publisher://environments/prod/packages/sales"
|
|
1191
|
+
path="q3.malloy"
|
|
1192
|
+
onEvent={onEvent}
|
|
1193
|
+
// Return what the target resolved to and the drill is reported too.
|
|
1194
|
+
onNavigate={(target) => (openReport(target) ? "resolved" : "unresolved")}
|
|
1195
|
+
/>;
|
|
1196
|
+
```
|
|
1197
|
+
|
|
1098
1198
|
## Styling
|
|
1099
1199
|
|
|
1100
1200
|
### Required CSS
|
|
@@ -1450,8 +1550,8 @@ function EnvironmentList() {
|
|
|
1450
1550
|
| `QueryExplorerResult` | Query builder result |
|
|
1451
1551
|
| `SourceAndPath` | Source info with model path |
|
|
1452
1552
|
| `DocumentStorage` | Document storage interface |
|
|
1453
|
-
| `DocumentLocator` | Workspace +
|
|
1454
|
-
| `DocumentType` | `"
|
|
1553
|
+
| `DocumentLocator` | Workspace + path, with layout |
|
|
1554
|
+
| `DocumentType` | `"grid"` or `"linear"` |
|
|
1455
1555
|
| `Workspace` | Workspace metadata |
|
|
1456
1556
|
| `ApiError` | Standardized API error |
|
|
1457
1557
|
| `ModelExplorerProps` | ModelExplorer props |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const M=require("react/jsx-runtime"),X=require("@mui/material"),p=require("react"),b=require("./useCompiledDocument-
|
|
1
|
+
"use strict";const M=require("react/jsx-runtime"),X=require("@mui/material"),p=require("react"),b=require("./useCompiledDocument-oocN5cGE.cjs.js"),Y=require("./ServerProvider-DuEOzwPc.cjs.js"),g="publisher-drill";function de(e,r){const t=new Set;let l;try{l=e.getMetadata()?.getAllFields()??[]}catch{return t}const o=new Set;for(const a of l)!a||r(a)||a.tag?.tag("hidden")===void 0&&o.add(a.tag?.text("label")??a.name);for(const a of l){if(!a||!r(a))continue;const n=a.tag?.text("label")??a.name;o.has(n)||t.add(n)}return t}function B(e){const r=/^\s*(\d+)/.exec(e.style?.gridColumn??"");return r?r[1]:void 0}function ce(e,r){if(r.size!==0)for(const t of e.querySelectorAll(".malloy-table")){const l=n=>n.closest(".malloy-table")===t,o=new Set;for(const n of t.querySelectorAll(".column-cell.th")){if(!l(n))continue;const s=(n.textContent??"").replace(/\u200b/g,"").trim(),f=B(n);f&&r.has(s)&&o.add(f)}if(o.size===0)continue;const a=new Set;for(const n of t.querySelectorAll(`.${g}[tabindex="0"]`)){if(!l(n))continue;const s=B(n);s&&(a.has(s)?n.tabIndex=-1:a.add(s))}for(const n of t.querySelectorAll(".column-cell.td")){if(!l(n))continue;const s=B(n),f=!n.querySelector(".value-null")&&(n.textContent??"").trim()!=="";if(s&&f&&o.has(s)&&!n.querySelector(".malloy-table")){if(n.classList.add(g),n.tabIndex===0)a.add(s);else{const v=a.has(s);v||a.add(s),n.tabIndex=v?-1:0}n.setAttribute("role","button")}}}}function ge(e){const r=e.closest(".malloy-table"),t=B(e);return!r||!t?[]:Array.from(r.querySelectorAll(`.${g}`)).filter(l=>l.closest(".malloy-table")===r&&B(l)===t)}function ie(e,r){const t=ge(e),l=t.indexOf(e);if(l===-1)return;const o=r==="first"?t[0]:r==="last"?t[t.length-1]:t[Math.min(Math.max(l+r,0),t.length-1)];if(o){for(const a of t)a.tabIndex=a===o?0:-1;return o}}function ue(e){return{background:e.dashboardRoot,tableBackground:e.tableBackground,tableHeaderColor:e.tableHeader,tableBodyColor:e.tableBody,tableBorder:e.border,tablePinnedBackground:e.tableHeaderBackground,tablePinnedBorder:e.pinnedBorder,tableFontSize:`${e.font.size}px`,fontFamily:e.font.family,mapColor:e.mapColor}}function he(e){const{foreground:r,axisFaint:t,gridline:l,font:o}=e,a={background:e.background,font:o.family,title:{color:r,font:o.family},axis:{labelColor:r,titleColor:r,domainColor:t,tickColor:t,gridColor:l,labelFont:o.family,titleFont:o.family},legend:{labelColor:r,titleColor:r,labelFont:o.family,titleFont:o.family},header:{labelColor:r,titleColor:r},range:{category:e.series}},n={...a,legend:{...a.legend,orient:"bottom"}};return s=>s==="shape_map"?n:a}function me(e){if(!e)return;const r=e.tag("theme");if(!r)return;const t={},l=r.tag("palette");if(l){const a={},n=l.textArray("series");n&&n.length>0&&(a.series=n);for(const s of Y.PER_MODE_COLOR_KEYS){const f=l.tag(s);if(!f)continue;const v={},R=f.text("light"),k=f.text("dark");R&&(v.light=R),k&&(v.dark=k),Object.keys(v).length>0&&(a[s]=v)}Object.keys(a).length>0&&(t.palette=a)}const o=r.tag("font");if(o){const a={},n=o.text("family");n&&(a.family=n);const s=o.numeric("size");typeof s=="number"&&Number.isFinite(s)&&(a.size=s),Object.keys(a).length>0&&(t.font=a)}return Object.keys(t).length>0?t:void 0}const I="data-publisher-fill",ve=async(e,r)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:t}=await b.loadMalloyRenderer();return new t({onClick:r,vegaConfigOverride:he(e),theme:ue(e),onError:o=>{console.error("Error rendering visualization:",typeof o,o)}}).createViz()};async function we(e){if(!e||typeof e!="object")return;const r=e,t=[...Array.isArray(r.model_annotations)?r.model_annotations:[],...Array.isArray(r.source_annotations)?r.source_annotations:[],...Array.isArray(r.annotations)?r.annotations:[]].map(o=>typeof o?.value=="string"?o.value:void 0).filter(o=>!!o);if(t.length===0)return;let l;try{({parseAnnotation:l}=await b.loadMalloyTag())}catch{return}try{const{tag:o}=l(t);return me(o)}catch(o){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:o,lines:t});return}}function ke(e,r,t){const l=b.buildTableCssVars(r,t);for(const[o,a]of Object.entries(l))e.style.setProperty(o,a)}const xe=`
|
|
2
2
|
/* Card geometry, through the renderer's OWN theme vars rather than over the top
|
|
3
3
|
of them. It declares --malloy-theme--dashboard-* on .malloy-render itself and
|
|
4
4
|
passes each through to the --malloy-render--* the card CSS reads, so a value
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as L } from "react/jsx-runtime";
|
|
2
2
|
import { Box as ne, useTheme as he } from "@mui/material";
|
|
3
3
|
import { Suspense as me, useRef as F, useCallback as be, useMemo as fe, useEffect as ye, useLayoutEffect as pe } from "react";
|
|
4
|
-
import { D as ge, r as U, l as ve, a as we, b as ke, c as xe, m as Ce, d as Re, e as le } from "./useCompiledDocument-
|
|
5
|
-
import {
|
|
4
|
+
import { D as ge, r as U, l as ve, a as we, b as ke, c as xe, m as Ce, d as Re, e as le } from "./useCompiledDocument-x0B2RAH3.es.js";
|
|
5
|
+
import { aX as Ee, aV as Se, aY as Ae } from "./ServerProvider-B_bPAsu2.es.js";
|
|
6
6
|
const g = "publisher-drill";
|
|
7
7
|
function Te(e, r) {
|
|
8
8
|
const t = /* @__PURE__ */ new Set();
|