@oxide/react-asciidoc 0.1.3-alpha.1 → 0.1.3-alpha.2
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/dist/react-asciidoc.js +789 -782
- package/dist/react-asciidoc.umd.cjs +11 -11
- package/dist/types/hooks/useGetContent.d.ts +3 -2
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(d,
|
|
1
|
+
(function(d,X){typeof exports=="object"&&typeof module<"u"?X(exports,require("@asciidoctor/core"),require("html-react-parser"),require("react")):typeof define=="function"&&define.amd?define(["exports","@asciidoctor/core","html-react-parser","react"],X):(d=typeof globalThis<"u"?globalThis:d||self,X(d.ReactAsciiDoc={},d.core,d.parse,d.React))})(this,function(d,X,_t,k){"use strict";const fe=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},Tt=fe(X),O=fe(_t),Te=fe(k),G={},U=e=>{const[a,i]=k.useState("");return k.useEffect(()=>{const l=e.$$id;if(G[l]){i(G[l]);return}const f=e.getContent()||"";G[l]=f,i(f)},[e]),a},$=e=>{const[a,i]=k.useState("");return k.useEffect(()=>{const l=e.$$id;if(G[l]){i(G[l]);return}const f=e.getText()||"";G[l]=f,i(f)},[e]),a};var ne={exports:{}},Q={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Ae;function At(){if(Ae)return Q;Ae=1;var e=Te.default,a=Symbol.for("react.element"),i=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,f=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function h(y,g,T){var v,I={},_=null,j=null;T!==void 0&&(_=""+T),g.key!==void 0&&(_=""+g.key),g.ref!==void 0&&(j=g.ref);for(v in g)l.call(g,v)&&!c.hasOwnProperty(v)&&(I[v]=g[v]);if(y&&y.defaultProps)for(v in g=y.defaultProps,g)I[v]===void 0&&(I[v]=g[v]);return{$$typeof:a,type:y,key:_,ref:j,props:I,_owner:f.current}}return Q.Fragment=i,Q.jsx=h,Q.jsxs=h,Q}var q={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,19 +14,19 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+ge+t}}var
|
|
17
|
+
*/var Ne;function Nt(){return Ne||(Ne=1,process.env.NODE_ENV!=="production"&&function(){var e=Te.default,a=Symbol.for("react.element"),i=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),h=Symbol.for("react.provider"),y=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),j=Symbol.for("react.offscreen"),P=Symbol.iterator,B="@@iterator";function de(t){if(t===null||typeof t!="object")return null;var n=P&&t[P]||t[B];return typeof n=="function"?n:null}var H=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(t){{for(var n=arguments.length,s=new Array(n>1?n-1:0),u=1;u<n;u++)s[u-1]=arguments[u];J("error",t,s)}}function J(t,n,s){{var u=H.ReactDebugCurrentFrame,p=u.getStackAddendum();p!==""&&(n+="%s",s=s.concat([p]));var A=s.map(function(b){return String(b)});A.unshift("Warning: "+n),Function.prototype.apply.call(console[t],console,A)}}var te=!1,ie=!1,Et=!1,St=!1,wt=!1,Xe;Xe=Symbol.for("react.module.reference");function Ct(t){return!!(typeof t=="string"||typeof t=="function"||t===l||t===c||wt||t===f||t===T||t===v||St||t===j||te||ie||Et||typeof t=="object"&&t!==null&&(t.$$typeof===_||t.$$typeof===I||t.$$typeof===h||t.$$typeof===y||t.$$typeof===g||t.$$typeof===Xe||t.getModuleId!==void 0))}function Ot(t,n,s){var u=t.displayName;if(u)return u;var p=n.displayName||n.name||"";return p!==""?s+"("+p+")":s}function Qe(t){return t.displayName||"Context"}function W(t){if(t==null)return null;if(typeof t.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case l:return"Fragment";case i:return"Portal";case c:return"Profiler";case f:return"StrictMode";case T:return"Suspense";case v:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case y:var n=t;return Qe(n)+".Consumer";case h:var s=t;return Qe(s._context)+".Provider";case g:return Ot(t,t.render,"ForwardRef");case I:var u=t.displayName||null;return u!==null?u:W(t.type)||"Memo";case _:{var p=t,A=p._payload,b=p._init;try{return W(b(A))}catch{return null}}}return null}var V=Object.assign,re=0,qe,Ze,et,tt,rt,at,nt;function it(){}it.__reactDisabledLog=!0;function It(){{if(re===0){qe=console.log,Ze=console.info,et=console.warn,tt=console.error,rt=console.group,at=console.groupCollapsed,nt=console.groupEnd;var t={configurable:!0,enumerable:!0,value:it,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}re++}}function Pt(){{if(re--,re===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},t,{value:qe}),info:V({},t,{value:Ze}),warn:V({},t,{value:et}),error:V({},t,{value:tt}),group:V({},t,{value:rt}),groupCollapsed:V({},t,{value:at}),groupEnd:V({},t,{value:nt})})}re<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var he=H.ReactCurrentDispatcher,ge;function se(t,n,s){{if(ge===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);ge=u&&u[1]||""}return`
|
|
18
|
+
`+ge+t}}var me=!1,le;{var jt=typeof WeakMap=="function"?WeakMap:Map;le=new jt}function st(t,n){if(!t||me)return"";{var s=le.get(t);if(s!==void 0)return s}var u;me=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var A;A=he.current,he.current=null,It();try{if(n){var b=function(){throw Error()};if(Object.defineProperty(b.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(b,[])}catch(Y){u=Y}Reflect.construct(t,[],b)}else{try{b.call()}catch(Y){u=Y}t.call(b.prototype)}}else{try{throw Error()}catch(Y){u=Y}t()}}catch(Y){if(Y&&u&&typeof Y.stack=="string"){for(var m=Y.stack.split(`
|
|
19
19
|
`),D=u.stack.split(`
|
|
20
|
-
`),R=
|
|
21
|
-
`+
|
|
20
|
+
`),R=m.length-1,C=D.length-1;R>=1&&C>=0&&m[R]!==D[C];)C--;for(;R>=1&&C>=0;R--,C--)if(m[R]!==D[C]){if(R!==1||C!==1)do if(R--,C--,C<0||m[R]!==D[C]){var x=`
|
|
21
|
+
`+m[R].replace(" at new "," at ");return t.displayName&&x.includes("<anonymous>")&&(x=x.replace("<anonymous>",t.displayName)),typeof t=="function"&&le.set(t,x),x}while(R>=1&&C>=0);break}}}finally{me=!1,he.current=A,Pt(),Error.prepareStackTrace=p}var K=t?t.displayName||t.name:"",yt=K?se(K):"";return typeof t=="function"&&le.set(t,yt),yt}function Lt(t,n,s){return st(t,!1)}function Dt(t){var n=t.prototype;return!!(n&&n.isReactComponent)}function ce(t,n,s){if(t==null)return"";if(typeof t=="function")return st(t,Dt(t));if(typeof t=="string")return se(t);switch(t){case T:return se("Suspense");case v:return se("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case g:return Lt(t.render);case I:return ce(t.type,n,s);case _:{var u=t,p=u._payload,A=u._init;try{return ce(A(p),n,s)}catch{}}}return""}var oe=Object.prototype.hasOwnProperty,lt={},ct=H.ReactDebugCurrentFrame;function ue(t){if(t){var n=t._owner,s=ce(t.type,t._source,n?n.type:null);ct.setExtraStackFrame(s)}else ct.setExtraStackFrame(null)}function Ft(t,n,s,u,p){{var A=Function.call.bind(oe);for(var b in t)if(A(t,b)){var m=void 0;try{if(typeof t[b]!="function"){var D=Error((u||"React class")+": "+s+" type `"+b+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[b]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw D.name="Invariant Violation",D}m=t[b](n,b,u,s,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(R){m=R}m&&!(m instanceof Error)&&(ue(p),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",u||"React class",s,b,typeof m),ue(null)),m instanceof Error&&!(m.message in lt)&&(lt[m.message]=!0,ue(p),w("Failed %s type: %s",s,m.message),ue(null))}}}var $t=Array.isArray;function ve(t){return $t(t)}function xt(t){{var n=typeof Symbol=="function"&&Symbol.toStringTag,s=n&&t[Symbol.toStringTag]||t.constructor.name||"Object";return s}}function Mt(t){try{return ot(t),!1}catch{return!0}}function ot(t){return""+t}function ut(t){if(Mt(t))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",xt(t)),ot(t)}var ae=H.ReactCurrentOwner,Bt={key:!0,ref:!0,__self:!0,__source:!0},ft,dt,be;be={};function Wt(t){if(oe.call(t,"ref")){var n=Object.getOwnPropertyDescriptor(t,"ref").get;if(n&&n.isReactWarning)return!1}return t.ref!==void 0}function Yt(t){if(oe.call(t,"key")){var n=Object.getOwnPropertyDescriptor(t,"key").get;if(n&&n.isReactWarning)return!1}return t.key!==void 0}function Ut(t,n){if(typeof t.ref=="string"&&ae.current&&n&&ae.current.stateNode!==n){var s=W(ae.current.type);be[s]||(w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',W(ae.current.type),t.ref),be[s]=!0)}}function Ht(t,n){{var s=function(){ft||(ft=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};s.isReactWarning=!0,Object.defineProperty(t,"key",{get:s,configurable:!0})}}function Vt(t,n){{var s=function(){dt||(dt=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",n))};s.isReactWarning=!0,Object.defineProperty(t,"ref",{get:s,configurable:!0})}}var Gt=function(t,n,s,u,p,A,b){var m={$$typeof:a,type:t,key:n,ref:s,props:b,_owner:A};return m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(m,"_self",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.defineProperty(m,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m};function Jt(t,n,s,u,p){{var A,b={},m=null,D=null;s!==void 0&&(ut(s),m=""+s),Yt(n)&&(ut(n.key),m=""+n.key),Wt(n)&&(D=n.ref,Ut(n,p));for(A in n)oe.call(n,A)&&!Bt.hasOwnProperty(A)&&(b[A]=n[A]);if(t&&t.defaultProps){var R=t.defaultProps;for(A in R)b[A]===void 0&&(b[A]=R[A])}if(m||D){var C=typeof t=="function"?t.displayName||t.name||"Unknown":t;m&&Ht(b,C),D&&Vt(b,C)}return Gt(t,m,D,p,u,ae.current,b)}}var pe=H.ReactCurrentOwner,ht=H.ReactDebugCurrentFrame;function z(t){if(t){var n=t._owner,s=ce(t.type,t._source,n?n.type:null);ht.setExtraStackFrame(s)}else ht.setExtraStackFrame(null)}var ye;ye=!1;function _e(t){return typeof t=="object"&&t!==null&&t.$$typeof===a}function gt(){{if(pe.current){var t=W(pe.current.type);if(t)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+t+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+t+"`."}return""}}function zt(t){{if(t!==void 0){var n=t.fileName.replace(/^.*[\\\/]/,""),s=t.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+
|
|
25
|
+
Check your code at `+n+":"+s+"."}return""}}var mt={};function Kt(t){{var n=gt();if(!n){var s=typeof t=="string"?t:t.displayName||t.name;s&&(n=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+s+">.")}return
|
|
27
|
+
Check the top-level render call using <`+s+">.")}return n}}function vt(t,n){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var s=Kt(n);if(mt[s])return;mt[s]=!0;var u="";t&&t._owner&&t._owner!==pe.current&&(u=" It was passed a child from "+W(t._owner.type)+"."),z(t),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',s,u),z(null)}}function bt(t,n){{if(typeof t!="object")return;if(ve(t))for(var s=0;s<t.length;s++){var u=t[s];_e(u)&&vt(u,n)}else if(_e(t))t._store&&(t._store.validated=!0);else if(t){var p=de(t);if(typeof p=="function"&&p!==t.entries)for(var A=p.call(t),b;!(b=A.next()).done;)_e(b.value)&&vt(b.value,n)}}}function Xt(t){{var n=t.type;if(n==null||typeof n=="string")return;var s;if(typeof n=="function")s=n.propTypes;else if(typeof n=="object"&&(n.$$typeof===g||n.$$typeof===I))s=n.propTypes;else return;if(s){var u=W(n);Ft(s,t.props,"prop",u,t)}else if(n.PropTypes!==void 0&&!ye){ye=!0;var p=W(n);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof n.getDefaultProps=="function"&&!n.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Qt(t){{for(var n=Object.keys(t.props),s=0;s<n.length;s++){var u=n[s];if(u!=="children"&&u!=="key"){z(t),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",u),z(null);break}}t.ref!==null&&(z(t),w("Invalid attribute `ref` supplied to `React.Fragment`."),z(null))}}function pt(t,n,s,u,p,A){{var b=Ct(t);if(!b){var m="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(m+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var D=zt(p);D?m+=D:m+=gt();var R;t===null?R="null":ve(t)?R="array":t!==void 0&&t.$$typeof===a?(R="<"+(W(t.type)||"Unknown")+" />",m=" Did you accidentally export a JSX literal instead of a component?"):R=typeof t,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,m)}var C=Jt(t,n,s,p,A);if(C==null)return C;if(b){var x=n.children;if(x!==void 0)if(u)if(ve(x)){for(var K=0;K<x.length;K++)bt(x[K],t);Object.freeze&&Object.freeze(x)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else bt(x,t)}return t===l?Qt(C):Xt(C),C}}function qt(t,n,s){return pt(t,n,s,!0)}function Zt(t,n,s){return pt(t,n,s,!1)}var er=Zt,tr=qt;q.Fragment=l,q.jsx=er,q.jsxs=tr}()),q}(function(e){process.env.NODE_ENV==="production"?e.exports=At():e.exports=Nt()})(ne);const M=ne.exports.Fragment,r=ne.exports.jsx,o=ne.exports.jsxs,F=({node:e})=>e.hasTitle()?r("div",{className:"title",children:O.default(e.getTitle()||"")}):null,Z=({node:e})=>e.hasTitle()?r("div",{className:"title",children:O.default(e.getCaptionedTitle()||"")}):null,E=e=>typeof e.getRole()=="string"?e.getRole():void 0,N=e=>e.getLineNumber()?{"data-lineno":e.getLineNumber()}:{},ke=({node:e})=>{const a=e.getAttributes(),i=e.getDocument(),l=U(e),f=()=>i.getAttribute("icons")==="font"&&!a.icon?r("i",{className:`fa icon-${a.name}`,title:a.textlabel}):r("img",{src:e.getIconUri(a.name),alt:a.textlabel}),c=e.content_model;return r("div",{className:`admonitionblock ${a.name}`,...N(e),children:r("table",{children:r("tbody",{children:o("tr",{children:[r("td",{className:"icon",children:i.hasAttribute("icons")?f():r("div",{className:"title",children:e.getAttribute("textlabel")})}),o("td",{className:"content",children:[r(F,{node:e}),c==="simple"?O.default(l):r(L,{blocks:e.getBlocks()})]})]})})})})},Re=({node:e})=>{const a=e.getAttribute("start"),i=e.getAttribute("start"),l=(a||i)&&`#t=${a||""}`+i?`,${i}`:"";return o("div",{className:"audioblock",...N(e),children:[r(F,{node:e}),r("div",{className:"content",children:r("audio",{src:`${e.getMediaUri(e.getAttribute("target"))}${l}`,autoPlay:e.isOption("autoplay"),controls:!e.isOption("nocontrols"),loop:e.isOption("loop"),children:"Your browser does not support the audio tag."})})]})},Ee=({node:e})=>o("div",{className:"colist",...N(e),children:[r(F,{node:e}),r("table",{children:r("tbody",{children:e.getItems().map((a,i)=>o("tr",{children:[o("td",{children:[r("i",{className:"conum","data-value":i+1}),r("b",{children:i+1})]}),o("td",{children:[O.default($(a)),r(L,{blocks:a.getBlocks()})]})]},i))})})]});var Se={exports:{}};/*!
|
|
28
28
|
Copyright (c) 2018 Jed Watson.
|
|
29
29
|
Licensed under the MIT License (MIT), see
|
|
30
30
|
http://jedwatson.github.io/classnames
|
|
31
|
-
*/(function(e){(function(){var a={}.hasOwnProperty;function n(){for(var l=[],f=0;f<arguments.length;f++){var c=arguments[f];if(!!c){var y=typeof c;if(y==="string"||y==="number")l.push(c);else if(Array.isArray(c)){if(c.length){var m=n.apply(null,c);m&&l.push(m)}}else if(y==="object"){if(c.toString!==Object.prototype.toString&&!c.toString.toString().includes("[native code]")){l.push(c.toString());continue}for(var g in c)a.call(c,g)&&c[g]&&l.push(g)}}}return l.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Ee);const S=Ee.exports,Se=({node:e})=>{const a=e.getStyle(),n=c=>{const y=c,m=y[0];let g=y[1];return g.getNodeName||(g=null),{terms:m,dd:g}},l=c=>{if(c)return o("dd",{children:[c.hasText()&&r("p",{children:O.default(c.getText())}),c.hasBlocks()&&r(L,{blocks:c.getBlocks()})]})},f=e.hasTitle()&&r("div",{className:"title",children:e.getCaptionedTitle()});if(a==="qanda")return o("div",{className:S("qlist qanda",E(e)),...N(e),children:[f,r("ol",{children:e.getItems().map((c,y)=>{const{terms:m,dd:g}=n(c);return o("li",{children:[m.map((v,b)=>r("p",{children:r("em",{children:v.getText()})},b)),l(g)]},y)})})]});if(a==="horizontal"){const c=e.getAttribute("labelwidth"),y=e.getAttribute("itemwidth");return o("div",{className:S("hdlist",E(e)),children:[f,o("table",{children:[(c||y)&&o("colgroup",{children:[r("col",{style:{width:c?`${c.replace("%","")}%`:""}}),r("col",{style:{width:y?`${y.replace("%","")}%`:""}})]}),r("tbody",{children:e.getItems().map((m,g)=>{const{terms:v,dd:b}=n(m);return o("tr",{children:[r("td",{className:S("hdlist1",e.isOption("strong")?"strong":""),children:v.map((I,T)=>o(k.Fragment,{children:[T!==0&&r("br",{}),O.default(I.getText())]},T))}),b&&o("td",{className:"hdlist2",children:[b.hasText()&&r("p",{children:O.default(b.getText())}),b.hasBlocks()&&r(L,{blocks:b.getBlocks()})]})]},g)})})]})]})}else return o("div",{className:S("dlist",e.getStyle(),E(e)),children:[f,r("dl",{children:e.getItems().map((c,y)=>{const{terms:m,dd:g}=n(c);return o(k.Fragment,{children:[m.map((v,b)=>r("dt",{className:"hdlist1",children:O.default(v.getText())},b)),l(g)]},y)})})]})},q=({node:e,opts:a})=>{if(!e.hasSections())return null;const n=e.getSections(),l=e.getDocument(),f=k.useMemo(()=>l.getAttributes(),[e]),c=k.useMemo(()=>l.getAttribute("sectnumlevels"),[e]),y=k.useMemo(()=>l.getAttribute("toclevels"),[e]),m=(a==null?void 0:a.sectNumLevels)||(c?parseInt(c):3),g=(a==null?void 0:a.tocLevels)||(y?parseInt(y):2);return r("ul",{className:`sectlevel${n[0].getLevel()}`,children:n.map(v=>{let b=v.$sectnum();b=b==="."||b===".."?"":b;const I=v.getLevel();let T="";if(v.getCaption())T=v.getCaptionedTitle();else if(I<=m)if(I<2&&l.getDoctype()=="book"){const j=v.getSectionName();j==="chapter"?T=`${f["chapter-signifier"]||""} ${b} ${v.getTitle()}`:j==="part"?T=`${f["part-signifier"]||""} ${b} ${v.getTitle()}`:T=`${b} ${v.getTitle()}`}else T=`${b} ${v.getTitle()}`;else T=v.getTitle()||"";return o("li",{children:[r("a",{href:`#${v.getId()}`,children:O.default(T)}),I<g&&r(q,{node:v,opts:{tocLevels:g,sectNumLevels:m}})]},v.getId())})})},we=({document:e})=>{const a=e.getBlocks(),[n,l]=k.useState();k.useMemo(()=>{(a||a[0])&&l(e.getFootnotes())},[a]);const f=()=>{var m;return e.getNoheader()?null:r("div",{id:"header",children:e.hasHeader()&&o($,{children:[r("h1",{dangerouslySetInnerHTML:{__html:((m=e.getDocumentTitle())==null?void 0:m.toString())||""}}),r(y,{}),e.hasSections()&&e.hasAttribute("toc")&&e.getAttribute("toc-placement")==="auto"&&o("div",{id:"toc",className:e.getAttribute("toc-class","toc"),children:[r("div",{id:"toctitle",children:e.getAttribute("toc-title")}),r(q,{node:e})]})]})})},c=()=>n&&n.length>0&&a&&!a[0].getDocument().hasAttribute("nofootnotes")?o("div",{id:"footnotes",children:[r("hr",{}),n.map(m=>o("div",{className:"footnote",id:`_footnotedef_${m.getIndex()}`,children:[r("a",{href:`#_footnoteref_${m.getIndex()}`,children:m.getIndex()}),"."," ",O.default(m.getText()||"")]},m.getIndex()))]}):null,y=()=>e.getAuthors().length>0||e.hasAttribute("revnumber")||e.hasAttribute("revdate")||e.hasAttribute("revremark")?o("div",{className:"details",children:[e.getAuthors().map((g,v)=>o(k.Fragment,{children:[g.getName()&&o($,{children:[r("span",{id:`author${v+1>1?v+1:""}`,className:"author",children:O.default(e.applySubstitutions(g.getName()||"").toString())}),r("br",{})]}),g.getEmail()&&o($,{children:[r("span",{id:`email${v+1>1?v+1:""}`,className:"email",children:O.default(e.applySubstitutions(g.getEmail()||"").toString())}),r("br",{})]})]},v)),e.hasAttribute("revnumber")&&r("span",{id:"revnumber",children:`${e.getAttribute("version-label").toLowerCase()} ${e.getAttribute("revnumber")}${e.hasAttribute("revdate")?",":""}`}),e.hasAttribute("revdate")&&r("span",{id:"revdate",children:e.getAttribute("revdate")}),e.hasAttribute("revremark")&&o($,{children:[r("br",{}),r("span",{id:"revremark",children:e.getAttribute("revremark")})]})]}):null;return o($,{children:[r(f,{}),r("div",{id:"content",children:r(L,{blocks:a})}),r(c,{})]})},Ce=({node:e})=>o("div",{className:S("exampleblock",E(e)),...N(e),children:[r(Q,{node:e}),r("div",{className:"content",children:r(L,{blocks:e.getBlocks()})})]}),Oe=({node:e})=>{const a=e.getLevel();return o($,{children:[r("a",{className:"sectionanchor",id:`${e.getId()||""}`,...N(e)}),k.createElement(`h${a+1}`,null,r(x,{node:e}))]})},Ie=({node:e})=>{const a=e.getAttribute("target");let n=r("img",{src:e.getImageUri(a),alt:e.getAttribute("alt"),width:e.getAttribute("width"),height:e.getAttribute("height")});return e.hasAttribute("link")&&(n=r("a",{className:"image",href:e.getAttribute("link"),children:n})),o("div",{className:`imageblock ${e.hasAttribute("align")?"text-"+e.getAttribute("align"):""} ${e.hasAttribute("float")?e.getAttribute("float"):""} ${e.getRole()?e.getRole():""}`,...N(e),children:[r("div",{className:"content",children:n}),r(Q,{node:e})]})},Pe=({node:e})=>{const a=e.getDocument(),n=e.getAttributes(),l=e.isOption("nowrap")||!a.hasAttribute("prewrap"),f=Y(e);if(e.getStyle()==="source"){const c=n.language;return o("div",{className:"listingblock",...N(e),children:[r(Q,{node:e}),r("div",{className:"content",children:r("pre",{className:S("highlight",l?" nowrap":""),children:c?r("code",{className:c?`language-${c}`:"","data-lang":c,dangerouslySetInnerHTML:{__html:f}}):r("code",{dangerouslySetInnerHTML:{__html:f}})})})]})}else return o("div",{className:"listingblock",...N(e),children:[r(Q,{node:e}),r("div",{className:"content",children:r("pre",{className:l?" nowrap":"",children:r("code",{dangerouslySetInnerHTML:{__html:e.getSource()}})})})]})},je=({node:e})=>{const n=e.getDocument().getAttributes().prewrap===void 0||e.isOption("nowrap");return o("div",{className:"literalblock",...N(e),children:[r(x,{node:e}),r("div",{className:"content",children:r("pre",{className:n?"nowrap":"",children:e.getSource()})})]})},Le=({node:e})=>o("div",{className:S("olist",E(e),e.getStyle()),...N(e),children:[r(x,{node:e}),r("ol",{className:e.getStyle(),reversed:e.isOption("reversed"),start:e.getAttribute("start"),children:e.getItems().map((a,n)=>o("li",{className:E(e)?E(e):"",children:[r("p",{children:O.default(a.getText())}),r(L,{blocks:a.getBlocks()})]},n))})]}),De=({node:e})=>{const a=e.getStyle();return a==="abstract"?o("div",{className:S("quoteblock abstract",E(e)),...N(e),children:[r(x,{node:e}),r("blockquote",{className:"content",children:r(L,{blocks:e.getBlocks()})})]}):o("div",{className:S("openblock",a&&a!=="open"?a:"",E(e)),...N(e),children:[r(x,{node:e}),r("div",{className:"content",children:r(L,{blocks:e.getBlocks()})})]})},xe=()=>r("div",{style:{pageBreakAfter:"always"}}),Fe=({node:e})=>{const a=Y(e);return o("div",{id:e.getId?e.getId():"",className:S("paragraph",E(e)),...N(e),children:[r(x,{node:e}),r("p",{dangerouslySetInnerHTML:{__html:a}})]})},$e=({node:e})=>{const a=Y(e);return r($,{children:O.default(a)})},Me=({node:e})=>{const a=e.getDocument(),n=a.getAttribute("toc-placement")==="preamble"&&a.hasSections()&&a.hasAttribute("toc");return r("div",{id:"preamble",...N(e),children:o("div",{className:"sectionbody",children:[r(L,{blocks:e.getBlocks()}),n&&o("div",{id:"toc",className:a.getAttribute("toc-class","toc"),children:[r("div",{id:"toctitle",children:O.default(a.getAttribute("toc-title"))}),r(q,{node:a})]})]})})},Be=({node:e})=>{const a=e.getAttribute("attribution"),n=e.getAttribute("citetitle"),l=Y(e);return o("div",{id:e.getId?e.getId():"",className:S("quoteblock",E(e)),...N(e),children:[r(x,{node:e}),r("blockquote",{dangerouslySetInnerHTML:{__html:l}}),a&&o("div",{className:"attribution",children:["\u2014 ",a,n&&r("cite",{children:n})]})]})},We=({node:e})=>{const a=e.getDocument().getAttributes(),n=e.getLevel();let l="",f=e.getSectionNumeral();f=f==="."?"":f;const c=a.sectnumlevels?parseInt(a.sectnumlevels):3;if(e.getCaption())l=e.getCaptionedTitle();else if(e.isNumbered()&&n<=c)if(n<2&&e.getDocument().getDoctype()=="book"){const y=e.getSectionName();y==="chapter"?l=`${a["chapter-signifier"]||""} ${f} ${e.getTitle()}`:y==="part"?l=`${a["part-signifier"]||""} ${f} ${e.getTitle()}`:l=`${f} ${e.getTitle()}`}else l=`${f} ${e.getTitle()}`;else l=e.getTitle()||"";return a.sectlinks&&(l=o($,{children:[r("a",{className:"anchor",id:e.getId()||"",...N(e)}),r("a",{className:"link",href:`#${e.getId()}`,dangerouslySetInnerHTML:{__html:l}})]})),n===0?o($,{children:[r("h1",{className:S("sect0",E(e)),"data-sectnum":f,...N(e),children:l}),r(L,{blocks:e.getBlocks()})]}):o("div",{className:S(`sect${n}`,E(e)),...N(e),children:[k.createElement(`h${n+1}`,{"data-sectnum":f},l),r("div",{className:"sectionbody",children:r(L,{blocks:e.getBlocks()})})]})},Ye=({node:e})=>r("div",{className:S("sidebarblock",E(e)),...N(e),children:o("div",{className:"content",children:[r(x,{node:e}),r(L,{blocks:e.getBlocks()})]})}),Ue=({node:e})=>{let a=["frame-"+e.getAttribute("frame","all","table-frame"),"grid-"+e.getAttribute("grid","all","table-grid")],n=e.getAttribute("stripes",null,"table-stripes");n&&a.push("stripes-"+n);let l=e.hasAutowidthOption(),f=e.getAttribute("tablepcwidth"),c=null;l&&!e.hasAttribute("width")?a.push("fit-content"):f==100?a.push("stretch"):c=`${f}%`,e.hasAttribute("float")&&a.push(e.getAttribute("float")),e.getRole()&&a.push(e.getRole()||"");const y=e.getRowCount(),m=e.getColumns(),g=e.getHeadRows(),v=e.getBodyRows(),b=e.getFootRows(),I=T=>S("tableblock",`halign-${T.getAttribute("halign")}`,`valign-${T.getAttribute("valign")}`);return o("table",{className:S("tableblock",...a),style:{width:c||void 0},...N(e),children:[e.hasTitle()&&r("caption",{className:"title",children:e.getCaptionedTitle()}),y>0&&r("colgroup",{children:m.map((T,j)=>{const P=T.getAttribute("colpcwidth");return r("col",{style:{width:`${P}%`}},j)})}),g.map((T,j)=>r("thead",{children:r("tr",{children:T.map((P,M)=>r("th",{className:I(P),dangerouslySetInnerHTML:{__html:P.getText()}},M))})},j)),r("tbody",{children:v.map((T,j)=>r("tr",{children:T.map((P,M)=>{const fe=P.getColumnSpan(),U=P.getRowSpan(),w=Y(P),V={colSpan:fe,rowSpan:U,className:I(P)},Z=P.getStyle();if(Z==="asciidoc")return k.createElement("td",{...V,key:M},r("div",{className:"content",dangerouslySetInnerHTML:{__html:w}}));if(Z==="literal")return k.createElement("td",{...V,key:M},r("div",{className:"literal",children:r("pre",{dangerouslySetInnerHTML:{__html:w}})}));if(Z==="header")return k.createElement("th",{...V,key:M},r("p",{className:"tableblock",dangerouslySetInnerHTML:{__html:w}}));{let ae=w;return k.createElement("td",{...V,key:M},ae.length===0?"":O.default(`<p class="tableblock">${ae.join(`</p>
|
|
32
|
-
<p class="tableblock">`)}</p>`))}})},j))}),
|
|
31
|
+
*/(function(e){(function(){var a={}.hasOwnProperty;function i(){for(var l=[],f=0;f<arguments.length;f++){var c=arguments[f];if(!!c){var h=typeof c;if(h==="string"||h==="number")l.push(c);else if(Array.isArray(c)){if(c.length){var y=i.apply(null,c);y&&l.push(y)}}else if(h==="object"){if(c.toString!==Object.prototype.toString&&!c.toString.toString().includes("[native code]")){l.push(c.toString());continue}for(var g in c)a.call(c,g)&&c[g]&&l.push(g)}}}return l.join(" ")}e.exports?(i.default=i,e.exports=i):window.classNames=i})()})(Se);const S=Se.exports,we=({node:e})=>{const a=e.getStyle(),i=c=>{const h=c,y=h[0];let g=h[1];return g.getNodeName||(g=null),{terms:y,dd:g}},l=c=>{if(c)return o("dd",{children:[c.hasText()&&r("p",{children:O.default($(c))}),c.hasBlocks()&&r(L,{blocks:c.getBlocks()})]})},f=e.hasTitle()&&r("div",{className:"title",children:e.getCaptionedTitle()});if(a==="qanda")return o("div",{className:S("qlist qanda",E(e)),...N(e),children:[f,r("ol",{children:e.getItems().map((c,h)=>{const{terms:y,dd:g}=i(c);return o("li",{children:[y.map((T,v)=>r("p",{children:r("em",{children:$(T)})},v)),l(g)]},h)})})]});if(a==="horizontal"){const c=e.getAttribute("labelwidth"),h=e.getAttribute("itemwidth");return o("div",{className:S("hdlist",E(e)),children:[f,o("table",{children:[(c||h)&&o("colgroup",{children:[r("col",{style:{width:c?`${c.replace("%","")}%`:""}}),r("col",{style:{width:h?`${h.replace("%","")}%`:""}})]}),r("tbody",{children:e.getItems().map((y,g)=>{const{terms:T,dd:v}=i(y);return o("tr",{children:[r("td",{className:S("hdlist1",e.isOption("strong")?"strong":""),children:T.map((I,_)=>o(k.Fragment,{children:[_!==0&&r("br",{}),O.default($(I))]},_))}),v&&o("td",{className:"hdlist2",children:[v.hasText()&&r("p",{children:O.default($(v))}),v.hasBlocks()&&r(L,{blocks:v.getBlocks()})]})]},g)})})]})]})}else return o("div",{className:S("dlist",e.getStyle(),E(e)),children:[f,r("dl",{children:e.getItems().map((c,h)=>{const{terms:y,dd:g}=i(c);return o(k.Fragment,{children:[y.map((T,v)=>r("dt",{className:"hdlist1",children:O.default($(T))},v)),l(g)]},h)})})]})},ee=({node:e,opts:a})=>{if(!e.hasSections())return null;const i=e.getSections(),l=e.getDocument(),f=k.useMemo(()=>l.getAttributes(),[e]),c=k.useMemo(()=>l.getAttribute("sectnumlevels"),[e]),h=k.useMemo(()=>l.getAttribute("toclevels"),[e]),y=(a==null?void 0:a.sectNumLevels)||(c?parseInt(c):3),g=(a==null?void 0:a.tocLevels)||(h?parseInt(h):2);return r("ul",{className:`sectlevel${i[0].getLevel()}`,children:i.map(T=>{let v=T.$sectnum();v=v==="."||v===".."?"":v;const I=T.getLevel();let _="";if(T.getCaption())_=T.getCaptionedTitle();else if(I<=y)if(I<2&&l.getDoctype()=="book"){const j=T.getSectionName();j==="chapter"?_=`${f["chapter-signifier"]||""} ${v} ${T.getTitle()}`:j==="part"?_=`${f["part-signifier"]||""} ${v} ${T.getTitle()}`:_=`${v} ${T.getTitle()}`}else _=`${v} ${T.getTitle()}`;else _=T.getTitle()||"";return o("li",{children:[r("a",{href:`#${T.getId()}`,children:O.default(_)}),I<g&&r(ee,{node:T,opts:{tocLevels:g,sectNumLevels:y}})]},T.getId())})})},Ce=({document:e})=>{const a=e.getBlocks(),i=e.getFootnotes(),l=()=>{var h;return e.getNoheader()?null:r("div",{id:"header",children:e.hasHeader()&&o(M,{children:[r("h1",{dangerouslySetInnerHTML:{__html:((h=e.getDocumentTitle())==null?void 0:h.toString())||""}}),r(c,{}),e.hasSections()&&e.hasAttribute("toc")&&e.getAttribute("toc-placement")==="auto"&&o("div",{id:"toc",className:e.getAttribute("toc-class","toc"),children:[r("div",{id:"toctitle",children:e.getAttribute("toc-title")}),r(ee,{node:e})]})]})})},f=()=>i&&i.length>0&&a&&!a[0].getDocument().hasAttribute("nofootnotes")?o("div",{id:"footnotes",children:[r("hr",{}),i.map(h=>o("div",{className:"footnote",id:`_footnotedef_${h.getIndex()}`,children:[r("a",{href:`#_footnoteref_${h.getIndex()}`,children:h.getIndex()}),"."," ",O.default($(h)||"")]},h.getIndex()))]}):null,c=()=>e.getAuthors().length>0||e.hasAttribute("revnumber")||e.hasAttribute("revdate")||e.hasAttribute("revremark")?o("div",{className:"details",children:[e.getAuthors().map((y,g)=>o(k.Fragment,{children:[y.getName()&&o(M,{children:[r("span",{id:`author${g+1>1?g+1:""}`,className:"author",children:O.default(e.applySubstitutions(y.getName()||"").toString())}),r("br",{})]}),y.getEmail()&&o(M,{children:[r("span",{id:`email${g+1>1?g+1:""}`,className:"email",children:O.default(e.applySubstitutions(y.getEmail()||"").toString())}),r("br",{})]})]},g)),e.hasAttribute("revnumber")&&r("span",{id:"revnumber",children:`${e.getAttribute("version-label").toLowerCase()} ${e.getAttribute("revnumber")}${e.hasAttribute("revdate")?",":""}`}),e.hasAttribute("revdate")&&r("span",{id:"revdate",children:e.getAttribute("revdate")}),e.hasAttribute("revremark")&&o(M,{children:[r("br",{}),r("span",{id:"revremark",children:e.getAttribute("revremark")})]})]}):null;return o(M,{children:[r(l,{}),r("div",{id:"content",children:r(L,{blocks:a})}),r(f,{})]})},Oe=({node:e})=>o("div",{className:S("exampleblock",E(e)),...N(e),children:[r(Z,{node:e}),r("div",{className:"content",children:r(L,{blocks:e.getBlocks()})})]}),Ie=({node:e})=>{const a=e.getLevel();return o(M,{children:[r("a",{className:"sectionanchor",id:`${e.getId()||""}`,...N(e)}),k.createElement(`h${a+1}`,null,r(F,{node:e}))]})},Pe=({node:e})=>{const a=e.getAttribute("target");let i=r("img",{src:e.getImageUri(a),alt:e.getAttribute("alt"),width:e.getAttribute("width"),height:e.getAttribute("height")});return e.hasAttribute("link")&&(i=r("a",{className:"image",href:e.getAttribute("link"),children:i})),o("div",{className:`imageblock ${e.hasAttribute("align")?"text-"+e.getAttribute("align"):""} ${e.hasAttribute("float")?e.getAttribute("float"):""} ${e.getRole()?e.getRole():""}`,...N(e),children:[r("div",{className:"content",children:i}),r(Z,{node:e})]})},je=({node:e})=>{const a=e.getDocument(),i=e.getAttributes(),l=e.isOption("nowrap")||!a.hasAttribute("prewrap"),f=U(e);if(e.getStyle()==="source"){const c=i.language;return o("div",{className:"listingblock",...N(e),children:[r(Z,{node:e}),r("div",{className:"content",children:r("pre",{className:S("highlight",l?" nowrap":""),children:c?r("code",{className:c?`language-${c}`:"","data-lang":c,dangerouslySetInnerHTML:{__html:f}}):r("code",{dangerouslySetInnerHTML:{__html:f}})})})]})}else return o("div",{className:"listingblock",...N(e),children:[r(Z,{node:e}),r("div",{className:"content",children:r("pre",{className:l?" nowrap":"",children:r("code",{dangerouslySetInnerHTML:{__html:e.getSource()}})})})]})},Le=({node:e})=>{const i=e.getDocument().getAttributes().prewrap===void 0||e.isOption("nowrap");return o("div",{className:"literalblock",...N(e),children:[r(F,{node:e}),r("div",{className:"content",children:r("pre",{className:i?"nowrap":"",children:e.getSource()})})]})},De=({node:e})=>o("div",{className:S("olist",E(e),e.getStyle()),...N(e),children:[r(F,{node:e}),r("ol",{className:e.getStyle(),reversed:e.isOption("reversed"),start:e.getAttribute("start"),children:e.getItems().map((a,i)=>o("li",{className:E(e)?E(e):"",children:[r("p",{children:O.default($(a))}),r(L,{blocks:a.getBlocks()})]},i))})]}),Fe=({node:e})=>{const a=e.getStyle();return a==="abstract"?o("div",{className:S("quoteblock abstract",E(e)),...N(e),children:[r(F,{node:e}),r("blockquote",{className:"content",children:r(L,{blocks:e.getBlocks()})})]}):o("div",{className:S("openblock",a&&a!=="open"?a:"",E(e)),...N(e),children:[r(F,{node:e}),r("div",{className:"content",children:r(L,{blocks:e.getBlocks()})})]})},$e=()=>r("div",{style:{pageBreakAfter:"always"}}),xe=({node:e})=>{const a=U(e);return o("div",{id:e.getId?e.getId():"",className:S("paragraph",E(e)),...N(e),children:[r(F,{node:e}),r("p",{dangerouslySetInnerHTML:{__html:a}})]})},Me=({node:e})=>{const a=U(e);return r(M,{children:O.default(a)})},Be=({node:e})=>{const a=e.getDocument(),i=a.getAttribute("toc-placement")==="preamble"&&a.hasSections()&&a.hasAttribute("toc");return r("div",{id:"preamble",...N(e),children:o("div",{className:"sectionbody",children:[r(L,{blocks:e.getBlocks()}),i&&o("div",{id:"toc",className:a.getAttribute("toc-class","toc"),children:[r("div",{id:"toctitle",children:O.default(a.getAttribute("toc-title"))}),r(ee,{node:a})]})]})})},We=({node:e})=>{const a=e.getAttribute("attribution"),i=e.getAttribute("citetitle"),l=U(e);return o("div",{id:e.getId?e.getId():"",className:S("quoteblock",E(e)),...N(e),children:[r(F,{node:e}),r("blockquote",{dangerouslySetInnerHTML:{__html:l}}),a&&o("div",{className:"attribution",children:["\u2014 ",a,i&&r("cite",{children:i})]})]})},Ye=({node:e})=>{const a=e.getDocument().getAttributes(),i=e.getLevel();let l="",f=e.getSectionNumeral();f=f==="."?"":f;const c=a.sectnumlevels?parseInt(a.sectnumlevels):3;if(e.getCaption())l=e.getCaptionedTitle();else if(e.isNumbered()&&i<=c)if(i<2&&e.getDocument().getDoctype()=="book"){const h=e.getSectionName();h==="chapter"?l=`${a["chapter-signifier"]||""} ${f} ${e.getTitle()}`:h==="part"?l=`${a["part-signifier"]||""} ${f} ${e.getTitle()}`:l=`${f} ${e.getTitle()}`}else l=`${f} ${e.getTitle()}`;else l=e.getTitle()||"";return a.sectlinks&&(l=o(M,{children:[r("a",{className:"anchor",id:e.getId()||"",...N(e)}),r("a",{className:"link",href:`#${e.getId()}`,dangerouslySetInnerHTML:{__html:l}})]})),i===0?o(M,{children:[r("h1",{className:S("sect0",E(e)),"data-sectnum":f,...N(e),children:l}),r(L,{blocks:e.getBlocks()})]}):o("div",{className:S(`sect${i}`,E(e)),...N(e),children:[k.createElement(`h${i+1}`,{"data-sectnum":f},l),r("div",{className:"sectionbody",children:r(L,{blocks:e.getBlocks()})})]})},Ue=({node:e})=>r("div",{className:S("sidebarblock",E(e)),...N(e),children:o("div",{className:"content",children:[r(F,{node:e}),r(L,{blocks:e.getBlocks()})]})}),He=({node:e})=>{let a=["frame-"+e.getAttribute("frame","all","table-frame"),"grid-"+e.getAttribute("grid","all","table-grid")],i=e.getAttribute("stripes",null,"table-stripes");i&&a.push("stripes-"+i);let l=e.hasAutowidthOption(),f=e.getAttribute("tablepcwidth"),c=null;l&&!e.hasAttribute("width")?a.push("fit-content"):f==100?a.push("stretch"):c=`${f}%`,e.hasAttribute("float")&&a.push(e.getAttribute("float")),e.getRole()&&a.push(e.getRole()||"");const h=e.getRowCount(),y=e.getColumns(),g=e.getHeadRows(),T=e.getBodyRows(),v=e.getFootRows(),I=_=>S("tableblock",`halign-${_.getAttribute("halign")}`,`valign-${_.getAttribute("valign")}`);return o("table",{className:S("tableblock",...a),style:{width:c||void 0},...N(e),children:[e.hasTitle()&&r("caption",{className:"title",children:e.getCaptionedTitle()}),h>0&&r("colgroup",{children:y.map((_,j)=>{const P=_.getAttribute("colpcwidth");return r("col",{style:{width:`${P}%`}},j)})}),g.map((_,j)=>r("thead",{children:r("tr",{children:_.map((P,B)=>r("th",{className:I(P),dangerouslySetInnerHTML:{__html:$(P)}},B))})},j)),r("tbody",{children:T.map((_,j)=>r("tr",{children:_.map((P,B)=>{const de=P.getColumnSpan(),H=P.getRowSpan(),w=U(P),J={colSpan:de,rowSpan:H,className:I(P)},te=P.getStyle();if(te==="asciidoc")return k.createElement("td",{...J,key:B},r("div",{className:"content",dangerouslySetInnerHTML:{__html:w}}));if(te==="literal")return k.createElement("td",{...J,key:B},r("div",{className:"literal",children:r("pre",{dangerouslySetInnerHTML:{__html:w}})}));if(te==="header")return k.createElement("th",{...J,key:B},r("p",{className:"tableblock",dangerouslySetInnerHTML:{__html:w}}));{let ie=w;return k.createElement("td",{...J,key:B},ie.length===0?"":O.default(`<p class="tableblock">${ie.join(`</p>
|
|
32
|
+
<p class="tableblock">`)}</p>`))}})},j))}),v.map((_,j)=>r("tfoot",{children:r("tr",{children:_.map((P,B)=>r("td",{className:I(P),children:r("p",{className:"tableblock",dangerouslySetInnerHTML:{__html:$(P)}})},B))})},j))]})},Ve=({node:e})=>{let a=e.getId()||"toc";const i=e.getDocument(),l=e.hasTitle()?e.getTitle():i.getAttribute("toc-title"),f=k.useMemo(()=>i.getAttribute("toc-placement"),[e]),c=k.useMemo(()=>i.hasAttribute("toc"),[e]),h=e.hasAttribute("levels")?parseInt(e.getAttribute("levels")):void 0;return f==="macro"&&i.hasSections()&&c?o("div",{id:a,className:S("toc",E(e)),children:[r("div",{id:`${a}title`,className:"title",children:O.default(l||"")}),r(ee,{node:e.getDocument(),opts:{tocLevels:h}})]}):null},Ge=()=>r("hr",{}),Je=({node:e})=>{const a=e.isOption("checklist");return o("div",{id:e.getId?e.getId():"",className:S("ulist",e.getStyle(),E(e),a&&"checklist"),...N(e),children:[r(F,{node:e}),r("ul",{className:a?"checklist":"",children:e.getItems().map((i,l)=>a?r("li",{id:i.getId(),className:E(e),children:o("p",{children:[a&&i.hasAttribute("checkbox")&&r("i",{className:S("fa",i.hasAttribute("checked")?"fa-check-square-o":"fa-square-o")})," ",O.default($(i))]})},l):o("li",{id:i.getId(),className:E(e),children:[r("p",{dangerouslySetInnerHTML:{__html:$(i)}}),r(L,{blocks:i.getBlocks()})]},l))})]})},ze=({node:e})=>{const a=e.getAttribute("attribution"),i=e.getAttribute("citetitle"),l=U(e);return o("div",{id:e.getId?e.getId():"",className:S("verseblock",E(e)),...N(e),children:[r(F,{node:e}),r("pre",{className:"content",dangerouslySetInnerHTML:{__html:l}}),a&&o("div",{className:"attribution",children:["\u2014 ",a,i&&r("cite",{children:i})]})]})},Ke=k.createContext({}),kt=({content:e,options:a})=>{const i=a&&a.customDocument;return r(Ke.Provider,{value:a||{},children:i?r(i,{document:e}):r(Ce,{document:e})})},L=({blocks:e})=>r(M,{children:e.map((a,i)=>r(Rt,{node:a},`${i}-${a.getNodeName()}`))}),Rt=({node:e})=>{const a=k.useContext(Ke),i=e.getNodeName(),l=e.getDocument(),f=e.getAttributes();l.playbackAttributes(f);const c=a&&a.overrides&&a.overrides[i];if(c)return r(c,{node:e});switch(i){case"audio":return r(Re,{node:e});case"preamble":return r(Be,{node:e});case"section":return r(Ye,{node:e});case"paragraph":return r(xe,{node:e});case"dlist":return r(we,{node:e});case"ulist":return r(Je,{node:e});case"floating_title":return r(Ie,{node:e});case"admonition":return r(ke,{node:e});case"listing":return r(je,{node:e});case"literal":return r(Le,{node:e});case"image":return r(Pe,{node:e});case"colist":return r(Ee,{node:e});case"olist":return r(De,{node:e});case"table":return r(He,{node:e});case"thematic_break":return r(Ge,{});case"open":return r(Fe,{node:e});case"pass":return r(Me,{node:e});case"page_break":return r($e,{});case"example":return r(Oe,{node:e});case"sidebar":return r(Ue,{node:e});case"quote":return r(We,{node:e});case"verse":return r(ze,{node:e});case"toc":return r(Ve,{node:e});default:return r(M,{children:O.default(e.convert())})}};Object.defineProperty(d,"asciidoctor",{enumerable:!0,get:()=>Tt.default}),d.Admonition=ke,d.Audio=Re,d.CaptionedTitle=Z,d.CoList=Ee,d.Content=L,d.DList=we,d.Document=Ce,d.Example=Oe,d.FloatingTitle=Ie,d.Image=Pe,d.Listing=je,d.Literal=Le,d.OList=De,d.Open=Fe,d.Outline=ee,d.PageBreak=$e,d.Paragraph=xe,d.Pass=Me,d.Preamble=Be,d.Quote=We,d.Section=Ye,d.Sidebar=Ue,d.Table=He,d.TableOfContents=Ve,d.ThematicBreak=Ge,d.Title=F,d.UList=Je,d.Verse=ze,d.default=kt,d.getLineNumber=N,d.getRole=E,d.useGetContent=U,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { AbstractBlock, Block, Table } from '@asciidoctor/core';
|
|
1
|
+
import type { AbstractBlock, Block, Document, ListItem, Table } from '@asciidoctor/core';
|
|
2
2
|
type Node = Block | AbstractBlock | Table.Cell;
|
|
3
3
|
declare const useGetContent: (node: Node) => string;
|
|
4
|
-
|
|
4
|
+
declare const useGetText: (node: ListItem | Document.Footnote | Table.Cell) => string;
|
|
5
|
+
export { useGetContent, useGetText };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import asciidoctor from '@asciidoctor/core';
|
|
3
3
|
import type { AbstractBlock } from '@asciidoctor/core';
|
|
4
4
|
import type * as AdocTypes from '@asciidoctor/core';
|
|
5
|
-
import useGetContent from './hooks/useGetContent';
|
|
5
|
+
import { useGetContent } from './hooks/useGetContent';
|
|
6
6
|
import { Admonition, Audio, CoList, DList, Document, Example, FloatingTitle, Image, Listing, Literal, OList, Open, PageBreak, Paragraph, Pass, Preamble, Quote, Section, Sidebar, Table, TableOfContents, ThematicBreak, UList, Verse } from './templates';
|
|
7
7
|
import { CaptionedTitle, Title, getLineNumber, getRole } from './templates/util';
|
|
8
8
|
type Overrides = {
|