@yoopta/image 6.0.0-beta.1 → 6.0.0-beta.11

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,6 +1,6 @@
1
- import type { ImageUploadOptions, ImageUploadPreview, UseImageDeleteReturn, UseImageUploadReturn } from '../types';
2
- export declare const useImageDelete: (options: ImageUploadOptions) => UseImageDeleteReturn;
3
- export declare const useImageUpload: (options: ImageUploadOptions) => UseImageUploadReturn;
1
+ import type { ImageDeleteOptions, ImageUploadOptions, ImageUploadPreview, UseImageDeleteReturn, UseImageUploadReturn } from '../types';
2
+ export declare const useImageDelete: (options: ImageDeleteOptions | undefined) => UseImageDeleteReturn;
3
+ export declare const useImageUpload: (options: ImageUploadOptions | undefined) => UseImageUploadReturn;
4
4
  export declare const useImageDimensions: () => {
5
5
  getDimensions: (file: File) => Promise<{
6
6
  width: number;
@@ -1 +1 @@
1
- {"version":3,"file":"use-upload.d.ts","sourceRoot":"","sources":["../../src/hooks/use-upload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,cAAc,YAAa,kBAAkB,KAAG,oBAsC5D,CAAC;AAEF,eAAO,MAAM,cAAc,YAAa,kBAAkB,KAAG,oBAwC5D,CAAC;AAEF,eAAO,MAAM,kBAAkB;0BACA,IAAI,KAAG,QAAQ;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAsB/E,CAAC;AAEF,eAAO,MAAM,eAAe;;4BAIK,IAAI;;;;CAyBpC,CAAC"}
1
+ {"version":3,"file":"use-upload.d.ts","sourceRoot":"","sources":["../../src/hooks/use-upload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAGV,kBAAkB,EAKlB,kBAAkB,EAClB,kBAAkB,EAKlB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,UAAU,CAAC;AA2FlB,eAAO,MAAM,cAAc,YAAa,kBAAkB,GAAG,SAAS,KAAG,oBAgHxE,CAAC;AAEF,eAAO,MAAM,cAAc,YAAa,kBAAkB,GAAG,SAAS,KAAG,oBAkHxE,CAAC;AAEF,eAAO,MAAM,kBAAkB;0BACA,IAAI,KAAG,QAAQ;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAsB/E,CAAC;AAEF,eAAO,MAAM,eAAe;;4BAGK,IAAI;;;;CAuBpC,CAAC"}
@@ -1,5 +1,5 @@
1
- import type { ImageUploadOptions, ImageUploadProgress, UploadError, UploadResult } from '../types';
2
- export declare const useXHRRequest: ({ onError, onSuccess, onProgress, accept, maxSize, method, endpoint, headers, }: ImageUploadOptions) => {
1
+ import type { ImageUploadProgress, UploadError, UploadResult, XHRRequestOptions } from '../types';
2
+ export declare const useXHRRequest: ({ onError, onSuccess, onProgress, accept, maxSize, method, endpoint, headers, }: XHRRequestOptions) => {
3
3
  xhrFetch: (body: XMLHttpRequestBodyInit) => Promise<UploadResult>;
4
4
  cancel: () => void;
5
5
  reset: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"use-xhr.d.ts","sourceRoot":"","sources":["../../src/hooks/use-xhr.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,YAAY,EAEb,MAAM,UAAU,CAAC;AAqBlB,eAAO,MAAM,aAAa,oFASvB,kBAAkB;qBAUK,sBAAsB,KAAG,QAAQ,YAAY,CAAC;;;;;;;CA+KvE,CAAC"}
1
+ {"version":3,"file":"use-xhr.d.ts","sourceRoot":"","sources":["../../src/hooks/use-xhr.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,mBAAmB,EACnB,WAAW,EACX,YAAY,EAEZ,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAqBlB,eAAO,MAAM,aAAa,oFASvB,iBAAiB;qBAUM,sBAAsB,KAAG,QAAQ,YAAY,CAAC;;;;;;;CA+KvE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Image } from './plugin/image-plugin';
2
- export { ImageElement, ImageElementProps, ImageUploadResponse, ImagePluginOptions, ImageUploadOptions, ImageDeleteOptions, ImageUploadPreview, UseImageDeleteReturn, UseImageUploadReturn, ImageUploadProgress, } from './types';
2
+ export { ImageElement, ImageElementProps, ImageUploadResponse, ImagePluginOptions, ImageUploadOptions, ImageDeleteOptions, ImageUploadFn, ImageDeleteFn, ImageUploadEndpointOptions, ImageDeleteEndpointOptions, ImageUploadPreview, UseImageDeleteReturn, UseImageUploadReturn, ImageUploadProgress, } from './types';
3
3
  export { useImageUpload, useImageDelete, useImageDimensions, useImagePreview, } from './hooks/use-upload';
4
4
  export { ImageCommands } from './commands';
5
5
  export default Image;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE9C,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,eAAe,KAAK,CAAC"}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{generateId as r,Blocks as s,Elements as n,YooptaPlugin as i}from"@yoopta/editor";import{useState as o,useRef as a,useCallback as l}from"react";const d={buildImageElements:(e,t={})=>{const s=Object.assign(Object.assign({},t.props),{nodeType:"void"});return{id:r(),type:"image",children:[{text:""}],props:s}},insertImage:(e,t={})=>{const{at:r,focus:n,props:i}=t,o=d.buildImageElements(e,{props:i}),a=s.buildBlockData({value:[o],type:"Image",meta:{align:"center",depth:0}});s.insertBlock(e,a.type,{focus:n,at:r,blockData:a})},deleteImage:(e,t)=>{s.deleteBlock(e,{blockId:t})},updateImage:(e,t,r)=>{n.updateElement(e,{blockId:t,type:"image",props:r})}},c=e=>"number"==typeof e?e:parseInt(e.replace(/[^\d]/g,""),10),p={left:"flex-start",center:"center",right:"flex-end"},g=new i({type:"Image",elements:e("image",{render:r=>{var s,n;return t("div",Object.assign({},r.attributes,{contentEditable:!1},{children:[e("img",{src:r.element.props.src,alt:r.element.props.alt,width:null===(s=r.element.props.sizes)||void 0===s?void 0:s.width,height:null===(n=r.element.props.sizes)||void 0===n?void 0:n.height,style:{objectFit:r.element.props.fit}}),r.children]}))},props:{id:null,src:null,alt:null,srcSet:null,bgColor:null,fit:null,sizes:{width:0,height:0}},nodeType:"void"}),commands:d,options:{display:{title:"Image",description:"Upload from device or insert with link"},maxSizes:{maxWidth:650,maxHeight:550}},parsers:{html:{deserialize:{nodeNames:["IMG"],parse:(e,t)=>{var s;if("IMG"===e.nodeName){const n={width:e.getAttribute("width")?parseInt(e.getAttribute("width")||"650",10):650,height:e.getAttribute("height")?parseInt(e.getAttribute("height")||"500",10):500},i=null===(s=t.plugins.Image.options)||void 0===s?void 0:s.maxSizes,o=((e,t)=>{const r=c(e.width),s=c(e.height),n=c(t.width),i=c(t.height);if(r<=n&&s<=i)return{width:r,height:s};const o=r/n,a=s/i,l=Math.max(o,a),d=Math.round(r/l),p=Math.round(s/l);return{width:Math.min(d,n),height:Math.min(p,i)}})(n,{width:i.maxWidth,height:i.maxHeight}),a={id:r(),nodeType:"void",src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",srcSet:e.getAttribute("srcset")||"",fit:e.getAttribute("objectFit")||"contain",sizes:o};return{id:r(),type:"image",children:[{text:""}],props:a}}}},serialize:(e,t,r)=>{const{align:s="center",depth:n=0}=r||{};return`<div style="margin-left: ${20*n}px; display: flex; width: 100%; justify-content: ${p[s]||"center"};">\n <img data-meta-align="${s}" data-meta-depth="${n}" src="${e.props.src}" alt="${e.props.alt}" width="${e.props.sizes.width}" height="${e.props.sizes.height}" objectFit="${e.props.fit}"/>\n </div>`}},markdown:{serialize:e=>`![${e.props.alt||e.id}](${e.props.src})\n`},email:{serialize:(e,t,r)=>{const{align:s="center",depth:n=0}=r||{};return`\n <table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td style="margin-left: ${20*n}px; display: flex; width: 100%; justify-content: ${p[s]||"center"}; margin-top: 1rem;">\n <img data-meta-align="${s}" style="margin: 0 auto; object-fit:${e.props.fit||"contain"};" data-meta-depth="${n}" src="${e.props.src}" alt="${e.props.alt}" width="${e.props.sizes.width}" height="${e.props.sizes.height}" />\n </td>\n </tr>\n </tbody>\n </table>\n `}}}}),u=({onError:e,onSuccess:t,onProgress:r,accept:s,maxSize:n,method:i="POST",endpoint:d,headers:c})=>{const[p,g]=o({loading:!1,progress:null,error:null,result:null}),u=a(null),h=l(()=>{u.current&&(u.current.abort(),u.current=null)},[]),m=l(()=>{g({loading:!1,progress:null,error:null,result:null})},[]);return Object.assign(Object.assign({},p),{xhrFetch:o=>new Promise((a,l)=>{if(o instanceof File){const t=((e,t,r)=>{if(t&&!t.includes(e.type))return{message:`Invalid file type. Allowed types: ${t}`,code:"INVALID_TYPE"};if(r&&e.size>r)return{message:`File size exceeds ${(r/1024/1024).toFixed(2)}MB`,code:"FILE_TOO_LARGE"};return null})(o,s,n);if(t)return g(e=>Object.assign(Object.assign({},e),{error:t})),null==e||e(t),void l(t)}g({loading:!0,progress:{loaded:0,total:o instanceof File?o.size:0,percentage:0},error:null,result:null});const p=new XMLHttpRequest;u.current=p,p.upload.addEventListener("progress",e=>{if(e.lengthComputable){const t={loaded:e.loaded,total:e.total,percentage:Math.round(e.loaded/e.total*100)};g(e=>Object.assign(Object.assign({},e),{progress:t})),null==r||r(t)}}),p.addEventListener("load",()=>{if(p.status>=200&&p.status<300)try{const e=JSON.parse(p.responseText);g(t=>Object.assign(Object.assign({},t),{loading:!1,result:e})),null==t||t(e),a(e)}catch(t){const r={message:"Failed to parse server response",code:"PARSE_ERROR",status:p.status};g(e=>Object.assign(Object.assign({},e),{loading:!1,error:r})),null==e||e(r),l(r)}else{const t={message:`Upload failed with status ${p.status}`,code:"HTTP_ERROR",status:p.status};g(e=>Object.assign(Object.assign({},e),{loading:!1,error:t})),null==e||e(t),l(t)}}),p.addEventListener("error",()=>{const t={message:"Network error occurred",code:"NETWORK_ERROR"};g(e=>Object.assign(Object.assign({},e),{loading:!1,error:t})),null==e||e(t),l(t)}),p.addEventListener("abort",()=>{const e={message:"Upload cancelled",code:"ABORT"};g(t=>Object.assign(Object.assign({},t),{loading:!1,error:e})),l(e)}),p.addEventListener("timeout",()=>{const t={message:"Upload timeout",code:"TIMEOUT"};g(e=>Object.assign(Object.assign({},e),{loading:!1,error:t})),null==e||e(t),l(t)}),p.open(i,d),c&&Object.entries(c).forEach(([e,t])=>{p.setRequestHeader(e,t)}),p.timeout=3e4,p.send(o)}),cancel:h,reset:m})},h=e=>{const{endpoint:t,method:r="DELETE",headers:s={},fieldName:n="file",onSuccess:i,onError:o,onProgress:a}=e,{xhrFetch:l,cancel:d,reset:c,loading:p,progress:g,error:h,result:m}=u({onError:o,onSuccess:i,onProgress:a,fieldName:n,method:r,endpoint:t,headers:s});return{loading:p,progress:g,error:h,result:m,deleteImage:e=>{var t;const r=null===(t=e.props)||void 0===t?void 0:t.id;if(!r)throw new Error("FileId is required");return l(JSON.stringify({fileId:r}))},cancel:d,reset:c}},m=e=>{const{endpoint:t,method:r="POST",headers:s={},fieldName:n="file",maxSize:i,accept:o="image/jpeg, image/jpg, image/png, image/gif, image/webp",onSuccess:a,onError:l,onProgress:d}=e,{xhrFetch:c,cancel:p,reset:g,loading:h,progress:m,error:b,result:f}=u({onError:l,onSuccess:a,onProgress:d,fieldName:n,accept:o,maxSize:i,method:r,endpoint:t,headers:s});return{loading:h,progress:m,error:b,result:f,upload:e=>{const t=new FormData;return t.append(null!=n?n:"yoopta-image-file",e),c(t)},cancel:p,reset:g}},b=()=>({getDimensions:e=>new Promise((t,r)=>{const s=new Image,n=URL.createObjectURL(e);s.onload=()=>{URL.revokeObjectURL(n),t({width:s.naturalWidth,height:s.naturalHeight})},s.onerror=()=>{URL.revokeObjectURL(n),r(new Error("Failed to load image"))},s.src=n})}),f=()=>{const[e,t]=o(null);return{preview:e,generatePreview:r=>{e&&URL.revokeObjectURL(e.url);const s=URL.createObjectURL(r);return t({url:s}),{url:s}},clearPreview:()=>{e&&(URL.revokeObjectURL(e.url),t(null))}}};export{d as ImageCommands,g as default,h as useImageDelete,b as useImageDimensions,f as useImagePreview,m as useImageUpload};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{generateId as n,Blocks as o,Elements as r,YooptaPlugin as i}from"@yoopta/editor";import{useState as s,useRef as a,useCallback as l}from"react";const d={buildImageElements:(e,t={})=>{const o=Object.assign(Object.assign({},t.props),{nodeType:"void"});return{id:n(),type:"image",children:[{text:""}],props:o}},insertImage:(e,t={})=>{const{at:n,focus:r,props:i}=t,s=d.buildImageElements(e,{props:i}),a=o.buildBlockData({value:[s],type:"Image",meta:{align:"center",depth:0}});o.insertBlock(e,a.type,{focus:r,at:n,blockData:a})},deleteImage:(e,t)=>{o.deleteBlock(e,{blockId:t})},updateImage:(e,t,n)=>{r.updateElement(e,{blockId:t,type:"image",props:n})}},c=e=>"number"==typeof e?e:parseInt(e.replace(/[^\d]/g,""),10),u={left:"flex-start",center:"center",right:"flex-end"},p=new i({type:"Image",elements:e("image",{render:n=>{var o,r;return t("div",Object.assign({},n.attributes,{contentEditable:!1},{children:[e("img",{src:n.element.props.src,alt:n.element.props.alt,width:null===(o=n.element.props.sizes)||void 0===o?void 0:o.width,height:null===(r=n.element.props.sizes)||void 0===r?void 0:r.height,style:{objectFit:n.element.props.fit}}),n.children]}))},props:{id:null,src:null,alt:null,srcSet:null,bgColor:null,fit:null,sizes:{width:0,height:0}},nodeType:"void"}),commands:d,options:{display:{title:"Image",description:"Upload from device or insert with link"},maxSizes:{maxWidth:650,maxHeight:550}},parsers:{html:{deserialize:{nodeNames:["IMG"],parse:(e,t)=>{var o;if("IMG"===e.nodeName){const r={width:e.getAttribute("width")?parseInt(e.getAttribute("width")||"650",10):650,height:e.getAttribute("height")?parseInt(e.getAttribute("height")||"500",10):500},i=null===(o=t.plugins.Image.options)||void 0===o?void 0:o.maxSizes,s=((e,t)=>{const n=c(e.width),o=c(e.height),r=c(t.width),i=c(t.height);if(n<=r&&o<=i)return{width:n,height:o};const s=n/r,a=o/i,l=Math.max(s,a),d=Math.round(n/l),u=Math.round(o/l);return{width:Math.min(d,r),height:Math.min(u,i)}})(r,{width:i.maxWidth,height:i.maxHeight}),a={id:n(),nodeType:"void",src:e.getAttribute("src")||"",alt:e.getAttribute("alt")||"",srcSet:e.getAttribute("srcset")||"",fit:e.getAttribute("objectFit")||"contain",sizes:s};return{id:n(),type:"image",children:[{text:""}],props:a}}}},serialize:(e,t,n)=>{const{align:o="center",depth:r=0}=n||{};return`<div style="margin-left: ${20*r}px; display: flex; width: 100%; justify-content: ${u[o]||"center"};">\n <img data-meta-align="${o}" data-meta-depth="${r}" src="${e.props.src}" alt="${e.props.alt}" width="${e.props.sizes.width}" height="${e.props.sizes.height}" objectFit="${e.props.fit}"/>\n </div>`}},markdown:{serialize:e=>`![${e.props.alt||e.id}](${e.props.src})\n`},email:{serialize:(e,t,n)=>{const{align:o="center",depth:r=0}=n||{};return`\n <table style="width:100%;">\n <tbody style="width:100%;">\n <tr>\n <td style="margin-left: ${20*r}px; display: flex; width: 100%; justify-content: ${u[o]||"center"}; margin-top: 1rem;">\n <img data-meta-align="${o}" style="margin: 0 auto; object-fit:${e.props.fit||"contain"};" data-meta-depth="${r}" src="${e.props.src}" alt="${e.props.alt}" width="${e.props.sizes.width}" height="${e.props.sizes.height}" />\n </td>\n </tr>\n </tbody>\n </table>\n `}}}});function g(e,t,n,o){return new(n||(n=Promise))(function(r,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((o=o.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const m=({onError:e,onSuccess:t,onProgress:n,accept:o,maxSize:r,method:i="POST",endpoint:d,headers:c})=>{const[u,p]=s({loading:!1,progress:null,error:null,result:null}),g=a(null),m=l(()=>{g.current&&(g.current.abort(),g.current=null)},[]),h=l(()=>{p({loading:!1,progress:null,error:null,result:null})},[]);return Object.assign(Object.assign({},u),{xhrFetch:s=>new Promise((a,l)=>{if(s instanceof File){const t=((e,t,n)=>{if(t&&!t.includes(e.type))return{message:`Invalid file type. Allowed types: ${t}`,code:"INVALID_TYPE"};if(n&&e.size>n)return{message:`File size exceeds ${(n/1024/1024).toFixed(2)}MB`,code:"FILE_TOO_LARGE"};return null})(s,o,r);if(t)return p(e=>Object.assign(Object.assign({},e),{error:t})),null==e||e(t),void l(t)}p({loading:!0,progress:{loaded:0,total:s instanceof File?s.size:0,percentage:0},error:null,result:null});const u=new XMLHttpRequest;g.current=u,u.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==n||n(t)}}),u.addEventListener("load",()=>{if(u.status>=200&&u.status<300)try{const e=JSON.parse(u.responseText);p(t=>Object.assign(Object.assign({},t),{loading:!1,result:e})),null==t||t(e),a(e)}catch(t){const n={message:"Failed to parse server response",code:"PARSE_ERROR",status:u.status};p(e=>Object.assign(Object.assign({},e),{loading:!1,error:n})),null==e||e(n),l(n)}else{const t={message:`Upload failed with status ${u.status}`,code:"HTTP_ERROR",status:u.status};p(e=>Object.assign(Object.assign({},e),{loading:!1,error:t})),null==e||e(t),l(t)}}),u.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),l(t)}),u.addEventListener("abort",()=>{const e={message:"Upload cancelled",code:"ABORT"};p(t=>Object.assign(Object.assign({},t),{loading:!1,error:e})),l(e)}),u.addEventListener("timeout",()=>{const t={message:"Upload timeout",code:"TIMEOUT"};p(e=>Object.assign(Object.assign({},e),{loading:!1,error:t})),null==e||e(t),l(t)}),u.open(i,d),c&&Object.entries(c).forEach(([e,t])=>{u.setRequestHeader(e,t)}),u.timeout=3e4,u.send(s)}),cancel:m,reset:h})},h="https://docs.yoopta.dev/plugins/image",f=e=>{var t,n,o;const r=(e=>{if(null==e)return!1;if("function"!=typeof e&&"object"!=typeof e)throw new Error(`[Yoopta Image] Invalid delete options. Expected a function or endpoint configuration object.\n\nSee documentation: ${h}`);if("object"==typeof e&&!e.endpoint)throw new Error(`[Yoopta Image] Missing 'endpoint' in delete options. When using endpoint-based delete, you must provide an 'endpoint' URL.\n\nExample:\nImage.extend({\n options: {\n delete: {\n endpoint: '/api/delete-image',\n },\n },\n})\n\nSee documentation: ${h}`);return!0})(e),i=r?e:null,a=!!i&&(e=>"function"==typeof e)(i),[d,c]=s({loading:!1,progress:null,error:null,result:null}),u=!i||a?{endpoint:""}:i,p=m({endpoint:u.endpoint,method:null!==(t=u.method)&&void 0!==t?t:"DELETE",headers:null!==(n=u.headers)&&void 0!==n?n:{},fieldName:null!==(o=u.fieldName)&&void 0!==o?o:"file",onSuccess:u.onSuccess,onError:u.onError,onProgress:u.onProgress}),f=l(e=>g(void 0,void 0,void 0,function*(){var t,n,o,r,s,l,d;if(!i){const i=null!==(n=null===(t=e.props)||void 0===t?void 0:t.src)&&void 0!==n?n:"";return{id:null!==(r=null===(o=e.props)||void 0===o?void 0:o.id)&&void 0!==r?r:"",url:i}}if(!a)throw new Error("Custom delete called but options is not a function");const u=null===(s=e.props)||void 0===s?void 0:s.src;if(!u)throw new Error("Image src is required");c(e=>Object.assign(Object.assign({},e),{loading:!0,error:null}));try{yield i(e);const t={id:null!==(d=null===(l=e.props)||void 0===l?void 0:l.id)&&void 0!==d?d:"",url:u};return c(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 c(e=>Object.assign(Object.assign({},e),{loading:!1,error:t})),t}}),[i,a]),b=l(()=>{c({loading:!1,progress:null,error:null,result:null})},[]),v=l(e=>{var t;const n=null===(t=e.props)||void 0===t?void 0:t.id;if(!n)throw new Error("FileId is required");return p.xhrFetch(JSON.stringify({fileId:n}))},[p]);return r?a?Object.assign(Object.assign({},d),{deleteImage:f,cancel:()=>{},reset:b}):{loading:p.loading,progress:p.progress,error:p.error,result:p.result,deleteImage:v,cancel:p.cancel,reset:p.reset}:Object.assign(Object.assign({},d),{deleteImage:f,cancel:()=>{},reset:b})},b=e=>{var t,n,o,r;(e=>{if(null==e)throw new Error(`[Yoopta Image] Upload options are not configured. Please provide 'upload' option when extending the Image plugin.\n\nExample:\nImage.extend({\n options: {\n upload: async (file) => {\n // Upload file to your storage and return image props\n return { id: '...', src: '...' };\n },\n },\n})\n\nSee documentation: ${h}`);if("function"!=typeof e&&"object"!=typeof e)throw new Error(`[Yoopta Image] Invalid upload options. Expected a function or endpoint configuration object.\n\nSee documentation: ${h}`);if("object"==typeof e&&!e.endpoint)throw new Error(`[Yoopta Image] Missing 'endpoint' in upload options. When using endpoint-based upload, you must provide an 'endpoint' URL.\n\nExample:\nImage.extend({\n options: {\n upload: {\n endpoint: '/api/upload-image',\n },\n },\n})\n\nSee documentation: ${h}`)})(e);const i=e,a=(e=>"function"==typeof e)(i),[d,c]=s({loading:!1,progress:null,error:null,result:null}),u=a?{endpoint:""}:i,p=m({endpoint:u.endpoint,method:null!==(t=u.method)&&void 0!==t?t:"POST",headers:null!==(n=u.headers)&&void 0!==n?n:{},fieldName:null!==(o=u.fieldName)&&void 0!==o?o:"file",maxSize:u.maxSize,accept:null!==(r=u.accept)&&void 0!==r?r:"image/jpeg, image/jpg, image/png, image/gif, image/webp",onSuccess:u.onSuccess,onError:u.onError,onProgress:u.onProgress}),f=l(e=>g(void 0,void 0,void 0,function*(){var t,n,o,r;if(!a)throw new Error("Custom upload called but options is not a function");c(t=>Object.assign(Object.assign({},t),{loading:!0,progress:{loaded:0,total:e.size,percentage:0},error:null}));try{const s=e=>{c(t=>Object.assign(Object.assign({},t),{progress:e}))},a=yield i(e,s),l={id:null!==(t=a.id)&&void 0!==t?t:"",url:null!==(n=a.src)&&void 0!==n?n:"",width:"number"==typeof(null===(o=a.sizes)||void 0===o?void 0:o.width)?a.sizes.width:void 0,height:"number"==typeof(null===(r=a.sizes)||void 0===r?void 0:r.height)?a.sizes.height:void 0};return c(t=>Object.assign(Object.assign({},t),{loading:!1,progress:{loaded:e.size,total:e.size,percentage:100},result:l})),l}catch(e){const t={message:e instanceof Error?e.message:"Upload failed",code:"CUSTOM_UPLOAD_ERROR"};throw c(e=>Object.assign(Object.assign({},e),{loading:!1,error:t})),t}}),[i,a]),b=l(()=>{c({loading:!1,progress:null,error:null,result:null})},[]),v=l(e=>{var t;const n=new FormData;return n.append(null!==(t=u.fieldName)&&void 0!==t?t:"yoopta-image-file",e),p.xhrFetch(n)},[u.fieldName,p]);return a?Object.assign(Object.assign({},d),{upload:f,cancel:()=>{},reset:b}):{loading:p.loading,progress:p.progress,error:p.error,result:p.result,upload:v,cancel:p.cancel,reset:p.reset}},v=()=>({getDimensions:e=>new Promise((t,n)=>{const o=new Image,r=URL.createObjectURL(e);o.onload=()=>{URL.revokeObjectURL(r),t({width:o.naturalWidth,height:o.naturalHeight})},o.onerror=()=>{URL.revokeObjectURL(r),n(new Error("Failed to load image"))},o.src=r})}),O=()=>{const[e,t]=s(null);return{preview:e,generatePreview:n=>{e&&URL.revokeObjectURL(e.url);const o=URL.createObjectURL(n);return t({url:o}),{url:o}},clearPreview:()=>{e&&(URL.revokeObjectURL(e.url),t(null))}}};export{d as ImageCommands,p as default,f as useImageDelete,v as useImageDimensions,O as useImagePreview,b as useImageUpload};
@@ -1 +1 @@
1
- {"version":3,"file":"image-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/image-plugin.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAc,MAAM,gBAAgB,CAAC;AAG1D,OAAO,KAAK,EAAE,eAAe,EAAqB,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAgCvF,QAAA,MAAM,KAAK,mDAiGT,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"image-plugin.d.ts","sourceRoot":"","sources":["../../src/plugin/image-plugin.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAc,MAAM,gBAAgB,CAAC;AAG1D,OAAO,KAAK,EAAE,eAAe,EAAqB,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAgCvF,QAAA,MAAM,KAAK,mDA2FT,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,CAAC"}
package/dist/types.d.ts CHANGED
@@ -19,26 +19,30 @@ export type ImageOptimizationFields = {
19
19
  deviceSizes?: number[];
20
20
  provider?: 'imgix' | 'cloudinary' | 'akamai';
21
21
  };
22
- export type ImageUploadOptions = {
22
+ export type ImageUploadFn = (file: File, onProgress?: (progress: ImageUploadProgress) => void) => Promise<ImageElementProps>;
23
+ export type ImageDeleteFn = (element: ImageElement) => Promise<any>;
24
+ export type ImageUploadEndpointOptions = {
23
25
  endpoint: string;
24
- method?: 'POST' | 'PUT' | 'DELETE' | 'PATCH';
26
+ method?: 'POST' | 'PUT' | 'PATCH';
25
27
  headers?: Record<string, string>;
26
28
  fieldName?: string;
27
29
  maxSize?: number;
28
30
  accept?: string;
29
- onProgress?: (progress: any) => void;
30
- onSuccess?: (result: any) => void;
31
- onError?: (error: any) => void;
31
+ onProgress?: (progress: ImageUploadProgress) => void;
32
+ onSuccess?: (result: UploadResult) => void;
33
+ onError?: (error: UploadError) => void;
32
34
  };
33
- export type ImageDeleteOptions = {
35
+ export type ImageDeleteEndpointOptions = {
34
36
  endpoint: string;
35
37
  method?: 'DELETE' | 'PATCH';
36
38
  headers?: Record<string, string>;
37
39
  fieldName?: string;
38
- onProgress?: (progress: any) => void;
39
- onSuccess?: (result: any) => void;
40
- onError?: (error: any) => void;
40
+ onProgress?: (progress: ImageUploadProgress) => void;
41
+ onSuccess?: (result: UploadResult) => void;
42
+ onError?: (error: UploadError) => void;
41
43
  };
44
+ export type ImageUploadOptions = ImageUploadEndpointOptions | ImageUploadFn;
45
+ export type ImageDeleteOptions = ImageDeleteEndpointOptions | ImageDeleteFn;
42
46
  export type ImagePluginOptions = {
43
47
  upload?: ImageUploadOptions;
44
48
  delete?: ImageDeleteOptions;
@@ -48,6 +52,17 @@ export type ImagePluginOptions = {
48
52
  } | null;
49
53
  optimizations?: ImageOptimizationFields | null;
50
54
  };
55
+ export type XHRRequestOptions = {
56
+ endpoint: string;
57
+ method?: 'POST' | 'PUT' | 'PATCH' | 'DELETE';
58
+ headers?: Record<string, string>;
59
+ fieldName?: string;
60
+ maxSize?: number;
61
+ accept?: string;
62
+ onProgress?: (progress: ImageUploadProgress) => void;
63
+ onSuccess?: (result: UploadResult) => void;
64
+ onError?: (error: UploadError) => void;
65
+ };
51
66
  export type ImageElementMap = {
52
67
  image: ImageElement;
53
68
  };
@@ -82,7 +97,7 @@ export type UseImageUploadReturn = {
82
97
  reset: () => void;
83
98
  } & UploadState;
84
99
  export type UseImageDeleteReturn = {
85
- deleteImage: (element: ImageElement) => Promise<UploadResult>;
100
+ deleteImage: (element: ImageElement) => Promise<any>;
86
101
  cancel: () => void;
87
102
  reset: () => void;
88
103
  } & UploadState;
@@ -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;AAEnD,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1C,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC;AAC1C,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;AAEpE,MAAM,MAAM,mBAAmB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AC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/image",
3
- "version": "6.0.0-beta.1",
3
+ "version": "6.0.0-beta.11",
4
4
  "description": "Image plugin for Yoopta Editor",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
@@ -14,7 +14,7 @@
14
14
  "dist/"
15
15
  ],
16
16
  "peerDependencies": {
17
- "@yoopta/editor": ">=4.9.9",
17
+ "@yoopta/editor": "6.0.0-beta.4",
18
18
  "react": ">=18.2.0",
19
19
  "react-dom": ">=18.2.0"
20
20
  },
@@ -35,5 +35,5 @@
35
35
  "bugs": {
36
36
  "url": "https://github.com/Darginec05/Yoopta-Editor/issues"
37
37
  },
38
- "gitHead": "ff6a5ae2937a56e0d1820df29fdfd6356171786c"
38
+ "gitHead": "328b04fa6481a487b434708338f56057792aafa4"
39
39
  }