@appquality/unguess-design-system 3.1.91-highlight-5 → 3.1.91-highlight-7
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 +1 -19
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -7646,7 +7646,7 @@ const useEditor = ({ content, observations, currentTime, onSetCurrentTime, }, de
|
|
|
7646
7646
|
content: content.map((paragraph) => {
|
|
7647
7647
|
function getWords() {
|
|
7648
7648
|
return paragraph.words.map((word) => {
|
|
7649
|
-
const observationsInThisWord = observations === null || observations === void 0 ? void 0 : observations.filter((observation) => observation.start
|
|
7649
|
+
const observationsInThisWord = observations === null || observations === void 0 ? void 0 : observations.filter((observation) => observation.start <= word.start && observation.end >= word.end);
|
|
7650
7650
|
function getWordContent() {
|
|
7651
7651
|
const textContent = [
|
|
7652
7652
|
{
|
|
@@ -7723,24 +7723,6 @@ const useEditor = ({ content, observations, currentTime, onSetCurrentTime, }, de
|
|
|
7723
7723
|
return;
|
|
7724
7724
|
ed.commands.updateCurrentActive({ currentWord });
|
|
7725
7725
|
}, [currentTime, content, ed]);
|
|
7726
|
-
React.useEffect(() => {
|
|
7727
|
-
if (!observations)
|
|
7728
|
-
return;
|
|
7729
|
-
if (!ed)
|
|
7730
|
-
return;
|
|
7731
|
-
const selection = ed.state.selection;
|
|
7732
|
-
observations.forEach((observation) => {
|
|
7733
|
-
const startWord = ed.$node("Word", { "data-start": observation.start });
|
|
7734
|
-
const endWord = ed.$node("Word", { "data-end": observation.end });
|
|
7735
|
-
if (!startWord || !endWord)
|
|
7736
|
-
return;
|
|
7737
|
-
ed.chain()
|
|
7738
|
-
.setTextSelection({ from: startWord.pos, to: endWord.pos })
|
|
7739
|
-
.addObservation(observation.type, observation.text)
|
|
7740
|
-
.setTextSelection(selection.from)
|
|
7741
|
-
.run();
|
|
7742
|
-
});
|
|
7743
|
-
}, [observations, ed]);
|
|
7744
7726
|
return ed;
|
|
7745
7727
|
};
|
|
7746
7728
|
|