@typesafe-html5/typescript 0.2.62 → 0.2.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-all.mjs +54 -0
- package/dist/block/article/article.js +465 -0
- package/dist/block/article/article.js.map +7 -0
- package/dist/block/aside/aside.js +476 -0
- package/dist/block/aside/aside.js.map +7 -0
- package/dist/block/audio/audio.js +454 -0
- package/dist/block/audio/audio.js.map +7 -0
- package/dist/block/blockquote/blockquote.js +476 -0
- package/dist/block/blockquote/blockquote.js.map +7 -0
- package/dist/block/body/body.js +378 -0
- package/dist/block/body/body.js.map +7 -0
- package/dist/block/canvas/canvas.js +487 -0
- package/dist/block/canvas/canvas.js.map +7 -0
- package/dist/block/caption/caption.js +465 -0
- package/dist/block/caption/caption.js.map +7 -0
- package/dist/block/colgroup/colgroup.js +190 -0
- package/dist/block/colgroup/colgroup.js.map +7 -0
- package/dist/block/datalist/datalist.js +465 -0
- package/dist/block/datalist/datalist.js.map +7 -0
- package/dist/block/dd/dd.js +422 -0
- package/dist/block/dd/dd.js.map +7 -0
- package/dist/block/del/del.js +487 -0
- package/dist/block/del/del.js.map +7 -0
- package/dist/block/details/details.js +520 -0
- package/dist/block/details/details.js.map +7 -0
- package/dist/block/dialog/dialog.js +520 -0
- package/dist/block/dialog/dialog.js.map +7 -0
- package/dist/block/div/div.js +520 -0
- package/dist/block/div/div.js.map +7 -0
- package/dist/block/dl/dl.js +465 -0
- package/dist/block/dl/dl.js.map +7 -0
- package/dist/block/dt/dt.js +422 -0
- package/dist/block/dt/dt.js.map +7 -0
- package/dist/block/embed/embed.js +333 -0
- package/dist/block/embed/embed.js.map +7 -0
- package/dist/block/fieldset/fieldset.js +509 -0
- package/dist/block/fieldset/fieldset.js.map +7 -0
- package/dist/block/figcaption/figcaption.js +465 -0
- package/dist/block/figcaption/figcaption.js.map +7 -0
- package/dist/block/figure/figure.js +465 -0
- package/dist/block/figure/figure.js.map +7 -0
- package/dist/block/footer/footer.js +476 -0
- package/dist/block/footer/footer.js.map +7 -0
- package/dist/block/form/form.js +443 -0
- package/dist/block/form/form.js.map +7 -0
- package/dist/block/h1/h1.js +454 -0
- package/dist/block/h1/h1.js.map +7 -0
- package/dist/block/h2/h2.js +454 -0
- package/dist/block/h2/h2.js.map +7 -0
- package/dist/block/h3/h3.js +454 -0
- package/dist/block/h3/h3.js.map +7 -0
- package/dist/block/h4/h4.js +454 -0
- package/dist/block/h4/h4.js.map +7 -0
- package/dist/block/h5/h5.js +454 -0
- package/dist/block/h5/h5.js.map +7 -0
- package/dist/block/h6/h6.js +454 -0
- package/dist/block/h6/h6.js.map +7 -0
- package/dist/block/header/header.js +322 -0
- package/dist/block/header/header.js.map +7 -0
- package/dist/block/hgroup/hgroup.js +465 -0
- package/dist/block/hgroup/hgroup.js.map +7 -0
- package/dist/block/hr/hr.js +169 -0
- package/dist/block/hr/hr.js.map +7 -0
- package/dist/block/html/html.js +92 -0
- package/dist/block/html/html.js.map +7 -0
- package/dist/block/iframe/iframe.js +465 -0
- package/dist/block/iframe/iframe.js.map +7 -0
- package/dist/block/ins/ins.js +487 -0
- package/dist/block/ins/ins.js.map +7 -0
- package/dist/block/legend/legend.js +465 -0
- package/dist/block/legend/legend.js.map +7 -0
- package/dist/block/li/li.js +488 -0
- package/dist/block/li/li.js.map +7 -0
- package/dist/block/main/main.js +444 -0
- package/dist/block/main/main.js.map +7 -0
- package/dist/block/map/map.js +476 -0
- package/dist/block/map/map.js.map +7 -0
- package/dist/block/menu/menu.js +498 -0
- package/dist/block/menu/menu.js.map +7 -0
- package/dist/block/nav/nav.js +455 -0
- package/dist/block/nav/nav.js.map +7 -0
- package/dist/block/noscript/noscript.js +311 -0
- package/dist/block/noscript/noscript.js.map +7 -0
- package/dist/block/object/object.js +542 -0
- package/dist/block/object/object.js.map +7 -0
- package/dist/block/ol/ol.js +542 -0
- package/dist/block/ol/ol.js.map +7 -0
- package/dist/block/optgroup/optgroup.js +476 -0
- package/dist/block/optgroup/optgroup.js.map +7 -0
- package/dist/block/option/option.js +542 -0
- package/dist/block/option/option.js.map +7 -0
- package/dist/block/p/p.js +465 -0
- package/dist/block/p/p.js.map +7 -0
- package/dist/block/picture/picture.js +465 -0
- package/dist/block/picture/picture.js.map +7 -0
- package/dist/block/pre/pre.js +465 -0
- package/dist/block/pre/pre.js.map +7 -0
- package/dist/block/section/section.js +487 -0
- package/dist/block/section/section.js.map +7 -0
- package/dist/block/summary/summary.js +466 -0
- package/dist/block/summary/summary.js.map +7 -0
- package/dist/block/table/table.js +509 -0
- package/dist/block/table/table.js.map +7 -0
- package/dist/block/tbody/tbody.js +465 -0
- package/dist/block/tbody/tbody.js.map +7 -0
- package/dist/block/td/td.js +575 -0
- package/dist/block/td/td.js.map +7 -0
- package/dist/block/template/template.js +465 -0
- package/dist/block/template/template.js.map +7 -0
- package/dist/block/tfoot/tfoot.js +465 -0
- package/dist/block/tfoot/tfoot.js.map +7 -0
- package/dist/block/th/th.js +586 -0
- package/dist/block/th/th.js.map +7 -0
- package/dist/block/thead/thead.js +465 -0
- package/dist/block/thead/thead.js.map +7 -0
- package/dist/block/tr/tr.js +586 -0
- package/dist/block/tr/tr.js.map +7 -0
- package/dist/block/ul/ul.js +509 -0
- package/dist/block/ul/ul.js.map +7 -0
- package/dist/block/video/video.js +575 -0
- package/dist/block/video/video.js.map +7 -0
- package/dist/index.js +48830 -0
- package/dist/index.js.map +7 -0
- package/dist/inline/a/a.js +586 -0
- package/dist/inline/a/a.js.map +7 -0
- package/dist/inline/abbr/abbr.js +454 -0
- package/dist/inline/abbr/abbr.js.map +7 -0
- package/dist/inline/address/address.js +443 -0
- package/dist/inline/address/address.js.map +7 -0
- package/dist/inline/b/b.js +465 -0
- package/dist/inline/b/b.js.map +7 -0
- package/dist/inline/bdi/bdi.js +454 -0
- package/dist/inline/bdi/bdi.js.map +7 -0
- package/dist/inline/bdo/bdo.js +465 -0
- package/dist/inline/bdo/bdo.js.map +7 -0
- package/dist/inline/button/button.js +685 -0
- package/dist/inline/button/button.js.map +7 -0
- package/dist/inline/cite/cite.js +465 -0
- package/dist/inline/cite/cite.js.map +7 -0
- package/dist/inline/code/code.js +465 -0
- package/dist/inline/code/code.js.map +7 -0
- package/dist/inline/data/data.js +476 -0
- package/dist/inline/data/data.js.map +7 -0
- package/dist/inline/dfn/dfn.js +465 -0
- package/dist/inline/dfn/dfn.js.map +7 -0
- package/dist/inline/em/em.js +465 -0
- package/dist/inline/em/em.js.map +7 -0
- package/dist/inline/i/i.js +465 -0
- package/dist/inline/i/i.js.map +7 -0
- package/dist/inline/img/img.js +399 -0
- package/dist/inline/img/img.js.map +7 -0
- package/dist/inline/input/input.js +938 -0
- package/dist/inline/input/input.js.map +7 -0
- package/dist/inline/kbd/kbd.js +465 -0
- package/dist/inline/kbd/kbd.js.map +7 -0
- package/dist/inline/label/label.js +487 -0
- package/dist/inline/label/label.js.map +7 -0
- package/dist/inline/mark/mark.js +465 -0
- package/dist/inline/mark/mark.js.map +7 -0
- package/dist/inline/meter/meter.js +498 -0
- package/dist/inline/meter/meter.js.map +7 -0
- package/dist/inline/output/output.js +410 -0
- package/dist/inline/output/output.js.map +7 -0
- package/dist/inline/progress/progress.js +454 -0
- package/dist/inline/progress/progress.js.map +7 -0
- package/dist/inline/q/q.js +476 -0
- package/dist/inline/q/q.js.map +7 -0
- package/dist/inline/rp/rp.js +465 -0
- package/dist/inline/rp/rp.js.map +7 -0
- package/dist/inline/rt/rt.js +465 -0
- package/dist/inline/rt/rt.js.map +7 -0
- package/dist/inline/ruby/ruby.js +465 -0
- package/dist/inline/ruby/ruby.js.map +7 -0
- package/dist/inline/s/s.js +465 -0
- package/dist/inline/s/s.js.map +7 -0
- package/dist/inline/samp/samp.js +465 -0
- package/dist/inline/samp/samp.js.map +7 -0
- package/dist/inline/select/select.js +674 -0
- package/dist/inline/select/select.js.map +7 -0
- package/dist/inline/slot/slot.js +476 -0
- package/dist/inline/slot/slot.js.map +7 -0
- package/dist/inline/small/small.js +465 -0
- package/dist/inline/small/small.js.map +7 -0
- package/dist/inline/span/span.js +465 -0
- package/dist/inline/span/span.js.map +7 -0
- package/dist/inline/strong/strong.js +465 -0
- package/dist/inline/strong/strong.js.map +7 -0
- package/dist/inline/sub/sub.js +465 -0
- package/dist/inline/sub/sub.js.map +7 -0
- package/dist/inline/sup/sup.js +465 -0
- package/dist/inline/sup/sup.js.map +7 -0
- package/dist/inline/svg/svg.js +542 -0
- package/dist/inline/svg/svg.js.map +7 -0
- package/dist/inline/textarea/textarea.js +718 -0
- package/dist/inline/textarea/textarea.js.map +7 -0
- package/dist/inline/time/time.js +476 -0
- package/dist/inline/time/time.js.map +7 -0
- package/dist/inline/u/u.js +465 -0
- package/dist/inline/u/u.js.map +7 -0
- package/dist/inline/var/var.js +465 -0
- package/dist/inline/var/var.js.map +7 -0
- package/dist/void/area/area.js +388 -0
- package/dist/void/area/area.js.map +7 -0
- package/dist/void/base/base.js +37 -0
- package/dist/void/base/base.js.map +7 -0
- package/dist/void/br/br.js +135 -0
- package/dist/void/br/br.js.map +7 -0
- package/dist/void/col/col.js +135 -0
- package/dist/void/col/col.js.map +7 -0
- package/dist/void/head/head.js +37 -0
- package/dist/void/head/head.js.map +7 -0
- package/dist/void/link/link.js +213 -0
- package/dist/void/link/link.js.map +7 -0
- package/dist/void/meta/meta.js +147 -0
- package/dist/void/meta/meta.js.map +7 -0
- package/dist/void/param/param.js +146 -0
- package/dist/void/param/param.js.map +7 -0
- package/dist/void/script/script.js +213 -0
- package/dist/void/script/script.js.map +7 -0
- package/dist/void/source/source.js +168 -0
- package/dist/void/source/source.js.map +7 -0
- package/dist/void/style/style.js +147 -0
- package/dist/void/style/style.js.map +7 -0
- package/dist/void/title/title.js +37 -0
- package/dist/void/title/title.js.map +7 -0
- package/dist/void/track/track.js +190 -0
- package/dist/void/track/track.js.map +7 -0
- package/dist/void/wbr/wbr.js +124 -0
- package/dist/void/wbr/wbr.js.map +7 -0
- package/package.json +4 -4
- package/src/block/article/article.ts +649 -0
- package/{block → src/block}/aside/aside.ts +144 -1
- package/{block → src/block}/audio/audio.ts +128 -1
- package/src/block/blockquote/blockquote.ts +665 -0
- package/{block → src/block}/body/body.ts +91 -1
- package/{block → src/block}/canvas/canvas.ts +144 -1
- package/src/block/caption/caption.ts +649 -0
- package/{block → src/block}/colgroup/colgroup.ts +96 -1
- package/src/block/datalist/datalist.ts +649 -0
- package/{block/dialog/dialog.ts → src/block/dd/dd.ts} +114 -88
- package/{block → src/block}/del/del.ts +144 -1
- package/src/block/details/details.ts +729 -0
- package/src/block/dialog/dialog.ts +729 -0
- package/src/block/div/div.ts +729 -0
- package/src/block/dl/dl.ts +649 -0
- package/{block/details/details.ts → src/block/dt/dt.ts} +114 -88
- package/{block → src/block}/embed/embed.ts +144 -1
- package/{block → src/block}/fieldset/fieldset.ts +144 -1
- package/src/block/figcaption/figcaption.ts +649 -0
- package/src/block/figure/figure.ts +649 -0
- package/src/block/footer/footer.ts +665 -0
- package/{block → src/block}/form/form.ts +132 -5
- package/src/block/h1/h1.ts +633 -0
- package/src/block/h2/h2.ts +633 -0
- package/src/block/h3/h3.ts +633 -0
- package/src/block/h4/h4.ts +633 -0
- package/src/block/h5/h5.ts +633 -0
- package/src/block/h6/h6.ts +633 -0
- package/{block → src/block}/header/header.ts +144 -1
- package/src/block/hgroup/hgroup.ts +649 -0
- package/{block → src/block}/hr/hr.ts +59 -1
- package/{block → src/block}/html/html.ts +27 -1
- package/{block → src/block}/iframe/iframe.ts +112 -1
- package/{block → src/block}/ins/ins.ts +144 -1
- package/src/block/legend/legend.ts +649 -0
- package/{block → src/block}/li/li.ts +107 -1
- package/{block/div/div.ts → src/block/main/main.ts} +112 -54
- package/src/block/map/map.ts +665 -0
- package/{block → src/block}/menu/menu.ts +144 -1
- package/{block → src/block}/nav/nav.ts +107 -1
- package/{block → src/block}/noscript/noscript.ts +144 -1
- package/{block → src/block}/object/object.ts +144 -1
- package/{block → src/block}/ol/ol.ts +144 -1
- package/{block → src/block}/optgroup/optgroup.ts +144 -1
- package/{block → src/block}/option/option.ts +144 -1
- package/src/block/p/p.ts +649 -0
- package/src/block/picture/picture.ts +649 -0
- package/src/block/pre/pre.ts +649 -0
- package/{block → src/block}/section/section.ts +144 -1
- package/{block → src/block}/summary/summary.ts +107 -1
- package/{block → src/block}/table/table.ts +144 -1
- package/src/block/tbody/tbody.ts +649 -0
- package/{block → src/block}/td/td.ts +144 -1
- package/src/block/template/template.ts +649 -0
- package/src/block/tfoot/tfoot.ts +649 -0
- package/{block → src/block}/th/th.ts +144 -1
- package/src/block/thead/thead.ts +649 -0
- package/{block → src/block}/tr/tr.ts +144 -1
- package/{block → src/block}/ul/ul.ts +144 -1
- package/{block → src/block}/video/video.ts +144 -1
- package/{inline → src/inline}/a/a.ts +144 -1
- package/src/inline/abbr/abbr.ts +633 -0
- package/src/inline/address/address.ts +617 -0
- package/src/inline/b/b.ts +649 -0
- package/src/inline/bdi/bdi.ts +633 -0
- package/src/inline/bdo/bdo.ts +649 -0
- package/{inline → src/inline}/button/button.ts +145 -2
- package/src/inline/cite/cite.ts +649 -0
- package/src/inline/code/code.ts +649 -0
- package/src/inline/data/data.ts +665 -0
- package/src/inline/dfn/dfn.ts +649 -0
- package/src/inline/em/em.ts +649 -0
- package/src/inline/i/i.ts +649 -0
- package/{inline → src/inline}/img/img.ts +112 -1
- package/{inline → src/inline}/input/input.ts +145 -2
- package/src/inline/kbd/kbd.ts +649 -0
- package/{inline → src/inline}/label/label.ts +144 -1
- package/src/inline/mark/mark.ts +649 -0
- package/{inline → src/inline}/meter/meter.ts +144 -1
- package/{inline → src/inline}/output/output.ts +144 -1
- package/{inline → src/inline}/progress/progress.ts +144 -1
- package/src/inline/q/q.ts +665 -0
- package/src/inline/rp/rp.ts +649 -0
- package/src/inline/rt/rt.ts +649 -0
- package/src/inline/ruby/ruby.ts +649 -0
- package/src/inline/s/s.ts +649 -0
- package/src/inline/samp/samp.ts +649 -0
- package/{inline → src/inline}/select/select.ts +144 -1
- package/src/inline/slot/slot.ts +665 -0
- package/src/inline/small/small.ts +649 -0
- package/src/inline/span/span.ts +649 -0
- package/src/inline/strong/strong.ts +649 -0
- package/src/inline/sub/sub.ts +649 -0
- package/src/inline/sup/sup.ts +649 -0
- package/{inline → src/inline}/svg/svg.ts +144 -1
- package/{inline → src/inline}/textarea/textarea.ts +144 -1
- package/src/inline/time/time.ts +665 -0
- package/src/inline/u/u.ts +649 -0
- package/src/inline/var/var.ts +649 -0
- package/{void → src/void}/area/area.ts +144 -1
- package/{void → src/void}/base/base.ts +1 -1
- package/src/void/br/br.ts +172 -0
- package/src/void/col/col.ts +172 -0
- package/{void → src/void}/head/head.ts +1 -1
- package/{void → src/void}/link/link.ts +59 -1
- package/{void → src/void}/meta/meta.ts +59 -1
- package/src/void/param/param.ts +188 -0
- package/{void → src/void}/script/script.ts +59 -1
- package/src/void/source/source.ts +220 -0
- package/{void → src/void}/style/style.ts +59 -1
- package/{void → src/void}/title/title.ts +1 -1
- package/{void → src/void}/track/track.ts +96 -1
- package/src/void/wbr/wbr.ts +156 -0
- package/block/article/article.ts +0 -506
- package/block/blockquote/blockquote.ts +0 -522
- package/block/caption/caption.ts +0 -506
- package/block/datalist/datalist.ts +0 -506
- package/block/dd/dd.ts +0 -506
- package/block/dl/dl.ts +0 -506
- package/block/dt/dt.ts +0 -506
- package/block/figcaption/figcaption.ts +0 -506
- package/block/figure/figure.ts +0 -506
- package/block/footer/footer.ts +0 -522
- package/block/h1/h1.ts +0 -490
- package/block/h2/h2.ts +0 -490
- package/block/h3/h3.ts +0 -490
- package/block/h4/h4.ts +0 -490
- package/block/h5/h5.ts +0 -490
- package/block/h6/h6.ts +0 -490
- package/block/hgroup/hgroup.ts +0 -506
- package/block/legend/legend.ts +0 -506
- package/block/main/main.ts +0 -538
- package/block/map/map.ts +0 -522
- package/block/p/p.ts +0 -506
- package/block/picture/picture.ts +0 -506
- package/block/pre/pre.ts +0 -506
- package/block/tbody/tbody.ts +0 -506
- package/block/template/template.ts +0 -506
- package/block/tfoot/tfoot.ts +0 -506
- package/block/thead/thead.ts +0 -506
- package/inline/abbr/abbr.ts +0 -490
- package/inline/address/address.ts +0 -474
- package/inline/b/b.ts +0 -506
- package/inline/bdi/bdi.ts +0 -490
- package/inline/bdo/bdo.ts +0 -506
- package/inline/cite/cite.ts +0 -506
- package/inline/code/code.ts +0 -506
- package/inline/data/data.ts +0 -522
- package/inline/dfn/dfn.ts +0 -506
- package/inline/em/em.ts +0 -506
- package/inline/i/i.ts +0 -506
- package/inline/kbd/kbd.ts +0 -506
- package/inline/mark/mark.ts +0 -506
- package/inline/q/q.ts +0 -522
- package/inline/rp/rp.ts +0 -506
- package/inline/rt/rt.ts +0 -506
- package/inline/ruby/ruby.ts +0 -506
- package/inline/s/s.ts +0 -506
- package/inline/samp/samp.ts +0 -506
- package/inline/slot/slot.ts +0 -522
- package/inline/small/small.ts +0 -506
- package/inline/span/span.ts +0 -506
- package/inline/strong/strong.ts +0 -506
- package/inline/sub/sub.ts +0 -506
- package/inline/sup/sup.ts +0 -506
- package/inline/time/time.ts +0 -522
- package/inline/u/u.ts +0 -506
- package/inline/var/var.ts +0 -506
- package/void/br/br.ts +0 -77
- package/void/col/col.ts +0 -77
- package/void/param/param.ts +0 -93
- package/void/source/source.ts +0 -125
- package/void/wbr/wbr.ts +0 -61
- /package/{index.ts → src/index.ts} +0 -0
- /package/{tsconfig.json → src/tsconfig.json} +0 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// src/block/hr/hr.ts
|
|
2
|
+
var Hr = class {
|
|
3
|
+
constructor(props = {}) {
|
|
4
|
+
this.element = document.createElement("hr");
|
|
5
|
+
this.applyProps(props);
|
|
6
|
+
}
|
|
7
|
+
applyProps(props) {
|
|
8
|
+
if (props.align !== void 0) {
|
|
9
|
+
this.setAlign(props.align);
|
|
10
|
+
}
|
|
11
|
+
if (props.className !== void 0) {
|
|
12
|
+
this.element.setAttribute("className", String(props.className));
|
|
13
|
+
}
|
|
14
|
+
if (props.color !== void 0) {
|
|
15
|
+
this.element.setAttribute("color", String(props.color));
|
|
16
|
+
}
|
|
17
|
+
if (props["data-attributes"] !== void 0) {
|
|
18
|
+
const __map = props["data-attributes"];
|
|
19
|
+
if (__map !== null && __map !== void 0) {
|
|
20
|
+
for (const __k in __map) {
|
|
21
|
+
this.element.setAttribute(`data-${__k}`, String(__map[__k]));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (props.dir !== void 0) {
|
|
26
|
+
this.setDir(props.dir);
|
|
27
|
+
}
|
|
28
|
+
if (props.hidden !== void 0) {
|
|
29
|
+
this.element.setAttribute("hidden", String(props.hidden));
|
|
30
|
+
}
|
|
31
|
+
if (props.id !== void 0) {
|
|
32
|
+
this.element.setAttribute("id", String(props.id));
|
|
33
|
+
}
|
|
34
|
+
if (props.lang !== void 0) {
|
|
35
|
+
this.element.setAttribute("lang", String(props.lang));
|
|
36
|
+
}
|
|
37
|
+
if (props.noshade !== void 0) {
|
|
38
|
+
this.element.setAttribute("noshade", String(props.noshade));
|
|
39
|
+
}
|
|
40
|
+
if (props.size !== void 0) {
|
|
41
|
+
this.element.setAttribute("size", String(props.size));
|
|
42
|
+
}
|
|
43
|
+
if (props.style !== void 0) {
|
|
44
|
+
this.element.setAttribute("style", String(props.style));
|
|
45
|
+
}
|
|
46
|
+
if (props.title !== void 0) {
|
|
47
|
+
this.element.setAttribute("title", String(props.title));
|
|
48
|
+
}
|
|
49
|
+
if (props.width !== void 0) {
|
|
50
|
+
this.element.setAttribute("width", String(props.width));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
setAlign(value) {
|
|
54
|
+
if (value === null || value === void 0) {
|
|
55
|
+
this.element.removeAttribute("align");
|
|
56
|
+
} else {
|
|
57
|
+
this.element.setAttribute("align", String(value));
|
|
58
|
+
}
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
setClassName(value) {
|
|
62
|
+
if (value === null || value === void 0) {
|
|
63
|
+
this.element.removeAttribute("className");
|
|
64
|
+
} else {
|
|
65
|
+
this.element.setAttribute("className", String(value));
|
|
66
|
+
}
|
|
67
|
+
return this;
|
|
68
|
+
}
|
|
69
|
+
setColor(value) {
|
|
70
|
+
if (value === null || value === void 0) {
|
|
71
|
+
this.element.removeAttribute("color");
|
|
72
|
+
} else {
|
|
73
|
+
this.element.setAttribute("color", String(value));
|
|
74
|
+
}
|
|
75
|
+
return this;
|
|
76
|
+
}
|
|
77
|
+
setDataAttributes(value) {
|
|
78
|
+
if (value === null || value === void 0) {
|
|
79
|
+
for (const __a of Array.from(this.element.attributes)) {
|
|
80
|
+
if (__a.name.startsWith("data-")) {
|
|
81
|
+
this.element.removeAttribute(__a.name);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
} else {
|
|
85
|
+
for (const __k in value) {
|
|
86
|
+
this.element.setAttribute(`data-${__k}`, String(value[__k]));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return this;
|
|
90
|
+
}
|
|
91
|
+
setDir(value) {
|
|
92
|
+
if (value === null || value === void 0) {
|
|
93
|
+
this.element.removeAttribute("dir");
|
|
94
|
+
} else {
|
|
95
|
+
this.element.setAttribute("dir", String(value));
|
|
96
|
+
}
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
setHidden(value) {
|
|
100
|
+
if (value === true) {
|
|
101
|
+
this.element.setAttribute("hidden", "");
|
|
102
|
+
} else {
|
|
103
|
+
this.element.removeAttribute("hidden");
|
|
104
|
+
}
|
|
105
|
+
return this;
|
|
106
|
+
}
|
|
107
|
+
setId(value) {
|
|
108
|
+
if (value === null || value === void 0) {
|
|
109
|
+
this.element.removeAttribute("id");
|
|
110
|
+
} else {
|
|
111
|
+
this.element.setAttribute("id", String(value));
|
|
112
|
+
}
|
|
113
|
+
return this;
|
|
114
|
+
}
|
|
115
|
+
setLang(value) {
|
|
116
|
+
if (value === null || value === void 0) {
|
|
117
|
+
this.element.removeAttribute("lang");
|
|
118
|
+
} else {
|
|
119
|
+
this.element.setAttribute("lang", String(value));
|
|
120
|
+
}
|
|
121
|
+
return this;
|
|
122
|
+
}
|
|
123
|
+
setNoshade(value) {
|
|
124
|
+
if (value === true) {
|
|
125
|
+
this.element.setAttribute("noshade", "");
|
|
126
|
+
} else {
|
|
127
|
+
this.element.removeAttribute("noshade");
|
|
128
|
+
}
|
|
129
|
+
return this;
|
|
130
|
+
}
|
|
131
|
+
setSize(value) {
|
|
132
|
+
if (value === null || value === void 0) {
|
|
133
|
+
this.element.removeAttribute("size");
|
|
134
|
+
} else {
|
|
135
|
+
this.element.setAttribute("size", String(value));
|
|
136
|
+
}
|
|
137
|
+
return this;
|
|
138
|
+
}
|
|
139
|
+
setStyle(value) {
|
|
140
|
+
if (value === null || value === void 0) {
|
|
141
|
+
this.element.removeAttribute("style");
|
|
142
|
+
} else {
|
|
143
|
+
this.element.setAttribute("style", String(value));
|
|
144
|
+
}
|
|
145
|
+
return this;
|
|
146
|
+
}
|
|
147
|
+
setTitle(value) {
|
|
148
|
+
if (value === null || value === void 0) {
|
|
149
|
+
this.element.removeAttribute("title");
|
|
150
|
+
} else {
|
|
151
|
+
this.element.setAttribute("title", String(value));
|
|
152
|
+
}
|
|
153
|
+
return this;
|
|
154
|
+
}
|
|
155
|
+
setWidth(value) {
|
|
156
|
+
if (value === null || value === void 0) {
|
|
157
|
+
this.element.removeAttribute("width");
|
|
158
|
+
} else {
|
|
159
|
+
this.element.setAttribute("width", String(value));
|
|
160
|
+
}
|
|
161
|
+
return this;
|
|
162
|
+
}
|
|
163
|
+
getElement() {
|
|
164
|
+
return this.element;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
export {
|
|
168
|
+
Hr
|
|
169
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/block/hr/hr.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * THIS FILE IS AUTOGENERATED. DO NOT EDIT IT.\n *\n * @generated January 2, 2026 15:45:45\n * @component Hr\n * @description \n */\n\nexport interface HrProps {\n /**\n * Specifies the horizontal alignment of the element.\n */\n align?: 'center' | 'justify' | 'left' | 'right' | null | undefined;\n /**\n * CSS class names\n */\n className?: string;\n /**\n * \n */\n color?: string | null | undefined;\n /**\n * Mapping of data-* attributes to their values (e.g., {\"test\":\"value\"} -> data-test=\"value\")\n */\n 'data-attributes'?: Record<string, string> | null | undefined;\n /**\n * Represents the text direction of the element\n */\n dir?: 'ltr' | 'rtl' | 'auto' | null | undefined;\n /**\n * Indicates whether the element is hidden\n */\n hidden?: boolean | null | undefined;\n /**\n * Unique identifier\n */\n id?: string;\n /**\n * Specifies the primary language for the element's content\n */\n lang?: string | null | undefined;\n /**\n * \n */\n noshade?: boolean | null | undefined;\n /**\n * Specifies the height of a hr element in pixels.\n */\n size?: number | null | undefined;\n /**\n * Represents the CSS inline style of the element\n */\n style?: string | null | undefined;\n /**\n * Represents a title or tooltip for the element\n */\n title?: string | null | undefined;\n /**\n * Specifies the width of the element. The meaning may vary depending on the element type. Accepts integers, pixels (px), and percentages (%).\n */\n width?: string | null | undefined;\n}\n\n/**\n * Hr - \n */\nexport class Hr {\n private element: HTMLElement;\n\n constructor(props: HrProps = {}) {\n this.element = document.createElement('hr');\n this.applyProps(props);\n }\n\n private applyProps(props: HrProps): void {\n if (props.align !== undefined) {\n this.setAlign(props.align);\n }\n if (props.className !== undefined) {\n this.element.setAttribute('className', String(props.className));\n }\n if (props.color !== undefined) {\n this.element.setAttribute('color', String(props.color));\n }\n if (props['data-attributes'] !== undefined) {\n const __map = props['data-attributes'];\n if (__map !== null && __map !== undefined) {\n for (const __k in __map) {\n this.element.setAttribute(`data-${__k}`, String((__map as any)[__k]));\n }\n }\n }\n if (props.dir !== undefined) {\n this.setDir(props.dir);\n }\n if (props.hidden !== undefined) {\n this.element.setAttribute('hidden', String(props.hidden));\n }\n if (props.id !== undefined) {\n this.element.setAttribute('id', String(props.id));\n }\n if (props.lang !== undefined) {\n this.element.setAttribute('lang', String(props.lang));\n }\n if (props.noshade !== undefined) {\n this.element.setAttribute('noshade', String(props.noshade));\n }\n if (props.size !== undefined) {\n this.element.setAttribute('size', String(props.size));\n }\n if (props.style !== undefined) {\n this.element.setAttribute('style', String(props.style));\n }\n if (props.title !== undefined) {\n this.element.setAttribute('title', String(props.title));\n }\n if (props.width !== undefined) {\n this.element.setAttribute('width', String(props.width));\n }\n }\n\n setAlign(value: 'center' | 'justify' | 'left' | 'right' | null | undefined): this {\n if (value === null || value === undefined) {\n this.element.removeAttribute('align');\n } else {\n this.element.setAttribute('align', String(value));\n }\n return this;\n }\n\n setClassName(value: string): this {\n if (value === null || value === undefined) {\n this.element.removeAttribute('className');\n } else {\n this.element.setAttribute('className', String(value));\n }\n return this;\n }\n\n setColor(value: string | null | undefined): this {\n if (value === null || value === undefined) {\n this.element.removeAttribute('color');\n } else {\n this.element.setAttribute('color', String(value));\n }\n return this;\n }\n\n setDataAttributes(value: Record<string, string>): this {\n if (value === null || value === undefined) {\n // Remove all data-* attributes (best-effort)\n for (const __a of Array.from(this.element.attributes)) {\n if ((__a as Attr).name.startsWith('data-')) { (this.element as HTMLElement).removeAttribute((__a as Attr).name); }\n }\n } else {\n for (const __k in value as Record<string, string>) {\n this.element.setAttribute(`data-${__k}`, String((value as any)[__k]));\n }\n }\n return this;\n }\n\n setDir(value: 'ltr' | 'rtl' | 'auto' | null | undefined): this {\n if (value === null || value === undefined) {\n this.element.removeAttribute('dir');\n } else {\n this.element.setAttribute('dir', String(value));\n }\n return this;\n }\n\n setHidden(value: boolean | null | undefined): this {\n if (value === true) {\n this.element.setAttribute('hidden', '');\n } else {\n this.element.removeAttribute('hidden');\n }\n return this;\n }\n\n setId(value: string): this {\n if (value === null || value === undefined) {\n this.element.removeAttribute('id');\n } else {\n this.element.setAttribute('id', String(value));\n }\n return this;\n }\n\n setLang(value: string | null | undefined): this {\n if (value === null || value === undefined) {\n this.element.removeAttribute('lang');\n } else {\n this.element.setAttribute('lang', String(value));\n }\n return this;\n }\n\n setNoshade(value: boolean | null | undefined): this {\n if (value === true) {\n this.element.setAttribute('noshade', '');\n } else {\n this.element.removeAttribute('noshade');\n }\n return this;\n }\n\n setSize(value: number | null | undefined): this {\n if (value === null || value === undefined) {\n this.element.removeAttribute('size');\n } else {\n this.element.setAttribute('size', String(value));\n }\n return this;\n }\n\n setStyle(value: string | null | undefined): this {\n if (value === null || value === undefined) {\n this.element.removeAttribute('style');\n } else {\n this.element.setAttribute('style', String(value));\n }\n return this;\n }\n\n setTitle(value: string | null | undefined): this {\n if (value === null || value === undefined) {\n this.element.removeAttribute('title');\n } else {\n this.element.setAttribute('title', String(value));\n }\n return this;\n }\n\n setWidth(value: string | null | undefined): this {\n if (value === null || value === undefined) {\n this.element.removeAttribute('width');\n } else {\n this.element.setAttribute('width', String(value));\n }\n return this;\n }\n\n getElement(): HTMLElement {\n return this.element;\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAkEO,IAAM,KAAN,MAAS;AAAA,EAGd,YAAY,QAAiB,CAAC,GAAG;AAC/B,SAAK,UAAU,SAAS,cAAc,IAAI;AAC1C,SAAK,WAAW,KAAK;AAAA,EACvB;AAAA,EAEQ,WAAW,OAAsB;AACvC,QAAI,MAAM,UAAU,QAAW;AAC7B,WAAK,SAAS,MAAM,KAAK;AAAA,IAC3B;AACA,QAAI,MAAM,cAAc,QAAW;AACjC,WAAK,QAAQ,aAAa,aAAa,OAAO,MAAM,SAAS,CAAC;AAAA,IAChE;AACA,QAAI,MAAM,UAAU,QAAW;AAC7B,WAAK,QAAQ,aAAa,SAAS,OAAO,MAAM,KAAK,CAAC;AAAA,IACxD;AACA,QAAI,MAAM,iBAAiB,MAAM,QAAW;AAC1C,YAAM,QAAQ,MAAM,iBAAiB;AACrC,UAAI,UAAU,QAAQ,UAAU,QAAW;AACzC,mBAAW,OAAO,OAAO;AACvB,eAAK,QAAQ,aAAa,QAAQ,GAAG,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AA,EACd;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// src/block/html/html.ts
|
|
2
|
+
var Html = class {
|
|
3
|
+
constructor(props = {}) {
|
|
4
|
+
this.element = document.createElement("html");
|
|
5
|
+
this.applyProps(props);
|
|
6
|
+
}
|
|
7
|
+
applyProps(props) {
|
|
8
|
+
if (props.children !== void 0) {
|
|
9
|
+
this.setChildren(props.children);
|
|
10
|
+
}
|
|
11
|
+
if (props["data-attributes"] !== void 0) {
|
|
12
|
+
const __map = props["data-attributes"];
|
|
13
|
+
if (__map !== null && __map !== void 0) {
|
|
14
|
+
for (const __k in __map) {
|
|
15
|
+
this.element.setAttribute(`data-${__k}`, String(__map[__k]));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
if (props.dir !== void 0) {
|
|
20
|
+
this.setDir(props.dir);
|
|
21
|
+
}
|
|
22
|
+
if (props.lang !== void 0) {
|
|
23
|
+
this.element.setAttribute("lang", String(props.lang));
|
|
24
|
+
}
|
|
25
|
+
if (props.manifest !== void 0) {
|
|
26
|
+
this.element.setAttribute("manifest", String(props.manifest));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
setDataAttributes(value) {
|
|
30
|
+
if (value === null || value === void 0) {
|
|
31
|
+
for (const __a of Array.from(this.element.attributes)) {
|
|
32
|
+
if (__a.name.startsWith("data-")) {
|
|
33
|
+
this.element.removeAttribute(__a.name);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
for (const __k in value) {
|
|
38
|
+
this.element.setAttribute(`data-${__k}`, String(value[__k]));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
setDir(value) {
|
|
44
|
+
if (value === null || value === void 0) {
|
|
45
|
+
this.element.removeAttribute("dir");
|
|
46
|
+
} else {
|
|
47
|
+
this.element.setAttribute("dir", String(value));
|
|
48
|
+
}
|
|
49
|
+
return this;
|
|
50
|
+
}
|
|
51
|
+
setLang(value) {
|
|
52
|
+
if (value === null || value === void 0) {
|
|
53
|
+
this.element.removeAttribute("lang");
|
|
54
|
+
} else {
|
|
55
|
+
this.element.setAttribute("lang", String(value));
|
|
56
|
+
}
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
setManifest(value) {
|
|
60
|
+
if (value === null || value === void 0) {
|
|
61
|
+
this.element.removeAttribute("manifest");
|
|
62
|
+
} else {
|
|
63
|
+
this.element.setAttribute("manifest", String(value));
|
|
64
|
+
}
|
|
65
|
+
return this;
|
|
66
|
+
}
|
|
67
|
+
setChildren(children) {
|
|
68
|
+
while (this.element.firstChild) {
|
|
69
|
+
this.element.removeChild(this.element.firstChild);
|
|
70
|
+
}
|
|
71
|
+
if (typeof children === "string") {
|
|
72
|
+
this.element.textContent = children;
|
|
73
|
+
} else if (Array.isArray(children)) {
|
|
74
|
+
children.forEach((child) => {
|
|
75
|
+
if (typeof child === "string") {
|
|
76
|
+
this.element.appendChild(document.createTextNode(child));
|
|
77
|
+
} else {
|
|
78
|
+
this.element.appendChild(child);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
} else {
|
|
82
|
+
this.element.appendChild(children);
|
|
83
|
+
}
|
|
84
|
+
return this;
|
|
85
|
+
}
|
|
86
|
+
getElement() {
|
|
87
|
+
return this.element;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
export {
|
|
91
|
+
Html
|
|
92
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/block/html/html.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * THIS FILE IS AUTOGENERATED. DO NOT EDIT IT.\n *\n * @generated January 2, 2026 15:45:45\n * @component Html\n * @description \n */\n\nexport interface HtmlProps {\n /**\n * Child content or elements\n */\n children?: string | HTMLElement | (string | HTMLElement)[];\n /**\n * Mapping of data-* attributes to their values (e.g., {\"test\":\"value\"} -> data-test=\"value\")\n */\n 'data-attributes'?: Record<string, string> | null | undefined;\n /**\n * Represents the text direction of the element\n */\n dir?: 'ltr' | 'rtl' | 'auto' | null | undefined;\n /**\n * Specifies the primary language for the element's content\n */\n lang?: string | null | undefined;\n /**\n * Specifies the address of the document's cache manifest.\n */\n manifest?: string | null | undefined;\n}\n\n/**\n * Html - \n */\nexport class Html {\n private element: HTMLElement;\n\n constructor(props: HtmlProps = {}) {\n this.element = document.createElement('html');\n this.applyProps(props);\n }\n\n private applyProps(props: HtmlProps): void {\n if (props.children !== undefined) {\n this.setChildren(props.children);\n }\n if (props['data-attributes'] !== undefined) {\n const __map = props['data-attributes'];\n if (__map !== null && __map !== undefined) {\n for (const __k in __map) {\n this.element.setAttribute(`data-${__k}`, String((__map as any)[__k]));\n }\n }\n }\n if (props.dir !== undefined) {\n this.setDir(props.dir);\n }\n if (props.lang !== undefined) {\n this.element.setAttribute('lang', String(props.lang));\n }\n if (props.manifest !== undefined) {\n this.element.setAttribute('manifest', String(props.manifest));\n }\n }\n\n setDataAttributes(value: Record<string, string>): this {\n if (value === null || value === undefined) {\n // Remove all data-* attributes (best-effort)\n for (const __a of Array.from(this.element.attributes)) {\n if ((__a as Attr).name.startsWith('data-')) { (this.element as HTMLElement).removeAttribute((__a as Attr).name); }\n }\n } else {\n for (const __k in value as Record<string, string>) {\n this.element.setAttribute(`data-${__k}`, String((value as any)[__k]));\n }\n }\n return this;\n }\n\n setDir(value: 'ltr' | 'rtl' | 'auto' | null | undefined): this {\n if (value === null || value === undefined) {\n this.element.removeAttribute('dir');\n } else {\n this.element.setAttribute('dir', String(value));\n }\n return this;\n }\n\n setLang(value: string | null | undefined): this {\n if (value === null || value === undefined) {\n this.element.removeAttribute('lang');\n } else {\n this.element.setAttribute('lang', String(value));\n }\n return this;\n }\n\n setManifest(value: string | null | undefined): this {\n if (value === null || value === undefined) {\n this.element.removeAttribute('manifest');\n } else {\n this.element.setAttribute('manifest', String(value));\n }\n return this;\n }\n\n setChildren(children: string | HTMLElement | (string | HTMLElement)[]): this {\n // Clear existing children\n while (this.element.firstChild) {\n this.element.removeChild(this.element.firstChild);\n }\n \n if (typeof children === 'string') {\n this.element.textContent = children;\n } else if (Array.isArray(children)) {\n children.forEach(child => {\n if (typeof child === 'string') {\n this.element.appendChild(document.createTextNode(child));\n } else {\n this.element.appendChild(child);\n }\n });\n } else {\n this.element.appendChild(children);\n }\n return this;\n }\n\n getElement(): HTMLElement {\n return this.element;\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAkCO,IAAM,OAAN,MAAW;AAAA,EAGhB,YAAY,QAAmB,CAAC,GAAG;AACjC,SAAK,UAAU,SAAS,cAAc,MAAM;AAC5C,SAAK,WAAW,KAAK;AAAA,EACvB;AAAA,EAEQ,WAAW,OAAwB;AACzC,QAAI,MAAM,aAAa,QAAW;AAChC,WAAK,YAAY,MAAM,QAAQ;AAAA,IACjC;AACA,QAAI,MAAM,iBAAiB,MAAM,QAAW;AAC1C,YAAM,QAAQ,MAAM,iBAAiB;AACrC,UAAI,UAAU,QAAQ,UAAU,QAAW;AACzC,mBAAW,OAAO,OAAO;AACvB,eAAK,QAAQ,aAAa,QAAQ,GAAG,IAAI,OAAQ,MAAc,GAAG,CAAC,CAAC;AAAA,QACtE;AAAA,MACF;AAAA,IACF;AACA,QAAI,MAAM,QAAQ,QAAW;AAC3B,WAAK,OAAO,MAAM,GAAG;AAAA,IACvB;AACA,QAAI,MAAM,SAAS,QAAW;AAC5B,WAAK,QAAQ,aAAa,QAAQ,OAAO,MAAM,IAAI,CAAC;AAAA,IACtD;AACA,QAAI,MAAM,aAAa,QAAW;AAChC,WAAK,QAAQ,aAAa,YAAY,OAAO,MAAM,QAAQ,CAAC;AAAA,IAC9D;AAAA,EACF;AAAA,EAEA,kBAAkB,OAAqC;AACrD,QAAI,UAAU,QAAQ,UAAU,QAAW;AAEzC,iBAAW,OAAO,MAAM,KAAK,KAA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