@appquality/unguess-design-system 3.1.87 → 3.1.88-tooltip
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/build/index.js +13 -7
- package/build/stories/highlight/_types.d.ts +2 -0
- package/build/stories/highlight/demo-parts/data.d.ts +49 -0
- package/build/stories/highlight/demo-parts/transcript-base.d.ts +5 -0
- package/build/stories/highlight/demo-parts/transcript-diarization.d.ts +5 -0
- package/build/stories/highlight/demo-parts/transcript-paragraph.d.ts +5 -0
- package/build/stories/highlight/index.stories.d.ts +5 -1
- package/build/stories/tooltip/_types.d.ts +1 -0
- package/build/stories/tooltip/index.d.ts +1 -0
- package/build/stories/tooltip/index.stories.d.ts +1 -0
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -2978,10 +2978,17 @@ const FloatingMenu = (props) => {
|
|
|
2978
2978
|
const TooltipComponent = (props) => {
|
|
2979
2979
|
var _a;
|
|
2980
2980
|
const theme = React.useContext(styled.ThemeContext);
|
|
2981
|
-
return jsxRuntime.jsx(reactTooltips.Tooltip, Object.assign({}, props, { zIndex: (_a = props.zIndex) !== null && _a !== void 0 ? _a : theme.levels.front }));
|
|
2981
|
+
return (jsxRuntime.jsx(reactTooltips.Tooltip, Object.assign({}, props, { zIndex: (_a = props.zIndex) !== null && _a !== void 0 ? _a : theme.levels.front })));
|
|
2982
2982
|
};
|
|
2983
2983
|
const Tooltip = styled__default["default"](TooltipComponent) `
|
|
2984
2984
|
box-shadow: ${({ theme }) => theme.shadows.lg(`${theme.space.base * 3}px`, `${theme.space.base * 5}px`, getColor("neutralHue", 600, theme, 0.15))};
|
|
2985
|
+
|
|
2986
|
+
${({ isTransparent }) => isTransparent &&
|
|
2987
|
+
`
|
|
2988
|
+
box-shadow: none;
|
|
2989
|
+
background-color: transparent;
|
|
2990
|
+
border: none;
|
|
2991
|
+
`};
|
|
2985
2992
|
`;
|
|
2986
2993
|
|
|
2987
2994
|
var _path$t;
|
|
@@ -4722,11 +4729,7 @@ const VideoSpinner = () => (jsxRuntime.jsx(StyledDiv, { children: jsxRuntime.jsx
|
|
|
4722
4729
|
* Used for this:
|
|
4723
4730
|
- To display a video
|
|
4724
4731
|
*/
|
|
4725
|
-
const Player = React.forwardRef((props, forwardRef) => {
|
|
4726
|
-
const videoRef = React.useRef(null);
|
|
4727
|
-
React.useImperativeHandle(forwardRef, () => videoRef.current);
|
|
4728
|
-
return (jsxRuntime.jsx(Video__default["default"], Object.assign({ src: props.url }, props, { children: jsxRuntime.jsx(PlayerCore, Object.assign({ ref: videoRef }, props)) })));
|
|
4729
|
-
});
|
|
4732
|
+
const Player = React.forwardRef((props, forwardRef) => (jsxRuntime.jsx(Video__default["default"], Object.assign({ src: props.url }, props, { children: jsxRuntime.jsx(PlayerCore, Object.assign({ ref: forwardRef }, props)) }))));
|
|
4730
4733
|
const PlayerCore = React.forwardRef((props, forwardRef) => {
|
|
4731
4734
|
var _a;
|
|
4732
4735
|
const { context, togglePlay, setIsPlaying } = Video.useVideoContext();
|
|
@@ -4734,7 +4737,7 @@ const PlayerCore = React.forwardRef((props, forwardRef) => {
|
|
|
4734
4737
|
const videoRef = (_a = context.player) === null || _a === void 0 ? void 0 : _a.ref.current;
|
|
4735
4738
|
const isLoaded = !!videoRef;
|
|
4736
4739
|
const containerRef = React.useRef(null);
|
|
4737
|
-
React.useImperativeHandle(forwardRef, () => videoRef);
|
|
4740
|
+
React.useImperativeHandle(forwardRef, () => videoRef, [videoRef]);
|
|
4738
4741
|
React.useEffect(() => {
|
|
4739
4742
|
if (videoRef) {
|
|
4740
4743
|
videoRef.addEventListener("pause", () => {
|
|
@@ -5705,6 +5708,9 @@ const Word = (props) => {
|
|
|
5705
5708
|
props.currentTime < props.end;
|
|
5706
5709
|
// Is there an observation that contains this word?
|
|
5707
5710
|
const observation = (_a = props.observations) === null || _a === void 0 ? void 0 : _a.find((obs) => props.start >= obs.start && props.end <= obs.end);
|
|
5711
|
+
if (props.tooltipContent && !!observation) {
|
|
5712
|
+
return (jsxRuntime.jsx(Tooltip, Object.assign({ content: props.tooltipContent, isTransparent: true }, { children: jsxRuntime.jsxs(StyledWord, Object.assign({}, props, { observation: observation, "data-start": props.start, "data-end": props.end, className: !!observation ? "highlighted" : "" }, (!!observation ? { tag: "observation" } : {}), { children: [isActive ? (jsxRuntime.jsx(ActiveWord, { children: jsxRuntime.jsx(Searchable, { start: props.start, text: props.text }) })) : (jsxRuntime.jsx(Searchable, { start: props.start, text: props.text })), " "] })) })));
|
|
5713
|
+
}
|
|
5708
5714
|
return (jsxRuntime.jsxs(StyledWord, Object.assign({}, props, { observation: observation, "data-start": props.start, "data-end": props.end, className: !!observation ? "highlighted" : "" }, (!!observation ? { tag: "observation" } : {}), { children: [isActive ? (jsxRuntime.jsx(ActiveWord, { children: jsxRuntime.jsx(Searchable, { start: props.start, text: props.text }) })) : (jsxRuntime.jsx(Searchable, { start: props.start, text: props.text })), " "] })));
|
|
5709
5715
|
};
|
|
5710
5716
|
Highlight.Word = Word;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ISpanProps } from "@zendeskgarden/react-typography";
|
|
2
|
+
import { ReactNode } from "react";
|
|
2
3
|
export interface HighlightArgs {
|
|
3
4
|
/**
|
|
4
5
|
* Applies a font color. Use [PALETTE](/components/palette#palette) colors
|
|
@@ -35,4 +36,5 @@ export interface WordProps extends ISpanProps {
|
|
|
35
36
|
text: string;
|
|
36
37
|
/** Adjusts the font size. By default font size is medium */
|
|
37
38
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl";
|
|
39
|
+
tooltipContent?: ReactNode;
|
|
38
40
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare const DemoTranscript: {
|
|
2
|
+
metadata: {
|
|
3
|
+
transaction_key: string;
|
|
4
|
+
request_id: string;
|
|
5
|
+
sha256: string;
|
|
6
|
+
created: string;
|
|
7
|
+
duration: number;
|
|
8
|
+
channels: number;
|
|
9
|
+
models: string[];
|
|
10
|
+
model_info: {
|
|
11
|
+
"4accafca-a091-473d-8241-f5a847cb5766": {
|
|
12
|
+
name: string;
|
|
13
|
+
version: string;
|
|
14
|
+
arch: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
results: {
|
|
19
|
+
channels: {
|
|
20
|
+
alternatives: {
|
|
21
|
+
transcript: string;
|
|
22
|
+
confidence: number;
|
|
23
|
+
words: {
|
|
24
|
+
word: string;
|
|
25
|
+
start: number;
|
|
26
|
+
end: number;
|
|
27
|
+
confidence: number;
|
|
28
|
+
speaker: number;
|
|
29
|
+
speaker_confidence: number;
|
|
30
|
+
punctuated_word: string;
|
|
31
|
+
}[];
|
|
32
|
+
paragraphs: {
|
|
33
|
+
transcript: string;
|
|
34
|
+
paragraphs: {
|
|
35
|
+
sentences: {
|
|
36
|
+
text: string;
|
|
37
|
+
start: number;
|
|
38
|
+
end: number;
|
|
39
|
+
}[];
|
|
40
|
+
speaker: number;
|
|
41
|
+
num_words: number;
|
|
42
|
+
start: number;
|
|
43
|
+
end: number;
|
|
44
|
+
}[];
|
|
45
|
+
};
|
|
46
|
+
}[];
|
|
47
|
+
}[];
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { HighlightArgs } from "./_types";
|
|
2
|
-
interface StoryArgs extends HighlightArgs {
|
|
3
|
+
export interface StoryArgs extends HighlightArgs {
|
|
3
4
|
words: {
|
|
4
5
|
start: number;
|
|
5
6
|
end: number;
|
|
6
7
|
word: string;
|
|
7
8
|
speaker: number;
|
|
9
|
+
tooltip?: React.ReactNode;
|
|
8
10
|
}[];
|
|
9
11
|
currentTime: number;
|
|
10
12
|
includeSearch?: boolean;
|
|
@@ -12,6 +14,8 @@ interface StoryArgs extends HighlightArgs {
|
|
|
12
14
|
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, StoryArgs>;
|
|
13
15
|
export declare const VideoSync: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, StoryArgs>;
|
|
14
16
|
export declare const WithSearch: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, StoryArgs>;
|
|
17
|
+
export declare const WithTooltip: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, StoryArgs>;
|
|
18
|
+
export declare const Demo: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, StoryArgs>;
|
|
15
19
|
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, HighlightArgs & {
|
|
16
20
|
children?: import("react").ReactNode;
|
|
17
21
|
}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TooltipArgs } from "./_types";
|
|
3
3
|
declare const Tooltip: import("styled-components").IStyledComponent<"web", {
|
|
4
|
+
isTransparent?: boolean | undefined;
|
|
4
5
|
appendToNode?: Element | undefined;
|
|
5
6
|
hasArrow?: boolean | undefined;
|
|
6
7
|
delayMS?: number | undefined;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TooltipArgs } from "./_types";
|
|
2
2
|
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TooltipArgs>;
|
|
3
|
+
export declare const Transparent: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, TooltipArgs>;
|
|
3
4
|
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, TooltipArgs>;
|
|
4
5
|
export default _default;
|