@blocknote/mantine 0.14.2 → 0.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blocknote-mantine.js +1 -1
- package/dist/blocknote-mantine.js.map +1 -1
- package/dist/blocknote-mantine.umd.cjs +9 -9
- package/dist/blocknote-mantine.umd.cjs.map +1 -1
- package/dist/style.css +1 -1
- package/dist/webpack-stats.json +1 -1
- package/package.json +4 -4
- package/src/index.tsx +1 -1
- package/src/style.css +23 -20
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(S,
|
|
1
|
+
(function(S,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("@blocknote/core"),require("@blocknote/react"),require("@mantine/core"),require("use-prefers-color-scheme"),require("@mantine/hooks")):typeof define=="function"&&define.amd?define(["exports","react","@blocknote/core","@blocknote/react","@mantine/core","use-prefers-color-scheme","@mantine/hooks"],m):(S=typeof globalThis<"u"?globalThis:S||self,m(S["blocknote-mantine"]={},S.React,S.core,S.react,S.core$1,S.usePrefersColorScheme,S.hooks))})(this,function(S,m,y,q,d,Xe,z){"use strict";const M=(t=>t&&typeof t=="object"&&"default"in t?t:{default:t})(m);var ee={exports:{}},V={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var de;function Ze(){if(de)return V;de=1;var t=M.default,n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function v(c,f,p){var j,R={},C=null,J=null;p!==void 0&&(C=""+p),f.key!==void 0&&(C=""+f.key),f.ref!==void 0&&(J=f.ref);for(j in f)a.call(f,j)&&!u.hasOwnProperty(j)&&(R[j]=f[j]);if(c&&c.defaultProps)for(j in f=c.defaultProps,f)R[j]===void 0&&(R[j]=f[j]);return{$$typeof:n,type:c,key:C,ref:J,props:R,_owner:s.current}}return V.Fragment=r,V.jsx=v,V.jsxs=v,V}var W={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,20 +14,20 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+ae+e}}var oe=!1,Z;{var
|
|
17
|
+
*/var ve;function Qe(){return ve||(ve=1,process.env.NODE_ENV!=="production"&&function(){var t=M.default,n=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),ke=Symbol.iterator,At="@@iterator";function Bt(e){if(e===null||typeof e!="object")return null;var o=ke&&e[ke]||e[At];return typeof o=="function"?o:null}var L=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(e){{for(var o=arguments.length,i=new Array(o>1?o-1:0),b=1;b<o;b++)i[b-1]=arguments[b];zt("error",e,i)}}function zt(e,o,i){{var b=L.ReactDebugCurrentFrame,E=b.getStackAddendum();E!==""&&(o+="%s",i=i.concat([E]));var w=i.map(function(h){return String(h)});w.unshift("Warning: "+o),Function.prototype.apply.call(console[e],console,w)}}var Vt=!1,Wt=!1,Yt=!1,Ut=!1,Gt=!1,Se;Se=Symbol.for("react.module.reference");function qt(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===u||Gt||e===s||e===p||e===j||Ut||e===J||Vt||Wt||Yt||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===R||e.$$typeof===v||e.$$typeof===c||e.$$typeof===f||e.$$typeof===Se||e.getModuleId!==void 0))}function Kt(e,o,i){var b=e.displayName;if(b)return b;var E=o.displayName||o.name||"";return E!==""?i+"("+E+")":i}function Re(e){return e.displayName||"Context"}function D(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 a:return"Fragment";case r:return"Portal";case u:return"Profiler";case s:return"StrictMode";case p:return"Suspense";case j:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case c:var o=e;return Re(o)+".Consumer";case v:var i=e;return Re(i._context)+".Provider";case f:return Kt(e,e.render,"ForwardRef");case R:var b=e.displayName||null;return b!==null?b:D(e.type)||"Memo";case C:{var E=e,w=E._payload,h=E._init;try{return D(h(w))}catch{return null}}}return null}var N=Object.assign,Y=0,Ce,_e,Pe,Oe,Fe,De,Me;function Ne(){}Ne.__reactDisabledLog=!0;function Ht(){{if(Y===0){Ce=console.log,_e=console.info,Pe=console.warn,Oe=console.error,Fe=console.group,De=console.groupCollapsed,Me=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ne,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Y++}}function Jt(){{if(Y--,Y===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:N({},e,{value:Ce}),info:N({},e,{value:_e}),warn:N({},e,{value:Pe}),error:N({},e,{value:Oe}),group:N({},e,{value:Fe}),groupCollapsed:N({},e,{value:De}),groupEnd:N({},e,{value:Me})})}Y<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ne=L.ReactCurrentDispatcher,ae;function X(e,o,i){{if(ae===void 0)try{throw Error()}catch(E){var b=E.stack.trim().match(/\n( *(at )?)/);ae=b&&b[1]||""}return`
|
|
18
|
+
`+ae+e}}var oe=!1,Z;{var Xt=typeof WeakMap=="function"?WeakMap:Map;Z=new Xt}function Ie(e,o){if(!e||oe)return"";{var i=Z.get(e);if(i!==void 0)return i}var b;oe=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var w;w=ne.current,ne.current=null,Ht();try{if(o){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(O){b=O}Reflect.construct(e,[],h)}else{try{h.call()}catch(O){b=O}e.call(h.prototype)}}else{try{throw Error()}catch(O){b=O}e()}}catch(O){if(O&&b&&typeof O.stack=="string"){for(var g=O.stack.split(`
|
|
19
19
|
`),P=b.stack.split(`
|
|
20
20
|
`),T=g.length-1,k=P.length-1;T>=1&&k>=0&&g[T]!==P[k];)k--;for(;T>=1&&k>=0;T--,k--)if(g[T]!==P[k]){if(T!==1||k!==1)do if(T--,k--,k<0||g[T]!==P[k]){var F=`
|
|
21
|
-
`+g[T].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),typeof e=="function"&&Z.set(e,F),F}while(T>=1&&k>=0);break}}}finally{oe=!1,ne.current=w,
|
|
21
|
+
`+g[T].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),typeof e=="function"&&Z.set(e,F),F}while(T>=1&&k>=0);break}}}finally{oe=!1,ne.current=w,Jt(),Error.prepareStackTrace=E}var B=e?e.displayName||e.name:"",I=B?X(B):"";return typeof e=="function"&&Z.set(e,I),I}function Zt(e,o,i){return Ie(e,!1)}function Qt(e){var o=e.prototype;return!!(o&&o.isReactComponent)}function Q(e,o,i){if(e==null)return"";if(typeof e=="function")return Ie(e,Qt(e));if(typeof e=="string")return X(e);switch(e){case p:return X("Suspense");case j:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return Zt(e.render);case R:return Q(e.type,o,i);case C:{var b=e,E=b._payload,w=b._init;try{return Q(w(E),o,i)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,Le={},Ae=L.ReactDebugCurrentFrame;function $(e){if(e){var o=e._owner,i=Q(e.type,e._source,o?o.type:null);Ae.setExtraStackFrame(i)}else Ae.setExtraStackFrame(null)}function $t(e,o,i,b,E){{var w=Function.call.bind(U);for(var h in e)if(w(e,h)){var g=void 0;try{if(typeof e[h]!="function"){var P=Error((b||"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 P.name="Invariant Violation",P}g=e[h](o,h,b,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(T){g=T}g&&!(g instanceof Error)&&($(E),_("%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).",b||"React class",i,h,typeof g),$(null)),g instanceof Error&&!(g.message in Le)&&(Le[g.message]=!0,$(E),_("Failed %s type: %s",i,g.message),$(null))}}}var er=Array.isArray;function se(e){return er(e)}function tr(e){{var o=typeof Symbol=="function"&&Symbol.toStringTag,i=o&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function rr(e){try{return Be(e),!1}catch{return!0}}function Be(e){return""+e}function ze(e){if(rr(e))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",tr(e)),Be(e)}var G=L.ReactCurrentOwner,nr={key:!0,ref:!0,__self:!0,__source:!0},Ve,We,ie;ie={};function ar(e){if(U.call(e,"ref")){var o=Object.getOwnPropertyDescriptor(e,"ref").get;if(o&&o.isReactWarning)return!1}return e.ref!==void 0}function or(e){if(U.call(e,"key")){var o=Object.getOwnPropertyDescriptor(e,"key").get;if(o&&o.isReactWarning)return!1}return e.key!==void 0}function sr(e,o){if(typeof e.ref=="string"&&G.current&&o&&G.current.stateNode!==o){var i=D(G.current.type);ie[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',D(G.current.type),e.ref),ie[i]=!0)}}function ir(e,o){{var i=function(){Ve||(Ve=!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)",o))};i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}}function lr(e,o){{var i=function(){We||(We=!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)",o))};i.isReactWarning=!0,Object.defineProperty(e,"ref",{get:i,configurable:!0})}}var ur=function(e,o,i,b,E,w,h){var g={$$typeof:n,type:e,key:o,ref:i,props:h,_owner:w};return g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(g,"_self",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function cr(e,o,i,b,E){{var w,h={},g=null,P=null;i!==void 0&&(ze(i),g=""+i),or(o)&&(ze(o.key),g=""+o.key),ar(o)&&(P=o.ref,sr(o,E));for(w in o)U.call(o,w)&&!nr.hasOwnProperty(w)&&(h[w]=o[w]);if(e&&e.defaultProps){var T=e.defaultProps;for(w in T)h[w]===void 0&&(h[w]=T[w])}if(g||P){var k=typeof e=="function"?e.displayName||e.name||"Unknown":e;g&&ir(h,k),P&&lr(h,k)}return ur(e,g,P,E,b,G.current,h)}}var le=L.ReactCurrentOwner,Ye=L.ReactDebugCurrentFrame;function A(e){if(e){var o=e._owner,i=Q(e.type,e._source,o?o.type:null);Ye.setExtraStackFrame(i)}else Ye.setExtraStackFrame(null)}var ue;ue=!1;function ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function Ue(){{if(le.current){var e=D(le.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function fr(e){{if(e!==void 0){var o=e.fileName.replace(/^.*[\\\/]/,""),i=e.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+o+":"+i+"."}return""}}var
|
|
25
|
+
Check your code at `+o+":"+i+"."}return""}}var Ge={};function dr(e){{var o=Ue();if(!o){var i=typeof e=="string"?e:e.displayName||e.name;i&&(o=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+i+">.")}return o}}function
|
|
27
|
+
Check the top-level render call using <`+i+">.")}return o}}function qe(e,o){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var i=dr(o);if(Ge[i])return;Ge[i]=!0;var b="";e&&e._owner&&e._owner!==le.current&&(b=" It was passed a child from "+D(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,b),A(null)}}function Ke(e,o){{if(typeof e!="object")return;if(se(e))for(var i=0;i<e.length;i++){var b=e[i];ce(b)&&qe(b,o)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var E=Bt(e);if(typeof E=="function"&&E!==e.entries)for(var w=E.call(e),h;!(h=w.next()).done;)ce(h.value)&&qe(h.value,o)}}}function vr(e){{var o=e.type;if(o==null||typeof o=="string")return;var i;if(typeof o=="function")i=o.propTypes;else if(typeof o=="object"&&(o.$$typeof===f||o.$$typeof===R))i=o.propTypes;else return;if(i){var b=D(o);$t(i,e.props,"prop",b,e)}else if(o.PropTypes!==void 0&&!ue){ue=!0;var E=D(o);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof o.getDefaultProps=="function"&&!o.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function br(e){{for(var o=Object.keys(e.props),i=0;i<o.length;i++){var b=o[i];if(b!=="children"&&b!=="key"){A(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",b),A(null);break}}e.ref!==null&&(A(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),A(null))}}var He={};function Je(e,o,i,b,E,w){{var h=qt(e);if(!h){var g="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(g+=" 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 P=fr(E);P?g+=P:g+=Ue();var T;e===null?T="null":se(e)?T="array":e!==void 0&&e.$$typeof===n?(T="<"+(D(e.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):T=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",T,g)}var k=cr(e,o,i,E,w);if(k==null)return k;if(h){var F=o.children;if(F!==void 0)if(b)if(se(F)){for(var B=0;B<F.length;B++)Ke(F[B],e);Object.freeze&&Object.freeze(F)}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 Ke(F,e)}if(U.call(o,"key")){var I=D(e),O=Object.keys(o).filter(function(xr){return xr!=="key"}),fe=O.length>0?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}";if(!He[I+fe]){var yr=O.length>0?"{"+O.join(": ..., ")+": ...}":"{}";_(`A props object containing a "key" prop is being spread into JSX:
|
|
28
28
|
let props = %s;
|
|
29
29
|
<%s {...props} />
|
|
30
30
|
React keys must be passed directly to JSX without using spread:
|
|
31
31
|
let props = %s;
|
|
32
|
-
<%s key={someKey} {...props} />`,fe,I,Er,I),Je[I+fe]=!0}}return e===a?pr(k):mr(k),k}}function gr(e,o,i){return Xe(e,o,i,!0)}function hr(e,o,i){return Xe(e,o,i,!1)}var yr=hr,xr=gr;W.Fragment=a,W.jsx=yr,W.jsxs=xr}()),W}process.env.NODE_ENV==="production"?ee.exports=$e():ee.exports=et();var l=ee.exports;const me=(t,n,r=!1)=>{const a=[];function s(u,v="--bn"){for(const c in u){const f=c.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),m=`${v}-${f}`;typeof u[c]!="object"?(typeof u[c]=="number"&&(u[c]=`${u[c]}px`),r?n.style.removeProperty(m):n.style.setProperty(m,u[c].toString())):s(u[c],m)}}return s(t),a},te=(t,n)=>me(t,n),tt={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},pe=t=>me(tt,t,!0),rt=p.forwardRef((t,n)=>{const{className:r,name:a,label:s,icon:u,value:v,autoFocus:c,placeholder:f,onKeyDown:m,onChange:j,onSubmit:R,..._}=t;return y.assertEmpty(_),l.jsx(d.TextInput,{size:"xs",className:r,ref:n,name:a,label:s,leftSection:u,value:v,autoFocus:c,"data-autofocus":c?"true":void 0,placeholder:f,onKeyDown:m,onChange:j,onSubmit:R})});var ge={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},he=M.default.createContext&&M.default.createContext(ge),nt=["attr","size","title"];function at(t,n){if(t==null)return{};var r=ot(t,n),a,s;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(s=0;s<u.length;s++)a=u[s],!(n.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(r[a]=t[a])}return r}function ot(t,n){if(t==null)return{};var r={};for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){if(n.indexOf(a)>=0)continue;r[a]=t[a]}return r}function K(){return K=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},K.apply(this,arguments)}function ye(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);n&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,a)}return r}function H(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?ye(Object(r),!0).forEach(function(a){st(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ye(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function st(t,n,r){return n=it(n),n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}function it(t){var n=lt(t,"string");return typeof n=="symbol"?n:n+""}function lt(t,n){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,n||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}function xe(t){return t&&t.map((n,r)=>M.default.createElement(n.tag,H({key:r},n.attr),xe(n.child)))}function Ee(t){return n=>M.default.createElement(ut,K({attr:H({},t.attr)},n),xe(t.child))}function ut(t){var n=r=>{var{attr:a,size:s,title:u}=t,v=at(t,nt),c=s||r.size||"1em",f;return r.className&&(f=r.className),t.className&&(f=(f?f+" ":"")+t.className),M.default.createElement("svg",K({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,a,v,{className:f,style:H(H({color:t.color||r.color},r.style),t.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),u&&M.default.createElement("title",null,u),t.children)};return he!==void 0?M.default.createElement(he.Consumer,null,r=>n(r)):n(ge)}function ct(t){return Ee({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"},child:[]}]})(t)}function ft(t){return Ee({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"},child:[]}]})(t)}const je=p.createContext(void 0),dt=p.forwardRef((t,n)=>{const{children:r,onOpenChange:a,position:s,sub:u,...v}=t;y.assertEmpty(v);const[c,f]=p.useState(!1),m=p.useRef(null),j=p.useRef(),R=p.useCallback(()=>{j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{f(!1)},250)},[]),_=p.useCallback(()=>{j.current&&clearTimeout(j.current),f(!0)},[]);return l.jsx(je.Provider,{value:{onMenuMouseOver:_,onMenuMouseLeave:R},children:l.jsx(d.Menu.Item,{className:"bn-menu-item bn-mt-sub-menu-item",ref:z.mergeRefs(n,m),onMouseOver:_,onMouseLeave:R,children:l.jsx(d.Menu,{portalProps:{target:m.current?m.current.parentElement:void 0},middlewares:{flip:!0,shift:!0,inline:!1,size:!0},trigger:"hover",opened:c,onClose:()=>a==null?void 0:a(!1),onOpen:()=>a==null?void 0:a(!0),position:s,children:r})})})}),vt=t=>{const{children:n,onOpenChange:r,position:a,sub:s,...u}=t;return y.assertEmpty(u),s?l.jsx(dt,{...t}):l.jsx(d.Menu,{withinPortal:!1,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},onClose:()=>r==null?void 0:r(!1),onOpen:()=>r==null?void 0:r(!0),position:a,children:n})},bt=p.forwardRef((t,n)=>{const{className:r,children:a,icon:s,checked:u,subTrigger:v,onClick:c,...f}=t;return y.assertEmpty(f,!1),v?l.jsxs("div",{ref:n,...f,children:[a,l.jsx(ft,{size:15})]}):l.jsx(d.Menu.Item,{className:r,ref:n,leftSection:s,rightSection:u?l.jsx(d.CheckIcon,{size:10}):u===!1?l.jsx("div",{className:"bn-tick-space"}):null,onClick:c,...f,children:a})}),mt=t=>{const{children:n,sub:r,...a}=t;return y.assertEmpty(a),l.jsx(d.Menu.Target,{children:n})},pt=p.forwardRef((t,n)=>{const{className:r,children:a,sub:s,...u}=t;y.assertEmpty(u);const v=p.useContext(je);return l.jsx(d.Menu.Dropdown,{className:r,ref:n,onMouseOver:v==null?void 0:v.onMenuMouseOver,onMouseLeave:v==null?void 0:v.onMenuMouseLeave,children:a})}),gt=p.forwardRef((t,n)=>{const{className:r,...a}=t;return y.assertEmpty(a),l.jsx(d.Menu.Divider,{className:r,ref:n})}),ht=p.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return y.assertEmpty(s),l.jsx(d.Menu.Label,{className:r,ref:n,children:a})}),yt=p.forwardRef((t,n)=>{const{className:r,tabs:a,defaultOpenTab:s,openTab:u,setOpenTab:v,loading:c,...f}=t;return y.assertEmpty(f),l.jsx(d.Group,{className:r,ref:n,children:l.jsxs(d.Tabs,{value:u,defaultValue:s,onChange:v,children:[c&&l.jsx(d.LoadingOverlay,{visible:c}),l.jsx(d.Tabs.List,{children:a.map(m=>l.jsx(d.Tabs.Tab,{"data-test":`${m.name.toLowerCase()}-tab`,value:m.name,children:m.name},m.name))}),a.map(m=>l.jsx(d.Tabs.Panel,{value:m.name,children:m.tabPanel},m.name))]})})}),xt=p.forwardRef((t,n)=>{const{className:r,children:a,onClick:s,label:u,...v}=t;return y.assertEmpty(v),l.jsx(d.Button,{size:"xs","aria-label":u,className:r,ref:n,onClick:s,...v,children:a})}),Et=p.forwardRef((t,n)=>{const{className:r,accept:a,value:s,placeholder:u,onChange:v,...c}=t;return y.assertEmpty(c),l.jsx(d.FileInput,{size:"xs",className:r,ref:n,accept:a,value:s,placeholder:u,onChange:v,...c})}),jt=p.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return y.assertEmpty(s),l.jsx("div",{className:r,ref:n,children:a})}),wt=p.forwardRef((t,n)=>{const{className:r,value:a,placeholder:s,onKeyDown:u,onChange:v,...c}=t;return y.assertEmpty(c),l.jsx(d.TextInput,{size:"xs","data-test":"embed-input",className:r,ref:n,value:a,placeholder:s,onKeyDown:u,onChange:v})}),Tt=t=>{const{children:n,opened:r,position:a,...s}=t;return y.assertEmpty(s),l.jsx(d.Popover,{withinPortal:!1,zIndex:1e4,opened:r,position:a,children:n})},kt=t=>{const{children:n,...r}=t;return y.assertEmpty(r),l.jsx(d.PopoverTarget,{children:n})},St=p.forwardRef((t,n)=>{const{className:r,children:a,variant:s,...u}=t;return y.assertEmpty(u),l.jsx(d.PopoverDropdown,{className:r,ref:n,children:a})}),Rt=p.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return y.assertEmpty(s,!1),l.jsx(d.Group,{align:"center",gap:0,className:r,ref:n,...s,children:a})}),_t=p.forwardRef((t,n)=>{const{className:r,children:a,icon:s,onClick:u,onDragEnd:v,onDragStart:c,draggable:f,label:m,...j}=t;return y.assertEmpty(j,!1),s?l.jsx(d.ActionIcon,{size:24,className:r,ref:n,onClick:u,onDragEnd:v,onDragStart:c,draggable:f,"aria-label":m,...j,children:s}):l.jsx(d.Button,{className:r,ref:n,onClick:u,onDragEnd:v,onDragStart:c,draggable:f,"aria-label":m,...j,children:a})}),Ct=p.forwardRef((t,n)=>{const{className:r,children:a,id:s,...u}=t;return y.assertEmpty(u),l.jsx(d.Stack,{gap:0,className:r,ref:n,id:s,role:"listbox",children:a})}),Pt=p.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return y.assertEmpty(s),l.jsx(d.Group,{className:r,ref:n,children:l.jsx(d.Group,{className:"bn-mt-suggestion-menu-item-title",children:a})})}),Ot=p.forwardRef((t,n)=>{const{className:r,isSelected:a,onClick:s,item:u,id:v,...c}=t;y.assertEmpty(c);const f=p.useRef(null);return p.useEffect(()=>{if(!f.current||!a)return;const m=q.elementOverflow(f.current);m==="top"?f.current.scrollIntoView(!0):m==="bottom"&&f.current.scrollIntoView(!1)},[a]),l.jsxs(d.Group,{gap:0,className:r,ref:z.mergeRefs(n,f),id:v,role:"option",onClick:s,"aria-selected":a||void 0,children:[u.icon&&l.jsx(d.Group,{className:"bn-mt-suggestion-menu-item-section","data-position":"left",children:u.icon}),l.jsxs(d.Stack,{gap:0,className:"bn-mt-suggestion-menu-item-body",children:[l.jsx(d.Text,{className:"bn-mt-suggestion-menu-item-title",children:u.title}),l.jsx(d.Text,{className:"bn-mt-suggestion-menu-item-subtitle",children:u.subtext})]}),u.badge&&l.jsx(d.Group,{"data-position":"right",className:"bn-mt-suggestion-menu-item-section",children:l.jsx(d.Badge,{size:"xs",children:u.badge})})]})}),Ft=p.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return y.assertEmpty(s),l.jsx(d.Group,{className:r,ref:n,children:a})}),Dt=p.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return y.assertEmpty(s),l.jsx(d.Loader,{className:r,type:"dots",ref:n})}),Mt=p.forwardRef((t,n)=>{const{className:r,children:a,draggable:s,onDragStart:u,onDragEnd:v,style:c,label:f,...m}=t;return y.assertEmpty(m,!1),l.jsx(d.Button,{className:r,ref:n,"aria-label":f,draggable:s,onDragStart:u,onDragEnd:v,style:c,...m,children:a})}),we=p.forwardRef((t,n)=>{const{className:r,children:a,onMouseEnter:s,onMouseLeave:u,...v}=t;y.assertEmpty(v);const{ref:c,focused:f}=z.useFocusWithin(),m=z.useFocusTrap(f),j=z.mergeRefs(n,c,m);return l.jsx(d.Group,{className:r,ref:j,role:"toolbar",onMouseEnter:s,onMouseLeave:u,children:a})}),Nt=t=>l.jsxs(d.Stack,{gap:0,className:"bn-tooltip",children:[l.jsx(d.Text,{size:"sm",children:t.mainTooltip}),t.secondaryTooltip&&l.jsx(d.Text,{size:"xs",children:t.secondaryTooltip})]}),Te=p.forwardRef((t,n)=>{const{className:r,children:a,mainTooltip:s,secondaryTooltip:u,icon:v,isSelected:c,isDisabled:f,onClick:m,label:j,...R}=t;return y.assertEmpty(R,!1),l.jsx(d.Tooltip,{withinPortal:!1,label:l.jsx(Nt,{mainTooltip:s,secondaryTooltip:u}),children:a?l.jsx(d.Button,{"aria-label":j,className:r,onMouseDown:_=>{y.isSafari()&&_.currentTarget.focus()},onClick:m,"aria-pressed":c,"data-selected":c||void 0,"data-test":s.slice(0,1).toLowerCase()+s.replace(/\s+/g,"").slice(1),size:"xs",disabled:f||!1,ref:n,...R,children:a}):l.jsx(d.ActionIcon,{className:r,"aria-label":j,onMouseDown:_=>{y.isSafari()&&_.currentTarget.focus()},onClick:m,"aria-pressed":c,"data-selected":c||void 0,"data-test":s.slice(0,1).toLowerCase()+s.replace(/\s+/g,"").slice(1),size:30,disabled:f||!1,ref:n,...R,children:v})})}),It=p.forwardRef((t,n)=>{const{className:r,items:a,isDisabled:s,...u}=t;y.assertEmpty(u);const v=a.filter(c=>c.isSelected)[0];return v?l.jsxs(d.Menu,{withinPortal:!1,transitionProps:{exitDuration:0},disabled:s,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},children:[l.jsx(d.Menu.Target,{children:l.jsx(d.Button,{onMouseDown:c=>{y.isSafari()&&c.currentTarget.focus()},leftSection:v.icon,rightSection:l.jsx(ct,{}),size:"xs",variant:"subtle",disabled:s,children:v.text})}),l.jsx(d.Menu.Dropdown,{className:r,ref:n,children:a.map(c=>l.jsx(d.Menu.Item,{onClick:c.onClick,leftSection:c.icon,rightSection:c.isSelected?l.jsx(d.CheckIcon,{size:10,className:"bn-tick-icon"}):l.jsx("div",{className:"bn-tick-space"}),disabled:c.isDisabled,children:c.text},c.text))})]}):null}),wr="",x=["#FFFFFF","#EFEFEF","#CFCFCF","#AFAFAF","#7F7F7F","#3F3F3F","#1F1F1F","#161616","#0F0F0F","#000000"],re={colors:{editor:{text:x[5],background:x[0]},menu:{text:x[5],background:x[0]},tooltip:{text:x[5],background:x[1]},hovered:{text:x[5],background:x[1]},selected:{text:x[0],background:x[5]},disabled:{text:x[3],background:x[1]},shadow:x[2],border:x[1],sideMenu:x[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'},Lt={colors:{editor:{text:x[2],background:x[6]},menu:{text:x[2],background:x[6]},tooltip:{text:x[2],background:x[7]},hovered:{text:x[2],background:x[7]},selected:{text:x[2],background:x[8]},disabled:{text:x[5],background:x[7]},shadow:x[8],border:x[7],sideMenu:x[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:re.borderRadius,fontFamily:re.fontFamily},ke={FormattingToolbar:{Root:we,Button:Te,Select:It},FilePanel:{Root:yt,Button:xt,FileInput:Et,TabPanel:jt,TextInput:wt},LinkToolbar:{Root:we,Button:Te},SideMenu:{Root:Rt,Button:_t},SuggestionMenu:{Root:Ct,Item:Ot,EmptyItem:Pt,Label:Ft,Loader:Dt},TableHandle:{Root:Mt},Generic:{Form:{Root:t=>l.jsx("div",{children:t.children}),TextInput:rt},Menu:{Root:vt,Trigger:mt,Dropdown:pt,Divider:gt,Label:ht,Item:bt},Popover:{Root:Tt,Trigger:kt,Content:St}}},At={activeClassName:""},Bt=t=>{const{className:n,theme:r,...a}=t,s=q.useBlockNoteContext(),u=Qe.default(),v=(s==null?void 0:s.colorSchemePreference)||u,c=p.useCallback(f=>{if(f&&(pe(f),typeof r=="object")){if("light"in r&&"dark"in r){te(r[v==="dark"?"dark":"light"],f);return}te(r,f);return}},[v,r]);return l.jsx(q.ComponentsContext.Provider,{value:ke,children:l.jsx(d.MantineProvider,{theme:At,cssVariablesSelector:".bn-mantine",getRootElement:()=>{},children:l.jsx(q.BlockNoteViewRaw,{className:y.mergeCSSClasses("bn-mantine",n||""),theme:typeof r=="object"?void 0:r,...a,ref:c})})})};S.BlockNoteView=Bt,S.applyBlockNoteCSSVariablesFromTheme=te,S.components=ke,S.darkDefaultTheme=Lt,S.defaultColorScheme=x,S.lightDefaultTheme=re,S.removeBlockNoteCSSVariables=pe,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|
|
32
|
+
<%s key={someKey} {...props} />`,fe,I,yr,I),He[I+fe]=!0}}return e===a?br(k):vr(k),k}}function pr(e,o,i){return Je(e,o,i,!0)}function mr(e,o,i){return Je(e,o,i,!1)}var gr=mr,hr=pr;W.Fragment=a,W.jsx=gr,W.jsxs=hr}()),W}process.env.NODE_ENV==="production"?ee.exports=Ze():ee.exports=Qe();var l=ee.exports;const be=(t,n,r=!1)=>{const a=[];function s(u,v="--bn"){for(const c in u){const f=c.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),p=`${v}-${f}`;typeof u[c]!="object"?(typeof u[c]=="number"&&(u[c]=`${u[c]}px`),r?n.style.removeProperty(p):n.style.setProperty(p,u[c].toString())):s(u[c],p)}}return s(t),a},te=(t,n)=>be(t,n),$e={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},pe=t=>be($e,t,!0),et=m.forwardRef((t,n)=>{const{className:r,name:a,label:s,icon:u,value:v,autoFocus:c,placeholder:f,onKeyDown:p,onChange:j,onSubmit:R,...C}=t;return y.assertEmpty(C),l.jsx(d.TextInput,{size:"xs",className:r,ref:n,name:a,label:s,leftSection:u,value:v,autoFocus:c,"data-autofocus":c?"true":void 0,placeholder:f,onKeyDown:p,onChange:j,onSubmit:R})});var me={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ge=M.default.createContext&&M.default.createContext(me),tt=["attr","size","title"];function rt(t,n){if(t==null)return{};var r=nt(t,n),a,s;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(s=0;s<u.length;s++)a=u[s],!(n.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(t,a)&&(r[a]=t[a])}return r}function nt(t,n){if(t==null)return{};var r={};for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){if(n.indexOf(a)>=0)continue;r[a]=t[a]}return r}function K(){return K=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},K.apply(this,arguments)}function he(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);n&&(a=a.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,a)}return r}function H(t){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?he(Object(r),!0).forEach(function(a){at(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):he(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function at(t,n,r){return n=ot(n),n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}function ot(t){var n=st(t,"string");return typeof n=="symbol"?n:n+""}function st(t,n){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,n||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}function ye(t){return t&&t.map((n,r)=>M.default.createElement(n.tag,H({key:r},n.attr),ye(n.child)))}function xe(t){return n=>M.default.createElement(it,K({attr:H({},t.attr)},n),ye(t.child))}function it(t){var n=r=>{var{attr:a,size:s,title:u}=t,v=rt(t,tt),c=s||r.size||"1em",f;return r.className&&(f=r.className),t.className&&(f=(f?f+" ":"")+t.className),M.default.createElement("svg",K({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,a,v,{className:f,style:H(H({color:t.color||r.color},r.style),t.style),height:c,width:c,xmlns:"http://www.w3.org/2000/svg"}),u&&M.default.createElement("title",null,u),t.children)};return ge!==void 0?M.default.createElement(ge.Consumer,null,r=>n(r)):n(me)}function lt(t){return xe({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"},child:[]}]})(t)}function ut(t){return xe({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"},child:[]}]})(t)}const Ee=m.createContext(void 0),ct=m.forwardRef((t,n)=>{const{children:r,onOpenChange:a,position:s,sub:u,...v}=t;y.assertEmpty(v);const[c,f]=m.useState(!1),p=m.useRef(null),j=m.useRef(),R=m.useCallback(()=>{j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{f(!1)},250)},[]),C=m.useCallback(()=>{j.current&&clearTimeout(j.current),f(!0)},[]);return l.jsx(Ee.Provider,{value:{onMenuMouseOver:C,onMenuMouseLeave:R},children:l.jsx(d.Menu.Item,{className:"bn-menu-item bn-mt-sub-menu-item",ref:z.mergeRefs(n,p),onMouseOver:C,onMouseLeave:R,children:l.jsx(d.Menu,{portalProps:{target:p.current?p.current.parentElement:void 0},middlewares:{flip:!0,shift:!0,inline:!1,size:!0},trigger:"hover",opened:c,onClose:()=>a==null?void 0:a(!1),onOpen:()=>a==null?void 0:a(!0),position:s,children:r})})})}),ft=t=>{const{children:n,onOpenChange:r,position:a,sub:s,...u}=t;return y.assertEmpty(u),s?l.jsx(ct,{...t}):l.jsx(d.Menu,{withinPortal:!1,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},onClose:()=>r==null?void 0:r(!1),onOpen:()=>r==null?void 0:r(!0),position:a,children:n})},dt=m.forwardRef((t,n)=>{const{className:r,children:a,icon:s,checked:u,subTrigger:v,onClick:c,...f}=t;return y.assertEmpty(f,!1),v?l.jsxs("div",{ref:n,...f,children:[a,l.jsx(ut,{size:15})]}):l.jsx(d.Menu.Item,{className:r,ref:n,leftSection:s,rightSection:u?l.jsx(d.CheckIcon,{size:10}):u===!1?l.jsx("div",{className:"bn-tick-space"}):null,onClick:c,...f,children:a})}),vt=t=>{const{children:n,sub:r,...a}=t;return y.assertEmpty(a),l.jsx(d.Menu.Target,{children:n})},bt=m.forwardRef((t,n)=>{const{className:r,children:a,sub:s,...u}=t;y.assertEmpty(u);const v=m.useContext(Ee);return l.jsx(d.Menu.Dropdown,{className:r,ref:n,onMouseOver:v==null?void 0:v.onMenuMouseOver,onMouseLeave:v==null?void 0:v.onMenuMouseLeave,children:a})}),pt=m.forwardRef((t,n)=>{const{className:r,...a}=t;return y.assertEmpty(a),l.jsx(d.Menu.Divider,{className:r,ref:n})}),mt=m.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return y.assertEmpty(s),l.jsx(d.Menu.Label,{className:r,ref:n,children:a})}),gt=m.forwardRef((t,n)=>{const{className:r,tabs:a,defaultOpenTab:s,openTab:u,setOpenTab:v,loading:c,...f}=t;return y.assertEmpty(f),l.jsx(d.Group,{className:r,ref:n,children:l.jsxs(d.Tabs,{value:u,defaultValue:s,onChange:v,children:[c&&l.jsx(d.LoadingOverlay,{visible:c}),l.jsx(d.Tabs.List,{children:a.map(p=>l.jsx(d.Tabs.Tab,{"data-test":`${p.name.toLowerCase()}-tab`,value:p.name,children:p.name},p.name))}),a.map(p=>l.jsx(d.Tabs.Panel,{value:p.name,children:p.tabPanel},p.name))]})})}),ht=m.forwardRef((t,n)=>{const{className:r,children:a,onClick:s,label:u,...v}=t;return y.assertEmpty(v),l.jsx(d.Button,{size:"xs","aria-label":u,className:r,ref:n,onClick:s,...v,children:a})}),yt=m.forwardRef((t,n)=>{const{className:r,accept:a,value:s,placeholder:u,onChange:v,...c}=t;return y.assertEmpty(c),l.jsx(d.FileInput,{size:"xs",className:r,ref:n,accept:a,value:s,placeholder:u,onChange:v,...c})}),xt=m.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return y.assertEmpty(s),l.jsx("div",{className:r,ref:n,children:a})}),Et=m.forwardRef((t,n)=>{const{className:r,value:a,placeholder:s,onKeyDown:u,onChange:v,...c}=t;return y.assertEmpty(c),l.jsx(d.TextInput,{size:"xs","data-test":"embed-input",className:r,ref:n,value:a,placeholder:s,onKeyDown:u,onChange:v})}),jt=t=>{const{children:n,opened:r,position:a,...s}=t;return y.assertEmpty(s),l.jsx(d.Popover,{withinPortal:!1,zIndex:1e4,opened:r,position:a,children:n})},wt=t=>{const{children:n,...r}=t;return y.assertEmpty(r),l.jsx(d.PopoverTarget,{children:n})},Tt=m.forwardRef((t,n)=>{const{className:r,children:a,variant:s,...u}=t;return y.assertEmpty(u),l.jsx(d.PopoverDropdown,{className:r,ref:n,children:a})}),kt=m.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return y.assertEmpty(s,!1),l.jsx(d.Group,{align:"center",gap:0,className:r,ref:n,...s,children:a})}),St=m.forwardRef((t,n)=>{const{className:r,children:a,icon:s,onClick:u,onDragEnd:v,onDragStart:c,draggable:f,label:p,...j}=t;return y.assertEmpty(j,!1),s?l.jsx(d.ActionIcon,{size:24,className:r,ref:n,onClick:u,onDragEnd:v,onDragStart:c,draggable:f,"aria-label":p,...j,children:s}):l.jsx(d.Button,{className:r,ref:n,onClick:u,onDragEnd:v,onDragStart:c,draggable:f,"aria-label":p,...j,children:a})}),Rt=m.forwardRef((t,n)=>{const{className:r,children:a,id:s,...u}=t;return y.assertEmpty(u),l.jsx(d.Stack,{gap:0,className:r,ref:n,id:s,role:"listbox",children:a})}),Ct=m.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return y.assertEmpty(s),l.jsx(d.Group,{className:r,ref:n,children:l.jsx(d.Group,{className:"bn-mt-suggestion-menu-item-title",children:a})})}),_t=m.forwardRef((t,n)=>{const{className:r,isSelected:a,onClick:s,item:u,id:v,...c}=t;y.assertEmpty(c);const f=m.useRef(null);return m.useEffect(()=>{if(!f.current||!a)return;const p=q.elementOverflow(f.current);p==="top"?f.current.scrollIntoView(!0):p==="bottom"&&f.current.scrollIntoView(!1)},[a]),l.jsxs(d.Group,{gap:0,className:r,ref:z.mergeRefs(n,f),id:v,role:"option",onClick:s,"aria-selected":a||void 0,children:[u.icon&&l.jsx(d.Group,{className:"bn-mt-suggestion-menu-item-section","data-position":"left",children:u.icon}),l.jsxs(d.Stack,{gap:0,className:"bn-mt-suggestion-menu-item-body",children:[l.jsx(d.Text,{className:"bn-mt-suggestion-menu-item-title",children:u.title}),l.jsx(d.Text,{className:"bn-mt-suggestion-menu-item-subtitle",children:u.subtext})]}),u.badge&&l.jsx(d.Group,{"data-position":"right",className:"bn-mt-suggestion-menu-item-section",children:l.jsx(d.Badge,{size:"xs",children:u.badge})})]})}),Pt=m.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return y.assertEmpty(s),l.jsx(d.Group,{className:r,ref:n,children:a})}),Ot=m.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return y.assertEmpty(s),l.jsx(d.Loader,{className:r,type:"dots",ref:n})}),Ft=m.forwardRef((t,n)=>{const{className:r,children:a,draggable:s,onDragStart:u,onDragEnd:v,style:c,label:f,...p}=t;return y.assertEmpty(p,!1),l.jsx(d.Button,{className:r,ref:n,"aria-label":f,draggable:s,onDragStart:u,onDragEnd:v,style:c,...p,children:a})}),je=m.forwardRef((t,n)=>{const{className:r,children:a,onMouseEnter:s,onMouseLeave:u,...v}=t;y.assertEmpty(v);const{ref:c,focused:f}=z.useFocusWithin(),p=z.useFocusTrap(f),j=z.mergeRefs(n,c,p);return l.jsx(d.Group,{className:r,ref:j,role:"toolbar",onMouseEnter:s,onMouseLeave:u,children:a})}),Dt=t=>l.jsxs(d.Stack,{gap:0,className:"bn-tooltip",children:[l.jsx(d.Text,{size:"sm",children:t.mainTooltip}),t.secondaryTooltip&&l.jsx(d.Text,{size:"xs",children:t.secondaryTooltip})]}),we=m.forwardRef((t,n)=>{const{className:r,children:a,mainTooltip:s,secondaryTooltip:u,icon:v,isSelected:c,isDisabled:f,onClick:p,label:j,...R}=t;return y.assertEmpty(R,!1),l.jsx(d.Tooltip,{withinPortal:!1,label:l.jsx(Dt,{mainTooltip:s,secondaryTooltip:u}),children:a?l.jsx(d.Button,{"aria-label":j,className:r,onMouseDown:C=>{y.isSafari()&&C.currentTarget.focus()},onClick:p,"aria-pressed":c,"data-selected":c||void 0,"data-test":s.slice(0,1).toLowerCase()+s.replace(/\s+/g,"").slice(1),size:"xs",disabled:f||!1,ref:n,...R,children:a}):l.jsx(d.ActionIcon,{className:r,"aria-label":j,onMouseDown:C=>{y.isSafari()&&C.currentTarget.focus()},onClick:p,"aria-pressed":c,"data-selected":c||void 0,"data-test":s.slice(0,1).toLowerCase()+s.replace(/\s+/g,"").slice(1),size:30,disabled:f||!1,ref:n,...R,children:v})})}),Mt=m.forwardRef((t,n)=>{const{className:r,items:a,isDisabled:s,...u}=t;y.assertEmpty(u);const v=a.filter(c=>c.isSelected)[0];return v?l.jsxs(d.Menu,{withinPortal:!1,transitionProps:{exitDuration:0},disabled:s,middlewares:{flip:!0,shift:!0,inline:!1,size:!0},children:[l.jsx(d.Menu.Target,{children:l.jsx(d.Button,{onMouseDown:c=>{y.isSafari()&&c.currentTarget.focus()},leftSection:v.icon,rightSection:l.jsx(lt,{}),size:"xs",variant:"subtle",disabled:s,children:v.text})}),l.jsx(d.Menu.Dropdown,{className:r,ref:n,children:a.map(c=>l.jsx(d.Menu.Item,{onClick:c.onClick,leftSection:c.icon,rightSection:c.isSelected?l.jsx(d.CheckIcon,{size:10,className:"bn-tick-icon"}):l.jsx("div",{className:"bn-tick-space"}),disabled:c.isDisabled,children:c.text},c.text))})]}):null}),jr="",x=["#FFFFFF","#EFEFEF","#CFCFCF","#AFAFAF","#7F7F7F","#3F3F3F","#1F1F1F","#161616","#0F0F0F","#000000"],re={colors:{editor:{text:x[5],background:x[0]},menu:{text:x[5],background:x[0]},tooltip:{text:x[5],background:x[1]},hovered:{text:x[5],background:x[1]},selected:{text:x[0],background:x[5]},disabled:{text:x[3],background:x[1]},shadow:x[2],border:x[1],sideMenu:x[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'},Nt={colors:{editor:{text:x[2],background:x[6]},menu:{text:x[2],background:x[6]},tooltip:{text:x[2],background:x[7]},hovered:{text:x[2],background:x[7]},selected:{text:x[2],background:x[8]},disabled:{text:x[5],background:x[7]},shadow:x[8],border:x[7],sideMenu:x[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:re.borderRadius,fontFamily:re.fontFamily},Te={FormattingToolbar:{Root:je,Button:we,Select:Mt},FilePanel:{Root:gt,Button:ht,FileInput:yt,TabPanel:xt,TextInput:Et},LinkToolbar:{Root:je,Button:we},SideMenu:{Root:kt,Button:St},SuggestionMenu:{Root:Rt,Item:_t,EmptyItem:Ct,Label:Pt,Loader:Ot},TableHandle:{Root:Ft},Generic:{Form:{Root:t=>l.jsx("div",{children:t.children}),TextInput:et},Menu:{Root:ft,Trigger:vt,Dropdown:bt,Divider:pt,Label:mt,Item:dt},Popover:{Root:jt,Trigger:wt,Content:Tt}}},It={activeClassName:""},Lt=t=>{const{className:n,theme:r,...a}=t,s=q.useBlockNoteContext(),u=Xe.usePrefersColorScheme(),v=(s==null?void 0:s.colorSchemePreference)||u,c=m.useCallback(f=>{if(f&&(pe(f),typeof r=="object")){if("light"in r&&"dark"in r){te(r[v==="dark"?"dark":"light"],f);return}te(r,f);return}},[v,r]);return l.jsx(q.ComponentsContext.Provider,{value:Te,children:l.jsx(d.MantineProvider,{theme:It,cssVariablesSelector:".bn-mantine",getRootElement:()=>{},children:l.jsx(q.BlockNoteViewRaw,{className:y.mergeCSSClasses("bn-mantine",n||""),theme:typeof r=="object"?void 0:r,...a,ref:c})})})};S.BlockNoteView=Lt,S.applyBlockNoteCSSVariablesFromTheme=te,S.components=Te,S.darkDefaultTheme=Nt,S.defaultColorScheme=x,S.lightDefaultTheme=re,S.removeBlockNoteCSSVariables=pe,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|
|
33
33
|
//# sourceMappingURL=blocknote-mantine.umd.cjs.map
|