This file contains hidden or 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
| import { observable, makeObservable, runInAction, action } from "mobx"; | |
| import { HistoryManager } from "./history"; | |
| import { v4 as uuid } from "uuid"; | |
| type Constructor<T> = { | |
| new (...params: any[]): T; | |
| [x: string | number | symbol]: any; | |
| }; | |
| type BaseData = { |
This file contains hidden or 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
| export interface Project { | |
| id: string; | |
| video: MediaReference; // hosted video | |
| preview_video: MediaReference; // hosted video | |
| background: MediaReference; | |
| speakers: Speaker[]; | |
| source_blueprint: { | |
| id: string; | |
| utterances: SourceUtterance[] |
This file contains hidden or 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
| // actions | |
| decomposeVideo({ src: 'video-url'}): SourceBlueprint | |
| dub({ source_transcription, target_transcription, source_audio, voice_id }): MediaReference | |
| recomposeVideo(targetBlueprint: TargetBlueprint): MediaReference | |
| // types | |
| interface SourceBlueprint { | |
| video: MediaReference // hosted video | |
| background_audio: MediaReference |
This file contains hidden or 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
| // components/Tabs.tsx | |
| import { | |
| Tabs as ArkTabs, | |
| TabList as ArkTabList, | |
| TabTrigger as ArkTabTrigger, | |
| } from '@ark-ui/react' | |
| const tabs = defineMultipartRecipe({ | |
| name: 'tabs', | |
| parts: ['root', 'list', 'trigger'], |
This file contains hidden or 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
| // client | |
| signIn().then((user) => { | |
| axios.post('/users', user, { headers: { authorization: user.accessToken } }) | |
| }) | |
| // server | |
| server.middleware((req, res) => { | |
| if (req.headers.authorization) { | |
| try { | |
| const decoded = await firebase.verifyIdToken(req.headers.authorization) |
This file contains hidden or 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
| type Book = { | |
| id: string | |
| image: string | |
| title: string | |
| description: string | |
| duration: number // (milliseconds?) | |
| audio: string | |
| chapters: Chapter[] | |
| } |
This file contains hidden or 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
| { | |
| "kind": "books#volumes", | |
| "totalItems": 3633, | |
| "items": [ | |
| { | |
| "kind": "books#volume", | |
| "id": "o_dvDwAAQBAJ", | |
| "etag": "b9ADYZl9aVQ", | |
| "selfLink": "https://content-books.googleapis.com/books/v1/volumes/o_dvDwAAQBAJ", | |
| "volumeInfo": { |
This file contains hidden or 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
| import 'react-app-polyfill/ie11'; | |
| import * as ReactDOM from 'react-dom'; | |
| import { | |
| theme, | |
| ArrowLeftIcon, | |
| ArrowRightIcon, | |
| ArrowDiagonalIcon, | |
| CollectionsIcon, | |
| Dropdown, | |
| } from '../'; |
This file contains hidden or 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
| const Item = () => { | |
| const progress = useScrollProgress() | |
| return <motion.div style={{ opacity: progress }} /> | |
| } | |
| const App = () => { | |
| return ( | |
| <Scroll.Section | |
| start={{ section: 'start', container: 'center' }} | |
| end={{ section: 'end', container: 'center' }} |
This file contains hidden or 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
| import { Box, Center, Flex, Grid, Stack, Text } from "@chakra-ui/react"; | |
| import React, { ReactNode } from "react"; | |
| export interface TableProps<T extends { id: string }> { | |
| children: ReactNode; | |
| data: T[]; | |
| emptyLabel?: string; | |
| } | |
| export interface ColumnDefinition { |