@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,88 +1,88 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Box as
|
|
3
|
-
import { Suspense as
|
|
4
|
-
import { D as
|
|
5
|
-
import {
|
|
1
|
+
import { jsx as L } from "react/jsx-runtime";
|
|
2
|
+
import { Box as ne, useTheme as he } from "@mui/material";
|
|
3
|
+
import { Suspense as me, useRef as z, 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-BU6d8FPp.es.js";
|
|
5
|
+
import { aM as Ee, aK as Se, aN as Ae } from "./ServerProvider-CcSrGaRN.es.js";
|
|
6
6
|
const g = "publisher-drill";
|
|
7
|
-
function
|
|
7
|
+
function Te(e, r) {
|
|
8
8
|
const t = /* @__PURE__ */ new Set();
|
|
9
|
-
let
|
|
9
|
+
let l;
|
|
10
10
|
try {
|
|
11
|
-
|
|
11
|
+
l = e.getMetadata()?.getAllFields() ?? [];
|
|
12
12
|
} catch {
|
|
13
13
|
return t;
|
|
14
14
|
}
|
|
15
|
-
const
|
|
16
|
-
for (const
|
|
17
|
-
!
|
|
18
|
-
for (const
|
|
19
|
-
if (!
|
|
20
|
-
const
|
|
21
|
-
|
|
15
|
+
const o = /* @__PURE__ */ new Set();
|
|
16
|
+
for (const a of l)
|
|
17
|
+
!a || r(a) || a.tag?.tag("hidden") === void 0 && o.add(a.tag?.text("label") ?? a.name);
|
|
18
|
+
for (const a of l) {
|
|
19
|
+
if (!a || !r(a)) continue;
|
|
20
|
+
const n = a.tag?.text("label") ?? a.name;
|
|
21
|
+
o.has(n) || t.add(n);
|
|
22
22
|
}
|
|
23
23
|
return t;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function I(e) {
|
|
26
26
|
const r = /^\s*(\d+)/.exec(e.style?.gridColumn ?? "");
|
|
27
27
|
return r ? r[1] : void 0;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function De(e, r) {
|
|
30
30
|
if (r.size !== 0)
|
|
31
31
|
for (const t of e.querySelectorAll(
|
|
32
32
|
".malloy-table"
|
|
33
33
|
)) {
|
|
34
|
-
const
|
|
35
|
-
for (const
|
|
34
|
+
const l = (n) => n.closest(".malloy-table") === t, o = /* @__PURE__ */ new Set();
|
|
35
|
+
for (const n of t.querySelectorAll(
|
|
36
36
|
".column-cell.th"
|
|
37
37
|
)) {
|
|
38
|
-
if (!
|
|
39
|
-
const s = (
|
|
40
|
-
|
|
38
|
+
if (!l(n)) continue;
|
|
39
|
+
const s = (n.textContent ?? "").replace(/\u200b/g, "").trim(), b = I(n);
|
|
40
|
+
b && r.has(s) && o.add(b);
|
|
41
41
|
}
|
|
42
|
-
if (
|
|
43
|
-
const
|
|
44
|
-
for (const
|
|
42
|
+
if (o.size === 0) continue;
|
|
43
|
+
const a = /* @__PURE__ */ new Set();
|
|
44
|
+
for (const n of t.querySelectorAll(
|
|
45
45
|
`.${g}[tabindex="0"]`
|
|
46
46
|
)) {
|
|
47
|
-
if (!
|
|
48
|
-
const s =
|
|
49
|
-
s && (
|
|
47
|
+
if (!l(n)) continue;
|
|
48
|
+
const s = I(n);
|
|
49
|
+
s && (a.has(s) ? n.tabIndex = -1 : a.add(s));
|
|
50
50
|
}
|
|
51
|
-
for (const
|
|
51
|
+
for (const n of t.querySelectorAll(
|
|
52
52
|
".column-cell.td"
|
|
53
53
|
)) {
|
|
54
|
-
if (!
|
|
55
|
-
const s =
|
|
56
|
-
if (s &&
|
|
57
|
-
if (
|
|
58
|
-
|
|
54
|
+
if (!l(n)) continue;
|
|
55
|
+
const s = I(n), b = !n.querySelector(".value-null") && (n.textContent ?? "").trim() !== "";
|
|
56
|
+
if (s && b && o.has(s) && !n.querySelector(".malloy-table")) {
|
|
57
|
+
if (n.classList.add(g), n.tabIndex === 0)
|
|
58
|
+
a.add(s);
|
|
59
59
|
else {
|
|
60
|
-
const
|
|
61
|
-
|
|
60
|
+
const y = a.has(s);
|
|
61
|
+
y || a.add(s), n.tabIndex = y ? -1 : 0;
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
n.setAttribute("role", "button");
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
const r = e.closest(".malloy-table"), t =
|
|
68
|
+
function Oe(e) {
|
|
69
|
+
const r = e.closest(".malloy-table"), t = I(e);
|
|
70
70
|
return !r || !t ? [] : Array.from(
|
|
71
71
|
r.querySelectorAll(`.${g}`)
|
|
72
72
|
).filter(
|
|
73
|
-
(
|
|
73
|
+
(l) => l.closest(".malloy-table") === r && I(l) === t
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
const t =
|
|
78
|
-
if (
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
81
|
-
for (const
|
|
82
|
-
return
|
|
76
|
+
function ie(e, r) {
|
|
77
|
+
const t = Oe(e), l = t.indexOf(e);
|
|
78
|
+
if (l === -1) return;
|
|
79
|
+
const o = r === "first" ? t[0] : r === "last" ? t[t.length - 1] : t[Math.min(Math.max(l + r, 0), t.length - 1)];
|
|
80
|
+
if (o) {
|
|
81
|
+
for (const a of t) a.tabIndex = a === o ? 0 : -1;
|
|
82
|
+
return o;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function _e(e) {
|
|
86
86
|
return {
|
|
87
87
|
background: e.dashboardRoot,
|
|
88
88
|
tableBackground: e.tableBackground,
|
|
@@ -104,106 +104,105 @@ function Ae(e) {
|
|
|
104
104
|
mapColor: e.mapColor
|
|
105
105
|
};
|
|
106
106
|
}
|
|
107
|
-
function
|
|
108
|
-
const { foreground: r, axisFaint: t, font:
|
|
107
|
+
function Fe(e) {
|
|
108
|
+
const { foreground: r, axisFaint: t, gridline: l, font: o } = e, a = {
|
|
109
109
|
background: e.background,
|
|
110
|
-
font:
|
|
111
|
-
title: { color: r, font:
|
|
110
|
+
font: o.family,
|
|
111
|
+
title: { color: r, font: o.family },
|
|
112
112
|
axis: {
|
|
113
113
|
labelColor: r,
|
|
114
114
|
titleColor: r,
|
|
115
115
|
domainColor: t,
|
|
116
116
|
tickColor: t,
|
|
117
|
-
gridColor:
|
|
118
|
-
labelFont:
|
|
119
|
-
titleFont:
|
|
117
|
+
gridColor: l,
|
|
118
|
+
labelFont: o.family,
|
|
119
|
+
titleFont: o.family
|
|
120
120
|
},
|
|
121
121
|
legend: {
|
|
122
122
|
labelColor: r,
|
|
123
123
|
titleColor: r,
|
|
124
|
-
labelFont:
|
|
125
|
-
titleFont:
|
|
124
|
+
labelFont: o.family,
|
|
125
|
+
titleFont: o.family
|
|
126
126
|
},
|
|
127
127
|
header: { labelColor: r, titleColor: r },
|
|
128
128
|
range: { category: e.series }
|
|
129
129
|
};
|
|
130
|
-
return (
|
|
130
|
+
return (n) => a;
|
|
131
131
|
}
|
|
132
|
-
function
|
|
132
|
+
function ze(e) {
|
|
133
133
|
if (!e) return;
|
|
134
134
|
const r = e.tag("theme");
|
|
135
135
|
if (!r) return;
|
|
136
|
-
const t = {},
|
|
137
|
-
if (
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
for (const s of
|
|
141
|
-
const
|
|
142
|
-
if (!
|
|
143
|
-
const
|
|
144
|
-
|
|
136
|
+
const t = {}, l = r.tag("palette");
|
|
137
|
+
if (l) {
|
|
138
|
+
const a = {}, n = l.textArray("series");
|
|
139
|
+
n && n.length > 0 && (a.series = n);
|
|
140
|
+
for (const s of Ee) {
|
|
141
|
+
const b = l.tag(s);
|
|
142
|
+
if (!b) continue;
|
|
143
|
+
const y = {}, k = b.text("light"), v = b.text("dark");
|
|
144
|
+
k && (y.light = k), v && (y.dark = v), Object.keys(y).length > 0 && (a[s] = y);
|
|
145
145
|
}
|
|
146
|
-
Object.keys(
|
|
146
|
+
Object.keys(a).length > 0 && (t.palette = a);
|
|
147
147
|
}
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
150
|
-
const
|
|
151
|
-
|
|
152
|
-
const s =
|
|
153
|
-
typeof s == "number" && Number.isFinite(s) && (
|
|
148
|
+
const o = r.tag("font");
|
|
149
|
+
if (o) {
|
|
150
|
+
const a = {}, n = o.text("family");
|
|
151
|
+
n && (a.family = n);
|
|
152
|
+
const s = o.numeric("size");
|
|
153
|
+
typeof s == "number" && Number.isFinite(s) && (a.size = s), Object.keys(a).length > 0 && (t.font = a);
|
|
154
154
|
}
|
|
155
155
|
return Object.keys(t).length > 0 ? t : void 0;
|
|
156
156
|
}
|
|
157
|
-
const
|
|
157
|
+
const M = "data-publisher-fill", Le = async (e, r) => {
|
|
158
158
|
if (typeof window > "u")
|
|
159
159
|
throw new Error("MalloyRenderer can only be used in browser environment");
|
|
160
|
-
const { MalloyRenderer: t } = await
|
|
160
|
+
const { MalloyRenderer: t } = await we();
|
|
161
161
|
return new t({
|
|
162
162
|
onClick: r,
|
|
163
|
-
vegaConfigOverride:
|
|
163
|
+
vegaConfigOverride: Fe(e),
|
|
164
164
|
// Pass the explicit theme so table chrome and dashboard tiles
|
|
165
165
|
// pick up the operator's colours directly. Without this the
|
|
166
166
|
// renderer's own inline style writes `--malloy-render--*` values
|
|
167
167
|
// sourced from its built-in defaults and shadows whatever we set
|
|
168
168
|
// on the outer wrapper.
|
|
169
|
-
theme:
|
|
170
|
-
onError: (
|
|
171
|
-
console.error("Error rendering visualization:", typeof
|
|
169
|
+
theme: _e(e),
|
|
170
|
+
onError: (o) => {
|
|
171
|
+
console.error("Error rendering visualization:", typeof o, o);
|
|
172
172
|
}
|
|
173
173
|
}).createViz();
|
|
174
174
|
};
|
|
175
|
-
|
|
176
|
-
async function _e(e) {
|
|
175
|
+
async function Me(e) {
|
|
177
176
|
if (!e || typeof e != "object") return;
|
|
178
177
|
const r = e, t = [
|
|
179
178
|
...Array.isArray(r.model_annotations) ? r.model_annotations : [],
|
|
180
179
|
...Array.isArray(r.source_annotations) ? r.source_annotations : [],
|
|
181
180
|
...Array.isArray(r.annotations) ? r.annotations : []
|
|
182
|
-
].map((
|
|
181
|
+
].map((o) => typeof o?.value == "string" ? o.value : void 0).filter((o) => !!o);
|
|
183
182
|
if (t.length === 0) return;
|
|
184
|
-
let
|
|
183
|
+
let l;
|
|
185
184
|
try {
|
|
186
|
-
({ parseAnnotation:
|
|
185
|
+
({ parseAnnotation: l } = await ve());
|
|
187
186
|
} catch {
|
|
188
187
|
return;
|
|
189
188
|
}
|
|
190
189
|
try {
|
|
191
|
-
const { tag:
|
|
192
|
-
return
|
|
193
|
-
} catch (
|
|
190
|
+
const { tag: o } = l(t);
|
|
191
|
+
return ze(o);
|
|
192
|
+
} catch (o) {
|
|
194
193
|
console.warn(
|
|
195
194
|
"Failed to parse # theme.* annotations; chart will render with the shell theme.",
|
|
196
|
-
{ error:
|
|
195
|
+
{ error: o, lines: t }
|
|
197
196
|
);
|
|
198
197
|
return;
|
|
199
198
|
}
|
|
200
199
|
}
|
|
201
|
-
function
|
|
202
|
-
const
|
|
203
|
-
for (const [
|
|
204
|
-
e.style.setProperty(
|
|
200
|
+
function Ie(e, r, t) {
|
|
201
|
+
const l = ke(r, t);
|
|
202
|
+
for (const [o, a] of Object.entries(l))
|
|
203
|
+
e.style.setProperty(o, a);
|
|
205
204
|
}
|
|
206
|
-
const
|
|
205
|
+
const Be = `
|
|
207
206
|
/* Card geometry, through the renderer's OWN theme vars rather than over the top
|
|
208
207
|
of them. It declares --malloy-theme--dashboard-* on .malloy-render itself and
|
|
209
208
|
passes each through to the --malloy-render--* the card CSS reads, so a value
|
|
@@ -288,6 +287,12 @@ div.malloy-render .malloy-dashboard .dashboard-row-header {
|
|
|
288
287
|
.malloy-render .malloy-dashboard .dashboard-row-header-separator {
|
|
289
288
|
background: var(--malloy-render--table-border) !important;
|
|
290
289
|
}
|
|
290
|
+
/* !important because the malloy-explorer stylesheet pins these same properties with it. */
|
|
291
|
+
[${M}] .malloy-table.root {
|
|
292
|
+
height: 100% !important;
|
|
293
|
+
align-content: start !important;
|
|
294
|
+
grid-template-columns: repeat(var(--total-header-size), minmax(max-content, 1fr)) !important;
|
|
295
|
+
}
|
|
291
296
|
.malloy-render .malloy-table .th.column-cell {
|
|
292
297
|
/* Non-pinned tables have no header background in the renderer's
|
|
293
298
|
own CSS (only pinned scrolled tables paint the pinned-header
|
|
@@ -337,56 +342,59 @@ div.malloy-render .malloy-dashboard .dashboard-row-header {
|
|
|
337
342
|
color: var(--publisher-drill-link) !important;
|
|
338
343
|
text-decoration: underline;
|
|
339
344
|
}
|
|
340
|
-
`,
|
|
341
|
-
function
|
|
342
|
-
if (typeof document > "u" || document.getElementById(
|
|
345
|
+
`, se = "publisher-malloy-renderer-overrides";
|
|
346
|
+
function Ne() {
|
|
347
|
+
if (typeof document > "u" || document.getElementById(se)) return;
|
|
343
348
|
const e = document.createElement("style");
|
|
344
|
-
e.id =
|
|
349
|
+
e.id = se, e.textContent = Be, document.head.appendChild(e);
|
|
345
350
|
}
|
|
346
|
-
function
|
|
351
|
+
function $e({
|
|
347
352
|
result: e,
|
|
348
353
|
height: r,
|
|
349
354
|
drill: t,
|
|
350
|
-
onSizeChange:
|
|
351
|
-
onSizing:
|
|
355
|
+
onSizeChange: l,
|
|
356
|
+
onSizing: o,
|
|
357
|
+
fill: a
|
|
352
358
|
}) {
|
|
353
|
-
const
|
|
354
|
-
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
}, []), y = t !== void 0,
|
|
359
|
+
const n = z(null), s = z(t);
|
|
360
|
+
s.current = t;
|
|
361
|
+
const b = be((c) => {
|
|
362
|
+
s.current?.onClick(c);
|
|
363
|
+
}, []), y = t !== void 0, k = z(!1), v = z(
|
|
358
364
|
null
|
|
359
|
-
),
|
|
365
|
+
), P = z(0), { theme: X, layers: Y, mode: J } = Se(), W = he().shape.borderRadius, Q = fe(
|
|
360
366
|
() => ({
|
|
361
|
-
radius: `${
|
|
362
|
-
padding: `${
|
|
367
|
+
radius: `${W}px`,
|
|
368
|
+
padding: `${ge}px`
|
|
363
369
|
}),
|
|
364
|
-
[
|
|
370
|
+
[W]
|
|
365
371
|
);
|
|
366
|
-
return
|
|
367
|
-
|
|
372
|
+
return ye(() => () => {
|
|
373
|
+
P.current += 1;
|
|
368
374
|
const c = v.current;
|
|
369
375
|
c?.viz.remove(), c?.node.remove(), v.current = null;
|
|
370
|
-
}, []),
|
|
371
|
-
if (!
|
|
372
|
-
|
|
373
|
-
const c =
|
|
374
|
-
let
|
|
375
|
-
const
|
|
376
|
-
let d,
|
|
377
|
-
|
|
378
|
-
let p,
|
|
379
|
-
const
|
|
380
|
-
if (
|
|
381
|
-
const
|
|
382
|
-
if (
|
|
383
|
-
const
|
|
376
|
+
}, []), pe(() => {
|
|
377
|
+
if (!n.current || !e) return;
|
|
378
|
+
Ne();
|
|
379
|
+
const c = n.current, de = P.current += 1;
|
|
380
|
+
let V = !1;
|
|
381
|
+
const q = () => !V && de === P.current;
|
|
382
|
+
let d, h, B = null, H = 0, N = null, $ = null, j = null, T = null, D = null, O = null, Z = null, ee = 0, C = null;
|
|
383
|
+
k.current = !1;
|
|
384
|
+
let p, R;
|
|
385
|
+
const K = (w) => {
|
|
386
|
+
if (V || !w.firstElementChild || U(p, R) === "container") return;
|
|
387
|
+
const _ = xe(p, R);
|
|
388
|
+
if (k.current && !_) return;
|
|
389
|
+
const F = c.hasAttribute(M);
|
|
390
|
+
F && c.removeAttribute(M);
|
|
391
|
+
const E = Ce(
|
|
384
392
|
w,
|
|
385
|
-
|
|
393
|
+
le(p)
|
|
386
394
|
);
|
|
387
|
-
|
|
388
|
-
const
|
|
389
|
-
|
|
395
|
+
F && c.setAttribute(M, ""), E > 0 && (k.current = !0, l && E !== ee && (ee = E, l(E)));
|
|
396
|
+
const u = Re(w, le(p));
|
|
397
|
+
_ && u && Z !== u && (Z = u, O?.disconnect(), O = new ResizeObserver(() => K(w)), O.observe(u));
|
|
390
398
|
};
|
|
391
399
|
return (async () => {
|
|
392
400
|
let w;
|
|
@@ -396,121 +404,122 @@ function Le({
|
|
|
396
404
|
console.error("Error parsing visualization result:", f);
|
|
397
405
|
return;
|
|
398
406
|
}
|
|
399
|
-
const
|
|
400
|
-
if (!
|
|
407
|
+
const _ = await Me(w), F = _ ? Ae([...Y, _], J) : X;
|
|
408
|
+
if (!q()) return;
|
|
401
409
|
try {
|
|
402
|
-
|
|
410
|
+
h = await Le(F, b);
|
|
403
411
|
} catch (f) {
|
|
404
412
|
console.error("Failed to create renderer:", f);
|
|
405
413
|
return;
|
|
406
414
|
}
|
|
407
|
-
if (!
|
|
408
|
-
|
|
415
|
+
if (!q()) {
|
|
416
|
+
h.remove(), h = void 0;
|
|
409
417
|
return;
|
|
410
418
|
}
|
|
411
|
-
const
|
|
412
|
-
d = document.createElement("div"), d.style.width = "100%", d.style.height = "100%",
|
|
419
|
+
const E = v.current;
|
|
420
|
+
d = document.createElement("div"), d.style.width = "100%", d.style.height = "100%", Ie(d, F, Q), c.childElementCount > 0 && (c.style.position = "relative", d.style.position = "absolute", d.style.inset = "0", d.style.visibility = "hidden"), c.appendChild(d);
|
|
413
421
|
const u = d;
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
422
|
+
T = new MutationObserver(() => {
|
|
423
|
+
D && clearTimeout(D), D = setTimeout(() => {
|
|
424
|
+
K(u), k.current && T?.disconnect();
|
|
417
425
|
}, 100);
|
|
418
|
-
}),
|
|
426
|
+
}), T.observe(d, {
|
|
419
427
|
childList: !0,
|
|
420
428
|
subtree: !0,
|
|
421
429
|
attributes: !0
|
|
422
430
|
});
|
|
423
|
-
const
|
|
424
|
-
let
|
|
425
|
-
const
|
|
426
|
-
if (!(
|
|
427
|
-
|
|
431
|
+
const ce = h;
|
|
432
|
+
let re = !1;
|
|
433
|
+
const te = () => {
|
|
434
|
+
if (!(re || !q())) {
|
|
435
|
+
re = !0, C && (clearTimeout(C), C = null), E?.viz.remove();
|
|
428
436
|
for (const f of Array.from(c.children))
|
|
429
437
|
f !== u && c.removeChild(f);
|
|
430
|
-
u.style.position = "", u.style.inset = "", u.style.visibility = "", c.style.position = "", v.current = { viz:
|
|
438
|
+
u.style.position = "", u.style.inset = "", u.style.visibility = "", c.style.position = "", v.current = { viz: ce, node: u }, K(u);
|
|
431
439
|
}
|
|
432
440
|
};
|
|
433
441
|
try {
|
|
434
|
-
|
|
442
|
+
h.setResult(w);
|
|
435
443
|
try {
|
|
436
|
-
const
|
|
437
|
-
p =
|
|
444
|
+
const x = h.getMetadata(), S = x?.getRootField();
|
|
445
|
+
p = S?.renderAs(), R = S ? x?.getPluginsForField(S.key)?.[0]?.sizingStrategy : void 0;
|
|
438
446
|
} catch {
|
|
439
|
-
p = void 0,
|
|
447
|
+
p = void 0, R = void 0;
|
|
440
448
|
}
|
|
441
|
-
|
|
442
|
-
const f =
|
|
449
|
+
o?.(U(p, R)), d.dataset.malloyRenderAs = p ?? "unknown", d.dataset.malloySizing = U(p, R), h.render(d);
|
|
450
|
+
const f = s.current;
|
|
443
451
|
try {
|
|
444
452
|
if (f) {
|
|
445
|
-
const
|
|
453
|
+
const x = Te(h, f.canDrill), S = () => {
|
|
446
454
|
try {
|
|
447
|
-
|
|
455
|
+
De(u, x);
|
|
448
456
|
} catch (i) {
|
|
449
457
|
console.warn("Drill affordance skipped:", i);
|
|
450
458
|
}
|
|
451
459
|
};
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
const
|
|
455
|
-
|
|
460
|
+
S();
|
|
461
|
+
const oe = (i) => {
|
|
462
|
+
const A = i.querySelector(".cell-content") ?? i, G = A.getBoundingClientRect();
|
|
463
|
+
A.dispatchEvent(
|
|
456
464
|
new MouseEvent("click", {
|
|
457
465
|
bubbles: !0,
|
|
458
466
|
cancelable: !0,
|
|
459
|
-
view:
|
|
460
|
-
clientX: Math.round(
|
|
461
|
-
clientY: Math.round(
|
|
467
|
+
view: A.ownerDocument.defaultView,
|
|
468
|
+
clientX: Math.round(G.left + G.width / 2),
|
|
469
|
+
clientY: Math.round(G.bottom)
|
|
462
470
|
})
|
|
463
471
|
);
|
|
464
|
-
},
|
|
465
|
-
|
|
472
|
+
}, ae = (i) => i.target?.closest?.(`.${g}`) ?? null, ue = (i, m) => {
|
|
473
|
+
ie(i, m)?.focus();
|
|
466
474
|
};
|
|
467
|
-
|
|
468
|
-
const
|
|
469
|
-
if (!
|
|
470
|
-
const
|
|
471
|
-
if (
|
|
472
|
-
i.preventDefault(),
|
|
475
|
+
N = (i) => {
|
|
476
|
+
const m = ae(i);
|
|
477
|
+
if (!m) return;
|
|
478
|
+
const A = i.key === "ArrowDown" ? 1 : i.key === "ArrowUp" ? -1 : i.key === "Home" ? "first" : i.key === "End" ? "last" : void 0;
|
|
479
|
+
if (A !== void 0) {
|
|
480
|
+
i.preventDefault(), ue(m, A);
|
|
473
481
|
return;
|
|
474
482
|
}
|
|
475
|
-
i.key === "Enter" ? (i.preventDefault(),
|
|
476
|
-
}, N = (i) => {
|
|
477
|
-
if (i.key !== " ") return;
|
|
478
|
-
const b = te(i);
|
|
479
|
-
b && (i.preventDefault(), re(b));
|
|
483
|
+
i.key === "Enter" ? (i.preventDefault(), oe(m)) : i.key === " " && i.preventDefault();
|
|
480
484
|
}, $ = (i) => {
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
+
if (i.key !== " ") return;
|
|
486
|
+
const m = ae(i);
|
|
487
|
+
m && (i.preventDefault(), oe(m));
|
|
488
|
+
}, j = (i) => {
|
|
489
|
+
const m = i.target?.closest?.(`.${g}`);
|
|
490
|
+
m && ie(m, 0);
|
|
491
|
+
}, u.addEventListener("keydown", N), u.addEventListener("keyup", $), u.addEventListener("focusin", j), x.size > 0 && typeof MutationObserver < "u" && (B = new MutationObserver(() => {
|
|
492
|
+
cancelAnimationFrame(H), H = requestAnimationFrame(S);
|
|
485
493
|
}), B.observe(u, {
|
|
486
494
|
childList: !0,
|
|
487
495
|
subtree: !0
|
|
488
496
|
}));
|
|
489
497
|
}
|
|
490
|
-
} catch (
|
|
491
|
-
console.warn("Drill affordance skipped:",
|
|
498
|
+
} catch (x) {
|
|
499
|
+
console.warn("Drill affordance skipped:", x);
|
|
492
500
|
}
|
|
493
|
-
|
|
501
|
+
h.onReady(te), C = setTimeout(te, 1e4);
|
|
494
502
|
} catch (f) {
|
|
495
|
-
console.error("Error rendering visualization:", f),
|
|
503
|
+
console.error("Error rendering visualization:", f), T?.disconnect(), O?.disconnect(), B?.disconnect(), h.remove(), h = void 0, u.parentNode === c && c.removeChild(u);
|
|
496
504
|
}
|
|
497
505
|
})(), () => {
|
|
498
|
-
|
|
506
|
+
V = !0, T?.disconnect(), O?.disconnect(), D && clearTimeout(D), C && clearTimeout(C), d && v.current?.node !== d && (N && d.removeEventListener("keydown", N), $ && d.removeEventListener("keyup", $), j && d.removeEventListener("focusin", j), B?.disconnect(), cancelAnimationFrame(H), h?.remove(), d.parentNode === c && c.removeChild(d), c.style.position = "");
|
|
499
507
|
};
|
|
500
508
|
}, [
|
|
501
509
|
e,
|
|
502
|
-
|
|
510
|
+
b,
|
|
503
511
|
y,
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
G,
|
|
507
|
-
U,
|
|
512
|
+
l,
|
|
513
|
+
o,
|
|
508
514
|
X,
|
|
509
|
-
|
|
510
|
-
|
|
515
|
+
Y,
|
|
516
|
+
J,
|
|
517
|
+
Q
|
|
518
|
+
]), /* @__PURE__ */ L(
|
|
511
519
|
"div",
|
|
512
520
|
{
|
|
513
|
-
ref:
|
|
521
|
+
ref: n,
|
|
522
|
+
...a ? { [M]: "" } : {},
|
|
514
523
|
style: {
|
|
515
524
|
width: "100%",
|
|
516
525
|
height: r ? `${r}px` : "400px"
|
|
@@ -518,9 +527,9 @@ function Le({
|
|
|
518
527
|
}
|
|
519
528
|
);
|
|
520
529
|
}
|
|
521
|
-
function
|
|
522
|
-
return typeof window > "u" ? /* @__PURE__ */
|
|
523
|
-
|
|
530
|
+
function je(e) {
|
|
531
|
+
return typeof window > "u" ? /* @__PURE__ */ L(
|
|
532
|
+
ne,
|
|
524
533
|
{
|
|
525
534
|
sx: {
|
|
526
535
|
width: "100%",
|
|
@@ -532,11 +541,11 @@ function Be(e) {
|
|
|
532
541
|
},
|
|
533
542
|
children: "Loading..."
|
|
534
543
|
}
|
|
535
|
-
) : /* @__PURE__ */
|
|
536
|
-
|
|
544
|
+
) : /* @__PURE__ */ L(
|
|
545
|
+
me,
|
|
537
546
|
{
|
|
538
|
-
fallback: /* @__PURE__ */
|
|
539
|
-
|
|
547
|
+
fallback: /* @__PURE__ */ L(
|
|
548
|
+
ne,
|
|
540
549
|
{
|
|
541
550
|
sx: {
|
|
542
551
|
width: "100%",
|
|
@@ -549,21 +558,21 @@ function Be(e) {
|
|
|
549
558
|
children: "Loading visualization..."
|
|
550
559
|
}
|
|
551
560
|
),
|
|
552
|
-
children: /* @__PURE__ */
|
|
561
|
+
children: /* @__PURE__ */ L($e, { ...e })
|
|
553
562
|
}
|
|
554
563
|
);
|
|
555
564
|
}
|
|
556
|
-
const
|
|
565
|
+
const Ge = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
557
566
|
__proto__: null,
|
|
558
|
-
default:
|
|
567
|
+
default: je
|
|
559
568
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
560
569
|
export {
|
|
561
570
|
g as D,
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
571
|
+
je as R,
|
|
572
|
+
Fe as a,
|
|
573
|
+
_e as b,
|
|
574
|
+
Ge as c,
|
|
575
|
+
Te as d,
|
|
576
|
+
De as m,
|
|
577
|
+
ze as r
|
|
569
578
|
};
|