@devalok/shilp-sutra 0.44.1 → 0.45.0
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/AGENTS.md +13 -11
- package/BREAKING.json +209 -27
- package/MIGRATION.md +34 -0
- package/README.md +12 -0
- package/dist/_chunks/badge-group.js +1 -0
- package/dist/_chunks/badge-group.js.map +1 -1
- package/dist/_chunks/block-shell.js +25 -0
- package/dist/_chunks/block-shell.js.map +1 -0
- package/dist/_chunks/chat.js +4 -2
- package/dist/_chunks/chat.js.map +1 -1
- package/dist/_chunks/document-preview.js +1 -1
- package/dist/_chunks/image-preview.js +4 -4
- package/dist/_chunks/shared.js +65 -78
- package/dist/_chunks/shared.js.map +1 -1
- package/dist/_chunks/success.js +108 -106
- package/dist/_chunks/success.js.map +1 -1
- package/dist/ai/blocks/block-shell.d.ts +19 -0
- package/dist/ai/blocks/block-shell.d.ts.map +1 -0
- package/dist/ai/blocks/block-table.d.ts.map +1 -1
- package/dist/ai/blocks/confirm.d.ts.map +1 -1
- package/dist/ai/blocks/error.d.ts.map +1 -1
- package/dist/ai/blocks/error.js +5 -5
- package/dist/ai/blocks/error.js.map +1 -1
- package/dist/ai/blocks/success.d.ts.map +1 -1
- package/dist/ai/blocks/text.d.ts.map +1 -1
- package/dist/ai/blocks/text.js +4 -3
- package/dist/ai/blocks/text.js.map +1 -1
- package/dist/composed/activity-feed.d.ts.map +1 -1
- package/dist/composed/activity-feed.js +14 -12
- package/dist/composed/activity-feed.js.map +1 -1
- package/dist/composed/file-preview/audio-preview.d.ts.map +1 -1
- package/dist/composed/file-preview/shared.d.ts +10 -0
- package/dist/composed/file-preview/shared.d.ts.map +1 -1
- package/dist/composed/file-preview/video-preview.d.ts.map +1 -1
- package/dist/composed/file-preview.js +149 -188
- package/dist/composed/file-preview.js.map +1 -1
- package/dist/composed/master-detail.d.ts.map +1 -1
- package/dist/composed/master-detail.js +13 -4
- package/dist/composed/master-detail.js.map +1 -1
- package/dist/composed/schedule-view.d.ts.map +1 -1
- package/dist/composed/schedule-view.js +52 -39
- package/dist/composed/schedule-view.js.map +1 -1
- package/dist/shell/notification-preferences.d.ts.map +1 -1
- package/dist/shell/notification-preferences.js +115 -114
- package/dist/shell/notification-preferences.js.map +1 -1
- package/dist/ui/badge-group.d.ts.map +1 -1
- package/dist/ui/card.d.ts +66 -16
- package/dist/ui/card.d.ts.map +1 -1
- package/dist/ui/card.js +85 -60
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/chat/message.d.ts.map +1 -1
- package/dist/ui/color-input.d.ts.map +1 -1
- package/dist/ui/color-input.js +18 -18
- package/dist/ui/color-input.js.map +1 -1
- package/dist/ui/data-table-body.d.ts.map +1 -1
- package/dist/ui/data-table-body.js +94 -64
- package/dist/ui/data-table-body.js.map +1 -1
- package/dist/ui/data-table-card.d.ts.map +1 -1
- package/dist/ui/data-table-card.js +50 -43
- package/dist/ui/data-table-card.js.map +1 -1
- package/dist/ui/data-table-context.d.ts +0 -4
- package/dist/ui/data-table-context.d.ts.map +1 -1
- package/dist/ui/data-table-context.js +8 -12
- package/dist/ui/data-table-context.js.map +1 -1
- package/dist/ui/data-table-header.d.ts.map +1 -1
- package/dist/ui/data-table-header.js +2 -2
- package/dist/ui/data-table-header.js.map +1 -1
- package/dist/ui/data-table.d.ts.map +1 -1
- package/dist/ui/data-table.js +185 -182
- package/dist/ui/data-table.js.map +1 -1
- package/dist/ui/index.d.ts +3 -2
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/index.js +59 -58
- package/dist/ui/index.js.map +1 -1
- package/dist/ui/segmented-control.js +4 -4
- package/dist/ui/segmented-control.js.map +1 -1
- package/dist/ui/separator.d.ts +6 -5
- package/dist/ui/separator.d.ts.map +1 -1
- package/dist/ui/separator.js +7 -10
- package/dist/ui/separator.js.map +1 -1
- package/dist/ui/split-button.d.ts.map +1 -1
- package/dist/ui/split-button.js +62 -129
- package/dist/ui/split-button.js.map +1 -1
- package/dist/ui/stat-card.d.ts +7 -0
- package/dist/ui/stat-card.d.ts.map +1 -1
- package/dist/ui/stat-card.js +144 -126
- package/dist/ui/stat-card.js.map +1 -1
- package/dist/ui/table-row-link.d.ts +45 -0
- package/dist/ui/table-row-link.d.ts.map +1 -0
- package/dist/ui/table-row-link.js +16 -0
- package/dist/ui/table-row-link.js.map +1 -0
- package/dist/ui/table.d.ts +49 -5
- package/dist/ui/table.d.ts.map +1 -1
- package/dist/ui/table.js +39 -29
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/toast-types.d.ts +10 -0
- package/dist/ui/toast-types.d.ts.map +1 -1
- package/dist/ui/toast.d.ts +6 -2
- package/dist/ui/toast.d.ts.map +1 -1
- package/dist/ui/toast.js +56 -54
- package/dist/ui/toast.js.map +1 -1
- package/docs/components/composed/content-card.md +2 -0
- package/docs/components/ui/button.md +3 -3
- package/docs/components/ui/card.md +27 -10
- package/docs/components/ui/color-input.md +2 -2
- package/docs/components/ui/data-table.md +8 -1
- package/docs/components/ui/segmented-control.md +2 -2
- package/docs/components/ui/separator.md +3 -1
- package/docs/components/ui/split-button.md +3 -0
- package/docs/components/ui/stat-card.md +10 -2
- package/docs/components/ui/table-row-link.md +41 -0
- package/docs/components/ui/table.md +69 -0
- package/docs/components/ui/toast.md +10 -6
- package/docs/recipes/install-next-app-router.md +1 -1
- package/docs/recipes/troubleshoot.md +1 -1
- package/llms.txt +159 -781
- package/make-kit/components/card.md +54 -16
- package/make-kit/components/table.md +45 -7
- package/make-kit/foundations/spacing.md +3 -1
- package/make-kit/foundations/surfaces.md +1 -1
- package/mcp-manifest.json +12349 -0
- package/mcp-manifest.schema.json +232 -0
- package/package.json +3 -3
- package/skill/README.md +0 -1
- package/skill/SKILL.md +9 -8
- package/skill/references/components.md +159 -781
- package/skill/references/setup-next-app-router.md +1 -1
- package/skill/references/troubleshoot.md +1 -1
- package/llms-full.txt +0 -7198
- package/llms-quick.txt +0 -251
- package/skill/references/components-full.md +0 -7200
|
@@ -6,22 +6,22 @@ import { n as i } from "../_chunks/badge-group.js";
|
|
|
6
6
|
import { Button as a } from "../ui/button.js";
|
|
7
7
|
import { Skeleton as o } from "../ui/skeleton.js";
|
|
8
8
|
import { TruncatedText as s } from "../ui/truncated-text.js";
|
|
9
|
-
import { a as c,
|
|
10
|
-
import * as
|
|
11
|
-
import { jsx as
|
|
12
|
-
import { IconDownload as
|
|
13
|
-
import { AnimatePresence as
|
|
9
|
+
import { a as c, n as l, o as u, t as d } from "../_chunks/shared.js";
|
|
10
|
+
import * as f from "react";
|
|
11
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
12
|
+
import { IconDownload as h, IconMaximize as g, IconPlayerPause as _, IconPlayerPlay as v } from "@tabler/icons-react";
|
|
13
|
+
import { AnimatePresence as y, motion as b } from "framer-motion";
|
|
14
14
|
//#region src/composed/file-preview/audio-preview.tsx
|
|
15
|
-
function
|
|
16
|
-
let i =
|
|
17
|
-
|
|
15
|
+
function x({ url: e, fileName: t, onError: n }) {
|
|
16
|
+
let i = f.useRef(null), o = f.useRef(null), [h, g] = f.useState(!1), [y, b] = f.useState(0), [x, S] = f.useState(0), [C, w] = f.useState(0), [T, E] = f.useState(1), [D, O] = f.useState(!1), [k, A] = f.useState(!1);
|
|
17
|
+
f.useEffect(() => {
|
|
18
18
|
function e(e) {
|
|
19
19
|
let t = o.current;
|
|
20
20
|
if (!t || !t.contains(document.activeElement) && document.activeElement !== t) return;
|
|
21
21
|
let n = i.current;
|
|
22
22
|
if (n) switch (e.key) {
|
|
23
23
|
case " ":
|
|
24
|
-
e.preventDefault(),
|
|
24
|
+
e.preventDefault(), g((e) => (e ? n.pause() : n.play(), !e));
|
|
25
25
|
break;
|
|
26
26
|
case "ArrowRight":
|
|
27
27
|
e.preventDefault(), n.currentTime = Math.min(n.duration || 0, n.currentTime + 5);
|
|
@@ -30,122 +30,96 @@ function b({ url: e, fileName: t, onError: n }) {
|
|
|
30
30
|
e.preventDefault(), n.currentTime = Math.max(0, n.currentTime - 5);
|
|
31
31
|
break;
|
|
32
32
|
case "m":
|
|
33
|
-
e.preventDefault(),
|
|
33
|
+
e.preventDefault(), O((e) => (n.muted = !e, !e));
|
|
34
34
|
break;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
38
38
|
}, []);
|
|
39
|
-
function
|
|
40
|
-
i.current && (
|
|
41
|
-
}
|
|
42
|
-
function N(e) {
|
|
43
|
-
if (!i.current || !b) return;
|
|
44
|
-
let t = e.currentTarget.getBoundingClientRect(), n = Math.max(0, Math.min(1, (e.clientX - t.left) / t.width));
|
|
45
|
-
i.current.currentTime = n * b;
|
|
39
|
+
function j() {
|
|
40
|
+
i.current && (h ? i.current.pause() : i.current.play(), g(!h));
|
|
46
41
|
}
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
let t = e.currentTarget.getBoundingClientRect();
|
|
50
|
-
j((e.clientX - t.left) / t.width * b);
|
|
42
|
+
function M(e) {
|
|
43
|
+
!i.current || !x || (i.current.currentTime = e / 100 * x);
|
|
51
44
|
}
|
|
52
|
-
function
|
|
45
|
+
function N() {
|
|
53
46
|
if (!i.current) return;
|
|
54
|
-
let e = !
|
|
55
|
-
|
|
47
|
+
let e = !D;
|
|
48
|
+
O(e), i.current.muted = e;
|
|
56
49
|
}
|
|
57
|
-
return
|
|
50
|
+
return k ? /* @__PURE__ */ p(d, {
|
|
58
51
|
message: "Could not load audio",
|
|
59
52
|
url: e
|
|
60
|
-
}) : /* @__PURE__ */
|
|
53
|
+
}) : /* @__PURE__ */ m("div", {
|
|
61
54
|
ref: o,
|
|
62
55
|
className: "rounded-surface bg-surface-raised shadow-raised overflow-hidden",
|
|
63
56
|
tabIndex: -1,
|
|
64
57
|
children: [
|
|
65
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ p("audio", {
|
|
66
59
|
ref: i,
|
|
67
60
|
src: e,
|
|
68
61
|
onTimeUpdate: () => {
|
|
69
|
-
i.current && (
|
|
62
|
+
i.current && (w(i.current.currentTime), i.current.duration && b(i.current.currentTime / i.current.duration * 100));
|
|
70
63
|
},
|
|
71
|
-
onLoadedMetadata: () =>
|
|
72
|
-
onEnded: () =>
|
|
64
|
+
onLoadedMetadata: () => S(i.current?.duration ?? 0),
|
|
65
|
+
onEnded: () => g(!1),
|
|
73
66
|
onError: () => {
|
|
74
|
-
|
|
67
|
+
A(!0), n?.("Audio failed to load");
|
|
75
68
|
}
|
|
76
69
|
}),
|
|
77
70
|
/* @__PURE__ */ p("div", {
|
|
78
|
-
className: "
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
tabIndex: 0,
|
|
88
|
-
children: [
|
|
89
|
-
/* @__PURE__ */ f("div", {
|
|
90
|
-
className: "absolute left-0 top-0 h-full bg-accent-9 transition-[width] duration-75",
|
|
91
|
-
style: { width: `${v}%` }
|
|
92
|
-
}),
|
|
93
|
-
A !== null && /* @__PURE__ */ f("div", {
|
|
94
|
-
className: "absolute -top-7 -translate-x-1/2 rounded-control-inner bg-surface-overlay px-1.5 py-0.5 text-[10px] font-mono text-surface-fg shadow-floating pointer-events-none",
|
|
95
|
-
style: { left: `${A / (b || 1) * 100}%` },
|
|
96
|
-
children: c(A)
|
|
97
|
-
}),
|
|
98
|
-
/* @__PURE__ */ f("div", {
|
|
99
|
-
className: "absolute top-1/2 -translate-y-1/2 h-2.5 w-2.5 rounded-pill bg-accent-9 shadow-raised opacity-0 group-hover/bar:opacity-100 transition-opacity",
|
|
100
|
-
style: {
|
|
101
|
-
left: `${v}%`,
|
|
102
|
-
marginLeft: "-5px"
|
|
103
|
-
}
|
|
104
|
-
})
|
|
105
|
-
]
|
|
71
|
+
className: "px-ds-03 pt-ds-02",
|
|
72
|
+
children: /* @__PURE__ */ p(l, {
|
|
73
|
+
value: y,
|
|
74
|
+
max: 100,
|
|
75
|
+
step: .1,
|
|
76
|
+
onValueChange: M,
|
|
77
|
+
tone: "light",
|
|
78
|
+
ariaLabel: "Audio progress"
|
|
79
|
+
})
|
|
106
80
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ m("div", {
|
|
108
82
|
className: "flex items-center gap-ds-04 px-ds-05 py-ds-04",
|
|
109
83
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ p(a, {
|
|
111
85
|
variant: "solid",
|
|
112
86
|
size: "icon-sm",
|
|
113
|
-
onClick:
|
|
114
|
-
"aria-label":
|
|
115
|
-
title:
|
|
87
|
+
onClick: j,
|
|
88
|
+
"aria-label": h ? "Pause" : "Play",
|
|
89
|
+
title: h ? "Pause" : "Play",
|
|
116
90
|
className: "shrink-0",
|
|
117
|
-
children:
|
|
118
|
-
icon: g,
|
|
119
|
-
size: "sm"
|
|
120
|
-
}) : /* @__PURE__ */ f(r, {
|
|
91
|
+
children: h ? /* @__PURE__ */ p(r, {
|
|
121
92
|
icon: _,
|
|
93
|
+
size: "sm"
|
|
94
|
+
}) : /* @__PURE__ */ p(r, {
|
|
95
|
+
icon: v,
|
|
122
96
|
size: "sm",
|
|
123
97
|
className: "ml-0.5"
|
|
124
98
|
})
|
|
125
99
|
}),
|
|
126
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ m("div", {
|
|
127
101
|
className: "flex-1 min-w-0",
|
|
128
|
-
children: [t && /* @__PURE__ */
|
|
102
|
+
children: [t && /* @__PURE__ */ p(s, {
|
|
129
103
|
as: "p",
|
|
130
104
|
mode: "middle",
|
|
131
105
|
className: "text-ds-sm font-semibold text-surface-fg",
|
|
132
106
|
children: t
|
|
133
|
-
}), /* @__PURE__ */
|
|
107
|
+
}), /* @__PURE__ */ m("p", {
|
|
134
108
|
className: "text-ds-xs font-mono text-surface-fg-muted tabular-nums",
|
|
135
109
|
children: [
|
|
136
|
-
|
|
110
|
+
u(C),
|
|
137
111
|
" / ",
|
|
138
|
-
|
|
112
|
+
u(x)
|
|
139
113
|
]
|
|
140
114
|
})]
|
|
141
115
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
volume:
|
|
144
|
-
muted:
|
|
116
|
+
/* @__PURE__ */ p(c, {
|
|
117
|
+
volume: T,
|
|
118
|
+
muted: D,
|
|
145
119
|
onVolumeChange: (e) => {
|
|
146
|
-
|
|
120
|
+
E(e), i.current && (i.current.volume = e), e > 0 && D && (O(!1), i.current && (i.current.muted = !1));
|
|
147
121
|
},
|
|
148
|
-
onMuteToggle:
|
|
122
|
+
onMuteToggle: N,
|
|
149
123
|
variant: "light"
|
|
150
124
|
})
|
|
151
125
|
]
|
|
@@ -155,20 +129,20 @@ function b({ url: e, fileName: t, onError: n }) {
|
|
|
155
129
|
}
|
|
156
130
|
//#endregion
|
|
157
131
|
//#region src/composed/file-preview/embed-preview.tsx
|
|
158
|
-
function
|
|
159
|
-
let [i, a] =
|
|
160
|
-
return
|
|
132
|
+
function S({ url: e, embedUrl: n, onError: r }) {
|
|
133
|
+
let [i, a] = f.useState(!1), [s, c] = f.useState(!1);
|
|
134
|
+
return f.useEffect(() => {
|
|
161
135
|
let e = setTimeout(() => {
|
|
162
136
|
i || (c(!0), r?.("Embed timed out"));
|
|
163
137
|
}, 15e3);
|
|
164
138
|
return () => clearTimeout(e);
|
|
165
|
-
}, [i, r]), s ? /* @__PURE__ */
|
|
139
|
+
}, [i, r]), s ? /* @__PURE__ */ p(d, {
|
|
166
140
|
message: "Could not load embed",
|
|
167
141
|
url: e
|
|
168
|
-
}) : /* @__PURE__ */
|
|
142
|
+
}) : /* @__PURE__ */ m("div", {
|
|
169
143
|
className: "relative w-full rounded-control overflow-hidden",
|
|
170
144
|
style: { aspectRatio: "16 / 9" },
|
|
171
|
-
children: [!i && /* @__PURE__ */
|
|
145
|
+
children: [!i && /* @__PURE__ */ p(o, { className: "absolute inset-0" }), /* @__PURE__ */ p(b.iframe, {
|
|
172
146
|
src: n,
|
|
173
147
|
title: "Embedded content",
|
|
174
148
|
onLoad: () => a(!0),
|
|
@@ -185,7 +159,7 @@ function x({ url: e, embedUrl: n, onError: r }) {
|
|
|
185
159
|
}
|
|
186
160
|
//#endregion
|
|
187
161
|
//#region src/composed/file-preview/video-preview.tsx
|
|
188
|
-
var
|
|
162
|
+
var C = [
|
|
189
163
|
.5,
|
|
190
164
|
.75,
|
|
191
165
|
1,
|
|
@@ -193,9 +167,9 @@ var S = [
|
|
|
193
167
|
1.5,
|
|
194
168
|
2
|
|
195
169
|
];
|
|
196
|
-
function
|
|
197
|
-
let a =
|
|
198
|
-
|
|
170
|
+
function w({ url: n, onError: i }) {
|
|
171
|
+
let a = f.useRef(null), o = f.useRef(null), [s, h] = f.useState(!1), [x, S] = f.useState(0), [w, T] = f.useState(0), [E, D] = f.useState(0), [O, k] = f.useState(!1), [A, j] = f.useState(!1), [M, N] = f.useState(!0), [P, F] = f.useState(1), I = f.useRef(void 0);
|
|
172
|
+
f.useEffect(() => () => clearTimeout(I.current), []), f.useEffect(() => {
|
|
199
173
|
function e(e) {
|
|
200
174
|
let t = o.current;
|
|
201
175
|
if (!t || !t.contains(document.activeElement) && document.activeElement !== t) return;
|
|
@@ -203,7 +177,7 @@ function C({ url: n, onError: i }) {
|
|
|
203
177
|
if (n) switch (e.key) {
|
|
204
178
|
case " ":
|
|
205
179
|
case "k":
|
|
206
|
-
e.preventDefault(),
|
|
180
|
+
e.preventDefault(), h((e) => (e ? n.pause() : n.play(), !e));
|
|
207
181
|
break;
|
|
208
182
|
case "ArrowRight":
|
|
209
183
|
e.preventDefault(), n.currentTime = Math.min(n.duration, n.currentTime + 5);
|
|
@@ -218,65 +192,63 @@ function C({ url: n, onError: i }) {
|
|
|
218
192
|
e.preventDefault(), n.currentTime = Math.min(n.duration, n.currentTime + 10);
|
|
219
193
|
break;
|
|
220
194
|
case "m":
|
|
221
|
-
e.preventDefault(),
|
|
195
|
+
e.preventDefault(), k((e) => (n.muted = !e, !e));
|
|
222
196
|
break;
|
|
223
197
|
case "f":
|
|
224
198
|
e.preventDefault(), n.requestFullscreen?.();
|
|
225
199
|
break;
|
|
226
200
|
case ">":
|
|
227
|
-
e.preventDefault(),
|
|
201
|
+
e.preventDefault(), L(1);
|
|
228
202
|
break;
|
|
229
203
|
case "<":
|
|
230
|
-
e.preventDefault(),
|
|
204
|
+
e.preventDefault(), L(-1);
|
|
231
205
|
break;
|
|
232
206
|
}
|
|
233
207
|
}
|
|
234
208
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
235
209
|
}, []);
|
|
236
|
-
function
|
|
237
|
-
let t =
|
|
238
|
-
|
|
210
|
+
function L(e) {
|
|
211
|
+
let t = C.indexOf(P), n = C[Math.max(0, Math.min(C.length - 1, t + e))];
|
|
212
|
+
F(n), a.current && (a.current.playbackRate = n);
|
|
239
213
|
}
|
|
240
|
-
function
|
|
241
|
-
a.current && (s ? a.current.pause() : a.current.play(),
|
|
214
|
+
function R() {
|
|
215
|
+
a.current && (s ? a.current.pause() : a.current.play(), h(!s));
|
|
242
216
|
}
|
|
243
|
-
function
|
|
244
|
-
|
|
245
|
-
let t = e.currentTarget.getBoundingClientRect(), n = (e.clientX - t.left) / t.width;
|
|
246
|
-
a.current.currentTime = n * C;
|
|
217
|
+
function z(e) {
|
|
218
|
+
!a.current || !w || (a.current.currentTime = e / 100 * w);
|
|
247
219
|
}
|
|
248
|
-
function
|
|
249
|
-
|
|
220
|
+
function B() {
|
|
221
|
+
N(!0), clearTimeout(I.current), s && (I.current = setTimeout(() => N(!1), 3e3));
|
|
250
222
|
}
|
|
251
|
-
return
|
|
223
|
+
return A ? /* @__PURE__ */ p(d, {
|
|
252
224
|
message: "Could not load video",
|
|
253
225
|
url: n
|
|
254
|
-
}) : /* @__PURE__ */
|
|
226
|
+
}) : /* @__PURE__ */ m("div", {
|
|
255
227
|
ref: o,
|
|
256
228
|
className: "group relative rounded-control bg-black overflow-hidden",
|
|
257
|
-
onMouseMove:
|
|
258
|
-
onMouseLeave: () => s &&
|
|
229
|
+
onMouseMove: B,
|
|
230
|
+
onMouseLeave: () => s && N(!1),
|
|
259
231
|
tabIndex: -1,
|
|
260
232
|
children: [
|
|
261
|
-
/* @__PURE__ */
|
|
233
|
+
/* @__PURE__ */ p("video", {
|
|
262
234
|
ref: a,
|
|
263
235
|
src: n,
|
|
264
236
|
className: "max-h-[70vh] w-full",
|
|
265
|
-
onClick:
|
|
266
|
-
muted:
|
|
237
|
+
onClick: R,
|
|
238
|
+
muted: O,
|
|
267
239
|
onTimeUpdate: () => {
|
|
268
|
-
a.current && (
|
|
240
|
+
a.current && (D(a.current.currentTime), a.current.duration && S(a.current.currentTime / a.current.duration * 100));
|
|
269
241
|
},
|
|
270
|
-
onLoadedMetadata: () =>
|
|
242
|
+
onLoadedMetadata: () => T(a.current?.duration ?? 0),
|
|
271
243
|
onEnded: () => {
|
|
272
|
-
|
|
244
|
+
h(!1), N(!0);
|
|
273
245
|
},
|
|
274
246
|
onError: () => {
|
|
275
|
-
|
|
247
|
+
j(!0), i?.("Video failed to load");
|
|
276
248
|
},
|
|
277
249
|
playsInline: !0
|
|
278
250
|
}),
|
|
279
|
-
!s && /* @__PURE__ */
|
|
251
|
+
!s && /* @__PURE__ */ p(b.button, {
|
|
280
252
|
initial: {
|
|
281
253
|
opacity: 0,
|
|
282
254
|
scale: .8
|
|
@@ -286,19 +258,19 @@ function C({ url: n, onError: i }) {
|
|
|
286
258
|
scale: 1
|
|
287
259
|
},
|
|
288
260
|
transition: e.snappy,
|
|
289
|
-
onClick:
|
|
261
|
+
onClick: R,
|
|
290
262
|
className: "absolute inset-0 flex items-center justify-center bg-black/30",
|
|
291
263
|
"aria-label": "Play video",
|
|
292
|
-
children: /* @__PURE__ */
|
|
264
|
+
children: /* @__PURE__ */ p("div", {
|
|
293
265
|
className: "flex h-14 w-14 items-center justify-center rounded-pill bg-white/90 shadow-floating",
|
|
294
|
-
children: /* @__PURE__ */
|
|
295
|
-
icon:
|
|
266
|
+
children: /* @__PURE__ */ p(r, {
|
|
267
|
+
icon: v,
|
|
296
268
|
size: "xl",
|
|
297
269
|
className: "text-surface-fg ml-0.5"
|
|
298
270
|
})
|
|
299
271
|
})
|
|
300
272
|
}),
|
|
301
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ p(y, { children: M && w > 0 && /* @__PURE__ */ m(b.div, {
|
|
302
274
|
initial: {
|
|
303
275
|
opacity: 0,
|
|
304
276
|
y: 10
|
|
@@ -313,74 +285,63 @@ function C({ url: n, onError: i }) {
|
|
|
313
285
|
},
|
|
314
286
|
transition: t.fade,
|
|
315
287
|
className: "absolute bottom-0 left-0 right-0 bg-linear-to-t from-black/80 to-transparent px-ds-04 pb-ds-04 pt-ds-08",
|
|
316
|
-
children: [/* @__PURE__ */ p(
|
|
317
|
-
className: "
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
"
|
|
323
|
-
"
|
|
324
|
-
|
|
325
|
-
children: [/* @__PURE__ */ f("div", {
|
|
326
|
-
className: "absolute left-0 top-0 h-full rounded-pill bg-white transition-[width] duration-75",
|
|
327
|
-
style: { width: `${b}%` }
|
|
328
|
-
}), /* @__PURE__ */ f("div", {
|
|
329
|
-
className: "absolute top-1/2 -translate-y-1/2 h-3 w-3 rounded-pill bg-white shadow-raised opacity-0 group-hover/progress:opacity-100 transition-opacity",
|
|
330
|
-
style: {
|
|
331
|
-
left: `${b}%`,
|
|
332
|
-
marginLeft: "-6px"
|
|
333
|
-
}
|
|
334
|
-
})]
|
|
335
|
-
}), /* @__PURE__ */ p("div", {
|
|
288
|
+
children: [/* @__PURE__ */ p(l, {
|
|
289
|
+
className: "mb-ds-03",
|
|
290
|
+
value: x,
|
|
291
|
+
max: 100,
|
|
292
|
+
step: .1,
|
|
293
|
+
onValueChange: z,
|
|
294
|
+
tone: "dark",
|
|
295
|
+
ariaLabel: "Video progress"
|
|
296
|
+
}), /* @__PURE__ */ m("div", {
|
|
336
297
|
className: "flex items-center gap-ds-03",
|
|
337
298
|
children: [
|
|
338
|
-
/* @__PURE__ */
|
|
339
|
-
onClick:
|
|
299
|
+
/* @__PURE__ */ p("button", {
|
|
300
|
+
onClick: R,
|
|
340
301
|
className: "text-white hover:text-white/80",
|
|
341
302
|
"aria-label": s ? "Pause" : "Play",
|
|
342
303
|
title: s ? "Pause" : "Play",
|
|
343
|
-
children: s ? /* @__PURE__ */
|
|
344
|
-
icon: g,
|
|
345
|
-
size: "lg"
|
|
346
|
-
}) : /* @__PURE__ */ f(r, {
|
|
304
|
+
children: s ? /* @__PURE__ */ p(r, {
|
|
347
305
|
icon: _,
|
|
348
306
|
size: "lg"
|
|
307
|
+
}) : /* @__PURE__ */ p(r, {
|
|
308
|
+
icon: v,
|
|
309
|
+
size: "lg"
|
|
349
310
|
})
|
|
350
311
|
}),
|
|
351
|
-
/* @__PURE__ */
|
|
352
|
-
volume: +!
|
|
353
|
-
muted:
|
|
312
|
+
/* @__PURE__ */ p(c, {
|
|
313
|
+
volume: +!O,
|
|
314
|
+
muted: O,
|
|
354
315
|
onVolumeChange: (e) => {
|
|
355
|
-
a.current && (a.current.volume = e), e > 0 &&
|
|
316
|
+
a.current && (a.current.volume = e), e > 0 && O && (k(!1), a.current && (a.current.muted = !1));
|
|
356
317
|
},
|
|
357
318
|
onMuteToggle: () => {
|
|
358
|
-
|
|
319
|
+
k(!O), a.current && (a.current.muted = !O);
|
|
359
320
|
},
|
|
360
321
|
variant: "dark"
|
|
361
322
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ m("span", {
|
|
363
324
|
className: "text-[11px] font-mono text-white/70 tabular-nums",
|
|
364
325
|
children: [
|
|
365
|
-
|
|
326
|
+
u(E),
|
|
366
327
|
" / ",
|
|
367
|
-
|
|
328
|
+
u(w)
|
|
368
329
|
]
|
|
369
330
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
-
/* @__PURE__ */
|
|
372
|
-
onClick: () =>
|
|
331
|
+
/* @__PURE__ */ p("div", { className: "flex-1" }),
|
|
332
|
+
/* @__PURE__ */ m("button", {
|
|
333
|
+
onClick: () => L(1),
|
|
373
334
|
className: "text-[11px] font-mono text-white/70 hover:text-white px-1 rounded-control-inner hover:bg-white/10 transition-colors",
|
|
374
|
-
"aria-label": `Playback speed: ${
|
|
375
|
-
children: [
|
|
335
|
+
"aria-label": `Playback speed: ${P}x`,
|
|
336
|
+
children: [P, "x"]
|
|
376
337
|
}),
|
|
377
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ p("button", {
|
|
378
339
|
onClick: () => a.current?.requestFullscreen?.(),
|
|
379
340
|
className: "text-white hover:text-white/80",
|
|
380
341
|
"aria-label": "Fullscreen (F)",
|
|
381
342
|
title: "Fullscreen",
|
|
382
|
-
children: /* @__PURE__ */
|
|
383
|
-
icon:
|
|
343
|
+
children: /* @__PURE__ */ p(r, {
|
|
344
|
+
icon: g,
|
|
384
345
|
size: "sm"
|
|
385
346
|
})
|
|
386
347
|
})
|
|
@@ -392,8 +353,8 @@ function C({ url: n, onError: i }) {
|
|
|
392
353
|
}
|
|
393
354
|
//#endregion
|
|
394
355
|
//#region src/composed/file-preview.tsx
|
|
395
|
-
var
|
|
396
|
-
function
|
|
356
|
+
var T = f.lazy(() => import("../_chunks/image-preview.js")), E = f.lazy(() => import("../_chunks/document-preview.js"));
|
|
357
|
+
function D(e, t) {
|
|
397
358
|
if (t) {
|
|
398
359
|
if (t.startsWith("image/")) return "image";
|
|
399
360
|
if (t === "application/pdf") return "pdf";
|
|
@@ -423,7 +384,7 @@ function E(e, t) {
|
|
|
423
384
|
"flac"
|
|
424
385
|
].includes(n ?? "") ? "audio" : e.includes("figma.com") || e.includes("loom.com") || e.includes("youtube.com") || e.includes("youtu.be") || e.includes("vimeo.com") ? "embed" : "image";
|
|
425
386
|
}
|
|
426
|
-
function
|
|
387
|
+
function O(e) {
|
|
427
388
|
let t = e.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&?]+)/);
|
|
428
389
|
if (t) return `https://www.youtube.com/embed/${t[1]}`;
|
|
429
390
|
let n = e.match(/vimeo\.com\/(\d+)/);
|
|
@@ -432,62 +393,62 @@ function D(e) {
|
|
|
432
393
|
let r = e.match(/loom\.com\/share\/([^?]+)/);
|
|
433
394
|
return r ? `https://www.loom.com/embed/${r[1]}` : e;
|
|
434
395
|
}
|
|
435
|
-
function
|
|
436
|
-
let
|
|
437
|
-
return /* @__PURE__ */
|
|
396
|
+
function k({ url: e, type: t, mimeType: c, alt: l, initialPage: u = 1, fileName: d, fileSize: g, onError: _, className: v, ...y }) {
|
|
397
|
+
let b = t ?? D(e, c), C = /* @__PURE__ */ p(o, { className: "h-64 w-full rounded-control" });
|
|
398
|
+
return /* @__PURE__ */ m("div", {
|
|
438
399
|
className: n("flex flex-col gap-ds-03", v),
|
|
439
400
|
...y,
|
|
440
401
|
children: [
|
|
441
|
-
(
|
|
402
|
+
(d || g) && /* @__PURE__ */ m("div", {
|
|
442
403
|
className: "flex items-center gap-ds-03",
|
|
443
|
-
children: [
|
|
404
|
+
children: [d && /* @__PURE__ */ p(s, {
|
|
444
405
|
mode: "middle",
|
|
445
406
|
className: "min-w-0 text-ds-sm font-semibold text-surface-fg",
|
|
446
|
-
children:
|
|
447
|
-
}), g && /* @__PURE__ */
|
|
407
|
+
children: d
|
|
408
|
+
}), g && /* @__PURE__ */ p(i, {
|
|
448
409
|
variant: "subtle",
|
|
449
410
|
size: "xs",
|
|
450
411
|
children: g
|
|
451
412
|
})]
|
|
452
413
|
}),
|
|
453
|
-
|
|
454
|
-
fallback:
|
|
455
|
-
children: /* @__PURE__ */
|
|
414
|
+
b === "image" && /* @__PURE__ */ p(f.Suspense, {
|
|
415
|
+
fallback: C,
|
|
416
|
+
children: /* @__PURE__ */ p(T, {
|
|
456
417
|
url: e,
|
|
457
418
|
alt: l,
|
|
458
419
|
onError: _
|
|
459
420
|
})
|
|
460
421
|
}),
|
|
461
|
-
|
|
462
|
-
fallback:
|
|
463
|
-
children: /* @__PURE__ */
|
|
422
|
+
b === "pdf" && /* @__PURE__ */ p(f.Suspense, {
|
|
423
|
+
fallback: C,
|
|
424
|
+
children: /* @__PURE__ */ p(E, {
|
|
464
425
|
url: e,
|
|
465
426
|
initialPage: u,
|
|
466
427
|
onError: _
|
|
467
428
|
})
|
|
468
429
|
}),
|
|
469
|
-
|
|
430
|
+
b === "video" && /* @__PURE__ */ p(w, {
|
|
470
431
|
url: e,
|
|
471
432
|
onError: _
|
|
472
433
|
}),
|
|
473
|
-
|
|
434
|
+
b === "audio" && /* @__PURE__ */ p(x, {
|
|
474
435
|
url: e,
|
|
475
|
-
fileName:
|
|
436
|
+
fileName: d,
|
|
476
437
|
onError: _
|
|
477
438
|
}),
|
|
478
|
-
|
|
439
|
+
b === "embed" && /* @__PURE__ */ p(S, {
|
|
479
440
|
url: e,
|
|
480
|
-
embedUrl:
|
|
441
|
+
embedUrl: O(e),
|
|
481
442
|
onError: _
|
|
482
443
|
}),
|
|
483
|
-
|
|
444
|
+
b !== "audio" && /* @__PURE__ */ p("div", {
|
|
484
445
|
className: "flex justify-end",
|
|
485
|
-
children: /* @__PURE__ */
|
|
446
|
+
children: /* @__PURE__ */ p(a, {
|
|
486
447
|
variant: "ghost",
|
|
487
448
|
size: "xs",
|
|
488
|
-
startIcon: /* @__PURE__ */
|
|
449
|
+
startIcon: /* @__PURE__ */ p(r, { icon: h }),
|
|
489
450
|
asChild: !0,
|
|
490
|
-
children: /* @__PURE__ */
|
|
451
|
+
children: /* @__PURE__ */ p("a", {
|
|
491
452
|
href: e,
|
|
492
453
|
download: !0,
|
|
493
454
|
target: "_blank",
|
|
@@ -500,4 +461,4 @@ function O({ url: e, type: t, mimeType: c, alt: l, initialPage: u = 1, fileName:
|
|
|
500
461
|
});
|
|
501
462
|
}
|
|
502
463
|
//#endregion
|
|
503
|
-
export {
|
|
464
|
+
export { k as FilePreview };
|