File tree Expand file tree Collapse file tree 7 files changed +16
-21
lines changed
Expand file tree Collapse file tree 7 files changed +16
-21
lines changed Original file line number Diff line number Diff line change 5959
6060 <SharpForm
6161 :form =" form"
62- :entity-key =" entityKey"
63- :instance-id =" instanceId"
6462 :show-error-alert =" Object.values(props.errors).length > 0"
6563 @submit =" submit"
6664 >
Original file line number Diff line number Diff line change 4848 <div >
4949 <SharpForm
5050 :post-fn =" (data) => commands.postForm(data)"
51- :entity-key =" commands.state.currentCommandEndpoints.entityKey"
52- :instance-id =" commands.state.currentCommandEndpoints.instanceId"
5351 :form =" commands.state.currentCommandForm"
5452 @loading =" (loading) => commands.state.currentCommandFormLoading = loading"
5553 :key =" `form-${currentFormUpdatedKey}`"
Original file line number Diff line number Diff line change 2222
2323 const props = defineProps <{
2424 form: Form
25- entityKey: string ,
26- instanceId? : string | number ,
2725 inline? : boolean ,
2826 postFn? : (data : FormData [' data' ]) => Promise <ApiResponse <any >>,
2927 showErrorAlert? : boolean ,
Original file line number Diff line number Diff line change 183183 <EditorContent :editor =" editor" :key =" locale ?? 'editor'" />
184184 </EditorAttributes >
185185
186- <EditorUploadModal
187- :field =" field"
188- :editor =" editor"
189- ref =" uploadModal"
190- />
186+ <template v-if =" props .field .uploads " >
187+ <EditorUploadModal
188+ :field =" field"
189+ :editor =" editor"
190+ ref =" uploadModal"
191+ />
192+ </template >
191193
192- <EditorEmbedModal
193- :editor =" editor"
194- :field =" field"
195- ref =" embedModal"
196- />
194+ <template v-if =" props .field .embeds " >
195+ <EditorEmbedModal
196+ :editor =" editor"
197+ :field =" field"
198+ ref =" embedModal"
199+ />
200+ </template >
197201
198202 <!-- Commenting this for now because it causes infinite loop on HMR -->
199203
Original file line number Diff line number Diff line change 7474 </DialogHeader >
7575
7676 <SharpForm
77- :entity-key =" parentForm.entityKey"
78- :instance-id =" parentForm.instanceId"
7977 :form =" modalEmbed?.form"
8078 :post-fn =" postForm"
8179 inline
Original file line number Diff line number Diff line change @@ -108,7 +108,6 @@ export type EmbedData = {
108108 tag : string ;
109109 icon : IconData | null ;
110110 attributes : Array < string > ;
111- template : string ;
112111 fields : { [ key : string ] : FormFieldData } ;
113112} ;
114113export type EmbedFormData = {
@@ -334,7 +333,7 @@ export type FormEditorFieldData = {
334333 markdown : boolean ;
335334 inline : boolean ;
336335 showCharacterCount : boolean ;
337- uploads : FormEditorFieldUploadData ;
336+ uploads : FormEditorFieldUploadData | null ;
338337 embeds : { [ embedKey : string ] : EmbedData } ;
339338 toolbar : Array < FormEditorToolbarButton > ;
340339 maxHeight : number | null ;
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public function __construct(
2929 public bool $ markdown ,
3030 public bool $ inline ,
3131 public bool $ showCharacterCount ,
32- #[TypeScriptType( FormEditorFieldUploadData::class )]
32+ #[LiteralTypeScriptType( ' FormEditorFieldUploadData | null ' )]
3333 public ?array $ uploads = null ,
3434 #[LiteralTypeScriptType('{ [embedKey:string]:EmbedData } ' )]
3535 public ?array $ embeds = null ,
You can’t perform that action at this time.
0 commit comments