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 DB_NAME = 'standardnotes';
const STORE_NAME = 'items'; const STORE_NAME = 'items';

View File

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

View File

@@ -4,7 +4,7 @@ import { SNComponent, SNItem, ComponentArea } from '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 '@node_modules/snjs/dist/@types/models';
interface EditorMenuScope { interface EditorMenuScope {
callback: (component: SNComponent) => void 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 template from '%/directives/privileges-management-modal.pug';
import { PrivilegeCredential, ProtectedAction, SNPrivileges, PrivilegeSessionLength } from 'snjs'; import { PrivilegeCredential, ProtectedAction, SNPrivileges, PrivilegeSessionLength } from '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 '@node_modules/snjs/dist/@types/models';
type DisplayInfo = { type DisplayInfo = {
label: string label: string

View File

@@ -8,7 +8,7 @@ import {
ComponentArea ComponentArea
} from 'snjs'; } from '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 '@node_modules/snjs/dist/@types/protocol/payloads/generator';
interface RevisionPreviewScope { interface RevisionPreviewScope {
uuid: string uuid: string

View File

@@ -1,7 +1,7 @@
import { WebDirective } from './../../types'; import { WebDirective } from './../../types';
import { WebApplication } from '@/ui_models/application'; import { WebApplication } from '@/ui_models/application';
import template from '%/directives/session-history-menu.pug'; 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 { interface SessionHistoryScope {
application: WebApplication application: WebApplication

View File

@@ -10,8 +10,8 @@ import {
Copy, Copy,
dictToArray dictToArray
} from 'snjs'; } from 'snjs';
import { PayloadContent } from '@/../../../../snjs/dist/@types/protocol/payloads/generator'; import { PayloadContent } from '@node_modules/snjs/dist/@types/protocol/payloads/generator';
import { ComponentPermission } from '@/../../../../snjs/dist/@types/models/app/component'; import { ComponentPermission } from '@node_modules/snjs/dist/@types/models/app/component';
/** 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 {

View File

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

View File

@@ -1,6 +1,6 @@
import { SNComponent, ComponentArea, removeFromArray, addIfUnique } from 'snjs'; import { SNComponent, ComponentArea, removeFromArray, addIfUnique } from 'snjs';
import { WebApplication } from './application'; 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 */ /** Areas that only allow a single component to be active */
const SingleComponentAreas = [ const SingleComponentAreas = [

View File

@@ -14,7 +14,7 @@ import {
STRING_DEFAULT_FILE_ERROR STRING_DEFAULT_FILE_ERROR
} from '@/strings'; } from '@/strings';
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl'; 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 { class ApplicationViewCtrl extends PureViewCtrl {
private $compile?: ng.ICompileService private $compile?: ng.ICompileService

View File

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

View File

@@ -19,7 +19,7 @@ import {
STRING_NEW_UPDATE_READY STRING_NEW_UPDATE_READY
} from '@/strings'; } from '@/strings';
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 '@node_modules/snjs/dist/@types/models';
type DockShortcut = { type DockShortcut = {
name: string, name: string,

View File

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

View File

@@ -15,8 +15,8 @@ import { AppStateEvent } from '@/ui_models/app_state';
import { PANEL_NAME_TAGS } from '@/views/constants'; import { PANEL_NAME_TAGS } from '@/views/constants';
import { STRING_DELETE_TAG } from '@/strings'; import { STRING_DELETE_TAG } from '@/strings';
import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl'; import { PureViewCtrl } from '@Views/abstract/pure_view_ctrl';
import { UuidString } from '@/../../../../snjs/dist/@types/types'; import { UuidString } from '@node_modules/snjs/dist/@types/types';
import { TagMutator } from '@/../../../../snjs/dist/@types/models/app/tag'; import { TagMutator } from '@node_modules/snjs/dist/@types/models/app/tag';
type NoteCounts = Partial<Record<string, number>> 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 { export declare class Database {
private locked; private locked;
private alertService?; private alertService?;

View File

@@ -5,5 +5,5 @@ export { elemReady } from './elemReady';
export { fileChange } from './file-change'; export { fileChange } from './file-change';
export { infiniteScroll } from './infiniteScroll'; export { infiniteScroll } from './infiniteScroll';
export { lowercase } from './lowercase'; export { lowercase } from './lowercase';
export { selectOnClick } from './selectOnClick'; export { selectOnFocus } from './selectOnFocus';
export { snEnter } from './snEnter'; 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 { 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 */ /** A class for handling installation of system extensions */
export declare class NativeExtManager extends ApplicationService { export declare class NativeExtManager extends ApplicationService {
extManagerId: string; extManagerId: string;

View File

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

View File

@@ -1,12 +1,12 @@
import { SNComponent, ComponentArea } from 'snjs'; import { SNComponent, ComponentArea } from 'snjs';
import { WebApplication } from './application'; import { WebApplication } from './application';
import { UuidString } from '@/../../../../snjs/dist/@types/types'; import { UuidString } from '@node_modules/snjs/dist/@types/types';
export declare class ComponentGroup { export declare class ComponentGroup {
private application; private application;
changeObservers: any[]; changeObservers: any[];
activeComponents: UuidString[]; activeComponents: UuidString[];
constructor(application: WebApplication); constructor(application: WebApplication);
get componentManager(): import("../../../../../snjs/dist/@types").SNComponentManager; get componentManager(): import("snjs/dist/@types").SNComponentManager;
deinit(): void; deinit(): void;
activateComponent(component: SNComponent): Promise<void>; activateComponent(component: SNComponent): Promise<void>;
deactivateComponent(component: SNComponent, notify?: boolean): 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); constructor(application: WebApplication, noteUuid?: string, noteTitle?: string);
deinit(): void; deinit(): void;
private handleNoteStream; 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, * Reverts the editor to a blank state, removing any existing note from view,
* and creating a placeholder note. * and creating a placeholder note.
@@ -19,12 +19,12 @@ export declare class Editor {
/** /**
* Register to be notified when the editor's note changes. * 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 * Register to be notified when the editor's note's values change
* (and thus a new object reference is created) * (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. * Sets the editor contents by setting its note.
*/ */

View File

@@ -32,5 +32,6 @@ export declare class PureViewCtrl {
onAppStart(): Promise<void>; onAppStart(): Promise<void>;
onAppLaunch(): Promise<void>; onAppLaunch(): Promise<void>;
onAppKeyChange(): 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": { "lodash": {
"version": "4.17.15", "version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "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": { "log-symbols": {
"version": "3.0.0", "version": "3.0.0",
@@ -9798,11 +9799,19 @@
"kind-of": "^3.2.0" "kind-of": "^3.2.0"
} }
}, },
"snjs": { "sncrypto": {
"version": "github:standardnotes/snjs#ea2f182ba4b53642516714396bbef264f25e373b", "version": "github:standardnotes/sncrypto#6625bbcc141161eb866475d9786238001f3c514d",
"from": "github:standardnotes/snjs#ea2f182ba4b53642516714396bbef264f25e373b", "from": "github:standardnotes/sncrypto#6625bbcc141161eb866475d9786238001f3c514d",
"dev": true "dev": true
}, },
"snjs": {
"version": "github:standardnotes/snjs#0c306de70c5afffe16096424c6c3326eaa1dd4fd",
"from": "github:standardnotes/snjs#0c306de70c5afffe16096424c6c3326eaa1dd4fd",
"dev": true,
"requires": {
"sncrypto": "github:standardnotes/sncrypto#6625bbcc141161eb866475d9786238001f3c514d"
}
},
"sockjs": { "sockjs": {
"version": "0.3.19", "version": "0.3.19",
"resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.19.tgz", "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.19.tgz",

View File

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

View File

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