@vixoniccom/news-internal 0.4.19 → 0.4.20-dev.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/build/index.html +1 -0
  3. package/build/main.js +2 -0
  4. package/build/main.js.LICENSE.txt +39 -0
  5. package/build/test/downloads/cat-2.jpg +0 -0
  6. package/build/test/downloads/cat.jpg +0 -0
  7. package/build/test/downloads/colabra.jpg +0 -0
  8. package/build/test/downloads/custom-template/assets/background.png +0 -0
  9. package/build/test/downloads/custom-template/assets/image-error.png +0 -0
  10. package/build/test/downloads/custom-template/assets/image-loading.gif +0 -0
  11. package/build/test/downloads/custom-template/assets/main-font.ttf +0 -0
  12. package/build/test/downloads/custom-template/main.html +62 -0
  13. package/build/test/downloads/dog.jpg +0 -0
  14. package/build/test/downloads/fondo-noticiario-vitacura.jpg +0 -0
  15. package/build/test/downloads/font-title.otf +0 -0
  16. package/build/test/parameters.json +96 -0
  17. package/build.zip +0 -0
  18. package/configuration/index.ts +3 -109
  19. package/configuration/newsGroup/index.ts +16 -0
  20. package/configuration/newsGroup/newsInputs.ts +107 -0
  21. package/configuration.json +21 -11
  22. package/package.json +14 -12
  23. package/src/components/App.tsx +80 -0
  24. package/src/components/FontLoader.tsx +49 -0
  25. package/src/components/FormattedHtmlText/index.tsx +70 -0
  26. package/src/components/FormattedText/index.tsx +82 -0
  27. package/src/components/GalleryItem/index.tsx +85 -0
  28. package/src/components/GradientImage/index.tsx +18 -0
  29. package/src/components/GradientItem/index.tsx +49 -0
  30. package/src/components/GradientTitle/index.tsx +19 -0
  31. package/src/components/ImageContainer/index.tsx +77 -0
  32. package/src/components/NewsContainer/index.tsx +71 -0
  33. package/src/components/NewsContainer/styles.css +45 -0
  34. package/src/components/QrCodeContainer/index.tsx +38 -0
  35. package/src/components/StandardItem/index.tsx +45 -0
  36. package/src/components/TextContainer/index.tsx +35 -0
  37. package/src/global.d.ts +9 -0
  38. package/src/index.html +11 -0
  39. package/src/main.ts +28 -0
  40. package/src/parameters.d.ts +80 -0
  41. package/src/test/downloads/cat-2.jpg +0 -0
  42. package/src/test/downloads/cat.jpg +0 -0
  43. package/src/test/downloads/colabra.jpg +0 -0
  44. package/src/test/downloads/custom-template/assets/background.png +0 -0
  45. package/src/test/downloads/custom-template/assets/image-error.png +0 -0
  46. package/src/test/downloads/custom-template/assets/image-loading.gif +0 -0
  47. package/src/test/downloads/custom-template/assets/main-font.ttf +0 -0
  48. package/src/test/downloads/custom-template/main.html +62 -0
  49. package/src/test/downloads/dog.jpg +0 -0
  50. package/src/test/downloads/fondo-noticiario-vitacura.jpg +0 -0
  51. package/src/test/downloads/font-title.otf +0 -0
  52. package/src/test/parameters.json +96 -0
  53. package/tsconfig.json +4 -3
@@ -0,0 +1,38 @@
1
+ import React from 'react'
2
+ import { FormattedText } from '../FormattedText'
3
+ import QRCode from 'react-qr-code'
4
+
5
+ type Props = {
6
+ item: NewsItem
7
+ parameters: VixonicParameters
8
+ }
9
+
10
+ export const QrCodeContainer: React.FunctionComponent<Props> = (props) => {
11
+ const { item, parameters } = props
12
+ const qrCodeSize = parameters.qrCodeWidth || 200
13
+ const qrCodeWidth = `${qrCodeSize}px`
14
+ const qrCodeHeight = `${parameters.qrCodeHeight || 220}px`
15
+ const qrCodeBackgroundColor = parameters.qrCodeBackgroundColor || 'white'
16
+
17
+ return <div style={{
18
+ display: 'block',
19
+ position: 'absolute',
20
+ top: `${parameters.qrCodePositionY || 0}px`,
21
+ left: `${parameters.qrCodePositionX || 0}px`,
22
+ width: qrCodeWidth,
23
+ height: qrCodeHeight,
24
+ borderRadius: '10px',
25
+ padding: '20px',
26
+ textAlign: 'center',
27
+ background: qrCodeBackgroundColor,
28
+ boxShadow: '0 4px 8px 0 rgba(0,0,0,0.2)'
29
+ }}>
30
+ <QRCode
31
+ value={item.qrCodeUrl || ''} size={qrCodeSize}
32
+ bgColor={qrCodeBackgroundColor} fgColor={parameters.qrCodeColor || 'black'}
33
+ />
34
+ {item.qrCodeTitle &&
35
+ <FormattedText text={item.qrCodeTitle} unit={'px'} format={parameters.QrCodeTitleFormat} />
36
+ }
37
+ </div>
38
+ }
@@ -0,0 +1,45 @@
1
+ import React from 'react'
2
+ import { ImageContainer } from '../ImageContainer'
3
+ import { TextContainer } from '../TextContainer'
4
+ import { QrCodeContainer } from '../QrCodeContainer'
5
+
6
+ const imageContainerStyle: React.CSSProperties = {
7
+ display: 'flex',
8
+ alignItems: 'center',
9
+ justifyContent: 'center',
10
+ overflow: 'hidden',
11
+ flexShrink: 0
12
+ }
13
+
14
+ type Props = {
15
+ item: NewsItem
16
+ parameters: VixonicParameters
17
+ }
18
+
19
+ const direction: { [key: string]: 'column' | 'row-reverse' | 'column-reverse' | 'row' } = {
20
+ 'top': 'column',
21
+ 'right': 'row-reverse',
22
+ 'bottom': 'column-reverse',
23
+ 'left': 'row'
24
+ }
25
+
26
+ export const StandardItem: React.FunctionComponent<Props> = (props) => {
27
+ const { item, parameters } = props
28
+ const flexDirection = direction[parameters.imagePosition || 'left']
29
+
30
+ return <div style={{
31
+ display: 'flex',
32
+ position: 'absolute',
33
+ top: 0,
34
+ left: 0,
35
+ bottom: 0,
36
+ right: 0,
37
+ flexDirection,
38
+ overflow: 'hidden',
39
+ padding: 'inherit'
40
+ }}>
41
+ <ImageContainer parameters={parameters} style={imageContainerStyle} src={item.image} />
42
+ <TextContainer parameters={parameters} item={item} />
43
+ {parameters.qrCodeEnabled && <QrCodeContainer parameters={parameters} item={item} />}
44
+ </div>
45
+ }
@@ -0,0 +1,35 @@
1
+ import React from 'react'
2
+ import { FormattedText } from '../FormattedText'
3
+ import FormattedHtmlText from '../FormattedHtmlText'
4
+
5
+ type Props = {
6
+ item: NewsItem
7
+ parameters: VixonicParameters
8
+ style?: React.CSSProperties
9
+ }
10
+
11
+ export const TextContainer: React.FunctionComponent<Props> = (props) => {
12
+ const { item, parameters, style } = props
13
+ return <div style={{
14
+ ...style,
15
+ display: 'flex',
16
+ flexDirection: 'column',
17
+ justifyContent: parameters.textAlignment || 'center',
18
+ height: '100%',
19
+ flex: 1
20
+ }}>
21
+ {parameters.titleEnabled && <FormattedText text={item.title || ''} unit={'px'}
22
+ format={parameters.titleFormat} lineHeight={parameters.titleLineHeight}
23
+ style={
24
+ (parameters.textSeparation && parameters.titleEnabled && parameters.descriptionEnabled)
25
+ ? { marginBottom: Number(parameters.textSeparation) }
26
+ : undefined
27
+ } multiline />
28
+ }
29
+ {parameters.descriptionEnabled && <FormattedHtmlText html={item.description || ''} unit={'px'}
30
+ format={parameters.descriptionFormat} lineHeight={parameters.descriptionLineHeight}
31
+ defaults={{ fontSize: 10, fontColor: 'black', alignment: 'left' }}
32
+ multiline />
33
+ }
34
+ </div>
35
+ }
@@ -0,0 +1,9 @@
1
+ type NewsItem = {
2
+ id: string
3
+ title?: string
4
+ description?: string
5
+ image?: string
6
+ qrCodeUrl?: string
7
+ qrCodeTitle?: string
8
+ expirationDate?: string
9
+ }
package/src/index.html ADDED
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <html style="position: absolute; height:100%; width: 100%; overflow: hidden;">
3
+ <head>
4
+ <title></title>
5
+ <meta charset="utf-8">
6
+ </head>
7
+ <body style="margin:0; overflow: hidden;">
8
+ <div id="root" style="position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden;">
9
+ </div>
10
+ </body>
11
+ </html>
package/src/main.ts ADDED
@@ -0,0 +1,28 @@
1
+ import ReactDOM from 'react-dom'
2
+ import React from 'react'
3
+ const { ipcRenderer } = require('electron')
4
+
5
+ import { App, Props } from './components/App'
6
+
7
+ let start = false
8
+
9
+ ipcRenderer.on('preload', (_event: any, data: VixonicData) => {
10
+ render(data)
11
+ })
12
+
13
+ ipcRenderer.on('start', (_event: any, data: VixonicData) => {
14
+ start = true
15
+ render(data)
16
+ })
17
+
18
+ ipcRenderer.on('update', (_event: any, data: VixonicData) => {
19
+ render(data)
20
+ })
21
+
22
+ ipcRenderer.on('finish', (_event: any) => {
23
+ // Finish command sent by vixonic player when module is going to be removed
24
+ })
25
+
26
+ function render(data: VixonicData) {
27
+ ReactDOM.render(React.createElement<Props>(App, { data, start }), document.getElementById('root'))
28
+ }
@@ -0,0 +1,80 @@
1
+ declare type VixonicData = {
2
+ downloadsPath: string
3
+ services: { [key: string]: { data?: any; updatedAt?: number } }
4
+ parameters: VixonicParameters
5
+ }
6
+
7
+ declare type VixonicParameters = Partial<{
8
+ news: {
9
+ title: string | string | string | string
10
+ description: string | string | string | string
11
+ image: { id?: string; filename?: string; extension?: string }
12
+ qrCodeUrl: string
13
+ qrCodeTitle: string
14
+ expirationDate: string
15
+ __id: string | undefined
16
+ }[]
17
+ newsSizeSelect: 'short' | 'medium' | 'large' | 'extra-large'
18
+ template: 'standard' | 'gallery' | 'gradient'
19
+ showTime: number
20
+ animationSpeed: number
21
+ animationType: 'fade' | 'crossFade'
22
+ textAlignment: 'flex-start' | 'flex-end' | 'center' | 'space-around' | 'space-between'
23
+ titleEnabled: boolean
24
+ titleFormat: {
25
+ fontSize?: number
26
+ fontColor?: string
27
+ alignment?: { horizontal?: 'left' | 'right' | 'center' }
28
+ font?: { filename: string; id: string; __isAsset: true }
29
+ }
30
+ titleLineHeight: number
31
+ descriptionEnabled: boolean
32
+ descriptionFormat: {
33
+ fontSize?: number
34
+ fontColor?: string
35
+ alignment?: { horizontal?: 'left' | 'right' | 'center' }
36
+ font?: { filename: string; id: string; __isAsset: true }
37
+ }
38
+ descriptionLineHeight: number
39
+ textSeparation: number
40
+ imageEnabled: boolean
41
+ imageSize: 'small' | 'medium' | 'large' | 'custom'
42
+ imageCustomSize: number
43
+ imagePosition: 'top' | 'right' | 'bottom' | 'left'
44
+ imageMode: 'contain' | 'cover' | 'fill' | 'none'
45
+ imageStyle: 'normal' | 'rounded' | 'circle' | 'hex'
46
+ imageSeparation: number
47
+ gradientBackgroundColor: string
48
+ gradientRate: number
49
+ gradientOrientation: 'left' | 'right'
50
+ gradientTitleEnabled: boolean
51
+ gradientTitle: string
52
+ gradientTitlePositionX: number
53
+ gradientTitlePositionY: number
54
+ gradientTitleFormat: {
55
+ fontSize?: number
56
+ fontColor?: string
57
+ alignment?: { horizontal?: 'left' | 'right' | 'center' }
58
+ font?: { filename: string; id: string; __isAsset: true }
59
+ }
60
+ barSize: 'small' | 'medium' | 'big'
61
+ barColor: string
62
+ barOpacity: number
63
+ iconVisible: boolean
64
+ iconColor: string
65
+ qrCodeEnabled: boolean
66
+ qrCodeWidth: number
67
+ qrCodeHeight: number
68
+ qrCodePositionX: number
69
+ qrCodePositionY: number
70
+ qrCodeBackgroundColor: string
71
+ qrCodeColor: string
72
+ QrCodeTitleFormat: {
73
+ fontSize?: number
74
+ fontColor?: string
75
+ alignment?: { horizontal?: 'left' | 'right' | 'center' }
76
+ font?: { filename: string; id: string; __isAsset: true }
77
+ }
78
+ background: { id?: string; filename?: string; extension?: string }
79
+ padding: string
80
+ }>
Binary file
Binary file
Binary file
@@ -0,0 +1,62 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <style type="text/css">
5
+ @font-face {
6
+ font-family: 'MainFont';
7
+ src: url('./assets/main-font.ttf'); /* IE9 Compat Modes */
8
+
9
+ }
10
+ .news-item, .background {
11
+ position: absolute;
12
+ width: 800px;
13
+ height: 500px;
14
+ background-image: url('./assets/background.png');
15
+ }
16
+ .news-item__title {
17
+ display: flex;
18
+ position: absolute;
19
+ top: 35px;
20
+ left: 35px;
21
+ width: 725px;
22
+ height: 52px;
23
+ align-items: center;
24
+ font-size: 30px;
25
+ font-family: 'MainFont';
26
+ color: #112244;
27
+ }
28
+ .news-item__description {
29
+ display: flex;
30
+ position: absolute;
31
+ top: 155px;
32
+ left: 390px;
33
+ width: 370px;
34
+ height: 292px;
35
+ font-size: 25px;
36
+ font-family: 'MainFont';
37
+ color: #224466;
38
+ }
39
+ .news-item__image, .news-item__image-loading, .news-item__image-error {
40
+ border-radius: 10px;
41
+ position: absolute;
42
+ left: 32px;
43
+ top: 135px;
44
+ width: 335px;
45
+ height: 335px;
46
+ object-fit: cover;
47
+ }
48
+ </style>
49
+ </head>
50
+ <body>
51
+ <div class="background"></div>
52
+ <div class="news-item">
53
+ <div class="news-item__title">Título</div>
54
+ <div class="news-item__description">Descripción</div>
55
+ <div>
56
+ <img class="news-item__image">
57
+ <img class="news-item__image-error" src="./assets/image-error.png">
58
+ <img class="news-item__image-loading" src="./assets/image-loading.gif">
59
+ </div>
60
+ </div>
61
+ </body>
62
+ </html>
Binary file
@@ -0,0 +1,96 @@
1
+ {
2
+ "parameters": {
3
+ "maxTitleShort": 25,
4
+ "maxTitleMedium": 50,
5
+ "maxTitleLarge": 70,
6
+ "maxDescriptionShort": 80,
7
+ "maxDescriptionMedium": 350,
8
+ "maxDescriptionLarge": 500,
9
+ "animationSpeed": 1.75,
10
+ "animationType": "fade",
11
+ "automaticShowTime": false,
12
+ "background": {
13
+ "filename": "fondo-noticiario-vitacura.jpg"
14
+ },
15
+ "descriptionEnabled": true,
16
+ "descriptionFormat": {
17
+ "alignment": {
18
+ "horizontal": "left"
19
+ },
20
+ "fontColor": "#224466",
21
+ "fontSize": "24"
22
+ },
23
+ "imageEnabled": true,
24
+ "imageMode": "contain",
25
+ "imagePosition": "left",
26
+ "imageSize": "medium",
27
+ "imageSeparation": -50,
28
+ "news": [
29
+ {
30
+ "$$hashKey": "object:584",
31
+ "description": "Colabra",
32
+ "image": {
33
+ "__type": "kna-resource",
34
+ "filename": "colabra.jpg"
35
+ },
36
+ "title": "Las bandas elásticas apañan en casa🏋🏻 #SKCBalance",
37
+ "qrCodeUrl": "https://vixonic.com/",
38
+ "qrCodeTitle": "Entra a Vixonic",
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
+ }
65
+ ],
66
+ "padding": "25px 80px 120px 20px",
67
+ "showTime": 5,
68
+ "showTimeSpeed": 200,
69
+ "template": "standard",
70
+ "templateUrl": {
71
+ "filename": "custom-template.zip"
72
+ },
73
+ "qrCodeEnabled": true,
74
+ "qrCodePositionX": 1600,
75
+ "qrCodePositionY": 700,
76
+ "QrCodeTitleFormat": {
77
+ "alignment": {
78
+ "horizontal": "center"
79
+ },
80
+ "fontColor": "#336699",
81
+ "fontSize": "24"
82
+ },
83
+ "textAlignment": "center",
84
+ "titleEnabled": true,
85
+ "titleFormat": {
86
+ "alignment": {
87
+ "horizontal": "left"
88
+ },
89
+ "font": {
90
+ "filename": "font-title.otf"
91
+ },
92
+ "fontColor": "#336699",
93
+ "fontSize": "36"
94
+ }
95
+ }
96
+ }
package/tsconfig.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "es2015",
4
- "module": "es2015",
3
+ "target": "es6",
4
+ "module": "esnext",
5
5
  "moduleResolution": "node",
6
- "jsx": "preserve",
6
+ "jsx": "react-jsx",
7
7
  "allowJs": true,
8
8
  "checkJs": true,
9
9
  "allowSyntheticDefaultImports": true,
@@ -19,6 +19,7 @@
19
19
  "noUnusedLocals": true,
20
20
  "noUnusedParameters": true,
21
21
  "sourceMap": true,
22
+ "skipLibCheck": true,
22
23
  "types": ["node"],
23
24
  "typeRoots": ["./node_modules/@types", "./src"]
24
25
  },