reacthub-pixitweenjs 0.2.109-alpha.7 → 0.3.0-alpha.4
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/LICENSE +8 -16
- package/LICENSE.md +79 -239
- package/README.md +253 -106
- package/dist/components/AepComposition/Aep3DPostFx.d.ts +7 -0
- package/dist/components/AepComposition/Aep3DPrecompPlane.d.ts +9 -0
- package/dist/components/AepComposition/Aep3DScene.d.ts +14 -0
- package/dist/components/AepComposition/Aep3DShapeMesh.d.ts +13 -0
- package/dist/components/AepComposition/Aep3DTextMesh.d.ts +17 -0
- package/dist/components/AepComposition/AepAssetResolver.d.ts +13 -0
- package/dist/components/AepComposition/AepAudioLayer.d.ts +34 -0
- package/dist/components/AepComposition/AepComposition.d.ts +18 -0
- package/dist/components/AepComposition/AepLayerProvider.d.ts +30 -0
- package/dist/components/AepComposition/AepLayerRouter.d.ts +5 -0
- package/dist/components/AepComposition/AepMsdfTextMesh.d.ts +17 -0
- package/dist/components/AepComposition/AepPrecompRenderContext.d.ts +23 -0
- package/dist/components/AepComposition/AepPrecompRenderer.d.ts +8 -0
- package/dist/components/AepComposition/AepTextOverrideContext.d.ts +8 -0
- package/dist/components/AepComposition/AepThemeContext.d.ts +8 -0
- package/dist/components/AepComposition/AudioPlaybackManager.d.ts +38 -0
- package/dist/components/AepComposition/composeTransform3D.d.ts +27 -0
- package/dist/components/AepComposition/index.d.ts +42 -0
- package/dist/components/AepComposition/matteSourceIds.d.ts +2 -0
- package/dist/components/AepComposition/model3d/Pixi3DModelLayer.d.ts +9 -0
- package/dist/components/AepComposition/model3d/ThreeOffscreenRenderer.d.ts +49 -0
- package/dist/components/AepComposition/model3d/framing.d.ts +30 -0
- package/dist/components/AepComposition/model3d/geometry.d.ts +27 -0
- package/dist/components/AepComposition/model3d/index.d.ts +14 -0
- package/dist/components/AepComposition/model3d/lighting.d.ts +40 -0
- package/dist/components/AepComposition/model3d/readiness.d.ts +17 -0
- package/dist/components/AepComposition/model3d/sampleModel3D.d.ts +40 -0
- package/dist/components/AepComposition/msdfAtlasRegistry.d.ts +16 -0
- package/dist/components/AepComposition/pathToThreeShape.d.ts +4 -0
- package/dist/components/AepComposition/resolveParentChain.d.ts +3 -0
- package/dist/components/AepComposition/resolvePostFxList.d.ts +2 -0
- package/dist/components/AepComposition/shouldSplitText.d.ts +26 -0
- package/dist/components/AepComposition/threeTextureFromPixi.d.ts +8 -0
- package/dist/components/AepComposition/useAepLayerTransform.d.ts +18 -0
- package/dist/components/AepComposition/useAepLayerTransform3D.d.ts +8 -0
- package/dist/components/AepComposition/useMsdfAtlasRegistry.d.ts +6 -0
- package/dist/components/AepComposition/usePixiRenderTexture.d.ts +14 -0
- package/dist/components/AepComposition/useResolveAsset.d.ts +8 -0
- package/dist/components/AepMask/AepMaskContainer.d.ts +9 -0
- package/dist/components/AepMask/PixiTrackMatte.d.ts +10 -0
- package/dist/components/AepMask/drawAepMask.d.ts +3 -0
- package/dist/components/AepMask/index.d.ts +5 -0
- package/dist/components/PixiAudioSprite/HowlerAudioSprite.d.ts +12 -8
- package/dist/components/PixiAudioSprite/PixiAudioSprite.d.ts +43 -3
- package/dist/components/PixiAudioSprite/index.d.ts +3 -0
- package/dist/components/PixiAudioSprite/useAudioVisualizer.d.ts +30 -15
- package/dist/components/PixiAudioSprite/wave-config.d.ts +0 -1
- package/dist/components/PixiCaptionsTrack/PixiCaptionsTrack.d.ts +86 -0
- package/dist/components/PixiCaptionsTrack/index.d.ts +5 -0
- package/dist/components/PixiCaptionsTrack/useCaptionPlayhead.d.ts +31 -0
- package/dist/components/PixiCaptionsTrack/useCaptionStyles.d.ts +45 -0
- package/dist/components/PixiCaptionsTrack/useEmojiTextures.d.ts +8 -0
- package/dist/components/PixiGifSprite/PixiGifGsapSync.d.ts +11 -10
- package/dist/components/PixiImageSprite/PixiImageSprite.d.ts +28 -2
- package/dist/components/PixiLottieSprite/PixiLottieSprite.d.ts +5 -2
- package/dist/components/PixiNullObject/PixiNullObject.d.ts +25 -0
- package/dist/components/PixiNullObject/index.d.ts +2 -0
- package/dist/components/PixiPreComp/PixiPreComp.d.ts +29 -0
- package/dist/components/PixiPreComp/index.d.ts +3 -0
- package/dist/components/PixiPreComp/validatePrecompDepth.d.ts +2 -0
- package/dist/components/PixiRemotionSprite/PixiRemotionGifSprite.d.ts +24 -0
- package/dist/components/PixiRemotionSprite/PixiRemotionImageSprite.d.ts +18 -0
- package/dist/components/PixiRemotionSprite/PixiRemotionSprite.d.ts +5 -2
- package/dist/components/PixiRemotionSprite/PixiRemotionVideoCanvaSprite.d.ts +20 -0
- package/dist/components/PixiRemotionSprite/index.d.ts +4 -0
- package/dist/components/PixiSVGSprite/PixiMorphSvgSprite.d.ts +35 -0
- package/dist/components/PixiSVGSprite/PixiSvgImageSprite.d.ts +35 -0
- package/dist/components/PixiSVGSprite/PixiSvgPathSprite.d.ts +21 -4
- package/dist/components/PixiSVGSprite/PixiSvgRawSprite.d.ts +30 -0
- package/dist/components/PixiSVGSprite/index.d.ts +5 -0
- package/dist/components/PixiSequence/PixiSequence.d.ts +29 -5
- package/dist/components/PixiShapeLayer/PixiShapeLayer.d.ts +43 -0
- package/dist/components/PixiShapeLayer/drawShape.d.ts +20 -0
- package/dist/components/PixiShapeLayer/index.d.ts +4 -0
- package/dist/components/PixiShapeLayer/samplePath.d.ts +5 -0
- package/dist/components/PixiTextSprite/PixiTextSplit.d.ts +26 -0
- package/dist/components/PixiTextSprite/PixiTextSprite.d.ts +42 -5
- package/dist/components/PixiTextSprite/index.d.ts +3 -0
- package/dist/components/PixiTextSprite/resolveTextSplitFills.d.ts +27 -0
- package/dist/components/PixiTextSprite/textAnimator.d.ts +22 -0
- package/dist/components/PixiThreeSprite/PixiThreeModelSprite.d.ts +23 -0
- package/dist/components/PixiThreeSprite/PixiThreeSprite.d.ts +14 -0
- package/dist/components/PixiThreeSprite/index.d.ts +4 -0
- package/dist/components/PixiUnifiedTransformer/PixiUnifiedTransformer.d.ts +20 -8
- package/dist/components/PixiVideoSprite/PixiVideoCanvasSync.d.ts +3 -1
- package/dist/components/PixiVideoSprite/PixiVideoSprite.d.ts +31 -2
- package/dist/components/index.d.ts +7 -0
- package/dist/constants/animation.d.ts +232 -0
- package/dist/constants/animationConstants.d.ts +90 -0
- package/dist/constants/elementNames.d.ts +4 -0
- package/dist/events/Events.d.ts +0 -1
- package/dist/filters/animated-vfx/AnimatedVfxFilter.d.ts +19 -0
- package/dist/filters/animated-vfx/composeShader.d.ts +2 -0
- package/dist/filters/animated-vfx/index.d.ts +14 -0
- package/dist/filters/animated-vfx/registry/animatedVfxRegistry.d.ts +65 -0
- package/dist/filters/animated-vfx/registry/waveTearVariants.d.ts +14 -0
- package/dist/filters/animated-vfx/toStrength.d.ts +1 -0
- package/dist/filters/animated-vfx/types.d.ts +18 -0
- package/dist/filters/animatedVfxFilters.d.ts +1 -0
- package/dist/filters/blend-mode/createBlendCompositeFilter.d.ts +26 -0
- package/dist/filters/edge-feather/EdgeFeatherFilter.d.ts +19 -0
- package/dist/filters/plate-key/PlateKeyFilter.d.ts +29 -0
- package/dist/hocs/AbstractContainer.d.ts +8 -1
- package/dist/hocs/BorderMaskContainer.d.ts +43 -0
- package/dist/hocs/OverlayTilingSprite.d.ts +3 -3
- package/dist/hocs/drawMaskShape.d.ts +7 -0
- package/dist/hocs/index.d.ts +5 -0
- package/dist/hooks/aep/buildAudioLevelTimeline.d.ts +7 -0
- package/dist/hooks/aep/buildBezierPathTimeline.d.ts +13 -0
- package/dist/hooks/aep/buildColorValueTimeline.d.ts +24 -0
- package/dist/hooks/aep/buildLayerTimeline.d.ts +20 -0
- package/dist/hooks/aep/buildScalarValueTimeline.d.ts +6 -0
- package/dist/hooks/aep/buildVec2ValueTimeline.d.ts +17 -0
- package/dist/hooks/aep/easeCache.d.ts +3 -0
- package/dist/hooks/aep/effectRegistry.d.ts +5 -0
- package/dist/hooks/aep/effects/brightnessContrast.d.ts +2 -0
- package/dist/hooks/aep/effects/dropShadow.d.ts +2 -0
- package/dist/hooks/aep/effects/fastBoxBlur.d.ts +2 -0
- package/dist/hooks/aep/effects/gaussianBlur.d.ts +2 -0
- package/dist/hooks/aep/effects/glow.d.ts +2 -0
- package/dist/hooks/aep/effects/hueSaturation.d.ts +2 -0
- package/dist/hooks/aep/effects/index.d.ts +9 -0
- package/dist/hooks/aep/effects/levels.d.ts +2 -0
- package/dist/hooks/aep/effects/tint.d.ts +2 -0
- package/dist/hooks/aep/effects/types.d.ts +8 -0
- package/dist/hooks/aep/index.d.ts +22 -0
- package/dist/hooks/aep/interpolateBezierPath.d.ts +3 -0
- package/dist/hooks/aep/sampleAnimatable.d.ts +13 -0
- package/dist/hooks/aep/useAepBezierPathAnimator.d.ts +12 -0
- package/dist/hooks/aep/useAepColorAnimator.d.ts +11 -0
- package/dist/hooks/aep/useAepCurrentFrame.d.ts +1 -0
- package/dist/hooks/aep/useAepEffectKeyframes.d.ts +4 -0
- package/dist/hooks/aep/useAepEffects.d.ts +3 -0
- package/dist/hooks/aep/useAepKeyframes.d.ts +15 -0
- package/dist/hooks/aep/useAepTextLayout.d.ts +12 -0
- package/dist/hooks/aep/useAepValueAnimator.d.ts +2 -0
- package/dist/hooks/aep/useAepVec2Animator.d.ts +10 -0
- package/dist/hooks/aep/useTypefaceMetrics.d.ts +2 -0
- package/dist/hooks/index.d.ts +12 -0
- package/dist/hooks/useBlendFilter.d.ts +17 -0
- package/dist/hooks/useDebouncedValue.d.ts +11 -0
- package/dist/hooks/useFontEpoch.d.ts +10 -0
- package/dist/hooks/usePixiAnimation.d.ts +24 -0
- package/dist/hooks/useSpriteFilters.d.ts +81 -0
- package/dist/hooks/useSvgTexture.d.ts +29 -0
- package/dist/hooks/video/useVideoLifecycle.d.ts +23 -0
- package/dist/hooks/video/useVideoTexture.d.ts +34 -0
- package/dist/hooks/video/useVideoTimelineSync.d.ts +24 -0
- package/dist/hooks/withEffectsHook.d.ts +325 -4
- package/dist/hooks/withFiltersHook.d.ts +104 -38
- package/dist/importers/aep/bodymovin-color-controls.d.ts +23 -0
- package/dist/importers/aep/bodymovin-color.d.ts +1 -0
- package/dist/importers/aep/bodymovin-keyframe.d.ts +42 -0
- package/dist/importers/aep/bodymovin-layer.d.ts +84 -0
- package/dist/importers/aep/bodymovin-transform.d.ts +12 -0
- package/dist/importers/aep/bodymovin.d.ts +7 -0
- package/dist/importers/aep/bodymovinCameras.d.ts +34 -0
- package/dist/importers/aep/bodymovinExtensions.d.ts +3 -0
- package/dist/importers/aep/bodymovinTextRuns.d.ts +13 -0
- package/dist/importers/aep/index.d.ts +7 -0
- package/dist/importers/aep/lottieLint.d.ts +23 -0
- package/dist/importers/aep/lottieLint.rules.d.ts +6 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +76991 -30787
- package/dist/index.umd.js +5621 -1699
- package/dist/lib/pixi-essentials/bounds/AxisAlignedBounds.d.ts +121 -0
- package/dist/lib/pixi-essentials/bounds/OrientedBounds.d.ts +103 -0
- package/dist/lib/pixi-essentials/bounds/index.d.ts +2 -0
- package/dist/lib/pixi-essentials/index.d.ts +6 -0
- package/dist/lib/pixi-essentials/object-pool/AverageProvider.d.ts +28 -0
- package/dist/lib/pixi-essentials/object-pool/ObjectPool.d.ts +103 -0
- package/dist/lib/pixi-essentials/object-pool/ObjectPoolFactory.d.ts +40 -0
- package/dist/lib/pixi-essentials/object-pool/index.d.ts +2 -0
- package/dist/lib/pixi-essentials/react-bindings/Transformer.d.ts +74 -0
- package/dist/lib/pixi-essentials/react-bindings/index.d.ts +3 -0
- package/dist/lib/pixi-essentials/react-bindings/utils/applyEventProps.d.ts +13 -0
- package/dist/lib/pixi-essentials/transformer/Transformer.d.ts +728 -0
- package/dist/lib/pixi-essentials/transformer/TransformerHandle.d.ts +142 -0
- package/dist/lib/pixi-essentials/transformer/TransformerWireframe.d.ts +54 -0
- package/dist/lib/pixi-essentials/transformer/index.d.ts +5 -0
- package/dist/lib/pixi-essentials/transformer/utils/decomposeTransform.d.ts +11 -0
- package/dist/lib/pixi-essentials/transformer/utils/distanceToLine.d.ts +7 -0
- package/dist/lib/pixi-essentials/transformer/utils/multiplyTransform.d.ts +17 -0
- package/dist/lib/pixi-essentials/transformer/utils/skewTransform.d.ts +13 -0
- package/dist/providers/GsapPixieContextProvider.d.ts +7 -0
- package/dist/types/BaseProps.d.ts +51 -16
- package/dist/types/CropTypes.d.ts +12 -0
- package/dist/types/Effects.d.ts +674 -13
- package/dist/types/MaskTypes.d.ts +10 -0
- package/dist/types/OverlayTypes.d.ts +9 -0
- package/dist/types/aep/asset.d.ts +43 -0
- package/dist/types/aep/camera.d.ts +778 -0
- package/dist/types/aep/composition.d.ts +82 -0
- package/dist/types/aep/effect.d.ts +137 -0
- package/dist/types/aep/index.d.ts +14 -0
- package/dist/types/aep/layer.d.ts +26546 -0
- package/dist/types/aep/light.d.ts +781 -0
- package/dist/types/aep/mask.d.ts +193 -0
- package/dist/types/aep/parse.d.ts +11 -0
- package/dist/types/aep/postFx.d.ts +107 -0
- package/dist/types/aep/text-animator.d.ts +687 -0
- package/dist/types/aep/text-runs.d.ts +234 -0
- package/dist/types/aep/theme.d.ts +72 -0
- package/dist/types/aep/transform.d.ts +285 -0
- package/dist/types/aep/transform3D.d.ts +171 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/utils/AppStateProvider.d.ts +1 -0
- package/dist/utils/AppWrapper.d.ts +3 -0
- package/dist/utils/ContextBridge.d.ts +1 -1
- package/dist/utils/GsapAnims.d.ts +0 -1
- package/dist/utils/InteractionManager.d.ts +1 -10
- package/dist/utils/PixiSelector.d.ts +17 -0
- package/dist/utils/aeMath/zoomToFov.d.ts +1 -0
- package/dist/utils/areSpritePropsEqual.d.ts +8 -0
- package/dist/utils/assetRefCount.d.ts +20 -0
- package/dist/utils/audio/audioRegistry.d.ts +51 -0
- package/dist/utils/audio/audioSync.d.ts +98 -0
- package/dist/utils/audio/gainEnvelope.d.ts +162 -0
- package/dist/utils/audio/useAudioRegistry.d.ts +10 -0
- package/dist/utils/blendMode.d.ts +21 -0
- package/dist/utils/captions/captionClock.d.ts +17 -0
- package/dist/utils/captions/captionDisplay.d.ts +57 -0
- package/dist/utils/captions/captionPose.d.ts +107 -0
- package/dist/utils/captions/captionVisual.d.ts +32 -0
- package/dist/utils/captions/captionWordLayout.d.ts +67 -0
- package/dist/utils/captions/groupSegments.d.ts +20 -0
- package/dist/utils/captions/index.d.ts +10 -0
- package/dist/utils/captions/parseSubtitles.d.ts +25 -0
- package/dist/utils/captions/sampleCaption.d.ts +25 -0
- package/dist/utils/captions/timeBase.d.ts +34 -0
- package/dist/utils/captions/types.d.ts +279 -0
- package/dist/utils/entranceOverlap.d.ts +37 -0
- package/dist/utils/fonts/fontLoader.d.ts +33 -0
- package/dist/utils/fonts/fontSpec.d.ts +16 -0
- package/dist/utils/fonts/googleFonts.d.ts +9 -0
- package/dist/utils/gifTiming.d.ts +22 -0
- package/dist/utils/gsapEffects/animationConfigs.d.ts +3802 -0
- package/dist/utils/gsapEffects/backEffects.d.ts +1 -0
- package/dist/utils/gsapEffects/bounceEffects.d.ts +1 -0
- package/dist/utils/gsapEffects/effectGenerator.d.ts +3 -0
- package/dist/utils/gsapEffects/effectTarget.d.ts +11 -0
- package/dist/utils/gsapEffects/fadeEffects.d.ts +1 -0
- package/dist/utils/gsapEffects/flipEffects.d.ts +1 -0
- package/dist/utils/gsapEffects/generalEffects.d.ts +1 -0
- package/dist/utils/gsapEffects/lightSpeedEffect.d.ts +1 -0
- package/dist/utils/gsapEffects/logoRevealEffects.d.ts +1 -0
- package/dist/utils/gsapEffects/registerEffects.d.ts +1 -0
- package/dist/utils/gsapEffects/riseEffect.d.ts +1 -0
- package/dist/utils/gsapEffects/rollEffects.d.ts +1 -0
- package/dist/utils/gsapEffects/rotateEffects.d.ts +1 -0
- package/dist/utils/gsapEffects/slideEffects.d.ts +1 -0
- package/dist/utils/gsapEffects/staggerTextEffects.d.ts +1 -0
- package/dist/utils/gsapEffects/textUnitEffects.d.ts +1 -0
- package/dist/utils/gsapEffects/textUnitMask.d.ts +1 -0
- package/dist/utils/gsapEffects/textUnits.d.ts +172 -0
- package/dist/utils/gsapEffects/typewriterEffect.d.ts +1 -0
- package/dist/utils/gsapEffects/wipeEffect.d.ts +1 -0
- package/dist/utils/gsapEffects/zoomEffects.d.ts +1 -0
- package/dist/utils/index.d.ts +31 -0
- package/dist/utils/isExternalUrl.d.ts +1 -0
- package/dist/utils/loadSpriteTexture.d.ts +39 -0
- package/dist/utils/msdf/computeInstanceMatrix.d.ts +18 -0
- package/dist/utils/msdf/index.d.ts +4 -0
- package/dist/utils/msdf/loadMsdfAtlas.d.ts +9 -0
- package/dist/utils/msdf/msdfShader.d.ts +2 -0
- package/dist/utils/msdf/types.d.ts +49 -0
- package/dist/utils/pixiExtend.d.ts +0 -0
- package/dist/utils/sanitizeCanvasText.d.ts +12 -0
- package/dist/utils/sanitizeImageSrc.d.ts +7 -0
- package/dist/utils/svgRaster.d.ts +47 -0
- package/dist/utils/text/resolveTextRuns.d.ts +8 -0
- package/dist/utils/textLayout/alignLines.d.ts +15 -0
- package/dist/utils/textLayout/applyVerticals.d.ts +14 -0
- package/dist/utils/textLayout/breakLines.d.ts +14 -0
- package/dist/utils/textLayout/canvasMetricsProvider.d.ts +6 -0
- package/dist/utils/textLayout/index.d.ts +7 -0
- package/dist/utils/textLayout/layoutText.d.ts +7 -0
- package/dist/utils/textLayout/metricsCache.d.ts +9 -0
- package/dist/utils/textLayout/pixiCanvasMetricsProvider.d.ts +6 -0
- package/dist/utils/textLayout/shapeRuns.d.ts +18 -0
- package/dist/utils/textLayout/typefaceMetricsProvider.d.ts +19 -0
- package/dist/utils/textLayout/types.d.ts +61 -0
- package/dist/utils/textLayout/unicode.d.ts +2 -0
- package/dist/utils/textStyle.d.ts +81 -0
- package/dist/utils/textStyleV8.d.ts +62 -0
- package/dist/utils/threeModel.d.ts +55 -0
- package/dist/utils/videoAssetCache.d.ts +4 -0
- package/dist/utils/videoReadiness.d.ts +13 -0
- package/package.json +74 -54
- package/dist/assets/icon/transformericons/icons.d.ts +0 -8
- package/dist/components/PixiAudioSprite/PixiAudioSprite.stories.d.ts +0 -12
- package/dist/components/PixiGifSprite/PixiGifSprite.stories.d.ts +0 -163
- package/dist/components/PixiImageSprite/PixiImageSprite.stories.d.ts +0 -150
- package/dist/components/PixiLottieSprite/PixiLottieSprite.stories.d.ts +0 -159
- package/dist/components/PixiSVGSprite/PixiSvgPathSprite.stories.d.ts +0 -131
- package/dist/components/PixiSequence/PixiSequence.stories.d.ts +0 -33
- package/dist/components/PixiTextSprite/PixiTextSprite.stories.d.ts +0 -140
- package/dist/components/PixiVideoSprite/PixiVideoSprite.stories.d.ts +0 -146
- package/dist/favicon.svg +0 -41
- package/dist/pixitweenjs-logo-dark.svg +0 -98
- package/dist/pixitweenjs-logo.svg +0 -97
- package/dist/stories/Features/TestHowlerAudioFiles.d.ts +0 -2
- package/dist/stories/Features/TimelineAnimations.d.ts +0 -15
- package/dist/stories/Features/TimelineTest.d.ts +0 -15
- package/dist/stories/Features/TimelineTest.stories.d.ts +0 -23
- package/dist/stories/Features/TimelineTestAudios.d.ts +0 -15
- package/dist/stories/Features/TimelineTestWithVideos.d.ts +0 -15
- package/dist/stories/Features/TimelineWithGif.d.ts +0 -21
- package/dist/stories/Features/common.tests.d.ts +0 -411
- /package/dist/{.gitkeep → utils/gsapEffects/index.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as PIXI from 'pixi.js';
|
|
2
|
+
/**
|
|
3
|
+
* GSAP hands a registered effect its targets as an ARRAY — it runs
|
|
4
|
+
* gsap.utils.toArray() on whatever was passed to gsap.effects.NAME(...).
|
|
5
|
+
*
|
|
6
|
+
* Tween-only effects never notice, since gsap.to/from/set all accept arrays.
|
|
7
|
+
* Effects that touch the scene graph (addChild, getLocalBounds, mask) must
|
|
8
|
+
* unwrap first, or they fail on the Array — loudly with "addChild is not a
|
|
9
|
+
* function", or silently via `array.children ?? []` reading as empty.
|
|
10
|
+
*/
|
|
11
|
+
export declare function resolveEffectNode(target: PIXI.Container | PIXI.Container[]): PIXI.Container | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import * as PIXI from 'pixi.js';
|
|
2
|
+
/** Normalised anchor, 0–1. `0,0` is top-left, `1,1` bottom-right. */
|
|
3
|
+
export type UnitAnchor = number | {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
};
|
|
7
|
+
export type TextEffectVars = {
|
|
8
|
+
duration?: number;
|
|
9
|
+
ease?: string;
|
|
10
|
+
immediateRender?: boolean;
|
|
11
|
+
overwrite?: boolean | 'auto';
|
|
12
|
+
x?: number;
|
|
13
|
+
y?: number;
|
|
14
|
+
alpha?: number;
|
|
15
|
+
scaleX?: number;
|
|
16
|
+
scaleY?: number;
|
|
17
|
+
revealUnit?: 'letter' | 'word';
|
|
18
|
+
/** Seconds between each unit's start. Maps to gsap's stagger `each`. */
|
|
19
|
+
stagger?: number;
|
|
20
|
+
/** Where the stagger emanates from: start | center | edges | random | end. */
|
|
21
|
+
staggerFrom?: 'start' | 'center' | 'edges' | 'random' | 'end';
|
|
22
|
+
/** Ease that distributes the start times (not the per-unit ease). */
|
|
23
|
+
staggerEase?: string;
|
|
24
|
+
/** Vertical travel for fade-y (px). */
|
|
25
|
+
yOffset?: number;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Transform origins for the split, passed straight to SplitText.
|
|
29
|
+
*
|
|
30
|
+
* These are the ONLY correct way to set a unit's transform origin — `pivot`
|
|
31
|
+
* relocates the unit as well as re-centring it, which displaces it from the
|
|
32
|
+
* laid-out position captured in `baseX`/`baseY`.
|
|
33
|
+
*/
|
|
34
|
+
export type UnitAnchors = {
|
|
35
|
+
charAnchor?: UnitAnchor;
|
|
36
|
+
wordAnchor?: UnitAnchor;
|
|
37
|
+
lineAnchor?: UnitAnchor;
|
|
38
|
+
};
|
|
39
|
+
export type TextUnits = {
|
|
40
|
+
/** The effect's container — already normalised from GSAP's target array. */
|
|
41
|
+
node: PIXI.Container;
|
|
42
|
+
/** Words or chars, in reading order. */
|
|
43
|
+
units: PIXI.Container[];
|
|
44
|
+
/** Resting x of a unit, captured before any tween moved it. */
|
|
45
|
+
baseX: (unit: PIXI.Container) => number;
|
|
46
|
+
/** Resting y of a unit, captured before any tween moved it. */
|
|
47
|
+
baseY: (unit: PIXI.Container) => number;
|
|
48
|
+
/** Source text's font size, for deriving travel distances that scale. */
|
|
49
|
+
fontSize: number;
|
|
50
|
+
};
|
|
51
|
+
/** Depth-first search for the element's text node. */
|
|
52
|
+
export declare function findTextNode(root: PIXI.Container): PIXI.Text | null;
|
|
53
|
+
/** Normalise GSAP's target (always an array) to a Container, or null. */
|
|
54
|
+
export declare function resolveTextTarget(target: PIXI.Container | PIXI.Container[], label: string): PIXI.Container | null;
|
|
55
|
+
/**
|
|
56
|
+
* Lock the container to its authored transform before the units animate.
|
|
57
|
+
* Per-unit effects move the units, never the container, so it must sit at its
|
|
58
|
+
* resting state for the whole reveal.
|
|
59
|
+
*/
|
|
60
|
+
export declare function applyContainerBaseState(node: PIXI.Container, vars: TextEffectVars): void;
|
|
61
|
+
/**
|
|
62
|
+
* Cached split + resting positions, or null when the target has no PIXI.Text.
|
|
63
|
+
*
|
|
64
|
+
* A null return is a normal case, not an error: it is reached from project JSON
|
|
65
|
+
* and when an element's type changes under a saved animation. Callers should
|
|
66
|
+
* fall back to `containerFadeEffect`.
|
|
67
|
+
*/
|
|
68
|
+
export declare function resolveTextUnits(node: PIXI.Container, revealUnit: 'letter' | 'word', anchors?: UnitAnchors): TextUnits | null;
|
|
69
|
+
/**
|
|
70
|
+
* Turn the authored `stagger` into GSAP's config.
|
|
71
|
+
*
|
|
72
|
+
* `amount` is the total time spread across all units, so the LAST unit still
|
|
73
|
+
* lands on `duration` — the documented way to express what these effects used to
|
|
74
|
+
* hand-roll by offsetting N separate tweens. `each` would instead make the total
|
|
75
|
+
* grow with the word count, so a long title would overrun its own animation.
|
|
76
|
+
*/
|
|
77
|
+
export declare function resolveStagger(vars: TextEffectVars, unitCount: number, duration: number): {
|
|
78
|
+
amount: number;
|
|
79
|
+
unitDuration: number;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* The `stagger` object shared by every per-unit effect.
|
|
83
|
+
*
|
|
84
|
+
* `defaultFrom` lets an effect (e.g. TEXT_SPOTLIGHT → 'center') pick its own
|
|
85
|
+
* look when the user hasn't overridden it. Do NOT implement that by spreading
|
|
86
|
+
* `{ staggerFrom: defaultFrom, ...vars }` at the call site — `vars` always
|
|
87
|
+
* carries an explicit `staggerFrom` key (usePixiAnimation's `animInExtra` sets
|
|
88
|
+
* it even when the author never set one, so its value is `undefined`), and
|
|
89
|
+
* object spread copies that key regardless of value, silently clobbering the
|
|
90
|
+
* default. This shipped once already: every TEXT_* effect defaulted to
|
|
91
|
+
* 'start' instead of its intended origin until this comment was added.
|
|
92
|
+
*/
|
|
93
|
+
export declare function staggerConfig(vars: TextEffectVars, amount: number, defaultFrom?: NonNullable<TextEffectVars['staggerFrom']>): {
|
|
94
|
+
ease?: string | undefined;
|
|
95
|
+
amount: number;
|
|
96
|
+
from: NonNullable<"start" | "center" | "edges" | "random" | "end" | undefined>;
|
|
97
|
+
};
|
|
98
|
+
export declare function ensureUnitMask(unit: PIXI.Container, signature: string): PIXI.Graphics | null;
|
|
99
|
+
/**
|
|
100
|
+
* Public record of each per-unit effect's own defaults, keyed by name.
|
|
101
|
+
*
|
|
102
|
+
* Exists so `src/components/edit-menu/constants.ts` (`TEXT_ANIMATION_DEFAULT_FROM`)
|
|
103
|
+
* can be cross-checked against the real values rather than drifting silently —
|
|
104
|
+
* see `textUnitEffectsBehavior.test.ts`. Pure data; importing it does not
|
|
105
|
+
* invoke PIXI or run any effect.
|
|
106
|
+
*/
|
|
107
|
+
export declare const TEXT_UNIT_EFFECT_DEFAULTS: Readonly<Record<string, {
|
|
108
|
+
from: NonNullable<TextEffectVars['staggerFrom']>;
|
|
109
|
+
unit: 'letter' | 'word';
|
|
110
|
+
}>>;
|
|
111
|
+
export type UnitEffectContext = {
|
|
112
|
+
baseX: (unit: PIXI.Container) => number;
|
|
113
|
+
baseY: (unit: PIXI.Container) => number;
|
|
114
|
+
/**
|
|
115
|
+
* Resting box height per unit. Measured once per effect run and ONLY when
|
|
116
|
+
* the effect is masked — unmasked effects never pay for getLocalBounds.
|
|
117
|
+
* Falls back to fontSize (design-space units, NFR4).
|
|
118
|
+
*/
|
|
119
|
+
unitH: (unit: PIXI.Container) => number;
|
|
120
|
+
/** Source text's font size, for deriving travel distances that scale. */
|
|
121
|
+
fontSize: number;
|
|
122
|
+
};
|
|
123
|
+
export type UnitEffectSpec = {
|
|
124
|
+
/** GSAP effect name / ANIMATION id. */
|
|
125
|
+
name: string;
|
|
126
|
+
/** Default per-unit ease. */
|
|
127
|
+
ease: string;
|
|
128
|
+
/** Default stagger origin for this look. */
|
|
129
|
+
from?: TextEffectVars['staggerFrom'];
|
|
130
|
+
/** Default split granularity. `revealUnit` in the project JSON overrides it. */
|
|
131
|
+
unit?: 'letter' | 'word';
|
|
132
|
+
/** Transform origins — applied to the split, never as pivot. */
|
|
133
|
+
anchors?: UnitAnchors;
|
|
134
|
+
/**
|
|
135
|
+
* Clip every unit to its own resting box (FR8 masked reveals). The unit
|
|
136
|
+
* still animates through the same single fromTo — the mask only adds the
|
|
137
|
+
* hard edge, and pads past it so the resting frame is unclipped.
|
|
138
|
+
*/
|
|
139
|
+
masked?: boolean;
|
|
140
|
+
/** Per-unit start state. */
|
|
141
|
+
from_: (ctx: UnitEffectContext) => gsap.TweenVars;
|
|
142
|
+
/** Per-unit end state. Must land every unit exactly on its resting position. */
|
|
143
|
+
to: (ctx: UnitEffectContext) => gsap.TweenVars;
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* The single registration path for every SplitText per-unit effect (phase 2
|
|
147
|
+
* catalogue in `textUnitEffects.ts`, masked FR8 catalogue in
|
|
148
|
+
* `textUnitMask.ts`). One `gsap.fromTo` over the split units with a native
|
|
149
|
+
* `stagger` config; splitting, caching, resting-position capture and stagger
|
|
150
|
+
* maths all live above in this module.
|
|
151
|
+
*
|
|
152
|
+
* Three rules shape every effect registered here:
|
|
153
|
+
*
|
|
154
|
+
* - Positions are ABSOLUTE. A recipe's `y: 50` means "50px from where it
|
|
155
|
+
* sits"; on a Pixi unit the same literal means "y = 50 in parent space",
|
|
156
|
+
* which stacks every word in one spot. Always tween relative to baseX/baseY.
|
|
157
|
+
* - Transform origin comes from `charAnchor`/`wordAnchor`, never `pivot` —
|
|
158
|
+
* `pivot` relocates the unit away from its captured resting position.
|
|
159
|
+
* - Randomness must be DETERMINISTIC per unit. usePixiAnimation rebuilds the
|
|
160
|
+
* timeline every frame, so `gsap.utils.random()` would re-roll ~30x a
|
|
161
|
+
* second and the text would jitter instead of animating.
|
|
162
|
+
*/
|
|
163
|
+
export declare function registerTextUnitEffect(spec: UnitEffectSpec): void;
|
|
164
|
+
/**
|
|
165
|
+
* Whole-element fade — the non-text form.
|
|
166
|
+
*
|
|
167
|
+
* A sprite has no sub-units to stagger, so this is a fade (plus an optional
|
|
168
|
+
* rise) over the container itself. It backs the generic STAGGER_FADE family for
|
|
169
|
+
* images, video and shapes, and is the safety net whenever a text effect is
|
|
170
|
+
* pointed at something with no PIXI.Text inside.
|
|
171
|
+
*/
|
|
172
|
+
export declare function containerFadeEffect(node: PIXI.Container, vars: TextEffectVars, withYOffset: boolean, defaultEase: string): gsap.core.Tween;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { isExternalUrl } from './isExternalUrl';
|
|
2
|
+
export { loadSpriteTexture, type LoadSpriteTextureOptions, } from './loadSpriteTexture';
|
|
3
|
+
export { areSpritePropsEqual, SPRITE_REF_PROP_NAMES, } from './areSpritePropsEqual';
|
|
4
|
+
export { resolveTextRuns, resolveTextRunsWithWarnings, } from './text/resolveTextRuns';
|
|
5
|
+
export { layoutText, createCanvasMetricsProvider, MetricsCache, metricsCacheKey, splitGraphemes, isWhitespaceChar, type AepTextAlign as AepTextLayoutAlign, type AepGlyphMetrics, type AepTextLayoutGlyph, type AepTextLayoutInput, type AepTextLayoutLine, type AepTextLayoutResult, type AepTextLayoutRun, type AepTextMetricsProvider, } from './textLayout';
|
|
6
|
+
export { loadMsdfAtlas, hydrateMsdfAtlas, MSDF_VERTEX_SHADER, MSDF_FRAGMENT_SHADER, computeInstanceMatrix, writeInstanceColor, hexToRgba, type MsdfAtlas, type MsdfAtlasJson, type MsdfGlyph, type AnimatorOffset as MsdfAnimatorOffset, } from './msdf';
|
|
7
|
+
export * from './captions';
|
|
8
|
+
export { applyEntranceOverlaps } from './entranceOverlap';
|
|
9
|
+
export { ANIMATION, ANIMATION_TIMING, CANVAS_DEFAULTS, ANIMATIONS_WITHOUT_ALPHA, SPECIAL_ANIMATIONS, LOOP_ANIMATIONS, isLoopAnimation, camelToUpperSnake, normalizeAnimation, normalizeLoopAnimation, animationAffectsAlpha, isSpecialAnimation, isValidAnimation, } from '../constants/animation';
|
|
10
|
+
export { ANIMATION_CONFIGS } from './gsapEffects/animationConfigs';
|
|
11
|
+
export { useAllVideosReady, registerVideo, markVideoReady, unregisterVideo, resetVideoReadiness, } from './videoReadiness';
|
|
12
|
+
export { acquireVideoAsset, releaseVideoAsset } from './videoAssetCache';
|
|
13
|
+
export { getElementName, getUniqueIdFromName, findByName, findAllByPattern, createPixiSelector, type PixiSelector, } from './PixiSelector';
|
|
14
|
+
export { mapV7DropShadow, mapV7Stroke, buildV8FillGradient, normalizeFontWeight, normalizeLetterSpacing, } from './textStyleV8';
|
|
15
|
+
export { PIXITEXT_HITAREA_PREFIX, PIXITEXT_TEXT_LABEL, getPixiTextHitAreaName, } from '../constants/elementNames';
|
|
16
|
+
export { useBlendFilter } from '../hooks/useBlendFilter';
|
|
17
|
+
export { resolveBlendModeString, resolveBlendStrategy } from './blendMode';
|
|
18
|
+
export { sanitizeImageSrc } from './sanitizeImageSrc';
|
|
19
|
+
export { loadSpriteTextureSync, type SpriteTextureHandle, } from './loadSpriteTexture';
|
|
20
|
+
export { createAssetRefCounter, type AssetRefCounter } from './assetRefCount';
|
|
21
|
+
export { gifFrameAt, type GifFrameTiming } from './gifTiming';
|
|
22
|
+
export { buildRasterSvg, rewriteSvg, readOriginalSize, detectOutlineIcon, isSvgSource, } from './svgRaster';
|
|
23
|
+
export { loadGoogleFonts, getLoadedFonts, FONT_LOAD_TIMEOUT_MS, type FontsLoadedDetail, } from './fonts/fontLoader';
|
|
24
|
+
export { fontFamilyKey, formatGoogleFamily, fontWeightsOf, isFontSpecCovered, googleFontsHref, } from './fonts/fontSpec';
|
|
25
|
+
export { GOOGLE_FONTS, ALL_GOOGLE_FONTS, PRELOAD_FONTS } from './fonts/googleFonts';
|
|
26
|
+
export { sanitizeCanvasText, CANVAS_TEXT_MAX_LENGTH } from './sanitizeCanvasText';
|
|
27
|
+
export { buildTextStyleOptions, type TextStyleInput } from './textStyle';
|
|
28
|
+
export { gainAt, fadeGainAt, duckGainAt, buildGainSpec, deriveDuckWindows, duckWindowsFromEnvelope, dbToLinear, linearToDb, DEFAULT_DUCK_TO, DEFAULT_DUCK_FADE_SEC, MUSIC_BED_DEFAULT_VOLUME, VOICE_TRACK_ROLES, type AudioFade, type AudioFadeSide, type DuckWindow, type GainSpec, } from './audio/gainEnvelope';
|
|
29
|
+
export { decideAudioSync, applyAudioDecision, clipFileTime, clipVolumeAt, DRIFT_TOLERANCE_SEC, type AudioClipSpec, type SyncDecision, } from './audio/audioSync';
|
|
30
|
+
export { audioRegistry, createAudioRegistry, type AudioRegistry, } from './audio/audioRegistry';
|
|
31
|
+
export * from './threeModel';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isExternalUrl(src: string | undefined): boolean;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as PIXI from "pixi.js";
|
|
2
|
+
export interface LoadSpriteTextureOptions {
|
|
3
|
+
scaleMode?: "linear" | "nearest";
|
|
4
|
+
enableMipmap?: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Force Pixi's texture loader. Default true.
|
|
7
|
+
*
|
|
8
|
+
* Extensionless image URLs (Unsplash/imgix: `/photo-xxx?fm=jpg&w=1080`) give Pixi's
|
|
9
|
+
* resolver nothing to infer a loader from, so `Assets.load(url)` silently never resolves
|
|
10
|
+
* and the canvas stays blank. Pass `false` for GIF/video/SVG URLs that must go through
|
|
11
|
+
* their own parser.
|
|
12
|
+
*/
|
|
13
|
+
forceTextureParser?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface SpriteTextureHandle {
|
|
16
|
+
promise: Promise<PIXI.Texture | null>;
|
|
17
|
+
/** Stop caring about the result (resolves the promise with null if still pending). */
|
|
18
|
+
cancel: () => void;
|
|
19
|
+
/**
|
|
20
|
+
* Release this handle's use of the texture. The texture belongs to `PIXI.Assets` (every URL,
|
|
21
|
+
* relative or absolute, is cached there), so it is never `destroy`ed: `Assets.unload` runs
|
|
22
|
+
* once no sprite has used the URL for a grace period.
|
|
23
|
+
*/
|
|
24
|
+
dispose: () => void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Load a texture and return a handle SYNCHRONOUSLY.
|
|
28
|
+
*
|
|
29
|
+
* The old version was `async` and returned `Promise<handle>`, so a component that unmounted
|
|
30
|
+
* before that promise settled ran its cleanup with no handle to cancel: the load completed
|
|
31
|
+
* later and called `setTexture` on an unmounted component. Returning the handle directly
|
|
32
|
+
* removes the race. `loadSpriteTexture(src).then(handle => ...)` still works (see below).
|
|
33
|
+
*/
|
|
34
|
+
export declare function loadSpriteTextureSync(rawSrc: string, opts?: LoadSpriteTextureOptions): SpriteTextureHandle;
|
|
35
|
+
/**
|
|
36
|
+
* Backward-compatible wrapper: resolves to the same handle. Prefer
|
|
37
|
+
* `loadSpriteTextureSync`, which has no cancel race.
|
|
38
|
+
*/
|
|
39
|
+
export declare function loadSpriteTexture(src: string, opts?: LoadSpriteTextureOptions): Promise<SpriteTextureHandle>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MsdfGlyph } from './types';
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
export interface AnimatorOffset {
|
|
4
|
+
position: [number, number];
|
|
5
|
+
scale: [number, number];
|
|
6
|
+
rotation: number;
|
|
7
|
+
opacity: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function computeInstanceMatrix(out: THREE.Matrix4, glyph: MsdfGlyph, layout: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
bounds: {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
};
|
|
16
|
+
}, size: number, offset: AnimatorOffset): THREE.Matrix4;
|
|
17
|
+
export declare function writeInstanceColor(array: Float32Array, index: number, rgba: [number, number, number, number]): void;
|
|
18
|
+
export declare function hexToRgba(hex: string, alphaOverride?: number): [number, number, number, number];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { MsdfAtlas, MsdfAtlasJson, MsdfGlyph, } from './types';
|
|
2
|
+
export { loadMsdfAtlas, hydrateMsdfAtlas, _clearMsdfAtlasCache, } from './loadMsdfAtlas';
|
|
3
|
+
export { MSDF_VERTEX_SHADER, MSDF_FRAGMENT_SHADER, } from './msdfShader';
|
|
4
|
+
export { computeInstanceMatrix, writeInstanceColor, hexToRgba, type AnimatorOffset, } from './computeInstanceMatrix';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MsdfAtlas, MsdfAtlasJson } from './types';
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
interface LoadOptions {
|
|
4
|
+
pngUrl?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function loadMsdfAtlas(jsonUrl: string, options?: LoadOptions): Promise<MsdfAtlas>;
|
|
7
|
+
export declare function hydrateMsdfAtlas(json: MsdfAtlasJson, texture: THREE.Texture): MsdfAtlas;
|
|
8
|
+
export declare function _clearMsdfAtlasCache(): void;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const MSDF_VERTEX_SHADER = "\nattribute vec4 aUvRect;\nattribute vec4 aColor;\nvarying vec2 vUv;\nvarying vec4 vColor;\nvoid main() {\n // Atlas pixels are Y-down (image-space) but the plane geometry's UV is\n // Y-up (uv.y=0 = bottom). Invert uv.y so the glyph image's visual top\n // lands at the top of the quad.\n vUv = vec2(\n aUvRect.x + uv.x * aUvRect.z,\n aUvRect.y + (1.0 - uv.y) * aUvRect.w\n );\n vColor = aColor;\n // instanceMatrix is auto-injected by Three for InstancedMesh + ShaderMaterial.\n // Without this multiplication every instance collapses to local origin.\n gl_Position = projectionMatrix * modelViewMatrix * instanceMatrix * vec4(position, 1.0);\n}\n";
|
|
2
|
+
export declare const MSDF_FRAGMENT_SHADER = "\nprecision highp float;\nuniform sampler2D uAtlas;\nuniform float uDistanceRange;\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nfloat median(float a, float b, float c) {\n return max(min(a, b), min(max(a, b), c));\n}\n\nvoid main() {\n vec3 msd = texture2D(uAtlas, vUv).rgb;\n float sd = median(msd.r, msd.g, msd.b);\n float screenPxRange = max(uDistanceRange, 1.0);\n float screenPxDist = screenPxRange * (sd - 0.5);\n float opacity = clamp(screenPxDist + 0.5, 0.0, 1.0);\n if (opacity < 0.001) discard;\n gl_FragColor = vec4(vColor.rgb, vColor.a * opacity);\n}\n";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type * as THREE from "three";
|
|
2
|
+
export interface MsdfAtlasJson {
|
|
3
|
+
version: "msdf-atlas/1";
|
|
4
|
+
font: {
|
|
5
|
+
family: string;
|
|
6
|
+
weight?: number | string;
|
|
7
|
+
italic?: boolean;
|
|
8
|
+
em: number;
|
|
9
|
+
ascent: number;
|
|
10
|
+
descent: number;
|
|
11
|
+
lineHeight: number;
|
|
12
|
+
};
|
|
13
|
+
atlas: {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
distanceRange: number;
|
|
17
|
+
fieldType: "msdf";
|
|
18
|
+
};
|
|
19
|
+
glyphs: Array<{
|
|
20
|
+
char: string;
|
|
21
|
+
codepoint: number;
|
|
22
|
+
uv: [number, number, number, number];
|
|
23
|
+
planeBounds: [number, number, number, number];
|
|
24
|
+
advance: number;
|
|
25
|
+
}>;
|
|
26
|
+
kerning: Record<string, number>;
|
|
27
|
+
}
|
|
28
|
+
export interface MsdfGlyph {
|
|
29
|
+
char: string;
|
|
30
|
+
codepoint: number;
|
|
31
|
+
uv: [number, number, number, number];
|
|
32
|
+
planeBounds: [number, number, number, number];
|
|
33
|
+
advance: number;
|
|
34
|
+
}
|
|
35
|
+
export interface MsdfAtlas {
|
|
36
|
+
texture: THREE.Texture;
|
|
37
|
+
glyphs: Map<string, MsdfGlyph>;
|
|
38
|
+
kerning: Map<string, number>;
|
|
39
|
+
em: number;
|
|
40
|
+
ascent: number;
|
|
41
|
+
descent: number;
|
|
42
|
+
lineHeight: number;
|
|
43
|
+
distanceRange: number;
|
|
44
|
+
atlasSize: {
|
|
45
|
+
width: number;
|
|
46
|
+
height: number;
|
|
47
|
+
};
|
|
48
|
+
version: MsdfAtlasJson["version"];
|
|
49
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sanitize plain text for in-canvas title / TipTap editing.
|
|
3
|
+
*
|
|
4
|
+
* Guards against paste of HTML, control chars, zero-width/bidi tricks,
|
|
5
|
+
* and unbounded length that would blow up Pixi Text layout or project JSON.
|
|
6
|
+
*/
|
|
7
|
+
/** Soft cap for a single title element — enough for multi-line copy, not novels. */
|
|
8
|
+
export declare const CANVAS_TEXT_MAX_LENGTH = 2000;
|
|
9
|
+
/**
|
|
10
|
+
* Normalize and harden plain text before it hits TipTap / Pixi / editor store.
|
|
11
|
+
*/
|
|
12
|
+
export declare const sanitizeCanvasText: (input: unknown, maxLen?: number) => string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repairs a `data:` URI that had a CDN origin wrongly prepended, e.g.
|
|
3
|
+
* https://x.cloudfront.net/data:image/png;base64,AAAA?Expires=... -> data:image/png;base64,AAAA
|
|
4
|
+
* and drops the signed-URL query params appended after the payload. Anything else is
|
|
5
|
+
* returned unchanged. Ported from the Clippy editor.
|
|
6
|
+
*/
|
|
7
|
+
export declare function sanitizeImageSrc(src: string | undefined | null): string | undefined | null;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const BASE_STROKE_WIDTH_SVG = 2;
|
|
2
|
+
/** Longest side of the SVG's own coordinate system (viewBox, else width/height, else 512). */
|
|
3
|
+
export declare const readOriginalSize: (svgEl: Element) => number;
|
|
4
|
+
/** Outline (stroke-based) icons need `meet` scaling and stroke handling; filled ones stretch. */
|
|
5
|
+
export declare const detectOutlineIcon: (svgEl: Element) => boolean;
|
|
6
|
+
export declare const computeStrokeWidth: ({ shouldApply, strokeWidth, resolution, renderWidth, renderHeight, originalSize, isOutline, }: {
|
|
7
|
+
shouldApply: boolean;
|
|
8
|
+
strokeWidth: number;
|
|
9
|
+
resolution: number;
|
|
10
|
+
renderWidth: number;
|
|
11
|
+
renderHeight: number;
|
|
12
|
+
originalSize: number;
|
|
13
|
+
isOutline: boolean;
|
|
14
|
+
}) => number;
|
|
15
|
+
export declare const applyStrokeToShapes: (svgEl: Element, stroke: string, strokeWidth: number) => void;
|
|
16
|
+
export declare const scaleExistingStrokes: (svgEl: Element, scale: number, minStroke: number, resolution: number, originalSize: number, renderSize: number) => void;
|
|
17
|
+
export interface BuildRasterSvgOptions {
|
|
18
|
+
/** Target size in CSS px (before `resolution`). Falls back to the SVG's own size. */
|
|
19
|
+
width?: number;
|
|
20
|
+
height?: number;
|
|
21
|
+
resolution: number;
|
|
22
|
+
stroke?: string;
|
|
23
|
+
strokeWidth?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Re-write an SVG so that drawing it onto a `width*res x height*res` canvas is crisp and
|
|
27
|
+
* its strokes scale sensibly. Returns the serialized SVG. Non-SVG documents are returned as is.
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildRasterSvg(svgText: string, opts: BuildRasterSvgOptions): string;
|
|
30
|
+
export interface RewriteSvgOptions {
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
fill?: string;
|
|
34
|
+
stroke?: string;
|
|
35
|
+
strokeWidth?: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Size an SVG for baking through `Graphics.svg()` and optionally override fill/stroke on the
|
|
39
|
+
* root element (paths that inherit pick it up; per-path fills and gradients are left alone).
|
|
40
|
+
*
|
|
41
|
+
* Fix vs Clippy: it forced `viewBox="0 0 w h"`, discarding the artwork's real viewBox and
|
|
42
|
+
* distorting non-square art. The original viewBox is kept; one is only synthesised when the
|
|
43
|
+
* document has none.
|
|
44
|
+
*/
|
|
45
|
+
export declare function rewriteSvg(svgText: string, opts: RewriteSvgOptions): string;
|
|
46
|
+
/** True for `.svg` URLs and inline `data:image/svg+xml` sources. */
|
|
47
|
+
export declare const isSvgSource: (src: string) => boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AepLayer, AepTextStyleRun } from '../../types/aep';
|
|
2
|
+
import { TextRunsValidationResult } from '../../types/aep/text-runs';
|
|
3
|
+
type AepTextLayer = Extract<AepLayer, {
|
|
4
|
+
kind: "text";
|
|
5
|
+
}>;
|
|
6
|
+
export declare function resolveTextRuns(layer: AepTextLayer): ReadonlyArray<AepTextStyleRun>;
|
|
7
|
+
export declare function resolveTextRunsWithWarnings(layer: AepTextLayer): TextRunsValidationResult;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RawGlyph } from './shapeRuns';
|
|
2
|
+
import { RawLine } from './breakLines';
|
|
3
|
+
import { AepTextAlign } from './types';
|
|
4
|
+
interface AlignArgs {
|
|
5
|
+
glyphs: RawGlyph[];
|
|
6
|
+
lines: RawLine[];
|
|
7
|
+
align: AepTextAlign;
|
|
8
|
+
boxWidth: number | undefined;
|
|
9
|
+
}
|
|
10
|
+
export interface AlignedGlyphPosition {
|
|
11
|
+
x: number;
|
|
12
|
+
extraAdvance: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function alignLines({ glyphs, lines, align, boxWidth, }: AlignArgs): AlignedGlyphPosition[];
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RawGlyph } from './shapeRuns';
|
|
2
|
+
import { RawLine } from './breakLines';
|
|
3
|
+
interface VerticalArgs {
|
|
4
|
+
glyphs: RawGlyph[];
|
|
5
|
+
lines: RawLine[];
|
|
6
|
+
leading: number | undefined;
|
|
7
|
+
}
|
|
8
|
+
export interface LineVerticals {
|
|
9
|
+
baselineY: number;
|
|
10
|
+
ascent: number;
|
|
11
|
+
descent: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function applyVerticals({ glyphs, lines, leading, }: VerticalArgs): LineVerticals[];
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RawGlyph } from './shapeRuns';
|
|
2
|
+
export interface RawLine {
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
width: number;
|
|
6
|
+
collapsedTrailing: number;
|
|
7
|
+
endsWithHardBreak: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface BreakLinesArgs {
|
|
10
|
+
glyphs: RawGlyph[];
|
|
11
|
+
maxWidth: number | undefined;
|
|
12
|
+
}
|
|
13
|
+
export declare function breakLines({ glyphs, maxWidth }: BreakLinesArgs): RawLine[];
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AepTextMetricsProvider } from './types';
|
|
2
|
+
import { MetricsCache } from './metricsCache';
|
|
3
|
+
export interface CanvasMetricsProviderOptions {
|
|
4
|
+
cache?: MetricsCache;
|
|
5
|
+
}
|
|
6
|
+
export declare function createCanvasMetricsProvider(opts?: CanvasMetricsProviderOptions): AepTextMetricsProvider;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type { AepTextAlign, AepGlyphMetrics, AepTextLayoutGlyph, AepTextLayoutInput, AepTextLayoutLine, AepTextLayoutResult, AepTextLayoutRun, AepTextMetricsProvider, } from './types';
|
|
2
|
+
export { layoutText, resetDefaultTextMetrics } from './layoutText';
|
|
3
|
+
export { createCanvasMetricsProvider, type CanvasMetricsProviderOptions, } from './canvasMetricsProvider';
|
|
4
|
+
export { createPixiCanvasMetricsProvider, type PixiCanvasMetricsProviderOptions, } from './pixiCanvasMetricsProvider';
|
|
5
|
+
export { createTypefaceMetricsProvider, type ThreeTypefaceJson, } from './typefaceMetricsProvider';
|
|
6
|
+
export { MetricsCache, metricsCacheKey } from './metricsCache';
|
|
7
|
+
export { splitGraphemes, isWhitespaceChar } from './unicode';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AepTextLayoutInput, AepTextLayoutResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Drop the default provider and its glyph-metrics cache. Call after webfonts finish loading:
|
|
4
|
+
* glyphs measured against the fallback font are otherwise cached and stay wrong.
|
|
5
|
+
*/
|
|
6
|
+
export declare function resetDefaultTextMetrics(): void;
|
|
7
|
+
export declare function layoutText(input: AepTextLayoutInput): AepTextLayoutResult;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AepGlyphMetrics, AepTextLayoutRun } from './types';
|
|
2
|
+
export declare function metricsCacheKey(run: AepTextLayoutRun, ch: string): string;
|
|
3
|
+
export declare class MetricsCache {
|
|
4
|
+
private map;
|
|
5
|
+
get(key: string): AepGlyphMetrics | undefined;
|
|
6
|
+
set(key: string, value: AepGlyphMetrics): void;
|
|
7
|
+
clear(): void;
|
|
8
|
+
get size(): number;
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AepTextMetricsProvider } from './types';
|
|
2
|
+
import { MetricsCache } from './metricsCache';
|
|
3
|
+
export interface PixiCanvasMetricsProviderOptions {
|
|
4
|
+
cache?: MetricsCache;
|
|
5
|
+
}
|
|
6
|
+
export declare function createPixiCanvasMetricsProvider(opts?: PixiCanvasMetricsProviderOptions): AepTextMetricsProvider;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AepTextLayoutInput, AepTextMetricsProvider } from './types';
|
|
2
|
+
export interface RawGlyph {
|
|
3
|
+
char: string;
|
|
4
|
+
runIndex: number;
|
|
5
|
+
charIndex: number;
|
|
6
|
+
advance: number;
|
|
7
|
+
ascent: number;
|
|
8
|
+
descent: number;
|
|
9
|
+
isWhitespace: boolean;
|
|
10
|
+
isHardBreak: boolean;
|
|
11
|
+
baselineShift: number;
|
|
12
|
+
}
|
|
13
|
+
interface ShapeRunsArgs {
|
|
14
|
+
input: AepTextLayoutInput;
|
|
15
|
+
metrics: AepTextMetricsProvider;
|
|
16
|
+
}
|
|
17
|
+
export declare function shapeRuns({ input, metrics }: ShapeRunsArgs): RawGlyph[];
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AepTextMetricsProvider } from './types';
|
|
2
|
+
export interface ThreeTypefaceJson {
|
|
3
|
+
glyphs: Record<string, {
|
|
4
|
+
ha: number;
|
|
5
|
+
x_min?: number;
|
|
6
|
+
x_max?: number;
|
|
7
|
+
o?: string;
|
|
8
|
+
}>;
|
|
9
|
+
resolution: number;
|
|
10
|
+
ascender?: number;
|
|
11
|
+
descender?: number;
|
|
12
|
+
boundingBox?: {
|
|
13
|
+
yMin?: number;
|
|
14
|
+
yMax?: number;
|
|
15
|
+
xMin?: number;
|
|
16
|
+
xMax?: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare function createTypefaceMetricsProvider(typeface: ThreeTypefaceJson): AepTextMetricsProvider;
|