@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,102 @@
1
+ // Created by Lan Xu on 2024/6/7.
2
+ // Copyright © 2024 Airbnb Inc. All rights reserved.
3
+
4
+ import QuartzCore
5
+
6
+ // MARK: - DropShadowNode
7
+
8
+ final class DropShadowNode: LayerEffectNode {
9
+
10
+ // MARK: Lifecycle
11
+
12
+ init(model: DropShadowModel) {
13
+ properties = DropShadowNodeProperties(model: model)
14
+ }
15
+
16
+ // MARK: Internal
17
+
18
+ var properties: DropShadowNodeProperties
19
+
20
+ var propertyMap: any NodePropertyMap {
21
+ properties
22
+ }
23
+
24
+ func applyEffect(to layer: CALayer) {
25
+ if let opacity = properties.opacity?.value.cgFloatValue {
26
+ // Lottie animation files express opacity as a numerical percentage value
27
+ // (e.g. 0%, 50%, 100%) so we divide by 100 to get the decimal values
28
+ // expected by Core Animation (e.g. 0.0, 0.5, 1.0).
29
+ layer.shadowOpacity = Float(opacity / 100)
30
+ }
31
+ if
32
+ let angleDegrees = properties.angle?.value.cgFloatValue,
33
+ let distance = properties.distance?.value.cgFloatValue
34
+ {
35
+ // Lottie animation files express rotation in degrees
36
+ // (e.g. 90º, 180º, 360º) so we convert to radians to get the
37
+ // values expected by Core Animation (e.g. π/2, π, 2π)
38
+ let angleRadians = (angleDegrees * .pi) / 180
39
+
40
+ // Lottie animation files express the `shadowOffset` as (angle, distance) pair,
41
+ // which we convert to the expected x / y offset values:
42
+ let offsetX = distance * cos(angleRadians)
43
+ let offsetY = distance * sin(angleRadians)
44
+ layer.shadowOffset = .init(width: offsetX, height: offsetY)
45
+ }
46
+ layer.shadowColor = properties.color?.value.cgColorValue
47
+ layer.shadowRadius = properties.radius?.value.cgFloatValue ?? 0
48
+ }
49
+
50
+ }
51
+
52
+ // MARK: - DropShadowNodeProperties
53
+
54
+ final class DropShadowNodeProperties: NodePropertyMap {
55
+
56
+ // MARK: Lifecycle
57
+
58
+ init(model: DropShadowModel) {
59
+ if let opacityKeyframes = model._opacity?.keyframes {
60
+ opacity = NodeProperty(provider: KeyframeInterpolator(keyframes: opacityKeyframes))
61
+ propertyMap[PropertyName.opacity.rawValue] = opacity
62
+ } else {
63
+ opacity = nil
64
+ }
65
+ if let radiusKeyframes = model._radius?.keyframes {
66
+ radius = NodeProperty(provider: KeyframeInterpolator(keyframes: radiusKeyframes))
67
+ propertyMap["Radius"] = radius
68
+ } else {
69
+ radius = nil
70
+ }
71
+ if let colorKeyFrames = model._color?.keyframes {
72
+ color = NodeProperty(provider: KeyframeInterpolator(keyframes: colorKeyFrames))
73
+ propertyMap[PropertyName.color.rawValue] = color
74
+ } else {
75
+ color = nil
76
+ }
77
+ if let angleKeyFrames = model._angle?.keyframes {
78
+ angle = NodeProperty(provider: KeyframeInterpolator(keyframes: angleKeyFrames))
79
+ propertyMap["Angle"] = angle
80
+ } else {
81
+ angle = nil
82
+ }
83
+ if let distanceKeyFrame = model._distance?.keyframes {
84
+ distance = NodeProperty(provider: KeyframeInterpolator(keyframes: distanceKeyFrame))
85
+ propertyMap["Distance"] = distance
86
+ } else {
87
+ distance = nil
88
+ }
89
+ properties = Array(propertyMap.values)
90
+ }
91
+
92
+ // MARK: Internal
93
+
94
+ var propertyMap = [String: AnyNodeProperty]()
95
+ var properties: [AnyNodeProperty]
96
+
97
+ let opacity: NodeProperty<LottieVector1D>?
98
+ let radius: NodeProperty<LottieVector1D>?
99
+ let color: NodeProperty<LottieColor>?
100
+ let angle: NodeProperty<LottieVector1D>?
101
+ let distance: NodeProperty<LottieVector1D>?
102
+ }
@@ -0,0 +1,25 @@
1
+ // Created by Lan Xu on 2024/6/8.
2
+ // Copyright © 2024 Airbnb Inc. All rights reserved.
3
+
4
+ import QuartzCore
5
+
6
+ // MARK: - LayerEffectNode
7
+
8
+ protocol LayerEffectNode {
9
+ var propertyMap: NodePropertyMap { get }
10
+
11
+ func applyEffect(to layer: CALayer)
12
+ }
13
+
14
+ extension LayerEffectNode {
15
+
16
+ func updateWithFrame(layer: CALayer, frame: CGFloat) {
17
+ for property in propertyMap.properties {
18
+ if property.needsUpdate(frame: frame) {
19
+ property.update(frame: frame)
20
+ }
21
+ }
22
+ applyEffect(to: layer)
23
+ }
24
+
25
+ }
@@ -0,0 +1,85 @@
1
+ //
2
+ // RoundedCornersNode.swift
3
+ // Lottie
4
+ //
5
+ // Created by Duolingo on 10/31/22.
6
+ //
7
+
8
+ import Foundation
9
+ import QuartzCore
10
+
11
+ // MARK: - RoundedCornersProperties
12
+
13
+ final class RoundedCornersProperties: NodePropertyMap, KeypathSearchable {
14
+
15
+ // MARK: Lifecycle
16
+
17
+ init(roundedCorners: RoundedCorners) {
18
+ keypathName = roundedCorners.name
19
+ radius = NodeProperty(provider: KeyframeInterpolator(keyframes: roundedCorners.radius.keyframes))
20
+ keypathProperties = ["Radius": radius]
21
+ properties = Array(keypathProperties.values)
22
+ }
23
+
24
+ // MARK: Internal
25
+
26
+ let keypathProperties: [String: AnyNodeProperty]
27
+ let properties: [AnyNodeProperty]
28
+ let keypathName: String
29
+
30
+ let radius: NodeProperty<LottieVector1D>
31
+ }
32
+
33
+ // MARK: - RoundedCornersNode
34
+
35
+ final class RoundedCornersNode: AnimatorNode {
36
+
37
+ // MARK: Lifecycle
38
+
39
+ init(parentNode: AnimatorNode?, roundedCorners: RoundedCorners, upstreamPaths: [PathOutputNode]) {
40
+ outputNode = PassThroughOutputNode(parent: parentNode?.outputNode)
41
+ self.parentNode = parentNode
42
+ properties = RoundedCornersProperties(roundedCorners: roundedCorners)
43
+ self.upstreamPaths = upstreamPaths
44
+ }
45
+
46
+ // MARK: Internal
47
+
48
+ let properties: RoundedCornersProperties
49
+
50
+ let parentNode: AnimatorNode?
51
+ let outputNode: NodeOutput
52
+ var hasLocalUpdates = false
53
+ var hasUpstreamUpdates = false
54
+ var lastUpdateFrame: CGFloat? = nil
55
+ var isEnabled = true
56
+
57
+ var propertyMap: NodePropertyMap & KeypathSearchable {
58
+ properties
59
+ }
60
+
61
+ func forceUpstreamOutputUpdates() -> Bool {
62
+ hasLocalUpdates || hasUpstreamUpdates
63
+ }
64
+
65
+ func rebuildOutputs(frame: CGFloat) {
66
+ for pathContainer in upstreamPaths {
67
+ let pathObjects = pathContainer.removePaths(updateFrame: frame)
68
+ for path in pathObjects {
69
+ let cornerRadius = properties.radius.value.cgFloatValue
70
+ if cornerRadius != 0 {
71
+ pathContainer.appendPath(
72
+ path.roundCorners(radius: cornerRadius),
73
+ updateFrame: frame
74
+ )
75
+ } else {
76
+ pathContainer.appendPath(path, updateFrame: frame)
77
+ }
78
+ }
79
+ }
80
+ }
81
+
82
+ // MARK: Fileprivate
83
+
84
+ fileprivate let upstreamPaths: [PathOutputNode]
85
+ }
@@ -0,0 +1,281 @@
1
+ //
2
+ // TrimPathNode.swift
3
+ // lottie-swift
4
+ //
5
+ // Created by Brandon Withrow on 1/23/19.
6
+ //
7
+
8
+ import Foundation
9
+ import QuartzCore
10
+
11
+ // MARK: - TrimPathProperties
12
+
13
+ final class TrimPathProperties: NodePropertyMap, KeypathSearchable {
14
+
15
+ // MARK: Lifecycle
16
+
17
+ init(trim: Trim) {
18
+ keypathName = trim.name
19
+ start = NodeProperty(provider: KeyframeInterpolator(keyframes: trim.start.keyframes))
20
+ end = NodeProperty(provider: KeyframeInterpolator(keyframes: trim.end.keyframes))
21
+ offset = NodeProperty(provider: KeyframeInterpolator(keyframes: trim.offset.keyframes))
22
+ type = trim.trimType
23
+ keypathProperties = [
24
+ "Start": start,
25
+ "End": end,
26
+ "Offset": offset,
27
+ ]
28
+ properties = Array(keypathProperties.values)
29
+ }
30
+
31
+ // MARK: Internal
32
+
33
+ let keypathProperties: [String: AnyNodeProperty]
34
+ let properties: [AnyNodeProperty]
35
+ let keypathName: String
36
+
37
+ let start: NodeProperty<LottieVector1D>
38
+ let end: NodeProperty<LottieVector1D>
39
+ let offset: NodeProperty<LottieVector1D>
40
+ let type: TrimType
41
+ }
42
+
43
+ // MARK: - TrimPathNode
44
+
45
+ final class TrimPathNode: AnimatorNode {
46
+
47
+ // MARK: Lifecycle
48
+
49
+ init(parentNode: AnimatorNode?, trim: Trim, upstreamPaths: [PathOutputNode]) {
50
+ outputNode = PassThroughOutputNode(parent: parentNode?.outputNode)
51
+ self.parentNode = parentNode
52
+ properties = TrimPathProperties(trim: trim)
53
+ self.upstreamPaths = upstreamPaths
54
+ }
55
+
56
+ // MARK: Internal
57
+
58
+ let properties: TrimPathProperties
59
+
60
+ let parentNode: AnimatorNode?
61
+ let outputNode: NodeOutput
62
+ var hasLocalUpdates = false
63
+ var hasUpstreamUpdates = false
64
+ var lastUpdateFrame: CGFloat? = nil
65
+ var isEnabled = true
66
+
67
+ var propertyMap: NodePropertyMap & KeypathSearchable {
68
+ properties
69
+ }
70
+
71
+ func forceUpstreamOutputUpdates() -> Bool {
72
+ hasLocalUpdates || hasUpstreamUpdates
73
+ }
74
+
75
+ func rebuildOutputs(frame: CGFloat) {
76
+ /// Make sure there is a trim.
77
+ let startValue = properties.start.value.cgFloatValue * 0.01
78
+ let endValue = properties.end.value.cgFloatValue * 0.01
79
+ let start = min(startValue, endValue)
80
+ let end = max(startValue, endValue)
81
+
82
+ let offset = properties.offset.value.cgFloatValue.truncatingRemainder(dividingBy: 360) / 360
83
+
84
+ /// No need to trim, it's a full path
85
+ if start == 0, end == 1 {
86
+ return
87
+ }
88
+
89
+ /// All paths are empty.
90
+ if start == end {
91
+ for pathContainer in upstreamPaths {
92
+ pathContainer.removePaths(updateFrame: frame)
93
+ }
94
+ return
95
+ }
96
+
97
+ if properties.type == .simultaneously {
98
+ /// Just trim each path
99
+ for pathContainer in upstreamPaths {
100
+ let pathObjects = pathContainer.removePaths(updateFrame: frame)
101
+ for path in pathObjects {
102
+ // We are treating each compount path as an individual path. Its subpaths are treated as a whole.
103
+ pathContainer.appendPath(
104
+ path.trim(fromPosition: start, toPosition: end, offset: offset, trimSimultaneously: false),
105
+ updateFrame: frame
106
+ )
107
+ }
108
+ }
109
+ return
110
+ }
111
+
112
+ /// Individual path trimming.
113
+
114
+ /// Brace yourself for the below code.
115
+
116
+ /// Normalize lengths with offset.
117
+ var startPosition = (start + offset).truncatingRemainder(dividingBy: 1)
118
+ var endPosition = (end + offset).truncatingRemainder(dividingBy: 1)
119
+
120
+ if startPosition < 0 {
121
+ startPosition = 1 + startPosition
122
+ }
123
+
124
+ if endPosition < 0 {
125
+ endPosition = 1 + endPosition
126
+ }
127
+ if startPosition == 1 {
128
+ startPosition = 0
129
+ }
130
+ if endPosition == 0 {
131
+ endPosition = 1
132
+ }
133
+
134
+ /// First get the total length of all paths.
135
+ var totalLength: CGFloat = 0
136
+ for upstreamPath in upstreamPaths {
137
+ totalLength = totalLength + upstreamPath.totalLength
138
+ }
139
+
140
+ /// Now determine the start and end cut lengths
141
+ let startLength = startPosition * totalLength
142
+ let endLength = endPosition * totalLength
143
+ var pathStart: CGFloat = 0
144
+
145
+ /// Now loop through all path containers
146
+ for pathContainer in upstreamPaths {
147
+ let pathEnd = pathStart + pathContainer.totalLength
148
+
149
+ if
150
+ !startLength.isInRange(pathStart, pathEnd) &&
151
+ endLength.isInRange(pathStart, pathEnd)
152
+ {
153
+ // pathStart|=======E----------------------|pathEnd
154
+ // Cut path components, removing after end.
155
+
156
+ let pathCutLength = endLength - pathStart
157
+ let subpaths = pathContainer.removePaths(updateFrame: frame)
158
+ var subpathStart: CGFloat = 0
159
+ for path in subpaths {
160
+ let subpathEnd = subpathStart + path.length
161
+ if pathCutLength < subpathEnd {
162
+ /// This is the subpath that needs to be cut.
163
+ let cutLength = pathCutLength - subpathStart
164
+ let newPath = path.trim(fromPosition: 0, toPosition: cutLength / path.length, offset: 0, trimSimultaneously: false)
165
+ pathContainer.appendPath(newPath, updateFrame: frame)
166
+ break
167
+ } else {
168
+ /// Add to container and move on
169
+ pathContainer.appendPath(path, updateFrame: frame)
170
+ }
171
+ if pathCutLength == subpathEnd {
172
+ /// Right on the end. The next subpath is not included. Break.
173
+ break
174
+ }
175
+ subpathStart = subpathEnd
176
+ }
177
+
178
+ } else if
179
+ !endLength.isInRange(pathStart, pathEnd) &&
180
+ startLength.isInRange(pathStart, pathEnd)
181
+ {
182
+ // pathStart|-------S======================|pathEnd
183
+ //
184
+
185
+ // Cut path components, removing before beginning.
186
+ let pathCutLength = startLength - pathStart
187
+ // Clear paths from container
188
+ let subpaths = pathContainer.removePaths(updateFrame: frame)
189
+ var subpathStart: CGFloat = 0
190
+ for path in subpaths {
191
+ let subpathEnd = subpathStart + path.length
192
+
193
+ if subpathStart < pathCutLength, pathCutLength < subpathEnd {
194
+ /// This is the subpath that needs to be cut.
195
+ let cutLength = pathCutLength - subpathStart
196
+ let newPath = path.trim(fromPosition: cutLength / path.length, toPosition: 1, offset: 0, trimSimultaneously: false)
197
+ pathContainer.appendPath(newPath, updateFrame: frame)
198
+ } else if pathCutLength <= subpathStart {
199
+ pathContainer.appendPath(path, updateFrame: frame)
200
+ }
201
+ subpathStart = subpathEnd
202
+ }
203
+ } else if
204
+ endLength.isInRange(pathStart, pathEnd) &&
205
+ startLength.isInRange(pathStart, pathEnd)
206
+ {
207
+ // pathStart|-------S============E---------|endLength
208
+ // pathStart|=====E----------------S=======|endLength
209
+ // trim from path beginning to endLength.
210
+
211
+ // Cut path components, removing before beginnings.
212
+ let startCutLength = startLength - pathStart
213
+ let endCutLength = endLength - pathStart
214
+ // Clear paths from container
215
+ let subpaths = pathContainer.removePaths(updateFrame: frame)
216
+ var subpathStart: CGFloat = 0
217
+ for path in subpaths {
218
+ let subpathEnd = subpathStart + path.length
219
+
220
+ if
221
+ !startCutLength.isInRange(subpathStart, subpathEnd),
222
+ !endCutLength.isInRange(subpathStart, subpathEnd)
223
+ {
224
+ // The whole path is included. Add
225
+ // S|==============================|E
226
+ pathContainer.appendPath(path, updateFrame: frame)
227
+
228
+ } else if
229
+ startCutLength.isInRange(subpathStart, subpathEnd),
230
+ !endCutLength.isInRange(subpathStart, subpathEnd)
231
+ {
232
+ /// The start of the path needs to be trimmed
233
+ // |-------S======================|E
234
+ let cutLength = startCutLength - subpathStart
235
+ let newPath = path.trim(fromPosition: cutLength / path.length, toPosition: 1, offset: 0, trimSimultaneously: false)
236
+ pathContainer.appendPath(newPath, updateFrame: frame)
237
+ } else if
238
+ !startCutLength.isInRange(subpathStart, subpathEnd),
239
+ endCutLength.isInRange(subpathStart, subpathEnd)
240
+ {
241
+ // S|=======E----------------------|
242
+ let cutLength = endCutLength - subpathStart
243
+ let newPath = path.trim(fromPosition: 0, toPosition: cutLength / path.length, offset: 0, trimSimultaneously: false)
244
+ pathContainer.appendPath(newPath, updateFrame: frame)
245
+ break
246
+ } else if
247
+ startCutLength.isInRange(subpathStart, subpathEnd),
248
+ endCutLength.isInRange(subpathStart, subpathEnd)
249
+ {
250
+ // |-------S============E---------|
251
+ let cutFromLength = startCutLength - subpathStart
252
+ let cutToLength = endCutLength - subpathStart
253
+ let newPath = path.trim(
254
+ fromPosition: cutFromLength / path.length,
255
+ toPosition: cutToLength / path.length,
256
+ offset: 0,
257
+ trimSimultaneously: false
258
+ )
259
+ pathContainer.appendPath(newPath, updateFrame: frame)
260
+ break
261
+ }
262
+
263
+ subpathStart = subpathEnd
264
+ }
265
+ } else if
266
+ (endLength <= pathStart && pathEnd <= startLength) ||
267
+ (startLength <= pathStart && endLength <= pathStart) ||
268
+ (pathEnd <= startLength && pathEnd <= endLength)
269
+ {
270
+ /// The Path needs to be cleared
271
+ pathContainer.removePaths(updateFrame: frame)
272
+ }
273
+
274
+ pathStart = pathEnd
275
+ }
276
+ }
277
+
278
+ // MARK: Fileprivate
279
+
280
+ fileprivate let upstreamPaths: [PathOutputNode]
281
+ }
@@ -0,0 +1,74 @@
1
+ //
2
+ // TransformNodeOutput.swift
3
+ // lottie-swift
4
+ //
5
+ // Created by Brandon Withrow on 1/30/19.
6
+ //
7
+
8
+ import QuartzCore
9
+
10
+ final class GroupOutputNode: NodeOutput {
11
+
12
+ // MARK: Lifecycle
13
+
14
+ init(parent: NodeOutput?, rootNode: NodeOutput?) {
15
+ self.parent = parent
16
+ self.rootNode = rootNode
17
+ }
18
+
19
+ // MARK: Internal
20
+
21
+ let parent: NodeOutput?
22
+ let rootNode: NodeOutput?
23
+ var isEnabled = true
24
+
25
+ private(set) var outputPath: CGPath? = nil
26
+ private(set) var transform: CATransform3D = CATransform3DIdentity
27
+
28
+ func setTransform(_ xform: CATransform3D, forFrame _: CGFloat) {
29
+ transform = xform
30
+ outputPath = nil
31
+ }
32
+
33
+ func hasOutputUpdates(_ forFrame: CGFloat) -> Bool {
34
+ guard isEnabled else {
35
+ let upstreamUpdates = parent?.hasOutputUpdates(forFrame) ?? false
36
+ outputPath = parent?.outputPath
37
+ return upstreamUpdates
38
+ }
39
+
40
+ let upstreamUpdates = parent?.hasOutputUpdates(forFrame) ?? false
41
+ if upstreamUpdates {
42
+ outputPath = nil
43
+ }
44
+ let rootUpdates = rootNode?.hasOutputUpdates(forFrame) ?? false
45
+ if rootUpdates {
46
+ outputPath = nil
47
+ }
48
+
49
+ var localUpdates = false
50
+ if outputPath == nil {
51
+ localUpdates = true
52
+
53
+ let newPath = CGMutablePath()
54
+ if let parentNode = parent, let parentPath = parentNode.outputPath {
55
+ /// First add parent path.
56
+ newPath.addPath(parentPath)
57
+ }
58
+ var xform = CATransform3DGetAffineTransform(transform)
59
+ if
60
+ let rootNode,
61
+ let rootPath = rootNode.outputPath,
62
+ let xformedPath = rootPath.copy(using: &xform)
63
+ {
64
+ /// Now add root path. Note root path is transformed.
65
+ newPath.addPath(xformedPath)
66
+ }
67
+
68
+ outputPath = newPath
69
+ }
70
+
71
+ return upstreamUpdates || localUpdates
72
+ }
73
+
74
+ }
@@ -0,0 +1,47 @@
1
+ //
2
+ // PassThroughOutputNode.swift
3
+ // lottie-swift
4
+ //
5
+ // Created by Brandon Withrow on 1/30/19.
6
+ //
7
+
8
+ import CoreGraphics
9
+
10
+ /// Base class for pass-through nodes
11
+ class PassThroughOutputNode: NodeOutput {
12
+
13
+ // MARK: Lifecycle
14
+
15
+ init(parent: NodeOutput?) {
16
+ self.parent = parent
17
+ }
18
+
19
+ // MARK: Internal
20
+
21
+ let parent: NodeOutput?
22
+
23
+ var hasUpdate = false
24
+ var isEnabled = true
25
+
26
+ var outputPath: CGPath? {
27
+ if let parent {
28
+ return parent.outputPath
29
+ }
30
+ return nil
31
+ }
32
+
33
+ func hasOutputUpdates(_ forFrame: CGFloat) -> Bool {
34
+ /// Changes to this node do not affect downstream nodes.
35
+ let parentUpdate = parent?.hasOutputUpdates(forFrame) ?? false
36
+ /// Changes to upstream nodes do, however, affect this nodes state.
37
+ hasUpdate = hasUpdate || parentUpdate
38
+ return parentUpdate
39
+ }
40
+
41
+ func hasRenderUpdates(_ forFrame: CGFloat) -> Bool {
42
+ /// Return true if there are upstream updates or if this node has updates
43
+ let upstreamUpdates = parent?.hasOutputUpdates(forFrame) ?? false
44
+ hasUpdate = hasUpdate || upstreamUpdates
45
+ return hasUpdate
46
+ }
47
+ }
@@ -0,0 +1,89 @@
1
+ //
2
+ // PathNodeOutput.swift
3
+ // lottie-swift
4
+ //
5
+ // Created by Brandon Withrow on 1/30/19.
6
+ //
7
+
8
+ import CoreGraphics
9
+
10
+ /// A node that has an output of a BezierPath
11
+ final class PathOutputNode: NodeOutput {
12
+
13
+ // MARK: Lifecycle
14
+
15
+ init(parent: NodeOutput?) {
16
+ self.parent = parent
17
+ }
18
+
19
+ // MARK: Internal
20
+
21
+ let parent: NodeOutput?
22
+
23
+ fileprivate(set) var outputPath: CGPath? = nil
24
+
25
+ var lastUpdateFrame: CGFloat? = nil
26
+ var lastPathBuildFrame: CGFloat? = nil
27
+ var isEnabled = true
28
+ fileprivate(set) var totalLength: CGFloat = 0
29
+ fileprivate(set) var pathObjects = [CompoundBezierPath]()
30
+
31
+ func hasOutputUpdates(_ forFrame: CGFloat) -> Bool {
32
+ guard isEnabled else {
33
+ let upstreamUpdates = parent?.hasOutputUpdates(forFrame) ?? false
34
+ outputPath = parent?.outputPath
35
+ return upstreamUpdates
36
+ }
37
+
38
+ /// Ask if parent was updated
39
+ let upstreamUpdates = parent?.hasOutputUpdates(forFrame) ?? false
40
+
41
+ /// If parent was updated and the path hasn't been built for this frame, clear the path.
42
+ if upstreamUpdates && lastPathBuildFrame != forFrame {
43
+ outputPath = nil
44
+ }
45
+
46
+ if outputPath == nil {
47
+ /// If the path is clear, build the new path.
48
+ lastPathBuildFrame = forFrame
49
+ let newPath = CGMutablePath()
50
+ if let parentNode = parent, let parentPath = parentNode.outputPath {
51
+ newPath.addPath(parentPath)
52
+ }
53
+ for path in pathObjects {
54
+ for subPath in path.paths {
55
+ newPath.addPath(subPath.cgPath())
56
+ }
57
+ }
58
+ outputPath = newPath
59
+ }
60
+
61
+ /// Return true if there were upstream updates or if this node was updated.
62
+ return upstreamUpdates || (lastUpdateFrame == forFrame)
63
+ }
64
+
65
+ @discardableResult
66
+ func removePaths(updateFrame: CGFloat?) -> [CompoundBezierPath] {
67
+ lastUpdateFrame = updateFrame
68
+ let returnPaths = pathObjects
69
+ outputPath = nil
70
+ totalLength = 0
71
+ pathObjects = []
72
+ return returnPaths
73
+ }
74
+
75
+ func setPath(_ path: BezierPath, updateFrame: CGFloat) {
76
+ lastUpdateFrame = updateFrame
77
+ outputPath = nil
78
+ totalLength = path.length
79
+ pathObjects = [CompoundBezierPath(path: path)]
80
+ }
81
+
82
+ func appendPath(_ path: CompoundBezierPath, updateFrame: CGFloat) {
83
+ lastUpdateFrame = updateFrame
84
+ outputPath = nil
85
+ totalLength = totalLength + path.length
86
+ pathObjects.append(path)
87
+ }
88
+
89
+ }