@expcat/tigercat-react 2.1.3 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -19
- package/dist/{chunk-65CDWNRJ.mjs → chunk-2IOF3EC7.mjs} +1 -1
- package/dist/{chunk-5I7FKHZO.mjs → chunk-2MKDIXBP.mjs} +1 -1
- package/dist/chunk-2MV3F7WP.mjs +56 -0
- package/dist/{chunk-WLCRBIZO.mjs → chunk-2W4SH2IG.mjs} +1 -1
- package/dist/{chunk-YLXEMZVI.mjs → chunk-3C62ULJT.mjs} +1 -1
- package/dist/{chunk-6IJFLGCN.mjs → chunk-3QXXNK5X.mjs} +1 -1
- package/dist/{chunk-KVXGNUIE.mjs → chunk-4IVRLBKW.mjs} +1 -1
- package/dist/{chunk-YCVORYEO.mjs → chunk-532OVXLV.mjs} +3 -1
- package/dist/{chunk-R7J37DKJ.mjs → chunk-5TQFSORK.mjs} +2 -2
- package/dist/{chunk-ZATZSMQY.mjs → chunk-6L7RWLOU.mjs} +1 -1
- package/dist/{chunk-T5VXIYWF.mjs → chunk-6T5AEQJV.mjs} +2 -2
- package/dist/{chunk-R2VBVZIH.mjs → chunk-75SQCTLC.mjs} +4 -4
- package/dist/{chunk-U7V7ZWJ6.mjs → chunk-7QM2ZC52.mjs} +1 -1
- package/dist/{chunk-M7TSPEXC.mjs → chunk-A2PQJEII.mjs} +1 -1
- package/dist/{chunk-5P3OFNH3.mjs → chunk-ACHXTII7.mjs} +1 -1
- package/dist/{chunk-EJY3Y2XU.mjs → chunk-AHQR57Z4.mjs} +2 -2
- package/dist/{chunk-2N6WZ5Z5.mjs → chunk-BNC4MMVG.mjs} +1 -1
- package/dist/{chunk-I4P4T6LL.mjs → chunk-BVSR27AF.mjs} +1 -1
- package/dist/{chunk-2STETY2J.mjs → chunk-CCFKRKGJ.mjs} +12 -6
- package/dist/{chunk-N53N6H54.mjs → chunk-CQGDJU2H.mjs} +2 -2
- package/dist/{chunk-GRB667BG.mjs → chunk-DDSY5FPV.mjs} +1 -1
- package/dist/{chunk-OIMP63RE.mjs → chunk-DJLVNYZD.mjs} +1 -1
- package/dist/{chunk-HZGTQGSM.mjs → chunk-DNRLMEKE.mjs} +11 -4
- package/dist/{chunk-PZ4LAI6G.mjs → chunk-EK7R3MIN.mjs} +1 -1
- package/dist/{chunk-RTKPLZ5A.mjs → chunk-EVO4YVSD.mjs} +1 -1
- package/dist/chunk-F4XF5CGQ.mjs +72 -0
- package/dist/{chunk-GMHJWSQB.mjs → chunk-FTLA6FRU.mjs} +2 -2
- package/dist/chunk-FZQUUTWN.mjs +145 -0
- package/dist/{chunk-AFVKH2Z3.mjs → chunk-G4Y25JES.mjs} +1 -1
- package/dist/{chunk-CJSB5NOK.mjs → chunk-H3UEVWOO.mjs} +1 -1
- package/dist/{chunk-CX7QZXU5.mjs → chunk-HEVB53MU.mjs} +1 -1
- package/dist/{chunk-5QTYD4XG.mjs → chunk-HKPRHDW4.mjs} +1 -1
- package/dist/{chunk-7KVHHNUI.mjs → chunk-ION7IDAW.mjs} +1 -1
- package/dist/{chunk-CCTBNDCX.mjs → chunk-IWXG4346.mjs} +1 -1
- package/dist/{chunk-WW6MFKTJ.mjs → chunk-IXMQQ6PV.mjs} +3 -3
- package/dist/{chunk-IPI45RUK.mjs → chunk-JX2WKSVM.mjs} +1 -1
- package/dist/{chunk-PTKQJPLM.mjs → chunk-KDXNJN6C.mjs} +1 -1
- package/dist/{chunk-WKZZ4IQK.mjs → chunk-KEFHL7CJ.mjs} +1 -1
- package/dist/{chunk-XBDLXTF7.mjs → chunk-KJHPPPB2.mjs} +1 -1
- package/dist/{chunk-PLEAZRIC.mjs → chunk-LKTM4NU4.mjs} +1 -1
- package/dist/{chunk-2FFAUB47.mjs → chunk-MF6LOOXR.mjs} +2 -2
- package/dist/{chunk-KJB2OIG7.mjs → chunk-MMDVFCCL.mjs} +3 -3
- package/dist/{chunk-25BKSXTX.mjs → chunk-NMRCBGFP.mjs} +1 -1
- package/dist/{chunk-NPGU6VYD.mjs → chunk-OU2AV7DY.mjs} +1 -1
- package/dist/{chunk-6D2VLITE.mjs → chunk-OZ4WH3GE.mjs} +1 -1
- package/dist/{chunk-A6PNUVY6.mjs → chunk-PBF5TEF4.mjs} +2 -2
- package/dist/{chunk-JML6CK44.mjs → chunk-PQPO7XSV.mjs} +1 -1
- package/dist/{chunk-TVVLCER6.mjs → chunk-QCRTRRBD.mjs} +179 -163
- package/dist/chunk-REHHFHZ3.mjs +67 -0
- package/dist/{chunk-XI6KQAHW.mjs → chunk-RJ2FJXHT.mjs} +5 -6
- package/dist/{chunk-XKB7ECPU.mjs → chunk-S37KEELR.mjs} +1 -1
- package/dist/{chunk-RNKUEEIX.mjs → chunk-S5GHNXGQ.mjs} +4 -4
- package/dist/{chunk-OES5DL3S.mjs → chunk-SCN6UULA.mjs} +1 -1
- package/dist/{chunk-OYQ6HTLQ.mjs → chunk-SGKPZW57.mjs} +1 -1
- package/dist/{chunk-WN6ZHQTI.mjs → chunk-SIBNSFVR.mjs} +10 -4
- package/dist/{chunk-C4UZFBFV.mjs → chunk-SOVB7HJF.mjs} +1 -1
- package/dist/{chunk-3WP4PGHF.mjs → chunk-TFHQODGK.mjs} +7 -1
- package/dist/{chunk-IR45LOEZ.mjs → chunk-UGKTSPS4.mjs} +38 -4
- package/dist/{chunk-GJRGMIB3.mjs → chunk-UVI5JN47.mjs} +1 -1
- package/dist/{chunk-UAFA5GOL.mjs → chunk-VE3PZFFT.mjs} +2 -1
- package/dist/{chunk-XXU5VQV5.mjs → chunk-VGWFHVJ7.mjs} +1 -1
- package/dist/{chunk-BNCUJLRV.mjs → chunk-VW6RNQK4.mjs} +1 -1
- package/dist/{chunk-IZC77KAN.mjs → chunk-WWDZAWTS.mjs} +1 -1
- package/dist/{chunk-ZGXC47M5.mjs → chunk-YDIEWFBM.mjs} +1 -1
- package/dist/{chunk-53RDSFKZ.mjs → chunk-YUFKPLCK.mjs} +1 -1
- package/dist/{chunk-WSN4Z4MC.mjs → chunk-Z3AD5DZX.mjs} +1 -1
- package/dist/{chunk-6NCG4SLX.mjs → chunk-ZZJVJUO4.mjs} +1 -1
- package/dist/components/ActivityFeed.mjs +4 -4
- package/dist/components/Anchor.mjs +1 -1
- package/dist/components/AreaChart.mjs +3 -3
- package/dist/components/AutoComplete.mjs +2 -2
- package/dist/components/BackTop.mjs +1 -1
- package/dist/components/BarChart.mjs +3 -3
- package/dist/components/Calendar.mjs +1 -1
- package/dist/components/Cascader.mjs +2 -2
- package/dist/components/ChartTooltip.mjs +2 -2
- package/dist/components/Code.mjs +1 -1
- package/dist/components/ColorPicker.mjs +2 -2
- package/dist/components/CommentThread.mjs +2 -2
- package/dist/components/ContextMenu.mjs +2 -2
- package/dist/components/CropUpload.mjs +4 -4
- package/dist/components/DataExport.mjs +3 -3
- package/dist/components/DataTableWithToolbar.mjs +7 -7
- package/dist/components/DatePicker.mjs +3 -3
- package/dist/components/DonutChart.mjs +4 -4
- package/dist/components/Drag.d.mts +17 -0
- package/dist/components/Drag.mjs +9 -0
- package/dist/components/Drawer.mjs +2 -2
- package/dist/components/Dropdown.mjs +2 -2
- package/dist/components/FloatButton.mjs +2 -2
- package/dist/components/Footer.mjs +1 -1
- package/dist/components/FormItem.mjs +2 -2
- package/dist/components/FullscreenButton.d.mts +8 -0
- package/dist/components/FullscreenButton.mjs +10 -0
- package/dist/components/FunnelChart.mjs +3 -3
- package/dist/components/GaugeChart.mjs +3 -3
- package/dist/components/HeatmapChart.mjs +3 -3
- package/dist/components/Image.mjs +5 -5
- package/dist/components/ImageCropper.mjs +1 -1
- package/dist/components/ImageGroup.mjs +3 -3
- package/dist/components/ImagePreview.mjs +2 -2
- package/dist/components/ImageViewer.mjs +3 -3
- package/dist/components/LineChart.mjs +3 -3
- package/dist/components/List.mjs +3 -3
- package/dist/components/Loading.mjs +2 -2
- package/dist/components/Mentions.mjs +2 -2
- package/dist/components/Menu.mjs +2 -2
- package/dist/components/Message.mjs +2 -2
- package/dist/components/MessageContainer.mjs +2 -2
- package/dist/components/MessageRoot.mjs +1 -1
- package/dist/components/Modal.mjs +2 -2
- package/dist/components/NavigationMenu.mjs +2 -2
- package/dist/components/Notification.mjs +2 -2
- package/dist/components/NotificationCenter.mjs +5 -5
- package/dist/components/NotificationContainer.mjs +2 -2
- package/dist/components/NotificationRoot.mjs +1 -1
- package/dist/components/NumberKeyboard.mjs +2 -2
- package/dist/components/PieChart.mjs +3 -3
- package/dist/components/Popconfirm.mjs +3 -3
- package/dist/components/Popover.mjs +3 -3
- package/dist/components/RadarChart.mjs +3 -3
- package/dist/components/Rate.mjs +1 -1
- package/dist/components/ScatterChart.mjs +3 -3
- package/dist/components/ScrollSpy.mjs +1 -1
- package/dist/components/Select.mjs +2 -2
- package/dist/components/Slider.mjs +1 -1
- package/dist/components/SplitButton.mjs +3 -3
- package/dist/components/Spotlight.mjs +2 -2
- package/dist/components/SunburstChart.mjs +3 -3
- package/dist/components/Table.mjs +4 -4
- package/dist/components/Text.d.mts +5 -1
- package/dist/components/Text.mjs +2 -1
- package/dist/components/TimePicker.mjs +2 -2
- package/dist/components/Tooltip.mjs +3 -3
- package/dist/components/Tour.mjs +2 -2
- package/dist/components/TreeMapChart.mjs +3 -3
- package/dist/components/TreeSelect.mjs +2 -2
- package/dist/components/Upload.mjs +3 -3
- package/dist/hooks/useFullscreen.d.mts +13 -0
- package/dist/hooks/useFullscreen.mjs +6 -0
- package/dist/index.d.mts +5 -2
- package/dist/index.mjs +43 -0
- package/package.json +17 -2
- package/dist/chunk-VDBLI5Y3.mjs +0 -33
- /package/dist/{chunk-HHRU7TK3.mjs → chunk-GF7W2FTZ.mjs} +0 -0
- /package/dist/{chunk-XJHC6JEC.mjs → chunk-P44HJQNB.mjs} +0 -0
|
@@ -33,6 +33,9 @@ import {
|
|
|
33
33
|
getImageEditorLabels,
|
|
34
34
|
getInitialCropRect,
|
|
35
35
|
imageCropperContainerClasses,
|
|
36
|
+
imageCropperSizeHostClasses,
|
|
37
|
+
planCropperDisplaySize,
|
|
38
|
+
resolveCropperAvailableSize,
|
|
36
39
|
imageCropperDragAreaClasses,
|
|
37
40
|
imageCropperFrameClasses,
|
|
38
41
|
imageCropperGuideClasses,
|
|
@@ -127,10 +130,12 @@ var ImageCropper = forwardRef(
|
|
|
127
130
|
const defaultCropRectRef = useRef(defaultCropRect);
|
|
128
131
|
const onReadyRef = useRef(onReady);
|
|
129
132
|
const onErrorRef = useRef(onError);
|
|
133
|
+
const styleRef = useRef(style);
|
|
130
134
|
aspectRef.current = aspectRatio;
|
|
131
135
|
defaultCropRectRef.current = defaultCropRect;
|
|
132
136
|
onReadyRef.current = onReady;
|
|
133
137
|
onErrorRef.current = onError;
|
|
138
|
+
styleRef.current = style;
|
|
134
139
|
const [status, setStatus] = useState("loading");
|
|
135
140
|
const [displayWidth, setDisplayWidth] = useState(0);
|
|
136
141
|
const [displayHeight, setDisplayHeight] = useState(0);
|
|
@@ -160,12 +165,12 @@ var ImageCropper = forwardRef(
|
|
|
160
165
|
loader.load(src, {
|
|
161
166
|
onLoad: (img, naturalWidth, naturalHeight) => {
|
|
162
167
|
const container = containerRef.current;
|
|
163
|
-
const
|
|
164
|
-
naturalWidth,
|
|
165
|
-
naturalHeight,
|
|
168
|
+
const box = resolveCropperAvailableSize(
|
|
166
169
|
container?.clientWidth ?? 0,
|
|
167
|
-
container?.clientHeight ?? 0
|
|
170
|
+
container?.clientHeight ?? 0,
|
|
171
|
+
styleRef.current
|
|
168
172
|
);
|
|
173
|
+
const size = getCropperDisplaySize(naturalWidth, naturalHeight, box.width, box.height);
|
|
169
174
|
if (!size) {
|
|
170
175
|
setStatus("error");
|
|
171
176
|
onErrorRef.current?.(new Error("Image not loaded"));
|
|
@@ -205,15 +210,21 @@ var ImageCropper = forwardRef(
|
|
|
205
210
|
if (!container || status !== "ready" || typeof ResizeObserver === "undefined") return;
|
|
206
211
|
const observer = new ResizeObserver(() => {
|
|
207
212
|
const natural = naturalSizeRef.current;
|
|
208
|
-
const
|
|
213
|
+
const box = resolveCropperAvailableSize(
|
|
214
|
+
container.clientWidth,
|
|
215
|
+
container.clientHeight,
|
|
216
|
+
styleRef.current
|
|
217
|
+
);
|
|
218
|
+
const current = displayDimsRef.current;
|
|
219
|
+
const next = planCropperDisplaySize(
|
|
209
220
|
natural.w,
|
|
210
221
|
natural.h,
|
|
211
|
-
|
|
212
|
-
|
|
222
|
+
box.width,
|
|
223
|
+
box.height,
|
|
224
|
+
current.w,
|
|
225
|
+
current.h
|
|
213
226
|
);
|
|
214
227
|
if (!next) return;
|
|
215
|
-
const current = displayDimsRef.current;
|
|
216
|
-
if (next.width === current.w && next.height === current.h) return;
|
|
217
228
|
setCropRect(
|
|
218
229
|
(prev) => remapCropRect(
|
|
219
230
|
prev,
|
|
@@ -340,13 +351,10 @@ var ImageCropper = forwardRef(
|
|
|
340
351
|
},
|
|
341
352
|
[cropRect, setCropRect]
|
|
342
353
|
);
|
|
343
|
-
const containerClasses = classNames(
|
|
354
|
+
const containerClasses = classNames(imageCropperSizeHostClasses, className);
|
|
344
355
|
const rootStyle = { ...style };
|
|
345
356
|
if (status === "loading" || status === "error") {
|
|
346
357
|
if (rootStyle.minHeight == null) rootStyle.minHeight = 200;
|
|
347
|
-
} else {
|
|
348
|
-
if (rootStyle.width == null) rootStyle.width = displayWidth;
|
|
349
|
-
if (rootStyle.height == null) rootStyle.height = displayHeight;
|
|
350
358
|
}
|
|
351
359
|
if (status !== "ready") {
|
|
352
360
|
return /* @__PURE__ */ jsx(
|
|
@@ -354,7 +362,7 @@ var ImageCropper = forwardRef(
|
|
|
354
362
|
{
|
|
355
363
|
...rest,
|
|
356
364
|
ref: containerRef,
|
|
357
|
-
className: classNames(containerClasses, "
|
|
365
|
+
className: classNames(containerClasses, "items-center"),
|
|
358
366
|
style: rootStyle,
|
|
359
367
|
"data-image-cropper": "",
|
|
360
368
|
"data-image-cropper-status": status,
|
|
@@ -365,7 +373,7 @@ var ImageCropper = forwardRef(
|
|
|
365
373
|
);
|
|
366
374
|
}
|
|
367
375
|
const cr = cropRect;
|
|
368
|
-
return /* @__PURE__ */
|
|
376
|
+
return /* @__PURE__ */ jsx(
|
|
369
377
|
"div",
|
|
370
378
|
{
|
|
371
379
|
...rest,
|
|
@@ -374,161 +382,169 @@ var ImageCropper = forwardRef(
|
|
|
374
382
|
style: rootStyle,
|
|
375
383
|
"data-image-cropper": "",
|
|
376
384
|
"data-image-cropper-status": "ready",
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
385
|
+
children: /* @__PURE__ */ jsxs(
|
|
386
|
+
"div",
|
|
387
|
+
{
|
|
388
|
+
className: imageCropperContainerClasses,
|
|
389
|
+
style: { width: displayWidth, height: displayHeight },
|
|
390
|
+
"data-image-cropper-stage": "",
|
|
391
|
+
role: "group",
|
|
392
|
+
"aria-label": labels.cropperDialogAriaLabel,
|
|
393
|
+
children: [
|
|
394
|
+
/* @__PURE__ */ jsxs(
|
|
395
|
+
"div",
|
|
396
|
+
{
|
|
397
|
+
className: imageCropperFrameClasses,
|
|
398
|
+
style: { width: displayWidth, height: displayHeight },
|
|
399
|
+
children: [
|
|
400
|
+
/* @__PURE__ */ jsx(
|
|
401
|
+
"img",
|
|
402
|
+
{
|
|
403
|
+
src,
|
|
404
|
+
className: imageCropperImgClasses,
|
|
405
|
+
style: { width: displayWidth, height: displayHeight },
|
|
406
|
+
draggable: false,
|
|
407
|
+
alt: labels.imageToCropAriaLabel
|
|
408
|
+
}
|
|
409
|
+
),
|
|
410
|
+
/* @__PURE__ */ jsxs(
|
|
411
|
+
"svg",
|
|
412
|
+
{
|
|
413
|
+
className: imageCropperMaskClasses,
|
|
414
|
+
width: displayWidth,
|
|
415
|
+
height: displayHeight,
|
|
416
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
417
|
+
children: [
|
|
418
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsxs("mask", { id: maskId, children: [
|
|
419
|
+
/* @__PURE__ */ jsx("rect", { width: displayWidth, height: displayHeight, fill: "white" }),
|
|
420
|
+
/* @__PURE__ */ jsx("rect", { x: cr.x, y: cr.y, width: cr.width, height: cr.height, fill: "black" })
|
|
421
|
+
] }) }),
|
|
422
|
+
/* @__PURE__ */ jsx(
|
|
423
|
+
"rect",
|
|
424
|
+
{
|
|
425
|
+
width: displayWidth,
|
|
426
|
+
height: displayHeight,
|
|
427
|
+
fill: IMAGE_CROPPER_MASK_FILL,
|
|
428
|
+
mask: `url(#${maskId})`
|
|
429
|
+
}
|
|
430
|
+
)
|
|
431
|
+
]
|
|
432
|
+
}
|
|
433
|
+
)
|
|
434
|
+
]
|
|
435
|
+
}
|
|
436
|
+
),
|
|
437
|
+
/* @__PURE__ */ jsx(
|
|
438
|
+
"div",
|
|
439
|
+
{
|
|
440
|
+
className: imageCropperSelectionClasses,
|
|
441
|
+
style: {
|
|
442
|
+
left: cr.x,
|
|
443
|
+
top: cr.y,
|
|
444
|
+
width: cr.width,
|
|
445
|
+
height: cr.height
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
),
|
|
449
|
+
/* @__PURE__ */ jsx(
|
|
450
|
+
"div",
|
|
451
|
+
{
|
|
452
|
+
className: imageCropperDragAreaClasses,
|
|
453
|
+
style: {
|
|
454
|
+
left: cr.x,
|
|
455
|
+
top: cr.y,
|
|
456
|
+
width: cr.width,
|
|
457
|
+
height: cr.height
|
|
458
|
+
},
|
|
459
|
+
"data-crop-move": "",
|
|
460
|
+
role: "button",
|
|
461
|
+
tabIndex: 0,
|
|
462
|
+
"aria-label": labels.moveCropAreaAriaLabel,
|
|
463
|
+
onPointerDown: (event) => startDrag(event, "move"),
|
|
464
|
+
onKeyDown: handleMoveKeyDown
|
|
465
|
+
}
|
|
466
|
+
),
|
|
467
|
+
guides && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
468
|
+
/* @__PURE__ */ jsx(
|
|
469
|
+
"div",
|
|
470
|
+
{
|
|
471
|
+
className: imageCropperGuideClasses,
|
|
472
|
+
"data-guide": "true",
|
|
473
|
+
style: {
|
|
474
|
+
left: cr.x,
|
|
475
|
+
top: cr.y + cr.height / 3,
|
|
476
|
+
width: cr.width,
|
|
477
|
+
height: 0,
|
|
478
|
+
borderTopWidth: 1,
|
|
479
|
+
borderTopStyle: "dashed"
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
),
|
|
483
|
+
/* @__PURE__ */ jsx(
|
|
484
|
+
"div",
|
|
485
|
+
{
|
|
486
|
+
className: imageCropperGuideClasses,
|
|
487
|
+
"data-guide": "true",
|
|
488
|
+
style: {
|
|
489
|
+
left: cr.x,
|
|
490
|
+
top: cr.y + cr.height * 2 / 3,
|
|
491
|
+
width: cr.width,
|
|
492
|
+
height: 0,
|
|
493
|
+
borderTopWidth: 1,
|
|
494
|
+
borderTopStyle: "dashed"
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
),
|
|
386
498
|
/* @__PURE__ */ jsx(
|
|
387
|
-
"
|
|
499
|
+
"div",
|
|
388
500
|
{
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
style: {
|
|
392
|
-
|
|
393
|
-
|
|
501
|
+
className: imageCropperGuideClasses,
|
|
502
|
+
"data-guide": "true",
|
|
503
|
+
style: {
|
|
504
|
+
left: cr.x + cr.width / 3,
|
|
505
|
+
top: cr.y,
|
|
506
|
+
width: 0,
|
|
507
|
+
height: cr.height,
|
|
508
|
+
borderLeftWidth: 1,
|
|
509
|
+
borderLeftStyle: "dashed"
|
|
510
|
+
}
|
|
394
511
|
}
|
|
395
512
|
),
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
"
|
|
513
|
+
/* @__PURE__ */ jsx(
|
|
514
|
+
"div",
|
|
398
515
|
{
|
|
399
|
-
className:
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
"rect",
|
|
410
|
-
{
|
|
411
|
-
width: displayWidth,
|
|
412
|
-
height: displayHeight,
|
|
413
|
-
fill: IMAGE_CROPPER_MASK_FILL,
|
|
414
|
-
mask: `url(#${maskId})`
|
|
415
|
-
}
|
|
416
|
-
)
|
|
417
|
-
]
|
|
516
|
+
className: imageCropperGuideClasses,
|
|
517
|
+
"data-guide": "true",
|
|
518
|
+
style: {
|
|
519
|
+
left: cr.x + cr.width * 2 / 3,
|
|
520
|
+
top: cr.y,
|
|
521
|
+
width: 0,
|
|
522
|
+
height: cr.height,
|
|
523
|
+
borderLeftWidth: 1,
|
|
524
|
+
borderLeftStyle: "dashed"
|
|
525
|
+
}
|
|
418
526
|
}
|
|
419
527
|
)
|
|
420
|
-
]
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
left: cr.x,
|
|
441
|
-
top: cr.y,
|
|
442
|
-
width: cr.width,
|
|
443
|
-
height: cr.height
|
|
444
|
-
},
|
|
445
|
-
"data-crop-move": "",
|
|
446
|
-
role: "button",
|
|
447
|
-
tabIndex: 0,
|
|
448
|
-
"aria-label": labels.moveCropAreaAriaLabel,
|
|
449
|
-
onPointerDown: (event) => startDrag(event, "move"),
|
|
450
|
-
onKeyDown: handleMoveKeyDown
|
|
451
|
-
}
|
|
452
|
-
),
|
|
453
|
-
guides && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
454
|
-
/* @__PURE__ */ jsx(
|
|
455
|
-
"div",
|
|
456
|
-
{
|
|
457
|
-
className: imageCropperGuideClasses,
|
|
458
|
-
"data-guide": "true",
|
|
459
|
-
style: {
|
|
460
|
-
left: cr.x,
|
|
461
|
-
top: cr.y + cr.height / 3,
|
|
462
|
-
width: cr.width,
|
|
463
|
-
height: 0,
|
|
464
|
-
borderTopWidth: 1,
|
|
465
|
-
borderTopStyle: "dashed"
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
),
|
|
469
|
-
/* @__PURE__ */ jsx(
|
|
470
|
-
"div",
|
|
471
|
-
{
|
|
472
|
-
className: imageCropperGuideClasses,
|
|
473
|
-
"data-guide": "true",
|
|
474
|
-
style: {
|
|
475
|
-
left: cr.x,
|
|
476
|
-
top: cr.y + cr.height * 2 / 3,
|
|
477
|
-
width: cr.width,
|
|
478
|
-
height: 0,
|
|
479
|
-
borderTopWidth: 1,
|
|
480
|
-
borderTopStyle: "dashed"
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
),
|
|
484
|
-
/* @__PURE__ */ jsx(
|
|
485
|
-
"div",
|
|
486
|
-
{
|
|
487
|
-
className: imageCropperGuideClasses,
|
|
488
|
-
"data-guide": "true",
|
|
489
|
-
style: {
|
|
490
|
-
left: cr.x + cr.width / 3,
|
|
491
|
-
top: cr.y,
|
|
492
|
-
width: 0,
|
|
493
|
-
height: cr.height,
|
|
494
|
-
borderLeftWidth: 1,
|
|
495
|
-
borderLeftStyle: "dashed"
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
),
|
|
499
|
-
/* @__PURE__ */ jsx(
|
|
500
|
-
"div",
|
|
501
|
-
{
|
|
502
|
-
className: imageCropperGuideClasses,
|
|
503
|
-
"data-guide": "true",
|
|
504
|
-
style: {
|
|
505
|
-
left: cr.x + cr.width * 2 / 3,
|
|
506
|
-
top: cr.y,
|
|
507
|
-
width: 0,
|
|
508
|
-
height: cr.height,
|
|
509
|
-
borderLeftWidth: 1,
|
|
510
|
-
borderLeftStyle: "dashed"
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
)
|
|
514
|
-
] }),
|
|
515
|
-
CROP_HANDLES.map((handle) => /* @__PURE__ */ jsx(
|
|
516
|
-
"div",
|
|
517
|
-
{
|
|
518
|
-
className: getCropperHandleClasses(handle),
|
|
519
|
-
style: getCropperHandleStyle(handle, cr),
|
|
520
|
-
"data-crop-handle": handle,
|
|
521
|
-
role: "button",
|
|
522
|
-
tabIndex: -1,
|
|
523
|
-
"aria-label": formatCropperResizeAriaLabel(
|
|
524
|
-
labels.resizeCropAreaAriaLabel,
|
|
525
|
-
getCropperHandleName(handle, labels)
|
|
526
|
-
),
|
|
527
|
-
onPointerDown: (event) => startDrag(event, "resize", handle)
|
|
528
|
-
},
|
|
529
|
-
handle
|
|
530
|
-
))
|
|
531
|
-
]
|
|
528
|
+
] }),
|
|
529
|
+
CROP_HANDLES.map((handle) => /* @__PURE__ */ jsx(
|
|
530
|
+
"div",
|
|
531
|
+
{
|
|
532
|
+
className: getCropperHandleClasses(handle),
|
|
533
|
+
style: getCropperHandleStyle(handle, cr),
|
|
534
|
+
"data-crop-handle": handle,
|
|
535
|
+
role: "button",
|
|
536
|
+
tabIndex: -1,
|
|
537
|
+
"aria-label": formatCropperResizeAriaLabel(
|
|
538
|
+
labels.resizeCropAreaAriaLabel,
|
|
539
|
+
getCropperHandleName(handle, labels)
|
|
540
|
+
),
|
|
541
|
+
onPointerDown: (event) => startDrag(event, "resize", handle)
|
|
542
|
+
},
|
|
543
|
+
handle
|
|
544
|
+
))
|
|
545
|
+
]
|
|
546
|
+
}
|
|
547
|
+
)
|
|
532
548
|
}
|
|
533
549
|
);
|
|
534
550
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useFullscreen
|
|
3
|
+
} from "./chunk-2MV3F7WP.mjs";
|
|
4
|
+
import {
|
|
5
|
+
useTigerConfig
|
|
6
|
+
} from "./chunk-RUIFGSVN.mjs";
|
|
7
|
+
|
|
8
|
+
// src/components/FullscreenButton.tsx
|
|
9
|
+
import { forwardRef } from "react";
|
|
10
|
+
import {
|
|
11
|
+
classNames,
|
|
12
|
+
fullscreenButtonClasses,
|
|
13
|
+
getFullscreenLabels,
|
|
14
|
+
getIconDefinition,
|
|
15
|
+
mergeTigerLocale
|
|
16
|
+
} from "@expcat/tigercat-core";
|
|
17
|
+
import { jsx } from "react/jsx-runtime";
|
|
18
|
+
function Glyph({ name }) {
|
|
19
|
+
const definition = getIconDefinition(name);
|
|
20
|
+
if (!definition) return null;
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
"svg",
|
|
23
|
+
{
|
|
24
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
25
|
+
viewBox: definition.viewBox,
|
|
26
|
+
fill: "none",
|
|
27
|
+
stroke: "currentColor",
|
|
28
|
+
strokeWidth: "1.5",
|
|
29
|
+
strokeLinecap: "round",
|
|
30
|
+
strokeLinejoin: "round",
|
|
31
|
+
className: "h-5 w-5",
|
|
32
|
+
"aria-hidden": "true",
|
|
33
|
+
children: definition.paths.map((d, i) => /* @__PURE__ */ jsx("path", { d }, i))
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
var FullscreenButton = forwardRef(
|
|
38
|
+
function FullscreenButton2({ target, locale, labels, className, onChange, onError, ...props }, ref) {
|
|
39
|
+
const config = useTigerConfig();
|
|
40
|
+
const labelSet = getFullscreenLabels(mergeTigerLocale(config.locale, locale), labels);
|
|
41
|
+
const fullscreen = useFullscreen({ target, onChange, onError });
|
|
42
|
+
const label = fullscreen.isFullscreen ? labelSet.exitAriaLabel : labelSet.enterAriaLabel;
|
|
43
|
+
return /* @__PURE__ */ jsx(
|
|
44
|
+
"button",
|
|
45
|
+
{
|
|
46
|
+
...props,
|
|
47
|
+
ref,
|
|
48
|
+
type: "button",
|
|
49
|
+
className: classNames(fullscreenButtonClasses, className),
|
|
50
|
+
"aria-label": label,
|
|
51
|
+
"aria-pressed": fullscreen.isFullscreen,
|
|
52
|
+
disabled: !fullscreen.supported,
|
|
53
|
+
onClick: () => {
|
|
54
|
+
void fullscreen.toggle();
|
|
55
|
+
},
|
|
56
|
+
children: /* @__PURE__ */ jsx(Glyph, { name: fullscreen.isFullscreen ? "fullscreen-exit" : "fullscreen" })
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
FullscreenButton.displayName = "FullscreenButton";
|
|
62
|
+
var FullscreenButton_default = FullscreenButton;
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
FullscreenButton,
|
|
66
|
+
FullscreenButton_default
|
|
67
|
+
};
|
|
@@ -122,9 +122,8 @@ var Anchor = forwardRef(function Anchor2({
|
|
|
122
122
|
getCurrentAnchorRef.current = getCurrentAnchor;
|
|
123
123
|
const onChangeRef = useRef(onChange);
|
|
124
124
|
onChangeRef.current = onChange;
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
);
|
|
125
|
+
const resolveContainer = () => resolveAnchorScrollContainer(getContainerRef.current, anchorRef.current);
|
|
126
|
+
const scrollLockRef = useRef(createProgrammaticScrollLock(() => resolveContainer()));
|
|
128
127
|
const config = useTigerConfig();
|
|
129
128
|
const mergedLocale = useMemo(
|
|
130
129
|
() => mergeTigerLocale(config.locale, locale),
|
|
@@ -158,7 +157,7 @@ var Anchor = forwardRef(function Anchor2({
|
|
|
158
157
|
}, []);
|
|
159
158
|
const scrollTo = useCallback(
|
|
160
159
|
(href) => {
|
|
161
|
-
const container =
|
|
160
|
+
const container = resolveContainer();
|
|
162
161
|
scrollToAnchor(href, container, scrollOffset);
|
|
163
162
|
},
|
|
164
163
|
[scrollOffset]
|
|
@@ -182,10 +181,10 @@ var Anchor = forwardRef(function Anchor2({
|
|
|
182
181
|
},
|
|
183
182
|
[applyActive, onClick, scrollTo]
|
|
184
183
|
);
|
|
185
|
-
const resolved = resolveScrollRoot(getContainer);
|
|
184
|
+
const resolved = resolveScrollRoot(getContainer, { from: anchorRef.current });
|
|
186
185
|
const resolvedKey = resolved.isWindow ? "window" : resolved.target;
|
|
187
186
|
useEffect(() => {
|
|
188
|
-
const container =
|
|
187
|
+
const container = resolveContainer();
|
|
189
188
|
const root = container === window ? null : container;
|
|
190
189
|
const stop = createAnchorObserver(links, {
|
|
191
190
|
offsetTop: scrollOffset,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ImageGroupContext
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4IVRLBKW.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ImagePreview
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-SGKPZW57.mjs";
|
|
7
7
|
import {
|
|
8
8
|
usePopup
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-S37KEELR.mjs";
|
|
10
10
|
import {
|
|
11
11
|
renderOverlayPortal
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OU2AV7DY.mjs";
|
|
13
13
|
import {
|
|
14
14
|
useTigerConfig
|
|
15
15
|
} from "./chunk-RUIFGSVN.mjs";
|
|
@@ -54,7 +54,13 @@ var BackTop = forwardRef(function BackTop2({
|
|
|
54
54
|
[config.locale, locale]
|
|
55
55
|
);
|
|
56
56
|
const labelSet = getBackTopLabels(mergedLocale, labels);
|
|
57
|
-
const
|
|
57
|
+
const hostRef = useRef(null);
|
|
58
|
+
const setHostRef = (node) => {
|
|
59
|
+
hostRef.current = node;
|
|
60
|
+
if (typeof ref === "function") ref(node);
|
|
61
|
+
else if (ref) ref.current = node;
|
|
62
|
+
};
|
|
63
|
+
const resolved = resolveScrollRoot(target, { from: hostRef.current });
|
|
58
64
|
const resolvedKey = resolved.isWindow ? "window" : resolved.target;
|
|
59
65
|
const visibilityHeightRef = useRef(visibilityHeight);
|
|
60
66
|
visibilityHeightRef.current = visibilityHeight;
|
|
@@ -62,7 +68,7 @@ var BackTop = forwardRef(function BackTop2({
|
|
|
62
68
|
void 0
|
|
63
69
|
);
|
|
64
70
|
useEffect(() => {
|
|
65
|
-
const root = resolveScrollRoot(target);
|
|
71
|
+
const root = resolveScrollRoot(target, { from: hostRef.current });
|
|
66
72
|
const eventTarget = getScrollRootEventTarget(root);
|
|
67
73
|
const scrollNode = root.target;
|
|
68
74
|
if (!eventTarget || !scrollNode) return void 0;
|
|
@@ -85,7 +91,7 @@ var BackTop = forwardRef(function BackTop2({
|
|
|
85
91
|
}, [visibilityHeight]);
|
|
86
92
|
const handleClick = useCallback(
|
|
87
93
|
(event) => {
|
|
88
|
-
const root = resolveScrollRoot(target);
|
|
94
|
+
const root = resolveScrollRoot(target, { from: hostRef.current });
|
|
89
95
|
if (root.target) scrollToTop(root.target, duration);
|
|
90
96
|
onClick?.(event);
|
|
91
97
|
},
|
|
@@ -108,7 +114,7 @@ var BackTop = forwardRef(function BackTop2({
|
|
|
108
114
|
"button",
|
|
109
115
|
{
|
|
110
116
|
...props,
|
|
111
|
-
ref,
|
|
117
|
+
ref: setHostRef,
|
|
112
118
|
type: "button",
|
|
113
119
|
className: buttonClasses,
|
|
114
120
|
style: buttonStyle,
|
|
@@ -13,12 +13,15 @@ import {
|
|
|
13
13
|
getCodeBlockCopyButtonClasses,
|
|
14
14
|
getCodeLabels,
|
|
15
15
|
mergeTigerLocale,
|
|
16
|
+
renderCodeHighlightHtml,
|
|
16
17
|
resolveLocaleText
|
|
17
18
|
} from "@expcat/tigercat-core";
|
|
18
19
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
19
20
|
var Code = forwardRef(function Code2({
|
|
20
21
|
code,
|
|
21
22
|
copyable = true,
|
|
23
|
+
language,
|
|
24
|
+
highlighter,
|
|
22
25
|
copyLabel,
|
|
23
26
|
copiedLabel,
|
|
24
27
|
copyFailedLabel,
|
|
@@ -64,7 +67,10 @@ var Code = forwardRef(function Code2({
|
|
|
64
67
|
const buttonLabel = copyStatus === "failed" ? resolvedCopyFailedLabel : copyStatus === "copied" ? resolvedCopiedLabel : resolvedCopyLabel;
|
|
65
68
|
const liveText = copyStatus === "idle" ? "" : buttonLabel;
|
|
66
69
|
return /* @__PURE__ */ jsxs("div", { ref, className: containerClasses, ...props, children: [
|
|
67
|
-
/* @__PURE__ */ jsx("pre", { className: codeBlockPreClasses, children:
|
|
70
|
+
/* @__PURE__ */ jsx("pre", { className: codeBlockPreClasses, children: (() => {
|
|
71
|
+
const highlighted = renderCodeHighlightHtml(code, language, highlighter);
|
|
72
|
+
return highlighted == null ? /* @__PURE__ */ jsx("code", { className: "block", children: code }) : /* @__PURE__ */ jsx("code", { className: "block", dangerouslySetInnerHTML: { __html: highlighted } });
|
|
73
|
+
})() }),
|
|
68
74
|
copyable && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
69
75
|
/* @__PURE__ */ jsx("button", { type: "button", className: copyButtonClasses, onClick: handleCopy, children: buttonLabel }),
|
|
70
76
|
/* @__PURE__ */ jsx("span", { className: codeBlockCopyStatusLiveClasses, "aria-live": "polite", children: liveText })
|