{"version":3,"file":"store.js@_1.0.DuNBAjY4.mjs","names":["React.useContext","useState"],"sources":["https:/framerusercontent.com/modules/GvBeQcgWIOHEPx2UyRYT/ZQBLyDov1cIQTQDamXUK/OrderItemList.js","https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0"],"sourcesContent":["// OrderItemsList.tsx\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";export const RowDataContext=/*#__PURE__*/React.createContext(null);export const useRowData=()=>React.useContext(RowDataContext);const mapAlign=(v=\"center\")=>v===\"start\"?\"flex-start\":v===\"end\"?\"flex-end\":\"center\";export default function OrderItemsList({data=[],item,direction=\"vertical\",gap=8,scroll=true,maxItems=999,emptyText=\"데이터가 없습니다\",emptyFontSize=12,emptyColor=\"#999999\",emptyFontFamily=\"inherit\",emptyTextAlign=\"center\",emptyVAlign=\"center\",emptyHAlign=\"center\",emptyImage,emptyImageSize=64,emptyGap=8}){const rows=Array.isArray(data)?data.slice(0,maxItems):[];const containerStyle={display:\"flex\",flexDirection:direction===\"vertical\"?\"column\":\"row\",gap,width:\"100%\",...scroll?{maxHeight:\"100%\",overflow:\"auto\"}:{overflow:\"hidden\"},alignItems:direction===\"vertical\"?\"stretch\":\"flex-start\",minWidth:0};const renderEmpty=textToShow=>{const wrapStyle={display:\"flex\",flexDirection:\"column\",alignItems:mapAlign(emptyHAlign),justifyContent:mapAlign(emptyVAlign),width:\"100%\",minHeight:\"100%\",gap:emptyGap,padding:8,textAlign:emptyTextAlign};const textStyle={opacity:.9,fontSize:emptyFontSize,color:emptyColor,fontFamily:emptyFontFamily,lineHeight:1.35,wordBreak:\"keep-all\"};const imgStyle={width:emptyImageSize,height:emptyImageSize,objectFit:\"contain\",display:emptyImage?\"block\":\"none\",pointerEvents:\"none\",userSelect:\"none\"};return /*#__PURE__*/_jsxs(\"div\",{style:wrapStyle,children:[emptyImage?/*#__PURE__*/_jsx(\"img\",{src:emptyImage,alt:\"\",style:imgStyle}):null,/*#__PURE__*/_jsx(\"div\",{style:textStyle,children:textToShow})]});};if(!item){return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:renderEmpty(\"Item 슬롯에 디자인 컴포넌트를 지정하세요\")});}if(!rows.length){return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:renderEmpty(emptyText)});}return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:rows.map((row,i)=>/*#__PURE__*/_jsx(RowDataContext.Provider,{value:{data:row,index:i,isLast:i===rows.length-1},children:item/* ★ 그대로 렌더: 복제하지 않음 */},i))});}OrderItemsList.defaultProps={width:360,height:240,direction:\"vertical\",gap:8,scroll:true,maxItems:999,emptyText:\"데이터가 없습니다\",emptyFontSize:12,emptyColor:\"#999999\",emptyFontFamily:\"inherit\",emptyTextAlign:\"center\",emptyVAlign:\"center\",emptyHAlign:\"center\",emptyImageSize:64,emptyGap:8};addPropertyControls(OrderItemsList,{item:{type:ControlType.ComponentInstance,title:\"Item\"},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"vertical\",\"horizontal\"],optionTitles:[\"Vertical\",\"Horizontal\"],defaultValue:\"vertical\"},gap:{type:ControlType.Number,title:\"Gap\",min:0,max:64,step:1,displayStepper:true,defaultValue:8,unit:\"px\"},scroll:{type:ControlType.Boolean,title:\"Scroll\",defaultValue:true},maxItems:{type:ControlType.Number,title:\"Max Items\",min:1,max:1e3,step:1,defaultValue:999},/* === Empty View Controls === */emptyText:{type:ControlType.String,title:\"Empty Text\",defaultValue:\"데이터가 없습니다\",placeholder:\"비어있을 때 표시할 문구\"},emptyImage:{type:ControlType.Image,title:\"Empty Image\"},emptyImageSize:{type:ControlType.Number,title:\"Image Size\",min:16,max:512,step:1,defaultValue:64,unit:\"px\",displayStepper:true},emptyGap:{type:ControlType.Number,title:\"Gap\",min:0,max:64,step:1,defaultValue:8,unit:\"px\",displayStepper:true},emptyFontSize:{type:ControlType.Number,title:\"Font Size\",min:8,max:64,step:1,defaultValue:12,unit:\"px\",displayStepper:true},emptyColor:{type:ControlType.Color,title:\"Font Color\",defaultValue:\"#999999\"},emptyFontFamily:{type:ControlType.String,title:\"Font Family\",placeholder:\"예) Pretendard, system-ui\",defaultValue:\"inherit\"},emptyTextAlign:{type:ControlType.Enum,title:\"Text Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\"},emptyVAlign:{type:ControlType.Enum,title:\"Vertical Align\",options:[\"start\",\"center\",\"end\"],optionTitles:[\"Start\",\"Center\",\"End\"],defaultValue:\"center\"},emptyHAlign:{type:ControlType.Enum,title:\"Horizontal Align\",options:[\"start\",\"center\",\"end\"],optionTitles:[\"Start\",\"Center\",\"End\"],defaultValue:\"center\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"useRowData\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"RowDataContext\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"OrderItemsList\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"RowContext\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./OrderItemList.map","import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map","/*\n * createStore (framer/store@1.0.1)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js\"\n"],"mappings":"qNAC6V,SAAwB,EAAe,CAAC,OAAK,EAAE,CAAC,OAAK,YAAU,WAAW,MAAI,EAAE,SAAO,GAAK,WAAS,IAAI,YAAU,YAAY,gBAAc,GAAG,aAAW,UAAU,kBAAgB,UAAU,iBAAe,SAAS,cAAY,SAAS,cAAY,SAAS,aAAW,iBAAe,GAAG,WAAS,GAAG,CAAC,IAAM,EAAK,MAAM,QAAQ,EAAK,CAAC,EAAK,MAAM,EAAE,EAAS,CAAC,EAAE,CAAO,EAAe,CAAC,QAAQ,OAAO,cAAc,IAAY,WAAW,SAAS,MAAM,MAAI,MAAM,OAAO,GAAG,EAAO,CAAC,UAAU,OAAO,SAAS,OAAO,CAAC,CAAC,SAAS,SAAS,CAAC,WAAW,IAAY,WAAW,UAAU,aAAa,SAAS,EAA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