@midscene/visualizer 1.5.2 → 1.5.3-beta-20260305031416.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.
Files changed (43) hide show
  1. package/dist/es/component/blackboard/index.css +82 -4
  2. package/dist/es/component/blackboard/index.mjs +73 -301
  3. package/dist/es/component/player/index.css +144 -119
  4. package/dist/es/component/player/index.mjs +468 -830
  5. package/dist/es/component/player/remotion/StepScene.mjs +190 -0
  6. package/dist/es/component/player/remotion/derive-frame-state.mjs +207 -0
  7. package/dist/es/component/player/remotion/export-branded-video.mjs +210 -0
  8. package/dist/es/component/player/remotion/frame-calculator.mjs +149 -0
  9. package/dist/es/component/player/use-frame-player.mjs +88 -0
  10. package/dist/es/component/universal-playground/index.mjs +14 -1
  11. package/dist/es/hooks/usePlaygroundExecution.mjs +11 -7
  12. package/dist/es/index.mjs +2 -2
  13. package/dist/es/store/store.mjs +9 -0
  14. package/dist/es/utils/replay-scripts.mjs +78 -59
  15. package/dist/lib/component/blackboard/index.css +82 -4
  16. package/dist/lib/component/blackboard/index.js +73 -307
  17. package/dist/lib/component/player/index.css +144 -119
  18. package/dist/lib/component/player/index.js +466 -828
  19. package/dist/lib/component/player/remotion/StepScene.js +224 -0
  20. package/dist/lib/component/player/remotion/derive-frame-state.js +241 -0
  21. package/dist/lib/component/player/remotion/export-branded-video.js +244 -0
  22. package/dist/lib/component/player/remotion/frame-calculator.js +186 -0
  23. package/dist/lib/component/player/use-frame-player.js +122 -0
  24. package/dist/lib/component/universal-playground/index.js +14 -1
  25. package/dist/lib/hooks/usePlaygroundExecution.js +11 -7
  26. package/dist/lib/index.js +3 -0
  27. package/dist/lib/store/store.js +9 -0
  28. package/dist/lib/utils/replay-scripts.js +80 -58
  29. package/dist/types/component/blackboard/index.d.ts +0 -4
  30. package/dist/types/component/player/index.d.ts +0 -1
  31. package/dist/types/component/player/remotion/StepScene.d.ts +9 -0
  32. package/dist/types/component/player/remotion/derive-frame-state.d.ts +38 -0
  33. package/dist/types/component/player/remotion/export-branded-video.d.ts +2 -0
  34. package/dist/types/component/player/remotion/frame-calculator.d.ts +35 -0
  35. package/dist/types/component/player/use-frame-player.d.ts +17 -0
  36. package/dist/types/hooks/usePlaygroundExecution.d.ts +15 -1
  37. package/dist/types/index.d.ts +1 -1
  38. package/dist/types/store/store.d.ts +2 -0
  39. package/dist/types/utils/replay-scripts.d.ts +16 -1
  40. package/package.json +5 -8
  41. package/dist/es/utils/pixi-loader.mjs +0 -42
  42. package/dist/lib/utils/pixi-loader.js +0 -82
  43. package/dist/types/utils/pixi-loader.d.ts +0 -5
@@ -1,6 +1,5 @@
1
1
  .player-container {
2
2
  box-sizing: border-box;
3
- background: #f2f4f7;
4
3
  border: 1px solid #f2f4f7;
5
4
  border-radius: 8px;
6
5
  flex-direction: column;
@@ -11,7 +10,7 @@
11
10
  max-height: 100%;
12
11
  margin: 0 auto;
13
12
  padding: 12px;
14
- line-height: 100%;
13
+ line-height: normal;
15
14
  display: flex;
16
15
  position: relative;
17
16
  overflow: visible;
@@ -22,169 +21,207 @@
22
21
  }
23
22
 
24
23
  .player-container[data-fit-mode="height"] .canvas-container {
25
- background-color: #f2f4f7;
24
+ background-color: #000;
26
25
  }
27
26
 
28
27
  .player-container .canvas-container {
29
- width: 100%;
30
- min-height: 200px;
31
- aspect-ratio: var(--canvas-aspect-ratio, 16 / 9);
32
- background-color: #fff;
33
- border-top-left-radius: 4px;
34
- border-top-right-radius: 4px;
35
- flex: none;
28
+ background-color: #000;
29
+ border-radius: 4px;
30
+ flex: auto;
36
31
  justify-content: center;
37
32
  align-items: center;
33
+ width: 100%;
34
+ min-height: 200px;
38
35
  display: flex;
39
36
  position: relative;
40
37
  overflow: hidden;
41
38
  }
42
39
 
43
- .player-container .canvas-container canvas {
44
- box-sizing: border-box;
45
- object-fit: contain;
46
- border: none;
40
+ .player-container .canvas-container .player-wrapper {
47
41
  width: 100%;
48
42
  max-width: 100%;
49
- height: auto;
50
43
  max-height: 100%;
51
- margin: 0 auto;
52
- display: block;
53
- }
54
-
55
- .player-container .canvas-container[data-fit-mode="height"] {
56
- aspect-ratio: unset;
57
- flex: auto;
58
- height: auto;
59
- min-height: 0;
44
+ position: relative;
60
45
  }
61
46
 
62
- .player-container .canvas-container[data-fit-mode="height"] canvas {
47
+ .player-container .canvas-container .player-wrapper[data-portrait] {
63
48
  width: auto;
64
- max-width: 100%;
65
49
  height: 100%;
66
- max-height: 100%;
67
50
  }
68
51
 
69
- .player-container .canvas-container[data-fit-mode="width"] {
70
- aspect-ratio: var(--canvas-aspect-ratio, 16 / 9);
52
+ .player-container .player-subtitle {
53
+ -webkit-backdrop-filter: blur(8px);
54
+ backdrop-filter: blur(8px);
55
+ z-index: 3;
56
+ pointer-events: none;
57
+ background: rgba(80, 80, 80, .75);
58
+ border-radius: 8px;
59
+ align-items: center;
60
+ gap: 8px;
61
+ max-width: calc(100% - 24px);
62
+ height: 32px;
63
+ padding: 0 14px;
64
+ display: inline-flex;
65
+ position: absolute;
66
+ bottom: 52px;
67
+ left: 50%;
68
+ transform: translateX(-50%);
71
69
  }
72
70
 
73
- .player-container .canvas-container[data-fit-mode="width"] canvas {
74
- width: 100%;
75
- height: auto;
71
+ .player-container .player-subtitle .player-subtitle-badge {
72
+ color: #fff;
73
+ background: #a34dff;
74
+ border-radius: 4px;
75
+ flex-shrink: 0;
76
+ justify-content: center;
77
+ align-items: center;
78
+ height: 22px;
79
+ padding: 0 6px;
80
+ font-size: 13px;
81
+ font-weight: 700;
82
+ display: inline-flex;
76
83
  }
77
84
 
78
- .player-container .player-timeline-wrapper {
79
- flex: none;
80
- width: 100%;
81
- height: 4px;
82
- margin-bottom: 2px;
83
- position: relative;
85
+ .player-container .player-subtitle .player-subtitle-text {
86
+ color: #fff;
87
+ white-space: nowrap;
88
+ text-overflow: ellipsis;
89
+ min-width: 0;
90
+ font-size: 14px;
91
+ font-weight: 500;
92
+ overflow: hidden;
84
93
  }
85
94
 
86
- .player-container .player-timeline {
87
- background: #666;
95
+ .player-container .control-bar {
96
+ z-index: 2;
97
+ background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .6));
98
+ align-items: center;
99
+ gap: 8px;
100
+ padding: 8px 12px;
101
+ transition: opacity .3s;
102
+ display: flex;
103
+ position: absolute;
104
+ bottom: 0;
105
+ left: 0;
106
+ right: 0;
107
+ }
108
+
109
+ .player-container .control-bar.hidden {
110
+ opacity: 0;
111
+ pointer-events: none;
112
+ }
113
+
114
+ .player-container .time-display {
115
+ color: rgba(255, 255, 255, .8);
116
+ font-variant-numeric: tabular-nums;
117
+ white-space: nowrap;
88
118
  flex-shrink: 0;
89
- width: 100%;
90
- height: 4px;
119
+ font-size: 12px;
120
+ }
121
+
122
+ .player-container .seek-bar-track {
123
+ cursor: pointer;
124
+ touch-action: none;
125
+ background: rgba(255, 255, 255, .3);
126
+ border-radius: 2.5px;
127
+ flex: 1;
128
+ height: 5px;
91
129
  position: relative;
92
130
  }
93
131
 
94
- .player-container .player-timeline .player-timeline-progress {
132
+ .player-container .seek-bar-track .seek-bar-fill {
133
+ pointer-events: none;
95
134
  background: #2b83ff;
96
- height: 4px;
97
- transition-timing-function: linear;
135
+ border-radius: 2.5px;
136
+ height: 100%;
98
137
  position: absolute;
99
138
  top: 0;
100
139
  left: 0;
101
140
  }
102
141
 
103
- .player-container .player-tools-wrapper {
104
- box-sizing: border-box;
105
- flex: none;
106
- width: 100%;
107
- height: 72px;
108
- padding: 15px 16px;
109
- position: relative;
110
- }
111
-
112
- .player-container .player-tools {
113
- color: #000;
114
- box-sizing: border-box;
115
- flex-direction: row;
116
- flex-shrink: 0;
117
- justify-content: space-between;
118
- width: 100%;
119
- max-width: 100%;
120
- height: 42px;
121
- font-size: 14px;
122
- display: flex;
123
- overflow: hidden;
142
+ .player-container .seek-bar-track .seek-bar-knob {
143
+ pointer-events: none;
144
+ background: #fff;
145
+ border-radius: 10px;
146
+ width: 8px;
147
+ height: 16px;
148
+ position: absolute;
149
+ top: 50%;
150
+ transform: translate(-50%, -50%);
124
151
  }
125
152
 
126
- .player-container .player-tools .ant-spin {
127
- color: #333;
153
+ .player-container .seek-bar-track .chapter-marker {
154
+ pointer-events: auto;
155
+ cursor: pointer;
156
+ z-index: 1;
157
+ background: #fff;
158
+ width: 2px;
159
+ height: 100%;
160
+ position: absolute;
161
+ top: 0;
162
+ transform: translateX(-50%);
128
163
  }
129
164
 
130
- .player-container .player-tools .player-control {
131
- flex-direction: row;
132
- flex-grow: 1;
133
- align-items: center;
134
- display: flex;
135
- overflow: hidden;
165
+ .player-container .seek-bar-track .chapter-marker:before {
166
+ content: "";
167
+ position: absolute;
168
+ top: -8px;
169
+ bottom: -8px;
170
+ left: -8px;
171
+ right: -8px;
136
172
  }
137
173
 
138
- .player-container .player-tools .status-icon {
139
- border-radius: 8px;
174
+ .player-container .status-icon {
175
+ color: #fff;
176
+ cursor: pointer;
177
+ opacity: .7;
178
+ border-radius: 4px;
140
179
  flex-shrink: 0;
141
180
  justify-content: center;
142
181
  align-items: center;
143
- width: 32px;
144
- height: 32px;
145
- margin-left: 10px;
182
+ width: 24px;
183
+ height: 24px;
146
184
  transition: all .2s;
147
185
  display: flex;
148
186
  }
149
187
 
150
- .player-container .player-tools .status-icon:hover {
151
- cursor: pointer;
152
- background: #f0f0f0;
188
+ .player-container .status-icon svg {
189
+ color: #fff;
190
+ font-size: 14px;
153
191
  }
154
192
 
155
- .player-container .player-tools .status-text {
156
- flex-direction: column;
157
- flex-grow: 1;
158
- flex-shrink: 1;
159
- justify-content: space-between;
160
- width: 0;
161
- min-width: 0;
162
- height: 100%;
193
+ .player-container .status-icon:hover {
194
+ opacity: 1;
195
+ background: rgba(255, 255, 255, .15);
196
+ }
197
+
198
+ .player-container .player-custom-controls {
199
+ flex-direction: row;
200
+ align-items: center;
201
+ gap: 8px;
202
+ margin-right: 8px;
163
203
  display: flex;
164
- position: relative;
165
- overflow: hidden;
166
204
  }
167
205
 
168
- .player-container .player-tools .title {
169
- font-weight: 600;
206
+ .player-container .player-custom-controls .ant-spin {
207
+ color: #fff;
170
208
  }
171
209
 
172
- .player-container .player-tools .title, .player-container .player-tools .subtitle {
173
- text-overflow: ellipsis;
174
- white-space: nowrap;
175
- width: 100%;
176
- overflow: hidden;
210
+ .chapter-tooltip .ant-tooltip-inner {
211
+ -webkit-backdrop-filter: blur(8px);
212
+ backdrop-filter: blur(8px);
213
+ background: rgba(80, 80, 80, .85);
214
+ border-radius: 16px;
215
+ max-width: 360px;
216
+ padding: 6px 12px;
217
+ font-size: 12px;
177
218
  }
178
219
 
179
- .player-container .player-tools .player-tools-item {
180
- flex-direction: column;
181
- justify-content: center;
182
- height: 100%;
183
- display: flex;
220
+ .chapter-tooltip .ant-tooltip-arrow:before {
221
+ background: rgba(80, 80, 80, .85);
184
222
  }
185
223
 
186
224
  [data-theme="dark"] .player-container {
187
- background: #141414;
188
225
  border-color: #292929;
189
226
  }
190
227
 
@@ -193,20 +230,8 @@
193
230
  border-color: #292929;
194
231
  }
195
232
 
196
- [data-theme="dark"] .player-container[data-fit-mode="height"] .canvas-container {
197
- background-color: #141414;
198
- }
199
-
200
- [data-theme="dark"] .player-container .canvas-container {
201
- background-color: #1f1f1f;
202
- }
203
-
204
- [data-theme="dark"] .player-container .player-tools, [data-theme="dark"] .player-container .player-tools .ant-spin, [data-theme="dark"] .player-container .player-tools .status-icon svg {
205
- color: #f8fafd;
206
- }
207
-
208
- [data-theme="dark"] .player-container .player-tools .status-icon:hover {
209
- background: rgba(255, 255, 255, .08);
233
+ [data-theme="dark"] .player-container[data-fit-mode="height"] .canvas-container, [data-theme="dark"] .player-container .canvas-container {
234
+ background-color: #000;
210
235
  }
211
236
 
212
237
  .player-settings-dropdown {