@flozy/editor 5.9.4 → 5.9.5

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.
@@ -26,7 +26,7 @@ const FontLoader = props => {
26
26
  return;
27
27
  }
28
28
  const batch = families?.slice(currentIndex, currentIndex + batchSize);
29
- const batchWithWeights = batch.map(font => `${font}:300,400,600,700`);
29
+ const batchWithWeights = batch?.map(font => `${font}:300,400,600,700`);
30
30
  WebFont.load({
31
31
  google: {
32
32
  families: [...batchWithWeights]
@@ -80,8 +80,8 @@ const FontLoader = props => {
80
80
  });
81
81
  } else {
82
82
  function correctFontArray(fontString) {
83
- let fontsArray = fontString.split(",");
84
- let cleanedFontsArray = [...new Set(fontsArray.map(font => font.trim()))];
83
+ let fontsArray = fontString?.split(",");
84
+ let cleanedFontsArray = [...new Set(fontsArray?.map(font => font.trim()))];
85
85
  return cleanedFontsArray;
86
86
  }
87
87
  function sanitizeFontFamily(fontFamily) {
@@ -98,7 +98,7 @@ const FontLoader = props => {
98
98
  families = correctFontArray(families.join(", "));
99
99
  families = families?.map(font => font?.replace(/\"/g, ""));
100
100
  families = families?.map(font => font?.replace(", sans-serif", ""));
101
- families = families.filter(font => googleFontList.includes(font));
101
+ families = families?.filter(font => googleFontList?.includes(font));
102
102
  loadFontsInBatches(families);
103
103
  }
104
104
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "5.9.4",
3
+ "version": "5.9.5",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"