@vixoniccom/news-internal 0.4.21-dev.37 → 0.4.21-dev.39

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/build.zip CHANGED
Binary file
@@ -10,8 +10,8 @@ export const newsGroup = new List({
10
10
  range: new NumberRangeValue(1, 200),
11
11
  itemDisplayClass: '2-lines',
12
12
  itemDisplayAttributes: {
13
- title: 'titleMedium',
14
- subtitle: 'descriptionMedium',
13
+ title: 'title',
14
+ subtitle: 'description',
15
15
  expirationDate: 'expirationDate',
16
16
  },
17
17
  })
@@ -3,43 +3,38 @@ import { ShowValidations } from '../utils'
3
3
 
4
4
  export const newsInputs = [
5
5
  new TextInput({
6
- id: 'titleShort',
6
+ id: 'title',
7
7
  label: 'Título corto',
8
- required: true,
9
8
  show: ShowValidations.shortTitleEnabled,
10
9
  range: new NumberRangeValue(1, 25),
11
10
  pattern: '^(?!\\s*$).+',
12
11
  }),
13
12
  new TextInput({
14
- id: 'titleMedium',
13
+ id: 'title',
15
14
  label: 'Título mediano',
16
- required: true,
17
15
  show: ShowValidations.mediumTitleEnabled,
18
16
  range: new NumberRangeValue(1, 40),
19
17
  pattern: '^(?!\\s*$).+',
20
18
  }),
21
19
  new TextInput({
22
- id: 'titleLarge',
20
+ id: 'title',
23
21
  label: 'Título largo',
24
- required: true,
25
22
  show: ShowValidations.largeTitleEnabled,
26
23
  range: new NumberRangeValue(1, 50),
27
24
  pattern: '^(?!\\s*$).+',
28
25
  }),
29
26
 
30
27
  new TextInput({
31
- id: 'titleExtraLarge',
28
+ id: 'title',
32
29
  label: 'Título extra largo',
33
- required: true,
34
30
  show: ShowValidations.extraLargeTitleEnabled,
35
31
  range: new NumberRangeValue(1, 70),
36
32
  pattern: '^(?!\\s*$).+',
37
33
  }),
38
34
 
39
35
  new TextArea({
40
- id: 'descriptionShort',
36
+ id: 'description',
41
37
  label: 'Descripción corta',
42
- required: true,
43
38
  show: ShowValidations.shortDescriptionEnabled,
44
39
  range: new NumberRangeValue(1, 80),
45
40
  html: true,
@@ -47,9 +42,8 @@ export const newsInputs = [
47
42
  }),
48
43
 
49
44
  new TextArea({
50
- id: 'descriptionMedium',
45
+ id: 'description',
51
46
  label: 'Descripción mediana',
52
- required: true,
53
47
  show: ShowValidations.mediumDescriptionEnabled,
54
48
  range: new NumberRangeValue(1, 180),
55
49
  html: true,
@@ -57,9 +51,8 @@ export const newsInputs = [
57
51
  }),
58
52
 
59
53
  new TextArea({
60
- id: 'descriptionLarge',
54
+ id: 'description',
61
55
  label: 'Descripción larga',
62
- required: true,
63
56
  show: ShowValidations.largeDescriptionEnabled,
64
57
  range: new NumberRangeValue(1, 350),
65
58
  html: true,
@@ -67,9 +60,8 @@ export const newsInputs = [
67
60
  }),
68
61
 
69
62
  new TextArea({
70
- id: 'descriptionExtraLarge',
63
+ id: 'description',
71
64
  label: 'Descripción extra larga',
72
- required: true,
73
65
  show: ShowValidations.extraLargeDescriptionEnabled,
74
66
  range: new NumberRangeValue(1, 500),
75
67
  html: true,
@@ -7,79 +7,79 @@
7
7
  "type": "list",
8
8
  "itemSchema": [
9
9
  {
10
- "id": "titleShort",
10
+ "id": "title",
11
11
  "label": "Título corto",
12
12
  "show": "{{titleEnabled}} === true && ({{newsSizeSelect}} === 'short')",
13
13
  "type": "text-input",
14
14
  "required": true,
15
15
  "pattern": "^(?!\\s*$).+",
16
- "range": "[1:25:]"
16
+ "range": "[1:25]"
17
17
  },
18
18
  {
19
- "id": "titleMedium",
19
+ "id": "title",
20
20
  "label": "Título mediano",
21
21
  "show": "{{titleEnabled}} === true && ({{newsSizeSelect}} === 'medium')",
22
22
  "type": "text-input",
23
23
  "required": true,
24
24
  "pattern": "^(?!\\s*$).+",
25
- "range": "[1:40:]"
25
+ "range": "[1:40]"
26
26
  },
27
27
  {
28
- "id": "titleLarge",
28
+ "id": "title",
29
29
  "label": "Título largo",
30
30
  "show": "{{titleEnabled}} === true && ({{newsSizeSelect}} === 'large')",
31
31
  "type": "text-input",
32
32
  "required": true,
33
33
  "pattern": "^(?!\\s*$).+",
34
- "range": "[1:50:]"
34
+ "range": "[1:50]"
35
35
  },
36
36
  {
37
- "id": "titleExtraLarge",
37
+ "id": "title",
38
38
  "label": "Título extra largo",
39
39
  "show": "{{titleEnabled}} === true && ({{newsSizeSelect}} === 'extra-large')",
40
40
  "type": "text-input",
41
41
  "required": true,
42
42
  "pattern": "^(?!\\s*$).+",
43
- "range": "[1:70:]"
43
+ "range": "[1:70]"
44
44
  },
45
45
  {
46
- "id": "descriptionShort",
46
+ "id": "description",
47
47
  "label": "Descripción corta",
48
48
  "show": "{{descriptionEnabled}} === true && ({{newsSizeSelect}} === 'short')",
49
49
  "type": "text-area",
50
50
  "required": true,
51
51
  "pattern": "^(?!\\s*$).+",
52
- "range": "[1:80:]",
52
+ "range": "[1:80]",
53
53
  "html": true
54
54
  },
55
55
  {
56
- "id": "descriptionMedium",
56
+ "id": "description",
57
57
  "label": "Descripción mediana",
58
58
  "show": "{{descriptionEnabled}} === true && ({{newsSizeSelect}} === 'medium')",
59
59
  "type": "text-area",
60
60
  "required": true,
61
61
  "pattern": "^(?!\\s*$).+",
62
- "range": "[1:180:]",
62
+ "range": "[1:180]",
63
63
  "html": true
64
64
  },
65
65
  {
66
- "id": "descriptionLarge",
66
+ "id": "description",
67
67
  "label": "Descripción larga",
68
68
  "show": "{{descriptionEnabled}} === true && ({{newsSizeSelect}} === 'large')",
69
69
  "type": "text-area",
70
70
  "required": true,
71
71
  "pattern": "^(?!\\s*$).+",
72
- "range": "[1:350:]",
72
+ "range": "[1:350]",
73
73
  "html": true
74
74
  },
75
75
  {
76
- "id": "descriptionExtraLarge",
76
+ "id": "description",
77
77
  "label": "Descripción extra larga",
78
78
  "show": "{{descriptionEnabled}} === true && ({{newsSizeSelect}} === 'extra-large')",
79
79
  "type": "text-area",
80
80
  "required": true,
81
81
  "pattern": "^(?!\\s*$).+",
82
- "range": "[1:500:]",
82
+ "range": "[1:500]",
83
83
  "html": true
84
84
  },
85
85
  {
@@ -119,17 +119,17 @@
119
119
  }
120
120
  ],
121
121
  "description": "Lista de noticias",
122
- "range": "[1:200:]",
122
+ "range": "[1:200]",
123
123
  "itemDisplayClass": "2-lines",
124
124
  "itemDisplayAttributes": {
125
- "title": "titleMedium",
126
- "subtitle": "descriptionMedium",
125
+ "title": "title",
126
+ "subtitle": "description",
127
127
  "expirationDate": "expirationDate"
128
128
  },
129
129
  "sortable": true
130
130
  },
131
131
  {
132
- "id": "appearanceGroup",
132
+ "id": "appaeranceGroup",
133
133
  "label": "Apariencia",
134
134
  "type": "group",
135
135
  "items": [
@@ -188,7 +188,7 @@
188
188
  "id": "showTime",
189
189
  "label": "Persistencia",
190
190
  "type": "number-input",
191
- "range": "[5:9999:]",
191
+ "range": "[5:9999]",
192
192
  "description": "Tiempo en segundos por noticia. Por defecto 10"
193
193
  },
194
194
  {
@@ -253,13 +253,12 @@
253
253
  },
254
254
  {
255
255
  "id": "defaultMessage",
256
- "label": "Mensaje sin noticias",
257
- "type": "text-input",
258
- "description": "Mensaje a mostrar cuando no existen noticias o han caducado"
256
+ "label": "Sin noticias",
257
+ "type": "text-input"
259
258
  },
260
259
  {
261
260
  "id": "defaultMessageFormat",
262
- "label": "Formato del mensaje sin noticias",
261
+ "label": "Formato mensaje sin noticias",
263
262
  "type": "text-format"
264
263
  },
265
264
  {
@@ -283,7 +282,7 @@
283
282
  "label": "Altura de línea",
284
283
  "show": "{{titleEnabled}} === true",
285
284
  "type": "number-input",
286
- "range": "[0.8:100:]"
285
+ "range": "[0.8:100]"
287
286
  },
288
287
  {
289
288
  "id": "descriptionEnabled",
@@ -302,7 +301,7 @@
302
301
  "label": "Altura de línea",
303
302
  "show": "{{descriptionEnabled}} === true",
304
303
  "type": "number-input",
305
- "range": "[0.8:100:]"
304
+ "range": "[0.8:100]"
306
305
  },
307
306
  {
308
307
  "id": "textSeparation",
@@ -349,7 +348,7 @@
349
348
  "label": "Tamaño personalizado",
350
349
  "show": "{{imageEnabled}} === true && ( ( {{template}} === 'gallery' ) === false ) && ( ( {{template}} === 'gradient' ) === false ) && ( {{imageSize}} === 'custom' )",
351
350
  "type": "number-input",
352
- "range": "[1:100:]",
351
+ "range": "[1:100]",
353
352
  "description": "En porcentaje.",
354
353
  "required": true
355
354
  },
@@ -455,7 +454,7 @@
455
454
  "label": "Porcentje de degradado",
456
455
  "show": "{{template}} === 'gradient'",
457
456
  "type": "number-input",
458
- "range": "[1:100:]",
457
+ "range": "[1:100]",
459
458
  "description": "Por defecto 50"
460
459
  },
461
460
  {
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "author": {
9
9
  "name": ""
10
10
  },
11
- "version": "0.4.21-dev.37",
11
+ "version": "0.4.21-dev.39",
12
12
  "scripts": {
13
13
  "prepublish": "vixonic-module-packager --mode=build",
14
14
  "watch": "vixonic-module-packager --mode=watch",
@@ -36,7 +36,7 @@
36
36
  "@types/react-transition-group": "^4.4.12",
37
37
  "@types/uuid": "^9.0.1",
38
38
  "@vixoniccom/module-packager": "^2.13.0-dev.1",
39
- "@vixoniccom/modules": "^2.22.0-dev.3",
39
+ "@vixoniccom/modules": "^2.25.0-dev.16",
40
40
  "standard-version": "^9.5.0"
41
41
  }
42
42
  }
@@ -11,32 +11,17 @@ export type Props = {
11
11
  export const App: React.FunctionComponent<Props> = ({ data }) => {
12
12
  const [news, setNews] = useState<NewsItem[]>([])
13
13
 
14
- const getPrefixBySize = (n: any, size: string, prefix: string): string => {
15
- const prefixMap: { [key: string]: string } = {
16
- 'short': n[`${prefix}Short`],
17
- 'medium': n[`${prefix}Medium`],
18
- 'large': n[`${prefix}Large`],
19
- 'extra-large': n[`${prefix}ExtraLarge`]
20
- }
21
- return prefixMap[size] || n[`${prefix}Medium`] || n[prefix] || ''
22
- }
23
-
24
14
  const parseNews = (data?: VixonicData): NewsItem[] => {
25
15
  if (!data) return []
26
- const { news, newsSizeSelect } = data.parameters
16
+ const { news } = data.parameters
27
17
  const parsedNews = news?.map((n) => {
28
18
  const { image, ...rest } = n
29
19
  let parsedImage
30
20
  const qrUrl = n.qrCodeUrl
31
21
  if (image?.filename) parsedImage = `${data.downloadsPath}/${image.filename}`
32
22
 
33
- let title = getPrefixBySize(n, newsSizeSelect ?? 'medium', 'title')
34
- let description = getPrefixBySize(n, newsSizeSelect ?? 'medium', 'description')
35
-
36
23
  return {
37
24
  ...rest,
38
- title,
39
- description,
40
25
  image: parsedImage,
41
26
  id: uuid(),
42
27
  qrCodeUrl: qrUrl
package/src/global.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- declare module '*.css'
2
-
3
1
  type NewsItem = {
4
2
  id: string
5
3
  title?: string
@@ -4,6 +4,118 @@ declare type VixonicData = {
4
4
  parameters: VixonicParameters
5
5
  }
6
6
 
7
- declare type VixonicParameters = Partial<{
8
- news: {titleShort: string, titleMedium: string, titleLarge: string, titleExtraLarge: string, descriptionShort: string, descriptionMedium: string, descriptionLarge: string, descriptionExtraLarge: string, image: {id?: string, filename?: string, extension?: string}, qrCodeUrl: string, qrCodeTitle: string, expirationDate: string, __id: string | undefined}[], newsSizeSelect: 'short' | 'medium' | 'large' | 'extra-large', template: 'standard' | 'gallery' | 'gradient', showTime: number, animationSpeed: number, animationType: 'fade' | 'crossFade', textAlignment: 'flex-start' | 'flex-end' | 'center' | 'space-around' | 'space-between', defaultMessage: string, defaultMessageFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, titleEnabled: boolean, titleFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, titleLineHeight: number, descriptionEnabled: boolean, descriptionFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, descriptionLineHeight: number, textSeparation: number, imageEnabled: boolean, imageSize: 'small' | 'medium' | 'large' | 'custom', imageCustomSize: number, imagePosition: 'top' | 'right' | 'bottom' | 'left', imageMode: 'contain' | 'cover' | 'fill' | 'none', imageStyle: 'normal' | 'rounded' | 'circle' | 'hex', imageSeparation: number, gradientBackgroundColor: string, gradientRate: number, gradientOrientation: 'left' | 'right', gradientTitleEnabled: boolean, gradientTitle: string, gradientTitlePositionX: number, gradientTitlePositionY: number, gradientTitleFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, barSize: 'small' | 'medium' | 'big', barColor: string, barOpacity: number, iconVisible: boolean, iconColor: string, qrCodeEnabled: boolean, qrCodeWidth: number, qrCodeHeight: number, qrCodePositionX: number, qrCodePositionY: number, qrCodeBackgroundColor: string, qrCodeColor: string, QrCodeTitleFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, background: {id?: string, filename?: string, extension?: string}, padding: string
7
+ declare type VixonicParameters =
8
+ Partial<{
9
+ news: {
10
+ title: string,
11
+ description: string,
12
+ image: {
13
+ id?: string,
14
+ filename?: string,
15
+ extension?: string
16
+ },
17
+ qrCodeUrl: string,
18
+ qrCodeTitle: string,
19
+ expirationDate: string,
20
+ __id: string | undefined}[],
21
+ newsSizeSelect: 'short' | 'medium' | 'large' | 'extra-large',
22
+ template: 'standard' | 'gallery' | 'gradient',
23
+ showTime: number, animationSpeed: number,
24
+ animationType: 'fade' | 'crossFade',
25
+ textAlignment: 'flex-start' | 'flex-end' | 'center' | 'space-around' | 'space-between',
26
+ defaultMessage: string
27
+ defaultMessageFormat: {
28
+ fontSize?: number,
29
+ fontColor?: string,
30
+ alignment?: {
31
+ horizontal?: 'left' | 'right' | 'center'},
32
+ font?: {
33
+ filename: string;
34
+ id: string;
35
+ __isAsset: true}
36
+ }
37
+ titleEnabled: boolean,
38
+ titleFormat: {
39
+ fontSize?: number,
40
+ fontColor?: string,
41
+ alignment?: {
42
+ horizontal?: 'left' | 'right' | 'center'
43
+ },
44
+ font?: {
45
+ filename: string,
46
+ id: string,
47
+ __isAsset: true
48
+ }
49
+ },
50
+ titleLineHeight: number,
51
+ descriptionEnabled: boolean,
52
+ descriptionFormat: {
53
+ fontSize?: number,
54
+ fontColor?: string,
55
+ alignment?: {
56
+ horizontal?: 'left' | 'right' | 'center'
57
+ },
58
+ font?: {
59
+ filename: string,
60
+ id: string,
61
+ __isAsset: true
62
+ }
63
+ },
64
+ descriptionLineHeight: number,
65
+ textSeparation: number,
66
+ imageEnabled: boolean,
67
+ imageSize: 'small' | 'medium' | 'large' | 'custom',
68
+ imageCustomSize: number,
69
+ imagePosition: 'top' | 'right' | 'bottom' | 'left',
70
+ imageMode: 'contain' | 'cover' | 'fill' | 'none',
71
+ imageStyle: 'normal' | 'rounded' | 'circle' | 'hex',
72
+ imageSeparation: number,
73
+ gradientBackgroundColor: string,
74
+ gradientRate: number,
75
+ gradientOrientation: 'left' | 'right',
76
+ gradientTitleEnabled: boolean,
77
+ gradientTitle: string,
78
+ gradientTitlePositionX: number,
79
+ gradientTitlePositionY: number,
80
+ gradientTitleFormat: {
81
+ fontSize?: number,
82
+ fontColor?: string,
83
+ alignment?: {
84
+ horizontal?: 'left' | 'right' | 'center'
85
+ },
86
+ font?: {
87
+ filename: string,
88
+ id: string,
89
+ __isAsset: true
90
+ }
91
+ },
92
+ barSize: 'small' | 'medium' | 'big',
93
+ barColor: string,
94
+ barOpacity: number,
95
+ iconVisible: boolean,
96
+ iconColor: string,
97
+ qrCodeEnabled: boolean,
98
+ qrCodeWidth: number,
99
+ qrCodeHeight: number,
100
+ qrCodePositionX: number,
101
+ qrCodePositionY: number,
102
+ qrCodeBackgroundColor: string,
103
+ qrCodeColor: string,
104
+ QrCodeTitleFormat: {
105
+ fontSize?: number,
106
+ fontColor?: string,
107
+ alignment?: {
108
+ horizontal?: 'left' | 'right' | 'center' },
109
+ font?: {
110
+ filename: string,
111
+ id: string,
112
+ __isAsset: true
113
+ }
114
+ },
115
+ background: {
116
+ id?: string,
117
+ filename?: string,
118
+ extension?: string
119
+ },
120
+ padding: string
9
121
  }>