@gem-sdk/plugin-quick-view 12.0.0-dev.124 → 12.0.0-dev.138

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),components=require("@gem-sdk/components"),core=require("@gem-sdk/core"),react=require("react");const ModalContent=()=>{let e=core.useProduct(),{data:t,isLoading:s,error:n}=core.useProductQuery(e?.id);return s?jsxRuntime.jsx("div",{children:jsxRuntime.jsxs("svg",{className:"gp-mx-auto gp-my-20 gp-h-8 gp-w-8 gp-animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{className:"gp-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),jsxRuntime.jsx("path",{className:"gp-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):n?jsxRuntime.jsx("p",{className:"gp-py-20 gp-text-center gp-font-semibold",children:"Something went wrong"}):jsxRuntime.jsx(core.ProductProvider,{product:t,children:jsxRuntime.jsxs(components.Row,{setting:{layout:{desktop:{cols:[6,6],display:"fill"},mobile:{cols:[12]}}},children:[jsxRuntime.jsx(components.Col,{children:jsxRuntime.jsx(components.ProductImages,{})}),jsxRuntime.jsxs(components.Col,{children:[jsxRuntime.jsx(components.ProductTitle,{setting:{htmlTag:"p"},styles:{typography:{type:"heading-3"}}}),jsxRuntime.jsxs(components.Row,{setting:{layout:{desktop:{cols:[6,6],display:"fit"}},horizontalAlign:{desktop:"end"}},children:[jsxRuntime.jsx(components.Col,{children:jsxRuntime.jsx(components.ProductPrice,{setting:{priceType:"regular"},styles:{typography:{type:"subheading-2"}}})}),jsxRuntime.jsx(components.Col,{children:jsxRuntime.jsx(components.ProductPrice,{setting:{priceType:"compare"},styles:{typography:{type:"paragraph-2"}}})})]}),jsxRuntime.jsx(components.ProductVariants,{}),jsxRuntime.jsx(components.ProductQuantity,{}),jsxRuntime.jsx(components.ProductButton,{setting:{actionEffect:"open-cart-drawer"}})]})]})})},ProductQuickView=({setting:e})=>{let[t,s]=react.useState(!1),n=core.usePluginEnable();return n?.includes("quick-view")?jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{"aria-hidden":!0,role:"button","aria-label":"Quick view",onClick:()=>s(e=>!e),children:e?.label}),jsxRuntime.jsx(components.Modal,{setting:{open:t},closeOnClickOutside:!0,onClose:()=>s(e=>!e),children:jsxRuntime.jsx(ModalContent,{})})]}):null};ProductQuickView.defaultProps={setting:{label:"Quick View"}},exports.default=ProductQuickView;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/components"),s=require("@gem-sdk/core"),r=require("react");const i=()=>{let r=s.useProduct(),{data:i,isLoading:l,error:o}=s.useProductQuery(r?.id);return l?e.jsx("div",{children:e.jsxs("svg",{className:"gp-mx-auto gp-my-20 gp-h-8 gp-w-8 gp-animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"gp-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"gp-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):o?e.jsx("p",{className:"gp-py-20 gp-text-center gp-font-semibold",children:"Something went wrong"}):e.jsx(s.ProductProvider,{product:i,children:e.jsxs(t.Row,{setting:{layout:{desktop:{cols:[6,6],display:"fill"},mobile:{cols:[12]}}},children:[e.jsx(t.Col,{children:e.jsx(t.ProductImages,{})}),e.jsxs(t.Col,{children:[e.jsx(t.ProductTitle,{setting:{htmlTag:"p"},styles:{typography:{type:"heading-3"}}}),e.jsxs(t.Row,{setting:{layout:{desktop:{cols:[6,6],display:"fit"}},horizontalAlign:{desktop:"end"}},children:[e.jsx(t.Col,{children:e.jsx(t.ProductPrice,{setting:{priceType:"regular"},styles:{typography:{type:"subheading-2"}}})}),e.jsx(t.Col,{children:e.jsx(t.ProductPrice,{setting:{priceType:"compare"},styles:{typography:{type:"paragraph-2"}}})})]}),e.jsx(t.ProductVariants,{}),e.jsx(t.ProductQuantity,{}),e.jsx(t.ProductButton,{setting:{actionEffect:"open-cart-drawer"}})]})]})})},l=({setting:l})=>{let[o,c]=r.useState(!1),n=s.usePluginEnable();return n?.includes("quick-view")?e.jsxs("div",{children:[e.jsx("div",{"aria-hidden":!0,role:"button","aria-label":"Quick view",onClick:()=>c(e=>!e),children:l?.label}),e.jsx(t.Modal,{setting:{open:o},closeOnClickOutside:!0,onClose:()=>c(e=>!e),children:e.jsx(i,{})})]}):null};l.defaultProps={setting:{label:"Quick View"}},exports.default=l;
package/dist/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var QuickView=require("./components/QuickView.js"),QuickView$1=require("./setting/QuickView.js");const builderSetting={QuickView:QuickView$1.default};exports.default=QuickView.default,exports.builderSetting=builderSetting;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./components/QuickView.js"),t=require("./setting/QuickView.js");const i={QuickView:t.default};exports.default=e.default,exports.builderSetting=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const config={tag:"QuickView",label:"Product Quick View"};exports.default=config;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={tag:"QuickView",label:"Product Quick View"};
@@ -1 +1 @@
1
- import{jsxs as e,jsx as t}from"react/jsx-runtime";import{Modal as i,Row as l,Col as r,ProductImages as o,ProductTitle as n,ProductPrice as c,ProductVariants as a,ProductQuantity as s,ProductButton as p}from"@gem-sdk/components";import{usePluginEnable as d,useProduct as g,useProductQuery as h,ProductProvider as m}from"@gem-sdk/core";import{useState as u}from"react";let ModalContent=()=>{let i=g(),{data:d,isLoading:u,error:y}=h(i?.id);return u?t("div",{children:e("svg",{className:"gp-mx-auto gp-my-20 gp-h-8 gp-w-8 gp-animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[t("circle",{className:"gp-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t("path",{className:"gp-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):y?t("p",{className:"gp-py-20 gp-text-center gp-font-semibold",children:"Something went wrong"}):t(m,{product:d,children:e(l,{setting:{layout:{desktop:{cols:[6,6],display:"fill"},mobile:{cols:[12]}}},children:[t(r,{children:t(o,{})}),e(r,{children:[t(n,{setting:{htmlTag:"p"},styles:{typography:{type:"heading-3"}}}),e(l,{setting:{layout:{desktop:{cols:[6,6],display:"fit"}},horizontalAlign:{desktop:"end"}},children:[t(r,{children:t(c,{setting:{priceType:"regular"},styles:{typography:{type:"subheading-2"}}})}),t(r,{children:t(c,{setting:{priceType:"compare"},styles:{typography:{type:"paragraph-2"}}})})]}),t(a,{}),t(s,{}),t(p,{setting:{actionEffect:"open-cart-drawer"}})]})]})})},ProductQuickView=({setting:l})=>{let[r,o]=u(!1),n=d();return n?.includes("quick-view")?e("div",{children:[t("div",{"aria-hidden":!0,role:"button","aria-label":"Quick view",onClick:()=>o(e=>!e),children:l?.label}),t(i,{setting:{open:r},closeOnClickOutside:!0,onClose:()=>o(e=>!e),children:t(ModalContent,{})})]}):null};ProductQuickView.defaultProps={setting:{label:"Quick View"}};export{ProductQuickView as default};
1
+ import{jsxs as e,jsx as t}from"react/jsx-runtime";import{Modal as i,Row as l,Col as r,ProductImages as o,ProductTitle as n,ProductPrice as c,ProductVariants as s,ProductQuantity as p,ProductButton as a}from"@gem-sdk/components";import{usePluginEnable as d,useProduct as g,useProductQuery as h,ProductProvider as m}from"@gem-sdk/core";import{useState as y}from"react";let u=()=>{let i=g(),{data:d,isLoading:y,error:u}=h(i?.id);return y?t("div",{children:e("svg",{className:"gp-mx-auto gp-my-20 gp-h-8 gp-w-8 gp-animate-spin",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[t("circle",{className:"gp-opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t("path",{className:"gp-opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}):u?t("p",{className:"gp-py-20 gp-text-center gp-font-semibold",children:"Something went wrong"}):t(m,{product:d,children:e(l,{setting:{layout:{desktop:{cols:[6,6],display:"fill"},mobile:{cols:[12]}}},children:[t(r,{children:t(o,{})}),e(r,{children:[t(n,{setting:{htmlTag:"p"},styles:{typography:{type:"heading-3"}}}),e(l,{setting:{layout:{desktop:{cols:[6,6],display:"fit"}},horizontalAlign:{desktop:"end"}},children:[t(r,{children:t(c,{setting:{priceType:"regular"},styles:{typography:{type:"subheading-2"}}})}),t(r,{children:t(c,{setting:{priceType:"compare"},styles:{typography:{type:"paragraph-2"}}})})]}),t(s,{}),t(p,{}),t(a,{setting:{actionEffect:"open-cart-drawer"}})]})]})})},f=({setting:l})=>{let[r,o]=y(!1),n=d();return n?.includes("quick-view")?e("div",{children:[t("div",{"aria-hidden":!0,role:"button","aria-label":"Quick view",onClick:()=>o(e=>!e),children:l?.label}),t(i,{setting:{open:r},closeOnClickOutside:!0,onClose:()=>o(e=>!e),children:t(u,{})})]}):null};f.defaultProps={setting:{label:"Quick View"}};export{f as default};
package/dist/esm/index.js CHANGED
@@ -1 +1 @@
1
- import i from"./components/QuickView.js";import e from"./setting/QuickView.js";let builderSetting={QuickView:e};export{builderSetting,i as default};
1
+ import i from"./components/QuickView.js";import e from"./setting/QuickView.js";let t={QuickView:e};export{t as builderSetting,i as default};
@@ -1 +1 @@
1
- let config={tag:"QuickView",label:"Product Quick View"};export{config as default};
1
+ let e={tag:"QuickView",label:"Product Quick View"};export{e as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/plugin-quick-view",
3
- "version": "12.0.0-dev.124",
3
+ "version": "12.0.0-dev.138",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -19,9 +19,9 @@
19
19
  "test": "jest -c ./../../helpers/jest.config.ts"
20
20
  },
21
21
  "devDependencies": {
22
- "@gem-sdk/components": "12.0.0-dev.124",
23
- "@gem-sdk/core": "12.0.0-dev.124",
24
- "@gem-sdk/styles": "12.0.0-dev.124"
22
+ "@gem-sdk/components": "12.0.0-dev.138",
23
+ "@gem-sdk/core": "12.0.0-dev.138",
24
+ "@gem-sdk/styles": "12.0.0-dev.138"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "react": "18.3.1",