import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_client__ from "@tachybase/client";
const addActionInitializer = new __WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaInitializer({
    name: 'addAction',
    title: 'Configure actions',
    insertPosition: 'beforeEnd',
    style: {
        marginLeft: 8
    },
    items: [
        {
            name: 'enableActions',
            type: 'itemGroup',
            title: 'Enable actions',
            children: [
                {
                    name: 'create',
                    title: 'Create',
                    Component: 'ActionInitializer',
                    schema: {
                        title: 'Create',
                        'x-action': 'posts:create',
                        'x-component': 'Action',
                        'x-designer': 'Action.Designer',
                        'x-align': 'left'
                    }
                },
                {
                    name: 'update',
                    title: 'Update',
                    Component: 'ActionInitializer',
                    schema: {
                        title: 'Update',
                        'x-action': 'posts:update',
                        'x-component': 'Action',
                        'x-designer': 'Action.Designer',
                        'x-align': 'right'
                    }
                }
            ]
        }
    ]
});
const Root = ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
        children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaComponentProvider, {
            designable: true,
            children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_client__.SchemaComponent, {
                components: {
                    ActionBar: __WEBPACK_EXTERNAL_MODULE__tachybase_client__.ActionBar,
                    Action: __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Action,
                    ActionInitializer: __WEBPACK_EXTERNAL_MODULE__tachybase_client__.ActionInitializer
                },
                schema: {
                    type: 'void',
                    name: 'page',
                    'x-component': 'ActionBar',
                    'x-initializer': 'addAction',
                    properties: {
                        action1: {
                            type: 'void',
                            title: 'Update',
                            'x-action': 'posts:update',
                            'x-component': 'Action'
                        }
                    }
                }
            })
        })
    });
class MyPlugin extends __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Plugin {
    async load() {
        this.app.schemaInitializerManager.add(addActionInitializer);
        this.app.router.add('root', {
            path: '/',
            Component: Root
        });
    }
}
const app = new __WEBPACK_EXTERNAL_MODULE__tachybase_client__.Application({
    router: {
        type: 'memory',
        initialEntries: [
            '/'
        ]
    },
    plugins: [
        MyPlugin
    ]
});
const insert_schema_action_rslib_entry_ = app.getRootComponent();
export { insert_schema_action_rslib_entry_ as default };
