@gem-sdk/components 19.1.0-staging.1 → 19.1.0-staging.3

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,4 +1,4 @@
1
- "use strict";var e=require("@gem-sdk/core");const t=["desktop","mobile","tablet"],o=(e,o)=>{let l={};return t.forEach(t=>{l={...l,[`--d${"desktop"===t?"":`-${t}`}`]:`${e(t)?"none":o}`}}),l},l=t=>{let o={desktop:"none"};return["desktop","mobile","tablet"].forEach(l=>{let r=e.getResponsiveValueByScreen(t?.lineClamp,l),a=e.getResponsiveValueByScreen(t?.hasLineClamp,l);a&&r?o[l]=`calc(${r} * 1lh)`:o[l]="none"}),{...e.makeStyleResponsive("maxh",o)}};exports.getButtonStyle=({setting:t})=>{let l=e.composeTypographyStyle(t?.typo,t?.typography),r={...e.makeStyleResponsive("jc",t?.textAlign),...e.makeStyle({tt:t?.transform}),...l,...e.getGlobalColorStyle(t?.showMoreColor),...o(e=>!!t?.hasLineClamp&&void 0!==t.hasLineClamp[e]&&!t.hasLineClamp[e],"inline-flex")};return e.filterTruthyStyles(r)},exports.getMaxHeightStyleDefault=l,exports.getStaticCss=()=>{let e=`
1
+ "use strict";var e=require("@gem-sdk/core");const t=["desktop","mobile","tablet"],o=(e,o)=>{let l={};return t.forEach(t=>{l={...l,[`--d${"desktop"===t?"":`-${t}`}`]:`${e(t)?"none":o}`}}),l},l=t=>{let o={desktop:"none"};return["desktop","mobile","tablet"].forEach(l=>{let p=e.getResponsiveValueByScreen(t?.lineClamp,l),r=e.getResponsiveValueByScreen(t?.hasLineClamp,l);r&&p?o[l]=`calc(${p} * 1lh)`:o[l]="none"}),{...e.makeStyleResponsive("maxh",o)}};exports.getButtonStyle=({setting:t})=>{let l=e.composeTypographyStyle(t?.typo,t?.typography),p={...e.makeStyleResponsive("jc",t?.textAlign),...e.makeStyle({tt:t?.transform}),...l,...e.getGlobalColorStyle(t?.showMoreColor),...o(e=>!!t?.hasLineClamp&&void 0!==t.hasLineClamp[e]&&!t.hasLineClamp[e],"inline-flex")};return e.filterTruthyStyles(p)},exports.getMaxHeightStyleDefault=l,exports.getStaticCss=()=>{let e=`
2
2
  .gp-p-description-text > :not(ol, ul, table, div, style, script) {
3
3
  display: inline !important;
4
4
  }
@@ -7,6 +7,11 @@
7
7
  content: "";
8
8
  display: block; /* đảm bảo xuống d\xf2ng tr\xean Safari/iOS */
9
9
  }
10
+
11
+ .gp-p-description-text > :is(p, h1, h2, h3, h4, h5, h6, blockquote):not(:last-child)::after {
12
+ height: 1lh;
13
+ }
14
+
10
15
  .gp-p-description-text > table {
11
16
  box-shadow: none;
12
17
  }
@@ -14,4 +19,4 @@
14
19
  .p-description-wrapper.gp-p-description-text * {
15
20
  color: inherit;
16
21
  line-height: inherit !important;
17
- }`;return{gpDescriptionCss:e,textDescriptionCss:t}},exports.getTextStyle=({setting:t,renderMaxHeight:o})=>{let r=e.composeTypographyStyle(t?.typo,t?.typography),a={...e.getStyleShadow({value:t?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:t?.typo?.custom?.hasShadowText}),...e.makeStyleResponsive("ta",t?.textAlign),...e.getGlobalColorStyle(t?.color),...e.makeStyle({tt:t?.transform}),...r,...o&&l(t)};return e.filterTruthyStyles(a)};
22
+ }`;return{gpDescriptionCss:e,textDescriptionCss:t}},exports.getTextStyle=({setting:t,renderMaxHeight:o})=>{let p=e.composeTypographyStyle(t?.typo,t?.typography),r={...e.getStyleShadow({value:t?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:t?.typo?.custom?.hasShadowText}),...e.makeStyleResponsive("ta",t?.textAlign),...e.getGlobalColorStyle(t?.color),...e.makeStyle({tt:t?.transform}),...p,...o&&l(t)};return e.filterTruthyStyles(r)};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),s=require("../../../common/components/NoDataState.js"),l=require("../../../common/components/TooltipHover.js"),i=require("../../../text/components/Text.js"),a=require("@gem-sdk/system"),r=require("./common/styles.js"),o=require("./common/classes.js"),n=require("./hooks/useGpDiscountTag.js");exports.default=({setting:d,styles:u,builderProps:c,...p})=>{let{customContent:x}=d??{},m=p["bundle-item"],{textAlign:y}=u??{},{t:f}=t.useI18nStore(),{mode:g,product:j,salePrice:b,priceSave:h,currentProductId:q,unitCustomDisplay:C,shouldPlaceholderNoDiscount:S}=n.useGpDiscountTag({setting:d,styles:u,builderProps:c,...p});if(S)return e.jsx(l.default,{enable:!0,text:f("Not be displayed when published"),position:"bottom",width:"205px",children:e.jsx(s.default,{builderAttrs:c?.builderData,elementType:"secondary",description:f("No discount"),rawMode:!0,customClass:"!gp-p-[5px]"})});let v=a.createStyle(r.getWrapperTextStyle(u)),N=a.createStyle(r.getContainerStyle(u)),T=a.createClass(o.getWrapperTextClass(u)),k=a.createClass(o.getContainerClass()),D=a.createClass(o.getRootClass({mode:g,salePrice:b,priceSave:h,bundleItem:m}));return e.jsx("div",{className:D,style:{...t.makeStyleResponsive("ta",y)},id:`shopify-text-element-${c?.uid}`,"data-id":c?.uid,"data-product-id":q,"gp-data-hidden":"false",children:a.If(!j," ",e.jsx("div",{className:k,style:N,children:e.jsx("div",{className:T,style:v,children:e.jsxs("div",{className:"gp-flex gp-break-all",children:[e.jsx(i.default,{styles:u,setting:{...d,text:x?.prefix?.replaceAll(" "," "),options:{useState:!0,uniqueId:`${c?.uid}-prefix`},excludeFlex:!0}}),e.jsx(i.default,{styles:u,setting:{...d,text:C,options:{isCannotEditing:!0},excludeFlex:!0}}),e.jsx(i.default,{styles:u,setting:{...d,text:x?.suffix?.replaceAll(" "," "),excludeFlex:!0,options:{useState:!0,uniqueId:`${c?.uid}-suffix`}}})]})})}))})};
2
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("@gem-sdk/core"),s=require("../../../common/components/NoDataState.js"),l=require("../../../common/components/TooltipHover.js"),i=require("../../../text/components/Text.js"),r=require("@gem-sdk/system"),a=require("./common/styles.js"),o=require("./common/classes.js"),n=require("./hooks/useGpDiscountTag.js");exports.default=({setting:d,styles:u,builderProps:c,...p})=>{let{customContent:x}=d??{},m=p["bundle-item"],{textAlign:y}=u??{},{t:f}=t.useI18nStore(),{mode:g,product:j,salePrice:b,priceSave:h,currentProductId:q,unitCustomDisplay:C,shouldPlaceholderNoDiscount:S}=n.useGpDiscountTag({setting:d,styles:u,builderProps:c,...p});if(S)return e.jsx(l.default,{enable:!0,text:f("Not be displayed when published"),position:"bottom",width:"205px",children:e.jsx(s.default,{builderAttrs:c?.builderData,elementType:"secondary",description:f("No discount"),rawMode:!0,customClass:"!gp-p-[5px]"})});let v=r.createStyle(a.getWrapperTextStyle(u)),N=r.createStyle(a.getContainerStyle(u)),T=r.createClass(o.getWrapperTextClass(u)),k=r.createClass(o.getContainerClass()),D=r.createClass(o.getRootClass({mode:g,salePrice:b,priceSave:h,bundleItem:m}));return e.jsx("div",{className:D,style:{...t.makeStyleResponsive("ta",y)},id:`shopify-text-element-${c?.uid}`,"data-id":c?.uid,"data-product-id":q,"gp-data-hidden":"false",children:r.If(!j," ",e.jsx("div",{className:k,style:N,children:e.jsx("div",{className:T,style:v,children:e.jsxs("div",{className:"gp-flex gp-break-all gp-items-center",children:[e.jsx(i.default,{styles:u,setting:{...d,text:x?.prefix?.replaceAll(" "," "),options:{useState:!0,uniqueId:`${c?.uid}-prefix`},excludeFlex:!0}}),e.jsx(i.default,{styles:u,setting:{...d,text:C,options:{isCannotEditing:!0},excludeFlex:!0}}),e.jsx(i.default,{styles:u,setting:{...d,text:x?.suffix?.replaceAll(" "," "),excludeFlex:!0,options:{useState:!0,uniqueId:`${c?.uid}-suffix`}}})]})})}))})};
@@ -1,4 +1,4 @@
1
- import{composeTypographyStyle as t,makeStyle as e,getGlobalColorStyle as o,makeStyleResponsive as l,getStyleShadow as i,filterTruthyStyles as n,getResponsiveValueByScreen as a}from"@gem-sdk/core";let p=["desktop","mobile","tablet"],r=(t,e)=>{let o={};return p.forEach(l=>{o={...o,[`--d${"desktop"===l?"":`-${l}`}`]:`${t(l)?"none":e}`}}),o},s=({setting:a,renderMaxHeight:p})=>{let r=t(a?.typo,a?.typography),s={...i({value:a?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:a?.typo?.custom?.hasShadowText}),...l("ta",a?.textAlign),...o(a?.color),...e({tt:a?.transform}),...r,...p&&c(a)};return n(s)},d=({setting:i})=>{let a=t(i?.typo,i?.typography),p={...l("jc",i?.textAlign),...e({tt:i?.transform}),...a,...o(i?.showMoreColor),...r(t=>!!i?.hasLineClamp&&void 0!==i.hasLineClamp[t]&&!i.hasLineClamp[t],"inline-flex")};return n(p)},h=()=>{let t=`
1
+ import{composeTypographyStyle as t,makeStyle as e,getGlobalColorStyle as o,makeStyleResponsive as l,getStyleShadow as i,filterTruthyStyles as n,getResponsiveValueByScreen as p}from"@gem-sdk/core";let a=["desktop","mobile","tablet"],r=(t,e)=>{let o={};return a.forEach(l=>{o={...o,[`--d${"desktop"===l?"":`-${l}`}`]:`${t(l)?"none":e}`}}),o},s=({setting:p,renderMaxHeight:a})=>{let r=t(p?.typo,p?.typography),s={...i({value:p?.typo?.custom?.textShadow,styleAppliedFor:"text-shadow",isEnableShadow:p?.typo?.custom?.hasShadowText}),...l("ta",p?.textAlign),...o(p?.color),...e({tt:p?.transform}),...r,...a&&c(p)};return n(s)},h=({setting:i})=>{let p=t(i?.typo,i?.typography),a={...l("jc",i?.textAlign),...e({tt:i?.transform}),...p,...o(i?.showMoreColor),...r(t=>!!i?.hasLineClamp&&void 0!==i.hasLineClamp[t]&&!i.hasLineClamp[t],"inline-flex")};return n(a)},d=()=>{let t=`
2
2
  .gp-p-description-text > :not(ol, ul, table, div, style, script) {
3
3
  display: inline !important;
4
4
  }
@@ -7,6 +7,11 @@ import{composeTypographyStyle as t,makeStyle as e,getGlobalColorStyle as o,makeS
7
7
  content: "";
8
8
  display: block; /* đảm bảo xuống d\xf2ng tr\xean Safari/iOS */
9
9
  }
10
+
11
+ .gp-p-description-text > :is(p, h1, h2, h3, h4, h5, h6, blockquote):not(:last-child)::after {
12
+ height: 1lh;
13
+ }
14
+
10
15
  .gp-p-description-text > table {
11
16
  box-shadow: none;
12
17
  }
@@ -14,4 +19,4 @@ import{composeTypographyStyle as t,makeStyle as e,getGlobalColorStyle as o,makeS
14
19
  .p-description-wrapper.gp-p-description-text * {
15
20
  color: inherit;
16
21
  line-height: inherit !important;
17
- }`;return{gpDescriptionCss:t,textDescriptionCss:e}},c=t=>{let e={desktop:"none"};return["desktop","mobile","tablet"].forEach(o=>{let l=a(t?.lineClamp,o),i=a(t?.hasLineClamp,o);i&&l?e[o]=`calc(${l} * 1lh)`:e[o]="none"}),{...l("maxh",e)}};export{d as getButtonStyle,c as getMaxHeightStyleDefault,h as getStaticCss,s as getTextStyle};
22
+ }`;return{gpDescriptionCss:t,textDescriptionCss:e}},c=t=>{let e={desktop:"none"};return["desktop","mobile","tablet"].forEach(o=>{let l=p(t?.lineClamp,o),i=p(t?.hasLineClamp,o);i&&l?e[o]=`calc(${l} * 1lh)`:e[o]="none"}),{...l("maxh",e)}};export{h as getButtonStyle,c as getMaxHeightStyleDefault,d as getStaticCss,s as getTextStyle};
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useI18nStore as s,makeStyleResponsive as o}from"@gem-sdk/core";import i from"../../../common/components/NoDataState.js";import l from"../../../common/components/TooltipHover.js";import r from"../../../text/components/Text.js";import{createStyle as d,createClass as m,If as n}from"@gem-sdk/system";import{getWrapperTextStyle as a,getContainerStyle as p}from"./common/styles.js";import{getWrapperTextClass as c,getContainerClass as u,getRootClass as x}from"./common/classes.js";import{useGpDiscountTag as f}from"./hooks/useGpDiscountTag.js";let g=({setting:g,styles:y,builderProps:h,...b})=>{let{customContent:j}=g??{},N=b["bundle-item"],{textAlign:v}=y??{},{t:T}=s(),{mode:k,product:w,salePrice:A,priceSave:D,currentProductId:F,unitCustomDisplay:S,shouldPlaceholderNoDiscount:$}=f({setting:g,styles:y,builderProps:h,...b});if($)return e(l,{enable:!0,text:T("Not be displayed when published"),position:"bottom",width:"205px",children:e(i,{builderAttrs:h?.builderData,elementType:"secondary",description:T("No discount"),rawMode:!0,customClass:"!gp-p-[5px]"})});let q=d(a(y)),C=d(p(y)),I=m(c(y)),E=m(u()),G=m(x({mode:k,salePrice:A,priceSave:D,bundleItem:N}));return e("div",{className:G,style:{...o("ta",v)},id:`shopify-text-element-${h?.uid}`,"data-id":h?.uid,"data-product-id":F,"gp-data-hidden":"false",children:n(!w," ",e("div",{className:E,style:C,children:e("div",{className:I,style:q,children:t("div",{className:"gp-flex gp-break-all",children:[e(r,{styles:y,setting:{...g,text:j?.prefix?.replaceAll(" "," "),options:{useState:!0,uniqueId:`${h?.uid}-prefix`},excludeFlex:!0}}),e(r,{styles:y,setting:{...g,text:S,options:{isCannotEditing:!0},excludeFlex:!0}}),e(r,{styles:y,setting:{...g,text:j?.suffix?.replaceAll(" "," "),excludeFlex:!0,options:{useState:!0,uniqueId:`${h?.uid}-suffix`}}})]})})}))})};export{g as default};
2
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useI18nStore as s,makeStyleResponsive as o}from"@gem-sdk/core";import i from"../../../common/components/NoDataState.js";import l from"../../../common/components/TooltipHover.js";import r from"../../../text/components/Text.js";import{createStyle as d,createClass as m,If as n}from"@gem-sdk/system";import{getWrapperTextStyle as a,getContainerStyle as p}from"./common/styles.js";import{getWrapperTextClass as c,getContainerClass as u,getRootClass as x}from"./common/classes.js";import{useGpDiscountTag as f}from"./hooks/useGpDiscountTag.js";let g=({setting:g,styles:y,builderProps:h,...b})=>{let{customContent:j}=g??{},N=b["bundle-item"],{textAlign:v}=y??{},{t:T}=s(),{mode:k,product:w,salePrice:A,priceSave:D,currentProductId:F,unitCustomDisplay:S,shouldPlaceholderNoDiscount:$}=f({setting:g,styles:y,builderProps:h,...b});if($)return e(l,{enable:!0,text:T("Not be displayed when published"),position:"bottom",width:"205px",children:e(i,{builderAttrs:h?.builderData,elementType:"secondary",description:T("No discount"),rawMode:!0,customClass:"!gp-p-[5px]"})});let q=d(a(y)),C=d(p(y)),I=m(c(y)),E=m(u()),G=m(x({mode:k,salePrice:A,priceSave:D,bundleItem:N}));return e("div",{className:G,style:{...o("ta",v)},id:`shopify-text-element-${h?.uid}`,"data-id":h?.uid,"data-product-id":F,"gp-data-hidden":"false",children:n(!w," ",e("div",{className:E,style:C,children:e("div",{className:I,style:q,children:t("div",{className:"gp-flex gp-break-all gp-items-center",children:[e(r,{styles:y,setting:{...g,text:j?.prefix?.replaceAll(" "," "),options:{useState:!0,uniqueId:`${h?.uid}-prefix`},excludeFlex:!0}}),e(r,{styles:y,setting:{...g,text:S,options:{isCannotEditing:!0},excludeFlex:!0}}),e(r,{styles:y,setting:{...g,text:j?.suffix?.replaceAll(" "," "),excludeFlex:!0,options:{useState:!0,uniqueId:`${h?.uid}-suffix`}}})]})})}))})};export{g as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "19.1.0-staging.1",
3
+ "version": "19.1.0-staging.3",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",