@underverse-ui/underverse 2.0.35 → 2.0.37

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 (38) hide show
  1. package/api-reference.json +1 -1
  2. package/dist/DatePicker-FDOTQMNL.js +15 -0
  3. package/dist/{EmojiPicker-6H52Q4YE.js → EmojiPicker-Z7QPW4DA.js} +5 -4
  4. package/dist/EmojiPicker-Z7QPW4DA.js.map +1 -0
  5. package/dist/chunk-5GMQ23IU.js +719 -0
  6. package/dist/chunk-5GMQ23IU.js.map +1 -0
  7. package/dist/{chunk-L73HBI6E.js → chunk-5VCM2Z7M.js} +6 -4
  8. package/dist/{chunk-L73HBI6E.js.map → chunk-5VCM2Z7M.js.map} +1 -1
  9. package/dist/{chunk-H4AVZA4K.js → chunk-6K6CKZUL.js} +469 -360
  10. package/dist/chunk-6K6CKZUL.js.map +1 -0
  11. package/dist/{chunk-6FAHXNDQ.js → chunk-6XQTRIP6.js} +10 -349
  12. package/dist/chunk-6XQTRIP6.js.map +1 -0
  13. package/dist/chunk-EN33T3LJ.js +358 -0
  14. package/dist/chunk-EN33T3LJ.js.map +1 -0
  15. package/dist/{chunk-F2P3DJSC.js → chunk-GZ7EDNGF.js} +333 -1022
  16. package/dist/chunk-GZ7EDNGF.js.map +1 -0
  17. package/dist/{chunk-WFQV7XFC.js → chunk-JABD2ONI.js} +3 -3
  18. package/dist/chunk-JG3U26V6.js +1692 -0
  19. package/dist/chunk-JG3U26V6.js.map +1 -0
  20. package/dist/{chunk-W3QTP2DM.js → chunk-TSBKJELM.js} +2 -2
  21. package/dist/index.cjs +13513 -13323
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +20 -0
  24. package/dist/index.d.ts +20 -0
  25. package/dist/index.js +1942 -3569
  26. package/dist/index.js.map +1 -1
  27. package/dist/{menu-bar-MUISXLMR.js → menu-bar-VXAMTP3E.js} +6 -4
  28. package/dist/{menu-bar-MUISXLMR.js.map → menu-bar-VXAMTP3E.js.map} +1 -1
  29. package/dist/ueditor.cjs +2803 -1098
  30. package/dist/ueditor.cjs.map +1 -1
  31. package/dist/ueditor.js +6 -4
  32. package/package.json +1 -1
  33. package/dist/chunk-6FAHXNDQ.js.map +0 -1
  34. package/dist/chunk-F2P3DJSC.js.map +0 -1
  35. package/dist/chunk-H4AVZA4K.js.map +0 -1
  36. /package/dist/{EmojiPicker-6H52Q4YE.js.map → DatePicker-FDOTQMNL.js.map} +0 -0
  37. /package/dist/{chunk-WFQV7XFC.js.map → chunk-JABD2ONI.js.map} +0 -0
  38. /package/dist/{chunk-W3QTP2DM.js.map → chunk-TSBKJELM.js.map} +0 -0
@@ -289,6 +289,8 @@ var en_default = {
289
289
  codeBlockDesc: "Code with syntax highlighting",
290
290
  divider: "Divider",
291
291
  dividerDesc: "Visual divider",
292
+ date: "Date",
293
+ dateDesc: "Insert a date from the calendar",
292
294
  table: "Table",
293
295
  tableDesc: "Add a table",
294
296
  noResults: "No matching blocks found",
@@ -751,6 +753,8 @@ var vi_default = {
751
753
  codeBlockDesc: "M\xE3 v\u1EDBi t\xF4 m\xE0u c\xFA ph\xE1p",
752
754
  divider: "Ph\xE2n c\xE1ch",
753
755
  dividerDesc: "\u0110\u01B0\u1EDDng k\u1EBB ngang",
756
+ date: "Ng\xE0y",
757
+ dateDesc: "Ch\xE8n ng\xE0y t\u1EEB l\u1ECBch",
754
758
  table: "B\u1EA3ng",
755
759
  tableDesc: "Th\xEAm b\u1EA3ng",
756
760
  noResults: "Kh\xF4ng t\xECm th\u1EA5y kh\u1ED1i ph\xF9 h\u1EE3p",
@@ -1213,6 +1217,8 @@ var ko_default = {
1213
1217
  codeBlockDesc: "\uAD6C\uBB38 \uAC15\uC870\uAC00 \uC788\uB294 \uCF54\uB4DC",
1214
1218
  divider: "\uAD6C\uBD84\uC120",
1215
1219
  dividerDesc: "\uC2DC\uAC01\uC801 \uAD6C\uBD84\uC120",
1220
+ date: "\uB0A0\uC9DC",
1221
+ dateDesc: "\uB2EC\uB825\uC5D0\uC11C \uB0A0\uC9DC \uC0BD\uC785",
1216
1222
  table: "\uD45C",
1217
1223
  tableDesc: "\uD45C \uCD94\uAC00",
1218
1224
  noResults: "\uC77C\uCE58\uD558\uB294 \uBE14\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4",
@@ -1675,6 +1681,8 @@ var ja_default = {
1675
1681
  codeBlockDesc: "\u30B7\u30F3\u30BF\u30C3\u30AF\u30B9\u30CF\u30A4\u30E9\u30A4\u30C8\u4ED8\u304D\u30B3\u30FC\u30C9",
1676
1682
  divider: "\u533A\u5207\u308A\u7DDA",
1677
1683
  dividerDesc: "\u8996\u899A\u7684\u306A\u533A\u5207\u308A\u7DDA",
1684
+ date: "\u65E5\u4ED8",
1685
+ dateDesc: "\u30AB\u30EC\u30F3\u30C0\u30FC\u304B\u3089\u65E5\u4ED8\u3092\u633F\u5165",
1678
1686
  table: "\u8868",
1679
1687
  tableDesc: "\u8868\u3092\u8FFD\u52A0",
1680
1688
  noResults: "\u4E00\u81F4\u3059\u308B\u30D6\u30ED\u30C3\u30AF\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",
@@ -2199,20 +2207,6 @@ function resolveUEditorPortalContainer(getPortalContainer, fallbackGetPortalCont
2199
2207
  return typeof document !== "undefined" ? document.body : null;
2200
2208
  }
2201
2209
 
2202
- // src/components/Tooltip.tsx
2203
- import * as React6 from "react";
2204
- import { createPortal } from "react-dom";
2205
-
2206
- // src/hooks/useHydrated.ts
2207
- import { useSyncExternalStore } from "react";
2208
- var subscribe = () => () => {
2209
- };
2210
- var getSnapshot = () => true;
2211
- var getServerSnapshot = () => false;
2212
- function useHydrated() {
2213
- return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
2214
- }
2215
-
2216
2210
  // src/utils/react-compose.ts
2217
2211
  function chainEventHandlers(...handlers) {
2218
2212
  return (event) => {
@@ -2233,337 +2227,6 @@ function mergeRefs(...refs) {
2233
2227
  };
2234
2228
  }
2235
2229
 
2236
- // src/components/Tooltip.tsx
2237
- import { Fragment as Fragment2, jsx as jsx6, jsxs } from "react/jsx-runtime";
2238
- var variantStyles = {
2239
- default: "bg-popover text-popover-foreground border-border/50",
2240
- info: "bg-info text-info-foreground border-info/20",
2241
- warning: "bg-warning text-warning-foreground border-warning/20",
2242
- error: "bg-destructive text-destructive-foreground border-destructive/20",
2243
- success: "bg-success text-success-foreground border-success/20"
2244
- };
2245
- var clamp = (value, min, max) => Math.max(min, Math.min(max, value));
2246
- function getTransformOrigin(side) {
2247
- switch (side) {
2248
- case "top":
2249
- return "center bottom";
2250
- case "bottom":
2251
- return "center top";
2252
- case "left":
2253
- return "right center";
2254
- case "right":
2255
- return "left center";
2256
- }
2257
- }
2258
- function computeTooltipPosition(args) {
2259
- const { triggerRect, contentSize, placement, offset, padding, viewport } = args;
2260
- let side = placement;
2261
- const fitsTop = triggerRect.top - offset - contentSize.height >= padding;
2262
- const fitsBottom = triggerRect.bottom + offset + contentSize.height <= viewport.height - padding;
2263
- const fitsLeft = triggerRect.left - offset - contentSize.width >= padding;
2264
- const fitsRight = triggerRect.right + offset + contentSize.width <= viewport.width - padding;
2265
- if (side === "top" && !fitsTop && fitsBottom) side = "bottom";
2266
- if (side === "bottom" && !fitsBottom && fitsTop) side = "top";
2267
- if (side === "left" && !fitsLeft && fitsRight) side = "right";
2268
- if (side === "right" && !fitsRight && fitsLeft) side = "left";
2269
- const centerX = triggerRect.left + triggerRect.width / 2;
2270
- const centerY = triggerRect.top + triggerRect.height / 2;
2271
- let left = 0;
2272
- let top = 0;
2273
- if (side === "top") {
2274
- top = triggerRect.top - offset - contentSize.height;
2275
- left = centerX - contentSize.width / 2;
2276
- } else if (side === "bottom") {
2277
- top = triggerRect.bottom + offset;
2278
- left = centerX - contentSize.width / 2;
2279
- } else if (side === "left") {
2280
- top = centerY - contentSize.height / 2;
2281
- left = triggerRect.left - offset - contentSize.width;
2282
- } else {
2283
- top = centerY - contentSize.height / 2;
2284
- left = triggerRect.right + offset;
2285
- }
2286
- left = clamp(left, padding, viewport.width - contentSize.width - padding);
2287
- top = clamp(top, padding, viewport.height - contentSize.height - padding);
2288
- return { top, left, side };
2289
- }
2290
- var Tooltip = React6.forwardRef(({
2291
- children,
2292
- content,
2293
- placement = "top",
2294
- delay = { open: 200, close: 300 },
2295
- className,
2296
- disabled = false,
2297
- variant = "default",
2298
- asChild = true,
2299
- ...triggerPassthroughProps
2300
- }, forwardedRef) => {
2301
- const [isOpen, setIsOpen] = React6.useState(false);
2302
- const isMounted = useHydrated();
2303
- const triggerRef = React6.useRef(null);
2304
- const positionerRef = React6.useRef(null);
2305
- const panelRef = React6.useRef(null);
2306
- const timeoutRef = React6.useRef(void 0);
2307
- const lastAppliedRef = React6.useRef(null);
2308
- const openedByPointerRef = React6.useRef(false);
2309
- const triggerSelector = React6.useId();
2310
- const tooltipId = React6.useId();
2311
- const getPortalContainer = useUEditorPortalContainerGetter();
2312
- const portalContainer = isOpen ? resolveUEditorPortalContainer(getPortalContainer) : null;
2313
- const portalDocument = portalContainer?.ownerDocument ?? null;
2314
- const portalWindow = portalDocument?.defaultView ?? null;
2315
- const delayOpen = typeof delay === "object" ? delay.open || 700 : delay;
2316
- const delayClose = typeof delay === "object" ? delay.close || 300 : delay;
2317
- const offset = 8;
2318
- const padding = 8;
2319
- const updatePosition = React6.useCallback(() => {
2320
- const triggerEl = triggerRef.current;
2321
- const positionerEl = positionerRef.current;
2322
- const panelEl = panelRef.current;
2323
- if (!triggerEl || !positionerEl || !panelEl) return;
2324
- const triggerRect = triggerEl.getBoundingClientRect();
2325
- const measuredWidth = panelEl.offsetWidth;
2326
- const measuredHeight = panelEl.offsetHeight;
2327
- const rect = panelEl.getBoundingClientRect();
2328
- const contentWidth = measuredWidth || rect.width;
2329
- const contentHeight = measuredHeight || rect.height;
2330
- const next = computeTooltipPosition({
2331
- triggerRect,
2332
- contentSize: { width: contentWidth, height: contentHeight },
2333
- placement,
2334
- offset,
2335
- padding,
2336
- viewport: {
2337
- width: portalWindow?.innerWidth ?? window.innerWidth,
2338
- height: portalWindow?.innerHeight ?? window.innerHeight
2339
- }
2340
- });
2341
- const top = Math.round(next.top);
2342
- const left = Math.round(next.left);
2343
- const prev = lastAppliedRef.current;
2344
- const same = prev && Math.abs(prev.top - top) < 0.5 && Math.abs(prev.left - left) < 0.5 && prev.side === next.side;
2345
- if (same) return;
2346
- lastAppliedRef.current = { top, left, side: next.side };
2347
- positionerEl.style.transform = `translate3d(${left}px, ${top}px, 0)`;
2348
- panelEl.style.transformOrigin = getTransformOrigin(next.side);
2349
- if (positionerEl.style.visibility !== "visible") positionerEl.style.visibility = "visible";
2350
- }, [placement, portalWindow]);
2351
- const handleMouseEnter = () => {
2352
- if (disabled) return;
2353
- openedByPointerRef.current = true;
2354
- clearTimeout(timeoutRef.current);
2355
- timeoutRef.current = setTimeout(() => {
2356
- setIsOpen(true);
2357
- }, delayOpen);
2358
- };
2359
- const handleMouseLeave = () => {
2360
- clearTimeout(timeoutRef.current);
2361
- timeoutRef.current = setTimeout(() => {
2362
- setIsOpen(false);
2363
- }, delayClose);
2364
- };
2365
- const closeNow = React6.useCallback(() => {
2366
- clearTimeout(timeoutRef.current);
2367
- openedByPointerRef.current = false;
2368
- setIsOpen(false);
2369
- }, []);
2370
- const handleFocus = () => {
2371
- if (disabled) return;
2372
- openedByPointerRef.current = false;
2373
- setIsOpen(true);
2374
- };
2375
- const handleBlur = () => {
2376
- openedByPointerRef.current = false;
2377
- setIsOpen(false);
2378
- };
2379
- React6.useEffect(() => {
2380
- return () => clearTimeout(timeoutRef.current);
2381
- }, []);
2382
- React6.useEffect(() => {
2383
- if (isOpen) return;
2384
- clearTimeout(timeoutRef.current);
2385
- }, [isOpen]);
2386
- React6.useLayoutEffect(() => {
2387
- if (!isOpen || !portalWindow) {
2388
- lastAppliedRef.current = null;
2389
- return;
2390
- }
2391
- updatePosition();
2392
- let raf1 = 0;
2393
- let raf2 = 0;
2394
- raf1 = portalWindow.requestAnimationFrame(() => {
2395
- updatePosition();
2396
- raf2 = portalWindow.requestAnimationFrame(() => updatePosition());
2397
- });
2398
- return () => {
2399
- portalWindow.cancelAnimationFrame(raf1);
2400
- portalWindow.cancelAnimationFrame(raf2);
2401
- };
2402
- }, [isOpen, portalWindow, updatePosition]);
2403
- React6.useEffect(() => {
2404
- if (!isOpen || !portalDocument || !portalWindow) return;
2405
- let raf = 0;
2406
- const handler = () => {
2407
- portalWindow.cancelAnimationFrame(raf);
2408
- raf = portalWindow.requestAnimationFrame(() => updatePosition());
2409
- };
2410
- handler();
2411
- portalWindow.addEventListener("resize", handler);
2412
- portalWindow.addEventListener("scroll", handler, true);
2413
- portalDocument.addEventListener("scroll", handler, true);
2414
- return () => {
2415
- portalWindow.cancelAnimationFrame(raf);
2416
- portalWindow.removeEventListener("resize", handler);
2417
- portalWindow.removeEventListener("scroll", handler, true);
2418
- portalDocument.removeEventListener("scroll", handler, true);
2419
- };
2420
- }, [isOpen, portalDocument, portalWindow, updatePosition]);
2421
- React6.useEffect(() => {
2422
- if (!isOpen || !portalWindow) return;
2423
- const ResizeObserverCtor = portalWindow.ResizeObserver;
2424
- if (!ResizeObserverCtor) return;
2425
- const ro = new ResizeObserverCtor(() => updatePosition());
2426
- if (triggerRef.current) ro.observe(triggerRef.current);
2427
- if (panelRef.current) ro.observe(panelRef.current);
2428
- return () => ro.disconnect();
2429
- }, [isOpen, portalWindow, updatePosition]);
2430
- React6.useEffect(() => {
2431
- if (!isOpen || !portalDocument) return;
2432
- const handleDocumentKeyDown = (event) => {
2433
- if (event.key === "Escape") closeNow();
2434
- };
2435
- const handleDocumentPointerMove = (event) => {
2436
- if (!openedByPointerRef.current) return;
2437
- const triggerEl = triggerRef.current;
2438
- if (!triggerEl) {
2439
- closeNow();
2440
- return;
2441
- }
2442
- const rect = triggerEl.getBoundingClientRect();
2443
- const tolerance = 2;
2444
- const insideTrigger = event.clientX >= rect.left - tolerance && event.clientX <= rect.right + tolerance && event.clientY >= rect.top - tolerance && event.clientY <= rect.bottom + tolerance;
2445
- if (!insideTrigger) closeNow();
2446
- };
2447
- portalDocument.addEventListener("pointerdown", closeNow, true);
2448
- portalDocument.addEventListener("keydown", handleDocumentKeyDown);
2449
- portalDocument.addEventListener("pointermove", handleDocumentPointerMove, true);
2450
- return () => {
2451
- portalDocument.removeEventListener("pointerdown", closeNow, true);
2452
- portalDocument.removeEventListener("keydown", handleDocumentKeyDown);
2453
- portalDocument.removeEventListener("pointermove", handleDocumentPointerMove, true);
2454
- };
2455
- }, [closeNow, isOpen, portalDocument]);
2456
- const childProps = children.props;
2457
- const childRef = childProps.ref;
2458
- const passthroughRef = mergeRefs(forwardedRef, childRef, (node) => {
2459
- triggerRef.current = node;
2460
- });
2461
- if (disabled || !content) {
2462
- if (!asChild) return children;
2463
- return React6.cloneElement(children, {
2464
- ...triggerPassthroughProps,
2465
- ref: passthroughRef
2466
- });
2467
- }
2468
- const triggerProps = {
2469
- ...triggerPassthroughProps,
2470
- ref: passthroughRef,
2471
- "data-underverse-tooltip-trigger": triggerSelector,
2472
- "aria-describedby": isOpen ? [childProps["aria-describedby"], triggerPassthroughProps["aria-describedby"], tooltipId].filter(Boolean).join(" ") : childProps["aria-describedby"] ?? triggerPassthroughProps["aria-describedby"],
2473
- onMouseEnter: chainEventHandlers(
2474
- triggerPassthroughProps.onMouseEnter,
2475
- childProps.onMouseEnter,
2476
- (e) => {
2477
- triggerRef.current = e.currentTarget;
2478
- handleMouseEnter();
2479
- }
2480
- ),
2481
- onMouseLeave: chainEventHandlers(
2482
- triggerPassthroughProps.onMouseLeave,
2483
- childProps.onMouseLeave,
2484
- (e) => {
2485
- triggerRef.current = e.currentTarget;
2486
- handleMouseLeave();
2487
- }
2488
- ),
2489
- onPointerDown: chainEventHandlers(
2490
- triggerPassthroughProps.onPointerDown,
2491
- childProps.onPointerDown,
2492
- (e) => {
2493
- triggerRef.current = e.currentTarget;
2494
- closeNow();
2495
- }
2496
- ),
2497
- onClick: chainEventHandlers(
2498
- triggerPassthroughProps.onClick,
2499
- childProps.onClick,
2500
- (e) => {
2501
- triggerRef.current = e.currentTarget;
2502
- closeNow();
2503
- }
2504
- ),
2505
- onFocus: chainEventHandlers(
2506
- triggerPassthroughProps.onFocus,
2507
- childProps.onFocus,
2508
- (e) => {
2509
- triggerRef.current = e.currentTarget;
2510
- handleFocus();
2511
- }
2512
- ),
2513
- onBlur: chainEventHandlers(
2514
- triggerPassthroughProps.onBlur,
2515
- childProps.onBlur,
2516
- () => {
2517
- handleBlur();
2518
- }
2519
- )
2520
- };
2521
- const trigger = asChild ? React6.cloneElement(children, triggerProps) : /* @__PURE__ */ jsx6("span", { ...triggerProps, children });
2522
- return /* @__PURE__ */ jsxs(Fragment2, { children: [
2523
- trigger,
2524
- isMounted && isOpen && portalContainer && createPortal(
2525
- /* @__PURE__ */ jsx6(
2526
- "div",
2527
- {
2528
- ref: positionerRef,
2529
- style: {
2530
- position: "fixed",
2531
- top: 0,
2532
- left: 0,
2533
- transform: "translate3d(0, 0, 0)",
2534
- zIndex: 99999,
2535
- visibility: "hidden",
2536
- pointerEvents: "none",
2537
- willChange: "transform"
2538
- },
2539
- children: /* @__PURE__ */ jsx6(
2540
- "div",
2541
- {
2542
- ref: panelRef,
2543
- id: tooltipId,
2544
- role: "tooltip",
2545
- style: {
2546
- opacity: 1,
2547
- transition: "opacity 150ms",
2548
- transformOrigin: getTransformOrigin(placement)
2549
- },
2550
- className: cn(
2551
- "px-3 py-2 text-sm font-medium rounded-xl shadow-lg border",
2552
- "max-w-xs wrap-break-word backdrop-blur-sm",
2553
- variantStyles[variant],
2554
- className
2555
- ),
2556
- children: content
2557
- }
2558
- )
2559
- }
2560
- ),
2561
- portalContainer
2562
- )
2563
- ] });
2564
- });
2565
- Tooltip.displayName = "Tooltip";
2566
-
2567
2230
  export {
2568
2231
  formControlSizeStyles,
2569
2232
  formControlLabelClass,
@@ -2587,13 +2250,11 @@ export {
2587
2250
  ForceInternalTranslationsProvider,
2588
2251
  useSmartTranslations,
2589
2252
  useSmartLocale,
2590
- useHydrated,
2591
2253
  chainEventHandlers,
2592
2254
  setRefValue,
2593
2255
  mergeRefs,
2594
2256
  UEditorPortalProvider,
2595
2257
  useUEditorPortalContainerGetter,
2596
- resolveUEditorPortalContainer,
2597
- Tooltip
2258
+ resolveUEditorPortalContainer
2598
2259
  };
2599
- //# sourceMappingURL=chunk-6FAHXNDQ.js.map
2260
+ //# sourceMappingURL=chunk-6XQTRIP6.js.map