Use tabler icons (#9354)
* wip * wip * wip * Update style.scss * wip * wip * wip * wip
This commit is contained in:
parent
e3b8482891
commit
917ef465a5
240 changed files with 981 additions and 947 deletions
|
|
@ -93,7 +93,7 @@ export function getNoteMenu(props: {
|
|||
async function clip(): Promise<void> {
|
||||
const clips = await os.api('clips/list');
|
||||
os.popupMenu([{
|
||||
icon: 'fas fa-plus',
|
||||
icon: 'ti ti-plus',
|
||||
text: i18n.ts.createNew,
|
||||
action: async () => {
|
||||
const { canceled, result } = await os.form(i18n.ts.createNewClip, {
|
||||
|
|
@ -196,70 +196,70 @@ export function getNoteMenu(props: {
|
|||
menu = [
|
||||
...(
|
||||
props.currentClipPage?.value.userId === $i.id ? [{
|
||||
icon: 'fas fa-circle-minus',
|
||||
icon: 'ti ti-backspace',
|
||||
text: i18n.ts.unclip,
|
||||
danger: true,
|
||||
action: unclip,
|
||||
}, null] : []
|
||||
), {
|
||||
icon: 'fas fa-external-link-alt',
|
||||
icon: 'ti ti-external-link',
|
||||
text: i18n.ts.details,
|
||||
action: notedetails,
|
||||
}, {
|
||||
icon: 'fas fa-copy',
|
||||
icon: 'ti ti-copy',
|
||||
text: i18n.ts.copyContent,
|
||||
action: copyContent,
|
||||
}, {
|
||||
icon: 'fas fa-link',
|
||||
icon: 'ti ti-link',
|
||||
text: i18n.ts.copyLink,
|
||||
action: copyLink,
|
||||
}, (appearNote.url || appearNote.uri) ? {
|
||||
icon: 'fas fa-external-link-square-alt',
|
||||
icon: 'ti ti-external-link',
|
||||
text: i18n.ts.showOnRemote,
|
||||
action: () => {
|
||||
window.open(appearNote.url || appearNote.uri, '_blank');
|
||||
},
|
||||
} : undefined,
|
||||
{
|
||||
icon: 'fas fa-share-alt',
|
||||
icon: 'ti ti-share',
|
||||
text: i18n.ts.share,
|
||||
action: share,
|
||||
},
|
||||
instance.translatorAvailable ? {
|
||||
icon: 'fas fa-language',
|
||||
icon: 'ti ti-language-hiragana',
|
||||
text: i18n.ts.translate,
|
||||
action: translate,
|
||||
} : undefined,
|
||||
null,
|
||||
statePromise.then(state => state.isFavorited ? {
|
||||
icon: 'fas fa-star',
|
||||
icon: 'ti ti-star',
|
||||
text: i18n.ts.unfavorite,
|
||||
action: () => toggleFavorite(false),
|
||||
} : {
|
||||
icon: 'fas fa-star',
|
||||
icon: 'ti ti-star',
|
||||
text: i18n.ts.favorite,
|
||||
action: () => toggleFavorite(true),
|
||||
}),
|
||||
{
|
||||
icon: 'fas fa-paperclip',
|
||||
icon: 'ti ti-paperclip',
|
||||
text: i18n.ts.clip,
|
||||
action: () => clip(),
|
||||
},
|
||||
statePromise.then(state => state.isMutedThread ? {
|
||||
icon: 'fas fa-comment-slash',
|
||||
icon: 'ti ti-message-off',
|
||||
text: i18n.ts.unmuteThread,
|
||||
action: () => toggleThreadMute(false),
|
||||
} : {
|
||||
icon: 'fas fa-comment-slash',
|
||||
icon: 'ti ti-message-off',
|
||||
text: i18n.ts.muteThread,
|
||||
action: () => toggleThreadMute(true),
|
||||
}),
|
||||
appearNote.userId === $i.id ? ($i.pinnedNoteIds || []).includes(appearNote.id) ? {
|
||||
icon: 'fas fa-thumbtack',
|
||||
icon: 'ti ti-pin',
|
||||
text: i18n.ts.unpin,
|
||||
action: () => togglePin(false),
|
||||
} : {
|
||||
icon: 'fas fa-thumbtack',
|
||||
icon: 'ti ti-pin',
|
||||
text: i18n.ts.pin,
|
||||
action: () => togglePin(true),
|
||||
} : undefined,
|
||||
|
|
@ -276,7 +276,7 @@ export function getNoteMenu(props: {
|
|||
...(appearNote.userId !== $i.id ? [
|
||||
null,
|
||||
{
|
||||
icon: 'fas fa-exclamation-circle',
|
||||
icon: 'ti ti-exclamation-circle',
|
||||
text: i18n.ts.reportAbuse,
|
||||
action: () => {
|
||||
const u = appearNote.url || appearNote.uri || `${url}/notes/${appearNote.id}`;
|
||||
|
|
@ -291,12 +291,12 @@ export function getNoteMenu(props: {
|
|||
...(appearNote.userId === $i.id || $i.isModerator || $i.isAdmin ? [
|
||||
null,
|
||||
appearNote.userId === $i.id ? {
|
||||
icon: 'fas fa-edit',
|
||||
icon: 'ti ti-edit',
|
||||
text: i18n.ts.deleteAndEdit,
|
||||
action: delEdit,
|
||||
} : undefined,
|
||||
{
|
||||
icon: 'fas fa-trash-alt',
|
||||
icon: 'ti ti-trash',
|
||||
text: i18n.ts.delete,
|
||||
danger: true,
|
||||
action: del,
|
||||
|
|
@ -306,19 +306,19 @@ export function getNoteMenu(props: {
|
|||
.filter(x => x !== undefined);
|
||||
} else {
|
||||
menu = [{
|
||||
icon: 'fas fa-external-link-alt',
|
||||
icon: 'ti ti-external-link',
|
||||
text: i18n.ts.detailed,
|
||||
action: openDetail,
|
||||
}, {
|
||||
icon: 'fas fa-copy',
|
||||
icon: 'ti ti-copy',
|
||||
text: i18n.ts.copyContent,
|
||||
action: copyContent,
|
||||
}, {
|
||||
icon: 'fas fa-link',
|
||||
icon: 'ti ti-link',
|
||||
text: i18n.ts.copyLink,
|
||||
action: copyLink,
|
||||
}, (appearNote.url || appearNote.uri) ? {
|
||||
icon: 'fas fa-external-link-square-alt',
|
||||
icon: 'ti ti-external-link',
|
||||
text: i18n.ts.showOnRemote,
|
||||
action: () => {
|
||||
window.open(appearNote.url || appearNote.uri, '_blank');
|
||||
|
|
@ -329,7 +329,7 @@ export function getNoteMenu(props: {
|
|||
|
||||
if (noteActions.length > 0) {
|
||||
menu = menu.concat([null, ...noteActions.map(action => ({
|
||||
icon: 'fas fa-plug',
|
||||
icon: 'ti ti-plug',
|
||||
text: action.title,
|
||||
action: () => {
|
||||
action.handler(appearNote);
|
||||
|
|
|
|||
|
|
@ -153,70 +153,70 @@ export function getUserMenu(user, router: Router = mainRouter) {
|
|||
}
|
||||
|
||||
let menu = [{
|
||||
icon: 'fas fa-at',
|
||||
icon: 'ti ti-at',
|
||||
text: i18n.ts.copyUsername,
|
||||
action: () => {
|
||||
copyToClipboard(`@${user.username}@${user.host || host}`);
|
||||
},
|
||||
}, {
|
||||
icon: 'fas fa-info-circle',
|
||||
icon: 'ti ti-info-circle',
|
||||
text: i18n.ts.info,
|
||||
action: () => {
|
||||
router.push(`/user-info/${user.id}`);
|
||||
},
|
||||
}, {
|
||||
icon: 'fas fa-envelope',
|
||||
icon: 'ti ti-mail',
|
||||
text: i18n.ts.sendMessage,
|
||||
action: () => {
|
||||
os.post({ specified: user });
|
||||
},
|
||||
}, meId !== user.id ? {
|
||||
type: 'link',
|
||||
icon: 'fas fa-comments',
|
||||
icon: 'ti ti-messages',
|
||||
text: i18n.ts.startMessaging,
|
||||
to: '/my/messaging/' + Acct.toString(user),
|
||||
} : undefined, null, {
|
||||
icon: 'fas fa-list-ul',
|
||||
icon: 'ti ti-list',
|
||||
text: i18n.ts.addToList,
|
||||
action: pushList,
|
||||
}, meId !== user.id ? {
|
||||
icon: 'fas fa-users',
|
||||
icon: 'ti ti-users',
|
||||
text: i18n.ts.inviteToGroup,
|
||||
action: inviteGroup,
|
||||
} : undefined] as any;
|
||||
|
||||
if ($i && meId !== user.id) {
|
||||
menu = menu.concat([null, {
|
||||
icon: user.isMuted ? 'fas fa-eye' : 'fas fa-eye-slash',
|
||||
icon: user.isMuted ? 'ti ti-eye' : 'ti ti-eye-off',
|
||||
text: user.isMuted ? i18n.ts.unmute : i18n.ts.mute,
|
||||
action: toggleMute,
|
||||
}, {
|
||||
icon: 'fas fa-ban',
|
||||
icon: 'ti ti-ban',
|
||||
text: user.isBlocking ? i18n.ts.unblock : i18n.ts.block,
|
||||
action: toggleBlock,
|
||||
}]);
|
||||
|
||||
if (user.isFollowed) {
|
||||
menu = menu.concat([{
|
||||
icon: 'fas fa-unlink',
|
||||
icon: 'ti ti-link-off',
|
||||
text: i18n.ts.breakFollow,
|
||||
action: invalidateFollow,
|
||||
}]);
|
||||
}
|
||||
|
||||
menu = menu.concat([null, {
|
||||
icon: 'fas fa-exclamation-circle',
|
||||
icon: 'ti ti-exclamation-circle',
|
||||
text: i18n.ts.reportAbuse,
|
||||
action: reportAbuse,
|
||||
}]);
|
||||
|
||||
if (iAmModerator) {
|
||||
menu = menu.concat([null, {
|
||||
icon: 'fas fa-microphone-slash',
|
||||
icon: 'ti ti-microphone-2-off',
|
||||
text: user.isSilenced ? i18n.ts.unsilence : i18n.ts.silence,
|
||||
action: toggleSilence,
|
||||
}, {
|
||||
icon: 'fas fa-snowflake',
|
||||
icon: 'ti ti-snowflake',
|
||||
text: user.isSuspended ? i18n.ts.unsuspend : i18n.ts.suspend,
|
||||
action: toggleSuspend,
|
||||
}]);
|
||||
|
|
@ -225,7 +225,7 @@ export function getUserMenu(user, router: Router = mainRouter) {
|
|||
|
||||
if ($i && meId === user.id) {
|
||||
menu = menu.concat([null, {
|
||||
icon: 'fas fa-pencil-alt',
|
||||
icon: 'ti ti-pencil',
|
||||
text: i18n.ts.editProfile,
|
||||
action: () => {
|
||||
router.push('/settings/profile');
|
||||
|
|
@ -235,7 +235,7 @@ export function getUserMenu(user, router: Router = mainRouter) {
|
|||
|
||||
if (userActions.length > 0) {
|
||||
menu = menu.concat([null, ...userActions.map(action => ({
|
||||
icon: 'fas fa-plug',
|
||||
icon: 'ti ti-plug',
|
||||
text: action.title,
|
||||
action: () => {
|
||||
action.handler(user);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export type Fn = {
|
|||
export type Type = 'string' | 'number' | 'boolean' | 'stringArray' | null;
|
||||
|
||||
export const literalDefs: Record<string, { out: any; category: string; icon: any; }> = {
|
||||
text: { out: 'string', category: 'value', icon: 'fas fa-quote-right', },
|
||||
text: { out: 'string', category: 'value', icon: 'ti ti-quote', },
|
||||
multiLineText: { out: 'string', category: 'value', icon: 'fas fa-align-left', },
|
||||
textList: { out: 'stringArray', category: 'value', icon: 'fas fa-list', },
|
||||
number: { out: 'number', category: 'value', icon: 'fas fa-sort-numeric-up', },
|
||||
|
|
|
|||
|
|
@ -130,14 +130,14 @@ export function initAiLib(hpml: Hpml) {
|
|||
}
|
||||
|
||||
export const funcDefs: Record<string, { in: any[]; out: any; category: string; icon: any; }> = {
|
||||
if: { in: ['boolean', 0, 0], out: 0, category: 'flow', icon: 'fas fa-share-alt' },
|
||||
if: { in: ['boolean', 0, 0], out: 0, category: 'flow', icon: 'ti ti-share' },
|
||||
for: { in: ['number', 'function'], out: null, category: 'flow', icon: 'fas fa-recycle' },
|
||||
not: { in: ['boolean'], out: 'boolean', category: 'logical', icon: 'fas fa-flag' },
|
||||
or: { in: ['boolean', 'boolean'], out: 'boolean', category: 'logical', icon: 'fas fa-flag' },
|
||||
and: { in: ['boolean', 'boolean'], out: 'boolean', category: 'logical', icon: 'fas fa-flag' },
|
||||
add: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'fas fa-plus' },
|
||||
subtract: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'fas fa-minus' },
|
||||
multiply: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'fas fa-times' },
|
||||
add: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'ti ti-plus' },
|
||||
subtract: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'ti ti-minus' },
|
||||
multiply: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'ti ti-x' },
|
||||
divide: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'fas fa-divide' },
|
||||
mod: { in: ['number', 'number'], out: 'number', category: 'operation', icon: 'fas fa-divide' },
|
||||
round: { in: ['number'], out: 'number', category: 'operation', icon: 'fas fa-calculator' },
|
||||
|
|
@ -147,11 +147,11 @@ export const funcDefs: Record<string, { in: any[]; out: any; category: string; i
|
|||
lt: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: 'fas fa-less-than' },
|
||||
gtEq: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: 'fas fa-greater-than-equal' },
|
||||
ltEq: { in: ['number', 'number'], out: 'boolean', category: 'comparison', icon: 'fas fa-less-than-equal' },
|
||||
strLen: { in: ['string'], out: 'number', category: 'text', icon: 'fas fa-quote-right' },
|
||||
strPick: { in: ['string', 'number'], out: 'string', category: 'text', icon: 'fas fa-quote-right' },
|
||||
strReplace: { in: ['string', 'string', 'string'], out: 'string', category: 'text', icon: 'fas fa-quote-right' },
|
||||
strReverse: { in: ['string'], out: 'string', category: 'text', icon: 'fas fa-quote-right' },
|
||||
join: { in: ['stringArray', 'string'], out: 'string', category: 'text', icon: 'fas fa-quote-right' },
|
||||
strLen: { in: ['string'], out: 'number', category: 'text', icon: 'ti ti-quote' },
|
||||
strPick: { in: ['string', 'number'], out: 'string', category: 'text', icon: 'ti ti-quote' },
|
||||
strReplace: { in: ['string', 'string', 'string'], out: 'string', category: 'text', icon: 'ti ti-quote' },
|
||||
strReverse: { in: ['string'], out: 'string', category: 'text', icon: 'ti ti-quote' },
|
||||
join: { in: ['stringArray', 'string'], out: 'string', category: 'text', icon: 'ti ti-quote' },
|
||||
stringToNumber: { in: ['string'], out: 'number', category: 'convert', icon: 'fas fa-exchange-alt' },
|
||||
numberToString: { in: ['number'], out: 'string', category: 'convert', icon: 'fas fa-exchange-alt' },
|
||||
splitStrByLine: { in: ['string'], out: 'stringArray', category: 'convert', icon: 'fas fa-exchange-alt' },
|
||||
|
|
|
|||
|
|
@ -80,15 +80,15 @@ function select(src: any, label: string | null, multiple: boolean): Promise<Driv
|
|||
ref: keepOriginal,
|
||||
}, {
|
||||
text: i18n.ts.upload,
|
||||
icon: 'fas fa-upload',
|
||||
icon: 'ti ti-upload',
|
||||
action: chooseFileFromPc,
|
||||
}, {
|
||||
text: i18n.ts.fromDrive,
|
||||
icon: 'fas fa-cloud',
|
||||
icon: 'ti ti-cloud',
|
||||
action: chooseFileFromDrive,
|
||||
}, {
|
||||
text: i18n.ts.fromUrl,
|
||||
icon: 'fas fa-link',
|
||||
icon: 'ti ti-link',
|
||||
action: chooseFileFromUrl,
|
||||
}], src);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue