@moises.ai/design-system 4.21.0 → 4.21.2
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/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useState, useMemo, useEffect } from 'react'
|
|
2
|
-
import { stems } from './utils'
|
|
3
2
|
|
|
4
3
|
function areStemSelectionsEqual(current = [], initial = []) {
|
|
5
4
|
if (current.length !== initial.length) return false
|
|
@@ -10,9 +9,10 @@ function areStemSelectionsEqual(current = [], initial = []) {
|
|
|
10
9
|
export function useForm({ onShowPaywall, selected = [] }) {
|
|
11
10
|
const [stemsSelected, setStemsSelected] = useState(selected)
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
const hasChanges = useMemo(
|
|
13
|
+
() => !areStemSelectionsEqual(stemsSelected, selected),
|
|
14
|
+
[stemsSelected, selected],
|
|
15
|
+
)
|
|
16
16
|
|
|
17
17
|
const onToggleStems = async (value) => {
|
|
18
18
|
if (value.locked) {
|
|
@@ -28,16 +28,11 @@ export function useForm({ onShowPaywall, selected = [] }) {
|
|
|
28
28
|
|
|
29
29
|
// If the item is not selected, add it and remove the mutualExclusiveStems
|
|
30
30
|
const newStems = [...prev, value.value]
|
|
31
|
-
const mutualExclusiveStems =
|
|
31
|
+
const mutualExclusiveStems = value.mutualExclusiveStems
|
|
32
32
|
return newStems.filter((stem) => !mutualExclusiveStems?.includes(stem))
|
|
33
33
|
})
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
const hasChanges = useMemo(
|
|
37
|
-
() => !areStemSelectionsEqual(stemsSelected, selected),
|
|
38
|
-
[stemsSelected, selected],
|
|
39
|
-
)
|
|
40
|
-
|
|
41
36
|
return {
|
|
42
37
|
stemsSelected,
|
|
43
38
|
onToggleStems,
|
|
@@ -175,6 +175,7 @@ export const projects = [
|
|
|
175
175
|
category: 'premium',
|
|
176
176
|
paywallId: 'customSeparationVocals-stemSeparationExtension',
|
|
177
177
|
locked: false,
|
|
178
|
+
mutualExclusiveStems: ['leadVocals', 'backingVocals'],
|
|
178
179
|
},
|
|
179
180
|
{
|
|
180
181
|
text: 'Lead Vocals',
|
|
@@ -182,6 +183,7 @@ export const projects = [
|
|
|
182
183
|
category: 'premium',
|
|
183
184
|
paywallId: 'customSeparationLeadVocals-stemSeparationExtension',
|
|
184
185
|
locked: false,
|
|
186
|
+
mutualExclusiveStems: ['vocals'],
|
|
185
187
|
},
|
|
186
188
|
{
|
|
187
189
|
text: 'Backing Vocals',
|
|
@@ -190,6 +192,7 @@ export const projects = [
|
|
|
190
192
|
paywallId:
|
|
191
193
|
'customSeparationBackgroundVocals-stemSeparationExtension',
|
|
192
194
|
locked: false,
|
|
195
|
+
mutualExclusiveStems: ['vocals'],
|
|
193
196
|
},
|
|
194
197
|
],
|
|
195
198
|
},
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
export const stems = [
|
|
2
|
-
{
|
|
3
|
-
value: 'freeVocalInstruments',
|
|
4
|
-
name: 'Vocals & Instruments',
|
|
5
|
-
category: 'free',
|
|
6
|
-
stems: ['vocals', 'other'],
|
|
7
|
-
mutualExclusiveStems: ['freeVocalBassDrumsOthers'],
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
value: 'freeVocalBassDrumsOthers',
|
|
11
|
-
name: 'Vocal, Bass, Drums & Others',
|
|
12
|
-
category: 'free',
|
|
13
|
-
stems: ['vocals', 'bass', 'drums', 'other'],
|
|
14
|
-
mutualExclusiveStems: ['freeVocalInstruments'],
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
value: 'vocals',
|
|
18
|
-
name: 'Vocals',
|
|
19
|
-
category: 'premium',
|
|
20
|
-
paywallId: 'customSeparationVocals-stemSeparationExtension',
|
|
21
|
-
stems: ['vocals'],
|
|
22
|
-
mutualExclusiveStems: ['leadVocals', 'backingVocals'],
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
value: 'leadVocals',
|
|
26
|
-
name: 'Lead Vocals',
|
|
27
|
-
category: 'premium',
|
|
28
|
-
paywallId: 'customSeparationLeadVocals-stemSeparationExtension',
|
|
29
|
-
stems: ['leadVocals'],
|
|
30
|
-
mutualExclusiveStems: ['vocals'],
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
value: 'backingVocals',
|
|
34
|
-
name: 'Backing Vocals',
|
|
35
|
-
category: 'premium',
|
|
36
|
-
paywallId: 'customSeparationBackgroundVocals-stemSeparationExtension',
|
|
37
|
-
stems: ['backingVocals'],
|
|
38
|
-
mutualExclusiveStems: ['vocals'],
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
value: 'bass',
|
|
42
|
-
name: 'Bass',
|
|
43
|
-
category: 'premium',
|
|
44
|
-
paywallId: 'customSeparationBass-stemSeparationExtension',
|
|
45
|
-
stems: ['bass'],
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
value: 'guitars',
|
|
49
|
-
name: 'Guitars',
|
|
50
|
-
category: 'premium',
|
|
51
|
-
paywallId: 'customSeparationGuitars-stemSeparationExtension',
|
|
52
|
-
stems: ['guitars'],
|
|
53
|
-
mutualExclusiveStems: ['rhythmGuitars', 'soloGuitars', 'acousticGuitar', 'electricGuitar'],
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
value: 'rhythmGuitars',
|
|
57
|
-
name: 'Rhythm Guitars',
|
|
58
|
-
category: 'premium',
|
|
59
|
-
paywallId: 'customSeparationRhythmGuitar-stemSeparationExtension',
|
|
60
|
-
stems: ['rhythmGuitars'],
|
|
61
|
-
mutualExclusiveStems: ['guitars', 'acousticGuitar', 'electricGuitar'],
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
value: 'soloGuitars',
|
|
65
|
-
name: 'Solo Guitars',
|
|
66
|
-
category: 'premium',
|
|
67
|
-
paywallId: 'customSeparationLeadGuitar-stemSeparationExtension',
|
|
68
|
-
stems: ['soloGuitars'],
|
|
69
|
-
mutualExclusiveStems: ['guitars', 'acousticGuitar', 'electricGuitar'],
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
value: 'acousticGuitar',
|
|
73
|
-
name: 'Acoustic Guitar',
|
|
74
|
-
category: 'premium',
|
|
75
|
-
paywallId: 'customSeparationAcousticGuitar-stemSeparationExtension',
|
|
76
|
-
stems: ['acousticGuitar'],
|
|
77
|
-
mutualExclusiveStems: ['guitars', 'rhythmGuitars', 'soloGuitars'],
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
value: 'electricGuitar',
|
|
81
|
-
name: 'Electric Guitar',
|
|
82
|
-
category: 'premium',
|
|
83
|
-
paywallId: 'customSeparationElectricGuitar-stemSeparationExtension',
|
|
84
|
-
stems: ['electricGuitar'],
|
|
85
|
-
mutualExclusiveStems: ['guitars', 'rhythmGuitars', 'soloGuitars'],
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
value: 'strings',
|
|
89
|
-
name: 'Strings',
|
|
90
|
-
category: 'premium',
|
|
91
|
-
paywallId: 'customSeparationStrings-stemSeparationExtension',
|
|
92
|
-
stems: ['strings'],
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
value: 'piano',
|
|
96
|
-
name: 'Piano',
|
|
97
|
-
category: 'premium',
|
|
98
|
-
paywallId: 'customSeparationPiano-stemSeparationExtension',
|
|
99
|
-
stems: ['piano'],
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
value: 'keys',
|
|
103
|
-
name: 'Keys',
|
|
104
|
-
category: 'premium',
|
|
105
|
-
paywallId: 'customSeparationKeys-stemSeparationExtension',
|
|
106
|
-
stems: ['keys'],
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
value: 'wind',
|
|
110
|
-
name: 'Wind',
|
|
111
|
-
category: 'premium',
|
|
112
|
-
paywallId: 'customSeparationWind-stemSeparationExtension',
|
|
113
|
-
stems: ['wind'],
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
value: 'drums',
|
|
117
|
-
name: 'Drums',
|
|
118
|
-
category: 'premium',
|
|
119
|
-
paywallId: 'customSeparationDrums-stemSeparationExtension',
|
|
120
|
-
stems: ['drums'],
|
|
121
|
-
mutualExclusiveStems: ['kickDrums', 'snareDrums', 'toms', 'hiHat', 'cymbals'],
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
value: 'kickDrums',
|
|
125
|
-
name: 'Kick Drums',
|
|
126
|
-
category: 'pro',
|
|
127
|
-
paywallId: 'customSeparationDrumPartsKickDrum-stemSeparationExtension',
|
|
128
|
-
stems: ['kickDrums'],
|
|
129
|
-
mutualExclusiveStems: ['drums'],
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
value: 'snareDrums',
|
|
133
|
-
name: 'Snare Drums',
|
|
134
|
-
category: 'pro',
|
|
135
|
-
paywallId: 'customSeparationDrumPartsSnare-stemSeparationExtension',
|
|
136
|
-
stems: ['snareDrums'],
|
|
137
|
-
mutualExclusiveStems: ['drums'],
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
value: 'toms',
|
|
141
|
-
name: 'Toms',
|
|
142
|
-
category: 'pro',
|
|
143
|
-
paywallId: 'customSeparationDrumPartsToms-stemSeparationExtension',
|
|
144
|
-
stems: ['toms'],
|
|
145
|
-
mutualExclusiveStems: ['drums'],
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
value: 'hiHat',
|
|
149
|
-
name: 'Hi-Hat',
|
|
150
|
-
category: 'pro',
|
|
151
|
-
paywallId: 'customSeparationDrumPartsHiHat-stemSeparationExtension',
|
|
152
|
-
stems: ['hiHat'],
|
|
153
|
-
mutualExclusiveStems: ['drums'],
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
value: 'cymbals',
|
|
157
|
-
name: 'Cymbals',
|
|
158
|
-
category: 'pro',
|
|
159
|
-
paywallId: 'customSeparationDrumPartsCymbals-stemSeparationExtension',
|
|
160
|
-
stems: ['cymbals'],
|
|
161
|
-
mutualExclusiveStems: ['drums'],
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
value: 'other',
|
|
165
|
-
name: 'Other',
|
|
166
|
-
paywallId: 'customSeparationOther-stemSeparationExtension',
|
|
167
|
-
category: 'pro',
|
|
168
|
-
stems: ['other'],
|
|
169
|
-
},
|
|
170
|
-
]
|