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 { CHECKBOX_LIST_STYLE_ATTRIBUTE_VALUE } from "./../../../../../_shared/list-checkbox/checkbox-list-style.js";
import alignmentStyle from "../../../../statics/alignment-scss.js";
import styles from "./lists-scss.js";
const CheckboxList = ({ node, nodeIndex, RicosNodesRenderer }) => {
  const checkboxListNode = node;
  const { textAlignment } = useContext(RicosAlignmentContext);
  const { visibleIndentation } = useContext(VisibleIndentationContext);
  const currIndentation = visibleIndentation?.indentation || 0;
  const currOffset = checkboxListNode.checkboxListData?.offset || 0;
  const indentation = (visibleIndentation && visibleIndentation?.nodeId !== node.id ? 1 : 0) + currIndentation + currOffset;
  const checkboxListClassName = classnames(
    styles.bulletedlist,
    styles.checkboxList,
    alignmentStyle[textAlignment || TextStyle_TextAlignment.AUTO]
  );
  return /* @__PURE__ */ React.createElement("ul", { className: checkboxListClassName, "data-list-style": CHECKBOX_LIST_STYLE_ATTRIBUTE_VALUE }, /* @__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 CheckboxListRenderer = ({ node, ...props }) => {
  return /* @__PURE__ */ React.createElement(CheckboxList, { key: node.id, node, ...props });
};
var checkbox_list_default = CheckboxListRenderer;
export {
  checkbox_list_default as default
};
//# sourceMappingURL=checkbox-list.js.map
