@lumen5/lottie-web 5.14.0

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.
Files changed (300) hide show
  1. package/.babelrc.json +3 -0
  2. package/.eslintrc.json +46 -0
  3. package/.gitattributes +1 -0
  4. package/.github/FUNDING.yml +1 -0
  5. package/.github/ISSUE_TEMPLATE.md +22 -0
  6. package/.github/workflows/publish.yml +26 -0
  7. package/.github/workflows/testAnimations.yml +29 -0
  8. package/.github/workflows/updateScreenshots.yml +34 -0
  9. package/CHANGELOG.md +601 -0
  10. package/History.md +1230 -0
  11. package/LICENSE.md +21 -0
  12. package/README.md +351 -0
  13. package/bower.json +31 -0
  14. package/build/old_parser/bodymovin_parser.jsx +3023 -0
  15. package/build/old_parser/helperProject.aep +0 -0
  16. package/build/player/cjs/lottie.min.js +18229 -0
  17. package/build/player/cjs/lottie_canvas.min.js +16465 -0
  18. package/build/player/cjs/lottie_html.min.js +16312 -0
  19. package/build/player/cjs/lottie_light.min.js +11584 -0
  20. package/build/player/cjs/lottie_light_canvas.min.js +13518 -0
  21. package/build/player/cjs/lottie_light_html.min.js +12843 -0
  22. package/build/player/cjs/lottie_svg.min.js +15053 -0
  23. package/build/player/esm/lottie.min.js +18225 -0
  24. package/build/player/esm/lottie_canvas.min.js +16461 -0
  25. package/build/player/esm/lottie_html.min.js +16308 -0
  26. package/build/player/esm/lottie_light.min.js +11580 -0
  27. package/build/player/esm/lottie_light_canvas.min.js +13514 -0
  28. package/build/player/esm/lottie_light_html.min.js +12839 -0
  29. package/build/player/esm/lottie_svg.min.js +15049 -0
  30. package/build/player/lottie.d.ts +5 -0
  31. package/build/player/lottie.js +17151 -0
  32. package/build/player/lottie.min.js +1 -0
  33. package/build/player/lottie_canvas.js +15506 -0
  34. package/build/player/lottie_canvas.min.js +1 -0
  35. package/build/player/lottie_canvas_worker.js +18196 -0
  36. package/build/player/lottie_canvas_worker.min.js +15 -0
  37. package/build/player/lottie_html.d.ts +5 -0
  38. package/build/player/lottie_html.js +15354 -0
  39. package/build/player/lottie_html.min.js +1 -0
  40. package/build/player/lottie_light.d.ts +5 -0
  41. package/build/player/lottie_light.js +10854 -0
  42. package/build/player/lottie_light.min.js +1 -0
  43. package/build/player/lottie_light_canvas.d.ts +5 -0
  44. package/build/player/lottie_light_canvas.js +12666 -0
  45. package/build/player/lottie_light_canvas.min.js +1 -0
  46. package/build/player/lottie_light_html.d.ts +5 -0
  47. package/build/player/lottie_light_html.js +12029 -0
  48. package/build/player/lottie_light_html.min.js +1 -0
  49. package/build/player/lottie_svg.d.ts +5 -0
  50. package/build/player/lottie_svg.js +14179 -0
  51. package/build/player/lottie_svg.min.js +1 -0
  52. package/build/player/lottie_worker.js +18196 -0
  53. package/build/player/lottie_worker.min.js +15 -0
  54. package/docs/json/animation.json +101 -0
  55. package/docs/json/effects/angle.json +40 -0
  56. package/docs/json/effects/checkBox.json +40 -0
  57. package/docs/json/effects/color.json +40 -0
  58. package/docs/json/effects/customValue.json +4 -0
  59. package/docs/json/effects/dropDown.json +40 -0
  60. package/docs/json/effects/fill.json +55 -0
  61. package/docs/json/effects/group.json +41 -0
  62. package/docs/json/effects/index.json +51 -0
  63. package/docs/json/effects/layer.json +33 -0
  64. package/docs/json/effects/noValue.json +1 -0
  65. package/docs/json/effects/point.json +43 -0
  66. package/docs/json/effects/proLevels.json +130 -0
  67. package/docs/json/effects/slider.json +40 -0
  68. package/docs/json/effects/stroke.json +64 -0
  69. package/docs/json/effects/tint.json +43 -0
  70. package/docs/json/effects/tritone.json +46 -0
  71. package/docs/json/helpers/blendMode.json +71 -0
  72. package/docs/json/helpers/boolean.json +14 -0
  73. package/docs/json/helpers/composite.json +15 -0
  74. package/docs/json/helpers/lineCap.json +19 -0
  75. package/docs/json/helpers/lineJoin.json +19 -0
  76. package/docs/json/helpers/mask.json +80 -0
  77. package/docs/json/helpers/textBased.json +23 -0
  78. package/docs/json/helpers/textGrouping.json +23 -0
  79. package/docs/json/helpers/textShape.json +31 -0
  80. package/docs/json/helpers/transform.json +146 -0
  81. package/docs/json/layers/image.json +113 -0
  82. package/docs/json/layers/null.json +87 -0
  83. package/docs/json/layers/preComp.json +118 -0
  84. package/docs/json/layers/shape.json +157 -0
  85. package/docs/json/layers/solid.json +120 -0
  86. package/docs/json/layers/text.json +523 -0
  87. package/docs/json/properties/doubleKeyframe.json +50 -0
  88. package/docs/json/properties/multiDimensional.json +21 -0
  89. package/docs/json/properties/multiDimensionalKeyframed.json +35 -0
  90. package/docs/json/properties/offsetKeyframe.json +53 -0
  91. package/docs/json/properties/shape.json +27 -0
  92. package/docs/json/properties/shapeKeyframed.json +35 -0
  93. package/docs/json/properties/shapeProp.json +50 -0
  94. package/docs/json/properties/shapePropKeyframe.json +54 -0
  95. package/docs/json/properties/value.json +21 -0
  96. package/docs/json/properties/valueKeyframe.json +33 -0
  97. package/docs/json/properties/valueKeyframed.json +25 -0
  98. package/docs/json/shapes/ellipse.json +54 -0
  99. package/docs/json/shapes/fill.json +48 -0
  100. package/docs/json/shapes/gFill.json +107 -0
  101. package/docs/json/shapes/gStroke.json +137 -0
  102. package/docs/json/shapes/group.json +89 -0
  103. package/docs/json/shapes/merge.json +27 -0
  104. package/docs/json/shapes/rect.json +66 -0
  105. package/docs/json/shapes/repeater.json +63 -0
  106. package/docs/json/shapes/round.json +35 -0
  107. package/docs/json/shapes/shape.json +40 -0
  108. package/docs/json/shapes/star.json +133 -0
  109. package/docs/json/shapes/stroke.json +78 -0
  110. package/docs/json/shapes/transform.json +102 -0
  111. package/docs/json/shapes/trim.json +61 -0
  112. package/docs/json/sources/chars.json +61 -0
  113. package/docs/json/sources/image.json +31 -0
  114. package/docs/json/sources/precomp.json +39 -0
  115. package/index.d.ts +197 -0
  116. package/package.json +54 -0
  117. package/player/index.html +115 -0
  118. package/player/js/3rd_party/BezierEaser.js +158 -0
  119. package/player/js/3rd_party/howler.js +5 -0
  120. package/player/js/3rd_party/seedrandom.js +237 -0
  121. package/player/js/3rd_party/transformation-matrix.js +449 -0
  122. package/player/js/EffectsManager.js +83 -0
  123. package/player/js/animation/AnimationItem.js +809 -0
  124. package/player/js/animation/AnimationItemWorkerOverride.js +157 -0
  125. package/player/js/animation/AnimationManager.js +248 -0
  126. package/player/js/animation/AnimationManagerWorkerOverride.js +201 -0
  127. package/player/js/effects/EffectsManagerPlaceholder.js +5 -0
  128. package/player/js/effects/SliderEffect.js +37 -0
  129. package/player/js/effects/TransformEffect.js +44 -0
  130. package/player/js/elements/AudioElement.js +102 -0
  131. package/player/js/elements/BaseElement.js +78 -0
  132. package/player/js/elements/BaseTextElement.js +4 -0
  133. package/player/js/elements/CompElement.js +107 -0
  134. package/player/js/elements/FootageElement.js +47 -0
  135. package/player/js/elements/ImageElement.js +42 -0
  136. package/player/js/elements/NullElement.js +39 -0
  137. package/player/js/elements/ShapeElement.js +76 -0
  138. package/player/js/elements/SolidElement.js +23 -0
  139. package/player/js/elements/TextElement.js +94 -0
  140. package/player/js/elements/canvasElements/CVBaseElement.js +167 -0
  141. package/player/js/elements/canvasElements/CVCompBaseElement.js +11 -0
  142. package/player/js/elements/canvasElements/CVCompElement.js +57 -0
  143. package/player/js/elements/canvasElements/CVContextData.js +239 -0
  144. package/player/js/elements/canvasElements/CVEffects.js +57 -0
  145. package/player/js/elements/canvasElements/CVImageElement.js +58 -0
  146. package/player/js/elements/canvasElements/CVMaskElement.js +72 -0
  147. package/player/js/elements/canvasElements/CVShapeElement.js +521 -0
  148. package/player/js/elements/canvasElements/CVSolidElement.js +30 -0
  149. package/player/js/elements/canvasElements/CVTextElement.js +244 -0
  150. package/player/js/elements/canvasElements/effects/CVGaussianBlurEffect.js +29 -0
  151. package/player/js/elements/canvasElements/effects/CVTransformEffect.js +9 -0
  152. package/player/js/elements/helpers/FrameElement.js +54 -0
  153. package/player/js/elements/helpers/HierarchyElement.js +52 -0
  154. package/player/js/elements/helpers/RenderableDOMElement.js +72 -0
  155. package/player/js/elements/helpers/RenderableElement.js +87 -0
  156. package/player/js/elements/helpers/TransformElement.js +140 -0
  157. package/player/js/elements/helpers/shapes/CVShapeData.js +33 -0
  158. package/player/js/elements/helpers/shapes/ProcessedElement.js +6 -0
  159. package/player/js/elements/helpers/shapes/SVGElementsRenderer.js +239 -0
  160. package/player/js/elements/helpers/shapes/SVGFillStyleData.js +18 -0
  161. package/player/js/elements/helpers/shapes/SVGGradientFillStyleData.js +100 -0
  162. package/player/js/elements/helpers/shapes/SVGGradientStrokeStyleData.js +20 -0
  163. package/player/js/elements/helpers/shapes/SVGNoStyleData.js +15 -0
  164. package/player/js/elements/helpers/shapes/SVGShapeData.js +28 -0
  165. package/player/js/elements/helpers/shapes/SVGStrokeStyleData.js +21 -0
  166. package/player/js/elements/helpers/shapes/SVGStyleData.js +19 -0
  167. package/player/js/elements/helpers/shapes/SVGTransformData.js +11 -0
  168. package/player/js/elements/helpers/shapes/ShapeElement.js +5 -0
  169. package/player/js/elements/helpers/shapes/ShapeGroupData.js +9 -0
  170. package/player/js/elements/helpers/shapes/ShapeTransformManager.js +61 -0
  171. package/player/js/elements/htmlElements/HBaseElement.js +88 -0
  172. package/player/js/elements/htmlElements/HCameraElement.js +170 -0
  173. package/player/js/elements/htmlElements/HCompElement.js +61 -0
  174. package/player/js/elements/htmlElements/HEffects.js +3 -0
  175. package/player/js/elements/htmlElements/HImageElement.js +42 -0
  176. package/player/js/elements/htmlElements/HShapeElement.js +261 -0
  177. package/player/js/elements/htmlElements/HSolidElement.js +36 -0
  178. package/player/js/elements/htmlElements/HTextElement.js +290 -0
  179. package/player/js/elements/svgElements/SVGBaseElement.js +181 -0
  180. package/player/js/elements/svgElements/SVGCompElement.js +28 -0
  181. package/player/js/elements/svgElements/SVGEffects.js +70 -0
  182. package/player/js/elements/svgElements/SVGEffectsPlaceholder.js +3 -0
  183. package/player/js/elements/svgElements/SVGShapeElement.js +366 -0
  184. package/player/js/elements/svgElements/SVGTextElement.js +322 -0
  185. package/player/js/elements/svgElements/effects/SVGComposableEffect.js +22 -0
  186. package/player/js/elements/svgElements/effects/SVGDropShadowEffect.js +83 -0
  187. package/player/js/elements/svgElements/effects/SVGFillFilter.js +22 -0
  188. package/player/js/elements/svgElements/effects/SVGGaussianBlurEffect.js +44 -0
  189. package/player/js/elements/svgElements/effects/SVGMatte3Effect.js +101 -0
  190. package/player/js/elements/svgElements/effects/SVGProLevelsFilter.js +108 -0
  191. package/player/js/elements/svgElements/effects/SVGStrokeEffect.js +119 -0
  192. package/player/js/elements/svgElements/effects/SVGTintEffect.js +47 -0
  193. package/player/js/elements/svgElements/effects/SVGTransformEffect.js +10 -0
  194. package/player/js/elements/svgElements/effects/SVGTritoneFilter.js +43 -0
  195. package/player/js/main.js +21 -0
  196. package/player/js/mask.js +239 -0
  197. package/player/js/module.js +153 -0
  198. package/player/js/modules/canvas.js +22 -0
  199. package/player/js/modules/canvas_light.js +25 -0
  200. package/player/js/modules/full.js +70 -0
  201. package/player/js/modules/full_worker.js +0 -0
  202. package/player/js/modules/html.js +37 -0
  203. package/player/js/modules/html_light.js +25 -0
  204. package/player/js/modules/main.js +162 -0
  205. package/player/js/modules/svg.js +37 -0
  206. package/player/js/modules/svg_light.js +25 -0
  207. package/player/js/renderers/BaseRenderer.js +187 -0
  208. package/player/js/renderers/CanvasRenderer.js +67 -0
  209. package/player/js/renderers/CanvasRendererBase.js +318 -0
  210. package/player/js/renderers/CanvasRendererWorkerOverride.js +54 -0
  211. package/player/js/renderers/HybridRenderer.js +47 -0
  212. package/player/js/renderers/HybridRendererBase.js +344 -0
  213. package/player/js/renderers/SVGRenderer.js +82 -0
  214. package/player/js/renderers/SVGRendererBase.js +255 -0
  215. package/player/js/renderers/renderersManager.js +29 -0
  216. package/player/js/utils/BaseEvent.js +42 -0
  217. package/player/js/utils/DataManager.js +676 -0
  218. package/player/js/utils/DataManagerWorkerOverrides.js +13 -0
  219. package/player/js/utils/FontManager.js +443 -0
  220. package/player/js/utils/FontManagerWorkerOverride.js +16 -0
  221. package/player/js/utils/PolynomialBezier.js +253 -0
  222. package/player/js/utils/PropertyFactory.js +489 -0
  223. package/player/js/utils/SlotManager.js +17 -0
  224. package/player/js/utils/TransformProperty.js +251 -0
  225. package/player/js/utils/animationFramePolyFill.js +25 -0
  226. package/player/js/utils/asset_loader.js +53 -0
  227. package/player/js/utils/asset_loader_worker_override.js +3 -0
  228. package/player/js/utils/audio/AudioController.js +85 -0
  229. package/player/js/utils/audio/AudioElement.js +6 -0
  230. package/player/js/utils/bez.js +251 -0
  231. package/player/js/utils/common.js +280 -0
  232. package/player/js/utils/expressions/CompInterface.js +28 -0
  233. package/player/js/utils/expressions/EffectInterface.js +111 -0
  234. package/player/js/utils/expressions/ExpressionManager.js +752 -0
  235. package/player/js/utils/expressions/ExpressionPropertyDecorator.js +463 -0
  236. package/player/js/utils/expressions/ExpressionTextPropertyDecorator.js +40 -0
  237. package/player/js/utils/expressions/ExpressionValue.js +61 -0
  238. package/player/js/utils/expressions/ExpressionValueFactory.js +102 -0
  239. package/player/js/utils/expressions/Expressions.js +48 -0
  240. package/player/js/utils/expressions/FootageInterface.js +60 -0
  241. package/player/js/utils/expressions/InterfacesProvider.js +21 -0
  242. package/player/js/utils/expressions/LayerInterface.js +179 -0
  243. package/player/js/utils/expressions/MaskInterface.js +50 -0
  244. package/player/js/utils/expressions/ProjectInterface.js +31 -0
  245. package/player/js/utils/expressions/PropertyGroupFactory.js +13 -0
  246. package/player/js/utils/expressions/PropertyInterface.js +19 -0
  247. package/player/js/utils/expressions/ShapeInterface.js +543 -0
  248. package/player/js/utils/expressions/TextInterface.js +35 -0
  249. package/player/js/utils/expressions/TextSelectorPropertyDecorator.js +44 -0
  250. package/player/js/utils/expressions/TransformInterface.js +126 -0
  251. package/player/js/utils/expressions/expressionHelpers.js +86 -0
  252. package/player/js/utils/expressions/shapes/ShapePathInterface.js +47 -0
  253. package/player/js/utils/featureSupport.js +16 -0
  254. package/player/js/utils/filters.js +32 -0
  255. package/player/js/utils/functionExtensions.js +27 -0
  256. package/player/js/utils/getFontProperties.js +42 -0
  257. package/player/js/utils/helpers/arrays.js +43 -0
  258. package/player/js/utils/helpers/assetManager.js +96 -0
  259. package/player/js/utils/helpers/blendModes.js +26 -0
  260. package/player/js/utils/helpers/bufferManager.js +61 -0
  261. package/player/js/utils/helpers/dynamicProperties.js +29 -0
  262. package/player/js/utils/helpers/effectTypes.js +3 -0
  263. package/player/js/utils/helpers/html_elements.js +6 -0
  264. package/player/js/utils/helpers/propTypes.js +3 -0
  265. package/player/js/utils/helpers/shapeEnums.js +16 -0
  266. package/player/js/utils/helpers/svg_elements.js +8 -0
  267. package/player/js/utils/imagePreloader.js +213 -0
  268. package/player/js/utils/imagePreloaderWorkerOverride.js +3 -0
  269. package/player/js/utils/markers/markerParser.js +47 -0
  270. package/player/js/utils/pooling/bezier_length_pool.js +20 -0
  271. package/player/js/utils/pooling/point_pool.js +13 -0
  272. package/player/js/utils/pooling/pool_factory.js +44 -0
  273. package/player/js/utils/pooling/pooling.js +15 -0
  274. package/player/js/utils/pooling/segments_length_pool.js +24 -0
  275. package/player/js/utils/pooling/shapeCollection_pool.js +48 -0
  276. package/player/js/utils/pooling/shape_pool.js +44 -0
  277. package/player/js/utils/shapes/DashProperty.js +63 -0
  278. package/player/js/utils/shapes/GradientProperty.js +93 -0
  279. package/player/js/utils/shapes/MouseModifier.js +222 -0
  280. package/player/js/utils/shapes/OffsetPathModifier.js +306 -0
  281. package/player/js/utils/shapes/PuckerAndBloatModifier.js +80 -0
  282. package/player/js/utils/shapes/RepeaterModifier.js +232 -0
  283. package/player/js/utils/shapes/RoundCornersModifier.js +122 -0
  284. package/player/js/utils/shapes/ShapeCollection.js +29 -0
  285. package/player/js/utils/shapes/ShapeModifiers.js +71 -0
  286. package/player/js/utils/shapes/ShapePath.js +100 -0
  287. package/player/js/utils/shapes/ShapeProperty.js +546 -0
  288. package/player/js/utils/shapes/TrimModifier.js +359 -0
  289. package/player/js/utils/shapes/ZigZagModifier.js +174 -0
  290. package/player/js/utils/shapes/shapePathBuilder.js +20 -0
  291. package/player/js/utils/text/LetterProps.js +60 -0
  292. package/player/js/utils/text/TextAnimatorDataProperty.js +34 -0
  293. package/player/js/utils/text/TextAnimatorProperty.js +610 -0
  294. package/player/js/utils/text/TextProperty.js +461 -0
  295. package/player/js/utils/text/TextSelectorProperty.js +179 -0
  296. package/player/js/worker_wrapper.js +1029 -0
  297. package/rollup.config.js +215 -0
  298. package/tasks/build.js +773 -0
  299. package/tasks/build_worker.js +164 -0
  300. package/tasks/watch.js +34 -0
@@ -0,0 +1,366 @@
1
+ import {
2
+ extendPrototype,
3
+ } from '../../utils/functionExtensions';
4
+ import { getLocationHref } from '../../main';
5
+ import ShapePropertyFactory from '../../utils/shapes/ShapeProperty';
6
+ import BaseElement from '../BaseElement';
7
+ import TransformElement from '../helpers/TransformElement';
8
+ import SVGBaseElement from './SVGBaseElement';
9
+ import HierarchyElement from '../helpers/HierarchyElement';
10
+ import FrameElement from '../helpers/FrameElement';
11
+ import RenderableDOMElement from '../helpers/RenderableDOMElement';
12
+ import getBlendMode from '../../utils/helpers/blendModes';
13
+ import Matrix from '../../3rd_party/transformation-matrix';
14
+ import IShapeElement from '../ShapeElement';
15
+ import TransformPropertyFactory from '../../utils/TransformProperty';
16
+ import { ShapeModifiers } from '../../utils/shapes/ShapeModifiers';
17
+ import {
18
+ lineCapEnum,
19
+ lineJoinEnum,
20
+ } from '../../utils/helpers/shapeEnums';
21
+ import SVGShapeData from '../helpers/shapes/SVGShapeData';
22
+ import SVGStyleData from '../helpers/shapes/SVGStyleData';
23
+ import SVGStrokeStyleData from '../helpers/shapes/SVGStrokeStyleData';
24
+ import SVGFillStyleData from '../helpers/shapes/SVGFillStyleData';
25
+ import SVGNoStyleData from '../helpers/shapes/SVGNoStyleData';
26
+ import SVGGradientFillStyleData from '../helpers/shapes/SVGGradientFillStyleData';
27
+ import SVGGradientStrokeStyleData from '../helpers/shapes/SVGGradientStrokeStyleData';
28
+ import ShapeGroupData from '../helpers/shapes/ShapeGroupData';
29
+ import SVGTransformData from '../helpers/shapes/SVGTransformData';
30
+ import SVGElementsRenderer from '../helpers/shapes/SVGElementsRenderer';
31
+
32
+ function SVGShapeElement(data, globalData, comp) {
33
+ // List of drawable elements
34
+ this.shapes = [];
35
+ // Full shape data
36
+ this.shapesData = data.shapes;
37
+ // List of styles that will be applied to shapes
38
+ this.stylesList = [];
39
+ // List of modifiers that will be applied to shapes
40
+ this.shapeModifiers = [];
41
+ // List of items in shape tree
42
+ this.itemsData = [];
43
+ // List of items in previous shape tree
44
+ this.processedElements = [];
45
+ // List of animated components
46
+ this.animatedContents = [];
47
+ this.initElement(data, globalData, comp);
48
+ // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
49
+ // List of elements that have been created
50
+ this.prevViewData = [];
51
+ // Moving any property that doesn't get too much access after initialization because of v8 way of handling more than 10 properties.
52
+ }
53
+
54
+ extendPrototype([BaseElement, TransformElement, SVGBaseElement, IShapeElement, HierarchyElement, FrameElement, RenderableDOMElement], SVGShapeElement);
55
+
56
+ SVGShapeElement.prototype.initSecondaryElement = function () {
57
+ };
58
+
59
+ SVGShapeElement.prototype.identityMatrix = new Matrix();
60
+
61
+ SVGShapeElement.prototype.buildExpressionInterface = function () {};
62
+
63
+ SVGShapeElement.prototype.createContent = function () {
64
+ this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
65
+ this.filterUniqueShapes();
66
+ };
67
+
68
+ /*
69
+ This method searches for multiple shapes that affect a single element and one of them is animated
70
+ */
71
+ SVGShapeElement.prototype.filterUniqueShapes = function () {
72
+ var i;
73
+ var len = this.shapes.length;
74
+ var shape;
75
+ var j;
76
+ var jLen = this.stylesList.length;
77
+ var style;
78
+ var tempShapes = [];
79
+ var areAnimated = false;
80
+ for (j = 0; j < jLen; j += 1) {
81
+ style = this.stylesList[j];
82
+ areAnimated = false;
83
+ tempShapes.length = 0;
84
+ for (i = 0; i < len; i += 1) {
85
+ shape = this.shapes[i];
86
+ if (shape.styles.indexOf(style) !== -1) {
87
+ tempShapes.push(shape);
88
+ areAnimated = shape._isAnimated || areAnimated;
89
+ }
90
+ }
91
+ if (tempShapes.length > 1 && areAnimated) {
92
+ this.setShapesAsAnimated(tempShapes);
93
+ }
94
+ }
95
+ };
96
+
97
+ SVGShapeElement.prototype.setShapesAsAnimated = function (shapes) {
98
+ var i;
99
+ var len = shapes.length;
100
+ for (i = 0; i < len; i += 1) {
101
+ shapes[i].setAsAnimated();
102
+ }
103
+ };
104
+
105
+ SVGShapeElement.prototype.createStyleElement = function (data, level) {
106
+ // TODO: prevent drawing of hidden styles
107
+ var elementData;
108
+ var styleOb = new SVGStyleData(data, level);
109
+
110
+ var pathElement = styleOb.pElem;
111
+ if (data.ty === 'st') {
112
+ elementData = new SVGStrokeStyleData(this, data, styleOb);
113
+ } else if (data.ty === 'fl') {
114
+ elementData = new SVGFillStyleData(this, data, styleOb);
115
+ } else if (data.ty === 'gf' || data.ty === 'gs') {
116
+ var GradientConstructor = data.ty === 'gf' ? SVGGradientFillStyleData : SVGGradientStrokeStyleData;
117
+ elementData = new GradientConstructor(this, data, styleOb);
118
+ this.globalData.defs.appendChild(elementData.gf);
119
+ if (elementData.maskId) {
120
+ this.globalData.defs.appendChild(elementData.ms);
121
+ this.globalData.defs.appendChild(elementData.of);
122
+ pathElement.setAttribute('mask', 'url(' + getLocationHref() + '#' + elementData.maskId + ')');
123
+ }
124
+ } else if (data.ty === 'no') {
125
+ elementData = new SVGNoStyleData(this, data, styleOb);
126
+ }
127
+
128
+ if (data.ty === 'st' || data.ty === 'gs') {
129
+ pathElement.setAttribute('stroke-linecap', lineCapEnum[data.lc || 2]);
130
+ pathElement.setAttribute('stroke-linejoin', lineJoinEnum[data.lj || 2]);
131
+ pathElement.setAttribute('fill-opacity', '0');
132
+ if (data.lj === 1) {
133
+ pathElement.setAttribute('stroke-miterlimit', data.ml);
134
+ }
135
+ }
136
+
137
+ if (data.r === 2) {
138
+ pathElement.setAttribute('fill-rule', 'evenodd');
139
+ }
140
+
141
+ if (data.ln) {
142
+ pathElement.setAttribute('id', data.ln);
143
+ }
144
+ if (data.cl) {
145
+ pathElement.setAttribute('class', data.cl);
146
+ }
147
+ if (data.bm) {
148
+ pathElement.style['mix-blend-mode'] = getBlendMode(data.bm);
149
+ }
150
+ this.stylesList.push(styleOb);
151
+ this.addToAnimatedContents(data, elementData);
152
+ return elementData;
153
+ };
154
+
155
+ SVGShapeElement.prototype.createGroupElement = function (data) {
156
+ var elementData = new ShapeGroupData();
157
+ if (data.ln) {
158
+ elementData.gr.setAttribute('id', data.ln);
159
+ }
160
+ if (data.cl) {
161
+ elementData.gr.setAttribute('class', data.cl);
162
+ }
163
+ if (data.bm) {
164
+ elementData.gr.style['mix-blend-mode'] = getBlendMode(data.bm);
165
+ }
166
+ return elementData;
167
+ };
168
+
169
+ SVGShapeElement.prototype.createTransformElement = function (data, container) {
170
+ var transformProperty = TransformPropertyFactory.getTransformProperty(this, data, this);
171
+ var elementData = new SVGTransformData(transformProperty, transformProperty.o, container);
172
+ this.addToAnimatedContents(data, elementData);
173
+ return elementData;
174
+ };
175
+
176
+ SVGShapeElement.prototype.createShapeElement = function (data, ownTransformers, level) {
177
+ var ty = 4;
178
+ if (data.ty === 'rc') {
179
+ ty = 5;
180
+ } else if (data.ty === 'el') {
181
+ ty = 6;
182
+ } else if (data.ty === 'sr') {
183
+ ty = 7;
184
+ }
185
+ var shapeProperty = ShapePropertyFactory.getShapeProp(this, data, ty, this);
186
+ var elementData = new SVGShapeData(ownTransformers, level, shapeProperty);
187
+ this.shapes.push(elementData);
188
+ this.addShapeToModifiers(elementData);
189
+ this.addToAnimatedContents(data, elementData);
190
+ return elementData;
191
+ };
192
+
193
+ SVGShapeElement.prototype.addToAnimatedContents = function (data, element) {
194
+ var i = 0;
195
+ var len = this.animatedContents.length;
196
+ while (i < len) {
197
+ if (this.animatedContents[i].element === element) {
198
+ return;
199
+ }
200
+ i += 1;
201
+ }
202
+ this.animatedContents.push({
203
+ fn: SVGElementsRenderer.createRenderFunction(data),
204
+ element: element,
205
+ data: data,
206
+ });
207
+ };
208
+
209
+ SVGShapeElement.prototype.setElementStyles = function (elementData) {
210
+ var arr = elementData.styles;
211
+ var j;
212
+ var jLen = this.stylesList.length;
213
+ for (j = 0; j < jLen; j += 1) {
214
+ if (arr.indexOf(this.stylesList[j]) === -1 && !this.stylesList[j].closed) {
215
+ arr.push(this.stylesList[j]);
216
+ }
217
+ }
218
+ };
219
+
220
+ SVGShapeElement.prototype.reloadShapes = function () {
221
+ this._isFirstFrame = true;
222
+ var i;
223
+ var len = this.itemsData.length;
224
+ for (i = 0; i < len; i += 1) {
225
+ this.prevViewData[i] = this.itemsData[i];
226
+ }
227
+ this.searchShapes(this.shapesData, this.itemsData, this.prevViewData, this.layerElement, 0, [], true);
228
+ this.filterUniqueShapes();
229
+ len = this.dynamicProperties.length;
230
+ for (i = 0; i < len; i += 1) {
231
+ this.dynamicProperties[i].getValue();
232
+ }
233
+ this.renderModifiers();
234
+ };
235
+
236
+ SVGShapeElement.prototype.searchShapes = function (arr, itemsData, prevViewData, container, level, transformers, render) {
237
+ var ownTransformers = [].concat(transformers);
238
+ var i;
239
+ var len = arr.length - 1;
240
+ var j;
241
+ var jLen;
242
+ var ownStyles = [];
243
+ var ownModifiers = [];
244
+ var currentTransform;
245
+ var modifier;
246
+ var processedPos;
247
+ for (i = len; i >= 0; i -= 1) {
248
+ processedPos = this.searchProcessedElement(arr[i]);
249
+ if (!processedPos) {
250
+ arr[i]._render = render;
251
+ } else {
252
+ itemsData[i] = prevViewData[processedPos - 1];
253
+ }
254
+ if (arr[i].ty === 'fl' || arr[i].ty === 'st' || arr[i].ty === 'gf' || arr[i].ty === 'gs' || arr[i].ty === 'no') {
255
+ if (!processedPos) {
256
+ itemsData[i] = this.createStyleElement(arr[i], level);
257
+ } else {
258
+ itemsData[i].style.closed = arr[i].hd;
259
+ }
260
+ if (arr[i]._render) {
261
+ if (itemsData[i].style.pElem.parentNode !== container) {
262
+ container.appendChild(itemsData[i].style.pElem);
263
+ }
264
+ }
265
+ ownStyles.push(itemsData[i].style);
266
+ } else if (arr[i].ty === 'gr') {
267
+ if (!processedPos) {
268
+ itemsData[i] = this.createGroupElement(arr[i]);
269
+ } else {
270
+ jLen = itemsData[i].it.length;
271
+ for (j = 0; j < jLen; j += 1) {
272
+ itemsData[i].prevViewData[j] = itemsData[i].it[j];
273
+ }
274
+ }
275
+ this.searchShapes(arr[i].it, itemsData[i].it, itemsData[i].prevViewData, itemsData[i].gr, level + 1, ownTransformers, render);
276
+ if (arr[i]._render) {
277
+ if (itemsData[i].gr.parentNode !== container) {
278
+ container.appendChild(itemsData[i].gr);
279
+ }
280
+ }
281
+ } else if (arr[i].ty === 'tr') {
282
+ if (!processedPos) {
283
+ itemsData[i] = this.createTransformElement(arr[i], container);
284
+ }
285
+ currentTransform = itemsData[i].transform;
286
+ ownTransformers.push(currentTransform);
287
+ } else if (arr[i].ty === 'sh' || arr[i].ty === 'rc' || arr[i].ty === 'el' || arr[i].ty === 'sr') {
288
+ if (!processedPos) {
289
+ itemsData[i] = this.createShapeElement(arr[i], ownTransformers, level);
290
+ }
291
+ this.setElementStyles(itemsData[i]);
292
+ } else if (arr[i].ty === 'tm' || arr[i].ty === 'rd' || arr[i].ty === 'ms' || arr[i].ty === 'pb' || arr[i].ty === 'zz' || arr[i].ty === 'op') {
293
+ if (!processedPos) {
294
+ modifier = ShapeModifiers.getModifier(arr[i].ty);
295
+ modifier.init(this, arr[i]);
296
+ itemsData[i] = modifier;
297
+ this.shapeModifiers.push(modifier);
298
+ } else {
299
+ modifier = itemsData[i];
300
+ modifier.closed = false;
301
+ }
302
+ ownModifiers.push(modifier);
303
+ } else if (arr[i].ty === 'rp') {
304
+ if (!processedPos) {
305
+ modifier = ShapeModifiers.getModifier(arr[i].ty);
306
+ itemsData[i] = modifier;
307
+ modifier.init(this, arr, i, itemsData);
308
+ this.shapeModifiers.push(modifier);
309
+ render = false;
310
+ } else {
311
+ modifier = itemsData[i];
312
+ modifier.closed = true;
313
+ }
314
+ ownModifiers.push(modifier);
315
+ }
316
+ this.addProcessedElement(arr[i], i + 1);
317
+ }
318
+ len = ownStyles.length;
319
+ for (i = 0; i < len; i += 1) {
320
+ ownStyles[i].closed = true;
321
+ }
322
+ len = ownModifiers.length;
323
+ for (i = 0; i < len; i += 1) {
324
+ ownModifiers[i].closed = true;
325
+ }
326
+ };
327
+
328
+ SVGShapeElement.prototype.renderInnerContent = function () {
329
+ this.renderModifiers();
330
+ var i;
331
+ var len = this.stylesList.length;
332
+ for (i = 0; i < len; i += 1) {
333
+ this.stylesList[i].reset();
334
+ }
335
+ this.renderShape();
336
+ for (i = 0; i < len; i += 1) {
337
+ if (this.stylesList[i]._mdf || this._isFirstFrame) {
338
+ if (this.stylesList[i].msElem) {
339
+ this.stylesList[i].msElem.setAttribute('d', this.stylesList[i].d);
340
+ // Adding M0 0 fixes same mask bug on all browsers
341
+ this.stylesList[i].d = 'M0 0' + this.stylesList[i].d;
342
+ }
343
+ this.stylesList[i].pElem.setAttribute('d', this.stylesList[i].d || 'M0 0');
344
+ }
345
+ }
346
+ };
347
+
348
+ SVGShapeElement.prototype.renderShape = function () {
349
+ var i;
350
+ var len = this.animatedContents.length;
351
+ var animatedContent;
352
+ for (i = 0; i < len; i += 1) {
353
+ animatedContent = this.animatedContents[i];
354
+ if ((this._isFirstFrame || animatedContent.element._isAnimated) && animatedContent.data !== true) {
355
+ animatedContent.fn(animatedContent.data, animatedContent.element, this._isFirstFrame);
356
+ }
357
+ }
358
+ };
359
+
360
+ SVGShapeElement.prototype.destroy = function () {
361
+ this.destroyBaseElement();
362
+ this.shapesData = null;
363
+ this.itemsData = null;
364
+ };
365
+
366
+ export default SVGShapeElement;
@@ -0,0 +1,322 @@
1
+ import {
2
+ extendPrototype,
3
+ } from '../../utils/functionExtensions';
4
+ import {
5
+ createSizedArray,
6
+ } from '../../utils/helpers/arrays';
7
+ import createNS from '../../utils/helpers/svg_elements';
8
+ import BaseElement from '../BaseElement';
9
+ import TransformElement from '../helpers/TransformElement';
10
+ import SVGBaseElement from './SVGBaseElement';
11
+ import HierarchyElement from '../helpers/HierarchyElement';
12
+ import FrameElement from '../helpers/FrameElement';
13
+ import RenderableDOMElement from '../helpers/RenderableDOMElement';
14
+ import ITextElement from '../TextElement';
15
+ import SVGCompElement from './SVGCompElement'; // eslint-disable-line
16
+ import SVGShapeElement from './SVGShapeElement';
17
+
18
+ var emptyShapeData = {
19
+ shapes: [],
20
+ };
21
+
22
+ function SVGTextLottieElement(data, globalData, comp) {
23
+ this.textSpans = [];
24
+ this.renderType = 'svg';
25
+ this.initElement(data, globalData, comp);
26
+ }
27
+
28
+ extendPrototype([BaseElement, TransformElement, SVGBaseElement, HierarchyElement, FrameElement, RenderableDOMElement, ITextElement], SVGTextLottieElement);
29
+
30
+ SVGTextLottieElement.prototype.createContent = function () {
31
+ if (this.data.singleShape && !this.globalData.fontManager.chars) {
32
+ this.textContainer = createNS('text');
33
+ }
34
+ };
35
+
36
+ SVGTextLottieElement.prototype.buildTextContents = function (textArray) {
37
+ var i = 0;
38
+ var len = textArray.length;
39
+ var textContents = [];
40
+ var currentTextContent = '';
41
+ while (i < len) {
42
+ if (textArray[i] === String.fromCharCode(13) || textArray[i] === String.fromCharCode(3)) {
43
+ textContents.push(currentTextContent);
44
+ currentTextContent = '';
45
+ } else {
46
+ currentTextContent += textArray[i];
47
+ }
48
+ i += 1;
49
+ }
50
+ textContents.push(currentTextContent);
51
+ return textContents;
52
+ };
53
+
54
+ SVGTextLottieElement.prototype.buildShapeData = function (data, scale) {
55
+ // data should probably be cloned to apply scale separately to each instance of a text on different layers
56
+ // but since text internal content gets only rendered once and then it's never rerendered,
57
+ // it's probably safe not to clone data and reuse always the same instance even if the object is mutated.
58
+ // Avoiding cloning is preferred since cloning each character shape data is expensive
59
+ if (data.shapes && data.shapes.length) {
60
+ var shape = data.shapes[0];
61
+ if (shape.it) {
62
+ var shapeItem = shape.it[shape.it.length - 1];
63
+ if (shapeItem.s) {
64
+ shapeItem.s.k[0] = scale;
65
+ shapeItem.s.k[1] = scale;
66
+ }
67
+ }
68
+ }
69
+ return data;
70
+ };
71
+
72
+ SVGTextLottieElement.prototype.buildNewText = function () {
73
+ this.addDynamicProperty(this);
74
+ var i;
75
+ var len;
76
+
77
+ var documentData = this.textProperty.currentData;
78
+ this.renderedLetters = createSizedArray(documentData ? documentData.l.length : 0);
79
+ if (documentData.fc) {
80
+ this.layerElement.setAttribute('fill', this.buildColor(documentData.fc));
81
+ } else {
82
+ this.layerElement.setAttribute('fill', 'rgba(0,0,0,0)');
83
+ }
84
+ if (documentData.sc) {
85
+ this.layerElement.setAttribute('stroke', this.buildColor(documentData.sc));
86
+ this.layerElement.setAttribute('stroke-width', documentData.sw);
87
+ }
88
+ this.layerElement.setAttribute('font-size', documentData.finalSize);
89
+ var fontData = this.globalData.fontManager.getFontByName(documentData.f);
90
+ if (fontData.fClass) {
91
+ this.layerElement.setAttribute('class', fontData.fClass);
92
+ } else {
93
+ this.layerElement.setAttribute('font-family', fontData.fFamily);
94
+ var fWeight = documentData.fWeight;
95
+ var fStyle = documentData.fStyle;
96
+ this.layerElement.setAttribute('font-style', fStyle);
97
+ this.layerElement.setAttribute('font-weight', fWeight);
98
+ }
99
+ this.layerElement.setAttribute('aria-label', documentData.t);
100
+
101
+ var letters = documentData.l || [];
102
+ var usesGlyphs = !!this.globalData.fontManager.chars;
103
+ len = letters.length;
104
+
105
+ var tSpan;
106
+ var matrixHelper = this.mHelper;
107
+ var shapeStr = '';
108
+ var singleShape = this.data.singleShape;
109
+ var xPos = 0;
110
+ var yPos = 0;
111
+ var firstLine = true;
112
+ var trackingOffset = documentData.tr * 0.001 * documentData.finalSize;
113
+ if (singleShape && !usesGlyphs && !documentData.sz) {
114
+ var tElement = this.textContainer;
115
+ var justify = 'start';
116
+ switch (documentData.j) {
117
+ case 1:
118
+ justify = 'end';
119
+ break;
120
+ case 2:
121
+ justify = 'middle';
122
+ break;
123
+ default:
124
+ justify = 'start';
125
+ break;
126
+ }
127
+ tElement.setAttribute('text-anchor', justify);
128
+ tElement.setAttribute('letter-spacing', trackingOffset);
129
+ var textContent = this.buildTextContents(documentData.finalText);
130
+ len = textContent.length;
131
+ yPos = documentData.ps ? documentData.ps[1] + documentData.ascent : 0;
132
+ for (i = 0; i < len; i += 1) {
133
+ tSpan = this.textSpans[i].span || createNS('tspan');
134
+ tSpan.textContent = textContent[i];
135
+ tSpan.setAttribute('x', 0);
136
+ tSpan.setAttribute('y', yPos);
137
+ tSpan.style.display = 'inherit';
138
+ tElement.appendChild(tSpan);
139
+ if (!this.textSpans[i]) {
140
+ this.textSpans[i] = {
141
+ span: null,
142
+ glyph: null,
143
+ };
144
+ }
145
+ this.textSpans[i].span = tSpan;
146
+ yPos += documentData.finalLineHeight;
147
+ }
148
+
149
+ this.layerElement.appendChild(tElement);
150
+ } else {
151
+ var cachedSpansLength = this.textSpans.length;
152
+ var charData;
153
+ for (i = 0; i < len; i += 1) {
154
+ if (!this.textSpans[i]) {
155
+ this.textSpans[i] = {
156
+ span: null,
157
+ childSpan: null,
158
+ glyph: null,
159
+ };
160
+ }
161
+ if (!usesGlyphs || !singleShape || i === 0) {
162
+ tSpan = cachedSpansLength > i ? this.textSpans[i].span : createNS(usesGlyphs ? 'g' : 'text');
163
+ if (cachedSpansLength <= i) {
164
+ tSpan.setAttribute('stroke-linecap', 'butt');
165
+ tSpan.setAttribute('stroke-linejoin', 'round');
166
+ tSpan.setAttribute('stroke-miterlimit', '4');
167
+ this.textSpans[i].span = tSpan;
168
+ if (usesGlyphs) {
169
+ var childSpan = createNS('g');
170
+ tSpan.appendChild(childSpan);
171
+ this.textSpans[i].childSpan = childSpan;
172
+ }
173
+ this.textSpans[i].span = tSpan;
174
+ this.layerElement.appendChild(tSpan);
175
+ }
176
+ tSpan.style.display = 'inherit';
177
+ }
178
+
179
+ matrixHelper.reset();
180
+ if (singleShape) {
181
+ if (letters[i].n) {
182
+ xPos = -trackingOffset;
183
+ yPos += documentData.yOffset;
184
+ yPos += firstLine ? 1 : 0;
185
+ firstLine = false;
186
+ }
187
+ this.applyTextPropertiesToMatrix(documentData, matrixHelper, letters[i].line, xPos, yPos);
188
+ xPos += letters[i].l || 0;
189
+ // xPos += letters[i].val === ' ' ? 0 : trackingOffset;
190
+ xPos += trackingOffset;
191
+ }
192
+ if (usesGlyphs) {
193
+ charData = this.globalData.fontManager.getCharData(
194
+ documentData.finalText[i],
195
+ fontData.fStyle,
196
+ this.globalData.fontManager.getFontByName(documentData.f).fFamily
197
+ );
198
+ var glyphElement;
199
+ // t === 1 means the character has been replaced with an animated shaped
200
+ if (charData.t === 1) {
201
+ glyphElement = new SVGCompElement(charData.data, this.globalData, this);
202
+ } else {
203
+ var data = emptyShapeData;
204
+ if (charData.data && charData.data.shapes) {
205
+ data = this.buildShapeData(charData.data, documentData.finalSize);
206
+ }
207
+ glyphElement = new SVGShapeElement(data, this.globalData, this);
208
+ }
209
+ if (this.textSpans[i].glyph) {
210
+ var glyph = this.textSpans[i].glyph;
211
+ this.textSpans[i].childSpan.removeChild(glyph.layerElement);
212
+ glyph.destroy();
213
+ }
214
+ this.textSpans[i].glyph = glyphElement;
215
+ glyphElement._debug = true;
216
+ glyphElement.prepareFrame(0);
217
+ glyphElement.renderFrame();
218
+ this.textSpans[i].childSpan.appendChild(glyphElement.layerElement);
219
+ // when using animated shapes, the layer will be scaled instead of replacing the internal scale
220
+ // this might have issues with strokes and might need a different solution
221
+ if (charData.t === 1) {
222
+ this.textSpans[i].childSpan.setAttribute('transform', 'scale(' + documentData.finalSize / 100 + ',' + documentData.finalSize / 100 + ')');
223
+ }
224
+ } else {
225
+ if (singleShape) {
226
+ tSpan.setAttribute('transform', 'translate(' + matrixHelper.props[12] + ',' + matrixHelper.props[13] + ')');
227
+ }
228
+ tSpan.textContent = letters[i].val;
229
+ tSpan.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:space', 'preserve');
230
+ }
231
+ //
232
+ }
233
+ if (singleShape && tSpan) {
234
+ tSpan.setAttribute('d', shapeStr);
235
+ }
236
+ }
237
+ while (i < this.textSpans.length) {
238
+ this.textSpans[i].span.style.display = 'none';
239
+ i += 1;
240
+ }
241
+
242
+ this._sizeChanged = true;
243
+ };
244
+
245
+ SVGTextLottieElement.prototype.sourceRectAtTime = function () {
246
+ this.prepareFrame(this.comp.renderedFrame - this.data.st);
247
+ this.renderInnerContent();
248
+ if (this._sizeChanged) {
249
+ this._sizeChanged = false;
250
+ var textBox = this.layerElement.getBBox();
251
+ this.bbox = {
252
+ top: textBox.y,
253
+ left: textBox.x,
254
+ width: textBox.width,
255
+ height: textBox.height,
256
+ };
257
+ }
258
+ return this.bbox;
259
+ };
260
+
261
+ SVGTextLottieElement.prototype.getValue = function () {
262
+ var i;
263
+ var len = this.textSpans.length;
264
+ var glyphElement;
265
+ this.renderedFrame = this.comp.renderedFrame;
266
+ for (i = 0; i < len; i += 1) {
267
+ glyphElement = this.textSpans[i].glyph;
268
+ if (glyphElement) {
269
+ glyphElement.prepareFrame(this.comp.renderedFrame - this.data.st);
270
+ if (glyphElement._mdf) {
271
+ this._mdf = true;
272
+ }
273
+ }
274
+ }
275
+ };
276
+
277
+ SVGTextLottieElement.prototype.renderInnerContent = function () {
278
+ this.validateText();
279
+ if (!this.data.singleShape || this._mdf) {
280
+ this.textAnimator.getMeasures(this.textProperty.currentData, this.lettersChangedFlag);
281
+ if (this.lettersChangedFlag || this.textAnimator.lettersChangedFlag) {
282
+ this._sizeChanged = true;
283
+ var i;
284
+ var len;
285
+ var renderedLetters = this.textAnimator.renderedLetters;
286
+
287
+ var letters = this.textProperty.currentData.l;
288
+
289
+ len = letters.length;
290
+ var renderedLetter;
291
+ var textSpan;
292
+ var glyphElement;
293
+ for (i = 0; i < len; i += 1) {
294
+ if (!letters[i].n) {
295
+ renderedLetter = renderedLetters[i];
296
+ textSpan = this.textSpans[i].span;
297
+ glyphElement = this.textSpans[i].glyph;
298
+ if (glyphElement) {
299
+ glyphElement.renderFrame();
300
+ }
301
+ if (renderedLetter._mdf.m) {
302
+ textSpan.setAttribute('transform', renderedLetter.m);
303
+ }
304
+ if (renderedLetter._mdf.o) {
305
+ textSpan.setAttribute('opacity', renderedLetter.o);
306
+ }
307
+ if (renderedLetter._mdf.sw) {
308
+ textSpan.setAttribute('stroke-width', renderedLetter.sw);
309
+ }
310
+ if (renderedLetter._mdf.sc) {
311
+ textSpan.setAttribute('stroke', renderedLetter.sc);
312
+ }
313
+ if (renderedLetter._mdf.fc) {
314
+ textSpan.setAttribute('fill', renderedLetter.fc);
315
+ }
316
+ }
317
+ }
318
+ }
319
+ }
320
+ };
321
+
322
+ export default SVGTextLottieElement;