import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
import "react";
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
import * as __WEBPACK_EXTERNAL_MODULE_antd_style__ from "antd-style";
import * as __WEBPACK_EXTERNAL_MODULE_classnames__ from "classnames";
import * as __WEBPACK_EXTERNAL_MODULE__application_hoc_withDynamicSchemaProps_mjs__ from "../../../application/hoc/withDynamicSchemaProps.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__common_index_mjs__ from "../../common/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__ from "../../hooks/index.mjs";
import * as __WEBPACK_EXTERNAL_MODULE__hooks_useGetAriaLabelOfBlockItem_mjs__ from "./hooks/useGetAriaLabelOfBlockItem.mjs";
function _tagged_template_literal(strings, raw) {
    if (!raw) raw = strings.slice(0);
    return Object.freeze(Object.defineProperties(strings, {
        raw: {
            value: Object.freeze(raw)
        }
    }));
}
function _templateObject() {
    const data = _tagged_template_literal([
        "\n    position: relative;\n    &:hover {\n      > .general-schema-designer {\n        display: block;\n      }\n    }\n    &.tb-form-item:hover {\n      > .general-schema-designer {\n        background: var(--colorBgSettingsHover) !important;\n        border: 0 !important;\n        top: -5px !important;\n        bottom: -5px !important;\n        left: -5px !important;\n        right: -5px !important;\n      }\n    }\n    > .general-schema-designer {\n      position: absolute;\n      z-index: 999;\n      top: 0;\n      bottom: 0;\n      left: 0;\n      right: 0;\n      display: none;\n      border: 2px solid var(--colorBorderSettingsHover);\n      pointer-events: none;\n      > .general-schema-designer-icons {\n        position: absolute;\n        right: 2px;\n        top: 2px;\n        line-height: 16px;\n        pointer-events: all;\n        .ant-space-item {\n          background-color: var(--colorSettings);\n          color: #fff;\n          line-height: 16px;\n          width: 16px;\n          padding-left: 1px;\n          align-self: stretch;\n        }\n      }\n    }\n  "
    ]);
    _templateObject = function() {
        return data;
    };
    return data;
}
const useStyles = (0, __WEBPACK_EXTERNAL_MODULE_antd_style__.createStyles)((param)=>{
    let { css } = param;
    return css(_templateObject());
});
const BlockItem = (0, __WEBPACK_EXTERNAL_MODULE__application_hoc_withDynamicSchemaProps_mjs__.withDynamicSchemaProps)((props)=>{
    const { className, children } = (0, __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__.useProps)(props);
    const { styles } = useStyles();
    const Designer = (0, __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__.useDesigner)();
    const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
    const { getAriaLabel } = (0, __WEBPACK_EXTERNAL_MODULE__hooks_useGetAriaLabelOfBlockItem_mjs__.useGetAriaLabelOfBlockItem)(props.name);
    return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE__common_index_mjs__.SortableItem, {
        role: "button",
        "aria-label": getAriaLabel(),
        className: (0, __WEBPACK_EXTERNAL_MODULE_classnames__["default"])('tb-block-item', className, styles),
        children: [
            /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(Designer, {
                ...fieldSchema['x-toolbar-props']
            }),
            children
        ]
    });
});
export { BlockItem };
