-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/dropdown_sections
- Loading branch information
Showing
25 changed files
with
131 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
import { aiLogger } from "@oakai/logger"; | ||
|
||
const log = aiLogger("chat"); | ||
export const copyLinkToClipboard = () => { | ||
const currentURL = window.location.href; | ||
navigator.clipboard.writeText(currentURL).then(() => { | ||
alert("Link copied to clipboard!"); | ||
}); | ||
navigator.clipboard | ||
.writeText(currentURL) | ||
.then(() => { | ||
alert("Link copied to clipboard!"); | ||
}) | ||
.catch((error) => { | ||
log.error(error); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
import { aiLogger } from "@oakai/logger"; | ||
|
||
const log = aiLogger("chat"); | ||
export const copyTextToClipboard = () => { | ||
const elementsToCopy = | ||
document.querySelectorAll<HTMLElement>(".copy-to-clipboard"); | ||
const textToCopy = Array.from(elementsToCopy) | ||
.map((element) => element.innerText) | ||
.join("\n"); | ||
|
||
navigator.clipboard.writeText(textToCopy).then(() => { | ||
alert("Text copied to clipboard!"); | ||
}); | ||
navigator.clipboard | ||
.writeText(textToCopy) | ||
.then(() => { | ||
alert("Text copied to clipboard!"); | ||
}) | ||
.catch((error) => { | ||
log.error(error); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,5 @@ export default function Page() { | |
<div> | ||
<UserProfile /> | ||
</div> | ||
) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
import * as React from 'react' | ||
import * as React from "react"; | ||
|
||
export function useAtBottom(offset = 0) { | ||
const [isAtBottom, setIsAtBottom] = React.useState(false) | ||
const [isAtBottom, setIsAtBottom] = React.useState(false); | ||
|
||
React.useEffect(() => { | ||
const handleScroll = () => { | ||
setIsAtBottom( | ||
window.innerHeight + window.scrollY >= | ||
document.body.offsetHeight - offset | ||
) | ||
} | ||
document.body.offsetHeight - offset, | ||
); | ||
}; | ||
|
||
window.addEventListener('scroll', handleScroll, { passive: true }) | ||
handleScroll() | ||
window.addEventListener("scroll", handleScroll, { passive: true }); | ||
handleScroll(); | ||
|
||
return () => { | ||
window.removeEventListener('scroll', handleScroll) | ||
} | ||
}, [offset]) | ||
window.removeEventListener("scroll", handleScroll); | ||
}; | ||
}, [offset]); | ||
|
||
return isAtBottom | ||
return isAtBottom; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from "./src"; | ||
export { Aila } from "./src/core/Aila"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
extends: ["eslint-config-custom"], | ||
parserOptions: { | ||
project: __dirname + "/tsconfig.json", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
extends: ["eslint-config-custom"], | ||
parserOptions: { | ||
project: __dirname + "/tsconfig.json", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
extends: ["eslint-config-custom"], | ||
parserOptions: { | ||
project: __dirname + "/tsconfig.json", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
extends: ["eslint-config-custom"], | ||
parserOptions: { | ||
project: __dirname + "/tsconfig.json", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** @type {import("eslint").Linter.Config} */ | ||
module.exports = { | ||
extends: ["eslint-config-custom"], | ||
parserOptions: { | ||
project: __dirname + "/tsconfig.json", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
export function jsonlToArray(jsonl: string) { | ||
return jsonl | ||
.split("\n") | ||
.filter((line) => line.trim() !== "") | ||
.map((line) => JSON.parse(line)); | ||
export function jsonlToArray(jsonl: string): unknown[] { | ||
return ( | ||
jsonl | ||
.split("\n") | ||
.filter((line) => line.trim() !== "") | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return | ||
.map((line) => JSON.parse(line)) | ||
); | ||
} |