fix mobile embed

This commit is contained in:
Jeff Emmett 2024-10-19 16:20:54 -04:00
parent 895d02a19c
commit 4e2103aab2
2 changed files with 10 additions and 5 deletions

View File

@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "concurrently --kill-others --names client,worker --prefix-colors blue,red yarn:dev:client yarn:dev:worker",
"dev:client": "vite",
"dev:client": "vite --host",
"dev:worker": "wrangler dev",
"build": "tsc && vite build",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
@ -55,4 +55,4 @@
"vite-plugin-wasm": "^3.2.2",
"wrangler": "^3.72.3"
}
}
}

View File

@ -22,7 +22,12 @@ export class EmbedShape extends BaseBoxShapeUtil<IEmbedShape> {
}
indicator(shape: IEmbedShape) {
return <rect x={0} y={0} width={shape.props.w} height={shape.props.h} />;
return (
<g>
<rect x={0} y={0} width={shape.props.w} height={shape.props.h} />
<rect x={0} y={0} width={shape.props.w} height={shape.props.h} style={{ stroke: 'black', strokeWidth: 2, fill: 'none' }} />
</g>
);
}
component(shape: IEmbedShape) {
@ -35,7 +40,7 @@ export class EmbedShape extends BaseBoxShapeUtil<IEmbedShape> {
if (!shape.props.url) {
return (
<div style={{ pointerEvents: 'all' }}>
<div style={{ pointerEvents: 'all', border: '1px solid #000', borderRadius: '5px', padding: '5px' }}>
<form onSubmit={handleSubmit}>
<input
type="text"
@ -44,7 +49,7 @@ export class EmbedShape extends BaseBoxShapeUtil<IEmbedShape> {
placeholder="Enter URL"
style={{ width: shape.props.w, height: shape.props.h }}
/>
<button type="submit">Load</button>
<button type="submit" onTouchStart={handleSubmit} onClick={handleSubmit}>Load</button>
</form>
</div>
);