import * as __WEBPACK_EXTERNAL_MODULE__index_mjs__ from "../../../../index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__application_schema_initializer_SchemaInitializer_mjs__ from "../../../../application/schema-initializer/SchemaInitializer.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__schema_initializer_utils_mjs__ from "../../../../schema-initializer/utils.mjs";
const commonOptions = {
    wrap: __WEBPACK_EXTERNAL_MODULE__schema_initializer_utils_mjs__.gridRowColWrap,
    title: '{{t("Add block")}}',
    icon: 'PlusOutlined',
    items: [
        {
            type: 'itemGroup',
            title: '{{t("Selector")}}',
            name: 'selector',
            children: [
                {
                    name: 'title',
                    title: 'Table',
                    Component: 'TableSelectorInitializer'
                }
            ]
        },
        {
            type: 'itemGroup',
            title: '{{t("Filter blocks")}}',
            name: 'filterBlocks',
            useChildren () {
                const { name, dataSource } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useCollection)();
                return [
                    {
                        name: 'filterFormBlockInTableSelector',
                        title: '{{t("Form")}}',
                        Component: 'FilterFormBlockInitializer',
                        componentProps: {
                            filterCollections () {
                                return false;
                            },
                            onlyCurrentDataSource: true
                        },
                        collectionName: name,
                        dataSource
                    },
                    {
                        name: 'filterCollapseBlockInTableSelector',
                        title: '{{t("Collapse")}}',
                        Component: 'FilterCollapseBlockInitializer',
                        componentProps: {
                            filterCollections () {
                                return false;
                            },
                            onlyCurrentDataSource: true
                        },
                        collectionName: name,
                        dataSource
                    }
                ];
            }
        },
        {
            type: 'itemGroup',
            title: '{{t("Other blocks")}}',
            name: 'otherBlocks',
            children: [
                {
                    title: '{{t("Add text")}}',
                    Component: 'BlockItemInitializer',
                    name: 'addText',
                    schema: {
                        type: 'void',
                        'x-editable': false,
                        'x-decorator': 'BlockItem',
                        'x-toolbar': 'BlockSchemaToolbar',
                        'x-settings': 'blockSettings:markdown',
                        'x-component': 'Markdown.Void',
                        'x-component-props': {
                            content: '{{t("This is a demo text, **supports Markdown syntax**.")}}'
                        }
                    }
                }
            ]
        }
    ]
};
const tableSelectorInitializers = new __WEBPACK_EXTERNAL_MODULE__application_schema_initializer_SchemaInitializer_mjs__.SchemaInitializer({
    name: 'popup:tableSelector:addBlock',
    ...commonOptions
});
export { tableSelectorInitializers };
