@blocknote/mantine 0.13.0 → 0.13.2

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.
@@ -24,5 +24,5 @@ Check the render method of \``+e+"`."}return""}}function st(e){{if(e!==void 0){v
24
24
 
25
25
  Check your code at `+n+":"+i+"."}return""}}var We={};function it(e){{var n=Ve();if(!n){var i=typeof e=="string"?e:e.displayName||e.name;i&&(n=`
26
26
 
27
- Check the top-level render call using <`+i+">.")}return n}}function Ye(e,n){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var i=it(n);if(We[i])return;We[i]=!0;var v="";e&&e._owner&&e._owner!==se.current&&(v=" It was passed a child from "+M(e._owner.type)+"."),A(e),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,v),A(null)}}function Ue(e,n){{if(typeof e!="object")return;if(ae(e))for(var i=0;i<e.length;i++){var v=e[i];le(v)&&Ye(v,n)}else if(le(e))e._store&&(e._store.validated=!0);else if(e){var x=Nr(e);if(typeof x=="function"&&x!==e.entries)for(var k=x.call(e),h;!(h=k.next()).done;)le(h.value)&&Ye(h.value,n)}}}function lt(e){{var n=e.type;if(n==null||typeof n=="string")return;var i;if(typeof n=="function")i=n.propTypes;else if(typeof n=="object"&&(n.$$typeof===b||n.$$typeof===R))i=n.propTypes;else return;if(i){var v=M(n);Hr(i,e.props,"prop",v,e)}else if(n.PropTypes!==void 0&&!ie){ie=!0;var x=M(n);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",x||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ut(e){{for(var n=Object.keys(e.props),i=0;i<n.length;i++){var v=n[i];if(v!=="children"&&v!=="key"){A(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),A(null);break}}e.ref!==null&&(A(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}function Ge(e,n,i,v,x,k){{var h=$r(e);if(!h){var p="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(p+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var C=st(x);C?p+=C:p+=Ve();var j;e===null?j="null":ae(e)?j="array":e!==void 0&&e.$$typeof===t?(j="<"+(M(e.type)||"Unknown")+" />",p=" Did you accidentally export a JSX literal instead of a component?"):j=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",j,p)}var w=ot(e,n,i,x,k);if(w==null)return w;if(h){var O=n.children;if(O!==void 0)if(v)if(ae(O)){for(var z=0;z<O.length;z++)Ue(O[z],e);Object.freeze&&Object.freeze(O)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ue(O,e)}return e===o?ut(w):lt(w),w}}function ct(e,n,i){return Ge(e,n,i,!0)}function ft(e,n,i){return Ge(e,n,i,!1)}var dt=ft,vt=ct;$.Fragment=o,$.jsx=dt,$.jsxs=vt}()),$}process.env.NODE_ENV==="production"?Z.exports=Xe():Z.exports=Ze();var l=Z.exports;const ve=(r,t,a=!1)=>{const o=[];function s(c,d="--bn"){for(const u in c){const b=u.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),m=`${d}-${b}`;typeof c[u]!="object"?(typeof c[u]=="number"&&(c[u]=`${c[u]}px`),a?t.style.removeProperty(m):t.style.setProperty(m,c[u].toString())):s(c[u],m)}}return s(r),o},Q=(r,t)=>ve(r,t),Qe={colors:{editor:{text:void 0,background:void 0},menu:{text:void 0,background:void 0},tooltip:{text:void 0,background:void 0},hovered:{text:void 0,background:void 0},selected:{text:void 0,background:void 0},disabled:{text:void 0,background:void 0},shadow:void 0,border:void 0,sideMenu:void 0,highlights:{gray:{text:void 0,background:void 0},brown:{text:void 0,background:void 0},red:{text:void 0,background:void 0},orange:{text:void 0,background:void 0},yellow:{text:void 0,background:void 0},green:{text:void 0,background:void 0},blue:{text:void 0,background:void 0},purple:{text:void 0,background:void 0},pink:{text:void 0,background:void 0}}},borderRadius:void 0,fontFamily:void 0},be=r=>ve(Qe,r,!0),er=g.forwardRef((r,t)=>{const{className:a,name:o,label:s,icon:c,value:d,autoFocus:u,placeholder:b,onKeyDown:m,onChange:T,onSubmit:R,...P}=r;return E.assertEmpty(P),l.jsx(f.TextInput,{size:"xs",className:a,ref:t,name:o,label:s,leftSection:c,value:d,autoFocus:u,"data-autofocus":u?"true":void 0,placeholder:b,onKeyDown:m,onChange:T,onSubmit:R})});var me={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},pe=F.default.createContext&&F.default.createContext(me),D=globalThis&&globalThis.__assign||function(){return D=Object.assign||function(r){for(var t,a=1,o=arguments.length;a<o;a++){t=arguments[a];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=t[s])}return r},D.apply(this,arguments)},rr=globalThis&&globalThis.__rest||function(r,t){var a={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&t.indexOf(o)<0&&(a[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(r);s<o.length;s++)t.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(r,o[s])&&(a[o[s]]=r[o[s]]);return a};function ge(r){return r&&r.map(function(t,a){return F.default.createElement(t.tag,D({key:a},t.attr),ge(t.child))})}function he(r){return function(t){return F.default.createElement(tr,D({attr:D({},r.attr)},t),ge(r.child))}}function tr(r){var t=function(a){var o=r.attr,s=r.size,c=r.title,d=rr(r,["attr","size","title"]),u=s||a.size||"1em",b;return a.className&&(b=a.className),r.className&&(b=(b?b+" ":"")+r.className),F.default.createElement("svg",D({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,o,d,{className:b,style:D(D({color:r.color||a.color},a.style),r.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),c&&F.default.createElement("title",null,c),r.children)};return pe!==void 0?F.default.createElement(pe.Consumer,null,function(a){return t(a)}):t(me)}function nr(r){return he({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"}}]})(r)}function ar(r){return he({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"}}]})(r)}const ye=g.createContext(void 0),or=g.forwardRef((r,t)=>{const{children:a,onOpenChange:o,position:s,sub:c,...d}=r;E.assertEmpty(d);const[u,b]=g.useState(!1),m=g.useRef(),T=g.useCallback(()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{b(!1)},250)},[]),R=g.useCallback(()=>{m.current&&clearTimeout(m.current),b(!0)},[]);return l.jsx(ye.Provider,{value:{onMenuMouseOver:R,onMenuMouseLeave:T},children:l.jsx(f.Menu.Item,{className:"bn-menu-item bn-mt-sub-menu-item",ref:t,onMouseOver:R,onMouseLeave:T,children:l.jsx(f.Menu,{withinPortal:!1,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},trigger:"hover",opened:u,onClose:()=>o==null?void 0:o(!1),onOpen:()=>o==null?void 0:o(!0),position:s,children:a})})})}),sr=r=>{const{children:t,onOpenChange:a,position:o,sub:s,...c}=r;return E.assertEmpty(c),s?l.jsx(or,{...r}):l.jsx(f.Menu,{withinPortal:!1,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},onClose:()=>a==null?void 0:a(!1),onOpen:()=>a==null?void 0:a(!0),position:o,children:t})},ir=g.forwardRef((r,t)=>{const{className:a,children:o,icon:s,checked:c,subTrigger:d,onClick:u,...b}=r;return E.assertEmpty(b,!1),d?l.jsxs("div",{ref:t,...b,children:[o,l.jsx(ar,{size:15})]}):l.jsx(f.Menu.Item,{className:a,ref:t,leftSection:s,rightSection:c?l.jsx(f.CheckIcon,{size:10}):c===!1?l.jsx("div",{className:"bn-tick-space"}):null,onClick:u,...b,children:o})}),lr=r=>{const{children:t,sub:a,...o}=r;return E.assertEmpty(o),l.jsx(f.Menu.Target,{children:t})},ur=g.forwardRef((r,t)=>{const{className:a,children:o,sub:s,...c}=r;E.assertEmpty(c);const d=g.useContext(ye);return l.jsx(f.Menu.Dropdown,{className:a,ref:t,onMouseOver:d==null?void 0:d.onMenuMouseOver,onMouseLeave:d==null?void 0:d.onMenuMouseLeave,children:o})}),cr=g.forwardRef((r,t)=>{const{className:a,...o}=r;return E.assertEmpty(o),l.jsx(f.Menu.Divider,{className:a,ref:t})}),fr=g.forwardRef((r,t)=>{const{className:a,children:o,...s}=r;return E.assertEmpty(s),l.jsx(f.Menu.Label,{className:a,ref:t,children:o})}),dr=g.forwardRef((r,t)=>{const{className:a,tabs:o,defaultOpenTab:s,openTab:c,setOpenTab:d,loading:u,...b}=r;return E.assertEmpty(b),l.jsx(f.Group,{className:a,ref:t,children:l.jsxs(f.Tabs,{value:c,defaultValue:s,onChange:d,children:[u&&l.jsx(f.LoadingOverlay,{visible:u}),l.jsx(f.Tabs.List,{children:o.map(m=>l.jsx(f.Tabs.Tab,{"data-test":`${m.name.toLowerCase()}-tab`,value:m.name,children:m.name},m.name))}),o.map(m=>l.jsx(f.Tabs.Panel,{value:m.name,children:m.tabPanel},m.name))]})})}),vr=g.forwardRef((r,t)=>{const{className:a,children:o,onClick:s,label:c,...d}=r;return E.assertEmpty(d),l.jsx(f.Button,{size:"xs","aria-label":c,className:a,ref:t,onClick:s,...d,children:o})}),br=g.forwardRef((r,t)=>{const{className:a,value:o,placeholder:s,onChange:c,...d}=r;return E.assertEmpty(d),l.jsx(f.FileInput,{size:"xs",className:a,ref:t,value:o,placeholder:s,onChange:c,...d})}),mr=g.forwardRef((r,t)=>{const{className:a,children:o,...s}=r;return E.assertEmpty(s),l.jsx("div",{className:a,ref:t,children:o})}),pr=g.forwardRef((r,t)=>{const{className:a,value:o,placeholder:s,onKeyDown:c,onChange:d,...u}=r;return E.assertEmpty(u),l.jsx(f.TextInput,{size:"xs","data-test":"embed-input",className:a,ref:t,value:o,placeholder:s,onKeyDown:c,onChange:d})}),gr=r=>{const{children:t,opened:a,position:o,...s}=r;return E.assertEmpty(s),l.jsx(f.Popover,{withinPortal:!1,zIndex:1e4,opened:a,position:o,children:t})},hr=r=>{const{children:t,...a}=r;return E.assertEmpty(a),l.jsx(f.PopoverTarget,{children:t})},yr=g.forwardRef((r,t)=>{const{className:a,children:o,variant:s,...c}=r;return E.assertEmpty(c),l.jsx(f.PopoverDropdown,{className:a,ref:t,children:o})}),xr=g.forwardRef((r,t)=>{const{className:a,children:o,...s}=r;return E.assertEmpty(s),l.jsx(f.Group,{align:"center",gap:0,className:a,ref:t,children:o})}),Er=g.forwardRef((r,t)=>{const{className:a,children:o,icon:s,onClick:c,onDragEnd:d,onDragStart:u,draggable:b,label:m,...T}=r;return E.assertEmpty(T,!1),s?l.jsx(f.ActionIcon,{size:24,className:a,ref:t,onClick:c,onDragEnd:d,onDragStart:u,draggable:b,"aria-label":m,...T,children:s}):l.jsx(f.Button,{className:a,ref:t,onClick:c,onDragEnd:d,onDragStart:u,draggable:b,"aria-label":m,...T,children:o})}),Tr=g.forwardRef((r,t)=>{const{className:a,children:o,id:s,...c}=r;return E.assertEmpty(c),l.jsx(f.Stack,{gap:0,className:a,ref:t,id:s,role:"listbox",children:o})}),kr=g.forwardRef((r,t)=>{const{className:a,children:o,...s}=r;return E.assertEmpty(s),l.jsx(f.Group,{className:a,ref:t,children:l.jsx(f.Group,{className:"bn-mt-suggestion-menu-item-label",children:o})})}),jr=g.forwardRef((r,t)=>{const{className:a,isSelected:o,onClick:s,item:c,id:d,...u}=r;return E.assertEmpty(u),l.jsxs(f.Group,{gap:0,className:a,ref:t,id:d,role:"option","aria-selected":o||void 0,children:[c.icon&&l.jsx(f.Group,{className:"bn-mt-suggestion-menu-item-section","data-position":"left",children:c.icon}),l.jsxs(f.Stack,{gap:0,className:"bn-mt-suggestion-menu-item-body",children:[l.jsx(f.Text,{className:"bn-mt-suggestion-menu-item-title",children:c.title}),l.jsx(f.Text,{className:"bn-mt-suggestion-menu-item-subtitle",children:c.subtext})]}),c.badge&&l.jsx(f.Group,{"data-position":"right",className:"bn-mt-suggestion-menu-item-section",children:l.jsx(f.Badge,{size:"xs",children:c.badge})})]})}),wr=g.forwardRef((r,t)=>{const{className:a,children:o,...s}=r;return E.assertEmpty(s),l.jsx(f.Group,{className:a,ref:t,children:o})}),Sr=g.forwardRef((r,t)=>{const{className:a,children:o,...s}=r;return E.assertEmpty(s),l.jsx(f.Loader,{className:a,type:"dots",ref:t})}),Rr=g.forwardRef((r,t)=>{const{className:a,children:o,draggable:s,onDragStart:c,onDragEnd:d,style:u,label:b,...m}=r;return E.assertEmpty(m,!1),l.jsx("button",{className:a,ref:t,"aria-label":b,draggable:s,onDragStart:c,onDragEnd:d,style:u,...m,children:o})}),xe=g.forwardRef((r,t)=>{const{className:a,children:o,onMouseEnter:s,onMouseLeave:c,...d}=r;E.assertEmpty(d);const{ref:u,focused:b}=X.useFocusWithin(),m=X.useFocusTrap(b),T=X.mergeRefs(t,u,m);return l.jsx(f.Group,{className:a,ref:T,role:"toolbar",onMouseEnter:s,onMouseLeave:c,children:o})}),_r=r=>l.jsxs(f.Stack,{gap:0,className:"bn-tooltip",children:[l.jsx(f.Text,{size:"sm",children:r.mainTooltip}),r.secondaryTooltip&&l.jsx(f.Text,{size:"xs",children:r.secondaryTooltip})]}),Ee=g.forwardRef((r,t)=>{const{className:a,children:o,mainTooltip:s,secondaryTooltip:c,icon:d,isSelected:u,isDisabled:b,onClick:m,label:T,...R}=r;return E.assertEmpty(R,!1),l.jsx(f.Tooltip,{withinPortal:!1,label:l.jsx(_r,{mainTooltip:s,secondaryTooltip:c}),children:o?l.jsx(f.Button,{"aria-label":T,className:a,onMouseDown:P=>{E.isSafari()&&P.currentTarget.focus()},onClick:m,"aria-pressed":u,"data-selected":u||void 0,"data-test":s.slice(0,1).toLowerCase()+s.replace(/\s+/g,"").slice(1),size:"xs",disabled:b||!1,ref:t,...R,children:o}):l.jsx(f.ActionIcon,{className:a,"aria-label":T,onMouseDown:P=>{E.isSafari()&&P.currentTarget.focus()},onClick:m,"aria-pressed":u,"data-selected":u||void 0,"data-test":s.slice(0,1).toLowerCase()+s.replace(/\s+/g,"").slice(1),size:30,disabled:b||!1,ref:t,...R,children:d})})}),Cr=g.forwardRef((r,t)=>{const{className:a,items:o,isDisabled:s,...c}=r;E.assertEmpty(c);const d=o.filter(u=>u.isSelected)[0];return d?l.jsxs(f.Menu,{withinPortal:!1,transitionProps:{exitDuration:0},disabled:s,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},children:[l.jsx(f.Menu.Target,{children:l.jsx(f.Button,{onMouseDown:u=>{E.isSafari()&&u.currentTarget.focus()},leftSection:d.icon,rightSection:l.jsx(nr,{}),size:"xs",variant:"subtle",disabled:s,children:d.text})}),l.jsx(f.Menu.Dropdown,{className:a,ref:t,children:o.map(u=>l.jsx(f.Menu.Item,{onClick:u.onClick,leftSection:u.icon,rightSection:u.isSelected?l.jsx(f.CheckIcon,{size:10,className:"bn-tick-icon"}):l.jsx("div",{className:"bn-tick-space"}),disabled:u.isDisabled,children:u.text},u.text))})]}):null}),bt="",y=["#FFFFFF","#EFEFEF","#CFCFCF","#AFAFAF","#7F7F7F","#3F3F3F","#1F1F1F","#161616","#0F0F0F","#000000"],ee={colors:{editor:{text:y[5],background:y[0]},menu:{text:y[5],background:y[0]},tooltip:{text:y[5],background:y[1]},hovered:{text:y[5],background:y[1]},selected:{text:y[0],background:y[5]},disabled:{text:y[3],background:y[1]},shadow:y[2],border:y[1],sideMenu:y[2],highlights:{gray:{text:"#9b9a97",background:"#ebeced"},brown:{text:"#64473a",background:"#e9e5e3"},red:{text:"#e03e3e",background:"#fbe4e4"},orange:{text:"#d9730d",background:"#f6e9d9"},yellow:{text:"#dfab01",background:"#fbf3db"},green:{text:"#4d6461",background:"#ddedea"},blue:{text:"#0b6e99",background:"#ddebf1"},purple:{text:"#6940a5",background:"#eae4f2"},pink:{text:"#ad1a72",background:"#f4dfeb"}}},borderRadius:6,fontFamily:'"Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Open Sans", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif'},Pr={colors:{editor:{text:y[2],background:y[6]},menu:{text:y[2],background:y[6]},tooltip:{text:y[2],background:y[7]},hovered:{text:y[2],background:y[7]},selected:{text:y[2],background:y[8]},disabled:{text:y[5],background:y[7]},shadow:y[8],border:y[7],sideMenu:y[4],highlights:{gray:{text:"#bebdb8",background:"#9b9a97"},brown:{text:"#8e6552",background:"#64473a"},red:{text:"#ec4040",background:"#be3434"},orange:{text:"#e3790d",background:"#b7600a"},yellow:{text:"#dfab01",background:"#b58b00"},green:{text:"#6b8b87",background:"#4d6461"},blue:{text:"#0e87bc",background:"#0b6e99"},purple:{text:"#8552d7",background:"#6940a5"},pink:{text:"#da208f",background:"#ad1a72"}}},borderRadius:ee.borderRadius,fontFamily:ee.fontFamily},Te={FormattingToolbar:{Root:xe,Button:Ee,Select:Cr},ImagePanel:{Root:dr,Button:vr,FileInput:br,TabPanel:mr,TextInput:pr},LinkToolbar:{Root:xe,Button:Ee},SideMenu:{Root:xr,Button:Er},SuggestionMenu:{Root:Tr,Item:jr,EmptyItem:kr,Label:wr,Loader:Sr},TableHandle:{Root:Rr},Generic:{Form:{Root:r=>l.jsx("div",{children:r.children}),TextInput:er},Menu:{Root:sr,Trigger:lr,Dropdown:ur,Divider:cr,Label:fr,Item:ir},Popover:{Root:gr,Trigger:hr,Content:yr}}},Or={activeClassName:""},Fr=r=>{const{theme:t,...a}=r,o=J.useBlockNoteContext(),s=Je.default(),c=(o==null?void 0:o.colorSchemePreference)||s,d=g.useCallback(u=>{if(u&&(be(u),typeof t=="object")){if("light"in t&&"dark"in t){Q(t[c==="dark"?"dark":"light"],u);return}Q(t,u);return}},[c,t]);return l.jsx(J.ComponentsContext.Provider,{value:Te,children:l.jsx(ue.MantineProvider,{theme:Or,cssVariablesSelector:".bn-container",children:l.jsx(J.BlockNoteViewRaw,{theme:typeof t=="object"?void 0:t,...a,ref:d})})})};S.BlockNoteView=Fr,S.applyBlockNoteCSSVariablesFromTheme=Q,S.components=Te,S.darkDefaultTheme=Pr,S.defaultColorScheme=y,S.lightDefaultTheme=ee,S.removeBlockNoteCSSVariables=be,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
27
+ Check the top-level render call using <`+i+">.")}return n}}function Ye(e,n){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var i=it(n);if(We[i])return;We[i]=!0;var v="";e&&e._owner&&e._owner!==se.current&&(v=" It was passed a child from "+M(e._owner.type)+"."),A(e),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,v),A(null)}}function Ue(e,n){{if(typeof e!="object")return;if(ae(e))for(var i=0;i<e.length;i++){var v=e[i];le(v)&&Ye(v,n)}else if(le(e))e._store&&(e._store.validated=!0);else if(e){var x=Nr(e);if(typeof x=="function"&&x!==e.entries)for(var k=x.call(e),h;!(h=k.next()).done;)le(h.value)&&Ye(h.value,n)}}}function lt(e){{var n=e.type;if(n==null||typeof n=="string")return;var i;if(typeof n=="function")i=n.propTypes;else if(typeof n=="object"&&(n.$$typeof===b||n.$$typeof===R))i=n.propTypes;else return;if(i){var v=M(n);Hr(i,e.props,"prop",v,e)}else if(n.PropTypes!==void 0&&!ie){ie=!0;var x=M(n);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",x||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ut(e){{for(var n=Object.keys(e.props),i=0;i<n.length;i++){var v=n[i];if(v!=="children"&&v!=="key"){A(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),A(null);break}}e.ref!==null&&(A(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}function Ge(e,n,i,v,x,k){{var h=$r(e);if(!h){var p="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(p+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var C=st(x);C?p+=C:p+=Ve();var j;e===null?j="null":ae(e)?j="array":e!==void 0&&e.$$typeof===t?(j="<"+(M(e.type)||"Unknown")+" />",p=" Did you accidentally export a JSX literal instead of a component?"):j=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",j,p)}var w=ot(e,n,i,x,k);if(w==null)return w;if(h){var O=n.children;if(O!==void 0)if(v)if(ae(O)){for(var z=0;z<O.length;z++)Ue(O[z],e);Object.freeze&&Object.freeze(O)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ue(O,e)}return e===o?ut(w):lt(w),w}}function ct(e,n,i){return Ge(e,n,i,!0)}function ft(e,n,i){return Ge(e,n,i,!1)}var dt=ft,vt=ct;$.Fragment=o,$.jsx=dt,$.jsxs=vt}()),$}process.env.NODE_ENV==="production"?Z.exports=Xe():Z.exports=Ze();var l=Z.exports;const ve=(r,t,a=!1)=>{const o=[];function s(c,d="--bn"){for(const u in c){const b=u.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),m=`${d}-${b}`;typeof c[u]!="object"?(typeof c[u]=="number"&&(c[u]=`${c[u]}px`),a?t.style.removeProperty(m):t.style.setProperty(m,c[u].toString())):s(c[u],m)}}return s(r),o},Q=(r,t)=>ve(r,t),Qe={colors:{editor:{text:void 0,background:void 0},menu:{text:void 0,background:void 0},tooltip:{text:void 0,background:void 0},hovered:{text:void 0,background:void 0},selected:{text:void 0,background:void 0},disabled:{text:void 0,background:void 0},shadow:void 0,border:void 0,sideMenu:void 0,highlights:{gray:{text:void 0,background:void 0},brown:{text:void 0,background:void 0},red:{text:void 0,background:void 0},orange:{text:void 0,background:void 0},yellow:{text:void 0,background:void 0},green:{text:void 0,background:void 0},blue:{text:void 0,background:void 0},purple:{text:void 0,background:void 0},pink:{text:void 0,background:void 0}}},borderRadius:void 0,fontFamily:void 0},be=r=>ve(Qe,r,!0),er=g.forwardRef((r,t)=>{const{className:a,name:o,label:s,icon:c,value:d,autoFocus:u,placeholder:b,onKeyDown:m,onChange:T,onSubmit:R,...P}=r;return E.assertEmpty(P),l.jsx(f.TextInput,{size:"xs",className:a,ref:t,name:o,label:s,leftSection:c,value:d,autoFocus:u,"data-autofocus":u?"true":void 0,placeholder:b,onKeyDown:m,onChange:T,onSubmit:R})});var me={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},pe=F.default.createContext&&F.default.createContext(me),D=globalThis&&globalThis.__assign||function(){return D=Object.assign||function(r){for(var t,a=1,o=arguments.length;a<o;a++){t=arguments[a];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=t[s])}return r},D.apply(this,arguments)},rr=globalThis&&globalThis.__rest||function(r,t){var a={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&t.indexOf(o)<0&&(a[o]=r[o]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(r);s<o.length;s++)t.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(r,o[s])&&(a[o[s]]=r[o[s]]);return a};function ge(r){return r&&r.map(function(t,a){return F.default.createElement(t.tag,D({key:a},t.attr),ge(t.child))})}function he(r){return function(t){return F.default.createElement(tr,D({attr:D({},r.attr)},t),ge(r.child))}}function tr(r){var t=function(a){var o=r.attr,s=r.size,c=r.title,d=rr(r,["attr","size","title"]),u=s||a.size||"1em",b;return a.className&&(b=a.className),r.className&&(b=(b?b+" ":"")+r.className),F.default.createElement("svg",D({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,o,d,{className:b,style:D(D({color:r.color||a.color},a.style),r.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),c&&F.default.createElement("title",null,c),r.children)};return pe!==void 0?F.default.createElement(pe.Consumer,null,function(a){return t(a)}):t(me)}function nr(r){return he({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z",clipRule:"evenodd"}}]})(r)}function ar(r){return he({tag:"svg",attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"}}]})(r)}const ye=g.createContext(void 0),or=g.forwardRef((r,t)=>{const{children:a,onOpenChange:o,position:s,sub:c,...d}=r;E.assertEmpty(d);const[u,b]=g.useState(!1),m=g.useRef(),T=g.useCallback(()=>{m.current&&clearTimeout(m.current),m.current=setTimeout(()=>{b(!1)},250)},[]),R=g.useCallback(()=>{m.current&&clearTimeout(m.current),b(!0)},[]);return l.jsx(ye.Provider,{value:{onMenuMouseOver:R,onMenuMouseLeave:T},children:l.jsx(f.Menu.Item,{className:"bn-menu-item bn-mt-sub-menu-item",ref:t,onMouseOver:R,onMouseLeave:T,children:l.jsx(f.Menu,{withinPortal:!1,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},trigger:"hover",opened:u,onClose:()=>o==null?void 0:o(!1),onOpen:()=>o==null?void 0:o(!0),position:s,children:a})})})}),sr=r=>{const{children:t,onOpenChange:a,position:o,sub:s,...c}=r;return E.assertEmpty(c),s?l.jsx(or,{...r}):l.jsx(f.Menu,{withinPortal:!1,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},onClose:()=>a==null?void 0:a(!1),onOpen:()=>a==null?void 0:a(!0),position:o,children:t})},ir=g.forwardRef((r,t)=>{const{className:a,children:o,icon:s,checked:c,subTrigger:d,onClick:u,...b}=r;return E.assertEmpty(b,!1),d?l.jsxs("div",{ref:t,...b,children:[o,l.jsx(ar,{size:15})]}):l.jsx(f.Menu.Item,{className:a,ref:t,leftSection:s,rightSection:c?l.jsx(f.CheckIcon,{size:10}):c===!1?l.jsx("div",{className:"bn-tick-space"}):null,onClick:u,...b,children:o})}),lr=r=>{const{children:t,sub:a,...o}=r;return E.assertEmpty(o),l.jsx(f.Menu.Target,{children:t})},ur=g.forwardRef((r,t)=>{const{className:a,children:o,sub:s,...c}=r;E.assertEmpty(c);const d=g.useContext(ye);return l.jsx(f.Menu.Dropdown,{className:a,ref:t,onMouseOver:d==null?void 0:d.onMenuMouseOver,onMouseLeave:d==null?void 0:d.onMenuMouseLeave,children:o})}),cr=g.forwardRef((r,t)=>{const{className:a,...o}=r;return E.assertEmpty(o),l.jsx(f.Menu.Divider,{className:a,ref:t})}),fr=g.forwardRef((r,t)=>{const{className:a,children:o,...s}=r;return E.assertEmpty(s),l.jsx(f.Menu.Label,{className:a,ref:t,children:o})}),dr=g.forwardRef((r,t)=>{const{className:a,tabs:o,defaultOpenTab:s,openTab:c,setOpenTab:d,loading:u,...b}=r;return E.assertEmpty(b),l.jsx(f.Group,{className:a,ref:t,children:l.jsxs(f.Tabs,{value:c,defaultValue:s,onChange:d,children:[u&&l.jsx(f.LoadingOverlay,{visible:u}),l.jsx(f.Tabs.List,{children:o.map(m=>l.jsx(f.Tabs.Tab,{"data-test":`${m.name.toLowerCase()}-tab`,value:m.name,children:m.name},m.name))}),o.map(m=>l.jsx(f.Tabs.Panel,{value:m.name,children:m.tabPanel},m.name))]})})}),vr=g.forwardRef((r,t)=>{const{className:a,children:o,onClick:s,label:c,...d}=r;return E.assertEmpty(d),l.jsx(f.Button,{size:"xs","aria-label":c,className:a,ref:t,onClick:s,...d,children:o})}),br=g.forwardRef((r,t)=>{const{className:a,value:o,placeholder:s,onChange:c,...d}=r;return E.assertEmpty(d),l.jsx(f.FileInput,{size:"xs",className:a,ref:t,value:o,placeholder:s,onChange:c,...d})}),mr=g.forwardRef((r,t)=>{const{className:a,children:o,...s}=r;return E.assertEmpty(s),l.jsx("div",{className:a,ref:t,children:o})}),pr=g.forwardRef((r,t)=>{const{className:a,value:o,placeholder:s,onKeyDown:c,onChange:d,...u}=r;return E.assertEmpty(u),l.jsx(f.TextInput,{size:"xs","data-test":"embed-input",className:a,ref:t,value:o,placeholder:s,onKeyDown:c,onChange:d})}),gr=r=>{const{children:t,opened:a,position:o,...s}=r;return E.assertEmpty(s),l.jsx(f.Popover,{withinPortal:!1,zIndex:1e4,opened:a,position:o,children:t})},hr=r=>{const{children:t,...a}=r;return E.assertEmpty(a),l.jsx(f.PopoverTarget,{children:t})},yr=g.forwardRef((r,t)=>{const{className:a,children:o,variant:s,...c}=r;return E.assertEmpty(c),l.jsx(f.PopoverDropdown,{className:a,ref:t,children:o})}),xr=g.forwardRef((r,t)=>{const{className:a,children:o,...s}=r;return E.assertEmpty(s),l.jsx(f.Group,{align:"center",gap:0,className:a,ref:t,children:o})}),Er=g.forwardRef((r,t)=>{const{className:a,children:o,icon:s,onClick:c,onDragEnd:d,onDragStart:u,draggable:b,label:m,...T}=r;return E.assertEmpty(T,!1),s?l.jsx(f.ActionIcon,{size:24,className:a,ref:t,onClick:c,onDragEnd:d,onDragStart:u,draggable:b,"aria-label":m,...T,children:s}):l.jsx(f.Button,{className:a,ref:t,onClick:c,onDragEnd:d,onDragStart:u,draggable:b,"aria-label":m,...T,children:o})}),Tr=g.forwardRef((r,t)=>{const{className:a,children:o,id:s,...c}=r;return E.assertEmpty(c),l.jsx(f.Stack,{gap:0,className:a,ref:t,id:s,role:"listbox",children:o})}),kr=g.forwardRef((r,t)=>{const{className:a,children:o,...s}=r;return E.assertEmpty(s),l.jsx(f.Group,{className:a,ref:t,children:l.jsx(f.Group,{className:"bn-mt-suggestion-menu-item-label",children:o})})}),jr=g.forwardRef((r,t)=>{const{className:a,isSelected:o,onClick:s,item:c,id:d,...u}=r;return E.assertEmpty(u),l.jsxs(f.Group,{gap:0,className:a,ref:t,id:d,role:"option",onClick:s,"aria-selected":o||void 0,children:[c.icon&&l.jsx(f.Group,{className:"bn-mt-suggestion-menu-item-section","data-position":"left",children:c.icon}),l.jsxs(f.Stack,{gap:0,className:"bn-mt-suggestion-menu-item-body",children:[l.jsx(f.Text,{className:"bn-mt-suggestion-menu-item-title",children:c.title}),l.jsx(f.Text,{className:"bn-mt-suggestion-menu-item-subtitle",children:c.subtext})]}),c.badge&&l.jsx(f.Group,{"data-position":"right",className:"bn-mt-suggestion-menu-item-section",children:l.jsx(f.Badge,{size:"xs",children:c.badge})})]})}),wr=g.forwardRef((r,t)=>{const{className:a,children:o,...s}=r;return E.assertEmpty(s),l.jsx(f.Group,{className:a,ref:t,children:o})}),Sr=g.forwardRef((r,t)=>{const{className:a,children:o,...s}=r;return E.assertEmpty(s),l.jsx(f.Loader,{className:a,type:"dots",ref:t})}),Rr=g.forwardRef((r,t)=>{const{className:a,children:o,draggable:s,onDragStart:c,onDragEnd:d,style:u,label:b,...m}=r;return E.assertEmpty(m,!1),l.jsx("button",{className:a,ref:t,"aria-label":b,draggable:s,onDragStart:c,onDragEnd:d,style:u,...m,children:o})}),xe=g.forwardRef((r,t)=>{const{className:a,children:o,onMouseEnter:s,onMouseLeave:c,...d}=r;E.assertEmpty(d);const{ref:u,focused:b}=X.useFocusWithin(),m=X.useFocusTrap(b),T=X.mergeRefs(t,u,m);return l.jsx(f.Group,{className:a,ref:T,role:"toolbar",onMouseEnter:s,onMouseLeave:c,children:o})}),_r=r=>l.jsxs(f.Stack,{gap:0,className:"bn-tooltip",children:[l.jsx(f.Text,{size:"sm",children:r.mainTooltip}),r.secondaryTooltip&&l.jsx(f.Text,{size:"xs",children:r.secondaryTooltip})]}),Ee=g.forwardRef((r,t)=>{const{className:a,children:o,mainTooltip:s,secondaryTooltip:c,icon:d,isSelected:u,isDisabled:b,onClick:m,label:T,...R}=r;return E.assertEmpty(R,!1),l.jsx(f.Tooltip,{withinPortal:!1,label:l.jsx(_r,{mainTooltip:s,secondaryTooltip:c}),children:o?l.jsx(f.Button,{"aria-label":T,className:a,onMouseDown:P=>{E.isSafari()&&P.currentTarget.focus()},onClick:m,"aria-pressed":u,"data-selected":u||void 0,"data-test":s.slice(0,1).toLowerCase()+s.replace(/\s+/g,"").slice(1),size:"xs",disabled:b||!1,ref:t,...R,children:o}):l.jsx(f.ActionIcon,{className:a,"aria-label":T,onMouseDown:P=>{E.isSafari()&&P.currentTarget.focus()},onClick:m,"aria-pressed":u,"data-selected":u||void 0,"data-test":s.slice(0,1).toLowerCase()+s.replace(/\s+/g,"").slice(1),size:30,disabled:b||!1,ref:t,...R,children:d})})}),Cr=g.forwardRef((r,t)=>{const{className:a,items:o,isDisabled:s,...c}=r;E.assertEmpty(c);const d=o.filter(u=>u.isSelected)[0];return d?l.jsxs(f.Menu,{withinPortal:!1,transitionProps:{exitDuration:0},disabled:s,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},children:[l.jsx(f.Menu.Target,{children:l.jsx(f.Button,{onMouseDown:u=>{E.isSafari()&&u.currentTarget.focus()},leftSection:d.icon,rightSection:l.jsx(nr,{}),size:"xs",variant:"subtle",disabled:s,children:d.text})}),l.jsx(f.Menu.Dropdown,{className:a,ref:t,children:o.map(u=>l.jsx(f.Menu.Item,{onClick:u.onClick,leftSection:u.icon,rightSection:u.isSelected?l.jsx(f.CheckIcon,{size:10,className:"bn-tick-icon"}):l.jsx("div",{className:"bn-tick-space"}),disabled:u.isDisabled,children:u.text},u.text))})]}):null}),bt="",y=["#FFFFFF","#EFEFEF","#CFCFCF","#AFAFAF","#7F7F7F","#3F3F3F","#1F1F1F","#161616","#0F0F0F","#000000"],ee={colors:{editor:{text:y[5],background:y[0]},menu:{text:y[5],background:y[0]},tooltip:{text:y[5],background:y[1]},hovered:{text:y[5],background:y[1]},selected:{text:y[0],background:y[5]},disabled:{text:y[3],background:y[1]},shadow:y[2],border:y[1],sideMenu:y[2],highlights:{gray:{text:"#9b9a97",background:"#ebeced"},brown:{text:"#64473a",background:"#e9e5e3"},red:{text:"#e03e3e",background:"#fbe4e4"},orange:{text:"#d9730d",background:"#f6e9d9"},yellow:{text:"#dfab01",background:"#fbf3db"},green:{text:"#4d6461",background:"#ddedea"},blue:{text:"#0b6e99",background:"#ddebf1"},purple:{text:"#6940a5",background:"#eae4f2"},pink:{text:"#ad1a72",background:"#f4dfeb"}}},borderRadius:6,fontFamily:'"Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Open Sans", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif'},Pr={colors:{editor:{text:y[2],background:y[6]},menu:{text:y[2],background:y[6]},tooltip:{text:y[2],background:y[7]},hovered:{text:y[2],background:y[7]},selected:{text:y[2],background:y[8]},disabled:{text:y[5],background:y[7]},shadow:y[8],border:y[7],sideMenu:y[4],highlights:{gray:{text:"#bebdb8",background:"#9b9a97"},brown:{text:"#8e6552",background:"#64473a"},red:{text:"#ec4040",background:"#be3434"},orange:{text:"#e3790d",background:"#b7600a"},yellow:{text:"#dfab01",background:"#b58b00"},green:{text:"#6b8b87",background:"#4d6461"},blue:{text:"#0e87bc",background:"#0b6e99"},purple:{text:"#8552d7",background:"#6940a5"},pink:{text:"#da208f",background:"#ad1a72"}}},borderRadius:ee.borderRadius,fontFamily:ee.fontFamily},Te={FormattingToolbar:{Root:xe,Button:Ee,Select:Cr},ImagePanel:{Root:dr,Button:vr,FileInput:br,TabPanel:mr,TextInput:pr},LinkToolbar:{Root:xe,Button:Ee},SideMenu:{Root:xr,Button:Er},SuggestionMenu:{Root:Tr,Item:jr,EmptyItem:kr,Label:wr,Loader:Sr},TableHandle:{Root:Rr},Generic:{Form:{Root:r=>l.jsx("div",{children:r.children}),TextInput:er},Menu:{Root:sr,Trigger:lr,Dropdown:ur,Divider:cr,Label:fr,Item:ir},Popover:{Root:gr,Trigger:hr,Content:yr}}},Or={activeClassName:""},Fr=r=>{const{theme:t,...a}=r,o=J.useBlockNoteContext(),s=Je.default(),c=(o==null?void 0:o.colorSchemePreference)||s,d=g.useCallback(u=>{if(u&&(be(u),typeof t=="object")){if("light"in t&&"dark"in t){Q(t[c==="dark"?"dark":"light"],u);return}Q(t,u);return}},[c,t]);return l.jsx(J.ComponentsContext.Provider,{value:Te,children:l.jsx(ue.MantineProvider,{theme:Or,cssVariablesSelector:".bn-container",children:l.jsx(J.BlockNoteViewRaw,{theme:typeof t=="object"?void 0:t,...a,ref:d})})})};S.BlockNoteView=Fr,S.applyBlockNoteCSSVariablesFromTheme=Q,S.components=Te,S.darkDefaultTheme=Pr,S.defaultColorScheme=y,S.lightDefaultTheme=ee,S.removeBlockNoteCSSVariables=be,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
28
28
  //# sourceMappingURL=blocknote-mantine.umd.cjs.map