@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.
- package/README.md +56 -2
- package/dist/native/cx.mobile.js +11 -0
- package/dist/native/escape-props.js +39 -0
- package/dist/native/index.js +183 -0
- package/dist/native/layout-child.js +38 -0
- package/dist/native/octane-client-build.json +8 -0
- package/dist/native/vendor/ui-lottie/index.android.js +286 -0
- package/dist/native/vendor/ui-lottie/index.ios.js +214 -0
- package/dist/native/vendor/ui-lottie/src/lottie/index.common.js +50 -0
- package/dist/native/vendor/ui-lottie/src/lottie/utils.js +6 -0
- package/dist/web/escape-props.web.js +17 -0
- package/dist/web/index.js +346 -0
- package/dist/web/layout-child.web.js +47 -0
- package/dist/web/octane-client-build.json +8 -0
- package/package.json +104 -11
- package/platforms/android/include.gradle +7 -0
- package/platforms/android/java/com/nativescript/lottie/LottieAnimationView.java +92 -0
- package/platforms/android/lottie.aar +0 -0
- package/platforms/android/native-api-usage.json +16 -0
- package/platforms/ios/Podfile +5 -0
- package/platforms/macos/LICENSE-EpoxyCore-Apache-2.0.txt +201 -0
- package/platforms/macos/LICENSE-LRUCache-MIT.txt +22 -0
- package/platforms/macos/LICENSE-Lottie-Apache-2.0.txt +201 -0
- package/platforms/macos/LICENSE-ZIPFoundation-MIT.txt +21 -0
- package/platforms/macos/UPSTREAM.md +13 -0
- package/platforms/macos/resources/PrivacyInfo.xcprivacy +23 -0
- package/platforms/macos/resources/THIRD-PARTY-NOTICES.txt +10 -0
- package/platforms/macos/src/XplatAppKitLottie.swift +246 -0
- package/platforms/macos/src/vendor/Lottie/PrivacyInfo.xcprivacy +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CAAnimation+TimingConfiguration.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CALayer+addAnimation.swift +476 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CombinedShapeAnimation.swift +92 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CustomPathAnimation.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/DropShadowAnimation.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/EllipseAnimation.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/GradientAnimations.swift +287 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/LayerProperty.swift +440 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/OpacityAnimation.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/RectangleAnimation.swift +59 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/ShapeAnimation.swift +246 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/StarAnimation.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/StrokeAnimation.swift +96 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/TransformAnimations.swift +380 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/VisibilityAnimation.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/CompatibilityTracker.swift +129 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/CoreAnimationLayer.swift +645 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/CALayer+fillBounds.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/KeyframeGroup+exactlyOneKeyframe.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/Keyframes+combined.swift +345 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/Keyframes+timeRemapping.swift +46 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/AnimationLayer.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/BaseAnimationLayer.swift +46 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/BaseCompositionLayer.swift +120 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/CALayer+setupLayerHierarchy.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/GradientRenderLayer.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ImageLayer.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/InfiniteOpaqueAnimationLayer.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/LayerModel+makeAnimationLayer.swift +59 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/MaskCompositionLayer.swift +139 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/PreCompLayer.swift +107 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/RepeaterLayer.swift +113 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ShapeItemLayer.swift +346 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ShapeLayer.swift +569 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/SolidLayer.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/TextLayer.swift +157 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/TransformLayer.swift +13 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/ValueProviderStore.swift +157 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/Collection+Diff.swift +267 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/Diffable.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/DiffableSection.swift +16 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/IndexChangeset.swift +187 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/SectionedChangeset.swift +22 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Logging/EpoxyLogger.swift +102 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/CallbackContextEpoxyModeled.swift +8 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelArrayBuilder.swift +48 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelProperty.swift +158 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelStorage.swift +88 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModeled.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/AnyEpoxyModelProperty.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/ClassReference.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/AnimatedProviding.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DataIDProviding.swift +58 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidDisplayProviding.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidEndDisplayingProviding.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidSelectProviding.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ErasedContentProviding.swift +49 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/MakeViewProviding.swift +61 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetBehaviorsProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetContentProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/StyleIDProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/TraitCollectionProviding.swift +14 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewDifferentiatorProviding.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewProviding.swift +13 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/WillDisplayProviding.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/ViewEpoxyModeled.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/README.md +30 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUIIntrinsicContentSizeInvalidator.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUILayoutMargins.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxyableView+SwiftUIView.swift +165 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/MeasuringViewRepresentable.swift +127 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/SwiftUIMeasurementContainer.swift +468 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/SwiftUIView.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIView+SwiftUIView.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIViewConfiguringSwiftUIView.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/BehaviorsConfigurableView.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/ContentConfigurableView.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/EpoxyableView.swift +5 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/StyledView.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/ViewType.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/LRUCache/LRUCache.swift +257 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/LRUCache/README.md +24 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/README.md +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+BackingConfiguration.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Deprecated.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Helpers.swift +361 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+MemoryFile.swift +205 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Progress.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Reading.swift +160 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+ReadingDeprecated.swift +50 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Writing.swift +403 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+WritingDeprecated.swift +95 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+ZIP64.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive.swift +404 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+Compression.swift +632 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+CompressionDeprecated.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+Serialization.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Date+ZIP.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry+Serialization.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry+ZIP64.swift +170 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry.swift +669 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIP.swift +405 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIPDeprecated.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/README.md +24 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/URL+ZIP.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/CompositionLayer.swift +177 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/ImageCompositionLayer.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/MaskContainerLayer.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/NullCompositionLayer.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/PreCompositionLayer.swift +137 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/ShapeCompositionLayer.swift +60 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/SolidCompositionLayer.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/TextCompositionLayer.swift +247 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/MainThreadAnimationLayer.swift +321 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CachedImageProvider.swift +56 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CompositionLayersInitializer.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CoreTextRenderLayer.swift +424 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/InvertedMatteLayer.swift +55 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerFontProvider.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerImageProvider.swift +52 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerTextProvider.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerTransformNode.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Extensions/ItemsExtension.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/NodeProperty.swift +62 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyNodeProperty.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyValueContainer.swift +26 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/KeypathSearchable.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/NodePropertyMap.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueContainer.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueProviders/GroupInterpolator.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueProviders/SingleValueProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/DropShadowNode.swift +102 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/LayerEffectNode.swift +25 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/RoundedCornersNode.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/TrimPathNode.swift +281 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/GroupOutputNode.swift +74 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/PassThroughOutputNode.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/PathOutputNode.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/FillRenderer.swift +69 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientFillRenderer.swift +253 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientStrokeRenderer.swift +64 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/LegacyGradientFillRenderer.swift +158 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/StrokeRenderer.swift +165 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/EllipseNode.swift +143 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/PolygonNode.swift +173 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/RectNode.swift +238 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/ShapeNode.swift +73 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/StarNode.swift +224 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderContainers/GroupNode.swift +162 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/FillNode.swift +88 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientFillNode.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientStrokeNode.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/StrokeNode.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/Text/TextAnimatorNode.swift +345 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/AnimatorNode.swift +197 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/PathNode.swift +20 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/RenderNode.swift +60 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeContainerLayer.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeRenderLayer.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/Asset.swift +51 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/AssetLibrary.swift +75 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/ImageAsset.swift +141 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/PrecompAsset.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DictionaryInitializable.swift +73 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieAnimation.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieImageProvider.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieManifest.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieUtils.swift +71 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Extensions/Bundle.swift +58 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Extensions/KeyedDecodingContainerExtensions.swift +71 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Keyframes/KeyframeData.swift +111 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Keyframes/KeyframeGroup.swift +265 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/DropShadowEffect.swift +52 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/ColorEffectValue.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/EffectValue.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/Vector1DEffectValue.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/LayerEffect.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerStyles/DropShadowStyle.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerStyles/LayerStyle.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/ImageLayerModel.swift +49 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/LayerModel.swift +266 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/PreCompLayerModel.swift +74 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/ShapeLayerModel.swift +50 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/SolidLayerModel.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/TextLayerModel.swift +65 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/DashPattern.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Marker.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Mask.swift +80 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Transform.swift +261 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Ellipse.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Fill.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/GradientFill.swift +142 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/GradientStroke.swift +244 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Group.swift +55 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Merge.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Rectangle.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Repeater.swift +181 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/RoundedCorners.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Shape.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/ShapeItem.swift +171 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/ShapeTransform.swift +202 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Star.swift +136 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Stroke.swift +144 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Trim.swift +90 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/Font.swift +67 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/Glyph.swift +94 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/TextAnimator.swift +240 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/TextDocument.swift +142 -0
- package/platforms/macos/src/vendor/Lottie/Private/RootAnimationLayer.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/AnimatorNodeDebugging.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/LayerDebugging.swift +231 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/TestHelpers.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/AnimationKeypathExtension.swift +303 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/BlendMode+Filter.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/CGColor+RGB.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/CGFloatExtensions.swift +152 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/DataExtension.swift +33 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/MathKit.swift +454 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/StringExtensions.swift +44 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/AnimationContext.swift +95 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/AnyEquatable.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/Binding+Map.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/View+ValueChanged.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/InterpolatableExtensions.swift +143 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/KeyframeExtensions.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/KeyframeInterpolator.swift +250 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/LottieAnimationSource.swift +51 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/BezierPath.swift +509 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/BezierPathRoundExtension.swift +163 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CGPointExtension.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/ColorExtension.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CompoundBezierPath.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CurveVertex.swift +190 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/PathElement.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/UnitBezier.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/VectorsExtensions.swift +368 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimation.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationHelpers.swift +317 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationLayer.swift +1582 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationView.swift +1090 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationViewInitializers.swift +226 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottiePlaybackMode.swift +266 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieView.swift +643 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/AnimationCacheProvider.swift +21 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/DefaultAnimationCache.swift +67 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/LRUAnimationCache.swift +11 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/LottieAnimationCache.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/DecodingStrategy.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/LottieConfiguration.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/LottieURLSession.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/ReducedMotionOption.swift +128 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/RenderingEngineOption.swift +117 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedButton.swift +128 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedControl.swift +248 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedSwitch.swift +271 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieButton.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieSwitch.swift +144 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieViewType.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/Cache/DotLottieCache.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/Cache/DotLottieCacheProvider.swift +21 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieConfiguration.swift +72 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieFile.swift +186 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieFileHelpers.swift +386 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/AnimationKeypath.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/AnyValueProvider.swift +132 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/ColorValueProvider.swift +96 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/FloatValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/GradientValueProvider.swift +138 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/PointValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/SizeValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/FontProvider/AnimationFontProvider.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Public/ImageProvider/AnimationImageProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/Keyframes/Interpolatable.swift +285 -0
- package/platforms/macos/src/vendor/Lottie/Public/Keyframes/Keyframe.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Public/Logging/LottieLogger.swift +138 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/AnimationTime.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/LottieColor.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/Vectors.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Public/TextProvider/AnimationTextProvider.swift +135 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/AnimationSubview.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/BundleImageProvider.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleAnimationKeypath.swift +33 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleAnimationView.swift +567 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleFontProvider.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleImageProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/FilepathImageProvider.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/LottieAnimationViewBase.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/UIColorExtension.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/AnimationSubview.macOS.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/BundleImageProvider.macOS.swift +90 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/FilepathImageProvider.macOS.swift +86 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/LottieAnimationViewBase.macOS.swift +102 -0
- package/src/Lottie.macos.tsrx +129 -0
- package/src/Lottie.tsrx +162 -0
- package/src/Lottie.web.tsrx +152 -0
- package/src/cx.mobile.ts +8 -0
- package/src/escape-props.ts +65 -0
- package/src/escape-props.web.ts +25 -0
- package/src/index.macos.ts +2 -0
- package/src/index.ts +2 -0
- package/src/index.web.ts +2 -0
- package/src/layout-child.ts +57 -0
- package/src/layout-child.web.ts +108 -0
- package/src/native-elements.d.ts +8 -0
- package/src/props.ts +133 -0
- package/src/references.d.ts +3 -0
- package/src/vendor/ui-lottie/LICENSE.md +21 -0
- package/src/vendor/ui-lottie/src/lottie/index.android.ts +447 -0
- package/src/vendor/ui-lottie/src/lottie/index.common.ts +84 -0
- package/src/vendor/ui-lottie/src/lottie/index.d.ts +133 -0
- package/src/vendor/ui-lottie/src/lottie/index.ios.ts +345 -0
- package/src/vendor/ui-lottie/src/lottie/typings/android.d.ts +4149 -0
- package/src/vendor/ui-lottie/src/lottie/typings/android.nativescript.d.ts +12 -0
- package/src/vendor/ui-lottie/src/lottie/typings/dotlottie.ios.d.ts +14 -0
- package/src/vendor/ui-lottie/src/lottie/typings/ios.d.ts +384 -0
- package/src/vendor/ui-lottie/src/lottie/utils.ts +9 -0
- package/types/generated/.tsrx-typegen-manifest.json +18 -0
- package/types/generated/Lottie.d.ts +7 -0
- package/types/generated/Lottie.web.d.ts +7 -0
- package/types/generated/cx.mobile.d.ts +6 -0
- package/types/generated/escape-props.d.ts +15 -0
- package/types/generated/escape-props.web.d.ts +5 -0
- package/types/generated/index.d.ts +2 -0
- package/types/generated/index.web.d.ts +2 -0
- package/types/generated/layout-child.d.ts +6 -0
- package/types/generated/layout-child.web.d.ts +15 -0
- package/types/generated/props.d.ts +110 -0
- package/types/generated/vendor/ui-lottie/src/lottie/index.common.d.ts +30 -0
- package/types/generated/vendor/ui-lottie/src/lottie/index.ios.d.ts +35 -0
- package/types/generated/vendor/ui-lottie/src/lottie/utils.d.ts +1 -0
- package/index.d.ts +0 -1
- package/index.js +0 -2
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
//
|
|
2
|
+
// LayerTransformPropertyMap.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 2/4/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import QuartzCore
|
|
9
|
+
|
|
10
|
+
// MARK: - LayerTransformProperties
|
|
11
|
+
|
|
12
|
+
final class LayerTransformProperties: NodePropertyMap, KeypathSearchable {
|
|
13
|
+
|
|
14
|
+
// MARK: Lifecycle
|
|
15
|
+
|
|
16
|
+
init(transform: Transform) {
|
|
17
|
+
anchor = NodeProperty(provider: KeyframeInterpolator(keyframes: transform.anchorPoint.keyframes))
|
|
18
|
+
scale = NodeProperty(provider: KeyframeInterpolator(keyframes: transform.scale.keyframes))
|
|
19
|
+
rotationX = NodeProperty(provider: KeyframeInterpolator(keyframes: transform.rotationX.keyframes))
|
|
20
|
+
rotationY = NodeProperty(provider: KeyframeInterpolator(keyframes: transform.rotationY.keyframes))
|
|
21
|
+
rotationZ = NodeProperty(provider: KeyframeInterpolator(keyframes: transform.rotationZ.keyframes))
|
|
22
|
+
opacity = NodeProperty(provider: KeyframeInterpolator(keyframes: transform.opacity.keyframes))
|
|
23
|
+
|
|
24
|
+
var propertyMap: [String: AnyNodeProperty] = [
|
|
25
|
+
"Anchor Point": anchor,
|
|
26
|
+
PropertyName.scale.rawValue: scale,
|
|
27
|
+
PropertyName.rotation.rawValue: rotationZ,
|
|
28
|
+
"Rotation X": rotationX,
|
|
29
|
+
"Rotation Y": rotationY,
|
|
30
|
+
"Rotation Z": rotationZ,
|
|
31
|
+
PropertyName.opacity.rawValue: opacity,
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
if
|
|
35
|
+
let positionKeyframesX = transform.positionX?.keyframes,
|
|
36
|
+
let positionKeyframesY = transform.positionY?.keyframes
|
|
37
|
+
{
|
|
38
|
+
let xPosition: NodeProperty<LottieVector1D> = NodeProperty(provider: KeyframeInterpolator(keyframes: positionKeyframesX))
|
|
39
|
+
let yPosition: NodeProperty<LottieVector1D> = NodeProperty(provider: KeyframeInterpolator(keyframes: positionKeyframesY))
|
|
40
|
+
propertyMap["X Position"] = xPosition
|
|
41
|
+
propertyMap["Y Position"] = yPosition
|
|
42
|
+
positionX = xPosition
|
|
43
|
+
positionY = yPosition
|
|
44
|
+
position = nil
|
|
45
|
+
} else if let positionKeyframes = transform.position?.keyframes {
|
|
46
|
+
let position: NodeProperty<LottieVector3D> = NodeProperty(provider: KeyframeInterpolator(keyframes: positionKeyframes))
|
|
47
|
+
propertyMap[PropertyName.position.rawValue] = position
|
|
48
|
+
self.position = position
|
|
49
|
+
positionX = nil
|
|
50
|
+
positionY = nil
|
|
51
|
+
} else {
|
|
52
|
+
position = nil
|
|
53
|
+
positionY = nil
|
|
54
|
+
positionX = nil
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
keypathProperties = propertyMap
|
|
58
|
+
properties = Array(propertyMap.values)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// MARK: Internal
|
|
62
|
+
|
|
63
|
+
let keypathProperties: [String: AnyNodeProperty]
|
|
64
|
+
var keypathName = "Transform"
|
|
65
|
+
|
|
66
|
+
let properties: [AnyNodeProperty]
|
|
67
|
+
|
|
68
|
+
let anchor: NodeProperty<LottieVector3D>
|
|
69
|
+
let scale: NodeProperty<LottieVector3D>
|
|
70
|
+
let rotationX: NodeProperty<LottieVector1D>
|
|
71
|
+
let rotationY: NodeProperty<LottieVector1D>
|
|
72
|
+
let rotationZ: NodeProperty<LottieVector1D>
|
|
73
|
+
let position: NodeProperty<LottieVector3D>?
|
|
74
|
+
let positionX: NodeProperty<LottieVector1D>?
|
|
75
|
+
let positionY: NodeProperty<LottieVector1D>?
|
|
76
|
+
let opacity: NodeProperty<LottieVector1D>
|
|
77
|
+
|
|
78
|
+
var childKeypaths: [KeypathSearchable] {
|
|
79
|
+
[]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// MARK: - LayerTransformNode
|
|
84
|
+
|
|
85
|
+
final class LayerTransformNode: AnimatorNode {
|
|
86
|
+
|
|
87
|
+
// MARK: Lifecycle
|
|
88
|
+
|
|
89
|
+
init(transform: Transform) {
|
|
90
|
+
transformProperties = LayerTransformProperties(transform: transform)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// MARK: Internal
|
|
94
|
+
|
|
95
|
+
let outputNode: NodeOutput = PassThroughOutputNode(parent: nil)
|
|
96
|
+
|
|
97
|
+
let transformProperties: LayerTransformProperties
|
|
98
|
+
|
|
99
|
+
var parentNode: AnimatorNode?
|
|
100
|
+
var hasLocalUpdates = false
|
|
101
|
+
var hasUpstreamUpdates = false
|
|
102
|
+
var lastUpdateFrame: CGFloat? = nil
|
|
103
|
+
var isEnabled = true
|
|
104
|
+
|
|
105
|
+
var opacity: Float = 1
|
|
106
|
+
var localTransform: CATransform3D = CATransform3DIdentity
|
|
107
|
+
var globalTransform: CATransform3D = CATransform3DIdentity
|
|
108
|
+
|
|
109
|
+
var propertyMap: NodePropertyMap & KeypathSearchable {
|
|
110
|
+
transformProperties
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
func shouldRebuildOutputs(frame _: CGFloat) -> Bool {
|
|
114
|
+
hasLocalUpdates || hasUpstreamUpdates
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
func rebuildOutputs(frame _: CGFloat) {
|
|
118
|
+
opacity = Float(transformProperties.opacity.value.cgFloatValue) * 0.01
|
|
119
|
+
|
|
120
|
+
let position: CGPoint =
|
|
121
|
+
if let point = transformProperties.position?.value.pointValue {
|
|
122
|
+
point
|
|
123
|
+
} else if
|
|
124
|
+
let xPos = transformProperties.positionX?.value.cgFloatValue,
|
|
125
|
+
let yPos = transformProperties.positionY?.value.cgFloatValue
|
|
126
|
+
{
|
|
127
|
+
CGPoint(x: xPos, y: yPos)
|
|
128
|
+
} else {
|
|
129
|
+
.zero
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
localTransform = CATransform3D.makeTransform(
|
|
133
|
+
anchor: transformProperties.anchor.value.pointValue,
|
|
134
|
+
position: position,
|
|
135
|
+
scale: transformProperties.scale.value.sizeValue,
|
|
136
|
+
rotationX: transformProperties.rotationX.value.cgFloatValue,
|
|
137
|
+
rotationY: transformProperties.rotationY.value.cgFloatValue,
|
|
138
|
+
rotationZ: transformProperties.rotationZ.value.cgFloatValue,
|
|
139
|
+
skew: nil,
|
|
140
|
+
skewAxis: nil
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
if let parentNode = parentNode as? LayerTransformNode {
|
|
144
|
+
globalTransform = CATransform3DConcat(localTransform, parentNode.globalTransform)
|
|
145
|
+
} else {
|
|
146
|
+
globalTransform = localTransform
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ItemsExtension.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/18/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - NodeTree
|
|
9
|
+
|
|
10
|
+
final class NodeTree {
|
|
11
|
+
var rootNode: AnimatorNode? = nil
|
|
12
|
+
var transform: ShapeTransform? = nil
|
|
13
|
+
var renderContainers = [ShapeContainerLayer]()
|
|
14
|
+
var paths = [PathOutputNode]()
|
|
15
|
+
var childrenNodes = [AnimatorNode]()
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
extension [ShapeItem] {
|
|
19
|
+
func initializeNodeTree() -> NodeTree {
|
|
20
|
+
let nodeTree = NodeTree()
|
|
21
|
+
|
|
22
|
+
for item in self {
|
|
23
|
+
guard item.hidden == false, item.type != .unknown else { continue }
|
|
24
|
+
if let fill = item as? Fill {
|
|
25
|
+
let node = FillNode(parentNode: nodeTree.rootNode, fill: fill)
|
|
26
|
+
nodeTree.rootNode = node
|
|
27
|
+
nodeTree.childrenNodes.append(node)
|
|
28
|
+
} else if let stroke = item as? Stroke {
|
|
29
|
+
let node = StrokeNode(parentNode: nodeTree.rootNode, stroke: stroke)
|
|
30
|
+
nodeTree.rootNode = node
|
|
31
|
+
nodeTree.childrenNodes.append(node)
|
|
32
|
+
} else if let gradientFill = item as? GradientFill {
|
|
33
|
+
let node = GradientFillNode(parentNode: nodeTree.rootNode, gradientFill: gradientFill)
|
|
34
|
+
nodeTree.rootNode = node
|
|
35
|
+
nodeTree.childrenNodes.append(node)
|
|
36
|
+
} else if let gradientStroke = item as? GradientStroke {
|
|
37
|
+
let node = GradientStrokeNode(parentNode: nodeTree.rootNode, gradientStroke: gradientStroke)
|
|
38
|
+
nodeTree.rootNode = node
|
|
39
|
+
nodeTree.childrenNodes.append(node)
|
|
40
|
+
} else if let ellipse = item as? Ellipse {
|
|
41
|
+
let node = EllipseNode(parentNode: nodeTree.rootNode, ellipse: ellipse)
|
|
42
|
+
nodeTree.rootNode = node
|
|
43
|
+
nodeTree.childrenNodes.append(node)
|
|
44
|
+
} else if let rect = item as? Rectangle {
|
|
45
|
+
let node = RectangleNode(parentNode: nodeTree.rootNode, rectangle: rect)
|
|
46
|
+
nodeTree.rootNode = node
|
|
47
|
+
nodeTree.childrenNodes.append(node)
|
|
48
|
+
} else if let star = item as? Star {
|
|
49
|
+
switch star.starType {
|
|
50
|
+
case .none:
|
|
51
|
+
continue
|
|
52
|
+
|
|
53
|
+
case .polygon:
|
|
54
|
+
let node = PolygonNode(parentNode: nodeTree.rootNode, star: star)
|
|
55
|
+
nodeTree.rootNode = node
|
|
56
|
+
nodeTree.childrenNodes.append(node)
|
|
57
|
+
|
|
58
|
+
case .star:
|
|
59
|
+
let node = StarNode(parentNode: nodeTree.rootNode, star: star)
|
|
60
|
+
nodeTree.rootNode = node
|
|
61
|
+
nodeTree.childrenNodes.append(node)
|
|
62
|
+
}
|
|
63
|
+
} else if let shape = item as? Shape {
|
|
64
|
+
let node = ShapeNode(parentNode: nodeTree.rootNode, shape: shape)
|
|
65
|
+
nodeTree.rootNode = node
|
|
66
|
+
nodeTree.childrenNodes.append(node)
|
|
67
|
+
} else if let trim = item as? Trim {
|
|
68
|
+
let node = TrimPathNode(parentNode: nodeTree.rootNode, trim: trim, upstreamPaths: nodeTree.paths)
|
|
69
|
+
nodeTree.rootNode = node
|
|
70
|
+
nodeTree.childrenNodes.append(node)
|
|
71
|
+
} else if let roundedCorners = item as? RoundedCorners {
|
|
72
|
+
let node = RoundedCornersNode(
|
|
73
|
+
parentNode: nodeTree.rootNode,
|
|
74
|
+
roundedCorners: roundedCorners,
|
|
75
|
+
upstreamPaths: nodeTree.paths
|
|
76
|
+
)
|
|
77
|
+
nodeTree.rootNode = node
|
|
78
|
+
nodeTree.childrenNodes.append(node)
|
|
79
|
+
} else if let xform = item as? ShapeTransform {
|
|
80
|
+
nodeTree.transform = xform
|
|
81
|
+
continue
|
|
82
|
+
} else if let group = item as? Group {
|
|
83
|
+
let tree = group.items.initializeNodeTree()
|
|
84
|
+
let node = GroupNode(name: group.name, parentNode: nodeTree.rootNode, tree: tree)
|
|
85
|
+
nodeTree.rootNode = node
|
|
86
|
+
nodeTree.childrenNodes.append(node)
|
|
87
|
+
/// Now add all child paths to current tree
|
|
88
|
+
nodeTree.paths.append(contentsOf: tree.paths)
|
|
89
|
+
nodeTree.renderContainers.append(node.container)
|
|
90
|
+
} else if item is Repeater {
|
|
91
|
+
LottieLogger.shared.warn("""
|
|
92
|
+
The Main Thread rendering engine doesn't currently support repeaters.
|
|
93
|
+
To play an animation with repeaters, you can use the Core Animation rendering engine instead.
|
|
94
|
+
""")
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if let pathNode = nodeTree.rootNode?.getPathNode() {
|
|
98
|
+
//// Add path container to the node tree
|
|
99
|
+
nodeTree.paths.append(pathNode.pathOutput)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if let renderNode = nodeTree.rootNode?.getRenderNode() {
|
|
103
|
+
nodeTree.renderContainers.append(ShapeRenderLayer(renderer: renderNode.renderer))
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return nodeTree
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
extension AnimatorNode {
|
|
111
|
+
/// Helper function to avoid casting to `PathNode`
|
|
112
|
+
/// More performant replacement for `nodeTree.rootNode as? PathNode`
|
|
113
|
+
fileprivate func getPathNode() -> PathNode? {
|
|
114
|
+
switch self {
|
|
115
|
+
case let node as EllipseNode:
|
|
116
|
+
node
|
|
117
|
+
case let node as PolygonNode:
|
|
118
|
+
node
|
|
119
|
+
case let node as ShapeNode:
|
|
120
|
+
node
|
|
121
|
+
case let node as StarNode:
|
|
122
|
+
node
|
|
123
|
+
case let node as RectangleNode:
|
|
124
|
+
node
|
|
125
|
+
default:
|
|
126
|
+
nil
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/// Helper function to avoid casting to `RenderNode`
|
|
131
|
+
/// More performant replacement for `nodeTree.rootNode as? RenderNode`
|
|
132
|
+
fileprivate func getRenderNode() -> RenderNode? {
|
|
133
|
+
switch self {
|
|
134
|
+
case let node as GradientFillNode:
|
|
135
|
+
node
|
|
136
|
+
case let node as StrokeNode:
|
|
137
|
+
node
|
|
138
|
+
case let node as FillNode:
|
|
139
|
+
node
|
|
140
|
+
case let node as GradientStrokeNode:
|
|
141
|
+
node
|
|
142
|
+
default:
|
|
143
|
+
nil
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//
|
|
2
|
+
// NodeProperty.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/30/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import CoreGraphics
|
|
9
|
+
import Foundation
|
|
10
|
+
|
|
11
|
+
/// A node property that holds a reference to a T ValueProvider and a T ValueContainer.
|
|
12
|
+
final class NodeProperty<T>: AnyNodeProperty {
|
|
13
|
+
|
|
14
|
+
// MARK: Lifecycle
|
|
15
|
+
|
|
16
|
+
init(provider: AnyValueProvider) {
|
|
17
|
+
valueProvider = provider
|
|
18
|
+
originalValueProvider = valueProvider
|
|
19
|
+
typedContainer = ValueContainer<T>(provider.value(frame: 0) as! T)
|
|
20
|
+
typedContainer.setNeedsUpdate()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// MARK: Internal
|
|
24
|
+
|
|
25
|
+
var valueProvider: AnyValueProvider
|
|
26
|
+
var originalValueProvider: AnyValueProvider
|
|
27
|
+
|
|
28
|
+
var valueType: Any.Type {
|
|
29
|
+
T.self
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var value: T {
|
|
33
|
+
typedContainer.outputValue
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var valueContainer: AnyValueContainer {
|
|
37
|
+
typedContainer
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
func needsUpdate(frame: CGFloat) -> Bool {
|
|
41
|
+
valueContainer.needsUpdate || valueProvider.hasUpdate(frame: frame)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
func setProvider(provider: AnyValueProvider) {
|
|
45
|
+
guard provider.valueType == valueType else { return }
|
|
46
|
+
valueProvider = provider
|
|
47
|
+
valueContainer.setNeedsUpdate()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
func removeProvider() {
|
|
51
|
+
valueProvider = originalValueProvider
|
|
52
|
+
valueContainer.setNeedsUpdate()
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
func update(frame: CGFloat) {
|
|
56
|
+
typedContainer.setValue(valueProvider.value(frame: frame), forFrame: frame)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// MARK: Fileprivate
|
|
60
|
+
|
|
61
|
+
fileprivate var typedContainer: ValueContainer<T>
|
|
62
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
//
|
|
2
|
+
// AnyNodeProperty.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/30/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import CoreGraphics
|
|
9
|
+
import Foundation
|
|
10
|
+
|
|
11
|
+
// MARK: - AnyNodeProperty
|
|
12
|
+
|
|
13
|
+
/// A property of a node. The node property holds a provider and a container
|
|
14
|
+
protocol AnyNodeProperty {
|
|
15
|
+
|
|
16
|
+
/// The stored value container for the property
|
|
17
|
+
var valueContainer: AnyValueContainer { get }
|
|
18
|
+
|
|
19
|
+
/// The value provider for the property
|
|
20
|
+
var valueProvider: AnyValueProvider { get }
|
|
21
|
+
|
|
22
|
+
/// The original value provider for the property
|
|
23
|
+
var originalValueProvider: AnyValueProvider { get }
|
|
24
|
+
|
|
25
|
+
/// The Type of the value provider
|
|
26
|
+
var valueType: Any.Type { get }
|
|
27
|
+
|
|
28
|
+
/// Returns true if the property needs to recompute its stored value
|
|
29
|
+
func needsUpdate(frame: CGFloat) -> Bool
|
|
30
|
+
|
|
31
|
+
/// Updates the property for the frame
|
|
32
|
+
func update(frame: CGFloat)
|
|
33
|
+
|
|
34
|
+
/// Sets the value provider for the property.
|
|
35
|
+
func setProvider(provider: AnyValueProvider)
|
|
36
|
+
|
|
37
|
+
/// Removes the value provider for the property.
|
|
38
|
+
func removeProvider()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
extension AnyNodeProperty {
|
|
42
|
+
|
|
43
|
+
/// Returns the most recently computed value for the keypath, returns nil if property wasn't found
|
|
44
|
+
func getValueOfType<T>() -> T? {
|
|
45
|
+
valueContainer.value as? T
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/// Returns the most recently computed value for the keypath, returns nil if property wasn't found
|
|
49
|
+
func getValue() -> Any? {
|
|
50
|
+
valueContainer.value
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// AnyValueContainer.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/30/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import CoreGraphics
|
|
9
|
+
import Foundation
|
|
10
|
+
|
|
11
|
+
/// The container for the value of a property.
|
|
12
|
+
protocol AnyValueContainer: AnyObject {
|
|
13
|
+
|
|
14
|
+
/// The stored value of the container
|
|
15
|
+
var value: Any { get }
|
|
16
|
+
|
|
17
|
+
/// When true the container needs to have its value updated by its provider
|
|
18
|
+
var needsUpdate: Bool { get }
|
|
19
|
+
|
|
20
|
+
/// The frame time of the last provided update
|
|
21
|
+
var lastUpdateFrame: CGFloat { get }
|
|
22
|
+
|
|
23
|
+
/// Notifies the provider that it should update its container
|
|
24
|
+
func setNeedsUpdate()
|
|
25
|
+
|
|
26
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// KeypathSettable.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 2/4/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import QuartzCore
|
|
9
|
+
|
|
10
|
+
/// Protocol that provides keypath search functionality. Returns all node properties associated with a keypath.
|
|
11
|
+
protocol KeypathSearchable {
|
|
12
|
+
|
|
13
|
+
/// The name of the Keypath
|
|
14
|
+
var keypathName: String { get }
|
|
15
|
+
|
|
16
|
+
/// A list of properties belonging to the keypath.
|
|
17
|
+
var keypathProperties: [String: AnyNodeProperty] { get }
|
|
18
|
+
|
|
19
|
+
/// Children Keypaths
|
|
20
|
+
var childKeypaths: [KeypathSearchable] { get }
|
|
21
|
+
|
|
22
|
+
var keypathLayer: CALayer? { get }
|
|
23
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//
|
|
2
|
+
// NodePropertyMap.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/21/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import QuartzCore
|
|
9
|
+
|
|
10
|
+
// MARK: - NodePropertyMap
|
|
11
|
+
|
|
12
|
+
protocol NodePropertyMap {
|
|
13
|
+
var properties: [AnyNodeProperty] { get }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
extension NodePropertyMap {
|
|
17
|
+
|
|
18
|
+
var childKeypaths: [KeypathSearchable] {
|
|
19
|
+
[]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
var keypathLayer: CALayer? {
|
|
23
|
+
nil
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/// Checks if the node's local contents need to be rebuilt.
|
|
27
|
+
func needsLocalUpdate(frame: CGFloat) -> Bool {
|
|
28
|
+
for property in properties {
|
|
29
|
+
if property.needsUpdate(frame: frame) {
|
|
30
|
+
return true
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return false
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/// Rebuilds only the local nodes that have an update for the frame
|
|
37
|
+
func updateNodeProperties(frame: CGFloat) {
|
|
38
|
+
for property in properties {
|
|
39
|
+
property.update(frame: frame)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ValueContainer.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/30/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import CoreGraphics
|
|
9
|
+
import Foundation
|
|
10
|
+
|
|
11
|
+
/// A container for a node value that is Typed to T.
|
|
12
|
+
final class ValueContainer<T>: AnyValueContainer {
|
|
13
|
+
|
|
14
|
+
// MARK: Lifecycle
|
|
15
|
+
|
|
16
|
+
init(_ value: T) {
|
|
17
|
+
outputValue = value
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// MARK: Internal
|
|
21
|
+
|
|
22
|
+
private(set) var lastUpdateFrame = CGFloat.infinity
|
|
23
|
+
|
|
24
|
+
fileprivate(set) var needsUpdate = true
|
|
25
|
+
|
|
26
|
+
var value: Any {
|
|
27
|
+
outputValue as Any
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var outputValue: T {
|
|
31
|
+
didSet {
|
|
32
|
+
needsUpdate = false
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
func setValue(_ value: Any, forFrame: CGFloat) {
|
|
37
|
+
if let typedValue = value as? T {
|
|
38
|
+
needsUpdate = false
|
|
39
|
+
lastUpdateFrame = forFrame
|
|
40
|
+
outputValue = typedValue
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
func setNeedsUpdate() {
|
|
45
|
+
needsUpdate = true
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// KeyframeGroupInterpolator.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/22/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import CoreGraphics
|
|
9
|
+
import Foundation
|
|
10
|
+
|
|
11
|
+
/// A value provider that produces an array of values from an array of Keyframe Interpolators
|
|
12
|
+
final class GroupInterpolator<ValueType: Interpolatable>: ValueProvider {
|
|
13
|
+
|
|
14
|
+
// MARK: Lifecycle
|
|
15
|
+
|
|
16
|
+
/// Initialize with an array of array of keyframes.
|
|
17
|
+
init(keyframeGroups: ContiguousArray<ContiguousArray<Keyframe<ValueType>>>) {
|
|
18
|
+
keyframeInterpolators = ContiguousArray(keyframeGroups.map { KeyframeInterpolator(keyframes: $0) })
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// MARK: Internal
|
|
22
|
+
|
|
23
|
+
let keyframeInterpolators: ContiguousArray<KeyframeInterpolator<ValueType>>
|
|
24
|
+
|
|
25
|
+
var valueType: Any.Type {
|
|
26
|
+
[ValueType].self
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var storage: ValueProviderStorage<[ValueType]> {
|
|
30
|
+
.closure { frame in
|
|
31
|
+
self.keyframeInterpolators.map { $0.value(frame: frame) as! ValueType }
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
func hasUpdate(frame: CGFloat) -> Bool {
|
|
36
|
+
let updated = keyframeInterpolators.first(where: { $0.hasUpdate(frame: frame) })
|
|
37
|
+
return updated != nil
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//
|
|
2
|
+
// SingleValueProvider.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/30/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import QuartzCore
|
|
10
|
+
|
|
11
|
+
/// Returns a value for every frame.
|
|
12
|
+
final class SingleValueProvider<ValueType: AnyInterpolatable>: ValueProvider {
|
|
13
|
+
|
|
14
|
+
// MARK: Lifecycle
|
|
15
|
+
|
|
16
|
+
init(_ value: ValueType) {
|
|
17
|
+
self.value = value
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// MARK: Internal
|
|
21
|
+
|
|
22
|
+
var value: ValueType {
|
|
23
|
+
didSet {
|
|
24
|
+
hasUpdate = true
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var storage: ValueProviderStorage<ValueType> {
|
|
29
|
+
.singleValue(value)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var valueType: Any.Type {
|
|
33
|
+
ValueType.self
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
func hasUpdate(frame _: CGFloat) -> Bool {
|
|
37
|
+
hasUpdate
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// MARK: Private
|
|
41
|
+
|
|
42
|
+
private var hasUpdate = true
|
|
43
|
+
}
|