@malloy-publisher/sdk 0.10.1 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/{RenderedResult-vf6tu8tf.es.js → RenderedResult-B_sW7neX.es.js} +329 -266
  2. package/dist/RenderedResult-BlYdT4lz.cjs.js +179 -0
  3. package/dist/{ServerProvider-B6RLAbgV.es.js → ServerProvider-BN399NH6.es.js} +4 -4
  4. package/dist/builder/index.cjs.js +1 -1
  5. package/dist/builder/index.es.js +3 -3
  6. package/dist/client/api.d.ts +6 -6
  7. package/dist/client/index.es.js +1 -1
  8. package/dist/components/Dashboard/DashboardView.d.ts +10 -3
  9. package/dist/components/Dashboard/DownloadRowsCsv.d.ts +10 -0
  10. package/dist/components/Dashboard/RowsDialog.d.ts +63 -21
  11. package/dist/components/Dashboard/index.d.ts +2 -0
  12. package/dist/components/Dashboard/rowsCsv.d.ts +26 -0
  13. package/dist/components/RenderedResult/ResultContainer.d.ts +2 -3
  14. package/dist/components/RenderedResult/resultSizing.d.ts +2 -0
  15. package/dist/components/Report/Report.d.ts +8 -1
  16. package/dist/components/drill/drillClauses.d.ts +34 -0
  17. package/dist/components/drill/drillClickRelay.d.ts +36 -0
  18. package/dist/components/drill/resolveDrill.d.ts +29 -0
  19. package/dist/components/drill/rowsTarget.d.ts +114 -0
  20. package/dist/components/drill/useDrill.d.ts +24 -12
  21. package/dist/index.cjs.js +13 -11
  22. package/dist/index.es.js +7331 -6886
  23. package/dist/{useCompiledDocument-C995sQ3j.cjs.js → useCompiledDocument-CyPOSStA.cjs.js} +31 -31
  24. package/dist/{useCompiledDocument-CLbTFtsJ.es.js → useCompiledDocument-xJRD5DRP.es.js} +1588 -1575
  25. package/dist/utils/malloyString.d.ts +2 -1
  26. package/package.json +1 -1
  27. package/src/components/Dashboard/DashboardView.tsx +54 -28
  28. package/src/components/Dashboard/DownloadRowsCsv.tsx +152 -0
  29. package/src/components/Dashboard/RowsDialog.actions.spec.tsx +250 -0
  30. package/src/components/Dashboard/RowsDialog.drill.compile.spec.ts +672 -0
  31. package/src/components/Dashboard/RowsDialog.spec.ts +38 -11
  32. package/src/components/Dashboard/RowsDialog.tsx +194 -40
  33. package/src/components/Dashboard/index.ts +2 -0
  34. package/src/components/Dashboard/rowsCsv.spec.ts +105 -0
  35. package/src/components/Dashboard/rowsCsv.ts +107 -0
  36. package/src/components/RenderedResult/RenderedResult.tsx +44 -7
  37. package/src/components/RenderedResult/ResultContainer.tsx +2 -2
  38. package/src/components/RenderedResult/resultSizing.ts +3 -0
  39. package/src/components/Report/Report.tsx +9 -0
  40. package/src/components/drill/drillClauses.ts +201 -0
  41. package/src/components/drill/drillClickRelay.spec.ts +122 -0
  42. package/src/components/drill/drillClickRelay.ts +106 -0
  43. package/src/components/drill/resolveDrill.ts +29 -0
  44. package/src/components/drill/rowsTarget.ts +245 -0
  45. package/src/components/drill/useDrill.spec.tsx +311 -15
  46. package/src/components/drill/useDrill.tsx +206 -67
  47. package/src/components/legacy/malloynb/NotebookCell.tsx +0 -7
  48. package/src/utils/malloyString.ts +21 -2
  49. package/dist/RenderedResult-B5f4qOjp.cjs.js +0 -171
@@ -0,0 +1,179 @@
1
+ "use strict";const $=require("react/jsx-runtime"),se=require("@mui/material"),w=require("react"),u=require("./useCompiledDocument-CyPOSStA.cjs.js"),X=require("./ServerProvider-e2369oom.cjs.js"),v=u.reportClasses.drillCell;function he(e,t){const r=new Set;let a;try{a=e.getMetadata()?.getAllFields()??[]}catch{return r}const o=new Set;for(const n of a)!n||t(n)||n.tag?.tag("hidden")===void 0&&o.add(n.tag?.text("label")??n.name);for(const n of a){if(!n||!t(n))continue;const l=n.tag?.text("label")??n.name;o.has(l)||r.add(l)}return r}function j(e){const t=/^\s*(\d+)/.exec(e.style?.gridColumn??"");return t?t[1]:void 0}function me(e,t){if(t.size!==0)for(const r of e.querySelectorAll(".malloy-table")){const a=l=>l.closest(".malloy-table")===r,o=new Set;for(const l of r.querySelectorAll(".column-cell.th")){if(!a(l))continue;const i=(l.textContent??"").replace(/\u200b/g,"").trim(),m=j(l);m&&t.has(i)&&o.add(m)}if(o.size===0)continue;const n=new Set;for(const l of r.querySelectorAll(`.${v}[tabindex="0"]`)){if(!a(l))continue;const i=j(l);i&&(n.has(i)?l.tabIndex=-1:n.add(i))}for(const l of r.querySelectorAll(".column-cell.td")){if(!a(l))continue;const i=j(l),m=!l.querySelector(".value-null")&&(l.textContent??"").trim()!=="";if(i&&m&&o.has(i)&&!l.querySelector(".malloy-table")){if(l.classList.add(v),l.tabIndex===0)n.add(i);else{const p=n.has(i);p||n.add(i),l.tabIndex=p?-1:0}l.setAttribute("role","button")}}}}function ke(e){const t=e.closest(".malloy-table"),r=j(e);return!t||!r?[]:Array.from(t.querySelectorAll(`.${v}`)).filter(a=>a.closest(".malloy-table")===t&&j(a)===r)}function de(e,t){const r=ke(e),a=r.indexOf(e);if(a===-1)return;const o=t==="first"?r[0]:t==="last"?r[r.length-1]:r[Math.min(Math.max(a+t,0),r.length-1)];if(o){for(const n of r)n.tabIndex=n===o?0:-1;return o}}function be(e){return{background:e.dashboardRoot,tableBackground:e.tableBackground,tableHeaderColor:e.tableHeader,tableBodyColor:e.tableBody,tableBorder:e.border,tablePinnedBackground:e.tableHeaderBackground,tablePinnedBorder:e.pinnedBorder,tableFontSize:`${e.font.size}px`,fontFamily:e.font.family,mapColor:e.mapColor}}function fe(e){const{foreground:t,axisFaint:r,gridline:a,font:o}=e,n={background:e.background,font:o.family,title:{color:t,font:o.family},axis:{labelColor:t,titleColor:t,domainColor:r,tickColor:r,gridColor:a,labelFont:o.family,titleFont:o.family},legend:{labelColor:t,titleColor:t,labelFont:o.family,titleFont:o.family},header:{labelColor:t,titleColor:t},range:{category:e.series}},l={...n,legend:{...n.legend,orient:"bottom"}};return i=>i==="shape_map"?l:n}function ye(e){if(!e)return;const t=e.tag("theme");if(!t)return;const r={},a=t.tag("palette");if(a){const n={},l=a.textArray("series");l&&l.length>0&&(n.series=l);for(const i of X.PER_MODE_COLOR_KEYS){const m=a.tag(i);if(!m)continue;const p={},C=m.text("light"),x=m.text("dark");C&&(p.light=C),x&&(p.dark=x),Object.keys(p).length>0&&(n[i]=p)}Object.keys(n).length>0&&(r.palette=n)}const o=t.tag("font");if(o){const n={},l=o.text("family");l&&(n.family=l);const i=o.numeric("size");typeof i=="number"&&Number.isFinite(i)&&(n.size=i),Object.keys(n).length>0&&(r.font=n)}return Object.keys(r).length>0?r:void 0}const Z=e=>(e??[]).map(t=>t?.value).filter(t=>typeof t=="string");function xe(e){const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();return t.charAt(0).toUpperCase()+t.slice(1)}const Ce=e=>Z(e.annotations).some(t=>{const r=t.trim();return/^#[^("]/.test(r)&&/(?:^#|[\s{])label\s*=/.test(r)}),Re=e=>`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,Te=e=>e.type?.element_type?.fields??e.type?.fields;function pe(e,t){let r=!1;return{fields:e.map(o=>{const n=Te(o);if(n){const i=pe(n,u.requestsRowChart(Z(o.annotations)));if(!i.changed)return o;r=!0;const m=o.type?.element_type?{...o.type,element_type:{...o.type.element_type,fields:i.fields}}:{...o.type,fields:i.fields};return{...o,type:m}}if(!t||!o.name||Ce(o))return o;const l=xe(o.name);return l===o.name?o:(r=!0,{...o,annotations:[{value:`# label=${Re(l)}
2
+ `},...o.annotations??[]]})}),changed:r}}function Ae(e){if(!e||typeof e!="object")return e;const t=e,r=t.schema?.fields;if(!Array.isArray(r))return e;const{fields:a,changed:o}=pe(r,u.requestsRowChart(Z(t.annotations)));return o?{...t,schema:{...t.schema,fields:a}}:e}const ce=320,Ee=10,Se=96,_e=4e3;function De(e,t){if(e!=="bar"&&e!=="combo"&&e!=="line"&&e!=="chart"&&e!=="scatter_chart")return;if(e!=="bar"&&e!=="combo")return ce;const r=t?.data?.array_value?.length,a=r===void 0?0:r*Ee+Se;return Math.min(Math.max(ce,a),_e)}function Oe(e){let t;return{onClick:r=>{const a={...r,...Le(r)};t=a,queueMicrotask(()=>{t===a&&(t=void 0),e(a)})},onDrill:r=>{const a=t;t=void 0,a&&r.stableDrillClauses!==void 0&&(a.drillClauses=r.stableDrillClauses)}}}function Le(e){const t=e.field;try{const r=t?.getEffectiveQueryTimezone?.();return r?{timezone:r}:{}}catch{return{}}}function ze(e){const t=r=>{let a=!1;try{a=r.isArray?.()===!0}catch{a=!1}a&&"stableDrillFilters"in r&&Object.defineProperty(r,"stableDrillFilters",{configurable:!0,get:()=>[]});for(const o of r.fields??[])t(o)};e&&t(e)}const B="data-publisher-fill",Fe=async(e,t,r)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:a}=await u.loadMalloyRenderer();return new a({onClick:t,...r?{onDrill:r,tableConfig:{enableDrill:!0}}:{},vegaConfigOverride:fe(e),theme:be(e),onError:n=>{console.error("Error rendering visualization:",typeof n,n)}}).createViz()};async function Ie(e){if(!e||typeof e!="object")return;const t=e,r=[...Array.isArray(t.model_annotations)?t.model_annotations:[],...Array.isArray(t.source_annotations)?t.source_annotations:[],...Array.isArray(t.annotations)?t.annotations:[]].map(o=>typeof o?.value=="string"?o.value:void 0).filter(o=>!!o);if(r.length===0)return;let a;try{({parseAnnotation:a}=await u.loadMalloyTag())}catch{return}try{const{tag:o}=a(r);return ye(o)}catch(o){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:o,lines:r});return}}function Me(e,t,r){const a=u.buildTableCssVars(t,r);for(const[o,n]of Object.entries(a))e.style.setProperty(o,n)}const $e=`
3
+ /* Card geometry, through the renderer's OWN theme vars rather than over the top
4
+ of them. It declares --malloy-theme--dashboard-* on .malloy-render itself and
5
+ passes each through to the --malloy-render--* the card CSS reads, so a value
6
+ inherited from our wrapper loses to that declaration however early it is set:
7
+ this has to be a rule on the same element, at higher specificity. Doubling the
8
+ class does that, and then no !important is needed — which matters, because
9
+ !important here also lands on .dashboard-item-borderless and repaints a card
10
+ the author asked to have no card. */
11
+ .malloy-render.malloy-render {
12
+ --malloy-theme--dashboard-card-radius: var(--publisher-dashboard-card-radius);
13
+ --malloy-theme--dashboard-card-padding: var(--publisher-dashboard-card-padding);
14
+ }
15
+ /* dashboard.css hardcodes background: #f7f9fc on .malloy-dashboard
16
+ and .dashboard-row-header, which would paint light grey in dark
17
+ mode and also bleed an operator-picked palette.background across
18
+ the panel chrome in light. Both surfaces use
19
+ --malloy-render--background here, which buildMalloyExplicitTheme
20
+ wires to dashboardRoot: a mode-keyed neutral that stays decoupled
21
+ from palette.background (the chart canvas) on purpose. Selectors
22
+ are duplicated at higher specificity to beat the renderer s own
23
+ scoped rules. */
24
+ .malloy-render .malloy-dashboard,
25
+ .malloy-render.malloy-render .malloy-dashboard,
26
+ div.malloy-render .malloy-dashboard {
27
+ /* --publisher-dashboard-root is set on the outer Publisher wrapper
28
+ (see buildTableCssVars) and stays decoupled from
29
+ --malloy-render--background, which gets shadowed inside the
30
+ renderer when a theme.background annotation is present. The
31
+ dedicated var means the panel between tiles always paints the
32
+ operator neutral dashboardRoot regardless of annotations. */
33
+ background: var(--publisher-dashboard-root) !important;
34
+ background-color: var(--publisher-dashboard-root) !important;
35
+ color: var(--malloy-render--table-body-color) !important;
36
+ }
37
+ .malloy-render .malloy-dashboard .dashboard-row,
38
+ .malloy-render .malloy-dashboard .dashboard-row-body,
39
+ .malloy-render .malloy-dashboard .dashboard-row-header,
40
+ .malloy-render.malloy-render .malloy-dashboard .dashboard-row-header,
41
+ div.malloy-render .malloy-dashboard .dashboard-row-header {
42
+ /* Belt + suspenders: dashboard.css hardcodes .dashboard-row-header
43
+ to #f7f9fc, and row / row-body have no explicit background but
44
+ get caught in any annotation-driven inline writes. Force all of
45
+ them to the neutral panel colour. */
46
+ background: var(--publisher-dashboard-root) !important;
47
+ background-color: var(--publisher-dashboard-root) !important;
48
+ }
49
+ .malloy-render .malloy-dashboard .dashboard-item:not(.dashboard-item-borderless) {
50
+ /* Tile padding around each chart / table. Uses our custom
51
+ --malloy-render--tile-background so the operator can theme the
52
+ tile separately from the table header row (which paints from
53
+ --malloy-render--table-pinned-background below).
54
+
55
+ A flat bordered card rather than the renderer's shadow ring, which is what
56
+ makes it match the composite tile's Paper. :not(borderless) because
57
+ # borderless asks for no card at all, and an !important background and
58
+ border drew one anyway. */
59
+ background: var(--malloy-render--tile-background) !important;
60
+ color: var(--malloy-render--table-body-color) !important;
61
+ box-shadow: none !important;
62
+ /* The card edge, not the table gridline: --publisher-dashboard-card-border,
63
+ the same value TileCard paints, so the renderer's card and the composite
64
+ one are outlined identically. */
65
+ border: var(--publisher-dashboard-card-border) !important;
66
+ }
67
+ /* The renderer's big-value card — the small card a "# big_value" measure sits
68
+ in, several to a row inside one tile. (No backticks in here: this is inside
69
+ a template literal.) Its own CSS gives it a 0.55px edge in
70
+ #e5e7eb: a sub-pixel width, and a grey off the slate ramp everything else on
71
+ the page is on. It is a dashboard card like any other, so it takes the card
72
+ edge and stops being the one card outlined in a hairline nobody can see. */
73
+ .malloy-render .malloy-big-value-card {
74
+ border: var(--publisher-dashboard-card-border) !important;
75
+ /* Its shadow is a four-layer Tailwind stack, and only two of those layers
76
+ are a shadow: the other is "0 0 0 1px #e5e7eb", a spread ring drawn as a
77
+ second border OVER the real one. So the border above was landing
78
+ underneath a ring in the renderer's own grey, and the card kept both a
79
+ lifted look the flat cards around it do not have and an edge we did not
80
+ pick. Dropped whole rather than rebuilt layer by layer: the ring's job is
81
+ the border's job, and the border is already doing it. */
82
+ box-shadow: none !important;
83
+ }
84
+ /* The strip of big-value cards as a grid, so cards share a width and the last one does not wrap
85
+ alone. The renderer's wrapping flex row sizes each card to its own text. The 250px floor is the
86
+ widest realistic value: it is nowrap at 32px in an overflow:visible card, so a narrower track
87
+ would spill it onto its neighbour. Embedded (a nested big_value) is left as the renderer draws it. */
88
+ .malloy-render .malloy-big-value:not(.malloy-big-value--embedded) {
89
+ display: grid;
90
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
91
+ }
92
+ .malloy-render .malloy-big-value-card:not(.malloy-big-value-card--embedded) {
93
+ width: auto;
94
+ max-width: none;
95
+ }
96
+ /* Compact, in a tile set shorter than its cards (ResultContainer marks it tight): smaller values,
97
+ tighter cards and a 190px floor, which a 22px value still fits in, so five cards share a row of
98
+ about a thousand pixels instead of wrapping into rows the tile has no room for. */
99
+ [${u.TIGHT_ATTR}] .malloy-render .malloy-big-value:not(.malloy-big-value--embedded) {
100
+ grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
101
+ gap: 8px;
102
+ padding: 8px;
103
+ }
104
+ [${u.TIGHT_ATTR}] .malloy-render .malloy-big-value-card:not(.malloy-big-value-card--embedded) {
105
+ padding: 9px 14px;
106
+ }
107
+ [${u.TIGHT_ATTR}] .malloy-render .malloy-big-value-value {
108
+ font-size: 22px;
109
+ }
110
+ [${u.TIGHT_ATTR}] .malloy-render .malloy-big-value-label {
111
+ font-size: 11px;
112
+ }
113
+ .malloy-render .malloy-dashboard .dashboard-row-header-separator {
114
+ background: var(--malloy-render--table-border) !important;
115
+ }
116
+ /* !important because the malloy-explorer stylesheet pins these same properties with it. */
117
+ [${B}] .malloy-table.root {
118
+ height: 100% !important;
119
+ align-content: start !important;
120
+ grid-template-columns: repeat(var(--total-header-size), minmax(max-content, 1fr)) !important;
121
+ }
122
+ .malloy-render .malloy-table .th.column-cell {
123
+ /* Non-pinned tables have no header background in the renderer's
124
+ own CSS (only pinned scrolled tables paint the pinned-header
125
+ with this var). Force the same value here so every table has a
126
+ visible header band reflecting the operator's choice. */
127
+ background: var(--malloy-render--table-pinned-background) !important;
128
+ }
129
+ .malloy-render .dashboard-item-title,
130
+ .malloy-render .dashboard-dimension-name {
131
+ color: var(--malloy-render--label-color) !important;
132
+ }
133
+ .malloy-render .dashboard-item-value,
134
+ .malloy-render .dashboard-item-value-measure,
135
+ .malloy-render .dashboard-dimension-value {
136
+ color: var(--malloy-render--value-color) !important;
137
+ }
138
+ .malloy-render .malloy-table,
139
+ .malloy-render .malloy-list {
140
+ color: var(--malloy-render--table-body-color) !important;
141
+ }
142
+ .malloy-render .column-cell.th,
143
+ .malloy-render .cell-content.header {
144
+ color: var(--malloy-render--table-header-color) !important;
145
+ }
146
+ /* A cell whose column declares a "# drill" this surface can honor, marked
147
+ by markDrillableCells. Ordinary text with a pointer cursor until hovered,
148
+ then it reads as a link: the same affordance Malloyyo gives the same tag,
149
+ and the only thing that tells a reader a cell navigates. Kept off the
150
+ resting state deliberately: a column painted blue competes with the data.
151
+ (No backticks in here: this is inside a template literal.) */
152
+ .malloy-render .${v} {
153
+ cursor: pointer;
154
+ }
155
+ .malloy-render .${v}:hover > .cell-content {
156
+ color: var(--publisher-drill-link) !important;
157
+ text-decoration: underline;
158
+ }
159
+ /* Keyboard focus reads the same as hover, plus a ring: a hover colour is not
160
+ something a keyboard user can produce, and a focus ring is not something a
161
+ mouse user sees. focus-visible rather than focus, so a click does not leave a
162
+ ring behind it. (No backticks in here: this is inside a template literal.) */
163
+ .malloy-render .${v}:focus-visible {
164
+ outline: 2px solid var(--publisher-drill-link);
165
+ outline-offset: -2px;
166
+ }
167
+ .malloy-render .${v}:focus-visible > .cell-content {
168
+ color: var(--publisher-drill-link) !important;
169
+ text-decoration: underline;
170
+ }
171
+ /* The renderer's own drill, on so a click can report its row, paints the
172
+ whole hovered row as a link. Which cells click is the marking above. */
173
+ .malloy-render .malloy-table .td.highlight {
174
+ color: inherit;
175
+ }
176
+ .malloy-render .malloy-table .td.highlight:not(.${v}) {
177
+ cursor: inherit;
178
+ }
179
+ `,ue="publisher-malloy-renderer-overrides";function Be(){if(typeof document>"u"||document.getElementById(ue))return;const e=document.createElement("style");e.id=ue,e.textContent=$e,document.head.appendChild(e)}function je({result:e,height:t,drill:r,onSizeChange:a,onSizing:o,fill:n}){const l=w.useRef(null),i=w.useRef(r);i.current=r;const m=w.useMemo(()=>Oe(d=>i.current?.onClick(d)),[]),p=r!==void 0,C=w.useRef(!1),x=w.useRef(null),G=w.useRef(0),{theme:N,layers:W,mode:ee}=X.usePublisherTheme(),te=w.useMemo(()=>({radius:N.ui.radius.tile,padding:`${u.DASHBOARD_CARD_PADDING_PX}px`}),[N.ui.radius.tile]);return w.useEffect(()=>()=>{G.current+=1;const d=x.current;d?.viz.remove(),d?.node.remove(),x.current=null},[]),w.useLayoutEffect(()=>{if(!l.current||!e)return;Be();const d=l.current,ve=G.current+=1;let K=!1;const U=()=>!K&&ve===G.current;let c,f,P=null,Y=0,q=null,H=null,V=null,L=null,z=null,F=null,re=null,oe=0,S=null;C.current=!1;let g,_;const J=k=>{if(K||!k.firstElementChild||u.resultSizing(g,_)==="container")return;const I=u.remeasuresAfterReady(g,_);if(C.current&&!I)return;const M=d.hasAttribute(B);M&&d.removeAttribute(B);const R=d.closest(`.${u.RESULT_SCROLLER_CLASS}`),h=R?.style.overflowY;R&&(R.style.overflowY="hidden");const D=u.measureContentHeight(k,u.contentNodeDepth(g));R&&(R.style.overflowY=h??""),M&&d.setAttribute(B,""),D>0&&(C.current=!0,a&&D!==oe&&(oe=D,a(D)));const T=u.contentNode(k,u.contentNodeDepth(g));I&&T&&re!==T&&(re=T,F?.disconnect(),F=new ResizeObserver(()=>J(k)),F.observe(T))};return(async()=>{let k;try{k=JSON.parse(e)}catch(b){console.error("Error parsing visualization result:",b);return}const I=await Ie(k),M=I?X.resolveTheme([...W,X.chartThemeLayer(W,I)],ee):N;if(!U())return;try{f=await Fe(M,m.onClick,p?m.onDrill:void 0)}catch(b){console.error("Failed to create renderer:",b);return}if(!U()){f.remove(),f=void 0;return}const R=x.current;c=document.createElement("div"),c.style.width="100%",c.style.height="100%",Me(c,M,te),d.childElementCount>0&&(d.style.position="relative",c.style.position="absolute",c.style.inset="0",c.style.visibility="hidden"),d.appendChild(c);const h=c;L=new MutationObserver(()=>{z&&clearTimeout(z),z=setTimeout(()=>{J(h),C.current&&L?.disconnect()},100)}),L.observe(c,{childList:!0,subtree:!0,attributes:!0});const D=f;let T=!1;const ae=()=>{if(!(T||!U())){T=!0,S&&(clearTimeout(S),S=null),R?.viz.remove();for(const b of Array.from(d.children))b!==h&&d.removeChild(b);h.style.position="",h.style.inset="",h.style.visibility="",d.style.position="",x.current={viz:D,node:h},J(h)}};try{f.setResult(Ae(k));try{const A=f.getMetadata(),E=A?.getRootField();p&&ze(E),g=E?.renderAs(),_=E?A?.getPluginsForField(E.key)?.[0]?.sizingStrategy:void 0}catch{g=void 0,_=void 0}o?.(u.resultSizing(g,_),g),c.dataset.malloyRenderAs=g??"unknown",c.dataset.malloySizing=u.resultSizing(g,_);const b=De(g,k);c.style.minWidth=b===void 0?"":`${b}px`,d.style.overflowX=b===void 0?"":"auto",d.style.overflowY=b===void 0?"":"hidden",f.render(c);const ne=i.current;try{if(ne){const A=he(f,ne.canDrill),E=()=>{try{me(h,A)}catch(s){console.warn("Drill affordance skipped:",s)}};E();const le=s=>{const O=s.querySelector(".cell-content")??s,Q=O.getBoundingClientRect();O.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0,view:O.ownerDocument.defaultView,clientX:Math.round(Q.left+Q.width/2),clientY:Math.round(Q.bottom)}))},ie=s=>s.target?.closest?.(`.${v}`)??null,we=(s,y)=>{de(s,y)?.focus()};q=s=>{const y=ie(s);if(!y)return;const O=s.key==="ArrowDown"?1:s.key==="ArrowUp"?-1:s.key==="Home"?"first":s.key==="End"?"last":void 0;if(O!==void 0){s.preventDefault(),we(y,O);return}s.key==="Enter"?(s.preventDefault(),le(y)):s.key===" "&&s.preventDefault()},H=s=>{if(s.key!==" ")return;const y=ie(s);y&&(s.preventDefault(),le(y))},V=s=>{const y=s.target?.closest?.(`.${v}`);y&&de(y,0)},h.addEventListener("keydown",q),h.addEventListener("keyup",H),h.addEventListener("focusin",V),A.size>0&&typeof MutationObserver<"u"&&(P=new MutationObserver(()=>{cancelAnimationFrame(Y),Y=requestAnimationFrame(E)}),P.observe(h,{childList:!0,subtree:!0}))}}catch(A){console.warn("Drill affordance skipped:",A)}f.onReady(ae),S=setTimeout(ae,1e4)}catch(b){console.error("Error rendering visualization:",b),L?.disconnect(),F?.disconnect(),P?.disconnect(),f.remove(),f=void 0,h.parentNode===d&&d.removeChild(h)}})(),()=>{K=!0,L?.disconnect(),F?.disconnect(),z&&clearTimeout(z),S&&clearTimeout(S),c&&x.current?.node!==c&&(q&&c.removeEventListener("keydown",q),H&&c.removeEventListener("keyup",H),V&&c.removeEventListener("focusin",V),P?.disconnect(),cancelAnimationFrame(Y),f?.remove(),c.parentNode===d&&d.removeChild(c),d.style.position="")}},[e,m,p,a,o,N,W,ee,te]),$.jsx("div",{ref:l,...n?{[B]:""}:{},style:{width:"100%",height:t?`${t}px`:"400px"}})}function ge(e){return typeof window>"u"?$.jsx(se.Box,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading..."}):$.jsx(w.Suspense,{fallback:$.jsx(se.Box,{sx:{width:"100%",height:e.height?`${e.height}px`:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"text.secondary"},children:"Loading visualization..."}),children:$.jsx(je,{...e})})}const Ne=Object.freeze(Object.defineProperty({__proto__:null,default:ge},Symbol.toStringTag,{value:"Module"}));exports.DRILL_CELL_CLASS=v;exports.RenderedResult=ge;exports.RenderedResult$1=Ne;exports.buildMalloyExplicitTheme=be;exports.buildVegaThemeOverride=fe;exports.drillableFieldNames=he;exports.markDrillableCells=me;exports.readChartAnnotations=ye;
@@ -926,7 +926,7 @@ const Lt = {
926
926
  };
927
927
  },
928
928
  /**
929
- * Retrieves a table from the specified database schema. This endpoint is useful for discovering available data sources and exploring the database structure. The schema must exist in the connection for this operation to succeed. The tablePath is the full path to the table, including the schema name.
929
+ * Retrieves a table from the specified database schema. This endpoint is useful for discovering available data sources and exploring the database structure. The schema must exist in the connection for this operation to succeed. The tablePath is the full path to the table, including the schema name. On a DuckLake connection, a bare tablePath equal to schemaName reads the catalog\'s default schema.
930
930
  * @summary Get table details from database
931
931
  * @param {string} environmentName Name of the environment
932
932
  * @param {string} connectionName Name of the connection
@@ -1281,7 +1281,7 @@ const Lt = {
1281
1281
  return (l, i) => V(r, u, g, c)(l, s || i);
1282
1282
  },
1283
1283
  /**
1284
- * Retrieves a table from the specified database schema. This endpoint is useful for discovering available data sources and exploring the database structure. The schema must exist in the connection for this operation to succeed. The tablePath is the full path to the table, including the schema name.
1284
+ * Retrieves a table from the specified database schema. This endpoint is useful for discovering available data sources and exploring the database structure. The schema must exist in the connection for this operation to succeed. The tablePath is the full path to the table, including the schema name. On a DuckLake connection, a bare tablePath equal to schemaName reads the catalog\'s default schema.
1285
1285
  * @summary Get table details from database
1286
1286
  * @param {string} environmentName Name of the environment
1287
1287
  * @param {string} connectionName Name of the connection
@@ -1507,7 +1507,7 @@ const Lt = {
1507
1507
  return t.getConnection(a, r, o).then((s) => s(e, n));
1508
1508
  },
1509
1509
  /**
1510
- * Retrieves a table from the specified database schema. This endpoint is useful for discovering available data sources and exploring the database structure. The schema must exist in the connection for this operation to succeed. The tablePath is the full path to the table, including the schema name.
1510
+ * Retrieves a table from the specified database schema. This endpoint is useful for discovering available data sources and exploring the database structure. The schema must exist in the connection for this operation to succeed. The tablePath is the full path to the table, including the schema name. On a DuckLake connection, a bare tablePath equal to schemaName reads the catalog\'s default schema.
1511
1511
  * @summary Get table details from database
1512
1512
  * @param {string} environmentName Name of the environment
1513
1513
  * @param {string} connectionName Name of the connection
@@ -1718,7 +1718,7 @@ class Qe extends C {
1718
1718
  return y(this.configuration).getConnection(n, e, t).then((a) => a(this.axios, this.basePath));
1719
1719
  }
1720
1720
  /**
1721
- * Retrieves a table from the specified database schema. This endpoint is useful for discovering available data sources and exploring the database structure. The schema must exist in the connection for this operation to succeed. The tablePath is the full path to the table, including the schema name.
1721
+ * Retrieves a table from the specified database schema. This endpoint is useful for discovering available data sources and exploring the database structure. The schema must exist in the connection for this operation to succeed. The tablePath is the full path to the table, including the schema name. On a DuckLake connection, a bare tablePath equal to schemaName reads the catalog\'s default schema.
1722
1722
  * @summary Get table details from database
1723
1723
  * @param {string} environmentName Name of the environment
1724
1724
  * @param {string} connectionName Name of the connection