Last Sync: 2026-04-01 16:40 (Mobile)
This commit is contained in:
1 parent
6b24559ae6
commit
dcabdd12ab
11 files changed
+5467
-8
No files matched your search
Vendored
+3
-1
@@ -4,5 +4,7 @@
|
||||
"remotely-save",
|
||||
"obsidian-kanban",
|
||||
"dataview",
|
||||
"obsidian-style-settings"
|
||||
"obsidian-style-settings",
|
||||
"obsidian42-brat",
|
||||
"notion-bases"
|
||||
]
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
||||
if you want to view the source, please visit the github repository of this plugin
|
||||
*/
|
||||
|
||||
var ob=Object.create;var xa=Object.defineProperty;var rb=Object.getOwnPropertyDescriptor;var ib=Object.getOwnPropertyNames;var lb=Object.getPrototypeOf,ab=Object.prototype.hasOwnProperty;var Ao=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),sb=(e,t)=>{for(var n in t)xa(e,n,{get:t[n],enumerable:!0})},fm=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ib(t))!ab.call(e,r)&&r!==n&&xa(e,r,{get:()=>t[r],enumerable:!(o=rb(t,r))||o.enumerable});return e};var ze=(e,t,n)=>(n=e!=null?ob(lb(e)):{},fm(t||!e||!e.__esModule?xa(n,"default",{value:e,enumerable:!0}):n,e)),ub=e=>fm(xa({},"__esModule",{value:!0}),e);var Mm=Ao(lt=>{"use strict";var il=Symbol.for("react.element"),vb=Symbol.for("react.portal"),bb=Symbol.for("react.fragment"),yb=Symbol.for("react.strict_mode"),wb=Symbol.for("react.profiler"),Cb=Symbol.for("react.provider"),kb=Symbol.for("react.context"),Sb=Symbol.for("react.forward_ref"),Nb=Symbol.for("react.suspense"),xb=Symbol.for("react.memo"),Rb=Symbol.for("react.lazy"),ym=Symbol.iterator;function Eb(e){return e===null||typeof e!="object"?null:(e=ym&&e[ym]||e["@@iterator"],typeof e=="function"?e:null)}var km={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Sm=Object.assign,Nm={};function ci(e,t,n){this.props=e,this.context=t,this.refs=Nm,this.updater=n||km}ci.prototype.isReactComponent={};ci.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ci.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function xm(){}xm.prototype=ci.prototype;function Xu(e,t,n){this.props=e,this.context=t,this.refs=Nm,this.updater=n||km}var Qu=Xu.prototype=new xm;Qu.constructor=Xu;Sm(Qu,ci.prototype);Qu.isPureReactComponent=!0;var wm=Array.isArray,Rm=Object.prototype.hasOwnProperty,Zu={current:null},Em={key:!0,ref:!0,__self:!0,__source:!0};function Fm(e,t,n){var o,r={},i=null,l=null;if(t!=null)for(o in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)Rm.call(t,o)&&!Em.hasOwnProperty(o)&&(r[o]=t[o]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];r.children=s}if(e&&e.defaultProps)for(o in a=e.defaultProps,a)r[o]===void 0&&(r[o]=a[o]);return{$$typeof:il,type:e,key:i,ref:l,props:r,_owner:Zu.current}}function Fb(e,t){return{$$typeof:il,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ju(e){return typeof e=="object"&&e!==null&&e.$$typeof===il}function Db(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Cm=/\/+/g;function Yu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Db(""+e.key):t.toString(36)}function Ea(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case il:case vb:l=!0}}if(l)return l=e,r=r(l),e=o===""?"."+Yu(l,0):o,wm(r)?(n="",e!=null&&(n=e.replace(Cm,"$&/")+"/"),Ea(r,t,n,"",function(c){return c})):r!=null&&(Ju(r)&&(r=Fb(r,n+(!r.key||l&&l.key===r.key?"":(""+r.key).replace(Cm,"$&/")+"/")+e)),t.push(r)),1;if(l=0,o=o===""?".":o+":",wm(e))for(var a=0;a<e.length;a++){i=e[a];var s=o+Yu(i,a);l+=Ea(i,t,n,s,r)}else if(s=Eb(e),typeof s=="function")for(e=s.call(e),a=0;!(i=e.next()).done;)i=i.value,s=o+Yu(i,a++),l+=Ea(i,t,n,s,r);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function Ra(e,t,n){if(e==null)return e;var o=[],r=0;return Ea(e,o,"","",function(i){return t.call(n,i,r++)}),o}function Mb(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var hn={current:null},Fa={transition:null},Tb={ReactCurrentDispatcher:hn,ReactCurrentBatchConfig:Fa,ReactCurrentOwner:Zu};function Dm(){throw Error("act(...) is not supported in production builds of React.")}lt.Children={map:Ra,forEach:function(e,t,n){Ra(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ra(e,function(){t++}),t},toArray:function(e){return Ra(e,function(t){return t})||[]},only:function(e){if(!Ju(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};lt.Component=ci;lt.Fragment=bb;lt.Profiler=wb;lt.PureComponent=Xu;lt.StrictMode=yb;lt.Suspense=Nb;lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Tb;lt.act=Dm;lt.cloneElement=function(e,t,n){if(e==nLine truncated
|
||||
`+uc+e}var cc=!1;function dc(e,t){if(!e||cc)return"";cc=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var o=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){o=c}e.call(t.prototype)}else{try{throw Error()}catch(c){o=c}e()}}catch(c){if(c&&o&&typeof c.stack=="string"){for(var r=c.stack.split(`
|
||||
`),i=o.stack.split(`
|
||||
`),l=r.length-1,a=i.length-1;1<=l&&0<=a&&r[l]!==i[a];)a--;for(;1<=l&&0<=a;l--,a--)if(r[l]!==i[a]){if(l!==1||a!==1)do if(l--,a--,0>a||r[l]!==i[a]){var s=`
|
||||
`+r[l].replace(" at new "," at ");return e.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",e.displayName)),s}while(1<=l&&0<=a);break}}}finally{cc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?_l(e):""}function zb(e){switch(e.tag){case 5:return _l(e.type);case 16:return _l("Lazy");case 13:return _l("Suspense");case 19:return _l("SuspenseList");case 0:case 2:case 15:return e=dc(e.type,!1),e;case 11:return e=dc(e.type.render,!1),e;case 1:return e=dc(e.type,!0),e;default:return""}}function Ic(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case fi:return"Fragment";case mi:return"Portal";case Tc:return"Profiler";case xd:return"StrictMode";case Lc:return"Suspense";case Pc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case eg:return(e.displayName||"Context")+".Consumer";case Jf:return(e._context.displayName||"Context")+".Provider";case Rd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ed:return t=e.displayName||null,t!==null?t:Ic(e.type)||"Memo";case Qo:t=e._payload,e=e._init;try{return Ic(e(t))}catch{}}return null}function Vb(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ic(t);case 8:return t===xd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function dr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ng(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Bb(e){var t=ng(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),o=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(l){o=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return o},setValue:function(l){o=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Aa(e){e._valueTracker||(e._valueTracker=Bb(e))}function og(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),o="";return e&&(o=ng(e)?e.checked?"true":"false":e.value),e=o,e!==n?(t.setValue(e),!0):!1}function cs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Ac(e,t){var n=t.checked;return Pt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Km(e,t){var n=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;n=dr(t.value!=null?t.value:n),e._wrapperState={initialChecked:o,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function rg(e,t){t=t.checked,t!=null&&Nd(e,"checked",t,!1)}function Oc(e,t){rg(e,t);var n=dr(t.value),o=t.type;if(n!=null)o==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?$c(e,t.type,n):t.hasOwnProperty("defaultValue")&&$c(e,t.type,dr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ym(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var o=t.type;if(!(o!=="submit"&&o!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function $c(e,t,n){(t!=="number"||cs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var vl=Array.isArray;function Ni(e,t,n,o){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&o&&(e[n].defaultSelected=!0)}else{for(n=""+dr(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,o&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function zc(e,t){if(t.dan
Line truncated
|
||||
`).replace(Yy,"")}function Ka(e,t,n){if(t=yf(t),yf(e)!==t&&n)throw Error(fe(425))}function vs(){}var Zc=null,Jc=null;function ed(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var td=typeof setTimeout=="function"?setTimeout:void 0,Xy=typeof clearTimeout=="function"?clearTimeout:void 0,wf=typeof Promise=="function"?Promise:void 0,Qy=typeof queueMicrotask=="function"?queueMicrotask:typeof wf<"u"?function(e){return wf.resolve(null).then(e).catch(Zy)}:td;function Zy(e){setTimeout(function(){throw e})}function wc(e,t){var n=t,o=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(o===0){e.removeChild(r),Il(t);return}o--}else n!=="$"&&n!=="$?"&&n!=="$!"||o++;n=r}while(n);Il(t)}function lr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Cf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var zi=Math.random().toString(36).slice(2),Ro="__reactFiber$"+zi,Vl="__reactProps$"+zi,Ho="__reactContainer$"+zi,nd="__reactEvents$"+zi,Jy="__reactListeners$"+zi,ew="__reactHandles$"+zi;function Ir(e){var t=e[Ro];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ho]||n[Ro]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cf(e);e!==null;){if(n=e[Ro])return n;e=Cf(e)}return t}e=n,n=e.parentNode}return null}function Yl(e){return e=e[Ro]||e[Ho],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function vi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(fe(33))}function $s(e){return e[Vl]||null}var od=[],bi=-1;function fr(e){return{current:e}}function xt(e){0>bi||(e.current=od[bi],od[bi]=null,bi--)}function Ct(e,t){bi++,od[bi]=e.current,e.current=t}var pr={},dn=fr(pr),Rn=fr(!1),Vr=pr;function Ti(e,t){var n=e.type.contextTypes;if(!n)return pr;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var r={},i;for(i in n)r[i]=t[i];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function En(e){return e=e.childContextTypes,e!=null}function bs(){xt(Rn),xt(dn)}function kf(e,t,n){if(dn.current!==pr)throw Error(fe(168));Ct(dn,t),Ct(Rn,n)}function Gg(e,t,n){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return n;o=o.getChildContext();for(var r in o)if(!(r in t))throw Error(fe(108,Vb(e)||"Unknown",r));return Pt({},n,o)}function ys(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||pr,Vr=dn.current,Ct(dn,e),Ct(Rn,Rn.current),!0}function Sf(e,t,n){var o=e.stateNode;if(!o)throw Error(fe(169));n?(e=Gg(e,t,Vr),o.__reactInternalMemoizedMergedChildContext=e,xt(Rn),xt(dn),Ct(dn,e)):xt(Rn),Ct(Rn,n)}var $o=null,zs=!1,Cc=!1;function qg(e){$o===null?$o=[e]:$o.push(e)}function tw(e){zs=!0,qg(e)}function gr(){if(!Cc&&$o!==null){Cc=!0;var e=0,t=ht;try{var n=$o;for(ht=1;e<n.length;e++){var o=n[e];do o=o(!0);while(o!==null)}$o=null,zs=!1}catch(r){throw $o!==null&&($o=$o.slice(e+1)),vg(Dd,gr),r}finally{ht=t,Cc=!1}}return null}var yi=[],wi=0,ws=null,Cs=0,Qn=[],Zn=0,Br=null,zo=1,Vo="";function Lr(e,t){yi[wi++]=Cs,yi[wi++]=ws,ws=e,Cs=t}function Kg(e,t,n){Qn[Zn++]=zo,Qn[Zn++]=Vo,Qn[Zn++]=Br,Br=e;var o=zo;e=Vo;var r=32-go(o)-1;o&=~(1<<r),n+=1;var i=32-go(t)+r;if(30<i){var l=r-r%5;i=(o&(1<<l)-1).toString(32),o>>=l,r-=l,zo=1<<32-go(t)+r|n<<r|o,Vo=i+e}else zo=1<<i|n<<r|o,Vo=e}function zd(e){e.return!==null&&(Lr(e,1),Kg(e,1,0))}function Vd(e){for(;e===ws;)ws=yi[--wi],yi[wi]=null,Cs=yi[--wi],yi[wi]=null;for(;e===Br;)Br=Qn[--Zn],Qn[Zn]=null,Vo=Qn[--Zn],Qn[Zn]=null,zo=Qn[--Zn],Qn[Zn]=null}var Bn=null,Vn=null,Ft=!1,fo=null;function Yg(e,t){var n=Jn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Nf(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Bn=e,Vn=lr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Bn=e,Vn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Br!==null?{id:zo,overflow:Vo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Jn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Bn=e,Vn=null,!0):!1;default:return!1}}function rd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function id(e){if(Ft){var t=Vn;if(t){var n=t;if(!Nf(e,t)){if(rd(e))throw Error(fe(418));t=lr(n.nextSibling);var o=Bn;t&&Nf(e,t)?Yg(o,n):(e.flags=e.flags&-4097|2,Ft=!1,Bn=e)}}else{if(rd(e))throw Error(fe(418));e.flags=e.flags&-4097|2,Ft=!1,Bn=e}}}function xf(e){
Line truncated
|
||||
Error generating stack: `+i.message+`
|
||||
`+i.stack}return{value:e,source:t,stack:r,digest:null}}function Rc(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ud(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var cw=typeof WeakMap=="function"?WeakMap:Map;function Ch(e,t,n){n=Bo(-1,n),n.tag=3,n.payload={element:null};var o=t.value;return n.callback=function(){Ds||(Ds=!0,bd=o),ud(e,t)},n}function kh(e,t,n){n=Bo(-1,n),n.tag=3;var o=e.type.getDerivedStateFromError;if(typeof o=="function"){var r=t.value;n.payload=function(){return o(r)},n.callback=function(){ud(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){ud(e,t),typeof o!="function"&&(sr===null?sr=new Set([this]):sr.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function Pf(e,t,n){var o=e.pingCache;if(o===null){o=e.pingCache=new cw;var r=new Set;o.set(t,r)}else r=o.get(t),r===void 0&&(r=new Set,o.set(t,r));r.has(n)||(r.add(n),e=Sw.bind(null,e,t,n),t.then(e,e))}function If(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Af(e,t,n,o,r){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Bo(-1,1),t.tag=2,ar(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=r,e)}var dw=Go.ReactCurrentOwner,xn=!1;function _n(e,t,n,o){t.child=e===null?Zg(t,null,n,o):Pi(t,e.child,n,o)}function Of(e,t,n,o,r){n=n.render;var i=t.ref;return Fi(t,r),o=Qd(e,t,n,o,i,r),n=Zd(),e!==null&&!xn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Wo(e,t,r)):(Ft&&n&&zd(t),t.flags|=1,_n(e,t,o,r),t.child)}function $f(e,t,n,o,r){if(e===null){var i=n.type;return typeof i=="function"&&!sp(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Sh(e,t,i,o,r)):(e=us(n.type,null,o,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,(e.lanes&r)===0){var l=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ol,n(l,o)&&e.ref===t.ref)return Wo(e,t,r)}return t.flags|=1,e=cr(i,o),e.ref=t.ref,e.return=t,t.child=e}function Sh(e,t,n,o,r){if(e!==null){var i=e.memoizedProps;if(Ol(i,o)&&e.ref===t.ref)if(xn=!1,t.pendingProps=o=i,(e.lanes&r)!==0)(e.flags&131072)!==0&&(xn=!0);else return t.lanes=e.lanes,Wo(e,t,r)}return cd(e,t,n,o,r)}function Nh(e,t,n){var o=t.pendingProps,r=o.children,i=e!==null?e.memoizedState:null;if(o.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ct(Si,zn),zn|=n;else{if((n&1073741824)===0)return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ct(Si,zn),zn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},o=i!==null?i.baseLanes:n,Ct(Si,zn),zn|=o}else i!==null?(o=i.baseLanes|n,t.memoizedState=null):o=n,Ct(Si,zn),zn|=o;return _n(e,t,r,n),t.child}function xh(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function cd(e,t,n,o,r){var i=En(n)?Vr:dn.current;return i=Ti(t,i),Fi(t,r),n=Qd(e,t,n,o,i,r),o=Zd(),e!==null&&!xn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Wo(e,t,r)):(Ft&&o&&zd(t),t.flags|=1,_n(e,t,n,r),t.child)}function zf(e,t,n,o,r){if(En(n)){var i=!0;ys(t)}else i=!1;if(Fi(t,r),t.stateNode===null)ls(e,t),wh(t,n,o),sd(t,n,o,r),o=!0;else if(e===null){var l=t.stateNode,a=t.memoizedProps;l.props=a;var s=l.context,c=n.contextType;typeof c=="object"&&c!==null?c=to(c):(c=En(n)?Vr:dn.current,c=Ti(t,c));var p=n.getDerivedStateFromProps,m=typeof p=="function"||typeof l.getSnapshotBeforeUpdate=="function";m||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==o||s!==c)&&Lf(t,l,o,c),Zo=!1;var g=t.memoizedState;l.state=g,Ns(t,o,l,r),s=t.memoizedState,a!==o||g!==s||Rn.current||Zo?(typeof p=="function"&&(ad(t,n,p,o),s=t.memoizedState),(a=Zo||Tf(t,n,a,o,g,s,c))?(m||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.componentWillMount=="function"&&l.componentWillMount(),typeof l.UNSAFE_componentWillMount=="function"&&l.UNSAFE_componentWillMount()),typeof l.componentDidMount=="function"&&(t.flags|=4194308)):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=s),l.props=o,l.state=s,l.context=c,o=a):(typeof l.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{l=t.stateNode,eh(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:po(t.type,a),l.props=c,m=t.pendingProps,g=l.context,s=n.contextType,typeof s=="object"&&s!==null?s=to(s):(s=En(n)?Vr:dn.current,s=Ti(t,s));var d=n.getDerivedStateFromProps;(p=typeof d=="function"||typeof l.getSnapshotBeforeUpdate=="function")||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==m||g!==s)&&Lf(t,l,o,s),Zo=!1,g=t.memoizedState,l.state=g,Ns(t,o,l,
Line truncated
|
||||
font-size: .6rem;
|
||||
font-weight: bold;
|
||||
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,n?.key)}return r}}function Ge(e,t,n,o){return{debug:()=>{var r;return(r=e?.debugAll)!=null?r:e[t]},key:!1,onChange:o}}function Ow(e,t,n,o){let r=()=>{var l;return(l=i.getValue())!=null?l:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:r,getContext:We(()=>[e,n,t,i],(l,a,s,c)=>({table:l,column:a,row:s,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Ge(e.options,"debugCells","cell.getContext"))};return e._features.forEach(l=>{l.createCell==null||l.createCell(i,n,t,e)},{}),i}function $w(e,t,n,o){var r,i;let a={...e._getDefaultColumnDef(),...t},s=a.accessorKey,c=(r=(i=a.id)!=null?i:s?typeof String.prototype.replaceAll=="function"?s.replaceAll(".","_"):s.replace(/\./g,"_"):void 0)!=null?r:typeof a.header=="string"?a.header:void 0,p;if(a.accessorFn?p=a.accessorFn:s&&(s.includes(".")?p=g=>{let d=g;for(let h of s.split(".")){var v;d=(v=d)==null?void 0:v[h]}return d}:p=g=>g[a.accessorKey]),!c)throw new Error;let m={id:`${String(c)}`,accessorFn:p,parent:o,depth:n,columnDef:a,columns:[],getFlatColumns:We(()=>[!0],()=>{var g;return[m,...(g=m.columns)==null?void 0:g.flatMap(d=>d.getFlatColumns())]},Ge(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:We(()=>[e._getOrderColumnsFn()],g=>{var d;if((d=m.columns)!=null&&d.length){let v=m.columns.flatMap(h=>h.getLeafColumns());return g(v)}return[m]},Ge(e.options,"debugColumns","column.getLeafColumns"))};for(let g of e._features)g.createColumn==null||g.createColumn(m,e);return m}var pn="debugHeaders";function Jh(e,t,n){var o;let i={id:(o=n.id)!=null?o:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let l=[],a=s=>{s.subHeaders&&s.subHeaders.length&&s.subHeaders.map(a),l.push(s)};return a(i),l},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(l=>{l.createHeader==null||l.createHeader(i,e)}),i}var zw={createTable:e=>{e.getHeaderGroups=We(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>{var i,l;let a=(i=o?.map(m=>n.find(g=>g.id===m)).filter(Boolean))!=null?i:[],s=(l=r?.map(m=>n.find(g=>g.id===m)).filter(Boolean))!=null?l:[],c=n.filter(m=>!(o!=null&&o.includes(m.id))&&!(r!=null&&r.includes(m.id)));return Xs(t,[...a,...c,...s],e)},Ge(e.options,pn,"getHeaderGroups")),e.getCenterHeaderGroups=We(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>(n=n.filter(i=>!(o!=null&&o.includes(i.id))&&!(r!=null&&r.includes(i.id))),Xs(t,n,e,"center")),Ge(e.options,pn,"getCenterHeaderGroups")),e.getLeftHeaderGroups=We(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var r;let i=(r=o?.map(l=>n.find(a=>a.id===l)).filter(Boolean))!=null?r:[];return Xs(t,i,e,"left")},Ge(e.options,pn,"getLeftHeaderGroups")),e.getRightHeaderGroups=We(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var r;let i=(r=o?.map(l=>n.find(a=>a.id===l)).filter(Boolean))!=null?r:[];return Xs(t,i,e,"right")},Ge(e.options,pn,"getRightHeaderGroups")),e.getFooterGroups=We(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Ge(e.options,pn,"getFooterGroups")),e.getLeftFooterGroups=We(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Ge(e.options,pn,"getLeftFooterGroups")),e.getCenterFooterGroups=We(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Ge(e.options,pn,"getCenterFooterGroups")),e.getRightFooterGroups=We(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Ge(e.options,pn,"getRightFooterGroups")),e.getFlatHeaders=We(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ge(e.options,pn,"getFlatHeaders")),e.getLeftFlatHeaders=We(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ge(e.options,pn,"getLeftFlatHeaders")),e.getCenterFlatHeaders=We(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ge(e.options,pn,"getCenterFlatHeaders")),e.getRightFlatHeaders=We(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ge(e.options,pn,"getRightFlatHeaders")),e.getCenterLeafHeaders=We(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),Ge(e.options,pn,"getCenterLeafHeaders")),e.getLeftLeafHeaders=We(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),Ge(e.options,pn,"getLeftLeafHeaders")),e.getRightLeafHeaders=We(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),Ge(e.options,pn,"getRightLeafHeaders")),e.getLeafHeaders=We(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,o)=>{var r,i,l,a,s,c;return[...(r=(i=t[0])==null?void 0:i.headers)!=null?r:[],...(l=(a=n[0])==null?void 0:a.headers)!=null?l:[],...(s=(c=o[0])
Line truncated
|
||||
To pick up a draggable item, press the space bar.
|
||||
While dragging, use the arrow keys to move the item.
|
||||
Press space again to drop the item in its new position, or press escape to cancel.
|
||||
`},MC={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function TC(e){let{announcements:t=MC,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=DC}=e,{announce:i,announcement:l}=C_(),a=Yr("DndLiveRegion"),[s,c]=(0,ne.useState)(!1);if((0,ne.useEffect)(()=>{c(!0)},[]),EC((0,ne.useMemo)(()=>({onDragStart(m){let{active:g}=m;i(t.onDragStart({active:g}))},onDragMove(m){let{active:g,over:d}=m;t.onDragMove&&i(t.onDragMove({active:g,over:d}))},onDragOver(m){let{active:g,over:d}=m;i(t.onDragOver({active:g,over:d}))},onDragEnd(m){let{active:g,over:d}=m;i(t.onDragEnd({active:g,over:d}))},onDragCancel(m){let{active:g,over:d}=m;i(t.onDragCancel({active:g,over:d}))}}),[i,t])),!s)return null;let p=ne.default.createElement(ne.default.Fragment,null,ne.default.createElement(y_,{id:o,value:r.draggable}),ne.default.createElement(w_,{id:a,announcement:l}));return n?(0,Zr.createPortal)(p,n):p}var Yt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Yt||(Yt={}));function lu(){}function Vp(e,t){return(0,ne.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function I_(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,ne.useMemo)(()=>[...t].filter(o=>o!=null),[...t])}var yo=Object.freeze({x:0,y:0});function LC(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function PC(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function IC(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function A_(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function k_(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var Bp=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e,r=k_(t,t.left,t.top),i=[];for(let l of o){let{id:a}=l,s=n.get(a);if(s){let c=LC(k_(s),r);i.push({id:a,data:{droppableContainer:l,value:c}})}}return i.sort(PC)};function AC(e,t){let n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),l=r-o,a=i-n;if(o<r&&n<i){let s=t.width*t.height,c=e.width*e.height,p=l*a,m=p/(s+c-p);return Number(m.toFixed(4))}return 0}var OC=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e,r=[];for(let i of o){let{id:l}=i,a=n.get(l);if(a){let s=AC(a,t);s>0&&r.push({id:l,data:{droppableContainer:i,value:s}})}}return r.sort(IC)};function $C(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function O_(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:yo}function zC(e){return function(n){for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];return r.reduce((l,a)=>({...l,top:l.top+e*a.y,bottom:l.bottom+e*a.y,left:l.left+e*a.x,right:l.right+e*a.x}),{...n})}}var VC=zC(1);function BC(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function jC(e,t,n){let o=BC(t);if(!o)return e;let{scaleX:r,scaleY:i,x:l,y:a}=o,s=e.left-l-(1-r)*parseFloat(n),c=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),p=r?e.width/r:e.width,m=i?e.height/i:e.height;return{width:p,height:m,top:c,right:s+p,bottom:c+m,left:s}}var HC={ignoreTransform:!1};function ti(e,t){t===void 0&&(t=HC);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:c,transformOrigin:p}=yn(e).getComputedStyle(e);c&&(n=jC(n,c,p))}let{top:o,left:r,width:i,height:l,bottom:a,right:s}=n;return{top:o,left:r,width:i,height:l,bottom:a,right:s}}function S_(e){return ti(e,{ignoreTransform:!0})}function UC(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function WC(e,t){return t===void 0&&(t=yn(e).getComputedStyle(e)),t.position==="fixed"}function GC(e,t){t===void 0&&(t=yn(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{let i=t[r];return typeof i=="string"?n.test(i):!1})}function uu(e,t){let n=[];function o(r){if(t!=null&&n.length>=t||!r)return n;if(tu(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!Bi(r)||Tp(r)||n.includes(r))return n;let i=yn(e).getComputedStyle(r);return r!==e&&GC(r,i)&&n.push(r),WC(r,i)?n:o(r.parentNode)}retu
Line truncated
|
||||
`)?'"'+St.replace(/"/g,'""')+'"':St},E=["Nome",...b.map(Vt=>Vt.name)],z=ln.map(Vt=>[Vt._title,...b.map(ko=>{let Ut=Vt[ko.id];return Array.isArray(Ut)?Ut.join(";"):Ut})].map(x).join(",")),pe=[E.join(","),...z].join(`
|
||||
`),Ue=new Blob([pe],{type:"text/csv;charset=utf-8;"}),dt=URL.createObjectURL(Ue),Sn=document.createElement("a");Sn.href=dt,Sn.download=(e?.parent?.name||r.vault.getName()||"database")+".csv",Sn.click(),URL.revokeObjectURL(dt),xe(!1)},[Le,U.hiddenColumns,ln,e,r]),li=(0,se.useCallback)(async b=>{let x=b.target.files?.[0];if(!x||!e)return;let z=(await x.text()).split(/\r?\n/).filter(St=>St.trim()!=="");if(z.length<2)return;let pe=St=>{let ko=[],Ut="",Po=!1;for(let Io=0;Io<St.length;Io++){let ui=St[Io];ui==='"'?Po&&St[Io+1]==='"'?(Ut+='"',Io++):Po=!Po:ui===","&&!Po?(ko.push(Ut),Ut=""):Ut+=ui}return ko.push(Ut),ko},Ue=pe(z[0]).map(St=>St.trim().toLowerCase()),dt=new Map,Sn=new Set;Ue.forEach((St,ko)=>{if(St==="nome"||St==="title"||St==="name")return;let Ut=f.schema.find(Po=>Po.name.toLowerCase()===St);Ut&&!Sn.has(Ut.id)&&(dt.set(ko,{id:Ut.id,type:Ut.type}),Sn.add(Ut.id))});let Vt=Ue.findIndex(St=>St==="nome"||St==="title"||St==="name");for(let St of z.slice(1)){let ko=pe(St),Ut=Vt>=0?ko[Vt]?.trim():"";if(Ut&&y.some(Io=>Io._title===Ut))continue;let Po=await t.createNote(e);Ut&&await t.renameNote(Po,Ut);for(let[Io,ui]of dt){let Wu=ko[Io]?.trim()??"";if(!Wu)continue;let tb=ui.type==="multiselect"?Wu.split(";").map(nb=>nb.trim()):Wu;await t.updateNoteField(Po,ui.id,tb)}}b.target.value="",xe(!1)},[e,f.schema,t,r]);(0,se.useEffect)(()=>{if(!K)return;let b=x=>{oe.current?.contains(x.target)||Z.current&&!Z.current.contains(x.target)&&D(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[K]),(0,se.useEffect)(()=>{if(!ke){Mt(null);return}let b=ft.current[ke];if(!b)return;let x=b.getBoundingClientRect();Mt({top:x.bottom+6,left:x.left})},[ke]),(0,se.useEffect)(()=>{if(!ke)return;let b=x=>{let E=ft.current[ke],z=Jt.current,pe=E&&E.contains(x.target),Ue=z&&z.contains(x.target);!pe&&!Ue&&ye(null)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[ke]),(0,se.useEffect)(()=>{if(!Et)return;let b=x=>{let E=$t.current[Et];E&&!E.contains(x.target)&&bt(null)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[Et]);let Rr=Ik,Er=(0,se.useCallback)(async b=>{let x=b.map(E=>({id:E.id,columnId:E.columnId,operator:E.operator,value:E.value,conjunction:E.conjunction}));await Pe({...U,activePills:x})},[Pe,U]),wa=b=>{let{active:x,over:E}=b;if(!E||x.id===E.id)return;let z=v.findIndex(dt=>dt.id===x.id),pe=v.findIndex(dt=>dt.id===E.id),Ue=Gi(v,z,pe);h(Ue),Er(Ue)},ai=(b,x,E,z)=>{let pe=crypto.randomUUID(),Ue=[...v,{id:pe,columnId:b,columnName:x,columnType:z,icon:E,operator:Bk(z),value:"",conjunction:"and"}];h(Ue),Er(Ue),D(!1)},tl=b=>{let x=v.filter(E=>E.id!==b);h(x),Er(x),ke===b&&ye(null),Et===b&&bt(null)},$u=async b=>{await Pe({...U,rowHeight:b}),Ye(!1)},zu=async()=>{await Pe({...U,wrapText:!U.wrapText})},nl=async()=>{await Pe({...U,includeSubfolders:!U.includeSubfolders})},Vu=async(b,x)=>{let E={...U.aggregations??{},[b]:x};await Pe({...U,aggregations:E}),De(null)},Ca=(b,x)=>{if(x==="none")return"";let E=ln.map(dt=>b==="_title"?dt._title:dt[b]),z=ln.length;if(x==="count")return`${z} ${z===1?u("row_singular").toLowerCase():u("row_plural").toLowerCase()}`;let pe=E.filter(dt=>dt!=null&&String(dt).trim()!=="");if(x==="count_values")return`${pe.length} preenchido${pe.length!==1?"s":""}`;let Ue=pe.map(dt=>parseFloat(String(dt))).filter(dt=>!isNaN(dt));return Ue.length===0?"\u2014":x==="sum"?String(Math.round(Ue.reduce((dt,Sn)=>dt+Sn,0)*1e10)/1e10):x==="avg"?String(Math.round(Ue.reduce((dt,Sn)=>dt+Sn,0)/Ue.length*1e10)/1e10):x==="min"?String(Math.min(...Ue)):x==="max"?String(Math.max(...Ue)):""},Bu={none:u("agg_none"),count:"",count_values:"",sum:u("agg_sum"),avg:u("agg_avg"),min:u("agg_min"),max:u("agg_max")},Fr=(b,x,E)=>{let z=v.map(pe=>pe.id===b?{...pe,operator:x,value:E}:pe);h(z),Er(z)},ol=b=>{let x=v.map(E=>E.id===b?{...E,conjunction:E.conjunction==="and"?"or":"and"}:E);h(x),Er(x)},Co=v.length>=3||v.some(b=>b.columnName.length>10);(0,se.useEffect)(()=>{Co||(en(!1),Ce.current&&clearTimeout(Ce.current))},[Co]),(0,se.useEffect)(()=>()=>{Ce.current&&clearTimeout(Ce.current)},[]);let rl=()=>{Ce.current&&(clearTimeout(Ce.current),Ce.current=null)},ka=()=>{rl(),Ce.current=setTimeout(()=>en(!1),6e3)},ju=()=>{en(!0),ka(),requestAnimationFrame(()=>M.current?.focus())},Sa=()=>{rl(),en(!1)},Na=(0,se.useCallback)(async b=>{if(n){let x=U.hiddenColumns.includes(b)?U.hiddenColumns.filter(E=>E!==b):[...U.hiddenColumns,b];await Pe({...U,hiddenColumns:x})}else{let x=f.schema.map(E=>E.id===b?{...E,visible:!E.visible}:E);await Xe(x)}},[n,U,Pe,f.schema,Xe]),Hu=(0,se.useCallback)(async b=>{let{active:x,over:E}=b;if(!E||x.id===E.id)return;let z=Le.findIndex(Ue=>Ue.id===x.id),pe=Le.findIndex(Ue=>Ue.id===E.id);if(!(z===-1||pe===-1))if(n){let Ue=Gi(Le,z,pe).map(dt=>dt.id);await Pe({...U,columnOrder:Ue})}else await Xe(Gi(f.schema,z,pe))},[Le,n,U,Pe,f.schema,Xe]),Uu=async()=>{let x={id:`campo_${Date.now()}`,name:u("new_field"),type
Line truncated
|
||||
`,r-1)+1,a=o.indexOf(`
|
||||
`,r+n.fullMatch.length);a===-1?a=o.length:a+=1,i=o.slice(0,l)+o.slice(a)}else i=o.slice(0,r)+o.slice(r+n.fullMatch.length);await this.app.vault.modify(t,i)}serializeInlineValue(t){return t==null?"":Array.isArray(t)?t.join(", "):typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):JSON.stringify(t)}async syncTwoWayRelation(t,n,o,r){if(!n.pairedColumnId||!n.refDatabasePath)return;let i=this.app.vault.getFileByPath(n.refDatabasePath);if(!i)return;let l=this.getNotesInDatabase(i),a=t.basename,s=r.filter(p=>!o.includes(p)),c=o.filter(p=>!r.includes(p));for(let p of l){let g=this.app.metadataCache.getFileCache(p)?.frontmatter??{},d=n.refColumnId==="_title"?p.basename:String(g[n.refColumnId]??"");s.includes(d)&&await this.app.fileManager.processFrontMatter(p,v=>{let h=Array.isArray(v[n.pairedColumnId])?v[n.pairedColumnId]:v[n.pairedColumnId]?[String(v[n.pairedColumnId])]:[];h.includes(a)||(v[n.pairedColumnId]=[...h,a])}),c.includes(d)&&await this.app.fileManager.processFrontMatter(p,v=>{let y=(Array.isArray(v[n.pairedColumnId])?v[n.pairedColumnId]:v[n.pairedColumnId]?[String(v[n.pairedColumnId])]:[]).filter(_=>_!==a);y.length>0?v[n.pairedColumnId]=y:delete v[n.pairedColumnId]})}}async renameNote(t,n){if(!n.trim()||n===t.basename)return;let o=(0,Kn.normalizePath)(`${t.parent?.path??""}/${n.trim()}.md`);await this.app.fileManager.renameFile(t,o)}async createNote(t,n){let o=t.parent?.path??"",r=(0,Kn.normalizePath)(`${o}/${u("db_untitled_note")}`),i=`${r}.md`,l=1;for(;this.app.vault.getFileByPath(i);)i=`${r} ${l++}.md`;let a=await this.app.vault.create(i,`---
|
||||
---
|
||||
`);return n&&Object.keys(n).length>0&&await this.app.fileManager.processFrontMatter(a,s=>{for(let[c,p]of Object.entries(n))s[c]=p}),a}getAllDatabases(){return this.app.vault.getMarkdownFiles().filter(t=>this.isDatabaseFile(t))}resolveLookupsForRows(t,n){let o=n.filter(i=>i.type==="lookup"&&i.refDatabasePath&&i.refColumnId&&i.refMatchColumnId);if(o.length===0)return t;let r=new Map;for(let i of o){let l=i.refDatabasePath;if(!r.has(l)){let a=this.app.vault.getFileByPath(l);if(!a){r.set(l,[]);continue}let s=this.readConfig(a),p=this.getNotesInDatabase(a).map(m=>this.getNoteDataSync(m,s.schema));r.set(l,p)}}return t.map(i=>{let l={...i};for(let a of o){let s=r.get(a.refDatabasePath)??[],c=a.refMatchColumnId==="_title"?i._title:i[a.refMatchColumnId],p=String(c??"");if(!p){l[a.id]=null;continue}let m=s.find(g=>g._title===p);l[a.id]=m?m[a.refColumnId]??null:null}return l})}resolveRollupsForRows(t,n){let o=n.filter(i=>i.type==="rollup"&&i.rollupRelationColumnId&&i.rollupTargetColumnId&&i.rollupFunction);if(o.length===0)return t;let r=new Map;for(let i of o){let l=n.find(s=>s.id===i.rollupRelationColumnId);if(!l||l.type!=="relation"||!l.refDatabasePath)continue;let a=l.refDatabasePath;if(!r.has(a)){let s=this.app.vault.getFileByPath(a);if(!s){r.set(a,[]);continue}let c=this.readConfig(s),p=this.getNotesInDatabase(s);r.set(a,p.map(m=>this.getNoteDataSync(m,c.schema)))}}return t.map(i=>{let l={...i};for(let a of o){let s=n.find(h=>h.id===a.rollupRelationColumnId);if(!s||!s.refDatabasePath){l[a.id]=null;continue}let c=r.get(s.refDatabasePath)??[],p=i[s.id],m=Array.isArray(p)?p.filter(h=>typeof h=="string"):typeof p=="string"&&p?[p]:[];if(m.length===0){l[a.id]=null;continue}let g=c.filter(h=>m.includes(h._title)),d=a.rollupTargetColumnId,v=g.map(h=>d==="_title"?h._title:h[d]).filter(h=>h!=null);l[a.id]=this.applyRollupFunction(v,a.rollupFunction)}return l})}applyRollupFunction(t,n){if(t.length===0)return null;switch(n){case"count":return t.length;case"count_values":return new Set(t.map(o=>String(o))).size;case"list":return t.map(o=>String(o)).join(", ");case"sum":{let o=t.map(Number).filter(r=>!isNaN(r));return o.length>0?o.reduce((r,i)=>r+i,0):null}case"avg":{let o=t.map(Number).filter(r=>!isNaN(r));return o.length>0?Math.round(o.reduce((r,i)=>r+i,0)/o.length*100)/100:null}case"min":{let o=t.map(Number).filter(r=>!isNaN(r));return o.length>0?Math.min(...o):null}case"max":{let o=t.map(Number).filter(r=>!isNaN(r));return o.length>0?Math.max(...o):null}default:return null}}async deleteNotes(t){for(let n of t)await this.app.fileManager.trashFile(n)}async duplicateNotes(t){for(let n of t){let o=n.parent?.path??"",r=(0,Kn.normalizePath)(`${o}/${n.basename} ${u("db_copy_suffix")}.md`),i=2;for(;this.app.vault.getFileByPath(r);)r=(0,Kn.normalizePath)(`${o}/${n.basename} ${u("db_copy_suffix_n").replace("$n",String(i++))}.md`);let l=await this.app.vault.read(n);await this.app.vault.create(r,l)}}async moveNotes(t,n){for(let o of t){let r=(0,Kn.normalizePath)(`${n}/${o.name}`);await this.app.fileManager.renameFile(o,r)}}async createDatabase(t){let n=(0,Kn.normalizePath)(t?`${t}/${this.databaseFileName}`:this.databaseFileName);if(this.app.vault.getFileByPath(n))throw new Error(u("db_already_exists").replace("$folder",t||"/"));let o=["---",`${Fu}: true`,"schema: []","views:"," - id: default"," type: table"," filters: []"," sorts: []"," hiddenColumns: []"," columnWidths: {}","---","","> [!tip] Notion Bases","> "+u("db_tip_body"),""].join(`
|
||||
`);return this.app.vault.create(n,o)}async inferSchema(t){let n=new Map;for(let o of t){let i=this.app.metadataCache.getFileCache(o)?.frontmatter;if(i)for(let[l,a]of Object.entries(i))l==="position"||l.startsWith("notion-bases")||(n.has(l)||n.set(l,[]),a!=null&&n.get(l).push(a))}if(this.readInlineFields)for(let o of t){let r=await this.app.vault.cachedRead(o),i=dm(r);for(let l of i)n.has(l.key)||n.set(l.key,[]),l.value!==null&&l.value!==void 0&&n.get(l.key).push(l.value)}return Array.from(n.entries()).map(([o,r])=>{let i=this.inferType(o,r),l=i==="select"||i==="multiselect"||i==="status"?this.extractOptions(r,i):void 0;return{id:o,name:this.toDisplayName(o),type:i,visible:!0,width:i==="title"||i==="text"?200:140,options:l}})}inferType(t,n){if(t==="tags")return"multiselect";if(["date","created","modified","due"].includes(t)||t.endsWith("_date")||t.endsWith("_at")||t.endsWith("At"))return"date";if(["status","priority","type","category","stage"].includes(t))return"select";if(["done","completed","archived","published","pinned"].includes(t))return"checkbox";if(["audio","sound","music","recording"].includes(t)||t.endsWith("_audio")||t.endsWith("_sound"))return"audio";if(["video","clip","movie"].includes(t)||t.endsWith("_video")||t.endsWith("_clip"))return"video";let o=n.filter(i=>i!=null);return o.length===0?"text":o.every(i=>typeof i=="boolean")?"checkbox":o.every(i=>typeof i=="number")?"number":o.every(i=>Array.isArray(i))?"multiselect":new Set(o.map(String)).size<=8?"select":"text"}extractOptions(t,n){let o=new Set;for(let r of t)if(n==="multiselect"&&Array.isArray(r))for(let i of r)o.add(String(i));else r!=null&&o.add(String(r));return Array.from(o).map(r=>({value:r}))}toDisplayName(t){return t.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,n=>n.toUpperCase())}async renameColumn(t,n,o,r){let i=this.uniqueSlug(r,n.schema,o);if(i!==o){let c=this.getNotesInDatabase(t);for(let p of c){let m=this.app.metadataCache.getFileCache(p);m?.frontmatter&&o in m.frontmatter&&await this.app.fileManager.processFrontMatter(p,g=>{g[i]=g[o],delete g[o]})}}let a=n.schema.map(c=>c.id===o?{...c,id:i,name:r}:c),s={...n,schema:a};return await this.writeConfig(t,s),s}slugify(t){return t.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").replace(/_+/g,"_")||"campo"}uniqueSlug(t,n,o){let r=this.slugify(t),i=new Set(n.filter(a=>a.id!==o).map(a=>a.id));if(!i.has(r))return r;let l=2;for(;i.has(`${r}_${l}`);)l++;return`${r}_${l}`}};var Zi=require("obsidian");var Xv={databaseFileName:"_database.md",defaultRowHeight:36,embedViews:{},readInlineFields:!1},Mu=class extends Zi.PluginSettingTab{constructor(t,n){super(t,n),this.plugin=n}display(){let{containerEl:t}=this;t.empty(),new Zi.Setting(t).setName(u("settings_db_filename_name")).setDesc(u("settings_db_filename_desc")).addText(n=>n.setPlaceholder("_database.md").setValue(this.plugin.settings.databaseFileName).onChange(async o=>{this.plugin.settings.databaseFileName=o||"_database.md",await this.plugin.saveSettings()})),new Zi.Setting(t).setName(u("settings_inline_fields_name")).setDesc(u("settings_inline_fields_desc")).addToggle(n=>n.setValue(this.plugin.settings.readInlineFields).onChange(async o=>{this.plugin.settings.readInlineFields=o,this.plugin.manager.readInlineFields=o,await this.plugin.saveSettings()})),new Zi.Setting(t).setName(u("settings_row_height_name")).setDesc(u("settings_row_height_desc")).addSlider(n=>n.setLimits(28,80,4).setValue(this.plugin.settings.defaultRowHeight).setDynamicTooltip().onChange(async o=>{this.plugin.settings.defaultRowHeight=o,await this.plugin.saveSettings()}))}};var Qv=require("obsidian");var ma=class extends Qv.FuzzySuggestModal{constructor(t,n,o){super(t),this.onChoose=o,this.setPlaceholder(u("picker_placeholder")),this.entries=n.map(r=>{let i=!r.parent?.path||r.parent.path==="/";return{file:r,label:i?u("picker_root"):r.parent?.name??"/",sublabel:i?"":r.parent?.path??"/"}})}getItems(){return this.entries}getItemText(t){return`${t.label} ${t.sublabel}`}renderSuggestion(t,n){n.createEl("div",{text:t.item.label,cls:"nb-picker-title"}),n.createEl("small",{text:t.item.sublabel,cls:"nb-picker-path"})}onChooseItem(t){this.onChoose(t.file)}};var ri=require("obsidian");var ES=new Set(["text","number","select","multiselect","status","date","checkbox","url","email","phone"]),Tu=class extends ri.Modal{constructor(n,o,r,i){super(n);this.values={};this.titleValue="";this.manager=o,this.dbFile=r,this.schema=i}onOpen(){let{contentEl:n}=this;n.empty(),n.addClass("nb-quick-add-modal"),n.createEl("h3",{text:u("quick_add_title")});let o=this.dbFile.parent?.name??this.dbFile.path;n.createEl("p",{text:o,cls:"nb-quick-add-db-name"}),new ri.Setting(n).setName(u("quick_add_note_title")).addText(s=>{s.setPlaceholder(u("quick_add_note_title_placeholder")),s.onChange(c=>{this.titleValue=c}),s.inputEl.addClass("nb-quick-add-title-input"),setTimeout(()=>s.inputEl.focus(),50)});let r=this.schema.filter
Line truncated
|
||||
`),i="",l="",a;for(let s of r){let c=s.match(/^path:\s*(.+)$/);c&&(i=c[1].trim());let p=s.match(/^id:\s*(.+)$/);p&&(l=p[1].trim());let m=s.match(/^type:\s*(.+)$/);if(m){let g=m[1].trim();(g==="table"||g==="list")&&(a=g)}}if(!l){l="nb"+Math.random().toString(36).slice(2,10);let s=e.app.vault.getFileByPath(o.sourcePath);s&&e.app.vault.process(s,c=>{let p="```nb-database\n"+t.trimEnd(),m=c.indexOf(p);if(m===-1)return c;let g=m+15;return c.slice(0,g)+`id: ${l}
|
||||
`+c.slice(g)}).catch(console.error)}n.addClass("nb-embed-container"),o.addChild(new mm(n,e,i,l,o.sourcePath,a))})}var Lu=class extends Ji.Plugin{constructor(){super(...arguments);this._redirecting=!1}async onload(){await this.loadSettings(),this.manager=new Du(this.app,this.settings.databaseFileName),this.manager.readInlineFields=this.settings.readInlineFields,this.registerView(pa,n=>new oi(n,this)),this.addRibbonIcon("table","Notion bases",()=>{this.openDatabasePicker()}),this.addCommand({id:"open-database",name:u("cmd_open_database"),callback:async()=>{await this.openOrCreateDatabase()}}),this.addCommand({id:"create-database",name:u("cmd_create_database"),callback:async()=>{let o=this.app.workspace.getActiveFile()?.parent?.path??"";await this.createAndOpenDatabase(o)}}),this.addCommand({id:"quick-add",name:u("cmd_quick_add"),callback:()=>{this.openQuickAdd()}}),this.registerEvent(this.app.workspace.on("active-leaf-change",async n=>{if(!n||this._redirecting||n.view.getViewType()!=="markdown")return;let o=n.view.file??void 0;if(!o||!this.manager.isDatabaseFile(o))return;let r=this.findDatabaseLeaf(o.path);if(r&&r!==n){this.app.workspace.revealLeaf(r),n.detach();return}if(!r){this._redirecting=!0;try{await this.openDatabaseInLeaf(n,o)}finally{this._redirecting=!1}}})),eb(this),this.addSettingTab(new Mu(this.app,this))}onunload(){}async loadSettings(){this.settings=Object.assign({},Xv,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}openQuickAdd(){let n=this.manager.getAllDatabases().sort((o,r)=>(o.parent?.path??"").localeCompare(r.parent?.path??""));if(n.length===0){new Ji.Notice(u("no_databases_found"));return}new ma(this.app,n,o=>{let r=this.manager.readConfig(o);new Tu(this.app,this.manager,o,r.schema).open()}).open()}openDatabasePicker(){let n=this.manager.getAllDatabases().sort((o,r)=>(o.parent?.path??"").localeCompare(r.parent?.path??""));if(n.length===0){new Ji.Notice(u("no_databases_found"));return}new ma(this.app,n,o=>{let r=this.findDatabaseLeaf(o.path);if(r){this.app.workspace.revealLeaf(r);return}let i=this.app.workspace.getLeaf("tab");this.openDatabaseInLeaf(i,o)}).open()}async openOrCreateDatabase(){let n=this.app.workspace.getActiveFile(),o=n?.parent?.path??"";if(!n){let i=this.app.workspace.getActiveViewOfType(oi)?.leaf??null;if(i?.view instanceof oi){let l=i.view.getDatabaseFilePath();o=this.app.vault.getFileByPath(l)?.parent?.path??""}}let r=this.manager.getDatabaseFileInFolder(o);if(r){let i=this.findDatabaseLeaf(r.path);if(i){this.app.workspace.revealLeaf(i);return}let l=this.app.workspace.getLeaf("tab");await this.openDatabaseInLeaf(l,r)}else await this.createAndOpenDatabase(o)}async createAndOpenDatabase(n){try{let o=await this.manager.createDatabase(n),r=this.app.workspace.getLeaf("tab");await this.openDatabaseInLeaf(r,o)}catch(o){new Ji.Notice(String(o))}}async openDatabaseInLeaf(n,o){await n.setViewState({type:pa,state:{dbFilePath:o.path},active:!0}),this.app.workspace.revealLeaf(n);let r=n.view;r instanceof oi&&r.getDatabaseFilePath()!==o.path&&r.setDatabaseFile(o)}findDatabaseLeaf(n){let o=null;return this.app.workspace.iterateAllLeaves(r=>{if(o||r.view.getViewType()!==pa)return;r.view.getState().dbFilePath===n&&(o=r)}),o}};
|
||||
/*! Bundled license information:
|
||||
|
||||
react/cjs/react.production.min.js:
|
||||
(**
|
||||
* @license React
|
||||
* react.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
scheduler/cjs/scheduler.production.min.js:
|
||||
(**
|
||||
* @license React
|
||||
* scheduler.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
react-dom/cjs/react-dom.production.min.js:
|
||||
(**
|
||||
* @license React
|
||||
* react-dom.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
react/cjs/react-jsx-runtime.production.min.js:
|
||||
(**
|
||||
* @license React
|
||||
* react-jsx-runtime.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
@tanstack/table-core/build/lib/index.mjs:
|
||||
(**
|
||||
* table-core
|
||||
*
|
||||
* Copyright (c) TanStack
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*)
|
||||
|
||||
@tanstack/react-table/build/lib/index.mjs:
|
||||
(**
|
||||
* react-table
|
||||
*
|
||||
* Copyright (c) TanStack
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE.md file in the root directory of this source tree.
|
||||
*
|
||||
* @license MIT
|
||||
*)
|
||||
*/
|
||||
@@ -0,0 +1 @@
|
||||
{"id":"notion-bases","name":"Notion Bases","version":"1.6.0","minAppVersion":"1.4.0","description":"Turn any folder into a database — table, kanban board, gallery, calendar, timeline and list views powered by frontmatter.","author":"bgarciamoura","authorUrl":"https://github.com/bgarciamoura","isDesktopOnly":false,"fundingUrl":"https://github.com/sponsors/bgarciamoura"}
|
||||
+5080
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"appliedMigrations": [
|
||||
"tokens-to-secretstorage-v1"
|
||||
]
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"pluginList": [
|
||||
"bgarciamoura/obsidian-notion-bases-plugin"
|
||||
],
|
||||
"pluginSubListFrozenVersion": [
|
||||
{
|
||||
"repo": "bgarciamoura/obsidian-notion-bases-plugin",
|
||||
"version": "latest"
|
||||
}
|
||||
],
|
||||
"themesList": [],
|
||||
"updateAtStartup": true,
|
||||
"updateThemesAtStartup": true,
|
||||
"enableAfterInstall": true,
|
||||
"loggingEnabled": false,
|
||||
"loggingPath": "BRAT-log",
|
||||
"loggingVerboseEnabled": false,
|
||||
"debuggingMode": false,
|
||||
"notificationsEnabled": true,
|
||||
"globalTokenName": "",
|
||||
"personalAccessToken": "",
|
||||
"selectLatestPluginVersionByDefault": false,
|
||||
"allowIncompatiblePlugins": false
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
"use strict";var nn=Object.create;var pe=Object.defineProperty;var sn=Object.getOwnPropertyDescriptor;var on=Object.getOwnPropertyNames;var rn=Object.getPrototypeOf,an=Object.prototype.hasOwnProperty;var x=(s,e)=>()=>(e||s((e={exports:{}}).exports,e),e.exports),ln=(s,e)=>{for(var t in e)pe(s,t,{get:e[t],enumerable:!0})},Ze=(s,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of on(e))!an.call(s,i)&&i!==t&&pe(s,i,{get:()=>e[i],enumerable:!(n=sn(e,i))||n.enumerable});return s};var un=(s,e,t)=>(t=s!=null?nn(rn(s)):{},Ze(e||!s||!s.__esModule?pe(t,"default",{value:s,enumerable:!0}):t,s)),cn=s=>Ze(pe({},"__esModule",{value:!0}),s);var $e=x((ms,et)=>{"use strict";var gn=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...s)=>console.error("SEMVER",...s):()=>{};et.exports=gn});var xe=x((hs,tt)=>{"use strict";var dn="2.0.0",pn=Number.MAX_SAFE_INTEGER||9007199254740991,mn=16,hn=250,fn=["major","premajor","minor","preminor","patch","prepatch","prerelease"];tt.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:mn,MAX_SAFE_BUILD_LENGTH:hn,MAX_SAFE_INTEGER:pn,RELEASE_TYPES:fn,SEMVER_SPEC_VERSION:dn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Be=x((F,nt)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Oe,MAX_SAFE_BUILD_LENGTH:bn,MAX_LENGTH:wn}=xe(),Tn=$e();F=nt.exports={};var En=F.re=[],yn=F.safeRe=[],h=F.src=[],vn=F.safeSrc=[],f=F.t={},Pn=0,Fe="[a-zA-Z0-9-]",Rn=[["\\s",1],["\\d",wn],[Fe,bn]],In=s=>{for(let[e,t]of Rn)s=s.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return s},y=(s,e,t)=>{let n=In(e),i=Pn++;Tn(s,i,e),f[s]=i,h[i]=e,vn[i]=n,En[i]=new RegExp(e,t?"g":void 0),yn[i]=new RegExp(n,t?"g":void 0)};y("NUMERICIDENTIFIER","0|[1-9]\\d*");y("NUMERICIDENTIFIERLOOSE","\\d+");y("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Fe}*`);y("MAINVERSION",`(${h[f.NUMERICIDENTIFIER]})\\.(${h[f.NUMERICIDENTIFIER]})\\.(${h[f.NUMERICIDENTIFIER]})`);y("MAINVERSIONLOOSE",`(${h[f.NUMERICIDENTIFIERLOOSE]})\\.(${h[f.NUMERICIDENTIFIERLOOSE]})\\.(${h[f.NUMERICIDENTIFIERLOOSE]})`);y("PRERELEASEIDENTIFIER",`(?:${h[f.NONNUMERICIDENTIFIER]}|${h[f.NUMERICIDENTIFIER]})`);y("PRERELEASEIDENTIFIERLOOSE",`(?:${h[f.NONNUMERICIDENTIFIER]}|${h[f.NUMERICIDENTIFIERLOOSE]})`);y("PRERELEASE",`(?:-(${h[f.PRERELEASEIDENTIFIER]}(?:\\.${h[f.PRERELEASEIDENTIFIER]})*))`);y("PRERELEASELOOSE",`(?:-?(${h[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${h[f.PRERELEASEIDENTIFIERLOOSE]})*))`);y("BUILDIDENTIFIER",`${Fe}+`);y("BUILD",`(?:\\+(${h[f.BUILDIDENTIFIER]}(?:\\.${h[f.BUILDIDENTIFIER]})*))`);y("FULLPLAIN",`v?${h[f.MAINVERSION]}${h[f.PRERELEASE]}?${h[f.BUILD]}?`);y("FULL",`^${h[f.FULLPLAIN]}$`);y("LOOSEPLAIN",`[v=\\s]*${h[f.MAINVERSIONLOOSE]}${h[f.PRERELEASELOOSE]}?${h[f.BUILD]}?`);y("LOOSE",`^${h[f.LOOSEPLAIN]}$`);y("GTLT","((?:<|>)?=?)");y("XRANGEIDENTIFIERLOOSE",`${h[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);y("XRANGEIDENTIFIER",`${h[f.NUMERICIDENTIFIER]}|x|X|\\*`);y("XRANGEPLAIN",`[v=\\s]*(${h[f.XRANGEIDENTIFIER]})(?:\\.(${h[f.XRANGEIDENTIFIER]})(?:\\.(${h[f.XRANGEIDENTIFIER]})(?:${h[f.PRERELEASE]})?${h[f.BUILD]}?)?)?`);y("XRANGEPLAINLOOSE",`[v=\\s]*(${h[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${h[f.XRANGEIDENTIFIERLOOSE]})(?:${h[f.PRERELEASELOOSE]})?${h[f.BUILD]}?)?)?`);y("XRANGE",`^${h[f.GTLT]}\\s*${h[f.XRANGEPLAIN]}$`);y("XRANGELOOSE",`^${h[f.GTLT]}\\s*${h[f.XRANGEPLAINLOOSE]}$`);y("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Oe}})(?:\\.(\\d{1,${Oe}}))?(?:\\.(\\d{1,${Oe}}))?`);y("COERCE",`${h[f.COERCEPLAIN]}(?:$|[^\\d])`);y("COERCEFULL",h[f.COERCEPLAIN]+`(?:${h[f.PRERELEASE]})?(?:${h[f.BUILD]})?(?:$|[^\\d])`);y("COERCERTL",h[f.COERCE],!0);y("COERCERTLFULL",h[f.COERCEFULL],!0);y("LONETILDE","(?:~>?)");y("TILDETRIM",`(\\s*)${h[f.LONETILDE]}\\s+`,!0);F.tildeTrimReplace="$1~";y("TILDE",`^${h[f.LONETILDE]}${h[f.XRANGEPLAIN]}$`);y("TILDELOOSE",`^${h[f.LONETILDE]}${h[f.XRANGEPLAINLOOSE]}$`);y("LONECARET","(?:\\^)");y("CARETTRIM",`(\\s*)${h[f.LONECARET]}\\s+`,!0);F.caretTrimReplace="$1^";y("CARET",`^${h[f.LONECARET]}${h[f.XRANGEPLAIN]}$`);y("CARETLOOSE",`^${h[f.LONECARET]}${h[f.XRANGEPLAINLOOSE]}$`);y("COMPARATORLOOSE",`^${h[f.GTLT]}\\s*(${h[f.LOOSEPLAIN]})$|^$`);y("COMPARATOR",`^${h[f.GTLT]}\\s*(${h[f.FULLPLAIN]})$|^$`);y("COMPARATORTRIM",`(\\s*)${h[f.GTLT]}\\s*(${h[f.LOOSEPLAIN]}|${h[f.XRANGEPLAIN]})`,!0);F.comparatorTrimReplace="$1$2$3";y("HYPHENRANGE",`^\\s*(${h[f.XRANGEPLAIN]})\\s+-\\s+(${h[f.XRANGEPLAIN]})\\s*$`);y("HYPHENRANGELOOSE",`^\\s*(${h[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${h[f.XRANGEPLAINLOOSE]})\\s*$`);y("STAR","(<|>)?=?\\s*\\*");y("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");y("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var it=x((fs,st)=>{"use strict";var Nn=Object.freeze({loose:!0}),An=Object.freeze({}),Cn=s=>s?typeof s!="object"?Nn:s:An;st.exports=Cn});var lt=x((bs,at)=>{"use strict";var ot=/^[0-9]+$/,rt=(s,e)=>{if(typeof s=="number"&&typeof e=="number")return s===e?0:s<e?-1:1;let t=ot.test(s),n=ot.test(e);return t&&n&&(s=+s,e=+e),s===e?0:t&&!n?-1:n&&!t?1:s<e?-1:1},Ln=(s,eLine truncated
|
||||
GitHub API rate limit exceeded:`,`
|
||||
Request: ${u.requestUrl}`,`
|
||||
Rate limits - Remaining: ${u.remaining}`,`
|
||||
Reset in: ${u.getMinutesToReset()} minutes`),u}throw e&&console.log("GitHub request failed:",o),a}};var je={pluginList:[],pluginSubListFrozenVersion:[],themesList:[],updateAtStartup:!0,updateThemesAtStartup:!0,enableAfterInstall:!0,loggingEnabled:!1,loggingPath:"BRAT-log",loggingVerboseEnabled:!1,debuggingMode:!1,notificationsEnabled:!0,globalTokenName:"",personalAccessToken:"",selectLatestPluginVersionByDefault:!1,allowIncompatiblePlugins:!1};function Nt(s,e,t="latest",n=!1,i=""){let o=!1;s.settings.pluginList.contains(e)||(s.settings.pluginList.unshift(e),o=!0);let a=s.settings.pluginSubListFrozenVersion.find(c=>c.repo===e);a?(Object.assign(a,{repo:e,version:t,token:void 0,tokenName:i||a.tokenName,isIncompatible:n||void 0}),o=!0):(s.settings.pluginSubListFrozenVersion.unshift({repo:e,version:t,token:void 0,tokenName:i||void 0,isIncompatible:n||void 0}),o=!0),o&&s.saveSettings()}function Pe(s,e){return s.settings.pluginList.contains(e)}function At(s,e,t){let n={repo:e,lastUpdate:Z(t)};s.settings.themesList.unshift(n),s.saveSettings()}function Ct(s,e){return!!s.settings.themesList.find(n=>n.repo===e)}function ze(s,e,t){let n=s.settings.pluginSubListFrozenVersion.find(i=>i.repo===e);n&&(n.tokenName=t||void 0,s.saveSettings())}function Lt(s,e,t){for(let n of s.settings.themesList)n.repo===e&&(n.lastUpdate=t,s.saveSettings())}var L=require("obsidian");var j=class{constructor(e){this.statusEl=e}async validateToken(e,t){var n,i,o,a,c,u,g,m,l;if(!e)return(n=this.statusEl)==null||n.setText("No token provided"),(i=this.statusEl)==null||i.addClass("invalid"),(o=this.statusEl)==null||o.removeClass("valid"),!1;try{let r=await Et(e,t);return(a=this.statusEl)==null||a.removeClass("invalid","valid"),(c=this.statusEl)==null||c.empty(),r.validToken?((u=this.statusEl)==null||u.addClass("valid"),this.showValidTokenInfo(r),!0):((g=this.statusEl)==null||g.addClass("invalid"),this.showErrorMessage(r.error),!1)}catch(r){return console.error("Token validation error:",r),(m=this.statusEl)==null||m.setText("Failed to validate token"),(l=this.statusEl)==null||l.addClass("invalid"),!1}}showValidTokenInfo(e){var n,i;let t=(n=this.statusEl)==null?void 0:n.createDiv({cls:"brat-token-details"});if(t&&(t.createDiv({text:"\u2713 Valid token",cls:"brat-token-status valid"}),(i=e.currentScopes)!=null&&i.length&&t.createDiv({text:`Scopes: ${e.currentScopes.join(", ")}`,cls:"brat-token-scopes"}),e.rateLimit&&t.createDiv({text:`Rate Limit: ${e.rateLimit.remaining}/${e.rateLimit.limit}`,cls:"brat-token-rate"}),e.expirationDate)){let o=new Date(e.expirationDate),a=Math.ceil((o.getTime()-Date.now())/(1e3*60*60*24));a<7&&t.createDiv({text:`\u26A0\uFE0F Token expires in ${a} days`,cls:"brat-token-warning"})}}showErrorMessage(e){var n,i,o;let t=(n=this.statusEl)==null?void 0:n.createDiv({cls:"brat-token-error"});if(t&&(t.createDiv({text:e.message}),e.details))switch(e.type){case"invalid_prefix":t.createDiv({text:`Valid prefixes: ${(i=e.details.validPrefixes)==null?void 0:i.join(", ")}`});break;case"insufficient_scope":t.createDiv({text:`Required scopes: ${(o=e.details.requiredScopes)==null?void 0:o.join(", ")}`});break}}};function te(s,e){let t=new DocumentFragment,n=document.createElement("a");if(n.textContent=s,n.href=`https://github.com/${s}`,n.target="_blank",t.appendChild(n),e){let i=document.createTextNode(e);t.appendChild(i)}return t}function kt({prependText:s,url:e,text:t,appendText:n}){let i=new DocumentFragment,o=document.createElement("a");if(o.textContent=t,o.href=e,s){let a=document.createTextNode(s);i.appendChild(a)}if(i.appendChild(o),n){let a=document.createTextNode(n);i.appendChild(a)}return i}var Re=require("obsidian");function E(s,e,t=10,n){if(!s.settings.notificationsEnabled)return;let i=n?Re.Platform.isDesktop?"(click=dismiss, right-click=Info)":"(click=dismiss)":"",o=new Re.Notice(`BRAT
|
||||
${e}
|
||||
${i}`,t*1e3);n&&(o.noticeEl.oncontextmenu=()=>{n()})}var z=(s,e=!0)=>{let t=s.createEl("div");t.style.float="right",e?(t.style.padding="15px",t.style.paddingLeft="15px",t.style.paddingRight="15px",t.style.marginLeft="15px"):(t.style.padding="10px",t.style.paddingLeft="15px",t.style.paddingRight="15px");let n=t.createDiv("coffee");n.addClass("ex-twitter-span"),n.style.paddingLeft="10px";let i=n.createDiv();i.innerText="Learn more about my work at:",n.appendChild(i);let o=n.createEl("a",{href:"https://tfthacker.com"});return o.innerText="https://tfthacker.com",t};var St=require("obsidian"),Ie=class extends St.SuggestModal{constructor(e,t,n,i,o){super(e),this.versions=n,this.selected=i,this.onChoose=o,this.setTitle("Select a version"),this.setPlaceholder(`Type to search for a version for ${t}`),this.setInstructions([{command:"\u2191\u2193",purpose:"Navigate versions"},{command:"\u21B5",purpose:"Select version"},{command:"esc",purpose:"Dismiss modal"}])}getSuggestions(e){let t=e.toLowerCase();return this.versions.filter(n=>n.version.toLowerCase().contains(t))}renderSuggestion(e,t){t.createEl("div",{text:`${e.version} ${e.prerelease?"(Prerelease)":""}`})}onChooseSuggestion(e){this.onChoose(e.version)}onNoSuggestion(){this.onChoose(this.selected?this.selected:""),this.close()}};var U=class extends L.Modal{constructor(t,n,i=!1,o=!1,a="",c="",u=""){super(t.app);this.versionSetting=null;this.repositoryAddressEl=null;this.tokenInputEl=null;this.validateButton=null;this.validator=null;this.addPluginButton=null;this.cancelButton=null;this.plugin=t,this.betaPlugins=n,this.address=a,this.version=c,this.secretName=u,this.openSettingsTabAfterwards=i,this.updateVersion=o,this.enableAfterInstall=t.settings.enableAfterInstall}async submitForm(){var o,a,c,u,g,m,l,r;if(this.address==="")return;let t=ye(this.address);if(this.plugin.settings.pluginSubListFrozenVersion.find(d=>d.repo===t)){await this.betaPlugins.addPlugin(t,!1,!1,!1,this.version,!0,this.enableAfterInstall,this.secretName)&&this.close(),(o=this.cancelButton)==null||o.setDisabled(!1),(a=this.addPluginButton)==null||a.setDisabled(!1),(c=this.addPluginButton)==null||c.setButtonText("Add Plugin"),(u=this.versionSetting)==null||u.setDisabled(!1);return}if(!this.version&&Pe(this.plugin,t)){E(this.plugin,"This plugin is already in the list for beta testing",10);return}await this.betaPlugins.addPlugin(t,!1,!1,!1,this.version,!1,this.enableAfterInstall,this.secretName)&&this.close(),(g=this.cancelButton)==null||g.setDisabled(!1),(m=this.addPluginButton)==null||m.setDisabled(!1),(l=this.addPluginButton)==null||l.setButtonText("Add Plugin"),(r=this.versionSetting)==null||r.setDisabled(!1)}updateVersionDropdown(t,n,i=""){let o;t.clear(),n.length>0&&!i&&this.plugin.settings.selectLatestPluginVersionByDefault?(o="latest",this.version="latest"):o=i,n.length<20||L.Platform.isMobile?t.addDropdown(c=>{c.addOption("","Select a version"),c.addOption("latest","Latest version");for(let u of n)c.addOption(u.version,`${u.version} ${u.prerelease?"(Prerelease)":""}`);c.onChange(u=>{var g;this.version=u,(g=this.addPluginButton)==null||g.setDisabled(this.version==="")}),c.setValue(o),c.selectEl.addClass("brat-version-selector"),c.selectEl.style.width="100%"}):t.addButton(c=>{c.setButtonText(o==="latest"?"Latest version":o||"Select a version...").setClass("brat-version-selector").setClass("button").onClick(()=>{let g=[{version:"latest",prerelease:!1},...n];new Ie(this.app,this.address,g,o,l=>{var r;this.version=l,c.setButtonText(l==="latest"?"Latest version":l||"Select a version..."),(r=this.addPluginButton)==null||r.setDisabled(this.version==="")}).open()})})}onOpen(){let t=this.contentEl.createEl("h4");this.address?(t.appendText("Change plugin version: "),t.appendChild(te(this.address))):t.setText("Github repository for beta plugin:"),this.contentEl.createEl("form",{},n=>{var g;n.addClass("brat-modal"),(!this.address||!this.updateVersion)&&new L.Setting(n).setClass("repository-setting").then(l=>{l.addText(r=>{this.repositoryAddressEl=r,r.setPlaceholder("Repository (example: https://github.com/GitHubUserName/repository-name)"),r.setValue(this.address),r.onChange(d=>{var b,w;this.address=ye(d.trim()),this.version!==""&&(!this.address||!this.isGitHubRepositoryMatch(this.address))&&this.versionSetting&&(this.updateVersionDropdown(this.versionSetting,[]),this.versionSetting.settingEl.classList.add("disabled-setting"),this.versionSetting.setDisabled(!0),r.inputEl.classList.remove("valid-repository"),r.inputEl.classList.remove("invalid-repository")),this.version||(this.isGitHubRepositoryMatch(this.address)?(b=this.addPluginButton)==null||b.setDisabled(!1):(w=this.addPluginButton)==null||w.setDisabled(!0))}),r.inputEl.addEventListener("keydown",async d=>{var b,w,p;d.key==="Enter"&&(this.address&&(this.updateVersion&&this.version!==""||!this.updateVersion)&&(d.preventDefault(),(b=this.addPluginButton)==null||b.setDisabled(!0),(w=this.cancelButton)==null||w.setDisabled(!0),(p=this.versionSetting)==nu
Line truncated
|
||||
This does not seem to be an obsidian plugin with valid releases, as there are no releases available.`,15),console.error("BRAT: validateRepository",e,t,n)),null;let m=await Q(g,"manifest.json",this.plugin.settings.debuggingMode,u,c);if(!m)return n&&(E(this.plugin,`${e}
|
||||
This does not seem to be an obsidian plugin, as there is no manifest.json file.`,15),console.error("BRAT: validateRepository",e,t,n)),null;let l=JSON.parse(m);if(!("id"in l))return n&&E(this.plugin,`${e}
|
||||
The plugin id attribute for the release is missing from the manifest file`,15),null;if(!("version"in l))return n&&E(this.plugin,`${e}
|
||||
The version attribute for the release is missing from the manifest file`,15),null;try{let r=Ae(g.tag_name,{includePrerelease:!0,loose:!0}),d=Ae(l.version,{includePrerelease:!0,loose:!0});$t(r,d)!==0&&(n&&E(this.plugin,`${e}
|
||||
Version mismatch detected:
|
||||
Release tag version: ${g.tag_name}
|
||||
Manifest version: ${l.version}
|
||||
|
||||
The release tag version will be used to ensure consistency.`,15),l.version=r.version)}catch(r){}return l}catch(u){if(u instanceof D){let g=`GitHub API rate limit exceeded. Reset in ${u.getMinutesToReset()} minutes.`;throw n&&E(this.plugin,g,15),console.error(`BRAT: validateRepository ${u}`),E(this.plugin,`${u.message} Consider adding a personal access token in BRAT settings for higher limits. See documentation for details.`,20,()=>{window.open("https://github.com/TfTHacker/obsidian42-brat/blob/main/BRAT-DEVELOPER-GUIDE.md#github-api-rate-limits")}),u}if(u instanceof O)throw n&&(u.status===401?E(this.plugin,`${e}
|
||||
GitHub API Authentication error. Please verify that your personal access token is valid and set correctly.`,15):E(this.plugin,`${e}
|
||||
GitHub API error ${u.status}: ${u.message}`,15)),console.error(`BRAT: validateRepository ${u}`),u;return n&&E(this.plugin,`${e}
|
||||
Unspecified error encountered: ${u}, verify debug for more information.`,15),null}}async getAllReleaseFiles(e,t,n="",i=""){let o=i,a=await He(e,this.plugin.settings.debuggingMode,o),c=await Ge(e,n,t,this.plugin.settings.debuggingMode,a,o);if(!c)return Promise.reject("No release found");let u=t||n!=="";return console.log({reallyGetManifestOrNot:u,version:c.tag_name}),{mainJs:await Q(c,"main.js",this.plugin.settings.debuggingMode,a,o),manifest:u?await Q(c,"manifest.json",this.plugin.settings.debuggingMode,a,o):"",styles:await Q(c,"styles.css",this.plugin.settings.debuggingMode,a,o)}}async writeReleaseFilesToPluginFolder(e,t){var o,a;let n=`${(0,k.normalizePath)(`${this.plugin.app.vault.configDir}/plugins/${e}`)}/`,{adapter:i}=this.plugin.app.vault;await i.exists(n)||await i.mkdir(n),await i.write(`${n}main.js`,(o=t.mainJs)!=null?o:""),await i.write(`${n}manifest.json`,(a=t.manifest)!=null?a:""),t.styles&&await i.write(`${n}styles.css`,t.styles)}async addPlugin(e,t=!1,n=!1,i=!1,o="",a=!1,c=this.plugin.settings.enableAfterInstall,u=""){try{this.plugin.settings.debuggingMode&&console.log("BRAT: addPlugin",e,t,n,i,o,a,c,u?"with secret":"public");let g="";u&&u.trim()!==""?(g=await this.plugin.app.secretStorage.getSecret(u)||"",g||E(this.plugin,`Secret not found for token name: ${u}. Please add it to SecretStorage or clear the token name for this plugin.`,10)):this.plugin.settings.globalTokenName&&(g=await this.plugin.app.secretStorage.getSecret(this.plugin.settings.globalTokenName)||"");let m=10,l=await this.validateRepository(e,!0,!0,o,g),r=!!l;if(r||(l=await this.validateRepository(e,!1,!0,o,g)),l===null){let w=`${e}
|
||||
A manifest.json file does not exist in the latest release of the repository. This plugin cannot be installed.`;return await this.plugin.log(w,!0),E(this.plugin,w,m),!1}if(!Object.hasOwn(l,"version")){let w=`${e}
|
||||
The manifest.json file in the latest release or pre-release of the repository does not have a version number in the file. This plugin cannot be installed.`;return await this.plugin.log(w,!0),E(this.plugin,w,m),!1}let d=!1;if(Object.hasOwn(l,"minAppVersion")&&!(0,k.requireApiVersion)(l.minAppVersion)){if(o===""||o==="latest"||!this.plugin.settings.allowIncompatiblePlugins){let p=`Plugin: ${e}
|
||||
|
||||
The manifest.json for this plugin indicates that the Obsidian version of the app needs to be ${l.minAppVersion}, but this installation of Obsidian is ${k.apiVersion}.
|
||||
|
||||
You will need to update your Obsidian to use this plugin or contact the plugin developer for more information.`;return await this.plugin.log(p,!0),E(this.plugin,p,30),!1}if(!await De({app:this.plugin.app,message:createFragment(p=>{p.appendText("Plugin: "),p.createEl("code",{text:e}),p.createEl("br"),p.appendText("The "),p.createEl("code",{text:"manifest.json"}),p.appendText(" for this plugin indicates that the Obsidian version of the app needs to be "),p.createEl("code",{text:l.minAppVersion}),p.appendText(", but this installation of Obsidian is "),p.createEl("code",{text:k.apiVersion}),p.appendText("."),p.createEl("br"),p.appendText("Using this plugin is not recommended and may not work as expected. Use at your own risk."),p.createEl("br"),p.appendText("Do you want to install it anyways?")})}))return!1;d=!0}let b=async()=>{var T,C;let w=await this.getAllReleaseFiles(e,r,o,g);console.log("rFiles",w),(r||w.manifest==="")&&(w.manifest=JSON.stringify(l));let p=JSON.parse((T=w.manifest)!=null?T:"");if(d&&(p.brat={isIncompatible:!0,minAppVersionOriginal:p.minAppVersion},p.minAppVersion=k.apiVersion),k.Platform.isMobile&&p.isDesktopOnly)if(this.plugin.settings.allowIncompatiblePlugins){if(!await De({app:this.plugin.app,message:createFragment(R=>{R.appendText("Plugin: "),R.createEl("code",{text:e}),R.createEl("br"),R.appendText("The "),R.createEl("code",{text:"manifest.json"}),R.appendText(" for this plugin indicates that the plugin has "),R.createEl("code",{text:"isDesktopOnly: true"}),R.appendText(", but you are using a mobile device."),R.createEl("br"),R.appendText("Using this plugin is not recommended and may not work as expected. Use at your own risk."),R.createEl("br"),R.appendText("Do you want to forcefully run it on mobile anyways?")})}))return null;p.isDesktopOnly=!1,(C=p.brat)!=null||(p.brat={}),p.brat.isDesktopOnlyOriginal=!0,p.brat.isIncompatible=!0,d=!0}else{let N=`Plugin: ${e}
|
||||
|
||||
The manifest.json for this plugin indicates that the plugin has isDesktopOnly: true, but you are using a mobile device.
|
||||
|
||||
The plugin will not be installed.`;return await this.plugin.log(N,!0),E(this.plugin,N,30),null}if(d&&(w.manifest=JSON.stringify(p)),this.plugin.settings.debuggingMode&&console.log("BRAT: rFiles.manifest",r,w),w.mainJs===null){let N=`${e}
|
||||
The release is not complete and cannot be downloaded. main.js is missing from the Release`;return await this.plugin.log(N,!0),E(this.plugin,N,m),null}return w};if(!t||a){let w=await b();if(w===null)return!1;if(await this.writeReleaseFilesToPluginFolder(l.id,w),Nt(this.plugin,e,o,d,u),c){let{plugins:p}=this.plugin.app,T=(0,k.normalizePath)(`${p.getPluginFolder()}/${l.id}`);await p.loadManifest(T),await p.enablePluginAndSave(l.id)}if(await this.plugin.app.plugins.loadManifests(),a)await this.reloadPlugin(l.id),await this.plugin.log(`${e} reinstalled`,!0),E(this.plugin,`${e}
|
||||
Plugin has been reinstalled and reloaded with version ${l.version}`,m);else{let p=o===""?"":` (version: ${o})`,T=`${e}${p}
|
||||
The plugin has been registered with BRAT.`;c||(T+=" You may still need to enable it the Community Plugin List."),await this.plugin.log(T,!0),E(this.plugin,T,m)}}else{let w=`${this.plugin.app.vault.configDir}/plugins/${l.id}/`,p="";try{p=await this.plugin.app.vault.adapter.read(`${w}manifest.json`)}catch(R){if(R.errno===-4058||R.errno===-2)return await this.addPlugin(e,!1,r,!1,o,!1,c,u),!0;console.log("BRAT - Local Manifest Load",l.id,JSON.stringify(R,null,2))}if(o!==""&&o!=="latest")return E(this.plugin,`The version of ${e} is frozen, not updating.`,3),!1;let T=await JSON.parse(p),C=Ae(T.version,{includePrerelease:!0,loose:!0}),N=Ae(l.version,{includePrerelease:!0,loose:!0});if($t(C,N)===-1){let R=await b();if(R===null)return!1;if(n){let J=`There is an update available for ${l.id} from version ${T.version} to ${l.version}. `;return await this.plugin.log(`${J}[Release Info](https://github.com/${e}/releases/tag/${l.version})`,!0),E(this.plugin,J,30,()=>{l&&window.open(`https://github.com/${e}/releases/tag/${l.version}`)}),!1}await this.writeReleaseFilesToPluginFolder(l.id,R),await this.plugin.app.plugins.loadManifests(),await this.reloadPlugin(l.id);let P=`${l.id}
|
||||
Plugin has been updated from version ${T.version} to ${l.version}. `;return await this.plugin.log(`${P}[Release Info](https://github.com/${e}/releases/tag/${l.version})`,!0),E(this.plugin,P,30,()=>{l&&window.open(`https://github.com/${e}/releases/tag/${l.version}`)}),!0}return i&&E(this.plugin,`No update available for ${e}`,3),!0}}catch(g){console.error(`BRAT: Error adding plugin ${e}:`,{error:g,updatePluginFiles:t,seeIfUpdatedOnly:n,specifyVersion:o,forceReinstall:a});let m=g instanceof Error?g.message:"Unknown error occurred";return await this.plugin.log(`Error ${t?"updating":"adding"} plugin ${e}: ${m}`,!0),!1}return!0}async reloadPlugin(e){let{plugins:t}=this.plugin.app;try{await t.disablePlugin(e),await t.enablePlugin(e)}catch(n){this.plugin.settings.debuggingMode&&console.log("reload plugin",n)}}async updatePlugin(e,t=!1,n=!1,i=!1,o=""){let a=await this.addPlugin(e,!0,t,n,"",i,!1,o);return!a&&!t&&E(this.plugin,`${e}
|
||||
Update of plugin failed.`),a}async checkForPluginUpdatesAndInstallUpdates(e=!1,t=!1){if(!await Ne()){console.log("BRAT: No internet detected.");return}let n,i="Checking for plugin updates STARTED";await this.plugin.log(i,!0),e&&this.plugin.settings.notificationsEnabled&&(n=new k.Notice(`BRAT
|
||||
${i}`,3e4));let o=new Map(this.plugin.settings.pluginSubListFrozenVersion.map(u=>[u.repo,u.version])),a=new Map(this.plugin.settings.pluginSubListFrozenVersion.map(u=>[u.repo,u.tokenName||""]));for(let u of this.plugin.settings.pluginList){let g=o.get(u);g&&g!=="latest"||await this.updatePlugin(u,t,!1,!1,a.get(u)||"")}let c="Checking for plugin updates COMPLETED";await this.plugin.log(c,!0),e&&(n&&n.hide(),E(this.plugin,c,10))}deletePlugin(e){let t=`Removed ${e} from BRAT plugin list`;this.plugin.log(t,!0),this.plugin.settings.pluginList=this.plugin.settings.pluginList.filter(n=>n!==e),this.plugin.settings.pluginSubListFrozenVersion=this.plugin.settings.pluginSubListFrozenVersion.filter(n=>n.repo!==e),this.plugin.saveSettings()}getEnabledDisabledPlugins(e){let t=this.plugin.app.plugins,n=Object.values(t.manifests),i=Object.values(t.plugins).map(o=>o.manifest);return e?n.filter(o=>i.find(a=>o.id===a.id)):n.filter(o=>!i.find(a=>o.id===a.id))}checkIncompatiblePlugins(){let e=this.plugin.settings.pluginSubListFrozenVersion.filter(t=>t.isIncompatible).map(t=>t.repo);e.length>0&&E(this.plugin,`The following incompatible plugins were forcefully installed by BRAT and may not work as expected:
|
||||
${e.join(`
|
||||
`)}`,30)}};var _=require("obsidian");var se=async(s,e,t)=>{let n=await G(e,!0,s.settings.debuggingMode);if(n||(n=await G(e,!1,s.settings.debuggingMode)),!n)return E(s,"There is no theme.css or theme-beta.css file in the root path of this repository, so there is no theme to install."),!1;let i=await Rt(e,s.settings.debuggingMode);if(!i)return E(s,"There is no manifest.json file in the root path of this repository, so theme cannot be installed."),!1;let o=await JSON.parse(i),a=(0,_.normalizePath)(Un(s)+o.name),{adapter:c}=s.app.vault;await c.exists(a)||await c.mkdir(a),await c.write((0,_.normalizePath)(`${a}/theme.css`),n),await c.write((0,_.normalizePath)(`${a}/manifest.json`),i),Lt(s,e,Z(n));let u="";return t?(At(s,e,n),u=`${o.name} theme installed from ${e}. `,setTimeout(()=>{s.app.customCss.setTheme(o.name)},500)):u=`${o.name} theme updated from ${e}.`,s.log(`${u}[Theme Info](https://github.com/${e})`,!1),E(s,u,20,()=>{window.open(`https://github.com/${e}`)}),!0},q=async(s,e)=>{if(!await Ne()){console.log("BRAT: No internet detected.");return}let t,n="Checking for beta theme updates STARTED";await s.log(n,!0),e&&s.settings.notificationsEnabled&&(t=new _.Notice(`BRAT
|
||||
${n}`,3e4));for(let o of s.settings.themesList){let a=await ee(o.repo,!0,s.settings.debuggingMode);a==="0"&&(a=await ee(o.repo,!1,s.settings.debuggingMode)),console.log("BRAT: lastUpdateOnline",a),a!==o.lastUpdate&&await se(s,o.repo,!1)}let i="Checking for beta theme updates COMPLETED";(async()=>await s.log(i,!0))(),e&&(s.settings.notificationsEnabled&&t&&t.hide(),E(s,i))},Ce=(s,e)=>{s.settings.themesList=s.settings.themesList.filter(n=>n.repo!==e),s.saveSettings();let t=`Removed ${e} from BRAT themes list and will no longer be updated. However, the theme files still exist in the vault. To remove them, go into Settings > Appearance and remove the theme.`;s.log(t,!0),E(s,t)},Un=s=>`${(0,_.normalizePath)(`${s.app.vault.configDir}/themes`)}/`;var xt="brat-migrations";async function _n(s,e){try{let t=await s.vault.adapter.read(`${s.vault.configDir}/plugins/obsidian42-brat/${xt}.json`);return JSON.parse(t).appliedMigrations.includes(e)}catch(t){return!1}}async function Hn(s,e){try{let t=`${s.vault.configDir}/plugins/obsidian42-brat/${xt}.json`,n={appliedMigrations:[]};try{let i=await s.vault.adapter.read(t);n=JSON.parse(i)}catch(i){}n.appliedMigrations.includes(e)||(n.appliedMigrations.push(e),await s.vault.adapter.write(t,JSON.stringify(n,null,2)))}catch(t){console.error(`BRAT: Failed to mark migration ${e} complete:`,t)}}async function Ot(s,e,t){let n="tokens-to-secretstorage-v1";if(!await _n(s,n))try{let i=0,o=u=>{let m=`brat-gh-${u.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}`;return m.length>64?m.substring(0,64).replace(/-$/,""):m},a=u=>{let g=s.secretStorage.listSecrets();for(let m of g)if(s.secretStorage.getSecret(m)===u)return m;return null},c=(u,g)=>{let m=a(u);return m?(console.log(`BRAT: Reusing existing secret "${m}"`),m):(s.secretStorage.setSecret(g,u),console.log(`BRAT: Created new secret "${g}"`),g)};if(e.personalAccessToken&&e.personalAccessToken.trim()!==""){let u=e.personalAccessToken.trim(),m=c(u,"brat-gh-global");e.globalTokenName=m,e.personalAccessToken="",i++}if(e.pluginSubListFrozenVersion){for(let u of e.pluginSubListFrozenVersion)if(u.token&&u.token.trim()!==""){let g=u.token.trim(),m=o(u.repo),l=c(g,m);u.tokenName=l,u.token=void 0,i++}}i>0&&(await t(),console.log(`BRAT: Migrated ${i} token(s) to SecretStorage`)),await Hn(s,n)}catch(i){console.error("BRAT: Failed to migrate tokens to SecretStorage:",i)}}var H=require("obsidian");var B=class extends H.Modal{constructor(e,t=!1){super(e.app),this.plugin=e,this.address="",this.openSettingsTabAfterwards=t}async submitForm(){if(this.address==="")return;let e=this.address.replace("https://github.com/","");if(Ct(this.plugin,e)){E(this.plugin,"This theme is already in the list for beta testing",10);return}await se(this.plugin,e,!0)&&this.close()}onOpen(){this.contentEl.createEl("h4",{text:"Github repository for beta theme:"}),this.contentEl.createEl("form",{},e=>{e.addClass("brat-modal"),new H.Setting(e).addText(i=>{i.setPlaceholder("Repository (example: https://github.com/GitHubUserName/repository-name"),i.setValue(this.address),i.onChange(o=>{this.address=o.trim()}),i.inputEl.addEventListener("keydown",o=>{o.key==="Enter"&&this.address!==" "&&(o.preventDefault(),this.submitForm())}),i.inputEl.style.width="100%",window.setTimeout(()=>{let o=document.querySelector(".setting-item-info");o&&o.remove(),i.inputEl.focus()},10)}),e.createDiv("modal-button-container",i=>{new H.ButtonComponent(i).setButtonText("Never mind").onClick(()=>{this.close()}),new H.ButtonComponent(i).setButtonText("Add theme").setCta().onClick(o=>{o.preventDefault(),console.log("Add theme button clicked"),this.address!==""&&this.submitForm()})});let t=e.createDiv();t.style.borderTop="1px solid #ccc",t.style.marginTop="30px";let n=t.createSpan();n.createEl("a",{href:"https://bit.ly/o42-twitter",text:"TFTHacker"}),n.appendText(" and "),n.createEl("a",{href:"https://github.com/johannrichard",text:"johannrichard"}),n.style.fontStyle="italic",t.appendChild(n),z(t,!1),window.setTimeout(()=>{let i=e.querySelectorAll(".brat-modal .setting-item-info");for(let o of Array.from(i))o.remove()},50)})}onClose(){this.openSettingsTabAfterwards&&(this.plugin.app.setting.openTab(),this.plugin.app.setting.openTabById(this.plugin.APP_ID))}};var Ft=require("obsidian");function Bt(){(0,Ft.addIcon)("BratIcon",'<path fill="currentColor" stroke="currentColor" d="M 41.667969 41.667969 C 41.667969 39.367188 39.800781 37.5 37.5 37.5 C 35.199219 37.5 33.332031 39.367188 33.332031 41.667969 C 33.332031 43.96875 35.199219 45.832031 37.5 45.832031 C 39.800781 45.832031 41.667969 43.96875 41.667969 41.667969 Z M 60.417969 58.582031 C 59.460938 58.023438 58.320312 57.867188 57.25 58.148438 C 56.179688 58.429688 55.265625 59.125 54.707031 60.082031 C 53.746094 61.777344 51.949219 62.820312 50 62.820312 C 48.050781 62.820312 46.253906 61.777344 45.292969 60.082031 C 44.734375 59.125 43.820312 58.429688 42.75 58.148438 C 41.679688 57.867188 40.539062 58.023438 39.582031 58.5820
Line truncated
|
||||
${o}`,3),this.plugin.betaPlugins.updatePlugin(i.info,!1,!0,!1,a==null?void 0:a.token)})}},{id:"reinstallOnePlugin",icon:"BratIcon",name:"Plugins: Choose a single plugin to reinstall",showInRibbon:!0,callback:()=>{let e=new Set(this.plugin.settings.pluginSubListFrozenVersion.map(i=>i.repo)),t=Object.values(this.plugin.settings.pluginList).filter(i=>!e.has(i)).map(i=>({display:i,info:i})),n=new S(this.plugin);n.setSuggesterData(t),n.display(i=>{let o=`Reinstalling ${i.info}`;E(this.plugin,`
|
||||
${o}`,3),this.plugin.log(o,!0),this.plugin.betaPlugins.updatePlugin(i.info,!1,!1,!0)})}},{id:"restartPlugin",icon:"BratIcon",name:"Plugins: Restart a plugin that is already installed",showInRibbon:!0,callback:()=>{let e=Object.values(this.plugin.app.plugins.manifests).map(n=>({display:n.id,info:n.id})),t=new S(this.plugin);t.setSuggesterData(e),t.display(n=>{E(this.plugin,`${n.info}
|
||||
Plugin reloading .....`,5),this.plugin.betaPlugins.reloadPlugin(n.info)})}},{id:"disablePlugin",icon:"BratIcon",name:"Plugins: Disable a plugin - toggle it off",showInRibbon:!0,callback:()=>{let e=this.plugin.betaPlugins.getEnabledDisabledPlugins(!0).map(n=>({display:`${n.name} (${n.id})`,info:n.id})),t=new S(this.plugin);t.setSuggesterData(e),t.display(n=>{this.plugin.log(`${n.display} plugin disabled`,!1),this.plugin.settings.debuggingMode&&console.log(n.info),this.plugin.app.plugins.disablePluginAndSave(n.info)})}},{id:"enablePlugin",icon:"BratIcon",name:"Plugins: Enable a plugin - toggle it on",showInRibbon:!0,callback:()=>{let e=this.plugin.betaPlugins.getEnabledDisabledPlugins(!1).map(n=>({display:`${n.name} (${n.id})`,info:n.id})),t=new S(this.plugin);t.setSuggesterData(e),t.display(n=>{this.plugin.log(`${n.display} plugin enabled`,!1),this.plugin.app.plugins.enablePluginAndSave(n.info)})}},{id:"openGitHubZRepository",icon:"BratIcon",name:"Plugins: Open the GitHub repository for a plugin",showInRibbon:!0,callback:async()=>{let e=await vt(this.plugin.settings.debuggingMode);if(e){let t=Object.values(e).map(o=>({display:`Plugin: ${o.name} (${o.repo})`,info:o.repo})),n=Object.values(this.plugin.settings.pluginList).map(o=>({display:`BRAT: ${o}`,info:o}));for(let o of t)n.push(o);let i=new S(this.plugin);i.setSuggesterData(n),i.display(o=>{o.info&&window.open(`https://github.com/${o.info}`)})}}},{id:"openGitHubRepoTheme",icon:"BratIcon",name:"Themes: Open the GitHub repository for a theme (appearance)",showInRibbon:!0,callback:async()=>{let e=await Pt(this.plugin.settings.debuggingMode);if(e){let t=Object.values(e).map(i=>({display:`Theme: ${i.name} (${i.repo})`,info:i.repo})),n=new S(this.plugin);n.setSuggesterData(t),n.display(i=>{i.info&&window.open(`https://github.com/${i.info}`)})}}},{id:"opentPluginSettings",icon:"BratIcon",name:"Plugins: Open Plugin Settings Tab",showInRibbon:!0,callback:()=>{let e=this.plugin.app.setting,t=Object.values(e.pluginTabs).map(o=>({display:`Plugin: ${o.name}`,info:o.id})),n=new S(this.plugin),i=Object.values(e.settingTabs).map(o=>({display:`Core: ${o.name}`,info:o.id}));for(let o of t)i.push(o);n.setSuggesterData(i),n.display(o=>{e.open(),e.openTabById(o.info)})}},{id:"GrabBetaTheme",icon:"BratIcon",name:"Themes: Grab a beta theme for testing from a Github repository",showInRibbon:!0,callback:()=>{new B(this.plugin).open()}},{id:"updateBetaThemes",icon:"BratIcon",name:"Themes: Update beta themes",showInRibbon:!0,callback:async()=>{await q(this.plugin,!0)}},{id:"allCommands",icon:"BratIcon",name:"All Commands list",showInRibbon:!1,callback:()=>{this.ribbonDisplayCommands()}}];this.plugin=e;for(let t of this.bratCommands)this.plugin.addCommand({id:t.id,name:t.name,icon:t.icon,callback:()=>{t.callback()}})}ribbonDisplayCommands(){let e=[];for(let a of this.bratCommands)a.showInRibbon&&e.push({display:a.name,info:a.callback});let t=new S(this.plugin),n=this.plugin.app.setting,i=Object.values(n.settingTabs).map(a=>({display:`Core: ${a.name}`,info:()=>{n.open(),n.openTabById(a.id)}})),o=Object.values(n.pluginTabs).map(a=>({display:`Plugin: ${a.name}`,info:()=>{n.open(),n.openTabById(a.id)}}));e.push({display:"---- Core Plugin Settings ----",info:()=>{this.ribbonDisplayCommands()}});for(let a of i)e.push(a);e.push({display:"---- Plugin Settings ----",info:()=>{this.ribbonDisplayCommands()}});for(let a of o)e.push(a);t.setSuggesterData(e),t.display(a=>{typeof a.info=="function"&&a.info()})}};var A=require("obsidian");var Le=class extends A.PluginSettingTab{constructor(t,n){super(t,n);this.accessTokenSetting=null;this.accessTokenButton=null;this.tokenInfo=null;this.validator=null;this.plugin=n}display(){let{containerEl:t}=this;t.empty(),t.addClass("brat-settings"),new A.Setting(t).setName("Auto-enable plugins after installation").setDesc('If enabled beta plugins will be automatically enabled after installtion by default. Note: you can toggle this on and off for each plugin in the "Add Plugin" form.').addToggle(l=>{l.setValue(this.plugin.settings.enableAfterInstall).onChange(async r=>{this.plugin.settings.enableAfterInstall=r,await this.plugin.saveSettings()})}),new A.Setting(t).setName("Auto-update plugins at startup").setDesc("If enabled all beta plugins will be checked for updates each time Obsidian starts. Note: this does not update frozen version plugins.").addToggle(l=>{l.setValue(this.plugin.settings.updateAtStartup).onChange(async r=>{this.plugin.settings.updateAtStartup=r,await this.plugin.saveSettings()})}),new A.Setting(t).setName("Auto-update themes at startup").setDesc("If enabled all beta themes will be checked for updates each time Obsidian starts.").addToggle(l=>{l.setValue(this.plugin.settings.updateThemesAtStartup).onChange(async r=>{this.plugin.settings.updateThemesAtStartup=r,await this.plugin.saveSettings()})}),new A.Setting(t).setName("Select latest plugin version by default").setDesc("If enabled the latest version will be selected by default when adding
Line truncated
|
||||
`," ")}
|
||||
`,u=s.app.vault.getAbstractFileByPath(n);u?await s.app.vault.append(u,c):u=await s.app.vault.create(n,c)}}var ke=class extends tn.Plugin{constructor(){super(...arguments);this.APP_NAME="BRAT";this.APP_ID="obsidian42-brat";this.settings=je;this.betaPlugins=new ne(this);this.commands=new ie(this);this.bratApi=new oe(this);this.obsidianProtocolHandler=t=>{if(!t.plugin&&!t.theme){E(this,"Could not locate the repository from the URL.",10);return}for(let n of["plugin","theme"])if(t[n]){let i;switch(n){case"plugin":i=new U(this,this.betaPlugins,!0,!1,t[n],t.version?t.version:void 0),i.open();break;case"theme":i=new B(this),i.address=t[n],i.open();break}return}}}onload(){console.log(`loading ${this.APP_NAME}`),Bt(),this.addRibbonIcon("BratIcon","BRAT",()=>{this.commands.ribbonDisplayCommands()}),this.loadSettings().then(async()=>{await Ot(this.app,this.settings,()=>this.saveSettings()),this.app.workspace.onLayoutReady(()=>{this.addSettingTab(new Le(this.app,this)),this.registerObsidianProtocolHandler("brat",this.obsidianProtocolHandler),this.betaPlugins.checkIncompatiblePlugins(),this.settings.updateAtStartup&&setTimeout(()=>{this.betaPlugins.checkForPluginUpdatesAndInstallUpdates(!1)},6e4),this.settings.updateThemesAtStartup&&setTimeout(()=>{q(this,!1)},12e4),setTimeout(()=>{window.bratAPI=this.bratApi},500)})}).catch(t=>{console.error("Failed to load settings:",t)})}async log(t,n=!1){await en(this,t,n)}onunload(){console.log(`unloading ${this.APP_NAME}`)}async loadSettings(){this.settings=Object.assign({},je,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}};
|
||||
|
||||
/* nosourcemap */
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"id": "obsidian42-brat",
|
||||
"name": "BRAT",
|
||||
"version": "2.0.4",
|
||||
"minAppVersion": "1.11.4",
|
||||
"description": "Easily install a beta version of a plugin for testing.",
|
||||
"author": "TfTHacker",
|
||||
"authorUrl": "https://github.com/TfTHacker/obsidian42-brat",
|
||||
"helpUrl": "https://tfthacker.com/BRAT",
|
||||
"isDesktopOnly": false,
|
||||
"fundingUrl": {
|
||||
"Visit my site": "https://tfthacker.com"
|
||||
}
|
||||
}
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
.brat-modal .modal-button-container {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.brat-modal .disabled-setting {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.brat-modal .disabled-setting:hover {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* Input validation styles */
|
||||
.brat-settings .valid-input,
|
||||
.brat-modal .valid-repository {
|
||||
border-color: var(--color-green);
|
||||
}
|
||||
.brat-settings .invalid-input,
|
||||
.brat-modal .invalid-repository {
|
||||
border-color: var(--color-red);
|
||||
}
|
||||
.brat-settings .validation-error,
|
||||
.brat-modal .validation-error {
|
||||
border-color: var(--color-orange);
|
||||
}
|
||||
|
||||
/* Version selector */
|
||||
.brat-version-selector {
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
justify-content: left;
|
||||
}
|
||||
|
||||
.brat-token-input {
|
||||
min-width: 33%;
|
||||
}
|
||||
|
||||
/* Token info container styles */
|
||||
.brat-token-info {
|
||||
margin-top: 8px;
|
||||
font-size: 0.8em;
|
||||
padding: 8px;
|
||||
border-radius: 4px;
|
||||
background-color: var(--background-secondary);
|
||||
}
|
||||
|
||||
/* Token status indicators */
|
||||
.brat-token-info.valid,
|
||||
.brat-token-status.valid {
|
||||
color: var(--color-green);
|
||||
}
|
||||
|
||||
.brat-token-info.invalid,
|
||||
.brat-token-status.invalid {
|
||||
color: var(--color-red);
|
||||
}
|
||||
|
||||
.brat-token-info.valid {
|
||||
border-left: 3px solid var(--color-green);
|
||||
}
|
||||
|
||||
.brat-token-info.invalid {
|
||||
border-left: 3px solid var(--color-red);
|
||||
}
|
||||
|
||||
/* Token details and status */
|
||||
.brat-token-status {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.brat-token-details {
|
||||
margin-top: 4px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
/* Token warnings */
|
||||
.brat-token-warning {
|
||||
color: var(--color-orange);
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
/* Token additional info */
|
||||
.brat-token-scopes,
|
||||
.brat-token-rate {
|
||||
color: var(--text-muted);
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
/* Flex break utility */
|
||||
.brat-modal .break {
|
||||
flex-basis: 100%;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
/* Validation status */
|
||||
.brat-modal .validation-status-error {
|
||||
color: var(--text-error);
|
||||
}
|
||||
|
||||
.brat-modal .validation-status {
|
||||
margin-top: 0.5em;
|
||||
margin-bottom: 0.5em;
|
||||
font-size: 0.8em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.confirm-modal .ok-button {
|
||||
margin-right: 10px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/* Hide filtered plugin items */
|
||||
.brat-plugin-item[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Hide filtered theme items */
|
||||
.brat-theme-item[hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Filter and button layout */
|
||||
.brat-filter-and-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 10px;
|
||||
margin: 0.75em 0;
|
||||
}
|
||||
|
||||
.brat-filter-input {
|
||||
max-width: 300px;
|
||||
padding: 4px 8px;
|
||||
border: 1px solid var(--background-modifier-border);
|
||||
border-radius: 4px;
|
||||
background-color: var(--background-secondary);
|
||||
color: var(--text-normal);
|
||||
}
|
||||
|
||||
.brat-filter-input:focus {
|
||||
outline: none;
|
||||
border-color: var(--interactive-accent);
|
||||
}
|
||||
|
||||
.brat-filter-and-button .setting-item {
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.brat-filter-and-button .setting-item-control {
|
||||
justify-content: flex-end;
|
||||
}
|
||||
Vendored
+8
-7
@@ -15,8 +15,8 @@
|
||||
"state": {
|
||||
"file": "2026년 월력형 메모형 일정(2월).canvas",
|
||||
"viewState": {
|
||||
"x": 1353.2124212357014,
|
||||
"y": 46656.190815059104,
|
||||
"x": 1317.9318756549426,
|
||||
"y": 45283.132419615395,
|
||||
"zoom": -0.43938619755800934
|
||||
}
|
||||
},
|
||||
@@ -168,14 +168,18 @@
|
||||
"command-palette:명령어 팔레트 열기": false,
|
||||
"bases:새 베이스 생성하기": false,
|
||||
"remotely-save:Remotely Save": false,
|
||||
"obsidian-kanban:새 보드 만들기": false
|
||||
"obsidian-kanban:새 보드 만들기": false,
|
||||
"obsidian42-brat:BRAT": false,
|
||||
"notion-bases:Notion bases": false
|
||||
}
|
||||
},
|
||||
"active": "a0b2e6d345b95980",
|
||||
"lastOpenFiles": [
|
||||
"이름 없는 보드.md",
|
||||
"2026년 월력형 메모형 일정(2월).canvas",
|
||||
"_database.md",
|
||||
"점호.md",
|
||||
"[점호.md",
|
||||
"2026년 월력형 메모형 일정(2월).canvas",
|
||||
"30연대 26년도 예산.md",
|
||||
"2026년 월력형 메모형 일정(2월) (2).canvas",
|
||||
"2025년 월력형 메모형 일정.canvas",
|
||||
@@ -185,7 +189,6 @@
|
||||
"desktop_hp_obsidian/inbox/치장총기.md",
|
||||
"desktop_hp_obsidian/치장총기.md",
|
||||
"inbox/치장총기.md",
|
||||
"이름 없는 보드.md",
|
||||
"gemini_mikrotik_관리자접속정리.md",
|
||||
"가로등 파손.md",
|
||||
"1774062006949.jpg",
|
||||
@@ -206,8 +209,6 @@
|
||||
"Excalidraw/이름 없는 보드.md",
|
||||
"desktop_hp_obsidian/inbox/이름 없는 보드.md",
|
||||
"desktop_hp_obsidian/이름 없는 보드.md",
|
||||
"이름 없는 보드 1.md",
|
||||
"desktop_hp_obsidian/inbox/이름 없는 보드 1.md",
|
||||
"30연대재산현황/신형수통피/무제.base",
|
||||
"30연대재산현황/신형수통피",
|
||||
"30연대재산현황",
|
||||
|
||||
Reference in new issue
Block a user