@yoopta/ui 6.0.0-beta.12 → 6.0.0-beta.14

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.
Files changed (43) hide show
  1. package/dist/action-menu-list.js +1 -1
  2. package/dist/action-menu-list.js.map +1 -0
  3. package/dist/block-dnd.js.map +1 -0
  4. package/dist/block-options.js +1 -1
  5. package/dist/block-options.js.map +1 -0
  6. package/dist/chunks/_tslib-8f8de673.js +36 -0
  7. package/dist/chunks/_tslib-8f8de673.js.map +1 -0
  8. package/dist/chunks/floating-ui.react-b048728e.js +5 -0
  9. package/dist/chunks/floating-ui.react-d2303b03.js +4506 -0
  10. package/dist/chunks/floating-ui.react-d2303b03.js.map +1 -0
  11. package/dist/chunks/floating-ui.react-feaab622.js +4506 -0
  12. package/dist/chunks/floating-ui.react-feaab622.js.map +1 -0
  13. package/dist/chunks/highlight-color-picker-027fa4b4.js +93 -0
  14. package/dist/chunks/highlight-color-picker-027fa4b4.js.map +1 -0
  15. package/dist/chunks/highlight-color-picker-a1a292a9.js +1 -0
  16. package/dist/chunks/highlight-color-picker-a979e7a3.js +93 -0
  17. package/dist/chunks/highlight-color-picker-a979e7a3.js.map +1 -0
  18. package/dist/chunks/index-bfd2e7c4.js +6 -0
  19. package/dist/chunks/index-bfd2e7c4.js.map +1 -0
  20. package/dist/chunks/style-inject.es-746bb8ed.js +29 -0
  21. package/dist/chunks/style-inject.es-746bb8ed.js.map +1 -0
  22. package/dist/chunks/throttle-278836f4.js +45 -0
  23. package/dist/chunks/throttle-278836f4.js.map +1 -0
  24. package/dist/element-options.js +18 -5
  25. package/dist/element-options.js.map +1 -0
  26. package/dist/floating-block-actions.js.map +1 -0
  27. package/dist/floating-toolbar/floating-toolbar.d.ts +4 -4
  28. package/dist/floating-toolbar/floating-toolbar.d.ts.map +1 -1
  29. package/dist/floating-toolbar.js +1 -1
  30. package/dist/floating-toolbar.js.map +1 -0
  31. package/dist/highlight-color-picker.js +1 -1
  32. package/dist/highlight-color-picker.js.map +1 -0
  33. package/dist/index.js +1 -1
  34. package/dist/index.js.map +1 -0
  35. package/dist/overlay.js +1 -1
  36. package/dist/overlay.js.map +1 -0
  37. package/dist/portal/Portal.d.ts.map +1 -1
  38. package/dist/portal.js +1 -1
  39. package/dist/portal.js.map +1 -0
  40. package/dist/selection-box.js.map +1 -0
  41. package/dist/slash-command-menu.js +1 -1
  42. package/dist/slash-command-menu.js.map +1 -0
  43. package/package.json +2 -2
@@ -1 +1 @@
1
- import{_ as t}from"./chunks/_tslib-5e145dfd.js";import{jsx as i,jsxs as o,Fragment as e}from"react/jsx-runtime";import{createContext as n,useContext as a,forwardRef as l,useState as s,useMemo as r,useCallback as c,isValidElement as u,cloneElement as p}from"react";import{d,u as m,f as y,s as g,o as v,a as h,c as f}from"./chunks/floating-ui.react-727e4287.js";import{Blocks as b,getAllowedPluginsFromElement as x,getRootBlockElement as w,useYooptaEditor as k}from"@yoopta/editor";import{s as j}from"./chunks/style-inject.es-e87a8d02.js";import{Portal as N}from"./portal.js";import{Overlay as O}from"./overlay.js";import"react-dom";const A=n(null),z=()=>{const t=a(A);if(!t)throw new Error("ActionMenuList components must be used within <ActionMenuList>");return t};function M(t){const i=Object.keys(t.plugins);let o=null;if("number"==typeof t.path.current){const i=b.getBlockSlate(t,{at:t.path.current});i&&(o=x(t,i))}let e=i;return o&&o.length>0&&(e="string"==typeof i[0]?i.filter(t=>o.includes(t)):i.filter(t=>o.includes(t.type))),e.map(i=>{var o,e,n,a,l,s;if("string"==typeof i){return{type:i,title:(null===(e=null===(o=t.plugins[i].options)||void 0===o?void 0:o.display)||void 0===e?void 0:e.title)||i,description:null===(a=null===(n=t.plugins[i].options)||void 0===n?void 0:n.display)||void 0===a?void 0:a.description,icon:null===(s=null===(l=t.plugins[i].options)||void 0===l?void 0:l.display)||void 0===s?void 0:s.icon}}return i})}function S(t,i){var o;const e=t.plugins[i];if(!e)return!1;const n=w(e.elements);return"void"!==(null===(o=null==n?void 0:n.props)||void 0===o?void 0:o.nodeType)}j(".yoopta-ui-action-menu-list-overlay{background:transparent;z-index:var(--yoopta-ui-action-menu-z-index,9999)}.yoopta-ui-action-menu-list{bottom:auto;left:0;margin:0;position:absolute;right:auto;top:0;z-index:var(--yoopta-ui-action-menu-z-index,9999)}.yoopta-ui-action-menu-list-content{background:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-action-menu-radius,.5rem);box-shadow:var(\n --yoopta-ui-action-menu-shadow,0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)\n );max-height:var(--yoopta-ui-action-menu-max-height,330px);overflow-x:hidden;overflow-y:auto;padding:var(--yoopta-ui-action-menu-padding,.5rem);-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoopta-ui-action-menu-list-group{color:hsl(var(--yoopta-ui-foreground));overflow:hidden;padding:0}.yoopta-ui-action-menu-list-item{align-items:center;background:transparent;border:none;border-radius:var(--yoopta-ui-action-menu-item-radius,.375rem);color:hsl(var(--yoopta-ui-foreground));cursor:pointer;display:flex;font-size:var(--yoopta-ui-action-menu-item-font-size,.875rem);gap:var(--yoopta-ui-action-menu-item-gap,.5rem);margin-bottom:.125rem;outline:none;padding:var(--yoopta-ui-action-menu-item-padding,.5rem);text-align:left;transition:background-color .15s ease-out;width:100%}.yoopta-ui-action-menu-list-item:last-child{margin-bottom:0}.yoopta-ui-action-menu-list-item:hover,.yoopta-ui-action-menu-list-item[data-selected=true]{background:hsl(var(--yoopta-ui-accent))}.yoopta-ui-action-menu-list-item:focus-visible{outline:2px solid hsl(var(--yoopta-ui-ring));outline-offset:2px}.yoopta-ui-action-menu-list-item-icon{align-items:center;background:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-action-menu-icon-radius,.375rem);display:flex;flex-shrink:0;justify-content:center}.yoopta-ui-action-menu-list-item-icon img,.yoopta-ui-action-menu-list-item-icon svg{height:100%;-o-object-fit:contain;object-fit:contain;width:100%}.yoopta-ui-action-menu-list-item-content{flex:1;min-width:0}.yoopta-ui-action-menu-list-item-title{font-weight:500;line-height:1.25}.yoopta-ui-action-menu-list-item-description{color:hsl(var(--yoopta-ui-muted-foreground));font-size:var(--yoopta-ui-action-menu-item-description-font-size,.75rem);line-height:1.25;margin-top:.125rem;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.yoopta-ui-action-menu-list-empty{color:hsl(var(--yoopta-ui-muted-foreground));font-size:var(--yoopta-ui-action-menu-empty-font-size,.75rem);padding:var(--yoopta-ui-action-menu-empty-padding,.5rem);text-align:left}.yoopta-ui-action-menu-list-small{max-height:280px;min-width:180px;padding:.375rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item{font-size:.8125rem;gap:.375rem;padding:.375rem .5rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-icon{height:20px;padding:2px;width:20px}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-title{font-size:.8125rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-description{display:none}.yoopta-ui-action-menu-list-default{min-width:244px}.yoopta-ui-action-menu-list-default .yoopta-ui-action-menu-list-item-icon{height:40px;padding:6px;width:40px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar{width:8px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-track{background:transparent}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-thumb{background:hsl(var(--yoopta-ui-border));border-radius:4px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-thumb:hover{background:hsl(var(--yoopta-ui-muted-foreground))}");const C=({children:t,open:o,onOpenChange:e,defaultOpen:n=!1,anchor:a=null,view:l="default",placement:u="bottom-start",className:p=""})=>{var d;const b=k(),[x,j]=s(n),N=void 0!==o,O=N?o:x,z=r(()=>M(b).filter(t=>S(b,t.type)).filter(t=>{var i,o,e;const n=b.plugins[t.type],a=w(n.elements);return"inline"!==(null===(i=null==a?void 0:a.props)||void 0===i?void 0:i.nodeType)&&"inlineVoid"!==(null===(o=null==a?void 0:a.props)||void 0===o?void 0:o.nodeType)&&"void"!==(null===(e=null==a?void 0:a.props)||void 0===e?void 0:e.nodeType)}),[b]),[C,L]=s(null!==(d=z[0])&&void 0!==d?d:null),{refs:E,floatingStyles:$,context:F}=m({elements:{reference:a},placement:u,open:O,middleware:[y(),g(),v(10)],whileElementsMounted:h}),{isMounted:T,styles:B}=f(F,{duration:100}),I=r(()=>Object.assign(Object.assign(Object.assign({},$),B),{minWidth:"small"===l?200:244}),[$,B,l]),P=c(()=>{var t;N||j(!1),null==e||e(!1),L(null!==(t=z[0])&&void 0!==t?t:null)},[N,e,z]),R=c(t=>{Array.isArray(b.path.selected)&&b.path.selected.length>0?b.batchOperations(()=>{b.path.selected.forEach(i=>{b.toggleBlock(t,{preserveContent:!0,focus:!0,at:i})})}):b.toggleBlock(t,{preserveContent:!0,focus:!0,at:b.path.current}),P()},[b,P]),G=r(()=>({isOpen:T,view:l,actions:z,selectedAction:C,setSelectedAction:L,onSelect:R,close:P,floatingStyles:I,setFloatingRef:E.setFloating}),[T,l,z,C,R,P,I,E.setFloating]),_={actions:z,selectedAction:C,onSelect:R,empty:0===z.length},D="function"==typeof t?t(_):t;return i(A.Provider,Object.assign({value:G},{children:i("div",Object.assign({className:p},{children:D}))}))};C.displayName="ActionMenuList";const L=l((o,e)=>{var{children:n,className:a=""}=o,l=t(o,["children","className"]);const{isOpen:s,floatingStyles:r,setFloatingRef:c,actions:u,selectedAction:p,setSelectedAction:m,onSelect:y,view:g,close:v}=z(),h=d([e,c]);if(!s)return null;const f=null!=n?n:0===u.length?i(F,{}):i(E,{children:u.map(t=>i($,{action:t,selected:t.type===(null==p?void 0:p.type),onMouseEnter:()=>m(t),onClick:()=>y(t.type)},t.type))});return i(N,Object.assign({id:"yoopta-ui-action-menu-list-portal"},{children:i(O,Object.assign({lockScroll:!1,onClick:v,className:"yoopta-ui-action-menu-list-overlay"},{children:i("div",Object.assign({ref:h,role:"listbox",tabIndex:0,className:`yoopta-ui-action-menu-list-content yoopta-ui-action-menu-list-${g} ${a}`,style:r,onMouseDown:t=>t.stopPropagation(),onClick:t=>t.stopPropagation()},l,{children:f}))}))}))});L.displayName="ActionMenuList.Content";const E=l((o,e)=>{var{children:n,className:a=""}=o,l=t(o,["children","className"]);return i("div",Object.assign({ref:e,className:`yoopta-ui-action-menu-list-group ${a}`},l,{children:n}))});E.displayName="ActionMenuList.Group";const $=l((n,a)=>{var{action:l,selected:s,icon:r,className:c="",children:d}=n,m=t(n,["action","selected","icon","className","children"]);const y=null!=r?r:null==l?void 0:l.icon;return o("button",Object.assign({ref:a,type:"button",className:`yoopta-ui-action-menu-list-item ${s?"selected":""} ${c}`,"data-action-menu-item-type":null==l?void 0:l.type,"data-selected":s,"aria-pressed":s},m,{children:[l&&o(e,{children:[y&&i("div",Object.assign({className:"yoopta-ui-action-menu-list-item-icon"},{children:(t=>{if(!t)return null;if("string"==typeof t)return i("img",{src:t,alt:"icon"});if(u(t))return p(t);return i(t,{})})(y)})),o("div",Object.assign({className:"yoopta-ui-action-menu-list-item-content"},{children:[i("div",Object.assign({className:"yoopta-ui-action-menu-list-item-title"},{children:null==l?void 0:l.title})),(null==l?void 0:l.description)&&i("div",Object.assign({className:"yoopta-ui-action-menu-list-item-description"},{children:null==l?void 0:l.description}))]}))]}),d]}))});$.displayName="ActionMenuList.Item";const F=l((o,e)=>{var{children:n,className:a=""}=o,l=t(o,["children","className"]);return i("div",Object.assign({ref:e,className:`yoopta-ui-action-menu-list-empty ${a}`},l,{children:null!=n?n:"No actions available"}))});F.displayName="ActionMenuList.Empty";const T=Object.assign(C,{Root:C,Content:L,Group:E,Item:$,Empty:F});export{T as ActionMenuList,S as filterToggleActions,M as mapActionMenuItems,z as useActionMenuListContext};
1
+ import{_ as t}from"./chunks/_tslib-5e145dfd.js";import{jsx as i,jsxs as o,Fragment as e}from"react/jsx-runtime";import{createContext as n,useContext as a,forwardRef as l,useState as s,useMemo as r,useCallback as c,isValidElement as u,cloneElement as p}from"react";import{d,u as m,f as y,s as g,o as v,a as h,c as f}from"./chunks/floating-ui.react-b048728e.js";import{Blocks as b,getAllowedPluginsFromElement as x,getRootBlockElement as w,useYooptaEditor as k}from"@yoopta/editor";import{s as j}from"./chunks/style-inject.es-e87a8d02.js";import{Portal as N}from"./portal.js";import{Overlay as O}from"./overlay.js";import"react-dom";const A=n(null),z=()=>{const t=a(A);if(!t)throw new Error("ActionMenuList components must be used within <ActionMenuList>");return t};function M(t){const i=Object.keys(t.plugins);let o=null;if("number"==typeof t.path.current){const i=b.getBlockSlate(t,{at:t.path.current});i&&(o=x(t,i))}let e=i;return o&&o.length>0&&(e="string"==typeof i[0]?i.filter(t=>o.includes(t)):i.filter(t=>o.includes(t.type))),e.map(i=>{var o,e,n,a,l,s;if("string"==typeof i){return{type:i,title:(null===(e=null===(o=t.plugins[i].options)||void 0===o?void 0:o.display)||void 0===e?void 0:e.title)||i,description:null===(a=null===(n=t.plugins[i].options)||void 0===n?void 0:n.display)||void 0===a?void 0:a.description,icon:null===(s=null===(l=t.plugins[i].options)||void 0===l?void 0:l.display)||void 0===s?void 0:s.icon}}return i})}function S(t,i){var o;const e=t.plugins[i];if(!e)return!1;const n=w(e.elements);return"void"!==(null===(o=null==n?void 0:n.props)||void 0===o?void 0:o.nodeType)}j(".yoopta-ui-action-menu-list-overlay{background:transparent;z-index:var(--yoopta-ui-action-menu-z-index,9999)}.yoopta-ui-action-menu-list{bottom:auto;left:0;margin:0;position:absolute;right:auto;top:0;z-index:var(--yoopta-ui-action-menu-z-index,9999)}.yoopta-ui-action-menu-list-content{background:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-action-menu-radius,.5rem);box-shadow:var(\n --yoopta-ui-action-menu-shadow,0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)\n );max-height:var(--yoopta-ui-action-menu-max-height,330px);overflow-x:hidden;overflow-y:auto;padding:var(--yoopta-ui-action-menu-padding,.5rem);-webkit-user-select:none;-moz-user-select:none;user-select:none}.yoopta-ui-action-menu-list-group{color:hsl(var(--yoopta-ui-foreground));overflow:hidden;padding:0}.yoopta-ui-action-menu-list-item{align-items:center;background:transparent;border:none;border-radius:var(--yoopta-ui-action-menu-item-radius,.375rem);color:hsl(var(--yoopta-ui-foreground));cursor:pointer;display:flex;font-size:var(--yoopta-ui-action-menu-item-font-size,.875rem);gap:var(--yoopta-ui-action-menu-item-gap,.5rem);margin-bottom:.125rem;outline:none;padding:var(--yoopta-ui-action-menu-item-padding,.5rem);text-align:left;transition:background-color .15s ease-out;width:100%}.yoopta-ui-action-menu-list-item:last-child{margin-bottom:0}.yoopta-ui-action-menu-list-item:hover,.yoopta-ui-action-menu-list-item[data-selected=true]{background:hsl(var(--yoopta-ui-accent))}.yoopta-ui-action-menu-list-item:focus-visible{outline:2px solid hsl(var(--yoopta-ui-ring));outline-offset:2px}.yoopta-ui-action-menu-list-item-icon{align-items:center;background:hsl(var(--yoopta-ui-background));border:1px solid hsl(var(--yoopta-ui-border));border-radius:var(--yoopta-ui-action-menu-icon-radius,.375rem);display:flex;flex-shrink:0;justify-content:center}.yoopta-ui-action-menu-list-item-icon img,.yoopta-ui-action-menu-list-item-icon svg{height:100%;-o-object-fit:contain;object-fit:contain;width:100%}.yoopta-ui-action-menu-list-item-content{flex:1;min-width:0}.yoopta-ui-action-menu-list-item-title{font-weight:500;line-height:1.25}.yoopta-ui-action-menu-list-item-description{color:hsl(var(--yoopta-ui-muted-foreground));font-size:var(--yoopta-ui-action-menu-item-description-font-size,.75rem);line-height:1.25;margin-top:.125rem;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.yoopta-ui-action-menu-list-empty{color:hsl(var(--yoopta-ui-muted-foreground));font-size:var(--yoopta-ui-action-menu-empty-font-size,.75rem);padding:var(--yoopta-ui-action-menu-empty-padding,.5rem);text-align:left}.yoopta-ui-action-menu-list-small{max-height:280px;min-width:180px;padding:.375rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item{font-size:.8125rem;gap:.375rem;padding:.375rem .5rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-icon{height:20px;padding:2px;width:20px}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-title{font-size:.8125rem}.yoopta-ui-action-menu-list-small .yoopta-ui-action-menu-list-item-description{display:none}.yoopta-ui-action-menu-list-default{min-width:244px}.yoopta-ui-action-menu-list-default .yoopta-ui-action-menu-list-item-icon{height:40px;padding:6px;width:40px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar{width:8px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-track{background:transparent}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-thumb{background:hsl(var(--yoopta-ui-border));border-radius:4px}.yoopta-ui-action-menu-list-content::-webkit-scrollbar-thumb:hover{background:hsl(var(--yoopta-ui-muted-foreground))}");const C=({children:t,open:o,onOpenChange:e,defaultOpen:n=!1,anchor:a=null,view:l="default",placement:u="bottom-start",className:p=""})=>{var d;const b=k(),[x,j]=s(n),N=void 0!==o,O=N?o:x,z=r(()=>M(b).filter(t=>S(b,t.type)).filter(t=>{var i,o,e;const n=b.plugins[t.type],a=w(n.elements);return"inline"!==(null===(i=null==a?void 0:a.props)||void 0===i?void 0:i.nodeType)&&"inlineVoid"!==(null===(o=null==a?void 0:a.props)||void 0===o?void 0:o.nodeType)&&"void"!==(null===(e=null==a?void 0:a.props)||void 0===e?void 0:e.nodeType)}),[b]),[C,L]=s(null!==(d=z[0])&&void 0!==d?d:null),{refs:E,floatingStyles:$,context:F}=m({elements:{reference:a},placement:u,open:O,middleware:[y(),g(),v(10)],whileElementsMounted:h}),{isMounted:T,styles:B}=f(F,{duration:100}),I=r(()=>Object.assign(Object.assign(Object.assign({},$),B),{minWidth:"small"===l?200:244}),[$,B,l]),P=c(()=>{var t;N||j(!1),null==e||e(!1),L(null!==(t=z[0])&&void 0!==t?t:null)},[N,e,z]),R=c(t=>{Array.isArray(b.path.selected)&&b.path.selected.length>0?b.batchOperations(()=>{b.path.selected.forEach(i=>{b.toggleBlock(t,{preserveContent:!0,focus:!0,at:i})})}):b.toggleBlock(t,{preserveContent:!0,focus:!0,at:b.path.current}),P()},[b,P]),G=r(()=>({isOpen:T,view:l,actions:z,selectedAction:C,setSelectedAction:L,onSelect:R,close:P,floatingStyles:I,setFloatingRef:E.setFloating}),[T,l,z,C,R,P,I,E.setFloating]),_={actions:z,selectedAction:C,onSelect:R,empty:0===z.length},D="function"==typeof t?t(_):t;return i(A.Provider,Object.assign({value:G},{children:i("div",Object.assign({className:p},{children:D}))}))};C.displayName="ActionMenuList";const L=l((o,e)=>{var{children:n,className:a=""}=o,l=t(o,["children","className"]);const{isOpen:s,floatingStyles:r,setFloatingRef:c,actions:u,selectedAction:p,setSelectedAction:m,onSelect:y,view:g,close:v}=z(),h=d([e,c]);if(!s)return null;const f=null!=n?n:0===u.length?i(F,{}):i(E,{children:u.map(t=>i($,{action:t,selected:t.type===(null==p?void 0:p.type),onMouseEnter:()=>m(t),onClick:()=>y(t.type)},t.type))});return i(N,Object.assign({id:"yoopta-ui-action-menu-list-portal"},{children:i(O,Object.assign({lockScroll:!1,onClick:v,className:"yoopta-ui-action-menu-list-overlay"},{children:i("div",Object.assign({ref:h,role:"listbox",tabIndex:0,className:`yoopta-ui-action-menu-list-content yoopta-ui-action-menu-list-${g} ${a}`,style:r,onMouseDown:t=>t.stopPropagation(),onClick:t=>t.stopPropagation()},l,{children:f}))}))}))});L.displayName="ActionMenuList.Content";const E=l((o,e)=>{var{children:n,className:a=""}=o,l=t(o,["children","className"]);return i("div",Object.assign({ref:e,className:`yoopta-ui-action-menu-list-group ${a}`},l,{children:n}))});E.displayName="ActionMenuList.Group";const $=l((n,a)=>{var{action:l,selected:s,icon:r,className:c="",children:d}=n,m=t(n,["action","selected","icon","className","children"]);const y=null!=r?r:null==l?void 0:l.icon;return o("button",Object.assign({ref:a,type:"button",className:`yoopta-ui-action-menu-list-item ${s?"selected":""} ${c}`,"data-action-menu-item-type":null==l?void 0:l.type,"data-selected":s,"aria-pressed":s},m,{children:[l&&o(e,{children:[y&&i("div",Object.assign({className:"yoopta-ui-action-menu-list-item-icon"},{children:(t=>{if(!t)return null;if("string"==typeof t)return i("img",{src:t,alt:"icon"});if(u(t))return p(t);return i(t,{})})(y)})),o("div",Object.assign({className:"yoopta-ui-action-menu-list-item-content"},{children:[i("div",Object.assign({className:"yoopta-ui-action-menu-list-item-title"},{children:null==l?void 0:l.title})),(null==l?void 0:l.description)&&i("div",Object.assign({className:"yoopta-ui-action-menu-list-item-description"},{children:null==l?void 0:l.description}))]}))]}),d]}))});$.displayName="ActionMenuList.Item";const F=l((o,e)=>{var{children:n,className:a=""}=o,l=t(o,["children","className"]);return i("div",Object.assign({ref:e,className:`yoopta-ui-action-menu-list-empty ${a}`},l,{children:null!=n?n:"No actions available"}))});F.displayName="ActionMenuList.Empty";const T=Object.assign(C,{Root:C,Content:L,Group:E,Item:$,Empty:F});export{T as ActionMenuList,S as filterToggleActions,M as mapActionMenuItems,z as useActionMenuListContext};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-menu-list.js","sources":["../src/action-menu-list/context.tsx","../src/action-menu-list/utils.ts","../src/action-menu-list/action-menu-list.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\nimport type { CSSProperties } from 'react';\nimport type { ActionMenuItem } from './types';\n\nexport type ActionMenuListContextValue = {\n /** Whether menu is open */\n isOpen: boolean;\n /** Current view mode */\n view: 'small' | 'default';\n /** Available actions from editor plugins */\n actions: ActionMenuItem[];\n /** Currently selected/hovered action */\n selectedAction: ActionMenuItem | null;\n /** Select an action (hover) */\n setSelectedAction: (action: ActionMenuItem) => void;\n /** Execute action (toggle block) */\n onSelect: (type: string) => void;\n /** Close the menu */\n close: () => void;\n /** Floating styles for positioning */\n floatingStyles: CSSProperties;\n /** Ref setter for floating element */\n setFloatingRef: (node: HTMLElement | null) => void;\n};\n\nexport const ActionMenuListContext = createContext<ActionMenuListContextValue | null>(null);\n\nexport const useActionMenuListContext = () => {\n const context = useContext(ActionMenuListContext);\n\n if (!context) {\n throw new Error('ActionMenuList components must be used within <ActionMenuList>');\n }\n\n return context;\n};\n","import { Blocks, getAllowedPluginsFromElement, getRootBlockElement } from '@yoopta/editor';\nimport type { Plugin, SlateElement, YooEditor, YooptaBlock, YooptaBlockData } from '@yoopta/editor';\n\nimport type { ActionMenuItem } from './types';\n\nconst filterBy = (\n item: YooptaBlockData | YooptaBlock['options'],\n text: string,\n field: string,\n): boolean => {\n if (!item || typeof item[field] === 'undefined') return false;\n\n const value = item[field];\n const searchText = text.toLowerCase().trim();\n\n if (Array.isArray(value)) {\n return value\n .filter(Boolean)\n .map((v) => String(v).toLowerCase())\n .some((v) => v.includes(searchText));\n }\n\n return String(value).toLowerCase().includes(searchText);\n};\n\nexport const filterActionMenuItems = (\n blockPlugin: Plugin<Record<string, SlateElement>, unknown>,\n searchText: string,\n): boolean => {\n if (!searchText.trim()) return true;\n if (!blockPlugin) return false;\n\n const searchTerms = searchText.toLowerCase().split(/\\s+/);\n\n return searchTerms.every((term) => {\n const typeMatch = filterBy(blockPlugin, term, 'type');\n if (typeMatch) return true;\n\n const titleMatch =\n blockPlugin.options?.display && filterBy(blockPlugin.options.display, term, 'title');\n if (titleMatch) return true;\n\n const shortcutMatch = blockPlugin.options && filterBy(blockPlugin.options, term, 'shortcuts');\n if (shortcutMatch) return true;\n\n const descriptionMatch =\n blockPlugin.options?.display && filterBy(blockPlugin.options.display, term, 'description');\n if (descriptionMatch) return true;\n\n return false;\n });\n};\n\nexport function mapActionMenuItems(editor: YooEditor): ActionMenuItem[] {\n const items: string[] | ActionMenuItem[] = Object.keys(editor.plugins);\n // Check if we're inside an element with injectElementsFromPlugins\n let injectElementsFromPlugins: string[] | null = null;\n\n if (typeof editor.path.current === 'number') {\n const slate = Blocks.getBlockSlate(editor, { at: editor.path.current });\n if (slate) {\n injectElementsFromPlugins = getAllowedPluginsFromElement(editor, slate);\n }\n }\n\n // Filter items based on injectElementsFromPlugins\n let filteredItems = items;\n\n if (injectElementsFromPlugins && injectElementsFromPlugins.length > 0) {\n if (typeof items[0] === 'string') {\n filteredItems = (items as string[]).filter((item) =>\n injectElementsFromPlugins!.includes(item),\n );\n } else {\n filteredItems = items.filter((item) => injectElementsFromPlugins!.includes(item.type));\n }\n }\n\n return filteredItems.map((item: string | ActionMenuItem) => {\n if (typeof item === 'string') {\n const title = editor.plugins[item].options?.display?.title || item;\n const description = editor.plugins[item].options?.display?.description;\n const icon = editor.plugins[item].options?.display?.icon;\n return { type: item, title, description, icon };\n }\n return item;\n });\n}\n\nexport function filterToggleActions(editor: YooEditor, type: string) {\n const block = editor.plugins[type];\n if (!block) return false;\n\n const rootBlock = getRootBlockElement(block.elements);\n if (rootBlock?.props?.nodeType === 'void') return false;\n return true;\n}\n\nexport function isSlashPressed(event: KeyboardEvent): boolean {\n return (\n event.key === '/' ||\n event.keyCode === 191 ||\n event.which === 191 ||\n event.code === 'Slash' ||\n event.key === '/' ||\n (event.key === '.' && event.shiftKey)\n );\n}\n","import type { CSSProperties, HTMLAttributes, ReactNode } from 'react';\nimport { cloneElement, forwardRef, isValidElement, useCallback, useMemo, useState } from 'react';\nimport type { Placement } from '@floating-ui/react';\nimport { autoUpdate, flip, offset, shift, useFloating, useMergeRefs, useTransitionStyles } from '@floating-ui/react';\nimport { getRootBlockElement, useYooptaEditor } from '@yoopta/editor';\n\nimport { ActionMenuListContext, useActionMenuListContext } from './context';\nimport type { ActionMenuItem } from './types';\nimport { filterToggleActions, mapActionMenuItems } from './utils';\nimport { Overlay } from '../overlay';\nimport { Portal } from '../portal';\nimport './action-menu-list.css';\n\ntype ActionMenuListApi = {\n /** Available actions from editor plugins */\n actions: ActionMenuItem[];\n /** Currently selected action */\n selectedAction: ActionMenuItem | null;\n /** Execute action (toggle block type) */\n onSelect: (type: string) => void;\n /** Whether actions list is empty */\n empty: boolean;\n};\n\ntype ActionMenuListRootProps = {\n children: ReactNode | ((api: ActionMenuListApi) => ReactNode);\n /** Controlled open state */\n open?: boolean;\n /** Callback when open state changes */\n onOpenChange?: (open: boolean) => void;\n /** Default open state for uncontrolled usage */\n defaultOpen?: boolean;\n /** Anchor element for positioning */\n anchor?: HTMLElement | null;\n /** View mode - 'small' for compact, 'default' for full */\n view?: 'small' | 'default';\n /** Placement relative to anchor */\n placement?: Placement;\n className?: string;\n};\n\nconst ActionMenuListRoot = ({\n children,\n open: controlledOpen,\n onOpenChange: controlledOnOpenChange,\n defaultOpen = false,\n anchor = null,\n view = 'default',\n placement = 'bottom-start',\n className = '',\n}: ActionMenuListRootProps) => {\n const editor = useYooptaEditor();\n const [uncontrolledOpen, setUncontrolledOpen] = useState(defaultOpen);\n\n const isControlled = controlledOpen !== undefined;\n const isOpen = isControlled ? controlledOpen : uncontrolledOpen;\n\n // Get available actions from editor plugins\n const actions = useMemo(\n () => mapActionMenuItems(editor).filter((item) => filterToggleActions(editor, item.type)).filter(item => {\n const plugin = editor.plugins[item.type];\n const rootElement = getRootBlockElement(plugin.elements);\n return rootElement?.props?.nodeType !== 'inline' && rootElement?.props?.nodeType !== 'inlineVoid' && rootElement?.props?.nodeType !== 'void';\n }),\n [editor],\n );\n\n const [selectedAction, setSelectedAction] = useState<ActionMenuItem | null>(actions[0] ?? null);\n\n // Floating UI setup\n const { refs, floatingStyles, context } = useFloating({\n elements: { reference: anchor },\n placement,\n open: isOpen,\n middleware: [flip(), shift(), offset(10)],\n whileElementsMounted: autoUpdate,\n });\n\n const { isMounted, styles: transitionStyles } = useTransitionStyles(context, {\n duration: 100,\n });\n\n // Combined styles with view-specific width\n const combinedStyles: CSSProperties = useMemo(\n () => ({\n ...floatingStyles,\n ...transitionStyles,\n minWidth: view === 'small' ? 200 : 244,\n }),\n [floatingStyles, transitionStyles, view],\n );\n\n // Close menu\n const close = useCallback(() => {\n if (!isControlled) {\n setUncontrolledOpen(false);\n }\n controlledOnOpenChange?.(false);\n setSelectedAction(actions[0] ?? null);\n }, [isControlled, controlledOnOpenChange, actions]);\n\n const onSelect = useCallback(\n (type: string) => {\n if (Array.isArray(editor.path.selected) && editor.path.selected.length > 0) {\n editor.batchOperations(() => {\n editor.path.selected!.forEach((selected) => {\n editor.toggleBlock(type, { preserveContent: true, focus: true, at: selected });\n });\n });\n } else {\n editor.toggleBlock(type, { preserveContent: true, focus: true, at: editor.path.current });\n }\n\n close();\n },\n [editor, close],\n );\n\n // Context value\n const contextValue = useMemo(\n () => ({\n isOpen: isMounted,\n view,\n actions,\n selectedAction,\n setSelectedAction,\n onSelect,\n close,\n floatingStyles: combinedStyles,\n setFloatingRef: refs.setFloating,\n }),\n [isMounted, view, actions, selectedAction, onSelect, close, combinedStyles, refs.setFloating],\n );\n\n // API for render props\n const api: ActionMenuListApi = {\n actions,\n selectedAction,\n onSelect,\n empty: actions.length === 0,\n };\n\n // Render props or regular children\n const content = typeof children === 'function' ? children(api) : children;\n\n return (\n <ActionMenuListContext.Provider value={contextValue}>\n <div className={className}>{content}</div>\n </ActionMenuListContext.Provider>\n );\n};\n\nActionMenuListRoot.displayName = 'ActionMenuList';\n\ntype ActionMenuListContentProps = {\n children?: ReactNode;\n className?: string;\n} & HTMLAttributes<HTMLDivElement>;\n\nconst ActionMenuListContent = forwardRef<HTMLDivElement, ActionMenuListContentProps>(\n ({ children, className = '', ...props }, forwardedRef) => {\n const { isOpen, floatingStyles, setFloatingRef, actions, selectedAction, setSelectedAction, onSelect, view, close } =\n useActionMenuListContext();\n const mergedRef = useMergeRefs([forwardedRef, setFloatingRef]);\n\n if (!isOpen) return null;\n\n // Auto-generate items if no children provided\n const content =\n children ??\n (actions.length === 0 ? (\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n <ActionMenuListEmpty />\n ) : (\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n <ActionMenuListGroup>\n {actions.map((action) => (\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n <ActionMenuListItem\n key={action.type}\n action={action}\n selected={action.type === selectedAction?.type}\n onMouseEnter={() => setSelectedAction(action)}\n onClick={() => onSelect(action.type)}\n />\n ))}\n </ActionMenuListGroup>\n ));\n\n return (\n <Portal id=\"yoopta-ui-action-menu-list-portal\">\n <Overlay lockScroll={false} onClick={close} className=\"yoopta-ui-action-menu-list-overlay\">\n <div\n ref={mergedRef}\n role=\"listbox\"\n tabIndex={0}\n className={`yoopta-ui-action-menu-list-content yoopta-ui-action-menu-list-${view} ${className}`}\n style={floatingStyles}\n onMouseDown={(e) => e.stopPropagation()}\n onClick={(e) => e.stopPropagation()}\n {...props}\n >\n {content}\n </div>\n </Overlay>\n </Portal>\n );\n },\n);\n\nActionMenuListContent.displayName = 'ActionMenuList.Content';\n\ntype ActionMenuListGroupProps = HTMLAttributes<HTMLDivElement>;\n\nconst ActionMenuListGroup = forwardRef<HTMLDivElement, ActionMenuListGroupProps>(\n ({ children, className = '', ...props }, ref) => (\n <div ref={ref} className={`yoopta-ui-action-menu-list-group ${className}`} {...props}>\n {children}\n </div>\n ),\n);\n\nActionMenuListGroup.displayName = 'ActionMenuList.Group';\n\ntype ActionMenuListItemProps = HTMLAttributes<HTMLButtonElement> & {\n action?: ActionMenuItem;\n selected?: boolean;\n icon?: string | ReactNode;\n};\n\nconst ActionMenuListItem = forwardRef<HTMLButtonElement, ActionMenuListItemProps>(\n ({ action, selected, icon: iconProp, className = '', children, ...props }, ref) => {\n const renderIcon = (icon: unknown) => {\n if (!icon) return null;\n\n if (typeof icon === 'string') {\n return <img src={icon} alt=\"icon\" />;\n }\n\n if (isValidElement(icon)) {\n return cloneElement(icon as React.ReactElement);\n }\n\n const IconComponent = icon as React.ComponentType;\n return <IconComponent />;\n };\n\n const iconToRender = iconProp ?? action?.icon;\n\n return (\n <button\n ref={ref}\n type=\"button\"\n className={`yoopta-ui-action-menu-list-item ${selected ? 'selected' : ''} ${className}`}\n data-action-menu-item-type={action?.type}\n data-selected={selected}\n aria-pressed={selected}\n {...props}\n >\n {action && (\n <>\n {iconToRender && <div className=\"yoopta-ui-action-menu-list-item-icon\">{renderIcon(iconToRender)}</div>}\n <div className=\"yoopta-ui-action-menu-list-item-content\">\n <div className=\"yoopta-ui-action-menu-list-item-title\">{action?.title}</div>\n {action?.description && <div className=\"yoopta-ui-action-menu-list-item-description\">{action?.description}</div>}\n </div>\n </>\n )}\n {children}\n </button>\n );\n },\n);\n\nActionMenuListItem.displayName = 'ActionMenuList.Item';\n\ntype ActionMenuListEmptyProps = HTMLAttributes<HTMLDivElement>;\n\nconst ActionMenuListEmpty = forwardRef<HTMLDivElement, ActionMenuListEmptyProps>(\n ({ children, className = '', ...props }, ref) => (\n <div ref={ref} className={`yoopta-ui-action-menu-list-empty ${className}`} {...props}>\n {children ?? 'No actions available'}\n </div>\n ),\n);\n\nActionMenuListEmpty.displayName = 'ActionMenuList.Empty';\n\nexport const ActionMenuList = Object.assign(ActionMenuListRoot, {\n Root: ActionMenuListRoot,\n Content: ActionMenuListContent,\n Group: ActionMenuListGroup,\n Item: ActionMenuListItem,\n Empty: ActionMenuListEmpty,\n});\n\nexport type {\n ActionMenuListRootProps,\n ActionMenuListContentProps,\n ActionMenuListGroupProps,\n ActionMenuListItemProps,\n ActionMenuListEmptyProps,\n ActionMenuListApi,\n};\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;AAyBO,MAAM,qBAAqB,GAAG,aAAa,CAAoC,IAAI,CAAC,CAAC;AAErF,MAAM,wBAAwB,GAAG,MAAK;AAC3C,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAElD,IAAI,CAAC,OAAO,EAAE;AACZ,QAAA,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;AACnF,KAAA;AAED,IAAA,OAAO,OAAO,CAAC;AACjB;;ACkBM,SAAU,kBAAkB,CAAC,MAAiB,EAAA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