diff --git a/scripts/bundle.msix.ts b/scripts/bundle.msix.ts index af5c2f21..049d70b3 100644 --- a/scripts/bundle.msix.ts +++ b/scripts/bundle.msix.ts @@ -19,7 +19,7 @@ async function getArgs() { }; } -const [major, minor, patch, nightly_date = 0] = packageJson.version.split(/[\.\+]/); +const [major, minor, patch, _nightly_date = 0] = packageJson.version.split(/[\.\+]/); if (major === undefined || minor === undefined || patch === undefined) { throw new Error('Invalid package version'); } @@ -35,16 +35,15 @@ fs.mkdirSync(buildFolder, { recursive: true }); fs.mkdirSync(bundleFolder, { recursive: true }); // we skip revision here because greater numbers than 65535 are not supported on msix -const packageVersion = `${major}.${minor}.${patch}.0`; -const postfix = nightly_date ? `+${nightly_date}` : ''; +const appxPackageVersion = `${major}.${minor}.${patch}.0`; const installer_msix_path = path.resolve( - `${bundleFolder}/Seelen.SeelenUI_${packageVersion}${postfix}_x64__p6yyn03m1894e.msix`, + `${bundleFolder}/Seelen.SeelenUI_${packageJson.version}_x64__p6yyn03m1894e.msix`, ); // Add manifest const manifest = fs .readFileSync('templates/AppxManifest.xml', 'utf-8') - .replace('{{version}}', packageVersion); + .replace('{{version}}', appxPackageVersion); fs.writeFileSync(`${buildFolder}/AppxManifest.xml`, manifest); // Add binaries diff --git a/scripts/translate.ts b/scripts/translate.ts index b7f69d43..1eb18583 100644 --- a/scripts/translate.ts +++ b/scripts/translate.ts @@ -1,11 +1,10 @@ +import { SupportedLanguages } from '@seelen-ui/lib'; import { existsSync, readFileSync, writeFileSync } from 'fs'; import { translate } from 'google-translate-api-x'; import yaml from 'js-yaml'; import yargs from 'yargs'; import { hideBin } from 'yargs/helpers'; -import { SupportedLanguages } from '../src/apps/shared/lang'; - const argv = await yargs(hideBin(process.argv)) .option('delete', { type: 'array', diff --git a/src/apps/seelen_rofi/i18n/index.ts b/src/apps/seelen_rofi/i18n/index.ts index 09767f0c..f8e1cd7c 100644 --- a/src/apps/seelen_rofi/i18n/index.ts +++ b/src/apps/seelen_rofi/i18n/index.ts @@ -1,9 +1,8 @@ +import { SupportedLanguagesCode } from '@seelen-ui/lib'; import i18n from 'i18next'; import yaml from 'js-yaml'; import { initReactI18next } from 'react-i18next'; -import { SupportedLanguagesCode } from '../../shared/lang'; - i18n.use(initReactI18next).init( { lng: 'en', diff --git a/src/apps/seelenweg/i18n/index.ts b/src/apps/seelenweg/i18n/index.ts index 09767f0c..f8e1cd7c 100644 --- a/src/apps/seelenweg/i18n/index.ts +++ b/src/apps/seelenweg/i18n/index.ts @@ -1,9 +1,8 @@ +import { SupportedLanguagesCode } from '@seelen-ui/lib'; import i18n from 'i18next'; import yaml from 'js-yaml'; import { initReactI18next } from 'react-i18next'; -import { SupportedLanguagesCode } from '../../shared/lang'; - i18n.use(initReactI18next).init( { lng: 'en', diff --git a/src/apps/settings/i18n/index.ts b/src/apps/settings/i18n/index.ts index 4aa66393..c1070416 100644 --- a/src/apps/settings/i18n/index.ts +++ b/src/apps/settings/i18n/index.ts @@ -1,9 +1,8 @@ +import { SupportedLanguagesCode } from '@seelen-ui/lib'; import i18n from 'i18next'; import yaml from 'js-yaml'; import { initReactI18next } from 'react-i18next'; -import { SupportedLanguagesCode } from '../../shared/lang'; - i18n.use(initReactI18next).init( { lng: 'en', diff --git a/src/apps/settings/modules/general/main/infra/index.tsx b/src/apps/settings/modules/general/main/infra/index.tsx index 2615a730..67cd6f32 100644 --- a/src/apps/settings/modules/general/main/infra/index.tsx +++ b/src/apps/settings/modules/general/main/infra/index.tsx @@ -1,3 +1,4 @@ +import { SupportedLanguages } from '@seelen-ui/lib'; import { Input, Select, Switch, Tooltip } from 'antd'; import { ChangeEvent, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -10,7 +11,6 @@ import { RootActions } from '../../../shared/store/app/reducer'; import { RootSelectors } from '../../../shared/store/app/selectors'; import { Icon } from 'src/apps/shared/components/Icon'; -import { SupportedLanguages } from '../../../../../shared/lang'; import { SettingsGroup, SettingsOption } from '../../../../components/SettingsBox'; import { Colors } from './Colors'; import { IconPacks } from './IconPacks'; diff --git a/src/apps/shared/index.ts b/src/apps/shared/index.ts index 3f89c2dc..be8b9e6c 100644 --- a/src/apps/shared/index.ts +++ b/src/apps/shared/index.ts @@ -1,15 +1,20 @@ -import { getRootElement, SeelenCommand } from '@seelen-ui/lib'; +import { SeelenCommand } from '@seelen-ui/lib'; import { invoke } from '@tauri-apps/api/core'; -export const getRootContainer = getRootElement; +export function getRootContainer(): HTMLElement { + const element = document.getElementById('root'); + if (!element) { + throw new Error('Root element not found'); + } + return element; +} export function toPhysicalPixels(size: number): number { return Math.round(size * window.devicePixelRatio); } export async function wasInstalledUsingMSIX(): Promise { - // Todo replace this when added to SeelenCommand - return invoke('is_appx_package'); + return invoke(SeelenCommand.IsAppxPackage); } export async function isDev(): Promise { diff --git a/src/apps/shared/lang.ts b/src/apps/shared/lang.ts deleted file mode 100644 index dc14c60f..00000000 --- a/src/apps/shared/lang.ts +++ /dev/null @@ -1,83 +0,0 @@ -const _languageList = [ - { label: 'Deutsch', enLabel: 'German', value: 'de' }, - { label: 'English', enLabel: 'English', value: 'en' }, - { label: 'Español', enLabel: 'Spanish', value: 'es' }, - { label: '한국어', enLabel: 'Korean', value: 'ko' }, - { label: '中文', enLabel: 'Chinese', value: 'zh' }, - { label: 'Français', enLabel: 'French', value: 'fr' }, - { label: 'العربية', enLabel: 'Arabic', value: 'ar' }, - { label: 'Português', enLabel: 'Portuguese', value: 'pt' }, - { label: 'Русский', enLabel: 'Russian', value: 'ru' }, - { label: 'हिन्दी', enLabel: 'Hindi', value: 'hi' }, - { label: '日本語', enLabel: 'Japanese', value: 'ja' }, - { label: 'Italiano', enLabel: 'Italian', value: 'it' }, - { label: 'Nederlands', enLabel: 'Dutch', value: 'nl' }, - { label: 'Türkçe', enLabel: 'Turkish', value: 'tr' }, - { label: 'Polski', enLabel: 'Polish', value: 'pl' }, - { label: 'Українська', enLabel: 'Ukrainian', value: 'uk' }, - { label: 'Ελληνικά', enLabel: 'Greek', value: 'el' }, - { label: 'עברית', enLabel: 'Hebrew', value: 'he' }, - { label: 'Svenska', enLabel: 'Swedish', value: 'sv' }, - { label: 'Norsk', enLabel: 'Norwegian', value: 'no' }, - { label: 'Suomi', enLabel: 'Finnish', value: 'fi' }, - { label: 'Dansk', enLabel: 'Danish', value: 'da' }, - { label: 'Magyar', enLabel: 'Hungarian', value: 'hu' }, - { label: 'Română', enLabel: 'Romanian', value: 'ro' }, - { label: 'Čeština', enLabel: 'Czech', value: 'cs' }, - { label: 'Slovenský', enLabel: 'Slovak', value: 'sk' }, - { label: 'Hrvatski', enLabel: 'Croatian', value: 'hr' }, - { label: 'Български', enLabel: 'Bulgarian', value: 'bg' }, - { label: 'Lietuvių', enLabel: 'Lithuanian', value: 'lt' }, - { label: 'Latviešu', enLabel: 'Latvian', value: 'lv' }, - { label: 'Eesti', enLabel: 'Estonian', value: 'et' }, - { label: 'Filipino', enLabel: 'Filipino', value: 'tl' }, - { label: 'Tiếng Việt', enLabel: 'Vietnamese', value: 'vi' }, - { label: 'ไทย', enLabel: 'Thai', value: 'th' }, - { label: 'Indonesia', enLabel: 'Indonesian', value: 'id' }, - { label: 'Malay', enLabel: 'Malay', value: 'ms' }, - { label: 'Català', enLabel: 'Catalan', value: 'ca' }, - { label: 'Afrikaans', enLabel: 'Afrikaans', value: 'af' }, - { label: 'বাংলা', enLabel: 'Bengali', value: 'bn' }, - { label: 'فارسی', enLabel: 'Farsi', value: 'fa' }, - { label: 'ਪੰਜਾਬੀ', enLabel: 'Punjabi', value: 'pa' }, - { label: 'Kiswahili', enLabel: 'Swahili', value: 'sw' }, - { label: 'தமிழ்', enLabel: 'Tamil', value: 'ta' }, - { label: 'اردو', enLabel: 'Urdu', value: 'ur' }, - { label: 'Cymraeg', enLabel: 'Welsh', value: 'cy' }, - { label: 'አማርኛ', enLabel: 'Amharic', value: 'am' }, - { label: 'Հայերեն', enLabel: 'Armenian', value: 'hy' }, - { label: 'Azərbaycan', enLabel: 'Azerbaijani', value: 'az' }, - { label: 'Euskara', enLabel: 'Basque', value: 'eu' }, - { label: 'Bosanski', enLabel: 'Bosnian', value: 'bs' }, - { label: 'ქართული', enLabel: 'Georgian', value: 'ka' }, - { label: 'ગુજરાતી', enLabel: 'Gujarati', value: 'gu' }, - { label: 'Íslenska', enLabel: 'Icelandic', value: 'is' }, - { label: 'ភាសាខ្មែរ', enLabel: 'Khmer', value: 'km' }, - { label: 'Kurdî', enLabel: 'Kurdish', value: 'ku' }, - { label: 'ລາວ', enLabel: 'Lao', value: 'lo' }, - { label: 'Lëtzebuergesch', enLabel: 'Luxembourgish', value: 'lb' }, - { label: 'Македонски', enLabel: 'Macedonian', value: 'mk' }, - { label: 'Malti', enLabel: 'Maltese', value: 'mt' }, - { label: 'Монгол', enLabel: 'Mongolian', value: 'mn' }, - { label: 'नेपाली', enLabel: 'Nepali', value: 'ne' }, - { label: 'پښتو', enLabel: 'Pashto', value: 'ps' }, - { label: 'Српски', enLabel: 'Serbian', value: 'sr' }, - { label: 'සිංහල', enLabel: 'Sinhala', value: 'si' }, - { label: 'Soomaali', enLabel: 'Somali', value: 'so' }, - { label: 'Тоҷикӣ', enLabel: 'Tajik', value: 'tg' }, - { label: 'తెలుగు', enLabel: 'Telugu', value: 'te' }, - { label: 'Oʻzbek', enLabel: 'Uzbek', value: 'uz' }, - { label: 'Yorùbá', enLabel: 'Yoruba', value: 'yo' }, - { label: 'isiZulu', enLabel: 'Zulu', value: 'zu' }, -] as const; - -export type SupportedLanguagesCode = (typeof _languageList)[number]['value']; - -export interface Language { - label: string; - enLabel: string; - /** language code @example 'de' 'es' 'zh' 'en_us' 'en_uk' */ - value: string; -} - -export const SupportedLanguages: Language[] = _languageList.toSorted((a, b) => a.label.localeCompare(b.label)); \ No newline at end of file diff --git a/src/apps/toolbar/i18n/index.ts b/src/apps/toolbar/i18n/index.ts index 34da023f..2e931350 100644 --- a/src/apps/toolbar/i18n/index.ts +++ b/src/apps/toolbar/i18n/index.ts @@ -1,10 +1,9 @@ import 'moment/min/locales'; +import { SupportedLanguagesCode } from '@seelen-ui/lib'; import i18n from 'i18next'; import yaml from 'js-yaml'; import { initReactI18next } from 'react-i18next'; -import { SupportedLanguagesCode } from '../../shared/lang'; - i18n.use(initReactI18next).init( { lng: 'en', diff --git a/static/widgets/demo.yml b/static/widgets/demo.yml deleted file mode 100644 index a800d6a1..00000000 --- a/static/widgets/demo.yml +++ /dev/null @@ -1 +0,0 @@ -id: '@seelen/demo' \ No newline at end of file diff --git a/static/widgets/launcher.yml b/static/widgets/launcher.yml new file mode 100644 index 00000000..fc75ec9e --- /dev/null +++ b/static/widgets/launcher.yml @@ -0,0 +1 @@ +id: '@seelen/launcher' \ No newline at end of file diff --git a/static/widgets/toolbar.yml b/static/widgets/toolbar.yml new file mode 100644 index 00000000..14e1b2ba --- /dev/null +++ b/static/widgets/toolbar.yml @@ -0,0 +1 @@ +id: '@seelen/fancy-toolbar' \ No newline at end of file diff --git a/static/widgets/wallpaper-manager.yml b/static/widgets/wallpaper-manager.yml new file mode 100644 index 00000000..80c29188 --- /dev/null +++ b/static/widgets/wallpaper-manager.yml @@ -0,0 +1 @@ +id: '@seelen/wallpaper-manager' \ No newline at end of file diff --git a/static/widgets/weg.yml b/static/widgets/weg.yml new file mode 100644 index 00000000..15e3ca2b --- /dev/null +++ b/static/widgets/weg.yml @@ -0,0 +1 @@ +id: '@seelen/weg' \ No newline at end of file diff --git a/static/widgets/window-manager.yml b/static/widgets/window-manager.yml new file mode 100644 index 00000000..53e89e0d --- /dev/null +++ b/static/widgets/window-manager.yml @@ -0,0 +1 @@ +id: '@seelen/window-manager' \ No newline at end of file