function _array_like_to_array(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
    return arr2;
}
function _array_without_holes(arr) {
    if (Array.isArray(arr)) return _array_like_to_array(arr);
}
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 _iterable_to_array(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _non_iterable_spread() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
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;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
function _to_consumable_array(arr) {
    return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
}
function _unsupported_iterable_to_array(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _array_like_to_array(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(n);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
import React, { memo } from "react";
import { standardPlugins } from "../Plugins/defaultPlugins";
import { BaseMarkdownEditor } from "./BaseMarkdownEditor";
export * from "./BaseMarkdownEditor";
/**
 * MarkdownEditor 组件 - Markdown编辑器组件
 *
 * 该组件是一个功能完整的Markdown编辑器，基于BaseMarkdownEditor构建，
 * 集成了标准插件集合，提供开箱即用的Markdown编辑功能。
 *
 * @component
 * @description Markdown编辑器组件，提供完整的Markdown编辑功能
 * @param {MarkdownEditorProps} props - 组件属性
 * @param {string} [props.initValue] - 初始值
 * @param {(value: string) => void} [props.onChange] - 内容变化回调
 * @param {React.RefObject} [props.editorRef] - 编辑器引用
 * @param {boolean} [props.readonly] - 是否只读模式
 * @param {Plugin[]} [props.plugins] - 自定义插件列表
 * @param {MarkdownRenderConfig} [props.markdownRenderConfig] - Markdown渲染配置
 * @param {string} [props.className] - 自定义CSS类名
 * @param {React.CSSProperties} [props.style] - 自定义样式
 *
 * @example
 * ```tsx
 * <MarkdownEditor
 *   initValue="# Hello World"
 *   onChange={(value) => console.log('内容变化:', value)}
 *   editorRef={editorRef}
 *   readonly={false}
 * />
 * ```
 *
 * @returns {React.ReactElement} 渲染的Markdown编辑器组件
 *
 * @remarks
 * - 基于BaseMarkdownEditor构建
 * - 集成标准插件集合
 * - 支持自定义插件扩展
 * - 提供完整的Markdown编辑功能
 * - 支持只读模式
 * - 支持内容变化监听
 * - 提供编辑器引用
 */ var MarkdownEditorComponent = function(props) {
    return /*#__PURE__*/ React.createElement(BaseMarkdownEditor, _object_spread_props(_object_spread({}, props), {
        plugins: _to_consumable_array(standardPlugins || []).concat(_to_consumable_array((props === null || props === void 0 ? void 0 : props.plugins) || []))
    }));
};
MarkdownEditorComponent.displayName = 'MarkdownEditor';
// 使用 React.memo 优化性能，避免不必要的重新渲染
export var MarkdownEditor = /*#__PURE__*/ memo(MarkdownEditorComponent);
