@diplodoc/cli 5.22.1 → 5.22.3

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.
@@ -1,2 +0,0 @@
1
- (()=>{var e={90101:function(){var e,t;"undefined"!=typeof Element&&((t=(e=Element.prototype).matches||e.matchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector)?e.matches=e.matchesSelector=t:e.matches=e.matchesSelector=function(e){var t=this;return Array.prototype.some.call(document.querySelectorAll(e),function(e){return e===t})})},91490:function(e,t,n){"use strict";var r,o=n(7409),i=n(85893),a=n(67294),c=n(20745),u=n(13065),s=n(8534),l=n(53816),d=n(369),f=(0,a.createContext)({pathname:"/",depth:0});f.displayName="RouterContext";var h=f.Provider,p=(0,a.createContext)(s.Uo.En);p.displayName="Lang";var v=p.Provider,g=n(55210),m={theme:s.Q2.Light,textSize:s.tF.M,showMiniToc:!0,wideFormat:!0,fullScreen:!1},w=["ar","arc","ckb","dv","fa","ha","he","khw","ks","ps","sd","ur","uz_AF","yi"],y=((r={}).RTL="rtl",r.LTR="ltr",r);function b(){return"undefined"!=typeof document}(0,g._)(new Set((0,g._)(["href"]).concat((0,g._)(["src","url","href","icon","image","desktop","mobile","tablet","previewImg","image","avatar","logo","light","dark"]))));var _=function(e){return"boolean"==typeof e?e:!!e&&"true"===e};function S(){return!!b()&&document.body.clientWidth<769}function x(e){if(!b())return m[e];try{return sessionStorage.getItem(e)||m[e]}catch(t){return m[e]}}var k=n(27412),C=n(24460);function j(e,t){var n=(0,C._)((0,a.useState)(t[e]),2),r=n[0],o=n[1],i=(0,a.useMemo)(function(){var t,n;return t=e,n=o,function(e){if(b())try{sessionStorage.setItem(t,String(e))}catch(e){}n(e)}},[e,o]);return(0,a.useMemo)(function(){var t;return t={},(0,k._)(t,e,r),(0,k._)(t,"onChange"+e.replace(/^./,function(e){return e.toUpperCase()}),i),t},[e,r,i])}var L=n(21890),M=n(22853),E=n(99282);n(68648),n(90101),n(57276),n(12646);var O=(0,M.default)("Layout");function T(){return null}function P(){return null}function N(){return null}var R={doc:!1},F=function(e){var t,n,r,c=(0,o._)({},R,e),u=c.children,s=c.doc,l=c.headerHeight;return a.Children.forEach(u,function(e){switch(e.type){case T:t=e.props.children;break;case P:n=e.props.children;break;case N:r=e.props.children}}),(0,i.jsxs)("div",{className:O({"full-header":(void 0===l?0:l)>0}),children:[t&&(0,i.jsx)("div",{className:O("header"),children:t}),(0,i.jsxs)("div",{className:O("body"),children:[n&&(0,i.jsx)("div",{className:O("content"),children:n}),r&&(0,i.jsx)("div",{className:O("footer",{doc:s}),children:r})]})]})};F.displayName="Layout",F.Header=T,F.Content=P,F.Footer=N,(0,M.default)("pc-page-constructor"),(0,M.default)("pc-constructor-row"),n(5122),(0,M.default)("Suggest");var q=n(69609),z=n(24426);(0,a.memo)(function(e){var t=e.mobileView,n=e.theme,r=e.onChangeTheme,o=e.textSize,a=e.onChangeTextSize,c=e.wideFormat,u=e.onChangeWideFormat,l=e.showMiniToc,d=e.onChangeShowMiniToc,f=e.lang,h=e.langs,p=e.onChangeLang,v=e.availableLangs;return(0,i.jsx)(q.C,{controlClassName:"Control",controlSize:s.$D.L,isWideView:t,isMobileView:t,children:(0,i.jsx)(z.Z,{className:"Controls",theme:n,onChangeTheme:r,wideFormat:c,onChangeWideFormat:u,showMiniToc:l,onChangeShowMiniToc:d,textSize:o,onChangeTextSize:a,lang:f,langs:h,onChangeLang:p,availableLangs:void 0===v?[]:v})})}).displayName="HeaderControls",n(91398),n(17344),n(87767),n(34952),n(76638),n(65333);var U=n(76150),A=n(43830),I=n(52062),W=n(41196),J=n(28395),V=function(){function e(t){var r=this,i=this;(0,A._)(this,e),(0,k._)(this,"worker",void 0),(0,k._)(this,"config",void 0),(0,k._)(this,"init",function(){var e;e=(0,E._)((0,o._)({},r.config),{base:r.base,mark:"Suggest__Item__Marker"}),r.worker=(0,U._)(function(){var t;return(0,J.Jh)(this,function(r){switch(r.label){case 0:return[4,(0,U._)(function(){var e,t,r;return(0,J.Jh)(this,function(o){try{return[2,new Worker(new URL(n.p+n.u("444"),n.b))]}catch(n){if((0,W._)(n,DOMException)&&(e=$.exec(n.message)))return t=e[1],r=new Blob(["importScripts('".concat(t,"');")],{type:"text/javascript"}),[2,new Worker(URL.createObjectURL(r))];throw n}})})()];case 1:return[4,B(t=r.sent(),(0,E._)((0,o._)({},e),{type:"init"}))];case 2:return r.sent(),[2,t]}})})()}),(0,k._)(this,"link",function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=new URLSearchParams;n&&o.set("query",n),r>1&&o.set("page",r.toString());var i=o.toString()?"?".concat(o.toString()):"";return"".concat(e,"/").concat(t.link).concat(i)}(i.base,i.config,e,t)}),this.config=t}return(0,I._)(e,[{key:"suggest",value:function(e){return(0,U._)(function(){return(0,J.Jh)(this,function(t){return[2,this.request({type:"suggest",query:e})]})}).call(this)}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return(0,U._)(function(){return(0,J.Jh)(this,function(r){return[2,this.request({type:"search",query:e,page:t,count:n})]})}).call(this)}},{key:"base",get:function(){return window.location.href.split("/").slice(0,-this.config.depth).join("/")}},{key:"request",value:function(e){return(0,U._)(function(){return(0,J.Jh)(this,function(t){switch(t.label){case 0:return[4,this.worker];case 1:return[2,B.apply(void 0,[t.sent(),e])]}})}).call(this)}}]),e}(),$=/Script at '(.*?)' cannot be accessed from origin/;function B(e,t){var n=new MessageChannel;return new Promise(function(r,o){n.port1.onmessage=function(e){e.data.error?o(e.data.error):r(e.data.result)},n.port1.onmessageerror=function(e){o(e.data.error)},e.postMessage(t,[n.port2])})}n(10932);var D=(0,M.default)("Search");function H(e,t){var n=new URLSearchParams;e&&n.set("query",e),t>1&&n.set("page",String(t)),window.history.pushState({},"","?".concat(n.toString()))}var Z=function(){var e,t,n,r,c,u,s,l,d=(e=(0,a.useContext)(p),n=void 0===(t=(0,a.useContext)(f).depth)?0:t,r=(0,a.useContext)(Q),u=(c=(0,C._)((0,a.useState)(null),2))[0],s=c[1],l=(0,a.useMemo)(function(){return r?(0,E._)((0,o._)({},r),{depth:n,lang:e}):null},[e,n,r]),(0,a.useEffect)(function(){l&&s(l?new V(l):null)},[l]),u),h=(0,a.useContext)(f),v=(0,C._)((0,a.useState)(""),2),g=v[0],m=v[1],w=(0,C._)((0,a.useState)(1),2),y=w[0],b=w[1],_=(0,C._)((0,a.useState)([]),2),S=_[0],x=_[1],k=(0,C._)((0,a.useState)(0),2),j=k[0],M=k[1],O=(0,C._)((0,a.useState)(!1),2),T=O[0],P=O[1],N=(0,a.useRef)(null);(0,a.useEffect)(function(){var e;N.current=d,null==d||null==(e=d.init)||e.call(d)},[d]),(0,a.useEffect)(function(){var e,t={query:(e=new URLSearchParams(window.location.search)).get("query")||"",page:Number(e.get("page"))||1},n=t.query,r=t.page;m(n),b(r)},[h]),(0,a.useEffect)(function(){g&&N.current?(P(!0),N.current.search(g,y,10).then(function(e){var t,n=e.items,r=e.total;x(Array.isArray(t=null!=n?n:[])?t.map(function(e){var t,n,r;return{title:(null==e?void 0:e.title)||(null==e||null==(t=e.hierarchy)?void 0:t.lvl0)||(null==e||null==(n=e.hierarchy)?void 0:n.lvl1)||"",url:(null==e?void 0:e.url)||(null==e?void 0:e.link)||"#",description:(null==e?void 0:e.description)||(null==e?void 0:e.content)||(null==e?void 0:e.text)||"",section:(null==e?void 0:e.section)||(null==e||null==(r=e.hierarchy)?void 0:r.lvl1)||""}}):[]),M(r)}).catch(function(){x([]),M(0)}).finally(function(){return P(!1)})):(x([]),M(0))},[g,y,d]);var R=(0,a.useCallback)(function(e){H(g,e),b(e)},[g]),F=(0,a.useCallback)(function(e){H(e,1),m(e),b(1)},[]);return(0,i.jsx)("div",{className:D(),children:(0,i.jsx)(L.Z,{query:g,items:S,page:y,totalItems:j,onPageChange:R,onSubmit:F,loading:T})})},Q=(0,a.createContext)(null);Q.displayName="SearchContext";var G=Q.Provider,K=document.getElementById("root");if(!K)throw Error("Root element not found!");var X=window.__DATA__,Y=X||{};Y.depth=Y.depth||3;var ee=new URL(window.location.href);(0,c.createRoot)(K).render((0,i.jsx)(function(e){var t,n,r,c,f,p,g,m,k,L,M,E,O,T,P,N=e.data,R=e.url,F=N.search,q=(null==F?void 0:F.lang)||s.Uo.En,z=(g=j("theme",(t=x("theme"),n=x("textSize"),r=x("showMiniToc"),c=x("wideFormat"),f=x("fullScreen"),p={theme:t,textSize:n,showMiniToc:_(r),wideFormat:_(c),fullScreen:_(f)})),m=j("textSize",p),k=j("wideFormat",p),L=j("fullScreen",p),M=j("showMiniToc",p),(0,a.useMemo)(function(){return(0,o._)({},g,m,k,M,L)},[g,m,k,M,L])),U=(O=(E=(0,C._)((0,a.useState)(S()),2))[0],T=E[1],P=(0,a.useCallback)(function(){T(S())},[]),(0,a.useEffect)(P,[P]),(0,a.useEffect)(function(){return window.addEventListener("resize",P),function(){return window.removeEventListener("resize",P)}},[P]),O),A=l.aP.includes(q)?q:s.Uo.En,I=w.includes(A)?y.RTL:y.LTR;(0,d.jQ)({lang:A,localeCode:A});var W={pathname:R.pathname,depth:3},J=z.theme,V=z.wideFormat;return(0,a.useEffect)(function(){var e={mobileView:U,wideFormat:V};if(b()){document.body.classList.add("g-root");var t=function(e,t){return document.body.classList.toggle(e,!!t)};Object.keys(e).forEach(function(n){switch(n){case"wideFormat":t("dc-root_wide-format",e[n]);break;case"focusSearch":t("dc-root_focused-search",e[n]);break;case"fullScreen":t("dc-root_full-screen",e[n]);break;case"landingPage":t("dc-root_document-page",!e[n]),t("dc-root_landing-page",e[n]);break;case"mobileView":t("mobile",e[n]),t("desktop",!e[n])}})}"undefined"!=typeof document&&document.querySelectorAll(".g-root").forEach(function(e){e.classList.toggle("g-root_theme_light","light"===J),e.classList.toggle("g-root_theme_dark","dark"===J)})},[J,U,V]),(0,i.jsx)(u.f,{theme:J,direction:I,children:(0,i.jsx)(v,{value:A,children:(0,i.jsx)(h,{value:W,children:(0,i.jsx)(G,{value:F,children:(0,i.jsx)(Z,{})})})})})},(0,o._)({},{data:X,url:ee})))},86685:function(e,t,n){"use strict";function r(){}n.d(t,{Z:()=>r})},65333:function(e,t,n){"use strict";e.exports={}},12646:function(e,t,n){"use strict";e.exports={}},10932:function(e,t,n){"use strict";e.exports={}},5122:function(e,t,n){"use strict";e.exports={}},18925:function(){},81481:function(){},21361:function(){},49505:function(){},53480:function(){},31337:function(){}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.m=e,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;n.t=function(r,o){if(1&o&&(r=this(r)),8&o||"object"==typeof r&&r&&(4&o&&r.__esModule||16&o&&"function"==typeof r.then))return r;var i=Object.create(null);n.r(i);var a={};e=e||[null,t({}),t([]),t(t)];for(var c=2&o&&r;"object"==typeof c&&!~e.indexOf(c);c=t(c))Object.getOwnPropertyNames(c).forEach(e=>{a[e]=()=>r[e]});return a.default=()=>r,n.d(i,a),i}})(),n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.k=e=>""+e+".css",n.u=e=>""+e+"-504c3782d2b3e0db.js",n.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}})(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e=[];n.O=(t,r,o,i)=>{if(r){i=i||0;for(var a=e.length;a>0&&e[a-1][2]>i;a--)e[a]=e[a-1];e[a]=[r,o,i];return}for(var c=1/0,a=0;a<e.length;a++){for(var[r,o,i]=e[a],u=!0,s=0;s<r.length;s++)(!1&i||c>=i)&&Object.keys(n.O).every(e=>n.O[e](r[s]))?r.splice(s--,1):(u=!1,i<c&&(c=i));if(u){e.splice(a--,1);var l=o();void 0!==l&&(t=l)}}return t}})(),n.rv=()=>"1.4.11",n.j="990",(()=>{n.g.importScripts&&(e=n.g.location+"");var e,t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw Error("Automatic publicPath is not supported in this browser");n.p=e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")})(),(()=>{n.b=document.baseURI||self.location.href;var e={990:0};n.O.j=t=>0===e[t];var t=(t,r)=>{var o,i,[a,c,u]=r,s=0;if(a.some(t=>0!==e[t])){for(o in c)n.o(c,o)&&(n.m[o]=c[o]);if(u)var l=u(n)}for(t&&t(r);s<a.length;s++)i=a[s],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return n.O(l)},r=self.webpackChunk_diplodoc_client=self.webpackChunk_diplodoc_client||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),n.ruid="bundler=rspack@1.4.11";var r=n.O(void 0,["966","971"],function(){return n(91490)});r=n.O(r)})();
2
- //# sourceMappingURL=search-c50badbbac7436bd.js.map