@moises.ai/design-system 4.20.9 → 4.21.0
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/index.js +4961 -4468
- package/package.json +1 -1
- package/src/components/PanControl/PanControl.jsx +15 -6
- package/src/components/PanControl/PanControl.stories.jsx +12 -2
- package/src/components/ProjectsList/ProjectItem/ListItems.jsx +106 -0
- package/src/components/ProjectsList/ProjectItem/ListItems.module.css +43 -0
- package/src/components/ProjectsList/ProjectItem/ProjectItem.jsx +13 -84
- package/src/components/ProjectsList/ProjectItem/ProjectItem.module.css +0 -44
- package/src/components/ProjectsList/ProjectItemStemSeparation/ListStems.jsx +108 -0
- package/src/components/ProjectsList/ProjectItemStemSeparation/ListStems.module.css +43 -0
- package/src/components/ProjectsList/ProjectItemStemSeparation/ProjectItemStemSeparation.jsx +153 -0
- package/src/components/ProjectsList/ProjectItemStemSeparation/ProjectItemStemSeparation.module.css +68 -0
- package/src/components/ProjectsList/ProjectItemStemSeparation/StemSeparationForm.jsx +82 -0
- package/src/components/ProjectsList/ProjectItemStemSeparation/StemSeparationForm.module.css +40 -0
- package/src/components/ProjectsList/ProjectItemStemSeparation/use-form.js +46 -0
- package/src/components/ProjectsList/ProjectItemStemSeparation/utils.js +170 -0
- package/src/components/ProjectsList/ProjectTrack/ProjectTrack.jsx +12 -4
- package/src/components/ProjectsList/ProjectTrack/ProjectTrack.module.css +6 -2
- package/src/components/ProjectsList/ProjectsList.jsx +14 -3
- package/src/components/ProjectsList/ProjectsList.stories.jsx +47 -0
- package/src/components/ProjectsList/context.js +2 -0
- package/src/components/ProjectsList/utils-stories.js +425 -215
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { Flex, Text, Button } from '@radix-ui/themes'
|
|
2
|
+
import { useContext, useCallback, useState, useEffect } from 'react'
|
|
3
|
+
import { InfoIcon } from '../../../icons'
|
|
4
|
+
import { ProjectsListContext } from '../context'
|
|
5
|
+
import { ProductsBrandPattern } from '../../ProductsBrandPattern/ProductsBrandPattern'
|
|
6
|
+
import ListStems from './ListStems'
|
|
7
|
+
import StemSeparationForm from './StemSeparationForm'
|
|
8
|
+
import styles from './ProjectItemStemSeparation.module.css'
|
|
9
|
+
|
|
10
|
+
const ProjectItemStemSeparation = ({
|
|
11
|
+
id,
|
|
12
|
+
title,
|
|
13
|
+
artist,
|
|
14
|
+
cover,
|
|
15
|
+
type,
|
|
16
|
+
tracks: allTracks = [],
|
|
17
|
+
loading = false,
|
|
18
|
+
failed = false,
|
|
19
|
+
children,
|
|
20
|
+
labels = {},
|
|
21
|
+
stemSeparation,
|
|
22
|
+
...props
|
|
23
|
+
}) => {
|
|
24
|
+
const {
|
|
25
|
+
projects,
|
|
26
|
+
onProjectClick,
|
|
27
|
+
onSubmitStemSeparation,
|
|
28
|
+
openedItem,
|
|
29
|
+
setOpenedItem,
|
|
30
|
+
} = useContext(ProjectsListContext)
|
|
31
|
+
const [isChangingStems, setIsChangingStems] = useState(false)
|
|
32
|
+
const isOpen = openedItem === id
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!isOpen) {
|
|
36
|
+
setIsChangingStems(false)
|
|
37
|
+
}
|
|
38
|
+
}, [isOpen])
|
|
39
|
+
|
|
40
|
+
const handleClickProject = useCallback(() => {
|
|
41
|
+
if (failed) return
|
|
42
|
+
const project = projects.find((p) => p.id === id)
|
|
43
|
+
|
|
44
|
+
if (openedItem === id) {
|
|
45
|
+
setOpenedItem(null)
|
|
46
|
+
onProjectClick?.(project, false)
|
|
47
|
+
} else {
|
|
48
|
+
setOpenedItem(id)
|
|
49
|
+
onProjectClick?.(project, true)
|
|
50
|
+
}
|
|
51
|
+
}, [id, openedItem, setOpenedItem, onProjectClick, projects, failed])
|
|
52
|
+
|
|
53
|
+
const handleToggleChangeStems = useCallback((e) => {
|
|
54
|
+
e.stopPropagation()
|
|
55
|
+
setIsChangingStems((current) => !current)
|
|
56
|
+
}, [])
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Flex
|
|
60
|
+
direction="column"
|
|
61
|
+
p="1"
|
|
62
|
+
className={`${styles.item} ${openedItem === id ? styles.opened : ''} ${failed ? styles.failed : ''}`}
|
|
63
|
+
onClick={handleClickProject}
|
|
64
|
+
{...props}
|
|
65
|
+
>
|
|
66
|
+
<Flex direction="row" gap="3">
|
|
67
|
+
<Flex className={styles.projectCover}>
|
|
68
|
+
<ProductsBrandPattern type={type} cover={cover} title={title} size="48px" />
|
|
69
|
+
</Flex>
|
|
70
|
+
|
|
71
|
+
<Flex
|
|
72
|
+
direction="row"
|
|
73
|
+
gap="1"
|
|
74
|
+
align="start"
|
|
75
|
+
justify="center"
|
|
76
|
+
style={{ flex: 1, minWidth: 0 }}
|
|
77
|
+
>
|
|
78
|
+
<Flex
|
|
79
|
+
direction="column"
|
|
80
|
+
gap="1"
|
|
81
|
+
align="start"
|
|
82
|
+
justify="center"
|
|
83
|
+
height="100%"
|
|
84
|
+
style={{ flex: 1, minWidth: 0 }}
|
|
85
|
+
>
|
|
86
|
+
<Text size="2" asChild>
|
|
87
|
+
<span className={styles.projectTitle}>
|
|
88
|
+
{title}
|
|
89
|
+
</span>
|
|
90
|
+
</Text>
|
|
91
|
+
|
|
92
|
+
{failed ? (
|
|
93
|
+
<Flex size="1" gap="1" className={styles.projectFailed}>
|
|
94
|
+
<InfoIcon width={16} height={16} />
|
|
95
|
+
<Text size="1">Failed</Text>
|
|
96
|
+
</Flex>
|
|
97
|
+
) : artist && (
|
|
98
|
+
<Text size="1" asChild>
|
|
99
|
+
<span className={styles.projectArtist}>
|
|
100
|
+
{artist}
|
|
101
|
+
</span>
|
|
102
|
+
</Text>
|
|
103
|
+
)}
|
|
104
|
+
</Flex>
|
|
105
|
+
|
|
106
|
+
<Flex
|
|
107
|
+
direction="column"
|
|
108
|
+
pt="1"
|
|
109
|
+
pr="1"
|
|
110
|
+
className={`${styles.changeStems} ${isChangingStems ? styles.changeStemsVisible : ''}`}
|
|
111
|
+
>
|
|
112
|
+
{isOpen ? (
|
|
113
|
+
<Button
|
|
114
|
+
variant="soft"
|
|
115
|
+
color="gray"
|
|
116
|
+
size="1"
|
|
117
|
+
onClick={handleToggleChangeStems}
|
|
118
|
+
style={{ minWidth: 101 }}
|
|
119
|
+
>
|
|
120
|
+
{isChangingStems
|
|
121
|
+
? (labels.cancel || 'Cancel')
|
|
122
|
+
: (labels.changeStems || 'Change Stems')}
|
|
123
|
+
</Button>
|
|
124
|
+
) : null}
|
|
125
|
+
</Flex>
|
|
126
|
+
</Flex>
|
|
127
|
+
</Flex>
|
|
128
|
+
|
|
129
|
+
<StemSeparationForm
|
|
130
|
+
id={id}
|
|
131
|
+
project={projects.find((p) => p.id === id)}
|
|
132
|
+
open={isOpen && isChangingStems}
|
|
133
|
+
selected={stemSeparation.selected}
|
|
134
|
+
options={stemSeparation.options}
|
|
135
|
+
onSubmit={onSubmitStemSeparation}
|
|
136
|
+
setIsChangingStems={setIsChangingStems}
|
|
137
|
+
/>
|
|
138
|
+
|
|
139
|
+
<ListStems
|
|
140
|
+
id={id}
|
|
141
|
+
type={type}
|
|
142
|
+
tracks={allTracks}
|
|
143
|
+
loading={loading}
|
|
144
|
+
labels={labels}
|
|
145
|
+
open={isOpen && !isChangingStems}
|
|
146
|
+
>
|
|
147
|
+
{children}
|
|
148
|
+
</ListStems>
|
|
149
|
+
</Flex>
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export default ProjectItemStemSeparation
|
package/src/components/ProjectsList/ProjectItemStemSeparation/ProjectItemStemSeparation.module.css
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
.projectTitle {
|
|
2
|
+
color: var(--neutral-12);
|
|
3
|
+
padding-right: var(--space-2);
|
|
4
|
+
display: block;
|
|
5
|
+
width: 100%;
|
|
6
|
+
min-width: 0;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
text-overflow: ellipsis;
|
|
9
|
+
white-space: nowrap;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.projectArtist {
|
|
13
|
+
color: var(--neutral-alpha-9);
|
|
14
|
+
display: block;
|
|
15
|
+
width: 100%;
|
|
16
|
+
min-width: 0;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
text-overflow: ellipsis;
|
|
19
|
+
white-space: nowrap;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.projectFailed {
|
|
23
|
+
color: var(--error-alpha-11);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.projectCover {
|
|
27
|
+
width: 48px;
|
|
28
|
+
height: 48px;
|
|
29
|
+
flex: 0 0 48px;
|
|
30
|
+
border-radius: var(--radius-3);
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.projectCover img {
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: 100%;
|
|
37
|
+
object-fit: cover;
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.item:not(.failed) {
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
border-radius: var(--radius-4);
|
|
44
|
+
|
|
45
|
+
&.opened {
|
|
46
|
+
background: var(--neutral-alpha-2);
|
|
47
|
+
box-shadow: 0 24px 24px -16px rgba(0, 0, 0, 0.40);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:hover:not(.opened) {
|
|
51
|
+
background: rgba(216, 244, 246, 0.04);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.changeStems {
|
|
55
|
+
opacity: 0;
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&:hover .changeStems {
|
|
60
|
+
opacity: 1;
|
|
61
|
+
pointer-events: auto;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.changeStemsVisible {
|
|
65
|
+
opacity: 1;
|
|
66
|
+
pointer-events: auto;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Flex, Text } from '@radix-ui/themes'
|
|
2
|
+
import { Button } from '../../Button/Button'
|
|
3
|
+
import { Collapsible } from 'radix-ui'
|
|
4
|
+
import { useContext, useState } from 'react'
|
|
5
|
+
import { InstrumentSelect } from '../../InstrumentSelect/InstrumentSelect'
|
|
6
|
+
import { ProjectsListContext } from '../context'
|
|
7
|
+
import styles from './StemSeparationForm.module.css'
|
|
8
|
+
import { useForm } from './use-form'
|
|
9
|
+
|
|
10
|
+
const StemSeparationForm = ({
|
|
11
|
+
project,
|
|
12
|
+
id,
|
|
13
|
+
open,
|
|
14
|
+
options = [],
|
|
15
|
+
selected = [],
|
|
16
|
+
labels = {},
|
|
17
|
+
onSubmit,
|
|
18
|
+
setIsChangingStems,
|
|
19
|
+
}) => {
|
|
20
|
+
const { openedItem, onShowPaywall } = useContext(ProjectsListContext)
|
|
21
|
+
|
|
22
|
+
const {
|
|
23
|
+
stemsSelected,
|
|
24
|
+
hasChanges,
|
|
25
|
+
onToggleStems,
|
|
26
|
+
} = useForm({ onShowPaywall, selected })
|
|
27
|
+
|
|
28
|
+
const [loading, setLoading] = useState(false)
|
|
29
|
+
const isOpen = open ?? openedItem === id
|
|
30
|
+
|
|
31
|
+
const handleSubmit = async (e) => {
|
|
32
|
+
e.stopPropagation()
|
|
33
|
+
setLoading(true)
|
|
34
|
+
await onSubmit?.(project, stemsSelected)
|
|
35
|
+
setLoading(false)
|
|
36
|
+
setIsChangingStems(false)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Collapsible.Root open={isOpen} className={styles.contentCollapsible}>
|
|
41
|
+
<Collapsible.Content className={styles.content}>
|
|
42
|
+
<Flex pt="3">
|
|
43
|
+
<Button
|
|
44
|
+
variant="solid"
|
|
45
|
+
color="cyan"
|
|
46
|
+
size="2"
|
|
47
|
+
style={{ width: '100%' }}
|
|
48
|
+
disabled={!hasChanges}
|
|
49
|
+
loading={loading}
|
|
50
|
+
onClick={handleSubmit}
|
|
51
|
+
>
|
|
52
|
+
{labels.changeStems || 'Change Stems'}
|
|
53
|
+
</Button>
|
|
54
|
+
</Flex>
|
|
55
|
+
|
|
56
|
+
<Flex
|
|
57
|
+
direction="column"
|
|
58
|
+
gap="4"
|
|
59
|
+
pt="3"
|
|
60
|
+
pb="5"
|
|
61
|
+
height="100%"
|
|
62
|
+
onClick={(e) => e.stopPropagation()}
|
|
63
|
+
>
|
|
64
|
+
{options.map((option) => (
|
|
65
|
+
<Flex key={option.id} direction="column" gap="2">
|
|
66
|
+
<Text size="1" className={styles.groupLabel}>
|
|
67
|
+
{option.title}
|
|
68
|
+
</Text>
|
|
69
|
+
<InstrumentSelect
|
|
70
|
+
items={option.items}
|
|
71
|
+
selectedValue={stemsSelected}
|
|
72
|
+
onSelect={onToggleStems}
|
|
73
|
+
/>
|
|
74
|
+
</Flex>
|
|
75
|
+
))}
|
|
76
|
+
</Flex>
|
|
77
|
+
</Collapsible.Content>
|
|
78
|
+
</Collapsible.Root>
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export default StemSeparationForm
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.groupLabel {
|
|
2
|
+
color: var(--neutral-alpha-8);
|
|
3
|
+
letter-spacing: 1.5px;
|
|
4
|
+
text-transform: uppercase;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.contentCollapsible {
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.content {
|
|
12
|
+
overflow: hidden;
|
|
13
|
+
width: 100%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.content[data-state='open'] {
|
|
17
|
+
animation: projectItemSlideDown 0.3s ease;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.content[data-state='closed'] {
|
|
21
|
+
animation: projectItemSlideUp 0.3s ease;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@keyframes projectItemSlideDown {
|
|
25
|
+
from {
|
|
26
|
+
height: 0;
|
|
27
|
+
}
|
|
28
|
+
to {
|
|
29
|
+
height: var(--radix-collapsible-content-height);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@keyframes projectItemSlideUp {
|
|
34
|
+
from {
|
|
35
|
+
height: var(--radix-collapsible-content-height);
|
|
36
|
+
}
|
|
37
|
+
to {
|
|
38
|
+
height: 0;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { useState, useMemo, useEffect } from 'react'
|
|
2
|
+
import { stems } from './utils'
|
|
3
|
+
|
|
4
|
+
function areStemSelectionsEqual(current = [], initial = []) {
|
|
5
|
+
if (current.length !== initial.length) return false
|
|
6
|
+
const initialSet = new Set(initial)
|
|
7
|
+
return current.every((stem) => initialSet.has(stem))
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function useForm({ onShowPaywall, selected = [] }) {
|
|
11
|
+
const [stemsSelected, setStemsSelected] = useState(selected)
|
|
12
|
+
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
setStemsSelected(selected)
|
|
15
|
+
}, [selected])
|
|
16
|
+
|
|
17
|
+
const onToggleStems = async (value) => {
|
|
18
|
+
if (value.locked) {
|
|
19
|
+
onShowPaywall(value.paywallId)
|
|
20
|
+
return
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
setStemsSelected((prev) => {
|
|
24
|
+
// If the item is already selected, remove it (toggle off)
|
|
25
|
+
if (prev.includes(value.value)) {
|
|
26
|
+
return prev.filter((stem) => stem !== value.value)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// If the item is not selected, add it and remove the mutualExclusiveStems
|
|
30
|
+
const newStems = [...prev, value.value]
|
|
31
|
+
const mutualExclusiveStems = stems.find((s) => s.value === value.value)?.mutualExclusiveStems
|
|
32
|
+
return newStems.filter((stem) => !mutualExclusiveStems?.includes(stem))
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const hasChanges = useMemo(
|
|
37
|
+
() => !areStemSelectionsEqual(stemsSelected, selected),
|
|
38
|
+
[stemsSelected, selected],
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
stemsSelected,
|
|
43
|
+
onToggleStems,
|
|
44
|
+
hasChanges,
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
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
|
+
]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Flex, Text } from '@radix-ui/themes'
|
|
1
|
+
import { Flex, Text, Spinner } from '@radix-ui/themes'
|
|
2
2
|
import { useCallback, useContext } from 'react'
|
|
3
3
|
import { ArrowLeftIcon } from '../../../icons'
|
|
4
4
|
import { ProjectsListContext } from '../context'
|
|
@@ -9,19 +9,21 @@ const ProjectTrack = ({
|
|
|
9
9
|
...props
|
|
10
10
|
}) => {
|
|
11
11
|
const { onClickTrack } = useContext(ProjectsListContext)
|
|
12
|
-
const { id, title } = props
|
|
12
|
+
const { id, title, loading } = props
|
|
13
13
|
|
|
14
14
|
const handleClickTrack = useCallback((e) => {
|
|
15
15
|
e.stopPropagation()
|
|
16
|
+
if (loading) return
|
|
17
|
+
|
|
16
18
|
onClickTrack?.(props)
|
|
17
|
-
}, [onClickTrack, props])
|
|
19
|
+
}, [onClickTrack, props, loading])
|
|
18
20
|
|
|
19
21
|
return (
|
|
20
22
|
<Flex direction="column" gap="1">
|
|
21
23
|
<Flex
|
|
22
24
|
direction="row"
|
|
23
25
|
gap="3"
|
|
24
|
-
className={styles.itemTrack}
|
|
26
|
+
className={`${styles.itemTrack} ${loading ? styles.disabledHover : ''}`}
|
|
25
27
|
onClick={handleClickTrack}
|
|
26
28
|
>
|
|
27
29
|
<div className={styles.icon}>
|
|
@@ -44,6 +46,12 @@ const ProjectTrack = ({
|
|
|
44
46
|
</span>
|
|
45
47
|
</Text>
|
|
46
48
|
</Flex>
|
|
49
|
+
|
|
50
|
+
{loading && (
|
|
51
|
+
<Flex align="center" justify="center" px="2">
|
|
52
|
+
<Spinner />
|
|
53
|
+
</Flex>
|
|
54
|
+
)}
|
|
47
55
|
</Flex>
|
|
48
56
|
</Flex>
|
|
49
57
|
)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
.itemTrack {
|
|
2
|
-
cursor: pointer;
|
|
3
2
|
border-radius: var(--radius-3);
|
|
3
|
+
cursor: pointer;
|
|
4
4
|
|
|
5
5
|
.iconArrowLeft {
|
|
6
6
|
display: none;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
&:hover {
|
|
9
|
+
&:not(.disabledHover):hover {
|
|
10
10
|
background: var(--neutral-alpha-2);
|
|
11
11
|
box-shadow: 0 24px 24px -16px rgba(0, 0, 0, 0.40);
|
|
12
12
|
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
display: none;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
|
|
22
|
+
&.disabledHover {
|
|
23
|
+
cursor: default;
|
|
24
|
+
}
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
.trackTitle {
|
|
@@ -2,6 +2,7 @@ import { Flex } from '@radix-ui/themes'
|
|
|
2
2
|
import { useState } from 'react'
|
|
3
3
|
import { ProjectsListContext } from './context'
|
|
4
4
|
import ProjectItem from './ProjectItem/ProjectItem'
|
|
5
|
+
import ProjectItemStemSeparation from './ProjectItemStemSeparation/ProjectItemStemSeparation'
|
|
5
6
|
import ProjectTrack from './ProjectTrack/ProjectTrack'
|
|
6
7
|
import ProjectTrackVoice from './ProjectTrackVoice/ProjectTrackVoice'
|
|
7
8
|
|
|
@@ -12,6 +13,8 @@ export const ProjectsList = ({
|
|
|
12
13
|
onInsertAllTracks,
|
|
13
14
|
onProjectClick,
|
|
14
15
|
onChangeTransfer,
|
|
16
|
+
onSubmitStemSeparation,
|
|
17
|
+
onShowPaywall,
|
|
15
18
|
labels = {},
|
|
16
19
|
showCover = true
|
|
17
20
|
}) => {
|
|
@@ -25,6 +28,8 @@ export const ProjectsList = ({
|
|
|
25
28
|
onInsertAllTracks,
|
|
26
29
|
onProjectClick,
|
|
27
30
|
onChangeTransfer,
|
|
31
|
+
onSubmitStemSeparation,
|
|
32
|
+
onShowPaywall,
|
|
28
33
|
openedItem,
|
|
29
34
|
setOpenedItem,
|
|
30
35
|
labels,
|
|
@@ -33,9 +38,15 @@ export const ProjectsList = ({
|
|
|
33
38
|
>
|
|
34
39
|
<Flex direction="column" width="100%">
|
|
35
40
|
{projects.map((project) => (
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
|
|
41
|
+
project.type === 'stems' ? (
|
|
42
|
+
<ProjectItemStemSeparation key={project.id} {...project} labels={labels}>
|
|
43
|
+
{children}
|
|
44
|
+
</ProjectItemStemSeparation>
|
|
45
|
+
) : (
|
|
46
|
+
<ProjectItem key={project.id} {...project} labels={labels}>
|
|
47
|
+
{children}
|
|
48
|
+
</ProjectItem>
|
|
49
|
+
)
|
|
39
50
|
))}
|
|
40
51
|
</Flex>
|
|
41
52
|
</ProjectsListContext.Provider>
|