Added support for search (#2415)

Added support for search within the template as suggested in #581. I
decided to go with a client side search based on [Ninja
keys](https://github.com/ssleptsov/ninja-keys), but using [deepdub's
fork](https://github.com/deepdub-ai/ninja-keys) as basis since it
supports fuzzy search.

Had to do a bunch of changes to their code to make it work without using
node to install everything. Also changed to use some colors defined in
our side and using both pages' titles and descriptions for search. Also
had to increase the template max width to better accomodate the new item
in navigation bar.

Missing implementations:
- [ ] One thing I'd love to do (but currently have no idea how) would be
to change the text next to the search button depending on the platform.
For example, if the user is accessing the site on a mac they should use
⌘k instead of ctrl k.
- [x] Test how this looks like (and how it is supposed to work) on
devices with smaller screens
- [x] Support for offline mode

Some screenshots:

---

## Dark version

![Screenshot from 2024-05-13
16-30-12](https://github.com/alshedivat/al-folio/assets/31376482/535acec5-dd7a-48cb-a17f-a295da98b5d3)

![Screenshot from 2024-05-13
16-30-26](https://github.com/alshedivat/al-folio/assets/31376482/6b2d94bb-3981-4252-ae2b-53994b514491)

![Screenshot from 2024-05-13
16-30-36](https://github.com/alshedivat/al-folio/assets/31376482/66262b56-2744-475d-b09f-2cb65210017b)

---

## Light version

![Screenshot from 2024-05-13
16-30-44](https://github.com/alshedivat/al-folio/assets/31376482/a0eec50c-e7ac-4b52-aee8-2050bff05d54)

![Screenshot from 2024-05-13
16-30-50](https://github.com/alshedivat/al-folio/assets/31376482/41d72066-3e68-4ec3-bf3d-140da621f67b)

![Screenshot from 2024-05-13
16-30-55](https://github.com/alshedivat/al-folio/assets/31376482/613fd56e-7180-4373-ab7a-dfed184b5a18)

---------

Signed-off-by: George Araujo <george.gcac@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
George 2024-05-23 23:21:16 -03:00 committed by GitHub
parent eef62a37df
commit 92cebc9bb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
43 changed files with 1603 additions and 3 deletions

View File

@ -2,7 +2,9 @@
**/*.min.css **/*.min.css
**/*.min.js **/*.min.js
assets/css/main.scss assets/css/main.scss
assets/js/search-data.js
assets/js/distillpub/template.v2.js assets/js/distillpub/template.v2.js
assets/js/search/*.js
assets/plotly/demo.html assets/plotly/demo.html
lighthouse_results/** lighthouse_results/**
_posts/2015-10-20-math.md _posts/2015-10-20-math.md

View File

@ -48,9 +48,11 @@ rss_icon: true
navbar_fixed: true navbar_fixed: true
footer_fixed: true footer_fixed: true
search_enabled: true
socials_in_search: true
# Dimensions # Dimensions
max_width: 800px max_width: 930px
# TODO: add layout settings (single page vs. multi-page) # TODO: add layout settings (single page vs. multi-page)
@ -266,7 +268,7 @@ sass:
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
jekyll-minifier: jekyll-minifier:
exclude: ["robots.txt"] exclude: ["robots.txt", "assets/js/search/*.js"]
uglifier_args: uglifier_args:
harmony: true harmony: true

View File

@ -107,6 +107,14 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if site.search_enabled %}
<!-- Search -->
<li class="nav-item">
<button id="search-toggle" title="Search" onclick="openSearchModal()">
<span class="nav-link">ctrl k <i class="ti ti-search"></i></span>
</button>
</li>
{% endif %}
{% if site.enable_darkmode %} {% if site.enable_darkmode %}
<!-- Toogle theme mode --> <!-- Toogle theme mode -->
<li class="toggle-container"> <li class="toggle-container">

View File

@ -0,0 +1,24 @@
{% if site.search_enabled %}
<script type="module" src="{{ '/assets/js/search/ninja-keys.min.js' | relative_url | bust_file_cache }}"></script>
<ninja-keys hideBreadcrumbs noAutoLoadMdIcons placeholder="Type to start searching"></ninja-keys>
<script src="{{ '/assets/js/search-data.js' | relative_url | bust_file_cache }}"></script>
<script>
let theme = determineComputedTheme();
const ninjaKeys = document.querySelector('ninja-keys');
if (theme === 'dark') {
ninjaKeys.classList.add('dark');
} else {
ninjaKeys.classList.remove('dark');
}
const openSearchModal = () => {
// collapse navbarNav if expanded on mobile
const navbarNav = document.querySelector('.navbar-collapse');
if (navbarNav.classList.contains('show')) {
navbarNav.classList.remove('show');
}
ninjaKeys.open();
};
</script>
{% endif %}

View File

@ -72,5 +72,6 @@
{% include scripts/imageLayouts.liquid %} {% include scripts/imageLayouts.liquid %}
{% include scripts/jekyll_tabs.liquid %} {% include scripts/jekyll_tabs.liquid %}
{% include scripts/back_to_top.liquid %} {% include scripts/back_to_top.liquid %}
{% include scripts/search.liquid %}
</body> </body>
</html> </html>

View File

@ -355,7 +355,8 @@ ul.task-list input[type="checkbox"] {
} }
} }
#light-toggle { #light-toggle,
#search-toggle {
padding: 0; padding: 0;
border: 0; border: 0;
background-color: inherit; background-color: inherit;
@ -1109,3 +1110,16 @@ swiper-container {
border-bottom: 2px solid var(--global-text-color); border-bottom: 2px solid var(--global-text-color);
} }
} }
// Ninja Keys
// for more options, check https://github.com/ssleptsov/ninja-keys?tab=readme-ov-file#css-variables
ninja-keys {
--ninja-accent-color: var(--global-theme-color);
--ninja-icon-size: 0px;
--ninja-modal-background: var(--global-bg-color);
--ninja-z-index: 1031;
}
ninja-keys::part(ninja-input-wrapper) {
background: var(--global-bg-color);
}

535
assets/js/search-data.js Normal file
View File

@ -0,0 +1,535 @@
---
---
// don't remove the above lines
// they are required to make the code work
// get the ninja-keys element
const ninja = document.querySelector('ninja-keys');
// add the home and posts menu items
ninja.data = [
{%- for page in site.pages -%}
{%- if page.permalink == '/' -%}{%- assign about_title = page.title -%}{%- endif -%}
{%- endfor -%}
{
id: "nav-{{ about_title | slugify }}",
title: "{{ about_title }}",
section: "Navigation",
handler: () => {
window.location.href = "{{ '/' | relative_url }}";
},
},
{%- assign sorted_pages = site.pages | sort: "nav_order" -%}
{%- for p in sorted_pages -%}
{%- if p.nav and p.autogen == null -%}
{%- if p.dropdown -%}
{%- for child in p.children -%}
{%- unless child.title == 'divider' -%}
{
{%- assign title = child.title | escape -%}
{%- if child.permalink contains "/blog/" -%}{%- assign url = "/blog/" -%} {%- else -%}{%- assign url = child.url -%}{%- endif -%}
id: "dropdown-{{ title | slugify }}",
title: "{{ title }}",
description: "{{ child.description | strip_html | strip_newlines | escape }}",
section: "Dropdown",
handler: () => {
window.location.href = "{{ url | relative_url }}";
},
},
{%- endunless -%}
{%- endfor -%}
{%- else -%}
{
{%- assign title = p.title | escape -%}
{%- if p.permalink contains "/blog/" -%}{%- assign url = "/blog/" -%} {%- else -%}{%- assign url = p.url -%}{%- endif -%}
id: "nav-{{ title | slugify }}",
title: "{{ title }}",
description: "{{ p.description | strip_html | strip_newlines | escape }}",
section: "Navigation",
handler: () => {
window.location.href = "{{ url | relative_url }}";
},
},
{%- endif -%}
{%- endif -%}
{%- endfor -%}
{%- for post in site.posts -%}
{
{%- assign title = post.title | escape -%}
id: "post-{{ title | slugify }}",
title: "{{ title }}",
description: "{{ post.description | strip_html | strip_newlines | escape }}",
section: "Posts",
handler: () => {
window.location.href = "{{ post.url | relative_url }}";
},
},
{%- endfor -%}
{%- for project in site.projects -%}
{
{%- assign title = project.title | escape -%}
id: "project-{{ title | slugify }}",
title: "{{ title }}",
description: "{{ project.description | strip_html | strip_newlines | escape }}",
section: "Projects",
handler: () => {
window.location.href = "{{ project.url | relative_url }}";
},
},
{%- endfor -%}
{%- if site.socials_in_search -%}
{%- if site.email -%}
{
id: 'socials-email',
title: 'Send email',
section: 'Socials',
handler: () => {
window.open("mailto:{{ site.email | encode_email }}", "_blank");
},
},
{%- endif -%}
{%- if site.telegram_username -%}
{
id: 'socials-telegram',
title: 'Telegram',
section: 'Socials',
handler: () => {
window.open("https://telegram.me/{{ site.telegram_username }}", "_blank");
},
},
{%- endif -%}
{%- if site.whatsapp_number -%}
{
id: 'socials-whatsapp',
title: 'WhatsApp',
section: 'Socials',
handler: () => {
window.open("https://wa.me/{{ site.whatsapp_number }}", "_blank");
},
},
{%- endif -%}
{%- if site.orcid_id -%}
{
id: 'socials-orcid',
title: 'ORCID',
section: 'Socials',
handler: () => {
window.open("https://orcid.org/{{ site.orcid_id }}", "_blank");
},
},
{%- endif -%}
{%- if site.scholar_userid -%}
{
id: 'socials-google-scholar',
title: 'Google Scholar',
section: 'Socials',
handler: () => {
window.open("https://scholar.google.com/citations?user={{ site.scholar_userid }}", "_blank");
},
},
{%- endif -%}
{%- if site.semanticscholar_id -%}
{
id: 'socials-semantic-scholar',
title: 'Semantic Scholar',
section: 'Socials',
handler: () => {
window.open("https://www.semanticscholar.org/author/{{ site.semanticscholar_id }}", "_blank");
},
},
{%- endif -%}
{%- if site.publons_id -%}
{
id: 'socials-publons',
title: 'Publons',
section: 'Socials',
handler: () => {
window.open("https://publons.com/a/{{ site.publons_id }}/", "_blank");
},
},
{%- endif -%}
{%- if site.lattes_id -%}
{
id: 'socials-lattes',
title: 'Lattes',
section: 'Socials',
handler: () => {
window.open("http://lattes.cnpq.br/{{ site.lattes_id }}", "_blank");
},
},
{%- endif -%}
{%- if site.osf_id -%}
id: 'socials-open-science-framework',
title: 'Open Science Framework',
section: 'Socials',
handler: () => {
window.open("https://osf.io/{{ site.osf_id }}/", "_blank");
},
},
{%- endif -%}
{%- if site.research_gate_profile -%}
{
id: 'socials-researchgate',
title: 'ResearchGate',
section: 'Socials',
handler: () => {
window.open("https://www.researchgate.net/profile/{{site.research_gate_profile}}/", "_blank");
},
},
{%- endif -%}
{%- if site.ieee_id -%}
{
id: 'socials-ieee-xplore',
title: 'IEEE Xplore',
section: 'Socials',
handler: () => {
window.open("https://ieeexplore.ieee.org/author/{{site.ieee_id}}/", "_blank");
},
},
{%- endif -%}
{%- if site.acm_id -%}
{
id: 'socials-acm-dl',
title: 'ACM DL',
section: 'Socials',
handler: () => {
window.open("https://dl.acm.org/profile/{{site.acm_id}}/", "_blank");
},
},
{%- endif -%}
{%- if site.scopus_id -%}
{
id: 'socials-scopus',
title: 'Scopus',
section: 'Socials',
handler: () => {
window.open("https://www.scopus.com/authid/detail.uri?authorId={{site.scopus_id}}", "_blank");
},
},
{%- endif -%}
{%- if site.github_username -%}
{
id: 'socials-github',
title: 'GitHub',
section: 'Socials',
handler: () => {
window.open("https://github.com/{{ site.github_username }}", "_blank");
},
},
{%- endif -%}
{%- if site.linkedin_username -%}
{
id: 'socials-linkedin',
title: 'LinkedIn',
section: 'Socials',
handler: () => {
window.open("https://www.linkedin.com/in/{{ site.linkedin_username }}", "_blank");
},
},
{%- endif -%}
{%- if site.x_username -%}
{
id: 'socials-x',
title: 'X',
description: 'Twitter',
section: 'Socials',
handler: () => {
window.open("https://twitter.com/{{ site.x_username }}", "_blank");
},
},
{%- endif -%}
{%- if site.mastodon_username -%}
{
id: 'socials-mastodon',
title: 'Mastodon',
section: 'Socials',
handler: () => {
window.open("https://{{ site.mastodon_username }}", "_blank");
},
},
{%- endif -%}
{%- if site.medium_username -%}
{
id: 'socials-medium',
title: 'Medium',
section: 'Socials',
handler: () => {
window.open("https://medium.com/@{{ site.medium_username }}", "_blank");
},
},
{%- endif -%}
{%- if site.quora_username -%}
{
id: 'socials-quora',
title: 'Quora',
section: 'Socials',
handler: () => {
window.open("https://www.quora.com/profile/{{ site.quora_username }}", "_blank");
},
},
{%- endif -%}
{%- if site.flickr_id -%}
{
id: 'socials-flickr',
title: 'Flickr',
section: 'Socials',
handler: () => {
window.open("https://www.flickr.com/{{ site.flickr_id }}", "_blank");
},
},
{%- endif -%}
{%- if site.blogger_url -%}
{
id: 'socials-blogger',
title: 'Blogger',
section: 'Socials',
handler: () => {
window.open("{{ site.blogger_url }}", "_blank");
},
},
{%- endif -%}
{%- if site.work_url -%}
{
id: 'socials-work',
title: 'Work',
section: 'Socials',
handler: () => {
window.open("{{ site.work_url }}", "_blank");
},
},
{%- endif -%}
{%- if site.wikidata_id -%}
{
id: 'socials-wikidata',
title: 'Wikidata',
section: 'Socials',
handler: () => {
window.open("https://www.wikidata.org/wiki/{{ site.wikidata_id }}", "_blank");
},
},
{%- endif -%}
{%- if site.wikipedia_id -%}
{
id: 'socials-wikipedia',
title: 'Wikipedia',
section: 'Socials',
handler: () => {
window.open("https://wikipedia.org/wiki/User:{{ site.wikipedia_id }}", "_blank");
},
},
{%- endif -%}
{%- if site.strava_userid -%}
{
id: 'socials-strava',
title: 'Strava',
section: 'Socials',
handler: () => {
window.open("https://www.strava.com/athletes/{{ site.strava_userid }}", "_blank");
},
},
{%- endif -%}
{%- if site.keybase_username -%}
{
id: 'socials-keybase',
title: 'Keybase',
section: 'Socials',
handler: () => {
window.open("https://keybase.io/{{ site.keybase_username }}", "_blank");
},
},
{%- endif -%}
{%- if site.gitlab_username -%}
{
id: 'socials-gitlab',
title: 'GitLab',
section: 'Socials',
handler: () => {
window.open("https://gitlab.com/{{ site.gitlab_username }}", "_blank");
},
},
{%- endif -%}
{%- if site.dblp_url -%}
{
id: 'socials-dblp',
title: 'DBLP',
section: 'Socials',
handler: () => {
window.open("{{ site.dblp_url }}", "_blank");
},
},
{%- endif -%}
{%- if site.stackoverflow_id -%}
{
id: 'socials-stackoverflow',
title: 'Stackoverflow',
section: 'Socials',
handler: () => {
window.open("https://stackoverflow.com/users/{{ site.stackoverflow_id }}", "_blank");
},
},
{%- endif -%}
{%- if site.kaggle_id -%}
{
id: 'socials-kaggle',
title: 'Kaggle',
section: 'Socials',
handler: () => {
window.open("https://www.kaggle.com/{{ site.kaggle_id }}", "_blank");
},
},
{%- endif -%}
{%- if site.lastfm_id -%}
{
id: 'socials-last-fm',
title: 'Last FM',
section: 'Socials',
handler: () => {
window.open("https://www.last.fm/user/{{ site.lastfm_id }}", "_blank");
},
},
{%- endif -%}
{%- if site.spotify_id -%}
{
id: 'socials-spotify',
title: 'Spotify',
section: 'Socials',
handler: () => {
window.open("https://open.spotify.com/user/{{ site.spotify_id }}", "_blank");
},
},
{%- endif -%}
{%- if site.pinterest_id -%}
{
id: 'socials-pinterest',
title: 'Pinterest',
section: 'Socials',
handler: () => {
window.open("https://www.pinterest.com/{{ site.pinterest_id }}", "_blank");
},
},
{%- endif -%}
{%- if site.unsplash_id -%}
{
id: 'socials-unsplash',
title: 'Unsplash',
section: 'Socials',
handler: () => {
window.open("https://unsplash.com/@{{ site.unsplash_id }}", "_blank");
},
},
{%- endif -%}
{%- if site.instagram_id -%}
{
id: 'socials-instagram',
title: 'Instagram',
section: 'Socials',
handler: () => {
window.open("https://instagram.com/{{ site.instagram_id }}", "_blank");
},
},
{%- endif -%}
{%- if site.facebook_id -%}
{
id: 'socials-facebook',
title: 'Facebook',
section: 'Socials',
handler: () => {
window.open("https://facebook.com/{{ site.facebook_id }}", "_blank");
},
},
{%- endif -%}
{%- if site.bluesky_url -%}
{
id: 'socials-bluesky',
title: 'Bluesky',
section: 'Socials',
handler: () => {
window.open("https://bsky.app/profile/{{ site.bluesky_url }}", "_blank");
},
},
{%- endif -%}
{%- if site.youtube_id -%}
{
id: 'socials-youtube',
title: 'YouTube',
section: 'Socials',
handler: () => {
window.open("https://youtube.com/@{{ site.youtube_id }}", "_blank");
},
},
{%- endif -%}
{%- if site.discord_id -%}
{
id: 'socials-discord',
title: 'Discord',
section: 'Socials',
handler: () => {
window.open("https://discord.com/users/{{ site.discord_id }}", "_blank");
},
},
{%- endif -%}
{%- if site.zotero_username -%}
{
id: 'socials-zotero',
title: 'Zotero',
section: 'Socials',
handler: () => {
window.open("https://www.zotero.org/{{ site.zotero_username }}", "_blank");
},
},
{%- endif -%}
{%- if site.rss_icon -%}
{
id: 'socials-rss',
title: 'RSS Feed',
section: 'Socials',
handler: () => {
window.open("{{ site.baseurl }}/feed.xml", "_blank");
},
},
{%- endif -%}
{%- comment -%}
{%- if site.wechat_qr -%}
// check how to add wechat qr code
{
id: 'socials-wechat',
title: 'WeChat',
section: 'Socials',
handler: () => {
window.open("", "_blank");
},
},
{%- endif -%}
{%- endcomment -%}
{%- endif -%}
{%- if site.enable_darkmode -%}
{
id: 'light-theme',
title: 'Change theme to light',
description: 'Change the theme of the site to Light',
section: 'Theme',
handler: () => {
setThemeSetting("light");
},
},
{
id: 'dark-theme',
title: 'Change theme to dark',
description: 'Change the theme of the site to Dark',
section: 'Theme',
handler: () => {
setThemeSetting("dark");
},
},
{
id: 'system-theme',
title: 'Use system default theme',
description: 'Change the theme of the site to System Default',
section: 'Theme',
handler: () => {
setThemeSetting("system");
},
},
{%- endif -%}
];

286
assets/js/search/base-styles.min.js vendored Normal file
View File

@ -0,0 +1,286 @@
/**
* Minified by jsDelivr using Terser v5.19.2.
* Original file: /npm/@deepdub/ninja-keys@1.2.11/dist/base-styles.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
import{css}from"./lit/index.min.js";export const baseStyles=css`
:host {
--ninja-width: 640px;
--ninja-backdrop-filter: none;
--ninja-overflow-background: rgba(255, 255, 255, 0.5);
--ninja-text-color: rgb(60, 65, 73);
--ninja-font-size: 16px;
--ninja-top: 20%;
--ninja-key-border-radius: 0.25em;
--ninja-accent-color: rgb(110, 94, 210);
--ninja-secondary-background-color: rgb(239, 241, 244);
--ninja-secondary-text-color: rgb(107, 111, 118);
--ninja-selected-background: rgb(248, 249, 251);
--ninja-icon-color: var(--ninja-secondary-text-color);
--ninja-icon-size: 1.2em;
--ninja-separate-border: 1px solid var(--ninja-secondary-background-color);
--ninja-modal-background: #fff;
--ninja-modal-shadow: rgb(0 0 0 / 50%) 0px 16px 70px;
--ninja-actions-height: 300px;
--ninja-group-text-color: rgb(144, 149, 157);
--ninja-footer-background: rgba(242, 242, 242, 0.4);
--ninja-placeholder-color: #8e8e8e;
font-size: var(--ninja-font-size);
--ninja-z-index: 1;
}
:host(.dark) {
--ninja-backdrop-filter: none;
--ninja-overflow-background: rgba(0, 0, 0, 0.7);
--ninja-text-color: #7d7d7d;
--ninja-modal-background: rgba(17, 17, 17, 0.85);
--ninja-accent-color: rgb(110, 94, 210);
--ninja-secondary-background-color: rgba(51, 51, 51, 0.44);
--ninja-secondary-text-color: #888;
--ninja-selected-text-color: #eaeaea;
--ninja-selected-background: rgba(51, 51, 51, 0.44);
--ninja-icon-color: var(--ninja-secondary-text-color);
--ninja-separate-border: 1px solid var(--ninja-secondary-background-color);
--ninja-modal-shadow: 0 16px 70px rgba(0, 0, 0, 0.2);
--ninja-group-text-color: rgb(144, 149, 157);
--ninja-footer-background: rgba(30, 30, 30, 85%);
}
.modal {
display: none;
position: fixed;
z-index: var(--ninja-z-index);
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background: var(--ninja-overflow-background);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-backdrop-filter: var(--ninja-backdrop-filter);
backdrop-filter: var(--ninja-backdrop-filter);
text-align: left;
color: var(--ninja-text-color);
font-family: var(--ninja-font-family);
}
.modal.visible {
display: block;
}
.modal.isLoadingItems .loading-indicator {
opacity: 1;
}
.modal-content {
position: relative;
top: var(--ninja-top);
margin: auto;
padding: 0;
display: flex;
flex-direction: column;
flex-shrink: 1;
-webkit-box-flex: 1;
flex-grow: 1;
min-width: 0px;
will-change: transform;
background: var(--global-bg-color);
backdrop-filter: blur(20px);
border-radius: 0.5em;
box-shadow: var(--ninja-modal-shadow);
max-width: var(--ninja-width);
overflow: hidden;
}
.modal-body {
background: var(--global-bg-color);
}
.loading-indicator {
position: absolute;
width: 100%;
overflow: hidden;
opacity: 0;
height: 3px;
z-index: 1;
bottom: 34px;
}
.loading-indicator::before {
content: '';
position: absolute;
inset: 0;
background-color: var(--ninja-accent-color);
opacity: 0.3;
}
@keyframes animation-bar1 {
0% {
left: -35%;
right: 100%;
}
60% {
left: 100%;
right: -90%;
}
100% {
left: 100%;
right: -90%;
}
}
.loading-indicator .bar1 {
width: 100%;
position: absolute;
left: 0;
bottom: 0;
top: 0;
-webkit-transition: -webkit-transform 0.2s linear;
transition: transform 0.2s linear;
transform-origin: left;
background-color: var(--ninja-accent-color);
width: auto;
-webkit-animation: animation-bar1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
animation: animation-bar1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite;
}
@keyframes animation-bar2 {
0% {
left: -200%;
right: 100%;
}
60% {
left: 107%;
right: -8%;
}
100% {
left: 107%;
right: -8%;
}
}
.loading-indicator .bar2 {
width: 100%;
position: absolute;
left: 0;
bottom: 0;
top: 0;
-webkit-transition: -webkit-transform 0.2s linear;
transition: transform 0.2s linear;
transform-origin: left;
background-color: var(--ninja-accent-color);
width: auto;
-webkit-animation: animation-bar2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
animation: animation-bar2 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite;
}
.bump {
animation: zoom-in-zoom-out 0.2s ease;
}
@keyframes zoom-in-zoom-out {
0% {
transform: scale(0.99);
}
50% {
transform: scale(1.01, 1.01);
}
100% {
transform: scale(1, 1);
}
}
.title {
font-size: 0.75rem;
padding: 0.25rem 0.25rem;
text-align: right;
position: absolute;
right: 0px;
width: 100%;
}
.title.separator {
border-top: 1px solid rgb(51, 51, 51);
}
.ninja-github {
color: var(--ninja-keys-text-color);
font-weight: normal;
text-decoration: none;
}
.actions-list {
max-height: var(--ninja-actions-height);
overflow: auto;
position: relative;
margin: 0;
padding: 0.5em 0;
list-style: none;
scroll-behavior: auto;
}
.group-header {
height: 1.375em;
line-height: 1.375em;
padding-left: 1.25em;
padding-top: 0.5em;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
font-size: 0.75em;
line-height: 1em;
color: var(--ninja-group-text-color);
margin: 1px 0;
}
.modal-footer {
padding: 0.5em 1em;
display: flex;
/* font-size: 0.75em; */
border-top: var(--ninja-separate-border);
color: var(--ninja-secondary-text-color);
}
.modal-footer .help {
display: flex;
margin-right: 1em;
align-items: center;
font-size: 0.75em;
}
.ninja-examplekey {
background: var(--ninja-secondary-background-color);
padding: 0.06em 0.25em;
border-radius: var(--ninja-key-border-radius);
color: var(--ninja-secondary-text-color);
width: 1em;
height: 1em;
margin-right: 0.5em;
font-size: 1.25em;
fill: currentColor;
}
.ninja-examplekey.esc {
width: auto;
height: auto;
font-size: 1.1em;
}
.ninja-examplekey.backspace {
opacity: 0.7;
}
`;

7
assets/js/search/command-score.min.js vendored Normal file
View File

@ -0,0 +1,7 @@
/**
* Minified by jsDelivr using Terser v5.19.2.
* Original file: /npm/@deepdub/ninja-keys@1.2.11/dist/command-score.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
const SCORE_CONTINUE_MATCH=1,SCORE_SPACE_WORD_JUMP=.9,SCORE_NON_SPACE_WORD_JUMP=.8,SCORE_CHARACTER_JUMP=.3,PENALTY_SKIPPED=.999,PENALTY_CASE_MISMATCH=.9999,PENALTY_NOT_COMPLETE=.99,IS_GAP_REGEXP=/[\\/_+.#"@[({&]/,COUNT_GAPS_REGEXP=/[\\/_+.#"@[({&]/g,IS_SPACE_REGEXP=/[\s-]/,COUNT_SPACE_REGEXP=/[\s-]/g;function commandScoreInner(E,_,P,C,e,n,t){if(n===_.length)return e===E.length?{score:SCORE_CONTINUE_MATCH,indices:[]}:{score:PENALTY_NOT_COMPLETE,indices:[]};const A=`${e},${n}`;if(void 0!==t[A])return t[A];const S=C.charAt(n);let c,r,o,O,T=P.indexOf(S,e),R=0,N=[];for(;T>=0;)O=commandScoreInner(E,_,P,C,T+1,n+1,t),c=O.score,c>R&&(T===e?c*=SCORE_CONTINUE_MATCH:IS_GAP_REGEXP.test(E.charAt(T-1))?(c*=SCORE_NON_SPACE_WORD_JUMP,r=E.slice(e,T-1).match(COUNT_GAPS_REGEXP),r&&e>0&&(c*=Math.pow(PENALTY_SKIPPED,r.length))):IS_SPACE_REGEXP.test(E.charAt(T-1))?(c*=SCORE_SPACE_WORD_JUMP,o=E.slice(e,T-1).match(COUNT_SPACE_REGEXP),o&&e>0&&(c*=Math.pow(PENALTY_SKIPPED,o.length))):(c*=SCORE_CHARACTER_JUMP,e>0&&(c*=Math.pow(PENALTY_SKIPPED,T-e))),E.charAt(T)!==_.charAt(n)&&(c*=PENALTY_CASE_MISMATCH)),c>R&&(N=[T,...O.indices],R=c),T=P.indexOf(S,T+1);return t[A]={score:R,indices:N},{score:R,indices:N}}function formatInput(E){return E.toLowerCase().replace(COUNT_SPACE_REGEXP," ")}function commandScore(E,_){return commandScoreInner(E,_,formatInput(E),formatInput(_),0,0,{})}export{commandScore};

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,12 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/lit-element@4.0.5/lit-element.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
import{ReactiveElement as e}from"../reactive-element/reactive-element.min.js";export*from"../reactive-element/reactive-element.min.js";import{render as t,noChange as n}from"../lit-html/lit-html.min.js";export*from"../lit-html/lit-html.min.js";
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/class s extends e{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=t(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return n}}s._$litElement$=!0,s.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:s});const r=globalThis.litElementPolyfillSupport;r?.({LitElement:s});const o={_$AK:(e,t,n)=>{e._$AK(t,n)},_$AL:e=>e._$AL};(globalThis.litElementVersions??=[]).push("4.0.5");export{s as LitElement,o as _$LE};export default null;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,12 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/lit-html@3.1.3/directives/join.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
function*o(o,t){const n="function"==typeof t;if(void 0!==o){let e=-1;for(const f of o)e>-1&&(yield n?t(e):t),e++,yield f}}export{o as join};export default null;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,12 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/lit-html@3.1.3/is-server.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
/**
* @license
* Copyright 2022 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const e=!1;export{e as isServer};export default null;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,7 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/lit@3.1.3/decorators.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
export*from"../reactive-element/decorators/custom-element.min.js";export*from"../reactive-element/decorators/property.min.js";export*from"../reactive-element/decorators/state.min.js";export*from"../reactive-element/decorators/event-options.min.js";export*from"../reactive-element/decorators/query.min.js";export*from"../reactive-element/decorators/query-all.min.js";export*from"../reactive-element/decorators/query-async.min.js";export*from"../reactive-element/decorators/query-assigned-elements.min.js";export*from"../reactive-element/decorators/query-assigned-nodes.min.js";export default null;

View File

@ -0,0 +1,7 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/lit@3.1.3/directives/class-map.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
export*from"../../lit-html/directives/class-map.min.js";export default null;

View File

@ -0,0 +1,7 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/lit@3.1.3/directives/join.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
export*from"../../lit-html/directives/join.min.js";export default null;

View File

@ -0,0 +1,7 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/lit@3.1.3/directives/live.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
export*from"../../lit-html/directives/live.min.js";export default null;

View File

@ -0,0 +1,7 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/lit@3.1.3/directives/ref.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
export*from"../../lit-html/directives/ref.min.js";export default null;

View File

@ -0,0 +1,7 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/lit@3.1.3/directives/repeat.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
export*from"../../lit-html/directives/repeat.min.js";export default null;

View File

@ -0,0 +1,7 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/lit@3.1.3/directives/unsafe-html.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
export*from"../../lit-html/directives/unsafe-html.min.js";export default null;

7
assets/js/search/lit/index.min.js vendored Normal file
View File

@ -0,0 +1,7 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/lit@3.1.3/index.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
import"../reactive-element/reactive-element.min.js";import"../lit-html/lit-html.min.js";export*from"../lit-element/lit-element.min.js";export*from"../lit-html/is-server.min.js";export default null;

101
assets/js/search/ninja-action.min.js vendored Normal file
View File

@ -0,0 +1,101 @@
/**
* Minified by jsDelivr using Terser v5.19.2.
* Original file: /npm/@deepdub/ninja-keys@1.2.11/dist/ninja-action.js
*
* 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`
<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"}">
${this.action.type}
</div>`:html``}
<div class="ninja-title">${this.highlightMatch(this.action.title,this.matchIndices)}</div>
${e}
</div>
`;var n}};NinjaAction.styles=css`
:host {
display: flex;
width: 100%;
}
.ninja-action {
padding: 0.75em 1em;
display: flex;
gap: 0.75rem;
border-left: 2px solid transparent;
align-items: center;
justify-content: start;
outline: none;
transition: color 0s ease 0s;
width: 100%;
}
.ninja-action .highlight {
color: var(--ninja-accent-color);
font-weight: bold;
}
.ninja-action.selected {
cursor: pointer;
color: var(--ninja-selected-text-color);
background-color: var(--ninja-selected-background);
border-left: 2px solid var(--ninja-accent-color);
outline: none;
}
.ninja-action.selected .ninja-icon {
color: var(--ninja-selected-text-color);
}
.ninja-icon {
width: 20px;
font-size: var(--ninja-icon-size);
color: var(--ninja-icon-color);
margin-right: 0.5625rem;
position: relative;
line-height: 0;
flex-shrink: 0;
}
.ninja-icon img {
width: 100%;
}
.ninja-title {
flex-shrink: 0.01;
margin-right: 0.5em;
flex-grow: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.ninja-action-type {
font-size: 11px;
padding: 3px 5px;
border-radius: 3px;
color: #ffffff;
text-transform: uppercase;
}
.ninja-hotkeys {
flex-shrink: 0;
width: min-content;
display: flex;
}
.ninja-hotkeys kbd {
font-family: inherit;
}
.ninja-hotkey {
background: var(--ninja-secondary-background-color);
padding: 0.06em 0.25em;
border-radius: var(--ninja-key-border-radius);
text-transform: capitalize;
color: var(--ninja-secondary-text-color);
font-size: 0.75em;
font-family: inherit;
}
.ninja-hotkey + .ninja-hotkey {
margin-left: 0.5em;
}
.ninja-hotkeys + .ninja-hotkeys {
margin-left: 1em;
}
`,__decorate([property({type:Object})],NinjaAction.prototype,"action",void 0),__decorate([property({type:Array})],NinjaAction.prototype,"matchIndices",void 0),__decorate([property({type:Boolean})],NinjaAction.prototype,"selected",void 0),__decorate([property({type:Boolean})],NinjaAction.prototype,"hotKeysJoinedView",void 0),NinjaAction=__decorate([customElement("ninja-action")],NinjaAction);export{NinjaAction};

62
assets/js/search/ninja-footer.min.js vendored Normal file
View File

@ -0,0 +1,62 @@
/**
* Minified by jsDelivr using Terser v5.19.2.
* Original file: /npm/@deepdub/ninja-keys@1.2.11/dist/ninja-footer.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
import{html}from"./lit/index.min.js";export const footerHtml=html` <div class="modal-footer" slot="footer">
<span class="help">
<svg
version="1.0"
class="ninja-examplekey"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 1280 1280"
>
<path
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"
/>
</svg>
to select
</span>
<span class="help">
<svg
xmlns="http://www.w3.org/2000/svg"
class="ninja-examplekey"
viewBox="0 0 24 24"
>
<path d="M0 0h24v24H0V0z" fill="none" />
<path
d="M20 12l-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"
/>
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
class="ninja-examplekey"
viewBox="0 0 24 24"
>
<path d="M0 0h24v24H0V0z" fill="none" />
<path d="M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z" />
</svg>
to navigate
</span>
<span class="help">
<span class="ninja-examplekey esc">esc</span>
to close
</span>
<span class="help">
<svg
xmlns="http://www.w3.org/2000/svg"
class="ninja-examplekey backspace"
viewBox="0 0 20 20"
fill="currentColor"
>
<path
fill-rule="evenodd"
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"
clip-rule="evenodd"
/>
</svg>
move to parent
</span>
</div>`;

78
assets/js/search/ninja-header.min.js vendored Normal file
View File

@ -0,0 +1,78 @@
/**
* Minified by jsDelivr using Terser v5.19.2.
* Original file: /npm/@deepdub/ninja-keys@1.2.11/dist/ninja-header.js
*
* 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(e,t,r,a){var n,o=arguments.length,i=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(i=(o<3?n(i):o>3?n(t,r,i):n(t,r))||i);return o>3&&i&&Object.defineProperty(t,r,i),i};import{LitElement,html,css}from"./lit/index.min.js";import{customElement,property}from"./lit/decorators.min.js";import{ref,createRef}from"./lit/directives/ref.min.js";let NinjaHeader=class extends LitElement{constructor(){super(...arguments),this.placeholder="",this.hideBreadcrumbs=!1,this.breadcrumbHome="Home",this.breadcrumbs=[],this._inputRef=createRef(),this._prevValue=""}render(){let e="";if(!this.hideBreadcrumbs){const t=[];for(const e of this.breadcrumbs)t.push(html`<button tabindex="-1" @click=${()=>this.selectParent(e)} class="breadcrumb">
${e}
</button>`);e=html`<div class="breadcrumb-list">
<button tabindex="-1" @click=${()=>this.selectParent()} class="breadcrumb">${this.breadcrumbHome}</button>
${t}
</div>`}return html`
${e}
<div part="ninja-input-wrapper" class="search-wrapper">
<input
part="ninja-input"
type="text"
id="search"
spellcheck="false"
autocomplete="off"
@input="${this._handleInput}"
@keyup="${this._handleKeyup}"
${ref(this._inputRef)}
placeholder="${this.placeholder}"
class="search"
/>
</div>
`}setSearch(e){this._inputRef.value&&(this._prevValue=e,this._inputRef.value.value=e)}focusSearch(){requestAnimationFrame((()=>this._inputRef.value.focus()))}_handleInput(e){const t=e.target;this.handleChange(t.value)}_handleKeyup(e){const t=e.target;t.value!==this._prevValue&&this.handleChange(t.value)}handleChange(e){this._prevValue=e,this.dispatchEvent(new CustomEvent("change",{detail:{search:e},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}))}};NinjaHeader.styles=css`
:host {
flex: 1;
position: relative;
}
.search {
padding: 1.25em;
flex-grow: 1;
flex-shrink: 0;
margin: 0px;
border: none;
appearance: none;
font-size: 1.125em;
background: transparent;
caret-color: var(--ninja-accent-color);
color: #ffffff;
outline: none;
font-family: var(--ninja-font-family);
}
.search::placeholder {
color: var(--ninja-placeholder-color);
}
.breadcrumb-list {
padding: 1em 4em 0 1em;
display: flex;
flex-direction: row;
align-items: stretch;
justify-content: flex-start;
flex: initial;
}
.breadcrumb {
background: var(--ninja-secondary-background-color);
text-align: center;
line-height: 1.2em;
border-radius: var(--ninja-key-border-radius);
border: 0;
cursor: pointer;
padding: 0.1em 0.5em;
color: var(--ninja-secondary-text-color);
margin-right: 0.5em;
outline: none;
font-family: var(--ninja-font-family);
}
.search-wrapper {
display: flex;
border-bottom: var(--ninja-separate-border);
background: #000000;
}
`,__decorate([property()],NinjaHeader.prototype,"placeholder",void 0),__decorate([property({type:Boolean})],NinjaHeader.prototype,"hideBreadcrumbs",void 0),__decorate([property()],NinjaHeader.prototype,"breadcrumbHome",void 0),__decorate([property({type:Array})],NinjaHeader.prototype,"breadcrumbs",void 0),NinjaHeader=__decorate([customElement("ninja-header")],NinjaHeader);export{NinjaHeader};

39
assets/js/search/ninja-keys.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,12 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/@lit/reactive-element@2.0.4/decorators/custom-element.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const e=e=>(t,n)=>{void 0!==n?n.addInitializer((()=>{customElements.define(e,t)})):customElements.define(e,t)};export{e as customElement};export default null;

View File

@ -0,0 +1,12 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/@lit/reactive-element@2.0.4/decorators/event-options.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
function t(t){return(n,e)=>{const o="function"==typeof n?n:n[e];Object.assign(o,t)}}export{t as eventOptions};export default null;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,17 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/@lit/reactive-element@2.0.4/decorators/query-all.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
let e;function t(t){return(r,o)=>((e,t,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,r),r))(r,o,{get(){return(this.renderRoot??(e??=document.createDocumentFragment())).querySelectorAll(t)}})}export{t as queryAll};export default null;

View File

@ -0,0 +1,17 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/@lit/reactive-element@2.0.4/decorators/query-assigned-elements.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
* @license
* Copyright 2021 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
function e(e){return(t,r)=>{const{slot:n,selector:o}=e??{},s="slot"+(n?`[name=${n}]`:":not([name])");return((e,t,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,r),r))(t,r,{get(){const t=this.renderRoot?.querySelector(s),r=t?.assignedElements(e)??[];return void 0===o?r:r.filter((e=>e.matches(o)))}})}}export{e as queryAssignedElements};export default null;

View File

@ -0,0 +1,17 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/@lit/reactive-element@2.0.4/decorators/query-assigned-nodes.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
function e(e){return(t,o)=>{const{slot:r}=e??{},n="slot"+(r?`[name=${r}]`:":not([name])");return((e,t,o)=>(o.configurable=!0,o.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,o),o))(t,o,{get(){const t=this.renderRoot?.querySelector(n);return t?.assignedNodes(e)??[]}})}}export{e as queryAssignedNodes};export default null;

View File

@ -0,0 +1,17 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/@lit/reactive-element@2.0.4/decorators/query-async.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
function e(e){return(t,r)=>((e,t,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,r),r))(t,r,{async get(){return await this.updateComplete,this.renderRoot?.querySelector(e)??null}})}export{e as queryAsync};export default null;

View File

@ -0,0 +1,17 @@
/**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/@lit/reactive-element@2.0.4/decorators/query.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
const e=(e,t,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,r),r)
/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/;function t(t,r){return(n,o,l)=>{const u=e=>e.renderRoot?.querySelector(t)??null;if(r){const{get:t,set:r}="object"==typeof o?n:l??(()=>{const e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return e(n,o,{get(){let e=t.call(this);return void 0===e&&(e=u(this),(null!==e||this.hasUpdated)&&r.call(this,e)),e}})}return e(n,o,{get(){return u(this)}})}}export{t as query};export default null;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -28,6 +28,7 @@ let applyTheme = () => {
transTheme(); transTheme();
setHighlight(theme); setHighlight(theme);
setGiscusTheme(theme); setGiscusTheme(theme);
setSearchTheme(theme);
// if mermaid is not defined, do nothing // if mermaid is not defined, do nothing
if (typeof mermaid !== "undefined") { if (typeof mermaid !== "undefined") {
@ -186,6 +187,17 @@ let setVegaLiteTheme = (theme) => {
}); });
}; };
let setSearchTheme = (theme) => {
const ninjaKeys = document.querySelector("ninja-keys");
if (!ninjaKeys) return;
if (theme === "dark") {
ninjaKeys.classList.add("dark");
} else {
ninjaKeys.classList.remove("dark");
}
};
let transTheme = () => { let transTheme = () => {
document.documentElement.classList.add("transition"); document.documentElement.classList.add("transition");
window.setTimeout(() => { window.setTimeout(() => {

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
nbconvert