refactor: migrate remaining angular components to react (#833)
* refactor: menuRow directive to MenuRow component * refactor: migrate footer to react * refactor: migrate actions menu to react * refactor: migrate history menu to react * fix: click outside handler use capture to trigger event before re-render occurs which would otherwise cause node.contains to return incorrect result (specifically for the account menu) * refactor: migrate revision preview modal to react * refactor: migrate permissions modal to react * refactor: migrate password wizard to react * refactor: remove unused input modal directive * refactor: remove unused delay hide component * refactor: remove unused filechange directive * refactor: remove unused elemReady directive * refactor: remove unused sn-enter directive * refactor: remove unused lowercase directive * refactor: remove unused autofocus directive * refactor(wip): note view to react * refactor: use mutation observer to deinit textarea listeners * refactor: migrate challenge modal to react * refactor: migrate note group view to react * refactor(wip): migrate remaining classes * fix: navigation parent ref * refactor: fully remove angular assets * fix: account switcher * fix: application view state * refactor: remove unused password wizard type * fix: revision preview and permissions modal * fix: remove angular comment * refactor: react panel resizers for editor * feat: simple panel resizer * fix: use simple panel resizer everywhere * fix: simplify panel resizer state * chore: rename simple panel resizer to panel resizer * refactor: simplify column layout * fix: editor mount safety check * fix: use inline onLoad callback for iframe, as setting onload after it loads will never call it * chore: fix note view test * chore(deps): upgrade snjs
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable camelcase */
|
||||
import {
|
||||
SNComponent,
|
||||
ComponentMutator,
|
||||
@@ -10,7 +11,7 @@ import {
|
||||
PayloadSource,
|
||||
} from '@standardnotes/snjs';
|
||||
|
||||
import { WebApplication } from '@/ui_models/application';
|
||||
import { WebAppEvent, WebApplication } from '@/ui_models/application';
|
||||
import { isDesktopApplication } from '@/utils';
|
||||
import { Bridge } from './bridge';
|
||||
|
||||
@@ -21,8 +22,6 @@ export class DesktopManager
|
||||
extends ApplicationService
|
||||
implements DesktopManagerInterface
|
||||
{
|
||||
$rootScope: ng.IRootScopeService;
|
||||
$timeout: ng.ITimeoutService;
|
||||
updateObservers: {
|
||||
callback: (component: SNComponent) => void;
|
||||
}[] = [];
|
||||
@@ -31,15 +30,8 @@ export class DesktopManager
|
||||
dataLoaded = false;
|
||||
lastSearchedText?: string;
|
||||
|
||||
constructor(
|
||||
$rootScope: ng.IRootScopeService,
|
||||
$timeout: ng.ITimeoutService,
|
||||
application: WebApplication,
|
||||
private bridge: Bridge
|
||||
) {
|
||||
constructor(application: WebApplication, private bridge: Bridge) {
|
||||
super(application);
|
||||
this.$rootScope = $rootScope;
|
||||
this.$timeout = $timeout;
|
||||
}
|
||||
|
||||
get webApplication() {
|
||||
@@ -124,11 +116,11 @@ export class DesktopManager
|
||||
}
|
||||
|
||||
desktop_windowGainedFocus(): void {
|
||||
this.$rootScope.$broadcast('window-gained-focus');
|
||||
this.webApplication.notifyWebEvent(WebAppEvent.DesktopWindowGainedFocus);
|
||||
}
|
||||
|
||||
desktop_windowLostFocus() {
|
||||
this.$rootScope.$broadcast('window-lost-focus');
|
||||
desktop_windowLostFocus(): void {
|
||||
this.webApplication.notifyWebEvent(WebAppEvent.DesktopWindowLostFocus);
|
||||
}
|
||||
|
||||
async desktop_onComponentInstallationComplete(
|
||||
@@ -155,11 +147,9 @@ export class DesktopManager
|
||||
PayloadSource.DesktopInstalled
|
||||
);
|
||||
|
||||
this.$timeout(() => {
|
||||
for (const observer of this.updateObservers) {
|
||||
observer.callback(updatedComponent as SNComponent);
|
||||
}
|
||||
});
|
||||
for (const observer of this.updateObservers) {
|
||||
observer.callback(updatedComponent as SNComponent);
|
||||
}
|
||||
}
|
||||
|
||||
async desktop_requestBackupFile() {
|
||||
|
||||
Reference in New Issue
Block a user