Skip to content

Commit daee5c7

Browse files
authored
Refactored now (#29)
* redy to recover Terminal dir * as Mike asked ... commit what you have :) * fir anyone to have a look - DONT RUN * works !!!
1 parent 9f28408 commit daee5c7

File tree

106 files changed

+851
-3339
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+851
-3339
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

static/index-dev.html renamed to public/index-dev.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<base href="../" />
66
<script charset="UTF-8" src="dist-dev/prompt.js"></script>
7-
<link rel="stylesheet" href="static/bulma-0.9.4.min.css" />
7+
<link rel="stylesheet" href="public/bulma-0.9.4.min.css" />
88
<link rel="stylesheet" href="dist-dev/prompt.css" />
99
</head>
1010
<body>

static/index.html renamed to public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<base href="../" />
66
<script charset="UTF-8" src="dist/prompt.js"></script>
7-
<link rel="stylesheet" href="static/bulma-0.9.4.min.css" />
7+
<link rel="stylesheet" href="public/bulma-0.9.4.min.css" />
88
<link rel="stylesheet" href="dist/prompt.css" />
99
</head>
1010
<body>

src/main/Main.tsx renamed to src/app/app.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,29 @@ import { If } from "tsx-control-statements/components";
66
import dayjs from "dayjs";
77
import type { ContextMenuOpts } from "../types/types";
88
import localizedFormat from "dayjs/plugin/localizedFormat";
9-
import { GlobalModel } from "../model";
9+
import { GlobalModel } from "../model/model";
1010
import { isBlank } from "../util/util";
1111
import { BookmarksView } from "./bookmarks/bookmarks";
12-
import { WebShareView } from "../webshare/webshare-client-view";
1312
import { HistoryView } from "./history/history";
14-
import { ScreenSettingsModal, SessionSettingsModal, LineSettingsModal, ClientSettingsModal } from "./modals/settings";
15-
import { RemotesModal } from "../remotes/remotes";
16-
import { TosModal } from "./modals/Modals";
17-
import { SessionView } from "./sessionview/SessionView";
13+
import {
14+
ScreenSettingsModal,
15+
SessionSettingsModal,
16+
LineSettingsModal,
17+
ClientSettingsModal,
18+
} from "./common/modals/settings";
19+
import { RemotesModal } from "./connections/connections";
20+
import { TosModal } from "./common/modals/modals";
21+
import { WorkspaceView } from "../app/workspace/workspaceview";
1822
import { MainSideBar } from "./sidebar/MainSideBar";
19-
import { DisconnectedModal, ClientStopModal, AlertModal, WelcomeModal } from "./modals/Modals";
23+
import { DisconnectedModal, ClientStopModal, AlertModal, WelcomeModal } from "./common/modals/modals";
2024
import "../index.less";
2125

2226
dayjs.extend(localizedFormat);
2327

2428
type OV<V> = mobx.IObservableValue<V>;
2529

2630
@mobxReact.observer
27-
class Main extends React.Component<{}, {}> {
31+
class App extends React.Component<{}, {}> {
2832
dcWait: OV<boolean> = mobx.observable.box(false, { name: "dcWait" });
2933

3034
constructor(props: any) {
@@ -102,10 +106,9 @@ class Main extends React.Component<{}, {}> {
102106
<div id="main" onContextMenu={this.handleContextMenu}>
103107
<div className="main-content">
104108
<MainSideBar />
105-
<SessionView />
109+
<WorkspaceView />
106110
<HistoryView />
107111
<BookmarksView />
108-
<WebShareView />
109112
</div>
110113
<AlertModal />
111114
<If condition={GlobalModel.needsTos()}>
@@ -138,4 +141,4 @@ class Main extends React.Component<{}, {}> {
138141
}
139142
}
140143

141-
export { Main };
144+
export { App };
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.

src/main/bookmarks/bookmarks.tsx renamed to src/app/bookmarks/bookmarks.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { boundMethod } from "autobind-decorator";
55
import { If, For } from "tsx-control-statements/components";
66
import cn from "classnames";
77
import type { BookmarkType } from "../../types/types";
8-
import { GlobalModel } from "../../model";
9-
import { CmdStrCode, Markdown } from "../../common/common";
8+
import { GlobalModel } from "../../model/model";
9+
import { CmdStrCode, Markdown } from "../common/common";
1010

1111
import "./bookmarks.less";
1212

src/common/common.less renamed to src/app/common/common.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "../index.less";
1+
@import "../../index.less";
22

33
.info-message {
44
position: relative;

src/common/common.tsx renamed to src/app/common/common.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import ReactMarkdown from "react-markdown";
66
import remarkGfm from "remark-gfm";
77
import cn from "classnames";
88
import { If } from "tsx-control-statements/components";
9-
import type { RemoteType } from "../types/types";
9+
import type { RemoteType } from "../../types/types";
1010

1111
import "./common.less";
1212

src/main/modals/modals.less renamed to src/app/common/modals/modals.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "../../index.less";
1+
@import "../../../index.less";
22

33
// modal css (also includes settings-field)
44

src/main/modals/Modals.tsx renamed to src/app/common/modals/modals.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { If, For } from "tsx-control-statements/components";
66
import cn from "classnames";
77
import dayjs from "dayjs";
88
import localizedFormat from "dayjs/plugin/localizedFormat";
9-
import { GlobalModel } from "../../model";
10-
import { Markdown } from "../../common/common";
9+
import { GlobalModel } from "../../../model/model";
10+
import { Markdown } from "../common";
1111

1212
dayjs.extend(localizedFormat);
1313

src/main/modals/settings.tsx renamed to src/app/common/modals/settings.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import * as mobx from "mobx";
44
import { boundMethod } from "autobind-decorator";
55
import { If, For } from "tsx-control-statements/components";
66
import cn from "classnames";
7-
import { GlobalModel, GlobalCommandRunner, TabColors } from "../../model";
8-
import { Toggle, InlineSettingsTextEdit, SettingsError, InfoMessage } from "../../common/common";
9-
import { LineType, RendererPluginType, ClientDataType, CommandRtnType } from "../../types/types";
10-
import { PluginModel } from "../../plugins/plugins";
11-
import * as util from "../../util/util";
7+
import { GlobalModel, GlobalCommandRunner, TabColors } from "../../../model/model";
8+
import { Toggle, InlineSettingsTextEdit, SettingsError, InfoMessage } from "../common";
9+
import { LineType, RendererPluginType, ClientDataType, CommandRtnType } from "../../../types/types";
10+
import { PluginModel } from "../../../plugins/plugins";
11+
import * as util from "../../../util/util";
1212

1313
import "./modals.less";
1414

src/app/common/prompt/prompt.less

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
@import "../../../index.less";
2+
3+
.term-prompt {
4+
font-weight: 300;
5+
.icon {
6+
margin: 0 4px 0 2px;
7+
vertical-align: middle;
8+
width: 1.2em;
9+
height: 1.2em;
10+
fill: @prompt-green;
11+
}
12+
13+
.term-prompt-branch {
14+
color: @term-white;
15+
}
16+
17+
.term-prompt-python {
18+
color: @term-bright-magenta;
19+
}
20+
21+
.term-prompt-remote {
22+
i {
23+
margin-right: 0;
24+
}
25+
}
26+
27+
.term-prompt-remote {
28+
color: @term-bright-green;
29+
30+
&.color-green {
31+
color: @term-bright-green;
32+
}
33+
34+
&.color-red {
35+
color: @term-bright-red;
36+
}
37+
38+
&.color-blue {
39+
color: @term-bright-blue;
40+
}
41+
42+
&.color-yellow {
43+
color: @term-bright-yellow;
44+
}
45+
46+
&.color-magenta {
47+
color: @term-bright-magenta;
48+
}
49+
50+
&.color-cyan {
51+
color: @term-bright-cyan;
52+
}
53+
54+
&.color-white {
55+
color: @term-bright-white;
56+
}
57+
58+
&.color-orange {
59+
color: @tab-orange;
60+
}
61+
}
62+
63+
.term-prompt-cwd {
64+
color: @term-bright-green;
65+
}
66+
67+
.term-prompt-end {
68+
color: @term-bright-green;
69+
}
70+
}

src/terminal/prompt.tsx renamed to src/app/common/prompt/prompt.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import * as mobxReact from "mobx-react";
33
import * as mobx from "mobx";
44
import dayjs from "dayjs";
55
import localizedFormat from "dayjs/plugin/localizedFormat";
6-
import { GlobalModel, LineContainerModel } from "../model";
7-
import type { LineType, RemoteType, RemotePtrType, LineHeightChangeCallbackType } from "../../types/types";
6+
import { GlobalModel, LineContainerModel } from "../../../model/model";
7+
import type { LineType, RemoteType, RemotePtrType, LineHeightChangeCallbackType } from "../../../types/types";
88
import cn from "classnames";
9-
import { isBlank } from "../util/util";
10-
import { ReactComponent as FolderIcon } from "../assets/icons/folder.svg";
9+
import { isBlank } from "../../../util/util";
10+
import { ReactComponent as FolderIcon } from "../../assets/icons/folder.svg";
1111

12-
import "./terminal.less";
12+
import "./prompt.less";
1313

1414
dayjs.extend(localizedFormat);
1515

File renamed without changes.

src/remotes/remotes.less renamed to src/app/connections/connections.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "../index.less";
1+
@import "../../index.less";
22

33
.modal.prompt-modal.remotes-modal {
44
.modal-content {

src/remotes/remotes.tsx renamed to src/app/connections/connections.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import * as mobx from "mobx";
44
import { boundMethod } from "autobind-decorator";
55
import { If, For } from "tsx-control-statements/components";
66
import cn from "classnames";
7-
import { GlobalModel, GlobalCommandRunner, RemotesModalModel } from "../model";
7+
import { GlobalModel, GlobalCommandRunner, RemotesModalModel } from "../../model/model";
88
import { Toggle, RemoteStatusLight, InfoMessage } from "../common/common";
9-
import { RemoteType, RemoteEditType } from "../types/types";
10-
import * as util from "../util/util";
11-
import * as textmeasure from "../util/textmeasure";
9+
import { RemoteType, RemoteEditType } from "../../types/types";
10+
import * as util from "../../util/util";
11+
import * as textmeasure from "../../util/textmeasure";
1212

13-
import "./remotes.less";
13+
import "./connections.less";
1414

1515
type OV<V> = mobx.IObservableValue<V>;
1616
type OArr<V> = mobx.IObservableArray<V>;
File renamed without changes.

src/main/history/history.tsx renamed to src/app/history/history.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import { If, For, When, Otherwise, Choose } from "tsx-control-statements/compone
55
import { sprintf } from "sprintf-js";
66
import { boundMethod } from "autobind-decorator";
77
import cn from "classnames";
8-
import { GlobalModel, GlobalCommandRunner, Cmd } from "../../model";
8+
import { GlobalModel, GlobalCommandRunner, Cmd } from "../../model/model";
99
import { HistoryItem, RemotePtrType, LineType, CmdDataType } from "../../types/types";
1010
import dayjs from "dayjs";
1111
import localizedFormat from "dayjs/plugin/localizedFormat";
1212
import customParseFormat from "dayjs/plugin/customParseFormat";
1313
import { Line } from "../line/linecomps";
14-
import { CmdStrCode } from "../../common/common";
14+
import { CmdStrCode } from "../common/common";
1515

1616
import "./history.less";
1717

src/main/line/linecomps.tsx renamed to src/app/line/linecomps.tsx

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,34 @@ import { boundMethod } from "autobind-decorator";
66
import dayjs from "dayjs";
77
import localizedFormat from "dayjs/plugin/localizedFormat";
88
import { If } from "tsx-control-statements/components";
9-
import { GlobalModel, GlobalCommandRunner, Cmd, getTermPtyData } from "../../model";
9+
import { GlobalModel, GlobalCommandRunner, Cmd, getTermPtyData } from "../../model/model";
1010
import { termHeightFromRows } from "../../util/textmeasure";
1111
import type {
1212
LineType,
13-
CmdDataType,
1413
RemoteType,
1514
RemotePtrType,
1615
RenderModeType,
17-
RendererContext,
1816
RendererOpts,
19-
SimpleBlobRendererComponent,
2017
RendererPluginType,
2118
LineHeightChangeCallbackType,
2219
RendererModelInitializeParams,
2320
RendererModel,
2421
} from "../../types/types";
2522
import cn from "classnames";
2623

27-
import { ReactComponent as FavouritesIcon } from "../../assets/icons/favourites.svg";
28-
import { ReactComponent as PinIcon } from "../../assets/icons/pin.svg";
29-
import { ReactComponent as PlusIcon } from "../../assets/icons/plus.svg";
30-
import { ReactComponent as MinusIcon } from "../../assets/icons/minus.svg";
24+
import { ReactComponent as FavouritesIcon } from "../assets/icons/favourites.svg";
25+
import { ReactComponent as PinIcon } from "../assets/icons/pin.svg";
26+
import { ReactComponent as PlusIcon } from "../assets/icons/plus.svg";
27+
import { ReactComponent as MinusIcon } from "../assets/icons/minus.svg";
3128

32-
import type { LineContainerModel } from "../../model";
33-
import { renderCmdText } from "../../common/common";
34-
import { SimpleBlobRenderer } from "./renderer/simplerenderer";
35-
import { FullRenderer } from "./renderer/fullrenderer";
36-
import { TerminalRenderer } from "../../common/terminal/Terminal";
29+
import type { LineContainerModel } from "../../model/model";
30+
import { renderCmdText } from "../common/common";
31+
import { SimpleBlobRenderer } from "../../plugins/renderer/basicrenderer";
32+
import { IncrementalRenderer } from "../../plugins/renderer/incrementalrenderer";
33+
import { TerminalRenderer } from "../../plugins/terminal/Terminal";
3734
import { isBlank } from "../../util/util";
3835
import { PluginModel } from "../../plugins/plugins";
39-
import { Prompt } from "../../terminal/prompt";
36+
import { Prompt } from "../common/prompt/prompt";
4037
import * as lineutil from "./lineutil";
4138

4239
import "./lines.less";
@@ -776,7 +773,7 @@ class LineCmd extends React.Component<
776773
/>
777774
</If>
778775
<If condition={rendererPlugin != null && rendererPlugin.rendererType == "full"}>
779-
<FullRenderer
776+
<IncrementalRenderer
780777
rendererContainer={screen}
781778
lineId={line.lineid}
782779
plugin={rendererPlugin}
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/main/line/renderer/simplerenderer.tsx renamed to src/app/line/renderer/basicrenderer.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ import type {
1919
LineType,
2020
TermContextUnion,
2121
RendererContainerType,
22-
} from "../../../types/types";
23-
import * as T from "../../../types/types";
24-
import { PacketDataBuffer } from "../../../terminal/ptydata";
22+
} from "../../types/types";
23+
import * as T from "../../types/types";
24+
import { PacketDataBuffer } from "../../common/prompt/ptydata";
2525
import { debounce, throttle } from "throttle-debounce";
26-
import * as util from "../../../util/util";
27-
import { GlobalModel } from "../../../model";
26+
import * as util from "../../util/util";
27+
import { GlobalModel } from "../../model/model";
2828

2929
type OV<V> = mobx.IObservableValue<V>;
3030
type CV<V> = mobx.IComputedValue<V>;

src/main/sidebar/MainSideBar.tsx renamed to src/app/sidebar/MainSideBar.tsx

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,25 @@ import * as React from "react";
22
import * as mobxReact from "mobx-react";
33
import * as mobx from "mobx";
44
import { boundMethod } from "autobind-decorator";
5-
import { If, For } from "tsx-control-statements/components";
65
import cn from "classnames";
76
import dayjs from "dayjs";
87
import type { RemoteType } from "../../types/types";
98

10-
import { ReactComponent as LeftChevronIcon } from "../../assets/icons/chevron_left.svg";
11-
import { ReactComponent as HelpIcon } from "../../assets/icons/help.svg";
12-
import { ReactComponent as SettingsIcon } from "../../assets/icons/settings.svg";
13-
import { ReactComponent as DiscordIcon } from "../../assets/icons/discord.svg";
14-
import { ReactComponent as HistoryIcon } from "../../assets/icons/history.svg";
15-
import { ReactComponent as FavouritesIcon } from "../../assets/icons/favourites.svg";
16-
import { ReactComponent as AppsIcon } from "../../assets/icons/apps.svg";
17-
import { ReactComponent as ConnectionsIcon } from "../../assets/icons/connections.svg";
18-
import { ReactComponent as WorkspacesIcon } from "../../assets/icons/workspaces.svg";
19-
import { ReactComponent as AddIcon } from "../../assets/icons/add.svg";
20-
import { ReactComponent as ActionsIcon } from "../../assets/icons/tab/actions.svg";
9+
import { ReactComponent as LeftChevronIcon } from "../assets/icons/chevron_left.svg";
10+
import { ReactComponent as HelpIcon } from "../assets/icons/help.svg";
11+
import { ReactComponent as SettingsIcon } from "../assets/icons/settings.svg";
12+
import { ReactComponent as DiscordIcon } from "../assets/icons/discord.svg";
13+
import { ReactComponent as HistoryIcon } from "../assets/icons/history.svg";
14+
import { ReactComponent as FavouritesIcon } from "../assets/icons/favourites.svg";
15+
import { ReactComponent as AppsIcon } from "../assets/icons/apps.svg";
16+
import { ReactComponent as ConnectionsIcon } from "../assets/icons/connections.svg";
17+
import { ReactComponent as WorkspacesIcon } from "../assets/icons/workspaces.svg";
18+
import { ReactComponent as AddIcon } from "../assets/icons/add.svg";
19+
import { ReactComponent as ActionsIcon } from "../assets/icons/tab/actions.svg";
2120

2221
import localizedFormat from "dayjs/plugin/localizedFormat";
23-
import { GlobalModel, GlobalCommandRunner, Session } from "../../model";
22+
import { GlobalModel, GlobalCommandRunner, Session } from "../../model/model";
2423
import { sortAndFilterRemotes, isBlank, openLink } from "../../util/util";
25-
import { RemoteStatusLight } from "../../common/common";
2624

2725
import "./sidebar.less";
2826

src/main/sidebar/sidebar.less renamed to src/app/sidebar/sidebar.less

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
.main-sidebar {
44
padding: 0;
55
width: 20rem;
6+
min-width: 20rem;
67
overflow-x: hidden;
78
display: flex;
89
flex-direction: column;
@@ -253,9 +254,3 @@
253254
}
254255
}
255256
}
256-
257-
.menu-list .emote-status.status-connecting {
258-
position: relative;
259-
top: 0px;
260-
margin-left: -3px;
261-
}

0 commit comments

Comments
 (0)