@transcommerce/cwm-shared 1.1.87 → 1.1.88

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.
@@ -1,3 +1,6 @@
1
+ import { ImageStyle } from './style/image-style';
2
+ import { ColorStyle } from './style/color-style';
3
+ import { TextStyle } from './style/text-style';
1
4
  export type Slide = {
2
5
  image: string;
3
6
  title: string;
@@ -6,7 +9,15 @@ export type Slide = {
6
9
  textColor: 'red' | 'green' | 'blue' | 'yellow' | 'black' | 'white';
7
10
  backgroundColor: 'red' | 'green' | 'blue' | 'yellow' | 'black' | 'white';
8
11
  };
12
+ export declare class FooterSlide {
13
+ image: ImageStyle;
14
+ title: TextStyle;
15
+ description: TextStyle;
16
+ highlighted: boolean;
17
+ backgroundColor: ColorStyle;
18
+ }
9
19
  export declare const DEFAULT_SLIDE: Slide;
20
+ export declare const DEFAULT_FOOTER_SLIDE: FooterSlide;
10
21
  export declare const SLIDE_SCHEMA: {
11
22
  type: string;
12
23
  title: string;
@@ -52,3 +63,35 @@ export declare const SLIDE_SCHEMA: {
52
63
  };
53
64
  required: string[];
54
65
  };
66
+ export declare const FOOTER_SLIDE_SCHEMA: {
67
+ type: string;
68
+ title: string;
69
+ properties: {
70
+ image: {
71
+ type: string;
72
+ title: string;
73
+ description: string;
74
+ };
75
+ title: {
76
+ type: string;
77
+ title: string;
78
+ description: string;
79
+ };
80
+ description: {
81
+ type: string;
82
+ title: string;
83
+ description: string;
84
+ };
85
+ highlighted: {
86
+ type: string;
87
+ title: string;
88
+ description: string;
89
+ };
90
+ backgroundColor: {
91
+ type: string;
92
+ title: string;
93
+ description: string;
94
+ };
95
+ };
96
+ required: string[];
97
+ };
@@ -2,7 +2,7 @@ import { NamedColors } from './named-colors';
2
2
  import { RgbaColorStyle } from './rgba-color-style';
3
3
  import { HexColor } from './hex-color';
4
4
  import { OnStyle } from './on-style';
5
- import { ngStyleItem } from './ng-style-item';
5
+ import { ngStyleAttribute } from './ng-style-attribute';
6
6
  export type ColorValue = NamedColors | HexColor | RgbaColorStyle;
7
7
  /**
8
8
  * A unified Color class that can represent colors as Named, Hex, or RGBA formats
@@ -11,7 +11,7 @@ export type ColorValue = NamedColors | HexColor | RgbaColorStyle;
11
11
  export declare class ColorStyle implements OnStyle {
12
12
  private _value;
13
13
  constructor(value: ColorValue);
14
- ngOnStyle(ngStyle: ngStyleItem): ngStyleItem;
14
+ ngOnStyle(ngStyle: ngStyleAttribute): ngStyleAttribute;
15
15
  /**
16
16
  * Gets the original color value
17
17
  */
@@ -1,8 +1,27 @@
1
1
  import { OnStyle } from './on-style';
2
- import { ngStyleItem } from './ng-style-item';
2
+ import { ngStyleAttribute } from './ng-style-attribute';
3
3
  export declare class CoordinatesStyle implements OnStyle {
4
4
  top: number | string | any | undefined;
5
5
  left: number | string | any | undefined;
6
- ngOnStyle(ngStyle: ngStyleItem): ngStyleItem;
6
+ ngOnStyle(ngStyle: ngStyleAttribute): ngStyleAttribute;
7
7
  }
8
8
  export declare const DEFAULT_COORDINATES: CoordinatesStyle;
9
+ export declare const COORDINATES_STYLE_SCHEMA: {
10
+ type: string;
11
+ title: string;
12
+ properties: {
13
+ top: {
14
+ type: string;
15
+ title: string;
16
+ description: string;
17
+ default: number;
18
+ };
19
+ left: {
20
+ type: string;
21
+ title: string;
22
+ description: string;
23
+ default: number;
24
+ };
25
+ };
26
+ required: string[];
27
+ };
@@ -1,11 +1,48 @@
1
1
  import { OnStyle } from './on-style';
2
- import { ngStyleItem } from './ng-style-item';
2
+ import { ngStyleAttribute } from './ng-style-attribute';
3
3
  export declare class FontStyle implements OnStyle {
4
4
  family: string;
5
5
  size: number;
6
6
  italic: boolean;
7
7
  bold: boolean;
8
8
  underline: boolean;
9
- ngOnStyle(ngStyle: ngStyleItem): ngStyleItem;
9
+ ngOnStyle(ngStyle: ngStyleAttribute): ngStyleAttribute;
10
10
  }
11
11
  export declare const DEFAULT_FONT: FontStyle;
12
+ export declare const FONT_STYLE_SCHEMA: {
13
+ type: string;
14
+ title: string;
15
+ properties: {
16
+ family: {
17
+ type: string;
18
+ title: string;
19
+ description: string;
20
+ default: string;
21
+ };
22
+ size: {
23
+ type: string;
24
+ title: string;
25
+ description: string;
26
+ default: number;
27
+ };
28
+ italic: {
29
+ type: string;
30
+ title: string;
31
+ description: string;
32
+ default: boolean;
33
+ };
34
+ bold: {
35
+ type: string;
36
+ title: string;
37
+ description: string;
38
+ default: boolean;
39
+ };
40
+ underline: {
41
+ type: string;
42
+ title: string;
43
+ description: string;
44
+ default: boolean;
45
+ };
46
+ };
47
+ required: string[];
48
+ };
@@ -120,3 +120,11 @@ export declare function hexToNamedColor(hexColor: HexColor): string | null;
120
120
  * @returns Named color string or null if no close match found
121
121
  */
122
122
  export declare function rgbaToNamedColor(rgba: RgbaColorStyle): string | null;
123
+ export declare const DEFAULT_HEX_COLOR: HexColor;
124
+ export declare const HEX_COLOR_SCHEMA: {
125
+ type: string;
126
+ title: string;
127
+ description: string;
128
+ pattern: string;
129
+ default: `#${string}`;
130
+ };
@@ -2,12 +2,66 @@ import { CoordinatesStyle } from './coordinates-style';
2
2
  import { Justifications } from './justifications';
3
3
  import { SizeStyle } from "./size-style";
4
4
  import { OnStyle } from './on-style';
5
- import { ngStyleItem } from './ng-style-item';
5
+ import { ngStyleAttribute } from './ng-style-attribute';
6
6
  export declare class ImageStyle implements OnStyle {
7
7
  href: string | URL;
8
8
  justification: Justifications;
9
9
  size: SizeStyle | undefined;
10
10
  coordinates: CoordinatesStyle | undefined;
11
- ngOnStyle(ngStyle: ngStyleItem): ngStyleItem;
11
+ ngOnStyle(ngStyle: ngStyleAttribute): ngStyleAttribute;
12
12
  }
13
- export declare const DEFAULT_IMAGE: ImageStyle;
13
+ export declare const DEFAULT_IMAGE_STYLE: ImageStyle;
14
+ export declare const IMAGE_STYLE_SCHEMA: {
15
+ type: string;
16
+ title: string;
17
+ properties: {
18
+ href: {
19
+ type: string;
20
+ title: string;
21
+ description: string;
22
+ };
23
+ justification: {
24
+ enum: Justifications[];
25
+ type: string;
26
+ title: string;
27
+ description: string;
28
+ };
29
+ size: {
30
+ type: string;
31
+ title: string;
32
+ description: string;
33
+ properties: {
34
+ width: {
35
+ type: string[];
36
+ title: string;
37
+ description: string;
38
+ };
39
+ height: {
40
+ type: string[];
41
+ title: string;
42
+ description: string;
43
+ };
44
+ };
45
+ required: string[];
46
+ };
47
+ coordinates: {
48
+ type: string;
49
+ title: string;
50
+ description: string;
51
+ properties: {
52
+ top: {
53
+ type: string[];
54
+ title: string;
55
+ description: string;
56
+ };
57
+ left: {
58
+ type: string[];
59
+ title: string;
60
+ description: string;
61
+ };
62
+ };
63
+ required: string[];
64
+ };
65
+ };
66
+ required: string[];
67
+ };
@@ -4,3 +4,11 @@ export declare enum Justifications {
4
4
  Center = "center",
5
5
  Fully = "fully"
6
6
  }
7
+ export declare const DEFAULT_JUSTIFICATION = Justifications.Left;
8
+ export declare const JUSTIFICATIONS_SCHEMA: {
9
+ type: string;
10
+ title: string;
11
+ description: string;
12
+ enum: Justifications[];
13
+ default: Justifications;
14
+ };
@@ -170,3 +170,11 @@ export declare function isNamedColor(colorName: string): boolean;
170
170
  * @returns Array of all CSS named color names
171
171
  */
172
172
  export declare function getNamedColors(): string[];
173
+ export declare const DEFAULT_NAMED_COLOR: NamedColors;
174
+ export declare const NAMED_COLOR_SCHEMA: {
175
+ type: string;
176
+ title: string;
177
+ description: string;
178
+ enum: string[];
179
+ default: NamedColors.Black;
180
+ };
@@ -0,0 +1,14 @@
1
+ export type ngStyleAttribute = {
2
+ [key: string]: string | number | null;
3
+ };
4
+ export declare const DEFAULT_NG_STYLE: ngStyleAttribute;
5
+ export declare const NG_STYLE_SCHEMA: {
6
+ type: string;
7
+ title: string;
8
+ description: string;
9
+ additionalProperties: {
10
+ type: string[];
11
+ title: string;
12
+ description: string;
13
+ };
14
+ };
@@ -1,4 +1,4 @@
1
- import { ngStyleItem } from './ng-style-item';
1
+ import { ngStyleAttribute } from './ng-style-attribute';
2
2
  export interface OnStyle {
3
- ngOnStyle(ngStyle: ngStyleItem): ngStyleItem;
3
+ ngOnStyle(ngStyle: ngStyleAttribute): ngStyleAttribute;
4
4
  }
@@ -1,9 +1,9 @@
1
1
  import { HexColor } from './hex-color';
2
2
  import { NamedColors } from './named-colors';
3
3
  import { OnStyle } from './on-style';
4
- import { ngStyleItem } from './ng-style-item';
4
+ import { ngStyleAttribute } from './ng-style-attribute';
5
5
  export declare class RgbaColorStyle implements OnStyle {
6
- ngOnStyle(ngStyle: ngStyleItem): ngStyleItem;
6
+ ngOnStyle(ngStyle: ngStyleAttribute): ngStyleAttribute;
7
7
  r: number;
8
8
  g: number;
9
9
  b: number;
@@ -14,3 +14,43 @@ export declare class RgbaColorStyle implements OnStyle {
14
14
  toCssString(): string;
15
15
  toNamedColor(): string | null;
16
16
  }
17
+ export declare const DEFAULT_RGBA_COLOR_STYLE: RgbaColorStyle;
18
+ export declare const RGBA_COLOR_STYLE_SCHEMA: {
19
+ type: string;
20
+ title: string;
21
+ properties: {
22
+ r: {
23
+ type: string;
24
+ title: string;
25
+ description: string;
26
+ minimum: number;
27
+ maximum: number;
28
+ default: number;
29
+ };
30
+ g: {
31
+ type: string;
32
+ title: string;
33
+ description: string;
34
+ minimum: number;
35
+ maximum: number;
36
+ default: number;
37
+ };
38
+ b: {
39
+ type: string;
40
+ title: string;
41
+ description: string;
42
+ minimum: number;
43
+ maximum: number;
44
+ default: number;
45
+ };
46
+ a: {
47
+ type: string;
48
+ title: string;
49
+ description: string;
50
+ minimum: number;
51
+ maximum: number;
52
+ default: number;
53
+ };
54
+ };
55
+ required: string[];
56
+ };
@@ -1,8 +1,25 @@
1
1
  import { OnStyle } from './on-style';
2
- import { ngStyleItem } from './ng-style-item';
2
+ import { ngStyleAttribute } from './ng-style-attribute';
3
3
  export declare class SizeStyle implements OnStyle {
4
- ngOnStyle(ngStyle: ngStyleItem): ngStyleItem;
4
+ ngOnStyle(ngStyle: ngStyleAttribute): ngStyleAttribute;
5
5
  width: number | string | any | undefined;
6
6
  height: number | string | any | undefined;
7
7
  }
8
- export declare const DEFAULT_SIZE: SizeStyle;
8
+ export declare const DEFAULT_SIZE_STYLE: SizeStyle;
9
+ export declare const SIZE_STYLE_SCHEMA: {
10
+ type: string;
11
+ title: string;
12
+ properties: {
13
+ width: {
14
+ type: string[];
15
+ title: string;
16
+ description: string;
17
+ };
18
+ height: {
19
+ type: string[];
20
+ title: string;
21
+ description: string;
22
+ };
23
+ };
24
+ required: string[];
25
+ };
@@ -2,7 +2,7 @@ import { ColorStyle } from './color-style';
2
2
  import { FontStyle } from './font-style';
3
3
  import { ImageStyle } from './image-style';
4
4
  import { OnStyle } from './on-style';
5
- import { ngStyleItem } from './ng-style-item';
5
+ import { ngStyleAttribute } from './ng-style-attribute';
6
6
  export declare class TextStyle implements OnStyle {
7
7
  font: FontStyle | undefined;
8
8
  textColor: ColorStyle | undefined;
@@ -10,6 +10,69 @@ export declare class TextStyle implements OnStyle {
10
10
  watermark: string | undefined;
11
11
  image: ImageStyle | undefined;
12
12
  value: string;
13
- ngOnStyle(ngStyle: ngStyleItem): ngStyleItem;
13
+ ngOnStyle(ngStyle: ngStyleAttribute): ngStyleAttribute;
14
14
  }
15
15
  export declare const DEFAULT_TEXT_STYLE: TextStyle;
16
+ export declare const TEXT_STYLE_SCHEMA: {
17
+ type: string;
18
+ title: string;
19
+ properties: {
20
+ value: {
21
+ type: string;
22
+ title: string;
23
+ description: string;
24
+ };
25
+ font: {
26
+ type: string;
27
+ title: string;
28
+ description: string;
29
+ properties: {
30
+ family: {
31
+ type: string;
32
+ title: string;
33
+ description: string;
34
+ };
35
+ size: {
36
+ type: string[];
37
+ title: string;
38
+ description: string;
39
+ };
40
+ weight: {
41
+ type: string[];
42
+ title: string;
43
+ description: string;
44
+ };
45
+ style: {
46
+ type: string;
47
+ title: string;
48
+ description: string;
49
+ };
50
+ decoration: {
51
+ type: string;
52
+ title: string;
53
+ description: string;
54
+ };
55
+ };
56
+ };
57
+ textColor: {
58
+ type: string;
59
+ title: string;
60
+ description: string;
61
+ };
62
+ backgroundColor: {
63
+ type: string;
64
+ title: string;
65
+ description: string;
66
+ };
67
+ watermark: {
68
+ type: string;
69
+ title: string;
70
+ description: string;
71
+ };
72
+ image: {
73
+ type: string;
74
+ title: string;
75
+ description: string;
76
+ };
77
+ };
78
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transcommerce/cwm-shared",
3
- "version": "1.1.87",
3
+ "version": "1.1.88",
4
4
  "engines": {
5
5
  "node": ">=18.0.0 <21.0.0"
6
6
  },
package/public-api.d.ts CHANGED
@@ -23,7 +23,7 @@ export * from './lib/models/style/font-style';
23
23
  export * from './lib/models/style/hex-color';
24
24
  export * from './lib/models/style/image-style';
25
25
  export * from './lib/models/style/justifications';
26
- export * from './lib/models/style/ng-style-item';
26
+ export * from './lib/models/style/ng-style-attribute';
27
27
  export * from './lib/models/style/on-style';
28
28
  export * from './lib/models/style/rgba-color-style';
29
29
  export * from './lib/models/style/size-style';
@@ -1,3 +0,0 @@
1
- export type ngStyleItem = {
2
- [key: string]: string | number | null;
3
- };