@magmamath/students-features 0.9.98 → 0.9.99
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/dist/commonjs/features/celebrations/helpers.js +4 -1
- package/dist/commonjs/features/celebrations/helpers.js.map +1 -1
- package/dist/module/features/celebrations/helpers.js +4 -1
- package/dist/module/features/celebrations/helpers.js.map +1 -1
- package/dist/typescript/commonjs/features/celebrations/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/celebrations/helpers.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/features/celebrations/helpers.ts +35 -33
- package/.editorconfig +0 -15
- package/.eslintignore +0 -2
- package/.eslintrc +0 -22
- package/.gitattributes +0 -3
- package/.github/actions/setup/action.yml +0 -37
- package/.github/workflows/ci.yml +0 -73
- package/.gitignore +0 -84
- package/.nvmrc +0 -1
- package/.prettierrc +0 -11
- package/.release-it.json +0 -17
- package/.watchmanconfig +0 -1
- package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +0 -541
- package/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs +0 -28
- package/.yarn/releases/yarn-3.6.1.cjs +0 -874
- package/babel.config.js +0 -5
- package/bob.config.js +0 -25
- package/example/app.json +0 -30
- package/example/assets/adaptive-icon.png +0 -0
- package/example/assets/favicon.png +0 -0
- package/example/assets/icon.png +0 -0
- package/example/assets/splash-icon.png +0 -0
- package/example/babel.config.js +0 -28
- package/example/index.js +0 -8
- package/example/metro.config.js +0 -18
- package/example/package.json +0 -25
- package/example/src/App.tsx +0 -8
- package/example/tsconfig.json +0 -6
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -34
- package/yarn.lock +0 -8623
|
@@ -13,7 +13,10 @@ const isDateInRange = (currentDate, startDateStr, endDateStr) => {
|
|
|
13
13
|
const [endDay, endMonth] = endDateStr.split('-').map(Number);
|
|
14
14
|
const currentYear = currentDate.getFullYear();
|
|
15
15
|
const startDate = new Date(currentYear, startMonth - 1, startDay);
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
// If end month is earlier than start month, it spans to next year
|
|
18
|
+
const endYear = endMonth < startMonth ? currentYear + 1 : currentYear;
|
|
19
|
+
const endDate = new Date(endYear, endMonth - 1, endDay + 1);
|
|
17
20
|
return currentDate >= startDate && currentDate <= endDate;
|
|
18
21
|
};
|
|
19
22
|
const getIconForCurrentDate = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Spark","require","_config","randomRange","min","max","Math","random","exports","isDateInRange","currentDate","startDateStr","endDateStr","startDay","startMonth","split","map","Number","endDay","endMonth","currentYear","getFullYear","startDate","Date","endDate","getIconForCurrentDate","celebration","CELEBRATION_ICON_CONFIG","activePeriod","start","end","Icon","MainIcon","generateParticle","variant","elementsCount","angle","rotation","sparkSize","mainSize","velocityMultiplier","friction","life","angularAcceleration","speedRange","CELEBRATION_VARIANTS","sparkSpeedMin","spark","sparkSpeedMax","mainSpeedMin","main","mainSpeedMax","particles","i","randomAngle","from","PI","to","randomSpeed","randomAngularAcceleration","push","id","size","type","velocity","x","cos","y","sin","rotationSpeed","Component","Spark","star"],"sourceRoot":"../../../../src","sources":["features/celebrations/helpers.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAGO,MAAME,WAAW,GAAGA,CAACC,GAAW,EAAEC,GAAW,KAAKC,IAAI,CAACC,MAAM,CAAC,CAAC,IAAIF,GAAG,GAAGD,GAAG,CAAC,GAAGA,GAAG;
|
|
1
|
+
{"version":3,"names":["_Spark","require","_config","randomRange","min","max","Math","random","exports","isDateInRange","currentDate","startDateStr","endDateStr","startDay","startMonth","split","map","Number","endDay","endMonth","currentYear","getFullYear","startDate","Date","endYear","endDate","getIconForCurrentDate","celebration","CELEBRATION_ICON_CONFIG","activePeriod","start","end","Icon","MainIcon","generateParticle","variant","elementsCount","angle","rotation","sparkSize","mainSize","velocityMultiplier","friction","life","angularAcceleration","speedRange","CELEBRATION_VARIANTS","sparkSpeedMin","spark","sparkSpeedMax","mainSpeedMin","main","mainSpeedMax","particles","i","randomAngle","from","PI","to","randomSpeed","randomAngularAcceleration","push","id","size","type","velocity","x","cos","y","sin","rotationSpeed","Component","Spark","star"],"sourceRoot":"../../../../src","sources":["features/celebrations/helpers.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAGO,MAAME,WAAW,GAAGA,CAACC,GAAW,EAAEC,GAAW,KAAKC,IAAI,CAACC,MAAM,CAAC,CAAC,IAAIF,GAAG,GAAGD,GAAG,CAAC,GAAGA,GAAG;AAAAI,OAAA,CAAAL,WAAA,GAAAA,WAAA;AAE1F,MAAMM,aAAa,GAAGA,CAACC,WAAiB,EAAEC,YAAoB,EAAEC,UAAkB,KAAK;EACrF,MAAM,CAACC,QAAQ,EAAEC,UAAU,CAAC,GAAGH,YAAY,CAACI,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EAClE,MAAM,CAACC,MAAM,EAAEC,QAAQ,CAAC,GAAGP,UAAU,CAACG,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EAE5D,MAAMG,WAAW,GAAGV,WAAW,CAACW,WAAW,CAAC,CAAC;EAC7C,MAAMC,SAAS,GAAG,IAAIC,IAAI,CAACH,WAAW,EAAEN,UAAU,GAAG,CAAC,EAAED,QAAQ,CAAC;;EAEjE;EACA,MAAMW,OAAO,GAAGL,QAAQ,GAAGL,UAAU,GAAGM,WAAW,GAAG,CAAC,GAAGA,WAAW;EACrE,MAAMK,OAAO,GAAG,IAAIF,IAAI,CAACC,OAAO,EAAEL,QAAQ,GAAG,CAAC,EAAED,MAAM,GAAG,CAAC,CAAC;EAE3D,OAAOR,WAAW,IAAIY,SAAS,IAAIZ,WAAW,IAAIe,OAAO;AAC3D,CAAC;AAEM,MAAMC,qBAAqB,GAAGA,CA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AmB,CAACc,EAAE,CAAC;IAE/FL,SAAS,CAACQ,IAAI,CAAC;MACbC,EAAE,EAAExD,IAAI,CAACC,MAAM,CAAC,CAAC;MACjBwD,IAAI,EAAE5D,WAAW,CAACqC,QAAQ,CAACgB,IAAI,EAAEhB,QAAQ,CAACkB,EAAE,CAAC;MAC7CM,IAAI,EAAE,MAAM;MACZ3B,KAAK,EAAEkB,WAAW;MAClBU,QAAQ,EAAE;QACRC,CAAC,EAAE5D,IAAI,CAAC6D,GAAG,CAACZ,WAAW,CAAC,GAAGI,WAAW,GAAGlB,kBAAkB;QAC3D2B,CAAC,EAAE9D,IAAI,CAAC+D,GAAG,CAACd,WAAW,CAAC,GAAGI;MAC7B,CAAC;MACDrB,QAAQ,EAAEnC,WAAW,CAACmC,QAAQ,CAACkB,IAAI,EAAElB,QAAQ,CAACoB,EAAE,CAAC;MACjDY,aAAa,EAAEnE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;MACjCyC,mBAAmB,EAAEgB,yBAAyB;MAC9ClB,QAAQ;MACR6B,SAAS,EAAEtC,QAAQ;MACnBU;IACF,CAAC,CAAC;EACJ;EAEA,OAAOU,SAAS;AAClB,CAAC;AAAA7C,OAAA,CAAA0B,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -8,7 +8,10 @@ const isDateInRange = (currentDate, startDateStr, endDateStr) => {
|
|
|
8
8
|
const [endDay, endMonth] = endDateStr.split('-').map(Number);
|
|
9
9
|
const currentYear = currentDate.getFullYear();
|
|
10
10
|
const startDate = new Date(currentYear, startMonth - 1, startDay);
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
// If end month is earlier than start month, it spans to next year
|
|
13
|
+
const endYear = endMonth < startMonth ? currentYear + 1 : currentYear;
|
|
14
|
+
const endDate = new Date(endYear, endMonth - 1, endDay + 1);
|
|
12
15
|
return currentDate >= startDate && currentDate <= endDate;
|
|
13
16
|
};
|
|
14
17
|
export const getIconForCurrentDate = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Spark","CELEBRATION_ICON_CONFIG","CELEBRATION_VARIANTS","randomRange","min","max","Math","random","isDateInRange","currentDate","startDateStr","endDateStr","startDay","startMonth","split","map","Number","endDay","endMonth","currentYear","getFullYear","startDate","Date","endDate","getIconForCurrentDate","celebration","activePeriod","start","end","Icon","MainIcon","generateParticle","variant","elementsCount","angle","rotation","sparkSize","mainSize","velocityMultiplier","friction","life","angularAcceleration","speedRange","sparkSpeedMin","spark","sparkSpeedMax","mainSpeedMin","main","mainSpeedMax","particles","i","randomAngle","from","PI","to","randomSpeed","randomAngularAcceleration","push","id","size","type","velocity","x","cos","y","sin","rotationSpeed","Component","star"],"sourceRoot":"../../../../src","sources":["features/celebrations/helpers.ts"],"mappings":";;AACA,SAASA,KAAK,QAAQ,uBAAoB;AAC1C,SAASC,uBAAuB,EAAEC,oBAAoB,QAAQ,aAAU;AAGxE,OAAO,MAAMC,WAAW,GAAGA,CAACC,GAAW,EAAEC,GAAW,KAAKC,IAAI,CAACC,MAAM,CAAC,CAAC,IAAIF,GAAG,GAAGD,GAAG,CAAC,GAAGA,GAAG;AAE1F,MAAMI,aAAa,GAAGA,CAACC,WAAiB,EAAEC,YAAoB,EAAEC,UAAkB,KAAK;EACrF,MAAM,CAACC,QAAQ,EAAEC,UAAU,CAAC,GAAGH,YAAY,CAACI,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EAClE,MAAM,CAACC,MAAM,EAAEC,QAAQ,CAAC,GAAGP,UAAU,CAACG,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EAE5D,MAAMG,WAAW,GAAGV,WAAW,CAACW,WAAW,CAAC,CAAC;EAC7C,MAAMC,SAAS,GAAG,IAAIC,IAAI,CAACH,WAAW,EAAEN,UAAU,GAAG,CAAC,EAAED,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"names":["Spark","CELEBRATION_ICON_CONFIG","CELEBRATION_VARIANTS","randomRange","min","max","Math","random","isDateInRange","currentDate","startDateStr","endDateStr","startDay","startMonth","split","map","Number","endDay","endMonth","currentYear","getFullYear","startDate","Date","endYear","endDate","getIconForCurrentDate","celebration","activePeriod","start","end","Icon","MainIcon","generateParticle","variant","elementsCount","angle","rotation","sparkSize","mainSize","velocityMultiplier","friction","life","angularAcceleration","speedRange","sparkSpeedMin","spark","sparkSpeedMax","mainSpeedMin","main","mainSpeedMax","particles","i","randomAngle","from","PI","to","randomSpeed","randomAngularAcceleration","push","id","size","type","velocity","x","cos","y","sin","rotationSpeed","Component","star"],"sourceRoot":"../../../../src","sources":["features/celebrations/helpers.ts"],"mappings":";;AACA,SAASA,KAAK,QAAQ,uBAAoB;AAC1C,SAASC,uBAAuB,EAAEC,oBAAoB,QAAQ,aAAU;AAGxE,OAAO,MAAMC,WAAW,GAAGA,CAACC,GAAW,EAAEC,GAAW,KAAKC,IAAI,CAACC,MAAM,CAAC,CAAC,IAAIF,GAAG,GAAGD,GAAG,CAAC,GAAGA,GAAG;AAE1F,MAAMI,aAAa,GAAGA,CAACC,WAAiB,EAAEC,YAAoB,EAAEC,UAAkB,KAAK;EACrF,MAAM,CAACC,QAAQ,EAAEC,UAAU,CAAC,GAAGH,YAAY,CAACI,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EAClE,MAAM,CAACC,MAAM,EAAEC,QAAQ,CAAC,GAAGP,UAAU,CAACG,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EAE5D,MAAMG,WAAW,GAAGV,WAAW,CAACW,WAAW,CAAC,CAAC;EAC7C,MAAMC,SAAS,GAAG,IAAIC,IAAI,CAACH,WAAW,EAAEN,UAAU,GAAG,CAAC,EAAED,QAAQ,CAAC;;EAEjE;EACA,MAAMW,OAAO,GAAGL,QAAQ,GAAGL,UAAU,GAAGM,WAAW,GAAG,CAAC,GAAGA,WAAW;EACrE,MAAMK,OAAO,GAAG,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AG,CAAC;IACzF,MAAME,WAAW,GAAGrD,WAAW,CAAC4C,YAAY,EAAEE,YAAY,CAAC;IAC3D,MAAMQ,yBAAyB,GAAGtD,WAAW,CAACuC,mBAAmB,CAACW,IAAI,EAAEX,mBAAmB,CAACa,EAAE,CAAC;IAE/FL,SAAS,CAACQ,IAAI,CAAC;MACbC,EAAE,EAAErD,IAAI,CAACC,MAAM,CAAC,CAAC;MACjBqD,IAAI,EAAEzD,WAAW,CAACmC,QAAQ,CAACe,IAAI,EAAEf,QAAQ,CAACiB,EAAE,CAAC;MAC7CM,IAAI,EAAE,MAAM;MACZ1B,KAAK,EAAEiB,WAAW;MAClBU,QAAQ,EAAE;QACRC,CAAC,EAAEzD,IAAI,CAAC0D,GAAG,CAACZ,WAAW,CAAC,GAAGI,WAAW,GAAGjB,kBAAkB;QAC3D0B,CAAC,EAAE3D,IAAI,CAAC4D,GAAG,CAACd,WAAW,CAAC,GAAGI;MAC7B,CAAC;MACDpB,QAAQ,EAAEjC,WAAW,CAACiC,QAAQ,CAACiB,IAAI,EAAEjB,QAAQ,CAACmB,EAAE,CAAC;MACjDY,aAAa,EAAEhE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;MACjCuC,mBAAmB,EAAEe,yBAAyB;MAC9CjB,QAAQ;MACR4B,SAAS,EAAErC,QAAQ;MACnBU;IACF,CAAC,CAAC;EACJ;EAEA,OAAOS,SAAS;AAClB,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/features/celebrations/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/features/celebrations/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAG3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAO,MAAM,WAAW,QAAS,MAAM,OAAO,MAAM,WAAsC,CAAA;AAgB1F,eAAO,MAAM,qBAAqB,wDAajC,CAAA;AAGD,eAAO,MAAM,gBAAgB,YAAa,kBAAkB,qBAmE3D,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/features/celebrations/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/features/celebrations/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAG3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAE5C,eAAO,MAAM,WAAW,QAAS,MAAM,OAAO,MAAM,WAAsC,CAAA;AAgB1F,eAAO,MAAM,qBAAqB,wDAajC,CAAA;AAGD,eAAO,MAAM,gBAAgB,YAAa,kBAAkB,qBAmE3D,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import { ParticlesBatch } from './components/ParticleBatch'
|
|
2
|
-
import { Spark } from './components/Spark'
|
|
3
|
-
import { CELEBRATION_ICON_CONFIG, CELEBRATION_VARIANTS } from './config'
|
|
4
|
-
import { CelebrationVariant } from './types'
|
|
1
|
+
import { ParticlesBatch } from './components/ParticleBatch'
|
|
2
|
+
import { Spark } from './components/Spark'
|
|
3
|
+
import { CELEBRATION_ICON_CONFIG, CELEBRATION_VARIANTS } from './config'
|
|
4
|
+
import { CelebrationVariant } from './types'
|
|
5
5
|
|
|
6
|
-
export const randomRange = (min: number, max: number) => Math.random() * (max - min) + min
|
|
6
|
+
export const randomRange = (min: number, max: number) => Math.random() * (max - min) + min
|
|
7
7
|
|
|
8
8
|
const isDateInRange = (currentDate: Date, startDateStr: string, endDateStr: string) => {
|
|
9
|
-
const [startDay, startMonth] = startDateStr.split('-').map(Number)
|
|
10
|
-
const [endDay, endMonth] = endDateStr.split('-').map(Number)
|
|
9
|
+
const [startDay, startMonth] = startDateStr.split('-').map(Number)
|
|
10
|
+
const [endDay, endMonth] = endDateStr.split('-').map(Number)
|
|
11
11
|
|
|
12
|
-
const currentYear = currentDate.getFullYear()
|
|
13
|
-
const startDate = new Date(currentYear, startMonth - 1, startDay)
|
|
14
|
-
const endDate = new Date(currentYear, endMonth - 1, endDay + 1);
|
|
12
|
+
const currentYear = currentDate.getFullYear()
|
|
13
|
+
const startDate = new Date(currentYear, startMonth - 1, startDay)
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
// If end month is earlier than start month, it spans to next year
|
|
16
|
+
const endYear = endMonth < startMonth ? currentYear + 1 : currentYear
|
|
17
|
+
const endDate = new Date(endYear, endMonth - 1, endDay + 1)
|
|
18
|
+
|
|
19
|
+
return currentDate >= startDate && currentDate <= endDate
|
|
20
|
+
}
|
|
18
21
|
|
|
19
22
|
export const getIconForCurrentDate = () => {
|
|
20
|
-
const currentDate = new Date()
|
|
23
|
+
const currentDate = new Date()
|
|
21
24
|
|
|
22
25
|
for (const celebration of CELEBRATION_ICON_CONFIG) {
|
|
23
26
|
if (celebration.activePeriod) {
|
|
24
|
-
const { start, end } = celebration.activePeriod
|
|
27
|
+
const { start, end } = celebration.activePeriod
|
|
25
28
|
if (isDateInRange(currentDate, start, end)) {
|
|
26
|
-
return celebration.Icon
|
|
29
|
+
return celebration.Icon
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
|
|
31
|
-
return CELEBRATION_ICON_CONFIG[0].Icon
|
|
32
|
-
}
|
|
34
|
+
return CELEBRATION_ICON_CONFIG[0].Icon
|
|
35
|
+
}
|
|
33
36
|
|
|
34
|
-
const MainIcon = getIconForCurrentDate()
|
|
35
|
-
export const generateParticle = (variant: CelebrationVariant
|
|
36
|
-
) => {
|
|
37
|
+
const MainIcon = getIconForCurrentDate()
|
|
38
|
+
export const generateParticle = (variant: CelebrationVariant) => {
|
|
37
39
|
const {
|
|
38
40
|
elementsCount,
|
|
39
41
|
angle,
|
|
@@ -44,20 +46,20 @@ export const generateParticle = (variant: CelebrationVariant
|
|
|
44
46
|
friction,
|
|
45
47
|
life,
|
|
46
48
|
angularAcceleration,
|
|
47
|
-
speedRange
|
|
48
|
-
} = CELEBRATION_VARIANTS[variant]
|
|
49
|
+
speedRange,
|
|
50
|
+
} = CELEBRATION_VARIANTS[variant]
|
|
49
51
|
|
|
50
52
|
const sparkSpeedMin = speedRange?.spark?.[0]
|
|
51
53
|
const sparkSpeedMax = speedRange?.spark?.[1]
|
|
52
54
|
const mainSpeedMin = speedRange?.main?.[0]
|
|
53
55
|
const mainSpeedMax = speedRange?.main?.[1]
|
|
54
56
|
|
|
55
|
-
const particles: ParticlesBatch[] = []
|
|
57
|
+
const particles: ParticlesBatch[] = []
|
|
56
58
|
|
|
57
59
|
for (let i = 0; i < elementsCount.spark; i++) {
|
|
58
|
-
const randomAngle = randomRange((angle.from * Math.PI) / 180, (angle.to * Math.PI) / 180)
|
|
59
|
-
const randomSpeed = randomRange(sparkSpeedMin, sparkSpeedMax)
|
|
60
|
-
const randomAngularAcceleration = randomRange(angularAcceleration.from, angularAcceleration.to)
|
|
60
|
+
const randomAngle = randomRange((angle.from * Math.PI) / 180, (angle.to * Math.PI) / 180)
|
|
61
|
+
const randomSpeed = randomRange(sparkSpeedMin, sparkSpeedMax)
|
|
62
|
+
const randomAngularAcceleration = randomRange(angularAcceleration.from, angularAcceleration.to)
|
|
61
63
|
|
|
62
64
|
particles.push({
|
|
63
65
|
id: Math.random(),
|
|
@@ -74,12 +76,12 @@ export const generateParticle = (variant: CelebrationVariant
|
|
|
74
76
|
friction,
|
|
75
77
|
Component: Spark,
|
|
76
78
|
life,
|
|
77
|
-
})
|
|
79
|
+
})
|
|
78
80
|
}
|
|
79
81
|
for (let i = 0; i < elementsCount.star; i++) {
|
|
80
|
-
const randomAngle = randomRange((angle.from * Math.PI) / 180, (angle.to * Math.PI) / 180)
|
|
81
|
-
const randomSpeed = randomRange(mainSpeedMin, mainSpeedMax)
|
|
82
|
-
const randomAngularAcceleration = randomRange(angularAcceleration.from, angularAcceleration.to)
|
|
82
|
+
const randomAngle = randomRange((angle.from * Math.PI) / 180, (angle.to * Math.PI) / 180)
|
|
83
|
+
const randomSpeed = randomRange(mainSpeedMin, mainSpeedMax)
|
|
84
|
+
const randomAngularAcceleration = randomRange(angularAcceleration.from, angularAcceleration.to)
|
|
83
85
|
|
|
84
86
|
particles.push({
|
|
85
87
|
id: Math.random(),
|
|
@@ -96,8 +98,8 @@ export const generateParticle = (variant: CelebrationVariant
|
|
|
96
98
|
friction,
|
|
97
99
|
Component: MainIcon,
|
|
98
100
|
life,
|
|
99
|
-
})
|
|
101
|
+
})
|
|
100
102
|
}
|
|
101
103
|
|
|
102
|
-
return particles
|
|
103
|
-
}
|
|
104
|
+
return particles
|
|
105
|
+
}
|
package/.editorconfig
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# EditorConfig helps developers define and maintain consistent
|
|
2
|
-
# coding styles between different editors and IDEs
|
|
3
|
-
# editorconfig.org
|
|
4
|
-
|
|
5
|
-
root = true
|
|
6
|
-
|
|
7
|
-
[*]
|
|
8
|
-
|
|
9
|
-
indent_style = space
|
|
10
|
-
indent_size = 2
|
|
11
|
-
|
|
12
|
-
end_of_line = lf
|
|
13
|
-
charset = utf-8
|
|
14
|
-
trim_trailing_whitespace = true
|
|
15
|
-
insert_final_newline = true
|
package/.eslintignore
DELETED
package/.eslintrc
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"browser": true,
|
|
4
|
-
"es2020": true
|
|
5
|
-
},
|
|
6
|
-
"extends": [
|
|
7
|
-
"eslint:recommended",
|
|
8
|
-
"plugin:@typescript-eslint/recommended",
|
|
9
|
-
"plugin:react-hooks/recommended",
|
|
10
|
-
"plugin:storybook/recommended",
|
|
11
|
-
"prettier"
|
|
12
|
-
],
|
|
13
|
-
"parser": "@typescript-eslint/parser",
|
|
14
|
-
"parserOptions": {
|
|
15
|
-
"ecmaVersion": "latest",
|
|
16
|
-
"sourceType": "module"
|
|
17
|
-
},
|
|
18
|
-
"plugins": ["react-refresh"],
|
|
19
|
-
"rules": {
|
|
20
|
-
"react-refresh/only-export-components": "warn"
|
|
21
|
-
}
|
|
22
|
-
}
|
package/.gitattributes
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
name: Setup
|
|
2
|
-
description: Setup Node.js and install dependencies
|
|
3
|
-
|
|
4
|
-
inputs:
|
|
5
|
-
npmrc-auth-token:
|
|
6
|
-
required: true
|
|
7
|
-
|
|
8
|
-
runs:
|
|
9
|
-
using: composite
|
|
10
|
-
steps:
|
|
11
|
-
- name: Setup Node.js
|
|
12
|
-
uses: actions/setup-node@v3
|
|
13
|
-
with:
|
|
14
|
-
node-version-file: .nvmrc
|
|
15
|
-
|
|
16
|
-
- name: Create .npmrc
|
|
17
|
-
shell: bash
|
|
18
|
-
run: |
|
|
19
|
-
echo "registry=https://registry.npmjs.org" > .npmrc
|
|
20
|
-
echo "//registry.npmjs.org/:_authToken=${{ inputs.npmrc-auth-token }}" >> .npmrc
|
|
21
|
-
|
|
22
|
-
- name: Cache dependencies
|
|
23
|
-
id: yarn-cache
|
|
24
|
-
uses: actions/cache@v3
|
|
25
|
-
with:
|
|
26
|
-
path: |
|
|
27
|
-
**/node_modules
|
|
28
|
-
.yarn/install-state.gz
|
|
29
|
-
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
|
|
30
|
-
restore-keys: |
|
|
31
|
-
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
|
|
32
|
-
${{ runner.os }}-yarn-
|
|
33
|
-
|
|
34
|
-
- name: Install dependencies
|
|
35
|
-
if: steps.yarn-cache.outputs.cache-hit != 'true'
|
|
36
|
-
run: yarn install --immutable
|
|
37
|
-
shell: bash
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
pull_request:
|
|
8
|
-
branches:
|
|
9
|
-
- main
|
|
10
|
-
merge_group:
|
|
11
|
-
types:
|
|
12
|
-
- checks_requested
|
|
13
|
-
|
|
14
|
-
jobs:
|
|
15
|
-
lint:
|
|
16
|
-
runs-on: ubuntu-latest
|
|
17
|
-
steps:
|
|
18
|
-
- name: Checkout
|
|
19
|
-
uses: actions/checkout@v3
|
|
20
|
-
|
|
21
|
-
- name: Setup
|
|
22
|
-
uses: ./.github/actions/setup
|
|
23
|
-
with:
|
|
24
|
-
npmrc-auth-token: ${{ secrets.MAGMA_NPMRC_TOKEN }}
|
|
25
|
-
|
|
26
|
-
- name: Lint files
|
|
27
|
-
run: yarn lint
|
|
28
|
-
|
|
29
|
-
- name: Typecheck files
|
|
30
|
-
run: yarn typecheck
|
|
31
|
-
|
|
32
|
-
test:
|
|
33
|
-
runs-on: ubuntu-latest
|
|
34
|
-
steps:
|
|
35
|
-
- name: Checkout
|
|
36
|
-
uses: actions/checkout@v3
|
|
37
|
-
|
|
38
|
-
- name: Setup
|
|
39
|
-
uses: ./.github/actions/setup
|
|
40
|
-
with:
|
|
41
|
-
npmrc-auth-token: ${{ secrets.MAGMA_NPMRC_TOKEN }}
|
|
42
|
-
|
|
43
|
-
- name: Run unit tests
|
|
44
|
-
run: yarn test --maxWorkers=2 --coverage
|
|
45
|
-
|
|
46
|
-
build-library:
|
|
47
|
-
runs-on: ubuntu-latest
|
|
48
|
-
steps:
|
|
49
|
-
- name: Checkout
|
|
50
|
-
uses: actions/checkout@v3
|
|
51
|
-
|
|
52
|
-
- name: Setup
|
|
53
|
-
uses: ./.github/actions/setup
|
|
54
|
-
with:
|
|
55
|
-
npmrc-auth-token: ${{ secrets.MAGMA_NPMRC_TOKEN }}
|
|
56
|
-
|
|
57
|
-
- name: Build package
|
|
58
|
-
run: yarn prepare
|
|
59
|
-
|
|
60
|
-
build-web:
|
|
61
|
-
runs-on: ubuntu-latest
|
|
62
|
-
steps:
|
|
63
|
-
- name: Checkout
|
|
64
|
-
uses: actions/checkout@v3
|
|
65
|
-
|
|
66
|
-
- name: Setup
|
|
67
|
-
uses: ./.github/actions/setup
|
|
68
|
-
with:
|
|
69
|
-
npmrc-auth-token: ${{ secrets.MAGMA_NPMRC_TOKEN }}
|
|
70
|
-
|
|
71
|
-
- name: Build example for Web
|
|
72
|
-
run: |
|
|
73
|
-
yarn example expo export --platform web
|
package/.gitignore
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
# OSX
|
|
2
|
-
#
|
|
3
|
-
.DS_Store
|
|
4
|
-
|
|
5
|
-
# XDE
|
|
6
|
-
.expo/
|
|
7
|
-
|
|
8
|
-
# VSCode
|
|
9
|
-
.vscode/
|
|
10
|
-
jsconfig.json
|
|
11
|
-
|
|
12
|
-
# Xcode
|
|
13
|
-
#
|
|
14
|
-
build/
|
|
15
|
-
*.pbxuser
|
|
16
|
-
!default.pbxuser
|
|
17
|
-
*.mode1v3
|
|
18
|
-
!default.mode1v3
|
|
19
|
-
*.mode2v3
|
|
20
|
-
!default.mode2v3
|
|
21
|
-
*.perspectivev3
|
|
22
|
-
!default.perspectivev3
|
|
23
|
-
xcuserdata
|
|
24
|
-
*.xccheckout
|
|
25
|
-
*.moved-aside
|
|
26
|
-
DerivedData
|
|
27
|
-
*.hmap
|
|
28
|
-
*.ipa
|
|
29
|
-
*.xcuserstate
|
|
30
|
-
project.xcworkspace
|
|
31
|
-
|
|
32
|
-
# Android/IJ
|
|
33
|
-
#
|
|
34
|
-
.classpath
|
|
35
|
-
.cxx
|
|
36
|
-
.gradle
|
|
37
|
-
.idea
|
|
38
|
-
.project
|
|
39
|
-
.settings
|
|
40
|
-
local.properties
|
|
41
|
-
android.iml
|
|
42
|
-
|
|
43
|
-
# Cocoapods
|
|
44
|
-
#
|
|
45
|
-
example/ios/Pods
|
|
46
|
-
|
|
47
|
-
# Ruby
|
|
48
|
-
example/vendor/
|
|
49
|
-
|
|
50
|
-
# node.js
|
|
51
|
-
#
|
|
52
|
-
node_modules/
|
|
53
|
-
npm-debug.log
|
|
54
|
-
yarn-debug.log
|
|
55
|
-
yarn-error.log
|
|
56
|
-
|
|
57
|
-
# BUCK
|
|
58
|
-
buck-out/
|
|
59
|
-
\.buckd/
|
|
60
|
-
android/app/libs
|
|
61
|
-
android/keystores/debug.keystore
|
|
62
|
-
|
|
63
|
-
# Yarn
|
|
64
|
-
.yarn/*
|
|
65
|
-
!.yarn/patches
|
|
66
|
-
!.yarn/plugins
|
|
67
|
-
!.yarn/releases
|
|
68
|
-
!.yarn/sdks
|
|
69
|
-
!.yarn/versions
|
|
70
|
-
|
|
71
|
-
# Expo
|
|
72
|
-
.expo/
|
|
73
|
-
|
|
74
|
-
# Turborepo
|
|
75
|
-
.turbo/
|
|
76
|
-
|
|
77
|
-
# generated by bob
|
|
78
|
-
dist/
|
|
79
|
-
!src/lib/
|
|
80
|
-
|
|
81
|
-
# React Native Codegen
|
|
82
|
-
ios/generated
|
|
83
|
-
android/generated
|
|
84
|
-
.npmrc
|
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
v18
|
package/.prettierrc
DELETED
package/.release-it.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"git": {
|
|
3
|
-
"commitMessage": "chore: release ${version}",
|
|
4
|
-
"tagName": "v${version}"
|
|
5
|
-
},
|
|
6
|
-
"npm": {
|
|
7
|
-
"publish": true
|
|
8
|
-
},
|
|
9
|
-
"github": {
|
|
10
|
-
"release": true
|
|
11
|
-
},
|
|
12
|
-
"plugins": {
|
|
13
|
-
"@release-it/conventional-changelog": {
|
|
14
|
-
"preset": "angular"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
package/.watchmanconfig
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|