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";
const gridRowColWrap = (schema)=>({
        type: 'void',
        'x-component': 'Grid.Row',
        properties: {
            [(0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)()]: {
                type: 'void',
                'x-component': 'Grid.Col',
                properties: {
                    [schema.name || (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)()]: schema
                }
            }
        }
    });
const addBlockButton = new __WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaInitializer({
    name: 'addBlockButton',
    title: 'Add block',
    wrap: gridRowColWrap,
    items: [
        {
            name: 'media',
            type: 'itemGroup',
            title: 'Other blocks',
            children: [
                {
                    name: 'markdown',
                    title: 'Markdown',
                    Component: 'MarkdownBlockInitializer'
                }
            ]
        }
    ]
});
const demo3_rslib_entry_schema = {
    type: 'object',
    properties: {
        grid: {
            type: 'void',
            'x-component': 'Grid',
            'x-initializer': 'addBlockButton',
            'x-uid': (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.uid)(),
            properties: {}
        }
    }
};
function Root() {
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaComponentProvider, {
        components: {
            Grid: __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Grid,
            CardItem: __WEBPACK_EXTERNAL_MODULE__tachybase_client__.CardItem,
            Markdown: __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Markdown,
            MarkdownBlockInitializer: __WEBPACK_EXTERNAL_MODULE__tachybase_client__.MarkdownBlockInitializer
        },
        children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaComponent, {
            schema: demo3_rslib_entry_schema
        })
    });
}
class MyPlugin extends __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Plugin {
    async load() {
        this.app.router.add('root', {
            path: '/',
            Component: Root
        });
        this.app.schemaInitializerManager.add(addBlockButton);
    }
}
const app = new __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Application({
    router: {
        type: 'memory',
        initialEntries: [
            '/'
        ]
    },
    plugins: [
        MyPlugin
    ]
});
const demo3_rslib_entry_ = app.getRootComponent();
export { addBlockButton, demo3_rslib_entry_ as default };
