@teambit/react.ui.component-highlighter 0.0.511 → 0.0.514
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/children-highlighter/use-children-highlighter.tsx +5 -3
- package/component-highlighter.docs.md +3 -14
- package/dist/children-highlighter/use-children-highlighter.d.ts +7 -2
- package/dist/children-highlighter/use-children-highlighter.js.map +1 -1
- package/dist/component-highlighter.docs.md +3 -14
- package/dist/element-highlighter/element-highlighter.compositions.d.ts +2 -0
- package/dist/element-highlighter/element-highlighter.compositions.js +33 -17
- package/dist/element-highlighter/element-highlighter.compositions.js.map +1 -1
- package/dist/element-highlighter/element-highlighter.d.ts +6 -10
- package/dist/element-highlighter/element-highlighter.js +4 -4
- package/dist/element-highlighter/element-highlighter.js.map +1 -1
- package/dist/element-highlighter/index.d.ts +1 -1
- package/dist/frame/frame.d.ts +8 -4
- package/dist/frame/frame.js +69 -31
- package/dist/frame/frame.js.map +1 -1
- package/dist/frame/frame.module.scss +8 -1
- package/dist/hover-highlighter/bubble-to-component.d.ts +19 -0
- package/dist/hover-highlighter/bubble-to-component.js +43 -0
- package/dist/hover-highlighter/bubble-to-component.js.map +1 -0
- package/dist/hover-highlighter/bubble-to-component.spec.d.ts +1 -0
- package/dist/hover-highlighter/bubble-to-component.spec.js +38 -0
- package/dist/hover-highlighter/bubble-to-component.spec.js.map +1 -0
- package/dist/hover-highlighter/use-hover-highlighter.d.ts +6 -1
- package/dist/hover-highlighter/use-hover-highlighter.js +2 -23
- package/dist/hover-highlighter/use-hover-highlighter.js.map +1 -1
- package/dist/hybrid-highlighter/hybrid-highlighter.js +1 -1
- package/dist/hybrid-highlighter/hybrid-highlighter.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/label/component-strip.d.ts +1 -1
- package/dist/label/component-strip.js +7 -1
- package/dist/label/component-strip.js.map +1 -1
- package/dist/label/label-container.d.ts +4 -5
- package/dist/label/label-container.js +29 -13
- package/dist/label/label-container.js.map +1 -1
- package/dist/label/label.d.ts +1 -1
- package/dist/label/label.module.scss +8 -0
- package/dist/label/other-components.d.ts +1 -1
- package/dist/mock-component.d.ts +2 -0
- package/dist/mock-component.js +30 -0
- package/dist/mock-component.js.map +1 -0
- package/element-highlighter/element-highlighter.compositions.tsx +53 -19
- package/element-highlighter/element-highlighter.tsx +13 -25
- package/element-highlighter/index.ts +1 -1
- package/frame/frame.module.scss +8 -1
- package/frame/frame.tsx +92 -44
- package/hover-highlighter/bubble-to-component.spec.tsx +57 -0
- package/hover-highlighter/bubble-to-component.tsx +69 -0
- package/hover-highlighter/use-hover-highlighter.tsx +5 -36
- package/hybrid-highlighter/hybrid-highlighter.tsx +7 -2
- package/index.ts +1 -1
- package/label/component-strip.tsx +11 -2
- package/label/label-container.tsx +42 -20
- package/label/label.module.scss +8 -0
- package/label/label.tsx +1 -1
- package/label/other-components.tsx +1 -1
- package/mock-component.tsx +9 -0
- package/package-tar/teambit-react.ui.component-highlighter-0.0.514.tgz +0 -0
- package/package.json +9 -10
- package/{preview-1647509820722.js → preview-1649066106369.js} +2 -2
- package/dist/use-animation-frame.d.ts +0 -1
- package/dist/use-animation-frame.js +0 -23
- package/dist/use-animation-frame.js.map +0 -1
- package/package-tar/teambit-react.ui.component-highlighter-0.0.511.tgz +0 -0
- package/use-animation-frame.tsx +0 -20
package/use-animation-frame.tsx
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
|
|
3
|
-
// TODO - extract to its own component
|
|
4
|
-
|
|
5
|
-
export function useAnimationFrame(cb?: false | null | (() => any), deps: any[] = []) {
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
if (!cb) return () => {};
|
|
8
|
-
|
|
9
|
-
let animationFrameId = -1;
|
|
10
|
-
const animate = () => {
|
|
11
|
-
cb();
|
|
12
|
-
animationFrameId = window.requestAnimationFrame(animate);
|
|
13
|
-
};
|
|
14
|
-
animate();
|
|
15
|
-
|
|
16
|
-
return () => {
|
|
17
|
-
if (animationFrameId > -1) window.cancelAnimationFrame(animationFrameId);
|
|
18
|
-
};
|
|
19
|
-
}, [cb, ...deps]);
|
|
20
|
-
}
|