|
@@ -4,6 +4,7 @@ import { HTMLContainer, TLComponentProps } from '@tldraw/react'
|
|
|
import { TLAsset, TLImageShape, TLImageShapeProps } from '@tldraw/core'
|
|
import { TLAsset, TLImageShape, TLImageShapeProps } from '@tldraw/core'
|
|
|
import { observer } from 'mobx-react-lite'
|
|
import { observer } from 'mobx-react-lite'
|
|
|
import { LogseqContext } from '../logseq-context'
|
|
import { LogseqContext } from '../logseq-context'
|
|
|
|
|
+import { BindingIndicator } from './BindingIndicator'
|
|
|
|
|
|
|
|
export interface ImageShapeProps extends TLImageShapeProps {
|
|
export interface ImageShapeProps extends TLImageShapeProps {
|
|
|
type: 'image'
|
|
type: 'image'
|
|
@@ -27,7 +28,7 @@ export class ImageShape extends TLImageShape<ImageShapeProps> {
|
|
|
isAspectRatioLocked: true,
|
|
isAspectRatioLocked: true,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- ReactComponent = observer(({ events, isErasing, asset }: TLComponentProps) => {
|
|
|
|
|
|
|
+ ReactComponent = observer(({ events, isErasing, isBinding, asset }: TLComponentProps) => {
|
|
|
const {
|
|
const {
|
|
|
props: {
|
|
props: {
|
|
|
opacity,
|
|
opacity,
|
|
@@ -45,6 +46,8 @@ export class ImageShape extends TLImageShape<ImageShapeProps> {
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<HTMLContainer {...events} opacity={isErasing ? 0.2 : opacity}>
|
|
<HTMLContainer {...events} opacity={isErasing ? 0.2 : opacity}>
|
|
|
|
|
+ {isBinding && <BindingIndicator mode="html" strokeWidth={4} size={[w, h]} />}
|
|
|
|
|
+
|
|
|
<div style={{ width: '100%', height: '100%', overflow: 'hidden' }}>
|
|
<div style={{ width: '100%', height: '100%', overflow: 'hidden' }}>
|
|
|
{asset && (
|
|
{asset && (
|
|
|
<img
|
|
<img
|