@blocknote/mantine 0.15.2 → 0.15.4
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 +37 -31
- package/dist/blocknote-mantine.js.map +1 -1
- package/dist/blocknote-mantine.umd.cjs +4 -4
- 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/style.css +2 -1
- package/src/suggestionMenu/SuggestionMenuItem.tsx +4 -1
- package/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenuItem.tsx +4 -1
- package/types/src/form/TextInput.d.ts +5 -4
- package/types/src/index.d.ts +2 -2
- package/types/src/menu/Menu.d.ts +9 -8
- package/types/src/panel/Panel.d.ts +2 -1
- package/types/src/panel/PanelButton.d.ts +3 -2
- package/types/src/panel/PanelFileInput.d.ts +2 -1
- package/types/src/panel/PanelTab.d.ts +2 -1
- package/types/src/panel/PanelTextInput.d.ts +3 -2
- package/types/src/popover/Popover.d.ts +2 -1
- package/types/src/sideMenu/SideMenu.d.ts +2 -1
- package/types/src/sideMenu/SideMenuButton.d.ts +7 -6
- package/types/src/suggestionMenu/SuggestionMenu.d.ts +2 -1
- package/types/src/suggestionMenu/SuggestionMenuEmptyItem.d.ts +2 -1
- package/types/src/suggestionMenu/SuggestionMenuItem.d.ts +2 -1
- package/types/src/suggestionMenu/SuggestionMenuLabel.d.ts +2 -1
- package/types/src/suggestionMenu/SuggestionMenuLoader.d.ts +2 -1
- package/types/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenu.d.ts +2 -1
- package/types/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenuEmptyItem.d.ts +2 -1
- package/types/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenuItem.d.ts +2 -1
- package/types/src/suggestionMenu/gridSuggestionMenu/GridSuggestionMenuLoader.d.ts +2 -1
- package/types/src/tableHandle/TableHandle.d.ts +5 -4
- package/types/src/toolbar/Toolbar.d.ts +5 -4
- package/types/src/toolbar/ToolbarButton.d.ts +1 -0
- package/types/src/toolbar/ToolbarSelect.d.ts +4 -3
|
@@ -14,18 +14,18 @@
|
|
|
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 me;function Ze(){return me||(me=1,process.env.NODE_ENV!=="production"&&function(){var t=D.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"),m=Symbol.for("react.provider"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),Te=Symbol.iterator,Vt="@@iterator";function Wt(e){if(e===null||typeof e!="object")return null;var o=Te&&e[Te]||e[Vt];return typeof o=="function"?o:null}var B=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),v=1;v<o;v++)i[v-1]=arguments[v];Gt("error",e,i)}}function Gt(e,o,i){{var v=B.ReactDebugCurrentFrame,w=v.getStackAddendum();w!==""&&(o+="%s",i=i.concat([w]));var j=i.map(function(y){return String(y)});j.unshift("Warning: "+o),Function.prototype.apply.call(console[e],console,j)}}var Yt=!1,Ut=!1,
|
|
17
|
+
*/var me;function Ze(){return me||(me=1,process.env.NODE_ENV!=="production"&&function(){var t=D.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"),m=Symbol.for("react.provider"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),J=Symbol.for("react.offscreen"),Te=Symbol.iterator,Vt="@@iterator";function Wt(e){if(e===null||typeof e!="object")return null;var o=Te&&e[Te]||e[Vt];return typeof o=="function"?o:null}var B=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),v=1;v<o;v++)i[v-1]=arguments[v];Gt("error",e,i)}}function Gt(e,o,i){{var v=B.ReactDebugCurrentFrame,w=v.getStackAddendum();w!==""&&(o+="%s",i=i.concat([w]));var j=i.map(function(y){return String(y)});j.unshift("Warning: "+o),Function.prototype.apply.call(console[e],console,j)}}var Yt=!1,Ut=!1,qt=!1,Kt=!1,Ht=!1,ke;ke=Symbol.for("react.module.reference");function Jt(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===u||Ht||e===s||e===b||e===E||Kt||e===J||Yt||Ut||qt||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===k||e.$$typeof===m||e.$$typeof===c||e.$$typeof===f||e.$$typeof===ke||e.getModuleId!==void 0))}function Xt(e,o,i){var v=e.displayName;if(v)return v;var w=o.displayName||o.name||"";return w!==""?i+"("+w+")":i}function Re(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 a:return"Fragment";case r:return"Portal";case u:return"Profiler";case s:return"StrictMode";case b:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case c:var o=e;return Re(o)+".Consumer";case m:var i=e;return Re(i._context)+".Provider";case f:return Xt(e,e.render,"ForwardRef");case k:var v=e.displayName||null;return v!==null?v:M(e.type)||"Memo";case C:{var w=e,j=w._payload,y=w._init;try{return M(y(j))}catch{return null}}}return null}var N=Object.assign,Y=0,Ce,_e,Pe,Oe,Fe,Me,De;function Ne(){}Ne.__reactDisabledLog=!0;function Zt(){{if(Y===0){Ce=console.log,_e=console.info,Pe=console.warn,Oe=console.error,Fe=console.group,Me=console.groupCollapsed,De=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 Qt(){{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:Me}),groupEnd:N({},e,{value:De})})}Y<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ne=B.ReactCurrentDispatcher,ae;function X(e,o,i){{if(ae===void 0)try{throw Error()}catch(w){var v=w.stack.trim().match(/\n( *(at )?)/);ae=v&&v[1]||""}return`
|
|
18
18
|
`+ae+e}}var oe=!1,Z;{var $t=typeof WeakMap=="function"?WeakMap:Map;Z=new $t}function Ie(e,o){if(!e||oe)return"";{var i=Z.get(e);if(i!==void 0)return i}var v;oe=!0;var w=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var j;j=ne.current,ne.current=null,Zt();try{if(o){var y=function(){throw Error()};if(Object.defineProperty(y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(y,[])}catch(O){v=O}Reflect.construct(e,[],y)}else{try{y.call()}catch(O){v=O}e.call(y.prototype)}}else{try{throw Error()}catch(O){v=O}e()}}catch(O){if(O&&v&&typeof O.stack=="string"){for(var g=O.stack.split(`
|
|
19
19
|
`),P=v.stack.split(`
|
|
20
20
|
`),S=g.length-1,T=P.length-1;S>=1&&T>=0&&g[S]!==P[T];)T--;for(;S>=1&&T>=0;S--,T--)if(g[S]!==P[T]){if(S!==1||T!==1)do if(S--,T--,T<0||g[S]!==P[T]){var F=`
|
|
21
|
-
`+g[S].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(S>=1&&T>=0);break}}}finally{oe=!1,ne.current=j,Qt(),Error.prepareStackTrace=w}var V=e?e.displayName||e.name:"",I=V?X(V):"";return typeof e=="function"&&Z.set(e,I),I}function er(e,o,i){return Ie(e,!1)}function tr(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,tr(e));if(typeof e=="string")return X(e);switch(e){case b:return X("Suspense");case E:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return er(e.render);case k:return Q(e.type,o,i);case C:{var v=e,w=v._payload,j=v._init;try{return Q(j(w),o,i)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,Le={},Ae=B.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 rr(e,o,i,v,w){{var j=Function.call.bind(U);for(var y in e)if(j(e,y)){var g=void 0;try{if(typeof e[y]!="function"){var P=Error((v||"React class")+": "+i+" type `"+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw P.name="Invariant Violation",P}g=e[y](o,y,v,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(S){g=S}g&&!(g instanceof Error)&&($(w),_("%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,y,typeof g),$(null)),g instanceof Error&&!(g.message in Le)&&(Le[g.message]=!0,$(w),_("Failed %s type: %s",i,g.message),$(null))}}}var nr=Array.isArray;function se(e){return nr(e)}function ar(e){{var o=typeof Symbol=="function"&&Symbol.toStringTag,i=o&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function or(e){try{return Be(e),!1}catch{return!0}}function Be(e){return""+e}function ze(e){if(or(e))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ar(e)),Be(e)}var
|
|
21
|
+
`+g[S].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(S>=1&&T>=0);break}}}finally{oe=!1,ne.current=j,Qt(),Error.prepareStackTrace=w}var V=e?e.displayName||e.name:"",I=V?X(V):"";return typeof e=="function"&&Z.set(e,I),I}function er(e,o,i){return Ie(e,!1)}function tr(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,tr(e));if(typeof e=="string")return X(e);switch(e){case b:return X("Suspense");case E:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return er(e.render);case k:return Q(e.type,o,i);case C:{var v=e,w=v._payload,j=v._init;try{return Q(j(w),o,i)}catch{}}}return""}var U=Object.prototype.hasOwnProperty,Le={},Ae=B.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 rr(e,o,i,v,w){{var j=Function.call.bind(U);for(var y in e)if(j(e,y)){var g=void 0;try{if(typeof e[y]!="function"){var P=Error((v||"React class")+": "+i+" type `"+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw P.name="Invariant Violation",P}g=e[y](o,y,v,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(S){g=S}g&&!(g instanceof Error)&&($(w),_("%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,y,typeof g),$(null)),g instanceof Error&&!(g.message in Le)&&(Le[g.message]=!0,$(w),_("Failed %s type: %s",i,g.message),$(null))}}}var nr=Array.isArray;function se(e){return nr(e)}function ar(e){{var o=typeof Symbol=="function"&&Symbol.toStringTag,i=o&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function or(e){try{return Be(e),!1}catch{return!0}}function Be(e){return""+e}function ze(e){if(or(e))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ar(e)),Be(e)}var q=B.ReactCurrentOwner,sr={key:!0,ref:!0,__self:!0,__source:!0},Ve,We,ie;ie={};function ir(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 lr(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 ur(e,o){if(typeof e.ref=="string"&&q.current&&o&&q.current.stateNode!==o){var i=M(q.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',M(q.current.type),e.ref),ie[i]=!0)}}function cr(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 fr(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 dr=function(e,o,i,v,w,j,y){var g={$$typeof:n,type:e,key:o,ref:i,props:y,_owner:j};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:v}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:w}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function mr(e,o,i,v,w){{var j,y={},g=null,P=null;i!==void 0&&(ze(i),g=""+i),lr(o)&&(ze(o.key),g=""+o.key),ir(o)&&(P=o.ref,ur(o,w));for(j in o)U.call(o,j)&&!sr.hasOwnProperty(j)&&(y[j]=o[j]);if(e&&e.defaultProps){var S=e.defaultProps;for(j in S)y[j]===void 0&&(y[j]=S[j])}if(g||P){var T=typeof e=="function"?e.displayName||e.name||"Unknown":e;g&&cr(y,T),P&&fr(y,T)}return dr(e,g,P,w,v,q.current,y)}}var le=B.ReactCurrentOwner,Ge=B.ReactDebugCurrentFrame;function z(e){if(e){var o=e._owner,i=Q(e.type,e._source,o?o.type:null);Ge.setExtraStackFrame(i)}else Ge.setExtraStackFrame(null)}var ue;ue=!1;function ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function Ye(){{if(le.current){var e=M(le.current.type);if(e)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+e+"`."}return""}}function vr(e){return""}var Ue={};function pr(e){{var o=Ye();if(!o){var i=typeof e=="string"?e:e.displayName||e.name;i&&(o=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+i+">.")}return o}}function
|
|
25
|
+
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=pr(o);if(Ue[i])return;Ue[i]=!0;var v="";e&&e._owner&&e._owner!==le.current&&(v=" It was passed a child from "+M(e._owner.type)+"."),z(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),z(null)}}function Ke(e,o){{if(typeof e!="object")return;if(se(e))for(var i=0;i<e.length;i++){var v=e[i];ce(v)&&qe(v,o)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var w=Wt(e);if(typeof w=="function"&&w!==e.entries)for(var j=w.call(e),y;!(y=j.next()).done;)ce(y.value)&&qe(y.value,o)}}}function br(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===k))i=o.propTypes;else return;if(i){var v=M(o);rr(i,e.props,"prop",v,e)}else if(o.PropTypes!==void 0&&!ue){ue=!0;var w=M(o);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",w||"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 gr(e){{for(var o=Object.keys(e.props),i=0;i<o.length;i++){var v=o[i];if(v!=="children"&&v!=="key"){z(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),z(null);break}}e.ref!==null&&(z(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),z(null))}}var He={};function Je(e,o,i,v,w,j){{var y=Jt(e);if(!y){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=vr();P?g+=P:g+=Ye();var S;e===null?S="null":se(e)?S="array":e!==void 0&&e.$$typeof===n?(S="<"+(M(e.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):S=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",S,g)}var T=mr(e,o,i,w,j);if(T==null)return T;if(y){var F=o.children;if(F!==void 0)if(v)if(se(F)){for(var V=0;V<F.length;V++)Ke(F[V],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=M(e),O=Object.keys(o).filter(function(jr){return jr!=="key"}),fe=O.length>0?"{key: someKey, "+O.join(": ..., ")+": ...}":"{key: someKey}";if(!He[I+fe]){var wr=O.length>0?"{"+O.join(": ..., ")+": ...}":"{}";_(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,fe,I,wr,I),He[I+fe]=!0}}return e===a?gr(T):br(T),T}}function hr(e,o,i){return Je(e,o,i,!0)}function yr(e,o,i){return Je(e,o,i,!1)}var xr=yr,Er=hr;G.Fragment=a,G.jsx=xr,G.jsxs=Er}()),G}process.env.NODE_ENV==="production"?ee.exports=Xe():ee.exports=Ze();var l=ee.exports;const ve=(t,n,r=!1)=>{const a=[];function s(u,m="--bn"){for(const c in u){const f=c.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),b=`${m}-${f}`;typeof u[c]!="object"?(typeof u[c]=="number"&&(u[c]=`${u[c]}px`),r?n.style.removeProperty(b):n.style.setProperty(b,u[c].toString())):s(u[c],b)}}return s(t),a},te=(t,n)=>ve(t,n),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},pe=t=>ve(Qe,t,!0),$e=p.forwardRef((t,n)=>{const{className:r,children:a,id:s,columns:u,...m}=t;return h.assertEmpty(m),l.jsx("div",{className:r,style:{gridTemplateColumns:`repeat(${u}, 1fr)`},ref:n,id:s,role:"grid",children:a})}),et=p.forwardRef((t,n)=>{const{className:r,children:a,columns:s,...u}=t;return h.assertEmpty(u),l.jsx(d.Group,{className:r,style:{gridColumn:`1 / ${s+1}`},ref:n,children:l.jsx(d.Group,{className:"bn-mt-suggestion-menu-item-title",children:a})})}),tt=p.forwardRef((t,n)=>{const{className:r,isSelected:a,onClick:s,item:u,id:m,...c}=t;h.assertEmpty(c);const f=p.useRef(null);return p.useEffect(()=>{if(!f.current||!a)return;const b=L.elementOverflow(f.current);b==="top"?f.current.scrollIntoView(!0):b==="bottom"&&f.current.scrollIntoView(!1)},[a]),l.jsx("div",{className:r,ref:A.mergeRefs(n,f),id:m,role:"option",onClick:s,"aria-selected":a||void 0,children:u.icon})}),rt=p.forwardRef((t,n)=>{const{className:r,children:a,columns:s,...u}=t;return h.assertEmpty(u),l.jsx(d.Loader,{className:r,style:{gridColumn:`1 / ${s+1}`},type:"dots",ref:n})});var be={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ge=D.default.createContext&&D.default.createContext(be),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 q(){return q=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},q.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){st(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 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 ye(t){return t&&t.map((n,r)=>D.default.createElement(n.tag,H({key:r},n.attr),ye(n.child)))}function xe(t){return n=>D.default.createElement(ut,q({attr:H({},t.attr)},n),ye(t.child))}function ut(t){var n=r=>{var{attr:a,size:s,title:u}=t,m=at(t,nt),c=s||r.size||"1em",f;return r.className&&(f=r.className),t.className&&(f=(f?f+" ":"")+t.className),D.default.createElement("svg",q({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,a,m,{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&&D.default.createElement("title",null,u),t.children)};return ge!==void 0?D.default.createElement(ge.Consumer,null,r=>n(r)):n(be)}function ct(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 ft(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=p.createContext(void 0),dt=p.forwardRef((t,n)=>{const{children:r,onOpenChange:a,position:s,sub:u,...m}=t;h.assertEmpty(m);const[c,f]=p.useState(!1),b=p.useRef(null),E=p.useRef(),k=p.useCallback(()=>{E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{f(!1)},250)},[]),C=p.useCallback(()=>{E.current&&clearTimeout(E.current),f(!0)},[]);return l.jsx(Ee.Provider,{value:{onMenuMouseOver:C,onMenuMouseLeave:k},children:l.jsx(d.Menu.Item,{className:"bn-menu-item bn-mt-sub-menu-item",ref:A.mergeRefs(n,b),onMouseOver:C,onMouseLeave:k,children:l.jsx(d.Menu,{portalProps:{target:b.current?b.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})})})}),mt=t=>{const{children:n,onOpenChange:r,position:a,sub:s,...u}=t;return h.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})},vt=p.forwardRef((t,n)=>{const{className:r,children:a,icon:s,checked:u,subTrigger:m,onClick:c,...f}=t;return h.assertEmpty(f,!1),m?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})}),pt=t=>{const{children:n,sub:r,...a}=t;return h.assertEmpty(a),l.jsx(d.Menu.Target,{children:n})},bt=p.forwardRef((t,n)=>{const{className:r,children:a,sub:s,...u}=t;h.assertEmpty(u);const m=p.useContext(Ee);return l.jsx(d.Menu.Dropdown,{className:r,ref:n,onMouseOver:m==null?void 0:m.onMenuMouseOver,onMouseLeave:m==null?void 0:m.onMenuMouseLeave,children:a})}),gt=p.forwardRef((t,n)=>{const{className:r,...a}=t;return h.assertEmpty(a),l.jsx(d.Menu.Divider,{className:r,ref:n})}),ht=p.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return h.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:m,loading:c,...f}=t;return h.assertEmpty(f),l.jsx(d.Group,{className:r,ref:n,children:l.jsxs(d.Tabs,{value:u,defaultValue:s,onChange:m,children:[c&&l.jsx(d.LoadingOverlay,{visible:c}),l.jsx(d.Tabs.List,{children:a.map(b=>l.jsx(d.Tabs.Tab,{"data-test":`${b.name.toLowerCase()}-tab`,value:b.name,children:b.name},b.name))}),a.map(b=>l.jsx(d.Tabs.Panel,{value:b.name,children:b.tabPanel},b.name))]})})}),xt=p.forwardRef((t,n)=>{const{className:r,children:a,onClick:s,label:u,...m}=t;return h.assertEmpty(m),l.jsx(d.Button,{size:"xs","aria-label":u,className:r,ref:n,onClick:s,...m,children:a})}),Et=p.forwardRef((t,n)=>{const{className:r,accept:a,value:s,placeholder:u,onChange:m,...c}=t;return h.assertEmpty(c),l.jsx(d.FileInput,{size:"xs",className:r,ref:n,accept:a,value:s,placeholder:u,onChange:m,...c})}),wt=p.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return h.assertEmpty(s),l.jsx("div",{className:r,ref:n,children:a})}),jt=p.forwardRef((t,n)=>{const{className:r,value:a,placeholder:s,onKeyDown:u,onChange:m,...c}=t;return h.assertEmpty(c),l.jsx(d.TextInput,{size:"xs","data-test":"embed-input",className:r,ref:n,value:a,placeholder:s,onKeyDown:u,onChange:m})}),St=t=>{const{children:n,opened:r,position:a,...s}=t;return h.assertEmpty(s),l.jsx(d.Popover,{withinPortal:!1,zIndex:1e4,opened:r,position:a,children:n})},Tt=t=>{const{children:n,...r}=t;return h.assertEmpty(r),l.jsx(d.PopoverTarget,{children:n})},kt=p.forwardRef((t,n)=>{const{className:r,children:a,variant:s,...u}=t;return h.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 h.assertEmpty(s,!1),l.jsx(d.Group,{align:"center",gap:0,className:r,ref:n,...s,children:a})}),Ct=p.forwardRef((t,n)=>{const{className:r,children:a,icon:s,onClick:u,onDragEnd:m,onDragStart:c,draggable:f,label:b,...E}=t;return h.assertEmpty(E,!1),s?l.jsx(d.ActionIcon,{size:24,className:r,ref:n,onClick:u,onDragEnd:m,onDragStart:c,draggable:f,"aria-label":b,...E,children:s}):l.jsx(d.Button,{className:r,ref:n,onClick:u,onDragEnd:m,onDragStart:c,draggable:f,"aria-label":b,...E,children:a})}),_t=p.forwardRef((t,n)=>{const{className:r,children:a,id:s,...u}=t;return h.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 h.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:m,...c}=t;h.assertEmpty(c);const f=p.useRef(null);return p.useEffect(()=>{if(!f.current||!a)return;const b=L.elementOverflow(f.current);b==="top"?f.current.scrollIntoView(!0):b==="bottom"&&f.current.scrollIntoView(!1)},[a]),l.jsxs(d.Group,{gap:0,className:r,ref:A.mergeRefs(n,f),id:m,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 h.assertEmpty(s),l.jsx(d.Group,{className:r,ref:n,children:a})}),Mt=p.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return h.assertEmpty(s),l.jsx(d.Loader,{className:r,type:"dots",ref:n})}),Dt=p.forwardRef((t,n)=>{const{className:r,children:a,draggable:s,onDragStart:u,onDragEnd:m,style:c,label:f,...b}=t;return h.assertEmpty(b,!1),l.jsx(d.Button,{className:r,ref:n,"aria-label":f,draggable:s,onDragStart:u,onDragEnd:m,style:c,...b,children:a})}),Nt=p.forwardRef((t,n)=>{const{className:r,name:a,label:s,icon:u,value:m,autoFocus:c,placeholder:f,onKeyDown:b,onChange:E,onSubmit:k,...C}=t;return h.assertEmpty(C),l.jsx(d.TextInput,{size:"xs",className:r,ref:n,name:a,label:s,leftSection:u,value:m,autoFocus:c,"data-autofocus":c?"true":void 0,placeholder:f,onKeyDown:b,onChange:E,onSubmit:k})}),we=p.forwardRef((t,n)=>{const{className:r,children:a,onMouseEnter:s,onMouseLeave:u,...m}=t;h.assertEmpty(m);const{ref:c,focused:f}=A.useFocusWithin(),b=A.useFocusTrap(f),E=A.mergeRefs(n,c,b);return l.jsx(d.Group,{className:r,ref:E,role:"toolbar",onMouseEnter:s,onMouseLeave:u,children:a})}),It=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})]}),je=p.forwardRef((t,n)=>{const{className:r,children:a,mainTooltip:s,secondaryTooltip:u,icon:m,isSelected:c,isDisabled:f,onClick:b,label:E,...k}=t;return h.assertEmpty(k,!1),l.jsx(d.Tooltip,{withinPortal:!1,label:l.jsx(It,{mainTooltip:s,secondaryTooltip:u}),children:a?l.jsx(d.Button,{"aria-label":E,className:r,onMouseDown:C=>{h.isSafari()&&C.currentTarget.focus()},onClick:b,"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,...k,children:a}):l.jsx(d.ActionIcon,{className:r,"aria-label":E,onMouseDown:C=>{h.isSafari()&&C.currentTarget.focus()},onClick:b,"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,...k,children:m})})}),Lt=p.forwardRef((t,n)=>{const{className:r,items:a,isDisabled:s,...u}=t;h.assertEmpty(u);const m=a.filter(c=>c.isSelected)[0];return m?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=>{h.isSafari()&&c.currentTarget.focus()},leftSection:m.icon,rightSection:l.jsx(ct,{}),size:"xs",variant:"subtle",disabled:s,children:m.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}),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'},At={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},Se={FormattingToolbar:{Root:we,Button:je,Select:Lt},FilePanel:{Root:yt,Button:xt,FileInput:Et,TabPanel:wt,TextInput:jt},GridSuggestionMenu:{Root:$e,Item:tt,EmptyItem:et,Loader:rt},LinkToolbar:{Root:we,Button:je},SideMenu:{Root:Rt,Button:Ct},SuggestionMenu:{Root:_t,Item:Ot,EmptyItem:Pt,Label:Ft,Loader:Mt},TableHandle:{Root:Dt},Generic:{Form:{Root:t=>l.jsx("div",{children:t.children}),TextInput:Nt},Menu:{Root:mt,Trigger:pt,Dropdown:bt,Divider:gt,Label:ht,Item:vt},Popover:{Root:St,Trigger:Tt,Content:kt}}},Bt={activeClassName:""},zt=t=>{const{className:n,theme:r,...a}=t,s=L.useBlockNoteContext(),u=L.usePrefersColorScheme(),m=(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[m==="dark"?"dark":"light"],f);return}te(r,f);return}},[m,r]);return l.jsx(L.ComponentsContext.Provider,{value:Se,children:l.jsx(d.MantineProvider,{theme:Bt,cssVariablesSelector:".bn-mantine",getRootElement:()=>{},children:l.jsx(L.BlockNoteViewRaw,{className:h.mergeCSSClasses("bn-mantine",n||""),theme:typeof r=="object"?void 0:r,...a,ref:c})})})};R.BlockNoteView=zt,R.applyBlockNoteCSSVariablesFromTheme=te,R.components=Se,R.darkDefaultTheme=At,R.defaultColorScheme=x,R.lightDefaultTheme=re,R.removeBlockNoteCSSVariables=pe,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|
|
30
|
+
<%s key={someKey} {...props} />`,fe,I,wr,I),He[I+fe]=!0}}return e===a?gr(T):br(T),T}}function hr(e,o,i){return Je(e,o,i,!0)}function yr(e,o,i){return Je(e,o,i,!1)}var xr=yr,Er=hr;G.Fragment=a,G.jsx=xr,G.jsxs=Er}()),G}process.env.NODE_ENV==="production"?ee.exports=Xe():ee.exports=Ze();var l=ee.exports;const ve=(t,n,r=!1)=>{const a=[];function s(u,m="--bn"){for(const c in u){const f=c.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),b=`${m}-${f}`;typeof u[c]!="object"?(typeof u[c]=="number"&&(u[c]=`${u[c]}px`),r?n.style.removeProperty(b):n.style.setProperty(b,u[c].toString())):s(u[c],b)}}return s(t),a},te=(t,n)=>ve(t,n),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},pe=t=>ve(Qe,t,!0),$e=p.forwardRef((t,n)=>{const{className:r,children:a,id:s,columns:u,...m}=t;return h.assertEmpty(m),l.jsx("div",{className:r,style:{gridTemplateColumns:`repeat(${u}, 1fr)`},ref:n,id:s,role:"grid",children:a})}),et=p.forwardRef((t,n)=>{const{className:r,children:a,columns:s,...u}=t;return h.assertEmpty(u),l.jsx(d.Group,{className:r,style:{gridColumn:`1 / ${s+1}`},ref:n,children:l.jsx(d.Group,{className:"bn-mt-suggestion-menu-item-title",children:a})})}),tt=p.forwardRef((t,n)=>{const{className:r,isSelected:a,onClick:s,item:u,id:m,...c}=t;h.assertEmpty(c);const f=p.useRef(null);return p.useEffect(()=>{if(!f.current||!a)return;const b=L.elementOverflow(f.current,document.querySelector(".bn-grid-suggestion-menu"));b==="top"?f.current.scrollIntoView(!0):b==="bottom"&&f.current.scrollIntoView(!1)},[a]),l.jsx("div",{className:r,ref:A.mergeRefs(n,f),id:m,role:"option",onClick:s,"aria-selected":a||void 0,children:u.icon})}),rt=p.forwardRef((t,n)=>{const{className:r,children:a,columns:s,...u}=t;return h.assertEmpty(u),l.jsx(d.Loader,{className:r,style:{gridColumn:`1 / ${s+1}`},type:"dots",ref:n})});var be={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ge=D.default.createContext&&D.default.createContext(be),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 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){st(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 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 ye(t){return t&&t.map((n,r)=>D.default.createElement(n.tag,H({key:r},n.attr),ye(n.child)))}function xe(t){return n=>D.default.createElement(ut,K({attr:H({},t.attr)},n),ye(t.child))}function ut(t){var n=r=>{var{attr:a,size:s,title:u}=t,m=at(t,nt),c=s||r.size||"1em",f;return r.className&&(f=r.className),t.className&&(f=(f?f+" ":"")+t.className),D.default.createElement("svg",K({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,a,m,{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&&D.default.createElement("title",null,u),t.children)};return ge!==void 0?D.default.createElement(ge.Consumer,null,r=>n(r)):n(be)}function ct(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 ft(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=p.createContext(void 0),dt=p.forwardRef((t,n)=>{const{children:r,onOpenChange:a,position:s,sub:u,...m}=t;h.assertEmpty(m);const[c,f]=p.useState(!1),b=p.useRef(null),E=p.useRef(),k=p.useCallback(()=>{E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{f(!1)},250)},[]),C=p.useCallback(()=>{E.current&&clearTimeout(E.current),f(!0)},[]);return l.jsx(Ee.Provider,{value:{onMenuMouseOver:C,onMenuMouseLeave:k},children:l.jsx(d.Menu.Item,{className:"bn-menu-item bn-mt-sub-menu-item",ref:A.mergeRefs(n,b),onMouseOver:C,onMouseLeave:k,children:l.jsx(d.Menu,{portalProps:{target:b.current?b.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})})})}),mt=t=>{const{children:n,onOpenChange:r,position:a,sub:s,...u}=t;return h.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})},vt=p.forwardRef((t,n)=>{const{className:r,children:a,icon:s,checked:u,subTrigger:m,onClick:c,...f}=t;return h.assertEmpty(f,!1),m?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})}),pt=t=>{const{children:n,sub:r,...a}=t;return h.assertEmpty(a),l.jsx(d.Menu.Target,{children:n})},bt=p.forwardRef((t,n)=>{const{className:r,children:a,sub:s,...u}=t;h.assertEmpty(u);const m=p.useContext(Ee);return l.jsx(d.Menu.Dropdown,{className:r,ref:n,onMouseOver:m==null?void 0:m.onMenuMouseOver,onMouseLeave:m==null?void 0:m.onMenuMouseLeave,children:a})}),gt=p.forwardRef((t,n)=>{const{className:r,...a}=t;return h.assertEmpty(a),l.jsx(d.Menu.Divider,{className:r,ref:n})}),ht=p.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return h.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:m,loading:c,...f}=t;return h.assertEmpty(f),l.jsx(d.Group,{className:r,ref:n,children:l.jsxs(d.Tabs,{value:u,defaultValue:s,onChange:m,children:[c&&l.jsx(d.LoadingOverlay,{visible:c}),l.jsx(d.Tabs.List,{children:a.map(b=>l.jsx(d.Tabs.Tab,{"data-test":`${b.name.toLowerCase()}-tab`,value:b.name,children:b.name},b.name))}),a.map(b=>l.jsx(d.Tabs.Panel,{value:b.name,children:b.tabPanel},b.name))]})})}),xt=p.forwardRef((t,n)=>{const{className:r,children:a,onClick:s,label:u,...m}=t;return h.assertEmpty(m),l.jsx(d.Button,{size:"xs","aria-label":u,className:r,ref:n,onClick:s,...m,children:a})}),Et=p.forwardRef((t,n)=>{const{className:r,accept:a,value:s,placeholder:u,onChange:m,...c}=t;return h.assertEmpty(c),l.jsx(d.FileInput,{size:"xs",className:r,ref:n,accept:a,value:s,placeholder:u,onChange:m,...c})}),wt=p.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return h.assertEmpty(s),l.jsx("div",{className:r,ref:n,children:a})}),jt=p.forwardRef((t,n)=>{const{className:r,value:a,placeholder:s,onKeyDown:u,onChange:m,...c}=t;return h.assertEmpty(c),l.jsx(d.TextInput,{size:"xs","data-test":"embed-input",className:r,ref:n,value:a,placeholder:s,onKeyDown:u,onChange:m})}),St=t=>{const{children:n,opened:r,position:a,...s}=t;return h.assertEmpty(s),l.jsx(d.Popover,{withinPortal:!1,zIndex:1e4,opened:r,position:a,children:n})},Tt=t=>{const{children:n,...r}=t;return h.assertEmpty(r),l.jsx(d.PopoverTarget,{children:n})},kt=p.forwardRef((t,n)=>{const{className:r,children:a,variant:s,...u}=t;return h.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 h.assertEmpty(s,!1),l.jsx(d.Group,{align:"center",gap:0,className:r,ref:n,...s,children:a})}),Ct=p.forwardRef((t,n)=>{const{className:r,children:a,icon:s,onClick:u,onDragEnd:m,onDragStart:c,draggable:f,label:b,...E}=t;return h.assertEmpty(E,!1),s?l.jsx(d.ActionIcon,{size:24,className:r,ref:n,onClick:u,onDragEnd:m,onDragStart:c,draggable:f,"aria-label":b,...E,children:s}):l.jsx(d.Button,{className:r,ref:n,onClick:u,onDragEnd:m,onDragStart:c,draggable:f,"aria-label":b,...E,children:a})}),_t=p.forwardRef((t,n)=>{const{className:r,children:a,id:s,...u}=t;return h.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 h.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:m,...c}=t;h.assertEmpty(c);const f=p.useRef(null);return p.useEffect(()=>{if(!f.current||!a)return;const b=L.elementOverflow(f.current,document.querySelector(".bn-suggestion-menu"));b==="top"?f.current.scrollIntoView(!0):b==="bottom"&&f.current.scrollIntoView(!1)},[a]),l.jsxs(d.Group,{gap:0,className:r,ref:A.mergeRefs(n,f),id:m,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 h.assertEmpty(s),l.jsx(d.Group,{className:r,ref:n,children:a})}),Mt=p.forwardRef((t,n)=>{const{className:r,children:a,...s}=t;return h.assertEmpty(s),l.jsx(d.Loader,{className:r,type:"dots",ref:n})}),Dt=p.forwardRef((t,n)=>{const{className:r,children:a,draggable:s,onDragStart:u,onDragEnd:m,style:c,label:f,...b}=t;return h.assertEmpty(b,!1),l.jsx(d.Button,{className:r,ref:n,"aria-label":f,draggable:s,onDragStart:u,onDragEnd:m,style:c,...b,children:a})}),Nt=p.forwardRef((t,n)=>{const{className:r,name:a,label:s,icon:u,value:m,autoFocus:c,placeholder:f,onKeyDown:b,onChange:E,onSubmit:k,...C}=t;return h.assertEmpty(C),l.jsx(d.TextInput,{size:"xs",className:r,ref:n,name:a,label:s,leftSection:u,value:m,autoFocus:c,"data-autofocus":c?"true":void 0,placeholder:f,onKeyDown:b,onChange:E,onSubmit:k})}),we=p.forwardRef((t,n)=>{const{className:r,children:a,onMouseEnter:s,onMouseLeave:u,...m}=t;h.assertEmpty(m);const{ref:c,focused:f}=A.useFocusWithin(),b=A.useFocusTrap(f),E=A.mergeRefs(n,c,b);return l.jsx(d.Group,{className:r,ref:E,role:"toolbar",onMouseEnter:s,onMouseLeave:u,children:a})}),It=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})]}),je=p.forwardRef((t,n)=>{const{className:r,children:a,mainTooltip:s,secondaryTooltip:u,icon:m,isSelected:c,isDisabled:f,onClick:b,label:E,...k}=t;return h.assertEmpty(k,!1),l.jsx(d.Tooltip,{withinPortal:!1,label:l.jsx(It,{mainTooltip:s,secondaryTooltip:u}),children:a?l.jsx(d.Button,{"aria-label":E,className:r,onMouseDown:C=>{h.isSafari()&&C.currentTarget.focus()},onClick:b,"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,...k,children:a}):l.jsx(d.ActionIcon,{className:r,"aria-label":E,onMouseDown:C=>{h.isSafari()&&C.currentTarget.focus()},onClick:b,"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,...k,children:m})})}),Lt=p.forwardRef((t,n)=>{const{className:r,items:a,isDisabled:s,...u}=t;h.assertEmpty(u);const m=a.filter(c=>c.isSelected)[0];return m?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=>{h.isSafari()&&c.currentTarget.focus()},leftSection:m.icon,rightSection:l.jsx(ct,{}),size:"xs",variant:"subtle",disabled:s,children:m.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}),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'},At={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},Se={FormattingToolbar:{Root:we,Button:je,Select:Lt},FilePanel:{Root:yt,Button:xt,FileInput:Et,TabPanel:wt,TextInput:jt},GridSuggestionMenu:{Root:$e,Item:tt,EmptyItem:et,Loader:rt},LinkToolbar:{Root:we,Button:je},SideMenu:{Root:Rt,Button:Ct},SuggestionMenu:{Root:_t,Item:Ot,EmptyItem:Pt,Label:Ft,Loader:Mt},TableHandle:{Root:Dt},Generic:{Form:{Root:t=>l.jsx("div",{children:t.children}),TextInput:Nt},Menu:{Root:mt,Trigger:pt,Dropdown:bt,Divider:gt,Label:ht,Item:vt},Popover:{Root:St,Trigger:Tt,Content:kt}}},Bt={activeClassName:""},zt=t=>{const{className:n,theme:r,...a}=t,s=L.useBlockNoteContext(),u=L.usePrefersColorScheme(),m=(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[m==="dark"?"dark":"light"],f);return}te(r,f);return}},[m,r]);return l.jsx(L.ComponentsContext.Provider,{value:Se,children:l.jsx(d.MantineProvider,{theme:Bt,cssVariablesSelector:".bn-mantine",getRootElement:()=>{},children:l.jsx(L.BlockNoteViewRaw,{className:h.mergeCSSClasses("bn-mantine",n||""),theme:typeof r=="object"?void 0:r,...a,ref:c})})})};R.BlockNoteView=zt,R.applyBlockNoteCSSVariablesFromTheme=te,R.components=Se,R.darkDefaultTheme=At,R.defaultColorScheme=x,R.lightDefaultTheme=re,R.removeBlockNoteCSSVariables=pe,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
|
|
31
31
|
//# sourceMappingURL=blocknote-mantine.umd.cjs.map
|