@zync/zync-screnplay-player 0.1.221 → 0.1.223
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/bundle.js +1 -1
- package/dist/screenplay/RemotionRenderer/components/LottieAnimationGlobal.js +21 -21
- package/dist/screenplay/RemotionRenderer/components/layouts/Keyword.js +3 -3
- package/dist/screenplay/RemotionRenderer/components/layouts/MotionStill.js +3 -3
- package/dist/screenplay/RemotionRenderer/components/layouts/MultiHandoff.js +264 -0
- package/dist/screenplay/RemotionRenderer/components/utils/FaceCenteredVideo.js +50 -50
- package/dist/screenplay/RemotionRenderer/components/utils/PausableImg.js +4 -4
- package/dist/screenplay/RemotionRenderer/components/utils/README.md +80 -80
- package/dist/screenplay/RemotionRenderer/components/utils/StretchTextDemo.js +3 -3
- package/dist/screenplay/RemotionRenderer/development.js +1165 -3064
- package/dist/screenplay/RemotionRenderer/helpers/convertToSeconds.js +8 -8
- package/dist/screenplay/RemotionRenderer/helpers/faceBasedVideoStyles.js +4 -4
- package/dist/screenplay/RemotionRenderer/helpers/faceCenteredVideoTransforms.js +46 -46
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/LayoutFactory.js +5 -0
- package/dist/screenplay/RemotionRenderer/main/lib/layouts/MultiHandoffLayout.js +53 -0
- package/dist/screenplay/RemotionRenderer/main/screenplaySchema.js +51 -51
- package/dist/screenplay/RemotionRenderer/registeredComponents.js +4 -2
- package/dist/screenplay/RemotionRenderer/tracks/LayoutVideoTrack.js +20 -20
- package/package.json +47 -47
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
# StretchText Component
|
|
2
|
-
|
|
3
|
-
A React component that renders text that stretches to fit the parent's width. Words with fewer characters will have a larger font size than words with more characters. The component uses SVG for rendering text, which ensures proper text-stroke rendering in headless mode.
|
|
4
|
-
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
7
|
-
```jsx
|
|
8
|
-
import StretchText from './StretchText';
|
|
9
|
-
|
|
10
|
-
// Basic usage
|
|
11
|
-
<StretchText text="Hello World" />
|
|
12
|
-
|
|
13
|
-
// With custom styling
|
|
14
|
-
<StretchText
|
|
15
|
-
text="Contribution"
|
|
16
|
-
color="#1a73e8"
|
|
17
|
-
fontFamily="Arial"
|
|
18
|
-
maxFontSize={200}
|
|
19
|
-
minFontSize={10}
|
|
20
|
-
style={{ fontWeight: 'bold' }}
|
|
21
|
-
/>
|
|
22
|
-
|
|
23
|
-
// With text stroke
|
|
24
|
-
<StretchText
|
|
25
|
-
text="Outlined Text"
|
|
26
|
-
color="transparent"
|
|
27
|
-
textStrokeColor="white"
|
|
28
|
-
textStrokeWidth="2px"
|
|
29
|
-
style={{ fontWeight: 'bold' }}
|
|
30
|
-
/>
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Props
|
|
34
|
-
|
|
35
|
-
| Prop | Type | Default | Description |
|
|
36
|
-
|------|------|---------|-------------|
|
|
37
|
-
| `text` | string | required | The text to display |
|
|
38
|
-
| `color` | string | '#000000' | Text color |
|
|
39
|
-
| `fontFamily` | string | 'Arial' | Font family |
|
|
40
|
-
| `maxFontSize` | number | 100 | Maximum font size in pixels |
|
|
41
|
-
| `minFontSize` | number | 10 | Minimum font size in pixels |
|
|
42
|
-
| `textStrokeColor` | string | undefined | Color of the text stroke |
|
|
43
|
-
| `textStrokeWidth` | string | undefined | Width of the text stroke (e.g., '2px') |
|
|
44
|
-
| `textFillColor` | string | undefined | Color of the text fill (overrides `color` if provided) |
|
|
45
|
-
| `style` | object | {} | Additional style properties |
|
|
46
|
-
|
|
47
|
-
## Examples
|
|
48
|
-
|
|
49
|
-
The component automatically calculates the appropriate font size to make the text stretch to fit the parent width. For example:
|
|
50
|
-
|
|
51
|
-
- "Work" (4 characters) will have a larger font size than "Contribution" (12 characters) when both are rendered in containers of the same width.
|
|
52
|
-
- The text will always be contained within the parent container and will not overflow.
|
|
53
|
-
- The component recalculates the font size when the window is resized.
|
|
54
|
-
|
|
55
|
-
## Demo
|
|
56
|
-
|
|
57
|
-
You can see a demo of the StretchText component by running the development environment and looking at the first segment in the video timeline.
|
|
58
|
-
|
|
59
|
-
The demo shows several words of different lengths rendered in containers of the same width:
|
|
60
|
-
|
|
61
|
-
- "Contribution" (longer word, smaller font)
|
|
62
|
-
- "Work" (shorter word, larger font)
|
|
63
|
-
- "Hello" (medium length word, medium font)
|
|
64
|
-
- "Supercalifragilisticexpialidocious" (very long word, very small font)
|
|
65
|
-
|
|
66
|
-
Each word stretches to fill the entire width of its container, demonstrating how the component automatically adjusts the font size based on the text length.
|
|
67
|
-
|
|
68
|
-
## Implementation Details
|
|
69
|
-
|
|
70
|
-
The component uses a binary search algorithm to find the optimal font size that makes the text fit the parent width. It uses a simple approximation for text width calculation (character count * fontSize * 0.75) which works well for most fonts.
|
|
71
|
-
|
|
72
|
-
The component uses SVG for rendering text, which provides several advantages:
|
|
73
|
-
- Proper text-stroke rendering in headless mode
|
|
74
|
-
- Better control over text positioning and alignment
|
|
75
|
-
- Consistent rendering across different browsers and environments
|
|
76
|
-
- Support for advanced SVG features like filters for text shadows
|
|
77
|
-
|
|
78
|
-
For text with stroke effects, the component uses SVG's native stroke and fill attributes, which are more reliable than CSS text-stroke properties, especially in headless rendering environments.
|
|
79
|
-
|
|
80
|
-
The component also includes a resize listener to recalculate the font size when the window size changes.
|
|
1
|
+
# StretchText Component
|
|
2
|
+
|
|
3
|
+
A React component that renders text that stretches to fit the parent's width. Words with fewer characters will have a larger font size than words with more characters. The component uses SVG for rendering text, which ensures proper text-stroke rendering in headless mode.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import StretchText from './StretchText';
|
|
9
|
+
|
|
10
|
+
// Basic usage
|
|
11
|
+
<StretchText text="Hello World" />
|
|
12
|
+
|
|
13
|
+
// With custom styling
|
|
14
|
+
<StretchText
|
|
15
|
+
text="Contribution"
|
|
16
|
+
color="#1a73e8"
|
|
17
|
+
fontFamily="Arial"
|
|
18
|
+
maxFontSize={200}
|
|
19
|
+
minFontSize={10}
|
|
20
|
+
style={{ fontWeight: 'bold' }}
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
// With text stroke
|
|
24
|
+
<StretchText
|
|
25
|
+
text="Outlined Text"
|
|
26
|
+
color="transparent"
|
|
27
|
+
textStrokeColor="white"
|
|
28
|
+
textStrokeWidth="2px"
|
|
29
|
+
style={{ fontWeight: 'bold' }}
|
|
30
|
+
/>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Props
|
|
34
|
+
|
|
35
|
+
| Prop | Type | Default | Description |
|
|
36
|
+
|------|------|---------|-------------|
|
|
37
|
+
| `text` | string | required | The text to display |
|
|
38
|
+
| `color` | string | '#000000' | Text color |
|
|
39
|
+
| `fontFamily` | string | 'Arial' | Font family |
|
|
40
|
+
| `maxFontSize` | number | 100 | Maximum font size in pixels |
|
|
41
|
+
| `minFontSize` | number | 10 | Minimum font size in pixels |
|
|
42
|
+
| `textStrokeColor` | string | undefined | Color of the text stroke |
|
|
43
|
+
| `textStrokeWidth` | string | undefined | Width of the text stroke (e.g., '2px') |
|
|
44
|
+
| `textFillColor` | string | undefined | Color of the text fill (overrides `color` if provided) |
|
|
45
|
+
| `style` | object | {} | Additional style properties |
|
|
46
|
+
|
|
47
|
+
## Examples
|
|
48
|
+
|
|
49
|
+
The component automatically calculates the appropriate font size to make the text stretch to fit the parent width. For example:
|
|
50
|
+
|
|
51
|
+
- "Work" (4 characters) will have a larger font size than "Contribution" (12 characters) when both are rendered in containers of the same width.
|
|
52
|
+
- The text will always be contained within the parent container and will not overflow.
|
|
53
|
+
- The component recalculates the font size when the window is resized.
|
|
54
|
+
|
|
55
|
+
## Demo
|
|
56
|
+
|
|
57
|
+
You can see a demo of the StretchText component by running the development environment and looking at the first segment in the video timeline.
|
|
58
|
+
|
|
59
|
+
The demo shows several words of different lengths rendered in containers of the same width:
|
|
60
|
+
|
|
61
|
+
- "Contribution" (longer word, smaller font)
|
|
62
|
+
- "Work" (shorter word, larger font)
|
|
63
|
+
- "Hello" (medium length word, medium font)
|
|
64
|
+
- "Supercalifragilisticexpialidocious" (very long word, very small font)
|
|
65
|
+
|
|
66
|
+
Each word stretches to fill the entire width of its container, demonstrating how the component automatically adjusts the font size based on the text length.
|
|
67
|
+
|
|
68
|
+
## Implementation Details
|
|
69
|
+
|
|
70
|
+
The component uses a binary search algorithm to find the optimal font size that makes the text fit the parent width. It uses a simple approximation for text width calculation (character count * fontSize * 0.75) which works well for most fonts.
|
|
71
|
+
|
|
72
|
+
The component uses SVG for rendering text, which provides several advantages:
|
|
73
|
+
- Proper text-stroke rendering in headless mode
|
|
74
|
+
- Better control over text positioning and alignment
|
|
75
|
+
- Consistent rendering across different browsers and environments
|
|
76
|
+
- Support for advanced SVG features like filters for text shadows
|
|
77
|
+
|
|
78
|
+
For text with stroke effects, the component uses SVG's native stroke and fill attributes, which are more reliable than CSS text-stroke properties, especially in headless rendering environments.
|
|
79
|
+
|
|
80
|
+
The component also includes a resize listener to recalculate the font size when the window size changes.
|
|
@@ -2,9 +2,9 @@ import React from "react";
|
|
|
2
2
|
import { AbsoluteFill } from "remotion";
|
|
3
3
|
import StretchText from "./StretchText";
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* Demo component to showcase the StretchText component
|
|
7
|
-
* Shows how different words stretch to the same width with different font sizes
|
|
5
|
+
/**
|
|
6
|
+
* Demo component to showcase the StretchText component
|
|
7
|
+
* Shows how different words stretch to the same width with different font sizes
|
|
8
8
|
*/
|
|
9
9
|
var StretchTextDemo = function StretchTextDemo() {
|
|
10
10
|
var containerStyle = {
|