From a7df777b0b891172e0d269bbe0b024726b6021ea Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Wed, 21 Feb 2024 21:57:30 +0100 Subject: [PATCH] Integrate highlighting into module component --- client/src/components/modules/Module.vue | 174 ++++++++++++++---- .../graphql/gql/fragments/highlightParts.gql | 8 + .../src/graphql/gql/fragments/moduleParts.gql | 4 + client/src/pages/module/module.vue | 1 + 4 files changed, 152 insertions(+), 35 deletions(-) diff --git a/client/src/components/modules/Module.vue b/client/src/components/modules/Module.vue index 57d5107b..8e30f1cb 100644 --- a/client/src/components/modules/Module.vue +++ b/client/src/components/modules/Module.vue @@ -54,6 +54,8 @@ />
@@ -100,44 +102,146 @@ import ObjectiveGroups from '@/components/objective-groups/ObjectiveGroups.vue'; import Chapter from '@/components/Chapter.vue'; import BookmarkActions from '@/components/notes/BookmarkActions.vue'; import Pill from '@/components/ui/Pill.vue'; - +import { + SelectionHandlerType, + SelectionHandlerOptions, + getSelectionHandler, + createHighlightCurry, + markHighlight, +} from '@/helpers/highlight'; +import { onMounted, onUnmounted, ref, watch, computed } from 'vue'; +import { AddHighlightArgument, HighlightNode, ModuleNode } from '@/__generated__/graphql'; +import { graphql } from '@/__generated__'; +import highlightSidebar from '@/helpers/highlight-sidebar'; +import { doUpdateHighlight } from '@/graphql/mutations'; +import Mark from 'mark.js'; +import { useRoute } from 'vue-router'; -