dinocollab-shared 1.1.17 → 1.1.19
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/cart/widget.js +1 -1
- package/dist/cart/widget.js.map +1 -1
- package/dist/layout-global/app-footer.js +1 -1
- package/dist/layout-global/app-footer.js.map +1 -1
- package/dist/layout-global/configs.js +1 -1
- package/dist/layout-global/configs.js.map +1 -1
- package/dist/media-player/analytic-media.js +2 -0
- package/dist/media-player/analytic-media.js.map +1 -0
- package/dist/media-player/core/btn.fullscreen.js +2 -0
- package/dist/media-player/core/btn.fullscreen.js.map +1 -0
- package/dist/media-player/core/btn.pip.js +2 -0
- package/dist/media-player/core/btn.pip.js.map +1 -0
- package/dist/media-player/core/btn.play.js +2 -0
- package/dist/media-player/core/btn.play.js.map +1 -0
- package/dist/media-player/core/btn.volume.js +2 -0
- package/dist/media-player/core/btn.volume.js.map +1 -0
- package/dist/media-player/core/progressBar.js +2 -0
- package/dist/media-player/core/progressBar.js.map +1 -0
- package/dist/media-player/core/time.js +2 -0
- package/dist/media-player/core/time.js.map +1 -0
- package/dist/media-player/core/useVideoPlayerCore.js +2 -0
- package/dist/media-player/core/useVideoPlayerCore.js.map +1 -0
- package/dist/media-player/core/videoplayer.js +2 -0
- package/dist/media-player/core/videoplayer.js.map +1 -0
- package/dist/media-player/helpers.js +2 -0
- package/dist/media-player/helpers.js.map +1 -0
- package/dist/media-player/index.js +2 -0
- package/dist/media-player/index.js.map +1 -0
- package/dist/media-player/mediaMetadata.js +2 -0
- package/dist/media-player/mediaMetadata.js.map +1 -0
- package/dist/media-player/muted.js +2 -0
- package/dist/media-player/muted.js.map +1 -0
- package/dist/media-player/player.audio.js +2 -0
- package/dist/media-player/player.audio.js.map +1 -0
- package/dist/media-player/player.video-stream.js +2 -0
- package/dist/media-player/player.video-stream.js.map +1 -0
- package/dist/media-player/preview.js +2 -0
- package/dist/media-player/preview.js.map +1 -0
- package/dist/media-player/types.js +2 -0
- package/dist/media-player/types.js.map +1 -0
- package/dist/media-player.d.ts +2 -0
- package/dist/media-player.js +2 -0
- package/dist/media-player.mjs +2 -0
- package/dist/notification/widget.js +1 -1
- package/dist/notification/widget.js.map +1 -1
- package/dist/types/layout-global/configs.d.ts +1 -1
- package/dist/types/layout-global/configs.d.ts.map +1 -1
- package/dist/types/media-player/analytic-media.d.ts +15 -0
- package/dist/types/media-player/analytic-media.d.ts.map +1 -0
- package/dist/types/media-player/core/btn.fullscreen.d.ts +11 -0
- package/dist/types/media-player/core/btn.fullscreen.d.ts.map +1 -0
- package/dist/types/media-player/core/btn.pip.d.ts +10 -0
- package/dist/types/media-player/core/btn.pip.d.ts.map +1 -0
- package/dist/types/media-player/core/btn.play.d.ts +11 -0
- package/dist/types/media-player/core/btn.play.d.ts.map +1 -0
- package/dist/types/media-player/core/btn.volume.d.ts +15 -0
- package/dist/types/media-player/core/btn.volume.d.ts.map +1 -0
- package/dist/types/media-player/core/progressBar.d.ts +13 -0
- package/dist/types/media-player/core/progressBar.d.ts.map +1 -0
- package/dist/types/media-player/core/time.d.ts +8 -0
- package/dist/types/media-player/core/time.d.ts.map +1 -0
- package/dist/types/media-player/core/useVideoPlayerCore.d.ts +29 -0
- package/dist/types/media-player/core/useVideoPlayerCore.d.ts.map +1 -0
- package/dist/types/media-player/core/videoplayer.d.ts +24 -0
- package/dist/types/media-player/core/videoplayer.d.ts.map +1 -0
- package/dist/types/media-player/helpers.d.ts +10 -0
- package/dist/types/media-player/helpers.d.ts.map +1 -0
- package/dist/types/media-player/index.d.ts +9 -0
- package/dist/types/media-player/index.d.ts.map +1 -0
- package/dist/types/media-player/mediaMetadata.d.ts +7 -0
- package/dist/types/media-player/mediaMetadata.d.ts.map +1 -0
- package/dist/types/media-player/muted.d.ts +12 -0
- package/dist/types/media-player/muted.d.ts.map +1 -0
- package/dist/types/media-player/player.audio.d.ts +7 -0
- package/dist/types/media-player/player.audio.d.ts.map +1 -0
- package/dist/types/media-player/player.video-stream.d.ts +15 -0
- package/dist/types/media-player/player.video-stream.d.ts.map +1 -0
- package/dist/types/media-player/preview.d.ts +29 -0
- package/dist/types/media-player/preview.d.ts.map +1 -0
- package/dist/types/media-player/types.d.ts +36 -0
- package/dist/types/media-player/types.d.ts.map +1 -0
- package/package.json +15 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player.video-stream.js","sources":["../../src/media-player/player.video-stream.tsx"],"sourcesContent":["import React, { useEffect } from 'react'\r\nimport { Box, Fade, Skeleton, styled } from '@mui/material'\r\nimport { useStreamUrl } from './helpers'\r\nimport MediaPlayerCore, { MediaPlayerSlot } from './core/videoplayer'\r\nimport { EMediaPlayerStatus } from './types'\r\nimport type { MediaPlayerBaseProps, MediaPlayerBaseSlots } from './types'\r\n\r\nexport interface MediaPlayerSlotsProps extends MediaPlayerBaseSlots {\r\n disabledBackground?: boolean\r\n keepTabActive?: boolean\r\n}\r\n\r\ninterface IProps extends MediaPlayerBaseProps {\r\n slots?: MediaPlayerSlotsProps\r\n slotMedia?: MediaPlayerSlot\r\n mediaMetadata?: MediaMetadata\r\n}\r\n\r\nconst mediaPlayerClasses = {\r\n disabledLoading: 'disabled-loading',\r\n disabledBackground: 'disabled-background'\r\n}\r\n\r\nconst MediaPlayerVideo = React.forwardRef<HTMLVideoElement, IProps>((props, ref) => {\r\n const { status, streamUrl } = useStreamUrl(props.resourceId, props.fetchDataStream)\r\n\r\n useEffect(() => {\r\n const keepActive = () => requestAnimationFrame(keepActive)\r\n const rafId = requestAnimationFrame(keepActive)\r\n return () => cancelAnimationFrame(rafId)\r\n }, [])\r\n\r\n const renderLoading = () => {\r\n if (props.slots?.loading) return props.slots.loading\r\n const duration = props.slots?.loadingProps?.animationDuration ?? '1s'\r\n return <Skeleton animation='wave' variant='rounded' sx={{ width: '100%', height: '100%', '&::after': { animationDuration: duration } }} />\r\n }\r\n\r\n const getClasses = (): string | undefined => {\r\n const classes: string[] = []\r\n if (props.slots?.loadingProps?.disabled) classes.push(mediaPlayerClasses.disabledLoading)\r\n if (props.slots?.disabledBackground) classes.push(mediaPlayerClasses.disabledBackground)\r\n if (status !== EMediaPlayerStatus.Loading && !props.loading && streamUrl) {\r\n classes.push('loaded')\r\n }\r\n return classes.length > 0 ? classes.join(' ') : undefined\r\n }\r\n\r\n return (\r\n <WrapPlayer className={getClasses()}>\r\n <WrapVideo sx={{ zIndex: 3 }}>\r\n {streamUrl && (\r\n <MediaPlayerCore\r\n ref={ref}\r\n className='player'\r\n src={streamUrl}\r\n mediaMetadata={props.mediaMetadata}\r\n {...props.slotMedia}\r\n controls={props.slotMedia?.controls}\r\n />\r\n )}\r\n </WrapVideo>\r\n <Fade in={(status === EMediaPlayerStatus.Loading || props.loading) && props.slots?.loadingProps?.disabled !== true}>\r\n <WrapVideo>{renderLoading()}</WrapVideo>\r\n </Fade>\r\n <Fade in={status === EMediaPlayerStatus.Error && !props.loading} unmountOnExit>\r\n <WrapVideo>\r\n <img src='images/video-error.webp' alt='video-error' style={{ width: '100%', height: '100%' }} />\r\n </WrapVideo>\r\n </Fade>\r\n </WrapPlayer>\r\n )\r\n})\r\n\r\nexport default React.memo(MediaPlayerVideo)\r\n\r\nconst WrapPlayer = styled(Box)({\r\n '--mp-core1-color-main': '#ed4229',\r\n '--mp-core1-color-text': '#fff',\r\n '--mp-core1-icon-size': '34px',\r\n position: 'relative',\r\n aspectRatio: '16/9',\r\n borderRadius: '6px',\r\n overflow: 'hidden',\r\n '&.loaded': {\r\n background: '#000',\r\n boxShadow: 'rgba(0, 0, 0, 0.24) 0px 3px 8px'\r\n },\r\n [`&.${mediaPlayerClasses.disabledBackground}`]: {\r\n background: 'unset'\r\n }\r\n})\r\n\r\nconst WrapVideo = styled(Box)({\r\n '--plyr-color-main': '#ed4229',\r\n position: 'absolute',\r\n top: 0,\r\n left: 0,\r\n width: '100%',\r\n height: '100%',\r\n zIndex: 2,\r\n '.MPCore1-root': {\r\n width: '100%',\r\n height: '100%'\r\n }\r\n})\r\n"],"names":["styled","Box","_defineProperty","position","aspectRatio","borderRadius","overflow","background","boxShadow","concat","top","left","width","height","zIndex"],"mappings":"mNA4EmBA,EAAOC,EAAPD,CAAWE,EAAA,CAC5B,wBAAyB,UACzB,wBAAyB,OACzB,uBAAwB,OACxBC,SAAU,WACVC,YAAa,OACbC,aAAc,MACdC,SAAU,SACV,WAAY,CACVC,WAAY,OACZC,UAAW,oCACZ,KAAAC,OAnEmB,uBAoE4B,CAC9CF,WAAY,WAIEP,EAAOC,EAAPD,CAAY,CAC5B,oBAAqB,UACrBG,SAAU,WACVO,IAAK,EACLC,KAAM,EACNC,MAAO,OACPC,OAAQ,OACRC,OAAQ,EACR,gBAAiB,CACfF,MAAO,OACPC,OAAQ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{objectWithoutProperties as e,objectSpread2 as t,inherits as o,createClass as i,classCallCheck as r,callSuper as l,defineProperty as n}from"../_virtual/_rollupPluginBabelHelpers.js";import{jsx as a,Fragment as s,jsxs as c}from"react/jsx-runtime";import{Component as d}from"react";import{createPortal as h}from"react-dom";import{styled as p,Box as u,IconButton as f,Fade as m,Typography as v}from"@mui/material";import b from"@mui/icons-material/Close";var g=["children"],x="mpp-root",k="mpp-content",C="mpp-backdrop",y={show:function(){console.log("MediaPlayerPreviewProvider is not found!")},close:function(){console.log("MediaPlayerPreviewProvider is not found!")}},w={Provider:function(){function e(t){var o;return r(this,e),o=l(this,e,[t]),n(o,"handleShow",function(e){o.setState(e)}),n(o,"handleClose",function(e){"backdropClick"===e&&!0===o.state.disabledBackdrop||o.setState({player:null})}),o.state={player:null},o}return o(e,d),i(e,[{key:"componentDidMount",value:function(){y.show=this.handleShow,y.close=this.handleClose}},{key:"render",value:function(){var e=this;if(!this.state.player)return a(s,{});var t=this.state.player;return h(c(P,{className:x,children:[a(S,{className:C,onClick:function(){return e.handleClose("backdropClick")}}),c(j,{children:[a(m,{in:Boolean(this.state.title),children:a(v,{variant:"subtitle1",sx:{flex:1,color:"#fff"},children:this.state.title})}),a(I,{onClick:function(){return e.handleClose("closeButton")},size:"small",children:a(b,{fontSize:"small"})})]}),a(z,{className:k,children:a(t,{close:this.handleClose})})]}),document.body)}}])}(),Api:y},P=p(function(o){var i=o.children,r=e(o,g);return a(u,t(t({},r),{},{children:a("div",{children:i})}))})({position:"fixed",top:0,left:0,bottom:0,right:0,zIndex:1500,"& > div":{position:"relative",width:"100%",height:"100%"}}),S=p(u)({position:"absolute",top:0,left:0,width:"100%",height:"100%",background:"rgba(0,0,0,0.325)",zIndex:1}),z=p(u)({position:"absolute",zIndex:2,top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxHeight:"calc(100vh - 24px)",overflowY:"auto"}),I=p(f)({color:"#fff","&:hover":{color:"#ff200c"}}),j=p(u)({background:"rgba(0,0,0,0.35)",position:"absolute",top:0,left:0,width:"100%",height:"48px",display:"flex",alignItems:"center",padding:"0 20px",zIndex:3});export{w as MediaPlayerPreview,w as default};
|
|
2
|
+
//# sourceMappingURL=preview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview.js","sources":["../../src/media-player/preview.tsx"],"sourcesContent":["import { Component } from 'react'\r\nimport { createPortal } from 'react-dom'\r\nimport { Box, BoxProps, Fade, IconButton, styled, Typography } from '@mui/material'\r\nimport CloseIcon from '@mui/icons-material/Close'\r\nimport { MediaPlayerClose, MediaPlayerShow } from './types'\r\n\r\nexport interface MediaPlayerProps {\r\n close?: MediaPlayerClose\r\n}\r\n\r\nconst mppClasses = {\r\n root: 'mpp-root',\r\n content: 'mpp-content',\r\n backdrop: 'mpp-backdrop'\r\n}\r\n\r\ninterface IState {\r\n player: React.ComponentType<MediaPlayerProps> | null\r\n title?: string\r\n disabledBackdrop?: boolean\r\n}\r\n\r\ninterface IActions {\r\n show: MediaPlayerShow<IState>\r\n close: MediaPlayerClose\r\n}\r\n\r\nconst MediaPlayerPreviewApi: IActions = {\r\n show: () => {\r\n console.log('MediaPlayerPreviewProvider is not found!')\r\n },\r\n close: () => {\r\n console.log('MediaPlayerPreviewProvider is not found!')\r\n }\r\n}\r\n\r\ninterface IProps {}\r\n\r\nclass MediaPlayerPreviewProvider extends Component<IProps, IState> {\r\n constructor(props: IProps) {\r\n super(props)\r\n this.state = { player: null }\r\n }\r\n\r\n handleShow: MediaPlayerShow<IState> = (value) => {\r\n this.setState(value)\r\n }\r\n\r\n handleClose: MediaPlayerClose = (reason) => {\r\n if (reason === 'backdropClick' && this.state.disabledBackdrop === true) return\r\n this.setState({ player: null })\r\n }\r\n\r\n componentDidMount() {\r\n MediaPlayerPreviewApi.show = this.handleShow\r\n MediaPlayerPreviewApi.close = this.handleClose\r\n }\r\n\r\n render() {\r\n if (!this.state.player) return <></>\r\n const PlayerComponent = this.state.player\r\n return createPortal(\r\n <Wrap className={mppClasses.root}>\r\n <Backdrop className={mppClasses.backdrop} onClick={() => this.handleClose('backdropClick')} />\r\n <TopBar>\r\n <Fade in={Boolean(this.state.title)}>\r\n <Typography variant='subtitle1' sx={{ flex: 1, color: '#fff' }}>\r\n {this.state.title}\r\n </Typography>\r\n </Fade>\r\n <BtnClose onClick={() => this.handleClose('closeButton')} size='small'>\r\n <CloseIcon fontSize='small' />\r\n </BtnClose>\r\n </TopBar>\r\n <WrapContent className={mppClasses.content}>\r\n <PlayerComponent close={this.handleClose} />\r\n </WrapContent>\r\n </Wrap>,\r\n document.body\r\n )\r\n }\r\n}\r\n\r\nexport const MediaPlayerPreview = {\r\n Provider: MediaPlayerPreviewProvider,\r\n Api: MediaPlayerPreviewApi\r\n}\r\n\r\nexport default MediaPlayerPreview\r\n\r\nconst Wrap = styled(({ children, ...props }: BoxProps) => (\r\n <Box {...props}>\r\n <div>{children}</div>\r\n </Box>\r\n))({\r\n position: 'fixed',\r\n top: 0,\r\n left: 0,\r\n bottom: 0,\r\n right: 0,\r\n zIndex: 1500,\r\n '& > div': {\r\n position: 'relative',\r\n width: '100%',\r\n height: '100%'\r\n }\r\n})\r\n\r\nconst Backdrop = styled(Box)({\r\n position: 'absolute',\r\n top: 0,\r\n left: 0,\r\n width: '100%',\r\n height: '100%',\r\n background: 'rgba(0,0,0,0.325)',\r\n zIndex: 1\r\n})\r\n\r\nconst WrapContent = styled(Box)({\r\n position: 'absolute',\r\n zIndex: 2,\r\n top: '50%',\r\n left: '50%',\r\n transform: 'translate(-50%, -50%)',\r\n maxHeight: 'calc(100vh - 24px)',\r\n overflowY: 'auto'\r\n})\r\n\r\nconst BtnClose = styled(IconButton)({\r\n color: '#fff',\r\n '&:hover': {\r\n color: '#ff200c'\r\n }\r\n})\r\n\r\nconst TopBar = styled(Box)({\r\n background: 'rgba(0,0,0,0.35)',\r\n position: 'absolute',\r\n top: 0,\r\n left: 0,\r\n width: '100%',\r\n height: '48px',\r\n display: 'flex',\r\n alignItems: 'center',\r\n padding: '0 20px',\r\n zIndex: 3\r\n})\r\n"],"names":["mppClasses","MediaPlayerPreviewApi","show","console","log","close","MediaPlayerPreview","Provider","MediaPlayerPreviewProvider","props","_this","_classCallCheck","_callSuper","_defineProperty","value","setState","reason","state","disabledBackdrop","player","_inherits","Component","_createClass","key","this","handleShow","handleClose","_this2","_jsx","PlayerComponent","createPortal","_jsxs","Wrap","className","children","Backdrop","onClick","TopBar","Fade","in","Boolean","title","Typography","variant","sx","flex","color","BtnClose","size","CloseIcon","fontSize","WrapContent","document","body","Api","styled","_ref","_objectWithoutProperties","_excluded","Box","_objectSpread","position","top","left","bottom","right","zIndex","width","height","background","transform","maxHeight","overflowY","IconButton","display","alignItems","padding"],"mappings":"6dAUMA,EACE,WADFA,EAEK,cAFLA,EAGM,eAcNC,EAAkC,CACtCC,KAAM,WACJC,QAAQC,IAAI,2CACb,EACDC,MAAO,WACLF,QAAQC,IAAI,2CACd,GAkDWE,EAAqB,CAChCC,oBA7CA,SAAAC,EAAYC,GAAa,IAAAC,EAEM,OAFNC,OAAAH,GACvBE,EAAAE,EAAAJ,KAAAA,GAAMC,IAAMI,EAAAH,EAIwB,aAAA,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EAAM,MAAA,CAAAM,SAAAA,MACF,EAHKqB,CAIV,CACDM,SAAU,QACVC,IAAK,EACLC,KAAM,EACNC,OAAQ,EACRC,MAAO,EACPC,OAAQ,KACR,UAAW,CACTL,SAAU,WACVM,MAAO,OACPC,OAAQ,UAINjC,EAAWoB,EAAOI,EAAPJ,CAAY,CAC3BM,SAAU,WACVC,IAAK,EACLC,KAAM,EACNI,MAAO,OACPC,OAAQ,OACRC,WAAY,oBACZH,OAAQ,IAGJf,EAAcI,EAAOI,EAAPJ,CAAY,CAC9BM,SAAU,WACVK,OAAQ,EACRJ,IAAK,MACLC,KAAM,MACNO,UAAW,wBACXC,UAAW,qBACXC,UAAW,SAGPzB,EAAWQ,EAAOkB,EAAPlB,CAAmB,CAClCT,MAAO,OACP,UAAW,CACTA,MAAO,aAILT,EAASkB,EAAOI,EAAPJ,CAAY,CACzBc,WAAY,mBACZR,SAAU,WACVC,IAAK,EACLC,KAAM,EACNI,MAAO,OACPC,OAAQ,OACRM,QAAS,OACTC,WAAY,SACZC,QAAS,SACTV,OAAQ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../src/media-player/types.ts"],"sourcesContent":["import { ReactNode } from 'react'\r\nimport { Breakpoint } from '@mui/material'\r\n\r\ntype IReason = 'backdropClick' | 'escape' | 'closeButton'\r\n\r\nexport type MediaPlayerClose = (reason?: IReason) => void\r\n\r\nexport type MediaPlayerShow<T> = (value: T) => void\r\n\r\nexport interface IMediaStream {\r\n code: number\r\n token: string\r\n StreamUrl: string\r\n}\r\n\r\nexport type FetchDataStream = (resourceId: string, signal?: AbortSignal) => Promise<IMediaStream[]>\r\n\r\nexport interface MediaPlayerBaseProps {\r\n resourceId: string\r\n fetchDataStream: FetchDataStream\r\n loading?: boolean\r\n}\r\n\r\nexport type AspectRatioParams = number | Partial<Record<Breakpoint, number>>\r\n\r\nexport interface MediaPlayerBaseSlots {\r\n /**\r\n * Aspect ratio (height / width), used to calculate height based on width.\r\n * @default 56.25 (%)\r\n */\r\n aspectRatio?: AspectRatioParams\r\n loading?: ReactNode\r\n loadingProps?: {\r\n disabled?: boolean\r\n animationDuration?: string\r\n }\r\n}\r\n\r\nexport enum EMediaPlayerStatus {\r\n Loading = 'Loading',\r\n Loaded = 'Loaded',\r\n Error = 'Error'\r\n}\r\n"],"names":["EMediaPlayerStatus"],"mappings":"IAsCYA,GAAZ,SAAYA,GACVA,EAAA,QAAA,UACAA,EAAA,OAAA,SACAA,EAAA,MAAA,OACD,CAJD,CAAYA,IAAAA,EAIX,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{slicedToArray as t,inherits as n,createClass as o,asyncToGenerator as r,objectSpread2 as e,classCallCheck as a,callSuper as i,defineProperty as l,regenerator as c}from"../_virtual/_rollupPluginBabelHelpers.js";import{jsx as s,jsxs as u,Fragment as d}from"react/jsx-runtime";import{Badge as f}from"@mui/material";import{useState as p,useEffect as h,Component as m}from"react";import{GlobalModal as v,mapGlobalModalContext as C}from"dinocollab-core/api-context";import g from"@mui/icons-material/NotificationsNone";import{MenuStyled as y}from"./styled.js";import{IconButtonDark as k}from"../components/buttons.js";import{useFetchData as b}from"./hook.js";import j from"./notify-list.js";import x from"./notify-detail.js";var E=function(){function t(n){var o;return a(this,t),o=i(this,t,[n]),l(o,"onClickHandler",function(t){var n;o.onClose(),null===(n=o.globalModalContext)||void 0===n||n.show({backdropActivated:!0,renderContent:function(){var n;return s(x,{data:[t],onRead:o.onReadHandler,onClose:null===(n=o.globalModalContext)||void 0===n?void 0:n.close})}})}),l(o,"onOpen",function(t){o.setState({anchorEl:t})}),l(o,"onClose",function(){o.setState({anchorEl:null})}),l(o,"onReadHandler",function(t){var n;null===(n=o.globalModalContext)||void 0===n||n.close();try{var r,e;null===(r=(e=o.props).onReaded)||void 0===r||r.call(e,t.Id)}catch(t){console.error("Error updating read state:",t)}}),o.state={anchorEl:null,hydrated:!1},o}return n(t,m),o(t,[{key:"notifications",get:function(){var t;return null!==(t=this.props.data)&&void 0!==t?t:[]}},{key:"newFeatureCount",get:function(){return this.notifications.filter(function(t){return!t.IsRead}).length}},{key:"componentDidMount",value:function(){this.setState({hydrated:!0})}},{key:"render",value:function(){var t=this;return u(d,{children:[s(k,{onClick:function(n){return t.onOpen(n.currentTarget)},children:s(f,{badgeContent:this.state.hydrated?this.newFeatureCount:0,color:"error",children:s(g,{})})}),s(y,{disableScrollLock:!0,anchorEl:this.state.anchorEl,open:Boolean(this.state.anchorEl),onClose:this.onClose,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},MenuListProps:{component:"div"},children:C(function(n){return t.globalModalContext=n,s(j,{data:t.props.data,onClick:t.onClickHandler})})})]})}}])}(),R=function(n){var o=b(n.featData),a=p([]),i=t(a,2),l=i[0],u=i[1];h(function(){o.data&&u(o.data)},[o.data]);var d=function(){var t=r(c().m(function t(o,r){var a;return c().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(a=n.readed)||void 0===a?void 0:a.call(n,o,r);case 1:u(function(t){return t.map(function(t){return t.Id===o?e(e({},t),{},{IsRead:!0}):t})});case 2:return t.a(2)}},t)}));return function(n,o){return t.apply(this,arguments)}}();return s(v,{children:s(E,{data:l,loading:o.loading,onReaded:d})})},
|
|
1
|
+
import{slicedToArray as t,inherits as n,createClass as o,asyncToGenerator as r,objectSpread2 as e,classCallCheck as a,callSuper as i,defineProperty as l,regenerator as c}from"../_virtual/_rollupPluginBabelHelpers.js";import{jsx as s,jsxs as u,Fragment as d}from"react/jsx-runtime";import{Badge as f}from"@mui/material";import{useState as p,useEffect as h,Component as m}from"react";import{GlobalModal as v,mapGlobalModalContext as C}from"dinocollab-core/api-context";import g from"@mui/icons-material/NotificationsNone";import{MenuStyled as y}from"./styled.js";import{IconButtonDark as k}from"../components/buttons.js";import{useFetchData as b}from"./hook.js";import j from"./notify-list.js";import x from"./notify-detail.js";var E=function(){function t(n){var o;return a(this,t),o=i(this,t,[n]),l(o,"onClickHandler",function(t){var n;o.onClose(),null===(n=o.globalModalContext)||void 0===n||n.show({backdropActivated:!0,renderContent:function(){var n;return s(x,{data:[t],onRead:o.onReadHandler,onClose:null===(n=o.globalModalContext)||void 0===n?void 0:n.close})}})}),l(o,"onOpen",function(t){o.setState({anchorEl:t})}),l(o,"onClose",function(){o.setState({anchorEl:null})}),l(o,"onReadHandler",function(t){var n;null===(n=o.globalModalContext)||void 0===n||n.close();try{var r,e;null===(r=(e=o.props).onReaded)||void 0===r||r.call(e,t.Id)}catch(t){console.error("Error updating read state:",t)}}),o.state={anchorEl:null,hydrated:!1},o}return n(t,m),o(t,[{key:"notifications",get:function(){var t;return null!==(t=this.props.data)&&void 0!==t?t:[]}},{key:"newFeatureCount",get:function(){return this.notifications.filter(function(t){return!t.IsRead}).length}},{key:"componentDidMount",value:function(){this.setState({hydrated:!0})}},{key:"render",value:function(){var t=this;return u(d,{children:[s(k,{onClick:function(n){return t.onOpen(n.currentTarget)},children:s(f,{badgeContent:this.state.hydrated?this.newFeatureCount:0,color:"error",children:s(g,{fontSize:"small"})})}),s(y,{disableScrollLock:!0,anchorEl:this.state.anchorEl,open:Boolean(this.state.anchorEl),onClose:this.onClose,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},MenuListProps:{component:"div"},children:C(function(n){return t.globalModalContext=n,s(j,{data:t.props.data,onClick:t.onClickHandler})})})]})}}])}(),R=function(n){var o=b(n.featData),a=p([]),i=t(a,2),l=i[0],u=i[1];h(function(){o.data&&u(o.data)},[o.data]);var d=function(){var t=r(c().m(function t(o,r){var a;return c().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,null===(a=n.readed)||void 0===a?void 0:a.call(n,o,r);case 1:u(function(t){return t.map(function(t){return t.Id===o?e(e({},t),{},{IsRead:!0}):t})});case 2:return t.a(2)}},t)}));return function(n,o){return t.apply(this,arguments)}}();return s(v,{children:s(E,{data:l,loading:o.loading,onReaded:d})})},S=function(t){var n=function(n){return s(R,e(e({},t),n))};return n.displayName="NotificationWidget",n};export{R as NotificationWidget,S as createNotificationWidget,R as default};
|
|
2
2
|
//# sourceMappingURL=widget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.js","sources":["../../src/notification/widget.tsx"],"sourcesContent":["import { Badge } from '@mui/material'\r\nimport { Component, FC, useEffect, useState } from 'react'\r\nimport { GlobalModal, IGlobalModalContext, mapGlobalModalContext } from 'dinocollab-core/api-context'\r\nimport NotificationsNoneIcon from '@mui/icons-material/NotificationsNone'\r\nimport { MenuStyled } from './styled'\r\nimport { IconButtonDark } from '../components/buttons'\r\nimport { FetcherFunction, useFetchData } from './hook'\r\nimport { INotification, ReadedFunction } from './types'\r\nimport NotifyList from './notify-list'\r\nimport NotifyDetail from './notify-detail'\r\n\r\ninterface INotificationProps {\r\n loading?: boolean\r\n data: INotification[]\r\n onReaded?: ReadedFunction\r\n}\r\n\r\ninterface INotificationState {\r\n anchorEl: HTMLElement | null\r\n hydrated: boolean\r\n}\r\nclass NotificationContent extends Component<INotificationProps, INotificationState> {\r\n globalModalContext?: IGlobalModalContext\r\n constructor(props: INotificationProps) {\r\n super(props)\r\n this.state = { anchorEl: null, hydrated: false }\r\n }\r\n\r\n get notifications() {\r\n return this.props.data ?? []\r\n }\r\n\r\n get newFeatureCount() {\r\n return this.notifications.filter((n) => !n.IsRead).length\r\n }\r\n\r\n componentDidMount() {\r\n // When mounted on the client, set hydrated = true\r\n this.setState({ hydrated: true })\r\n }\r\n\r\n render() {\r\n return (\r\n <>\r\n <IconButtonDark onClick={(e) => this.onOpen(e.currentTarget)}>\r\n <Badge badgeContent={this.state.hydrated ? this.newFeatureCount : 0} color='error'>\r\n <NotificationsNoneIcon />\r\n </Badge>\r\n </IconButtonDark>\r\n <MenuStyled\r\n disableScrollLock\r\n anchorEl={this.state.anchorEl}\r\n open={Boolean(this.state.anchorEl)}\r\n onClose={this.onClose}\r\n anchorOrigin={{ vertical: 'top', horizontal: 'right' }}\r\n transformOrigin={{ vertical: 'top', horizontal: 'right' }}\r\n MenuListProps={{ component: 'div' }}\r\n >\r\n {mapGlobalModalContext((context: IGlobalModalContext) => {\r\n this.globalModalContext = context\r\n return <NotifyList data={this.props.data} onClick={this.onClickHandler} />\r\n })}\r\n </MenuStyled>\r\n </>\r\n )\r\n }\r\n\r\n onClickHandler = (value: INotification) => {\r\n this.onClose()\r\n this.globalModalContext?.show({\r\n backdropActivated: true,\r\n renderContent: () => <NotifyDetail data={[value]} onRead={this.onReadHandler} onClose={this.globalModalContext?.close} />\r\n })\r\n }\r\n\r\n onOpen = (target: HTMLElement) => {\r\n this.setState({ anchorEl: target })\r\n }\r\n\r\n onClose = () => {\r\n this.setState({ anchorEl: null })\r\n }\r\n\r\n onReadHandler = (value: INotification) => {\r\n this.globalModalContext?.close()\r\n // NotifyLocalStorage.setSingle(value.Id)\r\n try {\r\n // Call the callback to update the read state in the parent component\r\n this.props.onReaded?.(value.Id)\r\n } catch (error) {\r\n console.error('Error updating read state:', error)\r\n }\r\n }\r\n}\r\n\r\nexport interface INotificationWidgetProps {\r\n featData: FetcherFunction<INotification[]>\r\n readed?: ReadedFunction\r\n}\r\n\r\nexport const NotificationWidget: FC<INotificationWidgetProps> = (props) => {\r\n const intitialData = useFetchData<INotification[]>(props.featData)\r\n const [data, setData] = useState<INotification[]>([])\r\n\r\n // When initialData changes, update the local state\r\n useEffect(() => {\r\n if (intitialData.data) setData(intitialData.data)\r\n }, [intitialData.data])\r\n\r\n // Function to update read notifications\r\n const handleRead: ReadedFunction = async (id: string, signal?: AbortSignal) => {\r\n await props.readed?.(id, signal)\r\n setData((prev) => prev.map((n) => (n.Id === id ? { ...n, IsRead: true } : n)))\r\n }\r\n\r\n return (\r\n <GlobalModal>\r\n <NotificationContent data={data} loading={intitialData.loading} onReaded={handleRead} />\r\n </GlobalModal>\r\n )\r\n}\r\nexport default NotificationWidget\r\n\r\nexport const createNotificationWidget = (params: INotificationWidgetProps) => {\r\n const _NotificationWidget: FC<Partial<INotificationWidgetProps>> = (props) => <NotificationWidget {...params} {...props} />\r\n _NotificationWidget.displayName = 'NotificationWidget'\r\n return _NotificationWidget\r\n}\r\n"],"names":["NotificationContent","props","_this","_classCallCheck","_callSuper","_defineProperty","value","_this$globalModalCont","onClose","globalModalContext","show","backdropActivated","renderContent","_this$globalModalCont2","_jsx","NotifyDetail","data","onRead","onReadHandler","close","target","setState","anchorEl","_this$globalModalCont3","_this$props$onReaded","_this$props","onReaded","call","Id","error","console","state","hydrated","_inherits","Component","_createClass","key","get","_this$props$data","this","notifications","filter","n","IsRead","length","_this2","_jsxs","_Fragment","children","IconButtonDark","onClick","e","onOpen","currentTarget","Badge","badgeContent","newFeatureCount","color","NotificationsNoneIcon","MenuStyled","disableScrollLock","open","Boolean","anchorOrigin","vertical","horizontal","transformOrigin","MenuListProps","component","mapGlobalModalContext","context","NotifyList","onClickHandler","NotificationWidget","intitialData","useFetchData","featData","_useState","useState","_useState2","_slicedToArray","setData","useEffect","handleRead","_ref","_asyncToGenerator","_regenerator","m","_callee","id","signal","_props$readed","w","_context","readed","prev","map","_objectSpread","a","_x","_x2","apply","arguments","GlobalModal","loading","createNotificationWidget","params","_NotificationWidget","displayName"],"mappings":"stBAS0C,IAYpCA,aAEJ,SAAAA,EAAYC,GAAyB,IAAAC,EAEa,OAFbC,OAAAH,GACnCE,EAAAE,EAAAJ,KAAAA,GAAMC,IAAMI,EAAAH,EA2CG,iBAAA,SAACI,GAAwB,IAAAC,EACxCL,EAAKM,UACkBD,QAAvBA,EAAAL,EAAKO,0BAALF,IAAuBA,GAAvBA,EAAyBG,KAAK,CAC5BC,mBAAmB,EACnBC,cAAe,WAAF,IAAAC,EAAA,OAAQC,EAACC,EAAY,CAACC,KAAM,CAACV,GAAQW,OAAQf,EAAKgB,cAAeV,QAAgCK,QAAzBA,EAAEX,EAAKO,0BAALI,IAAuBA,OAAvBA,EAAAA,EAAyBM,OAAS,MAE5Hd,EAAAH,EAEQ,SAAA,SAACkB,GACRlB,EAAKmB,SAAS,CAAEC,SAAUF,MAC3Bf,EAAAH,EAAA,UAES,WACRA,EAAKmB,SAAS,CAAEC,SAAU,SAC3BjB,EAAAH,EAEe,gBAAA,SAACI,GAAwB,IAAAiB,EAChB,QAAvBA,EAAArB,EAAKO,0BAAkB,IAAAc,GAAvBA,EAAyBJ,QAEzB,IAAI,IAAAK,EAAAC,EAEiB,QAAnBD,GAAAC,EAAAvB,EAAKD,OAAMyB,gBAAXF,IAAmBA,GAAnBA,EAAAG,KAAAF,EAAsBnB,EAAMsB,GAC7B,CAAC,MAAOC,GACPC,QAAQD,MAAM,6BAA8BA,EAC7C,IAlED3B,EAAK6B,MAAQ,CAAET,SAAU,KAAMU,UAAU,GAAO9B,CAClD,CAAC,OAAA+B,EAAAjC,EAL+BkC,GAK/BC,EAAAnC,EAAA,CAAA,CAAAoC,IAAA,gBAAAC,IAED,WAAiB,IAAAC,EACf,OAAsB,QAAtBA,EAAOC,KAAKtC,MAAMe,YAAI,IAAAsB,EAAAA,EAAI,EAC5B,GAAC,CAAAF,IAAA,kBAAAC,IAED,WACE,OAAOE,KAAKC,cAAcC,OAAO,SAACC,GAAC,OAAMA,EAAEC,MAAM,GAAEC,MACrD,GAAC,CAAAR,IAAA,oBAAA9B,MAED,WAEEiC,KAAKlB,SAAS,CAAEW,UAAU,GAC5B,GAAC,CAAAI,IAAA,SAAA9B,MAED,WAAM,IAAAuC,EAAAN,KACJ,OACEO,EACEC,EAAA,CAAAC,SAAA,CAAAlC,EAACmC,EAAc,CAACC,QAAS,SAACC,GAAC,OAAKN,EAAKO,OAAOD,EAAEE,cAAc,
|
|
1
|
+
{"version":3,"file":"widget.js","sources":["../../src/notification/widget.tsx"],"sourcesContent":["import { Badge } from '@mui/material'\r\nimport { Component, FC, useEffect, useState } from 'react'\r\nimport { GlobalModal, IGlobalModalContext, mapGlobalModalContext } from 'dinocollab-core/api-context'\r\nimport NotificationsNoneIcon from '@mui/icons-material/NotificationsNone'\r\nimport { MenuStyled } from './styled'\r\nimport { IconButtonDark } from '../components/buttons'\r\nimport { FetcherFunction, useFetchData } from './hook'\r\nimport { INotification, ReadedFunction } from './types'\r\nimport NotifyList from './notify-list'\r\nimport NotifyDetail from './notify-detail'\r\n\r\ninterface INotificationProps {\r\n loading?: boolean\r\n data: INotification[]\r\n onReaded?: ReadedFunction\r\n}\r\n\r\ninterface INotificationState {\r\n anchorEl: HTMLElement | null\r\n hydrated: boolean\r\n}\r\nclass NotificationContent extends Component<INotificationProps, INotificationState> {\r\n globalModalContext?: IGlobalModalContext\r\n constructor(props: INotificationProps) {\r\n super(props)\r\n this.state = { anchorEl: null, hydrated: false }\r\n }\r\n\r\n get notifications() {\r\n return this.props.data ?? []\r\n }\r\n\r\n get newFeatureCount() {\r\n return this.notifications.filter((n) => !n.IsRead).length\r\n }\r\n\r\n componentDidMount() {\r\n // When mounted on the client, set hydrated = true\r\n this.setState({ hydrated: true })\r\n }\r\n\r\n render() {\r\n return (\r\n <>\r\n <IconButtonDark onClick={(e) => this.onOpen(e.currentTarget)}>\r\n <Badge badgeContent={this.state.hydrated ? this.newFeatureCount : 0} color='error'>\r\n <NotificationsNoneIcon fontSize='small' />\r\n </Badge>\r\n </IconButtonDark>\r\n <MenuStyled\r\n disableScrollLock\r\n anchorEl={this.state.anchorEl}\r\n open={Boolean(this.state.anchorEl)}\r\n onClose={this.onClose}\r\n anchorOrigin={{ vertical: 'top', horizontal: 'right' }}\r\n transformOrigin={{ vertical: 'top', horizontal: 'right' }}\r\n MenuListProps={{ component: 'div' }}\r\n >\r\n {mapGlobalModalContext((context: IGlobalModalContext) => {\r\n this.globalModalContext = context\r\n return <NotifyList data={this.props.data} onClick={this.onClickHandler} />\r\n })}\r\n </MenuStyled>\r\n </>\r\n )\r\n }\r\n\r\n onClickHandler = (value: INotification) => {\r\n this.onClose()\r\n this.globalModalContext?.show({\r\n backdropActivated: true,\r\n renderContent: () => <NotifyDetail data={[value]} onRead={this.onReadHandler} onClose={this.globalModalContext?.close} />\r\n })\r\n }\r\n\r\n onOpen = (target: HTMLElement) => {\r\n this.setState({ anchorEl: target })\r\n }\r\n\r\n onClose = () => {\r\n this.setState({ anchorEl: null })\r\n }\r\n\r\n onReadHandler = (value: INotification) => {\r\n this.globalModalContext?.close()\r\n // NotifyLocalStorage.setSingle(value.Id)\r\n try {\r\n // Call the callback to update the read state in the parent component\r\n this.props.onReaded?.(value.Id)\r\n } catch (error) {\r\n console.error('Error updating read state:', error)\r\n }\r\n }\r\n}\r\n\r\nexport interface INotificationWidgetProps {\r\n featData: FetcherFunction<INotification[]>\r\n readed?: ReadedFunction\r\n}\r\n\r\nexport const NotificationWidget: FC<INotificationWidgetProps> = (props) => {\r\n const intitialData = useFetchData<INotification[]>(props.featData)\r\n const [data, setData] = useState<INotification[]>([])\r\n\r\n // When initialData changes, update the local state\r\n useEffect(() => {\r\n if (intitialData.data) setData(intitialData.data)\r\n }, [intitialData.data])\r\n\r\n // Function to update read notifications\r\n const handleRead: ReadedFunction = async (id: string, signal?: AbortSignal) => {\r\n await props.readed?.(id, signal)\r\n setData((prev) => prev.map((n) => (n.Id === id ? { ...n, IsRead: true } : n)))\r\n }\r\n\r\n return (\r\n <GlobalModal>\r\n <NotificationContent data={data} loading={intitialData.loading} onReaded={handleRead} />\r\n </GlobalModal>\r\n )\r\n}\r\nexport default NotificationWidget\r\n\r\nexport const createNotificationWidget = (params: INotificationWidgetProps) => {\r\n const _NotificationWidget: FC<Partial<INotificationWidgetProps>> = (props) => <NotificationWidget {...params} {...props} />\r\n _NotificationWidget.displayName = 'NotificationWidget'\r\n return _NotificationWidget\r\n}\r\n"],"names":["NotificationContent","props","_this","_classCallCheck","_callSuper","_defineProperty","value","_this$globalModalCont","onClose","globalModalContext","show","backdropActivated","renderContent","_this$globalModalCont2","_jsx","NotifyDetail","data","onRead","onReadHandler","close","target","setState","anchorEl","_this$globalModalCont3","_this$props$onReaded","_this$props","onReaded","call","Id","error","console","state","hydrated","_inherits","Component","_createClass","key","get","_this$props$data","this","notifications","filter","n","IsRead","length","_this2","_jsxs","_Fragment","children","IconButtonDark","onClick","e","onOpen","currentTarget","Badge","badgeContent","newFeatureCount","color","NotificationsNoneIcon","fontSize","MenuStyled","disableScrollLock","open","Boolean","anchorOrigin","vertical","horizontal","transformOrigin","MenuListProps","component","mapGlobalModalContext","context","NotifyList","onClickHandler","NotificationWidget","intitialData","useFetchData","featData","_useState","useState","_useState2","_slicedToArray","setData","useEffect","handleRead","_ref","_asyncToGenerator","_regenerator","m","_callee","id","signal","_props$readed","w","_context","readed","prev","map","_objectSpread","a","_x","_x2","apply","arguments","GlobalModal","loading","createNotificationWidget","params","_NotificationWidget","displayName"],"mappings":"stBAS0C,IAYpCA,aAEJ,SAAAA,EAAYC,GAAyB,IAAAC,EAEa,OAFbC,OAAAH,GACnCE,EAAAE,EAAAJ,KAAAA,GAAMC,IAAMI,EAAAH,EA2CG,iBAAA,SAACI,GAAwB,IAAAC,EACxCL,EAAKM,UACkBD,QAAvBA,EAAAL,EAAKO,0BAALF,IAAuBA,GAAvBA,EAAyBG,KAAK,CAC5BC,mBAAmB,EACnBC,cAAe,WAAF,IAAAC,EAAA,OAAQC,EAACC,EAAY,CAACC,KAAM,CAACV,GAAQW,OAAQf,EAAKgB,cAAeV,QAAgCK,QAAzBA,EAAEX,EAAKO,0BAALI,IAAuBA,OAAvBA,EAAAA,EAAyBM,OAAS,MAE5Hd,EAAAH,EAEQ,SAAA,SAACkB,GACRlB,EAAKmB,SAAS,CAAEC,SAAUF,MAC3Bf,EAAAH,EAAA,UAES,WACRA,EAAKmB,SAAS,CAAEC,SAAU,SAC3BjB,EAAAH,EAEe,gBAAA,SAACI,GAAwB,IAAAiB,EAChB,QAAvBA,EAAArB,EAAKO,0BAAkB,IAAAc,GAAvBA,EAAyBJ,QAEzB,IAAI,IAAAK,EAAAC,EAEiB,QAAnBD,GAAAC,EAAAvB,EAAKD,OAAMyB,gBAAXF,IAAmBA,GAAnB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rl: IAppSiteBaseUrl) => IAppNav[];
|
|
12
12
|
export declare const getMenuNavConfigs: (baseUrl: IAppSiteBaseUrl) => IAppNav[];
|
|
13
13
|
export declare const footerDescription = "We provide licensing services for music, images, and digital media,\ncopyright management, revenue optimization, and legal representation\nfor creators across multiple platforms.";
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const getCopyrightText: () => string;
|
|
15
15
|
export declare const getFooterNavTabConfigs: (baseUrl: IAppSiteBaseUrl) => IAppNav[];
|
|
16
16
|
export declare const getFooterNavConfigs: (baseUrl: IAppSiteBaseUrl) => IAppNav[][];
|
|
17
17
|
//# sourceMappingURL=configs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../../src/layout-global/configs.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAmB,MAAM,SAAS,CAAA;AAC3F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAE/C,eAAO,MAAM,UAAU,qBAAqB,CAAA;AAC5C,eAAO,MAAM,aAAa,SAAU,eAAe,WAA6B,CAAA;AAEhF,eAAO,MAAM,WAAW,0BAA0B,CAAA;AAClD,eAAO,MAAM,cAAc,SAAU,eAAe,WAA8B,CAAA;AAElF,eAAO,MAAM,gBAAgB,EAAE,UAAU,EAMxC,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAahD,CAAA;AAMD,eAAO,MAAM,WAAW,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,MAAM,CAAC,OAAO,EAAE,QAAQ,CAa9E,CAAA;AAEF,eAAO,MAAM,oBAAoB,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,QAAQ,EA6BxE,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,OAAO,EAWtE,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C,OAAO,EAAE,eAAe,KAAK,OAAO,EAAE,EAkBxE,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BoxProps } from '@mui/material';
|
|
2
|
+
import type { FC, PropsWithChildren } from 'react';
|
|
3
|
+
export declare const AnalyticMediaContext: import("react").Context<{
|
|
4
|
+
setStatus: (status: boolean) => void;
|
|
5
|
+
} | undefined>;
|
|
6
|
+
export declare const useAnalyticMedia: () => {
|
|
7
|
+
setStatus: (status: boolean) => void;
|
|
8
|
+
} | undefined;
|
|
9
|
+
export interface IAnalyticAudioProps extends PropsWithChildren, BoxProps {
|
|
10
|
+
meidaId?: string;
|
|
11
|
+
videoId?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const AnalyticMedia: FC<IAnalyticAudioProps>;
|
|
14
|
+
export default AnalyticMedia;
|
|
15
|
+
//# sourceMappingURL=analytic-media.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytic-media.d.ts","sourceRoot":"","sources":["../../../src/media-player/analytic-media.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,QAAQ,EAAE,MAAM,eAAe,CAAA;AAE7C,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAElD,eAAO,MAAM,oBAAoB;wBAAuC,OAAO,KAAK,IAAI;cAA0B,CAAA;AAElH,eAAO,MAAM,gBAAgB;wBAF2C,OAAO,KAAK,IAAI;aASvF,CAAA;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB,EAAE,QAAQ;IACtE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,aAAa,EAAE,EAAE,CAAC,mBAAmB,CAejD,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IconButtonProps } from '@mui/material';
|
|
3
|
+
interface FullscreenButtonProps {
|
|
4
|
+
hidden?: boolean;
|
|
5
|
+
isFullscreen: boolean;
|
|
6
|
+
onClick: () => void;
|
|
7
|
+
iconProps?: IconButtonProps;
|
|
8
|
+
}
|
|
9
|
+
declare const FullscreenButton: React.FC<FullscreenButtonProps>;
|
|
10
|
+
export default FullscreenButton;
|
|
11
|
+
//# sourceMappingURL=btn.fullscreen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"btn.fullscreen.d.ts","sourceRoot":"","sources":["../../../../src/media-player/core/btn.fullscreen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAc,eAAe,EAAU,MAAM,eAAe,CAAA;AAInE,UAAU,qBAAqB;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,OAAO,CAAA;IACrB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,SAAS,CAAC,EAAE,eAAe,CAAA;CAC5B;AAED,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAOrD,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IconButtonProps } from '@mui/material';
|
|
3
|
+
interface BtnPIPProps {
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
iconProps?: IconButtonProps;
|
|
6
|
+
hidden?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const BtnPIP: React.FC<BtnPIPProps>;
|
|
9
|
+
export default BtnPIP;
|
|
10
|
+
//# sourceMappingURL=btn.pip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"btn.pip.d.ts","sourceRoot":"","sources":["../../../../src/media-player/core/btn.pip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAc,eAAe,EAAU,MAAM,eAAe,CAAA;AAGnE,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAOjC,CAAA;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IconButtonProps } from '@mui/material';
|
|
3
|
+
interface PlayButtonProps {
|
|
4
|
+
isPlaying: boolean;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
iconProps?: IconButtonProps;
|
|
7
|
+
hidden?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const PlayButton: React.FC<PlayButtonProps>;
|
|
10
|
+
export default PlayButton;
|
|
11
|
+
//# sourceMappingURL=btn.play.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"btn.play.d.ts","sourceRoot":"","sources":["../../../../src/media-player/core/btn.play.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAc,eAAe,EAAU,MAAM,eAAe,CAAA;AAInE,UAAU,eAAe;IACvB,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAOzC,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type MediaControlProps = {
|
|
3
|
+
hidden?: boolean;
|
|
4
|
+
sliderPosition?: 'above' | 'right' | 'below';
|
|
5
|
+
orientation?: 'horizontal' | 'vertical';
|
|
6
|
+
sliderHeight?: number;
|
|
7
|
+
sliderWidth?: number;
|
|
8
|
+
volume?: number;
|
|
9
|
+
muted?: boolean;
|
|
10
|
+
setVolume: (value: number) => void;
|
|
11
|
+
toggleMute: () => void;
|
|
12
|
+
};
|
|
13
|
+
declare const BtnVolume: React.FC<MediaControlProps>;
|
|
14
|
+
export default BtnVolume;
|
|
15
|
+
//# sourceMappingURL=btn.volume.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"btn.volume.d.ts","sourceRoot":"","sources":["../../../../src/media-player/core/btn.volume.tsx"],"names":[],"mappings":";AAKA,KAAK,iBAAiB,GAAG;IACvB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,OAAO,CAAA;IAC5C,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IACvC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,UAAU,EAAE,MAAM,IAAI,CAAA;CACvB,CAAA;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA8F1C,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
bufferedSegments: {
|
|
4
|
+
left: number;
|
|
5
|
+
width: number;
|
|
6
|
+
}[];
|
|
7
|
+
progress: number;
|
|
8
|
+
isLoading: boolean;
|
|
9
|
+
onChange?: (value: number) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const ProgressBar: React.FC<Props>;
|
|
12
|
+
export default ProgressBar;
|
|
13
|
+
//# sourceMappingURL=progressBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progressBar.d.ts","sourceRoot":"","sources":["../../../../src/media-player/core/progressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,UAAU,KAAK;IACb,gBAAgB,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACnD,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACnC;AAED,QAAA,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAwFhC,CAAA;AAED,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../../src/media-player/core/time.tsx"],"names":[],"mappings":";AAEA,UAAU,WAAW;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAWD,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAIpC,CAAA;AAED,eAAe,SAAS,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface VideoPlayerCoreState {
|
|
3
|
+
isLoading: boolean;
|
|
4
|
+
isPlaying: boolean;
|
|
5
|
+
progress: number;
|
|
6
|
+
currentTime: number;
|
|
7
|
+
duration: number;
|
|
8
|
+
bufferedSegments: {
|
|
9
|
+
left: number;
|
|
10
|
+
width: number;
|
|
11
|
+
}[];
|
|
12
|
+
volume: number;
|
|
13
|
+
muted: boolean;
|
|
14
|
+
isFullscreen: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface VideoPlayerCoreControls {
|
|
17
|
+
togglePlay: () => void;
|
|
18
|
+
handleSeek: (value: number) => void;
|
|
19
|
+
setVolume: (value: number) => void;
|
|
20
|
+
toggleMute: () => void;
|
|
21
|
+
seek: (time: number) => void;
|
|
22
|
+
togglePIP: () => void;
|
|
23
|
+
toggleFullscreen: () => void;
|
|
24
|
+
}
|
|
25
|
+
export declare function useVideoPlayerCore(videoRef: React.RefObject<HTMLVideoElement>, videoContainerRef?: React.RefObject<HTMLDivElement>): {
|
|
26
|
+
state: VideoPlayerCoreState;
|
|
27
|
+
controls: VideoPlayerCoreControls;
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=useVideoPlayerCore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useVideoPlayerCore.d.ts","sourceRoot":"","sources":["../../../../src/media-player/core/useVideoPlayerCore.ts"],"names":[],"mappings":";AAEA,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,gBAAgB,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACnD,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,OAAO,CAAA;IACd,YAAY,EAAE,OAAO,CAAA;CACtB;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5B,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB,gBAAgB,EAAE,MAAM,IAAI,CAAA;CAC7B;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAC3C,iBAAiB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,GAClD;IAAE,KAAK,EAAE,oBAAoB,CAAC;IAAC,QAAQ,EAAE,uBAAuB,CAAA;CAAE,CAmKpE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
export interface IControlsConfig {
|
|
4
|
+
autoPlay?: boolean;
|
|
5
|
+
muted?: boolean;
|
|
6
|
+
volume?: boolean;
|
|
7
|
+
pip?: boolean;
|
|
8
|
+
fullscreen?: boolean;
|
|
9
|
+
preload?: 'auto' | 'metadata' | 'none';
|
|
10
|
+
}
|
|
11
|
+
export declare const defaultControlsConfig: IControlsConfig;
|
|
12
|
+
export interface MediaPlayerSlot {
|
|
13
|
+
controls?: IControlsConfig;
|
|
14
|
+
anotherControls?: React.ReactNode;
|
|
15
|
+
mediaMetadata?: MediaMetadata;
|
|
16
|
+
}
|
|
17
|
+
interface IProps extends MediaPlayerSlot, PropsWithChildren {
|
|
18
|
+
src?: string;
|
|
19
|
+
sx?: SxProps<Theme>;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
declare const MediaPlayerCore: import("react").ForwardRefExoticComponent<IProps & import("react").RefAttributes<HTMLVideoElement>>;
|
|
23
|
+
export default MediaPlayerCore;
|
|
24
|
+
//# sourceMappingURL=videoplayer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"videoplayer.d.ts","sourceRoot":"","sources":["../../../../src/media-player/core/videoplayer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,EAAsB,OAAO,EAAE,KAAK,EAA2B,MAAM,eAAe,CAAA;AAsB3F,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,MAAM,CAAA;CACvC;AAGD,eAAO,MAAM,qBAAqB,EAAE,eAOnC,CAAA;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACjC,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;AACD,UAAU,MAAO,SAAQ,eAAe,EAAE,iBAAiB;IACzD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,QAAA,MAAM,eAAe,qGAyFnB,CAAA;AAEF,eAAe,eAAe,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Breakpoint, SxProps, Theme } from '@mui/material';
|
|
2
|
+
import { EMediaPlayerStatus } from './types';
|
|
3
|
+
import type { AspectRatioParams, MediaPlayerBaseProps } from './types';
|
|
4
|
+
export declare const useStreamUrl: (resourceId: string | null, fetchDataStream: MediaPlayerBaseProps['fetchDataStream']) => {
|
|
5
|
+
status: EMediaPlayerStatus;
|
|
6
|
+
streamUrl: string | null;
|
|
7
|
+
};
|
|
8
|
+
export declare const getAspectRatio: (value?: AspectRatioParams, defaultAspectRatio?: string) => string | Partial<Record<Breakpoint, string>> | undefined;
|
|
9
|
+
export declare const getAspectRatioStyled: (value?: AspectRatioParams) => SxProps<Theme>;
|
|
10
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/media-player/helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEtE,eAAO,MAAM,YAAY,eAAgB,MAAM,GAAG,IAAI,mBAAmB,oBAAoB,CAAC,iBAAiB,CAAC;;;CA0B/G,CAAA;AAED,eAAO,MAAM,cAAc,WAAY,iBAAiB,0FAWvD,CAAA;AAED,eAAO,MAAM,oBAAoB,WAAY,iBAAiB,KAAG,QAAQ,KAAK,CAE7E,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './helpers';
|
|
3
|
+
export * from './player.audio';
|
|
4
|
+
export * from './player.video-stream';
|
|
5
|
+
export * from './preview';
|
|
6
|
+
export * from './mediaMetadata';
|
|
7
|
+
export * from './analytic-media';
|
|
8
|
+
export * from './muted';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/media-player/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AAEvB,cAAc,WAAW,CAAA;AAEzB,cAAc,gBAAgB,CAAA;AAE9B,cAAc,uBAAuB,CAAA;AAErC,cAAc,WAAW,CAAA;AAEzB,cAAc,iBAAiB,CAAA;AAE/B,cAAc,kBAAkB,CAAA;AAEhC,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediaMetadata.d.ts","sourceRoot":"","sources":["../../../src/media-player/mediaMetadata.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,kBAExB;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,KACvE,aAsCF,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import type { MediaPlayerBaseProps, MediaPlayerBaseSlots } from './types';
|
|
3
|
+
import { MediaPlayerSlot } from './core/videoplayer';
|
|
4
|
+
export interface SlotMediaPlayerMutedProps extends MediaPlayerBaseSlots {
|
|
5
|
+
coreProps?: MediaPlayerSlot;
|
|
6
|
+
}
|
|
7
|
+
export interface IMediaPlayerMutedProps extends MediaPlayerBaseProps {
|
|
8
|
+
slots?: SlotMediaPlayerMutedProps;
|
|
9
|
+
}
|
|
10
|
+
export declare const MediaPlayerMuted: FC<IMediaPlayerMutedProps>;
|
|
11
|
+
export default MediaPlayerMuted;
|
|
12
|
+
//# sourceMappingURL=muted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"muted.d.ts","sourceRoot":"","sources":["../../../src/media-player/muted.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAIzE,OAAwB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAErE,MAAM,WAAW,yBAA0B,SAAQ,oBAAoB;IACrE,SAAS,CAAC,EAAE,eAAe,CAAA;CAC5B;AACD,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB;IAClE,KAAK,CAAC,EAAE,yBAAyB,CAAA;CAClC;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,sBAAsB,CAiCvD,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player.audio.d.ts","sourceRoot":"","sources":["../../../src/media-player/player.audio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAE/B,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,sBAAsB,CAEvD,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MediaPlayerSlot } from './core/videoplayer';
|
|
3
|
+
import type { MediaPlayerBaseProps, MediaPlayerBaseSlots } from './types';
|
|
4
|
+
export interface MediaPlayerSlotsProps extends MediaPlayerBaseSlots {
|
|
5
|
+
disabledBackground?: boolean;
|
|
6
|
+
keepTabActive?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface IProps extends MediaPlayerBaseProps {
|
|
9
|
+
slots?: MediaPlayerSlotsProps;
|
|
10
|
+
slotMedia?: MediaPlayerSlot;
|
|
11
|
+
mediaMetadata?: MediaMetadata;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<IProps & React.RefAttributes<HTMLVideoElement>>>;
|
|
14
|
+
export default _default;
|
|
15
|
+
//# sourceMappingURL=player.video-stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player.video-stream.d.ts","sourceRoot":"","sources":["../../../src/media-player/player.video-stream.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AAGxC,OAAwB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAErE,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAEzE,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB;IACjE,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,UAAU,MAAO,SAAQ,oBAAoB;IAC3C,KAAK,CAAC,EAAE,qBAAqB,CAAA;IAC7B,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;;AA0DD,wBAA2C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Component } from 'react';
|
|
2
|
+
import { MediaPlayerClose, MediaPlayerShow } from './types';
|
|
3
|
+
export interface MediaPlayerProps {
|
|
4
|
+
close?: MediaPlayerClose;
|
|
5
|
+
}
|
|
6
|
+
interface IState {
|
|
7
|
+
player: React.ComponentType<MediaPlayerProps> | null;
|
|
8
|
+
title?: string;
|
|
9
|
+
disabledBackdrop?: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface IActions {
|
|
12
|
+
show: MediaPlayerShow<IState>;
|
|
13
|
+
close: MediaPlayerClose;
|
|
14
|
+
}
|
|
15
|
+
interface IProps {
|
|
16
|
+
}
|
|
17
|
+
declare class MediaPlayerPreviewProvider extends Component<IProps, IState> {
|
|
18
|
+
constructor(props: IProps);
|
|
19
|
+
handleShow: MediaPlayerShow<IState>;
|
|
20
|
+
handleClose: MediaPlayerClose;
|
|
21
|
+
componentDidMount(): void;
|
|
22
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
}
|
|
24
|
+
export declare const MediaPlayerPreview: {
|
|
25
|
+
Provider: typeof MediaPlayerPreviewProvider;
|
|
26
|
+
Api: IActions;
|
|
27
|
+
};
|
|
28
|
+
export default MediaPlayerPreview;
|
|
29
|
+
//# sourceMappingURL=preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../src/media-player/preview.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,gBAAgB,CAAA;CACzB;AAQD,UAAU,MAAM;IACd,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAA;IACpD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,UAAU,QAAQ;IAChB,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,CAAA;IAC7B,KAAK,EAAE,gBAAgB,CAAA;CACxB;AAWD,UAAU,MAAM;CAAG;AAEnB,cAAM,0BAA2B,SAAQ,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;gBACpD,KAAK,EAAE,MAAM;IAKzB,UAAU,EAAE,eAAe,CAAC,MAAM,CAAC,CAElC;IAED,WAAW,EAAE,gBAAgB,CAG5B;IAED,iBAAiB;IAKjB,MAAM;CAuBP;AAED,eAAO,MAAM,kBAAkB;;;CAG9B,CAAA;AAED,eAAe,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { Breakpoint } from '@mui/material';
|
|
3
|
+
type IReason = 'backdropClick' | 'escape' | 'closeButton';
|
|
4
|
+
export type MediaPlayerClose = (reason?: IReason) => void;
|
|
5
|
+
export type MediaPlayerShow<T> = (value: T) => void;
|
|
6
|
+
export interface IMediaStream {
|
|
7
|
+
code: number;
|
|
8
|
+
token: string;
|
|
9
|
+
StreamUrl: string;
|
|
10
|
+
}
|
|
11
|
+
export type FetchDataStream = (resourceId: string, signal?: AbortSignal) => Promise<IMediaStream[]>;
|
|
12
|
+
export interface MediaPlayerBaseProps {
|
|
13
|
+
resourceId: string;
|
|
14
|
+
fetchDataStream: FetchDataStream;
|
|
15
|
+
loading?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export type AspectRatioParams = number | Partial<Record<Breakpoint, number>>;
|
|
18
|
+
export interface MediaPlayerBaseSlots {
|
|
19
|
+
/**
|
|
20
|
+
* Aspect ratio (height / width), used to calculate height based on width.
|
|
21
|
+
* @default 56.25 (%)
|
|
22
|
+
*/
|
|
23
|
+
aspectRatio?: AspectRatioParams;
|
|
24
|
+
loading?: ReactNode;
|
|
25
|
+
loadingProps?: {
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
animationDuration?: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare enum EMediaPlayerStatus {
|
|
31
|
+
Loading = "Loading",
|
|
32
|
+
Loaded = "Loaded",
|
|
33
|
+
Error = "Error"
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/media-player/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,KAAK,OAAO,GAAG,eAAe,GAAG,QAAQ,GAAG,aAAa,CAAA;AAEzD,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;AAEzD,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAA;AAEnD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;AAEnG,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,eAAe,CAAA;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAA;AAE5E,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,WAAW,CAAC,EAAE,iBAAiB,CAAA;IAC/B,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,YAAY,CAAC,EAAE;QACb,QAAQ,CAAC,EAAE,OAAO,CAAA;QAClB,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAC3B,CAAA;CACF;AAED,oBAAY,kBAAkB;IAC5B,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,KAAK,UAAU;CAChB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dinocollab-shared",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.19",
|
|
4
4
|
"description": "DinoCollab shared utilities and components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -55,6 +55,12 @@
|
|
|
55
55
|
],
|
|
56
56
|
"./notification": [
|
|
57
57
|
"./dist/types/notification/index.d.ts"
|
|
58
|
+
],
|
|
59
|
+
"media-player": [
|
|
60
|
+
"./dist/media-player.d.ts"
|
|
61
|
+
],
|
|
62
|
+
"./media-player": [
|
|
63
|
+
"./dist/types/media-player/index.d.ts"
|
|
58
64
|
]
|
|
59
65
|
}
|
|
60
66
|
},
|
|
@@ -112,6 +118,14 @@
|
|
|
112
118
|
"./notification.js": "./dist/notification.js",
|
|
113
119
|
"./notification.mjs": "./dist/notification.mjs",
|
|
114
120
|
"./notification.d.ts": "./dist/notification.d.ts",
|
|
121
|
+
"./media-player": {
|
|
122
|
+
"import": "./dist/media-player/index.js",
|
|
123
|
+
"require": "./dist/media-player/index.js",
|
|
124
|
+
"types": "./dist/types/media-player/index.d.ts"
|
|
125
|
+
},
|
|
126
|
+
"./media-player.js": "./dist/media-player.js",
|
|
127
|
+
"./media-player.mjs": "./dist/media-player.mjs",
|
|
128
|
+
"./media-player.d.ts": "./dist/media-player.d.ts",
|
|
115
129
|
"./package.json": "./package.json"
|
|
116
130
|
},
|
|
117
131
|
"peerDependencies": {
|