@liascript/editor 1.1.30--0.17.2 → 1.1.32--0.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Base.d8e1fc60.js +1 -0
- package/dist/Worker.12f8469e.js +1 -0
- package/dist/ace.js +1 -1
- package/dist/ext-inline_autocomplete.js +1 -1
- package/dist/ext-language_tools.js +1 -1
- package/dist/ext-options.js +1 -1
- package/dist/ext-settings_menu.js +1 -1
- package/dist/index.008a45e4.js +1 -0
- package/dist/index.18dfe1db.js +1 -0
- package/dist/index.2aba4af3.js +1 -0
- package/dist/index.3a9c93a4.js +1 -0
- package/dist/index.4ae92b65.js +1 -0
- package/dist/index.4e767341.js +6 -0
- package/dist/index.54e5fdd3.js +6 -0
- package/dist/index.60b27406.js +1 -0
- package/dist/index.8310fd69.js +1 -0
- package/dist/index.ac483fbd.js +1 -0
- package/dist/index.d452ca23.js +1 -0
- package/dist/index.f3818782.js +34 -0
- package/dist/index.html +1 -1
- package/dist/pako.esm.e6a51df7.js +1 -0
- package/dist/theme-cloud_editor.js +1 -1
- package/dist/theme-cloud_editor_dark.js +1 -1
- package/package.json +3 -3
- package/dist/Worker.c04a8a05.js +0 -1
- package/dist/index.452255f7.js +0 -1
- package/dist/index.87dfb469.js +0 -1
- package/dist/index.d8d0157f.js +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},t={},i={},s=e.parcelRequirea18f;null==s&&((s=function(e){if(e in t)return t[e].exports;if(e in i){var s=i[e];delete i[e];var n={id:e,exports:{}};return t[e]=n,s.call(n.exports,n,n.exports),n.exports}var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(e,t){i[e]=t},e.parcelRequirea18f=s);var n=s("UiqKl");const r=Math.floor(20*parseFloat(getComputedStyle(document.documentElement).fontSize));customElements.define("lia-terminal",class extends HTMLElement{constructor(){super(),this.initObservers()}initObservers(){let e=this;this.resizeObserver=new(0,n.default)((function(t){e.style.height?(e.height_=e.style.height,e.update(),e.dispatchEvent(new CustomEvent("onchangeheight"))):t?.[0].borderBoxSize?.[0].blockSize>=r&&(e.height_=r+"px",e.update(),e.dispatchEvent(new CustomEvent("onchangeheight")))})),this.mutationObserver=new MutationObserver((()=>{this.update()}))}connectedCallback(){this.resizeObserver?.observe(this),this.mutationObserver?.observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){this.cleanup()}cleanup(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=void 0),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=void 0)}update(){this.height_&&(this.style.maxHeight="none",this.style.height=this.height_),this.scrollTop=this.scrollHeight}get height(){return this.height_}set height(e){this.height_!=e&&(this.height_=e,this.update())}})}();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){function t(t,e,i,s){Object.defineProperty(t,e,{get:i,set:s,enumerable:!0,configurable:!0})}var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i={},s={},n=e.parcelRequirea18f;null==n&&((n=function(t){if(t in i)return i[t].exports;if(t in s){var e=s[t];delete s[t];var n={id:t,exports:{}};return i[t]=n,e.call(n.exports,n,n.exports),n.exports}var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(t,e){s[t]=e},e.parcelRequirea18f=n),n.register("3gU5S",(function(e,i){t(e.exports,"initTooltip",(function(){return f}));var s=n("iLAck"),r=n("eWsJW"),o=n("axlxN"),c=n("7YIDk");const h="lia-tooltip",l=/(?:https?:)(?:\/\/)liascript\.github\.io\/course\/\?(.+\.md)/i;var a=Object();class u extends HTMLElement{sourceUrl="";cache=null;isFetching=!1;isClicked=!1;isActive=!1;lightMode=!0;constructor(){super()}connectedCallback(){this.sourceUrl=this.getAttribute("src")||"",this.sourceUrl&&(this.sourceUrl.endsWith("/")&&(this.sourceUrl=this.sourceUrl.slice(0,-1)),this.container=document.getElementById(h)||void 0,this.container&&this.firstChild&&(this.firstChild.addEventListener("mouseenter",this._onmouseenter),this.firstChild.addEventListener("mouseout",this._onmouseout),this.firstChild.addEventListener("click",this._onclick),this.firstChild.addEventListener("focus",this._onfocus),this.firstChild.addEventListener("focusout",this._onfocusout),this.firstChild.addEventListener("keyup",this._onescape)))}disconnectedCallback(){this.firstChild&&(this.firstChild.removeEventListener("mouseenter",this._onmouseenter),this.firstChild.removeEventListener("mouseout",this._onmouseout),this.firstChild.removeEventListener("click",this._onclick),this.firstChild.removeEventListener("focus",this._onfocus),this.firstChild.removeEventListener("focusout",this._onfocusout),this.firstChild.removeEventListener("keyup",this._onescape))}_onclick(){const t=this.parentElement;t.isActive=!1,t.isClicked=!0}_onescape(t){if("Escape"===t.code){const t=this.parentElement;t.setAttribute("data-active","false"),t.deactivate()}}_onmouseenter(){this.style.cursor="progress";const t=this.getBoundingClientRect();this.parentElement.activate(t.left+t.width/2,t.top+t.height/2)}_onmouseout(){this.parentElement.deactivate()}_onfocus(t){const e=this.getBoundingClientRect();this.parentElement.activate(e.left+e.width/2,e.top+e.height/2)}_onfocusout(){const t=this.parentElement;t.container&&t.container.setAttribute("data-active","false"),t.deactivate()}activate(t,e){if(this.container){if(this.isActive=!0,this.isClicked)return void(this.isClicked=!1);if(this.container.style.left=t-425*t/window.innerWidth+"px",1.5*e>window.innerHeight?(this.container.style.top="",this.container.style.bottom=window.innerHeight-e+10+"px"):(this.container.style.top=`${e+10}px`,this.container.style.bottom=""),this.cache)this.show();else if(a[this.sourceUrl])this.cache=a[this.sourceUrl],this.show();else if(!this.isFetching){this.isFetching=!0;let e=this,i=this.sourceUrl.match(l);if(i)r.fetch(i[1],(function(t,i){e.cache=d(e.sourceUrl,i.title,i.description,i.logo,i.logo_alt),e.show()}));else{const e=/\/\/([a-z]+)\.wikipedia\.org\/wiki\/([^#?\s]+(?:\([^#?\s]*\)[^#?\s]*)*)/i,i=this.sourceUrl.match(e);if(i){let e=i[1],n=i[2];try{n=decodeURIComponent(n)}catch(t){console.error("Error decoding title:",t)}let r=`https://${e}.wikipedia.org/api/rest_v1/page/summary/${encodeURIComponent(n)}`;window.fetch(r,{headers:{Accept:"application/json"}}).then((t=>{if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return t.json()})).then((t=>{this.cache=d(this.sourceUrl,t.title,t.extract,t.thumbnail?.source,t.thumbnail?.caption),this.show()})).catch((t=>{console.error("Wikipedia API error:",t),s.extract(this.sourceUrl,{}).then((t=>{this.cache=d(this.sourceUrl,t.title,void 0,t.thumbnail_url),this.show()})).catch((t=>{g(this.sourceUrl,function(t){this.parse(t)}.bind(this))}))}))}else try{s.extract(this.sourceUrl,{}).then((t=>{this.cache=d(this.sourceUrl,t.title,void 0,t.thumbnail_url),this.show()})).catch((t=>{g(this.sourceUrl,function(t){this.parse(t)}.bind(this))}))}catch(t){}}}}}deactivate(){this.container&&"false"===this.container.getAttribute("data-active")&&(this.isActive=!1,this.container.style.display="none",this.container.style.zIndex="-1000")}parse(t){if(null!==this.cache)return void this.show();let e=c.parse(this.sourceUrl,t);if("string"==typeof e.image){const t=e.image.match(/.*?%22(.*)\/%22/);t&&2==t.length&&(e.image=t[1])}this.cache=d(e.url,e.title,e.description,e.image,e.image_alt),""===this.cache&&(this.container=void 0),this.show()}show(){this.container&&this.cache&&this.isActive&&(this.lightMode?(this.container.style.background="white",this.container.style.boxShadow="0 30px 90px -20px rgba(0, 0, 0, 0.3)"):(this.container.style.background="#202020",this.container.style.boxShadow="0 30px 90px -20px rgba(120, 120, 120, 0.3)"),this.container.style.zIndex="20000",this.container.style.display="inline-block",this.container.innerHTML=this.cache),this.firstChild&&(this.firstChild.style.cursor="")}set light(t){this.lightMode!==t&&(this.lightMode=t,this.show())}get light(){return this.lightMode}}function d(t,e,i,s,n){if(!t)return"";t=t.replace(o.PROXY,"");let r="";if(s)try{o.allowedProtocol(s)||(s=new URL(s,t).toString()),r+=`<img src="${s}" ${n=n?`alt="${n}"`:""} style="background-color:white; margin-bottom: 1.5rem;">`}catch(t){}return e&&(r+=`<h4>${e}</h4>`),i&&(r+=i),""!=r&&(r+=`<hr style="border: 0px; height:1px; background:#888;"/><a style="font-size:x-small; display:block" href="${t}" target="_blank">${t}</a>`),a[t]=r,r}function f(){document.getElementById(h)||setTimeout((function(){const t=document.createElement("div");t.id=h,t.style.zIndex="-1000",t.style.width="425px",t.style.padding="15px",t.style.background="white",t.style.boxShadow="0 30px 90px -20px rgba(0, 0, 0, 0.3)",t.style.position="fixed",t.style.display="none",t.style.maxHeight="480px",t.style.overflow="auto",t.setAttribute("data-active","true"),t.addEventListener("mouseenter",(()=>{t.style.display="inline-block",t.style.zIndex="20000",t.setAttribute("data-active","true")})),t.addEventListener("mouseleave",(()=>{t.style.display="none",t.style.zIndex="-1000",t.setAttribute("data-active","false")})),document.body.appendChild(t)}),0)}function g(t,e,i=0){if(0==i&&function(t){return!!t.search(/wikipedia\.org/gi)}(t))return void g(o.PROXY+t,e,1);let s=new XMLHttpRequest;s.open("GET",t,!0),s.onload=function(t){if(4===s.readyState&&200===s.status)try{let i=s.responseText;try{i=JSON.parse(i).contents}catch(t){}e(i)}catch(t){console.warn("fetching",t)}},s.onerror=function(s){0===i&&g(o.PROXY+t,e,1)},s.send()}customElements.define("preview-link",u)})),n.register("7YIDk",(function(e,i){t(e.exports,"parse",(function(){return u}));var s=n("axlxN");const r=/href=[\"'](.*?)[\"']/gi,o=/src=[\"'](.*?)[\"']/gi,c=/alt=[\"'](.*?)[\"']/gi,h=/<h1.*?>(.*?)<\/h1>/gi,l=/<h2.*?>(.*?)<\/h2>/gi,a=/<title>(.*?)<\/title>/gi;function u(t,e){const i=function(t){const e=p("og:image",t);if(e)return{url:e,alt:p("og:image:alt",t)};const i=g(/<link.*?rel=[\"']image_src[\"'].*?>/gi,t);if(i)return{url:g(r,i)};const s=p("twitter:image",t);if(s)return{url:s,alt:p("twitter:image:alt",t)};const n=g(/<img .*?>/gi,t);return n?{url:g(o,n),alt:g(c,n)}:{}}(e),s=new URL(function(t){return g(/<base.*?href\s*=\s*[\"'](.*?)[\"']>/gi,t)}(e)||t);return{url:t,title:d(e),description:f(s,e),image:i.url,image_alt:i.alt}}function d(t){const e=p("og:title",t);if(e&&e.length>0)return e;const i=p("twitter:title",t);if(i&&i.length>0)return i;const s=g(a,t);if(s&&s.length>0)return s;const n=g(h,t);if(n&&n.length>0)return n;const r=g(l,t);return r&&r.length>0?r:void 0}function f(t,e){const i=p("og:description",e);if(i&&i.length>0)return i;const n=p("twitter:description",e);if(n&&n.length>0)return n;const r=g(/<meta.*?name=[\"']description[\"'].*?>/gi,e);if(r){const t=g(/content=[\"'](.*?)[\"']/gi,r);if(t&&t.length>0)return t}let o=g(/<p>([\s\S]+?)<\/p>/gi,e);return o?(o=o.replace(/(href|src)\s*=\s*[\"'].*?[\"']/g,(function(e){return function(t,e){const i=e.search(/[\"']/);e.startsWith("href")&&(e+=' target="blank_"');const n=e.slice(0,i+1),r=e.slice(i+1);return s.allowedProtocol(n)||r.startsWith("//")?e:r.startsWith("/")?n+t.origin+r:r.startsWith("#")?n+t.href+r:n+t.origin+"/"+r}(t,e)})),o):void 0}function g(t,e){const i=e.matchAll(t).next();return i.value?i.value[i.value.length-1]:void 0}function p(t,e){const i=g(new RegExp(`<meta[^>]+?property=["']${t}["'][^>]*?>`,"gi"),e);if(i)return g(/content=[\"'](.*?)[\"']/gi,i)}})),n("3gU5S")}();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(){let t;var e;(e=t||(t={})).DateTime="datetime",e.List="list",e.Number="number",e.PluralRules="pluralrules",e.RelativeTime="relativetime",customElements.define("lia-format",class extends HTMLElement{constructor(){super(),this.span=document.createElement("span"),this.option={},this.value_="",this.format,this.locale}connectedCallback(){switch(this.attachShadow({mode:"open"}).appendChild(this.span),this.locale=this.get("locale")||void 0,this.format=this.get("format")||void 0,this.format){case"number":this.option={compactDisplay:this.get("compactDisplay"),currency:this.get("currency"),currencyDisplay:this.get("currencyDisplay"),currencySign:this.get("currencySign"),localeMatcher:this.get("localeMatcher"),maximumFractionDigits:this.get("maximumFractionDigits"),maximumSignificantDigits:this.get("maximumSignificantDigits"),minimumFractionDigits:this.get("minimumFractionDigits"),minimumIntegerDigits:this.get("minimumIntegerDigits"),minimumSignificantDigits:this.get("minimumSignificantDigits"),notation:this.get("notation"),numberingSystem:this.get("numberingSystem"),signDisplay:this.get("signDisplay"),style:this.get("localeStyle"),unit:this.get("unit"),unitDisplay:this.get("unitDisplay"),useGrouping:this.get("useGrouping")};break;case"datetime":this.option={calendar:this.get("calendar"),dateStyle:this.get("dateStyle"),day:this.get("day"),dayPeriod:this.get("dayPeriod"),era:this.get("era"),formatMatcher:this.get("formatMatcher"),fractionalSecondDigits:this.get("fractionalSecondDigits"),hour:this.get("hour"),hour12:this.get("hour12"),hourCycle:this.get("hourCycle"),localeMatcher:this.get("localeMatcher"),minute:this.get("minute"),month:this.get("month"),numberingSystem:this.get("numberingSystem"),second:this.get("second"),timeStyle:this.get("timeStyle"),timeZone:this.get("timeZone"),timeZoneName:this.get("timeZoneName"),weekday:this.get("weekday"),year:this.get("year")};break;case"relativetime":this.unit=this.get("unit")||void 0,this.option={localeMatcher:this.get("localeMatcher"),numeric:this.get("numeric"),style:this.get("localeStyle")};break;case"list":this.option={localeMatcher:this.get("localeMatcher"),style:this.get("localeStyle"),type:this.get("type")};break;case"pluralrules":this.option={localeMatcher:this.get("localeMatcher"),maximumFractionDigits:this.get("maximumFractionDigits"),maximumSignificantDigits:this.get("maximumSignificantDigits"),minimumFractionDigits:this.get("minimumFractionDigits"),minimumIntegerDigits:this.get("minimumIntegerDigits"),minimumSignificantDigits:this.get("minimumSignificantDigits"),type:this.get("type")};break;default:this.option={}}this.value_=this.textContent||"",this.view()}view(){let e="";try{switch(this.format){case t.Number:e=new Intl.NumberFormat(this.locale,this.option).format(parseFloat(this.value_));break;case t.DateTime:e=new Intl.DateTimeFormat(this.locale,this.option).format(Date.parse(this.value_));break;case t.RelativeTime:e=new Intl.RelativeTimeFormat(this.locale,this.option).format(this.value_,this.unit);break;case t.List:e=new Intl.ListFormat(this.locale,this.option).format(JSON.parse(this.value_));break;case t.PluralRules:e=new Intl.PluralRules(this.locale,this.option).select(parseFloat(this.value_))}}catch(t){console.warn("intl-format: ",t.message)}this.span.innerText=e||this.value_}get(t){const e=this.getAttribute(t);return null===e?void 0:e}get value(){return this.value_}getFormat(){switch(this.get("format")){case t.DateTime:return t.DateTime;case t.List:return t.List;case t.Number:return t.Number;case t.PluralRules:return t.PluralRules;case t.RelativeTime:return t.RelativeTime}return null}set value(t){this.value_!==t&&(this.value_=t,this.view())}disconnectedCallback(){}})}();
|