Skip to content

Commit 9b397f9

Browse files
committed
feat(writing-tools): Add button to open writing tools settings
1 parent 33e5fa7 commit 9b397f9

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

entrypoints/content/components/WritingTools/EditableEntry.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@
5151
<IconSparkle class="w-4 h-4" />
5252
{{ t('writing_tools.sparkle') }}
5353
</button>
54+
<button
55+
class="bg-bg-primary border-0 cursor-pointer hover:bg-bg-hover h-7 w-7 flex items-center justify-center"
56+
aria-label="Open writing tools settings"
57+
@click.stop="onOpenSettings"
58+
>
59+
<IconDotsVertical class="w-4 h-4" />
60+
</button>
5461
<!-- <button
5562
class="mr-1 text-text-secondary bg-bg-neutral-subtle hover:bg-bg-hover border-0 cursor-pointer p-1 rounded-full"
5663
@click="onCloseToolBar"
@@ -82,6 +89,7 @@
8289
import { useElementBounding, useEventListener } from '@vueuse/core'
8390
import { computed, ref, UnwrapRef, watch } from 'vue'
8491
92+
import IconDotsVertical from '@/assets/icons/dots-vertical.svg?component'
8593
import IconList from '@/assets/icons/writing-tools-list.svg?component'
8694
import IconProofread from '@/assets/icons/writing-tools-proofread.svg?component'
8795
// import IconClose from '@/assets/icons/close.svg?component'
@@ -95,6 +103,7 @@ import { useRefSnapshot } from '@/composables/useRefSnapshot'
95103
import { MIN_SELECTION_LENGTH_TO_SHOW_WRITING_TOOLS } from '@/utils/constants'
96104
import { useI18n } from '@/utils/i18n'
97105
import { getCommonAncestorElement, getEditableElementSelectedText, getSelectionBoundingRectWithinElement, isContentEditableElement, isEditorFrameworkElement, isInputOrTextArea, replaceContentInRange } from '@/utils/selection'
106+
import { showSettings } from '@/utils/settings'
98107
import { extendedComputed } from '@/utils/vue/utils'
99108
100109
import SuggestionCard from './SuggestionCard.vue'
@@ -193,6 +202,10 @@ const onMouseEnterToolBar = () => {
193202
snapshotForEnterToolBar.updateSnapshot()
194203
}
195204
205+
const onOpenSettings = async () => {
206+
await showSettings({ path: 'writing-tools' })
207+
}
208+
196209
const updateEditableElementText = () => {
197210
if (props.editableElement.tagName === 'TEXTAREA' || props.editableElement.tagName === 'INPUT') {
198211
editableElementText.value = (props.editableElement as HTMLTextAreaElement | HTMLInputElement).value

0 commit comments

Comments
 (0)