Files
StudyDiary-20261009/.obsidian/plugins/editing-toolbar/main.js

12 lines
863 KiB
JavaScript
Raw Normal View History

2026-10-09 22:06:40 +08:00
"use strict";var e=require("obsidian"),t=require("@codemirror/language"),o=require("@codemirror/state"),n=require("@codemirror/view");const i=["Custom","editingToolbar","editingToolbarSub","editingToolbarAdd","editingToolbarDelete","editingToolbarReload","codeblock-glyph","underline-glyph","superscript-glyph","subscript-glyph","bot-glyph","header-1","header-2","header-3","header-4","header-5","header-6","header-n","obsidian","obsidian-new","accessibility","activity","air-vent","airplay","alarm-check","alarm-clock-off","alarm-clock","alarm-minus","alarm-plus","album","alert-circle","alert-octagon","alert-triangle","align-center-horizontal","align-center-vertical","align-center","align-end-horizontal","align-end-vertical","align-horizontal-distribute-center","align-horizontal-distribute-end","align-horizontal-distribute-start","align-horizontal-justify-center","align-horizontal-justify-end","align-horizontal-justify-start","align-horizontal-space-around","align-horizontal-space-between","align-justify","align-left","align-right","align-start-horizontal","align-start-vertical","align-vertical-distribute-center","align-vertical-distribute-end","align-vertical-distribute-start","align-vertical-justify-center","align-vertical-justify-end","align-vertical-justify-start","align-vertical-space-around","align-vertical-space-between","anchor","angry","annoyed","aperture","apple","archive-restore","archive","armchair","arrow-big-down","arrow-big-left","arrow-big-right","arrow-big-up","arrow-down-circle","arrow-down-left","arrow-down-right","arrow-down","arrow-left-circle","arrow-left-right","arrow-left","arrow-right-circle","arrow-right","arrow-up-circle","arrow-up-left","arrow-up-right","arrow-up","asterisk","at-sign","award","axe","axis-3d","baby","backpack","baggage-claim","banana","banknote","bar-chart-2","bar-chart-3","bar-chart-4","bar-chart-horizontal","bar-chart","baseline","bath","battery-charging","battery-full","battery-low","battery-medium","battery","beaker","bed-double","bed-single","bed","beer","bell-minus","bell-off","bell-plus","bell-ring","bell","bike","binary","bitcoin","bluetooth-connected","bluetooth-off","bluetooth-searching","bluetooth","bold","bomb","bone","book-open","book","bookmark-minus","bookmark-plus","bookmark","bot","box-select","box","boxes","briefcase","brush","bug","building-2","building","bus","cake","calculator","calendar-check-2","calendar-check","calendar-clock","calendar-days","calendar-heart","calendar-minus","calendar-off","calendar-plus","calendar-range","calendar-search","calendar-x2","calendar-x","calendar","camera-off","camera","car","carrot","cast","check-circle-2","check-circle","check-square","check","chef-hat","cherry","chevron-down","chevron-first","chevron-last","chevron-left","chevron-right","chevron-up","chevrons-down-up","chevrons-down","chevrons-left-right","chevrons-left","chevrons-right-left","chevrons-right","chevrons-up-down","chevrons-up","chrome","cigarette-off","cigarette","circle-dot","circle-ellipsis","circle-slashed","circle","citrus","clapperboard","clipboard-check","clipboard-copy","clipboard-edit","clipboard-list","clipboard-signature","clipboard-type","clipboard-x","clipboard","clock-1","clock-10","clock-11","clock-12","clock-2","clock-3","clock-4","clock-5","clock-6","clock-7","clock-8","clock-9","clock","cloud-cog","cloud-drizzle","cloud-fog","cloud-hail","cloud-lightning","cloud-moon-rain","cloud-moon","cloud-off","cloud-rain-wind","cloud-rain","cloud-snow","cloud-sun-rain","cloud-sun","cloud","cloudy","clover","code-2","code","codepen","codesandbox","coffee","cog","coins","columns","command","compass","component","contact","contrast","cookie","copy","copyleft","copyright","corner-down-left","corner-down-right","corner-left-down","corner-left-up","corner-right-down","corner-right-up","corner-up-left","corner-up-right","cpu","credit-card","croissant","crop","cross","crosshair","crown","cup-soda","curly-braces","currency","database","delete","diamond","dice-1","dice-2","dice-3","dice-4","dice-5","dice-6","dices","diff","disc","divide-circle","divide-square","div
/**!
* Sortable 1.15.7
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*/(s.cMenuFontColor,s.cMenuBackgroundColor)}}()}function He(e,t,o){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var o=e[Symbol.toPrimitive];if(void 0!==o){var n=o.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function Ke(){return Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)({}).hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},Ke.apply(null,arguments)}function We(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)}return o}function je(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?We(Object(o),!0).forEach(function(t){He(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):We(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function Ye(e){return Ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ye(e)}function Ge(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var Je=Ge(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Ze=Ge(/Edge/i),Xe=Ge(/firefox/i),Qe=Ge(/safari/i)&&!Ge(/chrome/i)&&!Ge(/android/i),et=Ge(/iP(ad|od|hone)/i),tt=Ge(/chrome/i)&&Ge(/android/i),ot={capture:!1,passive:!1};function nt(e,t,o){e.addEventListener(t,o,!Je&&ot)}function it(e,t,o){e.removeEventListener(t,o,!Je&&ot)}function at(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function st(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function rt(e,t,o,n){if(e){o=o||document;do{if(null!=t&&(">"===t[0]?e.parentNode===o&&at(e,t):at(e,t))||n&&e===o)return e;if(e===o)break}while(e=st(e))}return null}var lt,dt=/\s+/g;function ct(e,t,o){if(e&&t)if(e.classList)e.classList[o?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(dt," ").replace(" "+t+" "," ");e.className=(n+(o?" "+t:"")).replace(dt," ")}}function ut(e,t,o){var n=e&&e.style;if(n){if(void 0===o)return document.defaultView&&document.defaultView.getComputedStyle?o=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(o=e.currentStyle),void 0===t?o:o[t];t in n||-1!==t.indexOf("webkit")||(t="-webkit-"+t),n[t]=o+("string"==typeof o?"":"px")}}function mt(e,t){var o="";if("string"==typeof e)o=e;else do{var n=ut(e,"transform");n&&"none"!==n&&(o=n+" "+o)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(o)}function pt(e,t,o){if(e){var n=e.getElementsByTagName(t),i=0,a=n.length;if(o)for(;i<a;i++)o(n[i],i);return n}return[]}function ht(){var e=document.scrollingElement;return e||document.documentElement}function gt(e,t,o,n,i){if(e.getBoundingClientRect||e===window){var a,s,r,l,d,c,u;if(e!==window&&e.parentNode&&e!==ht()?(s=(a=e.getBoundingClientRect()).top,r=a.left,l=a.bottom,d=a.right,c=a.height,u=a.width):(s=0,r=0,l=window.innerHeight,d=window.innerWidth,c=window.innerHeight,u=window.innerWidth),(t||o)&&e!==window&&(i=i||e.parentNode,!Je))do{if(i&&i.getBoundingClientRect&&("none"!==ut(i,"transform")||o&&"static"!==ut(i,"position"))){var m=i.getBoundingClientRect();s-=m.top+parseInt(ut(i,"border-top-width")),r-=m.left+parseInt(ut(i,"border-left-width")),l=s+a.height,d=r+a.width;break}}while(i=i.parentNode);if(n&&e!==window){var p=mt(i||e),h=p&&p.a,g=p&&p.d;p&&(l=(s/=g
/*! Pickr 1.8.4 MIT | https://github.com/Simonwep/pickr */
var Jo=function(e){var t={exports:{}};return e(t,t.exports),t.exports}(function(e,t){self,e.exports=(()=>{var e={d:(t,o)=>{for(var n in o)e.o(o,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:o[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.d(t,{default:()=>D});var o={};function n(e,t,o,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};t instanceof HTMLCollection||t instanceof NodeList?t=Array.from(t):Array.isArray(t)||(t=[t]),Array.isArray(o)||(o=[o]);for(const a of t)for(const t of o)a[e](t,n,{capture:!1,...i});return Array.prototype.slice.call(arguments,1)}e.r(o),e.d(o,{adjustableInputNumbers:()=>c,createElementFromString:()=>s,createFromTemplate:()=>r,eventPath:()=>l,off:()=>a,on:()=>i,resolveElement:()=>d});const i=n.bind(null,"addEventListener"),a=n.bind(null,"removeEventListener");function s(e){const t=document.createElement("div");return t.innerHTML=e.trim(),t.firstElementChild}function r(e){const t=(e,t)=>{const o=e.getAttribute(t);return e.removeAttribute(t),o},o=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=t(e,":obj"),a=t(e,":ref"),s=i?n[i]={}:n;a&&(n[a]=e);for(const n of Array.from(e.children)){const e=t(n,":arr"),i=o(n,e?{}:s);e&&(s[e]||(s[e]=[])).push(Object.keys(i).length?i:n)}return n};return o(s(e))}function l(e){let t=e.path||e.composedPath&&e.composedPath();if(t)return t;let o=e.target.parentElement;for(t=[e.target,o];o=o.parentElement;)t.push(o);return t.push(document,window),t}function d(e){return e instanceof Element?e:"string"==typeof e?e.split(/>>/g).reduce((e,t,o,n)=>(e=e.querySelector(t),o<n.length-1?e.shadowRoot:e),document):null}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;function o(o){const n=[.001,.01,.1][Number(o.shiftKey||2*o.ctrlKey)]*(o.deltaY<0?1:-1);let i=0,a=e.selectionStart;e.value=e.value.replace(/[\d.]+/g,(e,o)=>o<=a&&o+e.length>=a?(a=o,t(Number(e),n,i)):(i++,e)),e.focus(),e.setSelectionRange(a,a),o.preventDefault(),e.dispatchEvent(new Event("input"))}i(e,"focus",()=>i(window,"wheel",o,{passive:!1})),i(e,"blur",()=>a(window,"wheel",o))}const{min:u,max:m,floor:p,round:h}=Math;function g(e,t,o){t/=100,o/=100;const n=p(e=e/360*6),i=e-n,a=o*(1-t),s=o*(1-i*t),r=o*(1-(1-i)*t),l=n%6;return[255*[o,s,a,a,r,o][l],255*[r,o,o,s,a,a][l],255*[a,a,r,o,o,s][l]]}function f(e,t,o){return g(e,t,o).map(e=>h(e).toString(16).padStart(2,"0"))}function b(e,t,o){const n=g(e,t,o),i=n[0]/255,a=n[1]/255,s=n[2]/255,r=u(1-i,1-a,1-s);return[100*(1===r?0:(1-i-r)/(1-r)),100*(1===r?0:(1-a-r)/(1-r)),100*(1===r?0:(1-s-r)/(1-r)),100*r]}function y(e,t,o){const n=(2-(t/=100))*(o/=100)/2;return 0!==n&&(t=1===n?0:n<.5?t*o/(2*n):t*o/(2-2*n)),[e,100*t,100*n]}function C(e,t,o){const n=u(e/=255,t/=255,o/=255),i=m(e,t,o),a=i-n;let s,r;if(0===a)s=r=0;else{r=a/i;const n=((i-e)/6+a/2)/a,l=((i-t)/6+a/2)/a,d=((i-o)/6+a/2)/a;e===i?s=d-l:t===i?s=1/3+n-d:o===i&&(s=2/3+l-n),s<0?s+=1:s>1&&(s-=1)}return[360*s,100*r,100*i]}function v(e,t,o,n){return t/=100,o/=100,[...C(255*(1-u(1,(e/=100)*(1-(n/=100))+n)),255*(1-u(1,t*(1-n)+n)),255*(1-u(1,o*(1-n)+n)))]}function w(e,t,o){t/=100;const n=2*(t*=(o/=100)<.5?o:1-o)/(o+t)*100,i=100*(o+t);return[e,isNaN(n)?0:n,i]}function x(e){return C(...e.match(/.{2}/g).map(e=>parseInt(e,16)))}function S(e){e=e.match(/^[a-zA-Z]+$/)?function(e){if("black"===e.toLowerCase())return"#000";const t=document.createElement("canvas").getContext("2d");return t.fillStyle=e,"#000"===t.fillStyle?null:t.fillStyle}(e):e;const t={cmyk:/^cmyk[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)/i,rgba:/^((rgba)|rgb)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsla:/^((hsla)|hsl)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hsva:/^((hsva)|hsv)[\D]+([\d.]+)[\D]+([\d.]+)[\D]+([\d.]+)[\D]*?([\d.]+|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=e=>e.map(e=>/^(|\d+)\.\d+|\d+$/.test(e)?Number(e):void 0);
/* nosourcemap */