diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f077bfc..d8b8c73 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -30,8 +30,11 @@ jobs: cp README.md ${{ env.PLUGIN_NAME }} || true cp package.json ${{ env.PLUGIN_NAME }} || true cp SynapseLogo.png ${{ env.PLUGIN_NAME }} || true - cp LICENSE ${{ env.PLUGIN_NAME }} || true + cp LICENSE ${{ env.PLUGIN_NAME }} || true + cp index.html ${{ env.PLUGIN_NAME }} || true + cp lsplugin.user.min.js ${{ env.PLUGIN_NAME }} || true cp index.js ${{ env.PLUGIN_NAME }} || true + cp icon.png ${{ env.PLUGIN_NAME }} || true # Create zip zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }} diff --git a/index.html b/index.html index 7be9cab..c6bf813 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ Synapse for LogSeq - +
diff --git a/lsplugin.user.min.js b/lsplugin.user.min.js new file mode 100644 index 0000000..8d077c6 --- /dev/null +++ b/lsplugin.user.min.js @@ -0,0 +1,8 @@ +/** + * Skipped minification because the original files appears to be already minified. + * Original file: /npm/@logseq/libs@0.2.1/dist/lsplugin.user.js + * + * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files + */ +/*! For license information please see lsplugin.user.js.LICENSE.txt */ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.LSPluginEntry=t():e.LSPluginEntry=t()}(self,(()=>(()=>{var e={227:(e,t,n)=>{var r=n(155);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(447)(t);const{formatters:o}=e.exports;o.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},447:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,i,s=null;function a(...e){if(!a.enabled)return;const r=a,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";s++;const i=t.formatters[o];if("function"==typeof i){const t=e[s];n=i.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(o),...t.skips.map(o).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?c((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function o(e,t,n){return e.concat(t).map((function(e){return r(e,n)}))}function i(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function a(e,t,n){var o={};return n.isMergeableObject(e)&&i(e).forEach((function(t){o[t]=r(e[t],n)})),i(t).forEach((function(i){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(s(e,i)&&n.isMergeableObject(t[i])?o[i]=function(e,t){if(!t.customMerge)return c;var n=t.customMerge(e);return"function"==typeof n?n:c}(i,n)(e[i],t[i],n):o[i]=r(t[i],n))})),o}function c(e,n,i){(i=i||{}).arrayMerge=i.arrayMerge||o,i.isMergeableObject=i.isMergeableObject||t,i.cloneUnlessOtherwiseSpecified=r;var s=Array.isArray(n);return s===Array.isArray(e)?s?i.arrayMerge(e,n,i):a(e,n,i):r(n,i)}c.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return c(e,n,t)}),{})};var l=c;e.exports=l},856:function(e){e.exports=function(){"use strict";function e(t){return e="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},e(t)}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}function n(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function r(e,o,i){return r=n()?Reflect.construct:function(e,n,r){var o=[null];o.push.apply(o,n);var i=new(Function.bind.apply(e,o));return r&&t(i,r.prototype),i},r.apply(null,arguments)}function o(e){return i(e)||s(e)||a(e)||l()}function i(e){if(Array.isArray(e))return c(e)}function s(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function a(e,t){if(e){if("string"==typeof e)return c(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?n-1:0),o=1;o/gm),Y=g(/\${[\w\W]*}/gm),Q=g(/^data-[\-\w.\u00B7-\uFFFF]/),X=g(/^aria-[\-\w]+$/),ee=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),te=g(/^(?:\w+script|data):/i),ne=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),re=g(/^html$/i),oe=g(/^[a-z][.\w]*(-[.\w]+)+$/i),ie=function(){return"undefined"==typeof window?null:window},se=function(t,n){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var r=null,o="data-tt-policy-suffix";n.currentScript&&n.currentScript.hasAttribute(o)&&(r=n.currentScript.getAttribute(o));var i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function ae(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ie(),n=function(e){return ae(e)};if(n.version="2.5.4",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,i=t.document,s=t.DocumentFragment,a=t.HTMLTemplateElement,c=t.Node,l=t.Element,u=t.NodeFilter,f=t.NamedNodeMap,p=void 0===f?t.NamedNodeMap||t.MozNamedAttrMap:f,d=t.HTMLFormElement,h=t.DOMParser,g=t.trustedTypes,y=l.prototype,v=P(y,"cloneNode"),b=P(y,"nextSibling"),_=P(y,"childNodes"),M=P(y,"parentNode");if("function"==typeof a){var N=i.createElement("template");N.content&&N.content.ownerDocument&&(i=N.content.ownerDocument)}var ce=se(g,r),le=ce?ce.createHTML(""):"",ue=i,fe=ue.implementation,pe=ue.createNodeIterator,de=ue.createDocumentFragment,he=ue.getElementsByTagName,me=r.importNode,ge={};try{ge=R(i).documentMode?i.documentMode:{}}catch(e){}var ye={};n.isSupported="function"==typeof M&&fe&&void 0!==fe.createHTMLDocument&&9!==ge;var ve,be,_e=V,we=K,xe=Y,Ce=Q,Se=X,Oe=te,Ee=ne,Ae=oe,je=ee,ke=null,Te=F({},[].concat(o(D),o(U),o($),o(H),o(q))),Ie=null,Le=F({},[].concat(o(W),o(G),o(J),o(Z))),Me=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ne=null,Fe=null,Re=!0,Pe=!0,De=!1,Ue=!0,$e=!1,ze=!0,He=!1,Be=!1,qe=!1,We=!1,Ge=!1,Je=!1,Ze=!0,Ve=!1,Ke="user-content-",Ye=!0,Qe=!1,Xe={},et=null,tt=F({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),nt=null,rt=F({},["audio","video","img","source","image","track"]),ot=null,it=F({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),st="http://www.w3.org/1998/Math/MathML",at="http://www.w3.org/2000/svg",ct="http://www.w3.org/1999/xhtml",lt=ct,ut=!1,ft=null,pt=F({},[st,at,ct],O),dt=["application/xhtml+xml","text/html"],ht="text/html",mt=null,gt=255,yt=i.createElement("form"),vt=function(e){return e instanceof RegExp||e instanceof Function},bt=function(t){mt&&mt===t||(t&&"object"===e(t)||(t={}),t=R(t),ve=ve=-1===dt.indexOf(t.PARSER_MEDIA_TYPE)?ht:t.PARSER_MEDIA_TYPE,be="application/xhtml+xml"===ve?O:S,ke="ALLOWED_TAGS"in t?F({},t.ALLOWED_TAGS,be):Te,Ie="ALLOWED_ATTR"in t?F({},t.ALLOWED_ATTR,be):Le,ft="ALLOWED_NAMESPACES"in t?F({},t.ALLOWED_NAMESPACES,O):pt,ot="ADD_URI_SAFE_ATTR"in t?F(R(it),t.ADD_URI_SAFE_ATTR,be):it,nt="ADD_DATA_URI_TAGS"in t?F(R(rt),t.ADD_DATA_URI_TAGS,be):rt,et="FORBID_CONTENTS"in t?F({},t.FORBID_CONTENTS,be):tt,Ne="FORBID_TAGS"in t?F({},t.FORBID_TAGS,be):{},Fe="FORBID_ATTR"in t?F({},t.FORBID_ATTR,be):{},Xe="USE_PROFILES"in t&&t.USE_PROFILES,Re=!1!==t.ALLOW_ARIA_ATTR,Pe=!1!==t.ALLOW_DATA_ATTR,De=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Ue=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,$e=t.SAFE_FOR_TEMPLATES||!1,ze=!1!==t.SAFE_FOR_XML,He=t.WHOLE_DOCUMENT||!1,We=t.RETURN_DOM||!1,Ge=t.RETURN_DOM_FRAGMENT||!1,Je=t.RETURN_TRUSTED_TYPE||!1,qe=t.FORCE_BODY||!1,Ze=!1!==t.SANITIZE_DOM,Ve=t.SANITIZE_NAMED_PROPS||!1,Ye=!1!==t.KEEP_CONTENT,Qe=t.IN_PLACE||!1,je=t.ALLOWED_URI_REGEXP||je,lt=t.NAMESPACE||ct,Me=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&vt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Me.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&vt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Me.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Me.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),$e&&(Pe=!1),Ge&&(We=!0),Xe&&(ke=F({},o(q)),Ie=[],!0===Xe.html&&(F(ke,D),F(Ie,W)),!0===Xe.svg&&(F(ke,U),F(Ie,G),F(Ie,Z)),!0===Xe.svgFilters&&(F(ke,$),F(Ie,G),F(Ie,Z)),!0===Xe.mathMl&&(F(ke,H),F(Ie,J),F(Ie,Z))),t.ADD_TAGS&&(ke===Te&&(ke=R(ke)),F(ke,t.ADD_TAGS,be)),t.ADD_ATTR&&(Ie===Le&&(Ie=R(Ie)),F(Ie,t.ADD_ATTR,be)),t.ADD_URI_SAFE_ATTR&&F(ot,t.ADD_URI_SAFE_ATTR,be),t.FORBID_CONTENTS&&(et===tt&&(et=R(et)),F(et,t.FORBID_CONTENTS,be)),Ye&&(ke["#text"]=!0),He&&F(ke,["html","head","body"]),ke.table&&(F(ke,["tbody"]),delete Ne.tbody),m&&m(t),mt=t)},_t=F({},["mi","mo","mn","ms","mtext"]),wt=F({},["foreignobject","annotation-xml"]),xt=F({},["title","style","font","a","script"]),Ct=F({},U);F(Ct,$),F(Ct,z);var St=F({},H);F(St,B);var Ot=function(e){var t=M(e);t&&t.tagName||(t={namespaceURI:lt,tagName:"template"});var n=S(e.tagName),r=S(t.tagName);return!!ft[e.namespaceURI]&&(e.namespaceURI===at?t.namespaceURI===ct?"svg"===n:t.namespaceURI===st?"svg"===n&&("annotation-xml"===r||_t[r]):Boolean(Ct[n]):e.namespaceURI===st?t.namespaceURI===ct?"math"===n:t.namespaceURI===at?"math"===n&&wt[r]:Boolean(St[n]):e.namespaceURI===ct?!(t.namespaceURI===at&&!wt[r])&&!(t.namespaceURI===st&&!_t[r])&&!St[n]&&(xt[n]||!Ct[n]):!("application/xhtml+xml"!==ve||!ft[e.namespaceURI]))},Et=function(e){C(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=le}catch(t){e.remove()}}},At=function(e,t){try{C(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){C(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Ie[e])if(We||Ge)try{Et(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},jt=function(e){var t,n;if(qe)e=""+e;else{var r=E(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ve&<===ct&&(e=''+e+"");var o=ce?ce.createHTML(e):e;if(lt===ct)try{t=(new h).parseFromString(o,ve)}catch(e){}if(!t||!t.documentElement){t=fe.createDocument(lt,"template",null);try{t.documentElement.innerHTML=ut?le:o}catch(e){}}var s=t.body||t.documentElement;return e&&n&&s.insertBefore(i.createTextNode(n),s.childNodes[0]||null),lt===ct?he.call(t,He?"html":"body")[0]:He?t.documentElement:s},kt=function(e){return pe.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null,!1)},Tt=function(e){return e instanceof d&&(void 0!==e.__depth&&"number"!=typeof e.__depth||void 0!==e.__removalCount&&"number"!=typeof e.__removalCount||"string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof p)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},It=function(t){return"object"===e(c)?t instanceof c:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},Lt=function(e,t,r){ye[e]&&w(ye[e],(function(e){e.call(n,t,r,mt)}))},Mt=function(e){var t;if(Lt("beforeSanitizeElements",e,null),Tt(e))return Et(e),!0;if(T(/[\u0080-\uFFFF]/,e.nodeName))return Et(e),!0;var r=be(e.nodeName);if(Lt("uponSanitizeElement",e,{tagName:r,allowedTags:ke}),e.hasChildNodes()&&!It(e.firstElementChild)&&(!It(e.content)||!It(e.content.firstElementChild))&&T(/<[/\w]/g,e.innerHTML)&&T(/<[/\w]/g,e.textContent))return Et(e),!0;if("select"===r&&T(/