@moises.ai/design-system 4.18.10 → 4.18.11

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 CHANGED
@@ -8532,7 +8532,9 @@ const nb = ({
8532
8532
  }, [n, m, f, C, h, c]), R = J((w) => {
8533
8533
  w.preventDefault(), w.stopPropagation(), y(!k);
8534
8534
  }, [k]), E = J((w) => {
8535
- w.stopPropagation(), g == null || g(i);
8535
+ w.stopPropagation();
8536
+ const B = i.filter((x) => !x.loading && x.transfers.length > 0);
8537
+ g == null || g(B);
8536
8538
  }, [g, i]);
8537
8539
  return /* @__PURE__ */ v(
8538
8540
  S,
@@ -8565,7 +8567,7 @@ const nb = ({
8565
8567
  )
8566
8568
  ] }),
8567
8569
  m === n && /* @__PURE__ */ v(S, { direction: "column", children: [
8568
- i.length === 0 && !l && /* @__PURE__ */ v(S, { direction: "row", gap: "3", p: "5", pt: "2", align: "center", justify: "center", children: [
8570
+ o !== "voice" && i.length === 0 && !l && /* @__PURE__ */ v(S, { direction: "row", gap: "3", p: "5", pt: "2", align: "center", justify: "center", children: [
8569
8571
  /* @__PURE__ */ a(Bd, { width: 16, height: 16, style: { color: "var(--neutral-alpha-10)" } }),
8570
8572
  /* @__PURE__ */ a(H, { size: "2", style: { color: "var(--neutral-alpha-10)" }, children: u.noTracks || "This file has no tracks" })
8571
8573
  ] }),
@@ -8775,7 +8777,7 @@ const nb = ({
8775
8777
  const y = ae(() => {
8776
8778
  if (!g && h || g && f === null)
8777
8779
  return !0;
8778
- if (f) {
8780
+ if (f !== null) {
8779
8781
  const E = u.find((w) => parseInt(w.pitchShift) === f);
8780
8782
  return (E == null ? void 0 : E.loading) === !0 || !(E != null && E.audioUrl);
8781
8783
  }
@@ -8825,8 +8827,20 @@ const nb = ({
8825
8827
  children: /* @__PURE__ */ a(H, { size: "2", asChild: !0, children: /* @__PURE__ */ a("span", { className: ln.trackTitle, children: c }) })
8826
8828
  }
8827
8829
  ),
8828
- y && /* @__PURE__ */ a(S, { align: "center", justify: "center", pl: "2", children: /* @__PURE__ */ a(Sn, {}) }),
8829
- !g && !p && !y ? /* @__PURE__ */ a(S, { align: "center", justify: "center", pr: "2", children: /* @__PURE__ */ a(Oe, { variant: "soft", color: "gray", size: "1", children: o.process || "Process" }) }) : g ? /* @__PURE__ */ a(
8830
+ (g || p) && y && /* @__PURE__ */ a(S, { align: "center", justify: "center", pl: "2", children: /* @__PURE__ */ a(Sn, {}) }),
8831
+ !g && !p ? /* @__PURE__ */ a(S, { align: "center", justify: "center", pr: "2", pr: "0", children: /* @__PURE__ */ a(
8832
+ Oe,
8833
+ {
8834
+ variant: "soft",
8835
+ color: "gray",
8836
+ size: "1",
8837
+ disabled: y,
8838
+ loading: y,
8839
+ onClick: R,
8840
+ style: { minWidth: "63px" },
8841
+ children: o.process || "Process"
8842
+ }
8843
+ ) }) : g ? /* @__PURE__ */ a(
8830
8844
  Cb,
8831
8845
  {
8832
8846
  min: m,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moises.ai/design-system",
3
- "version": "4.18.10",
3
+ "version": "4.18.11",
4
4
  "description": "Design System package based on @radix-ui/themes with custom defaults",
5
5
  "private": false,
6
6
  "type": "module",
@@ -53,7 +53,8 @@ const ProjectItem = ({
53
53
 
54
54
  const handleInsertAllTracks = useCallback((e) => {
55
55
  e.stopPropagation()
56
- onInsertAllTracks?.(allTracks)
56
+ const tracksFiltered = allTracks.filter((track) => !track.loading && track.transfers.length > 0)
57
+ onInsertAllTracks?.(tracksFiltered)
57
58
  }, [onInsertAllTracks, allTracks])
58
59
 
59
60
  return (
@@ -100,7 +101,7 @@ const ProjectItem = ({
100
101
 
101
102
  {openedItem === id && (
102
103
  <Flex direction="column">
103
- {allTracks.length === 0 && !loading && (
104
+ {type !== 'voice' && allTracks.length === 0 && !loading && (
104
105
  <Flex direction="row" gap="3" p="5" pt="2" align="center" justify="center">
105
106
  <NoMusicIcon width={16} height={16} style={{ color: 'var(--neutral-alpha-10)' }} />
106
107
  <Text size="2" style={{ color: 'var(--neutral-alpha-10)' }}>{labels.noTracks || 'This file has no tracks'}</Text>
@@ -31,7 +31,7 @@ const ProjectTrackVoice = ({ ...props }) => {
31
31
  return true
32
32
  }
33
33
 
34
- if (pitchShiftSelected) {
34
+ if (pitchShiftSelected !== null) {
35
35
  const currentTransfer = transfers.find((transfer) => parseInt(transfer.pitchShift) === pitchShiftSelected)
36
36
  return currentTransfer?.loading === true || !currentTransfer?.audioUrl
37
37
  }
@@ -104,15 +104,23 @@ const ProjectTrackVoice = ({ ...props }) => {
104
104
  </Text>
105
105
  </Flex>
106
106
 
107
- {loading && (
107
+ {(hasTransfers || audioUrl) && loading && (
108
108
  <Flex align="center" justify="center" pl="2">
109
109
  <Spinner />
110
110
  </Flex>
111
111
  )}
112
112
 
113
- {!hasTransfers && !audioUrl && !loading ? (
114
- <Flex align="center" justify="center" pr="2">
115
- <Button variant="soft" color="gray" size="1">
113
+ {!hasTransfers && !audioUrl ? (
114
+ <Flex align="center" justify="center" pr="2" pr="0">
115
+ <Button
116
+ variant="soft"
117
+ color="gray"
118
+ size="1"
119
+ disabled={loading}
120
+ loading={loading}
121
+ onClick={handleClickTrack}
122
+ style={{ minWidth: '63px' }}
123
+ >
116
124
  {labels.process || 'Process'}
117
125
  </Button>
118
126
  </Flex>
@@ -261,6 +261,13 @@ export const WithTrackVoiceStates = {
261
261
  "duration": 30.72,
262
262
  "type": "voice",
263
263
  "tracks": [
264
+ {
265
+ "id": "q8pzli0h38ptcxq09h2al-0",
266
+ "title": "Ana",
267
+ "type": "voice",
268
+ "cover": "https://picsum.photos/101/101",
269
+ "transfers": [],
270
+ },
264
271
  {
265
272
  "id": "q8pzli0h38ptcx211133q09h2al-0",
266
273
  "title": "Joyce",
@@ -268,11 +275,15 @@ export const WithTrackVoiceStates = {
268
275
  "loading": true,
269
276
  },
270
277
  {
271
- "id": "q8pzli0h38ptcxq09h2al-0",
272
- "title": "Ana",
278
+ "id": "q8pzli0h38ptcx211133q09h2al-0",
279
+ "title": "Carlos",
273
280
  "type": "voice",
274
- "cover": "https://picsum.photos/101/101",
275
- "transfers": [],
281
+ "loading": true,
282
+ "transfers": [{
283
+ "id": "q8pzli0h38ptcxq09h1122al",
284
+ "pitchShift": "12",
285
+ "audioUrl": null
286
+ }],
276
287
  },
277
288
  {
278
289
  "id": "q8pzli0h38ptcxq09h2al3-0",
@@ -288,6 +299,21 @@ export const WithTrackVoiceStates = {
288
299
  "pitchShift": "13",
289
300
  "audioUrl": "https://d3-stage.moises.ai/v3/download/moises-stage--tasks-us-east1/operations/VOICETRANSFER_A/0a6c2a03-320e-49f2-9ea6-a5ad7bbb6141/vocals.m4a"
290
301
  }],
302
+ },
303
+ {
304
+ "id": "q8pzli0h38ptcxq09h2al3-0",
305
+ "title": "Claudia",
306
+ "type": "voice",
307
+ "cover": "https://picsum.photos/105/105",
308
+ "transfers": [{
309
+ "id": "q8pzli0h38ptcxq09h1122al",
310
+ "pitchShift": "1",
311
+ "audioUrl": "https://d3-stage.moises.ai/v3/download/moises-stage--tasks-us-east1/operations/VOICETRANSFER_A/0b926e1f-52ce-4581-9f76-09545eed1c61/vocals.m4"
312
+ }, {
313
+ "id": "q8pzli0h38ptcxq03339h2al2",
314
+ "pitchShift": "2",
315
+ "audioUrl": null
316
+ }],
291
317
  }
292
318
  ]
293
319
  }],