western-world 3.0.248 → 3.0.249

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "western-world",
3
- "version": "3.0.248",
3
+ "version": "3.0.249",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -73,24 +73,17 @@ export const buildNewSvgImages = ({ allCells, language }) => {
73
73
  };
74
74
 
75
75
  export const buildNewSvgImageByCell = ({ cell, language, withMask, parser }) => {
76
- const cellImport = cells[cell.animatedImage];
77
- // TODO create scss file for each cell and simplify it;
78
- const svgStr = typeof cellImport === 'object' ? cellImport.svgPath : cellImport;
79
- const scssAnimationStr = typeof cellImport === 'object' ? cellImport.scssPath : '';
80
-
81
76
  // get svg image from file and apply offsets;
82
- const doc = parser.parseFromString(svgStr, 'image/svg+xml');
83
-
77
+ const doc = parser.parseFromString(cells[cell.animatedImage].svgPath, 'image/svg+xml');
84
78
  const svgEl = doc.querySelector('svg');
85
79
  const maxMainSvgViewBox = svgEl.viewBox.baseVal.width;
86
80
  svgEl.classList.add(cell.animatedImage);
87
-
88
81
  const styleElement = svgEl.querySelector('svg > style');
89
82
  const styleSvg = `
90
83
  ${languageSvgStyles}
91
84
  ${withMask ? maskStyles : ''}
92
- ${scssAnimationStr}
93
- `;
85
+ ${cells[cell.animatedImage].scssPath}
86
+ `;
94
87
  styleElement.insertAdjacentHTML('beforeend', styleSvg);
95
88
 
96
89
  // create new <g> and move all content to it to apply mask;
@@ -122,9 +115,7 @@ export const buildNewSvgImageByCell = ({ cell, language, withMask, parser }) =>
122
115
  svgUseBorderElement.setAttribute('class', 'use-border');
123
116
  svgEl.appendChild(svgUseBorderElement);
124
117
  }
125
-
126
118
  svgEl.appendChild(gElement);
127
-
128
119
  return buildImageForCanvasFromHtmlStr(svgEl.outerHTML).then((img) => ({ svgTag: svgEl.outerHTML, img }));
129
120
  };
130
121