fumadocs-ui 16.8.5 → 16.8.7

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.
Files changed (32) hide show
  1. package/css/generated/shared.css +13 -9
  2. package/dist/components/image-zoom.d.ts +1 -1
  3. package/dist/components/image-zoom.js +1 -1
  4. package/dist/components/toc/clerk.js +67 -55
  5. package/dist/components/ui/button.d.ts +1 -1
  6. package/dist/layouts/home/slots/header.d.ts +1 -1
  7. package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.3_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/Controlled.d.ts → react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/controlled.d.ts} +2 -7
  8. package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.3_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/Controlled.js → react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/controlled.js} +32 -8
  9. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/index.d.ts +2 -0
  10. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/uncontrolled.d.ts +7 -0
  11. package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.3_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/Uncontrolled.js → react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/uncontrolled.js} +2 -2
  12. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/adjust-svg-ids.js +53 -0
  13. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/compute-positioned-style.js +25 -0
  14. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/element-tests.js +12 -0
  15. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/get-div-img-style.js +45 -0
  16. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/get-img-alt.js +8 -0
  17. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/get-img-object-fit-style.js +55 -0
  18. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/get-img-regular-style.js +21 -0
  19. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/get-img-src.js +14 -0
  20. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/get-modal-img-transform.js +22 -0
  21. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/get-scale.js +27 -0
  22. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/get-style-ghost.js +31 -0
  23. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/get-style-modal-img.js +75 -0
  24. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/get-target-dimension.js +4 -0
  25. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/parse-position.js +7 -0
  26. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/test-has-scalable-src.js +5 -0
  27. package/dist/style.css +38 -13
  28. package/package.json +8 -8
  29. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.3_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/Uncontrolled.d.ts +0 -7
  30. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.3_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/icons.js +0 -24
  31. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.3_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/index.d.ts +0 -2
  32. package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.3_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils.js +0 -372
@@ -31,15 +31,12 @@
31
31
  @source inline("--spacing");
32
32
  @source inline("--track-bottom");
33
33
  @source inline("--track-top");
34
- @source inline("-circle");
35
34
  @source inline("-mb-px");
36
35
  @source inline("-me-0.5");
37
36
  @source inline("-me-2");
38
37
  @source inline("-mx-px");
39
38
  @source inline("-rotate-90");
40
- @source inline("-text");
41
39
  @source inline("-top-1.5");
42
- @source inline("-translate-1/2");
43
40
  @source inline("-translate-x-1/2");
44
41
  @source inline("-translate-y-1/2");
45
42
  @source inline("-z-1");
@@ -126,7 +123,6 @@
126
123
  @source inline("bg-fd-background");
127
124
  @source inline("bg-fd-border");
128
125
  @source inline("bg-fd-card");
129
- @source inline("bg-fd-foreground/10");
130
126
  @source inline("bg-fd-muted");
131
127
  @source inline("bg-fd-overlay");
132
128
  @source inline("bg-fd-popover");
@@ -342,6 +338,8 @@
342
338
  @source inline("file");
343
339
  @source inline("fill");
344
340
  @source inline("fill-(--callout-color)");
341
+ @source inline("fill-fd-muted");
342
+ @source inline("fill-fd-muted-foreground");
345
343
  @source inline("fill-fd-primary");
346
344
  @source inline("fill-fd-primary-foreground");
347
345
  @source inline("filter");
@@ -413,6 +411,7 @@
413
411
  @source inline("h-(--radix-navigation-menu-viewport-height)");
414
412
  @source inline("h-1.5");
415
413
  @source inline("h-9.5");
414
+ @source inline("h-[calc(100%+--spacing(1.5))]");
416
415
  @source inline("h-full");
417
416
  @source inline("h-px");
418
417
  @source inline("h1");
@@ -469,7 +468,6 @@
469
468
  @source inline("inset-x-0");
470
469
  @source inline("inset-x-2");
471
470
  @source inline("inset-y-0");
472
- @source inline("insetInlineStart");
473
471
  @source inline("instanceof");
474
472
  @source inline("instead");
475
473
  @source inline("integration");
@@ -496,6 +494,9 @@
496
494
  @source inline("key");
497
495
  @source inline("keydown");
498
496
  @source inline("l");
497
+ @source inline("l0");
498
+ @source inline("l1");
499
+ @source inline("l2");
499
500
  @source inline("label");
500
501
  @source inline("lang");
501
502
  @source inline("language");
@@ -506,6 +507,7 @@
506
507
  @source inline("layout");
507
508
  @source inline("leading-none");
508
509
  @source inline("leaving");
510
+ @source inline("left-0");
509
511
  @source inline("left-1/2");
510
512
  @source inline("length");
511
513
  @source inline("let");
@@ -525,7 +527,6 @@
525
527
  @source inline("locale");
526
528
  @source inline("locales");
527
529
  @source inline("lower");
528
- @source inline("lowerOffset");
529
530
  @source inline("ltr");
530
531
  @source inline("lucide");
531
532
  @source inline("lucide-book");
@@ -635,7 +636,6 @@
635
636
  @source inline("object");
636
637
  @source inline("observer");
637
638
  @source inline("of");
638
- @source inline("offset");
639
639
  @source inline("offsetPath");
640
640
  @source inline("offsetTop");
641
641
  @source inline("on");
@@ -669,6 +669,7 @@
669
669
  @source inline("orientation");
670
670
  @source inline("origin-(--radix-popover-content-transform-origin)");
671
671
  @source inline("origin-[top_center]");
672
+ @source inline("origin-center");
672
673
  @source inline("original");
673
674
  @source inline("out");
674
675
  @source inline("outer");
@@ -813,6 +814,7 @@
813
814
  @source inline("rounded-xl");
814
815
  @source inline("router");
815
816
  @source inline("row");
817
+ @source inline("rtl:-scale-x-100");
816
818
  @source inline("rtl:rotate-180");
817
819
  @source inline("rtl:rotate-90");
818
820
  @source inline("s");
@@ -968,7 +970,6 @@
968
970
  @source inline("toolbar");
969
971
  @source inline("top");
970
972
  @source inline("top-0");
971
- @source inline("top-1.5");
972
973
  @source inline("top-1/2");
973
974
  @source inline("top-2.5");
974
975
  @source inline("top-3");
@@ -1002,7 +1003,6 @@
1002
1003
  @source inline("unknown");
1003
1004
  @source inline("updateAnchor");
1004
1005
  @source inline("updates");
1005
- @source inline("upperOffset");
1006
1006
  @source inline("upperX");
1007
1007
  @source inline("url");
1008
1008
  @source inline("urls");
@@ -1075,8 +1075,12 @@
1075
1075
  @source inline("wrapInSuspense");
1076
1076
  @source inline("wrapped");
1077
1077
  @source inline("x");
1078
+ @source inline("x1");
1079
+ @source inline("x2");
1078
1080
  @source inline("xmlns");
1079
1081
  @source inline("y");
1082
+ @source inline("y1");
1083
+ @source inline("y2");
1080
1084
  @source inline("you");
1081
1085
  @source inline("your");
1082
1086
  @source inline("z-2");
@@ -1,4 +1,4 @@
1
- import { UncontrolledProps } from "../node_modules/.pnpm/react-medium-image-zoom@5.4.3_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/Uncontrolled.js";
1
+ import { UncontrolledProps } from "../node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/uncontrolled.js";
2
2
  import { ComponentProps } from "react";
3
3
  import { ImageProps } from "fumadocs-core/framework";
4
4
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { Uncontrolled } from "../node_modules/.pnpm/react-medium-image-zoom@5.4.3_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/Uncontrolled.js";
2
+ import { Uncontrolled } from "../node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/uncontrolled.js";
3
3
  import "./image-zoom2.css";
4
4
  import { Image } from "fumadocs-core/framework";
5
5
  import { jsx } from "react/jsx-runtime";
@@ -48,20 +48,23 @@ function TOCItems({ ref, className, thumbBox = true, children, ...props }) {
48
48
  ];
49
49
  d += ` C ${upperX} ${top - 4} ${x} ${upperBottom + 4} ${x} ${top} L${x} ${bottom}`;
50
50
  }
51
- if (item._step !== void 0) output.push(/* @__PURE__ */ jsx("circle", {
52
- cx: x,
53
- cy: (top + bottom) / 2,
54
- r: "8",
55
- className: "fill-fd-primary"
56
- }, `${i}-circle`), /* @__PURE__ */ jsx("text", {
57
- x,
58
- y: (top + bottom) / 2,
59
- textAnchor: "middle",
60
- alignmentBaseline: "central",
61
- dominantBaseline: "middle",
62
- className: "fill-fd-primary-foreground font-medium text-xs leading-none font-mono",
63
- children: item._step
64
- }, `${i}-text`));
51
+ if (item._step !== void 0) output.push(/* @__PURE__ */ jsxs("g", {
52
+ transform: `translate(${x}, ${(top + bottom) / 2})`,
53
+ children: [/* @__PURE__ */ jsx("circle", {
54
+ cx: "0",
55
+ cy: "0",
56
+ r: "8",
57
+ className: "fill-fd-primary"
58
+ }), /* @__PURE__ */ jsx("text", {
59
+ cx: "0",
60
+ cy: "0",
61
+ textAnchor: "middle",
62
+ alignmentBaseline: "central",
63
+ dominantBaseline: "middle",
64
+ className: "fill-fd-primary-foreground font-medium text-xs leading-none font-mono rtl:-scale-x-100",
65
+ children: item._step
66
+ })]
67
+ }, i));
65
68
  positions.push([
66
69
  top,
67
70
  bottom,
@@ -156,7 +159,7 @@ function ThumbTrack({ computed, thumbBox }) {
156
159
  });
157
160
  return /* @__PURE__ */ jsxs("div", {
158
161
  ref,
159
- className: "absolute top-0 inset-s-0",
162
+ className: "absolute top-0 inset-s-0 origin-center rtl:-scale-x-100",
160
163
  style: {
161
164
  width: computed.width,
162
165
  height: computed.height,
@@ -173,7 +176,7 @@ function ThumbTrack({ computed, thumbBox }) {
173
176
  },
174
177
  children: computed.content
175
178
  }), thumbBox && /* @__PURE__ */ jsx("div", {
176
- className: "absolute size-1 bg-fd-primary rounded-full [offset-distance:var(--offset-distance,0)] opacity-(--opacity,0) transition-[opacity,offset-distance]",
179
+ className: "absolute left-0 size-1 bg-fd-primary rounded-full [offset-distance:var(--offset-distance,0)] opacity-(--opacity,0) transition-[opacity,offset-distance]",
177
180
  style: { offsetPath: `path("${computed.d}")` }
178
181
  })]
179
182
  });
@@ -191,15 +194,55 @@ function getLineOffset(depth) {
191
194
  }
192
195
  function TOCItem({ item, ...props }) {
193
196
  const items = useTOCItems();
194
- const { lowerOffset, offset, upperOffset, isFirst, isLast } = useMemo(() => {
197
+ const { isFirst, isLast, svg } = useMemo(() => {
195
198
  const index = items.indexOf(item);
196
- const offset = getLineOffset(item.depth);
199
+ const isFirst = index === 0;
200
+ const isLast = index === items.length - 1;
201
+ const l1 = getLineOffset(item.depth);
202
+ const l0 = isFirst ? l1 : getLineOffset(items[index - 1].depth);
203
+ const l2 = isLast ? l1 : getLineOffset(items[index + 1].depth);
197
204
  return {
198
- offset,
199
- isFirst: index === 0,
200
- isLast: index === items.length - 1,
201
- upperOffset: index > 0 ? getLineOffset(items[index - 1].depth) : offset,
202
- lowerOffset: index + 1 < items.length ? getLineOffset(items[index + 1].depth) : offset
205
+ isFirst,
206
+ isLast,
207
+ svg: /* @__PURE__ */ jsxs("svg", {
208
+ xmlns: "http://www.w3.org/2000/svg",
209
+ className: cn("absolute -top-1.5 inset-s-0 bottom-0 h-[calc(100%+--spacing(1.5))] -z-1 rtl:-scale-x-100", l1 !== l2 && "h-full bottom-1.5"),
210
+ style: { width: Math.max(l0, l1) + 9 },
211
+ children: [
212
+ l0 !== l1 && /* @__PURE__ */ jsx("path", {
213
+ d: `M ${l0 + .5} 0 C ${l0 + .5} 8 ${l1 + .5} 4 ${l1 + .5} 12`,
214
+ stroke: "black",
215
+ strokeWidth: "1",
216
+ fill: "none",
217
+ className: "stroke-fd-foreground/10"
218
+ }),
219
+ /* @__PURE__ */ jsx("line", {
220
+ x1: l1 + .5,
221
+ y1: l0 === l1 ? "6" : "12",
222
+ x2: l1 + .5,
223
+ y2: "100%",
224
+ strokeWidth: "1",
225
+ className: "stroke-fd-foreground/10"
226
+ }),
227
+ item._step !== void 0 && /* @__PURE__ */ jsxs("g", {
228
+ transform: `translate(${l1 + .5}, ${l1 === l2 ? "3" : "6"})`,
229
+ children: [/* @__PURE__ */ jsx("circle", {
230
+ cx: "0",
231
+ cy: "50%",
232
+ r: "8",
233
+ className: "fill-fd-muted"
234
+ }), /* @__PURE__ */ jsx("text", {
235
+ x: "0",
236
+ y: "50%",
237
+ textAnchor: "middle",
238
+ alignmentBaseline: "central",
239
+ dominantBaseline: "middle",
240
+ className: "fill-fd-muted-foreground font-medium text-xs leading-none font-mono rtl:-scale-x-100",
241
+ children: item._step
242
+ })]
243
+ })
244
+ ]
245
+ })
203
246
  };
204
247
  }, [items, item]);
205
248
  return /* @__PURE__ */ jsxs(Primitive.TOCItem, {
@@ -210,38 +253,7 @@ function TOCItem({ item, ...props }) {
210
253
  paddingInlineStart: getItemOffset(item.depth),
211
254
  ...props.style
212
255
  },
213
- children: [
214
- offset !== upperOffset && /* @__PURE__ */ jsx("svg", {
215
- xmlns: "http://www.w3.org/2000/svg",
216
- viewBox: `${Math.min(offset, upperOffset)} 0 ${Math.abs(upperOffset - offset)} 12`,
217
- className: "absolute -top-1.5 -z-1",
218
- style: {
219
- width: Math.abs(upperOffset - offset) + 1,
220
- height: 12,
221
- insetInlineStart: Math.min(offset, upperOffset)
222
- },
223
- children: /* @__PURE__ */ jsx("path", {
224
- d: `M ${upperOffset} 0 C ${upperOffset} 8 ${offset} 4 ${offset} 12`,
225
- stroke: "black",
226
- strokeWidth: "1",
227
- fill: "none",
228
- className: "stroke-fd-foreground/10"
229
- })
230
- }),
231
- /* @__PURE__ */ jsx("div", {
232
- className: cn("absolute inset-y-0 w-px bg-fd-foreground/10 -z-1", offset !== upperOffset && "top-1.5", offset !== lowerOffset && "bottom-1.5"),
233
- style: { insetInlineStart: offset }
234
- }),
235
- item._step !== void 0 && /* @__PURE__ */ jsx("div", {
236
- className: "absolute flex items-center justify-center -translate-1/2 -z-1 size-4 font-mono font-medium text-xs bg-fd-muted text-fd-muted-foreground rounded-full leading-none",
237
- style: {
238
- top: `calc(50% + ${(isFirst ? -.75 : 0) + (isLast ? .75 : 0)} * var(--spacing))`,
239
- insetInlineStart: offset
240
- },
241
- children: item._step
242
- }),
243
- item.title
244
- ]
256
+ children: [svg, item.title]
245
257
  });
246
258
  }
247
259
  //#endregion
@@ -5,7 +5,7 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
5
5
  declare const buttonVariants: (props?: ({
6
6
  variant?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
7
7
  color?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
8
- size?: "icon" | "sm" | "icon-sm" | "icon-xs" | null | undefined;
8
+ size?: "sm" | "icon" | "icon-sm" | "icon-xs" | null | undefined;
9
9
  } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
10
10
  type ButtonProps = VariantProps<typeof buttonVariants>;
11
11
  //#endregion
@@ -5,7 +5,7 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
5
5
 
6
6
  //#region src/layouts/home/slots/header.d.ts
7
7
  declare const navItemVariants: (props?: ({
8
- variant?: "icon" | "main" | "button" | null | undefined;
8
+ variant?: "icon" | "button" | "main" | null | undefined;
9
9
  } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
10
10
  declare function Header(props: ComponentProps<'header'>): string | number | bigint | true | _$react_jsx_runtime0.JSX.Element | Iterable<_$react.ReactNode> | Promise<string | number | bigint | boolean | _$react.ReactPortal | _$react.ReactElement<unknown, string | _$react.JSXElementConstructor<any>> | Iterable<_$react.ReactNode> | null | undefined>;
11
11
  //#endregion
@@ -1,12 +1,7 @@
1
1
  import React from "react";
2
2
 
3
- //#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.3_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/Controlled.d.ts
4
- declare const enum ModalState {
5
- LOADED = "LOADED",
6
- LOADING = "LOADING",
7
- UNLOADED = "UNLOADED",
8
- UNLOADING = "UNLOADING"
9
- }
3
+ //#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/controlled.d.ts
4
+ type ModalState = 'LOADED' | 'LOADING' | 'UNLOADED' | 'UNLOADING';
10
5
  interface ControlledProps {
11
6
  a11yNameButtonUnzoom?: string;
12
7
  a11yNameButtonZoom?: string;
@@ -1,8 +1,12 @@
1
- import { ICompress, IEnlarge } from "./icons.js";
2
- import { adjustSvgIDs, getImgAlt, getImgSrc, getStyleGhost, getStyleModalImg, testDiv, testImg, testImgLoaded, testSvg } from "./utils.js";
1
+ import { adjustSvgIDs } from "./utils/adjust-svg-ids.js";
2
+ import { testDiv, testImg, testImgLoaded, testSvg } from "./utils/element-tests.js";
3
+ import { getImgAlt } from "./utils/get-img-alt.js";
4
+ import { getImgSrc } from "./utils/get-img-src.js";
5
+ import { getStyleGhost } from "./utils/get-style-ghost.js";
6
+ import { getStyleModalImg } from "./utils/get-style-modal-img.js";
3
7
  import React from "react";
4
8
  import ReactDOM from "react-dom";
5
- //#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.3_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/Controlled.js
9
+ //#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/controlled.js
6
10
  const IMAGE_QUERY = [
7
11
  "img",
8
12
  "svg",
@@ -69,7 +73,6 @@ var ControlledBase = class extends React.Component {
69
73
  } else if (prevModalState !== "UNLOADED" && modalState === "UNLOADED") {
70
74
  this.bodyScrollEnable();
71
75
  window.removeEventListener("resize", this.handleResize);
72
- this.refModalImg.current?.removeEventListener("transitionend", this.handleImgTransitionEnd);
73
76
  this.refDialog.current?.close();
74
77
  }
75
78
  };
@@ -223,7 +226,6 @@ var ControlledBase = class extends React.Component {
223
226
  this.zoom = () => {
224
227
  this.bodyScrollDisable();
225
228
  this.refDialog.current?.showModal();
226
- this.refModalImg.current?.addEventListener("transitionend", this.handleImgTransitionEnd);
227
229
  this.setState({ modalState: "LOADING" });
228
230
  };
229
231
  this.unzoom = () => {
@@ -298,7 +300,7 @@ var ControlledBase = class extends React.Component {
298
300
  };
299
301
  }
300
302
  render() {
301
- const { handleBtnUnzoomClick, handleDialogClick, handleDialogClose, handleUnzoom, handleZoom, imgEl, props: { a11yNameButtonUnzoom, a11yNameButtonZoom, children, classDialog, IconUnzoom, IconZoom, isZoomed, wrapElement: WrapElement, ZoomContent, zoomImg, zoomMargin }, refContent, refDialog, refModalContent, refModalImg, refWrap, state: { id, isZoomImgLoaded, loadedImgEl, modalState, shouldRefresh, styleGhost } } = this;
303
+ const { handleBtnUnzoomClick, handleDialogClick, handleDialogClose, handleUnzoom, handleZoom, imgEl, props: { a11yNameButtonUnzoom, a11yNameButtonZoom, children, classDialog, IconUnzoom, IconZoom, wrapElement: WrapElement, ZoomContent, zoomImg, zoomMargin }, refContent, refDialog, refModalContent, refModalImg, refWrap, state: { id, isZoomImgLoaded, loadedImgEl, modalState, shouldRefresh, styleGhost } } = this;
302
304
  const idModal = `rmiz-modal-${id}`;
303
305
  const idModalImg = `rmiz-modal-img-${id}`;
304
306
  const isDiv = testDiv(imgEl);
@@ -320,7 +322,7 @@ var ControlledBase = class extends React.Component {
320
322
  hasZoomImg,
321
323
  imgSrc,
322
324
  isSvg,
323
- isZoomed: isZoomed && isModalActive,
325
+ isZoomed: isModalActive,
324
326
  loadedImgEl,
325
327
  offset: zoomMargin,
326
328
  shouldRefresh,
@@ -338,11 +340,13 @@ var ControlledBase = class extends React.Component {
338
340
  "data-rmiz-modal-img": "",
339
341
  height: this.styleModalImg.height ?? void 0,
340
342
  id: idModalImg,
343
+ onTransitionEnd: this.handleImgTransitionEnd,
341
344
  ref: refModalImg,
342
345
  style: this.styleModalImg,
343
346
  width: this.styleModalImg.width ?? void 0
344
347
  }) : isSvg ? React.createElement("div", {
345
348
  "data-rmiz-modal-img": true,
349
+ onTransitionEnd: this.handleImgTransitionEnd,
346
350
  ref: refModalImg,
347
351
  style: this.styleModalImg
348
352
  }) : null;
@@ -405,7 +409,7 @@ var ControlledBase = class extends React.Component {
405
409
  this.imgElResizeObserver?.disconnect();
406
410
  this.imgEl?.removeEventListener("load", this.handleImgLoad);
407
411
  this.imgEl?.removeEventListener("click", this.handleZoom);
408
- this.refModalImg.current?.removeEventListener("transitionend", this.handleImgTransitionEnd);
412
+ clearTimeout(this.timeoutTransitionEnd);
409
413
  window.removeEventListener("wheel", this.handleWheel);
410
414
  window.removeEventListener("touchstart", this.handleTouchStart);
411
415
  window.removeEventListener("touchmove", this.handleTouchMove);
@@ -431,5 +435,25 @@ ControlledBase.defaultProps = {
431
435
  wrapElement: "div",
432
436
  zoomMargin: 0
433
437
  };
438
+ function ICompress() {
439
+ return React.createElement("svg", {
440
+ "aria-hidden": "true",
441
+ "data-rmiz-btn-unzoom-icon": true,
442
+ fill: "currentColor",
443
+ focusable: "false",
444
+ viewBox: "0 0 16 16",
445
+ xmlns: "http://www.w3.org/2000/svg"
446
+ }, React.createElement("path", { d: "M 14.144531 1.148438 L 9 6.292969 L 9 3 L 8 3 L 8 8 L 13 8 L 13 7 L 9.707031 7 L 14.855469 1.851563 Z M 8 8 L 3 8 L 3 9 L 6.292969 9 L 1.148438 14.144531 L 1.851563 14.855469 L 7 9.707031 L 7 13 L 8 13 Z" }));
447
+ }
448
+ function IEnlarge() {
449
+ return React.createElement("svg", {
450
+ "aria-hidden": "true",
451
+ "data-rmiz-btn-zoom-icon": true,
452
+ fill: "currentColor",
453
+ focusable: "false",
454
+ viewBox: "0 0 16 16",
455
+ xmlns: "http://www.w3.org/2000/svg"
456
+ }, React.createElement("path", { d: "M 9 1 L 9 2 L 12.292969 2 L 2 12.292969 L 2 9 L 1 9 L 1 14 L 6 14 L 6 13 L 2.707031 13 L 13 2.707031 L 13 6 L 14 6 L 14 1 Z" }));
457
+ }
434
458
  //#endregion
435
459
  export { Controlled };
@@ -0,0 +1,2 @@
1
+ import { ControlledProps } from "./controlled.js";
2
+ import { UncontrolledProps } from "./uncontrolled.js";
@@ -0,0 +1,7 @@
1
+ import { ControlledProps } from "./controlled.js";
2
+ import React from "react";
3
+
4
+ //#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/uncontrolled.d.ts
5
+ type UncontrolledProps = Omit<ControlledProps, 'isZoomed'>;
6
+ //#endregion
7
+ export { UncontrolledProps };
@@ -1,6 +1,6 @@
1
- import { Controlled } from "./Controlled.js";
1
+ import { Controlled } from "./controlled.js";
2
2
  import React from "react";
3
- //#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.3_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/Uncontrolled.js
3
+ //#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/uncontrolled.js
4
4
  function Uncontrolled({ onZoomChange, ...props }) {
5
5
  const [isZoomed, setIsZoomed] = React.useState(false);
6
6
  const handleZoomChange = React.useCallback((value, { event }) => {
@@ -0,0 +1,53 @@
1
+ //#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/adjust-svg-ids.js
2
+ const adjustSvgIDs = (svgEl) => {
3
+ const newIdSuffix = "-zoom";
4
+ const attrs = [
5
+ "clip-path",
6
+ "fill",
7
+ "mask",
8
+ "marker-start",
9
+ "marker-mid",
10
+ "marker-end"
11
+ ];
12
+ const idMap = /* @__PURE__ */ new Map();
13
+ if (svgEl.hasAttribute("id")) {
14
+ const { id: oldId } = svgEl;
15
+ const newId = oldId + newIdSuffix;
16
+ idMap.set(oldId, newId);
17
+ const svgNode = svgEl;
18
+ svgNode.id = newId;
19
+ }
20
+ svgEl.querySelectorAll("[id]").forEach((el) => {
21
+ const { id: oldId } = el;
22
+ const newId = oldId + newIdSuffix;
23
+ idMap.set(oldId, newId);
24
+ const node = el;
25
+ node.id = newId;
26
+ });
27
+ const urlAttrSelector = attrs.map((attr) => `[${attr}]`).join(", ");
28
+ svgEl.querySelectorAll(urlAttrSelector).forEach((el) => {
29
+ for (const attr of attrs) {
30
+ const val = el.getAttribute(attr);
31
+ if (val?.startsWith("url(#") === true) {
32
+ const oldId = val.slice(5, -1);
33
+ const newId = idMap.get(oldId);
34
+ if (newId !== void 0) el.setAttribute(attr, `url(#${newId})`);
35
+ }
36
+ }
37
+ });
38
+ svgEl.querySelectorAll("style").forEach((styleEl) => {
39
+ const { textContent } = styleEl;
40
+ if (textContent !== "") {
41
+ let updated = textContent;
42
+ idMap.forEach((newId, oldId) => {
43
+ updated = updated.replaceAll(`#${oldId}`, `#${newId}`);
44
+ });
45
+ if (updated !== textContent) {
46
+ const styleNode = styleEl;
47
+ styleNode.textContent = updated;
48
+ }
49
+ }
50
+ });
51
+ };
52
+ //#endregion
53
+ export { adjustSvgIDs };
@@ -0,0 +1,25 @@
1
+ import { getScale } from "./get-scale.js";
2
+ import { parsePosition } from "./parse-position.js";
3
+ //#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/compute-positioned-style.js
4
+ const computePositionedStyle = ({ containerHeight, containerLeft, containerTop, containerWidth, hasScalableSrc, offset, position, targetHeight, targetWidth, visibleHeight, visibleWidth }) => {
5
+ const [posLeft = "50%", posTop = "50%"] = position.split(" ");
6
+ const posX = parsePosition(posLeft, containerWidth - visibleWidth);
7
+ const posY = parsePosition(posTop, containerHeight - visibleHeight);
8
+ const scale = getScale({
9
+ containerHeight: visibleHeight,
10
+ containerWidth: visibleWidth,
11
+ hasScalableSrc,
12
+ offset,
13
+ targetHeight,
14
+ targetWidth
15
+ });
16
+ return {
17
+ top: containerTop + posY,
18
+ left: containerLeft + posX,
19
+ width: visibleWidth * scale,
20
+ height: visibleHeight * scale,
21
+ initialTransform: `translate(0,0) scale(${1 / scale})`
22
+ };
23
+ };
24
+ //#endregion
25
+ export { computePositionedStyle };
@@ -0,0 +1,12 @@
1
+ //#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/element-tests.js
2
+ function isElement(el) {
3
+ if (typeof Element === "undefined") return false;
4
+ return el instanceof Element;
5
+ }
6
+ const testElType = (type, el) => isElement(el) && el.tagName.toUpperCase() === type;
7
+ const testDiv = (el) => testElType("DIV", el) || testElType("SPAN", el);
8
+ const testImg = (el) => testElType("IMG", el);
9
+ const testImgLoaded = (el) => el.complete && el.naturalHeight !== 0;
10
+ const testSvg = (el) => testElType("SVG", el);
11
+ //#endregion
12
+ export { testDiv, testImg, testImgLoaded, testSvg };
@@ -0,0 +1,45 @@
1
+ import { parsePosition } from "./parse-position.js";
2
+ import { computePositionedStyle } from "./compute-positioned-style.js";
3
+ //#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/get-div-img-style.js
4
+ const getDivImgStyle = ({ backgroundPosition, backgroundSize, containerHeight, containerLeft, containerTop, containerWidth, hasScalableSrc, offset, targetHeight, targetWidth }) => {
5
+ const base = {
6
+ containerHeight,
7
+ containerLeft,
8
+ containerTop,
9
+ containerWidth,
10
+ hasScalableSrc,
11
+ offset,
12
+ position: backgroundPosition,
13
+ targetHeight,
14
+ targetWidth
15
+ };
16
+ if (backgroundSize === "cover" || backgroundSize === "contain") {
17
+ const widthRatio = containerWidth / targetWidth;
18
+ const heightRatio = containerHeight / targetHeight;
19
+ const ratio = backgroundSize === "cover" ? Math.max(widthRatio, heightRatio) : Math.min(widthRatio, heightRatio);
20
+ return computePositionedStyle({
21
+ ...base,
22
+ visibleWidth: targetWidth * ratio,
23
+ visibleHeight: targetHeight * ratio
24
+ });
25
+ } else if (backgroundSize === "auto") return computePositionedStyle({
26
+ ...base,
27
+ visibleWidth: targetWidth,
28
+ visibleHeight: targetHeight
29
+ });
30
+ else {
31
+ const [sizeW = "50%", sizeH = "50%"] = backgroundSize.split(" ");
32
+ const sizeWidth = parsePosition(sizeW, containerWidth);
33
+ const sizeHeight = parsePosition(sizeH, containerHeight);
34
+ const widthRatio = sizeWidth / targetWidth;
35
+ const heightRatio = sizeHeight / targetHeight;
36
+ const ratio = Math.min(widthRatio, heightRatio);
37
+ return computePositionedStyle({
38
+ ...base,
39
+ visibleWidth: targetWidth * ratio,
40
+ visibleHeight: targetHeight * ratio
41
+ });
42
+ }
43
+ };
44
+ //#endregion
45
+ export { getDivImgStyle };
@@ -0,0 +1,8 @@
1
+ import { testImg } from "./element-tests.js";
2
+ //#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-medium-image-zoom/dist/utils/get-img-alt.js
3
+ const getImgAlt = (imgEl) => {
4
+ if (imgEl !== null) if (testImg(imgEl)) return imgEl.alt;
5
+ else return imgEl.getAttribute("aria-label") ?? void 0;
6
+ };
7
+ //#endregion
8
+ export { getImgAlt };