@restaround/react 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,9 +3,7 @@ interface Props {
3
3
  branch?: branchModels.Branch;
4
4
  coverImage?: string;
5
5
  logoImage?: string;
6
- defaultCover?: string;
7
- defaultLogo?: string;
8
6
  name: string;
9
7
  }
10
- declare const Header: ({ branch, coverImage, logoImage, name, defaultCover, defaultLogo, }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ declare const Header: ({ branch, coverImage, logoImage, name }: Props) => import("react/jsx-runtime").JSX.Element;
11
9
  export default Header;
package/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as r,Fragment as a}from"react/jsx-runtime";import{useRef as t,useEffect as i,useState as n}from"react";import{Column as c,IconLink as l,Row as o,SVGIcon as s,Carousel as d,CarouselItem as m,Chip as u,UIElementType as h,Container as _,Card as g,Flex as v}from"@sorocraft/ui";import{Wifi as f,Phone as p,Whatsapp as I,Instagram as N,Telegram as b,Tiktok as y,Facebook as P,MarkerPin as L}from"@sorocraft/ui/icons";import{isEmpty as C,priceFormatter as H,groupBy as A}from"@sorocraft/js-utils";var w="PublicMenu-module_container__QLN6U",j="PublicMenu-module_categories__Iy6NC",k="Header-module_container__tenlF",z="Header-module_cover__BAWZK",B="Header-module_content__Gx4Al",E="Header-module_logo__4MTCm",O="Header-module_info__IchYA",x="Header-module_name__30wyw",F="Header-module_address__WOxXc",M="Header-module_labels__gYyth",R="Header-module_social__AoP0z",V="Header-module_links__EeQxg";const W=({branch:a,coverImage:t,logoImage:i,name:n,defaultCover:d="",defaultLogo:m=""})=>{const{address:u,latitude:h,longitude:_}=a||{},g=C(a),v=i||m,H=`https://www.google.com/maps/place/${h},${_}`;return e("div",{className:k,children:[r("img",{src:t||d,alt:n,className:z}),e("div",{className:B,children:[r(g?()=>e(c,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[r("img",{src:v,alt:n,className:E}),r("div",{className:O,children:r("h1",{className:x,children:n})})]}):()=>e(o,{gap:1,children:[r("img",{src:v,alt:n,className:E}),e("div",{className:O,children:[r("h1",{className:x,children:n}),r("a",{className:F,href:H,target:"_blank",rel:"noopener noreferrer",children:e(o,{alignItems:"center",gap:.5,children:[r(s,{icon:L,theme:"dark"}),r("span",{children:u})]})})]})]}),{}),!g&&r("div",{className:M,children:r(c,{alignItems:"center",justifyContent:"center",gap:.75,fullHeight:!0,children:r(l,{icon:f,href:"/",size:"sm",shape:"circle"})})})]}),!g&&r("div",{className:R,children:r("div",{className:V,children:e(o,{alignItems:"center",justifyContent:"center",gap:.5,children:[r(l,{icon:p,href:"/",size:"sm",shape:"circle",theme:"light"}),r(l,{icon:I,href:"/",size:"sm",shape:"circle",theme:"light"}),r(l,{icon:N,href:"/",size:"sm",shape:"circle",theme:"light"}),r(l,{icon:b,href:"/",size:"sm",shape:"circle",theme:"light"}),r(l,{icon:y,href:"/",size:"sm",shape:"circle",theme:"light"}),r(l,{icon:P,href:"/",size:"sm",shape:"circle",theme:"light"})]})})})]})},Y=({categories:e,language:a,selectedCategoryId:i,onSelectCategory:n})=>{const c=t({}),l=e=>{(e=>{var r;const a=null===(r=null==c?void 0:c.current)||void 0===r?void 0:r[e];a&&a.scrollIntoView({behavior:"smooth",inline:"center"})})(e),n(e)};return r("div",{className:j,children:r(d,{gap:1,children:e.map((({id:e,translations:t})=>{const{name:n}=t.find((e=>e.language===a))||{};return r(m,{children:r(u,{onClick:()=>l(e),type:h.BORDERED_PRIMARY,active:e===i,children:r("div",{ref:r=>c.current[e]=r,children:n})})},e)}))})})};var D={container:"Products-module_container__bF2LF",header:"Products-module_header__0EFvL",products:"Products-module_products__AoDrY",list:"Products-module_list__LH4v5"};var T={container:"ProductsListItem-module_container__i9tFs",data:"ProductsListItem-module_data__Mb3SF",name:"ProductsListItem-module_name__T1gyJ",description:"ProductsListItem-module_description__oL4CH",image:"ProductsListItem-module_image__h6Wbi",flexWide:"ProductsListItem-module_flexWide__Ds6LE",slidein:"ProductsListItem-module_slidein__rEzMI",fadeInOut:"ProductsListItem-module_fadeInOut__i1FNq",heightAnimation:"ProductsListItem-module_heightAnimation__2fk7l",fadein:"ProductsListItem-module_fadein__tPTJ6",floatAnimation:"ProductsListItem-module_floatAnimation__vugAV"};const S=({product:a,currency:t,language:i})=>{const{translations:n,price:l,imageUrl:s}=a||{},{name:d,description:m}=n.find((e=>e.language===i))||{},u=H(l,t||"AZN",i);return r("div",{className:T.container,children:e(o,{justifyContent:"space-between",children:[r("div",{className:T.data,children:e(c,{gap:.5,children:[r("h3",{className:T.name,children:d}),r("div",{className:T.description,children:m}),r("div",{className:T.price,children:u})]})}),s&&r("img",{src:s,alt:d,className:T.image})]})})},Z=({products:a,categories:t,currency:n,language:l,productBlocksRef:o,onCategoryInView:s})=>{const d=A(a,"categoryId");return i((()=>{const e=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const r=Number(e.target.getAttribute("data-category-id"));s(r)}}))}),{root:null,threshold:.5});return Object.values((null==o?void 0:o.current)||{}).forEach((r=>{r&&e.observe(r)})),()=>{e.disconnect()}}),[o,s]),r("div",{className:D.container,children:r(c,{children:Object.keys(d).map((a=>{const i=t.find((({id:e})=>e===Number(a)))||{},{name:s}=((e,r)=>{var a,t;return(null===(t=null===(a=null==e?void 0:e.translations)||void 0===a?void 0:a.find)||void 0===t?void 0:t.call(a,(e=>e.language===r)))||{}})(i,l);return e("div",{className:D.products,ref:e=>o.current[i.id]=e,"data-category-id":a,children:[r("h2",{className:D.category,children:s}),r("div",{className:D.list,children:r(c,{gap:2,children:d[a].map((e=>r(S,{product:e,currency:n,language:l},e.id)))})})]},a)}))})})};var J="Branches-module_branches__sOuoV",K="Branches-module_list__vYoT2",Q="Branches-module_name__K0Z-4";const U=({branches:e=[]})=>r("div",{className:J,children:r(_,{className:K,children:e.map((({id:e,name:a})=>r("a",{href:"/",children:r(g,{noBottomMargin:!0,children:r(v,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:r("h2",{className:Q,children:a})})})},e)))})}),$=({data:i})=>{var c;const{name:l,coverImage:o,logoImage:s,branches:d=[],branchId:m,language:u,categories:h,products:_,currency:g}=i||{},v=d.length<=1,f=d.find((e=>e.id===Number(m))),p=v||!(null==f?void 0:f.name)?l:(null==f?void 0:f.name)||"",[I,N]=n(null===(c=null==h?void 0:h[0])||void 0===c?void 0:c.id),b=t({});return e("div",{className:w,children:[r(W,{branch:f,name:p,coverImage:o,logoImage:s}),v||m?e(a,{children:[r(Y,{categories:h,language:u,selectedCategoryId:I,onSelectCategory:e=>{N(e),(e=>{var r;const a=null===(r=null==b?void 0:b.current)||void 0===r?void 0:r[e];a&&a.scrollIntoView({behavior:"smooth",block:"start"})})(e)}}),r(Z,{categories:h,products:_,currency:g,language:u,productBlocksRef:b,onCategoryInView:e=>{e!==I&&N(e)}})]}):r(U,{branches:d})]})};export{$ as PublicMenu};
1
+ import{jsxs as e,jsx as r,Fragment as a}from"react/jsx-runtime";import{useRef as t,useEffect as i,useState as n}from"react";import{Column as c,IconLink as l,Row as o,SVGIcon as s,Carousel as d,CarouselItem as m,Chip as u,UIElementType as h,Container as _,Card as g,Flex as v}from"@sorocraft/ui";import{Wifi as f,Phone as p,Whatsapp as I,Instagram as N,Telegram as b,Tiktok as y,Facebook as P,MarkerPin as L}from"@sorocraft/ui/icons";import{isEmpty as C,priceFormatter as H,groupBy as A}from"@sorocraft/js-utils";var w="PublicMenu-module_container__QLN6U",j="PublicMenu-module_categories__Iy6NC",k="Header-module_container__tenlF",z="Header-module_cover__BAWZK",B="Header-module_content__Gx4Al",E="Header-module_logo__4MTCm",O="Header-module_info__IchYA",x="Header-module_name__30wyw",F="Header-module_address__WOxXc",M="Header-module_labels__gYyth",R="Header-module_social__AoP0z",V="Header-module_links__EeQxg";const W=({branch:a,coverImage:t,logoImage:i,name:n})=>{const{address:d,latitude:m,longitude:u}=a||{},h=C(a),_=`https://www.google.com/maps/place/${m},${u}`;return e("div",{className:k,children:[r("img",{src:t,alt:n,className:z}),e("div",{className:B,children:[r(h?()=>e(c,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[r("img",{src:i,alt:n,className:E}),r("div",{className:O,children:r("h1",{className:x,children:n})})]}):()=>e(o,{gap:1,children:[r("img",{src:i,alt:n,className:E}),e("div",{className:O,children:[r("h1",{className:x,children:n}),r("a",{className:F,href:_,target:"_blank",rel:"noopener noreferrer",children:e(o,{alignItems:"center",gap:.5,children:[r(s,{icon:L,theme:"dark"}),r("span",{children:d})]})})]})]}),{}),!h&&r("div",{className:M,children:r(c,{alignItems:"center",justifyContent:"center",gap:.75,fullHeight:!0,children:r(l,{icon:f,href:"/",size:"sm",shape:"circle"})})})]}),!h&&r("div",{className:R,children:r("div",{className:V,children:e(o,{alignItems:"center",justifyContent:"center",gap:.5,children:[r(l,{icon:p,href:"/",size:"sm",shape:"circle",theme:"light"}),r(l,{icon:I,href:"/",size:"sm",shape:"circle",theme:"light"}),r(l,{icon:N,href:"/",size:"sm",shape:"circle",theme:"light"}),r(l,{icon:b,href:"/",size:"sm",shape:"circle",theme:"light"}),r(l,{icon:y,href:"/",size:"sm",shape:"circle",theme:"light"}),r(l,{icon:P,href:"/",size:"sm",shape:"circle",theme:"light"})]})})})]})},Y=({categories:e,language:a,selectedCategoryId:i,onSelectCategory:n})=>{const c=t({}),l=e=>{(e=>{var r;const a=null===(r=null==c?void 0:c.current)||void 0===r?void 0:r[e];a&&a.scrollIntoView({behavior:"smooth",inline:"center"})})(e),n(e)};return r("div",{className:j,children:r(d,{gap:1,children:e.map((({id:e,translations:t})=>{const{name:n}=t.find((e=>e.language===a))||{};return r(m,{children:r(u,{onClick:()=>l(e),type:h.BORDERED_PRIMARY,active:e===i,children:r("div",{ref:r=>c.current[e]=r,children:n})})},e)}))})})};var D={container:"Products-module_container__bF2LF",header:"Products-module_header__0EFvL",products:"Products-module_products__AoDrY",list:"Products-module_list__LH4v5"};var T={container:"ProductsListItem-module_container__i9tFs",data:"ProductsListItem-module_data__Mb3SF",name:"ProductsListItem-module_name__T1gyJ",description:"ProductsListItem-module_description__oL4CH",image:"ProductsListItem-module_image__h6Wbi",flexWide:"ProductsListItem-module_flexWide__Ds6LE",slidein:"ProductsListItem-module_slidein__rEzMI",fadeInOut:"ProductsListItem-module_fadeInOut__i1FNq",heightAnimation:"ProductsListItem-module_heightAnimation__2fk7l",fadein:"ProductsListItem-module_fadein__tPTJ6",floatAnimation:"ProductsListItem-module_floatAnimation__vugAV"};const S=({product:a,currency:t,language:i})=>{const{translations:n,price:l,imageUrl:s}=a||{},{name:d,description:m}=n.find((e=>e.language===i))||{},u=H(l,t||"AZN",i);return r("div",{className:T.container,children:e(o,{justifyContent:"space-between",children:[r("div",{className:T.data,children:e(c,{gap:.5,children:[r("h3",{className:T.name,children:d}),r("div",{className:T.description,children:m}),r("div",{className:T.price,children:u})]})}),s&&r("img",{src:s,alt:d,className:T.image})]})})},Z=({products:a,categories:t,currency:n,language:l,productBlocksRef:o,onCategoryInView:s})=>{const d=A(a,"categoryId");return i((()=>{const e=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const r=Number(e.target.getAttribute("data-category-id"));s(r)}}))}),{root:null,threshold:.5});return Object.values((null==o?void 0:o.current)||{}).forEach((r=>{r&&e.observe(r)})),()=>{e.disconnect()}}),[o,s]),r("div",{className:D.container,children:r(c,{children:Object.keys(d).map((a=>{const i=t.find((({id:e})=>e===Number(a)))||{},{name:s}=((e,r)=>{var a,t;return(null===(t=null===(a=null==e?void 0:e.translations)||void 0===a?void 0:a.find)||void 0===t?void 0:t.call(a,(e=>e.language===r)))||{}})(i,l);return e("div",{className:D.products,ref:e=>o.current[i.id]=e,"data-category-id":a,children:[r("h2",{className:D.category,children:s}),r("div",{className:D.list,children:r(c,{gap:2,children:d[a].map((e=>r(S,{product:e,currency:n,language:l},e.id)))})})]},a)}))})})};var J="Branches-module_branches__sOuoV",K="Branches-module_list__vYoT2",Q="Branches-module_name__K0Z-4";const U=({branches:e=[]})=>r("div",{className:J,children:r(_,{className:K,children:e.map((({id:e,name:a})=>r("a",{href:"/",children:r(g,{noBottomMargin:!0,children:r(v,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:r("h2",{className:Q,children:a})})})},e)))})}),$=({data:i})=>{var c;const{name:l,coverImage:o,logoImage:s,branches:d=[],branchId:m,language:u,categories:h,products:_,currency:g,defaultCover:v="",defaultLogo:f=""}=i||{},p=d.length<=1,I=d.find((e=>e.id===Number(m))),N=p||!(null==I?void 0:I.name)?l:(null==I?void 0:I.name)||"",b=o||v,y=s||f,[P,L]=n(null===(c=null==h?void 0:h[0])||void 0===c?void 0:c.id),C=t({});return e("div",{className:w,children:[r(W,{branch:I,name:N,coverImage:b,logoImage:y}),p||m?e(a,{children:[r(Y,{categories:h,language:u,selectedCategoryId:P,onSelectCategory:e=>{L(e),(e=>{var r;const a=null===(r=null==C?void 0:C.current)||void 0===r?void 0:r[e];a&&a.scrollIntoView({behavior:"smooth",block:"start"})})(e)}}),r(Z,{categories:h,products:_,currency:g,language:u,productBlocksRef:C,onCategoryInView:e=>{e!==P&&L(e)}})]}):r(U,{branches:d})]})};export{$ as PublicMenu};
2
2
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/components/PublicMenu/Header/Header.tsx","../src/components/PublicMenu/Categories.tsx","../src/components/PublicMenu/PublicMenu.constants.ts","../src/components/PublicMenu/ProductsListItem/ProductsListItem.tsx","../src/components/PublicMenu/Products/Products.tsx","../src/utils/category.ts","../src/components/PublicMenu/Branches/Branches.tsx","../src/components/PublicMenu/PublicMenu.tsx"],"sourcesContent":["import { Column, IconLink, Row, SVGIcon } from \"@sorocraft/ui\";\nimport {\n\tMarkerPin,\n\tPhone,\n\tWifi,\n\tInstagram,\n\tWhatsapp,\n\tTiktok,\n\tFacebook,\n\tTelegram,\n} from \"@sorocraft/ui/icons\";\nimport { isEmpty } from \"@sorocraft/js-utils\";\n\nimport styles from \"./Header.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\n\ninterface Props {\n\tbranch?: branchModels.Branch;\n\tcoverImage?: string;\n\tlogoImage?: string;\n\tdefaultCover?: string;\n\tdefaultLogo?: string;\n\tname: string;\n}\n\nconst Header = ({\n\tbranch,\n\tcoverImage,\n\tlogoImage,\n\tname,\n\tdefaultCover = \"\",\n\tdefaultLogo = \"\",\n}: Props) => {\n\tconst { address, latitude, longitude } = branch || {};\n\tconst noBranch = isEmpty(branch);\n\n\tconst coverImageSource = coverImage || defaultCover;\n\tconst logoImageSource = logoImage || defaultLogo;\n\n\tconst googleMapLink = `https://www.google.com/maps/place/${latitude},${longitude}`;\n\n\tconst BranchInfo = () => (\n\t\t<Row gap={1}>\n\t\t\t<img src={logoImageSource} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\n\t\t\t\t<a\n\t\t\t\t\tclassName={styles.address}\n\t\t\t\t\thref={googleMapLink}\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t>\n\t\t\t\t\t<Row alignItems=\"center\" gap={0.5}>\n\t\t\t\t\t\t<SVGIcon icon={MarkerPin} theme=\"dark\" />\n\t\t\t\t\t\t<span>{address}</span>\n\t\t\t\t\t</Row>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</Row>\n\t);\n\n\tconst BusinessInfo = () => (\n\t\t<Column fullWidth fullHeight alignItems=\"center\" justifyContent=\"center\">\n\t\t\t<img src={logoImageSource} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\t\t\t</div>\n\t\t</Column>\n\t);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<img src={coverImageSource} alt={name} className={styles.cover} />\n\t\t\t<div className={styles.content}>\n\t\t\t\t{noBranch ? <BusinessInfo /> : <BranchInfo />}\n\t\t\t\t{!noBranch && (\n\t\t\t\t\t<div className={styles.labels}>\n\t\t\t\t\t\t<Column alignItems=\"center\" justifyContent=\"center\" gap={0.75} fullHeight>\n\t\t\t\t\t\t\t<IconLink icon={Wifi} href=\"/\" size=\"sm\" shape=\"circle\" />\n\t\t\t\t\t\t</Column>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{!noBranch && (\n\t\t\t\t<div className={styles.social}>\n\t\t\t\t\t<div className={styles.links}>\n\t\t\t\t\t\t<Row alignItems=\"center\" justifyContent=\"center\" gap={0.5}>\n\t\t\t\t\t\t\t<IconLink icon={Phone} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Whatsapp} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Instagram} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Telegram} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Tiktok} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Facebook} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t</Row>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default Header;\n","import { Carousel, CarouselItem, Chip, DivElementMap, UIElementType } from \"@sorocraft/ui\";\nimport { useRef } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as categoryModels from \"src/models/category\";\n\ninterface Props {\n\tcategories: categoryModels.Category[];\n\tlanguage: string;\n\tselectedCategoryId: number;\n\tonSelectCategory: (id: number) => void;\n}\n\nconst Categories = ({ categories, language, selectedCategoryId, onSelectCategory }: Props) => {\n\tconst categoryBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToCategoryBlock = (categoryId: number) => {\n\t\tconst categoryBlock = categoryBlocksRef?.current?.[categoryId];\n\t\tif (!categoryBlock) return;\n\n\t\tcategoryBlock.scrollIntoView({ behavior: \"smooth\", inline: \"center\" });\n\t};\n\n\tconst handleSelectCategory = (id: number) => {\n\t\tscrollToCategoryBlock(id);\n\t\tonSelectCategory(id);\n\t};\n\n\treturn (\n\t\t<div className={styles.categories}>\n\t\t\t<Carousel gap={1}>\n\t\t\t\t{categories.map(({ id, translations }) => {\n\t\t\t\t\tconst { name } = translations.find((item) => item.language === language) || {};\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CarouselItem key={id}>\n\t\t\t\t\t\t\t<Chip\n\t\t\t\t\t\t\t\tonClick={() => handleSelectCategory(id)}\n\t\t\t\t\t\t\t\ttype={UIElementType.BORDERED_PRIMARY}\n\t\t\t\t\t\t\t\tactive={id === selectedCategoryId}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div ref={(el) => (categoryBlocksRef.current[id] = el)}>{name}</div>\n\t\t\t\t\t\t\t</Chip>\n\t\t\t\t\t\t</CarouselItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Carousel>\n\t\t</div>\n\t);\n};\nexport default Categories;\n","export const DEFAULT_CURRENCY = \"AZN\";\n","import { Column, Row } from \"@sorocraft/ui\";\nimport { priceFormatter } from \"@sorocraft/js-utils\";\n\nimport styles from \"./ProductsListItem.module.scss\";\n\nimport * as productModels from \"src/models/product\";\n\nimport { DEFAULT_CURRENCY } from \"../PublicMenu.constants\";\n\ninterface Props {\n\tproduct: productModels.Product;\n\tcurrency: string;\n\tlanguage: string;\n}\n\nconst ProductsListItem = ({ product, currency, language }: Props) => {\n\tconst { translations, price, imageUrl } = product || {};\n\tconst { name, description } = translations.find((item) => item.language === language) || {};\n\tconst formattedPrice = priceFormatter(price, currency || DEFAULT_CURRENCY, language);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Row justifyContent=\"space-between\">\n\t\t\t\t<div className={styles.data}>\n\t\t\t\t\t<Column gap={0.5}>\n\t\t\t\t\t\t<h3 className={styles.name}>{name}</h3>\n\t\t\t\t\t\t<div className={styles.description}>{description}</div>\n\t\t\t\t\t\t<div className={styles.price}>{formattedPrice}</div>\n\t\t\t\t\t</Column>\n\t\t\t\t</div>\n\t\t\t\t{imageUrl && <img src={imageUrl} alt={name} className={styles.image} />}\n\t\t\t</Row>\n\t\t</div>\n\t);\n};\nexport default ProductsListItem;\n","import { RefObject, useEffect } from \"react\";\nimport { Column, DivElementMap } from \"@sorocraft/ui\";\nimport { groupBy } from \"@sorocraft/js-utils\";\n\nimport styles from \"./Products.module.scss\";\n\nimport * as productModels from \"src/models/product\";\nimport * as categoryModels from \"src/models/category\";\nimport * as categoryUtils from \"src/utils/category\";\n\nimport ProductsListItem from \"../ProductsListItem\";\n\ninterface Props {\n\tproducts: productModels.Product[];\n\tcategories: categoryModels.Category[];\n\tproductBlocksRef: RefObject<DivElementMap>;\n\tcurrency: string;\n\tlanguage: string;\n\tonCategoryInView: (categoryId: number) => void;\n}\n\nconst Products = ({\n\tproducts,\n\tcategories,\n\tcurrency,\n\tlanguage,\n\tproductBlocksRef,\n\tonCategoryInView,\n}: Props) => {\n\t// const [layout, setLayout] = useState<\"list\" | \"grid\">(\"list\");\n\n\tconst groupedProducts = groupBy(products, \"categoryId\");\n\n\tuseEffect(() => {\n\t\tconst observer = new IntersectionObserver(\n\t\t\t(entries) => {\n\t\t\t\tentries.forEach((entry) => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tconst categoryId = Number(entry.target.getAttribute(\"data-category-id\"));\n\t\t\t\t\t\tonCategoryInView(categoryId); // Notify the parent when a category is in view\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\t{\n\t\t\t\troot: null, // Use the viewport as the container\n\t\t\t\tthreshold: 0.5, // Trigger when 50% of the product block is in view\n\t\t\t}\n\t\t);\n\n\t\tObject.values(productBlocksRef?.current || {}).forEach((block) => {\n\t\t\tif (block) {\n\t\t\t\tobserver.observe(block);\n\t\t\t}\n\t\t});\n\n\t\treturn () => {\n\t\t\tobserver.disconnect(); // Clean up the observer on component unmount\n\t\t};\n\t}, [productBlocksRef, onCategoryInView]);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t{/* <div className={styles.header}>\n\t\t\t\t<Row>\n\t\t\t\t\t<IconButton icon={List} onClick={() => setLayout(\"list\")} isActive={layout === \"list\"} />\n\t\t\t\t\t<IconButton icon={Grid} onClick={() => setLayout(\"grid\")} isActive={layout === \"grid\"} />\n\t\t\t\t</Row>\n\t\t\t</div> */}\n\t\t\t<Column>\n\t\t\t\t{Object.keys(groupedProducts).map((categoryId) => {\n\t\t\t\t\tconst category = (categories.find(({ id }) => id === Number(categoryId)) ||\n\t\t\t\t\t\t{}) as categoryModels.Category;\n\t\t\t\t\tconst { name } = categoryUtils.getCategoryTranslation(category, language);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={styles.products}\n\t\t\t\t\t\t\tkey={categoryId}\n\t\t\t\t\t\t\tref={(el) => (productBlocksRef!.current![category.id] = el)}\n\t\t\t\t\t\t\tdata-category-id={categoryId}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<h2 className={styles.category}>{name}</h2>\n\t\t\t\t\t\t\t<div className={styles.list}>\n\t\t\t\t\t\t\t\t<Column gap={2}>\n\t\t\t\t\t\t\t\t\t{groupedProducts[categoryId].map((product) => (\n\t\t\t\t\t\t\t\t\t\t<ProductsListItem\n\t\t\t\t\t\t\t\t\t\t\tproduct={product}\n\t\t\t\t\t\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\t\t\t\t\t\tkey={product.id}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</Column>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Column>\n\t\t</div>\n\t);\n};\nexport default Products;\n","import { Category, CategoryTranslation } from \"src/models/category\";\n\nexport const getCategoryTranslation = (\n\tcategory: Category,\n\tlanguage: string\n): CategoryTranslation => {\n\treturn (category?.translations?.find?.((item) => item.language === language) ||\n\t\t{}) as CategoryTranslation;\n};\n","import { Card, Container, Flex } from \"@sorocraft/ui\";\n\nimport styles from \"./Branches.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\n\ninterface Props {\n\tbranches: branchModels.Branch[];\n}\n\nconst Branches = ({ branches = [] }: Props) => {\n\treturn (\n\t\t<div className={styles.branches}>\n\t\t\t<Container className={styles.list}>\n\t\t\t\t{branches.map(({ id, name }) => (\n\t\t\t\t\t<a key={id} href=\"/\">\n\t\t\t\t\t\t<Card noBottomMargin>\n\t\t\t\t\t\t\t<Flex justifyContent=\"center\" alignItems=\"center\" fullHeight>\n\t\t\t\t\t\t\t\t<h2 className={styles.name}>{name}</h2>\n\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t</a>\n\t\t\t\t))}\n\t\t\t</Container>\n\t\t</div>\n\t);\n};\nexport default Branches;\n","import { DivElementMap } from \"@sorocraft/ui\";\nimport { useRef, useState } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as menuModels from \"src/models/menu\";\n\nimport Header from \"./Header\";\nimport Categories from \"./Categories\";\nimport Products from \"./Products\";\nimport Branches from \"./Branches\";\n\ninterface Props {\n\tdata: menuModels.PublicMenuData;\n}\n\nconst PublicMenu = ({ data }: Props) => {\n\tconst {\n\t\tname,\n\t\tcoverImage,\n\t\tlogoImage,\n\t\tbranches = [],\n\t\tbranchId,\n\t\tlanguage,\n\t\tcategories,\n\t\tproducts,\n\t\tcurrency,\n\t} = data || {};\n\n\tconst hasSingleBranch = branches.length <= 1;\n\tconst selectedBranch = branches.find((item) => item.id === Number(branchId));\n\tconst venueName = hasSingleBranch || !selectedBranch?.name ? name : selectedBranch?.name || \"\";\n\n\tconst [selectedCategoryId, setSelectedCategoryId] = useState<number>(categories?.[0]?.id);\n\tconst productBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToProductBlock = (categoryId: number) => {\n\t\tconst productBlock = productBlocksRef?.current?.[categoryId];\n\t\tif (!productBlock) return;\n\n\t\tproductBlock.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n\t};\n\n\tconst handleSelectCategory = (categoryId: number) => {\n\t\tsetSelectedCategoryId(categoryId);\n\n\t\tscrollToProductBlock(categoryId);\n\t};\n\n\tconst handleCategoryInView = (categoryId: number) => {\n\t\tif (categoryId !== selectedCategoryId) {\n\t\t\tsetSelectedCategoryId(categoryId);\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Header\n\t\t\t\tbranch={selectedBranch}\n\t\t\t\tname={venueName}\n\t\t\t\tcoverImage={coverImage}\n\t\t\t\tlogoImage={logoImage}\n\t\t\t/>\n\t\t\t{!hasSingleBranch && !branchId ? (\n\t\t\t\t<Branches branches={branches} />\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<Categories\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tselectedCategoryId={selectedCategoryId}\n\t\t\t\t\t\tonSelectCategory={handleSelectCategory}\n\t\t\t\t\t/>\n\t\t\t\t\t<Products\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tproducts={products}\n\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tproductBlocksRef={productBlocksRef}\n\t\t\t\t\t\tonCategoryInView={handleCategoryInView}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default PublicMenu;\n"],"names":["Header","branch","coverImage","logoImage","name","defaultCover","defaultLogo","address","latitude","longitude","noBranch","isEmpty","logoImageSource","googleMapLink","_jsxs","className","styles","children","_jsx","src","alt","Column","fullWidth","fullHeight","alignItems","justifyContent","Row","gap","href","target","rel","SVGIcon","icon","MarkerPin","theme","IconLink","Wifi","size","shape","Phone","Whatsapp","Instagram","Telegram","Tiktok","Facebook","Categories","categories","language","selectedCategoryId","onSelectCategory","categoryBlocksRef","useRef","handleSelectCategory","id","categoryId","categoryBlock","_a","current","scrollIntoView","behavior","inline","scrollToCategoryBlock","Carousel","map","translations","find","item","CarouselItem","Chip","onClick","type","UIElementType","BORDERED_PRIMARY","active","ref","el","ProductsListItem","product","currency","price","imageUrl","description","formattedPrice","priceFormatter","container","data","image","Products","products","productBlocksRef","onCategoryInView","groupedProducts","groupBy","useEffect","observer","IntersectionObserver","entries","forEach","entry","isIntersecting","Number","getAttribute","root","threshold","Object","values","block","observe","disconnect","keys","category","_b","call","categoryUtils.getCategoryTranslation","list","Branches","branches","Container","Card","noBottomMargin","Flex","PublicMenu","branchId","hasSingleBranch","length","selectedBranch","venueName","setSelectedCategoryId","useState","_Fragment","productBlock","scrollToProductBlock"],"mappings":"g5BA0BA,MAAMA,EAAS,EACdC,SACAC,aACAC,YACAC,OACAC,eAAe,GACfC,cAAc,OAEd,MAAMC,QAAEA,EAAOC,SAAEA,EAAQC,UAAEA,GAAcR,GAAU,CAAA,EAC7CS,EAAWC,EAAQV,GAGnBW,EAAkBT,GAAaG,EAE/BO,EAAgB,qCAAqCL,KAAYC,IAgCvE,OACCK,EAAA,MAAA,CAAKC,UAAWC,EAAgBC,SAAA,CAC/BC,EAAK,MAAA,CAAAC,IArCkBjB,GAAcG,EAqCTe,IAAKhB,EAAMW,UAAWC,IAClDF,EAAK,MAAA,CAAAC,UAAWC,YACHE,EAAXR,EAbiB,IACpBI,EAACO,EAAM,CAACC,WAAS,EAACC,YAAU,EAACC,WAAW,SAASC,eAAe,SAC/DR,SAAA,CAAAC,EAAA,MAAA,CAAKC,IAAKP,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AI,IAAAU,OAAA,EAAAA,EAAAH,IAChFoC,EAAmBtC,EAAsB,CAAA,GAqB/C,OACCrC,SAAKC,UAAWC,EACfC,SAAA,CAAAC,EAAClB,EAAM,CACNC,OAAQ4H,EACRzH,KAAM0H,EACN5H,WAAYA,EACZC,UAAWA,IAEVwH,GAAoBD,EAGrB5G,EAAAmH,EAAA,CAAAhH,SAAA,CACCC,EAAC2B,EAAU,CACVC,WAAYA,EACZC,SAAUA,EACVC,mBAAoBA,EACpBC,iBA5ByBK,IAC7ByE,EAAsBzE,GARM,CAACA,UAC7B,MAAM4E,EAA2C,QAA5B1E,EAAAiC,aAAA,EAAAA,EAAkBhC,eAAU,IAAAD,OAAA,EAAAA,EAAAF,GAC5C4E,GAELA,EAAaxE,eAAe,CAAEC,SAAU,SAAU+C,MAAO,SAAU,EAMnEyB,CAAqB7E,EAAW,IA2B7BpC,EAACqE,EACA,CAAAzC,WAAYA,EACZ0C,SAAUA,EACVV,SAAUA,EACV/B,SAAUA,EACV0C,iBAAkBA,EAClBC,iBA9ByBpC,IACzBA,IAAeN,GAClB+E,EAAsBzE,EACtB,OAYCpC,EAACiG,EAAQ,CAACC,SAAUA,MAoBrB"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/components/PublicMenu/Header/Header.tsx","../src/components/PublicMenu/Categories.tsx","../src/components/PublicMenu/PublicMenu.constants.ts","../src/components/PublicMenu/ProductsListItem/ProductsListItem.tsx","../src/components/PublicMenu/Products/Products.tsx","../src/utils/category.ts","../src/components/PublicMenu/Branches/Branches.tsx","../src/components/PublicMenu/PublicMenu.tsx"],"sourcesContent":["import { Column, IconLink, Row, SVGIcon } from \"@sorocraft/ui\";\nimport {\n\tMarkerPin,\n\tPhone,\n\tWifi,\n\tInstagram,\n\tWhatsapp,\n\tTiktok,\n\tFacebook,\n\tTelegram,\n} from \"@sorocraft/ui/icons\";\nimport { isEmpty } from \"@sorocraft/js-utils\";\n\nimport styles from \"./Header.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\n\ninterface Props {\n\tbranch?: branchModels.Branch;\n\tcoverImage?: string;\n\tlogoImage?: string;\n\tname: string;\n}\n\nconst Header = ({ branch, coverImage, logoImage, name }: Props) => {\n\tconst { address, latitude, longitude } = branch || {};\n\tconst noBranch = isEmpty(branch);\n\n\tconst googleMapLink = `https://www.google.com/maps/place/${latitude},${longitude}`;\n\n\tconst BranchInfo = () => (\n\t\t<Row gap={1}>\n\t\t\t<img src={logoImage} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\n\t\t\t\t<a\n\t\t\t\t\tclassName={styles.address}\n\t\t\t\t\thref={googleMapLink}\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t>\n\t\t\t\t\t<Row alignItems=\"center\" gap={0.5}>\n\t\t\t\t\t\t<SVGIcon icon={MarkerPin} theme=\"dark\" />\n\t\t\t\t\t\t<span>{address}</span>\n\t\t\t\t\t</Row>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</Row>\n\t);\n\n\tconst BusinessInfo = () => (\n\t\t<Column fullWidth fullHeight alignItems=\"center\" justifyContent=\"center\">\n\t\t\t<img src={logoImage} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\t\t\t</div>\n\t\t</Column>\n\t);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<img src={coverImage} alt={name} className={styles.cover} />\n\t\t\t<div className={styles.content}>\n\t\t\t\t{noBranch ? <BusinessInfo /> : <BranchInfo />}\n\t\t\t\t{!noBranch && (\n\t\t\t\t\t<div className={styles.labels}>\n\t\t\t\t\t\t<Column alignItems=\"center\" justifyContent=\"center\" gap={0.75} fullHeight>\n\t\t\t\t\t\t\t<IconLink icon={Wifi} href=\"/\" size=\"sm\" shape=\"circle\" />\n\t\t\t\t\t\t</Column>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{!noBranch && (\n\t\t\t\t<div className={styles.social}>\n\t\t\t\t\t<div className={styles.links}>\n\t\t\t\t\t\t<Row alignItems=\"center\" justifyContent=\"center\" gap={0.5}>\n\t\t\t\t\t\t\t<IconLink icon={Phone} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Whatsapp} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Instagram} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Telegram} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Tiktok} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Facebook} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t</Row>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default Header;\n","import { Carousel, CarouselItem, Chip, DivElementMap, UIElementType } from \"@sorocraft/ui\";\nimport { useRef } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as categoryModels from \"src/models/category\";\n\ninterface Props {\n\tcategories: categoryModels.Category[];\n\tlanguage: string;\n\tselectedCategoryId: number;\n\tonSelectCategory: (id: number) => void;\n}\n\nconst Categories = ({ categories, language, selectedCategoryId, onSelectCategory }: Props) => {\n\tconst categoryBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToCategoryBlock = (categoryId: number) => {\n\t\tconst categoryBlock = categoryBlocksRef?.current?.[categoryId];\n\t\tif (!categoryBlock) return;\n\n\t\tcategoryBlock.scrollIntoView({ behavior: \"smooth\", inline: \"center\" });\n\t};\n\n\tconst handleSelectCategory = (id: number) => {\n\t\tscrollToCategoryBlock(id);\n\t\tonSelectCategory(id);\n\t};\n\n\treturn (\n\t\t<div className={styles.categories}>\n\t\t\t<Carousel gap={1}>\n\t\t\t\t{categories.map(({ id, translations }) => {\n\t\t\t\t\tconst { name } = translations.find((item) => item.language === language) || {};\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CarouselItem key={id}>\n\t\t\t\t\t\t\t<Chip\n\t\t\t\t\t\t\t\tonClick={() => handleSelectCategory(id)}\n\t\t\t\t\t\t\t\ttype={UIElementType.BORDERED_PRIMARY}\n\t\t\t\t\t\t\t\tactive={id === selectedCategoryId}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div ref={(el) => (categoryBlocksRef.current[id] = el)}>{name}</div>\n\t\t\t\t\t\t\t</Chip>\n\t\t\t\t\t\t</CarouselItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Carousel>\n\t\t</div>\n\t);\n};\nexport default Categories;\n","export const DEFAULT_CURRENCY = \"AZN\";\n","import { Column, Row } from \"@sorocraft/ui\";\nimport { priceFormatter } from \"@sorocraft/js-utils\";\n\nimport styles from \"./ProductsListItem.module.scss\";\n\nimport * as productModels from \"src/models/product\";\n\nimport { DEFAULT_CURRENCY } from \"../PublicMenu.constants\";\n\ninterface Props {\n\tproduct: productModels.Product;\n\tcurrency: string;\n\tlanguage: string;\n}\n\nconst ProductsListItem = ({ product, currency, language }: Props) => {\n\tconst { translations, price, imageUrl } = product || {};\n\tconst { name, description } = translations.find((item) => item.language === language) || {};\n\tconst formattedPrice = priceFormatter(price, currency || DEFAULT_CURRENCY, language);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Row justifyContent=\"space-between\">\n\t\t\t\t<div className={styles.data}>\n\t\t\t\t\t<Column gap={0.5}>\n\t\t\t\t\t\t<h3 className={styles.name}>{name}</h3>\n\t\t\t\t\t\t<div className={styles.description}>{description}</div>\n\t\t\t\t\t\t<div className={styles.price}>{formattedPrice}</div>\n\t\t\t\t\t</Column>\n\t\t\t\t</div>\n\t\t\t\t{imageUrl && <img src={imageUrl} alt={name} className={styles.image} />}\n\t\t\t</Row>\n\t\t</div>\n\t);\n};\nexport default ProductsListItem;\n","import { RefObject, useEffect } from \"react\";\nimport { Column, DivElementMap } from \"@sorocraft/ui\";\nimport { groupBy } from \"@sorocraft/js-utils\";\n\nimport styles from \"./Products.module.scss\";\n\nimport * as productModels from \"src/models/product\";\nimport * as categoryModels from \"src/models/category\";\nimport * as categoryUtils from \"src/utils/category\";\n\nimport ProductsListItem from \"../ProductsListItem\";\n\ninterface Props {\n\tproducts: productModels.Product[];\n\tcategories: categoryModels.Category[];\n\tproductBlocksRef: RefObject<DivElementMap>;\n\tcurrency: string;\n\tlanguage: string;\n\tonCategoryInView: (categoryId: number) => void;\n}\n\nconst Products = ({\n\tproducts,\n\tcategories,\n\tcurrency,\n\tlanguage,\n\tproductBlocksRef,\n\tonCategoryInView,\n}: Props) => {\n\t// const [layout, setLayout] = useState<\"list\" | \"grid\">(\"list\");\n\n\tconst groupedProducts = groupBy(products, \"categoryId\");\n\n\tuseEffect(() => {\n\t\tconst observer = new IntersectionObserver(\n\t\t\t(entries) => {\n\t\t\t\tentries.forEach((entry) => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tconst categoryId = Number(entry.target.getAttribute(\"data-category-id\"));\n\t\t\t\t\t\tonCategoryInView(categoryId); // Notify the parent when a category is in view\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\t{\n\t\t\t\troot: null, // Use the viewport as the container\n\t\t\t\tthreshold: 0.5, // Trigger when 50% of the product block is in view\n\t\t\t}\n\t\t);\n\n\t\tObject.values(productBlocksRef?.current || {}).forEach((block) => {\n\t\t\tif (block) {\n\t\t\t\tobserver.observe(block);\n\t\t\t}\n\t\t});\n\n\t\treturn () => {\n\t\t\tobserver.disconnect(); // Clean up the observer on component unmount\n\t\t};\n\t}, [productBlocksRef, onCategoryInView]);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t{/* <div className={styles.header}>\n\t\t\t\t<Row>\n\t\t\t\t\t<IconButton icon={List} onClick={() => setLayout(\"list\")} isActive={layout === \"list\"} />\n\t\t\t\t\t<IconButton icon={Grid} onClick={() => setLayout(\"grid\")} isActive={layout === \"grid\"} />\n\t\t\t\t</Row>\n\t\t\t</div> */}\n\t\t\t<Column>\n\t\t\t\t{Object.keys(groupedProducts).map((categoryId) => {\n\t\t\t\t\tconst category = (categories.find(({ id }) => id === Number(categoryId)) ||\n\t\t\t\t\t\t{}) as categoryModels.Category;\n\t\t\t\t\tconst { name } = categoryUtils.getCategoryTranslation(category, language);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={styles.products}\n\t\t\t\t\t\t\tkey={categoryId}\n\t\t\t\t\t\t\tref={(el) => (productBlocksRef!.current![category.id] = el)}\n\t\t\t\t\t\t\tdata-category-id={categoryId}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<h2 className={styles.category}>{name}</h2>\n\t\t\t\t\t\t\t<div className={styles.list}>\n\t\t\t\t\t\t\t\t<Column gap={2}>\n\t\t\t\t\t\t\t\t\t{groupedProducts[categoryId].map((product) => (\n\t\t\t\t\t\t\t\t\t\t<ProductsListItem\n\t\t\t\t\t\t\t\t\t\t\tproduct={product}\n\t\t\t\t\t\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\t\t\t\t\t\tkey={product.id}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</Column>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Column>\n\t\t</div>\n\t);\n};\nexport default Products;\n","import { Category, CategoryTranslation } from \"src/models/category\";\n\nexport const getCategoryTranslation = (\n\tcategory: Category,\n\tlanguage: string\n): CategoryTranslation => {\n\treturn (category?.translations?.find?.((item) => item.language === language) ||\n\t\t{}) as CategoryTranslation;\n};\n","import { Card, Container, Flex } from \"@sorocraft/ui\";\n\nimport styles from \"./Branches.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\n\ninterface Props {\n\tbranches: branchModels.Branch[];\n}\n\nconst Branches = ({ branches = [] }: Props) => {\n\treturn (\n\t\t<div className={styles.branches}>\n\t\t\t<Container className={styles.list}>\n\t\t\t\t{branches.map(({ id, name }) => (\n\t\t\t\t\t<a key={id} href=\"/\">\n\t\t\t\t\t\t<Card noBottomMargin>\n\t\t\t\t\t\t\t<Flex justifyContent=\"center\" alignItems=\"center\" fullHeight>\n\t\t\t\t\t\t\t\t<h2 className={styles.name}>{name}</h2>\n\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t</a>\n\t\t\t\t))}\n\t\t\t</Container>\n\t\t</div>\n\t);\n};\nexport default Branches;\n","import { DivElementMap } from \"@sorocraft/ui\";\nimport { useRef, useState } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as menuModels from \"src/models/menu\";\n\nimport Header from \"./Header\";\nimport Categories from \"./Categories\";\nimport Products from \"./Products\";\nimport Branches from \"./Branches\";\n\ninterface Props {\n\tdata: menuModels.PublicMenuData;\n}\n\nconst PublicMenu = ({ data }: Props) => {\n\tconst {\n\t\tname,\n\t\tcoverImage,\n\t\tlogoImage,\n\t\tbranches = [],\n\t\tbranchId,\n\t\tlanguage,\n\t\tcategories,\n\t\tproducts,\n\t\tcurrency,\n\t\tdefaultCover = \"\",\n\t\tdefaultLogo = \"\",\n\t} = data || {};\n\n\tconst hasSingleBranch = branches.length <= 1;\n\tconst selectedBranch = branches.find((item) => item.id === Number(branchId));\n\tconst venueName = hasSingleBranch || !selectedBranch?.name ? name : selectedBranch?.name || \"\";\n\n\tconst coverImageSource = coverImage || defaultCover;\n\tconst logoImageSource = logoImage || defaultLogo;\n\n\tconst [selectedCategoryId, setSelectedCategoryId] = useState<number>(categories?.[0]?.id);\n\tconst productBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToProductBlock = (categoryId: number) => {\n\t\tconst productBlock = productBlocksRef?.current?.[categoryId];\n\t\tif (!productBlock) return;\n\n\t\tproductBlock.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n\t};\n\n\tconst handleSelectCategory = (categoryId: number) => {\n\t\tsetSelectedCategoryId(categoryId);\n\n\t\tscrollToProductBlock(categoryId);\n\t};\n\n\tconst handleCategoryInView = (categoryId: number) => {\n\t\tif (categoryId !== selectedCategoryId) {\n\t\t\tsetSelectedCategoryId(categoryId);\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Header\n\t\t\t\tbranch={selectedBranch}\n\t\t\t\tname={venueName}\n\t\t\t\tcoverImage={coverImageSource}\n\t\t\t\tlogoImage={logoImageSource}\n\t\t\t/>\n\t\t\t{!hasSingleBranch && !branchId ? (\n\t\t\t\t<Branches branches={branches} />\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<Categories\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tselectedCategoryId={selectedCategoryId}\n\t\t\t\t\t\tonSelectCategory={handleSelectCategory}\n\t\t\t\t\t/>\n\t\t\t\t\t<Products\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tproducts={products}\n\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tproductBlocksRef={productBlocksRef}\n\t\t\t\t\t\tonCategoryInView={handleCategoryInView}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default PublicMenu;\n"],"names":["Header","branch","coverImage","logoImage","name","address","latitude","longitude","noBranch","isEmpty","googleMapLink","_jsxs","className","styles","children","_jsx","src","alt","Column","fullWidth","fullHeight","alignItems","justifyContent","Row","gap","href","target","rel","SVGIcon","icon","MarkerPin","theme","IconLink","Wifi","size","shape","Phone","Whatsapp","Instagram","Telegram","Tiktok","Facebook","Categories","categories","language","selectedCategoryId","onSelectCategory","categoryBlocksRef","useRef","handleSelectCategory","id","categoryId","categoryBlock","_a","current","scrollIntoView","behavior","inline","scrollToCategoryBlock","Carousel","map","translations","find","item","CarouselItem","Chip","onClick","type","UIElementType","BORDERED_PRIMARY","active","ref","el","ProductsListItem","product","currency","price","imageUrl","description","formattedPrice","priceFormatter","container","data","image","Products","products","productBlocksRef","onCategoryInView","groupedProducts","groupBy","useEffect","observer","IntersectionObserver","entries","forEach","entry","isIntersecting","Number","getAttribute","root","threshold","Object","values","block","observe","disconnect","keys","category","_b","call","categoryUtils.getCategoryTranslation","list","Branches","branches","Container","Card","noBottomMargin","Flex","PublicMenu","branchId","defaultCover","defaultLogo","hasSingleBranch","length","selectedBranch","venueName","coverImageSource","logoImageSource","setSelectedCategoryId","useState","_Fragment","productBlock","scrollToProductBlock"],"mappings":"g5BAwBA,MAAMA,EAAS,EAAGC,SAAQC,aAAYC,YAAWC,WAChD,MAAMC,QAAEA,EAAOC,SAAEA,EAAQC,UAAEA,GAAcN,GAAU,CAAA,EAC7CO,EAAWC,EAAQR,GAEnBS,EAAgB,qCAAqCJ,KAAYC,IAgCvE,OACCI,EAAA,MAAA,CAAKC,UAAWC,EAAgBC,SAAA,CAC/BC,EAAK,MAAA,CAAAC,IAAKd,EAAYe,IAAKb,EAAMQ,UAAWC,IAC5CF,EAAK,MAAA,CAAAC,UAAWC,YACHE,EAAXP,EAbiB,IACpBG,EAACO,EAAM,CAACC,WAAS,EAACC,YAAU,EAACC,WAAW,SAASC,eAAe,SAC/DR,SAAA,CAAAC,EAAA,MAAA,CAAKC,IAAKb,EAAWc,IAAKb,EAAMQ,UAAWC,IAC3CE,EAAK,MAAA,CAAAH,UAAWC,WACfE,EAAI,KAAA,CAAAH,UAAWC,EAAcC,SAAAV,SAzBb,IAClBO,EAACY,EAAI,CAAAC,IAAK,EAACV,SAAA,CACVC,S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C,EACfC,SAAA,CAAAC,EAACf,EAAM,CACNC,OAAQ2H,EACRxH,KAAMyH,EACN3H,WAAY4H,EACZ3H,UAAW4H,IAEVL,GAAoBH,EAGrB5G,EAAAuH,EAAA,CAAApH,SAAA,CACCC,EAAC2B,EAAU,CACVC,WAAYA,EACZC,SAAUA,EACVC,mBAAoBA,EACpBC,iBA5ByBK,IAC7B6E,EAAsB7E,GARM,CAACA,UAC7B,MAAMgF,EAA2C,QAA5B9E,EAAAiC,aAAA,EAAAA,EAAkBhC,eAAU,IAAAD,OAAA,EAAAA,EAAAF,GAC5CgF,GAELA,EAAa5E,eAAe,CAAEC,SAAU,SAAU+C,MAAO,SAAU,EAMnE6B,CAAqBjF,EAAW,IA2B7BpC,EAACqE,EACA,CAAAzC,WAAYA,EACZ0C,SAAUA,EACVV,SAAUA,EACV/B,SAAUA,EACV0C,iBAAkBA,EAClBC,iBA9ByBpC,IACzBA,IAAeN,GAClBmF,EAAsB7E,EACtB,OAYCpC,EAACiG,EAAQ,CAACC,SAAUA,MAoBrB"}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),s=require("react"),r=require("@sorocraft/ui"),n=require("@sorocraft/ui/icons"),i=require("@sorocraft/js-utils"),a="PublicMenu-module_container__QLN6U",t="PublicMenu-module_categories__Iy6NC",c="Header-module_container__tenlF",l="Header-module_cover__BAWZK",o="Header-module_content__Gx4Al",d="Header-module_logo__4MTCm",u="Header-module_info__IchYA",m="Header-module_name__30wyw",h="Header-module_address__WOxXc",g="Header-module_labels__gYyth",_="Header-module_social__AoP0z",j="Header-module_links__EeQxg";const x=({branch:s,coverImage:a,logoImage:t,name:x,defaultCover:v="",defaultLogo:f=""})=>{const{address:p,latitude:I,longitude:N}=s||{},y=i.isEmpty(s),b=a||v,C=t||f,L=`https://www.google.com/maps/place/${I},${N}`;return e.jsxs("div",{className:c,children:[e.jsx("img",{src:b,alt:x,className:l}),e.jsxs("div",{className:o,children:[y?e.jsx((()=>e.jsxs(r.Column,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[e.jsx("img",{src:C,alt:x,className:d}),e.jsx("div",{className:u,children:e.jsx("h1",{className:m,children:x})})]})),{}):e.jsx((()=>e.jsxs(r.Row,{gap:1,children:[e.jsx("img",{src:C,alt:x,className:d}),e.jsxs("div",{className:u,children:[e.jsx("h1",{className:m,children:x}),e.jsx("a",{className:h,href:L,target:"_blank",rel:"noopener noreferrer",children:e.jsxs(r.Row,{alignItems:"center",gap:.5,children:[e.jsx(r.SVGIcon,{icon:n.MarkerPin,theme:"dark"}),e.jsx("span",{children:p})]})})]})]})),{}),!y&&e.jsx("div",{className:g,children:e.jsx(r.Column,{alignItems:"center",justifyContent:"center",gap:.75,fullHeight:!0,children:e.jsx(r.IconLink,{icon:n.Wifi,href:"/",size:"sm",shape:"circle"})})})]}),!y&&e.jsx("div",{className:_,children:e.jsx("div",{className:j,children:e.jsxs(r.Row,{alignItems:"center",justifyContent:"center",gap:.5,children:[e.jsx(r.IconLink,{icon:n.Phone,href:"/",size:"sm",shape:"circle",theme:"light"}),e.jsx(r.IconLink,{icon:n.Whatsapp,href:"/",size:"sm",shape:"circle",theme:"light"}),e.jsx(r.IconLink,{icon:n.Instagram,href:"/",size:"sm",shape:"circle",theme:"light"}),e.jsx(r.IconLink,{icon:n.Telegram,href:"/",size:"sm",shape:"circle",theme:"light"}),e.jsx(r.IconLink,{icon:n.Tiktok,href:"/",size:"sm",shape:"circle",theme:"light"}),e.jsx(r.IconLink,{icon:n.Facebook,href:"/",size:"sm",shape:"circle",theme:"light"})]})})})]})},v=({categories:n,language:i,selectedCategoryId:a,onSelectCategory:c})=>{const l=s.useRef({}),o=e=>{(e=>{var s;const r=null===(s=null==l?void 0:l.current)||void 0===s?void 0:s[e];r&&r.scrollIntoView({behavior:"smooth",inline:"center"})})(e),c(e)};return e.jsx("div",{className:t,children:e.jsx(r.Carousel,{gap:1,children:n.map((({id:s,translations:n})=>{const{name:t}=n.find((e=>e.language===i))||{};return e.jsx(r.CarouselItem,{children:e.jsx(r.Chip,{onClick:()=>o(s),type:r.UIElementType.BORDERED_PRIMARY,active:s===a,children:e.jsx("div",{ref:e=>l.current[s]=e,children:t})})},s)}))})})};var f={container:"Products-module_container__bF2LF",header:"Products-module_header__0EFvL",products:"Products-module_products__AoDrY",list:"Products-module_list__LH4v5"};var p={container:"ProductsListItem-module_container__i9tFs",data:"ProductsListItem-module_data__Mb3SF",name:"ProductsListItem-module_name__T1gyJ",description:"ProductsListItem-module_description__oL4CH",image:"ProductsListItem-module_image__h6Wbi",flexWide:"ProductsListItem-module_flexWide__Ds6LE",slidein:"ProductsListItem-module_slidein__rEzMI",fadeInOut:"ProductsListItem-module_fadeInOut__i1FNq",heightAnimation:"ProductsListItem-module_heightAnimation__2fk7l",fadein:"ProductsListItem-module_fadein__tPTJ6",floatAnimation:"ProductsListItem-module_floatAnimation__vugAV"};const I=({product:s,currency:n,language:a})=>{const{translations:t,price:c,imageUrl:l}=s||{},{name:o,description:d}=t.find((e=>e.language===a))||{},u=i.priceFormatter(c,n||"AZN",a);return e.jsx("div",{className:p.container,children:e.jsxs(r.Row,{justifyContent:"space-between",children:[e.jsx("div",{className:p.data,children:e.jsxs(r.Column,{gap:.5,children:[e.jsx("h3",{className:p.name,children:o}),e.jsx("div",{className:p.description,children:d}),e.jsx("div",{className:p.price,children:u})]})}),l&&e.jsx("img",{src:l,alt:o,className:p.image})]})})},N=({products:n,categories:a,currency:t,language:c,productBlocksRef:l,onCategoryInView:o})=>{const d=i.groupBy(n,"categoryId");return s.useEffect((()=>{const e=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const s=Number(e.target.getAttribute("data-category-id"));o(s)}}))}),{root:null,threshold:.5});return Object.values((null==l?void 0:l.current)||{}).forEach((s=>{s&&e.observe(s)})),()=>{e.disconnect()}}),[l,o]),e.jsx("div",{className:f.container,children:e.jsx(r.Column,{children:Object.keys(d).map((s=>{const n=a.find((({id:e})=>e===Number(s)))||{},{name:i}=((e,s)=>{var r,n;return(null===(n=null===(r=null==e?void 0:e.translations)||void 0===r?void 0:r.find)||void 0===n?void 0:n.call(r,(e=>e.language===s)))||{}})(n,c);return e.jsxs("div",{className:f.products,ref:e=>l.current[n.id]=e,"data-category-id":s,children:[e.jsx("h2",{className:f.category,children:i}),e.jsx("div",{className:f.list,children:e.jsx(r.Column,{gap:2,children:d[s].map((s=>e.jsx(I,{product:s,currency:t,language:c},s.id)))})})]},s)}))})})};var y="Branches-module_branches__sOuoV",b="Branches-module_list__vYoT2",C="Branches-module_name__K0Z-4";const L=({branches:s=[]})=>e.jsx("div",{className:y,children:e.jsx(r.Container,{className:b,children:s.map((({id:s,name:n})=>e.jsx("a",{href:"/",children:e.jsx(r.Card,{noBottomMargin:!0,children:e.jsx(r.Flex,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:e.jsx("h2",{className:C,children:n})})})},s)))})});exports.PublicMenu=({data:r})=>{var n;const{name:i,coverImage:t,logoImage:c,branches:l=[],branchId:o,language:d,categories:u,products:m,currency:h}=r||{},g=l.length<=1,_=l.find((e=>e.id===Number(o))),j=g||!(null==_?void 0:_.name)?i:(null==_?void 0:_.name)||"",[f,p]=s.useState(null===(n=null==u?void 0:u[0])||void 0===n?void 0:n.id),I=s.useRef({});return e.jsxs("div",{className:a,children:[e.jsx(x,{branch:_,name:j,coverImage:t,logoImage:c}),g||o?e.jsxs(e.Fragment,{children:[e.jsx(v,{categories:u,language:d,selectedCategoryId:f,onSelectCategory:e=>{p(e),(e=>{var s;const r=null===(s=null==I?void 0:I.current)||void 0===s?void 0:s[e];r&&r.scrollIntoView({behavior:"smooth",block:"start"})})(e)}}),e.jsx(N,{categories:u,products:m,currency:h,language:d,productBlocksRef:I,onCategoryInView:e=>{e!==f&&p(e)}})]}):e.jsx(L,{branches:l})]})};
1
+ "use strict";var e=require("react/jsx-runtime"),s=require("react"),r=require("@sorocraft/ui"),n=require("@sorocraft/ui/icons"),i=require("@sorocraft/js-utils"),a="PublicMenu-module_container__QLN6U",t="PublicMenu-module_categories__Iy6NC",c="Header-module_container__tenlF",l="Header-module_cover__BAWZK",o="Header-module_content__Gx4Al",d="Header-module_logo__4MTCm",u="Header-module_info__IchYA",m="Header-module_name__30wyw",h="Header-module_address__WOxXc",g="Header-module_labels__gYyth",_="Header-module_social__AoP0z",j="Header-module_links__EeQxg";const x=({branch:s,coverImage:a,logoImage:t,name:x})=>{const{address:v,latitude:f,longitude:p}=s||{},I=i.isEmpty(s),N=`https://www.google.com/maps/place/${f},${p}`;return e.jsxs("div",{className:c,children:[e.jsx("img",{src:a,alt:x,className:l}),e.jsxs("div",{className:o,children:[I?e.jsx((()=>e.jsxs(r.Column,{fullWidth:!0,fullHeight:!0,alignItems:"center",justifyContent:"center",children:[e.jsx("img",{src:t,alt:x,className:d}),e.jsx("div",{className:u,children:e.jsx("h1",{className:m,children:x})})]})),{}):e.jsx((()=>e.jsxs(r.Row,{gap:1,children:[e.jsx("img",{src:t,alt:x,className:d}),e.jsxs("div",{className:u,children:[e.jsx("h1",{className:m,children:x}),e.jsx("a",{className:h,href:N,target:"_blank",rel:"noopener noreferrer",children:e.jsxs(r.Row,{alignItems:"center",gap:.5,children:[e.jsx(r.SVGIcon,{icon:n.MarkerPin,theme:"dark"}),e.jsx("span",{children:v})]})})]})]})),{}),!I&&e.jsx("div",{className:g,children:e.jsx(r.Column,{alignItems:"center",justifyContent:"center",gap:.75,fullHeight:!0,children:e.jsx(r.IconLink,{icon:n.Wifi,href:"/",size:"sm",shape:"circle"})})})]}),!I&&e.jsx("div",{className:_,children:e.jsx("div",{className:j,children:e.jsxs(r.Row,{alignItems:"center",justifyContent:"center",gap:.5,children:[e.jsx(r.IconLink,{icon:n.Phone,href:"/",size:"sm",shape:"circle",theme:"light"}),e.jsx(r.IconLink,{icon:n.Whatsapp,href:"/",size:"sm",shape:"circle",theme:"light"}),e.jsx(r.IconLink,{icon:n.Instagram,href:"/",size:"sm",shape:"circle",theme:"light"}),e.jsx(r.IconLink,{icon:n.Telegram,href:"/",size:"sm",shape:"circle",theme:"light"}),e.jsx(r.IconLink,{icon:n.Tiktok,href:"/",size:"sm",shape:"circle",theme:"light"}),e.jsx(r.IconLink,{icon:n.Facebook,href:"/",size:"sm",shape:"circle",theme:"light"})]})})})]})},v=({categories:n,language:i,selectedCategoryId:a,onSelectCategory:c})=>{const l=s.useRef({}),o=e=>{(e=>{var s;const r=null===(s=null==l?void 0:l.current)||void 0===s?void 0:s[e];r&&r.scrollIntoView({behavior:"smooth",inline:"center"})})(e),c(e)};return e.jsx("div",{className:t,children:e.jsx(r.Carousel,{gap:1,children:n.map((({id:s,translations:n})=>{const{name:t}=n.find((e=>e.language===i))||{};return e.jsx(r.CarouselItem,{children:e.jsx(r.Chip,{onClick:()=>o(s),type:r.UIElementType.BORDERED_PRIMARY,active:s===a,children:e.jsx("div",{ref:e=>l.current[s]=e,children:t})})},s)}))})})};var f={container:"Products-module_container__bF2LF",header:"Products-module_header__0EFvL",products:"Products-module_products__AoDrY",list:"Products-module_list__LH4v5"};var p={container:"ProductsListItem-module_container__i9tFs",data:"ProductsListItem-module_data__Mb3SF",name:"ProductsListItem-module_name__T1gyJ",description:"ProductsListItem-module_description__oL4CH",image:"ProductsListItem-module_image__h6Wbi",flexWide:"ProductsListItem-module_flexWide__Ds6LE",slidein:"ProductsListItem-module_slidein__rEzMI",fadeInOut:"ProductsListItem-module_fadeInOut__i1FNq",heightAnimation:"ProductsListItem-module_heightAnimation__2fk7l",fadein:"ProductsListItem-module_fadein__tPTJ6",floatAnimation:"ProductsListItem-module_floatAnimation__vugAV"};const I=({product:s,currency:n,language:a})=>{const{translations:t,price:c,imageUrl:l}=s||{},{name:o,description:d}=t.find((e=>e.language===a))||{},u=i.priceFormatter(c,n||"AZN",a);return e.jsx("div",{className:p.container,children:e.jsxs(r.Row,{justifyContent:"space-between",children:[e.jsx("div",{className:p.data,children:e.jsxs(r.Column,{gap:.5,children:[e.jsx("h3",{className:p.name,children:o}),e.jsx("div",{className:p.description,children:d}),e.jsx("div",{className:p.price,children:u})]})}),l&&e.jsx("img",{src:l,alt:o,className:p.image})]})})},N=({products:n,categories:a,currency:t,language:c,productBlocksRef:l,onCategoryInView:o})=>{const d=i.groupBy(n,"categoryId");return s.useEffect((()=>{const e=new IntersectionObserver((e=>{e.forEach((e=>{if(e.isIntersecting){const s=Number(e.target.getAttribute("data-category-id"));o(s)}}))}),{root:null,threshold:.5});return Object.values((null==l?void 0:l.current)||{}).forEach((s=>{s&&e.observe(s)})),()=>{e.disconnect()}}),[l,o]),e.jsx("div",{className:f.container,children:e.jsx(r.Column,{children:Object.keys(d).map((s=>{const n=a.find((({id:e})=>e===Number(s)))||{},{name:i}=((e,s)=>{var r,n;return(null===(n=null===(r=null==e?void 0:e.translations)||void 0===r?void 0:r.find)||void 0===n?void 0:n.call(r,(e=>e.language===s)))||{}})(n,c);return e.jsxs("div",{className:f.products,ref:e=>l.current[n.id]=e,"data-category-id":s,children:[e.jsx("h2",{className:f.category,children:i}),e.jsx("div",{className:f.list,children:e.jsx(r.Column,{gap:2,children:d[s].map((s=>e.jsx(I,{product:s,currency:t,language:c},s.id)))})})]},s)}))})})};var y="Branches-module_branches__sOuoV",b="Branches-module_list__vYoT2",C="Branches-module_name__K0Z-4";const L=({branches:s=[]})=>e.jsx("div",{className:y,children:e.jsx(r.Container,{className:b,children:s.map((({id:s,name:n})=>e.jsx("a",{href:"/",children:e.jsx(r.Card,{noBottomMargin:!0,children:e.jsx(r.Flex,{justifyContent:"center",alignItems:"center",fullHeight:!0,children:e.jsx("h2",{className:C,children:n})})})},s)))})});exports.PublicMenu=({data:r})=>{var n;const{name:i,coverImage:t,logoImage:c,branches:l=[],branchId:o,language:d,categories:u,products:m,currency:h,defaultCover:g="",defaultLogo:_=""}=r||{},j=l.length<=1,f=l.find((e=>e.id===Number(o))),p=j||!(null==f?void 0:f.name)?i:(null==f?void 0:f.name)||"",I=t||g,y=c||_,[b,C]=s.useState(null===(n=null==u?void 0:u[0])||void 0===n?void 0:n.id),P=s.useRef({});return e.jsxs("div",{className:a,children:[e.jsx(x,{branch:f,name:p,coverImage:I,logoImage:y}),j||o?e.jsxs(e.Fragment,{children:[e.jsx(v,{categories:u,language:d,selectedCategoryId:b,onSelectCategory:e=>{C(e),(e=>{var s;const r=null===(s=null==P?void 0:P.current)||void 0===s?void 0:s[e];r&&r.scrollIntoView({behavior:"smooth",block:"start"})})(e)}}),e.jsx(N,{categories:u,products:m,currency:h,language:d,productBlocksRef:P,onCategoryInView:e=>{e!==b&&C(e)}})]}):e.jsx(L,{branches:l})]})};
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/components/PublicMenu/Header/Header.tsx","../src/components/PublicMenu/Categories.tsx","../src/components/PublicMenu/PublicMenu.constants.ts","../src/components/PublicMenu/ProductsListItem/ProductsListItem.tsx","../src/components/PublicMenu/Products/Products.tsx","../src/utils/category.ts","../src/components/PublicMenu/Branches/Branches.tsx","../src/components/PublicMenu/PublicMenu.tsx"],"sourcesContent":["import { Column, IconLink, Row, SVGIcon } from \"@sorocraft/ui\";\nimport {\n\tMarkerPin,\n\tPhone,\n\tWifi,\n\tInstagram,\n\tWhatsapp,\n\tTiktok,\n\tFacebook,\n\tTelegram,\n} from \"@sorocraft/ui/icons\";\nimport { isEmpty } from \"@sorocraft/js-utils\";\n\nimport styles from \"./Header.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\n\ninterface Props {\n\tbranch?: branchModels.Branch;\n\tcoverImage?: string;\n\tlogoImage?: string;\n\tdefaultCover?: string;\n\tdefaultLogo?: string;\n\tname: string;\n}\n\nconst Header = ({\n\tbranch,\n\tcoverImage,\n\tlogoImage,\n\tname,\n\tdefaultCover = \"\",\n\tdefaultLogo = \"\",\n}: Props) => {\n\tconst { address, latitude, longitude } = branch || {};\n\tconst noBranch = isEmpty(branch);\n\n\tconst coverImageSource = coverImage || defaultCover;\n\tconst logoImageSource = logoImage || defaultLogo;\n\n\tconst googleMapLink = `https://www.google.com/maps/place/${latitude},${longitude}`;\n\n\tconst BranchInfo = () => (\n\t\t<Row gap={1}>\n\t\t\t<img src={logoImageSource} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\n\t\t\t\t<a\n\t\t\t\t\tclassName={styles.address}\n\t\t\t\t\thref={googleMapLink}\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t>\n\t\t\t\t\t<Row alignItems=\"center\" gap={0.5}>\n\t\t\t\t\t\t<SVGIcon icon={MarkerPin} theme=\"dark\" />\n\t\t\t\t\t\t<span>{address}</span>\n\t\t\t\t\t</Row>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</Row>\n\t);\n\n\tconst BusinessInfo = () => (\n\t\t<Column fullWidth fullHeight alignItems=\"center\" justifyContent=\"center\">\n\t\t\t<img src={logoImageSource} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\t\t\t</div>\n\t\t</Column>\n\t);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<img src={coverImageSource} alt={name} className={styles.cover} />\n\t\t\t<div className={styles.content}>\n\t\t\t\t{noBranch ? <BusinessInfo /> : <BranchInfo />}\n\t\t\t\t{!noBranch && (\n\t\t\t\t\t<div className={styles.labels}>\n\t\t\t\t\t\t<Column alignItems=\"center\" justifyContent=\"center\" gap={0.75} fullHeight>\n\t\t\t\t\t\t\t<IconLink icon={Wifi} href=\"/\" size=\"sm\" shape=\"circle\" />\n\t\t\t\t\t\t</Column>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{!noBranch && (\n\t\t\t\t<div className={styles.social}>\n\t\t\t\t\t<div className={styles.links}>\n\t\t\t\t\t\t<Row alignItems=\"center\" justifyContent=\"center\" gap={0.5}>\n\t\t\t\t\t\t\t<IconLink icon={Phone} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Whatsapp} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Instagram} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Telegram} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Tiktok} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Facebook} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t</Row>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default Header;\n","import { Carousel, CarouselItem, Chip, DivElementMap, UIElementType } from \"@sorocraft/ui\";\nimport { useRef } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as categoryModels from \"src/models/category\";\n\ninterface Props {\n\tcategories: categoryModels.Category[];\n\tlanguage: string;\n\tselectedCategoryId: number;\n\tonSelectCategory: (id: number) => void;\n}\n\nconst Categories = ({ categories, language, selectedCategoryId, onSelectCategory }: Props) => {\n\tconst categoryBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToCategoryBlock = (categoryId: number) => {\n\t\tconst categoryBlock = categoryBlocksRef?.current?.[categoryId];\n\t\tif (!categoryBlock) return;\n\n\t\tcategoryBlock.scrollIntoView({ behavior: \"smooth\", inline: \"center\" });\n\t};\n\n\tconst handleSelectCategory = (id: number) => {\n\t\tscrollToCategoryBlock(id);\n\t\tonSelectCategory(id);\n\t};\n\n\treturn (\n\t\t<div className={styles.categories}>\n\t\t\t<Carousel gap={1}>\n\t\t\t\t{categories.map(({ id, translations }) => {\n\t\t\t\t\tconst { name } = translations.find((item) => item.language === language) || {};\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CarouselItem key={id}>\n\t\t\t\t\t\t\t<Chip\n\t\t\t\t\t\t\t\tonClick={() => handleSelectCategory(id)}\n\t\t\t\t\t\t\t\ttype={UIElementType.BORDERED_PRIMARY}\n\t\t\t\t\t\t\t\tactive={id === selectedCategoryId}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div ref={(el) => (categoryBlocksRef.current[id] = el)}>{name}</div>\n\t\t\t\t\t\t\t</Chip>\n\t\t\t\t\t\t</CarouselItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Carousel>\n\t\t</div>\n\t);\n};\nexport default Categories;\n","export const DEFAULT_CURRENCY = \"AZN\";\n","import { Column, Row } from \"@sorocraft/ui\";\nimport { priceFormatter } from \"@sorocraft/js-utils\";\n\nimport styles from \"./ProductsListItem.module.scss\";\n\nimport * as productModels from \"src/models/product\";\n\nimport { DEFAULT_CURRENCY } from \"../PublicMenu.constants\";\n\ninterface Props {\n\tproduct: productModels.Product;\n\tcurrency: string;\n\tlanguage: string;\n}\n\nconst ProductsListItem = ({ product, currency, language }: Props) => {\n\tconst { translations, price, imageUrl } = product || {};\n\tconst { name, description } = translations.find((item) => item.language === language) || {};\n\tconst formattedPrice = priceFormatter(price, currency || DEFAULT_CURRENCY, language);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Row justifyContent=\"space-between\">\n\t\t\t\t<div className={styles.data}>\n\t\t\t\t\t<Column gap={0.5}>\n\t\t\t\t\t\t<h3 className={styles.name}>{name}</h3>\n\t\t\t\t\t\t<div className={styles.description}>{description}</div>\n\t\t\t\t\t\t<div className={styles.price}>{formattedPrice}</div>\n\t\t\t\t\t</Column>\n\t\t\t\t</div>\n\t\t\t\t{imageUrl && <img src={imageUrl} alt={name} className={styles.image} />}\n\t\t\t</Row>\n\t\t</div>\n\t);\n};\nexport default ProductsListItem;\n","import { RefObject, useEffect } from \"react\";\nimport { Column, DivElementMap } from \"@sorocraft/ui\";\nimport { groupBy } from \"@sorocraft/js-utils\";\n\nimport styles from \"./Products.module.scss\";\n\nimport * as productModels from \"src/models/product\";\nimport * as categoryModels from \"src/models/category\";\nimport * as categoryUtils from \"src/utils/category\";\n\nimport ProductsListItem from \"../ProductsListItem\";\n\ninterface Props {\n\tproducts: productModels.Product[];\n\tcategories: categoryModels.Category[];\n\tproductBlocksRef: RefObject<DivElementMap>;\n\tcurrency: string;\n\tlanguage: string;\n\tonCategoryInView: (categoryId: number) => void;\n}\n\nconst Products = ({\n\tproducts,\n\tcategories,\n\tcurrency,\n\tlanguage,\n\tproductBlocksRef,\n\tonCategoryInView,\n}: Props) => {\n\t// const [layout, setLayout] = useState<\"list\" | \"grid\">(\"list\");\n\n\tconst groupedProducts = groupBy(products, \"categoryId\");\n\n\tuseEffect(() => {\n\t\tconst observer = new IntersectionObserver(\n\t\t\t(entries) => {\n\t\t\t\tentries.forEach((entry) => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tconst categoryId = Number(entry.target.getAttribute(\"data-category-id\"));\n\t\t\t\t\t\tonCategoryInView(categoryId); // Notify the parent when a category is in view\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\t{\n\t\t\t\troot: null, // Use the viewport as the container\n\t\t\t\tthreshold: 0.5, // Trigger when 50% of the product block is in view\n\t\t\t}\n\t\t);\n\n\t\tObject.values(productBlocksRef?.current || {}).forEach((block) => {\n\t\t\tif (block) {\n\t\t\t\tobserver.observe(block);\n\t\t\t}\n\t\t});\n\n\t\treturn () => {\n\t\t\tobserver.disconnect(); // Clean up the observer on component unmount\n\t\t};\n\t}, [productBlocksRef, onCategoryInView]);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t{/* <div className={styles.header}>\n\t\t\t\t<Row>\n\t\t\t\t\t<IconButton icon={List} onClick={() => setLayout(\"list\")} isActive={layout === \"list\"} />\n\t\t\t\t\t<IconButton icon={Grid} onClick={() => setLayout(\"grid\")} isActive={layout === \"grid\"} />\n\t\t\t\t</Row>\n\t\t\t</div> */}\n\t\t\t<Column>\n\t\t\t\t{Object.keys(groupedProducts).map((categoryId) => {\n\t\t\t\t\tconst category = (categories.find(({ id }) => id === Number(categoryId)) ||\n\t\t\t\t\t\t{}) as categoryModels.Category;\n\t\t\t\t\tconst { name } = categoryUtils.getCategoryTranslation(category, language);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={styles.products}\n\t\t\t\t\t\t\tkey={categoryId}\n\t\t\t\t\t\t\tref={(el) => (productBlocksRef!.current![category.id] = el)}\n\t\t\t\t\t\t\tdata-category-id={categoryId}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<h2 className={styles.category}>{name}</h2>\n\t\t\t\t\t\t\t<div className={styles.list}>\n\t\t\t\t\t\t\t\t<Column gap={2}>\n\t\t\t\t\t\t\t\t\t{groupedProducts[categoryId].map((product) => (\n\t\t\t\t\t\t\t\t\t\t<ProductsListItem\n\t\t\t\t\t\t\t\t\t\t\tproduct={product}\n\t\t\t\t\t\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\t\t\t\t\t\tkey={product.id}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</Column>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Column>\n\t\t</div>\n\t);\n};\nexport default Products;\n","import { Category, CategoryTranslation } from \"src/models/category\";\n\nexport const getCategoryTranslation = (\n\tcategory: Category,\n\tlanguage: string\n): CategoryTranslation => {\n\treturn (category?.translations?.find?.((item) => item.language === language) ||\n\t\t{}) as CategoryTranslation;\n};\n","import { Card, Container, Flex } from \"@sorocraft/ui\";\n\nimport styles from \"./Branches.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\n\ninterface Props {\n\tbranches: branchModels.Branch[];\n}\n\nconst Branches = ({ branches = [] }: Props) => {\n\treturn (\n\t\t<div className={styles.branches}>\n\t\t\t<Container className={styles.list}>\n\t\t\t\t{branches.map(({ id, name }) => (\n\t\t\t\t\t<a key={id} href=\"/\">\n\t\t\t\t\t\t<Card noBottomMargin>\n\t\t\t\t\t\t\t<Flex justifyContent=\"center\" alignItems=\"center\" fullHeight>\n\t\t\t\t\t\t\t\t<h2 className={styles.name}>{name}</h2>\n\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t</a>\n\t\t\t\t))}\n\t\t\t</Container>\n\t\t</div>\n\t);\n};\nexport default Branches;\n","import { DivElementMap } from \"@sorocraft/ui\";\nimport { useRef, useState } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as menuModels from \"src/models/menu\";\n\nimport Header from \"./Header\";\nimport Categories from \"./Categories\";\nimport Products from \"./Products\";\nimport Branches from \"./Branches\";\n\ninterface Props {\n\tdata: menuModels.PublicMenuData;\n}\n\nconst PublicMenu = ({ data }: Props) => {\n\tconst {\n\t\tname,\n\t\tcoverImage,\n\t\tlogoImage,\n\t\tbranches = [],\n\t\tbranchId,\n\t\tlanguage,\n\t\tcategories,\n\t\tproducts,\n\t\tcurrency,\n\t} = data || {};\n\n\tconst hasSingleBranch = branches.length <= 1;\n\tconst selectedBranch = branches.find((item) => item.id === Number(branchId));\n\tconst venueName = hasSingleBranch || !selectedBranch?.name ? name : selectedBranch?.name || \"\";\n\n\tconst [selectedCategoryId, setSelectedCategoryId] = useState<number>(categories?.[0]?.id);\n\tconst productBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToProductBlock = (categoryId: number) => {\n\t\tconst productBlock = productBlocksRef?.current?.[categoryId];\n\t\tif (!productBlock) return;\n\n\t\tproductBlock.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n\t};\n\n\tconst handleSelectCategory = (categoryId: number) => {\n\t\tsetSelectedCategoryId(categoryId);\n\n\t\tscrollToProductBlock(categoryId);\n\t};\n\n\tconst handleCategoryInView = (categoryId: number) => {\n\t\tif (categoryId !== selectedCategoryId) {\n\t\t\tsetSelectedCategoryId(categoryId);\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Header\n\t\t\t\tbranch={selectedBranch}\n\t\t\t\tname={venueName}\n\t\t\t\tcoverImage={coverImage}\n\t\t\t\tlogoImage={logoImage}\n\t\t\t/>\n\t\t\t{!hasSingleBranch && !branchId ? (\n\t\t\t\t<Branches branches={branches} />\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<Categories\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tselectedCategoryId={selectedCategoryId}\n\t\t\t\t\t\tonSelectCategory={handleSelectCategory}\n\t\t\t\t\t/>\n\t\t\t\t\t<Products\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tproducts={products}\n\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tproductBlocksRef={productBlocksRef}\n\t\t\t\t\t\tonCategoryInView={handleCategoryInView}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default PublicMenu;\n"],"names":["Header","branch","coverImage","logoImage","name","defaultCover","defaultLogo","address","latitude","longitude","noBranch","isEmpty","coverImageSource","logoImageSource","googleMapLink","_jsxs","jsxs","className","styles","children","_jsx","jsx","src","alt","Column","fullWidth","fullHeight","alignItems","justifyContent","Row","gap","href","target","rel","SVGIcon","icon","MarkerPin","theme","IconLink","Wifi","size","shape","Phone","Whatsapp","Instagram","Telegram","Tiktok","Facebook","Categories","categories","language","selectedCategoryId","onSelectCategory","categoryBlocksRef","useRef","handleSelectCategory","id","categoryId","categoryBlock","_a","current","scrollIntoView","behavior","inline","scrollToCategoryBlock","Carousel","map","translations","find","item","CarouselItem","Chip","onClick","type","UIElementType","BORDERED_PRIMARY","active","ref","el","ProductsListItem","product","currency","price","imageUrl","description","formattedPrice","priceFormatter","container","data","image","Products","products","productBlocksRef","onCategoryInView","groupedProducts","groupBy","useEffect","observer","IntersectionObserver","entries","forEach","entry","isIntersecting","Number","getAttribute","root","threshold","Object","values","block","observe","disconnect","keys","category","_b","call","categoryUtils.getCategoryTranslation","list","Branches","branches","Container","Card","noBottomMargin","Flex","branchId","hasSingleBranch","length","selectedBranch","venueName","setSelectedCategoryId","useState","_Fragment","Fragment","productBlock","scrollToProductBlock"],"mappings":"4iBA0BA,MAAMA,EAAS,EACdC,SACAC,aACAC,YACAC,OACAC,eAAe,GACfC,cAAc,OAEd,MAAMC,QAAEA,EAAOC,SAAEA,EAAQC,UAAEA,GAAcR,GAAU,CAAA,EAC7CS,EAAWC,UAAQV,GAEnBW,EAAmBV,GAAcG,EACjCQ,EAAkBV,GAAaG,EAE/BQ,EAAgB,qCAAqCN,KAAYC,IAgCvE,OACCM,EAAAC,KAAA,MAAA,CAAKC,UAAWC,EAAgBC,SAAA,CAC/BC,EAAKC,IAAA,MAAA,CAAAC,IAAKV,EAAkBW,IAAKnB,EAAMa,UAAWC,IAClDH,EAAAA,KAAK,MAAA,CAAAE,UAAWC,YACdR,EAAWU,EAACC,KAbK,IACpBN,EAAAC,KAACQ,SAAM,CAACC,WAAS,EAACC,YAAU,EAACC,WAAW,SAASC,eAAe,SAC/DT,SAAA,CAAAC,MAAA,MAAA,CAAKE,IAAKT,EAAiBU,IAAKnB,EAAMa,UAAWC,IACjDE,EAAAA,IAAK,MAAA,CAAAH,UAAWC,WACfE,EAAIC,IAAA,KAAA,CAAAJ,UAAWC,EAAcC,SAAAf,UASD,IAAGgB,OAlCf,IAClBL,OAACc,EAAAA,IAAI,CAAAC,IAAK,EAACX,SAAA,CACVC,aAAKE,IAAKT,EAAiBU,IAAKnB,EAAMa,UAAWC,IACjDH,cAAKE,UAAWC,YACfE,MAAI,KAAA,CAAAH,U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b,KAAO+C,OAAOqB,KAC5DI,EAAYH,KAAoBE,aAAc,EAAdA,EAAgB3H,MAAOA,GAAO2H,aAAc,EAAdA,EAAgB3H,OAAQ,IAErF+C,EAAoB8E,GAAyBC,EAAQA,SAA0B,QAAjBvE,EAAAV,aAAU,EAAVA,EAAa,UAAI,IAAAU,OAAA,EAAAA,EAAAH,IAChFoC,EAAmBtC,SAAsB,CAAA,GAqB/C,OACCvC,cAAKE,UAAWC,EACfC,SAAA,CAAAC,EAAAC,IAACrB,EAAM,CACNC,OAAQ8H,EACR3H,KAAM4H,EACN9H,WAAYA,EACZC,UAAWA,IAEV0H,GAAoBD,EAGrB7G,EAAAC,KAAAmH,EAAAC,SAAA,CAAAjH,SAAA,CACCC,MAAC4B,EAAU,CACVC,WAAYA,EACZC,SAAUA,EACVC,mBAAoBA,EACpBC,iBA5ByBK,IAC7BwE,EAAsBxE,GARM,CAACA,UAC7B,MAAM4E,EAA2C,QAA5B1E,EAAAiC,aAAA,EAAAA,EAAkBhC,eAAU,IAAAD,OAAA,EAAAA,EAAAF,GAC5C4E,GAELA,EAAaxE,eAAe,CAAEC,SAAU,SAAU+C,MAAO,SAAU,EAMnEyB,CAAqB7E,EAAW,IA2B7BrC,EAAAA,IAACsE,EACA,CAAAzC,WAAYA,EACZ0C,SAAUA,EACVV,SAAUA,EACV/B,SAAUA,EACV0C,iBAAkBA,EAClBC,iBA9ByBpC,IACzBA,IAAeN,GAClB8E,EAAsBxE,EACtB,OAYCrC,EAAAA,IAACkG,EAAQ,CAACC,SAAUA,MAoBrB"}
1
+ {"version":3,"file":"index.js","sources":["../src/components/PublicMenu/Header/Header.tsx","../src/components/PublicMenu/Categories.tsx","../src/components/PublicMenu/PublicMenu.constants.ts","../src/components/PublicMenu/ProductsListItem/ProductsListItem.tsx","../src/components/PublicMenu/Products/Products.tsx","../src/utils/category.ts","../src/components/PublicMenu/Branches/Branches.tsx","../src/components/PublicMenu/PublicMenu.tsx"],"sourcesContent":["import { Column, IconLink, Row, SVGIcon } from \"@sorocraft/ui\";\nimport {\n\tMarkerPin,\n\tPhone,\n\tWifi,\n\tInstagram,\n\tWhatsapp,\n\tTiktok,\n\tFacebook,\n\tTelegram,\n} from \"@sorocraft/ui/icons\";\nimport { isEmpty } from \"@sorocraft/js-utils\";\n\nimport styles from \"./Header.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\n\ninterface Props {\n\tbranch?: branchModels.Branch;\n\tcoverImage?: string;\n\tlogoImage?: string;\n\tname: string;\n}\n\nconst Header = ({ branch, coverImage, logoImage, name }: Props) => {\n\tconst { address, latitude, longitude } = branch || {};\n\tconst noBranch = isEmpty(branch);\n\n\tconst googleMapLink = `https://www.google.com/maps/place/${latitude},${longitude}`;\n\n\tconst BranchInfo = () => (\n\t\t<Row gap={1}>\n\t\t\t<img src={logoImage} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\n\t\t\t\t<a\n\t\t\t\t\tclassName={styles.address}\n\t\t\t\t\thref={googleMapLink}\n\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t>\n\t\t\t\t\t<Row alignItems=\"center\" gap={0.5}>\n\t\t\t\t\t\t<SVGIcon icon={MarkerPin} theme=\"dark\" />\n\t\t\t\t\t\t<span>{address}</span>\n\t\t\t\t\t</Row>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t</Row>\n\t);\n\n\tconst BusinessInfo = () => (\n\t\t<Column fullWidth fullHeight alignItems=\"center\" justifyContent=\"center\">\n\t\t\t<img src={logoImage} alt={name} className={styles.logo} />\n\t\t\t<div className={styles.info}>\n\t\t\t\t<h1 className={styles.name}>{name}</h1>\n\t\t\t</div>\n\t\t</Column>\n\t);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<img src={coverImage} alt={name} className={styles.cover} />\n\t\t\t<div className={styles.content}>\n\t\t\t\t{noBranch ? <BusinessInfo /> : <BranchInfo />}\n\t\t\t\t{!noBranch && (\n\t\t\t\t\t<div className={styles.labels}>\n\t\t\t\t\t\t<Column alignItems=\"center\" justifyContent=\"center\" gap={0.75} fullHeight>\n\t\t\t\t\t\t\t<IconLink icon={Wifi} href=\"/\" size=\"sm\" shape=\"circle\" />\n\t\t\t\t\t\t</Column>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{!noBranch && (\n\t\t\t\t<div className={styles.social}>\n\t\t\t\t\t<div className={styles.links}>\n\t\t\t\t\t\t<Row alignItems=\"center\" justifyContent=\"center\" gap={0.5}>\n\t\t\t\t\t\t\t<IconLink icon={Phone} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Whatsapp} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Instagram} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Telegram} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Tiktok} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t\t<IconLink icon={Facebook} href=\"/\" size=\"sm\" shape=\"circle\" theme=\"light\" />\n\t\t\t\t\t\t</Row>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default Header;\n","import { Carousel, CarouselItem, Chip, DivElementMap, UIElementType } from \"@sorocraft/ui\";\nimport { useRef } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as categoryModels from \"src/models/category\";\n\ninterface Props {\n\tcategories: categoryModels.Category[];\n\tlanguage: string;\n\tselectedCategoryId: number;\n\tonSelectCategory: (id: number) => void;\n}\n\nconst Categories = ({ categories, language, selectedCategoryId, onSelectCategory }: Props) => {\n\tconst categoryBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToCategoryBlock = (categoryId: number) => {\n\t\tconst categoryBlock = categoryBlocksRef?.current?.[categoryId];\n\t\tif (!categoryBlock) return;\n\n\t\tcategoryBlock.scrollIntoView({ behavior: \"smooth\", inline: \"center\" });\n\t};\n\n\tconst handleSelectCategory = (id: number) => {\n\t\tscrollToCategoryBlock(id);\n\t\tonSelectCategory(id);\n\t};\n\n\treturn (\n\t\t<div className={styles.categories}>\n\t\t\t<Carousel gap={1}>\n\t\t\t\t{categories.map(({ id, translations }) => {\n\t\t\t\t\tconst { name } = translations.find((item) => item.language === language) || {};\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<CarouselItem key={id}>\n\t\t\t\t\t\t\t<Chip\n\t\t\t\t\t\t\t\tonClick={() => handleSelectCategory(id)}\n\t\t\t\t\t\t\t\ttype={UIElementType.BORDERED_PRIMARY}\n\t\t\t\t\t\t\t\tactive={id === selectedCategoryId}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div ref={(el) => (categoryBlocksRef.current[id] = el)}>{name}</div>\n\t\t\t\t\t\t\t</Chip>\n\t\t\t\t\t\t</CarouselItem>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Carousel>\n\t\t</div>\n\t);\n};\nexport default Categories;\n","export const DEFAULT_CURRENCY = \"AZN\";\n","import { Column, Row } from \"@sorocraft/ui\";\nimport { priceFormatter } from \"@sorocraft/js-utils\";\n\nimport styles from \"./ProductsListItem.module.scss\";\n\nimport * as productModels from \"src/models/product\";\n\nimport { DEFAULT_CURRENCY } from \"../PublicMenu.constants\";\n\ninterface Props {\n\tproduct: productModels.Product;\n\tcurrency: string;\n\tlanguage: string;\n}\n\nconst ProductsListItem = ({ product, currency, language }: Props) => {\n\tconst { translations, price, imageUrl } = product || {};\n\tconst { name, description } = translations.find((item) => item.language === language) || {};\n\tconst formattedPrice = priceFormatter(price, currency || DEFAULT_CURRENCY, language);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Row justifyContent=\"space-between\">\n\t\t\t\t<div className={styles.data}>\n\t\t\t\t\t<Column gap={0.5}>\n\t\t\t\t\t\t<h3 className={styles.name}>{name}</h3>\n\t\t\t\t\t\t<div className={styles.description}>{description}</div>\n\t\t\t\t\t\t<div className={styles.price}>{formattedPrice}</div>\n\t\t\t\t\t</Column>\n\t\t\t\t</div>\n\t\t\t\t{imageUrl && <img src={imageUrl} alt={name} className={styles.image} />}\n\t\t\t</Row>\n\t\t</div>\n\t);\n};\nexport default ProductsListItem;\n","import { RefObject, useEffect } from \"react\";\nimport { Column, DivElementMap } from \"@sorocraft/ui\";\nimport { groupBy } from \"@sorocraft/js-utils\";\n\nimport styles from \"./Products.module.scss\";\n\nimport * as productModels from \"src/models/product\";\nimport * as categoryModels from \"src/models/category\";\nimport * as categoryUtils from \"src/utils/category\";\n\nimport ProductsListItem from \"../ProductsListItem\";\n\ninterface Props {\n\tproducts: productModels.Product[];\n\tcategories: categoryModels.Category[];\n\tproductBlocksRef: RefObject<DivElementMap>;\n\tcurrency: string;\n\tlanguage: string;\n\tonCategoryInView: (categoryId: number) => void;\n}\n\nconst Products = ({\n\tproducts,\n\tcategories,\n\tcurrency,\n\tlanguage,\n\tproductBlocksRef,\n\tonCategoryInView,\n}: Props) => {\n\t// const [layout, setLayout] = useState<\"list\" | \"grid\">(\"list\");\n\n\tconst groupedProducts = groupBy(products, \"categoryId\");\n\n\tuseEffect(() => {\n\t\tconst observer = new IntersectionObserver(\n\t\t\t(entries) => {\n\t\t\t\tentries.forEach((entry) => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tconst categoryId = Number(entry.target.getAttribute(\"data-category-id\"));\n\t\t\t\t\t\tonCategoryInView(categoryId); // Notify the parent when a category is in view\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\t{\n\t\t\t\troot: null, // Use the viewport as the container\n\t\t\t\tthreshold: 0.5, // Trigger when 50% of the product block is in view\n\t\t\t}\n\t\t);\n\n\t\tObject.values(productBlocksRef?.current || {}).forEach((block) => {\n\t\t\tif (block) {\n\t\t\t\tobserver.observe(block);\n\t\t\t}\n\t\t});\n\n\t\treturn () => {\n\t\t\tobserver.disconnect(); // Clean up the observer on component unmount\n\t\t};\n\t}, [productBlocksRef, onCategoryInView]);\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t{/* <div className={styles.header}>\n\t\t\t\t<Row>\n\t\t\t\t\t<IconButton icon={List} onClick={() => setLayout(\"list\")} isActive={layout === \"list\"} />\n\t\t\t\t\t<IconButton icon={Grid} onClick={() => setLayout(\"grid\")} isActive={layout === \"grid\"} />\n\t\t\t\t</Row>\n\t\t\t</div> */}\n\t\t\t<Column>\n\t\t\t\t{Object.keys(groupedProducts).map((categoryId) => {\n\t\t\t\t\tconst category = (categories.find(({ id }) => id === Number(categoryId)) ||\n\t\t\t\t\t\t{}) as categoryModels.Category;\n\t\t\t\t\tconst { name } = categoryUtils.getCategoryTranslation(category, language);\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={styles.products}\n\t\t\t\t\t\t\tkey={categoryId}\n\t\t\t\t\t\t\tref={(el) => (productBlocksRef!.current![category.id] = el)}\n\t\t\t\t\t\t\tdata-category-id={categoryId}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<h2 className={styles.category}>{name}</h2>\n\t\t\t\t\t\t\t<div className={styles.list}>\n\t\t\t\t\t\t\t\t<Column gap={2}>\n\t\t\t\t\t\t\t\t\t{groupedProducts[categoryId].map((product) => (\n\t\t\t\t\t\t\t\t\t\t<ProductsListItem\n\t\t\t\t\t\t\t\t\t\t\tproduct={product}\n\t\t\t\t\t\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\t\t\t\t\t\tkey={product.id}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</Column>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</Column>\n\t\t</div>\n\t);\n};\nexport default Products;\n","import { Category, CategoryTranslation } from \"src/models/category\";\n\nexport const getCategoryTranslation = (\n\tcategory: Category,\n\tlanguage: string\n): CategoryTranslation => {\n\treturn (category?.translations?.find?.((item) => item.language === language) ||\n\t\t{}) as CategoryTranslation;\n};\n","import { Card, Container, Flex } from \"@sorocraft/ui\";\n\nimport styles from \"./Branches.module.scss\";\n\nimport * as branchModels from \"src/models/branch\";\n\ninterface Props {\n\tbranches: branchModels.Branch[];\n}\n\nconst Branches = ({ branches = [] }: Props) => {\n\treturn (\n\t\t<div className={styles.branches}>\n\t\t\t<Container className={styles.list}>\n\t\t\t\t{branches.map(({ id, name }) => (\n\t\t\t\t\t<a key={id} href=\"/\">\n\t\t\t\t\t\t<Card noBottomMargin>\n\t\t\t\t\t\t\t<Flex justifyContent=\"center\" alignItems=\"center\" fullHeight>\n\t\t\t\t\t\t\t\t<h2 className={styles.name}>{name}</h2>\n\t\t\t\t\t\t\t</Flex>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t</a>\n\t\t\t\t))}\n\t\t\t</Container>\n\t\t</div>\n\t);\n};\nexport default Branches;\n","import { DivElementMap } from \"@sorocraft/ui\";\nimport { useRef, useState } from \"react\";\n\nimport styles from \"./PublicMenu.module.scss\";\n\nimport * as menuModels from \"src/models/menu\";\n\nimport Header from \"./Header\";\nimport Categories from \"./Categories\";\nimport Products from \"./Products\";\nimport Branches from \"./Branches\";\n\ninterface Props {\n\tdata: menuModels.PublicMenuData;\n}\n\nconst PublicMenu = ({ data }: Props) => {\n\tconst {\n\t\tname,\n\t\tcoverImage,\n\t\tlogoImage,\n\t\tbranches = [],\n\t\tbranchId,\n\t\tlanguage,\n\t\tcategories,\n\t\tproducts,\n\t\tcurrency,\n\t\tdefaultCover = \"\",\n\t\tdefaultLogo = \"\",\n\t} = data || {};\n\n\tconst hasSingleBranch = branches.length <= 1;\n\tconst selectedBranch = branches.find((item) => item.id === Number(branchId));\n\tconst venueName = hasSingleBranch || !selectedBranch?.name ? name : selectedBranch?.name || \"\";\n\n\tconst coverImageSource = coverImage || defaultCover;\n\tconst logoImageSource = logoImage || defaultLogo;\n\n\tconst [selectedCategoryId, setSelectedCategoryId] = useState<number>(categories?.[0]?.id);\n\tconst productBlocksRef = useRef<DivElementMap>({});\n\n\tconst scrollToProductBlock = (categoryId: number) => {\n\t\tconst productBlock = productBlocksRef?.current?.[categoryId];\n\t\tif (!productBlock) return;\n\n\t\tproductBlock.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n\t};\n\n\tconst handleSelectCategory = (categoryId: number) => {\n\t\tsetSelectedCategoryId(categoryId);\n\n\t\tscrollToProductBlock(categoryId);\n\t};\n\n\tconst handleCategoryInView = (categoryId: number) => {\n\t\tif (categoryId !== selectedCategoryId) {\n\t\t\tsetSelectedCategoryId(categoryId);\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className={styles.container}>\n\t\t\t<Header\n\t\t\t\tbranch={selectedBranch}\n\t\t\t\tname={venueName}\n\t\t\t\tcoverImage={coverImageSource}\n\t\t\t\tlogoImage={logoImageSource}\n\t\t\t/>\n\t\t\t{!hasSingleBranch && !branchId ? (\n\t\t\t\t<Branches branches={branches} />\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<Categories\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tselectedCategoryId={selectedCategoryId}\n\t\t\t\t\t\tonSelectCategory={handleSelectCategory}\n\t\t\t\t\t/>\n\t\t\t\t\t<Products\n\t\t\t\t\t\tcategories={categories}\n\t\t\t\t\t\tproducts={products}\n\t\t\t\t\t\tcurrency={currency}\n\t\t\t\t\t\tlanguage={language}\n\t\t\t\t\t\tproductBlocksRef={productBlocksRef}\n\t\t\t\t\t\tonCategoryInView={handleCategoryInView}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\nexport default PublicMenu;\n"],"names":["Header","branch","coverImage","logoImage","name","address","latitude","longitude","noBranch","isEmpty","googleMapLink","_jsxs","jsxs","className","styles","children","_jsx","jsx","src","alt","Column","fullWidth","fullHeight","alignItems","justifyContent","Row","gap","href","target","rel","SVGIcon","icon","MarkerPin","theme","IconLink","Wifi","size","shape","Phone","Whatsapp","Instagram","Telegram","Tiktok","Facebook","Categories","categories","language","selectedCategoryId","onSelectCategory","categoryBlocksRef","useRef","handleSelectCategory","id","categoryId","categoryBlock","_a","current","scrollIntoView","behavior","inline","scrollToCategoryBlock","Carousel","map","translations","find","item","CarouselItem","Chip","onClick","type","UIElementType","BORDERED_PRIMARY","active","ref","el","ProductsListItem","product","currency","price","imageUrl","description","formattedPrice","priceFormatter","container","data","image","Products","products","productBlocksRef","onCategoryInView","groupedProducts","groupBy","useEffect","observer","IntersectionObserver","entries","forEach","entry","isIntersecting","Number","getAttribute","root","threshold","Object","values","block","observe","disconnect","keys","category","_b","call","categoryUtils.getCategoryTranslation","list","Branches","branches","Container","Card","noBottomMargin","Flex","branchId","defaultCover","defaultLogo","hasSingleBranch","length","selectedBranch","venueName","coverImageSource","logoImageSource","setSelectedCategoryId","useState","_Fragment","Fragment","productBlock","scrollToProductBlock"],"mappings":"4iBAwBA,MAAMA,EAAS,EAAGC,SAAQC,aAAYC,YAAWC,WAChD,MAAMC,QAAEA,EAAOC,SAAEA,EAAQC,UAAEA,GAAcN,GAAU,CAAA,EAC7CO,EAAWC,UAAQR,GAEnBS,EAAgB,qCAAqCJ,KAAYC,IAgCvE,OACCI,EAAAC,KAAA,MAAA,CAAKC,UAAWC,EAAgBC,SAAA,CAC/BC,EAAKC,IAAA,MAAA,CAAAC,IAAKhB,EAAYiB,IAAKf,EAAMS,UAAWC,IAC5CH,EAAAA,KAAK,MAAA,CAAAE,UAAWC,YACdN,EAAWQ,EAACC,KAbK,IACpBN,EAAAC,KAACQ,SAA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AW,IA2B7BrC,EAAAA,IAACsE,EACA,CAAAzC,WAAYA,EACZ0C,SAAUA,EACVV,SAAUA,EACV/B,SAAUA,EACV0C,iBAAkBA,EAClBC,iBA9ByBpC,IACzBA,IAAeN,GAClBkF,EAAsB5E,EACtB,OAYCrC,EAAAA,IAACkG,EAAQ,CAACC,SAAUA,MAoBrB"}
@@ -11,4 +11,6 @@ export interface PublicMenuData {
11
11
  products: productModels.Product[];
12
12
  categories: categoryModels.Category[];
13
13
  language: string;
14
+ defaultCover: string;
15
+ defaultLogo: string;
14
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@restaround/react",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "React Library by restaround.co",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",