Skip to content

Commit

Permalink
0.0.19 (#244)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
nekobato and dependabot[bot] authored Oct 9, 2024
1 parent 38811c9 commit 4875679
Show file tree
Hide file tree
Showing 55 changed files with 1,599 additions and 1,087 deletions.
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/Layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const { site, frontmatter } = useData();

<style scoped>
.contents {
background: var(--color-background);
min-height: 100%;
padding: 40px;
background: var(--color-background);
}
</style>
8 changes: 8 additions & 0 deletions docs/components/misskey/mfm.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ const center = '<center>\nCenter\n</center>'
const background = '$[fg.color=f00 赤字]\n$[bg.color=ff0 黄背景]$[bg.color=00 デフォルト]'
const spin = `$[spin 🍮]$[spin.left 🍮]$[spin.alternate 🍮]\n$[spin.x 🍮]$[spin.x,left 🍮]$[spin.x,alternate 🍮]\n$[spin.y 🍮]$[spin.y,left 🍮]$[spin.y,alternate 🍮]\n$[spin.speed=5s 🍮]`
const plain = '<plain>$[x2 plain text]</plain>'

// https://misskey.io/notes/9y4e1ez19qyy0ai6
const mfmArt1 = '$[position.x=3,y=1 $[scale.x=1.3,y=1.1 $[border.radius=99,width=8,color=420 $[position.x=4.2,y=3.6 $[scale.x=.66,y=.8 $[scale.x=-15,y=-9 $[bg.color=57a :blank:]]$[position.x=-2,y=3.4 $[scale.y=5 $[blur $[scale.x=-15 $[bg.color=fa07 :blank:]]]]]$[position.x=-4,y=2 $[scale.x=2,y=2 $[scale.x=.4,y=.4 $[blur $[scale.x=3,y=3 ⚪]]]]$[position.x=-1.3 $[scale.x=3,y=3 $[blur $[scale.x=.7,y=.7 🌕]]]]]$[position.x=-25,y=3 $[scale.x=-12,y=5 ⛰$[position.x=-1.6,y=.3 $[scale.x=.5,y=0.6 $[rotate.deg=45 $[bg.color=0044 :blank:]]]]]]$[position.x=-17,y=4 $[scale.x=-13,y=5 ⛰$[position.x=-1.6,y=.3 $[scale.x=.5,y=.6 $[rotate.deg=45 $[bg.color=0044 :blank:]]]]]]\n$[position.y=6.2 $[scale.x=-15,y=5 $[bg.color=030 :blank:]]]\n$[position.x=-7,y=-3 $[rotate.deg=-3 $[scale.x=1.5,y=5 🟫]$[position.x=-2.5,y=2.8 $[rotate.deg=70 $[scale.x=1,y=2.6 🤎]]]$[position.x=-2.1,y=3 $[rotate.deg=-30 $[scale.x=1,y=2 🤎]]]$[position.x=-2.4,y=3 $[rotate.deg=-70 $[scale.x=1,y=3 🤎]]]]]$[position.x=-3.5,y=-3 $[rotate.deg=1 $[scale.x=1.5,y=5 🟫]$[position.x=-2.5,y=2.8 $[rotate.deg=70 $[scale.x=1,y=2.6 🤎]]]$[position.x=-3.1,y=3.4 $[rotate.deg=30 $[scale.x=1,y=2 🤎]]]$[position.x=-2.4,y=3 $[rotate.deg=-70 $[scale.x=1,y=3 🤎]]]]]\n$[position.x=7.5,y=-3.7 $[rotate.deg=5 $[scale.x=1.5,y=5 🟫]$[position.x=-2.5,y=2.8 $[rotate.deg=70 $[scale.x=1,y=2.6 🤎]]]$[position.x=-2.1,y=3 $[rotate.deg=-30 $[scale.x=1,y=2 🤎]]]$[position.x=-2,y=3 $[rotate.deg=-70 $[scale.x=1,y=3 🤎]]]]]$[position.x=-11.2,y=-5 $[rotate.deg=220 $[scale.x=0.7,y=3 🤎]]]$[position.x=-7,y=-3 $[scale.x=-11,y=-9 $[rotate.deg=-45 🥦$[position.x=-0.7,y=0.6 🥦]$[position.x=-1.4,y=1.1 🥦]]]]\n$[position.x=0.7,y=-14 $[scale.y=1 $[blur $[scale.x=-13,y=5 $[bg.color=0044 :blank:]]]]]$[position.y=1.5 $[scale.y=0.6 $[blur $[scale.x=-13,y=5 $[bg.color=ca4 :blank:]]]]]$[position.x=-14 $[rotate.deg=50 $[scale.x=0.4 $[blur $[scale.x=5,y=4 $[bg.color=0044 :blank:]]]]]]$[position.x=-4,y=1.6 $[rotate.deg=-10 $[scale.x=0.25 $[blur $[scale.x=5,y=4 $[bg.color=0044 :blank:]]]]]]$[position.x=2,y=1.6 $[rotate.deg=-30 $[scale.x=0.25 $[blur $[scale.x=5,y=4 $[bg.color=0044 :blank:]]]]]]$[position.x=-14,y=4 $[rotate.deg=190 $[jump.speed=1.5s $[scale.x=0.4 $[blur $[scale.x=5,y=4 $[bg.color=0044 :blank:]]]]]]]$[position.x=-7.4,y=4.5 $[rotate.deg=168 $[jump.speed=1.5s,delay=0.3s $[scale.x=0.3 $[blur $[scale.x=5,y=4 $[bg.color=0044 :blank:]]]]]]]\n$[position.x=-4,y=-4 $[jump.speed=1.5s $[scale.x=1.2,y=1.2 $[position.x=4.5,y=1 💨]$[scale.x=2,y=2 :blobcatuwu:]$[position.x=-0.5,y=-1 $[rotate.deg=30 $[scale.x=3,y=2.4 👒]]]$[position.x=-4.6 $[scale.x=1.5,y=1.5 ⚽]]$[position.x=-4.5 $[rotate.deg=17 $[scale.x=0.7,y=0.7 $[blur $[scale.x=2,y=2 $[bg.color=0045 :blank:]]]]]]]]]$[position.x=-5.5,y=-4 $[jump.speed=1.5s,delay=0.3s $[position.x=4.2,y=2 💨]$[rotate.deg=-3 $[scale.x=2,y=2 :bunhd_happy:]$[position.x=-2,y=1.4 $[scale.x=0.7,y=0.7 $[blur $[scale.x=2,y=1.3 $[bg.color=0045 :blank:]]]]]]]]\n:blank:]]]]]\n$[position.x=7.8,y=2 #1hMFMアート]\n$[scale.x=0 MFMart by @disc@misskey.io]'

</script>

# Mfm
Expand Down Expand Up @@ -131,3 +135,7 @@ const plain = '<plain>$[x2 plain text]</plain>'
<Box>
<Mfm :text="plain" />
</Box>

<Box>
<Mfm :text="mfmArt1" />
</Box>
10 changes: 10 additions & 0 deletions main/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ export const storeDefaults: StoreSchema = {
shortcuts: {
toggleTimeline: "Ctrl+Alt+x",
},
text2Speech: {
enabled: false,
rate: 1,
pitch: 1,
volume: 1,
voice: "Kyoko",
hookUrl: "",
},
misskey: {
hideCw: false,
showReactions: true,
Expand Down Expand Up @@ -336,6 +344,8 @@ export const setSetting = (key: string, value: any) => {
return store.set("settings.misskey.hideCw", value);
case "misskey.showReactions":
return store.set("settings.misskey.showReactions", value);
case "text2Speech.enabled":
return store.set("settings.text2Speech.enabled", value);
default:
throw new Error(`${key} is not defined key.`);
}
Expand Down
8 changes: 3 additions & 5 deletions main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,7 @@ const setMainWindowMode = async (mode: string) => {
};

const start = () => {
const menu = Menu.buildFromTemplate(
menuTemplate({
mainWindow,
}),
);
const menu = Menu.buildFromTemplate(menuTemplate());
Menu.setApplicationMenu(menu);
setGlobalShortcut();

Expand Down Expand Up @@ -126,6 +122,7 @@ const start = () => {
height: workAreaSize.height,
});
mediaViewerWindow?.center();
console.log("media-viewer:open", data);
mediaViewerWindow?.webContents.send(event, data);
mediaViewerWindow?.show();
mediaViewerWindow?.focus();
Expand All @@ -152,6 +149,7 @@ const start = () => {
postWindow?.hide();
break;
case "post:reaction":
case "post:repost":
postWindow?.webContents.send(event, data);
postWindow?.center();
postWindow?.show();
Expand Down
37 changes: 26 additions & 11 deletions main/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import electron, { app, dialog } from "electron";

type MenuTemplate = (electron.MenuItemConstructorOptions | electron.MenuItem)[];

const menuTemplate = ({ mainWindow }: { mainWindow: electron.BrowserWindow | null }): MenuTemplate => [
// @ts-ignore: appMenu is not defined in d.ts
const menuTemplate = (): MenuTemplate => [
{
label: "DotE",
submenu: [
Expand All @@ -23,18 +22,27 @@ const menuTemplate = ({ mainWindow }: { mainWindow: electron.BrowserWindow | nul
type: "separator",
},
{
id: "reload",
label: "Reload Timeline",
click: () => {
mainWindow?.webContents.reload();
},
role: "services",
},
{
type: "separator",
},
{
id: "quit",
label: "Quit DotE",
label: "Close DotE",
role: "hide",
accelerator: "CommandOrControl+W",
},
{
label: "Hide DotE",
role: "hide",
},
{
role: "hideOthers",
},
{
role: "unhide",
},
{
role: "quit",
},
],
Expand All @@ -43,10 +51,17 @@ const menuTemplate = ({ mainWindow }: { mainWindow: electron.BrowserWindow | nul
label: "Edit",
role: "editMenu",
},
// @ts-ignore: viewMenu is not defined in d.ts
{
label: "View",
role: "viewMenu",
// Customized ViewMenu for excluding toggleDevTools
submenu: [
{ role: "reload" },
{ role: "forceReload" },
{ type: "separator" },
{ role: "resetZoom" },
{ role: "zoomIn" },
{ role: "zoomOut" },
],
},
];

Expand Down
2 changes: 2 additions & 0 deletions main/static.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as path from "path";

export const isDevelopment = process.env.NODE_ENV === "development";

process.env.ROOT = path.join(__dirname, "..");
process.env.DIST = path.join(process.env.ROOT, "dist-electron");
process.env.VITE_PUBLIC = process.env.VITE_DEV_SERVER_URL
Expand Down
8 changes: 5 additions & 3 deletions main/windows/mainWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ export function createMainWindow() {
width: settings.windowSize.width || 360,
height: settings.windowSize.height || screen.getPrimaryDisplay().workAreaSize.height - 24, // size of Mac tray size
minWidth: 360,
minHeight: 240,
minHeight: 360,
resizable: true,
webPreferences: {
preload: preload,
},
frame: false,
frame: true,
transparent: true,
hasShadow: false,
skipTaskbar: false,
roundedCorners: false,
show: true,
titleBarStyle: "hidden",
titleBarOverlay: true,
trafficLightPosition: { x: 8, y: 12 },
icon: join("build", `app_icon.png`),
});

Expand Down
3 changes: 2 additions & 1 deletion main/windows/mediaViewerWindow.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { join } from "path";
import { BrowserWindow } from "electron";
import { pageRoot, preload } from "../static";
import { isDevelopment, pageRoot, preload } from "../static";

const pageName = "/media-viewer";

Expand All @@ -10,6 +10,7 @@ export function createMediaViewerWindow() {
resizable: true,
webPreferences: {
preload: preload,
devTools: isDevelopment,
},
frame: false,
transparent: true,
Expand Down
10 changes: 9 additions & 1 deletion main/windows/postWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,22 @@ export function createPostWindow() {
skipTaskbar: false,
alwaysOnTop: false,
fullscreenable: false,
titleBarStyle: "hidden",
titleBarOverlay: true,
trafficLightPosition: { x: 8, y: 12 },
});

if (process.env.NODE_ENV === "development") {
win.loadURL(pageRoot.development + "#" + pageName);
// win.webContents.openDevTools();
win.webContents.openDevTools();
} else {
win.loadFile(join(pageRoot.production), { hash: pageName });
}

win.on("close", (e) => {
e.preventDefault();
win.hide();
});

return win;
}
40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"url": "https://github.com/nekobato/dote.git"
},
"scripts": {
"prepare": "rm -rf node_modules/electron/dist && node node_modules/electron/install.js",
"dev": "vite",
"build": "vue-tsc && vite build && electron-builder --config electron-builder.config.cjs",
"preview": "vite preview",
"build": "pnpm prepare && vue-tsc && vite build && electron-builder --config electron-builder.config.cjs",
"release": "pnpm build && electron-builder --publish always -c --config electron-builder.config.cjs",
"build:icon": "electron-icon-builder --input=./public/images/logo/icon.png --output=./public",
"typecheck": "tsc",
Expand All @@ -30,39 +30,39 @@
"main": "./dist-electron/index.js",
"dependencies": {
"electron-fetch": "^1.9.1",
"electron-log": "^5.1.5",
"electron-log": "^5.1.7",
"electron-store": "^10.0.0",
"electron-updater": "^6.2.1"
},
"devDependencies": {
"@iconify/vue": "^4.1.1",
"@vitejs/plugin-vue": "^5.1.4",
"@vitejs/plugin-vue-jsx": "^4.0.0",
"@vueuse/core": "^10.9.0",
"electron": "31.1.0",
"@iconify/vue": "^4.1.2",
"@vitejs/plugin-vue-jsx": "^4.0.1",
"@vueuse/core": "^11.0.1",
"electron": "32.0.1",
"electron-builder": "^24.13.3",
"electron-icon-builder": "^2.0.1",
"@vitejs/plugin-vue": "^5.1.4",
"element-plus": "^2.8.4",
"mfm-js": "^0.24.0",
"misskey-js": "^2024.5.0",
"misskey-js": "^2024.8.0",
"nanoid": "^5.0.7",
"pinia": "^2.1.7",
"pinia": "^2.2.2",
"postcss-html": "^1.7.0",
"prettier": "^3.3.2",
"sass": "^1.77.2",
"stylelint": "^16.6.1",
"prettier": "^3.3.3",
"sass": "^1.77.8",
"stylelint": "^16.8.2",
"stylelint-config-rational-order": "^0.1.2",
"stylelint-config-recommended-scss": "^14.0.0",
"stylelint-config-recommended-scss": "^14.1.0",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-order": "^6.0.4",
"vite": "^5.4.2",
"typescript": "^5.6.2",
"vite": "^5.3.3",
"vite-plugin-electron": "^0.28.7",
"vite-plugin-electron-renderer": "^0.14.5",
"vite-plugin-resolve": "^2.5.1",
"vitepress": "^1.3.1",
"vue": "^3.4.33",
"vue-router": "^4.3.2",
"vue-tsc": "^2.0.26"
"vite-plugin-resolve": "^2.5.2",
"vitepress": "^1.3.3",
"vue": "^3.4.38",
"vue-router": "^4.4.3",
"vue-tsc": "^2.0.29"
}
}
Loading

0 comments on commit 4875679

Please sign in to comment.