import classnames from "classnames";
import React, { useContext } from "react";
import {
  RicosAlignmentContext,
  RicosNodeContextProvider,
  VisibleIndentationContext,
  VisibleIndentationContextProvider
} from "./../../../../../ricos-context/index.js";
import { TextStyle_TextAlignment } from "./../../../../../ricos-schema/legacy/wix/rich_content/v1/index.js";
import alignmentStyle from "../../../../statics/alignment-scss.js";
import styles from "./lists-scss.js";
const BulletedList = ({ node, nodeIndex, RicosNodesRenderer }) => {
  const { textAlignment } = useContext(RicosAlignmentContext);
  const { visibleIndentation } = useContext(VisibleIndentationContext);
  const currIndentation = visibleIndentation?.indentation || 0;
  const currOffset = node.bulletedListData?.offset || 0;
  const indentation = (visibleIndentation && visibleIndentation?.nodeId !== node.id ? 1 : 0) + currIndentation + currOffset;
  const bulletedListClassName = classnames(
    styles.bulletedlist,
    alignmentStyle[textAlignment || TextStyle_TextAlignment.AUTO]
  );
  return /* @__PURE__ */ React.createElement("ul", { className: bulletedListClassName }, /* @__PURE__ */ React.createElement(VisibleIndentationContextProvider, { visibleIndentation: { indentation, nodeId: node.id } }, /* @__PURE__ */ React.createElement(RicosNodeContextProvider, { parentNode: node, parentIndex: nodeIndex }, /* @__PURE__ */ React.createElement(RicosNodesRenderer, { nodes: node.nodes ?? [] }))));
};
const BulletedListRenderer = ({ node, ...props }) => {
  return /* @__PURE__ */ React.createElement(BulletedList, { key: node.id, node, ...props });
};
var bulleted_list_default = BulletedListRenderer;
export {
  bulleted_list_default as default
};
//# sourceMappingURL=bulleted-list.js.map
