{"version":3,"file":"TextPro.BCG7lp9i.mjs","names":["useState","useMemo"],"sources":["https:/framerusercontent.com/modules/20zhayqm9y3Y0ekkXAdJ/sr1Sj9PIAlRd9EdJVnUb/Style.js","https:/framerusercontent.com/modules/dqTAkSmLH1iWI2I3ThDP/4jDYjmPYWsKh3FBHkuKT/TextPro.js"],"sourcesContent":["// Importing necessary modules from @emotion/react\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{Global,css}from\"@emotion/react\";// import { createStore } from \"https://framer.com/m/framer/store.js\"\n// export const useStoretheme = createStore({\n//     // Set the starting theme below, otherwise default to system.\n//     theme: \"system\",\n// })\n//import { root } from \"../0_CSS/Theme.tsx\"\n// Defining global styles\nconst borderpop=css`\n  gap: var(--gap-normal);\n  border-radius: var(--radius-normal);\n  border-width: var(--borderwidth-normal);\n  border-style: solid;\n  padding: var(--padding-small);\n`;const borderCaroulselItem=css`\n  gap: var(--gap-normal);\n  border-radius: var(--radius-normal);\n  border-width: var(--borderwidth-normal);\n  border-color:var(--border-color);\n  border-style: solid;\n  width: 100%;\n  background-position: center;\n  background-size: cover;\n  padding: var(--padding-none);\n`;const MenuItem=css`\n  gap: var(--gap-normal);\n  border-radius: var(--radius-small);\n  border-width: var(--borderwidth-small);\n  border-style: solid;\n  padding: var(--padding-small);\n`;const globalStyles=css`\n\n.nonebg {\n  ${borderpop};\n  width:100%;\n  height:100%;\n  padding:var(--padding-none);\n  display: flex;\n  flex-direction: column;\n  border-color: rgba(0,0,0,0);\n  background-color: rgba(0,0,0,0);\n}\n\n.popover {\n  ${borderpop};\n  display: flex;\n  max-width: min(calc(100vw - 16px), 800px);\n  flex-direction: column;\n  border-color: var(--border-p-color);\n  background-color: var(--bg-color);\n  color: var(--text-color);\n  box-shadow:var(--box-shadow);\n  z-index: 100;\n}\n.arrow > svg {\n  fill: var(--bg-color);\n  stroke: var(--border-color);\n}\n\n.swiper {\n  width: 100%;\n  height: 100%;\n}\n.swiper-slide {\n  ${borderCaroulselItem};\n  object-position: center;\n  border-color: var(--border-color);\n  background-color: var(--bg-color);\n  color: black;\n  box-shadow:var(--box-shadow-small);\n  will-change: transform;\n  &[data-border]{\n    border:none;\n  }\n}\n.swiper-slide img {\n  display: block;\n  width: 100%;\n  height:100%;\n  object-fit: cover;\n}\n\n\n.my-custom-bullet {\n  --swiper-pagination-color: var(--highlight-background);\n  --swiper-pagination-bullet-width: 1.429rem;\n  --swiper-pagination-bullet-height: 1.429rem;\n  --swiper-pagination-bullet-inactive-color: var(--act-color);\n  --swiper-pagination-bullet-inactive-opacity: 1;\n  color: #000;\n  font-size: 0.857rem;\n  text-align: center;\n  line-height: 1.429rem;\n}\n\n.swiper-control{\n  z-index: 1;\n  position: absolute;\n  height: 1px;\n  overflow: visible;\n  width: 100%;\n  top: 50%;\n  left: 0;\n  transform: translateY(-50%);\n  opacity: 0;\n  visibility: hidden;\n  transition: opacity 0.3s ease, visibility 0.3s ease;\n}\n\n.swiper:hover .swiper-control {\n  opacity: 1;\n  visibility: visible;\n}\n\n\n/* 针对移动设备 */\n@media (max-width: 768px) {\n  .swiper-control {\n    opacity: 1;\n    visibility: visible;\n  }\n}\n\n/* Menu */\n.menu {\n  position: relative;\n  z-index: 99;\n  ${MenuItem};\n  display: flex;\n  max-height: var(--popover-available-height);\n  min-width: 180px;\n  flex-direction: column;\n  overscroll-behavior: contain;\n  border-color: var(--border-color);\n  background-color: var(--bg-color);\n  color: var(--text-color);\n  icon-color:var(--text-color);\n  box-shadow:var(--box-shadow);\n  outline: none !important;\n  overflow: visible;\n  font-size: 1rem;\n  font-weight: 500;\n}\n\n.menu-item {\n  display: flex;\n  cursor: default;\n  scroll-margin: 0.5rem;\n  align-items: center;\n  gap: var(--gap-normal);\n  border-radius: var(--radius-tiny);\n  padding: var(--padding-small);\n  outline: none !important;\n}\n\n.menu-item[aria-disabled=\"true\"] {\n  opacity: 0.25;\n}\n\n.menu-item[data-active-item] {\n  background-color: var(--hover-color);\n  color: var(--text-hover-color);\n}\n\n.menu-item:active,\n.menu-item[data-active] {\n  background-color: var(--active-color);\n  padding-top: 0.643rem;\n  padding-bottom: 0.5rem;\n}\n\n.menu:not(:focus) .menu-item:not(:focus)[aria-expanded=\"true\"] {\n  background-color: rgb(0 0 0 / 7.5%);\n  color: currentColor;\n}\n\n.menu:not(:focus)\n  .menu-item:not(:focus)[aria-expanded=\"true\"]:where(.dark, .dark *) {\n  background-color: rgb(255 255 255 / 0.1);\n}\n\n.menu-item .label {\n  flex: 1 1 0%;\n}\n.separator {\n  margin-top: 0.143rem;\n  margin-bottom: 0.143rem;\n  height: 0px;\n  width: 100%;\n  border-top-width: var(--borderwidth-small);\n  border-color: var(--line-color);\n}\n`;//const globalStylesCSS = [root, globalStyles]\nconst GlobalStyles=()=>/*#__PURE__*/_jsx(Global,{styles:globalStyles});// Font styling configuration\n// L M S 命名不可更改，否则会出问题，下方的width判断函数会返回这个值，要改一起改\nlet GlobalFont={weight:{light:{\"--framer-font-weight\":\"300\"},regular:{\"--framer-font-weight\":\"400\"},medium:{\"--framer-font-weight\":\"500\"},semibold:{\"--framer-font-weight\":\"600\"},bold:{\"--framer-font-weight\":\"700\"}},fontsize:{\"Tiny ---(11px p)\":{L:{type:\"p\",\"--framer-font-size\":\"11px\",\"--framer-line-height\":\"1.3em\",\"--framer-letter-spacing\":\"0em\",\"--framer-font-family\":\"var(--font-family)\"},M:{type:\"p\",\"--framer-font-size\":\"11px\",\"--framer-line-height\":\"1.3em\",\"--framer-letter-spacing\":\"0em\",\"--framer-font-family\":\"var(--font-family)\"},S:{type:\"p\",\"--framer-font-size\":\"11px\",\"--framer-line-height\":\"1.3em\",\"--framer-letter-spacing\":\"0em\",\"--framer-font-family\":\"var(--font-family)\"}},\"Detail ---(13px p)\":{L:{type:\"p\",\"--framer-font-size\":\"13px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"0em\",\"--framer-font-family\":\"var(--font-family)\"},M:{type:\"p\",\"--framer-font-size\":\"13px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"0em\",\"--framer-font-family\":\"var(--font-family)\"},S:{type:\"p\",\"--framer-font-size\":\"13px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"0em\",\"--framer-font-family\":\"var(--font-family)\"}},\"Callout ---(15px p)\":{L:{type:\"p\",\"--framer-font-size\":\"15px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.01em\",\"--framer-font-family\":\"var(--font-family)\"},M:{type:\"p\",\"--framer-font-size\":\"16px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.01em\",\"--framer-font-family\":\"var(--font-family)\"},S:{type:\"p\",\"--framer-font-size\":\"16px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.01em\",\"--framer-font-family\":\"var(--font-family)\"}},\"Body ---(16px p)\":{L:{type:\"p\",\"--framer-font-size\":\"16px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.01em\",\"--framer-font-family\":\"var(--font-family)\"},M:{type:\"p\",\"--framer-font-size\":\"17px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.01em\",\"--framer-font-family\":\"var(--font-family)\"},S:{type:\"p\",\"--framer-font-size\":\"17px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.01em\",\"--framer-font-family\":\"var(--font-family)\"}},\"Headline ---(18px H6)\":{L:{type:\"H6\",\"--framer-font-size\":\"18px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.01em\",\"--framer-font-family\":\"var(--font-family)\"},M:{type:\"H6\",\"--framer-font-size\":\"16px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.01em\",\"--framer-font-family\":\"var(--font-family)\"},S:{type:\"H6\",\"--framer-font-size\":\"16px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.01em\",\"--framer-font-family\":\"var(--font-family)\"}},\"Title ---(24px H3)\":{L:{type:\"H3\",\"--framer-font-size\":\"24px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.01em\",\"--framer-font-family\":\"var(--font-family)\"},M:{type:\"H3\",\"--framer-font-size\":\"20px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.01em\",\"--framer-font-family\":\"var(--font-family)\"},S:{type:\"H3\",\"--framer-font-size\":\"20px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.01em\",\"--framer-font-family\":\"var(--font-family)\"}},\"LargeTitle ---(36px H2)\":{L:{type:\"H2\",\"--framer-font-size\":\"36px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.03em\",\"--framer-font-family\":\"var(--font-family)\"},M:{type:\"H2\",\"--framer-font-size\":\"32px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.03em\",\"--framer-font-family\":\"var(--font-family)\"},S:{type:\"H2\",\"--framer-font-size\":\"28px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.03em\",\"--framer-font-family\":\"var(--font-family)\"}},\"H1 ---(64px)\":{L:{type:\"H1\",\"--framer-font-size\":\"64px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.03em\",\"--framer-font-family\":\"var(--font-family)\"},M:{type:\"H1\",\"--framer-font-size\":\"48px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.03em\",\"--framer-font-family\":\"var(--font-family)\"},S:{type:\"H1\",\"--framer-font-size\":\"48px\",\"--framer-line-height\":\"1.4em\",\"--framer-letter-spacing\":\"-0.03em\",\"--framer-font-family\":\"var(--font-family)\"}}}};// 添加一个更新函数\nexport const updateGlobalFont=newConfig=>{if(newConfig&&typeof newConfig===\"object\"){GlobalFont={...GlobalFont,...newConfig};}};function screenSize(){// const isClient = typeof window !== \"undefined\"\n// if (isClient) {\n//     const width = window.\n//     if (width >= 1200) {\n//         return \"L\"\n//     } else if (width >= 810) {\n//         return \"M\"\n//     } else {\n//         return \"S\"\n//     }\n// } else {\n//     // 如果 window 不存在，返回一个默认值或处理逻辑\n//     return \"L\" // 默认返回小屏幕尺寸\n// }\nconst isClient=typeof window!==\"undefined\";if(isClient){const largeScreenQuery=window.matchMedia(\"(min-width: 1200px)\");const mediumScreenQuery=window.matchMedia(\"(min-width: 810px) and (max-width: 1199px)\");if(largeScreenQuery.matches){return\"L\";}else if(mediumScreenQuery.matches){return\"M\";}else{return\"S\";}}else{// 如果 window 不存在，返回一个默认值或处理逻辑\nreturn\"L\"// 默认返回大屏幕尺寸\n;}}// function screenSizeDetail() {\n//     const [details, setDetails] = useState({ width: 1200, height: 800 })\n//     useEffect(() => {\n//         const updateDetails = () => {\n//             setDetails({ width: window., height: window. })\n//         }\n//         updateDetails() // 初始化时调用一次\n//         window.addEventListener(\"resize\", updateDetails)\n//         return () => {\n//             window.removeEventListener(\"resize\", updateDetails)\n//         }\n//     }, [])\n//     return details\n// }\n// 封装的函数，用来获取CSS变量\nfunction getCssVariable(variableName){const isClient=typeof window!==\"undefined\";if(isClient){return getComputedStyle(document.documentElement).getPropertyValue(variableName).trim();}else{return\"\";}}function screenSizeDetail(){const isClient=typeof window!==\"undefined\";if(isClient){// const width = window.=\n// const height = window.=\nconst width=document.documentElement.clientWidth;const height=document.documentElement.clientHeight;// console.log(document.documentElement.clientHeight, height)\nreturn{width:width,height:height};}else{return{width:1200,height:800};}}export{GlobalStyles,GlobalFont,screenSize,screenSizeDetail,getCssVariable,};export default function DSStyle(props){return /*#__PURE__*/_jsx(\"div\",{});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DSStyle\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"GlobalFont\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"GlobalStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getCssVariable\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"screenSizeDetail\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"updateGlobalFont\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"screenSize\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Style.map","// import React, { useState, useEffect, cloneElement, isValidElement } from \"react\"\n// import { addPropertyControls, ControlType, RenderTarget } from \"framer\"\n// import { GlobalFont, GlobalStyles, screenSize } from \"../0_Global/Style.tsx\"\n// import { colorpattle } from \"../0_CSS/Theme.tsx\"\n// // import { GlobalFont, GlobalStyles, screenSize } from \"../0_Global/Style.tsx\"\n// /**\n//  * @framerDisableUnlink\n//  */\n// export default function TextPro(props) {\n//     const {\n//         textitem,\n//         fontsize,\n//         fontweight,\n//         fontColor,\n//         fontSysColor,\n//         SameAlign,\n//         align,\n//         ...elseprops\n//     } = props\n//     const evi =\n//         RenderTarget.current() === RenderTarget.preview ||\n//         RenderTarget.current() === RenderTarget.export ||\n//         RenderTarget.current() === RenderTarget.canvas\n//     const Wsize = screenSize()\n//     //const mode = localStorage.getItem(\"theme\") === \"dark\" ? \"dark\" : \"light\"\n//     const tfontColor =\n//         fontSysColor !== \"none\" ? \"var(\" + fontSysColor + \")\" : fontColor\n//     //fontSysColor !== \"none\" ? colorpattle[fontSysColor][mode] : fontColor\n//     // console.log(\"hi color\")\n//     // console.log(tfontColor, mode)\n//     const element =\n//         Array.isArray(textitem) && textitem.length > 0 ? textitem[0] : textitem\n//     const [textobj, settext] = useState(null)\n//     //console.log(element)\n//     useEffect(() => {\n//         if (Object.keys(element).length !== 0) {\n//             try {\n//                 const FirstStyle = {\n//                     ...element?.props?.children?.props?.children?.props\n//                         ?.children?.props?.style,\n//                     ...GlobalFont.fontsize[fontsize][Wsize],\n//                 }\n//                 const combinedStyle = {\n//                     ...FirstStyle,\n//                     ...GlobalFont.weight[fontweight],\n//                     \"--framer-text-color\": tfontColor,\n//                     ...(!SameAlign && { \"--framer-text-alignment\": align }),\n//                 }\n//                 //console.log(combinedStyle)\n//                 let element2 = cloneElement(element)\n//                 // console.log(element2.props)\n//                 if (evi) {\n//                     let target =\n//                         element2?.props?.children?.props?.children?.props\n//                             ?.children\n//                     if (target) {\n//                         target.type = GlobalFont.fontsize[fontsize][Wsize].type\n//                         target.props.style = combinedStyle\n//                     }\n//                 }\n//                 const cElement = cloneElement(element2, {\n//                     ...element2.props,\n//                     style: {\n//                         ...element2.props.style,\n//                         width: \"100%\",\n//                         // 添加其他的样式属性\n//                     },\n//                 })\n//                 settext(cElement)\n//             } catch (error) {\n//                 console.log(\"文字核心组件错误\", error.message, error, element)\n//                 // console.log(element)\n//             }\n//         }\n//     }, [textitem])\n//     // console.log(\"修改的数值:\")\n//     // console.log(\n//     //     React.isValidElement(clonedElement) ? clonedElement : \"啥也没有\"\n//     // )\n//     // <div className=\"tooltip-container\">\n//     //     Hover over me\n//     //     <GlobalStyles />\n//     //     <span className=\"tooltip-text\">This is the tooltip text!</span>\n//     // </div>\n//     if (isValidElement(textobj)) {\n//         return <div>{textobj}</div>\n//     } else {\n//         //return <h1>Add Textitem first</h1>\n//         return null\n//     }\n// }\n// addPropertyControls(TextPro, {\n//     textitem: {\n//         type: ControlType.ComponentInstance,\n//     },\n//     fontsize: {\n//         type: ControlType.Enum,\n//         // displaySegmentedControl: true,\n//         // segmentedControlDirection: \"vertical\",\n//         options: Object.keys(GlobalFont.fontsize),\n//         optionTitles: Object.keys(GlobalFont.fontsize),\n//     },\n//     fontweight: {\n//         type: ControlType.Enum,\n//         defaultValue: \"regular\",\n//         // displaySegmentedControl: true,\n//         // segmentedControlDirection: \"vertical\",\n//         options: Object.keys(GlobalFont.weight),\n//         optionTitles: Object.keys(GlobalFont.weight),\n//     },\n//     fontSysColor: {\n//         type: ControlType.Enum,\n//         defaultValue: \"none\",\n//         options: [\"none\", ...Object.keys(colorpattle)],\n//     },\n//     fontColor: {\n//         type: ControlType.Color,\n//         defaultValue:\n//             colorpattle[\"--text-p-color\"][\n//                 localStorage.getItem(\"theme\") === \"dark\" ? \"dark\" : \"light\"\n//             ],\n//         hidden(props) {\n//             return props.fontSysColor !== \"none\"\n//         },\n//     },\n//     SameAlign: {\n//         type: ControlType.Boolean,\n//         defaultValue: true,\n//     },\n//     align: {\n//         type: ControlType.Enum,\n//         options: [\"left\", \"center\", \"right\"],\n//         optionIcons: [\n//             \"text-align-left\",\n//             \"text-align-center\",\n//             \"text-align-right\",\n//         ],\n//         displaySegmentedControl: true,\n//         hidden(props) {\n//             return props.SameAlign\n//         },\n//     },\n// })\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useLayoutEffect,cloneElement,isValidElement,useMemo}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{GlobalFont,screenSize}from\"https://framerusercontent.com/modules/20zhayqm9y3Y0ekkXAdJ/sr1Sj9PIAlRd9EdJVnUb/Style.js\";import{colorpattle}from\"https://framerusercontent.com/modules/niZ6YpK06zTaQeX49VIS/kyUI2MH03eq9506I17so/Theme.js\";// 在组件外部，只执行一次\nlet styleInjected=false;/**\n * @framerDisableUnlink\n */export default function TextPro(props){const{textitem,fontsize,fontweight,fontColor,fontSysColor,SameAlign,align,autoline,...restProps}=props;// 添加客户端状态检查\nconst[isClient,setIsClient]=useState(false);const[renderedText,setRenderedText]=useState(null);// 客户端挂载检查\nuseLayoutEffect(()=>{setIsClient(true);},[]);// 安全地获取主题\nconst getTheme=()=>{if(typeof window!==\"undefined\"&&window.localStorage){return localStorage.getItem(\"theme\")===\"dark\"?\"dark\":\"light\";}return\"light\"// 服务器端默认\n;};// 安全地检查渲染环境\nconst isRenderEnv=useMemo(()=>{if(typeof window===\"undefined\")return false;try{return[RenderTarget.preview,RenderTarget.export,RenderTarget.canvas].includes(RenderTarget.current());}catch(error){console.warn(\"RenderTarget check failed:\",error);return false;}},[isClient]);// 安全地获取屏幕尺寸\nconst Wsize=useMemo(()=>{if(!isClient)return\"desktop\"// 服务器端默认\n;try{return screenSize();}catch(error){console.warn(\"screenSize check failed:\",error);return\"desktop\";}},[isClient]);// 自动处理系统色 or 自定义色\nconst computedColor=useMemo(()=>{return fontSysColor!==\"none\"?`var(${fontSysColor})`:fontColor;},[fontSysColor,fontColor]);// 提取并缓存 element\nconst element=useMemo(()=>Array.isArray(textitem)?textitem[0]:textitem,[textitem]);// const styleTag = useMemo(\n//     () => (\n//         <style>{`\n//     .textpro-wrapper,\n//     .textpro-wrapper * {\n//         opacity: 1 !important;\n//     }\n// `}</style>\n//     ),\n//     []\n// ) // 空依赖，只创建一次\n// 📌 移到 useEffect 外面，变成独立的 useMemo\nconst computedStyle=useMemo(()=>({...GlobalFont.fontsize[fontsize]?.[Wsize],...GlobalFont.weight[fontweight],\"--framer-text-color\":computedColor,...!SameAlign&&{\"--framer-text-alignment\":align},...autoline>0&&{overflow:\"hidden\",display:\"-webkit-box\",WebkitLineClamp:autoline,WebkitBoxOrient:\"vertical\",textOverflow:\"ellipsis\",whiteSpace:\"normal\",wordBreak:\"break-word\"}}),[fontsize,Wsize,fontweight,computedColor,SameAlign,align,autoline]);useEffect(()=>{// 只在客户端执行\nif(!isClient||!element||!/*#__PURE__*/isValidElement(element)){setRenderedText(null);return;}try{// 找到嵌套的 text 元素\nconst nestedText=element?.props?.children?.props?.children?.props?.children;// ✅ 直接合并，不用重新计算\nconst baseStyle={...nestedText?.props?.style,...computedStyle};// const baseStyle = {\n//     ...nestedText?.props?.style,\n//     ...GlobalFont.fontsize[fontsize]?.[Wsize],\n//     ...GlobalFont.weight[fontweight],\n//     \"--framer-text-color\": computedColor,\n//     ...(!SameAlign && {\n//         \"--framer-text-alignment\": align,\n//     }),\n//     ...(autoline > 0 && {\n//         overflow: \"hidden\",\n//         display: \"-webkit-box\",\n//         WebkitLineClamp: autoline,\n//         WebkitBoxOrient: \"vertical\",\n//         textOverflow: \"ellipsis\",\n//         whiteSpace: \"normal\",\n//         wordBreak: \"break-word\",\n//     }),\n// }\nif(isRenderEnv&&nestedText){nestedText.type=GlobalFont.fontsize[fontsize]?.[Wsize]?.type;nestedText.props.style=baseStyle;}const wrappedElement=/*#__PURE__*/cloneElement(element,{...element.props,style:{...element.props.style,width:\"100%\"}});setRenderedText(wrappedElement);}catch(error){console.error(\"TextPro 错误:\",error.message,error);//setRenderedText(null)\n}},[isClient,element,computedStyle])// ⚠️ 依赖项也要改\n;// [\n//     isClient, // 添加 isClient 依赖\n//     element,\n//     fontsize,\n//     fontweight,\n//     computedColor,\n//     SameAlign,\n//     align,\n//     autoline,\n//     Wsize,\n//     isRenderEnv,\n// ])\n// 服务器端渲染占位符\nif(!isClient){return /*#__PURE__*/_jsx(\"div\",{style:{minHeight:\"40px\",opacity:1,visibility:\"hidden\"},children:\"Loading...\"});}// 客户端渲染,{styletag专门应对属性隐藏}\nreturn /*#__PURE__*/isValidElement(renderedText)?/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\"},children:renderedText})://     // {styleTag}\n//     {renderedText}\n// </div>\nnull;}// 安全地获取默认颜色值\nconst getDefaultColor=()=>{try{if(typeof window!==\"undefined\"&&window.localStorage){const theme=localStorage.getItem(\"theme\")===\"dark\"?\"dark\":\"light\";return colorpattle[\"--text-p-color\"]?.[theme];}}catch(error){console.warn(\"Failed to get theme from localStorage:\",error);}// 服务器端或出错时的默认值\nreturn colorpattle[\"--text-p-color\"]?.[\"light\"]||\"#000000\";};// 控件属性配置\naddPropertyControls(TextPro,{textitem:{type:ControlType.ComponentInstance},fontsize:{type:ControlType.Enum,options:Object.keys(GlobalFont.fontsize),optionTitles:Object.keys(GlobalFont.fontsize)},fontweight:{type:ControlType.Enum,defaultValue:\"regular\",options:Object.keys(GlobalFont.weight),optionTitles:Object.keys(GlobalFont.weight)},fontSysColor:{type:ControlType.Enum,defaultValue:\"none\",options:[\"none\",...Object.keys(colorpattle)]},fontColor:{type:ControlType.Color,defaultValue:getDefaultColor(),hidden(props){return props.fontSysColor!==\"none\";}},SameAlign:{type:ControlType.Boolean,defaultValue:true},align:{type:ControlType.Enum,options:[\"left\",\"center\",\"right\"],optionIcons:[\"text-align-left\",\"text-align-center\",\"text-align-right\"],displaySegmentedControl:true,hidden(props){return props.SameAlign;}},autoline:{type:ControlType.Number,defaultValue:0}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextPro\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"6TAoMgI,SAAS,GAAY,CAc1G,GAArB,IAAS,OAAwB,CAAC,IAAM,EAAiB,EAAO,WAAW,sBAAsB,CAAO,EAAkB,EAAO,WAAW,6CAA6C,CAA4F,OAAxF,EAAiB,QAAe,IAAa,EAAkB,QAAe,IAAgB,SACjT,MAAM,6BAlNqC,IAAuC,CAO5E,EAAU,CAAG;;;;;;EAsBE,CAAG;;;IAGpB,EAAU;;;;;;;;;;;IAWV,EAAU;;;;;;;;;;;;;;;;;;;;IA9Bc,CAAG;;;;;;;;;;EAkDP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAxCP,CAAG;;;;;;EAuGP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoET,EAAW,CAAC,OAAO,CAAC,MAAM,CAAC,uBAAuB,MAAM,CAAC,QAAQ,CAAC,uBAAuB,MAAM,CAAC,OAAO,CAAC,uBAAuB,MAAM,CAAC,SAAS,CAAC,uBAAuB,MAAM,CAAC,KAAK,CAAC,uBAAuB,MAAM,CAAC,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,CAAC,KAAK,IAAI,qBAAqB,OAAO,uBAAuB,QAAQ,0BAA0B,MAAM,uBAAuB,q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