@peak-ai/canvas 1.4.2-rc.7 → 1.4.2-rc.8

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@peak-ai/canvas",
3
3
  "author": "squad-builder-experience",
4
4
  "license": "UNLICENSED",
5
- "version": "1.4.2-rc.7",
5
+ "version": "1.4.2-rc.8",
6
6
  "description": "",
7
7
  "dependencies": {
8
8
  "@peak-ai/ais-components": "6.41.0",
@@ -1 +1 @@
1
- {"version":3,"file":"grapejs-plugin.js","names":["ReactDOM","getRenderers","jsx","_jsx","createGrapesjsShadcnGenericPlugin","mode","performInteraction","renderedComponents","grapesjsShadcnGenericPlugin","editor","DomComponents","addType","model","defaults","tagName","droppable","componentName","componentProps","traits","view","events","handleSlotInput","e","target","slot","dataset","text","innerText","props","get","startsWith","_props$data","idx","parseInt","split","dataKeys","Object","keys","data","headerMapper","key","set","_extends","render","_this","compName","compProps","JSON","parse","err","console","error","isEditable","onChange","renderers","Renderer","gjsModel","el","children","components","tabsContent","querySelectorAll","each","childModel","i","childView","createView","appendChild","innerHTML","_this$em$get$getType","ComponentView","em","getType","warn","config","componentTypes","remove","unmountComponentAtNode"],"sources":["../../src/plugins/grapejs-plugin.tsx"],"sourcesContent":["/* eslint-disable import/no-named-as-default-member */\n/* eslint-disable func-names */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport ReactDOM from 'react-dom';\nimport { Editor, Component } from 'grapesjs';\nimport { getRenderers } from './helpers/render-components';\n\nexport function createGrapesjsShadcnGenericPlugin(\n mode: 'editor' | 'preview',\n performInteraction: (payload: Record<string, any>) => void,\n renderedComponents: Record<string, Component> = {},\n) {\n return function grapesjsShadcnGenericPlugin(editor: Editor): void {\n editor.DomComponents.addType('shadcn-generic', {\n model: {\n defaults: {\n tagName: 'div',\n droppable: false,\n componentName: 'Card',\n componentProps: {},\n traits: [],\n },\n },\n view: {\n events: {\n 'input [data-slot]': 'handleSlotInput',\n } as any,\n handleSlotInput(e: Event) {\n const target = e.target as HTMLElement;\n const slot = target.dataset.slot;\n const text = target.innerText;\n\n const props = this.model.get('componentProps') || {};\n\n if (!slot) {\n return;\n }\n\n if (slot.startsWith('table-header-')) {\n const idx = parseInt(slot.split('-')[2], 10);\n const dataKeys = Object.keys(props.data?.[0] || {});\n\n if (!props.headerMapper) {\n props.headerMapper = {};\n }\n\n const key = dataKeys[idx];\n\n if (key) {\n props.headerMapper[key] = text;\n }\n } else {\n props[slot] = text;\n }\n\n this.model.set('componentProps', {\n ...props,\n });\n },\n render: function () {\n const compName: string = this.model.get('componentName');\n let compProps: any = this.model.get('componentProps');\n\n\n\n if (typeof compProps === 'string') {\n try {\n compProps = JSON.parse(compProps);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('Invalid JSON in componentProps', err);\n compProps = {};\n }\n }\n\n compProps.isEditable = mode === 'editor';\n compProps.performInteraction = performInteraction;\n\n compProps.onChange = (data: Record<string, any>) => {\n this.model.set('componentProps', {\n ...this.model.get('componentProps'),\n ...data,\n });\n };\n\n const renderers = getRenderers();\n const Renderer = renderers[compName];\n\n\n\n if (Renderer) {\n if (compName === 'Tabs') {\n ReactDOM.render(<Renderer {...compProps} gjsModel={this.model} />, this.el);\n\n const children = this.model.components();\n const tabsContent = this.el.querySelectorAll('.tabs-content');\n children.each((childModel, i) => {\n const childView = this.createView(childModel);\n\n if (childView) {\n childView.render();\n tabsContent[i].appendChild(childView.el);\n }\n });\n } else {\n ReactDOM.render(<Renderer {...compProps} gjsModel={this.model} />, this.el);\n }\n } else {\n this.el.innerHTML = `<div>Unsupported component: ${compName}</div>`;\n }\n\n renderedComponents[this.model.get('id')] = this.model;\n\n return this;\n },\n createView(model: any) {\n const ComponentView = this.em.get('DomComponents').getType(model.get('type'))?.view;\n\n if (!ComponentView) {\n // eslint-disable-next-line no-console\n console.warn('No view found for component type:', model.get('type'));\n\n return null;\n }\n\n const view = new ComponentView({\n model,\n config: this.config,\n componentTypes: this.componentTypes,\n });\n\n return view;\n },\n remove: function () {\n // eslint-disable-next-line import/no-named-as-default-member\n ReactDOM.unmountComponentAtNode(this.el);\n\n return this;\n },\n },\n });\n };\n}\n"],"mappings":"qDAAA,sDACA,+BACA,uDACA,MAAO,CAAAA,QAAQ,KAAM,WAAW,CAEhC,OAASC,YAAY,KAAQ,6BAA6B,CAAC,OAAAC,GAAA,IAAAC,IAAA,yBAE3D,MAAO,SAAS,CAAAC,iCAAiCA,CAC/CC,IAA0B,CAC1BC,kBAA0D,CAC1DC,kBAA6C,CAC7C,IADAA,kBAA6C,WAA7CA,kBAA6C,CAAG,CAAC,CAAC,CAElD,MAAO,SAAS,CAAAC,2BAA2BA,CAACC,MAAc,CAAQ,CAChEA,MAAM,CAACC,aAAa,CAACC,OAAO,CAAC,gBAAgB,CAAE,CAC7CC,KAAK,CAAE,CACLC,QAAQ,CAAE,CACRC,OAAO,CAAE,KAAK,CACdC,SAAS,CAAE,KAAK,CAChBC,aAAa,CAAE,MAAM,CACrBC,cAAc,CAAE,CAAC,CAAC,CAClBC,MAAM,CAAE,EACV,CACF,CAAC,CACDC,IAAI,CAAE,CACJC,MAAM,CAAE,CACN,mBAAmB,CAAE,iBACvB,CAAQ,CACRC,eAAe,SAAf,CAAAA,eAAeA,CAACC,CAAQ,CAAE,CACxB,GAAM,CAAAC,MAAM,CAAGD,CAAC,CAACC,MAAqB,CACtC,GAAM,CAAAC,IAAI,CAAGD,MAAM,CAACE,OAAO,CAACD,IAAI,CAChC,GAAM,CAAAE,IAAI,CAAGH,MAAM,CAACI,SAAS,CAE7B,GAAM,CAAAC,KAAK,CAAG,IAAI,CAAChB,KAAK,CAACiB,GAAG,CAAC,gBAAgB,CAAC,EAAI,CAAC,CAAC,CAEpD,GAAI,CAACL,IAAI,CAAE,CACT,MACF,CAEA,GAAIA,IAAI,CAACM,UAAU,CAAC,eAAe,CAAC,CAAE,KAAAC,WAAA,CACpC,GAAM,CAAAC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gCAAkCvB,QAAQ,SAC7D,CAEAtC,kBAAkB,CAAC,IAAI,CAACK,KAAK,CAACiB,GAAG,CAAC,IAAI,CAAC,CAAC,CAAG,IAAI,CAACjB,KAAK,CAErD,MAAO,KACT,CAAC,CACDsD,UAAU,SAAV,CAAAA,UAAUA,CAACtD,KAAU,CAAE,KAAAyD,oBAAA,CACrB,GAAM,CAAAC,aAAa,EAAAD,oBAAA,CAAG,IAAI,CAACE,EAAE,CAAC1C,GAAG,CAAC,eAAe,CAAC,CAAC2C,OAAO,CAAC5D,KAAK,CAACiB,GAAG,CAAC,MAAM,CAAC,CAAC,eAAvDwC,oBAAA,CAAyDlD,IAAI,CAEnF,GAAI,CAACmD,aAAa,CAAE,CAClB;AACApB,OAAO,CAACuB,IAAI,CAAC,mCAAmC,CAAE7D,KAAK,CAACiB,GAAG,CAAC,MAAM,CAAC,CAAC,CAEpE,MAAO,KACT,CAEA,GAAM,CAAAV,IAAI,CAAG,GAAI,CAAAmD,aAAa,CAAC,CAC7B1D,KAAK,CAALA,KAAK,CACL8D,MAAM,CAAE,IAAI,CAACA,MAAM,CACnBC,cAAc,CAAE,IAAI,CAACA,cACvB,CAAC,CAAC,CAEF,MAAO,CAAAxD,IACT,CAAC,CACDyD,MAAM,CAAE,QAAR,CAAAA,MAAMA,CAAA,CAAc,CAClB;AACA5E,QAAQ,CAAC6E,sBAAsB,CAAC,IAAI,CAACpB,EAAE,CAAC,CAExC,MAAO,KACT,CACF,CACF,CAAC,CACH,CACF","ignoreList":[]}
1
+ {"version":3,"file":"grapejs-plugin.js","names":["ReactDOM","getRenderers","jsx","_jsx","createGrapesjsShadcnGenericPlugin","mode","performInteraction","renderedComponents","grapesjsShadcnGenericPlugin","editor","DomComponents","addType","model","defaults","tagName","droppable","componentName","componentProps","traits","view","events","handleSlotInput","e","target","slot","dataset","text","innerText","props","get","startsWith","_props$data","idx","parseInt","split","dataKeys","Object","keys","data","headerMapper","key","set","_extends","render","_this","compName","compProps","JSON","parse","err","console","error","isEditable","onChange","renderers","Renderer","gjsModel","el","children","components","tabsContent","querySelectorAll","each","childModel","i","childView","createView","appendChild","innerHTML","_this$em$get$getType","ComponentView","em","getType","warn","config","componentTypes","remove","unmountComponentAtNode"],"sources":["../../src/plugins/grapejs-plugin.tsx"],"sourcesContent":["/* eslint-disable import/no-named-as-default-member */\n/* eslint-disable func-names */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport ReactDOM from 'react-dom';\nimport { Editor, Component } from 'grapesjs';\nimport { getRenderers } from './helpers/render-components';\n\nexport function createGrapesjsShadcnGenericPlugin(\n mode: 'editor' | 'preview',\n performInteraction: (payload: Record<string, any>) => void,\n renderedComponents: Record<string, Component> = {},\n) {\n return function grapesjsShadcnGenericPlugin(editor: Editor): void {\n editor.DomComponents.addType('shadcn-generic', {\n model: {\n defaults: {\n tagName: 'div',\n droppable: false,\n componentName: 'Card',\n componentProps: {},\n traits: [],\n },\n },\n view: {\n events: {\n 'input [data-slot]': 'handleSlotInput',\n } as any,\n handleSlotInput(e: Event) {\n const target = e.target as HTMLElement;\n const slot = target.dataset.slot;\n const text = target.innerText;\n\n const props = this.model.get('componentProps') || {};\n\n if (!slot) {\n return;\n }\n\n if (slot.startsWith('table-header-')) {\n const idx = parseInt(slot.split('-')[2], 10);\n const dataKeys = Object.keys(props.data?.[0] || {});\n\n if (!props.headerMapper) {\n props.headerMapper = {};\n }\n\n const key = dataKeys[idx];\n\n if (key) {\n props.headerMapper[key] = text;\n }\n } else {\n props[slot] = text;\n }\n\n this.model.set('componentProps', {\n ...props,\n });\n },\n render: function () {\n const compName: string = this.model.get('componentName');\n let compProps: any = this.model.get('componentProps');\n\n if (typeof compProps === 'string') {\n try {\n compProps = JSON.parse(compProps);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('Invalid JSON in componentProps', err);\n compProps = {};\n }\n }\n\n compProps.isEditable = mode === 'editor';\n compProps.performInteraction = performInteraction;\n\n compProps.onChange = (data: Record<string, any>) => {\n this.model.set('componentProps', {\n ...this.model.get('componentProps'),\n ...data,\n });\n };\n\n const renderers = getRenderers();\n const Renderer = renderers[compName];\n\n if (Renderer) {\n if (compName === 'Tabs') {\n ReactDOM.render(<Renderer {...compProps} gjsModel={this.model} />, this.el);\n\n const children = this.model.components();\n const tabsContent = this.el.querySelectorAll('.tabs-content');\n children.each((childModel, i) => {\n const childView = this.createView(childModel);\n\n if (childView) {\n childView.render();\n tabsContent[i].appendChild(childView.el);\n }\n });\n } else {\n ReactDOM.render(<Renderer {...compProps} gjsModel={this.model} />, this.el);\n }\n } else {\n this.el.innerHTML = `<div>Unsupported component: ${compName}</div>`;\n }\n\n renderedComponents[this.model.get('id')] = this.model;\n\n return this;\n },\n createView(model: any) {\n const ComponentView = this.em.get('DomComponents').getType(model.get('type'))?.view;\n\n if (!ComponentView) {\n // eslint-disable-next-line no-console\n console.warn('No view found for component type:', model.get('type'));\n\n return null;\n }\n\n const view = new ComponentView({\n model,\n config: this.config,\n componentTypes: this.componentTypes,\n });\n\n return view;\n },\n remove: function () {\n // eslint-disable-next-line import/no-named-as-default-member\n ReactDOM.unmountComponentAtNode(this.el);\n\n return this;\n },\n },\n });\n };\n}\n"],"mappings":"qDAAA,sDACA,+BACA,uDACA,MAAO,CAAAA,QAAQ,KAAM,WAAW,CAEhC,OAASC,YAAY,KAAQ,6BAA6B,CAAC,OAAAC,GAAA,IAAAC,IAAA,yBAE3D,MAAO,SAAS,CAAAC,iCAAiCA,CAC/CC,IAA0B,CAC1BC,kBAA0D,CAC1DC,kBAA6C,CAC7C,IADAA,kBAA6C,WAA7CA,kBAA6C,CAAG,CAAC,CAAC,CAElD,MAAO,SAAS,CAAAC,2BAA2BA,CAACC,MAAc,CAAQ,CAChEA,MAAM,CAACC,aAAa,CAACC,OAAO,CAAC,gBAAgB,CAAE,CAC7CC,KAAK,CAAE,CACLC,QAAQ,CAAE,CACRC,OAAO,CAAE,KAAK,CACdC,SAAS,CAAE,KAAK,CAChBC,aAAa,CAAE,MAAM,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ACL8D,MAAM,CAAE,IAAI,CAACA,MAAM,CACnBC,cAAc,CAAE,IAAI,CAACA,cACvB,CAAC,CAAC,CAEF,MAAO,CAAAxD,IACT,CAAC,CACDyD,MAAM,CAAE,QAAR,CAAAA,MAAMA,CAAA,CAAc,CAClB;AACA5E,QAAQ,CAAC6E,sBAAsB,CAAC,IAAI,CAACpB,EAAE,CAAC,CAExC,MAAO,KACT,CACF,CACF,CAAC,CACH,CACF","ignoreList":[]}
@@ -1,11 +1,10 @@
1
1
  import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";var _excluded=["gjsModel"],_excluded2=["isEditable","gjsModel"],_excluded3=["isEditable","gjsModel"],_excluded4=["gjsModel","performInteraction"],_excluded5=["gjsModel"];import _regeneratorRuntime from"@babel/runtime/regenerator";function _createForOfIteratorHelperLoose(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(t)return(t=t.call(r)).next.bind(t);if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}/* eslint-disable no-nested-ternary *//* eslint-disable @typescript-eslint/ban-ts-comment *//* eslint-disable func-style *//* eslint-disable @typescript-eslint/no-empty-function *//* eslint-disable func-names *//* eslint-disable @typescript-eslint/no-explicit-any */import chroma from"chroma-js";import React,{useEffect,useRef,useState}from"react";import{renderNoDataFallback}from"./extra";import{CircleAlert}from"lucide-react";import{theme}from"@peak-ai/ais-components/theme";import Markdown from"markdown-to-jsx";import{Bar,BarChart,CartesianGrid,Legend,Line,LineChart,Pie,PieChart,ResponsiveContainer,XAxis,YAxis}from"recharts/lib";// @ts-ignore
2
- import*as domutil from"recharts/lib/util/DOMUtils";import{TooltipButton}from"../../shadcn/components/ui/button";import{Card,CardContent,CardDescription,CardFooter,CardHeader,CardTitle}from"../../shadcn/components/ui/card";import{ChartContainer,ChartTooltip,ChartTooltipContent}from"../../shadcn/components/ui/chart";import{renderFilter}from"../../shadcn/components/ui/filter";import{ScrollArea,ScrollBar}from"../../shadcn/components/ui/scroll-area";import{renderSearch}from"../../shadcn/components/ui/search";import{CardLoader,ChartLoader,MarkdownLoader,ErrorState}from"../../shadcn/components/ui/skeleton";import{Tabs,TabsContent,TabsList,TabsTrigger}from"../../shadcn/components/ui/tabs";import{cn}from"../../shadcn/utils";import{getAffectedComponentsWithLoader}from"../../helpers";import{DataTable}from"./data-table";// Monkey-patching the getOffset function to use iframe's window instead of global one
2
+ import*as domutil from"recharts/lib/util/DOMUtils";import{TooltipButton}from"../../shadcn/components/ui/button";import{Card,CardContent,CardDescription,CardFooter,CardHeader,CardTitle}from"../../shadcn/components/ui/card";import{ChartContainer,ChartTooltip,ChartTooltipContent}from"../../shadcn/components/ui/chart";import{renderFilter}from"../../shadcn/components/ui/filter";import{ScrollArea,ScrollBar}from"../../shadcn/components/ui/scroll-area";import{renderSearch}from"../../shadcn/components/ui/search";import{CardLoader,ChartLoader,MarkdownLoader}from"../../shadcn/components/ui/skeleton";import{Tabs,TabsContent,TabsList,TabsTrigger}from"../../shadcn/components/ui/tabs";import{cn}from"../../shadcn/utils";import{getAffectedComponentsWithLoader}from"../../helpers";import{DataTable}from"./data-table";import{ErrorWrapper}from"../../shadcn/components/ui/error-wrapper";// Monkey-patching the getOffset function to use iframe's window instead of global one
3
3
  // REMEMBER TO UDPATE THIS WHEN recharts IS UPGRADED
4
- // @ts-ignore - Force assignment to read-only property
5
- import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";Object.defineProperty(domutil,"getOffset",{value:function value(el){var html=el.ownerDocument.documentElement;var box={top:0,left:0};if(typeof el.getBoundingClientRect!=="undefined"){box=el.getBoundingClientRect()}var iframe=document.querySelector(".gjs-frame");var iframeWindow=iframe==null?void 0:iframe.contentWindow;return{top:box.top+iframeWindow.pageYOffset-html.clientTop,left:box.left+iframeWindow.pageXOffset-html.clientLeft}},writable:true,configurable:true});var baseColors=[[theme.colors.Blue_100,theme.colors.Blue_30],[theme.colors.Purpley_100,theme.colors.Purpley_30],[theme.colors.Light_Bluish_Green,"#06601b"],[theme.colors.Wild_Strawberry,"#4d001c"]];function getNColors(n){var colors=[];for(var _iterator=_createForOfIteratorHelperLoose(baseColors),_step;!(_step=_iterator()).done;){var baseColor=_step.value;// eslint-disable-next-line import/no-named-as-default-member
6
- colors.push(chroma.scale(baseColor).mode("lab").colors(n))}function getOneColor(existing){var color=null;do{var base=colors[Math.floor(Math.random()*colors.length)];var selectedColorIndex=Math.floor(Math.random()*base.length);color=base[selectedColorIndex]}while(existing.includes(color));return color}var selectedColors=[];for(var i=0;i<n;i++){selectedColors.push(getOneColor(selectedColors))}return selectedColors}export function renderActionCard(props){var gjsModel=props.gjsModel,rest=_objectWithoutPropertiesLoose(props,_excluded);var _useState=useState(_extends({},props,gjsModel.get("componentProps"))),allData=_useState[0],setAllData=_useState[1];var _allData$headerConten=allData.headerContent,headerContent=_allData$headerConten===void 0?"Default Action Card Title":_allData$headerConten,icon=allData.icon,_allData$bodyContent=allData.bodyContent,bodyContent=_allData$bodyContent===void 0?"Default body content. Click to edit.":_allData$bodyContent;var _useState2=useState(_extends({},gjsModel.get("attributes"))),attributes=_useState2[0],setAttributes=_useState2[1];useEffect(function(){var handlePropsChange=function handlePropsChange(){setAllData(_extends({},gjsModel.get("componentProps")))};gjsModel.on("change:componentProps",handlePropsChange);return function(){gjsModel.off("change:componentProps",handlePropsChange)}},[gjsModel]);useEffect(function(){var handleAttributesChange=function handleAttributesChange(){setAttributes(_extends({},gjsModel.get("attributes")))};gjsModel.on("change:attributes",handleAttributesChange);return function(){gjsModel.off("change:attributes",handleAttributesChange)}},[gjsModel]);var defaultClasses="bg-white text-black p-4 rounded-lg shadow border flex flex-col h-full";if(attributes.error){return/*#__PURE__*/_jsx(Card,_extends({className:defaultClasses,isEditable:false,contentEditable:false},rest,{children:/*#__PURE__*/_jsx(CardContent,{className:"p-0",isEditable:false,contentEditable:false,children:/*#__PURE__*/_jsx("div",{className:"px-4 py-3",children:/*#__PURE__*/_jsx(ErrorState,{errorMessage:attributes.errorMessage||"Failed to load action card content",variant:"default"})})})}))}if(attributes.loading){return/*#__PURE__*/_jsx(Card,_extends({className:defaultClasses,isEditable:false,contentEditable:false},rest,{children:/*#__PURE__*/_jsx(CardContent,{className:"p-0",isEditable:false,contentEditable:false,children:/*#__PURE__*/_jsx("div",{className:"px-4 py-3",children:/*#__PURE__*/_jsx(CardLoader,{})})})}))}return/*#__PURE__*/_jsx(Card,_extends({className:defaultClasses,isEditable:false,contentEditable:false},rest,{children:/*#__PURE__*/_jsx(CardContent,{className:"p-0",isEditable:false,contentEditable:false,children:/*#__PURE__*/_jsx("div",{className:"px-4 py-3",children:/*#__PURE__*/_jsxs("div",{className:"flex items-start",children:[/*#__PURE__*/_jsx("span",{className:"text-5xl mr-2","aria-hidden":"true",children:icon}),/*#__PURE__*/_jsxs("div",{className:"flex-1",children:[/*#__PURE__*/_jsx("div",{className:"text-xl font-semibold",children:headerContent}),!bodyContent?/*#__PURE__*/_jsxs("span",{className:"flex flex-row items-center px-3 py-2",children:[/*#__PURE__*/_jsx(CircleAlert,{className:"w-3 h-3 text-gray-400 mr-1"}),/*#__PURE__*/_jsx("p",{className:"text-sm text-gray-500 max-w-md text-center",children:"No data available for given filters"})]}):/*#__PURE__*/_jsx("div",{className:"text-base leading-relaxed mt-1",children:bodyContent})]})]})})})}))}export function renderCard(props){var _props$isEditable=props.isEditable,isEditable=_props$isEditable===void 0?false:_props$isEditable,gjsModel=props.gjsModel,rest=_objectWithoutPropertiesLoose(props,_excluded2);var _useState3=useState(_extends({},props,gjsModel.get("componentProps"))),allData=_useState3[0],setAllData=_useState3[1];var headerContent=allData.headerContent,headerDescription=allData.headerDescription,bodyContent=allData.bodyContent,footerContent=allData.footerContent,footerClass=allData.footerClass,footerIcon=allData.footerIcon,contentMetadata=allData.contentMetadata,contentMetadataClass=allData.contentMetadataClass,className=allData.className;var _useState4=useState(_extends({},gjsModel.get("attributes"))),attributes=_useState4[0],setAttributes=_useState4[1];useEffect(function(){var handlePropsChange=function handlePropsChange(){setAllData(_extends({},gjsModel.get("componentProps")))};gjsModel.on("change:componentProps",handlePropsChange);return function(){gjsModel.off("change:componentProps",handlePropsChange)}},[gjsModel]);useEffect(function(){var handleAttributesChange=function handleAttributesChange(){setAttributes(_extends({},gjsModel.get("attributes")))};gjsModel.on("change:attributes",handleAttributesChange);return function(){gjsModel.off("change:attributes",handleAttributesChange)}},[gjsModel]);var defaultClasses="bg-white text-black p-4 rounded-lg shadow border flex flex-col h-full";var defaultFooterClasses="text-sm";var defaultContentMetadataClasses="text-xs";var mergedCardClassName=className?cn(defaultClasses,className):defaultClasses;var mergedFooterClassName=footerClass?cn(defaultFooterClasses,footerClass):defaultFooterClasses;var mergedContentMetadataClassName=contentMetadataClass?cn(defaultContentMetadataClasses,contentMetadataClass):defaultContentMetadataClasses;function getCardContent(){if(attributes.error){return/*#__PURE__*/_jsx(CardContent,{children:/*#__PURE__*/_jsx(ErrorState,{errorMessage:attributes.errorMessage||"Failed to load card content",variant:"default"})})}if(attributes.interactionApiInProgress||attributes.loading){return/*#__PURE__*/_jsx(CardContent,{children:/*#__PURE__*/_jsx(CardLoader,{})})}return/*#__PURE__*/_jsxs(React.Fragment,{children:[/*#__PURE__*/_jsxs(CardHeader,{children:[/*#__PURE__*/_jsx(CardTitle,{"data-slot":"headerContent",contentEditable:isEditable,className:"text-lg",children:headerContent}),/*#__PURE__*/_jsx(CardDescription,{"data-slot":"headerDescription",contentEditable:isEditable,className:"text-sm",children:headerDescription})]}),!bodyContent?/*#__PURE__*/_jsxs("span",{className:"flex flex-row items-center px-3 py-2",children:[/*#__PURE__*/_jsx(CircleAlert,{className:"w-3 h-3 text-gray-400 mr-1"}),/*#__PURE__*/_jsx("p",{className:"text-sm text-gray-500 max-w-md text-center",children:"No data available for given filters"})]}):/*#__PURE__*/_jsxs(CardContent,{"data-slot":"bodyContent",contentEditable:false,className:"flex-grow",children:[/*#__PURE__*/_jsx("div",{className:"text-3xl font-semibold truncate",children:bodyContent}),contentMetadata&&/*#__PURE__*/_jsx("div",{className:mergedContentMetadataClassName,style:{color:"#2A44D4"},children:contentMetadata})]}),/*#__PURE__*/_jsxs(CardFooter,{"data-slot":"footerContent",contentEditable:isEditable,className:cn(mergedFooterClassName),children:[footerIcon&&/*#__PURE__*/_jsx("span",{className:"mr-2","aria-hidden":"true",children:footerIcon}),footerContent]})]})}return/*#__PURE__*/_jsx(Card,_extends({},rest,{className:mergedCardClassName,children:getCardContent()}))}function renderChartComponent(chartType,data,config){if(!data||data.length===0){return renderNoDataFallback()}switch(chartType){case"pie":return/*#__PURE__*/_jsxs(PieChart,{children:[data.length>=20&&/*#__PURE__*/_jsx(ChartTooltip,{cursor:false,content:/*#__PURE__*/_jsx(ChartTooltipContent,{hideLabel:true})}),/*#__PURE__*/_jsx(Pie,{data:data,dataKey:config.dataKey,nameKey:config.nameKey,innerRadius:60,strokeWidth:10,label:data.length<20?function(_ref){var name=_ref.name,percent=_ref.percent;return name+": "+(percent*100).toFixed(0)+"%"}:undefined,labelLine:false})]});case"bar":config.dataKeys=config.dataKeys||[];return/*#__PURE__*/_jsxs(BarChart,_extends({data:data},config.chartUi,{children:[/*#__PURE__*/_jsx(CartesianGrid,{vertical:false}),/*#__PURE__*/_jsx(XAxis,{dataKey:config.xAxis}),/*#__PURE__*/_jsx(YAxis,{}),/*#__PURE__*/_jsx(Legend,{align:"left",wrapperStyle:{marginLeft:20}}),config.dataKeys.map(function(_ref2){var key=_ref2.key,name=_ref2.name,color=_ref2.color;return/*#__PURE__*/_jsx(Bar,{dataKey:key,fill:color!=null?color:"#4caf50",name:name,radius:2},key)}),/*#__PURE__*/_jsx(ChartTooltip,{cursor:false,content:/*#__PURE__*/_jsx(ChartTooltipContent,{indicator:"dashed"})})]}));case"line":config.dataKeys=config.dataKeys||[];return/*#__PURE__*/_jsxs(LineChart,{data:data,children:[/*#__PURE__*/_jsx(CartesianGrid,{vertical:false}),/*#__PURE__*/_jsx(XAxis,{dataKey:config.xAxis}),/*#__PURE__*/_jsx(YAxis,{}),/*#__PURE__*/_jsx(ChartTooltip,{cursor:false,content:/*#__PURE__*/_jsx(ChartTooltipContent,{indicator:"dashed"})}),config.dataKeys.map(function(_ref3){var key=_ref3.key,name=_ref3.name,color=_ref3.color;return/*#__PURE__*/_jsx(Line,{type:"monotone",dataKey:key,stroke:color!=null?color:"#4caf50",name:name},key)}),/*#__PURE__*/_jsx(Legend,{align:"left"})]});default:return/*#__PURE__*/_jsxs(PieChart,{children:[data.length>=20&&/*#__PURE__*/_jsx(ChartTooltip,{cursor:false,content:/*#__PURE__*/_jsx(ChartTooltipContent,{hideLabel:true})}),/*#__PURE__*/_jsx(Pie,{data:data,dataKey:config.dataKey,nameKey:config.nameKey,innerRadius:60,strokeWidth:10,label:data.length<20?function(_ref4){var name=_ref4.name,percent=_ref4.percent;return name+": "+(percent*100).toFixed(0)+"%"}:undefined,labelLine:false})]})}}export function renderChart(props){var _props$isEditable2=props.isEditable,isEditable=_props$isEditable2===void 0?false:_props$isEditable2,gjsModel=props.gjsModel,rest=_objectWithoutPropertiesLoose(props,_excluded3);var _useState5=useState(_extends({},props,gjsModel.get("componentProps"))),allData=_useState5[0],setAllData=_useState5[1];var _useState6=useState(_extends({},gjsModel.get("attributes"))),attributes=_useState6[0],setAttributes=_useState6[1];var containerRef=useRef(null);var _useState7=useState(0),containerWidth=_useState7[0],setContainerWidth=_useState7[1];useEffect(function(){var handlePropsChange=function handlePropsChange(){setAllData(_extends({},gjsModel.get("componentProps")))};gjsModel.on("change:componentProps",handlePropsChange);return function(){gjsModel.off("change:componentProps",handlePropsChange)}},[gjsModel]);useEffect(function(){var handleAttributesChange=function handleAttributesChange(){setAttributes(_extends({},gjsModel.get("attributes")))};gjsModel.on("change:attributes",handleAttributesChange);return function(){gjsModel.off("change:attributes",handleAttributesChange)}},[gjsModel]);useEffect(function(){var updateContainerWidth=function updateContainerWidth(){if(containerRef.current){setContainerWidth(containerRef.current.offsetWidth)}};updateContainerWidth();window.addEventListener("resize",updateContainerWidth);return function(){return window.removeEventListener("resize",updateContainerWidth)}},[]);var _allData$config=allData.config,config=_allData$config===void 0?{}:_allData$config,_allData$chartType=allData.chartType,chartType=_allData$chartType===void 0?"pie":_allData$chartType,_allData$chartData=allData.chartData,chartData=_allData$chartData===void 0?[]:_allData$chartData,className=allData.className,_allData$title=allData.title,title=_allData$title===void 0?"Title":_allData$title,_allData$subTitle=allData.subTitle,subTitle=_allData$subTitle===void 0?"Subtitle":_allData$subTitle;var defaultClasses="aspect-auto h-[250px] w-full";var mergedClasses=className?cn(defaultClasses,className):defaultClasses;if(chartType==="pie"){var colors=getNColors(chartData.length);for(var i=0;i<chartData.length;i++){var data=chartData[i];if(!data.fill){data.fill=colors[i]}}}else if(!config.color){config.color=baseColors[Math.floor(Math.random()*baseColors.length)]}var width=undefined;var totalDataPoints=0;// Helper function to get responsive config
4
+ // @ts-ignore
5
+ import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";domutil.getOffset=function(el){var html=el.ownerDocument.documentElement;var box={top:0,left:0};if(typeof el.getBoundingClientRect!=="undefined"){box=el.getBoundingClientRect()}var iframe=document.querySelector(".gjs-frame");var iframeWindow=iframe==null?void 0:iframe.contentWindow;return{top:box.top+iframeWindow.pageYOffset-html.clientTop,left:box.left+iframeWindow.pageXOffset-html.clientLeft}};var baseColors=[[theme.colors.Blue_100,theme.colors.Blue_30],[theme.colors.Purpley_100,theme.colors.Purpley_30],[theme.colors.Light_Bluish_Green,"#06601b"],[theme.colors.Wild_Strawberry,"#4d001c"]];function getNColors(n){var colors=[];for(var _iterator=_createForOfIteratorHelperLoose(baseColors),_step;!(_step=_iterator()).done;){var baseColor=_step.value;// eslint-disable-next-line import/no-named-as-default-member
6
+ colors.push(chroma.scale(baseColor).mode("lab").colors(n))}function getOneColor(existing){var color=null;do{var base=colors[Math.floor(Math.random()*colors.length)];var selectedColorIndex=Math.floor(Math.random()*base.length);color=base[selectedColorIndex]}while(existing.includes(color));return color}var selectedColors=[];for(var i=0;i<n;i++){selectedColors.push(getOneColor(selectedColors))}return selectedColors}/* TODO: Loader remains */export function renderActionCard(props){var gjsModel=props.gjsModel,rest=_objectWithoutPropertiesLoose(props,_excluded);var _useState=useState(_extends({},props)),allData=_useState[0],setAllData=_useState[1];var _allData$headerConten=allData.headerContent,headerContent=_allData$headerConten===void 0?"Default Action Card Title":_allData$headerConten,icon=allData.icon,_allData$bodyContent=allData.bodyContent,bodyContent=_allData$bodyContent===void 0?"Default body content. Click to edit.":_allData$bodyContent;var _useState2=useState(_extends({},gjsModel.get("attributes"))),setAttributes=_useState2[1];useEffect(function(){gjsModel.on("change:componentProps",function(){setAllData(_extends({},gjsModel.get("componentProps")))})},[]);useEffect(function(){gjsModel.on("change:attributes",function(){setAttributes(_extends({},gjsModel.get("attributes")))})},[]);var defaultClasses="bg-white text-black p-4 rounded-lg shadow border flex flex-col h-full";return/*#__PURE__*/_jsx(Card,_extends({className:defaultClasses,isEditable:false,contentEditable:false},rest,{children:/*#__PURE__*/_jsx(CardContent,{className:"p-0",isEditable:false,contentEditable:false,children:/*#__PURE__*/_jsx("div",{className:"px-4 py-3",children:/*#__PURE__*/_jsxs("div",{className:"flex items-start",children:[/*#__PURE__*/_jsx("span",{className:"text-5xl mr-2","aria-hidden":"true",children:icon}),/*#__PURE__*/_jsxs("div",{className:"flex-1",children:[/*#__PURE__*/_jsx("div",{className:"text-xl font-semibold",children:headerContent}),!bodyContent?/*#__PURE__*/_jsxs("span",{className:"flex flex-row items-center px-3 py-2",children:[/*#__PURE__*/_jsx(CircleAlert,{className:"w-3 h-3 text-gray-400 mr-1"}),/*#__PURE__*/_jsx("p",{className:"text-sm text-gray-500 max-w-md text-center",children:"No data available for given filters"})]}):/*#__PURE__*/_jsx("div",{className:"text-base leading-relaxed mt-1",children:bodyContent})]})]})})})}))}export function renderCard(props){var _props$isEditable=props.isEditable,isEditable=_props$isEditable===void 0?false:_props$isEditable,gjsModel=props.gjsModel,rest=_objectWithoutPropertiesLoose(props,_excluded2);var _useState3=useState(_extends({},props)),allData=_useState3[0],setAllData=_useState3[1];var headerContent=allData.headerContent,headerDescription=allData.headerDescription,bodyContent=allData.bodyContent,footerContent=allData.footerContent,footerClass=allData.footerClass,footerIcon=allData.footerIcon,contentMetadata=allData.contentMetadata,contentMetadataClass=allData.contentMetadataClass,className=allData.className;var _useState4=useState(_extends({},gjsModel.get("attributes"))),attributes=_useState4[0],setAttributes=_useState4[1];useEffect(function(){gjsModel.on("change:componentProps",function(){setAllData(_extends({},gjsModel.get("componentProps")))})},[]);useEffect(function(){gjsModel.on("change:attributes",function(){setAttributes(_extends({},gjsModel.get("attributes")))})},[]);var defaultClasses="bg-white text-black p-4 rounded-lg shadow border flex flex-col h-full";var defaultFooterClasses="text-sm";var defaultContentMetadataClasses="text-xs";var mergedCardClassName=className?cn(defaultClasses,className):defaultClasses;var mergedFooterClassName=footerClass?cn(defaultFooterClasses,footerClass):defaultFooterClasses;var mergedContentMetadataClassName=contentMetadataClass?cn(defaultContentMetadataClasses,contentMetadataClass):defaultContentMetadataClasses;function getCardContent(){if(attributes.interactionApiInProgress||attributes.loading){return/*#__PURE__*/_jsx(CardContent,{children:/*#__PURE__*/_jsx(CardLoader,{})})}return/*#__PURE__*/_jsxs(React.Fragment,{children:[/*#__PURE__*/_jsxs(CardHeader,{children:[/*#__PURE__*/_jsx(CardTitle,{"data-slot":"headerContent",contentEditable:isEditable,className:"text-lg",children:headerContent}),/*#__PURE__*/_jsx(CardDescription,{"data-slot":"headerDescription",contentEditable:isEditable,className:"text-sm",children:headerDescription})]}),!bodyContent?/*#__PURE__*/_jsxs("span",{className:"flex flex-row items-center px-3 py-2",children:[/*#__PURE__*/_jsx(CircleAlert,{className:"w-3 h-3 text-gray-400 mr-1"}),/*#__PURE__*/_jsx("p",{className:"text-sm text-gray-500 max-w-md text-center",children:"No data available for given filters"})]}):/*#__PURE__*/_jsxs(CardContent,{"data-slot":"bodyContent",contentEditable:false,className:"flex-grow",children:[/*#__PURE__*/_jsx("div",{className:"text-3xl font-semibold truncate",children:bodyContent}),contentMetadata&&/*#__PURE__*/_jsx("div",{className:mergedContentMetadataClassName,style:{color:"#2A44D4"},children:contentMetadata})]}),/*#__PURE__*/_jsxs(CardFooter,{"data-slot":"footerContent",contentEditable:isEditable,className:cn(mergedFooterClassName),children:[footerIcon&&/*#__PURE__*/_jsx("span",{className:"mr-2","aria-hidden":"true",children:footerIcon}),footerContent]})]})}return/*#__PURE__*/_jsx(Card,_extends({},rest,{className:mergedCardClassName,children:getCardContent()}))}function renderChartComponent(chartType,data,config){if(!data||data.length===0){return renderNoDataFallback()}switch(chartType){case"pie":return/*#__PURE__*/_jsxs(PieChart,{children:[data.length>=20&&/*#__PURE__*/_jsx(ChartTooltip,{cursor:false,content:/*#__PURE__*/_jsx(ChartTooltipContent,{hideLabel:true})}),/*#__PURE__*/_jsx(Pie,{data:data,dataKey:config.dataKey,nameKey:config.nameKey,innerRadius:60,strokeWidth:10,label:data.length<20?function(_ref){var name=_ref.name,percent=_ref.percent;return name+": "+(percent*100).toFixed(0)+"%"}:undefined,labelLine:false})]});case"bar":config.dataKeys=config.dataKeys||[];return/*#__PURE__*/_jsxs(BarChart,_extends({data:data},config.chartUi,{children:[/*#__PURE__*/_jsx(CartesianGrid,{vertical:false}),/*#__PURE__*/_jsx(XAxis,{dataKey:config.xAxis}),/*#__PURE__*/_jsx(YAxis,{}),/*#__PURE__*/_jsx(Legend,{align:"left",wrapperStyle:{marginLeft:20}}),config.dataKeys.map(function(_ref2){var key=_ref2.key,name=_ref2.name,color=_ref2.color;return/*#__PURE__*/_jsx(Bar,{dataKey:key,fill:color!=null?color:"#4caf50",name:name,radius:2},key)}),/*#__PURE__*/_jsx(ChartTooltip,{cursor:false,content:/*#__PURE__*/_jsx(ChartTooltipContent,{indicator:"dashed"})})]}));case"line":config.dataKeys=config.dataKeys||[];return/*#__PURE__*/_jsxs(LineChart,{data:data,children:[/*#__PURE__*/_jsx(CartesianGrid,{vertical:false}),/*#__PURE__*/_jsx(XAxis,{dataKey:config.xAxis}),/*#__PURE__*/_jsx(YAxis,{}),/*#__PURE__*/_jsx(ChartTooltip,{cursor:false,content:/*#__PURE__*/_jsx(ChartTooltipContent,{indicator:"dashed"})}),config.dataKeys.map(function(_ref3){var key=_ref3.key,name=_ref3.name,color=_ref3.color;return/*#__PURE__*/_jsx(Line,{type:"monotone",dataKey:key,stroke:color!=null?color:"#4caf50",name:name},key)}),/*#__PURE__*/_jsx(Legend,{align:"left"})]});default:return/*#__PURE__*/_jsxs(PieChart,{children:[data.length>=20&&/*#__PURE__*/_jsx(ChartTooltip,{cursor:false,content:/*#__PURE__*/_jsx(ChartTooltipContent,{hideLabel:true})}),/*#__PURE__*/_jsx(Pie,{data:data,dataKey:config.dataKey,nameKey:config.nameKey,innerRadius:60,strokeWidth:10,label:data.length<20?function(_ref4){var name=_ref4.name,percent=_ref4.percent;return name+": "+(percent*100).toFixed(0)+"%"}:undefined,labelLine:false})]})}}export function renderChart(props){var _props$isEditable2=props.isEditable,isEditable=_props$isEditable2===void 0?false:_props$isEditable2,gjsModel=props.gjsModel,rest=_objectWithoutPropertiesLoose(props,_excluded3);var _useState5=useState(_extends({},props)),allData=_useState5[0],setAllData=_useState5[1];var _useState6=useState(_extends({},gjsModel.get("attributes"))),attributes=_useState6[0],setAttributes=_useState6[1];var containerRef=useRef(null);var _useState7=useState(0),containerWidth=_useState7[0],setContainerWidth=_useState7[1];useEffect(function(){gjsModel.on("change:componentProps",function(){setAllData(_extends({},gjsModel.get("componentProps")))})},[]);useEffect(function(){gjsModel.on("change:attributes",function(){setAttributes(_extends({},gjsModel.get("attributes")))})},[]);useEffect(function(){var updateContainerWidth=function updateContainerWidth(){if(containerRef.current){setContainerWidth(containerRef.current.offsetWidth)}};updateContainerWidth();window.addEventListener("resize",updateContainerWidth);return function(){return window.removeEventListener("resize",updateContainerWidth)}},[]);var _allData$config=allData.config,config=_allData$config===void 0?{}:_allData$config,_allData$chartType=allData.chartType,chartType=_allData$chartType===void 0?"pie":_allData$chartType,_allData$chartData=allData.chartData,chartData=_allData$chartData===void 0?[]:_allData$chartData,className=allData.className,_allData$title=allData.title,title=_allData$title===void 0?"Title":_allData$title,_allData$subTitle=allData.subTitle,subTitle=_allData$subTitle===void 0?"Subtitle":_allData$subTitle;var defaultClasses="aspect-auto h-[250px] w-full";var mergedClasses=className?cn(defaultClasses,className):defaultClasses;if(chartType==="pie"){var colors=getNColors(chartData.length);for(var i=0;i<chartData.length;i++){var data=chartData[i];if(!data.fill){data.fill=colors[i]}}}else if(!config.color){config.color=baseColors[Math.floor(Math.random()*baseColors.length)]}var width=undefined;var totalDataPoints=0;// Helper function to get responsive config
7
7
  var getResponsiveConfig=function getResponsiveConfig(){if(chartType==="bar"&&totalDataPoints>15&&containerWidth>0&&width&&width<=containerWidth){// If chart fits in container, use responsive behavior
8
- return _extends({},config,{chartUi:{}})}return config};if(chartType==="bar"){totalDataPoints=chartData.length*config.dataKeys.length;if(totalDataPoints>15){width=totalDataPoints*20+config.dataKeys.length*8*chartData.length+chartData.length*15;config.chartUi={barCategoryGap:"10%",width:width}}else{config.chartUi={}}}var chartUi=attributes.error?/*#__PURE__*/_jsx(ErrorState,{errorMessage:attributes.errorMessage||"Failed to load chart data",variant:"default"}):attributes.interactionApiInProgress||attributes.loading?/*#__PURE__*/_jsx(ChartLoader,{}):!chartData?renderNoDataFallback():/*#__PURE__*/_jsx(React.Fragment,{children:chartType==="bar"&&totalDataPoints>15&&config.chartUi&&width&&(containerWidth===0||width>containerWidth)?/*#__PURE__*/_jsx("div",{className:"w-full",children:/*#__PURE__*/_jsxs(ScrollArea,{className:"w-full",children:[/*#__PURE__*/_jsx("div",{style:{minWidth:width+"px",width:"max-content"},children:/*#__PURE__*/_jsx(ResponsiveContainer,{width:width,height:250,children:/*#__PURE__*/_jsx(ChartContainer,_extends({},rest,{config:config,className:mergedClasses,children:renderChartComponent(chartType,chartData,config)}))})}),/*#__PURE__*/_jsx(ScrollBar,{orientation:"horizontal"})]})}):/*#__PURE__*/_jsx(ResponsiveContainer,{width:"100%",height:250,children:/*#__PURE__*/_jsx(ChartContainer,_extends({},rest,{config:getResponsiveConfig(),className:mergedClasses,children:renderChartComponent(chartType,chartData,getResponsiveConfig())}))})});return/*#__PURE__*/_jsxs(Card,{className:"shadow border mt-2 mb-2",children:[/*#__PURE__*/_jsxs(CardHeader,{children:[/*#__PURE__*/_jsx(CardTitle,{"data-slot":"title",contentEditable:isEditable,className:"text-2xl",children:title}),/*#__PURE__*/_jsx(CardDescription,{"data-slot":"subTitle",contentEditable:isEditable,className:"text-sm",children:subTitle})]}),/*#__PURE__*/_jsx(CardContent,{ref:containerRef,"data-slot":"bodyContent",contentEditable:false,className:"px-6",children:chartUi})]})}export function renderTable(props){var gjsModel=props.gjsModel,_props$performInterac=props.performInteraction,performInteraction=_props$performInterac===void 0?function(){}:_props$performInterac,rest=_objectWithoutPropertiesLoose(props,_excluded4);var _useState8=useState(_extends({},props,gjsModel.get("componentProps"))),allData=_useState8[0],setAllData=_useState8[1];var cardRef=useRef(null);var _useState9=useState(_extends({},gjsModel.get("attributes"))),attributes=_useState9[0],setAttributes=_useState9[1];var _allData$data=allData.data,data=_allData$data===void 0?[]:_allData$data,_allData$headerMapper=allData.headerMapper,rawHeaderMapper=_allData$headerMapper===void 0?{}:_allData$headerMapper,className=allData.className,_allData$isEditable=allData.isEditable,isEditable=_allData$isEditable===void 0?false:_allData$isEditable,_allData$title2=allData.title,title=_allData$title2===void 0?"Title":_allData$title2,_allData$subTitle2=allData.subTitle,subTitle=_allData$subTitle2===void 0?"Subtitle":_allData$subTitle2,_allData$actions=allData.actions,actions=_allData$actions===void 0?[]:_allData$actions,pagination=allData.pagination;var headerMapper=function(){var cleaned=_extends({},rawHeaderMapper);if("id"in cleaned){delete cleaned.id}if(data.length>0){var dataKeys=Object.keys(data[0]||{});return Object.fromEntries(Object.entries(cleaned).filter(function(_ref5){var key=_ref5[0];return dataKeys.includes(key)}))}return cleaned}();var sortConfig=function(_gjsModel$get,_ref7){var _ref6=(_gjsModel$get=gjsModel.get("componentProps"))!=null?_gjsModel$get:{},sortColumn=_ref6.sortColumn,sortDirection=_ref6.sortDirection;return sortColumn&&sortDirection?(_ref7={},_ref7[sortColumn]=sortDirection,_ref7):{}}();useEffect(function(){var handlePropsChange=function handlePropsChange(){setAllData(_extends({},gjsModel.get("componentProps")))};gjsModel.on("change:componentProps",handlePropsChange);return function(){gjsModel.off("change:componentProps",handlePropsChange)}},[gjsModel]);useEffect(function(){var handleAttributesChange=function handleAttributesChange(){setAttributes(_extends({},gjsModel.get("attributes")))};gjsModel.on("change:attributes",handleAttributesChange);return function(){gjsModel.off("change:attributes",handleAttributesChange)}},[gjsModel]);var parsedData=function(){if(typeof data==="object"&&data!==null&&data.name==="__peak_placeholder"){return[]}if(!Array.isArray(data)){return[]}return data.map(function(datum){var newData=_extends({},datum);delete newData.id;return newData})}();function onRowAction(_x,_x2){return _onRowAction.apply(this,arguments)}function _onRowAction(){_onRowAction=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(rowIndex,actionId){var id;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:id=gjsModel.get("id");_context.next=3;return performInteraction({id:actionId,interactionType:"tableButton",payload:{row:data[rowIndex],tableId:id},affectedComponents:[]});case 3:case"end":return _context.stop()}},_callee)}));return _onRowAction.apply(this,arguments)}function onPageChange(_x3,_x4){return _onPageChange.apply(this,arguments)}function _onPageChange(){_onPageChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(pageNumber,pageSize){var _gjsModel$get2;var id,_ref8,sortColumn,sortDirection;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:id=gjsModel.get("id");_ref8=(_gjsModel$get2=gjsModel.get("componentProps"))!=null?_gjsModel$get2:{},sortColumn=_ref8.sortColumn,sortDirection=_ref8.sortDirection;_context2.next=4;return performInteraction({id:id,interactionType:"pagination",payload:_extends({pageNumber:pageNumber,pageSize:pageSize},sortColumn&&sortDirection&&{sortColumn:sortColumn,sortDirection:sortDirection}),affectedComponents:getAffectedComponentsWithLoader([id],true)});case 4:case"end":return _context2.stop()}},_callee2)}));return _onPageChange.apply(this,arguments)}function handleSort(_x5,_x6){return _handleSort.apply(this,arguments)}function _handleSort(){_handleSort=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(column,direction){var currentProps,id;return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:currentProps=gjsModel.get("componentProps");id=gjsModel.get("id");gjsModel.set("componentProps",_extends({},currentProps,{sortColumn:direction?column:null,sortDirection:direction}));_context3.next=5;return performInteraction({id:id,interactionType:"tableSort",payload:{sortColumn:direction?column:null,sortDirection:direction,tableId:id},affectedComponents:getAffectedComponentsWithLoader([id],true)});case 5:case"end":return _context3.stop()}},_callee3)}));return _handleSort.apply(this,arguments)}return/*#__PURE__*/_jsxs(Card,{ref:cardRef,className:"shadow border","data-component-type":"table",children:[/*#__PURE__*/_jsxs(CardHeader,{children:[/*#__PURE__*/_jsx(CardTitle,{"data-slot":"title",contentEditable:isEditable,className:"text-2xl",children:title}),/*#__PURE__*/_jsx(CardDescription,{"data-slot":"subTitle",contentEditable:isEditable,className:"text-sm",children:subTitle})]}),/*#__PURE__*/_jsx(CardContent,{"data-slot":"bodyContent",contentEditable:false,children:attributes.error?/*#__PURE__*/_jsx(ErrorState,{errorMessage:attributes.errorMessage||"Failed to load table data",variant:"default"}):/*#__PURE__*/_jsx(DataTable,{data:parsedData,headerMapper:headerMapper,className:className,isEditable:isEditable,actions:actions,pagination:pagination,isLoading:attributes.interactionApiInProgress,onRowAction:onRowAction,onPageChange:onPageChange,onSort:handleSort,sortConfig:sortConfig,otherProps:rest})})]})}export function renderTab(props){var tabsWidth=200;if(props.tabs.length>4){tabsWidth=150}return/*#__PURE__*/_jsxs(Tabs,{defaultValue:props.defaultValue,children:[/*#__PURE__*/_jsx("div",{className:"text-center mb-4",children:/*#__PURE__*/_jsx(TabsList,{className:"bg-gray-300",children:props.tabs.map(function(tab){return/*#__PURE__*/_jsx(TabsTrigger,{value:tab,className:"text-md w-["+tabsWidth+"px]",children:tab},tab)})})}),props.tabs.map(function(tab){return/*#__PURE__*/_jsx(TabsContent,{value:tab,className:"tabs-content"},tab)})]})}export function renderMarkdown(props){var gjsModel=props.gjsModel,rest=_objectWithoutPropertiesLoose(props,_excluded5);var _useState10=useState(_extends({},props,gjsModel.get("componentProps"))),allData=_useState10[0],setAllData=_useState10[1];var _useState11=useState(_extends({},gjsModel.get("attributes"))),attributes=_useState11[0],setAttributes=_useState11[1];useEffect(function(){var handlePropsChange=function handlePropsChange(){setAllData(_extends({},gjsModel.get("componentProps")))};gjsModel.on("change:componentProps",handlePropsChange);return function(){gjsModel.off("change:componentProps",handlePropsChange)}},[gjsModel]);useEffect(function(){var handleAttributesChange=function handleAttributesChange(){setAttributes(_extends({},gjsModel.get("attributes")))};gjsModel.on("change:attributes",handleAttributesChange);return function(){gjsModel.off("change:attributes",handleAttributesChange)}},[gjsModel]);var _useState12=useState(false),isEditing=_useState12[0],setIsEditing=_useState12[1];var editRef=useRef(null);var startEditing=function startEditing(){setIsEditing(true);setTimeout(function(){setupEditor()},0)};var setupEditor=function setupEditor(){if(!editRef.current){return}var editor=editRef.current;editor.innerHTML="";editor.textContent=allData.summaryText;editor.focus()};// Save changes and exit editing mode
9
- var saveChanges=function saveChanges(){if(!editRef.current){return}var content=editRef.current.innerText||"";var newProps=_extends({},gjsModel.get("componentProps"),{summaryText:content});// Update the gjsModel which will trigger the useEffect to update local state
10
- gjsModel.set("componentProps",newProps);setIsEditing(false);editRef.current.innerHTML=""};var markdownStyles={ul:{props:{className:"list-disc"}},h1:{props:{className:"text-4xl font-bold leading-[4rem]"}},h2:{props:{className:"text-3xl font-bold leading-[3rem]"}},h3:{props:{className:"text-2xl font-bold leading-[2rem]"}},h4:{props:{className:"text-xl font-bold leading-[2.5rem]"}},h5:{props:{className:"text-lg font-bold leading-[2.5rem]"}},h6:{props:{className:"text-base font-bold leading-[2rem]"}}};if(attributes.error){return/*#__PURE__*/_jsx("div",_extends({className:"px-[1em]"},rest,{children:/*#__PURE__*/_jsx(ErrorState,{errorMessage:attributes.errorMessage||"Failed to load markdown content",variant:"default"})}))}if(attributes.loading){return/*#__PURE__*/_jsx(MarkdownLoader,{})}if(!allData.isEditable){return/*#__PURE__*/_jsx("div",_extends({className:"px-[1em]"},rest,{children:/*#__PURE__*/_jsx("div",{"data-slot":"summaryText",children:/*#__PURE__*/_jsx(Markdown,{options:{overrides:markdownStyles},children:allData.summaryText||""})})}))}return/*#__PURE__*/_jsx("div",_extends({className:"p-[1em]"},rest,{children:isEditing?/*#__PURE__*/_jsx("div",{ref:editRef,contentEditable:true,onBlur:saveChanges,"data-slot":"summaryText",className:"p-2 min-h-[100px] whitespace-pre-wrap",suppressContentEditableWarning:true,style:{whiteSpace:"pre-wrap",wordWrap:"break-word"}}):/*#__PURE__*/_jsx("div",{onClick:startEditing,"data-slot":"summaryText",style:{whiteSpace:"pre-wrap",wordWrap:"break-word"},children:/*#__PURE__*/_jsx(Markdown,{options:{overrides:markdownStyles},children:allData.summaryText||""})})}))}export function renderButton(props){var _props$isEditable3=props.isEditable,isEditable=_props$isEditable3===void 0?false:_props$isEditable3,gjsModel=props.gjsModel,_props$performInterac2=props.performInteraction,performInteraction=_props$performInterac2===void 0?function(){}:_props$performInterac2;var _useState13=useState(_extends({},props,gjsModel.get("componentProps"))),allData=_useState13[0],setAllData=_useState13[1];var _useState14=useState(_extends({},gjsModel.get("attributes"))),attributes=_useState14[0],setAttributes=_useState14[1];useEffect(function(){var handlePropsChange=function handlePropsChange(){setAllData(_extends({},gjsModel.get("componentProps")))};gjsModel.on("change:componentProps",handlePropsChange);return function(){gjsModel.off("change:componentProps",handlePropsChange)}},[gjsModel]);useEffect(function(){var handleAttributesChange=function handleAttributesChange(){setAttributes(_extends({},gjsModel.get("attributes")))};gjsModel.on("change:attributes",handleAttributesChange);return function(){gjsModel.off("change:attributes",handleAttributesChange)}},[gjsModel]);var text=allData.text,className=allData.className,payload=allData.payload,_allData$variant=allData.variant,variant=_allData$variant===void 0?"default":_allData$variant,_allData$size=allData.size,size=_allData$size===void 0?"sm":_allData$size,affectedComponents=allData.affectedComponents,tooltipContent=allData.tooltipContent;function interact(){var id=gjsModel.get("id");performInteraction({id:id,interactionType:"button",affectedComponents:getAffectedComponentsWithLoader([id].concat(affectedComponents),true),payload:payload})}if(attributes.error){return/*#__PURE__*/_jsx("div",{className:"inline-flex",children:/*#__PURE__*/_jsx(ErrorState,{errorMessage:attributes.errorMessage||"Button error",variant:"minimal"})})}return/*#__PURE__*/_jsx(TooltipButton,{className:className,isEditable:isEditable,interact:interact,attributes:attributes,variant:variant,size:size,text:text,tooltipContent:tooltipContent})}export function getRenderers(){return{ActionCard:renderActionCard,Button:renderButton,Card:renderCard,Chart:renderChart,Filter:renderFilter,Markdown:renderMarkdown,Search:renderSearch,Table:renderTable,Tabs:renderTab}}
8
+ return _extends({},config,{chartUi:{}})}return config};if(chartType==="bar"){totalDataPoints=chartData.length*config.dataKeys.length;if(totalDataPoints>15){width=totalDataPoints*20+config.dataKeys.length*8*chartData.length+chartData.length*15;config.chartUi={barCategoryGap:"10%",width:width}}else{config.chartUi={}}}var chartUi=attributes.interactionApiInProgress||attributes.loading?/*#__PURE__*/_jsx(ChartLoader,{}):!chartData?renderNoDataFallback():/*#__PURE__*/_jsx(React.Fragment,{children:chartType==="bar"&&totalDataPoints>15&&config.chartUi&&width&&(containerWidth===0||width>containerWidth)?/*#__PURE__*/_jsx("div",{className:"w-full",children:/*#__PURE__*/_jsxs(ScrollArea,{className:"w-full",children:[/*#__PURE__*/_jsx("div",{style:{minWidth:width+"px",width:"max-content"},children:/*#__PURE__*/_jsx(ResponsiveContainer,{width:width,height:250,children:/*#__PURE__*/_jsx(ChartContainer,_extends({},rest,{config:config,className:mergedClasses,children:renderChartComponent(chartType,chartData,config)}))})}),/*#__PURE__*/_jsx(ScrollBar,{orientation:"horizontal"})]})}):/*#__PURE__*/_jsx(ResponsiveContainer,{width:"100%",height:250,children:/*#__PURE__*/_jsx(ChartContainer,_extends({},rest,{config:getResponsiveConfig(),className:mergedClasses,children:renderChartComponent(chartType,chartData,getResponsiveConfig())}))})});return/*#__PURE__*/_jsxs(Card,{className:"shadow border mt-2 mb-2",children:[/*#__PURE__*/_jsxs(CardHeader,{children:[/*#__PURE__*/_jsx(CardTitle,{"data-slot":"title",contentEditable:isEditable,className:"text-2xl",children:title}),/*#__PURE__*/_jsx(CardDescription,{"data-slot":"subTitle",contentEditable:isEditable,className:"text-sm",children:subTitle})]}),/*#__PURE__*/_jsx(CardContent,{ref:containerRef,"data-slot":"bodyContent",contentEditable:false,className:"px-6",children:chartUi})]})}export function renderTable(props){var gjsModel=props.gjsModel,_props$performInterac=props.performInteraction,performInteraction=_props$performInterac===void 0?function(){}:_props$performInterac,rest=_objectWithoutPropertiesLoose(props,_excluded4);var _useState8=useState(_extends({},props)),allData=_useState8[0],setAllData=_useState8[1];var cardRef=useRef(null);var _useState9=useState(_extends({},gjsModel.get("attributes"))),attributes=_useState9[0],setAttributes=_useState9[1];var _allData$data=allData.data,data=_allData$data===void 0?[]:_allData$data,_allData$headerMapper=allData.headerMapper,rawHeaderMapper=_allData$headerMapper===void 0?{}:_allData$headerMapper,className=allData.className,_allData$isEditable=allData.isEditable,isEditable=_allData$isEditable===void 0?false:_allData$isEditable,_allData$title2=allData.title,title=_allData$title2===void 0?"Title":_allData$title2,_allData$subTitle2=allData.subTitle,subTitle=_allData$subTitle2===void 0?"Subtitle":_allData$subTitle2,_allData$actions=allData.actions,actions=_allData$actions===void 0?[]:_allData$actions,pagination=allData.pagination;var headerMapper=function(){var cleaned=_extends({},rawHeaderMapper);if("id"in cleaned){delete cleaned.id}if(data.length>0){var dataKeys=Object.keys(data[0]||{});return Object.fromEntries(Object.entries(cleaned).filter(function(_ref5){var key=_ref5[0];return dataKeys.includes(key)}))}return cleaned}();var sortConfig=function(_gjsModel$get,_ref7){var _ref6=(_gjsModel$get=gjsModel.get("componentProps"))!=null?_gjsModel$get:{},sortColumn=_ref6.sortColumn,sortDirection=_ref6.sortDirection;return sortColumn&&sortDirection?(_ref7={},_ref7[sortColumn]=sortDirection,_ref7):{}}();useEffect(function(){gjsModel.on("change:componentProps",function(){setAllData(_extends({},gjsModel.get("componentProps")))})},[]);useEffect(function(){gjsModel.on("change:attributes",function(){setAttributes(_extends({},gjsModel.get("attributes")))})},[]);var parsedData=function(){if(typeof data==="object"&&data!==null&&data.name==="__peak_placeholder"){return[]}if(!Array.isArray(data)){return[]}return data.map(function(datum){var newData=_extends({},datum);delete newData.id;return newData})}();function onRowAction(_x,_x2){return _onRowAction.apply(this,arguments)}function _onRowAction(){_onRowAction=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(rowIndex,actionId){var id;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:id=gjsModel.get("id");_context.next=3;return performInteraction({id:actionId,interactionType:"tableButton",payload:{row:data[rowIndex],tableId:id},affectedComponents:[]});case 3:case"end":return _context.stop()}},_callee)}));return _onRowAction.apply(this,arguments)}function onPageChange(_x3,_x4){return _onPageChange.apply(this,arguments)}function _onPageChange(){_onPageChange=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(pageNumber,pageSize){var _gjsModel$get2;var id,_ref8,sortColumn,sortDirection;return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:id=gjsModel.get("id");_ref8=(_gjsModel$get2=gjsModel.get("componentProps"))!=null?_gjsModel$get2:{},sortColumn=_ref8.sortColumn,sortDirection=_ref8.sortDirection;_context2.next=4;return performInteraction({id:id,interactionType:"pagination",payload:_extends({pageNumber:pageNumber,pageSize:pageSize},sortColumn&&sortDirection&&{sortColumn:sortColumn,sortDirection:sortDirection}),affectedComponents:getAffectedComponentsWithLoader([id],true)});case 4:case"end":return _context2.stop()}},_callee2)}));return _onPageChange.apply(this,arguments)}function handleSort(_x5,_x6){return _handleSort.apply(this,arguments)}function _handleSort(){_handleSort=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(column,direction){var currentProps,id;return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:currentProps=gjsModel.get("componentProps");id=gjsModel.get("id");gjsModel.set("componentProps",_extends({},currentProps,{sortColumn:direction?column:null,sortDirection:direction}));_context3.next=5;return performInteraction({id:id,interactionType:"tableSort",payload:{sortColumn:direction?column:null,sortDirection:direction,tableId:id},affectedComponents:getAffectedComponentsWithLoader([id],true)});case 5:case"end":return _context3.stop()}},_callee3)}));return _handleSort.apply(this,arguments)}return/*#__PURE__*/_jsxs(Card,{ref:cardRef,className:"shadow border","data-component-type":"table",children:[/*#__PURE__*/_jsxs(CardHeader,{children:[/*#__PURE__*/_jsx(CardTitle,{"data-slot":"title",contentEditable:isEditable,className:"text-2xl",children:title}),/*#__PURE__*/_jsx(CardDescription,{"data-slot":"subTitle",contentEditable:isEditable,className:"text-sm",children:subTitle})]}),/*#__PURE__*/_jsx(CardContent,{"data-slot":"bodyContent",contentEditable:false,children:/*#__PURE__*/_jsx(DataTable,{data:parsedData,headerMapper:headerMapper,className:className,isEditable:isEditable,actions:actions,pagination:pagination,isLoading:attributes.interactionApiInProgress,onRowAction:onRowAction,onPageChange:onPageChange,onSort:handleSort,sortConfig:sortConfig,otherProps:rest})})]})}export function renderTab(props){var tabsWidth=200;if(props.tabs.length>4){tabsWidth=150}return/*#__PURE__*/_jsxs(Tabs,{defaultValue:props.defaultValue,children:[/*#__PURE__*/_jsx("div",{className:"text-center mb-4",children:/*#__PURE__*/_jsx(TabsList,{className:"bg-gray-300",children:props.tabs.map(function(tab){return/*#__PURE__*/_jsx(TabsTrigger,{value:tab,className:"text-md w-["+tabsWidth+"px]",children:tab},tab)})})}),props.tabs.map(function(tab){return/*#__PURE__*/_jsx(TabsContent,{value:tab,className:"tabs-content"},tab)})]})}export function renderMarkdown(props){var gjsModel=props.gjsModel,rest=_objectWithoutPropertiesLoose(props,_excluded5);var _useState10=useState(_extends({},props)),allData=_useState10[0],setAllData=_useState10[1];var _useState11=useState(_extends({},gjsModel.get("attributes"))),attributes=_useState11[0],setAttributes=_useState11[1];useEffect(function(){gjsModel.on("change:componentProps",function(){setAllData(_extends({},gjsModel.get("componentProps")))})},[]);useEffect(function(){gjsModel.on("change:attributes",function(){setAttributes(_extends({},gjsModel.get("attributes")))})},[]);var _useState12=useState(false),isEditing=_useState12[0],setIsEditing=_useState12[1];var editRef=useRef(null);var startEditing=function startEditing(){setIsEditing(true);setTimeout(function(){setupEditor()},0)};var setupEditor=function setupEditor(){if(!editRef.current){return}var editor=editRef.current;editor.innerHTML="";editor.textContent=allData.summaryText;editor.focus()};// Save changes and exit editing mode
9
+ var saveChanges=function saveChanges(){if(!editRef.current){return}var content=editRef.current.innerText||"";setAllData(function(prev){return _extends({},prev,{summaryText:content})});setIsEditing(false);editRef.current.innerHTML=""};var markdownStyles={ul:{props:{className:"list-disc"}},h1:{props:{className:"text-4xl font-bold leading-[4rem]"}},h2:{props:{className:"text-3xl font-bold leading-[3rem]"}},h3:{props:{className:"text-2xl font-bold leading-[2rem]"}},h4:{props:{className:"text-xl font-bold leading-[2.5rem]"}},h5:{props:{className:"text-lg font-bold leading-[2.5rem]"}},h6:{props:{className:"text-base font-bold leading-[2rem]"}}};if(attributes.loading){return/*#__PURE__*/_jsx(MarkdownLoader,{})}if(!allData.isEditable){return/*#__PURE__*/_jsx("div",_extends({className:"px-[1em]"},rest,{children:/*#__PURE__*/_jsx("div",{"data-slot":"summaryText",children:/*#__PURE__*/_jsx(Markdown,{options:{overrides:markdownStyles},children:allData.summaryText})})}))}return/*#__PURE__*/_jsx("div",_extends({className:"p-[1em]"},rest,{children:isEditing?/*#__PURE__*/_jsx("div",{ref:editRef,contentEditable:true,onBlur:saveChanges,"data-slot":"summaryText",className:"p-2 min-h-[100px] whitespace-pre-wrap",suppressContentEditableWarning:true,style:{whiteSpace:"pre-wrap",wordWrap:"break-word"}}):/*#__PURE__*/_jsx("div",{onClick:startEditing,"data-slot":"summaryText",style:{whiteSpace:"pre-wrap",wordWrap:"break-word"},children:/*#__PURE__*/_jsx(Markdown,{options:{overrides:markdownStyles},children:allData.summaryText})})}))}export function renderButton(props){var _props$isEditable3=props.isEditable,isEditable=_props$isEditable3===void 0?false:_props$isEditable3,gjsModel=props.gjsModel,_props$performInterac2=props.performInteraction,performInteraction=_props$performInterac2===void 0?function(){}:_props$performInterac2;var _useState13=useState(_extends({},props)),allData=_useState13[0],setAllData=_useState13[1];var _useState14=useState(_extends({},gjsModel.get("attributes"))),attributes=_useState14[0],setAttributes=_useState14[1];useEffect(function(){gjsModel.on("change:componentProps",function(){setAllData(_extends({},gjsModel.get("componentProps")))})},[]);useEffect(function(){gjsModel.on("change:attributes",function(){setAttributes(_extends({},gjsModel.get("attributes")))})},[]);var text=allData.text,className=allData.className,payload=allData.payload,_allData$variant=allData.variant,variant=_allData$variant===void 0?"default":_allData$variant,_allData$size=allData.size,size=_allData$size===void 0?"sm":_allData$size,affectedComponents=allData.affectedComponents,tooltipContent=allData.tooltipContent;function interact(){var id=gjsModel.get("id");performInteraction({id:id,interactionType:"button",affectedComponents:getAffectedComponentsWithLoader([id].concat(affectedComponents),true),payload:payload})}return/*#__PURE__*/_jsx(TooltipButton,{className:className,isEditable:isEditable,interact:interact,attributes:attributes,variant:variant,size:size,text:text,tooltipContent:tooltipContent})}var renderActionCardWithError=function renderActionCardWithError(props){return/*#__PURE__*/_jsx(ErrorWrapper,{componentProps:props,children:renderActionCard(props)})};var renderButtonWithError=function renderButtonWithError(props){return/*#__PURE__*/_jsx(ErrorWrapper,{componentProps:props,children:renderButton(props)})};var renderCardWithError=function renderCardWithError(props){return/*#__PURE__*/_jsx(ErrorWrapper,{componentProps:props,children:renderCard(props)})};var renderChartWithError=function renderChartWithError(props){return/*#__PURE__*/_jsx(ErrorWrapper,{componentProps:props,children:renderChart(props)})};var renderFilterWithError=function renderFilterWithError(props){return/*#__PURE__*/_jsx(ErrorWrapper,{componentProps:props,children:renderFilter(props)})};var renderMarkdownWithError=function renderMarkdownWithError(props){return/*#__PURE__*/_jsx(ErrorWrapper,{componentProps:props,children:renderMarkdown(props)})};var renderSearchWithError=function renderSearchWithError(props){return/*#__PURE__*/_jsx(ErrorWrapper,{componentProps:props,children:renderSearch(props)})};var renderTableWithError=function renderTableWithError(props){return/*#__PURE__*/_jsx(ErrorWrapper,{componentProps:props,children:renderTable(props)})};var renderTabWithError=function renderTabWithError(props){return/*#__PURE__*/_jsx(ErrorWrapper,{componentProps:props,children:renderTab(props)})};export function getRenderers(){return{ActionCard:renderActionCardWithError,Button:renderButtonWithError,Card:renderCardWithError,Chart:renderChartWithError,Filter:renderFilterWithError,Markdown:renderMarkdownWithError,Search:renderSearchWithError,Table:renderTableWithError,Tabs:renderTabWithError}}
11
10
  //# sourceMappingURL=render-components.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"render-components.js","names":["chroma","React","useEffect","useRef","useState","renderNoDataFallback","CircleAlert","theme","Markdown","Bar","BarChart","CartesianGrid","Legend","Line","LineChart","Pie","PieChart","ResponsiveContainer","XAxis","YAxis","domutil","TooltipButton","Card","CardContent","CardDescription","CardFooter","CardHeader","CardTitle","ChartContainer","ChartTooltip","ChartTooltipContent","renderFilter","ScrollArea","ScrollBar","renderSearch","CardLoader","ChartLoader","MarkdownLoader","ErrorState","Tabs","TabsContent","TabsList","TabsTrigger","cn","getAffectedComponentsWithLoader","DataTable","jsx","_jsx","jsxs","_jsxs","Object","defineProperty","value","el","html","ownerDocument","documentElement","box","top","left","getBoundingClientRect","iframe","document","querySelector","iframeWindow","contentWindow","pageYOffset","clientTop","pageXOffset","clientLeft","writable","configurable","baseColors","colors","Blue_100","Blue_30","Purpley_100","Purpley_30","Light_Bluish_Green","Wild_Strawberry","getNColors","n","_iterator","_createForOfIteratorHelperLoose","_step","done","baseColor","push","scale","mode","getOneColor","existing","color","base","Math","floor","random","length","selectedColorIndex","includes","selectedColors","i","renderActionCard","props","gjsModel","rest","_objectWithoutPropertiesLoose","_excluded","_useState","_extends","get","allData","setAllData","_allData$headerConten","headerContent","icon","_allData$bodyContent","bodyContent","_useState2","attributes","setAttributes","handlePropsChange","on","off","handleAttributesChange","defaultClasses","error","className","isEditable","contentEditable","children","errorMessage","variant","loading","renderCard","_props$isEditable","_excluded2","_useState3","headerDescription","footerContent","footerClass","footerIcon","contentMetadata","contentMetadataClass","_useState4","defaultFooterClasses","defaultContentMetadataClasses","mergedCardClassName","mergedFooterClassName","mergedContentMetadataClassName","getCardContent","interactionApiInProgress","Fragment","style","renderChartComponent","chartType","data","config","cursor","content","hideLabel","dataKey","nameKey","innerRadius","strokeWidth","label","_ref","name","percent","toFixed","undefined","labelLine","dataKeys","chartUi","vertical","xAxis","align","wrapperStyle","marginLeft","map","_ref2","key","fill","radius","indicator","_ref3","type","stroke","_ref4","renderChart","_props$isEditable2","_excluded3","_useState5","_useState6","containerRef","_useState7","containerWidth","setContainerWidth","updateContainerWidth","current","offsetWidth","window","addEventListener","removeEventListener","_allData$config","_allData$chartType","_allData$chartData","chartData","_allData$title","title","_allData$subTitle","subTitle","mergedClasses","width","totalDataPoints","getResponsiveConfig","barCategoryGap","minWidth","height","orientation","ref","renderTable","_props$performInterac","performInteraction","_excluded4","_useState8","cardRef","_useState9","_allData$data","_allData$headerMapper","headerMapper","rawHeaderMapper","_allData$isEditable","_allData$title2","_allData$subTitle2","_allData$actions","actions","pagination","cleaned","id","keys","fromEntries","entries","filter","_ref5","sortConfig","_gjsModel$get","_ref7","_ref6","sortColumn","sortDirection","parsedData","Array","isArray","datum","newData","onRowAction","_x","_x2","_onRowAction","apply","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee","rowIndex","actionId","wrap","_callee$","_context","prev","next","interactionType","payload","row","tableId","affectedComponents","stop","onPageChange","_x3","_x4","_onPageChange","_callee2","pageNumber","pageSize","_gjsModel$get2","_ref8","_callee2$","_context2","handleSort","_x5","_x6","_handleSort","_callee3","column","direction","currentProps","_callee3$","_context3","set","isLoading","onSort","otherProps","renderTab","tabsWidth","tabs","defaultValue","tab","renderMarkdown","_excluded5","_useState10","_useState11","_useState12","isEditing","setIsEditing","editRef","startEditing","setTimeout","setupEditor","editor","innerHTML","textContent","summaryText","focus","saveChanges","innerText","newProps","markdownStyles","ul","h1","h2","h3","h4","h5","h6","options","overrides","onBlur","suppressContentEditableWarning","whiteSpace","wordWrap","onClick","renderButton","_props$isEditable3","_props$performInterac2","_useState13","_useState14","text","_allData$variant","_allData$size","size","tooltipContent","interact","concat","getRenderers","ActionCard","Button","Chart","Filter","Search","Table"],"sources":["../../../src/plugins/helpers/render-components.tsx"],"sourcesContent":["/* eslint-disable no-nested-ternary */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\n/* eslint-disable func-style */\n/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-disable func-names */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport chroma from 'chroma-js';\nimport React, {JSX, useEffect, useRef, useState} from 'react';\nimport {renderNoDataFallback} from './extra'\nimport {CircleAlert} from 'lucide-react';\n\nimport {theme} from '@peak-ai/ais-components/theme';\n\nimport Markdown from 'markdown-to-jsx';\n\nimport {\n Bar,\n BarChart,\n CartesianGrid,\n Legend,\n Line,\n LineChart,\n Pie,\n PieChart,\n ResponsiveContainer,\n XAxis,\n YAxis,\n} from 'recharts/lib';\n\n// @ts-ignore\nimport * as domutil from 'recharts/lib/util/DOMUtils';\n\nimport {TooltipButton} from '../../shadcn/components/ui/button';\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from '../../shadcn/components/ui/card';\nimport {ChartContainer, ChartTooltip, ChartTooltipContent,} from '../../shadcn/components/ui/chart';\nimport {renderFilter} from '../../shadcn/components/ui/filter';\nimport {ScrollArea, ScrollBar} from '../../shadcn/components/ui/scroll-area';\nimport {renderSearch} from '../../shadcn/components/ui/search';\nimport {CardLoader, ChartLoader, MarkdownLoader, ErrorState} from '../../shadcn/components/ui/skeleton';\nimport {SortDirection} from '../../shadcn/components/ui/table';\nimport {Tabs, TabsContent, TabsList, TabsTrigger} from '../../shadcn/components/ui/tabs';\n\nimport {cn} from '../../shadcn/utils';\nimport {getAffectedComponentsWithLoader} from '../../helpers';\nimport {DataTable} from './data-table';\n\n// Monkey-patching the getOffset function to use iframe's window instead of global one\n// REMEMBER TO UDPATE THIS WHEN recharts IS UPGRADED\n// @ts-ignore - Force assignment to read-only property\nObject.defineProperty(domutil, 'getOffset', {\n value: (el: HTMLElement): {\n top: number;\n left: number;\n } => {\n const html = el.ownerDocument.documentElement;\n let box = { top: 0, left: 0 };\n\n if (typeof el.getBoundingClientRect !== 'undefined') {\n box = el.getBoundingClientRect();\n }\n\n const iframe = document.querySelector('.gjs-frame');\n const iframeWindow = (iframe as any)?.contentWindow;\n\n return {\n top: box.top + iframeWindow.pageYOffset - html.clientTop,\n left: box.left + iframeWindow.pageXOffset - html.clientLeft,\n };\n },\n writable: true,\n configurable: true\n});\n\n\nconst baseColors = [\n [theme.colors.Blue_100, theme.colors.Blue_30],\n [theme.colors.Purpley_100, theme.colors.Purpley_30],\n [theme.colors.Light_Bluish_Green, '#06601b'],\n [theme.colors.Wild_Strawberry, '#4d001c'],\n];\n\nfunction getNColors(n: number) {\n const colors: Array<string[]> = [];\n\n for (const baseColor of baseColors) {\n // eslint-disable-next-line import/no-named-as-default-member\n colors.push(chroma.scale(baseColor).mode('lab').colors(n));\n }\n\n function getOneColor(existing: Array<string>) {\n let color: null | string = null;\n\n do {\n const base = colors[Math.floor(Math.random() * colors.length)];\n const selectedColorIndex = Math.floor(Math.random() * base.length);\n color = base[selectedColorIndex];\n } while (existing.includes(color));\n\n return color as string;\n }\n\n const selectedColors: Array<string> = [];\n\n for (let i = 0; i < n; i++) {\n selectedColors.push(getOneColor(selectedColors));\n }\n\n return selectedColors;\n}\n\nexport function renderActionCard(props: any): JSX.Element {\n const { gjsModel, ...rest } = props;\n\n const [allData, setAllData] = useState({\n ...props,\n ...gjsModel.get('componentProps'),\n });\n\n const {\n headerContent = 'Default Action Card Title',\n icon,\n bodyContent = 'Default body content. Click to edit.',\n } = allData;\n\n const [attributes, setAttributes] = useState({\n ...gjsModel.get('attributes'),\n });\n\n useEffect(() => {\n const handlePropsChange = () => {\n setAllData({\n ...gjsModel.get('componentProps'),\n });\n };\n\n gjsModel.on('change:componentProps', handlePropsChange);\n \n return () => {\n gjsModel.off('change:componentProps', handlePropsChange);\n };\n }, [gjsModel]);\n\n useEffect(() => {\n const handleAttributesChange = () => {\n setAttributes({\n ...gjsModel.get('attributes'),\n });\n };\n\n gjsModel.on('change:attributes', handleAttributesChange);\n \n return () => {\n gjsModel.off('change:attributes', handleAttributesChange);\n };\n }, [gjsModel]);\n\n const defaultClasses = 'bg-white text-black p-4 rounded-lg shadow border flex flex-col h-full';\n\n if (attributes.error) {\n return (\n <Card className={defaultClasses} isEditable={false} contentEditable={false} {...rest}>\n <CardContent className=\"p-0\" isEditable={false} contentEditable={false}>\n <div className=\"px-4 py-3\">\n <ErrorState \n errorMessage={attributes.errorMessage || \"Failed to load action card content\"}\n variant=\"default\"\n />\n </div>\n </CardContent>\n </Card>\n );\n }\n\n if (attributes.loading) {\n return (\n <Card className={defaultClasses} isEditable={false} contentEditable={false} {...rest}>\n <CardContent className=\"p-0\" isEditable={false} contentEditable={false}>\n <div className=\"px-4 py-3\">\n <CardLoader />\n </div>\n </CardContent>\n </Card>\n );\n }\n\n return (\n <Card className={defaultClasses} isEditable={false} contentEditable={false} {...rest}>\n <CardContent className=\"p-0\" isEditable={false} contentEditable={false}>\n <div className=\"px-4 py-3\">\n <div className=\"flex items-start\">\n <span className=\"text-5xl mr-2\" aria-hidden=\"true\">\n {icon}\n </span>\n <div className=\"flex-1\">\n <div className=\"text-xl font-semibold\">{headerContent}</div>\n {!bodyContent ? (\n <span className=\"flex flex-row items-center px-3 py-2\">\n <CircleAlert className=\"w-3 h-3 text-gray-400 mr-1\" />\n <p className=\"text-sm text-gray-500 max-w-md text-center\">\n No data available for given filters\n </p>\n </span>\n ) : (\n <div className=\"text-base leading-relaxed mt-1\">{bodyContent}</div>\n )}\n </div>\n </div>\n </div>\n </CardContent>\n </Card>\n );\n}\n\nexport function renderCard(props: any): JSX.Element {\n const { isEditable = false, gjsModel, ...rest } = props;\n\n const [allData, setAllData] = useState({\n ...props,\n ...gjsModel.get('componentProps'),\n });\n\n const {\n headerContent,\n headerDescription,\n bodyContent,\n footerContent,\n footerClass,\n footerIcon,\n contentMetadata,\n contentMetadataClass,\n className,\n } = allData;\n\n const [attributes, setAttributes] = useState({\n ...gjsModel.get('attributes'),\n });\n\n useEffect(() => {\n const handlePropsChange = () => {\n setAllData({\n ...gjsModel.get('componentProps'),\n });\n };\n\n gjsModel.on('change:componentProps', handlePropsChange);\n \n return () => {\n gjsModel.off('change:componentProps', handlePropsChange);\n };\n }, [gjsModel]);\n\n useEffect(() => {\n const handleAttributesChange = () => {\n setAttributes({\n ...gjsModel.get('attributes'),\n });\n };\n\n gjsModel.on('change:attributes', handleAttributesChange);\n \n return () => {\n gjsModel.off('change:attributes', handleAttributesChange);\n };\n }, [gjsModel]);\n\n const defaultClasses = 'bg-white text-black p-4 rounded-lg shadow border flex flex-col h-full';\n const defaultFooterClasses = 'text-sm';\n const defaultContentMetadataClasses = 'text-xs';\n const mergedCardClassName = className ? cn(defaultClasses, className) : defaultClasses;\n const mergedFooterClassName = footerClass\n ? cn(defaultFooterClasses, footerClass)\n : defaultFooterClasses;\n const mergedContentMetadataClassName = contentMetadataClass\n ? cn(defaultContentMetadataClasses, contentMetadataClass)\n : defaultContentMetadataClasses;\n\n function getCardContent() {\n if (attributes.error) {\n return (\n <CardContent>\n <ErrorState \n errorMessage={attributes.errorMessage || \"Failed to load card content\"}\n variant=\"default\"\n />\n </CardContent>\n );\n }\n\n if (attributes.interactionApiInProgress || attributes.loading) {\n return (\n <CardContent>\n <CardLoader />\n </CardContent>\n );\n }\n\n return (\n <React.Fragment>\n <CardHeader>\n <CardTitle data-slot=\"headerContent\" contentEditable={isEditable} className=\"text-lg\">\n {headerContent}\n </CardTitle>\n <CardDescription\n data-slot=\"headerDescription\"\n contentEditable={isEditable}\n className=\"text-sm\"\n >\n {headerDescription}\n </CardDescription>\n </CardHeader>\n\n {!bodyContent ? (\n <span className=\"flex flex-row items-center px-3 py-2\">\n <CircleAlert className=\"w-3 h-3 text-gray-400 mr-1\" />\n <p className=\"text-sm text-gray-500 max-w-md text-center\">\n No data available for given filters\n </p>\n </span>\n ) : (\n <CardContent data-slot=\"bodyContent\" contentEditable={false} className=\"flex-grow\">\n <div className=\"text-3xl font-semibold truncate\">{bodyContent}</div>\n {contentMetadata && (\n <div className={mergedContentMetadataClassName} style={{ color: '#2A44D4' }}>\n {contentMetadata}\n </div>\n )}\n </CardContent>\n )}\n\n <CardFooter\n data-slot=\"footerContent\"\n contentEditable={isEditable}\n className={cn(mergedFooterClassName)}\n >\n {footerIcon && (\n <span className=\"mr-2\" aria-hidden=\"true\">\n {footerIcon}\n </span>\n )}\n {footerContent}\n </CardFooter>\n </React.Fragment>\n );\n }\n\n return (\n <Card {...rest} className={mergedCardClassName}>\n {getCardContent()}\n </Card>\n );\n}\n\nfunction renderChartComponent(chartType: string, data: any, config: any): JSX.Element {\n if (!data || data.length === 0) {\n return renderNoDataFallback();\n }\n\n switch (chartType) {\n case 'pie':\n return (\n <PieChart>\n {data.length >= 20 && (\n <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />\n )}\n <Pie\n data={data}\n dataKey={config.dataKey}\n nameKey={config.nameKey}\n innerRadius={60}\n strokeWidth={10}\n label={\n data.length < 20\n ? ({ name, percent }: { name: string; percent: number; }) => `${name}: ${(percent * 100).toFixed(0)}%`\n : undefined\n }\n labelLine={false}\n />\n </PieChart>\n );\n case 'bar':\n config.dataKeys = config.dataKeys || [];\n\n return (\n <BarChart data={data} {...config.chartUi}>\n <CartesianGrid vertical={false} />\n <XAxis dataKey={config.xAxis} />\n <YAxis />\n <Legend align=\"left\" wrapperStyle={{ marginLeft: 20 }} />\n {config.dataKeys.map(\n ({ key, name, color }: { key: string; name: string; color: string }) => {\n return (\n <Bar dataKey={key} fill={color ?? '#4caf50'} name={name} key={key} radius={2} />\n );\n },\n )}\n <ChartTooltip cursor={false} content={<ChartTooltipContent indicator=\"dashed\" />} />\n </BarChart>\n );\n case 'line':\n config.dataKeys = config.dataKeys || [];\n\n return (\n <LineChart data={data}>\n <CartesianGrid vertical={false} />\n <XAxis dataKey={config.xAxis} />\n <YAxis />\n <ChartTooltip cursor={false} content={<ChartTooltipContent indicator=\"dashed\" />} />\n {config.dataKeys.map(\n ({ key, name, color }: { key: string; name: string; color: string }) => {\n return (\n <Line\n type=\"monotone\"\n dataKey={key}\n stroke={color ?? '#4caf50'}\n name={name}\n key={key}\n />\n );\n },\n )}\n <Legend align=\"left\" />\n </LineChart>\n );\n default:\n return (\n <PieChart>\n {data.length >= 20 && (\n <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />\n )}\n <Pie\n data={data}\n dataKey={config.dataKey}\n nameKey={config.nameKey}\n innerRadius={60}\n strokeWidth={10}\n label={\n data.length < 20\n ? ({ name, percent }: { name: string; percent: number; }) => `${name}: ${(percent * 100).toFixed(0)}%`\n : undefined\n }\n labelLine={false}\n />\n </PieChart>\n );\n }\n}\n\nexport function renderChart(props: any): JSX.Element {\n const { isEditable = false, gjsModel, ...rest } = props;\n\n const [allData, setAllData] = useState({\n ...props,\n ...gjsModel.get('componentProps'),\n });\n\n const [attributes, setAttributes] = useState({\n ...gjsModel.get('attributes'),\n });\n\n const containerRef = useRef<HTMLDivElement>(null);\n const [containerWidth, setContainerWidth] = useState<number>(0);\n\n useEffect(() => {\n const handlePropsChange = () => {\n setAllData({\n ...gjsModel.get('componentProps'),\n });\n };\n\n gjsModel.on('change:componentProps', handlePropsChange);\n \n return () => {\n gjsModel.off('change:componentProps', handlePropsChange);\n };\n }, [gjsModel]);\n\n useEffect(() => {\n const handleAttributesChange = () => {\n setAttributes({\n ...gjsModel.get('attributes'),\n });\n };\n\n gjsModel.on('change:attributes', handleAttributesChange);\n \n return () => {\n gjsModel.off('change:attributes', handleAttributesChange);\n };\n }, [gjsModel]);\n\n useEffect(() => {\n const updateContainerWidth = () => {\n if (containerRef.current) {\n setContainerWidth(containerRef.current.offsetWidth);\n }\n };\n\n updateContainerWidth();\n window.addEventListener('resize', updateContainerWidth);\n\n return () => window.removeEventListener('resize', updateContainerWidth);\n }, []);\n\n const {\n config = {},\n chartType = 'pie',\n chartData = [],\n className,\n title = 'Title',\n subTitle = 'Subtitle',\n } = allData;\n\n const defaultClasses = 'aspect-auto h-[250px] w-full';\n const mergedClasses = className ? cn(defaultClasses, className) : defaultClasses;\n\n if (chartType === 'pie') {\n const colors = getNColors(chartData.length);\n\n for (let i = 0; i < chartData.length; i++) {\n const data = chartData[i];\n\n if (!data.fill) {\n data.fill = colors[i];\n }\n }\n } else if (!config.color) {\n config.color = baseColors[Math.floor(Math.random() * baseColors.length)];\n }\n\n let width: number | undefined = undefined;\n let totalDataPoints = 0;\n\n // Helper function to get responsive config\n const getResponsiveConfig = () => {\n if (\n chartType === 'bar' &&\n totalDataPoints > 15 &&\n containerWidth > 0 &&\n width &&\n width <= containerWidth\n ) {\n // If chart fits in container, use responsive behavior\n return { ...config, chartUi: {} };\n }\n\n return config;\n };\n\n if (chartType === 'bar') {\n totalDataPoints = chartData.length * config.dataKeys.length;\n\n if (totalDataPoints > 15) {\n width =\n totalDataPoints * 20 +\n config.dataKeys.length * 8 * chartData.length +\n chartData.length * 15;\n config.chartUi = {\n barCategoryGap: '10%',\n width,\n };\n } else {\n config.chartUi = {};\n }\n }\n\n const chartUi = attributes.error ? (\n <ErrorState \n errorMessage={attributes.errorMessage || \"Failed to load chart data\"}\n variant=\"default\"\n />\n ) : (attributes.interactionApiInProgress || attributes.loading) ? (\n <ChartLoader />\n ) : !chartData ? (\n renderNoDataFallback()\n ) : (\n <React.Fragment>\n {chartType === 'bar' &&\n totalDataPoints > 15 &&\n config.chartUi &&\n width &&\n (containerWidth === 0 || width > containerWidth) ? (\n <div className=\"w-full\">\n <ScrollArea className=\"w-full\">\n <div style={{ minWidth: `${width}px`, width: 'max-content' }}>\n <ResponsiveContainer width={width} height={250}>\n <ChartContainer {...rest} config={config} className={mergedClasses}>\n {renderChartComponent(chartType, chartData, config)}\n </ChartContainer>\n </ResponsiveContainer>\n </div>\n <ScrollBar orientation=\"horizontal\" />\n </ScrollArea>\n </div>\n ) : (\n <ResponsiveContainer width=\"100%\" height={250}>\n <ChartContainer {...rest} config={getResponsiveConfig()} className={mergedClasses}>\n {renderChartComponent(chartType, chartData, getResponsiveConfig())}\n </ChartContainer>\n </ResponsiveContainer>\n )}\n </React.Fragment>\n );\n\n return (\n <Card className=\"shadow border mt-2 mb-2\">\n <CardHeader>\n <CardTitle data-slot=\"title\" contentEditable={isEditable} className=\"text-2xl\">\n {title}\n </CardTitle>\n <CardDescription data-slot=\"subTitle\" contentEditable={isEditable} className=\"text-sm\">\n {subTitle}\n </CardDescription>\n </CardHeader>\n <CardContent\n ref={containerRef}\n data-slot=\"bodyContent\"\n contentEditable={false}\n className=\"px-6\"\n >\n {chartUi}\n </CardContent>\n </Card>\n );\n}\n\nexport function renderTable(props: any): JSX.Element {\n const { gjsModel, performInteraction = () => {}, ...rest } = props;\n\n const [allData, setAllData] = useState({\n ...props,\n ...gjsModel.get('componentProps'),\n });\n\n const cardRef = useRef<HTMLDivElement>(null);\n\n const [attributes, setAttributes] = useState({\n ...gjsModel.get('attributes'),\n });\n\n const {\n data = [],\n headerMapper: rawHeaderMapper = {},\n className,\n isEditable = false,\n title = 'Title',\n subTitle = 'Subtitle',\n actions = [],\n pagination,\n } = allData;\n\n const headerMapper = (() => {\n const cleaned = { ...rawHeaderMapper };\n\n if ('id' in cleaned) {\n delete cleaned.id;\n }\n\n if (data.length > 0) {\n const dataKeys = Object.keys(data[0] || {});\n\n return Object.fromEntries(\n Object.entries(cleaned).filter(([key]) => dataKeys.includes(key))\n );\n }\n\n return cleaned;\n })();\n\n const sortConfig = (() => {\n const { sortColumn, sortDirection } = gjsModel.get('componentProps') ?? {};\n\n return sortColumn && sortDirection ? { [sortColumn]: sortDirection } : {};\n })();\n\n useEffect(() => {\n const handlePropsChange = () => {\n setAllData({\n ...gjsModel.get('componentProps'),\n });\n };\n\n gjsModel.on('change:componentProps', handlePropsChange);\n \n return () => {\n gjsModel.off('change:componentProps', handlePropsChange);\n };\n }, [gjsModel]);\n\n useEffect(() => {\n const handleAttributesChange = () => {\n setAttributes({\n ...gjsModel.get('attributes'),\n });\n };\n\n gjsModel.on('change:attributes', handleAttributesChange);\n \n return () => {\n gjsModel.off('change:attributes', handleAttributesChange);\n };\n }, [gjsModel]);\n\n const parsedData = (() => {\n if (typeof data === 'object' && data !== null && data.name === '__peak_placeholder') {\n return [];\n }\n\n if (!Array.isArray(data)) {\n return [];\n }\n\n return data.map((datum: any) => {\n const newData = {\n ...datum,\n };\n\n delete newData.id;\n\n return newData;\n });\n })();\n\n async function onRowAction(rowIndex: number, actionId: string) {\n const id = gjsModel.get('id');\n\n await performInteraction({\n id: actionId,\n interactionType: 'tableButton',\n payload: {\n row: data[rowIndex],\n tableId: id,\n },\n affectedComponents: [],\n });\n }\n\n async function onPageChange(pageNumber: number, pageSize: number) {\n const id = gjsModel.get('id');\n const { sortColumn, sortDirection } = gjsModel.get('componentProps') ?? {};\n\n await performInteraction({\n id,\n interactionType: 'pagination',\n payload: {\n pageNumber,\n pageSize,\n ...(sortColumn && sortDirection && { sortColumn, sortDirection }),\n },\n affectedComponents: getAffectedComponentsWithLoader([id], true),\n });\n }\n\n async function handleSort(column: string, direction: SortDirection) {\n const currentProps = gjsModel.get('componentProps');\n const id = gjsModel.get('id');\n\n gjsModel.set('componentProps', {\n ...currentProps,\n sortColumn: direction ? column : null,\n sortDirection: direction,\n });\n\n await performInteraction({\n id,\n interactionType: 'tableSort',\n payload: {\n sortColumn: direction ? column : null,\n sortDirection: direction,\n tableId: id,\n },\n affectedComponents: getAffectedComponentsWithLoader([id], true),\n });\n }\n\n return (\n <Card\n ref={cardRef}\n className=\"shadow border\"\n data-component-type=\"table\"\n >\n <CardHeader>\n <CardTitle data-slot=\"title\" contentEditable={isEditable} className=\"text-2xl\">\n {title}\n </CardTitle>\n <CardDescription data-slot=\"subTitle\" contentEditable={isEditable} className=\"text-sm\">\n {subTitle}\n </CardDescription>\n </CardHeader>\n <CardContent data-slot=\"bodyContent\" contentEditable={false}>\n {attributes.error ? (\n <ErrorState \n errorMessage={attributes.errorMessage || \"Failed to load table data\"}\n variant=\"default\"\n />\n ) : (\n <DataTable\n data={parsedData}\n headerMapper={headerMapper}\n className={className}\n isEditable={isEditable}\n actions={actions}\n pagination={pagination}\n isLoading={attributes.interactionApiInProgress}\n onRowAction={onRowAction}\n onPageChange={onPageChange}\n onSort={handleSort}\n sortConfig={sortConfig}\n otherProps={rest}\n />\n )}\n </CardContent>\n </Card>\n );\n}\n\nexport function renderTab(props: any): JSX.Element {\n let tabsWidth = 200;\n\n if (props.tabs.length > 4) {\n tabsWidth = 150;\n }\n\n return (\n <Tabs defaultValue={props.defaultValue}>\n <div className=\"text-center mb-4\">\n <TabsList className=\"bg-gray-300\">\n {props.tabs.map((tab: string) => (\n <TabsTrigger value={tab} key={tab} className={`text-md w-[${tabsWidth}px]`}>\n {tab}\n </TabsTrigger>\n ))}\n </TabsList>\n </div>\n {props.tabs.map((tab: string) => (\n <TabsContent value={tab} className=\"tabs-content\" key={tab} />\n ))}\n </Tabs>\n );\n}\n\nexport function renderMarkdown(props: any): JSX.Element {\n const { gjsModel, ...rest } = props;\n\n const [allData, setAllData] = useState({\n ...props,\n ...gjsModel.get('componentProps'),\n });\n\n\n\n const [attributes, setAttributes] = useState({\n ...gjsModel.get('attributes'),\n });\n\n useEffect(() => {\n const handlePropsChange = () => {\n setAllData({\n ...gjsModel.get('componentProps'),\n });\n };\n\n gjsModel.on('change:componentProps', handlePropsChange);\n \n return () => {\n gjsModel.off('change:componentProps', handlePropsChange);\n };\n }, [gjsModel]);\n\n useEffect(() => {\n const handleAttributesChange = () => {\n setAttributes({\n ...gjsModel.get('attributes'),\n });\n };\n\n gjsModel.on('change:attributes', handleAttributesChange);\n \n return () => {\n gjsModel.off('change:attributes', handleAttributesChange);\n };\n }, [gjsModel]);\n\n const [isEditing, setIsEditing] = useState(false);\n const editRef = useRef<HTMLDivElement>(null);\n\n const startEditing = () => {\n setIsEditing(true);\n setTimeout(() => {\n setupEditor();\n }, 0);\n };\n\n const setupEditor = () => {\n if (!editRef.current) {\n return;\n }\n\n const editor = editRef.current;\n editor.innerHTML = '';\n editor.textContent = allData.summaryText;\n editor.focus();\n };\n\n // Save changes and exit editing mode\n const saveChanges = () => {\n if (!editRef.current) {\n return;\n }\n\n const content = editRef.current.innerText || '';\n const newProps = {\n ...gjsModel.get('componentProps'),\n summaryText: content,\n };\n \n // Update the gjsModel which will trigger the useEffect to update local state\n gjsModel.set('componentProps', newProps);\n setIsEditing(false);\n editRef.current.innerHTML = '';\n };\n\n const markdownStyles = {\n ul: { props: { className: 'list-disc' } },\n h1: { props: { className: 'text-4xl font-bold leading-[4rem]' } },\n h2: { props: { className: 'text-3xl font-bold leading-[3rem]' } },\n h3: { props: { className: 'text-2xl font-bold leading-[2rem]' } },\n h4: { props: { className: 'text-xl font-bold leading-[2.5rem]' } },\n h5: { props: { className: 'text-lg font-bold leading-[2.5rem]' } },\n h6: { props: { className: 'text-base font-bold leading-[2rem]' } },\n };\n\n if (attributes.error) {\n return (\n <div className=\"px-[1em]\" {...rest}>\n <ErrorState \n errorMessage={attributes.errorMessage || \"Failed to load markdown content\"}\n variant=\"default\"\n />\n </div>\n );\n }\n\n if (attributes.loading) {\n return <MarkdownLoader />\n }\n\n if (!allData.isEditable) {\n return (\n <div className=\"px-[1em]\" {...rest}>\n <div data-slot=\"summaryText\">\n <Markdown options={{ overrides: markdownStyles }}>\n {allData.summaryText || ''}\n </Markdown>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"p-[1em]\" {...rest}>\n {isEditing ? (\n <div\n ref={editRef}\n contentEditable\n onBlur={saveChanges}\n data-slot=\"summaryText\"\n className=\"p-2 min-h-[100px] whitespace-pre-wrap\"\n suppressContentEditableWarning={true}\n style={{\n whiteSpace: 'pre-wrap',\n wordWrap: 'break-word',\n }}\n />\n ) : (\n <div\n onClick={startEditing}\n data-slot=\"summaryText\"\n style={{\n whiteSpace: 'pre-wrap',\n wordWrap: 'break-word',\n }}\n >\n <Markdown options={{ overrides: markdownStyles }}>\n {allData.summaryText || ''}\n </Markdown>\n </div>\n )}\n </div>\n );\n}\n\nexport function renderButton(props: any): JSX.Element {\n const { isEditable = false, gjsModel, performInteraction = () => {} } = props;\n\n const [allData, setAllData] = useState({\n ...props,\n ...gjsModel.get('componentProps'),\n });\n\n const [attributes, setAttributes] = useState({\n ...gjsModel.get('attributes'),\n });\n\n useEffect(() => {\n const handlePropsChange = () => {\n setAllData({\n ...gjsModel.get('componentProps'),\n });\n };\n\n gjsModel.on('change:componentProps', handlePropsChange);\n \n return () => {\n gjsModel.off('change:componentProps', handlePropsChange);\n };\n }, [gjsModel]);\n\n useEffect(() => {\n const handleAttributesChange = () => {\n setAttributes({\n ...gjsModel.get('attributes'),\n });\n };\n\n gjsModel.on('change:attributes', handleAttributesChange);\n \n return () => {\n gjsModel.off('change:attributes', handleAttributesChange);\n };\n }, [gjsModel]);\n\n const {\n text,\n className,\n payload,\n variant = 'default',\n size = 'sm',\n affectedComponents,\n tooltipContent,\n } = allData;\n\n function interact() {\n const id = gjsModel.get('id');\n performInteraction({\n id,\n interactionType: 'button',\n affectedComponents: getAffectedComponentsWithLoader([id, ...affectedComponents], true),\n payload,\n });\n }\n\n if (attributes.error) {\n return (\n <div className=\"inline-flex\">\n <ErrorState \n errorMessage={attributes.errorMessage || \"Button error\"}\n variant=\"minimal\"\n />\n </div>\n );\n }\n\n return (\n <TooltipButton\n className={className}\n isEditable={isEditable}\n interact={interact}\n attributes={attributes}\n variant={variant}\n size={size}\n text={text}\n tooltipContent={tooltipContent}\n />\n );\n}\n\nexport function getRenderers(): Record<string, (props: any) => JSX.Element> {\n return {\n ActionCard: renderActionCard,\n Button: renderButton,\n Card: renderCard,\n Chart: renderChart,\n Filter: renderFilter,\n Markdown: renderMarkdown,\n Search: renderSearch,\n Table: renderTable,\n Tabs: renderTab,\n };\n}\n"],"mappings":"02CAAA,sCACA,sDACA,+BACA,yDACA,+BACA,uDACA,MAAO,CAAAA,MAAM,KAAM,WAAW,CAC9B,MAAO,CAAAC,KAAK,EAAQC,SAAS,CAAEC,MAAM,CAAEC,QAAQ,KAAO,OAAO,CAC7D,OAAQC,oBAAoB,KAAO,SAAS,CAC5C,OAAQC,WAAW,KAAO,cAAc,CAExC,OAAQC,KAAK,KAAO,+BAA+B,CAEnD,MAAO,CAAAC,QAAQ,KAAM,iBAAiB,CAEtC,OAC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AEA,IAAK,CACXI,cAAc,CAAEA,cAAe,CAChC,CAEL,CAEA,MAAO,SAAS,CAAAG,YAAYA,CAAA,CAAgD,CAC1E,MAAO,CACLC,UAAU,CAAE9P,gBAAgB,CAC5B+P,MAAM,CAAEd,YAAY,CACpBjU,IAAI,CAAEgH,UAAU,CAChBgO,KAAK,CAAEzK,WAAW,CAClB0K,MAAM,CAAExU,YAAY,CACpBvB,QAAQ,CAAE6S,cAAc,CACxBmD,MAAM,CAAEtU,YAAY,CACpBuU,KAAK,CAAE5I,WAAW,CAClBtL,IAAI,CAAEyQ,SACR,CACF","ignoreList":[]}
1
+ {"version":3,"file":"render-components.js","names":["chroma","React","useEffect","useRef","useState","renderNoDataFallback","CircleAlert","theme","Markdown","Bar","BarChart","CartesianGrid","Legend","Line","LineChart","Pie","PieChart","ResponsiveContainer","XAxis","YAxis","domutil","TooltipButton","Card","CardContent","CardDescription","CardFooter","CardHeader","CardTitle","ChartContainer","ChartTooltip","ChartTooltipContent","renderFilter","ScrollArea","ScrollBar","renderSearch","CardLoader","ChartLoader","MarkdownLoader","Tabs","TabsContent","TabsList","TabsTrigger","cn","getAffectedComponentsWithLoader","DataTable","ErrorWrapper","jsx","_jsx","jsxs","_jsxs","getOffset","el","html","ownerDocument","documentElement","box","top","left","getBoundingClientRect","iframe","document","querySelector","iframeWindow","contentWindow","pageYOffset","clientTop","pageXOffset","clientLeft","baseColors","colors","Blue_100","Blue_30","Purpley_100","Purpley_30","Light_Bluish_Green","Wild_Strawberry","getNColors","n","_iterator","_createForOfIteratorHelperLoose","_step","done","baseColor","value","push","scale","mode","getOneColor","existing","color","base","Math","floor","random","length","selectedColorIndex","includes","selectedColors","i","renderActionCard","props","gjsModel","rest","_objectWithoutPropertiesLoose","_excluded","_useState","_extends","allData","setAllData","_allData$headerConten","headerContent","icon","_allData$bodyContent","bodyContent","_useState2","get","setAttributes","on","defaultClasses","className","isEditable","contentEditable","children","renderCard","_props$isEditable","_excluded2","_useState3","headerDescription","footerContent","footerClass","footerIcon","contentMetadata","contentMetadataClass","_useState4","attributes","defaultFooterClasses","defaultContentMetadataClasses","mergedCardClassName","mergedFooterClassName","mergedContentMetadataClassName","getCardContent","interactionApiInProgress","loading","Fragment","style","renderChartComponent","chartType","data","config","cursor","content","hideLabel","dataKey","nameKey","innerRadius","strokeWidth","label","_ref","name","percent","toFixed","undefined","labelLine","dataKeys","chartUi","vertical","xAxis","align","wrapperStyle","marginLeft","map","_ref2","key","fill","radius","indicator","_ref3","type","stroke","_ref4","renderChart","_props$isEditable2","_excluded3","_useState5","_useState6","containerRef","_useState7","containerWidth","setContainerWidth","updateContainerWidth","current","offsetWidth","window","addEventListener","removeEventListener","_allData$config","_allData$chartType","_allData$chartData","chartData","_allData$title","title","_allData$subTitle","subTitle","mergedClasses","width","totalDataPoints","getResponsiveConfig","barCategoryGap","minWidth","height","orientation","ref","renderTable","_props$performInterac","performInteraction","_excluded4","_useState8","cardRef","_useState9","_allData$data","_allData$headerMapper","headerMapper","rawHeaderMapper","_allData$isEditable","_allData$title2","_allData$subTitle2","_allData$actions","actions","pagination","cleaned","id","Object","keys","fromEntries","entries","filter","_ref5","sortConfig","_gjsModel$get","_ref7","_ref6","sortColumn","sortDirection","parsedData","Array","isArray","datum","newData","onRowAction","_x","_x2","_onRowAction","apply","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee","rowIndex","actionId","wrap","_callee$","_context","prev","next","interactionType","payload","row","tableId","affectedComponents","stop","onPageChange","_x3","_x4","_onPageChange","_callee2","pageNumber","pageSize","_gjsModel$get2","_ref8","_callee2$","_context2","handleSort","_x5","_x6","_handleSort","_callee3","column","direction","currentProps","_callee3$","_context3","set","isLoading","onSort","otherProps","renderTab","tabsWidth","tabs","defaultValue","tab","renderMarkdown","_excluded5","_useState10","_useState11","_useState12","isEditing","setIsEditing","editRef","startEditing","setTimeout","setupEditor","editor","innerHTML","textContent","summaryText","focus","saveChanges","innerText","markdownStyles","ul","h1","h2","h3","h4","h5","h6","options","overrides","onBlur","suppressContentEditableWarning","whiteSpace","wordWrap","onClick","renderButton","_props$isEditable3","_props$performInterac2","_useState13","_useState14","text","_allData$variant","variant","_allData$size","size","tooltipContent","interact","concat","renderActionCardWithError","componentProps","renderButtonWithError","renderCardWithError","renderChartWithError","renderFilterWithError","renderMarkdownWithError","renderSearchWithError","renderTableWithError","renderTabWithError","getRenderers","ActionCard","Button","Chart","Filter","Search","Table"],"sources":["../../../src/plugins/helpers/render-components.tsx"],"sourcesContent":["/* eslint-disable no-nested-ternary */\n/* eslint-disable @typescript-eslint/ban-ts-comment */\n/* eslint-disable func-style */\n/* eslint-disable @typescript-eslint/no-empty-function */\n/* eslint-disable func-names */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport chroma from 'chroma-js';\nimport React, {JSX, useEffect, useRef, useState} from 'react';\nimport {renderNoDataFallback} from './extra'\nimport {CircleAlert} from 'lucide-react';\n\nimport {theme} from '@peak-ai/ais-components/theme';\n\nimport Markdown from 'markdown-to-jsx';\n\nimport {\n Bar,\n BarChart,\n CartesianGrid,\n Legend,\n Line,\n LineChart,\n Pie,\n PieChart,\n ResponsiveContainer,\n XAxis,\n YAxis,\n} from 'recharts/lib';\n\n// @ts-ignore\nimport * as domutil from 'recharts/lib/util/DOMUtils';\n\nimport {TooltipButton} from '../../shadcn/components/ui/button';\nimport {\n Card,\n CardContent,\n CardDescription,\n CardFooter,\n CardHeader,\n CardTitle,\n} from '../../shadcn/components/ui/card';\nimport {ChartContainer, ChartTooltip, ChartTooltipContent,} from '../../shadcn/components/ui/chart';\nimport {renderFilter} from '../../shadcn/components/ui/filter';\nimport {ScrollArea, ScrollBar} from '../../shadcn/components/ui/scroll-area';\nimport {renderSearch} from '../../shadcn/components/ui/search';\nimport {CardLoader, ChartLoader, MarkdownLoader} from '../../shadcn/components/ui/skeleton';\nimport {SortDirection} from '../../shadcn/components/ui/table';\nimport {Tabs, TabsContent, TabsList, TabsTrigger} from '../../shadcn/components/ui/tabs';\n\nimport {cn} from '../../shadcn/utils';\nimport {getAffectedComponentsWithLoader} from '../../helpers';\nimport {DataTable} from './data-table';\nimport { ErrorWrapper } from '../../shadcn/components/ui/error-wrapper';\n\n// Monkey-patching the getOffset function to use iframe's window instead of global one\n// REMEMBER TO UDPATE THIS WHEN recharts IS UPGRADED\n// @ts-ignore\ndomutil.getOffset = (el: HTMLElement): {\n top: number;\n left: number;\n} => {\n const html = el.ownerDocument.documentElement;\n let box = { top: 0, left: 0 };\n\n if (typeof el.getBoundingClientRect !== 'undefined') {\n box = el.getBoundingClientRect();\n }\n\n const iframe = document.querySelector('.gjs-frame');\n const iframeWindow = (iframe as any)?.contentWindow;\n\n return {\n top: box.top + iframeWindow.pageYOffset - html.clientTop,\n left: box.left + iframeWindow.pageXOffset - html.clientLeft,\n };\n};\n\n\nconst baseColors = [\n [theme.colors.Blue_100, theme.colors.Blue_30],\n [theme.colors.Purpley_100, theme.colors.Purpley_30],\n [theme.colors.Light_Bluish_Green, '#06601b'],\n [theme.colors.Wild_Strawberry, '#4d001c'],\n];\n\nfunction getNColors(n: number) {\n const colors: Array<string[]> = [];\n\n for (const baseColor of baseColors) {\n // eslint-disable-next-line import/no-named-as-default-member\n colors.push(chroma.scale(baseColor).mode('lab').colors(n));\n }\n\n function getOneColor(existing: Array<string>) {\n let color: null | string = null;\n\n do {\n const base = colors[Math.floor(Math.random() * colors.length)];\n const selectedColorIndex = Math.floor(Math.random() * base.length);\n color = base[selectedColorIndex];\n } while (existing.includes(color));\n\n return color as string;\n }\n\n const selectedColors: Array<string> = [];\n\n for (let i = 0; i < n; i++) {\n selectedColors.push(getOneColor(selectedColors));\n }\n\n return selectedColors;\n}\n\n/* TODO: Loader remains */\nexport function renderActionCard(props: any): JSX.Element {\n const { gjsModel, ...rest } = props;\n\n const [allData, setAllData] = useState({\n ...props,\n });\n\n const {\n headerContent = 'Default Action Card Title',\n icon,\n bodyContent = 'Default body content. Click to edit.',\n } = allData;\n\n const [, setAttributes] = useState({\n ...gjsModel.get('attributes'),\n });\n\n useEffect(() => {\n gjsModel.on('change:componentProps', () => {\n setAllData({\n ...gjsModel.get('componentProps'),\n });\n });\n }, []);\n\n useEffect(() => {\n gjsModel.on('change:attributes', () => {\n setAttributes({\n ...gjsModel.get('attributes'),\n });\n });\n }, []);\n\n const defaultClasses = 'bg-white text-black p-4 rounded-lg shadow border flex flex-col h-full';\n\n return (\n <Card className={defaultClasses} isEditable={false} contentEditable={false} {...rest}>\n <CardContent className=\"p-0\" isEditable={false} contentEditable={false}>\n <div className=\"px-4 py-3\">\n <div className=\"flex items-start\">\n <span className=\"text-5xl mr-2\" aria-hidden=\"true\">\n {icon}\n </span>\n <div className=\"flex-1\">\n <div className=\"text-xl font-semibold\">{headerContent}</div>\n {!bodyContent ? (\n <span className=\"flex flex-row items-center px-3 py-2\">\n <CircleAlert className=\"w-3 h-3 text-gray-400 mr-1\" />\n <p className=\"text-sm text-gray-500 max-w-md text-center\">\n No data available for given filters\n </p>\n </span>\n ) : (\n <div className=\"text-base leading-relaxed mt-1\">{bodyContent}</div>\n )}\n </div>\n </div>\n </div>\n </CardContent>\n </Card>\n );\n}\n\nexport function renderCard(props: any): JSX.Element {\n const { isEditable = false, gjsModel, ...rest } = props;\n\n const [allData, setAllData] = useState({\n ...props,\n });\n\n const {\n headerContent,\n headerDescription,\n bodyContent,\n footerContent,\n footerClass,\n footerIcon,\n contentMetadata,\n contentMetadataClass,\n className,\n } = allData;\n\n const [attributes, setAttributes] = useState({\n ...gjsModel.get('attributes'),\n });\n\n useEffect(() => {\n gjsModel.on('change:componentProps', () => {\n setAllData({\n ...gjsModel.get('componentProps'),\n });\n });\n }, []);\n\n useEffect(() => {\n gjsModel.on('change:attributes', () => {\n setAttributes({\n ...gjsModel.get('attributes'),\n });\n });\n }, []);\n\n const defaultClasses = 'bg-white text-black p-4 rounded-lg shadow border flex flex-col h-full';\n const defaultFooterClasses = 'text-sm';\n const defaultContentMetadataClasses = 'text-xs';\n const mergedCardClassName = className ? cn(defaultClasses, className) : defaultClasses;\n const mergedFooterClassName = footerClass\n ? cn(defaultFooterClasses, footerClass)\n : defaultFooterClasses;\n const mergedContentMetadataClassName = contentMetadataClass\n ? cn(defaultContentMetadataClasses, contentMetadataClass)\n : defaultContentMetadataClasses;\n\n function getCardContent() {\n if (attributes.interactionApiInProgress || attributes.loading) {\n return (\n <CardContent>\n <CardLoader />\n </CardContent>\n );\n }\n\n return (\n <React.Fragment>\n <CardHeader>\n <CardTitle data-slot=\"headerContent\" contentEditable={isEditable} className=\"text-lg\">\n {headerContent}\n </CardTitle>\n <CardDescription\n data-slot=\"headerDescription\"\n contentEditable={isEditable}\n className=\"text-sm\"\n >\n {headerDescription}\n </CardDescription>\n </CardHeader>\n\n {!bodyContent ? (\n <span className=\"flex flex-row items-center px-3 py-2\">\n <CircleAlert className=\"w-3 h-3 text-gray-400 mr-1\" />\n <p className=\"text-sm text-gray-500 max-w-md text-center\">\n No data available for given filters\n </p>\n </span>\n ) : (\n <CardContent data-slot=\"bodyContent\" contentEditable={false} className=\"flex-grow\">\n <div className=\"text-3xl font-semibold truncate\">{bodyContent}</div>\n {contentMetadata && (\n <div className={mergedContentMetadataClassName} style={{ color: '#2A44D4' }}>\n {contentMetadata}\n </div>\n )}\n </CardContent>\n )}\n\n <CardFooter\n data-slot=\"footerContent\"\n contentEditable={isEditable}\n className={cn(mergedFooterClassName)}\n >\n {footerIcon && (\n <span className=\"mr-2\" aria-hidden=\"true\">\n {footerIcon}\n </span>\n )}\n {footerContent}\n </CardFooter>\n </React.Fragment>\n );\n }\n\n return (\n <Card {...rest} className={mergedCardClassName}>\n {getCardContent()}\n </Card>\n );\n}\n\nfunction renderChartComponent(chartType: string, data: any, config: any): JSX.Element {\n if (!data || data.length === 0) {\n return renderNoDataFallback();\n }\n\n switch (chartType) {\n case 'pie':\n return (\n <PieChart>\n {data.length >= 20 && (\n <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />\n )}\n <Pie\n data={data}\n dataKey={config.dataKey}\n nameKey={config.nameKey}\n innerRadius={60}\n strokeWidth={10}\n label={\n data.length < 20\n ? ({ name, percent }: { name: string; percent: number; }) => `${name}: ${(percent * 100).toFixed(0)}%`\n : undefined\n }\n labelLine={false}\n />\n </PieChart>\n );\n case 'bar':\n config.dataKeys = config.dataKeys || [];\n\n return (\n <BarChart data={data} {...config.chartUi}>\n <CartesianGrid vertical={false} />\n <XAxis dataKey={config.xAxis} />\n <YAxis />\n <Legend align=\"left\" wrapperStyle={{ marginLeft: 20 }} />\n {config.dataKeys.map(\n ({ key, name, color }: { key: string; name: string; color: string }) => {\n return (\n <Bar dataKey={key} fill={color ?? '#4caf50'} name={name} key={key} radius={2} />\n );\n },\n )}\n <ChartTooltip cursor={false} content={<ChartTooltipContent indicator=\"dashed\" />} />\n </BarChart>\n );\n case 'line':\n config.dataKeys = config.dataKeys || [];\n\n return (\n <LineChart data={data}>\n <CartesianGrid vertical={false} />\n <XAxis dataKey={config.xAxis} />\n <YAxis />\n <ChartTooltip cursor={false} content={<ChartTooltipContent indicator=\"dashed\" />} />\n {config.dataKeys.map(\n ({ key, name, color }: { key: string; name: string; color: string }) => {\n return (\n <Line\n type=\"monotone\"\n dataKey={key}\n stroke={color ?? '#4caf50'}\n name={name}\n key={key}\n />\n );\n },\n )}\n <Legend align=\"left\" />\n </LineChart>\n );\n default:\n return (\n <PieChart>\n {data.length >= 20 && (\n <ChartTooltip cursor={false} content={<ChartTooltipContent hideLabel />} />\n )}\n <Pie\n data={data}\n dataKey={config.dataKey}\n nameKey={config.nameKey}\n innerRadius={60}\n strokeWidth={10}\n label={\n data.length < 20\n ? ({ name, percent }: { name: string; percent: number; }) => `${name}: ${(percent * 100).toFixed(0)}%`\n : undefined\n }\n labelLine={false}\n />\n </PieChart>\n );\n }\n}\n\nexport function renderChart(props: any): JSX.Element {\n const { isEditable = false, gjsModel, ...rest } = props;\n\n const [allData, setAllData] = useState({\n ...props,\n });\n\n const [attributes, setAttributes] = useState({\n ...gjsModel.get('attributes'),\n });\n\n const containerRef = useRef<HTMLDivElement>(null);\n const [containerWidth, setContainerWidth] = useState<number>(0);\n\n useEffect(() => {\n gjsModel.on('change:componentProps', () => {\n setAllData({\n ...gjsModel.get('componentProps'),\n });\n });\n }, []);\n\n useEffect(() => {\n gjsModel.on('change:attributes', () => {\n setAttributes({\n ...gjsModel.get('attributes'),\n });\n });\n }, []);\n\n useEffect(() => {\n const updateContainerWidth = () => {\n if (containerRef.current) {\n setContainerWidth(containerRef.current.offsetWidth);\n }\n };\n\n updateContainerWidth();\n window.addEventListener('resize', updateContainerWidth);\n\n return () => window.removeEventListener('resize', updateContainerWidth);\n }, []);\n\n const {\n config = {},\n chartType = 'pie',\n chartData = [],\n className,\n title = 'Title',\n subTitle = 'Subtitle',\n } = allData;\n\n const defaultClasses = 'aspect-auto h-[250px] w-full';\n const mergedClasses = className ? cn(defaultClasses, className) : defaultClasses;\n\n if (chartType === 'pie') {\n const colors = getNColors(chartData.length);\n\n for (let i = 0; i < chartData.length; i++) {\n const data = chartData[i];\n\n if (!data.fill) {\n data.fill = colors[i];\n }\n }\n } else if (!config.color) {\n config.color = baseColors[Math.floor(Math.random() * baseColors.length)];\n }\n\n let width: number | undefined = undefined;\n let totalDataPoints = 0;\n\n // Helper function to get responsive config\n const getResponsiveConfig = () => {\n if (\n chartType === 'bar' &&\n totalDataPoints > 15 &&\n containerWidth > 0 &&\n width &&\n width <= containerWidth\n ) {\n // If chart fits in container, use responsive behavior\n return { ...config, chartUi: {} };\n }\n\n return config;\n };\n\n if (chartType === 'bar') {\n totalDataPoints = chartData.length * config.dataKeys.length;\n\n if (totalDataPoints > 15) {\n width =\n totalDataPoints * 20 +\n config.dataKeys.length * 8 * chartData.length +\n chartData.length * 15;\n config.chartUi = {\n barCategoryGap: '10%',\n width,\n };\n } else {\n config.chartUi = {};\n }\n }\n\n const chartUi = (attributes.interactionApiInProgress || attributes.loading) ? (\n <ChartLoader />\n ) : !chartData ? (\n renderNoDataFallback()\n ) : (\n <React.Fragment>\n {chartType === 'bar' &&\n totalDataPoints > 15 &&\n config.chartUi &&\n width &&\n (containerWidth === 0 || width > containerWidth) ? (\n <div className=\"w-full\">\n <ScrollArea className=\"w-full\">\n <div style={{ minWidth: `${width}px`, width: 'max-content' }}>\n <ResponsiveContainer width={width} height={250}>\n <ChartContainer {...rest} config={config} className={mergedClasses}>\n {renderChartComponent(chartType, chartData, config)}\n </ChartContainer>\n </ResponsiveContainer>\n </div>\n <ScrollBar orientation=\"horizontal\" />\n </ScrollArea>\n </div>\n ) : (\n <ResponsiveContainer width=\"100%\" height={250}>\n <ChartContainer {...rest} config={getResponsiveConfig()} className={mergedClasses}>\n {renderChartComponent(chartType, chartData, getResponsiveConfig())}\n </ChartContainer>\n </ResponsiveContainer>\n )}\n </React.Fragment>\n );\n\n return (\n <Card className=\"shadow border mt-2 mb-2\">\n <CardHeader>\n <CardTitle data-slot=\"title\" contentEditable={isEditable} className=\"text-2xl\">\n {title}\n </CardTitle>\n <CardDescription data-slot=\"subTitle\" contentEditable={isEditable} className=\"text-sm\">\n {subTitle}\n </CardDescription>\n </CardHeader>\n <CardContent\n ref={containerRef}\n data-slot=\"bodyContent\"\n contentEditable={false}\n className=\"px-6\"\n >\n {chartUi}\n </CardContent>\n </Card>\n );\n}\n\nexport function renderTable(props: any): JSX.Element {\n const { gjsModel, performInteraction = () => {}, ...rest } = props;\n\n const [allData, setAllData] = useState({\n ...props,\n });\n\n const cardRef = useRef<HTMLDivElement>(null);\n\n const [attributes, setAttributes] = useState({\n ...gjsModel.get('attributes'),\n });\n\n const {\n data = [],\n headerMapper: rawHeaderMapper = {},\n className,\n isEditable = false,\n title = 'Title',\n subTitle = 'Subtitle',\n actions = [],\n pagination,\n } = allData;\n\n const headerMapper = (() => {\n const cleaned = { ...rawHeaderMapper };\n\n if ('id' in cleaned) {\n delete cleaned.id;\n }\n\n if (data.length > 0) {\n const dataKeys = Object.keys(data[0] || {});\n\n return Object.fromEntries(\n Object.entries(cleaned).filter(([key]) => dataKeys.includes(key))\n );\n }\n\n return cleaned;\n })();\n\n const sortConfig = (() => {\n const { sortColumn, sortDirection } = gjsModel.get('componentProps') ?? {};\n\n return sortColumn && sortDirection ? { [sortColumn]: sortDirection } : {};\n })();\n\n useEffect(() => {\n gjsModel.on('change:componentProps', () => {\n setAllData({\n ...gjsModel.get('componentProps'),\n });\n });\n }, []);\n\n useEffect(() => {\n gjsModel.on('change:attributes', () => {\n setAttributes({\n ...gjsModel.get('attributes'),\n });\n });\n }, []);\n\n const parsedData = (() => {\n if (typeof data === 'object' && data !== null && data.name === '__peak_placeholder') {\n return [];\n }\n\n if (!Array.isArray(data)) {\n return [];\n }\n\n return data.map((datum: any) => {\n const newData = {\n ...datum,\n };\n\n delete newData.id;\n\n return newData;\n });\n })();\n\n async function onRowAction(rowIndex: number, actionId: string) {\n const id = gjsModel.get('id');\n\n await performInteraction({\n id: actionId,\n interactionType: 'tableButton',\n payload: {\n row: data[rowIndex],\n tableId: id,\n },\n affectedComponents: [],\n });\n }\n\n async function onPageChange(pageNumber: number, pageSize: number) {\n const id = gjsModel.get('id');\n const { sortColumn, sortDirection } = gjsModel.get('componentProps') ?? {};\n\n await performInteraction({\n id,\n interactionType: 'pagination',\n payload: {\n pageNumber,\n pageSize,\n ...(sortColumn && sortDirection && { sortColumn, sortDirection }),\n },\n affectedComponents: getAffectedComponentsWithLoader([id], true),\n });\n }\n\n async function handleSort(column: string, direction: SortDirection) {\n const currentProps = gjsModel.get('componentProps');\n const id = gjsModel.get('id');\n\n gjsModel.set('componentProps', {\n ...currentProps,\n sortColumn: direction ? column : null,\n sortDirection: direction,\n });\n\n await performInteraction({\n id,\n interactionType: 'tableSort',\n payload: {\n sortColumn: direction ? column : null,\n sortDirection: direction,\n tableId: id,\n },\n affectedComponents: getAffectedComponentsWithLoader([id], true),\n });\n }\n\n return (\n <Card\n ref={cardRef}\n className=\"shadow border\"\n data-component-type=\"table\"\n >\n <CardHeader>\n <CardTitle data-slot=\"title\" contentEditable={isEditable} className=\"text-2xl\">\n {title}\n </CardTitle>\n <CardDescription data-slot=\"subTitle\" contentEditable={isEditable} className=\"text-sm\">\n {subTitle}\n </CardDescription>\n </CardHeader>\n <CardContent data-slot=\"bodyContent\" contentEditable={false}>\n <DataTable\n data={parsedData}\n headerMapper={headerMapper}\n className={className}\n isEditable={isEditable}\n actions={actions}\n pagination={pagination}\n isLoading={attributes.interactionApiInProgress}\n onRowAction={onRowAction}\n onPageChange={onPageChange}\n onSort={handleSort}\n sortConfig={sortConfig}\n otherProps={rest}\n />\n </CardContent>\n </Card>\n );\n}\n\nexport function renderTab(props: any): JSX.Element {\n let tabsWidth = 200;\n\n if (props.tabs.length > 4) {\n tabsWidth = 150;\n }\n\n return (\n <Tabs defaultValue={props.defaultValue}>\n <div className=\"text-center mb-4\">\n <TabsList className=\"bg-gray-300\">\n {props.tabs.map((tab: string) => (\n <TabsTrigger value={tab} key={tab} className={`text-md w-[${tabsWidth}px]`}>\n {tab}\n </TabsTrigger>\n ))}\n </TabsList>\n </div>\n {props.tabs.map((tab: string) => (\n <TabsContent value={tab} className=\"tabs-content\" key={tab} />\n ))}\n </Tabs>\n );\n}\n\nexport function renderMarkdown(props: any): JSX.Element {\n const { gjsModel, ...rest } = props;\n\n const [allData, setAllData] = useState({\n ...props,\n });\n\n const [attributes, setAttributes] = useState({\n ...gjsModel.get('attributes'),\n });\n\n useEffect(() => {\n gjsModel.on('change:componentProps', () => {\n setAllData({\n ...gjsModel.get('componentProps'),\n });\n });\n }, []);\n\n useEffect(() => {\n gjsModel.on('change:attributes', () => {\n setAttributes({\n ...gjsModel.get('attributes'),\n });\n });\n }, []);\n\n const [isEditing, setIsEditing] = useState(false);\n const editRef = useRef<HTMLDivElement>(null);\n\n const startEditing = () => {\n setIsEditing(true);\n setTimeout(() => {\n setupEditor();\n }, 0);\n };\n\n const setupEditor = () => {\n if (!editRef.current) {\n return;\n }\n\n const editor = editRef.current;\n editor.innerHTML = '';\n editor.textContent = allData.summaryText;\n editor.focus();\n };\n\n // Save changes and exit editing mode\n const saveChanges = () => {\n if (!editRef.current) {\n return;\n }\n\n const content = editRef.current.innerText || '';\n setAllData((prev: Record<string, any>) => ({\n ...prev,\n summaryText: content,\n }));\n setIsEditing(false);\n editRef.current.innerHTML = '';\n };\n\n const markdownStyles = {\n ul: { props: { className: 'list-disc' } },\n h1: { props: { className: 'text-4xl font-bold leading-[4rem]' } },\n h2: { props: { className: 'text-3xl font-bold leading-[3rem]' } },\n h3: { props: { className: 'text-2xl font-bold leading-[2rem]' } },\n h4: { props: { className: 'text-xl font-bold leading-[2.5rem]' } },\n h5: { props: { className: 'text-lg font-bold leading-[2.5rem]' } },\n h6: { props: { className: 'text-base font-bold leading-[2rem]' } },\n };\n\n if (attributes.loading) {\n return <MarkdownLoader />\n }\n\n if (!allData.isEditable) {\n return (\n <div className=\"px-[1em]\" {...rest}>\n <div data-slot=\"summaryText\">\n <Markdown options={{ overrides: markdownStyles }}>{allData.summaryText}</Markdown>\n </div>\n </div>\n );\n }\n\n return (\n <div className=\"p-[1em]\" {...rest}>\n {isEditing ? (\n <div\n ref={editRef}\n contentEditable\n onBlur={saveChanges}\n data-slot=\"summaryText\"\n className=\"p-2 min-h-[100px] whitespace-pre-wrap\"\n suppressContentEditableWarning={true}\n style={{\n whiteSpace: 'pre-wrap',\n wordWrap: 'break-word',\n }}\n />\n ) : (\n <div\n onClick={startEditing}\n data-slot=\"summaryText\"\n style={{\n whiteSpace: 'pre-wrap',\n wordWrap: 'break-word',\n }}\n >\n <Markdown options={{ overrides: markdownStyles }}>{allData.summaryText}</Markdown>\n </div>\n )}\n </div>\n );\n}\n\nexport function renderButton(props: any): JSX.Element {\n const { isEditable = false, gjsModel, performInteraction = () => {} } = props;\n\n const [allData, setAllData] = useState({\n ...props,\n });\n\n const [attributes, setAttributes] = useState({\n ...gjsModel.get('attributes'),\n });\n\n useEffect(() => {\n gjsModel.on('change:componentProps', () => {\n setAllData({\n ...gjsModel.get('componentProps'),\n });\n });\n }, []);\n\n useEffect(() => {\n gjsModel.on('change:attributes', () => {\n setAttributes({\n ...gjsModel.get('attributes'),\n });\n });\n }, []);\n\n const {\n text,\n className,\n payload,\n variant = 'default',\n size = 'sm',\n affectedComponents,\n tooltipContent,\n } = allData;\n\n function interact() {\n const id = gjsModel.get('id');\n performInteraction({\n id,\n interactionType: 'button',\n affectedComponents: getAffectedComponentsWithLoader([id, ...affectedComponents], true),\n payload,\n });\n }\n\n return (\n <TooltipButton\n className={className}\n isEditable={isEditable}\n interact={interact}\n attributes={attributes}\n variant={variant}\n size={size}\n text={text}\n tooltipContent={tooltipContent}\n />\n );\n}\n\nconst renderActionCardWithError = (props: any) => (\n <ErrorWrapper componentProps={props}>\n {renderActionCard(props)}\n </ErrorWrapper>\n);\n\nconst renderButtonWithError = (props: any) => (\n <ErrorWrapper componentProps={props}>\n {renderButton(props)}\n </ErrorWrapper>\n);\n\nconst renderCardWithError = (props: any) => (\n <ErrorWrapper componentProps={props}>\n {renderCard(props)}\n </ErrorWrapper>\n);\n\nconst renderChartWithError = (props: any) => (\n <ErrorWrapper componentProps={props}>\n {renderChart(props)}\n </ErrorWrapper>\n);\n\nconst renderFilterWithError = (props: any) => (\n <ErrorWrapper componentProps={props}>\n {renderFilter(props)}\n </ErrorWrapper>\n);\n\nconst renderMarkdownWithError = (props: any) => (\n <ErrorWrapper componentProps={props}>\n {renderMarkdown(props)}\n </ErrorWrapper>\n);\n\nconst renderSearchWithError = (props: any) => (\n <ErrorWrapper componentProps={props}>\n {renderSearch(props)}\n </ErrorWrapper>\n);\n\nconst renderTableWithError = (props: any) => (\n <ErrorWrapper componentProps={props}>\n {renderTable(props)}\n </ErrorWrapper>\n);\n\nconst renderTabWithError = (props: any) => (\n <ErrorWrapper componentProps={props}>\n {renderTab(props)}\n </ErrorWrapper>\n);\n\n\nexport function getRenderers(): Record<string, (props: any) => JSX.Element> {\n return {\n ActionCard: renderActionCardWithError,\n Button: renderButtonWithError,\n Card: renderCardWithError,\n Chart: renderChartWithError,\n Filter: renderFilterWithError,\n Markdown: renderMarkdownWithError,\n Search: renderSearchWithError,\n Table: renderTableWithError,\n Tabs: renderTabWithError,\n };\n}\n"],"mappings":"02CAAA,sCACA,sDACA,+BACA,yDACA,+BACA,uDACA,MAAO,CAAAA,MAAM,KAAM,WAAW,CAC9B,MAAO,CAAAC,KAAK,EAAQC,SAAS,CAAEC,MAAM,CAAEC,QAAQ,KAAO,OAAO,CAC7D,OAAQC,oBAAoB,KAAO,SAAS,CAC5C,OAAQC,WAAW,KAAO,cAAc,CAExC,OAAQC,KAAK,KAAO,+BAA+B,CAEnD,MAAO,CAAAC,QAAQ,KAAM,iBAAiB,CAEtC,OACEC,GAAG,CACHC,QAAQ,CACRC,aAAa,CACbC,MAAM,CACNC,IAAI,CACJC,SAAS,CACTC,GAAG,CACHC,QAAQ,CACRC,mBAAmB,CACnBC,KAAK,CACLC,KAAK,KACA,cAAc,CAErB;AACA,MAAO,GAAK,CAAAC,OAAO,KAAM,4BAA4B,CAErD,OAAQC,aAAa,KAAO,mCAAmC,CAC/D,OACEC,IAAI,CACJC,WAAW,CACXC,eAAe,CACfC,UAAU,CACVC,UAAU,CACVC,SAAS,KACJ,iCAAiC,CACxC,OAAQC,cAAc,CAAEC,YAAY,CAAEC,mBAAmB,KAAQ,kCAAkC,CACnG,OAAQC,YAAY,KAAO,mCAAmC,CAC9D,OAAQC,UAAU,CAAEC,SAAS,KAAO,wCAAwC,CAC5E,OAAQC,YAAY,KAAO,mCAAmC,CAC9D,OAAQC,UAAU,CAAEC,WAAW,CAAEC,cAAc,KAAO,qCAAqC,CAE3F,OAAQC,IAAI,CAAEC,WAAW,CAAEC,QAAQ,CAAEC,WAAW,KAAO,iCAAiC,CAExF,OAAQC,EAAE,KAAO,oBAAoB,CACrC,OAAQC,+BAA+B,KAAO,eAAe,CAC7D,OAAQC,SAAS,KAAO,cAAc,CACtC,OAASC,YAAY,KAAQ,0CAA0C,CAEvE;AACA;AACA;AAAA,O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P,KAAM,CAAAsB,QAAA,CACjC8K,SAAS,CAACpM,KAAK,CAAC,CACL,CAAC,CAChB,CAGD,MAAO,SAAS,CAAAiQ,YAAYA,CAAA,CAAgD,CAC1E,MAAO,CACLC,UAAU,CAAEX,yBAAyB,CACrCY,MAAM,CAAEV,qBAAqB,CAC7BvU,IAAI,CAAEwU,mBAAmB,CACzBU,KAAK,CAAET,oBAAoB,CAC3BU,MAAM,CAAET,qBAAqB,CAC7BxV,QAAQ,CAAEyV,uBAAuB,CACjCS,MAAM,CAAER,qBAAqB,CAC7BS,KAAK,CAAER,oBAAoB,CAC3B7T,IAAI,CAAE8T,kBACR,CACF","ignoreList":[]}
@@ -0,0 +1,22 @@
1
+ type Size = 'small' | 'medium' | 'large';
2
+ export declare const ErrorContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
3
+ hasError: boolean;
4
+ }, never>;
5
+ export declare const ErrorBanner: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
6
+ size: Size;
7
+ }, never>;
8
+ export declare const ErrorIcon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
9
+ size: Size;
10
+ }, never>;
11
+ export declare const ErrorContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
12
+ export declare const ErrorMessage: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
13
+ size: Size;
14
+ }, never>;
15
+ export declare const ErrorType: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
16
+ size: Size;
17
+ }, never>;
18
+ export declare const ComponentContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
19
+ hasError: boolean;
20
+ size: Size;
21
+ }, never>;
22
+ export {};
@@ -0,0 +1,2 @@
1
+ import styled from"styled-components";export var ErrorContainer=styled.div.withConfig({displayName:"error-container__ErrorContainer",componentId:"sc-18iouq5-0"})(["position:relative;width:100%;height:100%;border:",";border-radius:6px;overflow:hidden;animation:",";@keyframes errorShake{0%,100%{transform:translateX(0);}25%{transform:translateX(-2px);}75%{transform:translateX(2px);}}"],function(_ref){var hasError=_ref.hasError;return hasError?"2px solid #ef4444":"none"},function(_ref2){var hasError=_ref2.hasError;return hasError?"errorShake 0.5s ease-in-out":"none"});export var ErrorBanner=styled.div.withConfig({displayName:"error-container__ErrorBanner",componentId:"sc-18iouq5-1"})(["background:linear-gradient(135deg,#ef4444 0%,#dc2626 100%);color:white;display:flex;align-items:center;gap:8px;font-weight:500;position:",";top:",";left:",";right:",";z-index:",";transform:",";transform-origin:top left;max-width:",";border-radius:",";box-shadow:",";padding:",";font-size:",";"],function(_ref3){var size=_ref3.size;return size==="small"?"absolute":"relative"},function(_ref4){var size=_ref4.size;return size==="small"?"4px":"auto"},function(_ref5){var size=_ref5.size;return size==="small"?"4px":"auto"},function(_ref6){var size=_ref6.size;return size==="small"?"4px":"auto"},function(_ref7){var size=_ref7.size;return size==="small"?10:"auto"},function(_ref8){var size=_ref8.size;return size==="small"?"scale(0.8)":"none"},function(_ref9){var size=_ref9.size;return size==="small"?"90%":"100%"},function(_ref10){var size=_ref10.size;return size==="small"?"4px":"0"},function(_ref11){var size=_ref11.size;return size==="small"?"0 2px 4px rgba(0, 0, 0, 0.2)":"none"},function(_ref12){var size=_ref12.size;switch(size){case"small":return"4px 8px";case"medium":return"6px 10px";case"large":return"8px 12px";default:return"6px 10px"}},function(_ref13){var size=_ref13.size;switch(size){case"small":return"10px";case"medium":return"11px";case"large":return"12px";default:return"11px"}});export var ErrorIcon=styled.div.withConfig({displayName:"error-container__ErrorIcon",componentId:"sc-18iouq5-2"})(["font-size:",";flex-shrink:0;"],function(_ref14){var size=_ref14.size;switch(size){case"small":return"12px";case"medium":return"13px";case"large":return"14px";default:return"13px"}});export var ErrorContent=styled.div.withConfig({displayName:"error-container__ErrorContent",componentId:"sc-18iouq5-3"})(["flex:1;min-width:0;"]);export var ErrorMessage=styled.div.withConfig({displayName:"error-container__ErrorMessage",componentId:"sc-18iouq5-4"})(["font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:",";"],function(_ref15){var size=_ref15.size;return size==="small"?"0":"1px"});export var ErrorType=styled.div.withConfig({displayName:"error-container__ErrorType",componentId:"sc-18iouq5-5"})(["opacity:0.9;font-size:",";text-transform:uppercase;letter-spacing:",";"],function(_ref16){var size=_ref16.size;switch(size){case"small":return"9px";case"medium":return"10px";case"large":return"11px";default:return"10px"}},function(_ref17){var size=_ref17.size;return size==="small"?"0.2px":"0.3px"});export var ComponentContent=styled.div.withConfig({displayName:"error-container__ComponentContent",componentId:"sc-18iouq5-6"})(["flex:1;background:",";padding:",";padding-top:",";min-height:",";display:flex;flex-direction:column;"],function(_ref18){var hasError=_ref18.hasError;return hasError?"rgba(239, 68, 68, 0.05)":"transparent"},function(_ref19){var hasError=_ref19.hasError,size=_ref19.size;if(!hasError){return"0"}switch(size){case"small":return"4px";case"medium":return"6px";case"large":return"8px";default:return"6px"}},function(_ref20){var hasError=_ref20.hasError,size=_ref20.size;if(!hasError){return"0"}return size==="small"?"20px":"8px"},function(_ref21){var hasError=_ref21.hasError,size=_ref21.size;return hasError&&size==="small"?"60px":"auto"});
2
+ //# sourceMappingURL=error-container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-container.js","names":["styled","ErrorContainer","div","withConfig","displayName","componentId","_ref","hasError","_ref2","ErrorBanner","_ref3","size","_ref4","_ref5","_ref6","_ref7","_ref8","_ref9","_ref10","_ref11","_ref12","_ref13","ErrorIcon","_ref14","ErrorContent","ErrorMessage","_ref15","ErrorType","_ref16","_ref17","ComponentContent","_ref18","_ref19","_ref20","_ref21"],"sources":["../../../../src/shadcn/components/ui/error-container.tsx"],"sourcesContent":["import styled from 'styled-components';\n\ntype Size = 'small' | 'medium' | 'large';\n\nexport const ErrorContainer = styled.div<{ hasError: boolean }>`\n position: relative;\n width: 100%;\n height: 100%;\n border: ${({ hasError }) => (hasError ? '2px solid #ef4444' : 'none')};\n border-radius: 6px;\n overflow: hidden;\n animation: ${({ hasError }) => (hasError ? 'errorShake 0.5s ease-in-out' : 'none')};\n\n @keyframes errorShake {\n 0%, 100% { transform: translateX(0); }\n 25% { transform: translateX(-2px); }\n 75% { transform: translateX(2px); }\n }\n`;\n\nexport const ErrorBanner = styled.div<{ size: Size }>`\n background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);\n color: white;\n display: flex;\n align-items: center;\n gap: 8px;\n font-weight: 500;\n position: ${({ size }) => (size === 'small' ? 'absolute' : 'relative')};\n top: ${({ size }) => (size === 'small' ? '4px' : 'auto')};\n left: ${({ size }) => (size === 'small' ? '4px' : 'auto')};\n right: ${({ size }) => (size === 'small' ? '4px' : 'auto')};\n z-index: ${({ size }) => (size === 'small' ? 10 : 'auto')};\n transform: ${({ size }) => (size === 'small' ? 'scale(0.8)' : 'none')};\n transform-origin: top left;\n max-width: ${({ size }) => (size === 'small' ? '90%' : '100%')};\n border-radius: ${({ size }) => (size === 'small' ? '4px' : '0')};\n box-shadow: ${({ size }) =>\n size === 'small' ? '0 2px 4px rgba(0, 0, 0, 0.2)' : 'none'};\n\n padding: ${({ size }) => {\n switch (size) {\n case 'small': return '4px 8px';\n case 'medium': return '6px 10px';\n case 'large': return '8px 12px';\n default: return '6px 10px';\n }\n }};\n\n font-size: ${({ size }) => {\n switch (size) {\n case 'small': return '10px';\n case 'medium': return '11px';\n case 'large': return '12px';\n default: return '11px';\n }\n }};\n`;\n\nexport const ErrorIcon = styled.div<{ size: Size }>`\n font-size: ${({ size }) => {\n switch (size) {\n case 'small': return '12px';\n case 'medium': return '13px';\n case 'large': return '14px';\n default: return '13px';\n }\n }};\n flex-shrink: 0;\n`;\n\nexport const ErrorContent = styled.div`\n flex: 1;\n min-width: 0;\n`;\n\nexport const ErrorMessage = styled.div<{ size: Size }>`\n font-weight: 600;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n margin-bottom: ${({ size }) => (size === 'small' ? '0' : '1px')};\n`;\n\nexport const ErrorType = styled.div<{ size: Size }>`\n opacity: 0.9;\n font-size: ${({ size }) => {\n switch (size) {\n case 'small': return '9px';\n case 'medium': return '10px';\n case 'large': return '11px';\n default: return '10px';\n }\n }};\n text-transform: uppercase;\n letter-spacing: ${({ size }) => (size === 'small' ? '0.2px' : '0.3px')};\n`;\n\nexport const ComponentContent = styled.div<{ hasError: boolean; size: Size }>`\n flex: 1;\n background: ${({ hasError }) =>\n hasError ? 'rgba(239, 68, 68, 0.05)' : 'transparent'};\n\n padding: ${({ hasError, size }) => {\n if (!hasError) {return '0';}\n\n switch (size) {\n case 'small': return '4px';\n case 'medium': return '6px';\n case 'large': return '8px';\n default: return '6px';\n }\n }};\n\n padding-top: ${({ hasError, size }) => {\n if (!hasError) {return '0';}\n\n return size === 'small' ? '20px' : '8px';\n }};\n\n min-height: ${({ hasError, size }) =>\n hasError && size === 'small' ? '60px' : 'auto'};\n\n display: flex;\n flex-direction: column;\n`;\n"],"mappings":"AAAA,MAAO,CAAAA,MAAM,KAAM,mBAAmB,CAItC,MAAO,IAAM,CAAAC,cAAc,CAAGD,MAAM,CAACE,GAAG,CAAAC,UAAA,EAAAC,WAAA,mCAAAC,WAAA,kPAI5B,SAAAC,IAAA,KAAG,CAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,OAAQ,CAAAA,QAAQ,CAAG,mBAAmB,CAAG,MAAM,CAAC,CAGxD,SAAAC,KAAA,KAAG,CAAAD,QAAQ,CAAAC,KAAA,CAARD,QAAQ,OAAQ,CAAAA,QAAQ,CAAG,6BAA6B,CAAG,MAAM,CAAC,CAOnF,CAED,MAAO,IAAM,CAAAE,WAAW,CAAGT,MAAM,CAACE,GAAG,CAAAC,UAAA,EAAAC,WAAA,gCAAAC,WAAA,2TAOvB,SAAAK,KAAA,KAAG,CAAAC,IAAI,CAAAD,KAAA,CAAJC,IAAI,OAAQ,CAAAA,IAAI,GAAK,OAAO,CAAG,UAAU,CAAG,UAAU,CAAC,CAC/D,SAAAC,KAAA,KAAG,CAAA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fo = {
3
+ message: string;
4
+ type?: string;
5
+ };
6
+ type ComponentProps = {
7
+ error?: ErrorInfo;
8
+ componentType?: string;
9
+ [key: string]: unknown;
10
+ };
11
+ type ErrorWrapperProps = {
12
+ children: React.ReactNode;
13
+ componentProps: ComponentProps;
14
+ className?: string;
15
+ };
16
+ export declare function ErrorWrapper({ children, componentProps, className }: ErrorWrapperProps): import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from"react";import{ComponentContent,ErrorBanner,ErrorContainer,ErrorContent,ErrorIcon,ErrorMessage,ErrorType}from"./error-container";import{Fragment as _Fragment,jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";export function ErrorWrapper(_ref){var children=_ref.children,componentProps=_ref.componentProps,_ref$className=_ref.className,className=_ref$className===void 0?"":_ref$className;var error=componentProps.error;if(!error){return/*#__PURE__*/_jsx(_Fragment,{children:children})}function getSize(){var componentType=componentProps.componentType||"medium";if(componentType==="Button"||componentType==="Search"){return"small"}if(componentType==="Filter"||componentType==="Markdown"){return"medium"}return"large"}var size=getSize();return/*#__PURE__*/_jsxs(ErrorContainer,{hasError:true,className:className,children:[/*#__PURE__*/_jsxs(ErrorBanner,{size:size,children:[/*#__PURE__*/_jsx(ErrorIcon,{size:size,children:"\u26A0\uFE0F"}),/*#__PURE__*/_jsxs(ErrorContent,{children:[/*#__PURE__*/_jsx(ErrorMessage,{size:size,children:size==="small"?error.message.substring(0,20)+"...":error.message}),size!=="small"&&error.type&&/*#__PURE__*/_jsx(ErrorType,{size:size,children:error.type})]})]}),/*#__PURE__*/_jsx(ComponentContent,{hasError:true,size:size,children:children})]})}
2
+ //# sourceMappingURL=error-wrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-wrapper.js","names":["React","ComponentContent","ErrorBanner","ErrorContainer","ErrorContent","ErrorIcon","ErrorMessage","ErrorType","Fragment","_Fragment","jsx","_jsx","jsxs","_jsxs","ErrorWrapper","_ref","children","componentProps","_ref$className","className","error","getSize","componentType","size","hasError","message","substring","type"],"sources":["../../../../src/shadcn/components/ui/error-wrapper.tsx"],"sourcesContent":["import React from 'react';\nimport {\n ComponentContent,\n ErrorBanner,\n ErrorContainer,\n ErrorContent,\n ErrorIcon,\n ErrorMessage,\n ErrorType\n} from \"./error-container\";\n\ntype ErrorInfo = {\n message: string;\n type?: string;\n};\n\ntype ComponentProps = {\n error?: ErrorInfo;\n componentType?: string;\n [key: string]: unknown; // allow extra props if needed\n};\n\ntype ErrorWrapperProps = {\n children: React.ReactNode;\n componentProps: ComponentProps;\n className?: string;\n};\n\nexport function ErrorWrapper({ children, componentProps, className = '' }: ErrorWrapperProps) {\n const error = componentProps.error;\n\n if (!error) {\n return <>{children}</>;\n }\n\n function getSize(): 'small' | 'medium' | 'large' {\n const componentType = componentProps.componentType || 'medium';\n\n if (componentType === 'Button' || componentType === 'Search') {\n return 'small';\n }\n\n if (componentType === 'Filter' || componentType === 'Markdown') {\n return 'medium';\n }\n\n return 'large';\n }\n\n const size = getSize();\n\n return (\n <ErrorContainer hasError className={className}>\n <ErrorBanner size={size}>\n <ErrorIcon size={size}>⚠️</ErrorIcon>\n <ErrorContent>\n <ErrorMessage size={size}>\n {size === 'small'\n ? `${error.message.substring(0, 20)}...`\n : error.message}\n </ErrorMessage>\n {size !== 'small' && error.type && (\n <ErrorType size={size}>{error.type}</ErrorType>\n )}\n </ErrorContent>\n </ErrorBanner>\n\n <ComponentContent hasError size={size}>\n {children}\n </ComponentContent>\n </ErrorContainer>\n );\n}\n"],"mappings":"AAAA,MAAO,CAAAA,KAAK,KAAM,OAAO,CACzB,OACEC,gBAAgB,CAChBC,WAAW,CACXC,cAAc,CACdC,YAAY,CACZC,SAAS,CACTC,YAAY,CACZC,SAAS,KACJ,mBAAmB,CAAC,OAAAC,QAAA,IAAAC,SAAA,CAAAC,GAAA,IAAAC,IAAA,CAAAC,IAAA,IAAAC,KAAA,yBAmB3B,MAAO,SAAS,CAAAC,YAAYA,CAAAC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AACgB,IAAI,CAAEA,IAAK,CAAAP,QAAA,CAAEI,KAAK,CAACO,IAAI,CAAY,CAC/C,EACW,CAAC,EACJ,CAAC,cAEdhB,IAAA,CAACV,gBAAgB,EAACuB,QAAQ,MAACD,IAAI,CAAEA,IAAK,CAAAP,QAAA,CACnCA,QAAQ,CACO,CAAC,EACL,CAEpB","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _extends from"@babel/runtime/helpers/extends";import _regeneratorRuntime from"@babel/runtime/regenerator";/* eslint-disable @typescript-eslint/no-explicit-any */import{useCallback,useEffect,useRef,useState}from"react";import{ChevronDown,ChevronUp,ListFilter as FilterIcon,Loader2Icon}from"lucide-react";import{Button}from"./button";import{Checkbox}from"./checkbox";import{ScrollArea}from"./scroll-area";import{getAffectedComponentsWithLoader}from"../../../helpers";import{renderDateFilter}from"./date-filter";import{ErrorState}from"./skeleton";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function FilterHeader(_ref){var label=_ref.label,count=_ref.count,isDisabled=_ref.isDisabled,isDropdownOpen=_ref.isDropdownOpen,isLoading=_ref.isLoading,toggleOpen=_ref.toggleOpen;var ChevronIcon=isDropdownOpen?ChevronUp:ChevronDown;return/*#__PURE__*/_jsxs(Button,{variant:"outline",size:"sm",disabled:isDisabled,onClick:toggleOpen,className:"px-2",children:[/*#__PURE__*/_jsx(FilterIcon,{size:16}),count>0?label+" ("+count+")":label,isLoading?/*#__PURE__*/_jsx(Loader2Icon,{className:"ml-2 animate-spin",size:16}):/*#__PURE__*/_jsx(ChevronIcon,{size:16,className:"ml-1"})]})}function FilterActions(_ref2){var selected=_ref2.selected,allSelected=_ref2.allSelected,onClear=_ref2.onClear,onSelectAll=_ref2.onSelectAll,isDisabled=_ref2.isDisabled;return/*#__PURE__*/_jsxs("div",{className:"flex items-center mb-3",children:[/*#__PURE__*/_jsx(Checkbox,{checked:allSelected,onCheckedChange:function onCheckedChange(){return allSelected?onClear():onSelectAll()},disabled:isDisabled}),/*#__PURE__*/_jsx("span",{className:"ml-2 text-sm text-gray-900",children:"Select All"}),selected.length>0&&/*#__PURE__*/_jsx("button",{type:"button",className:"ml-auto text-sm text-blue-600 hover:underline",onMouseDown:function onMouseDown(e){e.stopPropagation();e.preventDefault()},onClick:onClear,disabled:isDisabled,children:"Clear All"})]})}function FilterOptionList(_ref3){var options=_ref3.options,selected=_ref3.selected,onToggle=_ref3.onToggle,isDisabled=_ref3.isDisabled;return/*#__PURE__*/_jsx(ScrollArea,{viewportClassName:"max-h-48 overflow-y-auto mb-4 space-y-2",children:options.length>0?options.map(function(opt){return/*#__PURE__*/_jsxs("label",{className:"flex items-center space-x-2 hover:bg-gray-100 rounded p-1 transition hover:cursor-pointer",onClick:function onClick(e){e.preventDefault();e.stopPropagation();if(!isDisabled){onToggle(opt.value)}},children:[/*#__PURE__*/_jsx(Checkbox,{checked:selected.includes(opt.value),onChange:function onChange(){// Prevent checkbox from toggling when clicking label
2
- },disabled:isDisabled}),/*#__PURE__*/_jsx("span",{className:"text-sm text-gray-900",children:opt.label})]},opt.value)}):/*#__PURE__*/_jsx("div",{className:"text-sm text-gray-500",children:"No results found"})})}export function renderFilter(_ref4){var gjsModel=_ref4.gjsModel,performInteraction=_ref4.performInteraction;var _useState=useState(_extends({},gjsModel.get("componentProps"))),componentData=_useState[0],setComponentData=_useState[1];var _componentData$option=componentData.options,options=_componentData$option===void 0?[]:_componentData$option,_componentData$value=componentData.value,value=_componentData$value===void 0?[]:_componentData$value,_componentData$classN=componentData.className,className=_componentData$classN===void 0?"":_componentData$classN,_componentData$affect=componentData.affectedComponents,affectedComponents=_componentData$affect===void 0?[]:_componentData$affect,_componentData$text=componentData.text,label=_componentData$text===void 0?"Filter":_componentData$text,_componentData$filter=componentData.filterType,filterType=_componentData$filter===void 0?"multiselect":_componentData$filter;var actualOptions=function(){if(options&&typeof options==="object"&&options.name==="__peak_placeholder"){return[]}return Array.isArray(options)?options:[]}();if(filterType==="date"){return renderDateFilter({gjsModel:gjsModel,performInteraction:performInteraction})}var wrapperRef=useRef(null);var _useState2=useState(_extends({},gjsModel.get("attributes"))),attributes=_useState2[0],setAttributes=_useState2[1];var _useState3=useState(false),isDropdownOpen=_useState3[0],setIsDropdownOpen=_useState3[1];var _useState4=useState(""),searchQuery=_useState4[0],setSearchQuery=_useState4[1];var _useState5=useState(false),isApplying=_useState5[0],setIsApplying=_useState5[1];var _useState6=useState({left:"auto",right:"0"}),dropdownPosition=_useState6[0],setDropdownPosition=_useState6[1];var defaultValue=componentData["default"]||[];var _useState7=useState(function(){return Array.isArray(value)&&value.length>0?value:defaultValue}),selectedValues=_useState7[0],setSelectedValues=_useState7[1];var isMultiSelect=filterType==="multiselect";var hasPlaceholderOptions=options&&typeof options==="object"&&options.name==="__peak_placeholder";var isBusy=attributes.interactionApiInProgress||isApplying||attributes.loading||hasPlaceholderOptions;var allOptionsSelected=selectedValues.length===actualOptions.length&&actualOptions.length>0;useEffect(function(){var _document$getElementB;if(!isDropdownOpen||!wrapperRef.current){return}var filterRect=wrapperRef.current.getBoundingClientRect();var dropdownWidth=256;var iframeViewportWidth=document.documentElement.clientWidth;var iframeBodyWidth=((_document$getElementB=document.getElementById("dashboard-root"))==null?void 0:_document$getElementB.clientWidth)||iframeViewportWidth;var spaceToRight=iframeBodyWidth-filterRect.right;var spaceToLeft=filterRect.left;if(spaceToLeft>=dropdownWidth){setDropdownPosition({left:"auto",right:"0px"})}else if(spaceToRight<dropdownWidth&&spaceToLeft<dropdownWidth){var shiftLeft=dropdownWidth-spaceToRight+16;setDropdownPosition({left:"-"+shiftLeft+"px",right:"auto"})}else if(spaceToRight>=dropdownWidth){setDropdownPosition({left:"0px",right:"auto"})}},[isDropdownOpen]);useEffect(function(){function updateComponentData(){setComponentData(_extends({},gjsModel.get("componentProps")))}function updateAttributes(){setAttributes(_extends({},gjsModel.get("attributes")))}gjsModel.on("change:componentProps",updateComponentData);gjsModel.on("change:attributes",updateAttributes);return function(){gjsModel.off("change:componentProps",updateComponentData);gjsModel.off("change:attributes",updateAttributes)}},[gjsModel]);useEffect(function(){var _wrapperRef$current$o,_wrapperRef$current;var doc=(_wrapperRef$current$o=(_wrapperRef$current=wrapperRef.current)==null?void 0:_wrapperRef$current.ownerDocument)!=null?_wrapperRef$current$o:document;function handleOutsideClick(e){if(isDropdownOpen&&wrapperRef.current&&!wrapperRef.current.contains(e.target)){setIsDropdownOpen(false)}}function handleEscape(e){if(e.key==="Escape"){setIsDropdownOpen(false)}}doc.addEventListener("pointerdown",handleOutsideClick);doc.addEventListener("keydown",handleEscape);return function(){doc.removeEventListener("pointerdown",handleOutsideClick);doc.removeEventListener("keydown",handleEscape)}},[isDropdownOpen]);var filteredOptions=actualOptions.filter(function(opt){return String(opt.label).toLowerCase().includes(searchQuery.toLowerCase())});function updateAndApply(_x){return _updateAndApply.apply(this,arguments)}function _updateAndApply(){_updateAndApply=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(newValues){var id;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(newValues===void 0){newValues=selectedValues}setIsApplying(true);_context.prev=2;gjsModel.set("componentProps",_extends({},gjsModel.get("componentProps"),{value:newValues}));id=gjsModel.get("id");_context.next=7;return performInteraction({interactionType:"filter",id:id,affectedComponents:getAffectedComponentsWithLoader([id].concat(affectedComponents),true)});case 7:_context.prev=7;setIsApplying(false);setIsDropdownOpen(false);return _context.finish(7);case 11:case"end":return _context.stop()}},_callee,null,[[2,,7,11]])}));return _updateAndApply.apply(this,arguments)}var handleOptionToggle=useCallback(function(val){if(isMultiSelect){setSelectedValues(function(prev){return prev.includes(val)?prev.filter(function(v){return v!==val}):[].concat(prev,[val])})}else{if(selectedValues.includes(val)){setSelectedValues([]);updateAndApply([])}else{var singleValue=[val];setSelectedValues(singleValue);updateAndApply(singleValue)}}},[isMultiSelect,selectedValues]);function handleClearAll(){setSelectedValues([])}function handleSelectAll(){setSelectedValues(actualOptions.map(function(o){return o.value}))}if(attributes.error){return/*#__PURE__*/_jsx("div",{ref:wrapperRef,className:"relative inline-block "+className,style:{color:"#2A44D4",backgroundColor:"rgb(255 255 255)"},children:/*#__PURE__*/_jsx(ErrorState,{errorMessage:attributes.errorMessage||"Failed to load filter",variant:"minimal"})})}return/*#__PURE__*/_jsxs("div",{ref:wrapperRef,className:"relative inline-block "+className,style:{color:"#2A44D4",backgroundColor:"rgb(255 255 255)"},children:[/*#__PURE__*/_jsx(FilterHeader,{label:label,count:selectedValues.length,isDisabled:isBusy,isDropdownOpen:isDropdownOpen,isLoading:isBusy,toggleOpen:function toggleOpen(){return setIsDropdownOpen(function(prev){return!prev})}}),isDropdownOpen&&/*#__PURE__*/_jsxs("div",{className:"absolute top-full mt-2 w-64 bg-white border rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 p-4 z-50",style:dropdownPosition,children:[/*#__PURE__*/_jsx("input",{type:"text",placeholder:"Search...",value:searchQuery,onChange:function onChange(e){return setSearchQuery(e.target.value)},className:"w-full mb-3 px-2 py-1 border rounded focus:outline-none",disabled:isBusy}),isMultiSelect&&/*#__PURE__*/_jsx(FilterActions,{selected:selectedValues,allSelected:allOptionsSelected,onClear:handleClearAll,onSelectAll:handleSelectAll,isDisabled:isBusy}),/*#__PURE__*/_jsx(FilterOptionList,{options:filteredOptions,selected:selectedValues,onToggle:handleOptionToggle,isDisabled:isBusy}),isMultiSelect&&/*#__PURE__*/_jsxs("div",{className:"flex justify-end space-x-2",children:[/*#__PURE__*/_jsx(Button,{variant:"ghost",size:"sm",onClick:function onClick(){return setIsDropdownOpen(false)},disabled:isApplying,children:"Cancel"}),/*#__PURE__*/_jsxs(Button,{variant:"default",size:"sm",onClick:function onClick(){return updateAndApply(selectedValues)},disabled:isBusy,children:[isApplying&&/*#__PURE__*/_jsx(Loader2Icon,{className:"animate-spin mr-2",size:16}),"Apply"]})]})]})]})}
1
+ import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _extends from"@babel/runtime/helpers/extends";import _regeneratorRuntime from"@babel/runtime/regenerator";/* eslint-disable @typescript-eslint/no-explicit-any */import{useCallback,useEffect,useRef,useState}from"react";import{ChevronDown,ChevronUp,ListFilter as FilterIcon,Loader2Icon}from"lucide-react";import{Button}from"./button";import{Checkbox}from"./checkbox";import{ScrollArea}from"./scroll-area";import{getAffectedComponentsWithLoader}from"../../../helpers";import{renderDateFilter}from"./date-filter";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function FilterHeader(_ref){var label=_ref.label,count=_ref.count,isDisabled=_ref.isDisabled,isDropdownOpen=_ref.isDropdownOpen,isLoading=_ref.isLoading,toggleOpen=_ref.toggleOpen;var ChevronIcon=isDropdownOpen?ChevronUp:ChevronDown;return/*#__PURE__*/_jsxs(Button,{variant:"outline",size:"sm",disabled:isDisabled,onClick:toggleOpen,className:"px-2",children:[/*#__PURE__*/_jsx(FilterIcon,{size:16}),count>0?label+" ("+count+")":label,isLoading?/*#__PURE__*/_jsx(Loader2Icon,{className:"ml-2 animate-spin",size:16}):/*#__PURE__*/_jsx(ChevronIcon,{size:16,className:"ml-1"})]})}function FilterActions(_ref2){var selected=_ref2.selected,allSelected=_ref2.allSelected,onClear=_ref2.onClear,onSelectAll=_ref2.onSelectAll,isDisabled=_ref2.isDisabled;return/*#__PURE__*/_jsxs("div",{className:"flex items-center mb-3",children:[/*#__PURE__*/_jsx(Checkbox,{checked:allSelected,onCheckedChange:function onCheckedChange(){return allSelected?onClear():onSelectAll()},disabled:isDisabled}),/*#__PURE__*/_jsx("span",{className:"ml-2 text-sm text-gray-900",children:"Select All"}),selected.length>0&&/*#__PURE__*/_jsx("button",{type:"button",className:"ml-auto text-sm text-blue-600 hover:underline",onMouseDown:function onMouseDown(e){e.stopPropagation();e.preventDefault()},onClick:onClear,disabled:isDisabled,children:"Clear All"})]})}function FilterOptionList(_ref3){var options=_ref3.options,selected=_ref3.selected,onToggle=_ref3.onToggle,isDisabled=_ref3.isDisabled;return/*#__PURE__*/_jsx(ScrollArea,{viewportClassName:"max-h-48 overflow-y-auto mb-4 space-y-2",children:options.length>0?options.map(function(opt){return/*#__PURE__*/_jsxs("label",{className:"flex items-center space-x-2 hover:bg-gray-100 rounded p-1 transition hover:cursor-pointer",onClick:function onClick(e){e.preventDefault();e.stopPropagation();if(!isDisabled){onToggle(opt.value)}},children:[/*#__PURE__*/_jsx(Checkbox,{checked:selected.includes(opt.value),onChange:function onChange(){// Prevent checkbox from toggling when clicking label
2
+ },disabled:isDisabled}),/*#__PURE__*/_jsx("span",{className:"text-sm text-gray-900",children:opt.label})]},opt.value)}):/*#__PURE__*/_jsx("div",{className:"text-sm text-gray-500",children:"No results found"})})}export function renderFilter(_ref4){var gjsModel=_ref4.gjsModel,performInteraction=_ref4.performInteraction;var _useState=useState(_extends({},gjsModel.get("componentProps"))),componentData=_useState[0],setComponentData=_useState[1];var _componentData$option=componentData.options,options=_componentData$option===void 0?[]:_componentData$option,_componentData$value=componentData.value,value=_componentData$value===void 0?[]:_componentData$value,_componentData$classN=componentData.className,className=_componentData$classN===void 0?"":_componentData$classN,_componentData$affect=componentData.affectedComponents,affectedComponents=_componentData$affect===void 0?[]:_componentData$affect,_componentData$text=componentData.text,label=_componentData$text===void 0?"Filter":_componentData$text,_componentData$filter=componentData.filterType,filterType=_componentData$filter===void 0?"multiselect":_componentData$filter;var actualOptions=function(){if(options&&typeof options==="object"&&options.name==="__peak_placeholder"){return[]}return Array.isArray(options)?options:[]}();if(filterType==="date"){return renderDateFilter({gjsModel:gjsModel,performInteraction:performInteraction})}var wrapperRef=useRef(null);var _useState2=useState(_extends({},gjsModel.get("attributes"))),attributes=_useState2[0],setAttributes=_useState2[1];var _useState3=useState(false),isDropdownOpen=_useState3[0],setIsDropdownOpen=_useState3[1];var _useState4=useState(""),searchQuery=_useState4[0],setSearchQuery=_useState4[1];var _useState5=useState(false),isApplying=_useState5[0],setIsApplying=_useState5[1];var _useState6=useState({left:"auto",right:"0"}),dropdownPosition=_useState6[0],setDropdownPosition=_useState6[1];var defaultValue=componentData["default"]||[];var _useState7=useState(function(){return Array.isArray(value)&&value.length>0?value:defaultValue}),selectedValues=_useState7[0],setSelectedValues=_useState7[1];var isMultiSelect=filterType==="multiselect";var hasPlaceholderOptions=options&&typeof options==="object"&&options.name==="__peak_placeholder";var isBusy=attributes.interactionApiInProgress||isApplying||attributes.loading||hasPlaceholderOptions;var allOptionsSelected=selectedValues.length===actualOptions.length&&actualOptions.length>0;useEffect(function(){var _document$getElementB;if(!isDropdownOpen||!wrapperRef.current){return}var filterRect=wrapperRef.current.getBoundingClientRect();var dropdownWidth=256;var iframeViewportWidth=document.documentElement.clientWidth;var iframeBodyWidth=((_document$getElementB=document.getElementById("dashboard-root"))==null?void 0:_document$getElementB.clientWidth)||iframeViewportWidth;var spaceToRight=iframeBodyWidth-filterRect.right;var spaceToLeft=filterRect.left;if(spaceToLeft>=dropdownWidth){setDropdownPosition({left:"auto",right:"0px"})}else if(spaceToRight<dropdownWidth&&spaceToLeft<dropdownWidth){var shiftLeft=dropdownWidth-spaceToRight+16;setDropdownPosition({left:"-"+shiftLeft+"px",right:"auto"})}else if(spaceToRight>=dropdownWidth){setDropdownPosition({left:"0px",right:"auto"})}},[isDropdownOpen]);useEffect(function(){function updateComponentData(){setComponentData(_extends({},gjsModel.get("componentProps")))}function updateAttributes(){setAttributes(_extends({},gjsModel.get("attributes")))}gjsModel.on("change:componentProps",updateComponentData);gjsModel.on("change:attributes",updateAttributes);return function(){gjsModel.off("change:componentProps",updateComponentData);gjsModel.off("change:attributes",updateAttributes)}},[gjsModel]);useEffect(function(){var _wrapperRef$current$o,_wrapperRef$current;var doc=(_wrapperRef$current$o=(_wrapperRef$current=wrapperRef.current)==null?void 0:_wrapperRef$current.ownerDocument)!=null?_wrapperRef$current$o:document;function handleOutsideClick(e){if(isDropdownOpen&&wrapperRef.current&&!wrapperRef.current.contains(e.target)){setIsDropdownOpen(false)}}function handleEscape(e){if(e.key==="Escape"){setIsDropdownOpen(false)}}doc.addEventListener("pointerdown",handleOutsideClick);doc.addEventListener("keydown",handleEscape);return function(){doc.removeEventListener("pointerdown",handleOutsideClick);doc.removeEventListener("keydown",handleEscape)}},[isDropdownOpen]);var filteredOptions=actualOptions.filter(function(opt){return String(opt.label).toLowerCase().includes(searchQuery.toLowerCase())});function updateAndApply(_x){return _updateAndApply.apply(this,arguments)}function _updateAndApply(){_updateAndApply=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(newValues){var id;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(newValues===void 0){newValues=selectedValues}setIsApplying(true);_context.prev=2;gjsModel.set("componentProps",_extends({},gjsModel.get("componentProps"),{value:newValues}));id=gjsModel.get("id");_context.next=7;return performInteraction({interactionType:"filter",id:id,affectedComponents:getAffectedComponentsWithLoader([id].concat(affectedComponents),true)});case 7:_context.prev=7;setIsApplying(false);setIsDropdownOpen(false);return _context.finish(7);case 11:case"end":return _context.stop()}},_callee,null,[[2,,7,11]])}));return _updateAndApply.apply(this,arguments)}var handleOptionToggle=useCallback(function(val){if(isMultiSelect){setSelectedValues(function(prev){return prev.includes(val)?prev.filter(function(v){return v!==val}):[].concat(prev,[val])})}else{if(selectedValues.includes(val)){setSelectedValues([]);updateAndApply([])}else{var singleValue=[val];setSelectedValues(singleValue);updateAndApply(singleValue)}}},[isMultiSelect,selectedValues]);function handleClearAll(){setSelectedValues([])}function handleSelectAll(){setSelectedValues(actualOptions.map(function(o){return o.value}))}return/*#__PURE__*/_jsxs("div",{ref:wrapperRef,className:"relative inline-block "+className,style:{color:"#2A44D4",backgroundColor:"rgb(255 255 255)"},children:[/*#__PURE__*/_jsx(FilterHeader,{label:label,count:selectedValues.length,isDisabled:isBusy,isDropdownOpen:isDropdownOpen,isLoading:isBusy,toggleOpen:function toggleOpen(){return setIsDropdownOpen(function(prev){return!prev})}}),isDropdownOpen&&/*#__PURE__*/_jsxs("div",{className:"absolute top-full mt-2 w-64 bg-white border rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 p-4 z-50",style:dropdownPosition,children:[/*#__PURE__*/_jsx("input",{type:"text",placeholder:"Search...",value:searchQuery,onChange:function onChange(e){return setSearchQuery(e.target.value)},className:"w-full mb-3 px-2 py-1 border rounded focus:outline-none",disabled:isBusy}),isMultiSelect&&/*#__PURE__*/_jsx(FilterActions,{selected:selectedValues,allSelected:allOptionsSelected,onClear:handleClearAll,onSelectAll:handleSelectAll,isDisabled:isBusy}),/*#__PURE__*/_jsx(FilterOptionList,{options:filteredOptions,selected:selectedValues,onToggle:handleOptionToggle,isDisabled:isBusy}),isMultiSelect&&/*#__PURE__*/_jsxs("div",{className:"flex justify-end space-x-2",children:[/*#__PURE__*/_jsx(Button,{variant:"ghost",size:"sm",onClick:function onClick(){return setIsDropdownOpen(false)},disabled:isApplying,children:"Cancel"}),/*#__PURE__*/_jsxs(Button,{variant:"default",size:"sm",onClick:function onClick(){return updateAndApply(selectedValues)},disabled:isBusy,children:[isApplying&&/*#__PURE__*/_jsx(Loader2Icon,{className:"animate-spin mr-2",size:16}),"Apply"]})]})]})]})}
3
3
  //# sourceMappingURL=filter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filter.js","names":["useCallback","useEffect","useRef","useState","ChevronDown","ChevronUp","ListFilter","FilterIcon","Loader2Icon","Button","Checkbox","ScrollArea","getAffectedComponentsWithLoader","renderDateFilter","ErrorState","jsx","_jsx","jsxs","_jsxs","FilterHeader","_ref","label","count","isDisabled","isDropdownOpen","isLoading","toggleOpen","ChevronIcon","variant","size","disabled","onClick","className","children","FilterActions","_ref2","selected","allSelected","onClear","onSelectAll","checked","onCheckedChange","length","type","onMouseDown","e","stopPropagation","preventDefault","FilterOptionList","_ref3","options","onToggle","viewportClassName","map","opt","value","includes","onChange","renderFilter","_ref4","gjsModel","performInteraction","_useState","_extends","get","componentData","setComponentData","_componentData$option","_componentData$value","_componentData$classN","_componentData$affect","affectedComponents","_componentData$text","text","_componentData$filter","filterType","actualOptions","name","Array","isArray","wrapperRef","_useState2","attributes","setAttributes","_useState3","setIsDropdownOpen","_useState4","searchQuery","setSearchQuery","_useState5","isApplying","setIsApplying","_useState6","left","right","dropdownPosition","setDropdownPosition","defaultValue","_useState7","selectedValues","setSelectedValues","isMultiSelect","hasPlaceholderOptions","isBusy","interactionApiInProgress","loading","allOptionsSelected","_document$getElementB","current","filterRect","getBoundingClientRect","dropdownWidth","iframeViewportWidth","document","documentElement","clientWidth","iframeBodyWidth","getElementById","spaceToRight","spaceToLeft","shiftLeft","updateComponentData","updateAttributes","on","off","_wrapperRef$current$o","_wrapperRef$current","doc","ownerDocument","handleOutsideClick","contains","target","handleEscape","key","addEventListener","removeEventListener","filteredOptions","filter","String","toLowerCase","updateAndApply","_x","_updateAndApply","apply","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee","newValues","id","wrap","_callee$","_context","prev","next","set","interactionType","concat","finish","stop","handleOptionToggle","val","v","singleValue","handleClearAll","handleSelectAll","o","error","ref","style","color","backgroundColor","errorMessage","placeholder"],"sources":["../../../../src/shadcn/components/ui/filter.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { ChevronDown, ChevronUp, ListFilter as FilterIcon, Loader2Icon } from 'lucide-react';\n\nimport { Button } from './button';\nimport { Checkbox } from './checkbox';\nimport { ScrollArea } from './scroll-area';\nimport { getAffectedComponentsWithLoader } from '../../../helpers';\nimport { renderDateFilter } from './date-filter';\nimport { ErrorState } from './skeleton';\n\ntype FilterOption = {\n label: string;\n value: string;\n};\n\ntype FilterProps = {\n isEditable?: boolean;\n gjsModel: any;\n performInteraction: (payload: Record<string, any>) => Promise<void>;\n};\n\ntype FilterHeaderProps = {\n label: string;\n count: number;\n isDisabled: boolean;\n isDropdownOpen: boolean;\n isLoading: boolean;\n toggleOpen: () => void;\n};\n\ntype FilterActionsProps = {\n selected: string[];\n allSelected: boolean;\n onClear: () => void;\n onSelectAll: () => void;\n isDisabled: boolean;\n};\n\ntype FilterOptionListProps = {\n options: FilterOption[];\n selected: string[];\n onToggle: (value: string) => void;\n isDisabled: boolean;\n};\n\nfunction FilterHeader({\n label,\n count,\n isDisabled,\n isDropdownOpen,\n isLoading,\n toggleOpen,\n}: FilterHeaderProps) {\n const ChevronIcon = isDropdownOpen ? ChevronUp : ChevronDown;\n\n return (\n <Button variant=\"outline\" size=\"sm\" disabled={isDisabled} onClick={toggleOpen} className=\"px-2\">\n <FilterIcon size={16} />\n {count > 0 ? `${label} (${count})` : label}\n {isLoading ? (\n <Loader2Icon className=\"ml-2 animate-spin\" size={16} />\n ) : (\n <ChevronIcon size={16} className=\"ml-1\" />\n )}\n </Button>\n );\n}\n\nfunction FilterActions({\n selected,\n allSelected,\n onClear,\n onSelectAll,\n isDisabled,\n}: FilterActionsProps) {\n return (\n <div className=\"flex items-center mb-3\">\n <Checkbox\n checked={allSelected}\n onCheckedChange={() => (allSelected ? onClear() : onSelectAll())}\n disabled={isDisabled}\n />\n <span className=\"ml-2 text-sm text-gray-900\">Select All</span>\n {selected.length > 0 && (\n <button\n type=\"button\"\n className=\"ml-auto text-sm text-blue-600 hover:underline\"\n onMouseDown={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n onClick={onClear}\n disabled={isDisabled}\n >\n Clear All\n </button>\n )}\n </div>\n );\n}\n\nfunction FilterOptionList({ options, selected, onToggle, isDisabled }: FilterOptionListProps) {\n return (\n <ScrollArea viewportClassName=\"max-h-48 overflow-y-auto mb-4 space-y-2\">\n {options.length > 0 ? (\n options.map((opt) => (\n <label\n key={opt.value}\n className=\"flex items-center space-x-2 hover:bg-gray-100 rounded p-1 transition hover:cursor-pointer\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n\n if (!isDisabled) {\n onToggle(opt.value);\n }\n }}\n >\n <Checkbox\n checked={selected.includes(opt.value)}\n onChange={() => {\n // Prevent checkbox from toggling when clicking label\n }}\n disabled={isDisabled}\n />\n <span className=\"text-sm text-gray-900\">{opt.label}</span>\n </label>\n ))\n ) : (\n <div className=\"text-sm text-gray-500\">No results found</div>\n )}\n </ScrollArea>\n );\n}\n\nexport function renderFilter({ gjsModel, performInteraction }: FilterProps) {\n const [componentData, setComponentData] = useState({ ...gjsModel.get('componentProps') });\n\n const {\n options = [],\n value = [],\n className = '',\n affectedComponents = [],\n text: label = 'Filter',\n filterType = 'multiselect',\n } = componentData;\n\n const actualOptions = (() => {\n if (options && typeof options === 'object' && options.name === '__peak_placeholder') {\n return [];\n }\n\n return Array.isArray(options) ? options : [];\n })();\n\n if (filterType === 'date') {\n return renderDateFilter({ gjsModel, performInteraction });\n }\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n const [attributes, setAttributes] = useState({ ...gjsModel.get('attributes') });\n const [isDropdownOpen, setIsDropdownOpen] = useState(false);\n const [searchQuery, setSearchQuery] = useState('');\n const [isApplying, setIsApplying] = useState(false);\n const [dropdownPosition, setDropdownPosition] = useState({ left: 'auto', right: '0' });\n\n const defaultValue = componentData.default || [];\n\n const [selectedValues, setSelectedValues] = useState<string[]>(() => {\n return Array.isArray(value) && value.length > 0 ? value : defaultValue;\n });\n\n const isMultiSelect = filterType === 'multiselect';\n const hasPlaceholderOptions = options && typeof options === 'object' && options.name === '__peak_placeholder';\n const isBusy = attributes.interactionApiInProgress || isApplying || attributes.loading || hasPlaceholderOptions;\n const allOptionsSelected = selectedValues.length === actualOptions.length && actualOptions.length > 0;\n\n useEffect(() => {\n if (!isDropdownOpen || !wrapperRef.current) {return;}\n\n const filterRect = wrapperRef.current.getBoundingClientRect();\n const dropdownWidth = 256;\n const iframeViewportWidth = document.documentElement.clientWidth;\n const iframeBodyWidth =\n document.getElementById('dashboard-root')?.clientWidth || iframeViewportWidth;\n\n const spaceToRight = iframeBodyWidth - filterRect.right;\n const spaceToLeft = filterRect.left;\n\n if (spaceToLeft >= dropdownWidth) {\n setDropdownPosition({ left: 'auto', right: '0px' });\n } else if (spaceToRight < dropdownWidth && spaceToLeft < dropdownWidth) {\n const shiftLeft = dropdownWidth - spaceToRight + 16;\n setDropdownPosition({ left: `-${shiftLeft}px`, right: 'auto' });\n } else if (spaceToRight >= dropdownWidth) {\n setDropdownPosition({ left: '0px', right: 'auto' });\n }\n }, [isDropdownOpen]);\n\n useEffect(() => {\n function updateComponentData() {\n setComponentData({ ...gjsModel.get('componentProps') });\n }\n\n function updateAttributes() {\n setAttributes({ ...gjsModel.get('attributes') });\n }\n\n gjsModel.on('change:componentProps', updateComponentData);\n gjsModel.on('change:attributes', updateAttributes);\n\n return () => {\n gjsModel.off('change:componentProps', updateComponentData);\n gjsModel.off('change:attributes', updateAttributes);\n };\n }, [gjsModel]);\n\n useEffect(() => {\n const doc = wrapperRef.current?.ownerDocument ?? document;\n\n function handleOutsideClick(e: PointerEvent) {\n if (isDropdownOpen && wrapperRef.current && !wrapperRef.current.contains(e.target as Node)) {\n setIsDropdownOpen(false);\n }\n }\n\n function handleEscape(e: KeyboardEvent) {\n if (e.key === 'Escape') {\n setIsDropdownOpen(false);\n }\n }\n\n doc.addEventListener('pointerdown', handleOutsideClick);\n doc.addEventListener('keydown', handleEscape);\n\n return () => {\n doc.removeEventListener('pointerdown', handleOutsideClick);\n doc.removeEventListener('keydown', handleEscape);\n };\n }, [isDropdownOpen]);\n\n const filteredOptions = actualOptions.filter((opt: FilterOption) =>\n String(opt.label).toLowerCase().includes(searchQuery.toLowerCase()),\n );\n\n async function updateAndApply(newValues: string[] = selectedValues) {\n setIsApplying(true);\n\n try {\n gjsModel.set('componentProps', {\n ...gjsModel.get('componentProps'),\n value: newValues,\n });\n\n const id = gjsModel.get('id');\n\n await performInteraction({\n interactionType: 'filter',\n id,\n affectedComponents: getAffectedComponentsWithLoader([id, ...affectedComponents], true),\n });\n } finally {\n setIsApplying(false);\n setIsDropdownOpen(false);\n }\n }\n\n const handleOptionToggle = useCallback(\n (val: string) => {\n if (isMultiSelect) {\n setSelectedValues((prev) =>\n prev.includes(val) ? prev.filter((v) => v !== val) : [...prev, val],\n );\n } else {\n if (selectedValues.includes(val)) {\n setSelectedValues([]);\n updateAndApply([]);\n } else {\n const singleValue = [val];\n setSelectedValues(singleValue);\n updateAndApply(singleValue);\n }\n }\n },\n [isMultiSelect, selectedValues],\n );\n\n function handleClearAll() {\n setSelectedValues([]);\n }\n\n function handleSelectAll() {\n setSelectedValues(actualOptions.map((o: FilterOption) => o.value));\n }\n\n if (attributes.error) {\n return (\n <div\n ref={wrapperRef}\n className={`relative inline-block ${className}`}\n style={{ color: '#2A44D4', backgroundColor: 'rgb(255 255 255)' }}\n >\n <ErrorState \n errorMessage={attributes.errorMessage || \"Failed to load filter\"}\n variant=\"minimal\"\n />\n </div>\n );\n }\n\n return (\n <div\n ref={wrapperRef}\n className={`relative inline-block ${className}`}\n style={{ color: '#2A44D4', backgroundColor: 'rgb(255 255 255)' }}\n >\n <FilterHeader\n label={label}\n count={selectedValues.length}\n isDisabled={isBusy}\n isDropdownOpen={isDropdownOpen}\n isLoading={isBusy}\n toggleOpen={() => setIsDropdownOpen((prev) => !prev)}\n />\n\n {isDropdownOpen && (\n <div className=\"absolute top-full mt-2 w-64 bg-white border rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 p-4 z-50\" style={dropdownPosition}>\n <input\n type=\"text\"\n placeholder=\"Search...\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n className=\"w-full mb-3 px-2 py-1 border rounded focus:outline-none\"\n disabled={isBusy}\n />\n\n {isMultiSelect && (\n <FilterActions\n selected={selectedValues}\n allSelected={allOptionsSelected}\n onClear={handleClearAll}\n onSelectAll={handleSelectAll}\n isDisabled={isBusy}\n />\n )}\n\n <FilterOptionList\n options={filteredOptions}\n selected={selectedValues}\n onToggle={handleOptionToggle}\n isDisabled={isBusy}\n />\n\n {isMultiSelect && (\n <div className=\"flex justify-end space-x-2\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => setIsDropdownOpen(false)}\n disabled={isApplying}\n >\n Cancel\n </Button>\n <Button\n variant=\"default\"\n size=\"sm\"\n onClick={() => updateAndApply(selectedValues)}\n disabled={isBusy}\n >\n {isApplying && <Loader2Icon className=\"animate-spin mr-2\" size={16} />}Apply\n </Button>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":"wLAAA,uDACA,OAASA,WAAW,CAAEC,SAAS,CAAEC,MAAM,CAAEC,QAAQ,KAAQ,OAAO,CAChE,OAASC,WAAW,CAAEC,SAAS,CAAEC,UAAU,GAAI,CAAAC,UAAU,CAAEC,WAAW,KAAQ,cAAc,CAE5F,OAASC,MAAM,KAAQ,UAAU,CACjC,OAASC,QAAQ,KAAQ,YAAY,CACrC,OAASC,UAAU,KAAQ,eAAe,CAC1C,OAASC,+BAA+B,KAAQ,kBAAkB,CAClE,OAASC,gBAAgB,KAAQ,eAAe,CAChD,OAASC,UAAU,KAAQ,YAAY,CAAC,OAAAC,GAAA,IAAAC,IAAA,CAAAC,IAAA,IAAAC,KAAA,yBAqCxC,QAAS,CAAAC,YAAYA,CAAAC,IAAA,CAOC,IANpB,CAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,KAAK,CAAAF,IAAA,CAALE,KAAK,CACLC,UAAU,CAAAH,IAAA,CAAVG,UAAU,CACVC,cAAc,CAAAJ,IAAA,CAAdI,cAAc,CACdC,SAAS,CAAAL,IAAA,CAATK,SAAS,CACTC,UAAU,CAAAN,IAAA,CAAVM,UAAU,CAEV,GAAM,CAAAC,WAAW,CAAGH,cAAc,CAAGnB,SAAS,CAAGD,WAAW,CAE5D,mBACEc,KAAA,CAACT,MAAM,EAACmB,OAAO,CAAC,SAAS,CAACC,IAAI,CAAC,IAAI,CAACC,QAAQ,CAAEP,UAAW,CAACQ,OAAO,CAAEL,UAAW,CAACM,SAAS,CAAC,MAAM,CAAAC,QAAA,eAC7FjB,IAAA,CAACT,UAAU,EAACsB,IAAI,CAAE,EAAG,CAAE,C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Q,CAAE+D,cAAe,CACzB9D,WAAW,CAAEqE,kBAAmB,CAChCpE,OAAO,CAAE+H,cAAe,CACxB9H,WAAW,CAAE+H,eAAgB,CAC7B/I,UAAU,CAAEgF,MAAO,CACpB,CACF,cAEDvF,IAAA,CAACgC,gBAAgB,EACfE,OAAO,CAAEsF,eAAgB,CACzBpG,QAAQ,CAAE+D,cAAe,CACzBhD,QAAQ,CAAE8G,kBAAmB,CAC7B1I,UAAU,CAAEgF,MAAO,CACpB,CAAC,CAEDF,aAAa,eACZnF,KAAA,QAAKc,SAAS,CAAC,4BAA4B,CAAAC,QAAA,eACzCjB,IAAA,CAACP,MAAM,EACLmB,OAAO,CAAC,OAAO,CACfC,IAAI,CAAC,IAAI,CACTE,OAAO,CAAE,QAAT,CAAAA,OAAOA,CAAA,QAAQ,CAAAsD,iBAAiB,CAAC,KAAK,CAAC,CAAC,CACxCvD,QAAQ,CAAE4D,UAAW,CAAAzD,QAAA,CACtB,QAED,CAAQ,CAAC,cACTf,KAAA,CAACT,MAAM,EACLmB,OAAO,CAAC,SAAS,CACjBC,IAAI,CAAC,IAAI,CACTE,OAAO,CAAE,QAAT,CAAAA,OAAOA,CAAA,QAAQ,CAAA6G,cAAc,CAACzC,cAAc,CAAC,CAAC,CAC9CrE,QAAQ,CAAEyE,MAAO,CAAAtE,QAAA,EAEhByD,UAAU,eAAI1E,IAAA,CAACR,WAAW,EAACwB,SAAS,CAAC,mBAAmB,CAACH,IAAI,CAAE,EAAG,CAAE,CAAC,CAAC,OACzE,EAAQ,CAAC,EACN,CACN,EACE,CACN,EACE,CAET","ignoreList":[]}
1
+ {"version":3,"file":"filter.js","names":["useCallback","useEffect","useRef","useState","ChevronDown","ChevronUp","ListFilter","FilterIcon","Loader2Icon","Button","Checkbox","ScrollArea","getAffectedComponentsWithLoader","renderDateFilter","jsx","_jsx","jsxs","_jsxs","FilterHeader","_ref","label","count","isDisabled","isDropdownOpen","isLoading","toggleOpen","ChevronIcon","variant","size","disabled","onClick","className","children","FilterActions","_ref2","selected","allSelected","onClear","onSelectAll","checked","onCheckedChange","length","type","onMouseDown","e","stopPropagation","preventDefault","FilterOptionList","_ref3","options","onToggle","viewportClassName","map","opt","value","includes","onChange","renderFilter","_ref4","gjsModel","performInteraction","_useState","_extends","get","componentData","setComponentData","_componentData$option","_componentData$value","_componentData$classN","_componentData$affect","affectedComponents","_componentData$text","text","_componentData$filter","filterType","actualOptions","name","Array","isArray","wrapperRef","_useState2","attributes","setAttributes","_useState3","setIsDropdownOpen","_useState4","searchQuery","setSearchQuery","_useState5","isApplying","setIsApplying","_useState6","left","right","dropdownPosition","setDropdownPosition","defaultValue","_useState7","selectedValues","setSelectedValues","isMultiSelect","hasPlaceholderOptions","isBusy","interactionApiInProgress","loading","allOptionsSelected","_document$getElementB","current","filterRect","getBoundingClientRect","dropdownWidth","iframeViewportWidth","document","documentElement","clientWidth","iframeBodyWidth","getElementById","spaceToRight","spaceToLeft","shiftLeft","updateComponentData","updateAttributes","on","off","_wrapperRef$current$o","_wrapperRef$current","doc","ownerDocument","handleOutsideClick","contains","target","handleEscape","key","addEventListener","removeEventListener","filteredOptions","filter","String","toLowerCase","updateAndApply","_x","_updateAndApply","apply","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee","newValues","id","wrap","_callee$","_context","prev","next","set","interactionType","concat","finish","stop","handleOptionToggle","val","v","singleValue","handleClearAll","handleSelectAll","o","ref","style","color","backgroundColor","placeholder"],"sources":["../../../../src/shadcn/components/ui/filter.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { ChevronDown, ChevronUp, ListFilter as FilterIcon, Loader2Icon } from 'lucide-react';\n\nimport { Button } from './button';\nimport { Checkbox } from './checkbox';\nimport { ScrollArea } from './scroll-area';\nimport { getAffectedComponentsWithLoader } from '../../../helpers';\nimport { renderDateFilter } from './date-filter';\n\ntype FilterOption = {\n label: string;\n value: string;\n};\n\ntype FilterProps = {\n isEditable?: boolean;\n gjsModel: any;\n performInteraction: (payload: Record<string, any>) => Promise<void>;\n};\n\ntype FilterHeaderProps = {\n label: string;\n count: number;\n isDisabled: boolean;\n isDropdownOpen: boolean;\n isLoading: boolean;\n toggleOpen: () => void;\n};\n\ntype FilterActionsProps = {\n selected: string[];\n allSelected: boolean;\n onClear: () => void;\n onSelectAll: () => void;\n isDisabled: boolean;\n};\n\ntype FilterOptionListProps = {\n options: FilterOption[];\n selected: string[];\n onToggle: (value: string) => void;\n isDisabled: boolean;\n};\n\nfunction FilterHeader({\n label,\n count,\n isDisabled,\n isDropdownOpen,\n isLoading,\n toggleOpen,\n}: FilterHeaderProps) {\n const ChevronIcon = isDropdownOpen ? ChevronUp : ChevronDown;\n\n return (\n <Button variant=\"outline\" size=\"sm\" disabled={isDisabled} onClick={toggleOpen} className=\"px-2\">\n <FilterIcon size={16} />\n {count > 0 ? `${label} (${count})` : label}\n {isLoading ? (\n <Loader2Icon className=\"ml-2 animate-spin\" size={16} />\n ) : (\n <ChevronIcon size={16} className=\"ml-1\" />\n )}\n </Button>\n );\n}\n\nfunction FilterActions({\n selected,\n allSelected,\n onClear,\n onSelectAll,\n isDisabled,\n}: FilterActionsProps) {\n return (\n <div className=\"flex items-center mb-3\">\n <Checkbox\n checked={allSelected}\n onCheckedChange={() => (allSelected ? onClear() : onSelectAll())}\n disabled={isDisabled}\n />\n <span className=\"ml-2 text-sm text-gray-900\">Select All</span>\n {selected.length > 0 && (\n <button\n type=\"button\"\n className=\"ml-auto text-sm text-blue-600 hover:underline\"\n onMouseDown={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n onClick={onClear}\n disabled={isDisabled}\n >\n Clear All\n </button>\n )}\n </div>\n );\n}\n\nfunction FilterOptionList({ options, selected, onToggle, isDisabled }: FilterOptionListProps) {\n return (\n <ScrollArea viewportClassName=\"max-h-48 overflow-y-auto mb-4 space-y-2\">\n {options.length > 0 ? (\n options.map((opt) => (\n <label\n key={opt.value}\n className=\"flex items-center space-x-2 hover:bg-gray-100 rounded p-1 transition hover:cursor-pointer\"\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n\n if (!isDisabled) {\n onToggle(opt.value);\n }\n }}\n >\n <Checkbox\n checked={selected.includes(opt.value)}\n onChange={() => {\n // Prevent checkbox from toggling when clicking label\n }}\n disabled={isDisabled}\n />\n <span className=\"text-sm text-gray-900\">{opt.label}</span>\n </label>\n ))\n ) : (\n <div className=\"text-sm text-gray-500\">No results found</div>\n )}\n </ScrollArea>\n );\n}\n\nexport function renderFilter({ gjsModel, performInteraction }: FilterProps) {\n const [componentData, setComponentData] = useState({ ...gjsModel.get('componentProps') });\n\n const {\n options = [],\n value = [],\n className = '',\n affectedComponents = [],\n text: label = 'Filter',\n filterType = 'multiselect',\n } = componentData;\n\n const actualOptions = (() => {\n if (options && typeof options === 'object' && options.name === '__peak_placeholder') {\n return [];\n }\n\n return Array.isArray(options) ? options : [];\n })();\n\n if (filterType === 'date') {\n return renderDateFilter({ gjsModel, performInteraction });\n }\n\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n const [attributes, setAttributes] = useState({ ...gjsModel.get('attributes') });\n const [isDropdownOpen, setIsDropdownOpen] = useState(false);\n const [searchQuery, setSearchQuery] = useState('');\n const [isApplying, setIsApplying] = useState(false);\n const [dropdownPosition, setDropdownPosition] = useState({ left: 'auto', right: '0' });\n\n const defaultValue = componentData.default || [];\n\n const [selectedValues, setSelectedValues] = useState<string[]>(() => {\n return Array.isArray(value) && value.length > 0 ? value : defaultValue;\n });\n\n const isMultiSelect = filterType === 'multiselect';\n const hasPlaceholderOptions = options && typeof options === 'object' && options.name === '__peak_placeholder';\n const isBusy = attributes.interactionApiInProgress || isApplying || attributes.loading || hasPlaceholderOptions;\n const allOptionsSelected = selectedValues.length === actualOptions.length && actualOptions.length > 0;\n\n useEffect(() => {\n if (!isDropdownOpen || !wrapperRef.current) {return;}\n\n const filterRect = wrapperRef.current.getBoundingClientRect();\n const dropdownWidth = 256;\n const iframeViewportWidth = document.documentElement.clientWidth;\n const iframeBodyWidth =\n document.getElementById('dashboard-root')?.clientWidth || iframeViewportWidth;\n\n const spaceToRight = iframeBodyWidth - filterRect.right;\n const spaceToLeft = filterRect.left;\n\n if (spaceToLeft >= dropdownWidth) {\n setDropdownPosition({ left: 'auto', right: '0px' });\n } else if (spaceToRight < dropdownWidth && spaceToLeft < dropdownWidth) {\n const shiftLeft = dropdownWidth - spaceToRight + 16;\n setDropdownPosition({ left: `-${shiftLeft}px`, right: 'auto' });\n } else if (spaceToRight >= dropdownWidth) {\n setDropdownPosition({ left: '0px', right: 'auto' });\n }\n }, [isDropdownOpen]);\n\n useEffect(() => {\n function updateComponentData() {\n setComponentData({ ...gjsModel.get('componentProps') });\n }\n\n function updateAttributes() {\n setAttributes({ ...gjsModel.get('attributes') });\n }\n\n gjsModel.on('change:componentProps', updateComponentData);\n gjsModel.on('change:attributes', updateAttributes);\n\n return () => {\n gjsModel.off('change:componentProps', updateComponentData);\n gjsModel.off('change:attributes', updateAttributes);\n };\n }, [gjsModel]);\n\n useEffect(() => {\n const doc = wrapperRef.current?.ownerDocument ?? document;\n\n function handleOutsideClick(e: PointerEvent) {\n if (isDropdownOpen && wrapperRef.current && !wrapperRef.current.contains(e.target as Node)) {\n setIsDropdownOpen(false);\n }\n }\n\n function handleEscape(e: KeyboardEvent) {\n if (e.key === 'Escape') {\n setIsDropdownOpen(false);\n }\n }\n\n doc.addEventListener('pointerdown', handleOutsideClick);\n doc.addEventListener('keydown', handleEscape);\n\n return () => {\n doc.removeEventListener('pointerdown', handleOutsideClick);\n doc.removeEventListener('keydown', handleEscape);\n };\n }, [isDropdownOpen]);\n\n const filteredOptions = actualOptions.filter((opt: FilterOption) =>\n String(opt.label).toLowerCase().includes(searchQuery.toLowerCase()),\n );\n\n async function updateAndApply(newValues: string[] = selectedValues) {\n setIsApplying(true);\n\n try {\n gjsModel.set('componentProps', {\n ...gjsModel.get('componentProps'),\n value: newValues,\n });\n\n const id = gjsModel.get('id');\n\n await performInteraction({\n interactionType: 'filter',\n id,\n affectedComponents: getAffectedComponentsWithLoader([id, ...affectedComponents], true),\n });\n } finally {\n setIsApplying(false);\n setIsDropdownOpen(false);\n }\n }\n\n const handleOptionToggle = useCallback(\n (val: string) => {\n if (isMultiSelect) {\n setSelectedValues((prev) =>\n prev.includes(val) ? prev.filter((v) => v !== val) : [...prev, val],\n );\n } else {\n if (selectedValues.includes(val)) {\n setSelectedValues([]);\n updateAndApply([]);\n } else {\n const singleValue = [val];\n setSelectedValues(singleValue);\n updateAndApply(singleValue);\n }\n }\n },\n [isMultiSelect, selectedValues],\n );\n\n function handleClearAll() {\n setSelectedValues([]);\n }\n\n function handleSelectAll() {\n setSelectedValues(actualOptions.map((o: FilterOption) => o.value));\n }\n\n return (\n <div\n ref={wrapperRef}\n className={`relative inline-block ${className}`}\n style={{ color: '#2A44D4', backgroundColor: 'rgb(255 255 255)' }}\n >\n <FilterHeader\n label={label}\n count={selectedValues.length}\n isDisabled={isBusy}\n isDropdownOpen={isDropdownOpen}\n isLoading={isBusy}\n toggleOpen={() => setIsDropdownOpen((prev) => !prev)}\n />\n\n {isDropdownOpen && (\n <div className=\"absolute top-full mt-2 w-64 bg-white border rounded-lg shadow-lg ring-1 ring-black ring-opacity-5 p-4 z-50\" style={dropdownPosition}>\n <input\n type=\"text\"\n placeholder=\"Search...\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n className=\"w-full mb-3 px-2 py-1 border rounded focus:outline-none\"\n disabled={isBusy}\n />\n\n {isMultiSelect && (\n <FilterActions\n selected={selectedValues}\n allSelected={allOptionsSelected}\n onClear={handleClearAll}\n onSelectAll={handleSelectAll}\n isDisabled={isBusy}\n />\n )}\n\n <FilterOptionList\n options={filteredOptions}\n selected={selectedValues}\n onToggle={handleOptionToggle}\n isDisabled={isBusy}\n />\n\n {isMultiSelect && (\n <div className=\"flex justify-end space-x-2\">\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={() => setIsDropdownOpen(false)}\n disabled={isApplying}\n >\n Cancel\n </Button>\n <Button\n variant=\"default\"\n size=\"sm\"\n onClick={() => updateAndApply(selectedValues)}\n disabled={isBusy}\n >\n {isApplying && <Loader2Icon className=\"animate-spin mr-2\" size={16} />}Apply\n </Button>\n </div>\n )}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":"wLAAA,uDACA,OAASA,WAAW,CAAEC,SAAS,CAAEC,MAAM,CAAEC,QAAQ,KAAQ,OAAO,CAChE,OAASC,WAAW,CAAEC,SAAS,CAAEC,UAAU,GAAI,CAAAC,UAAU,CAAEC,WAAW,KAAQ,cAAc,CAE5F,OAASC,MAAM,KAAQ,UAAU,CACjC,OAASC,QAAQ,KAAQ,YAAY,CACrC,OAASC,UAAU,KAAQ,eAAe,CAC1C,OAASC,+BAA+B,KAAQ,kBAAkB,CAClE,OAASC,gBAAgB,KAAQ,eAAe,CAAC,OAAAC,GAAA,IAAAC,IAAA,CAAAC,IAAA,IAAAC,KAAA,yBAqCjD,QAAS,CAAAC,YAAYA,CAAAC,IAAA,CAOC,IANpB,CAAAC,KAAK,CAAAD,IAAA,CAALC,KAAK,CACLC,KAAK,CAAAF,IAAA,CAALE,KAAK,CACLC,UAAU,CAAAH,IAAA,CAAVG,UAAU,CACVC,cAAc,CAAAJ,IAAA,CAAdI,cAAc,CACdC,SAAS,CAAAL,IAAA,CAATK,SAAS,CACTC,UAAU,CAAAN,IAAA,CAAVM,UAAU,CAEV,GAAM,CAAAC,WAAW,CAAGH,cAAc,CAAGlB,SAAS,CAAGD,WAAW,CAE5D,mBACEa,KAAA,CAACR,MAAM,EAACkB,OAAO,CAAC,SAAS,CAACC,IAAI,CAAC,IAAI,CAACC,QAAQ,CAAEP,UAAW,CAACQ,OAAO,CAAEL,UAAW,CAACM,SAAS,CAAC,MAAM,CAAAC,QAAA,eAC7FjB,IAAA,CAACR,UAAU,EAACqB,IAAI,CAAE,EAAG,CAAE,CAAC,CACvBP,KAAK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CAAAC,QAAA,eACzCjB,IAAA,CAACN,MAAM,EACLkB,OAAO,CAAC,OAAO,CACfC,IAAI,CAAC,IAAI,CACTE,OAAO,CAAE,QAAT,CAAAA,OAAOA,CAAA,QAAQ,CAAAsD,iBAAiB,CAAC,KAAK,CAAC,CAAC,CACxCvD,QAAQ,CAAE4D,UAAW,CAAAzD,QAAA,CACtB,QAED,CAAQ,CAAC,cACTf,KAAA,CAACR,MAAM,EACLkB,OAAO,CAAC,SAAS,CACjBC,IAAI,CAAC,IAAI,CACTE,OAAO,CAAE,QAAT,CAAAA,OAAOA,CAAA,QAAQ,CAAA6G,cAAc,CAACzC,cAAc,CAAC,CAAC,CAC9CrE,QAAQ,CAAEyE,MAAO,CAAAtE,QAAA,EAEhByD,UAAU,eAAI1E,IAAA,CAACP,WAAW,EAACuB,SAAS,CAAC,mBAAmB,CAACH,IAAI,CAAE,EAAG,CAAE,CAAC,CAAC,OACzE,EAAQ,CAAC,EACN,CACN,EACE,CACN,EACE,CAET","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _extends from"@babel/runtime/helpers/extends";import _regeneratorRuntime from"@babel/runtime/regenerator";/* eslint-disable @typescript-eslint/no-explicit-any */import{useEffect,useRef,useState}from"react";import{Loader2Icon,Search as SearchIcon,X as ClearIcon,Info as InfoIcon}from"lucide-react";import{Input}from"./input";import{getAffectedComponentsWithLoader}from"../../../helpers";import{Tooltip,TooltipTrigger,TooltipContent}from"./tooltip";import{ErrorState}from"./skeleton";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var MAX_CHAR_LIMIT=140;var MaxCharLimitExceededMessage="Max 140 characters allowed.";export function renderSearch(_ref){var gjsModel=_ref.gjsModel,performInteraction=_ref.performInteraction;var wrapperRef=useRef(null);var _useState=useState(_extends({},gjsModel.get("componentProps"))),componentData=_useState[0],setComponentData=_useState[1];var placeholder=componentData.placeholder,_componentData$affect=componentData.affectedComponents,affectedComponents=_componentData$affect===void 0?[]:_componentData$affect,_componentData$classN=componentData.className,className=_componentData$classN===void 0?"":_componentData$classN;var initialSearchText=componentData.searchText||"";var _useState2=useState(_extends({},gjsModel.get("attributes"))),attributes=_useState2[0],setAttributes=_useState2[1];var _useState3=useState(initialSearchText),searchQuery=_useState3[0],setSearchQuery=_useState3[1];var _useState4=useState(false),isApplying=_useState4[0],setIsApplying=_useState4[1];var isBusy=attributes.interactionApiInProgress||isApplying;var showClear=!!searchQuery&&!isBusy;useEffect(function(){function updateComponentData(){setComponentData(_extends({},gjsModel.get("componentProps")))}function updateAttributes(){setAttributes(_extends({},gjsModel.get("attributes")))}gjsModel.on("change:componentProps",updateComponentData);gjsModel.on("change:attributes",updateAttributes);return function(){gjsModel.off("change:componentProps",updateComponentData);gjsModel.off("change:attributes",updateAttributes)}},[gjsModel]);function applySearch(_x){return _applySearch.apply(this,arguments)}function _applySearch(){_applySearch=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(query){var id;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!(query.length>MAX_CHAR_LIMIT)){_context.next=2;break}return _context.abrupt("return");case 2:setIsApplying(true);_context.prev=3;gjsModel.set("componentProps",_extends({},gjsModel.get("componentProps"),{searchText:query}));id=gjsModel.get("id");_context.next=8;return performInteraction({interactionType:"search",id:id,affectedComponents:getAffectedComponentsWithLoader([id].concat(affectedComponents),true)});case 8:_context.prev=8;setIsApplying(false);return _context.finish(8);case 11:case"end":return _context.stop()}},_callee,null,[[3,,8,11]])}));return _applySearch.apply(this,arguments)}function handleKeyDown(e){if(e.key==="Enter"){applySearch(searchQuery.trim())}}function handleSearchIconClick(){applySearch(searchQuery.trim())}function handleClear(){setSearchQuery("");applySearch("")}if(attributes.error){return/*#__PURE__*/_jsx("div",{ref:wrapperRef,className:"flex items-center gap-2 pb-4 "+className,children:/*#__PURE__*/_jsx(ErrorState,{errorMessage:attributes.errorMessage||"Failed to load search",variant:"minimal"})})}if(attributes.loading){return/*#__PURE__*/_jsx("div",{ref:wrapperRef,className:"flex items-center gap-2 pb-4 "+className,children:/*#__PURE__*/_jsx("div",{className:"relative transition-all duration-200 ease-in-out "+(searchQuery?"w-[320px]":"w-[280px]"),style:{backgroundColor:"#fff"},children:/*#__PURE__*/_jsx(Loader2Icon,{size:18,className:"animate-spin"})})})}return/*#__PURE__*/_jsxs("div",{ref:wrapperRef,className:"flex items-center gap-2 p-2 "+className,children:[/*#__PURE__*/_jsxs("div",{className:"relative transition-all duration-200 ease-in-out "+(searchQuery?"w-[320px]":"w-[280px]"),style:{backgroundColor:"#fff"},children:[/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Input,{type:"text",placeholder:"Search...",value:searchQuery,onChange:function onChange(e){return setSearchQuery(e.target.value)},onKeyDown:handleKeyDown,disabled:isBusy,className:"py-2 text-sm rounded-md border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-all duration-200 pl-4 pr-16 w-full"}),showClear&&/*#__PURE__*/_jsx("button",{type:"button",onClick:handleClear,className:"absolute right-10 top-7 -translate-y-1/2 text-gray-400 hover:text-gray-600 transition","aria-label":"Clear search",children:/*#__PURE__*/_jsx(ClearIcon,{size:16})}),/*#__PURE__*/_jsx("button",{type:"button",onClick:handleSearchIconClick,disabled:isBusy,className:"absolute right-2 top-7 -translate-y-1/2 text-gray-500 hover:text-blue-600 transition-colors","aria-label":"Search",children:isBusy?/*#__PURE__*/_jsx(Loader2Icon,{size:18,className:"animate-spin"}):/*#__PURE__*/_jsx(SearchIcon,{size:18})})]}),searchQuery.length>MAX_CHAR_LIMIT&&/*#__PURE__*/_jsx("p",{className:"absolute left-1 text-xs text-red-600 pl-1 pt-1",children:MaxCharLimitExceededMessage})]}),placeholder&&/*#__PURE__*/_jsxs(Tooltip,{children:[/*#__PURE__*/_jsx(TooltipTrigger,{asChild:true,children:/*#__PURE__*/_jsx("span",{className:"cursor-pointer text-gray-400 hover:text-gray-600",children:/*#__PURE__*/_jsx(InfoIcon,{size:16})})}),/*#__PURE__*/_jsx(TooltipContent,{side:"bottom",children:placeholder})]})]})}
1
+ import _asyncToGenerator from"@babel/runtime/helpers/asyncToGenerator";import _extends from"@babel/runtime/helpers/extends";import _regeneratorRuntime from"@babel/runtime/regenerator";/* eslint-disable @typescript-eslint/no-explicit-any */import{useEffect,useRef,useState}from"react";import{Loader2Icon,Search as SearchIcon,X as ClearIcon,Info as InfoIcon}from"lucide-react";import{Input}from"./input";import{getAffectedComponentsWithLoader}from"../../../helpers";import{Tooltip,TooltipTrigger,TooltipContent}from"./tooltip";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";var MAX_CHAR_LIMIT=140;var MaxCharLimitExceededMessage="Max 140 characters allowed.";export function renderSearch(_ref){var gjsModel=_ref.gjsModel,performInteraction=_ref.performInteraction;var wrapperRef=useRef(null);var _useState=useState(_extends({},gjsModel.get("componentProps"))),componentData=_useState[0],setComponentData=_useState[1];var placeholder=componentData.placeholder,_componentData$affect=componentData.affectedComponents,affectedComponents=_componentData$affect===void 0?[]:_componentData$affect,_componentData$classN=componentData.className,className=_componentData$classN===void 0?"":_componentData$classN;var initialSearchText=componentData.searchText||"";var _useState2=useState(_extends({},gjsModel.get("attributes"))),attributes=_useState2[0],setAttributes=_useState2[1];var _useState3=useState(initialSearchText),searchQuery=_useState3[0],setSearchQuery=_useState3[1];var _useState4=useState(false),isApplying=_useState4[0],setIsApplying=_useState4[1];var isBusy=attributes.interactionApiInProgress||isApplying;var showClear=!!searchQuery&&!isBusy;useEffect(function(){function updateComponentData(){setComponentData(_extends({},gjsModel.get("componentProps")))}function updateAttributes(){setAttributes(_extends({},gjsModel.get("attributes")))}gjsModel.on("change:componentProps",updateComponentData);gjsModel.on("change:attributes",updateAttributes);return function(){gjsModel.off("change:componentProps",updateComponentData);gjsModel.off("change:attributes",updateAttributes)}},[gjsModel]);function applySearch(_x){return _applySearch.apply(this,arguments)}function _applySearch(){_applySearch=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(query){var id;return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!(query.length>MAX_CHAR_LIMIT)){_context.next=2;break}return _context.abrupt("return");case 2:setIsApplying(true);_context.prev=3;gjsModel.set("componentProps",_extends({},gjsModel.get("componentProps"),{searchText:query}));id=gjsModel.get("id");_context.next=8;return performInteraction({interactionType:"search",id:id,affectedComponents:getAffectedComponentsWithLoader([id].concat(affectedComponents),true)});case 8:_context.prev=8;setIsApplying(false);return _context.finish(8);case 11:case"end":return _context.stop()}},_callee,null,[[3,,8,11]])}));return _applySearch.apply(this,arguments)}function handleKeyDown(e){if(e.key==="Enter"){applySearch(searchQuery.trim())}}function handleSearchIconClick(){applySearch(searchQuery.trim())}function handleClear(){setSearchQuery("");applySearch("")}if(attributes.loading){return/*#__PURE__*/_jsx("div",{ref:wrapperRef,className:"flex items-center gap-2 pb-4 "+className,children:/*#__PURE__*/_jsx("div",{className:"relative transition-all duration-200 ease-in-out "+(searchQuery?"w-[320px]":"w-[280px]"),style:{backgroundColor:"#fff"},children:/*#__PURE__*/_jsx(Loader2Icon,{size:18,className:"animate-spin"})})})}return/*#__PURE__*/_jsxs("div",{ref:wrapperRef,className:"flex items-center gap-2 p-2 "+className,children:[/*#__PURE__*/_jsxs("div",{className:"relative transition-all duration-200 ease-in-out "+(searchQuery?"w-[320px]":"w-[280px]"),style:{backgroundColor:"#fff"},children:[/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Input,{type:"text",placeholder:"Search...",value:searchQuery,onChange:function onChange(e){return setSearchQuery(e.target.value)},onKeyDown:handleKeyDown,disabled:isBusy,className:"py-2 text-sm rounded-md border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-all duration-200 pl-4 pr-16 w-full"}),showClear&&/*#__PURE__*/_jsx("button",{type:"button",onClick:handleClear,className:"absolute right-10 top-7 -translate-y-1/2 text-gray-400 hover:text-gray-600 transition","aria-label":"Clear search",children:/*#__PURE__*/_jsx(ClearIcon,{size:16})}),/*#__PURE__*/_jsx("button",{type:"button",onClick:handleSearchIconClick,disabled:isBusy,className:"absolute right-2 top-7 -translate-y-1/2 text-gray-500 hover:text-blue-600 transition-colors","aria-label":"Search",children:isBusy?/*#__PURE__*/_jsx(Loader2Icon,{size:18,className:"animate-spin"}):/*#__PURE__*/_jsx(SearchIcon,{size:18})})]}),searchQuery.length>MAX_CHAR_LIMIT&&/*#__PURE__*/_jsx("p",{className:"absolute left-1 text-xs text-red-600 pl-1 pt-1",children:MaxCharLimitExceededMessage})]}),placeholder&&/*#__PURE__*/_jsxs(Tooltip,{children:[/*#__PURE__*/_jsx(TooltipTrigger,{asChild:true,children:/*#__PURE__*/_jsx("span",{className:"cursor-pointer text-gray-400 hover:text-gray-600",children:/*#__PURE__*/_jsx(InfoIcon,{size:16})})}),/*#__PURE__*/_jsx(TooltipContent,{side:"bottom",children:placeholder})]})]})}
2
2
  //# sourceMappingURL=search.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"search.js","names":["useEffect","useRef","useState","Loader2Icon","Search","SearchIcon","X","ClearIcon","Info","InfoIcon","Input","getAffectedComponentsWithLoader","Tooltip","TooltipTrigger","TooltipContent","ErrorState","jsx","_jsx","jsxs","_jsxs","MAX_CHAR_LIMIT","MaxCharLimitExceededMessage","renderSearch","_ref","gjsModel","performInteraction","wrapperRef","_useState","_extends","get","componentData","setComponentData","placeholder","_componentData$affect","affectedComponents","_componentData$classN","className","initialSearchText","searchText","_useState2","attributes","setAttributes","_useState3","searchQuery","setSearchQuery","_useState4","isApplying","setIsApplying","isBusy","interactionApiInProgress","showClear","updateComponentData","updateAttributes","on","off","applySearch","_x","_applySearch","apply","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee","query","id","wrap","_callee$","_context","prev","next","length","abrupt","set","interactionType","concat","finish","stop","handleKeyDown","e","key","trim","handleSearchIconClick","handleClear","error","ref","children","errorMessage","variant","loading","style","backgroundColor","size","type","value","onChange","target","onKeyDown","disabled","onClick","asChild","side"],"sources":["../../../../src/shadcn/components/ui/search.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useEffect, useRef, useState } from 'react';\nimport { Loader2Icon, Search as SearchIcon, X as ClearIcon, Info as InfoIcon } from 'lucide-react';\nimport { Input } from './input';\nimport { getAffectedComponentsWithLoader } from '../../../helpers';\nimport { Tooltip, TooltipTrigger, TooltipContent } from './tooltip';\nimport { ErrorState } from './skeleton';\n\nconst MAX_CHAR_LIMIT = 140;\nconst MaxCharLimitExceededMessage = 'Max 140 characters allowed.';\n\ntype SearchProps = {\n isEditable?: boolean;\n gjsModel: any;\n performInteraction: (payload: Record<string, any>) => Promise<void>;\n};\n\nexport function renderSearch({ gjsModel, performInteraction }: SearchProps) {\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n const [componentData, setComponentData] = useState({ ...gjsModel.get('componentProps') });\n const { placeholder, affectedComponents = [], className = '' } = componentData;\n const initialSearchText = componentData.searchText || '';\n\n const [attributes, setAttributes] = useState({ ...gjsModel.get('attributes') });\n const [searchQuery, setSearchQuery] = useState(initialSearchText);\n const [isApplying, setIsApplying] = useState(false);\n\n const isBusy = attributes.interactionApiInProgress || isApplying;\n const showClear = !!searchQuery && !isBusy;\n\n useEffect(() => {\n function updateComponentData() {\n setComponentData({ ...gjsModel.get('componentProps') });\n }\n\n function updateAttributes() {\n setAttributes({ ...gjsModel.get('attributes') });\n }\n\n gjsModel.on('change:componentProps', updateComponentData);\n gjsModel.on('change:attributes', updateAttributes);\n\n return () => {\n gjsModel.off('change:componentProps', updateComponentData);\n gjsModel.off('change:attributes', updateAttributes);\n };\n }, [gjsModel]);\n\n async function applySearch(query: string) {\n if (query.length > MAX_CHAR_LIMIT) {\n return;\n }\n\n setIsApplying(true);\n\n try {\n gjsModel.set('componentProps', {\n ...gjsModel.get('componentProps'),\n searchText: query,\n });\n\n const id = gjsModel.get('id');\n\n await performInteraction({\n interactionType: 'search',\n id,\n affectedComponents: getAffectedComponentsWithLoader([id, ...affectedComponents], true),\n });\n } finally {\n setIsApplying(false);\n }\n }\n\n function handleKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {\n if (e.key === 'Enter') {\n applySearch(searchQuery.trim());\n }\n }\n\n function handleSearchIconClick() {\n applySearch(searchQuery.trim());\n }\n\n function handleClear() {\n setSearchQuery('');\n applySearch('');\n }\n\n if (attributes.error) {\n return (\n <div ref={wrapperRef} className={`flex items-center gap-2 pb-4 ${className}`}>\n <ErrorState \n errorMessage={attributes.errorMessage || \"Failed to load search\"}\n variant=\"minimal\"\n />\n </div>\n );\n }\n\n if (attributes.loading) {\n return (\n <div ref={wrapperRef} className={`flex items-center gap-2 pb-4 ${className}`}>\n <div\n className={`relative transition-all duration-200 ease-in-out ${\n searchQuery ? 'w-[320px]' : 'w-[280px]'\n }`}\n style={{ backgroundColor: '#fff' }}\n >\n <Loader2Icon size={18} className=\"animate-spin\" />\n </div>\n </div>\n )\n }\n\n return (\n <div ref={wrapperRef} className={`flex items-center gap-2 p-2 ${className}`}>\n <div\n className={`relative transition-all duration-200 ease-in-out ${\n searchQuery ? 'w-[320px]' : 'w-[280px]'\n }`}\n style={{ backgroundColor: '#fff' }}\n >\n <div>\n <Input\n type=\"text\"\n placeholder={'Search...'}\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n onKeyDown={handleKeyDown}\n disabled={isBusy}\n className={`py-2 text-sm rounded-md border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-all duration-200 pl-4 pr-16 w-full`}\n />\n\n {showClear && (\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"absolute right-10 top-7 -translate-y-1/2 text-gray-400 hover:text-gray-600 transition\"\n aria-label=\"Clear search\"\n >\n <ClearIcon size={16} />\n </button>\n )}\n\n <button\n type=\"button\"\n onClick={handleSearchIconClick}\n disabled={isBusy}\n className=\"absolute right-2 top-7 -translate-y-1/2 text-gray-500 hover:text-blue-600 transition-colors\"\n aria-label=\"Search\"\n >\n {isBusy ? <Loader2Icon size={18} className=\"animate-spin\" /> : <SearchIcon size={18} />}\n </button>\n </div>\n\n {searchQuery.length > MAX_CHAR_LIMIT && (\n <p className=\"absolute left-1 text-xs text-red-600 pl-1 pt-1\">\n {MaxCharLimitExceededMessage}\n </p>\n )}\n </div>\n\n {placeholder && (\n <Tooltip>\n <TooltipTrigger asChild>\n <span className=\"cursor-pointer text-gray-400 hover:text-gray-600\">\n <InfoIcon size={16} />\n </span>\n </TooltipTrigger>\n <TooltipContent side=\"bottom\">{placeholder}</TooltipContent>\n </Tooltip>\n )}\n </div>\n );\n}\n"],"mappings":"wLAAA,uDACA,OAASA,SAAS,CAAEC,MAAM,CAAEC,QAAQ,KAAQ,OAAO,CACnD,OAASC,WAAW,CAAEC,MAAM,GAAI,CAAAC,UAAU,CAAEC,CAAC,GAAI,CAAAC,SAAS,CAAEC,IAAI,GAAI,CAAAC,QAAQ,KAAQ,cAAc,CAClG,OAASC,KAAK,KAAQ,SAAS,CAC/B,OAASC,+BAA+B,KAAQ,kBAAkB,CAClE,OAASC,OAAO,CAAEC,cAAc,CAAEC,cAAc,KAAQ,WAAW,CACnE,OAASC,UAAU,KAAQ,YAAY,CAAC,OAAAC,GAAA,IAAAC,IAAA,CAAAC,IAAA,IAAAC,KAAA,yBAExC,GAAM,CAAAC,cAAc,CAAG,GAAG,CAC1B,GAAM,CAAAC,2BAA2B,CAAG,6BAA6B,CAQjE,MAAO,SAAS,CAAAC,YAAYA,CAAAC,IAAA,CAAgD,IAA7C,CAAAC,QAAQ,CAAAD,IAAA,CAARC,QAAQ,CAAEC,kBAAkB,CAAAF,IAAA,CAAlBE,kBAAkB,CACzD,GAAM,CAAAC,UAAU,CAAGzB,MAAM,CAAiB,IAAI,CAAC,CAE/C,IAAA0B,SAAA,CAA0CzB,QAAQ,CAAA0B,QAAA,IAAMJ,QAAQ,CAACK,GAAG,CAAC,gBAAgB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E,QAAA,eACNrE,IAAA,CAACJ,cAAc,EAACuF,OAAO,MAAAd,QAAA,cACrBrE,IAAA,SAAMmB,SAAS,CAAC,kDAAkD,CAAAkD,QAAA,cAChErE,IAAA,CAACR,QAAQ,EAACmF,IAAI,CAAE,EAAG,CAAE,CAAC,CAClB,CAAC,CACO,CAAC,cACjB3E,IAAA,CAACH,cAAc,EAACuF,IAAI,CAAC,QAAQ,CAAAf,QAAA,CAAEtD,WAAW,CAAiB,CAAC,EACrD,CACV,EACE,CAET","ignoreList":[]}
1
+ {"version":3,"file":"search.js","names":["useEffect","useRef","useState","Loader2Icon","Search","SearchIcon","X","ClearIcon","Info","InfoIcon","Input","getAffectedComponentsWithLoader","Tooltip","TooltipTrigger","TooltipContent","jsx","_jsx","jsxs","_jsxs","MAX_CHAR_LIMIT","MaxCharLimitExceededMessage","renderSearch","_ref","gjsModel","performInteraction","wrapperRef","_useState","_extends","get","componentData","setComponentData","placeholder","_componentData$affect","affectedComponents","_componentData$classN","className","initialSearchText","searchText","_useState2","attributes","setAttributes","_useState3","searchQuery","setSearchQuery","_useState4","isApplying","setIsApplying","isBusy","interactionApiInProgress","showClear","updateComponentData","updateAttributes","on","off","applySearch","_x","_applySearch","apply","arguments","_asyncToGenerator","_regeneratorRuntime","mark","_callee","query","id","wrap","_callee$","_context","prev","next","length","abrupt","set","interactionType","concat","finish","stop","handleKeyDown","e","key","trim","handleSearchIconClick","handleClear","loading","ref","children","style","backgroundColor","size","type","value","onChange","target","onKeyDown","disabled","onClick","asChild","side"],"sources":["../../../../src/shadcn/components/ui/search.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { useEffect, useRef, useState } from 'react';\nimport { Loader2Icon, Search as SearchIcon, X as ClearIcon, Info as InfoIcon } from 'lucide-react';\nimport { Input } from './input';\nimport { getAffectedComponentsWithLoader } from '../../../helpers';\nimport { Tooltip, TooltipTrigger, TooltipContent } from './tooltip';\n\nconst MAX_CHAR_LIMIT = 140;\nconst MaxCharLimitExceededMessage = 'Max 140 characters allowed.';\n\ntype SearchProps = {\n isEditable?: boolean;\n gjsModel: any;\n performInteraction: (payload: Record<string, any>) => Promise<void>;\n};\n\nexport function renderSearch({ gjsModel, performInteraction }: SearchProps) {\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n const [componentData, setComponentData] = useState({ ...gjsModel.get('componentProps') });\n const { placeholder, affectedComponents = [], className = '' } = componentData;\n const initialSearchText = componentData.searchText || '';\n\n const [attributes, setAttributes] = useState({ ...gjsModel.get('attributes') });\n const [searchQuery, setSearchQuery] = useState(initialSearchText);\n const [isApplying, setIsApplying] = useState(false);\n\n const isBusy = attributes.interactionApiInProgress || isApplying;\n const showClear = !!searchQuery && !isBusy;\n\n useEffect(() => {\n function updateComponentData() {\n setComponentData({ ...gjsModel.get('componentProps') });\n }\n\n function updateAttributes() {\n setAttributes({ ...gjsModel.get('attributes') });\n }\n\n gjsModel.on('change:componentProps', updateComponentData);\n gjsModel.on('change:attributes', updateAttributes);\n\n return () => {\n gjsModel.off('change:componentProps', updateComponentData);\n gjsModel.off('change:attributes', updateAttributes);\n };\n }, [gjsModel]);\n\n async function applySearch(query: string) {\n if (query.length > MAX_CHAR_LIMIT) {\n return;\n }\n\n setIsApplying(true);\n\n try {\n gjsModel.set('componentProps', {\n ...gjsModel.get('componentProps'),\n searchText: query,\n });\n\n const id = gjsModel.get('id');\n\n await performInteraction({\n interactionType: 'search',\n id,\n affectedComponents: getAffectedComponentsWithLoader([id, ...affectedComponents], true),\n });\n } finally {\n setIsApplying(false);\n }\n }\n\n function handleKeyDown(e: React.KeyboardEvent<HTMLInputElement>) {\n if (e.key === 'Enter') {\n applySearch(searchQuery.trim());\n }\n }\n\n function handleSearchIconClick() {\n applySearch(searchQuery.trim());\n }\n\n function handleClear() {\n setSearchQuery('');\n applySearch('');\n }\n\n if (attributes.loading) {\n return (\n <div ref={wrapperRef} className={`flex items-center gap-2 pb-4 ${className}`}>\n <div\n className={`relative transition-all duration-200 ease-in-out ${\n searchQuery ? 'w-[320px]' : 'w-[280px]'\n }`}\n style={{ backgroundColor: '#fff' }}\n >\n <Loader2Icon size={18} className=\"animate-spin\" />\n </div>\n </div>\n )\n }\n\n return (\n <div ref={wrapperRef} className={`flex items-center gap-2 p-2 ${className}`}>\n <div\n className={`relative transition-all duration-200 ease-in-out ${\n searchQuery ? 'w-[320px]' : 'w-[280px]'\n }`}\n style={{ backgroundColor: '#fff' }}\n >\n <div>\n <Input\n type=\"text\"\n placeholder={'Search...'}\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n onKeyDown={handleKeyDown}\n disabled={isBusy}\n className={`py-2 text-sm rounded-md border border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 transition-all duration-200 pl-4 pr-16 w-full`}\n />\n\n {showClear && (\n <button\n type=\"button\"\n onClick={handleClear}\n className=\"absolute right-10 top-7 -translate-y-1/2 text-gray-400 hover:text-gray-600 transition\"\n aria-label=\"Clear search\"\n >\n <ClearIcon size={16} />\n </button>\n )}\n\n <button\n type=\"button\"\n onClick={handleSearchIconClick}\n disabled={isBusy}\n className=\"absolute right-2 top-7 -translate-y-1/2 text-gray-500 hover:text-blue-600 transition-colors\"\n aria-label=\"Search\"\n >\n {isBusy ? <Loader2Icon size={18} className=\"animate-spin\" /> : <SearchIcon size={18} />}\n </button>\n </div>\n\n {searchQuery.length > MAX_CHAR_LIMIT && (\n <p className=\"absolute left-1 text-xs text-red-600 pl-1 pt-1\">\n {MaxCharLimitExceededMessage}\n </p>\n )}\n </div>\n\n {placeholder && (\n <Tooltip>\n <TooltipTrigger asChild>\n <span className=\"cursor-pointer text-gray-400 hover:text-gray-600\">\n <InfoIcon size={16} />\n </span>\n </TooltipTrigger>\n <TooltipContent side=\"bottom\">{placeholder}</TooltipContent>\n </Tooltip>\n )}\n </div>\n );\n}\n"],"mappings":"wLAAA,uDACA,OAASA,SAAS,CAAEC,MAAM,CAAEC,QAAQ,KAAQ,OAAO,CACnD,OAAS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SAAS,CAAC,6FAA6F,CACvG,aAAW,QAAQ,CAAAkD,QAAA,CAElBtC,MAAM,cAAG/B,IAAA,CAACb,WAAW,EAACqF,IAAI,CAAE,EAAG,CAACrD,SAAS,CAAC,cAAc,CAAE,CAAC,cAAGnB,IAAA,CAACX,UAAU,EAACmF,IAAI,CAAE,EAAG,CAAE,CAAC,CACjF,CAAC,EACN,CAAC,CAEL9C,WAAW,CAAC4B,MAAM,CAAGnD,cAAc,eAClCH,IAAA,MAAGmB,SAAS,CAAC,gDAAgD,CAAAkD,QAAA,CAC1DjE,2BAA2B,CAC3B,CACJ,EACE,CAAC,CAELW,WAAW,eACVb,KAAA,CAACN,OAAO,EAAAyE,QAAA,eACNrE,IAAA,CAACH,cAAc,EAACmF,OAAO,MAAAX,QAAA,cACrBrE,IAAA,SAAMmB,SAAS,CAAC,kDAAkD,CAAAkD,QAAA,cAChErE,IAAA,CAACP,QAAQ,EAAC+E,IAAI,CAAE,EAAG,CAAE,CAAC,CAClB,CAAC,CACO,CAAC,cACjBxE,IAAA,CAACF,cAAc,EAACmF,IAAI,CAAC,QAAQ,CAAAZ,QAAA,CAAEtD,WAAW,CAAiB,CAAC,EACrD,CACV,EACE,CAET","ignoreList":[]}
@@ -1,13 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  declare function Skeleton({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
3
- declare function ErrorState({ className, errorMessage, variant, ...props }: React.ComponentProps<"div"> & {
4
- errorMessage?: string;
5
- variant?: "default" | "minimal";
6
- }): import("react/jsx-runtime").JSX.Element;
7
3
  declare function TableLoader({ count }: {
8
4
  count?: number | undefined;
9
5
  }): import("react/jsx-runtime").JSX.Element;
10
6
  declare function ChartLoader(): import("react/jsx-runtime").JSX.Element;
11
7
  declare function CardLoader(): import("react/jsx-runtime").JSX.Element;
12
8
  declare function MarkdownLoader(): import("react/jsx-runtime").JSX.Element;
13
- export { Skeleton, ErrorState, TableLoader, ChartLoader, CardLoader, MarkdownLoader };
9
+ export { Skeleton, TableLoader, ChartLoader, CardLoader, MarkdownLoader, };
@@ -1,2 +1,2 @@
1
- import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";var _excluded=["className"],_excluded2=["className","errorMessage","variant"];import{cn}from"../../utils";import{CircleX,AlertTriangle}from"lucide-react";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function Skeleton(_ref){var className=_ref.className,props=_objectWithoutPropertiesLoose(_ref,_excluded);return/*#__PURE__*/_jsx("div",_extends({"data-slot":"skeleton",className:cn("bg-accent animate-pulse rounded-md",className)},props))}function ErrorState(_ref2){var className=_ref2.className,_ref2$errorMessage=_ref2.errorMessage,errorMessage=_ref2$errorMessage===void 0?"An error occurred while loading this component":_ref2$errorMessage,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?"default":_ref2$variant,props=_objectWithoutPropertiesLoose(_ref2,_excluded2);return/*#__PURE__*/_jsx("div",_extends({"data-slot":"error-state",className:cn("flex items-center justify-center p-4 rounded-md border border-destructive/20 bg-destructive/5",variant==="minimal"&&"p-2 border-none bg-transparent",className)},props,{children:/*#__PURE__*/_jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[variant==="default"?/*#__PURE__*/_jsx(CircleX,{className:"h-4 w-4 flex-shrink-0"}):/*#__PURE__*/_jsx(AlertTriangle,{className:"h-3 w-3 flex-shrink-0"}),/*#__PURE__*/_jsx("span",{className:cn("text-sm",variant==="minimal"&&"text-xs"),children:errorMessage})]})}))}function TableLoader(_ref3){var _ref3$count=_ref3.count,count=_ref3$count===void 0?5:_ref3$count;return/*#__PURE__*/_jsx("div",{className:"flex flex-row gap-6",children:Array.from({length:3}).map(function(_,colIndex){return/*#__PURE__*/_jsxs("div",{className:"flex flex-col gap-3 w-1/3",children:[/*#__PURE__*/_jsx(Skeleton,{className:"w-full h-10"}),Array.from({length:count}).map(function(__,index){return/*#__PURE__*/_jsx(Skeleton,{className:"w-full h-6"},index)})]},"col-"+colIndex)})})}function ChartLoader(){return/*#__PURE__*/_jsxs("div",{className:"flex flex-col gap-4",children:[/*#__PURE__*/_jsxs("div",{className:"flex flex-row gap-4",children:[/*#__PURE__*/_jsx(Skeleton,{className:"h-40 w-1/6 self-end"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-50 w-1/6 self-end"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-30 w-1/6 self-end"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-40 w-1/6 self-end"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-50 w-1/6 self-end"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-20 w-1/6 self-end"})]}),/*#__PURE__*/_jsx(Skeleton,{className:"w-full h-5"})]})}function CardLoader(){return/*#__PURE__*/_jsxs("div",{className:"flex flex-col gap-1",children:[/*#__PURE__*/_jsx(Skeleton,{className:"h-5 w-full"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-3 w-full"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-10 w-full"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-5 w-full"})]})}function MarkdownLoader(){return/*#__PURE__*/_jsxs("div",{className:"flex flex-col gap-2",children:[/*#__PURE__*/_jsx(Skeleton,{className:"h-5 w-full bg-black/10"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-5 w-full bg-black/10"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-5 w-full bg-black/10"})]})}export{Skeleton,ErrorState,TableLoader,ChartLoader,CardLoader,MarkdownLoader};
1
+ import _extends from"@babel/runtime/helpers/extends";import _objectWithoutPropertiesLoose from"@babel/runtime/helpers/objectWithoutPropertiesLoose";var _excluded=["className"];import{cn}from"../../utils";import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";function Skeleton(_ref){var className=_ref.className,props=_objectWithoutPropertiesLoose(_ref,_excluded);return/*#__PURE__*/_jsx("div",_extends({"data-slot":"skeleton",className:cn("bg-accent animate-pulse rounded-md",className)},props))}function TableLoader(_ref2){var _ref2$count=_ref2.count,count=_ref2$count===void 0?5:_ref2$count;return/*#__PURE__*/_jsx("div",{className:"flex flex-row gap-6",children:Array.from({length:3}).map(function(_,colIndex){return/*#__PURE__*/_jsxs("div",{className:"flex flex-col gap-3 w-1/3",children:[/*#__PURE__*/_jsx(Skeleton,{className:"w-full h-10"}),Array.from({length:count}).map(function(_,index){return/*#__PURE__*/_jsx(Skeleton,{className:"w-full h-6"},index)})]},"col-"+colIndex)})})}function ChartLoader(){return/*#__PURE__*/_jsxs("div",{className:"flex flex-col gap-4",children:[/*#__PURE__*/_jsxs("div",{className:"flex flex-row gap-4",children:[/*#__PURE__*/_jsx(Skeleton,{className:"h-40 w-1/6 self-end"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-50 w-1/6 self-end"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-30 w-1/6 self-end"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-40 w-1/6 self-end"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-50 w-1/6 self-end"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-20 w-1/6 self-end"})]}),/*#__PURE__*/_jsx(Skeleton,{className:"w-full h-5"})]})}function CardLoader(){return/*#__PURE__*/_jsxs("div",{className:"flex flex-col gap-1",children:[/*#__PURE__*/_jsx(Skeleton,{className:"h-5 w-full"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-3 w-full"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-10 w-full"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-5 w-full"})]})}function MarkdownLoader(){return/*#__PURE__*/_jsxs("div",{className:"flex flex-col gap-2",children:[/*#__PURE__*/_jsx(Skeleton,{className:"h-5 w-full bg-black/10"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-5 w-full bg-black/10"}),/*#__PURE__*/_jsx(Skeleton,{className:"h-5 w-full bg-black/10"})]})}export{Skeleton,TableLoader,ChartLoader,CardLoader,MarkdownLoader};
2
2
  //# sourceMappingURL=skeleton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton.js","names":["cn","CircleX","AlertTriangle","jsx","_jsx","jsxs","_jsxs","Skeleton","_ref","className","props","_objectWithoutPropertiesLoose","_excluded","_extends","ErrorState","_ref2","_ref2$errorMessage","errorMessage","_ref2$variant","variant","_excluded2","children","TableLoader","_ref3","_ref3$count","count","Array","from","length","map","_","colIndex","__","index","ChartLoader","CardLoader","MarkdownLoader"],"sources":["../../../../src/shadcn/components/ui/skeleton.tsx"],"sourcesContent":["import { cn } from '../../utils';\nimport { CircleX, AlertTriangle } from 'lucide-react';\n\nfunction Skeleton({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"skeleton\"\n className={cn(\"bg-accent animate-pulse rounded-md\", className)}\n {...props}\n />\n )\n}\n\nfunction ErrorState({\n className,\n errorMessage = \"An error occurred while loading this component\",\n variant = \"default\",\n ...props\n}: React.ComponentProps<\"div\"> & {\n errorMessage?: string;\n variant?: \"default\" | \"minimal\"\n}) {\n return (\n <div\n data-slot=\"error-state\"\n className={cn(\n \"flex items-center justify-center p-4 rounded-md border border-destructive/20 bg-destructive/5\",\n variant === \"minimal\" && \"p-2 border-none bg-transparent\",\n className\n )}\n {...props}\n >\n <div className=\"flex items-center gap-2 text-destructive\">\n {variant === \"default\" ? (\n <CircleX className=\"h-4 w-4 flex-shrink-0\" />\n ) : (\n <AlertTriangle className=\"h-3 w-3 flex-shrink-0\" />\n )}\n <span className={cn(\n \"text-sm\",\n variant === \"minimal\" && \"text-xs\"\n )}>\n {errorMessage}\n </span>\n </div>\n </div>\n )\n}\n\nfunction TableLoader({ count = 5 }) {\n return (\n <div className='flex flex-row gap-6'>\n {\n Array.from({ length: 3 }).map((_, colIndex) => {\n return (\n <div className=\"flex flex-col gap-3 w-1/3\" key={`col-${colIndex}`}>\n <Skeleton className=\"w-full h-10\" />\n {Array.from({ length: count }).map((__, index) => (\n <Skeleton className=\"w-full h-6\" key={index} />\n ))}\n </div>\n )\n })\n }\n </div>\n );\n}\n\nfunction ChartLoader() {\n return (\n <div className=\"flex flex-col gap-4\">\n <div className='flex flex-row gap-4'>\n <Skeleton className=\"h-40 w-1/6 self-end\" />\n <Skeleton className=\"h-50 w-1/6 self-end\" />\n <Skeleton className=\"h-30 w-1/6 self-end\" />\n <Skeleton className=\"h-40 w-1/6 self-end\" />\n <Skeleton className=\"h-50 w-1/6 self-end\" />\n <Skeleton className=\"h-20 w-1/6 self-end\" />\n </div>\n <Skeleton className=\"w-full h-5\" />\n </div>\n );\n}\n\nfunction CardLoader() {\n return (\n <div className='flex flex-col gap-1'>\n <Skeleton className=\"h-5 w-full\" />\n <Skeleton className=\"h-3 w-full\" />\n <Skeleton className=\"h-10 w-full\" />\n <Skeleton className=\"h-5 w-full\" />\n </div>\n );\n}\n\nfunction MarkdownLoader() {\n return (\n <div className='flex flex-col gap-2'>\n <Skeleton className=\"h-5 w-full bg-black/10\" />\n <Skeleton className=\"h-5 w-full bg-black/10\" />\n <Skeleton className=\"h-5 w-full bg-black/10\" />\n </div>\n );\n}\n\nexport { Skeleton, ErrorState, TableLoader, ChartLoader, CardLoader, MarkdownLoader }\n"],"mappings":"kOAAA,OAASA,EAAE,KAAQ,aAAa,CAChC,OAASC,OAAO,CAAEC,aAAa,KAAQ,cAAc,CAAC,OAAAC,GAAA,IAAAC,IAAA,CAAAC,IAAA,IAAAC,KAAA,yBAEtD,QAAS,CAAAC,QAAQA,CAAAC,IAAA,CAAuD,IAApD,CAAAC,SAAS,CAAAD,IAAA,CAATC,SAAS,CAAKC,KAAK,CAAAC,6BAAA,CAAAH,IAAA,CAAAI,SAAA,EACrC,mBACER,IAAA,OAAAS,QAAA,EACE,YAAU,UAAU,CACpBJ,SAAS,CAAET,EAAE,CAAC,oCAAoC,CAAES,SAAS,CAAE,EAC3DC,KAAK,CACV,CAEL,CAEA,QAAS,CAAAI,UAAUA,CAAAC,KAAA,CAQhB,IAPD,CAAAN,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,CAAC,YAAY,CAAE,CAAC,EAChC,CAET,CAEA,QAAS,CAAA2B,cAAcA,CAAA,CAAG,CACxB,mBACE9B,KAAA,QAAKG,SAAS,CAAC,qBAAqB,CAAAY,QAAA,eAClCjB,IAAA,CAACG,QAAQ,EAACE,SAAS,CAAC,wBAAwB,CAAE,CAAC,cAC/CL,IAAA,CAACG,QAAQ,EAACE,SAAS,CAAC,wBAAwB,CAAE,CAAC,cAC/CL,IAAA,CAACG,QAAQ,EAACE,SAAS,CAAC,wBAAwB,CAAE,CAAC,EAC5C,CAET,CAEA,OAASF,QAAQ,CAAEO,UAAU,CAAEQ,WAAW,CAAEY,WAAW,CAAEC,UAAU,CAAEC,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"skeleton.js","names":["cn","jsx","_jsx","jsxs","_jsxs","Skeleton","_ref","className","props","_objectWithoutPropertiesLoose","_excluded","_extends","TableLoader","_ref2","_ref2$count","count","children","Array","from","length","map","_","colIndex","index","ChartLoader","CardLoader","MarkdownLoader"],"sources":["../../../../src/shadcn/components/ui/skeleton.tsx"],"sourcesContent":["import { cn } from '../../utils';\n\nfunction Skeleton({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"skeleton\"\n className={cn(\"bg-accent animate-pulse rounded-md\", className)}\n {...props}\n />\n )\n}\n\nfunction TableLoader({ count = 5 }) {\n return (\n <div className='flex flex-row gap-6'>\n {\n Array.from({ length: 3 }).map((_, colIndex) => {\n return (\n <div className=\"flex flex-col gap-3 w-1/3\" key={`col-${colIndex}`}>\n <Skeleton className=\"w-full h-10\" />\n {Array.from({ length: count }).map((_, index) => (\n <Skeleton className=\"w-full h-6\" key={index} />\n ))}\n </div>\n )\n })\n }\n </div>\n );\n}\n\nfunction ChartLoader() {\n return (\n <div className=\"flex flex-col gap-4\">\n <div className='flex flex-row gap-4'>\n <Skeleton className=\"h-40 w-1/6 self-end\" />\n <Skeleton className=\"h-50 w-1/6 self-end\" />\n <Skeleton className=\"h-30 w-1/6 self-end\" />\n <Skeleton className=\"h-40 w-1/6 self-end\" />\n <Skeleton className=\"h-50 w-1/6 self-end\" />\n <Skeleton className=\"h-20 w-1/6 self-end\" />\n </div>\n <Skeleton className=\"w-full h-5\" />\n </div>\n );\n}\n\nfunction CardLoader() {\n return (\n <div className='flex flex-col gap-1'>\n <Skeleton className=\"h-5 w-full\" />\n <Skeleton className=\"h-3 w-full\" />\n <Skeleton className=\"h-10 w-full\" />\n <Skeleton className=\"h-5 w-full\" />\n </div>\n );\n}\n\nfunction MarkdownLoader() {\n return (\n <div className='flex flex-col gap-2'>\n <Skeleton className=\"h-5 w-full bg-black/10\" />\n <Skeleton className=\"h-5 w-full bg-black/10\" />\n <Skeleton className=\"h-5 w-full bg-black/10\" />\n </div>\n );\n}\n\nexport { Skeleton, TableLoader, ChartLoader, CardLoader, MarkdownLoader, }\n"],"mappings":"gLAAA,OAASA,EAAE,KAAQ,aAAa,CAAC,OAAAC,GAAA,IAAAC,IAAA,CAAAC,IAAA,IAAAC,KAAA,yBAEjC,QAAS,CAAAC,QAAQA,CAAAC,IAAA,CAAuD,IAApD,CAAAC,SAAS,CAAAD,IAAA,CAATC,SAAS,CAAKC,KAAK,CAAAC,6BAAA,CAAAH,IAAA,CAAAI,SAAA,EACrC,mBACER,IAAA,OAAAS,QAAA,EACE,YAAU,UAAU,CACpBJ,SAAS,CAAEP,EAAE,CAAC,oCAAoC,CAAEO,SAAS,CAAE,EAC3DC,KAAK,CACV,CAEL,CAEA,QAAS,CAAAI,WAAWA,CAAAC,KAAA,CAAgB,KAAAC,WAAA,CAAAD,KAAA,CAAbE,KAAK,CAALA,KAAK,CAAAD,WAAA,UAAG,CAAC,CAAAA,WAAA,CAC9B,mBACEZ,IAAA,QAAKK,SAAS,CAAC,qBAAqB,CAAAS,QAAA,CAEhCC,KAAK,CAACC,IAAI,CAAC,CAAEC,MAAM,CAAE,CAAE,CAAC,CAAC,CAACC,GAAG,CAAC,SAACC,CAAC,CAAEC,QAAQ,C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