payload-plugin-decks 1.0.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 +205 -0
- package/dist/blocks/decks/config.d.ts +2 -0
- package/dist/blocks/decks/config.js +148 -0
- package/dist/blocks/decks/config.js.map +1 -0
- package/dist/blocks/decks/index.d.ts +4 -0
- package/dist/blocks/decks/index.js +6 -0
- package/dist/blocks/decks/index.js.map +1 -0
- package/dist/components/decks/DecksBlock.d.ts +5 -0
- package/dist/components/decks/DecksBlock.js +104 -0
- package/dist/components/decks/DecksBlock.js.map +1 -0
- package/dist/components/decks/DecksComposition.d.ts +9 -0
- package/dist/components/decks/DecksComposition.js +94 -0
- package/dist/components/decks/DecksComposition.js.map +1 -0
- package/dist/components/decks/SnapContainer.d.ts +6 -0
- package/dist/components/decks/SnapContainer.js +61 -0
- package/dist/components/decks/SnapContainer.js.map +1 -0
- package/dist/components/decks/styles.css +167 -0
- package/dist/components/decks/useDecksSnap.d.ts +8 -0
- package/dist/components/decks/useDecksSnap.js +101 -0
- package/dist/components/decks/useDecksSnap.js.map +1 -0
- package/dist/decks/install.d.ts +16 -0
- package/dist/decks/install.js +36 -0
- package/dist/decks/install.js.map +1 -0
- package/dist/decks/install.spec.d.ts +1 -0
- package/dist/decks/install.spec.js +65 -0
- package/dist/decks/install.spec.js.map +1 -0
- package/dist/decks/model.d.ts +48 -0
- package/dist/decks/model.js +36 -0
- package/dist/decks/model.js.map +1 -0
- package/dist/decks/model.spec.d.ts +1 -0
- package/dist/decks/model.spec.js +55 -0
- package/dist/decks/model.spec.js.map +1 -0
- package/dist/decks/schema.d.ts +59 -0
- package/dist/decks/schema.js +75 -0
- package/dist/decks/schema.js.map +1 -0
- package/dist/decks/timeline.d.ts +37 -0
- package/dist/decks/timeline.js +205 -0
- package/dist/decks/timeline.js.map +1 -0
- package/dist/decks/timeline.spec.d.ts +1 -0
- package/dist/decks/timeline.spec.js +75 -0
- package/dist/decks/timeline.spec.js.map +1 -0
- package/dist/exports/client.d.ts +1 -0
- package/dist/exports/client.js +3 -0
- package/dist/exports/client.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/package.json +135 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export declare const DECKS_DEFAULTS: {
|
|
2
|
+
readonly animationType: "fadeIn";
|
|
3
|
+
readonly autoPlay: true;
|
|
4
|
+
readonly backgroundColor: "#000000";
|
|
5
|
+
readonly durationPerSlide: 3;
|
|
6
|
+
readonly fps: 30;
|
|
7
|
+
readonly imageZoom: true;
|
|
8
|
+
readonly loop: true;
|
|
9
|
+
readonly showControls: false;
|
|
10
|
+
readonly textColor: "#ffffff";
|
|
11
|
+
readonly textPosition: "center";
|
|
12
|
+
readonly transitionDuration: 15;
|
|
13
|
+
};
|
|
14
|
+
export declare const decksTextPositionOptions: readonly [{
|
|
15
|
+
readonly label: "Top Left";
|
|
16
|
+
readonly value: "top-left";
|
|
17
|
+
}, {
|
|
18
|
+
readonly label: "Top Center";
|
|
19
|
+
readonly value: "top-center";
|
|
20
|
+
}, {
|
|
21
|
+
readonly label: "Top Right";
|
|
22
|
+
readonly value: "top-right";
|
|
23
|
+
}, {
|
|
24
|
+
readonly label: "Center Left";
|
|
25
|
+
readonly value: "center-left";
|
|
26
|
+
}, {
|
|
27
|
+
readonly label: "Center";
|
|
28
|
+
readonly value: "center";
|
|
29
|
+
}, {
|
|
30
|
+
readonly label: "Center Right";
|
|
31
|
+
readonly value: "center-right";
|
|
32
|
+
}, {
|
|
33
|
+
readonly label: "Bottom Left";
|
|
34
|
+
readonly value: "bottom-left";
|
|
35
|
+
}, {
|
|
36
|
+
readonly label: "Bottom Center";
|
|
37
|
+
readonly value: "bottom-center";
|
|
38
|
+
}, {
|
|
39
|
+
readonly label: "Bottom Right";
|
|
40
|
+
readonly value: "bottom-right";
|
|
41
|
+
}];
|
|
42
|
+
export declare const decksAnimationOptions: readonly [{
|
|
43
|
+
readonly label: "Fade In";
|
|
44
|
+
readonly value: "fadeIn";
|
|
45
|
+
}, {
|
|
46
|
+
readonly label: "Slide Up";
|
|
47
|
+
readonly value: "slideUp";
|
|
48
|
+
}, {
|
|
49
|
+
readonly label: "Slide Down";
|
|
50
|
+
readonly value: "slideDown";
|
|
51
|
+
}, {
|
|
52
|
+
readonly label: "Scale In";
|
|
53
|
+
readonly value: "scaleIn";
|
|
54
|
+
}, {
|
|
55
|
+
readonly label: "None";
|
|
56
|
+
readonly value: "none";
|
|
57
|
+
}];
|
|
58
|
+
export type DecksAnimationType = (typeof decksAnimationOptions)[number]['value'];
|
|
59
|
+
export type DecksTextPosition = (typeof decksTextPositionOptions)[number]['value'];
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export const DECKS_DEFAULTS = {
|
|
2
|
+
animationType: 'fadeIn',
|
|
3
|
+
autoPlay: true,
|
|
4
|
+
backgroundColor: '#000000',
|
|
5
|
+
durationPerSlide: 3,
|
|
6
|
+
fps: 30,
|
|
7
|
+
imageZoom: true,
|
|
8
|
+
loop: true,
|
|
9
|
+
showControls: false,
|
|
10
|
+
textColor: '#ffffff',
|
|
11
|
+
textPosition: 'center',
|
|
12
|
+
transitionDuration: 15
|
|
13
|
+
};
|
|
14
|
+
export const decksTextPositionOptions = [
|
|
15
|
+
{
|
|
16
|
+
label: 'Top Left',
|
|
17
|
+
value: 'top-left'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
label: 'Top Center',
|
|
21
|
+
value: 'top-center'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: 'Top Right',
|
|
25
|
+
value: 'top-right'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
label: 'Center Left',
|
|
29
|
+
value: 'center-left'
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'Center',
|
|
33
|
+
value: 'center'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: 'Center Right',
|
|
37
|
+
value: 'center-right'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: 'Bottom Left',
|
|
41
|
+
value: 'bottom-left'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: 'Bottom Center',
|
|
45
|
+
value: 'bottom-center'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: 'Bottom Right',
|
|
49
|
+
value: 'bottom-right'
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
export const decksAnimationOptions = [
|
|
53
|
+
{
|
|
54
|
+
label: 'Fade In',
|
|
55
|
+
value: 'fadeIn'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: 'Slide Up',
|
|
59
|
+
value: 'slideUp'
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
label: 'Slide Down',
|
|
63
|
+
value: 'slideDown'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
label: 'Scale In',
|
|
67
|
+
value: 'scaleIn'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
label: 'None',
|
|
71
|
+
value: 'none'
|
|
72
|
+
}
|
|
73
|
+
];
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/decks/schema.ts"],"sourcesContent":["export const DECKS_DEFAULTS = {\n animationType: 'fadeIn',\n autoPlay: true,\n backgroundColor: '#000000',\n durationPerSlide: 3,\n fps: 30,\n imageZoom: true,\n loop: true,\n showControls: false,\n textColor: '#ffffff',\n textPosition: 'center',\n transitionDuration: 15,\n} as const\n\nexport const decksTextPositionOptions = [\n { label: 'Top Left', value: 'top-left' },\n { label: 'Top Center', value: 'top-center' },\n { label: 'Top Right', value: 'top-right' },\n { label: 'Center Left', value: 'center-left' },\n { label: 'Center', value: 'center' },\n { label: 'Center Right', value: 'center-right' },\n { label: 'Bottom Left', value: 'bottom-left' },\n { label: 'Bottom Center', value: 'bottom-center' },\n { label: 'Bottom Right', value: 'bottom-right' },\n] as const\n\nexport const decksAnimationOptions = [\n { label: 'Fade In', value: 'fadeIn' },\n { label: 'Slide Up', value: 'slideUp' },\n { label: 'Slide Down', value: 'slideDown' },\n { label: 'Scale In', value: 'scaleIn' },\n { label: 'None', value: 'none' },\n] as const\n\nexport type DecksAnimationType =\n (typeof decksAnimationOptions)[number]['value']\n\nexport type DecksTextPosition =\n (typeof decksTextPositionOptions)[number]['value']\n"],"names":["DECKS_DEFAULTS","animationType","autoPlay","backgroundColor","durationPerSlide","fps","imageZoom","loop","showControls","textColor","textPosition","transitionDuration","decksTextPositionOptions","label","value","decksAnimationOptions"],"mappings":"AAAA,OAAO,MAAMA,iBAAiB;IAC5BC,eAAe;IACfC,UAAU;IACVC,iBAAiB;IACjBC,kBAAkB;IAClBC,KAAK;IACLC,WAAW;IACXC,MAAM;IACNC,cAAc;IACdC,WAAW;IACXC,cAAc;IACdC,oBAAoB;AACtB,EAAU;AAEV,OAAO,MAAMC,2BAA2B;IACtC;QAAEC,OAAO;QAAYC,OAAO;IAAW;IACvC;QAAED,OAAO;QAAcC,OAAO;IAAa;IAC3C;QAAED,OAAO;QAAaC,OAAO;IAAY;IACzC;QAAED,OAAO;QAAeC,OAAO;IAAc;IAC7C;QAAED,OAAO;QAAUC,OAAO;IAAS;IACnC;QAAED,OAAO;QAAgBC,OAAO;IAAe;IAC/C;QAAED,OAAO;QAAeC,OAAO;IAAc;IAC7C;QAAED,OAAO;QAAiBC,OAAO;IAAgB;IACjD;QAAED,OAAO;QAAgBC,OAAO;IAAe;CAChD,CAAS;AAEV,OAAO,MAAMC,wBAAwB;IACnC;QAAEF,OAAO;QAAWC,OAAO;IAAS;IACpC;QAAED,OAAO;QAAYC,OAAO;IAAU;IACtC;QAAED,OAAO;QAAcC,OAAO;IAAY;IAC1C;QAAED,OAAO;QAAYC,OAAO;IAAU;IACtC;QAAED,OAAO;QAAQC,OAAO;IAAO;CAChC,CAAS"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
export type SlideMetricInput = {
|
|
3
|
+
frame: number;
|
|
4
|
+
slideDuration: number;
|
|
5
|
+
transitionDuration: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const getSlideDurationFrames: ({ durationPerSlide, fps, }: {
|
|
8
|
+
durationPerSlide: number;
|
|
9
|
+
fps: number;
|
|
10
|
+
}) => number;
|
|
11
|
+
export declare const getSlideOpacity: ({ frame, slideDuration, transitionDuration, }: SlideMetricInput) => number;
|
|
12
|
+
export declare const getImageScale: ({ frame, imageZoom, slideDuration, }: {
|
|
13
|
+
frame: number;
|
|
14
|
+
imageZoom: boolean;
|
|
15
|
+
slideDuration: number;
|
|
16
|
+
}) => number;
|
|
17
|
+
export declare const getPositionStyles: (position: string) => CSSProperties;
|
|
18
|
+
export declare const getTextAnimationStyles: ({ animationType, frame, transitionDuration, }: {
|
|
19
|
+
animationType?: string;
|
|
20
|
+
frame: number;
|
|
21
|
+
transitionDuration: number;
|
|
22
|
+
}) => CSSProperties;
|
|
23
|
+
export interface SlideStylesInput {
|
|
24
|
+
animationType?: string;
|
|
25
|
+
frame: number;
|
|
26
|
+
imageZoom: boolean;
|
|
27
|
+
slideDuration: number;
|
|
28
|
+
textPosition: string;
|
|
29
|
+
transitionDuration: number;
|
|
30
|
+
}
|
|
31
|
+
export interface SlideStyles {
|
|
32
|
+
imageScale: number;
|
|
33
|
+
opacity: number;
|
|
34
|
+
position: CSSProperties;
|
|
35
|
+
textAnimation: CSSProperties;
|
|
36
|
+
}
|
|
37
|
+
export declare const getSlideStyles: ({ animationType, frame, imageZoom, slideDuration, textPosition, transitionDuration, }: SlideStylesInput) => SlideStyles;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { interpolate } from 'remotion';
|
|
2
|
+
export const getSlideDurationFrames = ({ durationPerSlide, fps })=>{
|
|
3
|
+
return durationPerSlide * fps;
|
|
4
|
+
};
|
|
5
|
+
export const getSlideOpacity = ({ frame, slideDuration, transitionDuration })=>{
|
|
6
|
+
return interpolate(frame, [
|
|
7
|
+
0,
|
|
8
|
+
transitionDuration,
|
|
9
|
+
slideDuration - transitionDuration,
|
|
10
|
+
slideDuration
|
|
11
|
+
], [
|
|
12
|
+
0,
|
|
13
|
+
1,
|
|
14
|
+
1,
|
|
15
|
+
0
|
|
16
|
+
], {
|
|
17
|
+
extrapolateLeft: 'clamp',
|
|
18
|
+
extrapolateRight: 'clamp'
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
export const getImageScale = ({ frame, imageZoom, slideDuration })=>{
|
|
22
|
+
if (!imageZoom) {
|
|
23
|
+
return 1;
|
|
24
|
+
}
|
|
25
|
+
return interpolate(frame, [
|
|
26
|
+
0,
|
|
27
|
+
slideDuration
|
|
28
|
+
], [
|
|
29
|
+
1,
|
|
30
|
+
1.1
|
|
31
|
+
], {
|
|
32
|
+
extrapolateLeft: 'clamp',
|
|
33
|
+
extrapolateRight: 'clamp'
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
export const getPositionStyles = (position)=>{
|
|
37
|
+
const baseStyles = {
|
|
38
|
+
maxWidth: '80%',
|
|
39
|
+
padding: '2rem',
|
|
40
|
+
position: 'absolute'
|
|
41
|
+
};
|
|
42
|
+
switch(position){
|
|
43
|
+
case 'bottom-center':
|
|
44
|
+
return {
|
|
45
|
+
...baseStyles,
|
|
46
|
+
bottom: '10%',
|
|
47
|
+
left: '50%',
|
|
48
|
+
textAlign: 'center',
|
|
49
|
+
transform: 'translateX(-50%)'
|
|
50
|
+
};
|
|
51
|
+
case 'bottom-left':
|
|
52
|
+
return {
|
|
53
|
+
...baseStyles,
|
|
54
|
+
bottom: '10%',
|
|
55
|
+
left: '5%',
|
|
56
|
+
textAlign: 'left'
|
|
57
|
+
};
|
|
58
|
+
case 'bottom-right':
|
|
59
|
+
return {
|
|
60
|
+
...baseStyles,
|
|
61
|
+
bottom: '10%',
|
|
62
|
+
right: '5%',
|
|
63
|
+
textAlign: 'right'
|
|
64
|
+
};
|
|
65
|
+
case 'center':
|
|
66
|
+
return {
|
|
67
|
+
...baseStyles,
|
|
68
|
+
left: '50%',
|
|
69
|
+
textAlign: 'center',
|
|
70
|
+
top: '50%',
|
|
71
|
+
transform: 'translate(-50%, -50%)'
|
|
72
|
+
};
|
|
73
|
+
case 'center-left':
|
|
74
|
+
return {
|
|
75
|
+
...baseStyles,
|
|
76
|
+
left: '5%',
|
|
77
|
+
textAlign: 'left',
|
|
78
|
+
top: '50%',
|
|
79
|
+
transform: 'translateY(-50%)'
|
|
80
|
+
};
|
|
81
|
+
case 'center-right':
|
|
82
|
+
return {
|
|
83
|
+
...baseStyles,
|
|
84
|
+
right: '5%',
|
|
85
|
+
textAlign: 'right',
|
|
86
|
+
top: '50%',
|
|
87
|
+
transform: 'translateY(-50%)'
|
|
88
|
+
};
|
|
89
|
+
case 'top-center':
|
|
90
|
+
return {
|
|
91
|
+
...baseStyles,
|
|
92
|
+
left: '50%',
|
|
93
|
+
textAlign: 'center',
|
|
94
|
+
top: '10%',
|
|
95
|
+
transform: 'translateX(-50%)'
|
|
96
|
+
};
|
|
97
|
+
case 'top-left':
|
|
98
|
+
return {
|
|
99
|
+
...baseStyles,
|
|
100
|
+
left: '5%',
|
|
101
|
+
textAlign: 'left',
|
|
102
|
+
top: '10%'
|
|
103
|
+
};
|
|
104
|
+
case 'top-right':
|
|
105
|
+
return {
|
|
106
|
+
...baseStyles,
|
|
107
|
+
right: '5%',
|
|
108
|
+
textAlign: 'right',
|
|
109
|
+
top: '10%'
|
|
110
|
+
};
|
|
111
|
+
default:
|
|
112
|
+
return {
|
|
113
|
+
...baseStyles,
|
|
114
|
+
left: '50%',
|
|
115
|
+
textAlign: 'center',
|
|
116
|
+
top: '50%',
|
|
117
|
+
transform: 'translate(-50%, -50%)'
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
export const getTextAnimationStyles = ({ animationType, frame, transitionDuration })=>{
|
|
122
|
+
const animationProgress = interpolate(frame, [
|
|
123
|
+
transitionDuration,
|
|
124
|
+
transitionDuration + 20
|
|
125
|
+
], [
|
|
126
|
+
0,
|
|
127
|
+
1
|
|
128
|
+
], {
|
|
129
|
+
extrapolateLeft: 'clamp',
|
|
130
|
+
extrapolateRight: 'clamp'
|
|
131
|
+
});
|
|
132
|
+
switch(animationType){
|
|
133
|
+
case 'none':
|
|
134
|
+
return {};
|
|
135
|
+
case 'scaleIn':
|
|
136
|
+
{
|
|
137
|
+
const scaleValue = interpolate(animationProgress, [
|
|
138
|
+
0,
|
|
139
|
+
1
|
|
140
|
+
], [
|
|
141
|
+
0.8,
|
|
142
|
+
1
|
|
143
|
+
]);
|
|
144
|
+
return {
|
|
145
|
+
opacity: animationProgress,
|
|
146
|
+
transform: `scale(${scaleValue})`
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
case 'slideDown':
|
|
150
|
+
{
|
|
151
|
+
const translateYDown = interpolate(animationProgress, [
|
|
152
|
+
0,
|
|
153
|
+
1
|
|
154
|
+
], [
|
|
155
|
+
-50,
|
|
156
|
+
0
|
|
157
|
+
]);
|
|
158
|
+
return {
|
|
159
|
+
opacity: animationProgress,
|
|
160
|
+
transform: `translateY(${translateYDown}px)`
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
case 'slideUp':
|
|
164
|
+
{
|
|
165
|
+
const translateY = interpolate(animationProgress, [
|
|
166
|
+
0,
|
|
167
|
+
1
|
|
168
|
+
], [
|
|
169
|
+
50,
|
|
170
|
+
0
|
|
171
|
+
]);
|
|
172
|
+
return {
|
|
173
|
+
opacity: animationProgress,
|
|
174
|
+
transform: `translateY(${translateY}px)`
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
case 'fadeIn':
|
|
178
|
+
default:
|
|
179
|
+
return {
|
|
180
|
+
opacity: animationProgress
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
export const getSlideStyles = ({ animationType, frame, imageZoom, slideDuration, textPosition, transitionDuration })=>{
|
|
185
|
+
return {
|
|
186
|
+
imageScale: getImageScale({
|
|
187
|
+
frame,
|
|
188
|
+
imageZoom,
|
|
189
|
+
slideDuration
|
|
190
|
+
}),
|
|
191
|
+
opacity: getSlideOpacity({
|
|
192
|
+
frame,
|
|
193
|
+
slideDuration,
|
|
194
|
+
transitionDuration
|
|
195
|
+
}),
|
|
196
|
+
position: getPositionStyles(textPosition),
|
|
197
|
+
textAnimation: getTextAnimationStyles({
|
|
198
|
+
animationType,
|
|
199
|
+
frame,
|
|
200
|
+
transitionDuration
|
|
201
|
+
})
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
//# sourceMappingURL=timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/decks/timeline.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\n\nimport { interpolate } from 'remotion'\n\nexport type SlideMetricInput = {\n frame: number\n slideDuration: number\n transitionDuration: number\n}\n\nexport const getSlideDurationFrames = ({\n durationPerSlide,\n fps,\n}: {\n durationPerSlide: number\n fps: number\n}) => {\n return durationPerSlide * fps\n}\n\nexport const getSlideOpacity = ({\n frame,\n slideDuration,\n transitionDuration,\n}: SlideMetricInput) => {\n return interpolate(\n frame,\n [0, transitionDuration, slideDuration - transitionDuration, slideDuration],\n [0, 1, 1, 0],\n {\n extrapolateLeft: 'clamp',\n extrapolateRight: 'clamp',\n },\n )\n}\n\nexport const getImageScale = ({\n frame,\n imageZoom,\n slideDuration,\n}: {\n frame: number\n imageZoom: boolean\n slideDuration: number\n}) => {\n if (!imageZoom) {\n return 1\n }\n\n return interpolate(frame, [0, slideDuration], [1, 1.1], {\n extrapolateLeft: 'clamp',\n extrapolateRight: 'clamp',\n })\n}\n\nexport const getPositionStyles = (position: string): CSSProperties => {\n const baseStyles: CSSProperties = {\n maxWidth: '80%',\n padding: '2rem',\n position: 'absolute',\n }\n\n switch (position) {\n case 'bottom-center':\n return {\n ...baseStyles,\n bottom: '10%',\n left: '50%',\n textAlign: 'center',\n transform: 'translateX(-50%)',\n }\n case 'bottom-left':\n return { ...baseStyles, bottom: '10%', left: '5%', textAlign: 'left' }\n case 'bottom-right':\n return { ...baseStyles, bottom: '10%', right: '5%', textAlign: 'right' }\n case 'center':\n return {\n ...baseStyles,\n left: '50%',\n textAlign: 'center',\n top: '50%',\n transform: 'translate(-50%, -50%)',\n }\n case 'center-left':\n return {\n ...baseStyles,\n left: '5%',\n textAlign: 'left',\n top: '50%',\n transform: 'translateY(-50%)',\n }\n case 'center-right':\n return {\n ...baseStyles,\n right: '5%',\n textAlign: 'right',\n top: '50%',\n transform: 'translateY(-50%)',\n }\n case 'top-center':\n return {\n ...baseStyles,\n left: '50%',\n textAlign: 'center',\n top: '10%',\n transform: 'translateX(-50%)',\n }\n case 'top-left':\n return { ...baseStyles, left: '5%', textAlign: 'left', top: '10%' }\n case 'top-right':\n return { ...baseStyles, right: '5%', textAlign: 'right', top: '10%' }\n default:\n return {\n ...baseStyles,\n left: '50%',\n textAlign: 'center',\n top: '50%',\n transform: 'translate(-50%, -50%)',\n }\n }\n}\n\nexport const getTextAnimationStyles = ({\n animationType,\n frame,\n transitionDuration,\n}: {\n animationType?: string\n frame: number\n transitionDuration: number\n}): CSSProperties => {\n const animationProgress = interpolate(\n frame,\n [transitionDuration, transitionDuration + 20],\n [0, 1],\n {\n extrapolateLeft: 'clamp',\n extrapolateRight: 'clamp',\n },\n )\n\n switch (animationType) {\n case 'none':\n return {}\n case 'scaleIn': {\n const scaleValue = interpolate(animationProgress, [0, 1], [0.8, 1])\n return { opacity: animationProgress, transform: `scale(${scaleValue})` }\n }\n case 'slideDown': {\n const translateYDown = interpolate(animationProgress, [0, 1], [-50, 0])\n return { opacity: animationProgress, transform: `translateY(${translateYDown}px)` }\n }\n case 'slideUp': {\n const translateY = interpolate(animationProgress, [0, 1], [50, 0])\n return { opacity: animationProgress, transform: `translateY(${translateY}px)` }\n }\n case 'fadeIn':\n default:\n return { opacity: animationProgress }\n }\n}\n\nexport interface SlideStylesInput {\n animationType?: string\n frame: number\n imageZoom: boolean\n slideDuration: number\n textPosition: string\n transitionDuration: number\n}\n\nexport interface SlideStyles {\n imageScale: number\n opacity: number\n position: CSSProperties\n textAnimation: CSSProperties\n}\n\nexport const getSlideStyles = ({\n animationType,\n frame,\n imageZoom,\n slideDuration,\n textPosition,\n transitionDuration,\n}: SlideStylesInput): SlideStyles => {\n return {\n imageScale: getImageScale({ frame, imageZoom, slideDuration }),\n opacity: getSlideOpacity({ frame, slideDuration, transitionDuration }),\n position: getPositionStyles(textPosition),\n textAnimation: getTextAnimationStyles({ animationType, frame, transitionDuration }),\n }\n}\n"],"names":["interpolate","getSlideDurationFrames","durationPerSlide","fps","getSlideOpacity","frame","slideDuration","transitionDuration","extrapolateLeft","extrapolateRight","getImageScale","imageZoom","getPositionStyles","position","baseStyles","maxWidth","padding","bottom","left","textAlign","transform","right","top","getTextAnimationStyles","animationType","animationProgress","scaleValue","opacity","translateYDown","translateY","getSlideStyles","textPosition","imageScale","textAnimation"],"mappings":"AAEA,SAASA,WAAW,QAAQ,WAAU;AAQtC,OAAO,MAAMC,yBAAyB,CAAC,EACrCC,gBAAgB,EAChBC,GAAG,EAIJ;IACC,OAAOD,mBAAmBC;AAC5B,EAAC;AAED,OAAO,MAAMC,kBAAkB,CAAC,EAC9BC,KAAK,EACLC,aAAa,EACbC,kBAAkB,EACD;IACjB,OAAOP,YACLK,OACA;QAAC;QAAGE;QAAoBD,gBAAgBC;QAAoBD;KAAc,EAC1E;QAAC;QAAG;QAAG;QAAG;KAAE,EACZ;QACEE,iBAAiB;QACjBC,kBAAkB;IACpB;AAEJ,EAAC;AAED,OAAO,MAAMC,gBAAgB,CAAC,EAC5BL,KAAK,EACLM,SAAS,EACTL,aAAa,EAKd;IACC,IAAI,CAACK,WAAW;QACd,OAAO;IACT;IAEA,OAAOX,YAAYK,OAAO;QA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1
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import { getImageScale, getPositionStyles, getSlideDurationFrames, getSlideOpacity, getSlideStyles, getTextAnimationStyles } from './timeline.js';
|
|
3
|
+
describe('decks timeline', ()=>{
|
|
4
|
+
test('calculates frame duration from seconds and fps', ()=>{
|
|
5
|
+
expect(getSlideDurationFrames({
|
|
6
|
+
durationPerSlide: 3,
|
|
7
|
+
fps: 30
|
|
8
|
+
})).toBe(90);
|
|
9
|
+
});
|
|
10
|
+
test('fades slides in and out around the transition frames', ()=>{
|
|
11
|
+
expect(getSlideOpacity({
|
|
12
|
+
frame: 0,
|
|
13
|
+
slideDuration: 90,
|
|
14
|
+
transitionDuration: 15
|
|
15
|
+
})).toBe(0);
|
|
16
|
+
expect(getSlideOpacity({
|
|
17
|
+
frame: 15,
|
|
18
|
+
slideDuration: 90,
|
|
19
|
+
transitionDuration: 15
|
|
20
|
+
})).toBe(1);
|
|
21
|
+
expect(getSlideOpacity({
|
|
22
|
+
frame: 75,
|
|
23
|
+
slideDuration: 90,
|
|
24
|
+
transitionDuration: 15
|
|
25
|
+
})).toBe(1);
|
|
26
|
+
expect(getSlideOpacity({
|
|
27
|
+
frame: 90,
|
|
28
|
+
slideDuration: 90,
|
|
29
|
+
transitionDuration: 15
|
|
30
|
+
})).toBe(0);
|
|
31
|
+
});
|
|
32
|
+
test('describes image and text layout without rendering Remotion', ()=>{
|
|
33
|
+
expect(getImageScale({
|
|
34
|
+
frame: 45,
|
|
35
|
+
imageZoom: true,
|
|
36
|
+
slideDuration: 90
|
|
37
|
+
})).toBeCloseTo(1.05);
|
|
38
|
+
expect(getImageScale({
|
|
39
|
+
frame: 45,
|
|
40
|
+
imageZoom: false,
|
|
41
|
+
slideDuration: 90
|
|
42
|
+
})).toBe(1);
|
|
43
|
+
expect(getPositionStyles('bottom-center')).toMatchObject({
|
|
44
|
+
bottom: '10%',
|
|
45
|
+
left: '50%',
|
|
46
|
+
textAlign: 'center'
|
|
47
|
+
});
|
|
48
|
+
expect(getTextAnimationStyles({
|
|
49
|
+
animationType: 'slideUp',
|
|
50
|
+
frame: 35,
|
|
51
|
+
transitionDuration: 15
|
|
52
|
+
})).toMatchObject({
|
|
53
|
+
opacity: 1,
|
|
54
|
+
transform: 'translateY(0px)'
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
test('composes all slide styles through a single aggregate call', ()=>{
|
|
58
|
+
const styles = getSlideStyles({
|
|
59
|
+
animationType: 'fadeIn',
|
|
60
|
+
frame: 45,
|
|
61
|
+
imageZoom: true,
|
|
62
|
+
slideDuration: 90,
|
|
63
|
+
textPosition: 'bottom-center',
|
|
64
|
+
transitionDuration: 15
|
|
65
|
+
});
|
|
66
|
+
expect(styles.opacity).toBe(1);
|
|
67
|
+
expect(styles.imageScale).toBeCloseTo(1.05);
|
|
68
|
+
expect(styles.position).toMatchObject({
|
|
69
|
+
bottom: '10%'
|
|
70
|
+
});
|
|
71
|
+
expect(styles.textAnimation).toHaveProperty('opacity');
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=timeline.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/decks/timeline.spec.ts"],"sourcesContent":["import { describe, expect, test } from 'vitest'\n\nimport {\n getImageScale,\n getPositionStyles,\n getSlideDurationFrames,\n getSlideOpacity,\n getSlideStyles,\n getTextAnimationStyles,\n} from './timeline.js'\n\ndescribe('decks timeline', () => {\n test('calculates frame duration from seconds and fps', () => {\n expect(getSlideDurationFrames({ durationPerSlide: 3, fps: 30 })).toBe(90)\n })\n\n test('fades slides in and out around the transition frames', () => {\n expect(getSlideOpacity({ frame: 0, slideDuration: 90, transitionDuration: 15 })).toBe(0)\n expect(getSlideOpacity({ frame: 15, slideDuration: 90, transitionDuration: 15 })).toBe(1)\n expect(getSlideOpacity({ frame: 75, slideDuration: 90, transitionDuration: 15 })).toBe(1)\n expect(getSlideOpacity({ frame: 90, slideDuration: 90, transitionDuration: 15 })).toBe(0)\n })\n\n test('describes image and text layout without rendering Remotion', () => {\n expect(getImageScale({ frame: 45, imageZoom: true, slideDuration: 90 })).toBeCloseTo(1.05)\n expect(getImageScale({ frame: 45, imageZoom: false, slideDuration: 90 })).toBe(1)\n expect(getPositionStyles('bottom-center')).toMatchObject({\n bottom: '10%',\n left: '50%',\n textAlign: 'center',\n })\n expect(\n getTextAnimationStyles({\n animationType: 'slideUp',\n frame: 35,\n transitionDuration: 15,\n }),\n ).toMatchObject({\n opacity: 1,\n transform: 'translateY(0px)',\n })\n })\n\n test('composes all slide styles through a single aggregate call', () => {\n const styles = getSlideStyles({\n animationType: 'fadeIn',\n frame: 45,\n imageZoom: true,\n slideDuration: 90,\n textPosition: 'bottom-center',\n transitionDuration: 15,\n })\n\n expect(styles.opacity).toBe(1)\n expect(styles.imageScale).toBeCloseTo(1.05)\n expect(styles.position).toMatchObject({ bottom: '10%' })\n expect(styles.textAnimation).toHaveProperty('opacity')\n })\n})\n\n"],"names":["describe","expect","test","getImageScale","getPositionStyles","getSlideDurationFrames","getSlideOpacity","getSlideStyles","getTextAnimationStyles","durationPerSlide","fps","toBe","frame","slideDuration","transitionDuration","imageZoom","toBeCloseTo","toMatchObject","bottom","left","textAlign","animationType","opacity","transform","styles","textPosition","imageScale","position","textAnimation","toHaveProperty"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,IAAI,QAAQ,SAAQ;AAE/C,SACEC,aAAa,EACbC,iBAAiB,EACjBC,sBAAsB,EACtBC,eAAe,EACfC,cAAc,EACdC,sBAAsB,QACjB,gBAAe;AAEtBR,SAAS,kBAAkB;IACzBE,KAAK,kDAAkD;QACrDD,OAAOI,uBAAuB;YAAEI,kBAAkB;YAAGC,KAAK;QAAG,IAAIC,IAAI,CAAC;IACxE;IAEAT,KAAK,wDAAwD;QAC3DD,OAAOK,gBAAgB;YAAEM,OAA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cesContent":["export { DecksBlock } from '../components/decks/DecksBlock.js'\n"],"names":["DecksBlock"],"mappings":"AAAA,SAASA,UAAU,QAAQ,oCAAmC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Config } from 'payload';
|
|
2
|
+
import { type PayloadDecksConfig } from './decks/install.js';
|
|
3
|
+
export { DecksBlock } from './blocks/decks/config.js';
|
|
4
|
+
export type { PayloadDecksConfig } from './decks/install.js';
|
|
5
|
+
export type { DecksBlockProps, DecksSlide, } from './decks/model.js';
|
|
6
|
+
export { normalizeDecksBlock } from './decks/model.js';
|
|
7
|
+
export declare const payloadDecks: (pluginOptions?: PayloadDecksConfig) => (config: Config) => Config;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { installDecksField } from './decks/install.js';
|
|
2
|
+
export { DecksBlock } from './blocks/decks/config.js';
|
|
3
|
+
export { normalizeDecksBlock } from './decks/model.js';
|
|
4
|
+
export const payloadDecks = (pluginOptions = {})=>(config)=>{
|
|
5
|
+
installDecksField(config, pluginOptions);
|
|
6
|
+
return config;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import type { Config } from 'payload'\n\nimport { installDecksField, type PayloadDecksConfig } from './decks/install.js'\n\nexport { DecksBlock } from './blocks/decks/config.js'\nexport type { PayloadDecksConfig } from './decks/install.js'\nexport type {\n DecksBlockProps,\n DecksSlide,\n} from './decks/model.js'\nexport { normalizeDecksBlock } from './decks/model.js'\n\nexport const payloadDecks =\n (pluginOptions: PayloadDecksConfig = {}) =>\n (config: Config): Config => {\n installDecksField(config, pluginOptions)\n\n return config\n }\n"],"names":["installDecksField","DecksBlock","normalizeDecksBlock","payloadDecks","pluginOptions","config"],"mappings":"AAEA,SAASA,iBAAiB,QAAiC,qBAAoB;AAE/E,SAASC,UAAU,QAAQ,2BAA0B;AAMrD,SAASC,mBAAmB,QAAQ,mBAAkB;AAEtD,OAAO,MAAMC,eACX,CAACC,gBAAoC,CAAC,CAAC,GACvC,CAACC;QACCL,kBAAkBK,QAAQD;QAE1B,OAAOC;IACT,EAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "payload-plugin-decks",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Deck blocks and renderers for Payload CMS",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Krzysztof Radomski",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/krzysztofradomski/payload-plugin-decks.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/krzysztofradomski/payload-plugin-decks/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/krzysztofradomski/payload-plugin-decks#readme",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"payload",
|
|
17
|
+
"payloadcms",
|
|
18
|
+
"payload-plugin",
|
|
19
|
+
"cms",
|
|
20
|
+
"headless-cms",
|
|
21
|
+
"slideshow",
|
|
22
|
+
"decks",
|
|
23
|
+
"payload-plugin-decks"
|
|
24
|
+
],
|
|
25
|
+
"type": "module",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"import": "./src/index.ts",
|
|
29
|
+
"types": "./src/index.ts",
|
|
30
|
+
"default": "./src/index.ts"
|
|
31
|
+
},
|
|
32
|
+
"./client": {
|
|
33
|
+
"import": "./src/exports/client.ts",
|
|
34
|
+
"types": "./src/exports/client.ts",
|
|
35
|
+
"default": "./src/exports/client.ts"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"main": "./src/index.ts",
|
|
39
|
+
"types": "./src/index.ts",
|
|
40
|
+
"files": [
|
|
41
|
+
"dist"
|
|
42
|
+
],
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "pnpm copyfiles && pnpm build:types && pnpm build:swc",
|
|
45
|
+
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
|
|
46
|
+
"build:types": "tsc --outDir dist --rootDir ./src",
|
|
47
|
+
"clean": "rimraf {dist,*.tsbuildinfo}",
|
|
48
|
+
"copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
|
|
49
|
+
"dev": "next dev dev --turbo",
|
|
50
|
+
"dev:generate-importmap": "pnpm dev:payload generate:importmap",
|
|
51
|
+
"dev:generate-types": "pnpm dev:payload generate:types",
|
|
52
|
+
"dev:payload": "cross-env PAYLOAD_CONFIG_PATH=./dev/payload.config.ts payload",
|
|
53
|
+
"generate:importmap": "pnpm dev:generate-importmap",
|
|
54
|
+
"generate:types": "pnpm dev:generate-types",
|
|
55
|
+
"lint": "eslint",
|
|
56
|
+
"lint:fix": "eslint ./src --fix",
|
|
57
|
+
"test": "pnpm test:int && pnpm test:e2e",
|
|
58
|
+
"test:e2e": "playwright test",
|
|
59
|
+
"test:int": "vitest",
|
|
60
|
+
"typecheck": "tsc --noEmit"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
64
|
+
"@payloadcms/db-mongodb": "3.84.0",
|
|
65
|
+
"@payloadcms/db-postgres": "3.84.0",
|
|
66
|
+
"@payloadcms/db-sqlite": "3.84.0",
|
|
67
|
+
"@payloadcms/eslint-config": "3.28.0",
|
|
68
|
+
"@payloadcms/next": "3.84.0",
|
|
69
|
+
"@payloadcms/richtext-lexical": "3.84.0",
|
|
70
|
+
"@payloadcms/ui": "3.84.0",
|
|
71
|
+
"@playwright/test": "1.58.2",
|
|
72
|
+
"@remotion/player": "4.0.447",
|
|
73
|
+
"@swc-node/register": "1.10.9",
|
|
74
|
+
"@swc/cli": "0.6.0",
|
|
75
|
+
"@types/node": "22.19.9",
|
|
76
|
+
"@types/react": "19.2.14",
|
|
77
|
+
"@types/react-dom": "19.2.3",
|
|
78
|
+
"copyfiles": "2.4.1",
|
|
79
|
+
"cross-env": "^7.0.3",
|
|
80
|
+
"eslint": "^9.23.0",
|
|
81
|
+
"eslint-config-next": "16.2.3",
|
|
82
|
+
"graphql": "^16.8.1",
|
|
83
|
+
"mongodb-memory-server": "10.1.4",
|
|
84
|
+
"next": "16.2.3",
|
|
85
|
+
"open": "^10.1.0",
|
|
86
|
+
"payload": "3.84.0",
|
|
87
|
+
"prettier": "^3.4.2",
|
|
88
|
+
"qs-esm": "8.0.1",
|
|
89
|
+
"react": "19.2.4",
|
|
90
|
+
"react-dom": "19.2.4",
|
|
91
|
+
"remotion": "4.0.447",
|
|
92
|
+
"rimraf": "3.0.2",
|
|
93
|
+
"sharp": "0.34.2",
|
|
94
|
+
"sort-package-json": "^2.10.0",
|
|
95
|
+
"typescript": "5.7.3",
|
|
96
|
+
"vite-tsconfig-paths": "6.0.5",
|
|
97
|
+
"vitest": "4.0.18"
|
|
98
|
+
},
|
|
99
|
+
"peerDependencies": {
|
|
100
|
+
"@remotion/player": "^4.0.0",
|
|
101
|
+
"payload": "^3.84.0",
|
|
102
|
+
"react": "^19.0.0",
|
|
103
|
+
"react-dom": "^19.0.0",
|
|
104
|
+
"remotion": "^4.0.0"
|
|
105
|
+
},
|
|
106
|
+
"engines": {
|
|
107
|
+
"node": "^18.20.2 || >=20.9.0",
|
|
108
|
+
"pnpm": "^9 || ^10"
|
|
109
|
+
},
|
|
110
|
+
"publishConfig": {
|
|
111
|
+
"exports": {
|
|
112
|
+
".": {
|
|
113
|
+
"import": "./dist/index.js",
|
|
114
|
+
"types": "./dist/index.d.ts",
|
|
115
|
+
"default": "./dist/index.js"
|
|
116
|
+
},
|
|
117
|
+
"./client": {
|
|
118
|
+
"import": "./dist/exports/client.js",
|
|
119
|
+
"types": "./dist/exports/client.d.ts",
|
|
120
|
+
"default": "./dist/exports/client.js"
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"main": "./dist/index.js",
|
|
124
|
+
"types": "./dist/index.d.ts"
|
|
125
|
+
},
|
|
126
|
+
"pnpm": {
|
|
127
|
+
"onlyBuiltDependencies": [
|
|
128
|
+
"sharp",
|
|
129
|
+
"esbuild",
|
|
130
|
+
"unrs-resolver"
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
"registry": "https://registry.npmjs.org/",
|
|
134
|
+
"packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319"
|
|
135
|
+
}
|