@octane-xplat/lottie 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -16
- package/dist/native/index.js +10 -9
- package/dist/native/octane-client-build.json +1 -1
- package/dist/web/index.js +39 -25
- package/dist/web/octane-client-build.json +1 -1
- package/package.json +25 -3
- package/platforms/macos/LICENSE-EpoxyCore-Apache-2.0.txt +201 -0
- package/platforms/macos/LICENSE-LRUCache-MIT.txt +22 -0
- package/platforms/macos/LICENSE-Lottie-Apache-2.0.txt +201 -0
- package/platforms/macos/LICENSE-ZIPFoundation-MIT.txt +21 -0
- package/platforms/macos/UPSTREAM.md +13 -0
- package/platforms/macos/resources/PrivacyInfo.xcprivacy +23 -0
- package/platforms/macos/resources/THIRD-PARTY-NOTICES.txt +10 -0
- package/platforms/macos/src/XplatAppKitLottie.swift +246 -0
- package/platforms/macos/src/vendor/Lottie/PrivacyInfo.xcprivacy +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CAAnimation+TimingConfiguration.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CALayer+addAnimation.swift +476 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CombinedShapeAnimation.swift +92 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/CustomPathAnimation.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/DropShadowAnimation.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/EllipseAnimation.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/GradientAnimations.swift +287 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/LayerProperty.swift +440 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/OpacityAnimation.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/RectangleAnimation.swift +59 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/ShapeAnimation.swift +246 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/StarAnimation.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/StrokeAnimation.swift +96 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/TransformAnimations.swift +380 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Animations/VisibilityAnimation.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/CompatibilityTracker.swift +129 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/CoreAnimationLayer.swift +645 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/CALayer+fillBounds.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/KeyframeGroup+exactlyOneKeyframe.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/Keyframes+combined.swift +345 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Extensions/Keyframes+timeRemapping.swift +46 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/AnimationLayer.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/BaseAnimationLayer.swift +46 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/BaseCompositionLayer.swift +120 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/CALayer+setupLayerHierarchy.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/GradientRenderLayer.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ImageLayer.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/InfiniteOpaqueAnimationLayer.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/LayerModel+makeAnimationLayer.swift +59 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/MaskCompositionLayer.swift +139 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/PreCompLayer.swift +107 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/RepeaterLayer.swift +113 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ShapeItemLayer.swift +346 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/ShapeLayer.swift +569 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/SolidLayer.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/TextLayer.swift +157 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/Layers/TransformLayer.swift +13 -0
- package/platforms/macos/src/vendor/Lottie/Private/CoreAnimation/ValueProviderStore.swift +157 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/Collection+Diff.swift +267 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/Diffable.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/DiffableSection.swift +16 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/IndexChangeset.swift +187 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Diffing/SectionedChangeset.swift +22 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Logging/EpoxyLogger.swift +102 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/CallbackContextEpoxyModeled.swift +8 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelArrayBuilder.swift +48 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelProperty.swift +158 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModelStorage.swift +88 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/EpoxyModeled.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/AnyEpoxyModelProperty.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Internal/ClassReference.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/AnimatedProviding.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DataIDProviding.swift +58 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidDisplayProviding.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidEndDisplayingProviding.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/DidSelectProviding.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ErasedContentProviding.swift +49 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/MakeViewProviding.swift +61 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetBehaviorsProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/SetContentProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/StyleIDProviding.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/TraitCollectionProviding.swift +14 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewDifferentiatorProviding.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/ViewProviding.swift +13 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/Providers/WillDisplayProviding.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Model/ViewEpoxyModeled.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/README.md +30 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUIIntrinsicContentSizeInvalidator.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxySwiftUILayoutMargins.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/EpoxyableView+SwiftUIView.swift +165 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/MeasuringViewRepresentable.swift +127 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/LayoutUtilities/SwiftUIMeasurementContainer.swift +468 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/SwiftUIView.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIView+SwiftUIView.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/SwiftUI/UIViewConfiguringSwiftUIView.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/BehaviorsConfigurableView.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/ContentConfigurableView.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/EpoxyableView.swift +5 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/StyledView.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/EpoxyCore/Views/ViewType.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/LRUCache/LRUCache.swift +257 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/LRUCache/README.md +24 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/README.md +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+BackingConfiguration.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Deprecated.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Helpers.swift +361 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+MemoryFile.swift +205 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Progress.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Reading.swift +160 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+ReadingDeprecated.swift +50 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+Writing.swift +403 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+WritingDeprecated.swift +95 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive+ZIP64.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Archive.swift +404 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+Compression.swift +632 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+CompressionDeprecated.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Data+Serialization.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Date+ZIP.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry+Serialization.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry+ZIP64.swift +170 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/Entry.swift +669 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIP.swift +405 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/FileManager+ZIPDeprecated.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/README.md +24 -0
- package/platforms/macos/src/vendor/Lottie/Private/EmbeddedLibraries/ZipFoundation/URL+ZIP.swift +34 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/CompositionLayer.swift +177 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/ImageCompositionLayer.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/MaskContainerLayer.swift +191 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/NullCompositionLayer.swift +28 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/PreCompositionLayer.swift +137 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/ShapeCompositionLayer.swift +60 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/SolidCompositionLayer.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/CompLayers/TextCompositionLayer.swift +247 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/MainThreadAnimationLayer.swift +321 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CachedImageProvider.swift +56 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CompositionLayersInitializer.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/CoreTextRenderLayer.swift +424 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/InvertedMatteLayer.swift +55 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerFontProvider.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerImageProvider.swift +52 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerTextProvider.swift +38 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/LayerContainers/Utility/LayerTransformNode.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Extensions/ItemsExtension.swift +146 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/NodeProperty.swift +62 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyNodeProperty.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/AnyValueContainer.swift +26 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/KeypathSearchable.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/Protocols/NodePropertyMap.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueContainer.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueProviders/GroupInterpolator.swift +39 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/NodeProperties/ValueProviders/SingleValueProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/DropShadowNode.swift +102 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/LayerEffectNodes/LayerEffectNode.swift +25 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/RoundedCornersNode.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/ModifierNodes/TrimPathNode.swift +281 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/GroupOutputNode.swift +74 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/PassThroughOutputNode.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/PathOutputNode.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/FillRenderer.swift +69 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientFillRenderer.swift +253 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/GradientStrokeRenderer.swift +64 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/LegacyGradientFillRenderer.swift +158 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/OutputNodes/Renderables/StrokeRenderer.swift +165 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/EllipseNode.swift +143 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/PolygonNode.swift +173 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/RectNode.swift +238 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/ShapeNode.swift +73 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/PathNodes/StarNode.swift +224 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderContainers/GroupNode.swift +162 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/FillNode.swift +88 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientFillNode.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/GradientStrokeNode.swift +149 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/RenderNodes/StrokeNode.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Nodes/Text/TextAnimatorNode.swift +345 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/AnimatorNode.swift +197 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/PathNode.swift +20 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/Protocols/RenderNode.swift +60 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeContainerLayer.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Private/MainThread/NodeRenderSystem/RenderLayers/ShapeRenderLayer.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/Asset.swift +51 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/AssetLibrary.swift +75 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/ImageAsset.swift +141 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Assets/PrecompAsset.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DictionaryInitializable.swift +73 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieAnimation.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieImageProvider.swift +89 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieManifest.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/DotLottie/DotLottieUtils.swift +71 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Extensions/Bundle.swift +58 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Extensions/KeyedDecodingContainerExtensions.swift +71 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Keyframes/KeyframeData.swift +111 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Keyframes/KeyframeGroup.swift +265 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/DropShadowEffect.swift +52 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/ColorEffectValue.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/EffectValue.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/EffectValues/Vector1DEffectValue.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerEffects/LayerEffect.swift +103 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerStyles/DropShadowStyle.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/LayerStyles/LayerStyle.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/ImageLayerModel.swift +49 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/LayerModel.swift +266 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/PreCompLayerModel.swift +74 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/ShapeLayerModel.swift +50 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/SolidLayerModel.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Layers/TextLayerModel.swift +65 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/DashPattern.swift +42 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Marker.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Mask.swift +80 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Objects/Transform.swift +261 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Ellipse.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Fill.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/GradientFill.swift +142 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/GradientStroke.swift +244 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Group.swift +55 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Merge.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Rectangle.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Repeater.swift +181 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/RoundedCorners.swift +53 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Shape.swift +63 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/ShapeItem.swift +171 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/ShapeTransform.swift +202 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Star.swift +136 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Stroke.swift +144 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/ShapeItems/Trim.swift +90 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/Font.swift +67 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/Glyph.swift +94 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/TextAnimator.swift +240 -0
- package/platforms/macos/src/vendor/Lottie/Private/Model/Text/TextDocument.swift +142 -0
- package/platforms/macos/src/vendor/Lottie/Private/RootAnimationLayer.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/AnimatorNodeDebugging.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/LayerDebugging.swift +231 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/TestHelpers.swift +10 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/AnimationKeypathExtension.swift +303 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/BlendMode+Filter.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/CGColor+RGB.swift +45 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/CGFloatExtensions.swift +152 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/DataExtension.swift +33 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/MathKit.swift +454 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Extensions/StringExtensions.swift +44 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/AnimationContext.swift +95 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/AnyEquatable.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/Binding+Map.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Helpers/View+ValueChanged.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/InterpolatableExtensions.swift +143 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/KeyframeExtensions.swift +47 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Interpolatable/KeyframeInterpolator.swift +250 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/LottieAnimationSource.swift +51 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/BezierPath.swift +509 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/BezierPathRoundExtension.swift +163 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CGPointExtension.swift +35 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/ColorExtension.swift +101 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CompoundBezierPath.swift +169 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/CurveVertex.swift +190 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/PathElement.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/UnitBezier.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Private/Utility/Primitives/VectorsExtensions.swift +368 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimation.swift +179 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationHelpers.swift +317 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationLayer.swift +1582 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationView.swift +1090 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieAnimationViewInitializers.swift +226 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottiePlaybackMode.swift +266 -0
- package/platforms/macos/src/vendor/Lottie/Public/Animation/LottieView.swift +643 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/AnimationCacheProvider.swift +21 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/DefaultAnimationCache.swift +67 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/LRUAnimationCache.swift +11 -0
- package/platforms/macos/src/vendor/Lottie/Public/AnimationCache/LottieAnimationCache.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/DecodingStrategy.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/LottieConfiguration.swift +54 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/LottieURLSession.swift +31 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/ReducedMotionOption.swift +128 -0
- package/platforms/macos/src/vendor/Lottie/Public/Configuration/RenderingEngineOption.swift +117 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedButton.swift +128 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedControl.swift +248 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/AnimatedSwitch.swift +271 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieButton.swift +119 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieSwitch.swift +144 -0
- package/platforms/macos/src/vendor/Lottie/Public/Controls/LottieViewType.swift +79 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/Cache/DotLottieCache.swift +66 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/Cache/DotLottieCacheProvider.swift +21 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieConfiguration.swift +72 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieFile.swift +186 -0
- package/platforms/macos/src/vendor/Lottie/Public/DotLottie/DotLottieFileHelpers.swift +386 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/AnimationKeypath.swift +57 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/AnyValueProvider.swift +132 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/ColorValueProvider.swift +96 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/FloatValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/GradientValueProvider.swift +138 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/PointValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/DynamicProperties/ValueProviders/SizeValueProvider.swift +81 -0
- package/platforms/macos/src/vendor/Lottie/Public/FontProvider/AnimationFontProvider.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Public/ImageProvider/AnimationImageProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/Keyframes/Interpolatable.swift +285 -0
- package/platforms/macos/src/vendor/Lottie/Public/Keyframes/Keyframe.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Public/Logging/LottieLogger.swift +138 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/AnimationTime.swift +15 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/LottieColor.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/Primitives/Vectors.swift +36 -0
- package/platforms/macos/src/vendor/Lottie/Public/TextProvider/AnimationTextProvider.swift +135 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/AnimationSubview.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/BundleImageProvider.swift +98 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleAnimationKeypath.swift +33 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleAnimationView.swift +567 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleFontProvider.swift +41 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/Compatibility/CompatibleImageProvider.swift +43 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/FilepathImageProvider.swift +78 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/LottieAnimationViewBase.swift +85 -0
- package/platforms/macos/src/vendor/Lottie/Public/iOS/UIColorExtension.swift +23 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/AnimationSubview.macOS.swift +19 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/BundleImageProvider.macOS.swift +90 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/FilepathImageProvider.macOS.swift +86 -0
- package/platforms/macos/src/vendor/Lottie/Public/macOS/LottieAnimationViewBase.macOS.swift +102 -0
- package/src/Lottie.macos.tsrx +129 -0
- package/src/Lottie.tsrx +6 -4
- package/src/Lottie.web.tsrx +28 -11
- package/src/index.macos.ts +2 -0
- package/src/props.ts +6 -1
- package/types/generated/props.d.ts +5 -1
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
//
|
|
2
|
+
// TextAnimator.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/9/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - TextRangeUnit
|
|
9
|
+
|
|
10
|
+
enum TextRangeUnit: Int, RawRepresentable, Codable {
|
|
11
|
+
case percentage = 1
|
|
12
|
+
case index = 2
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// MARK: - TextAnimator
|
|
16
|
+
|
|
17
|
+
final class TextAnimator: Codable, DictionaryInitializable {
|
|
18
|
+
|
|
19
|
+
// MARK: Lifecycle
|
|
20
|
+
|
|
21
|
+
required init(from decoder: Decoder) throws {
|
|
22
|
+
let container = try decoder.container(keyedBy: TextAnimator.CodingKeys.self)
|
|
23
|
+
name = try container.decodeIfPresent(String.self, forKey: .name) ?? ""
|
|
24
|
+
|
|
25
|
+
let animatorContainer = try container.nestedContainer(keyedBy: TextAnimatorKeys.self, forKey: .textAnimator)
|
|
26
|
+
fillColor = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieColor>.self, forKey: .fillColor)
|
|
27
|
+
strokeColor = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieColor>.self, forKey: .strokeColor)
|
|
28
|
+
strokeWidth = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .strokeWidth)
|
|
29
|
+
tracking = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .tracking)
|
|
30
|
+
anchor = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .anchor)
|
|
31
|
+
position = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .position)
|
|
32
|
+
scale = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector3D>.self, forKey: .scale)
|
|
33
|
+
skew = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .skew)
|
|
34
|
+
skewAxis = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .skewAxis)
|
|
35
|
+
rotationX = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotationX)
|
|
36
|
+
rotationY = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotationY)
|
|
37
|
+
if let rotation = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotation) {
|
|
38
|
+
rotationZ = rotation
|
|
39
|
+
} else if let rotation = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .rotationZ) {
|
|
40
|
+
rotationZ = rotation
|
|
41
|
+
} else {
|
|
42
|
+
rotationZ = nil
|
|
43
|
+
}
|
|
44
|
+
opacity = try animatorContainer.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .opacity)
|
|
45
|
+
|
|
46
|
+
let selectorContainer = try? container.nestedContainer(keyedBy: TextSelectorKeys.self, forKey: .textSelector)
|
|
47
|
+
start = try? selectorContainer?.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .start)
|
|
48
|
+
end = try? selectorContainer?.decodeIfPresent(KeyframeGroup<LottieVector1D>.self, forKey: .end)
|
|
49
|
+
textRangeUnit = try? selectorContainer?.decodeIfPresent(TextRangeUnit.self, forKey: .textRangeUnits)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
init(dictionary: [String: Any]) throws {
|
|
53
|
+
name = (try? dictionary.value(for: CodingKeys.name)) ?? ""
|
|
54
|
+
|
|
55
|
+
let animatorDictionary: [String: Any] = try dictionary.value(for: CodingKeys.textAnimator)
|
|
56
|
+
if let fillColorDictionary = animatorDictionary[TextAnimatorKeys.fillColor.rawValue] as? [String: Any] {
|
|
57
|
+
fillColor = try? KeyframeGroup<LottieColor>(dictionary: fillColorDictionary)
|
|
58
|
+
} else {
|
|
59
|
+
fillColor = nil
|
|
60
|
+
}
|
|
61
|
+
if let strokeColorDictionary = animatorDictionary[TextAnimatorKeys.strokeColor.rawValue] as? [String: Any] {
|
|
62
|
+
strokeColor = try? KeyframeGroup<LottieColor>(dictionary: strokeColorDictionary)
|
|
63
|
+
} else {
|
|
64
|
+
strokeColor = nil
|
|
65
|
+
}
|
|
66
|
+
if let strokeWidthDictionary = animatorDictionary[TextAnimatorKeys.strokeWidth.rawValue] as? [String: Any] {
|
|
67
|
+
strokeWidth = try? KeyframeGroup<LottieVector1D>(dictionary: strokeWidthDictionary)
|
|
68
|
+
} else {
|
|
69
|
+
strokeWidth = nil
|
|
70
|
+
}
|
|
71
|
+
if let trackingDictionary = animatorDictionary[TextAnimatorKeys.tracking.rawValue] as? [String: Any] {
|
|
72
|
+
tracking = try? KeyframeGroup<LottieVector1D>(dictionary: trackingDictionary)
|
|
73
|
+
} else {
|
|
74
|
+
tracking = nil
|
|
75
|
+
}
|
|
76
|
+
if let anchorDictionary = animatorDictionary[TextAnimatorKeys.anchor.rawValue] as? [String: Any] {
|
|
77
|
+
anchor = try? KeyframeGroup<LottieVector3D>(dictionary: anchorDictionary)
|
|
78
|
+
} else {
|
|
79
|
+
anchor = nil
|
|
80
|
+
}
|
|
81
|
+
if let positionDictionary = animatorDictionary[TextAnimatorKeys.position.rawValue] as? [String: Any] {
|
|
82
|
+
position = try? KeyframeGroup<LottieVector3D>(dictionary: positionDictionary)
|
|
83
|
+
} else {
|
|
84
|
+
position = nil
|
|
85
|
+
}
|
|
86
|
+
if let scaleDictionary = animatorDictionary[TextAnimatorKeys.scale.rawValue] as? [String: Any] {
|
|
87
|
+
scale = try? KeyframeGroup<LottieVector3D>(dictionary: scaleDictionary)
|
|
88
|
+
} else {
|
|
89
|
+
scale = nil
|
|
90
|
+
}
|
|
91
|
+
if let skewDictionary = animatorDictionary[TextAnimatorKeys.skew.rawValue] as? [String: Any] {
|
|
92
|
+
skew = try? KeyframeGroup<LottieVector1D>(dictionary: skewDictionary)
|
|
93
|
+
} else {
|
|
94
|
+
skew = nil
|
|
95
|
+
}
|
|
96
|
+
if let skewAxisDictionary = animatorDictionary[TextAnimatorKeys.skewAxis.rawValue] as? [String: Any] {
|
|
97
|
+
skewAxis = try? KeyframeGroup<LottieVector1D>(dictionary: skewAxisDictionary)
|
|
98
|
+
} else {
|
|
99
|
+
skewAxis = nil
|
|
100
|
+
}
|
|
101
|
+
if let rotationDictionary = animatorDictionary[TextAnimatorKeys.rotationX.rawValue] as? [String: Any] {
|
|
102
|
+
rotationX = try? KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
103
|
+
} else {
|
|
104
|
+
rotationX = nil
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if let rotationDictionary = animatorDictionary[TextAnimatorKeys.rotationY.rawValue] as? [String: Any] {
|
|
108
|
+
rotationY = try? KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
109
|
+
} else {
|
|
110
|
+
rotationY = nil
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if let rotationDictionary = animatorDictionary[TextAnimatorKeys.rotation.rawValue] as? [String: Any] {
|
|
114
|
+
rotationZ = try? KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
115
|
+
} else if let rotationDictionary = animatorDictionary[TextAnimatorKeys.rotationZ.rawValue] as? [String: Any] {
|
|
116
|
+
rotationZ = try? KeyframeGroup<LottieVector1D>(dictionary: rotationDictionary)
|
|
117
|
+
} else {
|
|
118
|
+
rotationZ = nil
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if let opacityDictionary = animatorDictionary[TextAnimatorKeys.opacity.rawValue] as? [String: Any] {
|
|
122
|
+
opacity = try KeyframeGroup<LottieVector1D>(dictionary: opacityDictionary)
|
|
123
|
+
} else {
|
|
124
|
+
opacity = nil
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
let selectorDictionary: [String: Any] = try dictionary.value(for: CodingKeys.textSelector)
|
|
128
|
+
|
|
129
|
+
if let startDictionary = selectorDictionary[TextSelectorKeys.start.rawValue] as? [String: Any] {
|
|
130
|
+
start = try KeyframeGroup<LottieVector1D>(dictionary: startDictionary)
|
|
131
|
+
} else {
|
|
132
|
+
start = nil
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if let endDictionary = selectorDictionary[TextSelectorKeys.end.rawValue] as? [String: Any] {
|
|
136
|
+
end = try KeyframeGroup<LottieVector1D>(dictionary: endDictionary)
|
|
137
|
+
} else {
|
|
138
|
+
end = nil
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if let textRangeUnitValue = selectorDictionary[TextSelectorKeys.textRangeUnits.rawValue] as? Int {
|
|
142
|
+
textRangeUnit = TextRangeUnit(rawValue: textRangeUnitValue)
|
|
143
|
+
} else {
|
|
144
|
+
textRangeUnit = nil
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// MARK: Internal
|
|
149
|
+
|
|
150
|
+
let name: String
|
|
151
|
+
|
|
152
|
+
/// Anchor
|
|
153
|
+
let anchor: KeyframeGroup<LottieVector3D>?
|
|
154
|
+
|
|
155
|
+
/// Position
|
|
156
|
+
let position: KeyframeGroup<LottieVector3D>?
|
|
157
|
+
|
|
158
|
+
/// Scale
|
|
159
|
+
let scale: KeyframeGroup<LottieVector3D>?
|
|
160
|
+
|
|
161
|
+
/// Skew
|
|
162
|
+
let skew: KeyframeGroup<LottieVector1D>?
|
|
163
|
+
|
|
164
|
+
/// Skew Axis
|
|
165
|
+
let skewAxis: KeyframeGroup<LottieVector1D>?
|
|
166
|
+
|
|
167
|
+
/// Rotation on X axis
|
|
168
|
+
let rotationX: KeyframeGroup<LottieVector1D>?
|
|
169
|
+
|
|
170
|
+
/// Rotation on Y axis
|
|
171
|
+
let rotationY: KeyframeGroup<LottieVector1D>?
|
|
172
|
+
|
|
173
|
+
/// Rotation on Z axis
|
|
174
|
+
let rotationZ: KeyframeGroup<LottieVector1D>?
|
|
175
|
+
|
|
176
|
+
/// Opacity
|
|
177
|
+
let opacity: KeyframeGroup<LottieVector1D>?
|
|
178
|
+
|
|
179
|
+
/// Stroke Color
|
|
180
|
+
let strokeColor: KeyframeGroup<LottieColor>?
|
|
181
|
+
|
|
182
|
+
/// Fill Color
|
|
183
|
+
let fillColor: KeyframeGroup<LottieColor>?
|
|
184
|
+
|
|
185
|
+
/// Stroke Width
|
|
186
|
+
let strokeWidth: KeyframeGroup<LottieVector1D>?
|
|
187
|
+
|
|
188
|
+
/// Tracking
|
|
189
|
+
let tracking: KeyframeGroup<LottieVector1D>?
|
|
190
|
+
|
|
191
|
+
/// Start
|
|
192
|
+
let start: KeyframeGroup<LottieVector1D>?
|
|
193
|
+
|
|
194
|
+
/// End
|
|
195
|
+
let end: KeyframeGroup<LottieVector1D>?
|
|
196
|
+
|
|
197
|
+
/// The type of unit used by the start/end ranges
|
|
198
|
+
let textRangeUnit: TextRangeUnit?
|
|
199
|
+
|
|
200
|
+
func encode(to encoder: Encoder) throws {
|
|
201
|
+
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
202
|
+
var animatorContainer = container.nestedContainer(keyedBy: TextAnimatorKeys.self, forKey: .textAnimator)
|
|
203
|
+
try animatorContainer.encodeIfPresent(fillColor, forKey: .fillColor)
|
|
204
|
+
try animatorContainer.encodeIfPresent(strokeColor, forKey: .strokeColor)
|
|
205
|
+
try animatorContainer.encodeIfPresent(strokeWidth, forKey: .strokeWidth)
|
|
206
|
+
try animatorContainer.encodeIfPresent(tracking, forKey: .tracking)
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// MARK: Private
|
|
210
|
+
|
|
211
|
+
private enum CodingKeys: String, CodingKey {
|
|
212
|
+
case textSelector = "s"
|
|
213
|
+
case textAnimator = "a"
|
|
214
|
+
case name = "nm"
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
private enum TextSelectorKeys: String, CodingKey {
|
|
218
|
+
case start = "s"
|
|
219
|
+
case end = "e"
|
|
220
|
+
case offset = "o"
|
|
221
|
+
case textRangeUnits = "r"
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
private enum TextAnimatorKeys: String, CodingKey {
|
|
225
|
+
case fillColor = "fc"
|
|
226
|
+
case strokeColor = "sc"
|
|
227
|
+
case strokeWidth = "sw"
|
|
228
|
+
case tracking = "t"
|
|
229
|
+
case anchor = "a"
|
|
230
|
+
case position = "p"
|
|
231
|
+
case scale = "s"
|
|
232
|
+
case skew = "sk"
|
|
233
|
+
case skewAxis = "sa"
|
|
234
|
+
case rotation = "r"
|
|
235
|
+
case rotationX = "rx"
|
|
236
|
+
case rotationY = "ry"
|
|
237
|
+
case rotationZ = "rz"
|
|
238
|
+
case opacity = "o"
|
|
239
|
+
}
|
|
240
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
//
|
|
2
|
+
// TextDocument.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/9/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// MARK: - TextJustification
|
|
9
|
+
|
|
10
|
+
enum TextJustification: Int, Codable {
|
|
11
|
+
case left
|
|
12
|
+
case right
|
|
13
|
+
case center
|
|
14
|
+
case justifyLastLineLeft
|
|
15
|
+
case justifyLastLineRight
|
|
16
|
+
case justifyLastLineCenter
|
|
17
|
+
case justifyLastLineFull
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// MARK: - TextDocument
|
|
21
|
+
|
|
22
|
+
final class TextDocument: Codable, DictionaryInitializable, AnyInitializable {
|
|
23
|
+
|
|
24
|
+
// MARK: Lifecycle
|
|
25
|
+
|
|
26
|
+
required init(from decoder: Decoder) throws {
|
|
27
|
+
let container = try decoder.container(keyedBy: CodingKeys.self)
|
|
28
|
+
text = try container.decode(String.self, forKey: .text)
|
|
29
|
+
fontSize = try container.decode(Double.self, forKey: .fontSize)
|
|
30
|
+
fontFamily = try container.decode(String.self, forKey: .fontFamily)
|
|
31
|
+
justification = try container.decode(TextJustification.self, forKey: .justification)
|
|
32
|
+
tracking = try container.decode(Int.self, forKey: .tracking)
|
|
33
|
+
lineHeight = try container.decodeIfPresent(Double.self, forKey: .lineHeight) ?? 0
|
|
34
|
+
baseline = try container.decodeIfPresent(Double.self, forKey: .baseline)
|
|
35
|
+
fillColorData = try container.decodeIfPresent(LottieColor.self, forKey: .fillColorData)
|
|
36
|
+
strokeColorData = try container.decodeIfPresent(LottieColor.self, forKey: .strokeColorData)
|
|
37
|
+
strokeWidth = try container.decodeIfPresent(Double.self, forKey: .strokeWidth)
|
|
38
|
+
strokeOverFill = try container.decodeIfPresent(Bool.self, forKey: .strokeOverFill)
|
|
39
|
+
textFramePosition = try container.decodeIfPresent(LottieVector3D.self, forKey: .textFramePosition)
|
|
40
|
+
textFrameSize = try container.decodeIfPresent(LottieVector3D.self, forKey: .textFrameSize)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
init(dictionary: [String: Any]) throws {
|
|
44
|
+
text = try dictionary.value(for: CodingKeys.text)
|
|
45
|
+
fontSize = try dictionary.value(for: CodingKeys.fontSize)
|
|
46
|
+
fontFamily = try dictionary.value(for: CodingKeys.fontFamily)
|
|
47
|
+
let justificationValue: Int = try dictionary.value(for: CodingKeys.justification)
|
|
48
|
+
guard let justification = TextJustification(rawValue: justificationValue) else {
|
|
49
|
+
throw InitializableError.invalidInput()
|
|
50
|
+
}
|
|
51
|
+
self.justification = justification
|
|
52
|
+
tracking = try dictionary.value(for: CodingKeys.tracking)
|
|
53
|
+
lineHeight = (try? dictionary.value(for: CodingKeys.lineHeight)) ?? 0
|
|
54
|
+
baseline = try dictionary.value(for: CodingKeys.baseline)
|
|
55
|
+
if let fillColorRawValue = dictionary[CodingKeys.fillColorData.rawValue] {
|
|
56
|
+
fillColorData = try? LottieColor(value: fillColorRawValue)
|
|
57
|
+
} else {
|
|
58
|
+
fillColorData = nil
|
|
59
|
+
}
|
|
60
|
+
if let strokeColorRawValue = dictionary[CodingKeys.strokeColorData.rawValue] {
|
|
61
|
+
strokeColorData = try? LottieColor(value: strokeColorRawValue)
|
|
62
|
+
} else {
|
|
63
|
+
strokeColorData = nil
|
|
64
|
+
}
|
|
65
|
+
strokeWidth = try? dictionary.value(for: CodingKeys.strokeWidth)
|
|
66
|
+
strokeOverFill = try? dictionary.value(for: CodingKeys.strokeOverFill)
|
|
67
|
+
if let textFramePositionRawValue = dictionary[CodingKeys.textFramePosition.rawValue] {
|
|
68
|
+
textFramePosition = try? LottieVector3D(value: textFramePositionRawValue)
|
|
69
|
+
} else {
|
|
70
|
+
textFramePosition = nil
|
|
71
|
+
}
|
|
72
|
+
if let textFrameSizeRawValue = dictionary[CodingKeys.textFrameSize.rawValue] {
|
|
73
|
+
textFrameSize = try? LottieVector3D(value: textFrameSizeRawValue)
|
|
74
|
+
} else {
|
|
75
|
+
textFrameSize = nil
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
convenience init(value: Any) throws {
|
|
80
|
+
guard let dictionary = value as? [String: Any] else {
|
|
81
|
+
throw InitializableError.invalidInput()
|
|
82
|
+
}
|
|
83
|
+
try self.init(dictionary: dictionary)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// MARK: Internal
|
|
87
|
+
|
|
88
|
+
/// The Text
|
|
89
|
+
let text: String
|
|
90
|
+
|
|
91
|
+
/// The Font size
|
|
92
|
+
let fontSize: Double
|
|
93
|
+
|
|
94
|
+
/// The Font Family
|
|
95
|
+
let fontFamily: String
|
|
96
|
+
|
|
97
|
+
/// Justification
|
|
98
|
+
let justification: TextJustification
|
|
99
|
+
|
|
100
|
+
/// Tracking
|
|
101
|
+
let tracking: Int
|
|
102
|
+
|
|
103
|
+
/// Line Height
|
|
104
|
+
let lineHeight: Double
|
|
105
|
+
|
|
106
|
+
/// Baseline
|
|
107
|
+
let baseline: Double?
|
|
108
|
+
|
|
109
|
+
/// Fill Color data
|
|
110
|
+
let fillColorData: LottieColor?
|
|
111
|
+
|
|
112
|
+
/// Scroke Color data
|
|
113
|
+
let strokeColorData: LottieColor?
|
|
114
|
+
|
|
115
|
+
/// Stroke Width
|
|
116
|
+
let strokeWidth: Double?
|
|
117
|
+
|
|
118
|
+
/// Stroke Over Fill
|
|
119
|
+
let strokeOverFill: Bool?
|
|
120
|
+
|
|
121
|
+
let textFramePosition: LottieVector3D?
|
|
122
|
+
|
|
123
|
+
let textFrameSize: LottieVector3D?
|
|
124
|
+
|
|
125
|
+
// MARK: Private
|
|
126
|
+
|
|
127
|
+
private enum CodingKeys: String, CodingKey {
|
|
128
|
+
case text = "t"
|
|
129
|
+
case fontSize = "s"
|
|
130
|
+
case fontFamily = "f"
|
|
131
|
+
case justification = "j"
|
|
132
|
+
case tracking = "tr"
|
|
133
|
+
case lineHeight = "lh"
|
|
134
|
+
case baseline = "ls"
|
|
135
|
+
case fillColorData = "fc"
|
|
136
|
+
case strokeColorData = "sc"
|
|
137
|
+
case strokeWidth = "sw"
|
|
138
|
+
case strokeOverFill = "of"
|
|
139
|
+
case textFramePosition = "ps"
|
|
140
|
+
case textFrameSize = "sz"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Created by Cal Stephens on 12/13/21.
|
|
2
|
+
// Copyright © 2021 Airbnb Inc. All rights reserved.
|
|
3
|
+
|
|
4
|
+
import QuartzCore
|
|
5
|
+
|
|
6
|
+
// MARK: - RootAnimationLayer
|
|
7
|
+
|
|
8
|
+
/// A root `CALayer` responsible for playing a Lottie animation
|
|
9
|
+
protocol RootAnimationLayer: CALayer {
|
|
10
|
+
var lottieAnimationLayer: LottieAnimationLayer? { get set }
|
|
11
|
+
|
|
12
|
+
var currentFrame: AnimationFrameTime { get set }
|
|
13
|
+
var renderScale: CGFloat { get set }
|
|
14
|
+
var respectAnimationFrameRate: Bool { get set }
|
|
15
|
+
|
|
16
|
+
var _animationLayers: [CALayer] { get }
|
|
17
|
+
var imageProvider: AnimationImageProvider { get set }
|
|
18
|
+
var textProvider: AnimationKeypathTextProvider { get set }
|
|
19
|
+
var fontProvider: AnimationFontProvider { get set }
|
|
20
|
+
|
|
21
|
+
/// The `CAAnimation` key corresponding to the primary animation.
|
|
22
|
+
/// - `LottieAnimationView` uses this key to check if the animation is still active
|
|
23
|
+
var primaryAnimationKey: AnimationKey { get }
|
|
24
|
+
|
|
25
|
+
/// Whether or not this layer is currently playing an animation
|
|
26
|
+
/// - If the layer returns `nil`, `LottieAnimationView` determines if an animation
|
|
27
|
+
/// is playing by checking if there is an active animation for `primaryAnimationKey`
|
|
28
|
+
var isAnimationPlaying: Bool? { get }
|
|
29
|
+
|
|
30
|
+
/// Instructs this layer to remove all `CAAnimation`s,
|
|
31
|
+
/// other than the `CAAnimation` managed by `LottieAnimationView` (if applicable)
|
|
32
|
+
func removeAnimations()
|
|
33
|
+
|
|
34
|
+
func reloadImages()
|
|
35
|
+
func forceDisplayUpdate()
|
|
36
|
+
func logHierarchyKeypaths()
|
|
37
|
+
func allHierarchyKeypaths() -> [String]
|
|
38
|
+
func setValueProvider(_ valueProvider: AnyValueProvider, keypath: AnimationKeypath)
|
|
39
|
+
func removeValueProvider(for keypath: AnimationKeypath)
|
|
40
|
+
func getValue(for keypath: AnimationKeypath, atFrame: AnimationFrameTime?) -> Any?
|
|
41
|
+
func getOriginalValue(for keypath: AnimationKeypath, atFrame: AnimationFrameTime?) -> Any?
|
|
42
|
+
|
|
43
|
+
func layer(for keypath: AnimationKeypath) -> CALayer?
|
|
44
|
+
func animatorNodes(for keypath: AnimationKeypath) -> [AnimatorNode]?
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// MARK: - AnimationKey
|
|
48
|
+
|
|
49
|
+
enum AnimationKey {
|
|
50
|
+
/// The primary animation and its key should be managed by `LottieAnimationView`
|
|
51
|
+
case managed
|
|
52
|
+
/// The primary animation always uses the given key
|
|
53
|
+
case specific(String)
|
|
54
|
+
}
|
package/platforms/macos/src/vendor/Lottie/Private/Utility/Debugging/AnimatorNodeDebugging.swift
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// AnimatorNodeDebugging.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/18/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
extension AnimatorNode {
|
|
9
|
+
|
|
10
|
+
func printNodeTree() {
|
|
11
|
+
parentNode?.printNodeTree()
|
|
12
|
+
LottieLogger.shared.info(String(describing: type(of: self)))
|
|
13
|
+
|
|
14
|
+
if let group = self as? GroupNode {
|
|
15
|
+
LottieLogger.shared.info("* |Children")
|
|
16
|
+
group.rootNode?.printNodeTree()
|
|
17
|
+
LottieLogger.shared.info("*")
|
|
18
|
+
} else {
|
|
19
|
+
LottieLogger.shared.info("|")
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
//
|
|
2
|
+
// LayerDebugging.swift
|
|
3
|
+
// lottie-swift
|
|
4
|
+
//
|
|
5
|
+
// Created by Brandon Withrow on 1/24/19.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#if DEBUG
|
|
9
|
+
|
|
10
|
+
import QuartzCore
|
|
11
|
+
|
|
12
|
+
// MARK: - LayerDebugStyle
|
|
13
|
+
|
|
14
|
+
struct LayerDebugStyle {
|
|
15
|
+
let anchorColor: CGColor
|
|
16
|
+
let boundsColor: CGColor
|
|
17
|
+
let anchorWidth: CGFloat
|
|
18
|
+
let boundsWidth: CGFloat
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// MARK: - LayerDebugging
|
|
22
|
+
|
|
23
|
+
protocol LayerDebugging {
|
|
24
|
+
var debugStyle: LayerDebugStyle { get }
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// MARK: - CustomLayerDebugging
|
|
28
|
+
|
|
29
|
+
protocol CustomLayerDebugging {
|
|
30
|
+
func layerForDebugging() -> CALayer
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// MARK: - DebugLayer
|
|
34
|
+
|
|
35
|
+
final class DebugLayer: CALayer {
|
|
36
|
+
init(style: LayerDebugStyle) {
|
|
37
|
+
super.init()
|
|
38
|
+
zPosition = 1000
|
|
39
|
+
bounds = CGRect(x: 0, y: 0, width: style.anchorWidth, height: style.anchorWidth)
|
|
40
|
+
backgroundColor = style.anchorColor
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
required init?(coder _: NSCoder) {
|
|
44
|
+
fatalError("init(coder:) has not been implemented")
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
extension CALayer {
|
|
49
|
+
|
|
50
|
+
@nonobjc
|
|
51
|
+
public func logLayerTree(withIndent: Int = 0) {
|
|
52
|
+
var string = ""
|
|
53
|
+
for _ in 0...withIndent {
|
|
54
|
+
string = string + " "
|
|
55
|
+
}
|
|
56
|
+
string = string + "|_" + String(describing: self)
|
|
57
|
+
LottieLogger.shared.info(string)
|
|
58
|
+
if let sublayers {
|
|
59
|
+
for sublayer in sublayers {
|
|
60
|
+
sublayer.logLayerTree(withIndent: withIndent + 1)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// MARK: - CompositionLayer + CustomLayerDebugging
|
|
68
|
+
|
|
69
|
+
extension CompositionLayer: CustomLayerDebugging {
|
|
70
|
+
func layerForDebugging() -> CALayer {
|
|
71
|
+
contentsLayer
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
extension CALayer {
|
|
76
|
+
|
|
77
|
+
@nonobjc
|
|
78
|
+
func setDebuggingState(visible: Bool) {
|
|
79
|
+
var sublayers = sublayers
|
|
80
|
+
if let cust = self as? CustomLayerDebugging {
|
|
81
|
+
sublayers = cust.layerForDebugging().sublayers
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if let sublayers {
|
|
85
|
+
for i in 0..<sublayers.count {
|
|
86
|
+
if let debugLayer = sublayers[i] as? DebugLayer {
|
|
87
|
+
debugLayer.removeFromSuperlayer()
|
|
88
|
+
break
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if let sublayers {
|
|
94
|
+
for sublayer in sublayers {
|
|
95
|
+
sublayer.setDebuggingState(visible: visible)
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if visible {
|
|
100
|
+
let style: LayerDebugStyle =
|
|
101
|
+
if let layerDebugging = self as? LayerDebugging {
|
|
102
|
+
layerDebugging.debugStyle
|
|
103
|
+
} else {
|
|
104
|
+
LayerDebugStyle.defaultStyle()
|
|
105
|
+
}
|
|
106
|
+
let debugLayer = DebugLayer(style: style)
|
|
107
|
+
var container = self
|
|
108
|
+
if let cust = self as? CustomLayerDebugging {
|
|
109
|
+
container = cust.layerForDebugging()
|
|
110
|
+
}
|
|
111
|
+
container.addSublayer(debugLayer)
|
|
112
|
+
debugLayer.position = .zero
|
|
113
|
+
borderWidth = style.boundsWidth
|
|
114
|
+
borderColor = style.boundsColor
|
|
115
|
+
} else {
|
|
116
|
+
borderWidth = 0
|
|
117
|
+
borderColor = nil
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// MARK: - MainThreadAnimationLayer + LayerDebugging
|
|
123
|
+
|
|
124
|
+
extension MainThreadAnimationLayer: LayerDebugging {
|
|
125
|
+
var debugStyle: LayerDebugStyle {
|
|
126
|
+
LayerDebugStyle.topLayerStyle()
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// MARK: - NullCompositionLayer + LayerDebugging
|
|
131
|
+
|
|
132
|
+
extension NullCompositionLayer: LayerDebugging {
|
|
133
|
+
var debugStyle: LayerDebugStyle {
|
|
134
|
+
LayerDebugStyle.nullLayerStyle()
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// MARK: - ShapeCompositionLayer + LayerDebugging
|
|
139
|
+
|
|
140
|
+
extension ShapeCompositionLayer: LayerDebugging {
|
|
141
|
+
var debugStyle: LayerDebugStyle {
|
|
142
|
+
LayerDebugStyle.shapeLayerStyle()
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// MARK: - ShapeRenderLayer + LayerDebugging
|
|
147
|
+
|
|
148
|
+
extension ShapeRenderLayer: LayerDebugging {
|
|
149
|
+
var debugStyle: LayerDebugStyle {
|
|
150
|
+
LayerDebugStyle.shapeRenderLayerStyle()
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
extension LayerDebugStyle {
|
|
155
|
+
static func defaultStyle() -> LayerDebugStyle {
|
|
156
|
+
let anchorColor = CGColor.rgb(1, 0, 0)
|
|
157
|
+
let boundsColor = CGColor.rgb(1, 1, 0)
|
|
158
|
+
return LayerDebugStyle(
|
|
159
|
+
anchorColor: anchorColor,
|
|
160
|
+
boundsColor: boundsColor,
|
|
161
|
+
anchorWidth: 10,
|
|
162
|
+
boundsWidth: 2
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
static func topLayerStyle() -> LayerDebugStyle {
|
|
167
|
+
let anchorColor = CGColor.rgba(1, 0.5, 0, 0)
|
|
168
|
+
let boundsColor = CGColor.rgb(0, 1, 0)
|
|
169
|
+
|
|
170
|
+
return LayerDebugStyle(
|
|
171
|
+
anchorColor: anchorColor,
|
|
172
|
+
boundsColor: boundsColor,
|
|
173
|
+
anchorWidth: 10,
|
|
174
|
+
boundsWidth: 2
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
static func nullLayerStyle() -> LayerDebugStyle {
|
|
179
|
+
let anchorColor = CGColor.rgba(0, 0, 1, 0)
|
|
180
|
+
let boundsColor = CGColor.rgb(0, 1, 0)
|
|
181
|
+
|
|
182
|
+
return LayerDebugStyle(
|
|
183
|
+
anchorColor: anchorColor,
|
|
184
|
+
boundsColor: boundsColor,
|
|
185
|
+
anchorWidth: 10,
|
|
186
|
+
boundsWidth: 2
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
static func shapeLayerStyle() -> LayerDebugStyle {
|
|
191
|
+
let anchorColor = CGColor.rgba(0, 1, 0, 0)
|
|
192
|
+
let boundsColor = CGColor.rgb(0, 1, 0)
|
|
193
|
+
|
|
194
|
+
return LayerDebugStyle(
|
|
195
|
+
anchorColor: anchorColor,
|
|
196
|
+
boundsColor: boundsColor,
|
|
197
|
+
anchorWidth: 10,
|
|
198
|
+
boundsWidth: 2
|
|
199
|
+
)
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
static func shapeRenderLayerStyle() -> LayerDebugStyle {
|
|
203
|
+
let anchorColor = CGColor.rgba(0, 1, 1, 0)
|
|
204
|
+
let boundsColor = CGColor.rgb(0, 1, 0)
|
|
205
|
+
|
|
206
|
+
return LayerDebugStyle(
|
|
207
|
+
anchorColor: anchorColor,
|
|
208
|
+
boundsColor: boundsColor,
|
|
209
|
+
anchorWidth: 10,
|
|
210
|
+
boundsWidth: 2
|
|
211
|
+
)
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
extension [LayerModel] {
|
|
216
|
+
|
|
217
|
+
var parents: [Int] {
|
|
218
|
+
var array = [Int]()
|
|
219
|
+
for layer in self {
|
|
220
|
+
if let parent = layer.parent {
|
|
221
|
+
array.append(parent)
|
|
222
|
+
} else {
|
|
223
|
+
array.append(-1)
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return array
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
#endif
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Created by Cal Stephens on 1/28/22.
|
|
2
|
+
// Copyright © 2022 Airbnb Inc. All rights reserved.
|
|
3
|
+
|
|
4
|
+
enum TestHelpers {
|
|
5
|
+
/// Whether or not snapshot tests are currently running in a test target
|
|
6
|
+
static var snapshotTestsAreRunning = false
|
|
7
|
+
|
|
8
|
+
/// Whether or not performance tests are currently running in a test target
|
|
9
|
+
static var performanceTestsAreRunning = false
|
|
10
|
+
}
|