@octane-xplat/lottie 0.9.0 → 0.11.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 +36 -16
- package/dist/native/index.js +10 -9
- package/dist/native/octane-client-build.json +1 -1
- package/dist/web/index.js +39 -25
- package/dist/web/octane-client-build.json +1 -1
- package/package.json +25 -3
- 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 +6 -4
- package/src/Lottie.web.tsrx +28 -11
- package/src/index.macos.ts +2 -0
- package/src/props.ts +6 -1
- package/types/generated/props.d.ts +5 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
//
|
|
2
|
+
// GradientStrokeNode.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/23/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import CoreGraphics
|
|
9
|
+
import Foundation
|
|
10
|
+
|
|
11
|
+
// MARK: - GradientStrokeProperties
|
|
12
|
+
|
|
13
|
+
final class GradientStrokeProperties: NodePropertyMap, KeypathSearchable {
|
|
14
|
+
|
|
15
|
+
// MARK: Lifecycle
|
|
16
|
+
|
|
17
|
+
init(gradientStroke: GradientStroke) {
|
|
18
|
+
keypathName = gradientStroke.name
|
|
19
|
+
opacity = NodeProperty(provider: KeyframeInterpolator(keyframes: gradientStroke.opacity.keyframes))
|
|
20
|
+
startPoint = NodeProperty(provider: KeyframeInterpolator(keyframes: gradientStroke.startPoint.keyframes))
|
|
21
|
+
endPoint = NodeProperty(provider: KeyframeInterpolator(keyframes: gradientStroke.endPoint.keyframes))
|
|
22
|
+
colors = NodeProperty(provider: KeyframeInterpolator(keyframes: gradientStroke.colors.keyframes))
|
|
23
|
+
gradientType = gradientStroke.gradientType
|
|
24
|
+
numberOfColors = gradientStroke.numberOfColors
|
|
25
|
+
width = NodeProperty(provider: KeyframeInterpolator(keyframes: gradientStroke.width.keyframes))
|
|
26
|
+
miterLimit = CGFloat(gradientStroke.miterLimit)
|
|
27
|
+
lineCap = gradientStroke.lineCap
|
|
28
|
+
lineJoin = gradientStroke.lineJoin
|
|
29
|
+
|
|
30
|
+
if let dashes = gradientStroke.dashPattern {
|
|
31
|
+
var dashPatterns = ContiguousArray<ContiguousArray<Keyframe<LottieVector1D>>>()
|
|
32
|
+
var dashPhase = ContiguousArray<Keyframe<LottieVector1D>>()
|
|
33
|
+
for dash in dashes {
|
|
34
|
+
if dash.type == .offset {
|
|
35
|
+
dashPhase = dash.value.keyframes
|
|
36
|
+
} else {
|
|
37
|
+
dashPatterns.append(dash.value.keyframes)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
dashPattern = NodeProperty(provider: GroupInterpolator(keyframeGroups: dashPatterns))
|
|
41
|
+
self.dashPhase = NodeProperty(provider: KeyframeInterpolator(keyframes: dashPhase))
|
|
42
|
+
} else {
|
|
43
|
+
dashPattern = NodeProperty(provider: SingleValueProvider([LottieVector1D]()))
|
|
44
|
+
dashPhase = NodeProperty(provider: SingleValueProvider(LottieVector1D(0)))
|
|
45
|
+
}
|
|
46
|
+
keypathProperties = [
|
|
47
|
+
PropertyName.opacity.rawValue: opacity,
|
|
48
|
+
"Start Point": startPoint,
|
|
49
|
+
"End Point": endPoint,
|
|
50
|
+
PropertyName.gradientColors.rawValue: colors,
|
|
51
|
+
PropertyName.strokeWidth.rawValue: width,
|
|
52
|
+
"Dashes": dashPattern,
|
|
53
|
+
"Dash Phase": dashPhase,
|
|
54
|
+
]
|
|
55
|
+
properties = Array(keypathProperties.values)
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// MARK: Internal
|
|
59
|
+
|
|
60
|
+
var keypathName: String
|
|
61
|
+
|
|
62
|
+
let opacity: NodeProperty<LottieVector1D>
|
|
63
|
+
let startPoint: NodeProperty<LottieVector3D>
|
|
64
|
+
let endPoint: NodeProperty<LottieVector3D>
|
|
65
|
+
let colors: NodeProperty<[Double]>
|
|
66
|
+
let width: NodeProperty<LottieVector1D>
|
|
67
|
+
|
|
68
|
+
let dashPattern: NodeProperty<[LottieVector1D]>
|
|
69
|
+
let dashPhase: NodeProperty<LottieVector1D>
|
|
70
|
+
|
|
71
|
+
let lineCap: LineCap
|
|
72
|
+
let lineJoin: LineJoin
|
|
73
|
+
let miterLimit: CGFloat
|
|
74
|
+
let gradientType: GradientType
|
|
75
|
+
let numberOfColors: Int
|
|
76
|
+
|
|
77
|
+
let keypathProperties: [String: AnyNodeProperty]
|
|
78
|
+
let properties: [AnyNodeProperty]
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// MARK: - GradientStrokeNode
|
|
83
|
+
|
|
84
|
+
final class GradientStrokeNode: AnimatorNode, RenderNode {
|
|
85
|
+
|
|
86
|
+
// MARK: Lifecycle
|
|
87
|
+
|
|
88
|
+
init(parentNode: AnimatorNode?, gradientStroke: GradientStroke) {
|
|
89
|
+
strokeRender = GradientStrokeRenderer(parent: parentNode?.outputNode)
|
|
90
|
+
strokeProperties = GradientStrokeProperties(gradientStroke: gradientStroke)
|
|
91
|
+
self.parentNode = parentNode
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// MARK: Internal
|
|
95
|
+
|
|
96
|
+
let strokeRender: GradientStrokeRenderer
|
|
97
|
+
|
|
98
|
+
let strokeProperties: GradientStrokeProperties
|
|
99
|
+
|
|
100
|
+
let parentNode: AnimatorNode?
|
|
101
|
+
var hasLocalUpdates = false
|
|
102
|
+
var hasUpstreamUpdates = false
|
|
103
|
+
var lastUpdateFrame: CGFloat? = nil
|
|
104
|
+
|
|
105
|
+
var renderer: NodeOutput & Renderable {
|
|
106
|
+
strokeRender
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
var propertyMap: NodePropertyMap & KeypathSearchable {
|
|
110
|
+
strokeProperties
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
var isEnabled = true {
|
|
114
|
+
didSet {
|
|
115
|
+
strokeRender.isEnabled = isEnabled
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
func localUpdatesPermeateDownstream() -> Bool {
|
|
120
|
+
false
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
func rebuildOutputs(frame _: CGFloat) {
|
|
124
|
+
/// Update gradient properties
|
|
125
|
+
strokeRender.gradientRender.start = strokeProperties.startPoint.value.pointValue
|
|
126
|
+
strokeRender.gradientRender.end = strokeProperties.endPoint.value.pointValue
|
|
127
|
+
strokeRender.gradientRender.opacity = strokeProperties.opacity.value.cgFloatValue
|
|
128
|
+
strokeRender.gradientRender.colors = strokeProperties.colors.value.map { CGFloat($0) }
|
|
129
|
+
strokeRender.gradientRender.type = strokeProperties.gradientType
|
|
130
|
+
strokeRender.gradientRender.numberOfColors = strokeProperties.numberOfColors
|
|
131
|
+
|
|
132
|
+
/// Now update stroke properties
|
|
133
|
+
strokeRender.strokeRender.opacity = strokeProperties.opacity.value.cgFloatValue
|
|
134
|
+
strokeRender.strokeRender.width = strokeProperties.width.value.cgFloatValue
|
|
135
|
+
strokeRender.strokeRender.miterLimit = strokeProperties.miterLimit
|
|
136
|
+
strokeRender.strokeRender.lineCap = strokeProperties.lineCap
|
|
137
|
+
strokeRender.strokeRender.lineJoin = strokeProperties.lineJoin
|
|
138
|
+
|
|
139
|
+
/// Get dash lengths
|
|
140
|
+
let dashLengths = strokeProperties.dashPattern.value.map { $0.cgFloatValue }
|
|
141
|
+
if dashLengths.count > 0, dashLengths.isSupportedLayerDashPattern {
|
|
142
|
+
strokeRender.strokeRender.dashPhase = strokeProperties.dashPhase.value.cgFloatValue
|
|
143
|
+
strokeRender.strokeRender.dashLengths = dashLengths
|
|
144
|
+
} else {
|
|
145
|
+
strokeRender.strokeRender.dashLengths = nil
|
|
146
|
+
strokeRender.strokeRender.dashPhase = nil
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
//
|
|
2
|
+
// StrokeNode.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/22/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import QuartzCore
|
|
10
|
+
|
|
11
|
+
// MARK: - StrokeNodeProperties
|
|
12
|
+
|
|
13
|
+
final class StrokeNodeProperties: NodePropertyMap, KeypathSearchable {
|
|
14
|
+
|
|
15
|
+
// MARK: Lifecycle
|
|
16
|
+
|
|
17
|
+
init(stroke: Stroke) {
|
|
18
|
+
keypathName = stroke.name
|
|
19
|
+
color = NodeProperty(provider: KeyframeInterpolator(keyframes: stroke.color.keyframes))
|
|
20
|
+
opacity = NodeProperty(provider: KeyframeInterpolator(keyframes: stroke.opacity.keyframes))
|
|
21
|
+
width = NodeProperty(provider: KeyframeInterpolator(keyframes: stroke.width.keyframes))
|
|
22
|
+
miterLimit = CGFloat(stroke.miterLimit)
|
|
23
|
+
lineCap = stroke.lineCap
|
|
24
|
+
lineJoin = stroke.lineJoin
|
|
25
|
+
|
|
26
|
+
if let dashes = stroke.dashPattern {
|
|
27
|
+
let (dashPatterns, dashPhase) = dashes.shapeLayerConfiguration
|
|
28
|
+
dashPattern = NodeProperty(provider: GroupInterpolator(keyframeGroups: dashPatterns))
|
|
29
|
+
if dashPhase.count == 0 {
|
|
30
|
+
self.dashPhase = NodeProperty(provider: SingleValueProvider(LottieVector1D(0)))
|
|
31
|
+
} else {
|
|
32
|
+
self.dashPhase = NodeProperty(provider: KeyframeInterpolator(keyframes: dashPhase))
|
|
33
|
+
}
|
|
34
|
+
} else {
|
|
35
|
+
dashPattern = NodeProperty(provider: SingleValueProvider([LottieVector1D]()))
|
|
36
|
+
dashPhase = NodeProperty(provider: SingleValueProvider(LottieVector1D(0)))
|
|
37
|
+
}
|
|
38
|
+
keypathProperties = [
|
|
39
|
+
PropertyName.opacity.rawValue: opacity,
|
|
40
|
+
PropertyName.color.rawValue: color,
|
|
41
|
+
PropertyName.strokeWidth.rawValue: width,
|
|
42
|
+
"Dashes": dashPattern,
|
|
43
|
+
"Dash Phase": dashPhase,
|
|
44
|
+
]
|
|
45
|
+
properties = Array(keypathProperties.values)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// MARK: Internal
|
|
49
|
+
|
|
50
|
+
let keypathName: String
|
|
51
|
+
let keypathProperties: [String: AnyNodeProperty]
|
|
52
|
+
let properties: [AnyNodeProperty]
|
|
53
|
+
|
|
54
|
+
let opacity: NodeProperty<LottieVector1D>
|
|
55
|
+
let color: NodeProperty<LottieColor>
|
|
56
|
+
let width: NodeProperty<LottieVector1D>
|
|
57
|
+
|
|
58
|
+
let dashPattern: NodeProperty<[LottieVector1D]>
|
|
59
|
+
let dashPhase: NodeProperty<LottieVector1D>
|
|
60
|
+
|
|
61
|
+
let lineCap: LineCap
|
|
62
|
+
let lineJoin: LineJoin
|
|
63
|
+
let miterLimit: CGFloat
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// MARK: - StrokeNode
|
|
68
|
+
|
|
69
|
+
/// Node that manages stroking a path
|
|
70
|
+
final class StrokeNode: AnimatorNode, RenderNode {
|
|
71
|
+
|
|
72
|
+
// MARK: Lifecycle
|
|
73
|
+
|
|
74
|
+
init(parentNode: AnimatorNode?, stroke: Stroke) {
|
|
75
|
+
strokeRender = StrokeRenderer(parent: parentNode?.outputNode)
|
|
76
|
+
strokeProperties = StrokeNodeProperties(stroke: stroke)
|
|
77
|
+
self.parentNode = parentNode
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// MARK: Internal
|
|
81
|
+
|
|
82
|
+
let strokeRender: StrokeRenderer
|
|
83
|
+
|
|
84
|
+
let strokeProperties: StrokeNodeProperties
|
|
85
|
+
|
|
86
|
+
let parentNode: AnimatorNode?
|
|
87
|
+
var hasLocalUpdates = false
|
|
88
|
+
var hasUpstreamUpdates = false
|
|
89
|
+
var lastUpdateFrame: CGFloat? = nil
|
|
90
|
+
|
|
91
|
+
var renderer: NodeOutput & Renderable {
|
|
92
|
+
strokeRender
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
var propertyMap: NodePropertyMap & KeypathSearchable {
|
|
96
|
+
strokeProperties
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
var isEnabled = true {
|
|
100
|
+
didSet {
|
|
101
|
+
strokeRender.isEnabled = isEnabled
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
func localUpdatesPermeateDownstream() -> Bool {
|
|
106
|
+
false
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
func rebuildOutputs(frame _: CGFloat) {
|
|
110
|
+
strokeRender.color = strokeProperties.color.value.cgColorValue
|
|
111
|
+
strokeRender.opacity = strokeProperties.opacity.value.cgFloatValue * 0.01
|
|
112
|
+
strokeRender.width = strokeProperties.width.value.cgFloatValue
|
|
113
|
+
strokeRender.miterLimit = strokeProperties.miterLimit
|
|
114
|
+
strokeRender.lineCap = strokeProperties.lineCap
|
|
115
|
+
strokeRender.lineJoin = strokeProperties.lineJoin
|
|
116
|
+
|
|
117
|
+
/// Get dash lengths
|
|
118
|
+
let dashLengths = strokeProperties.dashPattern.value.map { $0.cgFloatValue }
|
|
119
|
+
if dashLengths.count > 0, dashLengths.isSupportedLayerDashPattern {
|
|
120
|
+
strokeRender.dashPhase = strokeProperties.dashPhase.value.cgFloatValue
|
|
121
|
+
strokeRender.dashLengths = dashLengths
|
|
122
|
+
} else {
|
|
123
|
+
strokeRender.dashLengths = nil
|
|
124
|
+
strokeRender.dashPhase = nil
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// MARK: - [DashElement] + shapeLayerConfiguration
|
|
131
|
+
|
|
132
|
+
extension [DashElement] {
|
|
133
|
+
typealias ShapeLayerConfiguration = (
|
|
134
|
+
dashPatterns: ContiguousArray<ContiguousArray<Keyframe<LottieVector1D>>>,
|
|
135
|
+
dashPhase: ContiguousArray<Keyframe<LottieVector1D>>
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
/// Converts the `[DashElement]` data model into `lineDashPattern` and `lineDashPhase`
|
|
139
|
+
/// representations usable in a `CAShapeLayer`
|
|
140
|
+
var shapeLayerConfiguration: ShapeLayerConfiguration {
|
|
141
|
+
var dashPatterns = ContiguousArray<ContiguousArray<Keyframe<LottieVector1D>>>()
|
|
142
|
+
var dashPhase = ContiguousArray<Keyframe<LottieVector1D>>()
|
|
143
|
+
for dash in self {
|
|
144
|
+
if dash.type == .offset {
|
|
145
|
+
dashPhase = dash.value.keyframes
|
|
146
|
+
} else {
|
|
147
|
+
dashPatterns.append(dash.value.keyframes)
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
dashPatterns = ContiguousArray(dashPatterns.map { pattern in
|
|
152
|
+
ContiguousArray(pattern.map { keyframe -> Keyframe<LottieVector1D> in
|
|
153
|
+
// The recommended way to create a stroke of round dots, in theory,
|
|
154
|
+
// is to use a value of 0 followed by the stroke width, but for
|
|
155
|
+
// some reason Core Animation incorrectly (?) renders these as pills
|
|
156
|
+
// instead of circles. As a workaround, for parity with Lottie on other
|
|
157
|
+
// platforms, we can change `0`s to `0.01`: https://stackoverflow.com/a/38036486
|
|
158
|
+
if keyframe.value.cgFloatValue == 0 {
|
|
159
|
+
return keyframe.withValue(LottieVector1D(0.01))
|
|
160
|
+
} else {
|
|
161
|
+
return keyframe
|
|
162
|
+
}
|
|
163
|
+
})
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
return (dashPatterns, dashPhase)
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
extension [CGFloat] {
|
|
171
|
+
/// If all of the items in the dash pattern are zeros, then we shouldn't attempt to render it.
|
|
172
|
+
/// This causes Core Animation to have extremely poor performance for some reason, even though
|
|
173
|
+
/// it doesn't affect the appearance of the animation.
|
|
174
|
+
/// - We check for `== 0.01` instead of `== 0` because `dashPattern.shapeLayerConfiguration`
|
|
175
|
+
/// converts all `0` values to `0.01` to work around a different Core Animation rendering issue.
|
|
176
|
+
var isSupportedLayerDashPattern: Bool {
|
|
177
|
+
!allSatisfy { $0 == 0.01 }
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
//
|
|
2
|
+
// TextAnimatorNode.swift
|
|
3
|
+
// lottie-ios-iOS
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 2/19/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import QuartzCore
|
|
9
|
+
|
|
10
|
+
// MARK: - TextAnimatorNodeProperties
|
|
11
|
+
|
|
12
|
+
final class TextAnimatorNodeProperties: NodePropertyMap, KeypathSearchable {
|
|
13
|
+
|
|
14
|
+
// MARK: Lifecycle
|
|
15
|
+
|
|
16
|
+
init(textAnimator: TextAnimator) {
|
|
17
|
+
keypathName = textAnimator.name
|
|
18
|
+
textRangeUnit = textAnimator.textRangeUnit
|
|
19
|
+
var properties = [String: AnyNodeProperty]()
|
|
20
|
+
|
|
21
|
+
if let keyframeGroup = textAnimator.anchor {
|
|
22
|
+
anchor = NodeProperty(provider: KeyframeInterpolator(keyframes: keyframeGroup.keyframes))
|
|
23
|
+
properties["Anchor"] = anchor
|
|
24
|
+
} else {
|
|
25
|
+
anchor = nil
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if let keyframeGroup = textAnimator.position {
|
|
29
|
+
position = NodeProperty(provider: KeyframeInterpolator(keyframes: keyframeGroup.keyframes))
|
|
30
|
+
properties[PropertyName.position.rawValue] = position
|
|
31
|
+
} else {
|
|
32
|
+
position = nil
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if let keyframeGroup = textAnimator.scale {
|
|
36
|
+
scale = NodeProperty(provider: KeyframeInterpolator(keyframes: keyframeGroup.keyframes))
|
|
37
|
+
properties[PropertyName.scale.rawValue] = scale
|
|
38
|
+
} else {
|
|
39
|
+
scale = nil
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if let keyframeGroup = textAnimator.skew {
|
|
43
|
+
skew = NodeProperty(provider: KeyframeInterpolator(keyframes: keyframeGroup.keyframes))
|
|
44
|
+
properties["Skew"] = skew
|
|
45
|
+
} else {
|
|
46
|
+
skew = nil
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if let keyframeGroup = textAnimator.skewAxis {
|
|
50
|
+
skewAxis = NodeProperty(provider: KeyframeInterpolator(keyframes: keyframeGroup.keyframes))
|
|
51
|
+
properties["Skew Axis"] = skewAxis
|
|
52
|
+
} else {
|
|
53
|
+
skewAxis = nil
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if let keyframeGroup = textAnimator.rotationX {
|
|
57
|
+
rotationX = NodeProperty(provider: KeyframeInterpolator(keyframes: keyframeGroup.keyframes))
|
|
58
|
+
properties["Rotation X"] = rotationX
|
|
59
|
+
} else {
|
|
60
|
+
rotationX = nil
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if let keyframeGroup = textAnimator.rotationY {
|
|
64
|
+
rotationY = NodeProperty(provider: KeyframeInterpolator(keyframes: keyframeGroup.keyframes))
|
|
65
|
+
properties["Rotation Y"] = rotationY
|
|
66
|
+
} else {
|
|
67
|
+
rotationY = nil
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if let keyframeGroup = textAnimator.rotationZ {
|
|
71
|
+
rotationZ = NodeProperty(provider: KeyframeInterpolator(keyframes: keyframeGroup.keyframes))
|
|
72
|
+
properties["Rotation Z"] = rotationZ
|
|
73
|
+
properties[PropertyName.rotation.rawValue] = rotationZ
|
|
74
|
+
} else {
|
|
75
|
+
rotationZ = nil
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if let keyframeGroup = textAnimator.opacity {
|
|
79
|
+
opacity = NodeProperty(provider: KeyframeInterpolator(keyframes: keyframeGroup.keyframes))
|
|
80
|
+
properties[PropertyName.opacity.rawValue] = opacity
|
|
81
|
+
} else {
|
|
82
|
+
opacity = nil
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if let keyframeGroup = textAnimator.strokeColor {
|
|
86
|
+
strokeColor = NodeProperty(provider: KeyframeInterpolator(keyframes: keyframeGroup.keyframes))
|
|
87
|
+
properties["Stroke Color"] = strokeColor
|
|
88
|
+
} else {
|
|
89
|
+
strokeColor = nil
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if let keyframeGroup = textAnimator.fillColor {
|
|
93
|
+
fillColor = NodeProperty(provider: KeyframeInterpolator(keyframes: keyframeGroup.keyframes))
|
|
94
|
+
properties["Fill Color"] = fillColor
|
|
95
|
+
} else {
|
|
96
|
+
fillColor = nil
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if let keyframeGroup = textAnimator.strokeWidth {
|
|
100
|
+
strokeWidth = NodeProperty(provider: KeyframeInterpolator(keyframes: keyframeGroup.keyframes))
|
|
101
|
+
properties[PropertyName.strokeWidth.rawValue] = strokeWidth
|
|
102
|
+
} else {
|
|
103
|
+
strokeWidth = nil
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if let keyframeGroup = textAnimator.tracking {
|
|
107
|
+
tracking = NodeProperty(provider: KeyframeInterpolator(keyframes: keyframeGroup.keyframes))
|
|
108
|
+
properties["Tracking"] = tracking
|
|
109
|
+
} else {
|
|
110
|
+
tracking = nil
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if let startKeyframes = textAnimator.start {
|
|
114
|
+
start = NodeProperty(provider: KeyframeInterpolator(keyframes: startKeyframes.keyframes))
|
|
115
|
+
properties["Start"] = start
|
|
116
|
+
} else {
|
|
117
|
+
start = nil
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if let endKeyframes = textAnimator.end {
|
|
121
|
+
end = NodeProperty(provider: KeyframeInterpolator(keyframes: endKeyframes.keyframes))
|
|
122
|
+
properties["End"] = end
|
|
123
|
+
} else {
|
|
124
|
+
end = nil
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if let selectedRangeOpacityKeyframes = textAnimator.opacity {
|
|
128
|
+
selectedRangeOpacity = NodeProperty(provider: KeyframeInterpolator(keyframes: selectedRangeOpacityKeyframes.keyframes))
|
|
129
|
+
properties["SelectedRangeOpacity"] = selectedRangeOpacity
|
|
130
|
+
} else {
|
|
131
|
+
selectedRangeOpacity = nil
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
keypathProperties = properties
|
|
135
|
+
|
|
136
|
+
self.properties = Array(keypathProperties.values)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// MARK: Internal
|
|
140
|
+
|
|
141
|
+
let keypathName: String
|
|
142
|
+
|
|
143
|
+
let anchor: NodeProperty<LottieVector3D>?
|
|
144
|
+
let position: NodeProperty<LottieVector3D>?
|
|
145
|
+
let scale: NodeProperty<LottieVector3D>?
|
|
146
|
+
let skew: NodeProperty<LottieVector1D>?
|
|
147
|
+
let skewAxis: NodeProperty<LottieVector1D>?
|
|
148
|
+
let rotationX: NodeProperty<LottieVector1D>?
|
|
149
|
+
let rotationY: NodeProperty<LottieVector1D>?
|
|
150
|
+
let rotationZ: NodeProperty<LottieVector1D>?
|
|
151
|
+
let opacity: NodeProperty<LottieVector1D>?
|
|
152
|
+
let strokeColor: NodeProperty<LottieColor>?
|
|
153
|
+
let fillColor: NodeProperty<LottieColor>?
|
|
154
|
+
let strokeWidth: NodeProperty<LottieVector1D>?
|
|
155
|
+
let tracking: NodeProperty<LottieVector1D>?
|
|
156
|
+
let start: NodeProperty<LottieVector1D>?
|
|
157
|
+
let end: NodeProperty<LottieVector1D>?
|
|
158
|
+
let selectedRangeOpacity: NodeProperty<LottieVector1D>?
|
|
159
|
+
let textRangeUnit: TextRangeUnit?
|
|
160
|
+
|
|
161
|
+
let keypathProperties: [String: AnyNodeProperty]
|
|
162
|
+
let properties: [AnyNodeProperty]
|
|
163
|
+
|
|
164
|
+
var caTransform: CATransform3D {
|
|
165
|
+
CATransform3D.makeTransform(
|
|
166
|
+
anchor: anchor?.value.pointValue ?? .zero,
|
|
167
|
+
position: position?.value.pointValue ?? .zero,
|
|
168
|
+
scale: scale?.value.sizeValue ?? CGSize(width: 100, height: 100),
|
|
169
|
+
rotationX: rotationX?.value.cgFloatValue ?? 0,
|
|
170
|
+
rotationY: rotationY?.value.cgFloatValue ?? 0,
|
|
171
|
+
rotationZ: rotationZ?.value.cgFloatValue ?? 0,
|
|
172
|
+
skew: skew?.value.cgFloatValue,
|
|
173
|
+
skewAxis: skewAxis?.value.cgFloatValue
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// MARK: - TextOutputNode
|
|
179
|
+
|
|
180
|
+
final class TextOutputNode: NodeOutput {
|
|
181
|
+
|
|
182
|
+
// MARK: Lifecycle
|
|
183
|
+
|
|
184
|
+
init(parent: TextOutputNode?) {
|
|
185
|
+
parentTextNode = parent
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// MARK: Internal
|
|
189
|
+
|
|
190
|
+
var parentTextNode: TextOutputNode?
|
|
191
|
+
var isEnabled = true
|
|
192
|
+
|
|
193
|
+
var outputPath: CGPath?
|
|
194
|
+
|
|
195
|
+
var parent: NodeOutput? {
|
|
196
|
+
parentTextNode
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
var xform: CATransform3D {
|
|
200
|
+
get {
|
|
201
|
+
_xform ?? parentTextNode?.xform ?? CATransform3DIdentity
|
|
202
|
+
}
|
|
203
|
+
set {
|
|
204
|
+
_xform = newValue
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
var opacity: CGFloat {
|
|
209
|
+
get {
|
|
210
|
+
_opacity ?? parentTextNode?.opacity ?? 1
|
|
211
|
+
}
|
|
212
|
+
set {
|
|
213
|
+
_opacity = newValue
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
var strokeColor: CGColor? {
|
|
218
|
+
get {
|
|
219
|
+
_strokeColor ?? parentTextNode?.strokeColor
|
|
220
|
+
}
|
|
221
|
+
set {
|
|
222
|
+
_strokeColor = newValue
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
var fillColor: CGColor? {
|
|
227
|
+
get {
|
|
228
|
+
_fillColor ?? parentTextNode?.fillColor
|
|
229
|
+
}
|
|
230
|
+
set {
|
|
231
|
+
_fillColor = newValue
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
var tracking: CGFloat {
|
|
236
|
+
get {
|
|
237
|
+
_tracking ?? parentTextNode?.tracking ?? 0
|
|
238
|
+
}
|
|
239
|
+
set {
|
|
240
|
+
_tracking = newValue
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
var strokeWidth: CGFloat {
|
|
245
|
+
get {
|
|
246
|
+
_strokeWidth ?? parentTextNode?.strokeWidth ?? 0
|
|
247
|
+
}
|
|
248
|
+
set {
|
|
249
|
+
_strokeWidth = newValue
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
var start: CGFloat? {
|
|
254
|
+
get {
|
|
255
|
+
_start
|
|
256
|
+
}
|
|
257
|
+
set {
|
|
258
|
+
_start = newValue
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
var end: CGFloat? {
|
|
263
|
+
get {
|
|
264
|
+
_end
|
|
265
|
+
}
|
|
266
|
+
set {
|
|
267
|
+
_end = newValue
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
var selectedRangeOpacity: CGFloat? {
|
|
272
|
+
get {
|
|
273
|
+
_selectedRangeOpacity
|
|
274
|
+
}
|
|
275
|
+
set {
|
|
276
|
+
_selectedRangeOpacity = newValue
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
func hasOutputUpdates(_: CGFloat) -> Bool {
|
|
281
|
+
// TODO Fix This
|
|
282
|
+
true
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// MARK: Fileprivate
|
|
286
|
+
|
|
287
|
+
fileprivate var _xform: CATransform3D?
|
|
288
|
+
fileprivate var _opacity: CGFloat?
|
|
289
|
+
fileprivate var _strokeColor: CGColor?
|
|
290
|
+
fileprivate var _fillColor: CGColor?
|
|
291
|
+
fileprivate var _tracking: CGFloat?
|
|
292
|
+
fileprivate var _strokeWidth: CGFloat?
|
|
293
|
+
fileprivate var _start: CGFloat?
|
|
294
|
+
fileprivate var _end: CGFloat?
|
|
295
|
+
fileprivate var _selectedRangeOpacity: CGFloat?
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
// MARK: - TextAnimatorNode
|
|
299
|
+
|
|
300
|
+
final class TextAnimatorNode: AnimatorNode {
|
|
301
|
+
|
|
302
|
+
// MARK: Lifecycle
|
|
303
|
+
|
|
304
|
+
init(parentNode: TextAnimatorNode?, textAnimator: TextAnimator) {
|
|
305
|
+
textOutputNode = TextOutputNode(parent: parentNode?.textOutputNode)
|
|
306
|
+
textAnimatorProperties = TextAnimatorNodeProperties(textAnimator: textAnimator)
|
|
307
|
+
self.parentNode = parentNode
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// MARK: Internal
|
|
311
|
+
|
|
312
|
+
let textOutputNode: TextOutputNode
|
|
313
|
+
|
|
314
|
+
let textAnimatorProperties: TextAnimatorNodeProperties
|
|
315
|
+
|
|
316
|
+
let parentNode: AnimatorNode?
|
|
317
|
+
var hasLocalUpdates = false
|
|
318
|
+
var hasUpstreamUpdates = false
|
|
319
|
+
var lastUpdateFrame: CGFloat? = nil
|
|
320
|
+
var isEnabled = true
|
|
321
|
+
|
|
322
|
+
var outputNode: NodeOutput {
|
|
323
|
+
textOutputNode
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
var propertyMap: NodePropertyMap & KeypathSearchable {
|
|
327
|
+
textAnimatorProperties
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
func localUpdatesPermeateDownstream() -> Bool {
|
|
331
|
+
true
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
func rebuildOutputs(frame _: CGFloat) {
|
|
335
|
+
textOutputNode.xform = textAnimatorProperties.caTransform
|
|
336
|
+
textOutputNode.opacity = 1.0
|
|
337
|
+
textOutputNode.strokeColor = textAnimatorProperties.strokeColor?.value.cgColorValue
|
|
338
|
+
textOutputNode.fillColor = textAnimatorProperties.fillColor?.value.cgColorValue
|
|
339
|
+
textOutputNode.tracking = textAnimatorProperties.tracking?.value.cgFloatValue ?? 1
|
|
340
|
+
textOutputNode.strokeWidth = textAnimatorProperties.strokeWidth?.value.cgFloatValue ?? 0
|
|
341
|
+
textOutputNode.start = textAnimatorProperties.start?.value.cgFloatValue
|
|
342
|
+
textOutputNode.end = textAnimatorProperties.end?.value.cgFloatValue
|
|
343
|
+
textOutputNode.selectedRangeOpacity = (textAnimatorProperties.opacity?.value.cgFloatValue).flatMap { $0 * 0.01 }
|
|
344
|
+
}
|
|
345
|
+
}
|