@vixoniccom/aniversarios 1.3.0-dev.0 → 1.3.0-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.
- package/CHANGELOG.md +9 -0
- package/build.zip +0 -0
- package/package.json +1 -1
- package/src/App.tsx +3 -3
- package/src/components/AnniversaryItem/components/AnniversaryDate/FlatDate/index.tsx +4 -4
- package/src/components/AnniversaryItem/components/AnniversaryImage/index.tsx +2 -1
- package/src/components/AnniversaryItem/components/ClassicItem/index.tsx +2 -2
- package/src/components/AnniversaryItem/components/Separator/Separator.tsx +1 -1
- package/src/components/FontLoader/index.tsx +0 -12
- package/src/components/FormattedText/index.tsx +3 -3
- package/src/components/ItemsContainer/components/animation.ts +4 -4
- package/src/components/Render/index.tsx +1 -1
- package/src/index.html +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.3.0-dev.1](https://github.com/Vixonic/store-aniversarios/compare/v1.3.0-dev.0...v1.3.0-dev.1) (2025-07-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* Replace logical OR with nullish coalescing operator for default values in various components ([c9f2bba](https://github.com/Vixonic/store-aniversarios/commit/c9f2bbafcf44f38b1578b6946a19434f41e50f52))
|
|
11
|
+
* Update maskId generation for unique identifiers in AnniversaryImage component ([6f5b452](https://github.com/Vixonic/store-aniversarios/commit/6f5b4525f640d8730488331c56aed5fb68378e56))
|
|
12
|
+
* Update maskId generation for unique identifiers in AnniversaryImage component ([c9a3d43](https://github.com/Vixonic/store-aniversarios/commit/c9a3d43acc57f707a39a31f131fda6266f674f30))
|
|
13
|
+
|
|
5
14
|
## [1.3.0-dev.0](https://github.com/Vixonic/store-aniversarios/compare/v1.2.3-dev.2...v1.3.0-dev.0) (2025-07-14)
|
|
6
15
|
|
|
7
16
|
|
package/build.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -10,7 +10,7 @@ interface Props {
|
|
|
10
10
|
export const App: React.FunctionComponent<Props> = ({ start, appData, anniversaries }) => {
|
|
11
11
|
|
|
12
12
|
const parameters = appData?.parameters
|
|
13
|
-
const [
|
|
13
|
+
const [anniversariesElements, setAnniversariesElements] = useState<Anniversary[]>(anniversaries)
|
|
14
14
|
|
|
15
15
|
useEffect(() => {
|
|
16
16
|
setAnniversariesElements(anniversaries)
|
|
@@ -19,8 +19,8 @@ export const App: React.FunctionComponent<Props> = ({ start, appData, anniversar
|
|
|
19
19
|
if (!appData) return null
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
|
-
(
|
|
22
|
+
(anniversariesElements.length === 0) ?
|
|
23
23
|
<FormattedText text={parameters?.defaultMessage ?? 'No hay ingresos para mostrar'} format={parameters?.defaultMessageFormat} />
|
|
24
|
-
: <Render appData={appData} start={start} anniversaries={
|
|
24
|
+
: <Render appData={appData} start={start} anniversaries={anniversariesElements} />
|
|
25
25
|
)
|
|
26
26
|
}
|
|
@@ -11,8 +11,8 @@ export const FlatDate: React.FunctionComponent<Props> = ({ month, day, data }: P
|
|
|
11
11
|
const { abbreviatedMonths, dateDayFormat, dateMonthFormat, orientation, datePrimaryColor } = data.parameters
|
|
12
12
|
|
|
13
13
|
const sizeProp = AnniveraryDateUtils.utils(orientation)
|
|
14
|
-
const monthSize = ((dateMonthFormat?.fontSize
|
|
15
|
-
const daySize = ((dateDayFormat?.fontSize
|
|
14
|
+
const monthSize = ((dateMonthFormat?.fontSize ?? 18.5) * 400) / 100
|
|
15
|
+
const daySize = ((dateDayFormat?.fontSize ?? 57.5) * 400) / 100
|
|
16
16
|
|
|
17
17
|
const getFontFamily = (format: any) => {
|
|
18
18
|
if (format?.font?.filename) return format.font.filename.replace('.', '-')
|
|
@@ -29,7 +29,7 @@ export const FlatDate: React.FunctionComponent<Props> = ({ month, day, data }: P
|
|
|
29
29
|
textAnchor='middle'
|
|
30
30
|
alignmentBaseline='central' x='200' y='55'
|
|
31
31
|
fontSize={monthSize} preserveAspectRatio='none'
|
|
32
|
-
fill={dateMonthFormat?.fontColor
|
|
32
|
+
fill={dateMonthFormat?.fontColor ?? '#fff'} fontSizeAdjust=''>
|
|
33
33
|
{AnniveraryDateUtils.getMonth(month, abbreviatedMonths)}
|
|
34
34
|
</text>
|
|
35
35
|
|
|
@@ -37,7 +37,7 @@ export const FlatDate: React.FunctionComponent<Props> = ({ month, day, data }: P
|
|
|
37
37
|
textAnchor='middle'
|
|
38
38
|
alignmentBaseline='central' x='200' y='245'
|
|
39
39
|
fontSize={daySize} preserveAspectRatio='none'
|
|
40
|
-
fill={dateDayFormat?.fontColor
|
|
40
|
+
fill={dateDayFormat?.fontColor ?? '#fff'} fontSizeAdjust=''>
|
|
41
41
|
{AnniveraryDateUtils.getZeroLeadedText(day)}
|
|
42
42
|
</text>
|
|
43
43
|
</g>
|
|
@@ -2,6 +2,7 @@ import React, { useEffect, useRef, useState } from 'react'
|
|
|
2
2
|
import { AnniveraryDateUtils } from '../AnniversaryDate/utils'
|
|
3
3
|
|
|
4
4
|
const defaultImg = require('../default-profile.png')
|
|
5
|
+
let idCounter = 0
|
|
5
6
|
const borderStyles = {
|
|
6
7
|
normal: '0',
|
|
7
8
|
rounded: '10',
|
|
@@ -18,7 +19,7 @@ interface Props {
|
|
|
18
19
|
export const AnniversaryImage: React.FunctionComponent<Props> = ({ url, size, borderStyle, orientation }) => {
|
|
19
20
|
const [urlState, setUrlState] = useState(url || defaultImg)
|
|
20
21
|
const input = useRef<SVGImageElement>(null)
|
|
21
|
-
const maskId =
|
|
22
|
+
const maskId = `mask-${Date.now()}-${++idCounter}`
|
|
22
23
|
const imageExist = (url: any) => {
|
|
23
24
|
const isValidImage = url.substr(-3).toLowerCase() === 'png' || url.substr(-3).toLowerCase() === 'jpg' || url.substr(-4).toLowerCase() === 'jpeg'
|
|
24
25
|
return isValidImage ? url : defaultImg
|
|
@@ -72,7 +72,7 @@ export const ClassicItem: React.FunctionComponent<Props> = ({ anniversary, data
|
|
|
72
72
|
/>
|
|
73
73
|
{state.descriptionEnabled && (
|
|
74
74
|
<FormattedText
|
|
75
|
-
text={anniversary.position
|
|
75
|
+
text={anniversary.position ?? ''}
|
|
76
76
|
format={parameters.descriptionFormat}
|
|
77
77
|
maxChar={Number(parameters.descriptionMaxChar)}
|
|
78
78
|
lineHeight={1.2}
|
|
@@ -80,7 +80,7 @@ export const ClassicItem: React.FunctionComponent<Props> = ({ anniversary, data
|
|
|
80
80
|
)}
|
|
81
81
|
{state.optionalEnabled && (
|
|
82
82
|
<FormattedText
|
|
83
|
-
text={anniversary.optional
|
|
83
|
+
text={anniversary.optional ?? ''}
|
|
84
84
|
format={parameters.optionalFormat}
|
|
85
85
|
maxChar={Number(parameters.descriptionMaxChar)}
|
|
86
86
|
lineHeight={1.2}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import PropTypes from 'prop-types'
|
|
2
|
-
|
|
3
1
|
interface Props {
|
|
4
2
|
paths: Array<string>
|
|
5
3
|
data: VixonicData
|
|
@@ -40,13 +38,3 @@ export const FontLoader = ({ paths, data }: Props) => {
|
|
|
40
38
|
<style>{fonts}</style>
|
|
41
39
|
)
|
|
42
40
|
}
|
|
43
|
-
|
|
44
|
-
FontLoader.defaultProps = {
|
|
45
|
-
paths: []
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
FontLoader.propTypes = {
|
|
49
|
-
paths: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
50
|
-
data: PropTypes.object.isRequired
|
|
51
|
-
}
|
|
52
|
-
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { CSSProperties } from 'react'
|
|
2
2
|
|
|
3
3
|
const alignments = {
|
|
4
4
|
center: 'center',
|
|
@@ -15,7 +15,7 @@ interface Props {
|
|
|
15
15
|
format?: any
|
|
16
16
|
lineHeight?: number
|
|
17
17
|
maxChar?: number
|
|
18
|
-
style?:
|
|
18
|
+
style?: CSSProperties
|
|
19
19
|
text: string
|
|
20
20
|
unit?: string
|
|
21
21
|
paddingBottom?: string
|
|
@@ -55,7 +55,7 @@ export const FormattedText: React.FunctionComponent<Props> = ({ text, format, ma
|
|
|
55
55
|
const containerStyle = {
|
|
56
56
|
display: 'inline-flex',
|
|
57
57
|
justifyContent: getHorizontalAlignment(format.alignment),
|
|
58
|
-
...
|
|
58
|
+
...style
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
return (
|
|
@@ -75,10 +75,10 @@ export class AnimationController {
|
|
|
75
75
|
|
|
76
76
|
configure(options: Partial<Options>) {
|
|
77
77
|
this.mode = options.mode && animationModes.hasOwnProperty(options.mode) ? animationModes[options.mode] : animationModes.fade
|
|
78
|
-
this.duration = options.duration
|
|
79
|
-
this.speed = 1000 * (options.speed
|
|
80
|
-
this.stagger = this.speed / (options.stagger
|
|
81
|
-
this.reverse = options.reverse
|
|
78
|
+
this.duration = options.duration ?? 10000
|
|
79
|
+
this.speed = 1000 * (options.speed ?? 1)
|
|
80
|
+
this.stagger = this.speed / (options.stagger ?? 4)
|
|
81
|
+
this.reverse = options.reverse ?? true
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
getInitialStyle() {
|
|
@@ -25,7 +25,7 @@ export const Render = ({ start, appData, anniversaries }: Props) => {
|
|
|
25
25
|
? `url("${downloadsPath}/${backgroundImage.filename}")` : ''
|
|
26
26
|
|
|
27
27
|
const anniversaryItems = anniversaries.map((anniversary: Anniversary) => {
|
|
28
|
-
return <AnniversaryItem style={'standard'} anniversary={anniversary} data={appData} />
|
|
28
|
+
return <AnniversaryItem style={'standard'} anniversary={anniversary} data={appData} key={anniversary?.name} />
|
|
29
29
|
})
|
|
30
30
|
|
|
31
31
|
return (
|
package/src/index.html
CHANGED