@octane-xplat/lottie 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -16
- package/dist/native/index.js +10 -9
- package/dist/native/octane-client-build.json +1 -1
- package/dist/web/index.js +39 -25
- package/dist/web/octane-client-build.json +1 -1
- package/package.json +25 -3
- package/platforms/macos/LICENSE-EpoxyCore-Apache-2.0.txt +201 -0
- package/platforms/macos/LICENSE-LRUCache-MIT.txt +22 -0
- package/platforms/macos/LICENSE-Lottie-Apache-2.0.txt +201 -0
- package/platforms/macos/LICENSE-ZIPFoundation-MIT.txt +21 -0
- package/platforms/macos/UPSTREAM.md +13 -0
- package/platforms/macos/resources/PrivacyInfo.xcprivacy +23 -0
- package/platforms/macos/resources/THIRD-PARTY-NOTICES.txt +10 -0
- package/platforms/macos/src/XplatAppKitLottie.swift +246 -0
- package/platforms/macos/src/vendor/Lottie/PrivacyInfo.xcprivacy +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CAAnimation+TimingConfiguration.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CALayer+addAnimation.swift +476 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CombinedShapeAnimation.swift +92 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CustomPathAnimation.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/DropShadowAnimation.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/EllipseAnimation.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/GradientAnimations.swift +287 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/LayerProperty.swift +440 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/OpacityAnimation.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/RectangleAnimation.swift +59 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/ShapeAnimation.swift +246 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/StarAnimation.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/StrokeAnimation.swift +96 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/TransformAnimations.swift +380 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/VisibilityAnimation.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/CompatibilityTracker.swift +129 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/CoreAnimationLayer.swift +645 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/CALayer+fillBounds.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/KeyframeGroup+exactlyOneKeyframe.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/Keyframes+combined.swift +345 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/Keyframes+timeRemapping.swift +46 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/AnimationLayer.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/BaseAnimationLayer.swift +46 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/BaseCompositionLayer.swift +120 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/CALayer+setupLayerHierarchy.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/GradientRenderLayer.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ImageLayer.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/InfiniteOpaqueAnimationLayer.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/LayerModel+makeAnimationLayer.swift +59 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/MaskCompositionLayer.swift +139 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/PreCompLayer.swift +107 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/RepeaterLayer.swift +113 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ShapeItemLayer.swift +346 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ShapeLayer.swift +569 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/SolidLayer.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/TextLayer.swift +157 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/TransformLayer.swift +13 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/ValueProviderStore.swift +157 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/Collection+Diff.swift +267 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/Diffable.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/DiffableSection.swift +16 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/IndexChangeset.swift +187 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/SectionedChangeset.swift +22 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Logging/EpoxyLogger.swift +102 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/CallbackContextEpoxyModeled.swift +8 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelArrayBuilder.swift +48 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelProperty.swift +158 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelStorage.swift +88 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModeled.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/AnyEpoxyModelProperty.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/ClassReference.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/AnimatedProviding.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DataIDProviding.swift +58 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidDisplayProviding.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidEndDisplayingProviding.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidSelectProviding.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ErasedContentProviding.swift +49 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/MakeViewProviding.swift +61 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetBehaviorsProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetContentProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/StyleIDProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/TraitCollectionProviding.swift +14 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewDifferentiatorProviding.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewProviding.swift +13 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/WillDisplayProviding.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/ViewEpoxyModeled.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/README.md +30 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUIIntrinsicContentSizeInvalidator.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUILayoutMargins.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxyableView+SwiftUIView.swift +165 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/MeasuringViewRepresentable.swift +127 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/SwiftUIMeasurementContainer.swift +468 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/SwiftUIView.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIView+SwiftUIView.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIViewConfiguringSwiftUIView.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/BehaviorsConfigurableView.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/ContentConfigurableView.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/EpoxyableView.swift +5 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/StyledView.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/ViewType.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/LRUCache/LRUCache.swift +257 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/LRUCache/README.md +24 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/README.md +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+BackingConfiguration.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Deprecated.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Helpers.swift +361 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+MemoryFile.swift +205 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Progress.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Reading.swift +160 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+ReadingDeprecated.swift +50 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Writing.swift +403 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+WritingDeprecated.swift +95 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+ZIP64.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive.swift +404 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+Compression.swift +632 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+CompressionDeprecated.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+Serialization.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Date+ZIP.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry+Serialization.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry+ZIP64.swift +170 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry.swift +669 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIP.swift +405 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIPDeprecated.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/README.md +24 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/URL+ZIP.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/CompositionLayer.swift +177 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/ImageCompositionLayer.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/MaskContainerLayer.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/NullCompositionLayer.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/PreCompositionLayer.swift +137 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/ShapeCompositionLayer.swift +60 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/SolidCompositionLayer.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/TextCompositionLayer.swift +247 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/MainThreadAnimationLayer.swift +321 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CachedImageProvider.swift +56 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CompositionLayersInitializer.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CoreTextRenderLayer.swift +424 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/InvertedMatteLayer.swift +55 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerFontProvider.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerImageProvider.swift +52 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerTextProvider.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerTransformNode.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Extensions/ItemsExtension.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/NodeProperty.swift +62 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyNodeProperty.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyValueContainer.swift +26 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/KeypathSearchable.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/NodePropertyMap.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueContainer.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueProviders/GroupInterpolator.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueProviders/SingleValueProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/DropShadowNode.swift +102 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/LayerEffectNode.swift +25 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/RoundedCornersNode.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/TrimPathNode.swift +281 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/GroupOutputNode.swift +74 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/PassThroughOutputNode.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/PathOutputNode.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/FillRenderer.swift +69 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientFillRenderer.swift +253 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientStrokeRenderer.swift +64 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/LegacyGradientFillRenderer.swift +158 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/StrokeRenderer.swift +165 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/EllipseNode.swift +143 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/PolygonNode.swift +173 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/RectNode.swift +238 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/ShapeNode.swift +73 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/StarNode.swift +224 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderContainers/GroupNode.swift +162 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/FillNode.swift +88 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientFillNode.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientStrokeNode.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/StrokeNode.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/Text/TextAnimatorNode.swift +345 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/AnimatorNode.swift +197 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/PathNode.swift +20 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/RenderNode.swift +60 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeContainerLayer.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeRenderLayer.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/Asset.swift +51 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/AssetLibrary.swift +75 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/ImageAsset.swift +141 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/PrecompAsset.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DictionaryInitializable.swift +73 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieAnimation.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieImageProvider.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieManifest.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieUtils.swift +71 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Extensions/Bundle.swift +58 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Extensions/KeyedDecodingContainerExtensions.swift +71 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Keyframes/KeyframeData.swift +111 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Keyframes/KeyframeGroup.swift +265 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/DropShadowEffect.swift +52 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/ColorEffectValue.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/EffectValue.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/Vector1DEffectValue.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/LayerEffect.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerStyles/DropShadowStyle.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerStyles/LayerStyle.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/ImageLayerModel.swift +49 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/LayerModel.swift +266 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/PreCompLayerModel.swift +74 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/ShapeLayerModel.swift +50 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/SolidLayerModel.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/TextLayerModel.swift +65 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/DashPattern.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Marker.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Mask.swift +80 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Transform.swift +261 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Ellipse.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Fill.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/GradientFill.swift +142 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/GradientStroke.swift +244 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Group.swift +55 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Merge.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Rectangle.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Repeater.swift +181 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/RoundedCorners.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Shape.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/ShapeItem.swift +171 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/ShapeTransform.swift +202 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Star.swift +136 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Stroke.swift +144 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Trim.swift +90 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/Font.swift +67 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/Glyph.swift +94 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/TextAnimator.swift +240 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/TextDocument.swift +142 -0
- package/platforms/macos/src/vendor/Lottie/Private/RootAnimationLayer.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/AnimatorNodeDebugging.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/LayerDebugging.swift +231 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/TestHelpers.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/AnimationKeypathExtension.swift +303 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/BlendMode+Filter.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/CGColor+RGB.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/CGFloatExtensions.swift +152 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/DataExtension.swift +33 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/MathKit.swift +454 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/StringExtensions.swift +44 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/AnimationContext.swift +95 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/AnyEquatable.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/Binding+Map.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/View+ValueChanged.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/InterpolatableExtensions.swift +143 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/KeyframeExtensions.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/KeyframeInterpolator.swift +250 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/LottieAnimationSource.swift +51 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/BezierPath.swift +509 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/BezierPathRoundExtension.swift +163 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CGPointExtension.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/ColorExtension.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CompoundBezierPath.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CurveVertex.swift +190 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/PathElement.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/UnitBezier.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/VectorsExtensions.swift +368 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimation.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationHelpers.swift +317 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationLayer.swift +1582 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationView.swift +1090 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationViewInitializers.swift +226 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottiePlaybackMode.swift +266 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieView.swift +643 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/AnimationCacheProvider.swift +21 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/DefaultAnimationCache.swift +67 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/LRUAnimationCache.swift +11 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/LottieAnimationCache.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/DecodingStrategy.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/LottieConfiguration.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/LottieURLSession.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/ReducedMotionOption.swift +128 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/RenderingEngineOption.swift +117 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedButton.swift +128 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedControl.swift +248 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedSwitch.swift +271 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieButton.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieSwitch.swift +144 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieViewType.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/Cache/DotLottieCache.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/Cache/DotLottieCacheProvider.swift +21 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieConfiguration.swift +72 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieFile.swift +186 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieFileHelpers.swift +386 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/AnimationKeypath.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/AnyValueProvider.swift +132 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/ColorValueProvider.swift +96 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/FloatValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/GradientValueProvider.swift +138 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/PointValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/SizeValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/FontProvider/AnimationFontProvider.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Public/ImageProvider/AnimationImageProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/Keyframes/Interpolatable.swift +285 -0
- package/platforms/macos/src/vendor/Lottie/Public/Keyframes/Keyframe.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Public/Logging/LottieLogger.swift +138 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/AnimationTime.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/LottieColor.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/Vectors.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Public/TextProvider/AnimationTextProvider.swift +135 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/AnimationSubview.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/BundleImageProvider.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleAnimationKeypath.swift +33 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleAnimationView.swift +567 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleFontProvider.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleImageProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/FilepathImageProvider.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/LottieAnimationViewBase.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/UIColorExtension.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/AnimationSubview.macOS.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/BundleImageProvider.macOS.swift +90 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/FilepathImageProvider.macOS.swift +86 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/LottieAnimationViewBase.macOS.swift +102 -0
- package/src/Lottie.macos.tsrx +129 -0
- package/src/Lottie.tsrx +6 -4
- package/src/Lottie.web.tsrx +28 -11
- package/src/index.macos.ts +2 -0
- package/src/props.ts +6 -1
- package/types/generated/props.d.ts +5 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ShapeLayer.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/8/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - ShapeLayerModel
|
|
9
|
+
|
|
10
|
+
/// A layer that holds vector shape objects.
|
|
11
|
+
final class ShapeLayerModel: LayerModel {
|
|
12
|
+
|
|
13
|
+
// MARK: Lifecycle
|
|
14
|
+
|
|
15
|
+
required init(from decoder: Decoder) throws {
|
|
16
|
+
let container = try decoder.container(keyedBy: ShapeLayerModel.CodingKeys.self)
|
|
17
|
+
items = try container.decode([ShapeItem].self, ofFamily: ShapeType.self, forKey: .items)
|
|
18
|
+
try super.init(from: decoder)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
required init(dictionary: [String: Any]) throws {
|
|
22
|
+
let itemDictionaries: [[String: Any]] = try dictionary.value(for: CodingKeys.items)
|
|
23
|
+
items = try [ShapeItem].fromDictionaries(itemDictionaries)
|
|
24
|
+
try super.init(dictionary: dictionary)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// MARK: Internal
|
|
28
|
+
|
|
29
|
+
/// A list of shape items.
|
|
30
|
+
let items: [ShapeItem]
|
|
31
|
+
|
|
32
|
+
override func encode(to encoder: Encoder) throws {
|
|
33
|
+
try super.encode(to: encoder)
|
|
34
|
+
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
35
|
+
try container.encode(items, forKey: .items)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// MARK: Private
|
|
39
|
+
|
|
40
|
+
private enum CodingKeys: String, CodingKey {
|
|
41
|
+
case items = "shapes"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// MARK: @unchecked Sendable
|
|
46
|
+
|
|
47
|
+
/// `ShapeLayerModel` inherits `@unchecked Sendable` from `LayerModel` and
|
|
48
|
+
/// we need to restate that here to avoid a warning in Xcode 16
|
|
49
|
+
// swiftlint:disable:next no_unchecked_sendable
|
|
50
|
+
extension ShapeLayerModel: @unchecked Sendable { }
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//
|
|
2
|
+
// SolidLayer.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/8/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - SolidLayerModel
|
|
9
|
+
|
|
10
|
+
/// A layer that holds a solid color.
|
|
11
|
+
final class SolidLayerModel: LayerModel {
|
|
12
|
+
|
|
13
|
+
// MARK: Lifecycle
|
|
14
|
+
|
|
15
|
+
required init(from decoder: Decoder) throws {
|
|
16
|
+
let container = try decoder.container(keyedBy: SolidLayerModel.CodingKeys.self)
|
|
17
|
+
colorHex = try container.decode(String.self, forKey: .colorHex)
|
|
18
|
+
width = try container.decode(Double.self, forKey: .width)
|
|
19
|
+
height = try container.decode(Double.self, forKey: .height)
|
|
20
|
+
try super.init(from: decoder)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
required init(dictionary: [String: Any]) throws {
|
|
24
|
+
colorHex = try dictionary.value(for: CodingKeys.colorHex)
|
|
25
|
+
width = try dictionary.value(for: CodingKeys.width)
|
|
26
|
+
height = try dictionary.value(for: CodingKeys.height)
|
|
27
|
+
try super.init(dictionary: dictionary)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// MARK: Internal
|
|
31
|
+
|
|
32
|
+
/// The color of the solid in Hex // Change to value provider.
|
|
33
|
+
let colorHex: String
|
|
34
|
+
|
|
35
|
+
/// The Width of the color layer
|
|
36
|
+
let width: Double
|
|
37
|
+
|
|
38
|
+
/// The height of the color layer
|
|
39
|
+
let height: Double
|
|
40
|
+
|
|
41
|
+
override func encode(to encoder: Encoder) throws {
|
|
42
|
+
try super.encode(to: encoder)
|
|
43
|
+
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
44
|
+
try container.encode(colorHex, forKey: .colorHex)
|
|
45
|
+
try container.encode(width, forKey: .width)
|
|
46
|
+
try container.encode(height, forKey: .height)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// MARK: Private
|
|
50
|
+
|
|
51
|
+
private enum CodingKeys: String, CodingKey {
|
|
52
|
+
case colorHex = "sc"
|
|
53
|
+
case width = "sw"
|
|
54
|
+
case height = "sh"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// MARK: @unchecked Sendable
|
|
59
|
+
|
|
60
|
+
/// `SolidLayerModel` inherits `@unchecked Sendable` from `LayerModel` and
|
|
61
|
+
/// we need to restate that here to avoid a warning in Xcode 16
|
|
62
|
+
// swiftlint:disable:next no_unchecked_sendable
|
|
63
|
+
extension SolidLayerModel: @unchecked Sendable { }
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
//
|
|
2
|
+
// TextLayer.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/8/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - TextLayerModel
|
|
9
|
+
|
|
10
|
+
/// A layer that holds text.
|
|
11
|
+
final class TextLayerModel: LayerModel {
|
|
12
|
+
|
|
13
|
+
// MARK: Lifecycle
|
|
14
|
+
|
|
15
|
+
required init(from decoder: Decoder) throws {
|
|
16
|
+
let container = try decoder.container(keyedBy: TextLayerModel.CodingKeys.self)
|
|
17
|
+
let textContainer = try container.nestedContainer(keyedBy: TextCodingKeys.self, forKey: .textGroup)
|
|
18
|
+
text = try textContainer.decode(KeyframeGroup<TextDocument>.self, forKey: .text)
|
|
19
|
+
animators = try textContainer.decode([TextAnimator].self, forKey: .animators)
|
|
20
|
+
try super.init(from: decoder)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
required init(dictionary: [String: Any]) throws {
|
|
24
|
+
let containerDictionary: [String: Any] = try dictionary.value(for: CodingKeys.textGroup)
|
|
25
|
+
let textDictionary: [String: Any] = try containerDictionary.value(for: TextCodingKeys.text)
|
|
26
|
+
text = try KeyframeGroup<TextDocument>(dictionary: textDictionary)
|
|
27
|
+
let animatorDictionaries: [[String: Any]] = try containerDictionary.value(for: TextCodingKeys.animators)
|
|
28
|
+
animators = try animatorDictionaries.map { try TextAnimator(dictionary: $0) }
|
|
29
|
+
try super.init(dictionary: dictionary)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// MARK: Internal
|
|
33
|
+
|
|
34
|
+
/// The text for the layer
|
|
35
|
+
let text: KeyframeGroup<TextDocument>
|
|
36
|
+
|
|
37
|
+
/// Text animators
|
|
38
|
+
let animators: [TextAnimator]
|
|
39
|
+
|
|
40
|
+
override func encode(to encoder: Encoder) throws {
|
|
41
|
+
try super.encode(to: encoder)
|
|
42
|
+
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
43
|
+
var textContainer = container.nestedContainer(keyedBy: TextCodingKeys.self, forKey: .textGroup)
|
|
44
|
+
try textContainer.encode(text, forKey: .text)
|
|
45
|
+
try textContainer.encode(animators, forKey: .animators)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// MARK: Private
|
|
49
|
+
|
|
50
|
+
private enum CodingKeys: String, CodingKey {
|
|
51
|
+
case textGroup = "t"
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
private enum TextCodingKeys: String, CodingKey {
|
|
55
|
+
case text = "d"
|
|
56
|
+
case animators = "a"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// MARK: @unchecked Sendable
|
|
61
|
+
|
|
62
|
+
/// `TextLayerModel` inherits `@unchecked Sendable` from `LayerModel` and
|
|
63
|
+
/// we need to restate that here to avoid a warning in Xcode 16
|
|
64
|
+
// swiftlint:disable:next no_unchecked_sendable
|
|
65
|
+
extension TextLayerModel: @unchecked Sendable { }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
//
|
|
2
|
+
// DashPattern.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/22/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - DashElementType
|
|
9
|
+
|
|
10
|
+
enum DashElementType: String, Codable {
|
|
11
|
+
case offset = "o"
|
|
12
|
+
case dash = "d"
|
|
13
|
+
case gap = "g"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// MARK: - DashElement
|
|
17
|
+
|
|
18
|
+
final class DashElement: Codable, DictionaryInitializable {
|
|
19
|
+
|
|
20
|
+
// MARK: Lifecycle
|
|
21
|
+
|
|
22
|
+
init(dictionary: [String: Any]) throws {
|
|
23
|
+
let typeRawValue: String = try dictionary.value(for: CodingKeys.type)
|
|
24
|
+
guard let type = DashElementType(rawValue: typeRawValue) else {
|
|
25
|
+
throw InitializableError.invalidInput()
|
|
26
|
+
}
|
|
27
|
+
self.type = type
|
|
28
|
+
let valueDictionary: [String: Any] = try dictionary.value(for: CodingKeys.value)
|
|
29
|
+
value = try KeyframeGroup<LottieVector1D>(dictionary: valueDictionary)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// MARK: Internal
|
|
33
|
+
|
|
34
|
+
enum CodingKeys: String, CodingKey {
|
|
35
|
+
case type = "n"
|
|
36
|
+
case value = "v"
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let type: DashElementType
|
|
40
|
+
let value: KeyframeGroup<LottieVector1D>
|
|
41
|
+
|
|
42
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Marker.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/9/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
/// A time marker
|
|
9
|
+
final class Marker: Codable, Sendable, DictionaryInitializable {
|
|
10
|
+
|
|
11
|
+
// MARK: Lifecycle
|
|
12
|
+
|
|
13
|
+
init(dictionary: [String: Any]) throws {
|
|
14
|
+
name = try dictionary.value(for: CodingKeys.name)
|
|
15
|
+
frameTime = try dictionary.value(for: CodingKeys.frameTime)
|
|
16
|
+
durationFrameTime = try dictionary.value(for: CodingKeys.durationFrameTime)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// MARK: Internal
|
|
20
|
+
|
|
21
|
+
enum CodingKeys: String, CodingKey {
|
|
22
|
+
case name = "cm"
|
|
23
|
+
case frameTime = "tm"
|
|
24
|
+
case durationFrameTime = "dr"
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/// The Marker Name
|
|
28
|
+
let name: String
|
|
29
|
+
|
|
30
|
+
/// The Frame time of the marker
|
|
31
|
+
let frameTime: AnimationFrameTime
|
|
32
|
+
|
|
33
|
+
/// The duration of the marker, in frames.
|
|
34
|
+
let durationFrameTime: AnimationFrameTime
|
|
35
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Mask.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/8/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - MaskMode
|
|
9
|
+
|
|
10
|
+
enum MaskMode: String, Codable {
|
|
11
|
+
case add = "a"
|
|
12
|
+
case subtract = "s"
|
|
13
|
+
case intersect = "i"
|
|
14
|
+
case lighten = "l"
|
|
15
|
+
case darken = "d"
|
|
16
|
+
case difference = "f"
|
|
17
|
+
case none = "n"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// MARK: - Mask
|
|
21
|
+
|
|
22
|
+
final class Mask: Codable, DictionaryInitializable {
|
|
23
|
+
|
|
24
|
+
// MARK: Lifecycle
|
|
25
|
+
|
|
26
|
+
required init(from decoder: Decoder) throws {
|
|
27
|
+
let container = try decoder.container(keyedBy: Mask.CodingKeys.self)
|
|
28
|
+
mode = try container.decodeIfPresent(MaskMode.self, forKey: .mode) ?? .add
|
|
29
|
+
opacity = try container
|
|
30
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .opacity) ?? KeyframeGroup(LottieVector1D(100))
|
|
31
|
+
shape = try container.decode(KeyframeGroup<BezierPath>.self, forKey: .shape)
|
|
32
|
+
inverted = try container.decodeIfPresent(Bool.self, forKey: .inverted) ?? false
|
|
33
|
+
expansion = try container
|
|
34
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .expansion) ?? KeyframeGroup(LottieVector1D(0))
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
init(dictionary: [String: Any]) throws {
|
|
38
|
+
if
|
|
39
|
+
let modeRawType = dictionary[CodingKeys.mode.rawValue] as? String,
|
|
40
|
+
let mode = MaskMode(rawValue: modeRawType)
|
|
41
|
+
{
|
|
42
|
+
self.mode = mode
|
|
43
|
+
} else {
|
|
44
|
+
mode = .add
|
|
45
|
+
}
|
|
46
|
+
if let opacityDictionary = dictionary[CodingKeys.opacity.rawValue] as? [String: Any] {
|
|
47
|
+
opacity = try KeyframeGroup<LottieVector1D>(dictionary: opacityDictionary)
|
|
48
|
+
} else {
|
|
49
|
+
opacity = KeyframeGroup(LottieVector1D(100))
|
|
50
|
+
}
|
|
51
|
+
let shapeDictionary: [String: Any] = try dictionary.value(for: CodingKeys.shape)
|
|
52
|
+
shape = try KeyframeGroup<BezierPath>(dictionary: shapeDictionary)
|
|
53
|
+
inverted = (try? dictionary.value(for: CodingKeys.inverted)) ?? false
|
|
54
|
+
if let expansionDictionary = dictionary[CodingKeys.expansion.rawValue] as? [String: Any] {
|
|
55
|
+
expansion = try KeyframeGroup<LottieVector1D>(dictionary: expansionDictionary)
|
|
56
|
+
} else {
|
|
57
|
+
expansion = KeyframeGroup(LottieVector1D(0))
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// MARK: Internal
|
|
62
|
+
|
|
63
|
+
enum CodingKeys: String, CodingKey {
|
|
64
|
+
case mode
|
|
65
|
+
case opacity = "o"
|
|
66
|
+
case inverted = "inv"
|
|
67
|
+
case shape = "pt"
|
|
68
|
+
case expansion = "x"
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
let mode: MaskMode
|
|
72
|
+
|
|
73
|
+
let opacity: KeyframeGroup<LottieVector1D>
|
|
74
|
+
|
|
75
|
+
let shape: KeyframeGroup<BezierPath>
|
|
76
|
+
|
|
77
|
+
let inverted: Bool
|
|
78
|
+
|
|
79
|
+
let expansion: KeyframeGroup<LottieVector1D>
|
|
80
|
+
}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Transform.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/7/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
/// The animatable transform for a layer. Controls position, rotation, scale, and opacity.
|
|
9
|
+
final class Transform: Codable, DictionaryInitializable {
|
|
10
|
+
|
|
11
|
+
// MARK: Lifecycle
|
|
12
|
+
|
|
13
|
+
required init(from decoder: Decoder) throws {
|
|
14
|
+
/// This manual override of decode is required because we want to throw an error
|
|
15
|
+
/// in the case that there is not position data.
|
|
16
|
+
let container = try decoder.container(keyedBy: Transform.CodingKeys.self)
|
|
17
|
+
|
|
18
|
+
// AnchorPoint
|
|
19
|
+
anchorPoint = try container
|
|
20
|
+
.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .anchorPoint) ??
|
|
21
|
+
KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
22
|
+
|
|
23
|
+
// Position
|
|
24
|
+
if container.contains(.positionX), container.contains(.positionY) {
|
|
25
|
+
// Position dimensions are split into two keyframe groups
|
|
26
|
+
positionX = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .positionX)
|
|
27
|
+
positionY = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .positionY)
|
|
28
|
+
position = nil
|
|
29
|
+
} else if let positionKeyframes = try? container.decode(KeyframeGroup<LottieVector3D>.self, forKey: .position) {
|
|
30
|
+
// Position dimensions are a single keyframe group.
|
|
31
|
+
position = positionKeyframes
|
|
32
|
+
positionX = nil
|
|
33
|
+
positionY = nil
|
|
34
|
+
} else if
|
|
35
|
+
let positionContainer = try? container.nestedContainer(keyedBy: PositionCodingKeys.self, forKey: .position),
|
|
36
|
+
let positionX = try? positionContainer.decode(KeyframeGroup<LottieVector1D>.self, forKey: .positionX),
|
|
37
|
+
let positionY = try? positionContainer.decode(KeyframeGroup<LottieVector1D>.self, forKey: .positionY)
|
|
38
|
+
{
|
|
39
|
+
/// Position keyframes are split and nested.
|
|
40
|
+
self.positionX = positionX
|
|
41
|
+
self.positionY = positionY
|
|
42
|
+
position = nil
|
|
43
|
+
} else {
|
|
44
|
+
/// Default value.
|
|
45
|
+
position = KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
46
|
+
positionX = nil
|
|
47
|
+
positionY = nil
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Scale
|
|
51
|
+
scale = try container
|
|
52
|
+
.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .scale) ??
|
|
53
|
+
KeyframeGroup(LottieVector3D(x: Double(100), y: 100, z: 100))
|
|
54
|
+
|
|
55
|
+
// Rotation
|
|
56
|
+
if let rotation = try container.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotationX) {
|
|
57
|
+
rotationX = rotation
|
|
58
|
+
} else {
|
|
59
|
+
rotationX = KeyframeGroup(LottieVector1D(0))
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if let rotation = try container.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotationY) {
|
|
63
|
+
rotationY = rotation
|
|
64
|
+
} else {
|
|
65
|
+
rotationY = KeyframeGroup(LottieVector1D(0))
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if let rotation = try container.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotationZ) {
|
|
69
|
+
rotationZ = rotation
|
|
70
|
+
} else {
|
|
71
|
+
rotationZ = try container
|
|
72
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotation) ?? KeyframeGroup(LottieVector1D(0))
|
|
73
|
+
}
|
|
74
|
+
rotation = nil
|
|
75
|
+
// Opacity
|
|
76
|
+
opacity = try container
|
|
77
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .opacity) ?? KeyframeGroup(LottieVector1D(100))
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
init(dictionary: [String: Any]) throws {
|
|
81
|
+
if
|
|
82
|
+
let anchorPointDictionary = dictionary[CodingKeys.anchorPoint.rawValue] as? [String: Any],
|
|
83
|
+
let anchorPoint = try? KeyframeGroup<LottieVector3D>(dictionary: anchorPointDictionary)
|
|
84
|
+
{
|
|
85
|
+
self.anchorPoint = anchorPoint
|
|
86
|
+
} else {
|
|
87
|
+
anchorPoint = Transform.default.anchorPoint
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if
|
|
91
|
+
let xDictionary = dictionary[CodingKeys.positionX.rawValue] as? [String: Any],
|
|
92
|
+
let yDictionary = dictionary[CodingKeys.positionY.rawValue] as? [String: Any]
|
|
93
|
+
{
|
|
94
|
+
positionX = try KeyframeGroup<LottieVector1D>(dictionary: xDictionary)
|
|
95
|
+
positionY = try KeyframeGroup<LottieVector1D>(dictionary: yDictionary)
|
|
96
|
+
position = nil
|
|
97
|
+
} else if
|
|
98
|
+
let positionDictionary = dictionary[CodingKeys.position.rawValue] as? [String: Any],
|
|
99
|
+
positionDictionary[KeyframeGroup<LottieVector3D>.KeyframeWrapperKey.keyframeData.rawValue] != nil
|
|
100
|
+
{
|
|
101
|
+
position = try KeyframeGroup<LottieVector3D>(dictionary: positionDictionary)
|
|
102
|
+
positionX = nil
|
|
103
|
+
positionY = nil
|
|
104
|
+
} else if
|
|
105
|
+
let positionDictionary = dictionary[CodingKeys.position.rawValue] as? [String: Any],
|
|
106
|
+
let xDictionary = positionDictionary[PositionCodingKeys.positionX.rawValue] as? [String: Any],
|
|
107
|
+
let yDictionary = positionDictionary[PositionCodingKeys.positionY.rawValue] as? [String: Any]
|
|
108
|
+
{
|
|
109
|
+
positionX = try KeyframeGroup<LottieVector1D>(dictionary: xDictionary)
|
|
110
|
+
positionY = try KeyframeGroup<LottieVector1D>(dictionary: yDictionary)
|
|
111
|
+
position = nil
|
|
112
|
+
} else {
|
|
113
|
+
position = Transform.default.position
|
|
114
|
+
positionX = nil
|
|
115
|
+
positionY = nil
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if
|
|
119
|
+
let scaleDictionary = dictionary[CodingKeys.scale.rawValue] as? [String: Any],
|
|
120
|
+
let scale = try? KeyframeGroup<LottieVector3D>(dictionary: scaleDictionary)
|
|
121
|
+
{
|
|
122
|
+
self.scale = scale
|
|
123
|
+
} else {
|
|
124
|
+
scale = Transform.default.scale
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if
|
|
128
|
+
let rotationDictionary = dictionary[CodingKeys.rotationX.rawValue] as? [String: Any],
|
|
129
|
+
let rotation = try? KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
130
|
+
{
|
|
131
|
+
rotationX = rotation
|
|
132
|
+
} else {
|
|
133
|
+
rotationX = Transform.default.rotationX
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if
|
|
137
|
+
let rotationDictionary = dictionary[CodingKeys.rotationY.rawValue] as? [String: Any],
|
|
138
|
+
let rotation = try? KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
139
|
+
{
|
|
140
|
+
rotationY = rotation
|
|
141
|
+
} else {
|
|
142
|
+
rotationY = Transform.default.rotationY
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if
|
|
146
|
+
let rotationDictionary = dictionary[CodingKeys.rotation.rawValue] as? [String: Any],
|
|
147
|
+
let rotation = try? KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
148
|
+
{
|
|
149
|
+
rotationZ = rotation
|
|
150
|
+
} else if
|
|
151
|
+
let rotationDictionary = dictionary[CodingKeys.rotationZ.rawValue] as? [String: Any],
|
|
152
|
+
let rotation = try? KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
153
|
+
{
|
|
154
|
+
rotationZ = rotation
|
|
155
|
+
} else {
|
|
156
|
+
rotationZ = Transform.default.rotationZ
|
|
157
|
+
}
|
|
158
|
+
rotation = nil
|
|
159
|
+
if
|
|
160
|
+
let opacityDictionary = dictionary[CodingKeys.opacity.rawValue] as? [String: Any],
|
|
161
|
+
let opacity = try? KeyframeGroup<LottieVector1D>(dictionary: opacityDictionary)
|
|
162
|
+
{
|
|
163
|
+
self.opacity = opacity
|
|
164
|
+
} else {
|
|
165
|
+
opacity = Transform.default.opacity
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
init(
|
|
170
|
+
anchorPoint: KeyframeGroup<LottieVector3D>,
|
|
171
|
+
position: KeyframeGroup<LottieVector3D>?,
|
|
172
|
+
positionX: KeyframeGroup<LottieVector1D>?,
|
|
173
|
+
positionY: KeyframeGroup<LottieVector1D>?,
|
|
174
|
+
scale: KeyframeGroup<LottieVector3D>,
|
|
175
|
+
rotationX: KeyframeGroup<LottieVector1D>,
|
|
176
|
+
rotationY: KeyframeGroup<LottieVector1D>,
|
|
177
|
+
rotationZ: KeyframeGroup<LottieVector1D>,
|
|
178
|
+
opacity: KeyframeGroup<LottieVector1D>,
|
|
179
|
+
rotation: KeyframeGroup<LottieVector1D>?
|
|
180
|
+
) {
|
|
181
|
+
self.anchorPoint = anchorPoint
|
|
182
|
+
self.position = position
|
|
183
|
+
self.positionX = positionX
|
|
184
|
+
self.positionY = positionY
|
|
185
|
+
self.scale = scale
|
|
186
|
+
self.rotationX = rotationX
|
|
187
|
+
self.rotationY = rotationY
|
|
188
|
+
self.rotationZ = rotationZ
|
|
189
|
+
self.opacity = opacity
|
|
190
|
+
self.rotation = rotation
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// MARK: Internal
|
|
194
|
+
|
|
195
|
+
enum CodingKeys: String, CodingKey {
|
|
196
|
+
case anchorPoint = "a"
|
|
197
|
+
case position = "p"
|
|
198
|
+
case positionX = "px"
|
|
199
|
+
case positionY = "py"
|
|
200
|
+
case scale = "s"
|
|
201
|
+
case rotation = "r"
|
|
202
|
+
case rotationX = "rx"
|
|
203
|
+
case rotationY = "ry"
|
|
204
|
+
case rotationZ = "rz"
|
|
205
|
+
case opacity = "o"
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
enum PositionCodingKeys: String, CodingKey {
|
|
209
|
+
case split = "s"
|
|
210
|
+
case positionX = "x"
|
|
211
|
+
case positionY = "y"
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/// Default transform values to use if no transform is provided
|
|
215
|
+
static var `default`: Transform {
|
|
216
|
+
Transform(
|
|
217
|
+
anchorPoint: KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0)),
|
|
218
|
+
position: KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0)),
|
|
219
|
+
positionX: nil,
|
|
220
|
+
positionY: nil,
|
|
221
|
+
scale: KeyframeGroup(LottieVector3D(x: Double(100), y: 100, z: 100)),
|
|
222
|
+
rotationX: KeyframeGroup(LottieVector1D(0)),
|
|
223
|
+
rotationY: KeyframeGroup(LottieVector1D(0)),
|
|
224
|
+
rotationZ: KeyframeGroup(LottieVector1D(0)),
|
|
225
|
+
opacity: KeyframeGroup(LottieVector1D(100)),
|
|
226
|
+
rotation: nil
|
|
227
|
+
)
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/// The anchor point of the transform.
|
|
231
|
+
let anchorPoint: KeyframeGroup<LottieVector3D>
|
|
232
|
+
|
|
233
|
+
/// The position of the transform. This is nil if the position data was split.
|
|
234
|
+
let position: KeyframeGroup<LottieVector3D>?
|
|
235
|
+
|
|
236
|
+
/// The positionX of the transform. This is nil if the position property is set.
|
|
237
|
+
let positionX: KeyframeGroup<LottieVector1D>?
|
|
238
|
+
|
|
239
|
+
/// The positionY of the transform. This is nil if the position property is set.
|
|
240
|
+
let positionY: KeyframeGroup<LottieVector1D>?
|
|
241
|
+
|
|
242
|
+
/// The scale of the transform.
|
|
243
|
+
let scale: KeyframeGroup<LottieVector3D>
|
|
244
|
+
|
|
245
|
+
/// The rotation of the transform on X axis.
|
|
246
|
+
let rotationX: KeyframeGroup<LottieVector1D>
|
|
247
|
+
|
|
248
|
+
/// The rotation of the transform on Y axis.
|
|
249
|
+
let rotationY: KeyframeGroup<LottieVector1D>
|
|
250
|
+
|
|
251
|
+
/// The rotation of the transform on Z axis.
|
|
252
|
+
let rotationZ: KeyframeGroup<LottieVector1D>
|
|
253
|
+
|
|
254
|
+
/// The opacity of the transform.
|
|
255
|
+
let opacity: KeyframeGroup<LottieVector1D>
|
|
256
|
+
|
|
257
|
+
// MARK: Private
|
|
258
|
+
|
|
259
|
+
/// Here for the CodingKeys.rotation = "r". `r` and `rz` are the same.
|
|
260
|
+
private let rotation: KeyframeGroup<LottieVector1D>?
|
|
261
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
//
|
|
2
|
+
// EllipseItem.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/8/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - PathDirection
|
|
9
|
+
|
|
10
|
+
enum PathDirection: Int, Codable {
|
|
11
|
+
case clockwise = 1
|
|
12
|
+
case userSetClockwise = 2
|
|
13
|
+
case counterClockwise = 3
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// MARK: - Ellipse
|
|
17
|
+
|
|
18
|
+
final class Ellipse: ShapeItem {
|
|
19
|
+
|
|
20
|
+
// MARK: Lifecycle
|
|
21
|
+
|
|
22
|
+
required init(from decoder: Decoder) throws {
|
|
23
|
+
let container = try decoder.container(keyedBy: Ellipse.CodingKeys.self)
|
|
24
|
+
direction = try container.decodeIfPresent(PathDirection.self, forKey: .direction) ?? .clockwise
|
|
25
|
+
position = try container.decode(KeyframeGroup<LottieVector3D>.self, forKey: .position)
|
|
26
|
+
size = try container.decode(KeyframeGroup<LottieVector3D>.self, forKey: .size)
|
|
27
|
+
try super.init(from: decoder)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
required init(dictionary: [String: Any]) throws {
|
|
31
|
+
if
|
|
32
|
+
let directionRawType = dictionary[CodingKeys.direction.rawValue] as? Int,
|
|
33
|
+
let direction = PathDirection(rawValue: directionRawType)
|
|
34
|
+
{
|
|
35
|
+
self.direction = direction
|
|
36
|
+
} else {
|
|
37
|
+
direction = .clockwise
|
|
38
|
+
}
|
|
39
|
+
let positionDictionary: [String: Any] = try dictionary.value(for: CodingKeys.position)
|
|
40
|
+
position = try KeyframeGroup<LottieVector3D>(dictionary: positionDictionary)
|
|
41
|
+
let sizeDictionary: [String: Any] = try dictionary.value(for: CodingKeys.size)
|
|
42
|
+
size = try KeyframeGroup<LottieVector3D>(dictionary: sizeDictionary)
|
|
43
|
+
try super.init(dictionary: dictionary)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// MARK: Internal
|
|
47
|
+
|
|
48
|
+
/// The direction of the ellipse.
|
|
49
|
+
let direction: PathDirection
|
|
50
|
+
|
|
51
|
+
/// The position of the ellipse
|
|
52
|
+
let position: KeyframeGroup<LottieVector3D>
|
|
53
|
+
|
|
54
|
+
/// The size of the ellipse
|
|
55
|
+
let size: KeyframeGroup<LottieVector3D>
|
|
56
|
+
|
|
57
|
+
override func encode(to encoder: Encoder) throws {
|
|
58
|
+
try super.encode(to: encoder)
|
|
59
|
+
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
60
|
+
try container.encode(direction, forKey: .direction)
|
|
61
|
+
try container.encode(position, forKey: .position)
|
|
62
|
+
try container.encode(size, forKey: .size)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// MARK: Private
|
|
66
|
+
|
|
67
|
+
private enum CodingKeys: String, CodingKey {
|
|
68
|
+
case direction = "d"
|
|
69
|
+
case position = "p"
|
|
70
|
+
case size = "s"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// MARK: @unchecked Sendable
|
|
75
|
+
|
|
76
|
+
/// `Ellipse` inherits `@unchecked Sendable` from `ShapeItem` and
|
|
77
|
+
/// we need to restate that here to avoid a warning in Xcode 16
|
|
78
|
+
// swiftlint:disable:next no_unchecked_sendable
|
|
79
|
+
extension Ellipse: @unchecked Sendable { }
|