1- import { useId , useMemo } from "react" ;
1+ import { useMemo } from "react" ;
22import { useStore } from "@nanostores/react" ;
33import { computed } from "nanostores" ;
4- import { Flex , rawTheme , Text , TextArea } from "@webstudio-is/design-system" ;
4+ import {
5+ DialogClose ,
6+ DialogMaximize ,
7+ DialogTitle ,
8+ DialogTitleActions ,
9+ Flex ,
10+ rawTheme ,
11+ Text ,
12+ } from "@webstudio-is/design-system" ;
513import type { Instance } from "@webstudio-is/sdk" ;
614import { AlertIcon } from "@webstudio-is/icons" ;
715import { $instances } from "~/shared/nano-states" ;
@@ -10,6 +18,7 @@ import {
1018 BindingPopover ,
1119} from "~/builder/shared/binding-popover" ;
1220import { updateWebstudioData } from "~/shared/instance-utils" ;
21+ import { CodeEditor } from "~/builder/shared/code-editor" ;
1322import {
1423 type ControlProps ,
1524 useLocalValue ,
@@ -55,7 +64,6 @@ export const TextContent = ({
5564 updateChildren ( instanceId , "text" , value ) ;
5665 }
5766 } ) ;
58- const id = useId ( ) ;
5967
6068 const { scope, aliases } = useStore ( $selectedInstanceScope ) ;
6169 let expression : undefined | string ;
@@ -107,15 +115,24 @@ export const TextContent = ({
107115 }
108116 >
109117 < BindingControl >
110- < TextArea
111- id = { id }
112- disabled = { overwritable === false }
113- autoGrow
118+ < CodeEditor
119+ title = {
120+ < DialogTitle
121+ suffix = {
122+ < DialogTitleActions >
123+ < DialogMaximize />
124+ < DialogClose />
125+ </ DialogTitleActions >
126+ }
127+ >
128+ < Text variant = "labelsTitleCase" > Text Content</ Text >
129+ </ DialogTitle >
130+ }
131+ size = "small"
132+ readOnly = { overwritable === false }
114133 value = { localValue . value }
115- rows = { 1 }
116134 onChange = { localValue . set }
117- onBlur = { localValue . save }
118- onSubmit = { localValue . save }
135+ onChangeComplete = { localValue . save }
119136 />
120137 { expression !== undefined && (
121138 < BindingPopover
0 commit comments