Fixes and improvements related to components

This commit is contained in:
Mo Bitar
2020-04-15 19:17:08 -05:00
parent 1280c2ec52
commit 407e3ea0d8
21 changed files with 276 additions and 270 deletions

View File

@@ -1,23 +1,26 @@
/// <reference types="angular" />
import { WebApplication } from '@/ui_models/application';
import { SNComponent } from 'snjs';
import { SNComponent, LiveItem } from 'snjs';
import { WebDirective } from './../../types';
declare type ComponentModalScope = {
component: SNComponent;
export declare type ComponentModalScope = {
componentUuid: string;
callback: () => void;
onDismiss: (component: SNComponent) => void;
application: WebApplication;
};
export declare class ComponentModalCtrl implements ComponentModalScope {
$element: JQLite;
component: SNComponent;
componentUuid: string;
callback: () => void;
onDismiss: (component: SNComponent) => void;
application: WebApplication;
liveComponent: LiveItem<SNComponent>;
component: SNComponent;
constructor($element: JQLite);
$onInit(): void;
$onDestroy(): void;
dismiss(): void;
}
export declare class ComponentModal extends WebDirective {
constructor();
}
export {};

View File

@@ -28,9 +28,6 @@ export interface PermissionsModalScope extends Partial<ng.IScope> {
permissionsString: string;
callback: (approved: boolean) => void;
}
export interface ModalComponentScope extends Partial<ng.IScope> {
component: SNComponent;
}
export declare type PanelPuppet = {
onReady?: () => void;
ready?: boolean;

View File

@@ -1,15 +1,15 @@
import { SNComponent, ComponentArea } from 'snjs';
import { WebApplication } from './application';
import { UuidString } from '@/../../../../snjs/dist/@types/types';
export declare class ComponentGroup {
private application;
changeObservers: any[];
activeComponents: Partial<Record<string, SNComponent>>;
activeComponents: UuidString[];
constructor(application: WebApplication);
get componentManager(): import("../../../../../snjs/dist/@types").SNComponentManager;
deinit(): void;
registerComponentHandler(): void;
activateComponent(component: SNComponent): Promise<void>;
deactivateComponent(component: SNComponent): Promise<void>;
deactivateComponent(component: SNComponent, notify?: boolean): Promise<void>;
deactivateComponentForArea(area: ComponentArea): Promise<void>;
activeComponentForArea(area: ComponentArea): SNComponent;
activeComponentsForArea(area: ComponentArea): SNComponent[];
@@ -18,6 +18,6 @@ export declare class ComponentGroup {
/**
* Notifies observer when the active editor has changed.
*/
addChangeObserver(callback: any): void;
addChangeObserver(callback: () => void): () => void;
private notifyObservers;
}

View File

@@ -1,6 +1,5 @@
export declare function getParameterByName(name: string, url: string): string | null;
export declare function isNullOrUndefined(value: any): boolean;
export declare function dictToArray<T>(dict: Record<any, T>): NonNullable<T>[];
export declare function getPlatformString(): string;
export declare function dateToLocalizedString(date: Date): string;
/** Via https://davidwalsh.name/javascript-debounce-function */

View File

@@ -6,7 +6,7 @@ export declare type CtrlProps = Partial<Record<string, any>>;
export declare class PureViewCtrl {
$timeout: ng.ITimeoutService;
/** Passed through templates */
application?: WebApplication;
application: WebApplication;
props: CtrlProps;
state: CtrlState;
private unsubApp;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long