@yoopta/image 2.0.0 → 4.0.0-rc.0

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/README.md CHANGED
@@ -1,11 +1,11 @@
1
- # `@yoopta/code`
1
+ # `yoopta-image`
2
2
 
3
3
  > TODO: description
4
4
 
5
5
  ## Usage
6
6
 
7
7
  ```
8
- const blockquote = require('@yoopta/code');
8
+ const image = require('yoopta-image');
9
9
 
10
10
  // TODO: DEMONSTRATE API
11
11
  ```
@@ -0,0 +1,11 @@
1
+ import { Image } from './plugin';
2
+ import { ImageElement } from './types';
3
+ import './styles.css';
4
+ declare module 'slate' {
5
+ interface CustomTypes {
6
+ Element: ImageElement;
7
+ }
8
+ }
9
+ export default Image;
10
+ export { ImageElement };
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,cAAc,CAAC;AAEtB,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,WAAW;QACnB,OAAO,EAAE,YAAY,CAAC;KACvB;CACF;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import{useYooptaEditor as t,useYooptaPluginOptions as e,UI as n,useBlockData as i,useBlockSelected as o,YooptaPlugin as r}from"@yoopta/editor";import{jsx as s,jsxs as a}from"react/jsx-runtime";import*as l from"react";import{useLayoutEffect as c,useEffect as d,forwardRef as p,createElement as u,useState as h,useMemo as f}from"react";import*as g from"react-dom";import{flushSync as m,createPortal as x}from"react-dom";const w=({width:t,height:e,src:n,alt:i,fit:o,bgColor:r,layout:a="intrinsic"})=>{const l={objectFit:o||"contain",backgroundColor:r||"transparent"},c="fixed"===a,d="fill"===a,p="intrinsic"===a;return"responsive"===a&&(l.width="100%",l.height="auto"),c&&(l.width="100%",l.height="100%"),d&&(l.width="100%",l.height="100%"),p&&(l.width="100%",l.height="100%"),s("div",Object.assign({className:"w-full","data-layout":a},{children:n&&s("img",{src:n,width:t,height:e,alt:i||"",decoding:"async",loading:"lazy",style:l})}))};var b,v=(b=function(t,e){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},b(t,e)},function(t,e){function n(){this.constructor=t}b(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),y=function(){return y=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},y.apply(this,arguments)},C={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},z={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},R={width:"20px",height:"20px",position:"absolute"},S={top:y(y({},C),{top:"-5px"}),right:y(y({},z),{left:void 0,right:"-5px"}),bottom:y(y({},C),{top:void 0,bottom:"-5px"}),left:y(y({},z),{left:"-5px"}),topRight:y(y({},R),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:y(y({},R),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:y(y({},R),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:y(y({},R),{left:"-10px",top:"-10px",cursor:"nw-resize"})},_=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.onMouseDown=function(t){e.props.onResizeStart(t,e.props.direction)},e.onTouchStart=function(t){e.props.onResizeStart(t,e.props.direction)},e}return v(e,t),e.prototype.render=function(){return l.createElement("div",{className:this.props.className||"",style:y(y({position:"absolute",userSelect:"none"},S[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},e}(l.PureComponent),k=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),E=function(){return E=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},E.apply(this,arguments)},L={width:"auto",height:"auto"},O=function(t,e,n){return Math.max(Math.min(t,n),e)},N=function(t,e){return Math.round(t/e)*e},M=function(t,e){return new RegExp(t,"i").test(e)},W=function(t){return Boolean(t.touches&&t.touches.length)},j=function(t,e,n){void 0===n&&(n=0);var i=e.reduce((function(n,i,o){return Math.abs(i-t)<Math.abs(e[n]-t)?o:n}),0),o=Math.abs(e[i]-t);return 0===n||o<n?e[i]:t},T=function(t){return"auto"===(t=t.toString())||t.endsWith("px")||t.endsWith("%")||t.endsWith("vh")||t.endsWith("vw")||t.endsWith("vmax")||t.endsWith("vmin")?t:t+"px"},A=function(t,e,n,i){if(t&&"string"==typeof t){if(t.endsWith("px"))return Number(t.replace("px",""));if(t.endsWith("%"))return e*(Number(t.replace("%",""))/100);if(t.endsWith("vw"))return n*(Number(t.replace("vw",""))/100);if(t.endsWith("vh"))return i*(Number(t.replace("vh",""))/100)}return t},B=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],H="__resizable_base__",P=function(t){function e(e){var n=t.call(this,e)||this;return n.ratio=1,n.resizable=null,n.parentLeft=0,n.parentTop=0,n.resizableLeft=0,n.resizableRight=0,n.resizableTop=0,n.resizableBottom=0,n.targetLeft=0,n.targetTop=0,n.appendBase=function(){if(!n.resizable||!n.window)return null;var t=n.parentNode;if(!t)return null;var e=n.window.document.createElement("div");return e.style.width="100%",e.style.height="100%",e.style.position="absolute",e.style.transform="scale(0, 0)",e.style.left="0",e.style.flex="0 0 100%",e.classList?e.classList.add(H):e.className+=H,t.appendChild(e),e},n.removeBase=function(t){var e=n.parentNode;e&&e.removeChild(t)},n.ref=function(t){t&&(n.resizable=t)},n.state={isResizing:!1,width:void 0===(n.propsSize&&n.propsSize.width)?"auto":n.propsSize&&n.propsSize.width,height:void 0===(n.propsSize&&n.propsSize.height)?"auto":n.propsSize&&n.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},n.onResizeStart=n.onResizeStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n}return k(e,t),Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||L},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){var t=0,e=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,i=this.resizable.offsetHeight,o=this.resizable.style.position;"relative"!==o&&(this.resizable.style.position="relative"),t="auto"!==this.resizable.style.width?this.resizable.offsetWidth:n,e="auto"!==this.resizable.style.height?this.resizable.offsetHeight:i,this.resizable.style.position=o}return{width:t,height:e}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sizeStyle",{get:function(){var t=this,e=this.props.size,n=function(e){if(void 0===t.state[e]||"auto"===t.state[e])return"auto";if(t.propsSize&&t.propsSize[e]&&t.propsSize[e].toString().endsWith("%")){if(t.state[e].toString().endsWith("%"))return t.state[e].toString();var n=t.getParentSize();return Number(t.state[e].toString().replace("px",""))/n[e]*100+"%"}return T(t.state[e])};return{width:e&&void 0!==e.width&&!this.state.isResizing?T(e.width):n("width"),height:e&&void 0!==e.height&&!this.state.isResizing?T(e.height):n("height")}},enumerable:!1,configurable:!0}),e.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var t=this.appendBase();if(!t)return{width:0,height:0};var e=!1,n=this.parentNode.style.flexWrap;"wrap"!==n&&(e=!0,this.parentNode.style.flexWrap="wrap"),t.style.position="relative",t.style.minWidth="100%",t.style.minHeight="100%";var i={width:t.offsetWidth,height:t.offsetHeight};return e&&(this.parentNode.style.flexWrap=n),this.removeBase(t),i},e.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},e.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},e.prototype.componentDidMount=function(){if(this.resizable&&this.window){var t=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==t.flexBasis?t.flexBasis:void 0})}},e.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},e.prototype.createSizeForCssProperty=function(t,e){var n=this.propsSize&&this.propsSize[e];return"auto"!==this.state[e]||this.state.original[e]!==t||void 0!==n&&"auto"!==n?t:"auto"},e.prototype.calculateNewMaxFromBoundary=function(t,e){var n,i,o=this.props.boundsByDirection,r=this.state.direction,s=o&&M("left",r),a=o&&M("top",r);if("parent"===this.props.bounds){var l=this.parentNode;l&&(n=s?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),i=a?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(n=s?this.resizableRight:this.window.innerWidth-this.resizableLeft,i=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(n=s?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),i=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return n&&Number.isFinite(n)&&(t=t&&t<n?t:n),i&&Number.isFinite(i)&&(e=e&&e<i?e:i),{maxWidth:t,maxHeight:e}},e.prototype.calculateNewSizeFromDirection=function(t,e){var n=this.props.scale||1,i=this.props.resizeRatio||1,o=this.state,r=o.direction,s=o.original,a=this.props,l=a.lockAspectRatio,c=a.lockAspectRatioExtraHeight,d=a.lockAspectRatioExtraWidth,p=s.width,u=s.height,h=c||0,f=d||0;return M("right",r)&&(p=s.width+(t-s.x)*i/n,l&&(u=(p-f)/this.ratio+h)),M("left",r)&&(p=s.width-(t-s.x)*i/n,l&&(u=(p-f)/this.ratio+h)),M("bottom",r)&&(u=s.height+(e-s.y)*i/n,l&&(p=(u-h)*this.ratio+f)),M("top",r)&&(u=s.height-(e-s.y)*i/n,l&&(p=(u-h)*this.ratio+f)),{newWidth:p,newHeight:u}},e.prototype.calculateNewSizeFromAspectRatio=function(t,e,n,i){var o=this.props,r=o.lockAspectRatio,s=o.lockAspectRatioExtraHeight,a=o.lockAspectRatioExtraWidth,l=void 0===i.width?10:i.width,c=void 0===n.width||n.width<0?t:n.width,d=void 0===i.height?10:i.height,p=void 0===n.height||n.height<0?e:n.height,u=s||0,h=a||0;if(r){var f=(d-u)*this.ratio+h,g=(p-u)*this.ratio+h,m=(l-h)/this.ratio+u,x=(c-h)/this.ratio+u,w=Math.max(l,f),b=Math.min(c,g),v=Math.max(d,m),y=Math.min(p,x);t=O(t,w,b),e=O(e,v,y)}else t=O(t,l,c),e=O(e,d,p);return{newWidth:t,newHeight:e}},e.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var t=this.parentNode;if(t){var e=t.getBoundingClientRect();this.parentLeft=e.left,this.parentTop=e.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var n=this.props.bounds.getBoundingClientRect();this.targetLeft=n.left,this.targetTop=n.top}if(this.resizable){var i=this.resizable.getBoundingClientRect(),o=i.left,r=i.top,s=i.right,a=i.bottom;this.resizableLeft=o,this.resizableRight=s,this.resizableTop=r,this.resizableBottom=a}},e.prototype.onResizeStart=function(t,e){if(this.resizable&&this.window){var n,i=0,o=0;if(t.nativeEvent&&function(t){return Boolean((t.clientX||0===t.clientX)&&(t.clientY||0===t.clientY))}(t.nativeEvent)?(i=t.nativeEvent.clientX,o=t.nativeEvent.clientY):t.nativeEvent&&W(t.nativeEvent)&&(i=t.nativeEvent.touches[0].clientX,o=t.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(t,e,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var r=this.window.getComputedStyle(this.resizable);if("auto"!==r.flexBasis){var s=this.parentNode;if(s){var a=this.window.getComputedStyle(s).flexDirection;this.flexDir=a.startsWith("row")?"row":"column",n=r.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:i,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:E(E({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(t.target).cursor||"auto"}),direction:e,flexBasis:n};this.setState(l)}},e.prototype.onMouseMove=function(t){var e=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&W(t))try{t.preventDefault(),t.stopPropagation()}catch(t){}var n=this.props,i=n.maxWidth,o=n.maxHeight,r=n.minWidth,s=n.minHeight,a=W(t)?t.touches[0].clientX:t.clientX,l=W(t)?t.touches[0].clientY:t.clientY,c=this.state,d=c.direction,p=c.original,u=c.width,h=c.height,f=this.getParentSize(),g=function(t,e,n,i,o,r,s){return i=A(i,t.width,e,n),o=A(o,t.height,e,n),r=A(r,t.width,e,n),s=A(s,t.height,e,n),{maxWidth:void 0===i?void 0:Number(i),maxHeight:void 0===o?void 0:Number(o),minWidth:void 0===r?void 0:Number(r),minHeight:void 0===s?void 0:Number(s)}}(f,this.window.innerWidth,this.window.innerHeight,i,o,r,s);i=g.maxWidth,o=g.maxHeight,r=g.minWidth,s=g.minHeight;var x=this.calculateNewSizeFromDirection(a,l),w=x.newHeight,b=x.newWidth,v=this.calculateNewMaxFromBoundary(i,o);this.props.snap&&this.props.snap.x&&(b=j(b,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(w=j(w,this.props.snap.y,this.props.snapGap));var y=this.calculateNewSizeFromAspectRatio(b,w,{width:v.maxWidth,height:v.maxHeight},{width:r,height:s});if(b=y.newWidth,w=y.newHeight,this.props.grid){var C=N(b,this.props.grid[0]),z=N(w,this.props.grid[1]),R=this.props.snapGap||0;b=0===R||Math.abs(C-b)<=R?C:b,w=0===R||Math.abs(z-w)<=R?z:w}var S={width:b-p.width,height:w-p.height};if(u&&"string"==typeof u)if(u.endsWith("%"))b=b/f.width*100+"%";else if(u.endsWith("vw")){b=b/this.window.innerWidth*100+"vw"}else if(u.endsWith("vh")){b=b/this.window.innerHeight*100+"vh"}if(h&&"string"==typeof h)if(h.endsWith("%"))w=w/f.height*100+"%";else if(h.endsWith("vw")){w=w/this.window.innerWidth*100+"vw"}else if(h.endsWith("vh")){w=w/this.window.innerHeight*100+"vh"}var _={width:this.createSizeForCssProperty(b,"width"),height:this.createSizeForCssProperty(w,"height")};"row"===this.flexDir?_.flexBasis=_.width:"column"===this.flexDir&&(_.flexBasis=_.height),m((function(){e.setState(_)})),this.props.onResize&&this.props.onResize(t,d,this.resizable,S)}},e.prototype.onMouseUp=function(t){var e=this.state,n=e.isResizing,i=e.direction,o=e.original;if(n&&this.resizable){var r={width:this.size.width-o.width,height:this.size.height-o.height};this.props.onResizeStop&&this.props.onResizeStop(t,i,this.resizable,r),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:E(E({},this.state.backgroundStyle),{cursor:"auto"})})}},e.prototype.updateSize=function(t){this.setState({width:t.width,height:t.height})},e.prototype.renderResizer=function(){var t=this,e=this.props,n=e.enable,i=e.handleStyles,o=e.handleClasses,r=e.handleWrapperStyle,s=e.handleWrapperClass,a=e.handleComponent;if(!n)return null;var c=Object.keys(n).map((function(e){return!1!==n[e]?l.createElement(_,{key:e,direction:e,onResizeStart:t.onResizeStart,replaceStyles:i&&i[e],className:o&&o[e]},a&&a[e]?a[e]:null):null}));return l.createElement("div",{className:s,style:r},c)},e.prototype.render=function(){var t=this,e=Object.keys(this.props).reduce((function(e,n){return-1!==B.indexOf(n)||(e[n]=t.props[n]),e}),{}),n=E(E(E({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(n.flexBasis=this.state.flexBasis);var i=this.props.as||"div";return l.createElement(i,E({ref:this.ref,style:n,className:this.props.className},e),this.state.isResizing&&l.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},e.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},e}(l.PureComponent);function I(t){return V(t)?(t.nodeName||"").toLowerCase():"#document"}function D(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function F(t){var e;return null==(e=(V(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function V(t){return t instanceof Node||t instanceof D(t).Node}function U(t){return t instanceof Element||t instanceof D(t).Element}function Z(t){return t instanceof HTMLElement||t instanceof D(t).HTMLElement}function X(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof D(t).ShadowRoot)}function Y(t){const{overflow:e,overflowX:n,overflowY:i,display:o}=K(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!["inline","contents"].includes(o)}function G(t){return["table","td","th"].includes(I(t))}function $(t){const e=q(),n=K(t);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function q(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function J(t){return["html","body","#document"].includes(I(t))}function K(t){return D(t).getComputedStyle(t)}function Q(t){return U(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function tt(t){if("html"===I(t))return t;const e=t.assignedSlot||t.parentNode||X(t)&&t.host||F(t);return X(e)?e.host:e}function et(t){const e=tt(t);return J(e)?t.ownerDocument?t.ownerDocument.body:t.body:Z(e)&&Y(e)?e:et(e)}function nt(t,e,n){var i;void 0===e&&(e=[]),void 0===n&&(n=!0);const o=et(t),r=o===(null==(i=t.ownerDocument)?void 0:i.body),s=D(o);return r?e.concat(s,s.visualViewport||[],Y(o)?o:[],s.frameElement&&n?nt(s.frameElement):[]):e.concat(o,nt(o,[],n))}const it=Math.min,ot=Math.max,rt=Math.round,st=t=>({x:t,y:t}),at={left:"right",right:"left",bottom:"top",top:"bottom"},lt={start:"end",end:"start"};function ct(t,e,n){return ot(t,it(e,n))}function dt(t,e){return"function"==typeof t?t(e):t}function pt(t){return t.split("-")[0]}function ut(t){return t.split("-")[1]}function ht(t){return"x"===t?"y":"x"}function ft(t){return"y"===t?"height":"width"}function gt(t){return["top","bottom"].includes(pt(t))?"y":"x"}function mt(t){return ht(gt(t))}function xt(t){return t.replace(/start|end/g,(t=>lt[t]))}function wt(t){return t.replace(/left|right|bottom|top/g,(t=>at[t]))}function bt(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function vt(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function yt(t,e,n){let{reference:i,floating:o}=t;const r=gt(e),s=mt(e),a=ft(s),l=pt(e),c="y"===r,d=i.x+i.width/2-o.width/2,p=i.y+i.height/2-o.height/2,u=i[a]/2-o[a]/2;let h;switch(l){case"top":h={x:d,y:i.y-o.height};break;case"bottom":h={x:d,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:p};break;case"left":h={x:i.x-o.width,y:p};break;default:h={x:i.x,y:i.y}}switch(ut(e)){case"start":h[s]-=u*(n&&c?-1:1);break;case"end":h[s]+=u*(n&&c?-1:1)}return h}async function Ct(t,e){var n;void 0===e&&(e={});const{x:i,y:o,platform:r,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:u=!1,padding:h=0}=dt(e,t),f=bt(h),g=a[u?"floating"===p?"reference":"floating":p],m=vt(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(g)))||n?g:g.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),x="floating"===p?{...s.floating,x:i,y:o}:s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),b=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},v=vt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:w,strategy:l}):x);return{top:(m.top-v.top+f.top)/b.y,bottom:(v.bottom-m.bottom+f.bottom)/b.y,left:(m.left-v.left+f.left)/b.x,right:(v.right-m.right+f.right)/b.x}}function zt(t){const e=it(...t.map((t=>t.left))),n=it(...t.map((t=>t.top)));return{x:e,y:n,width:ot(...t.map((t=>t.right)))-e,height:ot(...t.map((t=>t.bottom)))-n}}const Rt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:o,y:r,placement:s,middlewareData:a}=e,l=await async function(t,e){const{placement:n,platform:i,elements:o}=t,r=await(null==i.isRTL?void 0:i.isRTL(o.floating)),s=pt(n),a=ut(n),l="y"===gt(n),c=["left","top"].includes(s)?-1:1,d=r&&l?-1:1,p=dt(e,t);let{mainAxis:u,crossAxis:h,alignmentAxis:f}="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return a&&"number"==typeof f&&(h="end"===a?-1*f:f),l?{x:h*d,y:u*c}:{x:u*c,y:h*d}}(e,t);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(i=a.arrow)&&i.alignmentOffset?{}:{x:o+l.x,y:r+l.y,data:{...l,placement:s}}}}};function St(t){const e=K(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const o=Z(t),r=o?t.offsetWidth:n,s=o?t.offsetHeight:i,a=rt(n)!==r||rt(i)!==s;return a&&(n=r,i=s),{width:n,height:i,$:a}}function _t(t){return U(t)?t:t.contextElement}function kt(t){const e=_t(t);if(!Z(e))return st(1);const n=e.getBoundingClientRect(),{width:i,height:o,$:r}=St(e);let s=(r?rt(n.width):n.width)/i,a=(r?rt(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const Et=st(0);function Lt(t){const e=D(t);return q()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Et}function Ot(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const o=t.getBoundingClientRect(),r=_t(t);let s=st(1);e&&(i?U(i)&&(s=kt(i)):s=kt(t));const a=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==D(t))&&e}(r,n,i)?Lt(r):st(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,d=o.width/s.x,p=o.height/s.y;if(r){const t=D(r),e=i&&U(i)?D(i):i;let n=t,o=n.frameElement;for(;o&&i&&e!==n;){const t=kt(o),e=o.getBoundingClientRect(),i=K(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,s=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,d*=t.x,p*=t.y,l+=r,c+=s,n=D(o),o=n.frameElement}}return vt({width:d,height:p,x:l,y:c})}const Nt=[":popover-open",":modal"];function Mt(t){return Nt.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function Wt(t){return Ot(F(t)).left+Q(t).scrollLeft}function jt(t,e,n){let i;if("viewport"===e)i=function(t,e){const n=D(t),i=F(t),o=n.visualViewport;let r=i.clientWidth,s=i.clientHeight,a=0,l=0;if(o){r=o.width,s=o.height;const t=q();(!t||t&&"fixed"===e)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:r,height:s,x:a,y:l}}(t,n);else if("document"===e)i=function(t){const e=F(t),n=Q(t),i=t.ownerDocument.body,o=ot(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),r=ot(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let s=-n.scrollLeft+Wt(t);const a=-n.scrollTop;return"rtl"===K(i).direction&&(s+=ot(e.clientWidth,i.clientWidth)-o),{width:o,height:r,x:s,y:a}}(F(t));else if(U(e))i=function(t,e){const n=Ot(t,!0,"fixed"===e),i=n.top+t.clientTop,o=n.left+t.clientLeft,r=Z(t)?kt(t):st(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:o*r.x,y:i*r.y}}(e,n);else{const n=Lt(t);i={...e,x:e.x-n.x,y:e.y-n.y}}return vt(i)}function Tt(t,e){const n=tt(t);return!(n===e||!U(n)||J(n))&&("fixed"===K(n).position||Tt(n,e))}function At(t,e,n){const i=Z(e),o=F(e),r="fixed"===n,s=Ot(t,!0,r,e);let a={scrollLeft:0,scrollTop:0};const l=st(0);if(i||!i&&!r)if(("body"!==I(e)||Y(o))&&(a=Q(e)),i){const t=Ot(e,!0,r,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else o&&(l.x=Wt(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Bt(t,e){return Z(t)&&"fixed"!==K(t).position?e?e(t):t.offsetParent:null}function Ht(t,e){const n=D(t);if(!Z(t)||Mt(t))return n;let i=Bt(t,e);for(;i&&G(i)&&"static"===K(i).position;)i=Bt(i,e);return i&&("html"===I(i)||"body"===I(i)&&"static"===K(i).position&&!$(i))?n:i||function(t){let e=tt(t);for(;Z(e)&&!J(e);){if($(e))return e;e=tt(e)}return null}(t)||n}const Pt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t;const r="fixed"===o,s=F(i),a=!!e&&Mt(e.floating);if(i===s||a&&r)return n;let l={scrollLeft:0,scrollTop:0},c=st(1);const d=st(0),p=Z(i);if((p||!p&&!r)&&(("body"!==I(i)||Y(s))&&(l=Q(i)),Z(i))){const t=Ot(i);c=kt(i),d.x=t.x+i.clientLeft,d.y=t.y+i.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x,y:n.y*c.y-l.scrollTop*c.y+d.y}},getDocumentElement:F,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const r=[..."clippingAncestors"===n?function(t,e){const n=e.get(t);if(n)return n;let i=nt(t,[],!1).filter((t=>U(t)&&"body"!==I(t))),o=null;const r="fixed"===K(t).position;let s=r?tt(t):t;for(;U(s)&&!J(s);){const e=K(s),n=$(s);n||"fixed"!==e.position||(o=null),(r?!n&&!o:!n&&"static"===e.position&&o&&["absolute","fixed"].includes(o.position)||Y(s)&&!n&&Tt(t,s))?i=i.filter((t=>t!==s)):o=e,s=tt(s)}return e.set(t,i),i}(e,this._c):[].concat(n),i],s=r[0],a=r.reduce(((t,n)=>{const i=jt(e,n,o);return t.top=ot(i.top,t.top),t.right=it(i.right,t.right),t.bottom=it(i.bottom,t.bottom),t.left=ot(i.left,t.left),t}),jt(e,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Ht,getElementRects:async function(t){const e=this.getOffsetParent||Ht,n=this.getDimensions;return{reference:At(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,...await n(t.floating)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=St(t);return{width:e,height:n}},getScale:kt,isElement:U,isRTL:function(t){return"rtl"===K(t).direction}},It=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o}=e,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...l}=dt(t,e),c={x:n,y:i},d=await Ct(e,l),p=gt(pt(o)),u=ht(p);let h=c[u],f=c[p];if(r){const t="y"===u?"bottom":"right";h=ct(h+d["y"===u?"top":"left"],h,h-d[t])}if(s){const t="y"===p?"bottom":"right";f=ct(f+d["y"===p?"top":"left"],f,f-d[t])}const g=a.fn({...e,[u]:h,[p]:f});return{...g,data:{x:g.x-n,y:g.y-i}}}}},Dt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:o,middlewareData:r,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:u,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...m}=dt(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const x=pt(o),w=pt(a)===a,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),v=u||(w||!g?[wt(a)]:function(t){const e=wt(t);return[xt(t),e,xt(e)]}(a));u||"none"===f||v.push(...function(t,e,n,i){const o=ut(t);let r=function(t,e,n){const i=["left","right"],o=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:i:e?i:o;case"left":case"right":return e?r:s;default:return[]}}(pt(t),"start"===n,i);return o&&(r=r.map((t=>t+"-"+o)),e&&(r=r.concat(r.map(xt)))),r}(a,g,f,b));const y=[a,...v],C=await Ct(e,m),z=[];let R=(null==(i=r.flip)?void 0:i.overflows)||[];if(d&&z.push(C[x]),p){const t=function(t,e,n){void 0===n&&(n=!1);const i=ut(t),o=mt(t),r=ft(o);let s="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=wt(s)),[s,wt(s)]}(o,s,b);z.push(C[t[0]],C[t[1]])}if(R=[...R,{placement:o,overflows:z}],!z.every((t=>t<=0))){var S,_;const t=((null==(S=r.flip)?void 0:S.index)||0)+1,e=y[t];if(e)return{data:{index:t,overflows:R},reset:{placement:e}};let n=null==(_=R.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:_.placement;if(!n)switch(h){case"bestFit":{var k;const t=null==(k=R.map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:k[0];t&&(n=t);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Ft=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:i,rects:o,platform:r,strategy:s}=e,{padding:a=2,x:l,y:c}=dt(t,e),d=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(i.reference))||[]),p=function(t){const e=t.slice().sort(((t,e)=>t.y-e.y)),n=[];let i=null;for(let t=0;t<e.length;t++){const o=e[t];!i||o.y-i.y>i.height/2?n.push([o]):n[n.length-1].push(o),i=o}return n.map((t=>vt(zt(t))))}(d),u=vt(zt(d)),h=bt(a);const f=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===p.length&&p[0].left>p[1].right&&null!=l&&null!=c)return p.find((t=>l>t.left-h.left&&l<t.right+h.right&&c>t.top-h.top&&c<t.bottom+h.bottom))||u;if(p.length>=2){if("y"===gt(n)){const t=p[0],e=p[p.length-1],i="top"===pt(n),o=t.top,r=e.bottom,s=i?t.left:e.left,a=i?t.right:e.right;return{top:o,bottom:r,left:s,right:a,width:a-s,height:r-o,x:s,y:o}}const t="left"===pt(n),e=ot(...p.map((t=>t.right))),i=it(...p.map((t=>t.left))),o=p.filter((n=>t?n.left===i:n.right===e)),r=o[0].top,s=o[o.length-1].bottom;return{top:r,bottom:s,left:i,right:e,width:e-i,height:s-r,x:i,y:r}}return u}},floating:i.floating,strategy:s});return o.reference.x!==f.reference.x||o.reference.y!==f.reference.y||o.reference.width!==f.reference.width||o.reference.height!==f.reference.height?{reset:{rects:f}}:{}}}},Vt=(t,e,n)=>{const i=new Map,o={platform:Pt,...n},r={...o.platform,_c:i};return(async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:s}=n,a=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:d,y:p}=yt(c,i,l),u=i,h={},f=0;for(let n=0;n<a.length;n++){const{name:r,fn:g}=a[n],{x:m,y:x,data:w,reset:b}=await g({x:d,y:p,initialPlacement:i,placement:u,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:t,floating:e}});d=null!=m?m:d,p=null!=x?x:p,h={...h,[r]:{...h[r],...w}},b&&f<=50&&(f++,"object"==typeof b&&(b.placement&&(u=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:t,floating:e,strategy:o}):b.rects),({x:d,y:p}=yt(c,u,l))),n=-1)}return{x:d,y:p,placement:u,strategy:o,middlewareData:h}})(t,e,{...o,platform:r})};var Ut="undefined"!=typeof document?c:d;function Zt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("function"==typeof t&&t.toString()===e.toString())return!0;let n,i,o;if(t&&e&&"object"==typeof t){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(i=n;0!=i--;)if(!Zt(t[i],e[i]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(i=n;0!=i--;)if(!{}.hasOwnProperty.call(e,o[i]))return!1;for(i=n;0!=i--;){const n=o[i];if(("_owner"!==n||!t.$$typeof)&&!Zt(t[n],e[n]))return!1}return!0}return t!=t&&e!=e}function Xt(t){if("undefined"==typeof window)return 1;return(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Yt(t,e){const n=Xt(t);return Math.round(e*n)/n}function Gt(t){const e=l.useRef(t);return Ut((()=>{e.current=t})),e}
2
+ /*!
3
+ * tabbable 6.2.0
4
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
+ */
6
+ var $t=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),qt="undefined"==typeof Element,Jt=qt?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Kt=!qt&&Element.prototype.getRootNode?function(t){var e;return null==t||null===(e=t.getRootNode)||void 0===e?void 0:e.call(t)}:function(t){return null==t?void 0:t.ownerDocument},Qt=function t(e,n){var i;void 0===n&&(n=!0);var o=null==e||null===(i=e.getAttribute)||void 0===i?void 0:i.call(e,"inert");return""===o||"true"===o||n&&e&&t(e.parentNode)},te=function t(e,n,i){for(var o=[],r=Array.from(e);r.length;){var s=r.shift();if(!Qt(s,!1))if("SLOT"===s.tagName){var a=s.assignedElements(),l=t(a.length?a:s.children,!0,i);i.flatten?o.push.apply(o,l):o.push({scopeParent:s,candidates:l})}else{Jt.call(s,$t)&&i.filter(s)&&(n||!e.includes(s))&&o.push(s);var c=s.shadowRoot||"function"==typeof i.getShadowRoot&&i.getShadowRoot(s),d=!Qt(c,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(s));if(c&&d){var p=t(!0===c?s.children:c.children,!0,i);i.flatten?o.push.apply(o,p):o.push({scopeParent:s,candidates:p})}else r.unshift.apply(r,s.children)}}return o},ee=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ne=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||function(t){var e,n=null==t||null===(e=t.getAttribute)||void 0===e?void 0:e.call(t,"contenteditable");return""===n||"true"===n}(t))&&!ee(t)?0:t.tabIndex},ie=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},oe=function(t){return"INPUT"===t.tagName},re=function(t){return function(t){return oe(t)&&"radio"===t.type}(t)&&!function(t){if(!t.name)return!0;var e,n=t.form||Kt(t),i=function(t){return n.querySelectorAll('input[type="radio"][name="'+t+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)e=i(window.CSS.escape(t.name));else try{e=i(t.name)}catch(t){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",t.message),!1}var o=function(t,e){for(var n=0;n<t.length;n++)if(t[n].checked&&t[n].form===e)return t[n]}(e,t.form);return!o||o===t}(t)},se=function(t){var e=t.getBoundingClientRect(),n=e.width,i=e.height;return 0===n&&0===i},ae=function(t,e){var n=e.displayCheck,i=e.getShadowRoot;if("hidden"===getComputedStyle(t).visibility)return!0;var o=Jt.call(t,"details>summary:first-of-type")?t.parentElement:t;if(Jt.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return se(t)}else{if("function"==typeof i){for(var r=t;t;){var s=t.parentElement,a=Kt(t);if(s&&!s.shadowRoot&&!0===i(s))return se(t);t=t.assignedSlot?t.assignedSlot:s||a===t.ownerDocument?s:a.host}t=r}if(function(t){var e,n,i,o,r=t&&Kt(t),s=null===(e=r)||void 0===e?void 0:e.host,a=!1;if(r&&r!==t)for(a=!!(null!==(n=s)&&void 0!==n&&null!==(i=n.ownerDocument)&&void 0!==i&&i.contains(s)||null!=t&&null!==(o=t.ownerDocument)&&void 0!==o&&o.contains(t));!a&&s;){var l,c,d;a=!(null===(c=s=null===(l=r=Kt(s))||void 0===l?void 0:l.host)||void 0===c||null===(d=c.ownerDocument)||void 0===d||!d.contains(s))}return a}(t))return!t.getClientRects().length;if("legacy-full"!==n)return!0}return!1},le=function(t,e){return!(e.disabled||Qt(e)||function(t){return oe(t)&&"hidden"===t.type}(e)||ae(e,t)||function(t){return"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some((function(t){return"SUMMARY"===t.tagName}))}(e)||function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if("FIELDSET"===e.tagName&&e.disabled){for(var n=0;n<e.children.length;n++){var i=e.children.item(n);if("LEGEND"===i.tagName)return!!Jt.call(e,"fieldset[disabled] *")||!i.contains(t)}return!0}e=e.parentElement}return!1}(e))},ce=function(t,e){return!(re(e)||ne(e)<0||!le(t,e))},de=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},pe=function t(e){var n=[],i=[];return e.forEach((function(e,o){var r=!!e.scopeParent,s=r?e.scopeParent:e,a=function(t,e){var n=ne(t);return n<0&&e&&!ee(t)?0:n}(s,r),l=r?t(e.candidates):s;0===a?r?n.push.apply(n,l):n.push(s):i.push({documentOrder:o,tabIndex:a,item:e,isScope:r,content:l})})),i.sort(ie).reduce((function(t,e){return e.isScope?t.push.apply(t,e.content):t.push(e.content),t}),[]).concat(n)},ue=function(t,e){var n;return n=(e=e||{}).getShadowRoot?te([t],e.includeContainer,{filter:ce.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:de}):function(t,e,n){if(Qt(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll($t));return e&&Jt.call(t,$t)&&i.unshift(t),i.filter(n)}(t,e.includeContainer,ce.bind(null,e)),pe(n)};const he=l["useInsertionEffect".toString()]||(t=>t());var fe="undefined"!=typeof document?c:d;function ge(){return ge=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ge.apply(this,arguments)}let me=!1,xe=0;const we=()=>"floating-ui-"+xe++;const be=l["useId".toString()]||function(){const[t,e]=l.useState((()=>me?we():void 0));return fe((()=>{null==t&&e(we())}),[]),l.useEffect((()=>{me||(me=!0)}),[]),t};const ve=l.createContext(null),ye=l.createContext(null);function Ce(t){return"data-floating-ui-"+t}const ze=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Re(t,e){const n=ue(t,ze());"prev"===e&&n.reverse();const i=n.indexOf(function(t){let e=t.activeElement;for(;null!=(null==(n=e)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;e=e.shadowRoot.activeElement}return e}((null==(o=t)?void 0:o.ownerDocument)||document));var o;return n.slice(i+1)[0]}function Se(t,e){const n=e||t.currentTarget,i=t.relatedTarget;return!i||!function(t,e){if(!t||!e)return!1;const n=null==e.getRootNode?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&X(n)){let n=e;for(;n;){if(t===n)return!0;n=n.parentNode||n.host}}return!1}(n,i)}function _e(t){ue(t,ze()).forEach((t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}))}function ke(t){t.querySelectorAll("[data-tabindex]").forEach((t=>{const e=t.dataset.tabindex;delete t.dataset.tabindex,e?t.setAttribute("tabindex",e):t.removeAttribute("tabindex")}))}const Ee={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Le(t){"Tab"===t.key&&(t.target,clearTimeout(undefined))}const Oe=l.forwardRef((function(t,e){const[n,i]=l.useState();fe((()=>(/apple/i.test(navigator.vendor)&&i("button"),document.addEventListener("keydown",Le),()=>{document.removeEventListener("keydown",Le)})),[]);const o={ref:e,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Ce("focus-guard")]:"",style:Ee};return l.createElement("span",ge({},t,o))})),Ne=l.createContext(null),Me=Ce("portal");function We(t){let{children:e,id:n,root:i=null,preserveTabOrder:o=!0}=t;const r=function(t){let{id:e,root:n}=void 0===t?{}:t;const[i,o]=l.useState(null),r=be(),s=je(),a=l.useRef(null);return fe((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{a.current=null}))}),[i]),fe((()=>{if(a.current)return;const t=e?document.getElementById(e):null;if(!t)return;const n=document.createElement("div");n.id=r,n.setAttribute(Me,""),t.appendChild(n),a.current=n,o(n)}),[e,r]),fe((()=>{if(a.current)return;let t=n||(null==s?void 0:s.portalNode);t&&!U(t)&&(t=t.current),t=t||document.body;let i=null;e&&(i=document.createElement("div"),i.id=e,t.appendChild(i));const l=document.createElement("div");l.id=r,l.setAttribute(Me,""),t=i||t,t.appendChild(l),a.current=l,o(l)}),[e,n,r,s]),i}({id:n,root:i}),[s,a]=l.useState(null),c=l.useRef(null),d=l.useRef(null),p=l.useRef(null),u=l.useRef(null),h=!!s&&!s.modal&&s.open&&o&&!(!i&&!r);return l.useEffect((()=>{if(r&&o&&(null==s||!s.modal))return r.addEventListener("focusin",t,!0),r.addEventListener("focusout",t,!0),()=>{r.removeEventListener("focusin",t,!0),r.removeEventListener("focusout",t,!0)};function t(t){if(r&&Se(t)){("focusin"===t.type?ke:_e)(r)}}}),[r,o,null==s?void 0:s.modal]),l.createElement(Ne.Provider,{value:l.useMemo((()=>({preserveTabOrder:o,beforeOutsideRef:c,afterOutsideRef:d,beforeInsideRef:p,afterInsideRef:u,portalNode:r,setFocusManagerState:a})),[o,r])},h&&r&&l.createElement(Oe,{"data-type":"outside",ref:c,onFocus:t=>{if(Se(t,r)){var e;null==(e=p.current)||e.focus()}else{const t=Re(document.body,"prev")||(null==s?void 0:s.refs.domReference.current);null==t||t.focus()}}}),h&&r&&l.createElement("span",{"aria-owns":r.id,style:Ee}),r&&x(e,r),h&&r&&l.createElement(Oe,{"data-type":"outside",ref:d,onFocus:t=>{if(Se(t,r)){var e;null==(e=u.current)||e.focus()}else{const e=Re(document.body,"next")||(null==s?void 0:s.refs.domReference.current);null==e||e.focus(),(null==s?void 0:s.closeOnFocusOut)&&(null==s||s.onOpenChange(!1,t.nativeEvent))}}}))}const je=()=>l.useContext(Ne),Te=new Set,Ae=l.forwardRef((function(t,e){let{lockScroll:n=!1,...i}=t;const o=be();return fe((()=>{if(!n)return;Te.add(o);const t=/iP(hone|ad|od)|iOS/.test(function(){const t=navigator.userAgentData;return null!=t&&t.platform?t.platform:navigator.platform}()),e=document.body.style,i=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,s=e.left?parseFloat(e.left):window.pageXOffset,a=e.top?parseFloat(e.top):window.pageYOffset;if(e.overflow="hidden",r&&(e[i]=r+"px"),t){var l,c;const t=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(e,{position:"fixed",top:-(a-Math.floor(n))+"px",left:-(s-Math.floor(t))+"px",right:"0"})}return()=>{Te.delete(o),0===Te.size&&(Object.assign(e,{overflow:"",[i]:""}),t&&(Object.assign(e,{position:"",top:"",left:"",right:""}),window.scrollTo(s,a)))}}),[o,n]),l.createElement("div",ge({ref:e},i,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}}))}));function Be(t){var e;void 0===t&&(t={});const{open:n=!1,onOpenChange:i,nodeId:o}=t,[r,s]=l.useState(null),a=(null==(e=t.elements)?void 0:e.reference)||r,c=function(t){void 0===t&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:i=[],platform:o,elements:{reference:r,floating:s}={},transform:a=!0,whileElementsMounted:c,open:d}=t,[p,u]=l.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[h,f]=l.useState(i);Zt(h,i)||f(i);const[m,x]=l.useState(null),[w,b]=l.useState(null),v=l.useCallback((t=>{t!==R.current&&(R.current=t,x(t))}),[]),y=l.useCallback((t=>{t!==S.current&&(S.current=t,b(t))}),[]),C=r||m,z=s||w,R=l.useRef(null),S=l.useRef(null),_=l.useRef(p),k=null!=c,E=Gt(c),L=Gt(o),O=l.useCallback((()=>{if(!R.current||!S.current)return;const t={placement:e,strategy:n,middleware:h};L.current&&(t.platform=L.current),Vt(R.current,S.current,t).then((t=>{const e={...t,isPositioned:!0};N.current&&!Zt(_.current,e)&&(_.current=e,g.flushSync((()=>{u(e)})))}))}),[h,e,n,L]);Ut((()=>{!1===d&&_.current.isPositioned&&(_.current.isPositioned=!1,u((t=>({...t,isPositioned:!1}))))}),[d]);const N=l.useRef(!1);Ut((()=>(N.current=!0,()=>{N.current=!1})),[]),Ut((()=>{if(C&&(R.current=C),z&&(S.current=z),C&&z){if(E.current)return E.current(C,z,O);O()}}),[C,z,O,E,k]);const M=l.useMemo((()=>({reference:R,floating:S,setReference:v,setFloating:y})),[v,y]),W=l.useMemo((()=>({reference:C,floating:z})),[C,z]),j=l.useMemo((()=>{const t={position:n,left:0,top:0};if(!W.floating)return t;const e=Yt(W.floating,p.x),i=Yt(W.floating,p.y);return a?{...t,transform:"translate("+e+"px, "+i+"px)",...Xt(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:e,top:i}}),[n,a,W.floating,p.x,p.y]);return l.useMemo((()=>({...p,update:O,refs:M,elements:W,floatingStyles:j})),[p,O,M,W,j])}(t),d=l.useContext(ye),p=null!=((null==(u=l.useContext(ve))?void 0:u.id)||null);var u;const h=function(t){const e=l.useRef((()=>{}));return he((()=>{e.current=t})),l.useCallback((function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return null==e.current?void 0:e.current(...n)}),[])}(((t,e,n)=>{t&&(m.current.openEvent=e),x.emit("openchange",{open:t,event:e,reason:n,nested:p}),null==i||i(t,e,n)})),f=l.useRef(null),m=l.useRef({}),x=l.useState((()=>function(){const t=new Map;return{emit(e,n){var i;null==(i=t.get(e))||i.forEach((t=>t(n)))},on(e,n){t.set(e,[...t.get(e)||[],n])},off(e,n){var i;t.set(e,(null==(i=t.get(e))?void 0:i.filter((t=>t!==n)))||[])}}}()))[0],w=be(),b=l.useCallback((t=>{const e=U(t)?{getBoundingClientRect:()=>t.getBoundingClientRect(),contextElement:t}:t;c.refs.setReference(e)}),[c.refs]),v=l.useCallback((t=>{(U(t)||null===t)&&(f.current=t,s(t)),(U(c.refs.reference.current)||null===c.refs.reference.current||null!==t&&!U(t))&&c.refs.setReference(t)}),[c.refs]),y=l.useMemo((()=>({...c.refs,setReference:v,setPositionReference:b,domReference:f})),[c.refs,v,b]),C=l.useMemo((()=>({...c.elements,domReference:a})),[c.elements,a]),z=l.useMemo((()=>({...c,refs:y,elements:C,dataRef:m,nodeId:o,floatingId:w,events:x,open:n,onOpenChange:h})),[c,o,w,x,n,h,y,C]);return fe((()=>{const t=null==d?void 0:d.nodesRef.current.find((t=>t.id===o));t&&(t.context=z)})),l.useMemo((()=>({...c,context:z,refs:y,elements:C})),[c,y,C,z])}function He(t,e){if(null==t)return{};var n,i,o={},r=Object.keys(t);for(i=0;i<r.length;i++)n=r[i],e.indexOf(n)>=0||(o[n]=t[n]);return o}var Pe=["color"],Ie=p((function(t,e){var n=t.color,i=void 0===n?"currentColor":n,o=He(t,Pe);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),u("path",{d:"M7.50005 1.04999C7.74858 1.04999 7.95005 1.25146 7.95005 1.49999V8.41359L10.1819 6.18179C10.3576 6.00605 10.6425 6.00605 10.8182 6.18179C10.994 6.35753 10.994 6.64245 10.8182 6.81819L7.81825 9.81819C7.64251 9.99392 7.35759 9.99392 7.18185 9.81819L4.18185 6.81819C4.00611 6.64245 4.00611 6.35753 4.18185 6.18179C4.35759 6.00605 4.64251 6.00605 4.81825 6.18179L7.05005 8.41359V1.49999C7.05005 1.25146 7.25152 1.04999 7.50005 1.04999ZM2.5 10C2.77614 10 3 10.2239 3 10.5V12C3 12.5539 3.44565 13 3.99635 13H11.0012C11.5529 13 12 12.5528 12 12V10.5C12 10.2239 12.2239 10 12.5 10C12.7761 10 13 10.2239 13 10.5V12C13 13.1041 12.1062 14 11.0012 14H3.99635C2.89019 14 2 13.103 2 12V10.5C2 10.2239 2.22386 10 2.5 10Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),De=["color"],Fe=p((function(t,e){var n=t.color,i=void 0===n?"currentColor":n,o=He(t,De);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),u("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),Ve=["color"],Ue=p((function(t,e){var n=t.color,i=void 0===n?"currentColor":n,o=He(t,Ve);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),u("path",{d:"M7.81832 0.68179C7.64258 0.506054 7.35766 0.506054 7.18192 0.68179L5.18192 2.68179C5.00619 2.85753 5.00619 3.14245 5.18192 3.31819C5.35766 3.49392 5.64258 3.49392 5.81832 3.31819L7.05012 2.08638L7.05012 5.50023C7.05012 5.74876 7.25159 5.95023 7.50012 5.95023C7.74865 5.95023 7.95012 5.74876 7.95012 5.50023L7.95012 2.08638L9.18192 3.31819C9.35766 3.49392 9.64258 3.49392 9.81832 3.31819C9.99406 3.14245 9.99406 2.85753 9.81832 2.68179L7.81832 0.68179ZM7.95012 12.9136V9.50023C7.95012 9.2517 7.74865 9.05023 7.50012 9.05023C7.25159 9.05023 7.05012 9.2517 7.05012 9.50023V12.9136L5.81832 11.6818C5.64258 11.5061 5.35766 11.5061 5.18192 11.6818C5.00619 11.8575 5.00619 12.1424 5.18192 12.3182L7.18192 14.3182C7.26632 14.4026 7.38077 14.45 7.50012 14.45C7.61947 14.45 7.73393 14.4026 7.81832 14.3182L9.81832 12.3182C9.99406 12.1424 9.99406 11.8575 9.81832 11.6818C9.64258 11.5061 9.35766 11.5061 9.18192 11.6818L7.95012 12.9136ZM1.49994 7.00017C1.2238 7.00017 0.999939 7.22403 0.999939 7.50017C0.999939 7.77631 1.2238 8.00017 1.49994 8.00017L13.4999 8.00017C13.7761 8.00017 13.9999 7.77631 13.9999 7.50017C13.9999 7.22403 13.7761 7.00017 13.4999 7.00017L1.49994 7.00017Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),Ze=["color"],Xe=p((function(t,e){var n=t.color,i=void 0===n?"currentColor":n,o=He(t,Ze);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),u("path",{d:"M11.5 3.04999C11.7485 3.04999 11.95 3.25146 11.95 3.49999V7.49999C11.95 7.74852 11.7485 7.94999 11.5 7.94999C11.2515 7.94999 11.05 7.74852 11.05 7.49999V4.58639L4.58638 11.05H7.49999C7.74852 11.05 7.94999 11.2515 7.94999 11.5C7.94999 11.7485 7.74852 11.95 7.49999 11.95L3.49999 11.95C3.38064 11.95 3.26618 11.9026 3.18179 11.8182C3.0974 11.7338 3.04999 11.6193 3.04999 11.5L3.04999 7.49999C3.04999 7.25146 3.25146 7.04999 3.49999 7.04999C3.74852 7.04999 3.94999 7.25146 3.94999 7.49999L3.94999 10.4136L10.4136 3.94999L7.49999 3.94999C7.25146 3.94999 7.04999 3.74852 7.04999 3.49999C7.04999 3.25146 7.25146 3.04999 7.49999 3.04999L11.5 3.04999Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))})),Ye=["color"],Ge=p((function(t,e){var n=t.color,i=void 0===n?"currentColor":n,o=He(t,Ye);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:e}),u("path",{d:"M4.81812 4.68161C4.99386 4.85734 4.99386 5.14227 4.81812 5.318L3.08632 7.0498H11.9135L10.1817 5.318C10.006 5.14227 10.006 4.85734 10.1817 4.68161C10.3575 4.50587 10.6424 4.50587 10.8181 4.68161L13.3181 7.18161C13.4939 7.35734 13.4939 7.64227 13.3181 7.818L10.8181 10.318C10.6424 10.4937 10.3575 10.4937 10.1817 10.318C10.006 10.1423 10.006 9.85734 10.1817 9.68161L11.9135 7.9498H3.08632L4.81812 9.68161C4.99386 9.85734 4.99386 10.1423 4.81812 10.318C4.64239 10.4937 4.35746 10.4937 4.18173 10.318L1.68173 7.818C1.50599 7.64227 1.50599 7.35734 1.68173 7.18161L4.18173 4.68161C4.35746 4.50587 4.64239 4.50587 4.81812 4.68161Z",fill:i,fillRule:"evenodd",clipRule:"evenodd"}))}));const $e=({blockId:e,onClose:n})=>{const i=t(),[o,r]=h(""),l=0===o.length;return a("div",Object.assign({className:"cursor-pointer user-select-none transition-bg duration-20 ease-in white-space-nowrap w-full"},{children:[s("input",{type:"text",placeholder:"Paste image link",value:o,className:"items-center bg-[hsla(45,13%,94%,.6)] rounded-[4px] shadow-[inset_0_0_0_1px_hsla(0,0%,6%,.1)] cursor-text flex text-[14px] h-[32px] leading-[20px] px-[6px] relative w-full border-none",onChange:t=>r(t.target.value)}),s("button",Object.assign({type:"button",className:"user-select-none transition-bg duration-20 ease-in cursor-pointer flex items-center justify-center flex-shrink-0 white-space-nowrap h-[28px] rounded-[4px] shadow-[rgba(15,15,15,0.1)_0px_0px_0px_1px_inset,_rgba(15,15,15,0.1)_0px_1px_2px] bg-[rgb(35,131,226)] text-white fill-white leading-[1.2] px-[12px] text-[14px] font-medium w-full max-w-[300px] mx-auto m-[12px_0_6px] disabled:bg-[rgba(35,131,226,0.5)] disabled:cursor-not-allowed",disabled:l,onClick:()=>{0!==o.length&&(i.blocks.Image.updateElement(e,"image",{src:o}),n())}},{children:"Embed image"}))]}))};function qe(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 a(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,a)}l((i=i.apply(t,e||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const Je=({accept:n="image/*",onClose:i,blockId:o,onSetLoading:r})=>{const l=e("Image"),c=t();return s("div",Object.assign({className:"user-select-none transition-bg duration-20 ease-in white-space-nowrap rounded-[4px] h-[32px] px-[12px] border border-[rgba(55,53,47,0.16)] w-full cursor-pointer"},{children:a("label",Object.assign({htmlFor:"image-uploader",className:"text-[14px] leading-[1.2] font-medium cursor-pointer w-full flex items-center justify-center h-full"},{children:[s("input",{type:"file",id:"image-uploader",className:"absolute left-0 top-0 invisible",accept:(null==l?void 0:l.accept)||n,onChange:t=>{const e=t.target.files[0];e&&(t=>{qe(void 0,void 0,void 0,(function*(){if(null==l?void 0:l.onUpload){i(),r(!0);try{const e=yield null==l?void 0:l.onUpload(t);c.blocks.Image.updateElement(o,"image",{src:e.src,alt:e.alt,sizes:e.sizes,bgColor:e.bgColor,fit:"contain"})}catch(t){}finally{r(!1)}}else console.warn("onUpload not provided")}))})(e)},multiple:!1}),"Upload image"]}))}))},Ke=({floatingStyles:t,refs:e,onClose:n,blockId:i,onSetLoading:o})=>{const[r,l]=h("upload"),c=t=>l(t),d="upload"===r,p="embed"===r,u=t=>({borderBottom:t?"2px solid #2483e2":"2px solid transparent"});return s(We,Object.assign({root:document.getElementById("yoopta-editor")},{children:s(Ae,Object.assign({lockScroll:!0,className:"z-[100]",onClick:n},{children:s("div",Object.assign({ref:e.setFloating,style:t,onClick:t=>t.stopPropagation()},{children:a("div",Object.assign({className:"flex flex-col min-w-[540px] max-w-[calc(100vw-24px)] h-full max-h-[420px] bg-white shadow-[rgb(15_15_15_/5%)_0px_0px_0px_1px,_rgb(15_15_15_/10%)_0px_3px_6px,_rgb(15_15_15_/20%)_0px_9px_24px]"},{children:[a("div",Object.assign({className:"w-full flex text-[14px] p-[0_8px] shadow-[rgb(55_53_47_/9%)_0px_-1px_0px_inset] relative z-10 h-[40px]"},{children:[s("button",Object.assign({type:"button",onClick:()=>c("upload"),style:u(d),className:"py-[6px] whitespace-nowrap min-w-0 flex-shrink-0 text-[rgb(55,53,47)] relative cursor-pointer user-select-none bg-inherit transition-[height_20ms_ease-in] inline-flex items-center h-full text-[14px] leading-[1.2] px-[8px]"},{children:"Upload"})),s("button",Object.assign({type:"button",onClick:()=>c("embed"),style:u(p),className:"py-[6px] whitespace-nowrap min-w-0 flex-shrink-0 text-[rgb(55,53,47)] relative cursor-pointer user-select-none bg-inherit transition-[height_20ms_ease-in] inline-flex items-center h-full text-[14px] leading-[1.2] px-[8px]"},{children:"Image link"}))]})),a("div",Object.assign({className:"pt-[6px] pb-[6px] mt-[4px] flex justify-center mr-[12px] ml-[12px]"},{children:[p&&s($e,{onClose:n,blockId:i}),d&&s(Je,{onClose:n,blockId:i,onSetLoading:o})]}))]}))}))}))}))},Qe=({className:t,width:e,height:n,children:i})=>a("div",Object.assign({className:t},{children:[i,s("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:e,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-2 h-4 w-4 animate-spin"},{children:s("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}))]})),tn=({attributes:t,children:e,blockId:n})=>{const[i,o]=h(!1),[r,l]=h(!1),{refs:c,floatingStyles:d}=Be({placement:"bottom",open:i,onOpenChange:o,middleware:[Ft(),Dt(),It(),Rt(10)]});return a("div",Object.assign({className:"w-full user-select-none m-[20px_0_10px] relative flex"},t,{contentEditable:!1},{children:[a("button",Object.assign({className:"p-[12px_36px_12px_12px] flex items-center text-left w-full overflow-hidden rounded-[3px] text-[14px] text-[rgba(55,53,47,0.65)] relative cursor-pointer border-none bg-[#efefef] transition-[background-color_100ms_ease-in] hover:bg-[#e3e3e3]",onClick:()=>o(!0),disabled:r,ref:c.setReference},{children:[s(r?Qe:Fe,{className:"mr-2 user-select-none",width:24,height:24}),s("span",Object.assign({className:"font-medium"},{children:r?"Loading...":"Click to add image"})),r&&s("div",{className:"absolute top-0 left-0 h-full bg-[rgba(55,53,47,0.16)]",style:{width:"100%",transition:"width 100ms ease-in"}})]})),i&&s(Ke,{blockId:n,floatingStyles:d,refs:c,onClose:()=>o(!1),onSetLoading:t=>l(t)}),e]}))},{ExtendedBlockActions:en,BlockOptionsMenuGroup:nn,BlockOptionsMenuItem:on,BlockOptionsSeparator:rn}=n,sn=({editor:t,block:e,props:n})=>a(en,Object.assign({onClick:()=>t.setSelection([e.meta.order])},{children:[s(rn,{}),a(nn,{children:[s(on,{children:a("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{t.blocks.Image.updateElement(e.id,"image",{fit:"contain"})}},{children:[s(Ue,{width:16,height:16,className:"w-4 h-4 mr-2"}),"Fit"]}))}),s(on,{children:a("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{t.blocks.Image.updateElement(e.id,"image",{fit:"fill"})}},{children:[s(Ge,{width:16,height:16,className:"w-4 h-4 mr-2"}),"Fill"]}))}),s(on,{children:a("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{t.blocks.Image.updateElement(e.id,"image",{fit:"cover"})}},{children:[s(Xe,{width:16,height:16,className:"w-4 h-4 mr-2"}),"Cover"]}))})]}),s(rn,{}),s(nn,{children:s(on,{children:a("button",Object.assign({type:"button",className:"rounded-sm hover:bg-[#37352f14] leading-[120%] px-2 py-1.5 mx-[4px] cursor-pointer w-full flex justify-start",onClick:()=>{if(!n||!n.src)return;const t=document.createElement("a");t.href=n.src,t.download=n.alt||n.src,t.target="_blank",t.rel="noopener noreferrer",document.body.appendChild(t),t.click(),document.body.removeChild(t)}},{children:[s(Ie,{width:16,height:16,className:"w-4 h-4 mr-2"}),"Download"]}))})})]})),an=({position:t})=>s("div",Object.assign({contentEditable:!1,className:"absolute pointer-events-none flex items-center justify-center z-10 opacity-1 h-full w-[15px] cursor-col-resize transition-opacity duration-150 ease-in "+("left"===t?"left-0 top-0":"right-0 top-0")},{children:s("div",{className:"opacity-100 transition-opacity duration-300 ease-in rounded-[20px] bg-[rgba(15,15,15,0.6)] border border-[rgba(255,255,255,0.9)] w-[6px] h-[48px] max-h-[50%] shadow-[0_0_0_.5px_#FFF]"})})),ln=new r({type:"Image",elements:{image:{render:({element:n,attributes:r,children:l,blockId:c})=>{const{src:p,alt:u,srcSet:g,bgColor:m,fit:x,sizes:b}=n.props||{},v=i(c),y=t(),C=e("Image"),[z,R]=h({width:(null==b?void 0:b.width)||650,height:(null==b?void 0:b.height)||440});d((()=>R({width:(null==b?void 0:b.width)||650,height:(null==b?void 0:b.height)||440})),[n.props]);const S=o({blockId:c});const _=f((()=>{var t,e;return{minWidth:300,size:{width:z.width,height:z.height},maxWidth:(null===(t=null==C?void 0:C.maxSizes)||void 0===t?void 0:t.maxWidth)||800,maxHeight:(null===(e=null==C?void 0:C.maxSizes)||void 0===e?void 0:e.maxHeight)||720,lockAspectRatio:!0,resizeRatio:2,enable:{left:!0,right:!0},handleStyles:{left:{left:0},right:{right:0}},onResize:(t,e,n)=>{R({width:n.offsetWidth,height:n.offsetHeight})},onResizeStop:(t,e,n)=>{y.blocks.Image.updateElement(c,"image",{sizes:{width:n.offsetWidth,height:n.offsetHeight}})},handleComponent:{left:s(an,{position:"left"}),right:s(an,{position:"right"})}}}),[z.width,z.height]);return p?s("div",Object.assign({contentEditable:!1,draggable:!1,className:"mt-4 relative"},r,{children:a(P,Object.assign({},_,{className:"mx-auto my-0 flex"},{children:[S&&s("div",{className:"absolute pointer-events-none inset-0 bg-[rgba(35,131,226,0.14)] z-[81] rounded-[3px] opacity-100 transition-opacity duration-150 ease-in"}),s(w,{src:p,alt:u,srcSet:g,fit:x,width:null==z?void 0:z.width,bgColor:m,height:null==z?void 0:z.height}),s(sn,{block:v,editor:y,props:n.props}),l]}))})):s(tn,Object.assign({attributes:r,blockId:c},{children:l}))},props:{src:null,alt:null,srcSet:null,bgColor:null,fit:"contain",sizes:{width:650,height:500},nodeType:"void"}}},options:{displayLabel:"Image",onUpload:()=>Promise.resolve({src:null,alt:null}),accept:"image/png, image/jpeg, image/gif, image/webp",maxSizes:{maxWidth:650,maxHeight:550}}});!function(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}(".pointer-events-none{pointer-events:none}.invisible{visibility:hidden}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-\\[100\\]{z-index:100}.z-\\[81\\]{z-index:81}.m-\\[12px_0_6px\\]{margin:12px 0 6px}.m-\\[20px_0_10px\\]{margin:20px 0 10px}.mx-\\[4px\\]{margin-left:4px;margin-right:4px}.mx-auto{margin-left:auto;margin-right:auto}.my-0{margin-bottom:0;margin-top:0}.ml-\\[12px\\]{margin-left:12px}.mr-2{margin-right:.5rem}.mr-\\[12px\\]{margin-right:12px}.mt-4{margin-top:1rem}.mt-\\[4px\\]{margin-top:4px}.block{display:block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.h-4{height:1rem}.h-\\[28px\\]{height:28px}.h-\\[32px\\]{height:32px}.h-\\[40px\\]{height:40px}.h-\\[48px\\]{height:48px}.h-full{height:100%}.max-h-\\[420px\\]{max-height:420px}.max-h-\\[50\\%\\]{max-height:50%}.w-4{width:1rem}.w-\\[15px\\]{width:15px}.w-\\[6px\\]{width:6px}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\\[540px\\]{min-width:540px}.max-w-\\[300px\\]{max-width:300px}.max-w-\\[calc\\(100vw-24px\\)\\]{max-width:calc(100vw - 24px)}.flex-shrink-0{flex-shrink:0}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-col-resize{cursor:col-resize}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-sm{border-radius:.125rem}.border{border-width:1px}.border-none{border-style:none}.border-\\[rgba\\(255\\2c 255\\2c 255\\2c 0\\.9\\)\\]{border-color:hsla(0,0%,100%,.9)}.border-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.16\\)\\]{border-color:rgba(55,53,47,.16)}.bg-\\[\\#efefef\\]{--tw-bg-opacity:1;background-color:rgb(239 239 239/var(--tw-bg-opacity))}.bg-\\[hsla\\(45\\2c 13\\%\\2c 94\\%\\2c \\.6\\)\\]{background-color:hsla(45,13%,94%,.6)}.bg-\\[rgb\\(35\\2c 131\\2c 226\\)\\]{--tw-bg-opacity:1;background-color:rgb(35 131 226/var(--tw-bg-opacity))}.bg-\\[rgba\\(15\\2c 15\\2c 15\\2c 0\\.6\\)\\]{background-color:hsla(0,0%,6%,.6)}.bg-\\[rgba\\(35\\2c 131\\2c 226\\2c 0\\.14\\)\\]{background-color:rgba(35,131,226,.14)}.bg-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.16\\)\\]{background-color:rgba(55,53,47,.16)}.bg-inherit{background-color:inherit}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.fill-white{fill:#fff}.p-\\[0_8px\\]{padding:0 8px}.p-\\[12px_36px_12px_12px\\]{padding:12px 36px 12px 12px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-\\[12px\\]{padding-left:12px;padding-right:12px}.px-\\[6px\\]{padding-left:6px;padding-right:6px}.px-\\[8px\\]{padding-left:8px;padding-right:8px}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-\\[6px\\]{padding-top:6px}.pb-\\[6px\\],.py-\\[6px\\]{padding-bottom:6px}.pt-\\[6px\\]{padding-top:6px}.text-left{text-align:left}.text-\\[14px\\]{font-size:14px}.font-medium{font-weight:500}.leading-\\[1\\.2\\]{line-height:1.2}.leading-\\[120\\%\\]{line-height:120%}.leading-\\[20px\\]{line-height:20px}.text-\\[rgb\\(55\\2c 53\\2c 47\\)\\]{--tw-text-opacity:1;color:rgb(55 53 47/var(--tw-text-opacity))}.text-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.65\\)\\]{color:rgba(55,53,47,.65)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.opacity-100{opacity:1}.shadow-\\[0_0_0_\\.5px_\\#FFF\\]{--tw-shadow:0 0 0 .5px #fff;--tw-shadow-colored:0 0 0 .5px var(--tw-shadow-color)}.shadow-\\[0_0_0_\\.5px_\\#FFF\\],.shadow-\\[inset_0_0_0_1px_hsla\\(0\\2c 0\\%\\2c 6\\%\\2c \\.1\\)\\]{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-\\[inset_0_0_0_1px_hsla\\(0\\2c 0\\%\\2c 6\\%\\2c \\.1\\)\\]{--tw-shadow:inset 0 0 0 1px hsla(0,0%,6%,.1);--tw-shadow-colored:inset 0 0 0 1px var(--tw-shadow-color)}.shadow-\\[rgb\\(15_15_15_\\/5\\%\\)_0px_0px_0px_1px\\2c _rgb\\(15_15_15_\\/10\\%\\)_0px_3px_6px\\2c _rgb\\(15_15_15_\\/20\\%\\)_0px_9px_24px\\]{--tw-shadow:rgb(15 15 15/5%) 0px 0px 0px 1px,hsla(0,0%,6%,.1) 0px 3px 6px,hsla(0,0%,6%,.2) 0px 9px 24px;--tw-shadow-colored:0px 0px 0px 1px var(--tw-shadow-color),0px 3px 6px var(--tw-shadow-color),0px 9px 24px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-\\[rgb\\(55_53_47_\\/9\\%\\)_0px_-1px_0px_inset\\]{--tw-shadow:rgb(55 53 47/9%) 0px -1px 0px inset;--tw-shadow-colored:inset 0px -1px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-\\[rgba\\(15\\2c 15\\2c 15\\2c 0\\.1\\)_0px_0px_0px_1px_inset\\2c _rgba\\(15\\2c 15\\2c 15\\2c 0\\.1\\)_0px_1px_2px\\]{--tw-shadow:hsla(0,0%,6%,.1) 0px 0px 0px 1px inset,hsla(0,0%,6%,.1) 0px 1px 2px;--tw-shadow-colored:inset 0px 0px 0px 1px var(--tw-shadow-color),0px 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\\[background-color_100ms_ease-in\\]{transition-duration:.15s;transition-property:background-color .1s ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\\[height_20ms_ease-in\\]{transition-duration:.15s;transition-property:height 20ms ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,.transition-opacity{transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.hover\\:bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.hover\\:bg-\\[\\#e3e3e3\\]:hover{--tw-bg-opacity:1;background-color:rgb(227 227 227/var(--tw-bg-opacity))}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-\\[rgba\\(35\\2c 131\\2c 226\\2c 0\\.5\\)\\]:disabled{background-color:rgba(35,131,226,.5)}");export{ln as default};
@@ -0,0 +1,3 @@
1
+ declare const Image: any;
2
+ export { Image };
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,KAAK,KA0BT,CAAC;AAEH,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { type SlateElement } from '@yoopta/editor';
2
+ export type ImageSizes = {
3
+ width: number;
4
+ height: number;
5
+ };
6
+ export type ImageElementProps = {
7
+ src?: string | null;
8
+ alt?: string | null;
9
+ srcSet?: string | null;
10
+ bgColor?: string | null;
11
+ fit?: 'contain' | 'cover' | 'fill' | null;
12
+ sizes?: ImageSizes;
13
+ };
14
+ export type ImagePluginElements = 'image';
15
+ export type ImageElement = SlateElement<'image', ImageElementProps>;
16
+ export type onUploadResponse = Omit<ImageElementProps, 'fit' | 'srcSet'>;
17
+ export type ImageOptimizationFields = {
18
+ deviceSizes?: number[];
19
+ provider?: 'imgix' | 'cloudinary' | 'akamai';
20
+ };
21
+ export type ImagePluginOptions = {
22
+ onUpload: (file: File) => Promise<onUploadResponse>;
23
+ accept?: string;
24
+ optimizations?: ImageOptimizationFields;
25
+ maxSizes?: {
26
+ maxWidth?: number;
27
+ maxHeight?: number;
28
+ };
29
+ };
30
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +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,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,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,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,EAAE,KAAK,GAAG,QAAQ,CAAC,CAAC;AAEzE,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,GAAG,YAAY,GAAG,QAAQ,CAAC;CAC9C,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,uBAAuB,CAAC;IACxC,QAAQ,CAAC,EAAE;QACT,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ declare const EmbedUploader: ({ blockId, onClose }: {
3
+ blockId: any;
4
+ onClose: any;
5
+ }) => JSX.Element;
6
+ export { EmbedUploader };
7
+ //# sourceMappingURL=EmbedUploader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmbedUploader.d.ts","sourceRoot":"","sources":["../../src/ui/EmbedUploader.tsx"],"names":[],"mappings":";AAGA,QAAA,MAAM,aAAa;;;iBAqClB,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ type Props = {
3
+ onClose: () => void;
4
+ blockId: string;
5
+ accept?: string;
6
+ onSetLoading: (_s: boolean) => void;
7
+ };
8
+ declare const FileUploader: ({ accept, onClose, blockId, onSetLoading }: Props) => JSX.Element;
9
+ export { FileUploader };
10
+ //# sourceMappingURL=FileUploader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileUploader.d.ts","sourceRoot":"","sources":["../../src/ui/FileUploader.tsx"],"names":[],"mappings":";AAGA,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF,QAAA,MAAM,YAAY,+CAA4D,KAAK,gBAmDlF,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { ImagePluginOptions } from '../types';
3
+ declare const ImageRender: ({ element, attributes, children, blockId }: PluginElementRenderProps<ImagePluginOptions>) => JSX.Element;
4
+ export { ImageRender };
5
+ //# sourceMappingURL=Image.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../src/ui/Image.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAI9C,QAAA,MAAM,WAAW,2GAmFhB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { YooEditor, YooptaBlockData } from '@yoopta/editor';
3
+ import { ImageElementProps } from '../types';
4
+ type Props = {
5
+ editor: YooEditor;
6
+ block: YooptaBlockData;
7
+ props?: ImageElementProps;
8
+ };
9
+ declare const ImageBlockOptions: ({ editor, block, props: imageProps }: Props) => JSX.Element;
10
+ export { ImageBlockOptions };
11
+ //# sourceMappingURL=ImageBlockOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageBlockOptions.d.ts","sourceRoot":"","sources":["../../src/ui/ImageBlockOptions.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAuB,MAAM,UAAU,CAAC;AAIlE,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,iBAAiB,CAAC;CAC3B,CAAC;AAEF,QAAA,MAAM,iBAAiB,yCAA0C,KAAK,gBAyFrE,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { ImageElementProps } from '../types';
3
+ type ImageComponentProps = Omit<ImageElementProps, 'sizes'> & {
4
+ width: number;
5
+ height: number;
6
+ layout?: Layout;
7
+ };
8
+ type Layout = 'fill' | 'responsive' | 'intrinsic' | 'fixed';
9
+ declare const ImageComponent: ({ width, height, src, alt, fit, bgColor, layout }: ImageComponentProps) => JSX.Element;
10
+ export { ImageComponent, ImageComponentProps };
11
+ //# sourceMappingURL=ImageComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageComponent.d.ts","sourceRoot":"","sources":["../../src/ui/ImageComponent.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,KAAK,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,CAAC,GAAG;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,WAAW,GAAG,OAAO,CAAC;AAE5D,QAAA,MAAM,cAAc,sDAAqE,mBAAmB,gBAsC3G,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { CSSProperties } from 'react';
2
+ type Props = {
3
+ floatingStyles: CSSProperties;
4
+ refs: any;
5
+ blockId: string;
6
+ onClose: () => void;
7
+ onSetLoading: (_s: boolean) => void;
8
+ };
9
+ declare const ImageUploader: ({ floatingStyles, refs, onClose, blockId, onSetLoading }: Props) => JSX.Element;
10
+ export { ImageUploader };
11
+ //# sourceMappingURL=ImageUploader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageUploader.d.ts","sourceRoot":"","sources":["../../src/ui/ImageUploader.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;AAIhD,KAAK,KAAK,GAAG;IACX,cAAc,EAAE,aAAa,CAAC;IAC9B,IAAI,EAAE,GAAG,CAAC;IACV,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;CACrC,CAAC;AAIF,QAAA,MAAM,aAAa,6DAA8D,KAAK,gBA8CrF,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ className?: string;
4
+ children?: ReactNode;
5
+ width?: number;
6
+ height?: number;
7
+ };
8
+ declare const Loader: ({ className, width, height, children }: Props) => JSX.Element;
9
+ export { Loader };
10
+ //# sourceMappingURL=Loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Loader.d.ts","sourceRoot":"","sources":["../../src/ui/Loader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,KAAK,KAAK,GAAG;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,QAAA,MAAM,MAAM,2CAA4C,KAAK,gBAoB5D,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ declare const Placeholder: ({ attributes, children, blockId }: {
3
+ attributes: any;
4
+ children: any;
5
+ blockId: any;
6
+ }) => JSX.Element;
7
+ export { Placeholder };
8
+ //# sourceMappingURL=Placeholder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Placeholder.d.ts","sourceRoot":"","sources":["../../src/ui/Placeholder.tsx"],"names":[],"mappings":";AAMA,QAAA,MAAM,WAAW;;;;iBA8ChB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare const Resizer: ({ position }: {
3
+ position: any;
4
+ }) => JSX.Element;
5
+ export { Resizer };
6
+ //# sourceMappingURL=Resizer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Resizer.d.ts","sourceRoot":"","sources":["../../src/ui/Resizer.tsx"],"names":[],"mappings":";AAAA,QAAA,MAAM,OAAO;;iBASZ,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yoopta/image",
3
- "version": "2.0.0",
3
+ "version": "4.0.0-rc.0",
4
4
  "description": "> TODO: description",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
@@ -14,7 +14,7 @@
14
14
  "dist/"
15
15
  ],
16
16
  "peerDependencies": {
17
- "@yoopta/editor": ">=1.9.18-rc",
17
+ "@yoopta/editor": "=>4.0.0-rc.0",
18
18
  "react": ">=17.0.2",
19
19
  "react-dom": ">=17.0.2",
20
20
  "slate": ">=0.72.3",
@@ -28,13 +28,17 @@
28
28
  "url": "git+https://github.com/Darginec05/Editor-Yoopta.git"
29
29
  },
30
30
  "scripts": {
31
- "test": "node ./__tests__/yoopta-code.test.js"
31
+ "test": "node ./__tests__/yoopta-image.test.js",
32
+ "start": "rollup --config rollup.config.js --watch --bundleConfigAsCjs --environment NODE_ENV:development",
33
+ "build": "rollup --config rollup.config.js --bundleConfigAsCjs --environment NODE_ENV:production",
34
+ "publish": "yarn build && npm publish --access public"
32
35
  },
33
36
  "bugs": {
34
37
  "url": "https://github.com/Darginec05/Editor-Yoopta/issues"
35
38
  },
36
39
  "dependencies": {
37
- "body-scroll-lock": "^4.0.0-beta.0",
38
- "re-resizable": "^6.9.9"
40
+ "@floating-ui/react": "^0.26.9",
41
+ "@radix-ui/react-icons": "^1.3.0",
42
+ "re-resizable": "^6.9.11"
39
43
  }
40
- }
44
+ }