1
- import { useId , useMemo } from "react" ;
1
+ import { useMemo } from "react" ;
2
2
import { useStore } from "@nanostores/react" ;
3
3
import { 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" ;
5
13
import type { Instance } from "@webstudio-is/sdk" ;
6
14
import { AlertIcon } from "@webstudio-is/icons" ;
7
15
import { $instances } from "~/shared/nano-states" ;
@@ -10,6 +18,7 @@ import {
10
18
BindingPopover ,
11
19
} from "~/builder/shared/binding-popover" ;
12
20
import { updateWebstudioData } from "~/shared/instance-utils" ;
21
+ import { CodeEditor } from "~/builder/shared/code-editor" ;
13
22
import {
14
23
type ControlProps ,
15
24
useLocalValue ,
@@ -55,7 +64,6 @@ export const TextContent = ({
55
64
updateChildren ( instanceId , "text" , value ) ;
56
65
}
57
66
} ) ;
58
- const id = useId ( ) ;
59
67
60
68
const { scope, aliases } = useStore ( $selectedInstanceScope ) ;
61
69
let expression : undefined | string ;
@@ -107,15 +115,24 @@ export const TextContent = ({
107
115
}
108
116
>
109
117
< 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 }
114
133
value = { localValue . value }
115
- rows = { 1 }
116
134
onChange = { localValue . set }
117
- onBlur = { localValue . save }
118
- onSubmit = { localValue . save }
135
+ onChangeComplete = { localValue . save }
119
136
/>
120
137
{ expression !== undefined && (
121
138
< BindingPopover
0 commit comments