reacthub-pixitweenjs 0.2.109-alpha.5 → 0.3.0-alpha.3
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 +247 -103
- 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 +28 -0
- package/dist/components/AepComposition/AepComposition.d.ts +16 -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/composeTransform3D.d.ts +27 -0
- package/dist/components/AepComposition/index.d.ts +39 -0
- package/dist/components/AepComposition/matteSourceIds.d.ts +2 -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 +5 -7
- package/dist/components/PixiAudioSprite/PixiAudioSprite.d.ts +9 -2
- package/dist/components/PixiAudioSprite/useAudioVisualizer.d.ts +2 -2
- package/dist/components/PixiAudioSprite/wave-config.d.ts +0 -1
- package/dist/components/PixiGifSprite/PixiGifGsapSync.d.ts +14 -10
- package/dist/components/PixiImageSprite/PixiImageSprite.d.ts +14 -1
- package/dist/components/PixiLottieSprite/PixiLottieSprite.d.ts +8 -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/PixiSvgPathSprite.d.ts +14 -4
- package/dist/components/PixiSVGSprite/index.d.ts +1 -0
- 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 +20 -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/PixiThreeSprite.d.ts +14 -0
- package/dist/components/PixiThreeSprite/index.d.ts +2 -0
- package/dist/components/PixiUnifiedTransformer/PixiUnifiedTransformer.d.ts +38 -0
- package/dist/components/PixiUnifiedTransformer/index.d.ts +1 -0
- package/dist/components/PixiVideoSprite/PixiVideoCanvasSync.d.ts +3 -1
- package/dist/components/PixiVideoSprite/PixiVideoSprite.d.ts +8 -2
- package/dist/components/index.d.ts +6 -0
- package/dist/events/Events.d.ts +0 -1
- package/dist/hocs/AbstractContainer.d.ts +19 -1
- package/dist/hocs/BorderMaskContainer.d.ts +28 -0
- package/dist/hocs/OverlayTilingSprite.d.ts +3 -3
- package/dist/hocs/drawMaskShape.d.ts +3 -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 +2 -0
- package/dist/hooks/useSpriteFilters.d.ts +39 -0
- package/dist/hooks/withFiltersHook.d.ts +1 -1
- 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 +59996 -31176
- package/dist/index.umd.js +4351 -1851
- 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/types/BaseProps.d.ts +11 -3
- 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 +21579 -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 +3 -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/aeMath/zoomToFov.d.ts +1 -0
- package/dist/utils/areSpritePropsEqual.d.ts +8 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/isExternalUrl.d.ts +1 -0
- package/dist/utils/loadSpriteTexture.d.ts +10 -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/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 +2 -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/package.json +77 -45
- package/dist/components/PixiAudioSprite/PixiAudioSprite.stories.d.ts +0 -105
- package/dist/components/PixiGifSprite/PixiGifSprite.stories.d.ts +0 -153
- package/dist/components/PixiImageSprite/PixiImageSprite.stories.d.ts +0 -136
- package/dist/components/PixiLottieSprite/PixiLottieSprite.stories.d.ts +0 -149
- package/dist/components/PixiSVGSprite/PixiSvgPathSprite.stories.d.ts +0 -121
- package/dist/components/PixiSequence/PixiSequence.stories.d.ts +0 -33
- package/dist/components/PixiTextSprite/PixiTextSprite.stories.d.ts +0 -130
- package/dist/components/PixiTransformer/MenuIcons.d.ts +0 -40
- package/dist/components/PixiTransformer/MenuUtils.d.ts +0 -2
- package/dist/components/PixiTransformer/PixiColorPicker.d.ts +0 -14
- package/dist/components/PixiTransformer/PixiDropdownMenu.d.ts +0 -15
- package/dist/components/PixiTransformer/PixiMenuText.d.ts +0 -2
- package/dist/components/PixiTransformer/PixiTransformer.d.ts +0 -20
- package/dist/components/PixiTransformer/PixiTransformerMenu.d.ts +0 -9
- package/dist/components/PixiTransformer/Transformer.d.ts +0 -39
- package/dist/components/PixiTransformer/applyEventProps.d.ts +0 -10
- package/dist/components/PixiTransformer/index.d.ts +0 -1
- package/dist/components/PixiVideoSprite/PixiVideoSprite.stories.d.ts +0 -136
- package/dist/hooks/withEffectsHook.d.ts +0 -5
- 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 -22
- 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/pixiExtend.d.ts} +0 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Point } from 'pixi.js';
|
|
2
|
+
/**
|
|
3
|
+
* Rectangle object is an area defined by its position, as indicated by its top-left corner
|
|
4
|
+
* point (x, y) and by its width and its height.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare class AxisAlignedBounds {
|
|
9
|
+
currentID: number;
|
|
10
|
+
dirtyID: number;
|
|
11
|
+
protected _x: number;
|
|
12
|
+
protected _y: number;
|
|
13
|
+
protected _width: number;
|
|
14
|
+
protected _height: number;
|
|
15
|
+
protected _hull: [Point, Point, Point, Point];
|
|
16
|
+
/**
|
|
17
|
+
* @param [x=0] - The X coordinate of the upper-left corner of the rectangle
|
|
18
|
+
* @param [y=0] - The Y coordinate of the upper-left corner of the rectangle
|
|
19
|
+
* @param [width=0] - The overall width of this rectangle
|
|
20
|
+
* @param [height=0] - The overall height of this rectangle
|
|
21
|
+
*/
|
|
22
|
+
constructor(x?: number, y?: number, width?: number, height?: number);
|
|
23
|
+
get x(): number;
|
|
24
|
+
set x(value: number);
|
|
25
|
+
get y(): number;
|
|
26
|
+
set y(value: number);
|
|
27
|
+
get width(): number;
|
|
28
|
+
set width(value: number);
|
|
29
|
+
get height(): number;
|
|
30
|
+
set height(value: number);
|
|
31
|
+
get hull(): Point[];
|
|
32
|
+
get topLeft(): Point;
|
|
33
|
+
get topRight(): Point;
|
|
34
|
+
get bottomRight(): Point;
|
|
35
|
+
get bottomLeft(): Point;
|
|
36
|
+
protected isDirty(): boolean;
|
|
37
|
+
protected update(): void;
|
|
38
|
+
/**
|
|
39
|
+
* returns the left edge of the rectangle
|
|
40
|
+
*
|
|
41
|
+
* @member {number}
|
|
42
|
+
*/
|
|
43
|
+
get left(): number;
|
|
44
|
+
/**
|
|
45
|
+
* returns the right edge of the rectangle
|
|
46
|
+
*/
|
|
47
|
+
get right(): number;
|
|
48
|
+
/**
|
|
49
|
+
* returns the top edge of the rectangle
|
|
50
|
+
*/
|
|
51
|
+
get top(): number;
|
|
52
|
+
/**
|
|
53
|
+
* returns the bottom edge of the rectangle
|
|
54
|
+
*/
|
|
55
|
+
get bottom(): number;
|
|
56
|
+
/**
|
|
57
|
+
* Creates a clone of this Rectangle
|
|
58
|
+
*
|
|
59
|
+
* @return A copy of this AxisAlignedBounds.
|
|
60
|
+
*/
|
|
61
|
+
clone(): AxisAlignedBounds;
|
|
62
|
+
/**
|
|
63
|
+
* Copies another rectangle to this one.
|
|
64
|
+
*
|
|
65
|
+
* @param rectangle - The rectangle to copy from.
|
|
66
|
+
* @return Returns itself.
|
|
67
|
+
*/
|
|
68
|
+
copyFrom(rectangle: AxisAlignedBounds): AxisAlignedBounds;
|
|
69
|
+
/**
|
|
70
|
+
* Copies this rectangle to another one.
|
|
71
|
+
*
|
|
72
|
+
* @param rectangle - The rectangle to copy to.
|
|
73
|
+
* @return Returns given parameter.
|
|
74
|
+
*/
|
|
75
|
+
copyTo(rectangle: AxisAlignedBounds): AxisAlignedBounds;
|
|
76
|
+
/**
|
|
77
|
+
* Checks whether the x and y coordinates given are contained within this Rectangle
|
|
78
|
+
*
|
|
79
|
+
* @param x - The X coordinate of the point to test
|
|
80
|
+
* @param y - The Y coordinate of the point to test
|
|
81
|
+
* @return Whether the x/y coordinates are within this Rectangle
|
|
82
|
+
*/
|
|
83
|
+
contains(x: number, y: number): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Checks whether the given {@code bounds} are equal to this.
|
|
86
|
+
*
|
|
87
|
+
* @param bounds
|
|
88
|
+
*/
|
|
89
|
+
equals(bounds: AxisAlignedBounds): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Pads the rectangle making it grow in all directions.
|
|
92
|
+
* If paddingY is omitted, both paddingX and paddingY will be set to paddingX.
|
|
93
|
+
*
|
|
94
|
+
* @param [paddingX=0] - The horizontal padding amount.
|
|
95
|
+
* @param [paddingY=0] - The vertical padding amount.
|
|
96
|
+
* @return Returns itself.
|
|
97
|
+
*/
|
|
98
|
+
pad(paddingX?: number, paddingY?: number): this;
|
|
99
|
+
/**
|
|
100
|
+
* Fits this rectangle around the passed one.
|
|
101
|
+
*
|
|
102
|
+
* @param rectangle - The rectangle to fit.
|
|
103
|
+
* @return Returns itself.
|
|
104
|
+
*/
|
|
105
|
+
fit(rectangle: AxisAlignedBounds): this;
|
|
106
|
+
/**
|
|
107
|
+
* Enlarges rectangle that way its corners lie on grid
|
|
108
|
+
*
|
|
109
|
+
* @param [resolution=1] - resolution
|
|
110
|
+
* @param [eps=0.001] - precision
|
|
111
|
+
* @return Returns itself.
|
|
112
|
+
*/
|
|
113
|
+
ceil(resolution?: number, eps?: number): this;
|
|
114
|
+
/**
|
|
115
|
+
* Enlarges this rectangle to include the passed rectangle.
|
|
116
|
+
*
|
|
117
|
+
* @param rectangle - The rectangle to include.
|
|
118
|
+
* @return Returns itself.
|
|
119
|
+
*/
|
|
120
|
+
enlarge(rectangle: AxisAlignedBounds): this;
|
|
121
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { AxisAlignedBounds } from './AxisAlignedBounds';
|
|
2
|
+
import { Matrix, Point } from 'pixi.js';
|
|
3
|
+
/**
|
|
4
|
+
* An oriented bounding box is a rotated rectangle.
|
|
5
|
+
*
|
|
6
|
+
* An oriented bounding box is modelled by rotating its (axis-aligned) {@link OrientedBounds#innerBounds}
|
|
7
|
+
* by an angle {@link OrientedBounds#angle} around its center. The center of an oriented bounding box and
|
|
8
|
+
* its axis-aligned inner-bounds coincide.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export declare class OrientedBounds {
|
|
13
|
+
innerBounds: AxisAlignedBounds;
|
|
14
|
+
currentID: number;
|
|
15
|
+
dirtyID: number;
|
|
16
|
+
protected _rotation: number;
|
|
17
|
+
protected _center: Point;
|
|
18
|
+
protected _hull: [Point, Point, Point, Point];
|
|
19
|
+
protected _matrix: Matrix;
|
|
20
|
+
/**
|
|
21
|
+
* @param innerBounds
|
|
22
|
+
* @param angle
|
|
23
|
+
*/
|
|
24
|
+
constructor(innerBounds: AxisAlignedBounds, angle?: number);
|
|
25
|
+
/**
|
|
26
|
+
* @param x
|
|
27
|
+
* @param y
|
|
28
|
+
* @param width
|
|
29
|
+
* @param height
|
|
30
|
+
* @param angle
|
|
31
|
+
*/
|
|
32
|
+
constructor(x?: number, y?: number, width?: number, height?: number, angle?: number);
|
|
33
|
+
/**
|
|
34
|
+
* The angle, in radians, by which this bounding box is tilted.
|
|
35
|
+
*/
|
|
36
|
+
get rotation(): number;
|
|
37
|
+
set rotation(value: number);
|
|
38
|
+
/**
|
|
39
|
+
* The center of this bounding box.
|
|
40
|
+
*
|
|
41
|
+
* The center of this and {@code this.innerBounds} will always coincide.
|
|
42
|
+
*/
|
|
43
|
+
get center(): Point;
|
|
44
|
+
set center(value: Point);
|
|
45
|
+
/**
|
|
46
|
+
* The four-corners of this bounding, in clockwise order starting from the top-left.
|
|
47
|
+
*
|
|
48
|
+
* @readonly
|
|
49
|
+
*/
|
|
50
|
+
get hull(): [Point, Point, Point, Point];
|
|
51
|
+
/**
|
|
52
|
+
* The top-left corner of this bounding box. The returned instance should not be modified directly.
|
|
53
|
+
*
|
|
54
|
+
* @readonly
|
|
55
|
+
*/
|
|
56
|
+
get topLeft(): Point;
|
|
57
|
+
/**
|
|
58
|
+
* The top-right corner of this bounding box. The returned instance should not be modified directly.
|
|
59
|
+
*
|
|
60
|
+
* @readonly
|
|
61
|
+
*/
|
|
62
|
+
get topRight(): Point;
|
|
63
|
+
/**
|
|
64
|
+
* The bottom-right corner of this bounding box. The returned instance should not be modified directly.
|
|
65
|
+
*/
|
|
66
|
+
get bottomRight(): Point;
|
|
67
|
+
/**
|
|
68
|
+
* The bottom-left corner of this bounding box. The returned instance should not be modified directly.
|
|
69
|
+
*/
|
|
70
|
+
get bottomLeft(): Point;
|
|
71
|
+
/**
|
|
72
|
+
* Checks whether the given {@code bounds} are equal to this.
|
|
73
|
+
*
|
|
74
|
+
* @param bounds
|
|
75
|
+
*/
|
|
76
|
+
equals(bounds: OrientedBounds): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Whether this bounding box contains the given point
|
|
79
|
+
*
|
|
80
|
+
* @param point
|
|
81
|
+
*/
|
|
82
|
+
contains(point: Point | number, y?: number): boolean;
|
|
83
|
+
/**
|
|
84
|
+
* Copies {@code bounds} into this instance.
|
|
85
|
+
*
|
|
86
|
+
* @param bounds
|
|
87
|
+
*/
|
|
88
|
+
copyFrom(bounds: OrientedBounds): this;
|
|
89
|
+
/**
|
|
90
|
+
* Whether any internal state needs to be recalculated.
|
|
91
|
+
*/
|
|
92
|
+
protected isDirty(): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* This will recalculate the center, orientation matrix, and the hull vertices. It should be called only if
|
|
95
|
+
* {@code this.isDirty} returns true.
|
|
96
|
+
*/
|
|
97
|
+
protected update(): void;
|
|
98
|
+
/**
|
|
99
|
+
* This will translate {@link OrientedBounds#innerBounds} after {@link OrientedBounds#center} is
|
|
100
|
+
* changed to ensure consistency.
|
|
101
|
+
*/
|
|
102
|
+
private updateCenter;
|
|
103
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Transformer as TransformerImpl, TransformerHandle, TransformerWireframe, } from './transformer';
|
|
2
|
+
export type { Handle, RotateHandle, ScaleHandle, SkewHandle, ITransformerOptions, ITransformerStyle, ITransformerCursors, ITransformerColorTheme, IRotatorAnchorConfig, ITransformerHandleStyle, ITransformCommitPayload, ITransformerElementDims, ITransformerGroupBoundsSnapshot, } from './transformer';
|
|
3
|
+
export * from './object-pool';
|
|
4
|
+
export * from './bounds';
|
|
5
|
+
export { Transformer } from './react-bindings/Transformer';
|
|
6
|
+
export type { TransformerProps } from './react-bindings/Transformer';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides the exponential moving average of a sequence.
|
|
3
|
+
*
|
|
4
|
+
* Ignored because not directly exposed.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
* @ignore
|
|
8
|
+
* @class
|
|
9
|
+
*/
|
|
10
|
+
export declare class AverageProvider {
|
|
11
|
+
private _history;
|
|
12
|
+
private _decayRatio;
|
|
13
|
+
private _currentIndex;
|
|
14
|
+
private _average;
|
|
15
|
+
/**
|
|
16
|
+
* @ignore
|
|
17
|
+
* @param {number} windowSize - no. of inputs used to calculate window
|
|
18
|
+
* @param {number} decayRatio - quantifies the weight of previous values (b/w 0 and 1)
|
|
19
|
+
*/
|
|
20
|
+
constructor(windowSize: number, decayRatio: number);
|
|
21
|
+
/**
|
|
22
|
+
* @ignore
|
|
23
|
+
* @param {number} input - the next value in the sequence
|
|
24
|
+
* @returns {number} - the moving average
|
|
25
|
+
*/
|
|
26
|
+
next(input: number): number;
|
|
27
|
+
absDev(): number;
|
|
28
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Ticker } from 'pixi.js';
|
|
2
|
+
/**
|
|
3
|
+
* @interface
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface IObjectPoolOptions {
|
|
7
|
+
capacityRatio?: number;
|
|
8
|
+
decayRatio?: number;
|
|
9
|
+
reserve?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* `ObjectPool` provides the framework necessary for pooling minus the object instantiation
|
|
13
|
+
* method. You can use `ObjectPoolFactory` for objects that can be created using a default
|
|
14
|
+
* constructor.
|
|
15
|
+
*
|
|
16
|
+
* @template T
|
|
17
|
+
* @class
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export declare abstract class ObjectPool<T> {
|
|
21
|
+
protected _freeList: Array<T>;
|
|
22
|
+
protected _freeCount: number;
|
|
23
|
+
protected _reserveCount: number;
|
|
24
|
+
protected _borrowRate: number;
|
|
25
|
+
protected _returnRate: number;
|
|
26
|
+
protected _flowRate: number;
|
|
27
|
+
protected _borrowRateAverage: number;
|
|
28
|
+
protected _marginAverage: number;
|
|
29
|
+
private _capacityRatio;
|
|
30
|
+
private _decayRatio;
|
|
31
|
+
private _borrowRateAverageProvider;
|
|
32
|
+
private _marginAverageProvider;
|
|
33
|
+
/**
|
|
34
|
+
* @param {IObjectPoolOptions} options
|
|
35
|
+
*/
|
|
36
|
+
constructor(options?: IObjectPoolOptions);
|
|
37
|
+
/**
|
|
38
|
+
* Instantiates a new object of type `T`.
|
|
39
|
+
*
|
|
40
|
+
* @abstract
|
|
41
|
+
* @returns {T}
|
|
42
|
+
*/
|
|
43
|
+
abstract create(): T;
|
|
44
|
+
/**
|
|
45
|
+
* The number of objects that can be stored in the pool without allocating more space.
|
|
46
|
+
*
|
|
47
|
+
* @member {number}
|
|
48
|
+
*/
|
|
49
|
+
protected get capacity(): number;
|
|
50
|
+
protected set capacity(cp: number);
|
|
51
|
+
/**
|
|
52
|
+
* Obtains an instance from this pool.
|
|
53
|
+
*
|
|
54
|
+
* @returns {T}
|
|
55
|
+
*/
|
|
56
|
+
allocate(): T;
|
|
57
|
+
/**
|
|
58
|
+
* Obtains an array of instances from this pool. This is faster than allocating multiple objects
|
|
59
|
+
* separately from this pool.
|
|
60
|
+
*
|
|
61
|
+
* @param {number | T[]} lengthOrArray - no. of objects to allocate OR the array itself into which
|
|
62
|
+
* objects are inserted. The amount to allocate is inferred from the array's length.
|
|
63
|
+
* @returns {T[]} array of allocated objects
|
|
64
|
+
*/
|
|
65
|
+
allocateArray(lengthOrArray: number | T[]): T[];
|
|
66
|
+
/**
|
|
67
|
+
* Returns the object to the pool.
|
|
68
|
+
*
|
|
69
|
+
* @param {T} object
|
|
70
|
+
*/
|
|
71
|
+
release(object: T): void;
|
|
72
|
+
/**
|
|
73
|
+
* Releases all of the objects in the passed array. These need not be allocated using `allocateArray`, however.
|
|
74
|
+
*
|
|
75
|
+
* @param {T[]} array
|
|
76
|
+
*/
|
|
77
|
+
releaseArray(array: T[]): void;
|
|
78
|
+
/**
|
|
79
|
+
* Preallocates objects so that the pool size is at least `count`.
|
|
80
|
+
*
|
|
81
|
+
* @param {number} count
|
|
82
|
+
*/
|
|
83
|
+
reserve(count: number): void;
|
|
84
|
+
/**
|
|
85
|
+
* Dereferences objects for the GC to collect and brings the pool size down to `count`.
|
|
86
|
+
*
|
|
87
|
+
* @param {number} count
|
|
88
|
+
*/
|
|
89
|
+
limit(count: number): void;
|
|
90
|
+
/**
|
|
91
|
+
* Install the GC on the shared ticker.
|
|
92
|
+
*
|
|
93
|
+
* @param {Ticker}[ticker=Ticker.shared]
|
|
94
|
+
*/
|
|
95
|
+
startGC(ticker?: Ticker): void;
|
|
96
|
+
/**
|
|
97
|
+
* Stops running the GC on the pool.
|
|
98
|
+
*
|
|
99
|
+
* @param {Ticker}[ticker=Ticker.shared]
|
|
100
|
+
*/
|
|
101
|
+
stopGC(ticker?: Ticker): void;
|
|
102
|
+
private _gcTick;
|
|
103
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ObjectPool } from './ObjectPool';
|
|
2
|
+
/**
|
|
3
|
+
* Factory for creating pools of objects with default constructors. It will store the pool of
|
|
4
|
+
* a given type and reuse it on further builds.
|
|
5
|
+
*
|
|
6
|
+
* @class
|
|
7
|
+
* @public
|
|
8
|
+
* @example
|
|
9
|
+
* ```js
|
|
10
|
+
* import { ObjectPool, ObjectPoolFactory } from '@pixi-essentials/object-pool';
|
|
11
|
+
*
|
|
12
|
+
* class AABB {}
|
|
13
|
+
*
|
|
14
|
+
* const opool: ObjectPool<AABB> = ObjectPoolFactory.build(AABB) as ObjectPool<AABB>;
|
|
15
|
+
*
|
|
16
|
+
* const temp = opool.borrowObject();
|
|
17
|
+
* // do something
|
|
18
|
+
* opool.returnObject(temp);
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare class ObjectPoolFactory {
|
|
22
|
+
/**
|
|
23
|
+
* Builds an object-pool for objects constructed from the given class with a default constructor. If an
|
|
24
|
+
* object pool for that class was already created, an existing instance is returned.
|
|
25
|
+
*
|
|
26
|
+
* @param classConstructor
|
|
27
|
+
*/
|
|
28
|
+
static build<T>(Type: {
|
|
29
|
+
new (): T;
|
|
30
|
+
}): ObjectPool<T>;
|
|
31
|
+
/**
|
|
32
|
+
* Builds an object-pool for objects built using a factory function. The factory function's context will be the
|
|
33
|
+
* object-pool.
|
|
34
|
+
*
|
|
35
|
+
* These types of pools are not cached and should only be used on internal data structures.
|
|
36
|
+
*
|
|
37
|
+
* @param factoryFunction
|
|
38
|
+
*/
|
|
39
|
+
static buildFunctional<T>(factoryFunction: () => T): ObjectPool<T>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Container as ContainerImpl, Matrix } from 'pixi.js';
|
|
2
|
+
import { Transformer as TransformerImpl, TransformerHandle as TransformerHandleImpl, Handle } from '../transformer/index';
|
|
3
|
+
import { ITransformerCursors, ITransformerStyle, ITransformerColorTheme, IRotatorAnchorConfig, ITransformCommitPayload, ITransformerHandleStyle } from '../transformer';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
/** @internal */
|
|
6
|
+
export type TransformerProps = {
|
|
7
|
+
boundingBoxes?: 'all' | 'groupOnly' | 'none';
|
|
8
|
+
boxScalingEnabled?: boolean;
|
|
9
|
+
boxScalingTolerance?: number;
|
|
10
|
+
boxRotationEnabled?: boolean;
|
|
11
|
+
boxRotationTolerance?: number;
|
|
12
|
+
centeredScaling?: boolean;
|
|
13
|
+
clickThreshold?: number;
|
|
14
|
+
cursors?: Partial<ITransformerCursors>;
|
|
15
|
+
enabledHandles?: Array<string>;
|
|
16
|
+
group?: ContainerImpl[];
|
|
17
|
+
handleConstructor?: typeof TransformerHandleImpl;
|
|
18
|
+
handleStyle?: Partial<ITransformerHandleStyle>;
|
|
19
|
+
lockAspectRatio?: boolean;
|
|
20
|
+
projectionTransform?: Matrix;
|
|
21
|
+
rotateEnabled?: boolean;
|
|
22
|
+
rotationSnaps?: number[];
|
|
23
|
+
rotationSnapTolerance?: number;
|
|
24
|
+
scaleEnabled?: boolean;
|
|
25
|
+
skewEnabled?: boolean;
|
|
26
|
+
skewRadius?: number;
|
|
27
|
+
skewSnaps?: number[];
|
|
28
|
+
skewSnapTolerance?: number;
|
|
29
|
+
translateEnabled?: boolean;
|
|
30
|
+
transientGroupTilt?: boolean;
|
|
31
|
+
transformchange?: () => void;
|
|
32
|
+
transformstart?: (event: {
|
|
33
|
+
handle: Handle | null;
|
|
34
|
+
transformType: 'translate' | 'scale' | 'rotate' | 'skew' | 'none';
|
|
35
|
+
}) => void;
|
|
36
|
+
wireframeStyle?: Partial<ITransformerStyle>;
|
|
37
|
+
colorTheme?: Partial<ITransformerColorTheme>;
|
|
38
|
+
rotatorAnchor?: Partial<IRotatorAnchorConfig>;
|
|
39
|
+
nestedSelectionEnabled?: boolean;
|
|
40
|
+
focusedElementBorderColor?: number;
|
|
41
|
+
focusedElementBorderThickness?: number;
|
|
42
|
+
focusedElementBorderStyle?: 'solid' | 'dashed' | 'dotted';
|
|
43
|
+
focusedElementBorderDashPattern?: [number, number];
|
|
44
|
+
showNonFocusedBorders?: boolean;
|
|
45
|
+
individualBorderColor?: number;
|
|
46
|
+
individualBorderThickness?: number;
|
|
47
|
+
individualBorderAlpha?: number;
|
|
48
|
+
individualBorderStyle?: 'solid' | 'dashed' | 'dotted';
|
|
49
|
+
individualBorderDashPattern?: [number, number];
|
|
50
|
+
elementfocused?: (element: ContainerImpl, index: number) => void;
|
|
51
|
+
elementfocuscleared?: () => void;
|
|
52
|
+
transformcommit?: (payload: ITransformCommitPayload) => void;
|
|
53
|
+
focusedElementIndex?: number;
|
|
54
|
+
onFocusChange?: (index: number, element: ContainerImpl | null) => void;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Pixi v8 React binding for the imperative `Transformer` class.
|
|
58
|
+
*
|
|
59
|
+
* The v7 implementation used `@pixi/react`'s `PixiComponent('Name', { create,
|
|
60
|
+
* applyProps })` factory plus `applyDefaultProps`. Both are gone in
|
|
61
|
+
* `@pixi/react@8`: the new model registers custom intrinsics via `extend({})`,
|
|
62
|
+
* or mounts arbitrary Pixi display objects imperatively as children of a
|
|
63
|
+
* declarative `<pixiContainer>` via a ref.
|
|
64
|
+
*
|
|
65
|
+
* This component takes the **imperative** route: it renders an invisible
|
|
66
|
+
* `<pixiContainer ref={parentRef}>`, instantiates the `TransformerImpl` class
|
|
67
|
+
* once in a `useEffect`, attaches it to the parent's child list, and re-runs
|
|
68
|
+
* the `applyProps` body on every prop change. Cleanup removes the instance and
|
|
69
|
+
* destroys it.
|
|
70
|
+
*
|
|
71
|
+
* @see https://react.pixijs.io/getting-started/
|
|
72
|
+
* @see https://github.com/SukantPal/pixi-essentials/tree/master/packages/transformer
|
|
73
|
+
*/
|
|
74
|
+
export declare const Transformer: React.ForwardRefExoticComponent<TransformerProps & React.RefAttributes<TransformerImpl>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Container } from 'pixi.js';
|
|
2
|
+
/**
|
|
3
|
+
* Removes old listeners and applies the new ones passed in the props.
|
|
4
|
+
*
|
|
5
|
+
* Pixi v8 removed `DisplayObject` — `Container` is the new base class and
|
|
6
|
+
* still extends `EventEmitter`, so the on/off API is identical.
|
|
7
|
+
*
|
|
8
|
+
* @param container - container emitting events
|
|
9
|
+
* @param events - object mapping handler prop-names to the fired events
|
|
10
|
+
* @param oldProps - old props. If calling on first props being passed, this should be `{}`.
|
|
11
|
+
* @param newProps - new props.
|
|
12
|
+
*/
|
|
13
|
+
export declare function applyEventProps(container: Container, events: Record<string, string>, oldProps: any, newProps: any): void;
|