@gem-sdk/plugin-quick-view 17.0.0-staging.20 → 17.0.0-staging.26
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
|
|
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
|
|
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})
|
|
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
|
|
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
|
|
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
|
|
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": "17.0.0-staging.
|
|
3
|
+
"version": "17.0.0-staging.26",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
"post:publish": "node ./../../helpers/convert-publish.js",
|
|
15
15
|
"watch": "rollup -c ./../../helpers/rollup.config.mjs -w",
|
|
16
16
|
"build": "rollup -c ./../../helpers/rollup.config.mjs --environment NODE_ENV:production",
|
|
17
|
-
"lint": "
|
|
17
|
+
"lint": "oxlint --format=stylish ./src",
|
|
18
18
|
"type-check": "yarn tsc --noEmit",
|
|
19
19
|
"test": "jest -c ./../../helpers/jest.config.ts"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@gem-sdk/components": "17.0.0-staging.
|
|
23
|
-
"@gem-sdk/core": "17.0.0-staging.
|
|
24
|
-
"@gem-sdk/styles": "17.0.0-staging.
|
|
22
|
+
"@gem-sdk/components": "17.0.0-staging.26",
|
|
23
|
+
"@gem-sdk/core": "17.0.0-staging.26",
|
|
24
|
+
"@gem-sdk/styles": "17.0.0-staging.26"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "18.3.1",
|