standardize use of public keyword
This commit is contained in:
Vendored
+24
-22
@@ -1662,9 +1662,12 @@
|
||||
// src/ViewModel/Pages/taskViewModel.ts
|
||||
var TaskViewModel = class {
|
||||
// init
|
||||
constructor(coreViewModel2, chatViewModel, boardsAndTasksModel, containingModel, taskFileContent) {
|
||||
constructor(coreViewModel2, chatViewModel, boardsAndTasksModel, containingModel, task) {
|
||||
this.coreViewModel = coreViewModel2;
|
||||
this.chatViewModel = chatViewModel;
|
||||
this.boardsAndTasksModel = boardsAndTasksModel;
|
||||
this.containingModel = containingModel;
|
||||
this.task = task;
|
||||
// paths
|
||||
this.getFilePath = () => {
|
||||
return this.boardsAndTasksModel.getTaskFilePath(this.task.fileId);
|
||||
@@ -1790,9 +1793,6 @@
|
||||
this.selectedVersionId.value = this.task.fileContentId;
|
||||
this.updateSuggestions();
|
||||
};
|
||||
this.boardsAndTasksModel = boardsAndTasksModel;
|
||||
this.containingModel = containingModel;
|
||||
this.task = taskFileContent;
|
||||
this.loadAllData();
|
||||
this.selectedVersionId.subscribeSilent((selectedVersionId) => {
|
||||
this.switchVersion(selectedVersionId);
|
||||
@@ -1831,6 +1831,7 @@
|
||||
constructor(coreViewModel2, chatViewModel, boardsAndTasksModel) {
|
||||
this.coreViewModel = coreViewModel2;
|
||||
this.chatViewModel = chatViewModel;
|
||||
this.boardsAndTasksModel = boardsAndTasksModel;
|
||||
// state
|
||||
this.taskIndexManager = new IndexManager(
|
||||
(taskViewModel) => taskViewModel.sortingString
|
||||
@@ -1867,7 +1868,6 @@
|
||||
taskViewModel.updateIndex();
|
||||
}
|
||||
};
|
||||
this.boardsAndTasksModel = boardsAndTasksModel;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1879,6 +1879,8 @@
|
||||
super(coreViewModel2, chatViewModel, boardsAndTasksModel);
|
||||
this.coreViewModel = coreViewModel2;
|
||||
this.chatViewModel = chatViewModel;
|
||||
this.calendarModel = calendarModel;
|
||||
this.boardsAndTasksModel = boardsAndTasksModel;
|
||||
// paths
|
||||
this.getBasePath = () => {
|
||||
return [...this.calendarModel.getViewPath()];
|
||||
@@ -2030,6 +2032,7 @@
|
||||
// init
|
||||
constructor(coreViewModel2, messagePageViewModel, chatMessage, sentByUser) {
|
||||
this.coreViewModel = coreViewModel2;
|
||||
this.messagePageViewModel = messagePageViewModel;
|
||||
this.body = new State("");
|
||||
this.status = new State(
|
||||
void 0
|
||||
@@ -2122,7 +2125,6 @@
|
||||
this.body.value = this.chatMessage.body;
|
||||
this.status.value = this.chatMessage.status;
|
||||
};
|
||||
this.messagePageViewModel = messagePageViewModel;
|
||||
this.chatMessage = chatMessage;
|
||||
this.sentByUser = sentByUser;
|
||||
this.loadData();
|
||||
@@ -2134,6 +2136,7 @@
|
||||
// init
|
||||
constructor(coreViewModel2, chatViewModel) {
|
||||
this.coreViewModel = coreViewModel2;
|
||||
this.chatViewModel = chatViewModel;
|
||||
// state
|
||||
this.chatMessageViewModels = new MapState();
|
||||
this.composingMessage = new State("");
|
||||
@@ -2193,7 +2196,6 @@
|
||||
this.handleReaction(reaction);
|
||||
}
|
||||
};
|
||||
this.chatViewModel = chatViewModel;
|
||||
this.cannotSendMessage = createProxyState(
|
||||
[
|
||||
this.chatViewModel.settingsViewModel.username,
|
||||
@@ -2209,6 +2211,7 @@
|
||||
// init
|
||||
constructor(coreViewModel2, chatViewModel) {
|
||||
this.coreViewModel = coreViewModel2;
|
||||
this.chatViewModel = chatViewModel;
|
||||
// state
|
||||
this.primaryChannel = new State("");
|
||||
this.primaryChannelInput = new State("");
|
||||
@@ -2283,7 +2286,6 @@
|
||||
this.secondaryChannels.add(secondaryChannel);
|
||||
}
|
||||
};
|
||||
this.chatViewModel = chatViewModel;
|
||||
this.loadListRelevantData();
|
||||
this.cannotSetEncryptionKey = createProxyState(
|
||||
[this.encryptionKeyInput],
|
||||
@@ -2355,6 +2357,9 @@
|
||||
super(coreViewModel2, chatViewModel, boardsAndTasksModel);
|
||||
this.coreViewModel = coreViewModel2;
|
||||
this.chatViewModel = chatViewModel;
|
||||
this.boardsAndTasksModel = boardsAndTasksModel;
|
||||
this.taskPageViewModel = taskPageViewModel;
|
||||
this.boardInfo = boardInfo;
|
||||
// state
|
||||
this.name = new State("");
|
||||
this.color = new State("standard" /* Standard */);
|
||||
@@ -2527,9 +2532,6 @@
|
||||
this.loadTasks();
|
||||
this.loadSearchSuggestions();
|
||||
};
|
||||
this.boardsAndTasksModel = boardsAndTasksModel;
|
||||
this.taskPageViewModel = taskPageViewModel;
|
||||
this.boardInfo = boardInfo;
|
||||
this.loadListRelevantData();
|
||||
this.isSelected = createProxyState(
|
||||
[this.taskPageViewModel.selectedBoardId],
|
||||
@@ -2567,9 +2569,10 @@
|
||||
// src/ViewModel/Pages/taskPageViewModel.ts
|
||||
var TaskPageViewModel = class {
|
||||
// init
|
||||
constructor(coreViewModel2, chatViewModel, boardModel) {
|
||||
constructor(coreViewModel2, chatViewModel, boardsAndTasksModel) {
|
||||
this.coreViewModel = coreViewModel2;
|
||||
this.chatViewModel = chatViewModel;
|
||||
this.boardsAndTasksModel = boardsAndTasksModel;
|
||||
// data
|
||||
this.boardIndexManager = new IndexManager(
|
||||
(boardViewModel) => boardViewModel.name.value
|
||||
@@ -2674,10 +2677,9 @@
|
||||
this.updateBoardIndices();
|
||||
this.openLastUsedBoard();
|
||||
};
|
||||
this.boardsAndTasksModel = boardModel;
|
||||
this.chatViewModel = chatViewModel;
|
||||
this.loadData();
|
||||
boardModel.boardHandlerManager.addHandler(
|
||||
boardsAndTasksModel.boardHandlerManager.addHandler(
|
||||
(boardInfoFileContent) => {
|
||||
this.showBoardInList(boardInfoFileContent);
|
||||
this.updateBoardIndices();
|
||||
@@ -2691,6 +2693,11 @@
|
||||
// init
|
||||
constructor(coreViewModel2, chatModel, settingsViewModel2, notificationViewModel, connectionViewModel2, chatListViewModel2) {
|
||||
this.coreViewModel = coreViewModel2;
|
||||
this.chatModel = chatModel;
|
||||
this.settingsViewModel = settingsViewModel2;
|
||||
this.notificationViewModel = notificationViewModel;
|
||||
this.connectionViewModel = connectionViewModel2;
|
||||
this.chatListViewModel = chatListViewModel2;
|
||||
// state
|
||||
this.displayedColor = new State("standard" /* Standard */);
|
||||
this.selectedPage = new State(
|
||||
@@ -2764,11 +2771,6 @@
|
||||
}
|
||||
);
|
||||
};
|
||||
this.chatModel = chatModel;
|
||||
this.settingsViewModel = settingsViewModel2;
|
||||
this.connectionViewModel = connectionViewModel2;
|
||||
this.notificationViewModel = notificationViewModel;
|
||||
this.chatListViewModel = chatListViewModel2;
|
||||
this.calendarViewModel = new CalendarPageViewModel(
|
||||
coreViewModel2,
|
||||
this,
|
||||
@@ -2811,6 +2813,7 @@
|
||||
var NotificationViewModel = class _NotificationViewModel {
|
||||
// init
|
||||
constructor(chatListViewModel2) {
|
||||
this.chatListViewModel = chatListViewModel2;
|
||||
// data
|
||||
this.seenMessageIds = /* @__PURE__ */ new Set();
|
||||
this.messagesInMarquee = [];
|
||||
@@ -2864,7 +2867,6 @@
|
||||
this.stopLoop();
|
||||
this.startLoop();
|
||||
};
|
||||
this.chatListViewModel = chatListViewModel2;
|
||||
}
|
||||
// util
|
||||
static createNotification(message) {
|
||||
@@ -2882,6 +2884,8 @@
|
||||
// init
|
||||
constructor(coreViewModel2, settingsViewModel2, connectionViewModel2) {
|
||||
this.coreViewModel = coreViewModel2;
|
||||
this.settingsViewModel = settingsViewModel2;
|
||||
this.connectionViewModel = connectionViewModel2;
|
||||
// data
|
||||
this.chatIndexManager = new IndexManager(
|
||||
(chatViewModel) => chatViewModel.settingsPageViewModel.primaryChannel.value
|
||||
@@ -2947,9 +2951,7 @@
|
||||
}
|
||||
this.updateIndices();
|
||||
};
|
||||
this.settingsViewModel = settingsViewModel2;
|
||||
this.notificationViewModel = new NotificationViewModel(this);
|
||||
this.connectionViewModel = connectionViewModel2;
|
||||
this.loadChats();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,9 +11,7 @@ import ConnectionViewModel from "../Global/connectionViewModel";
|
||||
import NotificationViewModel from "../Global/notificationViewModel";
|
||||
|
||||
export default class ChatListViewModel {
|
||||
settingsViewModel: SettingsViewModel;
|
||||
notificationViewModel: NotificationViewModel;
|
||||
connectionViewModel: ConnectionViewModel;
|
||||
|
||||
// data
|
||||
chatIndexManager: IndexManager<ChatViewModel> = new IndexManager(
|
||||
@@ -99,12 +97,10 @@ export default class ChatListViewModel {
|
||||
// init
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
settingsViewModel: SettingsViewModel,
|
||||
connectionViewModel: ConnectionViewModel,
|
||||
public settingsViewModel: SettingsViewModel,
|
||||
public connectionViewModel: ConnectionViewModel,
|
||||
) {
|
||||
this.settingsViewModel = settingsViewModel;
|
||||
this.notificationViewModel = new NotificationViewModel(this);
|
||||
this.connectionViewModel = connectionViewModel;
|
||||
|
||||
this.loadChats();
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@ import CoreViewModel from "../Global/coreViewModel";
|
||||
import MessagePageViewModel from "../Pages/messagePageViewModel";
|
||||
|
||||
export default class ChatMessageViewModel {
|
||||
messagePageViewModel: MessagePageViewModel;
|
||||
|
||||
// data
|
||||
chatMessage: ChatMessage;
|
||||
channel: string;
|
||||
@@ -126,12 +124,10 @@ export default class ChatMessageViewModel {
|
||||
// init
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
messagePageViewModel: MessagePageViewModel,
|
||||
public messagePageViewModel: MessagePageViewModel,
|
||||
chatMessage: ChatMessage,
|
||||
sentByUser: boolean,
|
||||
) {
|
||||
this.messagePageViewModel = messagePageViewModel;
|
||||
|
||||
this.chatMessage = chatMessage;
|
||||
this.sentByUser = sentByUser;
|
||||
this.loadData();
|
||||
|
||||
@@ -24,13 +24,6 @@ import ConnectionViewModel from "../Global/connectionViewModel";
|
||||
import NotificationViewModel from "../Global/notificationViewModel";
|
||||
|
||||
export default class ChatViewModel {
|
||||
chatModel: ChatModel;
|
||||
|
||||
settingsViewModel: SettingsViewModel;
|
||||
notificationViewModel: NotificationViewModel;
|
||||
connectionViewModel: ConnectionViewModel;
|
||||
chatListViewModel: ChatListViewModel;
|
||||
|
||||
calendarViewModel: CalendarPageViewModel;
|
||||
taskPageViewModel: TaskPageViewModel;
|
||||
messagePageViewModel: MessagePageViewModel;
|
||||
@@ -132,19 +125,12 @@ export default class ChatViewModel {
|
||||
// init
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
chatModel: ChatModel,
|
||||
settingsViewModel: SettingsViewModel,
|
||||
notificationViewModel: NotificationViewModel,
|
||||
connectionViewModel: ConnectionViewModel,
|
||||
chatListViewModel: ChatListViewModel,
|
||||
public chatModel: ChatModel,
|
||||
public settingsViewModel: SettingsViewModel,
|
||||
public notificationViewModel: NotificationViewModel,
|
||||
public connectionViewModel: ConnectionViewModel,
|
||||
public chatListViewModel: ChatListViewModel,
|
||||
) {
|
||||
// models
|
||||
this.chatModel = chatModel;
|
||||
this.settingsViewModel = settingsViewModel;
|
||||
this.connectionViewModel = connectionViewModel;
|
||||
this.notificationViewModel = notificationViewModel;
|
||||
this.chatListViewModel = chatListViewModel;
|
||||
|
||||
// page viewModels
|
||||
this.calendarViewModel = new CalendarPageViewModel(
|
||||
coreViewModel,
|
||||
|
||||
@@ -8,7 +8,6 @@ import StorageModel, {
|
||||
filePaths,
|
||||
} from "../../Model/Global/storageModel";
|
||||
|
||||
import ChatListModel from "../../Model/Chat/chatListModel";
|
||||
import ChatModel from "../../Model/Chat/chatModel";
|
||||
import CoreViewModel from "./coreViewModel";
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ import ChatListViewModel from "../Chat/chatListViewModel";
|
||||
import { ChatPageTypes } from "../Chat/chatViewModel";
|
||||
|
||||
export default class NotificationViewModel {
|
||||
chatListViewModel: ChatListViewModel;
|
||||
|
||||
// data
|
||||
seenMessageIds = new Set<string>();
|
||||
messagesInMarquee: Notification[] = [];
|
||||
@@ -78,9 +76,7 @@ export default class NotificationViewModel {
|
||||
};
|
||||
|
||||
// init
|
||||
constructor(chatListViewModel: ChatListViewModel) {
|
||||
this.chatListViewModel = chatListViewModel;
|
||||
}
|
||||
constructor(public chatListViewModel: ChatListViewModel) {}
|
||||
|
||||
// util
|
||||
static createNotification(message: ChatMessage): Notification {
|
||||
|
||||
@@ -15,13 +15,6 @@ import TaskPageViewModel from "./taskPageViewModel";
|
||||
import TaskViewModel from "./taskViewModel";
|
||||
|
||||
export default class BoardViewModel extends TaskContainingPageViewModel {
|
||||
boardsAndTasksModel: BoardsAndTasksModel;
|
||||
|
||||
taskPageViewModel: TaskPageViewModel;
|
||||
|
||||
// data
|
||||
boardInfo: BoardInfoFileContent;
|
||||
|
||||
// state
|
||||
name: React.State<string> = new React.State("");
|
||||
color: React.State<Colors> = new React.State<any>(Colors.Standard);
|
||||
@@ -248,17 +241,12 @@ export default class BoardViewModel extends TaskContainingPageViewModel {
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
public chatViewModel: ChatViewModel,
|
||||
boardsAndTasksModel: BoardsAndTasksModel,
|
||||
taskPageViewModel: TaskPageViewModel,
|
||||
boardInfo: BoardInfoFileContent,
|
||||
public boardsAndTasksModel: BoardsAndTasksModel,
|
||||
public taskPageViewModel: TaskPageViewModel,
|
||||
public boardInfo: BoardInfoFileContent,
|
||||
) {
|
||||
super(coreViewModel, chatViewModel, boardsAndTasksModel);
|
||||
|
||||
// set
|
||||
this.boardsAndTasksModel = boardsAndTasksModel;
|
||||
this.taskPageViewModel = taskPageViewModel;
|
||||
this.boardInfo = boardInfo;
|
||||
|
||||
// load
|
||||
this.loadListRelevantData();
|
||||
|
||||
|
||||
@@ -14,9 +14,6 @@ import TaskViewModel from "./taskViewModel";
|
||||
export const CALENDAR_EVENT_BOARD_ID = "events";
|
||||
|
||||
export default class CalendarPageViewModel extends TaskContainingPageViewModel {
|
||||
calendarModel: CalendarModel;
|
||||
boardsAndTasksModel: BoardsAndTasksModel;
|
||||
|
||||
// data
|
||||
get monthString(): string {
|
||||
return CalendarModel.getMonthString(
|
||||
@@ -188,8 +185,8 @@ export default class CalendarPageViewModel extends TaskContainingPageViewModel {
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
public chatViewModel: ChatViewModel,
|
||||
calendarModel: CalendarModel,
|
||||
boardsAndTasksModel: BoardsAndTasksModel,
|
||||
public calendarModel: CalendarModel,
|
||||
public boardsAndTasksModel: BoardsAndTasksModel,
|
||||
) {
|
||||
super(coreViewModel, chatViewModel, boardsAndTasksModel);
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ import ChatViewModel from "../Chat/chatViewModel";
|
||||
import CoreViewModel from "../Global/coreViewModel";
|
||||
|
||||
export default class MessagePageViewModel {
|
||||
chatViewModel: ChatViewModel;
|
||||
|
||||
// state
|
||||
chatMessageViewModels: React.MapState<ChatMessageViewModel> =
|
||||
new React.MapState();
|
||||
@@ -97,10 +95,8 @@ export default class MessagePageViewModel {
|
||||
// init
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
chatViewModel: ChatViewModel,
|
||||
public chatViewModel: ChatViewModel,
|
||||
) {
|
||||
this.chatViewModel = chatViewModel;
|
||||
|
||||
this.cannotSendMessage = React.createProxyState(
|
||||
[
|
||||
this.chatViewModel.settingsViewModel.username,
|
||||
|
||||
@@ -5,8 +5,6 @@ import { Colors } from "../../colors";
|
||||
import CoreViewModel from "../Global/coreViewModel";
|
||||
|
||||
export default class SettingsPageViewModel {
|
||||
chatViewModel: ChatViewModel;
|
||||
|
||||
// state
|
||||
primaryChannel: React.State<string> = new React.State("");
|
||||
primaryChannelInput: React.State<string> = new React.State("");
|
||||
@@ -113,9 +111,8 @@ export default class SettingsPageViewModel {
|
||||
// init
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
chatViewModel: ChatViewModel,
|
||||
public chatViewModel: ChatViewModel,
|
||||
) {
|
||||
this.chatViewModel = chatViewModel;
|
||||
this.loadListRelevantData();
|
||||
|
||||
this.cannotSetEncryptionKey = React.createProxyState(
|
||||
|
||||
@@ -10,8 +10,6 @@ import { IndexManager } from "../../Model/Utility/utility";
|
||||
import TaskViewModel from "./taskViewModel";
|
||||
|
||||
export default class TaskContainingPageViewModel {
|
||||
boardsAndTasksModel: BoardsAndTasksModel;
|
||||
|
||||
// state
|
||||
taskIndexManager: IndexManager<TaskViewModel> = new IndexManager(
|
||||
(taskViewModel: TaskViewModel) => taskViewModel.sortingString,
|
||||
@@ -60,8 +58,6 @@ export default class TaskContainingPageViewModel {
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
public chatViewModel: ChatViewModel,
|
||||
boardsAndTasksModel: BoardsAndTasksModel,
|
||||
) {
|
||||
this.boardsAndTasksModel = boardsAndTasksModel;
|
||||
}
|
||||
public boardsAndTasksModel: BoardsAndTasksModel,
|
||||
) {}
|
||||
}
|
||||
|
||||
@@ -8,11 +8,8 @@ import BoardViewModel from "./boardViewModel";
|
||||
import ChatViewModel from "../Chat/chatViewModel";
|
||||
import CoreViewModel from "../Global/coreViewModel";
|
||||
import { IndexManager } from "../../Model/Utility/utility";
|
||||
import StorageModel from "../../Model/Global/storageModel";
|
||||
|
||||
export default class TaskPageViewModel {
|
||||
boardsAndTasksModel: BoardsAndTasksModel;
|
||||
|
||||
// data
|
||||
boardIndexManager: IndexManager<BoardViewModel> = new IndexManager(
|
||||
(boardViewModel: BoardViewModel) => boardViewModel.name.value,
|
||||
@@ -155,16 +152,14 @@ export default class TaskPageViewModel {
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
public chatViewModel: ChatViewModel,
|
||||
boardModel: BoardsAndTasksModel,
|
||||
public boardsAndTasksModel: BoardsAndTasksModel,
|
||||
) {
|
||||
this.boardsAndTasksModel = boardModel;
|
||||
|
||||
this.chatViewModel = chatViewModel;
|
||||
|
||||
this.loadData();
|
||||
|
||||
// handlers
|
||||
boardModel.boardHandlerManager.addHandler(
|
||||
boardsAndTasksModel.boardHandlerManager.addHandler(
|
||||
(boardInfoFileContent: BoardInfoFileContent) => {
|
||||
this.showBoardInList(boardInfoFileContent);
|
||||
this.updateBoardIndices();
|
||||
|
||||
@@ -11,13 +11,6 @@ import TaskContainingPageViewModel from "./taskContainingPageViewModel";
|
||||
import { allowDrag } from "../../View/utility";
|
||||
|
||||
export default class TaskViewModel {
|
||||
boardsAndTasksModel: BoardsAndTasksModel;
|
||||
|
||||
containingModel: TaskContainingPageViewModel;
|
||||
|
||||
// data
|
||||
task: TaskFileContent;
|
||||
|
||||
get sortingString(): string {
|
||||
const splitDate: string[] = this.date.value.split("-");
|
||||
const year = padZero(splitDate[0], 4);
|
||||
@@ -213,15 +206,10 @@ export default class TaskViewModel {
|
||||
constructor(
|
||||
public coreViewModel: CoreViewModel,
|
||||
public chatViewModel: ChatViewModel,
|
||||
boardsAndTasksModel: BoardsAndTasksModel,
|
||||
containingModel: TaskContainingPageViewModel,
|
||||
taskFileContent: TaskFileContent,
|
||||
public boardsAndTasksModel: BoardsAndTasksModel,
|
||||
public containingModel: TaskContainingPageViewModel,
|
||||
public task: TaskFileContent,
|
||||
) {
|
||||
this.boardsAndTasksModel = boardsAndTasksModel;
|
||||
this.containingModel = containingModel;
|
||||
|
||||
this.task = taskFileContent;
|
||||
|
||||
// load
|
||||
this.loadAllData();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user