@vixoniccom/news-internal 0.4.21-dev.32 → 0.4.21-dev.34

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
@@ -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: 'title',
14
- subtitle: 'description',
13
+ title: 'titleMedium',
14
+ subtitle: 'descriptionMedium',
15
15
  expirationDate: 'expirationDate',
16
16
  },
17
17
  })
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "author": {
9
9
  "name": ""
10
10
  },
11
- "version": "0.4.21-dev.32",
11
+ "version": "0.4.21-dev.34",
12
12
  "scripts": {
13
13
  "prepublish": "vixonic-module-packager --mode=build",
14
14
  "watch": "vixonic-module-packager --mode=watch",
@@ -36,7 +36,7 @@
36
36
  "@types/react-transition-group": "^4.4.12",
37
37
  "@types/uuid": "^9.0.1",
38
38
  "@vixoniccom/module-packager": "^2.13.0-dev.1",
39
- "@vixoniccom/modules": "^2.25.0-dev.14",
39
+ "@vixoniccom/modules": "^2.22.0-dev.3",
40
40
  "standard-version": "^9.5.0"
41
41
  }
42
42
  }
@@ -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'
@@ -18,13 +17,13 @@ export const App: React.FunctionComponent<Props> = ({ data }) => {
18
17
  'large': n[`${prefix}Large`],
19
18
  'extra-large': n[`${prefix}ExtraLarge`]
20
19
  }
21
- return prefixMap[size] || n[`${prefix}Medium`] || ''
20
+ return prefixMap[size] || n[`${prefix}Medium`] || n[prefix] || ''
22
21
  }
23
22
 
24
23
  const parseNews = (data?: VixonicData): NewsItem[] => {
25
24
  if (!data) return []
26
25
  const { news, newsSizeSelect } = data.parameters
27
- const parsedNews = news?.map((n) => {
26
+ const parsedNews = news?.map((n, index) => {
28
27
  const { image, ...rest } = n
29
28
  let parsedImage
30
29
  const qrUrl = n.qrCodeUrl
@@ -38,7 +37,7 @@ export const App: React.FunctionComponent<Props> = ({ data }) => {
38
37
  title,
39
38
  description,
40
39
  image: parsedImage,
41
- id: uuid(),
40
+ id: n.__id ?? String(index),
42
41
  qrCodeUrl: qrUrl
43
42
  }
44
43
  }).filter((n) => {
@@ -18,6 +18,12 @@ export const NewsContainer: React.FunctionComponent<Props> = (props) => {
18
18
  const [currentIndex, setCurrentIndex] = useState(0)
19
19
  const item = props.items.length > currentIndex ? props.items[currentIndex] : undefined
20
20
 
21
+ useEffect(() => {
22
+ if (props.items.length > 0 && currentIndex >= props.items.length) {
23
+ setCurrentIndex(0)
24
+ }
25
+ }, [props.items.length])
26
+
21
27
  useEffect(() => {
22
28
  startTimeout()
23
29
  return () => {
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