@octane-xplat/lottie 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -16
- package/dist/native/index.js +10 -9
- package/dist/native/octane-client-build.json +1 -1
- package/dist/web/index.js +39 -25
- package/dist/web/octane-client-build.json +1 -1
- package/package.json +25 -3
- package/platforms/macos/LICENSE-EpoxyCore-Apache-2.0.txt +201 -0
- package/platforms/macos/LICENSE-LRUCache-MIT.txt +22 -0
- package/platforms/macos/LICENSE-Lottie-Apache-2.0.txt +201 -0
- package/platforms/macos/LICENSE-ZIPFoundation-MIT.txt +21 -0
- package/platforms/macos/UPSTREAM.md +13 -0
- package/platforms/macos/resources/PrivacyInfo.xcprivacy +23 -0
- package/platforms/macos/resources/THIRD-PARTY-NOTICES.txt +10 -0
- package/platforms/macos/src/XplatAppKitLottie.swift +246 -0
- package/platforms/macos/src/vendor/Lottie/PrivacyInfo.xcprivacy +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CAAnimation+TimingConfiguration.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CALayer+addAnimation.swift +476 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CombinedShapeAnimation.swift +92 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CustomPathAnimation.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/DropShadowAnimation.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/EllipseAnimation.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/GradientAnimations.swift +287 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/LayerProperty.swift +440 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/OpacityAnimation.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/RectangleAnimation.swift +59 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/ShapeAnimation.swift +246 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/StarAnimation.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/StrokeAnimation.swift +96 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/TransformAnimations.swift +380 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/VisibilityAnimation.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/CompatibilityTracker.swift +129 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/CoreAnimationLayer.swift +645 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/CALayer+fillBounds.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/KeyframeGroup+exactlyOneKeyframe.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/Keyframes+combined.swift +345 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/Keyframes+timeRemapping.swift +46 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/AnimationLayer.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/BaseAnimationLayer.swift +46 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/BaseCompositionLayer.swift +120 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/CALayer+setupLayerHierarchy.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/GradientRenderLayer.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ImageLayer.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/InfiniteOpaqueAnimationLayer.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/LayerModel+makeAnimationLayer.swift +59 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/MaskCompositionLayer.swift +139 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/PreCompLayer.swift +107 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/RepeaterLayer.swift +113 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ShapeItemLayer.swift +346 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ShapeLayer.swift +569 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/SolidLayer.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/TextLayer.swift +157 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/TransformLayer.swift +13 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/ValueProviderStore.swift +157 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/Collection+Diff.swift +267 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/Diffable.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/DiffableSection.swift +16 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/IndexChangeset.swift +187 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/SectionedChangeset.swift +22 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Logging/EpoxyLogger.swift +102 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/CallbackContextEpoxyModeled.swift +8 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelArrayBuilder.swift +48 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelProperty.swift +158 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelStorage.swift +88 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModeled.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/AnyEpoxyModelProperty.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/ClassReference.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/AnimatedProviding.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DataIDProviding.swift +58 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidDisplayProviding.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidEndDisplayingProviding.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidSelectProviding.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ErasedContentProviding.swift +49 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/MakeViewProviding.swift +61 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetBehaviorsProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetContentProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/StyleIDProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/TraitCollectionProviding.swift +14 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewDifferentiatorProviding.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewProviding.swift +13 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/WillDisplayProviding.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/ViewEpoxyModeled.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/README.md +30 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUIIntrinsicContentSizeInvalidator.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUILayoutMargins.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxyableView+SwiftUIView.swift +165 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/MeasuringViewRepresentable.swift +127 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/SwiftUIMeasurementContainer.swift +468 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/SwiftUIView.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIView+SwiftUIView.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIViewConfiguringSwiftUIView.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/BehaviorsConfigurableView.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/ContentConfigurableView.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/EpoxyableView.swift +5 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/StyledView.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/ViewType.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/LRUCache/LRUCache.swift +257 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/LRUCache/README.md +24 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/README.md +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+BackingConfiguration.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Deprecated.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Helpers.swift +361 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+MemoryFile.swift +205 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Progress.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Reading.swift +160 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+ReadingDeprecated.swift +50 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Writing.swift +403 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+WritingDeprecated.swift +95 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+ZIP64.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive.swift +404 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+Compression.swift +632 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+CompressionDeprecated.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+Serialization.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Date+ZIP.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry+Serialization.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry+ZIP64.swift +170 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry.swift +669 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIP.swift +405 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIPDeprecated.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/README.md +24 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/URL+ZIP.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/CompositionLayer.swift +177 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/ImageCompositionLayer.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/MaskContainerLayer.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/NullCompositionLayer.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/PreCompositionLayer.swift +137 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/ShapeCompositionLayer.swift +60 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/SolidCompositionLayer.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/TextCompositionLayer.swift +247 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/MainThreadAnimationLayer.swift +321 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CachedImageProvider.swift +56 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CompositionLayersInitializer.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CoreTextRenderLayer.swift +424 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/InvertedMatteLayer.swift +55 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerFontProvider.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerImageProvider.swift +52 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerTextProvider.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerTransformNode.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Extensions/ItemsExtension.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/NodeProperty.swift +62 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyNodeProperty.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyValueContainer.swift +26 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/KeypathSearchable.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/NodePropertyMap.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueContainer.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueProviders/GroupInterpolator.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueProviders/SingleValueProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/DropShadowNode.swift +102 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/LayerEffectNode.swift +25 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/RoundedCornersNode.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/TrimPathNode.swift +281 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/GroupOutputNode.swift +74 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/PassThroughOutputNode.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/PathOutputNode.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/FillRenderer.swift +69 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientFillRenderer.swift +253 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientStrokeRenderer.swift +64 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/LegacyGradientFillRenderer.swift +158 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/StrokeRenderer.swift +165 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/EllipseNode.swift +143 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/PolygonNode.swift +173 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/RectNode.swift +238 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/ShapeNode.swift +73 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/StarNode.swift +224 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderContainers/GroupNode.swift +162 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/FillNode.swift +88 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientFillNode.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientStrokeNode.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/StrokeNode.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/Text/TextAnimatorNode.swift +345 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/AnimatorNode.swift +197 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/PathNode.swift +20 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/RenderNode.swift +60 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeContainerLayer.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeRenderLayer.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/Asset.swift +51 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/AssetLibrary.swift +75 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/ImageAsset.swift +141 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/PrecompAsset.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DictionaryInitializable.swift +73 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieAnimation.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieImageProvider.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieManifest.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieUtils.swift +71 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Extensions/Bundle.swift +58 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Extensions/KeyedDecodingContainerExtensions.swift +71 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Keyframes/KeyframeData.swift +111 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Keyframes/KeyframeGroup.swift +265 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/DropShadowEffect.swift +52 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/ColorEffectValue.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/EffectValue.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/Vector1DEffectValue.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/LayerEffect.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerStyles/DropShadowStyle.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerStyles/LayerStyle.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/ImageLayerModel.swift +49 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/LayerModel.swift +266 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/PreCompLayerModel.swift +74 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/ShapeLayerModel.swift +50 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/SolidLayerModel.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/TextLayerModel.swift +65 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/DashPattern.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Marker.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Mask.swift +80 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Transform.swift +261 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Ellipse.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Fill.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/GradientFill.swift +142 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/GradientStroke.swift +244 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Group.swift +55 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Merge.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Rectangle.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Repeater.swift +181 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/RoundedCorners.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Shape.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/ShapeItem.swift +171 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/ShapeTransform.swift +202 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Star.swift +136 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Stroke.swift +144 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Trim.swift +90 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/Font.swift +67 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/Glyph.swift +94 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/TextAnimator.swift +240 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/TextDocument.swift +142 -0
- package/platforms/macos/src/vendor/Lottie/Private/RootAnimationLayer.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/AnimatorNodeDebugging.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/LayerDebugging.swift +231 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/TestHelpers.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/AnimationKeypathExtension.swift +303 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/BlendMode+Filter.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/CGColor+RGB.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/CGFloatExtensions.swift +152 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/DataExtension.swift +33 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/MathKit.swift +454 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/StringExtensions.swift +44 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/AnimationContext.swift +95 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/AnyEquatable.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/Binding+Map.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/View+ValueChanged.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/InterpolatableExtensions.swift +143 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/KeyframeExtensions.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/KeyframeInterpolator.swift +250 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/LottieAnimationSource.swift +51 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/BezierPath.swift +509 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/BezierPathRoundExtension.swift +163 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CGPointExtension.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/ColorExtension.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CompoundBezierPath.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CurveVertex.swift +190 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/PathElement.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/UnitBezier.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/VectorsExtensions.swift +368 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimation.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationHelpers.swift +317 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationLayer.swift +1582 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationView.swift +1090 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationViewInitializers.swift +226 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottiePlaybackMode.swift +266 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieView.swift +643 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/AnimationCacheProvider.swift +21 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/DefaultAnimationCache.swift +67 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/LRUAnimationCache.swift +11 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/LottieAnimationCache.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/DecodingStrategy.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/LottieConfiguration.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/LottieURLSession.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/ReducedMotionOption.swift +128 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/RenderingEngineOption.swift +117 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedButton.swift +128 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedControl.swift +248 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedSwitch.swift +271 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieButton.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieSwitch.swift +144 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieViewType.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/Cache/DotLottieCache.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/Cache/DotLottieCacheProvider.swift +21 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieConfiguration.swift +72 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieFile.swift +186 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieFileHelpers.swift +386 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/AnimationKeypath.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/AnyValueProvider.swift +132 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/ColorValueProvider.swift +96 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/FloatValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/GradientValueProvider.swift +138 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/PointValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/SizeValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/FontProvider/AnimationFontProvider.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Public/ImageProvider/AnimationImageProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/Keyframes/Interpolatable.swift +285 -0
- package/platforms/macos/src/vendor/Lottie/Public/Keyframes/Keyframe.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Public/Logging/LottieLogger.swift +138 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/AnimationTime.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/LottieColor.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/Vectors.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Public/TextProvider/AnimationTextProvider.swift +135 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/AnimationSubview.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/BundleImageProvider.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleAnimationKeypath.swift +33 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleAnimationView.swift +567 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleFontProvider.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleImageProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/FilepathImageProvider.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/LottieAnimationViewBase.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/UIColorExtension.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/AnimationSubview.macOS.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/BundleImageProvider.macOS.swift +90 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/FilepathImageProvider.macOS.swift +86 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/LottieAnimationViewBase.macOS.swift +102 -0
- package/src/Lottie.macos.tsrx +129 -0
- package/src/Lottie.tsrx +3 -2
- package/src/Lottie.web.tsrx +28 -11
- package/src/index.macos.ts +2 -0
- package/src/props.ts +6 -1
- package/types/generated/props.d.ts +5 -1
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Repeater.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/8/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - Repeater
|
|
9
|
+
|
|
10
|
+
final class Repeater: ShapeItem {
|
|
11
|
+
|
|
12
|
+
// MARK: Lifecycle
|
|
13
|
+
|
|
14
|
+
required init(from decoder: Decoder) throws {
|
|
15
|
+
let container = try decoder.container(keyedBy: Repeater.CodingKeys.self)
|
|
16
|
+
copies = try container
|
|
17
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .copies) ?? KeyframeGroup(LottieVector1D(0))
|
|
18
|
+
offset = try container
|
|
19
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .offset) ?? KeyframeGroup(LottieVector1D(0))
|
|
20
|
+
let transformContainer = try container.nestedContainer(keyedBy: TransformKeys.self, forKey: .transform)
|
|
21
|
+
startOpacity = try transformContainer
|
|
22
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .startOpacity) ?? KeyframeGroup(LottieVector1D(100))
|
|
23
|
+
endOpacity = try transformContainer
|
|
24
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .endOpacity) ?? KeyframeGroup(LottieVector1D(100))
|
|
25
|
+
if let rotation = try transformContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotation) {
|
|
26
|
+
rotationZ = rotation
|
|
27
|
+
} else if let rotation = try transformContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotationZ) {
|
|
28
|
+
rotationZ = rotation
|
|
29
|
+
} else {
|
|
30
|
+
rotationZ = KeyframeGroup(LottieVector1D(0))
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
rotationX = try transformContainer
|
|
34
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotationX) ?? KeyframeGroup(LottieVector1D(0))
|
|
35
|
+
rotationY = try transformContainer
|
|
36
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotationY) ?? KeyframeGroup(LottieVector1D(0))
|
|
37
|
+
|
|
38
|
+
position = try transformContainer
|
|
39
|
+
.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .position) ??
|
|
40
|
+
KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
41
|
+
anchorPoint = try transformContainer
|
|
42
|
+
.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .anchorPoint) ??
|
|
43
|
+
KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
44
|
+
scale = try transformContainer
|
|
45
|
+
.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .scale) ??
|
|
46
|
+
KeyframeGroup(LottieVector3D(x: Double(100), y: 100, z: 100))
|
|
47
|
+
try super.init(from: decoder)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
required init(dictionary: [String: Any]) throws {
|
|
51
|
+
if let copiesDictionary = dictionary[CodingKeys.copies.rawValue] as? [String: Any] {
|
|
52
|
+
copies = try KeyframeGroup<LottieVector1D>(dictionary: copiesDictionary)
|
|
53
|
+
} else {
|
|
54
|
+
copies = KeyframeGroup(LottieVector1D(0))
|
|
55
|
+
}
|
|
56
|
+
if let offsetDictionary = dictionary[CodingKeys.offset.rawValue] as? [String: Any] {
|
|
57
|
+
offset = try KeyframeGroup<LottieVector1D>(dictionary: offsetDictionary)
|
|
58
|
+
} else {
|
|
59
|
+
offset = KeyframeGroup(LottieVector1D(0))
|
|
60
|
+
}
|
|
61
|
+
let transformDictionary: [String: Any] = try dictionary.value(for: CodingKeys.transform)
|
|
62
|
+
if let startOpacityDictionary = transformDictionary[TransformKeys.startOpacity.rawValue] as? [String: Any] {
|
|
63
|
+
startOpacity = try KeyframeGroup<LottieVector1D>(dictionary: startOpacityDictionary)
|
|
64
|
+
} else {
|
|
65
|
+
startOpacity = KeyframeGroup(LottieVector1D(100))
|
|
66
|
+
}
|
|
67
|
+
if let endOpacityDictionary = transformDictionary[TransformKeys.endOpacity.rawValue] as? [String: Any] {
|
|
68
|
+
endOpacity = try KeyframeGroup<LottieVector1D>(dictionary: endOpacityDictionary)
|
|
69
|
+
} else {
|
|
70
|
+
endOpacity = KeyframeGroup(LottieVector1D(100))
|
|
71
|
+
}
|
|
72
|
+
if let rotationDictionary = transformDictionary[TransformKeys.rotationX.rawValue] as? [String: Any] {
|
|
73
|
+
rotationX = try KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
74
|
+
} else {
|
|
75
|
+
rotationX = KeyframeGroup(LottieVector1D(0))
|
|
76
|
+
}
|
|
77
|
+
if let rotationDictionary = transformDictionary[TransformKeys.rotationY.rawValue] as? [String: Any] {
|
|
78
|
+
rotationY = try KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
79
|
+
} else {
|
|
80
|
+
rotationY = KeyframeGroup(LottieVector1D(0))
|
|
81
|
+
}
|
|
82
|
+
if let rotationDictionary = transformDictionary[TransformKeys.rotation.rawValue] as? [String: Any] {
|
|
83
|
+
rotationZ = try KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
84
|
+
} else if let rotationDictionary = transformDictionary[TransformKeys.rotationZ.rawValue] as? [String: Any] {
|
|
85
|
+
rotationZ = try KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
86
|
+
} else {
|
|
87
|
+
rotationZ = KeyframeGroup(LottieVector1D(0))
|
|
88
|
+
}
|
|
89
|
+
if let positionDictionary = transformDictionary[TransformKeys.position.rawValue] as? [String: Any] {
|
|
90
|
+
position = try KeyframeGroup<LottieVector3D>(dictionary: positionDictionary)
|
|
91
|
+
} else {
|
|
92
|
+
position = KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
93
|
+
}
|
|
94
|
+
if let anchorPointDictionary = transformDictionary[TransformKeys.anchorPoint.rawValue] as? [String: Any] {
|
|
95
|
+
anchorPoint = try KeyframeGroup<LottieVector3D>(dictionary: anchorPointDictionary)
|
|
96
|
+
} else {
|
|
97
|
+
anchorPoint = KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
98
|
+
}
|
|
99
|
+
if let scaleDictionary = transformDictionary[TransformKeys.scale.rawValue] as? [String: Any] {
|
|
100
|
+
scale = try KeyframeGroup<LottieVector3D>(dictionary: scaleDictionary)
|
|
101
|
+
} else {
|
|
102
|
+
scale = KeyframeGroup(LottieVector3D(x: Double(100), y: 100, z: 100))
|
|
103
|
+
}
|
|
104
|
+
try super.init(dictionary: dictionary)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// MARK: Internal
|
|
108
|
+
|
|
109
|
+
/// The number of copies to repeat
|
|
110
|
+
let copies: KeyframeGroup<LottieVector1D>
|
|
111
|
+
|
|
112
|
+
/// The offset of each copy
|
|
113
|
+
let offset: KeyframeGroup<LottieVector1D>
|
|
114
|
+
|
|
115
|
+
/// Start Opacity
|
|
116
|
+
let startOpacity: KeyframeGroup<LottieVector1D>
|
|
117
|
+
|
|
118
|
+
/// End opacity
|
|
119
|
+
let endOpacity: KeyframeGroup<LottieVector1D>
|
|
120
|
+
|
|
121
|
+
/// The rotation on X axis
|
|
122
|
+
let rotationX: KeyframeGroup<LottieVector1D>
|
|
123
|
+
|
|
124
|
+
/// The rotation on Y axis
|
|
125
|
+
let rotationY: KeyframeGroup<LottieVector1D>
|
|
126
|
+
|
|
127
|
+
/// The rotation on Z axis
|
|
128
|
+
let rotationZ: KeyframeGroup<LottieVector1D>
|
|
129
|
+
|
|
130
|
+
/// Anchor Point
|
|
131
|
+
let anchorPoint: KeyframeGroup<LottieVector3D>
|
|
132
|
+
|
|
133
|
+
/// Position
|
|
134
|
+
let position: KeyframeGroup<LottieVector3D>
|
|
135
|
+
|
|
136
|
+
/// Scale
|
|
137
|
+
let scale: KeyframeGroup<LottieVector3D>
|
|
138
|
+
|
|
139
|
+
override func encode(to encoder: Encoder) throws {
|
|
140
|
+
try super.encode(to: encoder)
|
|
141
|
+
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
142
|
+
try container.encode(copies, forKey: .copies)
|
|
143
|
+
try container.encode(offset, forKey: .offset)
|
|
144
|
+
var transformContainer = container.nestedContainer(keyedBy: TransformKeys.self, forKey: .transform)
|
|
145
|
+
try transformContainer.encode(startOpacity, forKey: .startOpacity)
|
|
146
|
+
try transformContainer.encode(endOpacity, forKey: .endOpacity)
|
|
147
|
+
try transformContainer.encode(rotationX, forKey: .rotationX)
|
|
148
|
+
try transformContainer.encode(rotationY, forKey: .rotationY)
|
|
149
|
+
try transformContainer.encode(rotationZ, forKey: .rotationZ)
|
|
150
|
+
try transformContainer.encode(position, forKey: .position)
|
|
151
|
+
try transformContainer.encode(anchorPoint, forKey: .anchorPoint)
|
|
152
|
+
try transformContainer.encode(scale, forKey: .scale)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// MARK: Private
|
|
156
|
+
|
|
157
|
+
private enum CodingKeys: String, CodingKey {
|
|
158
|
+
case copies = "c"
|
|
159
|
+
case offset = "o"
|
|
160
|
+
case transform = "tr"
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
private enum TransformKeys: String, CodingKey {
|
|
164
|
+
case rotation = "r"
|
|
165
|
+
case rotationX = "rx"
|
|
166
|
+
case rotationY = "ry"
|
|
167
|
+
case rotationZ = "rz"
|
|
168
|
+
case startOpacity = "so"
|
|
169
|
+
case endOpacity = "eo"
|
|
170
|
+
case anchorPoint = "a"
|
|
171
|
+
case position = "p"
|
|
172
|
+
case scale = "s"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// MARK: @unchecked Sendable
|
|
177
|
+
|
|
178
|
+
/// `Repeater` inherits `@unchecked Sendable` from `ShapeItem` and
|
|
179
|
+
/// we need to restate that here to avoid a warning in Xcode 16
|
|
180
|
+
// swiftlint:disable:next no_unchecked_sendable
|
|
181
|
+
extension Repeater: @unchecked Sendable { }
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RoundedCorners.swift
|
|
3
|
+
// Lottie
|
|
4
|
+
//
|
|
5
|
+
// Created by Duolingo on 10/31/22.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - RoundedCorners
|
|
9
|
+
|
|
10
|
+
final class RoundedCorners: ShapeItem {
|
|
11
|
+
|
|
12
|
+
// MARK: Lifecycle
|
|
13
|
+
|
|
14
|
+
required init(from decoder: Decoder) throws {
|
|
15
|
+
let container = try decoder.container(keyedBy: RoundedCorners.CodingKeys.self)
|
|
16
|
+
radius = try
|
|
17
|
+
container.decode(
|
|
18
|
+
KeyframeGroup<LottieVector1D>.self,
|
|
19
|
+
forKey: .radius
|
|
20
|
+
)
|
|
21
|
+
try super.init(from: decoder)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
required init(dictionary: [String: Any]) throws {
|
|
25
|
+
let radiusDictionary: [String: Any] = try dictionary.value(for: CodingKeys.radius)
|
|
26
|
+
radius = try KeyframeGroup<LottieVector1D>(dictionary: radiusDictionary)
|
|
27
|
+
try super.init(dictionary: dictionary)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// MARK: Internal
|
|
31
|
+
|
|
32
|
+
/// The radius of rounded corners
|
|
33
|
+
let radius: KeyframeGroup<LottieVector1D>
|
|
34
|
+
|
|
35
|
+
override func encode(to encoder: Encoder) throws {
|
|
36
|
+
try super.encode(to: encoder)
|
|
37
|
+
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
38
|
+
try container.encode(radius, forKey: .radius)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// MARK: Private
|
|
42
|
+
|
|
43
|
+
private enum CodingKeys: String, CodingKey {
|
|
44
|
+
case radius = "r"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// MARK: @unchecked Sendable
|
|
49
|
+
|
|
50
|
+
/// `RoundedCorners` inherits `@unchecked Sendable` from `ShapeItem` and
|
|
51
|
+
/// we need to restate that here to avoid a warning in Xcode 16
|
|
52
|
+
// swiftlint:disable:next no_unchecked_sendable
|
|
53
|
+
extension RoundedCorners: @unchecked Sendable { }
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//
|
|
2
|
+
// VectorShape.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/8/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - Shape
|
|
9
|
+
|
|
10
|
+
/// An item that defines an custom shape
|
|
11
|
+
final class Shape: ShapeItem {
|
|
12
|
+
|
|
13
|
+
// MARK: Lifecycle
|
|
14
|
+
|
|
15
|
+
required init(from decoder: Decoder) throws {
|
|
16
|
+
let container = try decoder.container(keyedBy: Shape.CodingKeys.self)
|
|
17
|
+
path = try container.decode(KeyframeGroup<BezierPath>.self, forKey: .path)
|
|
18
|
+
direction = try container.decodeIfPresent(PathDirection.self, forKey: .direction)
|
|
19
|
+
try super.init(from: decoder)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
required init(dictionary: [String: Any]) throws {
|
|
23
|
+
let pathDictionary: [String: Any] = try dictionary.value(for: CodingKeys.path)
|
|
24
|
+
path = try KeyframeGroup<BezierPath>(dictionary: pathDictionary)
|
|
25
|
+
if
|
|
26
|
+
let directionRawValue = dictionary[CodingKeys.direction.rawValue] as? Int,
|
|
27
|
+
let direction = PathDirection(rawValue: directionRawValue)
|
|
28
|
+
{
|
|
29
|
+
self.direction = direction
|
|
30
|
+
} else {
|
|
31
|
+
direction = nil
|
|
32
|
+
}
|
|
33
|
+
try super.init(dictionary: dictionary)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// MARK: Internal
|
|
37
|
+
|
|
38
|
+
/// The Path
|
|
39
|
+
let path: KeyframeGroup<BezierPath>
|
|
40
|
+
|
|
41
|
+
let direction: PathDirection?
|
|
42
|
+
|
|
43
|
+
override func encode(to encoder: Encoder) throws {
|
|
44
|
+
try super.encode(to: encoder)
|
|
45
|
+
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
46
|
+
try container.encode(path, forKey: .path)
|
|
47
|
+
try container.encodeIfPresent(direction, forKey: .direction)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// MARK: Private
|
|
51
|
+
|
|
52
|
+
private enum CodingKeys: String, CodingKey {
|
|
53
|
+
case path = "ks"
|
|
54
|
+
case direction = "d"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// MARK: @unchecked Sendable
|
|
59
|
+
|
|
60
|
+
/// `Shape` inherits `@unchecked Sendable` from `ShapeItem` and
|
|
61
|
+
/// we need to restate that here to avoid a warning in Xcode 16
|
|
62
|
+
// swiftlint:disable:next no_unchecked_sendable
|
|
63
|
+
extension Shape: @unchecked Sendable { }
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
//
|
|
2
|
+
// ShapeItem.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/8/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - ShapeType
|
|
9
|
+
|
|
10
|
+
enum ShapeType: String, Codable, Sendable {
|
|
11
|
+
case ellipse = "el"
|
|
12
|
+
case fill = "fl"
|
|
13
|
+
case gradientFill = "gf"
|
|
14
|
+
case group = "gr"
|
|
15
|
+
case gradientStroke = "gs"
|
|
16
|
+
case merge = "mm"
|
|
17
|
+
case rectangle = "rc"
|
|
18
|
+
case repeater = "rp"
|
|
19
|
+
case round = "rd"
|
|
20
|
+
case shape = "sh"
|
|
21
|
+
case star = "sr"
|
|
22
|
+
case stroke = "st"
|
|
23
|
+
case trim = "tm"
|
|
24
|
+
case transform = "tr"
|
|
25
|
+
case unknown
|
|
26
|
+
|
|
27
|
+
init(from decoder: Decoder) throws {
|
|
28
|
+
self = try ShapeType(rawValue: decoder.singleValueContainer().decode(RawValue.self)) ?? .unknown
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// MARK: ClassFamily
|
|
33
|
+
|
|
34
|
+
extension ShapeType: ClassFamily {
|
|
35
|
+
|
|
36
|
+
static var discriminator = Discriminator.type
|
|
37
|
+
|
|
38
|
+
func getType() -> AnyObject.Type {
|
|
39
|
+
switch self {
|
|
40
|
+
case .ellipse:
|
|
41
|
+
Ellipse.self
|
|
42
|
+
case .fill:
|
|
43
|
+
Fill.self
|
|
44
|
+
case .gradientFill:
|
|
45
|
+
GradientFill.self
|
|
46
|
+
case .group:
|
|
47
|
+
Group.self
|
|
48
|
+
case .gradientStroke:
|
|
49
|
+
GradientStroke.self
|
|
50
|
+
case .merge:
|
|
51
|
+
Merge.self
|
|
52
|
+
case .rectangle:
|
|
53
|
+
Rectangle.self
|
|
54
|
+
case .repeater:
|
|
55
|
+
Repeater.self
|
|
56
|
+
case .round:
|
|
57
|
+
RoundedCorners.self
|
|
58
|
+
case .shape:
|
|
59
|
+
Shape.self
|
|
60
|
+
case .star:
|
|
61
|
+
Star.self
|
|
62
|
+
case .stroke:
|
|
63
|
+
Stroke.self
|
|
64
|
+
case .trim:
|
|
65
|
+
Trim.self
|
|
66
|
+
case .transform:
|
|
67
|
+
ShapeTransform.self
|
|
68
|
+
default:
|
|
69
|
+
ShapeItem.self
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// MARK: - ShapeItem
|
|
75
|
+
|
|
76
|
+
/// Base class for items belonging to a Shape Layer
|
|
77
|
+
class ShapeItem: Codable, DictionaryInitializable {
|
|
78
|
+
|
|
79
|
+
// MARK: Lifecycle
|
|
80
|
+
|
|
81
|
+
required init(from decoder: Decoder) throws {
|
|
82
|
+
let container = try decoder.container(keyedBy: ShapeItem.CodingKeys.self)
|
|
83
|
+
name = try container.decodeIfPresent(String.self, forKey: .name) ?? "Layer"
|
|
84
|
+
type = try container.decode(ShapeType.self, forKey: .type)
|
|
85
|
+
hidden = try container.decodeIfPresent(Bool.self, forKey: .hidden) ?? false
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
required init(dictionary: [String: Any]) throws {
|
|
89
|
+
name = (try? dictionary.value(for: CodingKeys.name)) ?? "Layer"
|
|
90
|
+
type = ShapeType(rawValue: try dictionary.value(for: CodingKeys.type)) ?? .unknown
|
|
91
|
+
hidden = (try? dictionary.value(for: CodingKeys.hidden)) ?? false
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
init(
|
|
95
|
+
name: String,
|
|
96
|
+
type: ShapeType,
|
|
97
|
+
hidden: Bool
|
|
98
|
+
) {
|
|
99
|
+
self.name = name
|
|
100
|
+
self.type = type
|
|
101
|
+
self.hidden = hidden
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// MARK: Internal
|
|
105
|
+
|
|
106
|
+
/// The name of the shape
|
|
107
|
+
let name: String
|
|
108
|
+
|
|
109
|
+
/// The type of shape
|
|
110
|
+
let type: ShapeType
|
|
111
|
+
|
|
112
|
+
let hidden: Bool
|
|
113
|
+
|
|
114
|
+
// MARK: Fileprivate
|
|
115
|
+
|
|
116
|
+
fileprivate enum CodingKeys: String, CodingKey {
|
|
117
|
+
case name = "nm"
|
|
118
|
+
case type = "ty"
|
|
119
|
+
case hidden = "hd"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
extension [ShapeItem] {
|
|
124
|
+
|
|
125
|
+
static func fromDictionaries(_ dictionaries: [[String: Any]]) throws -> [ShapeItem] {
|
|
126
|
+
try dictionaries.compactMap { dictionary in
|
|
127
|
+
let shapeType = dictionary[ShapeItem.CodingKeys.type.rawValue] as? String
|
|
128
|
+
switch ShapeType(rawValue: shapeType ?? ShapeType.unknown.rawValue) {
|
|
129
|
+
case .ellipse:
|
|
130
|
+
return try Ellipse(dictionary: dictionary)
|
|
131
|
+
case .fill:
|
|
132
|
+
return try Fill(dictionary: dictionary)
|
|
133
|
+
case .gradientFill:
|
|
134
|
+
return try GradientFill(dictionary: dictionary)
|
|
135
|
+
case .group:
|
|
136
|
+
return try Group(dictionary: dictionary)
|
|
137
|
+
case .gradientStroke:
|
|
138
|
+
return try GradientStroke(dictionary: dictionary)
|
|
139
|
+
case .merge:
|
|
140
|
+
return try Merge(dictionary: dictionary)
|
|
141
|
+
case .rectangle:
|
|
142
|
+
return try Rectangle(dictionary: dictionary)
|
|
143
|
+
case .repeater:
|
|
144
|
+
return try Repeater(dictionary: dictionary)
|
|
145
|
+
case .round:
|
|
146
|
+
return try RoundedCorners(dictionary: dictionary)
|
|
147
|
+
case .shape:
|
|
148
|
+
return try Shape(dictionary: dictionary)
|
|
149
|
+
case .star:
|
|
150
|
+
return try Star(dictionary: dictionary)
|
|
151
|
+
case .stroke:
|
|
152
|
+
return try Stroke(dictionary: dictionary)
|
|
153
|
+
case .trim:
|
|
154
|
+
return try Trim(dictionary: dictionary)
|
|
155
|
+
case .transform:
|
|
156
|
+
return try ShapeTransform(dictionary: dictionary)
|
|
157
|
+
case .none:
|
|
158
|
+
return nil
|
|
159
|
+
default:
|
|
160
|
+
return try ShapeItem(dictionary: dictionary)
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// MARK: - ShapeItem + @unchecked Sendable
|
|
167
|
+
|
|
168
|
+
/// Since `ShapeItem` isn't `final`, we have to use `@unchecked Sendable` instead of `Sendable.`
|
|
169
|
+
/// All `ShapeItem` subclasses are immutable `Sendable` values.
|
|
170
|
+
// swiftlint:disable:next no_unchecked_sendable
|
|
171
|
+
extension ShapeItem: @unchecked Sendable { }
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
//
|
|
2
|
+
// TransformItem.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/8/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - ShapeTransform
|
|
9
|
+
|
|
10
|
+
final class ShapeTransform: ShapeItem {
|
|
11
|
+
|
|
12
|
+
// MARK: Lifecycle
|
|
13
|
+
|
|
14
|
+
required init(from decoder: Decoder) throws {
|
|
15
|
+
let container = try decoder.container(keyedBy: ShapeTransform.CodingKeys.self)
|
|
16
|
+
anchor = try container
|
|
17
|
+
.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .anchor) ??
|
|
18
|
+
KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
19
|
+
position = try container
|
|
20
|
+
.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .position) ??
|
|
21
|
+
KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
22
|
+
scale = try container
|
|
23
|
+
.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .scale) ??
|
|
24
|
+
KeyframeGroup(LottieVector3D(x: Double(100), y: 100, z: 100))
|
|
25
|
+
|
|
26
|
+
rotationX = try container
|
|
27
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotationX) ?? KeyframeGroup(LottieVector1D(0))
|
|
28
|
+
rotationY = try container
|
|
29
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotationY) ?? KeyframeGroup(LottieVector1D(0))
|
|
30
|
+
if
|
|
31
|
+
let rotation = try container
|
|
32
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotation)
|
|
33
|
+
{
|
|
34
|
+
rotationZ = rotation
|
|
35
|
+
} else if
|
|
36
|
+
let rotation = try container
|
|
37
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotationZ)
|
|
38
|
+
{
|
|
39
|
+
rotationZ = rotation
|
|
40
|
+
} else {
|
|
41
|
+
rotationZ = KeyframeGroup(LottieVector1D(0))
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
opacity = try container
|
|
45
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .opacity) ?? KeyframeGroup(LottieVector1D(100))
|
|
46
|
+
skew = try container.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .skew) ?? KeyframeGroup(LottieVector1D(0))
|
|
47
|
+
skewAxis = try container
|
|
48
|
+
.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .skewAxis) ?? KeyframeGroup(LottieVector1D(0))
|
|
49
|
+
try super.init(from: decoder)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
required init(dictionary: [String: Any]) throws {
|
|
53
|
+
if
|
|
54
|
+
let anchorDictionary = dictionary[CodingKeys.anchor.rawValue] as? [String: Any],
|
|
55
|
+
let anchor = try? KeyframeGroup<LottieVector3D>(dictionary: anchorDictionary)
|
|
56
|
+
{
|
|
57
|
+
self.anchor = anchor
|
|
58
|
+
} else {
|
|
59
|
+
anchor = KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
60
|
+
}
|
|
61
|
+
if
|
|
62
|
+
let positionDictionary = dictionary[CodingKeys.position.rawValue] as? [String: Any],
|
|
63
|
+
let position = try? KeyframeGroup<LottieVector3D>(dictionary: positionDictionary)
|
|
64
|
+
{
|
|
65
|
+
self.position = position
|
|
66
|
+
} else {
|
|
67
|
+
position = KeyframeGroup(LottieVector3D(x: Double(0), y: 0, z: 0))
|
|
68
|
+
}
|
|
69
|
+
if
|
|
70
|
+
let scaleDictionary = dictionary[CodingKeys.scale.rawValue] as? [String: Any],
|
|
71
|
+
let scale = try? KeyframeGroup<LottieVector3D>(dictionary: scaleDictionary)
|
|
72
|
+
{
|
|
73
|
+
self.scale = scale
|
|
74
|
+
} else {
|
|
75
|
+
scale = KeyframeGroup(LottieVector3D(x: Double(100), y: 100, z: 100))
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if
|
|
79
|
+
let rotationDictionary = dictionary[CodingKeys.rotationX.rawValue] as? [String: Any],
|
|
80
|
+
let rotation = try? KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
81
|
+
{
|
|
82
|
+
rotationX = rotation
|
|
83
|
+
} else {
|
|
84
|
+
rotationX = KeyframeGroup(LottieVector1D(0))
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if
|
|
88
|
+
let rotationDictionary = dictionary[CodingKeys.rotationY.rawValue] as? [String: Any],
|
|
89
|
+
let rotation = try? KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
90
|
+
{
|
|
91
|
+
rotationY = rotation
|
|
92
|
+
} else {
|
|
93
|
+
rotationY = KeyframeGroup(LottieVector1D(0))
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if
|
|
97
|
+
let rotationDictionary = dictionary[CodingKeys.rotation.rawValue] as? [String: Any],
|
|
98
|
+
let rotation = try? KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
99
|
+
{
|
|
100
|
+
rotationZ = rotation
|
|
101
|
+
} else if
|
|
102
|
+
let rotationDictionary = dictionary[CodingKeys.rotationZ.rawValue] as? [String: Any],
|
|
103
|
+
let rotation = try? KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
104
|
+
{
|
|
105
|
+
rotationZ = rotation
|
|
106
|
+
} else {
|
|
107
|
+
rotationZ = KeyframeGroup(LottieVector1D(0))
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if
|
|
111
|
+
let opacityDictionary = dictionary[CodingKeys.opacity.rawValue] as? [String: Any],
|
|
112
|
+
let opacity = try? KeyframeGroup<LottieVector1D>(dictionary: opacityDictionary)
|
|
113
|
+
{
|
|
114
|
+
self.opacity = opacity
|
|
115
|
+
} else {
|
|
116
|
+
opacity = KeyframeGroup(LottieVector1D(100))
|
|
117
|
+
}
|
|
118
|
+
if
|
|
119
|
+
let skewDictionary = dictionary[CodingKeys.skew.rawValue] as? [String: Any],
|
|
120
|
+
let skew = try? KeyframeGroup<LottieVector1D>(dictionary: skewDictionary)
|
|
121
|
+
{
|
|
122
|
+
self.skew = skew
|
|
123
|
+
} else {
|
|
124
|
+
skew = KeyframeGroup(LottieVector1D(0))
|
|
125
|
+
}
|
|
126
|
+
if
|
|
127
|
+
let skewAxisDictionary = dictionary[CodingKeys.skewAxis.rawValue] as? [String: Any],
|
|
128
|
+
let skewAxis = try? KeyframeGroup<LottieVector1D>(dictionary: skewAxisDictionary)
|
|
129
|
+
{
|
|
130
|
+
self.skewAxis = skewAxis
|
|
131
|
+
} else {
|
|
132
|
+
skewAxis = KeyframeGroup(LottieVector1D(0))
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
try super.init(dictionary: dictionary)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// MARK: Internal
|
|
139
|
+
|
|
140
|
+
/// Anchor Point
|
|
141
|
+
let anchor: KeyframeGroup<LottieVector3D>
|
|
142
|
+
|
|
143
|
+
/// Position
|
|
144
|
+
let position: KeyframeGroup<LottieVector3D>
|
|
145
|
+
|
|
146
|
+
/// Scale
|
|
147
|
+
let scale: KeyframeGroup<LottieVector3D>
|
|
148
|
+
|
|
149
|
+
/// Rotation on X axis
|
|
150
|
+
let rotationX: KeyframeGroup<LottieVector1D>
|
|
151
|
+
|
|
152
|
+
/// Rotation on Y axis
|
|
153
|
+
let rotationY: KeyframeGroup<LottieVector1D>
|
|
154
|
+
|
|
155
|
+
/// Rotation on Z axis
|
|
156
|
+
let rotationZ: KeyframeGroup<LottieVector1D>
|
|
157
|
+
|
|
158
|
+
/// opacity
|
|
159
|
+
let opacity: KeyframeGroup<LottieVector1D>
|
|
160
|
+
|
|
161
|
+
/// Skew
|
|
162
|
+
let skew: KeyframeGroup<LottieVector1D>
|
|
163
|
+
|
|
164
|
+
/// Skew Axis
|
|
165
|
+
let skewAxis: KeyframeGroup<LottieVector1D>
|
|
166
|
+
|
|
167
|
+
override func encode(to encoder: Encoder) throws {
|
|
168
|
+
try super.encode(to: encoder)
|
|
169
|
+
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
170
|
+
try container.encode(anchor, forKey: .anchor)
|
|
171
|
+
try container.encode(position, forKey: .position)
|
|
172
|
+
try container.encode(scale, forKey: .scale)
|
|
173
|
+
try container.encode(rotationX, forKey: .rotationX)
|
|
174
|
+
try container.encode(rotationY, forKey: .rotationY)
|
|
175
|
+
try container.encode(rotationZ, forKey: .rotationZ)
|
|
176
|
+
try container.encode(opacity, forKey: .opacity)
|
|
177
|
+
try container.encode(skew, forKey: .skew)
|
|
178
|
+
try container.encode(skewAxis, forKey: .skewAxis)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// MARK: Private
|
|
182
|
+
|
|
183
|
+
private enum CodingKeys: String, CodingKey {
|
|
184
|
+
case anchor = "a"
|
|
185
|
+
case position = "p"
|
|
186
|
+
case scale = "s"
|
|
187
|
+
case rotation = "r"
|
|
188
|
+
case rotationX = "rx"
|
|
189
|
+
case rotationY = "ry"
|
|
190
|
+
case rotationZ = "rz"
|
|
191
|
+
case opacity = "o"
|
|
192
|
+
case skew = "sk"
|
|
193
|
+
case skewAxis = "sa"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// MARK: @unchecked Sendable
|
|
198
|
+
|
|
199
|
+
/// `ShapeTransform` inherits `@unchecked Sendable` from `ShapeItem` and
|
|
200
|
+
/// we need to restate that here to avoid a warning in Xcode 16
|
|
201
|
+
// swiftlint:disable:next no_unchecked_sendable
|
|
202
|
+
extension ShapeTransform: @unchecked Sendable { }
|