Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 16 additions & 0 deletions cypress/e2e/workspace.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,22 @@ describe('Workspace', function() {
.should('not.contain', 'content')
})

it('emoji picker', () => {
cy.openWorkspace()
.type('# Let\'s smile together{enter}## ')

menuButton('emoji-picker')
.click()

cy.get('#emoji-mart-list button[aria-label="😀, grinning"]')
.first()
.click()

cy.getEditor()
.find('h2')
.contains('😀')
})

describe('callouts', () => {
const types = ['info', 'warn', 'error', 'success']

Expand Down
4 changes: 2 additions & 2 deletions js/editor-rich.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor-rich.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/files-modal.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/files-modal.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions js/text-files.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-files.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-public.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-text.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-text.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-viewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-viewer.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/components/Menu/ActionAttachmentUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
:data-text-action-entry="actionEntry.key"
:title="actionEntry.label"
:aria-label="actionEntry.label"
:container="menuIDSelector"
role="menu"
aria-haspopup>
<template #icon>
Expand Down Expand Up @@ -59,6 +60,7 @@ import { NcActions, NcActionButton } from '@nextcloud/vue'
import { Loading, Folder, Upload } from '../icons.js'
import { useIsPublicMixin } from '../Editor.provider.js'
import { BaseActionEntry } from './BaseActionEntry.js'
import { useMenuIDMixin } from './MenuBar.provider.js'
import {
useActionAttachmentPromptMixin,
useUploadingStateMixin,
Expand All @@ -80,6 +82,7 @@ export default {
useActionAttachmentPromptMixin,
useUploadingStateMixin,
useActionChooseLocalAttachmentMixin,
useMenuIDMixin,
],
computed: {
icon() {
Expand Down
4 changes: 3 additions & 1 deletion src/components/Menu/ActionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
class="entry-list-action entry-action"
role="menu"
v-bind="state"
:container="menuIDSelector"
:aria-label="actionEntry.label"
:title="actionEntry.label"
:data-text-action-entry="actionEntry.key"
Expand All @@ -48,12 +49,13 @@ import ActionSingle from './ActionSingle.vue'
import { getIsActive } from './utils.js'
import { useOutlineStateMixin } from '../Editor/Wrapper.provider.js'
import useStore from '../../mixins/store.js'
import { useMenuIDMixin } from './MenuBar.provider.js'

export default {
name: 'ActionList',
components: { NcActions, ActionSingle },
extends: BaseActionEntry,
mixins: [useStore, useOutlineStateMixin],
mixins: [useStore, useOutlineStateMixin, useMenuIDMixin],
computed: {
currentChild() {
const {
Expand Down
8 changes: 4 additions & 4 deletions src/components/Menu/EmojiPickerAction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
<template>
<NcEmojiPicker class="entry-action entry-action__emoji"
:data-text-action-entry="actionEntry.key"
@selectData="addEmoji">
:container="menuIDSelector"
@select-data="addEmoji">
<NcButton v-tooltip="actionEntry.label"
class="entry-action__button"
role="menu"
Expand All @@ -39,6 +40,7 @@
<script>
import { BaseActionEntry } from './BaseActionEntry.js'
import { NcEmojiPicker, NcButton } from '@nextcloud/vue'
import { useMenuIDMixin } from './MenuBar.provider.js'

export default {
name: 'EmojiPickerAction',
Expand All @@ -47,10 +49,8 @@ export default {
NcButton,
},
extends: BaseActionEntry,
mixins: [useMenuIDMixin],
methods: {
toggleChildMenu() {

},
addEmoji({ id, native }) {
this.actionEntry
.action(this.$editor.chain(), { id, native })
Expand Down
12 changes: 12 additions & 0 deletions src/components/Menu/MenuBar.provider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export const MENU_ID = Symbol('menu::id')

export const useMenuIDMixin = {
inject: {
$menuID: { from: MENU_ID, default: null },
},
computed: {
menuIDSelector() {
return `#${this.$menuID}`
},
},
}
16 changes: 15 additions & 1 deletion src/components/Menu/MenuBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
-->

<template>
<div class="text-menubar"
<div :id="randomID"
class="text-menubar"
data-text-el="menubar"
role="menubar"
:aria-label="t('text', 'Formatting menu bar')"
Expand Down Expand Up @@ -57,6 +58,7 @@ import debounce from 'debounce'
import HelpModal from '../HelpModal.vue'
import actionsFullEntries from './entries.js'
import ActionEntry from './ActionEntry.js'
import { MENU_ID } from './MenuBar.provider.js'
import { DotsHorizontal } from '../icons.js'
import {
useEditorMixin,
Expand All @@ -72,6 +74,17 @@ export default {
useIsRichEditorMixin,
useIsRichWorkspaceMixin,
],
provide() {
const val = {}

Object.defineProperties(val, {
[MENU_ID]: {
get: () => this.randomID,
},
})

return val
},
props: {
autohide: {
type: Boolean,
Expand All @@ -80,6 +93,7 @@ export default {
},
data() {
return {
randomID: `menu-bar-${(Math.ceil((Math.random() * 10000) + 500)).toString(16)}`,
displayHelp: false,
forceRecompute: 0,
isReady: false,
Expand Down