Merge branch 'release/3.5.9'
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -41,3 +41,4 @@ dump.rdb
|
|||||||
/dist/javascripts
|
/dist/javascripts
|
||||||
/dist/stylesheets
|
/dist/stylesheets
|
||||||
/dist/fonts
|
/dist/fonts
|
||||||
|
/dist/@types
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
declare const __VERSION__: string;
|
declare const __VERSION__: string;
|
||||||
declare const __WEB__: boolean;
|
declare const __WEB__: boolean;
|
||||||
|
|
||||||
import { SNLog } from 'snjs';
|
import { SNLog } from '@standardnotes/snjs';
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import { configRoutes } from './routes';
|
import { configRoutes } from './routes';
|
||||||
|
|
||||||
@@ -53,19 +53,16 @@ import {
|
|||||||
|
|
||||||
import { trusted } from './filters';
|
import { trusted } from './filters';
|
||||||
import { isDev } from './utils';
|
import { isDev } from './utils';
|
||||||
import { Bridge, BrowserBridge } from './services/bridge';
|
import { BrowserBridge } from './services/browserBridge';
|
||||||
import { startErrorReporting } from './services/errorReporting';
|
import { startErrorReporting } from './services/errorReporting';
|
||||||
import { alertDialog } from './services/alertService';
|
import { alertDialog } from './services/alertService';
|
||||||
|
import { StartApplication } from './startApplication';
|
||||||
|
import { Bridge } from './services/bridge';
|
||||||
|
|
||||||
if (__WEB__) {
|
const startApplication: StartApplication = async function startApplication(
|
||||||
startApplication((window as any)._default_sync_server, new BrowserBridge());
|
defaultSyncServerHost: string,
|
||||||
} else {
|
bridge: Bridge
|
||||||
(window as any).startApplication = startApplication;
|
) {
|
||||||
}
|
|
||||||
|
|
||||||
async function startApplication(defaultSyncServerHost: string, bridge: Bridge) {
|
|
||||||
notifyBetaPeriodEnd();
|
|
||||||
|
|
||||||
SNLog.onLog = console.log;
|
SNLog.onLog = console.log;
|
||||||
startErrorReporting();
|
startErrorReporting();
|
||||||
|
|
||||||
@@ -77,7 +74,7 @@ async function startApplication(defaultSyncServerHost: string, bridge: Bridge) {
|
|||||||
.config(configRoutes)
|
.config(configRoutes)
|
||||||
.constant('bridge', bridge)
|
.constant('bridge', bridge)
|
||||||
.constant('defaultSyncServerHost', defaultSyncServerHost)
|
.constant('defaultSyncServerHost', defaultSyncServerHost)
|
||||||
.constant('appVersion', __VERSION__);
|
.constant('appVersion', bridge.appVersion);
|
||||||
|
|
||||||
// Controllers
|
// Controllers
|
||||||
angular
|
angular
|
||||||
@@ -149,17 +146,10 @@ async function startApplication(defaultSyncServerHost: string, bridge: Bridge) {
|
|||||||
angular.element(document).ready(() => {
|
angular.element(document).ready(() => {
|
||||||
angular.bootstrap(document, ['app']);
|
angular.bootstrap(document, ['app']);
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
function notifyBetaPeriodEnd() {
|
if (__WEB__) {
|
||||||
if (window.location.hostname === 'app-beta.standardnotes.org') {
|
startApplication((window as any)._default_sync_server, new BrowserBridge(__VERSION__));
|
||||||
alertDialog({
|
} else {
|
||||||
title: 'Beta period has ended',
|
(window as any).startApplication = startApplication;
|
||||||
text:
|
|
||||||
'Thank you for trying this beta version. Please sign out, then ' +
|
|
||||||
'sign in to <a href="https://app.standardnotes.org" target="_blank">' +
|
|
||||||
'app.standardnotes.org</a> ' +
|
|
||||||
'to continue using Standard Notes.',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SNAlertService } from "snjs/dist/@types";
|
import { SNAlertService } from "@standardnotes/snjs";
|
||||||
|
|
||||||
const STORE_NAME = 'items';
|
const STORE_NAME = 'items';
|
||||||
const READ_WRITE = 'readwrite';
|
const READ_WRITE = 'readwrite';
|
||||||
@@ -216,4 +216,4 @@ export class Database {
|
|||||||
"Please close any other app instances and reload the page.";
|
"Please close any other app instances and reload the page.";
|
||||||
this.alertService!.alert(message);
|
this.alertService!.alert(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { WebDirective } from './../../types';
|
import { WebDirective } from './../../types';
|
||||||
import { isDesktopApplication, preventRefreshing } from '@/utils';
|
import { isDesktopApplication, preventRefreshing } from '@/utils';
|
||||||
import template from '%/directives/account-menu.pug';
|
import template from '%/directives/account-menu.pug';
|
||||||
import { ProtectedAction, ContentType } from 'snjs';
|
import { ProtectedAction, ContentType } from '@standardnotes/snjs';
|
||||||
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
||||||
import {
|
import {
|
||||||
STRING_ACCOUNT_MENU_UNCHECK_MERGE,
|
STRING_ACCOUNT_MENU_UNCHECK_MERGE,
|
||||||
@@ -22,9 +22,8 @@ import {
|
|||||||
STRING_CONFIRM_APP_QUIT_DURING_PASSCODE_REMOVAL,
|
STRING_CONFIRM_APP_QUIT_DURING_PASSCODE_REMOVAL,
|
||||||
STRING_UNSUPPORTED_BACKUP_FILE_VERSION
|
STRING_UNSUPPORTED_BACKUP_FILE_VERSION
|
||||||
} from '@/strings';
|
} from '@/strings';
|
||||||
import { SyncOpStatus } from 'snjs/dist/@types/services/sync/sync_op_status';
|
|
||||||
import { PasswordWizardType } from '@/types';
|
import { PasswordWizardType } from '@/types';
|
||||||
import { BackupFile } from 'snjs/dist/@types/services/protocol_service';
|
import { BackupFile } from '@standardnotes/snjs';
|
||||||
import { confirmDialog, alertDialog } from '@/services/alertService';
|
import { confirmDialog, alertDialog } from '@/services/alertService';
|
||||||
import { autorun, IReactionDisposer } from 'mobx';
|
import { autorun, IReactionDisposer } from 'mobx';
|
||||||
import { storage, StorageKey } from '@/services/localStorage';
|
import { storage, StorageKey } from '@/services/localStorage';
|
||||||
@@ -67,15 +66,18 @@ type AccountMenuState = {
|
|||||||
selectedAutoLockInterval: any;
|
selectedAutoLockInterval: any;
|
||||||
showBetaWarning: boolean;
|
showBetaWarning: boolean;
|
||||||
errorReportingEnabled: boolean;
|
errorReportingEnabled: boolean;
|
||||||
|
syncInProgress: boolean;
|
||||||
|
syncError: string;
|
||||||
|
syncPercentage: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
class AccountMenuCtrl extends PureViewCtrl<{}, AccountMenuState> {
|
class AccountMenuCtrl extends PureViewCtrl<{}, AccountMenuState> {
|
||||||
|
|
||||||
public appVersion: string
|
public appVersion: string
|
||||||
/** @template */
|
/** @template */
|
||||||
syncStatus?: SyncOpStatus
|
|
||||||
private closeFunction?: () => void
|
private closeFunction?: () => void
|
||||||
private removeBetaWarningListener?: IReactionDisposer
|
private removeBetaWarningListener?: IReactionDisposer
|
||||||
|
private removeSyncObserver?: IReactionDisposer
|
||||||
|
|
||||||
/* @ngInject */
|
/* @ngInject */
|
||||||
constructor(
|
constructor(
|
||||||
@@ -130,7 +132,14 @@ class AccountMenuCtrl extends PureViewCtrl<{}, AccountMenuState> {
|
|||||||
|
|
||||||
$onInit() {
|
$onInit() {
|
||||||
super.$onInit();
|
super.$onInit();
|
||||||
this.syncStatus = this.application!.getSyncStatus();
|
const sync = this.appState.sync;
|
||||||
|
this.removeSyncObserver = autorun(() => {
|
||||||
|
this.setState({
|
||||||
|
syncInProgress: sync.inProgress,
|
||||||
|
syncError: sync.errorMessage,
|
||||||
|
syncPercentage: sync.humanReadablePercentage,
|
||||||
|
});
|
||||||
|
})
|
||||||
this.removeBetaWarningListener = autorun(() => {
|
this.removeBetaWarningListener = autorun(() => {
|
||||||
this.setState({
|
this.setState({
|
||||||
showBetaWarning: this.appState.showBetaWarning
|
showBetaWarning: this.appState.showBetaWarning
|
||||||
@@ -139,6 +148,7 @@ class AccountMenuCtrl extends PureViewCtrl<{}, AccountMenuState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
deinit() {
|
deinit() {
|
||||||
|
this.removeSyncObserver?.();
|
||||||
this.removeBetaWarningListener?.();
|
this.removeBetaWarningListener?.();
|
||||||
super.deinit();
|
super.deinit();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import { WebApplication } from '@/ui_models/application';
|
|||||||
import { WebDirective } from './../../types';
|
import { WebDirective } from './../../types';
|
||||||
import template from '%/directives/actions-menu.pug';
|
import template from '%/directives/actions-menu.pug';
|
||||||
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
||||||
import { SNItem, Action, SNActionsExtension, UuidString } from 'snjs/dist/@types';
|
import { SNItem, Action, SNActionsExtension, UuidString } from '@standardnotes/snjs';
|
||||||
import { ActionResponse } from 'snjs';
|
import { ActionResponse } from '@standardnotes/snjs';
|
||||||
import { ActionsExtensionMutator } from 'snjs/dist/@types/models/app/extension';
|
import { ActionsExtensionMutator } from '@standardnotes/snjs';
|
||||||
import { autorun, IReactionDisposer } from 'mobx';
|
import { autorun, IReactionDisposer } from 'mobx';
|
||||||
|
|
||||||
type ActionsMenuScope = {
|
type ActionsMenuScope = {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { WebApplication } from '@/ui_models/application';
|
import { WebApplication } from '@/ui_models/application';
|
||||||
import { SNComponent, LiveItem } from 'snjs';
|
import { SNComponent, LiveItem } from '@standardnotes/snjs';
|
||||||
import { WebDirective } from './../../types';
|
import { WebDirective } from './../../types';
|
||||||
import template from '%/directives/component-modal.pug';
|
import template from '%/directives/component-modal.pug';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { RootScopeMessages } from './../../messages';
|
import { RootScopeMessages } from './../../messages';
|
||||||
import { WebApplication } from '@/ui_models/application';
|
import { WebApplication } from '@/ui_models/application';
|
||||||
import { SNComponent, ComponentAction, LiveItem } from 'snjs';
|
import { SNComponent, ComponentAction, LiveItem } from '@standardnotes/snjs';
|
||||||
import { WebDirective } from './../../types';
|
import { WebDirective } from './../../types';
|
||||||
import template from '%/directives/component-view.pug';
|
import template from '%/directives/component-view.pug';
|
||||||
import { isDesktopApplication } from '../../utils';
|
import { isDesktopApplication } from '../../utils';
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { WebDirective } from './../../types';
|
import { WebDirective } from './../../types';
|
||||||
import { WebApplication } from '@/ui_models/application';
|
import { WebApplication } from '@/ui_models/application';
|
||||||
import { SNComponent, SNItem, ComponentArea } from 'snjs';
|
import { SNComponent, SNItem, ComponentArea } from '@standardnotes/snjs';
|
||||||
import { isDesktopApplication } from '@/utils';
|
import { isDesktopApplication } from '@/utils';
|
||||||
import template from '%/directives/editor-menu.pug';
|
import template from '%/directives/editor-menu.pug';
|
||||||
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
||||||
import { ComponentMutator } from 'snjs/dist/@types/models';
|
import { ComponentMutator } from '@standardnotes/snjs';
|
||||||
|
|
||||||
interface EditorMenuScope {
|
interface EditorMenuScope {
|
||||||
callback: (component: SNComponent) => void
|
callback: (component: SNComponent) => void
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { WebDirective } from '../../types';
|
import { WebDirective } from '../../types';
|
||||||
import { WebApplication } from '@/ui_models/application';
|
import { WebApplication } from '@/ui_models/application';
|
||||||
import template from '%/directives/history-menu.pug';
|
import template from '%/directives/history-menu.pug';
|
||||||
import { SNItem, ItemHistoryEntry } from 'snjs/dist/@types';
|
import { SNItem, ItemHistoryEntry } from '@standardnotes/snjs';
|
||||||
import { PureViewCtrl } from '@/views';
|
import { PureViewCtrl } from '@/views';
|
||||||
import { ItemSessionHistory } from 'snjs/dist/@types/services/history/session/item_session_history';
|
import { ItemSessionHistory } from '@standardnotes/snjs';
|
||||||
import { RevisionListEntry, SingleRevision } from 'snjs/dist/@types/services/api/responses';
|
import { RevisionListEntry, SingleRevision } from '@standardnotes/snjs';
|
||||||
import { confirmDialog } from '@/services/alertService';
|
import { confirmDialog } from '@/services/alertService';
|
||||||
|
|
||||||
type HistoryState = {
|
type HistoryState = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { WebDirective } from './../../types';
|
import { WebDirective } from './../../types';
|
||||||
import { WebApplication } from '@/ui_models/application';
|
import { WebApplication } from '@/ui_models/application';
|
||||||
import { ProtectedAction, PrivilegeCredential, PrivilegeSessionLength } from 'snjs';
|
import { ProtectedAction, PrivilegeCredential, PrivilegeSessionLength } from '@standardnotes/snjs';
|
||||||
import template from '%/directives/privileges-auth-modal.pug';
|
import template from '%/directives/privileges-auth-modal.pug';
|
||||||
|
|
||||||
type PrivilegesAuthModalScope = {
|
type PrivilegesAuthModalScope = {
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { WebDirective } from './../../types';
|
import { WebDirective } from './../../types';
|
||||||
import { WebApplication } from '@/ui_models/application';
|
import { WebApplication } from '@/ui_models/application';
|
||||||
import template from '%/directives/privileges-management-modal.pug';
|
import template from '%/directives/privileges-management-modal.pug';
|
||||||
import { PrivilegeCredential, ProtectedAction, SNPrivileges, PrivilegeSessionLength } from 'snjs';
|
import { PrivilegeCredential, ProtectedAction, SNPrivileges, PrivilegeSessionLength } from '@standardnotes/snjs';
|
||||||
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
||||||
import { PrivilegeMutator } from 'snjs/dist/@types/models';
|
import { PrivilegeMutator } from '@standardnotes/snjs';
|
||||||
|
|
||||||
type DisplayInfo = {
|
type DisplayInfo = {
|
||||||
label: string
|
label: string
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ import {
|
|||||||
SNComponent,
|
SNComponent,
|
||||||
SNNote,
|
SNNote,
|
||||||
ComponentArea
|
ComponentArea
|
||||||
} from 'snjs';
|
} from '@standardnotes/snjs';
|
||||||
import template from '%/directives/revision-preview-modal.pug';
|
import template from '%/directives/revision-preview-modal.pug';
|
||||||
import { PayloadContent } from 'snjs/dist/@types/protocol/payloads/generator';
|
import { PayloadContent } from '@standardnotes/snjs';
|
||||||
import { confirmDialog } from '@/services/alertService';
|
import { confirmDialog } from '@/services/alertService';
|
||||||
|
|
||||||
interface RevisionPreviewScope {
|
interface RevisionPreviewScope {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable prefer-promise-reject-errors */
|
/* eslint-disable prefer-promise-reject-errors */
|
||||||
import { SNAlertService, ButtonType } from 'snjs';
|
import { SNAlertService, ButtonType } from '@standardnotes/snjs';
|
||||||
import { SKAlert } from 'sn-stylekit';
|
import { SKAlert } from 'sn-stylekit';
|
||||||
|
|
||||||
/** @returns a promise resolving to true if the user confirmed, false if they canceled */
|
/** @returns a promise resolving to true if the user confirmed, false if they canceled */
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { WebApplication } from '@/ui_models/application';
|
import { WebApplication } from '@/ui_models/application';
|
||||||
import { EncryptionIntent, ProtectedAction, SNItem, ContentType, SNNote } from 'snjs';
|
import { EncryptionIntent, ProtectedAction, SNItem, ContentType, SNNote } from '@standardnotes/snjs';
|
||||||
|
|
||||||
function zippableTxtName(name: string, suffix = ""): string {
|
function zippableTxtName(name: string, suffix = ""): string {
|
||||||
const sanitizedName = name
|
const sanitizedName = name
|
||||||
@@ -111,7 +111,7 @@ export class ArchiveManager {
|
|||||||
);
|
);
|
||||||
zipWriter.add(fileName, new this.zip.BlobReader(blob), resolve);
|
zipWriter.add(fileName, new this.zip.BlobReader(blob), resolve);
|
||||||
});
|
});
|
||||||
|
|
||||||
let index = 0;
|
let index = 0;
|
||||||
const nextFile = () => {
|
const nextFile = () => {
|
||||||
const item = items[index];
|
const item = items[index];
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ApplicationService } from 'snjs';
|
import { ApplicationService } from '@standardnotes/snjs';
|
||||||
import { WebApplication } from '@/ui_models/application';
|
import { WebApplication } from '@/ui_models/application';
|
||||||
import { isDesktopApplication } from '@/utils';
|
import { isDesktopApplication } from '@/utils';
|
||||||
import { AppStateEvent } from '@/ui_models/app_state';
|
import { AppStateEvent } from '@/ui_models/app_state';
|
||||||
|
|||||||
@@ -1,51 +1,22 @@
|
|||||||
import { PurePayload, Environment } from "snjs";
|
/**
|
||||||
|
* This file will be imported by desktop, so we make sure imports are carrying
|
||||||
|
* as little extra code as possible with them.
|
||||||
|
*/
|
||||||
|
import { Environment } from '@standardnotes/snjs';
|
||||||
|
|
||||||
/** Platform-specific (i-e Electron/browser) behavior is handled by a Bridge object. */
|
/** Platform-specific (i-e Electron/browser) behavior is handled by a Bridge object. */
|
||||||
export interface Bridge {
|
export interface Bridge {
|
||||||
environment: Environment,
|
readonly appVersion: string;
|
||||||
|
environment: Environment;
|
||||||
|
|
||||||
getKeychainValue(): Promise<unknown>;
|
getKeychainValue(): Promise<unknown>;
|
||||||
setKeychainValue(value: any): Promise<void>;
|
setKeychainValue(value: any): Promise<void>;
|
||||||
clearKeychainValue(): Promise<void>;
|
clearKeychainValue(): Promise<void>;
|
||||||
|
|
||||||
extensionsServerHost?: string;
|
extensionsServerHost?: string;
|
||||||
syncComponents(payloads: PurePayload[]): void;
|
syncComponents(payloads: unknown[]): void;
|
||||||
onMajorDataChange(): void;
|
onMajorDataChange(): void;
|
||||||
onInitialDataLoad(): void;
|
onInitialDataLoad(): void;
|
||||||
onSearch(text?: string): void;
|
onSearch(text?: string): void;
|
||||||
downloadBackup(): void;
|
downloadBackup(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
const KEYCHAIN_STORAGE_KEY = 'keychain';
|
|
||||||
|
|
||||||
export class BrowserBridge implements Bridge {
|
|
||||||
environment = Environment.Web;
|
|
||||||
|
|
||||||
async getKeychainValue(): Promise<unknown> {
|
|
||||||
const value = localStorage.getItem(KEYCHAIN_STORAGE_KEY);
|
|
||||||
if (value) {
|
|
||||||
return JSON.parse(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async setKeychainValue(value: any): Promise<void> {
|
|
||||||
localStorage.setItem(KEYCHAIN_STORAGE_KEY, JSON.stringify(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
async clearKeychainValue(): Promise<void> {
|
|
||||||
localStorage.removeItem(KEYCHAIN_STORAGE_KEY);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** No-ops */
|
|
||||||
|
|
||||||
syncComponents() {
|
|
||||||
}
|
|
||||||
onMajorDataChange() {
|
|
||||||
}
|
|
||||||
onInitialDataLoad() {
|
|
||||||
}
|
|
||||||
onSearch() {
|
|
||||||
}
|
|
||||||
downloadBackup() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
32
app/assets/javascripts/services/browserBridge.ts
Normal file
32
app/assets/javascripts/services/browserBridge.ts
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
import { Bridge } from "./bridge";
|
||||||
|
import { Environment } from '@standardnotes/snjs';
|
||||||
|
|
||||||
|
const KEYCHAIN_STORAGE_KEY = 'keychain';
|
||||||
|
|
||||||
|
export class BrowserBridge implements Bridge {
|
||||||
|
constructor(public appVersion: string) {}
|
||||||
|
environment = Environment.Web;
|
||||||
|
|
||||||
|
async getKeychainValue(): Promise<unknown> {
|
||||||
|
const value = localStorage.getItem(KEYCHAIN_STORAGE_KEY);
|
||||||
|
if (value) {
|
||||||
|
return JSON.parse(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async setKeychainValue(value: any): Promise<void> {
|
||||||
|
localStorage.setItem(KEYCHAIN_STORAGE_KEY, JSON.stringify(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
async clearKeychainValue(): Promise<void> {
|
||||||
|
localStorage.removeItem(KEYCHAIN_STORAGE_KEY);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** No-ops */
|
||||||
|
|
||||||
|
syncComponents() {}
|
||||||
|
onMajorDataChange() {}
|
||||||
|
onInitialDataLoad() {}
|
||||||
|
onSearch() {}
|
||||||
|
downloadBackup() {}
|
||||||
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
import { SNComponent, PurePayload, ComponentMutator, AppDataField, ContentType } from 'snjs';
|
import { SNComponent, PurePayload, ComponentMutator, AppDataField, ContentType } from '@standardnotes/snjs';
|
||||||
/* eslint-disable camelcase */
|
/* eslint-disable camelcase */
|
||||||
import { WebApplication } from '@/ui_models/application';
|
import { WebApplication } from '@/ui_models/application';
|
||||||
// An interface used by the Desktop app to interact with SN
|
// An interface used by the Desktop app to interact with SN
|
||||||
import { isDesktopApplication } from '@/utils';
|
import { isDesktopApplication } from '@/utils';
|
||||||
import { EncryptionIntent, ApplicationService, ApplicationEvent, removeFromArray } from 'snjs';
|
import { EncryptionIntent, ApplicationService, ApplicationEvent, removeFromArray } from '@standardnotes/snjs';
|
||||||
import { Bridge } from './bridge';
|
import { Bridge } from './bridge';
|
||||||
|
|
||||||
type UpdateObserverCallback = (component: SNComponent) => void
|
type UpdateObserverCallback = (component: SNComponent) => void
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SNLog } from 'snjs';
|
import { SNLog } from '@standardnotes/snjs';
|
||||||
import { isDesktopApplication, isDev } from '@/utils';
|
import { isDesktopApplication, isDev } from '@/utils';
|
||||||
import { storage, StorageKey } from './localStorage';
|
import { storage, StorageKey } from './localStorage';
|
||||||
import Bugsnag from '@bugsnag/js';
|
import Bugsnag from '@bugsnag/js';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { removeFromArray } from 'snjs';
|
import { removeFromArray } from '@standardnotes/snjs';
|
||||||
export enum KeyboardKey {
|
export enum KeyboardKey {
|
||||||
Tab = "Tab",
|
Tab = "Tab",
|
||||||
Backspace = "Backspace",
|
Backspace = "Backspace",
|
||||||
|
|||||||
@@ -9,9 +9,9 @@ import {
|
|||||||
ComponentMutator,
|
ComponentMutator,
|
||||||
Copy,
|
Copy,
|
||||||
dictToArray
|
dictToArray
|
||||||
} from 'snjs';
|
} from '@standardnotes/snjs';
|
||||||
import { PayloadContent } from 'snjs/dist/@types/protocol/payloads/generator';
|
import { PayloadContent } from '@standardnotes/snjs';
|
||||||
import { ComponentPermission } from 'snjs/dist/@types/models/app/component';
|
import { ComponentPermission } from '@standardnotes/snjs';
|
||||||
|
|
||||||
/** A class for handling installation of system extensions */
|
/** A class for handling installation of system extensions */
|
||||||
export class NativeExtManager extends ApplicationService {
|
export class NativeExtManager extends ApplicationService {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {
|
|||||||
UserPrefsMutator,
|
UserPrefsMutator,
|
||||||
FillItemContent,
|
FillItemContent,
|
||||||
ApplicationEvent,
|
ApplicationEvent,
|
||||||
} from 'snjs';
|
} from '@standardnotes/snjs';
|
||||||
|
|
||||||
export class PreferencesManager extends ApplicationService {
|
export class PreferencesManager extends ApplicationService {
|
||||||
private userPreferences!: SNUserPrefs;
|
private userPreferences!: SNUserPrefs;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { removeFromArray } from 'snjs';
|
import { removeFromArray } from '@standardnotes/snjs';
|
||||||
|
|
||||||
type StatusCallback = (string: string) => void;
|
type StatusCallback = (string: string) => void;
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
SNTheme,
|
SNTheme,
|
||||||
removeFromArray,
|
removeFromArray,
|
||||||
ApplicationEvent, ContentType
|
ApplicationEvent, ContentType
|
||||||
} from 'snjs';
|
} from '@standardnotes/snjs';
|
||||||
|
|
||||||
const CACHED_THEMES_KEY = 'cachedThemes';
|
const CACHED_THEMES_KEY = 'cachedThemes';
|
||||||
|
|
||||||
|
|||||||
6
app/assets/javascripts/startApplication.ts
Normal file
6
app/assets/javascripts/startApplication.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { Bridge } from "./services/bridge";
|
||||||
|
|
||||||
|
export type StartApplication = (
|
||||||
|
defaultSyncServerHost: string,
|
||||||
|
bridge: Bridge
|
||||||
|
) => Promise<void>;
|
||||||
@@ -4,11 +4,11 @@
|
|||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"allowJs": true,
|
"allowJs": true,
|
||||||
|
"noEmit": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"emitDeclarationOnly": true,
|
|
||||||
"newLine": "lf",
|
"newLine": "lf",
|
||||||
"declarationDir": "../../../dist/@types",
|
"declarationDir": "../../../dist/@types",
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SNComponent } from 'snjs';
|
import { SNComponent } from '@standardnotes/snjs';
|
||||||
export class WebDirective implements ng.IDirective {
|
export class WebDirective implements ng.IDirective {
|
||||||
controller?: string | ng.Injectable<ng.IControllerConstructor>;
|
controller?: string | ng.Injectable<ng.IControllerConstructor>;
|
||||||
controllerAs?: string;
|
controllerAs?: string;
|
||||||
@@ -42,4 +42,4 @@ export type PanelPuppet = {
|
|||||||
|
|
||||||
export type FooterStatus = {
|
export type FooterStatus = {
|
||||||
string: string
|
string: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,11 +10,13 @@ import {
|
|||||||
SNSmartTag,
|
SNSmartTag,
|
||||||
PayloadSource,
|
PayloadSource,
|
||||||
DeinitSource,
|
DeinitSource,
|
||||||
UuidString
|
UuidString,
|
||||||
} from 'snjs';
|
SyncOpStatus
|
||||||
|
} from '@standardnotes/snjs';
|
||||||
import { WebApplication } from '@/ui_models/application';
|
import { WebApplication } from '@/ui_models/application';
|
||||||
import { Editor } from '@/ui_models/editor';
|
import { Editor } from '@/ui_models/editor';
|
||||||
import { action, makeObservable, observable } from 'mobx';
|
import { action, makeObservable, observable } from 'mobx';
|
||||||
|
import { Bridge } from '@/services/bridge';
|
||||||
|
|
||||||
export enum AppStateEvent {
|
export enum AppStateEvent {
|
||||||
TagChanged = 1,
|
TagChanged = 1,
|
||||||
@@ -57,6 +59,39 @@ class ActionsMenuState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class SyncState {
|
||||||
|
inProgress = false;
|
||||||
|
errorMessage?: string;
|
||||||
|
humanReadablePercentage?: string;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
makeObservable(this, {
|
||||||
|
inProgress: observable,
|
||||||
|
errorMessage: observable,
|
||||||
|
humanReadablePercentage: observable,
|
||||||
|
update: action,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
update(status: SyncOpStatus) {
|
||||||
|
this.errorMessage = status.error?.message;
|
||||||
|
this.inProgress = status.syncInProgress;
|
||||||
|
const stats = status.getStats();
|
||||||
|
const completionPercentage = stats.uploadCompletionCount === 0
|
||||||
|
? 0
|
||||||
|
: stats.uploadCompletionCount / stats.uploadTotalCount;
|
||||||
|
|
||||||
|
if (completionPercentage === 0) {
|
||||||
|
this.humanReadablePercentage = undefined;
|
||||||
|
} else {
|
||||||
|
this.humanReadablePercentage = completionPercentage.toLocaleString(
|
||||||
|
undefined,
|
||||||
|
{ style: 'percent' }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class AppState {
|
export class AppState {
|
||||||
$rootScope: ng.IRootScopeService;
|
$rootScope: ng.IRootScopeService;
|
||||||
$timeout: ng.ITimeoutService;
|
$timeout: ng.ITimeoutService;
|
||||||
@@ -71,13 +106,15 @@ export class AppState {
|
|||||||
userPreferences?: SNUserPrefs;
|
userPreferences?: SNUserPrefs;
|
||||||
multiEditorEnabled = false;
|
multiEditorEnabled = false;
|
||||||
showBetaWarning = false;
|
showBetaWarning = false;
|
||||||
actionsMenu = new ActionsMenuState();
|
readonly actionsMenu = new ActionsMenuState();
|
||||||
|
readonly sync = new SyncState();
|
||||||
|
|
||||||
/* @ngInject */
|
/* @ngInject */
|
||||||
constructor(
|
constructor(
|
||||||
$rootScope: ng.IRootScopeService,
|
$rootScope: ng.IRootScopeService,
|
||||||
$timeout: ng.ITimeoutService,
|
$timeout: ng.ITimeoutService,
|
||||||
application: WebApplication
|
application: WebApplication,
|
||||||
|
private bridge: Bridge,
|
||||||
) {
|
) {
|
||||||
this.$timeout = $timeout;
|
this.$timeout = $timeout;
|
||||||
this.$rootScope = $rootScope;
|
this.$rootScope = $rootScope;
|
||||||
@@ -133,7 +170,7 @@ export class AppState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private determineBetaWarningValue() {
|
private determineBetaWarningValue() {
|
||||||
if ((window as any).electronAppVersion?.includes('-beta')) {
|
if (this.bridge.appVersion.includes('-beta')) {
|
||||||
switch (localStorage.getItem(SHOW_BETA_WARNING_KEY)) {
|
switch (localStorage.getItem(SHOW_BETA_WARNING_KEY)) {
|
||||||
case 'true':
|
case 'true':
|
||||||
default:
|
default:
|
||||||
@@ -152,10 +189,20 @@ export class AppState {
|
|||||||
*/
|
*/
|
||||||
async createEditor(title?: string) {
|
async createEditor(title?: string) {
|
||||||
const activeEditor = this.getActiveEditor();
|
const activeEditor = this.getActiveEditor();
|
||||||
|
const activeTagUuid = this.selectedTag
|
||||||
|
? this.selectedTag.isSmartTag()
|
||||||
|
? undefined
|
||||||
|
: this.selectedTag.uuid
|
||||||
|
: undefined;
|
||||||
|
|
||||||
if (!activeEditor || this.multiEditorEnabled) {
|
if (!activeEditor || this.multiEditorEnabled) {
|
||||||
this.application.editorGroup.createEditor(undefined, title);
|
this.application.editorGroup.createEditor(
|
||||||
|
undefined,
|
||||||
|
title,
|
||||||
|
activeTagUuid
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
await activeEditor.reset(title);
|
await activeEditor.reset(title, activeTagUuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,10 +298,16 @@ export class AppState {
|
|||||||
|
|
||||||
addAppEventObserver() {
|
addAppEventObserver() {
|
||||||
this.unsubApp = this.application.addEventObserver(async (eventName) => {
|
this.unsubApp = this.application.addEventObserver(async (eventName) => {
|
||||||
if (eventName === ApplicationEvent.Started) {
|
switch (eventName) {
|
||||||
this.locked = true;
|
case ApplicationEvent.Started:
|
||||||
} else if (eventName === ApplicationEvent.Launched) {
|
this.locked = true;
|
||||||
this.locked = false;
|
break;
|
||||||
|
case ApplicationEvent.Launched:
|
||||||
|
this.locked = false;
|
||||||
|
break;
|
||||||
|
case ApplicationEvent.SyncStatusChanged:
|
||||||
|
this.sync.update(this.application.getSyncStatus());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { PermissionDialog } from 'snjs/dist/@types/services/component_manager';
|
import { PermissionDialog } from '@standardnotes/snjs';
|
||||||
import { ComponentModalScope } from './../directives/views/componentModal';
|
import { ComponentModalScope } from './../directives/views/componentModal';
|
||||||
import { AccountSwitcherScope, PermissionsModalScope } from './../types';
|
import { AccountSwitcherScope, PermissionsModalScope } from './../types';
|
||||||
import { ComponentGroup } from './component_group';
|
import { ComponentGroup } from './component_group';
|
||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
platformFromString,
|
platformFromString,
|
||||||
Challenge,
|
Challenge,
|
||||||
ProtectedAction, SNComponent
|
ProtectedAction, SNComponent
|
||||||
} from 'snjs';
|
} from '@standardnotes/snjs';
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import { getPlatformString } from '@/utils';
|
import { getPlatformString } from '@/utils';
|
||||||
import { AlertService } from '@/services/alertService';
|
import { AlertService } from '@/services/alertService';
|
||||||
@@ -26,9 +26,9 @@ import {
|
|||||||
KeyboardManager
|
KeyboardManager
|
||||||
} from '@/services';
|
} from '@/services';
|
||||||
import { AppState } from '@/ui_models/app_state';
|
import { AppState } from '@/ui_models/app_state';
|
||||||
import { SNWebCrypto } from 'sncrypto/dist/sncrypto-web';
|
import { SNWebCrypto } from '@standardnotes/sncrypto-web';
|
||||||
import { Bridge } from '@/services/bridge';
|
import { Bridge } from '@/services/bridge';
|
||||||
import { DeinitSource } from 'snjs/dist/@types/types';
|
import { DeinitSource } from '@standardnotes/snjs';
|
||||||
|
|
||||||
type WebServices = {
|
type WebServices = {
|
||||||
appState: AppState
|
appState: AppState
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { WebDeviceInterface } from '@/web_device_interface';
|
import { WebDeviceInterface } from '@/web_device_interface';
|
||||||
import { WebApplication } from './application';
|
import { WebApplication } from './application';
|
||||||
import { ApplicationDescriptor, SNApplicationGroup, DeviceInterface } from 'snjs';
|
import { ApplicationDescriptor, SNApplicationGroup, DeviceInterface } from '@standardnotes/snjs';
|
||||||
import {
|
import {
|
||||||
ArchiveManager,
|
ArchiveManager,
|
||||||
DesktopManager,
|
DesktopManager,
|
||||||
@@ -63,7 +63,8 @@ export class ApplicationGroup extends SNApplicationGroup {
|
|||||||
const appState = new AppState(
|
const appState = new AppState(
|
||||||
this.$rootScope,
|
this.$rootScope,
|
||||||
this.$timeout,
|
this.$timeout,
|
||||||
application
|
application,
|
||||||
|
this.bridge,
|
||||||
);
|
);
|
||||||
const archiveService = new ArchiveManager(
|
const archiveService = new ArchiveManager(
|
||||||
application
|
application
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { SNComponent, ComponentArea, removeFromArray, addIfUnique } from 'snjs';
|
import { SNComponent, ComponentArea, removeFromArray, addIfUnique } from '@standardnotes/snjs';
|
||||||
import { WebApplication } from './application';
|
import { WebApplication } from './application';
|
||||||
import { UuidString } from 'snjs/dist/@types/types';
|
import { UuidString } from '@standardnotes/snjs';
|
||||||
|
|
||||||
/** Areas that only allow a single component to be active */
|
/** Areas that only allow a single component to be active */
|
||||||
const SingleComponentAreas = [
|
const SingleComponentAreas = [
|
||||||
@@ -99,4 +99,4 @@ export class ComponentGroup {
|
|||||||
observer();
|
observer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SNNote, ContentType, PayloadSource } from 'snjs';
|
import { SNNote, ContentType, PayloadSource, UuidString, TagMutator } from '@standardnotes/snjs';
|
||||||
import { WebApplication } from './application';
|
import { WebApplication } from './application';
|
||||||
|
|
||||||
export class Editor {
|
export class Editor {
|
||||||
@@ -12,15 +12,16 @@ export class Editor {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
application: WebApplication,
|
application: WebApplication,
|
||||||
noteUuid?: string,
|
noteUuid: string | undefined,
|
||||||
noteTitle?: string
|
noteTitle: string | undefined,
|
||||||
|
noteTag: UuidString | undefined
|
||||||
) {
|
) {
|
||||||
this.application = application;
|
this.application = application;
|
||||||
if (noteUuid) {
|
if (noteUuid) {
|
||||||
this.note = application.findItem(noteUuid) as SNNote;
|
this.note = application.findItem(noteUuid) as SNNote;
|
||||||
this.streamItems();
|
this.streamItems();
|
||||||
} else {
|
} else {
|
||||||
this.reset(noteTitle)
|
this.reset(noteTitle, noteTag)
|
||||||
.then(() => this.streamItems())
|
.then(() => this.streamItems())
|
||||||
.catch(console.error);
|
.catch(console.error);
|
||||||
}
|
}
|
||||||
@@ -65,7 +66,10 @@ export class Editor {
|
|||||||
* Reverts the editor to a blank state, removing any existing note from view,
|
* Reverts the editor to a blank state, removing any existing note from view,
|
||||||
* and creating a placeholder note.
|
* and creating a placeholder note.
|
||||||
*/
|
*/
|
||||||
async reset(noteTitle = '') {
|
async reset(
|
||||||
|
noteTitle = '',
|
||||||
|
noteTag?: UuidString,
|
||||||
|
) {
|
||||||
const note = await this.application.createTemplateItem(
|
const note = await this.application.createTemplateItem(
|
||||||
ContentType.Note,
|
ContentType.Note,
|
||||||
{
|
{
|
||||||
@@ -74,6 +78,11 @@ export class Editor {
|
|||||||
references: []
|
references: []
|
||||||
}
|
}
|
||||||
) as SNNote;
|
) as SNNote;
|
||||||
|
if (noteTag) {
|
||||||
|
await this.application.changeItem<TagMutator>(noteTag, (m) => {
|
||||||
|
m.addItemAsRelationship(note);
|
||||||
|
});
|
||||||
|
}
|
||||||
if (!this.isTemplateNote || this.note.title !== note.title) {
|
if (!this.isTemplateNote || this.note.title !== note.title) {
|
||||||
this.setNote(note as SNNote, true);
|
this.setNote(note as SNNote, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { removeFromArray } from 'snjs';
|
import { removeFromArray, UuidString } from '@standardnotes/snjs';
|
||||||
import { Editor } from './editor';
|
import { Editor } from './editor';
|
||||||
import { WebApplication } from './application';
|
import { WebApplication } from './application';
|
||||||
|
|
||||||
@@ -21,8 +21,12 @@ export class EditorGroup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
createEditor(noteUuid?: string, noteTitle?: string) {
|
createEditor(
|
||||||
const editor = new Editor(this.application, noteUuid, noteTitle);
|
noteUuid?: string,
|
||||||
|
noteTitle?: string,
|
||||||
|
noteTag?: UuidString
|
||||||
|
) {
|
||||||
|
const editor = new Editor(this.application, noteUuid, noteTitle, noteTag);
|
||||||
this.editors.push(editor);
|
this.editors.push(editor);
|
||||||
this.notifyObservers();
|
this.notifyObservers();
|
||||||
}
|
}
|
||||||
@@ -72,4 +76,4 @@ export class EditorGroup {
|
|||||||
observer();
|
observer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { ApplicationEvent } from 'snjs';
|
import { ApplicationEvent } from '@standardnotes/snjs';
|
||||||
import { WebApplication } from '@/ui_models/application';
|
import { WebApplication } from '@/ui_models/application';
|
||||||
|
|
||||||
export type CtrlState = Partial<Record<string, any>>
|
export type CtrlState = Partial<Record<string, any>>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { WebApplication } from '@/ui_models/application';
|
|||||||
import template from './account-switcher.pug';
|
import template from './account-switcher.pug';
|
||||||
import {
|
import {
|
||||||
ApplicationDescriptor,
|
ApplicationDescriptor,
|
||||||
} from 'snjs';
|
} from '@standardnotes/snjs';
|
||||||
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
||||||
import { WebDirective } from '@/types';
|
import { WebDirective } from '@/types';
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { WebDirective } from '@/types';
|
|||||||
import { getPlatformString } from '@/utils';
|
import { getPlatformString } from '@/utils';
|
||||||
import template from './application-view.pug';
|
import template from './application-view.pug';
|
||||||
import { AppStateEvent } from '@/ui_models/app_state';
|
import { AppStateEvent } from '@/ui_models/app_state';
|
||||||
import { ApplicationEvent } from 'snjs';
|
import { ApplicationEvent } from '@standardnotes/snjs';
|
||||||
import {
|
import {
|
||||||
PANEL_NAME_NOTES,
|
PANEL_NAME_NOTES,
|
||||||
PANEL_NAME_TAGS
|
PANEL_NAME_TAGS
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {
|
|||||||
Challenge,
|
Challenge,
|
||||||
ChallengeReason,
|
ChallengeReason,
|
||||||
ChallengePrompt
|
ChallengePrompt
|
||||||
} from 'snjs';
|
} from '@standardnotes/snjs';
|
||||||
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
||||||
import { WebDirective } from '@/types';
|
import { WebDirective } from '@/types';
|
||||||
import { confirmDialog } from '@/services/alertService';
|
import { confirmDialog } from '@/services/alertService';
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import {
|
|||||||
ComponentAction,
|
ComponentAction,
|
||||||
WebPrefKey,
|
WebPrefKey,
|
||||||
ComponentMutator,
|
ComponentMutator,
|
||||||
} from 'snjs';
|
} from '@standardnotes/snjs';
|
||||||
import find from 'lodash/find';
|
import find from 'lodash/find';
|
||||||
import { isDesktopApplication } from '@/utils';
|
import { isDesktopApplication } from '@/utils';
|
||||||
import { KeyboardModifier, KeyboardKey } from '@/services/keyboardManager';
|
import { KeyboardModifier, KeyboardKey } from '@/services/keyboardManager';
|
||||||
@@ -593,7 +593,7 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
focusTitle() {
|
focusTitle() {
|
||||||
document.getElementById(ElementIds.NoteTitleEditor)!.focus();
|
document.getElementById(ElementIds.NoteTitleEditor)?.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
clickedTextArea() {
|
clickedTextArea() {
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ editor-view(
|
|||||||
ng-repeat='editor in self.editors'
|
ng-repeat='editor in self.editors'
|
||||||
application='self.application'
|
application='self.application'
|
||||||
editor='editor'
|
editor='editor'
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -37,10 +37,8 @@
|
|||||||
)
|
)
|
||||||
.sk-app-bar-item.border(ng-if="ctrl.state.showBetaWarning")
|
.sk-app-bar-item.border(ng-if="ctrl.state.showBetaWarning")
|
||||||
.sk-app-bar-item(ng-if="ctrl.state.showBetaWarning")
|
.sk-app-bar-item(ng-if="ctrl.state.showBetaWarning")
|
||||||
a.no-decoration.sk-label.title.uppercase(
|
a.no-decoration.sk-label.title(
|
||||||
href='https://github.com/standardnotes/forum/issues/1114',
|
ng-click="ctrl.displayBetaDialog()"
|
||||||
rel='noopener',
|
|
||||||
target='_blank'
|
|
||||||
) You are using a beta version of the app
|
) You are using a beta version of the app
|
||||||
.center
|
.center
|
||||||
.sk-app-bar-item(ng-if='ctrl.arbitraryStatusMessage')
|
.sk-app-bar-item(ng-if='ctrl.arbitraryStatusMessage')
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
SNTheme,
|
SNTheme,
|
||||||
ComponentArea,
|
ComponentArea,
|
||||||
CollectionSort,
|
CollectionSort,
|
||||||
} from 'snjs';
|
} from '@standardnotes/snjs';
|
||||||
import template from './footer-view.pug';
|
import template from './footer-view.pug';
|
||||||
import { AppStateEvent, EventSource } from '@/ui_models/app_state';
|
import { AppStateEvent, EventSource } from '@/ui_models/app_state';
|
||||||
import {
|
import {
|
||||||
@@ -23,7 +23,7 @@ import {
|
|||||||
STRING_UPGRADE_ACCOUNT_CONFIRM_BUTTON,
|
STRING_UPGRADE_ACCOUNT_CONFIRM_BUTTON,
|
||||||
} from '@/strings';
|
} from '@/strings';
|
||||||
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
||||||
import { confirmDialog } from '@/services/alertService';
|
import { alertDialog, confirmDialog } from '@/services/alertService';
|
||||||
import { autorun, IReactionDisposer } from 'mobx';
|
import { autorun, IReactionDisposer } from 'mobx';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -568,6 +568,16 @@ class FooterViewCtrl extends PureViewCtrl<{}, {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
displayBetaDialog() {
|
||||||
|
alertDialog({
|
||||||
|
title: 'You are using a beta version of the app',
|
||||||
|
text:
|
||||||
|
'If you wish to go back to a stable version, make sure to sign out ' +
|
||||||
|
'of this beta app first.<br>You can silence this warning from the ' +
|
||||||
|
'<em>Account</em> menu.'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
clickOutsideAccountMenu() {
|
clickOutsideAccountMenu() {
|
||||||
if (this.application && this.application.authenticationInProgress()) {
|
if (this.application && this.application.authenticationInProgress()) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { SNNote } from 'snjs';
|
import { SNNote } from '@standardnotes/snjs';
|
||||||
|
|
||||||
export enum NoteSortKey {
|
export enum NoteSortKey {
|
||||||
CreatedAt = 'created_at',
|
CreatedAt = 'created_at',
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
WebPrefKey,
|
WebPrefKey,
|
||||||
findInArray,
|
findInArray,
|
||||||
CollectionSort,
|
CollectionSort,
|
||||||
} from 'snjs';
|
} from '@standardnotes/snjs';
|
||||||
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
|
||||||
import { AppStateEvent } from '@/ui_models/app_state';
|
import { AppStateEvent } from '@/ui_models/app_state';
|
||||||
import { KeyboardModifier, KeyboardKey } from '@/services/keyboardManager';
|
import { KeyboardModifier, KeyboardKey } from '@/services/keyboardManager';
|
||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
NoteSortKey,
|
NoteSortKey,
|
||||||
notePassesFilter
|
notePassesFilter
|
||||||
} from './note_utils';
|
} from './note_utils';
|
||||||
import { UuidString } from 'snjs/dist/@types/types';
|
import { UuidString } from '@standardnotes/snjs';
|
||||||
|
|
||||||
type NotesState = {
|
type NotesState = {
|
||||||
panelTitle: string
|
panelTitle: string
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { PayloadContent } from 'snjs/dist/@types/protocol/payloads/generator';
|
import { PayloadContent } from '@standardnotes/snjs';
|
||||||
import { WebDirective, PanelPuppet } from '@/types';
|
import { WebDirective, PanelPuppet } from '@/types';
|
||||||
import { WebApplication } from '@/ui_models/application';
|
import { WebApplication } from '@/ui_models/application';
|
||||||
import {
|
import {
|
||||||
@@ -12,7 +12,7 @@ import {
|
|||||||
WebPrefKey,
|
WebPrefKey,
|
||||||
UuidString,
|
UuidString,
|
||||||
TagMutator
|
TagMutator
|
||||||
} from 'snjs';
|
} from '@standardnotes/snjs';
|
||||||
import template from './tags-view.pug';
|
import template from './tags-view.pug';
|
||||||
import { AppStateEvent } from '@/ui_models/app_state';
|
import { AppStateEvent } from '@/ui_models/app_state';
|
||||||
import { PANEL_NAME_TAGS } from '@/views/constants';
|
import { PANEL_NAME_TAGS } from '@/views/constants';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { DeviceInterface, getGlobalScope, SNApplication, ApplicationIdentifier } from 'snjs';
|
import { DeviceInterface, getGlobalScope, SNApplication, ApplicationIdentifier } from '@standardnotes/snjs';
|
||||||
import { Database } from '@/database';
|
import { Database } from '@/database';
|
||||||
import { Bridge } from './services/bridge';
|
import { Bridge } from './services/bridge';
|
||||||
|
|
||||||
@@ -106,7 +106,7 @@ export class WebDeviceInterface extends DeviceInterface {
|
|||||||
if (!keychain) {
|
if (!keychain) {
|
||||||
keychain = {};
|
keychain = {};
|
||||||
}
|
}
|
||||||
this.bridge.setKeychainValue({
|
return this.bridge.setKeychainValue({
|
||||||
...keychain,
|
...keychain,
|
||||||
[identifier]: value
|
[identifier]: value
|
||||||
});
|
});
|
||||||
@@ -118,13 +118,17 @@ export class WebDeviceInterface extends DeviceInterface {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
delete keychain[identifier];
|
delete keychain[identifier];
|
||||||
this.bridge.setKeychainValue(keychain);
|
return this.bridge.setKeychainValue(keychain);
|
||||||
}
|
}
|
||||||
|
|
||||||
getRawKeychainValue(): Promise<any> {
|
getRawKeychainValue(): Promise<any> {
|
||||||
return this.bridge.getKeychainValue();
|
return this.bridge.getKeychainValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
legacy_setRawKeychainValue(value: unknown): Promise<any> {
|
||||||
|
return this.bridge.setKeychainValue(value);
|
||||||
|
}
|
||||||
|
|
||||||
clearRawKeychainValue() {
|
clearRawKeychainValue() {
|
||||||
return this.bridge.clearKeychainValue();
|
return this.bridge.clearKeychainValue();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,12 @@
|
|||||||
margin-left: 0.3rem;
|
margin-left: 0.3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sk-horizontal-group {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.sk-panel-section {
|
.sk-panel-section {
|
||||||
&:last-child {
|
&:last-child {
|
||||||
padding-bottom: 1rem;
|
padding-bottom: 1rem;
|
||||||
|
|||||||
@@ -136,11 +136,11 @@
|
|||||||
!self.state.formData.showRegister`
|
!self.state.formData.showRegister`
|
||||||
)
|
)
|
||||||
.sk-panel-section(ng-if='self.state.user')
|
.sk-panel-section(ng-if='self.state.user')
|
||||||
.sk-notification.danger(ng-if='self.syncStatus.error')
|
.sk-notification.danger(ng-if='self.state.syncError')
|
||||||
.sk-notification-title Sync Unreachable
|
.sk-notification-title Sync Unreachable
|
||||||
.sk-notification-text
|
.sk-notification-text
|
||||||
| Hmm...we can't seem to sync your account.
|
| Hmm...we can't seem to sync your account.
|
||||||
| The reason: {{self.syncStatus.error.message}}
|
| The reason: {{self.state.syncError}}
|
||||||
a.sk-a.info-contrast.sk-bold.sk-panel-row(
|
a.sk-a.info-contrast.sk-bold.sk-panel-row(
|
||||||
href='https://standardnotes.org/help',
|
href='https://standardnotes.org/help',
|
||||||
rel='noopener',
|
rel='noopener',
|
||||||
@@ -150,17 +150,16 @@
|
|||||||
.sk-panel-column
|
.sk-panel-column
|
||||||
.sk-h1.sk-bold.wrap {{self.state.user.email}}
|
.sk-h1.sk-bold.wrap {{self.state.user.email}}
|
||||||
.sk-subtitle.subtle.normal {{self.state.server}}
|
.sk-subtitle.subtle.normal {{self.state.server}}
|
||||||
.sk-horizontal-group(
|
.sk-horizontal-group(
|
||||||
delay='1000',
|
delay='1000',
|
||||||
delay-hide='true',
|
delay-hide='true',
|
||||||
show='self.syncStatus.syncOpInProgress || self.syncStatus.needsMoreSync'
|
show='self.state.syncInProgress'
|
||||||
)
|
)
|
||||||
.sk-spinner.small.info
|
.sk-spinner.small.info
|
||||||
.sk-sublabel
|
.sk-sublabel
|
||||||
| {{"Syncing" + (self.syncStatus.total > 0 ? ":" : "")}}
|
| Syncing
|
||||||
span(
|
span(ng-if='self.state.syncPercentage')
|
||||||
ng-if='self.syncStatus.total > 0'
|
| ({{self.state.syncPercentage}})
|
||||||
) {{self.syncStatus.current}}/{{self.syncStatus.total}}
|
|
||||||
.sk-panel-row
|
.sk-panel-row
|
||||||
a.sk-a.info.sk-panel-row.condensed(
|
a.sk-a.info.sk-panel-row.condensed(
|
||||||
ng-click="self.openPasswordWizard()"
|
ng-click="self.openPasswordWizard()"
|
||||||
|
|||||||
1
dist/@types/app/assets/javascripts/app.d.ts
vendored
1
dist/@types/app/assets/javascripts/app.d.ts
vendored
@@ -1 +0,0 @@
|
|||||||
export {};
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
import { PasswordWizardType } from './types';
|
|
||||||
import { SNApplication, Challenge, ChallengeOrchestrator, ProtectedAction } from 'snjs';
|
|
||||||
import { AppState, DesktopManager, LockManager, ArchiveManager, NativeExtManager, StatusManager, ThemeManager, PreferencesManager, KeyboardManager } from './services';
|
|
||||||
declare type WebServices = {
|
|
||||||
appState: AppState;
|
|
||||||
desktopService: DesktopManager;
|
|
||||||
lockService: LockManager;
|
|
||||||
archiveService: ArchiveManager;
|
|
||||||
nativeExtService: NativeExtManager;
|
|
||||||
statusService: StatusManager;
|
|
||||||
themeService: ThemeManager;
|
|
||||||
prefsService: PreferencesManager;
|
|
||||||
keyboardService: KeyboardManager;
|
|
||||||
};
|
|
||||||
export declare class WebApplication extends SNApplication {
|
|
||||||
private $compile?;
|
|
||||||
private scope?;
|
|
||||||
private onDeinit?;
|
|
||||||
private webServices;
|
|
||||||
private currentAuthenticationElement?;
|
|
||||||
constructor($compile: ng.ICompileService, $timeout: ng.ITimeoutService, scope: ng.IScope, onDeinit: (app: WebApplication) => void);
|
|
||||||
/** @override */
|
|
||||||
deinit(): void;
|
|
||||||
setWebServices(services: WebServices): void;
|
|
||||||
/** @access public */
|
|
||||||
getAppState(): AppState;
|
|
||||||
/** @access public */
|
|
||||||
getDesktopService(): DesktopManager;
|
|
||||||
/** @access public */
|
|
||||||
getLockService(): LockManager;
|
|
||||||
/** @access public */
|
|
||||||
getArchiveService(): ArchiveManager;
|
|
||||||
/** @access public */
|
|
||||||
getNativeExtService(): NativeExtManager;
|
|
||||||
/** @access public */
|
|
||||||
getStatusService(): StatusManager;
|
|
||||||
/** @access public */
|
|
||||||
getThemeService(): ThemeManager;
|
|
||||||
/** @access public */
|
|
||||||
getPrefsService(): PreferencesManager;
|
|
||||||
/** @access public */
|
|
||||||
getKeyboardService(): KeyboardManager;
|
|
||||||
checkForSecurityUpdate(): Promise<boolean>;
|
|
||||||
presentPasswordWizard(type: PasswordWizardType): void;
|
|
||||||
promptForChallenge(challenge: Challenge, orchestrator: ChallengeOrchestrator): void;
|
|
||||||
performProtocolUpgrade(): Promise<void>;
|
|
||||||
presentPrivilegesModal(action: ProtectedAction, onSuccess?: any, onCancel?: any): Promise<void>;
|
|
||||||
presentPrivilegesManagementModal(): void;
|
|
||||||
authenticationInProgress(): boolean;
|
|
||||||
presentPasswordModal(callback: () => void): void;
|
|
||||||
presentRevisionPreviewModal(uuid: string, content: any): void;
|
|
||||||
}
|
|
||||||
export {};
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
import { WebApplication } from './application';
|
|
||||||
declare type AppManagerChangeCallback = () => void;
|
|
||||||
export declare class ApplicationManager {
|
|
||||||
$compile: ng.ICompileService;
|
|
||||||
$rootScope: ng.IRootScopeService;
|
|
||||||
$timeout: ng.ITimeoutService;
|
|
||||||
applications: WebApplication[];
|
|
||||||
changeObservers: AppManagerChangeCallback[];
|
|
||||||
activeApplication?: WebApplication;
|
|
||||||
constructor($compile: ng.ICompileService, $rootScope: ng.IRootScopeService, $timeout: ng.ITimeoutService);
|
|
||||||
private createDefaultApplication;
|
|
||||||
/** @callback */
|
|
||||||
onApplicationDeinit(application: WebApplication): void;
|
|
||||||
private createNewApplication;
|
|
||||||
get application(): WebApplication | undefined;
|
|
||||||
getApplications(): WebApplication[];
|
|
||||||
/**
|
|
||||||
* Notifies observer when the active application has changed.
|
|
||||||
* Any application which is no longer active is destroyed, and
|
|
||||||
* must be removed from the interface.
|
|
||||||
*/
|
|
||||||
addApplicationChangeObserver(callback: AppManagerChangeCallback): void;
|
|
||||||
private notifyObserversOfAppChange;
|
|
||||||
}
|
|
||||||
export {};
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
import { WebApplication } from './../../application';
|
|
||||||
import { ApplicationEvent } from 'snjs';
|
|
||||||
export declare type CtrlState = Partial<Record<string, any>>;
|
|
||||||
export declare type CtrlProps = Partial<Record<string, any>>;
|
|
||||||
export declare class PureCtrl {
|
|
||||||
$timeout: ng.ITimeoutService;
|
|
||||||
/** Passed through templates */
|
|
||||||
application?: WebApplication;
|
|
||||||
props: CtrlProps;
|
|
||||||
state: CtrlState;
|
|
||||||
private unsubApp;
|
|
||||||
private unsubState;
|
|
||||||
private stateTimeout;
|
|
||||||
constructor($timeout: ng.ITimeoutService);
|
|
||||||
$onInit(): void;
|
|
||||||
deinit(): void;
|
|
||||||
$onDestroy(): void;
|
|
||||||
get appState(): import("../../services/state").AppState;
|
|
||||||
/** @private */
|
|
||||||
resetState(): Promise<void>;
|
|
||||||
/** @override */
|
|
||||||
getInitialState(): {};
|
|
||||||
setState(state: CtrlState): Promise<unknown>;
|
|
||||||
updateUI(func: () => void): Promise<void>;
|
|
||||||
initProps(props: CtrlProps): void;
|
|
||||||
addAppStateObserver(): void;
|
|
||||||
onAppStateEvent(eventName: any, data: any): void;
|
|
||||||
addAppEventObserver(): void;
|
|
||||||
onAppEvent(eventName: ApplicationEvent): void;
|
|
||||||
/** @override */
|
|
||||||
onAppStart(): Promise<void>;
|
|
||||||
onAppLaunch(): Promise<void>;
|
|
||||||
onAppKeyChange(): Promise<void>;
|
|
||||||
onAppSync(): void;
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../types';
|
|
||||||
export declare class ApplicationView extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
export declare const PANEL_NAME_NOTES = "notes";
|
|
||||||
export declare const PANEL_NAME_TAGS = "tags";
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
/// <reference types="pug" />
|
|
||||||
export class EditorPanel {
|
|
||||||
restrict: string;
|
|
||||||
scope: {};
|
|
||||||
template: import("pug").compileTemplate;
|
|
||||||
replace: boolean;
|
|
||||||
controller: typeof EditorCtrl;
|
|
||||||
controllerAs: string;
|
|
||||||
bindToController: boolean;
|
|
||||||
}
|
|
||||||
declare class EditorCtrl {
|
|
||||||
constructor($timeout: any, $rootScope: any, alertManager: any, appState: any, authManager: any, actionsManager: any, componentManager: any, desktopManager: any, keyboardManager: any, modelManager: any, preferencesManager: any, privilegesManager: any, sessionHistory: any, syncManager: any);
|
|
||||||
$rootScope: any;
|
|
||||||
alertManager: any;
|
|
||||||
appState: any;
|
|
||||||
actionsManager: any;
|
|
||||||
authManager: any;
|
|
||||||
componentManager: any;
|
|
||||||
desktopManager: any;
|
|
||||||
keyboardManager: any;
|
|
||||||
modelManager: any;
|
|
||||||
preferencesManager: any;
|
|
||||||
privilegesManager: any;
|
|
||||||
syncManager: any;
|
|
||||||
state: {
|
|
||||||
componentStack: never[];
|
|
||||||
editorDebounce: number;
|
|
||||||
isDesktop: any;
|
|
||||||
spellcheck: boolean;
|
|
||||||
mutable: {
|
|
||||||
tagsString: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
leftResizeControl: {};
|
|
||||||
rightResizeControl: {};
|
|
||||||
/** Used by .pug template */
|
|
||||||
prefKeyMonospace: any;
|
|
||||||
prefKeySpellcheck: any;
|
|
||||||
prefKeyMarginResizers: any;
|
|
||||||
addAppStateObserver(): void;
|
|
||||||
handleNoteSelectionChange(note: any, previousNote: any): Promise<void>;
|
|
||||||
addMappingObservers(): void;
|
|
||||||
addSyncEventHandler(): void;
|
|
||||||
addSyncStatusObserver(): void;
|
|
||||||
syncStatusObserver: any;
|
|
||||||
editorForNote(note: any): any;
|
|
||||||
setMenuState(menu: any, state: any): void;
|
|
||||||
toggleMenu(menu: any): void;
|
|
||||||
closeAllMenus({ exclude }?: {
|
|
||||||
exclude: any;
|
|
||||||
}): void;
|
|
||||||
editorMenuOnSelect: (component: any) => void;
|
|
||||||
hasAvailableExtensions(): boolean;
|
|
||||||
performFirefoxPinnedTabFix(): void;
|
|
||||||
saveNote({ bypassDebouncer, updateClientModified, dontUpdatePreviews }: {
|
|
||||||
bypassDebouncer: any;
|
|
||||||
updateClientModified: any;
|
|
||||||
dontUpdatePreviews: any;
|
|
||||||
}): void;
|
|
||||||
saveTimeout: any;
|
|
||||||
didShowErrorAlert: boolean | undefined;
|
|
||||||
showSavingStatus(): void;
|
|
||||||
showAllChangesSavedStatus(): void;
|
|
||||||
showErrorStatus(error: any): void;
|
|
||||||
setStatus(status: any, wait?: boolean): void;
|
|
||||||
statusTimeout: any;
|
|
||||||
contentChanged(): void;
|
|
||||||
onTitleEnter($event: any): void;
|
|
||||||
onTitleChange(): void;
|
|
||||||
focusEditor(): void;
|
|
||||||
lastEditorFocusEventSource: any;
|
|
||||||
focusTitle(): void;
|
|
||||||
clickedTextArea(): void;
|
|
||||||
onNameFocus(): void;
|
|
||||||
editingName: boolean | undefined;
|
|
||||||
onContentFocus(): void;
|
|
||||||
onNameBlur(): void;
|
|
||||||
selectedMenuItem(hide: any): void;
|
|
||||||
deleteNote(permanently: any): Promise<void>;
|
|
||||||
performNoteDeletion(note: any): void;
|
|
||||||
restoreTrashedNote(): void;
|
|
||||||
deleteNotePermanantely(): void;
|
|
||||||
getTrashCount(): any;
|
|
||||||
emptyTrash(): void;
|
|
||||||
togglePin(): void;
|
|
||||||
toggleLockNote(): void;
|
|
||||||
toggleProtectNote(): void;
|
|
||||||
toggleNotePreview(): void;
|
|
||||||
toggleArchiveNote(): void;
|
|
||||||
reloadTagsString(): void;
|
|
||||||
addTag(tag: any): void;
|
|
||||||
removeTag(tag: any): void;
|
|
||||||
saveTags({ strings }?: {
|
|
||||||
strings: any;
|
|
||||||
}): void;
|
|
||||||
onPanelResizeFinish: (width: any, left: any, isMaxWidth: any) => void;
|
|
||||||
loadPreferences(): void;
|
|
||||||
reloadFont(): void;
|
|
||||||
toggleKey(key: any): Promise<void>;
|
|
||||||
/** @components */
|
|
||||||
onEditorLoad: (editor: any) => void;
|
|
||||||
registerComponentHandler(): void;
|
|
||||||
reloadComponentStackArray(): void;
|
|
||||||
reloadComponentContext(): void;
|
|
||||||
toggleStackComponentForCurrentItem(component: any): void;
|
|
||||||
disassociateComponentWithCurrentNote(component: any): void;
|
|
||||||
associateComponentWithCurrentNote(component: any): void;
|
|
||||||
registerKeyboardShortcuts(): void;
|
|
||||||
altKeyObserver: any;
|
|
||||||
trashKeyObserver: any;
|
|
||||||
deleteKeyObserver: any;
|
|
||||||
onSystemEditorLoad(): void;
|
|
||||||
loadedTabListener: boolean | undefined;
|
|
||||||
tabObserver: any;
|
|
||||||
}
|
|
||||||
export {};
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../types';
|
|
||||||
export declare class Footer extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
export { PureCtrl } from './abstract/pure_ctrl';
|
|
||||||
export { EditorPanel } from './editor';
|
|
||||||
export { Footer } from './footer';
|
|
||||||
export { NotesPanel } from './notes/notes';
|
|
||||||
export { TagsPanel } from './tags';
|
|
||||||
export { Root } from './root';
|
|
||||||
export { ApplicationView } from './applicationView';
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import { SNNote, SNTag } from 'snjs';
|
|
||||||
export declare enum NoteSortKey {
|
|
||||||
CreatedAt = "created_at",
|
|
||||||
UpdatedAt = "updated_at",
|
|
||||||
ClientUpdatedAt = "client_updated_at",
|
|
||||||
Title = "title"
|
|
||||||
}
|
|
||||||
export declare function filterAndSortNotes(notes: SNNote[], selectedTag: SNTag, showArchived: boolean, hidePinned: boolean, filterText: string, sortBy: string, reverse: boolean): SNNote[];
|
|
||||||
export declare function filterNotes(notes: SNNote[], selectedTag: SNTag, showArchived: boolean, hidePinned: boolean, filterText: string): SNNote[];
|
|
||||||
export declare function sortNotes(notes: SNNote[] | undefined, sortBy: string, reverse: boolean): SNNote[];
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../../types';
|
|
||||||
export declare class NotesPanel extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../types';
|
|
||||||
export declare class Root extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../types';
|
|
||||||
export declare class TagsPanel extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
29
dist/@types/app/assets/javascripts/database.d.ts
vendored
29
dist/@types/app/assets/javascripts/database.d.ts
vendored
@@ -1,29 +0,0 @@
|
|||||||
import { SNAlertService } from "snjs/dist/@types";
|
|
||||||
export declare class Database {
|
|
||||||
databaseName: string;
|
|
||||||
private alertService;
|
|
||||||
private locked;
|
|
||||||
private db?;
|
|
||||||
constructor(databaseName: string, alertService: SNAlertService);
|
|
||||||
deinit(): void;
|
|
||||||
/**
|
|
||||||
* Relinquishes the lock and allows db operations to proceed
|
|
||||||
*/
|
|
||||||
unlock(): void;
|
|
||||||
/**
|
|
||||||
* Opens the database natively, or returns the existing database object if already opened.
|
|
||||||
* @param onNewDatabase - Callback to invoke when a database has been created
|
|
||||||
* as part of the open process. This can happen on new application sessions, or if the
|
|
||||||
* browser deleted the database without the user being aware.
|
|
||||||
*/
|
|
||||||
openDatabase(onNewDatabase?: () => void): Promise<IDBDatabase | undefined>;
|
|
||||||
getAllPayloads(): Promise<any[]>;
|
|
||||||
savePayload(payload: any): Promise<void>;
|
|
||||||
savePayloads(payloads: any[]): Promise<void>;
|
|
||||||
private putItems;
|
|
||||||
deletePayload(uuid: string): Promise<void>;
|
|
||||||
clearAllPayloads(): Promise<void>;
|
|
||||||
private showAlert;
|
|
||||||
private showGenericError;
|
|
||||||
private displayOfflineAlert;
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
export declare function autofocus($timeout: ng.ITimeoutService): {
|
|
||||||
restrict: string;
|
|
||||||
scope: {
|
|
||||||
shouldFocus: string;
|
|
||||||
};
|
|
||||||
link: ($scope: ng.IScope, $element: JQLite) => void;
|
|
||||||
};
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
export declare function clickOutside($document: ng.IDocumentService): {
|
|
||||||
restrict: string;
|
|
||||||
replace: boolean;
|
|
||||||
link($scope: ng.IScope, $element: JQLite, attrs: any): void;
|
|
||||||
};
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
export declare function delayHide($timeout: ng.ITimeoutService): {
|
|
||||||
restrict: string;
|
|
||||||
scope: {
|
|
||||||
show: string;
|
|
||||||
delay: string;
|
|
||||||
};
|
|
||||||
link: (scope: ng.IScope, elem: JQLite) => void;
|
|
||||||
};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
export declare function elemReady($parse: ng.IParseService): {
|
|
||||||
restrict: string;
|
|
||||||
link: ($scope: ng.IScope, elem: JQLite, attrs: any) => void;
|
|
||||||
};
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
export declare function fileChange(): {
|
|
||||||
restrict: string;
|
|
||||||
scope: {
|
|
||||||
handler: string;
|
|
||||||
};
|
|
||||||
link: (scope: ng.IScope, element: JQLite) => void;
|
|
||||||
};
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
export { autofocus } from './autofocus';
|
|
||||||
export { clickOutside } from './click-outside';
|
|
||||||
export { delayHide } from './delay-hide';
|
|
||||||
export { elemReady } from './elemReady';
|
|
||||||
export { fileChange } from './file-change';
|
|
||||||
export { infiniteScroll } from './infiniteScroll';
|
|
||||||
export { lowercase } from './lowercase';
|
|
||||||
export { selectOnFocus } from './selectOnFocus';
|
|
||||||
export { snEnter } from './snEnter';
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
export declare function infiniteScroll(): {
|
|
||||||
link: (scope: ng.IScope, elem: JQLite, attrs: any) => void;
|
|
||||||
};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
export declare function lowercase(): {
|
|
||||||
require: string;
|
|
||||||
link: (scope: ng.IScope, _: JQLite, attrs: any, ctrl: any) => void;
|
|
||||||
};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
export declare function selectOnClick($window: ng.IWindowService): {
|
|
||||||
restrict: string;
|
|
||||||
link: (scope: import("angular").IScope, element: JQLite) => void;
|
|
||||||
};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
export declare function selectOnFocus($window: ng.IWindowService): {
|
|
||||||
restrict: string;
|
|
||||||
link: (scope: ng.IScope, element: JQLite) => void;
|
|
||||||
};
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
export declare function snEnter(): (scope: ng.IScope, element: JQLite, attrs: any) => void;
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../../types';
|
|
||||||
export declare class AccountMenu extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../../types';
|
|
||||||
export declare class ActionsMenu extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../../types';
|
|
||||||
export declare class ChallengeModal extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
import { WebApplication } from '@/ui_models/application';
|
|
||||||
import { SNComponent, LiveItem } from 'snjs';
|
|
||||||
import { WebDirective } from './../../types';
|
|
||||||
export declare type ComponentModalScope = {
|
|
||||||
componentUuid: string;
|
|
||||||
onDismiss: () => void;
|
|
||||||
application: WebApplication;
|
|
||||||
};
|
|
||||||
export declare class ComponentModalCtrl implements ComponentModalScope {
|
|
||||||
$element: JQLite;
|
|
||||||
componentUuid: string;
|
|
||||||
onDismiss: () => void;
|
|
||||||
application: WebApplication;
|
|
||||||
liveComponent: LiveItem<SNComponent>;
|
|
||||||
component: SNComponent;
|
|
||||||
constructor($element: JQLite);
|
|
||||||
$onInit(): void;
|
|
||||||
$onDestroy(): void;
|
|
||||||
dismiss(): void;
|
|
||||||
}
|
|
||||||
export declare class ComponentModal extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../../types';
|
|
||||||
export declare class ComponentView extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../../types';
|
|
||||||
export declare class EditorMenu extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from '../../types';
|
|
||||||
export declare class HistoryMenu extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
export { AccountMenu } from './accountMenu';
|
|
||||||
export { ActionsMenu } from './actionsMenu';
|
|
||||||
export { ComponentModal } from './componentModal';
|
|
||||||
export { ComponentView } from './componentView';
|
|
||||||
export { EditorMenu } from './editorMenu';
|
|
||||||
export { InputModal } from './inputModal';
|
|
||||||
export { MenuRow } from './menuRow';
|
|
||||||
export { PanelResizer } from './panelResizer';
|
|
||||||
export { PasswordWizard } from './passwordWizard';
|
|
||||||
export { PermissionsModal } from './permissionsModal';
|
|
||||||
export { PrivilegesAuthModal } from './privilegesAuthModal';
|
|
||||||
export { PrivilegesManagementModal } from './privilegesManagementModal';
|
|
||||||
export { RevisionPreviewModal } from './revisionPreviewModal';
|
|
||||||
export { HistoryMenu } from './historyMenu';
|
|
||||||
export { SyncResolutionMenu } from './syncResolutionMenu';
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
import { WebDirective } from './../../types';
|
|
||||||
export interface InputModalScope extends Partial<ng.IScope> {
|
|
||||||
type: string;
|
|
||||||
title: string;
|
|
||||||
message: string;
|
|
||||||
callback: (value: string) => void;
|
|
||||||
}
|
|
||||||
export declare class InputModal extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../../types';
|
|
||||||
export declare class MenuRow extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../../types';
|
|
||||||
export declare class PanelResizer extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../../types';
|
|
||||||
export declare class PasswordWizard extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../../types';
|
|
||||||
export declare class PermissionsModal extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../../types';
|
|
||||||
export declare class PrivilegesAuthModal extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../../types';
|
|
||||||
export declare class PrivilegesManagementModal extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../../types';
|
|
||||||
export declare class RevisionPreviewModal extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../../types';
|
|
||||||
export declare class SessionHistoryMenu extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import { WebDirective } from './../../types';
|
|
||||||
export declare class SyncResolutionMenu extends WebDirective {
|
|
||||||
constructor();
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export { trusted } from './trusted';
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
export declare function trusted($sce: ng.ISCEService): (url: string) => any;
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import 'sn-stylekit/dist/stylekit.css';
|
|
||||||
import '../stylesheets/index.css.scss';
|
|
||||||
import 'angular';
|
|
||||||
import '../../../vendor/assets/javascripts/angular-sanitize';
|
|
||||||
import '../../../vendor/assets/javascripts/zip/deflate';
|
|
||||||
import '../../../vendor/assets/javascripts/zip/inflate';
|
|
||||||
import '../../../vendor/assets/javascripts/zip/zip';
|
|
||||||
import '../../../vendor/assets/javascripts/zip/z-worker';
|
|
||||||
import './app';
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
import { DeviceInterface, SNApplication } from 'snjs';
|
|
||||||
import { Platform } from './services/platform';
|
|
||||||
export declare class WebDeviceInterface extends DeviceInterface {
|
|
||||||
private platform;
|
|
||||||
private database;
|
|
||||||
constructor(namespace: string, timeout: any, platform: Platform);
|
|
||||||
setApplication(application: SNApplication): void;
|
|
||||||
deinit(): void;
|
|
||||||
getRawStorageValue(key: string): Promise<string | null>;
|
|
||||||
getAllRawStorageKeyValues(): Promise<{
|
|
||||||
key: string;
|
|
||||||
value: any;
|
|
||||||
}[]>;
|
|
||||||
setRawStorageValue(key: string, value: any): Promise<void>;
|
|
||||||
removeRawStorageValue(key: string): Promise<void>;
|
|
||||||
removeAllRawStorageValues(): Promise<void>;
|
|
||||||
openDatabase(): Promise<{
|
|
||||||
isNewDatabase?: boolean | undefined;
|
|
||||||
} | undefined>;
|
|
||||||
private getDatabaseKeyPrefix;
|
|
||||||
private keyForPayloadId;
|
|
||||||
getAllRawDatabasePayloads(): Promise<any[]>;
|
|
||||||
saveRawDatabasePayload(payload: any): Promise<void>;
|
|
||||||
saveRawDatabasePayloads(payloads: any[]): Promise<void>;
|
|
||||||
removeRawDatabasePayloadWithId(id: string): Promise<void>;
|
|
||||||
removeAllRawDatabasePayloads(): Promise<void>;
|
|
||||||
getKeychainValue(): Promise<unknown>;
|
|
||||||
setKeychainValue(value: any): Promise<void>;
|
|
||||||
clearKeychainValue(): Promise<void>;
|
|
||||||
openUrl(url: string): void;
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
export declare enum RootScopeMessages {
|
|
||||||
ReloadExtendedData = "reload-ext-data",
|
|
||||||
NewUpdateAvailable = "new-update-available"
|
|
||||||
}
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/// <reference types="angular" />
|
|
||||||
export declare function configRoutes($locationProvider: ng.ILocationProvider): void;
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import { SNAlertService, ButtonType } from 'snjs';
|
|
||||||
/** @returns a promise resolving to true if the user confirmed, false if they canceled */
|
|
||||||
export declare function confirmDialog({ text, title, confirmButtonText, cancelButtonText, confirmButtonStyle, }: {
|
|
||||||
text: string;
|
|
||||||
title?: string;
|
|
||||||
confirmButtonText?: string;
|
|
||||||
cancelButtonText?: string;
|
|
||||||
confirmButtonStyle?: 'danger' | 'info';
|
|
||||||
}): Promise<boolean>;
|
|
||||||
export declare function alertDialog({ title, text, closeButtonText, }: {
|
|
||||||
title?: string;
|
|
||||||
text: string;
|
|
||||||
closeButtonText?: string;
|
|
||||||
}): Promise<void>;
|
|
||||||
export declare class AlertService implements SNAlertService {
|
|
||||||
/**
|
|
||||||
* @deprecated use the standalone `alertDialog` function instead
|
|
||||||
*/
|
|
||||||
alert(text: string, title?: string, closeButtonText?: string): Promise<void>;
|
|
||||||
confirm(text: string, title?: string, confirmButtonText?: string, confirmButtonType?: ButtonType, cancelButtonText?: string): Promise<boolean>;
|
|
||||||
blockingDialog(text: string, title?: string): () => void;
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import { WebApplication } from '@/ui_models/application';
|
|
||||||
export declare class ArchiveManager {
|
|
||||||
private readonly application;
|
|
||||||
private textFile?;
|
|
||||||
constructor(application: WebApplication);
|
|
||||||
downloadBackup(encrypted: boolean): Promise<void>;
|
|
||||||
private formattedDate;
|
|
||||||
private itemsData;
|
|
||||||
private get zip();
|
|
||||||
private loadZip;
|
|
||||||
private downloadZippedItems;
|
|
||||||
private hrefForData;
|
|
||||||
private downloadData;
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
import { ApplicationService } from 'snjs';
|
|
||||||
export declare class AutolockService extends ApplicationService {
|
|
||||||
private unsubState?;
|
|
||||||
private pollFocusInterval;
|
|
||||||
private lastFocusState?;
|
|
||||||
private lockAfterDate?;
|
|
||||||
private lockTimeout?;
|
|
||||||
onAppLaunch(): Promise<void>;
|
|
||||||
observeVisibility(): void;
|
|
||||||
deinit(): void;
|
|
||||||
private lockApplication;
|
|
||||||
setAutoLockInterval(interval: number): Promise<void>;
|
|
||||||
getAutoLockInterval(): Promise<any>;
|
|
||||||
deleteAutolockPreference(): Promise<void>;
|
|
||||||
/**
|
|
||||||
* Verify document is in focus every so often as visibilitychange event is
|
|
||||||
* not triggered on a typical window blur event but rather on tab changes.
|
|
||||||
*/
|
|
||||||
beginWebFocusPolling(): void;
|
|
||||||
getAutoLockIntervalOptions(): {
|
|
||||||
value: number;
|
|
||||||
label: string;
|
|
||||||
}[];
|
|
||||||
documentVisibilityChanged(visible: boolean): Promise<void>;
|
|
||||||
beginAutoLockTimer(): Promise<void>;
|
|
||||||
cancelAutoLockTimer(): void;
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
import { PurePayload, Environment } from "snjs";
|
|
||||||
/** Platform-specific (i-e Electron/browser) behavior is handled by a Bridge object. */
|
|
||||||
export interface Bridge {
|
|
||||||
environment: Environment;
|
|
||||||
getKeychainValue(): Promise<unknown>;
|
|
||||||
setKeychainValue(value: any): Promise<void>;
|
|
||||||
clearKeychainValue(): Promise<void>;
|
|
||||||
extensionsServerHost?: string;
|
|
||||||
syncComponents(payloads: PurePayload[]): void;
|
|
||||||
onMajorDataChange(): void;
|
|
||||||
onInitialDataLoad(): void;
|
|
||||||
onSearch(text?: string): void;
|
|
||||||
downloadBackup(): void;
|
|
||||||
}
|
|
||||||
export declare class BrowserBridge implements Bridge {
|
|
||||||
environment: Environment;
|
|
||||||
getKeychainValue(): Promise<unknown>;
|
|
||||||
setKeychainValue(value: any): Promise<void>;
|
|
||||||
clearKeychainValue(): Promise<void>;
|
|
||||||
/** No-ops */
|
|
||||||
syncComponents(): void;
|
|
||||||
onMajorDataChange(): void;
|
|
||||||
onInitialDataLoad(): void;
|
|
||||||
onSearch(): void;
|
|
||||||
downloadBackup(): void;
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user