@gem-sdk/pages 2.0.0-dev.1278 → 2.0.0-dev.1290
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 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),
|
|
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),l=e.custom?.fontWeight&&i.includes(e.custom?.fontWeight)?e.custom?.fontWeight:i[0];if(l){let n=uniqueArray([l,...e?.attrs?.isAlwaysLoadBold?["700"]:[],...e?.attrs?.loadFontStyles?.includes("bold")?["700"]:[]]);if(e?.attrs?.loadFontStyles?.includes("italic")){let t=n.map(t=>{if("string"==typeof t&&/^\d+$/.test(t))return`${t}i`});n.push(...t)}let s=t.find(t=>t.family==r&&t.variants.includes(l));if(!s){let e=t.find(t=>t.family==r);e?e.variants.push(l):("700"!==l&&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 EXCLUDED_FONT_FAMILIES=["sans-serif"],getFontsFromDataBuilder=t=>{let e=[];for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let
|
|
1
|
+
let EXCLUDED_FONT_FAMILIES=["sans-serif"],getFontsFromDataBuilder=t=>{let e=[];for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let i=t[o],l=i.styles,n=i.settings;getFontFromGroupSetting(e,l),getFontFromGroupSetting(e,n)}return e},getFontFromGroupSetting=(t,e)=>{let o=["normal","hover","focus","active","disabled","price","compareAtPrice"];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let l=e[i];if(!l)continue;for(let e of(getFontValue(t,l),o))l[e]&&getFontValue(t,l[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 i=o?.value;if(EXCLUDED_FONT_FAMILIES.includes(i))return;let l=e.custom?.fontVariants;if(l?.length||(l=[e.custom?.fontWeight]),o&&l?.length){let n=l.map(t=>"regular"===t?"400":t),r=e.custom?.fontWeight&&n.includes(e.custom?.fontWeight)?e.custom?.fontWeight:n[0];if(r){let l=uniqueArray([r,...e?.attrs?.isAlwaysLoadBold?["700"]:[],...e?.attrs?.loadFontStyles?.includes("bold")?["700"]:[]]);if(e?.attrs?.loadFontStyles?.includes("italic")){let t=l.map(t=>{if("string"==typeof t&&/^\d+$/.test(t))return`${t}i`});l.push(...t)}let s=t.find(t=>t.family==i&&t.variants.includes(r));if(!s){let e=t.find(t=>t.family==i);e?e.variants.push(r):("700"!==r&&n.includes("700")&&l.push("700"),t.push({family:i||"",variants:l,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": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.1290",
|
|
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": "2.0.0-dev.
|
|
29
|
+
"@gem-sdk/core": "2.0.0-dev.1290",
|
|
30
30
|
"@gem-sdk/plugin-cookie-bar": "2.0.0-dev.1260",
|
|
31
31
|
"@gem-sdk/plugin-quick-view": "2.0.0-dev.1260",
|
|
32
32
|
"@gem-sdk/plugin-sticky-add-to-cart": "2.0.0-dev.1260"
|