File tree Expand file tree Collapse file tree 4 files changed +25
-6
lines changed Expand file tree Collapse file tree 4 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,11 @@ export function EasyblocksEditor(props: EasyblocksEditorProps) {
6262 onExternalDataChange = { props . onExternalDataChange ?? ( ( ) => ( { } ) ) }
6363 widgets = { props . widgets }
6464 components = { props . components }
65+ readOnly = { props . readOnly }
66+ locale = { props . locale }
67+ documentId = { props . documentId }
68+ rootTemplate = { props . rootTemplate }
69+ rootComponent = { props . rootComponent }
6570 />
6671 ) }
6772
Original file line number Diff line number Diff line change @@ -25,4 +25,9 @@ export type EasyblocksEditorProps = {
2525 > ;
2626
2727 __debug ?: boolean ;
28+ rootTemplate ?: string ;
29+ rootComponent ?: string ;
30+ locale ?: string ;
31+ documentId ?: string ;
32+ readOnly ?: boolean ;
2833} ;
Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ type EasyblocksParentProps = {
3131 | ComponentType < InlineTypeWidgetComponentProps < any > >
3232 > ;
3333 components ?: Record < string , ComponentType < any > > ;
34+ locale ?: string ;
35+ documentId ?: string ;
36+ rootComponent ?: string ;
37+ rootTemplate ?: string ;
38+ readOnly ?: boolean ;
3439} ;
3540
3641const shouldForwardProp : ShouldForwardProp < "web" > = ( propName , target ) => {
@@ -70,11 +75,15 @@ export function EasyblocksParent(props: EasyblocksParentProps) {
7075 />
7176 < Editor
7277 config = { props . config }
73- locale = { editorSearchParams . locale ?? undefined }
74- readOnly = { editorSearchParams . readOnly ?? true }
75- documentId = { editorSearchParams . documentId }
76- rootComponentId = { editorSearchParams . rootComponentId ?? null }
77- rootTemplateId = { editorSearchParams . rootTemplateId }
78+ locale = { props . locale || editorSearchParams . locale || undefined }
79+ readOnly = { props . readOnly ?? editorSearchParams . readOnly ?? true }
80+ documentId = { props . documentId ?? editorSearchParams . documentId }
81+ rootComponentId = {
82+ props . rootComponent ?? editorSearchParams . rootComponentId ?? null
83+ }
84+ rootTemplateId = {
85+ props . rootTemplate ?? editorSearchParams . rootTemplateId
86+ }
7887 externalData = { props . externalData }
7988 onExternalDataChange = { props . onExternalDataChange }
8089 widgets = { {
Original file line number Diff line number Diff line change @@ -648,7 +648,7 @@ const EditorContent = ({
648648 const sidebarNodeRef = useRef < HTMLDivElement | null > ( null ) ;
649649
650650 const [ editableData , form ] = useForm ( {
651- id : " easyblocks-editor" ,
651+ id : ` easyblocks-editor- ${ initialEntry . _id } ` ,
652652 label : "Edit entry" ,
653653 fields : [ ] ,
654654 initialValues : initialEntry ,
You can’t perform that action at this time.
0 commit comments