@yoopta/file 2.0.1 → 4.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023-present Akhmed Ibragimov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
- # `@yoopta/code`
1
+ # `yoopta-file`
2
2
 
3
3
  > TODO: description
4
4
 
5
5
  ## Usage
6
6
 
7
7
  ```
8
- const blockquote = require('@yoopta/code');
8
+ const file = require('yoopta-file');
9
9
 
10
10
  // TODO: DEMONSTRATE API
11
11
  ```
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
- import { YooEditor } from '@yoopta/editor';
2
- import { FileElement, FileElementData, FilePluginOptions } from './types';
1
+ import { File } from './plugin';
2
+ import { FileElement } from './types';
3
+ import './styles.css';
3
4
  declare module 'slate' {
4
5
  interface CustomTypes {
5
- Editor: YooEditor;
6
6
  Element: FileElement;
7
7
  }
8
8
  }
9
- declare const File: import("@yoopta/editor").YooptaPlugin<FilePluginOptions, FileElement>;
10
9
  export default File;
11
- export { FileElement, FileElementData, FilePluginOptions };
10
+ export { FileElement };
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,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,cAAc,CAAC;AAEtB,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAU,WAAW;QACnB,OAAO,EAAE,WAAW,CAAC;KACtB;CACF;AAED,eAAe,IAAI,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,CAAC"}
package/dist/index.js CHANGED
@@ -1 +1,6 @@
1
- import{getElementClassname as e,UI_HELPERS as t,cx as n,createYooptaPlugin as o,getElementByPath as i,generateId as r}from"@yoopta/editor";import{Transforms as a,Element as s}from"slate";import{jsx as l,jsxs as d}from"react/jsx-runtime";import*as c from"react";import{useState as p,useRef as u}from"react";import{ReactEditor as h,useSelected as g,useReadOnly as m}from"slate-react";var f;function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},v.apply(this,arguments)}var b=function(e){return c.createElement("svg",v({viewBox:"0 0 16 16"},e),f||(f=c.createElement("path",{d:"M4.356 15.468h7.28c1.464 0 2.222-.773 2.222-2.242v-6.2c0-.95-.123-1.388-.717-1.99l-3.59-3.65C8.979.805 8.507.668 7.652.668H4.356c-1.462 0-2.221.772-2.221 2.242v10.316c0 1.476.759 2.242 2.221 2.242Zm.11-1.34c-.663 0-.991-.349-.991-.984V2.992c0-.629.328-.984.99-.984h2.913v3.746c0 .977.485 1.45 1.456 1.45h3.685v5.94c0 .635-.335.984-.998.984H4.466Zm4.491-8.1c-.28 0-.396-.124-.396-.404V2.192l3.773 3.835H8.957Zm-.362 6.699v-2.1L8.54 9.563l.526.553.527.533a.531.531 0 0 0 .396.185c.308 0 .54-.219.54-.526a.49.49 0 0 0-.191-.404L8.45 8.167c-.157-.144-.287-.205-.458-.205-.164 0-.294.061-.451.205L5.655 9.903a.49.49 0 0 0-.191.404c0 .307.225.526.54.526a.543.543 0 0 0 .396-.185l.527-.533.526-.553-.055 1.066v2.099c0 .328.274.574.595.574.328 0 .602-.246.602-.574Z"})))};function y(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var w="eCBVJfAM",x="_1jrGaPHJ",j="_3xzPD4wO",O="_3jw0sAIy",N="gIQQGHaD";function P(e){if("number"!=typeof e||isNaN(e))return null;return(e/1024).toFixed(2)+" KB"}y(".eCBVJfAM{align-items:center;display:flex;justify-content:flex-start;margin:10px 0;position:relative;transition:background .1s cubic-bezier(.4,0,.2,1)}._1jrGaPHJ{border-radius:1px;color:inherit;max-width:100%;object-fit:cover;padding:6px 4px;pointer-events:auto;text-decoration:none;width:100%}._1jrGaPHJ:hover{background:rgba(35,131,226,.14)}._3xzPD4wO{display:flex}._3xzPD4wO svg{min-height:20px;min-width:20px}._3jw0sAIy{align-items:center;display:flex;font-weight:600;line-height:18px;margin-left:6px;overflow:hidden;text-overflow:ellipsis;white-space:pre-line}.gIQQGHaD{color:#8e8e93;font-size:12px;margin-left:10px}");function E(e,t,n,o){return new(n||(n=Promise))((function(i,r){function a(e){try{l(o.next(e))}catch(e){r(e)}}function s(e){try{l(o.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((o=o.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;var k="_83eU-j-s",C="_6CLndPnr",H="_7JqczNzX",z="sYo42svD",D="d7kPuF2M",T="_3Hw9hXef",B="PFlyte3h",_="MIwvxioK",A="WBUFnuEP";y('._83eU-j-s{position:fixed}._6CLndPnr{background:#fff;box-shadow:0 0 0 1px hsla(0,0%,6%,.05),0 3px 6px hsla(0,0%,6%,.1),0 9px 24px hsla(0,0%,6%,.2);display:flex;flex-direction:column;height:100%;max-height:420px;max-width:calc(100vw - 24px);min-width:540px}._7JqczNzX{box-shadow:inset 0 -1px 0 rgba(55,53,47,.09);display:flex;height:40px;padding:0 8px;width:100%;z-index:1}._7JqczNzX,.sYo42svD{font-size:14px;position:relative}.sYo42svD{align-items:center;background-color:inherit;border:none;border-radius:4px;color:#37352f;cursor:pointer;display:inline-flex;flex-shrink:0;height:100%;line-height:1.2;min-width:0;padding:6px 8px;transition:height 20ms ease-in 0s;user-select:none;white-space:nowrap}.d7kPuF2M:after{background-color:#37352f;bottom:0;content:"";height:2px;left:0;position:absolute;width:100%}._3Hw9hXef{display:flex;justify-content:center;margin-left:12px;margin-right:12px;margin-top:4px;padding-bottom:6px;padding-top:6px}.PFlyte3h{border:1px solid rgba(55,53,47,.16);border-radius:4px;cursor:pointer;height:32px;padding-left:12px;padding-right:12px;transition:background 20ms ease-in 0s;user-select:none;white-space:nowrap;width:100%}.ciBcVyws{border:none!important;cursor:pointer!important;height:auto!important;padding-left:0!important;padding-right:0!important}.MIwvxioK{align-items:center;cursor:pointer;display:inline-flex;font-size:14px;font-weight:500;height:100%;justify-content:center;line-height:1.2;width:100%}.WBUFnuEP{left:0;position:absolute;top:0;visibility:hidden}.P5wQ7tuy{background:hsla(45,13%,94%,.6);box-shadow:inset 0 0 0 1px hsla(0,0%,6%,.1);cursor:text;height:32px;line-height:20px;padding:3px 6px;position:relative}.P5wQ7tuy,.RywjmYhg{align-items:center;border:none;border-radius:4px;display:flex;font-size:14px;width:100%}.RywjmYhg{fill:#fff;background:#2383e2;box-shadow:inset 0 0 0 1px hsla(0,0%,6%,.1),0 1px 2px hsla(0,0%,6%,.1);color:#fff;cursor:pointer;flex-shrink:0;font-weight:500;height:28px;justify-content:center;line-height:1.2;margin:12px auto 6px;max-width:300px;padding-left:12px;padding-right:12px;transition:background 20ms ease-in 0s;user-select:none;white-space:nowrap}');const M=({onChange:e,accept:t="file/*"})=>l("div",Object.assign({className:B},{children:d("label",Object.assign({htmlFor:"file-uploader",className:_},{children:[l("input",{type:"file",id:"file-uploader",className:A,accept:t,onChange:t=>{const n=t.currentTarget.files;n&&n.length>0&&e(n[0])},multiple:!1}),"Upload file"]}))})),S=({activeTab:e="upload",style:o,switchTab:i,onChange:r,accept:a,onClose:s})=>{const c="upload"===e;return l(t.Overlay,Object.assign({onClose:s},{children:l("div",Object.assign({className:k,style:o},{children:d("div",Object.assign({className:C},{children:[l("div",Object.assign({className:H},{children:l("button",Object.assign({type:"button",onClick:()=>i("upload"),className:n(z,{[D]:c})},{children:"Upload"}))})),l("div",Object.assign({className:T},{children:c&&l(M,{onChange:r,accept:a})}))]}))}))}))};var F=!1;if("undefined"!=typeof window){var I={get passive(){F=!0}};window.addEventListener("testPassive",null,I),window.removeEventListener("testPassive",null,I)}var Y="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),L=[],W=!1,U=-1,G=void 0,J=void 0,Q=void 0,V=function(e){return L.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))},X=function(e){var t=e||window.event;return!!V(t.target)||(t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1))},K=function(e,t){if(e){if(!L.some((function(t){return t.targetElement===e}))){var n={targetElement:e,options:t||{}};L=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(L),[n]),Y?window.requestAnimationFrame((function(){if(void 0===J){J={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left};var e=window,t=e.scrollY,n=e.scrollX,o=e.innerHeight;document.body.style.position="fixed",document.body.style.top=-t,document.body.style.left=-n,setTimeout((function(){return window.requestAnimationFrame((function(){var e=o-window.innerHeight;e&&t>=o&&(document.body.style.top=-(t+e))}))}),300)}})):function(e){if(void 0===Q){var t=!!e&&!0===e.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;if(t&&n>0){var o=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);Q=document.body.style.paddingRight,document.body.style.paddingRight=o+n+"px"}}void 0===G&&(G=document.body.style.overflow,document.body.style.overflow="hidden")}(t),Y&&(e.ontouchstart=function(e){1===e.targetTouches.length&&(U=e.targetTouches[0].clientY)},e.ontouchmove=function(t){1===t.targetTouches.length&&function(e,t){var n=e.targetTouches[0].clientY-U;!V(e.target)&&(t&&0===t.scrollTop&&n>0||function(e){return!!e&&e.scrollHeight-e.scrollTop<=e.clientHeight}(t)&&n<0?X(e):e.stopPropagation())}(t,e)},W||(document.addEventListener("touchmove",X,F?{passive:!1}:void 0),W=!0))}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")},R=function(e){e?(L=L.filter((function(t){return t.targetElement!==e})),Y&&(e.ontouchstart=null,e.ontouchmove=null,W&&0===L.length&&(document.removeEventListener("touchmove",X,F?{passive:!1}:void 0),W=!1)),Y?function(){if(void 0!==J){var e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);document.body.style.position=J.position,document.body.style.top=J.top,document.body.style.left=J.left,window.scrollTo(t,e),J=void 0}}():(void 0!==Q&&(document.body.style.paddingRight=Q,Q=void 0),void 0!==G&&(document.body.style.overflow=G,G=void 0))):console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.")},Z="MwDZgdnr",q="o-YPlsho",$="HbsQ6aF6";y(".MwDZgdnr{margin:20px 0 10px;user-select:none}.MwDZgdnr,.o-YPlsho{position:relative;width:100%}.o-YPlsho{align-items:center;background-color:#efefef;border:none;border-radius:3px;color:rgba(55,53,47,.65);cursor:pointer;display:flex;font-size:14px;overflow:hidden;padding:12px 36px 12px 12px;text-align:left;transition:background-color .1s ease-in}.o-YPlsho:hover{background-color:#e3e3e3}.HbsQ6aF6{margin-right:8px;user-select:none}");const ee=({element:e,accept:t,attributes:n,children:o,editor:i,onUpload:r})=>{const[c,g]=p(null),[m,f]=p("upload"),v=u(null),y=e=>{var t;if(e.stopPropagation(),null!==c)return R(document.body),void g(null);const n=null===(t=v.current)||void 0===t?void 0:t.getBoundingClientRect();if(n){const e=n.top+n.height+88+20>window.innerHeight,t=!e;console.log({showAtTop:e,showAtBottom:t}),K(document.body,{reserveScrollBarGap:!0}),g({left:n.left,top:e?n.top-88-5:n.top+n.height+5})}};return d("div",Object.assign({className:Z},n,{contentEditable:!1},{children:[d("div",Object.assign({ref:v},{children:[d("button",Object.assign({className:q,onClick:y},{children:[l(b,{className:$,width:24,height:24}),l("span",{children:"Click to add file"})]})),null!==c&&l(S,{onChange:t=>E(void 0,void 0,void 0,(function*(){R(document.body),g(null);const n={data:Object.assign(Object.assign({},e.data),{name:t.name,size:t.size,"data-url":t.name})};if(a.setNodes(i,n,{at:h.findPath(i,e),match:e=>s.isElement(e)&&"file"===e.type}),!r)return console.error("Provide `onUpload` handler in File options");const o=yield r(t),l={data:Object.assign(Object.assign({},e.data),{url:o.url,size:t.size,name:t.name,"data-url":void 0})};a.setNodes(i,l,{at:h.findPath(i,e),match:e=>s.isElement(e)&&"file"===e.type})})),onClose:y,activeTab:m,switchTab:e=>f(e),style:c,accept:t})]})),o]}))};var te={root:"r29Aw2Hb",dotsOptions:"jgDPzrdW",dot:"Dmm1WXgb",loadingState:"fyMnhKHH"};y(".r29Aw2Hb{cursor:pointer;display:block;position:relative}.r29Aw2Hb:hover .jgDPzrdW{opacity:1}.jgDPzrdW{align-items:center;background-color:#eee;border:none;border-radius:2px;cursor:pointer;display:flex;height:22px;justify-content:space-between;opacity:0;padding:0 4px;position:absolute;right:10px;top:50%;transform:translateY(-50%);transition:opacity .15s ease-in 0s;width:22px;z-index:1}.Dmm1WXgb{background-color:gray;border-radius:50%;min-height:3px;min-width:3px}.fyMnhKHH{cursor:wait}.fyMnhKHH a{background:rgba(35,131,226,.14);cursor:inherit;opacity:.6;pointer-events:none}");function ne(e){var o,i;const{element:r,editor:a,plugin:s}=e,c=g(),u=m(),[h,f]=p(null),v=!!r.data["data-url"]&&!r.data.url,b=()=>{R(document.body),f(null)},y=e=>{var t;if(null==e||e.stopPropagation(),null!==h)return b();const n=null===(t=null==e?void 0:e.currentTarget)||void 0===t?void 0:t.getBoundingClientRect();if(n){const e=n.top+n.height+164+20>window.innerHeight;K(document.body,{reserveScrollBarGap:!0}),f({left:n.right-n.width+265>window.innerWidth?window.innerWidth-265-n.width:n.right-n.width,top:e?n.top-82-n.height:n.top+n.height+5})}};return null!==r.data.url||v?d("div",Object.assign({contentEditable:!1,draggable:!1,className:n(te.root,{[te.loadingState]:v})},{children:[s.renderer.render(e),!u&&!v&&d("div",{children:[d("button",Object.assign({type:"button",className:te.dotsOptions,onClick:y},{children:[l("span",{className:te.dot}),l("span",{className:te.dot}),l("span",{className:te.dot})]})),null!==h&&l(t.ElementOptions,{onClose:b,style:h,element:r,onCopy:b,onDelete:b,onDuplicate:b},r.id)]})]}),r.id):d("div",Object.assign({className:te.root,contentEditable:!1,draggable:!1},{children:[l("div",{className:n(te.selectImg,{[te.selected]:c})}),l(ee,Object.assign({attributes:e.attributes,element:r,editor:a,onUpload:null===(o=s.options)||void 0===o?void 0:o.onUpload,accept:null===(i=s.options)||void 0===i?void 0:i.accept},{children:!u&&d("div",{children:[d("button",Object.assign({type:"button",className:te.dotsOptions,onClick:y},{children:[l("span",{className:te.dot}),l("span",{className:te.dot}),l("span",{className:te.dot})]})),null!==h&&l(t.ElementOptions,{onClose:b,style:h,element:r,onCopy:b,onDelete:b,onDuplicate:b},r.id)]})})),e.children]}),r.id)}const oe=o({type:"file",shortcut:"file",renderer:{editor:(e,t)=>n=>l(ne,Object.assign({editor:e,plugin:t},n)),render:({attributes:t,element:n,children:o,HTMLAttributes:i})=>n.data.url||n.data["data-url"]?d("div",Object.assign({},t,{className:w,contentEditable:!1,draggable:!1},{children:[l("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:n.data.url,className:e({element:n,HTMLAttributes:i,className:x})},{children:d("div",Object.assign({className:j},{children:[l(b,{height:20,width:20}),d("div",Object.assign({className:O},{children:[n.data.name,l("span",Object.assign({className:N},{children:P(n.data.size)}))]}))]}))})),o]})):l("div",Object.assign({},t))},extendEditor(e){const{isVoid:t}=e;return e.isVoid=e=>e.type===oe.getPlugin.type||t(e),e},events:{onKeyDown:(e,{defaultNode:t,hotkeys:n})=>o=>{var r;if("file"===i(e,null===(r=e.selection)||void 0===r?void 0:r.anchor.path,"highest").type&&e.selection)return n.isEnter(o)?(o.preventDefault(),void a.insertNodes(e,t,{mode:"highest"})):void 0}},defineElement:()=>({id:r(),type:"file",nodeType:"void",data:{url:null,name:"",size:0},children:[{text:""}]}),createElement:(e,t)=>{var n;const o=Object.assign(Object.assign({},oe.getPlugin.defineElement()),t);a.setNodes(e,o,{at:null===(n=e.selection)||void 0===n?void 0:n.anchor})},exports:{markdown:{serialize:(e,t)=>`![${e.data.name||""}](${e.data.url})\n`},html:{serialize:(e,t)=>`<div><a href="${e.data.url}" target="_blank" rel="noopener noreferrer">${e.data.name}</a></div>`}},options:{searchString:"file url",displayLabel:"File"}});export{oe as default};
1
+ import{useYooptaPluginOptions as e,useYooptaEditor as t,UI as o,useBlockData as n,useYooptaReadOnly as i,useBlockSelected as r,YooptaPlugin as l}from"@yoopta/editor";import{jsx as a,jsxs as f}from"react/jsx-runtime";import*as s from"react";import{forwardRef as c,createElement as u,useLayoutEffect as d,useEffect as p,useState as y}from"react";import*as m from"react-dom";import{createPortal as g}from"react-dom";function h(e,t){if(null==e)return{};var o,n,i={},r=Object.keys(e);for(n=0;n<r.length;n++)o=r[n],t.indexOf(o)>=0||(i[o]=e[o]);return i}var x=["color"],b=c((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,i=h(e,x);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),u("path",{d:"M3 2C2.44772 2 2 2.44772 2 3V12C2 12.5523 2.44772 13 3 13H12C12.5523 13 13 12.5523 13 12V8.5C13 8.22386 12.7761 8 12.5 8C12.2239 8 12 8.22386 12 8.5V12H3V3L6.5 3C6.77614 3 7 2.77614 7 2.5C7 2.22386 6.77614 2 6.5 2H3ZM12.8536 2.14645C12.9015 2.19439 12.9377 2.24964 12.9621 2.30861C12.9861 2.36669 12.9996 2.4303 13 2.497L13 2.5V2.50049V5.5C13 5.77614 12.7761 6 12.5 6C12.2239 6 12 5.77614 12 5.5V3.70711L6.85355 8.85355C6.65829 9.04882 6.34171 9.04882 6.14645 8.85355C5.95118 8.65829 5.95118 8.34171 6.14645 8.14645L11.2929 3H9.5C9.22386 3 9 2.77614 9 2.5C9 2.22386 9.22386 2 9.5 2H12.4999H12.5C12.5678 2 12.6324 2.01349 12.6914 2.03794C12.7504 2.06234 12.8056 2.09851 12.8536 2.14645Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),v=["color"],w=c((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,i=h(e,v);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),u("path",{d:"M3.5 2C3.22386 2 3 2.22386 3 2.5V12.5C3 12.7761 3.22386 13 3.5 13H11.5C11.7761 13 12 12.7761 12 12.5V6H8.5C8.22386 6 8 5.77614 8 5.5V2H3.5ZM9 2.70711L11.2929 5H9V2.70711ZM2 2.5C2 1.67157 2.67157 1 3.5 1H8.5C8.63261 1 8.75979 1.05268 8.85355 1.14645L12.8536 5.14645C12.9473 5.24021 13 5.36739 13 5.5V12.5C13 13.3284 12.3284 14 11.5 14H3.5C2.67157 14 2 13.3284 2 12.5V2.5Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))})),C=["color"],R=c((function(e,t){var o=e.color,n=void 0===o?"currentColor":o,i=h(e,C);return u("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),u("path",{d:"M3 2.5C3 2.22386 3.22386 2 3.5 2H9.08579C9.21839 2 9.34557 2.05268 9.43934 2.14645L11.8536 4.56066C11.9473 4.65443 12 4.78161 12 4.91421V12.5C12 12.7761 11.7761 13 11.5 13H3.5C3.22386 13 3 12.7761 3 12.5V2.5ZM3.5 1C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H11.5C12.3284 14 13 13.3284 13 12.5V4.91421C13 4.51639 12.842 4.13486 12.5607 3.85355L10.1464 1.43934C9.86514 1.15804 9.48361 1 9.08579 1H3.5ZM4.5 4C4.22386 4 4 4.22386 4 4.5C4 4.77614 4.22386 5 4.5 5H7.5C7.77614 5 8 4.77614 8 4.5C8 4.22386 7.77614 4 7.5 4H4.5ZM4.5 7C4.22386 7 4 7.22386 4 7.5C4 7.77614 4.22386 8 4.5 8H10.5C10.7761 8 11 7.77614 11 7.5C11 7.22386 10.7761 7 10.5 7H4.5ZM4.5 10C4.22386 10 4 10.2239 4 10.5C4 10.7761 4.22386 11 4.5 11H10.5C10.7761 11 11 10.7761 11 10.5C11 10.2239 10.7761 10 10.5 10H4.5Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"}))}));function E(e){if("number"!=typeof e||isNaN(e))return null;return(e/1024).toFixed(2)+" KB"}const S=({name:e,src:t,size:o,format:n})=>{if(!t)return null;return a("div",Object.assign({className:"yoo-file-w-full yoo-file-cursor-pointer",contentEditable:!1,onClick:e=>{t&&(e.preventDefault(),e.stopPropagation(),window.open(t,"_blank"))}},{children:f("div",Object.assign({className:"yoo-file-flex yoo-file-items-center yoo-file-rounded-[4px] yoo-file-py-[8px] yoo-file-px-2 hover:yoo-file-bg-[rgba(55,53,47,0.04)] yoo-file-border-b-[1px] hover:yoo-file-border-[rgba(55,53,47,0.16)] yoo-file-border-[transparent]"},{children:[f("div",Object.assign({className:"yoo-file-flex yoo-file-items-center yoo-file-leading-[1.2] yoo-file-font-medium yoo-file-text-[#000000]"},{children:[a(R,{width:16,height:16}),a("span",Object.assign({className:"yoo-file-ml-[6px] yoo-file-text-[14px]"},{children:n?`${e}.${n}`:`${e}`}))]})),a("div",Object.assign({className:"yoo-file-ml-[8px] yoo-file-text-[10px] yoo-file-font-normal yoo-file-text-[#37352fa6]"},{children:E(o)}))]}))}))};function k(e){return N(e)?(e.nodeName||"").toLowerCase():"#document"}function _(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function O(e){var t;return null==(t=(N(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function N(e){return e instanceof Node||e instanceof _(e).Node}function L(e){return e instanceof Element||e instanceof _(e).Element}function T(e){return e instanceof HTMLElement||e instanceof _(e).HTMLElement}function j(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof _(e).ShadowRoot)}function A(e){const{overflow:t,overflowX:o,overflowY:n,display:i}=F(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+o)&&!["inline","contents"].includes(i)}function M(e){return["table","td","th"].includes(k(e))}function I(e){const t=P(),o=F(e);return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!t&&!!o.backdropFilter&&"none"!==o.backdropFilter||!t&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((e=>(o.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(o.contain||"").includes(e)))}function P(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function D(e){return["html","body","#document"].includes(k(e))}function F(e){return _(e).getComputedStyle(e)}function H(e){return L(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function V(e){if("html"===k(e))return e;const t=e.assignedSlot||e.parentNode||j(e)&&e.host||O(e);return j(t)?t.host:t}function B(e){const t=V(e);return D(t)?e.ownerDocument?e.ownerDocument.body:e.body:T(t)&&A(t)?t:B(t)}function z(e,t,o){var n;void 0===t&&(t=[]),void 0===o&&(o=!0);const i=B(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),l=_(i);return r?t.concat(l,l.visualViewport||[],A(i)?i:[],l.frameElement&&o?z(l.frameElement):[]):t.concat(i,z(i,[],o))}const U=Math.min,W=Math.max,Z=Math.round,$=e=>({x:e,y:e}),q={left:"right",right:"left",bottom:"top",top:"bottom"},X={start:"end",end:"start"};function Y(e,t,o){return W(e,U(t,o))}function G(e,t){return"function"==typeof e?e(t):e}function K(e){return e.split("-")[0]}function J(e){return e.split("-")[1]}function Q(e){return"x"===e?"y":"x"}function ee(e){return"y"===e?"height":"width"}function te(e){return["top","bottom"].includes(K(e))?"y":"x"}function oe(e){return Q(te(e))}function ne(e){return e.replace(/start|end/g,(e=>X[e]))}function ie(e){return e.replace(/left|right|bottom|top/g,(e=>q[e]))}function re(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function le(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function ae(e,t,o){let{reference:n,floating:i}=e;const r=te(t),l=oe(t),a=ee(l),f=K(t),s="y"===r,c=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,d=n[a]/2-i[a]/2;let p;switch(f){case"top":p={x:c,y:n.y-i.height};break;case"bottom":p={x:c,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-i.width,y:u};break;default:p={x:n.x,y:n.y}}switch(J(t)){case"start":p[l]-=d*(o&&s?-1:1);break;case"end":p[l]+=d*(o&&s?-1:1)}return p}async function fe(e,t){var o;void 0===t&&(t={});const{x:n,y:i,platform:r,rects:l,elements:a,strategy:f}=e,{boundary:s="clippingAncestors",rootBoundary:c="viewport",elementContext:u="floating",altBoundary:d=!1,padding:p=0}=G(t,e),y=re(p),m=a[d?"floating"===u?"reference":"floating":u],g=le(await r.getClippingRect({element:null==(o=await(null==r.isElement?void 0:r.isElement(m)))||o?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:s,rootBoundary:c,strategy:f})),h="floating"===u?{...l.floating,x:n,y:i}:l.reference,x=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),b=await(null==r.isElement?void 0:r.isElement(x))&&await(null==r.getScale?void 0:r.getScale(x))||{x:1,y:1},v=le(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:h,offsetParent:x,strategy:f}):h);return{top:(g.top-v.top+y.top)/b.y,bottom:(v.bottom-g.bottom+y.bottom)/b.y,left:(g.left-v.left+y.left)/b.x,right:(v.right-g.right+y.right)/b.x}}function se(e){const t=U(...e.map((e=>e.left))),o=U(...e.map((e=>e.top)));return{x:t,y:o,width:W(...e.map((e=>e.right)))-t,height:W(...e.map((e=>e.bottom)))-o}}const ce=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var o,n;const{x:i,y:r,placement:l,middlewareData:a}=t,f=await async function(e,t){const{placement:o,platform:n,elements:i}=e,r=await(null==n.isRTL?void 0:n.isRTL(i.floating)),l=K(o),a=J(o),f="y"===te(o),s=["left","top"].includes(l)?-1:1,c=r&&f?-1:1,u=G(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:y}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return a&&"number"==typeof y&&(p="end"===a?-1*y:y),f?{x:p*c,y:d*s}:{x:d*s,y:p*c}}(t,e);return l===(null==(o=a.offset)?void 0:o.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:i+f.x,y:r+f.y,data:{...f,placement:l}}}}};function ue(e){const t=F(e);let o=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=T(e),r=i?e.offsetWidth:o,l=i?e.offsetHeight:n,a=Z(o)!==r||Z(n)!==l;return a&&(o=r,n=l),{width:o,height:n,$:a}}function de(e){return L(e)?e:e.contextElement}function pe(e){const t=de(e);if(!T(t))return $(1);const o=t.getBoundingClientRect(),{width:n,height:i,$:r}=ue(t);let l=(r?Z(o.width):o.width)/n,a=(r?Z(o.height):o.height)/i;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}const ye=$(0);function me(e){const t=_(e);return P()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ye}function ge(e,t,o,n){void 0===t&&(t=!1),void 0===o&&(o=!1);const i=e.getBoundingClientRect(),r=de(e);let l=$(1);t&&(n?L(n)&&(l=pe(n)):l=pe(e));const a=function(e,t,o){return void 0===t&&(t=!1),!(!o||t&&o!==_(e))&&t}(r,o,n)?me(r):$(0);let f=(i.left+a.x)/l.x,s=(i.top+a.y)/l.y,c=i.width/l.x,u=i.height/l.y;if(r){const e=_(r),t=n&&L(n)?_(n):n;let o=e,i=o.frameElement;for(;i&&n&&t!==o;){const e=pe(i),t=i.getBoundingClientRect(),n=F(i),r=t.left+(i.clientLeft+parseFloat(n.paddingLeft))*e.x,l=t.top+(i.clientTop+parseFloat(n.paddingTop))*e.y;f*=e.x,s*=e.y,c*=e.x,u*=e.y,f+=r,s+=l,o=_(i),i=o.frameElement}}return le({width:c,height:u,x:f,y:s})}const he=[":popover-open",":modal"];function xe(e){return he.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function be(e){return ge(O(e)).left+H(e).scrollLeft}function ve(e,t,o){let n;if("viewport"===t)n=function(e,t){const o=_(e),n=O(e),i=o.visualViewport;let r=n.clientWidth,l=n.clientHeight,a=0,f=0;if(i){r=i.width,l=i.height;const e=P();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,f=i.offsetTop)}return{width:r,height:l,x:a,y:f}}(e,o);else if("document"===t)n=function(e){const t=O(e),o=H(e),n=e.ownerDocument.body,i=W(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),r=W(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let l=-o.scrollLeft+be(e);const a=-o.scrollTop;return"rtl"===F(n).direction&&(l+=W(t.clientWidth,n.clientWidth)-i),{width:i,height:r,x:l,y:a}}(O(e));else if(L(t))n=function(e,t){const o=ge(e,!0,"fixed"===t),n=o.top+e.clientTop,i=o.left+e.clientLeft,r=T(e)?pe(e):$(1);return{width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:i*r.x,y:n*r.y}}(t,o);else{const o=me(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return le(n)}function we(e,t){const o=V(e);return!(o===t||!L(o)||D(o))&&("fixed"===F(o).position||we(o,t))}function Ce(e,t,o){const n=T(t),i=O(t),r="fixed"===o,l=ge(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const f=$(0);if(n||!n&&!r)if(("body"!==k(t)||A(i))&&(a=H(t)),n){const e=ge(t,!0,r,t);f.x=e.x+t.clientLeft,f.y=e.y+t.clientTop}else i&&(f.x=be(i));return{x:l.left+a.scrollLeft-f.x,y:l.top+a.scrollTop-f.y,width:l.width,height:l.height}}function Re(e,t){return T(e)&&"fixed"!==F(e).position?t?t(e):e.offsetParent:null}function Ee(e,t){const o=_(e);if(!T(e)||xe(e))return o;let n=Re(e,t);for(;n&&M(n)&&"static"===F(n).position;)n=Re(n,t);return n&&("html"===k(n)||"body"===k(n)&&"static"===F(n).position&&!I(n))?o:n||function(e){let t=V(e);for(;T(t)&&!D(t);){if(I(t))return t;t=V(t)}return null}(e)||o}const Se={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:o,offsetParent:n,strategy:i}=e;const r="fixed"===i,l=O(n),a=!!t&&xe(t.floating);if(n===l||a&&r)return o;let f={scrollLeft:0,scrollTop:0},s=$(1);const c=$(0),u=T(n);if((u||!u&&!r)&&(("body"!==k(n)||A(l))&&(f=H(n)),T(n))){const e=ge(n);s=pe(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:o.width*s.x,height:o.height*s.y,x:o.x*s.x-f.scrollLeft*s.x+c.x,y:o.y*s.y-f.scrollTop*s.y+c.y}},getDocumentElement:O,getClippingRect:function(e){let{element:t,boundary:o,rootBoundary:n,strategy:i}=e;const r=[..."clippingAncestors"===o?function(e,t){const o=t.get(e);if(o)return o;let n=z(e,[],!1).filter((e=>L(e)&&"body"!==k(e))),i=null;const r="fixed"===F(e).position;let l=r?V(e):e;for(;L(l)&&!D(l);){const t=F(l),o=I(l);o||"fixed"!==t.position||(i=null),(r?!o&&!i:!o&&"static"===t.position&&i&&["absolute","fixed"].includes(i.position)||A(l)&&!o&&we(e,l))?n=n.filter((e=>e!==l)):i=t,l=V(l)}return t.set(e,n),n}(t,this._c):[].concat(o),n],l=r[0],a=r.reduce(((e,o)=>{const n=ve(t,o,i);return e.top=W(n.top,e.top),e.right=U(n.right,e.right),e.bottom=U(n.bottom,e.bottom),e.left=W(n.left,e.left),e}),ve(t,l,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Ee,getElementRects:async function(e){const t=this.getOffsetParent||Ee,o=this.getDimensions;return{reference:Ce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await o(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:o}=ue(e);return{width:t,height:o}},getScale:pe,isElement:L,isRTL:function(e){return"rtl"===F(e).direction}},ke=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:n,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:a={fn:e=>{let{x:t,y:o}=e;return{x:t,y:o}}},...f}=G(e,t),s={x:o,y:n},c=await fe(t,f),u=te(K(i)),d=Q(u);let p=s[d],y=s[u];if(r){const e="y"===d?"bottom":"right";p=Y(p+c["y"===d?"top":"left"],p,p-c[e])}if(l){const e="y"===u?"bottom":"right";y=Y(y+c["y"===u?"top":"left"],y,y-c[e])}const m=a.fn({...t,[d]:p,[u]:y});return{...m,data:{x:m.x-o,y:m.y-n}}}}},_e=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var o,n;const{placement:i,middlewareData:r,rects:l,initialPlacement:a,platform:f,elements:s}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:m=!0,...g}=G(e,t);if(null!=(o=r.arrow)&&o.alignmentOffset)return{};const h=K(i),x=K(a)===a,b=await(null==f.isRTL?void 0:f.isRTL(s.floating)),v=d||(x||!m?[ie(a)]:function(e){const t=ie(e);return[ne(e),t,ne(t)]}(a));d||"none"===y||v.push(...function(e,t,o,n){const i=J(e);let r=function(e,t,o){const n=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return o?t?i:n:t?n:i;case"left":case"right":return t?r:l;default:return[]}}(K(e),"start"===o,n);return i&&(r=r.map((e=>e+"-"+i)),t&&(r=r.concat(r.map(ne)))),r}(a,m,y,b));const w=[a,...v],C=await fe(t,g),R=[];let E=(null==(n=r.flip)?void 0:n.overflows)||[];if(c&&R.push(C[h]),u){const e=function(e,t,o){void 0===o&&(o=!1);const n=J(e),i=oe(e),r=ee(i);let l="x"===i?n===(o?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=ie(l)),[l,ie(l)]}(i,l,b);R.push(C[e[0]],C[e[1]])}if(E=[...E,{placement:i,overflows:R}],!R.every((e=>e<=0))){var S,k;const e=((null==(S=r.flip)?void 0:S.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:E},reset:{placement:t}};let o=null==(k=E.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:k.placement;if(!o)switch(p){case"bestFit":{var _;const e=null==(_=E.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:_[0];e&&(o=e);break}case"initialPlacement":o=a}if(i!==o)return{reset:{placement:o}}}return{}}}},Oe=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:o,elements:n,rects:i,platform:r,strategy:l}=t,{padding:a=2,x:f,y:s}=G(e,t),c=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(n.reference))||[]),u=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),o=[];let n=null;for(let e=0;e<t.length;e++){const i=t[e];!n||i.y-n.y>n.height/2?o.push([i]):o[o.length-1].push(i),n=i}return o.map((e=>le(se(e))))}(c),d=le(se(c)),p=re(a);const y=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=f&&null!=s)return u.find((e=>f>e.left-p.left&&f<e.right+p.right&&s>e.top-p.top&&s<e.bottom+p.bottom))||d;if(u.length>=2){if("y"===te(o)){const e=u[0],t=u[u.length-1],n="top"===K(o),i=e.top,r=t.bottom,l=n?e.left:t.left,a=n?e.right:t.right;return{top:i,bottom:r,left:l,right:a,width:a-l,height:r-i,x:l,y:i}}const e="left"===K(o),t=W(...u.map((e=>e.right))),n=U(...u.map((e=>e.left))),i=u.filter((o=>e?o.left===n:o.right===t)),r=i[0].top,l=i[i.length-1].bottom;return{top:r,bottom:l,left:n,right:t,width:t-n,height:l-r,x:n,y:r}}return d}},floating:n.floating,strategy:l});return i.reference.x!==y.reference.x||i.reference.y!==y.reference.y||i.reference.width!==y.reference.width||i.reference.height!==y.reference.height?{reset:{rects:y}}:{}}}},Ne=(e,t,o)=>{const n=new Map,i={platform:Se,...o},r={...i.platform,_c:n};return(async(e,t,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:l}=o,a=r.filter(Boolean),f=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:u}=ae(s,n,f),d=n,p={},y=0;for(let o=0;o<a.length;o++){const{name:r,fn:m}=a[o],{x:g,y:h,data:x,reset:b}=await m({x:c,y:u,initialPlacement:n,placement:d,strategy:i,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});c=null!=g?g:c,u=null!=h?h:u,p={...p,[r]:{...p[r],...x}},b&&y<=50&&(y++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(s=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:i}):b.rects),({x:c,y:u}=ae(s,d,f))),o=-1)}return{x:c,y:u,placement:d,strategy:i,middlewareData:p}})(e,t,{...i,platform:r})};var Le="undefined"!=typeof document?d:p;function Te(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let o,n,i;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(n=o;0!=n--;)if(!Te(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),o=i.length,o!==Object.keys(t).length)return!1;for(n=o;0!=n--;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=o;0!=n--;){const o=i[n];if(("_owner"!==o||!e.$$typeof)&&!Te(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function je(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ae(e,t){const o=je(e);return Math.round(t*o)/o}function Me(e){const t=s.useRef(e);return Le((()=>{t.current=e})),t}
2
+ /*!
3
+ * tabbable 6.2.0
4
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
+ */
6
+ var Ie=["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(","),Pe="undefined"==typeof Element,De=Pe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Fe=!Pe&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},He=function e(t,o){var n;void 0===o&&(o=!0);var i=null==t||null===(n=t.getAttribute)||void 0===n?void 0:n.call(t,"inert");return""===i||"true"===i||o&&t&&e(t.parentNode)},Ve=function e(t,o,n){for(var i=[],r=Array.from(t);r.length;){var l=r.shift();if(!He(l,!1))if("SLOT"===l.tagName){var a=l.assignedElements(),f=e(a.length?a:l.children,!0,n);n.flatten?i.push.apply(i,f):i.push({scopeParent:l,candidates:f})}else{De.call(l,Ie)&&n.filter(l)&&(o||!t.includes(l))&&i.push(l);var s=l.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(l),c=!He(s,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(l));if(s&&c){var u=e(!0===s?l.children:s.children,!0,n);n.flatten?i.push.apply(i,u):i.push({scopeParent:l,candidates:u})}else r.unshift.apply(r,l.children)}}return i},Be=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ze=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,o=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===o||"true"===o}(e))&&!Be(e)?0:e.tabIndex},Ue=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},We=function(e){return"INPUT"===e.tagName},Ze=function(e){return function(e){return We(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,o=e.form||Fe(e),n=function(e){return o.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=n(window.CSS.escape(e.name));else try{t=n(e.name)}catch(e){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",e.message),!1}var i=function(e,t){for(var o=0;o<e.length;o++)if(e[o].checked&&e[o].form===t)return e[o]}(t,e.form);return!i||i===e}(e)},$e=function(e){var t=e.getBoundingClientRect(),o=t.width,n=t.height;return 0===o&&0===n},qe=function(e,t){var o=t.displayCheck,n=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var i=De.call(e,"details>summary:first-of-type")?e.parentElement:e;if(De.call(i,"details:not([open]) *"))return!0;if(o&&"full"!==o&&"legacy-full"!==o){if("non-zero-area"===o)return $e(e)}else{if("function"==typeof n){for(var r=e;e;){var l=e.parentElement,a=Fe(e);if(l&&!l.shadowRoot&&!0===n(l))return $e(e);e=e.assignedSlot?e.assignedSlot:l||a===e.ownerDocument?l:a.host}e=r}if(function(e){var t,o,n,i,r=e&&Fe(e),l=null===(t=r)||void 0===t?void 0:t.host,a=!1;if(r&&r!==e)for(a=!!(null!==(o=l)&&void 0!==o&&null!==(n=o.ownerDocument)&&void 0!==n&&n.contains(l)||null!=e&&null!==(i=e.ownerDocument)&&void 0!==i&&i.contains(e));!a&&l;){var f,s,c;a=!(null===(s=l=null===(f=r=Fe(l))||void 0===f?void 0:f.host)||void 0===s||null===(c=s.ownerDocument)||void 0===c||!c.contains(l))}return a}(e))return!e.getClientRects().length;if("legacy-full"!==o)return!0}return!1},Xe=function(e,t){return!(t.disabled||He(t)||function(e){return We(e)&&"hidden"===e.type}(t)||qe(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var o=0;o<t.children.length;o++){var n=t.children.item(o);if("LEGEND"===n.tagName)return!!De.call(t,"fieldset[disabled] *")||!n.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ye=function(e,t){return!(Ze(t)||ze(t)<0||!Xe(e,t))},Ge=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ke=function e(t){var o=[],n=[];return t.forEach((function(t,i){var r=!!t.scopeParent,l=r?t.scopeParent:t,a=function(e,t){var o=ze(e);return o<0&&t&&!Be(e)?0:o}(l,r),f=r?e(t.candidates):l;0===a?r?o.push.apply(o,f):o.push(l):n.push({documentOrder:i,tabIndex:a,item:t,isScope:r,content:f})})),n.sort(Ue).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(o)},Je=function(e,t){var o;return o=(t=t||{}).getShadowRoot?Ve([e],t.includeContainer,{filter:Ye.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ge}):function(e,t,o){if(He(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(Ie));return t&&De.call(e,Ie)&&n.unshift(e),n.filter(o)}(e,t.includeContainer,Ye.bind(null,t)),Ke(o)};const Qe=s["useInsertionEffect".toString()]||(e=>e());var et="undefined"!=typeof document?d:p;function tt(){return tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},tt.apply(this,arguments)}let ot=!1,nt=0;const it=()=>"floating-ui-"+nt++;const rt=s["useId".toString()]||function(){const[e,t]=s.useState((()=>ot?it():void 0));return et((()=>{null==e&&t(it())}),[]),s.useEffect((()=>{ot||(ot=!0)}),[]),e};const lt=s.createContext(null),at=s.createContext(null);function ft(e){return"data-floating-ui-"+e}const st=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ct(e,t){const o=Je(e,st());"prev"===t&&o.reverse();const n=o.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(o=t)||null==(o=o.shadowRoot)?void 0:o.activeElement);){var o;t=t.shadowRoot.activeElement}return t}((null==(i=e)?void 0:i.ownerDocument)||document));var i;return o.slice(n+1)[0]}function ut(e,t){const o=t||e.currentTarget,n=e.relatedTarget;return!n||!function(e,t){if(!e||!t)return!1;const o=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(o&&j(o)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}(o,n)}function dt(e){Je(e,st()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function pt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const yt={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 mt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const gt=s.forwardRef((function(e,t){const[o,n]=s.useState();et((()=>(/apple/i.test(navigator.vendor)&&n("button"),document.addEventListener("keydown",mt),()=>{document.removeEventListener("keydown",mt)})),[]);const i={ref:t,tabIndex:0,role:o,"aria-hidden":!o||void 0,[ft("focus-guard")]:"",style:yt};return s.createElement("span",tt({},e,i))})),ht=s.createContext(null),xt=ft("portal");function bt(e){let{children:t,id:o,root:n=null,preserveTabOrder:i=!0}=e;const r=function(e){let{id:t,root:o}=void 0===e?{}:e;const[n,i]=s.useState(null),r=rt(),l=vt(),a=s.useRef(null);return et((()=>()=>{null==n||n.remove(),queueMicrotask((()=>{a.current=null}))}),[n]),et((()=>{if(a.current)return;const e=t?document.getElementById(t):null;if(!e)return;const o=document.createElement("div");o.id=r,o.setAttribute(xt,""),e.appendChild(o),a.current=o,i(o)}),[t,r]),et((()=>{if(a.current)return;let e=o||(null==l?void 0:l.portalNode);e&&!L(e)&&(e=e.current),e=e||document.body;let n=null;t&&(n=document.createElement("div"),n.id=t,e.appendChild(n));const f=document.createElement("div");f.id=r,f.setAttribute(xt,""),e=n||e,e.appendChild(f),a.current=f,i(f)}),[t,o,r,l]),n}({id:o,root:n}),[l,a]=s.useState(null),f=s.useRef(null),c=s.useRef(null),u=s.useRef(null),d=s.useRef(null),p=!!l&&!l.modal&&l.open&&i&&!(!n&&!r);return s.useEffect((()=>{if(r&&i&&(null==l||!l.modal))return r.addEventListener("focusin",e,!0),r.addEventListener("focusout",e,!0),()=>{r.removeEventListener("focusin",e,!0),r.removeEventListener("focusout",e,!0)};function e(e){if(r&&ut(e)){("focusin"===e.type?pt:dt)(r)}}}),[r,i,null==l?void 0:l.modal]),s.createElement(ht.Provider,{value:s.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:f,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:r,setFocusManagerState:a})),[i,r])},p&&r&&s.createElement(gt,{"data-type":"outside",ref:f,onFocus:e=>{if(ut(e,r)){var t;null==(t=u.current)||t.focus()}else{const e=ct(document.body,"prev")||(null==l?void 0:l.refs.domReference.current);null==e||e.focus()}}}),p&&r&&s.createElement("span",{"aria-owns":r.id,style:yt}),r&&g(t,r),p&&r&&s.createElement(gt,{"data-type":"outside",ref:c,onFocus:e=>{if(ut(e,r)){var t;null==(t=d.current)||t.focus()}else{const t=ct(document.body,"next")||(null==l?void 0:l.refs.domReference.current);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent))}}}))}const vt=()=>s.useContext(ht),wt=new Set,Ct=s.forwardRef((function(e,t){let{lockScroll:o=!1,...n}=e;const i=rt();return et((()=>{if(!o)return;wt.add(i);const e=/iP(hone|ad|od)|iOS/.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,l=t.left?parseFloat(t.left):window.pageXOffset,a=t.top?parseFloat(t.top):window.pageYOffset;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var f,s;const e=(null==(f=window.visualViewport)?void 0:f.offsetLeft)||0,o=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(a-Math.floor(o))+"px",left:-(l-Math.floor(e))+"px",right:"0"})}return()=>{wt.delete(i),0===wt.size&&(Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(l,a)))}}),[i,o]),s.createElement("div",tt({ref:t},n,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...n.style}}))}));function Rt(e){var t;void 0===e&&(e={});const{open:o=!1,onOpenChange:n,nodeId:i}=e,[r,l]=s.useState(null),a=(null==(t=e.elements)?void 0:t.reference)||r,f=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:o="absolute",middleware:n=[],platform:i,elements:{reference:r,floating:l}={},transform:a=!0,whileElementsMounted:f,open:c}=e,[u,d]=s.useState({x:0,y:0,strategy:o,placement:t,middlewareData:{},isPositioned:!1}),[p,y]=s.useState(n);Te(p,n)||y(n);const[g,h]=s.useState(null),[x,b]=s.useState(null),v=s.useCallback((e=>{e!==E.current&&(E.current=e,h(e))}),[]),w=s.useCallback((e=>{e!==S.current&&(S.current=e,b(e))}),[]),C=r||g,R=l||x,E=s.useRef(null),S=s.useRef(null),k=s.useRef(u),_=null!=f,O=Me(f),N=Me(i),L=s.useCallback((()=>{if(!E.current||!S.current)return;const e={placement:t,strategy:o,middleware:p};N.current&&(e.platform=N.current),Ne(E.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};T.current&&!Te(k.current,t)&&(k.current=t,m.flushSync((()=>{d(t)})))}))}),[p,t,o,N]);Le((()=>{!1===c&&k.current.isPositioned&&(k.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const T=s.useRef(!1);Le((()=>(T.current=!0,()=>{T.current=!1})),[]),Le((()=>{if(C&&(E.current=C),R&&(S.current=R),C&&R){if(O.current)return O.current(C,R,L);L()}}),[C,R,L,O,_]);const j=s.useMemo((()=>({reference:E,floating:S,setReference:v,setFloating:w})),[v,w]),A=s.useMemo((()=>({reference:C,floating:R})),[C,R]),M=s.useMemo((()=>{const e={position:o,left:0,top:0};if(!A.floating)return e;const t=Ae(A.floating,u.x),n=Ae(A.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...je(A.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}}),[o,a,A.floating,u.x,u.y]);return s.useMemo((()=>({...u,update:L,refs:j,elements:A,floatingStyles:M})),[u,L,j,A,M])}(e),c=s.useContext(at),u=null!=((null==(d=s.useContext(lt))?void 0:d.id)||null);var d;const p=function(e){const t=s.useRef((()=>{}));return Qe((()=>{t.current=e})),s.useCallback((function(){for(var e=arguments.length,o=new Array(e),n=0;n<e;n++)o[n]=arguments[n];return null==t.current?void 0:t.current(...o)}),[])}(((e,t,o)=>{e&&(g.current.openEvent=t),h.emit("openchange",{open:e,event:t,reason:o,nested:u}),null==n||n(e,t,o)})),y=s.useRef(null),g=s.useRef({}),h=s.useState((()=>function(){const e=new Map;return{emit(t,o){var n;null==(n=e.get(t))||n.forEach((e=>e(o)))},on(t,o){e.set(t,[...e.get(t)||[],o])},off(t,o){var n;e.set(t,(null==(n=e.get(t))?void 0:n.filter((e=>e!==o)))||[])}}}()))[0],x=rt(),b=s.useCallback((e=>{const t=L(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;f.refs.setReference(t)}),[f.refs]),v=s.useCallback((e=>{(L(e)||null===e)&&(y.current=e,l(e)),(L(f.refs.reference.current)||null===f.refs.reference.current||null!==e&&!L(e))&&f.refs.setReference(e)}),[f.refs]),w=s.useMemo((()=>({...f.refs,setReference:v,setPositionReference:b,domReference:y})),[f.refs,v,b]),C=s.useMemo((()=>({...f.elements,domReference:a})),[f.elements,a]),R=s.useMemo((()=>({...f,refs:w,elements:C,dataRef:g,nodeId:i,floatingId:x,events:h,open:o,onOpenChange:p})),[f,i,x,h,o,p,w,C]);return et((()=>{const e=null==c?void 0:c.nodesRef.current.find((e=>e.id===i));e&&(e.context=R)})),s.useMemo((()=>({...f,context:R,refs:w,elements:C})),[f,w,C,R])}function Et(e,t,o,n){return new(o||(o=Promise))((function(i,r){function l(e){try{f(n.next(e))}catch(e){r(e)}}function a(e){try{f(n.throw(e))}catch(e){r(e)}}function f(e){var t;e.done?i(e.value):(t=e.value,t instanceof o?t:new o((function(e){e(t)}))).then(l,a)}f((n=n.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const St=({accept:o="",onClose:n,blockId:i,onSetLoading:r})=>{const l=e("File"),s=t();return a("div",Object.assign({className:"yoo-file-user-select-none yoo-file-transition-bg yoo-file-duration-20 yoo-file-ease-in yoo-file-white-space-nowrap yoo-file-rounded-[4px] yoo-file-h-[32px] yoo-file-px-[12px] yoo-file-border yoo-file-border-[rgba(55,53,47,0.16)] yoo-file-w-full yoo-file-cursor-pointer"},{children:f("label",Object.assign({htmlFor:"file-uploader",className:"yoo-file-text-[14px] yoo-file-leading-[1.2] yoo-file-font-medium yoo-file-cursor-pointer yoo-file-w-full yoo-file-flex yoo-file-items-center yoo-file-justify-center yoo-file-h-full"},{children:[a("input",{type:"file",id:"file-uploader",className:"yoo-file-absolute yoo-file-left-0 yoo-file-top-0 yoo-file-invisible",accept:(null==l?void 0:l.accept)||o,onChange:e=>{const t=e.target.files[0];t&&(e=>{Et(void 0,void 0,void 0,(function*(){if(console.log("options?.onUpload",null==l?void 0:l.onUpload),!(null==l?void 0:l.onUpload))throw new Error("onUpload not provided in plugin options. Check File.extend({}) method");n(),r(!0);try{const t=yield null==l?void 0:l.onUpload(e),o=t.format||e.name.split(".").pop()||null;s.blocks.File.updateElement(i,"file",{src:t.src,name:t.name||e.name,size:t.size||e.size,format:o})}catch(e){}finally{r(!1)}}))})(t)},multiple:!1}),"Upload file"]}))}))},kt=({floatingStyles:e,refs:t,onClose:o,blockId:n,onSetLoading:i})=>a(bt,Object.assign({id:"yoo-file-uploader-portal",root:document.getElementById("yoopta-editor")},{children:a(Ct,Object.assign({lockScroll:!0,className:"yoo-file-z-[100]",onClick:o},{children:a("div",Object.assign({ref:t.setFloating,style:e,onClick:e=>e.stopPropagation()},{children:f("div",Object.assign({className:"yoo-file-flex yoo-file-flex-col yoo-file-min-w-[540px] yoo-file-max-w-[calc(100vw-24px)] yoo-file-h-full yoo-file-max-h-[420px] yoo-file-bg-white yoo-file-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:"yoo-file-w-full yoo-file-flex yoo-file-text-[14px] yoo-file-p-[0_8px] yoo-file-shadow-[rgb(55_53_47_/9%)_0px_-1px_0px_inset] yoo-file-relative yoo-file-z-10 yoo-file-h-[40px]"},{children:a("button",Object.assign({type:"button",style:{borderBottom:"2px solid #2483e2"},className:"yoo-file-py-[6px] yoo-file-whitespace-nowrap yoo-file-min-w-0 yoo-file-flex-shrink-0 yoo-file-text-[rgb(55,53,47)] yoo-file-relative yoo-file-cursor-pointer yoo-file-user-select-none yoo-file-bg-inherit yoo-file-transition-[height_20ms_ease-in] yoo-file-inline-flex yoo-file-items-center yoo-file-h-full yoo-file-text-[14px] yoo-file-leading-[1.2] yoo-file-px-[8px]"},{children:"Upload"}))})),a("div",Object.assign({className:"yoo-file-pt-[6px] yoo-file-pb-[6px] yoo-file-mt-[4px] yoo-file-flex yoo-file-justify-center yoo-file-mr-[12px] yoo-file-ml-[12px]"},{children:a(St,{onClose:o,blockId:n,onSetLoading:i})}))]}))}))}))})),_t=({className:e,width:t,height:o,children:n})=>f("div",Object.assign({className:e},{children:[n,a("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:t,height:o,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-loader-2 yoo-file-h-4 yoo-file-w-4 yoo-file-animate-spin"},{children:a("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}))]})),Ot=({attributes:e,children:t,blockId:o})=>{const[n,i]=y(!1),[r,l]=y(!1),{refs:s,floatingStyles:c}=Rt({placement:"bottom",open:n,onOpenChange:i,middleware:[Oe(),_e(),ke(),ce(10)]});return f("div",Object.assign({className:"yoo-file-w-full yoo-file-user-select-none yoo-file-m-[20px_0_10px] yoo-file-relative yoo-file-flex"},e,{contentEditable:!1},{children:[f("button",Object.assign({className:"yoo-file-p-[12px_36px_12px_12px] yoo-file-flex yoo-file-items-center yoo-file-text-left yoo-file-w-full yoo-file-overflow-hidden yoo-file-rounded-[3px] yoo-file-text-[14px] yoo-file-text-[rgba(55,53,47,0.65)] yoo-file-relative yoo-file-cursor-pointer yoo-file-border-none yoo-file-bg-[#efefef] yoo-file-transition-[background-color_100ms_ease-in] hover:yoo-file-bg-[#e3e3e3]",onClick:()=>i(!0),ref:s.setReference},{children:[a(r?_t:w,{className:"yoo-file-mr-2 yoo-file-user-select-none",width:24,height:24}),a("span",Object.assign({className:"yoo-file-font-medium"},{children:r?"Loading...":"Click to add file"})),r&&a("div",{className:"yoo-file-absolute yoo-file-top-0 yoo-file-left-0 yoo-file-h-full yoo-file-bg-[rgba(55,53,47,0.16)]",style:{width:"100%",transition:"width 100ms ease-in"}})]})),n&&a(kt,{blockId:o,floatingStyles:c,refs:s,onClose:()=>i(!1),onSetLoading:e=>l(e)}),t]}))},{ExtendedBlockActions:Nt,BlockOptionsMenuGroup:Lt,BlockOptionsMenuItem:Tt,BlockOptionsSeparator:jt}=o,At=({editor:e,block:t,props:o})=>f(Nt,Object.assign({onClick:()=>e.setSelection([t.meta.order])},{children:[a(jt,{}),a(Lt,{children:a(Tt,{children:f("button",Object.assign({type:"button",className:"yoo-file-rounded-sm hover:yoo-file-bg-[#37352f14] yoo-file-leading-[120%] yoo-file-px-2 yoo-file-py-1.5 yoo-file-mx-[4px] yoo-file-cursor-pointer yoo-file-w-full yoo-file-flex yoo-file-justify-start",onClick:()=>{(null==o?void 0:o.src)&&window.open(null==o?void 0:o.src,"_blank")}},{children:[a(b,{width:16,height:16,className:"yoo-file-w-4 yoo-file-h-4 yoo-file-mr-2"}),"Open"]}))})})]})),Mt=new l({type:"File",elements:{file:{render:({element:o,attributes:l,children:s,blockId:c})=>{const{name:u,src:d,format:p,size:y}=o.props||{},m=n(c),g=t();e("File");const h=i(),x=r({blockId:c});return d?f("div",Object.assign({"data-element-type":o.type,contentEditable:!1,draggable:!1,className:"yoo-file-mt-4 yoo-file-relative yoo-file-flex yoopta-file"},l,{children:[x&&a("div",{className:"yoo-file-absolute yoo-file-pointer-events-none yoo-file-inset-0 yoo-file-bg-[rgba(35,131,226,0.14)] yoo-file-z-[81] yoo-file-rounded-[3px] yoo-file-opacity-100 yoo-file-transition-opacity yoo-file-duration-150 yoo-file-ease-in"}),a(S,{name:u,format:p,src:d,size:y,blockId:c}),!h&&a(At,{block:m,editor:g,props:o.props}),s]})):a(Ot,Object.assign({attributes:l,blockId:c},{children:s}))},props:{size:0,name:null,src:null,format:null,nodeType:"void"}}},options:{display:{title:"File",description:"For file videos, google maps and more"},accept:""},parsers:{}});!function(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===o&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}(".yoo-file-pointer-events-none{pointer-events:none}.yoo-file-invisible{visibility:hidden}.yoo-file-absolute{position:absolute}.yoo-file-relative{position:relative}.yoo-file-inset-0{inset:0}.yoo-file-left-0{left:0}.yoo-file-top-0{top:0}.yoo-file-z-10{z-index:10}.yoo-file-z-\\[100\\]{z-index:100}.yoo-file-z-\\[81\\]{z-index:81}.yoo-file-m-\\[20px_0_10px\\]{margin:20px 0 10px}.yoo-file-mx-\\[4px\\]{margin-left:4px;margin-right:4px}.yoo-file-ml-\\[12px\\]{margin-left:12px}.yoo-file-ml-\\[6px\\]{margin-left:6px}.yoo-file-ml-\\[8px\\]{margin-left:8px}.yoo-file-mr-2{margin-right:.5rem}.yoo-file-mr-\\[12px\\]{margin-right:12px}.yoo-file-mt-4{margin-top:1rem}.yoo-file-mt-\\[4px\\]{margin-top:4px}.yoo-file-flex{display:flex}.yoo-file-inline-flex{display:inline-flex}.yoo-file-h-4{height:1rem}.yoo-file-h-\\[32px\\]{height:32px}.yoo-file-h-\\[40px\\]{height:40px}.yoo-file-h-full{height:100%}.yoo-file-max-h-\\[420px\\]{max-height:420px}.yoo-file-w-4{width:1rem}.yoo-file-w-full{width:100%}.yoo-file-min-w-0{min-width:0}.yoo-file-min-w-\\[540px\\]{min-width:540px}.yoo-file-max-w-\\[calc\\(100vw-24px\\)\\]{max-width:calc(100vw - 24px)}.yoo-file-flex-shrink-0{flex-shrink:0}@keyframes yoo-file-spin{to{transform:rotate(1turn)}}.yoo-file-animate-spin{animation:yoo-file-spin 1s linear infinite}.yoo-file-cursor-pointer{cursor:pointer}.yoo-file-flex-col{flex-direction:column}.yoo-file-items-center{align-items:center}.yoo-file-justify-start{justify-content:flex-start}.yoo-file-justify-center{justify-content:center}.yoo-file-overflow-hidden{overflow:hidden}.yoo-file-whitespace-nowrap{white-space:nowrap}.yoo-file-rounded-\\[3px\\]{border-radius:3px}.yoo-file-rounded-\\[4px\\]{border-radius:4px}.yoo-file-rounded-sm{border-radius:.125rem}.yoo-file-border{border-width:1px}.yoo-file-border-b-\\[1px\\]{border-bottom-width:1px}.yoo-file-border-none{border-style:none}.yoo-file-border-\\[rgba\\(55\\,53\\,47\\,0\\.16\\)\\]{border-color:rgba(55,53,47,.16)}.yoo-file-border-\\[transparent\\]{border-color:transparent}.yoo-file-bg-\\[\\#efefef\\]{--tw-bg-opacity:1;background-color:rgb(239 239 239/var(--tw-bg-opacity))}.yoo-file-bg-\\[rgba\\(35\\,131\\,226\\,0\\.14\\)\\]{background-color:rgba(35,131,226,.14)}.yoo-file-bg-\\[rgba\\(55\\,53\\,47\\,0\\.16\\)\\]{background-color:rgba(55,53,47,.16)}.yoo-file-bg-inherit{background-color:inherit}.yoo-file-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.yoo-file-p-\\[0_8px\\]{padding:0 8px}.yoo-file-p-\\[12px_36px_12px_12px\\]{padding:12px 36px 12px 12px}.yoo-file-px-2{padding-left:.5rem;padding-right:.5rem}.yoo-file-px-\\[12px\\]{padding-left:12px;padding-right:12px}.yoo-file-px-\\[8px\\]{padding-left:8px;padding-right:8px}.yoo-file-py-1{padding-bottom:.25rem;padding-top:.25rem}.yoo-file-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.yoo-file-py-\\[6px\\]{padding-bottom:6px;padding-top:6px}.yoo-file-py-\\[8px\\]{padding-bottom:8px;padding-top:8px}.yoo-file-pb-\\[6px\\]{padding-bottom:6px}.yoo-file-pt-\\[6px\\]{padding-top:6px}.yoo-file-text-left{text-align:left}.yoo-file-text-\\[10px\\]{font-size:10px}.yoo-file-text-\\[14px\\]{font-size:14px}.yoo-file-font-medium{font-weight:500}.yoo-file-font-normal{font-weight:400}.yoo-file-leading-\\[1\\.2\\]{line-height:1.2}.yoo-file-leading-\\[120\\%\\]{line-height:120%}.yoo-file-text-\\[\\#000000\\]{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.yoo-file-text-\\[\\#37352fa6\\]{color:#37352fa6}.yoo-file-text-\\[rgb\\(55\\,53\\,47\\)\\]{--tw-text-opacity:1;color:rgb(55 53 47/var(--tw-text-opacity))}.yoo-file-text-\\[rgba\\(55\\,53\\,47\\,0\\.65\\)\\]{color:rgba(55,53,47,.65)}.yoo-file-opacity-100{opacity:1}.yoo-file-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\\]{--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)}.yoo-file-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)}.yoo-file-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)}.yoo-file-transition-\\[height_20ms_ease-in\\]{transition-duration:.15s;transition-property:height 20ms ease-in;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-file-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.yoo-file-duration-150{transition-duration:.15s}.yoo-file-ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.yoopta-file .yoopta-extended-block-actions{opacity:0;transition:opacity .15s ease-in-out}.yoopta-file:hover .yoopta-extended-block-actions{opacity:1}.hover\\:yoo-file-border-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.16\\)\\]:hover{border-color:rgba(55,53,47,.16)}.hover\\:yoo-file-bg-\\[\\#37352f14\\]:hover{background-color:#37352f14}.hover\\:yoo-file-bg-\\[\\#e3e3e3\\]:hover{--tw-bg-opacity:1;background-color:rgb(227 227 227/var(--tw-bg-opacity))}.hover\\:yoo-file-bg-\\[rgba\\(55\\2c 53\\2c 47\\2c 0\\.04\\)\\]:hover{background-color:rgba(55,53,47,.04)}");export{Mt as default};
@@ -0,0 +1,5 @@
1
+ import { YooptaPlugin } from '@yoopta/editor';
2
+ import { FileElementProps, FilePluginOptions } from '../types';
3
+ declare const File: YooptaPlugin<"file", FileElementProps, FilePluginOptions>;
4
+ export { File };
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAsB,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAGnF,QAAA,MAAM,IAAI,2DAkDR,CAAC;AAEH,OAAO,EAAE,IAAI,EAAE,CAAC"}
package/dist/types.d.ts CHANGED
@@ -1,18 +1,17 @@
1
- import { YooptaBaseElement, Modify, YooptaPluginBaseOptions } from '@yoopta/editor';
2
- export type FileUploadResponse = {
3
- url: string;
4
- preview?: string;
1
+ import { type SlateElement } from '@yoopta/editor';
2
+ export type FileElementProps = {
3
+ size: number | null;
4
+ name: string | null;
5
+ src: string | null;
6
+ format: string | null;
7
+ };
8
+ export type FilePluginElements = 'file';
9
+ export type FileElement = SlateElement<'file', FileElementProps>;
10
+ export type OnUploadResponse = Partial<FileElementProps> & {
11
+ src: string;
5
12
  };
6
13
  export type FilePluginOptions = {
7
- accept?: string | undefined;
8
- onUpload: (file: File) => Promise<FileUploadResponse>;
9
- } & YooptaPluginBaseOptions;
10
- export type FileElementData = {
11
- 'data-url'?: string | null | undefined;
12
- url: string | null | undefined;
13
- name: string;
14
- size: number;
14
+ onUpload: (file: File) => Promise<OnUploadResponse>;
15
+ accept?: string;
15
16
  };
16
- export type FileElement = Modify<YooptaBaseElement<'file'>, {
17
- data: FileElementData;
18
- }>;
17
+ //# 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,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACxC,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;AAEjE,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
package/dist/ui/File.d.ts CHANGED
@@ -1,8 +1,4 @@
1
- import { RenderYooptaElementProps } from '@yoopta/editor';
2
- import { ReactNode } from 'react';
3
- import { FileElement } from '../types';
4
- type Props = RenderYooptaElementProps<FileElement> & {
5
- children?: ReactNode;
6
- };
7
- declare const File: ({ attributes, element, children, HTMLAttributes }: Props) => JSX.Element;
8
- export { File };
1
+ import { PluginElementRenderProps } from '@yoopta/editor';
2
+ declare const FileRender: ({ element, attributes, children, blockId }: PluginElementRenderProps) => import("react/jsx-runtime").JSX.Element;
3
+ export { FileRender };
4
+ //# sourceMappingURL=File.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"File.d.ts","sourceRoot":"","sources":["../../src/ui/File.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,wBAAwB,EAKzB,MAAM,gBAAgB,CAAC;AAOxB,QAAA,MAAM,UAAU,+CAAgD,wBAAwB,4CAiCvF,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { YooEditor, YooptaBlockData } from '@yoopta/editor';
2
+ import { FileElementProps } from '../types';
3
+ type Props = {
4
+ editor: YooEditor;
5
+ block: YooptaBlockData;
6
+ props?: FileElementProps;
7
+ };
8
+ declare const FileBlockOptions: ({ editor, block, props: fileProps }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export { FileBlockOptions };
10
+ //# sourceMappingURL=FileBlockOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileBlockOptions.d.ts","sourceRoot":"","sources":["../../src/ui/FileBlockOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAM,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAI5C,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF,QAAA,MAAM,gBAAgB,wCAAyC,KAAK,4CAuBnE,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { FileElementProps } from '../types';
2
+ type FileComponentProps = Partial<FileElementProps> & {
3
+ blockId: string;
4
+ };
5
+ declare const FileComponent: ({ name, src, size, format }: FileComponentProps) => import("react/jsx-runtime").JSX.Element | null;
6
+ export { FileComponent, FileComponentProps };
7
+ //# sourceMappingURL=FileComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileComponent.d.ts","sourceRoot":"","sources":["../../src/ui/FileComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAI5C,KAAK,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,CAAC,GAAG;IACpD,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAUF,QAAA,MAAM,aAAa,gCAAiC,kBAAkB,mDAwBrE,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,kBAAkB,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 FilePlaceholderUploader: ({ floatingStyles, refs, onClose, blockId, onSetLoading }: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export { FilePlaceholderUploader };
11
+ //# sourceMappingURL=FilePlaceholderUploader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilePlaceholderUploader.d.ts","sourceRoot":"","sources":["../../src/ui/FilePlaceholderUploader.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAY,MAAM,OAAO,CAAC;AAGhD,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;AAEF,QAAA,MAAM,uBAAuB,6DAA8D,KAAK,4CA2B/F,CAAC;AAEF,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ type Props = {
2
+ onClose: () => void;
3
+ blockId: string;
4
+ accept?: string;
5
+ onSetLoading: (_s: boolean) => void;
6
+ };
7
+ declare const FileUploader: ({ accept, onClose, blockId, onSetLoading }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export { FileUploader };
9
+ //# sourceMappingURL=FileUploader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileUploader.d.ts","sourceRoot":"","sources":["../../src/ui/FileUploader.tsx"],"names":[],"mappings":"AAIA,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,+CAAqD,KAAK,4CAqD3E,CAAC;AAEF,OAAO,EAAE,YAAY,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) => import("react/jsx-runtime").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,4CAoB5D,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ declare const Placeholder: ({ attributes, children, blockId }: {
2
+ attributes: any;
3
+ children: any;
4
+ blockId: any;
5
+ }) => import("react/jsx-runtime").JSX.Element;
6
+ export { Placeholder };
7
+ //# 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;;;;6CAsDhB,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,24 +1,22 @@
1
1
  {
2
2
  "name": "@yoopta/file",
3
- "version": "2.0.1",
3
+ "version": "4.0.0-rc.1",
4
4
  "description": "> TODO: description",
5
5
  "author": "Darginec05 <devopsbanda@gmail.com>",
6
6
  "homepage": "https://github.com/Darginec05/Editor-Yoopta#readme",
7
7
  "license": "MIT",
8
8
  "private": false,
9
- "type": "module",
10
9
  "main": "dist/index.js",
10
+ "type": "module",
11
11
  "module": "dist/index.js",
12
12
  "types": "./dist/index.d.ts",
13
13
  "files": [
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
- "react-dom": ">=17.0.2",
20
- "slate": ">=0.72.3",
21
- "slate-react": ">=0.95.0"
19
+ "react-dom": ">=17.0.2"
22
20
  },
23
21
  "publishConfig": {
24
22
  "registry": "https://registry.yarnpkg.com"
@@ -28,9 +26,17 @@
28
26
  "url": "git+https://github.com/Darginec05/Editor-Yoopta.git"
29
27
  },
30
28
  "scripts": {
31
- "test": "node ./__tests__/yoopta-code.test.js"
29
+ "test": "node ./__tests__/yoopta-file.test.js",
30
+ "start": "rollup --config rollup.config.js --watch --bundleConfigAsCjs --environment NODE_ENV:development",
31
+ "prepublishOnly": "yarn build",
32
+ "build": "rollup --config rollup.config.js --bundleConfigAsCjs --environment NODE_ENV:production"
32
33
  },
33
34
  "bugs": {
34
35
  "url": "https://github.com/Darginec05/Editor-Yoopta/issues"
35
- }
36
+ },
37
+ "dependencies": {
38
+ "@floating-ui/react": "^0.26.9",
39
+ "@radix-ui/react-icons": "^1.3.0"
40
+ },
41
+ "gitHead": "520057761efabc31e3d87b58a16f9ebe76e6fe22"
36
42
  }
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- import { RenderYooptaElementProps, YooEditor } from '@yoopta/editor';
3
- import { FileElement, FilePluginOptions } from '../types';
4
- type Props = RenderYooptaElementProps<FileElement> & {
5
- editor: YooEditor;
6
- onUpload?: FilePluginOptions['onUpload'];
7
- accept?: FilePluginOptions['accept'];
8
- };
9
- declare const EditorPlaceholder: ({ element, accept, attributes, children, editor, onUpload }: Props) => JSX.Element;
10
- export { EditorPlaceholder };
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- declare const EditorUploader: ({ activeTab, style, switchTab, onChange, accept, onClose }: {
3
- activeTab?: string | undefined;
4
- style: any;
5
- switchTab: any;
6
- onChange: any;
7
- accept: any;
8
- onClose: any;
9
- }) => JSX.Element;
10
- export { EditorUploader };
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import { RenderYooptaElementProps, YooEditor, YooptaPluginType } from '@yoopta/editor';
3
- import { FileElement, FilePluginOptions } from '../types';
4
- type Props = {
5
- editor: YooEditor;
6
- plugin: YooptaPluginType<FilePluginOptions, FileElement>;
7
- element: RenderYooptaElementProps<FileElement>['element'];
8
- children: RenderYooptaElementProps<FileElement>['children'];
9
- attributes: RenderYooptaElementProps<FileElement>['attributes'];
10
- };
11
- declare const FileEditorFactory: (editor: Props['editor'], plugin: Props['plugin']) => (props: RenderYooptaElementProps<FileElement>) => JSX.Element;
12
- export { FileEditorFactory };