@oxide/react-asciidoc 0.2.8 → 0.2.9--canary.cf652b0.0
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 +1190 -1029
- package/dist/react-asciidoc.umd.cjs +12 -12
- package/dist/types/index.d.ts +12 -9
- package/dist/types/templates/Admonition.d.ts +2 -2
- package/dist/types/templates/Audio.d.ts +2 -2
- package/dist/types/templates/CoList.d.ts +2 -2
- package/dist/types/templates/DList.d.ts +2 -2
- package/dist/types/templates/Document.d.ts +2 -2
- package/dist/types/templates/Example.d.ts +1 -1
- package/dist/types/templates/FloatingTitle.d.ts +2 -2
- package/dist/types/templates/Image.d.ts +2 -2
- package/dist/types/templates/Listing.d.ts +2 -2
- package/dist/types/templates/Literal.d.ts +2 -2
- package/dist/types/templates/OList.d.ts +2 -2
- package/dist/types/templates/Open.d.ts +2 -2
- package/dist/types/templates/Outline.d.ts +3 -3
- package/dist/types/templates/Paragraph.d.ts +2 -2
- package/dist/types/templates/Pass.d.ts +2 -2
- package/dist/types/templates/Preamble.d.ts +2 -2
- package/dist/types/templates/Quote.d.ts +1 -1
- package/dist/types/templates/Section.d.ts +2 -2
- package/dist/types/templates/Sidebar.d.ts +1 -1
- package/dist/types/templates/Table.d.ts +2 -2
- package/dist/types/templates/TableOfContents.d.ts +1 -1
- package/dist/types/templates/UList.d.ts +2 -2
- package/dist/types/templates/Verse.d.ts +1 -1
- package/dist/types/templates/util.d.ts +2 -12
- package/dist/types/utils/prepareDocument.d.ts +142 -0
- package/package.json +2 -2
- package/dist/types/utils/getContent.d.ts +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(g,J){typeof exports=="object"&&typeof module<"u"?J(exports,require("html-react-parser"),require("react")):typeof define=="function"&&define.amd?define(["exports","html-react-parser","react"],J):(g=typeof globalThis<"u"?globalThis:g||self,J(g.ReactAsciiDoc={},g.parse,g.React))})(this,function(g,J,P){"use strict";const pe=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},w=pe(J),ye=pe(P);var te={exports:{}},G={};/**
|
|
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 Ne;function gt(){if(Ne)return G;Ne=1;var e=ye.default,i=Symbol.for("react.element"),l=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,f=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function n(d,h,A){var p,u={},v=null,E=null;A!==void 0&&(v=""+A),h.key!==void 0&&(v=""+h.key),h.ref!==void 0&&(E=h.ref);for(p in h)s.call(h,p)&&!m.hasOwnProperty(p)&&(u[p]=h[p]);if(d&&d.defaultProps)for(p in h=d.defaultProps,h)u[p]===void 0&&(u[p]=h[p]);return{$$typeof:i,type:d,key:v,ref:E,props:u,_owner:f.current}}return G.Fragment=l,G.jsx=n,G.jsxs=n,G}var K={};/**
|
|
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
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),S=
|
|
21
|
-
`+
|
|
17
|
+
*/var _e;function pt(){return _e||(_e=1,process.env.NODE_ENV!=="production"&&function(){var e=ye.default,i=Symbol.for("react.element"),l=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),n=Symbol.for("react.provider"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),u=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),E=Symbol.for("react.offscreen"),x=Symbol.iterator,I="@@iterator";function q(t){if(t===null||typeof t!="object")return null;var a=x&&t[x]||t[I];return typeof a=="function"?a:null}var W=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function k(t){{for(var a=arguments.length,c=new Array(a>1?a-1:0),b=1;b<a;b++)c[b-1]=arguments[b];Y("error",t,c)}}function Y(t,a,c){{var b=W.ReactDebugCurrentFrame,_=b.getStackAddendum();_!==""&&(a+="%s",c=c.concat([_]));var R=c.map(function(N){return String(N)});R.unshift("Warning: "+a),Function.prototype.apply.call(console[t],console,R)}}var Q=!1,ie=!1,Et=!1,wt=!1,Tt=!1,Je;Je=Symbol.for("react.module.reference");function St(t){return!!(typeof t=="string"||typeof t=="function"||t===s||t===m||Tt||t===f||t===A||t===p||wt||t===E||Q||ie||Et||typeof t=="object"&&t!==null&&(t.$$typeof===v||t.$$typeof===u||t.$$typeof===n||t.$$typeof===d||t.$$typeof===h||t.$$typeof===Je||t.getModuleId!==void 0))}function Ct(t,a,c){var b=t.displayName;if(b)return b;var _=a.displayName||a.name||"";return _!==""?c+"("+_+")":c}function Ge(t){return t.displayName||"Context"}function H(t){if(t==null)return null;if(typeof t.tag=="number"&&k("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 s:return"Fragment";case l:return"Portal";case m:return"Profiler";case f:return"StrictMode";case A:return"Suspense";case p:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case d:var a=t;return Ge(a)+".Consumer";case n:var c=t;return Ge(c._context)+".Provider";case h:return Ct(t,t.render,"ForwardRef");case u:var b=t.displayName||null;return b!==null?b:H(t.type)||"Memo";case v:{var _=t,R=_._payload,N=_._init;try{return H(N(R))}catch{return null}}}return null}var U=Object.assign,Z=0,Ke,Xe,qe,Qe,Ze,et,tt;function rt(){}rt.__reactDisabledLog=!0;function xt(){{if(Z===0){Ke=console.log,Xe=console.info,qe=console.warn,Qe=console.error,Ze=console.group,et=console.groupCollapsed,tt=console.groupEnd;var t={configurable:!0,enumerable:!0,value:rt,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}Z++}}function kt(){{if(Z--,Z===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U({},t,{value:Ke}),info:U({},t,{value:Xe}),warn:U({},t,{value:qe}),error:U({},t,{value:Qe}),group:U({},t,{value:Ze}),groupCollapsed:U({},t,{value:et}),groupEnd:U({},t,{value:tt})})}Z<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ue=W.ReactCurrentDispatcher,fe;function ne(t,a,c){{if(fe===void 0)try{throw Error()}catch(_){var b=_.stack.trim().match(/\n( *(at )?)/);fe=b&&b[1]||""}return`
|
|
18
|
+
`+fe+t}}var de=!1,le;{var Ot=typeof WeakMap=="function"?WeakMap:Map;le=new Ot}function at(t,a){if(!t||de)return"";{var c=le.get(t);if(c!==void 0)return c}var b;de=!0;var _=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var R;R=ue.current,ue.current=null,xt();try{if(a){var N=function(){throw Error()};if(Object.defineProperty(N.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(N,[])}catch($){b=$}Reflect.construct(t,[],N)}else{try{N.call()}catch($){b=$}t.call(N.prototype)}}else{try{throw Error()}catch($){b=$}t()}}catch($){if($&&b&&typeof $.stack=="string"){for(var y=$.stack.split(`
|
|
19
|
+
`),j=b.stack.split(`
|
|
20
|
+
`),S=y.length-1,O=j.length-1;S>=1&&O>=0&&y[S]!==j[O];)O--;for(;S>=1&&O>=0;S--,O--)if(y[S]!==j[O]){if(S!==1||O!==1)do if(S--,O--,O<0||y[S]!==j[O]){var D=`
|
|
21
|
+
`+y[S].replace(" at new "," at ");return t.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",t.displayName)),typeof t=="function"&&le.set(t,D),D}while(S>=1&&O>=0);break}}}finally{de=!1,ue.current=R,kt(),Error.prepareStackTrace=_}var z=t?t.displayName||t.name:"",vt=z?ne(z):"";return typeof t=="function"&&le.set(t,vt),vt}function Pt(t,a,c){return at(t,!1)}function At(t){var a=t.prototype;return!!(a&&a.isReactComponent)}function se(t,a,c){if(t==null)return"";if(typeof t=="function")return at(t,At(t));if(typeof t=="string")return ne(t);switch(t){case A:return ne("Suspense");case p:return ne("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case h:return Pt(t.render);case u:return se(t.type,a,c);case v:{var b=t,_=b._payload,R=b._init;try{return se(R(_),a,c)}catch{}}}return""}var ce=Object.prototype.hasOwnProperty,it={},nt=W.ReactDebugCurrentFrame;function oe(t){if(t){var a=t._owner,c=se(t.type,t._source,a?a.type:null);nt.setExtraStackFrame(c)}else nt.setExtraStackFrame(null)}function It(t,a,c,b,_){{var R=Function.call.bind(ce);for(var N in t)if(R(t,N)){var y=void 0;try{if(typeof t[N]!="function"){var j=Error((b||"React class")+": "+c+" type `"+N+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[N]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw j.name="Invariant Violation",j}y=t[N](a,N,b,c,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(S){y=S}y&&!(y instanceof Error)&&(oe(_),k("%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).",b||"React class",c,N,typeof y),oe(null)),y instanceof Error&&!(y.message in it)&&(it[y.message]=!0,oe(_),k("Failed %s type: %s",c,y.message),oe(null))}}}var Lt=Array.isArray;function me(t){return Lt(t)}function jt(t){{var a=typeof Symbol=="function"&&Symbol.toStringTag,c=a&&t[Symbol.toStringTag]||t.constructor.name||"Object";return c}}function Dt(t){try{return lt(t),!1}catch{return!0}}function lt(t){return""+t}function st(t){if(Dt(t))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",jt(t)),lt(t)}var ee=W.ReactCurrentOwner,Ft={key:!0,ref:!0,__self:!0,__source:!0},ct,ot,he;he={};function Mt(t){if(ce.call(t,"ref")){var a=Object.getOwnPropertyDescriptor(t,"ref").get;if(a&&a.isReactWarning)return!1}return t.ref!==void 0}function Wt(t){if(ce.call(t,"key")){var a=Object.getOwnPropertyDescriptor(t,"key").get;if(a&&a.isReactWarning)return!1}return t.key!==void 0}function Bt(t,a){if(typeof t.ref=="string"&&ee.current&&a&&ee.current.stateNode!==a){var c=H(ee.current.type);he[c]||(k('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',H(ee.current.type),t.ref),he[c]=!0)}}function Ht(t,a){{var c=function(){ct||(ct=!0,k("%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)",a))};c.isReactWarning=!0,Object.defineProperty(t,"key",{get:c,configurable:!0})}}function $t(t,a){{var c=function(){ot||(ot=!0,k("%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)",a))};c.isReactWarning=!0,Object.defineProperty(t,"ref",{get:c,configurable:!0})}}var Ut=function(t,a,c,b,_,R,N){var y={$$typeof:i,type:t,key:a,ref:c,props:N,_owner:R};return y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(y,"_self",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.defineProperty(y,"_source",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y};function Yt(t,a,c,b,_){{var R,N={},y=null,j=null;c!==void 0&&(st(c),y=""+c),Wt(a)&&(st(a.key),y=""+a.key),Mt(a)&&(j=a.ref,Bt(a,_));for(R in a)ce.call(a,R)&&!Ft.hasOwnProperty(R)&&(N[R]=a[R]);if(t&&t.defaultProps){var S=t.defaultProps;for(R in S)N[R]===void 0&&(N[R]=S[R])}if(y||j){var O=typeof t=="function"?t.displayName||t.name||"Unknown":t;y&&Ht(N,O),j&&$t(N,O)}return Ut(t,y,j,_,b,ee.current,N)}}var be=W.ReactCurrentOwner,ut=W.ReactDebugCurrentFrame;function V(t){if(t){var a=t._owner,c=se(t.type,t._source,a?a.type:null);ut.setExtraStackFrame(c)}else ut.setExtraStackFrame(null)}var ve;ve=!1;function ge(t){return typeof t=="object"&&t!==null&&t.$$typeof===i}function ft(){{if(be.current){var t=H(be.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 Vt(t){{if(t!==void 0){var a=t.fileName.replace(/^.*[\\\/]/,""),c=t.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+
|
|
25
|
+
Check your code at `+a+":"+c+"."}return""}}var dt={};function zt(t){{var a=ft();if(!a){var c=typeof t=="string"?t:t.displayName||t.name;c&&(a=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+
|
|
27
|
+
Check the top-level render call using <`+c+">.")}return a}}function mt(t,a){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var c=zt(a);if(dt[c])return;dt[c]=!0;var b="";t&&t._owner&&t._owner!==be.current&&(b=" It was passed a child from "+H(t._owner.type)+"."),V(t),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',c,b),V(null)}}function ht(t,a){{if(typeof t!="object")return;if(me(t))for(var c=0;c<t.length;c++){var b=t[c];ge(b)&&mt(b,a)}else if(ge(t))t._store&&(t._store.validated=!0);else if(t){var _=q(t);if(typeof _=="function"&&_!==t.entries)for(var R=_.call(t),N;!(N=R.next()).done;)ge(N.value)&&mt(N.value,a)}}}function Jt(t){{var a=t.type;if(a==null||typeof a=="string")return;var c;if(typeof a=="function")c=a.propTypes;else if(typeof a=="object"&&(a.$$typeof===h||a.$$typeof===u))c=a.propTypes;else return;if(c){var b=H(a);It(c,t.props,"prop",b,t)}else if(a.PropTypes!==void 0&&!ve){ve=!0;var _=H(a);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",_||"Unknown")}typeof a.getDefaultProps=="function"&&!a.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Gt(t){{for(var a=Object.keys(t.props),c=0;c<a.length;c++){var b=a[c];if(b!=="children"&&b!=="key"){V(t),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",b),V(null);break}}t.ref!==null&&(V(t),k("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function bt(t,a,c,b,_,R){{var N=St(t);if(!N){var y="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(y+=" 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 j=Vt(_);j?y+=j:y+=ft();var S;t===null?S="null":me(t)?S="array":t!==void 0&&t.$$typeof===i?(S="<"+(H(t.type)||"Unknown")+" />",y=" Did you accidentally export a JSX literal instead of a component?"):S=typeof t,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",S,y)}var O=Yt(t,a,c,_,R);if(O==null)return O;if(N){var D=a.children;if(D!==void 0)if(b)if(me(D)){for(var z=0;z<D.length;z++)ht(D[z],t);Object.freeze&&Object.freeze(D)}else k("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 ht(D,t)}return t===s?Gt(O):Jt(O),O}}function Kt(t,a,c){return bt(t,a,c,!0)}function Xt(t,a,c){return bt(t,a,c,!1)}var qt=Xt,Qt=Kt;K.Fragment=s,K.jsx=qt,K.jsxs=Qt}()),K}(function(e){process.env.NODE_ENV==="production"?e.exports=gt():e.exports=pt()})(te);const F=te.exports.Fragment,r=te.exports.jsx,o=te.exports.jsxs,C=({text:e})=>e?r("div",{className:"title",children:w.default(e)}):null,Re=({node:e})=>{const{document:i}=P.useContext(M),l=i.attributes||{},s=e.attributes,f=()=>l.icons==="font"&&!s.icon?r("i",{className:`fa icon-${s.name}`,title:s.textlabel}):r("img",{src:e.iconUri,alt:s.textlabel});return r("div",{className:`admonitionblock ${s.name}`,...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:r("table",{children:r("tbody",{children:o("tr",{children:[r("td",{className:"icon",children:l.icons?f():r("div",{className:"title",children:s.textlabel})}),o("td",{className:"content",children:[r(C,{text:e.title}),e.content&&w.default(e.content)]})]})})})})},Ee=({node:e})=>{const i=e.attributes.start,l=e.attributes.end,s=(i||l)&&`#t=${i||""}`+l?`,${l}`:"";return o("div",{className:"audioblock",...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:[r(C,{text:e.title}),r("div",{className:"content",children:r("audio",{src:`${e.mediaUri}${s}`,autoPlay:e.autoplay,controls:!e.noControls,loop:e.loop,children:"Your browser does not support the audio tag."})})]})},we=({node:e})=>o("div",{className:"colist",...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:[r(C,{text:e.title}),r("table",{children:r("tbody",{children:e.items.map((i,l)=>o("tr",{children:[o("td",{children:[r("i",{className:"conum","data-value":l+1}),r("b",{children:l+1})]}),o("td",{children:[i.text&&w.default(i.text),r(L,{blocks:i.blocks})]})]},l))})})]});var Te={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 c=[],d=0;d<arguments.length;d++){var o=arguments[d];if(!!o){var g=typeof o;if(g==="string"||g==="number")c.push(o);else if(Array.isArray(o)){if(o.length){var y=n.apply(null,o);y&&c.push(y)}}else if(g==="object"){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){c.push(o.toString());continue}for(var h in o)a.call(o,h)&&o[h]&&c.push(h)}}}return c.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Oe);const E=Oe.exports,Ie=({node:e})=>{const a=e.getStyle(),n=o=>{const g=o,y=g[0];let h=g[1];return h.getNodeName||(h=null),{terms:y,dd:h}},c=o=>{if(o)return l("dd",{children:[o.hasText()&&r("p",{children:k.default(L(o))}),o.hasBlocks()&&r(j,{blocks:o.getBlocks()})]})},d=e.hasTitle()&&r("div",{className:"title",children:e.getCaptionedTitle()});if(a==="qanda")return l("div",{className:E("qlist qanda",R(e)),...N(e),children:[d,r("ol",{children:e.getItems().map((o,g)=>{const{terms:y,dd:h}=n(o);return l("li",{children:[y.map((_,v)=>r("p",{children:r("em",{children:k.default(L(_))})},v)),c(h)]},g)})})]});if(a==="horizontal"){const o=e.getAttribute("labelwidth"),g=e.getAttribute("itemwidth");return l("div",{className:E("hdlist",R(e)),children:[d,l("table",{children:[(o||g)&&l("colgroup",{children:[r("col",{style:{width:o?`${o.replace("%","")}%`:""}}),r("col",{style:{width:g?`${g.replace("%","")}%`:""}})]}),r("tbody",{children:e.getItems().map((y,h)=>{const{terms:_,dd:v}=n(y);return l("tr",{children:[r("td",{className:E("hdlist1",e.isOption("strong")?"strong":""),children:_.map((I,w)=>l(P.Fragment,{children:[w!==0&&r("br",{}),k.default(L(I))]},w))}),v&&l("td",{className:"hdlist2",children:[v.hasText()&&r("p",{children:k.default(L(v))}),v.hasBlocks()&&r(j,{blocks:v.getBlocks()})]})]},h)})})]})]})}else return l("div",{className:E("dlist",e.getStyle(),R(e)),children:[d,r("dl",{children:e.getItems().map((o,g)=>{const{terms:y,dd:h}=n(o);return l(P.Fragment,{children:[y.map((_,v)=>r("dt",{className:"hdlist1",children:k.default(L(_))},v)),c(h)]},g)})})]})},re=({node:e,opts:a})=>{if(!e.hasSections())return null;const n=e.getSections(),c=e.getDocument(),d=P.useMemo(()=>c.getAttributes(),[e]),o=P.useMemo(()=>c.getAttribute("sectnumlevels"),[e]),g=P.useMemo(()=>c.getAttribute("toclevels"),[e]),y=(a==null?void 0:a.sectNumLevels)||(o?parseInt(o):3),h=(a==null?void 0:a.tocLevels)||(g?parseInt(g):2);return r("ul",{className:`sectlevel${n[0].getLevel()}`,children:n.map(_=>{let v=_.$sectnum();v=v==="."||v===".."?"":v;const I=_.getLevel();let w="";if(_.getCaption())w=_.getCaptionedTitle();else if(I<=y)if(I<2&&c.getDoctype()=="book"){const B=_.getSectionName();B==="chapter"?w=`${d["chapter-signifier"]||""} ${v} ${_.getTitle()}`:B==="part"?w=`${d["part-signifier"]||""} ${v} ${_.getTitle()}`:w=`${v} ${_.getTitle()}`}else w=`${v} ${_.getTitle()}`;else w=_.getTitle()||"";return l("li",{children:[r("a",{href:`#${_.getId()}`,children:k.default(w)}),I<h&&r(re,{node:_,opts:{tocLevels:h,sectNumLevels:y}})]},_.getId())})})},Pe=({document:e})=>{const a=e.getBlocks(),n=e.getFootnotes(),c=()=>{var g;return e.getNoheader()?null:r("div",{id:"header",children:e.hasHeader()&&l(M,{children:[r("h1",{dangerouslySetInnerHTML:{__html:((g=e.getDocumentTitle())==null?void 0:g.toString())||""}}),r(o,{}),e.hasSections()&&e.hasAttribute("toc")&&e.getAttribute("toc-placement")==="auto"&&l("div",{id:"toc",className:e.getAttribute("toc-class","toc"),children:[r("div",{id:"toctitle",children:e.getAttribute("toc-title")}),r(re,{node:e})]})]})})},d=()=>n&&n.length>0&&a&&!a[0].getDocument().hasAttribute("nofootnotes")?l("div",{id:"footnotes",children:[r("hr",{}),n.map(g=>l("div",{className:"footnote",id:`_footnotedef_${g.getIndex()}`,children:[r("a",{href:`#_footnoteref_${g.getIndex()}`,children:g.getIndex()}),"."," ",k.default(L(g)||"")]},g.getIndex()))]}):null,o=()=>e.getAuthors().length>0||e.hasAttribute("revnumber")||e.hasAttribute("revdate")||e.hasAttribute("revremark")?l("div",{className:"details",children:[e.getAuthors().map((y,h)=>l(P.Fragment,{children:[y.getName()&&l(M,{children:[r("span",{id:`author${h+1>1?h+1:""}`,className:"author",children:k.default(e.applySubstitutions(y.getName()||"").toString())}),r("br",{})]}),y.getEmail()&&l(M,{children:[r("span",{id:`email${h+1>1?h+1:""}`,className:"email",children:k.default(e.applySubstitutions(y.getEmail()||"").toString())}),r("br",{})]})]},h)),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")&&l(M,{children:[r("br",{}),r("span",{id:"revremark",children:e.getAttribute("revremark")})]})]}):null;return l(M,{children:[r(c,{}),r("div",{id:"content",children:r(j,{blocks:a})}),r(d,{})]})},je=({node:e})=>{if(e.isOption("collapsible")){const a=e.isOption("collapsible"),n=e.getTitle()||"Details",c=e.isOption("open")?!0:void 0;if(a)return l("details",{className:R(e),open:c,...N(e),...e.getId()?{id:e.getId()}:{},children:[r("summary",{className:"title",children:k.default(n)}),r("div",{className:"content",children:r(j,{blocks:e.getBlocks()})})]})}return l("div",{className:E("exampleblock",R(e)),...N(e),...e.getId()?{id:e.getId()}:{},children:[r(te,{node:e}),r("div",{className:"content",children:r(j,{blocks:e.getBlocks()})})]})},De=({node:e})=>{const a=e.getLevel();return l(M,{children:[r("a",{className:"sectionanchor",...e.getId()?{id:e.getId()}:{},...N(e)}),P.createElement(`h${a+1}`,{className:E(R(e),e.getStyle())},k.default(e.getTitle()||""))]})},Le=({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})),l("div",{className:`imageblock ${e.hasAttribute("align")?"text-"+e.getAttribute("align"):""} ${e.hasAttribute("float")?e.getAttribute("float"):""} ${e.getRole()?e.getRole():""}`,...N(e),style:{maxWidth:e.getAttribute("width"),maxHeight:e.getAttribute("height")},children:[r("div",{className:"content",children:n}),r(te,{node:e})]})},$e=({node:e})=>{const a=e.getDocument(),n=e.getAttributes(),c=e.isOption("nowrap")||!a.hasAttribute("prewrap"),d=U(e);if(e.getStyle()==="source"){const o=n.language;return l("div",{className:"listingblock",...N(e),children:[r(te,{node:e}),r("div",{className:"content",children:r("pre",{className:E("highlight",c?" nowrap":""),children:o?r("code",{className:o?`language-${o}`:"","data-lang":o,dangerouslySetInnerHTML:{__html:d}}):r("code",{dangerouslySetInnerHTML:{__html:d}})})})]})}else return l("div",{className:"listingblock",...N(e),children:[r(te,{node:e}),r("div",{className:"content",children:r("pre",{className:c?" nowrap":"",children:r("code",{dangerouslySetInnerHTML:{__html:e.getSource()}})})})]})},Fe=({node:e})=>{const n=e.getDocument().getAttributes().prewrap===void 0||e.isOption("nowrap");return l("div",{className:"literalblock",...N(e),children:[r($,{node:e}),r("div",{className:"content",children:r("pre",{className:n?"nowrap":"",children:e.getSource()})})]})},xe=({node:e})=>l("div",{className:E("olist",R(e),e.getStyle()),...N(e),children:[r($,{node:e}),r("ol",{className:e.getStyle(),reversed:e.isOption("reversed"),start:e.getAttribute("start"),children:e.getItems().map((a,n)=>l("li",{className:R(e)?R(e):"",children:[r("p",{children:k.default(L(a))}),r(j,{blocks:a.getBlocks()})]},n))})]}),Me=({node:e})=>{const a=e.getStyle();return a==="abstract"?l("div",{className:E("quoteblock abstract",R(e)),...N(e),children:[r($,{node:e}),r("blockquote",{className:"content",children:r(j,{blocks:e.getBlocks()})})]}):l("div",{className:E("openblock",a&&a!=="open"?a:"",R(e)),...N(e),children:[r($,{node:e}),r("div",{className:"content",children:r(j,{blocks:e.getBlocks()})})]})},Be=()=>r("div",{style:{pageBreakAfter:"always"}}),We=({node:e})=>{const a=U(e);return l("div",{...e.getId()?{id:e.getId()}:{},className:E("paragraph",R(e)),...N(e),children:[r($,{node:e}),r("p",{dangerouslySetInnerHTML:{__html:a}})]})},Ye=({node:e})=>{const a=U(e);return r(M,{children:k.default(a)})},He=({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:l("div",{className:"sectionbody",children:[r(j,{blocks:e.getBlocks()}),n&&l("div",{id:"toc",className:a.getAttribute("toc-class","toc"),children:[r("div",{id:"toctitle",children:k.default(a.getAttribute("toc-title"))}),r(re,{node:a})]})]})})},Ue=({node:e})=>{const a=e.getAttribute("attribution"),n=e.getAttribute("citetitle"),c=U(e);return l("div",{...e.getId()?{id:e.getId()}:{},className:E("quoteblock",R(e)),...N(e),children:[r($,{node:e}),r("blockquote",{dangerouslySetInnerHTML:{__html:c}}),a&&l("div",{className:"attribution",children:["\u2014 ",a,n&&r("cite",{children:n})]})]})},Ve=({node:e})=>{const a=e.getDocument().getAttributes(),n=e.getLevel();let c="",d=e.getSectionNumeral();d=d==="."?"":d;const o=a.sectnumlevels?parseInt(a.sectnumlevels):3;if(e.getCaption())c=e.getCaptionedTitle();else if(e.isNumbered()&&n<=o)if(n<2&&e.getDocument().getDoctype()=="book"){const g=e.getSectionName();g==="chapter"?c=`${a["chapter-signifier"]||""} ${d} ${e.getTitle()}`:g==="part"?c=`${a["part-signifier"]||""} ${d} ${e.getTitle()}`:c=`${d} ${e.getTitle()}`}else c=`${d} ${e.getTitle()}`;else c=e.getTitle()||"";return a.sectlinks&&(c=l(M,{children:[r("a",{className:"anchor",id:e.getId()||"",...N(e)}),r("a",{className:"link",href:`#${e.getId()}`,dangerouslySetInnerHTML:{__html:c}})]})),n===0?l(M,{children:[r("h1",{className:E("sect0",R(e)),"data-sectnum":d,...N(e),children:c}),r(j,{blocks:e.getBlocks()})]}):l("div",{className:E(`sect${n}`,R(e)),...N(e),children:[P.createElement(`h${n+1}`,{"data-sectnum":d},c),r("div",{className:"sectionbody",children:r(j,{blocks:e.getBlocks()})})]})},ze=({node:e})=>r("div",{className:E("sidebarblock",R(e)),...N(e),children:l("div",{className:"content",children:[r($,{node:e}),r(j,{blocks:e.getBlocks()})]})}),Je=({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 c=e.hasAutowidthOption(),d=e.getAttribute("tablepcwidth"),o=null;c&&!e.hasAttribute("width")?a.push("fit-content"):d==100?a.push("stretch"):o=`${d}%`,e.hasAttribute("float")&&a.push(e.getAttribute("float")),e.getRole()&&a.push(e.getRole()||"");const g=e.getRowCount(),y=e.getColumns(),h=e.getHeadRows(),_=e.getBodyRows(),v=e.getFootRows(),I=F=>E("tableblock",`halign-${F.getAttribute("halign")}`,`valign-${F.getAttribute("valign")}`),w=e.getTitle(),B=e.getId(),V=B||St(w||"");return l("table",{className:E("tableblock",...a),style:{width:o||void 0},...N(e),children:[e.hasTitle()&&l("caption",{className:"title",children:[!B&&r("a",{className:"anchor",id:V}),r("a",{href:`#${V}`,children:e.getCaptionedTitle()})]}),g>0&&r("colgroup",{children:y.map((F,W)=>{const C=F.getAttribute("colpcwidth");return r("col",{style:{width:`${C}%`}},W)})}),h.map((F,W)=>r("thead",{children:r("tr",{children:F.map((C,A)=>r("th",{className:I(C),dangerouslySetInnerHTML:{__html:L(C)}},A))})},W)),r("tbody",{children:_.map((F,W)=>r("tr",{children:F.map((C,A)=>{const de=C.getColumnSpan(),me=C.getRowSpan(),K=U(C),G={colSpan:de,rowSpan:me,className:I(C)},ae=C.getStyle();if(ae==="asciidoc")return P.createElement("td",{...G,key:A},r("div",{className:"content",dangerouslySetInnerHTML:{__html:K}}));if(ae==="literal")return P.createElement("td",{...G,key:A},r("div",{className:"literal",children:r("pre",{dangerouslySetInnerHTML:{__html:K}})}));if(ae==="header")return P.createElement("th",{...G,key:A},r("p",{className:"tableblock",dangerouslySetInnerHTML:{__html:K}}));{let le=K;return P.createElement("td",{...G,key:A},le.length===0?"":k.default(`<p class="tableblock">${le.join(`</p>
|
|
32
|
-
<p class="tableblock">`)}</p>`))}})},
|
|
31
|
+
*/(function(e){(function(){var i={}.hasOwnProperty;function l(){for(var s=[],f=0;f<arguments.length;f++){var m=arguments[f];if(!!m){var n=typeof m;if(n==="string"||n==="number")s.push(m);else if(Array.isArray(m)){if(m.length){var d=l.apply(null,m);d&&s.push(d)}}else if(n==="object"){if(m.toString!==Object.prototype.toString&&!m.toString.toString().includes("[native code]")){s.push(m.toString());continue}for(var h in m)i.call(m,h)&&m[h]&&s.push(h)}}}return s.join(" ")}e.exports?(l.default=l,e.exports=l):window.classNames=l})()})(Te);const T=Te.exports,re=(e,i)=>e[`${i}-option`]!==void 0,ae=(e,i,l=void 0,s,f)=>{if(e[i]!==void 0)return e[i];const m=s||i;return m&&f&&f[m]!==void 0?f[m]:l},B=(e,i)=>e[i]!==void 0,yt=e=>{var m;let i;function l(n){const d=n.getNodeName&&n.getNodeName(),h=n.getContentModel&&n.getContentModel(),A=d&&n.hasBlocks()?n.getBlocks().map(u=>l(u)):[];let p={id:n.getId&&n.getId(),type:d,blocks:A,content:A.length>0?void 0:n.getContent&&n.getContent(),attributes:n.getAttributes&&n.getAttributes(),contentModel:h,lineNumber:n.getLineNumber&&n.getLineNumber(),style:n.getStyle&&n.getStyle(),role:n.getRole&&n.getRole(),title:n.hasTitle&&n.hasTitle()?n.getTitle():void 0,level:n.getLevel&&n.getLevel()};if(d==="admonition"){let u=p;u.iconUri=n.getIconUri(p.attributes.name)}if(d==="audio"){let u=p;u.mediaUri=n.getMediaUri(n.getAttribute("target")),u.autoplay=n.isOption("autoplay"),u.noControls=!n.isOption("nocontrols"),u.loop=n.isOption("loop"),p=u}if(d==="image"){let u=p;u.imageUri=n.getImageUri(n.getAttribute("target"))}if((d==="listing"||d==="literal")&&"getSource"in n){const u=p;u.source=n.getSource(),u.language=n.getAttribute("language")}if(d==="section"){const u=p;u.title=n.getCaption()?n.getCaptionedTitle():n.getTitle()||"","getSectionNumeral"in n&&(u.name=n.getSectionName(),u.numbered=n.isNumbered(),u.num=n.getSectionNumeral())}if(d==="dlist"){let u=p;u.items=n.getItems().map(v=>[v[0].map(E=>l(E)),l(v[1])])}if(d==="colist"||d==="olist"||d==="ulist"){let u=p;u.items=n.getItems().map(v=>l(v))}if(d==="list_item"){let u=p;const v=n;u.text=v.hasText()?v.getText():void 0}if(d==="table"){let u=p;const v=n;u.columns=v.getColumns().map(I=>({attributes:I.getAttributes(),columnNumber:I.getColumnNumber(),width:I.getWidth(),horizontalAlign:I.getHorizontalAlign(),verticalAlign:I.getVerticalAlign(),style:I.getStyle()}));const E=I=>I.map(q=>q.map(W=>l(W))),x=v.getRows();u.rows={head:E(x.head),body:E(x.body),foot:E(x.foot)},u={...u,caption:v.getCaption(),hasHeader:v.hasHeaderOption(),hasFooter:v.hasFooterOption(),hasAutowidth:v.hasAutowidthOption(),headRows:E(v.getHeadRows()),bodyRows:E(v.getBodyRows()),footRows:E(v.getFootRows())},p=u}if(d==="table_cell"){const u=n,v=u.getColumn();p={text:u.getText(),columnSpan:u.getColumnSpan(),rowSpan:u.getRowSpan(),source:u.getSource(),lines:u.getLines(),width:u.getWidth(),columnPercentageWidth:u.getColumnPercentageWidth(),column:v?{attributes:v.getAttributes(),columnNumber:v.getColumnNumber(),width:v.getWidth(),horizontalAlign:v.getHorizontalAlign(),verticalAlign:v.getVerticalAlign(),style:v.getStyle()}:void 0,...p}}return p}function s(n){return n.getSections().map(d=>({id:d.getId(),title:(d.getCaption()?d.getCaptionedTitle():d.getTitle())||"",level:d.getLevel(),num:d.getSectionNumber(),sections:s(d)}))}const f=e.getAuthors().map(n=>{const d=n.getName(),h=n.getEmail();return{name:d?e.applySubstitutions(d).toString():void 0,email:h?e.applySubstitutions(h).toString():void 0}});return i={type:"document",title:((m=e.getDocumentTitle())==null?void 0:m.toString())||"",hasHeader:e.hasHeader(),noHeader:e.getNoheader(),contentModel:e.getContentModel(),attributes:e.getAttributes(),footnotes:e.getFootnotes().map(n=>({text:n.getText(),index:n.getIndex()})),blocks:e.getBlocks().map(n=>l(n)),sections:s(e),authors:f},i.footnotes=e.getFootnotes().map(n=>({text:n.getText(),index:n.getIndex()})),i},Se=({node:e})=>{const i=s=>{const f=s,m=f[0];let n=f[1];return n.type||(n=null),{terms:m,dd:n}},l=s=>{if(s)return o("dd",{children:[s.text&&r("p",{children:w.default(s.text)}),r(L,{blocks:s.blocks})]})};if(e.style==="qanda")return o("div",{className:T("qlist qanda",e.role),...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:[r(C,{text:e.title}),r("ol",{children:e.items.map((s,f)=>{const{terms:m,dd:n}=i(s);if(!!m)return o("li",{children:[m.map((d,h)=>r("p",{children:r("em",{children:w.default(d.text)})},h)),l(n)]},f)})})]});if(e.style==="horizontal"){const s=e.attributes.labelwidth,f=e.attributes.itemwidth;return o("div",{className:T("hdlist",e.role),children:[r(C,{text:e.title}),o("table",{children:[(s||f)&&o("colgroup",{children:[r("col",{style:{width:s?`${s.replace("%","")}%`:""}}),r("col",{style:{width:f?`${f.replace("%","")}%`:""}})]}),r("tbody",{children:e.items.map((m,n)=>{const{terms:d,dd:h}=i(m);if(!!d)return o("tr",{children:[r("td",{className:T("hdlist1",re(e.attributes,"strong")?"strong":""),children:d.map((A,p)=>o(P.Fragment,{children:[p!==0&&r("br",{}),w.default(A.text)]},p))}),h&&o("td",{className:"hdlist2",children:[h.text&&r("p",{children:w.default(h.text)}),r(L,{blocks:h.blocks})]})]},n)})})]})]})}else return o("div",{className:T("dlist",e.style,e.role),children:[r(C,{text:e.title}),r("dl",{children:e.items.map((s,f)=>{const{terms:m,dd:n}=i(s);if(!!m)return o(P.Fragment,{children:[m.map((d,h)=>r("dt",{className:"hdlist1",children:w.default(d.text)},h)),l(n)]},f)})})]})},X=({sections:e,opts:i})=>{const{document:l}=P.useContext(M);if(!e||e.length===0)return null;const s=l.attributes||{},f=s.sectnumlevels,m=s.toclevels,n=(i==null?void 0:i.sectNumLevels)||(f?parseInt(f):3),d=(i==null?void 0:i.tocLevels)||(m?parseInt(m):2);return r("ul",{className:`sectlevel${e[0].level}`,children:e.map(h=>{let A=h.num;A=A==="."||A===".."?"":A;const p=h.level;let u=h.title;return p<=n&&(u=`${A} ${h.title}`),o("li",{children:[r("a",{href:`#${h.id}`,children:w.default(u)}),p<d&&r(X,{sections:h.sections,opts:{tocLevels:d,sectNumLevels:n}})]},h.id)})})},Ce=({document:e})=>{const i=()=>e.noHeader?null:r("div",{id:"header",children:e.hasHeader&&o(F,{children:[r("h1",{dangerouslySetInnerHTML:{__html:e.title}}),r(s,{}),e.sections&&e.sections.length>0&&e.attributes.toc!==void 0&&e.attributes["toc-placement"]==="auto"&&o("div",{id:"toc",className:ae(e.attributes,"toc-class","toc"),children:[r("div",{id:"toctitle",children:e.attributes["toc-title"]}),r(X,{sections:e.sections})]})]})}),l=()=>e.footnotes&&e.footnotes.length>0&&e.blocks&&!B(e.attributes,"nofootnotes")?o("div",{id:"footnotes",children:[r("hr",{}),e.footnotes.map(f=>o("div",{className:"footnote",id:`_footnotedef_${f.index}`,children:[r("a",{href:`#_footnoteref_${f.index}`,children:f.index}),"."," ",w.default(f.text||"")]},f.index))]}):null,s=()=>e.authors.length>0||B(e.attributes,"revnumber")||B(e.attributes,"revdate")||B(e.attributes,"revremark")?o("div",{className:"details",children:[e.authors.map((f,m)=>o(P.Fragment,{children:[f.name&&o(F,{children:[r("span",{id:`author${m+1>1?m+1:""}`,className:"author",children:w.default(f.name)}),r("br",{})]}),f.email&&o(F,{children:[r("span",{id:`email${m+1>1?m+1:""}`,className:"email",children:w.default(f.email)}),r("br",{})]})]},m)),B(e.attributes,"revnumber")&&r("span",{id:"revnumber",children:`${e.attributes["version-label"].toLowerCase()} ${e.attributes.revnumber}${e.attributes.revdate?",":""}`}),B(e.attributes,"revdate")&&r("span",{id:"revdate",children:e.attributes.revdate}),B(e.attributes,"revremark")&&o(F,{children:[r("br",{}),r("span",{id:"revremark",children:e.attributes.revremark})]})]}):null;return o(F,{children:[r(i,{}),r("div",{id:"content",children:r(L,{blocks:e.blocks})}),r(l,{})]})},xe=({node:e})=>{if(e.attributes.collapsible){const i=e.attributes.collapsible,l=e.title||"Details",s=e.attributes.open?!0:void 0;if(i)return o("details",{className:e.role,open:s,...e.lineNumber?{"data-lineno":e.lineNumber}:{},...e.id?{id:e.id}:{},children:[r("summary",{className:"title",children:w.default(l)}),r("div",{className:"content",children:r(L,{blocks:e.blocks})})]})}return o("div",{className:T("exampleblock",e.role),...e.lineNumber?{"data-lineno":e.lineNumber}:{},...e.id?{id:e.id}:{},children:[r(C,{text:e.title}),r("div",{className:"content",children:r(L,{blocks:e.blocks})})]})},ke=({node:e})=>o(F,{children:[r("a",{className:"sectionanchor",...e.id?{id:e.id}:{},...e.lineNumber?{"data-lineno":e.lineNumber}:{}}),P.createElement(`h${e.level+1}`,{className:T(e.role,e.style)},w.default(e.title||""))]}),Oe=({node:e})=>{let i=r("img",{src:e.imageUri,alt:e.attributes.alt,width:e.attributes.width,height:e.attributes.height});return e.attributes.link&&(i=r("a",{className:"image",href:e.attributes.link,children:i})),o("div",{className:`imageblock ${e.attributes.align?"text-"+e.attributes.align:""} ${e.attributes.float?e.attributes.float:""} ${e.role?e.role:""}`,...e.lineNumber?{"data-lineno":e.lineNumber}:{},style:{maxWidth:e.attributes.width,maxHeight:e.attributes.height},children:[r("div",{className:"content",children:i}),r(C,{text:e.title})]})},Pe=({node:e})=>{const{document:i}=P.useContext(M),l=e.attributes.nowrap||i.attributes.prewrap;if(e.style==="source"){const s=e.language;return o("div",{className:"listingblock",...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:[r(C,{text:e.title}),r("div",{className:"content",children:r("pre",{className:T("highlight",l?" nowrap":""),children:s?r("code",{className:s?`language-${s}`:"","data-lang":s,dangerouslySetInnerHTML:{__html:e.content||""}}):r("code",{dangerouslySetInnerHTML:{__html:e.content||""}})})})]})}else return o("div",{className:"listingblock",...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:[r(C,{text:e.title}),r("div",{className:"content",children:r("pre",{className:l?" nowrap":"",children:r("code",{dangerouslySetInnerHTML:{__html:e.source}})})})]})},Ae=({node:e})=>{const{document:i}=P.useContext(M),l=i.attributes||{},s=e.attributes.nowrap||l.prewrap===void 0;return o("div",{className:"literalblock",...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:[r(C,{text:e.title}),r("div",{className:"content",children:r("pre",{className:s?"nowrap":"",children:e.source})})]})},Ie=({node:e})=>o("div",{className:T("olist",e.role,e.style),...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:[r(C,{text:e.title}),r("ol",{className:e.style,reversed:re(e.attributes,"reversed"),...e.attributes.start?{start:parseInt(e.attributes.start)}:{},children:e.items.map((i,l)=>o("li",{className:e.role?e.role:"",children:[r("p",{children:w.default(i.text||"")}),r(L,{blocks:i.blocks})]},l))})]}),Le=({node:e})=>{const i=e.style;return i==="abstract"?o("div",{className:T("quoteblock abstract",e.role),...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:[r(C,{text:e.title}),r("blockquote",{className:"content",children:r(L,{blocks:e.blocks})})]}):o("div",{className:T("openblock",i&&i!=="open"?i:"",e.role),...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:[r(C,{text:e.title}),r("div",{className:"content",children:r(L,{blocks:e.blocks})})]})},je=()=>r("div",{style:{pageBreakAfter:"always"}}),De=({node:e})=>o("div",{...e.id?{id:e.id}:{},className:T("paragraph",e.role),...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:[r(C,{text:e.title}),e.content&&r("p",{dangerouslySetInnerHTML:{__html:e.content}})]}),Fe=({node:e})=>r(F,{children:w.default(e.content||"")}),Me=({node:e})=>{const{document:i}=P.useContext(M),l=i.attributes||{},s=l["toc-placement"]==="preamble"&&i.sections&&i.sections.length>0&&l.toc!==void 0;return r("div",{id:"preamble",...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:o("div",{className:"sectionbody",children:[r(L,{blocks:e.blocks}),s&&o("div",{id:"toc",className:e.attributes["toc-class"]?e.attributes["toc-class"]:"toc",children:[r("div",{id:"toctitle",children:w.default(l["toc-title"])}),i.sections&&r(X,{sections:i.sections})]})]})})},We=({node:e})=>{const i=e.attributes.attribution,l=e.attributes.citetitle;return o("div",{...e.id?{id:e.id}:{},className:T("quoteblock",e.role),...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:[r(C,{text:e.title}),e.content&&r("blockquote",{dangerouslySetInnerHTML:{__html:e.content}}),r(L,{blocks:e.blocks}),i&&o("div",{className:"attribution",children:["\u2014 ",i,l&&r("cite",{children:l})]})]})},Be=({node:e})=>{const{document:i}=P.useContext(M),l=i.attributes||{};let s=e.title,f=e.num;f=f==="."?"":f;const m=l.sectnumlevels?parseInt(l.sectnumlevels):3;return e.numbered&&e.level<=m&&(s=`${f} ${e.title}`),l.sectlinks&&(s=o(F,{children:[r("a",{className:"anchor",id:e.id||"",...e.lineNumber?{"data-lineno":e.lineNumber}:{}}),r("a",{className:"link",href:`#${e.id}`,dangerouslySetInnerHTML:{__html:s}})]})),e.level===0?o(F,{children:[r("h1",{className:T("sect0",e.role),"data-sectnum":f,...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:s}),r(L,{blocks:e.blocks})]}):o("div",{className:T(`sect${e.level}`,e.role),...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:[P.createElement(`h${e.level+1}`,{"data-sectnum":f},s),r("div",{className:"sectionbody",children:r(L,{blocks:e.blocks})})]})},He=({node:e})=>r("div",{className:T("sidebarblock",e.role),...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:o("div",{className:"content",children:[r(C,{text:e.title}),r(L,{blocks:e.blocks})]})}),$e=({node:e})=>{const{document:i}=P.useContext(M),l=i.attributes||{};let s=["frame-"+ae(e.attributes,"frame","all","table-frame",l),"grid-"+ae(e.attributes,"grid","all","table-grid",l)],f=ae(e.attributes,"stripes",null,"table-stripes",l);f&&s.push("stripes-"+f);let m=re(e.attributes,"autowidth"),n=parseInt(e.attributes.tablepcwidth),d=null;m&&!B(e.attributes,"width")?s.push("fit-content"):n===100?s.push("stretch"):d=`${n}%`,B(e.attributes,"float")&&s.push(e.attributes.float),e.role&&s.push(e.role||"");const h=v=>T("tableblock",`halign-${v.attributes.halign}`,`valign-${v.attributes.valign}`),A=e.title,p=e.id,u=p||Nt(A||"");return o("table",{className:T("tableblock",...s),style:{width:d||void 0},...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:[e.title&&o("caption",{className:"title",children:[!p&&r("a",{className:"anchor",id:u}),r("a",{href:`#${u}`,children:e.title})]}),e.columns.length>0&&r("colgroup",{children:e.columns.map((v,E)=>{const x=v.attributes.colpcwidth;return r("col",{style:{width:`${x}%`}},E)})}),e.headRows.map((v,E)=>r("thead",{children:r("tr",{children:v.map((x,I)=>r("th",{className:h(x),dangerouslySetInnerHTML:{__html:x.text}},I))})},E)),r("tbody",{children:e.bodyRows.map((v,E)=>r("tr",{children:v.map((x,I)=>{const q=x.columnSpan,W=x.rowSpan,k=x.content,Y={colSpan:q,rowSpan:W,className:h(x)},Q=x.style;if(Q==="asciidoc")return P.createElement("td",{...Y,key:I},r("div",{className:"content",dangerouslySetInnerHTML:{__html:k||""}}));if(Q==="literal")return P.createElement("td",{...Y,key:I},r("div",{className:"literal",children:r("pre",{dangerouslySetInnerHTML:{__html:k||""}})}));if(Q==="header")return P.createElement("th",{...Y,key:I},r("p",{className:"tableblock",dangerouslySetInnerHTML:{__html:k||""}}));{let ie=k;return P.createElement("td",{...Y,key:I},ie.length===0?"":w.default(`<p class="tableblock">${ie.join(`</p>
|
|
32
|
+
<p class="tableblock">`)}</p>`))}})},E))}),e.footRows.map((v,E)=>r("tfoot",{children:r("tr",{children:v.map((x,I)=>r("td",{className:h(x),children:r("p",{className:"tableblock",dangerouslySetInnerHTML:{__html:x.text}})},I))})},E))]})},Nt=e=>e.toString().normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/\s+/g,"_").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/-$/g,""),Ue=({node:e})=>{const{document:i}=P.useContext(M),l=i.attributes||{},s=i.sections&&i.sections.length>0;let f=e.id||"toc";const m=e.title?e.title:l["toc-title"],n=l["toc-placement"],d=l.toc!==void 0,h=e.attributes.levels?parseInt(e.attributes.levels):void 0;return n==="macro"&&s&&d?o("div",{id:f,className:T("toc",e.role),children:[r("div",{id:`${f}title`,className:"title",children:w.default(m||"")}),i.sections&&r(X,{sections:i.sections,opts:{tocLevels:h}})]}):null},Ye=()=>r("hr",{}),Ve=({node:e})=>{const i=re(e.attributes,"checklist");return o("div",{...e.id?{id:e.id}:{},className:T("ulist",e.style,e.role,i&&"checklist"),...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:[r(C,{text:e.title}),r("ul",{className:i?"checklist":"",children:e.items.map((l,s)=>i?r("li",{id:l.id,className:e.role,children:o("p",{children:[i&&l.attributes.checkbox&&r("i",{className:T("fa",l.attributes.checked?"fa-check-square-o":"fa-square-o")})," ",w.default(l.text||"")]})},s):o("li",{id:l.id,className:e.role,children:[r("p",{dangerouslySetInnerHTML:{__html:l.text||""}}),r(L,{blocks:l.blocks})]},s))})]})},ze=({node:e})=>{const i=e.attributes.attribution,l=e.attributes.citetitle;return o("div",{...e.id?{id:e.id}:{},className:T("verseblock",e.role),...e.lineNumber?{"data-lineno":e.lineNumber}:{},children:[r(C,{text:e.title}),e.content&&r("pre",{className:"content",dangerouslySetInnerHTML:{__html:e.content}}),i&&o("div",{className:"attribution",children:["\u2014 ",i,l&&r("cite",{children:l})]})]})},M=P.createContext({document:{}}),_t=({document:e,options:i})=>{const l=i&&i.customDocument;return r(M.Provider,{value:{...i,document:{attributes:e.attributes,sections:e.sections}},children:l?r(l,{document:e}):r(Ce,{document:e})})},L=({blocks:e})=>r(F,{children:e.map((i,l)=>r(Rt,{node:i},`${l}-${i.type}`))}),Rt=({node:e})=>{switch(e.type){case"audio":return r(Ee,{node:e});case"preamble":return r(Me,{node:e});case"section":return r(Be,{node:e});case"paragraph":return r(De,{node:e});case"dlist":return r(Se,{node:e});case"ulist":return r(Ve,{node:e});case"floating_title":return r(ke,{node:e});case"admonition":return r(Re,{node:e});case"listing":return r(Pe,{node:e});case"literal":return r(Ae,{node:e});case"image":return r(Oe,{node:e});case"colist":return r(we,{node:e});case"olist":return r(Ie,{node:e});case"table":return r($e,{node:e});case"thematic_break":return r(Ye,{});case"open":return r(Le,{node:e});case"pass":return r(Fe,{node:e});case"page_break":return r(je,{});case"example":return r(xe,{node:e});case"sidebar":return r(He,{node:e});case"quote":return r(We,{node:e});case"verse":return r(ze,{node:e});case"toc":return r(Ue,{node:e});default:return r(F,{})}};Object.defineProperty(g,"parse",{enumerable:!0,get:()=>w.default}),g.Admonition=Re,g.Audio=Ee,g.CoList=we,g.Content=L,g.Context=M,g.DList=Se,g.Document=Ce,g.Example=xe,g.FloatingTitle=ke,g.Image=Oe,g.Listing=Pe,g.Literal=Ae,g.OList=Ie,g.Open=Le,g.Outline=X,g.PageBreak=je,g.Paragraph=De,g.Pass=Fe,g.Preamble=Me,g.Quote=We,g.Section=Be,g.Sidebar=He,g.Table=$e,g.TableOfContents=Ue,g.ThematicBreak=Ye,g.Title=C,g.UList=Ve,g.Verse=ze,g.default=_t,g.prepareDocument=yt,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import asciidoctor from '@asciidoctor/core';
|
|
3
|
-
import type { AbstractBlock } from '@asciidoctor/core';
|
|
4
|
-
import type * as AdocTypes from '@asciidoctor/core';
|
|
5
2
|
import parse from 'html-react-parser';
|
|
6
3
|
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
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { Title } from './templates/util';
|
|
5
|
+
import { prepareDocument } from './utils/prepareDocument';
|
|
6
|
+
import { DocumentBlock, DocumentSection, Block as PreparedBlock } from './utils/prepareDocument';
|
|
9
7
|
type Overrides = {
|
|
10
8
|
admonition?: typeof Admonition;
|
|
11
9
|
audio?: typeof Audio;
|
|
@@ -34,14 +32,19 @@ type Overrides = {
|
|
|
34
32
|
export type Options = {
|
|
35
33
|
overrides?: Overrides;
|
|
36
34
|
customDocument?: typeof Document;
|
|
35
|
+
document: {
|
|
36
|
+
attributes?: DocumentBlock['attributes'];
|
|
37
|
+
sections?: DocumentSection[];
|
|
38
|
+
};
|
|
37
39
|
};
|
|
38
|
-
declare const
|
|
39
|
-
|
|
40
|
+
export declare const Context: import("react").Context<Options>;
|
|
41
|
+
declare const Asciidoc: ({ document, options, }: {
|
|
42
|
+
document: DocumentBlock;
|
|
40
43
|
options?: Options | undefined;
|
|
41
44
|
}) => JSX.Element;
|
|
42
45
|
declare const Content: ({ blocks }: {
|
|
43
|
-
blocks:
|
|
46
|
+
blocks: PreparedBlock[];
|
|
44
47
|
}) => JSX.Element;
|
|
45
48
|
export default Asciidoc;
|
|
46
|
-
export {
|
|
49
|
+
export { Content, prepareDocument, Title, parse };
|
|
47
50
|
export * from './templates';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
2
|
+
import { AdmonitionBlock } from '../utils/prepareDocument';
|
|
3
3
|
declare const Admonition: ({ node }: {
|
|
4
|
-
node:
|
|
4
|
+
node: AdmonitionBlock;
|
|
5
5
|
}) => JSX.Element;
|
|
6
6
|
export default Admonition;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
2
|
+
import { type DocumentBlock } from '../utils/prepareDocument';
|
|
3
3
|
declare const Document: ({ document }: {
|
|
4
|
-
document:
|
|
4
|
+
document: DocumentBlock;
|
|
5
5
|
}) => JSX.Element;
|
|
6
6
|
export default Document;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type
|
|
2
|
+
import { type BaseBlock } from '../utils/prepareDocument';
|
|
3
3
|
declare const FloatingTitle: ({ node }: {
|
|
4
|
-
node:
|
|
4
|
+
node: BaseBlock;
|
|
5
5
|
}) => JSX.Element;
|
|
6
6
|
export default FloatingTitle;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type
|
|
2
|
+
import { type LiteralBlock } from '../utils/prepareDocument';
|
|
3
3
|
declare const Listing: ({ node }: {
|
|
4
|
-
node:
|
|
4
|
+
node: LiteralBlock;
|
|
5
5
|
}) => JSX.Element;
|
|
6
6
|
export default Listing;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type
|
|
2
|
+
import { type LiteralBlock } from '../utils/prepareDocument';
|
|
3
3
|
declare const Literal: ({ node }: {
|
|
4
|
-
node:
|
|
4
|
+
node: LiteralBlock;
|
|
5
5
|
}) => JSX.Element;
|
|
6
6
|
export default Literal;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type
|
|
3
|
-
declare const Outline: ({
|
|
4
|
-
|
|
2
|
+
import { type DocumentSection } from '../utils/prepareDocument';
|
|
3
|
+
declare const Outline: ({ sections, opts, }: {
|
|
4
|
+
sections: DocumentSection[];
|
|
5
5
|
opts?: {
|
|
6
6
|
tocLevels?: number | undefined;
|
|
7
7
|
sectNumLevels?: number | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type
|
|
2
|
+
import { type ParagraphBlock } from '../utils/prepareDocument';
|
|
3
3
|
declare const Paragraph: ({ node }: {
|
|
4
|
-
node:
|
|
4
|
+
node: ParagraphBlock;
|
|
5
5
|
}) => JSX.Element;
|
|
6
6
|
export default Paragraph;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type
|
|
2
|
+
import { type BaseBlock } from '../utils/prepareDocument';
|
|
3
3
|
declare const Preamble: ({ node }: {
|
|
4
|
-
node:
|
|
4
|
+
node: BaseBlock;
|
|
5
5
|
}) => JSX.Element;
|
|
6
6
|
export default Preamble;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
2
|
+
import { type SectionBlock } from '../utils/prepareDocument';
|
|
3
3
|
declare const Section: ({ node }: {
|
|
4
|
-
node:
|
|
4
|
+
node: SectionBlock;
|
|
5
5
|
}) => JSX.Element;
|
|
6
6
|
export default Section;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import
|
|
2
|
+
import { type TableBlock } from '../utils/prepareDocument';
|
|
3
3
|
declare const Table: ({ node }: {
|
|
4
|
-
node:
|
|
4
|
+
node: TableBlock;
|
|
5
5
|
}) => JSX.Element;
|
|
6
6
|
export default Table;
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
node: AbstractBlock | Block | List;
|
|
2
|
+
export declare const Title: ({ text }: {
|
|
3
|
+
text: string | undefined;
|
|
5
4
|
}) => JSX.Element | null;
|
|
6
|
-
export declare const CaptionedTitle: ({ node }: {
|
|
7
|
-
node: Block | Block | List;
|
|
8
|
-
}) => JSX.Element | null;
|
|
9
|
-
export declare const getRole: (node: AbstractBlock | Block | List) => string | undefined;
|
|
10
|
-
export declare const getLineNumber: (node: AbstractBlock | Block | List) => {
|
|
11
|
-
'data-lineno': number;
|
|
12
|
-
} | {
|
|
13
|
-
'data-lineno'?: undefined;
|
|
14
|
-
};
|