Skip to content

Commit 3ed5c66

Browse files
authored
refactor: move to unocss icons (#408)
* refactor: move to unocss icons * chore: lint and format
1 parent c4a4a84 commit 3ed5c66

36 files changed

+113
-169
lines changed

.github/workflows/build.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Build
55

66
on:
77
pull_request:
8-
branches: ["main"]
8+
branches: ['main']
99

1010
jobs:
1111
build-all:
@@ -25,7 +25,7 @@ jobs:
2525
uses: actions/setup-node@v4
2626
with:
2727
node-version: ${{ matrix.node-version }}
28-
cache: "pnpm"
28+
cache: 'pnpm'
2929

3030
- name: Install dependencies
3131
run: pnpm install --ignore-scripts --frozen-lockfile

.github/workflows/lint.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Lint
22

33
on:
44
pull_request:
5-
branches: ["main"]
5+
branches: ['main']
66
jobs:
77
lint:
88
runs-on: ubuntu-latest
@@ -21,7 +21,7 @@ jobs:
2121
uses: actions/setup-node@v4
2222
with:
2323
node-version: ${{ matrix.node-version }}
24-
cache: "pnpm"
24+
cache: 'pnpm'
2525

2626
- name: Install dependencies
2727
run: pnpm install --ignore-scripts --frozen-lockfile

eslint.config.mjs

+6-29
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import prettierConfig from 'eslint-plugin-prettier/recommended';
88
import eslintPluginVue from 'eslint-plugin-vue';
99
import ts from 'typescript-eslint';
1010
import { fileURLToPath } from 'url';
11-
import vueParser from 'vue-eslint-parser';
1211

1312
export default ts.config(
1413
{
@@ -32,35 +31,16 @@ export default ts.config(
3231
},
3332

3433
// ----- i18n -----
35-
// Use the base config, then re-add the rules on specific files
36-
...vueI18n.configs['flat/base'],
3734
{
38-
name: '@intlify/vue-i18n:recommended:setup',
35+
extends: vueI18n.configs['flat/recommended'],
3936
files: ['**/packages/safelight/**/*.vue', '**/packages/shared/**/*.vue'],
4037
ignores: ['dist/**', 'generated/**', '**/*.scss', '**/views/dev/**'],
41-
languageOptions: {
42-
ecmaVersion: 2018,
43-
sourceType: 'module',
44-
parserOptions: {
45-
ecmaFeatures: {
46-
jsx: true
47-
}
38+
settings: {
39+
'vue-i18n': {
40+
localeDir: './packages/shared/src/Localization/i18n/*.json'
4841
}
49-
}
50-
},
51-
{
52-
name: '@intlify/vue-i18n:recommended:rules',
53-
files: ['**/packages/safelight/**/*.vue', '**/packages/shared/**/*.vue'],
54-
ignores: ['dist/**', 'generated/**', '**/*.scss', '**/views/dev/**'],
42+
},
5543
rules: {
56-
'@intlify/vue-i18n/no-deprecated-i18n-component': 'warn',
57-
'@intlify/vue-i18n/no-deprecated-i18n-place-attr': 'warn',
58-
'@intlify/vue-i18n/no-deprecated-i18n-places-prop': 'warn',
59-
'@intlify/vue-i18n/no-deprecated-modulo-syntax': 'warn',
60-
'@intlify/vue-i18n/no-deprecated-tc': 'warn',
61-
'@intlify/vue-i18n/no-html-messages': 'warn',
62-
'@intlify/vue-i18n/no-i18n-t-path-prop': 'warn',
63-
'@intlify/vue-i18n/no-missing-keys': 'off',
6444
'@intlify/vue-i18n/no-raw-text': [
6545
'warn',
6646
{
@@ -79,9 +59,7 @@ export default ts.config(
7959
ignoreNodes: ['md-icon', 'v-icon'],
8060
ignorePattern: '^[-#:()&]+$'
8161
}
82-
],
83-
'@intlify/vue-i18n/no-v-html': 'warn',
84-
'@intlify/vue-i18n/valid-message-syntax': 'warn'
62+
]
8563
}
8664
},
8765

@@ -96,7 +74,6 @@ export default ts.config(
9674
},
9775
{
9876
languageOptions: {
99-
parser: vueParser,
10077
parserOptions: {
10178
parser: ts.parser,
10279
// extraFileExtensions: ['.vue'],

packages/safelight/package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
},
1919
"dependencies": {
2020
"@fontsource-variable/inter": "^5.2.5",
21-
"@phosphor-icons/vue": "^2.2.1",
22-
"@phosphor-icons/web": "^2.1.1",
2321
"@primeuix/themes": "^1.0.0",
2422
"@safelight/daguerreo": "workspace:^",
2523
"@safelight/shared": "workspace:*",
@@ -43,19 +41,20 @@
4341
"vue-router": "^4.5.0"
4442
},
4543
"devDependencies": {
44+
"@iconify-json/ph": "^1.2.2",
4645
"@quantco/pnpm-licenses": "^2.2.0",
4746
"@types/fuzzysearch": "^1.0.2",
4847
"@types/luxon": "^3.4.2",
4948
"@types/node": "^22.13.10",
5049
"@types/uuid": "^10.0.0",
50+
"@vitejs/plugin-basic-ssl": "^2.0.0",
5151
"@vitejs/plugin-vue": "^5.2.2",
5252
"sass-embedded": "^1.85.1",
5353
"tinyglobby": "^0.2.12",
5454
"tsx": "^4.19.3",
5555
"typescript": "^5.8.2",
5656
"unocss": "^66.0.0",
5757
"vite": "^6.2.2",
58-
"@vitejs/plugin-basic-ssl": "^2.0.0",
5958
"vue-tsc": "2.2.8"
6059
}
6160
}

packages/safelight/src/App.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ SettingsManager.setup([
3838
{
3939
name: 'editor',
4040
title: 'Editor',
41-
icon: 'ph ph-sidebar',
41+
icon: 'i-ph-sidebar',
4242
childNamespaces: [
4343
{
4444
name: 'playback',
4545
title: 'Playback',
46-
icon: 'ph ph-play-pause',
46+
icon: 'i-ph-play-pause',
4747
settings: []
4848
},
4949
{
5050
name: 'timeline',
5151
title: 'Timeline',
52-
icon: 'ph ph-film-strip',
52+
icon: 'i-ph-film-strip',
5353
settings: [
5454
{
5555
type: 'boolean',
@@ -86,7 +86,7 @@ SettingsManager.setup([
8686
{
8787
name: 'library',
8888
title: 'Library',
89-
icon: 'ph ph-folders',
89+
icon: 'i-ph-folders',
9090
settings: [
9191
{
9292
type: 'group',
@@ -115,7 +115,7 @@ SettingsManager.setup([
115115
{
116116
name: 'keyboard',
117117
title: 'Keyboard',
118-
icon: 'ph ph-keyboard',
118+
icon: 'i-ph-keyboard',
119119
childNamespaces: [
120120
{
121121
name: 'hotkeys',

packages/safelight/src/components/Editor/Library/Library.vue

+5-7
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<template #start>
2626
<InputGroup class="mr-2">
2727
<InputGroupAddon class="p-0">
28-
<i class="ph ph-magnifying-glass"></i>
28+
<i class="i-ph-magnifying-glass"></i>
2929
</InputGroupAddon>
3030
<InputText v-model="search" :placeholder="$t('general.actions.search')">
3131
</InputText>
@@ -46,9 +46,7 @@
4646
? $t('general.actions.sortAscending')
4747
: $t('general.actions.sortDescending')
4848
"
49-
:icon="
50-
sortDescending ? 'ph ph-sort-descending' : 'ph ph-sort-ascending'
51-
"
49+
:icon="sortDescending ? 'i-ph-sort-descending' : 'i-ph-sort-ascending'"
5250
@click="sortDescending = !sortDescending"
5351
/>
5452
<Select
@@ -72,7 +70,7 @@
7270
:model="breadcrumbItems"
7371
:home="{
7472
key: 'home',
75-
icon: 'ph-bold ph-house',
73+
icon: 'i-ph-house-bold',
7674
command: () => {
7775
while (directoryPath.shift());
7876
}
@@ -136,7 +134,7 @@
136134
outlined
137135
severity="secondary"
138136
:model="createMenuItems"
139-
icon="ph ph-plus"
137+
icon="i-ph-plus"
140138
@click="fileDialog.open()"
141139
/>
142140
</template>
@@ -337,7 +335,7 @@ type sortOptions = 'name' | 'duration' | 'fileType';
337335
scroll-behavior: smooth;
338336
}
339337
340-
.p-breadcrumb ::v-deep(.ph-bold.ph-house) {
338+
.p-breadcrumb ::v-deep(.i-ph-house-bold) {
341339
@apply flex items-center;
342340
343341
height: 22.4px;

packages/safelight/src/components/Editor/Library/LibraryGridItem.vue

+10-11
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
:aria-label="item.name.value"
2525
/>
2626
<template v-else-if="item.isDirectory">
27-
<PhFolder weight="bold" style="max-width: 80%; max-height: 80%" :size="70" />
27+
<div class="i-ph-folder-bold size-18 size-max-80%" />
2828
</template>
2929
<Skeleton
3030
v-else
@@ -36,37 +36,37 @@
3636
<i
3737
v-if="item.media.value.isOfType(MediaSourceType.Video)"
3838
v-tooltip.top="$t('media.attrs.video')"
39-
class="ph-bold ph-video-camera"
39+
class="i-ph-video-camera-bold"
4040
:aria-label="$t('media.attrs.video')"
4141
/>
4242
<i
4343
v-if="item.media.value.isOfType(MediaSourceType.Audio)"
4444
v-tooltip.top="$t('media.attrs.audio')"
45-
class="ph-bold ph-speaker-high"
45+
class="i-ph-speaker-high-bold"
4646
:aria-label="$t('media.attrs.audio')"
4747
/>
4848
<i
4949
v-if="item.media.value.isOfType(MediaSourceType.Subtitles)"
5050
v-tooltip.top="$t('media.attrs.subtitles')"
51-
class="ph-bold ph-subtitles"
51+
class="i-ph-subtitles-bold"
5252
:aria-label="$t('media.attrs.subtitles')"
5353
/>
5454
<i
5555
v-if="item.media.value.isOfType(MediaSourceType.Image)"
5656
v-tooltip.top="$t('media.attrs.image')"
57-
class="ph-bold ph-image"
57+
class="i-ph-image-bold"
5858
:aria-label="$t('media.attrs.image')"
5959
/>
6060
<i
6161
v-if="item.media.value.isOfType(MediaSourceType.Timeline)"
6262
v-tooltip.top="$t('media.attrs.timeline')"
63-
class="ph-bold ph-film-strip"
63+
class="i-ph-film-strip-bold"
6464
:aria-label="$t('media.attrs.timeline')"
6565
/>
6666
<i
6767
v-if="item.media.value.isOfType(MediaSourceType.Special)"
6868
v-tooltip.top="$t('media.attrs.special')"
69-
class="ph-bold ph-sparkle"
69+
class="i-ph-sparkle-bold"
7070
:aria-label="$t('media.attrs.special')"
7171
/>
7272
</div>
@@ -125,7 +125,7 @@
125125
severity="secondary"
126126
aria-haspopup="true"
127127
aria-controls="library_item_menu"
128-
icon="ph ph-dots-three-vertical"
128+
icon="i-ph-dots-three-vertical"
129129
@click="overlay?.toggle"
130130
/>
131131
</div>
@@ -152,7 +152,7 @@
152152
v-tooltip.top="{ value: 'Delete', showDelay: 500 }"
153153
severity="secondary"
154154
text
155-
icon="ph ph-trash"
155+
icon="i-ph-trash"
156156
@click="item.deleteSelf()"
157157
/>
158158
</template>
@@ -170,7 +170,6 @@
170170
<script setup lang="ts">
171171
import InplaceRename from '@/components/InplaceRename.vue';
172172
import { useProject } from '@/stores/useProject';
173-
import { PhFolder } from '@phosphor-icons/vue';
174173
import { MediaSourceType } from '@safelight/shared/Media/Media';
175174
import type { FileTreeItem } from '@safelight/shared/Project/ProjectFileTree';
176175
import Button from 'primevue/button';
@@ -231,7 +230,7 @@ function clickHandler() {
231230
}
232231
233232
.media-type {
234-
@apply left-0 top-0 h-full w-full gap-2 p-2;
233+
@apply p-2 left-0 top-0 h-full w-full gap-2;
235234
236235
position: absolute;
237236
display: flex;

packages/safelight/src/components/Editor/Timeline/PlaybackControls.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
severity="secondary"
77
:aria-label="$t('general.actions.skipBackFrame', 1)"
88
:title="$t('general.actions.skipBackFrame', 1)"
9-
icon="ph ph-skip-back"
9+
icon="i-ph-skip-back"
1010
@click="if (!project.timeline.isPlaying.value) project.timeline.stepPlayback(true);"
1111
/>
1212
<Button
1313
severity="secondary"
1414
:aria-label="project.timeline.isPlaying.value ? 'Stop playback' : 'Start playback'"
15-
:icon="project.timeline.isPlaying.value ? 'ph ph-pause' : 'ph ph-play'"
15+
:icon="project.timeline.isPlaying.value ? 'i-ph-pause' : 'i-ph-play'"
1616
@click="playPause"
1717
/>
1818
<Button
1919
severity="secondary"
2020
:aria-label="$t('general.actions.skipForwardFrame', 1)"
2121
:title="$t('general.actions.skipForwardFrame', 1)"
22-
icon="ph ph-skip-forward"
22+
icon="i-ph-skip-forward"
2323
@click="if (!project.timeline.isPlaying.value) project.timeline.stepPlayback();"
2424
/>
2525
</ButtonGroup>

packages/safelight/src/components/General/Notifications/Notification.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010
<template v-if="notif.config.severity && notif.config.severity !== 'none'">
1111
<i
1212
v-if="notif.config.severity == 'info'"
13-
class="ph ph-info"
13+
class="i-ph-info"
1414
style="color: var(--blue-500)"
1515
/>
1616
<i
1717
v-if="notif.config.severity == 'error'"
18-
class="ph ph-warning-circle"
18+
class="i-ph-warning-circle"
1919
style="color: var(--red-500)"
2020
/>
21-
<i v-if="notif.config.severity == 'warning'" class="ph ph-warning" />
21+
<i v-if="notif.config.severity == 'warning'" class="i-ph-warning" />
2222
</template>
2323
<h3>{{ $t(notif.config.title ?? '', 'notification.defaultTitle') }}</h3>
24-
<Button text severity="secondary" rounded icon="ph ph-x" @click="closeNotif" />
24+
<Button text severity="secondary" rounded icon="i-ph-x" @click="closeNotif" />
2525
</template>
2626
<p :id="'content-' + notif.id" class="mb-0">{{ $t(notif.config.text ?? '') }}</p>
2727
<div v-if="buttons.length > 0" class="mt-4 flex items-center gap-2">

packages/safelight/src/components/Menu/ProjectList/ProjectList.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<Button
1616
rounded
1717
:title="$t('general.descriptions.refresh')"
18-
icon="ph ph-arrows-clockwise"
18+
icon="i-ph-arrows-clockwise"
1919
@click="loadList.execute()"
2020
/>
2121
<SplitButton
@@ -92,7 +92,7 @@
9292
text
9393
plain
9494
rounded
95-
icon="ph ph-trash"
95+
icon="i-ph-trash"
9696
@click="curProject.deleteProject(data.id).then(() => loadList.execute())"
9797
/>
9898
</template>
@@ -104,7 +104,7 @@
104104
text
105105
plain
106106
rounded
107-
icon="ph ph-caret-right"
107+
icon="i-ph-caret-right"
108108
@click="router.push(`/editor/${data.id}`)"
109109
/>
110110
</template>

packages/safelight/src/components/Menu/Settings/NamespaceSettings.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { computed, ref, watch } from 'vue';
2424
import VueMarkdown from 'vue-markdown-render';
2525
import SettingsGroup from './SettingsProperties/SettingsGroup.vue';
2626
27-
const props = withDefaults(defineProps<{ path: string }>(), {
27+
const props = withDefaults(defineProps<{ path?: string }>(), {
2828
path: () => 'general'
2929
});
3030

0 commit comments

Comments
 (0)