Merge branch 'vue3-again' into shigusegubu-vue3
* vue3-again: fix misc warnings properly implement resettableAsyncComponent fix opacity control again rename some binding hooks according to new names fix warnings fix some more warnings remove some warnings
This commit is contained in:
commit
4b3f525a8e
15 changed files with 32 additions and 33 deletions
|
|
@ -17,6 +17,7 @@ import FaviconService from '../services/favicon_service/favicon_service.js'
|
||||||
|
|
||||||
// disable compat for certain features
|
// disable compat for certain features
|
||||||
configureCompat({
|
configureCompat({
|
||||||
|
ATTR_FALSE_VALUE: false,
|
||||||
COMPONENT_V_MODEL: false,
|
COMPONENT_V_MODEL: false,
|
||||||
INSTANCE_SET: false,
|
INSTANCE_SET: false,
|
||||||
RENDER_FUNCTION: false
|
RENDER_FUNCTION: false
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
emits: ['resetAsyncComponent'],
|
||||||
methods: {
|
methods: {
|
||||||
retry () {
|
retry () {
|
||||||
this.$emit('resetAsyncComponent')
|
this.$emit('resetAsyncComponent')
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@
|
||||||
</span>
|
</span>
|
||||||
<span v-if="notification.type === 'pleroma:emoji_reaction'">
|
<span v-if="notification.type === 'pleroma:emoji_reaction'">
|
||||||
<small>
|
<small>
|
||||||
<i18n-t keypath="notifications.reacted_with">
|
<i18n-t scope="global" keypath="notifications.reacted_with">
|
||||||
<span class="emoji-reaction-emoji">{{ notification.emoji }}</span>
|
<span class="emoji-reaction-emoji">{{ notification.emoji }}</span>
|
||||||
</i18n-t>
|
</i18n-t>
|
||||||
</small>
|
</small>
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
:id="name"
|
:id="name"
|
||||||
class="input-number"
|
class="input-number"
|
||||||
type="number"
|
type="number"
|
||||||
:value="value || fallback"
|
:value="modelValue || fallback"
|
||||||
:disabled="!present || disabled"
|
:disabled="!present || disabled"
|
||||||
max="1"
|
max="1"
|
||||||
min="0"
|
min="0"
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@
|
||||||
{{ $tc("polls.votes_count", poll.votes_count, { count: poll.votes_count }) }} ·
|
{{ $tc("polls.votes_count", poll.votes_count, { count: poll.votes_count }) }} ·
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<i18n-t :keypath="expired ? 'polls.expired' : 'polls.expires_in'">
|
<i18n-t scope="global" :keypath="expired ? 'polls.expired' : 'polls.expires_in'">
|
||||||
<Timeago
|
<Timeago
|
||||||
:time="expiresAt"
|
:time="expiresAt"
|
||||||
:auto-update="60"
|
:auto-update="60"
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ export default {
|
||||||
path: String,
|
path: String,
|
||||||
disabled: Boolean,
|
disabled: Boolean,
|
||||||
min: Number,
|
min: Number,
|
||||||
expert: Number
|
expert: [Number, String]
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
pathDefault () {
|
pathDefault () {
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,8 @@ const SettingsModal = {
|
||||||
SettingsModalContent: getResettableAsyncComponent(
|
SettingsModalContent: getResettableAsyncComponent(
|
||||||
() => import('./settings_modal_content.vue'),
|
() => import('./settings_modal_content.vue'),
|
||||||
{
|
{
|
||||||
loading: PanelLoading,
|
loadingComponent: PanelLoading,
|
||||||
error: AsyncComponentError,
|
errorComponent: AsyncComponentError,
|
||||||
delay: 0
|
delay: 0
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -951,14 +951,14 @@
|
||||||
:fallback="currentShadowFallback"
|
:fallback="currentShadowFallback"
|
||||||
/>
|
/>
|
||||||
<div v-if="shadowSelected === 'avatar' || shadowSelected === 'avatarStatus'">
|
<div v-if="shadowSelected === 'avatar' || shadowSelected === 'avatarStatus'">
|
||||||
<i18n-t
|
<i18n-t scope="global"
|
||||||
keypath="settings.style.shadows.filter_hint.always_drop_shadow"
|
keypath="settings.style.shadows.filter_hint.always_drop_shadow"
|
||||||
tag="p"
|
tag="p"
|
||||||
>
|
>
|
||||||
<code>filter: drop-shadow()</code>
|
<code>filter: drop-shadow()</code>
|
||||||
</i18n-t>
|
</i18n-t>
|
||||||
<p>{{ $t('settings.style.shadows.filter_hint.avatar_inset') }}</p>
|
<p>{{ $t('settings.style.shadows.filter_hint.avatar_inset') }}</p>
|
||||||
<i18n-t
|
<i18n-t scope="global"
|
||||||
keypath="settings.style.shadows.filter_hint.drop_shadow_syntax"
|
keypath="settings.style.shadows.filter_hint.drop_shadow_syntax"
|
||||||
tag="p"
|
tag="p"
|
||||||
>
|
>
|
||||||
|
|
@ -966,7 +966,7 @@
|
||||||
<code>spread-radius</code>
|
<code>spread-radius</code>
|
||||||
<code>inset</code>
|
<code>inset</code>
|
||||||
</i18n-t>
|
</i18n-t>
|
||||||
<i18n-t
|
<i18n-t scope="global"
|
||||||
keypath="settings.style.shadows.filter_hint.inset_classic"
|
keypath="settings.style.shadows.filter_hint.inset_classic"
|
||||||
tag="p"
|
tag="p"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@
|
||||||
v-model="selected.alpha"
|
v-model="selected.alpha"
|
||||||
:disabled="!present"
|
:disabled="!present"
|
||||||
/>
|
/>
|
||||||
<i18n-t
|
<i18n-t scope="global"
|
||||||
keypath="settings.style.shadows.hintV3"
|
keypath="settings.style.shadows.hintV3"
|
||||||
tag="p"
|
tag="p"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ const controlledOrUncontrolledGetters = list => list.reduce((res, name) => {
|
||||||
const controlledName = `controlled${camelized}`
|
const controlledName = `controlled${camelized}`
|
||||||
const uncontrolledName = `uncontrolled${camelized}`
|
const uncontrolledName = `uncontrolled${camelized}`
|
||||||
res[name] = function () {
|
res[name] = function () {
|
||||||
return this[toggle] ? this[controlledName] : this[uncontrolledName]
|
return (Object.getOwnPropertyDescriptor(this, toggle) && this[toggle]) ? this[controlledName] : this[uncontrolledName]
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}, {})
|
}, {})
|
||||||
|
|
@ -311,7 +311,7 @@ const Status = {
|
||||||
return this.mergedConfig.hideWordFilteredPosts
|
return this.mergedConfig.hideWordFilteredPosts
|
||||||
},
|
},
|
||||||
hideStatus () {
|
hideStatus () {
|
||||||
return (this.virtualHidden || !this.shouldNotMute) && (
|
return (!this.shouldNotMute) && (
|
||||||
(this.muted && this.hideFilteredStatuses) ||
|
(this.muted && this.hideFilteredStatuses) ||
|
||||||
(this.userIsMuted && this.hideMutedUsers) ||
|
(this.userIsMuted && this.hideMutedUsers) ||
|
||||||
(this.status.thread_muted && this.hideMutedThreads) ||
|
(this.status.thread_muted && this.hideMutedThreads) ||
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ const controlledOrUncontrolledGetters = list => list.reduce((res, name) => {
|
||||||
const controlledName = `controlled${camelized}`
|
const controlledName = `controlled${camelized}`
|
||||||
const uncontrolledName = `uncontrolled${camelized}`
|
const uncontrolledName = `uncontrolled${camelized}`
|
||||||
res[name] = function () {
|
res[name] = function () {
|
||||||
return this[toggle] ? this[controlledName] : this[uncontrolledName]
|
return (Object.getOwnPropertyDescriptor(this, toggle) && this[toggle]) ? this[controlledName] : this[uncontrolledName]
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
}, {})
|
}, {})
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
v-if="currentReplies.length && !threadShowing"
|
v-if="currentReplies.length && !threadShowing"
|
||||||
class="thread-tree-replies thread-tree-replies-hidden"
|
class="thread-tree-replies thread-tree-replies-hidden"
|
||||||
>
|
>
|
||||||
<i18n-t
|
<i18n-t scope="global"
|
||||||
v-if="simple"
|
v-if="simple"
|
||||||
tag="button"
|
tag="button"
|
||||||
keypath="status.thread_follow_with_icon"
|
keypath="status.thread_follow_with_icon"
|
||||||
|
|
@ -92,7 +92,7 @@
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</i18n-t>
|
</i18n-t>
|
||||||
<i18n-t
|
<i18n-t scope="global"
|
||||||
v-else
|
v-else
|
||||||
tag="button"
|
tag="button"
|
||||||
keypath="status.thread_show_full_with_icon"
|
keypath="status.thread_show_full_with_icon"
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,8 @@ const Timeline = {
|
||||||
filteredVisibleStatuses () {
|
filteredVisibleStatuses () {
|
||||||
return this.timeline.visibleStatuses.filter(status => this.timelineName !== 'user' || (status.id >= this.timeline.minId && status.id <= this.timeline.maxId))
|
return this.timeline.visibleStatuses.filter(status => this.timelineName !== 'user' || (status.id >= this.timeline.minId && status.id <= this.timeline.maxId))
|
||||||
},
|
},
|
||||||
filteredPinnedStatusesId () {
|
filteredPinnedStatusIds () {
|
||||||
return this.pinnedStatusIds.filter(statusId => this.timeline.statusesObject[statusId])
|
return (this.pinnedStatusIds || []).filter(statusId => this.timeline.statusesObject[statusId])
|
||||||
},
|
},
|
||||||
newStatusCount () {
|
newStatusCount () {
|
||||||
return this.timeline.newStatusCount
|
return this.timeline.newStatusCount
|
||||||
|
|
|
||||||
|
|
@ -50,12 +50,12 @@ const enableBodyScroll = (el) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const directive = {
|
const directive = {
|
||||||
inserted: (el, binding) => {
|
mounted: (el, binding) => {
|
||||||
if (binding.value) {
|
if (binding.value) {
|
||||||
disableBodyScroll(el)
|
disableBodyScroll(el)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
componentUpdated: (el, binding) => {
|
updated: (el, binding) => {
|
||||||
if (binding.oldValue === binding.value) {
|
if (binding.oldValue === binding.value) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
@ -66,7 +66,7 @@ const directive = {
|
||||||
enableBodyScroll(el)
|
enableBodyScroll(el)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
unbind: (el) => {
|
unmounted: (el) => {
|
||||||
enableBodyScroll(el)
|
enableBodyScroll(el)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
// TODO investigate if even necessary since VUE3
|
import { defineAsyncComponent, shallowReactive, h } from 'vue'
|
||||||
import { reactive } from 'vue'
|
|
||||||
|
|
||||||
/* By default async components don't have any way to recover, if component is
|
/* By default async components don't have any way to recover, if component is
|
||||||
* failed, it is failed forever. This helper tries to remedy that by recreating
|
* failed, it is failed forever. This helper tries to remedy that by recreating
|
||||||
|
|
@ -9,23 +8,21 @@ import { reactive } from 'vue'
|
||||||
* actual target component itself if needs to be.
|
* actual target component itself if needs to be.
|
||||||
*/
|
*/
|
||||||
function getResettableAsyncComponent (asyncComponent, options) {
|
function getResettableAsyncComponent (asyncComponent, options) {
|
||||||
const asyncComponentFactory = () => () => ({
|
const asyncComponentFactory = () => () => defineAsyncComponent({
|
||||||
component: asyncComponent(),
|
loader: asyncComponent,
|
||||||
...options
|
...options
|
||||||
})
|
})
|
||||||
|
|
||||||
const observe = reactive({ c: asyncComponentFactory() })
|
const observe = shallowReactive({ c: asyncComponentFactory() })
|
||||||
|
|
||||||
return {
|
return {
|
||||||
functional: true,
|
render () {
|
||||||
render (createElement, { data, children }) {
|
|
||||||
// emit event resetAsyncComponent to reloading
|
// emit event resetAsyncComponent to reloading
|
||||||
data.on = {}
|
return h(observe.c(), {
|
||||||
data.on.resetAsyncComponent = () => {
|
onResetAsyncComponent () {
|
||||||
observe.c = asyncComponentFactory()
|
observe.c = asyncComponentFactory()
|
||||||
// parent.$forceUpdate()
|
}
|
||||||
}
|
})
|
||||||
return createElement(observe.c, data, children)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue