@octane-xplat/lottie 0.9.0 → 0.10.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 (313) hide show
  1. package/README.md +36 -16
  2. package/dist/native/index.js +10 -9
  3. package/dist/native/octane-client-build.json +1 -1
  4. package/dist/web/index.js +39 -25
  5. package/dist/web/octane-client-build.json +1 -1
  6. package/package.json +25 -3
  7. package/platforms/macos/LICENSE-EpoxyCore-Apache-2.0.txt +201 -0
  8. package/platforms/macos/LICENSE-LRUCache-MIT.txt +22 -0
  9. package/platforms/macos/LICENSE-Lottie-Apache-2.0.txt +201 -0
  10. package/platforms/macos/LICENSE-ZIPFoundation-MIT.txt +21 -0
  11. package/platforms/macos/UPSTREAM.md +13 -0
  12. package/platforms/macos/resources/PrivacyInfo.xcprivacy +23 -0
  13. package/platforms/macos/resources/THIRD-PARTY-NOTICES.txt +10 -0
  14. package/platforms/macos/src/XplatAppKitLottie.swift +246 -0
  15. package/platforms/macos/src/vendor/Lottie/PrivacyInfo.xcprivacy +23 -0
  16. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CAAnimation+TimingConfiguration.swift +81 -0
  17. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CALayer+addAnimation.swift +476 -0
  18. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CombinedShapeAnimation.swift +92 -0
  19. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CustomPathAnimation.swift +89 -0
  20. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/DropShadowAnimation.swift +179 -0
  21. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/EllipseAnimation.swift +53 -0
  22. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/GradientAnimations.swift +287 -0
  23. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/LayerProperty.swift +440 -0
  24. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/OpacityAnimation.swift +53 -0
  25. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/RectangleAnimation.swift +59 -0
  26. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/ShapeAnimation.swift +246 -0
  27. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/StarAnimation.swift +119 -0
  28. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/StrokeAnimation.swift +96 -0
  29. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/TransformAnimations.swift +380 -0
  30. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/VisibilityAnimation.swift +63 -0
  31. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/CompatibilityTracker.swift +129 -0
  32. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/CoreAnimationLayer.swift +645 -0
  33. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/CALayer+fillBounds.swift +35 -0
  34. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/KeyframeGroup+exactlyOneKeyframe.swift +28 -0
  35. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/Keyframes+combined.swift +345 -0
  36. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/Keyframes+timeRemapping.swift +46 -0
  37. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/AnimationLayer.swift +169 -0
  38. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/BaseAnimationLayer.swift +46 -0
  39. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/BaseCompositionLayer.swift +120 -0
  40. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/CALayer+setupLayerHierarchy.swift +169 -0
  41. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/GradientRenderLayer.swift +101 -0
  42. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ImageLayer.swift +81 -0
  43. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/InfiniteOpaqueAnimationLayer.swift +57 -0
  44. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/LayerModel+makeAnimationLayer.swift +59 -0
  45. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/MaskCompositionLayer.swift +139 -0
  46. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/PreCompLayer.swift +107 -0
  47. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/RepeaterLayer.swift +113 -0
  48. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ShapeItemLayer.swift +346 -0
  49. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ShapeLayer.swift +569 -0
  50. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/SolidLayer.swift +66 -0
  51. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/TextLayer.swift +157 -0
  52. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/TransformLayer.swift +13 -0
  53. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/ValueProviderStore.swift +157 -0
  54. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/Collection+Diff.swift +267 -0
  55. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/Diffable.swift +19 -0
  56. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/DiffableSection.swift +16 -0
  57. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/IndexChangeset.swift +187 -0
  58. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/SectionedChangeset.swift +22 -0
  59. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Logging/EpoxyLogger.swift +102 -0
  60. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/CallbackContextEpoxyModeled.swift +8 -0
  61. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelArrayBuilder.swift +48 -0
  62. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelProperty.swift +158 -0
  63. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelStorage.swift +88 -0
  64. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModeled.swift +54 -0
  65. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/AnyEpoxyModelProperty.swift +31 -0
  66. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/ClassReference.swift +39 -0
  67. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/AnimatedProviding.swift +10 -0
  68. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DataIDProviding.swift +58 -0
  69. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidDisplayProviding.swift +41 -0
  70. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidEndDisplayingProviding.swift +42 -0
  71. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidSelectProviding.swift +36 -0
  72. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ErasedContentProviding.swift +49 -0
  73. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/MakeViewProviding.swift +61 -0
  74. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetBehaviorsProviding.swift +38 -0
  75. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetContentProviding.swift +38 -0
  76. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/StyleIDProviding.swift +38 -0
  77. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/TraitCollectionProviding.swift +14 -0
  78. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewDifferentiatorProviding.swift +34 -0
  79. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewProviding.swift +13 -0
  80. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/WillDisplayProviding.swift +41 -0
  81. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/ViewEpoxyModeled.swift +10 -0
  82. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/README.md +30 -0
  83. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUIIntrinsicContentSizeInvalidator.swift +34 -0
  84. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUILayoutMargins.swift +38 -0
  85. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxyableView+SwiftUIView.swift +165 -0
  86. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/MeasuringViewRepresentable.swift +127 -0
  87. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/SwiftUIMeasurementContainer.swift +468 -0
  88. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/SwiftUIView.swift +146 -0
  89. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIView+SwiftUIView.swift +39 -0
  90. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIViewConfiguringSwiftUIView.swift +41 -0
  91. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/BehaviorsConfigurableView.swift +45 -0
  92. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/ContentConfigurableView.swift +36 -0
  93. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/EpoxyableView.swift +5 -0
  94. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/StyledView.swift +43 -0
  95. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/ViewType.swift +47 -0
  96. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/LRUCache/LRUCache.swift +257 -0
  97. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/LRUCache/README.md +24 -0
  98. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/README.md +43 -0
  99. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+BackingConfiguration.swift +149 -0
  100. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Deprecated.swift +23 -0
  101. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Helpers.swift +361 -0
  102. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+MemoryFile.swift +205 -0
  103. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Progress.swift +66 -0
  104. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Reading.swift +160 -0
  105. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+ReadingDeprecated.swift +50 -0
  106. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Writing.swift +403 -0
  107. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+WritingDeprecated.swift +95 -0
  108. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+ZIP64.swift +191 -0
  109. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive.swift +404 -0
  110. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+Compression.swift +632 -0
  111. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+CompressionDeprecated.swift +43 -0
  112. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+Serialization.swift +146 -0
  113. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Date+ZIP.swift +101 -0
  114. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry+Serialization.swift +191 -0
  115. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry+ZIP64.swift +170 -0
  116. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry.swift +669 -0
  117. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIP.swift +405 -0
  118. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIPDeprecated.swift +28 -0
  119. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/README.md +24 -0
  120. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/URL+ZIP.swift +34 -0
  121. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/CompositionLayer.swift +177 -0
  122. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/ImageCompositionLayer.swift +54 -0
  123. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/MaskContainerLayer.swift +191 -0
  124. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/NullCompositionLayer.swift +28 -0
  125. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/PreCompositionLayer.swift +137 -0
  126. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/ShapeCompositionLayer.swift +60 -0
  127. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/SolidCompositionLayer.swift +57 -0
  128. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/TextCompositionLayer.swift +247 -0
  129. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/MainThreadAnimationLayer.swift +321 -0
  130. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CachedImageProvider.swift +56 -0
  131. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CompositionLayersInitializer.swift +103 -0
  132. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CoreTextRenderLayer.swift +424 -0
  133. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/InvertedMatteLayer.swift +55 -0
  134. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerFontProvider.swift +39 -0
  135. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerImageProvider.swift +52 -0
  136. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerTextProvider.swift +38 -0
  137. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerTransformNode.swift +149 -0
  138. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Extensions/ItemsExtension.swift +146 -0
  139. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/NodeProperty.swift +62 -0
  140. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyNodeProperty.swift +53 -0
  141. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyValueContainer.swift +26 -0
  142. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/KeypathSearchable.swift +23 -0
  143. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/NodePropertyMap.swift +43 -0
  144. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueContainer.swift +47 -0
  145. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueProviders/GroupInterpolator.swift +39 -0
  146. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueProviders/SingleValueProvider.swift +43 -0
  147. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/DropShadowNode.swift +102 -0
  148. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/LayerEffectNode.swift +25 -0
  149. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/RoundedCornersNode.swift +85 -0
  150. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/TrimPathNode.swift +281 -0
  151. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/GroupOutputNode.swift +74 -0
  152. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/PassThroughOutputNode.swift +47 -0
  153. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/PathOutputNode.swift +89 -0
  154. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/FillRenderer.swift +69 -0
  155. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientFillRenderer.swift +253 -0
  156. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientStrokeRenderer.swift +64 -0
  157. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/LegacyGradientFillRenderer.swift +158 -0
  158. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/StrokeRenderer.swift +165 -0
  159. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/EllipseNode.swift +143 -0
  160. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/PolygonNode.swift +173 -0
  161. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/RectNode.swift +238 -0
  162. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/ShapeNode.swift +73 -0
  163. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/StarNode.swift +224 -0
  164. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderContainers/GroupNode.swift +162 -0
  165. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/FillNode.swift +88 -0
  166. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientFillNode.swift +103 -0
  167. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientStrokeNode.swift +149 -0
  168. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/StrokeNode.swift +179 -0
  169. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/Text/TextAnimatorNode.swift +345 -0
  170. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/AnimatorNode.swift +197 -0
  171. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/PathNode.swift +20 -0
  172. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/RenderNode.swift +60 -0
  173. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeContainerLayer.swift +78 -0
  174. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeRenderLayer.swift +98 -0
  175. package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/Asset.swift +51 -0
  176. package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/AssetLibrary.swift +75 -0
  177. package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/ImageAsset.swift +141 -0
  178. package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/PrecompAsset.swift +47 -0
  179. package/platforms/macos/src/vendor/Lottie/Private/Model/DictionaryInitializable.swift +73 -0
  180. package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieAnimation.swift +57 -0
  181. package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieImageProvider.swift +89 -0
  182. package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieManifest.swift +42 -0
  183. package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieUtils.swift +71 -0
  184. package/platforms/macos/src/vendor/Lottie/Private/Model/Extensions/Bundle.swift +58 -0
  185. package/platforms/macos/src/vendor/Lottie/Private/Model/Extensions/KeyedDecodingContainerExtensions.swift +71 -0
  186. package/platforms/macos/src/vendor/Lottie/Private/Model/Keyframes/KeyframeData.swift +111 -0
  187. package/platforms/macos/src/vendor/Lottie/Private/Model/Keyframes/KeyframeGroup.swift +265 -0
  188. package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/DropShadowEffect.swift +52 -0
  189. package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/ColorEffectValue.swift +45 -0
  190. package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/EffectValue.swift +98 -0
  191. package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/Vector1DEffectValue.swift +45 -0
  192. package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/LayerEffect.swift +103 -0
  193. package/platforms/macos/src/vendor/Lottie/Private/Model/LayerStyles/DropShadowStyle.swift +79 -0
  194. package/platforms/macos/src/vendor/Lottie/Private/Model/LayerStyles/LayerStyle.swift +85 -0
  195. package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/ImageLayerModel.swift +49 -0
  196. package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/LayerModel.swift +266 -0
  197. package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/PreCompLayerModel.swift +74 -0
  198. package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/ShapeLayerModel.swift +50 -0
  199. package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/SolidLayerModel.swift +63 -0
  200. package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/TextLayerModel.swift +65 -0
  201. package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/DashPattern.swift +42 -0
  202. package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Marker.swift +35 -0
  203. package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Mask.swift +80 -0
  204. package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Transform.swift +261 -0
  205. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Ellipse.swift +79 -0
  206. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Fill.swift +79 -0
  207. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/GradientFill.swift +142 -0
  208. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/GradientStroke.swift +244 -0
  209. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Group.swift +55 -0
  210. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Merge.swift +63 -0
  211. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Rectangle.swift +79 -0
  212. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Repeater.swift +181 -0
  213. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/RoundedCorners.swift +53 -0
  214. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Shape.swift +63 -0
  215. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/ShapeItem.swift +171 -0
  216. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/ShapeTransform.swift +202 -0
  217. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Star.swift +136 -0
  218. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Stroke.swift +144 -0
  219. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Trim.swift +90 -0
  220. package/platforms/macos/src/vendor/Lottie/Private/Model/Text/Font.swift +67 -0
  221. package/platforms/macos/src/vendor/Lottie/Private/Model/Text/Glyph.swift +94 -0
  222. package/platforms/macos/src/vendor/Lottie/Private/Model/Text/TextAnimator.swift +240 -0
  223. package/platforms/macos/src/vendor/Lottie/Private/Model/Text/TextDocument.swift +142 -0
  224. package/platforms/macos/src/vendor/Lottie/Private/RootAnimationLayer.swift +54 -0
  225. package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/AnimatorNodeDebugging.swift +23 -0
  226. package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/LayerDebugging.swift +231 -0
  227. package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/TestHelpers.swift +10 -0
  228. package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/AnimationKeypathExtension.swift +303 -0
  229. package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/BlendMode+Filter.swift +31 -0
  230. package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/CGColor+RGB.swift +45 -0
  231. package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/CGFloatExtensions.swift +152 -0
  232. package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/DataExtension.swift +33 -0
  233. package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/MathKit.swift +454 -0
  234. package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/StringExtensions.swift +44 -0
  235. package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/AnimationContext.swift +95 -0
  236. package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/AnyEquatable.swift +23 -0
  237. package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/Binding+Map.swift +19 -0
  238. package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/View+ValueChanged.swift +35 -0
  239. package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/InterpolatableExtensions.swift +143 -0
  240. package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/KeyframeExtensions.swift +47 -0
  241. package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/KeyframeInterpolator.swift +250 -0
  242. package/platforms/macos/src/vendor/Lottie/Private/Utility/LottieAnimationSource.swift +51 -0
  243. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/BezierPath.swift +509 -0
  244. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/BezierPathRoundExtension.swift +163 -0
  245. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CGPointExtension.swift +35 -0
  246. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/ColorExtension.swift +101 -0
  247. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CompoundBezierPath.swift +169 -0
  248. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CurveVertex.swift +190 -0
  249. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/PathElement.swift +78 -0
  250. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/UnitBezier.swift +119 -0
  251. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/VectorsExtensions.swift +368 -0
  252. package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimation.swift +179 -0
  253. package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationHelpers.swift +317 -0
  254. package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationLayer.swift +1582 -0
  255. package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationView.swift +1090 -0
  256. package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationViewInitializers.swift +226 -0
  257. package/platforms/macos/src/vendor/Lottie/Public/Animation/LottiePlaybackMode.swift +266 -0
  258. package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieView.swift +643 -0
  259. package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/AnimationCacheProvider.swift +21 -0
  260. package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/DefaultAnimationCache.swift +67 -0
  261. package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/LRUAnimationCache.swift +11 -0
  262. package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/LottieAnimationCache.swift +15 -0
  263. package/platforms/macos/src/vendor/Lottie/Public/Configuration/DecodingStrategy.swift +15 -0
  264. package/platforms/macos/src/vendor/Lottie/Public/Configuration/LottieConfiguration.swift +54 -0
  265. package/platforms/macos/src/vendor/Lottie/Public/Configuration/LottieURLSession.swift +31 -0
  266. package/platforms/macos/src/vendor/Lottie/Public/Configuration/ReducedMotionOption.swift +128 -0
  267. package/platforms/macos/src/vendor/Lottie/Public/Configuration/RenderingEngineOption.swift +117 -0
  268. package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedButton.swift +128 -0
  269. package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedControl.swift +248 -0
  270. package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedSwitch.swift +271 -0
  271. package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieButton.swift +119 -0
  272. package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieSwitch.swift +144 -0
  273. package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieViewType.swift +79 -0
  274. package/platforms/macos/src/vendor/Lottie/Public/DotLottie/Cache/DotLottieCache.swift +66 -0
  275. package/platforms/macos/src/vendor/Lottie/Public/DotLottie/Cache/DotLottieCacheProvider.swift +21 -0
  276. package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieConfiguration.swift +72 -0
  277. package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieFile.swift +186 -0
  278. package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieFileHelpers.swift +386 -0
  279. package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/AnimationKeypath.swift +57 -0
  280. package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/AnyValueProvider.swift +132 -0
  281. package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/ColorValueProvider.swift +96 -0
  282. package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/FloatValueProvider.swift +81 -0
  283. package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/GradientValueProvider.swift +138 -0
  284. package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/PointValueProvider.swift +81 -0
  285. package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/SizeValueProvider.swift +81 -0
  286. package/platforms/macos/src/vendor/Lottie/Public/FontProvider/AnimationFontProvider.swift +41 -0
  287. package/platforms/macos/src/vendor/Lottie/Public/ImageProvider/AnimationImageProvider.swift +43 -0
  288. package/platforms/macos/src/vendor/Lottie/Public/Keyframes/Interpolatable.swift +285 -0
  289. package/platforms/macos/src/vendor/Lottie/Public/Keyframes/Keyframe.swift +98 -0
  290. package/platforms/macos/src/vendor/Lottie/Public/Logging/LottieLogger.swift +138 -0
  291. package/platforms/macos/src/vendor/Lottie/Public/Primitives/AnimationTime.swift +15 -0
  292. package/platforms/macos/src/vendor/Lottie/Public/Primitives/LottieColor.swift +43 -0
  293. package/platforms/macos/src/vendor/Lottie/Public/Primitives/Vectors.swift +36 -0
  294. package/platforms/macos/src/vendor/Lottie/Public/TextProvider/AnimationTextProvider.swift +135 -0
  295. package/platforms/macos/src/vendor/Lottie/Public/iOS/AnimationSubview.swift +19 -0
  296. package/platforms/macos/src/vendor/Lottie/Public/iOS/BundleImageProvider.swift +98 -0
  297. package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleAnimationKeypath.swift +33 -0
  298. package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleAnimationView.swift +567 -0
  299. package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleFontProvider.swift +41 -0
  300. package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleImageProvider.swift +43 -0
  301. package/platforms/macos/src/vendor/Lottie/Public/iOS/FilepathImageProvider.swift +78 -0
  302. package/platforms/macos/src/vendor/Lottie/Public/iOS/LottieAnimationViewBase.swift +85 -0
  303. package/platforms/macos/src/vendor/Lottie/Public/iOS/UIColorExtension.swift +23 -0
  304. package/platforms/macos/src/vendor/Lottie/Public/macOS/AnimationSubview.macOS.swift +19 -0
  305. package/platforms/macos/src/vendor/Lottie/Public/macOS/BundleImageProvider.macOS.swift +90 -0
  306. package/platforms/macos/src/vendor/Lottie/Public/macOS/FilepathImageProvider.macOS.swift +86 -0
  307. package/platforms/macos/src/vendor/Lottie/Public/macOS/LottieAnimationViewBase.macOS.swift +102 -0
  308. package/src/Lottie.macos.tsrx +129 -0
  309. package/src/Lottie.tsrx +3 -2
  310. package/src/Lottie.web.tsrx +28 -11
  311. package/src/index.macos.ts +2 -0
  312. package/src/props.ts +6 -1
  313. package/types/generated/props.d.ts +5 -1
@@ -0,0 +1,224 @@
1
+ //
2
+ // StarNode.swift
3
+ // lottie-swift
4
+ //
5
+ // Created by Brandon Withrow on 1/21/19.
6
+ //
7
+
8
+ import Foundation
9
+ import QuartzCore
10
+
11
+ // MARK: - StarNodeProperties
12
+
13
+ final class StarNodeProperties: NodePropertyMap, KeypathSearchable {
14
+
15
+ // MARK: Lifecycle
16
+
17
+ init(star: Star) {
18
+ keypathName = star.name
19
+ direction = star.direction
20
+ position = NodeProperty(provider: KeyframeInterpolator(keyframes: star.position.keyframes))
21
+ outerRadius = NodeProperty(provider: KeyframeInterpolator(keyframes: star.outerRadius.keyframes))
22
+ outerRoundedness = NodeProperty(provider: KeyframeInterpolator(keyframes: star.outerRoundness.keyframes))
23
+ if let innerRadiusKeyframes = star.innerRadius?.keyframes {
24
+ innerRadius = NodeProperty(provider: KeyframeInterpolator(keyframes: innerRadiusKeyframes))
25
+ } else {
26
+ innerRadius = NodeProperty(provider: SingleValueProvider(LottieVector1D(0)))
27
+ }
28
+ if let innderRoundedness = star.innerRoundness?.keyframes {
29
+ innerRoundedness = NodeProperty(provider: KeyframeInterpolator(keyframes: innderRoundedness))
30
+ } else {
31
+ innerRoundedness = NodeProperty(provider: SingleValueProvider(LottieVector1D(0)))
32
+ }
33
+ rotation = NodeProperty(provider: KeyframeInterpolator(keyframes: star.rotation.keyframes))
34
+ points = NodeProperty(provider: KeyframeInterpolator(keyframes: star.points.keyframes))
35
+ keypathProperties = [
36
+ PropertyName.position.rawValue: position,
37
+ "Outer Radius": outerRadius,
38
+ "Outer Roundedness": outerRoundedness,
39
+ "Inner Radius": innerRadius,
40
+ "Inner Roundedness": innerRoundedness,
41
+ PropertyName.rotation.rawValue: rotation,
42
+ "Points": points,
43
+ ]
44
+ properties = Array(keypathProperties.values)
45
+ }
46
+
47
+ // MARK: Internal
48
+
49
+ var keypathName: String
50
+
51
+ let keypathProperties: [String: AnyNodeProperty]
52
+ let properties: [AnyNodeProperty]
53
+
54
+ let direction: PathDirection
55
+ let position: NodeProperty<LottieVector3D>
56
+ let outerRadius: NodeProperty<LottieVector1D>
57
+ let outerRoundedness: NodeProperty<LottieVector1D>
58
+ let innerRadius: NodeProperty<LottieVector1D>
59
+ let innerRoundedness: NodeProperty<LottieVector1D>
60
+ let rotation: NodeProperty<LottieVector1D>
61
+ let points: NodeProperty<LottieVector1D>
62
+ }
63
+
64
+ // MARK: - StarNode
65
+
66
+ final class StarNode: AnimatorNode, PathNode {
67
+
68
+ // MARK: Lifecycle
69
+
70
+ init(parentNode: AnimatorNode?, star: Star) {
71
+ pathOutput = PathOutputNode(parent: parentNode?.outputNode)
72
+ properties = StarNodeProperties(star: star)
73
+ self.parentNode = parentNode
74
+ }
75
+
76
+ // MARK: Internal
77
+
78
+ /// Magic number needed for building path data
79
+ static let PolystarConstant: CGFloat = 0.47829
80
+
81
+ let properties: StarNodeProperties
82
+
83
+ let pathOutput: PathOutputNode
84
+
85
+ let parentNode: AnimatorNode?
86
+ var hasLocalUpdates = false
87
+ var hasUpstreamUpdates = false
88
+ var lastUpdateFrame: CGFloat? = nil
89
+
90
+ var propertyMap: NodePropertyMap & KeypathSearchable {
91
+ properties
92
+ }
93
+
94
+ var isEnabled = true {
95
+ didSet {
96
+ pathOutput.isEnabled = isEnabled
97
+ }
98
+ }
99
+
100
+ func rebuildOutputs(frame: CGFloat) {
101
+ let path = BezierPath.star(
102
+ position: properties.position.value.pointValue,
103
+ outerRadius: properties.outerRadius.value.cgFloatValue,
104
+ innerRadius: properties.innerRadius.value.cgFloatValue,
105
+ outerRoundedness: properties.outerRoundedness.value.cgFloatValue,
106
+ innerRoundedness: properties.innerRoundedness.value.cgFloatValue,
107
+ numberOfPoints: properties.points.value.cgFloatValue,
108
+ rotation: properties.rotation.value.cgFloatValue,
109
+ direction: properties.direction
110
+ )
111
+
112
+ pathOutput.setPath(path, updateFrame: frame)
113
+ }
114
+
115
+ }
116
+
117
+ extension BezierPath {
118
+ /// Constructs a `BezierPath` in the shape of a star
119
+ static func star(
120
+ position: CGPoint,
121
+ outerRadius: CGFloat,
122
+ innerRadius: CGFloat,
123
+ outerRoundedness inoutOuterRoundedness: CGFloat,
124
+ innerRoundedness inputInnerRoundedness: CGFloat,
125
+ numberOfPoints: CGFloat,
126
+ rotation: CGFloat,
127
+ direction: PathDirection
128
+ ) -> BezierPath {
129
+ var currentAngle = (rotation - 90).toRadians()
130
+ let anglePerPoint = (2 * CGFloat.pi) / numberOfPoints
131
+ let halfAnglePerPoint = anglePerPoint / 2.0
132
+ let partialPointAmount = numberOfPoints - floor(numberOfPoints)
133
+ let outerRoundedness = inoutOuterRoundedness * 0.01
134
+ let innerRoundedness = inputInnerRoundedness * 0.01
135
+
136
+ var point = CGPoint.zero
137
+
138
+ var partialPointRadius: CGFloat = 0
139
+ if partialPointAmount != 0 {
140
+ currentAngle += halfAnglePerPoint * (1 - partialPointAmount)
141
+ partialPointRadius = innerRadius + partialPointAmount * (outerRadius - innerRadius)
142
+ point.x = (partialPointRadius * cos(currentAngle))
143
+ point.y = (partialPointRadius * sin(currentAngle))
144
+ currentAngle += anglePerPoint * partialPointAmount / 2
145
+ } else {
146
+ point.x = (outerRadius * cos(currentAngle))
147
+ point.y = (outerRadius * sin(currentAngle))
148
+ currentAngle += halfAnglePerPoint
149
+ }
150
+
151
+ var vertices = [CurveVertex]()
152
+ vertices.append(CurveVertex(point: point + position, inTangentRelative: .zero, outTangentRelative: .zero))
153
+
154
+ var previousPoint = point
155
+ var longSegment = false
156
+ let numPoints = Int(ceil(numberOfPoints) * 2)
157
+ for i in 0..<numPoints {
158
+ var radius = longSegment ? outerRadius : innerRadius
159
+ var dTheta = halfAnglePerPoint
160
+ if partialPointRadius != 0, i == numPoints - 2 {
161
+ dTheta = anglePerPoint * partialPointAmount / 2
162
+ }
163
+ if partialPointRadius != 0, i == numPoints - 1 {
164
+ radius = partialPointRadius
165
+ }
166
+ previousPoint = point
167
+ point.x = (radius * cos(currentAngle))
168
+ point.y = (radius * sin(currentAngle))
169
+
170
+ if innerRoundedness == 0, outerRoundedness == 0 {
171
+ vertices.append(CurveVertex(point: point + position, inTangentRelative: .zero, outTangentRelative: .zero))
172
+ } else {
173
+ let cp1Theta = (atan2(previousPoint.y, previousPoint.x) - CGFloat.pi / 2)
174
+ let cp1Dx = cos(cp1Theta)
175
+ let cp1Dy = sin(cp1Theta)
176
+
177
+ let cp2Theta = (atan2(point.y, point.x) - CGFloat.pi / 2)
178
+ let cp2Dx = cos(cp2Theta)
179
+ let cp2Dy = sin(cp2Theta)
180
+
181
+ let cp1Roundedness = longSegment ? innerRoundedness : outerRoundedness
182
+ let cp2Roundedness = longSegment ? outerRoundedness : innerRoundedness
183
+ let cp1Radius = longSegment ? innerRadius : outerRadius
184
+ let cp2Radius = longSegment ? outerRadius : innerRadius
185
+
186
+ var cp1 = CGPoint(
187
+ x: cp1Radius * cp1Roundedness * StarNode.PolystarConstant * cp1Dx,
188
+ y: cp1Radius * cp1Roundedness * StarNode.PolystarConstant * cp1Dy
189
+ )
190
+ var cp2 = CGPoint(
191
+ x: cp2Radius * cp2Roundedness * StarNode.PolystarConstant * cp2Dx,
192
+ y: cp2Radius * cp2Roundedness * StarNode.PolystarConstant * cp2Dy
193
+ )
194
+ if partialPointAmount != 0 {
195
+ if i == 0 {
196
+ cp1 = cp1 * partialPointAmount
197
+ } else if i == numPoints - 1 {
198
+ cp2 = cp2 * partialPointAmount
199
+ }
200
+ }
201
+ let previousVertex = vertices[vertices.endIndex - 1]
202
+ vertices[vertices.endIndex - 1] = CurveVertex(
203
+ previousVertex.inTangent,
204
+ previousVertex.point,
205
+ previousVertex.point - cp1
206
+ )
207
+ vertices.append(CurveVertex(point: point + position, inTangentRelative: cp2, outTangentRelative: .zero))
208
+ }
209
+ currentAngle += dTheta
210
+ longSegment = !longSegment
211
+ }
212
+
213
+ let reverse = direction == .counterClockwise
214
+ if reverse {
215
+ vertices = vertices.reversed()
216
+ }
217
+ var path = BezierPath()
218
+ for vertex in vertices {
219
+ path.addVertex(reverse ? vertex.reversed() : vertex)
220
+ }
221
+ path.close()
222
+ return path
223
+ }
224
+ }
@@ -0,0 +1,162 @@
1
+ //
2
+ // GroupNode.swift
3
+ // lottie-swift
4
+ //
5
+ // Created by Brandon Withrow on 1/18/19.
6
+ //
7
+
8
+ import QuartzCore
9
+
10
+ // MARK: - GroupNodeProperties
11
+
12
+ final class GroupNodeProperties: NodePropertyMap, KeypathSearchable {
13
+
14
+ // MARK: Lifecycle
15
+
16
+ init(transform: ShapeTransform?) {
17
+ if let transform {
18
+ anchor = NodeProperty(provider: KeyframeInterpolator(keyframes: transform.anchor.keyframes))
19
+ position = NodeProperty(provider: KeyframeInterpolator(keyframes: transform.position.keyframes))
20
+ scale = NodeProperty(provider: KeyframeInterpolator(keyframes: transform.scale.keyframes))
21
+ rotationX = NodeProperty(provider: KeyframeInterpolator(keyframes: transform.rotationX.keyframes))
22
+ rotationY = NodeProperty(provider: KeyframeInterpolator(keyframes: transform.rotationY.keyframes))
23
+ rotationZ = NodeProperty(provider: KeyframeInterpolator(keyframes: transform.rotationZ.keyframes))
24
+ opacity = NodeProperty(provider: KeyframeInterpolator(keyframes: transform.opacity.keyframes))
25
+ skew = NodeProperty(provider: KeyframeInterpolator(keyframes: transform.skew.keyframes))
26
+ skewAxis = NodeProperty(provider: KeyframeInterpolator(keyframes: transform.skewAxis.keyframes))
27
+ } else {
28
+ /// Transform node missing. Default to empty transform.
29
+ anchor = NodeProperty(provider: SingleValueProvider(LottieVector3D(x: CGFloat(0), y: CGFloat(0), z: CGFloat(0))))
30
+ position = NodeProperty(provider: SingleValueProvider(LottieVector3D(x: CGFloat(0), y: CGFloat(0), z: CGFloat(0))))
31
+ scale = NodeProperty(provider: SingleValueProvider(LottieVector3D(x: CGFloat(100), y: CGFloat(100), z: CGFloat(100))))
32
+ rotationX = NodeProperty(provider: SingleValueProvider(LottieVector1D(0)))
33
+ rotationY = NodeProperty(provider: SingleValueProvider(LottieVector1D(0)))
34
+ rotationZ = NodeProperty(provider: SingleValueProvider(LottieVector1D(0)))
35
+ opacity = NodeProperty(provider: SingleValueProvider(LottieVector1D(100)))
36
+ skew = NodeProperty(provider: SingleValueProvider(LottieVector1D(0)))
37
+ skewAxis = NodeProperty(provider: SingleValueProvider(LottieVector1D(0)))
38
+ }
39
+ keypathProperties = [
40
+ "Anchor Point": anchor,
41
+ PropertyName.position.rawValue: position,
42
+ PropertyName.scale.rawValue: scale,
43
+ PropertyName.rotation.rawValue: rotationZ,
44
+ "Rotation X": rotationX,
45
+ "Rotation Y": rotationY,
46
+ "Rotation Z": rotationZ,
47
+ PropertyName.opacity.rawValue: opacity,
48
+ "Skew": skew,
49
+ "Skew Axis": skewAxis,
50
+ ]
51
+ properties = Array(keypathProperties.values)
52
+ }
53
+
54
+ // MARK: Internal
55
+
56
+ var keypathName = "Transform"
57
+
58
+ var childKeypaths = [KeypathSearchable]()
59
+
60
+ let keypathProperties: [String: AnyNodeProperty]
61
+ let properties: [AnyNodeProperty]
62
+
63
+ let anchor: NodeProperty<LottieVector3D>
64
+ let position: NodeProperty<LottieVector3D>
65
+ let scale: NodeProperty<LottieVector3D>
66
+ let rotationX: NodeProperty<LottieVector1D>
67
+ let rotationY: NodeProperty<LottieVector1D>
68
+ let rotationZ: NodeProperty<LottieVector1D>
69
+
70
+ let opacity: NodeProperty<LottieVector1D>
71
+ let skew: NodeProperty<LottieVector1D>
72
+ let skewAxis: NodeProperty<LottieVector1D>
73
+
74
+ var caTransform: CATransform3D {
75
+ CATransform3D.makeTransform(
76
+ anchor: anchor.value.pointValue,
77
+ position: position.value.pointValue,
78
+ scale: scale.value.sizeValue,
79
+ rotationX: rotationX.value.cgFloatValue,
80
+ rotationY: rotationY.value.cgFloatValue,
81
+ rotationZ: rotationZ.value.cgFloatValue,
82
+ skew: skew.value.cgFloatValue,
83
+ skewAxis: skewAxis.value.cgFloatValue
84
+ )
85
+ }
86
+ }
87
+
88
+ // MARK: - GroupNode
89
+
90
+ final class GroupNode: AnimatorNode {
91
+
92
+ // MARK: Lifecycle
93
+
94
+ init(name: String, parentNode: AnimatorNode?, tree: NodeTree) {
95
+ self.parentNode = parentNode
96
+ keypathName = name
97
+ rootNode = tree.rootNode
98
+ properties = GroupNodeProperties(transform: tree.transform)
99
+ groupOutput = GroupOutputNode(parent: parentNode?.outputNode, rootNode: rootNode?.outputNode)
100
+ // Use direct downcasting from `AnimatorNode` to `KeypathSearchable`
101
+ // to avoid calling `_arrayForceCast` for performance reasons
102
+ var childKeypaths: [KeypathSearchable] = tree.childrenNodes.map { $0 as KeypathSearchable }
103
+ childKeypaths.append(properties)
104
+ self.childKeypaths = childKeypaths
105
+
106
+ for childContainer in tree.renderContainers {
107
+ container.insertRenderLayer(childContainer)
108
+ }
109
+ }
110
+
111
+ // MARK: Internal
112
+
113
+ let groupOutput: GroupOutputNode
114
+
115
+ let properties: GroupNodeProperties
116
+
117
+ let rootNode: AnimatorNode?
118
+
119
+ var container = ShapeContainerLayer()
120
+
121
+ let keypathName: String
122
+
123
+ let childKeypaths: [KeypathSearchable]
124
+
125
+ let parentNode: AnimatorNode?
126
+ var hasLocalUpdates = false
127
+ var hasUpstreamUpdates = false
128
+ var lastUpdateFrame: CGFloat? = nil
129
+
130
+ var keypathLayer: CALayer? {
131
+ container
132
+ }
133
+
134
+ var propertyMap: NodePropertyMap & KeypathSearchable {
135
+ properties
136
+ }
137
+
138
+ var outputNode: NodeOutput {
139
+ groupOutput
140
+ }
141
+
142
+ var isEnabled = true {
143
+ didSet {
144
+ container.isHidden = !isEnabled
145
+ }
146
+ }
147
+
148
+ func performAdditionalLocalUpdates(frame: CGFloat, forceLocalUpdate: Bool) -> Bool {
149
+ rootNode?.updateContents(frame, forceLocalUpdate: forceLocalUpdate) ?? false
150
+ }
151
+
152
+ func performAdditionalOutputUpdates(_ frame: CGFloat, forceOutputUpdate: Bool) {
153
+ rootNode?.updateOutputs(frame, forceOutputUpdate: forceOutputUpdate)
154
+ }
155
+
156
+ func rebuildOutputs(frame: CGFloat) {
157
+ container.opacity = Float(properties.opacity.value.cgFloatValue) * 0.01
158
+ container.transform = properties.caTransform
159
+ groupOutput.setTransform(container.transform, forFrame: frame)
160
+ }
161
+
162
+ }
@@ -0,0 +1,88 @@
1
+ //
2
+ // FillNode.swift
3
+ // lottie-swift
4
+ //
5
+ // Created by Brandon Withrow on 1/17/19.
6
+ //
7
+
8
+ import CoreGraphics
9
+ import Foundation
10
+
11
+ // MARK: - FillNodeProperties
12
+
13
+ final class FillNodeProperties: NodePropertyMap, KeypathSearchable {
14
+
15
+ // MARK: Lifecycle
16
+
17
+ init(fill: Fill) {
18
+ keypathName = fill.name
19
+ color = NodeProperty(provider: KeyframeInterpolator(keyframes: fill.color.keyframes))
20
+ opacity = NodeProperty(provider: KeyframeInterpolator(keyframes: fill.opacity.keyframes))
21
+ type = fill.fillRule
22
+ keypathProperties = [
23
+ PropertyName.opacity.rawValue: opacity,
24
+ PropertyName.color.rawValue: color,
25
+ ]
26
+ properties = Array(keypathProperties.values)
27
+ }
28
+
29
+ // MARK: Internal
30
+
31
+ var keypathName: String
32
+
33
+ let opacity: NodeProperty<LottieVector1D>
34
+ let color: NodeProperty<LottieColor>
35
+ let type: FillRule
36
+
37
+ let keypathProperties: [String: AnyNodeProperty]
38
+ let properties: [AnyNodeProperty]
39
+
40
+ }
41
+
42
+ // MARK: - FillNode
43
+
44
+ final class FillNode: AnimatorNode, RenderNode {
45
+
46
+ // MARK: Lifecycle
47
+
48
+ init(parentNode: AnimatorNode?, fill: Fill) {
49
+ fillRender = FillRenderer(parent: parentNode?.outputNode)
50
+ fillProperties = FillNodeProperties(fill: fill)
51
+ self.parentNode = parentNode
52
+ }
53
+
54
+ // MARK: Internal
55
+
56
+ let fillRender: FillRenderer
57
+
58
+ let fillProperties: FillNodeProperties
59
+
60
+ let parentNode: AnimatorNode?
61
+ var hasLocalUpdates = false
62
+ var hasUpstreamUpdates = false
63
+ var lastUpdateFrame: CGFloat? = nil
64
+
65
+ var renderer: NodeOutput & Renderable {
66
+ fillRender
67
+ }
68
+
69
+ var propertyMap: NodePropertyMap & KeypathSearchable {
70
+ fillProperties
71
+ }
72
+
73
+ var isEnabled = true {
74
+ didSet {
75
+ fillRender.isEnabled = isEnabled
76
+ }
77
+ }
78
+
79
+ func localUpdatesPermeateDownstream() -> Bool {
80
+ false
81
+ }
82
+
83
+ func rebuildOutputs(frame _: CGFloat) {
84
+ fillRender.color = fillProperties.color.value.cgColorValue
85
+ fillRender.opacity = fillProperties.opacity.value.cgFloatValue * 0.01
86
+ fillRender.fillRule = fillProperties.type
87
+ }
88
+ }
@@ -0,0 +1,103 @@
1
+ //
2
+ // GradientFillNode.swift
3
+ // lottie-swift
4
+ //
5
+ // Created by Brandon Withrow on 1/22/19.
6
+ //
7
+
8
+ import Foundation
9
+ import QuartzCore
10
+
11
+ // MARK: - GradientFillProperties
12
+
13
+ final class GradientFillProperties: NodePropertyMap, KeypathSearchable {
14
+
15
+ // MARK: Lifecycle
16
+
17
+ init(gradientfill: GradientFill) {
18
+ keypathName = gradientfill.name
19
+ opacity = NodeProperty(provider: KeyframeInterpolator(keyframes: gradientfill.opacity.keyframes))
20
+ startPoint = NodeProperty(provider: KeyframeInterpolator(keyframes: gradientfill.startPoint.keyframes))
21
+ endPoint = NodeProperty(provider: KeyframeInterpolator(keyframes: gradientfill.endPoint.keyframes))
22
+ colors = NodeProperty(provider: KeyframeInterpolator(keyframes: gradientfill.colors.keyframes))
23
+ gradientType = gradientfill.gradientType
24
+ numberOfColors = gradientfill.numberOfColors
25
+ fillRule = gradientfill.fillRule
26
+ keypathProperties = [
27
+ PropertyName.opacity.rawValue: opacity,
28
+ "Start Point": startPoint,
29
+ "End Point": endPoint,
30
+ PropertyName.gradientColors.rawValue: colors,
31
+ ]
32
+ properties = Array(keypathProperties.values)
33
+ }
34
+
35
+ // MARK: Internal
36
+
37
+ var keypathName: String
38
+
39
+ let opacity: NodeProperty<LottieVector1D>
40
+ let startPoint: NodeProperty<LottieVector3D>
41
+ let endPoint: NodeProperty<LottieVector3D>
42
+ let colors: NodeProperty<[Double]>
43
+
44
+ let gradientType: GradientType
45
+ let numberOfColors: Int
46
+ let fillRule: FillRule
47
+
48
+ let keypathProperties: [String: AnyNodeProperty]
49
+ let properties: [AnyNodeProperty]
50
+
51
+ }
52
+
53
+ // MARK: - GradientFillNode
54
+
55
+ final class GradientFillNode: AnimatorNode, RenderNode {
56
+
57
+ // MARK: Lifecycle
58
+
59
+ init(parentNode: AnimatorNode?, gradientFill: GradientFill) {
60
+ fillRender = GradientFillRenderer(parent: parentNode?.outputNode)
61
+ fillProperties = GradientFillProperties(gradientfill: gradientFill)
62
+ self.parentNode = parentNode
63
+ }
64
+
65
+ // MARK: Internal
66
+
67
+ let fillRender: GradientFillRenderer
68
+
69
+ let fillProperties: GradientFillProperties
70
+
71
+ let parentNode: AnimatorNode?
72
+ var hasLocalUpdates = false
73
+ var hasUpstreamUpdates = false
74
+ var lastUpdateFrame: CGFloat? = nil
75
+
76
+ var renderer: NodeOutput & Renderable {
77
+ fillRender
78
+ }
79
+
80
+ var propertyMap: NodePropertyMap & KeypathSearchable {
81
+ fillProperties
82
+ }
83
+
84
+ var isEnabled = true {
85
+ didSet {
86
+ fillRender.isEnabled = isEnabled
87
+ }
88
+ }
89
+
90
+ func localUpdatesPermeateDownstream() -> Bool {
91
+ false
92
+ }
93
+
94
+ func rebuildOutputs(frame _: CGFloat) {
95
+ fillRender.start = fillProperties.startPoint.value.pointValue
96
+ fillRender.end = fillProperties.endPoint.value.pointValue
97
+ fillRender.opacity = fillProperties.opacity.value.cgFloatValue * 0.01
98
+ fillRender.colors = fillProperties.colors.value.map { CGFloat($0) }
99
+ fillRender.type = fillProperties.gradientType
100
+ fillRender.numberOfColors = fillProperties.numberOfColors
101
+ fillRender.fillRule = fillProperties.fillRule.caFillRule
102
+ }
103
+ }