@gem-sdk/core 1.14.0-dev.324 → 1.14.0-dev.327
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.
- package/dist/cjs/components/theme-section/CreateThemeSection.js +1 -1
- package/dist/cjs/components/theme-section/ThemeSectionStatus.js +1 -1
- package/dist/cjs/components/theme-section/ThemeSectionTooltip.js +1 -1
- package/dist/cjs/helpers/typography.js +11 -11
- package/dist/esm/components/theme-section/CreateThemeSection.js +1 -1
- package/dist/esm/components/theme-section/ThemeSectionStatus.js +1 -1
- package/dist/esm/components/theme-section/ThemeSectionTooltip.js +1 -1
- package/dist/esm/helpers/typography.js +9 -9
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),ThemeSectionTooltip=require("./ThemeSectionTooltip.js");require("zustand");var ShopContext=require("../../contexts/ShopContext.js");require("@gem-sdk/adapter-shopify"),require("swr"),require("swr/mutation"),require("vanilla-lazyload"),require("../../hooks/useCartUI.js"),require("../../helpers/convert.js");const SHOW_TOOLTIP_TIMEOUT=600,NUMBER_OF_THEME_SECTION_CREATED_TO_SHOW_TOOLTIP=1,LIMIT_PLANS=["trial","trial2022"],CreateThemeSection=({...e})=>{let t=e.isThemeSection,i=ShopContext.useShopStore(e=>e.plan),r=ShopContext.useShopStore(e=>e.createThemeSectionCount),o=LIMIT_PLANS.includes(i??""),n="Section"===e.tag&&!t,s=o||void 0===r||r<1,a=react.useRef(),[u,c]=react.useState(!1),l=()=>{s&&(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{c(!0)},600))},d=()=>{s&&(a.current&&clearTimeout(a.current),c(!1))},h=(e,t)=>{e.preventDefault(),e.stopPropagation(),t?.disabled||(o?m():x(),a.current&&clearTimeout(a.current),c(!1))},m=()=>{let e=new CustomEvent("editor:toolbar:upgrade",{bubbles:!0});window.dispatchEvent(e)},x=()=>{let t=new CustomEvent("editor:toolbar:create-theme-section",{bubbles:!0,detail:{componentUid:e.uid}});window.dispatchEvent(t)};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(ThemeSectionTooltip.ThemeSectionTooltip,{isLimit:o,isShow:u,isRender:s,onActions:h,onMouseEnter:l,onMouseLeave:d,children:[n&&s&&jsxRuntime.jsx("div",{"data-toolbar-create-theme-section":!0,children:"You can create reusable sections"}),n&&jsxRuntime.jsx("div",{"data-toolbar-active-create-theme-section-wrapper":!0,children:jsxRuntime.jsxs("div",{"data-toolbar-active-create-theme-section":!0,onClick:e=>h(e,{disabled:o}),"aria-hidden":"true",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("path",{d:"M1 2C1 1.44772 1.44772 1 2 1H6C6.55228 1 7 1.44772 7 2V6C7 6.55228 6.55228 7 6 7H2C1.44772 7 1 6.55228 1 6V2Z",fill:"#F9F9F9"}),jsxRuntime.jsx("path",{d:"M9 10C9 9.44772 9.44772 9 10 9H14C14.5523 9 15 9.44772 15 10V14C15 14.5523 14.5523 15 14 15H10C9.44772 15 9 14.5523 9 14V10Z",fill:"#F9F9F9"}),jsxRuntime.jsx("path",{d:"M2 9C1.44772 9 1 9.44772 1 10V14C1 14.5523 1.44772 15 2 15H6C6.55228 15 7 14.5523 7 14V10C7 9.44772 6.55228 9 6 9H2Z",fill:"#F9F9F9"})]}),jsxRuntime.jsx("p",{children:"Create Theme
|
|
1
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),ThemeSectionTooltip=require("./ThemeSectionTooltip.js");require("zustand");var ShopContext=require("../../contexts/ShopContext.js");require("@gem-sdk/adapter-shopify"),require("swr"),require("swr/mutation"),require("vanilla-lazyload"),require("../../hooks/useCartUI.js"),require("../../helpers/convert.js");const SHOW_TOOLTIP_TIMEOUT=600,NUMBER_OF_THEME_SECTION_CREATED_TO_SHOW_TOOLTIP=1,LIMIT_PLANS=["trial","trial2022"],CreateThemeSection=({...e})=>{let t=e.isThemeSection,i=ShopContext.useShopStore(e=>e.plan),r=ShopContext.useShopStore(e=>e.createThemeSectionCount),o=LIMIT_PLANS.includes(i??""),n="Section"===e.tag&&!t,s=o||void 0===r||r<1,a=react.useRef(),[u,c]=react.useState(!1),l=()=>{s&&(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{c(!0)},600))},d=()=>{s&&(a.current&&clearTimeout(a.current),c(!1))},h=(e,t)=>{e.preventDefault(),e.stopPropagation(),t?.disabled||(o?m():x(),a.current&&clearTimeout(a.current),c(!1))},m=()=>{let e=new CustomEvent("editor:toolbar:upgrade",{bubbles:!0});window.dispatchEvent(e)},x=()=>{let t=new CustomEvent("editor:toolbar:create-theme-section",{bubbles:!0,detail:{componentUid:e.uid}});window.dispatchEvent(t)};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs(ThemeSectionTooltip.ThemeSectionTooltip,{isLimit:o,isShow:u,isRender:s,onActions:h,onMouseEnter:l,onMouseLeave:d,children:[n&&s&&jsxRuntime.jsx("div",{"data-toolbar-create-theme-section":!0,children:"You can create reusable sections"}),n&&jsxRuntime.jsx("div",{"data-toolbar-active-create-theme-section-wrapper":!0,children:jsxRuntime.jsxs("div",{"data-toolbar-active-create-theme-section":!0,onClick:e=>h(e,{disabled:o}),"aria-hidden":"true",children:[jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[jsxRuntime.jsx("path",{d:"M1 2C1 1.44772 1.44772 1 2 1H6C6.55228 1 7 1.44772 7 2V6C7 6.55228 6.55228 7 6 7H2C1.44772 7 1 6.55228 1 6V2Z",fill:"#F9F9F9"}),jsxRuntime.jsx("path",{d:"M9 10C9 9.44772 9.44772 9 10 9H14C14.5523 9 15 9.44772 15 10V14C15 14.5523 14.5523 15 14 15H10C9.44772 15 9 14.5523 9 14V10Z",fill:"#F9F9F9"}),jsxRuntime.jsx("path",{d:"M2 9C1.44772 9 1 9.44772 1 10V14C1 14.5523 1.44772 15 2 15H6C6.55228 15 7 14.5523 7 14V10C7 9.44772 6.55228 9 6 9H2Z",fill:"#F9F9F9"})]}),jsxRuntime.jsx("p",{children:"Create Theme Section"})]})})]})})};exports.CreateThemeSection=CreateThemeSection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime");const ThemeSectionStatus=({...e})=>{let t="Section"===e.tag&&e?.isThemeSection&&e?.needPublishing;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:t&&jsxRuntime.jsxs("div",{"data-theme-section-status":!0,children:[jsxRuntime.jsx("div",{"data-theme-section-status-icon":!0,children:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM8.4668 4.61597C8.4668 4.89211 8.24294 5.11597 7.9668 5.11597C7.69065 5.11597 7.4668 4.89211 7.4668 4.61597C7.4668 4.33982 7.69065 4.11597 7.9668 4.11597C8.24294 4.11597 8.4668 4.33982 8.4668 4.61597ZM6.91309 5.48633C6.63694 5.48633 6.41309 5.71019 6.41309 5.98633C6.41309 6.26247 6.63694 6.48633 6.91309 6.48633H7.56006V10.3839C7.56006 10.9362 8.00777 11.3839 8.56006 11.3839H9.57144C9.84758 11.3839 10.0714 11.1601 10.0714 10.8839C10.0714 10.6078 9.84758 10.3839 9.57144 10.3839H8.56006V6.48633C8.56006 5.93404 8.11234 5.48633 7.56006 5.48633H6.91309Z",fill:"#9144DA"})})}),jsxRuntime.jsx("span",{"data-theme-section-status-text":!0,children:"Need to republish. Go to global edit
|
|
1
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime");const ThemeSectionStatus=({...e})=>{let t="Section"===e.tag&&e?.isThemeSection&&e?.needPublishing;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:t&&jsxRuntime.jsxs("div",{"data-theme-section-status":!0,children:[jsxRuntime.jsx("div",{"data-theme-section-status-icon":!0,children:jsxRuntime.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:jsxRuntime.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM8.4668 4.61597C8.4668 4.89211 8.24294 5.11597 7.9668 5.11597C7.69065 5.11597 7.4668 4.89211 7.4668 4.61597C7.4668 4.33982 7.69065 4.11597 7.9668 4.11597C8.24294 4.11597 8.4668 4.33982 8.4668 4.61597ZM6.91309 5.48633C6.63694 5.48633 6.41309 5.71019 6.41309 5.98633C6.41309 6.26247 6.63694 6.48633 6.91309 6.48633H7.56006V10.3839C7.56006 10.9362 8.00777 11.3839 8.56006 11.3839H9.57144C9.84758 11.3839 10.0714 11.1601 10.0714 10.8839C10.0714 10.6078 9.84758 10.3839 9.57144 10.3839H8.56006V6.48633C8.56006 5.93404 8.11234 5.48633 7.56006 5.48633H6.91309Z",fill:"#9144DA"})})}),jsxRuntime.jsx("span",{"data-theme-section-status-text":!0,children:"Need to republish. Go to global edit and publish this section"})]})})};exports.ThemeSectionStatus=ThemeSectionStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),reactTransitionGroup=require("react-transition-group"),core=require("@gem-sdk/core");const TRANSITION_DURATION=350,defaultStyles={transition:"opacity 350ms ease-out",opacity:0},transitions={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0},unmounted:{opacity:0}},ThemeSectionTooltip=({isShow:e,isLimit:t,isRender:i,children:o,onMouseEnter:n,onMouseLeave:s,onActions:a})=>{let c=react.useRef(null),r=()=>{window.open("index","_blank")};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"theme-section-tooltip-wrapper",onMouseEnter:n,onMouseLeave:s,children:[o,i&&jsxRuntime.jsx(reactTransitionGroup.Transition,{in:e,timeout:350,nodeRef:c,unmountOnExit:!0,children:e=>jsxRuntime.jsxs("div",{className:"theme-section-tooltip",ref:c,style:{...defaultStyles,...transitions[e]},children:[jsxRuntime.jsx("div",{className:"theme-section-tooltip__image",children:jsxRuntime.jsx("img",{src:"https://ucarecdn.com/6a9f408a-aa8c-434a-890b-81067a14aceb/-/format/auto/-/preview/1920x1920/-/quality/lighter/theme-section-illustration.png",alt:""})}),jsxRuntime.jsxs("div",{className:"theme-section-tooltip__body",children:[jsxRuntime.jsx("div",{className:"theme-section-tooltip__body-title",children:"Create once, use everywhere with Theme
|
|
1
|
+
"use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),reactTransitionGroup=require("react-transition-group"),core=require("@gem-sdk/core");const TRANSITION_DURATION=350,defaultStyles={transition:"opacity 350ms ease-out",opacity:0},transitions={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0},unmounted:{opacity:0}},ThemeSectionTooltip=({isShow:e,isLimit:t,isRender:i,children:o,onMouseEnter:n,onMouseLeave:s,onActions:a})=>{let c=react.useRef(null),r=()=>{window.open("index","_blank")};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsxs("div",{className:"theme-section-tooltip-wrapper",onMouseEnter:n,onMouseLeave:s,children:[o,i&&jsxRuntime.jsx(reactTransitionGroup.Transition,{in:e,timeout:350,nodeRef:c,unmountOnExit:!0,children:e=>jsxRuntime.jsxs("div",{className:"theme-section-tooltip",ref:c,style:{...defaultStyles,...transitions[e]},children:[jsxRuntime.jsx("div",{className:"theme-section-tooltip__image",children:jsxRuntime.jsx("img",{src:"https://ucarecdn.com/6a9f408a-aa8c-434a-890b-81067a14aceb/-/format/auto/-/preview/1920x1920/-/quality/lighter/theme-section-illustration.png",alt:""})}),jsxRuntime.jsxs("div",{className:"theme-section-tooltip__body",children:[jsxRuntime.jsx("div",{className:"theme-section-tooltip__body-title",children:"Create once, use everywhere with Theme Section"}),jsxRuntime.jsx("div",{className:"theme-section-tooltip__body-desc",children:"A global section that can be used on all your GemPages & Shopify pages."})]}),jsxRuntime.jsxs("div",{className:core.cls("theme-section-tooltip__action",{"theme-section-tooltip__action-limit":t}),children:[jsxRuntime.jsx("button",{onClick:e=>a(e),children:t?"Upgrade to create Theme Section":"Create Theme Section"}),t&&jsxRuntime.jsx("div",{onClick:r,"aria-hidden":!0,className:"theme-section-tooltip__action-learn-more",children:"Learn more about Theme Section"})]})]})})]})})};exports.ThemeSectionTooltip=ThemeSectionTooltip;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";var colors=require("./colors.js"),makeStyle=require("./make-style.js");const genTypoClass=e=>`g-${e}`,composeTypographyCss=e=>{let o=e?.custom,{fontFamily:t,fontSize:s,fontStyle:p,fontWeight:y,lineHeight:r,letterSpacing:
|
|
1
|
+
"use strict";var colors=require("./colors.js"),makeStyle=require("./make-style.js");const genTypoClass=e=>`g-${e}`,composeTypographyCss=e=>{let o=e?.custom,{fontFamily:t,fontSize:s,fontStyle:p,fontWeight:y,lineHeight:r,letterSpacing:a}=o?.desktop??{};return`
|
|
2
2
|
${t?`font-family: var(--g-font-${t}, ${t});`:""}
|
|
3
3
|
${s?`font-size: ${s};`:""}
|
|
4
4
|
${p?`font-style: ${p};`:""}
|
|
5
5
|
${y?`font-weight: ${y};`:""}
|
|
6
|
-
${
|
|
6
|
+
${a?`letter-spacing: ${a};`:""}
|
|
7
7
|
${r?`line-height: ${r};`:""}
|
|
8
|
-
`},composeTypographyV2Css=e=>{let
|
|
9
|
-
${
|
|
10
|
-
${
|
|
11
|
-
${
|
|
12
|
-
${
|
|
13
|
-
${
|
|
14
|
-
${
|
|
15
|
-
${
|
|
16
|
-
${
|
|
8
|
+
`},composeTypographyV2Css=(e,o)=>{let t=e?.custom,{fontFamily:s,fontSize:p,fontWeight:y,lineHeight:r,letterSpacing:a}=t??{},l=e?.attrs,{bold:i,italic:n,underline:m,transform:g}=l??{},c=o?"!important":"";return`
|
|
9
|
+
${s?`font-family: var(--g-font-${s}, ${s})${c};`:""}
|
|
10
|
+
${p?.desktop?`font-size: ${p?.desktop}${c};`:""}
|
|
11
|
+
${i?"font-weight: bold;":y?`font-weight: ${y}${c};`:""}
|
|
12
|
+
${a?`letter-spacing: ${a}${c};`:""}
|
|
13
|
+
${r?`line-height: ${r}${c};`:""}
|
|
14
|
+
${n?`font-style: italic${c};`:""}
|
|
15
|
+
${m?`text-decoration-line: underline${c};`:""}
|
|
16
|
+
${g?`text-transform: ${g}${c};`:""}
|
|
17
17
|
`};function getCustomCSSByDevice(e,o){if(!e||!o)return{};let t="desktop"!==o&&o?`-${o}`:"",{fontFamily:s}=e?.[o]??{};return{[`--size${t}`]:e?.[o]?.fontSize,[`--lh${t}`]:e?.[o]?.lineHeight,[`--fs${t}`]:e?.[o]?.fontStyle,[`--ff${t}`]:s?`var(--g-font-${s}, ${s})`:void 0,[`--weight${t}`]:e?.[o]?.fontWeight,[`--ls${t}`]:e?.[o]?.letterSpacing}}const composeTypography=e=>e?makeStyle.removeNullUndefined({...getCustomCSSByDevice(e,"desktop"),...getCustomCSSByDevice(e,"tablet"),...getCustomCSSByDevice(e,"mobile")}):{},composeTypographyV2=(e,o)=>e?makeStyle.removeNullUndefined({...makeStyle.makeStyle({fs:o?.italic?void 0:e?.fontStyle,ff:e?.fontFamily?`var(--g-font-${e.fontFamily.replace(/ /g,"-")}, ${e.fontFamily})`:void 0,weight:o?.bold?void 0:e?.fontWeight,ls:e?.letterSpacing,lh:e?.lineHeight}),...makeStyle.makeStyleResponsive("size",e?.fontSize)}):{},composeTypographyAttr=e=>e?makeStyle.removeNullUndefined({...makeStyle.makeStyle({fs:e?.italic?"italic":void 0,weight:e?.bold?"bold":void 0,c:colors.getSingleColorVariable(e?.color),tt:e?.transform,tdl:e?.underline?"underline":void 0})}):{},composeTypographyClassName=(e,o)=>e?e?.type&&!e.custom?genTypoClass(e.type):"":o?.type&&genTypoClass(o?.type),composeTypographyStyle=(e,o,t)=>e?{...composeTypographyV2(e.custom,e.attrs),...!t&&composeTypographyAttr(e.attrs)}:{...o?.type?{}:composeTypography(o?.custom)};exports.composeTypography=composeTypography,exports.composeTypographyAttr=composeTypographyAttr,exports.composeTypographyClassName=composeTypographyClassName,exports.composeTypographyCss=composeTypographyCss,exports.composeTypographyStyle=composeTypographyStyle,exports.composeTypographyV2=composeTypographyV2,exports.composeTypographyV2Css=composeTypographyV2Css,exports.genTypoClass=genTypoClass;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import{useRef as i,useState as o}from"react";import{ThemeSectionTooltip as n}from"./ThemeSectionTooltip.js";import"zustand";import{useShopStore as a}from"../../contexts/ShopContext.js";import"@gem-sdk/adapter-shopify";import"swr";import"swr/mutation";import"vanilla-lazyload";import"../../hooks/useCartUI.js";import"../../helpers/convert.js";let SHOW_TOOLTIP_TIMEOUT=600,NUMBER_OF_THEME_SECTION_CREATED_TO_SHOW_TOOLTIP=1,LIMIT_PLANS=["trial","trial2022"],CreateThemeSection=({...c})=>{let l=c.isThemeSection,
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as r}from"react/jsx-runtime";import{useRef as i,useState as o}from"react";import{ThemeSectionTooltip as n}from"./ThemeSectionTooltip.js";import"zustand";import{useShopStore as a}from"../../contexts/ShopContext.js";import"@gem-sdk/adapter-shopify";import"swr";import"swr/mutation";import"vanilla-lazyload";import"../../hooks/useCartUI.js";import"../../helpers/convert.js";let SHOW_TOOLTIP_TIMEOUT=600,NUMBER_OF_THEME_SECTION_CREATED_TO_SHOW_TOOLTIP=1,LIMIT_PLANS=["trial","trial2022"],CreateThemeSection=({...c})=>{let l=c.isThemeSection,d=a(e=>e.plan),s=a(e=>e.createThemeSectionCount),m=LIMIT_PLANS.includes(d??""),h="Section"===c.tag&&!l,p=m||void 0===s||s<1,u=i(),[C,T]=o(!1),v=()=>{p&&(u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{T(!0)},600))},b=()=>{p&&(u.current&&clearTimeout(u.current),T(!1))},S=(e,t)=>{e.preventDefault(),e.stopPropagation(),t?.disabled||(m?w():E(),u.current&&clearTimeout(u.current),T(!1))},w=()=>{let e=new CustomEvent("editor:toolbar:upgrade",{bubbles:!0});window.dispatchEvent(e)},E=()=>{let e=new CustomEvent("editor:toolbar:create-theme-section",{bubbles:!0,detail:{componentUid:c.uid}});window.dispatchEvent(e)};return e(t,{children:r(n,{isLimit:m,isShow:C,isRender:p,onActions:S,onMouseEnter:v,onMouseLeave:b,children:[h&&p&&e("div",{"data-toolbar-create-theme-section":!0,children:"You can create reusable sections"}),h&&e("div",{"data-toolbar-active-create-theme-section-wrapper":!0,children:r("div",{"data-toolbar-active-create-theme-section":!0,onClick:e=>S(e,{disabled:m}),"aria-hidden":"true",children:[r("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[e("path",{d:"M1 2C1 1.44772 1.44772 1 2 1H6C6.55228 1 7 1.44772 7 2V6C7 6.55228 6.55228 7 6 7H2C1.44772 7 1 6.55228 1 6V2Z",fill:"#F9F9F9"}),e("path",{d:"M9 10C9 9.44772 9.44772 9 10 9H14C14.5523 9 15 9.44772 15 10V14C15 14.5523 14.5523 15 14 15H10C9.44772 15 9 14.5523 9 14V10Z",fill:"#F9F9F9"}),e("path",{d:"M2 9C1.44772 9 1 9.44772 1 10V14C1 14.5523 1.44772 15 2 15H6C6.55228 15 7 14.5523 7 14V10C7 9.44772 6.55228 9 6 9H2Z",fill:"#F9F9F9"})]}),e("p",{children:"Create Theme Section"})]})})]})})};export{CreateThemeSection};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";let ThemeSectionStatus=({...n})=>{let l="Section"===n.tag&&n?.isThemeSection&&n?.needPublishing;return e(t,{children:l&&i("div",{"data-theme-section-status":!0,children:[e("div",{"data-theme-section-status-icon":!0,children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM8.4668 4.61597C8.4668 4.89211 8.24294 5.11597 7.9668 5.11597C7.69065 5.11597 7.4668 4.89211 7.4668 4.61597C7.4668 4.33982 7.69065 4.11597 7.9668 4.11597C8.24294 4.11597 8.4668 4.33982 8.4668 4.61597ZM6.91309 5.48633C6.63694 5.48633 6.41309 5.71019 6.41309 5.98633C6.41309 6.26247 6.63694 6.48633 6.91309 6.48633H7.56006V10.3839C7.56006 10.9362 8.00777 11.3839 8.56006 11.3839H9.57144C9.84758 11.3839 10.0714 11.1601 10.0714 10.8839C10.0714 10.6078 9.84758 10.3839 9.57144 10.3839H8.56006V6.48633C8.56006 5.93404 8.11234 5.48633 7.56006 5.48633H6.91309Z",fill:"#9144DA"})})}),e("span",{"data-theme-section-status-text":!0,children:"Need to republish. Go to global edit
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";let ThemeSectionStatus=({...n})=>{let l="Section"===n.tag&&n?.isThemeSection&&n?.needPublishing;return e(t,{children:l&&i("div",{"data-theme-section-status":!0,children:[e("div",{"data-theme-section-status-icon":!0,children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM8.4668 4.61597C8.4668 4.89211 8.24294 5.11597 7.9668 5.11597C7.69065 5.11597 7.4668 4.89211 7.4668 4.61597C7.4668 4.33982 7.69065 4.11597 7.9668 4.11597C8.24294 4.11597 8.4668 4.33982 8.4668 4.61597ZM6.91309 5.48633C6.63694 5.48633 6.41309 5.71019 6.41309 5.98633C6.41309 6.26247 6.63694 6.48633 6.91309 6.48633H7.56006V10.3839C7.56006 10.9362 8.00777 11.3839 8.56006 11.3839H9.57144C9.84758 11.3839 10.0714 11.1601 10.0714 10.8839C10.0714 10.6078 9.84758 10.3839 9.57144 10.3839H8.56006V6.48633C8.56006 5.93404 8.11234 5.48633 7.56006 5.48633H6.91309Z",fill:"#9144DA"})})}),e("span",{"data-theme-section-status-text":!0,children:"Need to republish. Go to global edit and publish this section"})]})})};export{ThemeSectionStatus};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import{useRef as o}from"react";import{Transition as n}from"react-transition-group";import{cls as a}from"@gem-sdk/core";let TRANSITION_DURATION=350,defaultStyles={transition:"opacity 350ms ease-out",opacity:0},transitions={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0},unmounted:{opacity:0}},ThemeSectionTooltip=({isShow:c,isLimit:r,isRender:l,children:s,onMouseEnter:m,onMouseLeave:d,onActions:h})=>{let p=o(null),u=()=>{window.open("index","_blank")};return e(t,{children:i("div",{className:"theme-section-tooltip-wrapper",onMouseEnter:m,onMouseLeave:d,children:[s,l&&e(n,{in:c,timeout:350,nodeRef:p,unmountOnExit:!0,children:t=>i("div",{className:"theme-section-tooltip",ref:p,style:{...defaultStyles,...transitions[t]},children:[e("div",{className:"theme-section-tooltip__image",children:e("img",{src:"https://ucarecdn.com/6a9f408a-aa8c-434a-890b-81067a14aceb/-/format/auto/-/preview/1920x1920/-/quality/lighter/theme-section-illustration.png",alt:""})}),i("div",{className:"theme-section-tooltip__body",children:[e("div",{className:"theme-section-tooltip__body-title",children:"Create once, use everywhere with Theme
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import{useRef as o}from"react";import{Transition as n}from"react-transition-group";import{cls as a}from"@gem-sdk/core";let TRANSITION_DURATION=350,defaultStyles={transition:"opacity 350ms ease-out",opacity:0},transitions={entering:{opacity:1},entered:{opacity:1},exiting:{opacity:0},exited:{opacity:0},unmounted:{opacity:0}},ThemeSectionTooltip=({isShow:c,isLimit:r,isRender:l,children:s,onMouseEnter:m,onMouseLeave:d,onActions:h})=>{let p=o(null),u=()=>{window.open("index","_blank")};return e(t,{children:i("div",{className:"theme-section-tooltip-wrapper",onMouseEnter:m,onMouseLeave:d,children:[s,l&&e(n,{in:c,timeout:350,nodeRef:p,unmountOnExit:!0,children:t=>i("div",{className:"theme-section-tooltip",ref:p,style:{...defaultStyles,...transitions[t]},children:[e("div",{className:"theme-section-tooltip__image",children:e("img",{src:"https://ucarecdn.com/6a9f408a-aa8c-434a-890b-81067a14aceb/-/format/auto/-/preview/1920x1920/-/quality/lighter/theme-section-illustration.png",alt:""})}),i("div",{className:"theme-section-tooltip__body",children:[e("div",{className:"theme-section-tooltip__body-title",children:"Create once, use everywhere with Theme Section"}),e("div",{className:"theme-section-tooltip__body-desc",children:"A global section that can be used on all your GemPages & Shopify pages."})]}),i("div",{className:a("theme-section-tooltip__action",{"theme-section-tooltip__action-limit":r}),children:[e("button",{onClick:e=>h(e),children:r?"Upgrade to create Theme Section":"Create Theme Section"}),r&&e("div",{onClick:u,"aria-hidden":!0,className:"theme-section-tooltip__action-learn-more",children:"Learn more about Theme Section"})]})]})})]})})};export{ThemeSectionTooltip};
|
|
@@ -5,13 +5,13 @@ import{getSingleColorVariable as o}from"./colors.js";import{removeNullUndefined
|
|
|
5
5
|
${i?`font-weight: ${i};`:""}
|
|
6
6
|
${r?`letter-spacing: ${r};`:""}
|
|
7
7
|
${y?`line-height: ${y};`:""}
|
|
8
|
-
`},composeTypographyV2Css=o=>{let
|
|
9
|
-
${
|
|
10
|
-
${
|
|
11
|
-
${
|
|
12
|
-
${
|
|
13
|
-
${
|
|
14
|
-
${
|
|
15
|
-
${
|
|
16
|
-
${g?`text-transform: ${g};`:""}
|
|
8
|
+
`},composeTypographyV2Css=(o,t)=>{let e=o?.custom,{fontFamily:p,fontSize:s,fontWeight:i,lineHeight:y,letterSpacing:r}=e??{},l=o?.attrs,{bold:a,italic:n,underline:$,transform:g}=l??{},m=t?"!important":"";return`
|
|
9
|
+
${p?`font-family: var(--g-font-${p}, ${p})${m};`:""}
|
|
10
|
+
${s?.desktop?`font-size: ${s?.desktop}${m};`:""}
|
|
11
|
+
${a?"font-weight: bold;":i?`font-weight: ${i}${m};`:""}
|
|
12
|
+
${r?`letter-spacing: ${r}${m};`:""}
|
|
13
|
+
${y?`line-height: ${y}${m};`:""}
|
|
14
|
+
${n?`font-style: italic${m};`:""}
|
|
15
|
+
${$?`text-decoration-line: underline${m};`:""}
|
|
16
|
+
${g?`text-transform: ${g}${m};`:""}
|
|
17
17
|
`};function getCustomCSSByDevice(o,t){if(!o||!t)return{};let e="desktop"!==t&&t?`-${t}`:"",{fontFamily:p}=o?.[t]??{};return{[`--size${e}`]:o?.[t]?.fontSize,[`--lh${e}`]:o?.[t]?.lineHeight,[`--fs${e}`]:o?.[t]?.fontStyle,[`--ff${e}`]:p?`var(--g-font-${p}, ${p})`:void 0,[`--weight${e}`]:o?.[t]?.fontWeight,[`--ls${e}`]:o?.[t]?.letterSpacing}}let composeTypography=o=>o?t({...getCustomCSSByDevice(o,"desktop"),...getCustomCSSByDevice(o,"tablet"),...getCustomCSSByDevice(o,"mobile")}):{},composeTypographyV2=(o,s)=>o?t({...e({fs:s?.italic?void 0:o?.fontStyle,ff:o?.fontFamily?`var(--g-font-${o.fontFamily.replace(/ /g,"-")}, ${o.fontFamily})`:void 0,weight:s?.bold?void 0:o?.fontWeight,ls:o?.letterSpacing,lh:o?.lineHeight}),...p("size",o?.fontSize)}):{},composeTypographyAttr=p=>p?t({...e({fs:p?.italic?"italic":void 0,weight:p?.bold?"bold":void 0,c:o(p?.color),tt:p?.transform,tdl:p?.underline?"underline":void 0})}):{},composeTypographyClassName=(o,t)=>o?o?.type&&!o.custom?genTypoClass(o.type):"":t?.type&&genTypoClass(t?.type),composeTypographyStyle=(o,t,e)=>o?{...composeTypographyV2(o.custom,o.attrs),...!e&&composeTypographyAttr(o.attrs)}:{...t?.type?{}:composeTypography(t?.custom)};export{composeTypography,composeTypographyAttr,composeTypographyClassName,composeTypographyCss,composeTypographyStyle,composeTypographyV2,composeTypographyV2Css,genTypoClass};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7957,7 +7957,7 @@ declare const composeTextColorCss: (color?: ColorValueType) => string;
|
|
|
7957
7957
|
type TypographyClass = `g-${TypographyType}`;
|
|
7958
7958
|
declare const genTypoClass: (name: TypographyType) => TypographyClass;
|
|
7959
7959
|
declare const composeTypographyCss: (typography: TypographySetting | undefined) => string;
|
|
7960
|
-
declare const composeTypographyV2Css: (typography: TypographySettingV2 | undefined) => string;
|
|
7960
|
+
declare const composeTypographyV2Css: (typography: TypographySettingV2 | undefined, isImportant?: boolean) => string;
|
|
7961
7961
|
declare const composeTypography: (typography?: ObjectDevices<TypographyProps>) => React.CSSProperties;
|
|
7962
7962
|
declare const composeTypographyV2: (value?: TypographyV2Props, attrs?: TypographyV2Attrs) => React.CSSProperties;
|
|
7963
7963
|
declare const composeTypographyAttr: (attrs?: TypographyV2Attrs) => React.CSSProperties;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "1.14.0-dev.
|
|
3
|
+
"version": "1.14.0-dev.327",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@gem-sdk/adapter-shopify": "1.14.0-dev.284",
|
|
28
|
-
"@gem-sdk/styles": "1.14.0-dev.
|
|
28
|
+
"@gem-sdk/styles": "1.14.0-dev.327"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"react-error-boundary": "4.0.10",
|