@gem-sdk/plugin-quick-view 17.0.0-dev.73 → 17.0.0-staging.20
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 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;
|
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 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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0})
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const config={tag:"QuickView",label:"Product Quick View"};exports.default=config;
|
|
@@ -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 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};
|
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 builderSetting={QuickView:e};export{builderSetting,i as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let
|
|
1
|
+
let config={tag:"QuickView",label:"Product Quick View"};export{config 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-
|
|
3
|
+
"version": "17.0.0-staging.20",
|
|
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": "eslint ./src --ext .tsx,.ts",
|
|
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-
|
|
23
|
-
"@gem-sdk/core": "17.0.0-
|
|
24
|
-
"@gem-sdk/styles": "17.0.0-
|
|
22
|
+
"@gem-sdk/components": "17.0.0-staging.20",
|
|
23
|
+
"@gem-sdk/core": "17.0.0-staging.20",
|
|
24
|
+
"@gem-sdk/styles": "17.0.0-staging.20"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "18.3.1",
|