{"version":3,"file":"React_spline.CMsHJsCH.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/ENVLrih0zcRqQ2W9TqN4/lcvou1ISqqnY7MZxydLT/React_spline.js"],"sourcesContent":["import{jsx as _jsx,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useRef}from\"react\";import{Frame}from\"framer\";import{addPropertyControls,ControlType}from\"framer\";export function SplineCanvas({runtimeUrl,sceneUrl,index}){const canvasRef=useRef(null);useEffect(()=>{const load=async()=>{if(!runtimeUrl||!sceneUrl)return;try{const module=await import(/* @vite-ignore */runtimeUrl);const app=new module.Application(canvasRef.current);await app.load(sceneUrl);}catch(err){console.error(\"Error loading Spline scene:\",err);}};load();},[runtimeUrl,sceneUrl]);return /*#__PURE__*/_jsx(Frame,{background:\"transparent\",width:\"100%\",height:\"100%\",children:/*#__PURE__*/_jsx(\"canvas\",{ref:canvasRef,id:`spline-canvas-${index}`,style:{width:\"100%\",height:\"100%\",display:\"block\",cursor:\"inherit\"}})});}// 👉 加入右侧属性面板参数设置\naddPropertyControls(SplineCanvas,{runtimeUrl:{type:ControlType.String,title:\"Runtime URL\",placeholder:\"https://example.com/runtime.js?v=1.0.0\",defaultValue:\"\"},sceneUrl:{type:ControlType.String,title:\"Scene URL\",placeholder:\"https://example.com/scene.splinecode?v=1.0.0\",defaultValue:\"\"}});// 示例如何渲染多个 Spline 场景\nexport function MultipleSplines({runtimeUrl,sceneUrls}){return /*#__PURE__*/_jsx(_Fragment,{children:sceneUrls.map((sceneUrl,index)=>/*#__PURE__*/_jsx(SplineCanvas,{runtimeUrl:runtimeUrl,sceneUrl:sceneUrl,index:index},index))});}\nexport const __FramerMetadata__ = {\"exports\":{\"SplineCanvas\":{\"type\":\"reactComponent\",\"name\":\"SplineCanvas\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"MultipleSplines\":{\"type\":\"reactComponent\",\"name\":\"MultipleSplines\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./React_spline.map"],"mappings":"qRAAmL,SAAgB,EAAa,CAAC,aAAW,WAAS,SAAO,CAAC,IAAM,EAAUA,EAAO,KAAK,CAA+S,OAA9S,MAAc,EAAY,SAAS,CAAI,MAAC,GAAY,CAAC,GAAgB,GAAG,CAA6G,MAA1C,IAArD,MAAM,OAAyB,KAAiC,YAAY,EAAU,QAAQ,CAAW,KAAK,EAAS,OAAQ,EAAI,CAAC,QAAQ,MAAM,8BAA8B,EAAI,KAAU,EAAG,CAAC,EAAW,EAAS,CAAC,CAAqB,EAAK,EAAM,CAAC,WAAW,cAAc,MAAM,OAAO,OAAO,OAAO,SAAsB,EAAK,SAAS,CAAC,IAAI,EAAU,GAAG,iBAAiB,IAAQ,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,QAAQ,QAAQ,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,kBAAjuB,IAAoC,IAA0B,CAC/H,EAAoB,EAAa,CAAC,WAAW,CAAC,KAAK,EAAY,OAAO,MAAM,cAAc,YAAY,yCAAyC,aAAa,GAAG,CAAC,SAAS,CAAC,KAAK,EAAY,OAAO,MAAM,YAAY,YAAY,+CAA+C,aAAa,GAAG,CAAC,CAAC"}