2019-11-15 16:29:25 +02:00
|
|
|
<template>
|
2020-02-28 16:39:47 +00:00
|
|
|
<Popover
|
|
|
|
trigger="click"
|
2021-02-01 21:07:40 +02:00
|
|
|
class="ReactButton"
|
2019-11-15 16:29:25 +02:00
|
|
|
placement="top"
|
2020-02-28 16:39:47 +00:00
|
|
|
:offset="{ y: 5 }"
|
2020-11-09 09:40:20 +02:00
|
|
|
:bound-to="{ x: 'container' }"
|
2020-11-25 18:33:08 +02:00
|
|
|
remove-padding
|
2022-05-20 00:56:23 +03:00
|
|
|
popover-class="ReactButton popover-default"
|
2022-01-16 01:01:19 -05:00
|
|
|
@show="onShow"
|
|
|
|
@close="onClose"
|
2019-11-15 16:29:25 +02:00
|
|
|
>
|
2022-07-31 12:35:48 +03:00
|
|
|
<template #content="{close}">
|
2020-01-13 23:34:39 +02:00
|
|
|
<div class="reaction-picker-filter">
|
2020-01-14 10:06:14 +02:00
|
|
|
<input
|
|
|
|
v-model="filterWord"
|
2020-11-01 16:44:57 +02:00
|
|
|
size="1"
|
2020-01-14 10:06:14 +02:00
|
|
|
:placeholder="$t('emoji.search_emoji')"
|
2022-07-31 12:35:48 +03:00
|
|
|
@input="$event.target.composing = false"
|
2020-01-14 10:06:14 +02:00
|
|
|
>
|
2020-01-13 23:34:39 +02:00
|
|
|
</div>
|
2019-11-15 16:29:25 +02:00
|
|
|
<div class="reaction-picker">
|
2020-01-13 23:34:39 +02:00
|
|
|
<span
|
|
|
|
v-for="emoji in commonEmojis"
|
2020-12-06 23:45:34 +02:00
|
|
|
:key="emoji.replacement"
|
2020-01-14 10:06:14 +02:00
|
|
|
class="emoji-button"
|
2022-10-17 22:45:38 +03:00
|
|
|
:title="maybeLocalizedEmojiName(emoji)"
|
2020-12-06 23:45:34 +02:00
|
|
|
@click="addReaction($event, emoji.replacement, close)"
|
2020-01-13 23:34:39 +02:00
|
|
|
>
|
2020-11-28 15:27:58 +02:00
|
|
|
{{ emoji.replacement }}
|
2020-01-13 23:34:39 +02:00
|
|
|
</span>
|
|
|
|
<div class="reaction-picker-divider" />
|
2019-11-15 16:29:25 +02:00
|
|
|
<span
|
|
|
|
v-for="(emoji, key) in emojis"
|
|
|
|
:key="key"
|
2020-01-14 10:06:14 +02:00
|
|
|
class="emoji-button"
|
2022-10-17 22:45:38 +03:00
|
|
|
:title="maybeLocalizedEmojiName(emoji)"
|
2020-02-28 16:39:47 +00:00
|
|
|
@click="addReaction($event, emoji.replacement, close)"
|
2019-11-15 16:29:25 +02:00
|
|
|
>
|
|
|
|
{{ emoji.replacement }}
|
|
|
|
</span>
|
|
|
|
<div class="reaction-bottom-fader" />
|
|
|
|
</div>
|
2021-04-07 22:42:34 +03:00
|
|
|
</template>
|
2022-07-31 12:35:48 +03:00
|
|
|
<template #trigger>
|
2022-06-12 16:32:32 +03:00
|
|
|
<span
|
2021-04-07 22:42:34 +03:00
|
|
|
class="button-unstyled popover-trigger"
|
|
|
|
:title="$t('tool_tip.add_reaction')"
|
|
|
|
>
|
2022-01-16 01:01:19 -05:00
|
|
|
<FALayers>
|
|
|
|
<FAIcon
|
|
|
|
class="fa-scale-110 fa-old-padding"
|
|
|
|
:icon="['far', 'smile-beam']"
|
|
|
|
/>
|
|
|
|
<FAIcon
|
2022-04-16 15:27:35 -04:00
|
|
|
v-show="!expanded"
|
2022-01-16 01:01:19 -05:00
|
|
|
class="focus-marker"
|
|
|
|
transform="shrink-6 up-9 right-17"
|
|
|
|
icon="plus"
|
|
|
|
/>
|
|
|
|
<FAIcon
|
2022-04-16 15:27:35 -04:00
|
|
|
v-show="expanded"
|
2022-01-16 01:01:19 -05:00
|
|
|
class="focus-marker"
|
|
|
|
transform="shrink-6 up-9 right-17"
|
|
|
|
icon="times"
|
|
|
|
/>
|
|
|
|
</FALayers>
|
2022-06-12 16:32:32 +03:00
|
|
|
</span>
|
2021-04-07 22:42:34 +03:00
|
|
|
</template>
|
2020-02-28 16:39:47 +00:00
|
|
|
</Popover>
|
2019-11-15 16:29:25 +02:00
|
|
|
</template>
|
|
|
|
|
2022-07-31 12:35:48 +03:00
|
|
|
<script src="./react_button.js"></script>
|
2019-11-15 16:29:25 +02:00
|
|
|
|
|
|
|
<style lang="scss">
|
2023-01-09 13:02:16 -05:00
|
|
|
@import "../../variables";
|
|
|
|
@import "../../mixins";
|
2019-11-15 16:29:25 +02:00
|
|
|
|
2021-02-03 09:18:44 +02:00
|
|
|
.ReactButton {
|
|
|
|
.reaction-picker-filter {
|
|
|
|
padding: 0.5em;
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
input {
|
|
|
|
flex: 1;
|
|
|
|
}
|
2020-02-11 12:24:51 +00:00
|
|
|
}
|
2020-01-13 23:34:39 +02:00
|
|
|
|
2021-02-03 09:18:44 +02:00
|
|
|
.reaction-picker-divider {
|
|
|
|
height: 1px;
|
|
|
|
width: 100%;
|
|
|
|
margin: 0.5em;
|
|
|
|
background-color: var(--border, $fallback--border);
|
|
|
|
}
|
2020-01-13 23:34:39 +02:00
|
|
|
|
2021-02-03 09:18:44 +02:00
|
|
|
.reaction-picker {
|
|
|
|
width: 10em;
|
|
|
|
height: 9em;
|
|
|
|
font-size: 1.5em;
|
|
|
|
overflow-y: scroll;
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
padding: 0.5em;
|
|
|
|
text-align: center;
|
|
|
|
align-content: flex-start;
|
|
|
|
user-select: none;
|
2023-01-09 13:02:16 -05:00
|
|
|
mask:
|
|
|
|
linear-gradient(to top, white 0, transparent 100%) bottom no-repeat,
|
|
|
|
linear-gradient(to bottom, white 0, transparent 100%) top no-repeat,
|
|
|
|
linear-gradient(to top, white, white);
|
2021-02-03 09:18:44 +02:00
|
|
|
transition: mask-size 150ms;
|
|
|
|
mask-size: 100% 20px, 100% 20px, auto;
|
2019-11-15 16:29:25 +02:00
|
|
|
|
2021-02-03 09:18:44 +02:00
|
|
|
/* Autoprefixed seem to ignore this one, and also syntax is different */
|
2023-01-09 13:02:16 -05:00
|
|
|
mask-composite: xor;
|
2021-02-03 09:18:44 +02:00
|
|
|
mask-composite: exclude;
|
2020-01-14 10:06:14 +02:00
|
|
|
|
2021-02-03 09:18:44 +02:00
|
|
|
.emoji-button {
|
|
|
|
cursor: pointer;
|
|
|
|
flex-basis: 20%;
|
2022-04-20 23:55:34 +03:00
|
|
|
line-height: 1.5;
|
2021-02-03 09:18:44 +02:00
|
|
|
align-content: center;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
transform: scale(1.25);
|
|
|
|
}
|
2020-01-14 10:06:14 +02:00
|
|
|
}
|
|
|
|
}
|
2019-11-15 16:29:25 +02:00
|
|
|
|
2021-02-03 09:18:44 +02:00
|
|
|
.popover-trigger {
|
|
|
|
padding: 10px;
|
|
|
|
margin: -10px;
|
2019-11-15 16:29:25 +02:00
|
|
|
|
2021-02-03 09:18:44 +02:00
|
|
|
&:hover .svg-inline--fa {
|
|
|
|
color: $fallback--text;
|
|
|
|
color: var(--text, $fallback--text);
|
|
|
|
}
|
2022-08-19 08:45:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
.popover-trigger-button {
|
2023-01-09 13:02:16 -05:00
|
|
|
/* override of popover internal stuff */
|
|
|
|
width: auto;
|
|
|
|
|
2022-01-19 21:18:02 -05:00
|
|
|
@include unfocused-style {
|
|
|
|
.focus-marker {
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
2022-01-16 01:01:19 -05:00
|
|
|
}
|
|
|
|
|
2022-01-19 21:18:02 -05:00
|
|
|
@include focused-style {
|
2022-01-16 01:01:19 -05:00
|
|
|
.focus-marker {
|
|
|
|
visibility: visible;
|
|
|
|
}
|
|
|
|
}
|
2019-11-15 16:29:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|