From 669577f9bab15096fe60ba5333ad3894cd8cc32e Mon Sep 17 00:00:00 2001
From: ci7lus <7887955+ci7lus@users.noreply.github.com>
Date: Thu, 17 Feb 2022 20:53:29 +0900
Subject: [PATCH] =?UTF-8?q?=E2=9A=B0=EF=B8=8F=20zenza=E5=BB=83=E6=AD=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/ci.yml | 4 -
.gitmodules | 3 -
README.md | 12 +-
src/miraktest-miyou/README.md | 2 +-
src/miraktest-miyou/index.tsx | 58 ++++---
src/miraktest-nico/README.md | 2 +-
src/miraktest-nico/index.tsx | 58 ++++---
src/miraktest-saya/README.md | 2 +-
src/miraktest-saya/index.tsx | 59 +++----
src/miraktest-zenza/README.md | 8 -
src/miraktest-zenza/index.tsx | 242 ---------------------------
src/miraktest-zenza/types.ts | 16 --
src/miraktest-zenza/zenzaLoader.d.ts | 3 -
src/miraktest-zenza/zenzaLoader.js | 7 -
src/pecore.ts | 22 +++
webpack.config.ts | 3 -
zenzawatch | 1 -
17 files changed, 111 insertions(+), 391 deletions(-)
delete mode 100644 .gitmodules
delete mode 100644 src/miraktest-zenza/README.md
delete mode 100644 src/miraktest-zenza/index.tsx
delete mode 100644 src/miraktest-zenza/types.ts
delete mode 100644 src/miraktest-zenza/zenzaLoader.d.ts
delete mode 100644 src/miraktest-zenza/zenzaLoader.js
create mode 100644 src/pecore.ts
delete mode 160000 zenzawatch
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 48729d8..e60d864 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -73,10 +73,6 @@ jobs:
- name: Install
run: |
yarn
- - name: Install (zenzawatch)
- run: |
- yarn
- working-directory: ./zenzawatch
- name: Build
run: |
yarn build --env=analyze=yes
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index d2adaf6..0000000
--- a/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "zenzawatch"]
- path = zenzawatch
- url = git@github.com:neneka/ZenzaWatch.git
diff --git a/README.md b/README.md
index e28d999..6b0669d 100644
--- a/README.md
+++ b/README.md
@@ -23,19 +23,17 @@
- [Discord RPC](./src/miraktest-drpc)
(v1 標準機能代替) Discord に番組情報を連携表示するプラグインです。
- [Saya](./src/miraktest-saya)
- (v1 標準機能代替) Saya と連携し、視聴中のサービスに関するコメントを取得します。コメントの表示には Zenza か DPlayer プラグインが必要です。
+ (v1 標準機能代替) Saya と連携し、視聴中のサービスに関するコメントを取得します。コメントの表示には DPlayer プラグインが必要です。
- [DPlayer](./src/miraktest-dplayer)
(v1 標準機能代替) Saya プラグインと連携し、コメントを表示します。
-- [Zenza](./src/miraktest-zenza)
- ~~Saya プラグインと連携し、コメントを表示します。~~ **現在動きません**
- [EPGStation](./src/miraktest-epgs)
EPGStation と連携し、録画番組を再生します。
- [Annict](./src/miraktest-annict)
Annict と連携し、視聴中のアニメを記録します。
- [Miyou](./src/miraktest-miyou)
- Miyou から視聴中の録画番組のコメントを取得します。コメントの表示には Zenza か DPlayer プラグインが必要です。
+ Miyou から視聴中の録画番組のコメントを取得します。コメントの表示には DPlayer プラグインが必要です。
- [Nico](./src/miraktest-nico)
- ニコニコ実況(過去ログ API)から視聴中の録画番組のコメントを取得します。コメントの表示には Zenza か DPlayer プラグインが必要です。
+ ニコニコ実況(過去ログ API)から視聴中の録画番組のコメントを取得します。コメントの表示には DPlayer プラグインが必要です。
- [Gyazo](./src/miraktest-gyazo)
スクリーンショットを Gyazo にアップロードします。
- [Twitter](./src/miraktest-twitter)
@@ -47,10 +45,6 @@
git clone git@github.com:ci7lus/miraktest-plugins.git
cd miraktest-plugins
yarn
-git submodule init
-cd zenzawatch
-yarn
-cd ..
yarn build
yarn build --env=files=miraktest-annict # miraktest-annictだけをビルドする
```
diff --git a/src/miraktest-miyou/README.md b/src/miraktest-miyou/README.md
index d91ec2b..593356e 100644
--- a/src/miraktest-miyou/README.md
+++ b/src/miraktest-miyou/README.md
@@ -2,7 +2,7 @@
[search-future/miyou.tv](https://github.com/search-future/miyou.tv) で使用されている miteru との連携を行うプラグインです。
コメントの取得にモリタポアカウントが必要です。設定画面から指定してください。
-[miraktest-dplayer](../miraktest-dplayer) か [miraktest-zenza](../miraktest-zenza) が必要です。
+[miraktest-dplayer](../miraktest-dplayer) など対応するコメントレンダラープラグインが必要です。
## ダウンロード
diff --git a/src/miraktest-miyou/index.tsx b/src/miraktest-miyou/index.tsx
index 84f4dd3..a6d8a4d 100644
--- a/src/miraktest-miyou/index.tsx
+++ b/src/miraktest-miyou/index.tsx
@@ -1,14 +1,14 @@
import axios from "axios"
+import dayjs from "dayjs"
import React, { useEffect, useState } from "react"
-import type { RecoilState } from "recoil"
-import { atom, useRecoilValue, useRecoilState, useSetRecoilState } from "recoil"
+import { atom, useRecoilValue, useRecoilState } from "recoil"
import YAML from "yaml"
-import { Atom, InitPlugin } from "../@types/plugin"
+import { InitPlugin } from "../@types/plugin"
import { SayaDefinition } from "../miraktest-annict/types"
import { DPLAYER_COMMENT_EVENT } from "../miraktest-dplayer/constants"
import { DPlayerCommentPayload } from "../miraktest-dplayer/types"
import { trimCommentForFlow } from "../miraktest-saya/comment"
-import { NicoCommentChat } from "../miraktest-zenza/types"
+import { ChatInput, PECORE_ID } from "../pecore"
import { useRefFromState, wait } from "../shared/utils"
import tailwind from "../tailwind.scss"
import { MiyouComment, MiyouSetting } from "./types"
@@ -28,7 +28,7 @@ const meta = {
author: "ci7lus",
version: "0.0.1",
description:
- "Miyouからコメントを取得するプラグインです。ZenzaかDPlayerプラグインが必要です。",
+ "Miyouからコメントを取得するプラグインです。対応するコメントレンダラープラグインが必要です。",
}
const main: InitPlugin = {
@@ -45,8 +45,8 @@ const main: InitPlugin = {
default: null,
})
- let zenzaCommentAtom: RecoilState | null = null
let isDplayerFound = false
+ let isPkrFound = false
const client = axios.create({
baseURL: "https://miteru.digitiminimi.com/a2sc.php",
@@ -72,22 +72,12 @@ const main: InitPlugin = {
},
],
setup({ plugins }) {
- const zenza = plugins.find(
- (plugin) => plugin.id === "io.github.ci7lus.miraktest-plugins.zenza"
- )
- if (zenza) {
- const family = zenza.exposedAtoms.find(
- (atom): atom is Atom =>
- atom.type === "atom" &&
- atom.atom.key === "plugins.ci7lus.zenza.comment"
- )
- if (family) {
- zenzaCommentAtom = family.atom
- }
- }
isDplayerFound = !!plugins.find(
(plugin) => plugin.id === "io.github.ci7lus.miraktest-plugins.dplayer"
)
+ isPkrFound = !!plugins.find(
+ (plugin) => plugin.id === "io.github.ci7lus.miraktest-plugins.pecore"
+ )
},
components: [
{
@@ -102,14 +92,11 @@ const main: InitPlugin = {
)
const time = useRecoilValue(atoms.contentPlayerPlayingTimeSelector)
const timeRef = useRefFromState(time)
- const setZenzaComment = zenzaCommentAtom
- ? useSetRecoilState(zenzaCommentAtom)
- : null
const [token, setToken] = useRecoilState(tokenAtom)
// miyou token取得
useEffect(() => {
- if (!setZenzaComment && !isDplayerFound) {
+ if (!isPkrFound && !isDplayerFound) {
console.warn("コメント送信先の取得に失敗しています")
return
}
@@ -296,13 +283,6 @@ const main: InitPlugin = {
if (text.length === 0) {
continue
}
- if (setZenzaComment) {
- setZenzaComment({
- date: comment.time,
- mail: comment.email,
- content: text,
- })
- }
if (isDplayerFound) {
const event = new CustomEvent(DPLAYER_COMMENT_EVENT, {
bubbles: false,
@@ -321,6 +301,24 @@ const main: InitPlugin = {
})
window.dispatchEvent(event)
}
+ if (isPkrFound) {
+ const detail: ChatInput = {
+ thread: "1",
+ no: comment.title,
+ vpos: performance.now() / 10 + 200,
+ mail: [comment.email],
+ date: dayjs(comment.time).format(),
+ dateUsec: NaN,
+ anonymous: true,
+ commands: [],
+ content: text,
+ }
+ const event = new CustomEvent(PECORE_ID, {
+ bubbles: false,
+ detail,
+ })
+ window.dispatchEvent(event)
+ }
index++
}
})()
diff --git a/src/miraktest-nico/README.md b/src/miraktest-nico/README.md
index c63438a..33003c2 100644
--- a/src/miraktest-nico/README.md
+++ b/src/miraktest-nico/README.md
@@ -2,7 +2,7 @@
[ニコニコ実況](https://jk.nicovideo.jp) との連携を行うプラグインです。現在は録画のみ対応です。
過去ログは[ニコニコ実況 過去ログ API](https://jikkyo.tsukumijima.net/)から取得します。
-[miraktest-dplayer](../miraktest-dplayer) か [miraktest-zenza](../miraktest-zenza) が必要です。
+対応するコメントレンダラープラグインが必要です。
## ダウンロード
diff --git a/src/miraktest-nico/index.tsx b/src/miraktest-nico/index.tsx
index b9ad335..b87c422 100644
--- a/src/miraktest-nico/index.tsx
+++ b/src/miraktest-nico/index.tsx
@@ -1,14 +1,14 @@
import axios from "axios"
+import dayjs from "dayjs"
import React, { useEffect, useState } from "react"
-import type { RecoilState } from "recoil"
-import { atom, useRecoilValue, useRecoilState, useSetRecoilState } from "recoil"
+import { atom, useRecoilValue, useRecoilState } from "recoil"
import YAML from "yaml"
-import { Atom, InitPlugin } from "../@types/plugin"
+import { InitPlugin } from "../@types/plugin"
import { SayaDefinition } from "../miraktest-annict/types"
import { DPLAYER_COMMENT_EVENT } from "../miraktest-dplayer/constants"
import { DPlayerCommentPayload } from "../miraktest-dplayer/types"
import { trimCommentForFlow } from "../miraktest-saya/comment"
-import { NicoCommentChat } from "../miraktest-zenza/types"
+import { ChatInput, PECORE_ID } from "../pecore"
import { useRefFromState, wait } from "../shared/utils"
import tailwind from "../tailwind.scss"
import { parseMail } from "./parser"
@@ -28,7 +28,7 @@ const meta = {
author: "ci7lus",
version: "0.0.1",
description:
- "ニコニコ実況からコメントを取得するプラグインです。ZenzaかDPlayerプラグインが必要です。",
+ "ニコニコ実況からコメントを取得するプラグインです。対応するコメントレンダラープラグインが必要です。",
}
const main: InitPlugin = {
@@ -41,8 +41,8 @@ const main: InitPlugin = {
},
})
- let zenzaCommentAtom: RecoilState | null = null
let isDplayerFound = false
+ let isPkrFound = false
return {
...meta,
@@ -60,22 +60,12 @@ const main: InitPlugin = {
},
],
setup({ plugins }) {
- const zenza = plugins.find(
- (plugin) => plugin.id === "io.github.ci7lus.miraktest-plugins.zenza"
- )
- if (zenza) {
- const family = zenza.exposedAtoms.find(
- (atom): atom is Atom =>
- atom.type === "atom" &&
- atom.atom.key === "plugins.ci7lus.zenza.comment"
- )
- if (family) {
- zenzaCommentAtom = family.atom
- }
- }
isDplayerFound = !!plugins.find(
(plugin) => plugin.id === "io.github.ci7lus.miraktest-plugins.dplayer"
)
+ isPkrFound = !!plugins.find(
+ (plugin) => plugin.id === "io.github.ci7lus.miraktest-plugins.pecore"
+ )
},
components: [
{
@@ -90,14 +80,11 @@ const main: InitPlugin = {
)
const time = useRecoilValue(atoms.contentPlayerPlayingTimeSelector)
const timeRef = useRefFromState(time)
- const setZenzaComment = zenzaCommentAtom
- ? useSetRecoilState(zenzaCommentAtom)
- : null
const [sayaDefinition, setSayaDefinition] =
useState(null)
useEffect(() => {
- if (!setZenzaComment && !isDplayerFound) {
+ if (!isPkrFound && !isDplayerFound) {
console.warn("コメント送信先の取得に失敗しています")
return
}
@@ -117,7 +104,7 @@ const main: InitPlugin = {
const [jk, setJk] = useState(null)
useEffect(() => {
- if (!setZenzaComment && !isDplayerFound) {
+ if (!isPkrFound && !isDplayerFound) {
return
}
if (!sayaDefinition) {
@@ -245,16 +232,27 @@ const main: InitPlugin = {
if (text.length === 0) {
continue
}
- if (setZenzaComment) {
- setZenzaComment({
- ...comment,
- thread: 1,
- anonymity: 1,
+ const { color, position } = parseMail(comment.mail)
+ if (isPkrFound) {
+ const detail: ChatInput = {
+ thread: "1",
+ no: comment.no.toString(),
+ vpos: performance.now() / 10 + 200,
+ mail: [],
+ date: dayjs(comment.date).format(),
+ dateUsec: comment.date_usec,
+ anonymous: true,
+ commands: [color, position],
content: text,
+ }
+ const event = new CustomEvent(PECORE_ID, {
+ bubbles: false,
+ detail,
})
+ window.dispatchEvent(event)
}
+
if (isDplayerFound) {
- const { color, position } = parseMail(comment.mail)
const event = new CustomEvent(DPLAYER_COMMENT_EVENT, {
bubbles: false,
detail: {
diff --git a/src/miraktest-saya/README.md b/src/miraktest-saya/README.md
index 4358ce6..5ff5830 100644
--- a/src/miraktest-saya/README.md
+++ b/src/miraktest-saya/README.md
@@ -1,7 +1,7 @@
# miraktest-saya
[SlashNephy/saya](https://github.com/SlashNephy/saya) との連携を行うプラグインです。
-[miraktest-dplayer](../miraktest-dplayer) か [miraktest-zenza](../miraktest-zenza) が必要です。
+[miraktest-dplayer](../miraktest-dplayer) など対応するコメントレンダラープラグインが必要です。
MirakTest v1 での Saya 連携をおおよそ代替します。
## ダウンロード
diff --git a/src/miraktest-saya/index.tsx b/src/miraktest-saya/index.tsx
index 4ef7507..8659603 100644
--- a/src/miraktest-saya/index.tsx
+++ b/src/miraktest-saya/index.tsx
@@ -1,6 +1,6 @@
+import dayjs from "dayjs"
import React, { useEffect, useRef, useState } from "react"
import { Plus, X } from "react-feather"
-import type { RecoilState } from "recoil"
import {
atom,
atomFamily,
@@ -10,10 +10,10 @@ import {
} from "recoil"
import ReconnectingWebSocket from "reconnecting-websocket"
import urlJoin from "url-join"
-import { Atom, InitPlugin } from "../@types/plugin"
+import { InitPlugin } from "../@types/plugin"
import { DPLAYER_COMMENT_EVENT } from "../miraktest-dplayer/constants"
import { DPlayerCommentPayload } from "../miraktest-dplayer/types"
-import { NicoCommentChat } from "../miraktest-zenza/types"
+import { ChatInput, PECORE_ID } from "../pecore"
import { useRefFromState } from "../shared/utils"
import tailwind from "../tailwind.scss"
import { trimCommentForFlow } from "./comment"
@@ -33,7 +33,7 @@ const meta = {
author: "ci7lus",
version: "0.1.0",
description:
- "Sayaからコメントを取得するプラグインです。ZenzaかDPlayerプラグインが必要です。",
+ "Sayaからコメントを取得するプラグインです。対応するコメントレンダラープラグインが必要です。",
}
const commentWindowId = `${_id}.sayaCommentWindow`
@@ -52,8 +52,8 @@ const main: InitPlugin = {
default: [],
})
- let zenzaCommentAtom: RecoilState | null = null
let isDplayerFound = false
+ let isPkrFound = false
const commentFamilyKey = `${prefix}.rawComment`
const rawCommentFamily = atomFamily({
@@ -87,22 +87,12 @@ const main: InitPlugin = {
},
],
setup({ plugins }) {
- const zenza = plugins.find(
- (plugin) => plugin.id === "io.github.ci7lus.miraktest-plugins.zenza"
- )
- if (zenza) {
- const family = zenza.exposedAtoms.find(
- (atom): atom is Atom =>
- atom.type === "atom" &&
- atom.atom.key === "plugins.ci7lus.zenza.comment"
- )
- if (family) {
- zenzaCommentAtom = family.atom
- }
- }
isDplayerFound = !!plugins.find(
(plugin) => plugin.id === "io.github.ci7lus.miraktest-plugins.dplayer"
)
+ isPkrFound = !!plugins.find(
+ (plugin) => plugin.id === "io.github.ci7lus.miraktest-plugins.pecore"
+ )
},
components: [
{
@@ -118,9 +108,6 @@ const main: InitPlugin = {
const isPlaying = useRecoilValue(atoms.contentPlayerIsPlayingAtom)
const time = useRecoilValue(atoms.contentPlayerPlayingTimeSelector)
const timeRef = useRefFromState(time)
- const setZenzaComment = zenzaCommentAtom
- ? useSetRecoilState(zenzaCommentAtom)
- : null
const setRawComment = useSetRecoilState(rawCommentFamily(windowId))
const wsRef = useRef(null)
const send = (ws: ReconnectingWebSocket, payload: object) => {
@@ -135,7 +122,7 @@ const main: InitPlugin = {
})
}
useEffect(() => {
- if (!setZenzaComment && !isDplayerFound) {
+ if (!isPkrFound && !isDplayerFound) {
console.warn("コメント送信先の取得に失敗しています")
return
}
@@ -207,16 +194,6 @@ const main: InitPlugin = {
setRawComment(payload)
const commentText = trimCommentForFlow(payload.text)
if (commentText.trim().length === 0) return
- if (setZenzaComment) {
- setZenzaComment({
- no: payload.no,
- date: payload.time,
- date_usec: payload.timeMs,
- user_id: payload.author || undefined,
- mail: payload.type,
- content: commentText,
- })
- }
if (isDplayerFound) {
const event = new CustomEvent(DPLAYER_COMMENT_EVENT, {
bubbles: false,
@@ -224,6 +201,24 @@ const main: InitPlugin = {
})
window.dispatchEvent(event)
}
+ if (isPkrFound) {
+ const detail: ChatInput = {
+ thread: "1",
+ no: payload.source + payload.author,
+ vpos: performance.now() / 10 + 200,
+ mail: [],
+ date: dayjs(payload.time * 1000).format(),
+ dateUsec: payload.timeMs / 10,
+ anonymous: true,
+ commands: [],
+ content: commentText,
+ }
+ const event = new CustomEvent(PECORE_ID, {
+ bubbles: false,
+ detail,
+ })
+ window.dispatchEvent(event)
+ }
})
ws.addEventListener("open", () => {
console.info("Sayaへ接続しました")
diff --git a/src/miraktest-zenza/README.md b/src/miraktest-zenza/README.md
deleted file mode 100644
index 5483df4..0000000
--- a/src/miraktest-zenza/README.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# miraktest-zenza
-
-[miraktest-saya](../miraktest-saya) からのコメントを受け取って ZenzaWatch コメントプレイヤーで表示します。単体でいれても意味はありません。
-MirakTest v2.0.0-beta.0 時点ではうまく動きません。
-
-## ダウンロード
-
-
diff --git a/src/miraktest-zenza/index.tsx b/src/miraktest-zenza/index.tsx
deleted file mode 100644
index 70dd495..0000000
--- a/src/miraktest-zenza/index.tsx
+++ /dev/null
@@ -1,242 +0,0 @@
-import React, { useEffect, useState, useRef } from "react"
-import { useDebounce } from "react-use"
-import { atom, useRecoilValue, useRecoilState } from "recoil"
-import { InitPlugin } from "../@types/plugin"
-import tailwind from "../tailwind.scss"
-import { NicoCommentChat, NicoCommentList } from "./types"
-import { NicoCommentPlayer } from "./zenzaLoader"
-
-/**
- * MirakTest Zenza Plugin
- * ZenzaWatchのコメントプレイヤーをMirakTestで表示するためのプラグインです
- * https://github.com/neneka/ZenzaWatch
- * ニココメントフォーマット(NicoCommentChat)を出力するコメントソースのプラグインが別途必要です
- * 参考: https://github.com/rinsuki/nicotv
- * MIT License 2021 rinsuki
- * MIT License 2021 ci7lus
- */
-
-const _id = "io.github.ci7lus.miraktest-plugins.zenza"
-const prefix = "plugins.ci7lus.zenza"
-const meta = {
- id: _id,
- name: "Zenza",
- author: "ci7lus",
- version: "0.0.1",
- description:
- "映像の上にSayaコメントレンダラーを表示するプラグインです。別途コメントソースが必要です。",
-}
-
-const main: InitPlugin = {
- renderer: async () => {
- const allCommentsAtom = atom({
- key: `${prefix}.allComments`,
- default: null,
- })
- const commentAtom = atom({
- key: `${prefix}.comment`,
- default: null,
- })
- const opacityAtom = atom({
- key: `${prefix}.opacity`,
- default: 1,
- })
-
- const ZenzaCommentRendererCore: React.FC<{
- comment: NicoCommentChat | null
- allComments: NicoCommentList | null
- currentTime: number
- isPaused: boolean
- opacity: number
- }> = ({ comment, allComments, currentTime, isPaused, opacity }) => {
- const playerRef = useRef(null)
- const div = useRef(null)
-
- useEffect(() => {
- if (playerRef.current) return
- const player = new NicoCommentPlayer({
- filter: {
- enableFilter: false,
- fork0: true,
- fork1: true,
- fork2: true,
- },
- showComment: true,
- debug: true,
- playbackRate: 1,
- })
- playerRef.current = player
- console.info("NicoCommentPlayer", player)
- player.setComment(JSON.stringify([]), { format: "json" })
- }, [])
-
- useEffect(() => {
- if (!div.current || !playerRef.current) return
- playerRef.current.appendTo(div.current)
- }, [div.current, playerRef.current])
-
- useEffect(() => {
- const player = playerRef.current
- if (!allComments || !player) return
- player.setComment(JSON.stringify(allComments), { format: "json" })
- console.info("コメント", allComments)
- }, [allComments, playerRef.current])
-
- useEffect(() => {
- const player = playerRef.current
- if (!comment || !player) return
- let vpos = comment.vpos
- if (!vpos) {
- vpos = player.vpos + 200 + new Date().getMilliseconds() / 10
- }
- player.addChat(comment.content, comment.mail, vpos, comment)
- }, [comment, playerRef.current])
-
- useEffect(() => {
- const player = playerRef.current
- if (!player) return
- try {
- player.currentTime = currentTime
- } catch {}
- }, [currentTime, playerRef.current])
-
- useEffect(() => {
- const player = playerRef.current
- if (!player) return
- if (isPaused) {
- player._view.pause()
- } else {
- player._view.play()
- }
- }, [isPaused, playerRef.current])
-
- return (
-
- )
- }
-
- return {
- ...meta,
- exposedAtoms: [
- { type: "atom", atom: allCommentsAtom },
- { type: "atom", atom: commentAtom },
- ],
- sharedAtoms: [
- { type: "atom", atom: allCommentsAtom },
- { type: "atom", atom: opacityAtom },
- ],
- storedAtoms: [{ type: "atom", atom: opacityAtom }],
- setup() {
- return
- },
- components: [
- {
- id: `${prefix}.zenzaCommentPlayer`,
- position: "onPlayer",
- component: () => {
- const comments = useRecoilValue(allCommentsAtom)
- const comment = useRecoilValue(commentAtom)
- const opacity = useRecoilValue(opacityAtom)
- const [currentTime, setCurrentTime] = useState(0)
- useEffect(() => {
- console.warn("onPlayerの描画(Zenza)")
- const timer = setInterval(
- () => setCurrentTime((n) => n + 1),
- 1000
- )
- return () => clearInterval(timer)
- }, [])
- useEffect(() => {
- setCurrentTime(0)
- }, [comments])
- return (
- <>
-
-
- >
- )
- },
- },
- {
- id: `${prefix}.settings`,
- position: "onSetting",
- label: meta.name,
- component: () => {
- const [opacity, setOpacity] = useRecoilState(opacityAtom)
- const [rangeOpacity, setRangeOpacity] = useState(opacity * 10)
- useDebounce(
- () => {
- setOpacity(rangeOpacity / 10)
- },
- 100,
- [rangeOpacity]
- )
- return (
- <>
-
-
- >
- )
- },
- },
- ],
- destroy() {
- return
- },
- windows: {},
- }
- },
-}
-
-const componentCss = `
-body { margin: 0; background: black; }
-.player {
- width: 100%;
- height: 100%;
-}
-.player > * {
- position: absolute;
- width: 100%;
- height: 100%;
-}
-.zenzaCommentRendererCore {
- width: 100%;
- height: 100%;
- pointer-events: none;
-}
-.zenzaCommentRendererCore > iframe {
- border: 0;
- width: 100%;
- height: 100%;
-}`
-
-export default main
diff --git a/src/miraktest-zenza/types.ts b/src/miraktest-zenza/types.ts
deleted file mode 100644
index 15d97c0..0000000
--- a/src/miraktest-zenza/types.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-export type NicoCommentChat = {
- thread?: number
- no?: number
- vpos?: number
- date: number
- date_usec?: number
- premium?: number
- anonymity?: number
- user_id?: string
- mail: string
- content: string
-}
-
-export type NicoCommentList = {
- chat: NicoCommentChat
-}[]
diff --git a/src/miraktest-zenza/zenzaLoader.d.ts b/src/miraktest-zenza/zenzaLoader.d.ts
deleted file mode 100644
index 7a7273b..0000000
--- a/src/miraktest-zenza/zenzaLoader.d.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-import { NicoCommentPlayer } from "../../zenzawatch/src/CommentPlayer"
-
-export { NicoCommentPlayer }
diff --git a/src/miraktest-zenza/zenzaLoader.js b/src/miraktest-zenza/zenzaLoader.js
deleted file mode 100644
index 30ce2e7..0000000
--- a/src/miraktest-zenza/zenzaLoader.js
+++ /dev/null
@@ -1,7 +0,0 @@
-if (typeof window !== "undefined") {
- exports["NicoCommentPlayer"] =
- // eslint-disable-next-line @typescript-eslint/no-var-requires
- require("../../zenzawatch/src/CommentPlayer").NicoCommentPlayer
-} else {
- exports["NicoCommentPlayer"] = null
-}
diff --git a/src/pecore.ts b/src/pecore.ts
new file mode 100644
index 0000000..b594091
--- /dev/null
+++ b/src/pecore.ts
@@ -0,0 +1,22 @@
+export type ChatInput = {
+ thread: string
+ no: string
+ content: string
+ vpos: number
+ mail: string[]
+ date: string
+ dateUsec: number | null
+ userId?: string
+ anonymous: boolean
+ commands: string[]
+ score?: undefined
+ fork?: undefined
+ position?: "ue" | "naka" | "shita"
+ size?: string
+ colorName?: string
+ colorCode?: string
+ font?: string
+ atNumber?: number
+}
+
+export const PECORE_ID = "io.github.ci7lus.miraktest-plugins.pecore.comment"
diff --git a/webpack.config.ts b/webpack.config.ts
index 4b5a431..54cd622 100644
--- a/webpack.config.ts
+++ b/webpack.config.ts
@@ -33,7 +33,6 @@ const entries: Entry[] = [
name: "miraktest-saya",
dir: "./src/miraktest-saya",
},
- // { name: "miraktest-zenza", dir: "./src/miraktest-zenza" },
{
name: "miraktest-dplayer",
dir: "./src/miraktest-dplayer",
@@ -132,8 +131,6 @@ const config: (
new esm(),
new LicenseWebpackPlugin({
licenseTextOverrides: {
- "@zenza/components": "MIT License 2021 segabito",
- ZenzaWatch: "MIT License 2021 segabito",
"discord-rpc": "MIT License snek ",
},
}) as never,
diff --git a/zenzawatch b/zenzawatch
deleted file mode 160000
index 1442bf9..0000000
--- a/zenzawatch
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 1442bf9272b997b61601395097eec4fcd097440e