@trustless-work/blocks 1.0.7 → 1.0.9
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 +1 -1
- package/templates/escrows/details/EscrowDetailDialog.tsx +10 -12
- package/templates/escrows/escrows-by-role/cards/EscrowsCards.tsx +3 -1
- package/templates/escrows/escrows-by-signer/cards/EscrowsCards.tsx +3 -1
- package/templates/escrows/multi-release/initialize-escrow/dialog/InitializeEscrow.tsx +26 -9
- package/templates/escrows/multi-release/initialize-escrow/form/InitializeEscrow.tsx +26 -9
- package/templates/escrows/multi-release/update-escrow/form/UpdateEscrow.tsx +1 -1
- package/templates/escrows/single-release/update-escrow/form/UpdateEscrow.tsx +1 -25
- package/templates/escrows/single-release/update-escrow/shared/schema.ts +0 -10
package/package.json
CHANGED
|
@@ -55,7 +55,7 @@ export const EscrowDetailDialog = ({
|
|
|
55
55
|
selectedEscrow,
|
|
56
56
|
});
|
|
57
57
|
|
|
58
|
-
const
|
|
58
|
+
const viewerUrl = `https://viewer.trustlesswork.com/${selectedEscrow?.contractId}`;
|
|
59
59
|
|
|
60
60
|
if (!isDialogOpen || !selectedEscrow) return null;
|
|
61
61
|
return (
|
|
@@ -65,17 +65,15 @@ export const EscrowDetailDialog = ({
|
|
|
65
65
|
<DialogHeader className="flex-shrink-0">
|
|
66
66
|
<div className="w-full">
|
|
67
67
|
<div className="flex flex-col gap-2">
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
</Link>
|
|
78
|
-
</div>
|
|
68
|
+
<Link
|
|
69
|
+
href={viewerUrl}
|
|
70
|
+
target="_blank"
|
|
71
|
+
className="hover:underline w-fit"
|
|
72
|
+
>
|
|
73
|
+
<DialogTitle className="text-xl">
|
|
74
|
+
{selectedEscrow.title}
|
|
75
|
+
</DialogTitle>
|
|
76
|
+
</Link>
|
|
79
77
|
|
|
80
78
|
<DialogDescription>
|
|
81
79
|
{selectedEscrow.description}
|
|
@@ -351,7 +351,9 @@ export const EscrowsByRoleCards = () => {
|
|
|
351
351
|
key={`milestone-${milestone.description}-${milestone.status}-${index}`}
|
|
352
352
|
className="text-xs flex justify-between"
|
|
353
353
|
>
|
|
354
|
-
|
|
354
|
+
<p className="truncate mr-4">
|
|
355
|
+
{milestone.description}
|
|
356
|
+
</p>
|
|
355
357
|
|
|
356
358
|
{escrow.type === "multi-release" &&
|
|
357
359
|
"amount" in milestone && (
|
|
@@ -339,7 +339,9 @@ export const EscrowsBySignerCards = () => {
|
|
|
339
339
|
key={`milestone-${milestone.description}-${milestone.status}-${index}`}
|
|
340
340
|
className="text-xs flex justify-between"
|
|
341
341
|
>
|
|
342
|
-
|
|
342
|
+
<p className="truncate mr-4">
|
|
343
|
+
{milestone.description}
|
|
344
|
+
</p>
|
|
343
345
|
|
|
344
346
|
{escrow.type === "multi-release" &&
|
|
345
347
|
"amount" in milestone && (
|
|
@@ -402,19 +402,36 @@ export const InitializeEscrowDialog = () => {
|
|
|
402
402
|
/>
|
|
403
403
|
|
|
404
404
|
<div className="space-y-4">
|
|
405
|
-
<FormLabel className="flex items-center">
|
|
406
|
-
|
|
407
|
-
|
|
405
|
+
<FormLabel className="flex items-center">Milestones</FormLabel>
|
|
406
|
+
|
|
407
|
+
<div className="grid grid-cols-1 md:grid-cols-12 gap-4 items-center">
|
|
408
|
+
<div className="md:col-span-4">
|
|
409
|
+
<FormLabel className="flex items-center">
|
|
410
|
+
Description<span className="text-destructive ml-1">*</span>
|
|
411
|
+
</FormLabel>
|
|
412
|
+
</div>
|
|
413
|
+
<div className="md:col-span-4">
|
|
414
|
+
<FormLabel className="flex items-center">
|
|
415
|
+
Receiver<span className="text-destructive ml-1">*</span>
|
|
416
|
+
</FormLabel>
|
|
417
|
+
</div>
|
|
418
|
+
<div className="md:col-span-3">
|
|
419
|
+
<FormLabel className="flex items-center">
|
|
420
|
+
Amount<span className="text-destructive ml-1">*</span>
|
|
421
|
+
</FormLabel>
|
|
422
|
+
</div>
|
|
423
|
+
</div>
|
|
424
|
+
|
|
408
425
|
{milestones.map((milestone, index) => (
|
|
409
426
|
<div key={index} className="space-y-4">
|
|
410
427
|
<div className="grid grid-cols-1 md:grid-cols-12 gap-4 items-center">
|
|
411
428
|
<div className="md:col-span-4">
|
|
412
429
|
<Input
|
|
413
|
-
placeholder="
|
|
414
|
-
value={milestone.
|
|
430
|
+
placeholder="Milestone description"
|
|
431
|
+
value={milestone.description}
|
|
415
432
|
onChange={(e) => {
|
|
416
433
|
const updatedMilestones = [...milestones];
|
|
417
|
-
updatedMilestones[index].
|
|
434
|
+
updatedMilestones[index].description = e.target.value;
|
|
418
435
|
form.setValue("milestones", updatedMilestones);
|
|
419
436
|
}}
|
|
420
437
|
/>
|
|
@@ -422,11 +439,11 @@ export const InitializeEscrowDialog = () => {
|
|
|
422
439
|
|
|
423
440
|
<div className="md:col-span-4">
|
|
424
441
|
<Input
|
|
425
|
-
placeholder="
|
|
426
|
-
value={milestone.
|
|
442
|
+
placeholder="Enter receiver address"
|
|
443
|
+
value={milestone.receiver}
|
|
427
444
|
onChange={(e) => {
|
|
428
445
|
const updatedMilestones = [...milestones];
|
|
429
|
-
updatedMilestones[index].
|
|
446
|
+
updatedMilestones[index].receiver = e.target.value;
|
|
430
447
|
form.setValue("milestones", updatedMilestones);
|
|
431
448
|
}}
|
|
432
449
|
/>
|
|
@@ -383,19 +383,36 @@ export const InitializeEscrowForm = () => {
|
|
|
383
383
|
/>
|
|
384
384
|
|
|
385
385
|
<div className="space-y-4">
|
|
386
|
-
<FormLabel className="flex items-center">
|
|
387
|
-
|
|
388
|
-
|
|
386
|
+
<FormLabel className="flex items-center">Milestones</FormLabel>
|
|
387
|
+
|
|
388
|
+
<div className="grid grid-cols-1 md:grid-cols-12 gap-4 items-center">
|
|
389
|
+
<div className="md:col-span-4">
|
|
390
|
+
<FormLabel className="flex items-center">
|
|
391
|
+
Description<span className="text-destructive ml-1">*</span>
|
|
392
|
+
</FormLabel>
|
|
393
|
+
</div>
|
|
394
|
+
<div className="md:col-span-4">
|
|
395
|
+
<FormLabel className="flex items-center">
|
|
396
|
+
Receiver<span className="text-destructive ml-1">*</span>
|
|
397
|
+
</FormLabel>
|
|
398
|
+
</div>
|
|
399
|
+
<div className="md:col-span-3">
|
|
400
|
+
<FormLabel className="flex items-center">
|
|
401
|
+
Amount<span className="text-destructive ml-1">*</span>
|
|
402
|
+
</FormLabel>
|
|
403
|
+
</div>
|
|
404
|
+
</div>
|
|
405
|
+
|
|
389
406
|
{milestones.map((milestone, index) => (
|
|
390
407
|
<div key={index} className="space-y-4 max-w-3xl">
|
|
391
408
|
<div className="grid grid-cols-1 md:grid-cols-12 gap-4 items-center">
|
|
392
409
|
<div className="md:col-span-4">
|
|
393
410
|
<Input
|
|
394
|
-
placeholder="
|
|
395
|
-
value={milestone.
|
|
411
|
+
placeholder="Milestone description"
|
|
412
|
+
value={milestone.description}
|
|
396
413
|
onChange={(e) => {
|
|
397
414
|
const updatedMilestones = [...milestones];
|
|
398
|
-
updatedMilestones[index].
|
|
415
|
+
updatedMilestones[index].description = e.target.value;
|
|
399
416
|
form.setValue("milestones", updatedMilestones);
|
|
400
417
|
}}
|
|
401
418
|
/>
|
|
@@ -403,11 +420,11 @@ export const InitializeEscrowForm = () => {
|
|
|
403
420
|
|
|
404
421
|
<div className="md:col-span-4">
|
|
405
422
|
<Input
|
|
406
|
-
placeholder="
|
|
407
|
-
value={milestone.
|
|
423
|
+
placeholder="Enter receiver address"
|
|
424
|
+
value={milestone.receiver}
|
|
408
425
|
onChange={(e) => {
|
|
409
426
|
const updatedMilestones = [...milestones];
|
|
410
|
-
updatedMilestones[index].
|
|
427
|
+
updatedMilestones[index].receiver = e.target.value;
|
|
411
428
|
form.setValue("milestones", updatedMilestones);
|
|
412
429
|
}}
|
|
413
430
|
/>
|
|
@@ -322,7 +322,7 @@ export const UpdateEscrowForm = () => {
|
|
|
322
322
|
/>
|
|
323
323
|
</div>
|
|
324
324
|
|
|
325
|
-
<div className="grid grid-cols-1
|
|
325
|
+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
326
326
|
<FormField
|
|
327
327
|
control={form.control}
|
|
328
328
|
name="platformFee"
|
|
@@ -378,30 +378,6 @@ export const UpdateEscrowForm = () => {
|
|
|
378
378
|
</FormItem>
|
|
379
379
|
)}
|
|
380
380
|
/>
|
|
381
|
-
|
|
382
|
-
<FormField
|
|
383
|
-
control={form.control}
|
|
384
|
-
name="receiverMemo"
|
|
385
|
-
render={({ field }) => (
|
|
386
|
-
<FormItem>
|
|
387
|
-
<FormLabel className="flex items-center">
|
|
388
|
-
Receiver Memo (opcional)
|
|
389
|
-
</FormLabel>
|
|
390
|
-
<FormControl>
|
|
391
|
-
<Input
|
|
392
|
-
type="text"
|
|
393
|
-
placeholder="Enter the escrow receiver Memo"
|
|
394
|
-
{...field}
|
|
395
|
-
disabled={isEscrowLocked}
|
|
396
|
-
onChange={(e) => {
|
|
397
|
-
field.onChange(e);
|
|
398
|
-
}}
|
|
399
|
-
/>
|
|
400
|
-
</FormControl>
|
|
401
|
-
<FormMessage />
|
|
402
|
-
</FormItem>
|
|
403
|
-
)}
|
|
404
|
-
/>
|
|
405
381
|
</div>
|
|
406
382
|
|
|
407
383
|
<FormField
|
|
@@ -79,16 +79,6 @@ export const useUpdateEscrowSchema = () => {
|
|
|
79
79
|
},
|
|
80
80
|
{ message: "Platform fee can have a maximum of 2 decimal places." }
|
|
81
81
|
),
|
|
82
|
-
receiverMemo: z
|
|
83
|
-
.string()
|
|
84
|
-
.optional()
|
|
85
|
-
.refine((val) => !val || val.length >= 1, {
|
|
86
|
-
message: "Receiver Memo must be at least 1.",
|
|
87
|
-
})
|
|
88
|
-
.refine((val) => !val || /^[1-9][0-9]*$/.test(val), {
|
|
89
|
-
message:
|
|
90
|
-
"Receiver Memo must be a whole number greater than 0 (no decimals).",
|
|
91
|
-
}),
|
|
92
82
|
});
|
|
93
83
|
};
|
|
94
84
|
|