mirror of
https://github.com/DustinBrett/daedalOS.git
synced 2025-12-06 00:20:05 +01:00
Yet even more eslint rules
This commit is contained in:
parent
7709139e63
commit
e1b584ba47
|
|
@ -10,8 +10,10 @@
|
|||
"plugin:jest/recommended",
|
||||
"plugin:jsx-a11y/recommended",
|
||||
"plugin:playwright/recommended",
|
||||
"plugin:promise/recommended",
|
||||
"plugin:react/recommended",
|
||||
"plugin:react/jsx-runtime",
|
||||
"plugin:regexp/recommended",
|
||||
"plugin:sonarjs/recommended",
|
||||
"plugin:typescript-sort-keys/recommended",
|
||||
"plugin:unicorn/recommended",
|
||||
|
|
@ -27,8 +29,10 @@
|
|||
"import",
|
||||
"jest",
|
||||
"prettier",
|
||||
"promise",
|
||||
"react",
|
||||
"react-hooks-addons",
|
||||
"regexp",
|
||||
"sonarjs",
|
||||
"sort-keys-fix",
|
||||
"typescript-sort-keys",
|
||||
|
|
@ -40,7 +44,7 @@
|
|||
"@typescript-eslint/consistent-type-definitions": "off",
|
||||
"@typescript-eslint/consistent-type-imports": [
|
||||
"error",
|
||||
{ "prefer": "type-imports" }
|
||||
{ "fixStyle": "inline-type-imports", "prefer": "type-imports" }
|
||||
],
|
||||
"@typescript-eslint/explicit-function-return-type": [
|
||||
"error",
|
||||
|
|
@ -75,6 +79,7 @@
|
|||
"camelcase": "off",
|
||||
"class-methods-use-this": "off",
|
||||
"curly": "error",
|
||||
"import/consistent-type-specifier-style": ["error", "prefer-inline"],
|
||||
"import/extensions": [
|
||||
"error",
|
||||
"ignorePackages",
|
||||
|
|
@ -83,11 +88,12 @@
|
|||
"import/first": "error",
|
||||
"import/newline-after-import": "error",
|
||||
"import/no-cycle": "off",
|
||||
"import/no-duplicates": "error",
|
||||
"import/no-duplicates": ["error", { "prefer-inline": true }],
|
||||
"import/no-extraneous-dependencies": [
|
||||
"error",
|
||||
{ "devDependencies": ["*.config.ts", "e2e/**", "__tests__/**"] }
|
||||
],
|
||||
"import/order": ["error", { "newlines-between": "never" }],
|
||||
"import/prefer-default-export": "off",
|
||||
"jsx-a11y/label-has-associated-control": [
|
||||
"error",
|
||||
|
|
@ -116,6 +122,11 @@
|
|||
"playwright/expect-expect": "off",
|
||||
"playwright/no-conditional-in-test": "off",
|
||||
"playwright/no-skipped-test": "off",
|
||||
"promise/always-return": "off",
|
||||
"promise/catch-or-return": "off",
|
||||
"promise/no-nesting": "off",
|
||||
"promise/no-callback-in-promise": "off",
|
||||
"promise/no-promise-in-callback": "off",
|
||||
"react/function-component-definition": [
|
||||
"error",
|
||||
{ "namedComponents": "arrow-function" }
|
||||
|
|
@ -137,6 +148,10 @@
|
|||
"react/require-default-props": "off",
|
||||
"react/require-optimization": "error",
|
||||
"react-hooks-addons/no-unused-deps": "warn",
|
||||
"regexp/no-unused-capturing-group": "error",
|
||||
"regexp/no-useless-assertions": "error",
|
||||
"regexp/no-useless-flag": "error",
|
||||
"regexp/strict": "error",
|
||||
"sonarjs/cognitive-complexity": "off",
|
||||
"sonarjs/no-nested-template-literals": "off",
|
||||
"sort-keys-fix/sort-keys-fix": "error",
|
||||
|
|
@ -155,6 +170,7 @@
|
|||
"unicorn/no-array-for-each": "off",
|
||||
"unicorn/no-array-reduce": "off",
|
||||
"unicorn/no-await-expression-member": "off",
|
||||
"unicorn/no-unused-properties": "error",
|
||||
"unicorn/numeric-separators-style": "off",
|
||||
"unicorn/prefer-at": "off",
|
||||
"unicorn/prefer-node-protocol": "off",
|
||||
|
|
|
|||
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
|
@ -1,8 +1,7 @@
|
|||
{
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.addMissingImports": "always",
|
||||
"source.fixAll": "always",
|
||||
"source.organizeImports": "always"
|
||||
"source.fixAll": "always"
|
||||
},
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import StyledBoxedWine from "components/apps/BoxedWine/StyledBoxedWine";
|
||||
import useBoxedWine from "components/apps/BoxedWine/useBoxedWine";
|
||||
import AppContainer from "components/system/Apps/AppContainer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { haltEvent } from "utils/functions";
|
||||
|
||||
const BoxedWine: FC<ComponentProcessProps> = ({ id }) => (
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { basename } from "path";
|
||||
import { useCallback, useEffect, useRef } from "react";
|
||||
import { type Unzipped } from "fflate";
|
||||
import { getConfig } from "components/apps/BoxedWine/config";
|
||||
import type { ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { type ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import useEmscriptenMount from "components/system/Files/FileManager/useEmscriptenMount";
|
||||
import useTitle from "components/system/Window/useTitle";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import type { EmscriptenFS } from "contexts/fileSystem/useAsyncFs";
|
||||
import { type EmscriptenFS } from "contexts/fileSystem/useAsyncFs";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import type { Unzipped } from "fflate";
|
||||
import { basename } from "path";
|
||||
import { useCallback, useEffect, useRef } from "react";
|
||||
import { getExtension, isCanvasDrawn, loadFiles } from "utils/functions";
|
||||
|
||||
declare global {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { Arrow, Refresh, Stop } from "components/apps/Browser/NavigationIcons";
|
||||
import StyledBrowser from "components/apps/Browser/StyledBrowser";
|
||||
import { HOME_PAGE, bookmarks } from "components/apps/Browser/config";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import useTitle from "components/system/Window/useTitle";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import processDirectory from "contexts/process/directory";
|
||||
import useHistory from "hooks/useHistory";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import Button from "styles/common/Button";
|
||||
import Icon from "styles/common/Icon";
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import StyledClassiCube from "components/apps/ClassiCube/StyledClassiCube";
|
||||
import useClassiCube from "components/apps/ClassiCube/useClassiCube";
|
||||
import AppContainer from "components/system/Apps/AppContainer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { haltEvent } from "utils/functions";
|
||||
|
||||
const ClassiCube: FC<ComponentProcessProps> = ({ id }) => (
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import type { ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { useTheme } from "styled-components";
|
||||
import { useCallback, useEffect } from "react";
|
||||
import { type ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import useEmscriptenMount from "components/system/Files/FileManager/useEmscriptenMount";
|
||||
import type { EmscriptenFS } from "contexts/fileSystem/useAsyncFs";
|
||||
import { type EmscriptenFS } from "contexts/fileSystem/useAsyncFs";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { useSession } from "contexts/session";
|
||||
import { useCallback, useEffect } from "react";
|
||||
import { useTheme } from "styled-components";
|
||||
import { TRANSITIONS_IN_MILLISECONDS } from "utils/constants";
|
||||
import { loadFiles, pxToNum } from "utils/functions";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import StyledDXBall from "components/apps/DX-Ball/StyledDXBall";
|
||||
import useDXBall from "components/apps/DX-Ball/useDXBall";
|
||||
import AppContainer from "components/system/Apps/AppContainer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { haltEvent } from "utils/functions";
|
||||
|
||||
const DXBall: FC<ComponentProcessProps> = ({ id }) => (
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { DX_BALL_GLOBALS, SAVE_PATH } from "components/apps/DX-Ball/constants";
|
||||
import type { ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { basename, dirname } from "path";
|
||||
import { useEffect, useRef } from "react";
|
||||
import { DX_BALL_GLOBALS, SAVE_PATH } from "components/apps/DX-Ball/constants";
|
||||
import { type ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { TRANSITIONS_IN_MILLISECONDS } from "utils/constants";
|
||||
import { loadFiles } from "utils/functions";
|
||||
import { cleanUpGlobals } from "utils/globals";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import StyledDevTools from "components/apps/DevTools/StyledDevTools";
|
||||
import useEruda from "components/apps/DevTools/useEruda";
|
||||
import AppContainer from "components/system/Apps/AppContainer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
|
||||
const DevTools: FC<ComponentProcessProps> = ({ id }) => (
|
||||
<AppContainer StyledComponent={StyledDevTools} id={id} useHook={useEruda}>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import type { ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import type Eruda from "eruda";
|
||||
import type { InitOptions } from "eruda";
|
||||
import { useEffect } from "react";
|
||||
import { type default as Eruda, type InitOptions } from "eruda";
|
||||
import { type ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { loadFiles, viewWidth } from "utils/functions";
|
||||
|
||||
declare global {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import StyledEmulator from "components/apps/Emulator/StyledEmulator";
|
||||
import useEmulator from "components/apps/Emulator/useEmulator";
|
||||
import AppContainer from "components/system/Apps/AppContainer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
|
||||
const Emulator: FC<ComponentProcessProps> = ({ id }) => (
|
||||
<AppContainer StyledComponent={StyledEmulator} id={id} useHook={useEmulator}>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
import type { Core } from "components/apps/Emulator/config";
|
||||
import { emulatorCores } from "components/apps/Emulator/config";
|
||||
import type { Emulator } from "components/apps/Emulator/types";
|
||||
import type { ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { basename, dirname, extname, join } from "path";
|
||||
import { useCallback, useEffect, useRef } from "react";
|
||||
import { type Core, emulatorCores } from "components/apps/Emulator/config";
|
||||
import { type Emulator } from "components/apps/Emulator/types";
|
||||
import { type ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import useEmscriptenMount from "components/system/Files/FileManager/useEmscriptenMount";
|
||||
import useTitle from "components/system/Window/useTitle";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import type { EmscriptenFS } from "contexts/fileSystem/useAsyncFs";
|
||||
import { type EmscriptenFS } from "contexts/fileSystem/useAsyncFs";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { basename, dirname, extname, join } from "path";
|
||||
import { useCallback, useEffect, useRef } from "react";
|
||||
import { ICON_CACHE, ICON_CACHE_EXTENSION, SAVE_PATH } from "utils/constants";
|
||||
import { bufferToUrl, getExtension, loadFiles } from "utils/functions";
|
||||
import { zipAsync } from "utils/zipFunctions";
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { basename } from "path";
|
||||
import { forwardRef, useEffect, useState } from "react";
|
||||
import { Refresh } from "components/apps/FileExplorer/NavigationIcons";
|
||||
import StyledAddressBar from "components/apps/FileExplorer/StyledAddressBar";
|
||||
import useAddressBarContextMenu from "components/apps/FileExplorer/useAddressBarContextMenu";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { basename } from "path";
|
||||
import { forwardRef, useEffect, useState } from "react";
|
||||
import Button from "styles/common/Button";
|
||||
import Icon from "styles/common/Icon";
|
||||
import { ROOT_NAME } from "utils/constants";
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import { basename, dirname } from "path";
|
||||
import { forwardRef, useMemo } from "react";
|
||||
import AddressBar from "components/apps/FileExplorer/AddressBar";
|
||||
import {
|
||||
Back,
|
||||
|
|
@ -11,8 +13,6 @@ import useTitlebarContextMenu from "components/system/Window/Titlebar/useTitleba
|
|||
import { useMenu } from "contexts/menu";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import useHistory from "hooks/useHistory";
|
||||
import { basename, dirname } from "path";
|
||||
import { forwardRef, useMemo } from "react";
|
||||
import Button from "styles/common/Button";
|
||||
import { ROOT_NAME } from "utils/constants";
|
||||
import { haltEvent, label } from "utils/functions";
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { basename } from "path";
|
||||
import { memo, useEffect, useRef, useState } from "react";
|
||||
import { Search } from "components/apps/FileExplorer/NavigationIcons";
|
||||
import StyledSearch from "components/apps/FileExplorer/StyledSearch";
|
||||
import { getResultInfo } from "components/system/Taskbar/Search/functions";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useMenu } from "contexts/menu";
|
||||
import type { MenuItem } from "contexts/menu/useMenuContextState";
|
||||
import { type MenuItem } from "contexts/menu/useMenuContextState";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { useSession } from "contexts/session";
|
||||
import { basename } from "path";
|
||||
import { memo, useEffect, useRef, useState } from "react";
|
||||
import { SHORTCUT_EXTENSION } from "utils/constants";
|
||||
import { preloadLibs } from "utils/functions";
|
||||
import { SEARCH_LIBS, useSearch } from "utils/search";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import styled from "styled-components";
|
||||
import StyledLoading from "components/system/Files/FileManager/StyledLoading";
|
||||
import StyledFileEntry from "components/system/Files/Views/Icon/StyledFileEntry";
|
||||
import StyledFileManager from "components/system/Files/Views/Icon/StyledFileManager";
|
||||
import styled from "styled-components";
|
||||
|
||||
const StyledFileExplorer = styled.div`
|
||||
${StyledFileManager} {
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { basename } from "path";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import Navigation from "components/apps/FileExplorer/Navigation";
|
||||
import StyledFileExplorer from "components/apps/FileExplorer/StyledFileExplorer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { getIconFromIni } from "components/system/Files/FileEntry/functions";
|
||||
import FileManager from "components/system/Files/FileManager";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { getMountUrl, isMountedFolder } from "contexts/fileSystem/functions";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { basename } from "path";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import {
|
||||
COMPRESSED_FOLDER_ICON,
|
||||
FOLDER_ICON,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useMenu } from "contexts/menu";
|
||||
import type { ContextMenuCapture } from "contexts/menu/useMenuContextState";
|
||||
import { useMemo } from "react";
|
||||
import { useMenu } from "contexts/menu";
|
||||
import { type ContextMenuCapture } from "contexts/menu/useMenuContextState";
|
||||
|
||||
const useAddressBarContextMenu = (address: string): ContextMenuCapture => {
|
||||
const { contextMenu } = useMenu();
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { useEffect, useRef, useState } from "react";
|
||||
import { getNetworkConfig } from "components/apps/IRC/config";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import StyledLoading from "components/system/Files/FileManager/StyledLoading";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import processDirectory from "contexts/process/directory";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { IFRAME_CONFIG } from "utils/constants";
|
||||
|
||||
type KiwiIrcClient = {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type {
|
||||
DosOptions,
|
||||
EmulatorFunction,
|
||||
import {
|
||||
type DosOptions,
|
||||
type EmulatorFunction,
|
||||
} from "emulators-ui/dist/types/js-dos";
|
||||
|
||||
export const dosOptions: DosOptions = {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import StyledJSDOS from "components/apps/JSDOS/StyledJSDOS";
|
||||
import useJSDOS from "components/apps/JSDOS/useJSDOS";
|
||||
import AppContainer from "components/system/Apps/AppContainer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
|
||||
const JSDOS: FC<ComponentProcessProps> = ({ id }) => (
|
||||
<AppContainer StyledComponent={StyledJSDOS} id={id} useHook={useJSDOS} />
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { EmscriptenFS } from "contexts/fileSystem/useAsyncFs";
|
||||
import type { DosFactoryType } from "emulators-ui/dist/types/js-dos";
|
||||
import { type DosFactoryType } from "emulators-ui/dist/types/js-dos";
|
||||
import { type EmscriptenFS } from "contexts/fileSystem/useAsyncFs";
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,7 @@
|
|||
import { basename, dirname, join } from "path";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { type DosInstance } from "emulators-ui/dist/types/js-dos";
|
||||
import { type CommandInterface } from "emulators";
|
||||
import {
|
||||
globals,
|
||||
saveExtension,
|
||||
|
|
@ -6,10 +10,6 @@ import {
|
|||
import useTitle from "components/system/Window/useTitle";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import type { CommandInterface } from "emulators";
|
||||
import type { DosInstance } from "emulators-ui/dist/types/js-dos";
|
||||
import { basename, dirname, join } from "path";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import {
|
||||
ICON_CACHE,
|
||||
ICON_CACHE_EXTENSION,
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
||||
import { type DosInstance } from "emulators-ui/dist/types/js-dos";
|
||||
import {
|
||||
CAPTURED_KEYS,
|
||||
dosOptions,
|
||||
pathPrefix,
|
||||
} from "components/apps/JSDOS/config";
|
||||
import useDosCI from "components/apps/JSDOS/useDosCI";
|
||||
import type { ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { type ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import useEmscriptenMount from "components/system/Files/FileManager/useEmscriptenMount";
|
||||
import useWindowSize from "components/system/Window/useWindowSize";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { useSession } from "contexts/session";
|
||||
import type { DosInstance } from "emulators-ui/dist/types/js-dos";
|
||||
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
||||
import { PREVENT_SCROLL } from "utils/constants";
|
||||
import { loadFiles, pxToNum } from "utils/functions";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import StyledMarked from "components/apps/Marked/StyledMarked";
|
||||
import useMarked from "components/apps/Marked/useMarked";
|
||||
import AppContainer from "components/system/Apps/AppContainer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
|
||||
const Marked: FC<ComponentProcessProps> = ({ id }) => (
|
||||
<AppContainer StyledComponent={StyledMarked} id={id} useHook={useMarked}>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import type { ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { basename } from "path";
|
||||
import { useCallback, useEffect } from "react";
|
||||
import { type ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import useTitle from "components/system/Window/useTitle";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { basename } from "path";
|
||||
import { useCallback, useEffect } from "react";
|
||||
import { haltEvent, isYouTubeUrl, loadFiles } from "utils/functions";
|
||||
|
||||
type MarkedOptions = {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import dynamic from "next/dynamic";
|
||||
import ChatProfile from "components/apps/Messenger/ChatProfile";
|
||||
import {
|
||||
Avatar,
|
||||
|
|
@ -15,9 +17,7 @@ import {
|
|||
prettyChatTimestamp,
|
||||
} from "components/apps/Messenger/functions";
|
||||
import { useNostrProfile } from "components/apps/Messenger/hooks";
|
||||
import type { DecryptedContent } from "components/apps/Messenger/types";
|
||||
import dynamic from "next/dynamic";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { type DecryptedContent } from "components/apps/Messenger/types";
|
||||
import { clsx } from "utils/functions";
|
||||
|
||||
const SanitizedContent = dynamic(
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useRef } from "react";
|
||||
import Profile from "components/apps/Messenger/Profile";
|
||||
import StyledChatProfile from "components/apps/Messenger/StyledChatProfile";
|
||||
import { useIsVisible, useNostrProfile } from "components/apps/Messenger/hooks";
|
||||
import { useRef } from "react";
|
||||
|
||||
const ChatProfile: FC<{ publicKey: string }> = ({ publicKey }) => {
|
||||
const elementRef = useRef<HTMLLIElement | null>(null);
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
import { type Event } from "nostr-tools";
|
||||
import Profile from "components/apps/Messenger/Profile";
|
||||
import {
|
||||
copyKeyMenuItems,
|
||||
|
|
@ -6,8 +8,6 @@ import {
|
|||
} from "components/apps/Messenger/functions";
|
||||
import { useIsVisible, useNostrProfile } from "components/apps/Messenger/hooks";
|
||||
import { useMenu } from "contexts/menu";
|
||||
import { type Event } from "nostr-tools";
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
import Button from "styles/common/Button";
|
||||
import { MENU_SEPERATOR, MILLISECONDS_IN_MINUTE } from "utils/constants";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
import type { TimeScale } from "components/apps/Messenger/HistoryContext";
|
||||
import { useHistoryContext } from "components/apps/Messenger/HistoryContext";
|
||||
import StyledGetMoreMessages from "components/apps/Messenger/StyledGetMoreMessages";
|
||||
import { useState } from "react";
|
||||
import {
|
||||
type TimeScale,
|
||||
useHistoryContext,
|
||||
} from "components/apps/Messenger/HistoryContext";
|
||||
import StyledGetMoreMessages from "components/apps/Messenger/StyledGetMoreMessages";
|
||||
import Button from "styles/common/Button";
|
||||
import { MILLISECONDS_IN_DAY } from "utils/constants";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,3 @@
|
|||
import { SEEN_EVENT_IDS_PATH } from "components/apps/Messenger/constants";
|
||||
import type { NostrProfile } from "components/apps/Messenger/types";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import type { Event } from "nostr-tools";
|
||||
import {
|
||||
createContext,
|
||||
memo,
|
||||
|
|
@ -11,6 +7,10 @@ import {
|
|||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import { type Event } from "nostr-tools";
|
||||
import { SEEN_EVENT_IDS_PATH } from "components/apps/Messenger/constants";
|
||||
import { type NostrProfile } from "components/apps/Messenger/types";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
|
||||
type Profiles = Record<string, NostrProfile>;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,3 @@
|
|||
import { useHistoryContext } from "components/apps/Messenger/HistoryContext";
|
||||
import {
|
||||
getKeyFromTags,
|
||||
getMessages,
|
||||
groupChatEvents,
|
||||
} from "components/apps/Messenger/functions";
|
||||
import { useNostrEvents } from "components/apps/Messenger/hooks";
|
||||
import type { ChatEvents } from "components/apps/Messenger/types";
|
||||
import type { Event } from "nostr-tools";
|
||||
import {
|
||||
createContext,
|
||||
memo,
|
||||
|
|
@ -16,6 +7,15 @@ import {
|
|||
useMemo,
|
||||
useState,
|
||||
} from "react";
|
||||
import { type Event } from "nostr-tools";
|
||||
import { useHistoryContext } from "components/apps/Messenger/HistoryContext";
|
||||
import {
|
||||
getKeyFromTags,
|
||||
getMessages,
|
||||
groupChatEvents,
|
||||
} from "components/apps/Messenger/functions";
|
||||
import { useNostrEvents } from "components/apps/Messenger/hooks";
|
||||
import { type ChatEvents } from "components/apps/Messenger/types";
|
||||
|
||||
type MessageData = {
|
||||
allEventsReceived: boolean;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import type { Event as NostrEvent, Relay } from "nostr-tools";
|
||||
import { relayInit } from "nostr-tools";
|
||||
import { type Event as NostrEvent, type Relay, relayInit } from "nostr-tools";
|
||||
import {
|
||||
createContext,
|
||||
useCallback,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useState } from "react";
|
||||
import { Avatar, Verified } from "components/apps/Messenger/Icons";
|
||||
import StyledProfile from "components/apps/Messenger/StyledProfile";
|
||||
import { useNip05Domain } from "components/apps/Messenger/hooks";
|
||||
import { useState } from "react";
|
||||
|
||||
type ProfileProps = {
|
||||
nip05?: string;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { useCallback, useMemo } from "react";
|
||||
import { useHistoryContext } from "components/apps/Messenger/HistoryContext";
|
||||
import { Back, Write } from "components/apps/Messenger/Icons";
|
||||
import { useNostr } from "components/apps/Messenger/NostrContext";
|
||||
|
|
@ -12,9 +13,8 @@ import {
|
|||
getWebSocketStatusIcon,
|
||||
} from "components/apps/Messenger/functions";
|
||||
import { useNostrProfile } from "components/apps/Messenger/hooks";
|
||||
import type { ProfileData } from "components/apps/Messenger/types";
|
||||
import { type ProfileData } from "components/apps/Messenger/types";
|
||||
import { useMenu } from "contexts/menu";
|
||||
import { useCallback, useMemo } from "react";
|
||||
import Button from "styles/common/Button";
|
||||
import { MENU_SEPERATOR } from "utils/constants";
|
||||
import { haltEvent } from "utils/functions";
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import { sanitize } from "dompurify";
|
||||
import { useMemo } from "react";
|
||||
import {
|
||||
convertImageLinksToHtml,
|
||||
convertNewLinesToBreaks,
|
||||
} from "components/apps/Messenger/functions";
|
||||
import { sanitize } from "dompurify";
|
||||
import { useMemo } from "react";
|
||||
|
||||
const SanitizedContent: FC<{ content: string; decrypted: boolean }> = ({
|
||||
content,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { useCallback, useRef, useState } from "react";
|
||||
import { Send } from "components/apps/Messenger/Icons";
|
||||
import { useMessageContext } from "components/apps/Messenger/MessageContext";
|
||||
import { useNostr } from "components/apps/Messenger/NostrContext";
|
||||
import StyledSendMessage from "components/apps/Messenger/StyledSendMessage";
|
||||
import { UNKNOWN_PUBLIC_KEY } from "components/apps/Messenger/constants";
|
||||
import { createMessageEvent } from "components/apps/Messenger/functions";
|
||||
import { useCallback, useRef, useState } from "react";
|
||||
import Button from "styles/common/Button";
|
||||
import { haltEvent } from "utils/functions";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { MotionProps } from "framer-motion";
|
||||
import { type MotionProps } from "framer-motion";
|
||||
import {
|
||||
HOME,
|
||||
MILLISECONDS_IN_MINUTE,
|
||||
|
|
|
|||
|
|
@ -1,22 +1,7 @@
|
|||
import {
|
||||
BASE_NIP05_URL,
|
||||
BASE_RW_RELAYS,
|
||||
DM_KIND,
|
||||
GROUP_TIME_GAP_IN_SECONDS,
|
||||
METADATA_KIND,
|
||||
PRIVATE_KEY_IDB_NAME,
|
||||
PUBLIC_KEY_IDB_NAME,
|
||||
TIME_FORMAT,
|
||||
} from "components/apps/Messenger/constants";
|
||||
import type {
|
||||
ChatEvents,
|
||||
DecryptedContent,
|
||||
NostrEvents,
|
||||
NostrProfile,
|
||||
ProfileData,
|
||||
} from "components/apps/Messenger/types";
|
||||
import type { MenuItem } from "contexts/menu/useMenuContextState";
|
||||
import type { Event, VerifiedEvent } from "nostr-tools";
|
||||
// eslint-disable-next-line import/consistent-type-specifier-style
|
||||
import type { ProfilePointer } from "nostr-tools/lib/types/nip19";
|
||||
// eslint-disable-next-line import/consistent-type-specifier-style
|
||||
import type { NIP05Result } from "nostr-tools/lib/types/nip05";
|
||||
import {
|
||||
generatePrivateKey,
|
||||
getEventHash,
|
||||
|
|
@ -27,9 +12,27 @@ import {
|
|||
validateEvent,
|
||||
verifiedSymbol,
|
||||
verifySignature,
|
||||
type Event,
|
||||
type VerifiedEvent,
|
||||
} from "nostr-tools";
|
||||
import type { NIP05Result } from "nostr-tools/lib/types/nip05";
|
||||
import type { ProfilePointer } from "nostr-tools/lib/types/nip19";
|
||||
import {
|
||||
BASE_NIP05_URL,
|
||||
BASE_RW_RELAYS,
|
||||
DM_KIND,
|
||||
GROUP_TIME_GAP_IN_SECONDS,
|
||||
METADATA_KIND,
|
||||
PRIVATE_KEY_IDB_NAME,
|
||||
PUBLIC_KEY_IDB_NAME,
|
||||
TIME_FORMAT,
|
||||
} from "components/apps/Messenger/constants";
|
||||
import {
|
||||
type ChatEvents,
|
||||
type DecryptedContent,
|
||||
type NostrEvents,
|
||||
type NostrProfile,
|
||||
type ProfileData,
|
||||
} from "components/apps/Messenger/types";
|
||||
import { type MenuItem } from "contexts/menu/useMenuContextState";
|
||||
import { MILLISECONDS_IN_DAY, MILLISECONDS_IN_SECOND } from "utils/constants";
|
||||
|
||||
export const getRelayUrls = async (): Promise<string[]> => {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,12 @@
|
|||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
// eslint-disable-next-line import/consistent-type-specifier-style
|
||||
import type { NIP05Result } from "nostr-tools/lib/types/nip05";
|
||||
import {
|
||||
type Filter,
|
||||
type Event as NostrEvent,
|
||||
type Relay,
|
||||
type Sub,
|
||||
} from "nostr-tools";
|
||||
import { useHistoryContext } from "components/apps/Messenger/HistoryContext";
|
||||
import { useMessageContext } from "components/apps/Messenger/MessageContext";
|
||||
import { useNostr } from "components/apps/Messenger/NostrContext";
|
||||
|
|
@ -16,16 +25,13 @@ import {
|
|||
maybeGetExistingPublicKey,
|
||||
toHexKey,
|
||||
} from "components/apps/Messenger/functions";
|
||||
import type {
|
||||
Metadata,
|
||||
NostrContacts,
|
||||
NostrProfile,
|
||||
import {
|
||||
type Metadata,
|
||||
type NostrContacts,
|
||||
type NostrProfile,
|
||||
} from "components/apps/Messenger/types";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import directory from "contexts/process/directory";
|
||||
import type { Filter, Event as NostrEvent, Relay, Sub } from "nostr-tools";
|
||||
import type { NIP05Result } from "nostr-tools/lib/types/nip05";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { PACKAGE_DATA, PROCESS_DELIMITER } from "utils/constants";
|
||||
|
||||
export const useNostrEvents = ({
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { type Event } from "nostr-tools";
|
||||
import { AnimatePresence } from "framer-motion";
|
||||
import ChatLog from "components/apps/Messenger/ChatLog";
|
||||
import Contact from "components/apps/Messenger/Contact";
|
||||
import GetMoreMessages from "components/apps/Messenger/GetMoreMessages";
|
||||
|
|
@ -29,11 +32,8 @@ import {
|
|||
usePublicKey,
|
||||
useUnreadStatus,
|
||||
} from "components/apps/Messenger/hooks";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { AnimatePresence } from "framer-motion";
|
||||
import type { Event } from "nostr-tools";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { MILLISECONDS_IN_DAY } from "utils/constants";
|
||||
import { haltEvent } from "utils/functions";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { Event, Filter } from "nostr-tools";
|
||||
import { type Event, type Filter } from "nostr-tools";
|
||||
|
||||
type RelayPolicy = { read: boolean; write: boolean };
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
import { basename, dirname } from "path";
|
||||
import { memo, useEffect, useState } from "react";
|
||||
import StyledStatusBar from "components/apps/MonacoEditor/StyledStatusBar";
|
||||
import { getSaveFileInfo } from "components/apps/MonacoEditor/functions";
|
||||
import {
|
||||
isPrettyLanguage,
|
||||
prettyPrint,
|
||||
} from "components/apps/MonacoEditor/language";
|
||||
import type { Model } from "components/apps/MonacoEditor/types";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type Model } from "components/apps/MonacoEditor/types";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import useTitle from "components/system/Window/useTitle";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { basename, dirname } from "path";
|
||||
import { memo, useEffect, useState } from "react";
|
||||
import Button from "styles/common/Button";
|
||||
import { haltEvent, label } from "utils/functions";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import type * as Monaco from "monaco-editor/esm/vs/editor/editor.api";
|
||||
import {
|
||||
customExtensionLanguages,
|
||||
URL_DELIMITER,
|
||||
} from "components/apps/MonacoEditor/config";
|
||||
import { monacoExtensions } from "components/apps/MonacoEditor/extensions";
|
||||
import type * as Monaco from "monaco-editor/esm/vs/editor/editor.api";
|
||||
import { DEFAULT_TEXT_FILE_SAVE_PATH } from "utils/constants";
|
||||
|
||||
export const detectLanguage = (ext: string): string => {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import StatusBar from "components/apps/MonacoEditor/StatusBar";
|
|||
import StyledMonacoEditor from "components/apps/MonacoEditor/StyledMonacoEditor";
|
||||
import useMonaco from "components/apps/MonacoEditor/useMonaco";
|
||||
import AppContainer from "components/system/Apps/AppContainer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
|
||||
const MonacoEditor: FC<ComponentProcessProps> = ({ id }) => (
|
||||
<>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { Plugin } from "prettier";
|
||||
import { type Plugin } from "prettier";
|
||||
|
||||
type Parser = { parser: string; plugins: Plugin[] };
|
||||
type PrettierPlugin = { default: Plugin };
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
import { basename, dirname } from "path";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { loader } from "@monaco-editor/react";
|
||||
import type * as Monaco from "monaco-editor/esm/vs/editor/editor.api";
|
||||
import {
|
||||
URL_DELIMITER,
|
||||
config,
|
||||
|
|
@ -9,14 +12,11 @@ import {
|
|||
getSaveFileInfo,
|
||||
relocateShadowRoot,
|
||||
} from "components/apps/MonacoEditor/functions";
|
||||
import type { Model } from "components/apps/MonacoEditor/types";
|
||||
import type { ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { type Model } from "components/apps/MonacoEditor/types";
|
||||
import { type ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import useTitle from "components/system/Window/useTitle";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import type * as Monaco from "monaco-editor/esm/vs/editor/editor.api";
|
||||
import { basename, dirname } from "path";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import {
|
||||
DEFAULT_TEXT_FILE_SAVE_PATH,
|
||||
MILLISECONDS_IN_SECOND,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { type Font, type LocalizedName } from "opentype.js";
|
||||
import StyledOpenType from "components/apps/OpenType/StyledOpenType";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import useFileDrop from "components/system/Files/FileManager/useFileDrop";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import processDirectory from "contexts/process/directory";
|
||||
import type { Font, LocalizedName } from "opentype.js";
|
||||
import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { haltEvent } from "utils/functions";
|
||||
|
||||
type FontCanvasProps = {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { basename } from "path";
|
||||
import {
|
||||
Add,
|
||||
Download,
|
||||
|
|
@ -6,10 +7,9 @@ import {
|
|||
} from "components/apps/PDF//ControlIcons";
|
||||
import StyledControls from "components/apps/PDF/StyledControls";
|
||||
import { scales } from "components/apps/PDF/usePDF";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { basename } from "path";
|
||||
import Button from "styles/common/Button";
|
||||
import { MILLISECONDS_IN_SECOND } from "utils/constants";
|
||||
import { bufferToUrl, isSafari, label } from "utils/functions";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import Controls from "components/apps/PDF/Controls";
|
|||
import StyledPDF from "components/apps/PDF/StyledPDF";
|
||||
import usePDF from "components/apps/PDF/usePDF";
|
||||
import AppContainer from "components/system/Apps/AppContainer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
|
||||
const PDF: FC<ComponentProcessProps> = ({ id }) => (
|
||||
<>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import type { MetadataInfo } from "components/apps/PDF/types";
|
||||
import type { ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { basename } from "path";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { type PDFDocumentProxy } from "pdfjs-dist/types/src/display/api";
|
||||
import type * as PdfjsLib from "pdfjs-dist";
|
||||
import { type MetadataInfo } from "components/apps/PDF/types";
|
||||
import { type ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import useTitle from "components/system/Window/useTitle";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { basename } from "path";
|
||||
import type * as PdfjsLib from "pdfjs-dist";
|
||||
import type { PDFDocumentProxy } from "pdfjs-dist/types/src/display/api";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import {
|
||||
BASE_2D_CONTEXT_OPTIONS,
|
||||
DEFAULT_SCROLLBAR_WIDTH,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import { basename, dirname, join } from "path";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import StyledPaint from "components/apps/Paint/StyledPaint";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import StyledLoading from "components/system/Files/FileManager/StyledLoading";
|
||||
import useFileDrop from "components/system/Files/FileManager/useFileDrop";
|
||||
import useTitle from "components/system/Window/useTitle";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { useSession } from "contexts/session";
|
||||
import type { WallpaperFit } from "contexts/session/types";
|
||||
import { basename, dirname, join } from "path";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { type WallpaperFit } from "contexts/session/types";
|
||||
import {
|
||||
DESKTOP_PATH,
|
||||
IFRAME_CONFIG,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import { basename, dirname, extname, join } from "path";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import {
|
||||
ExitFullscreen,
|
||||
Fullscreen,
|
||||
|
|
@ -6,15 +8,13 @@ import {
|
|||
} from "components/apps/Photos/PhotoIcons";
|
||||
import StyledPhotos from "components/apps/Photos/StyledPhotos";
|
||||
import usePanZoom, { panZoomConfig } from "components/apps/Photos/usePanZoom";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import useFileDrop from "components/system/Files/FileManager/useFileDrop";
|
||||
import useTitle from "components/system/Window/useTitle";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { useViewport } from "contexts/viewport";
|
||||
import useDoubleClick from "hooks/useDoubleClick";
|
||||
import { basename, dirname, extname, join } from "path";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import Button from "styles/common/Button";
|
||||
import {
|
||||
HIGH_PRIORITY_ELEMENT,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import Panzoom from "@panzoom/panzoom";
|
||||
import type {
|
||||
PanzoomEventDetail,
|
||||
PanzoomObject,
|
||||
} from "@panzoom/panzoom/dist/src/types";
|
||||
import useTitle from "components/system/Window/useTitle";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import useResizeObserver from "hooks/useResizeObserver";
|
||||
import { basename } from "path";
|
||||
import Panzoom from "@panzoom/panzoom";
|
||||
import {
|
||||
type PanzoomEventDetail,
|
||||
type PanzoomObject,
|
||||
} from "@panzoom/panzoom/dist/src/types";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import useResizeObserver from "hooks/useResizeObserver";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import useTitle from "components/system/Window/useTitle";
|
||||
|
||||
export const panZoomConfig = {
|
||||
cursor: "default",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import StyledQuake3 from "components/apps/Quake3/StyledQuake3";
|
||||
import useQuake3 from "components/apps/Quake3/useQuake3";
|
||||
import AppContainer from "components/system/Apps/AppContainer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
|
||||
const Quake3: FC<ComponentProcessProps> = ({ id }) => (
|
||||
<AppContainer StyledComponent={StyledQuake3} id={id} useHook={useQuake3} />
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import type { ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { useTheme } from "styled-components";
|
||||
import { useEffect, useRef } from "react";
|
||||
import { type ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import useEmscriptenMount from "components/system/Files/FileManager/useEmscriptenMount";
|
||||
import type { EmscriptenFS } from "contexts/fileSystem/useAsyncFs";
|
||||
import { type EmscriptenFS } from "contexts/fileSystem/useAsyncFs";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { useSession } from "contexts/session";
|
||||
import { useEffect, useRef } from "react";
|
||||
import { useTheme } from "styled-components";
|
||||
import { TRANSITIONS_IN_MILLISECONDS } from "utils/constants";
|
||||
import { loadFiles, pxToNum } from "utils/functions";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import StyledRuffle from "components/apps/Ruffle/StyledRuffle";
|
||||
import useRuffle from "components/apps/Ruffle/useRuffle";
|
||||
import AppContainer from "components/system/Apps/AppContainer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
|
||||
const Ruffle: FC<ComponentProcessProps> = ({ id }) => (
|
||||
<AppContainer StyledComponent={StyledRuffle} id={id} useHook={useRuffle} />
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import type { RufflePlayer } from "components/apps/Ruffle/types";
|
||||
import type { ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { basename, extname } from "path";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { type RufflePlayer } from "components/apps/Ruffle/types";
|
||||
import { type ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import useTitle from "components/system/Window/useTitle";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { basename, extname } from "path";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { loadFiles } from "utils/functions";
|
||||
|
||||
const useRuffle = ({
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import StyledSpaceCadet from "components/apps/SpaceCadet/StyledSpaceCadet";
|
||||
import useSpaceCadet from "components/apps/SpaceCadet/useSpaceCadet";
|
||||
import AppContainer from "components/system/Apps/AppContainer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { haltEvent } from "utils/functions";
|
||||
|
||||
const SpaceCadet: FC<ComponentProcessProps> = ({ id }) => (
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import type { ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import useEmscriptenMount from "components/system/Files/FileManager/useEmscriptenMount";
|
||||
import type { EmscriptenFS } from "contexts/fileSystem/useAsyncFs";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { useEffect, useState } from "react";
|
||||
import { type ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import useEmscriptenMount from "components/system/Files/FileManager/useEmscriptenMount";
|
||||
import { type EmscriptenFS } from "contexts/fileSystem/useAsyncFs";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { TRANSITIONS_IN_MILLISECONDS } from "utils/constants";
|
||||
import { loadFiles } from "utils/functions";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { useCallback, useMemo, useRef, useState } from "react";
|
||||
import StyledStableDiffusion from "components/apps/StableDiffusion/StyledStableDiffusion";
|
||||
import type { StableDiffusionConfig } from "components/apps/StableDiffusion/types";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type StableDiffusionConfig } from "components/apps/StableDiffusion/types";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { runStableDiffusion } from "components/system/Desktop/Wallpapers/StableDiffusion";
|
||||
import { useWebGPUCheck } from "hooks/useWebGPUCheck";
|
||||
import useWorker from "hooks/useWorker";
|
||||
import { useCallback, useMemo, useRef, useState } from "react";
|
||||
|
||||
type WorkerMessage = { data: { message: string; type: string } };
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import type { StableDiffusionConfig } from "components/apps/StableDiffusion/types";
|
||||
import { type StableDiffusionConfig } from "components/apps/StableDiffusion/types";
|
||||
import {
|
||||
libs,
|
||||
runStableDiffusion,
|
||||
} from "components/system/Desktop/Wallpapers/StableDiffusion";
|
||||
import type { OffscreenRenderProps } from "components/system/Desktop/Wallpapers/types";
|
||||
import { type OffscreenRenderProps } from "components/system/Desktop/Wallpapers/types";
|
||||
|
||||
globalThis.addEventListener(
|
||||
"message",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { type ITerminalOptions } from "xterm";
|
||||
import processDirectory from "contexts/process/directory";
|
||||
import type { ITerminalOptions } from "xterm";
|
||||
|
||||
export const config: ITerminalOptions = {
|
||||
allowTransparency: true,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { colorAttributes, rgbAnsi } from "components/apps/Terminal/color";
|
||||
import { commands as gitCommands } from "components/apps/Terminal/processGit";
|
||||
import type { LocalEcho } from "components/apps/Terminal/types";
|
||||
import { type LocalEcho } from "components/apps/Terminal/types";
|
||||
import { resourceAliasMap } from "components/system/Dialogs/Run";
|
||||
import processDirectory from "contexts/process/directory";
|
||||
import { ONE_DAY_IN_MILLISECONDS } from "utils/constants";
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import StyledTerminal from "components/apps/Terminal/StyledTerminal";
|
||||
import useTerminal from "components/apps/Terminal/useTerminal";
|
||||
import AppContainer from "components/system/Apps/AppContainer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
|
||||
const Terminal: FC<ComponentProcessProps> = ({ id }) => (
|
||||
<AppContainer
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { type WASIBindings } from "wasi-js";
|
||||
import { config } from "components/apps/Terminal/config";
|
||||
import type { LocalEcho } from "components/apps/Terminal/types";
|
||||
import type { WASIBindings } from "wasi-js";
|
||||
import { type LocalEcho } from "components/apps/Terminal/types";
|
||||
|
||||
type WASIError = Error & {
|
||||
code: number;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
import type { FSModule } from "browserfs/dist/node/core/FS";
|
||||
import { help } from "components/apps/Terminal/functions";
|
||||
import type { LocalEcho } from "components/apps/Terminal/types";
|
||||
import type index from "isomorphic-git";
|
||||
import type {
|
||||
AuthCallback,
|
||||
GitAuth,
|
||||
MessageCallback,
|
||||
ProgressCallback,
|
||||
} from "isomorphic-git";
|
||||
import type { ParsedArgs } from "minimist";
|
||||
import { join } from "path";
|
||||
import { type FSModule } from "browserfs/dist/node/core/FS";
|
||||
import {
|
||||
type AuthCallback,
|
||||
type GitAuth,
|
||||
type MessageCallback,
|
||||
type ProgressCallback,
|
||||
type default as index,
|
||||
} from "isomorphic-git";
|
||||
import { type ParsedArgs } from "minimist";
|
||||
import { type LocalEcho } from "components/apps/Terminal/types";
|
||||
import { help } from "components/apps/Terminal/functions";
|
||||
|
||||
const corsProxy = "https://cors.isomorphic-git.org";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { LocalEcho } from "components/apps/Terminal/types";
|
||||
import { type LocalEcho } from "components/apps/Terminal/types";
|
||||
import { loadFiles } from "utils/functions";
|
||||
|
||||
type Pyodide = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { ITerminalAddon, Terminal } from "xterm";
|
||||
import { type ITerminalAddon, type Terminal } from "xterm";
|
||||
|
||||
export type CommandInterpreter = (command?: string) => Promise<string>;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
import { basename, dirname, extname, isAbsolute, join } from "path";
|
||||
import { type Terminal } from "xterm";
|
||||
import { useTheme } from "styled-components";
|
||||
import { useCallback, useEffect, useRef } from "react";
|
||||
import type UAParser from "ua-parser-js";
|
||||
import { colorAttributes, rgbAnsi } from "components/apps/Terminal/color";
|
||||
import {
|
||||
BACKUP_NAME_SERVER,
|
||||
|
|
@ -20,11 +25,11 @@ import {
|
|||
import loadWapm from "components/apps/Terminal/loadWapm";
|
||||
import processGit from "components/apps/Terminal/processGit";
|
||||
import { runPython } from "components/apps/Terminal/python";
|
||||
import type {
|
||||
CommandInterpreter,
|
||||
LocalEcho,
|
||||
NsEntry,
|
||||
NsResponse,
|
||||
import {
|
||||
type CommandInterpreter,
|
||||
type LocalEcho,
|
||||
type NsEntry,
|
||||
type NsResponse,
|
||||
} from "components/apps/Terminal/types";
|
||||
import {
|
||||
displayLicense,
|
||||
|
|
@ -43,10 +48,6 @@ import { useProcesses } from "contexts/process";
|
|||
import processDirectory from "contexts/process/directory";
|
||||
import { useSession } from "contexts/session";
|
||||
import { useProcessesRef } from "hooks/useProcessesRef";
|
||||
import { basename, dirname, extname, isAbsolute, join } from "path";
|
||||
import { useCallback, useEffect, useRef } from "react";
|
||||
import { useTheme } from "styled-components";
|
||||
import type UAParser from "ua-parser-js";
|
||||
import {
|
||||
DEFAULT_LOCALE,
|
||||
DESKTOP_PATH,
|
||||
|
|
@ -66,7 +67,6 @@ import { convert } from "utils/imagemagick";
|
|||
import { getIpfsFileName, getIpfsResource } from "utils/ipfs";
|
||||
import { fullSearch } from "utils/search";
|
||||
import { convertSheet } from "utils/sheetjs";
|
||||
import type { Terminal } from "xterm";
|
||||
|
||||
const COMMAND_NOT_SUPPORTED = "The system does not support the command.";
|
||||
const FILE_NOT_FILE = "The system cannot find the file specified.";
|
||||
|
|
|
|||
|
|
@ -1,18 +1,5 @@
|
|||
import { PROMPT_CHARACTER, config } from "components/apps/Terminal/config";
|
||||
import { autoComplete } from "components/apps/Terminal/functions";
|
||||
import type {
|
||||
FitAddon,
|
||||
LocalEcho,
|
||||
OnKeyEvent,
|
||||
} from "components/apps/Terminal/types";
|
||||
import useCommandInterpreter from "components/apps/Terminal/useCommandInterpreter";
|
||||
import type { ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import extensions from "components/system/Files/FileEntry/extensions";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { useSession } from "contexts/session";
|
||||
import useResizeObserver from "hooks/useResizeObserver";
|
||||
import { extname } from "path";
|
||||
import { type IDisposable, type Terminal } from "xterm";
|
||||
import {
|
||||
useCallback,
|
||||
useEffect,
|
||||
|
|
@ -20,9 +7,22 @@ import {
|
|||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import { PROMPT_CHARACTER, config } from "components/apps/Terminal/config";
|
||||
import { autoComplete } from "components/apps/Terminal/functions";
|
||||
import {
|
||||
type FitAddon,
|
||||
type LocalEcho,
|
||||
type OnKeyEvent,
|
||||
} from "components/apps/Terminal/types";
|
||||
import useCommandInterpreter from "components/apps/Terminal/useCommandInterpreter";
|
||||
import { type ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import extensions from "components/system/Files/FileEntry/extensions";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { useSession } from "contexts/session";
|
||||
import useResizeObserver from "hooks/useResizeObserver";
|
||||
import { HOME, PACKAGE_DATA, PREVENT_SCROLL } from "utils/constants";
|
||||
import { getExtension, haltEvent, isFirefox, loadFiles } from "utils/functions";
|
||||
import type { IDisposable, Terminal } from "xterm";
|
||||
|
||||
const { alias, author, license, version } = PACKAGE_DATA;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { Editor } from "tinymce";
|
||||
import { type Editor } from "tinymce";
|
||||
import { ONE_TIME_PASSIVE_EVENT } from "utils/constants";
|
||||
|
||||
export const draggableEditor = (activeEditor: Editor): boolean =>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import StyledTinyMceEditor from "components/apps/TinyMCE/StyledTinyMceEditor";
|
||||
import useTinyMCE from "components/apps/TinyMCE/useTinyMCE";
|
||||
import AppContainer from "components/system/Apps/AppContainer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
|
||||
const TinyMCE: FC<ComponentProcessProps> = ({ id }) => (
|
||||
<AppContainer
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { TinyMCE } from "tinymce";
|
||||
import { type TinyMCE } from "tinymce";
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
import { basename, dirname, extname, relative } from "path";
|
||||
import { type Editor, type NotificationSpec } from "tinymce";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { DEFAULT_SAVE_PATH, config } from "components/apps/TinyMCE/config";
|
||||
import {
|
||||
draggableEditor,
|
||||
setReadOnlyMode,
|
||||
} from "components/apps/TinyMCE/functions";
|
||||
import type { IRTFJS } from "components/apps/TinyMCE/types";
|
||||
import type { ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { type IRTFJS } from "components/apps/TinyMCE/types";
|
||||
import { type ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import {
|
||||
getModifiedTime,
|
||||
getProcessByFileExtension,
|
||||
|
|
@ -14,9 +17,6 @@ import useTitle from "components/system/Window/useTitle";
|
|||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { useSession } from "contexts/session";
|
||||
import { basename, dirname, extname, relative } from "path";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import type { Editor, NotificationSpec } from "tinymce";
|
||||
import { DEFAULT_LOCALE } from "utils/constants";
|
||||
import { getExtension, haltEvent, loadFiles } from "utils/functions";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import StyledV86 from "components/apps/V86/StyledV86";
|
||||
import useV86 from "components/apps/V86/useV86";
|
||||
import AppContainer from "components/system/Apps/AppContainer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { haltEvent } from "utils/functions";
|
||||
|
||||
const V86: FC<ComponentProcessProps> = ({ id }) => (
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { config } from "components/apps/V86/config";
|
||||
import type { V86ImageConfig } from "components/apps/V86/image";
|
||||
import { type config } from "components/apps/V86/config";
|
||||
import { type V86ImageConfig } from "components/apps/V86/image";
|
||||
|
||||
export type SizeCallback = (dimensions: number[]) => void;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,25 +1,24 @@
|
|||
import { basename, dirname, join } from "path";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import {
|
||||
BOOT_CD_FD_HD,
|
||||
BOOT_FD_CD_HD,
|
||||
config,
|
||||
saveExtension,
|
||||
} from "components/apps/V86/config";
|
||||
import type { V86ImageConfig } from "components/apps/V86/image";
|
||||
import { getImageType } from "components/apps/V86/image";
|
||||
import type {
|
||||
NavigatorWithMemory,
|
||||
V86Config,
|
||||
V86Starter,
|
||||
import { type V86ImageConfig, getImageType } from "components/apps/V86/image";
|
||||
import {
|
||||
type NavigatorWithMemory,
|
||||
type V86Config,
|
||||
type V86Starter,
|
||||
} from "components/apps/V86/types";
|
||||
import useV86ScreenSize from "components/apps/V86/useV86ScreenSize";
|
||||
import type { ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { type ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import useTitle from "components/system/Window/useTitle";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { fs9pV4ToV3 } from "contexts/fileSystem/core";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { useSession } from "contexts/session";
|
||||
import { basename, dirname, join } from "path";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import {
|
||||
ICON_CACHE,
|
||||
ICON_CACHE_EXTENSION,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import type { SizeCallback, V86Starter } from "components/apps/V86/types";
|
||||
import useWindowSize from "components/system/Window/useWindowSize";
|
||||
import { useEffect } from "react";
|
||||
import { type SizeCallback, type V86Starter } from "components/apps/V86/types";
|
||||
import useWindowSize from "components/system/Window/useWindowSize";
|
||||
|
||||
const SET_SCREEN_GFX = "screen-set-size-graphical";
|
||||
const SET_SCREEN_TXT = "screen-set-size-text";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { VideoJsPlayerOptions } from "video.js";
|
||||
import { type VideoJsPlayerOptions } from "video.js";
|
||||
|
||||
export const YT_TYPE = "video/youtube";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import StyledVideoPlayer from "components/apps/VideoPlayer/StyledVideoPlayer";
|
||||
import useVideoPlayer from "components/apps/VideoPlayer/useVideoPlayer";
|
||||
import AppContainer from "components/system/Apps/AppContainer";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
|
||||
const VideoPlayer: FC<ComponentProcessProps> = ({ id }) => (
|
||||
<AppContainer
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
import { basename } from "path";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import {
|
||||
CONTROL_BAR_HEIGHT,
|
||||
VideoResizeKey,
|
||||
YT_TYPE,
|
||||
config,
|
||||
} from "components/apps/VideoPlayer/config";
|
||||
import type {
|
||||
SourceObjectWithUrl,
|
||||
VideoPlayer,
|
||||
import {
|
||||
type SourceObjectWithUrl,
|
||||
type VideoPlayer,
|
||||
} from "components/apps/VideoPlayer/types";
|
||||
import type { ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { type ContainerHookProps } from "components/system/Apps/AppContainer";
|
||||
import { getMimeType } from "components/system/Files/FileEntry/functions";
|
||||
import useTitle from "components/system/Window/useTitle";
|
||||
import useWindowSize from "components/system/Window/useWindowSize";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { basename } from "path";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { VIDEO_FALLBACK_MIME_TYPE } from "utils/constants";
|
||||
import {
|
||||
bufferToUrl,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import { basename, dirname } from "path";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import StyledVim from "components/apps/Vim/StyledVim";
|
||||
import type { QueueItem } from "components/apps/Vim/types";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type QueueItem } from "components/apps/Vim/types";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import useEmscriptenMount from "components/system/Files/FileManager/useEmscriptenMount";
|
||||
import useFileDrop from "components/system/Files/FileManager/useFileDrop";
|
||||
import useTitle from "components/system/Window/useTitle";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { basename, dirname } from "path";
|
||||
import { useCallback, useEffect, useRef, useState } from "react";
|
||||
import { DEFAULT_TEXT_FILE_SAVE_PATH } from "utils/constants";
|
||||
import { haltEvent, loadFiles } from "utils/functions";
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import type { EmscriptenFS } from "contexts/fileSystem/useAsyncFs";
|
||||
import { type EmscriptenFS } from "contexts/fileSystem/useAsyncFs";
|
||||
|
||||
export type QueueItem = {
|
||||
buffer: Buffer;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
import type {
|
||||
ButterChurnPresets,
|
||||
ButterChurnWebampPreset,
|
||||
SkinData,
|
||||
WebampApiResponse,
|
||||
WebampCI,
|
||||
import { type Track, type URLTrack } from "webamp";
|
||||
import { type Position } from "react-rnd";
|
||||
import {
|
||||
type ButterChurnPresets,
|
||||
type ButterChurnWebampPreset,
|
||||
type SkinData,
|
||||
type WebampApiResponse,
|
||||
type WebampCI,
|
||||
} from "components/apps/Webamp/types";
|
||||
import { centerPosition } from "components/system/Window/functions";
|
||||
import type { Position } from "react-rnd";
|
||||
import { HOME, MP3_MIME_TYPE, PACKAGE_DATA } from "utils/constants";
|
||||
import { bufferToBlob, cleanUpBufferUrl, loadFiles } from "utils/functions";
|
||||
import type { Track, URLTrack } from "webamp";
|
||||
|
||||
const BROKEN_PRESETS = new Set([
|
||||
"Flexi - alien fish pond",
|
||||
|
|
@ -359,7 +359,8 @@ type MetadataGetter = () => Promise<Track["metaData"]>;
|
|||
type MetadataProvider = (url: string) => MetadataGetter;
|
||||
|
||||
const removeCData = (string = ""): string =>
|
||||
string.replace(/<!\[CDATA\[|]]>/g, "");
|
||||
// eslint-disable-next-line unicorn/better-regex
|
||||
string.replace(/<!\[CDATA\[|\]\]>/g, "");
|
||||
|
||||
const streamingMetadataProviders: Record<string, MetadataProvider> = {
|
||||
"somafm.com": (url: string) => async () => {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
import { basename, extname } from "path";
|
||||
import { type Options } from "webamp";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import StyledWebamp from "components/apps/Webamp/StyledWebamp";
|
||||
import {
|
||||
cleanBufferOnSkinLoad,
|
||||
|
|
@ -7,16 +10,13 @@ import {
|
|||
unFocus,
|
||||
} from "components/apps/Webamp/functions";
|
||||
import useWebamp from "components/apps/Webamp/useWebamp";
|
||||
import type { ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import { type ComponentProcessProps } from "components/system/Apps/RenderComponent";
|
||||
import useFocusable from "components/system/Window/useFocusable";
|
||||
import useWindowTransitions from "components/system/Window/useWindowTransitions";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { basename, extname } from "path";
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { AUDIO_PLAYLIST_EXTENSIONS } from "utils/constants";
|
||||
import { bufferToUrl, getExtension, loadFiles } from "utils/functions";
|
||||
import type { Options } from "webamp";
|
||||
|
||||
const Webamp: FC<ComponentProcessProps> = ({ id }) => {
|
||||
const containerRef = useRef<HTMLDivElement | null>(null);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import type { Position } from "react-rnd";
|
||||
import type Webamp from "webamp";
|
||||
import type { Track } from "webamp";
|
||||
import { type Position } from "react-rnd";
|
||||
import { type Track, type default as Webamp } from "webamp";
|
||||
|
||||
type ButterChurnPreset = {
|
||||
getPreset: () => Promise<unknown>;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
import { basename, dirname } from "path";
|
||||
import { type Options, type Track, type URLTrack } from "webamp";
|
||||
import { useCallback, useEffect, useRef } from "react";
|
||||
import {
|
||||
BASE_WEBAMP_OPTIONS,
|
||||
MAIN_WINDOW,
|
||||
|
|
@ -14,15 +17,13 @@ import {
|
|||
tracksFromPlaylist,
|
||||
updateWebampPosition,
|
||||
} from "components/apps/Webamp/functions";
|
||||
import type { SkinData, WebampCI } from "components/apps/Webamp/types";
|
||||
import { type SkinData, type WebampCI } from "components/apps/Webamp/types";
|
||||
import useFileDrop from "components/system/Files/FileManager/useFileDrop";
|
||||
import useWindowActions from "components/system/Window/Titlebar/useWindowActions";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import processDirectory from "contexts/process/directory";
|
||||
import { useSession } from "contexts/session";
|
||||
import { basename, dirname } from "path";
|
||||
import { useCallback, useEffect, useRef } from "react";
|
||||
import {
|
||||
AUDIO_PLAYLIST_EXTENSIONS,
|
||||
DESKTOP_PATH,
|
||||
|
|
@ -32,7 +33,6 @@ import {
|
|||
TRANSITIONS_IN_MILLISECONDS,
|
||||
} from "utils/constants";
|
||||
import { getExtension, haltEvent } from "utils/functions";
|
||||
import type { Options, Track, URLTrack } from "webamp";
|
||||
|
||||
type Webamp = {
|
||||
initWebamp: (containerElement: HTMLDivElement, options: Options) => void;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import { extname } from "path";
|
||||
import { memo, useCallback, useEffect, useMemo, useState } from "react";
|
||||
import Head from "next/head";
|
||||
import { getFirstAniImage } from "components/system/Files/FileEntry/functions";
|
||||
import { useFileSystem } from "contexts/fileSystem";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import { useSession } from "contexts/session";
|
||||
import Head from "next/head";
|
||||
import { extname } from "path";
|
||||
import desktopIcons from "public/.index/desktopIcons.json";
|
||||
import { memo, useCallback, useEffect, useMemo, useState } from "react";
|
||||
import {
|
||||
FAVICON_BASE_PATH,
|
||||
HIGH_PRIORITY_ELEMENT,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
import { useSession } from "contexts/session";
|
||||
import type { FeatureBundle } from "framer-motion";
|
||||
import { LazyMotion } from "framer-motion";
|
||||
import { memo } from "react";
|
||||
import { StyleSheetManager, ThemeProvider } from "styled-components";
|
||||
import { memo } from "react";
|
||||
import { type FeatureBundle, LazyMotion } from "framer-motion";
|
||||
import { useSession } from "contexts/session";
|
||||
import GlobalStyle from "styles/GlobalStyle";
|
||||
import themes from "styles/themes";
|
||||
import { DEFAULT_THEME } from "utils/constants";
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import useFileDrop from "components/system/Files/FileManager/useFileDrop";
|
||||
import { useProcesses } from "contexts/process";
|
||||
import dynamic from "next/dynamic";
|
||||
import { memo, useMemo, useRef, useState } from "react";
|
||||
import type { styled } from "styled-components";
|
||||
import { type styled } from "styled-components";
|
||||
import useFileDrop from "components/system/Files/FileManager/useFileDrop";
|
||||
import { useProcesses } from "contexts/process";
|
||||
|
||||
const StyledLoading = dynamic(
|
||||
() => import("components/system/Files/FileManager/StyledLoading")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { useProcesses } from "contexts/process";
|
||||
import { AnimatePresence } from "framer-motion";
|
||||
import dynamic from "next/dynamic";
|
||||
import { memo } from "react";
|
||||
import { useProcesses } from "contexts/process";
|
||||
|
||||
const RenderComponent = dynamic(
|
||||
() => import("components/system/Apps/RenderComponent")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { ErrorBoundary } from "components/pages/ErrorBoundary";
|
||||
import ComponentError from "components/system/Apps/ComponentError";
|
||||
import dynamic from "next/dynamic";
|
||||
import { memo } from "react";
|
||||
import { ErrorBoundary } from "components/pages/ErrorBoundary";
|
||||
import ComponentError from "components/system/Apps/ComponentError";
|
||||
|
||||
const Window = dynamic(() => import("components/system/Window"));
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import matrixConfig from "components/system/Desktop/Wallpapers/Matrix/config";
|
||||
import type { WallpaperConfig } from "components/system/Desktop/Wallpapers/types";
|
||||
import { type WallpaperConfig } from "components/system/Desktop/Wallpapers/types";
|
||||
import { loadFiles } from "utils/functions";
|
||||
|
||||
const libs = ["/System/Matrix/js/regl/main.js"];
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { libs } from "components/system/Desktop/Wallpapers/ShaderToy/CoastalLandscape";
|
||||
import type { OffscreenRenderProps } from "components/system/Desktop/Wallpapers/types";
|
||||
import { type OffscreenRenderProps } from "components/system/Desktop/Wallpapers/types";
|
||||
|
||||
/* eslint-disable vars-on-top, no-var */
|
||||
declare global {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { StableDiffusionConfig } from "components/apps/StableDiffusion/types";
|
||||
import type { WallpaperConfig } from "components/system/Desktop/Wallpapers/types";
|
||||
import { type StableDiffusionConfig } from "components/apps/StableDiffusion/types";
|
||||
import { type WallpaperConfig } from "components/system/Desktop/Wallpapers/types";
|
||||
import { loadFiles } from "utils/functions";
|
||||
|
||||
export const libs = [
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import type { WallpaperFunc } from "components/system/Desktop/Wallpapers/types";
|
||||
import type { WallpaperFit } from "contexts/session/types";
|
||||
import { type WallpaperFunc } from "components/system/Desktop/Wallpapers/types";
|
||||
import { type WallpaperFit } from "contexts/session/types";
|
||||
|
||||
export const bgPositionSize: Record<WallpaperFit, string> = {
|
||||
center: "center center",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { libs } from "components/system/Desktop/Wallpapers/hexells";
|
||||
import type { OffscreenRenderProps } from "components/system/Desktop/Wallpapers/types";
|
||||
import { type OffscreenRenderProps } from "components/system/Desktop/Wallpapers/types";
|
||||
|
||||
/* eslint-disable vars-on-top, no-var */
|
||||
declare global {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import type { StableDiffusionConfig } from "components/apps/StableDiffusion/types";
|
||||
import { type StableDiffusionConfig } from "components/apps/StableDiffusion/types";
|
||||
import { type VantaWavesConfig } from "components/system/Desktop/Wallpapers/vantaWaves/types";
|
||||
import { type Size } from "components/system/Window/RndWindow/useResizable";
|
||||
import type MatrixConfig from "components/system/Desktop/Wallpapers/Matrix/config";
|
||||
import type { VantaWavesConfig } from "components/system/Desktop/Wallpapers/vantaWaves/types";
|
||||
import type { Size } from "components/system/Window/RndWindow/useResizable";
|
||||
|
||||
export type WallpaperConfig =
|
||||
| Partial<StableDiffusionConfig>
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user