@vixoniccom/news-internal 0.4.19 → 0.4.20-dev.1

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 +11 -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 +103 -0
  21. package/configuration.json +17 -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,39 @@
1
+ /**
2
+ * @license React
3
+ * react-dom.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
10
+
11
+ /**
12
+ * @license React
13
+ * react-jsx-runtime.production.min.js
14
+ *
15
+ * Copyright (c) Facebook, Inc. and its affiliates.
16
+ *
17
+ * This source code is licensed under the MIT license found in the
18
+ * LICENSE file in the root directory of this source tree.
19
+ */
20
+
21
+ /**
22
+ * @license React
23
+ * react.production.min.js
24
+ *
25
+ * Copyright (c) Facebook, Inc. and its affiliates.
26
+ *
27
+ * This source code is licensed under the MIT license found in the
28
+ * LICENSE file in the root directory of this source tree.
29
+ */
30
+
31
+ /**
32
+ * @license React
33
+ * scheduler.production.min.js
34
+ *
35
+ * Copyright (c) Facebook, Inc. and its affiliates.
36
+ *
37
+ * This source code is licensed under the MIT license found in the
38
+ * LICENSE file in the root directory of this source tree.
39
+ */
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/build.zip CHANGED
Binary file
@@ -1,114 +1,8 @@
1
- import { Configuration, List, TextInput, SelectAssetKna, TextArea, NumberRangeValue, DateInput } from '@vixoniccom/modules'
1
+ import { Configuration } from '@vixoniccom/modules'
2
2
  import { appereanceGroup } from './appearanceGroup'
3
- import { ShowValidations } from './utils'
4
-
5
- const newsList = new List({
6
- id: 'news',
7
- label: 'Noticias',
8
- description: 'Lista de noticias',
9
- sortable: true,
10
- itemSchema: [
11
- new TextInput({
12
- id: 'title',
13
- label: 'Título corto',
14
- required: true,
15
- show: ShowValidations.shortTitleEnabled,
16
- range: new NumberRangeValue(1, 25)
17
- }),
18
- new TextInput({
19
- id: 'title',
20
- label: 'Título mediano',
21
- required: true,
22
- show: ShowValidations.mediumTitleEnabled,
23
- range: new NumberRangeValue(1, 40)
24
- }),
25
- new TextInput({
26
- id: 'title',
27
- label: 'Título largo',
28
- required: true,
29
- show: ShowValidations.largeTitleEnabled,
30
- range: new NumberRangeValue(1, 50)
31
- }),
32
-
33
- new TextInput({
34
- id: 'title',
35
- label: 'Título extra largo',
36
- required: true,
37
- show: ShowValidations.extraLargeTitleEnabled,
38
- range: new NumberRangeValue(1, 70)
39
- }),
40
-
41
- new TextArea({
42
- id: 'description',
43
- label: 'Descripción corta',
44
- required: true,
45
- show: ShowValidations.shortDescriptionEnabled,
46
- range: new NumberRangeValue(1, 80),
47
- html: true
48
- }),
49
-
50
- new TextArea({
51
- id: 'description',
52
- label: 'Descripción mediana',
53
- required: true,
54
- show: ShowValidations.mediumDescriptionEnabled,
55
- range: new NumberRangeValue(1, 180),
56
- html: true
57
- }),
58
-
59
- new TextArea({
60
- id: 'description',
61
- label: 'Descripción larga',
62
- required: true,
63
- show: ShowValidations.largeDescriptionEnabled,
64
- range: new NumberRangeValue(1, 350),
65
- html: true
66
- }),
67
-
68
- new TextArea({
69
- id: 'description',
70
- label: 'Descripción extra larga',
71
- required: true,
72
- show: ShowValidations.extraLargeDescriptionEnabled,
73
- range: new NumberRangeValue(1, 500),
74
- html: true
75
- }),
76
-
77
- new SelectAssetKna({ id: 'image', label: 'Imagen', required: true,
78
- extensions: ['jpg', 'jpeg', 'png', 'svg'], show: (ShowValidations.imageForceEnabled)
79
- }),
80
-
81
- new TextInput({
82
- id: 'qrCodeUrl',
83
- label: 'URL código QR',
84
- required: true,
85
- show: ShowValidations.qrCodeEnabled
86
- }),
87
-
88
- new TextInput({
89
- id: 'qrCodeTitle',
90
- label: 'Título código QR',
91
- required: false,
92
- show: ShowValidations.qrCodeEnabled
93
- }),
94
-
95
- new DateInput({
96
- id: 'expirationDate',
97
- label: 'Fecha de expiración Noticia',
98
- })
99
- ],
100
- itemDisplayClass: '2-lines',
101
- itemDisplayAttributes: {
102
- title: 'title',
103
- subtitle: 'description',
104
- expirationDate: "expirationDate"
105
- }
106
- })
3
+ import { newsGroup } from './newsGroup'
107
4
 
108
5
  export const configuration: Configuration = new Configuration({
109
6
  durationFormula: `(_values.news && _values.news.filter(function(newsItem) { return new Date(newsItem.expirationDate) > new Date() || isNaN(new Date(newsItem.expirationDate)) ; }).length || 0) * (_values.showTime || 10)`,
110
- schema: [
111
- newsList,
112
- appereanceGroup
113
- ]
7
+ schema: [newsGroup, appereanceGroup],
114
8
  })
@@ -0,0 +1,16 @@
1
+ import { List } from '@vixoniccom/modules'
2
+ import { newsInputs } from './newsInputs'
3
+
4
+ export const newsGroup = new List({
5
+ id: 'news',
6
+ label: 'Noticias',
7
+ description: 'Lista de noticias',
8
+ sortable: true,
9
+ itemSchema: [...newsInputs],
10
+ itemDisplayClass: '2-lines',
11
+ itemDisplayAttributes: {
12
+ title: 'title',
13
+ subtitle: 'description',
14
+ expirationDate: 'expirationDate',
15
+ },
16
+ })
@@ -0,0 +1,103 @@
1
+ import { DateInput, NumberRangeValue, SelectAssetKna, TextArea, TextInput } from '@vixoniccom/modules'
2
+ import { ShowValidations } from '../utils'
3
+
4
+ export const newsInputs = [
5
+ new TextInput({
6
+ id: 'title',
7
+ label: 'Título corto',
8
+ required: true,
9
+ show: ShowValidations.shortTitleEnabled,
10
+ range: new NumberRangeValue(1, 25),
11
+ pattern: '^(?!\\s*$).+',
12
+ }),
13
+ new TextInput({
14
+ id: 'title',
15
+ label: 'Título mediano',
16
+ required: true,
17
+ show: ShowValidations.mediumTitleEnabled,
18
+ range: new NumberRangeValue(1, 40),
19
+ pattern: '^(?!\\s*$).+',
20
+ }),
21
+ new TextInput({
22
+ id: 'title',
23
+ label: 'Título largo',
24
+ required: true,
25
+ show: ShowValidations.largeTitleEnabled,
26
+ range: new NumberRangeValue(1, 50),
27
+ pattern: '^(?!\\s*$).+',
28
+ }),
29
+
30
+ new TextInput({
31
+ id: 'title',
32
+ label: 'Título extra largo',
33
+ required: true,
34
+ show: ShowValidations.extraLargeTitleEnabled,
35
+ range: new NumberRangeValue(1, 70),
36
+ pattern: '^(?!\\s*$).+',
37
+ }),
38
+
39
+ new TextArea({
40
+ id: 'description',
41
+ label: 'Descripción corta',
42
+ required: true,
43
+ show: ShowValidations.shortDescriptionEnabled,
44
+ range: new NumberRangeValue(1, 80),
45
+ html: true,
46
+ }),
47
+
48
+ new TextArea({
49
+ id: 'description',
50
+ label: 'Descripción mediana',
51
+ required: true,
52
+ show: ShowValidations.mediumDescriptionEnabled,
53
+ range: new NumberRangeValue(1, 180),
54
+ html: true,
55
+ }),
56
+
57
+ new TextArea({
58
+ id: 'description',
59
+ label: 'Descripción larga',
60
+ required: true,
61
+ show: ShowValidations.largeDescriptionEnabled,
62
+ range: new NumberRangeValue(1, 350),
63
+ html: true,
64
+ }),
65
+
66
+ new TextArea({
67
+ id: 'description',
68
+ label: 'Descripción extra larga',
69
+ required: true,
70
+ show: ShowValidations.extraLargeDescriptionEnabled,
71
+ range: new NumberRangeValue(1, 500),
72
+ html: true,
73
+ }),
74
+
75
+ new SelectAssetKna({
76
+ id: 'image',
77
+ label: 'Imagen',
78
+ required: true,
79
+ extensions: ['jpg', 'jpeg', 'png', 'svg'],
80
+ show: ShowValidations.imageForceEnabled,
81
+ }),
82
+
83
+ new TextInput({
84
+ id: 'qrCodeUrl',
85
+ label: 'URL código QR',
86
+ required: true,
87
+ show: ShowValidations.qrCodeEnabled,
88
+ pattern: '^(?!\\s*$).+',
89
+ }),
90
+
91
+ new TextInput({
92
+ id: 'qrCodeTitle',
93
+ label: 'Título código QR',
94
+ required: false,
95
+ show: ShowValidations.qrCodeEnabled,
96
+ pattern: '^(?!\\s*$).+',
97
+ }),
98
+
99
+ new DateInput({
100
+ id: 'expirationDate',
101
+ label: 'Fecha de expiración Noticia',
102
+ }),
103
+ ]
@@ -1,5 +1,5 @@
1
1
  {
2
- "durationFormula": "(_values.news && _values.news.filter(function(newsItem) { return new Date(newsItem.expirationDate) > new Date() || isNaN(new Date(newsItem.expirationDate)) ; }).length || 1) * (_values.showTime || 10)",
2
+ "durationFormula": "(_values.news && _values.news.filter(function(newsItem) { return new Date(newsItem.expirationDate) > new Date() || isNaN(new Date(newsItem.expirationDate)) ; }).length || 0) * (_values.showTime || 10)",
3
3
  "schema": [
4
4
  {
5
5
  "id": "news",
@@ -12,7 +12,8 @@
12
12
  "show": "{{titleEnabled}} === true && ({{newsSizeSelect}} === 'short')",
13
13
  "type": "text-input",
14
14
  "required": true,
15
- "range": "[1:25]"
15
+ "pattern": "^(?!\\s*$).+",
16
+ "range": "[1:25:]"
16
17
  },
17
18
  {
18
19
  "id": "title",
@@ -20,7 +21,8 @@
20
21
  "show": "{{titleEnabled}} === true && ({{newsSizeSelect}} === 'medium')",
21
22
  "type": "text-input",
22
23
  "required": true,
23
- "range": "[1:40]"
24
+ "pattern": "^(?!\\s*$).+",
25
+ "range": "[1:40:]"
24
26
  },
25
27
  {
26
28
  "id": "title",
@@ -28,7 +30,8 @@
28
30
  "show": "{{titleEnabled}} === true && ({{newsSizeSelect}} === 'large')",
29
31
  "type": "text-input",
30
32
  "required": true,
31
- "range": "[1:50]"
33
+ "pattern": "^(?!\\s*$).+",
34
+ "range": "[1:50:]"
32
35
  },
33
36
  {
34
37
  "id": "title",
@@ -36,7 +39,8 @@
36
39
  "show": "{{titleEnabled}} === true && ({{newsSizeSelect}} === 'extra-large')",
37
40
  "type": "text-input",
38
41
  "required": true,
39
- "range": "[1:70]"
42
+ "pattern": "^(?!\\s*$).+",
43
+ "range": "[1:70:]"
40
44
  },
41
45
  {
42
46
  "id": "description",
@@ -44,7 +48,7 @@
44
48
  "show": "{{descriptionEnabled}} === true && ({{newsSizeSelect}} === 'short')",
45
49
  "type": "text-area",
46
50
  "required": true,
47
- "range": "[1:80]",
51
+ "range": "[1:80:]",
48
52
  "html": true
49
53
  },
50
54
  {
@@ -53,7 +57,7 @@
53
57
  "show": "{{descriptionEnabled}} === true && ({{newsSizeSelect}} === 'medium')",
54
58
  "type": "text-area",
55
59
  "required": true,
56
- "range": "[1:180]",
60
+ "range": "[1:180:]",
57
61
  "html": true
58
62
  },
59
63
  {
@@ -62,7 +66,7 @@
62
66
  "show": "{{descriptionEnabled}} === true && ({{newsSizeSelect}} === 'large')",
63
67
  "type": "text-area",
64
68
  "required": true,
65
- "range": "[1:350]",
69
+ "range": "[1:350:]",
66
70
  "html": true
67
71
  },
68
72
  {
@@ -71,7 +75,7 @@
71
75
  "show": "{{descriptionEnabled}} === true && ({{newsSizeSelect}} === 'extra-large')",
72
76
  "type": "text-area",
73
77
  "required": true,
74
- "range": "[1:500]",
78
+ "range": "[1:500:]",
75
79
  "html": true
76
80
  },
77
81
  {
@@ -93,14 +97,16 @@
93
97
  "label": "URL código QR",
94
98
  "show": "{{qrCodeEnabled}} === true",
95
99
  "type": "text-input",
96
- "required": true
100
+ "required": true,
101
+ "pattern": "^(?!\\s*$).+"
97
102
  },
98
103
  {
99
104
  "id": "qrCodeTitle",
100
105
  "label": "Título código QR",
101
106
  "show": "{{qrCodeEnabled}} === true",
102
107
  "type": "text-input",
103
- "required": false
108
+ "required": false,
109
+ "pattern": "^(?!\\s*$).+"
104
110
  },
105
111
  {
106
112
  "id": "expirationDate",
package/package.json CHANGED
@@ -8,9 +8,9 @@
8
8
  "author": {
9
9
  "name": ""
10
10
  },
11
- "version": "0.4.19",
11
+ "version": "0.4.20-dev.1",
12
12
  "scripts": {
13
- "prepublishOnly": "vixonic-module-packager --mode=build",
13
+ "prepublish": "vixonic-module-packager --mode=build",
14
14
  "watch": "vixonic-module-packager --mode=watch",
15
15
  "run": "vixonic-module-packager --mode=run",
16
16
  "configuration": "vixonic-module-packager --mode generate-configuration",
@@ -20,21 +20,23 @@
20
20
  "prerelease-dev": "standard-version --prerelease dev"
21
21
  },
22
22
  "dependencies": {
23
- "dayjs": "^1.11.7",
24
- "react": "^17.0.2",
25
- "react-dom": "^17.0.2",
26
- "react-qr-code": "^2.0.2",
27
- "react-quill": "^1.3.5",
23
+ "dayjs": "^1.11.18",
24
+ "dompurify": "^3.2.6",
25
+ "react": "^18.3.1",
26
+ "react-dom": "^18.3.1",
27
+ "react-qr-code": "^2.0.18",
28
+ "react-quill": "^2.0.0",
28
29
  "react-transition-group": "^4.4.5",
29
30
  "uuid": "^9.0.0"
30
31
  },
31
32
  "devDependencies": {
32
- "@types/react": "^17.0.35",
33
- "@types/react-dom": "^17.0.11",
34
- "@types/react-transition-group": "^4.4.5",
33
+ "@types/dompurify": "^3.0.5",
34
+ "@types/react": "^18.3.23",
35
+ "@types/react-dom": "^18.3.7",
36
+ "@types/react-transition-group": "^4.4.12",
35
37
  "@types/uuid": "^9.0.1",
36
- "@vixoniccom/module-packager": "^2.10.1",
37
- "@vixoniccom/modules": "^2.20.0",
38
+ "@vixoniccom/module-packager": "^2.13.0-dev.1",
39
+ "@vixoniccom/modules": "^2.22.0-dev.3",
38
40
  "standard-version": "^9.5.0"
39
41
  }
40
42
  }