Merge branch 'release/3.5.9'

This commit is contained in:
Baptiste Grob
2020-11-23 17:15:07 +01:00
145 changed files with 299 additions and 1788 deletions

1
.gitignore vendored
View File

@@ -41,3 +41,4 @@ dump.rdb
/dist/javascripts
/dist/stylesheets
/dist/fonts
/dist/@types

View File

@@ -3,7 +3,7 @@
declare const __VERSION__: string;
declare const __WEB__: boolean;
import { SNLog } from 'snjs';
import { SNLog } from '@standardnotes/snjs';
import angular from 'angular';
import { configRoutes } from './routes';
@@ -53,19 +53,16 @@ import {
import { trusted } from './filters';
import { isDev } from './utils';
import { Bridge, BrowserBridge } from './services/bridge';
import { BrowserBridge } from './services/browserBridge';
import { startErrorReporting } from './services/errorReporting';
import { alertDialog } from './services/alertService';
import { StartApplication } from './startApplication';
import { Bridge } from './services/bridge';
if (__WEB__) {
startApplication((window as any)._default_sync_server, new BrowserBridge());
} else {
(window as any).startApplication = startApplication;
}
async function startApplication(defaultSyncServerHost: string, bridge: Bridge) {
notifyBetaPeriodEnd();
const startApplication: StartApplication = async function startApplication(
defaultSyncServerHost: string,
bridge: Bridge
) {
SNLog.onLog = console.log;
startErrorReporting();
@@ -77,7 +74,7 @@ async function startApplication(defaultSyncServerHost: string, bridge: Bridge) {
.config(configRoutes)
.constant('bridge', bridge)
.constant('defaultSyncServerHost', defaultSyncServerHost)
.constant('appVersion', __VERSION__);
.constant('appVersion', bridge.appVersion);
// Controllers
angular
@@ -149,17 +146,10 @@ async function startApplication(defaultSyncServerHost: string, bridge: Bridge) {
angular.element(document).ready(() => {
angular.bootstrap(document, ['app']);
});
}
};
function notifyBetaPeriodEnd() {
if (window.location.hostname === 'app-beta.standardnotes.org') {
alertDialog({
title: 'Beta period has ended',
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.',
});
}
if (__WEB__) {
startApplication((window as any)._default_sync_server, new BrowserBridge(__VERSION__));
} else {
(window as any).startApplication = startApplication;
}

View File

@@ -1,4 +1,4 @@
import { SNAlertService } from "snjs/dist/@types";
import { SNAlertService } from "@standardnotes/snjs";
const STORE_NAME = 'items';
const READ_WRITE = 'readwrite';
@@ -216,4 +216,4 @@ export class Database {
"Please close any other app instances and reload the page.";
this.alertService!.alert(message);
}
}
}

View File

@@ -1,7 +1,7 @@
import { WebDirective } from './../../types';
import { isDesktopApplication, preventRefreshing } from '@/utils';
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 {
STRING_ACCOUNT_MENU_UNCHECK_MERGE,
@@ -22,9 +22,8 @@ import {
STRING_CONFIRM_APP_QUIT_DURING_PASSCODE_REMOVAL,
STRING_UNSUPPORTED_BACKUP_FILE_VERSION
} from '@/strings';
import { SyncOpStatus } from 'snjs/dist/@types/services/sync/sync_op_status';
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 { autorun, IReactionDisposer } from 'mobx';
import { storage, StorageKey } from '@/services/localStorage';
@@ -67,15 +66,18 @@ type AccountMenuState = {
selectedAutoLockInterval: any;
showBetaWarning: boolean;
errorReportingEnabled: boolean;
syncInProgress: boolean;
syncError: string;
syncPercentage: string;
}
class AccountMenuCtrl extends PureViewCtrl<{}, AccountMenuState> {
public appVersion: string
/** @template */
syncStatus?: SyncOpStatus
private closeFunction?: () => void
private removeBetaWarningListener?: IReactionDisposer
private removeSyncObserver?: IReactionDisposer
/* @ngInject */
constructor(
@@ -130,7 +132,14 @@ class AccountMenuCtrl extends PureViewCtrl<{}, AccountMenuState> {
$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.setState({
showBetaWarning: this.appState.showBetaWarning
@@ -139,6 +148,7 @@ class AccountMenuCtrl extends PureViewCtrl<{}, AccountMenuState> {
}
deinit() {
this.removeSyncObserver?.();
this.removeBetaWarningListener?.();
super.deinit();
}

View File

@@ -2,9 +2,9 @@ import { WebApplication } from '@/ui_models/application';
import { WebDirective } from './../../types';
import template from '%/directives/actions-menu.pug';
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
import { SNItem, Action, SNActionsExtension, UuidString } from 'snjs/dist/@types';
import { ActionResponse } from 'snjs';
import { ActionsExtensionMutator } from 'snjs/dist/@types/models/app/extension';
import { SNItem, Action, SNActionsExtension, UuidString } from '@standardnotes/snjs';
import { ActionResponse } from '@standardnotes/snjs';
import { ActionsExtensionMutator } from '@standardnotes/snjs';
import { autorun, IReactionDisposer } from 'mobx';
type ActionsMenuScope = {

View File

@@ -1,5 +1,5 @@
import { WebApplication } from '@/ui_models/application';
import { SNComponent, LiveItem } from 'snjs';
import { SNComponent, LiveItem } from '@standardnotes/snjs';
import { WebDirective } from './../../types';
import template from '%/directives/component-modal.pug';

View File

@@ -1,6 +1,6 @@
import { RootScopeMessages } from './../../messages';
import { WebApplication } from '@/ui_models/application';
import { SNComponent, ComponentAction, LiveItem } from 'snjs';
import { SNComponent, ComponentAction, LiveItem } from '@standardnotes/snjs';
import { WebDirective } from './../../types';
import template from '%/directives/component-view.pug';
import { isDesktopApplication } from '../../utils';

View File

@@ -1,10 +1,10 @@
import { WebDirective } from './../../types';
import { WebApplication } from '@/ui_models/application';
import { SNComponent, SNItem, ComponentArea } from 'snjs';
import { SNComponent, SNItem, ComponentArea } from '@standardnotes/snjs';
import { isDesktopApplication } from '@/utils';
import template from '%/directives/editor-menu.pug';
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
import { ComponentMutator } from 'snjs/dist/@types/models';
import { ComponentMutator } from '@standardnotes/snjs';
interface EditorMenuScope {
callback: (component: SNComponent) => void

View File

@@ -1,10 +1,10 @@
import { WebDirective } from '../../types';
import { WebApplication } from '@/ui_models/application';
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 { ItemSessionHistory } from 'snjs/dist/@types/services/history/session/item_session_history';
import { RevisionListEntry, SingleRevision } from 'snjs/dist/@types/services/api/responses';
import { ItemSessionHistory } from '@standardnotes/snjs';
import { RevisionListEntry, SingleRevision } from '@standardnotes/snjs';
import { confirmDialog } from '@/services/alertService';
type HistoryState = {

View File

@@ -1,6 +1,6 @@
import { WebDirective } from './../../types';
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';
type PrivilegesAuthModalScope = {

View File

@@ -1,9 +1,9 @@
import { WebDirective } from './../../types';
import { WebApplication } from '@/ui_models/application';
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 { PrivilegeMutator } from 'snjs/dist/@types/models';
import { PrivilegeMutator } from '@standardnotes/snjs';
type DisplayInfo = {
label: string

View File

@@ -7,9 +7,9 @@ import {
SNComponent,
SNNote,
ComponentArea
} from 'snjs';
} from '@standardnotes/snjs';
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';
interface RevisionPreviewScope {

View File

@@ -1,5 +1,5 @@
/* eslint-disable prefer-promise-reject-errors */
import { SNAlertService, ButtonType } from 'snjs';
import { SNAlertService, ButtonType } from '@standardnotes/snjs';
import { SKAlert } from 'sn-stylekit';
/** @returns a promise resolving to true if the user confirmed, false if they canceled */

View File

@@ -1,5 +1,5 @@
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 {
const sanitizedName = name
@@ -111,7 +111,7 @@ export class ArchiveManager {
);
zipWriter.add(fileName, new this.zip.BlobReader(blob), resolve);
});
let index = 0;
const nextFile = () => {
const item = items[index];

View File

@@ -1,4 +1,4 @@
import { ApplicationService } from 'snjs';
import { ApplicationService } from '@standardnotes/snjs';
import { WebApplication } from '@/ui_models/application';
import { isDesktopApplication } from '@/utils';
import { AppStateEvent } from '@/ui_models/app_state';

View File

@@ -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. */
export interface Bridge {
environment: Environment,
readonly appVersion: string;
environment: Environment;
getKeychainValue(): Promise<unknown>;
setKeychainValue(value: any): Promise<void>;
clearKeychainValue(): Promise<void>;
extensionsServerHost?: string;
syncComponents(payloads: PurePayload[]): void;
syncComponents(payloads: unknown[]): void;
onMajorDataChange(): void;
onInitialDataLoad(): void;
onSearch(text?: string): 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() {
}
}

View 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() {}
}

View File

@@ -1,9 +1,9 @@
import { SNComponent, PurePayload, ComponentMutator, AppDataField, ContentType } from 'snjs';
import { SNComponent, PurePayload, ComponentMutator, AppDataField, ContentType } from '@standardnotes/snjs';
/* eslint-disable camelcase */
import { WebApplication } from '@/ui_models/application';
// An interface used by the Desktop app to interact with SN
import { isDesktopApplication } from '@/utils';
import { EncryptionIntent, ApplicationService, ApplicationEvent, removeFromArray } from 'snjs';
import { EncryptionIntent, ApplicationService, ApplicationEvent, removeFromArray } from '@standardnotes/snjs';
import { Bridge } from './bridge';
type UpdateObserverCallback = (component: SNComponent) => void

View File

@@ -1,4 +1,4 @@
import { SNLog } from 'snjs';
import { SNLog } from '@standardnotes/snjs';
import { isDesktopApplication, isDev } from '@/utils';
import { storage, StorageKey } from './localStorage';
import Bugsnag from '@bugsnag/js';

View File

@@ -1,4 +1,4 @@
import { removeFromArray } from 'snjs';
import { removeFromArray } from '@standardnotes/snjs';
export enum KeyboardKey {
Tab = "Tab",
Backspace = "Backspace",

View File

@@ -9,9 +9,9 @@ import {
ComponentMutator,
Copy,
dictToArray
} from 'snjs';
import { PayloadContent } from 'snjs/dist/@types/protocol/payloads/generator';
import { ComponentPermission } from 'snjs/dist/@types/models/app/component';
} from '@standardnotes/snjs';
import { PayloadContent } from '@standardnotes/snjs';
import { ComponentPermission } from '@standardnotes/snjs';
/** A class for handling installation of system extensions */
export class NativeExtManager extends ApplicationService {

View File

@@ -8,7 +8,7 @@ import {
UserPrefsMutator,
FillItemContent,
ApplicationEvent,
} from 'snjs';
} from '@standardnotes/snjs';
export class PreferencesManager extends ApplicationService {
private userPreferences!: SNUserPrefs;

View File

@@ -1,4 +1,4 @@
import { removeFromArray } from 'snjs';
import { removeFromArray } from '@standardnotes/snjs';
type StatusCallback = (string: string) => void;

View File

@@ -6,7 +6,7 @@ import {
SNTheme,
removeFromArray,
ApplicationEvent, ContentType
} from 'snjs';
} from '@standardnotes/snjs';
const CACHED_THEMES_KEY = 'cachedThemes';

View File

@@ -0,0 +1,6 @@
import { Bridge } from "./services/bridge";
export type StartApplication = (
defaultSyncServerHost: string,
bridge: Bridge
) => Promise<void>;

View File

@@ -4,11 +4,11 @@
"module": "commonjs",
"moduleResolution": "node",
"allowJs": true,
"noEmit": true,
"strict": true,
"isolatedModules": true,
"esModuleInterop": true,
"declaration": true,
"emitDeclarationOnly": true,
"newLine": "lf",
"declarationDir": "../../../dist/@types",
"baseUrl": ".",

View File

@@ -1,4 +1,4 @@
import { SNComponent } from 'snjs';
import { SNComponent } from '@standardnotes/snjs';
export class WebDirective implements ng.IDirective {
controller?: string | ng.Injectable<ng.IControllerConstructor>;
controllerAs?: string;
@@ -42,4 +42,4 @@ export type PanelPuppet = {
export type FooterStatus = {
string: string
}
}

View File

@@ -10,11 +10,13 @@ import {
SNSmartTag,
PayloadSource,
DeinitSource,
UuidString
} from 'snjs';
UuidString,
SyncOpStatus
} from '@standardnotes/snjs';
import { WebApplication } from '@/ui_models/application';
import { Editor } from '@/ui_models/editor';
import { action, makeObservable, observable } from 'mobx';
import { Bridge } from '@/services/bridge';
export enum AppStateEvent {
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 {
$rootScope: ng.IRootScopeService;
$timeout: ng.ITimeoutService;
@@ -71,13 +106,15 @@ export class AppState {
userPreferences?: SNUserPrefs;
multiEditorEnabled = false;
showBetaWarning = false;
actionsMenu = new ActionsMenuState();
readonly actionsMenu = new ActionsMenuState();
readonly sync = new SyncState();
/* @ngInject */
constructor(
$rootScope: ng.IRootScopeService,
$timeout: ng.ITimeoutService,
application: WebApplication
application: WebApplication,
private bridge: Bridge,
) {
this.$timeout = $timeout;
this.$rootScope = $rootScope;
@@ -133,7 +170,7 @@ export class AppState {
}
private determineBetaWarningValue() {
if ((window as any).electronAppVersion?.includes('-beta')) {
if (this.bridge.appVersion.includes('-beta')) {
switch (localStorage.getItem(SHOW_BETA_WARNING_KEY)) {
case 'true':
default:
@@ -152,10 +189,20 @@ export class AppState {
*/
async createEditor(title?: string) {
const activeEditor = this.getActiveEditor();
const activeTagUuid = this.selectedTag
? this.selectedTag.isSmartTag()
? undefined
: this.selectedTag.uuid
: undefined;
if (!activeEditor || this.multiEditorEnabled) {
this.application.editorGroup.createEditor(undefined, title);
this.application.editorGroup.createEditor(
undefined,
title,
activeTagUuid
);
} else {
await activeEditor.reset(title);
await activeEditor.reset(title, activeTagUuid);
}
}
@@ -251,10 +298,16 @@ export class AppState {
addAppEventObserver() {
this.unsubApp = this.application.addEventObserver(async (eventName) => {
if (eventName === ApplicationEvent.Started) {
this.locked = true;
} else if (eventName === ApplicationEvent.Launched) {
this.locked = false;
switch (eventName) {
case ApplicationEvent.Started:
this.locked = true;
break;
case ApplicationEvent.Launched:
this.locked = false;
break;
case ApplicationEvent.SyncStatusChanged:
this.sync.update(this.application.getSyncStatus());
break;
}
});
}

View File

@@ -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 { AccountSwitcherScope, PermissionsModalScope } from './../types';
import { ComponentGroup } from './component_group';
@@ -10,7 +10,7 @@ import {
platformFromString,
Challenge,
ProtectedAction, SNComponent
} from 'snjs';
} from '@standardnotes/snjs';
import angular from 'angular';
import { getPlatformString } from '@/utils';
import { AlertService } from '@/services/alertService';
@@ -26,9 +26,9 @@ import {
KeyboardManager
} from '@/services';
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 { DeinitSource } from 'snjs/dist/@types/types';
import { DeinitSource } from '@standardnotes/snjs';
type WebServices = {
appState: AppState

View File

@@ -1,6 +1,6 @@
import { WebDeviceInterface } from '@/web_device_interface';
import { WebApplication } from './application';
import { ApplicationDescriptor, SNApplicationGroup, DeviceInterface } from 'snjs';
import { ApplicationDescriptor, SNApplicationGroup, DeviceInterface } from '@standardnotes/snjs';
import {
ArchiveManager,
DesktopManager,
@@ -63,7 +63,8 @@ export class ApplicationGroup extends SNApplicationGroup {
const appState = new AppState(
this.$rootScope,
this.$timeout,
application
application,
this.bridge,
);
const archiveService = new ArchiveManager(
application

View File

@@ -1,6 +1,6 @@
import { SNComponent, ComponentArea, removeFromArray, addIfUnique } from 'snjs';
import { SNComponent, ComponentArea, removeFromArray, addIfUnique } from '@standardnotes/snjs';
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 */
const SingleComponentAreas = [
@@ -99,4 +99,4 @@ export class ComponentGroup {
observer();
}
}
}
}

View File

@@ -1,4 +1,4 @@
import { SNNote, ContentType, PayloadSource } from 'snjs';
import { SNNote, ContentType, PayloadSource, UuidString, TagMutator } from '@standardnotes/snjs';
import { WebApplication } from './application';
export class Editor {
@@ -12,15 +12,16 @@ export class Editor {
constructor(
application: WebApplication,
noteUuid?: string,
noteTitle?: string
noteUuid: string | undefined,
noteTitle: string | undefined,
noteTag: UuidString | undefined
) {
this.application = application;
if (noteUuid) {
this.note = application.findItem(noteUuid) as SNNote;
this.streamItems();
} else {
this.reset(noteTitle)
this.reset(noteTitle, noteTag)
.then(() => this.streamItems())
.catch(console.error);
}
@@ -65,7 +66,10 @@ export class Editor {
* Reverts the editor to a blank state, removing any existing note from view,
* and creating a placeholder note.
*/
async reset(noteTitle = '') {
async reset(
noteTitle = '',
noteTag?: UuidString,
) {
const note = await this.application.createTemplateItem(
ContentType.Note,
{
@@ -74,6 +78,11 @@ export class Editor {
references: []
}
) as SNNote;
if (noteTag) {
await this.application.changeItem<TagMutator>(noteTag, (m) => {
m.addItemAsRelationship(note);
});
}
if (!this.isTemplateNote || this.note.title !== note.title) {
this.setNote(note as SNNote, true);
}

View File

@@ -1,4 +1,4 @@
import { removeFromArray } from 'snjs';
import { removeFromArray, UuidString } from '@standardnotes/snjs';
import { Editor } from './editor';
import { WebApplication } from './application';
@@ -21,8 +21,12 @@ export class EditorGroup {
}
}
createEditor(noteUuid?: string, noteTitle?: string) {
const editor = new Editor(this.application, noteUuid, noteTitle);
createEditor(
noteUuid?: string,
noteTitle?: string,
noteTag?: UuidString
) {
const editor = new Editor(this.application, noteUuid, noteTitle, noteTag);
this.editors.push(editor);
this.notifyObservers();
}
@@ -72,4 +76,4 @@ export class EditorGroup {
observer();
}
}
}
}

View File

@@ -1,4 +1,4 @@
import { ApplicationEvent } from 'snjs';
import { ApplicationEvent } from '@standardnotes/snjs';
import { WebApplication } from '@/ui_models/application';
export type CtrlState = Partial<Record<string, any>>

View File

@@ -3,7 +3,7 @@ import { WebApplication } from '@/ui_models/application';
import template from './account-switcher.pug';
import {
ApplicationDescriptor,
} from 'snjs';
} from '@standardnotes/snjs';
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
import { WebDirective } from '@/types';

View File

@@ -3,7 +3,7 @@ import { WebDirective } from '@/types';
import { getPlatformString } from '@/utils';
import template from './application-view.pug';
import { AppStateEvent } from '@/ui_models/app_state';
import { ApplicationEvent } from 'snjs';
import { ApplicationEvent } from '@standardnotes/snjs';
import {
PANEL_NAME_NOTES,
PANEL_NAME_TAGS

View File

@@ -6,7 +6,7 @@ import {
Challenge,
ChallengeReason,
ChallengePrompt
} from 'snjs';
} from '@standardnotes/snjs';
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
import { WebDirective } from '@/types';
import { confirmDialog } from '@/services/alertService';

View File

@@ -18,7 +18,7 @@ import {
ComponentAction,
WebPrefKey,
ComponentMutator,
} from 'snjs';
} from '@standardnotes/snjs';
import find from 'lodash/find';
import { isDesktopApplication } from '@/utils';
import { KeyboardModifier, KeyboardKey } from '@/services/keyboardManager';
@@ -593,7 +593,7 @@ class EditorViewCtrl extends PureViewCtrl<{}, EditorState> {
}
focusTitle() {
document.getElementById(ElementIds.NoteTitleEditor)!.focus();
document.getElementById(ElementIds.NoteTitleEditor)?.focus();
}
clickedTextArea() {

View File

@@ -2,4 +2,4 @@ editor-view(
ng-repeat='editor in self.editors'
application='self.application'
editor='editor'
)
)

View File

@@ -37,10 +37,8 @@
)
.sk-app-bar-item.border(ng-if="ctrl.state.showBetaWarning")
.sk-app-bar-item(ng-if="ctrl.state.showBetaWarning")
a.no-decoration.sk-label.title.uppercase(
href='https://github.com/standardnotes/forum/issues/1114',
rel='noopener',
target='_blank'
a.no-decoration.sk-label.title(
ng-click="ctrl.displayBetaDialog()"
) You are using a beta version of the app
.center
.sk-app-bar-item(ng-if='ctrl.arbitraryStatusMessage')

View File

@@ -11,7 +11,7 @@ import {
SNTheme,
ComponentArea,
CollectionSort,
} from 'snjs';
} from '@standardnotes/snjs';
import template from './footer-view.pug';
import { AppStateEvent, EventSource } from '@/ui_models/app_state';
import {
@@ -23,7 +23,7 @@ import {
STRING_UPGRADE_ACCOUNT_CONFIRM_BUTTON,
} from '@/strings';
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
import { confirmDialog } from '@/services/alertService';
import { alertDialog, confirmDialog } from '@/services/alertService';
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() {
if (this.application && this.application.authenticationInProgress()) {
return;

View File

@@ -1,4 +1,4 @@
import { SNNote } from 'snjs';
import { SNNote } from '@standardnotes/snjs';
export enum NoteSortKey {
CreatedAt = 'created_at',

View File

@@ -9,7 +9,7 @@ import {
WebPrefKey,
findInArray,
CollectionSort,
} from 'snjs';
} from '@standardnotes/snjs';
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
import { AppStateEvent } from '@/ui_models/app_state';
import { KeyboardModifier, KeyboardKey } from '@/services/keyboardManager';
@@ -20,7 +20,7 @@ import {
NoteSortKey,
notePassesFilter
} from './note_utils';
import { UuidString } from 'snjs/dist/@types/types';
import { UuidString } from '@standardnotes/snjs';
type NotesState = {
panelTitle: string

View File

@@ -1,4 +1,4 @@
import { PayloadContent } from 'snjs/dist/@types/protocol/payloads/generator';
import { PayloadContent } from '@standardnotes/snjs';
import { WebDirective, PanelPuppet } from '@/types';
import { WebApplication } from '@/ui_models/application';
import {
@@ -12,7 +12,7 @@ import {
WebPrefKey,
UuidString,
TagMutator
} from 'snjs';
} from '@standardnotes/snjs';
import template from './tags-view.pug';
import { AppStateEvent } from '@/ui_models/app_state';
import { PANEL_NAME_TAGS } from '@/views/constants';

View File

@@ -1,4 +1,4 @@
import { DeviceInterface, getGlobalScope, SNApplication, ApplicationIdentifier } from 'snjs';
import { DeviceInterface, getGlobalScope, SNApplication, ApplicationIdentifier } from '@standardnotes/snjs';
import { Database } from '@/database';
import { Bridge } from './services/bridge';
@@ -106,7 +106,7 @@ export class WebDeviceInterface extends DeviceInterface {
if (!keychain) {
keychain = {};
}
this.bridge.setKeychainValue({
return this.bridge.setKeychainValue({
...keychain,
[identifier]: value
});
@@ -118,13 +118,17 @@ export class WebDeviceInterface extends DeviceInterface {
return;
}
delete keychain[identifier];
this.bridge.setKeychainValue(keychain);
return this.bridge.setKeychainValue(keychain);
}
getRawKeychainValue(): Promise<any> {
return this.bridge.getKeychainValue();
}
legacy_setRawKeychainValue(value: unknown): Promise<any> {
return this.bridge.setKeychainValue(value);
}
clearRawKeychainValue() {
return this.bridge.clearKeychainValue();
}

View File

@@ -34,6 +34,12 @@
margin-left: 0.3rem;
}
.sk-horizontal-group {
display: flex;
flex-direction: row;
align-items: center;
}
.sk-panel-section {
&:last-child {
padding-bottom: 1rem;

View File

@@ -136,11 +136,11 @@
!self.state.formData.showRegister`
)
.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-text
| 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(
href='https://standardnotes.org/help',
rel='noopener',
@@ -150,17 +150,16 @@
.sk-panel-column
.sk-h1.sk-bold.wrap {{self.state.user.email}}
.sk-subtitle.subtle.normal {{self.state.server}}
.sk-horizontal-group(
delay='1000',
delay-hide='true',
show='self.syncStatus.syncOpInProgress || self.syncStatus.needsMoreSync'
)
.sk-spinner.small.info
.sk-sublabel
| {{"Syncing" + (self.syncStatus.total > 0 ? ":" : "")}}
span(
ng-if='self.syncStatus.total > 0'
) {{self.syncStatus.current}}/{{self.syncStatus.total}}
.sk-horizontal-group(
delay='1000',
delay-hide='true',
show='self.state.syncInProgress'
)
.sk-spinner.small.info
.sk-sublabel
| Syncing
span(ng-if='self.state.syncPercentage')
| ({{self.state.syncPercentage}})
.sk-panel-row
a.sk-a.info.sk-panel-row.condensed(
ng-click="self.openPasswordWizard()"

View File

@@ -1 +0,0 @@
export {};

View File

@@ -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 {};

View File

@@ -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 {};

View File

@@ -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;
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../types';
export declare class ApplicationView extends WebDirective {
constructor();
}

View File

@@ -1,2 +0,0 @@
export declare const PANEL_NAME_NOTES = "notes";
export declare const PANEL_NAME_TAGS = "tags";

View File

@@ -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 {};

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../types';
export declare class Footer extends WebDirective {
constructor();
}

View File

@@ -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';

View File

@@ -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[];

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../../types';
export declare class NotesPanel extends WebDirective {
constructor();
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../types';
export declare class Root extends WebDirective {
constructor();
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../types';
export declare class TagsPanel extends WebDirective {
constructor();
}

View File

@@ -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;
}

View File

@@ -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;
};

View File

@@ -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;
};

View File

@@ -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;
};

View File

@@ -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;
};

View File

@@ -1,8 +0,0 @@
/// <reference types="angular" />
export declare function fileChange(): {
restrict: string;
scope: {
handler: string;
};
link: (scope: ng.IScope, element: JQLite) => void;
};

View File

@@ -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';

View File

@@ -1,4 +0,0 @@
/// <reference types="angular" />
export declare function infiniteScroll(): {
link: (scope: ng.IScope, elem: JQLite, attrs: any) => void;
};

View File

@@ -1,5 +0,0 @@
/// <reference types="angular" />
export declare function lowercase(): {
require: string;
link: (scope: ng.IScope, _: JQLite, attrs: any, ctrl: any) => void;
};

View File

@@ -1,5 +0,0 @@
/// <reference types="angular" />
export declare function selectOnClick($window: ng.IWindowService): {
restrict: string;
link: (scope: import("angular").IScope, element: JQLite) => void;
};

View File

@@ -1,5 +0,0 @@
/// <reference types="angular" />
export declare function selectOnFocus($window: ng.IWindowService): {
restrict: string;
link: (scope: ng.IScope, element: JQLite) => void;
};

View File

@@ -1,2 +0,0 @@
/// <reference types="angular" />
export declare function snEnter(): (scope: ng.IScope, element: JQLite, attrs: any) => void;

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../../types';
export declare class AccountMenu extends WebDirective {
constructor();
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../../types';
export declare class ActionsMenu extends WebDirective {
constructor();
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../../types';
export declare class ChallengeModal extends WebDirective {
constructor();
}

View File

@@ -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();
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../../types';
export declare class ComponentView extends WebDirective {
constructor();
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../../types';
export declare class EditorMenu extends WebDirective {
constructor();
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from '../../types';
export declare class HistoryMenu extends WebDirective {
constructor();
}

View File

@@ -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';

View File

@@ -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();
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../../types';
export declare class MenuRow extends WebDirective {
constructor();
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../../types';
export declare class PanelResizer extends WebDirective {
constructor();
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../../types';
export declare class PasswordWizard extends WebDirective {
constructor();
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../../types';
export declare class PermissionsModal extends WebDirective {
constructor();
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../../types';
export declare class PrivilegesAuthModal extends WebDirective {
constructor();
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../../types';
export declare class PrivilegesManagementModal extends WebDirective {
constructor();
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../../types';
export declare class RevisionPreviewModal extends WebDirective {
constructor();
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../../types';
export declare class SessionHistoryMenu extends WebDirective {
constructor();
}

View File

@@ -1,4 +0,0 @@
import { WebDirective } from './../../types';
export declare class SyncResolutionMenu extends WebDirective {
constructor();
}

View File

@@ -1 +0,0 @@
export { trusted } from './trusted';

View File

@@ -1,2 +0,0 @@
/// <reference types="angular" />
export declare function trusted($sce: ng.ISCEService): (url: string) => any;

View File

@@ -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';

View File

@@ -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;
}

View File

@@ -1,4 +0,0 @@
export declare enum RootScopeMessages {
ReloadExtendedData = "reload-ext-data",
NewUpdateAvailable = "new-update-available"
}

View File

@@ -1,2 +0,0 @@
/// <reference types="angular" />
export declare function configRoutes($locationProvider: ng.ILocationProvider): void;

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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