mirror of https://github.com/mue/mue.git
refactor(modules): experimental changes to module structure
This commit is contained in:
parent
10f12b20c5
commit
618b5fe466
|
@ -6,9 +6,9 @@ import Background from 'features/widgets/background/Background';
|
||||||
import Widgets from 'features/widgets/Widgets';
|
import Widgets from 'features/widgets/Widgets';
|
||||||
import Modals from 'features/modals/Modals';
|
import Modals from 'features/modals/Modals';
|
||||||
|
|
||||||
import { loadSettings, moveSettings } from 'modules/helpers/settings';
|
import { loadSettings, moveSettings } from 'utils/helpers/settings';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
export default class App extends PureComponent {
|
export default class App extends PureComponent {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import variables from 'config/variables';
|
||||||
import { PureComponent } from 'react';
|
import { PureComponent } from 'react';
|
||||||
import { Checkbox as CheckboxUI, FormControlLabel } from '@mui/material';
|
import { Checkbox as CheckboxUI, FormControlLabel } from '@mui/material';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
class Checkbox extends PureComponent {
|
class Checkbox extends PureComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import variables from 'config/variables';
|
||||||
import { PureComponent, createRef } from 'react';
|
import { PureComponent, createRef } from 'react';
|
||||||
import { InputLabel, MenuItem, FormControl, Select } from '@mui/material';
|
import { InputLabel, MenuItem, FormControl, Select } from '@mui/material';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
class Dropdown extends PureComponent {
|
class Dropdown extends PureComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import variables from 'config/variables';
|
||||||
import { PureComponent } from 'react';
|
import { PureComponent } from 'react';
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
import { compressAccurately, filetoDataURL } from 'image-conversion';
|
import { compressAccurately, filetoDataURL } from 'image-conversion';
|
||||||
import { videoCheck } from 'modules/helpers/background/widget';
|
import { videoCheck } from 'utils/helpers/background/widget';
|
||||||
|
|
||||||
class FileUpload extends PureComponent {
|
class FileUpload extends PureComponent {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
|
@ -8,8 +8,8 @@ import {
|
||||||
FormLabel,
|
FormLabel,
|
||||||
} from '@mui/material';
|
} from '@mui/material';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
import { translations } from 'modules/translations';
|
import { translations } from 'utils/translations';
|
||||||
|
|
||||||
class Radio extends PureComponent {
|
class Radio extends PureComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { toast } from 'react-toastify';
|
||||||
import { Slider } from '@mui/material';
|
import { Slider } from '@mui/material';
|
||||||
import { MdRefresh } from 'react-icons/md';
|
import { MdRefresh } from 'react-icons/md';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
class SliderComponent extends PureComponent {
|
class SliderComponent extends PureComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import variables from 'config/variables';
|
||||||
import { PureComponent } from 'react';
|
import { PureComponent } from 'react';
|
||||||
import { Switch as SwitchUI, FormControlLabel } from '@mui/material';
|
import { Switch as SwitchUI, FormControlLabel } from '@mui/material';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
class Switch extends PureComponent {
|
class Switch extends PureComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { toast } from 'react-toastify';
|
||||||
import { TextField } from '@mui/material';
|
import { TextField } from '@mui/material';
|
||||||
import { MdRefresh } from 'react-icons/md';
|
import { MdRefresh } from 'react-icons/md';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
class Text extends PureComponent {
|
class Text extends PureComponent {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {
|
||||||
MdOutlineVisibility,
|
MdOutlineVisibility,
|
||||||
MdOutlineKeyboardArrowRight,
|
MdOutlineKeyboardArrowRight,
|
||||||
} from 'react-icons/md';
|
} from 'react-icons/md';
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
import { Button } from 'components/Elements';
|
import { Button } from 'components/Elements';
|
||||||
|
|
||||||
export const CustomActions = ({ children }) => {
|
export const CustomActions = ({ children }) => {
|
||||||
|
|
|
@ -3,8 +3,8 @@ import { Row, Content, Action } from '../Item/SettingsItem';
|
||||||
import variables from 'config/variables';
|
import variables from 'config/variables';
|
||||||
import Slider from '../../../Form/Settings/Slider/Slider';
|
import Slider from '../../../Form/Settings/Slider/Slider';
|
||||||
|
|
||||||
import { values } from 'modules/helpers/settings/modals';
|
import { values } from 'utils/helpers/settings/modals';
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
const PreferencesWrapper = ({ children, ...props }) => {
|
const PreferencesWrapper = ({ children, ...props }) => {
|
||||||
const [shown, setShown] = useState(localStorage.getItem(props.setting) === 'true');
|
const [shown, setShown] = useState(localStorage.getItem(props.setting) === 'true');
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as constants from 'config/constants';
|
import * as constants from 'config/constants';
|
||||||
import Stats from 'modules/helpers/stats';
|
import Stats from 'utils/helpers/stats';
|
||||||
|
|
||||||
const variables = {
|
const variables = {
|
||||||
language: {},
|
language: {},
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { PureComponent } from 'react';
|
import { PureComponent } from 'react';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
import './autocomplete.scss';
|
import './autocomplete.scss';
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import Main from './main/Main';
|
||||||
import Navbar from '../widgets/navbar/Navbar';
|
import Navbar from '../widgets/navbar/Navbar';
|
||||||
import Preview from '../helpers/preview/Preview';
|
import Preview from '../helpers/preview/Preview';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
import Welcome from './welcome/Welcome';
|
import Welcome from './welcome/Welcome';
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import Modal from 'react-modal';
|
||||||
import { Header } from 'components/Layout/Settings';
|
import { Header } from 'components/Layout/Settings';
|
||||||
import { Button } from 'components/Elements';
|
import { Button } from 'components/Elements';
|
||||||
|
|
||||||
import { install, uninstall } from 'modules/helpers/marketplace';
|
import { install, uninstall } from 'utils/helpers/marketplace';
|
||||||
|
|
||||||
import { ShareModal } from 'components/Elements';
|
import { ShareModal } from 'components/Elements';
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import Dropdown from '../../../../../components/Form/Settings/Dropdown/Dropdown'
|
||||||
import { Header, CustomActions } from 'components/Layout/Settings';
|
import { Header, CustomActions } from 'components/Layout/Settings';
|
||||||
import { Button } from 'components/Elements';
|
import { Button } from 'components/Elements';
|
||||||
|
|
||||||
import { install, uninstall, urlParser } from 'modules/helpers/marketplace';
|
import { install, uninstall, urlParser } from 'utils/helpers/marketplace';
|
||||||
|
|
||||||
export default class Added extends PureComponent {
|
export default class Added extends PureComponent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -16,7 +16,7 @@ import Dropdown from '../../../../../components/Form/Settings/Dropdown/Dropdown'
|
||||||
import { Header } from 'components/Layout/Settings';
|
import { Header } from 'components/Layout/Settings';
|
||||||
import { Button } from 'components/Elements';
|
import { Button } from 'components/Elements';
|
||||||
|
|
||||||
import { install, urlParser, uninstall } from 'modules/helpers/marketplace';
|
import { install, urlParser, uninstall } from 'utils/helpers/marketplace';
|
||||||
|
|
||||||
class Marketplace extends PureComponent {
|
class Marketplace extends PureComponent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
import variables from 'config/variables';
|
import variables from 'config/variables';
|
||||||
import { MdClose, MdRestartAlt } from 'react-icons/md';
|
import { MdClose, MdRestartAlt } from 'react-icons/md';
|
||||||
import { setDefaultSettings } from 'modules/helpers/settings';
|
import { setDefaultSettings } from 'utils/helpers/settings';
|
||||||
import { Tooltip } from 'components/Elements';
|
import { Tooltip } from 'components/Elements';
|
||||||
function ResetModal({ modalClose }) {
|
function ResetModal({ modalClose }) {
|
||||||
const reset = () => {
|
const reset = () => {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { SiGithubsponsors, SiOpencollective } from 'react-icons/si';
|
||||||
import { BiDonateHeart } from 'react-icons/bi';
|
import { BiDonateHeart } from 'react-icons/bi';
|
||||||
|
|
||||||
import { Tooltip } from 'components/Elements';
|
import { Tooltip } from 'components/Elements';
|
||||||
import other_contributors from 'modules/other_contributors.json';
|
import other_contributors from 'utils/data/other_contributors.json';
|
||||||
|
|
||||||
export default class About extends PureComponent {
|
export default class About extends PureComponent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
MdDataUsage,
|
MdDataUsage,
|
||||||
} from 'react-icons/md';
|
} from 'react-icons/md';
|
||||||
|
|
||||||
import { exportSettings, importSettings } from 'modules/helpers/settings/modals';
|
import { exportSettings, importSettings } from 'utils/helpers/settings/modals';
|
||||||
|
|
||||||
import { FileUpload, Text, Switch, Dropdown } from 'components/Form/Settings';
|
import { FileUpload, Text, Switch, Dropdown } from 'components/Form/Settings';
|
||||||
import ResetModal from '../ResetModal';
|
import ResetModal from '../ResetModal';
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { Header, Section, Row, Content, Action } from 'components/Layout/Setting
|
||||||
|
|
||||||
import { MdAccessibility } from 'react-icons/md';
|
import { MdAccessibility } from 'react-icons/md';
|
||||||
|
|
||||||
import { values } from 'modules/helpers/settings/modals';
|
import { values } from 'utils/helpers/settings/modals';
|
||||||
|
|
||||||
function AppearanceSettings() {
|
function AppearanceSettings() {
|
||||||
const [accessibility, setAccessibility] = useState(false);
|
const [accessibility, setAccessibility] = useState(false);
|
||||||
|
|
|
@ -4,8 +4,8 @@ import Checkbox from '../../../../../components/Form/Settings/Checkbox/Checkbox'
|
||||||
import Slider from '../../../../../components/Form/Settings/Slider/Slider';
|
import Slider from '../../../../../components/Form/Settings/Slider/Slider';
|
||||||
import { TextField } from '@mui/material';
|
import { TextField } from '@mui/material';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
import { values } from 'modules/helpers/settings/modals';
|
import { values } from 'utils/helpers/settings/modals';
|
||||||
|
|
||||||
import { Row, Content, Action } from '../../../../../components/Layout/Settings/Item/SettingsItem';
|
import { Row, Content, Action } from '../../../../../components/Layout/Settings/Item/SettingsItem';
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { toast } from 'react-toastify';
|
||||||
import { TextareaAutosize } from '@mui/material';
|
import { TextareaAutosize } from '@mui/material';
|
||||||
|
|
||||||
import { Header, Row, Content, Action, PreferencesWrapper } from 'components/Layout/Settings';
|
import { Header, Row, Content, Action, PreferencesWrapper } from 'components/Layout/Settings';
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
export default class Message extends PureComponent {
|
export default class Message extends PureComponent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -13,7 +13,7 @@ import { Button } from 'components/Elements';
|
||||||
|
|
||||||
import { Row, Content, Action } from '../../../../../components/Layout/Settings/Item/SettingsItem';
|
import { Row, Content, Action } from '../../../../../components/Layout/Settings/Item/SettingsItem';
|
||||||
import { Header } from 'components/Layout/Settings';
|
import { Header } from 'components/Layout/Settings';
|
||||||
import { getTitleFromUrl, isValidUrl } from 'modules/helpers/settings/modals';
|
import { getTitleFromUrl, isValidUrl } from 'utils/helpers/settings/modals';
|
||||||
import QuickLink from './quicklinks/QuickLink';
|
import QuickLink from './quicklinks/QuickLink';
|
||||||
|
|
||||||
function Navbar() {
|
function Navbar() {
|
||||||
|
|
|
@ -11,7 +11,7 @@ import QuickLinks from './overview_skeletons/QuickLinks';
|
||||||
import Date from './overview_skeletons/Date';
|
import Date from './overview_skeletons/Date';
|
||||||
import Message from './overview_skeletons/Message';
|
import Message from './overview_skeletons/Message';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
const widget_name = {
|
const widget_name = {
|
||||||
greeting: variables.getMessage('modals.main.settings.sections.greeting.title'),
|
greeting: variables.getMessage('modals.main.settings.sections.greeting.title'),
|
||||||
|
|
|
@ -8,9 +8,9 @@ import Modal from 'react-modal';
|
||||||
|
|
||||||
import AddModal from './quicklinks/AddModal';
|
import AddModal from './quicklinks/AddModal';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
import QuickLink from './quicklinks/QuickLink';
|
import QuickLink from './quicklinks/QuickLink';
|
||||||
import { getTitleFromUrl, isValidUrl } from 'modules/helpers/settings/modals';
|
import { getTitleFromUrl, isValidUrl } from 'utils/helpers/settings/modals';
|
||||||
|
|
||||||
export default class QuickLinks extends PureComponent {
|
export default class QuickLinks extends PureComponent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {
|
||||||
import { Checkbox, Dropdown } from 'components/Form/Settings';
|
import { Checkbox, Dropdown } from 'components/Form/Settings';
|
||||||
|
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
export default class QuoteSettings extends PureComponent {
|
export default class QuoteSettings extends PureComponent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { MenuItem, TextField } from '@mui/material';
|
||||||
import { Header, Row, Content, Action, PreferencesWrapper } from 'components/Layout/Settings';
|
import { Header, Row, Content, Action, PreferencesWrapper } from 'components/Layout/Settings';
|
||||||
import { Dropdown, Checkbox } from 'components/Form/Settings';
|
import { Dropdown, Checkbox } from 'components/Form/Settings';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
import searchEngines from 'features/widgets/search/search_engines.json';
|
import searchEngines from 'features/widgets/search/search_engines.json';
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,10 @@ import { toast } from 'react-toastify';
|
||||||
import { Button } from 'components/Elements';
|
import { Button } from 'components/Elements';
|
||||||
import { Header, CustomActions } from 'components/Layout/Settings';
|
import { Header, CustomActions } from 'components/Layout/Settings';
|
||||||
|
|
||||||
import { saveFile } from 'modules/helpers/settings/modals';
|
import { saveFile } from 'utils/helpers/settings/modals';
|
||||||
|
|
||||||
import achievementsData from 'modules/helpers/settings/achievements.json';
|
import achievementsData from 'utils/data/achievements.json';
|
||||||
import translations from 'modules/helpers/settings/achievement_translations/index';
|
import translations from 'i18n/locales/achievements/index';
|
||||||
|
|
||||||
const achievementLanguage = {
|
const achievementLanguage = {
|
||||||
de_DE: translations.de_DE,
|
de_DE: translations.de_DE,
|
||||||
|
|
|
@ -19,7 +19,7 @@ import Text from '../../../../../../components/Form/Settings/Text/Text';
|
||||||
import ColourSettings from './Colour';
|
import ColourSettings from './Colour';
|
||||||
import CustomSettings from './Custom';
|
import CustomSettings from './Custom';
|
||||||
|
|
||||||
import { values } from 'modules/helpers/settings/modals';
|
import { values } from 'utils/helpers/settings/modals';
|
||||||
|
|
||||||
export default class BackgroundSettings extends PureComponent {
|
export default class BackgroundSettings extends PureComponent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -8,8 +8,8 @@ import {
|
||||||
Action,
|
Action,
|
||||||
} from '../../../../../../components/Layout/Settings/Item/SettingsItem';
|
} from '../../../../../../components/Layout/Settings/Item/SettingsItem';
|
||||||
|
|
||||||
import hexToRgb from 'modules/helpers/background/hexToRgb';
|
import hexToRgb from 'utils/helpers/background/hexToRgb';
|
||||||
import rgbToHex from 'modules/helpers/background/rgbToHex';
|
import rgbToHex from 'utils/helpers/background/rgbToHex';
|
||||||
|
|
||||||
//import '@muetab/react-color-gradient-picker/dist/index.css';
|
//import '@muetab/react-color-gradient-picker/dist/index.css';
|
||||||
import '../../../scss/settings/react-color-picker-gradient-picker-custom-styles.scss';
|
import '../../../scss/settings/react-color-picker-gradient-picker-custom-styles.scss';
|
||||||
|
|
|
@ -9,9 +9,9 @@ import {
|
||||||
MdOutlineFileUpload,
|
MdOutlineFileUpload,
|
||||||
MdFolder,
|
MdFolder,
|
||||||
} from 'react-icons/md';
|
} from 'react-icons/md';
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
import { compressAccurately, filetoDataURL } from 'image-conversion';
|
import { compressAccurately, filetoDataURL } from 'image-conversion';
|
||||||
import { videoCheck } from 'modules/helpers/background/widget';
|
import { videoCheck } from 'utils/helpers/background/widget';
|
||||||
|
|
||||||
import Checkbox from '../../../../../../components/Form/Settings/Checkbox/Checkbox';
|
import Checkbox from '../../../../../../components/Form/Settings/Checkbox/Checkbox';
|
||||||
import FileUpload from '../../../../../../components/Form/Settings/FileUpload/FileUpload';
|
import FileUpload from '../../../../../../components/Form/Settings/FileUpload/FileUpload';
|
||||||
|
|
|
@ -2,9 +2,9 @@ import variables from 'config/variables';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { FileUpload } from 'components/Form/Settings';
|
import { FileUpload } from 'components/Form/Settings';
|
||||||
import { MdCloudUpload } from 'react-icons/md';
|
import { MdCloudUpload } from 'react-icons/md';
|
||||||
import { importSettings as importSettingsFunction } from 'modules/helpers/settings/modals';
|
import { importSettings as importSettingsFunction } from 'utils/helpers/settings/modals';
|
||||||
import { Header } from '../components/Layout';
|
import { Header } from '../components/Layout';
|
||||||
import default_settings from 'modules/default_settings.json';
|
import default_settings from 'utils/data/default_settings.json';
|
||||||
|
|
||||||
function ImportSettings(props) {
|
function ImportSettings(props) {
|
||||||
const [importedSettings, setImportedSettings] = useState([]);
|
const [importedSettings, setImportedSettings] = useState([]);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import variables from 'config/variables';
|
import variables from 'config/variables';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { MdAutoAwesome, MdLightMode, MdDarkMode } from 'react-icons/md';
|
import { MdAutoAwesome, MdLightMode, MdDarkMode } from 'react-icons/md';
|
||||||
import { loadSettings } from 'modules/helpers/settings';
|
import { loadSettings } from 'utils/helpers/settings';
|
||||||
import { Header } from '../components/Layout';
|
import { Header } from '../components/Layout';
|
||||||
|
|
||||||
function ThemeSelection() {
|
function ThemeSelection() {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import variables from 'config/variables';
|
||||||
import { PureComponent } from 'react';
|
import { PureComponent } from 'react';
|
||||||
import { MdArrowBackIosNew, MdArrowForwardIos, MdOutlinePreview } from 'react-icons/md';
|
import { MdArrowBackIosNew, MdArrowForwardIos, MdOutlinePreview } from 'react-icons/md';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
import { ProgressBar } from './components/Elements';
|
import { ProgressBar } from './components/Elements';
|
||||||
import { Button } from 'components/Elements';
|
import { Button } from 'components/Elements';
|
||||||
|
|
|
@ -15,10 +15,10 @@ import {
|
||||||
import { FaDiscord, FaGithub } from 'react-icons/fa';
|
import { FaDiscord, FaGithub } from 'react-icons/fa';
|
||||||
import { Radio, Checkbox, FileUpload } from 'components/Form/Settings';
|
import { Radio, Checkbox, FileUpload } from 'components/Form/Settings';
|
||||||
|
|
||||||
import { loadSettings } from 'modules/helpers/settings';
|
import { loadSettings } from 'utils/helpers/settings';
|
||||||
import { importSettings } from 'modules/helpers/settings/modals';
|
import { importSettings } from 'utils/helpers/settings/modals';
|
||||||
|
|
||||||
import default_settings from 'modules/default_settings.json';
|
import default_settings from 'utils/data/default_settings.json';
|
||||||
import languages from '@/i18n/languages.json';
|
import languages from '@/i18n/languages.json';
|
||||||
|
|
||||||
class WelcomeSections extends PureComponent {
|
class WelcomeSections extends PureComponent {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import Date from './time/Date';
|
||||||
import Message from './message/Message';
|
import Message from './message/Message';
|
||||||
import { WidgetsLayout } from 'components/Layout';
|
import { WidgetsLayout } from 'components/Layout';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
// weather is lazy loaded due to the size of the weather icons module
|
// weather is lazy loaded due to the size of the weather icons module
|
||||||
// since we're using react-icons this might not be accurate,
|
// since we're using react-icons this might not be accurate,
|
||||||
|
|
|
@ -5,17 +5,17 @@ import { PureComponent } from 'react';
|
||||||
|
|
||||||
import PhotoInformation from './PhotoInformation';
|
import PhotoInformation from './PhotoInformation';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
import {
|
import {
|
||||||
videoCheck,
|
videoCheck,
|
||||||
offlineBackground,
|
offlineBackground,
|
||||||
getGradient,
|
getGradient,
|
||||||
randomColourStyleBuilder,
|
randomColourStyleBuilder,
|
||||||
} from 'modules/helpers/background/widget';
|
} from 'utils/helpers/background/widget';
|
||||||
|
|
||||||
import './scss/index.scss';
|
import './scss/index.scss';
|
||||||
import { decodeBlurHash } from 'fast-blurhash';
|
import { decodeBlurHash } from 'fast-blurhash';
|
||||||
import { supportsAVIF } from 'modules/helpers/background/avif';
|
import { supportsAVIF } from 'utils/helpers/background/avif';
|
||||||
|
|
||||||
export default class Background extends PureComponent {
|
export default class Background extends PureComponent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import variables from 'config/variables';
|
import variables from 'config/variables';
|
||||||
import { memo } from 'react';
|
import { memo } from 'react';
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
import { Tooltip } from 'components/Elements';
|
import { Tooltip } from 'components/Elements';
|
||||||
|
|
||||||
import { MdClose, MdDone } from 'react-icons/md';
|
import { MdClose, MdDone } from 'react-icons/md';
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import variables from 'config/variables';
|
import variables from 'config/variables';
|
||||||
import { PureComponent, createRef } from 'react';
|
import { PureComponent, createRef } from 'react';
|
||||||
|
|
||||||
import { nth, convertTimezone } from 'modules/helpers/date';
|
import { nth, convertTimezone } from 'utils/helpers/date';
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
import './greeting.scss';
|
import './greeting.scss';
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { useState, useEffect, useRef } from 'react';
|
import { useState, useEffect, useRef } from 'react';
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
import './message.scss';
|
import './message.scss';
|
||||||
|
|
||||||
const Message = () => {
|
const Message = () => {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { MdPlaylistRemove, MdOutlineApps } from 'react-icons/md';
|
||||||
import { Tooltip } from 'components/Elements';
|
import { Tooltip } from 'components/Elements';
|
||||||
|
|
||||||
import { shift, useFloating } from '@floating-ui/react-dom';
|
import { shift, useFloating } from '@floating-ui/react-dom';
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
class Apps extends PureComponent {
|
class Apps extends PureComponent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import Todo from './Todo';
|
||||||
import Apps from './Apps';
|
import Apps from './Apps';
|
||||||
import Maximise from '../background/Maximise';
|
import Maximise from '../background/Maximise';
|
||||||
import { Tooltip } from 'components/Elements';
|
import { Tooltip } from 'components/Elements';
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
import './scss/index.scss';
|
import './scss/index.scss';
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@ import TextareaAutosize from '@mui/material/TextareaAutosize';
|
||||||
import { toast } from 'react-toastify';
|
import { toast } from 'react-toastify';
|
||||||
import { Tooltip } from 'components/Elements';
|
import { Tooltip } from 'components/Elements';
|
||||||
|
|
||||||
import { saveFile } from 'modules/helpers/settings/modals';
|
import { saveFile } from 'utils/helpers/settings/modals';
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
class Notes extends PureComponent {
|
class Notes extends PureComponent {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
|
@ -15,7 +15,7 @@ import { Tooltip } from 'components/Elements';
|
||||||
import Checkbox from '@mui/material/Checkbox';
|
import Checkbox from '@mui/material/Checkbox';
|
||||||
import { shift, useFloating } from '@floating-ui/react-dom';
|
import { shift, useFloating } from '@floating-ui/react-dom';
|
||||||
import { sortableContainer, sortableElement, sortableHandle } from '@muetab/react-sortable-hoc';
|
import { sortableContainer, sortableElement, sortableHandle } from '@muetab/react-sortable-hoc';
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
const SortableItem = sortableElement(({ value }) => <div>{value}</div>);
|
const SortableItem = sortableElement(({ value }) => <div>{value}</div>);
|
||||||
const SortableContainer = sortableContainer(({ children }) => <div>{children}</div>);
|
const SortableContainer = sortableContainer(({ children }) => <div>{children}</div>);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { PureComponent, createRef } from 'react';
|
import { PureComponent, createRef } from 'react';
|
||||||
import { Tooltip } from 'components/Elements';
|
import { Tooltip } from 'components/Elements';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
import './quicklinks.scss';
|
import './quicklinks.scss';
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ import { ShareModal } from 'components/Elements';
|
||||||
|
|
||||||
import offline_quotes from './offline_quotes.json';
|
import offline_quotes from './offline_quotes.json';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
import './quote.scss';
|
import './quote.scss';
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { FaYandex } from 'react-icons/fa';
|
||||||
import { Tooltip } from 'components/Elements';
|
import { Tooltip } from 'components/Elements';
|
||||||
import AutocompleteInput from 'features/helpers/autocomplete/Autocomplete';
|
import AutocompleteInput from 'features/helpers/autocomplete/Autocomplete';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
import './search.scss';
|
import './search.scss';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { PureComponent, Suspense, lazy } from 'react';
|
import { PureComponent, Suspense, lazy } from 'react';
|
||||||
|
|
||||||
import { convertTimezone } from 'modules/helpers/date';
|
import { convertTimezone } from 'utils/helpers/date';
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
import './clock.scss';
|
import './clock.scss';
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import variables from 'config/variables';
|
import variables from 'config/variables';
|
||||||
import { PureComponent, createRef } from 'react';
|
import { PureComponent, createRef } from 'react';
|
||||||
|
|
||||||
import { nth, convertTimezone } from '../../../modules/helpers/date';
|
import { nth, convertTimezone } from 'utils/helpers/date';
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
import './date.scss';
|
import './date.scss';
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { PureComponent } from 'react';
|
||||||
import WeatherIcon from './WeatherIcon';
|
import WeatherIcon from './WeatherIcon';
|
||||||
import Expanded from './Expanded';
|
import Expanded from './Expanded';
|
||||||
|
|
||||||
import EventBus from 'modules/helpers/eventbus';
|
import EventBus from 'utils/helpers/eventbus';
|
||||||
|
|
||||||
import './weather.scss';
|
import './weather.scss';
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ import './scss/index.scss';
|
||||||
// the toast css is based on default so we need to import it
|
// the toast css is based on default so we need to import it
|
||||||
import 'react-toastify/dist/ReactToastify.min.css';
|
import 'react-toastify/dist/ReactToastify.min.css';
|
||||||
|
|
||||||
import { initTranslations } from './modules/translations';
|
import { initTranslations } from 'utils/translations';
|
||||||
|
|
||||||
const languagecode = localStorage.getItem('language') || 'en_GB';
|
const languagecode = localStorage.getItem('language') || 'en_GB';
|
||||||
variables.language = initTranslations(languagecode);
|
variables.language = initTranslations(languagecode);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// since there is so much code in the component, we have moved it to a separate file
|
// since there is so much code in the component, we have moved it to a separate file
|
||||||
import offlineImages from './offlineImages.json';
|
import offlineImages from 'utils/data/offline_images.json';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If the URL starts with `data:video/` or ends with `.mp4`, `.webm`, or `.ogg`, then it's a video.
|
* If the URL starts with `data:video/` or ends with `.mp4`, `.webm`, or `.ogg`, then it's a video.
|
|
@ -1,7 +1,7 @@
|
||||||
import variables from 'config/variables';
|
import variables from 'config/variables';
|
||||||
import experimentalInit from '../experimental';
|
import experimentalInit from '../experimental';
|
||||||
|
|
||||||
import defaultSettings from 'modules/default_settings.json';
|
import defaultSettings from 'utils/data/default_settings.json';
|
||||||
import languages from '@/i18n/languages.json';
|
import languages from '@/i18n/languages.json';
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -98,9 +98,10 @@ export default defineConfig(({ command, mode }) => {
|
||||||
extensions: ['.js', '.jsx'],
|
extensions: ['.js', '.jsx'],
|
||||||
alias: {
|
alias: {
|
||||||
'@': path.resolve(__dirname, './src'),
|
'@': path.resolve(__dirname, './src'),
|
||||||
|
i18n: path.resolve(__dirname, './src/i18n'),
|
||||||
features: path.resolve(__dirname, './src/features'),
|
features: path.resolve(__dirname, './src/features'),
|
||||||
components: path.resolve(__dirname, './src/components'),
|
components: path.resolve(__dirname, './src/components'),
|
||||||
modules: path.resolve(__dirname, './src/modules'),
|
utils: path.resolve(__dirname, './src/utils'),
|
||||||
translations: path.resolve(__dirname, './src/i18n/locales'),
|
translations: path.resolve(__dirname, './src/i18n/locales'),
|
||||||
config: path.resolve(__dirname, './src/config'),
|
config: path.resolve(__dirname, './src/config'),
|
||||||
scss: path.resolve(__dirname, './src/scss'),
|
scss: path.resolve(__dirname, './src/scss'),
|
||||||
|
|
Loading…
Reference in New Issue