@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
package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/AnimationKeypathExtension.swift
ADDED
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
//
|
|
2
|
+
// KeypathSearchableExtension.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 2/4/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import QuartzCore
|
|
9
|
+
|
|
10
|
+
extension KeypathSearchable {
|
|
11
|
+
|
|
12
|
+
func animatorNodes(for keyPath: AnimationKeypath) -> [AnimatorNode]? {
|
|
13
|
+
// Make sure there is a current key path.
|
|
14
|
+
guard let currentKey = keyPath.currentKey else { return nil }
|
|
15
|
+
|
|
16
|
+
// Now try popping the keypath for wildcard / child search
|
|
17
|
+
guard let nextKeypath = keyPath.popKey(keypathName) else {
|
|
18
|
+
// We may be on the final keypath. Check for match.
|
|
19
|
+
if
|
|
20
|
+
let node = self as? AnimatorNode,
|
|
21
|
+
currentKey.equalsKeypath(keypathName)
|
|
22
|
+
{
|
|
23
|
+
// This is the final keypath and matches self. Return.s
|
|
24
|
+
return [node]
|
|
25
|
+
}
|
|
26
|
+
/// Nope. Stop Search
|
|
27
|
+
return nil
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
var results = [AnimatorNode]()
|
|
31
|
+
|
|
32
|
+
if
|
|
33
|
+
let node = self as? AnimatorNode,
|
|
34
|
+
nextKeypath.currentKey == nil
|
|
35
|
+
{
|
|
36
|
+
// Keypath matched self and was the final keypath.
|
|
37
|
+
results.append(node)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
for childNode in childKeypaths {
|
|
41
|
+
// Check if the child has any nodes matching the next keypath.
|
|
42
|
+
if let foundNodes = childNode.animatorNodes(for: nextKeypath) {
|
|
43
|
+
results.append(contentsOf: foundNodes)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// In this case the current key is fuzzy, and both child and self match the next keyname. Keep digging!
|
|
47
|
+
if
|
|
48
|
+
currentKey.keyPathType == .fuzzyWildcard,
|
|
49
|
+
let nextKeypath = keyPath.nextKeypath,
|
|
50
|
+
nextKeypath.equalsKeypath(childNode.keypathName),
|
|
51
|
+
let foundNodes = childNode.animatorNodes(for: keyPath)
|
|
52
|
+
{
|
|
53
|
+
results.append(contentsOf: foundNodes)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
guard results.count > 0 else {
|
|
58
|
+
return nil
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return results
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
func nodeProperties(for keyPath: AnimationKeypath) -> [AnyNodeProperty]? {
|
|
65
|
+
guard let nextKeypath = keyPath.popKey(keypathName) else {
|
|
66
|
+
/// Nope. Stop Search
|
|
67
|
+
return nil
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/// Keypath matches in some way. Continue the search.
|
|
71
|
+
var results = [AnyNodeProperty]()
|
|
72
|
+
|
|
73
|
+
/// Check if we have a property keypath yet
|
|
74
|
+
if
|
|
75
|
+
let propertyKey = nextKeypath.propertyKey,
|
|
76
|
+
let property = keypathProperties[propertyKey]
|
|
77
|
+
{
|
|
78
|
+
/// We found a property!
|
|
79
|
+
results.append(property)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if nextKeypath.nextKeypath != nil {
|
|
83
|
+
/// Now check child keypaths.
|
|
84
|
+
for child in childKeypaths {
|
|
85
|
+
if let childProperties = child.nodeProperties(for: nextKeypath) {
|
|
86
|
+
results.append(contentsOf: childProperties)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
guard results.count > 0 else {
|
|
92
|
+
return nil
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return results
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
func layer(for keyPath: AnimationKeypath) -> CALayer? {
|
|
99
|
+
if keyPath.nextKeypath == nil, let layerKey = keyPath.currentKey, layerKey.equalsKeypath(keypathName) {
|
|
100
|
+
/// We found our layer!
|
|
101
|
+
return keypathLayer
|
|
102
|
+
}
|
|
103
|
+
guard let nextKeypath = keyPath.popKey(keypathName) else {
|
|
104
|
+
/// Nope. Stop Search
|
|
105
|
+
return nil
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/// Now check child keypaths.
|
|
109
|
+
for child in childKeypaths {
|
|
110
|
+
if let layer = child.layer(for: nextKeypath) {
|
|
111
|
+
return layer
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return nil
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/// Searches this layer's keypaths to find the keypath for the given layer
|
|
118
|
+
func keypath(for layer: CALayer) -> AnimationKeypath? {
|
|
119
|
+
let allKeypaths = layerKeypaths()
|
|
120
|
+
return allKeypaths[layer]
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/// Computes the list of animation keypaths that descend from this layer
|
|
124
|
+
func allKeypaths(for keyPath: AnimationKeypath? = nil) -> [String] {
|
|
125
|
+
var allKeypaths = [String]()
|
|
126
|
+
|
|
127
|
+
let newKeypath: AnimationKeypath =
|
|
128
|
+
if let previousKeypath = keyPath {
|
|
129
|
+
previousKeypath.appendingKey(keypathName)
|
|
130
|
+
} else {
|
|
131
|
+
AnimationKeypath(keys: [keypathName])
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
allKeypaths.append(newKeypath.fullPath)
|
|
135
|
+
|
|
136
|
+
for key in keypathProperties.keys {
|
|
137
|
+
allKeypaths.append(newKeypath.appendingKey(key).fullPath)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
for child in childKeypaths {
|
|
141
|
+
allKeypaths.append(contentsOf: child.allKeypaths(for: newKeypath))
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return allKeypaths
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/// Computes the list of animation keypaths that descend from this layer
|
|
148
|
+
func layerKeypaths(for keyPath: AnimationKeypath? = nil) -> [CALayer: AnimationKeypath] {
|
|
149
|
+
var allKeypaths = [CALayer: AnimationKeypath]()
|
|
150
|
+
|
|
151
|
+
let newKeypath: AnimationKeypath =
|
|
152
|
+
if let previousKeypath = keyPath {
|
|
153
|
+
previousKeypath.appendingKey(keypathName)
|
|
154
|
+
} else {
|
|
155
|
+
AnimationKeypath(keys: [keypathName])
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if let layer = self as? CALayer {
|
|
159
|
+
allKeypaths[layer] = newKeypath
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
for child in childKeypaths {
|
|
163
|
+
for (layer, keypath) in child.layerKeypaths(for: newKeypath) {
|
|
164
|
+
allKeypaths[layer] = keypath
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return allKeypaths
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
extension AnimationKeypath {
|
|
173
|
+
var currentKey: String? {
|
|
174
|
+
keys.first
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
var nextKeypath: String? {
|
|
178
|
+
guard keys.count > 1 else {
|
|
179
|
+
return nil
|
|
180
|
+
}
|
|
181
|
+
return keys[1]
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
var propertyKey: String? {
|
|
185
|
+
if nextKeypath == nil {
|
|
186
|
+
/// There are no more keypaths. This is a property key.
|
|
187
|
+
return currentKey
|
|
188
|
+
}
|
|
189
|
+
if keys.count == 2, currentKey?.keyPathType == .fuzzyWildcard {
|
|
190
|
+
/// The next keypath is the last and the current is a fuzzy key.
|
|
191
|
+
return nextKeypath
|
|
192
|
+
}
|
|
193
|
+
return nil
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
var fullPath: String {
|
|
197
|
+
keys.joined(separator: ".")
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/// Pops the top keypath from the stack if the keyname matches.
|
|
201
|
+
func popKey(_ keyname: String) -> AnimationKeypath? {
|
|
202
|
+
guard
|
|
203
|
+
let currentKey,
|
|
204
|
+
currentKey.equalsKeypath(keyname),
|
|
205
|
+
keys.count > 1
|
|
206
|
+
else {
|
|
207
|
+
// Current key either doesnt match or we are on the last key.
|
|
208
|
+
return nil
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Pop the keypath from the stack and return the new stack.
|
|
212
|
+
let newKeys: [String]
|
|
213
|
+
|
|
214
|
+
if currentKey.keyPathType == .fuzzyWildcard {
|
|
215
|
+
/// Dont remove if current key is a fuzzy wildcard, and if the next keypath doesnt equal keypathname
|
|
216
|
+
if
|
|
217
|
+
let nextKeypath,
|
|
218
|
+
nextKeypath.equalsKeypath(keyname)
|
|
219
|
+
{
|
|
220
|
+
/// Remove next two keypaths. This keypath breaks the wildcard.
|
|
221
|
+
var oldKeys = keys
|
|
222
|
+
oldKeys.remove(at: 0)
|
|
223
|
+
oldKeys.remove(at: 0)
|
|
224
|
+
newKeys = oldKeys
|
|
225
|
+
} else {
|
|
226
|
+
newKeys = keys
|
|
227
|
+
}
|
|
228
|
+
} else {
|
|
229
|
+
var oldKeys = keys
|
|
230
|
+
oldKeys.remove(at: 0)
|
|
231
|
+
newKeys = oldKeys
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return AnimationKeypath(keys: newKeys)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
func appendingKey(_ key: String) -> AnimationKeypath {
|
|
238
|
+
var newKeys = keys
|
|
239
|
+
newKeys.append(key)
|
|
240
|
+
return AnimationKeypath(keys: newKeys)
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
extension String {
|
|
245
|
+
var keyPathType: KeyType {
|
|
246
|
+
switch self {
|
|
247
|
+
case "*":
|
|
248
|
+
.wildcard
|
|
249
|
+
case "**":
|
|
250
|
+
.fuzzyWildcard
|
|
251
|
+
default:
|
|
252
|
+
.specific
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
func equalsKeypath(_ keyname: String) -> Bool {
|
|
257
|
+
if keyPathType == .wildcard || keyPathType == .fuzzyWildcard {
|
|
258
|
+
return true
|
|
259
|
+
}
|
|
260
|
+
if self == keyname {
|
|
261
|
+
return true
|
|
262
|
+
}
|
|
263
|
+
if let index = firstIndex(of: "*") {
|
|
264
|
+
// Wildcard search.
|
|
265
|
+
let prefix = String(prefix(upTo: index))
|
|
266
|
+
let suffix = String(suffix(from: self.index(after: index)))
|
|
267
|
+
|
|
268
|
+
if prefix.count > 0 {
|
|
269
|
+
// Match prefix.
|
|
270
|
+
if keyname.count < prefix.count {
|
|
271
|
+
return false
|
|
272
|
+
}
|
|
273
|
+
let testPrefix = String(keyname.prefix(upTo: keyname.index(keyname.startIndex, offsetBy: prefix.count)))
|
|
274
|
+
if testPrefix != prefix {
|
|
275
|
+
// Prefix doesnt match
|
|
276
|
+
return false
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if suffix.count > 0 {
|
|
280
|
+
// Match suffix.
|
|
281
|
+
if keyname.count < suffix.count {
|
|
282
|
+
// Suffix doesnt match
|
|
283
|
+
return false
|
|
284
|
+
}
|
|
285
|
+
let index = keyname.index(keyname.endIndex, offsetBy: -suffix.count)
|
|
286
|
+
let testSuffix = String(keyname.suffix(from: index))
|
|
287
|
+
if testSuffix != suffix {
|
|
288
|
+
return false
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return true
|
|
292
|
+
}
|
|
293
|
+
return false
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// MARK: - KeyType
|
|
298
|
+
|
|
299
|
+
enum KeyType {
|
|
300
|
+
case specific
|
|
301
|
+
case wildcard
|
|
302
|
+
case fuzzyWildcard
|
|
303
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//
|
|
2
|
+
// File.swift
|
|
3
|
+
//
|
|
4
|
+
//
|
|
5
|
+
// Created by Denis Koryttsev on 10.05.2022.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
extension BlendMode {
|
|
9
|
+
/// The Core Image filter name for this `BlendMode`, that can be applied to a `CALayer`'s `compositingFilter`.
|
|
10
|
+
/// Supported compositing filters are defined here: https://developer.apple.com/library/archive/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html#//apple_ref/doc/uid/TP30000136-SW71
|
|
11
|
+
var filterName: String? {
|
|
12
|
+
switch self {
|
|
13
|
+
case .normal: nil
|
|
14
|
+
case .multiply: "multiplyBlendMode"
|
|
15
|
+
case .screen: "screenBlendMode"
|
|
16
|
+
case .overlay: "overlayBlendMode"
|
|
17
|
+
case .darken: "darkenBlendMode"
|
|
18
|
+
case .lighten: "lightenBlendMode"
|
|
19
|
+
case .colorDodge: "colorDodgeBlendMode"
|
|
20
|
+
case .colorBurn: "colorBurnBlendMode"
|
|
21
|
+
case .hardLight: "hardLightBlendMode"
|
|
22
|
+
case .softLight: "softLightBlendMode"
|
|
23
|
+
case .difference: "differenceBlendMode"
|
|
24
|
+
case .exclusion: "exclusionBlendMode"
|
|
25
|
+
case .hue: "hueBlendMode"
|
|
26
|
+
case .saturation: "saturationBlendMode"
|
|
27
|
+
case .color: "colorBlendMode"
|
|
28
|
+
case .luminosity: "luminosityBlendMode"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Created by Cal Stephens on 1/7/22.
|
|
2
|
+
// Copyright © 2022 Airbnb Inc. All rights reserved.
|
|
3
|
+
|
|
4
|
+
import QuartzCore
|
|
5
|
+
|
|
6
|
+
extension CGColor {
|
|
7
|
+
/// Retrieves the red, green, and blue color values from this `CGColor`
|
|
8
|
+
var rgb: (red: CGFloat, green: CGFloat, blue: CGFloat)? {
|
|
9
|
+
guard let components else { return nil }
|
|
10
|
+
|
|
11
|
+
switch numberOfComponents {
|
|
12
|
+
case 2:
|
|
13
|
+
return (red: components[0], green: components[0], blue: components[0])
|
|
14
|
+
|
|
15
|
+
case 3, 4:
|
|
16
|
+
return (red: components[0], green: components[1], blue: components[2])
|
|
17
|
+
|
|
18
|
+
default:
|
|
19
|
+
// Unsupported conversion
|
|
20
|
+
return nil
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/// Initializes a `CGColor` using the given `RGB` values
|
|
25
|
+
static func rgb(_ red: CGFloat, _ green: CGFloat, _ blue: CGFloat) -> CGColor {
|
|
26
|
+
rgba(red, green, blue, 1.0)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/// Initializes a `CGColor` using the given grayscale value
|
|
30
|
+
static func gray(_ gray: CGFloat) -> CGColor {
|
|
31
|
+
CGColor(
|
|
32
|
+
colorSpace: CGColorSpaceCreateDeviceGray(),
|
|
33
|
+
components: [gray, 1.0]
|
|
34
|
+
)!
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/// Initializes a `CGColor` using the given `RGBA` values
|
|
38
|
+
static func rgba(_ red: CGFloat, _ green: CGFloat, _ blue: CGFloat, _ alpha: CGFloat) -> CGColor {
|
|
39
|
+
CGColor(
|
|
40
|
+
colorSpace: LottieConfiguration.shared.colorSpace,
|
|
41
|
+
components: [red, green, blue, alpha]
|
|
42
|
+
)!
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CGFloatExtensions.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/14/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
import QuartzCore
|
|
10
|
+
|
|
11
|
+
extension CGFloat {
|
|
12
|
+
|
|
13
|
+
// MARK: Internal
|
|
14
|
+
|
|
15
|
+
var squared: CGFloat {
|
|
16
|
+
self * self
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
var cubed: CGFloat {
|
|
20
|
+
self * self * self
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var cubicRoot: CGFloat {
|
|
24
|
+
CGFloat(pow(Double(self), 1.0 / 3.0))
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
func isInRangeOrEqual(_ from: CGFloat, _ to: CGFloat) -> Bool {
|
|
28
|
+
from <= self && self <= to
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
func isInRange(_ from: CGFloat, _ to: CGFloat) -> Bool {
|
|
32
|
+
from < self && self < to
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
func cubicBezierInterpolate(_ P0: CGPoint, _ P1: CGPoint, _ P2: CGPoint, _ P3: CGPoint) -> CGFloat {
|
|
36
|
+
var t: CGFloat
|
|
37
|
+
if self == P0.x {
|
|
38
|
+
// Handle corner cases explicitly to prevent rounding errors
|
|
39
|
+
t = 0
|
|
40
|
+
} else if self == P3.x {
|
|
41
|
+
t = 1
|
|
42
|
+
} else {
|
|
43
|
+
// Calculate t
|
|
44
|
+
let a = -P0.x + 3 * P1.x - 3 * P2.x + P3.x
|
|
45
|
+
let b = 3 * P0.x - 6 * P1.x + 3 * P2.x
|
|
46
|
+
let c = -3 * P0.x + 3 * P1.x
|
|
47
|
+
let d = P0.x - self
|
|
48
|
+
let tTemp = CGFloat.SolveCubic(a, b, c, d)
|
|
49
|
+
if tTemp == -1 {
|
|
50
|
+
return -1
|
|
51
|
+
}
|
|
52
|
+
t = tTemp
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Calculate y from t
|
|
56
|
+
return (1 - t).cubed * P0.y + 3 * t * (1 - t).squared * P1.y + 3 * t.squared * (1 - t) * P2.y + t.cubed * P3.y
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
func cubicBezier(_ t: CGFloat, _ c1: CGFloat, _ c2: CGFloat, _ end: CGFloat) -> CGFloat {
|
|
60
|
+
let t_ = (1.0 - t)
|
|
61
|
+
let tt_ = t_ * t_
|
|
62
|
+
let ttt_ = t_ * t_ * t_
|
|
63
|
+
let tt = t * t
|
|
64
|
+
let ttt = t * t * t
|
|
65
|
+
|
|
66
|
+
return self * ttt_
|
|
67
|
+
+ 3.0 * c1 * tt_ * t
|
|
68
|
+
+ 3.0 * c2 * t_ * tt
|
|
69
|
+
+ end * ttt
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// MARK: Fileprivate
|
|
73
|
+
|
|
74
|
+
fileprivate static func SolveQuadratic(_ a: CGFloat, _ b: CGFloat, _ c: CGFloat) -> CGFloat {
|
|
75
|
+
var result = (-b + sqrt(b.squared - 4 * a * c)) / (2 * a)
|
|
76
|
+
guard !result.isInRangeOrEqual(0, 1) else {
|
|
77
|
+
return result
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
result = (-b - sqrt(b.squared - 4 * a * c)) / (2 * a)
|
|
81
|
+
guard !result.isInRangeOrEqual(0, 1) else {
|
|
82
|
+
return result
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return -1
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
fileprivate static func SolveCubic(_ a: CGFloat, _ b: CGFloat, _ c: CGFloat, _ d: CGFloat) -> CGFloat {
|
|
89
|
+
if a == 0 {
|
|
90
|
+
return SolveQuadratic(b, c, d)
|
|
91
|
+
}
|
|
92
|
+
if d == 0 {
|
|
93
|
+
return 0
|
|
94
|
+
}
|
|
95
|
+
let a = a
|
|
96
|
+
var b = b
|
|
97
|
+
var c = c
|
|
98
|
+
var d = d
|
|
99
|
+
b /= a
|
|
100
|
+
c /= a
|
|
101
|
+
d /= a
|
|
102
|
+
var q = (3.0 * c - b.squared) / 9.0
|
|
103
|
+
let r = (-27.0 * d + b * (9.0 * c - 2.0 * b.squared)) / 54.0
|
|
104
|
+
let disc = q.cubed + r.squared
|
|
105
|
+
let term1 = b / 3.0
|
|
106
|
+
|
|
107
|
+
if disc > 0 {
|
|
108
|
+
var s = r + sqrt(disc)
|
|
109
|
+
s = (s < 0) ? -((-s).cubicRoot) : s.cubicRoot
|
|
110
|
+
var t = r - sqrt(disc)
|
|
111
|
+
t = (t < 0) ? -((-t).cubicRoot) : t.cubicRoot
|
|
112
|
+
|
|
113
|
+
let result = -term1 + s + t
|
|
114
|
+
if result.isInRangeOrEqual(0, 1) {
|
|
115
|
+
return result
|
|
116
|
+
}
|
|
117
|
+
} else if disc == 0 {
|
|
118
|
+
let r13 = (r < 0) ? -((-r).cubicRoot) : r.cubicRoot
|
|
119
|
+
|
|
120
|
+
var result = -term1 + 2.0 * r13
|
|
121
|
+
if result.isInRangeOrEqual(0, 1) {
|
|
122
|
+
return result
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
result = -(r13 + term1)
|
|
126
|
+
if result.isInRangeOrEqual(0, 1) {
|
|
127
|
+
return result
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
} else {
|
|
131
|
+
q = -q
|
|
132
|
+
var dum1 = q * q * q
|
|
133
|
+
dum1 = acos(r / sqrt(dum1))
|
|
134
|
+
let r13 = 2.0 * sqrt(q)
|
|
135
|
+
|
|
136
|
+
var result = -term1 + r13 * cos(dum1 / 3.0)
|
|
137
|
+
if result.isInRangeOrEqual(0, 1) {
|
|
138
|
+
return result
|
|
139
|
+
}
|
|
140
|
+
result = -term1 + r13 * cos((dum1 + 2.0 * .pi) / 3.0)
|
|
141
|
+
if result.isInRangeOrEqual(0, 1) {
|
|
142
|
+
return result
|
|
143
|
+
}
|
|
144
|
+
result = -term1 + r13 * cos((dum1 + 4.0 * .pi) / 3.0)
|
|
145
|
+
if result.isInRangeOrEqual(0, 1) {
|
|
146
|
+
return result
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return -1
|
|
151
|
+
}
|
|
152
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// DataExtension.swift
|
|
3
|
+
// Lottie
|
|
4
|
+
//
|
|
5
|
+
// Created by René Fouquet on 03.05.21.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#if canImport(UIKit)
|
|
9
|
+
import UIKit
|
|
10
|
+
#elseif canImport(AppKit)
|
|
11
|
+
import AppKit
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
extension Data {
|
|
15
|
+
|
|
16
|
+
init(assetName: String, in bundle: Bundle) throws {
|
|
17
|
+
#if canImport(UIKit)
|
|
18
|
+
if let asset = NSDataAsset(name: assetName, bundle: bundle) {
|
|
19
|
+
self = asset.data
|
|
20
|
+
return
|
|
21
|
+
} else {
|
|
22
|
+
throw DotLottieError.assetNotFound(name: assetName, bundle: bundle)
|
|
23
|
+
}
|
|
24
|
+
#else
|
|
25
|
+
if let asset = NSDataAsset(name: assetName, bundle: bundle) {
|
|
26
|
+
self = asset.data
|
|
27
|
+
return
|
|
28
|
+
} else {
|
|
29
|
+
throw DotLottieError.assetNotFound(name: assetName, bundle: bundle)
|
|
30
|
+
}
|
|
31
|
+
#endif
|
|
32
|
+
}
|
|
33
|
+
}
|