laif-ds 0.2.89 → 0.2.91
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/CHANGELOG.md +27 -0
- package/dist/_virtual/index3.js +5 -5
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/agent-docs/adoption-report.json +24 -26
- package/dist/agent-docs/components/AppSidebar.md +51 -12
- package/dist/agent-docs/components/SecurePdfViewer.md +27 -1
- package/dist/agent-docs/components/Sheet.md +4 -1
- package/dist/agent-docs/components/Sidebar.md +2 -1
- package/dist/agent-docs/components-list.md +1 -1
- package/dist/agent-docs/manifest.json +14 -6
- package/dist/components/ui/app-sidebar.js +188 -84
- package/dist/components/ui/file-previewer.js +28 -28
- package/dist/components/ui/secure-pdf-viewer.js +59 -64
- package/dist/components/ui/sheet.js +42 -39
- package/dist/components/ui/sidebar.js +105 -108
- package/dist/index.d.ts +12 -2
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
|
@@ -1,106 +1,210 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
2
|
+
import { jsxs as n, jsx as t, Fragment as R } from "react/jsx-runtime";
|
|
3
|
+
import * as s from "react";
|
|
4
|
+
import { designTokens as J } from "../design-tokens.js";
|
|
5
|
+
import { DropdownMenu as Q, DropdownMenuTrigger as U, DropdownMenuContent as V, DropdownMenuItem as W } from "./dropdown-menu.js";
|
|
4
6
|
import { Icon as h } from "./icon.js";
|
|
5
|
-
import { Sidebar as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
import { useSidebar as X, Sidebar as Y, SidebarHeader as Z, SidebarContent as _, SidebarRail as k, SidebarGroup as P, SidebarGroupLabel as L, SidebarGroupContent as ee, SidebarMenu as re, SidebarMenuItem as x, SidebarMenuButton as M, SidebarMenuSub as te, SidebarMenuSubItem as ie, SidebarMenuSubButton as T } from "./sidebar.js";
|
|
8
|
+
import { Tooltip as ne, TooltipTrigger as ce, TooltipContent as se } from "./tooltip.js";
|
|
9
|
+
import { cn as le } from "../../lib/utils.js";
|
|
10
|
+
const $ = (c, l) => `${c.title} ${l.url} ${l.title}`, D = (c) => `${c.url} ${c.title}`;
|
|
11
|
+
function me({
|
|
12
|
+
navigation: c,
|
|
13
|
+
navigationFooter: l,
|
|
14
|
+
headerContent: w,
|
|
15
|
+
footerContent: j,
|
|
16
|
+
showRail: z = !0,
|
|
17
|
+
collapsible: f,
|
|
18
|
+
linkComponent: a,
|
|
19
|
+
linkProps: p = {},
|
|
20
|
+
...G
|
|
15
21
|
}) {
|
|
16
|
-
const [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const { state: K, isMobile: I } = X(), B = s.useId(), m = f === "icon" && K === "collapsed" && !I, [O, y] = s.useState({}), g = s.useMemo(
|
|
23
|
+
() => [...c, ...l ?? []].flatMap(
|
|
24
|
+
(e) => e.items.filter(
|
|
25
|
+
(r) => r.subItems?.length && (r.isActive || r.subItems.some((i) => i.isActive))
|
|
26
|
+
).map((r) => $(e, r))
|
|
27
|
+
).join("|"),
|
|
28
|
+
[c, l]
|
|
29
|
+
);
|
|
30
|
+
s.useEffect(() => {
|
|
31
|
+
g && y((e) => {
|
|
32
|
+
const r = g.split("|").filter((i) => e[i] === void 0);
|
|
33
|
+
return r.length ? { ...e, ...Object.fromEntries(r.map((i) => [i, !0])) } : e;
|
|
25
34
|
});
|
|
26
|
-
}, [
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
}, [g]);
|
|
36
|
+
const v = s.useRef(/* @__PURE__ */ new Map()), A = s.useRef(null), N = (e) => (r) => {
|
|
37
|
+
r ? v.current.set(e, r) : v.current.delete(e);
|
|
38
|
+
};
|
|
39
|
+
s.useLayoutEffect(() => {
|
|
40
|
+
const e = A.current;
|
|
41
|
+
!e || document.activeElement !== document.body || v.current.get(e)?.focus();
|
|
42
|
+
}, [m]);
|
|
43
|
+
const o = (e) => e.iconName ? /* @__PURE__ */ t(h, { name: e.iconName, size: "sm" }) : f !== "icon" ? null : /* @__PURE__ */ t(
|
|
44
|
+
"span",
|
|
45
|
+
{
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
className: "flex size-4 shrink-0 items-center justify-center text-xs font-semibold uppercase opacity-0 transition-opacity group-data-[collapsible=icon]:opacity-100",
|
|
48
|
+
children: e.title.charAt(0)
|
|
49
|
+
}
|
|
50
|
+
), F = (e) => {
|
|
51
|
+
const r = /* @__PURE__ */ n(R, { children: [
|
|
52
|
+
e.iconName && /* @__PURE__ */ t(h, { name: e.iconName, size: "xs" }),
|
|
53
|
+
/* @__PURE__ */ t("span", { children: e.title })
|
|
34
54
|
] });
|
|
35
|
-
return
|
|
36
|
-
|
|
55
|
+
return a ? /* @__PURE__ */ t(T, { isActive: e.isActive, asChild: !0, children: /* @__PURE__ */ t(
|
|
56
|
+
a,
|
|
37
57
|
{
|
|
38
|
-
href:
|
|
39
|
-
className: "flex w-full items-center
|
|
40
|
-
|
|
41
|
-
...
|
|
58
|
+
href: e.url,
|
|
59
|
+
className: "flex w-full items-center gap-2",
|
|
60
|
+
"aria-current": e.isActive ? "page" : void 0,
|
|
61
|
+
...p,
|
|
42
62
|
children: r
|
|
43
63
|
}
|
|
44
|
-
) }) : /* @__PURE__ */ t(
|
|
64
|
+
) }) : /* @__PURE__ */ t(T, { isActive: e.isActive, asChild: !0, children: /* @__PURE__ */ t(
|
|
45
65
|
"a",
|
|
46
66
|
{
|
|
47
|
-
href:
|
|
48
|
-
className: "flex w-full items-center
|
|
49
|
-
|
|
67
|
+
href: e.url,
|
|
68
|
+
className: "flex w-full items-center gap-2",
|
|
69
|
+
"aria-current": e.isActive ? "page" : void 0,
|
|
50
70
|
children: r
|
|
51
71
|
}
|
|
52
72
|
) });
|
|
53
|
-
},
|
|
54
|
-
const
|
|
73
|
+
}, H = (e) => {
|
|
74
|
+
const r = /* @__PURE__ */ n(R, { children: [
|
|
55
75
|
e.iconName && /* @__PURE__ */ t(h, { name: e.iconName, size: "xs" }),
|
|
56
76
|
/* @__PURE__ */ t("span", { children: e.title })
|
|
57
|
-
] })
|
|
58
|
-
|
|
59
|
-
|
|
77
|
+
] }), i = le(
|
|
78
|
+
"flex w-full items-center gap-2",
|
|
79
|
+
e.isActive && J.dropdownItem.selected
|
|
80
|
+
);
|
|
81
|
+
return /* @__PURE__ */ t(W, { asChild: !0, children: a ? /* @__PURE__ */ t(
|
|
82
|
+
a,
|
|
60
83
|
{
|
|
61
84
|
href: e.url,
|
|
62
|
-
className:
|
|
63
|
-
|
|
64
|
-
|
|
85
|
+
className: i,
|
|
86
|
+
"aria-current": e.isActive ? "page" : void 0,
|
|
87
|
+
...p,
|
|
88
|
+
children: r
|
|
65
89
|
}
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
90
|
+
) : /* @__PURE__ */ t(
|
|
91
|
+
"a",
|
|
92
|
+
{
|
|
93
|
+
href: e.url,
|
|
94
|
+
className: i,
|
|
95
|
+
"aria-current": e.isActive ? "page" : void 0,
|
|
96
|
+
children: r
|
|
97
|
+
}
|
|
98
|
+
) }, D(e));
|
|
99
|
+
}, q = (e, r) => {
|
|
100
|
+
const i = $(e, r), S = r.subItems ?? [], b = O[i] ?? !1, E = `${B}-${i.replace(/[^\w-]+/g, "-")}-submenu`, u = /* @__PURE__ */ t("span", { className: "truncate", children: r.title });
|
|
101
|
+
return S.length === 0 ? /* @__PURE__ */ t(x, { children: /* @__PURE__ */ t(
|
|
102
|
+
M,
|
|
103
|
+
{
|
|
104
|
+
asChild: !0,
|
|
105
|
+
isActive: r.isActive,
|
|
106
|
+
tooltip: r.title,
|
|
107
|
+
children: a ? /* @__PURE__ */ n(
|
|
108
|
+
a,
|
|
109
|
+
{
|
|
110
|
+
href: r.url,
|
|
111
|
+
"aria-current": r.isActive ? "page" : void 0,
|
|
112
|
+
...p,
|
|
113
|
+
children: [
|
|
114
|
+
o(r),
|
|
115
|
+
u
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
) : /* @__PURE__ */ n(
|
|
119
|
+
"a",
|
|
120
|
+
{
|
|
121
|
+
href: r.url,
|
|
122
|
+
"aria-current": r.isActive ? "page" : void 0,
|
|
123
|
+
children: [
|
|
124
|
+
o(r),
|
|
125
|
+
u
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
) }, i) : m ? /* @__PURE__ */ t(x, { children: /* @__PURE__ */ n(ne, { children: [
|
|
131
|
+
/* @__PURE__ */ n(Q, { modal: !1, children: [
|
|
132
|
+
/* @__PURE__ */ t(U, { asChild: !0, children: /* @__PURE__ */ t(ce, { asChild: !0, children: /* @__PURE__ */ n(
|
|
133
|
+
M,
|
|
134
|
+
{
|
|
135
|
+
ref: N(i),
|
|
136
|
+
type: "button",
|
|
137
|
+
isActive: r.isActive,
|
|
138
|
+
onFocus: () => {
|
|
139
|
+
A.current = i;
|
|
140
|
+
},
|
|
141
|
+
children: [
|
|
142
|
+
o(r),
|
|
143
|
+
u
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
) }) }),
|
|
147
|
+
/* @__PURE__ */ t(
|
|
148
|
+
V,
|
|
149
|
+
{
|
|
150
|
+
side: "right",
|
|
151
|
+
align: "start",
|
|
152
|
+
sideOffset: 8,
|
|
153
|
+
className: "min-w-48",
|
|
154
|
+
children: S.map(H)
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
] }),
|
|
158
|
+
/* @__PURE__ */ t(
|
|
159
|
+
se,
|
|
160
|
+
{
|
|
161
|
+
side: "right",
|
|
162
|
+
align: "center",
|
|
163
|
+
hidden: !m,
|
|
164
|
+
children: r.title
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
] }) }, i) : /* @__PURE__ */ n(x, { children: [
|
|
168
|
+
/* @__PURE__ */ n(
|
|
169
|
+
M,
|
|
170
|
+
{
|
|
171
|
+
ref: N(i),
|
|
172
|
+
type: "button",
|
|
173
|
+
isActive: r.isActive,
|
|
174
|
+
tooltip: r.title,
|
|
175
|
+
"aria-expanded": b,
|
|
176
|
+
"aria-controls": E,
|
|
177
|
+
onFocus: () => {
|
|
178
|
+
A.current = i;
|
|
179
|
+
},
|
|
180
|
+
onClick: () => y((d) => ({ ...d, [i]: !d[i] })),
|
|
181
|
+
children: [
|
|
182
|
+
o(r),
|
|
183
|
+
u,
|
|
184
|
+
/* @__PURE__ */ t(
|
|
185
|
+
h,
|
|
186
|
+
{
|
|
187
|
+
name: b ? "ChevronDown" : "ChevronRight",
|
|
188
|
+
className: "text-d-muted-foreground ml-auto size-4 shrink-0 group-data-[collapsible=icon]:hidden"
|
|
189
|
+
}
|
|
190
|
+
)
|
|
191
|
+
]
|
|
192
|
+
}
|
|
193
|
+
),
|
|
194
|
+
b && /* @__PURE__ */ t(te, { id: E, children: S.map((d) => /* @__PURE__ */ t(ie, { children: F(d) }, D(d))) })
|
|
195
|
+
] }, i);
|
|
196
|
+
}, C = (e) => /* @__PURE__ */ n(P, { children: [
|
|
197
|
+
e.title && /* @__PURE__ */ t(L, { children: e.title }),
|
|
198
|
+
/* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(re, { children: e.items.map((r) => q(e, r)) }) })
|
|
199
|
+
] }, e.title);
|
|
200
|
+
return /* @__PURE__ */ n(Y, { collapsible: f, ...G, children: [
|
|
201
|
+
w && /* @__PURE__ */ t(Z, { children: w }),
|
|
202
|
+
/* @__PURE__ */ t(_, { children: c.map((e) => C(e)) }),
|
|
203
|
+
l?.map((e) => C(e)),
|
|
204
|
+
j,
|
|
205
|
+
z && /* @__PURE__ */ t(k, {})
|
|
102
206
|
] });
|
|
103
207
|
}
|
|
104
208
|
export {
|
|
105
|
-
|
|
209
|
+
me as AppSidebar
|
|
106
210
|
};
|
|
@@ -18,35 +18,35 @@ function I(e) {
|
|
|
18
18
|
return d.safeAsk(p(e));
|
|
19
19
|
}
|
|
20
20
|
const q = () => {
|
|
21
|
-
const [{ payload: e }, { asking:
|
|
21
|
+
const [{ payload: e }, { asking: t, ok: i }] = O(), n = e?.url, a = e?.readOnly, s = e?.page, l = u(() => e?.filename ? e?.filename : (e?.url || "").split(/[?#]/)[0].split("/").pop() || "" || "document", [e?.filename, e?.url]), c = u(() => {
|
|
22
22
|
if (!e?.url) return null;
|
|
23
23
|
const o = new URL(e?.url), m = o.searchParams.get("response-content-type") || o.searchParams.get("content-type"), f = e?.mimeType || m || "";
|
|
24
24
|
return P({
|
|
25
25
|
mimeType: f,
|
|
26
|
-
filename:
|
|
26
|
+
filename: l,
|
|
27
27
|
url: e?.url
|
|
28
28
|
});
|
|
29
|
-
}, [e?.mimeType,
|
|
29
|
+
}, [e?.mimeType, l, e?.url]), w = u(
|
|
30
30
|
() => /* @__PURE__ */ h("span", { className: "flex items-center gap-2", children: [
|
|
31
31
|
/* @__PURE__ */ r(x, { name: "File", className: "h-4 w-4" }),
|
|
32
|
-
e?.title ||
|
|
32
|
+
e?.title || l
|
|
33
33
|
] }),
|
|
34
|
-
[e?.title,
|
|
34
|
+
[e?.title, l]
|
|
35
35
|
);
|
|
36
36
|
return /* @__PURE__ */ r(
|
|
37
37
|
g,
|
|
38
38
|
{
|
|
39
|
-
open:
|
|
40
|
-
onOpenChange: (o) => !o &&
|
|
39
|
+
open: t,
|
|
40
|
+
onOpenChange: (o) => !o && i(),
|
|
41
41
|
title: w,
|
|
42
42
|
size: e?.size ?? "xl",
|
|
43
|
-
children: c &&
|
|
43
|
+
children: c && n ? /* @__PURE__ */ r(
|
|
44
44
|
F,
|
|
45
45
|
{
|
|
46
46
|
kind: c,
|
|
47
|
-
src:
|
|
48
|
-
officeUrl:
|
|
49
|
-
alt: e?.alt ??
|
|
47
|
+
src: n,
|
|
48
|
+
officeUrl: n,
|
|
49
|
+
alt: e?.alt ?? l,
|
|
50
50
|
readOnly: a,
|
|
51
51
|
page: s
|
|
52
52
|
}
|
|
@@ -55,57 +55,57 @@ const q = () => {
|
|
|
55
55
|
);
|
|
56
56
|
}, F = ({
|
|
57
57
|
kind: e,
|
|
58
|
-
src:
|
|
59
|
-
officeUrl:
|
|
60
|
-
alt:
|
|
58
|
+
src: t,
|
|
59
|
+
officeUrl: i,
|
|
60
|
+
alt: n,
|
|
61
61
|
readOnly: a = !1,
|
|
62
62
|
page: s = 0
|
|
63
63
|
}) => {
|
|
64
|
-
if (!
|
|
64
|
+
if (!t && e !== "text" && e !== "office")
|
|
65
65
|
return /* @__PURE__ */ r("div", { className: "text-d-secondary-foreground", children: "Nessuna sorgente disponibile" });
|
|
66
66
|
switch (e) {
|
|
67
67
|
case "image":
|
|
68
|
-
return
|
|
68
|
+
return t ? /* @__PURE__ */ r(y, { src: t, alt: n }) : null;
|
|
69
69
|
case "pdf": {
|
|
70
|
-
if (a &&
|
|
70
|
+
if (a && t)
|
|
71
71
|
return /* @__PURE__ */ r(
|
|
72
72
|
N,
|
|
73
73
|
{
|
|
74
|
-
url:
|
|
74
|
+
url: t,
|
|
75
75
|
initialPage: s || 1,
|
|
76
|
-
className: "h-full w-full"
|
|
76
|
+
className: "h-full w-full [--pdf-viewer-max-height:100%]"
|
|
77
77
|
}
|
|
78
78
|
);
|
|
79
|
-
let
|
|
80
|
-
return s > 0 && (
|
|
79
|
+
let l = t;
|
|
80
|
+
return s > 0 && (l += "#page=" + s), /* @__PURE__ */ r(
|
|
81
81
|
"iframe",
|
|
82
82
|
{
|
|
83
|
-
src:
|
|
83
|
+
src: l,
|
|
84
84
|
title: "PDF Preview",
|
|
85
85
|
className: "h-full w-full rounded"
|
|
86
86
|
}
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
case "audio":
|
|
90
|
-
return /* @__PURE__ */ r("div", { className: "grid h-full place-items-center", children: /* @__PURE__ */ r("audio", { controls: !0, className: "w-full max-w-2xl", children: /* @__PURE__ */ r("source", { src:
|
|
90
|
+
return /* @__PURE__ */ r("div", { className: "grid h-full place-items-center", children: /* @__PURE__ */ r("audio", { controls: !0, className: "w-full max-w-2xl", children: /* @__PURE__ */ r("source", { src: t }) }) });
|
|
91
91
|
case "video":
|
|
92
|
-
return /* @__PURE__ */ r("div", { className: "grid h-full place-items-center", children: /* @__PURE__ */ r("video", { controls: !0, className: "max-h-full w-full max-w-3xl rounded", children: /* @__PURE__ */ r("source", { src:
|
|
92
|
+
return /* @__PURE__ */ r("div", { className: "grid h-full place-items-center", children: /* @__PURE__ */ r("video", { controls: !0, className: "max-h-full w-full max-w-3xl rounded", children: /* @__PURE__ */ r("source", { src: t }) }) });
|
|
93
93
|
case "text":
|
|
94
94
|
return /* @__PURE__ */ r(
|
|
95
95
|
"iframe",
|
|
96
96
|
{
|
|
97
|
-
src:
|
|
97
|
+
src: t,
|
|
98
98
|
title: "Text Preview",
|
|
99
99
|
className: "h-full w-full rounded"
|
|
100
100
|
}
|
|
101
101
|
);
|
|
102
102
|
case "office": {
|
|
103
|
-
if (
|
|
104
|
-
const
|
|
103
|
+
if (i && b(i)) {
|
|
104
|
+
const l = A(i);
|
|
105
105
|
return /* @__PURE__ */ r(
|
|
106
106
|
"iframe",
|
|
107
107
|
{
|
|
108
|
-
src:
|
|
108
|
+
src: l,
|
|
109
109
|
title: "Office Preview",
|
|
110
110
|
className: "h-full w-full rounded"
|
|
111
111
|
}
|
|
@@ -5,7 +5,8 @@ import "react-pdf/dist/Page/TextLayer.css";
|
|
|
5
5
|
import { useState as l, useRef as W, useMemo as v, useEffect as d } from "react";
|
|
6
6
|
import { Button as N } from "./button.js";
|
|
7
7
|
import { Icon as s } from "./icon.js";
|
|
8
|
-
|
|
8
|
+
import { cn as D } from "../../lib/utils.js";
|
|
9
|
+
function T({
|
|
9
10
|
url: m,
|
|
10
11
|
initialPage: g = 1,
|
|
11
12
|
className: u = ""
|
|
@@ -30,7 +31,7 @@ function R({
|
|
|
30
31
|
x(i - 32);
|
|
31
32
|
}
|
|
32
33
|
}, 50);
|
|
33
|
-
},
|
|
34
|
+
}, k = (r) => {
|
|
34
35
|
console.error("PDF Load Error:", r), h(r.message || "Errore nel caricamento del PDF");
|
|
35
36
|
};
|
|
36
37
|
if (d(() => {
|
|
@@ -63,72 +64,66 @@ function R({
|
|
|
63
64
|
) })
|
|
64
65
|
}
|
|
65
66
|
);
|
|
66
|
-
const { Document:
|
|
67
|
-
return /* @__PURE__ */ c(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
const { Document: y, Page: C } = o;
|
|
68
|
+
return /* @__PURE__ */ c("div", { className: D("flex w-full flex-col items-center", u), children: [
|
|
69
|
+
/* @__PURE__ */ e(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
ref: n,
|
|
73
|
+
className: "border-d-border max-h-[var(--pdf-viewer-max-height,500px)] min-h-0 w-full grow overflow-auto rounded border",
|
|
74
|
+
children: /* @__PURE__ */ e(
|
|
75
|
+
y,
|
|
74
76
|
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
file: E,
|
|
78
|
+
onLoadSuccess: L,
|
|
79
|
+
onLoadError: k,
|
|
80
|
+
options: w,
|
|
81
|
+
loading: /* @__PURE__ */ e("div", { className: "flex min-h-[400px] items-center justify-center", children: /* @__PURE__ */ e(
|
|
82
|
+
s,
|
|
79
83
|
{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
onLoadError: y,
|
|
83
|
-
options: w,
|
|
84
|
-
loading: /* @__PURE__ */ e("div", { className: "flex min-h-[600px] items-center justify-center", children: /* @__PURE__ */ e(
|
|
85
|
-
s,
|
|
86
|
-
{
|
|
87
|
-
name: "Loader2",
|
|
88
|
-
className: "text-d-primary h-8 w-8 animate-spin"
|
|
89
|
-
}
|
|
90
|
-
) }),
|
|
91
|
-
error: /* @__PURE__ */ c("div", { className: "text-d-destructive flex min-h-[600px] flex-col items-center justify-center gap-2", children: [
|
|
92
|
-
/* @__PURE__ */ e(s, { name: "AlertCircle", className: "h-12 w-12" }),
|
|
93
|
-
/* @__PURE__ */ e("p", { children: "Errore nel caricamento del PDF" })
|
|
94
|
-
] }),
|
|
95
|
-
className: "h-full min-h-[600px] w-full border-0",
|
|
96
|
-
children: /* @__PURE__ */ e(k, { pageNumber: t, width: b })
|
|
84
|
+
name: "Loader2",
|
|
85
|
+
className: "text-d-primary h-8 w-8 animate-spin"
|
|
97
86
|
}
|
|
98
|
-
)
|
|
87
|
+
) }),
|
|
88
|
+
error: /* @__PURE__ */ c("div", { className: "text-d-destructive flex min-h-[400px] flex-col items-center justify-center gap-2", children: [
|
|
89
|
+
/* @__PURE__ */ e(s, { name: "AlertCircle", className: "h-12 w-12" }),
|
|
90
|
+
/* @__PURE__ */ e("p", { children: "Errore nel caricamento del PDF" })
|
|
91
|
+
] }),
|
|
92
|
+
className: "w-full border-0",
|
|
93
|
+
children: /* @__PURE__ */ e(C, { pageNumber: t, width: b })
|
|
99
94
|
}
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
);
|
|
95
|
+
)
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ c("div", { className: "my-4 flex w-full shrink-0 items-center justify-center gap-4", children: [
|
|
99
|
+
/* @__PURE__ */ e(
|
|
100
|
+
N,
|
|
101
|
+
{
|
|
102
|
+
onClick: () => f(Math.max(1, t - 1)),
|
|
103
|
+
disabled: t <= 1,
|
|
104
|
+
variant: "outline",
|
|
105
|
+
size: "sm",
|
|
106
|
+
children: /* @__PURE__ */ e(s, { name: "ChevronLeft", className: "h-4 w-4" })
|
|
107
|
+
}
|
|
108
|
+
),
|
|
109
|
+
/* @__PURE__ */ c("p", { className: "text-d-foreground text-sm", children: [
|
|
110
|
+
t,
|
|
111
|
+
" / ",
|
|
112
|
+
a
|
|
113
|
+
] }),
|
|
114
|
+
/* @__PURE__ */ e(
|
|
115
|
+
N,
|
|
116
|
+
{
|
|
117
|
+
onClick: () => f(Math.min(a || 1, t + 1)),
|
|
118
|
+
disabled: t >= (a || 1),
|
|
119
|
+
variant: "outline",
|
|
120
|
+
size: "sm",
|
|
121
|
+
children: /* @__PURE__ */ e(s, { name: "ChevronRight", className: "h-4 w-4" })
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
] })
|
|
125
|
+
] });
|
|
131
126
|
}
|
|
132
127
|
export {
|
|
133
|
-
|
|
128
|
+
T as SecurePdfViewer
|
|
134
129
|
};
|