@malloy-publisher/sdk 0.9.1 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RenderedResult-BRgIgxWh.es.js → RenderedResult-DwB0-9Yx.es.js} +219 -210
- package/dist/RenderedResult-hKjFEqaN.cjs.js +141 -0
- package/dist/{ServerProvider-Boxrv6Ym.es.js → ServerProvider-CcSrGaRN.es.js} +1473 -1326
- package/dist/ServerProvider-Gbf1YPOP.cjs.js +1 -0
- package/dist/builder/index.cjs.js +143 -58
- package/dist/builder/index.es.js +12179 -9318
- package/dist/builder-entry.d.ts +5 -1
- package/dist/client/api.d.ts +247 -56
- package/dist/client/configuration.d.ts +1 -1
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.es.js +94 -88
- package/dist/client-entry.d.ts +2 -0
- package/dist/components/ApiErrorDisplay.d.ts +11 -0
- package/dist/components/AppDialog.d.ts +6 -6
- package/dist/components/Dashboard/Dashboard.d.ts +8 -15
- package/dist/components/Dashboard/DashboardGrid.d.ts +38 -6
- package/dist/components/Dashboard/DashboardTile.d.ts +21 -2
- package/dist/components/Dashboard/DashboardView.d.ts +71 -0
- package/dist/components/Dashboard/TileCard.d.ts +30 -5
- package/dist/components/Dashboard/TileFilterTag.d.ts +12 -0
- package/dist/components/Dashboard/dropValueUrlTags.d.ts +6 -0
- package/dist/components/Dashboard/index.d.ts +5 -1
- package/dist/components/Dashboard/telemetry.d.ts +16 -3
- package/dist/components/Dashboard/textSource.d.ts +19 -0
- package/dist/components/DashboardBuilder/AddTileDialog.d.ts +15 -9
- package/dist/components/DashboardBuilder/BuilderDialogs.d.ts +25 -0
- package/dist/components/DashboardBuilder/BuilderGrid.d.ts +31 -0
- package/dist/components/DashboardBuilder/BuilderHeader.d.ts +17 -0
- package/dist/components/DashboardBuilder/BuilderToolbar.d.ts +23 -15
- package/dist/components/DashboardBuilder/ChartPicker.d.ts +31 -0
- package/dist/components/DashboardBuilder/DashboardBuilder.d.ts +56 -21
- package/dist/components/DashboardBuilder/DashboardEditor.d.ts +44 -5
- package/dist/components/DashboardBuilder/EditorSurface.d.ts +33 -0
- package/dist/components/DashboardBuilder/FilterDialog.d.ts +2 -2
- package/dist/components/DashboardBuilder/FilterStrip.d.ts +8 -4
- package/dist/components/DashboardBuilder/InlineMarkdown.d.ts +18 -0
- package/dist/components/DashboardBuilder/InlineText.d.ts +19 -0
- package/dist/components/DashboardBuilder/NotebookEditor.d.ts +15 -0
- package/dist/components/DashboardBuilder/SourceViewPicker.d.ts +9 -0
- package/dist/components/DashboardBuilder/TextTileBody.d.ts +10 -0
- package/dist/components/DashboardBuilder/TileFrame.d.ts +51 -12
- package/dist/components/DashboardBuilder/TileMenu.d.ts +12 -6
- package/dist/components/DashboardBuilder/annotationText.d.ts +4 -0
- package/dist/components/DashboardBuilder/builderReport.d.ts +13 -0
- package/dist/components/DashboardBuilder/catalog.d.ts +4 -18
- package/dist/components/DashboardBuilder/changedTile.d.ts +7 -0
- package/dist/components/DashboardBuilder/chartLine.d.ts +33 -0
- package/dist/components/DashboardBuilder/controls.d.ts +2 -2
- package/dist/components/DashboardBuilder/document.d.ts +42 -26
- package/dist/components/DashboardBuilder/documentSession.d.ts +100 -0
- package/dist/components/DashboardBuilder/imports.d.ts +19 -0
- package/dist/components/DashboardBuilder/inlineEdit.d.ts +18 -0
- package/dist/components/DashboardBuilder/legacyNotebook.d.ts +73 -0
- package/dist/components/DashboardBuilder/loadMalloy.d.ts +15 -0
- package/dist/components/DashboardBuilder/malloyTree.d.ts +119 -0
- package/dist/components/DashboardBuilder/newDashboard.d.ts +3 -1
- package/dist/components/DashboardBuilder/openDraft.d.ts +10 -0
- package/dist/components/DashboardBuilder/preview.d.ts +24 -4
- package/dist/components/DashboardBuilder/readDocument.d.ts +6 -1
- package/dist/components/DashboardBuilder/readForEditor.d.ts +16 -0
- package/dist/components/DashboardBuilder/sortable.d.ts +16 -0
- package/dist/components/DashboardBuilder/spliceDocument.d.ts +15 -13
- package/dist/components/DashboardBuilder/spliceResult.d.ts +11 -0
- package/dist/components/DashboardBuilder/tagParse.d.ts +24 -0
- package/dist/components/DashboardBuilder/telemetry.d.ts +43 -0
- package/dist/components/DashboardBuilder/testing/fixtures.d.ts +3 -1
- package/dist/components/DashboardBuilder/testing/inline.d.ts +4 -0
- package/dist/components/DashboardBuilder/testing/resize.d.ts +7 -0
- package/dist/components/DashboardBuilder/tileDisplayTitle.d.ts +7 -0
- package/dist/components/DashboardBuilder/useBuilderSelection.d.ts +53 -0
- package/dist/components/DashboardBuilder/useBuilderSession.d.ts +86 -0
- package/dist/components/DashboardBuilder/useBuilderShortcuts.d.ts +9 -6
- package/dist/components/DashboardBuilder/useControlBindings.d.ts +30 -0
- package/dist/components/DashboardBuilder/useConversionConfirm.d.ts +20 -0
- package/dist/components/DashboardBuilder/useDashboardEditor.d.ts +19 -55
- package/dist/components/DashboardBuilder/useDocumentEditor.d.ts +105 -0
- package/dist/components/DashboardBuilder/useDraft.d.ts +3 -1
- package/dist/components/DashboardBuilder/useExitGuard.d.ts +19 -0
- package/dist/components/DashboardBuilder/useFilterForm.d.ts +3 -3
- package/dist/components/DashboardBuilder/useHostCopy.d.ts +26 -0
- package/dist/components/DashboardBuilder/useOpenDraftCommit.d.ts +17 -0
- package/dist/components/DashboardBuilder/useOpenedDocument.d.ts +71 -0
- package/dist/components/DashboardBuilder/useSaveChannel.d.ts +50 -0
- package/dist/components/DashboardBuilder/useTileEditing.d.ts +33 -0
- package/dist/components/DashboardBuilder/useTileResize.d.ts +6 -3
- package/dist/components/DocumentCreate/canRetry.d.ts +6 -0
- package/dist/components/DocumentCreate/createDocument.d.ts +58 -0
- package/dist/components/DocumentCreate/documentPath.d.ts +10 -0
- package/dist/components/DocumentCreate/events.d.ts +10 -0
- package/dist/components/DocumentCreate/exportedSources.d.ts +7 -0
- package/dist/components/DocumentCreate/guards.d.ts +12 -0
- package/dist/components/DocumentCreate/index.d.ts +6 -0
- package/dist/components/DocumentCreate/newNotebook.d.ts +9 -0
- package/dist/components/DocumentCreate/useDocumentChoices.d.ts +32 -0
- package/dist/components/DocumentStorage/DocumentStorage.d.ts +2 -1
- package/dist/components/Loading.d.ts +13 -0
- package/dist/components/NarrowEditGate.d.ts +8 -0
- package/dist/components/Notebook/Notebook.d.ts +1 -1
- package/dist/components/Notebook/NotebookCell.d.ts +1 -5
- package/dist/components/Package/NewDocumentDialog.d.ts +33 -0
- package/dist/components/Package/Package.d.ts +17 -1
- package/dist/components/Package/documentLocation.d.ts +28 -0
- package/dist/components/Package/index.d.ts +5 -1
- package/dist/components/Package/useDocumentLocation.d.ts +12 -0
- package/dist/components/PackageSection.d.ts +2 -2
- package/dist/components/Prose.d.ts +1 -1
- package/dist/components/RenderedResult/RenderedResult.d.ts +2 -0
- package/dist/components/RenderedResult/ResultContainer.d.ts +8 -1
- package/dist/components/RenderedResult/ResultPanel.d.ts +3 -1
- package/dist/components/RenderedResult/loadRenderer.d.ts +7 -0
- package/dist/components/RenderedResult/resultSizing.d.ts +9 -1
- package/dist/components/ServerProvider.d.ts +2 -1
- package/dist/components/UnsavedChangesDialog.d.ts +9 -0
- package/dist/components/given/GivensPanel.d.ts +2 -2
- package/dist/components/given/paramCodec.d.ts +8 -1
- package/dist/components/index.d.ts +3 -2
- package/dist/components/styles.d.ts +4 -4
- package/dist/hooks/givenValue.d.ts +6 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useCompiledDocument.d.ts +23 -0
- package/dist/hooks/useDocumentControls.d.ts +6 -1
- package/dist/hooks/useNarrowScreen.d.ts +4 -0
- package/dist/hooks/useNearViewport.d.ts +16 -0
- package/dist/hooks/useQueryResult.d.ts +2 -0
- package/dist/hooks/useQueryWithApiError.d.ts +7 -2
- package/dist/hooks/useSettled.d.ts +14 -0
- package/dist/hooks/useSuggestOptions.d.ts +9 -2
- package/dist/index.cjs.js +23 -24
- package/dist/index.es.js +9041 -7002
- package/dist/text/index.cjs.js +1 -0
- package/dist/text/index.d.ts +2 -0
- package/dist/text/index.es.js +6 -0
- package/dist/text-entry-BJwltZiy.cjs.js +7 -0
- package/dist/text-entry-CA0LZ1xL.es.js +196 -0
- package/dist/text-entry.d.ts +2 -0
- package/dist/theme/accent.d.ts +29 -0
- package/dist/theme/buildVegaThemeOverride.d.ts +3 -3
- package/dist/theme/index.d.ts +3 -0
- package/dist/theme/keys.d.ts +1 -1
- package/dist/theme/motion.d.ts +31 -0
- package/dist/theme/readChartAnnotations.d.ts +1 -1
- package/dist/theme/resolveTheme.d.ts +4 -4
- package/dist/theme/types.d.ts +33 -5
- package/dist/{Dashboard-H1kJlDFo.es.js → useCompiledDocument-BU6d8FPp.es.js} +17904 -19057
- package/dist/useCompiledDocument-pOg2W-Yt.cjs.js +142 -0
- package/dist/utils/clock.d.ts +2 -0
- package/dist/utils/malloyText.d.ts +104 -0
- package/package.json +20 -11
- package/src/builder-entry.ts +36 -0
- package/src/client-entry.ts +8 -0
- package/src/clientEntry.spec.ts +17 -0
- package/src/components/ApiErrorDisplay.tsx +37 -18
- package/src/components/AppDialog.tsx +8 -7
- package/src/components/Dashboard/Dashboard.spec.tsx +3 -32
- package/src/components/Dashboard/Dashboard.tsx +29 -280
- package/src/components/Dashboard/DashboardGrid.tsx +87 -8
- package/src/components/Dashboard/DashboardTile.spec.tsx +121 -2
- package/src/components/Dashboard/DashboardTile.tsx +121 -30
- package/src/components/Dashboard/DashboardView.spec.tsx +368 -0
- package/src/components/Dashboard/DashboardView.tsx +428 -0
- package/src/components/Dashboard/RowsDialog.tsx +4 -3
- package/src/components/Dashboard/TileCard.tsx +60 -11
- package/src/components/Dashboard/TileFilterTag.spec.tsx +73 -0
- package/src/components/Dashboard/TileFilterTag.tsx +78 -0
- package/src/components/Dashboard/defaultTileSpan.spec.ts +32 -0
- package/src/components/Dashboard/dropValueUrlTags.spec.ts +177 -0
- package/src/components/Dashboard/dropValueUrlTags.ts +108 -0
- package/src/components/Dashboard/index.ts +13 -1
- package/src/components/Dashboard/telemetry.ts +17 -5
- package/src/components/Dashboard/textSource.spec.ts +36 -0
- package/src/components/Dashboard/textSource.ts +39 -0
- package/src/components/DashboardBuilder/AddTileDialog.spec.tsx +88 -0
- package/src/components/DashboardBuilder/AddTileDialog.tsx +124 -138
- package/src/components/DashboardBuilder/BuilderDialogs.tsx +162 -0
- package/src/components/DashboardBuilder/BuilderGrid.tsx +245 -0
- package/src/components/DashboardBuilder/BuilderHeader.tsx +107 -0
- package/src/components/DashboardBuilder/BuilderToolbar.tsx +111 -80
- package/src/components/DashboardBuilder/ChartPicker.render.spec.tsx +25 -0
- package/src/components/DashboardBuilder/ChartPicker.spec.ts +77 -0
- package/src/components/DashboardBuilder/ChartPicker.tsx +156 -0
- package/src/components/DashboardBuilder/DashboardBuilder.charts.spec.tsx +205 -0
- package/src/components/DashboardBuilder/DashboardBuilder.exit.spec.tsx +183 -0
- package/src/components/DashboardBuilder/DashboardBuilder.inline.spec.tsx +373 -0
- package/src/components/DashboardBuilder/DashboardBuilder.notebook.spec.tsx +310 -0
- package/src/components/DashboardBuilder/DashboardBuilder.openDraft.spec.tsx +105 -0
- package/src/components/DashboardBuilder/DashboardBuilder.sources.spec.tsx +117 -0
- package/src/components/DashboardBuilder/DashboardBuilder.spec.tsx +146 -108
- package/src/components/DashboardBuilder/DashboardBuilder.textTiles.spec.tsx +179 -0
- package/src/components/DashboardBuilder/DashboardBuilder.tsx +330 -512
- package/src/components/DashboardBuilder/DashboardEditor.authoritative.spec.tsx +55 -25
- package/src/components/DashboardBuilder/DashboardEditor.emptyStart.spec.tsx +142 -0
- package/src/components/DashboardBuilder/DashboardEditor.filterTag.spec.tsx +162 -0
- package/src/components/DashboardBuilder/DashboardEditor.notebook.spec.tsx +310 -0
- package/src/components/DashboardBuilder/DashboardEditor.package.spec.tsx +39 -13
- package/src/components/DashboardBuilder/DashboardEditor.resourceUri.spec.tsx +9 -26
- package/src/components/DashboardBuilder/DashboardEditor.spec.tsx +102 -25
- package/src/components/DashboardBuilder/DashboardEditor.textSource.spec.tsx +317 -0
- package/src/components/DashboardBuilder/DashboardEditor.tsx +252 -780
- package/src/components/DashboardBuilder/DrillDialog.tsx +2 -2
- package/src/components/DashboardBuilder/EditorSurface.tsx +471 -0
- package/src/components/DashboardBuilder/FilterDialog.tsx +23 -11
- package/src/components/DashboardBuilder/FilterStrip.tsx +130 -70
- package/src/components/DashboardBuilder/InlineMarkdown.tsx +182 -0
- package/src/components/DashboardBuilder/InlineText.tsx +112 -0
- package/src/components/DashboardBuilder/NotebookEditor.tsx +44 -0
- package/src/components/DashboardBuilder/SourceViewPicker.tsx +122 -0
- package/src/components/DashboardBuilder/TextTileBody.tsx +31 -0
- package/src/components/DashboardBuilder/TileFrame.tsx +302 -163
- package/src/components/DashboardBuilder/TileMenu.tsx +125 -97
- package/src/components/DashboardBuilder/annotationText.spec.ts +33 -0
- package/src/components/DashboardBuilder/annotationText.ts +17 -0
- package/src/components/DashboardBuilder/artifactBlock.spec.ts +248 -0
- package/src/components/DashboardBuilder/artifactTagParity.spec.ts +46 -0
- package/src/components/DashboardBuilder/builderReport.ts +74 -0
- package/src/components/DashboardBuilder/catalog.aggregate.spec.ts +49 -0
- package/src/components/DashboardBuilder/catalog.spec.ts +2 -44
- package/src/components/DashboardBuilder/catalog.ts +61 -57
- package/src/components/DashboardBuilder/changedTile.spec.ts +46 -0
- package/src/components/DashboardBuilder/changedTile.ts +28 -0
- package/src/components/DashboardBuilder/chartLine.spec.ts +180 -0
- package/src/components/DashboardBuilder/chartLine.ts +121 -0
- package/src/components/DashboardBuilder/controls.spec.ts +21 -10
- package/src/components/DashboardBuilder/controls.ts +22 -8
- package/src/components/DashboardBuilder/document.ts +53 -5
- package/src/components/DashboardBuilder/documentSession.spec.ts +209 -0
- package/src/components/DashboardBuilder/documentSession.ts +258 -0
- package/src/components/DashboardBuilder/emptyStart.spec.ts +131 -0
- package/src/components/DashboardBuilder/imports.spec.ts +61 -0
- package/src/components/DashboardBuilder/imports.ts +93 -0
- package/src/components/DashboardBuilder/inlineEdit.tsx +78 -0
- package/src/components/DashboardBuilder/invariants.spec.ts +6 -2
- package/src/components/DashboardBuilder/legacyNotebook.chart.spec.ts +77 -0
- package/src/components/DashboardBuilder/legacyNotebook.convert.spec.ts +630 -0
- package/src/components/DashboardBuilder/legacyNotebook.read.spec.ts +338 -0
- package/src/components/DashboardBuilder/legacyNotebook.ts +1117 -0
- package/src/components/DashboardBuilder/loadMalloy.spec.ts +80 -0
- package/src/components/DashboardBuilder/loadMalloy.ts +39 -0
- package/src/components/DashboardBuilder/malloyTree.ts +159 -7
- package/src/components/DashboardBuilder/newDashboard.spec.ts +46 -2
- package/src/components/DashboardBuilder/newDashboard.ts +30 -3
- package/src/components/DashboardBuilder/openDraft.ts +52 -0
- package/src/components/DashboardBuilder/preview.shapes.spec.ts +75 -0
- package/src/components/DashboardBuilder/preview.spec.ts +159 -12
- package/src/components/DashboardBuilder/preview.ts +83 -9
- package/src/components/DashboardBuilder/readDocument.spec.ts +174 -26
- package/src/components/DashboardBuilder/readDocument.ts +137 -45
- package/src/components/DashboardBuilder/readForEditor.spec.ts +80 -0
- package/src/components/DashboardBuilder/readForEditor.ts +52 -0
- package/src/components/DashboardBuilder/scannerShapes.spec.ts +14 -13
- package/src/components/DashboardBuilder/sortable.spec.ts +89 -0
- package/src/components/DashboardBuilder/sortable.tsx +11 -10
- package/src/components/DashboardBuilder/spliceDocument.chart.spec.ts +340 -0
- package/src/components/DashboardBuilder/spliceDocument.imports.spec.ts +167 -0
- package/src/components/DashboardBuilder/spliceDocument.spec.ts +229 -94
- package/src/components/DashboardBuilder/spliceDocument.ts +768 -131
- package/src/components/DashboardBuilder/spliceResult.ts +15 -0
- package/src/components/DashboardBuilder/statementExtent.spec.ts +33 -30
- package/src/components/DashboardBuilder/tagParse.spec.ts +149 -0
- package/src/components/DashboardBuilder/tagParse.ts +103 -0
- package/src/components/DashboardBuilder/telemetry.ts +47 -0
- package/src/components/DashboardBuilder/testing/artifactTagParity.json +253 -0
- package/src/components/DashboardBuilder/testing/documentKindRule.json +40 -0
- package/src/components/DashboardBuilder/testing/fixtures.ts +16 -1
- package/src/components/DashboardBuilder/testing/inline.ts +25 -0
- package/src/components/DashboardBuilder/testing/resize.ts +48 -0
- package/src/components/DashboardBuilder/testing/urlRenderTags.json +62 -0
- package/src/components/DashboardBuilder/textTiles.spec.ts +760 -0
- package/src/components/DashboardBuilder/tileDisplayTitle.ts +13 -0
- package/src/components/DashboardBuilder/useBuilderSelection.ts +121 -0
- package/src/components/DashboardBuilder/useBuilderSession.spec.ts +250 -0
- package/src/components/DashboardBuilder/useBuilderSession.ts +255 -0
- package/src/components/DashboardBuilder/useBuilderShortcuts.overlay.spec.tsx +97 -0
- package/src/components/DashboardBuilder/useBuilderShortcuts.spec.tsx +60 -0
- package/src/components/DashboardBuilder/useBuilderShortcuts.ts +45 -9
- package/src/components/DashboardBuilder/useControlBindings.ts +152 -0
- package/src/components/DashboardBuilder/useConversionConfirm.ts +55 -0
- package/src/components/DashboardBuilder/useDashboardEditor.spec.ts +16 -13
- package/src/components/DashboardBuilder/useDashboardEditor.ts +57 -181
- package/src/components/DashboardBuilder/useDocumentEditor.spec.ts +565 -0
- package/src/components/DashboardBuilder/useDocumentEditor.ts +399 -0
- package/src/components/DashboardBuilder/useDraft.ts +15 -2
- package/src/components/DashboardBuilder/useExitGuard.spec.ts +159 -0
- package/src/components/DashboardBuilder/useExitGuard.ts +89 -0
- package/src/components/DashboardBuilder/useFilterForm.existing.spec.tsx +41 -0
- package/src/components/DashboardBuilder/useFilterForm.spec.tsx +24 -2
- package/src/components/DashboardBuilder/useFilterForm.ts +41 -13
- package/src/components/DashboardBuilder/useHostCopy.ts +104 -0
- package/src/components/DashboardBuilder/useOpenDraftCommit.ts +47 -0
- package/src/components/DashboardBuilder/useOpenedDocument.ts +314 -0
- package/src/components/DashboardBuilder/useSaveChannel.ts +275 -0
- package/src/components/DashboardBuilder/useTileEditing.ts +141 -0
- package/src/components/DashboardBuilder/useTileReorder.spec.tsx +28 -5
- package/src/components/DashboardBuilder/useTileReorder.ts +5 -7
- package/src/components/DashboardBuilder/useTileResize.spec.tsx +30 -5
- package/src/components/DashboardBuilder/useTileResize.ts +31 -8
- package/src/components/DataAppViewer/DataAppViewer.tsx +7 -4
- package/src/components/DocumentCreate/canRetry.spec.ts +32 -0
- package/src/components/DocumentCreate/canRetry.ts +19 -0
- package/src/components/DocumentCreate/createDocument.spec.ts +310 -0
- package/src/components/DocumentCreate/createDocument.ts +159 -0
- package/src/components/DocumentCreate/documentPath.ts +40 -0
- package/src/components/DocumentCreate/events.ts +15 -0
- package/src/components/DocumentCreate/exportedSources.ts +25 -0
- package/src/components/DocumentCreate/guards.ts +45 -0
- package/src/components/DocumentCreate/index.ts +27 -0
- package/src/components/DocumentCreate/newNotebook.spec.ts +156 -0
- package/src/components/DocumentCreate/newNotebook.ts +44 -0
- package/src/components/DocumentCreate/useDocumentChoices.spec.tsx +138 -0
- package/src/components/DocumentCreate/useDocumentChoices.ts +113 -0
- package/src/components/DocumentStorage/DocumentStorage.ts +2 -1
- package/src/components/Environment/Environment.tsx +0 -10
- package/src/components/Loading.tsx +14 -0
- package/src/components/Model/Model.tsx +16 -9
- package/src/components/Model/ModelExplorer.spec.tsx +2 -2
- package/src/components/Model/ModelExplorer.tsx +2 -2
- package/src/components/Model/SourcesExplorer.tsx +2 -4
- package/src/components/NarrowEditGate.spec.tsx +73 -0
- package/src/components/NarrowEditGate.tsx +29 -0
- package/src/components/Notebook/Notebook.layout.spec.tsx +94 -0
- package/src/components/Notebook/Notebook.tsx +72 -29
- package/src/components/Notebook/NotebookCell.tsx +90 -215
- package/src/components/Package/NewDocumentDialog.spec.tsx +749 -0
- package/src/components/Package/NewDocumentDialog.tsx +401 -0
- package/src/components/Package/Package.artifacts.spec.tsx +186 -0
- package/src/components/Package/Package.create.spec.tsx +401 -0
- package/src/components/Package/Package.notebooks.spec.tsx +18 -0
- package/src/components/Package/Package.tsx +396 -177
- package/src/components/Package/documentLocation.spec.ts +81 -0
- package/src/components/Package/documentLocation.ts +55 -0
- package/src/components/Package/index.ts +14 -1
- package/src/components/Package/useDocumentLocation.ts +59 -0
- package/src/components/PackageSection.tsx +2 -2
- package/src/components/Prose.spec.tsx +37 -0
- package/src/components/Prose.tsx +35 -5
- package/src/components/RenderedResult/RenderedResult.tsx +23 -8
- package/src/components/RenderedResult/ResultContainer.tsx +51 -13
- package/src/components/RenderedResult/ResultPanel.tsx +24 -5
- package/src/components/RenderedResult/loadRenderer.ts +42 -0
- package/src/components/RenderedResult/resultSizing.spec.ts +68 -0
- package/src/components/RenderedResult/resultSizing.ts +14 -3
- package/src/components/ServerProvider.tsx +2 -1
- package/src/components/UnsavedChangesDialog.spec.tsx +70 -0
- package/src/components/UnsavedChangesDialog.tsx +49 -0
- package/src/components/given/GivenInput.spec.tsx +5 -5
- package/src/components/given/GivenInput.tsx +46 -38
- package/src/components/given/GivensPanel.spec.tsx +6 -6
- package/src/components/given/GivensPanel.tsx +5 -11
- package/src/components/given/paramCodec.ts +27 -1
- package/src/components/index.ts +3 -2
- package/src/components/styles.ts +4 -5
- package/src/hooks/givenValue.ts +9 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/useCompiledDocument.spec.tsx +86 -0
- package/src/hooks/useCompiledDocument.ts +59 -0
- package/src/hooks/useDimensionalFilterRangeData.ts +3 -1
- package/src/hooks/useDocumentControls.ts +13 -1
- package/src/hooks/useNarrowScreen.ts +21 -0
- package/src/hooks/useNearViewport.spec.tsx +150 -0
- package/src/hooks/useNearViewport.ts +102 -0
- package/src/hooks/useQueryResult.ts +23 -1
- package/src/hooks/useQueryWithApiError.ts +10 -3
- package/src/hooks/useRawQueryData.ts +3 -1
- package/src/hooks/useSettled.spec.ts +41 -0
- package/src/hooks/useSettled.ts +27 -0
- package/src/hooks/useSuggestOptions.dom.spec.ts +40 -1
- package/src/hooks/useSuggestOptions.ts +42 -10
- package/src/mainEntry.spec.ts +145 -0
- package/src/text-entry.ts +12 -0
- package/src/textEntry.spec.ts +112 -0
- package/src/theme/accent.spec.ts +116 -0
- package/src/theme/accent.ts +148 -0
- package/src/theme/buildTableCssVars.spec.ts +24 -0
- package/src/theme/buildTableCssVars.ts +1 -2
- package/src/theme/buildVegaThemeOverride.spec.ts +38 -2
- package/src/theme/buildVegaThemeOverride.ts +5 -5
- package/src/theme/defaults.ts +34 -0
- package/src/theme/index.ts +9 -0
- package/src/theme/keys.ts +6 -0
- package/src/theme/motion.ts +44 -0
- package/src/theme/readChartAnnotations.spec.ts +18 -0
- package/src/theme/readChartAnnotations.ts +1 -1
- package/src/theme/resolveTheme.spec.ts +73 -0
- package/src/theme/resolveTheme.ts +61 -20
- package/src/theme/types.ts +30 -5
- package/src/utils/clock.spec.ts +12 -0
- package/src/utils/clock.ts +6 -0
- package/src/{components/DashboardBuilder → utils}/malloyText.spec.ts +48 -0
- package/src/utils/malloyText.ts +368 -0
- package/src/utils/queryClient.ts +8 -0
- package/vite.config.ts +4 -0
- package/dist/Dashboard-ChyylkTD.cjs.js +0 -136
- package/dist/RenderedResult-AJPMUkAD.cjs.js +0 -135
- package/dist/ServerProvider-CXrOKD6g.cjs.js +0 -1
- package/dist/components/Dashboard/DashboardBar.d.ts +0 -21
- package/dist/components/Dashboard/ExploreDialog.d.ts +0 -20
- package/dist/components/DashboardBuilder/DiffDialog.d.ts +0 -15
- package/dist/components/DashboardBuilder/SettingsPopover.d.ts +0 -20
- package/dist/components/DashboardBuilder/diff.d.ts +0 -35
- package/dist/components/DashboardBuilder/malloyText.d.ts +0 -64
- package/dist/components/Package/NewDashboardDialog.d.ts +0 -18
- package/src/components/Dashboard/DashboardBar.tsx +0 -88
- package/src/components/Dashboard/ExploreDialog.tsx +0 -89
- package/src/components/DashboardBuilder/DiffDialog.tsx +0 -122
- package/src/components/DashboardBuilder/SettingsPopover.tsx +0 -168
- package/src/components/DashboardBuilder/diff.spec.ts +0 -44
- package/src/components/DashboardBuilder/diff.ts +0 -93
- package/src/components/DashboardBuilder/malloyText.ts +0 -214
- package/src/components/Package/NewDashboardDialog.spec.tsx +0 -129
- package/src/components/Package/NewDashboardDialog.tsx +0 -265
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export { Dashboard, type DashboardProps } from './Dashboard';
|
|
2
|
+
export { DashboardView, STICKY_CONTROLS_Z, type DashboardViewProps, } from './DashboardView';
|
|
3
|
+
export { TileFilterTag, tileIgnoredFilterLabels } from './TileFilterTag';
|
|
2
4
|
export { DashboardTile, type DashboardTileProps } from './DashboardTile';
|
|
5
|
+
export { documentPreamble, RESTRICTED_NOTICE, withPreamble, } from './textSource';
|
|
3
6
|
export type { DashboardEvent, DashboardEventHandler } from './telemetry';
|
|
4
|
-
export { TileCard, TileHeading } from './TileCard';
|
|
7
|
+
export { TILE_MIN_HEIGHT, TileCard, TileHeading } from './TileCard';
|
|
8
|
+
export type { TileHeadingSlots } from './TileCard';
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { DashboardCreatedEvent } from '../DocumentCreate/events';
|
|
2
|
+
/** Where a host's Save lands, as an editor's events report it. */
|
|
3
|
+
export type SavesTo = "package" | "browser" | "host";
|
|
1
4
|
/**
|
|
2
5
|
* What a dashboard surface reports about itself, for the host to log or
|
|
3
6
|
* count: the operations that matter (open, save, the rows behind a value,
|
|
@@ -37,7 +40,7 @@ export type DashboardEvent = {
|
|
|
37
40
|
* "dashboards are being edited" unreadable, because a read-only server
|
|
38
41
|
* reports exactly as much saving as a writable one.
|
|
39
42
|
*/
|
|
40
|
-
where:
|
|
43
|
+
where: SavesTo;
|
|
41
44
|
/** The workspace that took the write, so the event says so itself. */
|
|
42
45
|
workspace?: string;
|
|
43
46
|
durationMs: number;
|
|
@@ -45,6 +48,18 @@ export type DashboardEvent = {
|
|
|
45
48
|
type: "dashboard.save_refused";
|
|
46
49
|
reason: string;
|
|
47
50
|
} | {
|
|
51
|
+
/** Undo save wrote the file back as it was before the last save. */
|
|
52
|
+
type: "dashboard.save_undone";
|
|
53
|
+
tiles: number;
|
|
54
|
+
/** Whether the save it took back added or removed a tile. */
|
|
55
|
+
structural: boolean;
|
|
56
|
+
where: SavesTo;
|
|
57
|
+
workspace?: string;
|
|
58
|
+
durationMs: number;
|
|
59
|
+
} | {
|
|
60
|
+
type: "dashboard.save_undo_refused";
|
|
61
|
+
reason: string;
|
|
62
|
+
} | DashboardCreatedEvent | {
|
|
48
63
|
type: "dashboard.rows_shown";
|
|
49
64
|
source: string;
|
|
50
65
|
view: string;
|
|
@@ -56,5 +71,3 @@ export type DashboardEvent = {
|
|
|
56
71
|
tile: string;
|
|
57
72
|
};
|
|
58
73
|
export type DashboardEventHandler = (event: DashboardEvent) => void;
|
|
59
|
-
/** A monotonic clock in milliseconds, for durations. */
|
|
60
|
-
export declare const now: () => number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NotebookCell } from '../../client';
|
|
2
|
+
/**
|
|
3
|
+
* Text-source mode: the document is a string the host keeps, and every query
|
|
4
|
+
* it runs is that document's own definitions followed by one `run:`, sent as
|
|
5
|
+
* the caller's text against a model the caller can already read. Nothing is run
|
|
6
|
+
* as the document's author, so each viewer sees what their own identity allows.
|
|
7
|
+
*/
|
|
8
|
+
/** What a tile says in place of a result the viewer may not read. */
|
|
9
|
+
export declare const RESTRICTED_NOTICE = "You don't have access to this data";
|
|
10
|
+
/**
|
|
11
|
+
* The text a tile's `run:` is appended to: the document's definition cells in
|
|
12
|
+
* file order. Never an `import`, a `##!` flag or a `given:`; the model supplies
|
|
13
|
+
* those, and caller text may not carry them.
|
|
14
|
+
*/
|
|
15
|
+
export declare function documentPreamble(cells: readonly NotebookCell[] | undefined): string;
|
|
16
|
+
/** `preamble` then `text`, as one query. */
|
|
17
|
+
export declare function withPreamble(preamble: string, text: string): string;
|
|
18
|
+
/** The server refused this viewer the source, as opposed to the query failing. */
|
|
19
|
+
export declare function isForbidden(error: unknown): boolean;
|
|
@@ -1,27 +1,31 @@
|
|
|
1
1
|
import { PackageCatalog } from './catalog';
|
|
2
|
+
import { ChartPick } from './chartLine';
|
|
2
3
|
import { DashboardDocument } from './document';
|
|
3
4
|
/**
|
|
4
|
-
* What a new tile is: a view, picked from the package
|
|
5
|
-
* can reach.
|
|
5
|
+
* What a new tile is: a view, picked from the package.
|
|
6
6
|
*
|
|
7
7
|
* The picker is what makes a tile expression correct BY CONSTRUCTION. Every
|
|
8
8
|
* `source -> view` it offers came from the catalog, so the builder never emits
|
|
9
9
|
* a tile that does not resolve — which is why saving needs no compile step
|
|
10
10
|
* beyond the reader's own round-trip.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* or imports it BY NAME. A bare `import "../m.malloy"` may well bring it in,
|
|
17
|
-
* but the file cannot say so, and a guess here fails the whole package load.
|
|
12
|
+
* Every source the package publishes is offered. A tile's view is declared in
|
|
13
|
+
* an extension of its model source, so a source the file cannot see yet is
|
|
14
|
+
* imported by name when the tile is added (`withSource`); one the file already
|
|
15
|
+
* reaches, by name or through a whole-file import of its model, is left alone.
|
|
18
16
|
*/
|
|
19
17
|
export interface NewTile {
|
|
20
18
|
/** The model source the view lives on. */
|
|
21
19
|
base: string;
|
|
20
|
+
/** The model that declares it, for the import a source the file cannot see yet needs. */
|
|
21
|
+
modelPath: string;
|
|
22
22
|
/** The view, as the catalog names it. */
|
|
23
23
|
view: string;
|
|
24
24
|
label?: string;
|
|
25
|
+
/** A chart for the tile; absent keeps the view's own. */
|
|
26
|
+
chart?: ChartPick | "none";
|
|
27
|
+
/** The chart tags the view carries, so the chart line negates only those. */
|
|
28
|
+
chartCarried?: string[];
|
|
25
29
|
colspan: number;
|
|
26
30
|
}
|
|
27
31
|
export interface AddTileDialogProps {
|
|
@@ -31,5 +35,7 @@ export interface AddTileDialogProps {
|
|
|
31
35
|
columns: number;
|
|
32
36
|
onClose: () => void;
|
|
33
37
|
onAdd: (tile: NewTile) => void;
|
|
38
|
+
/** Add an empty text tile, whose markdown is written on the tile itself. */
|
|
39
|
+
onAddText: () => void;
|
|
34
40
|
}
|
|
35
|
-
export declare function AddTileDialog({ open, document, catalog, columns, onClose, onAdd, }: AddTileDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export declare function AddTileDialog({ open, document, catalog, columns, onClose, onAdd, onAddText, }: AddTileDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { UnsavedChangesDialog } from '../UnsavedChangesDialog';
|
|
3
|
+
import { PackageCatalog } from './catalog';
|
|
4
|
+
import { ConversionConfirm } from './useConversionConfirm';
|
|
5
|
+
import { useControlBindings } from './useControlBindings';
|
|
6
|
+
import { DashboardEditor } from './useDashboardEditor';
|
|
7
|
+
import { useTileEditing } from './useTileEditing';
|
|
8
|
+
/**
|
|
9
|
+
* Every window the builder opens, each driven by state its hooks hold: the
|
|
10
|
+
* filter window, a tile's menu, the clickable-cells window, the conversion
|
|
11
|
+
* question, the unsaved-changes guard and the add-tile picker.
|
|
12
|
+
*/
|
|
13
|
+
export declare function BuilderDialogs({ editor, catalog, columns, dashboards, bindings, tiles, drillSource, setDrillSource, confirmConversion, exitDialog, }: {
|
|
14
|
+
editor: DashboardEditor;
|
|
15
|
+
catalog: PackageCatalog | undefined;
|
|
16
|
+
columns: number;
|
|
17
|
+
dashboards: string[] | undefined;
|
|
18
|
+
bindings: ReturnType<typeof useControlBindings>;
|
|
19
|
+
tiles: ReturnType<typeof useTileEditing>;
|
|
20
|
+
/** The source whose clickable cells are being edited, if any. */
|
|
21
|
+
drillSource: string | undefined;
|
|
22
|
+
setDrillSource: (source: string | undefined) => void;
|
|
23
|
+
confirmConversion: ConversionConfirm | undefined;
|
|
24
|
+
exitDialog: ComponentProps<typeof UnsavedChangesDialog>;
|
|
25
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { TileChrome, TileHeadingSlots } from '../Dashboard/TileCard';
|
|
3
|
+
import { DashboardTile, QueryTile } from './document';
|
|
4
|
+
import { DashboardEditor } from './useDashboardEditor';
|
|
5
|
+
import { useTileReorder } from './useTileReorder';
|
|
6
|
+
import { useTileResize } from './useTileResize';
|
|
7
|
+
/**
|
|
8
|
+
* The builder's tiles, on the SAME grid the dashboard renders on, each drawn
|
|
9
|
+
* by the caller's `renderTile` inside a `TileFrame` that carries the
|
|
10
|
+
* affordances: selection, the grip and menu, the width handle.
|
|
11
|
+
*/
|
|
12
|
+
export declare function BuilderGrid({ editor, reorder, resizing, gridBox, columns, notebook, chrome, canAdd, selected, flash, menuIndex, onSelect, onOpenMenu, openAdd, editTile, renderTile, }: {
|
|
13
|
+
editor: DashboardEditor;
|
|
14
|
+
reorder: ReturnType<typeof useTileReorder>;
|
|
15
|
+
resizing: ReturnType<typeof useTileResize>;
|
|
16
|
+
gridBox: RefObject<HTMLDivElement | null>;
|
|
17
|
+
columns: number;
|
|
18
|
+
notebook: boolean;
|
|
19
|
+
chrome: TileChrome;
|
|
20
|
+
/** Whether there is a catalog to add a tile from. */
|
|
21
|
+
canAdd: boolean;
|
|
22
|
+
selected: number | undefined;
|
|
23
|
+
flash: string | undefined;
|
|
24
|
+
/** The tile whose menu is open. */
|
|
25
|
+
menuIndex: number | undefined;
|
|
26
|
+
onSelect: (index: number) => void;
|
|
27
|
+
onOpenMenu: (anchor: HTMLElement, index: number) => void;
|
|
28
|
+
openAdd: (at?: number) => void;
|
|
29
|
+
editTile: (key: string, change: (tile: DashboardTile) => void) => void;
|
|
30
|
+
renderTile?: (tile: QueryTile, heading?: TileHeadingSlots, chrome?: TileChrome) => ReactNode;
|
|
31
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TileChrome } from '../Dashboard/TileCard';
|
|
3
|
+
import { DashboardEditor } from './useDashboardEditor';
|
|
4
|
+
/**
|
|
5
|
+
* The document's title, with the builder's actions on its line, and its
|
|
6
|
+
* description beneath: both edited where they stand, as the reader sees them.
|
|
7
|
+
*/
|
|
8
|
+
export declare function BuilderHeader({ editor, notebook, documentSlug, chrome, actions, descriptionSelected, selectDescription, }: {
|
|
9
|
+
editor: DashboardEditor;
|
|
10
|
+
notebook: boolean;
|
|
11
|
+
/** The name a reader's view titles an untitled document with. */
|
|
12
|
+
documentSlug: string | undefined;
|
|
13
|
+
chrome: TileChrome;
|
|
14
|
+
actions: ReactNode;
|
|
15
|
+
descriptionSelected: boolean;
|
|
16
|
+
selectDescription: () => void;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
1
|
+
import { ReactNode, Ref } from 'react';
|
|
2
|
+
import { SavesTo } from './documentSession';
|
|
3
|
+
/** Where Save puts the document, in the words under the button. */
|
|
4
|
+
export declare const SAVE_TARGET: Record<SavesTo, string>;
|
|
2
5
|
/**
|
|
3
|
-
* The
|
|
4
|
-
*
|
|
5
|
-
* the reader's view uses, so switching modes swaps the contents of one bar
|
|
6
|
-
* rather than replacing one bar with a different one.
|
|
6
|
+
* The builder's actions, as one row with no bar of its own, at the right of
|
|
7
|
+
* the page title's line.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* reader's own header (title and description) stays in the page below it
|
|
13
|
-
* rather than being repeated here.
|
|
9
|
+
* Grouped by what they do, separated rather than run together: change the page
|
|
10
|
+
* (a tile), take a change back (undo, redo), and keep it (Save,
|
|
11
|
+
* which saves in place: the builder stays open, and leaving is the page's
|
|
12
|
+
* own navigation).
|
|
14
13
|
*/
|
|
15
14
|
export interface BuilderToolbarProps {
|
|
16
15
|
canUndo: boolean;
|
|
@@ -21,11 +20,20 @@ export interface BuilderToolbarProps {
|
|
|
21
20
|
saving: boolean;
|
|
22
21
|
/** Absent when the builder has nowhere to save: no Save, no unsaved marker. */
|
|
23
22
|
onSave?: () => void;
|
|
24
|
-
/**
|
|
23
|
+
/** Where Save writes, shown in its tooltip. */
|
|
24
|
+
savesTo?: SavesTo;
|
|
25
|
+
/** The backend's own words for where Save writes; replaces the generic line for `savesTo`. */
|
|
26
|
+
saveLabel?: string;
|
|
27
|
+
/** The Save button, so focus can return to it after an Undo save. */
|
|
28
|
+
saveButton?: Ref<HTMLButtonElement>;
|
|
29
|
+
/** The host's own extra actions, beside Save. */
|
|
25
30
|
actions?: ReactNode;
|
|
26
31
|
/** Open the add-tile picker. Absent when the host passed no catalog to pick from. */
|
|
27
32
|
onAddTile?: () => void;
|
|
28
|
-
/**
|
|
29
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Leave the builder: draws Close after Save, for a host that opts in. The
|
|
35
|
+
* Console leaves from its own header and passes nothing.
|
|
36
|
+
*/
|
|
37
|
+
onExit?: () => void;
|
|
30
38
|
}
|
|
31
|
-
export declare function BuilderToolbar({ canUndo, canRedo, onUndo, onRedo, dirty, saving, onSave, actions, onAddTile,
|
|
39
|
+
export declare function BuilderToolbar({ canUndo, canRedo, onUndo, onRedo, dirty, saving, onSave, savesTo, saveLabel, saveButton, actions, onAddTile, onExit, }: BuilderToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CatalogView } from './catalog';
|
|
2
|
+
import { ChartState } from './chartLine';
|
|
3
|
+
export interface ChartChoice {
|
|
4
|
+
value: ChartState;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Listed but not pickable; `reason` says what the view would need. */
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
reason?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Why a view is absent, so the reason on a disabled choice says whether to wait or to pick another. */
|
|
11
|
+
export type ViewStatus = "loading" | "unlisted";
|
|
12
|
+
/**
|
|
13
|
+
* Every chart a cell can be set to; one the view cannot render is listed disabled with its reason, so it is discoverable rather than missing.
|
|
14
|
+
* Whatever the cell has now stays selectable, so the select never shows a value it does not offer.
|
|
15
|
+
*/
|
|
16
|
+
export declare function chartChoices(view: Pick<CatalogView, "chart" | "aggregateOnly"> | undefined, current: ChartState, viewStatus?: ViewStatus): ChartChoice[];
|
|
17
|
+
export declare function ChartPicker({ state, view, viewStatus, cellLabel, disabledReason, onOpen, onChange, variant, }: {
|
|
18
|
+
state: ChartState;
|
|
19
|
+
/** The catalog's view this cell runs, when it is one the catalog knows. */
|
|
20
|
+
view: Pick<CatalogView, "chart" | "aggregateOnly"> | undefined;
|
|
21
|
+
/** Why `view` is absent, worded into the reasons on the charts that need its shape. */
|
|
22
|
+
viewStatus?: ViewStatus;
|
|
23
|
+
/** Which cell this is, so the control is named apart from its neighbours. */
|
|
24
|
+
cellLabel: string;
|
|
25
|
+
disabledReason?: string;
|
|
26
|
+
/** The choices are being looked at, which is when a host may fetch what it needs to offer more. */
|
|
27
|
+
onOpen?: () => void;
|
|
28
|
+
onChange: (next: ChartState) => void;
|
|
29
|
+
/** The field's look: underlined in a compact menu, outlined beside a dialog's other fields. */
|
|
30
|
+
variant?: "standard" | "outlined";
|
|
31
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { TileChrome, TileHeadingSlots } from '../Dashboard/TileCard';
|
|
3
|
+
import { SavesTo } from './documentSession';
|
|
4
|
+
import { BuilderEvent } from './telemetry';
|
|
3
5
|
import { BuilderGiven } from './controls';
|
|
4
6
|
import { PackageCatalog } from './catalog';
|
|
5
|
-
import { DashboardDocument,
|
|
7
|
+
import { DashboardDocument, QueryTile } from './document';
|
|
8
|
+
import { SaveHandler } from './useDocumentEditor';
|
|
6
9
|
export type { BuilderGiven } from './controls';
|
|
7
10
|
/**
|
|
8
11
|
* The dashboard builder's editing surface.
|
|
@@ -20,30 +23,31 @@ export type { BuilderGiven } from './controls';
|
|
|
20
23
|
* draws its own card AND its own heading. Nesting one inside a card of ours
|
|
21
24
|
* would show a card in a card under two titles — which is precisely not what a
|
|
22
25
|
* reader sees. So every affordance is drawn AROUND whatever the caller renders:
|
|
23
|
-
* an outline for selection, a grip and a menu in the corners
|
|
24
|
-
* edge.
|
|
26
|
+
* an outline for selection, a grip and a menu in the corners.
|
|
25
27
|
*
|
|
26
|
-
* **Everything here is on the thing it changes.**
|
|
27
|
-
*
|
|
28
|
-
* to change which row it is in.
|
|
29
|
-
*
|
|
28
|
+
* **Everything here is on the thing it changes.** Set a tile's width from its menu, and drag
|
|
29
|
+
* the tile itself to reorder — into the empty end of a row
|
|
30
|
+
* to change which row it is in. Click a title, subtitle, description or text
|
|
31
|
+
* tile to edit it where it stands. FILTERS are configured in exactly one place, the strip under the
|
|
30
32
|
* header: each chip opens the tiles-to-update window for that control,
|
|
31
33
|
* which is where a tile is bound or unbound, and "Add filter" declares a new
|
|
32
34
|
* one in this file — the convention {@link LocalGiven} describes — or binds one
|
|
33
35
|
* the model offers. Nothing about filters is on the tiles themselves: a second
|
|
34
36
|
* place to edit the same binding is a second place for it to be wrong.
|
|
35
37
|
*
|
|
36
|
-
* Tiles are added from the package's catalog and removed from their menu
|
|
37
|
-
* save that adds or removes one shows the file's diff first, because those
|
|
38
|
-
* moves relocate declarations and the comments beside them.
|
|
38
|
+
* Tiles are added from the package's catalog and removed from their menu.
|
|
39
39
|
*/
|
|
40
40
|
export interface DashboardBuilderProps {
|
|
41
41
|
/** The file being edited. */
|
|
42
42
|
source: string;
|
|
43
43
|
/** The document that file produced. */
|
|
44
44
|
document: DashboardDocument;
|
|
45
|
-
/**
|
|
46
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Persist the patched file. Left out, the builder edits without saving.
|
|
47
|
+
* Undo save calls it too, with `purpose: "undo"` and the text from before
|
|
48
|
+
* the save, so it must write through the same channel and checks.
|
|
49
|
+
*/
|
|
50
|
+
onSave?: SaveHandler<DashboardDocument>;
|
|
47
51
|
/**
|
|
48
52
|
* The document as it stands, on every edit — including the first render.
|
|
49
53
|
*
|
|
@@ -58,8 +62,15 @@ export interface DashboardBuilderProps {
|
|
|
58
62
|
/**
|
|
59
63
|
* Renders a tile, card and heading included — this is where a real
|
|
60
64
|
* `DashboardTile` goes. Without it, tiles show what they will run.
|
|
65
|
+
*
|
|
66
|
+
* `heading` is the tile's title and subtitle as fields edited in place;
|
|
67
|
+
* absent for a tile whose title the model owns. A host that draws the
|
|
68
|
+
* heading itself passes it on (`DashboardTile`'s `heading`), or the tile
|
|
69
|
+
* cannot be retitled on the page.
|
|
61
70
|
*/
|
|
62
|
-
renderTile?: (tile:
|
|
71
|
+
renderTile?: (tile: QueryTile, heading?: TileHeadingSlots,
|
|
72
|
+
/** The document's tile chrome — bare on a notebook — so the live tile reads as the reader's. */
|
|
73
|
+
chrome?: TileChrome) => ReactNode;
|
|
63
74
|
/**
|
|
64
75
|
* The control row, in the slot the reader puts it — this is where a real
|
|
65
76
|
* `GivensPanel` goes.
|
|
@@ -100,8 +111,17 @@ export interface DashboardBuilderProps {
|
|
|
100
111
|
* go. Absent, a drill can only filter this dashboard.
|
|
101
112
|
*/
|
|
102
113
|
dashboards?: string[];
|
|
103
|
-
/** Saves and refusals, for the host to log; see `DashboardEvent`. */
|
|
104
|
-
onEvent?:
|
|
114
|
+
/** Saves and refusals, for the host to log; see `DashboardEvent`. A notebook-kind document reports `NotebookEvent`s instead. */
|
|
115
|
+
onEvent?: (event: BuilderEvent) => void;
|
|
116
|
+
/**
|
|
117
|
+
* The document is a conversion of a cell-format notebook: `from` is the text
|
|
118
|
+
* on disk, `to` the layout text it converts to. Save writes `to` with the
|
|
119
|
+
* edits spliced in, and Undo save puts `from` back.
|
|
120
|
+
*/
|
|
121
|
+
conversion?: {
|
|
122
|
+
from: string;
|
|
123
|
+
to: string;
|
|
124
|
+
};
|
|
105
125
|
/**
|
|
106
126
|
* Whether the document differs from what was last saved, on every change
|
|
107
127
|
* and on mount.
|
|
@@ -119,12 +139,27 @@ export interface DashboardBuilderProps {
|
|
|
119
139
|
* this browser, and into a host store that holds the record are not the
|
|
120
140
|
* same event.
|
|
121
141
|
*/
|
|
122
|
-
savesTo?:
|
|
142
|
+
savesTo?: SavesTo;
|
|
143
|
+
/** The backend's own words for where Save writes, in place of the generic line for `savesTo`. */
|
|
144
|
+
saveLabel?: string;
|
|
145
|
+
/** The file a save overwrites when `source` is a draft of it, so Undo save restores that file rather than the draft. */
|
|
146
|
+
replaces?: string;
|
|
147
|
+
/** The document's file within the package, so a kind switch tags what its folder would otherwise misread. */
|
|
148
|
+
modelPath?: string;
|
|
149
|
+
/** The document is held as text, which the server reads by its tags rather than its folder: the tag always carries `kind=`. */
|
|
150
|
+
explicitKind?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* Why "Add filter" is off, or absent when it is on. A document kept as bare
|
|
153
|
+
* text has no `given:` of its own to write, so only the model's givens can
|
|
154
|
+
* be bound, from the chips.
|
|
155
|
+
*/
|
|
156
|
+
addFilterDisabledReason?: string;
|
|
123
157
|
/**
|
|
124
|
-
* The host's own actions for the edit bar
|
|
125
|
-
*
|
|
126
|
-
* afterwards is the host's, so its buttons sit in the host's slot.
|
|
158
|
+
* The host's own extra actions for the edit bar, rendered beside undo, redo
|
|
159
|
+
* and save.
|
|
127
160
|
*/
|
|
128
161
|
toolbar?: ReactNode;
|
|
162
|
+
/** Leave the builder, opted into: draws Close, which asks first when edits are unsaved. */
|
|
163
|
+
onExit?: () => void;
|
|
129
164
|
}
|
|
130
|
-
export declare function DashboardBuilder({ source, document, onSave, onChange, onDirtyChange, renderTile, controls, givens, catalog, toolbar, dashboards, onEvent, savesTo, }: DashboardBuilderProps): import("react/jsx-runtime").JSX.Element;
|
|
165
|
+
export declare function DashboardBuilder({ source, document, onSave, onChange, onDirtyChange, onExit, renderTile, controls, givens, catalog, toolbar, dashboards, onEvent, conversion, savesTo, saveLabel, replaces, modelPath, explicitKind, addFilterDisabledReason, }: DashboardBuilderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HostGivenValue } from '../../hooks/givenValue';
|
|
2
|
+
import { BuilderEvent } from './telemetry';
|
|
3
|
+
import { DocumentKind } from './document';
|
|
2
4
|
/**
|
|
3
5
|
* The builder, opened on a package dashboard, with everything a host has to
|
|
4
6
|
* supply already wired: the file's text and manifest from the server, a live
|
|
@@ -33,13 +35,23 @@ export type DashboardEditorProps = ({
|
|
|
33
35
|
*/
|
|
34
36
|
dashboardName: string;
|
|
35
37
|
}) & {
|
|
36
|
-
/** Leave the editor: the host's "Done editing". Absent, no such button. */
|
|
37
|
-
onExit?: () => void;
|
|
38
38
|
/**
|
|
39
39
|
* What the editor does — opened, saved, refused — for the host to log or
|
|
40
|
-
* count; see `DashboardEvent`.
|
|
40
|
+
* count; see `DashboardEvent`. A notebook reports `NotebookEvent`s instead.
|
|
41
|
+
*/
|
|
42
|
+
onEvent?: (event: BuilderEvent) => void;
|
|
43
|
+
/**
|
|
44
|
+
* What the document is to the host: its storage locator and event names.
|
|
45
|
+
* Default `dashboard`. A notebook is a dashboard with one column, and is
|
|
46
|
+
* read with the authoring flag and served through the notebook endpoint.
|
|
41
47
|
*/
|
|
42
|
-
|
|
48
|
+
kind?: DocumentKind;
|
|
49
|
+
/**
|
|
50
|
+
* The document's file within the package, when it is not where its kind
|
|
51
|
+
* puts a new one (`dashboards/<slug>.malloy`, `notebooks/<slug>.malloy`):
|
|
52
|
+
* the kind comes from the file's own tag, so a document may sit in either.
|
|
53
|
+
*/
|
|
54
|
+
path?: string;
|
|
43
55
|
/**
|
|
44
56
|
* Whether there are edits the record does not have, on every change and
|
|
45
57
|
* whenever the editor opens a document.
|
|
@@ -49,5 +61,32 @@ export type DashboardEditorProps = ({
|
|
|
49
61
|
* without this a host cannot tell whether leaving costs anything.
|
|
50
62
|
*/
|
|
51
63
|
onDirtyChange?: (dirty: boolean) => void;
|
|
64
|
+
/**
|
|
65
|
+
* Leave the editor: opted into, it draws Close after Save, which asks first
|
|
66
|
+
* when edits are unsaved. A host with a way out of its own (the Console's
|
|
67
|
+
* header View) leaves it unset and guards with `onDirtyChange`.
|
|
68
|
+
*/
|
|
69
|
+
onExit?: () => void;
|
|
70
|
+
/** Edit a document held as text; see {@link TextSourceOptions}. */
|
|
71
|
+
textSource?: TextSourceOptions;
|
|
52
72
|
};
|
|
73
|
+
/**
|
|
74
|
+
* Open a document the host keeps as TEXT, rather than a file in a package.
|
|
75
|
+
*
|
|
76
|
+
* The text comes from the host's authoritative {@link DocumentStorage} and is
|
|
77
|
+
* compiled by the server, as the viewer, on top of `modelPath`: the model whose
|
|
78
|
+
* sources the document may name. The manifest is that compile's `document`, and
|
|
79
|
+
* every tile, cell and control option runs as the document's definitions
|
|
80
|
+
* followed by one `run:`, so each viewer sees what their own identity allows.
|
|
81
|
+
* The document carries no `import`, `##!` or `given:`, so "Add filter" is off
|
|
82
|
+
* and only the model's givens can be bound.
|
|
83
|
+
*/
|
|
84
|
+
export interface TextSourceOptions {
|
|
85
|
+
/** The model the text is compiled and run on top of. */
|
|
86
|
+
modelPath: string;
|
|
87
|
+
/** Givens the host sets itself: no control is shown for them. */
|
|
88
|
+
hiddenGivens?: readonly string[];
|
|
89
|
+
/** The values for the givens the host sets: sent with the compile and with each tile that reads one. */
|
|
90
|
+
givens?: Record<string, HostGivenValue>;
|
|
91
|
+
}
|
|
53
92
|
export declare function DashboardEditor(props: DashboardEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Given } from '../../client';
|
|
2
|
+
import { DashboardDocument, DocumentKind } from './document';
|
|
3
|
+
import { SavesTo } from './documentSession';
|
|
4
|
+
import { TextSourceOptions } from './DashboardEditor';
|
|
5
|
+
import { BuilderEvent } from './telemetry';
|
|
6
|
+
export declare function EditorSurface({ textSource, kind, modelGivens, environmentName, packageName, modelPath, slug, versionId, opened, replaces, onSave, onDirtyChange, onExit, onEvent, savesTo, saveLabel, note, }: {
|
|
7
|
+
textSource?: TextSourceOptions;
|
|
8
|
+
kind: DocumentKind;
|
|
9
|
+
/** The model's own givens, for a cell-format notebook whose manifest the server cannot build until it is saved. */
|
|
10
|
+
modelGivens?: Given[];
|
|
11
|
+
environmentName: string;
|
|
12
|
+
packageName: string;
|
|
13
|
+
modelPath: string;
|
|
14
|
+
slug: string;
|
|
15
|
+
versionId?: string;
|
|
16
|
+
opened: {
|
|
17
|
+
source: string;
|
|
18
|
+
document: DashboardDocument;
|
|
19
|
+
conversion?: {
|
|
20
|
+
from: string;
|
|
21
|
+
to: string;
|
|
22
|
+
};
|
|
23
|
+
generation: number;
|
|
24
|
+
};
|
|
25
|
+
replaces?: string;
|
|
26
|
+
onSave?: (source: string) => Promise<void>;
|
|
27
|
+
onDirtyChange: (dirty: boolean) => void;
|
|
28
|
+
onExit?: () => void;
|
|
29
|
+
onEvent?: (event: BuilderEvent) => void;
|
|
30
|
+
savesTo: SavesTo;
|
|
31
|
+
saveLabel?: string;
|
|
32
|
+
note: string;
|
|
33
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CatalogField } from './catalog';
|
|
2
2
|
import { BuilderControl, MappingRow } from './controls';
|
|
3
|
-
import { DashboardDocument,
|
|
3
|
+
import { DashboardDocument, LocalGiven, QueryTile } from './document';
|
|
4
4
|
/**
|
|
5
5
|
* A filter control: what it is, and which tiles it drives.
|
|
6
6
|
*
|
|
@@ -41,7 +41,7 @@ export interface FilterDialogProps {
|
|
|
41
41
|
* source the host has no catalog for, in which case any name is accepted
|
|
42
42
|
* for it and nothing is searched.
|
|
43
43
|
*/
|
|
44
|
-
fieldsFor?: (tile:
|
|
44
|
+
fieldsFor?: (tile: QueryTile) => readonly CatalogField[] | undefined;
|
|
45
45
|
onClose: () => void;
|
|
46
46
|
/**
|
|
47
47
|
* Bind a control. `declare` is set when the control is new to this file, or
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { BuilderControl } from './controls';
|
|
3
3
|
/**
|
|
4
|
-
* The strip
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* The strip where the dashboard's controls are configured — the ONE place: a
|
|
5
|
+
* chip per control opens its window, and "Add filter" beside them declares a
|
|
6
|
+
* new one. The live control row the host renders sits under it.
|
|
7
7
|
*/
|
|
8
|
-
export declare function FilterStrip({ controls: controlList, tileCount, unknownFieldsOf, onEdit, onAdd, children, }: {
|
|
8
|
+
export declare function FilterStrip({ controls: controlList, tileCount, unknownFieldsOf, onEdit, onAdd, addDisabledReason, onRemove, children, }: {
|
|
9
9
|
controls: BuilderControl[];
|
|
10
10
|
tileCount: number;
|
|
11
11
|
/** Bindings a control has that its tiles' sources cannot take. */
|
|
12
12
|
unknownFieldsOf: (name: string, type: string | undefined) => string[];
|
|
13
13
|
onEdit: (control: BuilderControl) => void;
|
|
14
14
|
onAdd: () => void;
|
|
15
|
+
/** Why adding is off; set, the chip is disabled and its tooltip says why. */
|
|
16
|
+
addDisabledReason?: string;
|
|
17
|
+
/** Take a control off the dashboard, as its window's Remove does. */
|
|
18
|
+
onRemove: (name: string) => void;
|
|
15
19
|
/** The host's live control row. */
|
|
16
20
|
children?: ReactNode;
|
|
17
21
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ProseVariant } from '../Prose';
|
|
2
|
+
/**
|
|
3
|
+
* Markdown that is edited where it is read: it draws as prose, a click on it
|
|
4
|
+
* opens a textarea, and what was typed commits once, when the field closes.
|
|
5
|
+
*
|
|
6
|
+
* Escape and Cmd or Ctrl+Enter are Done, which holds on a draft the writer
|
|
7
|
+
* would refuse and says why; leaving the field commits, so the closed prose
|
|
8
|
+
* keeps saying what Save will refuse. Links stay inert: a click on one is not
|
|
9
|
+
* a way out of the builder, and not an edit either.
|
|
10
|
+
*/
|
|
11
|
+
export declare function InlineMarkdown({ markdown, placeholder, onCommit, variant, }: {
|
|
12
|
+
markdown: string;
|
|
13
|
+
/** Shown in place of empty prose. */
|
|
14
|
+
placeholder: string;
|
|
15
|
+
/** Called once per edit, with the new text, only when it differs from `markdown`. */
|
|
16
|
+
onCommit: (next: string) => void;
|
|
17
|
+
variant?: ProseVariant;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single line of text that is edited where it is read: a click opens a field,
|
|
3
|
+
* Enter or leaving it commits, Escape puts the old text back.
|
|
4
|
+
*
|
|
5
|
+
* The display is a real button, so it is a tab stop that Enter and Space open,
|
|
6
|
+
* and the drag sensor refuses a press that starts on one: opening an editor can
|
|
7
|
+
* never be the start of a move.
|
|
8
|
+
*/
|
|
9
|
+
export declare function InlineText({ value, placeholder, ariaLabel, onCommit, faintWhenEmpty, }: {
|
|
10
|
+
value: string;
|
|
11
|
+
/** Shown in place of an empty value. */
|
|
12
|
+
placeholder: string;
|
|
13
|
+
/** Names the field while it is open. */
|
|
14
|
+
ariaLabel: string;
|
|
15
|
+
/** Called once per edit, with the new text, only when it differs from `value`. */
|
|
16
|
+
onCommit: (next: string) => void;
|
|
17
|
+
/** Hides an empty value until its tile is hovered or focused. */
|
|
18
|
+
faintWhenEmpty?: boolean;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DashboardEditorProps } from './DashboardEditor';
|
|
2
|
+
/** The props a host passed the notebook editor before notebooks opened in the one builder. */
|
|
3
|
+
export type NotebookEditorProps = ({
|
|
4
|
+
/** `publisher://environments/{env}/packages/{pkg}`, optionally `?versionId=`. */
|
|
5
|
+
resourceUri: string;
|
|
6
|
+
/** The notebook's slug: `overview` for `notebooks/overview.malloy`. */
|
|
7
|
+
notebook: string;
|
|
8
|
+
} | {
|
|
9
|
+
environmentName: string;
|
|
10
|
+
packageName: string;
|
|
11
|
+
/** The notebook's slug: `overview` for `notebooks/overview.malloy`. */
|
|
12
|
+
notebookName: string;
|
|
13
|
+
}) & Pick<DashboardEditorProps, "onEvent" | "onDirtyChange" | "onExit" | "path">;
|
|
14
|
+
/** `DashboardEditor` opened on a notebook, under the name hosts already import. */
|
|
15
|
+
export declare function NotebookEditor(props: NotebookEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CatalogSource } from './catalog';
|
|
2
|
+
/** A source select and the list of its views, which is what both "add a tile" and "add a query" pick from. */
|
|
3
|
+
export declare function SourceViewPicker({ sources, source, view, onSource, onView, }: {
|
|
4
|
+
sources: CatalogSource[];
|
|
5
|
+
source: string;
|
|
6
|
+
view: string;
|
|
7
|
+
onSource: (name: string) => void;
|
|
8
|
+
onView: (name: string) => void;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TileChrome } from '../Dashboard/TileCard';
|
|
2
|
+
import { TextTile } from './document';
|
|
3
|
+
export declare const TEXT_TILE_PLACEHOLDER = "Write markdown: # heading, **bold**, - list";
|
|
4
|
+
/** A text tile as the builder draws it: its markdown, edited in place. */
|
|
5
|
+
export declare function TextTileBody({ tile, onChange, chrome, }: {
|
|
6
|
+
tile: TextTile;
|
|
7
|
+
onChange: (markdown: string) => void;
|
|
8
|
+
/** The document's tile chrome: a card on a dashboard, bare on a notebook, as the reader draws it. */
|
|
9
|
+
chrome?: TileChrome;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|