vault backup: 2026-06-04 16:59:32
This commit is contained in:
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "homepage",
|
||||
"name": "Homepage",
|
||||
"version": "4.4.2",
|
||||
"version": "4.4.4",
|
||||
"minAppVersion": "1.12.2",
|
||||
"description": "Open a specified note, canvas, base, or workspace on startup, or set it for quick access later.",
|
||||
"author": "novov",
|
||||
|
||||
+1
-1
@@ -3,6 +3,6 @@
|
||||
* https://github.com/logonoff/obsidian-inline-spoilers
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
"use strict";var u=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var C=(t,e)=>{for(var i in e)u(t,i,{get:e[i],enumerable:!0})},_=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of N(e))!A.call(t,o)&&o!==i&&u(t,o,{get:()=>e[o],enumerable:!(s=y(e,o))||s.enumerable});return t};var v=t=>_(u({},"__esModule",{value:!0}),t);var H={};C(H,{default:()=>g});module.exports=v(H);var D=require("@codemirror/language"),x=require("@codemirror/state"),c=require("@codemirror/view"),n=require("obsidian"),P=/\|\|(.+?)\|\|/g,M="p, li, h1, h2, h3, h4, h5, h6, blockquote, em, strong, b, i, a, th, td",T=t=>{if(t.nodeType===Node.TEXT_NODE){if(!t.textContent||!t.parentNode)return;let e=t.textContent.split(/(\|\|[^|]+\|\|)/g),i=document.createDocumentFragment();for(let s of e)if(P.test(s)){let o=s.slice(2,-2),l=createSpan({cls:"inline_spoilers-spoiler",text:o});i.appendChild(l)}else{let o=document.createTextNode(s);i.appendChild(o)}t.parentNode.replaceChild(i,t)}else t.nodeType===Node.ELEMENT_NODE&&Array.from(t.childNodes).forEach(T)},w=(t,e)=>{let i=t.findAll(M);for(let o of i)Array.from(o.childNodes).forEach(T);let s=t.findAll(".inline_spoilers-spoiler");for(let o of s)e.registerDomEvent(o,"click",()=>{o.classList.toggle("inline_spoilers-revealed")})},V=t=>{let e=Array.from(t.containerEl.querySelectorAll(".inline_spoilers-spoiler"));for(let i of e){let s=i.parentNode,o=document.createTextNode(`||${i.innerText}||`);s&&s.replaceChild(o,i)}},L=c.Decoration.mark({class:"inline_spoilers-editor-spoiler",tagName:"span"}),R=c.Decoration.mark({class:"inline_spoilers-editor-spoiler-delimiter",tagName:"span"}),m=class{constructor(e){this.decorations=this.buildDecorations(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=this.buildDecorations(e.view))}destroy(){}buildDecorations(e){let i=new x.RangeSetBuilder,s=[];for(let{from:o,to:l}of e.visibleRanges)(0,D.syntaxTree)(e.state).iterate({from:o,to:l,enter(E){let k=e.state.sliceDoc(E.from,E.to),h;for(;(h=P.exec(k))!==null;){let a=h.index,p=a+h[0].length,S=e.state.sliceDoc(a,p);!S.startsWith("||")&&!S.endsWith("||")||(s.push({from:a,to:a+2,isDelimiter:!0}),s.push({from:a+2,to:p-2,isDelimiter:!1}),s.push({from:p-2,to:p,isDelimiter:!0}))}}});s.sort((o,l)=>o.from-l.from);for(let o of s)i.add(o.from,o.to,o.isDelimiter?R:L);return i.finish()}},I={decorations:t=>t.decorations},d=c.ViewPlugin.fromClass(m,I),r=[],O=t=>{r.includes(d)||r.push(d),t.updateOptions()},b=t=>{let e=r.indexOf(d);e!==-1&&r.splice(e,1),t.updateOptions()},W={showAllSpoilers:!1,enableEditorMode:!1},f=class extends n.PluginSettingTab{constructor(e,i){super(e,i),this.plugin=i}display(){let{containerEl:e}=this;e.empty(),new n.Setting(e).setName("Reveal all spoilers").setDesc("Always show all inline spoilers, regardless of whether they are clicked or not.").addToggle(i=>i.setValue(this.plugin.settings.showAllSpoilers).onChange(async s=>{this.plugin.settings.showAllSpoilers=s,this.app.workspace.containerEl.toggleClass("inline_spoilers-revealed",s),await this.plugin.saveSettings()})),new n.Setting(e).setName("Hide spoilers in editor view (experimental)").setDesc("Hide spoilers in the editor until your cursor is on the same line as the spoiler.").addToggle(i=>i.setValue(this.plugin.settings.enableEditorMode).onChange(async s=>{this.plugin.settings.enableEditorMode=s,s?O(this.app.workspace):b(this.app.workspace),await this.plugin.saveSettings()}))}},g=class extends n.Plugin{async onload(){await this.loadSettings();let e=this.app.workspace.containerEl.querySelector(".markdown-reading-view");e&&w(e,this),this.registerMarkdownPostProcessor(i=>{w(i,this)}),this.addCommand({id:"create-spoiler",name:"Create spoiler",editorCallback:i=>{let s=i.getSelection();i.replaceSelection(`||${s}||`)}}),this.registerEditorExtension(r),this.addSettingTab(new f(this.app,this))}onunload(){this.app.workspace.containerEl.classList.remove("inline_spoilers-revealed"),V(this.app.workspace),b(this.app.workspace)}async loadSettings(){this.settings=Object.assign({},W,await this.loadData()),this.app.workspace.containerEl.toggleClass("inline_spoilers-revealed",this.settings.showAllSpoilers),this.settings.enableEditorMode&&r.push(d)}async saveSettings(){await this.saveData(this.settings)}};
|
||||
"use strict";var u=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var A=Object.prototype.hasOwnProperty;var C=(t,e)=>{for(var i in e)u(t,i,{get:e[i],enumerable:!0})},v=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of N(e))!A.call(t,o)&&o!==i&&u(t,o,{get:()=>e[o],enumerable:!(s=y(e,o))||s.enumerable});return t};var _=t=>v(u({},"__esModule",{value:!0}),t);var H={};C(H,{default:()=>g});module.exports=_(H);var D=require("@codemirror/language"),x=require("@codemirror/state"),c=require("@codemirror/view"),n=require("obsidian"),P=/\|\|(.+?)\|\|/g,M="p, li, h1, h2, h3, h4, h5, h6, blockquote, em, strong, b, i, a, th, td",T=t=>{if(t.nodeType===Node.TEXT_NODE){if(!t.textContent||!t.parentNode)return;let e=t.textContent.split(/(\|\|[^|]+\|\|)/g),i=createFragment();for(let s of e)if(P.test(s)){let o=s.slice(2,-2),l=createSpan({cls:"inline_spoilers-spoiler",text:o});i.appendChild(l)}else{let o=activeDocument.createTextNode(s);i.appendChild(o)}t.parentNode.replaceChild(i,t)}else t.nodeType===Node.ELEMENT_NODE&&Array.from(t.childNodes).forEach(T)},w=(t,e)=>{let i=t.findAll(M);for(let o of i)Array.from(o.childNodes).forEach(T);let s=t.findAll(".inline_spoilers-spoiler");for(let o of s)e.registerDomEvent(o,"click",()=>{o.classList.toggle("inline_spoilers-revealed")})},V=t=>{let e=Array.from(t.containerEl.querySelectorAll(".inline_spoilers-spoiler"));for(let i of e){let s=i.parentNode,o=activeDocument.createTextNode(`||${i.innerText}||`);s&&s.replaceChild(o,i)}},L=c.Decoration.mark({class:"inline_spoilers-editor-spoiler",tagName:"span"}),R=c.Decoration.mark({class:"inline_spoilers-editor-spoiler-delimiter",tagName:"span"}),m=class{constructor(e){this.decorations=this.buildDecorations(e)}update(e){(e.docChanged||e.viewportChanged)&&(this.decorations=this.buildDecorations(e.view))}destroy(){}buildDecorations(e){let i=new x.RangeSetBuilder,s=[];for(let{from:o,to:l}of e.visibleRanges)(0,D.syntaxTree)(e.state).iterate({from:o,to:l,enter(E){let k=e.state.sliceDoc(E.from,E.to),h;for(;(h=P.exec(k))!==null;){let a=h.index,p=a+h[0].length,S=e.state.sliceDoc(a,p);!S.startsWith("||")&&!S.endsWith("||")||(s.push({from:a,to:a+2,isDelimiter:!0}),s.push({from:a+2,to:p-2,isDelimiter:!1}),s.push({from:p-2,to:p,isDelimiter:!0}))}}});s.sort((o,l)=>o.from-l.from);for(let o of s)i.add(o.from,o.to,o.isDelimiter?R:L);return i.finish()}},I={decorations:t=>t.decorations},d=c.ViewPlugin.fromClass(m,I),r=[],O=t=>{r.includes(d)||r.push(d),t.updateOptions()},b=t=>{let e=r.indexOf(d);e!==-1&&r.splice(e,1),t.updateOptions()},W={showAllSpoilers:!1,enableEditorMode:!1},f=class extends n.PluginSettingTab{constructor(e,i){super(e,i),this.plugin=i}display(){let{containerEl:e}=this;e.empty(),new n.Setting(e).setName("Reveal all spoilers").setDesc("Always show all inline spoilers, regardless of whether they are clicked or not.").addToggle(i=>i.setValue(this.plugin.settings.showAllSpoilers).onChange(async s=>{this.plugin.settings.showAllSpoilers=s,this.app.workspace.containerEl.toggleClass("inline_spoilers-revealed",s),await this.plugin.saveSettings()})),new n.Setting(e).setName("Hide spoilers in editor view (experimental)").setDesc("Hide spoilers in the editor until your cursor is on the same line as the spoiler.").addToggle(i=>i.setValue(this.plugin.settings.enableEditorMode).onChange(async s=>{this.plugin.settings.enableEditorMode=s,s?O(this.app.workspace):b(this.app.workspace),await this.plugin.saveSettings()}))}},g=class extends n.Plugin{async onload(){await this.loadSettings();let e=this.app.workspace.containerEl.querySelector(".markdown-reading-view");e&&w(e,this),this.registerMarkdownPostProcessor(i=>{w(i,this)}),this.addCommand({id:"create-spoiler",name:"Create spoiler",editorCallback:i=>{let s=i.getSelection();i.replaceSelection(`||${s}||`)}}),this.registerEditorExtension(r),this.addSettingTab(new f(this.app,this))}onunload(){this.app.workspace.containerEl.classList.remove("inline_spoilers-revealed"),V(this.app.workspace),b(this.app.workspace)}async loadSettings(){this.settings=Object.assign({},W,await this.loadData()),this.app.workspace.containerEl.toggleClass("inline_spoilers-revealed",this.settings.showAllSpoilers),this.settings.enableEditorMode&&r.push(d)}async saveSettings(){await this.saveData(this.settings)}};
|
||||
|
||||
/* nosourcemap */
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "inline-spoilers",
|
||||
"name": "Inline spoilers",
|
||||
"version": "1.2.5",
|
||||
"version": "1.2.6",
|
||||
"minAppVersion": "1.6.5",
|
||||
"description": "Adds Discord-like syntax for inline spoilers.",
|
||||
"author": "logonoff",
|
||||
|
||||
+21
-5
@@ -13,15 +13,25 @@ body {
|
||||
--inline-spoilers-spoiler-radius: var(--radius-s);
|
||||
}
|
||||
|
||||
/* spoiler bar */
|
||||
/**
|
||||
* hidden spoilers
|
||||
*/
|
||||
/** used in reader mode */
|
||||
.inline_spoilers-spoiler,
|
||||
|
||||
/** used in spoiler content in editor mode */
|
||||
.inline_spoilers-editor-spoiler,
|
||||
|
||||
/** used in delimiter in editor mode */
|
||||
.inline_spoilers-editor-spoiler-delimiter {
|
||||
/* obscured */
|
||||
background-color: var(--inline-spoilers-hidden-background) !important;
|
||||
color: var(--inline-spoilers-hidden-foreground) !important;
|
||||
}
|
||||
|
||||
/**
|
||||
* revealed spoilers
|
||||
*/
|
||||
/** used when a hidden spoiler is revealed by clicking in reader mode */
|
||||
.inline_spoilers-spoiler.inline_spoilers-revealed,
|
||||
|
||||
@@ -33,27 +43,31 @@ body {
|
||||
.inline_spoilers-revealed .inline_spoilers-spoiler,
|
||||
.inline_spoilers-revealed .inline_spoilers-editor-spoiler,
|
||||
.inline_spoilers-revealed .inline_spoilers-editor-spoiler-delimiter {
|
||||
/* revealed */
|
||||
background-color: var(--inline-spoilers-revealed-background) !important;
|
||||
color: var(--inline-spoilers-revealed-foreground) !important;
|
||||
}
|
||||
|
||||
/* reader */
|
||||
/**
|
||||
* spoiler border radius
|
||||
*/
|
||||
/* reader mode always shows one contiguous spoiler with rounded corners */
|
||||
.inline_spoilers-spoiler {
|
||||
border-radius: var(--inline-spoilers-spoiler-radius);
|
||||
}
|
||||
|
||||
/* editor */
|
||||
/* editor mode, when a spoiler is hidden, does not display delimiters (||) */
|
||||
.is-live-preview .inline_spoilers-editor-spoiler {
|
||||
border-radius: var(--inline-spoilers-spoiler-radius);
|
||||
}
|
||||
|
||||
/* editor mode, when a spoiler is revealed, display delimiters */
|
||||
.is-live-preview .cm-active .inline_spoilers-editor-spoiler {
|
||||
/* contiguous border radius with the delimiter */
|
||||
border-radius: 0em;
|
||||
}
|
||||
|
||||
/* delimiter */
|
||||
/* editor mode, when a spoiler is revealed, display delimiters, which should have
|
||||
contiguous border radius with the spoiler content */
|
||||
.cm-line .inline_spoilers-editor-spoiler-delimiter {
|
||||
&:has(+ .inline_spoilers-editor-spoiler) {
|
||||
border-radius: var(--inline-spoilers-spoiler-radius) 0 0 var(--inline-spoilers-spoiler-radius);
|
||||
@@ -63,10 +77,12 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
/** hide spoiler delimiters in editor mode when spoilers are hidden */
|
||||
.is-live-preview .inline_spoilers-editor-spoiler-delimiter {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/** reveal spoiler delimiters in editor mode when a spoiler is revealed */
|
||||
.is-live-preview .cm-active .inline_spoilers-editor-spoiler-delimiter {
|
||||
display: unset;
|
||||
}
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "obsidian-excalidraw-plugin",
|
||||
"name": "Excalidraw",
|
||||
"version": "2.23.7",
|
||||
"version": "2.23.8",
|
||||
"minAppVersion": "1.8.7",
|
||||
"description": "Sketch Your Mind. Edit and view Excalidraw drawings. Enter the world of 4D Visual PKM.",
|
||||
"author": "Zsolt Viczian",
|
||||
|
||||
+7
@@ -353,6 +353,13 @@
|
||||
"replace": "...",
|
||||
"flags": "gm",
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"label": "remove whitespace from empty blockquote lines",
|
||||
"find": "^> +(?=\\n>)",
|
||||
"replace": ">",
|
||||
"flags": "gm",
|
||||
"enabled": true
|
||||
}
|
||||
],
|
||||
"commonStyles": {
|
||||
|
||||
Reference in New Issue
Block a user