@stealthscale/component-media 0.2.1 → 0.2.2

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.
@@ -0,0 +1,760 @@
1
+ import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.js";
2
+ import { n as recipe } from "../../recipes-CBo6SSP8.js";
3
+ import { D as Image$1, E as Root$1, a as Viewport, c as Image, d as useImageCropper, k as Fallback, l as Handle, o as Selection, r as handles, s as Root, u as Grid } from "../../shared-DH0DrBx7.js";
4
+ import { c } from "react/compiler-runtime";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { useState } from "react";
7
+ import { Button, IconButton } from "@stealthscale/component-actions";
8
+ import { Room, scenesOf, specimen, useWords } from "@stealthscale/specimen";
9
+ import { FlipHorizontal2Icon, RotateCcwIcon, RotateCwIcon, Undo2Icon, ZoomInIcon, ZoomOutIcon } from "lucide-react";
10
+ import { Stack } from "@stealthscale/component-layout";
11
+ import { Text } from "@stealthscale/component-typography";
12
+ //#region src/image-cropper/examples/landscape.webp
13
+ var landscape_default = "data:image/webp;base64,UklGRrQrAABXRUJQVlA4IKgrAABQegGdASrAA4ACPm02l0kkIyImIlQpKMANiWVu+F+oS/MuELTefqf7/cN8bvkdZn3PebM+LZ35Xf+T1t5rWUX5h7uz6r8v+rN678O/2D6RdR7uX9n3on1B5q9pfoA/hH+J9gD+AfxD/b/3/+5e+v0p/270B+f36ef+l6gX9f9P/1A//70d37v/Ct+337Sf+v4o/7n///YA///qAf//rv+w3+z8IOtFXz/pu7t19d6e8K8ZOCDxiNyZIn97l5ev/eDf8OiW7/ekj58HsH/dgGUXkrPz3BK0JFyWvESemsREnprERJ6axESemsREnprERJ6axESemsREnprERJ6awch+/PcErQkXJa8RJ6axESemsREnprERJ6axESemsREnprERJ6axESemsREnprERIiYiT01iIl/rxP8lb/Xif5K3+vE/yVv9eJ/krf68T/JW/14n+St/rxP8lb/Xif5K3+vEztliIk9NYiJPTWIiT01iIk9NYiJPTWIiT01iIk9NYiJPTWIiT01iIk9NYiJPTWId2Up6axESemsREnprERJ6axESemsREnprERJ6axESemsREnprERJ6axESemsREnpn2y/zmYNS14iT01iIk9NYiJPTWIiT01iIk9NYiJPTWIiT01iIk9NYiJPTWIiT01g4awT3BK0JFyWvESemsREnprERJ6axESemsREnprERJ6axESemsREnprERJ6axESImIk5CGk6LXiJPTWIiT01iIk9NYiJPTWIiT01iIk9NYiJPTWIiT01iIk9NYiJPTPl8s/PcErQkXJa8RJ6axESemsREnprERJ6axESemsREnprENZVueGOZipvjmYqb45mJtRUXJa8RJ6axESemsREnprERJ6axESemsREnpv//iFz68RHODD/5y2XS26DxscErQkXJa8O7KU9NYiJPTWIiT01iIk9NYiJPTWIiT01iIk9NY/3Ec9rMXLMWyPvJ///+wGuWpGUfHMxUxM8I+wlSxJjz1dsmmIsE/EgLm1lSxJlHsvESemsREnv///0f//LXiJPTWIn/G2NxGEkApbJpiLBPxIC6FmlnHUaLXW4rp5FeAxUm9raW5MrbgB4iU2QKnxqb1DFdW2k3///cE//z8aeCIB8cuRrv4NlfxizvmPSsX+a3pTG4rp5FeAxVrcV0JUR3NO9DJrcIfKgBAfFuGvFy64n4omWy4l14n+T9j//dS/89sFYRV+nREPj1JHXjkzW1VrxEnlenRVfnuCVoSLkteIikAKUqTc3q0JG4myV1v+y14iTkP9v8p9UuhdXu1Xt/oVGYUFG45KPXu3emS14iRDiclrwqBBgpjMS+lz01iIk7etW9P3dJ0NbP2kHYGXixFcMbOMo+LMu9hyjDuLf2YrkcCREehC1310k+DkruH/9BaRUcKJcmcbN4ZC3TUqmR/rETw3BPxIC6IZPouSebJJrJJTeSboI7SnT0nZINaz3BKvPlka0tSx5qQPjRxo1IM4DG07ipAzHngjcVV3QBz4ftxi9Ei5E4pmdaJ9wRdlrMJz//2qf2UWXu3zzF7TpjJToJWrhh6NiBOOavBYb7HeUVoZmadLFGpqBuQyNgGqmhPDtcY9Q7nNGRF8BZedAd4rolRrl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MFKFoo47+ik5Mb4Dp7MBg9fo96gPiO711ZfUvwS7R7fjBIMnCTscm7nVryRDIOeK1wJFd9ZSYDC6zeESYdlv8xcfEa8K+YO9wsmfx5NjyQyyDkbhfbxA0FyKDiKoH0Mz7YjMcegP9W1MYYQnVwAgJzzdEvMNgSXh9++d7Q4+CMCueJEPXmrlLxJoULVsqynA5dQCK1IcauXa5E0iuFUZgPxgcODvS6haNbzPoWrGjC65nPQJC9IlUlQ/RHbcAAAAAAAAAE/RwuAAAAAAAAA";
14
+ //#endregion
15
+ //#region src/image-cropper/examples/banner.example.tsx
16
+ var banner_example_exports = /* @__PURE__ */ __exportAll({
17
+ Banner: () => Banner,
18
+ source: () => source$4
19
+ });
20
+ function Banner() {
21
+ const $ = c(14);
22
+ const { t } = useWords("image-cropper");
23
+ let t0;
24
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
25
+ t0 = {
26
+ aspectRatio: 3,
27
+ defaultZoom: 1.5,
28
+ fixedCropArea: true
29
+ };
30
+ $[0] = t0;
31
+ } else t0 = $[0];
32
+ const cropper = useImageCropper(t0);
33
+ let t1;
34
+ if ($[1] !== t) {
35
+ t1 = t("bannerLabel");
36
+ $[1] = t;
37
+ $[2] = t1;
38
+ } else t1 = $[2];
39
+ let t2;
40
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
41
+ t2 = /* @__PURE__ */ jsx(Image, { src: landscape_default });
42
+ $[3] = t2;
43
+ } else t2 = $[3];
44
+ let t3;
45
+ if ($[4] !== t) {
46
+ t3 = t("bannerInstructions");
47
+ $[4] = t;
48
+ $[5] = t3;
49
+ } else t3 = $[5];
50
+ let t4;
51
+ let t5;
52
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
53
+ t4 = /* @__PURE__ */ jsx(Grid, { axis: "horizontal" });
54
+ t5 = /* @__PURE__ */ jsx(Grid, { axis: "vertical" });
55
+ $[6] = t4;
56
+ $[7] = t5;
57
+ } else {
58
+ t4 = $[6];
59
+ t5 = $[7];
60
+ }
61
+ let t6;
62
+ if ($[8] !== t3) {
63
+ t6 = /* @__PURE__ */ jsxs(Viewport, { children: [t2, /* @__PURE__ */ jsxs(Selection, {
64
+ "aria-description": t3,
65
+ children: [t4, t5]
66
+ })] });
67
+ $[8] = t3;
68
+ $[9] = t6;
69
+ } else t6 = $[9];
70
+ let t7;
71
+ if ($[10] !== cropper || $[11] !== t1 || $[12] !== t6) {
72
+ t7 = /* @__PURE__ */ jsx(Root, {
73
+ "aria-label": t1,
74
+ cropper,
75
+ children: t6
76
+ });
77
+ $[10] = cropper;
78
+ $[11] = t1;
79
+ $[12] = t6;
80
+ $[13] = t7;
81
+ } else t7 = $[13];
82
+ return t7;
83
+ }
84
+ const source$4 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ImageCropper } from \"@stealthscale/component-media\";\n\nimport landscape from \"./landscape.webp\";\n\nexport function Banner(): ReactElement {\n const { t } = useWords(\"image-cropper\");\n const cropper = ImageCropper.useImageCropper({\n aspectRatio: 3,\n defaultZoom: 1.5,\n fixedCropArea: true,\n });\n\n return (\n <ImageCropper.Root aria-label={t(\"bannerLabel\")} cropper={cropper}>\n <ImageCropper.Viewport>\n <ImageCropper.Image src={landscape} />\n <ImageCropper.Selection aria-description={t(\"bannerInstructions\")}>\n <ImageCropper.Grid axis=\"horizontal\" />\n <ImageCropper.Grid axis=\"vertical\" />\n </ImageCropper.Selection>\n </ImageCropper.Viewport>\n </ImageCropper.Root>\n );\n}\n";
85
+ //#endregion
86
+ //#region src/image-cropper/examples/cover.example.tsx
87
+ var cover_example_exports = /* @__PURE__ */ __exportAll({
88
+ Cover: () => Cover,
89
+ source: () => source$3
90
+ });
91
+ function Cover() {
92
+ const $ = c(49);
93
+ const { t } = useWords("image-cropper");
94
+ let t0;
95
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
96
+ t0 = { aspectRatio: 1.7777777777777777 };
97
+ $[0] = t0;
98
+ } else t0 = $[0];
99
+ const cropper = useImageCropper(t0);
100
+ let t1;
101
+ if ($[1] !== t) {
102
+ t1 = t("coverLabel");
103
+ $[1] = t;
104
+ $[2] = t1;
105
+ } else t1 = $[2];
106
+ let t2;
107
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
108
+ t2 = /* @__PURE__ */ jsx(Image, { src: landscape_default });
109
+ $[3] = t2;
110
+ } else t2 = $[3];
111
+ let t3;
112
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
113
+ t3 = /* @__PURE__ */ jsxs(Viewport, { children: [t2, /* @__PURE__ */ jsxs(Selection, { children: [
114
+ handles.map(_temp$3),
115
+ /* @__PURE__ */ jsx(Grid, { axis: "horizontal" }),
116
+ /* @__PURE__ */ jsx(Grid, { axis: "vertical" })
117
+ ] })] });
118
+ $[4] = t3;
119
+ } else t3 = $[4];
120
+ let t4;
121
+ if ($[5] !== cropper || $[6] !== t1) {
122
+ t4 = /* @__PURE__ */ jsx(Root, {
123
+ "aria-label": t1,
124
+ cropper,
125
+ children: t3
126
+ });
127
+ $[5] = cropper;
128
+ $[6] = t1;
129
+ $[7] = t4;
130
+ } else t4 = $[7];
131
+ let t5;
132
+ if ($[8] !== t) {
133
+ t5 = t("rotateLeft");
134
+ $[8] = t;
135
+ $[9] = t5;
136
+ } else t5 = $[9];
137
+ let t6;
138
+ if ($[10] !== cropper) {
139
+ t6 = () => {
140
+ cropper.rotateBy(-90);
141
+ };
142
+ $[10] = cropper;
143
+ $[11] = t6;
144
+ } else t6 = $[11];
145
+ let t7;
146
+ if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
147
+ t7 = /* @__PURE__ */ jsx(RotateCcwIcon, {});
148
+ $[12] = t7;
149
+ } else t7 = $[12];
150
+ let t8;
151
+ if ($[13] !== t5 || $[14] !== t6) {
152
+ t8 = /* @__PURE__ */ jsx(IconButton, {
153
+ "aria-label": t5,
154
+ onClick: t6,
155
+ variant: "outline",
156
+ children: t7
157
+ });
158
+ $[13] = t5;
159
+ $[14] = t6;
160
+ $[15] = t8;
161
+ } else t8 = $[15];
162
+ let t9;
163
+ if ($[16] !== t) {
164
+ t9 = t("rotateRight");
165
+ $[16] = t;
166
+ $[17] = t9;
167
+ } else t9 = $[17];
168
+ let t10;
169
+ if ($[18] !== cropper) {
170
+ t10 = () => {
171
+ cropper.rotateBy(90);
172
+ };
173
+ $[18] = cropper;
174
+ $[19] = t10;
175
+ } else t10 = $[19];
176
+ let t11;
177
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
178
+ t11 = /* @__PURE__ */ jsx(RotateCwIcon, {});
179
+ $[20] = t11;
180
+ } else t11 = $[20];
181
+ let t12;
182
+ if ($[21] !== t10 || $[22] !== t9) {
183
+ t12 = /* @__PURE__ */ jsx(IconButton, {
184
+ "aria-label": t9,
185
+ onClick: t10,
186
+ variant: "outline",
187
+ children: t11
188
+ });
189
+ $[21] = t10;
190
+ $[22] = t9;
191
+ $[23] = t12;
192
+ } else t12 = $[23];
193
+ let t13;
194
+ if ($[24] !== t) {
195
+ t13 = t("flip");
196
+ $[24] = t;
197
+ $[25] = t13;
198
+ } else t13 = $[25];
199
+ let t14;
200
+ if ($[26] !== cropper) {
201
+ t14 = () => {
202
+ cropper.flipHorizontally();
203
+ };
204
+ $[26] = cropper;
205
+ $[27] = t14;
206
+ } else t14 = $[27];
207
+ let t15;
208
+ if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
209
+ t15 = /* @__PURE__ */ jsx(FlipHorizontal2Icon, {});
210
+ $[28] = t15;
211
+ } else t15 = $[28];
212
+ let t16;
213
+ if ($[29] !== cropper.flip.horizontal || $[30] !== t13 || $[31] !== t14) {
214
+ t16 = /* @__PURE__ */ jsx(IconButton, {
215
+ "aria-label": t13,
216
+ "aria-pressed": cropper.flip.horizontal,
217
+ onClick: t14,
218
+ variant: "outline",
219
+ children: t15
220
+ });
221
+ $[29] = cropper.flip.horizontal;
222
+ $[30] = t13;
223
+ $[31] = t14;
224
+ $[32] = t16;
225
+ } else t16 = $[32];
226
+ let t17;
227
+ if ($[33] !== t) {
228
+ t17 = t("reset");
229
+ $[33] = t;
230
+ $[34] = t17;
231
+ } else t17 = $[34];
232
+ let t18;
233
+ if ($[35] !== cropper) {
234
+ t18 = () => {
235
+ cropper.reset();
236
+ };
237
+ $[35] = cropper;
238
+ $[36] = t18;
239
+ } else t18 = $[36];
240
+ let t19;
241
+ if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
242
+ t19 = /* @__PURE__ */ jsx(Undo2Icon, {});
243
+ $[37] = t19;
244
+ } else t19 = $[37];
245
+ let t20;
246
+ if ($[38] !== t17 || $[39] !== t18) {
247
+ t20 = /* @__PURE__ */ jsx(IconButton, {
248
+ "aria-label": t17,
249
+ onClick: t18,
250
+ variant: "outline",
251
+ children: t19
252
+ });
253
+ $[38] = t17;
254
+ $[39] = t18;
255
+ $[40] = t20;
256
+ } else t20 = $[40];
257
+ let t21;
258
+ if ($[41] !== t12 || $[42] !== t16 || $[43] !== t20 || $[44] !== t8) {
259
+ t21 = /* @__PURE__ */ jsxs(Stack, {
260
+ direction: "row",
261
+ gap: "sm",
262
+ children: [
263
+ t8,
264
+ t12,
265
+ t16,
266
+ t20
267
+ ]
268
+ });
269
+ $[41] = t12;
270
+ $[42] = t16;
271
+ $[43] = t20;
272
+ $[44] = t8;
273
+ $[45] = t21;
274
+ } else t21 = $[45];
275
+ let t22;
276
+ if ($[46] !== t21 || $[47] !== t4) {
277
+ t22 = /* @__PURE__ */ jsxs(Stack, {
278
+ gap: "md",
279
+ children: [t4, t21]
280
+ });
281
+ $[46] = t21;
282
+ $[47] = t4;
283
+ $[48] = t22;
284
+ } else t22 = $[48];
285
+ return t22;
286
+ }
287
+ function _temp$3(position) {
288
+ return /* @__PURE__ */ jsx(Handle, { position }, position);
289
+ }
290
+ const source$3 = "import { type ReactElement } from \"react\";\n\nimport { FlipHorizontal2Icon, RotateCcwIcon, RotateCwIcon, Undo2Icon } from \"lucide-react\";\n\nimport { IconButton } from \"@stealthscale/component-actions\";\nimport { Stack } from \"@stealthscale/component-layout\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ImageCropper } from \"@stealthscale/component-media\";\n\nimport landscape from \"./landscape.webp\";\n\nexport function Cover(): ReactElement {\n const { t } = useWords(\"image-cropper\");\n const cropper = ImageCropper.useImageCropper({ aspectRatio: 16 / 9 });\n\n return (\n <Stack gap=\"md\">\n <ImageCropper.Root aria-label={t(\"coverLabel\")} cropper={cropper}>\n <ImageCropper.Viewport>\n <ImageCropper.Image src={landscape} />\n <ImageCropper.Selection>\n {ImageCropper.handles.map((position) => (\n <ImageCropper.Handle key={position} position={position} />\n ))}\n <ImageCropper.Grid axis=\"horizontal\" />\n <ImageCropper.Grid axis=\"vertical\" />\n </ImageCropper.Selection>\n </ImageCropper.Viewport>\n </ImageCropper.Root>\n <Stack direction=\"row\" gap=\"sm\">\n <IconButton\n aria-label={t(\"rotateLeft\")}\n onClick={() => {\n cropper.rotateBy(-90);\n }}\n variant=\"outline\"\n >\n <RotateCcwIcon />\n </IconButton>\n <IconButton\n aria-label={t(\"rotateRight\")}\n onClick={() => {\n cropper.rotateBy(90);\n }}\n variant=\"outline\"\n >\n <RotateCwIcon />\n </IconButton>\n <IconButton\n aria-label={t(\"flip\")}\n aria-pressed={cropper.flip.horizontal}\n onClick={() => {\n cropper.flipHorizontally();\n }}\n variant=\"outline\"\n >\n <FlipHorizontal2Icon />\n </IconButton>\n <IconButton\n aria-label={t(\"reset\")}\n onClick={() => {\n cropper.reset();\n }}\n variant=\"outline\"\n >\n <Undo2Icon />\n </IconButton>\n </Stack>\n </Stack>\n );\n}\n";
291
+ //#endregion
292
+ //#region src/image-cropper/examples/free.example.tsx
293
+ var free_example_exports = /* @__PURE__ */ __exportAll({
294
+ Free: () => Free,
295
+ source: () => source$2
296
+ });
297
+ function Free() {
298
+ const $ = c(22);
299
+ const { t } = useWords("image-cropper");
300
+ let t0;
301
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
302
+ t0 = {
303
+ height: 0,
304
+ width: 0
305
+ };
306
+ $[0] = t0;
307
+ } else t0 = $[0];
308
+ const [size, setSize] = useState(t0);
309
+ let t1;
310
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
311
+ t1 = {
312
+ maxHeight: 200,
313
+ minHeight: 80,
314
+ minWidth: 80,
315
+ onCropChange: (t2) => {
316
+ const { crop } = t2;
317
+ setSize({
318
+ height: Math.round(crop.height),
319
+ width: Math.round(crop.width)
320
+ });
321
+ }
322
+ };
323
+ $[1] = t1;
324
+ } else t1 = $[1];
325
+ const cropper = useImageCropper(t1);
326
+ let t2;
327
+ if ($[2] !== t) {
328
+ t2 = t("label");
329
+ $[2] = t;
330
+ $[3] = t2;
331
+ } else t2 = $[3];
332
+ let t3;
333
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
334
+ t3 = /* @__PURE__ */ jsx(Image, { src: landscape_default });
335
+ $[4] = t3;
336
+ } else t3 = $[4];
337
+ let t4;
338
+ if ($[5] !== t) {
339
+ t4 = (crop_0) => t("valueText", {
340
+ height: crop_0.height,
341
+ width: crop_0.width
342
+ });
343
+ $[5] = t;
344
+ $[6] = t4;
345
+ } else t4 = $[6];
346
+ let t5;
347
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
348
+ t5 = handles.map(_temp$2);
349
+ $[7] = t5;
350
+ } else t5 = $[7];
351
+ let t6;
352
+ if ($[8] !== t4) {
353
+ t6 = /* @__PURE__ */ jsxs(Viewport, { children: [t3, /* @__PURE__ */ jsx(Selection, {
354
+ valueText: t4,
355
+ children: t5
356
+ })] });
357
+ $[8] = t4;
358
+ $[9] = t6;
359
+ } else t6 = $[9];
360
+ let t7;
361
+ if ($[10] !== cropper || $[11] !== t2 || $[12] !== t6) {
362
+ t7 = /* @__PURE__ */ jsx(Root, {
363
+ "aria-label": t2,
364
+ cropper,
365
+ children: t6
366
+ });
367
+ $[10] = cropper;
368
+ $[11] = t2;
369
+ $[12] = t6;
370
+ $[13] = t7;
371
+ } else t7 = $[13];
372
+ let t8;
373
+ if ($[14] !== size || $[15] !== t) {
374
+ t8 = t("size", size);
375
+ $[14] = size;
376
+ $[15] = t;
377
+ $[16] = t8;
378
+ } else t8 = $[16];
379
+ let t9;
380
+ if ($[17] !== t8) {
381
+ t9 = /* @__PURE__ */ jsx(Text, {
382
+ as: "output",
383
+ size: "sm",
384
+ tone: "muted",
385
+ children: t8
386
+ });
387
+ $[17] = t8;
388
+ $[18] = t9;
389
+ } else t9 = $[18];
390
+ let t10;
391
+ if ($[19] !== t7 || $[20] !== t9) {
392
+ t10 = /* @__PURE__ */ jsxs(Stack, {
393
+ gap: "sm",
394
+ children: [t7, t9]
395
+ });
396
+ $[19] = t7;
397
+ $[20] = t9;
398
+ $[21] = t10;
399
+ } else t10 = $[21];
400
+ return t10;
401
+ }
402
+ function _temp$2(position) {
403
+ return /* @__PURE__ */ jsx(Handle, { position }, position);
404
+ }
405
+ const source$2 = "import { type ReactElement, useState } from \"react\";\n\nimport { Stack } from \"@stealthscale/component-layout\";\nimport { Text } from \"@stealthscale/component-typography\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ImageCropper } from \"@stealthscale/component-media\";\n\nimport landscape from \"./landscape.webp\";\n\nexport function Free(): ReactElement {\n const { t } = useWords(\"image-cropper\");\n const [size, setSize] = useState({ height: 0, width: 0 });\n const cropper = ImageCropper.useImageCropper({\n maxHeight: 200,\n minHeight: 80,\n minWidth: 80,\n onCropChange: ({ crop }) => {\n setSize({ height: Math.round(crop.height), width: Math.round(crop.width) });\n },\n });\n\n return (\n <Stack gap=\"sm\">\n <ImageCropper.Root aria-label={t(\"label\")} cropper={cropper}>\n <ImageCropper.Viewport>\n <ImageCropper.Image src={landscape} />\n <ImageCropper.Selection\n valueText={(crop) => t(\"valueText\", { height: crop.height, width: crop.width })}\n >\n {ImageCropper.handles.map((position) => (\n <ImageCropper.Handle key={position} position={position} />\n ))}\n </ImageCropper.Selection>\n </ImageCropper.Viewport>\n </ImageCropper.Root>\n <Text as=\"output\" size=\"sm\" tone=\"muted\">\n {t(\"size\", size)}\n </Text>\n </Stack>\n );\n}\n";
406
+ //#endregion
407
+ //#region src/image-cropper/examples/photo.example.tsx
408
+ var photo_example_exports = /* @__PURE__ */ __exportAll({
409
+ Photo: () => Photo,
410
+ source: () => source$1
411
+ });
412
+ function Photo(props) {
413
+ const $ = c(8);
414
+ const { t } = useWords("image-cropper");
415
+ const cropper = useImageCropper();
416
+ let t0;
417
+ if ($[0] !== t) {
418
+ t0 = t("label");
419
+ $[0] = t;
420
+ $[1] = t0;
421
+ } else t0 = $[1];
422
+ let t1;
423
+ if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
424
+ t1 = /* @__PURE__ */ jsx(Image, { src: landscape_default });
425
+ $[2] = t1;
426
+ } else t1 = $[2];
427
+ let t2;
428
+ if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
429
+ t2 = /* @__PURE__ */ jsxs(Viewport, { children: [t1, /* @__PURE__ */ jsxs(Selection, { children: [
430
+ handles.map(_temp$1),
431
+ /* @__PURE__ */ jsx(Grid, { axis: "horizontal" }),
432
+ /* @__PURE__ */ jsx(Grid, { axis: "vertical" })
433
+ ] })] });
434
+ $[3] = t2;
435
+ } else t2 = $[3];
436
+ let t3;
437
+ if ($[4] !== cropper || $[5] !== props || $[6] !== t0) {
438
+ t3 = /* @__PURE__ */ jsx(Root, {
439
+ "aria-label": t0,
440
+ cropper,
441
+ ...props,
442
+ children: t2
443
+ });
444
+ $[4] = cropper;
445
+ $[5] = props;
446
+ $[6] = t0;
447
+ $[7] = t3;
448
+ } else t3 = $[7];
449
+ return t3;
450
+ }
451
+ function _temp$1(position) {
452
+ return /* @__PURE__ */ jsx(Handle, { position }, position);
453
+ }
454
+ const source$1 = "import { type ReactElement } from \"react\";\n\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { ImageCropper } from \"@stealthscale/component-media\";\n\nimport landscape from \"./landscape.webp\";\n\nexport function Photo(props: Omit<ImageCropper.RootProps, \"cropper\">): ReactElement {\n const { t } = useWords(\"image-cropper\");\n const cropper = ImageCropper.useImageCropper();\n\n return (\n <ImageCropper.Root aria-label={t(\"label\")} cropper={cropper} {...props}>\n <ImageCropper.Viewport>\n <ImageCropper.Image src={landscape} />\n <ImageCropper.Selection>\n {ImageCropper.handles.map((position) => (\n <ImageCropper.Handle key={position} position={position} />\n ))}\n <ImageCropper.Grid axis=\"horizontal\" />\n <ImageCropper.Grid axis=\"vertical\" />\n </ImageCropper.Selection>\n </ImageCropper.Viewport>\n </ImageCropper.Root>\n );\n}\n";
455
+ //#endregion
456
+ //#region src/image-cropper/examples/profile.example.tsx
457
+ var profile_example_exports = /* @__PURE__ */ __exportAll({
458
+ Profile: () => Profile,
459
+ source: () => source
460
+ });
461
+ function Profile() {
462
+ const $ = c(49);
463
+ const { t } = useWords("image-cropper");
464
+ let t0;
465
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
466
+ t0 = {
467
+ aspectRatio: 1,
468
+ cropShape: "circle"
469
+ };
470
+ $[0] = t0;
471
+ } else t0 = $[0];
472
+ const cropper = useImageCropper(t0);
473
+ const [picture, setPicture] = useState();
474
+ let t1;
475
+ if ($[1] !== cropper) {
476
+ t1 = async () => {
477
+ const url = await cropper.getCroppedImage({
478
+ maxSize: {
479
+ height: 256,
480
+ width: 256
481
+ },
482
+ output: "dataUrl"
483
+ });
484
+ if (typeof url === "string") setPicture(url);
485
+ };
486
+ $[1] = cropper;
487
+ $[2] = t1;
488
+ } else t1 = $[2];
489
+ const save = t1;
490
+ let t2;
491
+ if ($[3] !== t) {
492
+ t2 = t("profileLabel");
493
+ $[3] = t;
494
+ $[4] = t2;
495
+ } else t2 = $[4];
496
+ let t3;
497
+ if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
498
+ t3 = /* @__PURE__ */ jsx(Image, { src: landscape_default });
499
+ $[5] = t3;
500
+ } else t3 = $[5];
501
+ let t4;
502
+ if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
503
+ t4 = /* @__PURE__ */ jsxs(Viewport, { children: [t3, /* @__PURE__ */ jsx(Selection, { children: handles.map(_temp) })] });
504
+ $[6] = t4;
505
+ } else t4 = $[6];
506
+ let t5;
507
+ if ($[7] !== cropper || $[8] !== t2) {
508
+ t5 = /* @__PURE__ */ jsx(Root, {
509
+ "aria-label": t2,
510
+ cropper,
511
+ children: t4
512
+ });
513
+ $[7] = cropper;
514
+ $[8] = t2;
515
+ $[9] = t5;
516
+ } else t5 = $[9];
517
+ let t6;
518
+ if ($[10] !== t) {
519
+ t6 = t("zoomOut");
520
+ $[10] = t;
521
+ $[11] = t6;
522
+ } else t6 = $[11];
523
+ let t7;
524
+ if ($[12] !== cropper) {
525
+ t7 = () => {
526
+ cropper.zoomBy(-.25);
527
+ };
528
+ $[12] = cropper;
529
+ $[13] = t7;
530
+ } else t7 = $[13];
531
+ let t8;
532
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
533
+ t8 = /* @__PURE__ */ jsx(ZoomOutIcon, {});
534
+ $[14] = t8;
535
+ } else t8 = $[14];
536
+ let t9;
537
+ if ($[15] !== t6 || $[16] !== t7) {
538
+ t9 = /* @__PURE__ */ jsx(IconButton, {
539
+ "aria-label": t6,
540
+ onClick: t7,
541
+ variant: "outline",
542
+ children: t8
543
+ });
544
+ $[15] = t6;
545
+ $[16] = t7;
546
+ $[17] = t9;
547
+ } else t9 = $[17];
548
+ let t10;
549
+ if ($[18] !== t) {
550
+ t10 = t("zoomIn");
551
+ $[18] = t;
552
+ $[19] = t10;
553
+ } else t10 = $[19];
554
+ let t11;
555
+ if ($[20] !== cropper) {
556
+ t11 = () => {
557
+ cropper.zoomBy(.25);
558
+ };
559
+ $[20] = cropper;
560
+ $[21] = t11;
561
+ } else t11 = $[21];
562
+ let t12;
563
+ if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
564
+ t12 = /* @__PURE__ */ jsx(ZoomInIcon, {});
565
+ $[22] = t12;
566
+ } else t12 = $[22];
567
+ let t13;
568
+ if ($[23] !== t10 || $[24] !== t11) {
569
+ t13 = /* @__PURE__ */ jsx(IconButton, {
570
+ "aria-label": t10,
571
+ onClick: t11,
572
+ variant: "outline",
573
+ children: t12
574
+ });
575
+ $[23] = t10;
576
+ $[24] = t11;
577
+ $[25] = t13;
578
+ } else t13 = $[25];
579
+ let t14;
580
+ if ($[26] !== save) {
581
+ t14 = () => {
582
+ save();
583
+ };
584
+ $[26] = save;
585
+ $[27] = t14;
586
+ } else t14 = $[27];
587
+ let t15;
588
+ if ($[28] !== t) {
589
+ t15 = t("save");
590
+ $[28] = t;
591
+ $[29] = t15;
592
+ } else t15 = $[29];
593
+ let t16;
594
+ if ($[30] !== t14 || $[31] !== t15) {
595
+ t16 = /* @__PURE__ */ jsx(Button, {
596
+ onClick: t14,
597
+ children: t15
598
+ });
599
+ $[30] = t14;
600
+ $[31] = t15;
601
+ $[32] = t16;
602
+ } else t16 = $[32];
603
+ let t17;
604
+ if ($[33] !== t) {
605
+ t17 = t("name");
606
+ $[33] = t;
607
+ $[34] = t17;
608
+ } else t17 = $[34];
609
+ let t18;
610
+ if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
611
+ t18 = /* @__PURE__ */ jsx(Fallback, {});
612
+ $[35] = t18;
613
+ } else t18 = $[35];
614
+ let t19;
615
+ if ($[36] !== picture) {
616
+ t19 = picture === void 0 ? null : /* @__PURE__ */ jsx(Image$1, { src: picture });
617
+ $[36] = picture;
618
+ $[37] = t19;
619
+ } else t19 = $[37];
620
+ let t20;
621
+ if ($[38] !== t17 || $[39] !== t19) {
622
+ t20 = /* @__PURE__ */ jsxs(Root$1, {
623
+ name: t17,
624
+ size: "lg",
625
+ children: [t18, t19]
626
+ });
627
+ $[38] = t17;
628
+ $[39] = t19;
629
+ $[40] = t20;
630
+ } else t20 = $[40];
631
+ let t21;
632
+ if ($[41] !== t13 || $[42] !== t16 || $[43] !== t20 || $[44] !== t9) {
633
+ t21 = /* @__PURE__ */ jsxs(Stack, {
634
+ direction: "row",
635
+ gap: "sm",
636
+ children: [
637
+ t9,
638
+ t13,
639
+ t16,
640
+ t20
641
+ ]
642
+ });
643
+ $[41] = t13;
644
+ $[42] = t16;
645
+ $[43] = t20;
646
+ $[44] = t9;
647
+ $[45] = t21;
648
+ } else t21 = $[45];
649
+ let t22;
650
+ if ($[46] !== t21 || $[47] !== t5) {
651
+ t22 = /* @__PURE__ */ jsxs(Stack, {
652
+ gap: "md",
653
+ children: [t5, t21]
654
+ });
655
+ $[46] = t21;
656
+ $[47] = t5;
657
+ $[48] = t22;
658
+ } else t22 = $[48];
659
+ return t22;
660
+ }
661
+ function _temp(position) {
662
+ return /* @__PURE__ */ jsx(Handle, { position }, position);
663
+ }
664
+ const source = "import { type ReactElement, useState } from \"react\";\n\nimport { ZoomInIcon, ZoomOutIcon } from \"lucide-react\";\n\nimport { Button, IconButton } from \"@stealthscale/component-actions\";\nimport { Stack } from \"@stealthscale/component-layout\";\nimport { useWords } from \"@stealthscale/specimen\";\n\nimport { Avatar, ImageCropper } from \"@stealthscale/component-media\";\n\nimport landscape from \"./landscape.webp\";\n\nexport function Profile(): ReactElement {\n const { t } = useWords(\"image-cropper\");\n const cropper = ImageCropper.useImageCropper({ aspectRatio: 1, cropShape: \"circle\" });\n const [picture, setPicture] = useState<string>();\n\n const save = async (): Promise<void> => {\n const url = await cropper.getCroppedImage({\n maxSize: { height: 256, width: 256 },\n output: \"dataUrl\",\n });\n\n if (typeof url === \"string\") setPicture(url);\n };\n\n return (\n <Stack gap=\"md\">\n <ImageCropper.Root aria-label={t(\"profileLabel\")} cropper={cropper}>\n <ImageCropper.Viewport>\n <ImageCropper.Image src={landscape} />\n <ImageCropper.Selection>\n {ImageCropper.handles.map((position) => (\n <ImageCropper.Handle key={position} position={position} />\n ))}\n </ImageCropper.Selection>\n </ImageCropper.Viewport>\n </ImageCropper.Root>\n <Stack direction=\"row\" gap=\"sm\">\n <IconButton\n aria-label={t(\"zoomOut\")}\n onClick={() => {\n cropper.zoomBy(-0.25);\n }}\n variant=\"outline\"\n >\n <ZoomOutIcon />\n </IconButton>\n <IconButton\n aria-label={t(\"zoomIn\")}\n onClick={() => {\n cropper.zoomBy(0.25);\n }}\n variant=\"outline\"\n >\n <ZoomInIcon />\n </IconButton>\n <Button\n onClick={() => {\n void save();\n }}\n >\n {t(\"save\")}\n </Button>\n <Avatar.Root name={t(\"name\")} size=\"lg\">\n <Avatar.Fallback />\n {picture === undefined ? null : <Avatar.Image src={picture} />}\n </Avatar.Root>\n </Stack>\n </Stack>\n );\n}\n";
665
+ //#endregion
666
+ //#region src/image-cropper/image-cropper.specimen.tsx
667
+ /**
668
+ * Catalogue page for the image cropper.
669
+ *
670
+ * @remarks
671
+ * The hand-written scenes show a crop with every handle, a round profile picture exported into
672
+ * an avatar, a cover with rotation and flip, a fixed frame the picture pans under, and a free
673
+ * crop that reports its size. `scenesOf` generates the corner scene from the photo example. Each
674
+ * cropper renders in a room at its real width, and the picture is a generated file beside the
675
+ * examples. The words are keys under `image-cropper` in
676
+ * `locales/en/specimen/image-cropper.json`.
677
+ */
678
+ /**
679
+ * Hand-written scene for a crop with every handle and the lines of thirds.
680
+ */
681
+ const photo = {
682
+ about: "image-cropper.photo.about",
683
+ draw: () => /* @__PURE__ */ jsx(Room, {
684
+ size: "sm",
685
+ children: /* @__PURE__ */ jsx(Photo, {})
686
+ }),
687
+ example: photo_example_exports,
688
+ title: "image-cropper.photo.title"
689
+ };
690
+ /**
691
+ * Hand-written scene for a round crop exported into an avatar.
692
+ */
693
+ const profile = {
694
+ about: "image-cropper.profile.about",
695
+ draw: () => /* @__PURE__ */ jsx(Room, {
696
+ size: "sm",
697
+ children: /* @__PURE__ */ jsx(Profile, {})
698
+ }),
699
+ example: profile_example_exports,
700
+ title: "image-cropper.profile.title"
701
+ };
702
+ /**
703
+ * Hand-written scene for a 16:9 crop with rotation, flip and reset.
704
+ */
705
+ const cover = {
706
+ about: "image-cropper.cover.about",
707
+ draw: () => /* @__PURE__ */ jsx(Room, {
708
+ size: "sm",
709
+ children: /* @__PURE__ */ jsx(Cover, {})
710
+ }),
711
+ example: cover_example_exports,
712
+ title: "image-cropper.cover.title"
713
+ };
714
+ /**
715
+ * Hand-written scene for a fixed frame the picture pans under.
716
+ */
717
+ const banner = {
718
+ about: "image-cropper.banner.about",
719
+ draw: () => /* @__PURE__ */ jsx(Room, {
720
+ size: "sm",
721
+ children: /* @__PURE__ */ jsx(Banner, {})
722
+ }),
723
+ example: banner_example_exports,
724
+ title: "image-cropper.banner.title"
725
+ };
726
+ /**
727
+ * Hand-written scene for a crop of any shape that reports its size.
728
+ */
729
+ const free = {
730
+ about: "image-cropper.free.about",
731
+ draw: () => /* @__PURE__ */ jsx(Room, {
732
+ size: "sm",
733
+ children: /* @__PURE__ */ jsx(Free, {})
734
+ }),
735
+ example: free_example_exports,
736
+ title: "image-cropper.free.title"
737
+ };
738
+ var image_cropper_specimen_default = specimen({
739
+ about: "image-cropper.about",
740
+ id: "components/media/image-cropper",
741
+ imports: "import { ImageCropper } from \"@stealthscale/component-media\";",
742
+ scenes: [
743
+ photo,
744
+ profile,
745
+ cover,
746
+ banner,
747
+ free,
748
+ ...scenesOf(recipe, {
749
+ draw: (props) => /* @__PURE__ */ jsx(Room, {
750
+ size: "xs",
751
+ children: /* @__PURE__ */ jsx(Photo, { ...props })
752
+ }),
753
+ example: photo_example_exports,
754
+ namespace: "image-cropper"
755
+ })
756
+ ],
757
+ title: "image-cropper.title"
758
+ });
759
+ //#endregion
760
+ export { banner, cover, image_cropper_specimen_default as default, free, photo, profile };