@ai-matrx/capture 0.4.0 → 0.4.3
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/CHANGELOG.md +13 -0
- package/dist/index.d.cts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/react.cjs +417 -263
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +11 -10
- package/dist/react.d.ts +11 -10
- package/dist/react.js +417 -283
- package/dist/react.js.map +1 -1
- package/package.json +1 -2
package/dist/react.cjs
CHANGED
|
@@ -48,7 +48,158 @@ module.exports = __toCommonJS(react_exports);
|
|
|
48
48
|
|
|
49
49
|
// src/components/CameraCapture.tsx
|
|
50
50
|
var import_react5 = require("react");
|
|
51
|
-
|
|
51
|
+
|
|
52
|
+
// src/components/icons.tsx
|
|
53
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
54
|
+
function svgProps(props) {
|
|
55
|
+
return {
|
|
56
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
57
|
+
viewBox: "0 0 24 24",
|
|
58
|
+
width: 24,
|
|
59
|
+
height: 24,
|
|
60
|
+
fill: "none",
|
|
61
|
+
stroke: "currentColor",
|
|
62
|
+
strokeWidth: 2,
|
|
63
|
+
strokeLinecap: "round",
|
|
64
|
+
strokeLinejoin: "round",
|
|
65
|
+
"aria-hidden": true,
|
|
66
|
+
...props
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function CheckIcon(props) {
|
|
70
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { ...svgProps(props), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M20 6 9 17l-5-5" }) });
|
|
71
|
+
}
|
|
72
|
+
function ChevronLeftIcon(props) {
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { ...svgProps(props), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m15 18-6-6 6-6" }) });
|
|
74
|
+
}
|
|
75
|
+
function ChevronRightIcon(props) {
|
|
76
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { ...svgProps(props), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m9 18 6-6-6-6" }) });
|
|
77
|
+
}
|
|
78
|
+
function FlipHorizontal2Icon(props) {
|
|
79
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { ...svgProps(props), children: [
|
|
80
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m3 7 5 5-5 5V7" }),
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m21 7-5 5 5 5V7" }),
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 20v2" }),
|
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 14v2" }),
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 8v2" }),
|
|
85
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 2v2" })
|
|
86
|
+
] });
|
|
87
|
+
}
|
|
88
|
+
function Grid3x3Icon(props) {
|
|
89
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { ...svgProps(props), children: [
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
|
|
91
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 9h18" }),
|
|
92
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 15h18" }),
|
|
93
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9 3v18" }),
|
|
94
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M15 3v18" })
|
|
95
|
+
] });
|
|
96
|
+
}
|
|
97
|
+
function GripIcon(props) {
|
|
98
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { ...svgProps(props), children: [
|
|
99
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "5", r: "1" }),
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "19", cy: "5", r: "1" }),
|
|
101
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "5", cy: "5", r: "1" }),
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "12", r: "1" }),
|
|
103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "19", cy: "12", r: "1" }),
|
|
104
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "5", cy: "12", r: "1" }),
|
|
105
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "19", r: "1" }),
|
|
106
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "19", cy: "19", r: "1" }),
|
|
107
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "5", cy: "19", r: "1" })
|
|
108
|
+
] });
|
|
109
|
+
}
|
|
110
|
+
function ImagesIcon(props) {
|
|
111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { ...svgProps(props), children: [
|
|
112
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16" }),
|
|
113
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2" }),
|
|
114
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "13", cy: "7", r: "1", fill: "currentColor" }),
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { x: "8", y: "2", width: "14", height: "14", rx: "2" })
|
|
116
|
+
] });
|
|
117
|
+
}
|
|
118
|
+
function Loader2Icon(props) {
|
|
119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { ...svgProps(props), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) });
|
|
120
|
+
}
|
|
121
|
+
function LockIcon(props) {
|
|
122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { ...svgProps(props), children: [
|
|
123
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }),
|
|
124
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
|
|
125
|
+
] });
|
|
126
|
+
}
|
|
127
|
+
function PencilIcon(props) {
|
|
128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { ...svgProps(props), children: [
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }),
|
|
130
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m15 5 4 4" })
|
|
131
|
+
] });
|
|
132
|
+
}
|
|
133
|
+
function PlayIcon(props) {
|
|
134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { ...svgProps(props), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z" }) });
|
|
135
|
+
}
|
|
136
|
+
function ProportionsIcon(props) {
|
|
137
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { ...svgProps(props), children: [
|
|
138
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", { width: "20", height: "16", x: "2", y: "4", rx: "2" }),
|
|
139
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 9v11" }),
|
|
140
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M2 9h13a2 2 0 0 1 2 2v9" })
|
|
141
|
+
] });
|
|
142
|
+
}
|
|
143
|
+
function RefreshCwIcon(props) {
|
|
144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { ...svgProps(props), children: [
|
|
145
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
|
|
146
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M21 3v5h-5" }),
|
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
|
|
148
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 16H3v5" })
|
|
149
|
+
] });
|
|
150
|
+
}
|
|
151
|
+
function RotateCcwIcon(props) {
|
|
152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { ...svgProps(props), children: [
|
|
153
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 3v5h5" })
|
|
155
|
+
] });
|
|
156
|
+
}
|
|
157
|
+
function SunMediumIcon(props) {
|
|
158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { ...svgProps(props), children: [
|
|
159
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "12", r: "4" }),
|
|
160
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 3v1" }),
|
|
161
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 20v1" }),
|
|
162
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 12h1" }),
|
|
163
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M20 12h1" }),
|
|
164
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m18.364 5.636-.707.707" }),
|
|
165
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m6.343 17.657-.707.707" }),
|
|
166
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m5.636 5.636.707.707" }),
|
|
167
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m17.657 17.657.707.707" })
|
|
168
|
+
] });
|
|
169
|
+
}
|
|
170
|
+
function TimerIcon(props) {
|
|
171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { ...svgProps(props), children: [
|
|
172
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "10", x2: "14", y1: "2", y2: "2" }),
|
|
173
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("line", { x1: "12", x2: "15", y1: "14", y2: "11" }),
|
|
174
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("circle", { cx: "12", cy: "14", r: "8" })
|
|
175
|
+
] });
|
|
176
|
+
}
|
|
177
|
+
function Trash2Icon(props) {
|
|
178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { ...svgProps(props), children: [
|
|
179
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10 11v6" }),
|
|
180
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M14 11v6" }),
|
|
181
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" }),
|
|
182
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3 6h18" }),
|
|
183
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" })
|
|
184
|
+
] });
|
|
185
|
+
}
|
|
186
|
+
function XIcon(props) {
|
|
187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { ...svgProps(props), children: [
|
|
188
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M18 6 6 18" }),
|
|
189
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m6 6 12 12" })
|
|
190
|
+
] });
|
|
191
|
+
}
|
|
192
|
+
function ZapIcon(props) {
|
|
193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", { ...svgProps(props), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z" }) });
|
|
194
|
+
}
|
|
195
|
+
function ZapOffIcon(props) {
|
|
196
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", { ...svgProps(props), children: [
|
|
197
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317" }),
|
|
198
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773" }),
|
|
199
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643" }),
|
|
200
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "m2 2 20 20" })
|
|
201
|
+
] });
|
|
202
|
+
}
|
|
52
203
|
|
|
53
204
|
// src/cn.ts
|
|
54
205
|
var import_tailwind_merge = require("tailwind-merge");
|
|
@@ -181,14 +332,14 @@ function useTrackControls(stream) {
|
|
|
181
332
|
}
|
|
182
333
|
|
|
183
334
|
// src/components/ShutterButton.tsx
|
|
184
|
-
var
|
|
335
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
185
336
|
function ShutterButton({
|
|
186
337
|
mode,
|
|
187
338
|
recording,
|
|
188
339
|
disabled = false,
|
|
189
340
|
onPress
|
|
190
341
|
}) {
|
|
191
|
-
return /* @__PURE__ */ (0,
|
|
342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
192
343
|
"button",
|
|
193
344
|
{
|
|
194
345
|
type: "button",
|
|
@@ -200,7 +351,7 @@ function ShutterButton({
|
|
|
200
351
|
"border-[3.5px] border-white transition-opacity",
|
|
201
352
|
disabled && "opacity-30"
|
|
202
353
|
),
|
|
203
|
-
children: /* @__PURE__ */ (0,
|
|
354
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
204
355
|
"span",
|
|
205
356
|
{
|
|
206
357
|
className: cn(
|
|
@@ -214,7 +365,7 @@ function ShutterButton({
|
|
|
214
365
|
}
|
|
215
366
|
|
|
216
367
|
// src/components/ModeSelector.tsx
|
|
217
|
-
var
|
|
368
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
218
369
|
var SPRING_EASING = "linear(0, 0.0047 0.71%, 0.0189 1.44%, 0.0755 2.93%, 0.1692 4.49%, 0.3921 7.55%, 0.8121 12.94%, 0.9804 15.49%, 1.0946 18.14%, 1.1423 20.16%, 1.1568 21.62%, 1.1541 23.03%, 1.1113 26.4%, 1.0322 31.83%, 0.9902 36.25%, 0.9769 40.24%, 0.9844 45.87%, 1.0028 55.35%, 1.0075 63.42%, 1.0006 85.48%, 1)";
|
|
219
370
|
var LABEL_BASE = "relative z-10 flex h-8 min-w-0 touch-manipulation items-center justify-center rounded-full px-3 text-[11px] font-semibold uppercase tracking-[0.12em] transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/70 disabled:opacity-40";
|
|
220
371
|
function ModeSelector({
|
|
@@ -227,7 +378,7 @@ function ModeSelector({
|
|
|
227
378
|
}) {
|
|
228
379
|
const segments = 3 + extraModes.length;
|
|
229
380
|
const activeIndex = mode === "video" ? 0 : 1;
|
|
230
|
-
return /* @__PURE__ */ (0,
|
|
381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
231
382
|
"div",
|
|
232
383
|
{
|
|
233
384
|
role: "tablist",
|
|
@@ -235,7 +386,7 @@ function ModeSelector({
|
|
|
235
386
|
className: "relative inline-grid rounded-full bg-white/10 p-1",
|
|
236
387
|
style: { gridTemplateColumns: `repeat(${segments}, minmax(0, 1fr))` },
|
|
237
388
|
children: [
|
|
238
|
-
/* @__PURE__ */ (0,
|
|
389
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
239
390
|
"div",
|
|
240
391
|
{
|
|
241
392
|
"aria-hidden": true,
|
|
@@ -247,7 +398,7 @@ function ModeSelector({
|
|
|
247
398
|
}
|
|
248
399
|
}
|
|
249
400
|
),
|
|
250
|
-
/* @__PURE__ */ (0,
|
|
401
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
251
402
|
"button",
|
|
252
403
|
{
|
|
253
404
|
type: "button",
|
|
@@ -262,7 +413,7 @@ function ModeSelector({
|
|
|
262
413
|
children: "Video"
|
|
263
414
|
}
|
|
264
415
|
),
|
|
265
|
-
/* @__PURE__ */ (0,
|
|
416
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
266
417
|
"button",
|
|
267
418
|
{
|
|
268
419
|
type: "button",
|
|
@@ -277,7 +428,7 @@ function ModeSelector({
|
|
|
277
428
|
children: "Photo"
|
|
278
429
|
}
|
|
279
430
|
),
|
|
280
|
-
/* @__PURE__ */ (0,
|
|
431
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
281
432
|
"button",
|
|
282
433
|
{
|
|
283
434
|
type: "button",
|
|
@@ -288,7 +439,7 @@ function ModeSelector({
|
|
|
288
439
|
children: "Upload"
|
|
289
440
|
}
|
|
290
441
|
),
|
|
291
|
-
extraModes.map((extra) => /* @__PURE__ */ (0,
|
|
442
|
+
extraModes.map((extra) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
292
443
|
"button",
|
|
293
444
|
{
|
|
294
445
|
type: "button",
|
|
@@ -306,7 +457,7 @@ function ModeSelector({
|
|
|
306
457
|
}
|
|
307
458
|
|
|
308
459
|
// src/components/ZoomRow.tsx
|
|
309
|
-
var
|
|
460
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
310
461
|
function formatFactor(factor) {
|
|
311
462
|
return factor < 1 ? `.${String(Math.round(factor * 10))}` : String(Math.round(factor * 10) / 10);
|
|
312
463
|
}
|
|
@@ -315,9 +466,9 @@ function ZoomRow({ options, value, onSelect }) {
|
|
|
315
466
|
const active = options.reduce(
|
|
316
467
|
(best, opt) => Math.abs(opt - value) < Math.abs(best - value) ? opt : best
|
|
317
468
|
);
|
|
318
|
-
return /* @__PURE__ */ (0,
|
|
469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "flex items-center justify-center gap-3", children: options.map((opt) => {
|
|
319
470
|
const isActive = opt === active;
|
|
320
|
-
return /* @__PURE__ */ (0,
|
|
471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
321
472
|
"button",
|
|
322
473
|
{
|
|
323
474
|
type: "button",
|
|
@@ -330,7 +481,7 @@ function ZoomRow({ options, value, onSelect }) {
|
|
|
330
481
|
),
|
|
331
482
|
children: [
|
|
332
483
|
formatFactor(opt),
|
|
333
|
-
isActive && /* @__PURE__ */ (0,
|
|
484
|
+
isActive && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-[10px]", children: "\xD7" })
|
|
334
485
|
]
|
|
335
486
|
},
|
|
336
487
|
opt
|
|
@@ -339,15 +490,15 @@ function ZoomRow({ options, value, onSelect }) {
|
|
|
339
490
|
}
|
|
340
491
|
|
|
341
492
|
// src/components/OptionsGridPanel.tsx
|
|
342
|
-
var
|
|
493
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
343
494
|
function OptionsGridPanel({
|
|
344
495
|
open,
|
|
345
496
|
onClose,
|
|
346
497
|
tiles
|
|
347
498
|
}) {
|
|
348
499
|
if (!open) return null;
|
|
349
|
-
return /* @__PURE__ */ (0,
|
|
350
|
-
/* @__PURE__ */ (0,
|
|
500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "absolute inset-0 z-40", children: [
|
|
501
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
351
502
|
"button",
|
|
352
503
|
{
|
|
353
504
|
type: "button",
|
|
@@ -356,13 +507,13 @@ function OptionsGridPanel({
|
|
|
356
507
|
className: "absolute inset-0 bg-black/70"
|
|
357
508
|
}
|
|
358
509
|
),
|
|
359
|
-
/* @__PURE__ */ (0,
|
|
510
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
360
511
|
"div",
|
|
361
512
|
{
|
|
362
513
|
className: "absolute inset-x-3 bottom-3 rounded-[2.5rem] bg-[#3a3a3c]/95 px-6 py-8 shadow-2xl",
|
|
363
514
|
style: { marginBottom: "env(safe-area-inset-bottom, 0px)" },
|
|
364
|
-
children: /* @__PURE__ */ (0,
|
|
365
|
-
/* @__PURE__ */ (0,
|
|
515
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "grid grid-cols-3 gap-x-4 gap-y-7", children: tiles.map((tile) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col items-center gap-2.5", children: [
|
|
516
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
366
517
|
"button",
|
|
367
518
|
{
|
|
368
519
|
type: "button",
|
|
@@ -378,7 +529,7 @@ function OptionsGridPanel({
|
|
|
378
529
|
children: tile.icon
|
|
379
530
|
}
|
|
380
531
|
),
|
|
381
|
-
/* @__PURE__ */ (0,
|
|
532
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-[13px] font-semibold uppercase tracking-[0.14em] text-white", children: tile.valueLabel ? `${tile.label} ${tile.valueLabel}` : tile.label })
|
|
382
533
|
] }, tile.id)) })
|
|
383
534
|
}
|
|
384
535
|
)
|
|
@@ -386,8 +537,7 @@ function OptionsGridPanel({
|
|
|
386
537
|
}
|
|
387
538
|
|
|
388
539
|
// src/components/CaptureSheet.tsx
|
|
389
|
-
var
|
|
390
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
540
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
391
541
|
function CaptureSheet({
|
|
392
542
|
open,
|
|
393
543
|
onClose,
|
|
@@ -399,8 +549,8 @@ function CaptureSheet({
|
|
|
399
549
|
busyLabel = "Working\u2026"
|
|
400
550
|
}) {
|
|
401
551
|
if (!open) return null;
|
|
402
|
-
return /* @__PURE__ */ (0,
|
|
403
|
-
/* @__PURE__ */ (0,
|
|
552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "absolute inset-0 z-50 flex flex-col justify-end", children: [
|
|
553
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
404
554
|
"button",
|
|
405
555
|
{
|
|
406
556
|
type: "button",
|
|
@@ -409,30 +559,30 @@ function CaptureSheet({
|
|
|
409
559
|
className: "absolute inset-0 bg-black/30"
|
|
410
560
|
}
|
|
411
561
|
),
|
|
412
|
-
/* @__PURE__ */ (0,
|
|
562
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
413
563
|
"div",
|
|
414
564
|
{
|
|
415
565
|
className: "relative mx-2 mb-2 rounded-[2rem] bg-[#f2f2f7] px-6 pb-6 pt-5 text-black shadow-2xl",
|
|
416
566
|
style: { marginBottom: "calc(0.5rem + env(safe-area-inset-bottom, 0px))" },
|
|
417
567
|
children: [
|
|
418
|
-
/* @__PURE__ */ (0,
|
|
568
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
419
569
|
"button",
|
|
420
570
|
{
|
|
421
571
|
type: "button",
|
|
422
572
|
onClick: onClose,
|
|
423
573
|
"aria-label": "Close",
|
|
424
574
|
className: "absolute right-4 top-4 flex h-9 w-9 items-center justify-center rounded-full bg-black/5 text-black/70 transition-colors hover:bg-black/10",
|
|
425
|
-
children: /* @__PURE__ */ (0,
|
|
575
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(XIcon, { className: "h-5 w-5", strokeWidth: 2.5 })
|
|
426
576
|
}
|
|
427
577
|
),
|
|
428
|
-
variant === "busy" ? /* @__PURE__ */ (0,
|
|
429
|
-
/* @__PURE__ */ (0,
|
|
430
|
-
/* @__PURE__ */ (0,
|
|
431
|
-
] }) : /* @__PURE__ */ (0,
|
|
432
|
-
icon && /* @__PURE__ */ (0,
|
|
433
|
-
title && /* @__PURE__ */ (0,
|
|
434
|
-
body && /* @__PURE__ */ (0,
|
|
435
|
-
actions.length > 0 && /* @__PURE__ */ (0,
|
|
578
|
+
variant === "busy" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex min-h-[220px] items-center justify-center gap-2.5", children: [
|
|
579
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Loader2Icon, { className: "h-5 w-5 animate-spin text-black/50" }),
|
|
580
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-[17px] font-medium text-black/80", children: busyLabel })
|
|
581
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "pt-4", children: [
|
|
582
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "mb-5 text-[#0a84ff]", children: icon }),
|
|
583
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h2", { className: "mb-2 text-[26px] font-bold leading-tight", children: title }),
|
|
584
|
+
body && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "text-[17px] leading-snug text-black/85", children: body }),
|
|
585
|
+
actions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "mt-7 flex flex-col gap-3", children: actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
436
586
|
"button",
|
|
437
587
|
{
|
|
438
588
|
type: "button",
|
|
@@ -453,22 +603,22 @@ function CaptureSheet({
|
|
|
453
603
|
}
|
|
454
604
|
|
|
455
605
|
// src/components/GridOverlay.tsx
|
|
456
|
-
var
|
|
606
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
457
607
|
function GridOverlay({ visible }) {
|
|
458
608
|
if (!visible) return null;
|
|
459
|
-
return /* @__PURE__ */ (0,
|
|
460
|
-
/* @__PURE__ */ (0,
|
|
461
|
-
/* @__PURE__ */ (0,
|
|
462
|
-
/* @__PURE__ */ (0,
|
|
463
|
-
/* @__PURE__ */ (0,
|
|
609
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { "aria-hidden": true, className: "pointer-events-none absolute inset-0 z-10", children: [
|
|
610
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "absolute inset-y-0 left-1/3 w-px bg-white/40" }),
|
|
611
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "absolute inset-y-0 left-2/3 w-px bg-white/40" }),
|
|
612
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "absolute inset-x-0 top-1/3 h-px bg-white/40" }),
|
|
613
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "absolute inset-x-0 top-2/3 h-px bg-white/40" })
|
|
464
614
|
] });
|
|
465
615
|
}
|
|
466
616
|
|
|
467
617
|
// src/components/CountdownOverlay.tsx
|
|
468
|
-
var
|
|
618
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
469
619
|
function CountdownOverlay({ seconds }) {
|
|
470
620
|
if (seconds === null || seconds <= 0) return null;
|
|
471
|
-
return /* @__PURE__ */ (0,
|
|
621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "pointer-events-none absolute inset-0 z-30 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
472
622
|
"span",
|
|
473
623
|
{
|
|
474
624
|
className: "text-[120px] font-light text-white drop-shadow-lg [@starting-style]:scale-125 [@starting-style]:opacity-0 transition-all duration-300",
|
|
@@ -481,35 +631,43 @@ function CountdownOverlay({ seconds }) {
|
|
|
481
631
|
// src/media/media-cache.ts
|
|
482
632
|
var import_react2 = require("react");
|
|
483
633
|
var MAX_ENTRIES = 80;
|
|
484
|
-
var
|
|
485
|
-
|
|
634
|
+
var STATE_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.capture.media-cache-state");
|
|
635
|
+
function getState() {
|
|
636
|
+
const holder = globalThis;
|
|
637
|
+
let state = holder[STATE_SLOT];
|
|
638
|
+
if (!state) {
|
|
639
|
+
state = { cache: /* @__PURE__ */ new Map(), listeners: /* @__PURE__ */ new Map() };
|
|
640
|
+
holder[STATE_SLOT] = state;
|
|
641
|
+
}
|
|
642
|
+
return state;
|
|
643
|
+
}
|
|
486
644
|
function notify(key) {
|
|
487
|
-
listeners.get(key)?.forEach((fn) => fn());
|
|
645
|
+
getState().listeners.get(key)?.forEach((fn) => fn());
|
|
488
646
|
}
|
|
489
647
|
function evictIfNeeded() {
|
|
490
|
-
while (cache.size > MAX_ENTRIES) {
|
|
491
|
-
const oldest = cache.keys().next().value;
|
|
648
|
+
while (getState().cache.size > MAX_ENTRIES) {
|
|
649
|
+
const oldest = getState().cache.keys().next().value;
|
|
492
650
|
if (oldest === void 0) return;
|
|
493
|
-
const entry = cache.get(oldest);
|
|
494
|
-
cache.delete(oldest);
|
|
651
|
+
const entry = getState().cache.get(oldest);
|
|
652
|
+
getState().cache.delete(oldest);
|
|
495
653
|
if (entry?.revoke && entry.url) URL.revokeObjectURL(entry.url);
|
|
496
654
|
}
|
|
497
655
|
}
|
|
498
656
|
function touch(key, entry) {
|
|
499
|
-
cache.delete(key);
|
|
500
|
-
cache.set(key, entry);
|
|
657
|
+
getState().cache.delete(key);
|
|
658
|
+
getState().cache.set(key, entry);
|
|
501
659
|
}
|
|
502
660
|
function getMediaUrl(item) {
|
|
503
661
|
if (item.src) return item.src;
|
|
504
662
|
if (!item.resolve) return null;
|
|
505
|
-
const existing = cache.get(item.key);
|
|
663
|
+
const existing = getState().cache.get(item.key);
|
|
506
664
|
if (existing) {
|
|
507
665
|
touch(item.key, existing);
|
|
508
666
|
if (existing.url || existing.error) return existing.url;
|
|
509
667
|
return null;
|
|
510
668
|
}
|
|
511
669
|
const entry = { url: null, revoke: false, promise: null, error: false };
|
|
512
|
-
cache.set(item.key, entry);
|
|
670
|
+
getState().cache.set(item.key, entry);
|
|
513
671
|
evictIfNeeded();
|
|
514
672
|
entry.promise = item.resolve().then((resolved) => {
|
|
515
673
|
const url = typeof resolved === "string" ? resolved : resolved.url;
|
|
@@ -527,8 +685,8 @@ function getMediaUrl(item) {
|
|
|
527
685
|
return null;
|
|
528
686
|
}
|
|
529
687
|
function invalidateMedia(key) {
|
|
530
|
-
const entry = cache.get(key);
|
|
531
|
-
cache.delete(key);
|
|
688
|
+
const entry = getState().cache.get(key);
|
|
689
|
+
getState().cache.delete(key);
|
|
532
690
|
if (entry?.revoke && entry.url) URL.revokeObjectURL(entry.url);
|
|
533
691
|
notify(key);
|
|
534
692
|
}
|
|
@@ -537,13 +695,13 @@ function useMediaUrl(item) {
|
|
|
537
695
|
const key = item?.key ?? null;
|
|
538
696
|
(0, import_react2.useEffect)(() => {
|
|
539
697
|
if (!key) return;
|
|
540
|
-
const set = listeners.get(key) ?? /* @__PURE__ */ new Set();
|
|
698
|
+
const set = getState().listeners.get(key) ?? /* @__PURE__ */ new Set();
|
|
541
699
|
const fn = () => bump((n) => n + 1);
|
|
542
700
|
set.add(fn);
|
|
543
|
-
listeners.set(key, set);
|
|
701
|
+
getState().listeners.set(key, set);
|
|
544
702
|
return () => {
|
|
545
703
|
set.delete(fn);
|
|
546
|
-
if (set.size === 0) listeners.delete(key);
|
|
704
|
+
if (set.size === 0) getState().listeners.delete(key);
|
|
547
705
|
};
|
|
548
706
|
}, [key]);
|
|
549
707
|
if (!item) return null;
|
|
@@ -556,14 +714,14 @@ function primeMedia(items) {
|
|
|
556
714
|
}
|
|
557
715
|
|
|
558
716
|
// src/components/CaptureFilmstrip.tsx
|
|
559
|
-
var
|
|
717
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
560
718
|
function CaptureFilmstrip({
|
|
561
719
|
items,
|
|
562
720
|
onOpen,
|
|
563
721
|
limit = 12
|
|
564
722
|
}) {
|
|
565
723
|
if (items.length === 0) return null;
|
|
566
|
-
return /* @__PURE__ */ (0,
|
|
724
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex items-center gap-1.5 overflow-x-auto py-1", children: items.slice(-limit).map((item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
567
725
|
"button",
|
|
568
726
|
{
|
|
569
727
|
type: "button",
|
|
@@ -574,9 +732,9 @@ function CaptureFilmstrip({
|
|
|
574
732
|
item.accent && "ring-2 ring-inset ring-amber-400"
|
|
575
733
|
),
|
|
576
734
|
children: [
|
|
577
|
-
/* @__PURE__ */ (0,
|
|
578
|
-
item.status === "uploading" && /* @__PURE__ */ (0,
|
|
579
|
-
item.status === "error" && /* @__PURE__ */ (0,
|
|
735
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FilmstripThumb, { item }),
|
|
736
|
+
item.status === "uploading" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "absolute inset-0 flex items-center justify-center bg-black/40", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "h-3.5 w-3.5 animate-spin rounded-full border-2 border-white/40 border-t-white" }) }),
|
|
737
|
+
item.status === "error" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "absolute inset-0 rounded ring-2 ring-inset ring-red-500" })
|
|
580
738
|
]
|
|
581
739
|
},
|
|
582
740
|
item.key
|
|
@@ -585,7 +743,7 @@ function CaptureFilmstrip({
|
|
|
585
743
|
function FilmstripThumb({ item }) {
|
|
586
744
|
const url = useMediaUrl(item);
|
|
587
745
|
if (item.kind === "audio") {
|
|
588
|
-
return /* @__PURE__ */ (0,
|
|
746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "flex h-full w-full items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
589
747
|
"svg",
|
|
590
748
|
{
|
|
591
749
|
viewBox: "0 0 24 24",
|
|
@@ -595,44 +753,43 @@ function FilmstripThumb({ item }) {
|
|
|
595
753
|
strokeLinecap: "round",
|
|
596
754
|
"aria-hidden": true,
|
|
597
755
|
children: [
|
|
598
|
-
/* @__PURE__ */ (0,
|
|
599
|
-
/* @__PURE__ */ (0,
|
|
600
|
-
/* @__PURE__ */ (0,
|
|
756
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 3v10" }),
|
|
757
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M8 7v4M16 7v4M4 9v1M20 9v1" }),
|
|
758
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("circle", { cx: "12", cy: "17", r: "3" })
|
|
601
759
|
]
|
|
602
760
|
}
|
|
603
761
|
) });
|
|
604
762
|
}
|
|
605
|
-
if (!url) return /* @__PURE__ */ (0,
|
|
763
|
+
if (!url) return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "block h-full w-full bg-white/5" });
|
|
606
764
|
if (item.kind === "video") {
|
|
607
|
-
return /* @__PURE__ */ (0,
|
|
608
|
-
/* @__PURE__ */ (0,
|
|
765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "relative block h-full w-full", children: [
|
|
766
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
609
767
|
"video",
|
|
610
768
|
{
|
|
611
|
-
src: url
|
|
769
|
+
src: `${url}#t=0.01`,
|
|
612
770
|
muted: true,
|
|
613
771
|
playsInline: true,
|
|
614
772
|
preload: "metadata",
|
|
615
773
|
className: "h-full w-full object-cover"
|
|
616
774
|
}
|
|
617
775
|
),
|
|
618
|
-
/* @__PURE__ */ (0,
|
|
776
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
619
777
|
"svg",
|
|
620
778
|
{
|
|
621
779
|
viewBox: "0 0 24 24",
|
|
622
780
|
className: "absolute inset-0 m-auto h-4 w-4 fill-white drop-shadow",
|
|
623
781
|
"aria-hidden": true,
|
|
624
|
-
children: /* @__PURE__ */ (0,
|
|
782
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M8 5v14l11-7z" })
|
|
625
783
|
}
|
|
626
784
|
)
|
|
627
785
|
] });
|
|
628
786
|
}
|
|
629
|
-
return /* @__PURE__ */ (0,
|
|
787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: url, alt: "", className: "h-full w-full object-cover" });
|
|
630
788
|
}
|
|
631
789
|
|
|
632
790
|
// src/components/MediaViewer.tsx
|
|
633
791
|
var import_react3 = require("react");
|
|
634
|
-
var
|
|
635
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
792
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
636
793
|
var SWIPE_TRIGGER_PX = 40;
|
|
637
794
|
var SWIPE_TRIGGER_VELOCITY = 0.25;
|
|
638
795
|
var DISMISS_TRIGGER_PX = 110;
|
|
@@ -765,55 +922,55 @@ function MediaViewer({
|
|
|
765
922
|
}, [items, clamped]);
|
|
766
923
|
if (!current) return null;
|
|
767
924
|
const canEdit = onEdit && current.kind === "photo";
|
|
768
|
-
return /* @__PURE__ */ (0,
|
|
769
|
-
/* @__PURE__ */ (0,
|
|
925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "absolute inset-0 z-40 flex flex-col bg-black", children: [
|
|
926
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
770
927
|
"div",
|
|
771
928
|
{
|
|
772
929
|
className: "absolute inset-x-0 top-0 z-20 flex items-center justify-between bg-gradient-to-b from-black/70 to-transparent p-3",
|
|
773
930
|
style: safeTop,
|
|
774
931
|
children: [
|
|
775
|
-
/* @__PURE__ */ (0,
|
|
932
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
776
933
|
"button",
|
|
777
934
|
{
|
|
778
935
|
type: "button",
|
|
779
936
|
onClick: onClose,
|
|
780
937
|
"aria-label": "Close viewer",
|
|
781
938
|
className: "flex h-10 w-10 touch-manipulation items-center justify-center rounded-full text-white transition-colors hover:bg-white/10",
|
|
782
|
-
children: /* @__PURE__ */ (0,
|
|
939
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(XIcon, { className: "h-5 w-5" })
|
|
783
940
|
}
|
|
784
941
|
),
|
|
785
|
-
/* @__PURE__ */ (0,
|
|
942
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "rounded-full bg-black/50 px-3 py-1 text-sm tabular-nums text-white/90", children: [
|
|
786
943
|
clamped + 1,
|
|
787
944
|
" / ",
|
|
788
945
|
count
|
|
789
946
|
] }),
|
|
790
|
-
/* @__PURE__ */ (0,
|
|
791
|
-
canEdit ? /* @__PURE__ */ (0,
|
|
947
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1", children: [
|
|
948
|
+
canEdit ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
792
949
|
"button",
|
|
793
950
|
{
|
|
794
951
|
type: "button",
|
|
795
952
|
onClick: () => onEdit(current),
|
|
796
953
|
"aria-label": "Edit this photo",
|
|
797
954
|
className: "flex h-10 w-10 touch-manipulation items-center justify-center rounded-full text-white transition-colors hover:bg-white/10",
|
|
798
|
-
children: /* @__PURE__ */ (0,
|
|
955
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PencilIcon, { className: "h-5 w-5" })
|
|
799
956
|
}
|
|
800
957
|
) : null,
|
|
801
|
-
onDelete ? /* @__PURE__ */ (0,
|
|
958
|
+
onDelete ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
802
959
|
"button",
|
|
803
960
|
{
|
|
804
961
|
type: "button",
|
|
805
962
|
onClick: () => setConfirmingDelete(true),
|
|
806
963
|
"aria-label": "Delete this file",
|
|
807
964
|
className: "flex h-10 w-10 touch-manipulation items-center justify-center rounded-full text-white transition-colors hover:bg-white/10",
|
|
808
|
-
children: /* @__PURE__ */ (0,
|
|
965
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Trash2Icon, { className: "h-5 w-5" })
|
|
809
966
|
}
|
|
810
|
-
) : /* @__PURE__ */ (0,
|
|
967
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "h-10 w-10", "aria-hidden": true })
|
|
811
968
|
] })
|
|
812
969
|
]
|
|
813
970
|
}
|
|
814
971
|
),
|
|
815
|
-
/* @__PURE__ */ (0,
|
|
816
|
-
/* @__PURE__ */ (0,
|
|
972
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "relative min-h-0 flex-1 overflow-hidden", children: [
|
|
973
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
817
974
|
"div",
|
|
818
975
|
{
|
|
819
976
|
className: "absolute inset-0 touch-none",
|
|
@@ -826,7 +983,7 @@ function MediaViewer({
|
|
|
826
983
|
onPointerMove,
|
|
827
984
|
onPointerUp: endDrag,
|
|
828
985
|
onPointerCancel: endDrag,
|
|
829
|
-
children: /* @__PURE__ */ (0,
|
|
986
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
830
987
|
ViewerSlide,
|
|
831
988
|
{
|
|
832
989
|
item: current,
|
|
@@ -837,36 +994,36 @@ function MediaViewer({
|
|
|
837
994
|
)
|
|
838
995
|
}
|
|
839
996
|
),
|
|
840
|
-
/* @__PURE__ */ (0,
|
|
997
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
841
998
|
"div",
|
|
842
999
|
{
|
|
843
1000
|
"aria-hidden": true,
|
|
844
1001
|
className: "pointer-events-none absolute inset-0 opacity-0",
|
|
845
|
-
children: neighborKeys.map((m) => /* @__PURE__ */ (0,
|
|
1002
|
+
children: neighborKeys.map((m) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "absolute inset-0", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ViewerSlide, { item: m, active: false }) }, m.key))
|
|
846
1003
|
}
|
|
847
1004
|
),
|
|
848
|
-
clamped > 0 && /* @__PURE__ */ (0,
|
|
1005
|
+
clamped > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
849
1006
|
"button",
|
|
850
1007
|
{
|
|
851
1008
|
type: "button",
|
|
852
1009
|
onClick: () => go(-1),
|
|
853
1010
|
"aria-label": "Previous file",
|
|
854
1011
|
className: "absolute left-2 top-1/2 z-20 hidden h-11 w-11 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60 sm:flex",
|
|
855
|
-
children: /* @__PURE__ */ (0,
|
|
1012
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChevronLeftIcon, { className: "h-6 w-6" })
|
|
856
1013
|
}
|
|
857
1014
|
),
|
|
858
|
-
clamped < count - 1 && /* @__PURE__ */ (0,
|
|
1015
|
+
clamped < count - 1 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
859
1016
|
"button",
|
|
860
1017
|
{
|
|
861
1018
|
type: "button",
|
|
862
1019
|
onClick: () => go(1),
|
|
863
1020
|
"aria-label": "Next file",
|
|
864
1021
|
className: "absolute right-2 top-1/2 z-20 hidden h-11 w-11 -translate-y-1/2 items-center justify-center rounded-full bg-black/40 text-white hover:bg-black/60 sm:flex",
|
|
865
|
-
children: /* @__PURE__ */ (0,
|
|
1022
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChevronRightIcon, { className: "h-6 w-6" })
|
|
866
1023
|
}
|
|
867
1024
|
)
|
|
868
1025
|
] }),
|
|
869
|
-
confirmingDelete && onDelete && /* @__PURE__ */ (0,
|
|
1026
|
+
confirmingDelete && onDelete && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
870
1027
|
"div",
|
|
871
1028
|
{
|
|
872
1029
|
className: "absolute inset-x-0 bottom-0 z-30 bg-black/85 px-4 pt-4 backdrop-blur-sm",
|
|
@@ -874,14 +1031,14 @@ function MediaViewer({
|
|
|
874
1031
|
paddingBottom: "calc(1rem + env(safe-area-inset-bottom, 0px))"
|
|
875
1032
|
},
|
|
876
1033
|
children: [
|
|
877
|
-
/* @__PURE__ */ (0,
|
|
1034
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { className: "pb-3 text-center text-sm text-white/85", children: [
|
|
878
1035
|
"Delete this ",
|
|
879
1036
|
current.kind === "video" ? "video" : current.kind === "audio" ? "voice note" : "photo",
|
|
880
1037
|
"? ",
|
|
881
1038
|
deleteConsequence
|
|
882
1039
|
] }),
|
|
883
|
-
/* @__PURE__ */ (0,
|
|
884
|
-
/* @__PURE__ */ (0,
|
|
1040
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center justify-center gap-3", children: [
|
|
1041
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
885
1042
|
"button",
|
|
886
1043
|
{
|
|
887
1044
|
type: "button",
|
|
@@ -890,7 +1047,7 @@ function MediaViewer({
|
|
|
890
1047
|
children: "Keep it"
|
|
891
1048
|
}
|
|
892
1049
|
),
|
|
893
|
-
/* @__PURE__ */ (0,
|
|
1050
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
894
1051
|
"button",
|
|
895
1052
|
{
|
|
896
1053
|
type: "button",
|
|
@@ -906,12 +1063,12 @@ function MediaViewer({
|
|
|
906
1063
|
]
|
|
907
1064
|
}
|
|
908
1065
|
),
|
|
909
|
-
count > 1 && count <= 12 && /* @__PURE__ */ (0,
|
|
1066
|
+
count > 1 && count <= 12 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
910
1067
|
"div",
|
|
911
1068
|
{
|
|
912
1069
|
className: "pointer-events-none absolute inset-x-0 bottom-4 z-20 flex justify-center gap-1.5",
|
|
913
1070
|
style: safeMarginBottom,
|
|
914
|
-
children: items.map((m, i) => /* @__PURE__ */ (0,
|
|
1071
|
+
children: items.map((m, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
915
1072
|
"span",
|
|
916
1073
|
{
|
|
917
1074
|
className: cn(
|
|
@@ -932,12 +1089,12 @@ function ViewerSlide({
|
|
|
932
1089
|
}) {
|
|
933
1090
|
const url = useMediaUrl(item);
|
|
934
1091
|
if (!url) {
|
|
935
|
-
return active ? /* @__PURE__ */ (0,
|
|
1092
|
+
return active ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "h-8 w-8 animate-spin rounded-full border-2 border-white/30 border-t-white" }) }) : null;
|
|
936
1093
|
}
|
|
937
1094
|
if (item.kind === "audio") {
|
|
938
1095
|
if (!active) return null;
|
|
939
|
-
return /* @__PURE__ */ (0,
|
|
940
|
-
/* @__PURE__ */ (0,
|
|
1096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "absolute inset-0 flex flex-col items-center justify-center gap-6 px-8", children: [
|
|
1097
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
941
1098
|
"svg",
|
|
942
1099
|
{
|
|
943
1100
|
viewBox: "0 0 24 24",
|
|
@@ -947,19 +1104,19 @@ function ViewerSlide({
|
|
|
947
1104
|
strokeLinecap: "round",
|
|
948
1105
|
"aria-hidden": true,
|
|
949
1106
|
children: [
|
|
950
|
-
/* @__PURE__ */ (0,
|
|
951
|
-
/* @__PURE__ */ (0,
|
|
952
|
-
/* @__PURE__ */ (0,
|
|
1107
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M12 2v12" }),
|
|
1108
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M7 6v6M17 6v6M2 9v2M22 9v2" }),
|
|
1109
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "12", cy: "19", r: "3" })
|
|
953
1110
|
]
|
|
954
1111
|
}
|
|
955
1112
|
),
|
|
956
|
-
/* @__PURE__ */ (0,
|
|
1113
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("audio", { src: url, controls: true, className: "w-full max-w-sm" })
|
|
957
1114
|
] });
|
|
958
1115
|
}
|
|
959
1116
|
if (item.kind === "video") {
|
|
960
|
-
return /* @__PURE__ */ (0,
|
|
1117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(VideoSlide, { url, active, videoRef });
|
|
961
1118
|
}
|
|
962
|
-
return /* @__PURE__ */ (0,
|
|
1119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
963
1120
|
"img",
|
|
964
1121
|
{
|
|
965
1122
|
src: url,
|
|
@@ -985,8 +1142,8 @@ function VideoSlide({
|
|
|
985
1142
|
if (videoRef.current === localRef.current) videoRef.current = null;
|
|
986
1143
|
};
|
|
987
1144
|
}, [active, videoRef]);
|
|
988
|
-
return /* @__PURE__ */ (0,
|
|
989
|
-
/* @__PURE__ */ (0,
|
|
1145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "pointer-events-none absolute inset-0", children: [
|
|
1146
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
990
1147
|
"video",
|
|
991
1148
|
{
|
|
992
1149
|
ref: localRef,
|
|
@@ -1005,8 +1162,8 @@ function VideoSlide({
|
|
|
1005
1162
|
className: "absolute inset-0 h-full w-full object-contain"
|
|
1006
1163
|
}
|
|
1007
1164
|
),
|
|
1008
|
-
active && paused && /* @__PURE__ */ (0,
|
|
1009
|
-
active && !paused && /* @__PURE__ */ (0,
|
|
1165
|
+
active && paused && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "flex h-16 w-16 items-center justify-center rounded-full bg-black/45", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PlayIcon, { className: "ml-1 h-8 w-8 fill-white text-white" }) }) }),
|
|
1166
|
+
active && !paused && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "absolute inset-x-4 bottom-2 h-0.5 overflow-hidden rounded-full bg-white/25", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1010
1167
|
"span",
|
|
1011
1168
|
{
|
|
1012
1169
|
className: "block h-full rounded-full bg-white",
|
|
@@ -1018,8 +1175,7 @@ function VideoSlide({
|
|
|
1018
1175
|
|
|
1019
1176
|
// src/components/ImageEditSheet.tsx
|
|
1020
1177
|
var import_react4 = require("react");
|
|
1021
|
-
var
|
|
1022
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1178
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1023
1179
|
var ASPECTS = [
|
|
1024
1180
|
{ id: "free", label: "Free", ratio: null },
|
|
1025
1181
|
{ id: "1:1", label: "Square", ratio: 1 },
|
|
@@ -1199,14 +1355,14 @@ function ImageEditSheet({
|
|
|
1199
1355
|
}
|
|
1200
1356
|
}, [crop, onSave, onClose]);
|
|
1201
1357
|
if (!open || !src) return null;
|
|
1202
|
-
return /* @__PURE__ */ (0,
|
|
1203
|
-
/* @__PURE__ */ (0,
|
|
1358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "absolute inset-0 z-50 flex flex-col bg-black", children: [
|
|
1359
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1204
1360
|
"div",
|
|
1205
1361
|
{
|
|
1206
1362
|
className: "flex shrink-0 items-center justify-between px-4",
|
|
1207
1363
|
style: { paddingTop: "env(safe-area-inset-top, 0px)" },
|
|
1208
1364
|
children: [
|
|
1209
|
-
/* @__PURE__ */ (0,
|
|
1365
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1210
1366
|
"button",
|
|
1211
1367
|
{
|
|
1212
1368
|
type: "button",
|
|
@@ -1214,13 +1370,13 @@ function ImageEditSheet({
|
|
|
1214
1370
|
"aria-label": "Cancel editing",
|
|
1215
1371
|
className: "flex h-11 items-center gap-1.5 rounded-full px-3 text-[15px] font-medium text-white",
|
|
1216
1372
|
children: [
|
|
1217
|
-
/* @__PURE__ */ (0,
|
|
1373
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(XIcon, { className: "h-5 w-5" }),
|
|
1218
1374
|
"Cancel"
|
|
1219
1375
|
]
|
|
1220
1376
|
}
|
|
1221
1377
|
),
|
|
1222
|
-
/* @__PURE__ */ (0,
|
|
1223
|
-
/* @__PURE__ */ (0,
|
|
1378
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-[15px] font-semibold text-white/90", children: "Edit" }),
|
|
1379
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
1224
1380
|
"button",
|
|
1225
1381
|
{
|
|
1226
1382
|
type: "button",
|
|
@@ -1229,7 +1385,7 @@ function ImageEditSheet({
|
|
|
1229
1385
|
"aria-label": "Save edited image",
|
|
1230
1386
|
className: "flex h-11 items-center gap-1.5 rounded-full px-3 text-[15px] font-semibold text-[#FFCC00] disabled:opacity-50",
|
|
1231
1387
|
children: [
|
|
1232
|
-
/* @__PURE__ */ (0,
|
|
1388
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CheckIcon, { className: "h-5 w-5" }),
|
|
1233
1389
|
"Save"
|
|
1234
1390
|
]
|
|
1235
1391
|
}
|
|
@@ -1237,7 +1393,7 @@ function ImageEditSheet({
|
|
|
1237
1393
|
]
|
|
1238
1394
|
}
|
|
1239
1395
|
),
|
|
1240
|
-
/* @__PURE__ */ (0,
|
|
1396
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1241
1397
|
"div",
|
|
1242
1398
|
{
|
|
1243
1399
|
ref: stageRef,
|
|
@@ -1245,8 +1401,8 @@ function ImageEditSheet({
|
|
|
1245
1401
|
onPointerMove,
|
|
1246
1402
|
onPointerUp,
|
|
1247
1403
|
onPointerCancel: onPointerUp,
|
|
1248
|
-
children: /* @__PURE__ */ (0,
|
|
1249
|
-
/* @__PURE__ */ (0,
|
|
1404
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "relative max-h-full max-w-full", children: [
|
|
1405
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1250
1406
|
"img",
|
|
1251
1407
|
{
|
|
1252
1408
|
ref: imgRef,
|
|
@@ -1256,7 +1412,7 @@ function ImageEditSheet({
|
|
|
1256
1412
|
className: "max-h-[62dvh] max-w-full select-none object-contain"
|
|
1257
1413
|
}
|
|
1258
1414
|
),
|
|
1259
|
-
/* @__PURE__ */ (0,
|
|
1415
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1260
1416
|
"div",
|
|
1261
1417
|
{
|
|
1262
1418
|
role: "presentation",
|
|
@@ -1268,7 +1424,7 @@ function ImageEditSheet({
|
|
|
1268
1424
|
width: `${crop.w * 100}%`,
|
|
1269
1425
|
height: `${crop.h * 100}%`
|
|
1270
1426
|
},
|
|
1271
|
-
children: ["nw", "ne", "sw", "se"].map((corner) => /* @__PURE__ */ (0,
|
|
1427
|
+
children: ["nw", "ne", "sw", "se"].map((corner) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1272
1428
|
"span",
|
|
1273
1429
|
{
|
|
1274
1430
|
role: "presentation",
|
|
@@ -1289,9 +1445,9 @@ function ImageEditSheet({
|
|
|
1289
1445
|
] })
|
|
1290
1446
|
}
|
|
1291
1447
|
),
|
|
1292
|
-
/* @__PURE__ */ (0,
|
|
1293
|
-
editError && /* @__PURE__ */ (0,
|
|
1294
|
-
/* @__PURE__ */ (0,
|
|
1448
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "shrink-0", style: { paddingBottom: "env(safe-area-inset-bottom, 0px)" }, children: [
|
|
1449
|
+
editError && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "px-6 pb-2 text-center text-sm text-[#FF6961]", children: editError }),
|
|
1450
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex items-center justify-center gap-2 pb-2", children: ASPECTS.map((a) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1295
1451
|
"button",
|
|
1296
1452
|
{
|
|
1297
1453
|
type: "button",
|
|
@@ -1305,25 +1461,25 @@ function ImageEditSheet({
|
|
|
1305
1461
|
},
|
|
1306
1462
|
a.id
|
|
1307
1463
|
)) }),
|
|
1308
|
-
/* @__PURE__ */ (0,
|
|
1309
|
-
/* @__PURE__ */ (0,
|
|
1464
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex items-center justify-center gap-6 pb-4", children: [
|
|
1465
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1310
1466
|
"button",
|
|
1311
1467
|
{
|
|
1312
1468
|
type: "button",
|
|
1313
1469
|
onClick: () => bake("rotate-left"),
|
|
1314
1470
|
"aria-label": "Rotate left",
|
|
1315
1471
|
className: "flex h-12 w-12 touch-manipulation items-center justify-center rounded-full bg-white/10 text-white",
|
|
1316
|
-
children: /* @__PURE__ */ (0,
|
|
1472
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RotateCcwIcon, { className: "h-5 w-5" })
|
|
1317
1473
|
}
|
|
1318
1474
|
),
|
|
1319
|
-
/* @__PURE__ */ (0,
|
|
1475
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1320
1476
|
"button",
|
|
1321
1477
|
{
|
|
1322
1478
|
type: "button",
|
|
1323
1479
|
onClick: () => bake("flip"),
|
|
1324
1480
|
"aria-label": "Flip horizontally",
|
|
1325
1481
|
className: "flex h-12 w-12 touch-manipulation items-center justify-center rounded-full bg-white/10 text-white",
|
|
1326
|
-
children: /* @__PURE__ */ (0,
|
|
1482
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FlipHorizontal2Icon, { className: "h-5 w-5" })
|
|
1327
1483
|
}
|
|
1328
1484
|
)
|
|
1329
1485
|
] })
|
|
@@ -1332,7 +1488,7 @@ function ImageEditSheet({
|
|
|
1332
1488
|
}
|
|
1333
1489
|
|
|
1334
1490
|
// src/components/CameraCapture.tsx
|
|
1335
|
-
var
|
|
1491
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1336
1492
|
function formatElapsed(totalSeconds) {
|
|
1337
1493
|
const m = Math.floor(totalSeconds / 60);
|
|
1338
1494
|
const s = String(totalSeconds % 60).padStart(2, "0");
|
|
@@ -1411,7 +1567,7 @@ function CameraCapture({
|
|
|
1411
1567
|
{
|
|
1412
1568
|
id: "flash",
|
|
1413
1569
|
label: "Flash",
|
|
1414
|
-
icon: controls.torchOn ? /* @__PURE__ */ (0,
|
|
1570
|
+
icon: controls.torchOn ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ZapIcon, { className: "h-6 w-6", fill: "currentColor" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ZapOffIcon, { className: "h-6 w-6" }),
|
|
1415
1571
|
active: controls.torchOn,
|
|
1416
1572
|
onPress: controls.toggleTorch
|
|
1417
1573
|
}
|
|
@@ -1419,7 +1575,7 @@ function CameraCapture({
|
|
|
1419
1575
|
{
|
|
1420
1576
|
id: "timer",
|
|
1421
1577
|
label: "Timer",
|
|
1422
|
-
icon: /* @__PURE__ */ (0,
|
|
1578
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TimerIcon, { className: "h-6 w-6" }),
|
|
1423
1579
|
active: timerSetting !== 0,
|
|
1424
1580
|
valueLabel: timerSetting === 0 ? void 0 : `${timerSetting}s`,
|
|
1425
1581
|
onPress: cycleTimer
|
|
@@ -1427,7 +1583,7 @@ function CameraCapture({
|
|
|
1427
1583
|
{
|
|
1428
1584
|
id: "grid",
|
|
1429
1585
|
label: "Grid",
|
|
1430
|
-
icon: /* @__PURE__ */ (0,
|
|
1586
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Grid3x3Icon, { className: "h-6 w-6" }),
|
|
1431
1587
|
active: gridOn,
|
|
1432
1588
|
onPress: () => setGridOn((g) => !g)
|
|
1433
1589
|
},
|
|
@@ -1435,7 +1591,7 @@ function CameraCapture({
|
|
|
1435
1591
|
{
|
|
1436
1592
|
id: "aspect",
|
|
1437
1593
|
label: "Aspect",
|
|
1438
|
-
icon: /* @__PURE__ */ (0,
|
|
1594
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ProportionsIcon, { className: "h-6 w-6" }),
|
|
1439
1595
|
active: aspect !== "full",
|
|
1440
1596
|
valueLabel: aspect === "full" ? void 0 : aspect,
|
|
1441
1597
|
onPress: () => setAspect(
|
|
@@ -1446,7 +1602,7 @@ function CameraCapture({
|
|
|
1446
1602
|
{
|
|
1447
1603
|
id: "exposure",
|
|
1448
1604
|
label: "Exposure",
|
|
1449
|
-
icon: /* @__PURE__ */ (0,
|
|
1605
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SunMediumIcon, { className: "h-6 w-6" }),
|
|
1450
1606
|
active: controls.exposure !== 0 || exposureOpen,
|
|
1451
1607
|
valueLabel: controls.exposure === 0 ? void 0 : `${controls.exposure > 0 ? "+" : ""}${controls.exposure}`,
|
|
1452
1608
|
onPress: () => setExposureOpen((o) => !o)
|
|
@@ -1455,15 +1611,15 @@ function CameraCapture({
|
|
|
1455
1611
|
];
|
|
1456
1612
|
const tiles = [...coreTiles, ...slots.optionTiles ?? []];
|
|
1457
1613
|
const blocked = engine.blocked !== null;
|
|
1458
|
-
return /* @__PURE__ */ (0,
|
|
1459
|
-
/* @__PURE__ */ (0,
|
|
1460
|
-
/* @__PURE__ */ (0,
|
|
1461
|
-
mode === "photo" && aspect !== "full" && !blocked && /* @__PURE__ */ (0,
|
|
1614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "absolute inset-0 select-none overflow-hidden bg-black", children: [
|
|
1615
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "absolute inset-0", children: preview }),
|
|
1616
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GridOverlay, { visible: gridOn && !blocked }),
|
|
1617
|
+
mode === "photo" && aspect !== "full" && !blocked && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1462
1618
|
"div",
|
|
1463
1619
|
{
|
|
1464
1620
|
"aria-hidden": true,
|
|
1465
1621
|
className: "pointer-events-none absolute inset-0 z-10 flex items-center justify-center",
|
|
1466
|
-
children: /* @__PURE__ */ (0,
|
|
1622
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1467
1623
|
"div",
|
|
1468
1624
|
{
|
|
1469
1625
|
className: "shadow-[0_0_0_9999px_rgba(0,0,0,0.45)]",
|
|
@@ -1478,25 +1634,25 @@ function CameraCapture({
|
|
|
1478
1634
|
)
|
|
1479
1635
|
}
|
|
1480
1636
|
),
|
|
1481
|
-
/* @__PURE__ */ (0,
|
|
1482
|
-
!controlsHidden && /* @__PURE__ */ (0,
|
|
1637
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CountdownOverlay, { seconds: countdown }),
|
|
1638
|
+
!controlsHidden && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1483
1639
|
"div",
|
|
1484
1640
|
{
|
|
1485
1641
|
className: "absolute inset-x-0 top-0 z-20 bg-black/65 backdrop-blur-[2px]",
|
|
1486
1642
|
style: safeTop,
|
|
1487
|
-
children: /* @__PURE__ */ (0,
|
|
1488
|
-
onClose ? /* @__PURE__ */ (0,
|
|
1643
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex h-11 items-center gap-0.5 px-1.5", children: [
|
|
1644
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1489
1645
|
"button",
|
|
1490
1646
|
{
|
|
1491
1647
|
type: "button",
|
|
1492
1648
|
onClick: onClose,
|
|
1493
1649
|
"aria-label": "Close camera",
|
|
1494
1650
|
className: "flex h-10 w-10 shrink-0 touch-manipulation items-center justify-center rounded-full text-white transition-colors hover:bg-white/10",
|
|
1495
|
-
children: /* @__PURE__ */ (0,
|
|
1651
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(XIcon, { className: "h-5 w-5" })
|
|
1496
1652
|
}
|
|
1497
|
-
) : /* @__PURE__ */ (0,
|
|
1498
|
-
/* @__PURE__ */ (0,
|
|
1499
|
-
controls.torchSupported && /* @__PURE__ */ (0,
|
|
1653
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "w-10 shrink-0" }),
|
|
1654
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "min-w-0 flex-1", children: slots.topBarCenter }),
|
|
1655
|
+
controls.torchSupported && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1500
1656
|
"button",
|
|
1501
1657
|
{
|
|
1502
1658
|
type: "button",
|
|
@@ -1507,8 +1663,8 @@ function CameraCapture({
|
|
|
1507
1663
|
"flex h-10 w-10 shrink-0 touch-manipulation items-center justify-center rounded-full transition-colors",
|
|
1508
1664
|
controls.torchOn ? "text-[#FFCC00]" : "text-white hover:bg-white/10"
|
|
1509
1665
|
),
|
|
1510
|
-
children: /* @__PURE__ */ (0,
|
|
1511
|
-
|
|
1666
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1667
|
+
ZapIcon,
|
|
1512
1668
|
{
|
|
1513
1669
|
className: "h-5 w-5",
|
|
1514
1670
|
fill: controls.torchOn ? "currentColor" : "none"
|
|
@@ -1517,7 +1673,7 @@ function CameraCapture({
|
|
|
1517
1673
|
}
|
|
1518
1674
|
),
|
|
1519
1675
|
slots.topBarTrailing,
|
|
1520
|
-
/* @__PURE__ */ (0,
|
|
1676
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1521
1677
|
"button",
|
|
1522
1678
|
{
|
|
1523
1679
|
type: "button",
|
|
@@ -1528,28 +1684,28 @@ function CameraCapture({
|
|
|
1528
1684
|
"flex h-10 w-10 shrink-0 touch-manipulation items-center justify-center rounded-full transition-colors",
|
|
1529
1685
|
optionsOpen ? "bg-white/20 text-white" : "text-white hover:bg-white/10"
|
|
1530
1686
|
),
|
|
1531
|
-
children: /* @__PURE__ */ (0,
|
|
1687
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(GripIcon, { className: "h-5 w-5" })
|
|
1532
1688
|
}
|
|
1533
1689
|
)
|
|
1534
1690
|
] })
|
|
1535
1691
|
}
|
|
1536
1692
|
),
|
|
1537
|
-
/* @__PURE__ */ (0,
|
|
1693
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1538
1694
|
"div",
|
|
1539
1695
|
{
|
|
1540
1696
|
className: "pointer-events-none absolute inset-x-0 top-[50px] z-20 flex flex-col items-center gap-1.5",
|
|
1541
1697
|
style: safeMarginTop,
|
|
1542
1698
|
children: [
|
|
1543
|
-
engine.recording && /* @__PURE__ */ (0,
|
|
1544
|
-
/* @__PURE__ */ (0,
|
|
1699
|
+
engine.recording && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "flex items-center gap-2 rounded-full bg-black/60 px-3 py-1.5 text-sm font-medium text-white", children: [
|
|
1700
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "h-2.5 w-2.5 animate-pulse rounded-full bg-[#FF3B30]" }),
|
|
1545
1701
|
formatElapsed(engine.recordElapsedSeconds)
|
|
1546
1702
|
] }),
|
|
1547
1703
|
slots.statusChips
|
|
1548
1704
|
]
|
|
1549
1705
|
}
|
|
1550
1706
|
),
|
|
1551
|
-
!controlsHidden && /* @__PURE__ */ (0,
|
|
1552
|
-
!blocked && controls.zoomOptions.length >= 2 && /* @__PURE__ */ (0,
|
|
1707
|
+
!controlsHidden && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "absolute inset-x-0 bottom-0 z-20", children: [
|
|
1708
|
+
!blocked && controls.zoomOptions.length >= 2 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1553
1709
|
ZoomRow,
|
|
1554
1710
|
{
|
|
1555
1711
|
options: controls.zoomOptions,
|
|
@@ -1557,17 +1713,17 @@ function CameraCapture({
|
|
|
1557
1713
|
onSelect: controls.setZoom
|
|
1558
1714
|
}
|
|
1559
1715
|
) }),
|
|
1560
|
-
media && media.items.length > 0 && /* @__PURE__ */ (0,
|
|
1716
|
+
media && media.items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mb-1.5 px-2", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1561
1717
|
CaptureFilmstrip,
|
|
1562
1718
|
{
|
|
1563
1719
|
items: media.items,
|
|
1564
1720
|
onOpen: (item) => setViewerKey(item.key)
|
|
1565
1721
|
}
|
|
1566
1722
|
) }),
|
|
1567
|
-
slots.aboveBar && /* @__PURE__ */ (0,
|
|
1568
|
-
exposureOpen && controls.exposureSupported && controls.exposureRange && /* @__PURE__ */ (0,
|
|
1569
|
-
/* @__PURE__ */ (0,
|
|
1570
|
-
/* @__PURE__ */ (0,
|
|
1723
|
+
slots.aboveBar && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mb-1.5 px-2", children: slots.aboveBar }),
|
|
1724
|
+
exposureOpen && controls.exposureSupported && controls.exposureRange && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mx-auto mb-3 flex w-64 items-center gap-3 rounded-full bg-black/55 px-4 py-2", children: [
|
|
1725
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SunMediumIcon, { className: "h-4 w-4 shrink-0 text-[#FFCC00]" }),
|
|
1726
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1571
1727
|
"input",
|
|
1572
1728
|
{
|
|
1573
1729
|
type: "range",
|
|
@@ -1580,20 +1736,20 @@ function CameraCapture({
|
|
|
1580
1736
|
className: "w-full accent-[#FFCC00]"
|
|
1581
1737
|
}
|
|
1582
1738
|
),
|
|
1583
|
-
/* @__PURE__ */ (0,
|
|
1739
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "w-8 shrink-0 text-right text-xs tabular-nums text-white", children: [
|
|
1584
1740
|
controls.exposure > 0 ? "+" : "",
|
|
1585
1741
|
controls.exposure
|
|
1586
1742
|
] })
|
|
1587
1743
|
] }),
|
|
1588
|
-
/* @__PURE__ */ (0,
|
|
1744
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1589
1745
|
"div",
|
|
1590
1746
|
{
|
|
1591
1747
|
className: "bg-black/65 px-3 backdrop-blur-[2px]",
|
|
1592
1748
|
style: safeBottom,
|
|
1593
1749
|
children: [
|
|
1594
1750
|
slots.aboveModeSelector,
|
|
1595
|
-
/* @__PURE__ */ (0,
|
|
1596
|
-
/* @__PURE__ */ (0,
|
|
1751
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-center gap-2 py-1.5", children: [
|
|
1752
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1597
1753
|
ModeSelector,
|
|
1598
1754
|
{
|
|
1599
1755
|
mode,
|
|
@@ -1604,20 +1760,20 @@ function CameraCapture({
|
|
|
1604
1760
|
extraModes: slots.extraModes
|
|
1605
1761
|
}
|
|
1606
1762
|
),
|
|
1607
|
-
slots.modeRowTrailing && /* @__PURE__ */ (0,
|
|
1763
|
+
slots.modeRowTrailing && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "shrink-0", children: slots.modeRowTrailing })
|
|
1608
1764
|
] }),
|
|
1609
|
-
/* @__PURE__ */ (0,
|
|
1610
|
-
/* @__PURE__ */ (0,
|
|
1765
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-between px-2 pb-1.5 pt-0.5", children: [
|
|
1766
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex w-14 justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1611
1767
|
"button",
|
|
1612
1768
|
{
|
|
1613
1769
|
type: "button",
|
|
1614
1770
|
onClick: cloud.onOpenLibrary,
|
|
1615
1771
|
"aria-label": "Open your media library",
|
|
1616
1772
|
className: "h-11 w-11 touch-manipulation overflow-hidden rounded-xl bg-white/10 ring-1 ring-white/25 transition-transform active:scale-95",
|
|
1617
|
-
children: cloud.recentsThumb ?? /* @__PURE__ */ (0,
|
|
1773
|
+
children: cloud.recentsThumb ?? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "block h-full w-full bg-white/5" })
|
|
1618
1774
|
}
|
|
1619
1775
|
) }),
|
|
1620
|
-
/* @__PURE__ */ (0,
|
|
1776
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1621
1777
|
ShutterButton,
|
|
1622
1778
|
{
|
|
1623
1779
|
mode,
|
|
@@ -1626,22 +1782,22 @@ function CameraCapture({
|
|
|
1626
1782
|
onPress: onShutter
|
|
1627
1783
|
}
|
|
1628
1784
|
),
|
|
1629
|
-
/* @__PURE__ */ (0,
|
|
1785
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex w-14 justify-end", children: engine.onFlipCamera ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1630
1786
|
"button",
|
|
1631
1787
|
{
|
|
1632
1788
|
type: "button",
|
|
1633
1789
|
onClick: engine.onFlipCamera,
|
|
1634
1790
|
"aria-label": "Switch camera",
|
|
1635
1791
|
className: "flex h-11 w-11 touch-manipulation items-center justify-center rounded-full bg-white/15 text-white transition-transform active:rotate-180 active:scale-95 duration-300",
|
|
1636
|
-
children: /* @__PURE__ */ (0,
|
|
1792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RefreshCwIcon, { className: "h-5 w-5" })
|
|
1637
1793
|
}
|
|
1638
|
-
) : /* @__PURE__ */ (0,
|
|
1794
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "h-11 w-11" }) })
|
|
1639
1795
|
] })
|
|
1640
1796
|
]
|
|
1641
1797
|
}
|
|
1642
1798
|
)
|
|
1643
1799
|
] }),
|
|
1644
|
-
/* @__PURE__ */ (0,
|
|
1800
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1645
1801
|
OptionsGridPanel,
|
|
1646
1802
|
{
|
|
1647
1803
|
open: optionsOpen && !controlsHidden,
|
|
@@ -1649,7 +1805,7 @@ function CameraCapture({
|
|
|
1649
1805
|
tiles
|
|
1650
1806
|
}
|
|
1651
1807
|
),
|
|
1652
|
-
blocked && blockedSheet && !blockedDismissed && /* @__PURE__ */ (0,
|
|
1808
|
+
blocked && blockedSheet && !blockedDismissed && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1653
1809
|
CaptureSheet,
|
|
1654
1810
|
{
|
|
1655
1811
|
open: true,
|
|
@@ -1659,7 +1815,7 @@ function CameraCapture({
|
|
|
1659
1815
|
actions: blockedSheet.actions
|
|
1660
1816
|
}
|
|
1661
1817
|
),
|
|
1662
|
-
media && viewerKey !== null && /* @__PURE__ */ (0,
|
|
1818
|
+
media && viewerKey !== null && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1663
1819
|
MediaViewer,
|
|
1664
1820
|
{
|
|
1665
1821
|
items: media.items,
|
|
@@ -1676,7 +1832,7 @@ function CameraCapture({
|
|
|
1676
1832
|
} : void 0
|
|
1677
1833
|
}
|
|
1678
1834
|
),
|
|
1679
|
-
media?.onReplacePhoto && /* @__PURE__ */ (0,
|
|
1835
|
+
media?.onReplacePhoto && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1680
1836
|
ImageEditSheet,
|
|
1681
1837
|
{
|
|
1682
1838
|
open: editTarget !== null,
|
|
@@ -1699,11 +1855,10 @@ function CameraCapture({
|
|
|
1699
1855
|
|
|
1700
1856
|
// src/components/CameraCaptureV3.tsx
|
|
1701
1857
|
var import_react8 = require("react");
|
|
1702
|
-
var import_lucide_react6 = require("lucide-react");
|
|
1703
1858
|
|
|
1704
1859
|
// src/components/CaptureRail.tsx
|
|
1705
1860
|
var import_react6 = require("react");
|
|
1706
|
-
var
|
|
1861
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1707
1862
|
function CaptureRail({
|
|
1708
1863
|
actions,
|
|
1709
1864
|
defaultExpanded = false,
|
|
@@ -1715,7 +1870,7 @@ function CaptureRail({
|
|
|
1715
1870
|
const shown = primary.length === 0 ? actions : expanded ? actions : primary;
|
|
1716
1871
|
const collapsible = primary.length > 0 && extra.length > 0;
|
|
1717
1872
|
if (actions.length === 0) return null;
|
|
1718
|
-
return /* @__PURE__ */ (0,
|
|
1873
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1719
1874
|
"div",
|
|
1720
1875
|
{
|
|
1721
1876
|
className: cn(
|
|
@@ -1723,8 +1878,8 @@ function CaptureRail({
|
|
|
1723
1878
|
className
|
|
1724
1879
|
),
|
|
1725
1880
|
children: [
|
|
1726
|
-
shown.map((action) => /* @__PURE__ */ (0,
|
|
1727
|
-
collapsible ? /* @__PURE__ */ (0,
|
|
1881
|
+
shown.map((action) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RailButton, { action }, action.id)),
|
|
1882
|
+
collapsible ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1728
1883
|
"button",
|
|
1729
1884
|
{
|
|
1730
1885
|
type: "button",
|
|
@@ -1735,7 +1890,7 @@ function CaptureRail({
|
|
|
1735
1890
|
"mt-0.5 flex h-9 w-9 touch-manipulation items-center justify-center",
|
|
1736
1891
|
"rounded-full text-white/90 transition-colors hover:bg-white/10"
|
|
1737
1892
|
),
|
|
1738
|
-
children: /* @__PURE__ */ (0,
|
|
1893
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1739
1894
|
Chevron,
|
|
1740
1895
|
{
|
|
1741
1896
|
className: cn(
|
|
@@ -1751,7 +1906,7 @@ function CaptureRail({
|
|
|
1751
1906
|
);
|
|
1752
1907
|
}
|
|
1753
1908
|
function RailButton({ action }) {
|
|
1754
|
-
return /* @__PURE__ */ (0,
|
|
1909
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1755
1910
|
"button",
|
|
1756
1911
|
{
|
|
1757
1912
|
type: "button",
|
|
@@ -1766,14 +1921,14 @@ function RailButton({ action }) {
|
|
|
1766
1921
|
action.disabled ? "opacity-40" : "hover:bg-white/10 active:bg-white/15"
|
|
1767
1922
|
),
|
|
1768
1923
|
children: [
|
|
1769
|
-
/* @__PURE__ */ (0,
|
|
1770
|
-
action.valueLabel ? /* @__PURE__ */ (0,
|
|
1924
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "drop-shadow-[0_1px_3px_rgba(0,0,0,0.6)]", children: action.icon }),
|
|
1925
|
+
action.valueLabel ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "text-[10px] font-semibold leading-none tabular-nums drop-shadow-[0_1px_2px_rgba(0,0,0,0.7)]", children: action.valueLabel }) : null
|
|
1771
1926
|
]
|
|
1772
1927
|
}
|
|
1773
1928
|
);
|
|
1774
1929
|
}
|
|
1775
1930
|
function Chevron({ className }) {
|
|
1776
|
-
return /* @__PURE__ */ (0,
|
|
1931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1777
1932
|
"svg",
|
|
1778
1933
|
{
|
|
1779
1934
|
viewBox: "0 0 24 24",
|
|
@@ -1784,15 +1939,14 @@ function Chevron({ className }) {
|
|
|
1784
1939
|
strokeLinejoin: "round",
|
|
1785
1940
|
className,
|
|
1786
1941
|
"aria-hidden": "true",
|
|
1787
|
-
children: /* @__PURE__ */ (0,
|
|
1942
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("path", { d: "m6 9 6 6 6-6" })
|
|
1788
1943
|
}
|
|
1789
1944
|
);
|
|
1790
1945
|
}
|
|
1791
1946
|
|
|
1792
1947
|
// src/components/HoldShutter.tsx
|
|
1793
1948
|
var import_react7 = require("react");
|
|
1794
|
-
var
|
|
1795
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1949
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1796
1950
|
var HOLD_MS = 320;
|
|
1797
1951
|
var LOCK_DRAG_PX = 64;
|
|
1798
1952
|
function HoldShutter({
|
|
@@ -1866,15 +2020,15 @@ function HoldShutter({
|
|
|
1866
2020
|
const progress = maxSeconds && maxSeconds > 0 ? Math.min(1, elapsedSeconds / maxSeconds) : 0;
|
|
1867
2021
|
const R = 39;
|
|
1868
2022
|
const C = 2 * Math.PI * R;
|
|
1869
|
-
return /* @__PURE__ */ (0,
|
|
1870
|
-
recording && maxSeconds ? /* @__PURE__ */ (0,
|
|
2023
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "relative flex h-[86px] w-[86px] shrink-0 items-center justify-center", children: [
|
|
2024
|
+
recording && maxSeconds ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1871
2025
|
"svg",
|
|
1872
2026
|
{
|
|
1873
2027
|
className: "pointer-events-none absolute inset-0 -rotate-90",
|
|
1874
2028
|
viewBox: "0 0 86 86",
|
|
1875
2029
|
"aria-hidden": "true",
|
|
1876
2030
|
children: [
|
|
1877
|
-
/* @__PURE__ */ (0,
|
|
2031
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1878
2032
|
"circle",
|
|
1879
2033
|
{
|
|
1880
2034
|
cx: "43",
|
|
@@ -1885,7 +2039,7 @@ function HoldShutter({
|
|
|
1885
2039
|
strokeWidth: "4"
|
|
1886
2040
|
}
|
|
1887
2041
|
),
|
|
1888
|
-
/* @__PURE__ */ (0,
|
|
2042
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1889
2043
|
"circle",
|
|
1890
2044
|
{
|
|
1891
2045
|
cx: "43",
|
|
@@ -1902,28 +2056,28 @@ function HoldShutter({
|
|
|
1902
2056
|
]
|
|
1903
2057
|
}
|
|
1904
2058
|
) : null,
|
|
1905
|
-
recording && pressed && !locked && /* @__PURE__ */ (0,
|
|
2059
|
+
recording && pressed && !locked && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1906
2060
|
"span",
|
|
1907
2061
|
{
|
|
1908
2062
|
className: "pointer-events-none absolute left-1/2 flex -translate-x-1/2 flex-col items-center gap-0.5",
|
|
1909
2063
|
style: { top: -LOCK_DRAG_PX - 22 },
|
|
1910
2064
|
"aria-hidden": true,
|
|
1911
2065
|
children: [
|
|
1912
|
-
/* @__PURE__ */ (0,
|
|
1913
|
-
/* @__PURE__ */ (0,
|
|
2066
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "flex h-9 w-9 items-center justify-center rounded-full bg-black/60 ring-1 ring-white/30", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LockIcon, { className: "h-4 w-4 text-white/90" }) }),
|
|
2067
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "text-[10px] font-medium text-white/80 drop-shadow", children: "Slide up to lock" })
|
|
1914
2068
|
]
|
|
1915
2069
|
}
|
|
1916
2070
|
),
|
|
1917
|
-
recording && locked && /* @__PURE__ */ (0,
|
|
2071
|
+
recording && locked && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1918
2072
|
"span",
|
|
1919
2073
|
{
|
|
1920
2074
|
className: "pointer-events-none absolute left-1/2 flex h-9 w-9 -translate-x-1/2 items-center justify-center rounded-full bg-[#FF3B30]",
|
|
1921
2075
|
style: { top: -LOCK_DRAG_PX - 22 },
|
|
1922
2076
|
"aria-hidden": true,
|
|
1923
|
-
children: /* @__PURE__ */ (0,
|
|
2077
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LockIcon, { className: "h-4 w-4 text-white", fill: "currentColor" })
|
|
1924
2078
|
}
|
|
1925
2079
|
),
|
|
1926
|
-
/* @__PURE__ */ (0,
|
|
2080
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1927
2081
|
"button",
|
|
1928
2082
|
{
|
|
1929
2083
|
type: "button",
|
|
@@ -1940,7 +2094,7 @@ function HoldShutter({
|
|
|
1940
2094
|
"rounded-full border-[3.5px] border-white transition-opacity",
|
|
1941
2095
|
disabled && "opacity-30"
|
|
1942
2096
|
),
|
|
1943
|
-
children: /* @__PURE__ */ (0,
|
|
2097
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1944
2098
|
"span",
|
|
1945
2099
|
{
|
|
1946
2100
|
className: cn(
|
|
@@ -1954,7 +2108,7 @@ function HoldShutter({
|
|
|
1954
2108
|
)
|
|
1955
2109
|
}
|
|
1956
2110
|
),
|
|
1957
|
-
recording ? /* @__PURE__ */ (0,
|
|
2111
|
+
recording ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1958
2112
|
"span",
|
|
1959
2113
|
{
|
|
1960
2114
|
className: cn(
|
|
@@ -1976,7 +2130,7 @@ function formatElapsed2(totalSeconds) {
|
|
|
1976
2130
|
}
|
|
1977
2131
|
|
|
1978
2132
|
// src/components/CameraCaptureV3.tsx
|
|
1979
|
-
var
|
|
2133
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1980
2134
|
var ASPECT_CYCLE2 = ["full", "4:3", "1:1", "16:9"];
|
|
1981
2135
|
function CameraCaptureV3({
|
|
1982
2136
|
engine,
|
|
@@ -2043,7 +2197,7 @@ function CameraCaptureV3({
|
|
|
2043
2197
|
{
|
|
2044
2198
|
id: "flip",
|
|
2045
2199
|
label: "Switch camera",
|
|
2046
|
-
icon: /* @__PURE__ */ (0,
|
|
2200
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(RefreshCwIcon, { className: "h-[22px] w-[22px]" }),
|
|
2047
2201
|
primary: true,
|
|
2048
2202
|
onPress: engine.onFlipCamera
|
|
2049
2203
|
}
|
|
@@ -2052,7 +2206,7 @@ function CameraCaptureV3({
|
|
|
2052
2206
|
{
|
|
2053
2207
|
id: "flash",
|
|
2054
2208
|
label: "Flash",
|
|
2055
|
-
icon: controls.torchOn ? /* @__PURE__ */ (0,
|
|
2209
|
+
icon: controls.torchOn ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ZapIcon, { className: "h-[22px] w-[22px]", fill: "currentColor" }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ZapOffIcon, { className: "h-[22px] w-[22px]" }),
|
|
2056
2210
|
active: controls.torchOn,
|
|
2057
2211
|
primary: true,
|
|
2058
2212
|
onPress: controls.toggleTorch
|
|
@@ -2061,7 +2215,7 @@ function CameraCaptureV3({
|
|
|
2061
2215
|
{
|
|
2062
2216
|
id: "timer",
|
|
2063
2217
|
label: "Timer",
|
|
2064
|
-
icon: /* @__PURE__ */ (0,
|
|
2218
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(TimerIcon, { className: "h-[22px] w-[22px]" }),
|
|
2065
2219
|
active: timerSetting !== 0,
|
|
2066
2220
|
valueLabel: timerSetting === 0 ? void 0 : `${timerSetting}s`,
|
|
2067
2221
|
onPress: () => setTimerSetting((t) => t === 0 ? 3 : t === 3 ? 10 : 0)
|
|
@@ -2069,14 +2223,14 @@ function CameraCaptureV3({
|
|
|
2069
2223
|
{
|
|
2070
2224
|
id: "grid",
|
|
2071
2225
|
label: "Grid",
|
|
2072
|
-
icon: /* @__PURE__ */ (0,
|
|
2226
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Grid3x3Icon, { className: "h-[22px] w-[22px]" }),
|
|
2073
2227
|
active: gridOn,
|
|
2074
2228
|
onPress: () => setGridOn((g) => !g)
|
|
2075
2229
|
},
|
|
2076
2230
|
{
|
|
2077
2231
|
id: "aspect",
|
|
2078
2232
|
label: "Aspect",
|
|
2079
|
-
icon: /* @__PURE__ */ (0,
|
|
2233
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ProportionsIcon, { className: "h-[22px] w-[22px]" }),
|
|
2080
2234
|
active: aspect !== "full",
|
|
2081
2235
|
valueLabel: aspect === "full" ? void 0 : aspect,
|
|
2082
2236
|
onPress: () => setAspect(
|
|
@@ -2087,7 +2241,7 @@ function CameraCaptureV3({
|
|
|
2087
2241
|
{
|
|
2088
2242
|
id: "exposure",
|
|
2089
2243
|
label: "Exposure",
|
|
2090
|
-
icon: /* @__PURE__ */ (0,
|
|
2244
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SunMediumIcon, { className: "h-[22px] w-[22px]" }),
|
|
2091
2245
|
active: controls.exposure !== 0,
|
|
2092
2246
|
valueLabel: controls.exposure === 0 ? void 0 : `${controls.exposure > 0 ? "+" : ""}${controls.exposure}`,
|
|
2093
2247
|
onPress: () => controls.setExposure(controls.exposure === 0 ? 1 : 0)
|
|
@@ -2098,15 +2252,15 @@ function CameraCaptureV3({
|
|
|
2098
2252
|
...coreRail.map((a) => blocked ? { ...a, disabled: true } : a),
|
|
2099
2253
|
...slots.railActions ?? []
|
|
2100
2254
|
];
|
|
2101
|
-
return /* @__PURE__ */ (0,
|
|
2102
|
-
/* @__PURE__ */ (0,
|
|
2103
|
-
/* @__PURE__ */ (0,
|
|
2104
|
-
aspect !== "full" && !blocked && !engine.recording && /* @__PURE__ */ (0,
|
|
2255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "absolute inset-0 select-none overflow-hidden bg-black", children: [
|
|
2256
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "absolute inset-0", children: preview }),
|
|
2257
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(GridOverlay, { visible: gridOn && !blocked }),
|
|
2258
|
+
aspect !== "full" && !blocked && !engine.recording && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2105
2259
|
"div",
|
|
2106
2260
|
{
|
|
2107
2261
|
"aria-hidden": true,
|
|
2108
2262
|
className: "pointer-events-none absolute inset-0 z-10 flex items-center justify-center",
|
|
2109
|
-
children: /* @__PURE__ */ (0,
|
|
2263
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2110
2264
|
"div",
|
|
2111
2265
|
{
|
|
2112
2266
|
className: "shadow-[0_0_0_9999px_rgba(0,0,0,0.45)]",
|
|
@@ -2121,32 +2275,32 @@ function CameraCaptureV3({
|
|
|
2121
2275
|
)
|
|
2122
2276
|
}
|
|
2123
2277
|
),
|
|
2124
|
-
/* @__PURE__ */ (0,
|
|
2125
|
-
!controlsHidden && /* @__PURE__ */ (0,
|
|
2278
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CountdownOverlay, { seconds: countdown }),
|
|
2279
|
+
!controlsHidden && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2126
2280
|
"div",
|
|
2127
2281
|
{
|
|
2128
2282
|
className: "pointer-events-none absolute inset-x-0 top-0 z-20 px-2",
|
|
2129
2283
|
style: safeTop,
|
|
2130
2284
|
children: [
|
|
2131
|
-
/* @__PURE__ */ (0,
|
|
2132
|
-
onClose ? /* @__PURE__ */ (0,
|
|
2285
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex min-h-[44px] items-center gap-2 py-1.5", children: [
|
|
2286
|
+
onClose ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2133
2287
|
"button",
|
|
2134
2288
|
{
|
|
2135
2289
|
type: "button",
|
|
2136
2290
|
onClick: onClose,
|
|
2137
2291
|
"aria-label": "Close camera",
|
|
2138
2292
|
className: "pointer-events-auto flex h-10 w-10 shrink-0 touch-manipulation items-center justify-center rounded-full text-white drop-shadow-[0_1px_3px_rgba(0,0,0,0.6)] transition-colors hover:bg-white/10",
|
|
2139
|
-
children: /* @__PURE__ */ (0,
|
|
2293
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(XIcon, { className: "h-6 w-6" })
|
|
2140
2294
|
}
|
|
2141
|
-
) : /* @__PURE__ */ (0,
|
|
2142
|
-
/* @__PURE__ */ (0,
|
|
2143
|
-
/* @__PURE__ */ (0,
|
|
2295
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "h-10 w-10 shrink-0" }),
|
|
2296
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "pointer-events-auto flex min-w-0 flex-1 justify-center", children: slots.topEntry }),
|
|
2297
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "h-10 w-10 shrink-0" })
|
|
2144
2298
|
] }),
|
|
2145
|
-
slots.topCenter ? /* @__PURE__ */ (0,
|
|
2299
|
+
slots.topCenter ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "pointer-events-none pb-1 text-center", children: slots.topCenter }) : null
|
|
2146
2300
|
]
|
|
2147
2301
|
}
|
|
2148
2302
|
),
|
|
2149
|
-
slots.statusChips ? /* @__PURE__ */ (0,
|
|
2303
|
+
slots.statusChips ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2150
2304
|
"div",
|
|
2151
2305
|
{
|
|
2152
2306
|
className: "pointer-events-none absolute inset-x-0 z-20 flex flex-col items-center gap-1.5 px-3",
|
|
@@ -2158,35 +2312,35 @@ function CameraCaptureV3({
|
|
|
2158
2312
|
children: slots.statusChips
|
|
2159
2313
|
}
|
|
2160
2314
|
) : null,
|
|
2161
|
-
!controlsHidden && /* @__PURE__ */ (0,
|
|
2315
|
+
!controlsHidden && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2162
2316
|
"div",
|
|
2163
2317
|
{
|
|
2164
2318
|
className: "pointer-events-none absolute right-1 z-20 flex justify-end",
|
|
2165
2319
|
style: { top: `calc(env(safe-area-inset-top, 0px) + 64px)` },
|
|
2166
|
-
children: /* @__PURE__ */ (0,
|
|
2320
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CaptureRail, { actions: railActions })
|
|
2167
2321
|
}
|
|
2168
2322
|
),
|
|
2169
|
-
!controlsHidden && /* @__PURE__ */ (0,
|
|
2170
|
-
media && media.items.length > 0 ? /* @__PURE__ */ (0,
|
|
2323
|
+
!controlsHidden && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "absolute inset-x-0 bottom-0 z-20", style: safeBottom, children: [
|
|
2324
|
+
media && media.items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "px-2 pb-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2171
2325
|
CaptureFilmstrip,
|
|
2172
2326
|
{
|
|
2173
2327
|
items: media.items,
|
|
2174
2328
|
onOpen: (item) => setViewerKey(item.key)
|
|
2175
2329
|
}
|
|
2176
2330
|
) }) : null,
|
|
2177
|
-
slots.aboveShutter ? /* @__PURE__ */ (0,
|
|
2178
|
-
/* @__PURE__ */ (0,
|
|
2179
|
-
/* @__PURE__ */ (0,
|
|
2331
|
+
slots.aboveShutter ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "px-2 pb-1.5", children: slots.aboveShutter }) : null,
|
|
2332
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center justify-between px-3 pb-2", children: [
|
|
2333
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex w-[86px] justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2180
2334
|
"button",
|
|
2181
2335
|
{
|
|
2182
2336
|
type: "button",
|
|
2183
2337
|
onClick: cloud.onOpenLibrary,
|
|
2184
2338
|
"aria-label": "Your media \u2014 library and upload",
|
|
2185
2339
|
className: "relative h-12 w-12 touch-manipulation overflow-hidden rounded-xl bg-black/40 ring-1 ring-white/30 backdrop-blur-md transition-transform active:scale-95",
|
|
2186
|
-
children: cloud.recentsThumb ?? /* @__PURE__ */ (0,
|
|
2340
|
+
children: cloud.recentsThumb ?? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "flex h-full w-full items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ImagesIcon, { className: "h-5 w-5 text-white/80" }) })
|
|
2187
2341
|
}
|
|
2188
2342
|
) }),
|
|
2189
|
-
/* @__PURE__ */ (0,
|
|
2343
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2190
2344
|
HoldShutter,
|
|
2191
2345
|
{
|
|
2192
2346
|
recording: engine.recording,
|
|
@@ -2199,11 +2353,11 @@ function CameraCaptureV3({
|
|
|
2199
2353
|
onStopRecording: engine.onStopRecording
|
|
2200
2354
|
}
|
|
2201
2355
|
),
|
|
2202
|
-
/* @__PURE__ */ (0,
|
|
2356
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "flex w-[86px] justify-end", children: slots.shutterTrailing })
|
|
2203
2357
|
] }),
|
|
2204
|
-
!engine.recording && !blocked ? /* @__PURE__ */ (0,
|
|
2358
|
+
!engine.recording && !blocked ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { className: "pb-1.5 text-center text-[11px] text-white/60 drop-shadow-[0_1px_2px_rgba(0,0,0,0.8)]", children: "Tap for a photo \xB7 hold to record" }) : null
|
|
2205
2359
|
] }),
|
|
2206
|
-
blocked && blockedSheet && !blockedDismissed && /* @__PURE__ */ (0,
|
|
2360
|
+
blocked && blockedSheet && !blockedDismissed && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2207
2361
|
CaptureSheet,
|
|
2208
2362
|
{
|
|
2209
2363
|
open: true,
|
|
@@ -2213,7 +2367,7 @@ function CameraCaptureV3({
|
|
|
2213
2367
|
actions: blockedSheet.actions
|
|
2214
2368
|
}
|
|
2215
2369
|
),
|
|
2216
|
-
media && viewerKey !== null && /* @__PURE__ */ (0,
|
|
2370
|
+
media && viewerKey !== null && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2217
2371
|
MediaViewer,
|
|
2218
2372
|
{
|
|
2219
2373
|
items: media.items,
|
|
@@ -2230,7 +2384,7 @@ function CameraCaptureV3({
|
|
|
2230
2384
|
} : void 0
|
|
2231
2385
|
}
|
|
2232
2386
|
),
|
|
2233
|
-
media?.onReplacePhoto && /* @__PURE__ */ (0,
|
|
2387
|
+
media?.onReplacePhoto && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2234
2388
|
ImageEditSheet,
|
|
2235
2389
|
{
|
|
2236
2390
|
open: editTarget !== null,
|
|
@@ -2253,7 +2407,7 @@ function CameraCaptureV3({
|
|
|
2253
2407
|
|
|
2254
2408
|
// src/components/CaptureExpandingField.tsx
|
|
2255
2409
|
var import_react9 = require("react");
|
|
2256
|
-
var
|
|
2410
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2257
2411
|
function CaptureExpandingField({
|
|
2258
2412
|
label,
|
|
2259
2413
|
placeholder,
|
|
@@ -2291,7 +2445,7 @@ function CaptureExpandingField({
|
|
|
2291
2445
|
setExpanded(false);
|
|
2292
2446
|
}, [commit]);
|
|
2293
2447
|
if (!expanded) {
|
|
2294
|
-
return /* @__PURE__ */ (0,
|
|
2448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2295
2449
|
"button",
|
|
2296
2450
|
{
|
|
2297
2451
|
type: "button",
|
|
@@ -2307,13 +2461,13 @@ function CaptureExpandingField({
|
|
|
2307
2461
|
className
|
|
2308
2462
|
),
|
|
2309
2463
|
children: [
|
|
2310
|
-
icon ? /* @__PURE__ */ (0,
|
|
2311
|
-
/* @__PURE__ */ (0,
|
|
2464
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shrink-0", children: icon }) : null,
|
|
2465
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "truncate", children: currentValue?.trim() || label })
|
|
2312
2466
|
]
|
|
2313
2467
|
}
|
|
2314
2468
|
);
|
|
2315
2469
|
}
|
|
2316
|
-
return /* @__PURE__ */ (0,
|
|
2470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
2317
2471
|
"div",
|
|
2318
2472
|
{
|
|
2319
2473
|
className: cn(
|
|
@@ -2322,8 +2476,8 @@ function CaptureExpandingField({
|
|
|
2322
2476
|
className
|
|
2323
2477
|
),
|
|
2324
2478
|
children: [
|
|
2325
|
-
icon ? /* @__PURE__ */ (0,
|
|
2326
|
-
/* @__PURE__ */ (0,
|
|
2479
|
+
icon ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "shrink-0 text-white/70", children: icon }) : null,
|
|
2480
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2327
2481
|
"input",
|
|
2328
2482
|
{
|
|
2329
2483
|
ref: inputRef,
|
|
@@ -2352,7 +2506,7 @@ function CaptureExpandingField({
|
|
|
2352
2506
|
)
|
|
2353
2507
|
}
|
|
2354
2508
|
),
|
|
2355
|
-
/* @__PURE__ */ (0,
|
|
2509
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2356
2510
|
"button",
|
|
2357
2511
|
{
|
|
2358
2512
|
type: "button",
|
|
@@ -2363,7 +2517,7 @@ function CaptureExpandingField({
|
|
|
2363
2517
|
},
|
|
2364
2518
|
"aria-label": `Close ${label}`,
|
|
2365
2519
|
className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-white/70 hover:bg-white/10 hover:text-white",
|
|
2366
|
-
children: /* @__PURE__ */ (0,
|
|
2520
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2367
2521
|
"svg",
|
|
2368
2522
|
{
|
|
2369
2523
|
viewBox: "0 0 24 24",
|
|
@@ -2373,7 +2527,7 @@ function CaptureExpandingField({
|
|
|
2373
2527
|
strokeLinecap: "round",
|
|
2374
2528
|
className: "h-3.5 w-3.5",
|
|
2375
2529
|
"aria-hidden": "true",
|
|
2376
|
-
children: /* @__PURE__ */ (0,
|
|
2530
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
2377
2531
|
}
|
|
2378
2532
|
)
|
|
2379
2533
|
}
|
|
@@ -2385,7 +2539,7 @@ function CaptureExpandingField({
|
|
|
2385
2539
|
|
|
2386
2540
|
// src/components/CameraFeed.tsx
|
|
2387
2541
|
var import_react10 = require("react");
|
|
2388
|
-
var
|
|
2542
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2389
2543
|
function CameraFeed({
|
|
2390
2544
|
engine,
|
|
2391
2545
|
mirror = false
|
|
@@ -2399,7 +2553,7 @@ function CameraFeed({
|
|
|
2399
2553
|
video.srcObject = null;
|
|
2400
2554
|
};
|
|
2401
2555
|
}, [stream, videoRef]);
|
|
2402
|
-
return /* @__PURE__ */ (0,
|
|
2556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2403
2557
|
"video",
|
|
2404
2558
|
{
|
|
2405
2559
|
ref: videoRef,
|