inkblot 0.2.0 → 0.2.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.
- checksums.yaml +4 -4
- data/.build.yml +10 -11
- data/Rakefile +13 -1
- data/docs/inkblot.yml +1 -0
- data/docs/pages/docs/tailwind.md +6 -1
- data/js-src/main.ts +1 -0
- data/js-src/search.ts +19 -0
- data/lib/assets/main.js +508 -0
- data/lib/inkblot/cli.rb +5 -0
- data/lib/inkblot/layout.rb +10 -1
- data/lib/inkblot/search.rb +11 -0
- data/lib/inkblot/version.rb +1 -1
- data/lib/inkblot.min.css +1 -1
- data/package-lock.json +1167 -0
- data/package.json +10 -0
- metadata +7 -4
- data/.rspec_status +0 -3
- data/docs/pages/test.md +0 -4
- data/docs/pages/test2.md +0 -4
data/lib/assets/main.js
ADDED
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
var ae=window,le=ae.ShadowRoot&&(ae.ShadyCSS===void 0||ae.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Pe=Symbol(),We=new WeakMap,W=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Pe)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(le&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=We.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&We.set(t,e))}return e}toString(){return this.cssText}},Qe=i=>new W(typeof i=="string"?i:i+"",void 0,Pe),O=(i,...e)=>{let t=i.length===1?i[0]:e.reduce(((r,n,o)=>r+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[o+1]),i[0]);return new W(t,i,Pe)},Ce=(i,e)=>{le?i.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((t=>{let r=document.createElement("style"),n=ae.litNonce;n!==void 0&&r.setAttribute("nonce",n),r.textContent=t.cssText,i.appendChild(r)}))},ce=le?i=>i:i=>i instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return Qe(t)})(i):i;var Oe,de=window,Ye=de.trustedTypes,Lt=Ye?Ye.emptyScript:"",Xe=de.reactiveElementPolyfillSupport,He={toAttribute(i,e){switch(e){case Boolean:i=i?Lt:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,e){let t=i;switch(e){case Boolean:t=i!==null;break;case Number:t=i===null?null:Number(i);break;case Object:case Array:try{t=JSON.parse(i)}catch{t=null}}return t}},Ze=(i,e)=>e!==i&&(e==e||i==i),Te={attribute:!0,type:String,converter:He,reflect:!1,hasChanged:Ze},Re="finalized",T=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach(((t,r)=>{let n=this._$Ep(r,t);n!==void 0&&(this._$Ev.set(n,r),e.push(n))})),e}static createProperty(e,t=Te){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){let r=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,r,t);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,t,r){return{get(){return this[t]},set(n){let o=this[e];this[t]=n,this.requestUpdate(e,o,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Te}static finalize(){if(this.hasOwnProperty(Re))return!1;this[Re]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let t=this.properties,r=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(let n of r)this.createProperty(n,t[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let n of r)t.unshift(ce(n))}else e!==void 0&&t.push(ce(e));return t}static _$Ep(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach((t=>t(this)))}addController(e){var t,r;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)===null||r===void 0||r.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])}))}createRenderRoot(){var e;let t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Ce(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach((t=>{var r;return(r=t.hostConnected)===null||r===void 0?void 0:r.call(t)}))}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach((t=>{var r;return(r=t.hostDisconnected)===null||r===void 0?void 0:r.call(t)}))}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EO(e,t,r=Te){var n;let o=this.constructor._$Ep(e,r);if(o!==void 0&&r.reflect===!0){let s=(((n=r.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?r.converter:He).toAttribute(t,r.type);this._$El=e,s==null?this.removeAttribute(o):this.setAttribute(o,s),this._$El=null}}_$AK(e,t){var r;let n=this.constructor,o=n._$Ev.get(e);if(o!==void 0&&this._$El!==o){let s=n.getPropertyOptions(o),a=typeof s.converter=="function"?{fromAttribute:s.converter}:((r=s.converter)===null||r===void 0?void 0:r.fromAttribute)!==void 0?s.converter:He;this._$El=o,this[o]=a.fromAttribute(t,s.type),this._$El=null}}requestUpdate(e,t,r){let n=!0;e!==void 0&&(((r=r||this.constructor.getPropertyOptions(e)).hasChanged||Ze)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),r.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,r))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((n,o)=>this[o]=n)),this._$Ei=void 0);let t=!1,r=this._$AL;try{t=this.shouldUpdate(r),t?(this.willUpdate(r),(e=this._$ES)===null||e===void 0||e.forEach((n=>{var o;return(o=n.hostUpdate)===null||o===void 0?void 0:o.call(n)})),this.update(r)):this._$Ek()}catch(n){throw t=!1,this._$Ek(),n}t&&this._$AE(r)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.forEach((r=>{var n;return(n=r.hostUpdated)===null||n===void 0?void 0:n.call(r)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach(((t,r)=>this._$EO(r,this[r],t))),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};T[Re]=!0,T.elementProperties=new Map,T.elementStyles=[],T.shadowRootOptions={mode:"open"},Xe?.({ReactiveElement:T}),((Oe=de.reactiveElementVersions)!==null&&Oe!==void 0?Oe:de.reactiveElementVersions=[]).push("1.6.3");var Me,he=window,q=he.trustedTypes,et=q?q.createPolicy("lit-html",{createHTML:i=>i}):void 0,ue="$lit$",H=`lit$${(Math.random()+"").slice(9)}$`,Ue="?"+H,Bt=`<${Ue}>`,I=document,Y=()=>I.createComment(""),X=i=>i===null||typeof i!="object"&&typeof i!="function",at=Array.isArray,lt=i=>at(i)||typeof i?.[Symbol.iterator]=="function",De=`[
|
|
2
|
+
\f\r]`,Q=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,tt=/-->/g,it=/>/g,L=RegExp(`>|${De}(?:([^\\s"'>=/]+)(${De}*=${De}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),rt=/'/g,nt=/"/g,ct=/^(?:script|style|textarea|title)$/i,dt=i=>(e,...t)=>({_$litType$:i,strings:e,values:t}),_=dt(1),si=dt(2),w=Symbol.for("lit-noChange"),v=Symbol.for("lit-nothing"),ot=new WeakMap,B=I.createTreeWalker(I,129,null,!1);function ht(i,e){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(e):e}var ut=(i,e)=>{let t=i.length-1,r=[],n,o=e===2?"<svg>":"",s=Q;for(let a=0;a<t;a++){let l=i[a],c,d,u=-1,h=0;for(;h<l.length&&(s.lastIndex=h,d=s.exec(l),d!==null);)h=s.lastIndex,s===Q?d[1]==="!--"?s=tt:d[1]!==void 0?s=it:d[2]!==void 0?(ct.test(d[2])&&(n=RegExp("</"+d[2],"g")),s=L):d[3]!==void 0&&(s=L):s===L?d[0]===">"?(s=n??Q,u=-1):d[1]===void 0?u=-2:(u=s.lastIndex-d[2].length,c=d[1],s=d[3]===void 0?L:d[3]==='"'?nt:rt):s===nt||s===rt?s=L:s===tt||s===it?s=Q:(s=L,n=void 0);let p=s===L&&i[a+1].startsWith("/>")?" ":"";o+=s===Q?l+Bt:u>=0?(r.push(c),l.slice(0,u)+ue+l.slice(u)+H+p):l+H+(u===-2?(r.push(void 0),a):p)}return[ht(i,o+(i[t]||"<?>")+(e===2?"</svg>":"")),r]},Z=class i{constructor({strings:e,_$litType$:t},r){let n;this.parts=[];let o=0,s=0,a=e.length-1,l=this.parts,[c,d]=ut(e,t);if(this.el=i.createElement(c,r),B.currentNode=this.el.content,t===2){let u=this.el.content,h=u.firstChild;h.remove(),u.append(...h.childNodes)}for(;(n=B.nextNode())!==null&&l.length<a;){if(n.nodeType===1){if(n.hasAttributes()){let u=[];for(let h of n.getAttributeNames())if(h.endsWith(ue)||h.startsWith(H)){let p=d[s++];if(u.push(h),p!==void 0){let f=n.getAttribute(p.toLowerCase()+ue).split(H),$=/([.?@])?(.*)/.exec(p);l.push({type:1,index:o,name:$[2],strings:f,ctor:$[1]==="."?fe:$[1]==="?"?ve:$[1]==="@"?me:z})}else l.push({type:6,index:o})}for(let h of u)n.removeAttribute(h)}if(ct.test(n.tagName)){let u=n.textContent.split(H),h=u.length-1;if(h>0){n.textContent=q?q.emptyScript:"";for(let p=0;p<h;p++)n.append(u[p],Y()),B.nextNode(),l.push({type:2,index:++o});n.append(u[h],Y())}}}else if(n.nodeType===8)if(n.data===Ue)l.push({type:2,index:o});else{let u=-1;for(;(u=n.data.indexOf(H,u+1))!==-1;)l.push({type:7,index:o}),u+=H.length-1}o++}}static createElement(e,t){let r=I.createElement("template");return r.innerHTML=e,r}};function N(i,e,t=i,r){var n,o,s,a;if(e===w)return e;let l=r!==void 0?(n=t._$Co)===null||n===void 0?void 0:n[r]:t._$Cl,c=X(e)?void 0:e._$litDirective$;return l?.constructor!==c&&((o=l?._$AO)===null||o===void 0||o.call(l,!1),c===void 0?l=void 0:(l=new c(i),l._$AT(i,t,r)),r!==void 0?((s=(a=t)._$Co)!==null&&s!==void 0?s:a._$Co=[])[r]=l:t._$Cl=l),l!==void 0&&(e=N(i,l._$AS(i,e.values),l,r)),e}var pe=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var t;let{el:{content:r},parts:n}=this._$AD,o=((t=e?.creationScope)!==null&&t!==void 0?t:I).importNode(r,!0);B.currentNode=o;let s=B.nextNode(),a=0,l=0,c=n[0];for(;c!==void 0;){if(a===c.index){let d;c.type===2?d=new G(s,s.nextSibling,this,e):c.type===1?d=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(d=new ye(s,this,e)),this._$AV.push(d),c=n[++l]}a!==c?.index&&(s=B.nextNode(),a++)}return B.currentNode=I,o}v(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},G=class i{constructor(e,t,r,n){var o;this.type=2,this._$AH=v,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=n,this._$Cp=(o=n?.isConnected)===null||o===void 0||o}get _$AU(){var e,t;return(t=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&t!==void 0?t:this._$Cp}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=N(this,e,t),X(e)?e===v||e==null||e===""?(this._$AH!==v&&this._$AR(),this._$AH=v):e!==this._$AH&&e!==w&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):lt(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==v&&X(this._$AH)?this._$AA.nextSibling.data=e:this.$(I.createTextNode(e)),this._$AH=e}g(e){var t;let{values:r,_$litType$:n}=e,o=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Z.createElement(ht(n.h,n.h[0]),this.options)),n);if(((t=this._$AH)===null||t===void 0?void 0:t._$AD)===o)this._$AH.v(r);else{let s=new pe(o,this),a=s.u(this.options);s.v(r),this.$(a),this._$AH=s}}_$AC(e){let t=ot.get(e.strings);return t===void 0&&ot.set(e.strings,t=new Z(e)),t}T(e){at(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,n=0;for(let o of e)n===t.length?t.push(r=new i(this.k(Y()),this.k(Y()),this,this.options)):r=t[n],r._$AI(o),n++;n<t.length&&(this._$AR(r&&r._$AB.nextSibling,n),t.length=n)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)===null||r===void 0||r.call(this,!1,!0,t);e&&e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){var t;this._$AM===void 0&&(this._$Cp=e,(t=this._$AP)===null||t===void 0||t.call(this,e))}},z=class{constructor(e,t,r,n,o){this.type=1,this._$AH=v,this._$AN=void 0,this.element=e,this.name=t,this._$AM=n,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=v}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,r,n){let o=this.strings,s=!1;if(o===void 0)e=N(this,e,t,0),s=!X(e)||e!==this._$AH&&e!==w,s&&(this._$AH=e);else{let a=e,l,c;for(e=o[0],l=0;l<o.length-1;l++)c=N(this,a[r+l],t,l),c===w&&(c=this._$AH[l]),s||(s=!X(c)||c!==this._$AH[l]),c===v?e=v:e!==v&&(e+=(c??"")+o[l+1]),this._$AH[l]=c}s&&!n&&this.j(e)}j(e){e===v?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},fe=class extends z{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===v?void 0:e}},It=q?q.emptyScript:"",ve=class extends z{constructor(){super(...arguments),this.type=4}j(e){e&&e!==v?this.element.setAttribute(this.name,It):this.element.removeAttribute(this.name)}},me=class extends z{constructor(e,t,r,n,o){super(e,t,r,n,o),this.type=5}_$AI(e,t=this){var r;if((e=(r=N(this,e,t,0))!==null&&r!==void 0?r:v)===w)return;let n=this._$AH,o=e===v&&n!==v||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==v&&(n===v||o);o&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,r;typeof this._$AH=="function"?this._$AH.call((r=(t=this.options)===null||t===void 0?void 0:t.host)!==null&&r!==void 0?r:this.element,e):this._$AH.handleEvent(e)}},ye=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){N(this,e)}},pt={O:ue,P:H,A:Ue,C:1,M:ut,L:pe,R:lt,D:N,I:G,V:z,H:ve,N:me,U:fe,F:ye},st=he.litHtmlPolyfillSupport;st?.(Z,G),((Me=he.litHtmlVersions)!==null&&Me!==void 0?Me:he.litHtmlVersions=[]).push("2.8.0");var ft=(i,e,t)=>{var r,n;let o=(r=t?.renderBefore)!==null&&r!==void 0?r:e,s=o._$litPart$;if(s===void 0){let a=(n=t?.renderBefore)!==null&&n!==void 0?n:null;o._$litPart$=s=new G(e.insertBefore(Y(),a),a,void 0,t??{})}return s._$AI(i),s};var Le,Be;var E=class extends T{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let r=super.createRenderRoot();return(e=(t=this.renderOptions).renderBefore)!==null&&e!==void 0||(t.renderBefore=r.firstChild),r}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ft(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return w}};E.finalized=!0,E._$litElement$=!0,(Le=globalThis.litElementHydrateSupport)===null||Le===void 0||Le.call(globalThis,{LitElement:E});var vt=globalThis.litElementPolyfillSupport;vt?.({LitElement:E});((Be=globalThis.litElementVersions)!==null&&Be!==void 0?Be:globalThis.litElementVersions=[]).push("3.3.3");var D=i=>e=>typeof e=="function"?((t,r)=>(customElements.define(t,r),r))(i,e):((t,r)=>{let{kind:n,elements:o}=r;return{kind:n,elements:o,finisher(s){customElements.define(t,s)}}})(i,e);var Nt=(i,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(t){t.createProperty(e.key,i)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,i)}},zt=(i,e,t)=>{e.constructor.createProperty(t,i)};function m(i){return(e,t)=>t!==void 0?zt(i,e,t):Nt(i,e)}function R(i){return m({...i,state:!0})}var Ie,Oi=((Ie=window.HTMLSlotElement)===null||Ie===void 0?void 0:Ie.prototype.assignedElements)!=null?(i,e)=>i.assignedElements(e):(i,e)=>i.assignedNodes(e).filter((t=>t.nodeType===Node.ELEMENT_NODE));var j={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},P=i=>(...e)=>({_$litDirective$:i,values:e}),S=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:Kt}=pt;var ge=i=>i.strings===void 0,mt=()=>document.createComment(""),F=(i,e,t)=>{var r;let n=i._$AA.parentNode,o=e===void 0?i._$AB:e._$AA;if(t===void 0){let s=n.insertBefore(mt(),o),a=n.insertBefore(mt(),o);t=new Kt(s,a,i,i.options)}else{let s=t._$AB.nextSibling,a=t._$AM,l=a!==i;if(l){let c;(r=t._$AQ)===null||r===void 0||r.call(t,i),t._$AM=i,t._$AP!==void 0&&(c=i._$AU)!==a._$AU&&t._$AP(c)}if(s!==o||l){let c=t._$AA;for(;c!==s;){let d=c.nextSibling;n.insertBefore(c,o),c=d}}}return t},U=(i,e,t=i)=>(i._$AI(e,t),i),Vt={},_e=(i,e=Vt)=>i._$AH=e,yt=i=>i._$AH,be=i=>{var e;(e=i._$AP)===null||e===void 0||e.call(i,!1,!0);let t=i._$AA,r=i._$AB.nextSibling;for(;t!==r;){let n=t.nextSibling;t.remove(),t=n}};var gt=(i,e,t)=>{let r=new Map;for(let n=e;n<=t;n++)r.set(i[n],n);return r},_t=P(class extends S{constructor(i){if(super(i),i.type!==j.CHILD)throw Error("repeat() can only be used in text expressions")}ct(i,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);let n=[],o=[],s=0;for(let a of i)n[s]=r?r(a,s):s,o[s]=t(a,s),s++;return{values:o,keys:n}}render(i,e,t){return this.ct(i,e,t).values}update(i,[e,t,r]){var n;let o=yt(i),{values:s,keys:a}=this.ct(e,t,r);if(!Array.isArray(o))return this.ut=a,s;let l=(n=this.ut)!==null&&n!==void 0?n:this.ut=[],c=[],d,u,h=0,p=o.length-1,f=0,$=s.length-1;for(;h<=p&&f<=$;)if(o[h]===null)h++;else if(o[p]===null)p--;else if(l[h]===a[f])c[f]=U(o[h],s[f]),h++,f++;else if(l[p]===a[$])c[$]=U(o[p],s[$]),p--,$--;else if(l[h]===a[$])c[$]=U(o[h],s[$]),F(i,c[$+1],o[h]),h++,$--;else if(l[p]===a[f])c[f]=U(o[p],s[f]),F(i,o[h],o[p]),p--,f++;else if(d===void 0&&(d=gt(a,f,$),u=gt(l,h,p)),d.has(l[h]))if(d.has(l[p])){let C=u.get(a[f]),Se=C!==void 0?o[C]:null;if(Se===null){let Je=F(i,o[h]);U(Je,s[f]),c[f]=Je}else c[f]=U(Se,s[f]),F(i,o[h],Se),o[C]=null;f++}else be(o[p]),p--;else be(o[h]),h++;for(;f<=$;){let C=F(i,c[$+1]);U(C,s[f]),c[f++]=C}for(;h<=p;){let C=o[h++];C!==null&&be(C)}return this.ut=a,_e(i,c),w}});var bt=P(class extends S{constructor(i){if(super(i),i.type!==j.PROPERTY&&i.type!==j.ATTRIBUTE&&i.type!==j.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!ge(i))throw Error("`live` bindings can only contain a single expression")}render(i){return i}update(i,[e]){if(e===w||e===v)return e;let t=i.element,r=i.name;if(i.type===j.PROPERTY){if(e===t[r])return w}else if(i.type===j.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(r))return w}else if(i.type===j.ATTRIBUTE&&t.getAttribute(r)===e+"")return w;return _e(i),e}});var te=(i,e)=>{var t,r;let n=i._$AN;if(n===void 0)return!1;for(let o of n)(r=(t=o)._$AO)===null||r===void 0||r.call(t,e,!1),te(o,e);return!0},$e=i=>{let e,t;do{if((e=i._$AM)===void 0)break;t=e._$AN,t.delete(i),i=e}while(t?.size===0)},$t=i=>{for(let e;e=i._$AM;i=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(i))break;t.add(i),Ft(e)}};function qt(i){this._$AN!==void 0?($e(this),this._$AM=i,$t(this)):this._$AM=i}function Gt(i,e=!1,t=0){let r=this._$AH,n=this._$AN;if(n!==void 0&&n.size!==0)if(e)if(Array.isArray(r))for(let o=t;o<r.length;o++)te(r[o],!1),$e(r[o]);else r!=null&&(te(r,!1),$e(r));else te(this,i)}var Ft=i=>{var e,t,r,n;i.type==j.CHILD&&((e=(r=i)._$AP)!==null&&e!==void 0||(r._$AP=Gt),(t=(n=i)._$AQ)!==null&&t!==void 0||(n._$AQ=qt))},we=class extends S{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),$t(this),this.isConnected=e._$AU}_$AO(e,t=!0){var r,n;e!==this.isConnected&&(this.isConnected=e,e?(r=this.reconnected)===null||r===void 0||r.call(this):(n=this.disconnected)===null||n===void 0||n.call(this)),t&&(te(this,e),$e(this))}setValue(e){if(ge(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};var xe=()=>new ze,ze=class{},Ne=new WeakMap,Ae=P(class extends we{render(i){return v}update(i,[e]){var t;let r=e!==this.G;return r&&this.G!==void 0&&this.ot(void 0),(r||this.rt!==this.lt)&&(this.G=e,this.dt=(t=i.options)===null||t===void 0?void 0:t.host,this.ot(this.lt=i.element)),v}ot(i){var e;if(typeof this.G=="function"){let t=(e=this.dt)!==null&&e!==void 0?e:globalThis,r=Ne.get(t);r===void 0&&(r=new WeakMap,Ne.set(t,r)),r.get(this.G)!==void 0&&this.G.call(this.dt,void 0),r.set(this.G,i),i!==void 0&&this.G.call(this.dt,i)}else this.G.value=i}get rt(){var i,e,t;return typeof this.G=="function"?(e=Ne.get((i=this.dt)!==null&&i!==void 0?i:globalThis))===null||e===void 0?void 0:e.get(this.G):(t=this.G)===null||t===void 0?void 0:t.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});var ie=P(class extends S{constructor(i){var e;if(super(i),i.type!==j.ATTRIBUTE||i.name!=="class"||((e=i.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(i){return" "+Object.keys(i).filter((e=>i[e])).join(" ")+" "}update(i,[e]){var t,r;if(this.it===void 0){this.it=new Set,i.strings!==void 0&&(this.nt=new Set(i.strings.join(" ").split(/\s/).filter((o=>o!==""))));for(let o in e)e[o]&&!(!((t=this.nt)===null||t===void 0)&&t.has(o))&&this.it.add(o);return this.render(e)}let n=i.element.classList;this.it.forEach((o=>{o in e||(n.remove(o),this.it.delete(o))}));for(let o in e){let s=!!e[o];s===this.it.has(o)||!((r=this.nt)===null||r===void 0)&&r.has(o)||(s?(n.add(o),this.it.add(o)):(n.remove(o),this.it.delete(o)))}return w}});var Ke=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;function Ve(i,e,t){i.addEventListener?i.addEventListener(e,t,!1):i.attachEvent&&i.attachEvent("on".concat(e),function(){t(window.event)})}function Et(i,e){for(var t=e.slice(0,e.length-1),r=0;r<t.length;r++)t[r]=i[t[r].toLowerCase()];return t}function kt(i){typeof i!="string"&&(i=""),i=i.replace(/\s/g,"");for(var e=i.split(","),t=e.lastIndexOf("");t>=0;)e[t-1]+=",",e.splice(t,1),t=e.lastIndexOf("");return e}function Jt(i,e){for(var t=i.length>=e.length?i:e,r=i.length>=e.length?e:i,n=!0,o=0;o<t.length;o++)r.indexOf(t[o])===-1&&(n=!1);return n}var St={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":Ke?173:189,"=":Ke?61:187,";":Ke?59:186,"'":222,"[":219,"]":221,"\\":220},K={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},wt={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},A={16:!1,18:!1,17:!1,91:!1},x={};for(re=1;re<20;re++)St["f".concat(re)]=111+re;var re,y=[],Pt="all",Ct=[],Ee=function(e){return St[e.toLowerCase()]||K[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function Ot(i){Pt=i||"all"}function ne(){return Pt||"all"}function Wt(){return y.slice(0)}function Qt(i){var e=i.target||i.srcElement,t=e.tagName,r=!0;return(e.isContentEditable||(t==="INPUT"||t==="TEXTAREA"||t==="SELECT")&&!e.readOnly)&&(r=!1),r}function Yt(i){return typeof i=="string"&&(i=Ee(i)),y.indexOf(i)!==-1}function Xt(i,e){var t,r;i||(i=ne());for(var n in x)if(Object.prototype.hasOwnProperty.call(x,n))for(t=x[n],r=0;r<t.length;)t[r].scope===i?t.splice(r,1):r++;ne()===i&&Ot(e||"all")}function Zt(i){var e=i.keyCode||i.which||i.charCode,t=y.indexOf(e);if(t>=0&&y.splice(t,1),i.key&&i.key.toLowerCase()==="meta"&&y.splice(0,y.length),(e===93||e===224)&&(e=91),e in A){A[e]=!1;for(var r in K)K[r]===e&&(M[r]=!1)}}function ei(i){if(!i)Object.keys(x).forEach(function(s){return delete x[s]});else if(Array.isArray(i))i.forEach(function(s){s.key&&qe(s)});else if(typeof i=="object")i.key&&qe(i);else if(typeof i=="string"){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];var n=t[0],o=t[1];typeof n=="function"&&(o=n,n=""),qe({key:i,scope:n,method:o,splitKey:"+"})}}var qe=function(e){var t=e.key,r=e.scope,n=e.method,o=e.splitKey,s=o===void 0?"+":o,a=kt(t);a.forEach(function(l){var c=l.split(s),d=c.length,u=c[d-1],h=u==="*"?"*":Ee(u);if(x[h]){r||(r=ne());var p=d>1?Et(K,c):[];x[h]=x[h].map(function(f){var $=n?f.method===n:!0;return $&&f.scope===r&&Jt(f.mods,p)?{}:f})}})};function xt(i,e,t){var r;if(e.scope===t||e.scope==="all"){r=e.mods.length>0;for(var n in A)Object.prototype.hasOwnProperty.call(A,n)&&(!A[n]&&e.mods.indexOf(+n)>-1||A[n]&&e.mods.indexOf(+n)===-1)&&(r=!1);(e.mods.length===0&&!A[16]&&!A[18]&&!A[17]&&!A[91]||r||e.shortcut==="*")&&e.method(i,e)===!1&&(i.preventDefault?i.preventDefault():i.returnValue=!1,i.stopPropagation&&i.stopPropagation(),i.cancelBubble&&(i.cancelBubble=!0))}}function At(i){var e=x["*"],t=i.keyCode||i.which||i.charCode;if(M.filter.call(this,i)){if((t===93||t===224)&&(t=91),y.indexOf(t)===-1&&t!==229&&y.push(t),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(p){var f=wt[p];i[p]&&y.indexOf(f)===-1?y.push(f):!i[p]&&y.indexOf(f)>-1?y.splice(y.indexOf(f),1):p==="metaKey"&&i[p]&&y.length===3&&(i.ctrlKey||i.shiftKey||i.altKey||(y=y.slice(y.indexOf(f))))}),t in A){A[t]=!0;for(var r in K)K[r]===t&&(M[r]=!0);if(!e)return}for(var n in A)Object.prototype.hasOwnProperty.call(A,n)&&(A[n]=i[wt[n]]);i.getModifierState&&!(i.altKey&&!i.ctrlKey)&&i.getModifierState("AltGraph")&&(y.indexOf(17)===-1&&y.push(17),y.indexOf(18)===-1&&y.push(18),A[17]=!0,A[18]=!0);var o=ne();if(e)for(var s=0;s<e.length;s++)e[s].scope===o&&(i.type==="keydown"&&e[s].keydown||i.type==="keyup"&&e[s].keyup)&&xt(i,e[s],o);if(t in x){for(var a=0;a<x[t].length;a++)if((i.type==="keydown"&&x[t][a].keydown||i.type==="keyup"&&x[t][a].keyup)&&x[t][a].key){for(var l=x[t][a],c=l.splitKey,d=l.key.split(c),u=[],h=0;h<d.length;h++)u.push(Ee(d[h]));u.sort().join("")===y.sort().join("")&&xt(i,l,o)}}}}function ti(i){return Ct.indexOf(i)>-1}function M(i,e,t){y=[];var r=kt(i),n=[],o="all",s=document,a=0,l=!1,c=!0,d="+";for(t===void 0&&typeof e=="function"&&(t=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(o=e.scope),e.element&&(s=e.element),e.keyup&&(l=e.keyup),e.keydown!==void 0&&(c=e.keydown),typeof e.splitKey=="string"&&(d=e.splitKey)),typeof e=="string"&&(o=e);a<r.length;a++)i=r[a].split(d),n=[],i.length>1&&(n=Et(K,i)),i=i[i.length-1],i=i==="*"?"*":Ee(i),i in x||(x[i]=[]),x[i].push({keyup:l,keydown:c,scope:o,mods:n,shortcut:r[a],method:t,key:r[a],splitKey:d});typeof s<"u"&&!ti(s)&&window&&(Ct.push(s),Ve(s,"keydown",function(u){At(u)}),Ve(window,"focus",function(){y=[]}),Ve(s,"keyup",function(u){At(u),Zt(u)}))}var Ge={setScope:Ot,getScope:ne,deleteScope:Xt,getPressedKeyCodes:Wt,isPressed:Yt,filter:Qt,unbind:ei};for(je in Ge)Object.prototype.hasOwnProperty.call(Ge,je)&&(M[je]=Ge[je]);var je;typeof window<"u"&&(jt=window.hotkeys,M.noConflict=function(i){return i&&window.hotkeys===M&&(window.hotkeys=jt),M},window.hotkeys=M);var jt,k=M;var oe=function(i,e,t,r){var n=arguments.length,o=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},V=class extends E{constructor(){super(...arguments),this.placeholder="",this.hideBreadcrumbs=!1,this.breadcrumbHome="Home",this.breadcrumbs=[],this._inputRef=xe()}render(){let e="";if(!this.hideBreadcrumbs){let t=[];for(let r of this.breadcrumbs)t.push(_`<button
|
|
4
|
+
tabindex="-1"
|
|
5
|
+
@click=${()=>this.selectParent(r)}
|
|
6
|
+
class="breadcrumb"
|
|
7
|
+
>
|
|
8
|
+
${r}
|
|
9
|
+
</button>`);e=_`<div class="breadcrumb-list">
|
|
10
|
+
<button
|
|
11
|
+
tabindex="-1"
|
|
12
|
+
@click=${()=>this.selectParent()}
|
|
13
|
+
class="breadcrumb"
|
|
14
|
+
>
|
|
15
|
+
${this.breadcrumbHome}
|
|
16
|
+
</button>
|
|
17
|
+
${t}
|
|
18
|
+
</div>`}return _`
|
|
19
|
+
${e}
|
|
20
|
+
<div part="ninja-input-wrapper" class="search-wrapper">
|
|
21
|
+
<input
|
|
22
|
+
part="ninja-input"
|
|
23
|
+
type="text"
|
|
24
|
+
id="search"
|
|
25
|
+
spellcheck="false"
|
|
26
|
+
autocomplete="off"
|
|
27
|
+
@input="${this._handleInput}"
|
|
28
|
+
${Ae(this._inputRef)}
|
|
29
|
+
placeholder="${this.placeholder}"
|
|
30
|
+
class="search"
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
`}setSearch(e){this._inputRef.value&&(this._inputRef.value.value=e)}focusSearch(){requestAnimationFrame(()=>this._inputRef.value.focus())}_handleInput(e){let t=e.target;this.dispatchEvent(new CustomEvent("change",{detail:{search:t.value},bubbles:!1,composed:!1}))}selectParent(e){this.dispatchEvent(new CustomEvent("setParent",{detail:{parent:e},bubbles:!0,composed:!0}))}firstUpdated(){this.focusSearch()}_close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}};V.styles=O`
|
|
34
|
+
:host {
|
|
35
|
+
flex: 1;
|
|
36
|
+
position: relative;
|
|
37
|
+
}
|
|
38
|
+
.search {
|
|
39
|
+
padding: 1.25em;
|
|
40
|
+
flex-grow: 1;
|
|
41
|
+
flex-shrink: 0;
|
|
42
|
+
margin: 0px;
|
|
43
|
+
border: none;
|
|
44
|
+
appearance: none;
|
|
45
|
+
font-size: 1.125em;
|
|
46
|
+
background: transparent;
|
|
47
|
+
caret-color: var(--ninja-accent-color);
|
|
48
|
+
color: var(--ninja-text-color);
|
|
49
|
+
outline: none;
|
|
50
|
+
font-family: var(--ninja-font-family);
|
|
51
|
+
}
|
|
52
|
+
.search::placeholder {
|
|
53
|
+
color: var(--ninja-placeholder-color);
|
|
54
|
+
}
|
|
55
|
+
.breadcrumb-list {
|
|
56
|
+
padding: 1em 4em 0 1em;
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: row;
|
|
59
|
+
align-items: stretch;
|
|
60
|
+
justify-content: flex-start;
|
|
61
|
+
flex: initial;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.breadcrumb {
|
|
65
|
+
background: var(--ninja-secondary-background-color);
|
|
66
|
+
text-align: center;
|
|
67
|
+
line-height: 1.2em;
|
|
68
|
+
border-radius: var(--ninja-key-border-radius);
|
|
69
|
+
border: 0;
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
padding: 0.1em 0.5em;
|
|
72
|
+
color: var(--ninja-secondary-text-color);
|
|
73
|
+
margin-right: 0.5em;
|
|
74
|
+
outline: none;
|
|
75
|
+
font-family: var(--ninja-font-family);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.search-wrapper {
|
|
79
|
+
display: flex;
|
|
80
|
+
border-bottom: var(--ninja-separate-border);
|
|
81
|
+
}
|
|
82
|
+
`;oe([m()],V.prototype,"placeholder",void 0);oe([m({type:Boolean})],V.prototype,"hideBreadcrumbs",void 0);oe([m()],V.prototype,"breadcrumbHome",void 0);oe([m({type:Array})],V.prototype,"breadcrumbs",void 0);V=oe([D("ninja-header")],V);var se=class extends S{constructor(e){if(super(e),this.et=v,e.type!==j.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===v||e==null)return this.ft=void 0,this.et=e;if(e===w)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.et)return this.ft;this.et=e;let t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}};se.directiveName="unsafeHTML",se.resultType=1;var Tt=P(se);function*Ht(i,e){let t=typeof e=="function";if(i!==void 0){let r=-1;for(let n of i)r>-1&&(yield t?e(r):e),r++,yield n}}function Rt(i,e,t,r){var n=arguments.length,o=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o}var Mt=O`:host{font-family:var(--mdc-icon-font, "Material Icons");font-weight:normal;font-style:normal;font-size:var(--mdc-icon-size, 24px);line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}`;var Fe=class extends E{render(){return _`<span><slot></slot></span>`}};Fe.styles=[Mt];Fe=Rt([D("mwc-icon")],Fe);var ke=function(i,e,t,r){var n=arguments.length,o=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},J=class extends E{constructor(){super(),this.selected=!1,this.hotKeysJoinedView=!0,this.addEventListener("click",this.click)}ensureInView(){requestAnimationFrame(()=>this.scrollIntoView({block:"nearest"}))}click(){this.dispatchEvent(new CustomEvent("actionsSelected",{detail:this.action,bubbles:!0,composed:!0}))}updated(e){e.has("selected")&&this.selected&&this.ensureInView()}render(){let e;this.action.mdIcon?e=_`<mwc-icon part="ninja-icon" class="ninja-icon"
|
|
83
|
+
>${this.action.mdIcon}</mwc-icon
|
|
84
|
+
>`:this.action.icon&&(e=Tt(this.action.icon||""));let t;this.action.hotkey&&(this.hotKeysJoinedView?t=this.action.hotkey.split(",").map(n=>{let o=n.split("+"),s=_`${Ht(o.map(a=>_`<kbd>${a}</kbd>`),"+")}`;return _`<div class="ninja-hotkey ninja-hotkeys">
|
|
85
|
+
${s}
|
|
86
|
+
</div>`}):t=this.action.hotkey.split(",").map(n=>{let s=n.split("+").map(a=>_`<kbd class="ninja-hotkey">${a}</kbd>`);return _`<kbd class="ninja-hotkeys">${s}</kbd>`}));let r={selected:this.selected,"ninja-action":!0};return _`
|
|
87
|
+
<div
|
|
88
|
+
class="ninja-action"
|
|
89
|
+
part="ninja-action ${this.selected?"ninja-selected":""}"
|
|
90
|
+
class=${ie(r)}
|
|
91
|
+
>
|
|
92
|
+
${e}
|
|
93
|
+
<div class="ninja-title">${this.action.title}</div>
|
|
94
|
+
${t}
|
|
95
|
+
</div>
|
|
96
|
+
`}};J.styles=O`
|
|
97
|
+
:host {
|
|
98
|
+
display: flex;
|
|
99
|
+
width: 100%;
|
|
100
|
+
}
|
|
101
|
+
.ninja-action {
|
|
102
|
+
padding: 0.75em 1em;
|
|
103
|
+
display: flex;
|
|
104
|
+
border-left: 2px solid transparent;
|
|
105
|
+
align-items: center;
|
|
106
|
+
justify-content: start;
|
|
107
|
+
outline: none;
|
|
108
|
+
transition: color 0s ease 0s;
|
|
109
|
+
width: 100%;
|
|
110
|
+
}
|
|
111
|
+
.ninja-action.selected {
|
|
112
|
+
cursor: pointer;
|
|
113
|
+
color: var(--ninja-selected-text-color);
|
|
114
|
+
background-color: var(--ninja-selected-background);
|
|
115
|
+
border-left: 2px solid var(--ninja-accent-color);
|
|
116
|
+
outline: none;
|
|
117
|
+
}
|
|
118
|
+
.ninja-action.selected .ninja-icon {
|
|
119
|
+
color: var(--ninja-selected-text-color);
|
|
120
|
+
}
|
|
121
|
+
.ninja-icon {
|
|
122
|
+
font-size: var(--ninja-icon-size);
|
|
123
|
+
max-width: var(--ninja-icon-size);
|
|
124
|
+
max-height: var(--ninja-icon-size);
|
|
125
|
+
margin-right: 1em;
|
|
126
|
+
color: var(--ninja-icon-color);
|
|
127
|
+
margin-right: 1em;
|
|
128
|
+
position: relative;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.ninja-title {
|
|
132
|
+
flex-shrink: 0.01;
|
|
133
|
+
margin-right: 0.5em;
|
|
134
|
+
flex-grow: 1;
|
|
135
|
+
font-size: 0.8125em;
|
|
136
|
+
white-space: nowrap;
|
|
137
|
+
overflow: hidden;
|
|
138
|
+
text-overflow: ellipsis;
|
|
139
|
+
}
|
|
140
|
+
.ninja-hotkeys {
|
|
141
|
+
flex-shrink: 0;
|
|
142
|
+
width: min-content;
|
|
143
|
+
display: flex;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.ninja-hotkeys kbd {
|
|
147
|
+
font-family: inherit;
|
|
148
|
+
}
|
|
149
|
+
.ninja-hotkey {
|
|
150
|
+
background: var(--ninja-secondary-background-color);
|
|
151
|
+
padding: 0.06em 0.25em;
|
|
152
|
+
border-radius: var(--ninja-key-border-radius);
|
|
153
|
+
text-transform: capitalize;
|
|
154
|
+
color: var(--ninja-secondary-text-color);
|
|
155
|
+
font-size: 0.75em;
|
|
156
|
+
font-family: inherit;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.ninja-hotkey + .ninja-hotkey {
|
|
160
|
+
margin-left: 0.5em;
|
|
161
|
+
}
|
|
162
|
+
.ninja-hotkeys + .ninja-hotkeys {
|
|
163
|
+
margin-left: 1em;
|
|
164
|
+
}
|
|
165
|
+
`;ke([m({type:Object})],J.prototype,"action",void 0);ke([m({type:Boolean})],J.prototype,"selected",void 0);ke([m({type:Boolean})],J.prototype,"hotKeysJoinedView",void 0);J=ke([D("ninja-action")],J);var Dt=_` <div class="modal-footer" slot="footer">
|
|
166
|
+
<span class="help">
|
|
167
|
+
<svg
|
|
168
|
+
version="1.0"
|
|
169
|
+
class="ninja-examplekey"
|
|
170
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
171
|
+
viewBox="0 0 1280 1280"
|
|
172
|
+
>
|
|
173
|
+
<path
|
|
174
|
+
d="M1013 376c0 73.4-.4 113.3-1.1 120.2a159.9 159.9 0 0 1-90.2 127.3c-20 9.6-36.7 14-59.2 15.5-7.1.5-121.9.9-255 1h-242l95.5-95.5 95.5-95.5-38.3-38.2-38.2-38.3-160 160c-88 88-160 160.4-160 161 0 .6 72 73 160 161l160 160 38.2-38.3 38.3-38.2-95.5-95.5-95.5-95.5h251.1c252.9 0 259.8-.1 281.4-3.6 72.1-11.8 136.9-54.1 178.5-116.4 8.6-12.9 22.6-40.5 28-55.4 4.4-12 10.7-36.1 13.1-50.6 1.6-9.6 1.8-21 2.1-132.8l.4-122.2H1013v110z"
|
|
175
|
+
/>
|
|
176
|
+
</svg>
|
|
177
|
+
|
|
178
|
+
to select
|
|
179
|
+
</span>
|
|
180
|
+
<span class="help">
|
|
181
|
+
<svg
|
|
182
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
183
|
+
class="ninja-examplekey"
|
|
184
|
+
viewBox="0 0 24 24"
|
|
185
|
+
>
|
|
186
|
+
<path d="M0 0h24v24H0V0z" fill="none" />
|
|
187
|
+
<path
|
|
188
|
+
d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
|
|
189
|
+
/>
|
|
190
|
+
</svg>
|
|
191
|
+
<svg
|
|
192
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
193
|
+
class="ninja-examplekey"
|
|
194
|
+
viewBox="0 0 24 24"
|
|
195
|
+
>
|
|
196
|
+
<path d="M0 0h24v24H0V0z" fill="none" />
|
|
197
|
+
<path d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z" />
|
|
198
|
+
</svg>
|
|
199
|
+
to navigate
|
|
200
|
+
</span>
|
|
201
|
+
<span class="help">
|
|
202
|
+
<span class="ninja-examplekey esc">esc</span>
|
|
203
|
+
to close
|
|
204
|
+
</span>
|
|
205
|
+
<span class="help">
|
|
206
|
+
<svg
|
|
207
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
208
|
+
class="ninja-examplekey backspace"
|
|
209
|
+
viewBox="0 0 20 20"
|
|
210
|
+
fill="currentColor"
|
|
211
|
+
>
|
|
212
|
+
<path
|
|
213
|
+
fill-rule="evenodd"
|
|
214
|
+
d="M6.707 4.879A3 3 0 018.828 4H15a3 3 0 013 3v6a3 3 0 01-3 3H8.828a3 3 0 01-2.12-.879l-4.415-4.414a1 1 0 010-1.414l4.414-4.414zm4 2.414a1 1 0 00-1.414 1.414L10.586 10l-1.293 1.293a1 1 0 101.414 1.414L12 11.414l1.293 1.293a1 1 0 001.414-1.414L13.414 10l1.293-1.293a1 1 0 00-1.414-1.414L12 8.586l-1.293-1.293z"
|
|
215
|
+
clip-rule="evenodd"
|
|
216
|
+
/>
|
|
217
|
+
</svg>
|
|
218
|
+
move to parent
|
|
219
|
+
</span>
|
|
220
|
+
</div>`;var Ut=O`
|
|
221
|
+
:host {
|
|
222
|
+
--ninja-width: 640px;
|
|
223
|
+
--ninja-backdrop-filter: none;
|
|
224
|
+
--ninja-overflow-background: rgba(255, 255, 255, 0.5);
|
|
225
|
+
--ninja-text-color: rgb(60, 65, 73);
|
|
226
|
+
--ninja-font-size: 16px;
|
|
227
|
+
--ninja-top: 20%;
|
|
228
|
+
|
|
229
|
+
--ninja-key-border-radius: 0.25em;
|
|
230
|
+
--ninja-accent-color: rgb(110, 94, 210);
|
|
231
|
+
--ninja-secondary-background-color: rgb(239, 241, 244);
|
|
232
|
+
--ninja-secondary-text-color: rgb(107, 111, 118);
|
|
233
|
+
|
|
234
|
+
--ninja-selected-background: rgb(248, 249, 251);
|
|
235
|
+
|
|
236
|
+
--ninja-icon-color: var(--ninja-secondary-text-color);
|
|
237
|
+
--ninja-icon-size: 1.2em;
|
|
238
|
+
--ninja-separate-border: 1px solid var(--ninja-secondary-background-color);
|
|
239
|
+
|
|
240
|
+
--ninja-modal-background: #fff;
|
|
241
|
+
--ninja-modal-shadow: rgb(0 0 0 / 50%) 0px 16px 70px;
|
|
242
|
+
|
|
243
|
+
--ninja-actions-height: 300px;
|
|
244
|
+
--ninja-group-text-color: rgb(144, 149, 157);
|
|
245
|
+
|
|
246
|
+
--ninja-footer-background: rgba(242, 242, 242, 0.4);
|
|
247
|
+
|
|
248
|
+
--ninja-placeholder-color: #8e8e8e;
|
|
249
|
+
|
|
250
|
+
font-size: var(--ninja-font-size);
|
|
251
|
+
|
|
252
|
+
--ninja-z-index: 1;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
:host(.dark) {
|
|
256
|
+
--ninja-backdrop-filter: none;
|
|
257
|
+
--ninja-overflow-background: rgba(0, 0, 0, 0.7);
|
|
258
|
+
--ninja-text-color: #7d7d7d;
|
|
259
|
+
|
|
260
|
+
--ninja-modal-background: rgba(17, 17, 17, 0.85);
|
|
261
|
+
--ninja-accent-color: rgb(110, 94, 210);
|
|
262
|
+
--ninja-secondary-background-color: rgba(51, 51, 51, 0.44);
|
|
263
|
+
--ninja-secondary-text-color: #888;
|
|
264
|
+
|
|
265
|
+
--ninja-selected-text-color: #eaeaea;
|
|
266
|
+
--ninja-selected-background: rgba(51, 51, 51, 0.44);
|
|
267
|
+
|
|
268
|
+
--ninja-icon-color: var(--ninja-secondary-text-color);
|
|
269
|
+
--ninja-separate-border: 1px solid var(--ninja-secondary-background-color);
|
|
270
|
+
|
|
271
|
+
--ninja-modal-shadow: 0 16px 70px rgba(0, 0, 0, 0.2);
|
|
272
|
+
|
|
273
|
+
--ninja-group-text-color: rgb(144, 149, 157);
|
|
274
|
+
|
|
275
|
+
--ninja-footer-background: rgba(30, 30, 30, 85%);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.modal {
|
|
279
|
+
display: none;
|
|
280
|
+
position: fixed;
|
|
281
|
+
z-index: var(--ninja-z-index);
|
|
282
|
+
left: 0;
|
|
283
|
+
top: 0;
|
|
284
|
+
width: 100%;
|
|
285
|
+
height: 100%;
|
|
286
|
+
overflow: auto;
|
|
287
|
+
background: var(--ninja-overflow-background);
|
|
288
|
+
-webkit-font-smoothing: antialiased;
|
|
289
|
+
-moz-osx-font-smoothing: grayscale;
|
|
290
|
+
-webkit-backdrop-filter: var(--ninja-backdrop-filter);
|
|
291
|
+
backdrop-filter: var(--ninja-backdrop-filter);
|
|
292
|
+
text-align: left;
|
|
293
|
+
color: var(--ninja-text-color);
|
|
294
|
+
font-family: var(--ninja-font-family);
|
|
295
|
+
}
|
|
296
|
+
.modal.visible {
|
|
297
|
+
display: block;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.modal-content {
|
|
301
|
+
position: relative;
|
|
302
|
+
top: var(--ninja-top);
|
|
303
|
+
margin: auto;
|
|
304
|
+
padding: 0;
|
|
305
|
+
display: flex;
|
|
306
|
+
flex-direction: column;
|
|
307
|
+
flex-shrink: 1;
|
|
308
|
+
-webkit-box-flex: 1;
|
|
309
|
+
flex-grow: 1;
|
|
310
|
+
min-width: 0px;
|
|
311
|
+
will-change: transform;
|
|
312
|
+
background: var(--ninja-modal-background);
|
|
313
|
+
border-radius: 0.5em;
|
|
314
|
+
box-shadow: var(--ninja-modal-shadow);
|
|
315
|
+
max-width: var(--ninja-width);
|
|
316
|
+
overflow: hidden;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.bump {
|
|
320
|
+
animation: zoom-in-zoom-out 0.2s ease;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
@keyframes zoom-in-zoom-out {
|
|
324
|
+
0% {
|
|
325
|
+
transform: scale(0.99);
|
|
326
|
+
}
|
|
327
|
+
50% {
|
|
328
|
+
transform: scale(1.01, 1.01);
|
|
329
|
+
}
|
|
330
|
+
100% {
|
|
331
|
+
transform: scale(1, 1);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.ninja-github {
|
|
336
|
+
color: var(--ninja-keys-text-color);
|
|
337
|
+
font-weight: normal;
|
|
338
|
+
text-decoration: none;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.actions-list {
|
|
342
|
+
max-height: var(--ninja-actions-height);
|
|
343
|
+
overflow: auto;
|
|
344
|
+
scroll-behavior: smooth;
|
|
345
|
+
position: relative;
|
|
346
|
+
margin: 0;
|
|
347
|
+
padding: 0.5em 0;
|
|
348
|
+
list-style: none;
|
|
349
|
+
scroll-behavior: smooth;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.group-header {
|
|
353
|
+
height: 1.375em;
|
|
354
|
+
line-height: 1.375em;
|
|
355
|
+
padding-left: 1.25em;
|
|
356
|
+
padding-top: 0.5em;
|
|
357
|
+
text-overflow: ellipsis;
|
|
358
|
+
white-space: nowrap;
|
|
359
|
+
overflow: hidden;
|
|
360
|
+
font-size: 0.75em;
|
|
361
|
+
line-height: 1em;
|
|
362
|
+
color: var(--ninja-group-text-color);
|
|
363
|
+
margin: 1px 0;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
.modal-footer {
|
|
367
|
+
background: var(--ninja-footer-background);
|
|
368
|
+
padding: 0.5em 1em;
|
|
369
|
+
display: flex;
|
|
370
|
+
/* font-size: 0.75em; */
|
|
371
|
+
border-top: var(--ninja-separate-border);
|
|
372
|
+
color: var(--ninja-secondary-text-color);
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
.modal-footer .help {
|
|
376
|
+
display: flex;
|
|
377
|
+
margin-right: 1em;
|
|
378
|
+
align-items: center;
|
|
379
|
+
font-size: 0.75em;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.ninja-examplekey {
|
|
383
|
+
background: var(--ninja-secondary-background-color);
|
|
384
|
+
padding: 0.06em 0.25em;
|
|
385
|
+
border-radius: var(--ninja-key-border-radius);
|
|
386
|
+
color: var(--ninja-secondary-text-color);
|
|
387
|
+
width: 1em;
|
|
388
|
+
height: 1em;
|
|
389
|
+
margin-right: 0.5em;
|
|
390
|
+
font-size: 1.25em;
|
|
391
|
+
fill: currentColor;
|
|
392
|
+
}
|
|
393
|
+
.ninja-examplekey.esc {
|
|
394
|
+
width: auto;
|
|
395
|
+
height: auto;
|
|
396
|
+
font-size: 1.1em;
|
|
397
|
+
}
|
|
398
|
+
.ninja-examplekey.backspace {
|
|
399
|
+
opacity: 0.7;
|
|
400
|
+
}
|
|
401
|
+
`;var b=function(i,e,t,r){var n=arguments.length,o=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(n<3?s(o):n>3?s(e,t,o):s(e,t))||o);return n>3&&o&&Object.defineProperty(e,t,o),o},g=class extends E{constructor(){super(...arguments),this.placeholder="Type a command or search...",this.disableHotkeys=!1,this.hideBreadcrumbs=!1,this.openHotkey="cmd+k,ctrl+k",this.navigationUpHotkey="up,shift+tab",this.navigationDownHotkey="down,tab",this.closeHotkey="esc",this.goBackHotkey="backspace",this.selectHotkey="enter",this.hotKeysJoinedView=!1,this.noAutoLoadMdIcons=!1,this.data=[],this.visible=!1,this._bump=!0,this._actionMatches=[],this._search="",this._flatData=[],this._headerRef=xe()}open(e={}){this._bump=!0,this.visible=!0,this._headerRef.value.focusSearch(),this._actionMatches.length>0&&(this._selected=this._actionMatches[0]),this.setParent(e.parent)}close(){this._bump=!1,this.visible=!1}setParent(e){e?this._currentRoot=e:this._currentRoot=void 0,this._selected=void 0,this._search="",this._headerRef.value.setSearch("")}get breadcrumbs(){var e;let t=[],r=(e=this._selected)===null||e===void 0?void 0:e.parent;if(r)for(t.push(r);r;){let n=this._flatData.find(o=>o.id===r);n?.parent&&t.push(n.parent),r=n?n.parent:void 0}return t.reverse()}connectedCallback(){super.connectedCallback(),this.noAutoLoadMdIcons||document.fonts.load("24px Material Icons","apps").then(()=>{}),this._registerInternalHotkeys()}disconnectedCallback(){super.disconnectedCallback(),this._unregisterInternalHotkeys()}_flattern(e,t){let r=[];return e||(e=[]),e.map(n=>{let o=n.children&&n.children.some(a=>typeof a=="string"),s={...n,parent:n.parent||t};return o||(s.children&&s.children.length&&(t=n.id,r=[...r,...s.children]),s.children=s.children?s.children.map(a=>a.id):[]),s}).concat(r.length?this._flattern(r,t):r)}update(e){e.has("data")&&!this.disableHotkeys&&(this._flatData=this._flattern(this.data),this._flatData.filter(t=>!!t.hotkey).forEach(t=>{k(t.hotkey,r=>{r.preventDefault(),t.handler&&t.handler(t)})})),super.update(e)}_registerInternalHotkeys(){this.openHotkey&&k(this.openHotkey,e=>{e.preventDefault(),this.visible?this.close():this.open()}),this.selectHotkey&&k(this.selectHotkey,e=>{this.visible&&(e.preventDefault(),this._actionSelected(this._actionMatches[this._selectedIndex]))}),this.goBackHotkey&&k(this.goBackHotkey,e=>{this.visible&&(this._search||(e.preventDefault(),this._goBack()))}),this.navigationDownHotkey&&k(this.navigationDownHotkey,e=>{this.visible&&(e.preventDefault(),this._selectedIndex>=this._actionMatches.length-1?this._selected=this._actionMatches[0]:this._selected=this._actionMatches[this._selectedIndex+1])}),this.navigationUpHotkey&&k(this.navigationUpHotkey,e=>{this.visible&&(e.preventDefault(),this._selectedIndex===0?this._selected=this._actionMatches[this._actionMatches.length-1]:this._selected=this._actionMatches[this._selectedIndex-1])}),this.closeHotkey&&k(this.closeHotkey,()=>{this.visible&&this.close()})}_unregisterInternalHotkeys(){this.openHotkey&&k.unbind(this.openHotkey),this.selectHotkey&&k.unbind(this.selectHotkey),this.goBackHotkey&&k.unbind(this.goBackHotkey),this.navigationDownHotkey&&k.unbind(this.navigationDownHotkey),this.navigationUpHotkey&&k.unbind(this.navigationUpHotkey),this.closeHotkey&&k.unbind(this.closeHotkey)}_actionFocused(e,t){this._selected=e,t.target.ensureInView()}_onTransitionEnd(){this._bump=!1}_goBack(){let e=this.breadcrumbs.length>1?this.breadcrumbs[this.breadcrumbs.length-2]:void 0;this.setParent(e)}render(){let e={bump:this._bump,"modal-content":!0},t={visible:this.visible,modal:!0},n=this._flatData.filter(a=>{var l;let c=new RegExp(this._search,"gi"),d=a.title.match(c)||((l=a.keywords)===null||l===void 0?void 0:l.match(c));return(!this._currentRoot&&this._search||a.parent===this._currentRoot)&&d}).reduce((a,l)=>a.set(l.section,[...a.get(l.section)||[],l]),new Map);this._actionMatches=[...n.values()].flat(),this._actionMatches.length>0&&this._selectedIndex===-1&&(this._selected=this._actionMatches[0]),this._actionMatches.length===0&&(this._selected=void 0);let o=a=>_` ${_t(a,l=>l.id,l=>{var c;return _`<ninja-action
|
|
402
|
+
exportparts="ninja-action,ninja-selected,ninja-icon"
|
|
403
|
+
.selected=${bt(l.id===((c=this._selected)===null||c===void 0?void 0:c.id))}
|
|
404
|
+
.hotKeysJoinedView=${this.hotKeysJoinedView}
|
|
405
|
+
@mouseover=${d=>this._actionFocused(l,d)}
|
|
406
|
+
@actionsSelected=${d=>this._actionSelected(d.detail)}
|
|
407
|
+
.action=${l}
|
|
408
|
+
></ninja-action>`})}`,s=[];return n.forEach((a,l)=>{let c=l?_`<div class="group-header">${l}</div>`:void 0;s.push(_`${c}${o(a)}`)}),_`
|
|
409
|
+
<div @click=${this._overlayClick} class=${ie(t)}>
|
|
410
|
+
<div class=${ie(e)} @animationend=${this._onTransitionEnd}>
|
|
411
|
+
<ninja-header
|
|
412
|
+
exportparts="ninja-input,ninja-input-wrapper"
|
|
413
|
+
${Ae(this._headerRef)}
|
|
414
|
+
.placeholder=${this.placeholder}
|
|
415
|
+
.hideBreadcrumbs=${this.hideBreadcrumbs}
|
|
416
|
+
.breadcrumbs=${this.breadcrumbs}
|
|
417
|
+
@change=${this._handleInput}
|
|
418
|
+
@setParent=${a=>this.setParent(a.detail.parent)}
|
|
419
|
+
@close=${this.close}
|
|
420
|
+
>
|
|
421
|
+
</ninja-header>
|
|
422
|
+
<div class="modal-body">
|
|
423
|
+
<div class="actions-list" part="actions-list">${s}</div>
|
|
424
|
+
</div>
|
|
425
|
+
<slot name="footer"> ${Dt} </slot>
|
|
426
|
+
</div>
|
|
427
|
+
</div>
|
|
428
|
+
`}get _selectedIndex(){return this._selected?this._actionMatches.indexOf(this._selected):-1}_actionSelected(e){var t;if(this.dispatchEvent(new CustomEvent("selected",{detail:{search:this._search,action:e},bubbles:!0,composed:!0})),!!e){if(e.children&&((t=e.children)===null||t===void 0?void 0:t.length)>0&&(this._currentRoot=e.id,this._search=""),this._headerRef.value.setSearch(""),this._headerRef.value.focusSearch(),e.handler){let r=e.handler(e);r?.keepOpen||this.close()}this._bump=!0}}async _handleInput(e){this._search=e.detail.search,await this.updateComplete,this.dispatchEvent(new CustomEvent("change",{detail:{search:this._search,actions:this._actionMatches},bubbles:!0,composed:!0}))}_overlayClick(e){var t;!((t=e.target)===null||t===void 0)&&t.classList.contains("modal")&&this.close()}};g.styles=[Ut];b([m({type:String})],g.prototype,"placeholder",void 0);b([m({type:Boolean})],g.prototype,"disableHotkeys",void 0);b([m({type:Boolean})],g.prototype,"hideBreadcrumbs",void 0);b([m()],g.prototype,"openHotkey",void 0);b([m()],g.prototype,"navigationUpHotkey",void 0);b([m()],g.prototype,"navigationDownHotkey",void 0);b([m()],g.prototype,"closeHotkey",void 0);b([m()],g.prototype,"goBackHotkey",void 0);b([m()],g.prototype,"selectHotkey",void 0);b([m({type:Boolean})],g.prototype,"hotKeysJoinedView",void 0);b([m({type:Boolean})],g.prototype,"noAutoLoadMdIcons",void 0);b([m({type:Array,hasChanged(){return!0}})],g.prototype,"data",void 0);b([R()],g.prototype,"visible",void 0);b([R()],g.prototype,"_bump",void 0);b([R()],g.prototype,"_actionMatches",void 0);b([R()],g.prototype,"_search",void 0);b([R()],g.prototype,"_currentRoot",void 0);b([R()],g.prototype,"_flatData",void 0);b([R()],g.prototype,"breadcrumbs",null);b([R()],g.prototype,"_selected",void 0);g=b([D("ninja-keys")],g);fetch(import.meta.resolve("./search.index.json")).then(async i=>{let e=await i.json();document.querySelector("ninja-keys").data=Object.entries(e).map(([t,{out:r,fm:n}])=>({id:t,title:"title"in n?n.title:t,handler:()=>{location.assign(r)}}))});
|
|
429
|
+
/*! Bundled license information:
|
|
430
|
+
|
|
431
|
+
@lit/reactive-element/css-tag.js:
|
|
432
|
+
(**
|
|
433
|
+
* @license
|
|
434
|
+
* Copyright 2019 Google LLC
|
|
435
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
436
|
+
*)
|
|
437
|
+
|
|
438
|
+
@lit/reactive-element/reactive-element.js:
|
|
439
|
+
lit-html/lit-html.js:
|
|
440
|
+
lit-element/lit-element.js:
|
|
441
|
+
@lit/reactive-element/decorators/custom-element.js:
|
|
442
|
+
@lit/reactive-element/decorators/property.js:
|
|
443
|
+
@lit/reactive-element/decorators/state.js:
|
|
444
|
+
@lit/reactive-element/decorators/base.js:
|
|
445
|
+
@lit/reactive-element/decorators/event-options.js:
|
|
446
|
+
@lit/reactive-element/decorators/query.js:
|
|
447
|
+
@lit/reactive-element/decorators/query-all.js:
|
|
448
|
+
@lit/reactive-element/decorators/query-async.js:
|
|
449
|
+
@lit/reactive-element/decorators/query-assigned-nodes.js:
|
|
450
|
+
lit-html/directive.js:
|
|
451
|
+
lit-html/directives/repeat.js:
|
|
452
|
+
lit-html/async-directive.js:
|
|
453
|
+
lit-html/directives/unsafe-html.js:
|
|
454
|
+
(**
|
|
455
|
+
* @license
|
|
456
|
+
* Copyright 2017 Google LLC
|
|
457
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
458
|
+
*)
|
|
459
|
+
|
|
460
|
+
@lit/reactive-element/decorators/query-assigned-elements.js:
|
|
461
|
+
lit-html/directives/join.js:
|
|
462
|
+
(**
|
|
463
|
+
* @license
|
|
464
|
+
* Copyright 2021 Google LLC
|
|
465
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
466
|
+
*)
|
|
467
|
+
|
|
468
|
+
lit-html/directive-helpers.js:
|
|
469
|
+
lit-html/directives/live.js:
|
|
470
|
+
lit-html/directives/ref.js:
|
|
471
|
+
(**
|
|
472
|
+
* @license
|
|
473
|
+
* Copyright 2020 Google LLC
|
|
474
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
475
|
+
*)
|
|
476
|
+
|
|
477
|
+
lit-html/directives/class-map.js:
|
|
478
|
+
(**
|
|
479
|
+
* @license
|
|
480
|
+
* Copyright 2018 Google LLC
|
|
481
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
482
|
+
*)
|
|
483
|
+
|
|
484
|
+
hotkeys-js/dist/hotkeys.esm.js:
|
|
485
|
+
(*!
|
|
486
|
+
* hotkeys-js v3.8.7
|
|
487
|
+
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
|
|
488
|
+
*
|
|
489
|
+
* Copyright (c) 2021 kenny wong <wowohoo@qq.com>
|
|
490
|
+
* http://jaywcjlove.github.io/hotkeys
|
|
491
|
+
*
|
|
492
|
+
* Licensed under the MIT license.
|
|
493
|
+
*)
|
|
494
|
+
|
|
495
|
+
@material/mwc-icon/mwc-icon-host.css.js:
|
|
496
|
+
(**
|
|
497
|
+
* @license
|
|
498
|
+
* Copyright 2021 Google LLC
|
|
499
|
+
* SPDX-LIcense-Identifier: Apache-2.0
|
|
500
|
+
*)
|
|
501
|
+
|
|
502
|
+
@material/mwc-icon/mwc-icon.js:
|
|
503
|
+
(**
|
|
504
|
+
* @license
|
|
505
|
+
* Copyright 2018 Google LLC
|
|
506
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
507
|
+
*)
|
|
508
|
+
*/
|
data/lib/inkblot/cli.rb
CHANGED
|
@@ -10,6 +10,7 @@ require "rouge"
|
|
|
10
10
|
|
|
11
11
|
require_relative "pages"
|
|
12
12
|
require_relative "markdown_page"
|
|
13
|
+
require_relative "search"
|
|
13
14
|
|
|
14
15
|
module Inkblot
|
|
15
16
|
class << self
|
|
@@ -64,6 +65,10 @@ module Inkblot
|
|
|
64
65
|
s.page "inkblot.min.css", proc {
|
|
65
66
|
File.read(File.join(File.expand_path(File.dirname(File.dirname(__FILE__))), "inkblot.min.css"))
|
|
66
67
|
}
|
|
68
|
+
|
|
69
|
+
s.mount File.join(File.expand_path(File.dirname(File.dirname(__FILE__))), "assets"), on: "/_inkblot"
|
|
70
|
+
|
|
71
|
+
Search.build_index s
|
|
67
72
|
end
|
|
68
73
|
end
|
|
69
74
|
end
|
data/lib/inkblot/layout.rb
CHANGED
|
@@ -4,6 +4,8 @@ require "phlex"
|
|
|
4
4
|
|
|
5
5
|
module Inkblot
|
|
6
6
|
class Layout < ::Phlex::HTML
|
|
7
|
+
register_element :ninja_keys
|
|
8
|
+
|
|
7
9
|
def initialize(title, id)
|
|
8
10
|
@title = title
|
|
9
11
|
@id = id
|
|
@@ -32,9 +34,13 @@ module Inkblot
|
|
|
32
34
|
link rel: "stylesheet", href: "/syntax.css"
|
|
33
35
|
end
|
|
34
36
|
body(class: "flex flex-row w-screen h-screen p-0 m-0 dark:bg-[#1f2021] dark:text-gray-50") do
|
|
35
|
-
aside(class: "p-5 min-w-[15%] border-r border-gray-200 bg-gray-100 dark:bg-[#131314] dark:border-
|
|
37
|
+
aside(class: "p-5 min-w-[15%] border-r border-gray-200 bg-gray-100 dark:bg-[#131314] dark:border-neutral-700 fixed top-0 left-0 h-screen overflow-auto") do
|
|
36
38
|
nav(style: "display: flex; flex-direction: column; justify-content: space-between; height: 100%;") do
|
|
37
39
|
ul do
|
|
40
|
+
li(class: "py-2 px-3 mb-4 rounded-md bg-white dark:bg-[#1f2021] text-neutral-800 dark:text-neutral-200 cursor-pointer border border-gray-200 dark:border-neutral-700", onclick: safe("document.querySelector('ninja-keys').open()")) {
|
|
41
|
+
kbd(class: "font-mono text-neutral-700 dark:text-neutral-300") { raw safe "⌘K" }
|
|
42
|
+
plain " Search"
|
|
43
|
+
}
|
|
38
44
|
pages.each do |section|
|
|
39
45
|
li(class: "font-bold text-gray-500 dark:text-gray-400 py-2 text-sm") { section.keys[0] }
|
|
40
46
|
section.values[0].each do |page|
|
|
@@ -54,6 +60,9 @@ module Inkblot
|
|
|
54
60
|
end
|
|
55
61
|
end
|
|
56
62
|
div(class: "w-full my-10", &block)
|
|
63
|
+
|
|
64
|
+
ninja_keys()
|
|
65
|
+
script(type: "module", src: "/_inkblot/main.js", defer: true)
|
|
57
66
|
end
|
|
58
67
|
end
|
|
59
68
|
end
|
data/lib/inkblot/version.rb
CHANGED