@vixoniccom/news-internal 0.4.21-dev.20 → 0.4.21-dev.23

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.
@@ -37,30 +37,6 @@
37
37
  "qrCodeUrl": "https://vixonic.com/",
38
38
  "qrCodeTitle": "Entra a Vixonic",
39
39
  "expirationDate": ""
40
- },
41
- {
42
- "$$hashKey": "object:583",
43
- "description": "Miau",
44
- "image": {
45
- "__type": "kna-resource",
46
- "filename": "cat.jpg"
47
- },
48
- "title": "Gato",
49
- "qrCodeUrl": "https://vixonic.com/",
50
- "qrCodeTitle": "Entra a Vixonic",
51
- "expirationDate": ""
52
- },
53
- {
54
- "$$hashKey": "object:653",
55
- "description": "Guau",
56
- "image": {
57
- "__type": "kna-resource",
58
- "filename": "dog.jpg"
59
- },
60
- "title": "Perro",
61
- "qrCodeUrl": "https://mandomedio.com/",
62
- "qrCodeTitle": "Entra a Mandomedio",
63
- "expirationDate": "2026-05-30"
64
40
  }
65
41
  ],
66
42
  "padding": "25px 80px 120px 20px",
@@ -91,6 +67,19 @@
91
67
  },
92
68
  "fontColor": "#336699",
93
69
  "fontSize": "36"
94
- }
70
+ },
71
+ "defaultMessageFormat": {
72
+ "font": {
73
+ "id": "7953953c-7029-4730-ae4d-cff4abd5288f",
74
+ "filename": "7953953c-7029-4730-ae4d-cff4abd5288f.ttf",
75
+ "__isAsset": true
76
+ },
77
+ "fontSize": 3.8,
78
+ "alignment": {
79
+ "horizontal": "left"
80
+ },
81
+ "fontColor": "#585858"
82
+ },
83
+ "defaultMessage": "No hay noticias disponibles en este momento."
95
84
  }
96
85
  }
package/build.zip CHANGED
Binary file
@@ -1,5 +1,5 @@
1
1
  import { Label, SelectInput, NumberInput } from '@vixoniccom/modules'
2
- import { NumberRangeValue, Slider } from '@vixoniccom/modules/dist/lib'
2
+ import { NumberRangeValue, Slider, TextFormat, TextInput } from '@vixoniccom/modules/dist/lib'
3
3
 
4
4
  export const generalInputs = [
5
5
  new Label({ label: 'General' }),
@@ -51,5 +51,7 @@ export const generalInputs = [
51
51
  { label: 'Distribuidos', value: 'space-around' },
52
52
  { label: 'Separados', value: 'space-between' }
53
53
  ]
54
- })
54
+ }),
55
+ new TextInput({ id: 'defaultMessage', label: 'Mensaje sin noticias', description: 'Mensaje a mostrar cuando no existen noticias o han caducado' }),
56
+ new TextFormat({ id: 'defaultMessageFormat', label: 'Formato del mensaje sin noticias' }),
55
57
  ]
@@ -251,6 +251,16 @@
251
251
  "required": true,
252
252
  "defaultValue": "center"
253
253
  },
254
+ {
255
+ "id": "defaultMessage",
256
+ "label": "Sin cumpleaños",
257
+ "type": "text-input"
258
+ },
259
+ {
260
+ "id": "defaultMessageFormat",
261
+ "label": "Formato Mensaje sin cumpleaños",
262
+ "type": "text-format"
263
+ },
254
264
  {
255
265
  "type": "label",
256
266
  "label": "Elementos"
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "author": {
9
9
  "name": ""
10
10
  },
11
- "version": "0.4.21-dev.20",
11
+ "version": "0.4.21-dev.23",
12
12
  "scripts": {
13
13
  "prepublish": "vixonic-module-packager --mode=build",
14
14
  "watch": "vixonic-module-packager --mode=watch",
@@ -17,6 +17,7 @@ export const FontLoader: React.FunctionComponent<Props<any>> = (props) => {
17
17
  src: url("${parseFontUrl(props.downloadPath, font)}");
18
18
  }`
19
19
  } catch (err) {
20
+ console.error('Error loading font:', font, err)
20
21
  return ''
21
22
  }
22
23
  })
@@ -47,8 +47,8 @@ export const FormattedText: React.FunctionComponent<Props> = (props) => {
47
47
 
48
48
  const getHorizontalAlignment = (alignment: Aligment) => {
49
49
  if (alignment) {
50
- const hA = alignment.horizontal
51
- return alignments.hasOwnProperty(hA) ? alignments[alignment.horizontal] : 'flex-start'
50
+ const hA = alignment?.horizontal
51
+ return alignments.hasOwnProperty(hA) ? alignments[alignment?.horizontal] : 'flex-start'
52
52
  }
53
53
  return 'flex-start'
54
54
  }
@@ -79,9 +79,4 @@ export const FormattedText: React.FunctionComponent<Props> = (props) => {
79
79
  )
80
80
  }
81
81
 
82
- FormattedText.defaultProps = {
83
- format: {},
84
- lineHeight: 1,
85
- unit: 'vh',
86
- maxChar: undefined,
87
- }
82
+
@@ -4,6 +4,7 @@ import { StandardItem } from '../StandardItem'
4
4
  import { GalleryItem } from '../GalleryItem'
5
5
  import { GradientItem } from '../GradientItem'
6
6
  import './styles.css'
7
+ import { FormattedText } from '../FormattedText'
7
8
 
8
9
  type Props = {
9
10
  data: VixonicData
@@ -12,7 +13,7 @@ type Props = {
12
13
 
13
14
  export const NewsContainer: React.FunctionComponent<Props> = (props) => {
14
15
  const { parameters, downloadsPath } = props.data
15
- const { animationSpeed } = parameters
16
+ const { animationSpeed, defaultMessage } = parameters
16
17
  const timerRef = useRef<number | undefined>(undefined)
17
18
  const [currentIndex, setCurrentIndex] = useState(0)
18
19
  const item = props.items.length > currentIndex ? props.items[currentIndex] : undefined
@@ -40,7 +41,7 @@ export const NewsContainer: React.FunctionComponent<Props> = (props) => {
40
41
  return <TransitionGroup className='main-container' style={{
41
42
  backgroundColor: parameters.gradientBackgroundColor || 'red'
42
43
  }}>
43
- {item &&
44
+ {item ?
44
45
  <CSSTransition key={item.id} classNames={parameters.animationType || 'fade'} timeout={(1750 / (animationSpeed || 1)) * 2}>
45
46
  <div className={'news-item-container'}>
46
47
  {
@@ -48,6 +49,7 @@ export const NewsContainer: React.FunctionComponent<Props> = (props) => {
48
49
  }
49
50
  </div>
50
51
  </CSSTransition>
52
+ : <FormattedText text={defaultMessage || 'No hay cumpleaños para mostrar'} format={parameters.defaultMessageFormat} />
51
53
  }
52
54
  </TransitionGroup>
53
55
 
@@ -56,15 +58,17 @@ export const NewsContainer: React.FunctionComponent<Props> = (props) => {
56
58
  padding: parameters.padding,
57
59
  backgroundImage: parameters.background && `url("${downloadsPath}/${parameters.background.filename}")`
58
60
  }}>
59
- {item &&
61
+ {item ?
60
62
  <CSSTransition key={item.id} classNames={parameters.animationType || 'fade'} timeout={(1750 / (animationSpeed || 1)) * 2}>
61
63
  <div className={'news-item-container'}>
62
- {parameters.template !== 'gallery'
63
- ? <StandardItem parameters={parameters} item={item} />
64
- : <GalleryItem parameters={parameters} item={item} />
64
+ {parameters.template === 'gallery'
65
+ ? <GalleryItem parameters={parameters} item={item} />
66
+ : <StandardItem parameters={parameters} item={item} />
65
67
  }
66
68
  </div>
67
69
  </CSSTransition>
70
+ :<FormattedText text={defaultMessage || 'No hay noticias para mostrar'} format={parameters.defaultMessageFormat} />
71
+
68
72
  }
69
73
  </TransitionGroup>
70
74
  }
@@ -4,6 +4,124 @@ 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', 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
+ titleShort: string,
11
+ titleMedium: string,
12
+ titleLarge: string,
13
+ titleExtraLarge: string,
14
+ descriptionShort: string,
15
+ descriptionMedium: string,
16
+ descriptionLarge: string,
17
+ descriptionExtraLarge: string,
18
+ image: {
19
+ id?: string,
20
+ filename?: string,
21
+ extension?: string
22
+ },
23
+ qrCodeUrl: string,
24
+ qrCodeTitle: string,
25
+ expirationDate: string,
26
+ __id: string | undefined}[],
27
+ newsSizeSelect: 'short' | 'medium' | 'large' | 'extra-large',
28
+ template: 'standard' | 'gallery' | 'gradient',
29
+ showTime: number, animationSpeed: number,
30
+ animationType: 'fade' | 'crossFade',
31
+ textAlignment: 'flex-start' | 'flex-end' | 'center' | 'space-around' | 'space-between',
32
+ defaultMessage: string
33
+ defaultMessageFormat: {
34
+ fontSize?: number,
35
+ fontColor?: string,
36
+ alignment?: {
37
+ horizontal?: 'left' | 'right' | 'center'},
38
+ font?: {
39
+ filename: string;
40
+ id: string;
41
+ __isAsset: true}
42
+ }
43
+ titleEnabled: boolean,
44
+ titleFormat: {
45
+ fontSize?: number,
46
+ fontColor?: string,
47
+ alignment?: {
48
+ horizontal?: 'left' | 'right' | 'center'
49
+ },
50
+ font?: {
51
+ filename: string,
52
+ id: string,
53
+ __isAsset: true
54
+ }
55
+ },
56
+ titleLineHeight: number,
57
+ descriptionEnabled: boolean,
58
+ descriptionFormat: {
59
+ fontSize?: number,
60
+ fontColor?: string,
61
+ alignment?: {
62
+ horizontal?: 'left' | 'right' | 'center'
63
+ },
64
+ font?: {
65
+ filename: string,
66
+ id: string,
67
+ __isAsset: true
68
+ }
69
+ },
70
+ descriptionLineHeight: number,
71
+ textSeparation: number,
72
+ imageEnabled: boolean,
73
+ imageSize: 'small' | 'medium' | 'large' | 'custom',
74
+ imageCustomSize: number,
75
+ imagePosition: 'top' | 'right' | 'bottom' | 'left',
76
+ imageMode: 'contain' | 'cover' | 'fill' | 'none',
77
+ imageStyle: 'normal' | 'rounded' | 'circle' | 'hex',
78
+ imageSeparation: number,
79
+ gradientBackgroundColor: string,
80
+ gradientRate: number,
81
+ gradientOrientation: 'left' | 'right',
82
+ gradientTitleEnabled: boolean,
83
+ gradientTitle: string,
84
+ gradientTitlePositionX: number,
85
+ gradientTitlePositionY: number,
86
+ gradientTitleFormat: {
87
+ fontSize?: number,
88
+ fontColor?: string,
89
+ alignment?: {
90
+ horizontal?: 'left' | 'right' | 'center'
91
+ },
92
+ font?: {
93
+ filename: string,
94
+ id: string,
95
+ __isAsset: true
96
+ }
97
+ },
98
+ barSize: 'small' | 'medium' | 'big',
99
+ barColor: string,
100
+ barOpacity: number,
101
+ iconVisible: boolean,
102
+ iconColor: string,
103
+ qrCodeEnabled: boolean,
104
+ qrCodeWidth: number,
105
+ qrCodeHeight: number,
106
+ qrCodePositionX: number,
107
+ qrCodePositionY: number,
108
+ qrCodeBackgroundColor: string,
109
+ qrCodeColor: string,
110
+ QrCodeTitleFormat: {
111
+ fontSize?: number,
112
+ fontColor?: string,
113
+ alignment?: {
114
+ horizontal?: 'left' | 'right' | 'center' },
115
+ font?: {
116
+ filename: string,
117
+ id: string,
118
+ __isAsset: true
119
+ }
120
+ },
121
+ background: {
122
+ id?: string,
123
+ filename?: string,
124
+ extension?: string
125
+ },
126
+ padding: string
9
127
  }>
@@ -37,30 +37,6 @@
37
37
  "qrCodeUrl": "https://vixonic.com/",
38
38
  "qrCodeTitle": "Entra a Vixonic",
39
39
  "expirationDate": ""
40
- },
41
- {
42
- "$$hashKey": "object:583",
43
- "description": "Miau",
44
- "image": {
45
- "__type": "kna-resource",
46
- "filename": "cat.jpg"
47
- },
48
- "title": "Gato",
49
- "qrCodeUrl": "https://vixonic.com/",
50
- "qrCodeTitle": "Entra a Vixonic",
51
- "expirationDate": ""
52
- },
53
- {
54
- "$$hashKey": "object:653",
55
- "description": "Guau",
56
- "image": {
57
- "__type": "kna-resource",
58
- "filename": "dog.jpg"
59
- },
60
- "title": "Perro",
61
- "qrCodeUrl": "https://mandomedio.com/",
62
- "qrCodeTitle": "Entra a Mandomedio",
63
- "expirationDate": "2026-05-30"
64
40
  }
65
41
  ],
66
42
  "padding": "25px 80px 120px 20px",
@@ -91,6 +67,19 @@
91
67
  },
92
68
  "fontColor": "#336699",
93
69
  "fontSize": "36"
94
- }
70
+ },
71
+ "defaultMessageFormat": {
72
+ "font": {
73
+ "id": "7953953c-7029-4730-ae4d-cff4abd5288f",
74
+ "filename": "7953953c-7029-4730-ae4d-cff4abd5288f.ttf",
75
+ "__isAsset": true
76
+ },
77
+ "fontSize": 3.8,
78
+ "alignment": {
79
+ "horizontal": "left"
80
+ },
81
+ "fontColor": "#585858"
82
+ },
83
+ "defaultMessage": "No hay noticias disponibles en este momento."
95
84
  }
96
85
  }