repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/components/CKEditor/index.tsx
src/components/CKEditor/index.tsx
/* eslint-disable no-return-await */ /* eslint-disable arrow-body-style */ import React from 'react'; import request from '@/utils/request'; import { CKEditor } from '@ckeditor/ckeditor5-react'; import DecoupledEditor from '@ckeditor/ckeditor5-build-decoupled-document'; import '@ckeditor/ckeditor5-build-decoupled-docum...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/components/Permission/index.tsx
src/components/Permission/index.tsx
import React from 'react'; import { Link } from 'react-router-dom'; import { Result, Button } from 'antd'; import { useRecoilValue } from 'recoil'; import { userState } from '@/store/user'; import { hasPermissionRoles } from '@/utils/router'; const Forbidden = ( <Result status={403} title='403' subTitle=...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/components/FooterToolbar/index.tsx
src/components/FooterToolbar/index.tsx
import React from 'react'; import classnames from 'classnames'; import style from './index.module.less'; export interface FooterToolbarProps { children: React.ReactNode; style?: React.CSSProperties; className?: string; } const FooterToolbar: React.FC<FooterToolbarProps> = (props) => { const { children, classN...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/components/TuiEditor/viewer.tsx
src/components/TuiEditor/viewer.tsx
import React, { useEffect, createRef } from 'react'; import { Viewer } from '@toast-ui/react-editor'; import '@toast-ui/editor/dist/toastui-editor.css'; export interface TuiEditorViewerProps { value: string; } const TuiEditorViewer: React.FC<TuiEditorViewerProps> = (props) => { const { value } = props; const e...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/components/TuiEditor/index.tsx
src/components/TuiEditor/index.tsx
import React, { createRef } from 'react'; import request from '@/utils/request'; import { Editor } from '@toast-ui/react-editor'; import '@toast-ui/editor/dist/toastui-editor.css'; export interface TuiEditorProps { value: string; onChange: (value?: string) => void; } const TuiEditor: React.FC<TuiEditorProps> = (p...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/utils/router.ts
src/utils/router.ts
/** * 路由工具 * @author LiQingSong */ import { createElement } from 'react'; import { Navigate, RouteObject, Location } from 'react-router-dom'; import { merge } from 'lodash/fp'; import qs from 'query-string'; import { isExternal } from '@/utils/validate'; import { equalObject } from '@/utils/object'; import { IRou...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/utils/localToken.ts
src/utils/localToken.ts
/** * 自定义 token 操作 * @author LiQingSong */ import settings from '@/config/settings'; /** * 获取本地Token */ export const getToken = () => localStorage.getItem(settings.siteTokenKey); /** * 设置存储本地Token */ export const setToken = (token: string) => { localStorage.setItem(settings.siteTokenKey, token); }; /** * 移...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/utils/i18n.ts
src/utils/i18n.ts
import { I18nKey } from '@/@types/i18n.d'; // window.localStorage 存储key export const localeKey = 'locale'; // 默认语言 export const defaultLang: I18nKey = 'zh-CN'; /** * 验证语言命名规则 zh-CN * @returns boolen * @author LiQingSong */ export const localeNameExp = (lang: string): boolean => { const localeExp = /^([a-z]{2})...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/utils/object.ts
src/utils/object.ts
import { ParsedQuery } from 'query-string'; /** * 浅比较两个object, json的key是否一致 * @param obj1 * @param obj2 * @returns */ export function equalObjectKey(obj1: Object, obj2: Object): boolean { const obj1Keys: string[] = Object.keys(obj1); const obj2Keys: string[] = Object.keys(obj2); const obj1KeysLen: number = o...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/utils/validate.ts
src/utils/validate.ts
/** * 判断是否是外链 * @param {string} path * @returns {Boolean} * @author LiQingSong */ export const isExternal = (path: string): boolean => /^(https?:|mailto:|tel:)/.test(path);
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/utils/request.ts
src/utils/request.ts
/** * 自定义 request 网络请求工具,基于axios * @author LiQingSong */ import axios, { AxiosPromise, AxiosRequestConfig, AxiosResponse } from 'axios'; import { notification } from 'antd'; import settings from '@/config/settings'; import { getToken } from '@/utils/localToken'; export interface ResponseData<T = unknown> { code: ...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/BlankLayout.tsx
src/layouts/BlankLayout.tsx
import { memo } from 'react'; export interface BlankLayoutProps { children: React.ReactNode; } export default memo(({ children }: BlankLayoutProps) => <>{children}</>);
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/SecurityLayout.tsx
src/layouts/SecurityLayout.tsx
import { memo, useCallback, useEffect, useMemo } from 'react'; import { useNavigate } from 'react-router-dom'; import { message } from 'antd'; import { useRecoilState } from 'recoil'; import { userState, CurrentUser } from '@/store/user'; import PageLoading from '@/components/PageLoading'; import { ResponseData } fro...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UniversalLayout/routes.ts
src/layouts/UniversalLayout/routes.ts
/** * UniversalLayout 路由配置 入口 * @author LiQingSong */ import { lazy } from 'react'; import { IRouter } from '@/@types/router.d'; const universalLayoutRotes: IRouter[] = [ /* { path: '/home', meta: { icon: 'home', title: 'universal-layout.menu.home', }, component: lazy(() => import('...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UniversalLayout/index.tsx
src/layouts/UniversalLayout/index.tsx
import { memo, useMemo } from 'react'; import { /* Outlet, */ useLocation } from 'react-router-dom'; import classnames from 'classnames'; import { useRecoilValue } from 'recoil'; import { globalState } from '@/store/global'; import { userState } from '@/store/user'; import { useI18n } from '@/store/i18n'; import local...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UniversalLayout/components/RightTopMessage.tsx
src/layouts/UniversalLayout/components/RightTopMessage.tsx
import { memo } from 'react'; import { Link } from 'react-router-dom'; import { Badge } from 'antd'; import { useRecoilValue } from 'recoil'; import { userMessageState } from '@/store/user'; import IconSvg from '@/components/IconSvg'; export default memo(() => { const userMessage = useRecoilValue(userMessageState)...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UniversalLayout/components/RightTop.tsx
src/layouts/UniversalLayout/components/RightTop.tsx
import { memo, Suspense } from 'react'; import { Link } from 'react-router-dom'; import classnames from 'classnames'; import { useRecoilState } from 'recoil'; import { globalState } from '@/store/global'; import IconSvg from '@/components/IconSvg'; import BreadCrumbs from '@/components/BreadCrumbs'; import SelectLang ...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UniversalLayout/components/RightTopUser.tsx
src/layouts/UniversalLayout/components/RightTopUser.tsx
import { memo, useCallback } from 'react'; import { useNavigate } from 'react-router-dom'; import { Dropdown, Menu } from 'antd'; import { useRecoilState, useRecoilValue } from 'recoil'; import { userState, initialState } from '@/store/user'; import { useI18n } from '@/store/i18n'; import locales from '../locales'; i...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UniversalLayout/components/RightTabNav.tsx
src/layouts/UniversalLayout/components/RightTabNav.tsx
import { memo, useCallback, useEffect, useMemo, useState, useRef } from 'react'; import { useLocation, useNavigate, Location } from 'react-router-dom'; import classnames from 'classnames'; import { Dropdown, Menu } from 'antd'; import { useRecoilValue, useRecoilState } from 'recoil'; import { globalState } from '@/sto...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UniversalLayout/components/LeftSider.tsx
src/layouts/UniversalLayout/components/LeftSider.tsx
import { memo } from 'react'; import { Link } from 'react-router-dom'; import classnames from 'classnames'; import logo from '@/assets/images/logo.png'; import SiderMenu from './SiderMenu'; import { IRouter } from '@/@types/router'; import { Theme } from '@/@types/settings'; export interface LeftSiderProps { menuD...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UniversalLayout/components/SiderMenu.tsx
src/layouts/UniversalLayout/components/SiderMenu.tsx
import { memo, useState, useMemo, useLayoutEffect } from 'react'; import { Menu } from 'antd'; import { unionWith } from 'lodash'; import { useRecoilValue } from 'recoil'; import { useI18n } from '@/store/i18n'; import locales from '../locales'; import { hasPermissionRoles } from '@/utils/router'; import { isExternal...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UniversalLayout/components/RightFooter.tsx
src/layouts/UniversalLayout/components/RightFooter.tsx
import { memo } from 'react'; export default memo(() => ( <div className='layout-right-footer'> <div>Copyright © 2020 liqingsong.cc, All Rights Reserved</div> </div> ));
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UniversalLayout/components/Settings/index.tsx
src/layouts/UniversalLayout/components/Settings/index.tsx
import { memo } from 'react'; import { Popover, Divider, Switch } from 'antd'; import classnames from 'classnames'; import { useRecoilState } from 'recoil'; import { globalState } from '@/store/global'; import IconSvg from '@/components/IconSvg'; import { Theme, NavMode } from '@/@types/settings'; import style from...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UniversalLayout/locales/en-US.ts
src/layouts/UniversalLayout/locales/en-US.ts
export default { 'universal-layout.topmenu.userinfo': 'Personal Info', 'universal-layout.topmenu.logout': 'Logout', 'universal-layout.menu.home': 'Home', 'universal-layout.menu.home.workplace': 'Workplace', 'universal-layout.menu.home.custom-breadcrumbs': 'Custom bread crumbs', 'universal-layout.menu.home....
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UniversalLayout/locales/zh-CN.ts
src/layouts/UniversalLayout/locales/zh-CN.ts
export default { 'universal-layout.topmenu.userinfo': '个人信息', 'universal-layout.topmenu.logout': '退出', 'universal-layout.menu.home': '首页', 'universal-layout.menu.home.workplace': '工作台', 'universal-layout.menu.home.custom-breadcrumbs': '自定义面包屑', 'universal-layout.menu.home.custom-breadcrumbs.liqingsong.cc':...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UniversalLayout/locales/index.ts
src/layouts/UniversalLayout/locales/index.ts
/** * UniversalLayout locale 入口 * @author LiQingSong */ import { I18n } from '@/@types/i18n.d'; import zhCN from './zh-CN'; import zhTW from './zh-TW'; import enUS from './en-US'; const locales: I18n = { 'zh-CN': zhCN, 'zh-TW': zhTW, 'en-US': enUS, }; export default locales;
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UniversalLayout/locales/zh-TW.ts
src/layouts/UniversalLayout/locales/zh-TW.ts
export default { 'universal-layout.topmenu.userinfo': '個人信息', 'universal-layout.topmenu.logout': '退出', 'universal-layout.menu.home': '首頁', 'universal-layout.menu.home.workplace': '工作臺', 'universal-layout.menu.home.custom-breadcrumbs': '自定義面包屑', 'universal-layout.menu.home.custom-breadcrumbs.liqingsong.cc':...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UserLayout/routes.ts
src/layouts/UserLayout/routes.ts
import { lazy } from 'react'; import { IRouter } from '@/@types/router'; const pathPre = '/user'; const UserLayoutRoutes: IRouter[] = [ { path: `${pathPre}/login`, meta: { title: 'user-layout.menu.login', }, component: lazy(() => import('@/pages/user/login')), }, { path: `${pathPre}/re...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UserLayout/index.tsx
src/layouts/UserLayout/index.tsx
import { memo, useMemo } from 'react'; import { /* Outlet, */ useLocation } from 'react-router-dom'; import { useRecoilValue } from 'recoil'; import { useI18n } from '@/store/i18n'; import locales from './locales'; import useTitle from '@/hooks/useTitle'; import SelectLang from '@/components/SelectLang'; import { f...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UserLayout/locales/en-US.ts
src/layouts/UserLayout/locales/en-US.ts
export default { 'user-layout.menu.login': 'Login', 'user-layout.menu.register': 'Register', };
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UserLayout/locales/zh-CN.ts
src/layouts/UserLayout/locales/zh-CN.ts
export default { 'user-layout.menu.login': '登录', 'user-layout.menu.register': '注册', };
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UserLayout/locales/index.ts
src/layouts/UserLayout/locales/index.ts
/** * UserLayout locale 入口 * @author LiQingSong */ import { I18n } from '@/@types/i18n.d'; import zhCN from './zh-CN'; import zhTW from './zh-TW'; import enUS from './en-US'; const locales: I18n = { 'zh-CN': zhCN, 'zh-TW': zhTW, 'en-US': enUS, }; export default locales;
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/layouts/UserLayout/locales/zh-TW.ts
src/layouts/UserLayout/locales/zh-TW.ts
export default { 'user-layout.menu.login': '登錄', 'user-layout.menu.register': '註冊', };
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/locales/en-US.ts
src/locales/en-US.ts
export default { 'app.empty': 'empty', 'app.global.menu.notfound': 'Not Found', 'app.global.form.validatefields.catch': 'The validation did not pass, please check the input', };
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/locales/zh-CN.ts
src/locales/zh-CN.ts
export default { 'app.empty': 'empty', 'app.global.menu.notfound': 'Not Found', 'app.global.form.validatefields.catch': '验证不通过,请检查输入', };
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/locales/index.ts
src/locales/index.ts
/** * 全局 locale 入口 * @author LiQingSong */ import { I18n } from '@/@types/i18n.d'; import zhCN from './zh-CN'; import zhTW from './zh-TW'; import enUS from './en-US'; const locales: I18n = { 'zh-CN': zhCN, 'zh-TW': zhTW, 'en-US': enUS, }; export default locales;
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/locales/zh-TW.ts
src/locales/zh-TW.ts
export default { 'app.empty': 'empty', 'app.global.menu.notfound': 'Not Found', 'app.global.form.validatefields.catch': '驗證不通過,請檢查輸入', };
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/config/routes.tsx
src/config/routes.tsx
/** * 路由配置 入口 * @author LiQingSong */ import React, { lazy, memo, Suspense } from 'react'; import { useLocation, useRoutes } from 'react-router-dom'; import { createUseRoutes, pathKeyCreateUseRoutes } from '@/utils/router'; import PageLoading from '@/components/PageLoading'; // BlankLayout import BlankLayout from...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/config/settings.ts
src/config/settings.ts
/** * 站点配置 * @author LiQingSong */ import { SettingsType } from '@/@types/settings.d'; const settings: SettingsType = { siteTitle: 'ADMIN-ANTD-REACT', siteTokenKey: 'admin_antd_react_token', ajaxHeadersTokenKey: 'x-token', ajaxResponseNoVerifyUrl: [ '/user/login', // 用户登录 '/user/info', // 获取用户信息 ...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/@types/router.d.ts
src/@types/router.d.ts
/** * 路由 ts定义 * @author LiQingSong */ import { Location, RouteObject } from 'react-router-dom'; /** * json path key RouteObject路由类型 */ export interface IPathKeyRouteObject { [path: string]: RouteObject; } /** * 面包屑类型 */ export interface BreadcrumbType { // 标题,路由在菜单、浏览器title 或 面包屑中展示的文字 title: string; /...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/@types/ckeditor.d.ts
src/@types/ckeditor.d.ts
declare module '@ckeditor/ckeditor5-react'; declare module '@ckeditor/ckeditor5-build-decoupled-document';
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/@types/assets.d.ts
src/@types/assets.d.ts
/** * 静态资源 ts定义 * @author LiQingSong */ declare module '*.avif' { export default src as string; } declare module '*.bmp' { export default src as string; } declare module '*.gif' { export default src as string; } declare module '*.jpg' { export default src as string; } declare module '*.jpeg' { export ...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/@types/env.d.ts
src/@types/env.d.ts
/** * 环境变量 ts定义 * @author LiQingSong */ /// <reference types="vite/client" /> // vite import.meta.env 变量 interface ImportMetaEnv { readonly VITE_APP_APIHOST: string; // api接口域名 // 更多环境变量... } // vite import.meta.env 变量 interface ImportMeta { readonly env: ImportMetaEnv; }
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/@types/i18n.d.ts
src/@types/i18n.d.ts
export type I18nKey = 'zh-CN' | 'zh-TW' | 'en-US'; export interface I18nVal { [key: string]: string; } export type I18n = { [key in I18nKey]?: I18nVal; };
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
lqsong/admin-antd-react
https://github.com/lqsong/admin-antd-react/blob/623f3ab581c639295a3cc7025bb47cd1613d90bf/src/@types/settings.d.ts
src/@types/settings.d.ts
/** * 站点配置 ts定义 * @author LiQingSong */ export type Theme = 'dark' | 'light'; export type NavMode = 'inline' | 'horizontal'; export interface SettingsType { /** * 站点名称 */ siteTitle: string; /** * 站点本地存储Token 的 Key值 */ siteTokenKey: string; /** * Ajax请求头发送Token 的 Key值 */ ajaxHeaders...
typescript
MIT
623f3ab581c639295a3cc7025bb47cd1613d90bf
2026-01-05T05:01:27.968222Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/index.tsx
app/src/index.tsx
import * as React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import Screen from './screens'; import store from './modules'; import { Provider } from 'react-redux'; import { resizeBasedOnContent } from 'utils/electron'; import AppDrag from './components/AppDrag'; resizeBasedOnContent(); Reac...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/setupTests.tsx
app/src/setupTests.tsx
// jest-dom adds custom jest matchers for asserting on DOM nodes. // allows you to do things like: // expect(element).toHaveTextContent(/react/i) // learn more: https://github.com/testing-library/jest-dom import '@testing-library/jest-dom/extend-expect';
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/react-app-env.d.ts
app/src/react-app-env.d.ts
/// <reference types="react-scripts" />
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/hooks/useShortcuts.tsx
app/src/hooks/useShortcuts.tsx
import * as React from 'react'; import focusOn, { focusOnTodoWithIndex } from 'utils/focusOn'; import keyCodes from 'utils/keyCodes'; import useEventListener from 'hooks/useEventListener'; import { hideApp, taskSwitchSubscribe } from 'utils/electron'; import { openBookmark } from 'utils/bookmarks'; import useSelector ...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/hooks/useTheme.tsx
app/src/hooks/useTheme.tsx
import * as React from 'react'; import useSelector from 'hooks/useSelector'; import { getTheme } from 'modules/selectors'; export default function useTheme() { const theme = useSelector(getTheme); React.useEffect( () => document.documentElement.setAttribute('data-theme', theme), [theme], ); }
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/hooks/useDragAndDropFiles.tsx
app/src/hooks/useDragAndDropFiles.tsx
import * as React from 'react'; import useEventListener from 'hooks/useEventListener'; import { newBookmarkBatch } from 'modules/task'; import useDispatch from 'hooks/useDispatch'; import { map } from 'lodash'; export default function useDragAndDropFiles() { const dispatch = useDispatch(); const [isDraging, setIs...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/hooks/useSelector.tsx
app/src/hooks/useSelector.tsx
import { useSelector, TypedUseSelectorHook } from 'react-redux'; import { IStoreState } from 'modules'; const useTypedSelector: TypedUseSelectorHook<IStoreState> = useSelector; export default useTypedSelector;
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/hooks/useDispatch.tsx
app/src/hooks/useDispatch.tsx
import { useDispatch } from 'react-redux'; export default useDispatch;
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/hooks/useEventListener.tsx
app/src/hooks/useEventListener.tsx
import { useRef, useEffect } from 'react'; interface IKeyDownEvent { target: Element; metaKey: boolean; shiftKey: boolean; keyCode: number; preventDefault: () => void; } type IHandle = (e: IKeyDownEvent) => void; // NOTE(rstankov): Taken from https://usehooks.com/useEventListener/ export default function u...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Title/index.tsx
app/src/components/Title/index.tsx
import * as React from 'react'; import styles from './styles.module.css'; interface IProps { title: string; } export default function Title({ title }: IProps) { return <div className={styles.title}>{title}</div>; }
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Table/index.tsx
app/src/components/Table/index.tsx
import * as React from 'react'; import styles from './styles.module.css'; interface IProps { children: React.ReactNode; } export default function Table({ children }: IProps) { return ( <table className={styles.table}> <tbody>{children}</tbody> </table> ); } Table.Row = ({ children, descriptio...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/AppDrag/index.tsx
app/src/components/AppDrag/index.tsx
import * as React from 'react'; import styles from './styles.module.css'; export default function AppDrag() { return <div className={styles.drag} />; }
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/ExternalLink/index.tsx
app/src/components/ExternalLink/index.tsx
import * as React from 'react'; import { openURI } from 'utils/electron'; interface IProps { children: React.ReactNode; href: string; className?: string; title?: string; } export default function ExternalLink({ children, ...props }: IProps) { return ( <a target="_blank" rel="noopener norefer...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Sortable/index.tsx
app/src/components/Sortable/index.tsx
import * as React from 'react'; import { sortableContainer, sortableElement, sortableHandle, } from './SortableHOC'; import Stack from 'components/Stack'; import { ReactComponent as DragIcon } from 'icons/drag.svg'; import styles from './styles.module.css'; import classNames from 'classnames'; const Handle = sor...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Sortable/SortableHOC/Sorter.ts
app/src/components/Sortable/SortableHOC/Sorter.ts
import { cloneNode, getScrollingParent, getContainerGridGap, getEdgeOffset, getElementMargin, getPosition, setStyle, setTransitionDuration, setTranslate3d, addEventListener, removeEventListener, IBrowserEvent, } from './utils'; import { ISortableElement, IAxis, IPosition, IBounds, IOf...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Sortable/SortableHOC/utils.ts
app/src/components/Sortable/SortableHOC/utils.ts
import { IPosition, IOffset } from './types'; export interface IBrowserEvent { button: number; target: HTMLElement; touches: { pageX: number; pageY: number }[]; changedTouches: { pageX: number; pageY: number }[]; pageY: number; pageX: number; preventDefault?: () => void; } const EVENTS = { start: ['to...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Sortable/SortableHOC/Manager.ts
app/src/components/Sortable/SortableHOC/Manager.ts
import { ISortableElement } from './types'; interface IRef { el: ISortableElement; } export default class Manager { _items: IRef[] = []; cache: IRef[] | null = null; add(ref: IRef) { this._items.push(ref); } remove(ref: IRef) { const index = this._items.indexOf(ref); if (index !== -1) { ...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Sortable/SortableHOC/reorderArray.ts
app/src/components/Sortable/SortableHOC/reorderArray.ts
import { ISortChange } from './types'; export default function reorderArray<T = any>( array: T[], { oldIndex, newIndex }: ISortChange, ): T[] { const newArray = [...array]; const item = newArray[oldIndex]; newArray.splice(oldIndex, 1); newArray.splice(newIndex, 0, item); return newArray; }
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Sortable/SortableHOC/AutoScroller.ts
app/src/components/Sortable/SortableHOC/AutoScroller.ts
import { IPosition, IOffset } from './types'; interface IAutoScrollerOptions { container: HTMLElement; onScroll: (offset: IOffset) => void; width: number; height: number; minTranslate: IPosition; maxTranslate: IPosition; } export default class AutoScroller { container: HTMLElement; onScroll: (offset: ...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Sortable/SortableHOC/Container.tsx
app/src/components/Sortable/SortableHOC/Container.tsx
import * as React from 'react'; import Manager from './Manager'; import { isSortableHandle } from './Handle'; import Sorter from './Sorter'; import ManagerContext from './context'; import { closest, displayName, addEventListener, removeEventListener, shouldCancelStart, IBrowserEvent, } from './utils'; imp...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Sortable/SortableHOC/types.ts
app/src/components/Sortable/SortableHOC/types.ts
export type ISortableElement = HTMLElement & { sortableInfo: { index: number }; bounds?: IBounds | null; }; export type IAxis = 'x' | 'y' | 'xy'; export type IPosition = { x: number; y: number; }; export type IOffset = { left: number; top: number; }; export type IBounds = { width: number; height: nu...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Sortable/SortableHOC/context.ts
app/src/components/Sortable/SortableHOC/context.ts
import * as React from 'react'; import Manager from './Manager'; export default React.createContext<Manager | null>(null);
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Sortable/SortableHOC/Element.tsx
app/src/components/Sortable/SortableHOC/Element.tsx
import * as React from 'react'; import { displayName } from './utils'; import ManagerContext from './context'; import { ISortableElement } from './types'; interface IProps { index: number; } export default function sortableElement<T>( build: (props: T, ref: any) => React.ReactElement, ) { const Component = (Rea...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Sortable/SortableHOC/index.ts
app/src/components/Sortable/SortableHOC/index.ts
export { default as sortableContainer } from './Container'; export { default as sortableElement } from './Element'; export { default as sortableHandle } from './Handle'; export { default as reorderArray } from './reorderArray';
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Sortable/SortableHOC/Handle.tsx
app/src/components/Sortable/SortableHOC/Handle.tsx
import * as React from 'react'; import { displayName } from './utils'; export default function sortableHandle<T>( build: (props: T, ref: any) => React.ReactElement, ) { const Component = (React.forwardRef(build) as any) as React.FC<T>; function WithSortableHandle(props: T) { return <Component ref={setSortab...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Section/index.tsx
app/src/components/Section/index.tsx
import * as React from 'react'; import Stack from 'components/Stack'; import styles from './styles.module.css'; interface IProps { title: string; emoji: string; actions?: React.ReactNode; children: React.ReactNode; } export default function Section({ title, emoji, children }: IProps) { return ( <div> ...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Stack/index.tsx
app/src/components/Stack/index.tsx
import * as React from 'react'; import classNames from 'classnames'; import styles from './styles.module.css'; interface ISubProps { children: React.ReactNode; className?: string; align?: 'start' | 'center' | 'end'; justify?: 'start' | 'center' | 'end'; gap?: 's' | 'm' | 'l' | 'xl'; onClick?: (e: React.Mou...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/BackButton/index.tsx
app/src/components/BackButton/index.tsx
import * as React from 'react'; import useDispatch from 'hooks/useDispatch'; import styles from './styles.module.css'; import { ReactComponent as CloseIcon } from 'icons/close.svg'; import { openTask } from 'modules/selectedScreen'; export default function BackButton() { const dispatch = useDispatch(); return ( ...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Input/index.tsx
app/src/components/Input/index.tsx
import * as React from 'react'; import styles from './styles.module.css'; import Textarea from './Textarea'; import keyCodes from 'utils/keyCodes'; import classNames from 'classnames'; import { renderText, IRenderer } from './utils'; interface IProps { id?: string; value: string; onChange: (value: string) => voi...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Input/Textarea.tsx
app/src/components/Input/Textarea.tsx
import * as React from 'react'; import autosize from 'autosize'; import { Omit } from 'utility-types'; import classNames from 'classnames'; import styles from './styles.module.css'; interface IKeyDownEvent { target: HTMLInputElement | HTMLTextAreaElement; metaKey: boolean; keyCode: number; shiftKey: boolean; ...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Input/utils.tsx
app/src/components/Input/utils.tsx
import * as React from 'react'; import { bookmarkTitle } from 'utils/bookmarks'; function hasMarkdown(text: string) { return text.includes('**'); } //eslint-disable-next-line no-useless-escape const BOLD_REGEX = /(\*\*[^\*]+\*\*)/gi; function applyMarkdown(text: string) { return text .split(BOLD_REGEX) ....
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/Button/index.tsx
app/src/components/Button/index.tsx
import * as React from 'react'; import styles from './styles.module.css'; interface IProps { onClick: () => void; title?: string; children: React.ReactNode; } export default function Button(props: IProps) { return <button className={styles.button} {...props} />; }
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/AppMenu/index.tsx
app/src/components/AppMenu/index.tsx
import * as React from 'react'; import store from 'modules'; import { ReactComponent as PreferencesIcon } from 'icons/preferences.svg'; import styles from './styles.module.css'; import { removeCompletedTodos } from 'modules/task'; import { newTask, deleteTask } from 'modules/actions'; import { getSelectedTask, getAllTa...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/components/AddButton/index.tsx
app/src/components/AddButton/index.tsx
import * as React from 'react'; import styles from './styles.module.css'; interface IProps { onClick: () => void; subject: string; } export default function AddButton({ onClick, subject }: IProps) { return ( <div className={styles.button} onClick={onClick}> Click to add {subject} </div> ); }
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/utils/isURI.test.ts
app/src/utils/isURI.test.ts
import isURI from './isURI'; describe(isURI.name, () => { it('handles web urls', () => { expect(isURI('https://rstankov.com')).toEqual(true); expect(isURI('https://rstankov.com/about')).toEqual(true); expect(isURI('https://blog.rstankov.com/about')).toEqual(true); }); it('handles localhost', () => {...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/utils/focusOn.tsx
app/src/utils/focusOn.tsx
export default function focusOn(id: string) { document.getElementById(id)?.click(); } export function focusOnTodoWithIndex(index: number) { focusOn(`todo-text-${index}`); } export function focusOnBookmarkWithIndex(index: number) { focusOn(`bookmark-${index}`); }
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/utils/keyCodes.tsx
app/src/utils/keyCodes.tsx
export default { esc: 27, backspace: 8, enter: 13, up: 38, down: 40, left: 37, right: 39, tab: 9, '[': 219, ']': 221, '/': 191, e: 69, h: 72, c: 67, t: 84, b: 66, n: 78, z: 90, '0': 48, '1': 49, '2': 50, '3': 51, '4': 52, '5': 53, '6': 54, '7': 55, '8': 56, '9': 5...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/utils/bookmarks.ts
app/src/utils/bookmarks.ts
import { openURI } from 'utils/electron'; import isURI from 'utils/isURI'; import { last } from 'lodash'; interface IBookmark { uri: string; } export function openBookmark(bookmark?: IBookmark) { if (!bookmark) { return; } const uri = bookmarkUri(bookmark); if (uri) { openURI(uri); } } const FI...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/utils/stateRestore.tsx
app/src/utils/stateRestore.tsx
import storage from 'utils/storage'; import generateId from 'utils/generateId'; import { getSelectedTask } from 'modules/selectors'; export const VERSION = 3; export function preloadStore() { const version = storage.get('reduxStoreVersion', 1); const store = storage.get('reduxStore'); if (!store) { return ...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/utils/generateId.ts
app/src/utils/generateId.ts
import { uniqueId } from 'lodash'; export default function generateId(name: string) { return uniqueId(`${name}-`) + +new Date(); }
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/utils/storage.tsx
app/src/utils/storage.tsx
export default { get(key: string, defaultValue: any = undefined): any { const value = window.localStorage.getItem(key); if (value) { return JSON.parse(value); } return defaultValue; }, set(key: string, value: any) { window.localStorage.setItem(key, JSON.stringify(value)); }, };
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/utils/bookmarks.test.ts
app/src/utils/bookmarks.test.ts
import { bookmarkUri, bookmarkTitle } from './bookmarks'; describe(bookmarkUri.name, () => { it('returns null when invalid url', () => { expect(bookmarkUri({ uri: '' })).toEqual(null); expect(bookmarkUri({ uri: 'invalid' })).toEqual(null); }); it('returns URI when valid', () => { expect(bookmarkUri(...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/utils/isURI.tsx
app/src/utils/isURI.tsx
const IS_URL = /^https?:\/\/[^ ]+\.[^ ]+$/; const IS_LOCALHOST = /^https?:\/\/localhost.*$/; const IS_FILE_PATH = /^\/.*$/; const IS_X_CALLBACK = /^[a-z]+:\/\/x-callback-url\/.*$/; const MATCHERS = [IS_URL, IS_LOCALHOST, IS_X_CALLBACK, IS_FILE_PATH]; export default function isURI(uri: string) { return !!uri && !!MA...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/utils/electron/index.tsx
app/src/utils/electron/index.tsx
import electron from './shim'; import { IStoreState } from 'modules'; import { exportTask, importTask } from 'utils/stateRestore'; import isURI, { isFilePathUri } from 'utils/isURI'; import { getTitle } from 'modules/selectors'; export const isElectron = !!electron; export function closeApp() { if (!isElectron) { ...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/utils/electron/shim.tsx
app/src/utils/electron/shim.tsx
let electron: any = null; if (window.require) { electron = window.require('electron'); } export default electron;
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/screens/index.tsx
app/src/screens/index.tsx
import * as React from 'react'; import useSelector from 'hooks/useSelector'; import { getSelectedScreen } from 'modules/selectors'; import { Screens, IScreens } from './screens'; import useShortcuts from 'hooks/useShortcuts'; import useTheme from 'hooks/useTheme'; export default function App() { useTheme(); useSho...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/screens/screens.tsx
app/src/screens/screens.tsx
import about from './about'; import changelog from './changelog'; import preferences from './preferences'; import shortcuts from './shortcuts'; import task from './task'; export const Screens = { about, changelog, preferences, shortcuts, task, }; export type IScreens = keyof typeof Screens
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/screens/shortcuts/index.tsx
app/src/screens/shortcuts/index.tsx
import * as React from 'react'; import Section from 'components/Section'; import Stack from 'components/Stack'; import styles from './styles.module.css'; import BackButton from 'components/BackButton'; import Title from 'components/Title'; import keyCodes from 'utils/keyCodes'; import { updateGlobalShortcutKey, getGlob...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/screens/about/index.tsx
app/src/screens/about/index.tsx
import * as React from 'react'; import Stack from 'components/Stack'; import BackButton from 'components/BackButton'; import styles from './styles.module.css'; import ExternalLink from 'components/ExternalLink'; import logo from 'icons/logo.png'; import { appVersion } from 'utils/electron'; import { autoUpdateRequest }...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/screens/about/AutoUpdateStatus.tsx
app/src/screens/about/AutoUpdateStatus.tsx
import * as React from 'react'; import styles from './styles.module.css'; import { autoUpdateSubscribe } from 'utils/electron'; export default function AutoUpdateStatus() { const status = useAutoUpdateStatus(); if (!status) { return null; } return <span className={styles.autoupdate}>{status}</span>; } f...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/screens/about/TextButton.tsx
app/src/screens/about/TextButton.tsx
import * as React from 'react'; import styles from './styles.module.css'; interface IProps { onClick: () => void; children: React.ReactNode; } export default function TextButton({ onClick, children }: IProps) { return ( <span className={styles.button} onClick={e => { e.preventDefault(); ...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/screens/preferences/index.tsx
app/src/screens/preferences/index.tsx
import * as React from 'react'; import Section from 'components/Section'; import Stack from 'components/Stack'; import styles from './styles.module.css'; import BackButton from 'components/BackButton'; import Title from 'components/Title'; import useSelector from 'hooks/useSelector'; import useDispatch from 'hooks/useD...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/screens/task/index.tsx
app/src/screens/task/index.tsx
import * as React from 'react'; import Section from 'components/Section'; import Stack from 'components/Stack'; import TaskTitle from './Title'; import TaskTodos from './Todos'; import TaskBookmarks from './Bookmarks'; import TaskNote from './Note'; import AppMenu from 'components/AppMenu'; import useDragAndDropFiles f...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/screens/task/Todos/index.tsx
app/src/screens/task/Todos/index.tsx
import * as React from 'react'; import Input from 'components/Input'; import Sortable from 'components/Sortable'; import Stack from 'components/Stack'; import { focusOnTodoWithIndex } from 'utils/focusOn'; import keyCodes from 'utils/keyCodes'; import styles from './styles.module.css'; import useDispatch from 'hooks/us...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false
RStankov/FocusedTask
https://github.com/RStankov/FocusedTask/blob/2532371d6b6a3d097cd8e23588c7786390b4e268/app/src/screens/task/Todos/Checkbox/index.tsx
app/src/screens/task/Todos/Checkbox/index.tsx
import * as React from 'react'; import styles from './styles.module.css'; interface IProps { isChecked: boolean; onClick: () => void; } export default function TodoCheckbox({ isChecked, onClick }: IProps) { function handleClick(e: React.SyntheticEvent<any>) { e.stopPropagation(); onClick(); } if (i...
typescript
MIT
2532371d6b6a3d097cd8e23588c7786390b4e268
2026-01-05T05:01:29.805825Z
false