@gfazioli/mantine-video 1.2.11 → 1.2.13
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/cjs/Video.cjs +61 -13
- package/dist/cjs/Video.cjs.map +1 -1
- package/dist/cjs/Video.context.cjs.map +1 -1
- package/dist/cjs/components/VideoControls.cjs +3 -1
- package/dist/cjs/components/VideoControls.cjs.map +1 -1
- package/dist/cjs/components/VideoTimeDisplay.cjs +0 -1
- package/dist/cjs/components/VideoTimeDisplay.cjs.map +1 -1
- package/dist/cjs/cue-lift.cjs +14 -0
- package/dist/cjs/cue-lift.cjs.map +1 -0
- package/dist/esm/Video.context.mjs.map +1 -1
- package/dist/esm/Video.mjs +62 -14
- package/dist/esm/Video.mjs.map +1 -1
- package/dist/esm/components/VideoControls.mjs +3 -1
- package/dist/esm/components/VideoControls.mjs.map +1 -1
- package/dist/esm/components/VideoTimeDisplay.mjs +0 -1
- package/dist/esm/components/VideoTimeDisplay.mjs.map +1 -1
- package/dist/esm/cue-lift.mjs +12 -0
- package/dist/esm/cue-lift.mjs.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/styles.layer.css +1 -1
- package/dist/types/Video.context.d.ts +3 -0
- package/dist/types/cue-lift.d.ts +14 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoControls.mjs","sources":["../../../src/components/VideoControls.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@mantine/core';\nimport React, { forwardRef, type ReactNode } from 'react';\nimport { useVideoContext } from '../Video.context';\nimport { VideoCaptionsButton } from './VideoCaptionsButton';\nimport { VideoFullscreenButton } from './VideoFullscreenButton';\nimport { VideoMuteButton } from './VideoMuteButton';\nimport { VideoPiPButton } from './VideoPiPButton';\nimport { VideoPlayButton } from './VideoPlayButton';\nimport { VideoTimeDisplay } from './VideoTimeDisplay';\nimport { VideoTimeline } from './VideoTimeline';\n\nexport interface VideoControlsProps extends BoxProps {\n children?: ReactNode;\n}\n\nexport const VideoControls = forwardRef<HTMLDivElement, VideoControlsProps>(\n ({ children, ...others }, ref) => {\n const ctx = useVideoContext();\n\n return (\n <Box\n ref={
|
|
1
|
+
{"version":3,"file":"VideoControls.mjs","sources":["../../../src/components/VideoControls.tsx"],"sourcesContent":["import { Box, type BoxProps } from '@mantine/core';\nimport { useMergedRef } from '@mantine/hooks';\nimport React, { forwardRef, type ReactNode } from 'react';\nimport { useVideoContext } from '../Video.context';\nimport { VideoCaptionsButton } from './VideoCaptionsButton';\nimport { VideoFullscreenButton } from './VideoFullscreenButton';\nimport { VideoMuteButton } from './VideoMuteButton';\nimport { VideoPiPButton } from './VideoPiPButton';\nimport { VideoPlayButton } from './VideoPlayButton';\nimport { VideoTimeDisplay } from './VideoTimeDisplay';\nimport { VideoTimeline } from './VideoTimeline';\n\nexport interface VideoControlsProps extends BoxProps {\n children?: ReactNode;\n}\n\nexport const VideoControls = forwardRef<HTMLDivElement, VideoControlsProps>(\n ({ children, ...others }, ref) => {\n const ctx = useVideoContext();\n const mergedRef = useMergedRef(ref, ctx.controlsRef);\n\n return (\n <Box\n ref={mergedRef}\n {...ctx.getStyles('controls')}\n mod={{ visible: ctx.controlsVisible }}\n onClick={(event) => event.stopPropagation()}\n {...others}\n >\n <Box {...ctx.getStyles('controlBar')}>\n {children ?? (\n <>\n <VideoPlayButton />\n <VideoTimeline />\n <VideoTimeDisplay />\n <VideoMuteButton />\n <VideoCaptionsButton />\n <VideoPiPButton />\n <VideoFullscreenButton />\n </>\n )}\n </Box>\n </Box>\n );\n }\n);\n\nVideoControls.displayName = 'VideoControls';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAWY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,GAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA;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version":3,"file":"VideoTimeDisplay.mjs","sources":["../../../src/components/VideoTimeDisplay.tsx"],"sourcesContent":["import { Text, type TextProps } from '@mantine/core';\nimport React, { forwardRef } from 'react';\nimport { useVideoContext } from '../Video.context';\n\nexport type VideoTimeDisplayFormat =\n | 'current'\n | 'duration'\n | 'remaining'\n | 'current/duration'\n | 'current/-remaining';\n\nexport interface VideoTimeDisplayProps extends TextProps {\n /** Display format. Default `'current/duration'`. */\n format?: VideoTimeDisplayFormat;\n}\n\nexport const VideoTimeDisplay = forwardRef<HTMLParagraphElement, VideoTimeDisplayProps>(\n ({ format = 'current/duration', ...others }, ref) => {\n const ctx = useVideoContext();\n const value = formatByMode(format, ctx.currentTime, ctx.duration);\n\n return (\n <Text\n ref={ref}\n size=\"sm\"\n
|
|
1
|
+
{"version":3,"file":"VideoTimeDisplay.mjs","sources":["../../../src/components/VideoTimeDisplay.tsx"],"sourcesContent":["import { Text, type TextProps } from '@mantine/core';\nimport React, { forwardRef } from 'react';\nimport { useVideoContext } from '../Video.context';\n\nexport type VideoTimeDisplayFormat =\n | 'current'\n | 'duration'\n | 'remaining'\n | 'current/duration'\n | 'current/-remaining';\n\nexport interface VideoTimeDisplayProps extends TextProps {\n /** Display format. Default `'current/duration'`. */\n format?: VideoTimeDisplayFormat;\n}\n\nexport const VideoTimeDisplay = forwardRef<HTMLParagraphElement, VideoTimeDisplayProps>(\n ({ format = 'current/duration', ...others }, ref) => {\n const ctx = useVideoContext();\n const value = formatByMode(format, ctx.currentTime, ctx.duration);\n\n return (\n <Text\n ref={ref}\n size=\"sm\"\n ff=\"monospace\"\n ta=\"center\"\n {...ctx.getStyles('timeDisplay')}\n {...others}\n >\n {value}\n </Text>\n );\n }\n);\n\nVideoTimeDisplay.displayName = 'VideoTimeDisplay';\n\nfunction formatTime(seconds: number): string {\n if (!Number.isFinite(seconds) || seconds < 0) return '0:00';\n const total = Math.floor(seconds);\n const h = Math.floor(total / 3600);\n const m = Math.floor((total % 3600) / 60);\n const s = total % 60;\n const mm = h > 0 ? String(m).padStart(2, '0') : String(m);\n const ss = String(s).padStart(2, '0');\n return h > 0 ? `${h}:${mm}:${ss}` : `${mm}:${ss}`;\n}\n\nfunction formatByMode(mode: VideoTimeDisplayFormat, current: number, duration: number): string {\n switch (mode) {\n case 'current':\n return formatTime(current);\n case 'duration':\n return formatTime(duration);\n case 'remaining':\n return formatTime(Math.max(duration - current, 0));\n case 'current/-remaining':\n return `${formatTime(current)} / -${formatTime(Math.max(duration - current, 0))}`;\n case 'current/duration':\n default:\n return `${formatTime(current)} / ${formatTime(duration)}`;\n }\n}\n"],"names":[],"mappings":";;;;;AAGY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,GAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAA;AAC1C,CAAA,CAAE,CAAC,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB,CAAA,CAAE,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAE,CAAA,CAAE,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA;AACvD,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAG,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,CAAA,CAAE,CAAA;AACjC,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAkB,CAAA;AAC3B,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAC,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAC,CAAC,CAAA,CAAA,CAAG,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAC,CAAC,CAAC,CAAA;AAC/D,CAAA,CAAA,CAAA;AACA,CAAA;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
const GAP = 4;
|
|
3
|
+
function cueLift(video, bar) {
|
|
4
|
+
if (bar.offsetParent === null) {
|
|
5
|
+
return null;
|
|
6
|
+
}
|
|
7
|
+
const covered = video.offsetTop + video.offsetHeight - bar.offsetTop;
|
|
8
|
+
return video.offsetHeight > 0 && covered > 0 ? covered + GAP : null;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { cueLift };
|
|
12
|
+
//# sourceMappingURL=cue-lift.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cue-lift.mjs","sources":["../../src/cue-lift.ts"],"sourcesContent":["/**\n * Browsers paint captions at the bottom of the video, which is where the overlay control bar\n * sits. While the bar shows, the player moves the captions' container up by the height the bar\n * covers (`--video-cue-lift`, read by `Video.module.css`), so the cues rest just above it.\n *\n * Moving the cues themselves (`VTTCue.line` with `lineAlign: 'end'`) is not an option: Chrome\n * ignores `lineAlign` and puts the cue's top where its bottom was meant to be.\n */\n\n/** Space between the bar and the bottom of the captions, in pixels. */\nconst GAP = 4;\n\n/**\n * How far to move the captions up, in pixels, or `null` when the bar does not cover the video.\n * Both positions are layout offsets in the player's root, so the bar's fade-in transform does not\n * count. A bar with no layout (`display: none`, or removed) has no offset to read.\n */\nexport function cueLift(\n video: Pick<HTMLElement, 'offsetTop' | 'offsetHeight'>,\n bar: Pick<HTMLElement, 'offsetTop' | 'offsetParent'>\n): number | null {\n if (bar.offsetParent === null) {\n return null;\n }\n const covered = video.offsetTop + video.offsetHeight - bar.offsetTop;\n return video.offsetHeight > 0 && covered > 0 ? covered + GAP : null;\n}\n"],"names":[],"mappings":";AAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAG,GAAG,CAAC,CAAA;AACN,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAC,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAE,GAAG,CAAA,CAAE,CAAA;AACpC,CAAA,CAAE,IAAI,CAAA,CAAA,CAAG,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAA,CAAK,IAAI,CAAA,CAAE,CAAA;AACjC,CAAA,CAAA,CAAA,CAAI,OAAO,CAAA,CAAA,CAAA,CAAI,CAAA;AACf,CAAA,CAAE,CAAA;AACF,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAK,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAK,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAG,CAAA,CAAA,CAAG,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAA;AACtE,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAK,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,GAAG,CAAC,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAG,CAAC,CAAA,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAA,CAAA,CAAG,CAAA,CAAA,CAAG,GAAG,CAAA,CAAA,CAAA,CAAI,CAAA;AACrE,CAAA;;"}
|
package/dist/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.me_93a1ff14{--video-color:var(--mantine-primary-color-filled);--video-radius:var(--mantine-radius-md);--video-bg:#000;--video-controls-bg:linear-gradient(0deg,rgba(0,0,0,.85) 0%,rgba(0,0,0,.35) 60%,transparent);--video-controls-height:44px;--video-controls-text-color:#fff;--video-timeline-color:var(--video-color);--video-timeline-thumb-color:var(--video-color);background:var(--video-bg);border-radius:var(--video-radius);cursor:pointer;display:block;outline:none;overflow:hidden;position:relative;user-select:none}.me_93a1ff14:focus-visible{outline:2px solid var(--video-color);outline-offset:2px}.me_93a1ff14[data-fullscreen]{border-radius:0}.me_93a1ff14[data-variant=bordered],.me_93a1ff14[data-variant=minimal]{--video-controls-bg:transparent;background:transparent;cursor:default;overflow:visible}.me_93a1ff14[data-variant=bordered]{border:1px solid var(--mantine-color-default-border);border-radius:var(--video-radius);overflow:hidden}.me_93a1ff14[data-variant=floating]{--video-controls-bg:transparent}.me_e0d35c89{background:#000;display:block;height:100%;object-fit:var(--video-object-fit,contain);width:100%}.me_93a1ff14[data-as-background]{border-radius:0;cursor:default;height:100%;inset:0;overflow:hidden;position:absolute;width:100%}.me_c06a98ab{backdrop-filter:blur(8px);background:rgba(0,0,0,.5);bottom:16px;color:#fff;position:absolute;right:16px;z-index:2}.me_c06a98ab:hover{background:rgba(0,0,0,.7)}.me_cdf35be8{background:var(--video-controls-bg);color:var(--video-controls-text-color);display:flex;flex-direction:column;gap:4px;inset:auto 0 0;opacity:0;padding:12px 16px;pointer-events:none;position:absolute;transform:translateY(8px);transition:opacity .2s ease,transform .2s ease}.me_cdf35be8[data-visible]{opacity:1;pointer-events:auto;transform:none}[data-variant=floating]>.me_cdf35be8{backdrop-filter:blur(8px);background:rgba(0,0,0,.65);border-radius:var(--mantine-radius-md);inset:auto 12px 12px}[data-variant=bordered]>.me_cdf35be8,[data-variant=minimal]>.me_cdf35be8{background:var(--mantine-color-default);color:var(--mantine-color-text);opacity:1;pointer-events:auto;position:static;transform:none}.me_1e8b5628{align-items:center;display:flex;gap:6px}.me_1d5188b7,.me_273e3f5d,.me_39f8f838,.me_3d7259ff,.me_bdfae1bd,.me_c8163091,.me_e5822e43{color:var(--video-controls-text-color)}.me_1d5188b7:hover,.me_273e3f5d:hover,.me_39f8f838:hover,.me_3d7259ff:hover,.me_bdfae1bd:hover,.me_c8163091:hover,.me_e5822e43:hover{background:hsla(0,0%,100%,.12)}[data-variant=bordered] .me_1d5188b7,[data-variant=bordered] .me_273e3f5d,[data-variant=bordered] .me_39f8f838,[data-variant=bordered] .me_3d7259ff,[data-variant=bordered] .me_bdfae1bd,[data-variant=bordered] .me_c8163091,[data-variant=bordered] .me_e5822e43,[data-variant=minimal] .me_1d5188b7,[data-variant=minimal] .me_273e3f5d,[data-variant=minimal] .me_39f8f838,[data-variant=minimal] .me_3d7259ff,[data-variant=minimal] .me_bdfae1bd,[data-variant=minimal] .me_c8163091,[data-variant=minimal] .me_e5822e43{color:var(--mantine-color-text)}[data-variant=bordered] .me_1d5188b7:hover,[data-variant=bordered] .me_273e3f5d:hover,[data-variant=bordered] .me_39f8f838:hover,[data-variant=bordered] .me_3d7259ff:hover,[data-variant=bordered] .me_bdfae1bd:hover,[data-variant=bordered] .me_c8163091:hover,[data-variant=bordered] .me_e5822e43:hover,[data-variant=minimal] .me_1d5188b7:hover,[data-variant=minimal] .me_273e3f5d:hover,[data-variant=minimal] .me_39f8f838:hover,[data-variant=minimal] .me_3d7259ff:hover,[data-variant=minimal] .me_bdfae1bd:hover,[data-variant=minimal] .me_c8163091:hover,[data-variant=minimal] .me_e5822e43:hover{background:var(--mantine-color-default-hover)}.me_73f6e973{align-items:center;display:flex;flex:1;margin:0 4px;position:relative}.me_aaddbb72{background:hsla(0,0%,100%,.4);border-radius:2px;height:4px;inset:50% 0 auto;pointer-events:none;position:absolute;transform:translateY(-50%);transition:width .25s linear}[data-variant=bordered] .me_aaddbb72,[data-variant=minimal] .me_aaddbb72{background:var(--mantine-color-default-hover)}.me_a6bc92c3{font-variant-numeric:tabular-nums;min-width:88px;text-align:center}[data-variant=bordered] .me_a6bc92c3,[data-variant=minimal] .me_a6bc92c3{color:var(--mantine-color-text)}
|
|
1
|
+
.me_93a1ff14{--video-color:var(--mantine-primary-color-filled);--video-radius:var(--mantine-radius-md);--video-bg:#000;--video-controls-bg:linear-gradient(0deg,rgba(0,0,0,.85) 0%,rgba(0,0,0,.35) 60%,transparent);--video-controls-height:44px;--video-controls-text-color:#fff;--video-timeline-color:var(--video-color);--video-timeline-thumb-color:var(--video-color);background:var(--video-bg);border-radius:var(--video-radius);cursor:pointer;display:block;outline:none;overflow:hidden;position:relative;user-select:none}.me_93a1ff14:focus-visible{outline:2px solid var(--video-color);outline-offset:2px}.me_93a1ff14[data-fullscreen]{border-radius:0}.me_93a1ff14[data-variant=bordered],.me_93a1ff14[data-variant=minimal]{--video-controls-bg:transparent;background:transparent;cursor:default;overflow:visible}.me_93a1ff14[data-variant=bordered]{border:1px solid var(--mantine-color-default-border);border-radius:var(--video-radius);overflow:hidden}.me_93a1ff14[data-variant=floating]{--video-controls-bg:transparent}.me_e0d35c89{background:#000;display:block;height:100%;object-fit:var(--video-object-fit,contain);width:100%}.me_e0d35c89::-webkit-media-text-track-container{transform:translateY(calc(var(--video-cue-lift, 0px)*-1));transition:transform .2s ease}.me_93a1ff14[data-as-background]{border-radius:0;cursor:default;height:100%;inset:0;overflow:hidden;position:absolute;width:100%}.me_c06a98ab{backdrop-filter:blur(8px);background:rgba(0,0,0,.5);bottom:16px;color:#fff;position:absolute;right:16px;z-index:2}.me_c06a98ab:hover{background:rgba(0,0,0,.7)}.me_cdf35be8{background:var(--video-controls-bg);color:var(--video-controls-text-color);display:flex;flex-direction:column;gap:4px;inset:auto 0 0;opacity:0;padding:12px 16px;pointer-events:none;position:absolute;transform:translateY(8px);transition:opacity .2s ease,transform .2s ease}.me_cdf35be8[data-visible]{opacity:1;pointer-events:auto;transform:none}[data-variant=floating]>.me_cdf35be8{backdrop-filter:blur(8px);background:rgba(0,0,0,.65);border-radius:var(--mantine-radius-md);inset:auto 12px 12px}[data-variant=bordered]>.me_cdf35be8,[data-variant=minimal]>.me_cdf35be8{background:var(--mantine-color-default);color:var(--mantine-color-text);opacity:1;pointer-events:auto;position:static;transform:none}.me_1e8b5628{align-items:center;display:flex;gap:6px}.me_1d5188b7,.me_273e3f5d,.me_39f8f838,.me_3d7259ff,.me_bdfae1bd,.me_c8163091,.me_e5822e43{color:var(--video-controls-text-color)}.me_1d5188b7:hover,.me_273e3f5d:hover,.me_39f8f838:hover,.me_3d7259ff:hover,.me_bdfae1bd:hover,.me_c8163091:hover,.me_e5822e43:hover{background:hsla(0,0%,100%,.12)}[data-variant=bordered] .me_1d5188b7,[data-variant=bordered] .me_273e3f5d,[data-variant=bordered] .me_39f8f838,[data-variant=bordered] .me_3d7259ff,[data-variant=bordered] .me_bdfae1bd,[data-variant=bordered] .me_c8163091,[data-variant=bordered] .me_e5822e43,[data-variant=minimal] .me_1d5188b7,[data-variant=minimal] .me_273e3f5d,[data-variant=minimal] .me_39f8f838,[data-variant=minimal] .me_3d7259ff,[data-variant=minimal] .me_bdfae1bd,[data-variant=minimal] .me_c8163091,[data-variant=minimal] .me_e5822e43{color:var(--mantine-color-text)}[data-variant=bordered] .me_1d5188b7:hover,[data-variant=bordered] .me_273e3f5d:hover,[data-variant=bordered] .me_39f8f838:hover,[data-variant=bordered] .me_3d7259ff:hover,[data-variant=bordered] .me_bdfae1bd:hover,[data-variant=bordered] .me_c8163091:hover,[data-variant=bordered] .me_e5822e43:hover,[data-variant=minimal] .me_1d5188b7:hover,[data-variant=minimal] .me_273e3f5d:hover,[data-variant=minimal] .me_39f8f838:hover,[data-variant=minimal] .me_3d7259ff:hover,[data-variant=minimal] .me_bdfae1bd:hover,[data-variant=minimal] .me_c8163091:hover,[data-variant=minimal] .me_e5822e43:hover{background:var(--mantine-color-default-hover)}.me_73f6e973{align-items:center;display:flex;flex:1;margin:0 4px;position:relative}.me_aaddbb72{background:hsla(0,0%,100%,.4);border-radius:2px;height:4px;inset:50% 0 auto;pointer-events:none;position:absolute;transform:translateY(-50%);transition:width .25s linear}[data-variant=bordered] .me_aaddbb72,[data-variant=minimal] .me_aaddbb72{background:var(--mantine-color-default-hover)}.me_a6bc92c3{color:var(--video-controls-text-color);font-variant-numeric:tabular-nums;min-width:88px;text-align:center}[data-variant=bordered] .me_a6bc92c3,[data-variant=minimal] .me_a6bc92c3{color:var(--mantine-color-text)}
|
package/dist/styles.layer.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer mantine-video {.me_93a1ff14{--video-color:var(--mantine-primary-color-filled);--video-radius:var(--mantine-radius-md);--video-bg:#000;--video-controls-bg:linear-gradient(0deg,rgba(0,0,0,.85) 0%,rgba(0,0,0,.35) 60%,transparent);--video-controls-height:44px;--video-controls-text-color:#fff;--video-timeline-color:var(--video-color);--video-timeline-thumb-color:var(--video-color);background:var(--video-bg);border-radius:var(--video-radius);cursor:pointer;display:block;outline:none;overflow:hidden;position:relative;user-select:none}.me_93a1ff14:focus-visible{outline:2px solid var(--video-color);outline-offset:2px}.me_93a1ff14[data-fullscreen]{border-radius:0}.me_93a1ff14[data-variant=bordered],.me_93a1ff14[data-variant=minimal]{--video-controls-bg:transparent;background:transparent;cursor:default;overflow:visible}.me_93a1ff14[data-variant=bordered]{border:1px solid var(--mantine-color-default-border);border-radius:var(--video-radius);overflow:hidden}.me_93a1ff14[data-variant=floating]{--video-controls-bg:transparent}.me_e0d35c89{background:#000;display:block;height:100%;object-fit:var(--video-object-fit,contain);width:100%}.me_93a1ff14[data-as-background]{border-radius:0;cursor:default;height:100%;inset:0;overflow:hidden;position:absolute;width:100%}.me_c06a98ab{backdrop-filter:blur(8px);background:rgba(0,0,0,.5);bottom:16px;color:#fff;position:absolute;right:16px;z-index:2}.me_c06a98ab:hover{background:rgba(0,0,0,.7)}.me_cdf35be8{background:var(--video-controls-bg);color:var(--video-controls-text-color);display:flex;flex-direction:column;gap:4px;inset:auto 0 0;opacity:0;padding:12px 16px;pointer-events:none;position:absolute;transform:translateY(8px);transition:opacity .2s ease,transform .2s ease}.me_cdf35be8[data-visible]{opacity:1;pointer-events:auto;transform:none}[data-variant=floating]>.me_cdf35be8{backdrop-filter:blur(8px);background:rgba(0,0,0,.65);border-radius:var(--mantine-radius-md);inset:auto 12px 12px}[data-variant=bordered]>.me_cdf35be8,[data-variant=minimal]>.me_cdf35be8{background:var(--mantine-color-default);color:var(--mantine-color-text);opacity:1;pointer-events:auto;position:static;transform:none}.me_1e8b5628{align-items:center;display:flex;gap:6px}.me_1d5188b7,.me_273e3f5d,.me_39f8f838,.me_3d7259ff,.me_bdfae1bd,.me_c8163091,.me_e5822e43{color:var(--video-controls-text-color)}.me_1d5188b7:hover,.me_273e3f5d:hover,.me_39f8f838:hover,.me_3d7259ff:hover,.me_bdfae1bd:hover,.me_c8163091:hover,.me_e5822e43:hover{background:hsla(0,0%,100%,.12)}[data-variant=bordered] .me_1d5188b7,[data-variant=bordered] .me_273e3f5d,[data-variant=bordered] .me_39f8f838,[data-variant=bordered] .me_3d7259ff,[data-variant=bordered] .me_bdfae1bd,[data-variant=bordered] .me_c8163091,[data-variant=bordered] .me_e5822e43,[data-variant=minimal] .me_1d5188b7,[data-variant=minimal] .me_273e3f5d,[data-variant=minimal] .me_39f8f838,[data-variant=minimal] .me_3d7259ff,[data-variant=minimal] .me_bdfae1bd,[data-variant=minimal] .me_c8163091,[data-variant=minimal] .me_e5822e43{color:var(--mantine-color-text)}[data-variant=bordered] .me_1d5188b7:hover,[data-variant=bordered] .me_273e3f5d:hover,[data-variant=bordered] .me_39f8f838:hover,[data-variant=bordered] .me_3d7259ff:hover,[data-variant=bordered] .me_bdfae1bd:hover,[data-variant=bordered] .me_c8163091:hover,[data-variant=bordered] .me_e5822e43:hover,[data-variant=minimal] .me_1d5188b7:hover,[data-variant=minimal] .me_273e3f5d:hover,[data-variant=minimal] .me_39f8f838:hover,[data-variant=minimal] .me_3d7259ff:hover,[data-variant=minimal] .me_bdfae1bd:hover,[data-variant=minimal] .me_c8163091:hover,[data-variant=minimal] .me_e5822e43:hover{background:var(--mantine-color-default-hover)}.me_73f6e973{align-items:center;display:flex;flex:1;margin:0 4px;position:relative}.me_aaddbb72{background:hsla(0,0%,100%,.4);border-radius:2px;height:4px;inset:50% 0 auto;pointer-events:none;position:absolute;transform:translateY(-50%);transition:width .25s linear}[data-variant=bordered] .me_aaddbb72,[data-variant=minimal] .me_aaddbb72{background:var(--mantine-color-default-hover)}.me_a6bc92c3{font-variant-numeric:tabular-nums;min-width:88px;text-align:center}[data-variant=bordered] .me_a6bc92c3,[data-variant=minimal] .me_a6bc92c3{color:var(--mantine-color-text)}}
|
|
1
|
+
@layer mantine-video {.me_93a1ff14{--video-color:var(--mantine-primary-color-filled);--video-radius:var(--mantine-radius-md);--video-bg:#000;--video-controls-bg:linear-gradient(0deg,rgba(0,0,0,.85) 0%,rgba(0,0,0,.35) 60%,transparent);--video-controls-height:44px;--video-controls-text-color:#fff;--video-timeline-color:var(--video-color);--video-timeline-thumb-color:var(--video-color);background:var(--video-bg);border-radius:var(--video-radius);cursor:pointer;display:block;outline:none;overflow:hidden;position:relative;user-select:none}.me_93a1ff14:focus-visible{outline:2px solid var(--video-color);outline-offset:2px}.me_93a1ff14[data-fullscreen]{border-radius:0}.me_93a1ff14[data-variant=bordered],.me_93a1ff14[data-variant=minimal]{--video-controls-bg:transparent;background:transparent;cursor:default;overflow:visible}.me_93a1ff14[data-variant=bordered]{border:1px solid var(--mantine-color-default-border);border-radius:var(--video-radius);overflow:hidden}.me_93a1ff14[data-variant=floating]{--video-controls-bg:transparent}.me_e0d35c89{background:#000;display:block;height:100%;object-fit:var(--video-object-fit,contain);width:100%}.me_e0d35c89::-webkit-media-text-track-container{transform:translateY(calc(var(--video-cue-lift, 0px)*-1));transition:transform .2s ease}.me_93a1ff14[data-as-background]{border-radius:0;cursor:default;height:100%;inset:0;overflow:hidden;position:absolute;width:100%}.me_c06a98ab{backdrop-filter:blur(8px);background:rgba(0,0,0,.5);bottom:16px;color:#fff;position:absolute;right:16px;z-index:2}.me_c06a98ab:hover{background:rgba(0,0,0,.7)}.me_cdf35be8{background:var(--video-controls-bg);color:var(--video-controls-text-color);display:flex;flex-direction:column;gap:4px;inset:auto 0 0;opacity:0;padding:12px 16px;pointer-events:none;position:absolute;transform:translateY(8px);transition:opacity .2s ease,transform .2s ease}.me_cdf35be8[data-visible]{opacity:1;pointer-events:auto;transform:none}[data-variant=floating]>.me_cdf35be8{backdrop-filter:blur(8px);background:rgba(0,0,0,.65);border-radius:var(--mantine-radius-md);inset:auto 12px 12px}[data-variant=bordered]>.me_cdf35be8,[data-variant=minimal]>.me_cdf35be8{background:var(--mantine-color-default);color:var(--mantine-color-text);opacity:1;pointer-events:auto;position:static;transform:none}.me_1e8b5628{align-items:center;display:flex;gap:6px}.me_1d5188b7,.me_273e3f5d,.me_39f8f838,.me_3d7259ff,.me_bdfae1bd,.me_c8163091,.me_e5822e43{color:var(--video-controls-text-color)}.me_1d5188b7:hover,.me_273e3f5d:hover,.me_39f8f838:hover,.me_3d7259ff:hover,.me_bdfae1bd:hover,.me_c8163091:hover,.me_e5822e43:hover{background:hsla(0,0%,100%,.12)}[data-variant=bordered] .me_1d5188b7,[data-variant=bordered] .me_273e3f5d,[data-variant=bordered] .me_39f8f838,[data-variant=bordered] .me_3d7259ff,[data-variant=bordered] .me_bdfae1bd,[data-variant=bordered] .me_c8163091,[data-variant=bordered] .me_e5822e43,[data-variant=minimal] .me_1d5188b7,[data-variant=minimal] .me_273e3f5d,[data-variant=minimal] .me_39f8f838,[data-variant=minimal] .me_3d7259ff,[data-variant=minimal] .me_bdfae1bd,[data-variant=minimal] .me_c8163091,[data-variant=minimal] .me_e5822e43{color:var(--mantine-color-text)}[data-variant=bordered] .me_1d5188b7:hover,[data-variant=bordered] .me_273e3f5d:hover,[data-variant=bordered] .me_39f8f838:hover,[data-variant=bordered] .me_3d7259ff:hover,[data-variant=bordered] .me_bdfae1bd:hover,[data-variant=bordered] .me_c8163091:hover,[data-variant=bordered] .me_e5822e43:hover,[data-variant=minimal] .me_1d5188b7:hover,[data-variant=minimal] .me_273e3f5d:hover,[data-variant=minimal] .me_39f8f838:hover,[data-variant=minimal] .me_3d7259ff:hover,[data-variant=minimal] .me_bdfae1bd:hover,[data-variant=minimal] .me_c8163091:hover,[data-variant=minimal] .me_e5822e43:hover{background:var(--mantine-color-default-hover)}.me_73f6e973{align-items:center;display:flex;flex:1;margin:0 4px;position:relative}.me_aaddbb72{background:hsla(0,0%,100%,.4);border-radius:2px;height:4px;inset:50% 0 auto;pointer-events:none;position:absolute;transform:translateY(-50%);transition:width .25s linear}[data-variant=bordered] .me_aaddbb72,[data-variant=minimal] .me_aaddbb72{background:var(--mantine-color-default-hover)}.me_a6bc92c3{color:var(--video-controls-text-color);font-variant-numeric:tabular-nums;min-width:88px;text-align:center}[data-variant=bordered] .me_a6bc92c3,[data-variant=minimal] .me_a6bc92c3{color:var(--mantine-color-text)}}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { GetStylesApi } from '@mantine/core';
|
|
2
|
+
import { type RefObject } from 'react';
|
|
2
3
|
import type { UseVideoReturn } from './use-video';
|
|
3
4
|
import type { VideoFactory } from './Video';
|
|
4
5
|
export interface VideoContextValue extends UseVideoReturn {
|
|
5
6
|
getStyles: GetStylesApi<VideoFactory>;
|
|
6
7
|
controlsVisible: boolean;
|
|
7
8
|
showControls: () => void;
|
|
9
|
+
/** The control bar's element, set by `Video.Controls`: captions are lifted above it while it shows. */
|
|
10
|
+
controlsRef?: RefObject<HTMLDivElement | null>;
|
|
8
11
|
}
|
|
9
12
|
export declare const VideoContext: import("react").Context<VideoContextValue | null>;
|
|
10
13
|
export declare const VideoProvider: import("react").Provider<VideoContextValue | null>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browsers paint captions at the bottom of the video, which is where the overlay control bar
|
|
3
|
+
* sits. While the bar shows, the player moves the captions' container up by the height the bar
|
|
4
|
+
* covers (`--video-cue-lift`, read by `Video.module.css`), so the cues rest just above it.
|
|
5
|
+
*
|
|
6
|
+
* Moving the cues themselves (`VTTCue.line` with `lineAlign: 'end'`) is not an option: Chrome
|
|
7
|
+
* ignores `lineAlign` and puts the cue's top where its bottom was meant to be.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* How far to move the captions up, in pixels, or `null` when the bar does not cover the video.
|
|
11
|
+
* Both positions are layout offsets in the player's root, so the bar's fade-in transform does not
|
|
12
|
+
* count. A bar with no layout (`display: none`, or removed) has no offset to read.
|
|
13
|
+
*/
|
|
14
|
+
export declare function cueLift(video: Pick<HTMLElement, 'offsetTop' | 'offsetHeight'>, bar: Pick<HTMLElement, 'offsetTop' | 'offsetParent'>): number | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gfazioli/mantine-video",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.13",
|
|
4
4
|
"description": "A customizable video player component for React built with Mantine. Compound API in Mantine ecosystem style, headless useVideo hook, theme-aware styling, accessibility, and full Styles API.",
|
|
5
5
|
"homepage": "https://gfazioli.github.io/mantine-video/",
|
|
6
6
|
"packageManager": "yarn@4.0.1",
|