import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_client__ from "@tachybase/client";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
const Hello = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.observer)((props)=>{
    const { insertAdjacent } = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_client__.useDesignable)();
    const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
        children: [
            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("h1", {
                children: fieldSchema.name
            }),
            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_antd__.Space, {
                children: [
                    /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Button, {
                        onClick: ()=>{
                            insertAdjacent('beforeBegin', {
                                'x-component': 'Hello'
                            });
                        },
                        children: "before begin"
                    }),
                    /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Button, {
                        onClick: ()=>{
                            insertAdjacent('afterBegin', {
                                'x-component': 'Hello'
                            });
                        },
                        children: "after begin"
                    }),
                    /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Button, {
                        onClick: ()=>{
                            insertAdjacent('beforeEnd', {
                                'x-component': 'Hello'
                            });
                        },
                        children: "before end"
                    }),
                    /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Button, {
                        onClick: ()=>{
                            insertAdjacent('afterEnd', {
                                'x-component': 'Hello'
                            });
                        },
                        children: "after end"
                    })
                ]
            }),
            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
                style: {
                    margin: 50
                },
                children: props.children
            })
        ]
    });
}, {
    displayName: 'Hello'
});
const Page = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.observer)((props)=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
        children: props.children
    }), {
    displayName: 'Page'
});
function App() {
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaComponentProvider, {
        components: {
            Page,
            Hello
        },
        children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaComponent, {
            schema: {
                type: 'void',
                name: 'page',
                'x-uid': (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)(),
                'x-component': 'Page',
                properties: {
                    hello1: {
                        type: 'void',
                        'x-uid': (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)(),
                        'x-component': 'Hello'
                    }
                }
            }
        })
    });
}
export { App as default };
