@oxide/react-asciidoc 0.0.1-alpha.11 → 0.0.1-alpha.12

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.
@@ -46461,7 +46461,7 @@ const ge = Rc.exports, wE = ({
46461
46461
  return e.sectlinks && (a = /* @__PURE__ */ P(Me, {
46462
46462
  children: [/* @__PURE__ */ g("a", {
46463
46463
  className: "anchor",
46464
- href: t.getId() || ""
46464
+ id: t.getId() || ""
46465
46465
  }), /* @__PURE__ */ g("a", {
46466
46466
  className: "link",
46467
46467
  href: `#${t.getId()}`,
@@ -46480,8 +46480,7 @@ const ge = Rc.exports, wE = ({
46480
46480
  }) : /* @__PURE__ */ P("div", {
46481
46481
  className: ge(`sect${n}`, Te(t)),
46482
46482
  children: [cc(`h${n + 1}`, {
46483
- "data-sectnum": o,
46484
- id: t.getId()
46483
+ "data-sectnum": o
46485
46484
  }, a), /* @__PURE__ */ g("div", {
46486
46485
  className: "sectionbody",
46487
46486
  children: /* @__PURE__ */ g(Ie, {
@@ -36,5 +36,5 @@ Check the top-level render call using <`+D+">.")}return C}}function Et(u,C){{if(
36
36
  Copyright (c) 2018 Jed Watson.
37
37
  Licensed under the MIT License (MIT), see
38
38
  http://jedwatson.github.io/classnames
39
- */(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var a=[],o=0;o<arguments.length;o++){var r=arguments[o];if(!!r){var s=typeof r;if(s==="string"||s==="number")a.push(r);else if(Array.isArray(r)){if(r.length){var i=n.apply(null,r);i&&a.push(i)}}else if(s==="object"){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){a.push(r.toString());continue}for(var l in r)e.call(r,l)&&r[l]&&a.push(l)}}}return a.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(Ec);const Se=Ec.exports,jm=({node:t})=>{const e=t.getStyle(),n=r=>{const s=r,i=s[0];let l=s[1];return l.getNodeName||(l=null),{terms:i,dd:l}},a=r=>{if(r)return P("dd",{children:[r.hasText()&&g("p",{children:Te.default(r.getText())}),r.hasBlocks()&&g(Oe,{blocks:r.getBlocks()})]})},o=t.hasTitle()&&g("div",{className:"title",children:t.getCaptionedTitle()});if(e==="qanda")return P("div",{className:Se("qlist qanda",ge(t)),children:[o,g("ol",{children:t.getItems().map((r,s)=>{const{terms:i,dd:l}=n(r);return P("li",{children:[i.map((c,_)=>g("p",{children:g("em",{children:c.getText()})},_)),a(l)]},s)})})]});if(e==="horizontal"){const r=t.getAttribute("labelwidth"),s=t.getAttribute("itemwidth");return P("div",{className:Se("hdlist",ge(t)),children:[o,P("table",{children:[(r||s)&&P("colgroup",{children:[g("col",{style:{width:r?`${r.replace("%","")}%`:""}}),g("col",{style:{width:s?`${s.replace("%","")}%`:""}})]}),g("tbody",{children:t.getItems().map((i,l)=>{const{terms:c,dd:_}=n(i);return P("tr",{children:[g("td",{className:Se("hdlist1",t.isOption("strong")?"strong":""),children:c.map((d,m)=>P(be.Fragment,{children:[m!==0&&g("br",{}),Te.default(d.getText())]},m))}),_&&P("td",{className:"hdlist2",children:[_.hasText()&&g("p",{children:Te.default(_.getText())}),_.hasBlocks()&&g(Oe,{blocks:_.getBlocks()})]})]},l)})})]})]})}else return P("div",{className:Se("dlist",t.getStyle(),ge(t)),children:[o,g("dl",{children:t.getItems().map((r,s)=>{const{terms:i,dd:l}=n(r);return P(be.Fragment,{children:[i.map((c,_)=>g("dt",{className:"hdlist1",children:Te.default(c.getText())},_)),a(l)]},s)})})]})},_t=({node:t,opts:e})=>{if(!t.hasSections())return null;const n=t.getSections(),a=t.getDocument(),o=be.useMemo(()=>a.getAttributes(),[t]),r=be.useMemo(()=>a.getAttribute("sectnumlevels"),[t]),s=be.useMemo(()=>a.getAttribute("toclevels"),[t]),i=(e==null?void 0:e.sectNumLevels)||(r?parseInt(r):3),l=(e==null?void 0:e.tocLevels)||(s?parseInt(s):2);return g("ul",{className:`sectlevel${n[0].getLevel()}`,children:n.map(c=>{let _=c.$sectnum();_=_==="."||_===".."?"":_;const d=c.getLevel();let m="";if(c.getCaption())m=c.getCaptionedTitle();else if(d<=i)if(d<2&&a.getDoctype()=="book"){const p=c.getSectionName();p==="chapter"?m=`${o["chapter-signifier"]||""} ${_} ${c.getTitle()}`:p==="part"?m=`${o["part-signifier"]||""} ${_} ${c.getTitle()}`:m=`${_} ${c.getTitle()}`}else m=`${_} ${c.getTitle()}`;else m=c.getTitle()||"";return P("li",{children:[g("a",{href:`#${c.getId()}`,children:Te.default(m)}),d<l&&g(_t,{node:c,opts:{tocLevels:l,sectNumLevels:i}})]},c.getId())})})},eE=({document:t})=>{const e=t.getBlocks(),[n,a]=be.useState();be.useMemo(()=>{(e||e[0])&&a(t.getFootnotes())},[e]);const o=()=>{var i;return t.getNoheader()?null:g("div",{id:"header",children:t.hasHeader()&&P(Le,{children:[g("h1",{dangerouslySetInnerHTML:{__html:((i=t.getDocumentTitle())==null?void 0:i.toString())||""}}),g(s,{}),t.hasSections()&&t.hasAttribute("toc")&&t.getAttribute("toc-placement")==="auto"&&P("div",{id:"toc",className:t.getAttribute("toc-class","toc"),children:[g("div",{id:"toctitle",children:t.getAttribute("toc-title")}),g(_t,{node:t})]})]})})},r=()=>n&&n.length>0&&e&&!e[0].getDocument().hasAttribute("nofootnotes")?P("div",{id:"footnotes",children:[g("hr",{}),n.map(i=>P("div",{className:"footnote",id:`_footnotedef_${i.getIndex()}`,children:[g("a",{href:`#_footnoteref_${i.getIndex()}`,children:i.getIndex()}),"."," ",Te.default(i.getText()||"")]},i.getIndex()))]}):null,s=()=>t.getAuthors().length>0||t.hasAttribute("revnumber")||t.hasAttribute("revdate")||t.hasAttribute("revremark")?P("div",{className:"details",children:[t.getAuthors().map((l,c)=>P(be.Fragment,{children:[l.getName()&&P(Le,{children:[g("span",{id:`author${c+1>1?c+1:""}`,className:"author",children:Te.default(t.applySubstitutions(l.getName()||"").toString())}),g("br",{})]}),l.getEmail()&&P(Le,{children:[g("span",{id:`email${c+1>1?c+1:""}`,className:"email",children:Te.default(t.applySubstitutions(l.getEmail()||"").toString())}),g("br",{})]})]},c)),t.hasAttribute("revnumber")&&g("span",{id:"revnumber",children:`${t.getAttribute("version-label").toLowerCase()} ${t.getAttribute("revnumber")}${t.hasAttribute("revdate")?",":""}`}),t.hasAttribute("revdate")&&g("span",{id:"revdate",children:t.getAttribute("revdate")}),t.hasAttribute("revremark")&&P(Le,{children:[g("br",{}),g("span",{id:"revremark",children:t.getAttribute("revremark")})]})]}):null;return P(Le,{children:[g(o,{}),g("div",{id:"content",children:g(Oe,{blocks:e})}),g(r,{})]})},tE=({node:t})=>P("div",{className:Se("exampleblock",ge(t)),children:[g(tt,{node:t}),g("div",{className:"content",children:g(Oe,{blocks:t.getBlocks()})})]}),nE=({node:t})=>{const e=t.getLevel();return P(Le,{children:[g("a",{className:"sectionanchor",id:`${t.getId()||""}`}),be.createElement(`h${e+1}`,null,g(ve,{node:t}))]})},aE=({node:t})=>{const e=t.getAttribute("target");let n=g("img",{src:t.getImageUri(e),alt:t.getAttribute("alt"),width:t.getAttribute("width"),height:t.getAttribute("height")});return t.hasAttribute("link")&&(n=g("a",{className:"image",href:t.getAttribute("link"),children:n})),P("div",{className:`imageblock ${t.hasAttribute("align")?"text-"+t.getAttribute("align"):""} ${t.hasAttribute("float")?t.getAttribute("float"):""} ${t.getRole()?t.getRole():""}`,children:[g("div",{className:"content",children:n}),g(tt,{node:t})]})},rE=({node:t})=>{const e=t.getDocument(),n=t.getAttributes(),a=t.isOption("nowrap")||!e.hasAttribute("prewrap"),o=Ge(t);if(t.getStyle()==="source"){const r=n.language;return P("div",{className:"listingblock",children:[g(tt,{node:t}),g("div",{className:"content",children:g("pre",{className:Se("highlight",a?" nowrap":""),children:r?g("code",{className:r?`language-${r}`:"","data-lang":r,dangerouslySetInnerHTML:{__html:o}}):g("code",{dangerouslySetInnerHTML:{__html:o}})})})]})}else return P("div",{className:"listingblock",children:[g(tt,{node:t}),g("div",{className:"content",children:g("pre",{className:a?" nowrap":"",children:g("code",{dangerouslySetInnerHTML:{__html:t.getSource()}})})})]})},iE=({node:t})=>{const n=t.getDocument().getAttributes().prewrap===void 0||t.isOption("nowrap");return P("div",{className:"literalblock",children:[g(ve,{node:t}),g("div",{className:"content",children:g("pre",{className:n?"nowrap":"",children:t.getSource()})})]})},oE=({node:t})=>P("div",{className:Se("olist",ge(t),t.getStyle()),children:[g(ve,{node:t}),g("ol",{className:t.getStyle(),reversed:t.isOption("reversed"),start:t.getAttribute("start"),children:t.getItems().map((e,n)=>P("li",{className:ge(t)?ge(t):"",children:[g("p",{children:Te.default(e.getText())}),g(Oe,{blocks:e.getBlocks()})]},n))})]}),sE=({node:t})=>{const e=t.getStyle();return e==="abstract"?P("div",{className:Se("quoteblock abstract",ge(t)),children:[g(ve,{node:t}),g("blockquote",{className:"content",children:g(Oe,{blocks:t.getBlocks()})})]}):P("div",{className:Se("openblock",e&&e!=="open"?e:"",ge(t)),children:[g(ve,{node:t}),g("div",{className:"content",children:g(Oe,{blocks:t.getBlocks()})})]})},lE=()=>g("div",{style:{pageBreakAfter:"always"}}),cE=({node:t})=>{const e=Ge(t);return P("div",{id:t.getId?t.getId():"",className:Se("paragraph",ge(t)),children:[g(ve,{node:t}),g("p",{dangerouslySetInnerHTML:{__html:e}})]})},_E=({node:t})=>{const e=Ge(t);return g(Le,{children:Te.default(e)})},dE=({node:t})=>{const e=t.getDocument(),n=e.getAttribute("toc-placement")==="preamble"&&e.hasSections()&&e.hasAttribute("toc");return g("div",{id:"preamble",children:P("div",{className:"sectionbody",children:[g(Oe,{blocks:t.getBlocks()}),n&&P("div",{id:"toc",className:e.getAttribute("toc-class","toc"),children:[g("div",{id:"toctitle",children:Te.default(e.getAttribute("toc-title"))}),g(_t,{node:e})]})]})})},uE=({node:t})=>{const e=t.getAttribute("attribution"),n=t.getAttribute("citetitle"),a=Ge(t);return P("div",{id:t.getId?t.getId():"",className:Se("quoteblock",ge(t)),children:[g(ve,{node:t}),g("blockquote",{dangerouslySetInnerHTML:{__html:a}}),e&&P("div",{className:"attribution",children:["\u2014 ",e,n&&g("cite",{children:n})]})]})},mE=({node:t})=>{const e=t.getDocument().getAttributes(),n=t.getLevel();let a="",o=t.$sectnum();o=o==="."?"":o;const r=e.sectnumlevels?parseInt(e.sectnumlevels):3;if(t.getCaption())a=t.getCaptionedTitle();else if(t.isNumbered()&&n<=r)if(n<2&&t.getDocument().getDoctype()=="book"){const s=t.getSectionName();s==="chapter"?a=`${e["chapter-signifier"]||""} ${o} ${t.getTitle()}`:s==="part"?a=`${e["part-signifier"]||""} ${o} ${t.getTitle()}`:a=`${o} ${t.getTitle()}`}else a=`${o} ${t.getTitle()}`;else a=t.getTitle()||"";return e.sectlinks&&(a=P(Le,{children:[g("a",{className:"anchor",href:t.getId()||""}),g("a",{className:"link",href:`#${t.getId()}`,dangerouslySetInnerHTML:{__html:a}})]})),n===0?P(Le,{children:[g("h1",{className:Se("sect0",ge(t)),"data-sectnum":o,children:a}),g(Oe,{blocks:t.getBlocks()})]}):P("div",{className:Se(`sect${n}`,ge(t)),children:[be.createElement(`h${n+1}`,{"data-sectnum":o,id:t.getId()},a),g("div",{className:"sectionbody",children:g(Oe,{blocks:t.getBlocks()})})]})},EE=({node:t})=>g("div",{className:Se("sidebarblock",ge(t)),children:P("div",{className:"content",children:[g(ve,{node:t}),g(Oe,{blocks:t.getBlocks()})]})}),pE=({node:t})=>{let e=["frame-"+t.getAttribute("frame","all","table-frame"),"grid-"+t.getAttribute("grid","all","table-grid")],n=t.getAttribute("stripes",null,"table-stripes");n&&e.push("stripes-"+n);let a=t.hasAutowidthOption(),o=t.getAttribute("tablepcwidth"),r=null;a&&!t.hasAttribute("width")?e.push("fit-content"):o==100?e.push("stretch"):r=`${o}%`,t.hasAttribute("float")&&e.push(t.getAttribute("float")),t.getRole()&&e.push(t.getRole()||"");const s=t.getRowCount(),i=t.getColumns(),l=t.getHeadRows(),c=t.getBodyRows(),_=t.getFootRows(),d=m=>Se("tableblock",`halign-${m.getAttribute("halign")}`,`valign-${m.getAttribute("valign")}`);return P("table",{className:Se("tableblock",...e),style:{width:r||void 0},children:[t.hasTitle()&&g("caption",{className:"title",children:t.getCaptionedTitle()}),s>0&&g("colgroup",{children:i.map(m=>{const p=m.getAttribute("colpcwidth");return g("col",{style:{width:`${p}%`}})})}),l.map(m=>g("thead",{children:g("tr",{children:m.map(p=>g("th",{className:d(p),dangerouslySetInnerHTML:{__html:p.getText()}}))})})),g("tbody",{children:c.map(m=>g("tr",{children:m.map(p=>{const S=p.getColumnSpan(),T=p.getRowSpan(),b=Ge(p),R={colSpan:S,rowSpan:T,className:d(p)},f=p.getStyle();if(f==="asciidoc")return g("td",{...R,children:g("div",{className:"content",dangerouslySetInnerHTML:{__html:b}})});if(f==="literal")return g("td",{...R,children:g("div",{className:"literal",children:g("pre",{dangerouslySetInnerHTML:{__html:b}})})});if(f==="header")return g("th",{...R,children:g("p",{className:"tableblock",dangerouslySetInnerHTML:{__html:b}})});{const O=p.getContent();if(O.length>0)return g("td",{...R,children:Te.default(`<p class="tableblock">${O.join(`</p>
39
+ */(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var a=[],o=0;o<arguments.length;o++){var r=arguments[o];if(!!r){var s=typeof r;if(s==="string"||s==="number")a.push(r);else if(Array.isArray(r)){if(r.length){var i=n.apply(null,r);i&&a.push(i)}}else if(s==="object"){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){a.push(r.toString());continue}for(var l in r)e.call(r,l)&&r[l]&&a.push(l)}}}return a.join(" ")}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(Ec);const Se=Ec.exports,jm=({node:t})=>{const e=t.getStyle(),n=r=>{const s=r,i=s[0];let l=s[1];return l.getNodeName||(l=null),{terms:i,dd:l}},a=r=>{if(r)return P("dd",{children:[r.hasText()&&g("p",{children:Te.default(r.getText())}),r.hasBlocks()&&g(Oe,{blocks:r.getBlocks()})]})},o=t.hasTitle()&&g("div",{className:"title",children:t.getCaptionedTitle()});if(e==="qanda")return P("div",{className:Se("qlist qanda",ge(t)),children:[o,g("ol",{children:t.getItems().map((r,s)=>{const{terms:i,dd:l}=n(r);return P("li",{children:[i.map((c,_)=>g("p",{children:g("em",{children:c.getText()})},_)),a(l)]},s)})})]});if(e==="horizontal"){const r=t.getAttribute("labelwidth"),s=t.getAttribute("itemwidth");return P("div",{className:Se("hdlist",ge(t)),children:[o,P("table",{children:[(r||s)&&P("colgroup",{children:[g("col",{style:{width:r?`${r.replace("%","")}%`:""}}),g("col",{style:{width:s?`${s.replace("%","")}%`:""}})]}),g("tbody",{children:t.getItems().map((i,l)=>{const{terms:c,dd:_}=n(i);return P("tr",{children:[g("td",{className:Se("hdlist1",t.isOption("strong")?"strong":""),children:c.map((d,m)=>P(be.Fragment,{children:[m!==0&&g("br",{}),Te.default(d.getText())]},m))}),_&&P("td",{className:"hdlist2",children:[_.hasText()&&g("p",{children:Te.default(_.getText())}),_.hasBlocks()&&g(Oe,{blocks:_.getBlocks()})]})]},l)})})]})]})}else return P("div",{className:Se("dlist",t.getStyle(),ge(t)),children:[o,g("dl",{children:t.getItems().map((r,s)=>{const{terms:i,dd:l}=n(r);return P(be.Fragment,{children:[i.map((c,_)=>g("dt",{className:"hdlist1",children:Te.default(c.getText())},_)),a(l)]},s)})})]})},_t=({node:t,opts:e})=>{if(!t.hasSections())return null;const n=t.getSections(),a=t.getDocument(),o=be.useMemo(()=>a.getAttributes(),[t]),r=be.useMemo(()=>a.getAttribute("sectnumlevels"),[t]),s=be.useMemo(()=>a.getAttribute("toclevels"),[t]),i=(e==null?void 0:e.sectNumLevels)||(r?parseInt(r):3),l=(e==null?void 0:e.tocLevels)||(s?parseInt(s):2);return g("ul",{className:`sectlevel${n[0].getLevel()}`,children:n.map(c=>{let _=c.$sectnum();_=_==="."||_===".."?"":_;const d=c.getLevel();let m="";if(c.getCaption())m=c.getCaptionedTitle();else if(d<=i)if(d<2&&a.getDoctype()=="book"){const p=c.getSectionName();p==="chapter"?m=`${o["chapter-signifier"]||""} ${_} ${c.getTitle()}`:p==="part"?m=`${o["part-signifier"]||""} ${_} ${c.getTitle()}`:m=`${_} ${c.getTitle()}`}else m=`${_} ${c.getTitle()}`;else m=c.getTitle()||"";return P("li",{children:[g("a",{href:`#${c.getId()}`,children:Te.default(m)}),d<l&&g(_t,{node:c,opts:{tocLevels:l,sectNumLevels:i}})]},c.getId())})})},eE=({document:t})=>{const e=t.getBlocks(),[n,a]=be.useState();be.useMemo(()=>{(e||e[0])&&a(t.getFootnotes())},[e]);const o=()=>{var i;return t.getNoheader()?null:g("div",{id:"header",children:t.hasHeader()&&P(Le,{children:[g("h1",{dangerouslySetInnerHTML:{__html:((i=t.getDocumentTitle())==null?void 0:i.toString())||""}}),g(s,{}),t.hasSections()&&t.hasAttribute("toc")&&t.getAttribute("toc-placement")==="auto"&&P("div",{id:"toc",className:t.getAttribute("toc-class","toc"),children:[g("div",{id:"toctitle",children:t.getAttribute("toc-title")}),g(_t,{node:t})]})]})})},r=()=>n&&n.length>0&&e&&!e[0].getDocument().hasAttribute("nofootnotes")?P("div",{id:"footnotes",children:[g("hr",{}),n.map(i=>P("div",{className:"footnote",id:`_footnotedef_${i.getIndex()}`,children:[g("a",{href:`#_footnoteref_${i.getIndex()}`,children:i.getIndex()}),"."," ",Te.default(i.getText()||"")]},i.getIndex()))]}):null,s=()=>t.getAuthors().length>0||t.hasAttribute("revnumber")||t.hasAttribute("revdate")||t.hasAttribute("revremark")?P("div",{className:"details",children:[t.getAuthors().map((l,c)=>P(be.Fragment,{children:[l.getName()&&P(Le,{children:[g("span",{id:`author${c+1>1?c+1:""}`,className:"author",children:Te.default(t.applySubstitutions(l.getName()||"").toString())}),g("br",{})]}),l.getEmail()&&P(Le,{children:[g("span",{id:`email${c+1>1?c+1:""}`,className:"email",children:Te.default(t.applySubstitutions(l.getEmail()||"").toString())}),g("br",{})]})]},c)),t.hasAttribute("revnumber")&&g("span",{id:"revnumber",children:`${t.getAttribute("version-label").toLowerCase()} ${t.getAttribute("revnumber")}${t.hasAttribute("revdate")?",":""}`}),t.hasAttribute("revdate")&&g("span",{id:"revdate",children:t.getAttribute("revdate")}),t.hasAttribute("revremark")&&P(Le,{children:[g("br",{}),g("span",{id:"revremark",children:t.getAttribute("revremark")})]})]}):null;return P(Le,{children:[g(o,{}),g("div",{id:"content",children:g(Oe,{blocks:e})}),g(r,{})]})},tE=({node:t})=>P("div",{className:Se("exampleblock",ge(t)),children:[g(tt,{node:t}),g("div",{className:"content",children:g(Oe,{blocks:t.getBlocks()})})]}),nE=({node:t})=>{const e=t.getLevel();return P(Le,{children:[g("a",{className:"sectionanchor",id:`${t.getId()||""}`}),be.createElement(`h${e+1}`,null,g(ve,{node:t}))]})},aE=({node:t})=>{const e=t.getAttribute("target");let n=g("img",{src:t.getImageUri(e),alt:t.getAttribute("alt"),width:t.getAttribute("width"),height:t.getAttribute("height")});return t.hasAttribute("link")&&(n=g("a",{className:"image",href:t.getAttribute("link"),children:n})),P("div",{className:`imageblock ${t.hasAttribute("align")?"text-"+t.getAttribute("align"):""} ${t.hasAttribute("float")?t.getAttribute("float"):""} ${t.getRole()?t.getRole():""}`,children:[g("div",{className:"content",children:n}),g(tt,{node:t})]})},rE=({node:t})=>{const e=t.getDocument(),n=t.getAttributes(),a=t.isOption("nowrap")||!e.hasAttribute("prewrap"),o=Ge(t);if(t.getStyle()==="source"){const r=n.language;return P("div",{className:"listingblock",children:[g(tt,{node:t}),g("div",{className:"content",children:g("pre",{className:Se("highlight",a?" nowrap":""),children:r?g("code",{className:r?`language-${r}`:"","data-lang":r,dangerouslySetInnerHTML:{__html:o}}):g("code",{dangerouslySetInnerHTML:{__html:o}})})})]})}else return P("div",{className:"listingblock",children:[g(tt,{node:t}),g("div",{className:"content",children:g("pre",{className:a?" nowrap":"",children:g("code",{dangerouslySetInnerHTML:{__html:t.getSource()}})})})]})},iE=({node:t})=>{const n=t.getDocument().getAttributes().prewrap===void 0||t.isOption("nowrap");return P("div",{className:"literalblock",children:[g(ve,{node:t}),g("div",{className:"content",children:g("pre",{className:n?"nowrap":"",children:t.getSource()})})]})},oE=({node:t})=>P("div",{className:Se("olist",ge(t),t.getStyle()),children:[g(ve,{node:t}),g("ol",{className:t.getStyle(),reversed:t.isOption("reversed"),start:t.getAttribute("start"),children:t.getItems().map((e,n)=>P("li",{className:ge(t)?ge(t):"",children:[g("p",{children:Te.default(e.getText())}),g(Oe,{blocks:e.getBlocks()})]},n))})]}),sE=({node:t})=>{const e=t.getStyle();return e==="abstract"?P("div",{className:Se("quoteblock abstract",ge(t)),children:[g(ve,{node:t}),g("blockquote",{className:"content",children:g(Oe,{blocks:t.getBlocks()})})]}):P("div",{className:Se("openblock",e&&e!=="open"?e:"",ge(t)),children:[g(ve,{node:t}),g("div",{className:"content",children:g(Oe,{blocks:t.getBlocks()})})]})},lE=()=>g("div",{style:{pageBreakAfter:"always"}}),cE=({node:t})=>{const e=Ge(t);return P("div",{id:t.getId?t.getId():"",className:Se("paragraph",ge(t)),children:[g(ve,{node:t}),g("p",{dangerouslySetInnerHTML:{__html:e}})]})},_E=({node:t})=>{const e=Ge(t);return g(Le,{children:Te.default(e)})},dE=({node:t})=>{const e=t.getDocument(),n=e.getAttribute("toc-placement")==="preamble"&&e.hasSections()&&e.hasAttribute("toc");return g("div",{id:"preamble",children:P("div",{className:"sectionbody",children:[g(Oe,{blocks:t.getBlocks()}),n&&P("div",{id:"toc",className:e.getAttribute("toc-class","toc"),children:[g("div",{id:"toctitle",children:Te.default(e.getAttribute("toc-title"))}),g(_t,{node:e})]})]})})},uE=({node:t})=>{const e=t.getAttribute("attribution"),n=t.getAttribute("citetitle"),a=Ge(t);return P("div",{id:t.getId?t.getId():"",className:Se("quoteblock",ge(t)),children:[g(ve,{node:t}),g("blockquote",{dangerouslySetInnerHTML:{__html:a}}),e&&P("div",{className:"attribution",children:["\u2014 ",e,n&&g("cite",{children:n})]})]})},mE=({node:t})=>{const e=t.getDocument().getAttributes(),n=t.getLevel();let a="",o=t.$sectnum();o=o==="."?"":o;const r=e.sectnumlevels?parseInt(e.sectnumlevels):3;if(t.getCaption())a=t.getCaptionedTitle();else if(t.isNumbered()&&n<=r)if(n<2&&t.getDocument().getDoctype()=="book"){const s=t.getSectionName();s==="chapter"?a=`${e["chapter-signifier"]||""} ${o} ${t.getTitle()}`:s==="part"?a=`${e["part-signifier"]||""} ${o} ${t.getTitle()}`:a=`${o} ${t.getTitle()}`}else a=`${o} ${t.getTitle()}`;else a=t.getTitle()||"";return e.sectlinks&&(a=P(Le,{children:[g("a",{className:"anchor",id:t.getId()||""}),g("a",{className:"link",href:`#${t.getId()}`,dangerouslySetInnerHTML:{__html:a}})]})),n===0?P(Le,{children:[g("h1",{className:Se("sect0",ge(t)),"data-sectnum":o,children:a}),g(Oe,{blocks:t.getBlocks()})]}):P("div",{className:Se(`sect${n}`,ge(t)),children:[be.createElement(`h${n+1}`,{"data-sectnum":o},a),g("div",{className:"sectionbody",children:g(Oe,{blocks:t.getBlocks()})})]})},EE=({node:t})=>g("div",{className:Se("sidebarblock",ge(t)),children:P("div",{className:"content",children:[g(ve,{node:t}),g(Oe,{blocks:t.getBlocks()})]})}),pE=({node:t})=>{let e=["frame-"+t.getAttribute("frame","all","table-frame"),"grid-"+t.getAttribute("grid","all","table-grid")],n=t.getAttribute("stripes",null,"table-stripes");n&&e.push("stripes-"+n);let a=t.hasAutowidthOption(),o=t.getAttribute("tablepcwidth"),r=null;a&&!t.hasAttribute("width")?e.push("fit-content"):o==100?e.push("stretch"):r=`${o}%`,t.hasAttribute("float")&&e.push(t.getAttribute("float")),t.getRole()&&e.push(t.getRole()||"");const s=t.getRowCount(),i=t.getColumns(),l=t.getHeadRows(),c=t.getBodyRows(),_=t.getFootRows(),d=m=>Se("tableblock",`halign-${m.getAttribute("halign")}`,`valign-${m.getAttribute("valign")}`);return P("table",{className:Se("tableblock",...e),style:{width:r||void 0},children:[t.hasTitle()&&g("caption",{className:"title",children:t.getCaptionedTitle()}),s>0&&g("colgroup",{children:i.map(m=>{const p=m.getAttribute("colpcwidth");return g("col",{style:{width:`${p}%`}})})}),l.map(m=>g("thead",{children:g("tr",{children:m.map(p=>g("th",{className:d(p),dangerouslySetInnerHTML:{__html:p.getText()}}))})})),g("tbody",{children:c.map(m=>g("tr",{children:m.map(p=>{const S=p.getColumnSpan(),T=p.getRowSpan(),b=Ge(p),R={colSpan:S,rowSpan:T,className:d(p)},f=p.getStyle();if(f==="asciidoc")return g("td",{...R,children:g("div",{className:"content",dangerouslySetInnerHTML:{__html:b}})});if(f==="literal")return g("td",{...R,children:g("div",{className:"literal",children:g("pre",{dangerouslySetInnerHTML:{__html:b}})})});if(f==="header")return g("th",{...R,children:g("p",{className:"tableblock",dangerouslySetInnerHTML:{__html:b}})});{const O=p.getContent();if(O.length>0)return g("td",{...R,children:Te.default(`<p class="tableblock">${O.join(`</p>
40
40
  <p class="tableblock">`)}</p>`)})}})}))}),_.map(m=>g("tfoot",{children:g("tr",{children:m.map((p,S)=>g("td",{className:d(p),children:g("p",{className:"tableblock",dangerouslySetInnerHTML:{__html:p.getText()}})},S))})}))]})},gE=({node:t})=>{let e=t.getId()||"toc";const n=t.getDocument(),a=t.hasTitle()?t.getTitle():n.getAttribute("toc-title"),o=be.useMemo(()=>n.getAttribute("toc-placement"),[t]),r=be.useMemo(()=>n.hasAttribute("toc"),[t]),s=t.hasAttribute("levels")?parseInt(t.getAttribute("levels")):void 0;return o==="macro"&&n.hasSections()&&r?P("div",{id:e,className:Se("toc",ge(t)),children:[g("div",{id:`${e}title`,className:"title",children:Te.default(a||"")}),g(_t,{node:t.getDocument(),opts:{tocLevels:s}})]}):null},SE=()=>g("hr",{}),TE=({node:t})=>{const e=t.isOption("checklist");return P("div",{id:t.getId?t.getId():"",className:Se("ulist",t.getStyle(),ge(t),e&&"checklist"),children:[g(ve,{node:t}),g("ul",{className:e?"checklist":"",children:t.getItems().map((n,a)=>e?g("li",{id:n.getId(),className:ge(t),children:P("p",{children:[e&&n.hasAttribute("checkbox")&&g("i",{className:Se("fa",n.hasAttribute("checked")?"fa-check-square-o":"fa-square-o")})," ",Te.default(n.getText())]})},a):P("li",{id:n.getId(),className:ge(t),children:[g("p",{dangerouslySetInnerHTML:{__html:n.getText()}}),g(Oe,{blocks:n.getBlocks()})]},a))})]})},bE=({node:t})=>{const e=t.getAttribute("attribution"),n=t.getAttribute("citetitle"),a=Ge(t);return P("div",{id:t.getId?t.getId():"",className:Se("verseblock",ge(t)),children:[g(ve,{node:t}),g("pre",{className:"content",dangerouslySetInnerHTML:{__html:a}}),e&&P("div",{className:"attribution",children:["\u2014 ",e,n&&g("cite",{children:n})]})]})},pc=pi.default();pc.SyntaxHighlighter.register("highlight.js-server",{handlesHighlighting:()=>!0,highlight:(t,e,n)=>n&&dc.getLanguage(n)?dc.highlight(e,{language:n}).value:e});const gc=be.createContext({}),RE=({content:t,options:e})=>{const n={"source-highlighter":"highlight.js-server",sectlinks:"true",icons:"font"},a=e&&e.attributes?e.attributes:{},o={standalone:!0,attributes:{...n,...a},sourcemap:!0},r=pc.load(t,o),s=e&&e.customDocument;return g(gc.Provider,{value:e||{},children:s?g(s,{document:r}):g(eE,{document:r})})},Oe=({blocks:t})=>g(Le,{children:t.map((e,n)=>g(fE,{node:e},`${n}-${e.getNodeName()}`))}),fE=({node:t})=>{const e=be.useContext(gc),n=t.getNodeName(),a=t.getDocument(),o=t.getAttributes();a.playbackAttributes(o);const r=e&&e.overrides&&e.overrides[n];if(r)return g(r,{node:t});switch(n){case"audio":return g(Zm,{node:t});case"preamble":return g(dE,{node:t});case"section":return g(mE,{node:t});case"paragraph":return g(cE,{node:t});case"dlist":return g(jm,{node:t});case"ulist":return g(TE,{node:t});case"floating_title":return g(nE,{node:t});case"admonition":return g(Xm,{node:t});case"listing":return g(rE,{node:t});case"literal":return g(iE,{node:t});case"image":return g(aE,{node:t});case"colist":return g(Jm,{node:t});case"olist":return g(oE,{node:t});case"table":return g(pE,{node:t});case"thematic_break":return g(SE,{});case"open":return g(sE,{node:t});case"pass":return g(_E,{node:t});case"page_break":return g(lE,{});case"example":return g(tE,{node:t});case"sidebar":return g(EE,{node:t});case"quote":return g(uE,{node:t});case"verse":return g(bE,{node:t});case"toc":return g(gE,{node:t});default:return g(Le,{children:Te.default(t.convert())})}};Object.defineProperty(Ce,"asciidoctor",{enumerable:!0,get:()=>pi.default}),Ce.CaptionedTitle=tt,Ce.Content=Oe,Ce.Title=ve,Ce.default=RE,Ce.getRole=ge,Ce.useGetContent=Ge,Object.defineProperties(Ce,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxide/react-asciidoc",
3
- "version": "0.0.1-alpha.11",
3
+ "version": "0.0.1-alpha.12",
4
4
  "files": [
5
5
  "dist"
6
6
  ],