@malloy-publisher/sdk 0.2.7 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +180 -204
- package/dist/DocumentStorageProvider-BeBD0uWc.cjs.js +134 -0
- package/dist/DocumentStorageProvider-tGvodI8f.es.js +24268 -0
- package/dist/RenderedResult-CPi6uQWq.cjs.js +115 -0
- package/dist/RenderedResult-mDE-4u8S.es.js +542 -0
- package/dist/{ServerProvider-xXW1HJOJ.cjs.js → ServerProvider-CH71GsoL.cjs.js} +1 -1
- package/dist/{ServerProvider-ksC5Su_x.es.js → ServerProvider-X2Ma0HRs.es.js} +324 -359
- package/dist/builder/index.cjs.js +105 -0
- package/dist/builder/index.d.ts +2 -0
- package/dist/builder/index.es.js +9561 -0
- package/dist/builder-entry.d.ts +8 -0
- package/dist/client/api.d.ts +13 -1
- package/dist/client/index.cjs.js +1 -1
- package/dist/client/index.es.js +1 -1
- package/dist/components/ApiErrorDisplay.d.ts +1 -2
- package/dist/components/Dashboard/Dashboard.d.ts +23 -16
- package/dist/components/Dashboard/DashboardGrid.d.ts +67 -0
- package/dist/components/Dashboard/DashboardTile.d.ts +6 -1
- package/dist/components/Dashboard/ExploreDialog.d.ts +18 -0
- package/dist/components/Dashboard/RowsDialog.d.ts +47 -0
- package/dist/components/Dashboard/TileCard.d.ts +44 -0
- package/dist/components/Dashboard/index.d.ts +2 -0
- package/dist/components/Dashboard/promoteMeasureRow.d.ts +40 -0
- package/dist/components/Dashboard/telemetry.d.ts +43 -0
- package/dist/components/DashboardBuilder/AddTileDialog.d.ts +35 -0
- package/dist/components/DashboardBuilder/BuilderToolbar.d.ts +29 -0
- package/dist/components/DashboardBuilder/DashboardBuilder.d.ts +112 -0
- package/dist/components/DashboardBuilder/DashboardEditor.d.ts +32 -0
- package/dist/components/DashboardBuilder/DiffDialog.d.ts +15 -0
- package/dist/components/DashboardBuilder/DrillDialog.d.ts +15 -0
- package/dist/components/DashboardBuilder/FilterDialog.d.ts +54 -0
- package/dist/components/DashboardBuilder/FilterStrip.d.ts +17 -0
- package/dist/components/DashboardBuilder/SettingsPopover.d.ts +20 -0
- package/dist/components/DashboardBuilder/TileFrame.d.ts +42 -0
- package/dist/components/DashboardBuilder/TileMenu.d.ts +24 -0
- package/dist/components/DashboardBuilder/catalog.d.ts +62 -0
- package/dist/components/DashboardBuilder/controls.d.ts +157 -0
- package/dist/components/DashboardBuilder/diff.d.ts +35 -0
- package/dist/components/DashboardBuilder/document.d.ts +218 -0
- package/dist/components/DashboardBuilder/layout.d.ts +71 -0
- package/dist/components/DashboardBuilder/malloyText.d.ts +45 -0
- package/dist/components/DashboardBuilder/preview.d.ts +60 -0
- package/dist/components/DashboardBuilder/readDocument.d.ts +106 -0
- package/dist/components/DashboardBuilder/sortable.d.ts +51 -0
- package/dist/components/DashboardBuilder/spliceDocument.d.ts +44 -0
- package/dist/components/DashboardBuilder/testing/fixtures.d.ts +10 -0
- package/dist/components/DashboardBuilder/useBuilderShortcuts.d.ts +22 -0
- package/dist/components/DashboardBuilder/useDashboardEditor.d.ts +63 -0
- package/dist/components/DashboardBuilder/useDraft.d.ts +13 -0
- package/dist/components/DashboardBuilder/useFilterForm.d.ts +65 -0
- package/dist/components/DashboardBuilder/useTileReorder.d.ts +22 -0
- package/dist/components/DashboardBuilder/useTileResize.d.ts +29 -0
- package/dist/components/DocumentStorage/BrowserDocumentStorage.d.ts +14 -0
- package/dist/components/DocumentStorage/DocumentStorage.d.ts +58 -0
- package/dist/components/DocumentStorage/DocumentStorageProvider.d.ts +25 -0
- package/dist/components/DocumentStorage/index.d.ts +3 -0
- package/dist/components/FloatingIconButton.d.ts +16 -0
- package/dist/components/Model/index.d.ts +0 -1
- package/dist/components/Prose.d.ts +46 -0
- package/dist/components/RenderedResult/RenderedResult.d.ts +12 -0
- package/dist/components/RenderedResult/ResultContainer.d.ts +7 -1
- package/dist/components/RenderedResult/ResultPanel.d.ts +30 -0
- package/dist/components/RenderedResult/index.d.ts +2 -0
- package/dist/components/RenderedResult/resultSizing.d.ts +183 -0
- package/dist/components/drill/index.d.ts +2 -1
- package/dist/components/drill/resolveDrill.d.ts +22 -0
- package/dist/components/drill/useDrill.d.ts +11 -2
- package/dist/components/drill/useDrillSelf.d.ts +46 -0
- package/dist/components/given/filterValue.d.ts +63 -0
- package/dist/components/given/index.d.ts +1 -0
- package/dist/components/given/useGivenUrlParams.d.ts +39 -0
- package/dist/components/index.d.ts +3 -3
- package/dist/components/styles.d.ts +3 -7
- package/dist/core-8NVBCLZh.cjs.js +148 -0
- package/dist/{core-BY7vB5gN.es.js → core-B8oMW4sm.es.js} +3540 -2335
- package/dist/hooks/index.d.ts +3 -1
- package/dist/hooks/useDocumentControls.d.ts +70 -0
- package/dist/hooks/useQueryResult.d.ts +40 -0
- package/dist/hooks/useSuggestOptions.d.ts +28 -12
- package/dist/index.cjs.js +34 -1
- package/dist/index.es.js +21487 -79
- package/dist/sdk.css +1 -1
- package/dist/styles.css +0 -1
- package/dist/utils/malloyLiteral.d.ts +11 -0
- package/package.json +25 -14
- package/src/builder-entry.ts +55 -0
- package/src/components/ApiErrorDisplay.tsx +1 -1
- package/src/components/Connections/EditConnectionDialog.tsx +96 -86
- package/src/components/Dashboard/Dashboard.spec.tsx +7 -10
- package/src/components/Dashboard/Dashboard.tsx +184 -229
- package/src/components/Dashboard/DashboardGrid.tsx +124 -0
- package/src/components/Dashboard/DashboardTile.spec.tsx +30 -6
- package/src/components/Dashboard/DashboardTile.tsx +67 -101
- package/src/components/Dashboard/ExploreDialog.tsx +84 -0
- package/src/components/Dashboard/RowsDialog.spec.ts +42 -0
- package/src/components/Dashboard/RowsDialog.tsx +234 -0
- package/src/components/Dashboard/TileCard.tsx +120 -0
- package/src/components/Dashboard/index.ts +2 -0
- package/src/components/Dashboard/promoteMeasureRow.spec.ts +207 -0
- package/src/components/Dashboard/promoteMeasureRow.ts +160 -0
- package/src/components/Dashboard/telemetry.ts +44 -0
- package/src/components/Dashboard/tileGridColumn.spec.ts +1 -1
- package/src/components/DashboardBuilder/AddTileDialog.tsx +249 -0
- package/src/components/DashboardBuilder/BuilderToolbar.tsx +270 -0
- package/src/components/DashboardBuilder/DashboardBuilder.spec.tsx +858 -0
- package/src/components/DashboardBuilder/DashboardBuilder.tsx +653 -0
- package/src/components/DashboardBuilder/DashboardEditor.spec.tsx +211 -0
- package/src/components/DashboardBuilder/DashboardEditor.tsx +493 -0
- package/src/components/DashboardBuilder/DiffDialog.tsx +129 -0
- package/src/components/DashboardBuilder/DrillDialog.tsx +281 -0
- package/src/components/DashboardBuilder/FilterDialog.tsx +581 -0
- package/src/components/DashboardBuilder/FilterStrip.tsx +125 -0
- package/src/components/DashboardBuilder/SettingsPopover.tsx +168 -0
- package/src/components/DashboardBuilder/TileFrame.tsx +380 -0
- package/src/components/DashboardBuilder/TileMenu.tsx +188 -0
- package/src/components/DashboardBuilder/catalog.spec.ts +215 -0
- package/src/components/DashboardBuilder/catalog.ts +225 -0
- package/src/components/DashboardBuilder/controls.spec.ts +243 -0
- package/src/components/DashboardBuilder/controls.ts +398 -0
- package/src/components/DashboardBuilder/diff.spec.ts +44 -0
- package/src/components/DashboardBuilder/diff.ts +93 -0
- package/src/components/DashboardBuilder/document.ts +209 -0
- package/src/components/DashboardBuilder/keepRowStructure.spec.ts +84 -0
- package/src/components/DashboardBuilder/layout.ts +143 -0
- package/src/components/DashboardBuilder/malloyText.spec.ts +84 -0
- package/src/components/DashboardBuilder/malloyText.ts +151 -0
- package/src/components/DashboardBuilder/moveIntoGap.spec.ts +90 -0
- package/src/components/DashboardBuilder/preview.spec.ts +149 -0
- package/src/components/DashboardBuilder/preview.ts +172 -0
- package/src/components/DashboardBuilder/readDocument.spec.ts +375 -0
- package/src/components/DashboardBuilder/readDocument.ts +467 -0
- package/src/components/DashboardBuilder/sortable.tsx +151 -0
- package/src/components/DashboardBuilder/spliceDocument.spec.ts +1108 -0
- package/src/components/DashboardBuilder/spliceDocument.ts +1098 -0
- package/src/components/DashboardBuilder/testing/fixtures.ts +48 -0
- package/src/components/DashboardBuilder/useBuilderShortcuts.ts +88 -0
- package/src/components/DashboardBuilder/useDashboardEditor.spec.ts +255 -0
- package/src/components/DashboardBuilder/useDashboardEditor.ts +193 -0
- package/src/components/DashboardBuilder/useDraft.ts +43 -0
- package/src/components/DashboardBuilder/useFilterForm.spec.tsx +144 -0
- package/src/components/DashboardBuilder/useFilterForm.ts +352 -0
- package/src/components/DashboardBuilder/useTileReorder.spec.tsx +97 -0
- package/src/components/DashboardBuilder/useTileReorder.ts +115 -0
- package/src/components/DashboardBuilder/useTileResize.spec.tsx +121 -0
- package/src/components/DashboardBuilder/useTileResize.ts +110 -0
- package/src/components/DashboardBuilder/withGaps.spec.ts +96 -0
- package/src/components/DocumentStorage/BrowserDocumentStorage.spec.ts +81 -0
- package/src/components/DocumentStorage/BrowserDocumentStorage.ts +105 -0
- package/src/components/DocumentStorage/DocumentStorage.ts +73 -0
- package/src/components/DocumentStorage/DocumentStorageProvider.tsx +58 -0
- package/src/components/DocumentStorage/index.ts +16 -0
- package/src/components/Environment/About.tsx +4 -36
- package/src/components/FloatingIconButton.tsx +41 -0
- package/src/components/Model/Model.tsx +6 -23
- package/src/components/Model/ModelCell.tsx +34 -72
- package/src/components/Model/index.ts +0 -1
- package/src/components/Notebook/Notebook.tsx +27 -156
- package/src/components/Notebook/NotebookCell.tsx +37 -191
- package/src/components/Prose.spec.tsx +85 -0
- package/src/components/Prose.tsx +179 -0
- package/src/components/QueryResult/QueryResult.tsx +15 -43
- package/src/components/RenderedResult/RenderedResult.tsx +86 -76
- package/src/components/RenderedResult/ResultContainer.tsx +25 -36
- package/src/components/RenderedResult/ResultPanel.spec.tsx +49 -0
- package/src/components/RenderedResult/ResultPanel.tsx +73 -0
- package/src/components/RenderedResult/index.ts +16 -0
- package/src/components/RenderedResult/resultSizing.spec.ts +249 -0
- package/src/components/RenderedResult/resultSizing.ts +308 -0
- package/src/components/ResultsDialog.tsx +2 -1
- package/src/components/drill/index.ts +6 -0
- package/src/components/drill/resolveDrill.ts +22 -1
- package/src/components/drill/useDrill.spec.tsx +94 -0
- package/src/components/drill/useDrill.tsx +52 -12
- package/src/components/drill/useDrillSelf.spec.tsx +64 -0
- package/src/components/drill/useDrillSelf.ts +110 -0
- package/src/components/given/GivenInput.spec.tsx +196 -2
- package/src/components/given/GivenInput.tsx +300 -25
- package/src/components/given/GivensPanel.tsx +1 -1
- package/src/components/given/filterValue.spec.ts +112 -0
- package/src/components/given/filterValue.ts +188 -0
- package/src/components/given/index.ts +4 -0
- package/src/components/given/useGivenUrlParams.spec.tsx +74 -0
- package/src/components/given/useGivenUrlParams.ts +87 -0
- package/src/components/index.ts +11 -3
- package/src/components/styles.ts +0 -37
- package/src/hooks/index.ts +13 -1
- package/src/hooks/useDocumentControls.ts +170 -0
- package/src/hooks/useGivensState.spec.ts +158 -0
- package/src/hooks/useGivensState.ts +114 -23
- package/src/hooks/useQueryResult.ts +82 -0
- package/src/hooks/useSuggestOptions.dom.spec.ts +60 -1
- package/src/hooks/useSuggestOptions.ts +94 -51
- package/src/utils/malloyLiteral.spec.ts +43 -0
- package/src/utils/malloyLiteral.ts +76 -0
- package/vite.config.ts +5 -1
- package/dist/components/AnalyzePackageButton.d.ts +0 -6
- package/dist/components/Workbook/BrowserWorkbookStorage.d.ts +0 -9
- package/dist/components/Workbook/EditableMalloyCell.d.ts +0 -11
- package/dist/components/Workbook/ModelPicker.d.ts +0 -11
- package/dist/components/Workbook/MutableCell.d.ts +0 -17
- package/dist/components/Workbook/Workbook.d.ts +0 -7
- package/dist/components/Workbook/WorkbookList.d.ts +0 -7
- package/dist/components/Workbook/WorkbookManager.d.ts +0 -84
- package/dist/components/Workbook/WorkbookStorage.d.ts +0 -17
- package/dist/components/Workbook/WorkbookStorageProvider.d.ts +0 -12
- package/dist/components/Workbook/index.d.ts +0 -7
- package/dist/core-CWKmWEg2.cjs.js +0 -148
- package/dist/index-B0WyZAUA.es.js +0 -66412
- package/dist/index-kxVD1RjY.cjs.js +0 -356
- package/dist/markdown-editor.css +0 -341
- package/src/components/AnalyzePackageButton.tsx +0 -319
- package/src/components/Workbook/BrowserWorkbookStorage.ts +0 -64
- package/src/components/Workbook/EditableMalloyCell.tsx +0 -49
- package/src/components/Workbook/ModelPicker.tsx +0 -134
- package/src/components/Workbook/MutableCell.tsx +0 -458
- package/src/components/Workbook/Workbook.tsx +0 -501
- package/src/components/Workbook/WorkbookList.tsx +0 -110
- package/src/components/Workbook/WorkbookManager.ts +0 -214
- package/src/components/Workbook/WorkbookStorage.ts +0 -35
- package/src/components/Workbook/WorkbookStorageProvider.tsx +0 -40
- package/src/components/Workbook/index.ts +0 -10
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { DashboardBuilder } from './components/DashboardBuilder/DashboardBuilder';
|
|
2
|
+
export type { BuilderGiven, DashboardBuilderProps, } from './components/DashboardBuilder/DashboardBuilder';
|
|
3
|
+
export { DashboardEditor, type DashboardEditorProps, } from './components/DashboardBuilder/DashboardEditor';
|
|
4
|
+
export type { DashboardDocument, DashboardTile, LocalGiven, } from './components/DashboardBuilder/document';
|
|
5
|
+
export { readDashboardDocument, readFailed, type ReadResult, } from './components/DashboardBuilder/readDocument';
|
|
6
|
+
export { spliceDashboardDocument, spliceFailed, type SpliceResult, } from './components/DashboardBuilder/spliceDocument';
|
|
7
|
+
export { buildCatalog, type PackageCatalog, } from './components/DashboardBuilder/catalog';
|
|
8
|
+
export type { DashboardEvent, DashboardEventHandler, } from './components/Dashboard/telemetry';
|
package/dist/client/api.d.ts
CHANGED
|
@@ -574,7 +574,7 @@ export interface CompiledModel {
|
|
|
574
574
|
'sourceText'?: string;
|
|
575
575
|
}
|
|
576
576
|
/**
|
|
577
|
-
* Database connection configuration and metadata
|
|
577
|
+
* Database connection configuration and metadata. Credential fields are WRITE-ONLY. They are accepted on create and update and no read returns them, so this one schema describes a request body in full and a response body with its credentials omitted. Omitted rather than masked, so a client cannot round-trip a placeholder back into stored config as a real credential. An update does not have to resend a credential it could not read; a field left out keeps its stored value, a field sent replaces it, and a field sent empty clears it.
|
|
578
578
|
* @export
|
|
579
579
|
* @interface Connection
|
|
580
580
|
*/
|
|
@@ -597,6 +597,12 @@ export interface Connection {
|
|
|
597
597
|
* @memberof Connection
|
|
598
598
|
*/
|
|
599
599
|
'type'?: ConnectionTypeEnum;
|
|
600
|
+
/**
|
|
601
|
+
* Read-only. Dotted paths of the fields this connection has stored that this response does not return. In practice that is its credentials, but it is any stored field the response withholds, so a field the server does not publish appears here too. Names only, never a value. It exists because a client otherwise cannot tell a credential that is set from one that is absent, and so cannot tell whether leaving a box empty keeps something or leaves the connection without a credential. An editor should read it to label the boxes that are already filled. Ignored on write.
|
|
602
|
+
* @type {Array<string>}
|
|
603
|
+
* @memberof Connection
|
|
604
|
+
*/
|
|
605
|
+
'withheldFields'?: Array<string>;
|
|
600
606
|
/**
|
|
601
607
|
* Optional, opaque, stable fingerprint of this connection\'s data identity. It is a hash of the configuration that determines *which data* the connection reaches (its data-locating settings), and deliberately excludes credentials and other secret values, so it stays constant across credential rotation and changes only when the connection is pointed at different data. When present, it is used as this connection\'s contribution to content-addressed build identifiers so that builds re-address only when the underlying data identity actually changes; consumers should treat it as an opaque token and use the supplied value verbatim rather than deriving their own. This field is optional — when omitted, a connection identity is derived locally instead. Because the fingerprint replaces the derived digest verbatim, it must vary with anything that changes which data the connection can reach — including the impersonated identity: two environments on the same project with different impersonateServiceAccount values but the same fingerprint would share persisted-table ids.
|
|
602
608
|
* @type {string}
|
|
@@ -1491,6 +1497,12 @@ export interface GivenSuggest {
|
|
|
1491
1497
|
* @memberof GivenSuggest
|
|
1492
1498
|
*/
|
|
1493
1499
|
'dimension'?: string;
|
|
1500
|
+
/**
|
|
1501
|
+
* The givens the suggest query needs in its request to run: the ones the source it reads is scoped by (a source-level `where: … ~ $X`) or gated by (an `#(authorize)` reading `$X`), plus, for the `query` form, the named query\'s own. A client sends the current values of exactly these, so a gated source\'s options load while the option list still does not depend on the page\'s other filters. Absent when the query needs none.
|
|
1502
|
+
* @type {Array<string>}
|
|
1503
|
+
* @memberof GivenSuggest
|
|
1504
|
+
*/
|
|
1505
|
+
'givenNames'?: Array<string>;
|
|
1494
1506
|
}
|
|
1495
1507
|
/**
|
|
1496
1508
|
* One incremental source\'s `covered_through` boundary: the table it belongs to, the boundary itself, and the source definition it was measured under. Reported on the manifest entry of every incrementally refreshed source. A caller that owns the ledger stores each one and returns it verbatim in `BuildInstructions.ledger` on the next run — only the publisher derives these values. A returned entry is validated at create time: one naming a table the run does not instruct, or whose `sourceEntityId` is no longer the source\'s, is a 400. After a publish or rollback that changes the source, delete the entry (the source seeds) or set `reseed`.
|
package/dist/client/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../ServerProvider-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../ServerProvider-CH71GsoL.cjs.js");exports.AttachedDatabaseTypeEnum=e.AttachedDatabaseTypeEnum;exports.AzureConnectionAuthTypeEnum=e.AzureConnectionAuthTypeEnum;exports.CompileProblemSeverityEnum=e.CompileProblemSeverityEnum;exports.CompileRequestScopeEnum=e.CompileRequestScopeEnum;exports.CompileResultStatusEnum=e.CompileResultStatusEnum;exports.Configuration=e.Configuration;exports.ConnectionProxyTypeEnum=e.ConnectionProxyTypeEnum;exports.ConnectionStatusStatusEnum=e.ConnectionStatusStatusEnum;exports.ConnectionTypeEnum=e.ConnectionTypeEnum;exports.ConnectionsApi=e.ConnectionsApi;exports.ConnectionsApiAxiosParamCreator=e.ConnectionsApiAxiosParamCreator;exports.ConnectionsApiFactory=e.ConnectionsApiFactory;exports.ConnectionsApiFp=e.ConnectionsApiFp;exports.ConnectionsTestApi=e.ConnectionsTestApi;exports.ConnectionsTestApiAxiosParamCreator=e.ConnectionsTestApiAxiosParamCreator;exports.ConnectionsTestApiFactory=e.ConnectionsTestApiFactory;exports.ConnectionsTestApiFp=e.ConnectionsTestApiFp;exports.DashboardsApi=e.DashboardsApi;exports.DashboardsApiAxiosParamCreator=e.DashboardsApiAxiosParamCreator;exports.DashboardsApiFactory=e.DashboardsApiFactory;exports.DashboardsApiFp=e.DashboardsApiFp;exports.DataAppFitEnum=e.DataAppFitEnum;exports.DataAppsApi=e.DataAppsApi;exports.DataAppsApiAxiosParamCreator=e.DataAppsApiAxiosParamCreator;exports.DataAppsApiFactory=e.DataAppsApiFactory;exports.DataAppsApiFp=e.DataAppsApiFp;exports.DatabaseTypeEnum=e.DatabaseTypeEnum;exports.DatabasesApi=e.DatabasesApi;exports.DatabasesApiAxiosParamCreator=e.DatabasesApiAxiosParamCreator;exports.DatabasesApiFactory=e.DatabasesApiFactory;exports.DatabasesApiFp=e.DatabasesApiFp;exports.EnvironmentsApi=e.EnvironmentsApi;exports.EnvironmentsApiAxiosParamCreator=e.EnvironmentsApiAxiosParamCreator;exports.EnvironmentsApiFactory=e.EnvironmentsApiFactory;exports.EnvironmentsApiFp=e.EnvironmentsApiFp;exports.ExecuteNotebookCellBypassFiltersEnum=e.ExecuteNotebookCellBypassFiltersEnum;exports.FilterTypeEnum=e.FilterTypeEnum;exports.FreshnessFallbackEnum=e.FreshnessFallbackEnum;exports.GivenControlEnum=e.GivenControlEnum;exports.LedgerEntryStrategyEnum=e.LedgerEntryStrategyEnum;exports.LogMessageSeverityEnum=e.LogMessageSeverityEnum;exports.ManifestEntryFreshnessFallbackEnum=e.ManifestEntryFreshnessFallbackEnum;exports.ManifestEntryOriginEnum=e.ManifestEntryOriginEnum;exports.ManifestEntryRefreshEnum=e.ManifestEntryRefreshEnum;exports.MaterializationActionActionEnum=e.MaterializationActionActionEnum;exports.MaterializationStatus=e.MaterializationStatus;exports.MaterializationsApi=e.MaterializationsApi;exports.MaterializationsApiAxiosParamCreator=e.MaterializationsApiAxiosParamCreator;exports.MaterializationsApiFactory=e.MaterializationsApiFactory;exports.MaterializationsApiFp=e.MaterializationsApiFp;exports.ModelsApi=e.ModelsApi;exports.ModelsApiAxiosParamCreator=e.ModelsApiAxiosParamCreator;exports.ModelsApiFactory=e.ModelsApiFactory;exports.ModelsApiFp=e.ModelsApiFp;exports.NotebookCellResultTypeEnum=e.NotebookCellResultTypeEnum;exports.NotebookCellTypeEnum=e.NotebookCellTypeEnum;exports.NotebooksApi=e.NotebooksApi;exports.NotebooksApiAxiosParamCreator=e.NotebooksApiAxiosParamCreator;exports.NotebooksApiFactory=e.NotebooksApiFactory;exports.NotebooksApiFp=e.NotebooksApiFp;exports.PackageEmbeddingIndexStatusEnum=e.PackageEmbeddingIndexStatusEnum;exports.PackageManifestBindingStatusEnum=e.PackageManifestBindingStatusEnum;exports.PackageQueryableSourcesEnum=e.PackageQueryableSourcesEnum;exports.PackageScopeEnum=e.PackageScopeEnum;exports.PackageStorageServeBindingsInnerOriginEnum=e.PackageStorageServeBindingsInnerOriginEnum;exports.PackageWarningsInnerSeverityEnum=e.PackageWarningsInnerSeverityEnum;exports.PackagesApi=e.PackagesApi;exports.PackagesApiAxiosParamCreator=e.PackagesApiAxiosParamCreator;exports.PackagesApiFactory=e.PackagesApiFactory;exports.PackagesApiFp=e.PackagesApiFp;exports.PersistSourcePlanOriginEnum=e.PersistSourcePlanOriginEnum;exports.PostgresConnectionSslmodeEnum=e.PostgresConnectionSslmodeEnum;exports.PublisherApi=e.PublisherApi;exports.PublisherApiAxiosParamCreator=e.PublisherApiAxiosParamCreator;exports.PublisherApiFactory=e.PublisherApiFactory;exports.PublisherApiFp=e.PublisherApiFp;exports.QueryClass=e.QueryClass;exports.QueryResultQueryRowLimitSourceEnum=e.QueryResultQueryRowLimitSourceEnum;exports.QueryResultServedFromEnum=e.QueryResultServedFromEnum;exports.Realization=e.Realization;exports.RefusedSourceReasonEnum=e.RefusedSourceReasonEnum;exports.RefusedSourceTierEnum=e.RefusedSourceTierEnum;exports.RunContextTriggerEnum=e.RunContextTriggerEnum;exports.S3ConnectionProviderEnum=e.S3ConnectionProviderEnum;exports.ServerProvider=e.ServerProvider;exports.ServerStatusOperationalStateEnum=e.ServerStatusOperationalStateEnum;exports.ThemeDefaultModeEnum=e.ThemeDefaultModeEnum;exports.WatchModeApi=e.WatchModeApi;exports.WatchModeApiAxiosParamCreator=e.WatchModeApiAxiosParamCreator;exports.WatchModeApiFactory=e.WatchModeApiFactory;exports.WatchModeApiFp=e.WatchModeApiFp;exports.globalQueryClient=e.globalQueryClient;exports.useServer=e.useServer;
|
package/dist/client/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, a as i, C as o, b as n, c as t, aC as r, e as p, f as u, d as A, O as m, I as c, K as E, J as l, X as C, U as y, W as P, V as F, $ as b, Y as g, _ as d, Z as S, D as k, a3 as M, a0 as h, a2 as x, a1 as v, h as D, a7 as T, a4 as R, a6 as f, a5 as z, ab as N, a8 as Q, aa as W, a9 as B, ap as O, F as I, i as L, G as q, L as w, j, k as G, M as H, l as J, ag as K, m as U, af as V, ac as X, ae as Y, ad as Z, ak as _, ah as $, aj as aa, ai as sa, n as ea, N as ia, ao as oa, al as na, an as ta, am as ra, q as pa, p as ua, o as Aa, P as ma, r as ca, s as Ea, at as la, aq as Ca, as as ya, ar as Pa, t as Fa, v as ba, ax as ga, au as da, aw as Sa, av as ka, Q as Ma, w as ha, x as xa, R as va, z as Da, y as Ta, B as Ra, E as fa, S as za, H as Na, T as Qa, aB as Wa, ay as Ba, aA as Oa, az as Ia, g as La, u as qa } from "../ServerProvider-
|
|
1
|
+
import { A as e, a as i, C as o, b as n, c as t, aC as r, e as p, f as u, d as A, O as m, I as c, K as E, J as l, X as C, U as y, W as P, V as F, $ as b, Y as g, _ as d, Z as S, D as k, a3 as M, a0 as h, a2 as x, a1 as v, h as D, a7 as T, a4 as R, a6 as f, a5 as z, ab as N, a8 as Q, aa as W, a9 as B, ap as O, F as I, i as L, G as q, L as w, j, k as G, M as H, l as J, ag as K, m as U, af as V, ac as X, ae as Y, ad as Z, ak as _, ah as $, aj as aa, ai as sa, n as ea, N as ia, ao as oa, al as na, an as ta, am as ra, q as pa, p as ua, o as Aa, P as ma, r as ca, s as Ea, at as la, aq as Ca, as as ya, ar as Pa, t as Fa, v as ba, ax as ga, au as da, aw as Sa, av as ka, Q as Ma, w as ha, x as xa, R as va, z as Da, y as Ta, B as Ra, E as fa, S as za, H as Na, T as Qa, aB as Wa, ay as Ba, aA as Oa, az as Ia, g as La, u as qa } from "../ServerProvider-X2Ma0HRs.es.js";
|
|
2
2
|
export {
|
|
3
3
|
e as AttachedDatabaseTypeEnum,
|
|
4
4
|
i as AzureConnectionAuthTypeEnum,
|
|
@@ -5,9 +5,8 @@ export interface ApiError extends Error {
|
|
|
5
5
|
message: string;
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
|
-
interface ApiErrorDisplayProps {
|
|
8
|
+
export interface ApiErrorDisplayProps {
|
|
9
9
|
error: ApiError;
|
|
10
10
|
context?: string;
|
|
11
11
|
}
|
|
12
12
|
export declare function ApiErrorDisplay({ error, context }: ApiErrorDisplayProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { DrillNavigation } from '../drill';
|
|
2
|
+
import { DashboardEventHandler } from './telemetry';
|
|
3
|
+
export { DEFAULT_COLUMNS, tileGridColumn } from './DashboardGrid';
|
|
2
4
|
export interface DashboardProps {
|
|
3
5
|
/** `publisher://environments/{env}/packages/{pkg}`, optionally `?versionId=`. */
|
|
4
6
|
resourceUri: string;
|
|
@@ -30,25 +32,16 @@ export interface DashboardProps {
|
|
|
30
32
|
onNavigate?: (target: DrillNavigation, event?: MouseEvent) => void;
|
|
31
33
|
/**
|
|
32
34
|
* Height cap for a result panel. Left unset, each form gets the cap that
|
|
33
|
-
* suits its shape
|
|
34
|
-
*
|
|
35
|
+
* suits its shape: {@link TILE_MAX_HEIGHT} per tile for the composite form,
|
|
36
|
+
* and no cap at all for the single-query form, where the one result IS the
|
|
37
|
+
* dashboard and a cap would clip the page rather than tidy it. Set it to
|
|
38
|
+
* hold a dashboard to a fixed box, as an embedding host might.
|
|
35
39
|
*/
|
|
36
40
|
height?: number;
|
|
37
41
|
maxResultSize?: number;
|
|
42
|
+
/** The rows shown and tiles explored, for the host to log or count. */
|
|
43
|
+
onEvent?: DashboardEventHandler;
|
|
38
44
|
}
|
|
39
|
-
/**
|
|
40
|
-
* The `grid-column` one tile occupies: its `# colspan`, and a `# break` forcing
|
|
41
|
-
* it to start a fresh row.
|
|
42
|
-
*
|
|
43
|
-
* Clamped to the grid width the same way @malloydata/render clamps it, so one
|
|
44
|
-
* view laid out as a composite tile and as a `nest:` under `# dashboard` lands
|
|
45
|
-
* in the same place. A break is `1 / span N` — an explicit start line, which is
|
|
46
|
-
* what pushes the tile down to the next row; the renderer's grid does the same.
|
|
47
|
-
*/
|
|
48
|
-
export declare function tileGridColumn(tile: {
|
|
49
|
-
colspan?: number;
|
|
50
|
-
break?: boolean;
|
|
51
|
-
}, columns: number): string;
|
|
52
45
|
/**
|
|
53
46
|
* A Malloyyo-style dashboard: a control row over one or more query results,
|
|
54
47
|
* declared entirely by tags in a package's `dashboards/*.malloy`.
|
|
@@ -58,5 +51,19 @@ export declare function tileGridColumn(tile: {
|
|
|
58
51
|
* Console and an external React app render the same component and differ only
|
|
59
52
|
* in what they do with `onNavigate` and `onGivensChange`.
|
|
60
53
|
*/
|
|
61
|
-
export declare function Dashboard({ resourceUri, dashboard, givens, onGivensChange, onNavigate, height, maxResultSize, }: DashboardProps): import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
export declare function Dashboard({ resourceUri, dashboard, givens, onGivensChange, onNavigate, height, maxResultSize, onEvent, }: DashboardProps): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
/**
|
|
56
|
+
* The prose header itself, over the two fields it actually needs.
|
|
57
|
+
*
|
|
58
|
+
* Separate from {@link DashboardHeader} so the BUILDER can render the same
|
|
59
|
+
* header over a `DashboardDocument` — which carries `title` and `description`
|
|
60
|
+
* but is not a manifest. Same argument as {@link tileGridColumn}: what the
|
|
61
|
+
* builder shows a author is the thing a reader will see, and one component is
|
|
62
|
+
* what stops the two drifting. A builder that restated this markdown block
|
|
63
|
+
* would be one edit away from showing a different header than it writes.
|
|
64
|
+
*/
|
|
65
|
+
export declare function DashboardProse({ title, description, }: {
|
|
66
|
+
title: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
62
69
|
export default Dashboard;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/** Grid width when the dashboard declares no `# dashboard { columns=N }`. */
|
|
3
|
+
export declare const DEFAULT_COLUMNS = 2;
|
|
4
|
+
/**
|
|
5
|
+
* The gutter between tiles, in px.
|
|
6
|
+
*
|
|
7
|
+
* A number rather than a `gap: 2` spacing unit because the BUILDER has to do
|
|
8
|
+
* arithmetic with it: turning a dragged edge into a column count means solving
|
|
9
|
+
* for the track width, and that needs the gutter in the same units as a
|
|
10
|
+
* `getBoundingClientRect`. Exported so the value the grid paints and the value
|
|
11
|
+
* the drag solves with cannot drift apart.
|
|
12
|
+
*/
|
|
13
|
+
export declare const GRID_GAP_PX = 16;
|
|
14
|
+
/**
|
|
15
|
+
* The `grid-column` one tile occupies: its `# colspan`, and a `# break` forcing
|
|
16
|
+
* it to start a fresh row.
|
|
17
|
+
*
|
|
18
|
+
* Clamped to the grid width the same way @malloydata/render clamps it, so one
|
|
19
|
+
* view laid out as a composite tile and as a `nest:` under `# dashboard` lands
|
|
20
|
+
* in the same place. A break is `1 / span N` — an explicit start line, which is
|
|
21
|
+
* what pushes the tile down to the next row; the renderer's grid does the same.
|
|
22
|
+
*/
|
|
23
|
+
export declare function tileGridColumn(tile: {
|
|
24
|
+
colspan?: number;
|
|
25
|
+
break?: boolean;
|
|
26
|
+
}, columns: number): string;
|
|
27
|
+
/** The layout a tile carries, whatever else its own shape holds. */
|
|
28
|
+
export interface GridTile {
|
|
29
|
+
colspan?: number;
|
|
30
|
+
break?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The composite dashboard's grid: the column track, and each tile's place on
|
|
34
|
+
* it.
|
|
35
|
+
*
|
|
36
|
+
* Shared by the READER ({@link Dashboard}) and the BUILDER, which is the whole
|
|
37
|
+
* point of it being a component rather than a rule each surface applies. An
|
|
38
|
+
* author arranging a dashboard is arranging the thing a reader will open, so
|
|
39
|
+
* the two cannot be allowed to lay tiles out even slightly differently; a
|
|
40
|
+
* restated track without the grid item's own `display: grid` ends rows at
|
|
41
|
+
* ragged heights on one surface and level on the other.
|
|
42
|
+
*
|
|
43
|
+
* **Why the item is a grid and not a block.** A grid item stretches to its row,
|
|
44
|
+
* but a block CHILD of one does not — it keeps its content height. Results
|
|
45
|
+
* divide on exactly that line (see `resultSizing`): a table, a map or a
|
|
46
|
+
* `# big_value` sizes to its content, while a plotted chart fills whatever box
|
|
47
|
+
* it is handed. So a block item put a short table beside a tall chart and let
|
|
48
|
+
* the row end twice. Making the item a grid passes the row's height down to the
|
|
49
|
+
* tile, and every card in a row ends level.
|
|
50
|
+
*
|
|
51
|
+
* The tile itself is the caller's: the reader renders a `DashboardTile`, the
|
|
52
|
+
* builder wraps one in its selection outline. Anything this component rendered
|
|
53
|
+
* on their behalf would be a third opinion about what a tile looks like.
|
|
54
|
+
*/
|
|
55
|
+
export declare function DashboardGrid<T extends GridTile>({ tiles, columns, keyOf, renderTile, }: {
|
|
56
|
+
tiles: readonly T[];
|
|
57
|
+
/** Track count — `# dashboard { columns=N }`, or {@link DEFAULT_COLUMNS}. */
|
|
58
|
+
columns: number;
|
|
59
|
+
/**
|
|
60
|
+
* This tile's React key. Taken from the caller because the two surfaces
|
|
61
|
+
* identify a tile differently and both are right: the manifest's `tiles=[…]`
|
|
62
|
+
* can repeat one expression (a typo, not a request for two identical
|
|
63
|
+
* panels), so the reader keys on position as well.
|
|
64
|
+
*/
|
|
65
|
+
keyOf: (tile: T, index: number) => string;
|
|
66
|
+
renderTile: (tile: T, index: number) => ReactNode;
|
|
67
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -35,6 +35,11 @@ export interface DashboardTileProps {
|
|
|
35
35
|
maxResultSize?: number;
|
|
36
36
|
/** Cell clicks and their affordance, for the dashboard's `# drill`. */
|
|
37
37
|
drill?: DrillBinding;
|
|
38
|
+
/**
|
|
39
|
+
* Open this tile's query somewhere it can be changed. Shown as a button in
|
|
40
|
+
* the heading, on hover; absent, the heading has no button.
|
|
41
|
+
*/
|
|
42
|
+
onExplore?: () => void;
|
|
38
43
|
}
|
|
39
44
|
/**
|
|
40
45
|
* A composite tile's heading when the view it names carries no `# label`: the
|
|
@@ -54,4 +59,4 @@ export declare function tileTitle(tile: string): string;
|
|
|
54
59
|
* tile: the broken one shows its error in place and the rest of the grid still
|
|
55
60
|
* renders, rather than one failure blanking the page.
|
|
56
61
|
*/
|
|
57
|
-
export declare function DashboardTile({ environmentName, packageName, versionId, modelPath, queryName, tile, label, subtitle, borderless, givens, declaredTypes, givenNames, height, maxResultSize, drill, }: DashboardTileProps): import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
export declare function DashboardTile({ environmentName, packageName, versionId, modelPath, queryName, tile, label, subtitle, borderless, givens, declaredTypes, givenNames, height, maxResultSize, drill, onExplore, }: DashboardTileProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Explore from here": the tile's query, open in the model explorer on the
|
|
3
|
+
* tile's source, so the reader can change it rather than only look at it.
|
|
4
|
+
*
|
|
5
|
+
* The dashboard file is itself a model, so the explorer opens on that file:
|
|
6
|
+
* the tile's source is an extension declared there, and its query resolves
|
|
7
|
+
* as written. The model is fetched here rather than inside the explorer so
|
|
8
|
+
* the tile's source can be selected before it renders.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ExploreDialog({ tile, environmentName, packageName, versionId, modelPath, onClose, }: {
|
|
11
|
+
/** The tile expression to open, or undefined when closed. */
|
|
12
|
+
tile: string | undefined;
|
|
13
|
+
environmentName: string;
|
|
14
|
+
packageName: string;
|
|
15
|
+
versionId?: string;
|
|
16
|
+
modelPath: string;
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The rows behind a value: "show the rows" on a cell, as one query.
|
|
3
|
+
*
|
|
4
|
+
* A grouped value is an aggregate over rows of the tile's source, and Malloy's
|
|
5
|
+
* `drill:` names exactly those rows: `drill: <view>.<field> = <value>` applies
|
|
6
|
+
* the view's own `where:` — the tile's control bindings included — and the
|
|
7
|
+
* clicked value's, so what comes back is the rows the number was made of.
|
|
8
|
+
* Measured: `where: name = …` alone failed on a view that spelled the column
|
|
9
|
+
* `name is products.name`, because the output name is not a source field;
|
|
10
|
+
* `drill:` resolves it through the view, which is where the name lives.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ROW_LIMIT = 200;
|
|
13
|
+
export interface RowsRequest {
|
|
14
|
+
/** The source the rows are of: the tile expression's first step. */
|
|
15
|
+
source: string;
|
|
16
|
+
/** The view the value was grouped in: the expression's last step. */
|
|
17
|
+
view: string;
|
|
18
|
+
field: string;
|
|
19
|
+
rawValue: unknown;
|
|
20
|
+
label: string;
|
|
21
|
+
}
|
|
22
|
+
/** The query the dialog runs, or undefined when the value cannot be spelled. */
|
|
23
|
+
export declare function rowsQuery(request: RowsRequest): string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* `overview -> revenue_trend` → its source and view; undefined for anything
|
|
26
|
+
* else — an inline stage has no view to drill through, a refined one carries
|
|
27
|
+
* filters `drill:` would not, and a longer pipeline has no one view its value
|
|
28
|
+
* came from.
|
|
29
|
+
*/
|
|
30
|
+
export declare function stepsOf(tileExpression: string | undefined): {
|
|
31
|
+
source: string;
|
|
32
|
+
view: string;
|
|
33
|
+
} | undefined;
|
|
34
|
+
/** The source alone, for opening the explorer on it. */
|
|
35
|
+
export declare const sourceOf: (tileExpression: string | undefined) => string;
|
|
36
|
+
export declare function RowsDialog({ request, environmentName, packageName, versionId, modelPath, givens, onClose, onDone, }: {
|
|
37
|
+
request: RowsRequest | undefined;
|
|
38
|
+
environmentName: string;
|
|
39
|
+
packageName: string;
|
|
40
|
+
versionId?: string;
|
|
41
|
+
modelPath: string;
|
|
42
|
+
/** The applied control row, which the source's own `where:` may read. */
|
|
43
|
+
givens: Record<string, unknown>;
|
|
44
|
+
onClose: () => void;
|
|
45
|
+
/** The query's outcome and how long it took, once per request. */
|
|
46
|
+
onDone?: (ok: boolean, durationMs: number) => void;
|
|
47
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* The card a dashboard tile sits in, and nothing else — so the builder, which
|
|
5
|
+
* draws a stand-in tile when it has no server to run one, draws the same card
|
|
6
|
+
* the reader does rather than restating its geometry.
|
|
7
|
+
*
|
|
8
|
+
* The instance theme's border, not MUI's `divider`: the renderer card's edge is
|
|
9
|
+
* this same value, and a card that agrees with the theme everywhere except its
|
|
10
|
+
* outline still reads as a different card. Radius stays on the host's
|
|
11
|
+
* `shape.borderRadius`, which the renderer card is pointed at too. The
|
|
12
|
+
* background is `theme.tile`, the value the renderer card paints — left unset,
|
|
13
|
+
* on a theme whose page is also white the composite tiles lost the tint that
|
|
14
|
+
* separates a card from the page while the single-query form kept it.
|
|
15
|
+
*
|
|
16
|
+
* `borderless` is `# borderless` on the view: the result with no card, which
|
|
17
|
+
* the renderer honours by dropping background, border, radius and most padding
|
|
18
|
+
* on its own `.dashboard-item`. Same here, so the tag reads the same on both
|
|
19
|
+
* forms.
|
|
20
|
+
*
|
|
21
|
+
* `overflow: hidden` and `minWidth: 0` are load-bearing for RESIZING, not
|
|
22
|
+
* tidiness: this card is a grid item, and a grid item that clips gets a
|
|
23
|
+
* minimum width of zero instead of its content's, which is what lets it
|
|
24
|
+
* narrow below the chart it holds so the renderer redraws the chart to fit.
|
|
25
|
+
* See the `minWidth: 0` note in `DashboardGrid` for the rest of that chain.
|
|
26
|
+
*/
|
|
27
|
+
export declare function TileCard({ borderless, sx, children, }: {
|
|
28
|
+
borderless?: boolean;
|
|
29
|
+
sx?: SxProps<Theme>;
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* A tile's heading: its `# label`, and its `# subtitle` under it. In the
|
|
34
|
+
* instance theme's title colour and face, so a tile is titled the same
|
|
35
|
+
* whichever surface draws it.
|
|
36
|
+
*/
|
|
37
|
+
export declare function TileHeading({ title, subtitle, tooltip, action, }: {
|
|
38
|
+
title: string;
|
|
39
|
+
subtitle?: string;
|
|
40
|
+
/** What actually ran, kept reachable without being the heading. */
|
|
41
|
+
tooltip?: string;
|
|
42
|
+
/** A control on the heading's row, hard right — the tile's Explore button. */
|
|
43
|
+
action?: ReactNode;
|
|
44
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
interface ResultField {
|
|
2
|
+
kind?: string;
|
|
3
|
+
annotations?: Array<{
|
|
4
|
+
value?: string;
|
|
5
|
+
}>;
|
|
6
|
+
}
|
|
7
|
+
interface ResultShape {
|
|
8
|
+
schema?: {
|
|
9
|
+
fields?: ResultField[];
|
|
10
|
+
};
|
|
11
|
+
data?: {
|
|
12
|
+
kind?: string;
|
|
13
|
+
array_value?: unknown[];
|
|
14
|
+
};
|
|
15
|
+
annotations?: Array<{
|
|
16
|
+
value?: string;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* True when the result is one row consisting solely of measures: the shape a
|
|
21
|
+
* `view: kpis is { aggregate: … }` tile produces.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isMeasureRow(result: ResultShape): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* True when any annotation on the result names a render tag.
|
|
26
|
+
*
|
|
27
|
+
* A `# ` line is a MOTLY tag list: space-separated properties, each a bare name
|
|
28
|
+
* or `name=value`, with `{ … }` sub-properties and `.` paths. Quoted values are
|
|
29
|
+
* dropped before tokenizing so a space inside a label does not split it; the
|
|
30
|
+
* remaining tokens are compared whole, so `bar_chart` matches and `bar_charts`
|
|
31
|
+
* does not. `#(…)` and `#"` lines are documentation, never render tags.
|
|
32
|
+
*/
|
|
33
|
+
export declare function carriesRenderTag(annotations: readonly string[]): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The result with `# big_value` prepended when {@link isMeasureRow} and no render
|
|
36
|
+
* tag is already present; otherwise the input string untouched. A result that
|
|
37
|
+
* does not parse as JSON is returned as is, for the renderer to report.
|
|
38
|
+
*/
|
|
39
|
+
export declare function promoteMeasureRowToKpis(result: string): string;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a dashboard surface reports about itself, for the host to log or
|
|
3
|
+
* count: the operations that matter (open, save, export, the rows behind a
|
|
4
|
+
* value, exploring a tile), each with its outcome and how long it took.
|
|
5
|
+
*
|
|
6
|
+
* Context-free on purpose — the host that mounted the surface knows which
|
|
7
|
+
* environment, package and dashboard it is, and adds that when it logs.
|
|
8
|
+
*/
|
|
9
|
+
export type DashboardEvent = {
|
|
10
|
+
type: "dashboard.opened";
|
|
11
|
+
/** The package file, or a draft the host had saved. */
|
|
12
|
+
from: "package" | "draft";
|
|
13
|
+
tiles: number;
|
|
14
|
+
durationMs: number;
|
|
15
|
+
} | {
|
|
16
|
+
type: "dashboard.open_refused";
|
|
17
|
+
reason: string;
|
|
18
|
+
} | {
|
|
19
|
+
type: "dashboard.saved";
|
|
20
|
+
tiles: number;
|
|
21
|
+
/** Whether a tile was added or removed, which moves declarations. */
|
|
22
|
+
structural: boolean;
|
|
23
|
+
durationMs: number;
|
|
24
|
+
} | {
|
|
25
|
+
type: "dashboard.save_refused";
|
|
26
|
+
reason: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: "dashboard.exported";
|
|
29
|
+
bytes: number;
|
|
30
|
+
} | {
|
|
31
|
+
type: "dashboard.rows_shown";
|
|
32
|
+
source: string;
|
|
33
|
+
view: string;
|
|
34
|
+
field: string;
|
|
35
|
+
ok: boolean;
|
|
36
|
+
durationMs: number;
|
|
37
|
+
} | {
|
|
38
|
+
type: "dashboard.explored";
|
|
39
|
+
tile: string;
|
|
40
|
+
};
|
|
41
|
+
export type DashboardEventHandler = (event: DashboardEvent) => void;
|
|
42
|
+
/** A monotonic clock in milliseconds, for durations. */
|
|
43
|
+
export declare const now: () => number;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { PackageCatalog } from './catalog';
|
|
2
|
+
import { DashboardDocument } from './document';
|
|
3
|
+
/**
|
|
4
|
+
* What a new tile is: a view, picked from the package, on a source this file
|
|
5
|
+
* can reach.
|
|
6
|
+
*
|
|
7
|
+
* The picker is what makes a tile expression correct BY CONSTRUCTION. Every
|
|
8
|
+
* `source -> view` it offers came from the catalog, so the builder never emits
|
|
9
|
+
* a tile that does not resolve — which is why saving needs no compile step
|
|
10
|
+
* beyond the reader's own round-trip.
|
|
11
|
+
*
|
|
12
|
+
* "Can reach" is the rule the writer enforces and the reason some sources are
|
|
13
|
+
* not offered: a tile's view is declared in an extension of a model source, and
|
|
14
|
+
* that source has to be in this file's scope. The builder never adds an
|
|
15
|
+
* import, so a model source is offered only when the file already extends it,
|
|
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.
|
|
18
|
+
*/
|
|
19
|
+
export interface NewTile {
|
|
20
|
+
/** The model source the view lives on. */
|
|
21
|
+
base: string;
|
|
22
|
+
/** The view, as the catalog names it. */
|
|
23
|
+
view: string;
|
|
24
|
+
label?: string;
|
|
25
|
+
colspan: number;
|
|
26
|
+
}
|
|
27
|
+
export interface AddTileDialogProps {
|
|
28
|
+
open: boolean;
|
|
29
|
+
document: DashboardDocument;
|
|
30
|
+
catalog: PackageCatalog | undefined;
|
|
31
|
+
columns: number;
|
|
32
|
+
onClose: () => void;
|
|
33
|
+
onAdd: (tile: NewTile) => void;
|
|
34
|
+
}
|
|
35
|
+
export declare function AddTileDialog({ open, document, catalog, columns, onClose, onAdd, }: AddTileDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The edit bar across the top of the builder, in the shape every builder has
|
|
4
|
+
* settled on: that you are editing on the left, what you can do about it on
|
|
5
|
+
* the right.
|
|
6
|
+
*
|
|
7
|
+
* Sticky, so undo and save stay in reach on a long dashboard; the reader's own
|
|
8
|
+
* header (title and description) stays in the page below it rather than being
|
|
9
|
+
* repeated here.
|
|
10
|
+
*/
|
|
11
|
+
export interface BuilderToolbarProps {
|
|
12
|
+
canUndo: boolean;
|
|
13
|
+
canRedo: boolean;
|
|
14
|
+
onUndo: () => void;
|
|
15
|
+
onRedo: () => void;
|
|
16
|
+
dirty: boolean;
|
|
17
|
+
saving: boolean;
|
|
18
|
+
/** Absent when the builder has nowhere to save: no Save, no unsaved marker. */
|
|
19
|
+
onSave?: () => void;
|
|
20
|
+
/** The host's actions, beside the builder's own: Export, Done. */
|
|
21
|
+
actions?: ReactNode;
|
|
22
|
+
/** Open the add-tile picker. Absent when the host passed no catalog to pick from. */
|
|
23
|
+
onAddTile?: () => void;
|
|
24
|
+
/** Open the page's settings, anchored to the button that asked. */
|
|
25
|
+
onSettings: (anchor: HTMLElement) => void;
|
|
26
|
+
/** Quick layout: every tile this file owns to one width. */
|
|
27
|
+
onQuickLayout: (share: 1 | 2 | 3 | 4) => void;
|
|
28
|
+
}
|
|
29
|
+
export declare function BuilderToolbar({ canUndo, canRedo, onUndo, onRedo, dirty, saving, onSave, actions, onAddTile, onSettings, onQuickLayout, }: BuilderToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { DashboardEventHandler } from '../Dashboard/telemetry';
|
|
3
|
+
import { BuilderGiven } from './controls';
|
|
4
|
+
import { PackageCatalog } from './catalog';
|
|
5
|
+
import { DashboardDocument, DashboardTile } from './document';
|
|
6
|
+
export type { BuilderGiven } from './controls';
|
|
7
|
+
/**
|
|
8
|
+
* The dashboard builder's editing surface.
|
|
9
|
+
*
|
|
10
|
+
* Lays the tiles out on the SAME grid the dashboard renders on — literally the
|
|
11
|
+
* same component, `DashboardGrid`, rather than a grid restated here to match.
|
|
12
|
+
* What you arrange is what a reader will see, and the two cannot drift.
|
|
13
|
+
*
|
|
14
|
+
* The TILE ITSELF is the caller's business, through `renderTile`. A tile's
|
|
15
|
+
* result comes from running a query, and where that query runs differs between
|
|
16
|
+
* a saved package dashboard and an unsaved draft; keeping it out here means the
|
|
17
|
+
* editing surface can be mounted, tested and reviewed without a server.
|
|
18
|
+
*
|
|
19
|
+
* `renderTile` replaces the tile rather than filling it, because `DashboardTile`
|
|
20
|
+
* draws its own card AND its own heading. Nesting one inside a card of ours
|
|
21
|
+
* would show a card in a card under two titles — which is precisely not what a
|
|
22
|
+
* 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, a handle at the
|
|
24
|
+
* edge.
|
|
25
|
+
*
|
|
26
|
+
* **Everything here is on the thing it changes.** Drag a tile's right edge to
|
|
27
|
+
* set its width, and the tile itself to reorder — into the empty end of a row
|
|
28
|
+
* to change which row it is in. The tile's own menu holds its title and
|
|
29
|
+
* subtitle. FILTERS are configured in exactly one place, the strip under the
|
|
30
|
+
* header: each chip opens the tiles-to-update window for that control,
|
|
31
|
+
* which is where a tile is bound or unbound, and "Add filter" declares a new
|
|
32
|
+
* one in this file — the convention {@link LocalGiven} describes — or binds one
|
|
33
|
+
* the model offers. Nothing about filters is on the tiles themselves: a second
|
|
34
|
+
* place to edit the same binding is a second place for it to be wrong.
|
|
35
|
+
*
|
|
36
|
+
* Tiles are added from the package's catalog and removed from their menu; a
|
|
37
|
+
* save that adds or removes one shows the file's diff first, because those
|
|
38
|
+
* moves relocate declarations and the comments beside them.
|
|
39
|
+
*/
|
|
40
|
+
export interface DashboardBuilderProps {
|
|
41
|
+
/** The file being edited. */
|
|
42
|
+
source: string;
|
|
43
|
+
/** The document that file produced. */
|
|
44
|
+
document: DashboardDocument;
|
|
45
|
+
/** Persist the patched file. Left out, the builder edits without saving. */
|
|
46
|
+
onSave?: (source: string) => Promise<void> | void;
|
|
47
|
+
/**
|
|
48
|
+
* The document as it stands, on every edit — including the first render.
|
|
49
|
+
*
|
|
50
|
+
* For the host's LIVE VIEW. A tile's result and the control row are the
|
|
51
|
+
* host's to render (`renderTile`, `controls`), and both have to follow the
|
|
52
|
+
* document rather than the saved file, or an edit looks like it did
|
|
53
|
+
* nothing: unbinding a tile left it filtering, removing a control left it
|
|
54
|
+
* in the row. `preview.ts` turns the document handed here into what a reader
|
|
55
|
+
* would see.
|
|
56
|
+
*/
|
|
57
|
+
onChange?: (document: DashboardDocument) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Renders a tile, card and heading included — this is where a real
|
|
60
|
+
* `DashboardTile` goes. Without it, tiles show what they will run.
|
|
61
|
+
*/
|
|
62
|
+
renderTile?: (tile: DashboardTile) => ReactNode;
|
|
63
|
+
/**
|
|
64
|
+
* The control row, in the slot the reader puts it — this is where a real
|
|
65
|
+
* `GivensPanel` goes.
|
|
66
|
+
*
|
|
67
|
+
* A seam for the same reason as `renderTile`, and not an oversight: a
|
|
68
|
+
* control's SPEC (its type, its control tag, its suggestions) is resolved by
|
|
69
|
+
* the server across the model and everything it imports, and a
|
|
70
|
+
* `DashboardDocument` holds only what this one file declares. The storefront
|
|
71
|
+
* dashboard is the ordinary case — it imports every given from
|
|
72
|
+
* `../givens.malloy` — so a bar built from the document alone would come up
|
|
73
|
+
* empty and claim the dashboard has no filters. Better to let a caller that
|
|
74
|
+
* has the manifest hand over the real one.
|
|
75
|
+
*
|
|
76
|
+
* It matters to LAYOUT, not just to fidelity: the bar takes vertical space
|
|
77
|
+
* above the grid, so an author arranging tiles without it is arranging
|
|
78
|
+
* against a page the reader never sees.
|
|
79
|
+
*/
|
|
80
|
+
controls?: ReactNode;
|
|
81
|
+
/**
|
|
82
|
+
* Givens a tile can be bound to, for the palette above the grid.
|
|
83
|
+
*
|
|
84
|
+
* A prop for the same reason as `controls`: which givens exist is resolved
|
|
85
|
+
* by the server across the model and its imports, and a `DashboardDocument`
|
|
86
|
+
* knows only what its own file declares.
|
|
87
|
+
*/
|
|
88
|
+
givens?: BuilderGiven[];
|
|
89
|
+
/**
|
|
90
|
+
* What the package offers, for the filter window to SEARCH a field rather
|
|
91
|
+
* than take one on trust: the dimensions of the source the tiles read are
|
|
92
|
+
* offered, an unknown name is marked where it stands, and a binding to a
|
|
93
|
+
* field the source does not have cannot be applied. Absent, any name is
|
|
94
|
+
* accepted — a binding to a missing field then fails at package load, which
|
|
95
|
+
* is the worst place for it.
|
|
96
|
+
*/
|
|
97
|
+
catalog?: PackageCatalog;
|
|
98
|
+
/**
|
|
99
|
+
* The other dashboards in the package, by slug — where a clicked cell can
|
|
100
|
+
* go. Absent, a drill can only filter this dashboard.
|
|
101
|
+
*/
|
|
102
|
+
dashboards?: string[];
|
|
103
|
+
/** Saves and refusals, for the host to log; see `DashboardEvent`. */
|
|
104
|
+
onEvent?: DashboardEventHandler;
|
|
105
|
+
/**
|
|
106
|
+
* The host's own actions for the edit bar — Export, Done — rendered beside
|
|
107
|
+
* undo, redo and save. The builder owns the edits; where the file goes
|
|
108
|
+
* afterwards is the host's, so its buttons sit in the host's slot.
|
|
109
|
+
*/
|
|
110
|
+
toolbar?: ReactNode;
|
|
111
|
+
}
|
|
112
|
+
export declare function DashboardBuilder({ source, document, onSave, onChange, renderTile, controls, givens, catalog, toolbar, dashboards, onEvent, }: DashboardBuilderProps): import("react/jsx-runtime").JSX.Element;
|