Skip to content

Commit

Permalink
updated themes
Browse files Browse the repository at this point in the history
  • Loading branch information
imonroe committed Apr 23, 2024
1 parent 46fffaf commit be70927
Show file tree
Hide file tree
Showing 73 changed files with 18,863 additions and 13,581 deletions.
Empty file modified themes/minimally_branded_subtheme/README.md
100644 → 100755
Empty file.
Empty file modified themes/minimally_branded_subtheme/logo.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
Empty file.
Empty file.
Empty file modified themes/minimally_branded_subtheme/screenshot.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 0 additions & 7 deletions themes/minimally_branded_subtheme/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ var webpackConfig = {
},
module: {
rules: [
{
test: /\.behavior.js$/,
exclude: /node_modules/,
options: {
enableHmr: false
},
},
{
test: /\.m?js$/,
exclude: /(node_modules)/,
Expand Down
2,886 changes: 1,417 additions & 1,469 deletions themes/minimally_branded_subtheme/yarn.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion themes/soe_basic/dist/css/theme.css

Large diffs are not rendered by default.

Empty file modified themes/soe_basic/theme-settings.php
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions themes/soe_basic/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

const path = require("path");
const Webpack = require("webpack");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
Expand Down
Empty file modified themes/stanford_basic/README.md
100644 → 100755
Empty file.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! algoliasearch-lite.umd.js | 4.20.0 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
/*! algoliasearch-lite.umd.js | 4.22.1 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */

/**
* @license React
Expand Down
31 changes: 16 additions & 15 deletions themes/stanford_basic/algolia-search/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,26 @@
"dev": "webpack serve --env dev"
},
"dependencies": {
"algoliasearch": "^4.20.0",
"preact": "^10.18.1",
"react-instantsearch": "^7.3.0",
"styled-components": "^6.1.1"
"algoliasearch": "^4.22.1",
"preact": "^10.19.6",
"react-instantsearch": "^7.7.0",
"styled-components": "^6.1.8"
},
"devDependencies": {
"@babel/core": "^7.23.0",
"@babel/preset-env": "^7.18.9",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.18.6",
"@types/webpack": "^5.28.0",
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@babel/preset-react": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@types/webpack": "^5.28.5",
"babel-loader": "^9.1.3",
"css-loader": "^6.7.1",
"css-loader": "^6.10.0",
"dotenv-webpack": "^8.0.1",
"html-webpack-plugin": "^5.5.0",
"html-webpack-plugin": "^5.6.0",
"preact-island": "^1.1.2",
"terser-webpack-plugin": "^5.3.5",
"webpack": "^5.74.0",
"terser-webpack-plugin": "^5.3.10",
"webpack": "^5.90.3",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.9.3"
}
"webpack-dev-server": "^4.15.1"
},
"packageManager": "[email protected]"
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import algoliasearch from 'algoliasearch/lite';
import {createIslandWebComponent} from 'preact-island'
import {Hits, HitsProps, InstantSearch, useHits} from 'react-instantsearch';
import {HitsProps, InstantSearch, useHits} from 'react-instantsearch';
import SearchBox from "./search-box";
import EventHit from "./hits/events";
import NewsHit from "./hits/news";
Expand Down Expand Up @@ -40,7 +40,7 @@ const CustomHits = (props) => {
)

return (
<ul>
<ul style={{listStyle: "none", padding: 0}}>
{hits.map(hit =>
<li key={hit.objectID}>
<Hit hit={hit}/>
Expand Down
50 changes: 19 additions & 31 deletions themes/stanford_basic/algolia-search/src/search-box.tsx
Original file line number Diff line number Diff line change
@@ -1,65 +1,53 @@
import {useInstantSearch, useSearchBox} from "react-instantsearch";
import {useId, useRef, useState} from "preact/compat";
import {useRef} from "preact/compat";

const SearchBox = (props) => {
const {query, refine} = useSearchBox(props);
const {status} = useInstantSearch();
const [inputValue, setInputValue] = useState(query);
const inputRef = useRef(null);
const inputId = useId();

const isSearchStalled = status === 'stalled';
const isLoading = status === 'loading'
const inputRef = useRef<HTMLInputElement>(null);

return (
<form
action=""
role="search"
noValidate
onSubmit={(event) => {
event.preventDefault();
event.stopPropagation();

if (inputRef.current) {
inputRef.current.blur();
}
refine(inputValue);
onSubmit={e => {
e.preventDefault();
e.stopPropagation();
refine(inputRef.current?.value);
window.history.replaceState(null, '', `?key=${inputRef.current?.value}`)
}}
onReset={(event) => {
event.preventDefault();
event.stopPropagation();
setInputValue('');
onReset={e => {
e.preventDefault();
e.stopPropagation();
refine('');

if (inputRef.current) {
inputRef.current.focus();
}
inputRef.current.value = '';
inputRef.current?.focus();
}}
style={{marginBottom: "20px"}}
>
<div>
<label htmlFor={inputId}>
<label htmlFor="keyword-search-algolia">
Keywords<span className="visually-hidden">&nbsp;Search</span>
</label>
<input
id={inputId}
id="keyword-search-algolia"
ref={inputRef}
autoComplete="on"
autoCorrect="on"
autoCapitalize="off"
spellCheck={false}
maxLength={512}
spellCheck={true}
maxLength={128}
type="search"
value={inputValue}
onChange={e => setInputValue(e.currentTarget.value)}
defaultValue={query}
autoFocus
/>
</div>
<div style={{display: "flex", gap: "1rem", marginTop: "1rem"}}>
<button type="submit">Submit</button>
<button
type="reset"
hidden={inputValue.length === 0 || isSearchStalled}
hidden={query.length === 0}
>
Reset
</button>
Expand All @@ -75,7 +63,7 @@ const StatusMessage = ({status, query}) => {
message = `Showing results for "${query}"`
}
return (
<div className="visually-hidden" aria-live="polite">{message}</div>
<div className="visually-hidden" aria-live="polite" aria-atomic>{message}</div>
)
}
export default SearchBox;
Loading

0 comments on commit be70927

Please sign in to comment.