Skip to content

Commit eaf9ccc

Browse files
Bump version 0.12.3
1 parent 891d9ad commit eaf9ccc

File tree

5 files changed

+46
-41
lines changed

5 files changed

+46
-41
lines changed

.github/workflows/ci_cd.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
fail-fast: false
8484
matrix:
8585
os: [ubuntu-latest, windows-latest, macos-latest]
86-
python-version: ['3.8', '3.9', '3.10', '3.11']
86+
python-version: ['3.9', '3.10', '3.11', '3.12']
8787
should-release:
8888
- ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags') }}
8989
exclude:
@@ -94,7 +94,6 @@ jobs:
9494
uses: ansys/actions/build-wheelhouse@v4
9595
with:
9696
library-name: ${{ env.PACKAGE_NAME }}
97-
library-namespace: ${{ env.PACKAGE_NAMESPACE }}
9897
operating-system: ${{ matrix.os }}
9998
python-version: ${{ matrix.python-version }}
10099

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ build-backend = "flit_core.buildapi"
55
[project]
66
# Check https://flit.readthedocs.io/en/latest/pyproject_toml.html for all available sections
77
name = "ansys-sphinx-theme"
8-
version = "0.12.2"
8+
version = "0.12.3"
99
description = "A theme devised by ANSYS, Inc. for Sphinx documentation."
1010
readme = "README.rst"
11-
requires-python = ">=3.8,<4"
11+
requires-python = ">=3.9,<4"
1212
license = {file = "LICENSE"}
1313
authors = [
1414
{name = "ANSYS, Inc.", email = "[email protected]"},

src/ansys_sphinx_theme/theme/ansys_sphinx_theme/components/search-field.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
action="{{ pathto('search') }}"
1010
method="get"
1111
>
12+
<i class="fa fa-search" aria-hidden="true" id="search-icon"></i>
1213
<input
1314
type="search"
1415
placeholder="Search"
@@ -31,7 +32,6 @@
3132
{% endfor %}
3233
</select>
3334
{% endif %}
34-
<i class="fa-solid fa-magnifying-glass"></i>
3535
<!-- Include the MeiliSearch JavaScript library for the search bar -->
3636
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script>
3737

src/ansys_sphinx_theme/theme/ansys_sphinx_theme/static/css/meilisearch.css

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ div[data-ds-theme] .searchbox input {
8282
.container {
8383
display: flex;
8484
justify-content: center;
85-
align-items: center;
85+
align-items: right;
8686
}
8787

8888
div[data-ds-theme] .meilisearch-autocomplete {
@@ -92,23 +92,12 @@ div[data-ds-theme] .meilisearch-autocomplete {
9292

9393
#search-bar-input {
9494
background-color: var(--pst-color-background);
95-
border: 1px solid var(--pst-color-border);
96-
border-radius: 0.25rem;
9795
color: var(--pst-color-text-base);
9896
font-size: var(--pst-font-size-icon);
9997
position: relative;
100-
padding-left: 3rem;
101-
}
102-
103-
.meilisearch-autocomplete::before {
104-
content: "\f002";
105-
font-family: "Font Awesome 6 Free";
106-
position: absolute;
107-
left: 8px;
108-
top: 50%;
109-
transform: translateY(-50%);
110-
font-size: 1rem;
111-
color: var(--pst-color-border);
98+
padding-left: 1rem;
99+
outline-color: var(--pst-color-border);
100+
margin-left: 1rem;
112101
}
113102

114103
.index-select {
@@ -197,4 +186,9 @@ div[data-ds-theme]
197186

198187
.bd-search {
199188
margin-bottom: 200px;
189+
gap: 0em;
190+
border: 0px solid var(--pst-color-border);
191+
}
192+
#search-icon {
193+
font-size: 1.5rem;
200194
}

src/ansys_sphinx_theme/theme/ansys_sphinx_theme/static/js/meilisearch_theme_wrap.js

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,49 @@ require.config({
88
require(["docsSearchBar"], function (docsSearchBar) {
99
document.body.style.overflow = "hidden !important";
1010
// Initialize the MeiliSearch bar with the given API key and host
11-
// inspect the first value of index UID as default
12-
1311
var theSearchBar = docsSearchBar({
1412
hostUrl: HOST_URL,
1513
apiKey: API_KEY,
1614
indexUid: indexUid,
1715
inputSelector: "#search-bar-input",
1816
debug: true, // Set debug to true if you want to inspect the dropdown
1917
meilisearchOptions: {
20-
limit: 1000,
18+
limit: 10,
2119
},
2220
});
2321

22+
// Function to show the magnifier icon
23+
function showMagnifierIcon() {
24+
var searchIcon = document.getElementById("search-icon");
25+
searchIcon.classList.remove("fa-spinner", "fa-spin"); // Remove spinner classes
26+
searchIcon.classList.add("fa-magnifying-glass"); // Add magnifier icon class
27+
}
28+
29+
// Function to show the spinner icon
30+
function showSpinnerIcon() {
31+
var searchIcon = document.getElementById("search-icon");
32+
if (searchIcon) {
33+
searchIcon.classList.remove("fa-magnifying-glass"); // Remove magnifier icon class
34+
searchIcon.classList.add("fa-spinner", "fa-spin"); // Add spinner classes
35+
}
36+
}
37+
38+
document
39+
.getElementById("search-bar-input")
40+
.addEventListener("input", function () {
41+
const inputValue = this.value.trim(); // Trim whitespace from input value
42+
// Show the spinner icon only when there is input and no suggestions
43+
if (
44+
inputValue &&
45+
document.querySelectorAll(".dsb-suggestion").length === 0
46+
) {
47+
showSpinnerIcon();
48+
} else {
49+
// Hide the spinner icon when there are suggestions
50+
showMagnifierIcon();
51+
}
52+
});
53+
2454
// Listen for changes in the dropdown selector and update the index uid and suggestion accordingly
2555
document
2656
.getElementById("indexUidSelector")
@@ -29,22 +59,4 @@ require(["docsSearchBar"], function (docsSearchBar) {
2959
theSearchBar.suggestionIndexUid = this.value;
3060
theSearchBar.autocomplete.autocomplete.setVal("");
3161
});
32-
33-
// Listen for changes in the search bar input and update the suggestion accordingly
34-
document
35-
.getElementById("search-bar-input")
36-
.addEventListener("change", function () {
37-
theSearchBar.suggestionIndexUid =
38-
document.getElementById("indexUidSelector").value;
39-
});
40-
41-
// Set the focus on the search bar input
42-
document.getElementById("searchbar").focus();
43-
44-
// Set the focus on the dropdown selector
45-
document
46-
.getElementById("searchbar")
47-
.addEventListener("indexUidSelector", function () {
48-
theSearchBar.autocomplete.autocomplete.close();
49-
});
5062
});

0 commit comments

Comments
 (0)