Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions CustomExitScreen/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Build output
dist/
build/

# Dependencies
node_modules/

# Environment
.uuid.env

# Module Federation temp
.__mf__temp/
__mf__temp/

# Editor
.vscode/
.idea/
*.iml
*.sublime-project
*.sublime-workspace
*.swp
*.swo
*~

# OS
.DS_Store

# Logs
*.log*

# Coverage
coverage/
93 changes: 93 additions & 0 deletions CustomExitScreen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# CustomExitScreen

A plugin template for customizing the metatell exit screen.

## Requirements

- Node 24+

## Development

```bash
npm install
npm run dev
```

The dev server runs at `http://localhost:5173`.

## Build

```bash
npm run build
```

The Module Federation manifest is output to `dist/mf-manifest.json`.

## Plugin type

```
CustomExitScreen
```
Comment on lines +28 to +30

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

コードブロックに言語指定を追加してください。

静的解析ツール(markdownlint)がこのコードブロックに言語指定がないことを検出しました。textまたはplaintextを指定することで修正できます。

修正案
-```
+```text
 CustomExitScreen
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

28-28: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In `@CustomExitScreen/README.md` around lines 28 - 30, The fenced code block
containing "CustomExitScreen" lacks a language label; update that block by
changing the opening triple backticks from ``` to ```text (or ```plaintext) so
it becomes ```text\nCustomExitScreen\n```, ensuring markdownlint no longer flags
the missing language.


## Supported reasons

| reason | description | trigger |
|--------|-------------|---------|
| `exited` | Exit (fallback) | Default value of `exitScene()` |
| `left` | Exit | When `leave_room_requested` fires from the in-world UI |
| `closed` | Room closed | When the host closes the room |
| `denied` | Access denied | When the user has no entry permission |
| `kicked` | Kicked | When the host kicks the user |
| `connectError` | Connection error | When the server connection fails |
| `sceneError` | Scene error | When the 3D scene fails to load |

## Props

```ts
export type CustomExitScreenProps = {
reason:
| "exited"
| "closed"
| "denied"
| "kicked"
| "left"
| "connectError"
| "sceneError";
contentByReason: Record<
CustomExitScreenProps["reason"],
{
title: string;
message: string;
buttonLabel: string;
buttonUrl?: string;
}
>;
onPrimaryAction: () => void;
logoUrl?: string;
};
```

## Module Federation metadata

```ts
export const mfMeta = {
type: "CustomExitScreen",
contractVersion: 1,
supportedReasons: [
"exited",
"closed",
"denied",
"kicked",
"left",
"connectError",
"sceneError"
] as const
};
```

## Notes

- `.uuid.env` contains `VERSION_ID` and `VITE_VERSION_ID` generated by `npm run set-uuid`.
- The host loads `CustomExitScreen` via the Module Federation runtime.
- `exited` and `left` show the same message. `exited` is a fallback, and `left` is used in normal cases.
- The 2D "Leave" button usually navigates to the root from `LeaveRoomModal`, so it does not go through `ExitedRoomScreen`.
12 changes: 12 additions & 0 deletions CustomExitScreen/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CustomExitScreen</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading