Skip to content

Commit

Permalink
fix: Fix layouts and dark/light color scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
JumpLink committed Jun 23, 2023
1 parent 2acfa27 commit 3750e23
Show file tree
Hide file tree
Showing 20 changed files with 261 additions and 1,891 deletions.
2 changes: 1 addition & 1 deletion @types
Submodule @types updated 1154 files
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export class SearchServer {
results.push({
classes: row.classes,
url: row.url,
kind: row.kind,
name,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export interface SearchResult {
classes: string;
url: string;
name: string;
kind: number;
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ export class ModuleMenuComponent extends Component {
}
}

public onModuleSelect(mod: Module) {
console.debug("onModuleSelect");
public onModuleSelect(mod: Module, event: Event) {
console.debug("onModuleSelect", mod, event);
this.scope.selectedModule = mod.name;
const pjax = Pjax.getInstance("main");
if (!pjax || !mod.url) {
console.warn("No module with href or no pjax instance found!");
return;
}
Dropdown.hideAll();
Dropdown.hideAll(event);
pjax.goTo(mod.url);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tsd-search {
visibility: hidden;
border-top-left-radius: 0 !important;
border-top-right-radius: 0 !important;
top: $default-navbar-height - 4;
top: $default-navbar-height - 17;
right: 0;
width: 500px;
max-width: 100%;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ export class SearchComponent extends Component {

this.scope.isLoading = true;
this.scope.isReady = false;
this.scope.hasFailure = false;

const url = new URL(this.scope.serverBaseUrl);
const separator = url.pathname.endsWith("/") ? "" : "/";
Expand All @@ -192,8 +193,17 @@ export class SearchComponent extends Component {
this.scope.hasFailure = true;
}

this.validateResult(results);
this.transformResult(results);
try {
this.validateResult(results);
this.transformResult(results);
} catch (error) {
console.error(error);
this.scope.results = [];
this.scope.isLoading = false;
this.scope.hasFailure = true;
}

if (this.scope.hasFailure) return;

this.scope.results = results;
this.scope.isLoading = false;
Expand All @@ -212,6 +222,8 @@ export class SearchComponent extends Component {
throw new Error("Property name must be of type string!");
if (typeof result.url !== "string")
throw new Error("Property url must be of type string!");
if (typeof result.kind !== "number")
throw new Error("Property kind must be of type number!");
}
}

Expand Down Expand Up @@ -354,11 +366,12 @@ export class SearchComponent extends Component {
rv-on-mousedown="onSearchResultClick"
rv-on-ontouchend="onSearchResultClick"
>
<a
class="tsd-kind-icon"
rv-href="item.url"
rv-html="item.name"
></a>
<a class="tsd-index-link" rv-href="item.url">
<svg class="tsd-kind-icon" viewBox="0 0 24 24">
<use rv-href="'#icon-' | append item.kind"></use>
</svg>
<span rv-html="item.name"></span>
</a>
</li>
<li class="list-group-item disabled" rv-if="results | size | eq 0">
No results...
Expand Down
3 changes: 0 additions & 3 deletions packages/typedoc-theme-client/scripts/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ export * from "./module-options.js";
export * from "./navbar-component-scope.js";
export * from "./module.js";
export * from "./module-menu-component-scope.js";
export * from "./module-menu.js";
export * from "./navigation.js";
export * from "./search-component-scope.js";
export * from "./search-options.js";
export * from "./search-result.js";
export * from "./sidebar-content-component-scope.js";
export * from "./sidebar-content.js";
9 changes: 0 additions & 9 deletions packages/typedoc-theme-client/scripts/types/module-menu.ts

This file was deleted.

9 changes: 0 additions & 9 deletions packages/typedoc-theme-client/scripts/types/navigation.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export interface SearchResult {
classes: string;
kind: number;
url: string;
name: string;
}

This file was deleted.

Loading

0 comments on commit 3750e23

Please sign in to comment.