File tree Expand file tree Collapse file tree 3 files changed +19
-29
lines changed
messaging/pluginMessage/pluginToContainerMessage Expand file tree Collapse file tree 3 files changed +19
-29
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import type {
5
5
ModalSize ,
6
6
PromptAIPayload ,
7
7
PromptAIResponse ,
8
+ Dimension ,
8
9
} from '../messaging'
9
10
import type { FieldPluginData } from './FieldPluginData'
10
11
@@ -21,20 +22,7 @@ export type RequestUserContext = () => Promise<UserData>
21
22
export type SelectAsset = ( ) => Promise < Asset >
22
23
export type Initialize < Content > = ( ) => Promise < FieldPluginData < Content > >
23
24
export type SetPreviewWidth = (
24
- previewWidth :
25
- | {
26
- tag : 'desktop'
27
- }
28
- | {
29
- tag : 'tablet'
30
- }
31
- | {
32
- tag : 'mobile'
33
- }
34
- | {
35
- tag : 'custom'
36
- width : number
37
- } ,
25
+ previewWidth : Dimension
38
26
) => Promise < void >
39
27
40
28
export type FieldPluginActions < Content > = {
Original file line number Diff line number Diff line change @@ -8,22 +8,24 @@ import {
8
8
optionalGuard ,
9
9
} from 'pure-parse'
10
10
11
+ export type Dimension =
12
+ | {
13
+ tag : 'desktop'
14
+ }
15
+ | {
16
+ tag : 'tablet'
17
+ }
18
+ | {
19
+ tag : 'mobile'
20
+ }
21
+ | {
22
+ tag : 'custom'
23
+ width : number
24
+ }
25
+
11
26
export type PreviewDimensionChangeMessage =
12
27
MessageToContainer < 'previewDimension' > & {
13
- data :
14
- | {
15
- tag : 'desktop'
16
- }
17
- | {
18
- tag : 'tablet'
19
- }
20
- | {
21
- tag : 'mobile'
22
- }
23
- | {
24
- tag : 'custom'
25
- width : number
26
- }
28
+ data : Dimension
27
29
}
28
30
export const isPreviewDimensionChangeMessage =
29
31
objectGuard < PreviewDimensionChangeMessage > ( {
Original file line number Diff line number Diff line change @@ -545,7 +545,7 @@ export const FieldPluginSandbox: FunctionComponent = () => {
545
545
</ Accordion >
546
546
< Accordion defaultExpanded >
547
547
< AccordionSummary >
548
- < Typography variant = "h3" > Data </ Typography >
548
+ < Typography variant = "h3" > Editor Preview </ Typography >
549
549
</ AccordionSummary >
550
550
< AccordionDetails >
551
551
< PreviewDimension previewDimension = { previewDimension } />
You can’t perform that action at this time.
0 commit comments