Skip to content

Commit

Permalink
Improved source code structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
hubuk committed May 8, 2024
1 parent 91238f7 commit ccacb63
Show file tree
Hide file tree
Showing 56 changed files with 46 additions and 37 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"cSpell.words": [
"browserslist",
"bson",
"Bukowski",
"camelcase",
"csstype",
"Descriptable",
Expand Down
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { CSSObject, Global, ThemeProvider } from '@emotion/react';
import { BrowserRouter } from 'react-router-dom';
import { Provider } from 'react-redux'
import { PersistGate } from 'redux-persist/integration/react';
import MainView from 'src/components/views/main/MainView';
import MainView from 'src/views/main/MainView';
import { theme } from 'src/styles/themes';
import store, { persistor } from 'src/store';
import { DialogProvider } from 'src/components/common/Dialog';
import ScreenOrientationProvider from 'src/components/common/ScreenOrientationProvider';
import { DialogProvider } from 'src/components/Dialog';
import ScreenOrientationProvider from 'src/contexts/ScreenOrientationContext';

interface Props {
basename?: string,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
//
// @jsxImportSource @emotion/react

import Toolbar from 'src/components/common/Toolbar';
import Toolbar from 'src/components/Toolbar';
import { useRootSelector } from 'src/hooks/useRootSelector';
import EditTilesButton from '../EditTilesButton';
import AddTileButton from '../AddTileButton';
import ClearTilesButton from '../ClearTilesButton';
import EditTilesButton from './EditTilesButton';
import AddTileButton from './AddTileButton';
import ClearTilesButton from './ClearTilesButton';

export default function EditWorkspaceToolbox() {
const isTileEditorActive = useRootSelector((state) => state.editor.isActive);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React, { useCallback, useContext, useEffect, useMemo } from 'react';
import { ReactElement } from 'react-markdown/lib/react-markdown';
import { mergeStyles } from 'src/styles/mergeStyles';
import { cloneElementWithEmotion } from 'src/types';
import { ScreenOrientationContext } from './ScreenOrientationProvider';
import { ScreenOrientationContext } from '../contexts/ScreenOrientationContext';

type Direction = 'horizontal' | 'vertical'

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
//
// @jsxImportSource @emotion/react

import { DialogLink } from 'src/components/common/Dialog';
import TermsOfUse from 'src/components/documents/TermsOfUse';
import { DialogLink } from 'src/components/Dialog';
import TermsOfUse from 'src/documents/TermsOfUse';

export default function TermsOfUseLink() {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
//
// @jsxImportSource @emotion/react

import { DialogLink } from 'src/components/common/Dialog';
import ThirdPartyLicenses from 'src/components/documents/ThirdPartyLicenses';
import { DialogLink } from 'src/components/Dialog';
import ThirdPartyLicenses from 'src/documents/ThirdPartyLicenses';

export default function ThirdPartyLicensesLink() {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import { CSSObject } from '@emotion/react';
import { TileDefinition } from 'src/store/tiles';
import CloseButton from 'src/components/common/CloseButton';
import EditButton from 'src/components/specialized/EditButton';
import CloseButton from 'src/components/CloseButton';
import EditButton from 'src/components/EditButton';
import { AriaAttributes, useCallback, useMemo } from 'react';
import Box from 'src/components/common/Box';
import Box from 'src/components/Box';
import { mergeStyles } from 'src/styles/mergeStyles';
import { useRootSelector } from 'src/hooks/useRootSelector';
import { Entity } from 'src/types';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import { CSSObject } from '@emotion/react';
import { AriaAttributes } from 'react';
import Dialog from 'src/components/common/Dialog';
import Dialog from 'src/components/Dialog';
import { TileDefinition } from 'src/store/tiles';
import { Entity } from 'src/types';
import TileNameEditor from './TileNameEditor';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

import { useCallback, useEffect } from 'react';
import { useDispatch } from 'react-redux';
import FlowContainer from 'src/components/common/FlowContainer';
import FlowContainer from 'src/components/FlowContainer';
import { useRootSelector } from 'src/hooks/useRootSelector';
import { selectAllTiles, removeTile } from 'src/store/tiles';
import { startEditing, stopEditing } from 'src/store/editor';
import TileBox from './tiles/running/TileBox';
import TileEditorDialog from './tiles/editing/TileEditorDialog';
import TileBox from './TileBox';
import TileEditorDialog from './TileEditorDialog';

export default function TileGallery() {
const dispatch = useDispatch();
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
//
// @jsxImportSource @emotion/react

import { DialogLink } from 'src/components/common/Dialog';
import VersionHistory from 'src/components/documents/VersionHistory';
import { DialogLink } from 'src/components/Dialog';
import VersionHistory from 'src/documents/VersionHistory';

export default function VersionHistoryLink() {
return (
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
// @jsxImportSource @emotion/react

import raw from 'raw.macro';
import MarkdownDocument from '../common/MarkdownDocument';
import MarkdownDocument from '../components/MarkdownDocument';

const termsOfUse = raw('../../../docs/TermsOfUse.md');
const termsOfUse = raw('../../docs/TermsOfUse.md');

export default function TermsOfUse() {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

import { useCallback, useState } from 'react';
import thirdPartyLicenses from 'src/thirdPartyLicenses.g.json';
import Accordion from '../common/Accordion';
import MarkdownDocument from '../common/MarkdownDocument';
import Accordion from '../components/Accordion';
import MarkdownDocument from '../components/MarkdownDocument';

const documents: Record<string, string> = {};
thirdPartyLicenses.forEach(entry => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @jsxImportSource @emotion/react

import versionHistory from 'src/versionHistory.g.json';
import MarkdownDocument from '../common/MarkdownDocument';
import MarkdownDocument from '../components/MarkdownDocument';

const documentLines: string[] = [];
versionHistory.forEach(entry => {
Expand Down
2 changes: 1 addition & 1 deletion src/emotion.d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import '@emotion/react';
import type { Property } from 'csstype';
import { DockDirection } from 'src/components/common/Dock';
import { DockDirection } from 'src/components/Dock';

declare module '@emotion/react' {
export interface Theme {
Expand Down
8 changes: 6 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// @jsxImportSource @emotion/react

import React from 'react';
import React, { StrictMode } from 'react';
import ReactDOM from 'react-dom';
import { createRoot } from 'react-dom/client';
import axe from '@axe-core/react';
Expand All @@ -25,4 +25,8 @@ if (process.env.NODE_ENV !== 'production') {
}

const root = createRoot(rootElement);
root.render(<App basename={baseUrl} />);
root.render(
<StrictMode>
<App basename={baseUrl} />
</StrictMode>
);
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
//
// @jsxImportSource @emotion/react

import Dock from 'src/components/common/Dock/Dock';
import LinksSection from 'src/components/specialized/LinksSection';
import VersionLabel from 'src/components/specialized/VersionLabel';
import Dock from 'src/components/Dock/Dock';
import LinksSection from 'src/components/LinksSection';
import VersionLabel from 'src/components/VersionLabel';

export default function Footer() {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @jsxImportSource @emotion/react

import { CSSObject } from '@emotion/react';
import TilesTokenInput from 'src/components/specialized/TilesTokenInput';
import TilesTokenInput from 'src/components/TilesTokenInput';

const titleStyle: CSSObject = {
display: 'inline-block',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// @jsxImportSource @emotion/react

import { CSSObject } from '@emotion/react';
import Dock from 'src/components/common/Dock';
import Dock from 'src/components/Dock';
import Footer from './Footer';
import Header from './Header';
import Toolbox from './Toolbox';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// @jsxImportSource @emotion/react

import EditWorkspaceToolbox from 'src/components/specialized/tiles/EditWorkspaceToolbox';
import EditWorkspaceToolbox from 'src/components/EditWorkspaceToolbox';

export default function Toolbox() {
return <EditWorkspaceToolbox />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import { CSSObject, useTheme } from '@emotion/react';
import { useMemo } from 'react';
import { mergeStyles } from 'src/styles/mergeStyles';
import TileGalleryView from 'src/components/specialized/TileGallery';
import TileGalleryView from 'src/components/TileGallery';
import Dock from 'src/components/Dock';

const baseStyle: CSSObject = {
label: 'Workspace',
Expand All @@ -25,7 +26,10 @@ export default function Workspace() {

return (
<main css={style}>
<TileGalleryView />
<Dock>
<TileGalleryView dock-direction="top" />
<TileGalleryView dock-direction="fill" />
</Dock>
</main>
);
}

0 comments on commit ccacb63

Please sign in to comment.