{"version":3,"file":"React_spline.CaLSqKWm.mjs","names":[],"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,QAAM,CAAC,CAAC,IAAM,EAAU,EAAO,KAAK,CAA+S,MAA9S,GAAU,IAAI,CAAC,IAAM,EAAK,SAAS,CAAC,MAAI,IAAa,GAAgB,GAAG,CAAC,IAAM,EAAO,MAAM,OAAyB,GAAkB,EAAI,IAAI,EAAO,YAAY,EAAU,SAAS,KAAM,GAAI,KAAK,EAAS,AAAE,OAAM,EAAI,CAAC,QAAQ,MAAM,8BAA8B,EAAI,AAAE,CAAC,EAAC,GAAM,AAAE,EAAC,CAAC,EAAW,CAAS,EAAC,CAAqB,EAAK,EAAM,CAAC,WAAW,cAAc,MAAM,OAAO,OAAO,OAAO,SAAsB,EAAK,SAAS,CAAC,IAAI,EAAU,IAAI,gBAAgB,IAAQ,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,QAAQ,QAAQ,OAAO,SAAU,CAAC,EAAC,AAAC,EAAC,AAAE,cACpyB,AADA,GAAiE,IAAoC,IAA0B,CAC/H,EAAoB,EAAa,CAAC,WAAW,CAAC,KAAK,EAAY,OAAO,MAAM,cAAc,YAAY,yCAAyC,aAAa,EAAG,EAAC,SAAS,CAAC,KAAK,EAAY,OAAO,MAAM,YAAY,YAAY,+CAA+C,aAAa,EAAG,CAAC,EAAC"}