import { isDefined } from "ts-is-present";
import { INDENT_TYPE } from "./../ricos-content/index.js";
import { ToolbarType } from "./../ricos-types/index.js";
import { AllSelection } from "./../tiptap/pm/state.js";
import { isTextSelection } from "./../editor-common/index.js";
import { pluginBlockquote } from "./blockquote/blockquote.js";
import { pluginBold } from "./bold/bold.js";
import { pluginBreakout } from "./breakout/breakout.js";
import { pluginBulletedList } from "./bulleted-list/bulleted-list.js";
import { pluginCheckboxList } from "./checkbox-list/checkbox-list.js";
import { pluginDraggable } from "./draggable/draggable.js";
import { pluginFontSize } from "./font-size/font-size.js";
import { pluginGapSpacer } from "./gap-spacer/gap-spacer.js";
import { pluginHardBreak } from "./hard-break/hard-break.js";
import { pluginItalic } from "./italic/italic.js";
import { pluginCell } from "./layout/plugin-cell.js";
import { pluginLayout } from "./layout/plugin-layout.js";
import { pluginListItem } from "./list-item/list-item.js";
import { pluginNotOvertypable } from "./not-overwritable/not-overtypable.js";
import { pluginOrderedList } from "./ordered-list/ordered-list.js";
import { pluginParagraph } from "./paragraph/paragraph.js";
import { pluginQuickActions } from "./quick-actions/editor.js";
import { pluginResizable } from "./resizable/resizable.js";
import { pluginSelection } from "./selection/selection.js";
import { pluginSpotlight } from "./spotlight/spotlight.js";
import { pluginStrikethrough } from "./strikethrough/strikethrough.js";
import { pluginSubscript } from "./subscript/subscript.js";
import { pluginSuperscript } from "./superscript/superscript.js";
import { pluginTab } from "./tab/tab.js";
import { pluginTextAlignment } from "./text-align/text-align.js";
import { pluginTitle } from "./title/title.js";
import { pluginUnderline } from "./underline/underline.js";
import { pluginUndoRedo } from "./undo-redo/undo-redo.js";
import { unsupportedPlugin } from "./unsupported/unsupported.js";
const commonPlugins = (editorProps, pluginOptions) => {
  const layoutConfig = pluginOptions.find(
    (config) => ["LAYOUT", "layout"].includes(config.type)
  );
  const fontSizeConfig = pluginOptions.find(
    (config) => config.type === "fontSize"
  );
  return [
    pluginBlockquote,
    pluginBold,
    pluginBulletedList,
    pluginCheckboxList,
    pluginFontSize(fontSizeConfig),
    pluginItalic,
    pluginListItem,
    pluginOrderedList,
    pluginParagraph,
    pluginTextAlignment,
    pluginUnderline,
    pluginResizable,
    pluginDraggable,
    pluginUndoRedo,
    pluginTitle,
    pluginHardBreak,
    pluginBreakout,
    pluginTab,
    pluginSelection,
    pluginNotOvertypable,
    pluginGapSpacer,
    unsupportedPlugin,
    pluginStrikethrough,
    pluginSubscript,
    pluginSuperscript,
    pluginLayout(layoutConfig),
    pluginCell(layoutConfig),
    pluginQuickActions(
      (() => {
        const qa = editorProps?.toolbarSettings?.getToolbarSettings?.({})?.find(({ name }) => name === ToolbarType.QUICK_ACTIONS);
        if (!qa) {
          return {};
        }
        const { placeholder, ...rest } = qa;
        return placeholder !== void 0 ? { ...rest, customPlaceholder: placeholder } : rest;
      })()
    ),
    pluginSpotlight
  ].filter(isDefined);
};
const commonPluginConfig = {
  [INDENT_TYPE]: { isTextSelection, AllSelection }
};
export {
  commonPluginConfig,
  commonPlugins
};
//# sourceMappingURL=index.js.map
