@haklex/rich-renderer-video 0.0.4 → 0.0.5
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/VideoEditRenderer.d.ts.map +1 -1
- package/dist/VideoRenderer.d.ts.map +1 -1
- package/dist/index.mjs +297 -178
- package/dist/rich-renderer-video.css +38 -38
- package/dist/styles.css.d.ts +50 -1
- package/dist/styles.css.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoEditRenderer.d.ts","sourceRoot":"","sources":["../src/VideoEditRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"VideoEditRenderer.d.ts","sourceRoot":"","sources":["../src/VideoEditRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAW7D,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,kBAAkB,2CAQ1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoRenderer.d.ts","sourceRoot":"","sources":["../src/VideoRenderer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VideoRenderer.d.ts","sourceRoot":"","sources":["../src/VideoRenderer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAW7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAmB1C,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,kBAAkB,CA6R3D,CAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -6,12 +6,43 @@ import { $getNearestNodeFromDOMNode } from "lexical";
|
|
|
6
6
|
import { Play, Pause, VolumeX, Volume2, Loader2, Download, Minimize, Maximize, Video, ImageIcon, ExternalLink, Trash2 } from "lucide-react";
|
|
7
7
|
import { useRef, useState, useMemo, useCallback, useEffect } from "react";
|
|
8
8
|
import { Slider } from "@base-ui/react/slider";
|
|
9
|
+
var semanticClassNames = { root: "rr-video-root", player: "rr-video-player", element: "rr-video-element", indicator: "rr-video-indicator", controls: "rr-video-controls", button: "rr-video-btn", progress: "rr-video-progress", progressControl: "rr-video-progress-control", progressTrack: "rr-video-progress-track", progressRange: "rr-video-progress-range", progressThumb: "rr-video-progress-thumb", spin: "rr-video-spin", editTrigger: "rr-video-edit-trigger", editPreview: "rr-video-edit-preview", editVideo: "rr-video-edit-video", editOverlay: "rr-video-edit-overlay", editPlaceholder: "rr-video-edit-placeholder", editPanel: "rr-video-edit-panel", editField: "rr-video-edit-field", editFieldIcon: "rr-video-edit-field-icon", editInput: "rr-video-edit-input", editActions: "rr-video-edit-actions", editActionButton: "rr-video-edit-action-btn", editActionButtonEnd: "rr-video-edit-action-btn--end" };
|
|
10
|
+
var root = "_1x2h1ol0";
|
|
11
|
+
var player = "_1x2h1ol1";
|
|
12
|
+
var element = "_1x2h1ol2";
|
|
13
|
+
var indicator = "_1x2h1ol4";
|
|
14
|
+
var controls = "_1x2h1ol5";
|
|
15
|
+
var button = "_1x2h1ol6";
|
|
16
|
+
var progress = "_1x2h1ol7";
|
|
17
|
+
var progressControl = "_1x2h1ol8";
|
|
18
|
+
var progressTrack = "_1x2h1ol9";
|
|
19
|
+
var progressRange = "_1x2h1ola";
|
|
20
|
+
var progressThumb = "_1x2h1olb";
|
|
21
|
+
var spin = "_1x2h1old";
|
|
22
|
+
var editTrigger = "_1x2h1ole";
|
|
23
|
+
var editPreview = "_1x2h1olf";
|
|
24
|
+
var editVideo = "_1x2h1olg";
|
|
25
|
+
var editOverlay = "_1x2h1olh";
|
|
26
|
+
var editPlaceholder = "_1x2h1oli";
|
|
27
|
+
var editPanel = "_1x2h1olj";
|
|
28
|
+
var editField = "_1x2h1olk";
|
|
29
|
+
var editFieldIcon = "_1x2h1oll";
|
|
30
|
+
var editInput = "_1x2h1olm";
|
|
31
|
+
var editActions = "_1x2h1oln";
|
|
32
|
+
var editActionButton = "_1x2h1olo";
|
|
33
|
+
var editActionButtonEnd = "_1x2h1olp";
|
|
9
34
|
const PlayIcon = ({ size = 20 }) => /* @__PURE__ */ jsx(Play, { size });
|
|
10
35
|
const PauseIcon = ({ size = 20 }) => /* @__PURE__ */ jsx(Pause, { size });
|
|
11
36
|
const VolumeIcon = () => /* @__PURE__ */ jsx(Volume2, { size: 20 });
|
|
12
37
|
const VolumeMuteIcon = () => /* @__PURE__ */ jsx(VolumeX, { size: 20 });
|
|
13
38
|
const DownloadIcon = () => /* @__PURE__ */ jsx(Download, { size: 20 });
|
|
14
|
-
const LoadingIcon = () => /* @__PURE__ */ jsx(
|
|
39
|
+
const LoadingIcon = () => /* @__PURE__ */ jsx(
|
|
40
|
+
Loader2,
|
|
41
|
+
{
|
|
42
|
+
size: 20,
|
|
43
|
+
className: `${spin} ${semanticClassNames.spin}`
|
|
44
|
+
}
|
|
45
|
+
);
|
|
15
46
|
const FullscreenIcon = () => /* @__PURE__ */ jsx(Maximize, { size: 20 });
|
|
16
47
|
const ExitFullscreenIcon = () => /* @__PURE__ */ jsx(Minimize, { size: 20 });
|
|
17
48
|
const VideoRenderer = ({
|
|
@@ -27,7 +58,7 @@ const VideoRenderer = ({
|
|
|
27
58
|
const [currentTime, setCurrentTime] = useState(0);
|
|
28
59
|
const [muted, setMuted] = useState(false);
|
|
29
60
|
const [isFullscreen, setIsFullscreen] = useState(false);
|
|
30
|
-
const [indicator, setIndicator] = useState(null);
|
|
61
|
+
const [indicator$1, setIndicator] = useState(null);
|
|
31
62
|
const [draggingTime, setDraggingTime] = useState(null);
|
|
32
63
|
const [isDownloading, setIsDownloading] = useState(false);
|
|
33
64
|
const dragWasPlayingRef = useRef(false);
|
|
@@ -153,105 +184,139 @@ const VideoRenderer = ({
|
|
|
153
184
|
return () => clearTimeout(indicatorTimerRef.current);
|
|
154
185
|
}, []);
|
|
155
186
|
const timelineValue = draggingTime ?? currentTime;
|
|
156
|
-
return /* @__PURE__ */ jsx("figure", { className:
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
{
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
"
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
/* @__PURE__ */ jsx(
|
|
183
|
-
Slider.Root,
|
|
184
|
-
{
|
|
185
|
-
className: "rr-video-progress",
|
|
186
|
-
min: 0,
|
|
187
|
-
max: duration || 0,
|
|
188
|
-
step: 0.01,
|
|
189
|
-
value: timelineValue,
|
|
190
|
-
onValueChange: (value) => {
|
|
191
|
-
setDraggingTime(value);
|
|
192
|
-
},
|
|
193
|
-
onValueCommitted: (value) => {
|
|
194
|
-
seekTo(value);
|
|
195
|
-
setDraggingTime(null);
|
|
196
|
-
if (dragWasPlayingRef.current) {
|
|
197
|
-
play();
|
|
198
|
-
}
|
|
187
|
+
return /* @__PURE__ */ jsx("figure", { className: `${root} ${semanticClassNames.root}`, children: /* @__PURE__ */ jsxs(
|
|
188
|
+
"div",
|
|
189
|
+
{
|
|
190
|
+
className: `${player} ${semanticClassNames.player}`,
|
|
191
|
+
ref: wrapperRef,
|
|
192
|
+
style: { aspectRatio },
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ jsx(
|
|
195
|
+
"video",
|
|
196
|
+
{
|
|
197
|
+
ref: videoRef,
|
|
198
|
+
className: `${element} ${semanticClassNames.element}`,
|
|
199
|
+
src,
|
|
200
|
+
poster,
|
|
201
|
+
preload: "metadata",
|
|
202
|
+
playsInline: true,
|
|
203
|
+
onClick: togglePlay,
|
|
204
|
+
onDoubleClick: toggleFullscreen
|
|
205
|
+
}
|
|
206
|
+
),
|
|
207
|
+
indicator$1 && /* @__PURE__ */ jsx(
|
|
208
|
+
"span",
|
|
209
|
+
{
|
|
210
|
+
className: `${indicator} ${semanticClassNames.indicator}`,
|
|
211
|
+
"aria-hidden": true,
|
|
212
|
+
children: indicator$1.type === "play" ? /* @__PURE__ */ jsx(PlayIcon, { size: 32 }) : /* @__PURE__ */ jsx(PauseIcon, { size: 32 })
|
|
199
213
|
},
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
214
|
+
indicator$1.key
|
|
215
|
+
),
|
|
216
|
+
/* @__PURE__ */ jsxs(
|
|
217
|
+
"div",
|
|
218
|
+
{
|
|
219
|
+
className: `${controls} ${semanticClassNames.controls}`,
|
|
220
|
+
onClick: (e) => e.stopPropagation(),
|
|
221
|
+
children: [
|
|
222
|
+
/* @__PURE__ */ jsx(
|
|
223
|
+
"button",
|
|
224
|
+
{
|
|
225
|
+
type: "button",
|
|
226
|
+
className: `${button} ${semanticClassNames.button}`,
|
|
227
|
+
"aria-label": playing ? "Pause" : "Play",
|
|
228
|
+
onClick: togglePlay,
|
|
229
|
+
children: playing ? /* @__PURE__ */ jsx(PauseIcon, {}) : /* @__PURE__ */ jsx(PlayIcon, {})
|
|
230
|
+
}
|
|
231
|
+
),
|
|
232
|
+
/* @__PURE__ */ jsx(
|
|
233
|
+
Slider.Root,
|
|
234
|
+
{
|
|
235
|
+
className: `${progress} ${semanticClassNames.progress}`,
|
|
236
|
+
min: 0,
|
|
237
|
+
max: duration || 0,
|
|
238
|
+
step: 0.01,
|
|
239
|
+
value: timelineValue,
|
|
240
|
+
onValueChange: (value) => {
|
|
241
|
+
setDraggingTime(value);
|
|
242
|
+
},
|
|
243
|
+
onValueCommitted: (value) => {
|
|
244
|
+
seekTo(value);
|
|
245
|
+
setDraggingTime(null);
|
|
246
|
+
if (dragWasPlayingRef.current) {
|
|
247
|
+
play();
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
children: /* @__PURE__ */ jsx(
|
|
251
|
+
Slider.Control,
|
|
252
|
+
{
|
|
253
|
+
className: `${progressControl} ${semanticClassNames.progressControl}`,
|
|
254
|
+
onPointerDown: () => {
|
|
255
|
+
dragWasPlayingRef.current = playing;
|
|
256
|
+
pause();
|
|
257
|
+
setDraggingTime(currentTime);
|
|
258
|
+
},
|
|
259
|
+
children: /* @__PURE__ */ jsxs(
|
|
260
|
+
Slider.Track,
|
|
261
|
+
{
|
|
262
|
+
className: `${progressTrack} ${semanticClassNames.progressTrack}`,
|
|
263
|
+
children: [
|
|
264
|
+
/* @__PURE__ */ jsx(
|
|
265
|
+
Slider.Indicator,
|
|
266
|
+
{
|
|
267
|
+
className: `${progressRange} ${semanticClassNames.progressRange}`
|
|
268
|
+
}
|
|
269
|
+
),
|
|
270
|
+
/* @__PURE__ */ jsx(
|
|
271
|
+
Slider.Thumb,
|
|
272
|
+
{
|
|
273
|
+
className: `${progressThumb} ${semanticClassNames.progressThumb}`,
|
|
274
|
+
"aria-label": "Playback progress"
|
|
275
|
+
}
|
|
276
|
+
)
|
|
277
|
+
]
|
|
278
|
+
}
|
|
279
|
+
)
|
|
280
|
+
}
|
|
281
|
+
)
|
|
282
|
+
}
|
|
283
|
+
),
|
|
284
|
+
/* @__PURE__ */ jsx(
|
|
285
|
+
"button",
|
|
286
|
+
{
|
|
287
|
+
type: "button",
|
|
288
|
+
className: `${button} ${semanticClassNames.button}`,
|
|
289
|
+
"aria-label": muted ? "Unmute" : "Mute",
|
|
290
|
+
onClick: toggleMute,
|
|
291
|
+
children: muted ? /* @__PURE__ */ jsx(VolumeMuteIcon, {}) : /* @__PURE__ */ jsx(VolumeIcon, {})
|
|
292
|
+
}
|
|
293
|
+
),
|
|
294
|
+
/* @__PURE__ */ jsx(
|
|
295
|
+
"button",
|
|
296
|
+
{
|
|
297
|
+
type: "button",
|
|
298
|
+
className: `${button} ${semanticClassNames.button}`,
|
|
299
|
+
"aria-label": "Download",
|
|
300
|
+
onClick: downloadVideo,
|
|
301
|
+
children: isDownloading ? /* @__PURE__ */ jsx(LoadingIcon, {}) : /* @__PURE__ */ jsx(DownloadIcon, {})
|
|
302
|
+
}
|
|
303
|
+
),
|
|
304
|
+
/* @__PURE__ */ jsx(
|
|
305
|
+
"button",
|
|
306
|
+
{
|
|
307
|
+
type: "button",
|
|
308
|
+
className: `${button} ${semanticClassNames.button}`,
|
|
309
|
+
"aria-label": isFullscreen ? "Exit fullscreen" : "Fullscreen",
|
|
310
|
+
onClick: toggleFullscreen,
|
|
311
|
+
children: isFullscreen ? /* @__PURE__ */ jsx(ExitFullscreenIcon, {}) : /* @__PURE__ */ jsx(FullscreenIcon, {})
|
|
312
|
+
}
|
|
313
|
+
)
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
)
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
) });
|
|
255
320
|
};
|
|
256
321
|
function VideoEditRenderer(props) {
|
|
257
322
|
const mode = useRendererMode();
|
|
@@ -344,32 +409,56 @@ function VideoEditRendererInner({
|
|
|
344
409
|
/* @__PURE__ */ jsx(
|
|
345
410
|
PopoverTrigger,
|
|
346
411
|
{
|
|
347
|
-
render: /* @__PURE__ */ jsx(
|
|
348
|
-
|
|
412
|
+
render: /* @__PURE__ */ jsx(
|
|
413
|
+
"div",
|
|
414
|
+
{
|
|
415
|
+
ref: wrapperRef,
|
|
416
|
+
className: `${editTrigger} ${semanticClassNames.editTrigger}`
|
|
417
|
+
}
|
|
418
|
+
),
|
|
419
|
+
children: src ? /* @__PURE__ */ jsx(
|
|
420
|
+
"figure",
|
|
421
|
+
{
|
|
422
|
+
className: `${root} ${semanticClassNames.root}`,
|
|
423
|
+
children: /* @__PURE__ */ jsxs(
|
|
424
|
+
"div",
|
|
425
|
+
{
|
|
426
|
+
className: `${editPreview} ${semanticClassNames.editPreview}`,
|
|
427
|
+
style: {
|
|
428
|
+
aspectRatio,
|
|
429
|
+
backgroundImage: poster ? `url(${poster})` : void 0
|
|
430
|
+
},
|
|
431
|
+
children: [
|
|
432
|
+
/* @__PURE__ */ jsx(
|
|
433
|
+
"video",
|
|
434
|
+
{
|
|
435
|
+
className: `${editVideo} ${semanticClassNames.editVideo}`,
|
|
436
|
+
src,
|
|
437
|
+
poster,
|
|
438
|
+
preload: "metadata"
|
|
439
|
+
}
|
|
440
|
+
),
|
|
441
|
+
/* @__PURE__ */ jsx(
|
|
442
|
+
"span",
|
|
443
|
+
{
|
|
444
|
+
className: `${editOverlay} ${semanticClassNames.editOverlay}`,
|
|
445
|
+
children: /* @__PURE__ */ jsx(Video, { size: 32 })
|
|
446
|
+
}
|
|
447
|
+
)
|
|
448
|
+
]
|
|
449
|
+
}
|
|
450
|
+
)
|
|
451
|
+
}
|
|
452
|
+
) : /* @__PURE__ */ jsxs(
|
|
349
453
|
"div",
|
|
350
454
|
{
|
|
351
|
-
className:
|
|
352
|
-
style: {
|
|
353
|
-
aspectRatio,
|
|
354
|
-
backgroundImage: poster ? `url(${poster})` : void 0
|
|
355
|
-
},
|
|
455
|
+
className: `${editPlaceholder} ${semanticClassNames.editPlaceholder}`,
|
|
356
456
|
children: [
|
|
357
|
-
/* @__PURE__ */ jsx(
|
|
358
|
-
|
|
359
|
-
{
|
|
360
|
-
className: "rr-video-edit-video",
|
|
361
|
-
src,
|
|
362
|
-
poster,
|
|
363
|
-
preload: "metadata"
|
|
364
|
-
}
|
|
365
|
-
),
|
|
366
|
-
/* @__PURE__ */ jsx("span", { className: "rr-video-edit-overlay", children: /* @__PURE__ */ jsx(Video, { size: 32 }) })
|
|
457
|
+
/* @__PURE__ */ jsx(Video, { size: 24 }),
|
|
458
|
+
/* @__PURE__ */ jsx("span", { children: "Click to add video" })
|
|
367
459
|
]
|
|
368
460
|
}
|
|
369
|
-
)
|
|
370
|
-
/* @__PURE__ */ jsx(Video, { size: 24 }),
|
|
371
|
-
/* @__PURE__ */ jsx("span", { children: "Click to add video" })
|
|
372
|
-
] })
|
|
461
|
+
)
|
|
373
462
|
}
|
|
374
463
|
),
|
|
375
464
|
/* @__PURE__ */ jsxs(
|
|
@@ -377,64 +466,94 @@ function VideoEditRendererInner({
|
|
|
377
466
|
{
|
|
378
467
|
side: "bottom",
|
|
379
468
|
sideOffset: 8,
|
|
380
|
-
className:
|
|
469
|
+
className: `${editPanel} ${semanticClassNames.editPanel}`,
|
|
381
470
|
children: [
|
|
382
|
-
/* @__PURE__ */ jsxs(
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
471
|
+
/* @__PURE__ */ jsxs(
|
|
472
|
+
"div",
|
|
473
|
+
{
|
|
474
|
+
className: `${editField} ${semanticClassNames.editField}`,
|
|
475
|
+
children: [
|
|
476
|
+
/* @__PURE__ */ jsx(
|
|
477
|
+
Video,
|
|
478
|
+
{
|
|
479
|
+
className: `${editFieldIcon} ${semanticClassNames.editFieldIcon}`,
|
|
480
|
+
size: 14
|
|
481
|
+
}
|
|
482
|
+
),
|
|
483
|
+
/* @__PURE__ */ jsx(
|
|
484
|
+
"input",
|
|
485
|
+
{
|
|
486
|
+
ref: srcInputRef,
|
|
487
|
+
className: `${editInput} ${semanticClassNames.editInput}`,
|
|
488
|
+
type: "url",
|
|
489
|
+
value: editSrc,
|
|
490
|
+
onChange: (e) => setEditSrc(e.target.value),
|
|
491
|
+
onKeyDown: handleKeyDown,
|
|
492
|
+
placeholder: "Video URL"
|
|
493
|
+
}
|
|
494
|
+
)
|
|
495
|
+
]
|
|
496
|
+
}
|
|
497
|
+
),
|
|
498
|
+
/* @__PURE__ */ jsxs(
|
|
499
|
+
"div",
|
|
500
|
+
{
|
|
501
|
+
className: `${editField} ${semanticClassNames.editField}`,
|
|
502
|
+
children: [
|
|
503
|
+
/* @__PURE__ */ jsx(
|
|
504
|
+
ImageIcon,
|
|
505
|
+
{
|
|
506
|
+
className: `${editFieldIcon} ${semanticClassNames.editFieldIcon}`,
|
|
507
|
+
size: 14
|
|
508
|
+
}
|
|
509
|
+
),
|
|
510
|
+
/* @__PURE__ */ jsx(
|
|
511
|
+
"input",
|
|
512
|
+
{
|
|
513
|
+
className: `${editInput} ${semanticClassNames.editInput}`,
|
|
514
|
+
type: "url",
|
|
515
|
+
value: editPoster,
|
|
516
|
+
onChange: (e) => setEditPoster(e.target.value),
|
|
517
|
+
onBlur: commitChanges,
|
|
518
|
+
onKeyDown: handleKeyDown,
|
|
519
|
+
placeholder: "Poster URL (optional)"
|
|
520
|
+
}
|
|
521
|
+
)
|
|
522
|
+
]
|
|
523
|
+
}
|
|
524
|
+
),
|
|
525
|
+
/* @__PURE__ */ jsxs(
|
|
526
|
+
"div",
|
|
527
|
+
{
|
|
528
|
+
className: `${editActions} ${semanticClassNames.editActions}`,
|
|
529
|
+
children: [
|
|
530
|
+
/* @__PURE__ */ jsxs(
|
|
531
|
+
"button",
|
|
532
|
+
{
|
|
533
|
+
className: `${editActionButton} ${semanticClassNames.editActionButton}`,
|
|
534
|
+
type: "button",
|
|
535
|
+
onClick: handleOpen,
|
|
536
|
+
children: [
|
|
537
|
+
/* @__PURE__ */ jsx(ExternalLink, { size: 14 }),
|
|
538
|
+
"Open"
|
|
539
|
+
]
|
|
540
|
+
}
|
|
541
|
+
),
|
|
542
|
+
/* @__PURE__ */ jsxs(
|
|
543
|
+
"button",
|
|
544
|
+
{
|
|
545
|
+
className: `${editActionButton} ${semanticClassNames.editActionButton} ${editActionButtonEnd} ${semanticClassNames.editActionButtonEnd}`,
|
|
546
|
+
type: "button",
|
|
547
|
+
onClick: handleDelete,
|
|
548
|
+
children: [
|
|
549
|
+
/* @__PURE__ */ jsx(Trash2, { size: 14 }),
|
|
550
|
+
"Remove"
|
|
551
|
+
]
|
|
552
|
+
}
|
|
553
|
+
)
|
|
554
|
+
]
|
|
555
|
+
}
|
|
556
|
+
)
|
|
438
557
|
]
|
|
439
558
|
}
|
|
440
559
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@keyframes
|
|
1
|
+
@keyframes _1x2h1ol3 {
|
|
2
2
|
0% {
|
|
3
3
|
opacity: 1;
|
|
4
4
|
transform: scale(1);
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
transform: scale(1.3);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
@keyframes
|
|
11
|
+
@keyframes _1x2h1olc {
|
|
12
12
|
from {
|
|
13
13
|
transform: rotate(0deg);
|
|
14
14
|
}
|
|
@@ -16,17 +16,17 @@
|
|
|
16
16
|
transform: rotate(360deg);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
.
|
|
19
|
+
._1x2h1ol0 {
|
|
20
20
|
margin: 1.25rem 0;
|
|
21
21
|
}
|
|
22
|
-
.
|
|
22
|
+
._1x2h1ol1 {
|
|
23
23
|
position: relative;
|
|
24
24
|
width: 100%;
|
|
25
25
|
background: #000;
|
|
26
26
|
border-radius: 0.75rem;
|
|
27
27
|
overflow: hidden;
|
|
28
28
|
}
|
|
29
|
-
.
|
|
29
|
+
._1x2h1ol2 {
|
|
30
30
|
width: 100%;
|
|
31
31
|
height: 100%;
|
|
32
32
|
display: block;
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
background: #000;
|
|
35
35
|
cursor: pointer;
|
|
36
36
|
}
|
|
37
|
-
.
|
|
37
|
+
._1x2h1ol4 {
|
|
38
38
|
position: absolute;
|
|
39
39
|
inset: 0;
|
|
40
40
|
margin: auto;
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
background: rgba(0, 0, 0, 0.7);
|
|
48
48
|
color: #fff;
|
|
49
49
|
pointer-events: none;
|
|
50
|
-
animation:
|
|
50
|
+
animation: _1x2h1ol3 0.5s ease forwards;
|
|
51
51
|
}
|
|
52
|
-
.
|
|
52
|
+
._1x2h1ol5 {
|
|
53
53
|
position: absolute;
|
|
54
54
|
left: 2rem;
|
|
55
55
|
right: 2rem;
|
|
@@ -70,11 +70,11 @@
|
|
|
70
70
|
transform: translateY(4px);
|
|
71
71
|
transition: opacity 0.2s ease, transform 0.2s ease;
|
|
72
72
|
}
|
|
73
|
-
.
|
|
73
|
+
._1x2h1ol1:hover ._1x2h1ol5, ._1x2h1ol1:focus-within ._1x2h1ol5 {
|
|
74
74
|
opacity: 1;
|
|
75
75
|
transform: translateY(0);
|
|
76
76
|
}
|
|
77
|
-
.
|
|
77
|
+
._1x2h1ol6 {
|
|
78
78
|
appearance: none;
|
|
79
79
|
border: none;
|
|
80
80
|
background: none;
|
|
@@ -88,26 +88,26 @@
|
|
|
88
88
|
flex-shrink: 0;
|
|
89
89
|
transition: transform 0.15s ease;
|
|
90
90
|
}
|
|
91
|
-
.
|
|
91
|
+
._1x2h1ol6:hover {
|
|
92
92
|
transform: scale(1.1);
|
|
93
93
|
}
|
|
94
|
-
.
|
|
94
|
+
._1x2h1ol6:active {
|
|
95
95
|
transform: scale(0.93);
|
|
96
96
|
}
|
|
97
|
-
.
|
|
97
|
+
._1x2h1ol6:focus-visible {
|
|
98
98
|
outline: 2px solid currentColor;
|
|
99
99
|
outline-offset: 2px;
|
|
100
100
|
border-radius: 4px;
|
|
101
101
|
}
|
|
102
|
-
.
|
|
102
|
+
._1x2h1ol6:disabled {
|
|
103
103
|
opacity: 0.5;
|
|
104
104
|
pointer-events: none;
|
|
105
105
|
}
|
|
106
|
-
.
|
|
106
|
+
._1x2h1ol7 {
|
|
107
107
|
flex: 1;
|
|
108
108
|
height: 100%;
|
|
109
109
|
}
|
|
110
|
-
.
|
|
110
|
+
._1x2h1ol8 {
|
|
111
111
|
position: relative;
|
|
112
112
|
display: flex;
|
|
113
113
|
align-items: center;
|
|
@@ -116,20 +116,20 @@
|
|
|
116
116
|
touch-action: none;
|
|
117
117
|
user-select: none;
|
|
118
118
|
}
|
|
119
|
-
.
|
|
119
|
+
._1x2h1ol9 {
|
|
120
120
|
position: relative;
|
|
121
121
|
flex: 1;
|
|
122
122
|
height: 0.25rem;
|
|
123
123
|
border-radius: 999px;
|
|
124
124
|
background: var(--rc-bg);
|
|
125
125
|
}
|
|
126
|
-
.
|
|
126
|
+
._1x2h1ola {
|
|
127
127
|
position: absolute;
|
|
128
128
|
height: 100%;
|
|
129
129
|
border-radius: 999px;
|
|
130
130
|
background: color-mix(in srgb, var(--rc-text-secondary) 40%, transparent);
|
|
131
131
|
}
|
|
132
|
-
.
|
|
132
|
+
._1x2h1olb {
|
|
133
133
|
display: block;
|
|
134
134
|
height: 0.75rem;
|
|
135
135
|
width: 3px;
|
|
@@ -137,14 +137,14 @@
|
|
|
137
137
|
border: none;
|
|
138
138
|
background: var(--rc-text-secondary);
|
|
139
139
|
}
|
|
140
|
-
.
|
|
141
|
-
animation:
|
|
140
|
+
._1x2h1old {
|
|
141
|
+
animation: _1x2h1olc 0.8s linear infinite;
|
|
142
142
|
}
|
|
143
|
-
.
|
|
143
|
+
._1x2h1ole {
|
|
144
144
|
display: block;
|
|
145
145
|
cursor: pointer;
|
|
146
146
|
}
|
|
147
|
-
.
|
|
147
|
+
._1x2h1olf {
|
|
148
148
|
position: relative;
|
|
149
149
|
width: 100%;
|
|
150
150
|
border-radius: 0.75rem;
|
|
@@ -154,14 +154,14 @@
|
|
|
154
154
|
background-position: center;
|
|
155
155
|
cursor: pointer;
|
|
156
156
|
}
|
|
157
|
-
.
|
|
157
|
+
._1x2h1olg {
|
|
158
158
|
width: 100%;
|
|
159
159
|
height: 100%;
|
|
160
160
|
display: block;
|
|
161
161
|
object-fit: contain;
|
|
162
162
|
pointer-events: none;
|
|
163
163
|
}
|
|
164
|
-
.
|
|
164
|
+
._1x2h1olh {
|
|
165
165
|
position: absolute;
|
|
166
166
|
inset: 0;
|
|
167
167
|
display: flex;
|
|
@@ -171,10 +171,10 @@
|
|
|
171
171
|
color: #fff;
|
|
172
172
|
transition: background 0.2s;
|
|
173
173
|
}
|
|
174
|
-
.
|
|
174
|
+
._1x2h1ole:hover ._1x2h1olh {
|
|
175
175
|
background: rgba(0, 0, 0, 0.5);
|
|
176
176
|
}
|
|
177
|
-
.
|
|
177
|
+
._1x2h1oli {
|
|
178
178
|
display: flex;
|
|
179
179
|
align-items: center;
|
|
180
180
|
justify-content: center;
|
|
@@ -187,11 +187,11 @@
|
|
|
187
187
|
cursor: pointer;
|
|
188
188
|
transition: border-color 0.2s, color 0.2s;
|
|
189
189
|
}
|
|
190
|
-
.
|
|
190
|
+
._1x2h1oli:hover {
|
|
191
191
|
border-color: var(--rc-accent);
|
|
192
192
|
color: var(--rc-text);
|
|
193
193
|
}
|
|
194
|
-
.
|
|
194
|
+
._1x2h1olj {
|
|
195
195
|
display: flex;
|
|
196
196
|
flex-direction: column;
|
|
197
197
|
gap: 8px;
|
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
font-size: 13px;
|
|
201
201
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
202
202
|
}
|
|
203
|
-
.
|
|
203
|
+
._1x2h1olk {
|
|
204
204
|
display: flex;
|
|
205
205
|
align-items: center;
|
|
206
206
|
gap: 8px;
|
|
@@ -209,11 +209,11 @@
|
|
|
209
209
|
border-radius: 6px;
|
|
210
210
|
min-width: 0;
|
|
211
211
|
}
|
|
212
|
-
.
|
|
212
|
+
._1x2h1oll {
|
|
213
213
|
flex-shrink: 0;
|
|
214
214
|
color: var(--rc-text-secondary);
|
|
215
215
|
}
|
|
216
|
-
.
|
|
216
|
+
._1x2h1olm {
|
|
217
217
|
flex: 1;
|
|
218
218
|
appearance: none;
|
|
219
219
|
border: none;
|
|
@@ -224,15 +224,15 @@
|
|
|
224
224
|
outline: none;
|
|
225
225
|
min-width: 0;
|
|
226
226
|
}
|
|
227
|
-
.
|
|
227
|
+
._1x2h1olm::placeholder {
|
|
228
228
|
color: var(--rc-text-secondary);
|
|
229
229
|
}
|
|
230
|
-
.
|
|
230
|
+
._1x2h1oln {
|
|
231
231
|
display: flex;
|
|
232
232
|
align-items: center;
|
|
233
233
|
gap: 4px;
|
|
234
234
|
}
|
|
235
|
-
.
|
|
235
|
+
._1x2h1olo {
|
|
236
236
|
display: inline-flex;
|
|
237
237
|
align-items: center;
|
|
238
238
|
gap: 6px;
|
|
@@ -248,14 +248,14 @@
|
|
|
248
248
|
transition: color 0.15s ease, background-color 0.15s ease;
|
|
249
249
|
white-space: nowrap;
|
|
250
250
|
}
|
|
251
|
-
.
|
|
251
|
+
._1x2h1olo:hover {
|
|
252
252
|
background-color: var(--rc-bg-secondary);
|
|
253
253
|
}
|
|
254
|
-
.
|
|
254
|
+
._1x2h1olp {
|
|
255
255
|
margin-left: auto;
|
|
256
256
|
}
|
|
257
257
|
@media (max-width: 768px) {
|
|
258
|
-
.
|
|
258
|
+
._1x2h1ol5 {
|
|
259
259
|
left: 0.75rem;
|
|
260
260
|
right: 0.75rem;
|
|
261
261
|
opacity: 1;
|
package/dist/styles.css.d.ts
CHANGED
|
@@ -1,2 +1,51 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export declare const semanticClassNames: {
|
|
2
|
+
readonly root: "rr-video-root";
|
|
3
|
+
readonly player: "rr-video-player";
|
|
4
|
+
readonly element: "rr-video-element";
|
|
5
|
+
readonly indicator: "rr-video-indicator";
|
|
6
|
+
readonly controls: "rr-video-controls";
|
|
7
|
+
readonly button: "rr-video-btn";
|
|
8
|
+
readonly progress: "rr-video-progress";
|
|
9
|
+
readonly progressControl: "rr-video-progress-control";
|
|
10
|
+
readonly progressTrack: "rr-video-progress-track";
|
|
11
|
+
readonly progressRange: "rr-video-progress-range";
|
|
12
|
+
readonly progressThumb: "rr-video-progress-thumb";
|
|
13
|
+
readonly spin: "rr-video-spin";
|
|
14
|
+
readonly editTrigger: "rr-video-edit-trigger";
|
|
15
|
+
readonly editPreview: "rr-video-edit-preview";
|
|
16
|
+
readonly editVideo: "rr-video-edit-video";
|
|
17
|
+
readonly editOverlay: "rr-video-edit-overlay";
|
|
18
|
+
readonly editPlaceholder: "rr-video-edit-placeholder";
|
|
19
|
+
readonly editPanel: "rr-video-edit-panel";
|
|
20
|
+
readonly editField: "rr-video-edit-field";
|
|
21
|
+
readonly editFieldIcon: "rr-video-edit-field-icon";
|
|
22
|
+
readonly editInput: "rr-video-edit-input";
|
|
23
|
+
readonly editActions: "rr-video-edit-actions";
|
|
24
|
+
readonly editActionButton: "rr-video-edit-action-btn";
|
|
25
|
+
readonly editActionButtonEnd: "rr-video-edit-action-btn--end";
|
|
26
|
+
};
|
|
27
|
+
export declare const root: string;
|
|
28
|
+
export declare const player: string;
|
|
29
|
+
export declare const element: string;
|
|
30
|
+
export declare const indicator: string;
|
|
31
|
+
export declare const controls: string;
|
|
32
|
+
export declare const button: string;
|
|
33
|
+
export declare const progress: string;
|
|
34
|
+
export declare const progressControl: string;
|
|
35
|
+
export declare const progressTrack: string;
|
|
36
|
+
export declare const progressRange: string;
|
|
37
|
+
export declare const progressThumb: string;
|
|
38
|
+
export declare const spin: string;
|
|
39
|
+
export declare const editTrigger: string;
|
|
40
|
+
export declare const editPreview: string;
|
|
41
|
+
export declare const editVideo: string;
|
|
42
|
+
export declare const editOverlay: string;
|
|
43
|
+
export declare const editPlaceholder: string;
|
|
44
|
+
export declare const editPanel: string;
|
|
45
|
+
export declare const editField: string;
|
|
46
|
+
export declare const editFieldIcon: string;
|
|
47
|
+
export declare const editInput: string;
|
|
48
|
+
export declare const editActions: string;
|
|
49
|
+
export declare const editActionButton: string;
|
|
50
|
+
export declare const editActionButtonEnd: string;
|
|
2
51
|
//# sourceMappingURL=styles.css.d.ts.map
|
package/dist/styles.css.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../src/styles.css.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../src/styles.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;CAyBrB,CAAA;AAEV,eAAO,MAAM,IAAI,QAAiC,CAAA;AAElD,eAAO,MAAM,MAAM,QAMjB,CAAA;AAEF,eAAO,MAAM,OAAO,QAOlB,CAAA;AAOF,eAAO,MAAM,SAAS,QAcpB,CAAA;AAEF,eAAO,MAAM,QAAQ,QAoCnB,CAAA;AAEF,eAAO,MAAM,MAAM,QAuBjB,CAAA;AAEF,eAAO,MAAM,QAAQ,QAAqC,CAAA;AAE1D,eAAO,MAAM,eAAe,QAQ1B,CAAA;AAEF,eAAO,MAAM,aAAa,QAMxB,CAAA;AAEF,eAAO,MAAM,aAAa,QAKxB,CAAA;AAEF,eAAO,MAAM,aAAa,QAOxB,CAAA;AAOF,eAAO,MAAM,IAAI,QAEf,CAAA;AAEF,eAAO,MAAM,WAAW,QAGtB,CAAA;AAEF,eAAO,MAAM,WAAW,QAStB,CAAA;AAEF,eAAO,MAAM,SAAS,QAMpB,CAAA;AAEF,eAAO,MAAM,WAAW,QActB,CAAA;AAEF,eAAO,MAAM,eAAe,QAkB1B,CAAA;AAEF,eAAO,MAAM,SAAS,QASpB,CAAA;AAEF,eAAO,MAAM,SAAS,QAQpB,CAAA;AAEF,eAAO,MAAM,aAAa,QAGxB,CAAA;AAEF,eAAO,MAAM,SAAS,QAepB,CAAA;AAEF,eAAO,MAAM,WAAW,QAItB,CAAA;AAEF,eAAO,MAAM,gBAAgB,QAoB3B,CAAA;AAEF,eAAO,MAAM,mBAAmB,QAAgC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-renderer-video",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Video player renderer",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@base-ui/react": "^1.1.0",
|
|
20
20
|
"lucide-react": "^0.574.0",
|
|
21
|
-
"@haklex/rich-editor": "0.0.
|
|
22
|
-
"@haklex/rich-style-token": "0.0.
|
|
23
|
-
"@haklex/rich-editor-ui": "0.0.
|
|
21
|
+
"@haklex/rich-editor": "0.0.5",
|
|
22
|
+
"@haklex/rich-style-token": "0.0.5",
|
|
23
|
+
"@haklex/rich-editor-ui": "0.0.5"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@lexical/react": "^0.39.0",
|