@octane-xplat/lottie 0.0.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -2
- package/dist/native/cx.mobile.js +11 -0
- package/dist/native/escape-props.js +39 -0
- package/dist/native/index.js +183 -0
- package/dist/native/layout-child.js +38 -0
- package/dist/native/octane-client-build.json +8 -0
- package/dist/native/vendor/ui-lottie/index.android.js +286 -0
- package/dist/native/vendor/ui-lottie/index.ios.js +214 -0
- package/dist/native/vendor/ui-lottie/src/lottie/index.common.js +50 -0
- package/dist/native/vendor/ui-lottie/src/lottie/utils.js +6 -0
- package/dist/web/escape-props.web.js +17 -0
- package/dist/web/index.js +346 -0
- package/dist/web/layout-child.web.js +47 -0
- package/dist/web/octane-client-build.json +8 -0
- package/package.json +104 -11
- package/platforms/android/include.gradle +7 -0
- package/platforms/android/java/com/nativescript/lottie/LottieAnimationView.java +92 -0
- package/platforms/android/lottie.aar +0 -0
- package/platforms/android/native-api-usage.json +16 -0
- package/platforms/ios/Podfile +5 -0
- package/platforms/macos/LICENSE-EpoxyCore-Apache-2.0.txt +201 -0
- package/platforms/macos/LICENSE-LRUCache-MIT.txt +22 -0
- package/platforms/macos/LICENSE-Lottie-Apache-2.0.txt +201 -0
- package/platforms/macos/LICENSE-ZIPFoundation-MIT.txt +21 -0
- package/platforms/macos/UPSTREAM.md +13 -0
- package/platforms/macos/resources/PrivacyInfo.xcprivacy +23 -0
- package/platforms/macos/resources/THIRD-PARTY-NOTICES.txt +10 -0
- package/platforms/macos/src/XplatAppKitLottie.swift +246 -0
- package/platforms/macos/src/vendor/Lottie/PrivacyInfo.xcprivacy +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CAAnimation+TimingConfiguration.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CALayer+addAnimation.swift +476 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CombinedShapeAnimation.swift +92 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CustomPathAnimation.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/DropShadowAnimation.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/EllipseAnimation.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/GradientAnimations.swift +287 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/LayerProperty.swift +440 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/OpacityAnimation.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/RectangleAnimation.swift +59 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/ShapeAnimation.swift +246 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/StarAnimation.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/StrokeAnimation.swift +96 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/TransformAnimations.swift +380 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/VisibilityAnimation.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/CompatibilityTracker.swift +129 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/CoreAnimationLayer.swift +645 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/CALayer+fillBounds.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/KeyframeGroup+exactlyOneKeyframe.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/Keyframes+combined.swift +345 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/Keyframes+timeRemapping.swift +46 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/AnimationLayer.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/BaseAnimationLayer.swift +46 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/BaseCompositionLayer.swift +120 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/CALayer+setupLayerHierarchy.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/GradientRenderLayer.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ImageLayer.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/InfiniteOpaqueAnimationLayer.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/LayerModel+makeAnimationLayer.swift +59 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/MaskCompositionLayer.swift +139 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/PreCompLayer.swift +107 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/RepeaterLayer.swift +113 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ShapeItemLayer.swift +346 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ShapeLayer.swift +569 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/SolidLayer.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/TextLayer.swift +157 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/TransformLayer.swift +13 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/ValueProviderStore.swift +157 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/Collection+Diff.swift +267 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/Diffable.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/DiffableSection.swift +16 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/IndexChangeset.swift +187 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/SectionedChangeset.swift +22 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Logging/EpoxyLogger.swift +102 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/CallbackContextEpoxyModeled.swift +8 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelArrayBuilder.swift +48 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelProperty.swift +158 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelStorage.swift +88 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModeled.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/AnyEpoxyModelProperty.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/ClassReference.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/AnimatedProviding.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DataIDProviding.swift +58 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidDisplayProviding.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidEndDisplayingProviding.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidSelectProviding.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ErasedContentProviding.swift +49 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/MakeViewProviding.swift +61 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetBehaviorsProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetContentProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/StyleIDProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/TraitCollectionProviding.swift +14 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewDifferentiatorProviding.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewProviding.swift +13 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/WillDisplayProviding.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/ViewEpoxyModeled.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/README.md +30 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUIIntrinsicContentSizeInvalidator.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUILayoutMargins.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxyableView+SwiftUIView.swift +165 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/MeasuringViewRepresentable.swift +127 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/SwiftUIMeasurementContainer.swift +468 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/SwiftUIView.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIView+SwiftUIView.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIViewConfiguringSwiftUIView.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/BehaviorsConfigurableView.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/ContentConfigurableView.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/EpoxyableView.swift +5 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/StyledView.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/ViewType.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/LRUCache/LRUCache.swift +257 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/LRUCache/README.md +24 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/README.md +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+BackingConfiguration.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Deprecated.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Helpers.swift +361 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+MemoryFile.swift +205 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Progress.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Reading.swift +160 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+ReadingDeprecated.swift +50 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Writing.swift +403 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+WritingDeprecated.swift +95 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+ZIP64.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive.swift +404 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+Compression.swift +632 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+CompressionDeprecated.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+Serialization.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Date+ZIP.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry+Serialization.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry+ZIP64.swift +170 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry.swift +669 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIP.swift +405 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIPDeprecated.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/README.md +24 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/URL+ZIP.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/CompositionLayer.swift +177 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/ImageCompositionLayer.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/MaskContainerLayer.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/NullCompositionLayer.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/PreCompositionLayer.swift +137 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/ShapeCompositionLayer.swift +60 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/SolidCompositionLayer.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/TextCompositionLayer.swift +247 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/MainThreadAnimationLayer.swift +321 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CachedImageProvider.swift +56 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CompositionLayersInitializer.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CoreTextRenderLayer.swift +424 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/InvertedMatteLayer.swift +55 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerFontProvider.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerImageProvider.swift +52 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerTextProvider.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerTransformNode.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Extensions/ItemsExtension.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/NodeProperty.swift +62 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyNodeProperty.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyValueContainer.swift +26 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/KeypathSearchable.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/NodePropertyMap.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueContainer.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueProviders/GroupInterpolator.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueProviders/SingleValueProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/DropShadowNode.swift +102 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/LayerEffectNode.swift +25 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/RoundedCornersNode.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/TrimPathNode.swift +281 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/GroupOutputNode.swift +74 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/PassThroughOutputNode.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/PathOutputNode.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/FillRenderer.swift +69 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientFillRenderer.swift +253 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientStrokeRenderer.swift +64 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/LegacyGradientFillRenderer.swift +158 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/StrokeRenderer.swift +165 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/EllipseNode.swift +143 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/PolygonNode.swift +173 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/RectNode.swift +238 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/ShapeNode.swift +73 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/StarNode.swift +224 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderContainers/GroupNode.swift +162 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/FillNode.swift +88 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientFillNode.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientStrokeNode.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/StrokeNode.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/Text/TextAnimatorNode.swift +345 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/AnimatorNode.swift +197 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/PathNode.swift +20 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/RenderNode.swift +60 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeContainerLayer.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeRenderLayer.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/Asset.swift +51 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/AssetLibrary.swift +75 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/ImageAsset.swift +141 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/PrecompAsset.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DictionaryInitializable.swift +73 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieAnimation.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieImageProvider.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieManifest.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieUtils.swift +71 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Extensions/Bundle.swift +58 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Extensions/KeyedDecodingContainerExtensions.swift +71 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Keyframes/KeyframeData.swift +111 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Keyframes/KeyframeGroup.swift +265 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/DropShadowEffect.swift +52 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/ColorEffectValue.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/EffectValue.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/Vector1DEffectValue.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/LayerEffect.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerStyles/DropShadowStyle.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerStyles/LayerStyle.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/ImageLayerModel.swift +49 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/LayerModel.swift +266 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/PreCompLayerModel.swift +74 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/ShapeLayerModel.swift +50 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/SolidLayerModel.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/TextLayerModel.swift +65 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/DashPattern.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Marker.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Mask.swift +80 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Transform.swift +261 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Ellipse.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Fill.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/GradientFill.swift +142 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/GradientStroke.swift +244 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Group.swift +55 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Merge.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Rectangle.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Repeater.swift +181 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/RoundedCorners.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Shape.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/ShapeItem.swift +171 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/ShapeTransform.swift +202 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Star.swift +136 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Stroke.swift +144 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Trim.swift +90 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/Font.swift +67 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/Glyph.swift +94 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/TextAnimator.swift +240 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/TextDocument.swift +142 -0
- package/platforms/macos/src/vendor/Lottie/Private/RootAnimationLayer.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/AnimatorNodeDebugging.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/LayerDebugging.swift +231 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/TestHelpers.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/AnimationKeypathExtension.swift +303 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/BlendMode+Filter.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/CGColor+RGB.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/CGFloatExtensions.swift +152 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/DataExtension.swift +33 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/MathKit.swift +454 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/StringExtensions.swift +44 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/AnimationContext.swift +95 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/AnyEquatable.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/Binding+Map.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/View+ValueChanged.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/InterpolatableExtensions.swift +143 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/KeyframeExtensions.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/KeyframeInterpolator.swift +250 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/LottieAnimationSource.swift +51 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/BezierPath.swift +509 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/BezierPathRoundExtension.swift +163 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CGPointExtension.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/ColorExtension.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CompoundBezierPath.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CurveVertex.swift +190 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/PathElement.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/UnitBezier.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/VectorsExtensions.swift +368 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimation.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationHelpers.swift +317 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationLayer.swift +1582 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationView.swift +1090 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationViewInitializers.swift +226 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottiePlaybackMode.swift +266 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieView.swift +643 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/AnimationCacheProvider.swift +21 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/DefaultAnimationCache.swift +67 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/LRUAnimationCache.swift +11 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/LottieAnimationCache.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/DecodingStrategy.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/LottieConfiguration.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/LottieURLSession.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/ReducedMotionOption.swift +128 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/RenderingEngineOption.swift +117 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedButton.swift +128 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedControl.swift +248 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedSwitch.swift +271 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieButton.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieSwitch.swift +144 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieViewType.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/Cache/DotLottieCache.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/Cache/DotLottieCacheProvider.swift +21 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieConfiguration.swift +72 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieFile.swift +186 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieFileHelpers.swift +386 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/AnimationKeypath.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/AnyValueProvider.swift +132 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/ColorValueProvider.swift +96 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/FloatValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/GradientValueProvider.swift +138 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/PointValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/SizeValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/FontProvider/AnimationFontProvider.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Public/ImageProvider/AnimationImageProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/Keyframes/Interpolatable.swift +285 -0
- package/platforms/macos/src/vendor/Lottie/Public/Keyframes/Keyframe.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Public/Logging/LottieLogger.swift +138 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/AnimationTime.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/LottieColor.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/Vectors.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Public/TextProvider/AnimationTextProvider.swift +135 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/AnimationSubview.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/BundleImageProvider.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleAnimationKeypath.swift +33 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleAnimationView.swift +567 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleFontProvider.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleImageProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/FilepathImageProvider.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/LottieAnimationViewBase.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/UIColorExtension.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/AnimationSubview.macOS.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/BundleImageProvider.macOS.swift +90 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/FilepathImageProvider.macOS.swift +86 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/LottieAnimationViewBase.macOS.swift +102 -0
- package/src/Lottie.macos.tsrx +129 -0
- package/src/Lottie.tsrx +162 -0
- package/src/Lottie.web.tsrx +152 -0
- package/src/cx.mobile.ts +8 -0
- package/src/escape-props.ts +65 -0
- package/src/escape-props.web.ts +25 -0
- package/src/index.macos.ts +2 -0
- package/src/index.ts +2 -0
- package/src/index.web.ts +2 -0
- package/src/layout-child.ts +57 -0
- package/src/layout-child.web.ts +108 -0
- package/src/native-elements.d.ts +8 -0
- package/src/props.ts +133 -0
- package/src/references.d.ts +3 -0
- package/src/vendor/ui-lottie/LICENSE.md +21 -0
- package/src/vendor/ui-lottie/src/lottie/index.android.ts +447 -0
- package/src/vendor/ui-lottie/src/lottie/index.common.ts +84 -0
- package/src/vendor/ui-lottie/src/lottie/index.d.ts +133 -0
- package/src/vendor/ui-lottie/src/lottie/index.ios.ts +345 -0
- package/src/vendor/ui-lottie/src/lottie/typings/android.d.ts +4149 -0
- package/src/vendor/ui-lottie/src/lottie/typings/android.nativescript.d.ts +12 -0
- package/src/vendor/ui-lottie/src/lottie/typings/dotlottie.ios.d.ts +14 -0
- package/src/vendor/ui-lottie/src/lottie/typings/ios.d.ts +384 -0
- package/src/vendor/ui-lottie/src/lottie/utils.ts +9 -0
- package/types/generated/.tsrx-typegen-manifest.json +18 -0
- package/types/generated/Lottie.d.ts +7 -0
- package/types/generated/Lottie.web.d.ts +7 -0
- package/types/generated/cx.mobile.d.ts +6 -0
- package/types/generated/escape-props.d.ts +15 -0
- package/types/generated/escape-props.web.d.ts +5 -0
- package/types/generated/index.d.ts +2 -0
- package/types/generated/index.web.d.ts +2 -0
- package/types/generated/layout-child.d.ts +6 -0
- package/types/generated/layout-child.web.d.ts +15 -0
- package/types/generated/props.d.ts +110 -0
- package/types/generated/vendor/ui-lottie/src/lottie/index.common.d.ts +30 -0
- package/types/generated/vendor/ui-lottie/src/lottie/index.ios.d.ts +35 -0
- package/types/generated/vendor/ui-lottie/src/lottie/utils.d.ts +1 -0
- package/index.d.ts +0 -1
- package/index.js +0 -2
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
//
|
|
2
|
+
// FillShape.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/8/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - FillRule
|
|
9
|
+
|
|
10
|
+
enum FillRule: Int, Codable {
|
|
11
|
+
case none
|
|
12
|
+
case nonZeroWinding
|
|
13
|
+
case evenOdd
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// MARK: - Fill
|
|
17
|
+
|
|
18
|
+
final class Fill: ShapeItem {
|
|
19
|
+
|
|
20
|
+
// MARK: Lifecycle
|
|
21
|
+
|
|
22
|
+
required init(from decoder: Decoder) throws {
|
|
23
|
+
let container = try decoder.container(keyedBy: Fill.CodingKeys.self)
|
|
24
|
+
opacity = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .opacity)
|
|
25
|
+
color = try container.decode(KeyframeGroup<LottieColor>.self, forKey: .color)
|
|
26
|
+
fillRule = try container.decodeIfPresent(FillRule.self, forKey: .fillRule) ?? .nonZeroWinding
|
|
27
|
+
try super.init(from: decoder)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
required init(dictionary: [String: Any]) throws {
|
|
31
|
+
let opacityDictionary: [String: Any] = try dictionary.value(for: CodingKeys.opacity)
|
|
32
|
+
opacity = try KeyframeGroup<LottieVector1D>(dictionary: opacityDictionary)
|
|
33
|
+
let colorDictionary: [String: Any] = try dictionary.value(for: CodingKeys.color)
|
|
34
|
+
color = try KeyframeGroup<LottieColor>(dictionary: colorDictionary)
|
|
35
|
+
if
|
|
36
|
+
let fillRuleRawValue = dictionary[CodingKeys.fillRule.rawValue] as? Int,
|
|
37
|
+
let fillRule = FillRule(rawValue: fillRuleRawValue)
|
|
38
|
+
{
|
|
39
|
+
self.fillRule = fillRule
|
|
40
|
+
} else {
|
|
41
|
+
fillRule = .nonZeroWinding
|
|
42
|
+
}
|
|
43
|
+
try super.init(dictionary: dictionary)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// MARK: Internal
|
|
47
|
+
|
|
48
|
+
/// The opacity of the fill
|
|
49
|
+
let opacity: KeyframeGroup<LottieVector1D>
|
|
50
|
+
|
|
51
|
+
/// The color keyframes for the fill
|
|
52
|
+
let color: KeyframeGroup<LottieColor>
|
|
53
|
+
|
|
54
|
+
/// The fill rule to use when filling a path
|
|
55
|
+
let fillRule: FillRule
|
|
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(opacity, forKey: .opacity)
|
|
61
|
+
try container.encode(color, forKey: .color)
|
|
62
|
+
try container.encode(fillRule, forKey: .fillRule)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// MARK: Private
|
|
66
|
+
|
|
67
|
+
private enum CodingKeys: String, CodingKey {
|
|
68
|
+
case opacity = "o"
|
|
69
|
+
case color = "c"
|
|
70
|
+
case fillRule = "r"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// MARK: @unchecked Sendable
|
|
75
|
+
|
|
76
|
+
/// `Fill` 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 Fill: @unchecked Sendable { }
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
//
|
|
2
|
+
// GradientFill.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/8/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - GradientType
|
|
9
|
+
|
|
10
|
+
enum GradientType: Int, Codable, Sendable {
|
|
11
|
+
case none
|
|
12
|
+
case linear
|
|
13
|
+
case radial
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// MARK: - GradientFill
|
|
17
|
+
|
|
18
|
+
final class GradientFill: ShapeItem {
|
|
19
|
+
|
|
20
|
+
// MARK: Lifecycle
|
|
21
|
+
|
|
22
|
+
required init(from decoder: Decoder) throws {
|
|
23
|
+
let container = try decoder.container(keyedBy: GradientFill.CodingKeys.self)
|
|
24
|
+
opacity = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .opacity)
|
|
25
|
+
startPoint = try container.decode(KeyframeGroup<LottieVector3D>.self, forKey: .startPoint)
|
|
26
|
+
endPoint = try container.decode(KeyframeGroup<LottieVector3D>.self, forKey: .endPoint)
|
|
27
|
+
gradientType = try container.decode(GradientType.self, forKey: .gradientType)
|
|
28
|
+
highlightLength = try container.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .highlightLength)
|
|
29
|
+
highlightAngle = try container.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .highlightAngle)
|
|
30
|
+
fillRule = try container.decodeIfPresent(FillRule.self, forKey: .fillRule) ?? .nonZeroWinding
|
|
31
|
+
let colorsContainer = try container.nestedContainer(keyedBy: GradientDataKeys.self, forKey: .colors)
|
|
32
|
+
colors = try colorsContainer.decode(KeyframeGroup<[Double]>.self, forKey: .colors)
|
|
33
|
+
numberOfColors = try colorsContainer.decode(Int.self, forKey: .numberOfColors)
|
|
34
|
+
try super.init(from: decoder)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
required init(dictionary: [String: Any]) throws {
|
|
38
|
+
let opacityDictionary: [String: Any] = try dictionary.value(for: CodingKeys.opacity)
|
|
39
|
+
opacity = try KeyframeGroup<LottieVector1D>(dictionary: opacityDictionary)
|
|
40
|
+
let startPointDictionary: [String: Any] = try dictionary.value(for: CodingKeys.startPoint)
|
|
41
|
+
startPoint = try KeyframeGroup<LottieVector3D>(dictionary: startPointDictionary)
|
|
42
|
+
let endPointDictionary: [String: Any] = try dictionary.value(for: CodingKeys.endPoint)
|
|
43
|
+
endPoint = try KeyframeGroup<LottieVector3D>(dictionary: endPointDictionary)
|
|
44
|
+
let gradientRawType: Int = try dictionary.value(for: CodingKeys.gradientType)
|
|
45
|
+
guard let gradient = GradientType(rawValue: gradientRawType) else {
|
|
46
|
+
throw InitializableError.invalidInput()
|
|
47
|
+
}
|
|
48
|
+
gradientType = gradient
|
|
49
|
+
if let highlightLengthDictionary = dictionary[CodingKeys.highlightLength.rawValue] as? [String: Any] {
|
|
50
|
+
highlightLength = try? KeyframeGroup<LottieVector1D>(dictionary: highlightLengthDictionary)
|
|
51
|
+
} else {
|
|
52
|
+
highlightLength = nil
|
|
53
|
+
}
|
|
54
|
+
if let highlightAngleDictionary = dictionary[CodingKeys.highlightAngle.rawValue] as? [String: Any] {
|
|
55
|
+
highlightAngle = try? KeyframeGroup<LottieVector1D>(dictionary: highlightAngleDictionary)
|
|
56
|
+
} else {
|
|
57
|
+
highlightAngle = nil
|
|
58
|
+
}
|
|
59
|
+
let colorsDictionary: [String: Any] = try dictionary.value(for: CodingKeys.colors)
|
|
60
|
+
let nestedColorsDictionary: [String: Any] = try colorsDictionary.value(for: GradientDataKeys.colors)
|
|
61
|
+
colors = try KeyframeGroup<[Double]>(dictionary: nestedColorsDictionary)
|
|
62
|
+
numberOfColors = try colorsDictionary.value(for: GradientDataKeys.numberOfColors)
|
|
63
|
+
if
|
|
64
|
+
let fillRuleRawValue = dictionary[CodingKeys.fillRule.rawValue] as? Int,
|
|
65
|
+
let fillRule = FillRule(rawValue: fillRuleRawValue)
|
|
66
|
+
{
|
|
67
|
+
self.fillRule = fillRule
|
|
68
|
+
} else {
|
|
69
|
+
fillRule = .nonZeroWinding
|
|
70
|
+
}
|
|
71
|
+
try super.init(dictionary: dictionary)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// MARK: Internal
|
|
75
|
+
|
|
76
|
+
/// The opacity of the fill
|
|
77
|
+
let opacity: KeyframeGroup<LottieVector1D>
|
|
78
|
+
|
|
79
|
+
/// The start of the gradient
|
|
80
|
+
let startPoint: KeyframeGroup<LottieVector3D>
|
|
81
|
+
|
|
82
|
+
/// The end of the gradient
|
|
83
|
+
let endPoint: KeyframeGroup<LottieVector3D>
|
|
84
|
+
|
|
85
|
+
/// The type of gradient
|
|
86
|
+
let gradientType: GradientType
|
|
87
|
+
|
|
88
|
+
/// Gradient Highlight Length. Only if type is Radial
|
|
89
|
+
let highlightLength: KeyframeGroup<LottieVector1D>?
|
|
90
|
+
|
|
91
|
+
/// Highlight Angle. Only if type is Radial
|
|
92
|
+
let highlightAngle: KeyframeGroup<LottieVector1D>?
|
|
93
|
+
|
|
94
|
+
/// The number of color points in the gradient
|
|
95
|
+
let numberOfColors: Int
|
|
96
|
+
|
|
97
|
+
/// The Colors of the gradient.
|
|
98
|
+
let colors: KeyframeGroup<[Double]>
|
|
99
|
+
|
|
100
|
+
/// The fill rule to use when filling a path
|
|
101
|
+
let fillRule: FillRule
|
|
102
|
+
|
|
103
|
+
override func encode(to encoder: Encoder) throws {
|
|
104
|
+
try super.encode(to: encoder)
|
|
105
|
+
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
106
|
+
try container.encode(opacity, forKey: .opacity)
|
|
107
|
+
try container.encode(startPoint, forKey: .startPoint)
|
|
108
|
+
try container.encode(endPoint, forKey: .endPoint)
|
|
109
|
+
try container.encode(gradientType, forKey: .gradientType)
|
|
110
|
+
try container.encodeIfPresent(highlightLength, forKey: .highlightLength)
|
|
111
|
+
try container.encodeIfPresent(highlightAngle, forKey: .highlightAngle)
|
|
112
|
+
try container.encodeIfPresent(fillRule, forKey: .fillRule)
|
|
113
|
+
var colorsContainer = container.nestedContainer(keyedBy: GradientDataKeys.self, forKey: .colors)
|
|
114
|
+
try colorsContainer.encode(numberOfColors, forKey: .numberOfColors)
|
|
115
|
+
try colorsContainer.encode(colors, forKey: .colors)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// MARK: Private
|
|
119
|
+
|
|
120
|
+
private enum CodingKeys: String, CodingKey {
|
|
121
|
+
case opacity = "o"
|
|
122
|
+
case startPoint = "s"
|
|
123
|
+
case endPoint = "e"
|
|
124
|
+
case gradientType = "t"
|
|
125
|
+
case highlightLength = "h"
|
|
126
|
+
case highlightAngle = "a"
|
|
127
|
+
case colors = "g"
|
|
128
|
+
case fillRule = "r"
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
private enum GradientDataKeys: String, CodingKey {
|
|
132
|
+
case numberOfColors = "p"
|
|
133
|
+
case colors = "k"
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// MARK: @unchecked Sendable
|
|
138
|
+
|
|
139
|
+
/// `GradientFill` inherits `@unchecked Sendable` from `ShapeItem` and
|
|
140
|
+
/// we need to restate that here to avoid a warning in Xcode 16
|
|
141
|
+
// swiftlint:disable:next no_unchecked_sendable
|
|
142
|
+
extension GradientFill: @unchecked Sendable { }
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
//
|
|
2
|
+
// GradientStroke.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/8/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - LineCap
|
|
9
|
+
|
|
10
|
+
enum LineCap: Int, Codable, Sendable {
|
|
11
|
+
case none
|
|
12
|
+
case butt
|
|
13
|
+
case round
|
|
14
|
+
case square
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// MARK: - LineJoin
|
|
18
|
+
|
|
19
|
+
enum LineJoin: Int, Codable, Sendable {
|
|
20
|
+
case none
|
|
21
|
+
case miter
|
|
22
|
+
case round
|
|
23
|
+
case bevel
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// MARK: - GradientStroke
|
|
27
|
+
|
|
28
|
+
final class GradientStroke: ShapeItem {
|
|
29
|
+
|
|
30
|
+
// MARK: Lifecycle
|
|
31
|
+
|
|
32
|
+
required init(from decoder: Decoder) throws {
|
|
33
|
+
let container = try decoder.container(keyedBy: GradientStroke.CodingKeys.self)
|
|
34
|
+
opacity = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .opacity)
|
|
35
|
+
startPoint = try container.decode(KeyframeGroup<LottieVector3D>.self, forKey: .startPoint)
|
|
36
|
+
endPoint = try container.decode(KeyframeGroup<LottieVector3D>.self, forKey: .endPoint)
|
|
37
|
+
gradientType = try container.decode(GradientType.self, forKey: .gradientType)
|
|
38
|
+
highlightLength = try container.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .highlightLength)
|
|
39
|
+
highlightAngle = try container.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .highlightAngle)
|
|
40
|
+
width = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .width)
|
|
41
|
+
lineCap = try container.decodeIfPresent(LineCap.self, forKey: .lineCap) ?? .round
|
|
42
|
+
lineJoin = try container.decodeIfPresent(LineJoin.self, forKey: .lineJoin) ?? .round
|
|
43
|
+
miterLimit = try container.decodeIfPresent(Double.self, forKey: .miterLimit) ?? 4
|
|
44
|
+
// TODO Decode Color Objects instead of array.
|
|
45
|
+
let colorsContainer = try container.nestedContainer(keyedBy: GradientDataKeys.self, forKey: .colors)
|
|
46
|
+
colors = try colorsContainer.decode(KeyframeGroup<[Double]>.self, forKey: .colors)
|
|
47
|
+
numberOfColors = try colorsContainer.decode(Int.self, forKey: .numberOfColors)
|
|
48
|
+
dashPattern = try container.decodeIfPresent([DashElement].self, forKey: .dashPattern)
|
|
49
|
+
try super.init(from: decoder)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
required init(dictionary: [String: Any]) throws {
|
|
53
|
+
let opacityDictionary: [String: Any] = try dictionary.value(for: CodingKeys.opacity)
|
|
54
|
+
opacity = try KeyframeGroup<LottieVector1D>(dictionary: opacityDictionary)
|
|
55
|
+
let startPointDictionary: [String: Any] = try dictionary.value(for: CodingKeys.startPoint)
|
|
56
|
+
startPoint = try KeyframeGroup<LottieVector3D>(dictionary: startPointDictionary)
|
|
57
|
+
let endPointDictionary: [String: Any] = try dictionary.value(for: CodingKeys.endPoint)
|
|
58
|
+
endPoint = try KeyframeGroup<LottieVector3D>(dictionary: endPointDictionary)
|
|
59
|
+
let gradientRawType: Int = try dictionary.value(for: CodingKeys.gradientType)
|
|
60
|
+
guard let gradient = GradientType(rawValue: gradientRawType) else {
|
|
61
|
+
throw InitializableError.invalidInput()
|
|
62
|
+
}
|
|
63
|
+
gradientType = gradient
|
|
64
|
+
if let highlightLengthDictionary = dictionary[CodingKeys.highlightLength.rawValue] as? [String: Any] {
|
|
65
|
+
highlightLength = try? KeyframeGroup<LottieVector1D>(dictionary: highlightLengthDictionary)
|
|
66
|
+
} else {
|
|
67
|
+
highlightLength = nil
|
|
68
|
+
}
|
|
69
|
+
if let highlightAngleDictionary = dictionary[CodingKeys.highlightAngle.rawValue] as? [String: Any] {
|
|
70
|
+
highlightAngle = try? KeyframeGroup<LottieVector1D>(dictionary: highlightAngleDictionary)
|
|
71
|
+
} else {
|
|
72
|
+
highlightAngle = nil
|
|
73
|
+
}
|
|
74
|
+
let widthDictionary: [String: Any] = try dictionary.value(for: CodingKeys.width)
|
|
75
|
+
width = try KeyframeGroup<LottieVector1D>(dictionary: widthDictionary)
|
|
76
|
+
if
|
|
77
|
+
let lineCapRawValue = dictionary[CodingKeys.lineCap.rawValue] as? Int,
|
|
78
|
+
let lineCap = LineCap(rawValue: lineCapRawValue)
|
|
79
|
+
{
|
|
80
|
+
self.lineCap = lineCap
|
|
81
|
+
} else {
|
|
82
|
+
lineCap = .round
|
|
83
|
+
}
|
|
84
|
+
if
|
|
85
|
+
let lineJoinRawValue = dictionary[CodingKeys.lineJoin.rawValue] as? Int,
|
|
86
|
+
let lineJoin = LineJoin(rawValue: lineJoinRawValue)
|
|
87
|
+
{
|
|
88
|
+
self.lineJoin = lineJoin
|
|
89
|
+
} else {
|
|
90
|
+
lineJoin = .round
|
|
91
|
+
}
|
|
92
|
+
miterLimit = (try? dictionary.value(for: CodingKeys.miterLimit)) ?? 4
|
|
93
|
+
let colorsDictionary: [String: Any] = try dictionary.value(for: CodingKeys.colors)
|
|
94
|
+
let nestedColorsDictionary: [String: Any] = try colorsDictionary.value(for: GradientDataKeys.colors)
|
|
95
|
+
colors = try KeyframeGroup<[Double]>(dictionary: nestedColorsDictionary)
|
|
96
|
+
numberOfColors = try colorsDictionary.value(for: GradientDataKeys.numberOfColors)
|
|
97
|
+
let dashPatternDictionaries = dictionary[CodingKeys.dashPattern.rawValue] as? [[String: Any]]
|
|
98
|
+
dashPattern = try? dashPatternDictionaries?.map { try DashElement(dictionary: $0) }
|
|
99
|
+
try super.init(dictionary: dictionary)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
init(
|
|
103
|
+
name: String,
|
|
104
|
+
hidden: Bool,
|
|
105
|
+
opacity: KeyframeGroup<LottieVector1D>,
|
|
106
|
+
startPoint: KeyframeGroup<LottieVector3D>,
|
|
107
|
+
endPoint: KeyframeGroup<LottieVector3D>,
|
|
108
|
+
gradientType: GradientType,
|
|
109
|
+
highlightLength: KeyframeGroup<LottieVector1D>?,
|
|
110
|
+
highlightAngle: KeyframeGroup<LottieVector1D>?,
|
|
111
|
+
numberOfColors: Int,
|
|
112
|
+
colors: KeyframeGroup<[Double]>,
|
|
113
|
+
width: KeyframeGroup<LottieVector1D>,
|
|
114
|
+
lineCap: LineCap,
|
|
115
|
+
lineJoin: LineJoin,
|
|
116
|
+
miterLimit: Double,
|
|
117
|
+
dashPattern: [DashElement]?
|
|
118
|
+
) {
|
|
119
|
+
self.opacity = opacity
|
|
120
|
+
self.startPoint = startPoint
|
|
121
|
+
self.endPoint = endPoint
|
|
122
|
+
self.gradientType = gradientType
|
|
123
|
+
self.highlightLength = highlightLength
|
|
124
|
+
self.highlightAngle = highlightAngle
|
|
125
|
+
self.numberOfColors = numberOfColors
|
|
126
|
+
self.colors = colors
|
|
127
|
+
self.width = width
|
|
128
|
+
self.lineCap = lineCap
|
|
129
|
+
self.lineJoin = lineJoin
|
|
130
|
+
self.miterLimit = miterLimit
|
|
131
|
+
self.dashPattern = dashPattern
|
|
132
|
+
super.init(name: name, type: .gradientStroke, hidden: hidden)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// MARK: Internal
|
|
136
|
+
|
|
137
|
+
/// The opacity of the fill
|
|
138
|
+
let opacity: KeyframeGroup<LottieVector1D>
|
|
139
|
+
|
|
140
|
+
/// The start of the gradient
|
|
141
|
+
let startPoint: KeyframeGroup<LottieVector3D>
|
|
142
|
+
|
|
143
|
+
/// The end of the gradient
|
|
144
|
+
let endPoint: KeyframeGroup<LottieVector3D>
|
|
145
|
+
|
|
146
|
+
/// The type of gradient
|
|
147
|
+
let gradientType: GradientType
|
|
148
|
+
|
|
149
|
+
/// Gradient Highlight Length. Only if type is Radial
|
|
150
|
+
let highlightLength: KeyframeGroup<LottieVector1D>?
|
|
151
|
+
|
|
152
|
+
/// Highlight Angle. Only if type is Radial
|
|
153
|
+
let highlightAngle: KeyframeGroup<LottieVector1D>?
|
|
154
|
+
|
|
155
|
+
/// The number of color points in the gradient
|
|
156
|
+
let numberOfColors: Int
|
|
157
|
+
|
|
158
|
+
/// The Colors of the gradient.
|
|
159
|
+
let colors: KeyframeGroup<[Double]>
|
|
160
|
+
|
|
161
|
+
/// The width of the stroke
|
|
162
|
+
let width: KeyframeGroup<LottieVector1D>
|
|
163
|
+
|
|
164
|
+
/// Line Cap
|
|
165
|
+
let lineCap: LineCap
|
|
166
|
+
|
|
167
|
+
/// Line Join
|
|
168
|
+
let lineJoin: LineJoin
|
|
169
|
+
|
|
170
|
+
/// Miter Limit
|
|
171
|
+
let miterLimit: Double
|
|
172
|
+
|
|
173
|
+
/// The dash pattern of the stroke
|
|
174
|
+
let dashPattern: [DashElement]?
|
|
175
|
+
|
|
176
|
+
/// Creates a copy of this GradientStroke with the given updated width keyframes
|
|
177
|
+
func copy(width newWidth: KeyframeGroup<LottieVector1D>) -> GradientStroke {
|
|
178
|
+
GradientStroke(
|
|
179
|
+
name: name,
|
|
180
|
+
hidden: hidden,
|
|
181
|
+
opacity: opacity,
|
|
182
|
+
startPoint: startPoint,
|
|
183
|
+
endPoint: endPoint,
|
|
184
|
+
gradientType: gradientType,
|
|
185
|
+
highlightLength: highlightLength,
|
|
186
|
+
highlightAngle: highlightAngle,
|
|
187
|
+
numberOfColors: numberOfColors,
|
|
188
|
+
colors: colors,
|
|
189
|
+
width: newWidth,
|
|
190
|
+
lineCap: lineCap,
|
|
191
|
+
lineJoin: lineJoin,
|
|
192
|
+
miterLimit: miterLimit,
|
|
193
|
+
dashPattern: dashPattern
|
|
194
|
+
)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
override func encode(to encoder: Encoder) throws {
|
|
198
|
+
try super.encode(to: encoder)
|
|
199
|
+
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
200
|
+
try container.encode(opacity, forKey: .opacity)
|
|
201
|
+
try container.encode(startPoint, forKey: .startPoint)
|
|
202
|
+
try container.encode(endPoint, forKey: .endPoint)
|
|
203
|
+
try container.encode(gradientType, forKey: .gradientType)
|
|
204
|
+
try container.encodeIfPresent(highlightLength, forKey: .highlightLength)
|
|
205
|
+
try container.encodeIfPresent(highlightAngle, forKey: .highlightAngle)
|
|
206
|
+
try container.encode(width, forKey: .width)
|
|
207
|
+
try container.encode(lineCap, forKey: .lineCap)
|
|
208
|
+
try container.encode(lineJoin, forKey: .lineJoin)
|
|
209
|
+
try container.encode(miterLimit, forKey: .miterLimit)
|
|
210
|
+
var colorsContainer = container.nestedContainer(keyedBy: GradientDataKeys.self, forKey: .colors)
|
|
211
|
+
try colorsContainer.encode(numberOfColors, forKey: .numberOfColors)
|
|
212
|
+
try colorsContainer.encode(colors, forKey: .colors)
|
|
213
|
+
try container.encodeIfPresent(dashPattern, forKey: .dashPattern)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// MARK: Private
|
|
217
|
+
|
|
218
|
+
private enum CodingKeys: String, CodingKey {
|
|
219
|
+
case opacity = "o"
|
|
220
|
+
case startPoint = "s"
|
|
221
|
+
case endPoint = "e"
|
|
222
|
+
case gradientType = "t"
|
|
223
|
+
case highlightLength = "h"
|
|
224
|
+
case highlightAngle = "a"
|
|
225
|
+
case colors = "g"
|
|
226
|
+
case width = "w"
|
|
227
|
+
case lineCap = "lc"
|
|
228
|
+
case lineJoin = "lj"
|
|
229
|
+
case miterLimit = "ml"
|
|
230
|
+
case dashPattern = "d"
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
private enum GradientDataKeys: String, CodingKey {
|
|
234
|
+
case numberOfColors = "p"
|
|
235
|
+
case colors = "k"
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// MARK: @unchecked Sendable
|
|
240
|
+
|
|
241
|
+
/// `GradientStroke` inherits `@unchecked Sendable` from `ShapeItem` and
|
|
242
|
+
/// we need to restate that here to avoid a warning in Xcode 16
|
|
243
|
+
// swiftlint:disable:next no_unchecked_sendable
|
|
244
|
+
extension GradientStroke: @unchecked Sendable { }
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//
|
|
2
|
+
// GroupItem.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/8/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - Group
|
|
9
|
+
|
|
10
|
+
/// An item that define a a group of shape items
|
|
11
|
+
final class Group: ShapeItem {
|
|
12
|
+
|
|
13
|
+
// MARK: Lifecycle
|
|
14
|
+
|
|
15
|
+
required init(from decoder: Decoder) throws {
|
|
16
|
+
let container = try decoder.container(keyedBy: Group.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
|
+
init(items: [ShapeItem], name: String) {
|
|
28
|
+
self.items = items
|
|
29
|
+
super.init(name: name, type: .group, hidden: false)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// MARK: Internal
|
|
33
|
+
|
|
34
|
+
/// A list of shape items.
|
|
35
|
+
let items: [ShapeItem]
|
|
36
|
+
|
|
37
|
+
override func encode(to encoder: Encoder) throws {
|
|
38
|
+
try super.encode(to: encoder)
|
|
39
|
+
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
40
|
+
try container.encode(items, forKey: .items)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// MARK: Private
|
|
44
|
+
|
|
45
|
+
private enum CodingKeys: String, CodingKey {
|
|
46
|
+
case items = "it"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// MARK: @unchecked Sendable
|
|
51
|
+
|
|
52
|
+
/// `Group` inherits `@unchecked Sendable` from `ShapeItem` and
|
|
53
|
+
/// we need to restate that here to avoid a warning in Xcode 16
|
|
54
|
+
// swiftlint:disable:next no_unchecked_sendable
|
|
55
|
+
extension Group: @unchecked Sendable { }
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Merge.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/8/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - MergeMode
|
|
9
|
+
|
|
10
|
+
enum MergeMode: Int, Codable, Sendable {
|
|
11
|
+
case none
|
|
12
|
+
case merge
|
|
13
|
+
case add
|
|
14
|
+
case subtract
|
|
15
|
+
case intersect
|
|
16
|
+
case exclude
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// MARK: - Merge
|
|
20
|
+
|
|
21
|
+
final class Merge: ShapeItem {
|
|
22
|
+
|
|
23
|
+
// MARK: Lifecycle
|
|
24
|
+
|
|
25
|
+
required init(from decoder: Decoder) throws {
|
|
26
|
+
let container = try decoder.container(keyedBy: Merge.CodingKeys.self)
|
|
27
|
+
mode = try container.decode(MergeMode.self, forKey: .mode)
|
|
28
|
+
try super.init(from: decoder)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
required init(dictionary: [String: Any]) throws {
|
|
32
|
+
let modeRawType: Int = try dictionary.value(for: CodingKeys.mode)
|
|
33
|
+
guard let mode = MergeMode(rawValue: modeRawType) else {
|
|
34
|
+
throw InitializableError.invalidInput()
|
|
35
|
+
}
|
|
36
|
+
self.mode = mode
|
|
37
|
+
try super.init(dictionary: dictionary)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// MARK: Internal
|
|
41
|
+
|
|
42
|
+
/// The mode of the merge path
|
|
43
|
+
let mode: MergeMode
|
|
44
|
+
|
|
45
|
+
override func encode(to encoder: Encoder) throws {
|
|
46
|
+
try super.encode(to: encoder)
|
|
47
|
+
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
48
|
+
try container.encode(mode, forKey: .mode)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// MARK: Private
|
|
52
|
+
|
|
53
|
+
private enum CodingKeys: String, CodingKey {
|
|
54
|
+
case mode = "mm"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// MARK: @unchecked Sendable
|
|
59
|
+
|
|
60
|
+
/// `Merge` 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 Merge: @unchecked Sendable { }
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Rectangle.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/8/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - Rectangle
|
|
9
|
+
|
|
10
|
+
final class Rectangle: ShapeItem {
|
|
11
|
+
|
|
12
|
+
// MARK: Lifecycle
|
|
13
|
+
|
|
14
|
+
required init(from decoder: Decoder) throws {
|
|
15
|
+
let container = try decoder.container(keyedBy: Rectangle.CodingKeys.self)
|
|
16
|
+
direction = try container.decodeIfPresent(PathDirection.self, forKey: .direction) ?? .clockwise
|
|
17
|
+
position = try container.decode(KeyframeGroup<LottieVector3D>.self, forKey: .position)
|
|
18
|
+
size = try container.decode(KeyframeGroup<LottieVector3D>.self, forKey: .size)
|
|
19
|
+
cornerRadius = try container.decode(KeyframeGroup<LottieVector1D>.self, forKey: .cornerRadius)
|
|
20
|
+
try super.init(from: decoder)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
required init(dictionary: [String: Any]) throws {
|
|
24
|
+
if
|
|
25
|
+
let directionRawType = dictionary[CodingKeys.direction.rawValue] as? Int,
|
|
26
|
+
let direction = PathDirection(rawValue: directionRawType)
|
|
27
|
+
{
|
|
28
|
+
self.direction = direction
|
|
29
|
+
} else {
|
|
30
|
+
direction = .clockwise
|
|
31
|
+
}
|
|
32
|
+
let positionDictionary: [String: Any] = try dictionary.value(for: CodingKeys.position)
|
|
33
|
+
position = try KeyframeGroup<LottieVector3D>(dictionary: positionDictionary)
|
|
34
|
+
let sizeDictionary: [String: Any] = try dictionary.value(for: CodingKeys.size)
|
|
35
|
+
size = try KeyframeGroup<LottieVector3D>(dictionary: sizeDictionary)
|
|
36
|
+
let cornerRadiusDictionary: [String: Any] = try dictionary.value(for: CodingKeys.cornerRadius)
|
|
37
|
+
cornerRadius = try KeyframeGroup<LottieVector1D>(dictionary: cornerRadiusDictionary)
|
|
38
|
+
try super.init(dictionary: dictionary)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// MARK: Internal
|
|
42
|
+
|
|
43
|
+
/// The direction of the rect.
|
|
44
|
+
let direction: PathDirection
|
|
45
|
+
|
|
46
|
+
/// The position
|
|
47
|
+
let position: KeyframeGroup<LottieVector3D>
|
|
48
|
+
|
|
49
|
+
/// The size
|
|
50
|
+
let size: KeyframeGroup<LottieVector3D>
|
|
51
|
+
|
|
52
|
+
/// The Corner radius of the rectangle
|
|
53
|
+
let cornerRadius: KeyframeGroup<LottieVector1D>
|
|
54
|
+
|
|
55
|
+
override func encode(to encoder: Encoder) throws {
|
|
56
|
+
try super.encode(to: encoder)
|
|
57
|
+
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
58
|
+
try container.encode(direction, forKey: .direction)
|
|
59
|
+
try container.encode(position, forKey: .position)
|
|
60
|
+
try container.encode(size, forKey: .size)
|
|
61
|
+
try container.encode(cornerRadius, forKey: .cornerRadius)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// MARK: Private
|
|
65
|
+
|
|
66
|
+
private enum CodingKeys: String, CodingKey {
|
|
67
|
+
case direction = "d"
|
|
68
|
+
case position = "p"
|
|
69
|
+
case size = "s"
|
|
70
|
+
case cornerRadius = "r"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// MARK: @unchecked Sendable
|
|
75
|
+
|
|
76
|
+
/// `Rectangle` 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 Rectangle: @unchecked Sendable { }
|