@yoopta/video 6.0.0-beta.5 → 6.0.0-beta.6
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/hooks/use-upload.d.ts +17 -0
- package/dist/hooks/use-upload.d.ts.map +1 -0
- package/dist/hooks/use-xhr.d.ts +11 -0
- package/dist/hooks/use-xhr.d.ts.map +1 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/plugin/{index.d.ts → video-plugin.d.ts} +1 -1
- package/dist/plugin/video-plugin.d.ts.map +1 -0
- package/dist/types.d.ts +133 -9
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/providers.d.ts +75 -9
- package/dist/utils/providers.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/plugin/index.d.ts.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { UseVideoDeleteReturn, UseVideoPosterUploadReturn, UseVideoUploadReturn, VideoDeleteOptions, VideoPosterUploadOptions, VideoUploadOptions, VideoUploadPreview } from '../types';
|
|
2
|
+
export declare const useVideoDelete: (options: VideoDeleteOptions | undefined) => UseVideoDeleteReturn;
|
|
3
|
+
export declare const useVideoUpload: (options: VideoUploadOptions | undefined) => UseVideoUploadReturn;
|
|
4
|
+
export declare const useVideoPosterUpload: (options: VideoPosterUploadOptions | undefined) => UseVideoPosterUploadReturn;
|
|
5
|
+
export declare const useVideoDimensions: () => {
|
|
6
|
+
getDimensions: (file: File) => Promise<{
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
duration: number;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
export declare const useVideoPreview: () => {
|
|
13
|
+
preview: VideoUploadPreview | null;
|
|
14
|
+
generatePreview: (file: File) => VideoUploadPreview;
|
|
15
|
+
clearPreview: () => void;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=use-upload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-upload.d.ts","sourceRoot":"","sources":["../../src/hooks/use-upload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EAGpB,kBAAkB,EAIlB,wBAAwB,EAIxB,kBAAkB,EAClB,kBAAkB,EAInB,MAAM,UAAU,CAAC;AAmJlB,eAAO,MAAM,cAAc,YAAa,kBAAkB,GAAG,SAAS,KAAG,oBAkGxE,CAAC;AAEF,eAAO,MAAM,cAAc,YAAa,kBAAkB,GAAG,SAAS,KAAG,oBAoHxE,CAAC;AAEF,eAAO,MAAM,oBAAoB,YACtB,wBAAwB,GAAG,SAAS,KAC5C,0BAiHF,CAAC;AAEF,eAAO,MAAM,kBAAkB;0BACA,IAAI,KAAG,QAAQ;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAuBjG,CAAC;AAEF,eAAO,MAAM,eAAe;;4BAGK,IAAI,KAAG,kBAAkB;;CAwBzD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { VideoUploadProgress, VideoUploadError, VideoUploadResult, XHRRequestOptions } from '../types';
|
|
2
|
+
export declare const useXHRRequest: ({ onError, onSuccess, onProgress, accept, maxSize, method, endpoint, headers, }: XHRRequestOptions) => {
|
|
3
|
+
xhrFetch: (body: XMLHttpRequestBodyInit) => Promise<VideoUploadResult>;
|
|
4
|
+
cancel: () => void;
|
|
5
|
+
reset: () => void;
|
|
6
|
+
loading: boolean;
|
|
7
|
+
progress: VideoUploadProgress | null;
|
|
8
|
+
error: VideoUploadError | null;
|
|
9
|
+
result: VideoUploadResult | null;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=use-xhr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-xhr.d.ts","sourceRoot":"","sources":["../../src/hooks/use-xhr.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EAEjB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAqBlB,eAAO,MAAM,aAAa,oFASvB,iBAAiB;qBAUM,sBAAsB,KAAG,QAAQ,iBAAiB,CAAC;;;;;;;CA2K5E,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { Video } from './plugin';
|
|
2
|
-
import { VideoElement, VideoElementProps, VideoUploadResponse } from './types';
|
|
1
|
+
import { Video } from './plugin/video-plugin';
|
|
2
|
+
import { VideoElement, VideoElementProps, VideoPluginOptions, VideoUploadResponse } from './types';
|
|
3
3
|
export { VideoCommands } from './commands';
|
|
4
|
+
export { useVideoUpload, useVideoDelete, useVideoPosterUpload, useVideoPreview, useVideoDimensions } from './hooks/use-upload';
|
|
5
|
+
export { parseVideoUrl, buildVideoProvider, getEmbedUrl, getProvider, isValidVideoUrl, isProviderUrl, getSupportedProviders, isProviderSupported } from './utils/providers';
|
|
4
6
|
export default Video;
|
|
5
|
-
export { VideoElement, VideoElementProps, VideoUploadResponse };
|
|
7
|
+
export { VideoElement, VideoElementProps, VideoUploadResponse, VideoPluginOptions };
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnG,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,oBAAoB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC/H,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE5K,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{generateId as n,Blocks as i,Elements as o,YooptaPlugin as r}from"@yoopta/editor";function s(t,e,n,i){return new(n||(n=Promise))(function(o,r){function s(t){try{l(i.next(t))}catch(t){r(t)}}function p(t){try{l(i.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,p)}l((i=i.apply(t,e||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const p={buildVideoElements:(t,e={})=>{const i=Object.assign(Object.assign({},e.props),{nodeType:"void"});return{id:n(),type:"video",children:[{text:""}],props:i}},insertVideo:(t,e={})=>{const{at:n,focus:o,props:r}=e,s=p.buildVideoElements(t,{props:r}),l=i.buildBlockData({value:[s],type:"Video",meta:{align:"center",depth:0}});i.insertBlock(t,l.type,{focus:o,at:n,blockData:l})},deleteVideo:(t,e)=>{i.deleteBlock(t,{blockId:e})},updateVideo:(t,e,n)=>{o.updateElement(t,{blockId:e,type:"video",props:n})}},l=t=>"number"==typeof t?t:parseInt(t.replace(/[^\d]/g,"")),d={left:"flex-start",center:"center",right:"flex-end"},a=new r({type:"Video",elements:t("video",{render:n=>e("div",Object.assign({},n.attributes,{children:[t("video",{src:n.element.props.src,width:n.element.props.sizes.width,height:n.element.props.sizes.height,objectFit:n.element.props.fit,controls:n.element.props.settings.controls,loop:n.element.props.settings.loop,muted:n.element.props.settings.muted,autoPlay:n.element.props.settings.autoPlay}),n.children]})),props:{src:null,srcSet:null,bgColor:null,sizes:{width:0,height:0},nodeType:"void",fit:null,settings:{controls:!1,loop:!1,muted:!1,autoPlay:!1},provider:null},nodeType:"void"}),options:{accept:"video/*",maxSizes:{maxWidth:650,maxHeight:550},onUpload:()=>s(void 0,void 0,void 0,function*(){return Promise.resolve({src:""})}),display:{title:"Video",description:"Upload from device, insert from Youtube, Vimeo, DailyMotion, Loom, Wistia"}},commands:p,parsers:{html:{deserialize:{nodeNames:["VIDEO"],parse:(t,e)=>{var i;if("VIDEO"===t.nodeName){const o=t.getAttribute("src"),r=t.getAttribute("srcset"),s=t.getAttribute("bgcolor"),p={width:t.getAttribute("width")?parseInt(t.getAttribute("width")||"650",10):650,height:t.getAttribute("height")?parseInt(t.getAttribute("height")||"500",10):500},d=null===(i=e.plugins.Image.options)||void 0===i?void 0:i.maxSizes,a=((t,e)=>{const n=l(t.width),i=l(t.height),o=l(e.width),r=l(e.height);if(n<=o&&i<=r)return{width:n,height:i};const s=n/o,p=i/r,d=Math.max(s,p),a=Math.round(n/d),h=Math.round(i/d);return{width:Math.min(a,o),height:Math.min(h,r)}})(p,{width:d.maxWidth,height:d.maxHeight}),h=t.getAttribute("controls"),c=t.getAttribute("loop"),u=t.getAttribute("muted"),g=t.getAttribute("autoplay"),m={src:o,srcSet:r,bgColor:s,sizes:a,fit:t.getAttribute("objectFit")||"cover",settings:{controls:!!h,loop:!!c,muted:!!u,autoPlay:!!g}};return{id:n(),type:"video",children:[{text:""}],props:m}}}},serialize:(t,e,n)=>{const{align:i="center",depth:o=0}=n||{};return`\n <div style="margin-left: ${20*o}px; display: flex; width: 100%; justify-content: ${d[i]||"center"};">\n <video data-meta-align="${i}" data-meta-depth="${o}" src="${t.props.src}" width="${t.props.sizes.width}" height="${t.props.sizes.height}" controls="${t.props.settings.controls}" loop="${t.props.settings.loop}" muted="${t.props.settings.muted}" autoplay="${t.props.settings.autoPlay}" style="margin: 0 auto;" objectFit="${t.props.fit}" />\n </div>`}},markdown:{serialize:(t,e)=>`\n`},email:{serialize:(t,e,n)=>{const{align:i="center",depth:o=0}=n||{};return`\n <table style="width: 100%;">\n <tbody style="width: 100%;">\n <tr>\n <td\n style="\n margin-left: ${o}px;\n display: flex;\n width: 100%;\n justify-content: ${d[i]||"center"};\n padding: 1rem 0rem;\n position: relative;\n "\n >\n <a\n href="${t.props.src}"\n target="_blank"\n rel="noreferrer noopener"\n style="\n position: relative;\n display: block;\n width: ${t.props.sizes.width}px;\n height: ${t.props.sizes.height}px;\n background-color: #999999;\n min-height: 300px;\n border-radius: 12px;\n border: none;\n overflow: hidden;\n "\n >\n <img\n data-meta-align="${i}"\n data-meta-depth="${o}"\n src="${t.props.poster}"\n width="${t.props.sizes.width}"\n height="${t.props.sizes.height}"\n objectfit="${t.props.fit}"\n alt="Poster"\n style="\n object-fit: ${t.props.fit};\n height: 100%;\n "\n />\n <span\n style="\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n pointer-events: none;\n "\n >\n <svg\n xmlns="http://www.w3.org/2000/svg"\n viewBox="0 0 24 24"\n width="50"\n height="50"\n >\n <circle cx="12" cy="12" r="10" fill="rgba(0, 0, 0, 0.6)" />\n <polygon points="10,8 16,12 10,16" fill="white" />\n </svg>\n </span>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n `}}}});export{p as VideoCommands,a as default};
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{generateId as o,Blocks as n,Elements as i,YooptaPlugin as r}from"@yoopta/editor";import{useState as s,useRef as l,useCallback as a}from"react";const d={buildVideoElements:(e,t={})=>{const n=Object.assign(Object.assign({},t.props),{nodeType:"void"});return{id:o(),type:"video",children:[{text:""}],props:n}},insertVideo:(e,t={})=>{const{at:o,focus:i,props:r}=t,s=d.buildVideoElements(e,{props:r}),l=n.buildBlockData({value:[s],type:"Video",meta:{align:"center",depth:0}});n.insertBlock(e,l.type,{focus:i,at:o,blockData:l})},deleteVideo:(e,t)=>{n.deleteBlock(e,{blockId:t})},updateVideo:(e,t,o)=>{i.updateElement(e,{blockId:t,type:"video",props:o})}},u=e=>"number"==typeof e?e:parseInt(e.replace(/[^\d]/g,""),10),c={left:"flex-start",center:"center",right:"flex-end"},p=new r({type:"Video",elements:e("video",{render:o=>t("div",Object.assign({},o.attributes,{children:[e("video",{src:o.element.props.src,width:o.element.props.sizes.width,height:o.element.props.sizes.height,objectFit:o.element.props.fit,controls:o.element.props.settings.controls,loop:o.element.props.settings.loop,muted:o.element.props.settings.muted,autoPlay:o.element.props.settings.autoPlay}),o.children]})),props:{src:null,srcSet:null,bgColor:null,sizes:{width:0,height:0},nodeType:"void",fit:null,settings:{controls:!1,loop:!1,muted:!1,autoPlay:!1},provider:null},nodeType:"void"}),options:{accept:"video/*",maxSizes:{maxWidth:650,maxHeight:550},display:{title:"Video",description:"Upload from device, insert from Youtube, Vimeo, DailyMotion, Loom, Wistia"}},commands:d,parsers:{html:{deserialize:{nodeNames:["VIDEO"],parse:(e,t)=>{var n;if("VIDEO"===e.nodeName){const i=e.getAttribute("src"),r=e.getAttribute("srcset"),s=e.getAttribute("bgcolor"),l={width:e.getAttribute("width")?parseInt(e.getAttribute("width")||"650",10):650,height:e.getAttribute("height")?parseInt(e.getAttribute("height")||"500",10):500},a=null===(n=t.plugins.Image.options)||void 0===n?void 0:n.maxSizes,d=((e,t)=>{const o=u(e.width),n=u(e.height),i=u(t.width),r=u(t.height);if(o<=i&&n<=r)return{width:o,height:n};const s=o/i,l=n/r,a=Math.max(s,l),d=Math.round(o/a),c=Math.round(n/a);return{width:Math.min(d,i),height:Math.min(c,r)}})(l,{width:a.maxWidth,height:a.maxHeight}),c=e.getAttribute("controls"),p=e.getAttribute("loop"),g=e.getAttribute("muted"),m=e.getAttribute("autoplay"),h={src:i,srcSet:r,bgColor:s,sizes:d,fit:e.getAttribute("objectFit")||"cover",settings:{controls:!!c,loop:!!p,muted:!!g,autoPlay:!!m}};return{id:o(),type:"video",children:[{text:""}],props:h}}}},serialize:(e,t,o)=>{const{align:n="center",depth:i=0}=o||{};return`\n <div style="margin-left: ${20*i}px; display: flex; width: 100%; justify-content: ${c[n]||"center"};">\n <video data-meta-align="${n}" data-meta-depth="${i}" src="${e.props.src}" width="${e.props.sizes.width}" height="${e.props.sizes.height}" controls="${e.props.settings.controls}" loop="${e.props.settings.loop}" muted="${e.props.settings.muted}" autoplay="${e.props.settings.autoPlay}" style="margin: 0 auto;" objectFit="${e.props.fit}" />\n </div>`}},markdown:{serialize:e=>`\n`},email:{serialize:(e,t,o)=>{const{align:n="center",depth:i=0}=o||{};return`\n <table style="width: 100%;">\n <tbody style="width: 100%;">\n <tr>\n <td\n style="\n margin-left: ${i}px;\n display: flex;\n width: 100%;\n justify-content: ${c[n]||"center"};\n padding: 1rem 0rem;\n position: relative;\n "\n >\n <a\n href="${e.props.src}"\n target="_blank"\n rel="noreferrer noopener"\n style="\n position: relative;\n display: block;\n width: ${e.props.sizes.width}px;\n height: ${e.props.sizes.height}px;\n background-color: #999999;\n min-height: 300px;\n border-radius: 12px;\n border: none;\n overflow: hidden;\n "\n >\n <img\n data-meta-align="${n}"\n data-meta-depth="${i}"\n src="${e.props.poster}"\n width="${e.props.sizes.width}"\n height="${e.props.sizes.height}"\n objectfit="${e.props.fit}"\n alt="Poster"\n style="\n object-fit: ${e.props.fit};\n height: 100%;\n "\n />\n <span\n style="\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n pointer-events: none;\n "\n >\n <svg\n xmlns="http://www.w3.org/2000/svg"\n viewBox="0 0 24 24"\n width="50"\n height="50"\n >\n <circle cx="12" cy="12" r="10" fill="rgba(0, 0, 0, 0.6)" />\n <polygon points="10,8 16,12 10,16" fill="white" />\n </svg>\n </span>\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n `}}}});function g(e,t,o,n){return new(o||(o=Promise))(function(i,r){function s(e){try{a(n.next(e))}catch(e){r(e)}}function l(e){try{a(n.throw(e))}catch(e){r(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof o?t:new o(function(e){e(t)})).then(s,l)}a((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const m=({onError:e,onSuccess:t,onProgress:o,accept:n,maxSize:i,method:r="POST",endpoint:d,headers:u})=>{const[c,p]=s({loading:!1,progress:null,error:null,result:null}),g=l(null),m=a(()=>{g.current&&(g.current.abort(),g.current=null)},[]),h=a(()=>{p({loading:!1,progress:null,error:null,result:null})},[]);return Object.assign(Object.assign({},c),{xhrFetch:s=>new Promise((l,a)=>{if(s instanceof File){const t=((e,t,o)=>{if(t&&!t.includes(e.type))return{message:`Invalid file type. Allowed types: ${t}`,code:"INVALID_TYPE"};if(o&&e.size>o)return{message:`File size exceeds ${(o/1024/1024).toFixed(2)}MB`,code:"FILE_TOO_LARGE"};return null})(s,n,i);if(t)return p(e=>Object.assign(Object.assign({},e),{error:t})),null==e||e(t),void a(t)}p({loading:!0,progress:{loaded:0,total:s instanceof File?s.size:0,percentage:0},error:null,result:null});const c=new XMLHttpRequest;g.current=c,c.upload.addEventListener("progress",e=>{if(e.lengthComputable){const t={loaded:e.loaded,total:e.total,percentage:Math.round(e.loaded/e.total*100)};p(e=>Object.assign(Object.assign({},e),{progress:t})),null==o||o(t)}}),c.addEventListener("load",()=>{if(c.status>=200&&c.status<300)try{const e=JSON.parse(c.responseText);p(t=>Object.assign(Object.assign({},t),{loading:!1,result:e})),null==t||t(e),l(e)}catch(t){const o={message:"Failed to parse server response",code:"PARSE_ERROR",status:c.status};p(e=>Object.assign(Object.assign({},e),{loading:!1,error:o})),null==e||e(o),a(o)}else{const t={message:`Upload failed with status ${c.status}`,code:"HTTP_ERROR",status:c.status};p(e=>Object.assign(Object.assign({},e),{loading:!1,error:t})),null==e||e(t),a(t)}}),c.addEventListener("error",()=>{const t={message:"Network error occurred",code:"NETWORK_ERROR"};p(e=>Object.assign(Object.assign({},e),{loading:!1,error:t})),null==e||e(t),a(t)}),c.addEventListener("abort",()=>{const e={message:"Upload cancelled",code:"ABORT"};p(t=>Object.assign(Object.assign({},t),{loading:!1,error:e})),a(e)}),c.addEventListener("timeout",()=>{const t={message:"Upload timeout",code:"TIMEOUT"};p(e=>Object.assign(Object.assign({},e),{loading:!1,error:t})),null==e||e(t),a(t)}),c.open(r,d),u&&Object.entries(u).forEach(([e,t])=>{c.setRequestHeader(e,t)}),c.timeout=3e5,c.send(s)}),cancel:m,reset:h})},h="https://yoopta.dev/docs/plugins/video",b=e=>{var t,o,n;(e=>{if(null==e)throw new Error(`[Yoopta Video] Delete options are not configured. Please provide 'delete' option when extending the Video plugin.\n\nExample:\nVideo.extend({\n options: {\n delete: async (element) => {\n // Delete file from your storage\n },\n },\n})\n\nSee documentation: ${h}`);if("function"!=typeof e&&"object"!=typeof e)throw new Error(`[Yoopta Video] Invalid delete options. Expected a function or endpoint configuration object.\n\nSee documentation: ${h}`);if("object"==typeof e&&!e.endpoint)throw new Error(`[Yoopta Video] Missing 'endpoint' in delete options. When using endpoint-based delete, you must provide an 'endpoint' URL.\n\nExample:\nVideo.extend({\n options: {\n delete: {\n endpoint: '/api/delete-video',\n },\n },\n})\n\nSee documentation: ${h}`)})(e);const i=e,r=(e=>"function"==typeof e)(i),[l,d]=s({loading:!1,progress:null,error:null,result:null}),u=r?{endpoint:""}:i,c=m({endpoint:u.endpoint,method:null!==(t=u.method)&&void 0!==t?t:"DELETE",headers:null!==(o=u.headers)&&void 0!==o?o:{},fieldName:null!==(n=u.fieldName)&&void 0!==n?n:"file",onSuccess:u.onSuccess,onError:u.onError,onProgress:u.onProgress}),p=a(e=>g(void 0,void 0,void 0,function*(){var t,o,n;if(!r)throw new Error("Custom delete called but options is not a function");const s=null===(t=e.props)||void 0===t?void 0:t.src;if(!s)throw new Error("Video src is required");d(e=>Object.assign(Object.assign({},e),{loading:!0,error:null}));try{yield i(e);const t={id:null!==(n=null===(o=e.props)||void 0===o?void 0:o.id)&&void 0!==n?n:"",url:s};return d(e=>Object.assign(Object.assign({},e),{loading:!1,result:t})),t}catch(e){const t={message:e instanceof Error?e.message:"Delete failed",code:"CUSTOM_DELETE_ERROR"};throw d(e=>Object.assign(Object.assign({},e),{loading:!1,error:t})),t}}),[i,r]),b=a(()=>{d({loading:!1,progress:null,error:null,result:null})},[]),f=a(e=>{var t;const o=null===(t=e.props)||void 0===t?void 0:t.id;if(!o)throw new Error("Video id is required");return c.xhrFetch(JSON.stringify({fileId:o}))},[c]);return r?Object.assign(Object.assign({},l),{deleteVideo:p,cancel:()=>{},reset:b}):{loading:c.loading,progress:c.progress,error:c.error,result:c.result,deleteVideo:f,cancel:c.cancel,reset:c.reset}},f=e=>{var t,o,n,i;(e=>{if(null==e)throw new Error(`[Yoopta Video] Upload options are not configured. Please provide 'upload' option when extending the Video plugin.\n\nExample:\nVideo.extend({\n options: {\n upload: async (file) => {\n // Upload file to your storage and return video props\n return { id: '...', src: '...' };\n },\n },\n})\n\nSee documentation: ${h}`);if("function"!=typeof e&&"object"!=typeof e)throw new Error(`[Yoopta Video] Invalid upload options. Expected a function or endpoint configuration object.\n\nSee documentation: ${h}`);if("object"==typeof e&&!e.endpoint)throw new Error(`[Yoopta Video] Missing 'endpoint' in upload options. When using endpoint-based upload, you must provide an 'endpoint' URL.\n\nExample:\nVideo.extend({\n options: {\n upload: {\n endpoint: '/api/upload-video',\n },\n },\n})\n\nSee documentation: ${h}`)})(e);const r=e,l=(e=>"function"==typeof e)(r),[d,u]=s({loading:!1,progress:null,error:null,result:null}),c=l?{endpoint:""}:r,p=m({endpoint:c.endpoint,method:null!==(t=c.method)&&void 0!==t?t:"POST",headers:null!==(o=c.headers)&&void 0!==o?o:{},fieldName:null!==(n=c.fieldName)&&void 0!==n?n:"file",maxSize:c.maxSize,accept:null!==(i=c.accept)&&void 0!==i?i:"video/mp4, video/webm, video/ogg, video/quicktime",onSuccess:c.onSuccess,onError:c.onError,onProgress:c.onProgress}),b=a(e=>g(void 0,void 0,void 0,function*(){var t,o,n,i;if(!l)throw new Error("Custom upload called but options is not a function");u(t=>Object.assign(Object.assign({},t),{loading:!0,progress:{loaded:0,total:e.size,percentage:0},error:null}));try{const s=e=>{u(t=>Object.assign(Object.assign({},t),{progress:e}))},l=yield r(e,s),a={id:null!==(t=l.id)&&void 0!==t?t:"",url:null!==(o=l.src)&&void 0!==o?o:"",poster:l.poster,width:"number"==typeof(null===(n=l.sizes)||void 0===n?void 0:n.width)?l.sizes.width:void 0,height:"number"==typeof(null===(i=l.sizes)||void 0===i?void 0:i.height)?l.sizes.height:void 0,provider:l.provider};return u(t=>Object.assign(Object.assign({},t),{loading:!1,progress:{loaded:e.size,total:e.size,percentage:100},result:a})),a}catch(e){const t={message:e instanceof Error?e.message:"Upload failed",code:"CUSTOM_UPLOAD_ERROR"};throw u(e=>Object.assign(Object.assign({},e),{loading:!1,error:t})),t}}),[r,l]),f=a(()=>{u({loading:!1,progress:null,error:null,result:null})},[]),v=a(e=>{var t;const o=new FormData;return o.append(null!==(t=c.fieldName)&&void 0!==t?t:"yoopta-video-file",e),p.xhrFetch(o)},[c.fieldName,p]);return l?Object.assign(Object.assign({},d),{upload:b,cancel:()=>{},reset:f}):{loading:p.loading,progress:p.progress,error:p.error,result:p.result,upload:v,cancel:p.cancel,reset:p.reset}},v=e=>{var t,o,n,i;(e=>{if(null==e)throw new Error(`[Yoopta Video] Poster upload options are not configured. Please provide 'uploadPoster' option when extending the Video plugin.\n\nExample:\nVideo.extend({\n options: {\n uploadPoster: async (file) => {\n // Upload poster image and return URL\n return 'https://...';\n },\n },\n})\n\nSee documentation: ${h}`);if("function"!=typeof e&&"object"!=typeof e)throw new Error(`[Yoopta Video] Invalid poster upload options. Expected a function or endpoint configuration object.\n\nSee documentation: ${h}`);if("object"==typeof e&&!e.endpoint)throw new Error(`[Yoopta Video] Missing 'endpoint' in poster upload options. When using endpoint-based upload, you must provide an 'endpoint' URL.\n\nExample:\nVideo.extend({\n options: {\n uploadPoster: {\n endpoint: '/api/upload-poster',\n },\n },\n})\n\nSee documentation: ${h}`)})(e);const r=e,l=(e=>"function"==typeof e)(r),[d,u]=s({loading:!1,progress:null,error:null,result:null}),c=l?{endpoint:""}:r,p=m({endpoint:c.endpoint,method:null!==(t=c.method)&&void 0!==t?t:"POST",headers:null!==(o=c.headers)&&void 0!==o?o:{},fieldName:null!==(n=c.fieldName)&&void 0!==n?n:"file",maxSize:c.maxSize,accept:null!==(i=c.accept)&&void 0!==i?i:"image/jpeg, image/jpg, image/png, image/gif, image/webp",onSuccess:c.onSuccess,onError:c.onError,onProgress:c.onProgress}),b=a(e=>g(void 0,void 0,void 0,function*(){if(!l)throw new Error("Custom upload called but options is not a function");u(t=>Object.assign(Object.assign({},t),{loading:!0,progress:{loaded:0,total:e.size,percentage:0},error:null}));try{const t=e=>{u(t=>Object.assign(Object.assign({},t),{progress:e}))},o=yield r(e,t),n={id:"",url:o};return u(t=>Object.assign(Object.assign({},t),{loading:!1,progress:{loaded:e.size,total:e.size,percentage:100},result:n})),o}catch(e){const t={message:e instanceof Error?e.message:"Poster upload failed",code:"CUSTOM_UPLOAD_ERROR"};throw u(e=>Object.assign(Object.assign({},e),{loading:!1,error:t})),t}}),[r,l]),f=a(()=>{u({loading:!1,progress:null,error:null,result:null})},[]),v=a(e=>g(void 0,void 0,void 0,function*(){var t;const o=new FormData;o.append(null!==(t=c.fieldName)&&void 0!==t?t:"yoopta-poster-file",e);return(yield p.xhrFetch(o)).url}),[c.fieldName,p]);return l?Object.assign(Object.assign({},d),{uploadPoster:b,cancel:()=>{},reset:f}):{loading:p.loading,progress:p.progress,error:p.error,result:p.result,uploadPoster:v,cancel:p.cancel,reset:p.reset}},w=()=>({getDimensions:e=>new Promise((t,o)=>{const n=document.createElement("video"),i=URL.createObjectURL(e);n.onloadedmetadata=()=>{URL.revokeObjectURL(i),t({width:n.videoWidth,height:n.videoHeight,duration:n.duration})},n.onerror=()=>{URL.revokeObjectURL(i),o(new Error("Failed to load video"))},n.src=i})}),y=()=>{const[e,t]=s(null);return{preview:e,generatePreview:o=>{e&&URL.revokeObjectURL(e.url);const n={url:URL.createObjectURL(o)};return t(n),n},clearPreview:()=>{e&&(URL.revokeObjectURL(e.url),t(null))}}},O=e=>{const t=e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=|shorts\/)([^#&?]*).*/);return t&&11===t[2].length?t[2]:null},j=e=>{try{const t=new URL(e).pathname.split("/").filter(Boolean);return"video"===t[0]?t[1]||null:t[0]||null}catch(e){return null}},E=e=>{const t=e.match(/^.+dailymotion.com\/(video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/);if(null!==t)return void 0!==t[4]?t[4]:t[2];const o=e.match(/dai\.ly\/([a-zA-Z0-9]+)/);return o?o[1]:null},x=e=>{try{const t=e.match(/(?:https?:\/\/)?(?:fast\.)?wistia\.(?:com|net)\/embed\/iframe\/([a-zA-Z0-9]+)/);if(t)return t[1];const o=e.match(/(?:https?:\/\/)?(?:www\.)?wistia\.com\/medias\/([a-zA-Z0-9]+)/);return o?o[1]:null}catch(e){return console.error("Error extracting Wistia ID:",e),null}},U=e=>{try{const t=e.match(/(?:https?:\/\/)?(?:www\.)?loom\.com\/(?:share|embed)\/([a-zA-Z0-9]+)/);return t?t[1]:null}catch(e){return console.error("Error extracting Loom ID:",e),null}};function $(e){return e.includes("youtube.com")||e.includes("youtu.be")?"youtube":e.includes("vimeo.com")?"vimeo":e.includes("dailymotion.com")||e.includes("dai.ly")?"dailymotion":e.includes("loom.com")?"loom":e.includes("wistia.com")||e.includes("wistia.net")?"wistia":null}const V={youtube:O,vimeo:j,dailymotion:E,loom:U,wistia:x},z=e=>`https://www.youtube.com/embed/${e}`,R=e=>`https://player.vimeo.com/video/${e}`,P=e=>`https://www.dailymotion.com/embed/video/${e}`,S=e=>`https://www.loom.com/embed/${e}`,L=e=>`https://fast.wistia.net/embed/iframe/${e}`,A={youtube:z,vimeo:R,dailymotion:P,loom:S,wistia:L},T=(e,t)=>{if(!e||!t)return null;const o=A[e];return o?o(t):null},I=(e,t="hq")=>`https://img.youtube.com/vi/${e}/${{default:"default",hq:"hqdefault",mq:"mqdefault",sd:"sddefault",maxres:"maxresdefault"}[t]}.jpg`,D=e=>`https://vumbnail.com/${e}.jpg`,k=e=>`https://www.dailymotion.com/thumbnail/video/${e}`,N=e=>`https://cdn.loom.com/sessions/thumbnails/${e}-with-play.gif`,F=e=>`https://fast.wistia.net/embed/medias/${e}/swatch`,M={youtube:I,vimeo:D,dailymotion:k,loom:N,wistia:F},_={youtube:{name:"YouTube",patterns:[/(?:https?:\/\/)?(?:www\.)?youtube\.com\/watch\?v=([^&]+)/,/(?:https?:\/\/)?(?:www\.)?youtube\.com\/embed\/([^?]+)/,/(?:https?:\/\/)?(?:www\.)?youtube\.com\/shorts\/([^?]+)/,/(?:https?:\/\/)?youtu\.be\/([^?]+)/],getVideoId:O,getEmbedUrl:z,getThumbnailUrl:I},vimeo:{name:"Vimeo",patterns:[/(?:https?:\/\/)?(?:www\.)?vimeo\.com\/(\d+)/,/(?:https?:\/\/)?player\.vimeo\.com\/video\/(\d+)/],getVideoId:j,getEmbedUrl:R,getThumbnailUrl:D},dailymotion:{name:"Dailymotion",patterns:[/(?:https?:\/\/)?(?:www\.)?dailymotion\.com\/video\/([a-zA-Z0-9]+)/,/(?:https?:\/\/)?dai\.ly\/([a-zA-Z0-9]+)/],getVideoId:E,getEmbedUrl:P,getThumbnailUrl:k},loom:{name:"Loom",patterns:[/(?:https?:\/\/)?(?:www\.)?loom\.com\/share\/([a-zA-Z0-9]+)/,/(?:https?:\/\/)?(?:www\.)?loom\.com\/embed\/([a-zA-Z0-9]+)/],getVideoId:U,getEmbedUrl:S,getThumbnailUrl:N},wistia:{name:"Wistia",patterns:[/(?:https?:\/\/)?(?:www\.)?wistia\.com\/medias\/([a-zA-Z0-9]+)/,/(?:https?:\/\/)?(?:fast\.)?wistia\.(?:com|net)\/embed\/iframe\/([a-zA-Z0-9]+)/],getVideoId:x,getEmbedUrl:L,getThumbnailUrl:F}},Y=e=>{const t=$(e);if(!t)return{provider:null,id:"",originalUrl:e,embedUrl:"",thumbnailUrl:void 0,isValid:!1};const o=V[t],n=o?o(e):null;if(!n)return{provider:t,id:"",originalUrl:e,embedUrl:"",thumbnailUrl:void 0,isValid:!1};const i=T(t,n)||"",r=((e,t)=>{if(!e||!t)return null;const o=M[e];return o?o(t):null})(t,n)||void 0;return{provider:t,id:n,originalUrl:e,embedUrl:i,thumbnailUrl:r,isValid:!0}},q=e=>Y(e).isValid,W=(e,t)=>{const o=Y(e);return o.provider===t&&o.isValid},Z=e=>{const t=Y(e);return t.isValid?{type:t.provider,id:t.id,url:t.originalUrl}:null},C=()=>Object.keys(_),B=e=>!!e&&e in _;export{d as VideoCommands,Z as buildVideoProvider,p as default,T as getEmbedUrl,$ as getProvider,C as getSupportedProviders,B as isProviderSupported,W as isProviderUrl,q as isValidVideoUrl,Y as parseVideoUrl,b as useVideoDelete,w as useVideoDimensions,v as useVideoPosterUpload,y as useVideoPreview,f as useVideoUpload};
|
|
@@ -2,4 +2,4 @@ import { YooptaPlugin } from '@yoopta/editor';
|
|
|
2
2
|
import type { VideoElementMap, VideoPluginOptions } from '../types';
|
|
3
3
|
declare const Video: YooptaPlugin<VideoElementMap, VideoPluginOptions>;
|
|
4
4
|
export { Video };
|
|
5
|
-
//# sourceMappingURL=
|
|
5
|
+
//# sourceMappingURL=video-plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/video-plugin.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAc,MAAM,gBAAgB,CAAC;AAG1D,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAyBpE,QAAA,MAAM,KAAK,mDA2MT,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -9,36 +9,160 @@ export type VideoElementSettings = {
|
|
|
9
9
|
muted?: boolean;
|
|
10
10
|
autoPlay?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export type VideoProviderTypes = 'youtube' | 'vimeo' | 'dailymotion' | 'loom' | 'wistia' | string | null;
|
|
12
|
+
export type VideoProviderTypes = 'youtube' | 'vimeo' | 'dailymotion' | 'loom' | 'wistia' | 'custom' | string | null;
|
|
13
13
|
export type VideoProvider = {
|
|
14
14
|
type: VideoProviderTypes;
|
|
15
15
|
id: string;
|
|
16
16
|
url?: string;
|
|
17
17
|
};
|
|
18
18
|
export type VideoElementProps = {
|
|
19
|
+
id?: string | null;
|
|
19
20
|
src?: string | null;
|
|
20
21
|
srcSet?: string | null;
|
|
21
22
|
bgColor?: string | null;
|
|
22
23
|
settings?: VideoElementSettings;
|
|
24
|
+
alignment?: 'left' | 'center' | 'right' | null;
|
|
23
25
|
sizes?: VideoSizes;
|
|
24
26
|
provider?: VideoProvider;
|
|
25
27
|
fit?: 'contain' | 'cover' | 'fill' | null;
|
|
26
|
-
poster?: string;
|
|
28
|
+
poster?: string | null;
|
|
27
29
|
};
|
|
28
30
|
export type VideoPluginElements = 'video';
|
|
29
31
|
export type VideoElement = SlateElement<'video', VideoElementProps>;
|
|
30
|
-
export type
|
|
32
|
+
export type VideoElementMap = {
|
|
33
|
+
video: VideoElement;
|
|
34
|
+
};
|
|
35
|
+
export type VideoUploadResponse = {
|
|
36
|
+
id?: string;
|
|
37
|
+
src: string;
|
|
38
|
+
poster?: string;
|
|
39
|
+
sizes?: VideoSizes;
|
|
40
|
+
provider?: VideoProvider;
|
|
41
|
+
};
|
|
42
|
+
export type VideoUploadProgress = {
|
|
43
|
+
loaded: number;
|
|
44
|
+
total: number;
|
|
45
|
+
percentage: number;
|
|
46
|
+
};
|
|
47
|
+
export type VideoUploadError = {
|
|
48
|
+
message: string;
|
|
49
|
+
code?: string;
|
|
50
|
+
status?: number;
|
|
51
|
+
};
|
|
52
|
+
export type VideoUploadResult = {
|
|
53
|
+
id: string;
|
|
54
|
+
url: string;
|
|
55
|
+
poster?: string;
|
|
56
|
+
width?: number;
|
|
57
|
+
height?: number;
|
|
58
|
+
duration?: number;
|
|
59
|
+
size?: number;
|
|
60
|
+
format?: string;
|
|
61
|
+
provider?: VideoProvider;
|
|
62
|
+
[key: string]: any;
|
|
63
|
+
};
|
|
64
|
+
export type VideoUploadState = {
|
|
65
|
+
loading: boolean;
|
|
66
|
+
progress: VideoUploadProgress | null;
|
|
67
|
+
error: VideoUploadError | null;
|
|
68
|
+
result: VideoUploadResult | null;
|
|
69
|
+
};
|
|
70
|
+
export type VideoUploadFn = (file: File, onProgress?: (progress: VideoUploadProgress) => void) => Promise<VideoUploadResponse>;
|
|
71
|
+
export type VideoDeleteFn = (element: VideoElement) => Promise<any>;
|
|
72
|
+
export type VideoPosterUploadFn = (file: File, onProgress?: (progress: VideoUploadProgress) => void) => Promise<string>;
|
|
73
|
+
export type VideoUploadEndpointOptions = {
|
|
74
|
+
endpoint: string;
|
|
75
|
+
method?: 'POST' | 'PUT' | 'PATCH';
|
|
76
|
+
headers?: Record<string, string>;
|
|
77
|
+
fieldName?: string;
|
|
78
|
+
maxSize?: number;
|
|
79
|
+
accept?: string;
|
|
80
|
+
onProgress?: (progress: VideoUploadProgress) => void;
|
|
81
|
+
onSuccess?: (result: VideoUploadResult) => void;
|
|
82
|
+
onError?: (error: VideoUploadError) => void;
|
|
83
|
+
};
|
|
84
|
+
export type VideoDeleteEndpointOptions = {
|
|
85
|
+
endpoint: string;
|
|
86
|
+
method?: 'DELETE' | 'PATCH';
|
|
87
|
+
headers?: Record<string, string>;
|
|
88
|
+
fieldName?: string;
|
|
89
|
+
onProgress?: (progress: VideoUploadProgress) => void;
|
|
90
|
+
onSuccess?: (result: VideoUploadResult) => void;
|
|
91
|
+
onError?: (error: VideoUploadError) => void;
|
|
92
|
+
};
|
|
93
|
+
export type VideoPosterUploadEndpointOptions = {
|
|
94
|
+
endpoint: string;
|
|
95
|
+
method?: 'POST' | 'PUT' | 'PATCH';
|
|
96
|
+
headers?: Record<string, string>;
|
|
97
|
+
fieldName?: string;
|
|
98
|
+
maxSize?: number;
|
|
99
|
+
accept?: string;
|
|
100
|
+
onProgress?: (progress: VideoUploadProgress) => void;
|
|
101
|
+
onSuccess?: (result: VideoUploadResult) => void;
|
|
102
|
+
onError?: (error: VideoUploadError) => void;
|
|
103
|
+
};
|
|
104
|
+
export type VideoUploadOptions = VideoUploadEndpointOptions | VideoUploadFn;
|
|
105
|
+
export type VideoDeleteOptions = VideoDeleteEndpointOptions | VideoDeleteFn;
|
|
106
|
+
export type VideoPosterUploadOptions = VideoPosterUploadEndpointOptions | VideoPosterUploadFn;
|
|
107
|
+
export type UseVideoUploadReturn = {
|
|
108
|
+
upload: (file: File) => Promise<VideoUploadResult>;
|
|
109
|
+
cancel: () => void;
|
|
110
|
+
reset: () => void;
|
|
111
|
+
} & VideoUploadState;
|
|
112
|
+
export type UseVideoDeleteReturn = {
|
|
113
|
+
deleteVideo: (element: VideoElement) => Promise<any>;
|
|
114
|
+
cancel: () => void;
|
|
115
|
+
reset: () => void;
|
|
116
|
+
} & VideoUploadState;
|
|
117
|
+
export type UseVideoPosterUploadReturn = {
|
|
118
|
+
uploadPoster: (file: File) => Promise<string>;
|
|
119
|
+
cancel: () => void;
|
|
120
|
+
reset: () => void;
|
|
121
|
+
} & VideoUploadState;
|
|
122
|
+
export type VideoUploadPreview = {
|
|
123
|
+
url: string;
|
|
124
|
+
width?: number;
|
|
125
|
+
height?: number;
|
|
126
|
+
duration?: number;
|
|
127
|
+
};
|
|
128
|
+
export type ParsedVideoUrl = {
|
|
129
|
+
provider: VideoProviderTypes;
|
|
130
|
+
id: string;
|
|
131
|
+
originalUrl: string;
|
|
132
|
+
embedUrl: string;
|
|
133
|
+
thumbnailUrl?: string;
|
|
134
|
+
isValid: boolean;
|
|
135
|
+
};
|
|
136
|
+
export type VideoProviderConfig = {
|
|
137
|
+
name: string;
|
|
138
|
+
patterns: RegExp[];
|
|
139
|
+
getVideoId: (url: string) => string | null;
|
|
140
|
+
getEmbedUrl: (id: string) => string;
|
|
141
|
+
getThumbnailUrl?: (id: string) => string;
|
|
142
|
+
};
|
|
31
143
|
export type VideoPluginOptions = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
144
|
+
upload?: VideoUploadOptions;
|
|
145
|
+
delete?: VideoDeleteOptions;
|
|
146
|
+
uploadPoster?: VideoPosterUploadOptions;
|
|
147
|
+
onError?: (error: VideoUploadError) => void;
|
|
35
148
|
accept?: string;
|
|
149
|
+
maxFileSize?: number;
|
|
36
150
|
maxSizes?: {
|
|
37
151
|
maxWidth?: number | string;
|
|
38
152
|
maxHeight?: number | string;
|
|
39
|
-
};
|
|
153
|
+
} | null;
|
|
154
|
+
defaultSettings?: VideoElementSettings;
|
|
155
|
+
allowedProviders?: VideoProviderTypes[];
|
|
40
156
|
};
|
|
41
|
-
export type
|
|
42
|
-
|
|
157
|
+
export type XHRRequestOptions = {
|
|
158
|
+
endpoint: string;
|
|
159
|
+
method?: 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
160
|
+
headers?: Record<string, string>;
|
|
161
|
+
fieldName?: string;
|
|
162
|
+
maxSize?: number;
|
|
163
|
+
accept?: string;
|
|
164
|
+
onProgress?: (progress: VideoUploadProgress) => void;
|
|
165
|
+
onSuccess?: (result: VideoUploadResult) => void;
|
|
166
|
+
onError?: (error: VideoUploadError) => void;
|
|
43
167
|
};
|
|
44
168
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{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AC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE;QACT,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KAC7B,GAAG,IAAI,CAAC;IAET,eAAe,CAAC,EAAE,oBAAoB,CAAC;IAEvC,gBAAgB,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACzC,CAAC;AAMF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACrD,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAChD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC7C,CAAC"}
|
|
@@ -1,15 +1,81 @@
|
|
|
1
|
-
import type { VideoProviderTypes } from '../types';
|
|
1
|
+
import type { ParsedVideoUrl, VideoProvider, VideoProviderConfig, VideoProviderTypes } from '../types';
|
|
2
2
|
export declare const getYoutubeId: (url: string) => string | null;
|
|
3
|
-
export declare const getVimeoId: (url: string) => string;
|
|
3
|
+
export declare const getVimeoId: (url: string) => string | null;
|
|
4
4
|
export declare const getDailymotionId: (url: string) => string | null;
|
|
5
5
|
export declare const getWistiaId: (url: string) => string | null;
|
|
6
6
|
export declare const getLoomId: (url: string) => string | null;
|
|
7
7
|
export declare function getProvider(url: string): VideoProviderTypes | null;
|
|
8
|
-
export declare const ProviderGetters:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
export declare const ProviderGetters: Record<string, (url: string) => string | null>;
|
|
9
|
+
export declare const getYoutubeEmbedUrl: (id: string) => string;
|
|
10
|
+
export declare const getVimeoEmbedUrl: (id: string) => string;
|
|
11
|
+
export declare const getDailymotionEmbedUrl: (id: string) => string;
|
|
12
|
+
export declare const getLoomEmbedUrl: (id: string) => string;
|
|
13
|
+
export declare const getWistiaEmbedUrl: (id: string) => string;
|
|
14
|
+
export declare const ProviderEmbedUrlGetters: Record<string, (id: string) => string>;
|
|
15
|
+
export declare const getEmbedUrl: (provider: VideoProviderTypes, id: string) => string | null;
|
|
16
|
+
export declare const getYoutubeThumbnailUrl: (id: string, quality?: 'default' | 'hq' | 'mq' | 'sd' | 'maxres') => string;
|
|
17
|
+
export declare const getVimeoThumbnailUrl: (id: string) => string;
|
|
18
|
+
export declare const getDailymotionThumbnailUrl: (id: string) => string;
|
|
19
|
+
export declare const getLoomThumbnailUrl: (id: string) => string;
|
|
20
|
+
export declare const getWistiaThumbnailUrl: (id: string) => string;
|
|
21
|
+
export declare const ProviderThumbnailGetters: Record<string, (id: string) => string>;
|
|
22
|
+
export declare const getThumbnailUrl: (provider: VideoProviderTypes, id: string) => string | null;
|
|
23
|
+
export declare const VIDEO_PROVIDERS: Record<string, VideoProviderConfig>;
|
|
24
|
+
/**
|
|
25
|
+
* Parse a video URL and extract provider information, video ID, embed URL, and thumbnail URL.
|
|
26
|
+
* This is the main utility function for handling video URLs from various providers.
|
|
27
|
+
*
|
|
28
|
+
* @param url - The video URL to parse
|
|
29
|
+
* @returns ParsedVideoUrl object with all extracted information
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const result = parseVideoUrl('https://www.youtube.com/watch?v=dQw4w9WgXcQ');
|
|
34
|
+
* // {
|
|
35
|
+
* // provider: 'youtube',
|
|
36
|
+
* // id: 'dQw4w9WgXcQ',
|
|
37
|
+
* // originalUrl: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
|
|
38
|
+
* // embedUrl: 'https://www.youtube.com/embed/dQw4w9WgXcQ',
|
|
39
|
+
* // thumbnailUrl: 'https://img.youtube.com/vi/dQw4w9WgXcQ/hqdefault.jpg',
|
|
40
|
+
* // isValid: true
|
|
41
|
+
* // }
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare const parseVideoUrl: (url: string) => ParsedVideoUrl;
|
|
45
|
+
/**
|
|
46
|
+
* Check if a URL is a valid video URL from a supported provider.
|
|
47
|
+
*
|
|
48
|
+
* @param url - The URL to validate
|
|
49
|
+
* @returns true if the URL is a valid video URL from a supported provider
|
|
50
|
+
*/
|
|
51
|
+
export declare const isValidVideoUrl: (url: string) => boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Check if a URL is from a specific provider.
|
|
54
|
+
*
|
|
55
|
+
* @param url - The URL to check
|
|
56
|
+
* @param provider - The provider to check for
|
|
57
|
+
* @returns true if the URL is from the specified provider
|
|
58
|
+
*/
|
|
59
|
+
export declare const isProviderUrl: (url: string, provider: VideoProviderTypes) => boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Build a VideoProvider object from a URL.
|
|
62
|
+
* This is useful for storing provider information in the video element props.
|
|
63
|
+
*
|
|
64
|
+
* @param url - The video URL
|
|
65
|
+
* @returns VideoProvider object or null if URL is invalid
|
|
66
|
+
*/
|
|
67
|
+
export declare const buildVideoProvider: (url: string) => VideoProvider | null;
|
|
68
|
+
/**
|
|
69
|
+
* Get all supported provider types.
|
|
70
|
+
*
|
|
71
|
+
* @returns Array of supported provider type strings
|
|
72
|
+
*/
|
|
73
|
+
export declare const getSupportedProviders: () => VideoProviderTypes[];
|
|
74
|
+
/**
|
|
75
|
+
* Check if a provider type is supported.
|
|
76
|
+
*
|
|
77
|
+
* @param provider - The provider type to check
|
|
78
|
+
* @returns true if the provider is supported
|
|
79
|
+
*/
|
|
80
|
+
export declare const isProviderSupported: (provider: VideoProviderTypes) => boolean;
|
|
15
81
|
//# sourceMappingURL=providers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/utils/providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/utils/providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAMvG,eAAO,MAAM,YAAY,QAAS,MAAM,KAAG,MAAM,GAAG,IAInD,CAAC;AAEF,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,MAAM,GAAG,IAejD,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAAS,MAAM,KAAG,MAAM,GAAG,IAcvD,CAAC;AAEF,eAAO,MAAM,WAAW,QAAS,MAAM,KAAG,MAAM,GAAG,IAiBlD,CAAC;AAEF,eAAO,MAAM,SAAS,QAAS,MAAM,KAAG,MAAM,GAAG,IAQhD,CAAC;AAMF,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAiBlE;AAGD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAM1E,CAAC;AAMF,eAAO,MAAM,kBAAkB,OAAQ,MAAM,KAAG,MAA+C,CAAC;AAEhG,eAAO,MAAM,gBAAgB,OAAQ,MAAM,KAAG,MAAgD,CAAC;AAE/F,eAAO,MAAM,sBAAsB,OAAQ,MAAM,KAAG,MAAyD,CAAC;A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AAG,aAAa,GAAG,IAYhE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,QAAO,kBAAkB,EAA0D,CAAC;AAEtH;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,aAAc,kBAAkB,KAAG,OAGlE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoopta/video",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.6",
|
|
4
4
|
"description": "Video plugin for Yoopta Editor",
|
|
5
5
|
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"bugs": {
|
|
36
36
|
"url": "https://github.com/Darginec05/Yoopta-Editor/issues"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "4c99cc586ce4c17cd837e3136a068121af44cc8f"
|
|
39
39
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAc,MAAM,gBAAgB,CAAC;AAG1D,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAyBpE,QAAA,MAAM,KAAK,mDAiNT,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,CAAC"}
|