import { Decorations } from "../decorations/index.js";
import { RicosNodeStyle } from "../document-style/node-style.js";
import { RicosTextStyle } from "../document-style/text-style.js";
import { TextStyleTransformer } from "../text-style-transformer.js";
import { themeStrategy } from "../themeStrategy/theme-strategy.js";
class RicosTextualTheme {
  constructor(theme) {
    this.theme = theme;
    this.documentStyle = TextStyleTransformer.fromTheme(this.theme).toDocumentStyle();
  }
  /**
   * Extracts given decoration settings for specific node type from the current theme.
   */
  getDecoration(nodeType, decorationType) {
    const textNodeStyle = this.documentStyle[nodeType];
    return Decorations.of(textNodeStyle?.decorations || []).byType(decorationType);
  }
  getTextStyle(nodeType) {
    return RicosTextStyle.of({ lineHeight: this.documentStyle[nodeType]?.lineHeight });
  }
  getNodeStyle(nodeType) {
    return RicosNodeStyle.of(this.documentStyle[nodeType]?.nodeStyle);
  }
  /**
   * Translates RicosTheme to HTML style tag with CSS variable definitions
   */
  toStyleTag() {
    return themeStrategy({ ricosTheme: this.theme }).html;
  }
  /**
   * Returns palette colors for the current theme
   */
  getColors() {
    return themeStrategy({ ricosTheme: this.theme }).themeData.colors || {};
  }
}
export {
  RicosTextualTheme
};
//# sourceMappingURL=textual-theme.js.map
