@octane-xplat/lottie 0.9.0 → 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 +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 +3 -2
- 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,54 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ImageCompositionLayer.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/25/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import QuartzCore
|
|
9
|
+
|
|
10
|
+
final class ImageCompositionLayer: CompositionLayer {
|
|
11
|
+
|
|
12
|
+
// MARK: Lifecycle
|
|
13
|
+
|
|
14
|
+
init(imageLayer: ImageLayerModel, size: CGSize) {
|
|
15
|
+
imageReferenceID = imageLayer.referenceID
|
|
16
|
+
super.init(layer: imageLayer, size: size)
|
|
17
|
+
contentsLayer.masksToBounds = true
|
|
18
|
+
contentsLayer.contentsGravity = CALayerContentsGravity.resize
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
override init(layer: Any) {
|
|
22
|
+
/// Used for creating shadow model layers. Read More here: https://developer.apple.com/documentation/quartzcore/calayer/1410842-init
|
|
23
|
+
guard let layer = layer as? ImageCompositionLayer else {
|
|
24
|
+
fatalError("init(layer:) Wrong Layer Class")
|
|
25
|
+
}
|
|
26
|
+
imageReferenceID = layer.imageReferenceID
|
|
27
|
+
image = nil
|
|
28
|
+
super.init(layer: layer)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
required init?(coder _: NSCoder) {
|
|
32
|
+
fatalError("init(coder:) has not been implemented")
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// MARK: Internal
|
|
36
|
+
|
|
37
|
+
let imageReferenceID: String
|
|
38
|
+
|
|
39
|
+
var image: CGImage? = nil {
|
|
40
|
+
didSet {
|
|
41
|
+
if let image {
|
|
42
|
+
contentsLayer.contents = image
|
|
43
|
+
} else {
|
|
44
|
+
contentsLayer.contents = nil
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var imageContentsGravity = CALayerContentsGravity.resize {
|
|
50
|
+
didSet {
|
|
51
|
+
contentsLayer.contentsGravity = imageContentsGravity
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
//
|
|
2
|
+
// MaskContainerLayer.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/25/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import QuartzCore
|
|
9
|
+
|
|
10
|
+
extension MaskMode {
|
|
11
|
+
var usableMode: MaskMode {
|
|
12
|
+
switch self {
|
|
13
|
+
case .add:
|
|
14
|
+
.add
|
|
15
|
+
case .subtract:
|
|
16
|
+
.subtract
|
|
17
|
+
case .intersect:
|
|
18
|
+
.intersect
|
|
19
|
+
case .lighten:
|
|
20
|
+
.add
|
|
21
|
+
case .darken:
|
|
22
|
+
.darken
|
|
23
|
+
case .difference:
|
|
24
|
+
.intersect
|
|
25
|
+
case .none:
|
|
26
|
+
.none
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// MARK: - MaskContainerLayer
|
|
32
|
+
|
|
33
|
+
final class MaskContainerLayer: CALayer {
|
|
34
|
+
|
|
35
|
+
// MARK: Lifecycle
|
|
36
|
+
|
|
37
|
+
init(masks: [Mask]) {
|
|
38
|
+
super.init()
|
|
39
|
+
anchorPoint = .zero
|
|
40
|
+
var containerLayer = CALayer()
|
|
41
|
+
var firstObject = true
|
|
42
|
+
for mask in masks {
|
|
43
|
+
let maskLayer = MaskLayer(mask: mask)
|
|
44
|
+
maskLayers.append(maskLayer)
|
|
45
|
+
if mask.mode.usableMode == .none {
|
|
46
|
+
continue
|
|
47
|
+
} else if mask.mode.usableMode == .add || firstObject {
|
|
48
|
+
firstObject = false
|
|
49
|
+
containerLayer.addSublayer(maskLayer)
|
|
50
|
+
} else {
|
|
51
|
+
containerLayer.mask = maskLayer
|
|
52
|
+
let newContainer = CALayer()
|
|
53
|
+
newContainer.addSublayer(containerLayer)
|
|
54
|
+
containerLayer = newContainer
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
addSublayer(containerLayer)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
override init(layer: Any) {
|
|
61
|
+
/// Used for creating shadow model layers. Read More here: https://developer.apple.com/documentation/quartzcore/calayer/1410842-init
|
|
62
|
+
guard let layer = layer as? MaskContainerLayer else {
|
|
63
|
+
fatalError("init(layer:) Wrong Layer Class")
|
|
64
|
+
}
|
|
65
|
+
super.init(layer: layer)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
required init?(coder _: NSCoder) {
|
|
69
|
+
fatalError("init(coder:) has not been implemented")
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// MARK: Internal
|
|
73
|
+
|
|
74
|
+
func updateWithFrame(frame: CGFloat, forceUpdates: Bool) {
|
|
75
|
+
for maskLayer in maskLayers {
|
|
76
|
+
maskLayer.updateWithFrame(frame: frame, forceUpdates: forceUpdates)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// MARK: Fileprivate
|
|
81
|
+
|
|
82
|
+
fileprivate var maskLayers = [MaskLayer]()
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
extension CGRect {
|
|
86
|
+
static var veryLargeRect: CGRect {
|
|
87
|
+
CGRect(
|
|
88
|
+
x: -10_000_000,
|
|
89
|
+
y: -10_000_000,
|
|
90
|
+
width: 20_000_000,
|
|
91
|
+
height: 20_000_000
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// MARK: - MaskLayer
|
|
97
|
+
|
|
98
|
+
private final class MaskLayer: CALayer {
|
|
99
|
+
|
|
100
|
+
// MARK: Lifecycle
|
|
101
|
+
|
|
102
|
+
init(mask: Mask) {
|
|
103
|
+
properties = MaskNodeProperties(mask: mask)
|
|
104
|
+
super.init()
|
|
105
|
+
addSublayer(maskLayer)
|
|
106
|
+
anchorPoint = .zero
|
|
107
|
+
maskLayer.fillColor = mask.mode == .add
|
|
108
|
+
? .rgb(1, 0, 0)
|
|
109
|
+
: .rgb(0, 1, 0)
|
|
110
|
+
maskLayer.fillRule = CAShapeLayerFillRule.evenOdd
|
|
111
|
+
actions = [
|
|
112
|
+
"opacity": NSNull()
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
override init(layer: Any) {
|
|
117
|
+
properties = nil
|
|
118
|
+
super.init(layer: layer)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
required init?(coder _: NSCoder) {
|
|
122
|
+
fatalError("init(coder:) has not been implemented")
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// MARK: Internal
|
|
126
|
+
|
|
127
|
+
let properties: MaskNodeProperties?
|
|
128
|
+
|
|
129
|
+
let maskLayer = CAShapeLayer()
|
|
130
|
+
|
|
131
|
+
func updateWithFrame(frame: CGFloat, forceUpdates: Bool) {
|
|
132
|
+
guard let properties else { return }
|
|
133
|
+
if properties.opacity.needsUpdate(frame: frame) || forceUpdates {
|
|
134
|
+
properties.opacity.update(frame: frame)
|
|
135
|
+
opacity = Float(properties.opacity.value.cgFloatValue)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if properties.shape.needsUpdate(frame: frame) || forceUpdates {
|
|
139
|
+
properties.shape.update(frame: frame)
|
|
140
|
+
properties.expansion.update(frame: frame)
|
|
141
|
+
|
|
142
|
+
let shapePath = properties.shape.value.cgPath()
|
|
143
|
+
var path = shapePath
|
|
144
|
+
if
|
|
145
|
+
properties.mode.usableMode == .subtract && !properties.inverted ||
|
|
146
|
+
(properties.mode.usableMode == .add && properties.inverted)
|
|
147
|
+
{
|
|
148
|
+
/// Add a bounds rect to invert the mask
|
|
149
|
+
let newPath = CGMutablePath()
|
|
150
|
+
newPath.addRect(CGRect.veryLargeRect)
|
|
151
|
+
newPath.addPath(shapePath)
|
|
152
|
+
path = newPath
|
|
153
|
+
}
|
|
154
|
+
maskLayer.path = path
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// MARK: - MaskNodeProperties
|
|
160
|
+
|
|
161
|
+
private final class MaskNodeProperties: NodePropertyMap {
|
|
162
|
+
|
|
163
|
+
// MARK: Lifecycle
|
|
164
|
+
|
|
165
|
+
init(mask: Mask) {
|
|
166
|
+
mode = mask.mode
|
|
167
|
+
inverted = mask.inverted
|
|
168
|
+
opacity = NodeProperty(provider: KeyframeInterpolator(keyframes: mask.opacity.keyframes))
|
|
169
|
+
shape = NodeProperty(provider: KeyframeInterpolator(keyframes: mask.shape.keyframes))
|
|
170
|
+
expansion = NodeProperty(provider: KeyframeInterpolator(keyframes: mask.expansion.keyframes))
|
|
171
|
+
propertyMap = [
|
|
172
|
+
PropertyName.opacity.rawValue: opacity,
|
|
173
|
+
"Shape": shape,
|
|
174
|
+
"Expansion": expansion,
|
|
175
|
+
]
|
|
176
|
+
properties = Array(propertyMap.values)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// MARK: Internal
|
|
180
|
+
|
|
181
|
+
var propertyMap: [String: AnyNodeProperty]
|
|
182
|
+
|
|
183
|
+
var properties: [AnyNodeProperty]
|
|
184
|
+
|
|
185
|
+
let mode: MaskMode
|
|
186
|
+
let inverted: Bool
|
|
187
|
+
|
|
188
|
+
let opacity: NodeProperty<LottieVector1D>
|
|
189
|
+
let shape: NodeProperty<BezierPath>
|
|
190
|
+
let expansion: NodeProperty<LottieVector1D>
|
|
191
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// NullCompositionLayer.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/25/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
|
|
10
|
+
final class NullCompositionLayer: CompositionLayer {
|
|
11
|
+
|
|
12
|
+
init(layer: LayerModel) {
|
|
13
|
+
super.init(layer: layer, size: .zero)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
required init?(coder _: NSCoder) {
|
|
17
|
+
fatalError("init(coder:) has not been implemented")
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
override init(layer: Any) {
|
|
21
|
+
/// Used for creating shadow model layers. Read More here: https://developer.apple.com/documentation/quartzcore/calayer/1410842-init
|
|
22
|
+
guard let layer = layer as? NullCompositionLayer else {
|
|
23
|
+
fatalError("init(layer:) Wrong Layer Class")
|
|
24
|
+
}
|
|
25
|
+
super.init(layer: layer)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
//
|
|
2
|
+
// PreCompositionLayer.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/25/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import QuartzCore
|
|
9
|
+
|
|
10
|
+
final class PreCompositionLayer: CompositionLayer {
|
|
11
|
+
|
|
12
|
+
// MARK: Lifecycle
|
|
13
|
+
|
|
14
|
+
init(
|
|
15
|
+
precomp: PreCompLayerModel,
|
|
16
|
+
asset: PrecompAsset,
|
|
17
|
+
layerImageProvider: LayerImageProvider,
|
|
18
|
+
layerTextProvider: LayerTextProvider,
|
|
19
|
+
layerFontProvider: LayerFontProvider,
|
|
20
|
+
textProvider: AnimationKeypathTextProvider,
|
|
21
|
+
fontProvider: AnimationFontProvider,
|
|
22
|
+
assetLibrary: AssetLibrary?,
|
|
23
|
+
frameRate: CGFloat,
|
|
24
|
+
rootAnimationLayer: MainThreadAnimationLayer?
|
|
25
|
+
) {
|
|
26
|
+
animationLayers = []
|
|
27
|
+
if let keyframes = precomp.timeRemapping?.keyframes {
|
|
28
|
+
remappingNode = NodeProperty(provider: KeyframeInterpolator(keyframes: keyframes))
|
|
29
|
+
} else {
|
|
30
|
+
remappingNode = nil
|
|
31
|
+
}
|
|
32
|
+
self.frameRate = frameRate
|
|
33
|
+
super.init(layer: precomp, size: CGSize(width: precomp.width, height: precomp.height))
|
|
34
|
+
bounds = CGRect(origin: .zero, size: CGSize(width: precomp.width, height: precomp.height))
|
|
35
|
+
contentsLayer.masksToBounds = true
|
|
36
|
+
contentsLayer.bounds = bounds
|
|
37
|
+
|
|
38
|
+
let layers = asset.layers.initializeCompositionLayers(
|
|
39
|
+
assetLibrary: assetLibrary,
|
|
40
|
+
layerImageProvider: layerImageProvider,
|
|
41
|
+
layerTextProvider: layerTextProvider,
|
|
42
|
+
layerFontProvider: layerFontProvider,
|
|
43
|
+
textProvider: textProvider,
|
|
44
|
+
fontProvider: fontProvider,
|
|
45
|
+
frameRate: frameRate,
|
|
46
|
+
rootAnimationLayer: rootAnimationLayer
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
var imageLayers = [ImageCompositionLayer]()
|
|
50
|
+
var textLayers = [TextCompositionLayer]()
|
|
51
|
+
|
|
52
|
+
var mattedLayer: CompositionLayer? = nil
|
|
53
|
+
|
|
54
|
+
for layer in layers.reversed() {
|
|
55
|
+
layer.bounds = bounds
|
|
56
|
+
animationLayers.append(layer)
|
|
57
|
+
if let imageLayer = layer as? ImageCompositionLayer {
|
|
58
|
+
imageLayers.append(imageLayer)
|
|
59
|
+
}
|
|
60
|
+
if let textLayer = layer as? TextCompositionLayer {
|
|
61
|
+
textLayers.append(textLayer)
|
|
62
|
+
}
|
|
63
|
+
if let matte = mattedLayer {
|
|
64
|
+
/// The previous layer requires this layer to be its matte
|
|
65
|
+
matte.matteLayer = layer
|
|
66
|
+
mattedLayer = nil
|
|
67
|
+
continue
|
|
68
|
+
}
|
|
69
|
+
if
|
|
70
|
+
let matte = layer.matteType,
|
|
71
|
+
matte == .add || matte == .invert
|
|
72
|
+
{
|
|
73
|
+
/// We have a layer that requires a matte.
|
|
74
|
+
mattedLayer = layer
|
|
75
|
+
}
|
|
76
|
+
contentsLayer.addSublayer(layer)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
childKeypaths.append(contentsOf: layers)
|
|
80
|
+
|
|
81
|
+
layerImageProvider.addImageLayers(imageLayers)
|
|
82
|
+
layerTextProvider.addTextLayers(textLayers)
|
|
83
|
+
layerFontProvider.addTextLayers(textLayers)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
override init(layer: Any) {
|
|
87
|
+
/// Used for creating shadow model layers. Read More here: https://developer.apple.com/documentation/quartzcore/calayer/1410842-init
|
|
88
|
+
guard let layer = layer as? PreCompositionLayer else {
|
|
89
|
+
fatalError("init(layer:) Wrong Layer Class")
|
|
90
|
+
}
|
|
91
|
+
frameRate = layer.frameRate
|
|
92
|
+
remappingNode = nil
|
|
93
|
+
animationLayers = []
|
|
94
|
+
|
|
95
|
+
super.init(layer: layer)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
required init?(coder _: NSCoder) {
|
|
99
|
+
fatalError("init(coder:) has not been implemented")
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// MARK: Internal
|
|
103
|
+
|
|
104
|
+
let frameRate: CGFloat
|
|
105
|
+
let remappingNode: NodeProperty<LottieVector1D>?
|
|
106
|
+
|
|
107
|
+
override var keypathProperties: [String: AnyNodeProperty] {
|
|
108
|
+
guard let remappingNode else {
|
|
109
|
+
return super.keypathProperties
|
|
110
|
+
}
|
|
111
|
+
return ["Time Remap": remappingNode]
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
override func displayContentsWithFrame(frame: CGFloat, forceUpdates: Bool) {
|
|
115
|
+
let localFrame: CGFloat
|
|
116
|
+
if let remappingNode {
|
|
117
|
+
remappingNode.update(frame: frame)
|
|
118
|
+
localFrame = remappingNode.value.cgFloatValue * frameRate
|
|
119
|
+
} else {
|
|
120
|
+
localFrame = (frame - startFrame) / timeStretch
|
|
121
|
+
}
|
|
122
|
+
for animationLayer in animationLayers {
|
|
123
|
+
animationLayer.displayWithFrame(frame: localFrame, forceUpdates: forceUpdates)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
override func updateRenderScale() {
|
|
128
|
+
super.updateRenderScale()
|
|
129
|
+
for animationLayer in animationLayers {
|
|
130
|
+
animationLayer.renderScale = renderScale
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// MARK: Fileprivate
|
|
135
|
+
|
|
136
|
+
fileprivate var animationLayers: [CompositionLayer]
|
|
137
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ShapeLayerContainer.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/22/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import CoreGraphics
|
|
9
|
+
import Foundation
|
|
10
|
+
|
|
11
|
+
/// A CompositionLayer responsible for initializing and rendering shapes
|
|
12
|
+
final class ShapeCompositionLayer: CompositionLayer {
|
|
13
|
+
|
|
14
|
+
// MARK: Lifecycle
|
|
15
|
+
|
|
16
|
+
init(shapeLayer: ShapeLayerModel) {
|
|
17
|
+
let results = shapeLayer.items.initializeNodeTree()
|
|
18
|
+
let renderContainer = ShapeContainerLayer()
|
|
19
|
+
self.renderContainer = renderContainer
|
|
20
|
+
rootNode = results.rootNode
|
|
21
|
+
super.init(layer: shapeLayer, size: .zero)
|
|
22
|
+
contentsLayer.addSublayer(renderContainer)
|
|
23
|
+
for container in results.renderContainers {
|
|
24
|
+
renderContainer.insertRenderLayer(container)
|
|
25
|
+
}
|
|
26
|
+
rootNode?.updateTree(0, forceUpdates: true)
|
|
27
|
+
// Use direct downcasting from `AnimatorNode` to `KeypathSearchable`
|
|
28
|
+
// to avoid calling `_arrayForceCast` for performance reasons
|
|
29
|
+
childKeypaths.append(contentsOf: results.childrenNodes.map { $0 as KeypathSearchable })
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
override init(layer: Any) {
|
|
33
|
+
guard let layer = layer as? ShapeCompositionLayer else {
|
|
34
|
+
fatalError("init(layer:) wrong class.")
|
|
35
|
+
}
|
|
36
|
+
rootNode = nil
|
|
37
|
+
renderContainer = nil
|
|
38
|
+
super.init(layer: layer)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
required init?(coder _: NSCoder) {
|
|
42
|
+
fatalError("init(coder:) has not been implemented")
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// MARK: Internal
|
|
46
|
+
|
|
47
|
+
let rootNode: AnimatorNode?
|
|
48
|
+
let renderContainer: ShapeContainerLayer?
|
|
49
|
+
|
|
50
|
+
override func displayContentsWithFrame(frame: CGFloat, forceUpdates: Bool) {
|
|
51
|
+
rootNode?.updateTree(frame, forceUpdates: forceUpdates)
|
|
52
|
+
renderContainer?.markRenderUpdates(forFrame: frame)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
override func updateRenderScale() {
|
|
56
|
+
super.updateRenderScale()
|
|
57
|
+
renderContainer?.renderScale = renderScale
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//
|
|
2
|
+
// SolidCompositionLayer.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/25/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import QuartzCore
|
|
9
|
+
|
|
10
|
+
final class SolidCompositionLayer: CompositionLayer {
|
|
11
|
+
|
|
12
|
+
// MARK: Lifecycle
|
|
13
|
+
|
|
14
|
+
init(solid: SolidLayerModel) {
|
|
15
|
+
let components = solid.colorHex.hexColorComponents()
|
|
16
|
+
colorProperty =
|
|
17
|
+
NodeProperty(provider: SingleValueProvider(LottieColor(
|
|
18
|
+
r: Double(components.red),
|
|
19
|
+
g: Double(components.green),
|
|
20
|
+
b: Double(components.blue),
|
|
21
|
+
a: 1
|
|
22
|
+
)))
|
|
23
|
+
|
|
24
|
+
super.init(layer: solid, size: .zero)
|
|
25
|
+
solidShape.path = CGPath(rect: CGRect(x: 0, y: 0, width: solid.width, height: solid.height), transform: nil)
|
|
26
|
+
contentsLayer.addSublayer(solidShape)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
override init(layer: Any) {
|
|
30
|
+
/// Used for creating shadow model layers. Read More here: https://developer.apple.com/documentation/quartzcore/calayer/1410842-init
|
|
31
|
+
guard let layer = layer as? SolidCompositionLayer else {
|
|
32
|
+
fatalError("init(layer:) Wrong Layer Class")
|
|
33
|
+
}
|
|
34
|
+
colorProperty = layer.colorProperty
|
|
35
|
+
super.init(layer: layer)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
required init?(coder _: NSCoder) {
|
|
39
|
+
fatalError("init(coder:) has not been implemented")
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// MARK: Internal
|
|
43
|
+
|
|
44
|
+
let colorProperty: NodeProperty<LottieColor>?
|
|
45
|
+
let solidShape = CAShapeLayer()
|
|
46
|
+
|
|
47
|
+
override var keypathProperties: [String: AnyNodeProperty] {
|
|
48
|
+
guard let colorProperty else { return super.keypathProperties }
|
|
49
|
+
return [PropertyName.color.rawValue: colorProperty]
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
override func displayContentsWithFrame(frame: CGFloat, forceUpdates _: Bool) {
|
|
53
|
+
guard let colorProperty else { return }
|
|
54
|
+
colorProperty.update(frame: frame)
|
|
55
|
+
solidShape.fillColor = colorProperty.value.cgColorValue
|
|
56
|
+
}
|
|
57
|
+
}
|