@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.cjs
CHANGED
|
@@ -4783,79 +4783,85 @@ function FileDropzone({
|
|
|
4783
4783
|
inputRef.current?.click();
|
|
4784
4784
|
}
|
|
4785
4785
|
}
|
|
4786
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4786
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4787
|
+
"div",
|
|
4788
|
+
{
|
|
4789
|
+
className: cn("relative flex w-full min-w-0 flex-col gap-2", className),
|
|
4790
|
+
children: [
|
|
4791
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
4792
|
+
"div",
|
|
4793
|
+
{
|
|
4794
|
+
role: "button",
|
|
4795
|
+
tabIndex: disabled ? -1 : 0,
|
|
4796
|
+
"aria-disabled": disabled,
|
|
4797
|
+
"aria-describedby": message ? `${inputId}-message` : `${inputId}-hint`,
|
|
4798
|
+
"aria-controls": inputId,
|
|
4799
|
+
"data-dragging": dragging || void 0,
|
|
4800
|
+
className: cn(
|
|
4801
|
+
"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]",
|
|
4802
|
+
dragging && "border-primary bg-primary/5",
|
|
4803
|
+
disabled && "pointer-events-none opacity-50"
|
|
4804
|
+
),
|
|
4805
|
+
onClick: () => {
|
|
4806
|
+
if (!disabled) inputRef.current?.click();
|
|
4807
|
+
},
|
|
4808
|
+
onKeyDown,
|
|
4809
|
+
onDragEnter: (event) => {
|
|
4810
|
+
event.preventDefault();
|
|
4811
|
+
if (!disabled) setDragging(true);
|
|
4812
|
+
},
|
|
4813
|
+
onDragOver: (event) => {
|
|
4814
|
+
event.preventDefault();
|
|
4815
|
+
},
|
|
4816
|
+
onDragLeave: (event) => {
|
|
4817
|
+
if (event.currentTarget.contains(event.relatedTarget)) {
|
|
4818
|
+
return;
|
|
4819
|
+
}
|
|
4820
|
+
setDragging(false);
|
|
4821
|
+
},
|
|
4822
|
+
onDrop,
|
|
4823
|
+
children: [
|
|
4824
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium", children: labels.idle }),
|
|
4825
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4826
|
+
"p",
|
|
4827
|
+
{
|
|
4828
|
+
id: `${inputId}-hint`,
|
|
4829
|
+
className: "text-muted-foreground mt-1 text-xs",
|
|
4830
|
+
children: labels.hint
|
|
4831
|
+
}
|
|
4832
|
+
),
|
|
4833
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary mt-3 inline-flex text-sm font-medium underline-offset-4", children: labels.browse })
|
|
4834
|
+
]
|
|
4815
4835
|
}
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
"
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4836
|
+
),
|
|
4837
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4838
|
+
"input",
|
|
4839
|
+
{
|
|
4840
|
+
id: inputId,
|
|
4841
|
+
ref: inputRef,
|
|
4842
|
+
type: "file",
|
|
4843
|
+
accept,
|
|
4844
|
+
disabled,
|
|
4845
|
+
"aria-label": labels.browse,
|
|
4846
|
+
className: "sr-only",
|
|
4847
|
+
onChange: (event) => {
|
|
4848
|
+
takeFile(event.target.files?.[0]);
|
|
4849
|
+
event.target.value = "";
|
|
4827
4850
|
}
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
className: "sr-only",
|
|
4843
|
-
onChange: (event) => {
|
|
4844
|
-
takeFile(event.target.files?.[0]);
|
|
4845
|
-
event.target.value = "";
|
|
4846
|
-
}
|
|
4847
|
-
}
|
|
4848
|
-
),
|
|
4849
|
-
message ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4850
|
-
"p",
|
|
4851
|
-
{
|
|
4852
|
-
id: `${inputId}-message`,
|
|
4853
|
-
role: "alert",
|
|
4854
|
-
className: "text-destructive text-sm",
|
|
4855
|
-
children: message
|
|
4856
|
-
}
|
|
4857
|
-
) : null
|
|
4858
|
-
] });
|
|
4851
|
+
}
|
|
4852
|
+
),
|
|
4853
|
+
message ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4854
|
+
"p",
|
|
4855
|
+
{
|
|
4856
|
+
id: `${inputId}-message`,
|
|
4857
|
+
role: "alert",
|
|
4858
|
+
className: "text-destructive text-sm",
|
|
4859
|
+
children: message
|
|
4860
|
+
}
|
|
4861
|
+
) : null
|
|
4862
|
+
]
|
|
4863
|
+
}
|
|
4864
|
+
);
|
|
4859
4865
|
}
|
|
4860
4866
|
function statusLabel(status, labels) {
|
|
4861
4867
|
switch (status) {
|
|
@@ -4888,73 +4894,90 @@ function FileUploadTray({
|
|
|
4888
4894
|
const labels = { ...DEFAULT_FILE_UPLOAD_TRAY_LABELS, ...labelOverrides };
|
|
4889
4895
|
const visible = jobs.filter((job) => job.status !== "cancelled");
|
|
4890
4896
|
if (visible.length === 0) return null;
|
|
4891
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
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
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4897
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4898
|
+
"section",
|
|
4899
|
+
{
|
|
4900
|
+
"aria-label": labels.title,
|
|
4901
|
+
className: cn("grid min-w-0 gap-3", className),
|
|
4902
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "grid min-w-0 gap-3", children: visible.map((job) => {
|
|
4903
|
+
const active = job.status === "uploading" || job.status === "completing";
|
|
4904
|
+
const canPause = job.status === "uploading";
|
|
4905
|
+
const canResume = job.status === "paused";
|
|
4906
|
+
const canCancel = job.status === "uploading" || job.status === "paused" || job.status === "error";
|
|
4907
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "grid min-w-0 gap-1.5", children: [
|
|
4908
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
4909
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4910
|
+
"p",
|
|
4911
|
+
{
|
|
4912
|
+
className: "min-w-0 flex-1 truncate text-sm font-medium",
|
|
4913
|
+
title: job.name,
|
|
4914
|
+
children: job.name
|
|
4915
|
+
}
|
|
4916
|
+
),
|
|
4917
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground shrink-0 text-xs", children: statusLabel(job.status, labels) }),
|
|
4918
|
+
canPause ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4919
|
+
Button,
|
|
4920
|
+
{
|
|
4921
|
+
type: "button",
|
|
4922
|
+
variant: "ghost",
|
|
4923
|
+
size: "icon-sm",
|
|
4924
|
+
className: "shrink-0",
|
|
4925
|
+
"aria-label": `${labels.pause} ${job.name}`,
|
|
4926
|
+
onClick: () => onPause(job.id),
|
|
4927
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pause, {})
|
|
4928
|
+
}
|
|
4929
|
+
) : null,
|
|
4930
|
+
canResume ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4931
|
+
Button,
|
|
4932
|
+
{
|
|
4933
|
+
type: "button",
|
|
4934
|
+
variant: "ghost",
|
|
4935
|
+
size: "icon-sm",
|
|
4936
|
+
className: "shrink-0",
|
|
4937
|
+
"aria-label": `${labels.resume} ${job.name}`,
|
|
4938
|
+
onClick: () => onResume(job.id),
|
|
4939
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Play, {})
|
|
4940
|
+
}
|
|
4941
|
+
) : null,
|
|
4942
|
+
canCancel ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4943
|
+
Button,
|
|
4944
|
+
{
|
|
4945
|
+
type: "button",
|
|
4946
|
+
variant: "ghost",
|
|
4947
|
+
size: "icon-sm",
|
|
4948
|
+
className: "shrink-0",
|
|
4949
|
+
"aria-label": `${labels.cancel} ${job.name}`,
|
|
4950
|
+
onClick: () => onCancel(job.id),
|
|
4951
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, {})
|
|
4952
|
+
}
|
|
4953
|
+
) : null
|
|
4954
|
+
] }),
|
|
4955
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
4944
4956
|
"div",
|
|
4945
4957
|
{
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
4950
|
-
|
|
4958
|
+
role: "progressbar",
|
|
4959
|
+
"aria-valuemin": 0,
|
|
4960
|
+
"aria-valuemax": 100,
|
|
4961
|
+
"aria-valuenow": job.percent,
|
|
4962
|
+
"aria-label": job.name,
|
|
4963
|
+
className: "bg-muted h-2 overflow-hidden rounded-full",
|
|
4964
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
4965
|
+
"div",
|
|
4966
|
+
{
|
|
4967
|
+
className: cn(
|
|
4968
|
+
"bg-primary h-full",
|
|
4969
|
+
active && "motion-safe:transition-[width]"
|
|
4970
|
+
),
|
|
4971
|
+
style: { width: `${job.percent}%` }
|
|
4972
|
+
}
|
|
4973
|
+
)
|
|
4951
4974
|
}
|
|
4952
|
-
)
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4975
|
+
),
|
|
4976
|
+
job.error ? /* @__PURE__ */ jsxRuntime.jsx("p", { role: "alert", className: "text-destructive text-xs", children: job.error }) : null
|
|
4977
|
+
] }, job.id);
|
|
4978
|
+
}) })
|
|
4979
|
+
}
|
|
4980
|
+
);
|
|
4958
4981
|
}
|
|
4959
4982
|
function formatActiveBadge(count) {
|
|
4960
4983
|
return count > 9 ? "9+" : String(count);
|
|
@@ -5007,19 +5030,26 @@ function FileUploadMenu({
|
|
|
5007
5030
|
]
|
|
5008
5031
|
}
|
|
5009
5032
|
) }),
|
|
5010
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
labels,
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5033
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5034
|
+
DropdownMenuContent,
|
|
5035
|
+
{
|
|
5036
|
+
align,
|
|
5037
|
+
className: "w-80 min-w-0 max-w-[calc(100vw-2rem)] overflow-x-hidden p-0",
|
|
5038
|
+
children: [
|
|
5039
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-between border-b px-4 py-3", children: /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "font-semibold", children: labels.title }) }),
|
|
5040
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-80 min-w-0 overflow-x-hidden overflow-y-auto p-3", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5041
|
+
FileUploadTray,
|
|
5042
|
+
{
|
|
5043
|
+
jobs: visible,
|
|
5044
|
+
labels,
|
|
5045
|
+
onPause,
|
|
5046
|
+
onResume,
|
|
5047
|
+
onCancel
|
|
5048
|
+
}
|
|
5049
|
+
) })
|
|
5050
|
+
]
|
|
5051
|
+
}
|
|
5052
|
+
)
|
|
5023
5053
|
]
|
|
5024
5054
|
}
|
|
5025
5055
|
);
|