@epam/ai-dial-ui-kit 0.14.0-dev.15 → 0.14.0-dev.17
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/dist/{JsonEditor-CAH5hiNi.cjs → JsonEditor-BVB01dgd.cjs} +1 -1
- package/dist/{JsonEditor-DRc7un9e.js → JsonEditor-Buv5dMd4.js} +1 -1
- package/dist/{MarkdownEditor-BQyv0jqc.js → MarkdownEditor-ByIOZdDL.js} +1 -1
- package/dist/{MarkdownEditor-B7pccYlb.js → MarkdownEditor-CWmjH6FL.js} +1 -1
- package/dist/{MarkdownEditor-21tIlbic.cjs → MarkdownEditor-CktPrz1J.cjs} +1 -1
- package/dist/{MarkdownEditor-DHoEm29d.cjs → MarkdownEditor-DaszncR6.cjs} +1 -1
- package/dist/components-manifest.json +2 -2
- package/dist/dial-ui-kit.cjs.js +1 -1
- package/dist/dial-ui-kit.es.js +1 -1
- package/dist/{index-VQPGSue6.cjs → index-BCa8FskH.cjs} +30 -30
- package/dist/{index-CIDIXPOX.js → index-Nt73y5T9.js} +6348 -6340
- package/dist/src/components/New/EllipsisTooltip/use-truncation.d.ts +5 -0
- package/dist/src/utils/__tests__/element-size-observer.spec.d.ts +1 -0
- package/dist/src/utils/element-size-observer.d.ts +26 -0
- package/package.json +1 -1
|
@@ -8,6 +8,11 @@ import { ReactNode } from 'react';
|
|
|
8
8
|
* window resize, and — since a parent can resize without the window doing so —
|
|
9
9
|
* whenever the element's own box changes size.
|
|
10
10
|
*
|
|
11
|
+
* All of that goes through the shared observer in
|
|
12
|
+
* `@/utils/element-size-observer`, so a screen full of truncating labels costs
|
|
13
|
+
* one `ResizeObserver`, one resize listener and one animation frame in total
|
|
14
|
+
* rather than a set per label.
|
|
15
|
+
*
|
|
11
16
|
* @param text - The rendered content; a change to it re-measures
|
|
12
17
|
* @returns `ref` to attach to the truncating element, whether it `isTruncated`,
|
|
13
18
|
* its `textContent` (the full string even when `text` is a node), and
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
type SizeCallback = () => void;
|
|
2
|
+
/**
|
|
3
|
+
* Queues a measurement for the next animation frame, coalescing it with every
|
|
4
|
+
* other measurement queued for that frame.
|
|
5
|
+
*
|
|
6
|
+
* Passing the same callback twice before the frame runs schedules it once.
|
|
7
|
+
*
|
|
8
|
+
* @param callback - Reads layout and stores the result; must be referentially stable
|
|
9
|
+
*/
|
|
10
|
+
export declare const scheduleMeasure: (callback: SizeCallback) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Watches an element's box for size changes and calls back — batched through
|
|
13
|
+
* {@link scheduleMeasure} — whenever it may need re-measuring.
|
|
14
|
+
*
|
|
15
|
+
* A parent can resize without the window doing so, which is what the
|
|
16
|
+
* `ResizeObserver` covers; the `window.resize` listener stays for environments
|
|
17
|
+
* that have no `ResizeObserver`.
|
|
18
|
+
*
|
|
19
|
+
* One callback per element: observing the same element again replaces it.
|
|
20
|
+
*
|
|
21
|
+
* @param element - The element to watch
|
|
22
|
+
* @param callback - Runs when the element may have changed size; must be referentially stable
|
|
23
|
+
* @returns Unsubscribes the element, tearing the shared observer down once nothing is left to watch
|
|
24
|
+
*/
|
|
25
|
+
export declare const observeElementSize: (element: Element, callback: SizeCallback) => () => void;
|
|
26
|
+
export {};
|