@malloy-publisher/sdk 0.0.42 → 0.0.45

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./vendor-hHfbZ4ZT.cjs"),x=require("./index-C7HUzsul.cjs"),t=require("react");function E({result:i,height:m,isFillElement:f,onSizeChange:l,onDrill:v}){const e=t.useRef(null),[a,h]=t.useState(!1),[R,b]=t.useState(!1),[y,M]=t.useState(!1),s=t.useRef(null),n=t.useRef(null);if(t.useLayoutEffect(()=>{if(e.current&&i&&!R){b(!0),s.current||(s.current=new Promise(r=>{n.current=r}));const o=new x.index_umdExports.MalloyRenderer({onClick:v}).createViz();for(;e.current.firstChild;)e.current.removeChild(e.current.firstChild);const d=new MutationObserver(r=>{for(const c of r)if(c.type==="childList"&&c.addedNodes.length>0&&Array.from(c.addedNodes).some(g=>g.nodeType===Node.ELEMENT_NODE)){d.disconnect(),setTimeout(()=>{h(!0),n.current&&(n.current(),n.current=null,s.current=null)},50);break}});if(e.current){d.observe(e.current,{childList:!0,subtree:!0,characterData:!0});try{o.setResult(JSON.parse(i)),o.render(e.current)}catch(r){console.error("Error rendering visualization:",r),d.disconnect(),h(!0),n.current&&(n.current(),n.current=null,s.current=null)}}}},[i,v,R]),t.useEffect(()=>{h(!1),b(!1),s.current=null,n.current=null},[i]),R&&!a&&s.current)throw s.current;return t.useEffect(()=>{if(!e.current||!a)return;const u=e.current,o=()=>{if(u){const c=u.offsetHeight;c>0?l&&l(c):f&&u.firstChild&&(u.firstChild.offsetHeight==0?f(!0):f(!1))}},d=setTimeout(o,100);let r=null;return y||(r=new MutationObserver(o),r.observe(u,{childList:!0,subtree:!0,attributes:!0})),()=>{clearTimeout(d),r?.disconnect()}},[l,i,f,a]),p.jsxRuntimeExports.jsx("div",{ref:e,style:{width:"100%",height:m?`${m}px`:"100%"}})}exports.default=E;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("./vendor-hHfbZ4ZT.cjs"),x=require("./index-nsXS-gBw.cjs"),t=require("react");function E({result:i,height:m,isFillElement:f,onSizeChange:l,onDrill:v}){const e=t.useRef(null),[a,h]=t.useState(!1),[R,b]=t.useState(!1),[y,M]=t.useState(!1),s=t.useRef(null),n=t.useRef(null);if(t.useLayoutEffect(()=>{if(e.current&&i&&!R){b(!0),s.current||(s.current=new Promise(r=>{n.current=r}));const o=new x.index_umdExports.MalloyRenderer({onClick:v}).createViz();for(;e.current.firstChild;)e.current.removeChild(e.current.firstChild);const d=new MutationObserver(r=>{for(const c of r)if(c.type==="childList"&&c.addedNodes.length>0&&Array.from(c.addedNodes).some(g=>g.nodeType===Node.ELEMENT_NODE)){d.disconnect(),setTimeout(()=>{h(!0),n.current&&(n.current(),n.current=null,s.current=null)},50);break}});if(e.current){d.observe(e.current,{childList:!0,subtree:!0,characterData:!0});try{o.setResult(JSON.parse(i)),o.render(e.current)}catch(r){console.error("Error rendering visualization:",r),d.disconnect(),h(!0),n.current&&(n.current(),n.current=null,s.current=null)}}}},[i,v,R]),t.useEffect(()=>{h(!1),b(!1),s.current=null,n.current=null},[i]),R&&!a&&s.current)throw s.current;return t.useEffect(()=>{if(!e.current||!a)return;const u=e.current,o=()=>{if(u){const c=u.offsetHeight;c>0?l&&l(c):f&&u.firstChild&&(u.firstChild.offsetHeight==0?f(!0):f(!1))}},d=setTimeout(o,100);let r=null;return y||(r=new MutationObserver(o),r.observe(u,{childList:!0,subtree:!0,attributes:!0})),()=>{clearTimeout(d),r?.disconnect()}},[l,i,f,a]),p.jsxRuntimeExports.jsx("div",{ref:e,style:{width:"100%",height:m?`${m}px`:"100%"}})}exports.default=E;
@@ -1,5 +1,5 @@
1
1
  import { j as C } from "./vendor-BKsYdkmG.js";
2
- import { i as E } from "./index-wBKeSKqo.js";
2
+ import { i as E } from "./index-ClVlSQMk.js";
3
3
  import { useRef as m, useState as R, useLayoutEffect as M, useEffect as w } from "react";
4
4
  function O({
5
5
  result: c,
@@ -1,3 +1,4 @@
1
+ import { default as React } from 'react';
1
2
  import { SourceAndPath } from '../Model/SourcesExplorer';
2
3
  import { NotebookCellValue } from '../NotebookManager';
3
4
  interface NotebookCellProps {
@@ -12,6 +13,7 @@ interface NotebookCellProps {
12
13
  onClose: () => void;
13
14
  onEdit: () => void;
14
15
  onDelete: () => void;
16
+ addButtonCallback: (isMarkdown: boolean) => React.ReactNode;
15
17
  }
16
- export declare function MutableCell({ cell, expandCodeCell, expandEmbedding, hideEmbeddingIcons, editingMalloy, editingMarkdown, sourceAndPaths, onCellChange, onClose, onEdit, onDelete, }: NotebookCellProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function MutableCell({ cell, expandCodeCell, expandEmbedding, hideEmbeddingIcons, editingMalloy, editingMarkdown, sourceAndPaths, onCellChange, onClose, onEdit, onDelete, addButtonCallback, }: NotebookCellProps): import("react/jsx-runtime").JSX.Element;
17
19
  export {};