@appquality/unguess-design-system 3.1.96 → 3.1.97
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/CHANGELOG.md +16 -0
- package/build/index.js +27 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
# v3.1.97 (Tue May 28 2024)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Add highlight support to unselectable [#377](https://github.com/AppQuality/unguess-design-system/pull/377) ([@cannarocks](https://github.com/cannarocks))
|
|
6
|
+
- "Improve styling and functionality for transcript diarization in highlight component" [#376](https://github.com/AppQuality/unguess-design-system/pull/376) ([@cannarocks](https://github.com/cannarocks))
|
|
7
|
+
- Fix obs player [#375](https://github.com/AppQuality/unguess-design-system/pull/375) ([@marcbon](https://github.com/marcbon))
|
|
8
|
+
- 🎨 style(bookmark.tsx): improve styling for active bookmarks in player parts [#374](https://github.com/AppQuality/unguess-design-system/pull/374) ([@marcbon](https://github.com/marcbon))
|
|
9
|
+
|
|
10
|
+
#### Authors: 2
|
|
11
|
+
|
|
12
|
+
- Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
|
|
13
|
+
- Marco Bonomo ([@marcbon](https://github.com/marcbon))
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
1
17
|
# v3.1.96 (Mon May 27 2024)
|
|
2
18
|
|
|
3
19
|
#### 🐛 Bug Fix
|
package/build/index.js
CHANGED
|
@@ -4037,6 +4037,9 @@ const StyledGrabber = styled.styled.div `
|
|
|
4037
4037
|
const activeBookMark = styled.css `
|
|
4038
4038
|
height: 250%;
|
|
4039
4039
|
transform: translateY(-30%);
|
|
4040
|
+
cursor: pointer;
|
|
4041
|
+
z-index: 2;
|
|
4042
|
+
border-radius: 4px;
|
|
4040
4043
|
|
|
4041
4044
|
${StyledGrabber} {
|
|
4042
4045
|
display: block;
|
|
@@ -4048,17 +4051,15 @@ const Rect = styled.styled.div `
|
|
|
4048
4051
|
background-color: ${({ hue, theme }) => getColor(hue || theme.palette.grey[800], undefined, undefined, 0.8)};
|
|
4049
4052
|
z-index: 1;
|
|
4050
4053
|
border-radius: 2px;
|
|
4054
|
+
color: white;
|
|
4055
|
+
transition: width 0.1s ease;
|
|
4056
|
+
|
|
4051
4057
|
&:hover {
|
|
4052
|
-
${activeBookMark}
|
|
4053
|
-
border-radius: 4px;
|
|
4054
4058
|
background-color: ${({ hue, theme }) => hue || theme.palette.grey[800]};
|
|
4055
|
-
|
|
4056
|
-
z-index: 2;
|
|
4059
|
+
${activeBookMark}
|
|
4057
4060
|
}
|
|
4058
|
-
color: white;
|
|
4059
|
-
${({ isActive }) => isActive && activeBookMark}
|
|
4060
4061
|
|
|
4061
|
-
|
|
4062
|
+
${({ isActive }) => isActive && activeBookMark}
|
|
4062
4063
|
`;
|
|
4063
4064
|
const StyledTooltip$1 = styled.styled(Tooltip) `
|
|
4064
4065
|
margin-bottom: ${({ theme }) => theme.space.sm};
|
|
@@ -5649,13 +5650,29 @@ const WordsContainer = styled__default["default"].div `
|
|
|
5649
5650
|
*/
|
|
5650
5651
|
const Highlight = (props) => {
|
|
5651
5652
|
const ref = React.useRef(null);
|
|
5653
|
+
const extractText = (selection) => {
|
|
5654
|
+
var range = selection.getRangeAt(0);
|
|
5655
|
+
var tempDiv = document.createElement("div");
|
|
5656
|
+
tempDiv.appendChild(range.cloneContents());
|
|
5657
|
+
var items = tempDiv.querySelectorAll("div");
|
|
5658
|
+
items.forEach(function (item) {
|
|
5659
|
+
if (item.getAttribute("data-unselectable")) {
|
|
5660
|
+
item.remove();
|
|
5661
|
+
}
|
|
5662
|
+
});
|
|
5663
|
+
var filteredText = tempDiv.textContent || tempDiv.innerText;
|
|
5664
|
+
return filteredText.length ? filteredText.trim() : selection.toString();
|
|
5665
|
+
};
|
|
5652
5666
|
const handleSelectionChange = React.useCallback(() => {
|
|
5653
5667
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
5654
5668
|
const activeSelection = document.getSelection();
|
|
5655
|
-
|
|
5656
|
-
if (!activeSelection || !text) {
|
|
5669
|
+
if (!activeSelection) {
|
|
5657
5670
|
return;
|
|
5658
5671
|
}
|
|
5672
|
+
// Extract the text from the selection cleaning unselectable items
|
|
5673
|
+
const text = extractText(activeSelection);
|
|
5674
|
+
if (!text)
|
|
5675
|
+
return;
|
|
5659
5676
|
const anchorNode = (_a = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.anchorNode) === null || _a === void 0 ? void 0 : _a.parentElement;
|
|
5660
5677
|
const focusNode = (_b = activeSelection === null || activeSelection === void 0 ? void 0 : activeSelection.focusNode) === null || _b === void 0 ? void 0 : _b.parentElement;
|
|
5661
5678
|
if (anchorNode &&
|
|
@@ -5686,7 +5703,7 @@ const Word = (props) => {
|
|
|
5686
5703
|
props.currentTime >= props.start &&
|
|
5687
5704
|
props.currentTime < props.end;
|
|
5688
5705
|
// Are there any observations containing this word?
|
|
5689
|
-
const foundObservations = (_a = props.observations) === null || _a === void 0 ? void 0 : _a.map((obs) =>
|
|
5706
|
+
const foundObservations = (_a = props.observations) === null || _a === void 0 ? void 0 : _a.map((obs) => props.start >= obs.start && props.end <= obs.end ? obs : null);
|
|
5690
5707
|
// Get the closer observation to the word
|
|
5691
5708
|
const observation = foundObservations === null || foundObservations === void 0 ? void 0 : foundObservations.reduce((prev, current) => {
|
|
5692
5709
|
if (!prev)
|