@vixoniccom/news-internal 0.4.21-dev.33 → 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/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 appereanceGroup = new Group({
6
- id: 'appaeranceGroup',
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: 'titleMedium',
14
- subtitle: 'descriptionMedium',
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: 'titleShort',
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: 'titleMedium',
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: 'titleLarge',
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: 'titleExtraLarge',
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: 'descriptionShort',
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: 'descriptionMedium',
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: 'descriptionLarge',
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: 'descriptionExtraLarge',
70
+ id: 'description',
71
71
  label: 'Descripción extra larga',
72
72
  required: true,
73
73
  show: ShowValidations.extraLargeDescriptionEnabled,
@@ -7,7 +7,7 @@
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",
@@ -16,7 +16,7 @@
16
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",
@@ -25,7 +25,7 @@
25
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",
@@ -34,7 +34,7 @@
34
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",
@@ -43,7 +43,7 @@
43
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",
@@ -53,7 +53,7 @@
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",
@@ -63,7 +63,7 @@
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",
@@ -73,7 +73,7 @@
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",
@@ -129,7 +129,7 @@
129
129
  "sortable": true
130
130
  },
131
131
  {
132
- "id": "appaeranceGroup",
132
+ "id": "appearanceGroup",
133
133
  "label": "Apariencia",
134
134
  "type": "group",
135
135
  "items": [
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "author": {
9
9
  "name": ""
10
10
  },
11
- "version": "0.4.21-dev.33",
11
+ "version": "0.4.21-dev.35",
12
12
  "scripts": {
13
13
  "prepublish": "vixonic-module-packager --mode=build",
14
14
  "watch": "vixonic-module-packager --mode=watch",
@@ -1,5 +1,4 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { v4 as uuid } from 'uuid'
3
2
  import { NewsContainer } from './NewsContainer'
4
3
  import { FontLoader } from './FontLoader'
5
4
  import dayjs from 'dayjs'
@@ -11,27 +10,17 @@ export type Props = {
11
10
  export const App: React.FunctionComponent<Props> = ({ data }) => {
12
11
  const [news, setNews] = useState<NewsItem[]>([])
13
12
 
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`] || ''
22
- }
23
-
24
13
  const parseNews = (data?: VixonicData): NewsItem[] => {
25
14
  if (!data) return []
26
- const { news, newsSizeSelect } = data.parameters
15
+ const { news } = data.parameters
27
16
  const parsedNews = news?.map((n, index) => {
28
17
  const { image, ...rest } = n
29
18
  let parsedImage
30
19
  const qrUrl = n.qrCodeUrl
31
20
  if (image?.filename) parsedImage = `${data.downloadsPath}/${image.filename}`
32
21
 
33
- let title = getPrefixBySize(n, newsSizeSelect ?? 'medium', 'title')
34
- let description = getPrefixBySize(n, newsSizeSelect ?? 'medium', 'description')
22
+ let title = n.title
23
+ let description = n.description
35
24
 
36
25
  return {
37
26
  ...rest,
package/src/global.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ declare module '*.css'
2
+
1
3
  type NewsItem = {
2
4
  id: string
3
5
  title?: string
@@ -7,14 +7,8 @@ declare type VixonicData = {
7
7
  declare type VixonicParameters =
8
8
  Partial<{
9
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,
10
+ title: string,
11
+ description: string,
18
12
  image: {
19
13
  id?: string,
20
14
  filename?: string,