@malloy-publisher/sdk 0.9.9 → 0.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{RenderedResult-Bw7EQc42.cjs.js → RenderedResult-BcgYjkZ0.cjs.js} +1 -1
- package/dist/{RenderedResult-BHuJpdSn.es.js → RenderedResult-Dp1Qdajz.es.js} +1 -1
- package/dist/builder/index.cjs.js +61 -61
- package/dist/builder/index.es.js +782 -793
- package/dist/components/Dashboard/DashboardView.d.ts +11 -0
- package/dist/components/Dashboard/useStuck.d.ts +14 -0
- package/dist/components/DocumentCreate/newNotebook.d.ts +9 -5
- package/dist/components/ReportBuilder/FilterStrip.d.ts +3 -1
- package/dist/components/ReportBuilder/TileMenu.d.ts +7 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +3 -3
- package/dist/{useCompiledDocument-1dgF5CC9.es.js → useCompiledDocument-BMPDvdFx.es.js} +2348 -2310
- package/dist/{useCompiledDocument-BKyRnXmA.cjs.js → useCompiledDocument-UY28ITET.cjs.js} +34 -34
- package/package.json +1 -1
- package/src/components/Dashboard/DashboardView.tsx +62 -13
- package/src/components/Dashboard/useStuck.ts +38 -0
- package/src/components/DocumentCreate/newNotebook.spec.ts +8 -6
- package/src/components/DocumentCreate/newNotebook.ts +26 -12
- package/src/components/ReportBuilder/BuilderDialogs.tsx +5 -3
- package/src/components/ReportBuilder/BuilderGrid.tsx +13 -3
- package/src/components/ReportBuilder/FilterStrip.tsx +118 -118
- package/src/components/ReportBuilder/ReportBuilder.inline.spec.tsx +0 -1
- package/src/components/ReportBuilder/ReportBuilder.spec.tsx +5 -6
- package/src/components/ReportBuilder/ReportBuilder.tsx +1 -0
- package/src/components/ReportBuilder/TileMenu.tsx +8 -3
- package/src/components/ReportBuilder/newDashboard.spec.ts +2 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const M=require("react/jsx-runtime"),X=require("@mui/material"),p=require("react"),b=require("./useCompiledDocument-
|
|
1
|
+
"use strict";const M=require("react/jsx-runtime"),X=require("@mui/material"),p=require("react"),b=require("./useCompiledDocument-UY28ITET.cjs.js"),Y=require("./ServerProvider-B0dUY8be.cjs.js"),g="publisher-drill";function de(e,r){const t=new Set;let l;try{l=e.getMetadata()?.getAllFields()??[]}catch{return t}const o=new Set;for(const a of l)!a||r(a)||a.tag?.tag("hidden")===void 0&&o.add(a.tag?.text("label")??a.name);for(const a of l){if(!a||!r(a))continue;const n=a.tag?.text("label")??a.name;o.has(n)||t.add(n)}return t}function B(e){const r=/^\s*(\d+)/.exec(e.style?.gridColumn??"");return r?r[1]:void 0}function ce(e,r){if(r.size!==0)for(const t of e.querySelectorAll(".malloy-table")){const l=n=>n.closest(".malloy-table")===t,o=new Set;for(const n of t.querySelectorAll(".column-cell.th")){if(!l(n))continue;const s=(n.textContent??"").replace(/\u200b/g,"").trim(),f=B(n);f&&r.has(s)&&o.add(f)}if(o.size===0)continue;const a=new Set;for(const n of t.querySelectorAll(`.${g}[tabindex="0"]`)){if(!l(n))continue;const s=B(n);s&&(a.has(s)?n.tabIndex=-1:a.add(s))}for(const n of t.querySelectorAll(".column-cell.td")){if(!l(n))continue;const s=B(n),f=!n.querySelector(".value-null")&&(n.textContent??"").trim()!=="";if(s&&f&&o.has(s)&&!n.querySelector(".malloy-table")){if(n.classList.add(g),n.tabIndex===0)a.add(s);else{const v=a.has(s);v||a.add(s),n.tabIndex=v?-1:0}n.setAttribute("role","button")}}}}function ge(e){const r=e.closest(".malloy-table"),t=B(e);return!r||!t?[]:Array.from(r.querySelectorAll(`.${g}`)).filter(l=>l.closest(".malloy-table")===r&&B(l)===t)}function ie(e,r){const t=ge(e),l=t.indexOf(e);if(l===-1)return;const o=r==="first"?t[0]:r==="last"?t[t.length-1]:t[Math.min(Math.max(l+r,0),t.length-1)];if(o){for(const a of t)a.tabIndex=a===o?0:-1;return o}}function ue(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 he(e){const{foreground:r,axisFaint:t,gridline:l,font:o}=e,a={background:e.background,font:o.family,title:{color:r,font:o.family},axis:{labelColor:r,titleColor:r,domainColor:t,tickColor:t,gridColor:l,labelFont:o.family,titleFont:o.family},legend:{labelColor:r,titleColor:r,labelFont:o.family,titleFont:o.family},header:{labelColor:r,titleColor:r},range:{category:e.series}},n={...a,legend:{...a.legend,orient:"bottom"}};return s=>s==="shape_map"?n:a}function me(e){if(!e)return;const r=e.tag("theme");if(!r)return;const t={},l=r.tag("palette");if(l){const a={},n=l.textArray("series");n&&n.length>0&&(a.series=n);for(const s of Y.PER_MODE_COLOR_KEYS){const f=l.tag(s);if(!f)continue;const v={},R=f.text("light"),k=f.text("dark");R&&(v.light=R),k&&(v.dark=k),Object.keys(v).length>0&&(a[s]=v)}Object.keys(a).length>0&&(t.palette=a)}const o=r.tag("font");if(o){const a={},n=o.text("family");n&&(a.family=n);const s=o.numeric("size");typeof s=="number"&&Number.isFinite(s)&&(a.size=s),Object.keys(a).length>0&&(t.font=a)}return Object.keys(t).length>0?t:void 0}const I="data-publisher-fill",ve=async(e,r)=>{if(typeof window>"u")throw new Error("MalloyRenderer can only be used in browser environment");const{MalloyRenderer:t}=await b.loadMalloyRenderer();return new t({onClick:r,vegaConfigOverride:he(e),theme:ue(e),onError:o=>{console.error("Error rendering visualization:",typeof o,o)}}).createViz()};async function we(e){if(!e||typeof e!="object")return;const r=e,t=[...Array.isArray(r.model_annotations)?r.model_annotations:[],...Array.isArray(r.source_annotations)?r.source_annotations:[],...Array.isArray(r.annotations)?r.annotations:[]].map(o=>typeof o?.value=="string"?o.value:void 0).filter(o=>!!o);if(t.length===0)return;let l;try{({parseAnnotation:l}=await b.loadMalloyTag())}catch{return}try{const{tag:o}=l(t);return me(o)}catch(o){console.warn("Failed to parse # theme.* annotations; chart will render with the shell theme.",{error:o,lines:t});return}}function ke(e,r,t){const l=b.buildTableCssVars(r,t);for(const[o,a]of Object.entries(l))e.style.setProperty(o,a)}const xe=`
|
|
2
2
|
/* Card geometry, through the renderer's OWN theme vars rather than over the top
|
|
3
3
|
of them. It declares --malloy-theme--dashboard-* on .malloy-render itself and
|
|
4
4
|
passes each through to the --malloy-render--* the card CSS reads, so a value
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as L } from "react/jsx-runtime";
|
|
2
2
|
import { Box as ne, useTheme as he } from "@mui/material";
|
|
3
3
|
import { Suspense as me, useRef as F, useCallback as be, useMemo as fe, useEffect as ye, useLayoutEffect as pe } from "react";
|
|
4
|
-
import { D as ge, r as U, l as ve, a as we, b as ke, c as xe, m as Ce, d as Re, e as le } from "./useCompiledDocument-
|
|
4
|
+
import { D as ge, r as U, l as ve, a as we, b as ke, c as xe, m as Ce, d as Re, e as le } from "./useCompiledDocument-BMPDvdFx.es.js";
|
|
5
5
|
import { b6 as Ee, b4 as Se, b7 as Ae } from "./ServerProvider-CQy4jVYK.es.js";
|
|
6
6
|
const g = "publisher-drill";
|
|
7
7
|
function Te(e, r) {
|