@gem-sdk/pages 4.0.0-staging.1195 → 4.0.0-staging.1208
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";const getFontsFromDataBuilder=t=>{let e=[];for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],n=r.styles,i=r.settings;getFontFromGroupSetting(e,n),getFontFromGroupSetting(e,i)}return e},getFontFromGroupSetting=(t,e)=>{let o=["normal","hover","focus","active","disabled","price","compareAtPrice"];for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let n=e[r];if(!n)continue;for(let e of(getFontValue(t,n),o))n[e]&&getFontValue(t,n[e])}},uniqueArray=t=>Array.from(new Set(t)),getFontValue=(t,e)=>{let o=e.custom?.fontFamily;"string"==typeof o&&(o={value:e.custom?.fontFamily||"",type:"google"});let r=o?.value
|
|
1
|
+
"use strict";const EXCLUDED_FONT_FAMILIES=["sans-serif"],getFontsFromDataBuilder=t=>{let e=[];for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],n=r.styles,i=r.settings;getFontFromGroupSetting(e,n),getFontFromGroupSetting(e,i)}return e},getFontFromGroupSetting=(t,e)=>{let o=["normal","hover","focus","active","disabled","price","compareAtPrice"];for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r)){let n=e[r];if(!n)continue;for(let e of(getFontValue(t,n),o))n[e]&&getFontValue(t,n[e])}},uniqueArray=t=>Array.from(new Set(t)),getFontValue=(t,e)=>{let o=e.custom?.fontFamily;"string"==typeof o&&(o={value:e.custom?.fontFamily||"",type:"google"});let r=o?.value;if(EXCLUDED_FONT_FAMILIES.includes(r))return;let n=e.custom?.fontVariants;if(n?.length||(n=[e.custom?.fontWeight]),o&&n?.length){let i=n.map(t=>"regular"===t?"400":t),s=e.custom?.fontWeight&&i.includes(e.custom?.fontWeight)?e.custom?.fontWeight:i[0];if(s){let n=uniqueArray([s,...e?.attrs?.isAlwaysLoadBold?["700"]:[]]),l=t.find(t=>t.family==r&&t.variants.includes(s));if(!l){let e=t.find(t=>t.family==r);e?e.variants.push(s):("700"!==s&&i.includes("700")&&n.push("700"),t.push({family:r||"",variants:n,subsets:[],type:o.type}))}}}};exports.getFontFromGroupSetting=getFontFromGroupSetting,exports.getFontsFromDataBuilder=getFontsFromDataBuilder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
let getFontsFromDataBuilder=t=>{let e=[];for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let n=t[o],r=n.styles,i=n.settings;getFontFromGroupSetting(e,r),getFontFromGroupSetting(e,i)}return e},getFontFromGroupSetting=(t,e)=>{let o=["normal","hover","focus","active","disabled","price","compareAtPrice"];for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let r=e[n];if(!r)continue;for(let e of(getFontValue(t,r),o))r[e]&&getFontValue(t,r[e])}},uniqueArray=t=>Array.from(new Set(t)),getFontValue=(t,e)=>{let o=e.custom?.fontFamily;"string"==typeof o&&(o={value:e.custom?.fontFamily||"",type:"google"});let n=o?.value
|
|
1
|
+
let EXCLUDED_FONT_FAMILIES=["sans-serif"],getFontsFromDataBuilder=t=>{let e=[];for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let n=t[o],r=n.styles,i=n.settings;getFontFromGroupSetting(e,r),getFontFromGroupSetting(e,i)}return e},getFontFromGroupSetting=(t,e)=>{let o=["normal","hover","focus","active","disabled","price","compareAtPrice"];for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let r=e[n];if(!r)continue;for(let e of(getFontValue(t,r),o))r[e]&&getFontValue(t,r[e])}},uniqueArray=t=>Array.from(new Set(t)),getFontValue=(t,e)=>{let o=e.custom?.fontFamily;"string"==typeof o&&(o={value:e.custom?.fontFamily||"",type:"google"});let n=o?.value;if(EXCLUDED_FONT_FAMILIES.includes(n))return;let r=e.custom?.fontVariants;if(r?.length||(r=[e.custom?.fontWeight]),o&&r?.length){let i=r.map(t=>"regular"===t?"400":t),l=e.custom?.fontWeight&&i.includes(e.custom?.fontWeight)?e.custom?.fontWeight:i[0];if(l){let r=uniqueArray([l,...e?.attrs?.isAlwaysLoadBold?["700"]:[]]),a=t.find(t=>t.family==n&&t.variants.includes(l));if(!a){let e=t.find(t=>t.family==n);e?e.variants.push(l):("700"!==l&&i.includes("700")&&r.push("700"),t.push({family:n||"",variants:r,subsets:[],type:o.type}))}}}};export{getFontFromGroupSetting,getFontsFromDataBuilder};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/pages",
|
|
3
|
-
"version": "4.0.0-staging.
|
|
3
|
+
"version": "4.0.0-staging.1208",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"next": "14.2.20"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@gem-sdk/core": "4.0.0-staging.
|
|
29
|
+
"@gem-sdk/core": "4.0.0-staging.1205",
|
|
30
30
|
"@gem-sdk/plugin-cookie-bar": "4.0.0-staging.1195",
|
|
31
31
|
"@gem-sdk/plugin-quick-view": "4.0.0-staging.1195",
|
|
32
32
|
"@gem-sdk/plugin-sticky-add-to-cart": "4.0.0-staging.1195"
|