@telia-ace/widget-core-flamingo 1.0.14
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE.txt +6 -0
- package/README.md +3 -0
- package/dist/action-resolver.d.ts +9 -0
- package/dist/action-resolver.d.ts.map +1 -0
- package/dist/bootstrap.d.ts +16 -0
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/component-platform/actions-controller.d.ts +41 -0
- package/dist/component-platform/actions-controller.d.ts.map +1 -0
- package/dist/component-platform/changeset-provider.d.ts +9 -0
- package/dist/component-platform/changeset-provider.d.ts.map +1 -0
- package/dist/component-platform/component-configuration-api.d.ts +3 -0
- package/dist/component-platform/component-configuration-api.d.ts.map +1 -0
- package/dist/component-platform/component-controller.d.ts +39 -0
- package/dist/component-platform/component-controller.d.ts.map +1 -0
- package/dist/component-platform/component-node-collection.d.ts +19 -0
- package/dist/component-platform/component-node-collection.d.ts.map +1 -0
- package/dist/component-platform/component-node.d.ts +64 -0
- package/dist/component-platform/component-node.d.ts.map +1 -0
- package/dist/component-platform/component-platform.d.ts +55 -0
- package/dist/component-platform/component-platform.d.ts.map +1 -0
- package/dist/component-platform/component-query.d.ts +17 -0
- package/dist/component-platform/component-query.d.ts.map +1 -0
- package/dist/component-platform/create-component-model.d.ts +37 -0
- package/dist/component-platform/create-component-model.d.ts.map +1 -0
- package/dist/component-platform/custom-component-handler.d.ts +22 -0
- package/dist/component-platform/custom-component-handler.d.ts.map +1 -0
- package/dist/component-platform/descriptor.d.ts +9 -0
- package/dist/component-platform/descriptor.d.ts.map +1 -0
- package/dist/component-platform/extend-component.d.ts +9 -0
- package/dist/component-platform/extend-component.d.ts.map +1 -0
- package/dist/component-platform/index.d.ts +19 -0
- package/dist/component-platform/index.d.ts.map +1 -0
- package/dist/component-platform/queries.d.ts +7 -0
- package/dist/component-platform/queries.d.ts.map +1 -0
- package/dist/component-platform/state-processor.d.ts +13 -0
- package/dist/component-platform/state-processor.d.ts.map +1 -0
- package/dist/component-resolver.d.ts +15 -0
- package/dist/component-resolver.d.ts.map +1 -0
- package/dist/environment.d.ts +49 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/event-subscriber.d.ts +8 -0
- package/dist/event-subscriber.d.ts.map +1 -0
- package/dist/implementation.d.ts +8 -0
- package/dist/implementation.d.ts.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2076 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +8 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/types/configuration.d.ts +87 -0
- package/dist/types/configuration.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/ui.d.ts +49 -0
- package/dist/types/ui.d.ts.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/widget-type.d.ts +8 -0
- package/dist/widget-type.d.ts.map +1 -0
- package/package.json +48 -0
package/LICENSE.txt
ADDED
package/README.md
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Container, EventSubscriptionCancellation } from '@webprovisions/platform';
|
2
|
+
export 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
|
+
}
|
9
|
+
//# sourceMappingURL=action-resolver.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"action-resolver.d.ts","sourceRoot":"","sources":["../src/action-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAET,6BAA6B,EAE9B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;AAE3E,MAAM,CAAC,OAAO,OAAO,cAAc;IACjC,OAAO,CAAC,MAAM,CAAe;gBAEjB,SAAS,EAAE,SAAS;IAKhC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAQxD,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,6BAA6B;CAOrE"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { BootstrappedImplementation } from '@webprovisions/bootstrapping';
|
2
|
+
import { ConfigureCallback } from '@webprovisions/platform';
|
3
|
+
import Implementation from './implementation';
|
4
|
+
export type BootstrapOptions = {
|
5
|
+
/**
|
6
|
+
* Resolver function for the root element to base the bootstrapping on.
|
7
|
+
*/
|
8
|
+
rootElementResolver?: () => HTMLElement;
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* Bootstraps an `Implementation` by scanning trigger elements and attaches them to
|
12
|
+
* their corresponding widgets.
|
13
|
+
*/
|
14
|
+
declare const _default: (implementation: Implementation, configure: ConfigureCallback, options?: BootstrapOptions) => Promise<BootstrappedImplementation>;
|
15
|
+
export default _default;
|
16
|
+
//# sourceMappingURL=bootstrap.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAyB,MAAM,yBAAyB,CAAC;AACnF,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C,MAAM,MAAM,gBAAgB,GAAG;IAC3B;;OAEG;IACH,mBAAmB,CAAC,EAAE,MAAM,WAAW,CAAC;CAC3C,CAAC;AAEF;;;GAGG;yCAEiB,cAAc,aACnB,iBAAiB,YACnB,gBAAgB,KAC1B,QAAQ,0BAA0B,CAAC;AAJtC,wBAyBE"}
|
@@ -0,0 +1,41 @@
|
|
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 type ActionData = any;
|
7
|
+
export type ActionHandler = (data: any, options: any, instance: ComponentNodeController) => any;
|
8
|
+
export type NextActionDelegate = (data: any, options?: any) => Promise<any>;
|
9
|
+
export type WatchActionDelegate = (input: ActionData, next: NextActionDelegate, instance: ComponentNodeController) => Promise<any> | any;
|
10
|
+
export type ActionWatcherContext = {
|
11
|
+
source: ComponentNode;
|
12
|
+
action: string;
|
13
|
+
};
|
14
|
+
export 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
|
+
}
|
41
|
+
//# sourceMappingURL=actions-controller.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"actions-controller.d.ts","sourceRoot":"","sources":["../../src/component-platform/actions-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EA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CAAC,aAAa,CAAsB;gBAE/B,QAAQ,EAAE,iBAAiB,EAC3B,MAAM,EAAE,cAAc,EACtB,EAAE,CAAC,oBAAQ;IAKvB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,GAAE,aAAwB,GAAG,6BAA6B;IAkBhF,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAqDxE,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,mBAAmB,GAAG,6BAA6B;IA0B1E,OAAO;CAGV"}
|
@@ -0,0 +1,9 @@
|
|
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
|
+
}
|
9
|
+
//# sourceMappingURL=changeset-provider.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"changeset-provider.d.ts","sourceRoot":"","sources":["../../src/component-platform/changeset-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,CACH,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,cAAc,EACtB,UAAU,EAAE,OAAO,CAAC,qBAAqB,CAAC,EAC1C,OAAO,EAAE,gBAAgB,KACxB,IAAI,CAAC;IAEV,MAAM,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAE9B,IAAI,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CACvD"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"component-configuration-api.d.ts","sourceRoot":"","sources":["../../src/component-platform/component-configuration-api.ts"],"names":[],"mappings":";AAOA,wBAaG"}
|
@@ -0,0 +1,39 @@
|
|
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
|
+
}
|
39
|
+
//# sourceMappingURL=component-controller.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"component-controller.d.ts","sourceRoot":"","sources":["../../src/component-platform/component-controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EAExB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,iBAAiB,CAAC;IAE3B,eAAe,CACb,UAAU,EAAE,OAAO,CAAC,uBAAuB,CAAC,EAC5C,OAAO,EAAE,gBAAgB,GACxB,IAAI,CAAC;IAER,YAAY,CACV,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EACtC,OAAO,EAAE,gBAAgB,GACxB,IAAI,CAAC;IAER,WAAW,CACT,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC,EACrC,OAAO,EAAE,gBAAgB,GACxB,IAAI,CAAC;IAER,OA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AAE,cAAc,EACtB,cAAc,UAAO;IAK/B,eAAe,CACb,UAAU,EAAE,OAAO,CAAC,uBAAuB,CAAC,EAC5C,OAAO,CAAC,EAAE,gBAAgB,GACzB,IAAI;IAWP,YAAY,CACV,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,EACtC,OAAO,CAAC,EAAE,gBAAgB,GACzB,IAAI;IAWP,WAAW,CACT,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,EACpC,OAAO,CAAC,EAAE,gBAAgB,GACzB,IAAI;IAWP,OAAO;CAMR"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { EventManager } from '@webprovisions/platform';
|
2
|
+
import { ComponentNode } from './component-node';
|
3
|
+
import { SwitchMap } from './component-platform';
|
4
|
+
export 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
|
+
}
|
19
|
+
//# sourceMappingURL=component-node-collection.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"component-node-collection.d.ts","sourceRoot":"","sources":["../../src/component-platform/component-node-collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAA0B,MAAM,kBAAkB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAOjD,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,qBAAa,uBAAuB;IAMzB,IAAI,EAAE,aAAa;IAC1B,OAAO,CAAC,QAAQ;IANlB,GAAG,EAAE,aAAa,EAAE,CAAM;IAC1B,OAAO,EAAE,aAAa,EAAE,CAAM;IAC9B,QAAQ,EAAE,aAAa,EAAE,CAAM;gBAGtB,IAAI,EAAE,aAAa,EAClB,QAAQ,EAAE,SAAS,EAC3B,MAAM,EAAE,YAAY;IA+BtB,KAAK,CAAC,KAAK,GAAE,eAAoB,GAAG,aAAa,EAAE;IAanD,GAAG,CAAC,EAAE,EAAE,MAAM;CAMf"}
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import { Container, EventManager } from '@webprovisions/platform';
|
2
|
+
import { Breakpoints } from '../types';
|
3
|
+
export type ComponentNodeEventData = {
|
4
|
+
node: ComponentNode;
|
5
|
+
};
|
6
|
+
export type RemoveChangeset = () => void;
|
7
|
+
export type ComponentNodeAttributes = {
|
8
|
+
tags: string[];
|
9
|
+
properties: ComponentNodeProperties;
|
10
|
+
context: ComponentNodeContext;
|
11
|
+
layout: ComponentNodeLayout;
|
12
|
+
};
|
13
|
+
export type ResolveComponentNodeProperties = (properties: ComponentNodeProperties) => Partial<ComponentNodeProperties> | void;
|
14
|
+
export type ResolveComponentNodeContext = (context: ComponentNodeContext) => Partial<ComponentNodeContext>;
|
15
|
+
export type ResolveComponentNodeLayout = (layout: ComponentNodeLayout) => Partial<ComponentNodeLayout>;
|
16
|
+
export type ComponentNodeSettings = {
|
17
|
+
tags?: string[];
|
18
|
+
properties?: ComponentNodeProperties | ResolveComponentNodeProperties;
|
19
|
+
context?: ComponentNodeContext | ResolveComponentNodeContext;
|
20
|
+
layout?: ComponentNodeLayout | ResolveComponentNodeLayout;
|
21
|
+
};
|
22
|
+
export type ComponentNodeProperties = {
|
23
|
+
[key: string]: any;
|
24
|
+
};
|
25
|
+
export type ComponentNodeContext = {
|
26
|
+
[key: string]: any;
|
27
|
+
};
|
28
|
+
export type ComponentNodeLayout = {
|
29
|
+
size?: Size;
|
30
|
+
indent?: number;
|
31
|
+
order?: number;
|
32
|
+
};
|
33
|
+
export type Size = number | 'full' | 'none';
|
34
|
+
export type UnmountComponentNode = () => void;
|
35
|
+
export type ChangesetOptions = {
|
36
|
+
breakpoints?: Breakpoints;
|
37
|
+
};
|
38
|
+
export 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
|
+
}
|
64
|
+
//# sourceMappingURL=component-node.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"component-node.d.ts","sourceRoot":"","sources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GAChC,8BAA8B,EAClC,OAAO,GAAE,gBAAqB,EAC9B,SAAS,CAAC,EAAE,OAAO,GAClB,eAAe;IAgBlB,WAAW,CACT,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,0BAA0B,EACjE,OAAO,GAAE,gBAAqB,EAC9B,SAAS,CAAC,EAAE,OAAO,GAClB,eAAe;IAiBlB,YAAY,CACV,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,2BAA2B,EACpE,OAAO,GAAE,gBAAqB,EAC9B,SAAS,CAAC,EAAE,OAAO,GAClB,eAAe;IAiBlB,WAAW,CAAC,MAAM,GAAE,MAAkB,GAAG,aAAa,EAAE;IAaxD,MAAM;IAMN,WAAW,CAAC,IAAI,EAAE,aAAa;CAchC"}
|
@@ -0,0 +1,55 @@
|
|
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 type MergeOptions = {
|
9
|
+
breakpoints?: string[];
|
10
|
+
};
|
11
|
+
export type SwitchMap = {
|
12
|
+
[id: string]: string;
|
13
|
+
};
|
14
|
+
export 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
|
+
}
|
55
|
+
//# sourceMappingURL=component-platform.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"component-platform.d.ts","sourceRoot":"","sources":["../../src/component-platform/component-platform.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,YAAY,EAEZ,MAAM,EACP,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAEL,gBAAgB,EAChB,aAAa,EAEb,qBAAqB,EACrB,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAEL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,UAAU,CACR,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAO,GACnC,aAAa;IAQhB,UAAU,IAAI,cAAc;IAI5B,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,GAAG,iBAAiB;IAI9D,KAAK,CAAC,IAAI,EAAE,aAAa,GAAG,eAAe;IAkD3C,mBAAmB,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,EAAE,qBAAqB;IAIrE,mBAAmB,CAAC,cAAc,EAAE,MAAM;IAI1C,OAAO;CAGR"}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { AbstractComponentController } from './component-controller';
|
2
|
+
import { ComponentNode } from './component-node';
|
3
|
+
import { ComponentPlatform } from './component-platform';
|
4
|
+
export 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
|
+
}
|
17
|
+
//# sourceMappingURL=component-query.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"component-query.d.ts","sourceRoot":"","sources":["../../src/component-platform/component-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,MAAM,kBAAkB,GAAG;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,qBAAa,cAAc;IACX,OAAO,CAAC,QAAQ;IAA4B,KAAK,EAAE,kBAAkB,EAAE;gBAA/D,QAAQ,EAAE,iBAAiB,EAAS,KAAK,GAAE,kBAAkB,EAAO;IAExF,KAAK,CAAC,IAAI,EAAE,aAAa;IAYzB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc;IAKpC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,cAAc;IAKlC,MAAM,IAAI,2BAA2B;CAGxC"}
|
@@ -0,0 +1,37 @@
|
|
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
|
+
type ComponentReference = string | [string, ...ComponentReferenceOverride[]];
|
6
|
+
type ComponentReferenceOverride = {
|
7
|
+
breakpoints?: Breakpoints;
|
8
|
+
tags?: string[];
|
9
|
+
context?: ComponentNodeContext;
|
10
|
+
properties?: ComponentNodeProperties;
|
11
|
+
layout?: ComponentNodeLayout;
|
12
|
+
};
|
13
|
+
export type NormalizedComponentReference = {
|
14
|
+
definitionId: string;
|
15
|
+
overrides: ComponentReferenceOverride[];
|
16
|
+
};
|
17
|
+
export declare const normalizeReference: (reference: ComponentReference) => NormalizedComponentReference;
|
18
|
+
export 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) => void;
|
35
|
+
export declare const createComponentModel: (platform: ComponentPlatform, settings: WidgetSettings) => EventSubscriptionCancellation;
|
36
|
+
export {};
|
37
|
+
//# sourceMappingURL=create-component-model.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"create-component-model.d.ts","sourceRoot":"","sources":["../../src/component-platform/create-component-model.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1F,OAAO,EACH,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,KAAK,kBAAkB,GAAG,MAAM,GAAG,CAAC,MAAM,EAAE,GAAG,0BAA0B,EAAE,CAAC,CAAC;AAE7E,KAAK,0BAA0B,GAAG;IAC9B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,0BAA0B,EAAE,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,kBAAkB,cAAe,kBAAkB,KAAG,4BAYlE,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IAClC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,WAAW,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAA;KAAE,CAAC;IACnD,KAAK,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,cAAc,aACb,iBAAiB,QACrB,aAAa,cACP,kBAAkB,EAAE;;;;YAGvB,MAAM,SAiFlB,CAAC;AAEF,eAAO,MAAM,oBAAoB,aACnB,iBAAiB,YACjB,cAAc,KACzB,6BA2BF,CAAC"}
|
@@ -0,0 +1,22 @@
|
|
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 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
|
+
}
|
22
|
+
//# sourceMappingURL=custom-component-handler.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"custom-component-handler.d.ts","sourceRoot":"","sources":["../../src/component-platform/custom-component-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACjF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAExE,MAAM,MAAM,qBAAqB,GAAG,CAChC,GAAG,EAAE,4BAA4B,EACjC,OAAO,EAAE;IACL,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,IAAI,EAAE,aAAa,CAAC;IACpB,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,WAAW,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAAA;KAAE,CAAC;IACnD,KAAK,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAAE,CAAC;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB,KACA,IAAI,CAAC;AAEV,qBAAa,sBAAsB;IAC/B,OAAO,CAAC,QAAQ,CAA4C;IAE5D,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,qBAAqB;IAI3C,GAAG,CAAC,IAAI,EAAE,MAAM;CAGnB"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { ComponentNode } from './component-node';
|
2
|
+
export type ComponentDescriptor = {
|
3
|
+
id: string;
|
4
|
+
type?: string;
|
5
|
+
name?: string;
|
6
|
+
branch: string;
|
7
|
+
};
|
8
|
+
export declare const asDescriptor: (node: ComponentNode, branch?: string) => ComponentDescriptor;
|
9
|
+
//# sourceMappingURL=descriptor.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"descriptor.d.ts","sourceRoot":"","sources":["../../src/component-platform/descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,MAAM,mBAAmB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,YAAY,SAAU,aAAa,WAAW,MAAM,KAAG,mBAOnE,CAAC"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Container } from '@webprovisions/platform';
|
2
|
+
import { ComponentNodeController } from './component-controller';
|
3
|
+
import { ComponentQuery } from './component-query';
|
4
|
+
export type ExtendComponentHandler = (controller: ComponentNodeController) => any;
|
5
|
+
export type ExtendComponentOptions = {
|
6
|
+
reuseController?: boolean;
|
7
|
+
};
|
8
|
+
export declare const extendComponent: (container: Container, typeOrQuery: string | ComponentQuery, handler: ExtendComponentHandler, ns?: string, options?: ExtendComponentOptions) => Promise<void>;
|
9
|
+
//# sourceMappingURL=extend-component.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"extend-component.d.ts","sourceRoot":"","sources":["../../src/component-platform/extend-component.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EAEV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAGjE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,MAAM,sBAAsB,GAAG,CACnC,UAAU,EAAE,uBAAuB,KAChC,GAAG,CAAC;AAET,MAAM,MAAM,sBAAsB,GAAG;IACnC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,eAAe,cACf,SAAS,eACP,MAAM,GAAG,cAAc,WAC3B,sBAAsB,OAC3B,MAAM,YACD,sBAAsB,KAC9B,QAAQ,IAAI,CA6Dd,CAAC"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
export { ActionsController } from './actions-controller';
|
2
|
+
export type { WatchActionDelegate } from './actions-controller';
|
3
|
+
export type { ChangesetProvider } from './changeset-provider';
|
4
|
+
export { default as componentConfigurationApi } from './component-configuration-api';
|
5
|
+
export { AbstractComponentController, ComponentNodeController } from './component-controller';
|
6
|
+
export { ComponentNode } from './component-node';
|
7
|
+
export type { ChangesetOptions, ComponentNodeAttributes, ComponentNodeContext, ComponentNodeLayout, ComponentNodeProperties, ComponentNodeSettings, Size, } from './component-node';
|
8
|
+
export { ComponentPlatform } from './component-platform';
|
9
|
+
export type { SwitchMap } from './component-platform';
|
10
|
+
export { ComponentQuery } from './component-query';
|
11
|
+
export type { ComponentQueryRule } from './component-query';
|
12
|
+
export { createChildren, createComponentModel } from './create-component-model';
|
13
|
+
export type { ComponentHandlerOptions, NormalizedComponentReference, } from './create-component-model';
|
14
|
+
export { asDescriptor } from './descriptor';
|
15
|
+
export type { ComponentDescriptor } from './descriptor';
|
16
|
+
export { extendComponent } from './extend-component';
|
17
|
+
export type { ExtendComponentHandler, ExtendComponentOptions } from './extend-component';
|
18
|
+
export { findComponent, findVisibleComponents, traverseComponents } from './queries';
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/component-platform/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AACrF,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAC9F,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EACR,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,qBAAqB,EACrB,IAAI,GACP,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,YAAY,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChF,YAAY,EACR,uBAAuB,EACvB,4BAA4B,GAC/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { ComponentNode } from './component-node';
|
2
|
+
import { SwitchMap } from './component-platform';
|
3
|
+
export declare const traverseComponents: (root: ComponentNode, switches: SwitchMap, fn: (node: ComponentNode) => boolean | void) => void;
|
4
|
+
export declare const findVisibleComponents: (root: ComponentNode, switches: SwitchMap) => ComponentNode[];
|
5
|
+
export declare const findComponent: (root: ComponentNode, switches: SwitchMap, fn: (node: ComponentNode) => boolean) => ComponentNode | undefined;
|
6
|
+
export declare const getAncestors: (node: ComponentNode) => ComponentNode[];
|
7
|
+
//# sourceMappingURL=queries.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/component-platform/queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAiBjD,eAAO,MAAM,kBAAkB,SACrB,aAAa,YACT,SAAS,aACR,aAAa,KAAK,OAAO,GAAG,IAAI,SAO9C,CAAC;AAEF,eAAO,MAAM,qBAAqB,SACxB,aAAa,YACT,SAAS,KACpB,aAAa,EAMf,CAAC;AAEF,eAAO,MAAM,aAAa,SAChB,aAAa,YACT,SAAS,aACR,aAAa,KAAK,OAAO,8BAUvC,CAAC;AAEF,eAAO,MAAM,YAAY,SAAU,aAAa,oBAW/C,CAAC"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { ComponentPlatform } from '.';
|
2
|
+
import { ComponentNode } from './component-node';
|
3
|
+
export type ProcessOptions = {
|
4
|
+
context?: boolean;
|
5
|
+
properties?: boolean;
|
6
|
+
layout?: boolean;
|
7
|
+
recursive?: boolean;
|
8
|
+
};
|
9
|
+
export type StateProcessor = (node: ComponentNode, options: ProcessOptions) => void;
|
10
|
+
export type ProcessResult = Map<ComponentNode, ProcessOptions>;
|
11
|
+
export type ProcessReportCallback = (report: ProcessResult) => void;
|
12
|
+
export declare const createStateProcessor: (platform: ComponentPlatform, callback: ProcessReportCallback) => StateProcessor;
|
13
|
+
//# sourceMappingURL=state-processor.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"state-processor.d.ts","sourceRoot":"","sources":["../../src/component-platform/state-processor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,GAAG,CAAC;AAEtC,OAAO,EACH,aAAa,EAIhB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,cAAc,GAAG;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;AAwDpF,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AAE/D,MAAM,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;AAEpE,eAAO,MAAM,oBAAoB,aACnB,iBAAiB,YACjB,qBAAqB,KAChC,cA+IF,CAAC"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { Logger } from '@telia-ace/widget-utilities';
|
2
|
+
import { Container, EventManager, EventSubscriptionCancellation } from '@webprovisions/platform';
|
3
|
+
export type ReactComponent = any | null;
|
4
|
+
export default class ComponentResolver {
|
5
|
+
aliases: Map<string, string>;
|
6
|
+
components: Map<string, any>;
|
7
|
+
events: EventManager;
|
8
|
+
logger: Logger;
|
9
|
+
constructor(container: Container);
|
10
|
+
getComponent(key: string): ReactComponent;
|
11
|
+
registerComponent(key: string, component: ReactComponent): EventSubscriptionCancellation;
|
12
|
+
registerResolver(key: string, fn: (component: ReactComponent) => void): EventSubscriptionCancellation;
|
13
|
+
registerAlias(alias: string, key: string): EventSubscriptionCancellation;
|
14
|
+
}
|
15
|
+
//# sourceMappingURL=component-resolver.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"component-resolver.d.ts","sourceRoot":"","sources":["../src/component-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EACL,SAAS,EACT,YAAY,EACZ,6BAA6B,EAE9B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,cAAc,GAAG,GAAG,GAAG,IAAI,CAAC;AAExC,MAAM,CAAC,OAAO,OAAO,iBAAiB;IACpC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAa;IACzC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAa;IACzC,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,SAAgB;gBAEV,SAAS,EAAE,SAAS;IAKhC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc;IAoBzC,iBAAiB,CACf,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,cAAc,GACxB,6BAA6B;IAUhC,gBAAgB,CACd,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,IAAI,GACtC,6BAA6B;IAYhC,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,6BAA6B;CASzE"}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import { BootstrappedImplementationConfiguration } from '@webprovisions/bootstrapping';
|
2
|
+
import { ConfigurationApiDefinition, Environment as EnvironmentBase, WidgetSelector } from '@webprovisions/platform';
|
3
|
+
import Implementation from './implementation';
|
4
|
+
export interface RuntimeConfiguration {
|
5
|
+
/**
|
6
|
+
* Extensions for the configuration API (optional).
|
7
|
+
*/
|
8
|
+
configurationApiExtensions?: ConfigurationApiDefinition[];
|
9
|
+
}
|
10
|
+
/**
|
11
|
+
* The widget runtime.
|
12
|
+
*/
|
13
|
+
export default class Environment extends EnvironmentBase {
|
14
|
+
/**
|
15
|
+
* Version of the widget runtime.
|
16
|
+
*/
|
17
|
+
static version: string;
|
18
|
+
constructor(name: string, configurationApiExtensions?: ConfigurationApiDefinition[]);
|
19
|
+
createImplementation(configuration: BootstrappedImplementationConfiguration): Implementation;
|
20
|
+
/**
|
21
|
+
* Performs navigation for widgets matching the specified selector by invoking a
|
22
|
+
* 'navigate' command.
|
23
|
+
* @param selector Widget selector matching the widget(s) to perform navigation on.
|
24
|
+
* @param route Route name.
|
25
|
+
* @param params Route params.
|
26
|
+
*/
|
27
|
+
navigate(selector: WidgetSelector, route: string, params: {
|
28
|
+
[key: string]: string;
|
29
|
+
}): void;
|
30
|
+
/**
|
31
|
+
* Creates a runtime based on provided configuration.
|
32
|
+
* @param configuration Runtime configuration.
|
33
|
+
*/
|
34
|
+
static create(configuration?: RuntimeConfiguration): Environment;
|
35
|
+
/**
|
36
|
+
* Creates a widget runtime based on provided configuration and retains configuration handlers
|
37
|
+
* registered on global context. Use this factory to fully support the default embed script.
|
38
|
+
* Will return any existing widget runtime if available.
|
39
|
+
* @param configuration Runtime configuration.
|
40
|
+
* @param global Object to read configuration handlers from (default: window).
|
41
|
+
*/
|
42
|
+
static createFromGlobal(globalInstance: any, configuration?: RuntimeConfiguration): Environment;
|
43
|
+
/**
|
44
|
+
* Determines whether the specified object is a valid widget runtime.
|
45
|
+
* @param obj Object to compare.
|
46
|
+
*/
|
47
|
+
static isRuntime(obj: any): boolean;
|
48
|
+
}
|
49
|
+
//# sourceMappingURL=environment.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uCAAuC,EAExC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,0BAA0B,EAC1B,WAAW,IAAI,eAAe,EAE9B,cAAc,EACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAG9C,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,0BAA0B,CAAC,EAAE,0BAA0B,EAAE,CAAC;CAC3D;AAED;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,eAAe;IACtD;;OAEG;IACH,OAAgB,OAAO,EAAE,MAAM,CAA0C;gBAGvE,IAAI,EAAE,MAAM,EACZ,0BAA0B,GAAE,0BAA0B,EAAO;IAetD,oBAAoB,CAC3B,aAAa,EAAE,uCAAuC,GACrD,cAAc;IAQjB;;;;;;OAMG;IACH,QAAQ,CACN,QAAQ,EAAE,cAAc,EACxB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IAOnC;;;OAGG;WACa,MAAM,CACpB,aAAa,GAAE,oBAAyB,GACvC,WAAW;IAOd;;;;;;OAMG;IACH,MAAM,CAAC,gBAAgB,CACrB,cAAc,EAAE,GAAG,EACnB,aAAa,GAAE,oBAAyB,GACvC,WAAW;IAoBd;;;OAGG;IACH,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO;CAapC"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { EventListener, EventManager, EventSubscriptionCancellation } from '@webprovisions/platform';
|
2
|
+
export type SubscribeDelegate = (type: string, listener: EventListener) => void;
|
3
|
+
/**
|
4
|
+
* Creates s subscriber for the specified `EventManager` and provides a single cancellation
|
5
|
+
* function for all registered subscriptions.
|
6
|
+
*/
|
7
|
+
export declare const createEventSubscriber: (events: EventManager) => [SubscribeDelegate, EventSubscriptionCancellation];
|
8
|
+
//# sourceMappingURL=event-subscriber.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"event-subscriber.d.ts","sourceRoot":"","sources":["../src/event-subscriber.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,aAAa,EACb,YAAY,EACZ,6BAA6B,EAChC,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;AAEhF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,WACtB,YAAY,KACrB,CAAC,iBAAiB,EAAE,6BAA6B,CAenD,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"implementation.d.ts","sourceRoot":"","sources":["../src/implementation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE/E;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,kBAAkB;IAC1D,QAAQ,EAAE,MAAM,EAAE,CAAM;CAC3B"}
|