@livo-tv/blocks 1.6.0 → 1.6.1
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.cjs +178 -148
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +178 -148
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4757,79 +4757,85 @@ function FileDropzone({
|
|
|
4757
4757
|
inputRef.current?.click();
|
|
4758
4758
|
}
|
|
4759
4759
|
}
|
|
4760
|
-
return /* @__PURE__ */ jsxs(
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4760
|
+
return /* @__PURE__ */ jsxs(
|
|
4761
|
+
"div",
|
|
4762
|
+
{
|
|
4763
|
+
className: cn("relative flex w-full min-w-0 flex-col gap-2", className),
|
|
4764
|
+
children: [
|
|
4765
|
+
/* @__PURE__ */ jsxs(
|
|
4766
|
+
"div",
|
|
4767
|
+
{
|
|
4768
|
+
role: "button",
|
|
4769
|
+
tabIndex: disabled ? -1 : 0,
|
|
4770
|
+
"aria-disabled": disabled,
|
|
4771
|
+
"aria-describedby": message ? `${inputId}-message` : `${inputId}-hint`,
|
|
4772
|
+
"aria-controls": inputId,
|
|
4773
|
+
"data-dragging": dragging || void 0,
|
|
4774
|
+
className: cn(
|
|
4775
|
+
"border-input bg-background focus-visible:border-ring focus-visible:ring-ring/50 w-full min-w-0 rounded-lg border border-dashed px-4 py-8 text-center outline-none focus-visible:ring-[3px]",
|
|
4776
|
+
dragging && "border-primary bg-primary/5",
|
|
4777
|
+
disabled && "pointer-events-none opacity-50"
|
|
4778
|
+
),
|
|
4779
|
+
onClick: () => {
|
|
4780
|
+
if (!disabled) inputRef.current?.click();
|
|
4781
|
+
},
|
|
4782
|
+
onKeyDown,
|
|
4783
|
+
onDragEnter: (event) => {
|
|
4784
|
+
event.preventDefault();
|
|
4785
|
+
if (!disabled) setDragging(true);
|
|
4786
|
+
},
|
|
4787
|
+
onDragOver: (event) => {
|
|
4788
|
+
event.preventDefault();
|
|
4789
|
+
},
|
|
4790
|
+
onDragLeave: (event) => {
|
|
4791
|
+
if (event.currentTarget.contains(event.relatedTarget)) {
|
|
4792
|
+
return;
|
|
4793
|
+
}
|
|
4794
|
+
setDragging(false);
|
|
4795
|
+
},
|
|
4796
|
+
onDrop,
|
|
4797
|
+
children: [
|
|
4798
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: labels.idle }),
|
|
4799
|
+
/* @__PURE__ */ jsx(
|
|
4800
|
+
"p",
|
|
4801
|
+
{
|
|
4802
|
+
id: `${inputId}-hint`,
|
|
4803
|
+
className: "text-muted-foreground mt-1 text-xs",
|
|
4804
|
+
children: labels.hint
|
|
4805
|
+
}
|
|
4806
|
+
),
|
|
4807
|
+
/* @__PURE__ */ jsx("span", { className: "text-primary mt-3 inline-flex text-sm font-medium underline-offset-4", children: labels.browse })
|
|
4808
|
+
]
|
|
4789
4809
|
}
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
"
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4810
|
+
),
|
|
4811
|
+
/* @__PURE__ */ jsx(
|
|
4812
|
+
"input",
|
|
4813
|
+
{
|
|
4814
|
+
id: inputId,
|
|
4815
|
+
ref: inputRef,
|
|
4816
|
+
type: "file",
|
|
4817
|
+
accept,
|
|
4818
|
+
disabled,
|
|
4819
|
+
"aria-label": labels.browse,
|
|
4820
|
+
className: "sr-only",
|
|
4821
|
+
onChange: (event) => {
|
|
4822
|
+
takeFile(event.target.files?.[0]);
|
|
4823
|
+
event.target.value = "";
|
|
4801
4824
|
}
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
className: "sr-only",
|
|
4817
|
-
onChange: (event) => {
|
|
4818
|
-
takeFile(event.target.files?.[0]);
|
|
4819
|
-
event.target.value = "";
|
|
4820
|
-
}
|
|
4821
|
-
}
|
|
4822
|
-
),
|
|
4823
|
-
message ? /* @__PURE__ */ jsx(
|
|
4824
|
-
"p",
|
|
4825
|
-
{
|
|
4826
|
-
id: `${inputId}-message`,
|
|
4827
|
-
role: "alert",
|
|
4828
|
-
className: "text-destructive text-sm",
|
|
4829
|
-
children: message
|
|
4830
|
-
}
|
|
4831
|
-
) : null
|
|
4832
|
-
] });
|
|
4825
|
+
}
|
|
4826
|
+
),
|
|
4827
|
+
message ? /* @__PURE__ */ jsx(
|
|
4828
|
+
"p",
|
|
4829
|
+
{
|
|
4830
|
+
id: `${inputId}-message`,
|
|
4831
|
+
role: "alert",
|
|
4832
|
+
className: "text-destructive text-sm",
|
|
4833
|
+
children: message
|
|
4834
|
+
}
|
|
4835
|
+
) : null
|
|
4836
|
+
]
|
|
4837
|
+
}
|
|
4838
|
+
);
|
|
4833
4839
|
}
|
|
4834
4840
|
function statusLabel(status, labels) {
|
|
4835
4841
|
switch (status) {
|
|
@@ -4862,73 +4868,90 @@ function FileUploadTray({
|
|
|
4862
4868
|
const labels = { ...DEFAULT_FILE_UPLOAD_TRAY_LABELS, ...labelOverrides };
|
|
4863
4869
|
const visible = jobs.filter((job) => job.status !== "cancelled");
|
|
4864
4870
|
if (visible.length === 0) return null;
|
|
4865
|
-
return /* @__PURE__ */ jsx(
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
{
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4871
|
+
return /* @__PURE__ */ jsx(
|
|
4872
|
+
"section",
|
|
4873
|
+
{
|
|
4874
|
+
"aria-label": labels.title,
|
|
4875
|
+
className: cn("grid min-w-0 gap-3", className),
|
|
4876
|
+
children: /* @__PURE__ */ jsx("ul", { className: "grid min-w-0 gap-3", children: visible.map((job) => {
|
|
4877
|
+
const active = job.status === "uploading" || job.status === "completing";
|
|
4878
|
+
const canPause = job.status === "uploading";
|
|
4879
|
+
const canResume = job.status === "paused";
|
|
4880
|
+
const canCancel = job.status === "uploading" || job.status === "paused" || job.status === "error";
|
|
4881
|
+
return /* @__PURE__ */ jsxs("li", { className: "grid min-w-0 gap-1.5", children: [
|
|
4882
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
4883
|
+
/* @__PURE__ */ jsx(
|
|
4884
|
+
"p",
|
|
4885
|
+
{
|
|
4886
|
+
className: "min-w-0 flex-1 truncate text-sm font-medium",
|
|
4887
|
+
title: job.name,
|
|
4888
|
+
children: job.name
|
|
4889
|
+
}
|
|
4890
|
+
),
|
|
4891
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground shrink-0 text-xs", children: statusLabel(job.status, labels) }),
|
|
4892
|
+
canPause ? /* @__PURE__ */ jsx(
|
|
4893
|
+
Button,
|
|
4894
|
+
{
|
|
4895
|
+
type: "button",
|
|
4896
|
+
variant: "ghost",
|
|
4897
|
+
size: "icon-sm",
|
|
4898
|
+
className: "shrink-0",
|
|
4899
|
+
"aria-label": `${labels.pause} ${job.name}`,
|
|
4900
|
+
onClick: () => onPause(job.id),
|
|
4901
|
+
children: /* @__PURE__ */ jsx(Pause, {})
|
|
4902
|
+
}
|
|
4903
|
+
) : null,
|
|
4904
|
+
canResume ? /* @__PURE__ */ jsx(
|
|
4905
|
+
Button,
|
|
4906
|
+
{
|
|
4907
|
+
type: "button",
|
|
4908
|
+
variant: "ghost",
|
|
4909
|
+
size: "icon-sm",
|
|
4910
|
+
className: "shrink-0",
|
|
4911
|
+
"aria-label": `${labels.resume} ${job.name}`,
|
|
4912
|
+
onClick: () => onResume(job.id),
|
|
4913
|
+
children: /* @__PURE__ */ jsx(Play, {})
|
|
4914
|
+
}
|
|
4915
|
+
) : null,
|
|
4916
|
+
canCancel ? /* @__PURE__ */ jsx(
|
|
4917
|
+
Button,
|
|
4918
|
+
{
|
|
4919
|
+
type: "button",
|
|
4920
|
+
variant: "ghost",
|
|
4921
|
+
size: "icon-sm",
|
|
4922
|
+
className: "shrink-0",
|
|
4923
|
+
"aria-label": `${labels.cancel} ${job.name}`,
|
|
4924
|
+
onClick: () => onCancel(job.id),
|
|
4925
|
+
children: /* @__PURE__ */ jsx(X, {})
|
|
4926
|
+
}
|
|
4927
|
+
) : null
|
|
4928
|
+
] }),
|
|
4929
|
+
/* @__PURE__ */ jsx(
|
|
4918
4930
|
"div",
|
|
4919
4931
|
{
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4932
|
+
role: "progressbar",
|
|
4933
|
+
"aria-valuemin": 0,
|
|
4934
|
+
"aria-valuemax": 100,
|
|
4935
|
+
"aria-valuenow": job.percent,
|
|
4936
|
+
"aria-label": job.name,
|
|
4937
|
+
className: "bg-muted h-2 overflow-hidden rounded-full",
|
|
4938
|
+
children: /* @__PURE__ */ jsx(
|
|
4939
|
+
"div",
|
|
4940
|
+
{
|
|
4941
|
+
className: cn(
|
|
4942
|
+
"bg-primary h-full",
|
|
4943
|
+
active && "motion-safe:transition-[width]"
|
|
4944
|
+
),
|
|
4945
|
+
style: { width: `${job.percent}%` }
|
|
4946
|
+
}
|
|
4947
|
+
)
|
|
4925
4948
|
}
|
|
4926
|
-
)
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4949
|
+
),
|
|
4950
|
+
job.error ? /* @__PURE__ */ jsx("p", { role: "alert", className: "text-destructive text-xs", children: job.error }) : null
|
|
4951
|
+
] }, job.id);
|
|
4952
|
+
}) })
|
|
4953
|
+
}
|
|
4954
|
+
);
|
|
4932
4955
|
}
|
|
4933
4956
|
function formatActiveBadge(count) {
|
|
4934
4957
|
return count > 9 ? "9+" : String(count);
|
|
@@ -4981,19 +5004,26 @@ function FileUploadMenu({
|
|
|
4981
5004
|
]
|
|
4982
5005
|
}
|
|
4983
5006
|
) }),
|
|
4984
|
-
/* @__PURE__ */ jsxs(
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
labels,
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
5007
|
+
/* @__PURE__ */ jsxs(
|
|
5008
|
+
DropdownMenuContent,
|
|
5009
|
+
{
|
|
5010
|
+
align,
|
|
5011
|
+
className: "w-80 min-w-0 max-w-[calc(100vw-2rem)] overflow-x-hidden p-0",
|
|
5012
|
+
children: [
|
|
5013
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-between border-b px-4 py-3", children: /* @__PURE__ */ jsx("h4", { className: "font-semibold", children: labels.title }) }),
|
|
5014
|
+
/* @__PURE__ */ jsx("div", { className: "max-h-80 min-w-0 overflow-x-hidden overflow-y-auto p-3", children: /* @__PURE__ */ jsx(
|
|
5015
|
+
FileUploadTray,
|
|
5016
|
+
{
|
|
5017
|
+
jobs: visible,
|
|
5018
|
+
labels,
|
|
5019
|
+
onPause,
|
|
5020
|
+
onResume,
|
|
5021
|
+
onCancel
|
|
5022
|
+
}
|
|
5023
|
+
) })
|
|
5024
|
+
]
|
|
5025
|
+
}
|
|
5026
|
+
)
|
|
4997
5027
|
]
|
|
4998
5028
|
}
|
|
4999
5029
|
);
|