@luceosports/play-rendering 2.1.0 → 2.1.1
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/dist/play-rendering.js +2 -2
- package/dist/play-rendering.js.map +1 -1
- package/dist/types/models/NoteModel.d.ts +1 -0
- package/dist/types/models/PlayModel.d.ts +1 -0
- package/dist/types/models/ShapeModel.d.ts +1 -0
- package/dist/types/types/index.d.ts +2 -0
- package/package.json +1 -1
- package/src/helpers/animation.ts +1 -1
- package/src/models/NoteModel.ts +4 -0
- package/src/models/Play/Options.ts +2 -1
- package/src/models/PlayModel.ts +1 -0
- package/src/models/ShapeModel.ts +4 -0
- package/src/types/index.ts +2 -0
|
@@ -101,6 +101,7 @@ export interface Shape {
|
|
|
101
101
|
showBorder?: boolean;
|
|
102
102
|
linePart?: LinePart;
|
|
103
103
|
animations: Animation[];
|
|
104
|
+
hideForStatic?: boolean;
|
|
104
105
|
}
|
|
105
106
|
export interface Note {
|
|
106
107
|
id: string;
|
|
@@ -111,6 +112,7 @@ export interface Note {
|
|
|
111
112
|
font: NoteFont;
|
|
112
113
|
color: Color;
|
|
113
114
|
showBorder: boolean;
|
|
115
|
+
hideForStatic?: boolean;
|
|
114
116
|
}
|
|
115
117
|
export interface NoteFont {
|
|
116
118
|
bold: boolean;
|
package/package.json
CHANGED
package/src/helpers/animation.ts
CHANGED
|
@@ -4,7 +4,7 @@ import _ from 'lodash';
|
|
|
4
4
|
import { FrameDataOptions } from '../models/FrameModel';
|
|
5
5
|
|
|
6
6
|
export function computeAnimationAlpha(model: NoteModel | ShapeModel, options: FrameDataOptions) {
|
|
7
|
-
let alpha = 1;
|
|
7
|
+
let alpha = model.hideForStatic && !options.inDrawingState ? 0 : 1;
|
|
8
8
|
if (options.animationGlobalProgress) {
|
|
9
9
|
alpha = 0;
|
|
10
10
|
const animationKeyTimeChunks = model.animations.map(a => {
|
package/src/models/NoteModel.ts
CHANGED
|
@@ -24,7 +24,8 @@ export function useDefaults(options?: Partial<PlayModelOptions>): PlayModelOptio
|
|
|
24
24
|
// TODO: refactor NBA court type constants below
|
|
25
25
|
showHalfCourtCircle: true,
|
|
26
26
|
playersMap: [],
|
|
27
|
-
labelsOverrideType: null
|
|
27
|
+
labelsOverrideType: null,
|
|
28
|
+
inDrawingState: false
|
|
28
29
|
};
|
|
29
30
|
return {
|
|
30
31
|
...defaults,
|
package/src/models/PlayModel.ts
CHANGED
package/src/models/ShapeModel.ts
CHANGED
|
@@ -53,6 +53,10 @@ export default abstract class ShapeModel extends Model<ShapeData, ShapeData> {
|
|
|
53
53
|
return this._getAttr('animations') || [];
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
get hideForStatic() {
|
|
57
|
+
return this._getAttr('hideForStatic');
|
|
58
|
+
}
|
|
59
|
+
|
|
56
60
|
get rectWrapPointsPure() {
|
|
57
61
|
const topLeft = { x: -this.outerCircleRadius / 2, y: -this.outerCircleRadius / 2 };
|
|
58
62
|
const topRight = { x: this.outerCircleRadius / 2, y: -this.outerCircleRadius / 2 };
|
package/src/types/index.ts
CHANGED
|
@@ -164,6 +164,7 @@ export interface Shape {
|
|
|
164
164
|
showBorder?: boolean;
|
|
165
165
|
linePart?: LinePart;
|
|
166
166
|
animations: Animation[];
|
|
167
|
+
hideForStatic?: boolean;
|
|
167
168
|
}
|
|
168
169
|
|
|
169
170
|
export interface Note {
|
|
@@ -175,6 +176,7 @@ export interface Note {
|
|
|
175
176
|
font: NoteFont;
|
|
176
177
|
color: Color;
|
|
177
178
|
showBorder: boolean;
|
|
179
|
+
hideForStatic?: boolean;
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
export interface NoteFont {
|