@vixoniccom/news-internal 0.4.21-dev.34 → 0.4.21-dev.35
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/CHANGELOG.md +2 -0
- package/build/main.js +1 -1
- package/build.zip +0 -0
- package/configuration/appearanceGroup/index.ts +2 -2
- package/configuration/newsGroup/index.ts +2 -2
- package/configuration/newsGroup/newsInputs.ts +8 -8
- package/configuration.json +9 -9
- package/package.json +1 -1
- package/src/components/App.tsx +3 -13
- package/src/parameters.d.ts +2 -8
package/build.zip
CHANGED
|
Binary file
|
|
@@ -2,8 +2,8 @@ import { Group } from '@vixoniccom/modules'
|
|
|
2
2
|
import { generalInputs } from './generalInputs'
|
|
3
3
|
import { elementsInputs } from './elementsInputs'
|
|
4
4
|
|
|
5
|
-
export const
|
|
6
|
-
id: '
|
|
5
|
+
export const appearanceGroup = new Group({
|
|
6
|
+
id: 'appearanceGroup',
|
|
7
7
|
label: 'Apariencia',
|
|
8
8
|
items: [
|
|
9
9
|
...generalInputs,
|
|
@@ -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: '
|
|
14
|
-
subtitle: '
|
|
13
|
+
title: 'title',
|
|
14
|
+
subtitle: 'description',
|
|
15
15
|
expirationDate: 'expirationDate',
|
|
16
16
|
},
|
|
17
17
|
})
|
|
@@ -3,7 +3,7 @@ import { ShowValidations } from '../utils'
|
|
|
3
3
|
|
|
4
4
|
export const newsInputs = [
|
|
5
5
|
new TextInput({
|
|
6
|
-
id: '
|
|
6
|
+
id: 'title',
|
|
7
7
|
label: 'Título corto',
|
|
8
8
|
required: true,
|
|
9
9
|
show: ShowValidations.shortTitleEnabled,
|
|
@@ -11,7 +11,7 @@ export const newsInputs = [
|
|
|
11
11
|
pattern: '^(?!\\s*$).+',
|
|
12
12
|
}),
|
|
13
13
|
new TextInput({
|
|
14
|
-
id: '
|
|
14
|
+
id: 'title',
|
|
15
15
|
label: 'Título mediano',
|
|
16
16
|
required: true,
|
|
17
17
|
show: ShowValidations.mediumTitleEnabled,
|
|
@@ -19,7 +19,7 @@ export const newsInputs = [
|
|
|
19
19
|
pattern: '^(?!\\s*$).+',
|
|
20
20
|
}),
|
|
21
21
|
new TextInput({
|
|
22
|
-
id: '
|
|
22
|
+
id: 'title',
|
|
23
23
|
label: 'Título largo',
|
|
24
24
|
required: true,
|
|
25
25
|
show: ShowValidations.largeTitleEnabled,
|
|
@@ -28,7 +28,7 @@ export const newsInputs = [
|
|
|
28
28
|
}),
|
|
29
29
|
|
|
30
30
|
new TextInput({
|
|
31
|
-
id: '
|
|
31
|
+
id: 'title',
|
|
32
32
|
label: 'Título extra largo',
|
|
33
33
|
required: true,
|
|
34
34
|
show: ShowValidations.extraLargeTitleEnabled,
|
|
@@ -37,7 +37,7 @@ export const newsInputs = [
|
|
|
37
37
|
}),
|
|
38
38
|
|
|
39
39
|
new TextArea({
|
|
40
|
-
id: '
|
|
40
|
+
id: 'description',
|
|
41
41
|
label: 'Descripción corta',
|
|
42
42
|
required: true,
|
|
43
43
|
show: ShowValidations.shortDescriptionEnabled,
|
|
@@ -47,7 +47,7 @@ export const newsInputs = [
|
|
|
47
47
|
}),
|
|
48
48
|
|
|
49
49
|
new TextArea({
|
|
50
|
-
id: '
|
|
50
|
+
id: 'description',
|
|
51
51
|
label: 'Descripción mediana',
|
|
52
52
|
required: true,
|
|
53
53
|
show: ShowValidations.mediumDescriptionEnabled,
|
|
@@ -57,7 +57,7 @@ export const newsInputs = [
|
|
|
57
57
|
}),
|
|
58
58
|
|
|
59
59
|
new TextArea({
|
|
60
|
-
id: '
|
|
60
|
+
id: 'description',
|
|
61
61
|
label: 'Descripción larga',
|
|
62
62
|
required: true,
|
|
63
63
|
show: ShowValidations.largeDescriptionEnabled,
|
|
@@ -67,7 +67,7 @@ export const newsInputs = [
|
|
|
67
67
|
}),
|
|
68
68
|
|
|
69
69
|
new TextArea({
|
|
70
|
-
id: '
|
|
70
|
+
id: 'description',
|
|
71
71
|
label: 'Descripción extra larga',
|
|
72
72
|
required: true,
|
|
73
73
|
show: ShowValidations.extraLargeDescriptionEnabled,
|
package/configuration.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"type": "list",
|
|
8
8
|
"itemSchema": [
|
|
9
9
|
{
|
|
10
|
-
"id": "
|
|
10
|
+
"id": "title",
|
|
11
11
|
"label": "Título corto",
|
|
12
12
|
"show": "{{titleEnabled}} === true && ({{newsSizeSelect}} === 'short')",
|
|
13
13
|
"type": "text-input",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"range": "[1:25]"
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
|
-
"id": "
|
|
19
|
+
"id": "title",
|
|
20
20
|
"label": "Título mediano",
|
|
21
21
|
"show": "{{titleEnabled}} === true && ({{newsSizeSelect}} === 'medium')",
|
|
22
22
|
"type": "text-input",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"range": "[1:40]"
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
|
-
"id": "
|
|
28
|
+
"id": "title",
|
|
29
29
|
"label": "Título largo",
|
|
30
30
|
"show": "{{titleEnabled}} === true && ({{newsSizeSelect}} === 'large')",
|
|
31
31
|
"type": "text-input",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"range": "[1:50]"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
"id": "
|
|
37
|
+
"id": "title",
|
|
38
38
|
"label": "Título extra largo",
|
|
39
39
|
"show": "{{titleEnabled}} === true && ({{newsSizeSelect}} === 'extra-large')",
|
|
40
40
|
"type": "text-input",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"range": "[1:70]"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
|
-
"id": "
|
|
46
|
+
"id": "description",
|
|
47
47
|
"label": "Descripción corta",
|
|
48
48
|
"show": "{{descriptionEnabled}} === true && ({{newsSizeSelect}} === 'short')",
|
|
49
49
|
"type": "text-area",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"html": true
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
|
-
"id": "
|
|
56
|
+
"id": "description",
|
|
57
57
|
"label": "Descripción mediana",
|
|
58
58
|
"show": "{{descriptionEnabled}} === true && ({{newsSizeSelect}} === 'medium')",
|
|
59
59
|
"type": "text-area",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"html": true
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
|
-
"id": "
|
|
66
|
+
"id": "description",
|
|
67
67
|
"label": "Descripción larga",
|
|
68
68
|
"show": "{{descriptionEnabled}} === true && ({{newsSizeSelect}} === 'large')",
|
|
69
69
|
"type": "text-area",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"html": true
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
|
-
"id": "
|
|
76
|
+
"id": "description",
|
|
77
77
|
"label": "Descripción extra larga",
|
|
78
78
|
"show": "{{descriptionEnabled}} === true && ({{newsSizeSelect}} === 'extra-large')",
|
|
79
79
|
"type": "text-area",
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"sortable": true
|
|
130
130
|
},
|
|
131
131
|
{
|
|
132
|
-
"id": "
|
|
132
|
+
"id": "appearanceGroup",
|
|
133
133
|
"label": "Apariencia",
|
|
134
134
|
"type": "group",
|
|
135
135
|
"items": [
|
package/package.json
CHANGED
package/src/components/App.tsx
CHANGED
|
@@ -10,27 +10,17 @@ export type Props = {
|
|
|
10
10
|
export const App: React.FunctionComponent<Props> = ({ data }) => {
|
|
11
11
|
const [news, setNews] = useState<NewsItem[]>([])
|
|
12
12
|
|
|
13
|
-
const getPrefixBySize = (n: any, size: string, prefix: string): string => {
|
|
14
|
-
const prefixMap: { [key: string]: string } = {
|
|
15
|
-
'short': n[`${prefix}Short`],
|
|
16
|
-
'medium': n[`${prefix}Medium`],
|
|
17
|
-
'large': n[`${prefix}Large`],
|
|
18
|
-
'extra-large': n[`${prefix}ExtraLarge`]
|
|
19
|
-
}
|
|
20
|
-
return prefixMap[size] || n[`${prefix}Medium`] || n[prefix] || ''
|
|
21
|
-
}
|
|
22
|
-
|
|
23
13
|
const parseNews = (data?: VixonicData): NewsItem[] => {
|
|
24
14
|
if (!data) return []
|
|
25
|
-
const { news
|
|
15
|
+
const { news } = data.parameters
|
|
26
16
|
const parsedNews = news?.map((n, index) => {
|
|
27
17
|
const { image, ...rest } = n
|
|
28
18
|
let parsedImage
|
|
29
19
|
const qrUrl = n.qrCodeUrl
|
|
30
20
|
if (image?.filename) parsedImage = `${data.downloadsPath}/${image.filename}`
|
|
31
21
|
|
|
32
|
-
let title =
|
|
33
|
-
let description =
|
|
22
|
+
let title = n.title
|
|
23
|
+
let description = n.description
|
|
34
24
|
|
|
35
25
|
return {
|
|
36
26
|
...rest,
|
package/src/parameters.d.ts
CHANGED
|
@@ -7,14 +7,8 @@ declare type VixonicData = {
|
|
|
7
7
|
declare type VixonicParameters =
|
|
8
8
|
Partial<{
|
|
9
9
|
news: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
titleLarge: string,
|
|
13
|
-
titleExtraLarge: string,
|
|
14
|
-
descriptionShort: string,
|
|
15
|
-
descriptionMedium: string,
|
|
16
|
-
descriptionLarge: string,
|
|
17
|
-
descriptionExtraLarge: string,
|
|
10
|
+
title: string,
|
|
11
|
+
description: string,
|
|
18
12
|
image: {
|
|
19
13
|
id?: string,
|
|
20
14
|
filename?: string,
|