reorganize models
This commit is contained in:
Vendored
+6
-6
@@ -335,7 +335,7 @@
|
|||||||
return a.localeCompare(b);
|
return a.localeCompare(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
// src/Model/storageModel.ts
|
// src/Model/Global/storageModel.ts
|
||||||
var PATH_COMPONENT_SEPARATOR = "\\";
|
var PATH_COMPONENT_SEPARATOR = "\\";
|
||||||
var StorageModel = class _StorageModel {
|
var StorageModel = class _StorageModel {
|
||||||
storageEntryTree = {};
|
storageEntryTree = {};
|
||||||
@@ -467,7 +467,7 @@
|
|||||||
chatFiles: [DATA_VERSION, "chat", "files"]
|
chatFiles: [DATA_VERSION, "chat", "files"]
|
||||||
};
|
};
|
||||||
|
|
||||||
// src/Model/fileModel.ts
|
// src/Model/Files/fileModel.ts
|
||||||
var FileModel = class _FileModel {
|
var FileModel = class _FileModel {
|
||||||
chatModel;
|
chatModel;
|
||||||
storageModel;
|
storageModel;
|
||||||
@@ -642,7 +642,7 @@
|
|||||||
return Color2;
|
return Color2;
|
||||||
})(Color || {});
|
})(Color || {});
|
||||||
|
|
||||||
// src/Model/chatModel.ts
|
// src/Model/Chat/chatModel.ts
|
||||||
var ChatModel = class _ChatModel {
|
var ChatModel = class _ChatModel {
|
||||||
connectionModel;
|
connectionModel;
|
||||||
storageModel;
|
storageModel;
|
||||||
@@ -867,7 +867,7 @@
|
|||||||
stringifiedFile: ""
|
stringifiedFile: ""
|
||||||
};
|
};
|
||||||
|
|
||||||
// src/Model/chatListModel.ts
|
// src/Model/Chat/chatListModel.ts
|
||||||
var ChatListModel = class {
|
var ChatListModel = class {
|
||||||
storageModel;
|
storageModel;
|
||||||
settingsModel;
|
settingsModel;
|
||||||
@@ -1826,7 +1826,7 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// src/Model/connectionModel.ts
|
// src/Model/Global/connectionModel.ts
|
||||||
var ConnectionModel = class {
|
var ConnectionModel = class {
|
||||||
udn;
|
udn;
|
||||||
storageModel;
|
storageModel;
|
||||||
@@ -2198,7 +2198,7 @@
|
|||||||
return /* @__PURE__ */ createElement("article", { id: "home-page" }, /* @__PURE__ */ createElement("div", null, overviewSection, chatSection));
|
return /* @__PURE__ */ createElement("article", { id: "home-page" }, /* @__PURE__ */ createElement("div", null, overviewSection, chatSection));
|
||||||
}
|
}
|
||||||
|
|
||||||
// src/Model/settingsModel.ts
|
// src/Model/Global/settingsModel.ts
|
||||||
var SettingsModel = class {
|
var SettingsModel = class {
|
||||||
storageModel;
|
storageModel;
|
||||||
username;
|
username;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import StorageModel, { storageKeys } from "./storageModel";
|
import StorageModel, { storageKeys } from "../Global/storageModel";
|
||||||
|
|
||||||
import ChatModel from "./chatModel";
|
import ChatModel from "./chatModel";
|
||||||
import ConnectionModel from "./connectionModel";
|
import ConnectionModel from "../Global/connectionModel";
|
||||||
import { Message } from "udn-frontend";
|
import { Message } from "udn-frontend";
|
||||||
import SettingsModel from "./settingsModel";
|
import SettingsModel from "../Global/settingsModel";
|
||||||
import { localeCompare } from "./Utility/utility";
|
import { localeCompare } from "../Utility/utility";
|
||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
|
|
||||||
export default class ChatListModel {
|
export default class ChatListModel {
|
||||||
@@ -1,19 +1,19 @@
|
|||||||
// this file is responsible for managing chats.
|
// this file is responsible for managing chats.
|
||||||
|
|
||||||
import { DATA_VERSION, ValidObject } from "./Utility/typeSafety";
|
import { DATA_VERSION, ValidObject } from "../Utility/typeSafety";
|
||||||
import FileModel, { File } from "./fileModel";
|
import FileModel, { File } from "../Files/fileModel";
|
||||||
import StorageModel, { storageKeys } from "./storageModel";
|
import StorageModel, { storageKeys } from "../Global/storageModel";
|
||||||
import {
|
import {
|
||||||
createTimestamp,
|
createTimestamp,
|
||||||
parseValidObject,
|
parseValidObject,
|
||||||
stringify,
|
stringify,
|
||||||
} from "./Utility/utility";
|
} from "../Utility/utility";
|
||||||
import { decryptString, encryptString } from "./Utility/crypto";
|
import { decryptString, encryptString } from "../Utility/crypto";
|
||||||
|
|
||||||
import ChatListModel from "./chatListModel";
|
import ChatListModel from "./chatListModel";
|
||||||
import { Color } from "../ViewModel/colors";
|
import { Color } from "../../ViewModel/colors";
|
||||||
import ConnectionModel from "./connectionModel";
|
import ConnectionModel from "../Global/connectionModel";
|
||||||
import SettingsModel from "./settingsModel";
|
import SettingsModel from "../Global/settingsModel";
|
||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
|
|
||||||
export default class ChatModel {
|
export default class ChatModel {
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
// this file is responsible for managing files within chats.
|
// this file is responsible for managing files within chats.
|
||||||
|
|
||||||
import { DATA_VERSION, ValidObject } from "./Utility/typeSafety";
|
import { DATA_VERSION, ValidObject } from "../Utility/typeSafety";
|
||||||
import StorageModel, { storageKeys } from "./storageModel";
|
import StorageModel, { storageKeys } from "../Global/storageModel";
|
||||||
import { parseValidObject, stringify } from "./Utility/utility";
|
import { parseValidObject, stringify } from "../Utility/utility";
|
||||||
|
|
||||||
import ChatModel from "./chatModel";
|
import ChatModel from "../Chat/chatModel";
|
||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
|
|
||||||
export default class FileModel {
|
export default class FileModel {
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
// thile file is responsible for managing task files within chats.
|
||||||
|
|
||||||
|
import { FileContent } from "./fileModel";
|
||||||
|
|
||||||
|
export default class TaskFileModel {}
|
||||||
|
|
||||||
|
// types
|
||||||
|
export interface TaskFileContent extends FileContent {
|
||||||
|
type: "task",
|
||||||
|
|
||||||
|
board: string;
|
||||||
|
category?: string;
|
||||||
|
status?: string;
|
||||||
|
|
||||||
|
description?: string;
|
||||||
|
|
||||||
|
priority?: number;
|
||||||
|
date?: string;
|
||||||
|
time?: string;
|
||||||
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
// this file is responsible for managing UDN connections.
|
// this file is responsible for managing UDN connections.
|
||||||
|
|
||||||
import { ChatMessage, ChatMessageReference } from "./chatModel";
|
import { ChatMessage, ChatMessageReference } from "../Chat/chatModel";
|
||||||
import StorageModel, { storageKeys } from "./storageModel";
|
import StorageModel, { storageKeys } from "./storageModel";
|
||||||
import UDNFrontend, { Message } from "udn-frontend";
|
import UDNFrontend, { Message } from "udn-frontend";
|
||||||
|
|
||||||
import { stringify } from "./Utility/utility";
|
import { stringify } from "../Utility/utility";
|
||||||
|
|
||||||
export default class ConnectionModel {
|
export default class ConnectionModel {
|
||||||
udn: UDNFrontend;
|
udn: UDNFrontend;
|
||||||
@@ -4,8 +4,8 @@ import {
|
|||||||
DATA_VERSION,
|
DATA_VERSION,
|
||||||
ValidObject,
|
ValidObject,
|
||||||
checkMatchesObjectStructure,
|
checkMatchesObjectStructure,
|
||||||
} from "./Utility/typeSafety";
|
} from "../Utility/typeSafety";
|
||||||
import { localeCompare, parseValidObject, stringify } from "./Utility/utility";
|
import { localeCompare, parseValidObject, stringify } from "../Utility/utility";
|
||||||
|
|
||||||
export const PATH_COMPONENT_SEPARATOR = "\\";
|
export const PATH_COMPONENT_SEPARATOR = "\\";
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import { ChatMessageInfoModal } from "./chatMessageInfoModal";
|
import { ChatMessageInfoModal } from "./chatMessageInfoModal";
|
||||||
import { ChatMessageStatus } from "../../Model/chatModel";
|
import { ChatMessageStatus } from "../../Model/Chat/chatModel";
|
||||||
import ChatMessageViewModel from "../../Model/chatMessageViewModel";
|
import ChatMessageViewModel from "../../ViewModel/chatMessageViewModel";
|
||||||
import { translations } from "../translations";
|
import { translations } from "../translations";
|
||||||
|
|
||||||
export function ChatMessage(chatMessageViewModel: ChatMessageViewModel) {
|
export function ChatMessage(chatMessageViewModel: ChatMessageViewModel) {
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import StorageModel, {
|
import StorageModel, { PATH_COMPONENT_SEPARATOR } from "../../Model/Global/storageModel";
|
||||||
PATH_COMPONENT_SEPARATOR,
|
|
||||||
} from "../../Model/storageModel";
|
|
||||||
|
|
||||||
import StorageViewModel from "../../ViewModel/storageViewModel";
|
import StorageViewModel from "../../ViewModel/storageViewModel";
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,9 @@ import "./fileBrowser.css";
|
|||||||
|
|
||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import StorageModel, {
|
|
||||||
PATH_COMPONENT_SEPARATOR,
|
|
||||||
} from "../../Model/storageModel";
|
|
||||||
|
|
||||||
import { DangerousActionButton } from "./dangerousActionButton";
|
import { DangerousActionButton } from "./dangerousActionButton";
|
||||||
import { DirectoryItemList } from "./directoryItemList";
|
import { DirectoryItemList } from "./directoryItemList";
|
||||||
|
import { PATH_COMPONENT_SEPARATOR } from "../../Model/Global/storageModel";
|
||||||
import StorageViewModel from "../../ViewModel/storageViewModel";
|
import StorageViewModel from "../../ViewModel/storageViewModel";
|
||||||
import { translations } from "../translations";
|
import { translations } from "../translations";
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import ChatListModel from "../Model/chatListModel";
|
import ChatListModel from "../Model/Chat/chatListModel";
|
||||||
import ChatModel from "../Model/chatModel";
|
import ChatModel from "../Model/chatModel";
|
||||||
import ChatViewModel from "./chatViewModel";
|
import ChatViewModel from "./chatViewModel";
|
||||||
import SettingsViewModel from "./settingsViewModel";
|
import SettingsViewModel from "./settingsViewModel";
|
||||||
import StorageModel from "../Model/storageModel";
|
import StorageModel from "../Model/Global/storageModel";
|
||||||
|
|
||||||
export default class ChatListViewModel {
|
export default class ChatListViewModel {
|
||||||
chatListModel: ChatListModel;
|
chatListModel: ChatListModel;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import { ChatMessage, ChatMessageStatus } from "../Model/chatModel";
|
import { ChatMessage, ChatMessageStatus } from "../Model/Chat/chatModel";
|
||||||
|
|
||||||
import ChatViewModel from "./chatViewModel";
|
import ChatViewModel from "./chatViewModel";
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import ChatModel, { ChatMessage } from "../Model/chatModel";
|
import ChatModel, { ChatMessage } from "../Model/Chat/chatModel";
|
||||||
import StorageModel, { storageKeys } from "../Model/storageModel";
|
import StorageModel, { storageKeys } from "../Model/Global/storageModel";
|
||||||
|
|
||||||
import ChatListViewModel from "./chatListViewModel";
|
import ChatListViewModel from "./chatListViewModel";
|
||||||
import ChatMessageViewModel from "./chatMessageViewModel";
|
import ChatMessageViewModel from "./chatMessageViewModel";
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import ConnectionModel from "../Model/connectionModel";
|
import ConnectionModel from "../Model/Global/connectionModel";
|
||||||
|
|
||||||
export default class ConnectionViewModel {
|
export default class ConnectionViewModel {
|
||||||
connectionModel: ConnectionModel;
|
connectionModel: ConnectionModel;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import SettingsModel from "../Model/settingsModel";
|
import SettingsModel from "../Model/Global/settingsModel";
|
||||||
|
|
||||||
export default class SettingsViewModel {
|
export default class SettingsViewModel {
|
||||||
settingsModel: SettingsModel;
|
settingsModel: SettingsModel;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import StorageModel, { PATH_COMPONENT_SEPARATOR } from "../Model/storageModel";
|
import StorageModel, { PATH_COMPONENT_SEPARATOR } from "../Model/Global/storageModel";
|
||||||
|
|
||||||
import { translations } from "../View/translations";
|
import { translations } from "../View/translations";
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -3,17 +3,17 @@ import "./colors.css";
|
|||||||
|
|
||||||
import * as React from "bloatless-react";
|
import * as React from "bloatless-react";
|
||||||
|
|
||||||
import ChatListModel from "./Model/chatListModel";
|
import ChatListModel from "./Model/Chat/chatListModel";
|
||||||
import ChatListViewModel from "./ViewModel/chatListViewModel";
|
import ChatListViewModel from "./ViewModel/chatListViewModel";
|
||||||
import { ChatPageWrapper } from "./View/chatPageWrapper";
|
import { ChatPageWrapper } from "./View/chatPageWrapper";
|
||||||
import { ConnectionModal } from "./View/Modals/connectionModal";
|
import { ConnectionModal } from "./View/Modals/connectionModal";
|
||||||
import ConnectionModel from "./Model/connectionModel";
|
import ConnectionModel from "./Model/Global/connectionModel";
|
||||||
import ConnectionViewModel from "./ViewModel/connectionViewModel";
|
import ConnectionViewModel from "./ViewModel/connectionViewModel";
|
||||||
import { HomePage } from "./View/homePage";
|
import { HomePage } from "./View/homePage";
|
||||||
import SettingsModel from "./Model/settingsModel";
|
import SettingsModel from "./Model/Global/settingsModel";
|
||||||
import SettingsViewModel from "./ViewModel/settingsViewModel";
|
import SettingsViewModel from "./ViewModel/settingsViewModel";
|
||||||
import { StorageModal } from "./View/Modals/storageModal";
|
import { StorageModal } from "./View/Modals/storageModal";
|
||||||
import StorageModel from "./Model/storageModel";
|
import StorageModel from "./Model/Global/storageModel";
|
||||||
import StorageViewModel from "./ViewModel/storageViewModel";
|
import StorageViewModel from "./ViewModel/storageViewModel";
|
||||||
|
|
||||||
// models
|
// models
|
||||||
|
|||||||
Reference in New Issue
Block a user