@blocknote/mantine 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/LICENSE +373 -0
  2. package/dist/blocknote-mantine.js +1532 -0
  3. package/dist/blocknote-mantine.js.map +1 -0
  4. package/dist/blocknote-mantine.umd.cjs +28 -0
  5. package/dist/blocknote-mantine.umd.cjs.map +1 -0
  6. package/dist/style.css +1 -0
  7. package/dist/webpack-stats.json +1 -0
  8. package/package.json +88 -0
  9. package/src/BlockNoteTheme.ts +153 -0
  10. package/src/defaultThemes.ts +159 -0
  11. package/src/form/TextInput.tsx +44 -0
  12. package/src/index.tsx +172 -0
  13. package/src/mantineStyles.css +138 -0
  14. package/src/menu/Menu.tsx +252 -0
  15. package/src/panel/Panel.tsx +50 -0
  16. package/src/panel/PanelButton.tsx +26 -0
  17. package/src/panel/PanelFileInput.tsx +26 -0
  18. package/src/panel/PanelTab.tsx +18 -0
  19. package/src/panel/PanelTextInput.tsx +27 -0
  20. package/src/popover/Popover.tsx +53 -0
  21. package/src/sideMenu/SideMenu.tsx +20 -0
  22. package/src/sideMenu/SideMenuButton.tsx +57 -0
  23. package/src/style.css +490 -0
  24. package/src/suggestionMenu/SuggestionMenu.tsx +25 -0
  25. package/src/suggestionMenu/SuggestionMenuEmptyItem.tsx +22 -0
  26. package/src/suggestionMenu/SuggestionMenuItem.tsx +47 -0
  27. package/src/suggestionMenu/SuggestionMenuLabel.tsx +20 -0
  28. package/src/suggestionMenu/SuggestionMenuLoader.tsx +20 -0
  29. package/src/tableHandle/TableHandle.tsx +37 -0
  30. package/src/toolbar/Toolbar.tsx +36 -0
  31. package/src/toolbar/ToolbarButton.tsx +106 -0
  32. package/src/toolbar/ToolbarSelect.tsx +69 -0
  33. package/types/src/BlockNoteTheme.d.ts +33 -0
  34. package/types/src/defaultThemes.d.ts +143 -0
  35. package/types/src/form/TextInput.d.ts +13 -0
  36. package/types/src/index.d.ts +14 -0
  37. package/types/src/menu/Menu.d.ts +24 -0
  38. package/types/src/panel/Panel.d.ts +12 -0
  39. package/types/src/panel/PanelButton.d.ts +11 -0
  40. package/types/src/panel/PanelFileInput.d.ts +7 -0
  41. package/types/src/panel/PanelTab.d.ts +5 -0
  42. package/types/src/panel/PanelTextInput.d.ts +8 -0
  43. package/types/src/popover/Popover.d.ts +9 -0
  44. package/types/src/sideMenu/SideMenu.d.ts +5 -0
  45. package/types/src/sideMenu/SideMenuButton.d.ts +15 -0
  46. package/types/src/suggestionMenu/SuggestionMenu.d.ts +6 -0
  47. package/types/src/suggestionMenu/SuggestionMenuEmptyItem.d.ts +5 -0
  48. package/types/src/suggestionMenu/SuggestionMenuItem.d.ts +8 -0
  49. package/types/src/suggestionMenu/SuggestionMenuLabel.d.ts +5 -0
  50. package/types/src/suggestionMenu/SuggestionMenuLoader.d.ts +5 -0
  51. package/types/src/tableHandle/TableHandle.d.ts +14 -0
  52. package/types/src/toolbar/Toolbar.d.ts +10 -0
  53. package/types/src/toolbar/ToolbarButton.d.ts +12 -0
  54. package/types/src/toolbar/ToolbarSelect.d.ts +12 -0
@@ -0,0 +1,28 @@
1
+ (function(S,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("@blocknote/react"),require("@mantine/core"),require("use-prefers-color-scheme"),require("@blocknote/core"),require("@mantine/hooks")):typeof define=="function"&&define.amd?define(["exports","react","@blocknote/react","@mantine/core","use-prefers-color-scheme","@blocknote/core","@mantine/hooks"],g):(S=typeof globalThis<"u"?globalThis:S||self,g(S["blocknote-mantine"]={},S.React,S.react,S.Mantine,S.usePrefersColorScheme,S.core,S.hooks))})(this,function(S,g,J,ue,He,E,X){"use strict";const ce=r=>r&&typeof r=="object"&&"default"in r?r:{default:r};function Ke(r){if(r&&typeof r=="object"&&"default"in r)return r;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const a in r)if(a!=="default"){const o=Object.getOwnPropertyDescriptor(r,a);Object.defineProperty(t,a,o.get?o:{enumerable:!0,get:()=>r[a]})}}return t.default=r,Object.freeze(t)}const F=ce(g),f=Ke(ue),Je=ce(He);var Z={exports:{}},B={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var fe;function Xe(){if(fe)return B;fe=1;var r=F.default,t=Symbol.for("react.element"),a=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function d(u,b,m){var T,R={},P=null,Y=null;m!==void 0&&(P=""+m),b.key!==void 0&&(P=""+b.key),b.ref!==void 0&&(Y=b.ref);for(T in b)o.call(b,T)&&!c.hasOwnProperty(T)&&(R[T]=b[T]);if(u&&u.defaultProps)for(T in b=u.defaultProps,b)R[T]===void 0&&(R[T]=b[T]);return{$$typeof:t,type:u,key:P,ref:Y,props:R,_owner:s.current}}return B.Fragment=a,B.jsx=d,B.jsxs=d,B}var $={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var de;function Ze(){return de||(de=1,process.env.NODE_ENV!=="production"&&function(){var r=F.default,t=Symbol.for("react.element"),a=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),u=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),ke=Symbol.iterator,Mr="@@iterator";function Nr(e){if(e===null||typeof e!="object")return null;var n=ke&&e[ke]||e[Mr];return typeof n=="function"?n:null}var L=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(e){{for(var n=arguments.length,i=new Array(n>1?n-1:0),v=1;v<n;v++)i[v-1]=arguments[v];Dr("error",e,i)}}function Dr(e,n,i){{var v=L.ReactDebugCurrentFrame,x=v.getStackAddendum();x!==""&&(n+="%s",i=i.concat([x]));var k=i.map(function(h){return String(h)});k.unshift("Warning: "+n),Function.prototype.apply.call(console[e],console,k)}}var Ir=!1,Lr=!1,Ar=!1,zr=!1,Br=!1,je;je=Symbol.for("react.module.reference");function $r(e){return!!(typeof e=="string"||typeof e=="function"||e===o||e===c||Br||e===s||e===m||e===T||zr||e===Y||Ir||Lr||Ar||typeof e=="object"&&e!==null&&(e.$$typeof===P||e.$$typeof===R||e.$$typeof===d||e.$$typeof===u||e.$$typeof===b||e.$$typeof===je||e.getModuleId!==void 0))}function Vr(e,n,i){var v=e.displayName;if(v)return v;var x=n.displayName||n.name||"";return x!==""?i+"("+x+")":i}function we(e){return e.displayName||"Context"}function M(e){if(e==null)return null;if(typeof e.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case o:return"Fragment";case a:return"Portal";case c:return"Profiler";case s:return"StrictMode";case m:return"Suspense";case T:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case u:var n=e;return we(n)+".Consumer";case d:var i=e;return we(i._context)+".Provider";case b:return Vr(e,e.render,"ForwardRef");case R:var v=e.displayName||null;return v!==null?v:M(e.type)||"Memo";case P:{var x=e,k=x._payload,h=x._init;try{return M(h(k))}catch{return null}}}return null}var I=Object.assign,V=0,Se,Re,_e,Ce,Pe,Oe,Fe;function Me(){}Me.__reactDisabledLog=!0;function Wr(){{if(V===0){Se=console.log,Re=console.info,_e=console.warn,Ce=console.error,Pe=console.group,Oe=console.groupCollapsed,Fe=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Me,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}V++}}function Yr(){{if(V--,V===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:Se}),info:I({},e,{value:Re}),warn:I({},e,{value:_e}),error:I({},e,{value:Ce}),group:I({},e,{value:Pe}),groupCollapsed:I({},e,{value:Oe}),groupEnd:I({},e,{value:Fe})})}V<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=L.ReactCurrentDispatcher,te;function U(e,n,i){{if(te===void 0)try{throw Error()}catch(x){var v=x.stack.trim().match(/\n( *(at )?)/);te=v&&v[1]||""}return`
18
+ `+te+e}}var ne=!1,G;{var Ur=typeof WeakMap=="function"?WeakMap:Map;G=new Ur}function Ne(e,n){if(!e||ne)return"";{var i=G.get(e);if(i!==void 0)return i}var v;ne=!0;var x=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var k;k=re.current,re.current=null,Wr();try{if(n){var h=function(){throw Error()};if(Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(N){v=N}Reflect.construct(e,[],h)}else{try{h.call()}catch(N){v=N}e.call(h.prototype)}}else{try{throw Error()}catch(N){v=N}e()}}catch(N){if(N&&v&&typeof N.stack=="string"){for(var p=N.stack.split(`
19
+ `),C=v.stack.split(`
20
+ `),j=p.length-1,w=C.length-1;j>=1&&w>=0&&p[j]!==C[w];)w--;for(;j>=1&&w>=0;j--,w--)if(p[j]!==C[w]){if(j!==1||w!==1)do if(j--,w--,w<0||p[j]!==C[w]){var O=`
21
+ `+p[j].replace(" at new "," at ");return e.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",e.displayName)),typeof e=="function"&&G.set(e,O),O}while(j>=1&&w>=0);break}}}finally{ne=!1,re.current=k,Yr(),Error.prepareStackTrace=x}var z=e?e.displayName||e.name:"",qe=z?U(z):"";return typeof e=="function"&&G.set(e,qe),qe}function Gr(e,n,i){return Ne(e,!1)}function qr(e){var n=e.prototype;return!!(n&&n.isReactComponent)}function q(e,n,i){if(e==null)return"";if(typeof e=="function")return Ne(e,qr(e));if(typeof e=="string")return U(e);switch(e){case m:return U("Suspense");case T:return U("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case b:return Gr(e.render);case R:return q(e.type,n,i);case P:{var v=e,x=v._payload,k=v._init;try{return q(k(x),n,i)}catch{}}}return""}var H=Object.prototype.hasOwnProperty,De={},Ie=L.ReactDebugCurrentFrame;function K(e){if(e){var n=e._owner,i=q(e.type,e._source,n?n.type:null);Ie.setExtraStackFrame(i)}else Ie.setExtraStackFrame(null)}function Hr(e,n,i,v,x){{var k=Function.call.bind(H);for(var h in e)if(k(e,h)){var p=void 0;try{if(typeof e[h]!="function"){var C=Error((v||"React class")+": "+i+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw C.name="Invariant Violation",C}p=e[h](n,h,v,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(j){p=j}p&&!(p instanceof Error)&&(K(x),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",v||"React class",i,h,typeof p),K(null)),p instanceof Error&&!(p.message in De)&&(De[p.message]=!0,K(x),_("Failed %s type: %s",i,p.message),K(null))}}}var Kr=Array.isArray;function ae(e){return Kr(e)}function Jr(e){{var n=typeof Symbol=="function"&&Symbol.toStringTag,i=n&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function Xr(e){try{return Le(e),!1}catch{return!0}}function Le(e){return""+e}function Ae(e){if(Xr(e))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Jr(e)),Le(e)}var W=L.ReactCurrentOwner,Zr={key:!0,ref:!0,__self:!0,__source:!0},ze,Be,oe;oe={};function Qr(e){if(H.call(e,"ref")){var n=Object.getOwnPropertyDescriptor(e,"ref").get;if(n&&n.isReactWarning)return!1}return e.ref!==void 0}function et(e){if(H.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function rt(e,n){if(typeof e.ref=="string"&&W.current&&n&&W.current.stateNode!==n){var i=M(W.current.type);oe[i]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',M(W.current.type),e.ref),oe[i]=!0)}}function tt(e,n){{var i=function(){ze||(ze=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}}function nt(e,n){{var i=function(){Be||(Be=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};i.isReactWarning=!0,Object.defineProperty(e,"ref",{get:i,configurable:!0})}}var at=function(e,n,i,v,x,k,h){var p={$$typeof:t,type:e,key:n,ref:i,props:h,_owner:k};return p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(p,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(p,"_source",{configurable:!1,enumerable:!1,writable:!1,value:x}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p};function ot(e,n,i,v,x){{var k,h={},p=null,C=null;i!==void 0&&(Ae(i),p=""+i),et(n)&&(Ae(n.key),p=""+n.key),Qr(n)&&(C=n.ref,rt(n,x));for(k in n)H.call(n,k)&&!Zr.hasOwnProperty(k)&&(h[k]=n[k]);if(e&&e.defaultProps){var j=e.defaultProps;for(k in j)h[k]===void 0&&(h[k]=j[k])}if(p||C){var w=typeof e=="function"?e.displayName||e.name||"Unknown":e;p&&tt(h,w),C&&nt(h,w)}return at(e,p,C,x,v,W.current,h)}}var se=L.ReactCurrentOwner,$e=L.ReactDebugCurrentFrame;function A(e){if(e){var n=e._owner,i=q(e.type,e._source,n?n.type:null);$e.setExtraStackFrame(i)}else $e.setExtraStackFrame(null)}var ie;ie=!1;function le(e){return typeof e=="object"&&e!==null&&e.$$typeof===t}function Ve(){{if(se.current){var e=M(se.current.type);if(e)return`
22
+
23
+ Check the render method of \``+e+"`."}return""}}function st(e){{if(e!==void 0){var n=e.fileName.replace(/^.*[\\\/]/,""),i=e.lineNumber;return`
24
+
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
+
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"})});
28
+ //# sourceMappingURL=blocknote-mantine.umd.cjs.map