{"version":3,"file":"Table_test.Ck_frBjQ.mjs","names":["React.useState","React.Fragment"],"sources":["https:/framerusercontent.com/modules/5UPpLsIptml8Pf2ste2Q/CGv6Dz5yIXHe6rOvd3YV/Table_test.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerDisableUnlink\n * @framerSupportedLayoutHeight any\n */export function MarkdownTable(props){const[ReactMarkdown,setReactMarkdown]=React.useState(null);const[remarkGfm,setRemarkGfm]=React.useState(null);React.useEffect(()=>{import(\"react-markdown\").then(module=>setReactMarkdown(()=>module.default));import(\"remark-gfm\").then(module=>setRemarkGfm(()=>module.default));},[]);const{markdown,width,height,headerText,cellText,firstColumnText,headerBackgroundColor,firstColumnBackgroundColor,cellBackgroundColor,innerBorder,outerBorder,cornerRadius}=props;const containerStyle={width:width,height:height,overflow:\"auto\"};const tableWrapperStyle={border:`${outerBorder.width}px ${outerBorder.style} ${outerBorder.color}`,borderRadius:`${cornerRadius}px`,overflow:\"hidden\"};const tableStyle={width:\"100%\",borderCollapse:\"separate\",borderSpacing:0,borderRadius:`${cornerRadius}px`};const cellBaseStyle={padding:\"8px\",position:\"relative\"};const createCellStyle=(isHeader,isFirstColumn,isLastColumn,rowIndex,colIndex)=>{var _textStyle_font_style,_textStyle_font;const textStyle=isHeader?headerText:isFirstColumn?firstColumnText:cellText;return{...cellBaseStyle,backgroundColor:isHeader?headerBackgroundColor:isFirstColumn?firstColumnBackgroundColor:cellBackgroundColor,fontFamily:textStyle.framerFont.fontFamily||\"Inter\",fontWeight:textStyle.framerFont.fontWeight||400,fontStyle:((_textStyle_font=textStyle.font)===null||_textStyle_font===void 0?void 0:(_textStyle_font_style=_textStyle_font.style)===null||_textStyle_font_style===void 0?void 0:_textStyle_font_style.includes(\"Italic\"))?\"italic\":\"normal\",fontSize:`${textStyle.size}px`,color:textStyle.color,letterSpacing:`${textStyle.letterSpacing}px`,lineHeight:textStyle.lineHeight,textAlign:textStyle.align,borderRight:!isLastColumn?`${innerBorder.width}px ${innerBorder.style} ${innerBorder.color}`:\"none\",borderBottom:`${innerBorder.width}px ${innerBorder.style} ${innerBorder.color}`,...rowIndex===0&&{borderTop:\"none\"},...colIndex===0&&{borderLeft:\"none\"}};};const MarkdownComponents={table:({children})=>/*#__PURE__*/_jsx(\"div\",{style:tableWrapperStyle,children:/*#__PURE__*/_jsx(\"table\",{style:tableStyle,children:children})}),thead:({children})=>/*#__PURE__*/_jsx(\"thead\",{children:children}),tbody:({children})=>/*#__PURE__*/_jsx(\"tbody\",{children:children}),tr:({children,index})=>/*#__PURE__*/_jsx(\"tr\",{\"data-row-index\":index,children:React.Children.map(children,(child,cellIndex)=>/*#__PURE__*/React.cloneElement(child,{isFirstColumn:cellIndex===0,isLastColumn:cellIndex===children.length-1,rowIndex:index,colIndex:cellIndex}))}),th:({children,isFirstColumn,isLastColumn,rowIndex,colIndex})=>/*#__PURE__*/_jsx(\"th\",{style:createCellStyle(true,isFirstColumn,isLastColumn,rowIndex,colIndex),children:React.Children.map(children,child=>typeof child===\"string\"?child.split(\"<br>\").map((text,i,array)=>i===array.length-1?text:/*#__PURE__*/_jsxs(React.Fragment,{children:[text,/*#__PURE__*/_jsx(\"br\",{})]},i)):child)}),td:({children,isFirstColumn,isLastColumn,rowIndex,colIndex})=>/*#__PURE__*/_jsx(\"td\",{style:createCellStyle(false,isFirstColumn,isLastColumn,rowIndex,colIndex),children:React.Children.map(children,child=>typeof child===\"string\"?child.split(\"<br>\").map((text,i,array)=>i===array.length-1?text:/*#__PURE__*/_jsxs(React.Fragment,{children:[text,/*#__PURE__*/_jsx(\"br\",{})]},i)):child)})};if(!ReactMarkdown||!remarkGfm){// Return a loading state or placeholder\nreturn /*#__PURE__*/_jsx(\"div\",{children:\"Loading...\"});}return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,children:[/*#__PURE__*/_jsx(ReactMarkdown,{components:MarkdownComponents,remarkPlugins:[remarkGfm],children:markdown}),/*#__PURE__*/_jsx(\"style\",{children:`\n                table tr:last-child td {\n                    border-bottom: none !important;\n                }\n                table tr td:first-child, table tr th:first-child {\n                    border-left: none !important;\n                }\n                table tr:first-child th {\n                    border-top: none !important;\n                }\n                table tr td:last-child, table tr th:last-child {\n                    border-right: none !important;\n                }\n            `})]});}MarkdownTable.defaultProps={markdown:\"| Header 1 | Header 2 | Header 3 |\\n|----------|----------|----------|\\n| Row 1 Col 1 | Row 1 Col 2 | Row 1 Col 3 |\\n| Row 2 Col 1 | Row 2 Col 2 | Row 2 Col 3 |\",width:\"100%\",height:\"auto\",headerBackgroundColor:\"#f0f0f0\",firstColumnBackgroundColor:\"#f9f9f9\",cellBackgroundColor:\"#ffffff\",cornerRadius:4,innerBorder:{color:\"#dddddd\",width:1,style:\"solid\"},outerBorder:{color:\"#bbbbbb\",width:2,style:\"solid\"}};addPropertyControls(MarkdownTable,{markdown:{type:ControlType.String,title:\"Markdown\",displayTextArea:true},width:{type:ControlType.FusedNumber,title:\"Width\",defaultValue:300,toggleKey:\"widthType\",toggleTitles:[\"Fixed\",\"Flexible\"],valueKeys:[\"width\"],valueLabels:[\"W\"],min:0},height:{type:ControlType.FusedNumber,title:\"Height\",defaultValue:200,toggleKey:\"heightType\",toggleTitles:[\"Fixed\",\"Flexible\"],valueKeys:[\"height\"],valueLabels:[\"H\"],min:0},headerText:{type:ControlType.Object,title:\"Header Text\",controls:{framerFont:{type:ControlType.Font,title:\"Font\",defaultValue:{family:\"Inter\",weight:400}},color:{type:ControlType.Color,defaultValue:\"#000000\"},size:{type:ControlType.Number,defaultValue:16,min:0,max:200,unit:\"px\"},letterSpacing:{type:ControlType.Number,defaultValue:0,min:-20,max:100,unit:\"px\",step:.1,displayStepper:true},lineHeight:{type:ControlType.Number,defaultValue:1.2,min:0,max:3,step:.1,displayStepper:true},align:{type:ControlType.SegmentedEnum,options:[\"left\",\"center\",\"right\"],defaultValue:\"left\"}}},cellText:{type:ControlType.Object,title:\"Cell Text\",controls:{framerFont:{type:ControlType.Font,title:\"Font\",defaultValue:{family:\"Inter\",weight:400}},color:{type:ControlType.Color,defaultValue:\"#000000\"},size:{type:ControlType.Number,defaultValue:14,min:0,max:200,unit:\"px\"},letterSpacing:{type:ControlType.Number,defaultValue:0,min:-20,max:100,unit:\"px\",step:.1,displayStepper:true},lineHeight:{type:ControlType.Number,defaultValue:1.2,min:0,max:3,step:.1,displayStepper:true},align:{type:ControlType.SegmentedEnum,options:[\"left\",\"center\",\"right\"],defaultValue:\"left\"}}},firstColumnText:{type:ControlType.Object,title:\"First Column Text\",controls:{framerFont:{type:ControlType.Font,title:\"Font\",defaultValue:{family:\"Inter\",weight:400}},color:{type:ControlType.Color,defaultValue:\"#000000\"},size:{type:ControlType.Number,defaultValue:14,min:0,max:200,unit:\"px\"},letterSpacing:{type:ControlType.Number,defaultValue:0,min:-20,max:100,unit:\"px\",step:.1,displayStepper:true},lineHeight:{type:ControlType.Number,defaultValue:1.2,min:0,max:3,step:.1,displayStepper:true},align:{type:ControlType.SegmentedEnum,options:[\"left\",\"center\",\"right\"],defaultValue:\"left\"}}},headerBackgroundColor:{type:ControlType.Color,title:\"Header Color\",defaultValue:\"#f0f0f0\"},firstColumnBackgroundColor:{type:ControlType.Color,title:\"First Column Color\",defaultValue:\"#f9f9f9\"},cellBackgroundColor:{type:ControlType.Color,title:\"Cell Color\",defaultValue:\"#ffffff\"},innerBorder:{type:ControlType.Object,title:\"Inner Border\",controls:{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#dddddd\"},width:{type:ControlType.Number,title:\"Width\",defaultValue:1,min:0,max:10,step:1,unit:\"px\"},style:{type:ControlType.Enum,title:\"Style\",defaultValue:\"solid\",options:[\"solid\",\"dashed\",\"dotted\",\"double\"],optionTitles:[\"Solid\",\"Dashed\",\"Dotted\",\"Double\"]}}},outerBorder:{type:ControlType.Object,title:\"Outer Border\",controls:{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#bbbbbb\"},width:{type:ControlType.Number,title:\"Width\",defaultValue:2,min:0,max:10,step:1,unit:\"px\"},style:{type:ControlType.Enum,title:\"Style\",defaultValue:\"solid\",options:[\"solid\",\"dashed\",\"dotted\",\"double\"],optionTitles:[\"Solid\",\"Dashed\",\"Dotted\",\"Double\"]}}},cornerRadius:{type:ControlType.Number,title:\"Corner Radius\",defaultValue:4,min:0,max:20,step:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"MarkdownTable\":{\"type\":\"reactComponent\",\"name\":\"MarkdownTable\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"* @framerSupportedLayoutHeight any\",\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Table_test.map"],"mappings":"8MAIG,SAAgB,EAAc,EAAM,CAAC,GAAK,CAAC,EAAc,GAAkBA,EAAe,KAAK,CAAM,CAAC,EAAU,GAAcA,EAAe,KAAK,CAAC,MAAoB,CAAC,OAAO,yCAAkB,KAAK,GAAQ,MAAqB,EAAO,QAAQ,CAAC,CAAC,OAAO,qCAAc,KAAK,GAAQ,MAAiB,EAAO,QAAQ,CAAC,EAAG,EAAE,CAAC,CAAC,GAAK,CAAC,WAAS,QAAM,SAAO,aAAW,WAAS,kBAAgB,wBAAsB,6BAA2B,sBAAoB,cAAY,cAAY,gBAAc,EAAY,EAAe,CAAO,QAAa,SAAO,SAAS,OAAO,CAAO,EAAkB,CAAC,OAAO,GAAG,EAAY,MAAM,KAAK,EAAY,MAAM,GAAG,EAAY,QAAQ,aAAa,GAAG,EAAa,IAAI,SAAS,SAAS,CAAO,EAAW,CAAC,MAAM,OAAO,eAAe,WAAW,cAAc,EAAE,aAAa,GAAG,EAAa,IAAI,CAAO,EAAc,CAAC,QAAQ,MAAM,SAAS,WAAW,CAAO,GAAiB,EAAS,EAAc,EAAa,EAAS,IAAW,CAAC,IAA0B,EAAgB,IAAM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