fix: use snjs proper types location

This commit is contained in:
Mo Bitar
2020-04-30 11:23:02 -05:00
parent bbfb40dcba
commit 78e4ae0a16
30 changed files with 64 additions and 75079 deletions

View File

@@ -1,4 +1,4 @@
import { SNAlertService } from "../../../../snjs/dist/@types";
import { SNAlertService } from "@node_modules/snjs/dist/@types";
const DB_NAME = 'standardnotes';
const STORE_NAME = 'items';

View File

@@ -19,9 +19,9 @@ import {
STRING_GENERATING_REGISTER_KEYS,
StringImportError
} from '@/strings';
import { SyncOpStatus } from '@/../../../../snjs/dist/@types/services/sync/sync_op_status';
import { SyncOpStatus } from '@node_modules/snjs/dist/@types/services/sync/sync_op_status';
import { PasswordWizardType } from '@/types';
import { BackupFile } from '@/../../../../snjs/dist/@types/services/protocol_service';
import { BackupFile } from '@node_modules/snjs/dist/@types/services/protocol_service';
const ELEMENT_ID_IMPORT_PASSWORD_INPUT = 'import-password-request';

View File

@@ -2,8 +2,8 @@ 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 } from '@/../../../../snjs/dist/@types';
import { ActionResponse } from '@/../../../../snjs/dist/@types/services/actions_service';
import { SNItem, Action, SNActionsExtension } from '@node_modules/snjs/dist/@types';
import { ActionResponse } from '@node_modules/snjs/dist/@types/services/actions_service';
type ActionsMenuScope = {
application: WebApplication

View File

@@ -4,7 +4,7 @@ import { SNComponent, SNItem, ComponentArea } from '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 '@node_modules/snjs/dist/@types/models';
interface EditorMenuScope {
callback: (component: SNComponent) => void

View File

@@ -3,7 +3,7 @@ import { WebApplication } from '@/ui_models/application';
import template from '%/directives/privileges-management-modal.pug';
import { PrivilegeCredential, ProtectedAction, SNPrivileges, PrivilegeSessionLength } from 'snjs';
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
import { PrivilegeMutator } from '@/../../../../snjs/dist/@types/models';
import { PrivilegeMutator } from '@node_modules/snjs/dist/@types/models';
type DisplayInfo = {
label: string

View File

@@ -8,7 +8,7 @@ import {
ComponentArea
} from 'snjs';
import template from '%/directives/revision-preview-modal.pug';
import { PayloadContent } from '@/../../../../snjs/dist/@types/protocol/payloads/generator';
import { PayloadContent } from '@node_modules/snjs/dist/@types/protocol/payloads/generator';
interface RevisionPreviewScope {
uuid: string

View File

@@ -1,7 +1,7 @@
import { WebDirective } from './../../types';
import { WebApplication } from '@/ui_models/application';
import template from '%/directives/session-history-menu.pug';
import { SNItem, ItemHistoryEntry, ItemHistory } from '@/../../../../snjs/dist/@types';
import { SNItem, ItemHistoryEntry, ItemHistory } from '@node_modules/snjs/dist/@types';
interface SessionHistoryScope {
application: WebApplication

View File

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

View File

@@ -17,6 +17,7 @@
"@Controllers/*": ["./controllers/*"],
"@Views/*": ["./views/*"],
"@Services/*": ["./services/*"],
"@node_modules/*": ["../../../node_modules/*"],
}
}
}

View File

@@ -1,6 +1,6 @@
import { SNComponent, ComponentArea, removeFromArray, addIfUnique } from 'snjs';
import { WebApplication } from './application';
import { UuidString } from '@/../../../../snjs/dist/@types/types';
import { UuidString } from '@node_modules/snjs/dist/@types/types';
/** Areas that only allow a single component to be active */
const SingleComponentAreas = [

View File

@@ -14,7 +14,7 @@ import {
STRING_DEFAULT_FILE_ERROR
} from '@/strings';
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
import { PermissionDialog } from '@/../../../../snjs/dist/@types/services/component_manager';
import { PermissionDialog } from '@node_modules/snjs/dist/@types/services/component_manager';
class ApplicationViewCtrl extends PureViewCtrl {
private $compile?: ng.ICompileService

View File

@@ -32,7 +32,6 @@ import {
StringDeleteNote,
StringEmptyTrash
} from '@/strings';
import { RawPayload } from '@/../../../../snjs/dist/@types/protocol/payloads/generator';
const NOTE_PREVIEW_CHAR_LIMIT = 80;
const MINIMUM_STATUS_DURATION = 400;

View File

@@ -19,7 +19,7 @@ import {
STRING_NEW_UPDATE_READY
} from '@/strings';
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
import { ComponentMutator } from '@/../../../../snjs/dist/@types/models';
import { ComponentMutator } from '@node_modules/snjs/dist/@types/models';
type DockShortcut = {
name: string,

View File

@@ -23,7 +23,7 @@ import {
NoteSortKey,
notePassesFilter
} from './note_utils';
import { UuidString } from '@/../../../../snjs/dist/@types/types';
import { UuidString } from '@node_modules/snjs/dist/@types/types';
type NotesState = {
panelTitle: string

View File

@@ -15,8 +15,8 @@ import { AppStateEvent } from '@/ui_models/app_state';
import { PANEL_NAME_TAGS } from '@/views/constants';
import { STRING_DELETE_TAG } from '@/strings';
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
import { UuidString } from '@/../../../../snjs/dist/@types/types';
import { TagMutator } from '@/../../../../snjs/dist/@types/models/app/tag';
import { UuidString } from '@node_modules/snjs/dist/@types/types';
import { TagMutator } from '@node_modules/snjs/dist/@types/models/app/tag';
type NoteCounts = Partial<Record<string, number>>

View File

@@ -1,4 +1,4 @@
import { SNAlertService } from "../../../../snjs/dist/@types";
import { SNAlertService } from "@node_modules/snjs/dist/@types";
export declare class Database {
private locked;
private alertService?;

View File

@@ -5,5 +5,5 @@ export { elemReady } from './elemReady';
export { fileChange } from './file-change';
export { infiniteScroll } from './infiniteScroll';
export { lowercase } from './lowercase';
export { selectOnClick } from './selectOnClick';
export { selectOnFocus } from './selectOnFocus';
export { snEnter } from './snEnter';

View File

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

View File

@@ -1,5 +1,5 @@
import { SNPredicate, ApplicationService } from 'snjs';
import { PayloadContent } from '@/../../../../snjs/dist/@types/protocol/payloads/generator';
import { PayloadContent } from '@node_modules/snjs/dist/@types/protocol/payloads/generator';
/** A class for handling installation of system extensions */
export declare class NativeExtManager extends ApplicationService {
extManagerId: string;

View File

@@ -1,18 +1,20 @@
import { WebApplication } from '@/ui_models/application';
import { ApplicationService } from 'snjs';
import { ApplicationService, ApplicationEvent } from 'snjs';
export declare class ThemeManager extends ApplicationService {
private activeThemes;
private unsubState;
private unregisterDesktop;
private unregisterComponent;
constructor(application: WebApplication);
/** @override */
onAppLaunch(): Promise<void>;
onAppEvent(event: ApplicationEvent): void;
get webApplication(): WebApplication;
deinit(): void;
/** @override */
onAppStart(): Promise<void>;
private activateCachedThemes;
private registerObservers;
deactivateAllThemes(): void;
private deactivateAllThemes;
private activateTheme;
private deactivateTheme;
private cacheThemes;

View File

@@ -1,12 +1,12 @@
import { SNComponent, ComponentArea } from 'snjs';
import { WebApplication } from './application';
import { UuidString } from '@/../../../../snjs/dist/@types/types';
import { UuidString } from '@node_modules/snjs/dist/@types/types';
export declare class ComponentGroup {
private application;
changeObservers: any[];
activeComponents: UuidString[];
constructor(application: WebApplication);
get componentManager(): import("../../../../../snjs/dist/@types").SNComponentManager;
get componentManager(): import("snjs/dist/@types").SNComponentManager;
deinit(): void;
activateComponent(component: SNComponent): Promise<void>;
deactivateComponent(component: SNComponent, notify?: boolean): Promise<void>;

View File

@@ -10,7 +10,7 @@ export declare class Editor {
constructor(application: WebApplication, noteUuid?: string, noteTitle?: string);
deinit(): void;
private handleNoteStream;
insertTemplatedNote(): Promise<import("../../../../../snjs/dist/@types").SNItem>;
insertTemplatedNote(): Promise<import("snjs/dist/@types").SNItem>;
/**
* Reverts the editor to a blank state, removing any existing note from view,
* and creating a placeholder note.
@@ -19,12 +19,12 @@ export declare class Editor {
/**
* Register to be notified when the editor's note changes.
*/
onNoteChange(onNoteChange: () => void): void;
onNoteChange(callback: () => void): void;
/**
* Register to be notified when the editor's note's values change
* (and thus a new object reference is created)
*/
onNoteValueChange(onNoteValueChange: (note: SNNote, source?: PayloadSource) => void): void;
onNoteValueChange(callback: (note: SNNote, source?: PayloadSource) => void): void;
/**
* Sets the editor contents by setting its note.
*/

View File

@@ -32,5 +32,6 @@ export declare class PureViewCtrl {
onAppStart(): Promise<void>;
onAppLaunch(): Promise<void>;
onAppKeyChange(): Promise<void>;
onAppSync(): void;
onAppIncrementalSync(): void;
onAppFullSync(): void;
}

72405
dist/javascripts/app.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2642
dist/stylesheets/app.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

17
package-lock.json generated
View File

@@ -6760,7 +6760,8 @@
"lodash": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A=="
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
"dev": true
},
"log-symbols": {
"version": "3.0.0",
@@ -9798,11 +9799,19 @@
"kind-of": "^3.2.0"
}
},
"snjs": {
"version": "github:standardnotes/snjs#ea2f182ba4b53642516714396bbef264f25e373b",
"from": "github:standardnotes/snjs#ea2f182ba4b53642516714396bbef264f25e373b",
"sncrypto": {
"version": "github:standardnotes/sncrypto#6625bbcc141161eb866475d9786238001f3c514d",
"from": "github:standardnotes/sncrypto#6625bbcc141161eb866475d9786238001f3c514d",
"dev": true
},
"snjs": {
"version": "github:standardnotes/snjs#0c306de70c5afffe16096424c6c3326eaa1dd4fd",
"from": "github:standardnotes/snjs#0c306de70c5afffe16096424c6c3326eaa1dd4fd",
"dev": true,
"requires": {
"sncrypto": "github:standardnotes/sncrypto#6625bbcc141161eb866475d9786238001f3c514d"
}
},
"sockjs": {
"version": "0.3.19",
"resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.19.tgz",

View File

@@ -58,16 +58,14 @@
"pug-loader": "^2.4.0",
"sass-loader": "^8.0.2",
"serve-static": "^1.14.1",
"snjs": "github:standardnotes/snjs#0c306de70c5afffe16096424c6c3326eaa1dd4fd",
"sn-stylekit": "2.0.22",
"snjs": "github:standardnotes/snjs#ea2f182ba4b53642516714396bbef264f25e373b",
"ts-loader": "^6.2.2",
"typescript": "^3.8.3",
"typescript-eslint": "0.0.1-alpha.0",
"webpack": "^4.42.0",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3"
},
"dependencies": {
"webpack-dev-server": "^3.10.3",
"lodash": "^4.17.15"
}
}

View File

@@ -39,6 +39,7 @@ module.exports = {
'@Controllers': path.resolve(__dirname, 'app/assets/javascripts/controllers'),
'@Views': path.resolve(__dirname, 'app/assets/javascripts/views'),
'@Services': path.resolve(__dirname, 'app/assets/javascripts/services'),
'@node_modules': path.resolve(__dirname, 'node_modules'),
}
},
module: {