Skip to content

Commit

Permalink
Use @mml-io/mml-react-types (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusLongmuir authored Aug 8, 2024
1 parent dc22c42 commit 5044260
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@
"react-dom": "18.3.1",
"@types/react": "18.3.2",
"@types/react-dom": "18.3.0"
},
"devDependencies": {
"@mml-io/mml-react-types": "0.17.1"
}
}
6 changes: 3 additions & 3 deletions packages/playground/src/Slot.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { MMLClickEvent } from "@mml-io/mml-react-types";
import * as React from "react";
import { useEffect, useState } from "react";

Expand Down Expand Up @@ -85,13 +86,12 @@ export function Slot(props: { x: number; z: number; demo?: { url: string; title:
>
{loadedState ? (
<>
<m-frame className="document-frame" y="0.2" src={loadedState.url}></m-frame>
<m-frame y="0.2" src={loadedState.url}></m-frame>
<m-group
className="remove-document"
visible-to={loadedState.removable ? loadedState.userId : ""}
x={(SLOT_WIDTH - SLOT_BORDER_THICKNESS) / 2}
z={(SLOT_DEPTH - SLOT_BORDER_THICKNESS) / 2}
onClick={(event: CustomEvent<{ connectionId: number }>) => {
onClick={(event: MMLClickEvent) => {
const { connectionId } = event.detail;
if (loadedState && loadedState.removable && loadedState.userId === connectionId) {
setLoadedState(null);
Expand Down
1 change: 1 addition & 0 deletions packages/playground/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"target": "ES2020",
"jsx": "react-jsx",
"lib": ["esnext", "dom", "dom.iterable"],
"types": ["react", "react-dom", "node", "@mml-io/mml-react-types"],
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
Expand Down

0 comments on commit 5044260

Please sign in to comment.