Skip to content

Commit

Permalink
Merge branch 'alshedivat:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
kastnerp authored Sep 23, 2024
2 parents 3c3a105 + fdaed74 commit fa3f615
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/js/search/ninja-action.min.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
var __decorate=this&&this.__decorate||function(t,e,i,n){var o,a=arguments.length,s=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(s=(a<3?o(s):a>3?o(e,i,s):o(e,i))||s);return a>3&&s&&Object.defineProperty(e,i,s),s};import{LitElement,html,css}from"./lit/index.min.js";import{customElement,property}from"./lit/decorators.min.js";import{classMap}from"./lit/directives/class-map.min.js";import{unsafeHTML}from"./lit/directives/unsafe-html.min.js";import{join}from"./lit/directives/join.min.js";let NinjaAction=class extends LitElement{constructor(){super(),this.selected=!1,this.hotKeysJoinedView=!0,this.addEventListener("click",this.click)}ensureInView(){this.scrollIntoView({block:"nearest"})}click(){this.dispatchEvent(new CustomEvent("actionsSelected",{detail:this.action,bubbles:!0,composed:!0}))}updated(t){t.has("selected")&&this.selected&&this.ensureInView()}highlightMatch(t,e){let i="",n=0;for(let o=0;o<t.length;o++)e[n]===o?(i+=`<span class="highlight">${t[o]}</span>`,n++):i+=t[o];return unsafeHTML(i)}render(){let t,e;this.action.mdIcon?t=html`<div>${this.action.mdIcon}</div>`:this.action.icon&&(t=this.action.icon?unsafeHTML(`<div class="ninja-icon">${this.action.icon}</div>`):""),this.action.hotkey&&(e=this.hotKeysJoinedView?this.action.hotkey.split(",").map((t=>{const e=t.split("+"),i=html`${join(e.map((t=>html`<kbd>${t}</kbd>`)),"+")}`;return html`<div class="ninja-hotkey ninja-hotkeys">${i}</div>`})):this.action.hotkey.split(",").map((t=>{const e=t.split("+").map((t=>html`<kbd class="ninja-hotkey">${t}</kbd>`));return html`<kbd class="ninja-hotkeys">${e}</kbd>`})));const i={selected:this.selected,"ninja-action":!0};return html`
var __decorate=this&&this.__decorate||function(t,e,i,n){var o,a=arguments.length,s=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(s=(a<3?o(s):a>3?o(e,i,s):o(e,i))||s);return a>3&&s&&Object.defineProperty(e,i,s),s};import{LitElement,html,css}from"./lit/index.min.js";import{customElement,property}from"./lit/decorators.min.js";import{classMap}from"./lit/directives/class-map.min.js";import{unsafeHTML}from"./lit/directives/unsafe-html.min.js";import{join}from"./lit/directives/join.min.js";let NinjaAction=class extends LitElement{constructor(){super(),this.selected=!1,this.hotKeysJoinedView=!0,this.addEventListener("click",this.click)}ensureInView(){this.scrollIntoView({block:"nearest"})}click(){this.dispatchEvent(new CustomEvent("actionsSelected",{detail:this.action,bubbles:!0,composed:!0}))}updated(t){t.has("selected")&&this.selected&&this.ensureInView()}highlightMatch(t,e){const tt=new DOMParser().parseFromString(t,'text/html').body.textContent||"";let i="",n=0,o=0;for(o=0;o<tt.length;o++)e[n]===o?(i+=`<span class="highlight">${t[o]}</span>`,n++):i+=t[o];if(o<t.length){i+=t.slice(o);}return unsafeHTML(i)}render(){let t,e;this.action.mdIcon?t=html`<div>${this.action.mdIcon}</div>`:this.action.icon&&(t=this.action.icon?unsafeHTML(`<div class="ninja-icon">${this.action.icon}</div>`):""),this.action.hotkey&&(e=this.hotKeysJoinedView?this.action.hotkey.split(",").map((t=>{const e=t.split("+"),i=html`${join(e.map((t=>html`<kbd>${t}</kbd>`)),"+")}`;return html`<div class="ninja-hotkey ninja-hotkeys">${i}</div>`})):this.action.hotkey.split(",").map((t=>{const e=t.split("+").map((t=>html`<kbd class="ninja-hotkey">${t}</kbd>`));return html`<kbd class="ninja-hotkeys">${e}</kbd>`})));const i={selected:this.selected,"ninja-action":!0};return html`
<div class="ninja-action" part="ninja-action ${this.selected?"ninja-selected":""}" class=${classMap(i)}>
${t}
${this.action.type?html`<div class="ninja-action-type" style="background: ${n=this.action.type,"debug"===n?"#034900":"general"===n?"#193C79":"segments"===n?"#2F0A7D":"#000000"}">
Expand Down
2 changes: 1 addition & 1 deletion assets/js/search/ninja-keys.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fa3f615

Please sign in to comment.