@ikas/bp-storefront 1.4.0-beta.84 → 1.4.0-beta.85
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
|
|
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 n(n){return(String(n).match(e)||[]).map(function(e,n){var l=e.toLowerCase();return 0===n?l:l.charAt(0).toUpperCase()+l.slice(1)}).join("")}var l={settings:{},colors:[],typography:[],breakpoints:[],keyframes:[],colorSchemes:{schemes:[],values:[]}},r=function(e){return"var(--".concat(n(e),")")},i=function(e){return"_".concat(e)},t=function(e){return"bp(".concat(e,")")},o=function(e){return e.map(function(e){return{id:e.id,width:Number(e.width)||0}})};function u(e,n){return e&&e.includes("bp(")?n.reduce(function(e,n){return e.split(t(n.id)).join("".concat(n.width,"px"))},e):e}var a=function(e){var n;if(e)return Array.isArray(e)?null===(n=e[0])||void 0===n?void 0:n.value:e},d=function(e){var n,l=e;if(!l)return null;if(l.patternValueId)return r(l.patternValueId);if(l.colorSchemeId)return r(l.colorSchemeId);if(l.keyframeValueId)return i(l.keyframeValueId);var t=l.value;return null==t?null:"object"==typeof t?"string"==typeof t.css?t.css:null!=t.value?"".concat(t.value).concat(null!==(n=t.unit)&&void 0!==n?n:""):null:String(t)},v=/^__.+__$/,s=function(e){return v.test(null!=e?e:"")};function c(e){var t,o,u,v,c,f,p,m,y,h,b,g,S,A,I;if(!e)return l;for(var k=null===(t=e.theme)||void 0===t?void 0:t.pattern,N={},V=0,w=null!==(v=null===(u=null===(o=e.globalsBlueprint)||void 0===o?void 0:o.module)||void 0===u?void 0:u.variables)&&void 0!==v?v:[];V<w.length;V++){var _=w[V];if(!1!==_.isGlobal&&_.variableName&&(!s(_.id)&&!s(_.variableName))){var D=null!==(c=_.variableType)&&void 0!==c?c:"TEXT";N[_.variableName]={name:_.variableName,type:D,value:"BOOLEAN"===D?!!_.defaultValue:null!==(f=_.defaultValue)&&void 0!==f?f:null}}}var T=(null!==(p=null==k?void 0:k.values)&&void 0!==p?p:[]).map(function(e){var n;return{id:e.id,resolved:d(a(null===(n=e.style)||void 0===n?void 0:n.value)),cssVar:r(e.id)}}),j=function(e){return(null!=e?e:[]).map(function(e){return{property:e.property,value:d(a(e.value))}}).filter(function(e){return null!=e.value})},Z=(null!==(m=null==k?void 0:k.elements)&&void 0!==m?m:[]).map(function(e){for(var l={},r=0,t=j(e.styles);r<t.length;r++){var o=t[r],u=o.property,a=o.value;l[n(u)]=a}return{id:e.id,resolved:l,className:i(e.id)}}),x=(null!==(h=null===(y=e.theme)||void 0===y?void 0:y.breakpoints)&&void 0!==h?h:[]).map(function(e){var n;return{id:e.id,width:null!==(n=e.width)&&void 0!==n?n:0}}),z=(null!==(g=null===(b=e.theme)||void 0===b?void 0:b.keyframes)&&void 0!==g?g:[]).map(function(e){var n,l;return{id:e.id,type:null!==(n=e.type)&&void 0!==n?n:"keyframe",ref:i(e.id),settings:j(e.styles),points:(null!==(l=e.points)&&void 0!==l?l:[]).map(function(e){return{point:e.point,styles:j(e.styles)}})}}),B=(null!==(S=null==k?void 0:k.colorSchemes)&&void 0!==S?S:[]).map(function(e){var n;return{id:e.id,name:null!==(n=e.name)&&void 0!==n?n:e.id}}),E=null!==(A=null==k?void 0:k.colorSchemes)&&void 0!==A?A:[],C=null!==(I=null==k?void 0:k.colorSchemeValues)&&void 0!==I?I:[],L=C.map(function(e){for(var n,l,t,o=function(e){var n,l;return null!==(l=null===(n=C.find(function(n){return n.isDefault&&(e?n.designAssetId===e:!n.designAssetId)}))||void 0===n?void 0:n.colors)&&void 0!==l?l:[]}(e.designAssetId),u={},a=function(i){var a=null===(n=e.colors)||void 0===n?void 0:n.find(function(e){return e.colorSchemeId===i.id}),v=a?void 0:o.find(function(e){return e.colorSchemeId===i.id});u[i.id]={resolved:null!==(t=d(null!==(l=null==a?void 0:a.style)&&void 0!==l?l:null==v?void 0:v.style))&&void 0!==t?t:"#ffffff",cssVar:r(i.id)}},v=0,s=E;v<s.length;v++){a(s[v])}return{id:e.id,isDefault:!!e.isDefault,className:i(e.id),colorsByScheme:u}});return{settings:N,colors:T,typography:Z,breakpoints:x,keyframes:z,colorSchemes:{schemes:B,values:L}}}export{l as EMPTY_THEME_GLOBALS,t as breakpointCssToken,n as cssVarCamelCase,r as cssVarRef,s as isReservedVariableId,i as rawClassRef,u as resolveBreakpointMediaTokens,c as serializeThemeGlobals,o as toResolverBreakpoints};
|
|
@@ -11,12 +11,15 @@ export declare function cssVarCamelCase(str: string): string;
|
|
|
11
11
|
*/
|
|
12
12
|
/** Global-variable value kinds, mirrored from the editor sidebar `GlobalVariableType`. */
|
|
13
13
|
export type GlobalVariableType = "TEXT" | "RICH_TEXT" | "IMAGE" | "COLOR" | "NUMBER" | "BOOLEAN" | "BORDER" | "SHADOW";
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* A theme "global variable" (Theme Settings panel). `name` is the stable runtime key.
|
|
16
|
+
* The human-facing `displayName` is intentionally NOT part of this contract — the CC-server AI
|
|
17
|
+
* agent kept referencing display labels instead of stable keys, so labels are dropped from the
|
|
18
|
+
* theme-globals payload entirely (see the design-token types below).
|
|
19
|
+
*/
|
|
15
20
|
export type ThemeSetting = {
|
|
16
21
|
/** Stable runtime key — the variable's `variableName` (e.g. `_6Q0KV7VGGM`). */
|
|
17
22
|
name: string;
|
|
18
|
-
/** Human-facing label. */
|
|
19
|
-
displayName: string;
|
|
20
23
|
type: GlobalVariableType;
|
|
21
24
|
/**
|
|
22
25
|
* Concrete value, discriminated by `type`:
|
|
@@ -31,7 +34,6 @@ export type ThemeSetting = {
|
|
|
31
34
|
/** A single-value design token (color). `cssVar` resolves the live, scheme-aware value. */
|
|
32
35
|
export type DesignToken = {
|
|
33
36
|
id: string;
|
|
34
|
-
name: string;
|
|
35
37
|
/** Resolved base/default value (e.g. a hex string), or null when unset. */
|
|
36
38
|
resolved: string | null;
|
|
37
39
|
/** CSS custom-property reference, e.g. `var(--primaryColor)`. */
|
|
@@ -40,7 +42,6 @@ export type DesignToken = {
|
|
|
40
42
|
/** A typography token (text style). Apply `className` to an element to use it. */
|
|
41
43
|
export type TypographyToken = {
|
|
42
44
|
id: string;
|
|
43
|
-
name: string;
|
|
44
45
|
/** Resolved CSS values keyed by camelCased CSS property (e.g. `fontSize`, `fontWeight`). */
|
|
45
46
|
resolved: Record<string, string>;
|
|
46
47
|
/** Class selector the editor emits for this text style, e.g. `_<id>`. */
|
|
@@ -48,7 +49,6 @@ export type TypographyToken = {
|
|
|
48
49
|
};
|
|
49
50
|
export type BreakpointToken = {
|
|
50
51
|
id: string;
|
|
51
|
-
name: string;
|
|
52
52
|
width: number;
|
|
53
53
|
};
|
|
54
54
|
/** A resolved CSS style entry, e.g. { property: "animation-duration", value: "1.4s" }. */
|
|
@@ -58,7 +58,6 @@ export type StyleEntry = {
|
|
|
58
58
|
};
|
|
59
59
|
export type KeyframeToken = {
|
|
60
60
|
id: string;
|
|
61
|
-
name: string;
|
|
62
61
|
type: string;
|
|
63
62
|
/** CSS reference — the animation name / class the editor emits, e.g. `_<id>`. */
|
|
64
63
|
ref: string;
|
|
@@ -82,7 +81,6 @@ export type KeyframeToken = {
|
|
|
82
81
|
*/
|
|
83
82
|
export type ColorSchemeToken = {
|
|
84
83
|
id: string;
|
|
85
|
-
name: string;
|
|
86
84
|
isDefault: boolean;
|
|
87
85
|
/** Class selector to activate this scheme value, e.g. `_<id>`. */
|
|
88
86
|
className: string;
|