Resolve i18n conflict

This commit is contained in:
eris 2022-08-02 06:24:35 +00:00
commit b473ac8f57
15 changed files with 5468 additions and 5036 deletions

View file

@ -30,7 +30,7 @@ module.exports = {
}
},
resolve: {
extensions: ['.js', '.jsx', '.vue'],
extensions: ['.js', '.jsx', '.vue', '.mjs'],
modules: [
path.join(__dirname, '../node_modules')
],
@ -68,6 +68,11 @@ module.exports = {
path.resolve(__dirname, '../src/i18n')
]
},
{
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto"
},
{
test: /\.vue$/,
loader: 'vue-loader',

View file

@ -34,8 +34,7 @@
"js-cookie": "^3.0.1",
"localforage": "1.10.0",
"marked": "^4.0.17",
"marked-mfm": "^0.4.0",
"mfm-js": "^0.22.1",
"marked-mfm": "^0.5.0",
"parse-link-header": "1.0.1",
"phoenix": "1.6.2",
"punycode.js": "2.1.0",
@ -57,7 +56,7 @@
"@vue/babel-helper-vue-jsx-merge-props": "1.2.1",
"@vue/babel-plugin-jsx": "1.1.1",
"@vue/compiler-sfc": "^3.1.0",
"@vue/test-utils": "2.0.0-rc.17",
"@vue/test-utils": "^2.0.2",
"autoprefixer": "6.7.7",
"babel-eslint": "7.2.3",
"babel-loader": "8.2.4",

View file

@ -124,6 +124,14 @@ export default {
}
const renderMisskeyMarkdown = (content) => {
// Untangle code blocks from <br> tags
const codeblocks = content.match(/(<br\/>)?(~~~|```)\w*<br\/>.+?<br\/>\2\1?/g)
if (codeblocks) {
codeblocks.forEach((pre) => {
content = content.replace(pre, pre.replaceAll('<br/>', '\n'))
})
}
marked.use(markedMfm, {
mangle: false,
gfm: false,

View file

@ -37,6 +37,15 @@
{{ $t('settings.hide_muted_posts') }}
</BooleanSetting>
</li>
<li>
<BooleanSetting
v-if="user"
:disabled="hideFilteredStatuses"
path="hideThreadsWithBlockedUsers"
>
{{ $t('settings.hide_threads_with_blocked_users') }}
</BooleanSetting>
</li>
</ul>
</li>
<li>

View file

@ -261,6 +261,38 @@ const Status = {
hasMentionsLine () {
return this.mentionsLine.length > 0
},
mentionsBlockedUser () {
// XXX: doesn't work on domain blocks, because users from blocked domains
// don't appear in `attentions' and therefore cannot be filtered.
let mentions = false
// find if user in mentions list is blocked
this.status.attentions.forEach((attn) => {
if (attn.id === this.currentUser.id) return
const relationship = this.$store.getters.relationship(attn.id)
if (relationship.blocking) {
mentions = true
}
})
return mentions
},
mentionsMutedUser () {
// XXX: doesn't work on domain blocks, because users from blocked domains
// don't appear in `attentions' and therefore cannot be filtered.
let mentions = false
// find if user in mentions list is blocked
this.status.attentions.forEach((attn) => {
if (attn.id === this.currentUser.id) return
const relationship = this.$store.getters.relationship(attn.id)
if (relationship.muting) {
mentions = true
}
})
return mentions
},
muted () {
if (this.statusoid.user.id === this.currentUser.id) return false
const reasonsToMute = this.userIsMuted ||
@ -269,7 +301,11 @@ const Status = {
// Wordfiltered
this.muteWordHits.length > 0 ||
// bot status
(this.muteBotStatuses && this.botStatus && !this.compact)
(this.muteBotStatuses && this.botStatus && !this.compact) ||
// mentions blocked user
this.mentionsBlockedUser ||
// mentions muted user
this.mentionsMutedUser
return !this.unmuted && !this.shouldNotMute && reasonsToMute
},
userIsMuted () {
@ -312,6 +348,9 @@ const Status = {
hideFilteredStatuses () {
return this.mergedConfig.hideFilteredStatuses
},
hideThreadsWithBlockedUsers () {
return this.mergedConfig.hideThreadsWithBlockedUsers
},
hideWordFilteredPosts () {
return this.mergedConfig.hideWordFilteredPosts
},
@ -319,8 +358,9 @@ const Status = {
return (!this.shouldNotMute) && (
(this.muted && this.hideFilteredStatuses) ||
(this.userIsMuted && this.hideMutedUsers) ||
(this.status.thread_muted && this.hideMutedThreads) ||
(this.muteWordHits.length > 0 && this.hideWordFilteredPosts)
((this.status.thread_muted || this.mentionsMutedUser) && this.hideMutedThreads) ||
(this.muteWordHits.length > 0 && this.hideWordFilteredPosts) ||
(this.mentionsBlockedUser && this.hideThreadsWithBlockedUsers)
)
},
isFocused () {

View file

@ -157,16 +157,19 @@
--emoji-size: 16px;
& .body,
& .body:not(:active),
& .attachments {
max-height: 3.25em;
}
.body {
overflow: hidden;
white-space: normal;
min-width: 5em;
flex: 5 1 auto;
}
.body:not(:active) {
overflow: hidden;
mask-size: auto 3.5em, auto auto;
mask-position: 0 0, 0 0;
mask-repeat: repeat-x, repeat;

View file

@ -23,7 +23,7 @@
"media_removal_desc": "Aquesta instància elimina els adjunts multimèdia dels apunts de les següents instàncies:",
"not_applicable": "N/A",
"quarantine": "Quarantena",
"quarantine_desc": "Aquesta instància només enviarà entrades públiques a les següents instàncies:",
"quarantine_desc": "Aquesta instància no enviarà apunts a les següents instàncies:",
"reason": "Motiu",
"reject": "Rebutja",
"reject_desc": "Aquesta instància no acceptarà missatges de les següents instàncies:",

View file

@ -23,7 +23,7 @@
"media_removal_desc": "This instance removes media from posts on the following instances:",
"not_applicable": "N/A",
"quarantine": "Quarantine",
"quarantine_desc": "This instance will send only public posts to the following instances:",
"quarantine_desc": "This instance will not send posts to the following instances:",
"reason": "Reason",
"reject": "Reject",
"reject_desc": "This instance will not accept messages from the following instances:",
@ -460,6 +460,7 @@
"hide_shoutbox": "Hide instance shoutbox",
"hide_site_favicon": "Hide instance favicon in top panel",
"hide_site_name": "Hide instance name in top panel",
"hide_threads_with_blocked_users": "Hide threads tagging blocked users",
"hide_user_stats": "Hide user statistics (e.g. the number of followers)",
"hide_wallpaper": "Hide instance wallpaper",
"hide_wordfiltered_statuses": "Hide word-filtered statuses",

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -31,6 +31,7 @@ export const defaultState = {
// bad name: actually hides posts of muted USERS
hideMutedPosts: undefined, // instance default
hideMutedThreads: undefined, // instance default
hideThreadsWithBlockedUsers: undefined, // instance default
hideWordFilteredPosts: undefined, // instance default
muteBotStatuses: undefined, // instance default
collapseMessageWithSubject: undefined, // instance default

View file

@ -30,6 +30,7 @@ const defaultState = {
// bad name: actually hides posts of muted USERS
hideMutedPosts: false,
hideMutedThreads: true,
hideThreadsWithBlockedUsers: false,
hideWordFilteredPosts: false,
hidePostStats: false,
hideBotIndication: false,

View file

@ -57,12 +57,16 @@ const actions = {
commit('setList', { id, title })
},
setListAccounts ({ rootState, commit }, { id, accountIds }) {
const saved = rootState.lists.allListsObject[id].accountIds
const added = accountIds.filter(id => !saved.includes(id))
const removed = saved.filter(id => !accountIds.includes(id))
commit('setListAccounts', { id, accountIds })
rootState.api.backendInteractor.addAccountsToList({ id, accountIds })
rootState.api.backendInteractor.removeAccountsFromList({
id,
accountIds: rootState.lists.allListsObject[id].accountIds.filter(id => !accountIds.includes(id))
})
if (added.length > 0) {
rootState.api.backendInteractor.addAccountsToList({ id, accountIds: added })
}
if (removed.length > 0) {
rootState.api.backendInteractor.removeAccountsFromList({ id, accountIds: removed })
}
},
deleteList ({ rootState, commit }, { id }) {
rootState.api.backendInteractor.deleteList({ id })
@ -76,7 +80,7 @@ export const getters = {
return state.allListsObject[id].title
},
findListAccounts: state => id => {
return state.allListsObject[id].accountIds
return [...state.allListsObject[id].accountIds]
}
}

View file

@ -37,11 +37,11 @@
}
._mfm_jump_ {
animation: mfm-jump 0.75 linear infinite;
animation: mfm-jump 0.75s linear infinite;
}
._mfm_bounce_ {
animation: mfm-bounce 0.75 linear infinite;
animation: mfm-bounce 0.75s linear infinite;
transform-origin: center bottom;
}
@ -67,7 +67,13 @@
font-size: 600%;
}
/* blur */
._mfm_blur_ {
filter: blur(6px);
transition: filter 0.3s
}
._mfm_blur_:hover {
filter: blur(0px);
}
._mfm_rainbow_ {
animation: mfm-rainbow 1s linear infinite;

7088
yarn.lock

File diff suppressed because it is too large Load diff