Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
🩹 formatting-help must only be in extra options
Signed-off-by: Vinicius Reis <[email protected]>
  • Loading branch information
Vinicius Reis committed Oct 19, 2022
commit 7233fc494e8cc66a9f274f126bd026d74cc55502
45 changes: 45 additions & 0 deletions src/components/Menu/ActionFormattingHelp.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<!--
- @copyright Copyright (c) 2022 Vinicius Reis <[email protected]>
-
- @author Vinicius Reis <[email protected]>
-
- @license GNU AGPL version 3 or any later version
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as
- published by the Free Software Foundation, either version 3 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-->
<template>
<NcActionButton close-after-click
data-text-action-entry="formatting-help"
v-on="$listeners">
<template #icon>
<Help />
</template>
{{ t('text', 'Formatting help') }}
</NcActionButton>
</template>

<script>
import { defineComponent } from 'vue'
import { NcActionButton } from '@nextcloud/vue'
import { Help } from '../icons.js'

export default defineComponent({
name: 'ActionFormattingHelp',
components: {
NcActionButton,
Help,
},
})
</script>
6 changes: 5 additions & 1 deletion src/components/Menu/ActionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
:action-entry="child"
v-on="$listeners"
@trigged="onTrigger" />
<slot name="lastAction" />
</NcActions>
</template>

Expand All @@ -53,7 +54,10 @@ import { useMenuIDMixin } from './MenuBar.provider.js'

export default {
name: 'ActionList',
components: { NcActions, ActionSingle },
components: {
NcActions,
ActionSingle,
},
extends: BaseActionEntry,
mixins: [useStore, useOutlineStateMixin, useMenuIDMixin],
computed: {
Expand Down
28 changes: 25 additions & 3 deletions src/components/Menu/MenuBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,23 @@
:aria-label="t('text', 'Editor actions')">
<ActionEntry v-for="actionEntry of visibleEntries"
v-bind="{ actionEntry }"
:key="`text-action--${actionEntry.key}`"
@call:help="showHelp" />
:key="`text-action--${actionEntry.key}`" />
<ActionList key="text-action--remain"
:action-entry="hiddenEntries"
@update:open="refreshWordCount">
<template #lastAction>
<ActionFormattingHelp @click="showHelp" />
<NcActionSeparator />
<NcActionText data-text-action-entry="character-count">
<template #icon>
<AlphabeticalVariant />
</template>
<template #default>
{{ countString }}
</template>
</NcActionText>
</template>
</ActionList>
</div>
<div class="text-menubar__slot">
<slot />
Expand All @@ -58,17 +73,24 @@ import debounce from 'debounce'
import HelpModal from '../HelpModal.vue'
import actionsFullEntries from './entries.js'
import ActionEntry from './ActionEntry.js'
import ActionList from './ActionList.vue'
import { MENU_ID } from './MenuBar.provider.js'
import { DotsHorizontal } from '../icons.js'
import {
useEditorMixin,
useIsRichEditorMixin,
useIsRichWorkspaceMixin,
} from '../Editor.provider.js'
import ActionFormattingHelp from './ActionFormattingHelp.vue'

export default {
name: 'MenuBar',
components: { ActionEntry, HelpModal },
components: {
ActionList,
ActionEntry,
ActionFormattingHelp,
HelpModal,
},
mixins: [
useEditorMixin,
useIsRichEditorMixin,
Expand Down