function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
import { ConfigProvider } from "antd";
import classNames from "clsx";
import React, { createElement, useContext } from "react";
/**
 * ReadonlyList 组件 - 只读列表预览组件
 *
 * 专门针对 readonly 模式优化的列表组件，移除了拖拽功能等编辑相关功能。
 * 简化渲染逻辑，提升预览模式性能。
 *
 * @component
 * @description 只读列表预览组件，用于预览模式下的列表渲染
 * @param {ElementProps<ListNode>} props - 组件属性
 * @param {ListNode} props.element - 列表节点元素
 * @param {React.ReactNode} props.children - 子组件内容
 * @param {Object} props.attributes - 元素属性
 *
 * @example
 * ```tsx
 * <ReadonlyList
 *   element={listNode}
 *   attributes={attributes}
 * >
 *   列表项内容
 * </ReadonlyList>
 * ```
 *
 * @returns {React.ReactElement} 渲染的只读列表组件
 *
 * @remarks
 * - 移除拖拽相关事件处理
 * - 使用 React.memo 优化性能
 * - 保持预览模式的视觉效果
 */ export var ReadonlyList = /*#__PURE__*/ React.memo(function(param) {
    var element = param.element, attributes = param.attributes, children = param.children;
    var isOrdered = element.type === 'numbered-list';
    var isBulleted = element.type === 'bulleted-list';
    var context = useContext(ConfigProvider.ConfigContext);
    var baseCls = context.getPrefixCls('agentic-md-editor-list');
    var tag = isOrdered ? 'ol' : 'ul';
    return /*#__PURE__*/ React.createElement("div", _object_spread({
        className: classNames("".concat(baseCls, "-container"), 'relative'),
        "data-be": 'list'
    }, attributes), /*#__PURE__*/ createElement(tag, _define_property({
        className: classNames(baseCls, isOrdered ? 'ol' : 'ul'),
        start: isOrdered ? element.start : undefined
    }, 'data-task', isBulleted && element.task ? 'true' : undefined), children));
});
ReadonlyList.displayName = 'ReadonlyList';
