@appquality/unguess-design-system 3.1.91-highlighted-obs → 3.1.91-load-tests
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 +274 -109
- package/build/stories/avatar/InternalAvatar.d.ts +2 -0
- package/build/stories/chat/_types.d.ts +1 -1
- package/build/stories/chat/parts/ThumbnailContainer/Thumbnail.d.ts +2 -2
- package/build/stories/chat/parts/ThumbnailContainer/index.d.ts +0 -8
- package/build/stories/highlight/CreateObservationButton.d.ts +17 -0
- package/build/stories/highlight/_types.d.ts +6 -4
- package/build/stories/highlight/index.stories.d.ts +3 -2
- package/build/stories/player/_types.d.ts +3 -2
- package/build/stories/player/index.d.ts +7 -2
- package/build/stories/player/index.stories.d.ts +1 -0
- package/build/stories/player/parts/CutStart.d.ts +4 -0
- package/build/stories/player/parts/controls.d.ts +2 -1
- package/build/stories/player/parts/floatingControls.d.ts +1 -0
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -642,6 +642,15 @@ Alert.Close = reactNotifications.Close;
|
|
|
642
642
|
|
|
643
643
|
var img$2 = "data:image/svg+xml,%3csvg width='26' height='26' viewBox='0 0 26 26' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M17.2597 12.9199V14.767H17.2367C17.075 17.4452 15.5974 18.969 13.127 18.969C10.4949 18.969 8.92496 17.4452 8.76335 14.767H8.74026V12.9199H5V14.767V14.7901C5.20779 19.4538 8.34777 22.4322 13.1039 22.4322C17.8139 22.4322 20.7922 19.5231 21 14.7901V12.9199H17.2597Z' fill='%23003A57'/%3e%3cpath d='M8.78629 3.5H5.02295V7.26335H8.78629V3.5Z' fill='%2370C38A'/%3e%3cpath d='M20.9768 3.5H17.1672V7.30952H20.9768V3.5Z' fill='%23003A57'/%3e%3c/svg%3e";
|
|
644
644
|
|
|
645
|
+
const StyledInternalAvatar = styled__default["default"].div `
|
|
646
|
+
display: flex;
|
|
647
|
+
align-items: center;
|
|
648
|
+
justify-content: center;
|
|
649
|
+
`;
|
|
650
|
+
const InternalAvatar = () => {
|
|
651
|
+
return (jsxRuntime.jsx(StyledInternalAvatar, { children: jsxRuntime.jsx("img", { alt: "avatar", src: img$2 }) }));
|
|
652
|
+
};
|
|
653
|
+
|
|
645
654
|
const UgAvatar = styled__default["default"](reactAvatars.Avatar) `
|
|
646
655
|
text-transform: uppercase;
|
|
647
656
|
|
|
@@ -673,7 +682,7 @@ const Avatar = (_a) => {
|
|
|
673
682
|
if (type === "text")
|
|
674
683
|
return jsxRuntime.jsx(Avatar.Text, { children: props.children });
|
|
675
684
|
if (type === "system")
|
|
676
|
-
return jsxRuntime.jsx(
|
|
685
|
+
return jsxRuntime.jsx(InternalAvatar, {});
|
|
677
686
|
};
|
|
678
687
|
return (jsxRuntime.jsx(UgAvatar, Object.assign({}, props, { badge: fixedBadge, isSystem: props.avatarType === "system" || isSystem, children: wrapChildren(props.avatarType || "text"), size: props.size || "small" })));
|
|
679
688
|
};
|
|
@@ -2337,40 +2346,26 @@ const ChatContextProvider = ({ onSave, onFileUpload, onDeleteThumbnail, setMenti
|
|
|
2337
2346
|
setEditor,
|
|
2338
2347
|
thumbnails,
|
|
2339
2348
|
setThumbnails,
|
|
2340
|
-
afterUploadCallback: (failed) => {
|
|
2341
|
-
|
|
2342
|
-
if (failed.includes(file.id)) {
|
|
2343
|
-
file.isLoadingMedia = false;
|
|
2344
|
-
//file.isError = true;
|
|
2345
|
-
}
|
|
2346
|
-
else {
|
|
2347
|
-
file.isLoadingMedia = false;
|
|
2348
|
-
//file.isError = false
|
|
2349
|
-
}
|
|
2350
|
-
return file;
|
|
2351
|
-
}));
|
|
2352
|
-
},
|
|
2353
|
-
addThumbnails: ({ files }) => {
|
|
2349
|
+
afterUploadCallback: (failed) => { },
|
|
2350
|
+
addThumbnails: ({ files }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
2354
2351
|
setThumbnails((prev) => [...prev, ...files]);
|
|
2355
|
-
if (onFileUpload)
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
else {
|
|
2366
|
-
file.isError = false;
|
|
2367
|
-
}
|
|
2368
|
-
return file;
|
|
2369
|
-
});
|
|
2352
|
+
if (!onFileUpload)
|
|
2353
|
+
return;
|
|
2354
|
+
try {
|
|
2355
|
+
const data = yield onFileUpload(files);
|
|
2356
|
+
setThumbnails((prev) => {
|
|
2357
|
+
return prev.map(file => {
|
|
2358
|
+
var _a, _b;
|
|
2359
|
+
file.isLoadingMedia = false;
|
|
2360
|
+
file.error = (_b = (_a = data.failed) === null || _a === void 0 ? void 0 : _a.find(f => f.name === file.name)) === null || _b === void 0 ? void 0 : _b.errorCode;
|
|
2361
|
+
return file;
|
|
2370
2362
|
});
|
|
2371
2363
|
});
|
|
2372
2364
|
}
|
|
2373
|
-
|
|
2365
|
+
catch (e) {
|
|
2366
|
+
console.log("Error uploading files", e);
|
|
2367
|
+
}
|
|
2368
|
+
}),
|
|
2374
2369
|
clearInput: () => {
|
|
2375
2370
|
if (editor && !editor.isEmpty) {
|
|
2376
2371
|
editor.commands.clearContent();
|
|
@@ -3115,7 +3110,7 @@ const CommentBar = ({ editor, i18n, }) => {
|
|
|
3115
3110
|
}
|
|
3116
3111
|
};
|
|
3117
3112
|
};
|
|
3118
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(MenuContainer, Object.assign({ id: "menu-container" }, { children: [jsxRuntime.jsx(Tooltip, Object.assign({ content: `${(_b = (_a = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _a === void 0 ? void 0 : _a.bold) !== null && _b !== void 0 ? _b : "Bold text"} ${isMac() ? "Cmd" : "Ctrl"} + B`, placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("bold"), isPrimary: editor.isActive("bold"), isPill: false, onClick: handleBoldClick }, { children: jsxRuntime.jsx(SvgBoldStroke, {}) })) })), jsxRuntime.jsx(Tooltip, Object.assign({ content: `${(_d = (_c = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _c === void 0 ? void 0 : _c.italic) !== null && _d !== void 0 ? _d : "Italic text"} ${isMac() ? "Cmd" : "Ctrl"} + I`, placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("italic"), isPrimary: editor.isActive("italic"), isPill: false, onClick: handleItalicClick }, { children: jsxRuntime.jsx(SvgItalicStroke, {}) })) })), jsxRuntime.jsx(VerticalDivider, {}), jsxRuntime.jsx(Tooltip, Object.assign({ content: (_f = (_e = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _e === void 0 ? void 0 : _e.mention) !== null && _f !== void 0 ? _f : "Add a mention", placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("mention"), isPrimary: editor.isActive("mention"), isPill: false, onClick: handleMentionClick }, { children: jsxRuntime.jsx(SvgAtStroke, {}) })) })), jsxRuntime.jsx(Tooltip, Object.assign({ content: (_h = (_g = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _g === void 0 ? void 0 : _g.attachment) !== null && _h !== void 0 ? _h : (jsxRuntime.jsxs("span", { children: ["Upload images and video.", " ", jsxRuntime.jsxs("span", Object.assign({ style: { color: theme.palette.grey[600] } }, { children: [" ", jsxRuntime.jsx("br", {}), " Max size: 5GB", " "] }))] })), placement: "top", type: "light", size: "small", hasArrow: true }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("attachment"), isPrimary: editor.isActive("attachment"), isPill: false, onClick: handleAttachmentClick }, { children: jsxRuntime.jsx(SvgClipboard, {}) })) }))] })) }));
|
|
3113
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(MenuContainer, Object.assign({ id: "menu-container" }, { children: [jsxRuntime.jsx(Tooltip, Object.assign({ content: `${(_b = (_a = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _a === void 0 ? void 0 : _a.bold) !== null && _b !== void 0 ? _b : "Bold text"} ${isMac() ? "Cmd" : "Ctrl"} + B`, placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("bold"), isPrimary: editor.isActive("bold"), isPill: false, onClick: handleBoldClick }, { children: jsxRuntime.jsx(SvgBoldStroke, {}) })) })), jsxRuntime.jsx(Tooltip, Object.assign({ content: `${(_d = (_c = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _c === void 0 ? void 0 : _c.italic) !== null && _d !== void 0 ? _d : "Italic text"} ${isMac() ? "Cmd" : "Ctrl"} + I`, placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("italic"), isPrimary: editor.isActive("italic"), isPill: false, onClick: handleItalicClick }, { children: jsxRuntime.jsx(SvgItalicStroke, {}) })) })), jsxRuntime.jsx(VerticalDivider, {}), jsxRuntime.jsx(Tooltip, Object.assign({ content: (_f = (_e = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _e === void 0 ? void 0 : _e.mention) !== null && _f !== void 0 ? _f : "Add a mention", placement: "top", type: "light", size: "small", hasArrow: false }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("mention"), isPrimary: editor.isActive("mention"), isPill: false, onClick: handleMentionClick }, { children: jsxRuntime.jsx(SvgAtStroke, {}) })) })), jsxRuntime.jsx(Tooltip, Object.assign({ style: { textAlign: "center" }, content: (_h = (_g = i18n === null || i18n === void 0 ? void 0 : i18n.menu) === null || _g === void 0 ? void 0 : _g.attachment) !== null && _h !== void 0 ? _h : (jsxRuntime.jsxs("span", { children: ["Upload images and video.", " ", jsxRuntime.jsxs("span", Object.assign({ style: { color: theme.palette.grey[600] } }, { children: [" ", jsxRuntime.jsx("br", {}), " Max size: 5GB", " "] }))] })), placement: "top", type: "light", size: "small", hasArrow: true }, { children: jsxRuntime.jsx(IconButton, Object.assign({ size: "small", isBasic: !editor.isActive("attachment"), isPrimary: editor.isActive("attachment"), isPill: false, onClick: handleAttachmentClick }, { children: jsxRuntime.jsx(SvgClipboard, {}) })) }))] })) }));
|
|
3119
3114
|
};
|
|
3120
3115
|
|
|
3121
3116
|
const CustomMention = Mention__default["default"].extend({
|
|
@@ -3398,6 +3393,7 @@ const StyledDeleteThumbnailX = styled__default["default"].div `
|
|
|
3398
3393
|
opacity: 0;
|
|
3399
3394
|
transition: opacity 0.2s;
|
|
3400
3395
|
z-index: 2;
|
|
3396
|
+
color: ${({ theme }) => theme.palette.grey[800]};
|
|
3401
3397
|
`;
|
|
3402
3398
|
const DeleteThumbnailX = ({ deleteThumbnail }) => {
|
|
3403
3399
|
return (jsxRuntime.jsx(StyledDeleteThumbnailX, Object.assign({ className: "deleteThumbnail" }, { children: jsxRuntime.jsx(SvgRemoveMediaIcon, { onClick: (e) => deleteThumbnail(e) }) })));
|
|
@@ -3425,19 +3421,19 @@ const ImageCard = styled__default["default"](SpecialCard) `
|
|
|
3425
3421
|
padding: 0;
|
|
3426
3422
|
position: relative;
|
|
3427
3423
|
overflow: hidden;
|
|
3428
|
-
|
|
3424
|
+
width: 90px;
|
|
3429
3425
|
|
|
3430
3426
|
&:before {
|
|
3431
3427
|
content: "";
|
|
3428
|
+
font-size: ${({ theme }) => theme.fontSizes.xs};
|
|
3432
3429
|
position: absolute;
|
|
3430
|
+
padding: ${({ theme }) => theme.space.xs};
|
|
3433
3431
|
top: 0;
|
|
3434
3432
|
left: 0;
|
|
3435
3433
|
width: 100%;
|
|
3436
3434
|
height: 100%;
|
|
3437
|
-
background-color: ${({ theme }) => theme.palette.grey[800]};
|
|
3438
|
-
opacity: 0;
|
|
3435
|
+
background-color: ${({ theme }) => theme.palette.grey[800]}00; // 0% opacity
|
|
3439
3436
|
transition: opacity 0.2s;
|
|
3440
|
-
z-index: 1;
|
|
3441
3437
|
}
|
|
3442
3438
|
|
|
3443
3439
|
&:hover {
|
|
@@ -3445,12 +3441,26 @@ const ImageCard = styled__default["default"](SpecialCard) `
|
|
|
3445
3441
|
opacity: 1;
|
|
3446
3442
|
}
|
|
3447
3443
|
&:before {
|
|
3448
|
-
|
|
3444
|
+
background-color: ${({ theme }) => theme.palette.grey[800]}4d; // 30% opacity
|
|
3449
3445
|
}
|
|
3450
3446
|
}
|
|
3451
|
-
|
|
3447
|
+
${(p) => p.error &&
|
|
3448
|
+
`
|
|
3449
|
+
&:before{
|
|
3450
|
+
content: "Error: ${p.error}";
|
|
3451
|
+
color: ${p.theme.palette.white};
|
|
3452
|
+
background-color: ${p.theme.palette.grey[800]}b3; // 0.7 opacity
|
|
3453
|
+
}
|
|
3454
|
+
`}
|
|
3455
|
+
${(p) => p.isLoading &&
|
|
3456
|
+
`
|
|
3457
|
+
&:before{
|
|
3458
|
+
background-color: ${p.theme.palette.grey[800]}b3; // 0.7 opacity
|
|
3459
|
+
}
|
|
3460
|
+
`}
|
|
3452
3461
|
&.video {
|
|
3453
3462
|
svg {
|
|
3463
|
+
color: ${({ theme }) => theme.palette.grey[800]};
|
|
3454
3464
|
position: absolute;
|
|
3455
3465
|
top: 50%;
|
|
3456
3466
|
left: 50%;
|
|
@@ -3467,8 +3477,9 @@ const Preview = styled__default["default"].div `
|
|
|
3467
3477
|
align-items: center;
|
|
3468
3478
|
height: 100px;
|
|
3469
3479
|
width: 100%;
|
|
3470
|
-
|
|
3471
|
-
|
|
3480
|
+
color: ${({ theme }) => theme.palette.white};
|
|
3481
|
+
|
|
3482
|
+
${p => p.url &&
|
|
3472
3483
|
`
|
|
3473
3484
|
background-image: url(${p.url});
|
|
3474
3485
|
background-color: ${p.theme.palette.grey[100]};
|
|
@@ -3482,19 +3493,19 @@ const Preview = styled__default["default"].div `
|
|
|
3482
3493
|
height: 100%;
|
|
3483
3494
|
}
|
|
3484
3495
|
`;
|
|
3485
|
-
const Thumbnail = ({ src, type, removeThumbnail, clickThumbnail, showX, isLoadingMedia
|
|
3496
|
+
const Thumbnail = ({ src, type, removeThumbnail, clickThumbnail, showX, isLoadingMedia, error = "", }) => {
|
|
3486
3497
|
const handleCancel = (e) => {
|
|
3487
3498
|
e.stopPropagation();
|
|
3488
3499
|
if (removeThumbnail)
|
|
3489
3500
|
removeThumbnail();
|
|
3490
3501
|
};
|
|
3491
|
-
return (jsxRuntime.
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3502
|
+
return (jsxRuntime.jsx(ImageCard, Object.assign({ onClick: clickThumbnail, className: type.includes("video") ? "video" : "image", error: error, isLoading: isLoadingMedia }, { children: isLoadingMedia ? (jsxRuntime.jsx(Preview, Object.assign({ url: src }, { children: jsxRuntime.jsx(reactLoaders.Spinner, { style: {
|
|
3503
|
+
display: "flex",
|
|
3504
|
+
position: "absolute",
|
|
3505
|
+
color: "white",
|
|
3506
|
+
alignItems: "center",
|
|
3507
|
+
justifyContent: "center",
|
|
3508
|
+
}, size: "large" }) }))) : (jsxRuntime.jsxs(Preview, Object.assign({ url: src }, { children: [showX && (jsxRuntime.jsx(DeleteThumbnailX, { deleteThumbnail: (e) => handleCancel(e) })), type.includes("video") && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("video", Object.assign({ src: src }, { children: jsxRuntime.jsx("track", { kind: "captions" }) })), jsxRuntime.jsx(SvgVideoPlayIcon, { opacity: error ? "0.3" : "1" })] }))] }))) })));
|
|
3498
3509
|
};
|
|
3499
3510
|
|
|
3500
3511
|
const FlexContainer = styled.styled.div `
|
|
@@ -3511,12 +3522,13 @@ const ThumbnailContainer = ({ openLightbox }) => {
|
|
|
3511
3522
|
previewUrl: file.url,
|
|
3512
3523
|
id: file.id,
|
|
3513
3524
|
isLoadingMedia: file.isLoadingMedia,
|
|
3525
|
+
error: file.error,
|
|
3514
3526
|
}));
|
|
3515
3527
|
}, [thumbnails]);
|
|
3516
3528
|
if (!mediaFiles || mediaFiles.length === 0) {
|
|
3517
3529
|
return null;
|
|
3518
3530
|
}
|
|
3519
|
-
return (jsxRuntime.jsx(FlexContainer, { children: mediaFiles.map((file, index) => (jsxRuntime.jsx(Thumbnail, { src: file.previewUrl, showX: true, type: file.fileType, isLoadingMedia: file.isLoadingMedia, removeThumbnail: () => {
|
|
3531
|
+
return (jsxRuntime.jsx(FlexContainer, { children: mediaFiles.map((file, index) => (jsxRuntime.jsx(Thumbnail, { src: file.previewUrl, showX: true, type: file.fileType, isLoadingMedia: file.isLoadingMedia, error: file.error, removeThumbnail: () => {
|
|
3520
3532
|
removeThumbnail(index);
|
|
3521
3533
|
onDeleteThumbnail(file.id);
|
|
3522
3534
|
}, clickThumbnail: () => {
|
|
@@ -4037,6 +4049,9 @@ const StyledGrabber = styled.styled.div `
|
|
|
4037
4049
|
const activeBookMark = styled.css `
|
|
4038
4050
|
height: 250%;
|
|
4039
4051
|
transform: translateY(-30%);
|
|
4052
|
+
cursor: pointer;
|
|
4053
|
+
z-index: 2;
|
|
4054
|
+
border-radius: 4px;
|
|
4040
4055
|
|
|
4041
4056
|
${StyledGrabber} {
|
|
4042
4057
|
display: block;
|
|
@@ -4045,21 +4060,24 @@ const activeBookMark = styled.css `
|
|
|
4045
4060
|
const Rect = styled.styled.div `
|
|
4046
4061
|
position: absolute;
|
|
4047
4062
|
height: 110%;
|
|
4048
|
-
background-color: ${({ hue, theme }) => hue || theme.palette.grey[800]};
|
|
4063
|
+
background-color: ${({ hue, theme }) => getColor(hue || theme.palette.grey[800], undefined, undefined, 0.8)};
|
|
4049
4064
|
z-index: 1;
|
|
4050
4065
|
border-radius: 2px;
|
|
4066
|
+
color: white;
|
|
4067
|
+
transition: width 0.1s ease;
|
|
4068
|
+
|
|
4051
4069
|
&:hover {
|
|
4070
|
+
background-color: ${({ hue, theme }) => hue || theme.palette.grey[800]};
|
|
4052
4071
|
${activeBookMark}
|
|
4053
|
-
border-radius: 4px;
|
|
4054
4072
|
}
|
|
4055
|
-
|
|
4056
|
-
${({ isFocused }) => isFocused && activeBookMark}
|
|
4073
|
+
|
|
4057
4074
|
${({ isActive }) => isActive && activeBookMark}
|
|
4058
|
-
|
|
4075
|
+
${({ isFocused }) => isFocused && activeBookMark}
|
|
4059
4076
|
`;
|
|
4060
4077
|
const StyledTooltip$1 = styled.styled(Tooltip) `
|
|
4061
4078
|
margin-bottom: ${({ theme }) => theme.space.sm};
|
|
4062
4079
|
color: ${({ tooltipColor }) => tooltipColor};
|
|
4080
|
+
|
|
4063
4081
|
`;
|
|
4064
4082
|
const Grabber = (props) => {
|
|
4065
4083
|
const { observation } = props;
|
|
@@ -4086,7 +4104,7 @@ const Bookmark = (props) => {
|
|
|
4086
4104
|
}
|
|
4087
4105
|
if (start > videoEnd || start < videoStart)
|
|
4088
4106
|
return null;
|
|
4089
|
-
return (jsxRuntime.jsx(StyledTooltip$1, Object.assign({ content: tooltipContent, type: "light", size: "large", isTransparent: true }, { children: jsxRuntime.jsxs(Rect, Object.assign({
|
|
4107
|
+
return (jsxRuntime.jsx(StyledTooltip$1, Object.assign({ content: tooltipContent, type: "light", size: "large", isTransparent: true }, { children: jsxRuntime.jsxs(Rect, Object.assign({ isActive: activeBookmark && activeBookmark.id === props.id, hue: hue, isFocused: props.isFocused, style: {
|
|
4090
4108
|
left: `${((start - videoStart) / duration) * 100}%`,
|
|
4091
4109
|
width: `${((end - start) / duration) * 100}%`,
|
|
4092
4110
|
}, onClick: props.onClick }, { children: [jsxRuntime.jsx(Grabber, { observation: props }), jsxRuntime.jsx(Grabber, { isEnd: true, observation: props })] })) })));
|
|
@@ -4294,18 +4312,22 @@ const SvgPlus$1 = props => /*#__PURE__*/React__namespace.createElement("svg", _e
|
|
|
4294
4312
|
fill: "currentColor"
|
|
4295
4313
|
})));
|
|
4296
4314
|
|
|
4315
|
+
// Prevent button from breaking on smaller screens
|
|
4316
|
+
const StyledButton$2 = styled.styled(Button) `
|
|
4317
|
+
overflow: visible;
|
|
4318
|
+
`;
|
|
4297
4319
|
const Cutter = ({ onCutHandler, isCutting, i18n, }) => {
|
|
4298
4320
|
var _a;
|
|
4299
4321
|
const { context } = Video.useVideoContext();
|
|
4300
4322
|
const videoRef = (_a = context.player) === null || _a === void 0 ? void 0 : _a.ref.current;
|
|
4301
4323
|
if (!onCutHandler)
|
|
4302
4324
|
return null;
|
|
4303
|
-
return (jsxRuntime.jsx(
|
|
4325
|
+
return (jsxRuntime.jsx(StyledButton$2, Object.assign({ isPrimary: true, isAccent: !isCutting, size: "small", onClick: (e) => {
|
|
4304
4326
|
if (videoRef) {
|
|
4305
4327
|
onCutHandler(videoRef.currentTime);
|
|
4306
4328
|
}
|
|
4307
4329
|
e.stopPropagation();
|
|
4308
|
-
} }, { children: isCutting ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgTagStroke, {}) }), (i18n === null || i18n === void 0 ? void 0 : i18n.onHighlight) || "End observation"] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgPlus$1, {}) }), (i18n === null || i18n === void 0 ? void 0 : i18n.beforeHighlight) || "Start observation"] })) })));
|
|
4330
|
+
} }, { children: isCutting ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgTagStroke, {}) }), jsxRuntime.jsx(Span, { children: (i18n === null || i18n === void 0 ? void 0 : i18n.onHighlight) || "End observation" })] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Button.StartIcon, { children: jsxRuntime.jsx(SvgPlus$1, {}) }), jsxRuntime.jsx(Span, { children: (i18n === null || i18n === void 0 ? void 0 : i18n.beforeHighlight) || "Start observation" })] })) })));
|
|
4309
4331
|
};
|
|
4310
4332
|
|
|
4311
4333
|
var _path$e;
|
|
@@ -4472,13 +4494,40 @@ function useDebounce(value, delay) {
|
|
|
4472
4494
|
return debouncedValue;
|
|
4473
4495
|
}
|
|
4474
4496
|
|
|
4475
|
-
const
|
|
4497
|
+
const Pin = styled.styled.div `
|
|
4498
|
+
width: 2px;
|
|
4499
|
+
bottom: 0;
|
|
4500
|
+
left: ${({ left }) => `${left}%`};
|
|
4476
4501
|
position: absolute;
|
|
4502
|
+
height: 250%;
|
|
4503
|
+
z-index: 2;
|
|
4504
|
+
background-color: ${({ theme }) => theme.palette.grey[600]};
|
|
4505
|
+
margin-left: -2px; // To not override the current time marker
|
|
4506
|
+
|
|
4507
|
+
&:after {
|
|
4508
|
+
content: "";
|
|
4509
|
+
position: absolute;
|
|
4510
|
+
bottom: 100%;
|
|
4511
|
+
left: 50%;
|
|
4512
|
+
width: 10px;
|
|
4513
|
+
height: 10px;
|
|
4514
|
+
border-radius: 50%;
|
|
4515
|
+
transform: translate(-50%, 0);
|
|
4516
|
+
background-color: ${({ theme }) => theme.palette.grey[600]};
|
|
4517
|
+
}
|
|
4518
|
+
`;
|
|
4519
|
+
const CutStart = ({ left }) => {
|
|
4520
|
+
return jsxRuntime.jsx(Pin, { id: "obs-start-pin", left: left });
|
|
4521
|
+
};
|
|
4522
|
+
|
|
4523
|
+
const ControlsWrapper = styled__default["default"].div `
|
|
4524
|
+
${({ showControls }) => showControls ? "position: relative;" : "position: absolute;"}
|
|
4477
4525
|
bottom: 0;
|
|
4478
4526
|
left: 0;
|
|
4479
4527
|
right: 0;
|
|
4480
4528
|
padding: ${({ theme }) => theme.space.xxs} 0;
|
|
4481
4529
|
background-color: ${({ theme }) => theme.palette.grey[100]};
|
|
4530
|
+
height: 80px;
|
|
4482
4531
|
${({ isPlaying }) => isPlaying && "display: none;"}
|
|
4483
4532
|
z-index: 2;
|
|
4484
4533
|
`;
|
|
@@ -4500,7 +4549,16 @@ const StyledDiv$1 = styled__default["default"].div `
|
|
|
4500
4549
|
display: flex;
|
|
4501
4550
|
align-items: center;
|
|
4502
4551
|
`;
|
|
4503
|
-
const
|
|
4552
|
+
const CurrentTimeMarker = styled__default["default"].div `
|
|
4553
|
+
width: 2px;
|
|
4554
|
+
top: 0;
|
|
4555
|
+
left: ${({ left }) => `${left}%`};
|
|
4556
|
+
position: absolute;
|
|
4557
|
+
height: 110%;
|
|
4558
|
+
z-index: 1;
|
|
4559
|
+
background-color: white;
|
|
4560
|
+
`;
|
|
4561
|
+
const Controls = ({ container, onCutHandler, bookmarks, isCutting, onBookMarkUpdated, i18n, showControls = false, }) => {
|
|
4504
4562
|
var _a, _b, _c;
|
|
4505
4563
|
const [progress, setProgress] = React.useState(0);
|
|
4506
4564
|
const [tooltipMargin, setTooltipMargin] = React.useState(0);
|
|
@@ -4510,6 +4568,7 @@ const Controls = ({ container, onCutHandler, bookmarks, isCutting, onBookMarkUpd
|
|
|
4510
4568
|
const progressRef = React.useRef(null);
|
|
4511
4569
|
const { context, setCurrentTime } = Video.useVideoContext();
|
|
4512
4570
|
const debouncedMark = useDebounce(updatedMark, 500);
|
|
4571
|
+
const [cutStart, setCutStart] = React.useState(0);
|
|
4513
4572
|
const { reset, isGrabbing, activeBookmark, fromEnd } = useProgressContext();
|
|
4514
4573
|
React.useEffect(() => {
|
|
4515
4574
|
setMarks(bookmarks);
|
|
@@ -4585,8 +4644,14 @@ const Controls = ({ container, onCutHandler, bookmarks, isCutting, onBookMarkUpd
|
|
|
4585
4644
|
onBookMarkUpdated === null || onBookMarkUpdated === void 0 ? void 0 : onBookMarkUpdated(debouncedMark);
|
|
4586
4645
|
}
|
|
4587
4646
|
}, [debouncedMark, onBookMarkUpdated]);
|
|
4588
|
-
|
|
4589
|
-
|
|
4647
|
+
React.useEffect(() => {
|
|
4648
|
+
if (isCutting) {
|
|
4649
|
+
setCutStart(progress);
|
|
4650
|
+
}
|
|
4651
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4652
|
+
}, [isCutting]);
|
|
4653
|
+
return (jsxRuntime.jsxs(ControlsWrapper, Object.assign({ showControls: showControls }, (!showControls && { isPlaying: context.isPlaying }), { children: [jsxRuntime.jsxs(ProgressContainer, Object.assign({ onMouseEnter: onMouseEvent, onMouseMove: onMouseEvent, onMouseLeave: onMouseEvent }, { children: [jsxRuntime.jsx(StyledTooltip, Object.assign({ style: { marginLeft: `${tooltipMargin}px` } }, { children: tooltipLabel })), !!duration &&
|
|
4654
|
+
(marks === null || marks === void 0 ? void 0 : marks.map((bookmark, index) => (jsxRuntime.jsx(Bookmark, Object.assign({}, bookmark), `${index}${bookmark.start}`)))), jsxRuntime.jsx(ProgressBar, { ref: progressRef, progress: progress, handleSkipAhead: handleSkipAhead, duration: duration }), isCutting && jsxRuntime.jsx(CutStart, { left: cutStart }), jsxRuntime.jsx(CurrentTimeMarker, { left: progress })] })), jsxRuntime.jsxs(ControlsBar, { children: [jsxRuntime.jsxs(StyledDiv$1, Object.assign({ style: { width: "20%", justifyContent: "start" } }, { children: [jsxRuntime.jsx(AudioButton, {}), jsxRuntime.jsx(TimeLabel, { current: relCurrentTime, duration: duration })] })), jsxRuntime.jsx(ControlsGroupCenter, { style: { width: "60%" } }), jsxRuntime.jsxs(StyledDiv$1, Object.assign({ style: { width: "20%", justifyContent: "end" } }, { children: [jsxRuntime.jsx(Cutter, { onCutHandler: onCutHandler, isCutting: isCutting, i18n: i18n }), jsxRuntime.jsx(FullScreenButton, { container: container })] }))] })] })));
|
|
4590
4655
|
};
|
|
4591
4656
|
|
|
4592
4657
|
var _path$c;
|
|
@@ -4608,8 +4673,9 @@ const FloatingContainer = styled__default["default"].div `
|
|
|
4608
4673
|
top: 0;
|
|
4609
4674
|
left: 0;
|
|
4610
4675
|
right: 0;
|
|
4611
|
-
${({ isPlaying }) => isPlaying && "display: none;"}
|
|
4612
4676
|
z-index: 1;
|
|
4677
|
+
${({ isPlaying }) => isPlaying && "display: none;"}
|
|
4678
|
+
${({ showControls }) => showControls ? "height: 100%" : "height: calc(100% - 80px)"};
|
|
4613
4679
|
`;
|
|
4614
4680
|
const PlayIcon = styled__default["default"](SvgPlayIcon) ``;
|
|
4615
4681
|
const BigButton = styled__default["default"](IconButton) `
|
|
@@ -4634,8 +4700,8 @@ const ButtonsContainer = styled__default["default"].div `
|
|
|
4634
4700
|
height: 100%;
|
|
4635
4701
|
`;
|
|
4636
4702
|
const FloatingControls = (props) => {
|
|
4637
|
-
const { isPlaying, onClick } = props;
|
|
4638
|
-
return (jsxRuntime.jsx(FloatingContainer, Object.assign({ isPlaying: isPlaying, onClick: onClick }, { children: jsxRuntime.jsx(ButtonsContainer, { children: !isPlaying && (jsxRuntime.jsx(BigButton, Object.assign({ isPrimary: true, size: "large" }, { children: jsxRuntime.jsx(PlayIcon, { color: "red" }) }))) }) })));
|
|
4703
|
+
const { isPlaying, showControls, onClick } = props;
|
|
4704
|
+
return (jsxRuntime.jsx(FloatingContainer, Object.assign({ isPlaying: isPlaying, showControls: showControls, onClick: onClick }, { children: jsxRuntime.jsx(ButtonsContainer, { children: !isPlaying && (jsxRuntime.jsx(BigButton, Object.assign({ isPrimary: true, size: "large" }, { children: jsxRuntime.jsx(PlayIcon, { color: "red" }) }))) }) })));
|
|
4639
4705
|
};
|
|
4640
4706
|
|
|
4641
4707
|
const VideoStyle = styled.css `
|
|
@@ -4661,9 +4727,13 @@ const VideoStyle = styled.css `
|
|
|
4661
4727
|
|
|
4662
4728
|
const Container$1 = styled__default["default"].div `
|
|
4663
4729
|
position: relative;
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4730
|
+
${({ showControls }) => !showControls ? `
|
|
4731
|
+
display: flex;
|
|
4732
|
+
flex-direction: column;
|
|
4733
|
+
justify-content: center;
|
|
4734
|
+
` : `
|
|
4735
|
+
margin-bottom: 80px;
|
|
4736
|
+
`}
|
|
4667
4737
|
height: 100%;
|
|
4668
4738
|
width: 100%;
|
|
4669
4739
|
video {
|
|
@@ -4724,7 +4794,9 @@ const PlayerCore = React.forwardRef((props, forwardRef) => {
|
|
|
4724
4794
|
const videoRef = (_a = context.player) === null || _a === void 0 ? void 0 : _a.ref.current;
|
|
4725
4795
|
const isLoaded = !!videoRef;
|
|
4726
4796
|
const containerRef = React.useRef(null);
|
|
4727
|
-
React.useImperativeHandle(forwardRef, () => videoRef, [
|
|
4797
|
+
React.useImperativeHandle(forwardRef, () => videoRef, [
|
|
4798
|
+
videoRef,
|
|
4799
|
+
]);
|
|
4728
4800
|
React.useEffect(() => {
|
|
4729
4801
|
if (videoRef) {
|
|
4730
4802
|
videoRef.addEventListener("pause", () => {
|
|
@@ -4740,7 +4812,9 @@ const PlayerCore = React.forwardRef((props, forwardRef) => {
|
|
|
4740
4812
|
};
|
|
4741
4813
|
}, [setIsPlaying, videoRef]);
|
|
4742
4814
|
return (jsxRuntime.jsxs(Container$1, Object.assign({ isLoaded: isLoaded, isPlaying: context.isPlaying, ref: containerRef }, { children: [!isLoaded ? (jsxRuntime.jsx(VideoSpinner, {})) : (jsxRuntime.jsx(FloatingControls, { isPlaying: context.isPlaying, onClick: togglePlay })), jsxRuntime.jsx(Video__default["default"].Player, { className: "player-container" }), jsxRuntime.jsx(ProgressContextProvider, { children: jsxRuntime.jsx(Controls, { container: containerRef.current, onCutHandler: onCutHandler, bookmarks: bookmarks, isCutting: isCutting, onBookMarkUpdated: props.handleBookmarkUpdate, i18n: props.i18n }) })] })));
|
|
4743
|
-
});
|
|
4815
|
+
});
|
|
4816
|
+
const PlayerProvider = (props) => (jsxRuntime.jsx(Video__default["default"], Object.assign({ src: props.url }, props, { children: props.children })));
|
|
4817
|
+
PlayerProvider.Core = PlayerCore;
|
|
4744
4818
|
|
|
4745
4819
|
const MediaLightBox = ({ header, onClose, slideChange, selectedImageIndex, thumbnails, videoRefs, isOpen, details }) => {
|
|
4746
4820
|
if (!isOpen) {
|
|
@@ -5596,67 +5670,143 @@ const Searchable = ({ text, }) => {
|
|
|
5596
5670
|
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: text });
|
|
5597
5671
|
};
|
|
5598
5672
|
|
|
5599
|
-
const
|
|
5673
|
+
const CreateObservationButton = styled.styled(Button) `
|
|
5674
|
+
user-select: none;
|
|
5675
|
+
position: absolute;
|
|
5676
|
+
left: ${({ position: { x } }) => x}px;
|
|
5677
|
+
top: ${({ position: { y } }) => y}px;
|
|
5678
|
+
transform: translate(-50%, 0);
|
|
5679
|
+
z-index: ${({ theme }) => theme.levels.front};
|
|
5680
|
+
`;
|
|
5681
|
+
|
|
5682
|
+
const getFocusedObs = (observations) => {
|
|
5683
|
+
return observations.find((obs) => obs.isFocused);
|
|
5684
|
+
};
|
|
5685
|
+
const StyledWord = styled__default["default"].div `
|
|
5686
|
+
display: inline-block;
|
|
5600
5687
|
font-size: ${({ theme, size }) => theme.fontSizes[size !== null && size !== void 0 ? size : "md"]};
|
|
5601
5688
|
padding: ${({ theme }) => theme.space.xxs} 0;
|
|
5689
|
+
position: relative;
|
|
5690
|
+
color: ${({ theme }) => theme.palette.grey[700]};
|
|
5691
|
+
white-space: pre;
|
|
5602
5692
|
|
|
5603
|
-
${({
|
|
5604
|
-
var _a
|
|
5605
|
-
return
|
|
5606
|
-
|
|
5607
|
-
|
|
5608
|
-
|
|
5609
|
-
: (_a = observation.hue) !== null && _a !== void 0 ? _a : getColor(theme.palette.azure, 700, undefined, 0.5)};
|
|
5610
|
-
color: ${observation.isFocused ? "black" : (_b = observation.color) !== null && _b !== void 0 ? _b : "white"};
|
|
5693
|
+
${({ observations, theme }) => {
|
|
5694
|
+
var _a;
|
|
5695
|
+
return observations &&
|
|
5696
|
+
observations.length > 0 &&
|
|
5697
|
+
`
|
|
5698
|
+
color: ${(_a = observations[observations.length - 1].color) !== null && _a !== void 0 ? _a : theme.palette.grey[600]};
|
|
5611
5699
|
box-sizing: border-box;
|
|
5700
|
+
font-weight: ${getFocusedObs(observations)
|
|
5701
|
+
? theme.fontWeights.extrabold
|
|
5702
|
+
: theme.fontWeights.semibold};
|
|
5703
|
+
font-style: ${getFocusedObs(observations) ? "italic" : "normal"};
|
|
5704
|
+
z-index: 1;
|
|
5612
5705
|
&:focus {
|
|
5613
5706
|
outline: none;
|
|
5614
5707
|
}
|
|
5615
|
-
|
|
5616
|
-
+ span:not([observation]) {
|
|
5617
|
-
margin-left: 2px;
|
|
5618
|
-
}
|
|
5619
5708
|
`;
|
|
5620
5709
|
}}
|
|
5621
5710
|
`;
|
|
5622
5711
|
const ActiveWord = styled__default["default"].span `
|
|
5712
|
+
position: relative;
|
|
5713
|
+
z-index: 2;
|
|
5623
5714
|
background-color: ${({ theme }) => getColor(theme.palette.fuschia, 400, undefined, 0.4)};
|
|
5624
|
-
padding: 0 2px;
|
|
5625
5715
|
`;
|
|
5626
5716
|
const WordsContainer = styled__default["default"].div `
|
|
5627
5717
|
box-sizing: border-box;
|
|
5628
5718
|
${StyledWord}, span {
|
|
5629
5719
|
&::selection {
|
|
5630
|
-
background-color: ${({ theme }) => getColor(theme.palette.
|
|
5720
|
+
background-color: ${({ theme }) => getColor(theme.palette.grey, 400, undefined, 0.5)};
|
|
5631
5721
|
}
|
|
5632
5722
|
}
|
|
5633
5723
|
`;
|
|
5724
|
+
const Layer = styled__default["default"].div `
|
|
5725
|
+
position: absolute;
|
|
5726
|
+
top: 0;
|
|
5727
|
+
left: 0;
|
|
5728
|
+
width: 100%;
|
|
5729
|
+
height: 100%;
|
|
5730
|
+
z-index: 0;
|
|
5731
|
+
background-color: ${({ color }) => getColor(color, undefined, undefined, 0.2)};
|
|
5732
|
+
`;
|
|
5733
|
+
const textFromSelection = (selection) => {
|
|
5734
|
+
if (!selection || !selection.toString().length)
|
|
5735
|
+
return "";
|
|
5736
|
+
if (selection.anchorNode === null || selection.focusNode === null)
|
|
5737
|
+
return "";
|
|
5738
|
+
var range = selection.getRangeAt(0);
|
|
5739
|
+
var tempDiv = document.createElement("div");
|
|
5740
|
+
tempDiv.appendChild(range.cloneContents());
|
|
5741
|
+
var items = tempDiv.querySelectorAll("div");
|
|
5742
|
+
items.forEach(function (item) {
|
|
5743
|
+
if (item.getAttribute("data-unselectable")) {
|
|
5744
|
+
item.remove();
|
|
5745
|
+
}
|
|
5746
|
+
});
|
|
5747
|
+
var filteredText = tempDiv.textContent || tempDiv.innerText;
|
|
5748
|
+
return filteredText.length ? filteredText.trim() : selection.toString();
|
|
5749
|
+
};
|
|
5634
5750
|
/**
|
|
5635
5751
|
* Use Highlight to use highlight interation on any text element
|
|
5636
5752
|
*/
|
|
5637
5753
|
const Highlight = (props) => {
|
|
5754
|
+
var _a;
|
|
5755
|
+
const { onSelectionButtonClick, search, i18n, children } = props;
|
|
5638
5756
|
const ref = React.useRef(null);
|
|
5757
|
+
const [isSelecting, setIsSelecting] = React.useState(false);
|
|
5758
|
+
const [position, setPosition] = React.useState();
|
|
5759
|
+
const [selection, setSelection] = React.useState();
|
|
5760
|
+
const activeSelection = document.getSelection();
|
|
5761
|
+
const extractText = React.useMemo(() => textFromSelection(activeSelection), [activeSelection]);
|
|
5639
5762
|
const handleSelectionChange = React.useCallback(() => {
|
|
5640
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5763
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
5764
|
+
if (activeSelection && activeSelection.toString().length > 0) {
|
|
5765
|
+
// Extract the text from the selection cleaning unselectable items
|
|
5766
|
+
const text = extractText;
|
|
5767
|
+
if (!text)
|
|
5768
|
+
return;
|
|
5769
|
+
const anchorNode = (_a = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.anchorNode) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
5770
|
+
const focusNode = (_b = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.focusNode) === null || _b === void 0 ? void 0 : _b.parentElement;
|
|
5771
|
+
if (anchorNode &&
|
|
5772
|
+
focusNode &&
|
|
5773
|
+
((_c = ref.current) === null || _c === void 0 ? void 0 : _c.contains(anchorNode)) && // Selection starts inside the ref
|
|
5774
|
+
((_d = ref.current) === null || _d === void 0 ? void 0 : _d.contains(focusNode)) // Selection ends inside the ref
|
|
5775
|
+
) {
|
|
5776
|
+
if (onSelectionButtonClick) {
|
|
5777
|
+
setIsSelecting(true);
|
|
5778
|
+
const range = activeSelection.getRangeAt(0);
|
|
5779
|
+
const rects = range.getClientRects();
|
|
5780
|
+
const lastRect = rects[rects.length - 1];
|
|
5781
|
+
const containerRect = ref && ref.current ? ref.current.getBoundingClientRect() : null;
|
|
5782
|
+
if (!lastRect || !containerRect)
|
|
5783
|
+
return;
|
|
5784
|
+
const relativeY = lastRect.bottom - containerRect.top + ref.current.scrollTop;
|
|
5785
|
+
const relativeX = lastRect.right - containerRect.left + ref.current.scrollLeft;
|
|
5786
|
+
if (relativeY > 0 || relativeX > 0)
|
|
5787
|
+
// Fix to avoid the button to be placed sometimes at the top left corner of the screen (X: 0, Y: 0)
|
|
5788
|
+
setPosition({
|
|
5789
|
+
x: relativeX,
|
|
5790
|
+
y: relativeY + 15,
|
|
5791
|
+
});
|
|
5792
|
+
}
|
|
5793
|
+
else {
|
|
5794
|
+
setIsSelecting(false);
|
|
5795
|
+
}
|
|
5796
|
+
const selectionPart = {
|
|
5797
|
+
from: Math.min(Number.parseFloat((_e = anchorNode.getAttribute("data-start")) !== null && _e !== void 0 ? _e : "0"), Number.parseFloat((_f = focusNode.getAttribute("data-start")) !== null && _f !== void 0 ? _f : "0")),
|
|
5798
|
+
to: Math.max(Number.parseFloat((_g = anchorNode.getAttribute("data-end")) !== null && _g !== void 0 ? _g : "0"), Number.parseFloat((_h = focusNode.getAttribute("data-end")) !== null && _h !== void 0 ? _h : "0")),
|
|
5799
|
+
};
|
|
5800
|
+
setSelection(Object.assign(Object.assign({}, selectionPart), { text }));
|
|
5801
|
+
}
|
|
5802
|
+
else {
|
|
5803
|
+
setIsSelecting(false);
|
|
5804
|
+
}
|
|
5645
5805
|
}
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
if (anchorNode &&
|
|
5649
|
-
focusNode &&
|
|
5650
|
-
((_c = ref.current) === null || _c === void 0 ? void 0 : _c.contains(anchorNode)) && // Selection starts inside the ref
|
|
5651
|
-
((_d = ref.current) === null || _d === void 0 ? void 0 : _d.contains(focusNode)) // Selection ends inside the ref
|
|
5652
|
-
) {
|
|
5653
|
-
const selectionPart = {
|
|
5654
|
-
from: Math.min(Number.parseFloat((_e = anchorNode.getAttribute("data-start")) !== null && _e !== void 0 ? _e : "0"), Number.parseFloat((_f = focusNode.getAttribute("data-start")) !== null && _f !== void 0 ? _f : "0")),
|
|
5655
|
-
to: Math.max(Number.parseFloat((_g = anchorNode.getAttribute("data-end")) !== null && _g !== void 0 ? _g : "0"), Number.parseFloat((_h = focusNode.getAttribute("data-end")) !== null && _h !== void 0 ? _h : "0")),
|
|
5656
|
-
};
|
|
5657
|
-
(_j = props === null || props === void 0 ? void 0 : props.handleSelection) === null || _j === void 0 ? void 0 : _j.call(props, Object.assign(Object.assign({}, selectionPart), { text }));
|
|
5806
|
+
else {
|
|
5807
|
+
setIsSelecting(false);
|
|
5658
5808
|
}
|
|
5659
|
-
}, [
|
|
5809
|
+
}, [activeSelection, extractText, onSelectionButtonClick]);
|
|
5660
5810
|
React.useEffect(() => {
|
|
5661
5811
|
if (ref.current === null)
|
|
5662
5812
|
return;
|
|
@@ -5665,19 +5815,29 @@ const Highlight = (props) => {
|
|
|
5665
5815
|
document.removeEventListener("selectionchange", handleSelectionChange);
|
|
5666
5816
|
};
|
|
5667
5817
|
}, [ref, props, handleSelectionChange]);
|
|
5668
|
-
return (jsxRuntime.
|
|
5818
|
+
return (jsxRuntime.jsxs(HighlightContextProvider, Object.assign({ term: search }, { children: [jsxRuntime.jsx(WordsContainer, Object.assign({ ref: ref }, { children: children })), onSelectionButtonClick && isSelecting && selection && (jsxRuntime.jsxs(CreateObservationButton, Object.assign({ isAccent: true, isPrimary: true, position: position !== null && position !== void 0 ? position : {
|
|
5819
|
+
x: 0,
|
|
5820
|
+
y: 0,
|
|
5821
|
+
}, onClick: () => onSelectionButtonClick(selection) }, { children: [jsxRuntime.jsx(CreateObservationButton.StartIcon, { children: jsxRuntime.jsx(SvgTagStroke, {}) }), (_a = i18n === null || i18n === void 0 ? void 0 : i18n.selectionButtonLabel) !== null && _a !== void 0 ? _a : "Create observation"] })))] })));
|
|
5669
5822
|
};
|
|
5670
5823
|
const Word = (props) => {
|
|
5671
|
-
var _a;
|
|
5672
5824
|
const isActive = props.currentTime &&
|
|
5673
5825
|
props.currentTime >= props.start &&
|
|
5674
5826
|
props.currentTime < props.end;
|
|
5675
|
-
//
|
|
5676
|
-
const
|
|
5677
|
-
|
|
5678
|
-
return (
|
|
5827
|
+
// Are there any observations containing this word?
|
|
5828
|
+
const foundObservations = React.useMemo(() => {
|
|
5829
|
+
var _a, _b;
|
|
5830
|
+
return (_b = (_a = props.observations) === null || _a === void 0 ? void 0 : _a.filter((obs) => props.start >= obs.start && props.end <= obs.end)) !== null && _b !== void 0 ? _b : [];
|
|
5831
|
+
}, [props.observations, props.start, props.end]);
|
|
5832
|
+
const ObsWord = React.useMemo(() => (jsxRuntime.jsxs(StyledWord, Object.assign({}, props, { "data-start": props.start, "data-end": props.end, className: foundObservations.length > 0 ? "highlighted" : "" }, (foundObservations && { observations: foundObservations }), { children: [foundObservations.length > 0 &&
|
|
5833
|
+
foundObservations.map((obs) => {
|
|
5834
|
+
var _a;
|
|
5835
|
+
return (jsxRuntime.jsx(Layer, { color: (_a = obs.hue) !== null && _a !== void 0 ? _a : theme.palette.grey[600] }, obs.id));
|
|
5836
|
+
}), isActive ? (jsxRuntime.jsx(ActiveWord, Object.assign({ "data-start": props.start, "data-end": props.end }, { children: jsxRuntime.jsx(Searchable, { text: props.text }) }))) : (jsxRuntime.jsx(Searchable, { text: props.text })), " "] }))), [props, foundObservations, isActive]);
|
|
5837
|
+
if (props.tooltipContent !== undefined && foundObservations.length > 0) {
|
|
5838
|
+
return (jsxRuntime.jsx(Tooltip, Object.assign({ content: props.tooltipContent(foundObservations), isTransparent: true }, { children: ObsWord })));
|
|
5679
5839
|
}
|
|
5680
|
-
return
|
|
5840
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: ObsWord });
|
|
5681
5841
|
};
|
|
5682
5842
|
Highlight.Word = Word;
|
|
5683
5843
|
|
|
@@ -7103,6 +7263,10 @@ Object.defineProperty(exports, 'ModalClose', {
|
|
|
7103
7263
|
enumerable: true,
|
|
7104
7264
|
get: function () { return reactModals.Close; }
|
|
7105
7265
|
});
|
|
7266
|
+
Object.defineProperty(exports, 'useVideoContext', {
|
|
7267
|
+
enumerable: true,
|
|
7268
|
+
get: function () { return Video.useVideoContext; }
|
|
7269
|
+
});
|
|
7106
7270
|
exports.Accordion = Accordion;
|
|
7107
7271
|
exports.Alert = Alert;
|
|
7108
7272
|
exports.Anchor = Anchor;
|
|
@@ -7200,6 +7364,7 @@ exports.Pagination = Pagination;
|
|
|
7200
7364
|
exports.Paragraph = Paragraph;
|
|
7201
7365
|
exports.PieChart = PieChart;
|
|
7202
7366
|
exports.Player = Player;
|
|
7367
|
+
exports.PlayerProvider = PlayerProvider;
|
|
7203
7368
|
exports.PreviousItem = PreviousItem;
|
|
7204
7369
|
exports.ProductCard = ProductCard;
|
|
7205
7370
|
exports.ProfileModal = ProfileModal;
|
|
@@ -5,7 +5,7 @@ interface Props {
|
|
|
5
5
|
isLoadingMedia?: boolean;
|
|
6
6
|
removeThumbnail?: () => void;
|
|
7
7
|
showX?: boolean;
|
|
8
|
-
|
|
8
|
+
error?: string;
|
|
9
9
|
}
|
|
10
|
-
declare const Thumbnail: ({ src, type, removeThumbnail, clickThumbnail, showX, isLoadingMedia,
|
|
10
|
+
declare const Thumbnail: ({ src, type, removeThumbnail, clickThumbnail, showX, isLoadingMedia, error, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export default Thumbnail;
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
export interface FileElement {
|
|
2
|
-
fileName: string;
|
|
3
|
-
fileType: string;
|
|
4
|
-
errorCode?: "FILE_TOO_BIG" | "INVALID_FILE_EXTENSION" | "GENERIC_ERROR";
|
|
5
|
-
previewUrl: string;
|
|
6
|
-
internal_id: string;
|
|
7
|
-
isLoadingMedia: boolean;
|
|
8
|
-
}
|
|
9
1
|
interface Props {
|
|
10
2
|
openLightbox: (index: number) => void;
|
|
11
3
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare const CreateObservationButton: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("../buttons/button/_types").ButtonArgs & import("react").RefAttributes<HTMLButtonElement>, {
|
|
3
|
+
position: {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
};
|
|
7
|
+
}>> & import("react").ForwardRefExoticComponent<import("../buttons/button/_types").ButtonArgs & import("react").RefAttributes<HTMLButtonElement>> & {
|
|
8
|
+
EndIcon: {
|
|
9
|
+
(props: import("@zendeskgarden/react-buttons").IButtonEndIconProps): JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
StartIcon: {
|
|
13
|
+
(props: import("@zendeskgarden/react-buttons").IButtonEndIconProps): JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export { CreateObservationButton };
|
|
@@ -15,12 +15,15 @@ export interface HighlightArgs {
|
|
|
15
15
|
isMonospace?: boolean;
|
|
16
16
|
/** Adjusts the font size. By default font size is medium */
|
|
17
17
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl";
|
|
18
|
-
|
|
18
|
+
search?: string;
|
|
19
|
+
onSelectionButtonClick?: (part: {
|
|
19
20
|
from: number;
|
|
20
21
|
to: number;
|
|
21
22
|
text: string;
|
|
22
23
|
}) => void;
|
|
23
|
-
|
|
24
|
+
i18n?: {
|
|
25
|
+
selectionButtonLabel: string;
|
|
26
|
+
};
|
|
24
27
|
}
|
|
25
28
|
export interface Observation extends Omit<IBookmark, "onClick"> {
|
|
26
29
|
color?: string;
|
|
@@ -31,7 +34,6 @@ export interface WordProps extends ISpanProps {
|
|
|
31
34
|
currentTime?: number;
|
|
32
35
|
observations?: Observation[];
|
|
33
36
|
text: string;
|
|
34
|
-
/** Adjusts the font size. By default font size is medium */
|
|
35
37
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "xxl" | "xxxl";
|
|
36
|
-
tooltipContent?: (
|
|
38
|
+
tooltipContent?: (observations: Observation[]) => ReactNode;
|
|
37
39
|
}
|
|
@@ -7,9 +7,10 @@ export interface StoryArgs extends HighlightArgs {
|
|
|
7
7
|
includeSearch?: boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, StoryArgs>;
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const WithSearch: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, StoryArgs>;
|
|
10
|
+
export declare const WithSelectionButton: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, StoryArgs>;
|
|
12
11
|
export declare const WithTooltip: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, StoryArgs>;
|
|
12
|
+
export declare const WithSearch: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, StoryArgs>;
|
|
13
|
+
export declare const VideoSync: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, StoryArgs>;
|
|
13
14
|
export declare const Demo: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, StoryArgs>;
|
|
14
15
|
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, HighlightArgs & {
|
|
15
16
|
children?: import("react").ReactNode;
|
|
@@ -9,6 +9,7 @@ export interface PlayerArgs extends HTMLAttributes<HTMLVideoElement> {
|
|
|
9
9
|
bookmarks?: IBookmark[];
|
|
10
10
|
handleBookmarkUpdate?: (bookmark: IBookmark) => void;
|
|
11
11
|
i18n?: PlayerI18n;
|
|
12
|
+
showControls?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export interface PlayerI18n {
|
|
14
15
|
beforeHighlight?: string;
|
|
@@ -21,14 +22,14 @@ export interface IBookmark {
|
|
|
21
22
|
hue?: string;
|
|
22
23
|
label?: string;
|
|
23
24
|
tooltipContent?: ReactNode;
|
|
25
|
+
isFocused?: boolean;
|
|
24
26
|
onClick?: () => void;
|
|
25
27
|
tags?: VideoTag[];
|
|
26
|
-
isFocused?: boolean;
|
|
27
|
-
isActive?: boolean;
|
|
28
28
|
}
|
|
29
29
|
export interface WrapperProps {
|
|
30
30
|
isPlaying?: boolean;
|
|
31
31
|
isLoaded?: boolean;
|
|
32
|
+
showControls?: boolean;
|
|
32
33
|
}
|
|
33
34
|
type VideoTag = {
|
|
34
35
|
group: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { useVideoContext } from "@appquality/stream-player";
|
|
2
|
+
import { PropsWithChildren } from "react";
|
|
2
3
|
import { PlayerArgs } from "./_types";
|
|
3
4
|
/**
|
|
4
5
|
* The Player is a styled media tag with custom controls
|
|
@@ -7,4 +8,8 @@ import { PlayerArgs } from "./_types";
|
|
|
7
8
|
- To display a video
|
|
8
9
|
*/
|
|
9
10
|
declare const Player: import("react").ForwardRefExoticComponent<PlayerArgs & import("react").RefAttributes<HTMLVideoElement>>;
|
|
10
|
-
|
|
11
|
+
declare const PlayerProvider: {
|
|
12
|
+
(props: PropsWithChildren<PlayerArgs>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
Core: import("react").ForwardRefExoticComponent<PlayerArgs & import("react").RefAttributes<HTMLVideoElement>>;
|
|
14
|
+
};
|
|
15
|
+
export { Player, PlayerProvider, useVideoContext };
|
|
@@ -4,5 +4,6 @@ interface PlayerStoryArgs extends PlayerArgs {
|
|
|
4
4
|
export declare const Basic: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, PlayerStoryArgs>;
|
|
5
5
|
export declare const Streaming: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, PlayerStoryArgs>;
|
|
6
6
|
export declare const WithBookmarks: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, PlayerStoryArgs>;
|
|
7
|
+
export declare const WithContext: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, PlayerStoryArgs>;
|
|
7
8
|
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, PlayerArgs & import("react").RefAttributes<HTMLVideoElement>>;
|
|
8
9
|
export default _default;
|
|
@@ -268,11 +268,12 @@ export declare const ControlsBar: import("styled-components").IStyledComponent<"
|
|
|
268
268
|
onTransitionEnd?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
269
269
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
270
270
|
}>;
|
|
271
|
-
export declare const Controls: ({ container, onCutHandler, bookmarks, isCutting, onBookMarkUpdated, i18n, }: {
|
|
271
|
+
export declare const Controls: ({ container, onCutHandler, bookmarks, isCutting, onBookMarkUpdated, i18n, showControls, }: {
|
|
272
272
|
container: HTMLDivElement | null;
|
|
273
273
|
onCutHandler?: ((time: number) => void) | undefined;
|
|
274
274
|
bookmarks?: IBookmark[] | undefined;
|
|
275
275
|
isCutting?: boolean | undefined;
|
|
276
276
|
onBookMarkUpdated?: ((bookmark: IBookmark) => void) | undefined;
|
|
277
277
|
i18n?: PlayerI18n | undefined;
|
|
278
|
+
showControls?: boolean | undefined;
|
|
278
279
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,5 +3,6 @@ import { WrapperProps } from "../_types";
|
|
|
3
3
|
export declare const FloatingContainer: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, WrapperProps>>;
|
|
4
4
|
export declare const FloatingControls: (props: {
|
|
5
5
|
isPlaying?: boolean;
|
|
6
|
+
showControls?: boolean;
|
|
6
7
|
onClick?: () => void;
|
|
7
8
|
}) => import("react/jsx-runtime").JSX.Element;
|