@vixoniccom/footbal-score 1.4.5 → 1.4.6-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.
@@ -1,3 +1,9 @@
1
+ /*
2
+ object-assign
3
+ (c) Sindre Sorhus
4
+ @license MIT
5
+ */
6
+
1
7
  /*!
2
8
  localForage -- Offline Storage, Improved
3
9
  Version 1.10.0
@@ -14,9 +20,8 @@
14
20
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
15
21
  */
16
22
 
17
- /**
18
- * @license React
19
- * react-dom.production.min.js
23
+ /** @license React v0.20.2
24
+ * scheduler.production.min.js
20
25
  *
21
26
  * Copyright (c) Facebook, Inc. and its affiliates.
22
27
  *
@@ -24,9 +29,8 @@
24
29
  * LICENSE file in the root directory of this source tree.
25
30
  */
26
31
 
27
- /**
28
- * @license React
29
- * react-jsx-runtime.production.min.js
32
+ /** @license React v17.0.2
33
+ * react-dom.production.min.js
30
34
  *
31
35
  * Copyright (c) Facebook, Inc. and its affiliates.
32
36
  *
@@ -34,9 +38,8 @@
34
38
  * LICENSE file in the root directory of this source tree.
35
39
  */
36
40
 
37
- /**
38
- * @license React
39
- * react.production.min.js
41
+ /** @license React v17.0.2
42
+ * react-jsx-runtime.production.min.js
40
43
  *
41
44
  * Copyright (c) Facebook, Inc. and its affiliates.
42
45
  *
@@ -44,9 +47,8 @@
44
47
  * LICENSE file in the root directory of this source tree.
45
48
  */
46
49
 
47
- /**
48
- * @license React
49
- * scheduler.production.min.js
50
+ /** @license React v17.0.2
51
+ * react.production.min.js
50
52
  *
51
53
  * Copyright (c) Facebook, Inc. and its affiliates.
52
54
  *
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "parameters": {
3
3
  "league": 1,
4
- "timeStart": "1 am",
5
- "timeEnd": "11 pm",
6
- "matchesYesterday": true,
7
- "matchesTomorrow": true,
4
+ "debugTimezone" : false,
5
+ "timeStart": "10 am",
6
+ "timeEnd": "1 am",
7
+ "matchesYesterday": false,
8
+ "matchesTomorrow": false,
8
9
  "itemsPerPage": 2
9
10
  }
10
11
  }
package/build.zip CHANGED
Binary file
@@ -98,4 +98,11 @@ export const dataInputs = [
98
98
  description: 'Duración por página (en segundos)',
99
99
  range: new NumberRangeValue(1, 100),
100
100
  }),
101
+ new Switch({
102
+ id: 'debugTimezone',
103
+ label: 'Debug Timezone',
104
+ displayOnTrue: 'Visible',
105
+ displayOnFalse: 'Oculto',
106
+ defaultValue: false,
107
+ }),
101
108
  ]
@@ -373,6 +373,14 @@
373
373
  "type": "number-input",
374
374
  "range": "[1:100:]",
375
375
  "description": "Duración por página (en segundos)"
376
+ },
377
+ {
378
+ "id": "debugTimezone",
379
+ "label": "Debug Timezone",
380
+ "type": "switch",
381
+ "defaultValue": false,
382
+ "displayOnTrue": "Visible",
383
+ "displayOnFalse": "Oculto"
376
384
  }
377
385
  ]
378
386
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vixoniccom/footbal-score",
3
3
  "alias": "Resultados Deportivos",
4
- "version": "1.4.5",
4
+ "version": "1.4.6-dev.1",
5
5
  "description": "Muestra resultados en vivo de fútbol.",
6
6
  "main": "main.js",
7
7
  "author": "",
@@ -20,12 +20,12 @@
20
20
  "axios": "^1.6.0",
21
21
  "localforage": "^1.10.0",
22
22
  "moment": "^2.29.3",
23
- "react": "^18.3.1",
24
- "react-dom": "^18.3.1"
23
+ "react": "^17.0.2",
24
+ "react-dom": "^17.0.2"
25
25
  },
26
26
  "devDependencies": {
27
- "@types/react": "^18.3.23",
28
- "@types/react-dom": "^18.3.7",
27
+ "@types/react": "^17.0.0",
28
+ "@types/react-dom": "^17.0.0",
29
29
  "@vixoniccom/module-packager": "^2.13.0",
30
30
  "@vixoniccom/modules": "^2.21.0",
31
31
  "standard-version": "^9.5.0"
package/src/App.tsx CHANGED
@@ -56,7 +56,7 @@ export const App: React.FunctionComponent<Props> = ({ data, start }) => {
56
56
  const [dataFixture, setDataFixture] = useState<any[]>([])
57
57
  const [leagueState, setLeagueState] = useState<string>('')
58
58
  const { parameters, downloadsPath } = data
59
- const { backgroundImage, padding, msj0 = '', league = '9' } = parameters
59
+ const { backgroundImage, padding, msj0 = '', league = '9', debugTimezone = false } = parameters
60
60
  const backgroundImageState = backgroundImage?.filename
61
61
  ? `url("${downloadsPath}/${backgroundImage.filename}")`
62
62
  : ''
@@ -142,42 +142,68 @@ export const App: React.FunctionComponent<Props> = ({ data, start }) => {
142
142
  fetchAndSchedule()
143
143
  }, [league])
144
144
 
145
+ const timezone = (() => {
146
+ try { return Intl.DateTimeFormat().resolvedOptions().timeZone } catch { return 'UTC' }
147
+ })()
148
+
145
149
  return (
146
- dataFixture.length > 0 ?
147
- <div style={{
148
- position: 'absolute',
149
- top: 0,
150
- bottom: 0,
151
- left: 0,
152
- right: 0,
153
- backgroundImage: backgroundImageState,
154
- backgroundSize: '100% 100%',
155
- padding: padding
156
- }}>
157
- <FontLoader paths={['nameFormat.font', 'statusFormat.font', 'timeFormat.font', 'titleFormat.font', 'descriptionFormat.font', 'dateDayFormat.font', 'dateMonthFormat.font', 'goalsFormat.font']} parameters={parameters} downloadsPath={downloadsPath} />
158
- {parameters.titleEnabled &&
150
+ <>
151
+ {dataFixture.length > 0 ?
152
+ <div style={{
153
+ position: 'absolute',
154
+ top: 0,
155
+ bottom: 0,
156
+ left: 0,
157
+ right: 0,
158
+ backgroundImage: backgroundImageState,
159
+ backgroundSize: '100% 100%',
160
+ padding: padding
161
+ }}>
162
+ <FontLoader paths={['nameFormat.font', 'statusFormat.font', 'timeFormat.font', 'titleFormat.font', 'descriptionFormat.font', 'dateDayFormat.font', 'dateMonthFormat.font', 'goalsFormat.font']} parameters={parameters} downloadsPath={downloadsPath} />
163
+ {parameters.titleEnabled &&
164
+ <div style={{ display: 'flex', position: 'relative', flex: '1 1 0%', flexDirection: 'column' }}>
165
+ <FormattedText text={parameters.title0 || 'Partidos Mundial'} format={parameters.titleFormat} />
166
+ </div>
167
+ }
168
+ <Table dataFixture={dataFixture} parameters={parameters} />
169
+ </div> :
170
+ <div style={{
171
+ position: 'absolute',
172
+ top: 0,
173
+ bottom: 0,
174
+ left: 0,
175
+ right: 0,
176
+ backgroundImage: backgroundImageState,
177
+ backgroundSize: '100% 100%',
178
+ padding: padding,
179
+ display: 'flex',
180
+ alignItems: parameters.alignVerticalMsj
181
+ }}>
182
+ <FontLoader paths={['nameFormat.font', 'descriptionFormat.font', 'dateDayFormat.font', 'dateMonthFormat.font', 'formatMjs.font']} parameters={parameters} downloadsPath={downloadsPath} />
159
183
  <div style={{ display: 'flex', position: 'relative', flex: '1 1 0%', flexDirection: 'column' }}>
160
- <FormattedText text={parameters.title0 || 'Partidos Mundial'} format={parameters.titleFormat} />
184
+ <FormattedText text={msj0 || 'Sin partidos'} format={parameters.formatMjs} />
161
185
  </div>
162
- }
163
- <Table dataFixture={dataFixture} parameters={parameters} />
164
- </div> :
165
- <div style={{
166
- position: 'absolute',
167
- top: 0,
168
- bottom: 0,
169
- left: 0,
170
- right: 0,
171
- backgroundImage: backgroundImageState,
172
- backgroundSize: '100% 100%',
173
- padding: padding,
174
- display: 'flex',
175
- alignItems: parameters.alignVerticalMsj
176
- }}>
177
- <FontLoader paths={['nameFormat.font', 'descriptionFormat.font', 'dateDayFormat.font', 'dateMonthFormat.font', 'formatMjs.font']} parameters={parameters} downloadsPath={downloadsPath} />
178
- <div style={{ display: 'flex', position: 'relative', flex: '1 1 0%', flexDirection: 'column' }}>
179
- <FormattedText text={msj0 || 'Sin partidos'} format={parameters.formatMjs} />
180
186
  </div>
181
- </div>
187
+ }
188
+ {debugTimezone && (
189
+ <div style={{
190
+ position: 'fixed',
191
+ bottom: 8,
192
+ right: 8,
193
+ background: 'rgba(0,0,0,0.75)',
194
+ color: '#00ff00',
195
+ fontSize: 10,
196
+ fontFamily: 'monospace',
197
+ padding: '4px 8px',
198
+ borderRadius: 4,
199
+ zIndex: 9999,
200
+ lineHeight: 1.4,
201
+ pointerEvents: 'none',
202
+ whiteSpace: 'nowrap',
203
+ }}>
204
+ TZ: {timezone}
205
+ </div>
206
+ )}
207
+ </>
182
208
  )
183
209
  }
@@ -18,7 +18,16 @@ export const getFixture = async (league: string, yesterday?: boolean, tomorrow?:
18
18
  const year = moment().format('YYYY')
19
19
  const from = yesterday ? moment(Date.now() - MILLISECONDS_PER_DAY).format('YYYY-MM-DD') : today
20
20
  const to = tomorrow ? moment(Date.now() + MILLISECONDS_PER_DAY).format('YYYY-MM-DD') : today
21
- const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
21
+ const timezone = (() => {
22
+ try {
23
+ const tz = Intl.DateTimeFormat().resolvedOptions().timeZone
24
+ console.log(`[football-score] Timezone resolved: ${tz}`)
25
+ return tz
26
+ } catch (error) {
27
+ console.warn('[football-score] Failed to resolve timezone, defaulting to UTC', error)
28
+ return 'UTC'
29
+ }
30
+ })()
22
31
 
23
32
  const options = {
24
33
  method: 'GET',
@@ -5,5 +5,5 @@ declare type VixonicData = {
5
5
  }
6
6
 
7
7
  declare type VixonicParameters = Partial<{
8
- league: '1' | '9' | '4' | '22' | '15' | '1220' | '128' | '265', matchesYesterday: boolean, matchesTomorrow: boolean, timeStart: '12m' | '1m' | '2m' | '3m' | '4m' | '5m' | '6m' | '7m' | '8m' | '9m' | '10m' | '11m' | '12pm' | '1pm' | '2pm' | '3pm' | '4pm' | '5pm' | '6pm' | '7pm' | '8pm' | '9pm' | '10pm' | '11pm', timeEnd: '12m' | '1m' | '2m' | '3m' | '4m' | '5m' | '6m' | '7m' | '8m' | '9m' | '10m' | '11m' | '12pm' | '1pm' | '2pm' | '3pm' | '4pm' | '5pm' | '6pm' | '7pm' | '8pm' | '9pm' | '10pm' | '11pm', updateTime: 300000 | 600000 | 1800000 | 3600000 | 21600000 | 43200000 | 86400000, titleEnabled: boolean, title0: string, titleFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, msj0: string, formatMjs: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, alignVerticalMsj: 'flex-start' | 'center' | 'flex-end', itemsPerPage: number, durationPerPage: number, backgroundImage: {id?: string, filename?: string, extension?: string}, padding: string, columnGap: string, rowGap: string, timeFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, widthTime: string, statusFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, widthStatus: string, goalsFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, widthScore: string, descriptionEnabled: boolean, descriptionFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, widthDescription: string, imageSize: number, widthImage: string
8
+ league: '1' | '9' | '4' | '22' | '15' | '1220' | '128' | '265', matchesYesterday: boolean, matchesTomorrow: boolean, timeStart: '12m' | '1m' | '2m' | '3m' | '4m' | '5m' | '6m' | '7m' | '8m' | '9m' | '10m' | '11m' | '12pm' | '1pm' | '2pm' | '3pm' | '4pm' | '5pm' | '6pm' | '7pm' | '8pm' | '9pm' | '10pm' | '11pm', timeEnd: '12m' | '1m' | '2m' | '3m' | '4m' | '5m' | '6m' | '7m' | '8m' | '9m' | '10m' | '11m' | '12pm' | '1pm' | '2pm' | '3pm' | '4pm' | '5pm' | '6pm' | '7pm' | '8pm' | '9pm' | '10pm' | '11pm', updateTime: 300000 | 600000 | 1800000 | 3600000 | 21600000 | 43200000 | 86400000, titleEnabled: boolean, title0: string, titleFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, msj0: string, formatMjs: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, alignVerticalMsj: 'flex-start' | 'center' | 'flex-end', itemsPerPage: number, durationPerPage: number, backgroundImage: {id?: string, filename?: string, extension?: string}, padding: string, columnGap: string, rowGap: string, timeFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, widthTime: string, statusFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, widthStatus: string, goalsFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, widthScore: string, descriptionEnabled: boolean, descriptionFormat: { fontSize?: number, fontColor?: string, alignment?: { horizontal?: 'left' | 'right' | 'center' }, font?: { filename: string, id: string, __isAsset: true } }, widthDescription: string, imageSize: number, widthImage: string, debugTimezone: boolean
9
9
  }>
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "parameters": {
3
3
  "league": 1,
4
- "timeStart": "1 am",
5
- "timeEnd": "11 pm",
6
- "matchesYesterday": true,
7
- "matchesTomorrow": true,
4
+ "debugTimezone" : false,
5
+ "timeStart": "10 am",
6
+ "timeEnd": "1 am",
7
+ "matchesYesterday": false,
8
+ "matchesTomorrow": false,
8
9
  "itemsPerPage": 2
9
10
  }
10
11
  }