@devalok/shilp-sutra 0.44.1 → 0.45.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/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 +153 -150
- 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/mention.js +5 -0
- package/dist/_chunks/mention.js.map +1 -0
- 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 +151 -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/rich-chat-input.d.ts.map +1 -1
- package/dist/composed/rich-chat-input.js +514 -503
- package/dist/composed/rich-chat-input.js.map +1 -1
- package/dist/composed/rich-text-editor.d.ts.map +1 -1
- package/dist/composed/rich-text-editor.js +144 -143
- package/dist/composed/rich-text-editor.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/lib/mention.d.ts +11 -0
- package/dist/ui/lib/mention.d.ts.map +1 -0
- 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/chat.md +1 -1
- 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 +8 -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 && (
|
|
39
|
+
function j() {
|
|
40
|
+
i.current && (h ? i.current.pause() : i.current.play(), g(!h));
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
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;
|
|
42
|
+
function M(e) {
|
|
43
|
+
!i.current || !x || (i.current.currentTime = e / 100 * x);
|
|
46
44
|
}
|
|
47
|
-
function
|
|
48
|
-
if (!b) return;
|
|
49
|
-
let t = e.currentTarget.getBoundingClientRect();
|
|
50
|
-
j((e.clientX - t.left) / t.width * b);
|
|
51
|
-
}
|
|
52
|
-
function F() {
|
|
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,11 @@ 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(P);
|
|
172
|
+
I.current = P;
|
|
173
|
+
let L = f.useRef(void 0);
|
|
174
|
+
f.useEffect(() => () => clearTimeout(L.current), []), f.useEffect(() => {
|
|
199
175
|
function e(e) {
|
|
200
176
|
let t = o.current;
|
|
201
177
|
if (!t || !t.contains(document.activeElement) && document.activeElement !== t) return;
|
|
@@ -203,7 +179,7 @@ function C({ url: n, onError: i }) {
|
|
|
203
179
|
if (n) switch (e.key) {
|
|
204
180
|
case " ":
|
|
205
181
|
case "k":
|
|
206
|
-
e.preventDefault(),
|
|
182
|
+
e.preventDefault(), h((e) => (e ? n.pause() : n.play(), !e));
|
|
207
183
|
break;
|
|
208
184
|
case "ArrowRight":
|
|
209
185
|
e.preventDefault(), n.currentTime = Math.min(n.duration, n.currentTime + 5);
|
|
@@ -218,65 +194,63 @@ function C({ url: n, onError: i }) {
|
|
|
218
194
|
e.preventDefault(), n.currentTime = Math.min(n.duration, n.currentTime + 10);
|
|
219
195
|
break;
|
|
220
196
|
case "m":
|
|
221
|
-
e.preventDefault(),
|
|
197
|
+
e.preventDefault(), k((e) => (n.muted = !e, !e));
|
|
222
198
|
break;
|
|
223
199
|
case "f":
|
|
224
200
|
e.preventDefault(), n.requestFullscreen?.();
|
|
225
201
|
break;
|
|
226
202
|
case ">":
|
|
227
|
-
e.preventDefault(),
|
|
203
|
+
e.preventDefault(), R(1);
|
|
228
204
|
break;
|
|
229
205
|
case "<":
|
|
230
|
-
e.preventDefault(),
|
|
206
|
+
e.preventDefault(), R(-1);
|
|
231
207
|
break;
|
|
232
208
|
}
|
|
233
209
|
}
|
|
234
210
|
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
235
211
|
}, []);
|
|
236
|
-
function I(e) {
|
|
237
|
-
let t = S.indexOf(N), n = S[Math.max(0, Math.min(S.length - 1, t + e))];
|
|
238
|
-
P(n), a.current && (a.current.playbackRate = n);
|
|
239
|
-
}
|
|
240
|
-
function L() {
|
|
241
|
-
a.current && (s ? a.current.pause() : a.current.play(), m(!s));
|
|
242
|
-
}
|
|
243
212
|
function R(e) {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
a.current.currentTime = n * C;
|
|
213
|
+
let t = C.indexOf(I.current), n = C[Math.max(0, Math.min(C.length - 1, t + e))];
|
|
214
|
+
F(n), a.current && (a.current.playbackRate = n);
|
|
247
215
|
}
|
|
248
216
|
function z() {
|
|
249
|
-
|
|
217
|
+
a.current && (s ? a.current.pause() : a.current.play(), h(!s));
|
|
250
218
|
}
|
|
251
|
-
|
|
219
|
+
function B(e) {
|
|
220
|
+
!a.current || !w || (a.current.currentTime = e / 100 * w);
|
|
221
|
+
}
|
|
222
|
+
function V() {
|
|
223
|
+
N(!0), clearTimeout(L.current), s && (L.current = setTimeout(() => N(!1), 3e3));
|
|
224
|
+
}
|
|
225
|
+
return A ? /* @__PURE__ */ p(d, {
|
|
252
226
|
message: "Could not load video",
|
|
253
227
|
url: n
|
|
254
|
-
}) : /* @__PURE__ */
|
|
228
|
+
}) : /* @__PURE__ */ m("div", {
|
|
255
229
|
ref: o,
|
|
256
230
|
className: "group relative rounded-control bg-black overflow-hidden",
|
|
257
|
-
onMouseMove:
|
|
258
|
-
onMouseLeave: () => s &&
|
|
231
|
+
onMouseMove: V,
|
|
232
|
+
onMouseLeave: () => s && N(!1),
|
|
259
233
|
tabIndex: -1,
|
|
260
234
|
children: [
|
|
261
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ p("video", {
|
|
262
236
|
ref: a,
|
|
263
237
|
src: n,
|
|
264
238
|
className: "max-h-[70vh] w-full",
|
|
265
|
-
onClick:
|
|
266
|
-
muted:
|
|
239
|
+
onClick: z,
|
|
240
|
+
muted: O,
|
|
267
241
|
onTimeUpdate: () => {
|
|
268
|
-
a.current && (
|
|
242
|
+
a.current && (D(a.current.currentTime), a.current.duration && S(a.current.currentTime / a.current.duration * 100));
|
|
269
243
|
},
|
|
270
|
-
onLoadedMetadata: () =>
|
|
244
|
+
onLoadedMetadata: () => T(a.current?.duration ?? 0),
|
|
271
245
|
onEnded: () => {
|
|
272
|
-
|
|
246
|
+
h(!1), N(!0);
|
|
273
247
|
},
|
|
274
248
|
onError: () => {
|
|
275
|
-
|
|
249
|
+
j(!0), i?.("Video failed to load");
|
|
276
250
|
},
|
|
277
251
|
playsInline: !0
|
|
278
252
|
}),
|
|
279
|
-
!s && /* @__PURE__ */
|
|
253
|
+
!s && /* @__PURE__ */ p(b.button, {
|
|
280
254
|
initial: {
|
|
281
255
|
opacity: 0,
|
|
282
256
|
scale: .8
|
|
@@ -286,19 +260,19 @@ function C({ url: n, onError: i }) {
|
|
|
286
260
|
scale: 1
|
|
287
261
|
},
|
|
288
262
|
transition: e.snappy,
|
|
289
|
-
onClick:
|
|
263
|
+
onClick: z,
|
|
290
264
|
className: "absolute inset-0 flex items-center justify-center bg-black/30",
|
|
291
265
|
"aria-label": "Play video",
|
|
292
|
-
children: /* @__PURE__ */
|
|
266
|
+
children: /* @__PURE__ */ p("div", {
|
|
293
267
|
className: "flex h-14 w-14 items-center justify-center rounded-pill bg-white/90 shadow-floating",
|
|
294
|
-
children: /* @__PURE__ */
|
|
295
|
-
icon:
|
|
268
|
+
children: /* @__PURE__ */ p(r, {
|
|
269
|
+
icon: v,
|
|
296
270
|
size: "xl",
|
|
297
271
|
className: "text-surface-fg ml-0.5"
|
|
298
272
|
})
|
|
299
273
|
})
|
|
300
274
|
}),
|
|
301
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ p(y, { children: M && w > 0 && /* @__PURE__ */ m(b.div, {
|
|
302
276
|
initial: {
|
|
303
277
|
opacity: 0,
|
|
304
278
|
y: 10
|
|
@@ -313,74 +287,63 @@ function C({ url: n, onError: i }) {
|
|
|
313
287
|
},
|
|
314
288
|
transition: t.fade,
|
|
315
289
|
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", {
|
|
290
|
+
children: [/* @__PURE__ */ p(l, {
|
|
291
|
+
className: "mb-ds-03",
|
|
292
|
+
value: x,
|
|
293
|
+
max: 100,
|
|
294
|
+
step: .1,
|
|
295
|
+
onValueChange: B,
|
|
296
|
+
tone: "dark",
|
|
297
|
+
ariaLabel: "Video progress"
|
|
298
|
+
}), /* @__PURE__ */ m("div", {
|
|
336
299
|
className: "flex items-center gap-ds-03",
|
|
337
300
|
children: [
|
|
338
|
-
/* @__PURE__ */
|
|
339
|
-
onClick:
|
|
301
|
+
/* @__PURE__ */ p("button", {
|
|
302
|
+
onClick: z,
|
|
340
303
|
className: "text-white hover:text-white/80",
|
|
341
304
|
"aria-label": s ? "Pause" : "Play",
|
|
342
305
|
title: s ? "Pause" : "Play",
|
|
343
|
-
children: s ? /* @__PURE__ */
|
|
344
|
-
icon: g,
|
|
345
|
-
size: "lg"
|
|
346
|
-
}) : /* @__PURE__ */ f(r, {
|
|
306
|
+
children: s ? /* @__PURE__ */ p(r, {
|
|
347
307
|
icon: _,
|
|
348
308
|
size: "lg"
|
|
309
|
+
}) : /* @__PURE__ */ p(r, {
|
|
310
|
+
icon: v,
|
|
311
|
+
size: "lg"
|
|
349
312
|
})
|
|
350
313
|
}),
|
|
351
|
-
/* @__PURE__ */
|
|
352
|
-
volume: +!
|
|
353
|
-
muted:
|
|
314
|
+
/* @__PURE__ */ p(c, {
|
|
315
|
+
volume: +!O,
|
|
316
|
+
muted: O,
|
|
354
317
|
onVolumeChange: (e) => {
|
|
355
|
-
a.current && (a.current.volume = e), e > 0 &&
|
|
318
|
+
a.current && (a.current.volume = e), e > 0 && O && (k(!1), a.current && (a.current.muted = !1));
|
|
356
319
|
},
|
|
357
320
|
onMuteToggle: () => {
|
|
358
|
-
|
|
321
|
+
k(!O), a.current && (a.current.muted = !O);
|
|
359
322
|
},
|
|
360
323
|
variant: "dark"
|
|
361
324
|
}),
|
|
362
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ m("span", {
|
|
363
326
|
className: "text-[11px] font-mono text-white/70 tabular-nums",
|
|
364
327
|
children: [
|
|
365
|
-
|
|
328
|
+
u(E),
|
|
366
329
|
" / ",
|
|
367
|
-
|
|
330
|
+
u(w)
|
|
368
331
|
]
|
|
369
332
|
}),
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
-
/* @__PURE__ */
|
|
372
|
-
onClick: () =>
|
|
333
|
+
/* @__PURE__ */ p("div", { className: "flex-1" }),
|
|
334
|
+
/* @__PURE__ */ m("button", {
|
|
335
|
+
onClick: () => R(1),
|
|
373
336
|
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: [
|
|
337
|
+
"aria-label": `Playback speed: ${P}x`,
|
|
338
|
+
children: [P, "x"]
|
|
376
339
|
}),
|
|
377
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ p("button", {
|
|
378
341
|
onClick: () => a.current?.requestFullscreen?.(),
|
|
379
342
|
className: "text-white hover:text-white/80",
|
|
380
343
|
"aria-label": "Fullscreen (F)",
|
|
381
344
|
title: "Fullscreen",
|
|
382
|
-
children: /* @__PURE__ */
|
|
383
|
-
icon:
|
|
345
|
+
children: /* @__PURE__ */ p(r, {
|
|
346
|
+
icon: g,
|
|
384
347
|
size: "sm"
|
|
385
348
|
})
|
|
386
349
|
})
|
|
@@ -392,8 +355,8 @@ function C({ url: n, onError: i }) {
|
|
|
392
355
|
}
|
|
393
356
|
//#endregion
|
|
394
357
|
//#region src/composed/file-preview.tsx
|
|
395
|
-
var
|
|
396
|
-
function
|
|
358
|
+
var T = f.lazy(() => import("../_chunks/image-preview.js")), E = f.lazy(() => import("../_chunks/document-preview.js"));
|
|
359
|
+
function D(e, t) {
|
|
397
360
|
if (t) {
|
|
398
361
|
if (t.startsWith("image/")) return "image";
|
|
399
362
|
if (t === "application/pdf") return "pdf";
|
|
@@ -423,7 +386,7 @@ function E(e, t) {
|
|
|
423
386
|
"flac"
|
|
424
387
|
].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
388
|
}
|
|
426
|
-
function
|
|
389
|
+
function O(e) {
|
|
427
390
|
let t = e.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&?]+)/);
|
|
428
391
|
if (t) return `https://www.youtube.com/embed/${t[1]}`;
|
|
429
392
|
let n = e.match(/vimeo\.com\/(\d+)/);
|
|
@@ -432,62 +395,62 @@ function D(e) {
|
|
|
432
395
|
let r = e.match(/loom\.com\/share\/([^?]+)/);
|
|
433
396
|
return r ? `https://www.loom.com/embed/${r[1]}` : e;
|
|
434
397
|
}
|
|
435
|
-
function
|
|
436
|
-
let
|
|
437
|
-
return /* @__PURE__ */
|
|
398
|
+
function k({ url: e, type: t, mimeType: c, alt: l, initialPage: u = 1, fileName: d, fileSize: g, onError: _, className: v, ...y }) {
|
|
399
|
+
let b = t ?? D(e, c), C = /* @__PURE__ */ p(o, { className: "h-64 w-full rounded-control" });
|
|
400
|
+
return /* @__PURE__ */ m("div", {
|
|
438
401
|
className: n("flex flex-col gap-ds-03", v),
|
|
439
402
|
...y,
|
|
440
403
|
children: [
|
|
441
|
-
(
|
|
404
|
+
(d || g) && /* @__PURE__ */ m("div", {
|
|
442
405
|
className: "flex items-center gap-ds-03",
|
|
443
|
-
children: [
|
|
406
|
+
children: [d && /* @__PURE__ */ p(s, {
|
|
444
407
|
mode: "middle",
|
|
445
408
|
className: "min-w-0 text-ds-sm font-semibold text-surface-fg",
|
|
446
|
-
children:
|
|
447
|
-
}), g && /* @__PURE__ */
|
|
409
|
+
children: d
|
|
410
|
+
}), g && /* @__PURE__ */ p(i, {
|
|
448
411
|
variant: "subtle",
|
|
449
412
|
size: "xs",
|
|
450
413
|
children: g
|
|
451
414
|
})]
|
|
452
415
|
}),
|
|
453
|
-
|
|
454
|
-
fallback:
|
|
455
|
-
children: /* @__PURE__ */
|
|
416
|
+
b === "image" && /* @__PURE__ */ p(f.Suspense, {
|
|
417
|
+
fallback: C,
|
|
418
|
+
children: /* @__PURE__ */ p(T, {
|
|
456
419
|
url: e,
|
|
457
420
|
alt: l,
|
|
458
421
|
onError: _
|
|
459
422
|
})
|
|
460
423
|
}),
|
|
461
|
-
|
|
462
|
-
fallback:
|
|
463
|
-
children: /* @__PURE__ */
|
|
424
|
+
b === "pdf" && /* @__PURE__ */ p(f.Suspense, {
|
|
425
|
+
fallback: C,
|
|
426
|
+
children: /* @__PURE__ */ p(E, {
|
|
464
427
|
url: e,
|
|
465
428
|
initialPage: u,
|
|
466
429
|
onError: _
|
|
467
430
|
})
|
|
468
431
|
}),
|
|
469
|
-
|
|
432
|
+
b === "video" && /* @__PURE__ */ p(w, {
|
|
470
433
|
url: e,
|
|
471
434
|
onError: _
|
|
472
435
|
}),
|
|
473
|
-
|
|
436
|
+
b === "audio" && /* @__PURE__ */ p(x, {
|
|
474
437
|
url: e,
|
|
475
|
-
fileName:
|
|
438
|
+
fileName: d,
|
|
476
439
|
onError: _
|
|
477
440
|
}),
|
|
478
|
-
|
|
441
|
+
b === "embed" && /* @__PURE__ */ p(S, {
|
|
479
442
|
url: e,
|
|
480
|
-
embedUrl:
|
|
443
|
+
embedUrl: O(e),
|
|
481
444
|
onError: _
|
|
482
445
|
}),
|
|
483
|
-
|
|
446
|
+
b !== "audio" && /* @__PURE__ */ p("div", {
|
|
484
447
|
className: "flex justify-end",
|
|
485
|
-
children: /* @__PURE__ */
|
|
448
|
+
children: /* @__PURE__ */ p(a, {
|
|
486
449
|
variant: "ghost",
|
|
487
450
|
size: "xs",
|
|
488
|
-
startIcon: /* @__PURE__ */
|
|
451
|
+
startIcon: /* @__PURE__ */ p(r, { icon: h }),
|
|
489
452
|
asChild: !0,
|
|
490
|
-
children: /* @__PURE__ */
|
|
453
|
+
children: /* @__PURE__ */ p("a", {
|
|
491
454
|
href: e,
|
|
492
455
|
download: !0,
|
|
493
456
|
target: "_blank",
|
|
@@ -500,4 +463,4 @@ function O({ url: e, type: t, mimeType: c, alt: l, initialPage: u = 1, fileName:
|
|
|
500
463
|
});
|
|
501
464
|
}
|
|
502
465
|
//#endregion
|
|
503
|
-
export {
|
|
466
|
+
export { k as FilePreview };
|