@telia-ace/widget-core 0.0.1

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/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "@telia-ace/widget-core",
3
+ "version": "0.0.1",
4
+ "dependencies": {
5
+ "@webprovisions/platform": "^1.1.4",
6
+ "@webprovisions/bootstrapping": "^1.0.14",
7
+ "@telia-ace/widget-utilities": "*"
8
+ },
9
+ "main": "./index.js",
10
+ "module": "./index.mjs",
11
+ "typings": "./index.d.ts"
12
+ }
package/plugin.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { Container, Plugin as PluginBase } from '@webprovisions/platform';
2
+
3
+ /**
4
+ * Base class for a widget plugin.
5
+ */
6
+ export default class Plugin extends PluginBase {
7
+ constructor(container: Container, settings?: any);
8
+ }
@@ -0,0 +1,87 @@
1
+ import { ComponentNodeLayout } from '../component-platform';
2
+
3
+ export type ComponentSettings = {
4
+ type: string;
5
+ context?: Context;
6
+ properties?: Properties;
7
+ layout?: ComponentNodeLayout;
8
+ tags?: string[];
9
+ children?: ComponentReference[];
10
+ };
11
+ declare enum HistoryMode {
12
+ scopedHash = "scopedHash",
13
+ hash = "hash",
14
+ browser = "browser",
15
+ memory = "memory"
16
+ }
17
+ export type RoutingSettings = {
18
+ initialPath: string;
19
+ mode: HistoryMode;
20
+ basePath?: string;
21
+ };
22
+ export type ComponentReference = string | [string, ...ComponentReferenceOverride[]];
23
+ export type Properties = {
24
+ [key: string]: any;
25
+ };
26
+ export type Context = {
27
+ [key: string]: any;
28
+ };
29
+ export type ViewDefinition = {
30
+ path: string | string[];
31
+ entry: ComponentReference;
32
+ };
33
+ export type Breakpoints = 'all' | string[];
34
+ export type ComponentReferenceOverride = {
35
+ breakpoints?: Breakpoints;
36
+ size?: number | 'full' | 'none';
37
+ indent?: number;
38
+ tags?: string[];
39
+ context?: Context;
40
+ properties?: Properties;
41
+ };
42
+ export type ComponentDefinitionMap = {
43
+ [name: string]: ComponentSettings;
44
+ };
45
+ export type WidgetSettings = {
46
+ data: {
47
+ projection: string;
48
+ site?: 'current' | 'referrer';
49
+ forceHttps?: boolean;
50
+ };
51
+ components: ComponentDefinitionMap;
52
+ entry: ComponentReference;
53
+ breakpoints: {
54
+ [name: string]: string;
55
+ };
56
+ routing: RoutingSettings;
57
+ views: {
58
+ [name: string]: ViewDefinition;
59
+ };
60
+ integrationResources: {
61
+ path: string;
62
+ mediaQueriesSupported: boolean;
63
+ }[];
64
+ trigger?: {
65
+ symbol?: Symbol;
66
+ label?: string;
67
+ action?: string;
68
+ };
69
+ activate?: boolean | null;
70
+ plugins?: {
71
+ [key: string]: any;
72
+ };
73
+ };
74
+ export type MinMax = {
75
+ min: string;
76
+ max: string;
77
+ };
78
+ type Symbol = {
79
+ type: 'Uri' | 'Svg' | 'FontAwesome' | 'Text' | string;
80
+ content: string;
81
+ };
82
+ export declare enum WidgetRenderState {
83
+ open = "open",
84
+ closed = "closed",
85
+ hidden = "hidden"
86
+ }
87
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './configuration';
2
+ export * from './ui';
package/types/ui.d.ts ADDED
@@ -0,0 +1,48 @@
1
+ export type Theme = {
2
+ gap: string;
3
+ accessibility: {
4
+ border: string;
5
+ colors: {
6
+ inactiveText: string;
7
+ activeText: string;
8
+ };
9
+ };
10
+ border: string;
11
+ borderRadius: string;
12
+ boxShadow: string;
13
+ inputBorder: string;
14
+ colors: {
15
+ warning: string;
16
+ accent: string;
17
+ link: string;
18
+ primary: string;
19
+ text: string;
20
+ textLight: string;
21
+ };
22
+ fonts: {
23
+ type: string;
24
+ base: string;
25
+ small: string;
26
+ normal: string;
27
+ medium: string;
28
+ large: string;
29
+ huge: string;
30
+ };
31
+ sizes: {
32
+ cardinal: number;
33
+ small: string;
34
+ normal: string;
35
+ medium: string;
36
+ large: string;
37
+ };
38
+ typographyVariantMapping?: {
39
+ h1: 'h1';
40
+ h2: 'h2';
41
+ h3: 'h3';
42
+ h4: 'h4';
43
+ h5: 'h5';
44
+ h6: 'h6';
45
+ p: 'p';
46
+ span: 'span';
47
+ };
48
+ };
package/version.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ declare const _default: "#____version____#";
2
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { Container, WidgetType as WidgetTypeBase } from '@webprovisions/platform';
2
+
3
+ /**
4
+ * Base class for a widget.
5
+ */
6
+ export default class WidgetType extends WidgetTypeBase {
7
+ constructor(container: Container);
8
+ }