diff --git a/dist/index.js b/dist/index.js index b7fbc47f..cf7f32ac 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2246,7 +2246,7 @@ }; // src/ViewModel/Global/coreViewModel.ts - var CoreViewModel = class { + var CoreViewModel = class _CoreViewModel { // init constructor(storageModel2, settingsModel2, connectionModel2, chatListModel2, fileTransferModel2) { this.storageModel = storageModel2; @@ -2275,6 +2275,7 @@ this.logContexts(); }; this.handleKeyDown = (e) => { + if (_CoreViewModel.checkIsKeystroke(e) == false) return; const contexts = this.contexts; while (contexts.length > 0) { const currentContext = contexts.pop(); @@ -3192,6 +3193,7 @@ this.color.value ); this.taskPageViewModel.updateBoard(newBoardInfoFileContent); + this.taskPageViewModel.selectBoard(this); }; this.applyColor = () => { this.taskPageViewModel.chatViewModel.setDisplayedColor( @@ -3370,8 +3372,10 @@ () => this.searchViewModel.appliedQuery.value != "" ); this.registerKeyStroke("=" /* Filter */, this.showFilterModal); - this.registerKeyStroke("backspace" /* CloseOrCancel */, this.hideFilterModal); this.registerKeyStroke("-" /* Reset */, this.resetFilter); + this.registerKeyStroke("backspace" /* CloseOrCancel */, this.hideFilterModal); + this.registerKeyStroke("," /* Settings */, this.showSettings); + this.registerKeyStroke("enter" /* Apply */, this.hideSettings); this.taskPageViewModel.registerContext(this.boardInfo.fileId, this); } }; @@ -4584,7 +4588,7 @@ return /* @__PURE__ */ createElement("div", { id: "message-page" }, /* @__PURE__ */ createElement("div", { class: "pane-wrapper" }, /* @__PURE__ */ createElement("div", { class: "pane" }, /* @__PURE__ */ createElement("div", { class: "toolbar" }, /* @__PURE__ */ createElement("span", { class: "title" }, coreViewModel2.translations.chatPage.message.messagesHeadline), /* @__PURE__ */ createElement("span", null, /* @__PURE__ */ createElement( "button", { - class: "ghost", + class: "ghost inset-outline", "on:click": messagePageViewModel.showFilterModal, "aria-label": coreViewModel2.translations.chatPage.message.filterMessagesButtonAudioLabel, "toggle:selected": messagePageViewModel.isFilterActive @@ -4927,6 +4931,7 @@ // src/View/Modals/boardSettingsModal.tsx function BoardSettingsModal(coreViewModel2, boardViewModel) { + boardViewModel.isPresentingSettingsModal.subscribe(setFocusWithDelay); return /* @__PURE__ */ createElement( "div", { @@ -4936,6 +4941,7 @@ /* @__PURE__ */ createElement("div", null, /* @__PURE__ */ createElement("main", null, /* @__PURE__ */ createElement("h2", null, coreViewModel2.translations.chatPage.task.boardSettingsHeadline), /* @__PURE__ */ createElement("label", { class: "tile flex-no" }, /* @__PURE__ */ createElement("span", { class: "icon" }, "label"), /* @__PURE__ */ createElement("div", null, /* @__PURE__ */ createElement("span", null, coreViewModel2.translations.chatPage.task.boardNameInputLabel), /* @__PURE__ */ createElement( "input", { + id: "focused", "on:enter": boardViewModel.saveSettings, "bind:value": boardViewModel.name } diff --git a/src/Model/Chat/chatListModel.ts b/src/Model/Chat/chatListModel.ts index 98322993..960b0dae 100644 --- a/src/Model/Chat/chatListModel.ts +++ b/src/Model/Chat/chatListModel.ts @@ -42,7 +42,7 @@ export default class ChatListModel { channel: string, fn: (chatModel: ChatModel) => void, ): void => { - const allChannels = channel.split("/"); + const allChannels: string[] = channel.split("/"); for (const chatModel of this.chatModels) { for (const channel of allChannels) { diff --git a/src/Model/Chat/chatModel.ts b/src/Model/Chat/chatModel.ts index 653db858..aae26978 100644 --- a/src/Model/Chat/chatModel.ts +++ b/src/Model/Chat/chatModel.ts @@ -165,10 +165,10 @@ export default class ChatModel { }; getNameAndChannel = (): [string, string] | false => { - const senderName = this.settingsModel.username; + const senderName: string = this.settingsModel.username; if (senderName == "") return false; - const allChannels = [this.info.primaryChannel]; + const allChannels: string[] = [this.info.primaryChannel]; for (const secondaryChannel of this.info.secondaryChannels) { allChannels.push(secondaryChannel); } @@ -388,7 +388,7 @@ export default class ChatModel { stringifiedFile: "", }; if (fileContent != undefined) { - const stringifiedFile = stringify(fileContent); + const stringifiedFile: string = stringify(fileContent); chatMessage.stringifiedFile = stringifiedFile; } @@ -412,7 +412,8 @@ export default class ChatModel { content: ReactionSymbols, isDeleting: boolean, ): ChatMessageReaction => { - const fileContent = FileModel.createFileContent(v4(), "reaction"); + const fileContent: FileContent<"reaction"> = + FileModel.createFileContent(v4(), "reaction"); const reaction: ChatMessageReaction = { ...fileContent, fileId: ChatModel.createMessageReactionId(messageId, sender), diff --git a/src/Model/Files/calendarModel.ts b/src/Model/Files/calendarModel.ts index 32584f35..afcf8442 100644 --- a/src/Model/Files/calendarModel.ts +++ b/src/Model/Files/calendarModel.ts @@ -71,7 +71,7 @@ export default class CalendarModel { date.setMonth(month - 1); date.setFullYear(year); - const firstWeekdayOfMonth = date.getDay(); + const firstWeekdayOfMonth: number = date.getDay(); const firstDayOfWeekSetting: number = parseInt( this.settingsModel.firstDayOfWeek, ); diff --git a/src/Model/Global/connectionModel.ts b/src/Model/Global/connectionModel.ts index 570564c5..e31780e1 100644 --- a/src/Model/Global/connectionModel.ts +++ b/src/Model/Global/connectionModel.ts @@ -75,7 +75,7 @@ export default class ConnectionModel { StorageModelSubPaths.ConnectionModel, filePaths.connectionModel.mailboxes, ); - const mailboxFilePath = [...mailboxDirPath, address]; + const mailboxFilePath: string[] = [...mailboxDirPath, address]; return mailboxFilePath; }; diff --git a/src/Model/Global/settingsModel.ts b/src/Model/Global/settingsModel.ts index 828e1770..85d16c49 100644 --- a/src/Model/Global/settingsModel.ts +++ b/src/Model/Global/settingsModel.ts @@ -26,22 +26,22 @@ export default class SettingsModel { setName = (newValue: string): void => { this.username = newValue; this.storeSetting("username", newValue); - } + }; setFirstDayOfWeek = (newValue: string): void => { this.firstDayOfWeek = newValue; this.storeSetting("firstDayOfWeek", newValue); - } + }; setLanguage = (newValue: string): void => { this.language = newValue; this.storeSetting("language", newValue); - } + }; setTheme = (newValue: string): void => { this.theme = newValue; this.storeSetting("theme", newValue); - } + }; // load private readSetting = ( @@ -52,27 +52,27 @@ export default class SettingsModel { filePaths.settingsModel[pathName], ); return this.storageModel.read(path); - } + }; loadUsername = (): void => { - const content = this.readSetting("username"); + const content: string | null = this.readSetting("username"); this.username = content ?? ""; - } + }; loadFirstDayofWeek = (): void => { - const content = this.readSetting("firstDayOfWeek"); + const content: string | null = this.readSetting("firstDayOfWeek"); this.firstDayOfWeek = content ?? "0"; - } + }; loadLanguage = (): void => { - const content = this.readSetting("language"); + const content: string | null = this.readSetting("language"); this.language = content ?? SettingsModel.getSystemLanguage(); - } + }; loadTheme = (): void => { - const content = this.readSetting("theme"); + const content: string | null = this.readSetting("theme"); this.theme = content ?? ThemeSettings.System; - } + }; // init constructor(storageModel: StorageModel) { diff --git a/src/View/ChatPages/messagePage.tsx b/src/View/ChatPages/messagePage.tsx index 77a899c2..492570bd 100644 --- a/src/View/ChatPages/messagePage.tsx +++ b/src/View/ChatPages/messagePage.tsx @@ -66,7 +66,7 @@ export function MessagePage(