@malloy-publisher/sdk 0.12.1 → 0.12.2

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.
Files changed (208) hide show
  1. package/README.md +79 -6
  2. package/dist/{RenderedResult-DrNhQ2_9.cjs.js → RenderedResult-Cgw4iqev.cjs.js} +1 -1
  3. package/dist/{RenderedResult-AyM-RQaA.es.js → RenderedResult-DEjFM1DL.es.js} +2 -2
  4. package/dist/ServerProvider-BRQl_cBo.cjs.js +1 -0
  5. package/dist/{ServerProvider-a9Ki0QXO.es.js → ServerProvider-RnliA2Ao.es.js} +577 -555
  6. package/dist/builder/index.cjs.js +1 -1
  7. package/dist/builder/index.es.js +3 -3
  8. package/dist/client/api.d.ts +10 -1
  9. package/dist/client/index.cjs.js +1 -1
  10. package/dist/client/index.es.js +28 -27
  11. package/dist/components/Model/ExplorerPage.d.ts +9 -0
  12. package/dist/components/Model/Model.d.ts +27 -11
  13. package/dist/components/ModelViewer/AccessChips.d.ts +34 -0
  14. package/dist/components/ModelViewer/EmptyRow.d.ts +23 -0
  15. package/dist/components/ModelViewer/Facts.d.ts +15 -0
  16. package/dist/components/ModelViewer/FieldGroup.d.ts +31 -0
  17. package/dist/components/ModelViewer/FieldRow.d.ts +69 -0
  18. package/dist/components/ModelViewer/GivenFacts.d.ts +21 -0
  19. package/dist/components/ModelViewer/HeaderBar.d.ts +75 -0
  20. package/dist/components/ModelViewer/InlineDoc.d.ts +13 -0
  21. package/dist/components/ModelViewer/ModelGivensSection.d.ts +32 -0
  22. package/dist/components/ModelViewer/ModelSection.d.ts +21 -0
  23. package/dist/components/ModelViewer/ModelViewer.d.ts +91 -0
  24. package/dist/components/ModelViewer/QueriesGroup.d.ts +15 -0
  25. package/dist/components/ModelViewer/RowGlyph.d.ts +27 -0
  26. package/dist/components/ModelViewer/RunResult.d.ts +46 -0
  27. package/dist/components/ModelViewer/SampleValues.d.ts +20 -0
  28. package/dist/components/ModelViewer/SchemaJoin.d.ts +51 -0
  29. package/dist/components/ModelViewer/SchemaView.d.ts +52 -0
  30. package/dist/components/ModelViewer/SegmentIcons.d.ts +70 -0
  31. package/dist/components/ModelViewer/SourcesDropdown.d.ts +53 -0
  32. package/dist/components/ModelViewer/SourcesNav.d.ts +25 -0
  33. package/dist/components/ModelViewer/StatusPill.d.ts +56 -0
  34. package/dist/components/ModelViewer/ValueChip.d.ts +17 -0
  35. package/dist/components/ModelViewer/ViewRow.d.ts +36 -0
  36. package/dist/components/ModelViewer/clickableBox.d.ts +29 -0
  37. package/dist/components/ModelViewer/codeDisplay.d.ts +44 -0
  38. package/dist/components/ModelViewer/docAnnotations.d.ts +90 -0
  39. package/dist/components/ModelViewer/explorerModel.d.ts +12 -0
  40. package/dist/components/ModelViewer/extensions.d.ts +94 -0
  41. package/dist/components/ModelViewer/fieldCode.d.ts +74 -0
  42. package/dist/components/ModelViewer/fieldEntities.d.ts +45 -0
  43. package/dist/components/ModelViewer/fieldExpansion.d.ts +41 -0
  44. package/dist/components/ModelViewer/givenUsage.d.ts +71 -0
  45. package/dist/components/ModelViewer/headerCard.d.ts +31 -0
  46. package/dist/components/ModelViewer/httpStatus.d.ts +4 -0
  47. package/dist/components/ModelViewer/icons.d.ts +31 -0
  48. package/dist/components/ModelViewer/index.d.ts +9 -0
  49. package/dist/components/ModelViewer/joinAccess.d.ts +52 -0
  50. package/dist/components/ModelViewer/malloyRunText.d.ts +22 -0
  51. package/dist/components/ModelViewer/malloyText.d.ts +21 -0
  52. package/dist/components/ModelViewer/modelGivens.d.ts +61 -0
  53. package/dist/components/ModelViewer/modelGivensContext.d.ts +9 -0
  54. package/dist/components/ModelViewer/modelHeaderPresentation.d.ts +28 -0
  55. package/dist/components/ModelViewer/modelTextDeclarations.d.ts +32 -0
  56. package/dist/components/ModelViewer/modelTextParse.d.ts +27 -0
  57. package/dist/components/ModelViewer/namedQueryCode.d.ts +12 -0
  58. package/dist/components/ModelViewer/offSurface.d.ts +54 -0
  59. package/dist/components/ModelViewer/rowLayers.d.ts +30 -0
  60. package/dist/components/ModelViewer/runGate.d.ts +49 -0
  61. package/dist/components/ModelViewer/schemaModel.d.ts +109 -0
  62. package/dist/components/ModelViewer/sectionOpenCommand.d.ts +45 -0
  63. package/dist/components/ModelViewer/sourceAccess.d.ts +67 -0
  64. package/dist/components/ModelViewer/sourceLineage.d.ts +14 -0
  65. package/dist/components/ModelViewer/sourcePicker.d.ts +66 -0
  66. package/dist/components/ModelViewer/surface.d.ts +47 -0
  67. package/dist/components/ModelViewer/text.d.ts +6 -0
  68. package/dist/components/ModelViewer/theme.d.ts +63 -0
  69. package/dist/components/ModelViewer/tokens.d.ts +52 -0
  70. package/dist/components/ModelViewer/ui.d.ts +48 -0
  71. package/dist/components/ModelViewer/useDimensionSamples.d.ts +76 -0
  72. package/dist/components/ModelViewer/useModelSources.d.ts +92 -0
  73. package/dist/components/ModelViewer/useRunQuery.d.ts +115 -0
  74. package/dist/components/ReportBuilder/loadMalloy.d.ts +4 -0
  75. package/dist/components/ServerProvider.d.ts +15 -1
  76. package/dist/components/filter/utils.d.ts +1 -1
  77. package/dist/components/given/GivenInput.d.ts +7 -1
  78. package/dist/components/given/GivensPanel.d.ts +3 -1
  79. package/dist/components/given/filterSummary.d.ts +6 -0
  80. package/dist/components/given/useGivenUrlParams.d.ts +11 -0
  81. package/dist/components/index.d.ts +2 -1
  82. package/dist/components/modelPage.d.ts +36 -0
  83. package/dist/hooks/useDimensionalFilterRangeData.d.ts +9 -0
  84. package/dist/hooks/useSuggestOptions.d.ts +26 -2
  85. package/dist/index.cjs.js +47 -19
  86. package/dist/index.es.js +14281 -9879
  87. package/dist/useCompiledDocument-D88_2cGS.cjs.js +143 -0
  88. package/dist/{useCompiledDocument-Utj2u8CG.es.js → useCompiledDocument-Dmm6xkom.es.js} +6975 -6893
  89. package/dist/utils/filterCondition.d.ts +14 -0
  90. package/dist/utils/malloyLiteral.d.ts +20 -1
  91. package/package.json +2 -2
  92. package/src/components/Model/ExplorerPage.tsx +269 -0
  93. package/src/components/Model/Model.tsx +66 -250
  94. package/src/components/Model/ModelExplorer.spec.tsx +64 -1
  95. package/src/components/ModelViewer/AccessChips.tsx +149 -0
  96. package/src/components/ModelViewer/EmptyRow.tsx +71 -0
  97. package/src/components/ModelViewer/Facts.tsx +46 -0
  98. package/src/components/ModelViewer/FieldGroup.tsx +137 -0
  99. package/src/components/ModelViewer/FieldRow.tsx +566 -0
  100. package/src/components/ModelViewer/GivenFacts.tsx +89 -0
  101. package/src/components/ModelViewer/HeaderBar.tsx +362 -0
  102. package/src/components/ModelViewer/InlineDoc.tsx +50 -0
  103. package/src/components/ModelViewer/ModelGivensSection.tsx +142 -0
  104. package/src/components/ModelViewer/ModelSection.tsx +98 -0
  105. package/src/components/ModelViewer/ModelViewer.spec.tsx +937 -0
  106. package/src/components/ModelViewer/ModelViewer.tsx +777 -0
  107. package/src/components/ModelViewer/QueriesGroup.tsx +107 -0
  108. package/src/components/ModelViewer/RowGlyph.tsx +138 -0
  109. package/src/components/ModelViewer/RunResult.tsx +298 -0
  110. package/src/components/ModelViewer/SampleValues.tsx +97 -0
  111. package/src/components/ModelViewer/SchemaJoin.tsx +258 -0
  112. package/src/components/ModelViewer/SchemaView.tsx +222 -0
  113. package/src/components/ModelViewer/SegmentIcons.tsx +129 -0
  114. package/src/components/ModelViewer/SourcesDropdown.tsx +265 -0
  115. package/src/components/ModelViewer/SourcesNav.tsx +75 -0
  116. package/src/components/ModelViewer/StatusPill.tsx +145 -0
  117. package/src/components/ModelViewer/ValueChip.tsx +39 -0
  118. package/src/components/ModelViewer/ViewRow.tsx +274 -0
  119. package/src/components/ModelViewer/clickableBox.ts +59 -0
  120. package/src/components/ModelViewer/codeDisplay.spec.ts +176 -0
  121. package/src/components/ModelViewer/codeDisplay.ts +118 -0
  122. package/src/components/ModelViewer/docAnnotations.spec.ts +181 -0
  123. package/src/components/ModelViewer/docAnnotations.ts +244 -0
  124. package/src/components/ModelViewer/docAnnotations.typeDetail.spec.ts +114 -0
  125. package/src/components/ModelViewer/explorerModel.spec.ts +43 -0
  126. package/src/components/ModelViewer/explorerModel.ts +31 -0
  127. package/src/components/ModelViewer/extensions.tsx +112 -0
  128. package/src/components/ModelViewer/fieldCode.spec.ts +168 -0
  129. package/src/components/ModelViewer/fieldCode.ts +118 -0
  130. package/src/components/ModelViewer/fieldEntities.ts +63 -0
  131. package/src/components/ModelViewer/fieldExpansion.spec.ts +116 -0
  132. package/src/components/ModelViewer/fieldExpansion.ts +95 -0
  133. package/src/components/ModelViewer/givenUsage.spec.ts +304 -0
  134. package/src/components/ModelViewer/givenUsage.ts +325 -0
  135. package/src/components/ModelViewer/headerCard.tsx +102 -0
  136. package/src/components/ModelViewer/httpStatus.ts +15 -0
  137. package/src/components/ModelViewer/icons.tsx +67 -0
  138. package/src/components/ModelViewer/index.ts +26 -0
  139. package/src/components/ModelViewer/joinAccess.spec.ts +95 -0
  140. package/src/components/ModelViewer/joinAccess.ts +54 -0
  141. package/src/components/ModelViewer/malloyRunText.spec.ts +48 -0
  142. package/src/components/ModelViewer/malloyRunText.ts +51 -0
  143. package/src/components/ModelViewer/malloyText.spec.ts +47 -0
  144. package/src/components/ModelViewer/malloyText.ts +77 -0
  145. package/src/components/ModelViewer/modelGivens.ts +228 -0
  146. package/src/components/ModelViewer/modelGivensContext.ts +13 -0
  147. package/src/components/ModelViewer/modelHeaderPresentation.spec.ts +31 -0
  148. package/src/components/ModelViewer/modelHeaderPresentation.ts +41 -0
  149. package/src/components/ModelViewer/modelTextDeclarations.spec.ts +336 -0
  150. package/src/components/ModelViewer/modelTextDeclarations.ts +228 -0
  151. package/src/components/ModelViewer/modelTextParse.ts +112 -0
  152. package/src/components/ModelViewer/namedQueryCode.spec.ts +58 -0
  153. package/src/components/ModelViewer/namedQueryCode.ts +26 -0
  154. package/src/components/ModelViewer/offSurface.tsx +124 -0
  155. package/src/components/ModelViewer/rowLayers.tsx +104 -0
  156. package/src/components/ModelViewer/runGate.spec.ts +219 -0
  157. package/src/components/ModelViewer/runGate.ts +145 -0
  158. package/src/components/ModelViewer/schemaModel.defaultSource.spec.ts +126 -0
  159. package/src/components/ModelViewer/schemaModel.queries.spec.ts +37 -0
  160. package/src/components/ModelViewer/schemaModel.ts +300 -0
  161. package/src/components/ModelViewer/sectionOpenCommand.tsx +125 -0
  162. package/src/components/ModelViewer/sourceAccess.spec.ts +130 -0
  163. package/src/components/ModelViewer/sourceAccess.ts +194 -0
  164. package/src/components/ModelViewer/sourceLineage.spec.ts +73 -0
  165. package/src/components/ModelViewer/sourceLineage.ts +38 -0
  166. package/src/components/ModelViewer/sourcePicker.spec.ts +294 -0
  167. package/src/components/ModelViewer/sourcePicker.ts +162 -0
  168. package/src/components/ModelViewer/surface.ts +51 -0
  169. package/src/components/ModelViewer/text.tsx +33 -0
  170. package/src/components/ModelViewer/theme.spec.ts +38 -0
  171. package/src/components/ModelViewer/theme.ts +58 -0
  172. package/src/components/ModelViewer/tokens.ts +87 -0
  173. package/src/components/ModelViewer/ui.tsx +201 -0
  174. package/src/components/ModelViewer/useDimensionSamples.spec.tsx +139 -0
  175. package/src/components/ModelViewer/useDimensionSamples.ts +220 -0
  176. package/src/components/ModelViewer/useModelSources.spec.ts +110 -0
  177. package/src/components/ModelViewer/useModelSources.ts +238 -0
  178. package/src/components/ModelViewer/useRunQuery.spec.ts +50 -0
  179. package/src/components/ModelViewer/useRunQuery.ts +223 -0
  180. package/src/components/ReportBuilder/emptyStart.spec.ts +8 -0
  181. package/src/components/ReportBuilder/loadMalloy.ts +8 -1
  182. package/src/components/ServerProvider.tsx +27 -3
  183. package/src/components/filter/utils.ts +4 -60
  184. package/src/components/given/FilterButton.tsx +4 -1
  185. package/src/components/given/GivenInput.tsx +8 -0
  186. package/src/components/given/GivensPanel.tsx +6 -1
  187. package/src/components/given/filterSummary.spec.ts +31 -1
  188. package/src/components/given/filterSummary.ts +41 -19
  189. package/src/components/given/useGivenUrlParams.spec.tsx +32 -0
  190. package/src/components/given/useGivenUrlParams.ts +49 -14
  191. package/src/components/index.ts +6 -1
  192. package/src/components/legacy/malloynb/Notebook.spec.tsx +38 -4
  193. package/src/components/legacy/malloynb/NotebookCell.tsx +8 -2
  194. package/src/components/modelPage.spec.ts +79 -0
  195. package/src/components/modelPage.ts +48 -0
  196. package/src/hooks/useDimensionFilters.ts +3 -58
  197. package/src/hooks/useDimensionFiltersQuery.ts +3 -58
  198. package/src/hooks/useDimensionalFilterRangeData.spec.ts +57 -0
  199. package/src/hooks/useDimensionalFilterRangeData.ts +8 -63
  200. package/src/hooks/useSuggestOptions.dom.spec.ts +54 -1
  201. package/src/hooks/useSuggestOptions.spec.ts +71 -0
  202. package/src/hooks/useSuggestOptions.ts +102 -12
  203. package/src/utils/filterCondition.spec.ts +87 -0
  204. package/src/utils/filterCondition.ts +66 -0
  205. package/src/utils/malloyLiteral.spec.ts +53 -1
  206. package/src/utils/malloyLiteral.ts +47 -12
  207. package/dist/ServerProvider-BvD7PYZ7.cjs.js +0 -1
  208. package/dist/useCompiledDocument-CRhFBKv_.cjs.js +0 -142
@@ -0,0 +1,27 @@
1
+ import { Icon } from './icons';
2
+ /**
3
+ * Every kind of row the model page draws, one glyph each: a model's dimensions,
4
+ * measures, calculations, views (and named queries) and joins, and a table's
5
+ * columns, which take a dimension's marks.
6
+ */
7
+ export type RowGlyphKind = "dimension" | "measure" | "calculate" | "column" | "view" | "join";
8
+ /**
9
+ * A field's glyph by its DATA TYPE (text, number, date, timestamp, boolean,
10
+ * list, record), the way a BI tool marks its fields: the glyph says what kind
11
+ * of value it is, and the hue says whether it groups or aggregates. `dataType`
12
+ * is the row's own type detail ("number · integer", "date · month",
13
+ * "array<string>"); an unknown or missing type keeps the role's glyph.
14
+ */
15
+ export declare function fieldTypeGlyph(dataType: string | undefined): Icon | undefined;
16
+ /** One step over the row's 13px name. */
17
+ export declare const ROW_GLYPH_SIZE = 16;
18
+ /**
19
+ * The bare glyph that leads a model-page row: 16px, in its kind's hue (a
20
+ * field's glyph by its data type, `fieldTypeGlyph`). Decorative: the section a
21
+ * row sits in already names its kind, and the row's button names the row, so it
22
+ * is hidden from assistive tech.
23
+ */
24
+ export declare function RowGlyph({ kind, dataType, }: {
25
+ kind: RowGlyphKind;
26
+ dataType?: string;
27
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,46 @@
1
+ import { ReactNode } from 'react';
2
+ import { GivenInfo } from './modelGivens';
3
+ import { RunContext } from './useRunQuery';
4
+ /** A run's result as shown, with the given values it ran under. */
5
+ export interface ShownRun {
6
+ result: string;
7
+ /** The values it ran with, as `givensKeyFor` writes them: under the "values
8
+ * changed" banner these are not the panel's. */
9
+ givensKey: string;
10
+ }
11
+ /** What the body shows: the run's result (Session), or the Malloy definition
12
+ * (Base). The two layer segments a view card switches between. */
13
+ export type RunResultMode = "result" | "code";
14
+ /**
15
+ * The body of an open view's card (ViewRow): the result of running it, or the Malloy
16
+ * that declares it, whichever the card's Result | Code switch picks. Body only —
17
+ * the card above it carries the name and the switch.
18
+ *
19
+ * The run happens the first time the Result mode is shown, never in Code mode:
20
+ * reading a definition must not bill a query. It renders through the SDK's own
21
+ * result container, so a result here and in a report are one thing.
22
+ */
23
+ export declare function RunResult({ run, modelPath, query, sourceName, givens, givensUnknown, mode, renderCode, onShownChange, }: {
24
+ run: RunContext;
25
+ modelPath: string;
26
+ query: string;
27
+ /** The source a view belongs to, for its required-filter check; a named
28
+ * query has none. */
29
+ sourceName?: string;
30
+ /** The givens the run reads, where its source can't say (a named query the
31
+ * model gives no source); else its source's. */
32
+ givens?: ReadonlyArray<GivenInfo>;
33
+ /** With `givens`: those of them the page can't tie to the run either way
34
+ * (scanGivensOfNamedQuery). Without, its source's (`unknownGivensBySource`). */
35
+ givensUnknown?: ReadonlySet<string>;
36
+ /** Which body to show. The switching is the card's job; this renders
37
+ * whichever mode it is told. */
38
+ mode?: RunResultMode;
39
+ /** Renders the Malloy body for the `definition` mode. A function, called
40
+ * only when that body is shown, so a result-mode stage does none of the
41
+ * code-stripping work. */
42
+ renderCode?: () => ReactNode;
43
+ /** Told the result this stage is showing, including one held under the "values
44
+ * changed" banner, so a host's download exports exactly what is on screen. */
45
+ onShownChange?: (shown: ShownRun | undefined) => void;
46
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { ExplorerField } from './schemaModel';
2
+ import { SampleValuesFetcher } from './useDimensionSamples';
3
+ import { RunContext } from './useRunQuery';
4
+ /**
5
+ * A dimension's sample values: its most common values, most common first,
6
+ * fetched lazily (see useDimensionSamples). What the dimension MEANS, so its
7
+ * own card on the open row.
8
+ *
9
+ * <p>Mounts only inside an open row, so the fetch is paid for on a reader's
10
+ * click rather than while browsing.
11
+ */
12
+ export declare function SampleValues({ run, fetchSamples, modelPath, sourceName, field, generation, }: {
13
+ run: RunContext;
14
+ fetchSamples?: SampleValuesFetcher;
15
+ modelPath: string;
16
+ sourceName: string;
17
+ field: ExplorerField;
18
+ /** The host build the values come from (see useDimensionSamples). */
19
+ generation?: string;
20
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,51 @@
1
+ import { EntitiesByField } from './fieldEntities';
2
+ import { JoinLink } from './joinAccess';
3
+ import { ExplorerJoin } from './schemaModel';
4
+ import { SourceAccess } from './sourceAccess';
5
+ import { RunContext } from './useRunQuery';
6
+ interface SchemaJoinProps {
7
+ join: ExplorerJoin;
8
+ run?: RunContext;
9
+ modelPath: string;
10
+ sourceName: string;
11
+ /** Whether the joined SOURCE has a page of its own, and where. A package
12
+ * can serve a source only as a join partner (see joinAccess.ts), and the
13
+ * row must not offer a door that isn't there — those say so in words
14
+ * instead. Absent, or `unknown`, → neither arrow nor note: not yet
15
+ * established is not the same as established absent. */
16
+ link?: JoinLink;
17
+ /** The JOINED source's own fields. A joined source is the same source seen
18
+ * from another page, so its fields expand to definitions exactly as they
19
+ * do there. Absent (e.g. the target's model hasn't loaded) → the rows
20
+ * render with nothing to open rather than claiming "no
21
+ * definition". */
22
+ entitiesByName?: EntitiesByField;
23
+ entitiesLoading?: boolean;
24
+ entitiesError?: boolean;
25
+ /** The join's declaration, verbatim from a host's entities
26
+ * ("customer is customers with customer_id"), drawn in the page's code card. */
27
+ code?: string;
28
+ /** The joined source, where it declares an access rule: its Restricted or
29
+ * Row filtered pill rides on this row. */
30
+ target?: {
31
+ sourceName: string;
32
+ access: SourceAccess;
33
+ };
34
+ /** Whether the reader can change the model, so an open join to a gated
35
+ * source warns that its gate does not apply here. */
36
+ showRules?: boolean;
37
+ }
38
+ /**
39
+ * A join as a row of the page, opened and closed as every other row is (RowLine):
40
+ * its name, its field count, its doc, and at the right its relationship and the
41
+ * arrow to the joined source's own page. Open, it shows the joined source's
42
+ * fields — the same sections and rows the source's own use, one level in, framed
43
+ * as one block — with Fields | Code on its line, as an open view's Result | Code,
44
+ * and its declaration in the page's one code card (QueryCode) one click over.
45
+ *
46
+ * Opening is the default gesture (the join is part of this source). Navigating
47
+ * away to the joined source's own page is the deliberate one, so it gets a
48
+ * trailing arrow rather than being armed on the name.
49
+ */
50
+ export declare function SchemaJoin({ join, run, modelPath, sourceName, link, entitiesByName, entitiesLoading, entitiesError, code, target, showRules, }: SchemaJoinProps): import("react/jsx-runtime").JSX.Element;
51
+ export {};
@@ -0,0 +1,52 @@
1
+ import { ReactNode } from 'react';
2
+ import { EntitiesByField } from './fieldEntities';
3
+ import { JoinLink } from './joinAccess';
4
+ import { ExplorerSource } from './schemaModel';
5
+ import { SourceAccess } from './sourceAccess';
6
+ import { RunContext } from './useRunQuery';
7
+ interface SchemaViewProps {
8
+ source: ExplorerSource;
9
+ modelPath: string;
10
+ /** A host's entities for the source (per-field code and provenance), when
11
+ * it passes any. Undefined until loaded, and when there are none. */
12
+ entitiesByName?: EntitiesByField;
13
+ entitiesLoading?: boolean;
14
+ entitiesError?: boolean;
15
+ /** The model file's text, for the code of a field the entities don't carry
16
+ * (all of them, without a host's entities): see `fieldDeclarations`. */
17
+ modelText?: string;
18
+ /** Join name → whether the joined source has a page, and where. */
19
+ joinLinks?: Map<string, JoinLink>;
20
+ /** Join name → the JOINED source's own fields, so a joined source offers
21
+ * the same per-field definitions as it would on its own page. Keyed by
22
+ * join alias because that is what the rendered join is named. */
23
+ joinEntities?: Map<string, EntitiesByField>;
24
+ /** Join name → its declaration, verbatim from the host's entities. */
25
+ joinCodes?: Map<string, string>;
26
+ /** Join name → the joined source's access rules, where it declares any. */
27
+ joinAccess?: ReadonlyMap<string, {
28
+ sourceName: string;
29
+ access: SourceAccess;
30
+ }>;
31
+ /** Whether the reader can change the model (an editor sees the join's
32
+ * gate warning). */
33
+ showRules?: boolean;
34
+ /** A host's descriptions of the base table's columns (column → text), for
35
+ * the dimensions this source inherits rather than defines. */
36
+ columnDescriptions?: ReadonlyMap<string, string>;
37
+ /** Where to run this source's views against the served model. */
38
+ run?: RunContext;
39
+ /** The model's named queries, as their own section after the views: the two
40
+ * are the page's results, so they read together before the fields. */
41
+ queries?: ReactNode;
42
+ /** The givens this source reads, as the page's first section: they set every
43
+ * run below them (ModelGivensSection). */
44
+ givens?: ReactNode;
45
+ }
46
+ /**
47
+ * Single-source browse view, as always-open sections: the givens it reads, the
48
+ * views, the model's queries, the measures, calculations and dimensions, each a
49
+ * row that opens in place, then each join as an expandable row.
50
+ */
51
+ export declare function SchemaView({ source, modelPath, entitiesByName, entitiesLoading, entitiesError, modelText, joinLinks, joinEntities, joinCodes, joinAccess, showRules, columnDescriptions, run, queries, givens, }: SchemaViewProps): import("react/jsx-runtime").JSX.Element;
52
+ export {};
@@ -0,0 +1,70 @@
1
+ import { ReactNode } from 'react';
2
+ export interface SegmentIconOption<T extends string> {
3
+ value: T;
4
+ icon: ReactNode;
5
+ /** The accessible name AND the tooltip — kept equal (ux-design-guide §4). */
6
+ label: string;
7
+ /**
8
+ * Present but not selectable. For a representation this thing HAS but cannot show yet
9
+ * (or at all) — the option keeps its place so the switch does not change width as the
10
+ * data behind it arrives, which is the layout shift that omitting it causes.
11
+ */
12
+ disabled?: boolean;
13
+ /**
14
+ * Why it is disabled, as the tooltip, replacing `label`. A disabled control with no
15
+ * explanation is the failure mode this exists to avoid: the reader can see the option
16
+ * and cannot tell whether it is broken or merely not applicable here.
17
+ */
18
+ disabledReason?: string;
19
+ }
20
+ /**
21
+ * An action icon's button: a switch option's (active when pressed) and an action
22
+ * beside a switch (ActionIconButton) are one look, so a row of them reads as one set.
23
+ * The pressed one sits in a faint fill so the active layer reads at a glance; the
24
+ * rest are quiet.
25
+ */
26
+ export declare function actionIconSx(active: boolean): {
27
+ readonly p: "3px";
28
+ readonly borderRadius: 1;
29
+ readonly color: "text.secondary" | "text.primary";
30
+ readonly bgcolor: "transparent" | "action.selected";
31
+ readonly "&:hover": {
32
+ readonly bgcolor: "action.hover" | "action.selected";
33
+ readonly color: "text.primary";
34
+ };
35
+ readonly "&.Mui-disabled": {
36
+ readonly color: "text.disabled";
37
+ };
38
+ };
39
+ /**
40
+ * A "which layer of this thing am I looking at" switch, drawn as **action
41
+ * icons** rather than labelled chips — the app's one switch of record for
42
+ * choosing a representation of something already named beside it: on an
43
+ * open model row (its layers — Result, Code, Givens, Materialization — through
44
+ * RowLayerSwitch, at the row's line) and over a result. (A whole file's views are not a switch but the first items of
45
+ * its ⋯ — `viewActions`.) Any number of options, one pressed. The caller sizes
46
+ * its own glyphs — 14 on a row.
47
+ *
48
+ * <p>Why icons, not labelled chips: these switches choose a REPRESENTATION of
49
+ * something already named next to them, so words would restate the noun rather
50
+ * than add to it — "Model | Code" under a heading that says `auto_recalls`.
51
+ * The glyphs are
52
+ * the app's own (ContentTypeIcon's mark for each kind of file, the code
53
+ * brackets), so the switch reads as a lens over the named thing instead of
54
+ * chrome beside it.
55
+ *
56
+ * <p>The label is not lost, only moved: every option's `label` is BOTH its
57
+ * tooltip and its accessible name (ux-design-guide §4), so pointer users get
58
+ * the word on hover and screen readers get it unconditionally — and the option
59
+ * stays addressable by name, which is what keeps an icon switch testable. A
60
+ * disabled option keeps its place and swaps both for its `disabledReason`.
61
+ *
62
+ * <p>Group semantics: `role="group"` named by the caller, each option a
63
+ * `role="button"` with `aria-pressed`, so it is one control to a screen reader.
64
+ */
65
+ export declare function SegmentIcons<T extends string>({ value, options, onChange, "aria-label": ariaLabel, }: {
66
+ value: T;
67
+ options: ReadonlyArray<SegmentIconOption<T>>;
68
+ onChange: (value: T) => void;
69
+ "aria-label": string;
70
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,53 @@
1
+ import { ReactNode } from 'react';
2
+ import { SourceAccess } from './sourceAccess';
3
+ import { PickerDescription } from './sourcePicker';
4
+ /** A source as this dropdown needs it: what to show. */
5
+ export interface SourceNavItem {
6
+ name: string;
7
+ /** The row's description, two lines at most: the source's `#(doc)`, else a
8
+ * host's summary, marked as generated (`pickerDescription`). */
9
+ description?: PickerDescription;
10
+ /** Hold the description's line: the source has no doc, and a host's
11
+ * summaries are still being read, so one may arrive. */
12
+ descriptionPending?: boolean;
13
+ /** "16 views · 37 fields · 4 joins" (`sourceMetaLine`), from the compiled model. */
14
+ meta: string;
15
+ /** The source the model opens on, when it has the most views: a quiet token. */
16
+ mostViews?: boolean;
17
+ /** The source's access declarations. A restricted source stays listed (a
18
+ * reader learns it exists, and that it is restricted), marked beside its
19
+ * name. */
20
+ access?: SourceAccess;
21
+ /** A host's chips after the source's name (`describePickerSource`). */
22
+ status?: ReactNode;
23
+ }
24
+ /** The header's line on the package's root `index.malloy`, whose sources are the curated set,
25
+ * when they are listed in its export order. */
26
+ export declare const CURATED_SOURCES_HELP = "This package's curated sources, in the order its index.malloy exports them.";
27
+ /** The same, when the file's export order is unknown (its text withheld): it claims no order. */
28
+ export declare const PUBLIC_SOURCES_HELP = "This package's public sources.";
29
+ /**
30
+ * The sources of a model, as a dropdown hanging off the source picker pill
31
+ * beside the title ({@link import("./SourcesNav").SourcesNav}). A dropdown
32
+ * rather than a resident switcher: a model has a handful of sources and a
33
+ * reader settles into one, so the page stays in view and it closes on a click
34
+ * away.
35
+ *
36
+ * <p>Each row is what a reader needs to choose the source an analysis starts
37
+ * from: its name, its pills (the default's quiet **Most views**, access), two
38
+ * lines of description, and one line of counts, in `orderPickerSources`' order.
39
+ */
40
+ export declare function SourcesDropdown({ anchorEl, onClose, sources, currentName, onPickSource, curated, exportOrdered, }: {
41
+ /** The button this dropdown hangs from; null while closed. */
42
+ anchorEl: HTMLElement | null;
43
+ onClose: () => void;
44
+ sources: ReadonlyArray<SourceNavItem>;
45
+ currentName: string;
46
+ onPickSource: (name: string) => void;
47
+ /** The model is the package's root `index.malloy`: its header says these are the curated set. */
48
+ curated?: boolean;
49
+ /** The curated set is listed in the order its index.malloy exports it, so the header says so. */
50
+ exportOrdered?: boolean;
51
+ }): import("react/jsx-runtime").JSX.Element;
52
+ /** The quiet token on the source a model opens on, when it has the most views. */
53
+ export declare const MOST_VIEWS_LABEL = "Most views";
@@ -0,0 +1,25 @@
1
+ import { SourceNavItem } from './SourcesDropdown';
2
+ /**
3
+ * The model's source picker, beside the source's h1 ({@link import("./HeaderBar").HeaderBar})
4
+ * as the package page's version pill sits beside the package's ("v1.0.1 ▾"): the same
5
+ * `PillButton`, with the same props, so the two read as one family. Its face is the count —
6
+ * "2 sources ▾", or "4 public sources ▾" on the package's root `index.malloy`, whose sources
7
+ * are what the package publishes — and it opens the {@link SourcesDropdown} . The caller draws it only when there is something to switch to:
8
+ * more than one source. A model's named queries are rows on the page (QueriesGroup).
9
+ *
10
+ * <p>Reaching for it (pointer over, focus, a click) calls `onWarm`, which is when the
11
+ * picker's summaries are asked for (§7a).
12
+ */
13
+ export declare function SourcesNav({ sources, currentName, countLabel, onPickSource, curated, exportOrdered, onWarm, }: {
14
+ sources: ReadonlyArray<SourceNavItem>;
15
+ currentName: string;
16
+ /** The pill's face: "2 sources", "4 public sources" (`sourceCountLabel`). */
17
+ countLabel: string;
18
+ onPickSource: (name: string) => void;
19
+ /** The model is the package's root `index.malloy` (see SourcesDropdown). */
20
+ curated?: boolean;
21
+ /** Its sources are listed in the order its index.malloy exports them (see SourcesDropdown). */
22
+ exportOrdered?: boolean;
23
+ /** The reader is reaching for the picker: start what its rows will need. */
24
+ onWarm?: () => void;
25
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,56 @@
1
+ import { SxProps, Theme } from '@mui/material/styles';
2
+ import { ReactNode, ForwardRefExoticComponent, RefAttributes } from 'react';
3
+ /**
4
+ * The one status/tag pill: fully rounded, tinted, borderless (the design
5
+ * system has no outlines). Two voices, chosen by what the text IS:
6
+ *
7
+ * - `state` — a human state word ("Indexed", "In scope", "Materialized",
8
+ * "Published"): sans, sentence case supplied by the caller.
9
+ * - `token` — a machine token that exists verbatim in code or config
10
+ * (`join_one`, `line_chart`): mono, rendered exactly as written.
11
+ *
12
+ * Every status the app shows is drawn by this component — a list row's
13
+ * annotation and a page header's state alike — so a "Ready" reads the same
14
+ * wherever it sits, at ONE size: a header's state is the same pill as a row's,
15
+ * centered in the header's 28px row, so two states side by side never differ
16
+ * in scale. A host's own states (`renderSourceStatus`, `renderFieldStatus`)
17
+ * read best drawn with it too.
18
+ */
19
+ /**
20
+ * A pill reports a state, and there are four a reader acts on differently. The
21
+ * first two are the labels: `neutral` names a thing, `positive` says it is good.
22
+ *
23
+ * `warning` and `negative` are for a state that is degraded — data that is out
24
+ * of date, or something that failed outright — which the reader needs to see
25
+ * WITHOUT opening the row. Reach for them only where the state is genuinely degraded — a join
26
+ * relationship (`join_one`) is not a warning, so it takes no warm tone.
27
+ */
28
+ /** `info`: work under way, with its spinner (`busy`). */
29
+ export type StatusPillTone = "positive" | "neutral" | "warning" | "negative" | "quiet" | "info";
30
+ /**
31
+ * Where the pill sits: a row's annotation (`inline`) or a page or panel header's state
32
+ * (`header`). The same pill either way; the size names the place, not a scale.
33
+ */
34
+ export type StatusPillSize = "inline" | "header";
35
+ interface StatusPillProps {
36
+ tone?: StatusPillTone;
37
+ voice?: "state" | "token";
38
+ size?: StatusPillSize;
39
+ children: ReactNode;
40
+ sx?: SxProps<Theme>;
41
+ /**
42
+ * Accessibility passthrough to the rendered span. Declared rather than left
43
+ * to `...rest` because only one of the two was actually being type-checked:
44
+ * TypeScript skips JSX attributes containing a hyphen, so `aria-label` was
45
+ * always accepted while `role` was rejected — and an `aria-label` without a
46
+ * role is exactly the combination screen readers ignore.
47
+ */
48
+ role?: string;
49
+ "aria-label"?: string;
50
+ /** A tab stop, for a pill whose tooltip must reach a keyboard (guide §7). */
51
+ tabIndex?: number;
52
+ /** Work in flight: a spinner before the label. */
53
+ busy?: boolean;
54
+ }
55
+ export declare const StatusPill: ForwardRefExoticComponent<StatusPillProps & RefAttributes<HTMLSpanElement>>;
56
+ export {};
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * A single data VALUE — a sample from a dimension's index — as a **grey,
4
+ * outlined, gently-rounded rectangle**, deliberately unlike every other chip on
5
+ * these surfaces (the borderless, fully-rounded, semantically- or
6
+ * neutrally-toned pills the Base/Declarations/Platform layers use). A sample
7
+ * value is neither a layer status nor an annotation; it is raw data pulled from
8
+ * the warehouse, so it gets its own bordered-box vocabulary rather than reading
9
+ * as one more layer pill.
10
+ *
11
+ * <p>Mono, because a value is a literal that exists verbatim in the data (like
12
+ * the identifiers elsewhere here). On theme tokens (`action.hover` / `divider` /
13
+ * `text.primary`), no raw hex.
14
+ */
15
+ export declare function ValueChip({ children }: {
16
+ children: ReactNode;
17
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,36 @@
1
+ import { FieldCodeLookup } from './fieldCode';
2
+ import { ExplorerField } from './schemaModel';
3
+ import { RunContext } from './useRunQuery';
4
+ import { GivenInfo } from './modelGivens';
5
+ /**
6
+ * A source's view, or a model's named query, as a row of the page — the same
7
+ * line a measure or dimension has (RowLine), opened and closed the same way. Open,
8
+ * it shows its result card under the line, a notebook cell's shape: the Result |
9
+ * Code switch (and a host's actions) and the result, drawn by RunResult.
10
+ *
11
+ * <p>It runs when first opened, on its Result, and never on render: browsing a
12
+ * source costs nothing. The card mounts on first open and stays mounted while
13
+ * closed, so reopening shows the result already drawn; the result itself is the
14
+ * viewer's cache entry (runQueryOptions, kept for the page), so a remount
15
+ * (switching source and back) reopens it without a second request.
16
+ *
17
+ * <p>A row with nowhere to run (no `run`) opens on its Code, Result disabled.
18
+ */
19
+ export declare function ViewRow({ field, modelPath, sourceName, fieldCode, run, runQuery, runGivens, runGivensUnknown, }: {
20
+ field: ExplorerField;
21
+ modelPath: string;
22
+ /** The source the view belongs to; for a named query, the source it runs
23
+ * against when known (for its required filters), else "". */
24
+ sourceName: string;
25
+ /** The view's Malloy, when the source's definitions are available. */
26
+ fieldCode?: FieldCodeLookup;
27
+ /** Where to run it; absent where it can't be run. */
28
+ run?: RunContext;
29
+ /** A named query's `run:` text; a view's is built from its source and name.
30
+ * Its code is then the whole `query:` declaration, shown as written. */
31
+ runQuery?: string;
32
+ /** The givens a run reads, where its source can't say (see RunResult). */
33
+ runGivens?: ReadonlyArray<GivenInfo>;
34
+ /** Those of `runGivens` the page can't tie to the run either way. */
35
+ runGivensUnknown?: ReadonlySet<string>;
36
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,29 @@
1
+ import { KeyboardEvent, MouseEvent, SyntheticEvent } from 'react';
2
+ /**
3
+ * `role`, `tabIndex`, accessible name, and Enter/Space activation for a
4
+ * clickable `Box`. Pair with {@link focusRingSx} so the focus stop is visible.
5
+ *
6
+ * `onActivate` receives the originating event so a control that anchors a popup
7
+ * can read `currentTarget`; handlers that don't need it can ignore it.
8
+ *
9
+ * Pass `undefined` for `label` ONLY when the element's own text content names it
10
+ * — a `role="button"` falls back to its contents, so an explicit label there
11
+ * would just be a second, drift-prone copy of the text on screen. A control
12
+ * whose content is an icon, or arbitrary nodes that may not include text, needs
13
+ * the explicit label.
14
+ */
15
+ export declare function clickableBoxProps(label: string | undefined, onActivate?: (e: SyntheticEvent<HTMLElement>) => void): {
16
+ readonly onClick: (e: MouseEvent<HTMLElement>) => void;
17
+ readonly onKeyDown: (e: KeyboardEvent<HTMLElement>) => void;
18
+ readonly "aria-label"?: string;
19
+ readonly role: "button";
20
+ readonly tabIndex: 0;
21
+ };
22
+ /** Focus ring for a clickable `Box` — MUI draws none, so it needs one explicitly. */
23
+ export declare const focusRingSx: {
24
+ readonly "&:focus-visible": {
25
+ readonly outline: "2px solid";
26
+ readonly outlineColor: "primary.main";
27
+ readonly outlineOffset: "-2px";
28
+ };
29
+ };
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Drop the doc annotations from the head of a stored definition slice.
3
+ *
4
+ * The same text is the row's hover (see DocTooltip), so leaving it in the
5
+ * code block would print the description twice and bury the one thing the
6
+ * expansion exists to show — the expression — under prose. It would also keep
7
+ * the wrapper-strip below from matching, since the slice would not start with
8
+ * `name is`.
9
+ *
10
+ * Doc annotations only: `#(index)`, renderer tags and any other `#` annotation
11
+ * stay, because they are part of how the field behaves rather than a description
12
+ * of it. Both Malloy doc forms are recognized — `#(doc) …` and consecutive `#"`
13
+ * lines.
14
+ *
15
+ * The whole leading annotation run is scanned, not just its first lines: both
16
+ * orders are legal Malloy, so stopping at a `#(index)` would leave the docstring
17
+ * below it in the code block AND in the hover — the double-print this exists to
18
+ * prevent.
19
+ */
20
+ export declare function stripDocAnnotations(code: string): string;
21
+ /**
22
+ * Trim the redundant declaration wrapper off a field's stored Malloy
23
+ * definition for display — but only when the body is a BLOCK.
24
+ *
25
+ * `by_state is { … }` shows its dedented body: the braces and their level of
26
+ * indentation are pure wrapper, and `group_by:` / `aggregate:` describe
27
+ * themselves. An EXPRESSION keeps its wrapper, because stripping it throws
28
+ * away the relationship that makes it a definition — `category_grain is
29
+ * category` rendered as a lone `category` reads as a stray field reference,
30
+ * not as "this field is defined as that one".
31
+ *
32
+ * Anything that doesn't match the expected wrapper (multi-statement slices,
33
+ * renames, exotic forms) is shown verbatim rather than mangled.
34
+ */
35
+ export declare function stripDefinitionWrapper(name: string, code: string): string;
36
+ /**
37
+ * A view's whole declaration for display — `view: by_year is { … }`, keyword
38
+ * included, with its tags (`# line_chart`) above it and only the doc text dropped
39
+ * (the row prints that already). A view is read as the thing a model declares, so
40
+ * its Definition shows the declaration rather than just the block's body. The stored
41
+ * slice may start at the name (`by_year is { … }`); the keyword is put back then.
42
+ * Anything that isn't that shape is shown verbatim.
43
+ */
44
+ export declare function viewDeclaration(name: string, code: string): string;
@@ -0,0 +1,90 @@
1
+ import type * as Malloy from "@malloydata/malloy-interfaces";
2
+ /**
3
+ * Extract human-readable documentation from a list of Malloy annotations.
4
+ *
5
+ * Supports both forms a model author can use:
6
+ * - `#" markdown doc comment` lines (Malloy doc comments)
7
+ * - `#(doc) "text"` tag-style annotations
8
+ *
9
+ * Multiple matching lines are joined with newlines. Returns undefined when
10
+ * there is no documentation, so callers can `doc ?? fallback`.
11
+ */
12
+ export declare function getDocString(annotations: Malloy.Annotation[] | undefined): string | undefined;
13
+ /** Each doc annotation's text, in order — what `getDocString` joins. */
14
+ export declare function getDocParts(annotations: Malloy.Annotation[] | undefined): string[];
15
+ /**
16
+ * A model file's own doc: its `##"` and `##(doc)` lines (a model's annotations
17
+ * take the double hash), read as `getDocString` reads a source's. Other `##`
18
+ * lines (`##! experimental…`, model tags) are not prose and are left out.
19
+ */
20
+ export declare function getModelDocString(annotations: Malloy.Annotation[] | undefined): string | undefined;
21
+ /**
22
+ * A source's own doc, without what it inherited. A source that `extend`s another
23
+ * carries the base's doc annotations ahead of its own (the compiled source has no
24
+ * mark saying which are which), so a header printing all of them repeats the base
25
+ * source's description above the one written for this source. `base` is the source
26
+ * this one extends, read from the model's text (sourceLineage's `baseSourceName`);
27
+ * its whole doc, as a leading run of this one's, is what was inherited. Without a
28
+ * known base nothing is dropped: two unrelated sources can share boilerplate. A
29
+ * source with no doc of its own keeps the inherited one — it still describes it.
30
+ */
31
+ export declare function ownSourceDoc(source: {
32
+ docParts?: string[];
33
+ }, base: {
34
+ docParts?: string[];
35
+ } | undefined): string | undefined;
36
+ /**
37
+ * The non-doc annotation lines — renderer/behavior tags like `# bar_chart`,
38
+ * `# size=lg`, or `#(index)` — normalized for chip display: the `#` prefix
39
+ * (and any `#(malloy)`-style parens wrapper) stripped, whitespace trimmed.
40
+ * Doc lines (`#"`, `#(doc)`) are excluded (they're `getDocString`'s). Returns
41
+ * [] when there are none.
42
+ */
43
+ export declare function getTagLines(annotations: Malloy.Annotation[] | undefined): string[];
44
+ /**
45
+ * What a view's tag lines (getTagLines) make it, as names for its row: the chart
46
+ * type and any other bare tag (`line_chart`, `dashboard`, `percent`), each once.
47
+ * A tag's parameters (`{ y=checklist_count }`) and valued settings (`size=lg`)
48
+ * are left to the view's code, where they are read in full (except `viz=bar`, the
49
+ * chart type's other spelling, which names `bar`): on the row they
50
+ * crowded its name off the line. A removed tag (`-bar_chart`) names nothing.
51
+ *
52
+ * Parsed by Malloy's own tag parser; a line it can't parse names its first word,
53
+ * cut at any `{` or `=`.
54
+ */
55
+ export declare function tagNames(tagLines: string[]): string[];
56
+ /**
57
+ * Whether a source's annotations carry a Malloy Persistence `persist` tag
58
+ * (`#@ persist …`) — the marker that this source is served from a
59
+ * materialized table rather than computed live.
60
+ */
61
+ export declare function hasPersistTag(annotations: Malloy.Annotation[] | undefined): boolean;
62
+ /**
63
+ * Whether a measure's annotations carry a Malloy Persistence `preaggregate` tag
64
+ * (`#@ preaggregate grain="…"`) — the marker that this measure is rolled up
65
+ * into a table grouped at that grain.
66
+ *
67
+ * <p>The measure-level counterpart to {@link hasPersistTag}. Like it, this
68
+ * reports what the model DECLARES, which is true whether or not a rollup has
69
+ * been built — the built artifact is a binding, and the two are shown
70
+ * differently on purpose (see {@link import("./DeclarationPill").DeclarationPill}).
71
+ */
72
+ export declare function hasPreaggregateTag(annotations: Malloy.Annotation[] | undefined): boolean;
73
+ /**
74
+ * A field's type as a reader needs it, with the detail the kind alone drops:
75
+ * a time field's timeframe ("date · month"), a number's subtype
76
+ * ("number · integer"), an array's element type ("array<string>"), a record's
77
+ * field count, a native column's SQL type.
78
+ */
79
+ export declare function atomicTypeDetail(type: Malloy.AtomicType | undefined): string | undefined;
80
+ /** A record's fields, one per line ("name string"), for its type chip's tooltip;
81
+ * undefined for any other type. */
82
+ export declare function recordFieldsTip(type: Malloy.AtomicType | undefined): string | undefined;
83
+ /**
84
+ * A field's author-facing tags (`# label="Revenue"`, `# currency`, `# percent`,
85
+ * `# number="0.0%"`) as `getTagLines` reads them, less the persistence
86
+ * tags (`#@ preaggregate …`), which the row states as its own pill.
87
+ */
88
+ export declare function getFieldTagLines(annotations: Malloy.Annotation[] | undefined): string[];
89
+ /** Strip the "_type" suffix off an AtomicType kind ("string_type" → "string"). */
90
+ export declare function atomicTypeLabel(type: Malloy.AtomicType | undefined): string | undefined;
@@ -0,0 +1,12 @@
1
+ import type * as Malloy from "@malloydata/malloy-interfaces";
2
+ /**
3
+ * Each source's required filters, by source name, for the sources that declare
4
+ * any. Only the annotations: a required filter is declared there, and the field
5
+ * walk the full metadata does is for filter controls this surface doesn't render.
6
+ */
7
+ export declare function requiredFiltersBySource(sourceInfos: Malloy.SourceInfo[]): Map<string, string[]>;
8
+ /** The names of the model's sources: what lineage, inherited givens and a
9
+ * same-model join target are resolved against. */
10
+ export declare function sourceNameSet(sources: readonly {
11
+ name: string;
12
+ }[]): ReadonlySet<string>;