<commit_before>package vdom;

#if !macro

import js.html.*;
import js.Browser;
import vdom.VNode.Children;
import vdom.Attr;

@:native('vdom_VDom')
extern class VDom {
  
  static function __init__():Void {
    vdom.macros.Loader.embedInline();
  }
  
  macro static public function hxx(e:haxe.macro.Expr):haxe.macro.Expr;
  
  static function patch(target:Element, patch:Patch):Element;
  static function create(node:VNode):Element;
  static function diff(old:VNode, nu:VNode):Patch;
  
  static inline function object(attr: {> Attr, type:String, data:String }, ?children:Children):VNode return h('object', attr, children);
    
  static inline function param(attr: {> Attr, name:String, value:String } ):VNode return h('param', attr);
    
  
  static function h(selector:String, attr:Dynamic, ?children:Children):VNode;
  
  static inline function div(attr:EditableAttr, ?children:Children):VNode return h('div', attr, children);
  static inline function aside(attr:EditableAttr, ?children:Children):VNode return h('aside', attr, children);
  static inline function section(attr:EditableAttr, ?children:Children):VNode return h('section', attr, children);
  
  static inline function header(attr:EditableAttr, ?children:Children):VNode return h('header', attr, children);
  static inline function footer(attr:EditableAttr, ?children:Children):VNode return h('footer', attr, children);
  static inline function main(attr:EditableAttr, ?children:Children):VNode return h('main', attr, children);
  
  static inline function h1(attr:EditableAttr, ?children:Children):VNode return h('h1', attr, children);
  static inline function h2(attr:EditableAttr, ?children:Children):VNode return h('h2', attr, children);
  static inline function h3(attr:EditableAttr, ?children:Children):VNode return h('h3', attr, children);
  static inline function h4(attr:EditableAttr, ?children:Children):VNode return h('h4', attr, children);
  static inline function h5(attr:EditableAttr, ?children:Children):VNode return h('h5', attr, children);
  
  static inline function strong(attr:EditableAttr, ?children:Children):VNode return h('strong', attr, children);
  static inline function em(attr:EditableAttr, ?children:Children):VNode return h('em', attr, children);
  static inline function span(attr:EditableAttr, ?children:Children):VNode return h('span', attr, children);
  static inline function a(attr:AnchorAttr, ?children:Children):VNode return h('a', attr, children);
  
  static inline function p(attr:EditableAttr, ?children:Children):VNode return h('p', attr, children);
  static inline function i(attr:EditableAttr, ?children:Children):VNode return h('i', attr, children);
  static inline function b(attr:EditableAttr, ?children:Children):VNode return h('b', attr, children);
  static inline function menu(attr:EditableAttr, ?children:Children):VNode return h('menu', attr, children);
  static inline function ul(attr:EditableAttr, ?children:Children):VNode return h('ul', attr, children);
  static inline function ol(attr:EditableAttr, ?children:Children):VNode return h('ol', attr, children);
  static inline function li(attr:EditableAttr, ?children:Children):VNode return h('li', attr, children);
  static inline function label(attr:LabelAttr, ?children:Children):VNode return h('label', attr, children);
  static inline function button(attr:InputAttr, ?children:Children):VNode return h('button', attr, children);
  static inline function textarea(attr:AttrOf<TextAreaElement>, ?children:Children):VNode return h('textarea', attr, children);
  
  static inline function img(attr: ImgAttr ):VNode return h('img', attr);
  static inline function input(attr: InputAttr ):VNode return h('input', attr);
  static inline function form(attr: FormAttr, ?children:Children):VNode return h('form', attr, children);
  
  static inline function splat(nodes:Array<VNode>):VNode return cast nodes;
  
  static inline function raw(attr: RawAttr):VNode {	  
	  var spanElement = Browser.document.createSpanElement();
	  spanElement.innerHTML = attr.content;
	  var widget:Widget = new Foreign(spanElement);
	  return widget;
  }
  
}


typedef RawAttr = {
	var content:String;
}

typedef EditableAttr = {>Attr,
  @:optional var contentEditable(default, null):Bool;
}

typedef FormAttr = {>AttrOf<FormElement>,
  @:optional var method(default, null):String;
  @:optional var action(default, null):String;
}

typedef AnchorAttr = {> AttrOf<AnchorElement>,
  @:optional var href(default, null):String; 
}


typedef InputAttr = {> AttrOf<InputElement>, 
  @:optional var checked(default, null):Bool;
  @:optional var disabled(default, null):Bool;
  @:optional var value(default, null):String; 
  @:optional var type(default, null):String; 
  @:optional var name(default, null):String;
  @:optional var orient(default, null):String;<commit_msg>Remove input.orient. Add input.placeholder.<commit_after>package vdom;

#if !macro

import js.html.*;
import js.Browser;
import vdom.VNode.Children;
import vdom.Attr;

@:native('vdom_VDom')
extern class VDom {
  
  static function __init__():Void {
    vdom.macros.Loader.embedInline();
  }
  
  macro static public function hxx(e:haxe.macro.Expr):haxe.macro.Expr;
  
  static function patch(target:Element, patch:Patch):Element;
  static function create(node:VNode):Element;
  static function diff(old:VNode, nu:VNode):Patch;
  
  static inline function object(attr: {> Attr, type:String, data:String }, ?children:Children):VNode return h('object', attr, children);
    
  static inline function param(attr: {> Attr, name:String, value:String } ):VNode return h('param', attr);
    
  
  static function h(selector:String, attr:Dynamic, ?children:Children):VNode;
  
  static inline function div(attr:EditableAttr, ?children:Children):VNode return h('div', attr, children);
  static inline function aside(attr:EditableAttr, ?children:Children):VNode return h('aside', attr, children);
  static inline function section(attr:EditableAttr, ?children:Children):VNode return h('section', attr, children);
  
  static inline function header(attr:EditableAttr, ?children:Children):VNode return h('header', attr, children);
  static inline function footer(attr:EditableAttr, ?children:Children):VNode return h('footer', attr, children);
  static inline function main(attr:EditableAttr, ?children:Children):VNode return h('main', attr, children);
  
  static inline function h1(attr:EditableAttr, ?children:Children):VNode return h('h1', attr, children);
  static inline function h2(attr:EditableAttr, ?children:Children):VNode return h('h2', attr, children);
  static inline function h3(attr:EditableAttr, ?children:Children):VNode return h('h3', attr, children);
  static inline function h4(attr:EditableAttr, ?children:Children):VNode return h('h4', attr, children);
  static inline function h5(attr:EditableAttr, ?children:Children):VNode return h('h5', attr, children);
  
  static inline function strong(attr:EditableAttr, ?children:Children):VNode return h('strong', attr, children);
  static inline function em(attr:EditableAttr, ?children:Children):VNode return h('em', attr, children);
  static inline function span(attr:EditableAttr, ?children:Children):VNode return h('span', attr, children);
  static inline function a(attr:AnchorAttr, ?children:Children):VNode return h('a', attr, children);
  
  static inline function p(attr:EditableAttr, ?children:Children):VNode return h('p', attr, children);
  static inline function i(attr:EditableAttr, ?children:Children):VNode return h('i', attr, children);
  static inline function b(attr:EditableAttr, ?children:Children):VNode return h('b', attr, children);
  static inline function menu(attr:EditableAttr, ?children:Children):VNode return h('menu', attr, children);
  static inline function ul(attr:EditableAttr, ?children:Children):VNode return h('ul', attr, children);
  static inline function ol(attr:EditableAttr, ?children:Children):VNode return h('ol', attr, children);
  static inline function li(attr:EditableAttr, ?children:Children):VNode return h('li', attr, children);
  static inline function label(attr:LabelAttr, ?children:Children):VNode return h('label', attr, children);
  static inline function button(attr:InputAttr, ?children:Children):VNode return h('button', attr, children);
  static inline function textarea(attr:AttrOf<TextAreaElement>, ?children:Children):VNode return h('textarea', attr, children);
  
  static inline function img(attr: ImgAttr ):VNode return h('img', attr);
  static inline function input(attr: InputAttr ):VNode return h('input', attr);
  static inline function form(attr: FormAttr, ?children:Children):VNode return h('form', attr, children);
  
  static inline function splat(nodes:Array<VNode>):VNode return cast nodes;
  
  static inline function raw(attr: RawAttr):VNode {	  
    var spanElement = Browser.document.createSpanElement();
    spanElement.innerHTML = attr.content;
    var widget:Widget = new Foreign(spanElement);
    return widget;
  }
  
}


typedef RawAttr = {
  var content:String;
}

typedef EditableAttr = {>Attr,
  @:optional var contentEditable(default, null):Bool;
}

typedef FormAttr = {>AttrOf<FormElement>,
  @:optional var method(default, null):String;
  @:optional var action(default, null):String;
}

typedef AnchorAttr = {> AttrOf<AnchorElement>,
  @:optional var href(default, null):String; 
}


typedef InputAttr = {> AttrOf<InputElement>, 
  @:optional var checked(default, null):Bool;
  @:optional var disabled(default, null):Bool;
  @:optional var value(default, null):String; 
  @:optional var type(default, null):String; 
  @:optional var name(default, null):String;
  @:optional var placeholder(default, null):String;
{'fraction_non_alphanumeric': 0.12998553420128126, 'fraction_numerical': 0.0020665426741062203, 'mean_word_length': 6.687847498014297, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1408139', 'n_tokens_mistral': 2869, 'n_tokens_neox': 2821, 'n_words': 794}