@yoopta/themes-shadcn 6.0.0-beta.1 → 6.0.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion/elements/accordion-item-heading.d.ts.map +1 -1
- package/dist/accordion.js +1 -0
- package/dist/{withShadcnUI.d.ts → applyTheme.d.ts} +3 -3
- package/dist/applyTheme.d.ts.map +1 -0
- package/dist/blockquote.js +1 -0
- package/dist/callout/elements/callout.d.ts.map +1 -1
- package/dist/callout.js +13 -0
- package/dist/carousel.js +1 -0
- package/dist/chunks/Combination-ee85502b.js +1 -0
- package/dist/chunks/_tslib-35bb891d.js +1 -0
- package/dist/chunks/arrow-right-07affdbc.js +13 -0
- package/dist/chunks/button-ecb0aed1.js +1 -0
- package/dist/chunks/card-94325fef.js +1 -0
- package/dist/chunks/check-9adcfdfa.js +7 -0
- package/dist/chunks/chevron-down-abe5f871.js +7 -0
- package/dist/chunks/chevron-up-5b4801a9.js +7 -0
- package/dist/chunks/code-734dab76.js +7 -0
- package/dist/chunks/createLucideIcon-70ab5429.js +26 -0
- package/dist/chunks/dropdown-menu-b5845753.js +13 -0
- package/dist/chunks/external-link-956d49c0.js +7 -0
- package/dist/chunks/file-text-f268c203.js +7 -0
- package/dist/chunks/hover-card-4448c400.js +1 -0
- package/dist/chunks/index-056e5c06.js +1 -0
- package/dist/chunks/index-13505606.js +1 -0
- package/dist/chunks/index-325e2e09.js +1 -0
- package/dist/chunks/index-3b428d14.js +13 -0
- package/dist/chunks/index-70f4e709.js +1 -0
- package/dist/chunks/index-7725d7e0.js +1 -0
- package/dist/chunks/index-842a4484.js +1 -0
- package/dist/chunks/index-8dc6d938.js +1 -0
- package/dist/chunks/index-91a5b8d5.js +1 -0
- package/dist/chunks/index-aaeb33b0.js +1 -0
- package/dist/chunks/index-b273f426.js +1 -0
- package/dist/chunks/index-e9d6a4a8.js +7 -0
- package/dist/chunks/input-2708c7f4.js +1 -0
- package/dist/chunks/label-a0e6fde2.js +1 -0
- package/dist/chunks/language-select-d2235078.js +7 -0
- package/dist/chunks/play-ae8c52d2.js +7 -0
- package/dist/chunks/plus-0381140e.js +7 -0
- package/dist/chunks/popover-53c769ba.js +1 -0
- package/dist/chunks/scroll-area-f7cd99a3.js +1 -0
- package/dist/chunks/select-c547d76b.js +7 -0
- package/dist/chunks/separator-7be92037.js +1 -0
- package/dist/chunks/sparkles-c8608d1b.js +7 -0
- package/dist/chunks/style-inject.es-e87a8d02.js +1 -0
- package/dist/chunks/tabs-eeea28d9.js +1 -0
- package/dist/chunks/tooltip-bc45d963.js +7 -0
- package/dist/chunks/trash-2-8f855002.js +7 -0
- package/dist/chunks/upload-3b3687f2.js +13 -0
- package/dist/chunks/utils-de9c4c2b.js +1 -0
- package/dist/chunks/x-ec326bc0.js +7 -0
- package/dist/code/elements/code.d.ts.map +1 -1
- package/dist/code/elements/language-select.d.ts.map +1 -1
- package/dist/code-group/elements/code-group-content.d.ts.map +1 -1
- package/dist/code-group/elements/code-group-item-heading.d.ts.map +1 -1
- package/dist/code-group/elements/code-group-list.d.ts.map +1 -1
- package/dist/code-group.js +1 -0
- package/dist/code.js +1 -0
- package/dist/divider/elements/divider.d.ts.map +1 -1
- package/dist/divider.js +1 -0
- package/dist/embed/elements/embed/embed-element.d.ts +3 -0
- package/dist/embed/elements/embed/embed-element.d.ts.map +1 -0
- package/dist/embed/elements/embed/embed-inline-toolbar.d.ts +13 -0
- package/dist/embed/elements/embed/embed-inline-toolbar.d.ts.map +1 -0
- package/dist/embed/elements/embed/embed-placeholder.d.ts +11 -0
- package/dist/embed/elements/embed/embed-placeholder.d.ts.map +1 -0
- package/dist/embed/elements/embed/embed-render.d.ts +18 -0
- package/dist/embed/elements/embed/embed-render.d.ts.map +1 -0
- package/dist/embed/index.d.ts +6 -0
- package/dist/embed/index.d.ts.map +1 -0
- package/dist/embed/types.d.ts +3 -0
- package/dist/embed/types.d.ts.map +1 -0
- package/dist/embed.js +13 -0
- package/dist/file/elements/file/file-element.d.ts +3 -0
- package/dist/file/elements/file/file-element.d.ts.map +1 -0
- package/dist/file/elements/file/file-icons.d.ts +14 -0
- package/dist/file/elements/file/file-icons.d.ts.map +1 -0
- package/dist/file/elements/file/file-inline-toolbar.d.ts +12 -0
- package/dist/file/elements/file/file-inline-toolbar.d.ts.map +1 -0
- package/dist/file/elements/file/file-placeholder.d.ts +15 -0
- package/dist/file/elements/file/file-placeholder.d.ts.map +1 -0
- package/dist/file/elements/file/file-render.d.ts +14 -0
- package/dist/file/elements/file/file-render.d.ts.map +1 -0
- package/dist/file/index.d.ts +6 -0
- package/dist/file/index.d.ts.map +1 -0
- package/dist/file/types.d.ts +3 -0
- package/dist/file/types.d.ts.map +1 -0
- package/dist/file.js +13 -0
- package/dist/headings.js +1 -0
- package/dist/image/elements/image/image-placeholder.d.ts.map +1 -1
- package/dist/image/elements/image/image-render.d.ts +1 -1
- package/dist/image/elements/image/image-render.d.ts.map +1 -1
- package/dist/image.js +7 -0
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -14
- package/dist/link/elements/link/link-element.d.ts.map +1 -1
- package/dist/link/elements/link/link-preview.d.ts.map +1 -1
- package/dist/link.js +7 -0
- package/dist/lists.js +1 -0
- package/dist/mention/elements/mention/mention-avatar.d.ts +10 -0
- package/dist/mention/elements/mention/mention-avatar.d.ts.map +1 -0
- package/dist/mention/elements/mention/mention-dropdown.d.ts +8 -0
- package/dist/mention/elements/mention/mention-dropdown.d.ts.map +1 -0
- package/dist/mention/elements/mention/mention-element.d.ts +3 -0
- package/dist/mention/elements/mention/mention-element.d.ts.map +1 -0
- package/dist/mention/elements/mention/mention-item.d.ts +11 -0
- package/dist/mention/elements/mention/mention-item.d.ts.map +1 -0
- package/dist/mention/index.d.ts +11 -0
- package/dist/mention/index.d.ts.map +1 -0
- package/dist/mention/types.d.ts +17 -0
- package/dist/mention/types.d.ts.map +1 -0
- package/dist/mention.js +13 -0
- package/dist/paragraph.js +1 -0
- package/dist/steps/elements/steps-container.d.ts.map +1 -1
- package/dist/steps/elements/steps-list-item.d.ts.map +1 -1
- package/dist/steps.js +1 -0
- package/dist/table/components/add-column-button.d.ts +1 -3
- package/dist/table/components/add-column-button.d.ts.map +1 -1
- package/dist/table/components/add-row-button.d.ts +1 -3
- package/dist/table/components/add-row-button.d.ts.map +1 -1
- package/dist/table/components/column-controls.d.ts +1 -5
- package/dist/table/components/column-controls.d.ts.map +1 -1
- package/dist/table/components/column-resize-handles.d.ts +6 -0
- package/dist/table/components/column-resize-handles.d.ts.map +1 -0
- package/dist/table/components/row-controls.d.ts +1 -5
- package/dist/table/components/row-controls.d.ts.map +1 -1
- package/dist/table/components/table-controls.d.ts.map +1 -1
- package/dist/table/elements/table-data-cell.d.ts.map +1 -1
- package/dist/table/elements/table.d.ts.map +1 -1
- package/dist/table-of-contents/elements/table-of-contents.d.ts +3 -0
- package/dist/table-of-contents/elements/table-of-contents.d.ts.map +1 -0
- package/dist/table-of-contents/index.d.ts +6 -0
- package/dist/table-of-contents/index.d.ts.map +1 -0
- package/dist/table-of-contents.js +1 -0
- package/dist/table.js +13 -0
- package/dist/tabs/elements/tabs-item-heading.d.ts.map +1 -1
- package/dist/tabs/elements/tabs-list.d.ts.map +1 -1
- package/dist/tabs.js +1 -0
- package/dist/ui/switch.d.ts +5 -0
- package/dist/ui/switch.d.ts.map +1 -0
- package/dist/video/elements/video/video-element.d.ts +3 -0
- package/dist/video/elements/video/video-element.d.ts.map +1 -0
- package/dist/video/elements/video/video-inline-toolbar-settings.d.ts +14 -0
- package/dist/video/elements/video/video-inline-toolbar-settings.d.ts.map +1 -0
- package/dist/video/elements/video/video-inline-toolbar.d.ts +14 -0
- package/dist/video/elements/video/video-inline-toolbar.d.ts.map +1 -0
- package/dist/video/elements/video/video-placeholder.d.ts +16 -0
- package/dist/video/elements/video/video-placeholder.d.ts.map +1 -0
- package/dist/video/elements/video/video-render.d.ts +18 -0
- package/dist/video/elements/video/video-render.d.ts.map +1 -0
- package/dist/video/index.d.ts +6 -0
- package/dist/video/index.d.ts.map +1 -0
- package/dist/video/types.d.ts +4 -0
- package/dist/video/types.d.ts.map +1 -0
- package/dist/video.js +7 -0
- package/package.json +172 -12
- package/dist/withShadcnUI.d.ts.map +0 -1
package/dist/table.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as l}from"react/jsx-runtime";import{forwardRef as n,useState as o,useRef as r,useEffect as s,useCallback as a,useMemo as c}from"react";import{useYooptaEditor as i,Blocks as d}from"@yoopta/editor";import{TableCommands as u,TABLE_CELLS_IN_SELECTION as m,TABLE_SLATE_TO_SELECTION_SET as h}from"@yoopta/table";import{_ as b}from"./chunks/_tslib-35bb891d.js";import{c as p}from"./chunks/utils-de9c4c2b.js";import{Portal as g}from"@yoopta/ui/portal";import{Editor as v,Element as f}from"slate";import{B as w}from"./chunks/button-ecb0aed1.js";import{P as y}from"./chunks/plus-0381140e.js";import{D as x,a as k,b as j,c as N,e as C,E as O,A as M,d as E,f as z,g as I,h as L}from"./chunks/dropdown-menu-b5845753.js";import{c as $}from"./chunks/createLucideIcon-70ab5429.js";import{A as S,a as B}from"./chunks/arrow-right-07affdbc.js";import{T as R}from"./chunks/trash-2-8f855002.js";import{L as T}from"./chunks/label-a0e6fde2.js";import{P as q,a as A,b as D}from"./chunks/popover-53c769ba.js";import{S as H}from"./chunks/separator-7be92037.js";import{C as P}from"./chunks/chevron-down-abe5f871.js";import{s as _}from"./chunks/style-inject.es-e87a8d02.js";import"./chunks/index-8dc6d938.js";import"react-dom";import"./chunks/index-91a5b8d5.js";import"./chunks/index-7725d7e0.js";import"./chunks/index-aaeb33b0.js";import"./chunks/index-13505606.js";import"./chunks/index-842a4484.js";import"./chunks/index-70f4e709.js";import"./chunks/Combination-ee85502b.js";import"./chunks/index-325e2e09.js";import"./chunks/index-b273f426.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v0.378.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/const V=$("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),G=$("Eraser",[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]]),W=$("Merge",[["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M12 2v10.3a4 4 0 0 1-1.172 2.872L4 22",key:"1hyw0i"}],["path",{d:"m20 22-5-5",key:"1m27yz"}]]),X=$("MoveHorizontal",[["polyline",{points:"18 8 22 12 18 16",key:"1hqrds"}],["polyline",{points:"6 8 2 12 6 16",key:"f0ernq"}],["line",{x1:"2",x2:"22",y1:"12",y2:"12",key:"1dnqot"}]]),Y=$("MoveVertical",[["polyline",{points:"8 18 12 22 16 18",key:"1uutw3"}],["polyline",{points:"8 6 12 2 16 6",key:"d60sxy"}],["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}]]),F=$("Paintbrush",[["path",{d:"M18.37 2.63 14 7l-1.59-1.59a2 2 0 0 0-2.82 0L8 7l9 9 1.59-1.59a2 2 0 0 0 0-2.82L17 10l4.37-4.37a2.12 2.12 0 1 0-3-3Z",key:"m6k5sh"}],["path",{d:"M9 8c-2 3-4 3.5-7 4l8 10c2-1 6-5 6-7",key:"arzq70"}],["path",{d:"M14.5 17.5 4.5 15",key:"s7fvrz"}]]),J=$("Table2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]),Z=$("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]),K=n((t,l)=>{var{className:n}=t,o=b(t,["className"]);return e("div",Object.assign({"data-slot":"table-container",className:"relative w-full overflow-x-auto rounded-md"},{children:e("table",Object.assign({ref:l,"data-slot":"table",className:p("caption-bottom text-sm table-fixed border-collapse",n)},o))}))});
|
|
8
|
+
/**
|
|
9
|
+
* @license lucide-react v0.378.0 - ISC
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the ISC license.
|
|
12
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/K.displayName="Table";n((t,l)=>{var{className:n}=t,o=b(t,["className"]);return e("thead",Object.assign({ref:l,"data-slot":"table-header",className:p("[&_tr]:border-b",n)},o))}).displayName="TableHeader";const Q=n((t,l)=>{var{className:n}=t,o=b(t,["className"]);return e("tbody",Object.assign({ref:l,"data-slot":"table-body",className:p("[&_tr:first-child]:border-t [&_tr]:border-b [&_tr]:border-border",n)},o))});Q.displayName="TableBody";n((t,l)=>{var{className:n}=t,o=b(t,["className"]);return e("tfoot",Object.assign({ref:l,"data-slot":"table-footer",className:p("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",n)},o))}).displayName="TableFooter";const U=n((t,l)=>{var{className:n}=t,o=b(t,["className"]);return e("tr",Object.assign({ref:l,"data-slot":"table-row",className:p("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",n)},o))});U.displayName="TableRow";const ee=n((t,l)=>{var{className:n}=t,o=b(t,["className"]);return e("th",Object.assign({ref:l,"data-slot":"table-head",className:p("border-border border-r last:border-r-0 text-foreground h-10 px-2 text-left font-medium [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] bg-muted/50",n)},o))});ee.displayName="TableHead";const te=n((t,l)=>{var{className:n}=t,o=b(t,["className"]);return e("td",Object.assign({ref:l,"data-slot":"table-cell",className:p("border-border border-r last:border-r-0 p-2 [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",n)},o))});te.displayName="TableCell";n((t,l)=>{var{className:n}=t,o=b(t,["className"]);return e("caption",Object.assign({ref:l,"data-slot":"table-caption",className:p("text-muted-foreground mt-4 text-sm",n)},o))}).displayName="TableCaption";const le=({blockId:t})=>{const l=i(),[n,c]=o(null),[d,m]=o(!1),[h,b]=o(null),[p,v]=o([]),f=r(0),w=r(0),y=r([]),x=r(null),k=r(null),j=r(null);s(()=>{y.current=p},[p]),s(()=>{k.current=n},[n]),s(()=>{x.current=h},[h]);const N=a(()=>{const e=document.querySelector(`[data-yoopta-block-id="${t}"][data-table-container]`);if(!e)return;const l=e.querySelector("table");if(!l)return;const n=l.getBoundingClientRect();c(n);const o=l.querySelector("colgroup");j.current=o;const r=l.querySelectorAll("colgroup col"),s=l.querySelector("tr");if(r.length>0){const e=[];n.left,r.forEach((t,l)=>{const n=window.getComputedStyle(t),o=parseInt(n.width,10)||200;e.push(o)}),v(e)}else if(s){const e=s.querySelectorAll("td, th"),t=[],l=[];e.forEach((e,n)=>{const o=e.getBoundingClientRect();l.push(o.width),t.push({index:n,left:o.left,width:o.width})}),v(l)}},[t]);s(()=>{N();const e=document.querySelector(`[data-yoopta-block-id="${t}"][data-table-container]`);if(!e)return;const l=e.querySelector("table");if(!l)return;const n=new ResizeObserver(()=>{d||N()});n.observe(l);const o=new MutationObserver(()=>{d||N()});o.observe(l,{childList:!0,subtree:!0});const r=()=>{d||N()};return window.addEventListener("scroll",r,!0),()=>{n.disconnect(),o.disconnect(),window.removeEventListener("scroll",r,!0)}},[t,N,d]);const C=a(e=>{if(!j.current)return;j.current.querySelectorAll("col").forEach((t,l)=>{void 0!==e[l]&&(t.style.width=`${e[l]}px`)})},[]),O=a((e,t)=>{if(!t||0===e.length)return[];let l=t.left;return e.map((e,t)=>{const n={index:t,left:l,width:e};return l+=e,n})},[]),M=a((e,t)=>{e.preventDefault(),e.stopPropagation();const l=p[t];void 0!==l&&(m(!0),b(t),f.current=e.clientX,w.current=l,document.body.classList.add("resizing-column"))},[p]),E=a(e=>{const t=x.current;if(null===t)return;const l=e.clientX-f.current,n=Math.max(50,w.current+l),o=[...y.current];o[t]=n,v(o),C(o)},[C]),z=a(()=>{const e=x.current,n=y.current;null!==e&&void 0!==n[e]&&u.setColumnWidth(l,t,e,n[e]),m(!1),b(null),document.body.classList.remove("resizing-column"),setTimeout(N,50)},[l,t,N]);if(s(()=>{if(d)return document.addEventListener("mousemove",E),document.addEventListener("mouseup",z),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",z)}},[d,E,z]),!n||0===p.length)return null;const I=O(p,n).slice(0,-1).map(t=>{const l=t.left+t.width-3;return e("div",{className:"column-resize-handle",style:{position:"fixed",left:`${l}px`,top:`${n.top}px`,width:"6px",height:`${n.height}px`,cursor:"col-resize",zIndex:50,backgroundColor:d&&h===t.index?"hsl(var(--primary))":"transparent"},onMouseDown:e=>M(e,t.index),onMouseEnter:e=>{d||(e.target.style.backgroundColor="hsl(var(--primary) / 0.3)")},onMouseLeave:e=>{d||(e.target.style.backgroundColor="transparent")}},`resize-${t.index}`)});return e(g,Object.assign({id:"column-resize-handles-container"},{children:e("div",Object.assign({className:"column-resize-handles-container",style:{pointerEvents:d?"auto":void 0}},{children:I}))}))},ne=({blockId:t,totalColumns:l,position:n,onMouseEnter:o,onMouseLeave:r})=>{const s=i(),c=a(()=>{const e=[0,0,l-1,0];u.insertTableColumn(s,t,{path:e,insertMode:"after"})},[s,t,l]);return e(g,Object.assign({id:`table-add-column-button-${t}`},{children:e("div",Object.assign({className:"fixed z-[9999] pointer-events-auto",style:{left:`${n.left+4}px`,top:`${n.top}px`,width:"18px",height:`${n.height}px`},onMouseEnter:o,onMouseLeave:r},{children:e(w,Object.assign({variant:"ghost",size:"sm",className:"p-0 h-full w-full bg-background/95 hover:bg-accent border border-border/50 shadow-sm rounded-md transition-all hover:shadow-md flex items-center justify-center text-muted-foreground hover:text-foreground",onClick:c,onMouseDown:e=>e.preventDefault()},{children:e(y,{className:"h-3 w-3"})}))}))}))},oe=({blockId:t,totalRows:l,position:n,onMouseEnter:o,onMouseLeave:r})=>{const s=i(),c=a(()=>{const e=[0,l-1,0,0];u.insertTableRow(s,t,{path:e,insertMode:"after"})},[s,t,l]);return e(g,Object.assign({id:`table-add-row-button-${t}`},{children:e("div",Object.assign({className:"fixed z-[9999] pointer-events-auto",style:{left:`${n.left}px`,top:`${n.top+4}px`,width:`${n.width}px`,height:"18px"},onMouseEnter:o,onMouseLeave:r},{children:e(w,Object.assign({variant:"ghost",size:"sm",className:"h-full w-full bg-background/95 hover:bg-accent border border-border/50 shadow-sm rounded-md transition-all hover:shadow-md flex items-center justify-center gap-1.5 text-muted-foreground hover:text-foreground",onClick:c,onMouseDown:e=>e.preventDefault()},{children:e(y,{className:"h-3 w-3"})}))}))}))},re=({blockId:n,colIndex:o,position:r,onMouseEnter:s,onMouseLeave:d})=>{const m=i(),h=c(()=>[0,0,o,0],[o]),b=a(()=>{u.insertTableColumn(m,n,{path:h,insertMode:"before"})},[m,n,h]),p=a(()=>{u.insertTableColumn(m,n,{path:h,insertMode:"after"})},[m,n,h]),v=a(()=>{u.deleteTableColumn(m,n,{path:h})},[m,n,h]),f=a(()=>{u.toggleHeaderColumn(m,n)},[m,n]);return e(g,Object.assign({id:`table-column-controls-${n}-${o}`},{children:e("div",Object.assign({className:"fixed z-[9999] pointer-events-auto",style:{left:`${r.left}px`,top:`${r.top+4}px`,width:`${r.width}px`,height:"18px"},onMouseEnter:s,onMouseLeave:d},{children:t(x,{children:[e(k,Object.assign({asChild:!0},{children:e(w,Object.assign({variant:"ghost",size:"sm",className:"h-full w-full bg-background/95 hover:bg-accent border border-border/50 shadow-sm rounded-md p-0 transition-all hover:shadow-md",onMouseDown:e=>e.preventDefault()},{children:e(V,{className:"h-3 w-3 text-muted-foreground"})}))})),t(j,Object.assign({align:"start",side:"top",className:"w-48"},{children:[0===o&&t(l,{children:[t(N,Object.assign({onClick:f},{children:[e(J,{className:"mr-2 h-4 w-4"}),"Header column"]})),e(C,{})]}),t(N,Object.assign({onClick:b},{children:[e(S,{className:"mr-2 h-4 w-4"}),"Insert column left"]})),t(N,Object.assign({onClick:p},{children:[e(B,{className:"mr-2 h-4 w-4"}),"Insert column right"]})),e(C,{}),t(N,Object.assign({onClick:v,className:"text-destructive focus:text-destructive"},{children:[e(R,{className:"mr-2 h-4 w-4"}),"Delete column"]}))]}))]})}))}))},se=({blockId:n,rowIndex:o,position:r,onMouseEnter:s,onMouseLeave:d})=>{const m=i(),h=c(()=>[0,o,0,0],[o]),b=a(()=>{u.insertTableRow(m,n,{path:h,insertMode:"before"})},[m,n,h]),p=a(()=>{u.insertTableRow(m,n,{path:h,insertMode:"after"})},[m,n,h]),v=a(()=>{u.deleteTableRow(m,n,{path:h})},[m,n,h]),f=a(()=>{u.toggleHeaderRow(m,n)},[m,n]);return e(g,Object.assign({id:`table-row-controls-${n}-${o}`},{children:e("div",Object.assign({className:"fixed z-[9998] pointer-events-auto",style:{left:`${r.left+20}px`,top:`${r.top}px`,width:"18px",height:`${r.height}px`},onMouseEnter:s,onMouseLeave:d},{children:t(x,{children:[e(k,Object.assign({asChild:!0},{children:e(w,Object.assign({variant:"ghost",size:"sm",className:"h-full w-full bg-background/95 hover:bg-accent border border-border/50 shadow-sm rounded-md p-0 transition-all hover:shadow-md flex items-center justify-center",onMouseDown:e=>e.preventDefault()},{children:e(O,{className:"h-3 w-3 text-muted-foreground"})}))})),t(j,Object.assign({align:"start",side:"left",className:"w-48"},{children:[0===o&&t(l,{children:[t(N,Object.assign({onClick:f},{children:[e(J,{className:"mr-2 h-4 w-4"}),"Header row"]})),e(C,{})]}),t(N,Object.assign({onClick:b},{children:[e(M,{className:"mr-2 h-4 w-4"}),"Insert row above"]})),t(N,Object.assign({onClick:p},{children:[e(E,{className:"mr-2 h-4 w-4"}),"Insert row below"]})),e(C,{}),t(N,Object.assign({onClick:v,className:"text-destructive focus:text-destructive"},{children:[e(R,{className:"mr-2 h-4 w-4"}),"Delete row"]}))]}))]})}))}))},ae=({blockId:n})=>{const u=i(),m=c(()=>d.getBlockSlate(u,{id:n}),[n,u]),[h,b]=o(null),[p,g]=o(!1),[w,y]=o({rowControls:null,columnControls:null,addRowButton:null,addColumnButton:null}),x=r(!1),k=r(!1),j=r(null),N=r(null);N.current=h;const C=a(()=>{const e=N.current;if(!e)return void y({rowControls:null,columnControls:null,addRowButton:null,addColumnButton:null});const t=document.querySelector(`[data-yoopta-block-id="${n}"][data-table-container]`);if(!t)return;const l=t.querySelector("table");if(!l)return;const o=l.getBoundingClientRect(),r=Array.from(t.querySelectorAll("tr")),s=r[e.rowIndex];if(!s)return;const a=Array.from(s.querySelectorAll('[data-element-type="table-data-cell"]'));if(0===a.length)return;const c=a.map(e=>e.getBoundingClientRect()),i=Math.min(...c.map(e=>e.top)),d=Math.max(...c.map(e=>e.bottom)),u=Math.min(...c.map(e=>e.left)),m=Math.max(...c.map(e=>e.right)),h=d-i,b=[];r.forEach(t=>{const l=Array.from(t.querySelectorAll('[data-element-type="table-data-cell"]'));l[e.colIndex]&&b.push(l[e.colIndex].getBoundingClientRect())});const p=b.length>0?Math.min(...b.map(e=>e.left)):u,g=(b.length>0?Math.max(...b.map(e=>e.right)):m)-p,v=b.length>0?Math.min(...b.map(e=>e.top)):i,f=e.rowIndex===e.totalRows-1,w=e.colIndex===e.totalColumns-1;y({rowControls:{left:Math.max(0,u-32),top:i,height:h},columnControls:{left:p,top:v-32,width:g},addRowButton:f?{left:o.left,top:o.bottom,width:o.width}:null,addColumnButton:w?{left:o.right,top:o.top,height:o.height}:null})},[n]);s(()=>{if(!h||!p)return;const e=()=>{C()};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),C(),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[h,p,C]);const O=a(()=>{j.current&&(clearTimeout(j.current),j.current=null)},[]),M=a(()=>{O(),j.current=setTimeout(()=>{x.current||k.current||(g(!1),b(null))},150)},[O]),E=a(e=>{if(!m)return null;const t=Array.from(v.nodes(m,{at:[0],match:t=>{if(!f.isElement(t))return!1;const l=t;return"table-data-cell"===l.type&&"id"in l&&l.id===e},mode:"all"}));if(0===t.length)return null;const[,l]=t[0],n=l[l.length-2],o=l[l.length-1],r=Array.from(v.nodes(m,{at:[0],match:e=>f.isElement(e)&&"table"===e.type,mode:"lowest"}));if(0===r.length)return null;const[s]=r[0];if(!f.isElement(s))return null;const a=s.children.length,c=s.children[0];if(!f.isElement(c))return null;const i=c.children.length;return{rowIndex:n,colIndex:o,cellElementId:e,totalRows:a,totalColumns:i}},[m]);s(()=>{const e=document.querySelector(`[data-yoopta-block-id="${n}"][data-table-container]`);if(!e||!m)return;const t=e=>{O(),x.current=!0;const t=e.target.closest('[data-element-type="table-data-cell"]');if(!t)return;const l=t.getAttribute("data-yoopta-element-id");if(!l)return;const n=N.current;if((null==n?void 0:n.cellElementId)===l)return void g(!0);const o=E(l);o&&(b(o),g(!0))},l=()=>{x.current=!1,M()};return e.addEventListener("mousemove",t),e.addEventListener("mouseleave",l),()=>{O(),e.removeEventListener("mousemove",t),e.removeEventListener("mouseleave",l)}},[n,m,E,O,M]);const z=a(()=>{O(),k.current=!0},[O]),I=a(()=>{k.current=!1,M()},[M]);return p&&h?t(l,{children:[w.rowControls&&e(se,{blockId:n,rowIndex:h.rowIndex,position:w.rowControls,onMouseEnter:z,onMouseLeave:I}),w.columnControls&&e(re,{blockId:n,colIndex:h.colIndex,position:w.columnControls,onMouseEnter:z,onMouseLeave:I}),w.addColumnButton&&e(ne,{blockId:n,totalColumns:h.totalColumns,position:w.addColumnButton,onMouseEnter:z,onMouseLeave:I}),w.addRowButton&&e(oe,{blockId:n,totalRows:h.totalRows,position:w.addRowButton,onMouseEnter:z,onMouseLeave:I})]}):null},ce=[{label:"None",value:"transparent",color:"transparent"},{label:"Gray",value:"hsl(var(--muted))",color:"hsl(var(--muted))"},{label:"Red",value:"hsl(0 70% 95%)",color:"hsl(0 70% 95%)"},{label:"Orange",value:"hsl(30 70% 95%)",color:"hsl(30 70% 95%)"},{label:"Yellow",value:"hsl(60 70% 95%)",color:"hsl(60 70% 95%)"},{label:"Green",value:"hsl(120 70% 95%)",color:"hsl(120 70% 95%)"},{label:"Blue",value:"hsl(210 70% 95%)",color:"hsl(210 70% 95%)"},{label:"Purple",value:"hsl(270 70% 95%)",color:"hsl(270 70% 95%)"}],ie=[{label:"Default",value:"inherit",color:"currentColor"},{label:"Gray",value:"hsl(var(--muted-foreground))",color:"hsl(var(--muted-foreground))"},{label:"Red",value:"hsl(0 70% 50%)",color:"hsl(0 70% 50%)"},{label:"Orange",value:"hsl(30 70% 50%)",color:"hsl(30 70% 50%)"},{label:"Yellow",value:"hsl(60 70% 40%)",color:"hsl(60 70% 40%)"},{label:"Green",value:"hsl(120 70% 40%)",color:"hsl(120 70% 40%)"},{label:"Blue",value:"hsl(210 70% 50%)",color:"hsl(210 70% 50%)"},{label:"Purple",value:"hsl(270 70% 50%)",color:"hsl(270 70% 50%)"}],de=({blockId:n})=>{const r=i(),a=c(()=>d.getBlockSlate(r,{id:n}),[n,r]),[h,b]=o(null),[p,g]=o(!1),[v,f]=o([]),y=a?m.get(a):[];s(()=>{f(y)},[y]);const C=Array.isArray(y)&&(null==y?void 0:y.length)>0?y:v;s(()=>{if(!a||!C||C.length<=1)return void b(null);const e=document.querySelector(`[data-yoopta-block-id="${n}"]`);if(!e)return void b(null);const t=e.getBoundingClientRect();let l=1/0,o=-1/0,r=1/0,s=-1/0;for(const[e]of C){const t=document.querySelector(`[data-yoopta-block-id="${n}"] [data-yoopta-element-id="${e.id}"]`);if(!t)continue;const a=t.getBoundingClientRect();if(!a)continue;const{top:c,bottom:i,left:d,right:u}=a;l=Math.min(l,c),o=Math.max(o,i),r=Math.min(r,d),s=Math.max(s,u)}b(l!==1/0?{top:l-t.top,left:r-t.left,width:s-r,height:o-l}:null)},[a,C,n]),s(()=>{if(!C||C.length<=1)return;const e=()=>{b(e=>e?Object.assign({},e):null)};return window.addEventListener("scroll",e,!0),window.addEventListener("resize",e),()=>{window.removeEventListener("scroll",e,!0),window.removeEventListener("resize",e)}},[C]);const M=e=>{r&&C&&0!==C.length&&(u.setCellHorizontalAlign(r,n,{cells:C,align:e}),g(!1))},E=e=>{r&&C&&0!==C.length&&(u.setCellVerticalAlign(r,n,{cells:C,align:e}),g(!1))};return h?t(l,{children:[e("div",{className:"pointer-events-none absolute z-[9999]",style:{top:`${h.top}px`,left:`${h.left}px`,width:`${h.width}px`,height:`${h.height}px`,border:"2px solid hsl(var(--primary))",backgroundColor:"hsl(var(--primary) / 0.05)",borderRadius:"2px"}}),e("div",Object.assign({className:"absolute z-20 pointer-events-auto",style:{top:`${h.top+h.height/2}px`,left:`${h.left+h.width}px`,transform:"translate(-50%, -50%)"}},{children:t(q,Object.assign({open:p,onOpenChange:g},{children:[e(A,Object.assign({asChild:!0},{children:e(w,Object.assign({variant:"secondary",size:"icon",className:"h-4 w-4 rounded-full shadow-lg bg-primary hover:bg-primary/90",onMouseDown:e=>e.preventDefault()},{children:e(O,{className:"h-3 w-3 text-primary-foreground"})}))})),e(D,Object.assign({className:"w-64 p-2",align:"start",side:"right"},{children:t("div",Object.assign({className:"space-y-2"},{children:[t(w,Object.assign({variant:"ghost",size:"sm",className:"w-full justify-start gap-2",onClick:()=>{!r||!C||C.length<=1||(u.mergeCells(r,n,{cells:C}),g(!1))},disabled:!C||C.length<=1},{children:[e(W,{className:"h-4 w-4"}),"Merge cells"]})),e(H,{}),t("div",Object.assign({className:"space-y-1"},{children:[e(T,Object.assign({className:"text-sm font-medium"},{children:"Color"})),t(x,{children:[e(k,Object.assign({asChild:!0},{children:t(w,Object.assign({variant:"outline",size:"sm",className:"w-full justify-between"},{children:[t("span",Object.assign({className:"flex items-center gap-2"},{children:[e(F,{className:"h-4 w-4"}),"Select color"]})),e(P,{className:"h-4 w-4 opacity-50"})]}))})),t(j,Object.assign({className:"w-56",align:"start"},{children:[t(z,{children:[t(I,{children:[e(F,{className:"mr-2 h-4 w-4"}),"Background color"]}),e(L,{children:ce.map(l=>e(N,Object.assign({onClick:()=>(e=>{r&&C&&0!==C.length&&(u.setCellBackgroundColor(r,n,{cells:C,color:e}),g(!1))})(l.value)},{children:t("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",{className:"h-4 w-4 rounded border",style:{backgroundColor:l.color}}),l.label]}))}),l.value))})]}),t(z,{children:[t(I,{children:[e(Z,{className:"mr-2 h-4 w-4"}),"Text color"]}),e(L,{children:ie.map(l=>e(N,Object.assign({onClick:()=>(e=>{r&&C&&0!==C.length&&(u.setCellTextColor(r,n,{cells:C,color:e}),g(!1))})(l.value)},{children:t("div",Object.assign({className:"flex items-center gap-2"},{children:[e("div",Object.assign({className:"h-4 w-4 rounded border flex items-center justify-center text-xs font-bold",style:{color:l.color}},{children:"A"})),l.label]}))}),l.value))})]})]}))]})]})),t("div",Object.assign({className:"space-y-1"},{children:[e(T,Object.assign({className:"text-sm font-medium"},{children:"Alignment"})),t(x,{children:[e(k,Object.assign({asChild:!0},{children:t(w,Object.assign({variant:"outline",size:"sm",className:"w-full justify-between"},{children:[t("span",Object.assign({className:"flex items-center gap-2"},{children:[e(X,{className:"h-4 w-4"}),"Select alignment"]})),e(P,{className:"h-4 w-4 opacity-50"})]}))})),t(j,Object.assign({className:"w-56",align:"start"},{children:[t(z,{children:[t(I,{children:[e(X,{className:"mr-2 h-4 w-4"}),"Horizontal"]}),t(L,{children:[e(N,Object.assign({onClick:()=>M("left")},{children:"Left"})),e(N,Object.assign({onClick:()=>M("center")},{children:"Center"})),e(N,Object.assign({onClick:()=>M("right")},{children:"Right"})),e(N,Object.assign({onClick:()=>M("justify")},{children:"Justify"}))]})]}),t(z,{children:[t(I,{children:[e(Y,{className:"mr-2 h-4 w-4"}),"Vertical"]}),t(L,{children:[e(N,Object.assign({onClick:()=>E("top")},{children:"Top"})),e(N,Object.assign({onClick:()=>E("middle")},{children:"Middle"})),e(N,Object.assign({onClick:()=>E("bottom")},{children:"Bottom"}))]})]})]}))]})]})),e(H,{}),t(w,Object.assign({variant:"ghost",size:"sm",className:"w-full justify-start gap-2 text-destructive hover:text-destructive",onClick:()=>{r&&C&&0!==C.length&&(u.clearContents(r,n,{cells:C}),g(!1))}},{children:[e(G,{className:"h-4 w-4"}),"Clear contents"]}))]}))}))]}))}))]}):null};_("[data-element-type=table-data-cell] [data-slate-node=element]{margin:0}[data-slate-node=table]{-webkit-user-select:none;-moz-user-select:none;user-select:none}[data-slate-node=table-data-cell]{cursor:cell}[data-slate-node=table-data-cell]:active{cursor:crosshair}[data-is-selecting=true] ::-moz-selection{background:none}[data-is-selecting=true] ::selection{background:none}.column-resize-handle{transition:background-color .15s ease}.column-resize-handle:hover{background-color:hsl(var(--primary)/.3)!important}body.resizing-column{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}body.resizing-column,body.resizing-column *{cursor:col-resize!important}");const ue={table:{render:n=>{var o,r;const{attributes:s,children:a,element:u}=n,m=u,b=i(),p=c(()=>d.getBlockSlate(b,{id:n.blockId}),[b,n.blockId]),g=p?h.get(p):null;return t("div",Object.assign({className:"p-4 overflow-x-auto","data-yoopta-block-id":n.blockId,"data-table-container":!0},{children:[t(K,Object.assign({},s,{"data-is-selecting":!!g},{children:[e("colgroup",{children:null===(r=null===(o=m.props)||void 0===o?void 0:o.columnWidths)||void 0===r?void 0:r.map((t,l)=>e("col",{style:{width:`${t}px`}},l))}),e(Q,{children:a})]})),!b.readOnly&&t(l,{children:[e(de,{blockId:n.blockId}),e(ae,{blockId:n.blockId}),e(le,{blockId:n.blockId})]})]}))}},"table-row":{render:t=>{const{attributes:l,children:n}=t;return e(U,Object.assign({},l,{children:n}))}},"table-data-cell":{render:t=>{var l,n,o,r,s,a,u,b,g,v,f,w;const{attributes:y,children:x,element:k}=t,j=k,N=i(),C=c(()=>d.getBlockSlate(N,{id:t.blockId}),[N,t.blockId]),O=(null===(l=j.props)||void 0===l?void 0:l.asHeader)?ee:te;return e(O,Object.assign({},y,{onMouseDown:e=>{N.readOnly||(e.stopPropagation(),C&&(m.delete(C),h.delete(C)))},colSpan:null!==(o=null===(n=j.props)||void 0===n?void 0:n.colSpan)&&void 0!==o?o:1,rowSpan:null!==(s=null===(r=j.props)||void 0===r?void 0:r.rowSpan)&&void 0!==s?s:1,align:null!==(u=null===(a=j.props)||void 0===a?void 0:a.align)&&void 0!==u?u:"left",valign:null!==(g=null===(b=j.props)||void 0===b?void 0:b.verticalAlign)&&void 0!==g?g:"middle","data-yoopta-element-id":j.id,className:p("relative group transition-colors"),style:{backgroundColor:null===(v=j.props)||void 0===v?void 0:v.backgroundColor,color:null!==(w=null===(f=j.props)||void 0===f?void 0:f.color)&&void 0!==w?w:"inherit"}},{children:x}))}}};export{ue as TableUI};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-item-heading.d.ts","sourceRoot":"","sources":["../../../src/tabs/elements/tabs-item-heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAO/D,eAAO,MAAM,eAAe,UAAW,wBAAwB,
|
|
1
|
+
{"version":3,"file":"tabs-item-heading.d.ts","sourceRoot":"","sources":["../../../src/tabs/elements/tabs-item-heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAO/D,eAAO,MAAM,eAAe,UAAW,wBAAwB,4CA2B9D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs-list.d.ts","sourceRoot":"","sources":["../../../src/tabs/elements/tabs-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAQ/D,eAAO,MAAM,eAAe,UAAW,wBAAwB,
|
|
1
|
+
{"version":3,"file":"tabs-list.d.ts","sourceRoot":"","sources":["../../../src/tabs/elements/tabs-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAQ/D,eAAO,MAAM,eAAe,UAAW,wBAAwB,4CA6B9D,CAAC"}
|
package/dist/tabs.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useYooptaEditor as s,Blocks as n}from"@yoopta/editor";import{Transforms as i,Element as r}from"slate";import{T as o,a,b as c,c as l}from"./chunks/tabs-eeea28d9.js";import{TabsCommands as d}from"@yoopta/tabs";import{X as u}from"./chunks/x-ec326bc0.js";import{S as m,a as p}from"./chunks/scroll-area-f7cd99a3.js";import{P as b}from"./chunks/plus-0381140e.js";import"./chunks/_tslib-35bb891d.js";import"react";import"./chunks/index-8dc6d938.js";import"react-dom";import"./chunks/index-91a5b8d5.js";import"./chunks/index-b273f426.js";import"./chunks/index-aaeb33b0.js";import"./chunks/index-325e2e09.js";import"./chunks/index-70f4e709.js";import"./chunks/index-7725d7e0.js";import"./chunks/index-13505606.js";import"./chunks/utils-de9c4c2b.js";import"./chunks/createLucideIcon-70ab5429.js";import"./chunks/index-056e5c06.js";const h={"tabs-container":{render:t=>{var a;const{attributes:c,children:l,blockId:d,element:u}=t,m=s();return e(o,Object.assign({},c,{value:null===(a=u.props)||void 0===a?void 0:a.activeTabId,onValueChange:e=>{const t=n.getBlockSlate(m,{id:d});t&&i.setNodes(t,{props:Object.assign(Object.assign({},u.props),{activeTabId:e})},{at:[0],match:e=>r.isElement(e)&&"tabs-container"===e.type})},className:"w-full"},{children:l}))}},"tabs-list":{render:n=>{const{attributes:i,children:r,blockId:o}=n,a=s();return t(m,Object.assign({className:"w-full"},{children:[t(l,Object.assign({},i,{className:"w-full relative justify-start"},{children:[r,!a.readOnly&&e("button",Object.assign({type:"button",contentEditable:!1,onClick:e=>{e.preventDefault(),e.stopPropagation(),d.addTabItem(a,o)},className:"ml-1 flex items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 p-1.5",title:"Add tab"},{children:e(b,{className:"h-4 w-4 shrink-0 text-muted-foreground"})}))]})),e(p,{orientation:"horizontal"})]}))}},"tabs-item-heading":{render:n=>{const{attributes:i,children:r,element:o,blockId:a}=n,l=s();return t(c,Object.assign({},i,{value:o.id,className:"relative group/tab flex items-center gap-2 pr-8 whitespace-nowrap"},{children:[e("div",Object.assign({className:"flex-1 min-w-0"},{children:r})),!l.readOnly&&e("span",Object.assign({contentEditable:!1,onClick:()=>{l.readOnly||d.deleteTabItem(l,a,{tabId:o.id})},className:"absolute right-1 flex items-center justify-center rounded-sm opacity-0 group-hover/tab:opacity-100 transition-opacity hover:bg-muted focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 p-1",title:"Close tab"},{children:e(u,{className:"h-3 w-3 shrink-0 text-muted-foreground"})}))]}))}},"tabs-item-content":{render:t=>{var s;const{attributes:n,children:i,element:r}=t;return e(a,Object.assign({},n,{value:null===(s=r.props)||void 0===s?void 0:s.referenceId,className:"mt-2"},{children:i}))}}};export{h as TabsUI};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
3
|
+
declare const Switch: React.ForwardRefExoticComponent<Omit<SwitchPrimitives.SwitchProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export { Switch };
|
|
5
|
+
//# sourceMappingURL=switch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"switch.d.ts","sourceRoot":"","sources":["../../src/ui/switch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,wBAAwB,CAAC;AAI3D,QAAA,MAAM,MAAM,8JAiBV,CAAC;AAGH,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-element.d.ts","sourceRoot":"","sources":["../../../../src/video/elements/video/video-element.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,wBAAwB,EAA0B,MAAM,gBAAgB,CAAC;AAmBvF,eAAO,MAAM,YAAY,gDAKtB,wBAAwB,4CA6H1B,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ObjectFit, VideoElementProps } from '../../types';
|
|
2
|
+
type VideoInlineToolbarSettingsProps = {
|
|
3
|
+
fit: ObjectFit | null;
|
|
4
|
+
settings: {
|
|
5
|
+
controls?: boolean;
|
|
6
|
+
loop?: boolean;
|
|
7
|
+
muted?: boolean;
|
|
8
|
+
autoPlay?: boolean;
|
|
9
|
+
};
|
|
10
|
+
onUpdate: (props: Partial<VideoElementProps>) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const VideoInlineToolbarSettings: ({ fit, settings, onUpdate, }: VideoInlineToolbarSettingsProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=video-inline-toolbar-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-inline-toolbar-settings.d.ts","sourceRoot":"","sources":["../../../../src/video/elements/video/video-inline-toolbar-settings.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhE,KAAK,+BAA+B,GAAG;IACrC,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE;QACR,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,IAAI,CAAC,EAAE,OAAO,CAAC;QACf,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;IACF,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CACvD,CAAC;AAQF,eAAO,MAAM,0BAA0B,iCAIpC,+BAA+B,4CAyKjC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { VideoElementProps } from '../../types';
|
|
3
|
+
type VideoInlineToolbarProps = {
|
|
4
|
+
referenceRef: React.MutableRefObject<HTMLElement | null>;
|
|
5
|
+
elementProps: VideoElementProps;
|
|
6
|
+
onUpdate: (props: Partial<VideoElementProps>) => void;
|
|
7
|
+
onReplace: () => void;
|
|
8
|
+
onDelete: () => void;
|
|
9
|
+
onDownload?: () => void;
|
|
10
|
+
onCopy?: () => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const VideoInlineToolbar: ({ referenceRef, elementProps, onUpdate, onReplace, onDelete, onDownload, onCopy, }: VideoInlineToolbarProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=video-inline-toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-inline-toolbar.d.ts","sourceRoot":"","sources":["../../../../src/video/elements/video/video-inline-toolbar.tsx"],"names":[],"mappings":";AAUA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,KAAK,uBAAuB,GAAG;IAC7B,YAAY,EAAE,KAAK,CAAC,gBAAgB,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACzD,YAAY,EAAE,iBAAiB,CAAC;IAChC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACtD,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,uFAQ5B,uBAAuB,4CAuLzB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { PluginElementRenderProps } from '@yoopta/editor';
|
|
3
|
+
import type { VideoUploadPreview, VideoUploadProgress } from '@yoopta/video';
|
|
4
|
+
type VideoPlaceholderProps = {
|
|
5
|
+
onUpload: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
6
|
+
onInsertUrl: (url: string) => void;
|
|
7
|
+
className?: string;
|
|
8
|
+
attributes: PluginElementRenderProps['attributes'];
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
preview: VideoUploadPreview | null;
|
|
11
|
+
progress: VideoUploadProgress | null;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const VideoPlaceholder: ({ onUpload, onInsertUrl, className, attributes, children, preview, progress, loading, }: VideoPlaceholderProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=video-placeholder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-placeholder.d.ts","sourceRoot":"","sources":["../../../../src/video/elements/video/video-placeholder.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAS7E,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC/D,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,wBAAwB,CAAC,YAAY,CAAC,CAAC;IACnD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACnC,QAAQ,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACrC,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAkNF,eAAO,MAAM,gBAAgB,4FAS1B,qBAAqB,4CA2BvB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { PluginElementRenderProps } from '@yoopta/editor';
|
|
3
|
+
import type { VideoPluginOptions } from '@yoopta/video';
|
|
4
|
+
import type { VideoElementProps } from '../../types';
|
|
5
|
+
type Props = {
|
|
6
|
+
blockId: string;
|
|
7
|
+
elementId: string;
|
|
8
|
+
onUpdate: (props: Partial<VideoElementProps>) => void;
|
|
9
|
+
onDelete: () => void;
|
|
10
|
+
onReplace: () => void;
|
|
11
|
+
attributes: PluginElementRenderProps['attributes'];
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
elementProps: VideoElementProps;
|
|
14
|
+
pluginOptions?: VideoPluginOptions;
|
|
15
|
+
};
|
|
16
|
+
export declare const VideoRender: ({ blockId, attributes, children, elementProps, onUpdate, onDelete, onReplace, pluginOptions, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=video-render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"video-render.d.ts","sourceRoot":"","sources":["../../../../src/video/elements/video/video-render.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAMxD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IACtD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,EAAE,wBAAwB,CAAC,YAAY,CAAC,CAAC;IACnD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,EAAE,iBAAiB,CAAC;IAChC,aAAa,CAAC,EAAE,kBAAkB,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,WAAW,mGASrB,KAAK,4CA2SP,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/video/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO;;;;CAInB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/video/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAEhF,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AACrD,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC"}
|
package/dist/video.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{_ as e,a as t}from"./chunks/_tslib-35bb891d.js";import{jsxs as i,jsx as s,Fragment as n}from"react/jsx-runtime";import*as a from"react";import{useRef as r,useState as l,useEffect as o,useCallback as c}from"react";import{useElementSelected as d,useBlockSelected as h,useYooptaEditor as m,useYooptaPluginOptions as u,Elements as p,Blocks as g}from"@yoopta/editor";import{parseVideoUrl as b,getEmbedUrl as v,useVideoUpload as f,useVideoDelete as j,useVideoPreview as w,buildVideoProvider as x}from"@yoopta/video";import{Editor as y,Element as N}from"slate";import{B as O}from"./chunks/button-ecb0aed1.js";import{I as k}from"./chunks/input-2708c7f4.js";import{T as C,c as z,b as I,a as E}from"./chunks/tabs-eeea28d9.js";import{c as R}from"./chunks/utils-de9c4c2b.js";import{L as S,U,D as P}from"./chunks/upload-3b3687f2.js";import{L,A as D,a as H,b as W,R as F}from"./chunks/index-3b428d14.js";import{c as M}from"./chunks/createLucideIcon-70ab5429.js";import{P as V}from"./chunks/play-ae8c52d2.js";import{T as A,a as B,b as _,c as T,u as q,R as $}from"./chunks/tooltip-bc45d963.js";import{C as Y,c as K}from"./chunks/index-e9d6a4a8.js";import{L as X}from"./chunks/label-a0e6fde2.js";import{P as G,a as J,b as Q}from"./chunks/popover-53c769ba.js";import{u as Z,S as ee,a as te,b as ie,c as se,d as ne,e as ae,f as re}from"./chunks/select-c547d76b.js";import{S as le}from"./chunks/separator-7be92037.js";import{c as oe,P as ce,a as de}from"./chunks/index-8dc6d938.js";import{u as he}from"./chunks/index-91a5b8d5.js";import{u as me}from"./chunks/index-7725d7e0.js";import{u as ue,o as pe,i as ge,s as be,a as ve}from"./chunks/index-842a4484.js";import{E as fe}from"./chunks/external-link-956d49c0.js";import{T as je}from"./chunks/trash-2-8f855002.js";import"./chunks/index-b273f426.js";import"./chunks/index-aaeb33b0.js";import"./chunks/index-325e2e09.js";import"./chunks/index-70f4e709.js";import"./chunks/index-13505606.js";import"react-dom";import"./chunks/Combination-ee85502b.js";import"./chunks/index-056e5c06.js";import"./chunks/chevron-down-abe5f871.js";import"./chunks/check-9adcfdfa.js";import"./chunks/chevron-up-5b4801a9.js";
|
|
2
|
+
/**
|
|
3
|
+
* @license lucide-react v0.378.0 - ISC
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the ISC license.
|
|
6
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/const we=M("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]),xe=({preview:e})=>s("div",Object.assign({className:"absolute inset-0 overflow-hidden flex items-center justify-center bg-black/5"},{children:s("video",{src:e.url,className:"max-w-full max-h-full object-contain",style:{maxWidth:e.width||"100%",maxHeight:e.height||"100%"},controls:!1,muted:!0,draggable:!1})})),ye=({progress:e})=>s("div",Object.assign({className:"absolute inset-0 z-20 flex flex-col items-center justify-center gap-4 bg-black/70 backdrop-blur-sm p-6"},{children:s("div",Object.assign({className:"w-full max-w-md space-y-4"},{children:i("div",Object.assign({className:"space-y-2"},{children:[i("div",Object.assign({className:"flex items-center justify-between text-sm"},{children:[s("span",Object.assign({className:"font-medium text-white"},{children:"Uploading video..."})),i("span",Object.assign({className:"text-white/80"},{children:[e.percentage,"%"]}))]})),s("div",Object.assign({className:"h-2 w-full overflow-hidden rounded-full bg-white/20"},{children:s("div",{className:"h-full bg-primary transition-all duration-300 ease-out",style:{width:`${e.percentage}%`}})})),i("div",Object.assign({className:"flex items-center justify-between text-xs text-white/60"},{children:[i("span",{children:[(e.loaded/1024/1024).toFixed(2)," MB /"," ",(e.total/1024/1024).toFixed(2)," MB"]}),s(S,{className:"h-3.5 w-3.5 animate-spin"})]}))]}))}))})),Ne=({onUpload:e,hasPreview:t})=>{const n=r(null);return i("div",t?Object.assign({className:"flex flex-col items-center justify-center gap-4 py-8"},{children:[i("div",Object.assign({className:"text-center space-y-2"},{children:[s("p",Object.assign({className:"text-sm font-medium text-white"},{children:"Video preview"})),s("p",Object.assign({className:"text-xs text-white/80"},{children:"Uploading your video..."}))]})),s("input",{ref:n,type:"file",accept:"video/*",onChange:e,className:"hidden"})]}):Object.assign({className:"flex flex-col items-center gap-3 py-6"},{children:[s("div",Object.assign({className:"rounded-lg bg-muted p-3"},{children:s(we,{className:"h-6 w-6 text-muted-foreground"})})),i("div",Object.assign({className:"text-center"},{children:[s("p",Object.assign({className:"text-sm font-medium"},{children:"Upload a video"})),s("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Click or drag and drop"}))]})),s(O,Object.assign({onClick:()=>{var e;return null===(e=n.current)||void 0===e?void 0:e.click()}},{children:"Choose file"})),s("input",{ref:n,type:"file",accept:"video/*",onChange:e,className:"hidden"})]}))},Oe=({onInsertUrl:e})=>{const[t,n]=l(""),[a,r]=l(!1),[o,c]=l(null),d=()=>{t.trim()&&(e(t.trim()),n(""),r(!1),c(null))};return i("div",Object.assign({className:"mt-4 space-y-3"},{children:[i("div",Object.assign({className:"space-y-2"},{children:[s(k,{placeholder:"Paste video URL (YouTube, Vimeo, Dailymotion, Loom, Wistia)...",value:t,onChange:e=>(e=>{if(n(e),e.trim()){const t=b(e.trim());r(t.isValid),c(t.provider?t.provider.charAt(0).toUpperCase()+t.provider.slice(1):null)}else r(!1),c(null)})(e.target.value),onKeyDown:e=>{"Enter"===e.key&&t.trim()&&a&&d()}}),t.trim()&&s("div",Object.assign({className:"text-xs text-muted-foreground"},{children:a?i("span",Object.assign({className:"flex items-center gap-1.5 text-green-600 dark:text-green-400"},{children:[s(V,{className:"h-3 w-3"}),o," video detected"]})):s("span",Object.assign({className:"text-destructive"},{children:"Invalid video URL. Supported: YouTube, Vimeo, Dailymotion, Loom, Wistia"}))}))]})),s(O,Object.assign({className:"w-full",onClick:d,disabled:!t.trim()||!a},{children:a?`Embed ${o} video`:"Embed video"}))]}))},ke=({onUpload:e,onInsertUrl:t,hasPreview:n})=>s("div",Object.assign({className:R("relative p-4",n&&"min-h-[300px] flex flex-col")},{children:i(C,Object.assign({defaultValue:"upload",className:"w-full"},{children:[i(z,Object.assign({className:R("grid w-full grid-cols-2",n&&"bg-background/80 backdrop-blur-sm")},{children:[i(I,Object.assign({value:"upload",className:"gap-1.5"},{children:[s(U,{className:"h-3.5 w-3.5"}),"Upload"]})),i(I,Object.assign({value:"link",className:"gap-1.5"},{children:[s(L,{className:"h-3.5 w-3.5"}),"Link"]}))]})),s(E,Object.assign({value:"upload",className:"mt-4"},{children:s(Ne,{onUpload:e,hasPreview:n})})),s(E,Object.assign({value:"link"},{children:s(Oe,{onInsertUrl:t})}))]}))})),Ce=({onUpload:e,onInsertUrl:t,className:n,attributes:a,children:r,preview:l,progress:o,loading:c})=>{const d=null!==l&&!!l.url,h=c&&o;return i("div",Object.assign({className:R("mt-2 relative rounded-lg border bg-background overflow-hidden",d&&"min-h-[300px]",n)},a,{contentEditable:!1},{children:[d&&s(xe,{preview:l}),!d&&s(ke,{onUpload:e,onInsertUrl:t,hasPreview:d}),h&&o&&s(ye,{progress:o}),r]}))};var ze="Switch",[Ie,Ee]=oe(ze),[Re,Se]=Ie(ze),Ue=a.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:l,defaultChecked:o,required:c,disabled:d,value:h="on",onCheckedChange:m,form:u,...p}=e,[g,b]=a.useState(null),v=he(t,e=>b(e)),f=a.useRef(!1),j=!g||(u||!!g.closest("form")),[w,x]=me({prop:l,defaultProp:o??!1,onChange:m,caller:ze});return i(Re,{scope:n,checked:w,disabled:d,children:[s(ce.button,{type:"button",role:"switch","aria-checked":w,"aria-required":c,"data-state":He(w),"data-disabled":d?"":void 0,disabled:d,value:h,...p,ref:v,onClick:de(e.onClick,e=>{x(e=>!e),j&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})}),j&&s(De,{control:g,bubbles:!f.current,name:r,value:h,checked:w,required:c,disabled:d,form:u,style:{transform:"translateX(-100%)"}})]})});Ue.displayName=ze;var Pe="SwitchThumb",Le=a.forwardRef((e,t)=>{const{__scopeSwitch:i,...n}=e,a=Se(Pe,i);return s(ce.span,{"data-state":He(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:t})});Le.displayName=Pe;var De=a.forwardRef(({__scopeSwitch:e,control:t,checked:i,bubbles:n=!0,...r},l)=>{const o=a.useRef(null),c=he(o,l),d=Z(i),h=ue(t);return a.useEffect(()=>{const e=o.current;if(!e)return;const t=window.HTMLInputElement.prototype,s=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==i&&s){const t=new Event("click",{bubbles:n});s.call(e,i),e.dispatchEvent(t)}},[d,i,n]),s("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i,...r,tabIndex:-1,ref:c,style:{...r.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function He(e){return e?"checked":"unchecked"}De.displayName="SwitchBubbleInput";var We=Ue,Fe=Le;const Me=a.forwardRef((t,i)=>{var{className:n}=t,a=e(t,["className"]);return s(We,Object.assign({className:R("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",n)},a,{ref:i},{children:s(Fe,{className:R("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}))});Me.displayName=We.displayName;const Ve={contain:{label:"Contain",description:"Fit within bounds"},cover:{label:"Cover",description:"Fill and crop"},fill:{label:"Fill",description:"Stretch to fit"}},Ae=({fit:e,settings:t,onUpdate:n})=>{var a,r,o,c,d,h,m,u,p,g,b,v;const[f,j]=l(!1),w=e=>{n({settings:Object.assign(Object.assign({},t),e)})};return i(G,Object.assign({open:f,onOpenChange:j},{children:[s(A,{children:i(B,{children:[s(_,Object.assign({asChild:!0},{children:s(J,Object.assign({asChild:!0},{children:s(O,Object.assign({variant:f?"secondary":"ghost",size:"icon",className:"h-7 w-7"},{children:s(ee,{className:"h-4 w-4"})}))}))})),s(T,{children:"Settings"})]})}),s(Q,Object.assign({className:"w-80 p-3",align:"start",contentEditable:!1,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},{children:i("div",Object.assign({className:"space-y-3"},{children:[i("div",{children:[s("h4",Object.assign({className:"font-semibold"},{children:"Video settings"})),s("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Customize video playback and display"}))]}),s(le,{}),i("div",Object.assign({className:"space-y-1"},{children:[s(X,Object.assign({htmlFor:"object-fit",className:"text-sm font-medium"},{children:"How video fits"})),i(te,Object.assign({value:e||"contain",onValueChange:e=>n({fit:e})},{children:[s(ie,Object.assign({id:"object-fit",className:"h-9 w-full"},{children:s(se,Object.assign({placeholder:"Select how video fits"},{children:i("div",Object.assign({className:"flex items-center gap-2"},{children:[s("div",Object.assign({className:"font-medium"},{children:null===(a=Ve[e||"contain"])||void 0===a?void 0:a.label})),s("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(r=Ve[e||"contain"])||void 0===r?void 0:r.description}))]}))}))})),s(ne,{children:i(ae,{children:[s(re,Object.assign({value:"contain",className:"cursor-pointer"},{children:i("div",Object.assign({className:"flex items-center gap-2"},{children:[s("div",Object.assign({className:"flex h-8 w-8 shrink-0 items-center justify-center rounded border"},{children:s("div",{className:"h-4 w-3 rounded bg-primary"})})),i("div",Object.assign({className:"flex-1"},{children:[s("div",Object.assign({className:"font-medium"},{children:null===(o=Ve.contain)||void 0===o?void 0:o.label})),s("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(c=Ve.contain)||void 0===c?void 0:c.description}))]}))]}))})),s(re,Object.assign({value:"cover",className:"cursor-pointer"},{children:i("div",Object.assign({className:"flex items-center gap-2"},{children:[s("div",Object.assign({className:"flex h-8 w-8 shrink-0 items-center justify-center rounded border"},{children:s("div",{className:"h-8 w-6 rounded bg-primary"})})),i("div",Object.assign({className:"flex-1"},{children:[s("div",Object.assign({className:"font-medium"},{children:null===(d=Ve.cover)||void 0===d?void 0:d.label})),s("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(h=Ve.cover)||void 0===h?void 0:h.description}))]}))]}))})),s(re,Object.assign({value:"fill",className:"cursor-pointer"},{children:i("div",Object.assign({className:"flex items-center gap-2"},{children:[s("div",Object.assign({className:"flex h-8 w-8 shrink-0 items-center justify-center rounded border"},{children:s("div",{className:"h-8 w-8 rounded bg-primary"})})),i("div",Object.assign({className:"flex-1"},{children:[s("div",Object.assign({className:"font-medium"},{children:null===(m=Ve.fill)||void 0===m?void 0:m.label})),s("div",Object.assign({className:"text-xs text-muted-foreground"},{children:null===(u=Ve.fill)||void 0===u?void 0:u.description}))]}))]}))}))]})})]}))]})),s(le,{}),i("div",Object.assign({className:"space-y-3"},{children:[i("div",Object.assign({className:"flex items-center justify-between"},{children:[i("div",Object.assign({className:"space-y-0.5"},{children:[s(X,Object.assign({htmlFor:"controls",className:"text-sm font-medium"},{children:"Show controls"})),s("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Display video player controls"}))]})),s(Me,{id:"controls",checked:null!==(p=t.controls)&&void 0!==p&&p,onCheckedChange:e=>w({controls:e})})]})),i("div",Object.assign({className:"flex items-center justify-between"},{children:[i("div",Object.assign({className:"space-y-0.5"},{children:[s(X,Object.assign({htmlFor:"loop",className:"text-sm font-medium"},{children:"Loop video"})),s("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Automatically replay when finished"}))]})),s(Me,{id:"loop",checked:null!==(g=t.loop)&&void 0!==g&&g,onCheckedChange:e=>w({loop:e})})]})),i("div",Object.assign({className:"flex items-center justify-between"},{children:[i("div",Object.assign({className:"space-y-0.5"},{children:[s(X,Object.assign({htmlFor:"muted",className:"text-sm font-medium"},{children:"Muted"})),s("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Start video without sound"}))]})),s(Me,{id:"muted",checked:null!==(b=t.muted)&&void 0!==b&&b,onCheckedChange:e=>w({muted:e})})]})),i("div",Object.assign({className:"flex items-center justify-between"},{children:[i("div",Object.assign({className:"space-y-0.5"},{children:[s(X,Object.assign({htmlFor:"autoplay",className:"text-sm font-medium"},{children:"Autoplay"})),s("p",Object.assign({className:"text-xs text-muted-foreground"},{children:"Start playing automatically (may require muted)"}))]})),s(Me,{id:"autoplay",checked:null!==(v=t.autoPlay)&&void 0!==v&&v,onCheckedChange:e=>w({autoPlay:e})})]}))]}))]}))}))]}))},Be=({referenceRef:e,elementProps:t,onUpdate:a,onReplace:r,onDelete:c,onDownload:d,onCopy:h})=>{var m,u;const[p,g]=l(!1),b=t.provider&&t.provider.type,v="alignment"in t,{refs:f,floatingStyles:j}=q({placement:"top",strategy:"fixed",middleware:[pe(8),ge(),be({padding:10})],whileElementsMounted:ve});o(()=>{requestAnimationFrame(()=>{g(!0)})},[]),o(()=>{const t=e.current;t&&f.setReference(t)},[e,f]);return s("div",Object.assign({ref:f.setFloating,onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),className:R("pointer-events-auto","flex items-center gap-1 rounded-lg border bg-background/95 backdrop-blur-sm p-1 shadow-lg","transition-all duration-200 ease-out",p?"opacity-100 translate-y-0":"opacity-0 translate-y-2"),style:j},{children:i(A,Object.assign({delayDuration:0},{children:[v&&i("div",Object.assign({className:"flex items-center gap-0.5 border-r pr-1"},{children:[i(B,{children:[s(_,Object.assign({asChild:!0},{children:s(O,Object.assign({variant:"left"===t.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>a({alignment:"left"})},{children:s(D,{className:"h-4 w-4"})}))})),s(T,{children:"Align left"})]}),i(B,{children:[s(_,Object.assign({asChild:!0},{children:s(O,Object.assign({variant:"center"===t.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>a({alignment:"center"})},{children:s(H,{className:"h-4 w-4"})}))})),s(T,{children:"Align center"})]}),i(B,{children:[s(_,Object.assign({asChild:!0},{children:s(O,Object.assign({variant:"right"===t.alignment?"secondary":"ghost",size:"icon",className:"h-7 w-7",onClick:()=>a({alignment:"right"})},{children:s(W,{className:"h-4 w-4"})}))})),s(T,{children:"Align right"})]})]})),i(B,{children:[s(_,Object.assign({asChild:!0},{children:s(O,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:r},{children:s($,{className:"h-4 w-4"})}))})),s(T,{children:"Replace"})]}),!b&&t.src&&i(n,{children:[i(B,{children:[s(_,Object.assign({asChild:!0},{children:s(O,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{if(d)d();else if(t.src&&!b){const e=document.createElement("a");e.href=t.src,e.download=`video-${Date.now()}.mp4`,e.click()}}},{children:s(P,{className:"h-4 w-4"})}))})),s(T,{children:"Download"})]}),i(B,{children:[s(_,Object.assign({asChild:!0},{children:s(O,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{h?h():t.src&&K(t.src)}},{children:s(Y,{className:"h-4 w-4"})}))})),s(T,{children:"Copy URL"})]})]}),b&&(null===(m=t.provider)||void 0===m?void 0:m.url)&&i(B,{children:[s(_,Object.assign({asChild:!0},{children:s(O,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>{var e;(null===(e=t.provider)||void 0===e?void 0:e.url)&&window.open(t.provider.url,"_blank")}},{children:s(fe,{className:"h-4 w-4"})}))})),s(T,{children:"Open in new tab"})]}),!b&&i(n,{children:[s(le,{orientation:"vertical",className:"h-4"}),s(Ae,{fit:null!==(u=t.fit)&&void 0!==u?u:"contain",settings:t.settings||{controls:!1,loop:!1,muted:!1,autoPlay:!1},onUpdate:a})]}),i(B,{children:[s(_,Object.assign({asChild:!0},{children:s(O,Object.assign({variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:bg-destructive/10 hover:text-destructive",onClick:c},{children:s(je,{className:"h-4 w-4"})}))})),s(T,{children:"Delete"})]})]}))}))},_e=({blockId:e,attributes:n,children:a,elementProps:c,onUpdate:u,onDelete:p,onReplace:g,pluginOptions:b})=>{var f,j,w,x;const[y,N]=l(c.sizes||{width:650,height:400}),{isElementSelected:O}=d(),k=h({blockId:e}),C=O&&k,z=r(null),I=m(),[E,S]=l(()=>{var e;const t=(null===(e=I.refElement)||void 0===e?void 0:e.getBoundingClientRect().width)||650,i=null==b?void 0:b.maxSizes;return{maxWidth:(null==i?void 0:i.maxWidth)?"number"==typeof i.maxWidth?i.maxWidth:parseInt(String(i.maxWidth).replace(/[^\d]/g,""),10):t,maxHeight:(null==i?void 0:i.maxHeight)?"number"==typeof i.maxHeight?i.maxHeight:parseInt(String(i.maxHeight).replace(/[^\d]/g,""),10):550}});o(()=>{const e=()=>{var e;const t=(null===(e=I.refElement)||void 0===e?void 0:e.getBoundingClientRect().width)||650,i=null==b?void 0:b.maxSizes;S({maxWidth:(null==i?void 0:i.maxWidth)?"number"==typeof i.maxWidth?i.maxWidth:parseInt(String(i.maxWidth).replace(/[^\d]/g,""),10):t,maxHeight:(null==i?void 0:i.maxHeight)?"number"==typeof i.maxHeight?i.maxHeight:parseInt(String(i.maxHeight).replace(/[^\d]/g,""),10):550})};e();const t=new ResizeObserver(e);return I.refElement&&t.observe(I.refElement),window.addEventListener("resize",e),()=>{t.disconnect(),window.removeEventListener("resize",e)}},[I,b]);const U=(e,t)=>{const i=e=>"number"==typeof e?e:parseInt(String(e).replace(/[^\d]/g,""),10),s=i(e.width),n=i(e.height),a=i(t.width),r=i(t.height);if(s<=a&&n<=r)return{width:s,height:n};const l=s/a,o=n/r,c=Math.max(l,o),d=Math.round(s/c),h=Math.round(n/c);return{width:Math.min(d,a),height:Math.min(h,r)}},P=c.provider&&c.provider.type,L=c.src||"",D=P&&(null===(f=c.provider)||void 0===f?void 0:f.id)?v(c.provider.type,c.provider.id):null,H=c.settings||{controls:!0,loop:!1,muted:!1,autoPlay:!1},W={left:"justify-start",center:"justify-center",right:"justify-end"}[null!==(j=c.alignment)&&void 0!==j?j:"center"];return i("div",Object.assign({},n,{className:R("group/video mt-2 relative transition-all w-full flex",W)},{children:[i("div",Object.assign({className:"relative",contentEditable:!1},{children:[s(F,Object.assign({ref:e=>{(null==e?void 0:e.resizableElement)&&e.resizableElement instanceof HTMLElement&&(z.current=e.resizableElement)},style:{position:"relative",outline:C?".125rem solid rgba(0, 0, 0, 0)":"none",outlineColor:C?"hsl(var(--primary))":"none"},size:{width:"number"==typeof y.width?y.width:parseInt(String(y.width),10),height:"number"==typeof y.height?y.height:parseInt(String(y.height),10)},onResize:(e,t,i)=>{const s=parseInt(i.style.width,10),n=parseInt(i.style.height,10),a=U({width:s,height:n},{width:E.maxWidth,height:E.maxHeight});N(a)},onResizeStop:(e,t,i)=>{const s=parseInt(i.style.width,10),n=parseInt(i.style.height,10),a=U({width:s,height:n},{width:E.maxWidth,height:E.maxHeight});u({sizes:a})},lockAspectRatio:!0,minWidth:200,minHeight:150,maxWidth:E.maxWidth,maxHeight:E.maxHeight,enableResizing:!!C&&{bottom:!1,bottomLeft:!1,bottomRight:!1,left:!0,right:!0,top:!1,topLeft:!1,topRight:!1},disableDragging:!0,resizeHandleStyles:{left:{width:"auto",height:"40px",left:"-5px",top:"50%",transform:"translateY(-50%)",cursor:"ew-resize"},right:{width:"auto",height:"40px",right:"-5px",top:"50%",transform:"translateY(-50%)",cursor:"ew-resize"}},resizeHandleComponent:{left:s("div",{className:"h-10 w-2 rounded-full border border-primary bg-primary shadow-sm"}),right:s("div",{className:"h-10 w-2 rounded-full border border-primary bg-primary shadow-sm"})},className:R("rounded-sm overflow-hidden")},{children:P&&D?s("iframe",{title:c.provider.type,src:D,width:"100%",height:"100%",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-full",style:{aspectRatio:`${y.width} / ${y.height}`}}):s("video",{title:"Video",src:L,controls:H.controls,loop:H.loop,muted:H.muted,autoPlay:H.autoPlay,poster:null!==(w=c.poster)&&void 0!==w?w:void 0,className:"w-full h-full transition-all duration-200",style:{objectFit:null!==(x=c.fit)&&void 0!==x?x:"contain"},draggable:!1})})),C&&s(Be,{referenceRef:z,elementProps:c,onUpdate:u,onReplace:g,onDelete:p,onDownload:()=>t(void 0,void 0,void 0,function*(){if(c.src&&!P)try{const e=yield fetch(c.src),t=yield e.blob(),i=URL.createObjectURL(t),s=document.createElement("a");s.href=i,s.download=`video-${Date.now()}.mp4`,s.click(),URL.revokeObjectURL(i)}catch(e){}}),onCopy:()=>t(void 0,void 0,void 0,function*(){var e;if(c.src)try{if(P&&(null===(e=c.provider)||void 0===e?void 0:e.url)){const{default:e}=yield import("./chunks/index-e9d6a4a8.js").then(function(e){return e.i});e(c.provider.url)}else{const e=yield fetch(c.src),t=yield e.blob();if(navigator.clipboard&&ClipboardItem)yield navigator.clipboard.write([new ClipboardItem({[t.type]:t})]);else{const{default:e}=yield import("./chunks/index-e9d6a4a8.js").then(function(e){return e.i});e(c.src)}}}catch(e){const{default:t}=yield import("./chunks/index-e9d6a4a8.js").then(function(e){return e.i});t(c.src||"")}})})]})),a]}))},Te={video:{render:({element:e,attributes:i,children:n,blockId:a})=>{const r=m(),l=u("Video"),{upload:o,progress:d,loading:h}=f(l.upload),{deleteVideo:v}=j(l.delete),{preview:O,generatePreview:k,clearPreview:C}=w(),z=c(t=>{p.updateElement(r,{blockId:a,type:"video",props:Object.assign(Object.assign({},e.props),t)})},[r,a,e.props]),I=c(()=>t(void 0,void 0,void 0,function*(){yield v(e);const t=g.getBlockSlate(r,{id:a});if(!t)return;const i=p.getElementPath(r,{blockId:a,element:e});if(!i)return;const s=i?y.parent(t,i):void 0;s&&N.isElement(s[0])&&!y.isEditor(s[0])?p.deleteElement(r,{blockId:a,type:"video",path:i}):g.deleteBlock(r,{blockId:a,focus:!0})}),[r,a,e,v]),E=c(()=>{p.updateElement(r,{blockId:a,type:"video",props:Object.assign(Object.assign({},e.props),{src:null,provider:null})})},[r,a,e.props]),R=c(i=>t(void 0,void 0,void 0,function*(){var t;const s=null===(t=i.target.files)||void 0===t?void 0:t[0];if(!s)return;k(s);const n=yield o(s);z({id:n.id||n.fileId,src:n.url,sizes:n.width&&n.height?{width:n.width,height:n.height}:e.props.sizes||{width:650,height:400},provider:n.provider||null,poster:n.poster||null}),C()}),[o,z,k,C,e.props.sizes]),S=c(i=>t(void 0,void 0,void 0,function*(){const t=b(i);if(t.isValid&&t.provider){const s=x(i);z({src:t.embedUrl,provider:s,sizes:e.props.sizes||{width:650,height:400}})}else i.trim()&&z({src:i.trim(),provider:null,sizes:e.props.sizes||{width:650,height:400}})}),[z,e.props.sizes]);return e.props.src||e.props.provider?s(_e,Object.assign({blockId:a,elementId:e.id,onUpdate:z,onDelete:I,attributes:i,onReplace:E,elementProps:e.props,pluginOptions:l},{children:n})):s(Ce,Object.assign({onUpload:R,preview:O,progress:d,loading:h,onInsertUrl:S,attributes:i},{children:n}))}}};export{Te as VideoUI};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoopta/themes-shadcn",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.11",
|
|
4
4
|
"description": "Shadcn UI theme for Yoopta Editor plugins",
|
|
5
5
|
"author": "Darginec05 <devopsbanda@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/Darginec05/Yoopta-Editor#readme",
|
|
@@ -10,20 +10,180 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"module": "dist/index.js",
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
|
+
"typesVersions": {
|
|
14
|
+
"*": {
|
|
15
|
+
"accordion": [
|
|
16
|
+
"./dist/types/accordion/index.d.ts"
|
|
17
|
+
],
|
|
18
|
+
"blockquote": [
|
|
19
|
+
"./dist/types/blockquote/index.d.ts"
|
|
20
|
+
],
|
|
21
|
+
"callout": [
|
|
22
|
+
"./dist/types/callout/index.d.ts"
|
|
23
|
+
],
|
|
24
|
+
"carousel": [
|
|
25
|
+
"./dist/types/carousel/index.d.ts"
|
|
26
|
+
],
|
|
27
|
+
"code": [
|
|
28
|
+
"./dist/types/code/index.d.ts"
|
|
29
|
+
],
|
|
30
|
+
"code-group": [
|
|
31
|
+
"./dist/types/code-group/index.d.ts"
|
|
32
|
+
],
|
|
33
|
+
"divider": [
|
|
34
|
+
"./dist/types/divider/index.d.ts"
|
|
35
|
+
],
|
|
36
|
+
"embed": [
|
|
37
|
+
"./dist/types/embed/index.d.ts"
|
|
38
|
+
],
|
|
39
|
+
"file": [
|
|
40
|
+
"./dist/types/file/index.d.ts"
|
|
41
|
+
],
|
|
42
|
+
"headings": [
|
|
43
|
+
"./dist/types/headings/index.d.ts"
|
|
44
|
+
],
|
|
45
|
+
"image": [
|
|
46
|
+
"./dist/types/image/index.d.ts"
|
|
47
|
+
],
|
|
48
|
+
"link": [
|
|
49
|
+
"./dist/types/link/index.d.ts"
|
|
50
|
+
],
|
|
51
|
+
"lists": [
|
|
52
|
+
"./dist/types/lists/index.d.ts"
|
|
53
|
+
],
|
|
54
|
+
"mention": [
|
|
55
|
+
"./dist/types/mention/index.d.ts"
|
|
56
|
+
],
|
|
57
|
+
"paragraph": [
|
|
58
|
+
"./dist/types/paragraph/index.d.ts"
|
|
59
|
+
],
|
|
60
|
+
"steps": [
|
|
61
|
+
"./dist/types/steps/index.d.ts"
|
|
62
|
+
],
|
|
63
|
+
"table": [
|
|
64
|
+
"./dist/types/table/index.d.ts"
|
|
65
|
+
],
|
|
66
|
+
"table-of-contents": [
|
|
67
|
+
"./dist/types/table-of-contents/index.d.ts"
|
|
68
|
+
],
|
|
69
|
+
"tabs": [
|
|
70
|
+
"./dist/types/tabs/index.d.ts"
|
|
71
|
+
],
|
|
72
|
+
"video": [
|
|
73
|
+
"./dist/types/video/index.d.ts"
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"sideEffects": [
|
|
78
|
+
"**/*.css"
|
|
79
|
+
],
|
|
80
|
+
"exports": {
|
|
81
|
+
".": {
|
|
82
|
+
"types": "./dist/index.d.ts",
|
|
83
|
+
"import": "./dist/index.js"
|
|
84
|
+
},
|
|
85
|
+
"./accordion": {
|
|
86
|
+
"types": "./dist/types/accordion/index.d.ts",
|
|
87
|
+
"import": "./dist/accordion.js"
|
|
88
|
+
},
|
|
89
|
+
"./blockquote": {
|
|
90
|
+
"types": "./dist/types/blockquote/index.d.ts",
|
|
91
|
+
"import": "./dist/blockquote.js"
|
|
92
|
+
},
|
|
93
|
+
"./callout": {
|
|
94
|
+
"types": "./dist/types/callout/index.d.ts",
|
|
95
|
+
"import": "./dist/callout.js"
|
|
96
|
+
},
|
|
97
|
+
"./carousel": {
|
|
98
|
+
"types": "./dist/types/carousel/index.d.ts",
|
|
99
|
+
"import": "./dist/carousel.js"
|
|
100
|
+
},
|
|
101
|
+
"./code": {
|
|
102
|
+
"types": "./dist/types/code/index.d.ts",
|
|
103
|
+
"import": "./dist/code.js"
|
|
104
|
+
},
|
|
105
|
+
"./code-group": {
|
|
106
|
+
"types": "./dist/types/code-group/index.d.ts",
|
|
107
|
+
"import": "./dist/code-group.js"
|
|
108
|
+
},
|
|
109
|
+
"./divider": {
|
|
110
|
+
"types": "./dist/types/divider/index.d.ts",
|
|
111
|
+
"import": "./dist/divider.js"
|
|
112
|
+
},
|
|
113
|
+
"./embed": {
|
|
114
|
+
"types": "./dist/types/embed/index.d.ts",
|
|
115
|
+
"import": "./dist/embed.js"
|
|
116
|
+
},
|
|
117
|
+
"./file": {
|
|
118
|
+
"types": "./dist/types/file/index.d.ts",
|
|
119
|
+
"import": "./dist/file.js"
|
|
120
|
+
},
|
|
121
|
+
"./headings": {
|
|
122
|
+
"types": "./dist/types/headings/index.d.ts",
|
|
123
|
+
"import": "./dist/headings.js"
|
|
124
|
+
},
|
|
125
|
+
"./image": {
|
|
126
|
+
"types": "./dist/types/image/index.d.ts",
|
|
127
|
+
"import": "./dist/image.js"
|
|
128
|
+
},
|
|
129
|
+
"./link": {
|
|
130
|
+
"types": "./dist/types/link/index.d.ts",
|
|
131
|
+
"import": "./dist/link.js"
|
|
132
|
+
},
|
|
133
|
+
"./lists": {
|
|
134
|
+
"types": "./dist/types/lists/index.d.ts",
|
|
135
|
+
"import": "./dist/lists.js"
|
|
136
|
+
},
|
|
137
|
+
"./mention": {
|
|
138
|
+
"types": "./dist/types/mention/index.d.ts",
|
|
139
|
+
"import": "./dist/mention.js"
|
|
140
|
+
},
|
|
141
|
+
"./paragraph": {
|
|
142
|
+
"types": "./dist/types/paragraph/index.d.ts",
|
|
143
|
+
"import": "./dist/paragraph.js"
|
|
144
|
+
},
|
|
145
|
+
"./steps": {
|
|
146
|
+
"types": "./dist/types/steps/index.d.ts",
|
|
147
|
+
"import": "./dist/steps.js"
|
|
148
|
+
},
|
|
149
|
+
"./table": {
|
|
150
|
+
"types": "./dist/types/table/index.d.ts",
|
|
151
|
+
"import": "./dist/table.js"
|
|
152
|
+
},
|
|
153
|
+
"./table-of-contents": {
|
|
154
|
+
"types": "./dist/types/table-of-contents/index.d.ts",
|
|
155
|
+
"import": "./dist/table-of-contents.js"
|
|
156
|
+
},
|
|
157
|
+
"./tabs": {
|
|
158
|
+
"types": "./dist/types/tabs/index.d.ts",
|
|
159
|
+
"import": "./dist/tabs.js"
|
|
160
|
+
},
|
|
161
|
+
"./video": {
|
|
162
|
+
"types": "./dist/types/video/index.d.ts",
|
|
163
|
+
"import": "./dist/video.js"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
13
166
|
"files": [
|
|
14
167
|
"dist/"
|
|
15
168
|
],
|
|
16
169
|
"peerDependencies": {
|
|
17
|
-
"@yoopta/code": "^6.0.0-beta.
|
|
18
|
-
"@yoopta/editor": "^6.0.0-beta.
|
|
19
|
-
"@yoopta/
|
|
20
|
-
"@yoopta/
|
|
21
|
-
"@yoopta/
|
|
22
|
-
"@yoopta/
|
|
23
|
-
"@yoopta/
|
|
24
|
-
"@yoopta/
|
|
170
|
+
"@yoopta/code": "^6.0.0-beta.8",
|
|
171
|
+
"@yoopta/editor": "^6.0.0-beta.8",
|
|
172
|
+
"@yoopta/embed": "^6.0.0-beta.8",
|
|
173
|
+
"@yoopta/file": "^6.0.0-beta.8",
|
|
174
|
+
"@yoopta/image": "^6.0.0-beta.8",
|
|
175
|
+
"@yoopta/lists": "^6.0.0-beta.8",
|
|
176
|
+
"@yoopta/steps": "^6.0.0-beta.8",
|
|
177
|
+
"@yoopta/table": "^6.0.0-beta.8",
|
|
178
|
+
"@yoopta/table-of-contents": "^6.0.0-beta.8",
|
|
179
|
+
"@yoopta/tabs": "^6.0.0-beta.8",
|
|
180
|
+
"@yoopta/ui": "^6.0.0-beta.8",
|
|
181
|
+
"@yoopta/video": "^6.0.0-beta.8",
|
|
25
182
|
"react": ">=18.2.0",
|
|
26
|
-
"react-dom": ">=18.2.0"
|
|
183
|
+
"react-dom": ">=18.2.0",
|
|
184
|
+
"slate": "^0.120.0",
|
|
185
|
+
"slate-dom": "^0.119.0",
|
|
186
|
+
"slate-react": "^0.120.0"
|
|
27
187
|
},
|
|
28
188
|
"devDependencies": {
|
|
29
189
|
"tailwindcss": "^3.0.0"
|
|
@@ -34,13 +194,13 @@
|
|
|
34
194
|
"@radix-ui/react-dialog": "^1.1.15",
|
|
35
195
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
36
196
|
"@radix-ui/react-hover-card": "^1.1.15",
|
|
37
|
-
"@radix-ui/react-icons": "^1.3.0",
|
|
38
197
|
"@radix-ui/react-label": "^2.1.0",
|
|
39
198
|
"@radix-ui/react-popover": "^1.1.2",
|
|
40
199
|
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
41
200
|
"@radix-ui/react-select": "^2.2.6",
|
|
42
201
|
"@radix-ui/react-separator": "^1.1.0",
|
|
43
202
|
"@radix-ui/react-slider": "^1.3.6",
|
|
203
|
+
"@radix-ui/react-switch": "^1.2.6",
|
|
44
204
|
"@radix-ui/react-tabs": "^1.1.1",
|
|
45
205
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
46
206
|
"clsx": "^2.1.1",
|
|
@@ -66,5 +226,5 @@
|
|
|
66
226
|
"bugs": {
|
|
67
227
|
"url": "https://github.com/Darginec05/Yoopta-Editor/issues"
|
|
68
228
|
},
|
|
69
|
-
"gitHead": "
|
|
229
|
+
"gitHead": "328b04fa6481a487b434708338f56057792aafa4"
|
|
70
230
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"withShadcnUI.d.ts","sourceRoot":"","sources":["../src/withShadcnUI.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAmBnD,KAAK,YAAY,GAAG,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAG3C,KAAK,gBAAgB,GAAG,MAAM,CAC5B,MAAM,EACN;IACE,yBAAyB,CAAC,EAAE,YAAY,EAAE,CAAC;IAE3C,MAAM,CAAC,EAAE,GAAG,CAAC;IAEb,OAAO,CAAC,EAAE,GAAG,CAAC;IAEd,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,CACF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,YAAY,EAAE,EACvB,UAAU,CAAC,EAAE,gBAAgB,GAC5B,YAAY,EAAE,CAkDhB"}
|