@telia-ace/widget-core 1.0.7 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +5 -5
- package/README.md +3 -3
- package/dist/action-resolver.d.ts +8 -8
- package/dist/component-platform/actions-controller.d.ts +40 -40
- package/dist/component-platform/changeset-provider.d.ts +8 -8
- package/dist/component-platform/component-configuration-api.d.ts +2 -2
- package/dist/component-platform/component-controller.d.ts +38 -38
- package/dist/component-platform/component-node-collection.d.ts +18 -18
- package/dist/component-platform/component-node.d.ts +63 -63
- package/dist/component-platform/component-platform.d.ts +54 -54
- package/dist/component-platform/component-query.d.ts +16 -16
- package/dist/component-platform/create-component-model.d.ts +36 -36
- package/dist/component-platform/custom-component-handler.d.ts +21 -21
- package/dist/component-platform/descriptor.d.ts +8 -8
- package/dist/component-platform/extend-component.d.ts +8 -8
- package/dist/component-platform/index.d.ts +18 -18
- package/dist/component-platform/queries.d.ts +6 -6
- package/dist/component-platform/state-processor.d.ts +12 -12
- package/dist/component-resolver.d.ts +14 -14
- package/dist/event-subscriber.d.ts +7 -7
- package/dist/index.d.ts +8 -8
- package/dist/index.js.map +1 -1
- package/dist/types/configuration.d.ts +86 -86
- package/dist/types/index.d.ts +2 -2
- package/dist/types/ui.d.ts +54 -54
- package/package.json +3 -2
package/LICENSE.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Copyright © 2021, Telia Company AB. All rights reserved.
|
|
2
|
-
|
|
3
|
-
THIS PACKAGE AND CONTAINING SOFTWARE IS PART OF
|
|
4
|
-
THE HUMANY SERVICE. BY USING THIS SOFTWARE YOU
|
|
5
|
-
AGREE TO THE FOLLOWING TERMS AND CONDITIONS:
|
|
1
|
+
Copyright © 2021, Telia Company AB. All rights reserved.
|
|
2
|
+
|
|
3
|
+
THIS PACKAGE AND CONTAINING SOFTWARE IS PART OF
|
|
4
|
+
THE HUMANY SERVICE. BY USING THIS SOFTWARE YOU
|
|
5
|
+
AGREE TO THE FOLLOWING TERMS AND CONDITIONS:
|
|
6
6
|
http://www.humany.com/legal
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# `@telia-ace/widget-core`
|
|
2
|
-
|
|
3
|
-
Core framework for ACE widgets.
|
|
1
|
+
# `@telia-ace/widget-core`
|
|
2
|
+
|
|
3
|
+
Core framework for ACE widgets.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Container, EventSubscriptionCancellation } from '@webprovisions/platform';
|
|
2
|
-
export declare type Action = (origin: string, action: string, value?: any) => void;
|
|
3
|
-
export default class ActionResolver {
|
|
4
|
-
private events;
|
|
5
|
-
constructor(container: Container);
|
|
6
|
-
action(target: string, action: string, value: any): void;
|
|
7
|
-
subscribe(origin: string, fn: Action): EventSubscriptionCancellation;
|
|
8
|
-
}
|
|
1
|
+
import { Container, EventSubscriptionCancellation } from '@webprovisions/platform';
|
|
2
|
+
export declare type Action = (origin: string, action: string, value?: any) => void;
|
|
3
|
+
export default class ActionResolver {
|
|
4
|
+
private events;
|
|
5
|
+
constructor(container: Container);
|
|
6
|
+
action(target: string, action: string, value: any): void;
|
|
7
|
+
subscribe(origin: string, fn: Action): EventSubscriptionCancellation;
|
|
8
|
+
}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { EventSubscriptionCancellation } from '@webprovisions/platform';
|
|
2
|
-
import { ComponentNodeController } from './component-controller';
|
|
3
|
-
import { ComponentNode } from './component-node';
|
|
4
|
-
import { ComponentPlatform } from './component-platform';
|
|
5
|
-
import { ComponentQuery } from './component-query';
|
|
6
|
-
export declare type ActionData = any;
|
|
7
|
-
export declare type ActionHandler = (data: any, options: any, instance: ComponentNodeController) => any;
|
|
8
|
-
export declare type NextActionDelegate = (data: any, options?: any) => Promise<any>;
|
|
9
|
-
export declare type WatchActionDelegate = (input: ActionData, next: NextActionDelegate, instance: ComponentNodeController) => Promise<any> | any;
|
|
10
|
-
export declare type ActionWatcherContext = {
|
|
11
|
-
source: ComponentNode;
|
|
12
|
-
action: string;
|
|
13
|
-
};
|
|
14
|
-
export declare type ActionsState = {
|
|
15
|
-
handlers: {
|
|
16
|
-
fn: ActionHandler;
|
|
17
|
-
key: string;
|
|
18
|
-
target: ComponentQuery;
|
|
19
|
-
ns?: string;
|
|
20
|
-
}[];
|
|
21
|
-
watchers: {
|
|
22
|
-
target: ComponentQuery;
|
|
23
|
-
fn: WatchActionDelegate;
|
|
24
|
-
key: string;
|
|
25
|
-
ns?: string;
|
|
26
|
-
}[];
|
|
27
|
-
};
|
|
28
|
-
export declare class ActionsController {
|
|
29
|
-
private platform;
|
|
30
|
-
private target;
|
|
31
|
-
private ns?;
|
|
32
|
-
private subscriptions;
|
|
33
|
-
constructor(platform: ComponentPlatform, target: ComponentQuery, ns?: string | undefined);
|
|
34
|
-
create(key: string, fn?: ActionHandler): EventSubscriptionCancellation;
|
|
35
|
-
dispatch(key: string, data: any): Promise<{
|
|
36
|
-
[instanceId: string]: any;
|
|
37
|
-
}>;
|
|
38
|
-
watch(key: string, fn: WatchActionDelegate): EventSubscriptionCancellation;
|
|
39
|
-
dispose(): void;
|
|
40
|
-
}
|
|
1
|
+
import { EventSubscriptionCancellation } from '@webprovisions/platform';
|
|
2
|
+
import { ComponentNodeController } from './component-controller';
|
|
3
|
+
import { ComponentNode } from './component-node';
|
|
4
|
+
import { ComponentPlatform } from './component-platform';
|
|
5
|
+
import { ComponentQuery } from './component-query';
|
|
6
|
+
export declare type ActionData = any;
|
|
7
|
+
export declare type ActionHandler = (data: any, options: any, instance: ComponentNodeController) => any;
|
|
8
|
+
export declare type NextActionDelegate = (data: any, options?: any) => Promise<any>;
|
|
9
|
+
export declare type WatchActionDelegate = (input: ActionData, next: NextActionDelegate, instance: ComponentNodeController) => Promise<any> | any;
|
|
10
|
+
export declare type ActionWatcherContext = {
|
|
11
|
+
source: ComponentNode;
|
|
12
|
+
action: string;
|
|
13
|
+
};
|
|
14
|
+
export declare type ActionsState = {
|
|
15
|
+
handlers: {
|
|
16
|
+
fn: ActionHandler;
|
|
17
|
+
key: string;
|
|
18
|
+
target: ComponentQuery;
|
|
19
|
+
ns?: string;
|
|
20
|
+
}[];
|
|
21
|
+
watchers: {
|
|
22
|
+
target: ComponentQuery;
|
|
23
|
+
fn: WatchActionDelegate;
|
|
24
|
+
key: string;
|
|
25
|
+
ns?: string;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
export declare class ActionsController {
|
|
29
|
+
private platform;
|
|
30
|
+
private target;
|
|
31
|
+
private ns?;
|
|
32
|
+
private subscriptions;
|
|
33
|
+
constructor(platform: ComponentPlatform, target: ComponentQuery, ns?: string | undefined);
|
|
34
|
+
create(key: string, fn?: ActionHandler): EventSubscriptionCancellation;
|
|
35
|
+
dispatch(key: string, data: any): Promise<{
|
|
36
|
+
[instanceId: string]: any;
|
|
37
|
+
}>;
|
|
38
|
+
watch(key: string, fn: WatchActionDelegate): EventSubscriptionCancellation;
|
|
39
|
+
dispose(): void;
|
|
40
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ChangesetOptions, ComponentNodeSettings } from './component-node';
|
|
2
|
-
import { ComponentPlatform } from './component-platform';
|
|
3
|
-
import { ComponentQuery } from './component-query';
|
|
4
|
-
export interface ChangesetProvider {
|
|
5
|
-
write: (key: string, target: ComponentQuery, attributes: Partial<ComponentNodeSettings>, options: ChangesetOptions) => void;
|
|
6
|
-
remove: (key: string) => void;
|
|
7
|
-
load: (platform: ComponentPlatform) => Promise<any>;
|
|
8
|
-
}
|
|
1
|
+
import { ChangesetOptions, ComponentNodeSettings } from './component-node';
|
|
2
|
+
import { ComponentPlatform } from './component-platform';
|
|
3
|
+
import { ComponentQuery } from './component-query';
|
|
4
|
+
export interface ChangesetProvider {
|
|
5
|
+
write: (key: string, target: ComponentQuery, attributes: Partial<ComponentNodeSettings>, options: ChangesetOptions) => void;
|
|
6
|
+
remove: (key: string) => void;
|
|
7
|
+
load: (platform: ComponentPlatform) => Promise<any>;
|
|
8
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("@webprovisions/platform").ConfigurationApiDefinition;
|
|
2
|
-
export default _default;
|
|
1
|
+
declare const _default: import("@webprovisions/platform").ConfigurationApiDefinition;
|
|
2
|
+
export default _default;
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { ActionsController } from './actions-controller';
|
|
2
|
-
import { ChangesetOptions, ComponentNode, ComponentNodeContext, ComponentNodeLayout, ComponentNodeProperties } from './component-node';
|
|
3
|
-
import { ComponentPlatform } from './component-platform';
|
|
4
|
-
import { ComponentQuery } from './component-query';
|
|
5
|
-
export interface ComponentController {
|
|
6
|
-
actions: ActionsController;
|
|
7
|
-
writeProperties(properties: Partial<ComponentNodeProperties>, options: ChangesetOptions): void;
|
|
8
|
-
writeContext(context: Partial<ComponentNodeContext>, options: ChangesetOptions): void;
|
|
9
|
-
writeLayout(context: Partial<ComponentNodeLayout>, options: ChangesetOptions): void;
|
|
10
|
-
dispose(): void;
|
|
11
|
-
}
|
|
12
|
-
export declare class ComponentNodeController implements ComponentController {
|
|
13
|
-
private platform;
|
|
14
|
-
node: ComponentNode;
|
|
15
|
-
actions: ActionsController;
|
|
16
|
-
private subscribe;
|
|
17
|
-
private unsubscribe;
|
|
18
|
-
constructor(platform: ComponentPlatform, node: ComponentNode, ns?: string);
|
|
19
|
-
properties<T extends ComponentNodeProperties>(updated?: (properties: T) => void | Partial<ComponentNodeProperties>): T;
|
|
20
|
-
context(updated?: (context: ComponentNodeContext) => void): ComponentNodeContext;
|
|
21
|
-
layout(updated?: (layout: ComponentNodeLayout) => void): ComponentNodeLayout;
|
|
22
|
-
writeProperties(properties: Partial<ComponentNodeProperties> | ((properties: ComponentNodeProperties) => Partial<ComponentNodeProperties>), options?: ChangesetOptions): void;
|
|
23
|
-
writeContext(context: Partial<ComponentNodeContext>, options?: ChangesetOptions): void;
|
|
24
|
-
writeLayout(layout: Partial<ComponentNodeLayout>, options?: ChangesetOptions): void;
|
|
25
|
-
dispose(): void;
|
|
26
|
-
}
|
|
27
|
-
export declare class AbstractComponentController implements ComponentController {
|
|
28
|
-
private platform;
|
|
29
|
-
private target;
|
|
30
|
-
private clearOnDispose;
|
|
31
|
-
actions: ActionsController;
|
|
32
|
-
private removes;
|
|
33
|
-
constructor(platform: ComponentPlatform, target: ComponentQuery, clearOnDispose?: boolean);
|
|
34
|
-
writeProperties(properties: Partial<ComponentNodeProperties>, options?: ChangesetOptions): void;
|
|
35
|
-
writeContext(context: Partial<ComponentNodeContext>, options?: ChangesetOptions): void;
|
|
36
|
-
writeLayout(layout: Partial<ComponentNodeLayout>, options?: ChangesetOptions): void;
|
|
37
|
-
dispose(): void;
|
|
38
|
-
}
|
|
1
|
+
import { ActionsController } from './actions-controller';
|
|
2
|
+
import { ChangesetOptions, ComponentNode, ComponentNodeContext, ComponentNodeLayout, ComponentNodeProperties } from './component-node';
|
|
3
|
+
import { ComponentPlatform } from './component-platform';
|
|
4
|
+
import { ComponentQuery } from './component-query';
|
|
5
|
+
export interface ComponentController {
|
|
6
|
+
actions: ActionsController;
|
|
7
|
+
writeProperties(properties: Partial<ComponentNodeProperties>, options: ChangesetOptions): void;
|
|
8
|
+
writeContext(context: Partial<ComponentNodeContext>, options: ChangesetOptions): void;
|
|
9
|
+
writeLayout(context: Partial<ComponentNodeLayout>, options: ChangesetOptions): void;
|
|
10
|
+
dispose(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class ComponentNodeController implements ComponentController {
|
|
13
|
+
private platform;
|
|
14
|
+
node: ComponentNode;
|
|
15
|
+
actions: ActionsController;
|
|
16
|
+
private subscribe;
|
|
17
|
+
private unsubscribe;
|
|
18
|
+
constructor(platform: ComponentPlatform, node: ComponentNode, ns?: string);
|
|
19
|
+
properties<T extends ComponentNodeProperties>(updated?: (properties: T) => void | Partial<ComponentNodeProperties>): T;
|
|
20
|
+
context(updated?: (context: ComponentNodeContext) => void): ComponentNodeContext;
|
|
21
|
+
layout(updated?: (layout: ComponentNodeLayout) => void): ComponentNodeLayout;
|
|
22
|
+
writeProperties(properties: Partial<ComponentNodeProperties> | ((properties: ComponentNodeProperties) => Partial<ComponentNodeProperties>), options?: ChangesetOptions): void;
|
|
23
|
+
writeContext(context: Partial<ComponentNodeContext>, options?: ChangesetOptions): void;
|
|
24
|
+
writeLayout(layout: Partial<ComponentNodeLayout>, options?: ChangesetOptions): void;
|
|
25
|
+
dispose(): void;
|
|
26
|
+
}
|
|
27
|
+
export declare class AbstractComponentController implements ComponentController {
|
|
28
|
+
private platform;
|
|
29
|
+
private target;
|
|
30
|
+
private clearOnDispose;
|
|
31
|
+
actions: ActionsController;
|
|
32
|
+
private removes;
|
|
33
|
+
constructor(platform: ComponentPlatform, target: ComponentQuery, clearOnDispose?: boolean);
|
|
34
|
+
writeProperties(properties: Partial<ComponentNodeProperties>, options?: ChangesetOptions): void;
|
|
35
|
+
writeContext(context: Partial<ComponentNodeContext>, options?: ChangesetOptions): void;
|
|
36
|
+
writeLayout(layout: Partial<ComponentNodeLayout>, options?: ChangesetOptions): void;
|
|
37
|
+
dispose(): void;
|
|
38
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { EventManager } from '@webprovisions/platform';
|
|
2
|
-
import { ComponentNode } from './component-node';
|
|
3
|
-
import { SwitchMap } from './component-platform';
|
|
4
|
-
export declare type QueryDescriptor = {
|
|
5
|
-
id?: string;
|
|
6
|
-
type?: string;
|
|
7
|
-
name?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare class ComponentNodeCollection {
|
|
10
|
-
root: ComponentNode;
|
|
11
|
-
private switches;
|
|
12
|
-
all: ComponentNode[];
|
|
13
|
-
visible: ComponentNode[];
|
|
14
|
-
detached: ComponentNode[];
|
|
15
|
-
constructor(root: ComponentNode, switches: SwitchMap, events: EventManager);
|
|
16
|
-
query(query?: QueryDescriptor): ComponentNode[];
|
|
17
|
-
get(id: string): ComponentNode | undefined;
|
|
18
|
-
}
|
|
1
|
+
import { EventManager } from '@webprovisions/platform';
|
|
2
|
+
import { ComponentNode } from './component-node';
|
|
3
|
+
import { SwitchMap } from './component-platform';
|
|
4
|
+
export declare type QueryDescriptor = {
|
|
5
|
+
id?: string;
|
|
6
|
+
type?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare class ComponentNodeCollection {
|
|
10
|
+
root: ComponentNode;
|
|
11
|
+
private switches;
|
|
12
|
+
all: ComponentNode[];
|
|
13
|
+
visible: ComponentNode[];
|
|
14
|
+
detached: ComponentNode[];
|
|
15
|
+
constructor(root: ComponentNode, switches: SwitchMap, events: EventManager);
|
|
16
|
+
query(query?: QueryDescriptor): ComponentNode[];
|
|
17
|
+
get(id: string): ComponentNode | undefined;
|
|
18
|
+
}
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { Container, EventManager } from '@webprovisions/platform';
|
|
2
|
-
import { Breakpoints } from '../types';
|
|
3
|
-
export declare type ComponentNodeEventData = {
|
|
4
|
-
node: ComponentNode;
|
|
5
|
-
};
|
|
6
|
-
export declare type RemoveChangeset = () => void;
|
|
7
|
-
export declare type ComponentNodeAttributes = {
|
|
8
|
-
tags: string[];
|
|
9
|
-
properties: ComponentNodeProperties;
|
|
10
|
-
context: ComponentNodeContext;
|
|
11
|
-
layout: ComponentNodeLayout;
|
|
12
|
-
};
|
|
13
|
-
export declare type ResolveComponentNodeProperties = (properties: ComponentNodeProperties) => Partial<ComponentNodeProperties> | void;
|
|
14
|
-
export declare type ResolveComponentNodeContext = (context: ComponentNodeContext) => Partial<ComponentNodeContext>;
|
|
15
|
-
export declare type ResolveComponentNodeLayout = (layout: ComponentNodeLayout) => Partial<ComponentNodeLayout>;
|
|
16
|
-
export declare type ComponentNodeSettings = {
|
|
17
|
-
tags?: string[];
|
|
18
|
-
properties?: ComponentNodeProperties | ResolveComponentNodeProperties;
|
|
19
|
-
context?: ComponentNodeContext | ResolveComponentNodeContext;
|
|
20
|
-
layout?: ComponentNodeLayout | ResolveComponentNodeLayout;
|
|
21
|
-
};
|
|
22
|
-
export declare type ComponentNodeProperties = {
|
|
23
|
-
[key: string]: any;
|
|
24
|
-
};
|
|
25
|
-
export declare type ComponentNodeContext = {
|
|
26
|
-
[key: string]: any;
|
|
27
|
-
};
|
|
28
|
-
export declare type ComponentNodeLayout = {
|
|
29
|
-
size?: Size;
|
|
30
|
-
indent?: number;
|
|
31
|
-
order?: number;
|
|
32
|
-
};
|
|
33
|
-
export declare type Size = number | 'full' | 'none';
|
|
34
|
-
export declare type UnmountComponentNode = () => void;
|
|
35
|
-
export declare type ChangesetOptions = {
|
|
36
|
-
breakpoints?: Breakpoints;
|
|
37
|
-
};
|
|
38
|
-
export declare type Changeset = [Partial<ComponentNodeSettings>, ChangesetOptions];
|
|
39
|
-
export declare class ComponentNode {
|
|
40
|
-
private events;
|
|
41
|
-
id: string;
|
|
42
|
-
type: string;
|
|
43
|
-
name?: string;
|
|
44
|
-
parent?: ComponentNode;
|
|
45
|
-
tags: string[];
|
|
46
|
-
children: {
|
|
47
|
-
[key: string]: ComponentNode[];
|
|
48
|
-
};
|
|
49
|
-
changesets: Changeset[];
|
|
50
|
-
attributes: ComponentNodeAttributes;
|
|
51
|
-
private mountCount;
|
|
52
|
-
constructor(events: EventManager, type: string);
|
|
53
|
-
mount(viewOutletContainer: Container, element?: HTMLElement): UnmountComponentNode;
|
|
54
|
-
appendChild(node: ComponentNode, branch?: string): void;
|
|
55
|
-
prependChild(node: ComponentNode, branch?: string): void;
|
|
56
|
-
touchProperties(properties: ResolveComponentNodeProperties, options?: ChangesetOptions, removable?: boolean): RemoveChangeset;
|
|
57
|
-
writeProperties(properties: Partial<ComponentNodeProperties> | ResolveComponentNodeProperties, options?: ChangesetOptions, removable?: boolean): RemoveChangeset;
|
|
58
|
-
writeLayout(layout: Partial<ComponentNodeLayout> | ResolveComponentNodeLayout, options?: ChangesetOptions, removable?: boolean): RemoveChangeset;
|
|
59
|
-
writeContext(context: Partial<ComponentNodeContext> | ResolveComponentNodeContext, options?: ChangesetOptions, removable?: boolean): RemoveChangeset;
|
|
60
|
-
getChildren(branch?: string): ComponentNode[];
|
|
61
|
-
remove(): void;
|
|
62
|
-
removeChild(node: ComponentNode): void;
|
|
63
|
-
}
|
|
1
|
+
import { Container, EventManager } from '@webprovisions/platform';
|
|
2
|
+
import { Breakpoints } from '../types';
|
|
3
|
+
export declare type ComponentNodeEventData = {
|
|
4
|
+
node: ComponentNode;
|
|
5
|
+
};
|
|
6
|
+
export declare type RemoveChangeset = () => void;
|
|
7
|
+
export declare type ComponentNodeAttributes = {
|
|
8
|
+
tags: string[];
|
|
9
|
+
properties: ComponentNodeProperties;
|
|
10
|
+
context: ComponentNodeContext;
|
|
11
|
+
layout: ComponentNodeLayout;
|
|
12
|
+
};
|
|
13
|
+
export declare type ResolveComponentNodeProperties = (properties: ComponentNodeProperties) => Partial<ComponentNodeProperties> | void;
|
|
14
|
+
export declare type ResolveComponentNodeContext = (context: ComponentNodeContext) => Partial<ComponentNodeContext>;
|
|
15
|
+
export declare type ResolveComponentNodeLayout = (layout: ComponentNodeLayout) => Partial<ComponentNodeLayout>;
|
|
16
|
+
export declare type ComponentNodeSettings = {
|
|
17
|
+
tags?: string[];
|
|
18
|
+
properties?: ComponentNodeProperties | ResolveComponentNodeProperties;
|
|
19
|
+
context?: ComponentNodeContext | ResolveComponentNodeContext;
|
|
20
|
+
layout?: ComponentNodeLayout | ResolveComponentNodeLayout;
|
|
21
|
+
};
|
|
22
|
+
export declare type ComponentNodeProperties = {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
};
|
|
25
|
+
export declare type ComponentNodeContext = {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
};
|
|
28
|
+
export declare type ComponentNodeLayout = {
|
|
29
|
+
size?: Size;
|
|
30
|
+
indent?: number;
|
|
31
|
+
order?: number;
|
|
32
|
+
};
|
|
33
|
+
export declare type Size = number | 'full' | 'none';
|
|
34
|
+
export declare type UnmountComponentNode = () => void;
|
|
35
|
+
export declare type ChangesetOptions = {
|
|
36
|
+
breakpoints?: Breakpoints;
|
|
37
|
+
};
|
|
38
|
+
export declare type Changeset = [Partial<ComponentNodeSettings>, ChangesetOptions];
|
|
39
|
+
export declare class ComponentNode {
|
|
40
|
+
private events;
|
|
41
|
+
id: string;
|
|
42
|
+
type: string;
|
|
43
|
+
name?: string;
|
|
44
|
+
parent?: ComponentNode;
|
|
45
|
+
tags: string[];
|
|
46
|
+
children: {
|
|
47
|
+
[key: string]: ComponentNode[];
|
|
48
|
+
};
|
|
49
|
+
changesets: Changeset[];
|
|
50
|
+
attributes: ComponentNodeAttributes;
|
|
51
|
+
private mountCount;
|
|
52
|
+
constructor(events: EventManager, type: string);
|
|
53
|
+
mount(viewOutletContainer: Container, element?: HTMLElement): UnmountComponentNode;
|
|
54
|
+
appendChild(node: ComponentNode, branch?: string): void;
|
|
55
|
+
prependChild(node: ComponentNode, branch?: string): void;
|
|
56
|
+
touchProperties(properties: ResolveComponentNodeProperties, options?: ChangesetOptions, removable?: boolean): RemoveChangeset;
|
|
57
|
+
writeProperties(properties: Partial<ComponentNodeProperties> | ResolveComponentNodeProperties, options?: ChangesetOptions, removable?: boolean): RemoveChangeset;
|
|
58
|
+
writeLayout(layout: Partial<ComponentNodeLayout> | ResolveComponentNodeLayout, options?: ChangesetOptions, removable?: boolean): RemoveChangeset;
|
|
59
|
+
writeContext(context: Partial<ComponentNodeContext> | ResolveComponentNodeContext, options?: ChangesetOptions, removable?: boolean): RemoveChangeset;
|
|
60
|
+
getChildren(branch?: string): ComponentNode[];
|
|
61
|
+
remove(): void;
|
|
62
|
+
removeChild(node: ComponentNode): void;
|
|
63
|
+
}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { Container, EventManager, Widget } from '@webprovisions/platform';
|
|
2
|
-
import { ActionsController, ActionsState } from './actions-controller';
|
|
3
|
-
import { ChangesetProvider } from './changeset-provider';
|
|
4
|
-
import { ChangesetOptions, ComponentNode, ComponentNodeSettings, RemoveChangeset } from './component-node';
|
|
5
|
-
import { ComponentNodeCollection } from './component-node-collection';
|
|
6
|
-
import { ComponentQuery } from './component-query';
|
|
7
|
-
import { CustomHandlerCallback } from './custom-component-handler';
|
|
8
|
-
export declare type MergeOptions = {
|
|
9
|
-
breakpoints?: string[];
|
|
10
|
-
};
|
|
11
|
-
export declare type SwitchMap = {
|
|
12
|
-
[id: string]: string;
|
|
13
|
-
};
|
|
14
|
-
export declare type ChangesetData = {
|
|
15
|
-
key?: string;
|
|
16
|
-
target: ComponentQuery;
|
|
17
|
-
attributes: Partial<ComponentNodeSettings>;
|
|
18
|
-
options?: ChangesetOptions;
|
|
19
|
-
removable?: boolean;
|
|
20
|
-
provider?: string;
|
|
21
|
-
};
|
|
22
|
-
export declare class ComponentPlatform {
|
|
23
|
-
private providers;
|
|
24
|
-
events: EventManager;
|
|
25
|
-
breakpoints: string[];
|
|
26
|
-
nodes: ComponentNodeCollection;
|
|
27
|
-
actionsState: ActionsState;
|
|
28
|
-
private switches;
|
|
29
|
-
private changesets;
|
|
30
|
-
private subscriptions;
|
|
31
|
-
private processNode;
|
|
32
|
-
private customComponentHandler;
|
|
33
|
-
constructor(widget: Widget, providers?: {
|
|
34
|
-
[key: string]: ChangesetProvider;
|
|
35
|
-
});
|
|
36
|
-
static getInstance(container: Container): Promise<ComponentPlatform>;
|
|
37
|
-
addBreakpoint(name: string): void;
|
|
38
|
-
removeBreakpoint(name: string): void;
|
|
39
|
-
setSwitch(node: ComponentNode, branch: string): void;
|
|
40
|
-
getBranch(node: ComponentNode): string | undefined;
|
|
41
|
-
/**
|
|
42
|
-
* Creates a `ComponentNode` of the specified type.
|
|
43
|
-
* @param type Type of node.
|
|
44
|
-
*/
|
|
45
|
-
createNode(type: string, options?: {
|
|
46
|
-
detached?: boolean;
|
|
47
|
-
}): ComponentNode;
|
|
48
|
-
components(): ComponentQuery;
|
|
49
|
-
actions(target: ComponentQuery, ns: string): ActionsController;
|
|
50
|
-
write(data: ChangesetData): RemoveChangeset;
|
|
51
|
-
addComponentHandler(definitionType: string, fn: CustomHandlerCallback): void;
|
|
52
|
-
getComponentHandler(definitionType: string): CustomHandlerCallback | undefined;
|
|
53
|
-
dispose(): void;
|
|
54
|
-
}
|
|
1
|
+
import { Container, EventManager, Widget } from '@webprovisions/platform';
|
|
2
|
+
import { ActionsController, ActionsState } from './actions-controller';
|
|
3
|
+
import { ChangesetProvider } from './changeset-provider';
|
|
4
|
+
import { ChangesetOptions, ComponentNode, ComponentNodeSettings, RemoveChangeset } from './component-node';
|
|
5
|
+
import { ComponentNodeCollection } from './component-node-collection';
|
|
6
|
+
import { ComponentQuery } from './component-query';
|
|
7
|
+
import { CustomHandlerCallback } from './custom-component-handler';
|
|
8
|
+
export declare type MergeOptions = {
|
|
9
|
+
breakpoints?: string[];
|
|
10
|
+
};
|
|
11
|
+
export declare type SwitchMap = {
|
|
12
|
+
[id: string]: string;
|
|
13
|
+
};
|
|
14
|
+
export declare type ChangesetData = {
|
|
15
|
+
key?: string;
|
|
16
|
+
target: ComponentQuery;
|
|
17
|
+
attributes: Partial<ComponentNodeSettings>;
|
|
18
|
+
options?: ChangesetOptions;
|
|
19
|
+
removable?: boolean;
|
|
20
|
+
provider?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare class ComponentPlatform {
|
|
23
|
+
private providers;
|
|
24
|
+
events: EventManager;
|
|
25
|
+
breakpoints: string[];
|
|
26
|
+
nodes: ComponentNodeCollection;
|
|
27
|
+
actionsState: ActionsState;
|
|
28
|
+
private switches;
|
|
29
|
+
private changesets;
|
|
30
|
+
private subscriptions;
|
|
31
|
+
private processNode;
|
|
32
|
+
private customComponentHandler;
|
|
33
|
+
constructor(widget: Widget, providers?: {
|
|
34
|
+
[key: string]: ChangesetProvider;
|
|
35
|
+
});
|
|
36
|
+
static getInstance(container: Container): Promise<ComponentPlatform>;
|
|
37
|
+
addBreakpoint(name: string): void;
|
|
38
|
+
removeBreakpoint(name: string): void;
|
|
39
|
+
setSwitch(node: ComponentNode, branch: string): void;
|
|
40
|
+
getBranch(node: ComponentNode): string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a `ComponentNode` of the specified type.
|
|
43
|
+
* @param type Type of node.
|
|
44
|
+
*/
|
|
45
|
+
createNode(type: string, options?: {
|
|
46
|
+
detached?: boolean;
|
|
47
|
+
}): ComponentNode;
|
|
48
|
+
components(): ComponentQuery;
|
|
49
|
+
actions(target: ComponentQuery, ns: string): ActionsController;
|
|
50
|
+
write(data: ChangesetData): RemoveChangeset;
|
|
51
|
+
addComponentHandler(definitionType: string, fn: CustomHandlerCallback): void;
|
|
52
|
+
getComponentHandler(definitionType: string): CustomHandlerCallback | undefined;
|
|
53
|
+
dispose(): void;
|
|
54
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { AbstractComponentController } from './component-controller';
|
|
2
|
-
import { ComponentNode } from './component-node';
|
|
3
|
-
import { ComponentPlatform } from './component-platform';
|
|
4
|
-
export declare type ComponentQueryRule = {
|
|
5
|
-
id?: string;
|
|
6
|
-
type?: string;
|
|
7
|
-
};
|
|
8
|
-
export declare class ComponentQuery {
|
|
9
|
-
private platform;
|
|
10
|
-
rules: ComponentQueryRule[];
|
|
11
|
-
constructor(platform: ComponentPlatform, rules?: ComponentQueryRule[]);
|
|
12
|
-
match(node: ComponentNode): boolean;
|
|
13
|
-
ofType(type: string): ComponentQuery;
|
|
14
|
-
withId(id: string): ComponentQuery;
|
|
15
|
-
select(): AbstractComponentController;
|
|
16
|
-
}
|
|
1
|
+
import { AbstractComponentController } from './component-controller';
|
|
2
|
+
import { ComponentNode } from './component-node';
|
|
3
|
+
import { ComponentPlatform } from './component-platform';
|
|
4
|
+
export declare type ComponentQueryRule = {
|
|
5
|
+
id?: string;
|
|
6
|
+
type?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare class ComponentQuery {
|
|
9
|
+
private platform;
|
|
10
|
+
rules: ComponentQueryRule[];
|
|
11
|
+
constructor(platform: ComponentPlatform, rules?: ComponentQueryRule[]);
|
|
12
|
+
match(node: ComponentNode): boolean;
|
|
13
|
+
ofType(type: string): ComponentQuery;
|
|
14
|
+
withId(id: string): ComponentQuery;
|
|
15
|
+
select(): AbstractComponentController;
|
|
16
|
+
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { EventSubscriptionCancellation } from '@webprovisions/platform';
|
|
2
|
-
import { Breakpoints, ComponentSettings, ViewDefinition, WidgetSettings } from '../types';
|
|
3
|
-
import { ComponentNode, ComponentNodeContext, ComponentNodeLayout, ComponentNodeProperties } from './component-node';
|
|
4
|
-
import { ComponentPlatform } from './component-platform';
|
|
5
|
-
declare type ComponentReference = string | [string, ...ComponentReferenceOverride[]];
|
|
6
|
-
declare type ComponentReferenceOverride = {
|
|
7
|
-
breakpoints?: Breakpoints;
|
|
8
|
-
tags?: string[];
|
|
9
|
-
context?: ComponentNodeContext;
|
|
10
|
-
properties?: ComponentNodeProperties;
|
|
11
|
-
layout?: ComponentNodeLayout;
|
|
12
|
-
};
|
|
13
|
-
export declare type NormalizedComponentReference = {
|
|
14
|
-
definitionId: string;
|
|
15
|
-
overrides: ComponentReferenceOverride[];
|
|
16
|
-
};
|
|
17
|
-
export declare const normalizeReference: (reference: ComponentReference) => NormalizedComponentReference;
|
|
18
|
-
export declare type ComponentHandlerOptions = {
|
|
19
|
-
platform: ComponentPlatform;
|
|
20
|
-
node: ComponentNode;
|
|
21
|
-
references: ComponentReference[];
|
|
22
|
-
definitions: {
|
|
23
|
-
[name: string]: ComponentSettings;
|
|
24
|
-
};
|
|
25
|
-
views: {
|
|
26
|
-
[key: string]: ViewDefinition;
|
|
27
|
-
};
|
|
28
|
-
branch?: string;
|
|
29
|
-
};
|
|
30
|
-
export declare const createChildren: (platform: ComponentPlatform, node: ComponentNode, references: ComponentReference[], definitions: {
|
|
31
|
-
[name: string]: ComponentSettings;
|
|
32
|
-
}, views: {
|
|
33
|
-
[key: string]: ViewDefinition;
|
|
34
|
-
}, branch?: string | undefined) => void;
|
|
35
|
-
export declare const createComponentModel: (platform: ComponentPlatform, settings: WidgetSettings) => EventSubscriptionCancellation;
|
|
36
|
-
export {};
|
|
1
|
+
import { EventSubscriptionCancellation } from '@webprovisions/platform';
|
|
2
|
+
import { Breakpoints, ComponentSettings, ViewDefinition, WidgetSettings } from '../types';
|
|
3
|
+
import { ComponentNode, ComponentNodeContext, ComponentNodeLayout, ComponentNodeProperties } from './component-node';
|
|
4
|
+
import { ComponentPlatform } from './component-platform';
|
|
5
|
+
declare type ComponentReference = string | [string, ...ComponentReferenceOverride[]];
|
|
6
|
+
declare type ComponentReferenceOverride = {
|
|
7
|
+
breakpoints?: Breakpoints;
|
|
8
|
+
tags?: string[];
|
|
9
|
+
context?: ComponentNodeContext;
|
|
10
|
+
properties?: ComponentNodeProperties;
|
|
11
|
+
layout?: ComponentNodeLayout;
|
|
12
|
+
};
|
|
13
|
+
export declare type NormalizedComponentReference = {
|
|
14
|
+
definitionId: string;
|
|
15
|
+
overrides: ComponentReferenceOverride[];
|
|
16
|
+
};
|
|
17
|
+
export declare const normalizeReference: (reference: ComponentReference) => NormalizedComponentReference;
|
|
18
|
+
export declare type ComponentHandlerOptions = {
|
|
19
|
+
platform: ComponentPlatform;
|
|
20
|
+
node: ComponentNode;
|
|
21
|
+
references: ComponentReference[];
|
|
22
|
+
definitions: {
|
|
23
|
+
[name: string]: ComponentSettings;
|
|
24
|
+
};
|
|
25
|
+
views: {
|
|
26
|
+
[key: string]: ViewDefinition;
|
|
27
|
+
};
|
|
28
|
+
branch?: string;
|
|
29
|
+
};
|
|
30
|
+
export declare const createChildren: (platform: ComponentPlatform, node: ComponentNode, references: ComponentReference[], definitions: {
|
|
31
|
+
[name: string]: ComponentSettings;
|
|
32
|
+
}, views: {
|
|
33
|
+
[key: string]: ViewDefinition;
|
|
34
|
+
}, branch?: string | undefined) => void;
|
|
35
|
+
export declare const createComponentModel: (platform: ComponentPlatform, settings: WidgetSettings) => EventSubscriptionCancellation;
|
|
36
|
+
export {};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { ComponentReference, ComponentSettings, ViewDefinition } from '../types';
|
|
2
|
-
import { ComponentNode } from './component-node';
|
|
3
|
-
import { ComponentPlatform } from './component-platform';
|
|
4
|
-
import { NormalizedComponentReference } from './create-component-model';
|
|
5
|
-
export declare type CustomHandlerCallback = (ref: NormalizedComponentReference, options: {
|
|
6
|
-
platform: ComponentPlatform;
|
|
7
|
-
node: ComponentNode;
|
|
8
|
-
references: ComponentReference[];
|
|
9
|
-
definitions: {
|
|
10
|
-
[name: string]: ComponentSettings;
|
|
11
|
-
};
|
|
12
|
-
views: {
|
|
13
|
-
[key: string]: ViewDefinition;
|
|
14
|
-
};
|
|
15
|
-
branch?: string;
|
|
16
|
-
}) => void;
|
|
17
|
-
export declare class CustomComponentHandler {
|
|
18
|
-
private handlers;
|
|
19
|
-
add(name: string, fn: CustomHandlerCallback): void;
|
|
20
|
-
get(name: string): CustomHandlerCallback | undefined;
|
|
21
|
-
}
|
|
1
|
+
import { ComponentReference, ComponentSettings, ViewDefinition } from '../types';
|
|
2
|
+
import { ComponentNode } from './component-node';
|
|
3
|
+
import { ComponentPlatform } from './component-platform';
|
|
4
|
+
import { NormalizedComponentReference } from './create-component-model';
|
|
5
|
+
export declare type CustomHandlerCallback = (ref: NormalizedComponentReference, options: {
|
|
6
|
+
platform: ComponentPlatform;
|
|
7
|
+
node: ComponentNode;
|
|
8
|
+
references: ComponentReference[];
|
|
9
|
+
definitions: {
|
|
10
|
+
[name: string]: ComponentSettings;
|
|
11
|
+
};
|
|
12
|
+
views: {
|
|
13
|
+
[key: string]: ViewDefinition;
|
|
14
|
+
};
|
|
15
|
+
branch?: string;
|
|
16
|
+
}) => void;
|
|
17
|
+
export declare class CustomComponentHandler {
|
|
18
|
+
private handlers;
|
|
19
|
+
add(name: string, fn: CustomHandlerCallback): void;
|
|
20
|
+
get(name: string): CustomHandlerCallback | undefined;
|
|
21
|
+
}
|