@vidispine/vdt-materialui 25.4.5 → 26.1.0-pre.1

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),j=require("react"),x=require("lodash.get"),l=require("@material-ui/core"),t=require("@material-ui/icons"),z=require("@vidispine/vdt-js"),w=require("../../ItemSourceTable/components/ShapeTypeTableBody.js"),B=require("./ItemShapeMenu.js");function R({shapeType:i,TableRowProps:b,canExpand:o=!0,onRemove:r,showDownload:C,itemId:a,storageListType:f,displayMethodTypes:m,storageMetadataKeys:g}){const{id:S}=i,n=j.useMemo(()=>z.parseShapeType(i),[i]),[c,T]=j.useState(!1),p=()=>T(v=>!v),{containerComponent:{file:s=[]}={}}=i;let d,u;s.length>0&&(d=x(s,"[0].uri[0]","undefined"),u=x(s,"[0].path","undefined"));const q=i.tag.join(", "),h=n.fileSize==="-1 B"?"Not Available":n.fileSize;return e.jsxs(e.Fragment,{children:[e.jsxs(l.TableRow,{...b,children:[e.jsx(l.TableCell,{children:o&&e.jsx(l.IconButton,{size:"small",onClick:p,children:c?e.jsx(t.ExpandMore,{}):e.jsx(t.ChevronRight,{})})}),e.jsx(l.TableCell,{children:q}),e.jsxs(l.Hidden,{smDown:!0,children:[e.jsx(l.TableCell,{children:n.containerFormat}),e.jsx(l.TableCell,{children:n.videoCodec}),e.jsx(l.TableCell,{children:n.audioCodec}),e.jsx(l.TableCell,{children:n.frameRate})]}),e.jsx(l.TableCell,{children:n.dimension}),e.jsx(l.TableCell,{children:h}),e.jsxs(l.TableCell,{children:[C&&e.jsx(l.IconButton,{size:"small",href:d,download:u,style:{visibility:n.fileSizeBytes?"visible":"hidden"},children:e.jsx(t.CloudDownload,{})}),r&&e.jsx(B.default,{shapeType:i,shapeId:S,itemId:a,onRemove:r})]})]}),o&&e.jsx(l.TableRow,{children:e.jsx(l.TableCell,{colSpan:9,children:e.jsx(l.Collapse,{in:c,timeout:"auto",unmountOnExit:!0,children:e.jsx(l.Box,{margin:1,children:e.jsx(l.Table,{size:"small",padding:"none",children:e.jsx(w.default,{shapeActualSize:h,shapeType:i,itemId:a,storageListType:f,displayMethodTypes:m,storageMetadataKeys:g})})})})})})]})}exports.default=R;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),x=require("react"),b=require("lodash.get"),l=require("@material-ui/core"),o=require("@material-ui/icons"),z=require("@vidispine/vdt-js"),w=require("../../ItemSourceTable/components/ShapeTypeTableBody.js"),B=require("./ItemShapeMenu.js");function R({shapeType:n,TableRowProps:f,canExpand:r=!0,onRemove:a,showDownload:C,itemId:c,storageListType:m,displayMethodTypes:g,storageMetadataKeys:S}){const{id:T}=n,i=x.useMemo(()=>z.parseShapeType(n),[n]),[d,p]=x.useState(!1),q=()=>p(s=>!s),{containerComponent:{file:t=[]}={}}=n;if(t.length===0){const{binaryComponent:s=[]}=n;s.length>0&&t.push(...s[0].file)}let u,h;t.length>0&&(u=b(t,"[0].uri[0]","undefined"),h=b(t,"[0].path","undefined"));const v=n.tag.join(", "),j=i.fileSize==="-1 B"?"Not Available":i.fileSize;return e.jsxs(e.Fragment,{children:[e.jsxs(l.TableRow,{...f,children:[e.jsx(l.TableCell,{children:r&&e.jsx(l.IconButton,{size:"small",onClick:q,children:d?e.jsx(o.ExpandMore,{}):e.jsx(o.ChevronRight,{})})}),e.jsx(l.TableCell,{children:v}),e.jsxs(l.Hidden,{smDown:!0,children:[e.jsx(l.TableCell,{children:i.containerFormat}),e.jsx(l.TableCell,{children:i.videoCodec}),e.jsx(l.TableCell,{children:i.audioCodec}),e.jsx(l.TableCell,{children:i.frameRate})]}),e.jsx(l.TableCell,{children:i.dimension}),e.jsx(l.TableCell,{children:j}),e.jsxs(l.TableCell,{children:[C&&e.jsx(l.IconButton,{size:"small",href:u,download:h,style:{visibility:i.fileSizeBytes?"visible":"hidden"},children:e.jsx(o.CloudDownload,{})}),a&&e.jsx(B.default,{shapeType:n,shapeId:T,itemId:c,onRemove:a})]})]}),r&&e.jsx(l.TableRow,{children:e.jsx(l.TableCell,{colSpan:9,children:e.jsx(l.Collapse,{in:d,timeout:"auto",unmountOnExit:!0,children:e.jsx(l.Box,{margin:1,children:e.jsx(l.Table,{size:"small",padding:"none",children:e.jsx(w.default,{shapeActualSize:j,shapeType:n,itemId:c,storageListType:m,displayMethodTypes:g,storageMetadataKeys:S})})})})})})]})}exports.default=R;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),g=require("react"),L=require("clsx"),u=require("@material-ui/core"),ne=require("@material-ui/lab"),m=require("@vidispine/vdt-js"),$=require("../ItemAudioPlayer.js"),F=require("../ItemImagePlayer.js"),q=require("../ItemVideoPlayer.js"),ae=[...q.ALLOWED_MIME_TYPES,...F.ALLOWED_MIME_TYPES,...$.ALLOWED_MIME_TYPES],_="IMAGE",x="AUDIO",A="VIDEO",oe="DOCUMENT",se="BINARY",ie=e=>e.height?e.fieldOrder?`${e.tag} (${e.height}${e.fieldOrder[0]})`:`${e.tag} (${e.height}x${e.width})`:e.audioFormat?e.containerFormat!==e.audioFormat?`${e.tag} (${e.audioFormat} - ${e.containerFormat})`:`${e.tag} (${e.audioFormat})`:e.tag,ce=e=>{const s=i=>i.split(":").reduce((a,c)=>60*a+Number(c));if(e.timeCode)return Math.floor(e.timeCode.toSeconds());if(e.duration)return s(e.duration)},le=u.withStyles({},{name:"VdtSourceSelection"})(({value:e,onChange:s,options:i,previewSourceText:a="Preview Source"})=>{const c=i.find(l=>l.label===e.label);return t.jsxs(u.FormControl,{variant:"standard",fullWidth:!0,children:[t.jsx(u.InputLabel,{children:a}),t.jsx(u.Select,{value:c,onChange:s,children:i.map(l=>t.jsx(u.MenuItem,{value:l,children:l.label},l.src))})]})}),ue=u.withStyles({},{name:"VdtLoadingPlayer"})(e=>t.jsx(ne.Skeleton,{variant:"rect",width:"100%",height:520,...e})),de=u.withStyles(e=>({root:{backgroundColor:e.palette.divider,width:"100%",height:520,display:"flex",justifyContent:"center",alignItems:"center"},label:{...e.typography.button}}),{name:"VdtNoPreviewPlayer"})(({className:e,classes:s,label:i="No Previews"})=>t.jsx("div",{className:L(s.root,e),children:t.jsx("div",{className:s.label,children:i})})),fe=()=>({root:{}});function Se({className:e,classes:s={},itemId:i,videoEl:a,itemType:c,isLoading:l,subtitleGroup:T="stl_subtitle",subtitleField:V="stl_text",sampleRate:Y="PAL",allowedMimeTypes:j=ae,additionalMimeTypes:y=[],LoadingPlayerComponent:C=ue,NoPreviewPlayerComponent:W=de,ItemImagePlayerComponent:M=F.default,ItemAudioPlayerComponent:P=$.default,ItemVideoPlayerComponent:v=q.default,ItemBinaryPlayerComponent:b,onReady:I,onCinema:p,onScreenshot:U,width:w="100%",sourceTag:S="original",SourceSelectionComponent:D=le,videoPlayerProps:B={},audioPlayerProps:R={},shapeToLabel:O=ie,ItemVideoPlayerProps:k={},ItemBinaryPlayerProps:G={},LoadingPlayerProps:J={},NoPreviewPlayerProps:z={},...H}){const[d,K]=g.useState(),n=g.useMemo(()=>m.filterShapeSource(c,{allowedMimeTypes:[...j,...y]}).map(f=>({...f,label:O(f.shape)})),[c,j,y,O]),o=g.useMemo(()=>{if(d)return m.getShapeMediaType(d.shape);if(n&&n.length>0)return m.getShapeMediaType(n[0].shape)},[d,n]),Q=({target:{value:h}})=>{const{src:f,shape:Z,type:ee}=h;if(o===A||o===x){const r=a&&a.current&&a.current.player&&a.current.player.videojs;if(!r||r.currentSrc()===f)return;const te=r.paused(),re=r.currentTime(),E=Math.floor(r.duration()),N=ce(Z);r.preload==="none"&&(r.preload="metadata"),E<=N+2&&E>=N-2?(r.addClass("vjs-has-started"),r.bigPlayButton.hide(),r.poster(""),r.one("loadedmetadata",()=>{r.currentTime(re),te||r.play()})):r.one("loadeddata",()=>{r.bigPlayButton.show()}),r.pause(),r.src({src:f,type:ee.replace("x-","")})}K(h)},X=l||o===void 0||n.length===0;return t.jsx("div",{className:L(s.root,e,"VdtItemPlayer-root"),children:X?t.jsx(t.Fragment,{children:l?t.jsx(C,{...J}):t.jsx(W,{...z})}):t.jsxs(t.Fragment,{children:[(o===_||o===x||o===oe)&&t.jsxs(t.Fragment,{children:[M&&o===_&&t.jsx(M,{previewSource:d||n[0],videoEl:a,...H}),P&&o===x&&t.jsx(P,{videoEl:a,onReady:I,width:w,sourceTag:S,previewSources:n,audioPlayerProps:R}),D&&n.length>1&&t.jsx(D,{options:n,value:d||n[0],onChange:Q})]}),b&&o===se&&t.jsx(b,{itemId:i,itemType:c,source:d||(n==null?void 0:n[0]),sourceTag:S,previewSources:n,...G}),v&&o===A&&t.jsx(v,{videoEl:a,itemType:c,subtitleGroup:T,subtitleField:V,sampleRate:Y,onReady:I,onCinema:p,onScreenshot:U,width:w,sourceTag:S,previewSources:n,videoPlayerProps:B,...k})]})})}exports.default=Se;exports.styles=fe;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),g=require("react"),L=require("clsx"),u=require("@material-ui/core"),ne=require("@material-ui/lab"),m=require("@vidispine/vdt-js"),$=require("../ItemAudioPlayer.js"),F=require("../ItemImagePlayer.js"),q=require("../ItemVideoPlayer.js"),oe=[...q.ALLOWED_MIME_TYPES,...F.ALLOWED_MIME_TYPES,...$.ALLOWED_MIME_TYPES],_="IMAGE",j="AUDIO",A="VIDEO",ae="DOCUMENT",se="BINARY",ie=e=>e.height?e.fieldOrder?`${e.tag} (${e.height}${e.fieldOrder[0]})`:`${e.tag} (${e.height}x${e.width})`:e.audioFormat?e.containerFormat!==e.audioFormat?`${e.tag} (${e.audioFormat} - ${e.containerFormat})`:`${e.tag} (${e.audioFormat})`:e.tag.join(", "),ce=e=>{const s=i=>i.split(":").reduce((o,c)=>60*o+Number(c));if(e.timeCode)return Math.floor(e.timeCode.toSeconds());if(e.duration)return s(e.duration)},le=u.withStyles({},{name:"VdtSourceSelection"})(({value:e,onChange:s,options:i,previewSourceText:o="Preview Source"})=>{const c=i.find(l=>l.label===e.label);return t.jsxs(u.FormControl,{variant:"standard",fullWidth:!0,children:[t.jsx(u.InputLabel,{children:o}),t.jsx(u.Select,{value:c,onChange:s,children:i.map(l=>t.jsx(u.MenuItem,{value:l,children:l.label},l.src))})]})}),ue=u.withStyles({},{name:"VdtLoadingPlayer"})(e=>t.jsx(ne.Skeleton,{variant:"rect",width:"100%",height:520,...e})),de=u.withStyles(e=>({root:{backgroundColor:e.palette.divider,width:"100%",height:520,display:"flex",justifyContent:"center",alignItems:"center"},label:{...e.typography.button}}),{name:"VdtNoPreviewPlayer"})(({className:e,classes:s,label:i="No Previews"})=>t.jsx("div",{className:L(s.root,e),children:t.jsx("div",{className:s.label,children:i})})),fe=()=>({root:{}});function Se({className:e,classes:s={},itemId:i,videoEl:o,itemType:c,isLoading:l,subtitleGroup:T="stl_subtitle",subtitleField:V="stl_text",sampleRate:Y="PAL",allowedMimeTypes:x=oe,additionalMimeTypes:y=[],LoadingPlayerComponent:C=ue,NoPreviewPlayerComponent:W=de,ItemImagePlayerComponent:M=F.default,ItemAudioPlayerComponent:P=$.default,ItemVideoPlayerComponent:v=q.default,ItemBinaryPlayerComponent:b,onReady:I,onCinema:p,onScreenshot:U,width:w="100%",sourceTag:S="original",SourceSelectionComponent:D=le,videoPlayerProps:B={},audioPlayerProps:R={},shapeToLabel:O=ie,ItemVideoPlayerProps:k={},ItemBinaryPlayerProps:G={},LoadingPlayerProps:J={},NoPreviewPlayerProps:z={},...H}){const[d,K]=g.useState(),n=g.useMemo(()=>m.filterShapeSource(c,{allowedMimeTypes:[...x,...y]}).map(f=>({...f,label:O(f.shape)})),[c,x,y,O]),a=g.useMemo(()=>{if(d)return m.getShapeMediaType(d.shape);if(n&&n.length>0)return m.getShapeMediaType(n[0].shape)},[d,n]),Q=({target:{value:h}})=>{const{src:f,shape:Z,type:ee}=h;if(a===A||a===j){const r=o&&o.current&&o.current.player&&o.current.player.videojs;if(!r||r.currentSrc()===f)return;const te=r.paused(),re=r.currentTime(),E=Math.floor(r.duration()),N=ce(Z);r.preload==="none"&&(r.preload="metadata"),E<=N+2&&E>=N-2?(r.addClass("vjs-has-started"),r.bigPlayButton.hide(),r.poster(""),r.one("loadedmetadata",()=>{r.currentTime(re),te||r.play()})):r.one("loadeddata",()=>{r.bigPlayButton.show()}),r.pause(),r.src({src:f,type:ee.replace("x-","")})}K(h)},X=l||a===void 0||n.length===0;return t.jsx("div",{className:L(s.root,e,"VdtItemPlayer-root"),children:X?t.jsx(t.Fragment,{children:l?t.jsx(C,{...J}):t.jsx(W,{...z})}):t.jsxs(t.Fragment,{children:[(a===_||a===j||a===ae)&&t.jsxs(t.Fragment,{children:[M&&a===_&&t.jsx(M,{previewSource:d||n[0],videoEl:o,...H}),P&&a===j&&t.jsx(P,{videoEl:o,onReady:I,width:w,sourceTag:S,previewSources:n,audioPlayerProps:R}),D&&n.length>1&&t.jsx(D,{options:n,value:d||n[0],onChange:Q})]}),b&&a===se&&t.jsx(b,{itemId:i,itemType:c,source:d||(n==null?void 0:n[0]),sourceTag:S,previewSources:n,...G}),v&&a===A&&t.jsx(v,{videoEl:o,itemType:c,subtitleGroup:T,subtitleField:V,sampleRate:Y,onReady:I,onCinema:p,onScreenshot:U,width:w,sourceTag:S,previewSources:n,videoPlayerProps:B,...k})]})})}exports.default=Se;exports.styles=fe;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),h=require("react"),b=require("clsx"),e=require("prop-types"),a=require("@material-ui/core"),T=require("@vidispine/proptypes"),v=require("../QueryBuilder/index.js"),A=n=>({root:{padding:n.spacing(1)},resetButton:{},searchButton:{},DialogActions:{},errorButton:{color:n.palette.error.light,float:"left"},successButton:{color:n.palette.success.light,float:"left"}});function u({className:n,classes:o,resetText:g,searchText:f,onSubmit:l,itemSearchDocument:c,initialOperator:p,fields:m,groups:B,QueryBuilderProps:O,PaperProps:P,resetButtonProps:j,searchButtonProps:x,showGeneralOperator:q}){const[t,D]=h.useState(p),[i,d]=h.useState({operator:t,...c}),N=()=>{D(t.operation==="AND"?{operation:"OR"}:{operation:"AND"})},S=()=>{const r={...c,operator:p};d(r),l(r)},y=()=>{const r={...c,...i.toItemSearchDocument?i.toItemSearchDocument():i};r.operator.operation=t.operation,l(r)};return s.jsxs(a.Paper,{className:b(o.root,n),onKeyPress:r=>{r.key==="Enter"&&y()},variant:"outlined",elevation:0,square:!0,...P,children:[q&&s.jsx(a.Button,{className:t&&t.operation==="AND"?o.successButton:o.errorButton,edge:"end",onClick:N,size:"small",children:t&&t.operation}),s.jsx(v.default,{query:i,fields:m,groups:B,onChange:d,...O}),s.jsxs(a.DialogActions,{className:o.DialogActions,children:[s.jsx(a.Button,{className:o.resetButton,onClick:S,...j,children:g}),s.jsx(a.Button,{className:o.searchButton,variant:"contained",color:"primary",onClick:y,...x,children:f})]})]})}u.propTypes={classes:e.objectOf(e.string),className:e.string,resetText:e.string,searchText:e.string,onSubmit:e.func.isRequired,itemSearchDocument:T.ItemSearchType,initialOperator:e.objectOf(e.any),fields:e.arrayOf(e.shape({name:e.string,label:e.string,type:e.string})),groups:e.arrayOf(e.shape({name:e.string})),PaperProps:e.objectOf(e.any),QueryBuilderProps:e.objectOf(e.any),resetButtonProps:e.objectOf(e.any),searchButtonProps:e.objectOf(e.any),showGeneralOperator:e.bool};u.defaultProps={className:void 0,classes:{},resetText:"Reset",searchText:"Search",fields:void 0,groups:void 0,itemSearchDocument:{},initialOperator:{operation:"AND"},PaperProps:{},QueryBuilderProps:{},resetButtonProps:{},searchButtonProps:{},showGeneralOperator:!0};exports.default=u;exports.styles=A;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),y=require("react"),T=require("clsx"),e=require("prop-types"),a=require("@material-ui/core"),b=require("@vidispine/proptypes"),v=require("../QueryBuilder/index.js"),A=s=>({root:{padding:s.spacing(1)},resetButton:{},searchButton:{},DialogActions:{},errorButton:{color:s.palette.error.light,float:"left"},successButton:{color:s.palette.success.light,float:"left"}});function u({className:s,classes:o,resetText:h,searchText:g,onSubmit:l,itemSearchDocument:c,initialOperator:f,fields:m,groups:B,QueryBuilderProps:O,PaperProps:P,resetButtonProps:j,searchButtonProps:x,showGeneralOperator:N}){const[t,D]=y.useState(f),[i,p]=y.useState({operator:t,...c}),q=()=>{D(t.operation==="AND"?{operation:"OR"}:{operation:"AND"})},S=()=>{const r={...c,operator:{operation:t.operation==="NOT"?{operation:"AND"}:{operation:t.operation}}};p(r),l(r)},d=()=>{const r={...c,...i.toItemSearchDocument?i.toItemSearchDocument():i};r.operator.operation=t.operation,l(r)};return n.jsxs(a.Paper,{className:T(o.root,s),onKeyPress:r=>{r.key==="Enter"&&d()},variant:"outlined",elevation:0,square:!0,...P,children:[N&&n.jsx(a.Button,{className:t&&t.operation==="AND"?o.successButton:o.errorButton,edge:"end",onClick:q,size:"small",children:t&&t.operation}),n.jsx(v.default,{query:i,fields:m,groups:B,onChange:p,...O}),n.jsxs(a.DialogActions,{className:o.DialogActions,children:[n.jsx(a.Button,{className:o.resetButton,onClick:S,...j,children:h}),n.jsx(a.Button,{className:o.searchButton,variant:"contained",color:"primary",onClick:d,...x,children:g})]})]})}u.propTypes={classes:e.objectOf(e.string),className:e.string,resetText:e.string,searchText:e.string,onSubmit:e.func.isRequired,itemSearchDocument:b.ItemSearchType,initialOperator:e.objectOf(e.any),fields:e.arrayOf(e.shape({name:e.string,label:e.string,type:e.string})),groups:e.arrayOf(e.shape({name:e.string})),PaperProps:e.objectOf(e.any),QueryBuilderProps:e.objectOf(e.any),resetButtonProps:e.objectOf(e.any),searchButtonProps:e.objectOf(e.any),showGeneralOperator:e.bool};u.defaultProps={className:void 0,classes:{},resetText:"Reset",searchText:"Search",fields:void 0,groups:void 0,itemSearchDocument:{},initialOperator:{operation:"AND"},PaperProps:{},QueryBuilderProps:{},resetButtonProps:{},searchButtonProps:{},showGeneralOperator:!0};exports.default=u;exports.styles=A;
@@ -1,73 +1,77 @@
1
- import { jsxs as l, Fragment as I, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as r, Fragment as I, jsx as e } from "react/jsx-runtime";
2
2
  import { useMemo as M, useState as O } from "react";
3
3
  import u from "lodash.get";
4
- import { TableRow as f, TableCell as i, IconButton as p, Hidden as R, Collapse as A, Box as D, Table as F } from "@material-ui/core";
4
+ import { TableRow as p, TableCell as i, IconButton as g, Hidden as R, Collapse as A, Box as D, Table as F } from "@material-ui/core";
5
5
  import { ExpandMore as k, ChevronRight as E, CloudDownload as H } from "@material-ui/icons";
6
6
  import { parseShapeType as N } from "@vidispine/vdt-js";
7
- import T from "../../ItemSourceTable/components/ShapeTypeTableBody.js";
8
- import q from "./ItemShapeMenu.js";
7
+ import q from "../../ItemSourceTable/components/ShapeTypeTableBody.js";
8
+ import y from "./ItemShapeMenu.js";
9
9
  function V({
10
- shapeType: o,
11
- TableRowProps: g,
12
- canExpand: t = !0,
13
- onRemove: d,
14
- showDownload: S,
10
+ shapeType: n,
11
+ TableRowProps: S,
12
+ canExpand: d = !0,
13
+ onRemove: c,
14
+ showDownload: C,
15
15
  itemId: a,
16
- storageListType: C,
17
- displayMethodTypes: b,
18
- storageMetadataKeys: z
16
+ storageListType: b,
17
+ displayMethodTypes: z,
18
+ storageMetadataKeys: w
19
19
  }) {
20
- const { id: w } = o, n = M(() => N(o), [o]), [c, x] = O(!1), B = () => x((j) => !j), { containerComponent: { file: r = [] } = {} } = o;
21
- let m, h;
22
- r.length > 0 && (m = u(r, "[0].uri[0]", "undefined"), h = u(r, "[0].path", "undefined"));
23
- const v = o.tag.join(", "), s = n.fileSize === "-1 B" ? "Not Available" : n.fileSize;
24
- return /* @__PURE__ */ l(I, { children: [
25
- /* @__PURE__ */ l(f, { ...g, children: [
26
- /* @__PURE__ */ e(i, { children: t && /* @__PURE__ */ e(p, { size: "small", onClick: B, children: c ? /* @__PURE__ */ e(k, {}) : /* @__PURE__ */ e(E, {}) }) }),
27
- /* @__PURE__ */ e(i, { children: v }),
28
- /* @__PURE__ */ l(R, { smDown: !0, children: [
29
- /* @__PURE__ */ e(i, { children: n.containerFormat }),
30
- /* @__PURE__ */ e(i, { children: n.videoCodec }),
31
- /* @__PURE__ */ e(i, { children: n.audioCodec }),
32
- /* @__PURE__ */ e(i, { children: n.frameRate })
20
+ const { id: x } = n, o = M(() => N(n), [n]), [h, B] = O(!1), v = () => B((t) => !t), { containerComponent: { file: l = [] } = {} } = n;
21
+ if (l.length === 0) {
22
+ const { binaryComponent: t = [] } = n;
23
+ t.length > 0 && l.push(...t[0].file);
24
+ }
25
+ let m, s;
26
+ l.length > 0 && (m = u(l, "[0].uri[0]", "undefined"), s = u(l, "[0].path", "undefined"));
27
+ const j = n.tag.join(", "), f = o.fileSize === "-1 B" ? "Not Available" : o.fileSize;
28
+ return /* @__PURE__ */ r(I, { children: [
29
+ /* @__PURE__ */ r(p, { ...S, children: [
30
+ /* @__PURE__ */ e(i, { children: d && /* @__PURE__ */ e(g, { size: "small", onClick: v, children: h ? /* @__PURE__ */ e(k, {}) : /* @__PURE__ */ e(E, {}) }) }),
31
+ /* @__PURE__ */ e(i, { children: j }),
32
+ /* @__PURE__ */ r(R, { smDown: !0, children: [
33
+ /* @__PURE__ */ e(i, { children: o.containerFormat }),
34
+ /* @__PURE__ */ e(i, { children: o.videoCodec }),
35
+ /* @__PURE__ */ e(i, { children: o.audioCodec }),
36
+ /* @__PURE__ */ e(i, { children: o.frameRate })
33
37
  ] }),
34
- /* @__PURE__ */ e(i, { children: n.dimension }),
35
- /* @__PURE__ */ e(i, { children: s }),
36
- /* @__PURE__ */ l(i, { children: [
37
- S && /* @__PURE__ */ e(
38
- p,
38
+ /* @__PURE__ */ e(i, { children: o.dimension }),
39
+ /* @__PURE__ */ e(i, { children: f }),
40
+ /* @__PURE__ */ r(i, { children: [
41
+ C && /* @__PURE__ */ e(
42
+ g,
39
43
  {
40
44
  size: "small",
41
45
  href: m,
42
- download: h,
43
- style: { visibility: n.fileSizeBytes ? "visible" : "hidden" },
46
+ download: s,
47
+ style: { visibility: o.fileSizeBytes ? "visible" : "hidden" },
44
48
  children: /* @__PURE__ */ e(H, {})
45
49
  }
46
50
  ),
47
- d && /* @__PURE__ */ e(
48
- q,
51
+ c && /* @__PURE__ */ e(
52
+ y,
49
53
  {
50
- shapeType: o,
51
- shapeId: w,
54
+ shapeType: n,
55
+ shapeId: x,
52
56
  itemId: a,
53
- onRemove: d
57
+ onRemove: c
54
58
  }
55
59
  )
56
60
  ] })
57
61
  ] }),
58
- t && /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(
62
+ d && /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(
59
63
  i,
60
64
  {
61
65
  colSpan: 9,
62
- children: /* @__PURE__ */ e(A, { in: c, timeout: "auto", unmountOnExit: !0, children: /* @__PURE__ */ e(D, { margin: 1, children: /* @__PURE__ */ e(F, { size: "small", padding: "none", children: /* @__PURE__ */ e(
63
- T,
66
+ children: /* @__PURE__ */ e(A, { in: h, timeout: "auto", unmountOnExit: !0, children: /* @__PURE__ */ e(D, { margin: 1, children: /* @__PURE__ */ e(F, { size: "small", padding: "none", children: /* @__PURE__ */ e(
67
+ q,
64
68
  {
65
- shapeActualSize: s,
66
- shapeType: o,
69
+ shapeActualSize: f,
70
+ shapeType: n,
67
71
  itemId: a,
68
- storageListType: C,
69
- displayMethodTypes: b,
70
- storageMetadataKeys: z
72
+ storageListType: b,
73
+ displayMethodTypes: z,
74
+ storageMetadataKeys: w
71
75
  }
72
76
  ) }) }) })
73
77
  }
@@ -7,7 +7,7 @@ import { filterShapeSource as ct, getShapeMediaType as N } from "@vidispine/vdt-
7
7
  import ut, { ALLOWED_MIME_TYPES as dt } from "../ItemAudioPlayer.js";
8
8
  import st, { ALLOWED_MIME_TYPES as mt } from "../ItemImagePlayer.js";
9
9
  import ft, { ALLOWED_MIME_TYPES as St } from "../ItemVideoPlayer.js";
10
- const ht = [...St, ...mt, ...dt], p = "IMAGE", h = "AUDIO", T = "VIDEO", gt = "DOCUMENT", Mt = "BINARY", Et = (t) => t.height ? t.fieldOrder ? `${t.tag} (${t.height}${t.fieldOrder[0]})` : `${t.tag} (${t.height}x${t.width})` : t.audioFormat ? t.containerFormat !== t.audioFormat ? `${t.tag} (${t.audioFormat} - ${t.containerFormat})` : `${t.tag} (${t.audioFormat})` : t.tag, Pt = (t) => {
10
+ const ht = [...St, ...mt, ...dt], p = "IMAGE", h = "AUDIO", T = "VIDEO", gt = "DOCUMENT", Mt = "BINARY", Et = (t) => t.height ? t.fieldOrder ? `${t.tag} (${t.height}${t.fieldOrder[0]})` : `${t.tag} (${t.height}x${t.width})` : t.audioFormat ? t.containerFormat !== t.audioFormat ? `${t.tag} (${t.audioFormat} - ${t.containerFormat})` : `${t.tag} (${t.audioFormat})` : t.tag.join(", "), Pt = (t) => {
11
11
  const i = (l) => l.split(":").reduce((n, c) => 60 * n + Number(c));
12
12
  if (t.timeCode)
13
13
  return Math.floor(t.timeCode.toSeconds());
@@ -1,8 +1,8 @@
1
- import { jsxs as d, jsx as s } from "react/jsx-runtime";
2
- import { useState as f } from "react";
3
- import A from "clsx";
1
+ import { jsxs as m, jsx as s } from "react/jsx-runtime";
2
+ import { useState as d } from "react";
3
+ import S from "clsx";
4
4
  import e from "prop-types";
5
- import { Paper as I, Button as c, DialogActions as v } from "@material-ui/core";
5
+ import { Paper as I, Button as p, DialogActions as v } from "@material-ui/core";
6
6
  import C from "@vidispine/proptypes";
7
7
  import Q from "../QueryBuilder/index.js";
8
8
  const E = (a) => ({
@@ -19,62 +19,64 @@ const E = (a) => ({
19
19
  float: "left"
20
20
  }
21
21
  });
22
- function h({
22
+ function f({
23
23
  className: a,
24
24
  classes: t,
25
- resetText: y,
26
- searchText: g,
27
- onSubmit: p,
25
+ resetText: h,
26
+ searchText: y,
27
+ onSubmit: c,
28
28
  itemSearchDocument: i,
29
- initialOperator: l,
29
+ initialOperator: g,
30
30
  fields: B,
31
31
  groups: O,
32
32
  QueryBuilderProps: P,
33
- PaperProps: D,
34
- resetButtonProps: N,
33
+ PaperProps: N,
34
+ resetButtonProps: D,
35
35
  searchButtonProps: T,
36
36
  showGeneralOperator: b
37
37
  }) {
38
- const [r, j] = f(l), [n, u] = f({
39
- operator: r,
38
+ const [o, j] = d(g), [n, l] = d({
39
+ operator: o,
40
40
  ...i
41
41
  }), x = () => {
42
42
  j(
43
- r.operation === "AND" ? { operation: "OR" } : { operation: "AND" }
43
+ o.operation === "AND" ? { operation: "OR" } : { operation: "AND" }
44
44
  );
45
- }, S = () => {
46
- const o = {
45
+ }, A = () => {
46
+ const r = {
47
47
  ...i,
48
- operator: l
48
+ operator: {
49
+ operation: o.operation === "NOT" ? { operation: "AND" } : { operation: o.operation }
50
+ }
49
51
  };
50
- u(o), p(o);
51
- }, m = () => {
52
- const o = {
52
+ l(r), c(r);
53
+ }, u = () => {
54
+ const r = {
53
55
  ...i,
54
56
  ...n.toItemSearchDocument ? n.toItemSearchDocument() : n
55
57
  };
56
- o.operator.operation = r.operation, p(o);
58
+ r.operator.operation = o.operation, c(r);
57
59
  };
58
- return /* @__PURE__ */ d(
60
+ return /* @__PURE__ */ m(
59
61
  I,
60
62
  {
61
- className: A(t.root, a),
62
- onKeyPress: (o) => {
63
- o.key === "Enter" && m();
63
+ className: S(t.root, a),
64
+ onKeyPress: (r) => {
65
+ r.key === "Enter" && u();
64
66
  },
65
67
  variant: "outlined",
66
68
  elevation: 0,
67
69
  square: !0,
68
- ...D,
70
+ ...N,
69
71
  children: [
70
72
  b && /* @__PURE__ */ s(
71
- c,
73
+ p,
72
74
  {
73
- className: r && r.operation === "AND" ? t.successButton : t.errorButton,
75
+ className: o && o.operation === "AND" ? t.successButton : t.errorButton,
74
76
  edge: "end",
75
77
  onClick: x,
76
78
  size: "small",
77
- children: r && r.operation
79
+ children: o && o.operation
78
80
  }
79
81
  ),
80
82
  /* @__PURE__ */ s(
@@ -83,21 +85,21 @@ function h({
83
85
  query: n,
84
86
  fields: B,
85
87
  groups: O,
86
- onChange: u,
88
+ onChange: l,
87
89
  ...P
88
90
  }
89
91
  ),
90
- /* @__PURE__ */ d(v, { className: t.DialogActions, children: [
91
- /* @__PURE__ */ s(c, { className: t.resetButton, onClick: S, ...N, children: y }),
92
+ /* @__PURE__ */ m(v, { className: t.DialogActions, children: [
93
+ /* @__PURE__ */ s(p, { className: t.resetButton, onClick: A, ...D, children: h }),
92
94
  /* @__PURE__ */ s(
93
- c,
95
+ p,
94
96
  {
95
97
  className: t.searchButton,
96
98
  variant: "contained",
97
99
  color: "primary",
98
- onClick: m,
100
+ onClick: u,
99
101
  ...T,
100
- children: g
102
+ children: y
101
103
  }
102
104
  )
103
105
  ] })
@@ -105,7 +107,7 @@ function h({
105
107
  }
106
108
  );
107
109
  }
108
- h.propTypes = {
110
+ f.propTypes = {
109
111
  /**
110
112
  * Override or extend the styles applied to the component.
111
113
  */
@@ -129,7 +131,7 @@ h.propTypes = {
129
131
  searchButtonProps: e.objectOf(e.any),
130
132
  showGeneralOperator: e.bool
131
133
  };
132
- h.defaultProps = {
134
+ f.defaultProps = {
133
135
  className: void 0,
134
136
  classes: {},
135
137
  resetText: "Reset",
@@ -145,6 +147,6 @@ h.defaultProps = {
145
147
  showGeneralOperator: !0
146
148
  };
147
149
  export {
148
- h as default,
150
+ f as default,
149
151
  E as styles
150
152
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vidispine/vdt-materialui",
3
- "version": "25.4.5",
3
+ "version": "26.1.0-pre.1",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -36,11 +36,11 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@babel/runtime": "7.26.10",
39
- "@vidispine/proptypes": "25.4.5",
40
- "@vidispine/vdt-api": "25.4.5",
41
- "@vidispine/vdt-js": "25.4.5",
42
- "@vidispine/vdt-react": "25.4.5",
43
- "@vidispine/vdt-videojs-react": "25.4.5",
39
+ "@vidispine/proptypes": "26.1.0-pre.1",
40
+ "@vidispine/vdt-api": "26.1.0-pre.1",
41
+ "@vidispine/vdt-js": "26.1.0-pre.1",
42
+ "@vidispine/vdt-react": "26.1.0-pre.1",
43
+ "@vidispine/vdt-videojs-react": "26.1.0-pre.1",
44
44
  "clsx": "1.2.1",
45
45
  "filesize": "10.1.0",
46
46
  "final-form": "4.20.10",
@@ -74,11 +74,11 @@
74
74
  "@material-ui/icons": "4.11.3",
75
75
  "@material-ui/lab": "4.0.0-alpha.61",
76
76
  "@types/jest": "29.5.11",
77
- "@vidispine/eslint-config-mdx": "25.4.5",
78
- "@vidispine/eslint-config-react": "25.4.5",
79
- "@vidispine/eslint-config-storybook": "25.4.5",
80
- "@vidispine/prettier-config": "25.4.5",
81
- "@vidispine/proptypes": "25.4.5",
77
+ "@vidispine/eslint-config-mdx": "26.1.0-pre.1",
78
+ "@vidispine/eslint-config-react": "26.1.0-pre.1",
79
+ "@vidispine/eslint-config-storybook": "26.1.0-pre.1",
80
+ "@vidispine/prettier-config": "26.1.0-pre.1",
81
+ "@vidispine/proptypes": "26.1.0-pre.1",
82
82
  "@vitejs/plugin-react": "4.2.1",
83
83
  "@wojtekmaj/enzyme-adapter-react-17": "0.8.0",
84
84
  "axios": "1.7.7",