@gem-sdk/core 2.0.0-dev.842 → 2.0.0-dev.843

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"),react=require("react"),reactErrorBoundary=require("react-error-boundary"),BuilderComponent=require("../contexts/BuilderComponent.js"),BuilderContext=require("../contexts/BuilderContext.js"),ComponentWrapper=require("./ComponentWrapper.js"),RenderSection=require("./RenderSection.js");const Render=({uid:e,...r})=>{let t=BuilderContext.useBuilderStore(r=>r.getItem(e)),n=BuilderComponent.useBuilderComponent(t?.tag),s=BuilderContext.useBuilderStore(e=>e.getIsPostPurchase()),i=react.useMemo(()=>s?"POST_PURCHASE":void 0,[s]);return t?t?.type==="section"?jsxRuntime.jsx(RenderSection.default,{sectionId:t.uid}):jsxRuntime.jsx(reactErrorBoundary.ErrorBoundary,{fallbackRender:({error:e,resetErrorBoundary:r})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{"aria-label":"Error message",children:e.message}),jsxRuntime.jsx("button",{type:"button",onClick:r,children:"Try again"})]}),children:jsxRuntime.jsx(ComponentWrapper.default,{...t,pageType:i,children:t?.childrens?.length?jsxRuntime.jsx(n,{builderProps:{uid:e,builderData:t},styles:t.styles,setting:t.settings,...r,children:t.childrens.map(e=>jsxRuntime.jsx(RenderMemo,{uid:e},e))}):jsxRuntime.jsx(n,{builderProps:{uid:e,builderData:t},styles:t.styles,setting:t.settings,...r})})},t.uid):null},RenderMemo=react.memo(Render);RenderMemo.displayName="RenderMemo",exports.default=RenderMemo;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),react=require("react"),reactErrorBoundary=require("react-error-boundary"),BuilderComponent=require("../contexts/BuilderComponent.js"),BuilderContext=require("../contexts/BuilderContext.js"),ComponentWrapper=require("./ComponentWrapper.js"),RenderSection=require("./RenderSection.js");const Render=({uid:e,...r})=>{let t=BuilderContext.useBuilderStore(r=>r.getItem(e)),n=BuilderComponent.useBuilderComponent(t?.tag),s=BuilderContext.useBuilderStore(e=>e.getIsPostPurchase()),i=BuilderContext.useBuilderStore(e=>e.getIsPreview()),u=react.useMemo(()=>s?"POST_PURCHASE":void 0,[s]);return t?t?.type==="section"?jsxRuntime.jsx(RenderSection.default,{sectionId:t.uid}):jsxRuntime.jsx(reactErrorBoundary.ErrorBoundary,{fallbackRender:({error:e,resetErrorBoundary:r})=>jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{"aria-label":"Error message",children:e.message}),jsxRuntime.jsx("button",{type:"button",onClick:r,children:"Try again"})]}),children:jsxRuntime.jsx(ComponentWrapper.default,{...t,pageType:u,children:t?.childrens?.length?jsxRuntime.jsx(n,{builderProps:{uid:e,builderData:t,isPreview:i},styles:t.styles,setting:t.settings,...r,children:t.childrens.map(e=>jsxRuntime.jsx(RenderMemo,{uid:e},e))}):jsxRuntime.jsx(n,{builderProps:{uid:e,builderData:t,isPreview:i},styles:t.styles,setting:t.settings,...r})})},t.uid):null},RenderMemo=react.memo(Render);RenderMemo.displayName="RenderMemo",exports.default=RenderMemo;
@@ -1 +1 @@
1
- "use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),zustand=require("zustand");const BuilderContext=react.createContext(null),createBuilderProvider=(e,r)=>zustand.createStore((t,u)=>({state:e,isPostPurchase:r,getItem:e=>u().state[e],getIsPostPurchase:()=>u().isPostPurchase})),BuilderProvider=({children:e,state:r,isPostPurchase:t,lazy:u,priority:s,...i})=>{let d=u?react.Suspense:react.Fragment,o=createBuilderProvider(r,t);return jsxRuntime.jsx(d,{children:jsxRuntime.jsx(BuilderContext.Provider,{...i,value:o,children:e})})},useBuilderStore=(e,r)=>{let t=react.useContext(BuilderContext);if(!t)throw Error("useBuilderStore must be used within a BuilderProvider");return zustand.useStore(t,e,r)};exports.BuilderProvider=BuilderProvider,exports.useBuilderStore=useBuilderStore;
1
+ "use strict";var jsxRuntime=require("react/jsx-runtime"),react=require("react"),zustand=require("zustand");const BuilderContext=react.createContext(null),createBuilderProvider=(e,r,t)=>zustand.createStore((u,i)=>({state:e,isPostPurchase:r,isPreview:t,getItem:e=>i().state[e],getIsPostPurchase:()=>i().isPostPurchase,getIsPreview:()=>i().isPreview})),BuilderProvider=({children:e,state:r,isPostPurchase:t,isPreview:u,lazy:i,priority:s,...d})=>{let o=i?react.Suspense:react.Fragment,a=createBuilderProvider(r,t,u);return jsxRuntime.jsx(o,{children:jsxRuntime.jsx(BuilderContext.Provider,{...d,value:a,children:e})})},useBuilderStore=(e,r)=>{let t=react.useContext(BuilderContext);if(!t)throw Error("useBuilderStore must be used within a BuilderProvider");return zustand.useStore(t,e,r)};exports.BuilderProvider=BuilderProvider,exports.useBuilderStore=useBuilderStore;
@@ -1,5 +1,5 @@
1
1
  "use strict";const ThemePageDocument=`
2
- query ThemePage($themePageId: ID!) {
2
+ query ThemePage($themePageId: ID!, $first: Int, $where: ThemeStyleWhereInput) {
3
3
  themePage(id: $themePageId) {
4
4
  id
5
5
  name
@@ -12,10 +12,17 @@
12
12
  id
13
13
  deletedAt
14
14
  }
15
- themeStyle {
15
+ theme {
16
16
  id
17
- data
18
- name
17
+ themeStyles(first: $first, where: $where) {
18
+ edges {
19
+ node {
20
+ data
21
+ id
22
+ name
23
+ }
24
+ }
25
+ }
19
26
  }
20
27
  }
21
28
  }
@@ -1 +1 @@
1
- "use strict";var getResonsiveValue=require("./get-resonsive-value.js");const removeNullUndefined=e=>Object.entries(e).reduce((e,[t,o])=>null==o?e:{...e,[t]:o},{}),makeStyleKey=e=>[e,`hvr-${e}`,`focus-${e}`,`${e}-tablet`,`hvr-${e}-tablet`,`focus-${e}-tablet`,`${e}-mobile`,`hvr-${e}-mobile`,`focus-${e}-mobile`].map(e=>`--${e}`),makeStyle=e=>removeNullUndefined(Object.fromEntries(Object.entries(e).map(([e,t])=>[`--${e}`,t]))),makeStyleState=(e,t)=>t?{[`--${e}`]:t?.normal,[`--hvr-${e}`]:t?.hover,[`--focus-${e}`]:t?.focus}:{},makeStyleResponsiveState=(e,t)=>t?{[`--${e}`]:t?.desktop?.normal,[`--hvr-${e}`]:t?.desktop?.hover,[`--focus-${e}`]:t?.desktop?.focus,[`--${e}-tablet`]:t?.tablet?.normal,[`--hvr-${e}-tablet`]:t?.tablet?.hover,[`--focus-${e}-tablet`]:t?.tablet?.focus,[`--${e}-mobile`]:t?.mobile?.normal,[`--hvr-${e}-mobile`]:t?.mobile?.hover,[`--focus-${e}-mobile`]:t?.mobile?.focus}:{},makeStyleResponsive=(e,t,o)=>({[`--${e}`]:o?`${t?.desktop}${o}`:t?.desktop,[`--${e}-tablet`]:o?`${t?.tablet}${o}`:t?.tablet,[`--${e}-mobile`]:o?`${t?.mobile}${o}`:t?.mobile}),makeStyleResponsiveByScreen=(e,t,o)=>({[`--${e}`]:o?`${getResonsiveValue.getResponsiveValueByScreen(t,"desktop")}${o}`:getResonsiveValue.getResponsiveValueByScreen(t,"desktop"),[`--${e}-tablet`]:o?`${getResonsiveValue.getResponsiveValueByScreen(t,"tablet")}${o}`:getResonsiveValue.getResponsiveValueByScreen(t,"tablet"),[`--${e}-mobile`]:o?`${getResonsiveValue.getResponsiveValueByScreen(t,"mobile")}${o}`:getResonsiveValue.getResponsiveValueByScreen(t,"mobile")}),makeWidth=(e,t)=>{let o=(e,t,o)=>{let s=getResonsiveValue.getResponsiveValueByScreen(t,e),l=o?.[e]===void 0?o?.desktop:o?.[e];return l?"100%":!1===l?s??s:s||"auto"};return{desktop:o("desktop",e,t),tablet:o("tablet",e,t),mobile:o("mobile",e,t)}},makeGlobalSizeWidthResponsive=e=>({"--w":e?.desktop?.width,"--w-tablet":e?.tablet?.width,"--w-mobile":e?.mobile?.width}),makeGlobalSizeHeightResponsive=e=>({"--h":e?.desktop?.height,"--h-tablet":e?.tablet?.height,"--h-mobile":e?.mobile?.height}),makeHeight=(e,t)=>{let o=(e,t,o)=>{let s=t?.[e],l=o?.[e];return l?"auto":!1===l?s??s:s};return{desktop:o("desktop",e,t),tablet:o("tablet",e,t),mobile:o("mobile",e,t)}},makeAspectRatio=(e,t,o)=>{let s={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let a=getResonsiveValue.getResponsiveValueByScreen(e,l);"none"!==a&&(s={...s,[l]:"custom"!==a?a:`${getResonsiveValue.getResponsiveValueByScreen(t,"desktop")}/${getResonsiveValue.getResponsiveValueByScreen(o,"desktop")}`})}),s},makeLineClamp=(e,t)=>{let o=(e,t,o)=>{let s=t?.[e],l=o?.[e]||o?.desktop;return l||void 0===l?s:"unset"};return{desktop:o("desktop",e,t),tablet:o("tablet",e,t),mobile:o("mobile",e,t)}};exports.makeAspectRatio=makeAspectRatio,exports.makeGlobalSizeHeightResponsive=makeGlobalSizeHeightResponsive,exports.makeGlobalSizeWidthResponsive=makeGlobalSizeWidthResponsive,exports.makeHeight=makeHeight,exports.makeLineClamp=makeLineClamp,exports.makeStyle=makeStyle,exports.makeStyleKey=makeStyleKey,exports.makeStyleResponsive=makeStyleResponsive,exports.makeStyleResponsiveByScreen=makeStyleResponsiveByScreen,exports.makeStyleResponsiveState=makeStyleResponsiveState,exports.makeStyleState=makeStyleState,exports.makeWidth=makeWidth,exports.removeNullUndefined=removeNullUndefined;
1
+ "use strict";var getResonsiveValue=require("./get-resonsive-value.js");const removeNullUndefined=e=>Object.entries(e).reduce((e,[t,o])=>null==o?e:{...e,[t]:o},{}),makeStyleKey=e=>[e,`hvr-${e}`,`focus-${e}`,`${e}-tablet`,`hvr-${e}-tablet`,`focus-${e}-tablet`,`${e}-mobile`,`hvr-${e}-mobile`,`focus-${e}-mobile`].map(e=>`--${e}`),makeStyle=e=>removeNullUndefined(Object.fromEntries(Object.entries(e).map(([e,t])=>[`--${e}`,t]))),makeStyleState=(e,t)=>t?{[`--${e}`]:t?.normal,[`--hvr-${e}`]:t?.hover,[`--focus-${e}`]:t?.focus}:{},makeStyleResponsiveState=(e,t)=>t?{[`--${e}`]:t?.desktop?.normal,[`--hvr-${e}`]:t?.desktop?.hover,[`--focus-${e}`]:t?.desktop?.focus,[`--${e}-tablet`]:t?.tablet?.normal,[`--hvr-${e}-tablet`]:t?.tablet?.hover,[`--focus-${e}-tablet`]:t?.tablet?.focus,[`--${e}-mobile`]:t?.mobile?.normal,[`--hvr-${e}-mobile`]:t?.mobile?.hover,[`--focus-${e}-mobile`]:t?.mobile?.focus}:{},makeStyleResponsive=(e,t,o)=>({[`--${e}`]:o?`${t?.desktop}${o}`:t?.desktop,[`--${e}-tablet`]:o?`${t?.tablet}${o}`:t?.tablet,[`--${e}-mobile`]:o?`${t?.mobile}${o}`:t?.mobile}),makeStyleResponsiveByScreen=(e,t,o)=>({[`--${e}`]:o?`${getResonsiveValue.getResponsiveValueByScreen(t,"desktop")}${o}`:getResonsiveValue.getResponsiveValueByScreen(t,"desktop"),[`--${e}-tablet`]:o?`${getResonsiveValue.getResponsiveValueByScreen(t,"tablet")}${o}`:getResonsiveValue.getResponsiveValueByScreen(t,"tablet"),[`--${e}-mobile`]:o?`${getResonsiveValue.getResponsiveValueByScreen(t,"mobile")}${o}`:getResonsiveValue.getResponsiveValueByScreen(t,"mobile")}),makeWidth=(e,t)=>{let o=(e,t,o)=>{let s=getResonsiveValue.getResponsiveValueByScreen(t,e),l=o?.[e]===void 0?o?.desktop:o?.[e];return l?"100%":!1===l?s??s:s||"auto"};return{desktop:o("desktop",e,t),tablet:o("tablet",e,t),mobile:o("mobile",e,t)}},makeGlobalSizeWidthResponsive=e=>({"--w":e?.desktop?.width,"--w-tablet":e?.tablet?.width,"--w-mobile":e?.mobile?.width}),makeGlobalSizeHeightResponsive=e=>({"--h":e?.desktop?.height,"--h-tablet":e?.tablet?.height,"--h-mobile":e?.mobile?.height}),makeHeight=(e,t)=>{let o=(e,t,o)=>{let s=t?.[e],l=o?.[e];return l?"auto":!1===l?s??s:s};return{desktop:o("desktop",e,t),tablet:o("tablet",e,t),mobile:o("mobile",e,t)}},makeAspectRatio=(e,t,o)=>{let s={},l=["desktop","mobile","tablet"];return l.forEach(l=>{let a=getResonsiveValue.getResponsiveValueByScreen(e,l);"none"!==a&&(s={...s,[l]:"custom"!==a?a:`${getResonsiveValue.getResponsiveValueByScreen(t,"desktop")}/${getResonsiveValue.getResponsiveValueByScreen(o,"desktop")}`})}),s},makeLineClamp=(e,t)=>{let o=(e,t,o)=>{let s=getResonsiveValue.getResponsiveValueByScreen(t,e),l=getResonsiveValue.getResponsiveValueByScreen(o,e);return l||void 0===l?s:"unset"};return{desktop:o("desktop",e,t),tablet:o("tablet",e,t),mobile:o("mobile",e,t)}};exports.makeAspectRatio=makeAspectRatio,exports.makeGlobalSizeHeightResponsive=makeGlobalSizeHeightResponsive,exports.makeGlobalSizeWidthResponsive=makeGlobalSizeWidthResponsive,exports.makeHeight=makeHeight,exports.makeLineClamp=makeLineClamp,exports.makeStyle=makeStyle,exports.makeStyleKey=makeStyleKey,exports.makeStyleResponsive=makeStyleResponsive,exports.makeStyleResponsiveByScreen=makeStyleResponsiveByScreen,exports.makeStyleResponsiveState=makeStyleResponsiveState,exports.makeStyleState=makeStyleState,exports.makeWidth=makeWidth,exports.removeNullUndefined=removeNullUndefined;
@@ -1 +1 @@
1
- import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{memo as n,useMemo as o}from"react";import{ErrorBoundary as i}from"react-error-boundary";import{useBuilderComponent as s}from"../contexts/BuilderComponent.js";import{useBuilderStore as d}from"../contexts/BuilderContext.js";import l from"./ComponentWrapper.js";import a from"./RenderSection.js";let Render=({uid:n,...m})=>{let p=d(e=>e.getItem(n)),c=s(p?.tag),u=d(e=>e.getIsPostPurchase()),g=o(()=>u?"POST_PURCHASE":void 0,[u]);return p?p?.type==="section"?e(a,{sectionId:p.uid}):e(i,{fallbackRender:({error:n,resetErrorBoundary:o})=>r(t,{children:[e("span",{"aria-label":"Error message",children:n.message}),e("button",{type:"button",onClick:o,children:"Try again"})]}),children:e(l,{...p,pageType:g,children:p?.childrens?.length?e(c,{builderProps:{uid:n,builderData:p},styles:p.styles,setting:p.settings,...m,children:p.childrens.map(r=>e(RenderMemo,{uid:r},r))}):e(c,{builderProps:{uid:n,builderData:p},styles:p.styles,setting:p.settings,...m})})},p.uid):null},RenderMemo=n(Render);RenderMemo.displayName="RenderMemo";export{RenderMemo as default};
1
+ import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{memo as n,useMemo as o}from"react";import{ErrorBoundary as i}from"react-error-boundary";import{useBuilderComponent as s}from"../contexts/BuilderComponent.js";import{useBuilderStore as d}from"../contexts/BuilderContext.js";import l from"./ComponentWrapper.js";import a from"./RenderSection.js";let Render=({uid:n,...m})=>{let p=d(e=>e.getItem(n)),c=s(p?.tag),u=d(e=>e.getIsPostPurchase()),g=d(e=>e.getIsPreview()),h=o(()=>u?"POST_PURCHASE":void 0,[u]);return p?p?.type==="section"?e(a,{sectionId:p.uid}):e(i,{fallbackRender:({error:n,resetErrorBoundary:o})=>r(t,{children:[e("span",{"aria-label":"Error message",children:n.message}),e("button",{type:"button",onClick:o,children:"Try again"})]}),children:e(l,{...p,pageType:h,children:p?.childrens?.length?e(c,{builderProps:{uid:n,builderData:p,isPreview:g},styles:p.styles,setting:p.settings,...m,children:p.childrens.map(r=>e(RenderMemo,{uid:r},r))}):e(c,{builderProps:{uid:n,builderData:p,isPreview:g},styles:p.styles,setting:p.settings,...m})})},p.uid):null},RenderMemo=n(Render);RenderMemo.displayName="RenderMemo";export{RenderMemo as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useContext as r,createContext as t,Suspense as i,Fragment as u}from"react";import{useStore as o,createStore as d}from"zustand";let BuilderContext=t(null),createBuilderProvider=(e,r)=>d((t,i)=>({state:e,isPostPurchase:r,getItem:e=>i().state[e],getIsPostPurchase:()=>i().isPostPurchase})),BuilderProvider=({children:r,state:t,isPostPurchase:o,lazy:d,priority:l,...s})=>{let a=d?i:u,P=createBuilderProvider(t,o);return e(a,{children:e(BuilderContext.Provider,{...s,value:P,children:r})})},useBuilderStore=(e,t)=>{let i=r(BuilderContext);if(!i)throw Error("useBuilderStore must be used within a BuilderProvider");return o(i,e,t)};export{BuilderProvider,useBuilderStore};
1
+ import{jsx as e}from"react/jsx-runtime";import{useContext as r,createContext as t,Suspense as i,Fragment as u}from"react";import{useStore as o,createStore as d}from"zustand";let BuilderContext=t(null),createBuilderProvider=(e,r,t)=>d((i,u)=>({state:e,isPostPurchase:r,isPreview:t,getItem:e=>u().state[e],getIsPostPurchase:()=>u().isPostPurchase,getIsPreview:()=>u().isPreview})),BuilderProvider=({children:r,state:t,isPostPurchase:o,isPreview:d,lazy:s,priority:l,...P})=>{let a=s?i:u,n=createBuilderProvider(t,o,d);return e(a,{children:e(BuilderContext.Provider,{...P,value:n,children:r})})},useBuilderStore=(e,t)=>{let i=r(BuilderContext);if(!i)throw Error("useBuilderStore must be used within a BuilderProvider");return o(i,e,t)};export{BuilderProvider,useBuilderStore};
@@ -1,5 +1,5 @@
1
1
  let ThemePageDocument=`
2
- query ThemePage($themePageId: ID!) {
2
+ query ThemePage($themePageId: ID!, $first: Int, $where: ThemeStyleWhereInput) {
3
3
  themePage(id: $themePageId) {
4
4
  id
5
5
  name
@@ -12,10 +12,17 @@ let ThemePageDocument=`
12
12
  id
13
13
  deletedAt
14
14
  }
15
- themeStyle {
15
+ theme {
16
16
  id
17
- data
18
- name
17
+ themeStyles(first: $first, where: $where) {
18
+ edges {
19
+ node {
20
+ data
21
+ id
22
+ name
23
+ }
24
+ }
25
+ }
19
26
  }
20
27
  }
21
28
  }
@@ -1 +1 @@
1
- import{getResponsiveValueByScreen as e}from"./get-resonsive-value.js";let removeNullUndefined=e=>Object.entries(e).reduce((e,[t,l])=>null==l?e:{...e,[t]:l},{}),makeStyleKey=e=>[e,`hvr-${e}`,`focus-${e}`,`${e}-tablet`,`hvr-${e}-tablet`,`focus-${e}-tablet`,`${e}-mobile`,`hvr-${e}-mobile`,`focus-${e}-mobile`].map(e=>`--${e}`),makeStyle=e=>removeNullUndefined(Object.fromEntries(Object.entries(e).map(([e,t])=>[`--${e}`,t]))),makeStyleState=(e,t)=>t?{[`--${e}`]:t?.normal,[`--hvr-${e}`]:t?.hover,[`--focus-${e}`]:t?.focus}:{},makeStyleResponsiveState=(e,t)=>t?{[`--${e}`]:t?.desktop?.normal,[`--hvr-${e}`]:t?.desktop?.hover,[`--focus-${e}`]:t?.desktop?.focus,[`--${e}-tablet`]:t?.tablet?.normal,[`--hvr-${e}-tablet`]:t?.tablet?.hover,[`--focus-${e}-tablet`]:t?.tablet?.focus,[`--${e}-mobile`]:t?.mobile?.normal,[`--hvr-${e}-mobile`]:t?.mobile?.hover,[`--focus-${e}-mobile`]:t?.mobile?.focus}:{},makeStyleResponsive=(e,t,l)=>({[`--${e}`]:l?`${t?.desktop}${l}`:t?.desktop,[`--${e}-tablet`]:l?`${t?.tablet}${l}`:t?.tablet,[`--${e}-mobile`]:l?`${t?.mobile}${l}`:t?.mobile}),makeStyleResponsiveByScreen=(t,l,o)=>({[`--${t}`]:o?`${e(l,"desktop")}${o}`:e(l,"desktop"),[`--${t}-tablet`]:o?`${e(l,"tablet")}${o}`:e(l,"tablet"),[`--${t}-mobile`]:o?`${e(l,"mobile")}${o}`:e(l,"mobile")}),makeWidth=(t,l)=>{let o=(t,l,o)=>{let a=e(l,t),i=o?.[t]===void 0?o?.desktop:o?.[t];return i?"100%":!1===i?a??a:a||"auto"};return{desktop:o("desktop",t,l),tablet:o("tablet",t,l),mobile:o("mobile",t,l)}},makeGlobalSizeWidthResponsive=e=>({"--w":e?.desktop?.width,"--w-tablet":e?.tablet?.width,"--w-mobile":e?.mobile?.width}),makeGlobalSizeHeightResponsive=e=>({"--h":e?.desktop?.height,"--h-tablet":e?.tablet?.height,"--h-mobile":e?.mobile?.height}),makeHeight=(e,t)=>{let l=(e,t,l)=>{let o=t?.[e],a=l?.[e];return a?"auto":!1===a?o??o:o};return{desktop:l("desktop",e,t),tablet:l("tablet",e,t),mobile:l("mobile",e,t)}},makeAspectRatio=(t,l,o)=>{let a={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let m=e(t,i);"none"!==m&&(a={...a,[i]:"custom"!==m?m:`${e(l,"desktop")}/${e(o,"desktop")}`})}),a},makeLineClamp=(e,t)=>{let l=(e,t,l)=>{let o=t?.[e],a=l?.[e]||l?.desktop;return a||void 0===a?o:"unset"};return{desktop:l("desktop",e,t),tablet:l("tablet",e,t),mobile:l("mobile",e,t)}};export{makeAspectRatio,makeGlobalSizeHeightResponsive,makeGlobalSizeWidthResponsive,makeHeight,makeLineClamp,makeStyle,makeStyleKey,makeStyleResponsive,makeStyleResponsiveByScreen,makeStyleResponsiveState,makeStyleState,makeWidth,removeNullUndefined};
1
+ import{getResponsiveValueByScreen as e}from"./get-resonsive-value.js";let removeNullUndefined=e=>Object.entries(e).reduce((e,[t,l])=>null==l?e:{...e,[t]:l},{}),makeStyleKey=e=>[e,`hvr-${e}`,`focus-${e}`,`${e}-tablet`,`hvr-${e}-tablet`,`focus-${e}-tablet`,`${e}-mobile`,`hvr-${e}-mobile`,`focus-${e}-mobile`].map(e=>`--${e}`),makeStyle=e=>removeNullUndefined(Object.fromEntries(Object.entries(e).map(([e,t])=>[`--${e}`,t]))),makeStyleState=(e,t)=>t?{[`--${e}`]:t?.normal,[`--hvr-${e}`]:t?.hover,[`--focus-${e}`]:t?.focus}:{},makeStyleResponsiveState=(e,t)=>t?{[`--${e}`]:t?.desktop?.normal,[`--hvr-${e}`]:t?.desktop?.hover,[`--focus-${e}`]:t?.desktop?.focus,[`--${e}-tablet`]:t?.tablet?.normal,[`--hvr-${e}-tablet`]:t?.tablet?.hover,[`--focus-${e}-tablet`]:t?.tablet?.focus,[`--${e}-mobile`]:t?.mobile?.normal,[`--hvr-${e}-mobile`]:t?.mobile?.hover,[`--focus-${e}-mobile`]:t?.mobile?.focus}:{},makeStyleResponsive=(e,t,l)=>({[`--${e}`]:l?`${t?.desktop}${l}`:t?.desktop,[`--${e}-tablet`]:l?`${t?.tablet}${l}`:t?.tablet,[`--${e}-mobile`]:l?`${t?.mobile}${l}`:t?.mobile}),makeStyleResponsiveByScreen=(t,l,o)=>({[`--${t}`]:o?`${e(l,"desktop")}${o}`:e(l,"desktop"),[`--${t}-tablet`]:o?`${e(l,"tablet")}${o}`:e(l,"tablet"),[`--${t}-mobile`]:o?`${e(l,"mobile")}${o}`:e(l,"mobile")}),makeWidth=(t,l)=>{let o=(t,l,o)=>{let a=e(l,t),i=o?.[t]===void 0?o?.desktop:o?.[t];return i?"100%":!1===i?a??a:a||"auto"};return{desktop:o("desktop",t,l),tablet:o("tablet",t,l),mobile:o("mobile",t,l)}},makeGlobalSizeWidthResponsive=e=>({"--w":e?.desktop?.width,"--w-tablet":e?.tablet?.width,"--w-mobile":e?.mobile?.width}),makeGlobalSizeHeightResponsive=e=>({"--h":e?.desktop?.height,"--h-tablet":e?.tablet?.height,"--h-mobile":e?.mobile?.height}),makeHeight=(e,t)=>{let l=(e,t,l)=>{let o=t?.[e],a=l?.[e];return a?"auto":!1===a?o??o:o};return{desktop:l("desktop",e,t),tablet:l("tablet",e,t),mobile:l("mobile",e,t)}},makeAspectRatio=(t,l,o)=>{let a={},i=["desktop","mobile","tablet"];return i.forEach(i=>{let m=e(t,i);"none"!==m&&(a={...a,[i]:"custom"!==m?m:`${e(l,"desktop")}/${e(o,"desktop")}`})}),a},makeLineClamp=(t,l)=>{let o=(t,l,o)=>{let a=e(l,t),i=e(o,t);return i||void 0===i?a:"unset"};return{desktop:o("desktop",t,l),tablet:o("tablet",t,l),mobile:o("mobile",t,l)}};export{makeAspectRatio,makeGlobalSizeHeightResponsive,makeGlobalSizeWidthResponsive,makeHeight,makeLineClamp,makeStyle,makeStyleKey,makeStyleResponsive,makeStyleResponsiveByScreen,makeStyleResponsiveState,makeStyleState,makeWidth,removeNullUndefined};
@@ -6590,6 +6590,7 @@ type BaseProps<Setting = unknown, Style = unknown, Advanced = AdvancedType> = {
6590
6590
  /** Unique id of component */
6591
6591
  uid?: string;
6592
6592
  builderData?: BlockEntity;
6593
+ isPreview?: boolean;
6593
6594
  };
6594
6595
  styles?: Style;
6595
6596
  setting?: Setting;
@@ -27258,8 +27259,10 @@ type BuilderContextProps = {
27258
27259
  getItem: (id: string) => BuilderEntity | undefined;
27259
27260
  isPostPurchase?: boolean;
27260
27261
  getIsPostPurchase: () => boolean | undefined;
27262
+ isPreview?: boolean;
27263
+ getIsPreview: () => boolean | undefined;
27261
27264
  };
27262
- type BuilderProviderProps = Pick<BuilderContextProps, 'state' | 'isPostPurchase'> & {
27265
+ type BuilderProviderProps = Pick<BuilderContextProps, 'state' | 'isPostPurchase' | 'isPreview'> & {
27263
27266
  children: React.ReactNode;
27264
27267
  lazy?: boolean;
27265
27268
  priority?: boolean;
@@ -27812,14 +27815,22 @@ declare const LibraryTemplateDocument = "\n query LibraryTemplate($libraryTem
27812
27815
 
27813
27816
  type ThemePageQueryVariables = Exact<{
27814
27817
  themePageId: Scalars['ID'];
27818
+ first?: InputMaybe<Scalars['Int']>;
27819
+ where?: InputMaybe<ThemeStyleWhereInput>;
27815
27820
  }>;
27816
27821
  type ThemePageQueryResponse = {
27817
27822
  themePage?: Maybe<Pick<ThemePage, 'id' | 'name' | 'handle' | 'isMobile' | 'sectionPosition'> & {
27818
27823
  pageSections?: Maybe<Array<Maybe<Pick<PageSection, 'cid' | 'component' | 'id' | 'deletedAt'>>>>;
27819
- themeStyle?: Maybe<Pick<ThemeStyle, 'id' | 'data' | 'name'>>;
27824
+ theme?: Maybe<Pick<Theme, 'id'> & {
27825
+ themeStyles?: Maybe<{
27826
+ edges?: Maybe<Array<Maybe<{
27827
+ node?: Maybe<Pick<ThemeStyle, 'data' | 'id' | 'name'>>;
27828
+ }>>>;
27829
+ }>;
27830
+ }>;
27820
27831
  }>;
27821
27832
  };
27822
- declare const ThemePageDocument = "\n query ThemePage($themePageId: ID!) {\n themePage(id: $themePageId) {\n id\n name\n handle\n isMobile\n sectionPosition\n pageSections {\n cid\n component\n id\n deletedAt\n }\n themeStyle {\n id\n data\n name\n }\n }\n}\n ";
27833
+ declare const ThemePageDocument = "\n query ThemePage($themePageId: ID!, $first: Int, $where: ThemeStyleWhereInput) {\n themePage(id: $themePageId) {\n id\n name\n handle\n isMobile\n sectionPosition\n pageSections {\n cid\n component\n id\n deletedAt\n }\n theme {\n id\n themeStyles(first: $first, where: $where) {\n edges {\n node {\n data\n id\n name\n }\n }\n }\n }\n }\n}\n ";
27823
27834
 
27824
27835
  type SaleFunnelDiscountsQueryVariables = Exact<{
27825
27836
  where?: InputMaybe<SaleFunnelDiscountWhereInput>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "2.0.0-dev.842",
3
+ "version": "2.0.0-dev.843",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",