sdui-web 0.2.0 → 0.4.0

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/dist/index.d.cts CHANGED
@@ -1,16 +1,69 @@
1
+ type ComponentType = 'text' | 'image' | 'box' | 'column' | 'row' | 'lazy_column';
2
+ type AlignmentType = 'top_start' | 'top_center' | 'top_end' | 'center_start' | 'center' | 'center_end' | 'bottom_start' | 'bottom_center' | 'bottom_end';
3
+ type FontWeightType = 'bold' | 'medium' | 'normal' | 'semi_bold';
4
+ type SizeUnitType = 'dp' | 'match_parent' | 'wrap_content';
5
+ type BackgroundColorType = 'single' | 'vertical_gradient' | 'horizontal_gradient' | 'linear_gradient';
6
+ type ContentScaleType = 'fit' | 'crop' | 'fill_height' | 'fill_width' | 'fill_bounds' | 'inside' | 'none';
7
+ type TextAlignType = 'left' | 'right' | 'center' | 'justify' | 'start' | 'end' | 'unspecified';
8
+ type TextOverflowType = 'none' | 'ellipsis';
9
+ type HorizontalAlignmentType = 'start' | 'end' | 'center_horizontally';
10
+ type VerticalAlignmentType = 'top' | 'bottom' | 'center_vertically';
11
+ type HorizontalArrangementType = 'start' | 'center' | 'end' | 'space_between' | 'space_evenly' | 'space_around' | 'spaced_by';
12
+ type VerticalArrangementType = 'top' | 'center' | 'bottom' | 'space_evenly' | 'space_between' | 'space_around' | 'spaced_by';
1
13
  type Theme = 'light' | 'dark';
2
- interface SduiScreen {
3
- schemaVersion?: string;
4
- root: SduiComponent;
14
+ interface ColorModel {
15
+ light?: string;
16
+ dark?: string;
5
17
  }
6
- interface SduiComponent {
7
- type: string;
8
- properties?: PropertiesModel;
9
- children?: SduiComponent[];
18
+ interface SizeModel {
19
+ value?: number;
20
+ unit?: SizeUnitType;
10
21
  }
11
- type PropertiesModel = TextUiProperties | ImageUiProperties | BoxUiProperties | ColumnUiProperties | RowUiProperties | LazyColumnUiProperties | DefaultUiProperties;
12
- interface DefaultUiProperties {
13
- modifier?: DefaultUiModifier;
22
+ interface SpacingModel {
23
+ top?: number;
24
+ bottom?: number;
25
+ start?: number;
26
+ end?: number;
27
+ }
28
+ interface ActionModel {
29
+ type?: string;
30
+ params?: Record<string, string>;
31
+ }
32
+ interface BackgroundColorModel {
33
+ colors?: ColorModel[];
34
+ type?: BackgroundColorType;
35
+ }
36
+ interface HorizontalArrangementModel {
37
+ type?: HorizontalArrangementType;
38
+ spacing?: number;
39
+ }
40
+ interface VerticalArrangementModel {
41
+ type?: VerticalArrangementType;
42
+ spacing?: number;
43
+ }
44
+ interface ModifierBase {
45
+ alignment?: string;
46
+ weight?: number;
47
+ action?: ActionModel;
48
+ }
49
+ interface TextUiModifier extends ModifierBase {
50
+ width?: SizeModel;
51
+ margin?: SpacingModel;
52
+ }
53
+ interface ContainerUiModifier extends ModifierBase {
54
+ backgroundColor?: BackgroundColorModel;
55
+ width?: SizeModel;
56
+ height?: SizeModel;
57
+ padding?: SpacingModel;
58
+ margin?: SpacingModel;
59
+ aspectRatio?: number;
60
+ }
61
+ interface ImageUiModifier extends ModifierBase {
62
+ width?: SizeModel;
63
+ height?: SizeModel;
64
+ padding?: SpacingModel;
65
+ margin?: SpacingModel;
66
+ aspectRatio?: number;
14
67
  }
15
68
  interface TextUiProperties {
16
69
  modifier?: TextUiModifier;
@@ -42,87 +95,27 @@ interface ColumnUiProperties {
42
95
  }
43
96
  interface RowUiProperties {
44
97
  modifier?: ContainerUiModifier;
45
- verticalAlignment?: VerticalAlignmentType;
46
98
  horizontalArrangement?: HorizontalArrangementModel;
99
+ verticalAlignment?: VerticalAlignmentType;
47
100
  canScroll?: boolean;
48
101
  }
49
102
  interface LazyColumnUiProperties {
50
103
  modifier?: ContainerUiModifier;
51
104
  verticalArrangement?: VerticalArrangementModel;
52
105
  }
53
- interface ModifierBase {
54
- alignment?: string;
55
- weight?: number;
56
- action?: ActionModel;
57
- }
58
- interface DefaultUiModifier extends ModifierBase {
59
- }
60
- interface TextUiModifier extends ModifierBase {
61
- width?: SizeModel;
62
- margin?: SpacingModel;
63
- }
64
- interface ContainerUiModifier extends ModifierBase {
65
- backgroundColor?: BackgroundColorModel;
66
- width?: SizeModel;
67
- height?: SizeModel;
68
- padding?: SpacingModel;
69
- margin?: SpacingModel;
70
- aspectRatio?: number;
71
- }
72
- interface ImageUiModifier extends ModifierBase {
73
- width?: SizeModel;
74
- height?: SizeModel;
75
- padding?: SpacingModel;
76
- margin?: SpacingModel;
77
- aspectRatio?: number;
78
- }
79
- interface ColorModel {
80
- light?: string;
81
- dark?: string;
82
- }
83
- interface SizeModel {
84
- value?: number;
85
- unit?: SizeUnitType;
86
- }
87
- interface SpacingModel {
88
- top?: number;
89
- bottom?: number;
90
- start?: number;
91
- end?: number;
92
- }
93
- interface ActionModel {
94
- type?: ActionType;
95
- params?: ActionParams;
96
- }
97
- interface ActionParams {
98
- route?: string;
99
- args?: Record<string, string>;
100
- }
101
- interface BackgroundColorModel {
102
- colors?: ColorModel[];
103
- type?: BackgroundColorType;
106
+ interface DefaultUiProperties {
107
+ modifier?: ModifierBase;
104
108
  }
105
- interface HorizontalArrangementModel {
106
- type?: HorizontalArrangementType;
107
- spacing?: number;
109
+ type PropertiesModel = TextUiProperties | ImageUiProperties | BoxUiProperties | ColumnUiProperties | RowUiProperties | LazyColumnUiProperties | DefaultUiProperties;
110
+ interface SduiComponent {
111
+ type: string;
112
+ properties?: PropertiesModel;
113
+ children?: SduiComponent[];
108
114
  }
109
- interface VerticalArrangementModel {
110
- type?: VerticalArrangementType;
111
- spacing?: number;
115
+ interface SduiScreen {
116
+ schemaVersion?: string;
117
+ root: SduiComponent;
112
118
  }
113
- type ActionType = 'navigate';
114
- type FontWeightType = 'bold' | 'medium' | 'normal' | 'semi_bold';
115
- type TextAlignType = 'left' | 'right' | 'center' | 'justify' | 'start' | 'end' | 'unspecified';
116
- type TextOverflowType = 'none' | 'ellipsis';
117
- type ContentScaleType = 'fit' | 'crop' | 'fill_height' | 'fill_width' | 'fill_bounds' | 'inside' | 'none';
118
- type SizeUnitType = 'dp' | 'match_parent' | 'wrap_content';
119
- type AlignmentType = 'top_start' | 'top_center' | 'top_end' | 'center_start' | 'center' | 'center_end' | 'bottom_start' | 'bottom_center' | 'bottom_end';
120
- type HorizontalAlignmentType = 'start' | 'end' | 'center_horizontally';
121
- type VerticalAlignmentType = 'top' | 'bottom' | 'center_vertically';
122
- type HorizontalArrangementType = 'start' | 'center' | 'end' | 'space_between' | 'space_evenly' | 'space_around' | 'spaced_by';
123
- type VerticalArrangementType = 'top' | 'center' | 'bottom' | 'space_evenly' | 'space_between' | 'space_around' | 'spaced_by';
124
- type BackgroundColorType = 'single' | 'vertical_gradient' | 'linear_gradient' | 'horizontal_gradient';
125
-
126
119
  type PropertyType = 'string' | 'number' | 'boolean' | 'enum' | 'color' | 'object';
127
120
  interface PropertyDescriptor {
128
121
  name: string;
@@ -140,6 +133,7 @@ interface ComponentMeta {
140
133
  acceptsChildren: boolean;
141
134
  properties: PropertyDescriptor[];
142
135
  }
136
+
143
137
  declare function getComponents(): ComponentMeta[];
144
138
 
145
139
  interface RenderOptions {
@@ -147,4 +141,4 @@ interface RenderOptions {
147
141
  }
148
142
  declare function render(json: string, container: HTMLElement, options?: RenderOptions): void;
149
143
 
150
- export { type BoxUiProperties, type ColumnUiProperties, type ComponentMeta, type ImageUiProperties, type LazyColumnUiProperties, type PropertiesModel, type PropertyDescriptor, type PropertyType, type RenderOptions, type RowUiProperties, type SduiComponent, type SduiScreen, type TextUiProperties, type Theme, getComponents, render };
144
+ export { type ActionModel, type AlignmentType, type BackgroundColorModel, type BackgroundColorType, type BoxUiProperties, type ColorModel, type ColumnUiProperties, type ComponentMeta, type ComponentType, type ContainerUiModifier, type ContentScaleType, type DefaultUiProperties, type FontWeightType, type HorizontalAlignmentType, type HorizontalArrangementModel, type HorizontalArrangementType, type ImageUiModifier, type ImageUiProperties, type LazyColumnUiProperties, type ModifierBase, type PropertiesModel, type PropertyDescriptor, type PropertyType, type RenderOptions, type RowUiProperties, type SduiComponent, type SduiScreen, type SizeModel, type SizeUnitType, type SpacingModel, type TextAlignType, type TextOverflowType, type TextUiModifier, type TextUiProperties, type Theme, type VerticalAlignmentType, type VerticalArrangementModel, type VerticalArrangementType, getComponents, render };
package/dist/index.d.ts CHANGED
@@ -1,16 +1,69 @@
1
+ type ComponentType = 'text' | 'image' | 'box' | 'column' | 'row' | 'lazy_column';
2
+ type AlignmentType = 'top_start' | 'top_center' | 'top_end' | 'center_start' | 'center' | 'center_end' | 'bottom_start' | 'bottom_center' | 'bottom_end';
3
+ type FontWeightType = 'bold' | 'medium' | 'normal' | 'semi_bold';
4
+ type SizeUnitType = 'dp' | 'match_parent' | 'wrap_content';
5
+ type BackgroundColorType = 'single' | 'vertical_gradient' | 'horizontal_gradient' | 'linear_gradient';
6
+ type ContentScaleType = 'fit' | 'crop' | 'fill_height' | 'fill_width' | 'fill_bounds' | 'inside' | 'none';
7
+ type TextAlignType = 'left' | 'right' | 'center' | 'justify' | 'start' | 'end' | 'unspecified';
8
+ type TextOverflowType = 'none' | 'ellipsis';
9
+ type HorizontalAlignmentType = 'start' | 'end' | 'center_horizontally';
10
+ type VerticalAlignmentType = 'top' | 'bottom' | 'center_vertically';
11
+ type HorizontalArrangementType = 'start' | 'center' | 'end' | 'space_between' | 'space_evenly' | 'space_around' | 'spaced_by';
12
+ type VerticalArrangementType = 'top' | 'center' | 'bottom' | 'space_evenly' | 'space_between' | 'space_around' | 'spaced_by';
1
13
  type Theme = 'light' | 'dark';
2
- interface SduiScreen {
3
- schemaVersion?: string;
4
- root: SduiComponent;
14
+ interface ColorModel {
15
+ light?: string;
16
+ dark?: string;
5
17
  }
6
- interface SduiComponent {
7
- type: string;
8
- properties?: PropertiesModel;
9
- children?: SduiComponent[];
18
+ interface SizeModel {
19
+ value?: number;
20
+ unit?: SizeUnitType;
10
21
  }
11
- type PropertiesModel = TextUiProperties | ImageUiProperties | BoxUiProperties | ColumnUiProperties | RowUiProperties | LazyColumnUiProperties | DefaultUiProperties;
12
- interface DefaultUiProperties {
13
- modifier?: DefaultUiModifier;
22
+ interface SpacingModel {
23
+ top?: number;
24
+ bottom?: number;
25
+ start?: number;
26
+ end?: number;
27
+ }
28
+ interface ActionModel {
29
+ type?: string;
30
+ params?: Record<string, string>;
31
+ }
32
+ interface BackgroundColorModel {
33
+ colors?: ColorModel[];
34
+ type?: BackgroundColorType;
35
+ }
36
+ interface HorizontalArrangementModel {
37
+ type?: HorizontalArrangementType;
38
+ spacing?: number;
39
+ }
40
+ interface VerticalArrangementModel {
41
+ type?: VerticalArrangementType;
42
+ spacing?: number;
43
+ }
44
+ interface ModifierBase {
45
+ alignment?: string;
46
+ weight?: number;
47
+ action?: ActionModel;
48
+ }
49
+ interface TextUiModifier extends ModifierBase {
50
+ width?: SizeModel;
51
+ margin?: SpacingModel;
52
+ }
53
+ interface ContainerUiModifier extends ModifierBase {
54
+ backgroundColor?: BackgroundColorModel;
55
+ width?: SizeModel;
56
+ height?: SizeModel;
57
+ padding?: SpacingModel;
58
+ margin?: SpacingModel;
59
+ aspectRatio?: number;
60
+ }
61
+ interface ImageUiModifier extends ModifierBase {
62
+ width?: SizeModel;
63
+ height?: SizeModel;
64
+ padding?: SpacingModel;
65
+ margin?: SpacingModel;
66
+ aspectRatio?: number;
14
67
  }
15
68
  interface TextUiProperties {
16
69
  modifier?: TextUiModifier;
@@ -42,87 +95,27 @@ interface ColumnUiProperties {
42
95
  }
43
96
  interface RowUiProperties {
44
97
  modifier?: ContainerUiModifier;
45
- verticalAlignment?: VerticalAlignmentType;
46
98
  horizontalArrangement?: HorizontalArrangementModel;
99
+ verticalAlignment?: VerticalAlignmentType;
47
100
  canScroll?: boolean;
48
101
  }
49
102
  interface LazyColumnUiProperties {
50
103
  modifier?: ContainerUiModifier;
51
104
  verticalArrangement?: VerticalArrangementModel;
52
105
  }
53
- interface ModifierBase {
54
- alignment?: string;
55
- weight?: number;
56
- action?: ActionModel;
57
- }
58
- interface DefaultUiModifier extends ModifierBase {
59
- }
60
- interface TextUiModifier extends ModifierBase {
61
- width?: SizeModel;
62
- margin?: SpacingModel;
63
- }
64
- interface ContainerUiModifier extends ModifierBase {
65
- backgroundColor?: BackgroundColorModel;
66
- width?: SizeModel;
67
- height?: SizeModel;
68
- padding?: SpacingModel;
69
- margin?: SpacingModel;
70
- aspectRatio?: number;
71
- }
72
- interface ImageUiModifier extends ModifierBase {
73
- width?: SizeModel;
74
- height?: SizeModel;
75
- padding?: SpacingModel;
76
- margin?: SpacingModel;
77
- aspectRatio?: number;
78
- }
79
- interface ColorModel {
80
- light?: string;
81
- dark?: string;
82
- }
83
- interface SizeModel {
84
- value?: number;
85
- unit?: SizeUnitType;
86
- }
87
- interface SpacingModel {
88
- top?: number;
89
- bottom?: number;
90
- start?: number;
91
- end?: number;
92
- }
93
- interface ActionModel {
94
- type?: ActionType;
95
- params?: ActionParams;
96
- }
97
- interface ActionParams {
98
- route?: string;
99
- args?: Record<string, string>;
100
- }
101
- interface BackgroundColorModel {
102
- colors?: ColorModel[];
103
- type?: BackgroundColorType;
106
+ interface DefaultUiProperties {
107
+ modifier?: ModifierBase;
104
108
  }
105
- interface HorizontalArrangementModel {
106
- type?: HorizontalArrangementType;
107
- spacing?: number;
109
+ type PropertiesModel = TextUiProperties | ImageUiProperties | BoxUiProperties | ColumnUiProperties | RowUiProperties | LazyColumnUiProperties | DefaultUiProperties;
110
+ interface SduiComponent {
111
+ type: string;
112
+ properties?: PropertiesModel;
113
+ children?: SduiComponent[];
108
114
  }
109
- interface VerticalArrangementModel {
110
- type?: VerticalArrangementType;
111
- spacing?: number;
115
+ interface SduiScreen {
116
+ schemaVersion?: string;
117
+ root: SduiComponent;
112
118
  }
113
- type ActionType = 'navigate';
114
- type FontWeightType = 'bold' | 'medium' | 'normal' | 'semi_bold';
115
- type TextAlignType = 'left' | 'right' | 'center' | 'justify' | 'start' | 'end' | 'unspecified';
116
- type TextOverflowType = 'none' | 'ellipsis';
117
- type ContentScaleType = 'fit' | 'crop' | 'fill_height' | 'fill_width' | 'fill_bounds' | 'inside' | 'none';
118
- type SizeUnitType = 'dp' | 'match_parent' | 'wrap_content';
119
- type AlignmentType = 'top_start' | 'top_center' | 'top_end' | 'center_start' | 'center' | 'center_end' | 'bottom_start' | 'bottom_center' | 'bottom_end';
120
- type HorizontalAlignmentType = 'start' | 'end' | 'center_horizontally';
121
- type VerticalAlignmentType = 'top' | 'bottom' | 'center_vertically';
122
- type HorizontalArrangementType = 'start' | 'center' | 'end' | 'space_between' | 'space_evenly' | 'space_around' | 'spaced_by';
123
- type VerticalArrangementType = 'top' | 'center' | 'bottom' | 'space_evenly' | 'space_between' | 'space_around' | 'spaced_by';
124
- type BackgroundColorType = 'single' | 'vertical_gradient' | 'linear_gradient' | 'horizontal_gradient';
125
-
126
119
  type PropertyType = 'string' | 'number' | 'boolean' | 'enum' | 'color' | 'object';
127
120
  interface PropertyDescriptor {
128
121
  name: string;
@@ -140,6 +133,7 @@ interface ComponentMeta {
140
133
  acceptsChildren: boolean;
141
134
  properties: PropertyDescriptor[];
142
135
  }
136
+
143
137
  declare function getComponents(): ComponentMeta[];
144
138
 
145
139
  interface RenderOptions {
@@ -147,4 +141,4 @@ interface RenderOptions {
147
141
  }
148
142
  declare function render(json: string, container: HTMLElement, options?: RenderOptions): void;
149
143
 
150
- export { type BoxUiProperties, type ColumnUiProperties, type ComponentMeta, type ImageUiProperties, type LazyColumnUiProperties, type PropertiesModel, type PropertyDescriptor, type PropertyType, type RenderOptions, type RowUiProperties, type SduiComponent, type SduiScreen, type TextUiProperties, type Theme, getComponents, render };
144
+ export { type ActionModel, type AlignmentType, type BackgroundColorModel, type BackgroundColorType, type BoxUiProperties, type ColorModel, type ColumnUiProperties, type ComponentMeta, type ComponentType, type ContainerUiModifier, type ContentScaleType, type DefaultUiProperties, type FontWeightType, type HorizontalAlignmentType, type HorizontalArrangementModel, type HorizontalArrangementType, type ImageUiModifier, type ImageUiProperties, type LazyColumnUiProperties, type ModifierBase, type PropertiesModel, type PropertyDescriptor, type PropertyType, type RenderOptions, type RowUiProperties, type SduiComponent, type SduiScreen, type SizeModel, type SizeUnitType, type SpacingModel, type TextAlignType, type TextOverflowType, type TextUiModifier, type TextUiProperties, type Theme, type VerticalAlignmentType, type VerticalArrangementModel, type VerticalArrangementType, getComponents, render };