@octane-xplat/lottie 0.0.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -2
- package/dist/native/cx.mobile.js +11 -0
- package/dist/native/escape-props.js +39 -0
- package/dist/native/index.js +183 -0
- package/dist/native/layout-child.js +38 -0
- package/dist/native/octane-client-build.json +8 -0
- package/dist/native/vendor/ui-lottie/index.android.js +286 -0
- package/dist/native/vendor/ui-lottie/index.ios.js +214 -0
- package/dist/native/vendor/ui-lottie/src/lottie/index.common.js +50 -0
- package/dist/native/vendor/ui-lottie/src/lottie/utils.js +6 -0
- package/dist/web/escape-props.web.js +17 -0
- package/dist/web/index.js +346 -0
- package/dist/web/layout-child.web.js +47 -0
- package/dist/web/octane-client-build.json +8 -0
- package/package.json +104 -11
- package/platforms/android/include.gradle +7 -0
- package/platforms/android/java/com/nativescript/lottie/LottieAnimationView.java +92 -0
- package/platforms/android/lottie.aar +0 -0
- package/platforms/android/native-api-usage.json +16 -0
- package/platforms/ios/Podfile +5 -0
- package/platforms/macos/LICENSE-EpoxyCore-Apache-2.0.txt +201 -0
- package/platforms/macos/LICENSE-LRUCache-MIT.txt +22 -0
- package/platforms/macos/LICENSE-Lottie-Apache-2.0.txt +201 -0
- package/platforms/macos/LICENSE-ZIPFoundation-MIT.txt +21 -0
- package/platforms/macos/UPSTREAM.md +13 -0
- package/platforms/macos/resources/PrivacyInfo.xcprivacy +23 -0
- package/platforms/macos/resources/THIRD-PARTY-NOTICES.txt +10 -0
- package/platforms/macos/src/XplatAppKitLottie.swift +246 -0
- package/platforms/macos/src/vendor/Lottie/PrivacyInfo.xcprivacy +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CAAnimation+TimingConfiguration.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CALayer+addAnimation.swift +476 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CombinedShapeAnimation.swift +92 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CustomPathAnimation.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/DropShadowAnimation.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/EllipseAnimation.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/GradientAnimations.swift +287 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/LayerProperty.swift +440 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/OpacityAnimation.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/RectangleAnimation.swift +59 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/ShapeAnimation.swift +246 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/StarAnimation.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/StrokeAnimation.swift +96 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/TransformAnimations.swift +380 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/VisibilityAnimation.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/CompatibilityTracker.swift +129 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/CoreAnimationLayer.swift +645 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/CALayer+fillBounds.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/KeyframeGroup+exactlyOneKeyframe.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/Keyframes+combined.swift +345 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/Keyframes+timeRemapping.swift +46 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/AnimationLayer.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/BaseAnimationLayer.swift +46 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/BaseCompositionLayer.swift +120 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/CALayer+setupLayerHierarchy.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/GradientRenderLayer.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ImageLayer.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/InfiniteOpaqueAnimationLayer.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/LayerModel+makeAnimationLayer.swift +59 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/MaskCompositionLayer.swift +139 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/PreCompLayer.swift +107 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/RepeaterLayer.swift +113 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ShapeItemLayer.swift +346 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ShapeLayer.swift +569 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/SolidLayer.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/TextLayer.swift +157 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/TransformLayer.swift +13 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/ValueProviderStore.swift +157 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/Collection+Diff.swift +267 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/Diffable.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/DiffableSection.swift +16 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/IndexChangeset.swift +187 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/SectionedChangeset.swift +22 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Logging/EpoxyLogger.swift +102 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/CallbackContextEpoxyModeled.swift +8 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelArrayBuilder.swift +48 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelProperty.swift +158 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelStorage.swift +88 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModeled.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/AnyEpoxyModelProperty.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/ClassReference.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/AnimatedProviding.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DataIDProviding.swift +58 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidDisplayProviding.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidEndDisplayingProviding.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidSelectProviding.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ErasedContentProviding.swift +49 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/MakeViewProviding.swift +61 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetBehaviorsProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetContentProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/StyleIDProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/TraitCollectionProviding.swift +14 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewDifferentiatorProviding.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewProviding.swift +13 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/WillDisplayProviding.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/ViewEpoxyModeled.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/README.md +30 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUIIntrinsicContentSizeInvalidator.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUILayoutMargins.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxyableView+SwiftUIView.swift +165 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/MeasuringViewRepresentable.swift +127 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/SwiftUIMeasurementContainer.swift +468 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/SwiftUIView.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIView+SwiftUIView.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIViewConfiguringSwiftUIView.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/BehaviorsConfigurableView.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/ContentConfigurableView.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/EpoxyableView.swift +5 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/StyledView.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/ViewType.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/LRUCache/LRUCache.swift +257 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/LRUCache/README.md +24 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/README.md +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+BackingConfiguration.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Deprecated.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Helpers.swift +361 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+MemoryFile.swift +205 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Progress.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Reading.swift +160 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+ReadingDeprecated.swift +50 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Writing.swift +403 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+WritingDeprecated.swift +95 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+ZIP64.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive.swift +404 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+Compression.swift +632 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+CompressionDeprecated.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+Serialization.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Date+ZIP.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry+Serialization.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry+ZIP64.swift +170 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry.swift +669 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIP.swift +405 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIPDeprecated.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/README.md +24 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/URL+ZIP.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/CompositionLayer.swift +177 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/ImageCompositionLayer.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/MaskContainerLayer.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/NullCompositionLayer.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/PreCompositionLayer.swift +137 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/ShapeCompositionLayer.swift +60 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/SolidCompositionLayer.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/TextCompositionLayer.swift +247 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/MainThreadAnimationLayer.swift +321 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CachedImageProvider.swift +56 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CompositionLayersInitializer.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CoreTextRenderLayer.swift +424 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/InvertedMatteLayer.swift +55 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerFontProvider.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerImageProvider.swift +52 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerTextProvider.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerTransformNode.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Extensions/ItemsExtension.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/NodeProperty.swift +62 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyNodeProperty.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyValueContainer.swift +26 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/KeypathSearchable.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/NodePropertyMap.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueContainer.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueProviders/GroupInterpolator.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueProviders/SingleValueProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/DropShadowNode.swift +102 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/LayerEffectNode.swift +25 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/RoundedCornersNode.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/TrimPathNode.swift +281 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/GroupOutputNode.swift +74 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/PassThroughOutputNode.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/PathOutputNode.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/FillRenderer.swift +69 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientFillRenderer.swift +253 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientStrokeRenderer.swift +64 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/LegacyGradientFillRenderer.swift +158 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/StrokeRenderer.swift +165 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/EllipseNode.swift +143 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/PolygonNode.swift +173 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/RectNode.swift +238 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/ShapeNode.swift +73 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/StarNode.swift +224 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderContainers/GroupNode.swift +162 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/FillNode.swift +88 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientFillNode.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientStrokeNode.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/StrokeNode.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/Text/TextAnimatorNode.swift +345 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/AnimatorNode.swift +197 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/PathNode.swift +20 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/RenderNode.swift +60 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeContainerLayer.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeRenderLayer.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/Asset.swift +51 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/AssetLibrary.swift +75 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/ImageAsset.swift +141 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/PrecompAsset.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DictionaryInitializable.swift +73 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieAnimation.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieImageProvider.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieManifest.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieUtils.swift +71 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Extensions/Bundle.swift +58 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Extensions/KeyedDecodingContainerExtensions.swift +71 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Keyframes/KeyframeData.swift +111 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Keyframes/KeyframeGroup.swift +265 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/DropShadowEffect.swift +52 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/ColorEffectValue.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/EffectValue.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/Vector1DEffectValue.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/LayerEffect.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerStyles/DropShadowStyle.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerStyles/LayerStyle.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/ImageLayerModel.swift +49 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/LayerModel.swift +266 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/PreCompLayerModel.swift +74 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/ShapeLayerModel.swift +50 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/SolidLayerModel.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/TextLayerModel.swift +65 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/DashPattern.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Marker.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Mask.swift +80 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Transform.swift +261 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Ellipse.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Fill.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/GradientFill.swift +142 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/GradientStroke.swift +244 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Group.swift +55 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Merge.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Rectangle.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Repeater.swift +181 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/RoundedCorners.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Shape.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/ShapeItem.swift +171 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/ShapeTransform.swift +202 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Star.swift +136 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Stroke.swift +144 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Trim.swift +90 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/Font.swift +67 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/Glyph.swift +94 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/TextAnimator.swift +240 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/TextDocument.swift +142 -0
- package/platforms/macos/src/vendor/Lottie/Private/RootAnimationLayer.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/AnimatorNodeDebugging.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/LayerDebugging.swift +231 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/TestHelpers.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/AnimationKeypathExtension.swift +303 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/BlendMode+Filter.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/CGColor+RGB.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/CGFloatExtensions.swift +152 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/DataExtension.swift +33 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/MathKit.swift +454 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/StringExtensions.swift +44 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/AnimationContext.swift +95 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/AnyEquatable.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/Binding+Map.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/View+ValueChanged.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/InterpolatableExtensions.swift +143 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/KeyframeExtensions.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/KeyframeInterpolator.swift +250 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/LottieAnimationSource.swift +51 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/BezierPath.swift +509 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/BezierPathRoundExtension.swift +163 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CGPointExtension.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/ColorExtension.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CompoundBezierPath.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CurveVertex.swift +190 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/PathElement.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/UnitBezier.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/VectorsExtensions.swift +368 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimation.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationHelpers.swift +317 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationLayer.swift +1582 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationView.swift +1090 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationViewInitializers.swift +226 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottiePlaybackMode.swift +266 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieView.swift +643 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/AnimationCacheProvider.swift +21 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/DefaultAnimationCache.swift +67 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/LRUAnimationCache.swift +11 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/LottieAnimationCache.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/DecodingStrategy.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/LottieConfiguration.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/LottieURLSession.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/ReducedMotionOption.swift +128 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/RenderingEngineOption.swift +117 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedButton.swift +128 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedControl.swift +248 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedSwitch.swift +271 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieButton.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieSwitch.swift +144 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieViewType.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/Cache/DotLottieCache.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/Cache/DotLottieCacheProvider.swift +21 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieConfiguration.swift +72 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieFile.swift +186 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieFileHelpers.swift +386 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/AnimationKeypath.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/AnyValueProvider.swift +132 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/ColorValueProvider.swift +96 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/FloatValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/GradientValueProvider.swift +138 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/PointValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/SizeValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/FontProvider/AnimationFontProvider.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Public/ImageProvider/AnimationImageProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/Keyframes/Interpolatable.swift +285 -0
- package/platforms/macos/src/vendor/Lottie/Public/Keyframes/Keyframe.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Public/Logging/LottieLogger.swift +138 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/AnimationTime.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/LottieColor.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/Vectors.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Public/TextProvider/AnimationTextProvider.swift +135 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/AnimationSubview.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/BundleImageProvider.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleAnimationKeypath.swift +33 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleAnimationView.swift +567 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleFontProvider.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleImageProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/FilepathImageProvider.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/LottieAnimationViewBase.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/UIColorExtension.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/AnimationSubview.macOS.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/BundleImageProvider.macOS.swift +90 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/FilepathImageProvider.macOS.swift +86 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/LottieAnimationViewBase.macOS.swift +102 -0
- package/src/Lottie.macos.tsrx +129 -0
- package/src/Lottie.tsrx +162 -0
- package/src/Lottie.web.tsrx +152 -0
- package/src/cx.mobile.ts +8 -0
- package/src/escape-props.ts +65 -0
- package/src/escape-props.web.ts +25 -0
- package/src/index.macos.ts +2 -0
- package/src/index.ts +2 -0
- package/src/index.web.ts +2 -0
- package/src/layout-child.ts +57 -0
- package/src/layout-child.web.ts +108 -0
- package/src/native-elements.d.ts +8 -0
- package/src/props.ts +133 -0
- package/src/references.d.ts +3 -0
- package/src/vendor/ui-lottie/LICENSE.md +21 -0
- package/src/vendor/ui-lottie/src/lottie/index.android.ts +447 -0
- package/src/vendor/ui-lottie/src/lottie/index.common.ts +84 -0
- package/src/vendor/ui-lottie/src/lottie/index.d.ts +133 -0
- package/src/vendor/ui-lottie/src/lottie/index.ios.ts +345 -0
- package/src/vendor/ui-lottie/src/lottie/typings/android.d.ts +4149 -0
- package/src/vendor/ui-lottie/src/lottie/typings/android.nativescript.d.ts +12 -0
- package/src/vendor/ui-lottie/src/lottie/typings/dotlottie.ios.d.ts +14 -0
- package/src/vendor/ui-lottie/src/lottie/typings/ios.d.ts +384 -0
- package/src/vendor/ui-lottie/src/lottie/utils.ts +9 -0
- package/types/generated/.tsrx-typegen-manifest.json +18 -0
- package/types/generated/Lottie.d.ts +7 -0
- package/types/generated/Lottie.web.d.ts +7 -0
- package/types/generated/cx.mobile.d.ts +6 -0
- package/types/generated/escape-props.d.ts +15 -0
- package/types/generated/escape-props.web.d.ts +5 -0
- package/types/generated/index.d.ts +2 -0
- package/types/generated/index.web.d.ts +2 -0
- package/types/generated/layout-child.d.ts +6 -0
- package/types/generated/layout-child.web.d.ts +15 -0
- package/types/generated/props.d.ts +110 -0
- package/types/generated/vendor/ui-lottie/src/lottie/index.common.d.ts +30 -0
- package/types/generated/vendor/ui-lottie/src/lottie/index.ios.d.ts +35 -0
- package/types/generated/vendor/ui-lottie/src/lottie/utils.d.ts +1 -0
- package/index.d.ts +0 -1
- package/index.js +0 -2
package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/LayerProperty.swift
ADDED
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
// Created by Cal Stephens on 1/11/22.
|
|
2
|
+
// Copyright © 2022 Airbnb Inc. All rights reserved.
|
|
3
|
+
|
|
4
|
+
import QuartzCore
|
|
5
|
+
|
|
6
|
+
// MARK: - LayerProperty
|
|
7
|
+
|
|
8
|
+
/// A strongly typed value that can be used as the `keyPath` of a `CAAnimation`
|
|
9
|
+
///
|
|
10
|
+
/// Supported key paths and their expected value types are described
|
|
11
|
+
/// at https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreAnimation_guide/AnimatableProperties/AnimatableProperties.html#//apple_ref/doc/uid/TP40004514-CH11-SW1
|
|
12
|
+
/// and https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CoreAnimation_guide/Key-ValueCodingExtensions/Key-ValueCodingExtensions.html
|
|
13
|
+
struct LayerProperty<ValueRepresentation> {
|
|
14
|
+
/// The `CALayer` KVC key path that this value should be assigned to
|
|
15
|
+
let caLayerKeypath: String
|
|
16
|
+
|
|
17
|
+
/// Whether or not the given value is the default value for this property
|
|
18
|
+
/// - If the keyframe values are just equal to the default value,
|
|
19
|
+
/// then we can improve performance a bit by just not creating
|
|
20
|
+
/// a CAAnimation (since it would be redundant).
|
|
21
|
+
let isDefaultValue: (ValueRepresentation?) -> Bool
|
|
22
|
+
|
|
23
|
+
/// A description of how this property can be customized dynamically
|
|
24
|
+
/// at runtime using `AnimationView.setValueProvider(_:keypath:)`
|
|
25
|
+
let customizableProperty: CustomizableProperty<ValueRepresentation>?
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
extension LayerProperty where ValueRepresentation: Equatable {
|
|
29
|
+
/// Initializes a `LayerProperty` that corresponds to a property on `CALayer`
|
|
30
|
+
/// or some other `CALayer` subclass like `CAShapeLayer`.
|
|
31
|
+
/// - Parameters:
|
|
32
|
+
/// - caLayerKeypath: The Objective-C `#keyPath` to the `CALayer` property,
|
|
33
|
+
/// e.g. `#keyPath(CALayer.opacity)` or `#keyPath(CAShapeLayer.path)`.
|
|
34
|
+
/// - defaultValue: The default value of the property (e.g. the value of the
|
|
35
|
+
/// property immediately after calling `CALayer.init()`). Knowing this value
|
|
36
|
+
/// lets us perform some optimizations in `CALayer+addAnimation`.
|
|
37
|
+
/// - customizableProperty: A description of how this property can be customized
|
|
38
|
+
/// dynamically at runtime using `AnimationView.setValueProvider(_:keypath:)`.
|
|
39
|
+
init(
|
|
40
|
+
caLayerKeypath: String,
|
|
41
|
+
defaultValue: ValueRepresentation?,
|
|
42
|
+
customizableProperty: CustomizableProperty<ValueRepresentation>?
|
|
43
|
+
) {
|
|
44
|
+
self.init(
|
|
45
|
+
caLayerKeypath: caLayerKeypath,
|
|
46
|
+
isDefaultValue: { $0 == defaultValue },
|
|
47
|
+
customizableProperty: customizableProperty
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// MARK: - CustomizableProperty
|
|
53
|
+
|
|
54
|
+
/// A description of how a `CALayer` property can be customized dynamically
|
|
55
|
+
/// at runtime using `LottieAnimationView.setValueProvider(_:keypath:)`
|
|
56
|
+
struct CustomizableProperty<ValueRepresentation> {
|
|
57
|
+
/// The name that `AnimationKeypath`s can use to refer to this property
|
|
58
|
+
/// - When building an animation for this property that will be applied
|
|
59
|
+
/// to a specific layer, this `name` is appended to the end of that
|
|
60
|
+
/// layer's `AnimationKeypath`. The combined keypath is used to query
|
|
61
|
+
/// the `ValueProviderStore`.
|
|
62
|
+
let name: [PropertyName]
|
|
63
|
+
|
|
64
|
+
/// A closure that coverts the type-erased value of an `AnyValueProvider`
|
|
65
|
+
/// to the strongly-typed representation used by this property, if possible.
|
|
66
|
+
/// - `value` is the value for the current frame that should be converted,
|
|
67
|
+
/// as returned by `AnyValueProvider.typeErasedStorage`.
|
|
68
|
+
/// - `valueProvider` is the `AnyValueProvider` that returned the type-erased value.
|
|
69
|
+
let conversion: (_ value: Any, _ valueProvider: AnyValueProvider) -> ValueRepresentation?
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// MARK: - PropertyName
|
|
73
|
+
|
|
74
|
+
/// The name of a customizable property that can be used in an `AnimationKeypath`
|
|
75
|
+
/// - These values should be shared between the two rendering engines,
|
|
76
|
+
/// since they form the public API of the `AnimationKeypath` system.
|
|
77
|
+
enum PropertyName: String, CaseIterable {
|
|
78
|
+
case color = "Color"
|
|
79
|
+
case opacity = "Opacity"
|
|
80
|
+
case scale = "Scale"
|
|
81
|
+
case position = "Position"
|
|
82
|
+
case rotation = "Rotation"
|
|
83
|
+
case strokeWidth = "Stroke Width"
|
|
84
|
+
case gradientColors = "Colors"
|
|
85
|
+
case strokeColor = "Stroke Color"
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// MARK: CALayer properties
|
|
89
|
+
|
|
90
|
+
extension LayerProperty {
|
|
91
|
+
static var position: LayerProperty<CGPoint> {
|
|
92
|
+
.init(
|
|
93
|
+
caLayerKeypath: "transform.translation",
|
|
94
|
+
defaultValue: CGPoint(x: 0, y: 0),
|
|
95
|
+
customizableProperty: .position
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
static var positionX: LayerProperty<CGFloat> {
|
|
100
|
+
.init(
|
|
101
|
+
caLayerKeypath: "transform.translation.x",
|
|
102
|
+
defaultValue: 0,
|
|
103
|
+
customizableProperty: nil // currently unsupported
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
static var positionY: LayerProperty<CGFloat> {
|
|
108
|
+
.init(
|
|
109
|
+
caLayerKeypath: "transform.translation.y",
|
|
110
|
+
defaultValue: 0,
|
|
111
|
+
customizableProperty: nil // currently unsupported
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
static var scale: LayerProperty<CGFloat> {
|
|
116
|
+
.init(
|
|
117
|
+
caLayerKeypath: "transform.scale",
|
|
118
|
+
defaultValue: 1,
|
|
119
|
+
customizableProperty: nil // currently unsupported
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
static var scaleX: LayerProperty<CGFloat> {
|
|
124
|
+
.init(
|
|
125
|
+
caLayerKeypath: "transform.scale.x",
|
|
126
|
+
defaultValue: 1,
|
|
127
|
+
customizableProperty: .scaleX
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
static var scaleY: LayerProperty<CGFloat> {
|
|
132
|
+
.init(
|
|
133
|
+
caLayerKeypath: "transform.scale.y",
|
|
134
|
+
defaultValue: 1,
|
|
135
|
+
customizableProperty: .scaleY
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
static var rotationX: LayerProperty<CGFloat> {
|
|
140
|
+
.init(
|
|
141
|
+
caLayerKeypath: "transform.rotation.x",
|
|
142
|
+
defaultValue: 0,
|
|
143
|
+
customizableProperty: nil // currently unsupported
|
|
144
|
+
)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
static var rotationY: LayerProperty<CGFloat> {
|
|
148
|
+
.init(
|
|
149
|
+
caLayerKeypath: "transform.rotation.y",
|
|
150
|
+
defaultValue: 0,
|
|
151
|
+
customizableProperty: nil // currently unsupported
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
static var rotationZ: LayerProperty<CGFloat> {
|
|
156
|
+
.init(
|
|
157
|
+
caLayerKeypath: "transform.rotation.z",
|
|
158
|
+
defaultValue: 0,
|
|
159
|
+
customizableProperty: .rotation
|
|
160
|
+
)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
static var anchorPoint: LayerProperty<CGPoint> {
|
|
164
|
+
.init(
|
|
165
|
+
caLayerKeypath: #keyPath(CALayer.anchorPoint),
|
|
166
|
+
// This is intentionally not `GGPoint(x: 0.5, y: 0.5)` (the actual default)
|
|
167
|
+
// to opt `anchorPoint` out of the KVC `setValue` flow, which causes issues.
|
|
168
|
+
defaultValue: nil,
|
|
169
|
+
customizableProperty: nil // currently unsupported
|
|
170
|
+
)
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
static var opacity: LayerProperty<CGFloat> {
|
|
174
|
+
.init(
|
|
175
|
+
caLayerKeypath: #keyPath(CALayer.opacity),
|
|
176
|
+
defaultValue: 1,
|
|
177
|
+
customizableProperty: .opacity
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
static var isHidden: LayerProperty<Bool> {
|
|
182
|
+
.init(
|
|
183
|
+
caLayerKeypath: #keyPath(CALayer.isHidden),
|
|
184
|
+
defaultValue: false,
|
|
185
|
+
customizableProperty: nil // unsupported
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
static var transform: LayerProperty<CATransform3D> {
|
|
190
|
+
.init(
|
|
191
|
+
caLayerKeypath: #keyPath(CALayer.transform),
|
|
192
|
+
isDefaultValue: { transform in
|
|
193
|
+
guard let transform else { return false }
|
|
194
|
+
return CATransform3DIsIdentity(transform)
|
|
195
|
+
},
|
|
196
|
+
customizableProperty: nil // currently unsupported
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
static var shadowOpacity: LayerProperty<CGFloat> {
|
|
201
|
+
.init(
|
|
202
|
+
caLayerKeypath: #keyPath(CALayer.shadowOpacity),
|
|
203
|
+
defaultValue: 0,
|
|
204
|
+
customizableProperty: nil // currently unsupported
|
|
205
|
+
)
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
static var shadowColor: LayerProperty<CGColor> {
|
|
209
|
+
.init(
|
|
210
|
+
caLayerKeypath: #keyPath(CALayer.shadowColor),
|
|
211
|
+
defaultValue: .rgb(0, 0, 0),
|
|
212
|
+
customizableProperty: nil // currently unsupported
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
static var shadowRadius: LayerProperty<CGFloat> {
|
|
217
|
+
.init(
|
|
218
|
+
caLayerKeypath: #keyPath(CALayer.shadowRadius),
|
|
219
|
+
defaultValue: 3.0,
|
|
220
|
+
customizableProperty: nil // currently unsupported
|
|
221
|
+
)
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
static var shadowOffset: LayerProperty<CGSize> {
|
|
225
|
+
.init(
|
|
226
|
+
caLayerKeypath: #keyPath(CALayer.shadowOffset),
|
|
227
|
+
defaultValue: CGSize(width: 0, height: -3.0),
|
|
228
|
+
customizableProperty: nil // currently unsupported
|
|
229
|
+
)
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// MARK: CAShapeLayer properties
|
|
234
|
+
|
|
235
|
+
extension LayerProperty {
|
|
236
|
+
static var path: LayerProperty<CGPath> {
|
|
237
|
+
.init(
|
|
238
|
+
caLayerKeypath: #keyPath(CAShapeLayer.path),
|
|
239
|
+
defaultValue: nil,
|
|
240
|
+
customizableProperty: nil // currently unsupported
|
|
241
|
+
)
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
static var fillColor: LayerProperty<CGColor> {
|
|
245
|
+
.init(
|
|
246
|
+
caLayerKeypath: #keyPath(CAShapeLayer.fillColor),
|
|
247
|
+
defaultValue: nil,
|
|
248
|
+
customizableProperty: .color
|
|
249
|
+
)
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
static var lineWidth: LayerProperty<CGFloat> {
|
|
253
|
+
.init(
|
|
254
|
+
caLayerKeypath: #keyPath(CAShapeLayer.lineWidth),
|
|
255
|
+
defaultValue: 1,
|
|
256
|
+
customizableProperty: .floatValue(.strokeWidth)
|
|
257
|
+
)
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
static var lineDashPhase: LayerProperty<CGFloat> {
|
|
261
|
+
.init(
|
|
262
|
+
caLayerKeypath: #keyPath(CAShapeLayer.lineDashPhase),
|
|
263
|
+
defaultValue: 0,
|
|
264
|
+
customizableProperty: nil // currently unsupported
|
|
265
|
+
)
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
static var strokeColor: LayerProperty<CGColor> {
|
|
269
|
+
.init(
|
|
270
|
+
caLayerKeypath: #keyPath(CAShapeLayer.strokeColor),
|
|
271
|
+
defaultValue: nil,
|
|
272
|
+
customizableProperty: .color
|
|
273
|
+
)
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
static var strokeStart: LayerProperty<CGFloat> {
|
|
277
|
+
.init(
|
|
278
|
+
caLayerKeypath: #keyPath(CAShapeLayer.strokeStart),
|
|
279
|
+
defaultValue: 0,
|
|
280
|
+
customizableProperty: nil // currently unsupported
|
|
281
|
+
)
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
static var strokeEnd: LayerProperty<CGFloat> {
|
|
285
|
+
.init(
|
|
286
|
+
caLayerKeypath: #keyPath(CAShapeLayer.strokeEnd),
|
|
287
|
+
defaultValue: 1,
|
|
288
|
+
customizableProperty: nil // currently unsupported
|
|
289
|
+
)
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// MARK: CAGradientLayer properties
|
|
294
|
+
|
|
295
|
+
extension LayerProperty {
|
|
296
|
+
static var colors: LayerProperty<[CGColor]> {
|
|
297
|
+
.init(
|
|
298
|
+
caLayerKeypath: #keyPath(CAGradientLayer.colors),
|
|
299
|
+
defaultValue: nil,
|
|
300
|
+
customizableProperty: .gradientColors
|
|
301
|
+
)
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
static var locations: LayerProperty<[CGFloat]> {
|
|
305
|
+
.init(
|
|
306
|
+
caLayerKeypath: #keyPath(CAGradientLayer.locations),
|
|
307
|
+
defaultValue: nil,
|
|
308
|
+
customizableProperty: .gradientLocations
|
|
309
|
+
)
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
static var startPoint: LayerProperty<CGPoint> {
|
|
313
|
+
.init(
|
|
314
|
+
caLayerKeypath: #keyPath(CAGradientLayer.startPoint),
|
|
315
|
+
defaultValue: nil,
|
|
316
|
+
customizableProperty: nil // currently unsupported
|
|
317
|
+
)
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
static var endPoint: LayerProperty<CGPoint> {
|
|
321
|
+
.init(
|
|
322
|
+
caLayerKeypath: #keyPath(CAGradientLayer.endPoint),
|
|
323
|
+
defaultValue: nil,
|
|
324
|
+
customizableProperty: nil // currently unsupported
|
|
325
|
+
)
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
// MARK: - CustomizableProperty types
|
|
330
|
+
|
|
331
|
+
extension CustomizableProperty {
|
|
332
|
+
static var color: CustomizableProperty<CGColor> {
|
|
333
|
+
.init(
|
|
334
|
+
name: [.color],
|
|
335
|
+
conversion: { typeErasedValue, _ in
|
|
336
|
+
guard let color = typeErasedValue as? LottieColor else {
|
|
337
|
+
return nil
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
return .rgba(CGFloat(color.r), CGFloat(color.g), CGFloat(color.b), CGFloat(color.a))
|
|
341
|
+
}
|
|
342
|
+
)
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
static var opacity: CustomizableProperty<CGFloat> {
|
|
346
|
+
.init(
|
|
347
|
+
name: [.opacity],
|
|
348
|
+
conversion: { typeErasedValue, _ in
|
|
349
|
+
guard let vector = typeErasedValue as? LottieVector1D else { return nil }
|
|
350
|
+
|
|
351
|
+
// Lottie animation files express opacity as a numerical percentage value
|
|
352
|
+
// (e.g. 50%, 100%, 200%) so we divide by 100 to get the decimal values
|
|
353
|
+
// expected by Core Animation (e.g. 0.5, 1.0, 2.0).
|
|
354
|
+
return vector.cgFloatValue / 100
|
|
355
|
+
}
|
|
356
|
+
)
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
static var scaleX: CustomizableProperty<CGFloat> {
|
|
360
|
+
.init(
|
|
361
|
+
name: [.scale],
|
|
362
|
+
conversion: { typeErasedValue, _ in
|
|
363
|
+
guard let vector = typeErasedValue as? LottieVector3D else { return nil }
|
|
364
|
+
|
|
365
|
+
// Lottie animation files express scale as a numerical percentage value
|
|
366
|
+
// (e.g. 50%, 100%, 200%) so we divide by 100 to get the decimal values
|
|
367
|
+
// expected by Core Animation (e.g. 0.5, 1.0, 2.0).
|
|
368
|
+
return vector.pointValue.x / 100
|
|
369
|
+
}
|
|
370
|
+
)
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
static var scaleY: CustomizableProperty<CGFloat> {
|
|
374
|
+
.init(
|
|
375
|
+
name: [.scale],
|
|
376
|
+
conversion: { typeErasedValue, _ in
|
|
377
|
+
guard let vector = typeErasedValue as? LottieVector3D else { return nil }
|
|
378
|
+
|
|
379
|
+
// Lottie animation files express scale as a numerical percentage value
|
|
380
|
+
// (e.g. 50%, 100%, 200%) so we divide by 100 to get the decimal values
|
|
381
|
+
// expected by Core Animation (e.g. 0.5, 1.0, 2.0).
|
|
382
|
+
return vector.pointValue.y / 100
|
|
383
|
+
}
|
|
384
|
+
)
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
static var rotation: CustomizableProperty<CGFloat> {
|
|
388
|
+
.init(
|
|
389
|
+
name: [.rotation],
|
|
390
|
+
conversion: { typeErasedValue, _ in
|
|
391
|
+
guard let vector = typeErasedValue as? LottieVector1D else { return nil }
|
|
392
|
+
|
|
393
|
+
// Lottie animation files express rotation in degrees
|
|
394
|
+
// (e.g. 90º, 180º, 360º) so we covert to radians to get the
|
|
395
|
+
// values expected by Core Animation (e.g. π/2, π, 2π)
|
|
396
|
+
return vector.cgFloatValue * .pi / 180
|
|
397
|
+
}
|
|
398
|
+
)
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
static var position: CustomizableProperty<CGPoint> {
|
|
402
|
+
.init(
|
|
403
|
+
name: [.position],
|
|
404
|
+
conversion: { typeErasedValue, _ in
|
|
405
|
+
guard let vector = typeErasedValue as? LottieVector3D else { return nil }
|
|
406
|
+
return vector.pointValue
|
|
407
|
+
}
|
|
408
|
+
)
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
static var gradientColors: CustomizableProperty<[CGColor]> {
|
|
412
|
+
.init(
|
|
413
|
+
name: [.gradientColors],
|
|
414
|
+
conversion: { _, typeErasedValueProvider in
|
|
415
|
+
guard let gradientValueProvider = typeErasedValueProvider as? GradientValueProvider else { return nil }
|
|
416
|
+
return gradientValueProvider.colors.map { $0.cgColorValue }
|
|
417
|
+
}
|
|
418
|
+
)
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
static var gradientLocations: CustomizableProperty<[CGFloat]> {
|
|
422
|
+
.init(
|
|
423
|
+
name: [.gradientColors],
|
|
424
|
+
conversion: { _, typeErasedValueProvider in
|
|
425
|
+
guard let gradientValueProvider = typeErasedValueProvider as? GradientValueProvider else { return nil }
|
|
426
|
+
return gradientValueProvider.locations.map { CGFloat($0) }
|
|
427
|
+
}
|
|
428
|
+
)
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
static func floatValue(_ name: PropertyName...) -> CustomizableProperty<CGFloat> {
|
|
432
|
+
.init(
|
|
433
|
+
name: name,
|
|
434
|
+
conversion: { typeErasedValue, _ in
|
|
435
|
+
guard let vector = typeErasedValue as? LottieVector1D else { return nil }
|
|
436
|
+
return vector.cgFloatValue
|
|
437
|
+
}
|
|
438
|
+
)
|
|
439
|
+
}
|
|
440
|
+
}
|
package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/OpacityAnimation.swift
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Created by Cal Stephens on 5/17/22.
|
|
2
|
+
// Copyright © 2022 Airbnb Inc. All rights reserved.
|
|
3
|
+
|
|
4
|
+
import QuartzCore
|
|
5
|
+
|
|
6
|
+
// MARK: - OpacityAnimationModel
|
|
7
|
+
|
|
8
|
+
protocol OpacityAnimationModel {
|
|
9
|
+
/// The opacity animation to apply to a `CALayer`
|
|
10
|
+
var opacity: KeyframeGroup<LottieVector1D> { get }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// MARK: - Transform + OpacityAnimationModel
|
|
14
|
+
|
|
15
|
+
extension Transform: OpacityAnimationModel { }
|
|
16
|
+
|
|
17
|
+
// MARK: - ShapeTransform + OpacityAnimationModel
|
|
18
|
+
|
|
19
|
+
extension ShapeTransform: OpacityAnimationModel { }
|
|
20
|
+
|
|
21
|
+
// MARK: - Fill + OpacityAnimationModel
|
|
22
|
+
|
|
23
|
+
extension Fill: OpacityAnimationModel { }
|
|
24
|
+
|
|
25
|
+
// MARK: - GradientFill + OpacityAnimationModel
|
|
26
|
+
|
|
27
|
+
extension GradientFill: OpacityAnimationModel { }
|
|
28
|
+
|
|
29
|
+
// MARK: - Stroke + OpacityAnimationModel
|
|
30
|
+
|
|
31
|
+
extension Stroke: OpacityAnimationModel { }
|
|
32
|
+
|
|
33
|
+
// MARK: - GradientStroke + OpacityAnimationModel
|
|
34
|
+
|
|
35
|
+
extension GradientStroke: OpacityAnimationModel { }
|
|
36
|
+
|
|
37
|
+
extension CALayer {
|
|
38
|
+
/// Adds the opacity animation from the given `OpacityAnimationModel` to this layer
|
|
39
|
+
@nonobjc
|
|
40
|
+
func addOpacityAnimation(for opacity: OpacityAnimationModel, context: LayerAnimationContext) throws {
|
|
41
|
+
try addAnimation(
|
|
42
|
+
for: .opacity,
|
|
43
|
+
keyframes: opacity.opacity,
|
|
44
|
+
value: {
|
|
45
|
+
// Lottie animation files express opacity as a numerical percentage value
|
|
46
|
+
// (e.g. 0%, 50%, 100%) so we divide by 100 to get the decimal values
|
|
47
|
+
// expected by Core Animation (e.g. 0.0, 0.5, 1.0).
|
|
48
|
+
$0.cgFloatValue / 100
|
|
49
|
+
},
|
|
50
|
+
context: context
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
}
|
package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/RectangleAnimation.swift
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Created by Cal Stephens on 12/21/21.
|
|
2
|
+
// Copyright © 2021 Airbnb Inc. All rights reserved.
|
|
3
|
+
|
|
4
|
+
import QuartzCore
|
|
5
|
+
|
|
6
|
+
extension CAShapeLayer {
|
|
7
|
+
/// Adds animations for the given `Rectangle` to this `CALayer`
|
|
8
|
+
@nonobjc
|
|
9
|
+
func addAnimations(
|
|
10
|
+
for rectangle: Rectangle,
|
|
11
|
+
context: LayerAnimationContext,
|
|
12
|
+
pathMultiplier: PathMultiplier,
|
|
13
|
+
roundedCorners: RoundedCorners?
|
|
14
|
+
) throws {
|
|
15
|
+
try addAnimation(
|
|
16
|
+
for: .path,
|
|
17
|
+
keyframes: try rectangle.combinedKeyframes(roundedCorners: roundedCorners),
|
|
18
|
+
value: { keyframe in
|
|
19
|
+
BezierPath.rectangle(
|
|
20
|
+
position: keyframe.position.pointValue,
|
|
21
|
+
size: keyframe.size.sizeValue,
|
|
22
|
+
cornerRadius: keyframe.cornerRadius.cgFloatValue,
|
|
23
|
+
direction: rectangle.direction
|
|
24
|
+
)
|
|
25
|
+
.cgPath()
|
|
26
|
+
.duplicated(times: pathMultiplier)
|
|
27
|
+
},
|
|
28
|
+
context: context
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
extension Rectangle {
|
|
34
|
+
/// Data that represents how to render a rectangle at a specific point in time
|
|
35
|
+
struct Keyframe: Interpolatable {
|
|
36
|
+
let size: LottieVector3D
|
|
37
|
+
let position: LottieVector3D
|
|
38
|
+
let cornerRadius: LottieVector1D
|
|
39
|
+
|
|
40
|
+
func interpolate(to: Rectangle.Keyframe, amount: CGFloat) -> Rectangle.Keyframe {
|
|
41
|
+
Rectangle.Keyframe(
|
|
42
|
+
size: size.interpolate(to: to.size, amount: amount),
|
|
43
|
+
position: position.interpolate(to: to.position, amount: amount),
|
|
44
|
+
cornerRadius: cornerRadius.interpolate(to: to.cornerRadius, amount: amount)
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/// Creates a single array of animatable keyframes from the separate arrays of keyframes in this Rectangle
|
|
50
|
+
func combinedKeyframes(roundedCorners: RoundedCorners?) throws -> KeyframeGroup<Rectangle.Keyframe> {
|
|
51
|
+
let cornerRadius = roundedCorners?.radius ?? cornerRadius
|
|
52
|
+
return Keyframes.combined(
|
|
53
|
+
size,
|
|
54
|
+
position,
|
|
55
|
+
cornerRadius,
|
|
56
|
+
makeCombinedResult: Rectangle.Keyframe.init
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
}
|