mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:38:51 +00:00
feat: support mobile iframe block and toolbar props (#4292)
This commit is contained in:
parent
1604a4fdb6
commit
077efebdf0
@ -72,6 +72,7 @@ export interface GeneralSchemaDesignerProps {
|
|||||||
* @deprecated use `SchemaToolbar` instead
|
* @deprecated use `SchemaToolbar` instead
|
||||||
*/
|
*/
|
||||||
export const GeneralSchemaDesigner: FC<GeneralSchemaDesignerProps> = (props: any) => {
|
export const GeneralSchemaDesigner: FC<GeneralSchemaDesignerProps> = (props: any) => {
|
||||||
|
const fieldSchema = useFieldSchema();
|
||||||
const {
|
const {
|
||||||
disableInitializer,
|
disableInitializer,
|
||||||
title,
|
title,
|
||||||
@ -80,11 +81,10 @@ export const GeneralSchemaDesigner: FC<GeneralSchemaDesignerProps> = (props: any
|
|||||||
contextValue,
|
contextValue,
|
||||||
draggable = true,
|
draggable = true,
|
||||||
showDataSource = true,
|
showDataSource = true,
|
||||||
} = props;
|
} = { ...props, ...(fieldSchema['x-toolbar-props'] || {}) } as GeneralSchemaDesignerProps;
|
||||||
const { dn, designable } = useDesignable();
|
const { dn, designable } = useDesignable();
|
||||||
const field = useField();
|
const field = useField();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const fieldSchema = useFieldSchema();
|
|
||||||
const compile = useCompile();
|
const compile = useCompile();
|
||||||
const { getAriaLabel } = useGetAriaLabelOfDesigner();
|
const { getAriaLabel } = useGetAriaLabelOfDesigner();
|
||||||
const schemaSettingsProps = {
|
const schemaSettingsProps = {
|
||||||
@ -191,9 +191,16 @@ export interface SchemaToolbarProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const InternalSchemaToolbar: FC<SchemaToolbarProps> = (props) => {
|
const InternalSchemaToolbar: FC<SchemaToolbarProps> = (props) => {
|
||||||
const { title, initializer, settings, showBackground, showBorder = true, draggable = true } = props;
|
|
||||||
const { designable } = useDesignable();
|
|
||||||
const fieldSchema = useFieldSchema();
|
const fieldSchema = useFieldSchema();
|
||||||
|
const {
|
||||||
|
title,
|
||||||
|
initializer,
|
||||||
|
settings,
|
||||||
|
showBackground,
|
||||||
|
showBorder = true,
|
||||||
|
draggable = true,
|
||||||
|
} = { ...props, ...(fieldSchema['x-toolbar-props'] || {}) } as SchemaToolbarProps;
|
||||||
|
const { designable } = useDesignable();
|
||||||
const compile = useCompile();
|
const compile = useCompile();
|
||||||
const { styles } = useStyles();
|
const { styles } = useStyles();
|
||||||
const { getAriaLabel } = useGetAriaLabelOfDesigner();
|
const { getAriaLabel } = useGetAriaLabelOfDesigner();
|
||||||
|
@ -39,6 +39,11 @@ export class PluginBlockIframeClient extends Plugin {
|
|||||||
title: '{{t("Iframe")}}',
|
title: '{{t("Iframe")}}',
|
||||||
Component: 'IframeBlockInitializer',
|
Component: 'IframeBlockInitializer',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.app.schemaInitializerManager.addItem('mobilePage:addBlock', 'otherBlocks.iframe', {
|
||||||
|
title: '{{t("Iframe")}}',
|
||||||
|
Component: 'IframeBlockInitializer',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user