@octane-xplat/lottie 0.0.1 → 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 (361) hide show
  1. package/README.md +56 -2
  2. package/dist/native/cx.mobile.js +11 -0
  3. package/dist/native/escape-props.js +39 -0
  4. package/dist/native/index.js +183 -0
  5. package/dist/native/layout-child.js +38 -0
  6. package/dist/native/octane-client-build.json +8 -0
  7. package/dist/native/vendor/ui-lottie/index.android.js +286 -0
  8. package/dist/native/vendor/ui-lottie/index.ios.js +214 -0
  9. package/dist/native/vendor/ui-lottie/src/lottie/index.common.js +50 -0
  10. package/dist/native/vendor/ui-lottie/src/lottie/utils.js +6 -0
  11. package/dist/web/escape-props.web.js +17 -0
  12. package/dist/web/index.js +346 -0
  13. package/dist/web/layout-child.web.js +47 -0
  14. package/dist/web/octane-client-build.json +8 -0
  15. package/package.json +104 -11
  16. package/platforms/android/include.gradle +7 -0
  17. package/platforms/android/java/com/nativescript/lottie/LottieAnimationView.java +92 -0
  18. package/platforms/android/lottie.aar +0 -0
  19. package/platforms/android/native-api-usage.json +16 -0
  20. package/platforms/ios/Podfile +5 -0
  21. package/platforms/macos/LICENSE-EpoxyCore-Apache-2.0.txt +201 -0
  22. package/platforms/macos/LICENSE-LRUCache-MIT.txt +22 -0
  23. package/platforms/macos/LICENSE-Lottie-Apache-2.0.txt +201 -0
  24. package/platforms/macos/LICENSE-ZIPFoundation-MIT.txt +21 -0
  25. package/platforms/macos/UPSTREAM.md +13 -0
  26. package/platforms/macos/resources/PrivacyInfo.xcprivacy +23 -0
  27. package/platforms/macos/resources/THIRD-PARTY-NOTICES.txt +10 -0
  28. package/platforms/macos/src/XplatAppKitLottie.swift +246 -0
  29. package/platforms/macos/src/vendor/Lottie/PrivacyInfo.xcprivacy +23 -0
  30. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CAAnimation+TimingConfiguration.swift +81 -0
  31. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CALayer+addAnimation.swift +476 -0
  32. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CombinedShapeAnimation.swift +92 -0
  33. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CustomPathAnimation.swift +89 -0
  34. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/DropShadowAnimation.swift +179 -0
  35. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/EllipseAnimation.swift +53 -0
  36. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/GradientAnimations.swift +287 -0
  37. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/LayerProperty.swift +440 -0
  38. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/OpacityAnimation.swift +53 -0
  39. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/RectangleAnimation.swift +59 -0
  40. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/ShapeAnimation.swift +246 -0
  41. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/StarAnimation.swift +119 -0
  42. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/StrokeAnimation.swift +96 -0
  43. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/TransformAnimations.swift +380 -0
  44. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/VisibilityAnimation.swift +63 -0
  45. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/CompatibilityTracker.swift +129 -0
  46. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/CoreAnimationLayer.swift +645 -0
  47. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/CALayer+fillBounds.swift +35 -0
  48. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/KeyframeGroup+exactlyOneKeyframe.swift +28 -0
  49. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/Keyframes+combined.swift +345 -0
  50. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/Keyframes+timeRemapping.swift +46 -0
  51. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/AnimationLayer.swift +169 -0
  52. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/BaseAnimationLayer.swift +46 -0
  53. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/BaseCompositionLayer.swift +120 -0
  54. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/CALayer+setupLayerHierarchy.swift +169 -0
  55. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/GradientRenderLayer.swift +101 -0
  56. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ImageLayer.swift +81 -0
  57. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/InfiniteOpaqueAnimationLayer.swift +57 -0
  58. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/LayerModel+makeAnimationLayer.swift +59 -0
  59. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/MaskCompositionLayer.swift +139 -0
  60. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/PreCompLayer.swift +107 -0
  61. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/RepeaterLayer.swift +113 -0
  62. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ShapeItemLayer.swift +346 -0
  63. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ShapeLayer.swift +569 -0
  64. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/SolidLayer.swift +66 -0
  65. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/TextLayer.swift +157 -0
  66. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/TransformLayer.swift +13 -0
  67. package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/ValueProviderStore.swift +157 -0
  68. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/Collection+Diff.swift +267 -0
  69. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/Diffable.swift +19 -0
  70. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/DiffableSection.swift +16 -0
  71. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/IndexChangeset.swift +187 -0
  72. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/SectionedChangeset.swift +22 -0
  73. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Logging/EpoxyLogger.swift +102 -0
  74. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/CallbackContextEpoxyModeled.swift +8 -0
  75. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelArrayBuilder.swift +48 -0
  76. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelProperty.swift +158 -0
  77. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelStorage.swift +88 -0
  78. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModeled.swift +54 -0
  79. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/AnyEpoxyModelProperty.swift +31 -0
  80. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/ClassReference.swift +39 -0
  81. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/AnimatedProviding.swift +10 -0
  82. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DataIDProviding.swift +58 -0
  83. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidDisplayProviding.swift +41 -0
  84. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidEndDisplayingProviding.swift +42 -0
  85. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidSelectProviding.swift +36 -0
  86. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ErasedContentProviding.swift +49 -0
  87. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/MakeViewProviding.swift +61 -0
  88. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetBehaviorsProviding.swift +38 -0
  89. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetContentProviding.swift +38 -0
  90. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/StyleIDProviding.swift +38 -0
  91. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/TraitCollectionProviding.swift +14 -0
  92. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewDifferentiatorProviding.swift +34 -0
  93. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewProviding.swift +13 -0
  94. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/WillDisplayProviding.swift +41 -0
  95. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/ViewEpoxyModeled.swift +10 -0
  96. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/README.md +30 -0
  97. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUIIntrinsicContentSizeInvalidator.swift +34 -0
  98. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUILayoutMargins.swift +38 -0
  99. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxyableView+SwiftUIView.swift +165 -0
  100. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/MeasuringViewRepresentable.swift +127 -0
  101. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/SwiftUIMeasurementContainer.swift +468 -0
  102. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/SwiftUIView.swift +146 -0
  103. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIView+SwiftUIView.swift +39 -0
  104. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIViewConfiguringSwiftUIView.swift +41 -0
  105. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/BehaviorsConfigurableView.swift +45 -0
  106. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/ContentConfigurableView.swift +36 -0
  107. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/EpoxyableView.swift +5 -0
  108. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/StyledView.swift +43 -0
  109. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/ViewType.swift +47 -0
  110. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/LRUCache/LRUCache.swift +257 -0
  111. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/LRUCache/README.md +24 -0
  112. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/README.md +43 -0
  113. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+BackingConfiguration.swift +149 -0
  114. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Deprecated.swift +23 -0
  115. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Helpers.swift +361 -0
  116. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+MemoryFile.swift +205 -0
  117. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Progress.swift +66 -0
  118. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Reading.swift +160 -0
  119. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+ReadingDeprecated.swift +50 -0
  120. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Writing.swift +403 -0
  121. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+WritingDeprecated.swift +95 -0
  122. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+ZIP64.swift +191 -0
  123. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive.swift +404 -0
  124. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+Compression.swift +632 -0
  125. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+CompressionDeprecated.swift +43 -0
  126. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+Serialization.swift +146 -0
  127. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Date+ZIP.swift +101 -0
  128. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry+Serialization.swift +191 -0
  129. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry+ZIP64.swift +170 -0
  130. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry.swift +669 -0
  131. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIP.swift +405 -0
  132. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIPDeprecated.swift +28 -0
  133. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/README.md +24 -0
  134. package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/URL+ZIP.swift +34 -0
  135. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/CompositionLayer.swift +177 -0
  136. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/ImageCompositionLayer.swift +54 -0
  137. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/MaskContainerLayer.swift +191 -0
  138. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/NullCompositionLayer.swift +28 -0
  139. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/PreCompositionLayer.swift +137 -0
  140. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/ShapeCompositionLayer.swift +60 -0
  141. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/SolidCompositionLayer.swift +57 -0
  142. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/TextCompositionLayer.swift +247 -0
  143. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/MainThreadAnimationLayer.swift +321 -0
  144. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CachedImageProvider.swift +56 -0
  145. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CompositionLayersInitializer.swift +103 -0
  146. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CoreTextRenderLayer.swift +424 -0
  147. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/InvertedMatteLayer.swift +55 -0
  148. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerFontProvider.swift +39 -0
  149. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerImageProvider.swift +52 -0
  150. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerTextProvider.swift +38 -0
  151. package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerTransformNode.swift +149 -0
  152. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Extensions/ItemsExtension.swift +146 -0
  153. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/NodeProperty.swift +62 -0
  154. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyNodeProperty.swift +53 -0
  155. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyValueContainer.swift +26 -0
  156. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/KeypathSearchable.swift +23 -0
  157. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/NodePropertyMap.swift +43 -0
  158. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueContainer.swift +47 -0
  159. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueProviders/GroupInterpolator.swift +39 -0
  160. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueProviders/SingleValueProvider.swift +43 -0
  161. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/DropShadowNode.swift +102 -0
  162. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/LayerEffectNode.swift +25 -0
  163. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/RoundedCornersNode.swift +85 -0
  164. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/TrimPathNode.swift +281 -0
  165. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/GroupOutputNode.swift +74 -0
  166. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/PassThroughOutputNode.swift +47 -0
  167. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/PathOutputNode.swift +89 -0
  168. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/FillRenderer.swift +69 -0
  169. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientFillRenderer.swift +253 -0
  170. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientStrokeRenderer.swift +64 -0
  171. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/LegacyGradientFillRenderer.swift +158 -0
  172. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/StrokeRenderer.swift +165 -0
  173. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/EllipseNode.swift +143 -0
  174. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/PolygonNode.swift +173 -0
  175. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/RectNode.swift +238 -0
  176. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/ShapeNode.swift +73 -0
  177. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/StarNode.swift +224 -0
  178. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderContainers/GroupNode.swift +162 -0
  179. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/FillNode.swift +88 -0
  180. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientFillNode.swift +103 -0
  181. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientStrokeNode.swift +149 -0
  182. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/StrokeNode.swift +179 -0
  183. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/Text/TextAnimatorNode.swift +345 -0
  184. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/AnimatorNode.swift +197 -0
  185. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/PathNode.swift +20 -0
  186. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/RenderNode.swift +60 -0
  187. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeContainerLayer.swift +78 -0
  188. package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeRenderLayer.swift +98 -0
  189. package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/Asset.swift +51 -0
  190. package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/AssetLibrary.swift +75 -0
  191. package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/ImageAsset.swift +141 -0
  192. package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/PrecompAsset.swift +47 -0
  193. package/platforms/macos/src/vendor/Lottie/Private/Model/DictionaryInitializable.swift +73 -0
  194. package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieAnimation.swift +57 -0
  195. package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieImageProvider.swift +89 -0
  196. package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieManifest.swift +42 -0
  197. package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieUtils.swift +71 -0
  198. package/platforms/macos/src/vendor/Lottie/Private/Model/Extensions/Bundle.swift +58 -0
  199. package/platforms/macos/src/vendor/Lottie/Private/Model/Extensions/KeyedDecodingContainerExtensions.swift +71 -0
  200. package/platforms/macos/src/vendor/Lottie/Private/Model/Keyframes/KeyframeData.swift +111 -0
  201. package/platforms/macos/src/vendor/Lottie/Private/Model/Keyframes/KeyframeGroup.swift +265 -0
  202. package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/DropShadowEffect.swift +52 -0
  203. package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/ColorEffectValue.swift +45 -0
  204. package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/EffectValue.swift +98 -0
  205. package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/Vector1DEffectValue.swift +45 -0
  206. package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/LayerEffect.swift +103 -0
  207. package/platforms/macos/src/vendor/Lottie/Private/Model/LayerStyles/DropShadowStyle.swift +79 -0
  208. package/platforms/macos/src/vendor/Lottie/Private/Model/LayerStyles/LayerStyle.swift +85 -0
  209. package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/ImageLayerModel.swift +49 -0
  210. package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/LayerModel.swift +266 -0
  211. package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/PreCompLayerModel.swift +74 -0
  212. package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/ShapeLayerModel.swift +50 -0
  213. package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/SolidLayerModel.swift +63 -0
  214. package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/TextLayerModel.swift +65 -0
  215. package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/DashPattern.swift +42 -0
  216. package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Marker.swift +35 -0
  217. package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Mask.swift +80 -0
  218. package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Transform.swift +261 -0
  219. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Ellipse.swift +79 -0
  220. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Fill.swift +79 -0
  221. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/GradientFill.swift +142 -0
  222. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/GradientStroke.swift +244 -0
  223. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Group.swift +55 -0
  224. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Merge.swift +63 -0
  225. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Rectangle.swift +79 -0
  226. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Repeater.swift +181 -0
  227. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/RoundedCorners.swift +53 -0
  228. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Shape.swift +63 -0
  229. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/ShapeItem.swift +171 -0
  230. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/ShapeTransform.swift +202 -0
  231. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Star.swift +136 -0
  232. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Stroke.swift +144 -0
  233. package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Trim.swift +90 -0
  234. package/platforms/macos/src/vendor/Lottie/Private/Model/Text/Font.swift +67 -0
  235. package/platforms/macos/src/vendor/Lottie/Private/Model/Text/Glyph.swift +94 -0
  236. package/platforms/macos/src/vendor/Lottie/Private/Model/Text/TextAnimator.swift +240 -0
  237. package/platforms/macos/src/vendor/Lottie/Private/Model/Text/TextDocument.swift +142 -0
  238. package/platforms/macos/src/vendor/Lottie/Private/RootAnimationLayer.swift +54 -0
  239. package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/AnimatorNodeDebugging.swift +23 -0
  240. package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/LayerDebugging.swift +231 -0
  241. package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/TestHelpers.swift +10 -0
  242. package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/AnimationKeypathExtension.swift +303 -0
  243. package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/BlendMode+Filter.swift +31 -0
  244. package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/CGColor+RGB.swift +45 -0
  245. package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/CGFloatExtensions.swift +152 -0
  246. package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/DataExtension.swift +33 -0
  247. package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/MathKit.swift +454 -0
  248. package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/StringExtensions.swift +44 -0
  249. package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/AnimationContext.swift +95 -0
  250. package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/AnyEquatable.swift +23 -0
  251. package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/Binding+Map.swift +19 -0
  252. package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/View+ValueChanged.swift +35 -0
  253. package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/InterpolatableExtensions.swift +143 -0
  254. package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/KeyframeExtensions.swift +47 -0
  255. package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/KeyframeInterpolator.swift +250 -0
  256. package/platforms/macos/src/vendor/Lottie/Private/Utility/LottieAnimationSource.swift +51 -0
  257. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/BezierPath.swift +509 -0
  258. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/BezierPathRoundExtension.swift +163 -0
  259. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CGPointExtension.swift +35 -0
  260. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/ColorExtension.swift +101 -0
  261. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CompoundBezierPath.swift +169 -0
  262. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CurveVertex.swift +190 -0
  263. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/PathElement.swift +78 -0
  264. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/UnitBezier.swift +119 -0
  265. package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/VectorsExtensions.swift +368 -0
  266. package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimation.swift +179 -0
  267. package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationHelpers.swift +317 -0
  268. package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationLayer.swift +1582 -0
  269. package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationView.swift +1090 -0
  270. package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationViewInitializers.swift +226 -0
  271. package/platforms/macos/src/vendor/Lottie/Public/Animation/LottiePlaybackMode.swift +266 -0
  272. package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieView.swift +643 -0
  273. package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/AnimationCacheProvider.swift +21 -0
  274. package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/DefaultAnimationCache.swift +67 -0
  275. package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/LRUAnimationCache.swift +11 -0
  276. package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/LottieAnimationCache.swift +15 -0
  277. package/platforms/macos/src/vendor/Lottie/Public/Configuration/DecodingStrategy.swift +15 -0
  278. package/platforms/macos/src/vendor/Lottie/Public/Configuration/LottieConfiguration.swift +54 -0
  279. package/platforms/macos/src/vendor/Lottie/Public/Configuration/LottieURLSession.swift +31 -0
  280. package/platforms/macos/src/vendor/Lottie/Public/Configuration/ReducedMotionOption.swift +128 -0
  281. package/platforms/macos/src/vendor/Lottie/Public/Configuration/RenderingEngineOption.swift +117 -0
  282. package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedButton.swift +128 -0
  283. package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedControl.swift +248 -0
  284. package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedSwitch.swift +271 -0
  285. package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieButton.swift +119 -0
  286. package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieSwitch.swift +144 -0
  287. package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieViewType.swift +79 -0
  288. package/platforms/macos/src/vendor/Lottie/Public/DotLottie/Cache/DotLottieCache.swift +66 -0
  289. package/platforms/macos/src/vendor/Lottie/Public/DotLottie/Cache/DotLottieCacheProvider.swift +21 -0
  290. package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieConfiguration.swift +72 -0
  291. package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieFile.swift +186 -0
  292. package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieFileHelpers.swift +386 -0
  293. package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/AnimationKeypath.swift +57 -0
  294. package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/AnyValueProvider.swift +132 -0
  295. package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/ColorValueProvider.swift +96 -0
  296. package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/FloatValueProvider.swift +81 -0
  297. package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/GradientValueProvider.swift +138 -0
  298. package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/PointValueProvider.swift +81 -0
  299. package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/SizeValueProvider.swift +81 -0
  300. package/platforms/macos/src/vendor/Lottie/Public/FontProvider/AnimationFontProvider.swift +41 -0
  301. package/platforms/macos/src/vendor/Lottie/Public/ImageProvider/AnimationImageProvider.swift +43 -0
  302. package/platforms/macos/src/vendor/Lottie/Public/Keyframes/Interpolatable.swift +285 -0
  303. package/platforms/macos/src/vendor/Lottie/Public/Keyframes/Keyframe.swift +98 -0
  304. package/platforms/macos/src/vendor/Lottie/Public/Logging/LottieLogger.swift +138 -0
  305. package/platforms/macos/src/vendor/Lottie/Public/Primitives/AnimationTime.swift +15 -0
  306. package/platforms/macos/src/vendor/Lottie/Public/Primitives/LottieColor.swift +43 -0
  307. package/platforms/macos/src/vendor/Lottie/Public/Primitives/Vectors.swift +36 -0
  308. package/platforms/macos/src/vendor/Lottie/Public/TextProvider/AnimationTextProvider.swift +135 -0
  309. package/platforms/macos/src/vendor/Lottie/Public/iOS/AnimationSubview.swift +19 -0
  310. package/platforms/macos/src/vendor/Lottie/Public/iOS/BundleImageProvider.swift +98 -0
  311. package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleAnimationKeypath.swift +33 -0
  312. package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleAnimationView.swift +567 -0
  313. package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleFontProvider.swift +41 -0
  314. package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleImageProvider.swift +43 -0
  315. package/platforms/macos/src/vendor/Lottie/Public/iOS/FilepathImageProvider.swift +78 -0
  316. package/platforms/macos/src/vendor/Lottie/Public/iOS/LottieAnimationViewBase.swift +85 -0
  317. package/platforms/macos/src/vendor/Lottie/Public/iOS/UIColorExtension.swift +23 -0
  318. package/platforms/macos/src/vendor/Lottie/Public/macOS/AnimationSubview.macOS.swift +19 -0
  319. package/platforms/macos/src/vendor/Lottie/Public/macOS/BundleImageProvider.macOS.swift +90 -0
  320. package/platforms/macos/src/vendor/Lottie/Public/macOS/FilepathImageProvider.macOS.swift +86 -0
  321. package/platforms/macos/src/vendor/Lottie/Public/macOS/LottieAnimationViewBase.macOS.swift +102 -0
  322. package/src/Lottie.macos.tsrx +129 -0
  323. package/src/Lottie.tsrx +162 -0
  324. package/src/Lottie.web.tsrx +152 -0
  325. package/src/cx.mobile.ts +8 -0
  326. package/src/escape-props.ts +65 -0
  327. package/src/escape-props.web.ts +25 -0
  328. package/src/index.macos.ts +2 -0
  329. package/src/index.ts +2 -0
  330. package/src/index.web.ts +2 -0
  331. package/src/layout-child.ts +57 -0
  332. package/src/layout-child.web.ts +108 -0
  333. package/src/native-elements.d.ts +8 -0
  334. package/src/props.ts +133 -0
  335. package/src/references.d.ts +3 -0
  336. package/src/vendor/ui-lottie/LICENSE.md +21 -0
  337. package/src/vendor/ui-lottie/src/lottie/index.android.ts +447 -0
  338. package/src/vendor/ui-lottie/src/lottie/index.common.ts +84 -0
  339. package/src/vendor/ui-lottie/src/lottie/index.d.ts +133 -0
  340. package/src/vendor/ui-lottie/src/lottie/index.ios.ts +345 -0
  341. package/src/vendor/ui-lottie/src/lottie/typings/android.d.ts +4149 -0
  342. package/src/vendor/ui-lottie/src/lottie/typings/android.nativescript.d.ts +12 -0
  343. package/src/vendor/ui-lottie/src/lottie/typings/dotlottie.ios.d.ts +14 -0
  344. package/src/vendor/ui-lottie/src/lottie/typings/ios.d.ts +384 -0
  345. package/src/vendor/ui-lottie/src/lottie/utils.ts +9 -0
  346. package/types/generated/.tsrx-typegen-manifest.json +18 -0
  347. package/types/generated/Lottie.d.ts +7 -0
  348. package/types/generated/Lottie.web.d.ts +7 -0
  349. package/types/generated/cx.mobile.d.ts +6 -0
  350. package/types/generated/escape-props.d.ts +15 -0
  351. package/types/generated/escape-props.web.d.ts +5 -0
  352. package/types/generated/index.d.ts +2 -0
  353. package/types/generated/index.web.d.ts +2 -0
  354. package/types/generated/layout-child.d.ts +6 -0
  355. package/types/generated/layout-child.web.d.ts +15 -0
  356. package/types/generated/props.d.ts +110 -0
  357. package/types/generated/vendor/ui-lottie/src/lottie/index.common.d.ts +30 -0
  358. package/types/generated/vendor/ui-lottie/src/lottie/index.ios.d.ts +35 -0
  359. package/types/generated/vendor/ui-lottie/src/lottie/utils.d.ts +1 -0
  360. package/index.d.ts +0 -1
  361. package/index.js +0 -2
@@ -0,0 +1,197 @@
1
+ //
2
+ // AnimatorNode.swift
3
+ // lottie-swift
4
+ //
5
+ // Created by Brandon Withrow on 1/15/19.
6
+ //
7
+
8
+ import QuartzCore
9
+
10
+ // MARK: - NodeOutput
11
+
12
+ /// Defines the basic outputs of an animator node.
13
+ ///
14
+ protocol NodeOutput {
15
+
16
+ /// The parent node.
17
+ var parent: NodeOutput? { get }
18
+
19
+ var outputPath: CGPath? { get }
20
+
21
+ var isEnabled: Bool { get set }
22
+
23
+ /// Returns true if there are any updates upstream. OutputPath must be built before returning.
24
+ func hasOutputUpdates(_ forFrame: CGFloat) -> Bool
25
+
26
+ }
27
+
28
+ // MARK: - AnimatorNode
29
+
30
+ /// The Animator Node is the base node in the render system tree.
31
+ ///
32
+ /// It defines a single node that has an output path and option input node.
33
+ /// At animation time the root animation node is asked to update its contents for
34
+ /// the current frame.
35
+ /// The node reaches up its chain of nodes until the first node that does not need
36
+ /// updating is found. Then each node updates its contents down the render pipeline.
37
+ /// Each node adds its local path to its input path and passes it forward.
38
+ ///
39
+ /// An animator node holds a group of interpolators. These interpolators determine
40
+ /// if the node needs an update for the current frame.
41
+ ///
42
+ protocol AnimatorNode: AnyObject, KeypathSearchable {
43
+
44
+ /// The available properties of the Node.
45
+ ///
46
+ /// These properties are automatically updated each frame.
47
+ /// These properties are also settable and gettable through the dynamic
48
+ /// property system.
49
+ ///
50
+ var propertyMap: NodePropertyMap & KeypathSearchable { get }
51
+
52
+ /// The upstream input node
53
+ var parentNode: AnimatorNode? { get }
54
+
55
+ /// The output of the node.
56
+ var outputNode: NodeOutput { get }
57
+
58
+ /// Setters for marking current node state.
59
+ var isEnabled: Bool { get set }
60
+ var hasLocalUpdates: Bool { get set }
61
+ var hasUpstreamUpdates: Bool { get set }
62
+ var lastUpdateFrame: CGFloat? { get set }
63
+
64
+ /// Update the outputs of the node. Called if local contents were update or if outputsNeedUpdate returns true.
65
+ func rebuildOutputs(frame: CGFloat)
66
+
67
+ /// Marks if updates to this node affect nodes downstream.
68
+ func localUpdatesPermeateDownstream() -> Bool
69
+ func forceUpstreamOutputUpdates() -> Bool
70
+
71
+ /// Called at the end of this nodes update cycle. Always called. Optional.
72
+ func performAdditionalLocalUpdates(frame: CGFloat, forceLocalUpdate: Bool) -> Bool
73
+ func performAdditionalOutputUpdates(_ frame: CGFloat, forceOutputUpdate: Bool)
74
+
75
+ /// The default simply returns `hasLocalUpdates`
76
+ func shouldRebuildOutputs(frame: CGFloat) -> Bool
77
+ }
78
+
79
+ /// Basic Node Logic
80
+ extension AnimatorNode {
81
+
82
+ func shouldRebuildOutputs(frame _: CGFloat) -> Bool {
83
+ hasLocalUpdates
84
+ }
85
+
86
+ func localUpdatesPermeateDownstream() -> Bool {
87
+ /// Optional override
88
+ true
89
+ }
90
+
91
+ func forceUpstreamOutputUpdates() -> Bool {
92
+ /// Optional
93
+ false
94
+ }
95
+
96
+ func performAdditionalLocalUpdates(frame _: CGFloat, forceLocalUpdate: Bool) -> Bool {
97
+ /// Optional
98
+ forceLocalUpdate
99
+ }
100
+
101
+ func performAdditionalOutputUpdates(_: CGFloat, forceOutputUpdate _: Bool) {
102
+ /// Optional
103
+ }
104
+
105
+ @discardableResult
106
+ func updateOutputs(_ frame: CGFloat, forceOutputUpdate: Bool) -> Bool {
107
+ guard isEnabled else {
108
+ // Disabled node, pass through.
109
+ lastUpdateFrame = frame
110
+ return parentNode?.updateOutputs(frame, forceOutputUpdate: forceOutputUpdate) ?? false
111
+ }
112
+
113
+ if forceOutputUpdate == false && lastUpdateFrame != nil && lastUpdateFrame! == frame {
114
+ /// This node has already updated for this frame. Go ahead and return the results.
115
+ return hasUpstreamUpdates || hasLocalUpdates
116
+ }
117
+
118
+ /// Ask if this node should force output updates upstream.
119
+ let forceUpstreamUpdates = forceOutputUpdate || forceUpstreamOutputUpdates()
120
+
121
+ /// Perform upstream output updates. Optionally mark upstream updates if any.
122
+ hasUpstreamUpdates = (
123
+ parentNode?
124
+ .updateOutputs(frame, forceOutputUpdate: forceUpstreamUpdates) ?? false || hasUpstreamUpdates
125
+ )
126
+
127
+ /// Perform additional local output updates
128
+ performAdditionalOutputUpdates(frame, forceOutputUpdate: forceUpstreamUpdates)
129
+
130
+ /// If there are local updates, or if updates have been force, rebuild outputs
131
+ if forceUpstreamUpdates || shouldRebuildOutputs(frame: frame) {
132
+ lastUpdateFrame = frame
133
+ rebuildOutputs(frame: frame)
134
+ }
135
+ return hasUpstreamUpdates || hasLocalUpdates
136
+ }
137
+
138
+ /// Rebuilds the content of this node, and upstream nodes if necessary.
139
+ @discardableResult
140
+ func updateContents(_ frame: CGFloat, forceLocalUpdate: Bool) -> Bool {
141
+ guard isEnabled else {
142
+ // Disabled node, pass through.
143
+ return parentNode?.updateContents(frame, forceLocalUpdate: forceLocalUpdate) ?? false
144
+ }
145
+
146
+ if forceLocalUpdate == false && lastUpdateFrame != nil && lastUpdateFrame! == frame {
147
+ /// This node has already updated for this frame. Go ahead and return the results.
148
+ return localUpdatesPermeateDownstream() ? hasUpstreamUpdates || hasLocalUpdates : hasUpstreamUpdates
149
+ }
150
+
151
+ /// Are there local updates? If so mark the node.
152
+ hasLocalUpdates = forceLocalUpdate ? forceLocalUpdate : propertyMap.needsLocalUpdate(frame: frame)
153
+
154
+ /// Were there upstream updates? If so mark the node
155
+ hasUpstreamUpdates = parentNode?.updateContents(frame, forceLocalUpdate: forceLocalUpdate) ?? false
156
+
157
+ /// Perform property updates if necessary.
158
+ if hasLocalUpdates {
159
+ /// Rebuild local properties
160
+ propertyMap.updateNodeProperties(frame: frame)
161
+ }
162
+
163
+ /// Ask the node to perform any other updates it might have.
164
+ hasUpstreamUpdates = performAdditionalLocalUpdates(frame: frame, forceLocalUpdate: forceLocalUpdate) || hasUpstreamUpdates
165
+
166
+ /// If the node can update nodes downstream, notify them, otherwise pass on any upstream updates downstream.
167
+ return localUpdatesPermeateDownstream() ? hasUpstreamUpdates || hasLocalUpdates : hasUpstreamUpdates
168
+ }
169
+
170
+ func updateTree(_ frame: CGFloat, forceUpdates: Bool = false) {
171
+ updateContents(frame, forceLocalUpdate: forceUpdates)
172
+ updateOutputs(frame, forceOutputUpdate: forceUpdates)
173
+ }
174
+
175
+ }
176
+
177
+ extension AnimatorNode {
178
+ /// Default implementation for Keypath searchable.
179
+ /// Forward all calls to the propertyMap.
180
+
181
+ var keypathName: String {
182
+ propertyMap.keypathName
183
+ }
184
+
185
+ var keypathProperties: [String: AnyNodeProperty] {
186
+ propertyMap.keypathProperties
187
+ }
188
+
189
+ var childKeypaths: [KeypathSearchable] {
190
+ propertyMap.childKeypaths
191
+ }
192
+
193
+ var keypathLayer: CALayer? {
194
+ nil
195
+ }
196
+
197
+ }
@@ -0,0 +1,20 @@
1
+ //
2
+ // PathNode.swift
3
+ // lottie-swift
4
+ //
5
+ // Created by Brandon Withrow on 1/17/19.
6
+ //
7
+
8
+ // MARK: - PathNode
9
+
10
+ protocol PathNode {
11
+ var pathOutput: PathOutputNode { get }
12
+ }
13
+
14
+ extension PathNode where Self: AnimatorNode {
15
+
16
+ var outputNode: NodeOutput {
17
+ pathOutput
18
+ }
19
+
20
+ }
@@ -0,0 +1,60 @@
1
+ //
2
+ // RenderNode.swift
3
+ // lottie-swift
4
+ //
5
+ // Created by Brandon Withrow on 1/17/19.
6
+ //
7
+
8
+ import QuartzCore
9
+
10
+ // MARK: - RenderNode
11
+
12
+ /// A protocol that defines a node that holds render instructions
13
+ protocol RenderNode {
14
+ var renderer: Renderable & NodeOutput { get }
15
+ }
16
+
17
+ // MARK: - Renderable
18
+
19
+ /// A protocol that defines anything with render instructions
20
+ protocol Renderable {
21
+
22
+ /// The last frame in which this node was updated.
23
+ var hasUpdate: Bool { get }
24
+
25
+ /// Determines if the renderer requires a custom context for drawing.
26
+ /// If yes the shape layer will perform a custom drawing pass.
27
+ /// If no the shape layer will be a standard CAShapeLayer
28
+ var shouldRenderInContext: Bool { get }
29
+
30
+ func hasRenderUpdates(_ forFrame: CGFloat) -> Bool
31
+
32
+ /// Passes in the CAShapeLayer to update
33
+ func updateShapeLayer(layer: CAShapeLayer)
34
+
35
+ /// Asks the renderer what the renderable bounds is for the given box.
36
+ func renderBoundsFor(_ boundingBox: CGRect) -> CGRect
37
+
38
+ /// Opportunity for renderers to inject sublayers
39
+ func setupSublayers(layer: CAShapeLayer)
40
+
41
+ /// Renders the shape in a custom context
42
+ func render(_ inContext: CGContext)
43
+ }
44
+
45
+ extension RenderNode where Self: AnimatorNode {
46
+
47
+ var outputNode: NodeOutput {
48
+ renderer
49
+ }
50
+
51
+ }
52
+
53
+ extension Renderable {
54
+
55
+ func renderBoundsFor(_ boundingBox: CGRect) -> CGRect {
56
+ /// Optional
57
+ boundingBox
58
+ }
59
+
60
+ }
@@ -0,0 +1,78 @@
1
+ //
2
+ // ShapeContainerLayer.swift
3
+ // lottie-swift
4
+ //
5
+ // Created by Brandon Withrow on 1/30/19.
6
+ //
7
+
8
+ import QuartzCore
9
+
10
+ /// The base layer that holds Shapes and Shape Renderers
11
+ class ShapeContainerLayer: CALayer {
12
+
13
+ // MARK: Lifecycle
14
+
15
+ override init() {
16
+ super.init()
17
+ actions = [
18
+ "position": NSNull(),
19
+ "bounds": NSNull(),
20
+ "anchorPoint": NSNull(),
21
+ "transform": NSNull(),
22
+ "opacity": NSNull(),
23
+ "hidden": NSNull(),
24
+ ]
25
+ }
26
+
27
+ required init?(coder _: NSCoder) {
28
+ fatalError("init(coder:) has not been implemented")
29
+ }
30
+
31
+ override init(layer: Any) {
32
+ guard let layer = layer as? ShapeContainerLayer else {
33
+ fatalError("init(layer:) wrong class.")
34
+ }
35
+ super.init(layer: layer)
36
+ }
37
+
38
+ // MARK: Internal
39
+
40
+ private(set) var renderLayers = [ShapeContainerLayer]()
41
+
42
+ var renderScale: CGFloat = 1 {
43
+ didSet {
44
+ updateRenderScale()
45
+ }
46
+ }
47
+
48
+ func insertRenderLayer(_ layer: ShapeContainerLayer) {
49
+ renderLayers.append(layer)
50
+ insertSublayer(layer, at: 0)
51
+ }
52
+
53
+ func markRenderUpdates(forFrame: CGFloat) {
54
+ if hasRenderUpdate(forFrame: forFrame) {
55
+ rebuildContents(forFrame: forFrame)
56
+ }
57
+ guard isHidden == false else { return }
58
+ for renderLayer in renderLayers {
59
+ renderLayer.markRenderUpdates(forFrame: forFrame)
60
+ }
61
+ }
62
+
63
+ func hasRenderUpdate(forFrame _: CGFloat) -> Bool {
64
+ false
65
+ }
66
+
67
+ func rebuildContents(forFrame _: CGFloat) {
68
+ /// Override
69
+ }
70
+
71
+ func updateRenderScale() {
72
+ contentsScale = renderScale
73
+ for renderLayer in renderLayers {
74
+ renderLayer.renderScale = renderScale
75
+ }
76
+ }
77
+
78
+ }
@@ -0,0 +1,98 @@
1
+ //
2
+ // RenderLayer.swift
3
+ // lottie-swift
4
+ //
5
+ // Created by Brandon Withrow on 1/18/19.
6
+ //
7
+
8
+ import QuartzCore
9
+
10
+ /// The layer responsible for rendering shape objects
11
+ final class ShapeRenderLayer: ShapeContainerLayer {
12
+
13
+ // MARK: Lifecycle
14
+
15
+ init(renderer: Renderable & NodeOutput) {
16
+ self.renderer = renderer
17
+ super.init()
18
+ anchorPoint = .zero
19
+ actions = [
20
+ "position": NSNull(),
21
+ "bounds": NSNull(),
22
+ "anchorPoint": NSNull(),
23
+ "path": NSNull(),
24
+ "transform": NSNull(),
25
+ "opacity": NSNull(),
26
+ "hidden": NSNull(),
27
+ ]
28
+ shapeLayer.actions = [
29
+ "position": NSNull(),
30
+ "bounds": NSNull(),
31
+ "anchorPoint": NSNull(),
32
+ "path": NSNull(),
33
+ "fillColor": NSNull(),
34
+ "strokeColor": NSNull(),
35
+ "lineWidth": NSNull(),
36
+ "miterLimit": NSNull(),
37
+ "lineDashPhase": NSNull(),
38
+ "opacity": NSNull(),
39
+ "hidden": NSNull(),
40
+ ]
41
+ addSublayer(shapeLayer)
42
+
43
+ renderer.setupSublayers(layer: shapeLayer)
44
+ }
45
+
46
+ override init(layer: Any) {
47
+ guard let layer = layer as? ShapeRenderLayer else {
48
+ fatalError("init(layer:) wrong class.")
49
+ }
50
+ renderer = layer.renderer
51
+ super.init(layer: layer)
52
+ }
53
+
54
+ required init?(coder _: NSCoder) {
55
+ fatalError("init(coder:) has not been implemented")
56
+ }
57
+
58
+ // MARK: Internal
59
+
60
+ fileprivate(set) var renderer: Renderable & NodeOutput
61
+
62
+ let shapeLayer = CAShapeLayer()
63
+
64
+ override func hasRenderUpdate(forFrame: CGFloat) -> Bool {
65
+ isHidden = !renderer.isEnabled
66
+ guard isHidden == false else { return false }
67
+ return renderer.hasRenderUpdates(forFrame)
68
+ }
69
+
70
+ override func rebuildContents(forFrame _: CGFloat) {
71
+ if renderer.shouldRenderInContext {
72
+ if let newPath = renderer.outputPath {
73
+ bounds = renderer.renderBoundsFor(newPath.boundingBox)
74
+ } else {
75
+ bounds = .zero
76
+ }
77
+ position = bounds.origin
78
+ setNeedsDisplay()
79
+ } else {
80
+ shapeLayer.path = renderer.outputPath
81
+ renderer.updateShapeLayer(layer: shapeLayer)
82
+ }
83
+ }
84
+
85
+ override func draw(in ctx: CGContext) {
86
+ if let path = renderer.outputPath {
87
+ if !path.isEmpty {
88
+ ctx.addPath(path)
89
+ }
90
+ }
91
+ renderer.render(ctx)
92
+ }
93
+
94
+ override func updateRenderScale() {
95
+ super.updateRenderScale()
96
+ shapeLayer.contentsScale = renderScale
97
+ }
98
+ }
@@ -0,0 +1,51 @@
1
+ //
2
+ // Asset.swift
3
+ // lottie-swift
4
+ //
5
+ // Created by Brandon Withrow on 1/9/19.
6
+ //
7
+
8
+ // MARK: - Asset
9
+
10
+ /// Base class assets defined in Lottie manifests
11
+ public class Asset: Codable, DictionaryInitializable {
12
+
13
+ // MARK: Lifecycle
14
+
15
+ required public init(from decoder: Decoder) throws {
16
+ let container = try decoder.container(keyedBy: Asset.CodingKeys.self)
17
+ if let id = try? container.decode(String.self, forKey: .id) {
18
+ self.id = id
19
+ } else {
20
+ id = String(try container.decode(Int.self, forKey: .id))
21
+ }
22
+ }
23
+
24
+ required init(dictionary: [String: Any]) throws {
25
+ if let id = dictionary[CodingKeys.id.rawValue] as? String {
26
+ self.id = id
27
+ } else if let id = dictionary[CodingKeys.id.rawValue] as? Int {
28
+ self.id = String(id)
29
+ } else {
30
+ throw InitializableError.invalidInput()
31
+ }
32
+ }
33
+
34
+ // MARK: Public
35
+
36
+ /// The ID of the asset
37
+ public let id: String
38
+
39
+ // MARK: Private
40
+
41
+ private enum CodingKeys: String, CodingKey {
42
+ case id
43
+ }
44
+ }
45
+
46
+ // MARK: @unchecked Sendable
47
+
48
+ /// Since `Asset` isn't `final`, we have to use `@unchecked Sendable` instead of `Sendable.`
49
+ /// All `Asset` subclasses are immutable `Sendable` values.
50
+ // swiftlint:disable:next no_unchecked_sendable
51
+ extension Asset: @unchecked Sendable { }
@@ -0,0 +1,75 @@
1
+ //
2
+ // AssetLibrary.swift
3
+ // lottie-swift
4
+ //
5
+ // Created by Brandon Withrow on 1/9/19.
6
+ //
7
+
8
+ final class AssetLibrary: Codable, AnyInitializable, Sendable {
9
+
10
+ // MARK: Lifecycle
11
+
12
+ required init(from decoder: Decoder) throws {
13
+ var container = try decoder.unkeyedContainer()
14
+ var containerForKeys = container
15
+
16
+ var decodedAssets = [String: Asset]()
17
+
18
+ var imageAssets = [String: ImageAsset]()
19
+ var precompAssets = [String: PrecompAsset]()
20
+
21
+ while
22
+ !container.isAtEnd,
23
+ let keyContainer = try? containerForKeys.nestedContainer(keyedBy: PrecompAsset.CodingKeys.self)
24
+ {
25
+ if
26
+ keyContainer.contains(.layers),
27
+ let precompAsset = try? container.decode(PrecompAsset.self)
28
+ {
29
+ decodedAssets[precompAsset.id] = precompAsset
30
+ precompAssets[precompAsset.id] = precompAsset
31
+ } else if let imageAsset = try? container.decode(ImageAsset.self) {
32
+ decodedAssets[imageAsset.id] = imageAsset
33
+ imageAssets[imageAsset.id] = imageAsset
34
+ }
35
+ }
36
+ assets = decodedAssets
37
+ self.precompAssets = precompAssets
38
+ self.imageAssets = imageAssets
39
+ }
40
+
41
+ init(value: Any) throws {
42
+ guard let dictionaries = value as? [[String: Any]] else {
43
+ throw InitializableError.invalidInput()
44
+ }
45
+ var decodedAssets = [String: Asset]()
46
+ var imageAssets = [String: ImageAsset]()
47
+ var precompAssets = [String: PrecompAsset]()
48
+ for dictionary in dictionaries {
49
+ if dictionary[PrecompAsset.CodingKeys.layers.rawValue] != nil {
50
+ let asset = try PrecompAsset(dictionary: dictionary)
51
+ decodedAssets[asset.id] = asset
52
+ precompAssets[asset.id] = asset
53
+ } else if let asset = try? ImageAsset(dictionary: dictionary) {
54
+ decodedAssets[asset.id] = asset
55
+ imageAssets[asset.id] = asset
56
+ }
57
+ }
58
+ assets = decodedAssets
59
+ self.precompAssets = precompAssets
60
+ self.imageAssets = imageAssets
61
+ }
62
+
63
+ // MARK: Internal
64
+
65
+ /// The Assets
66
+ let assets: [String: Asset]
67
+
68
+ let imageAssets: [String: ImageAsset]
69
+ let precompAssets: [String: PrecompAsset]
70
+
71
+ func encode(to encoder: Encoder) throws {
72
+ var container = encoder.unkeyedContainer()
73
+ try container.encode(contentsOf: Array(assets.values))
74
+ }
75
+ }