-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add directives to change how sites generate
- Loading branch information
1 parent
5a705e8
commit 50e7fe0
Showing
5 changed files
with
81 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { TLCompleteEventInfo, TLTextShape, TextShapeTool } from "tldraw"; | ||
|
||
export class PromptShapeTool extends TextShapeTool { | ||
static override id = "prompt"; | ||
onExit = (info: TLCompleteEventInfo) => { | ||
const shape = this.editor.getEditingShape(); | ||
console.log("onDragExit", shape); | ||
if (!shape) return; | ||
this.editor.updateShape<TLTextShape>({ | ||
id: shape.id, | ||
type: "text", | ||
meta: { | ||
prompt: true, | ||
}, | ||
props: { | ||
color: "light-violet", | ||
}, | ||
}); | ||
}; | ||
} |