@ikas/bp-storefront 1.4.0-beta.67 → 1.4.0-beta.68

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
- var e=new RegExp(["[A-Z]?[a-z]+","[0-9]*(?:1ST|2ND|3RD|(?![123])[0-9]TH)(?=\\b|[a-z_])","[0-9]*(?:1st|2nd|3rd|(?![123])[0-9]th)(?=\\b|[A-Z_])","[A-Z]+(?![a-z])","[0-9]+","[A-Z]"].join("|"),"g");function l(l){return(String(l).match(e)||[]).map(function(e,l){var n=e.toLowerCase();return 0===l?n:n.charAt(0).toUpperCase()+n.slice(1)}).join("")}var n={settings:{},colors:[],typography:[],breakpoints:[],keyframes:[],colorSchemes:{schemes:[],values:[]}},i=function(e){return"var(--".concat(l(e),")")},o=function(e){return"_".concat(e)},r=function(e){var l;if(e)return Array.isArray(e)?null===(l=e[0])||void 0===l?void 0:l.value:e},a=function(e){var l,n=e;if(!n)return null;if(n.patternValueId)return i(n.patternValueId);if(n.colorSchemeId)return i(n.colorSchemeId);if(n.keyframeValueId)return o(n.keyframeValueId);var r=n.value;return null==r?null:"object"==typeof r?"string"==typeof r.css?r.css:null!=r.value?"".concat(r.value).concat(null!==(l=r.unit)&&void 0!==l?l:""):null:String(r)},u=/^__.+__$/,t=function(e){return u.test(null!=e?e:"")};function d(e){var u,d,v,s,c,m,f,p,y,h,g,b,S,A,I,N;if(!e)return n;for(var k=null===(u=e.theme)||void 0===u?void 0:u.pattern,V={},_=0,D=null!==(s=null===(v=null===(d=e.globalsBlueprint)||void 0===d?void 0:d.module)||void 0===v?void 0:v.variables)&&void 0!==s?s:[];_<D.length;_++){var T=D[_];if(!1!==T.isGlobal&&T.variableName&&(!t(T.id)&&!t(T.variableName))){var w=null!==(c=T.variableType)&&void 0!==c?c:"TEXT";V[T.variableName]={name:T.variableName,displayName:null!==(m=T.displayName)&&void 0!==m?m:T.variableName,type:w,value:"BOOLEAN"===w?!!T.defaultValue:null!==(f=T.defaultValue)&&void 0!==f?f:null}}}var Z=(null!==(p=null==k?void 0:k.values)&&void 0!==p?p:[]).map(function(e){var l,n;return{id:e.id,name:null!==(l=e.name)&&void 0!==l?l:e.id,resolved:a(r(null===(n=e.style)||void 0===n?void 0:n.value)),cssVar:i(e.id)}}),j=(null!==(y=null==k?void 0:k.elements)&&void 0!==y?y:[]).map(function(e){for(var n,i,u={},t=0,d=null!==(n=e.styles)&&void 0!==n?n:[];t<d.length;t++){var v=d[t],s=a(r(v.value));null!=s&&(u[l(v.property)]=s)}return{id:e.id,name:null!==(i=e.name)&&void 0!==i?i:e.id,resolved:u,className:o(e.id)}}),z=(null!==(g=null===(h=e.theme)||void 0===h?void 0:h.breakpoints)&&void 0!==g?g:[]).map(function(e){var l,n;return{id:e.id,name:null!==(l=e.name)&&void 0!==l?l:e.id,width:null!==(n=e.width)&&void 0!==n?n:0}}),B=(null!==(S=null===(b=e.theme)||void 0===b?void 0:b.keyframes)&&void 0!==S?S:[]).map(function(e){var l,n,i;return{id:e.id,name:null!==(l=e.name)&&void 0!==l?l:e.id,type:null!==(n=e.type)&&void 0!==n?n:"keyframe",ref:o(e.id),points:(null!==(i=e.points)&&void 0!==i?i:[]).map(function(e){return{point:e.point}})}}),E=(null!==(A=null==k?void 0:k.colorSchemes)&&void 0!==A?A:[]).map(function(e){var l;return{id:e.id,name:null!==(l=e.name)&&void 0!==l?l:e.id}}),x=null!==(I=null==k?void 0:k.colorSchemes)&&void 0!==I?I:[],C=null!==(N=null==k?void 0:k.colorSchemeValues)&&void 0!==N?N:[],L=C.map(function(e){for(var l,n,r,u,t=function(e){var l,n;return null!==(n=null===(l=C.find(function(l){return l.isDefault&&(e?l.designAssetId===e:!l.designAssetId)}))||void 0===l?void 0:l.colors)&&void 0!==n?n:[]}(e.designAssetId),d={},v=function(o){var u=null===(l=e.colors)||void 0===l?void 0:l.find(function(e){return e.colorSchemeId===o.id}),v=u?void 0:t.find(function(e){return e.colorSchemeId===o.id});d[o.id]={resolved:null!==(r=a(null!==(n=null==u?void 0:u.style)&&void 0!==n?n:null==v?void 0:v.style))&&void 0!==r?r:"#ffffff",cssVar:i(o.id)}},s=0,c=x;s<c.length;s++){v(c[s])}return{id:e.id,name:null!==(u=e.name)&&void 0!==u?u:e.id,isDefault:!!e.isDefault,className:o(e.id),colorsByScheme:d}});return{settings:V,colors:Z,typography:j,breakpoints:z,keyframes:B,colorSchemes:{schemes:E,values:L}}}export{n as EMPTY_THEME_GLOBALS,l as cssVarCamelCase,i as cssVarRef,t as isReservedVariableId,o as rawClassRef,d as serializeThemeGlobals};
1
+ var e=new RegExp(["[A-Z]?[a-z]+","[0-9]*(?:1ST|2ND|3RD|(?![123])[0-9]TH)(?=\\b|[a-z_])","[0-9]*(?:1st|2nd|3rd|(?![123])[0-9]th)(?=\\b|[A-Z_])","[A-Z]+(?![a-z])","[0-9]+","[A-Z]"].join("|"),"g");function l(l){return(String(l).match(e)||[]).map(function(e,l){var n=e.toLowerCase();return 0===l?n:n.charAt(0).toUpperCase()+n.slice(1)}).join("")}var n={settings:{},colors:[],typography:[],breakpoints:[],keyframes:[],colorSchemes:{schemes:[],values:[]}},i=function(e){return"var(--".concat(l(e),")")},r=function(e){return"_".concat(e)},o=function(e){var l;if(e)return Array.isArray(e)?null===(l=e[0])||void 0===l?void 0:l.value:e},u=function(e){var l,n=e;if(!n)return null;if(n.patternValueId)return i(n.patternValueId);if(n.colorSchemeId)return i(n.colorSchemeId);if(n.keyframeValueId)return r(n.keyframeValueId);var o=n.value;return null==o?null:"object"==typeof o?"string"==typeof o.css?o.css:null!=o.value?"".concat(o.value).concat(null!==(l=o.unit)&&void 0!==l?l:""):null:String(o)},a=/^__.+__$/,t=function(e){return a.test(null!=e?e:"")};function d(e){var a,d,v,s,c,f,m,p,y,h,g,b,S,A,I,N;if(!e)return n;for(var k=null===(a=e.theme)||void 0===a?void 0:a.pattern,V={},_=0,D=null!==(s=null===(v=null===(d=e.globalsBlueprint)||void 0===d?void 0:d.module)||void 0===v?void 0:v.variables)&&void 0!==s?s:[];_<D.length;_++){var T=D[_];if(!1!==T.isGlobal&&T.variableName&&(!t(T.id)&&!t(T.variableName))){var w=null!==(c=T.variableType)&&void 0!==c?c:"TEXT";V[T.variableName]={name:T.variableName,displayName:null!==(f=T.displayName)&&void 0!==f?f:T.variableName,type:w,value:"BOOLEAN"===w?!!T.defaultValue:null!==(m=T.defaultValue)&&void 0!==m?m:null}}}var Z=(null!==(p=null==k?void 0:k.values)&&void 0!==p?p:[]).map(function(e){var l,n;return{id:e.id,name:null!==(l=e.name)&&void 0!==l?l:e.id,resolved:u(o(null===(n=e.style)||void 0===n?void 0:n.value)),cssVar:i(e.id)}}),j=(null!==(y=null==k?void 0:k.elements)&&void 0!==y?y:[]).map(function(e){for(var n,i,a={},t=0,d=null!==(n=e.styles)&&void 0!==n?n:[];t<d.length;t++){var v=d[t],s=u(o(v.value));null!=s&&(a[l(v.property)]=s)}return{id:e.id,name:null!==(i=e.name)&&void 0!==i?i:e.id,resolved:a,className:r(e.id)}}),z=(null!==(g=null===(h=e.theme)||void 0===h?void 0:h.breakpoints)&&void 0!==g?g:[]).map(function(e){var l,n;return{id:e.id,name:null!==(l=e.name)&&void 0!==l?l:e.id,width:null!==(n=e.width)&&void 0!==n?n:0}}),B=function(e){return(null!=e?e:[]).map(function(e){return{property:e.property,value:u(o(e.value))}}).filter(function(e){return null!=e.value})},E=(null!==(S=null===(b=e.theme)||void 0===b?void 0:b.keyframes)&&void 0!==S?S:[]).map(function(e){var l,n,i;return{id:e.id,name:null!==(l=e.name)&&void 0!==l?l:e.id,type:null!==(n=e.type)&&void 0!==n?n:"keyframe",ref:r(e.id),settings:B(e.styles),points:(null!==(i=e.points)&&void 0!==i?i:[]).map(function(e){return{point:e.point,styles:B(e.styles)}})}}),x=(null!==(A=null==k?void 0:k.colorSchemes)&&void 0!==A?A:[]).map(function(e){var l;return{id:e.id,name:null!==(l=e.name)&&void 0!==l?l:e.id}}),C=null!==(I=null==k?void 0:k.colorSchemes)&&void 0!==I?I:[],L=null!==(N=null==k?void 0:k.colorSchemeValues)&&void 0!==N?N:[],O=L.map(function(e){for(var l,n,o,a,t=function(e){var l,n;return null!==(n=null===(l=L.find(function(l){return l.isDefault&&(e?l.designAssetId===e:!l.designAssetId)}))||void 0===l?void 0:l.colors)&&void 0!==n?n:[]}(e.designAssetId),d={},v=function(r){var a=null===(l=e.colors)||void 0===l?void 0:l.find(function(e){return e.colorSchemeId===r.id}),v=a?void 0:t.find(function(e){return e.colorSchemeId===r.id});d[r.id]={resolved:null!==(o=u(null!==(n=null==a?void 0:a.style)&&void 0!==n?n:null==v?void 0:v.style))&&void 0!==o?o:"#ffffff",cssVar:i(r.id)}},s=0,c=C;s<c.length;s++){v(c[s])}return{id:e.id,name:null!==(a=e.name)&&void 0!==a?a:e.id,isDefault:!!e.isDefault,className:r(e.id),colorsByScheme:d}});return{settings:V,colors:Z,typography:j,breakpoints:z,keyframes:E,colorSchemes:{schemes:x,values:O}}}export{n as EMPTY_THEME_GLOBALS,l as cssVarCamelCase,i as cssVarRef,t as isReservedVariableId,r as rawClassRef,d as serializeThemeGlobals};
@@ -51,14 +51,29 @@ export type BreakpointToken = {
51
51
  name: string;
52
52
  width: number;
53
53
  };
54
+ /** A resolved CSS style entry, e.g. { property: "animation-duration", value: "1.4s" }. */
55
+ export type StyleEntry = {
56
+ property: string;
57
+ value: string;
58
+ };
54
59
  export type KeyframeToken = {
55
60
  id: string;
56
61
  name: string;
57
62
  type: string;
58
63
  /** CSS reference — the animation name / class the editor emits, e.g. `_<id>`. */
59
64
  ref: string;
65
+ /**
66
+ * Keyframe-level animation "settings" (the editor's Settings popover). These are CSS
67
+ * animation/transition properties and DIFFER BY TYPE: a `keyframe` carries
68
+ * animation-duration/-iteration-count/-play-state/-delay/-timing-function/-direction/
69
+ * -fill-mode/-timeline/-range + transform-origin; a `transition` carries `transition`.
70
+ * Both may carry backface-visibility. Empty when none are set.
71
+ */
72
+ settings?: StyleEntry[];
73
+ /** Animation points; each point may carry its own resolved styles. */
60
74
  points?: {
61
75
  point: string;
76
+ styles?: StyleEntry[];
62
77
  }[];
63
78
  };
64
79
  /**
@@ -143,11 +158,13 @@ type BreakpointLike = {
143
158
  };
144
159
  type KeyframePointLike = {
145
160
  point: string;
161
+ styles?: ElementStyleLike[];
146
162
  };
147
163
  type KeyframeLike = {
148
164
  id: string;
149
165
  name?: string;
150
166
  type?: string;
167
+ styles?: ElementStyleLike[];
151
168
  points?: KeyframePointLike[];
152
169
  };
153
170
  type VariableLike = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikas/bp-storefront",
3
- "version": "1.4.0-beta.67",
3
+ "version": "1.4.0-beta.68",
4
4
  "description": "A framework for the ikas blueprint storefronts.",
5
5
  "author": "ikas",
6
6
  "license": "ISC",