@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,143 @@
|
|
|
1
|
+
//
|
|
2
|
+
// EllipseNode.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/17/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import QuartzCore
|
|
10
|
+
|
|
11
|
+
// MARK: - EllipseNodeProperties
|
|
12
|
+
|
|
13
|
+
final class EllipseNodeProperties: NodePropertyMap, KeypathSearchable {
|
|
14
|
+
|
|
15
|
+
// MARK: Lifecycle
|
|
16
|
+
|
|
17
|
+
init(ellipse: Ellipse) {
|
|
18
|
+
keypathName = ellipse.name
|
|
19
|
+
direction = ellipse.direction
|
|
20
|
+
position = NodeProperty(provider: KeyframeInterpolator(keyframes: ellipse.position.keyframes))
|
|
21
|
+
size = NodeProperty(provider: KeyframeInterpolator(keyframes: ellipse.size.keyframes))
|
|
22
|
+
keypathProperties = [
|
|
23
|
+
PropertyName.position.rawValue: position,
|
|
24
|
+
"Size": size,
|
|
25
|
+
]
|
|
26
|
+
properties = Array(keypathProperties.values)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// MARK: Internal
|
|
30
|
+
|
|
31
|
+
var keypathName: String
|
|
32
|
+
|
|
33
|
+
let direction: PathDirection
|
|
34
|
+
let position: NodeProperty<LottieVector3D>
|
|
35
|
+
let size: NodeProperty<LottieVector3D>
|
|
36
|
+
|
|
37
|
+
let keypathProperties: [String: AnyNodeProperty]
|
|
38
|
+
let properties: [AnyNodeProperty]
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// MARK: - EllipseNode
|
|
42
|
+
|
|
43
|
+
final class EllipseNode: AnimatorNode, PathNode {
|
|
44
|
+
|
|
45
|
+
// MARK: Lifecycle
|
|
46
|
+
|
|
47
|
+
init(parentNode: AnimatorNode?, ellipse: Ellipse) {
|
|
48
|
+
pathOutput = PathOutputNode(parent: parentNode?.outputNode)
|
|
49
|
+
properties = EllipseNodeProperties(ellipse: ellipse)
|
|
50
|
+
self.parentNode = parentNode
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// MARK: Internal
|
|
54
|
+
|
|
55
|
+
static let ControlPointConstant: CGFloat = 0.55228
|
|
56
|
+
|
|
57
|
+
let pathOutput: PathOutputNode
|
|
58
|
+
|
|
59
|
+
let properties: EllipseNodeProperties
|
|
60
|
+
|
|
61
|
+
let parentNode: AnimatorNode?
|
|
62
|
+
var hasLocalUpdates = false
|
|
63
|
+
var hasUpstreamUpdates = false
|
|
64
|
+
var lastUpdateFrame: CGFloat? = nil
|
|
65
|
+
|
|
66
|
+
var propertyMap: NodePropertyMap & KeypathSearchable {
|
|
67
|
+
properties
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
var isEnabled = true {
|
|
71
|
+
didSet {
|
|
72
|
+
pathOutput.isEnabled = isEnabled
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
func rebuildOutputs(frame: CGFloat) {
|
|
77
|
+
pathOutput.setPath(
|
|
78
|
+
.ellipse(
|
|
79
|
+
size: properties.size.value.sizeValue,
|
|
80
|
+
center: properties.position.value.pointValue,
|
|
81
|
+
direction: properties.direction
|
|
82
|
+
),
|
|
83
|
+
updateFrame: frame
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
extension BezierPath {
|
|
90
|
+
/// Constructs a `BezierPath` in the shape of an ellipse
|
|
91
|
+
static func ellipse(
|
|
92
|
+
size: CGSize,
|
|
93
|
+
center: CGPoint,
|
|
94
|
+
direction: PathDirection
|
|
95
|
+
) -> BezierPath {
|
|
96
|
+
// Unfortunately we HAVE to manually build out the ellipse.
|
|
97
|
+
// Every Apple method constructs an ellipse from the 3 o-clock position
|
|
98
|
+
// After effects constructs from the Noon position.
|
|
99
|
+
// After effects does clockwise, but also has a flag for reversed.
|
|
100
|
+
var half = size * 0.5
|
|
101
|
+
if direction == .counterClockwise {
|
|
102
|
+
half.width = half.width * -1
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
let q1 = CGPoint(x: center.x, y: center.y - half.height)
|
|
106
|
+
let q2 = CGPoint(x: center.x + half.width, y: center.y)
|
|
107
|
+
let q3 = CGPoint(x: center.x, y: center.y + half.height)
|
|
108
|
+
let q4 = CGPoint(x: center.x - half.width, y: center.y)
|
|
109
|
+
|
|
110
|
+
let cp = half * EllipseNode.ControlPointConstant
|
|
111
|
+
|
|
112
|
+
var path = BezierPath(startPoint: CurveVertex(
|
|
113
|
+
point: q1,
|
|
114
|
+
inTangentRelative: CGPoint(x: -cp.width, y: 0),
|
|
115
|
+
outTangentRelative: CGPoint(x: cp.width, y: 0)
|
|
116
|
+
))
|
|
117
|
+
path.addVertex(CurveVertex(
|
|
118
|
+
point: q2,
|
|
119
|
+
inTangentRelative: CGPoint(x: 0, y: -cp.height),
|
|
120
|
+
outTangentRelative: CGPoint(x: 0, y: cp.height)
|
|
121
|
+
))
|
|
122
|
+
|
|
123
|
+
path.addVertex(CurveVertex(
|
|
124
|
+
point: q3,
|
|
125
|
+
inTangentRelative: CGPoint(x: cp.width, y: 0),
|
|
126
|
+
outTangentRelative: CGPoint(x: -cp.width, y: 0)
|
|
127
|
+
))
|
|
128
|
+
|
|
129
|
+
path.addVertex(CurveVertex(
|
|
130
|
+
point: q4,
|
|
131
|
+
inTangentRelative: CGPoint(x: 0, y: cp.height),
|
|
132
|
+
outTangentRelative: CGPoint(x: 0, y: -cp.height)
|
|
133
|
+
))
|
|
134
|
+
|
|
135
|
+
path.addVertex(CurveVertex(
|
|
136
|
+
point: q1,
|
|
137
|
+
inTangentRelative: CGPoint(x: -cp.width, y: 0),
|
|
138
|
+
outTangentRelative: CGPoint(x: cp.width, y: 0)
|
|
139
|
+
))
|
|
140
|
+
path.close()
|
|
141
|
+
return path
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PolygonNode.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/21/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import QuartzCore
|
|
10
|
+
|
|
11
|
+
// MARK: - PolygonNodeProperties
|
|
12
|
+
|
|
13
|
+
final class PolygonNodeProperties: NodePropertyMap, KeypathSearchable {
|
|
14
|
+
|
|
15
|
+
// MARK: Lifecycle
|
|
16
|
+
|
|
17
|
+
init(star: Star) {
|
|
18
|
+
keypathName = star.name
|
|
19
|
+
direction = star.direction
|
|
20
|
+
position = NodeProperty(provider: KeyframeInterpolator(keyframes: star.position.keyframes))
|
|
21
|
+
outerRadius = NodeProperty(provider: KeyframeInterpolator(keyframes: star.outerRadius.keyframes))
|
|
22
|
+
outerRoundedness = NodeProperty(provider: KeyframeInterpolator(keyframes: star.outerRoundness.keyframes))
|
|
23
|
+
rotation = NodeProperty(provider: KeyframeInterpolator(keyframes: star.rotation.keyframes))
|
|
24
|
+
points = NodeProperty(provider: KeyframeInterpolator(keyframes: star.points.keyframes))
|
|
25
|
+
keypathProperties = [
|
|
26
|
+
PropertyName.position.rawValue: position,
|
|
27
|
+
"Outer Radius": outerRadius,
|
|
28
|
+
"Outer Roundedness": outerRoundedness,
|
|
29
|
+
PropertyName.rotation.rawValue: rotation,
|
|
30
|
+
"Points": points,
|
|
31
|
+
]
|
|
32
|
+
properties = Array(keypathProperties.values)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// MARK: Internal
|
|
36
|
+
|
|
37
|
+
var keypathName: String
|
|
38
|
+
|
|
39
|
+
var childKeypaths = [KeypathSearchable]()
|
|
40
|
+
|
|
41
|
+
let keypathProperties: [String: AnyNodeProperty]
|
|
42
|
+
let properties: [AnyNodeProperty]
|
|
43
|
+
|
|
44
|
+
let direction: PathDirection
|
|
45
|
+
let position: NodeProperty<LottieVector3D>
|
|
46
|
+
let outerRadius: NodeProperty<LottieVector1D>
|
|
47
|
+
let outerRoundedness: NodeProperty<LottieVector1D>
|
|
48
|
+
let rotation: NodeProperty<LottieVector1D>
|
|
49
|
+
let points: NodeProperty<LottieVector1D>
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// MARK: - PolygonNode
|
|
53
|
+
|
|
54
|
+
final class PolygonNode: AnimatorNode, PathNode {
|
|
55
|
+
|
|
56
|
+
// MARK: Lifecycle
|
|
57
|
+
|
|
58
|
+
init(parentNode: AnimatorNode?, star: Star) {
|
|
59
|
+
pathOutput = PathOutputNode(parent: parentNode?.outputNode)
|
|
60
|
+
properties = PolygonNodeProperties(star: star)
|
|
61
|
+
self.parentNode = parentNode
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// MARK: Internal
|
|
65
|
+
|
|
66
|
+
/// Magic number needed for constructing path.
|
|
67
|
+
static let PolygonConstant: CGFloat = 0.25
|
|
68
|
+
|
|
69
|
+
let properties: PolygonNodeProperties
|
|
70
|
+
|
|
71
|
+
let pathOutput: PathOutputNode
|
|
72
|
+
|
|
73
|
+
let parentNode: AnimatorNode?
|
|
74
|
+
var hasLocalUpdates = false
|
|
75
|
+
var hasUpstreamUpdates = false
|
|
76
|
+
var lastUpdateFrame: CGFloat? = nil
|
|
77
|
+
|
|
78
|
+
var propertyMap: NodePropertyMap & KeypathSearchable {
|
|
79
|
+
properties
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
var isEnabled = true {
|
|
83
|
+
didSet {
|
|
84
|
+
pathOutput.isEnabled = isEnabled
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
func rebuildOutputs(frame: CGFloat) {
|
|
89
|
+
let path = BezierPath.polygon(
|
|
90
|
+
position: properties.position.value.pointValue,
|
|
91
|
+
numberOfPoints: properties.points.value.cgFloatValue,
|
|
92
|
+
outerRadius: properties.outerRadius.value.cgFloatValue,
|
|
93
|
+
outerRoundedness: properties.outerRoundedness.value.cgFloatValue,
|
|
94
|
+
rotation: properties.rotation.value.cgFloatValue,
|
|
95
|
+
direction: properties.direction
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
pathOutput.setPath(path, updateFrame: frame)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
extension BezierPath {
|
|
104
|
+
/// Creates a `BezierPath` in the shape of a polygon
|
|
105
|
+
static func polygon(
|
|
106
|
+
position: CGPoint,
|
|
107
|
+
numberOfPoints: CGFloat,
|
|
108
|
+
outerRadius: CGFloat,
|
|
109
|
+
outerRoundedness inputOuterRoundedness: CGFloat,
|
|
110
|
+
rotation: CGFloat,
|
|
111
|
+
direction: PathDirection
|
|
112
|
+
) -> BezierPath {
|
|
113
|
+
var currentAngle = (rotation - 90).toRadians()
|
|
114
|
+
let anglePerPoint = ((2 * CGFloat.pi) / numberOfPoints)
|
|
115
|
+
let outerRoundedness = inputOuterRoundedness * 0.01
|
|
116
|
+
|
|
117
|
+
var point = CGPoint(
|
|
118
|
+
x: outerRadius * cos(currentAngle),
|
|
119
|
+
y: outerRadius * sin(currentAngle)
|
|
120
|
+
)
|
|
121
|
+
var vertices = [CurveVertex(point: point + position, inTangentRelative: .zero, outTangentRelative: .zero)]
|
|
122
|
+
|
|
123
|
+
var previousPoint = point
|
|
124
|
+
currentAngle += anglePerPoint
|
|
125
|
+
for _ in 0..<Int(ceil(numberOfPoints)) {
|
|
126
|
+
previousPoint = point
|
|
127
|
+
point = CGPoint(
|
|
128
|
+
x: outerRadius * cos(currentAngle),
|
|
129
|
+
y: outerRadius * sin(currentAngle)
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
if outerRoundedness != 0 {
|
|
133
|
+
let cp1Theta = (atan2(previousPoint.y, previousPoint.x) - CGFloat.pi / 2)
|
|
134
|
+
let cp1Dx = cos(cp1Theta)
|
|
135
|
+
let cp1Dy = sin(cp1Theta)
|
|
136
|
+
|
|
137
|
+
let cp2Theta = (atan2(point.y, point.x) - CGFloat.pi / 2)
|
|
138
|
+
let cp2Dx = cos(cp2Theta)
|
|
139
|
+
let cp2Dy = sin(cp2Theta)
|
|
140
|
+
|
|
141
|
+
let cp1 = CGPoint(
|
|
142
|
+
x: outerRadius * outerRoundedness * PolygonNode.PolygonConstant * cp1Dx,
|
|
143
|
+
y: outerRadius * outerRoundedness * PolygonNode.PolygonConstant * cp1Dy
|
|
144
|
+
)
|
|
145
|
+
let cp2 = CGPoint(
|
|
146
|
+
x: outerRadius * outerRoundedness * PolygonNode.PolygonConstant * cp2Dx,
|
|
147
|
+
y: outerRadius * outerRoundedness * PolygonNode.PolygonConstant * cp2Dy
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
let previousVertex = vertices[vertices.endIndex - 1]
|
|
151
|
+
vertices[vertices.endIndex - 1] = CurveVertex(
|
|
152
|
+
previousVertex.inTangent,
|
|
153
|
+
previousVertex.point,
|
|
154
|
+
previousVertex.point - cp1
|
|
155
|
+
)
|
|
156
|
+
vertices.append(CurveVertex(point: point + position, inTangentRelative: cp2, outTangentRelative: .zero))
|
|
157
|
+
} else {
|
|
158
|
+
vertices.append(CurveVertex(point: point + position, inTangentRelative: .zero, outTangentRelative: .zero))
|
|
159
|
+
}
|
|
160
|
+
currentAngle += anglePerPoint
|
|
161
|
+
}
|
|
162
|
+
let reverse = direction == .counterClockwise
|
|
163
|
+
if reverse {
|
|
164
|
+
vertices = vertices.reversed()
|
|
165
|
+
}
|
|
166
|
+
var path = BezierPath()
|
|
167
|
+
for vertex in vertices {
|
|
168
|
+
path.addVertex(reverse ? vertex.reversed() : vertex)
|
|
169
|
+
}
|
|
170
|
+
path.close()
|
|
171
|
+
return path
|
|
172
|
+
}
|
|
173
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RectNode.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/21/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import CoreGraphics
|
|
9
|
+
import Foundation
|
|
10
|
+
|
|
11
|
+
// MARK: - RectNodeProperties
|
|
12
|
+
|
|
13
|
+
final class RectNodeProperties: NodePropertyMap, KeypathSearchable {
|
|
14
|
+
|
|
15
|
+
// MARK: Lifecycle
|
|
16
|
+
|
|
17
|
+
init(rectangle: Rectangle) {
|
|
18
|
+
keypathName = rectangle.name
|
|
19
|
+
direction = rectangle.direction
|
|
20
|
+
position = NodeProperty(provider: KeyframeInterpolator(keyframes: rectangle.position.keyframes))
|
|
21
|
+
size = NodeProperty(provider: KeyframeInterpolator(keyframes: rectangle.size.keyframes))
|
|
22
|
+
cornerRadius = NodeProperty(provider: KeyframeInterpolator(keyframes: rectangle.cornerRadius.keyframes))
|
|
23
|
+
|
|
24
|
+
keypathProperties = [
|
|
25
|
+
PropertyName.position.rawValue: position,
|
|
26
|
+
"Size": size,
|
|
27
|
+
"Roundness": cornerRadius,
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
properties = Array(keypathProperties.values)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// MARK: Internal
|
|
34
|
+
|
|
35
|
+
var keypathName: String
|
|
36
|
+
|
|
37
|
+
let keypathProperties: [String: AnyNodeProperty]
|
|
38
|
+
let properties: [AnyNodeProperty]
|
|
39
|
+
|
|
40
|
+
let direction: PathDirection
|
|
41
|
+
let position: NodeProperty<LottieVector3D>
|
|
42
|
+
let size: NodeProperty<LottieVector3D>
|
|
43
|
+
let cornerRadius: NodeProperty<LottieVector1D>
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// MARK: - RectangleNode
|
|
48
|
+
|
|
49
|
+
final class RectangleNode: AnimatorNode, PathNode {
|
|
50
|
+
|
|
51
|
+
// MARK: Lifecycle
|
|
52
|
+
|
|
53
|
+
init(parentNode: AnimatorNode?, rectangle: Rectangle) {
|
|
54
|
+
properties = RectNodeProperties(rectangle: rectangle)
|
|
55
|
+
pathOutput = PathOutputNode(parent: parentNode?.outputNode)
|
|
56
|
+
self.parentNode = parentNode
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// MARK: Internal
|
|
60
|
+
|
|
61
|
+
let properties: RectNodeProperties
|
|
62
|
+
|
|
63
|
+
let pathOutput: PathOutputNode
|
|
64
|
+
let parentNode: AnimatorNode?
|
|
65
|
+
var hasLocalUpdates = false
|
|
66
|
+
var hasUpstreamUpdates = false
|
|
67
|
+
var lastUpdateFrame: CGFloat? = nil
|
|
68
|
+
|
|
69
|
+
var propertyMap: NodePropertyMap & KeypathSearchable {
|
|
70
|
+
properties
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
var isEnabled = true {
|
|
74
|
+
didSet {
|
|
75
|
+
pathOutput.isEnabled = isEnabled
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
func rebuildOutputs(frame: CGFloat) {
|
|
80
|
+
pathOutput.setPath(
|
|
81
|
+
.rectangle(
|
|
82
|
+
position: properties.position.value.pointValue,
|
|
83
|
+
size: properties.size.value.sizeValue,
|
|
84
|
+
cornerRadius: properties.cornerRadius.value.cgFloatValue,
|
|
85
|
+
direction: properties.direction
|
|
86
|
+
),
|
|
87
|
+
updateFrame: frame
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// MARK: - BezierPath + rectangle
|
|
94
|
+
|
|
95
|
+
extension BezierPath {
|
|
96
|
+
/// Constructs a `BezierPath` in the shape of a rectangle, optionally with rounded corners
|
|
97
|
+
static func rectangle(
|
|
98
|
+
position: CGPoint,
|
|
99
|
+
size inputSize: CGSize,
|
|
100
|
+
cornerRadius: CGFloat,
|
|
101
|
+
direction: PathDirection
|
|
102
|
+
) -> BezierPath {
|
|
103
|
+
let size = inputSize * 0.5
|
|
104
|
+
let radius = min(min(cornerRadius, size.width), size.height)
|
|
105
|
+
|
|
106
|
+
var bezierPath = BezierPath()
|
|
107
|
+
let points: [CurveVertex]
|
|
108
|
+
|
|
109
|
+
if radius <= 0 {
|
|
110
|
+
/// No Corners
|
|
111
|
+
points = [
|
|
112
|
+
/// Lead In
|
|
113
|
+
CurveVertex(
|
|
114
|
+
point: CGPoint(x: size.width, y: -size.height),
|
|
115
|
+
inTangentRelative: .zero,
|
|
116
|
+
outTangentRelative: .zero
|
|
117
|
+
)
|
|
118
|
+
.translated(position),
|
|
119
|
+
/// Corner 1
|
|
120
|
+
CurveVertex(
|
|
121
|
+
point: CGPoint(x: size.width, y: size.height),
|
|
122
|
+
inTangentRelative: .zero,
|
|
123
|
+
outTangentRelative: .zero
|
|
124
|
+
)
|
|
125
|
+
.translated(position),
|
|
126
|
+
/// Corner 2
|
|
127
|
+
CurveVertex(
|
|
128
|
+
point: CGPoint(x: -size.width, y: size.height),
|
|
129
|
+
inTangentRelative: .zero,
|
|
130
|
+
outTangentRelative: .zero
|
|
131
|
+
)
|
|
132
|
+
.translated(position),
|
|
133
|
+
/// Corner 3
|
|
134
|
+
CurveVertex(
|
|
135
|
+
point: CGPoint(x: -size.width, y: -size.height),
|
|
136
|
+
inTangentRelative: .zero,
|
|
137
|
+
outTangentRelative: .zero
|
|
138
|
+
)
|
|
139
|
+
.translated(position),
|
|
140
|
+
/// Corner 4
|
|
141
|
+
CurveVertex(
|
|
142
|
+
point: CGPoint(x: size.width, y: -size.height),
|
|
143
|
+
inTangentRelative: .zero,
|
|
144
|
+
outTangentRelative: .zero
|
|
145
|
+
)
|
|
146
|
+
.translated(position),
|
|
147
|
+
]
|
|
148
|
+
} else {
|
|
149
|
+
let controlPoint = radius * EllipseNode.ControlPointConstant
|
|
150
|
+
points = [
|
|
151
|
+
/// Lead In
|
|
152
|
+
CurveVertex(
|
|
153
|
+
CGPoint(x: radius, y: 0),
|
|
154
|
+
CGPoint(x: radius, y: 0),
|
|
155
|
+
CGPoint(x: radius, y: 0)
|
|
156
|
+
)
|
|
157
|
+
.translated(CGPoint(x: -radius, y: radius))
|
|
158
|
+
.translated(CGPoint(x: size.width, y: -size.height))
|
|
159
|
+
.translated(position),
|
|
160
|
+
/// Corner 1
|
|
161
|
+
CurveVertex(
|
|
162
|
+
CGPoint(x: radius, y: 0), // In tangent
|
|
163
|
+
CGPoint(x: radius, y: 0), // Point
|
|
164
|
+
CGPoint(x: radius, y: controlPoint)
|
|
165
|
+
)
|
|
166
|
+
.translated(CGPoint(x: -radius, y: -radius))
|
|
167
|
+
.translated(CGPoint(x: size.width, y: size.height))
|
|
168
|
+
.translated(position),
|
|
169
|
+
CurveVertex(
|
|
170
|
+
CGPoint(x: controlPoint, y: radius), // In tangent
|
|
171
|
+
CGPoint(x: 0, y: radius), // Point
|
|
172
|
+
CGPoint(x: 0, y: radius)
|
|
173
|
+
) // Out Tangent
|
|
174
|
+
.translated(CGPoint(x: -radius, y: -radius))
|
|
175
|
+
.translated(CGPoint(x: size.width, y: size.height))
|
|
176
|
+
.translated(position),
|
|
177
|
+
/// Corner 2
|
|
178
|
+
CurveVertex(
|
|
179
|
+
CGPoint(x: 0, y: radius), // In tangent
|
|
180
|
+
CGPoint(x: 0, y: radius), // Point
|
|
181
|
+
CGPoint(x: -controlPoint, y: radius)
|
|
182
|
+
) // Out tangent
|
|
183
|
+
.translated(CGPoint(x: radius, y: -radius))
|
|
184
|
+
.translated(CGPoint(x: -size.width, y: size.height))
|
|
185
|
+
.translated(position),
|
|
186
|
+
CurveVertex(
|
|
187
|
+
CGPoint(x: -radius, y: controlPoint), // In tangent
|
|
188
|
+
CGPoint(x: -radius, y: 0), // Point
|
|
189
|
+
CGPoint(x: -radius, y: 0)
|
|
190
|
+
) // Out tangent
|
|
191
|
+
.translated(CGPoint(x: radius, y: -radius))
|
|
192
|
+
.translated(CGPoint(x: -size.width, y: size.height))
|
|
193
|
+
.translated(position),
|
|
194
|
+
/// Corner 3
|
|
195
|
+
CurveVertex(
|
|
196
|
+
CGPoint(x: -radius, y: 0), // In tangent
|
|
197
|
+
CGPoint(x: -radius, y: 0), // Point
|
|
198
|
+
CGPoint(x: -radius, y: -controlPoint)
|
|
199
|
+
) // Out tangent
|
|
200
|
+
.translated(CGPoint(x: radius, y: radius))
|
|
201
|
+
.translated(CGPoint(x: -size.width, y: -size.height))
|
|
202
|
+
.translated(position),
|
|
203
|
+
CurveVertex(
|
|
204
|
+
CGPoint(x: -controlPoint, y: -radius), // In tangent
|
|
205
|
+
CGPoint(x: 0, y: -radius), // Point
|
|
206
|
+
CGPoint(x: 0, y: -radius)
|
|
207
|
+
) // Out tangent
|
|
208
|
+
.translated(CGPoint(x: radius, y: radius))
|
|
209
|
+
.translated(CGPoint(x: -size.width, y: -size.height))
|
|
210
|
+
.translated(position),
|
|
211
|
+
/// Corner 4
|
|
212
|
+
CurveVertex(
|
|
213
|
+
CGPoint(x: 0, y: -radius), // In tangent
|
|
214
|
+
CGPoint(x: 0, y: -radius), // Point
|
|
215
|
+
CGPoint(x: controlPoint, y: -radius)
|
|
216
|
+
) // Out tangent
|
|
217
|
+
.translated(CGPoint(x: -radius, y: radius))
|
|
218
|
+
.translated(CGPoint(x: size.width, y: -size.height))
|
|
219
|
+
.translated(position),
|
|
220
|
+
CurveVertex(
|
|
221
|
+
CGPoint(x: radius, y: -controlPoint), // In tangent
|
|
222
|
+
CGPoint(x: radius, y: 0), // Point
|
|
223
|
+
CGPoint(x: radius, y: 0)
|
|
224
|
+
) // Out tangent
|
|
225
|
+
.translated(CGPoint(x: -radius, y: radius))
|
|
226
|
+
.translated(CGPoint(x: size.width, y: -size.height))
|
|
227
|
+
.translated(position),
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
let reversed = direction == .counterClockwise
|
|
231
|
+
let pathPoints = reversed ? points.reversed() : points
|
|
232
|
+
for point in pathPoints {
|
|
233
|
+
bezierPath.addVertex(reversed ? point.reversed() : point)
|
|
234
|
+
}
|
|
235
|
+
bezierPath.close()
|
|
236
|
+
return bezierPath
|
|
237
|
+
}
|
|
238
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PathNode.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/16/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import CoreGraphics
|
|
9
|
+
import Foundation
|
|
10
|
+
|
|
11
|
+
// MARK: - ShapeNodeProperties
|
|
12
|
+
|
|
13
|
+
final class ShapeNodeProperties: NodePropertyMap, KeypathSearchable {
|
|
14
|
+
|
|
15
|
+
// MARK: Lifecycle
|
|
16
|
+
|
|
17
|
+
init(shape: Shape) {
|
|
18
|
+
keypathName = shape.name
|
|
19
|
+
path = NodeProperty(provider: KeyframeInterpolator(keyframes: shape.path.keyframes))
|
|
20
|
+
keypathProperties = [
|
|
21
|
+
"Path": path
|
|
22
|
+
]
|
|
23
|
+
properties = Array(keypathProperties.values)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// MARK: Internal
|
|
27
|
+
|
|
28
|
+
var keypathName: String
|
|
29
|
+
|
|
30
|
+
let path: NodeProperty<BezierPath>
|
|
31
|
+
let keypathProperties: [String: AnyNodeProperty]
|
|
32
|
+
let properties: [AnyNodeProperty]
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// MARK: - ShapeNode
|
|
37
|
+
|
|
38
|
+
final class ShapeNode: AnimatorNode, PathNode {
|
|
39
|
+
|
|
40
|
+
// MARK: Lifecycle
|
|
41
|
+
|
|
42
|
+
init(parentNode: AnimatorNode?, shape: Shape) {
|
|
43
|
+
pathOutput = PathOutputNode(parent: parentNode?.outputNode)
|
|
44
|
+
properties = ShapeNodeProperties(shape: shape)
|
|
45
|
+
self.parentNode = parentNode
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// MARK: Internal
|
|
49
|
+
|
|
50
|
+
let properties: ShapeNodeProperties
|
|
51
|
+
|
|
52
|
+
let pathOutput: PathOutputNode
|
|
53
|
+
|
|
54
|
+
let parentNode: AnimatorNode?
|
|
55
|
+
var hasLocalUpdates = false
|
|
56
|
+
var hasUpstreamUpdates = false
|
|
57
|
+
var lastUpdateFrame: CGFloat? = nil
|
|
58
|
+
|
|
59
|
+
var propertyMap: NodePropertyMap & KeypathSearchable {
|
|
60
|
+
properties
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
var isEnabled = true {
|
|
64
|
+
didSet {
|
|
65
|
+
pathOutput.isEnabled = isEnabled
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
func rebuildOutputs(frame: CGFloat) {
|
|
70
|
+
pathOutput.setPath(properties.path.value, updateFrame: frame)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
}
|