@diplodoc/client 2.0.0-alpha-5 → 2.0.0-beta-1
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/.github/workflows/quality.yaml +22 -0
- package/.github/workflows/release.yaml +19 -0
- package/.github/workflows/tests.yaml +22 -0
- package/CHANGELOG.md +53 -0
- package/build/client/app.css +2 -2
- package/build/client/app.css.map +1 -1
- package/build/client/app.js +1 -1
- package/build/client/app.js.map +1 -1
- package/build/client/manifest.json +4 -4
- package/build/client/vendor.css +18 -14
- package/build/client/vendor.css.map +1 -1
- package/build/client/vendor.js +1 -1
- package/build/client/vendor.js.LICENSE.txt +18 -0
- package/build/client/vendor.js.map +1 -1
- package/build/hooks/useSettings.d.ts +6 -5
- package/build/server/app.js +105 -58
- package/build/server/app.js.map +1 -1
- package/build/server/manifest.json +2 -2
- package/build/server/vendor.js +11126 -1994
- package/build/server/vendor.js.map +1 -1
- package/build/utils.d.ts +1 -11
- package/package.json +14 -18
- package/.eslintrc.js +0 -7
- package/.prettierignore +0 -11
- package/.prettierrc +0 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { TextSizes, Theme } from '@diplodoc/components';
|
|
2
3
|
export declare function useSettings(): {
|
|
3
4
|
theme: Theme;
|
|
4
|
-
onChangeTheme: (value: Theme) => void;
|
|
5
|
+
onChangeTheme: (value: import("react").SetStateAction<Theme>) => void;
|
|
5
6
|
textSize: TextSizes;
|
|
6
|
-
onChangeTextSize: (value: TextSizes) => void;
|
|
7
|
+
onChangeTextSize: (value: import("react").SetStateAction<TextSizes>) => void;
|
|
7
8
|
wideFormat: boolean;
|
|
8
|
-
onChangeWideFormat: (value: boolean) => void;
|
|
9
|
+
onChangeWideFormat: (value: import("react").SetStateAction<boolean>) => void;
|
|
9
10
|
showMiniToc: boolean;
|
|
10
|
-
onChangeShowMiniToc: (value: boolean) => void;
|
|
11
|
+
onChangeShowMiniToc: (value: import("react").SetStateAction<boolean>) => void;
|
|
11
12
|
fullScreen: boolean;
|
|
12
|
-
onChangeFullScreen: (value: boolean) => void;
|
|
13
|
+
onChangeFullScreen: (value: import("react").SetStateAction<boolean>) => void;
|
|
13
14
|
};
|
package/build/server/app.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/******/ (() => { // webpackBootstrap
|
|
2
2
|
/******/ var __webpack_modules__ = ({
|
|
3
3
|
|
|
4
|
-
/***/
|
|
4
|
+
/***/ 6222:
|
|
5
5
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
6
6
|
|
|
7
7
|
"use strict";
|
|
@@ -19,8 +19,8 @@ var react = __webpack_require__(7294);
|
|
|
19
19
|
var server_node = __webpack_require__(9680);
|
|
20
20
|
// EXTERNAL MODULE: ./node_modules/@gravity-ui/page-constructor/build/esm/containers/PageConstructor/Provider.js
|
|
21
21
|
var Provider = __webpack_require__(7725);
|
|
22
|
-
// EXTERNAL MODULE: ./node_modules/@gravity-ui/page-constructor/build/esm/containers/PageConstructor/PageConstructor.js +
|
|
23
|
-
var PageConstructor = __webpack_require__(
|
|
22
|
+
// EXTERNAL MODULE: ./node_modules/@gravity-ui/page-constructor/build/esm/containers/PageConstructor/PageConstructor.js + 350 modules
|
|
23
|
+
var PageConstructor = __webpack_require__(9324);
|
|
24
24
|
// EXTERNAL MODULE: ./node_modules/@diplodoc/components/build/esm/components/DocLeadingPage/DocLeadingPage.js + 2 modules
|
|
25
25
|
var DocLeadingPage = __webpack_require__(7332);
|
|
26
26
|
// EXTERNAL MODULE: ./node_modules/@diplodoc/components/build/esm/components/DocPage/DocPage.js + 36 modules
|
|
@@ -29,8 +29,8 @@ var DocPage = __webpack_require__(293);
|
|
|
29
29
|
var models = __webpack_require__(8534);
|
|
30
30
|
// EXTERNAL MODULE: ./node_modules/@diplodoc/components/build/esm/components/Controls/ControlsLayout.js
|
|
31
31
|
var ControlsLayout = __webpack_require__(9609);
|
|
32
|
-
// EXTERNAL MODULE: ./node_modules/@diplodoc/components/build/esm/components/Controls/Controls.js +
|
|
33
|
-
var Controls = __webpack_require__(
|
|
32
|
+
// EXTERNAL MODULE: ./node_modules/@diplodoc/components/build/esm/components/Controls/Controls.js + 65 modules
|
|
33
|
+
var Controls = __webpack_require__(4990);
|
|
34
34
|
;// CONCATENATED MODULE: ./src/components/HeaderControls/index.tsx
|
|
35
35
|
|
|
36
36
|
|
|
@@ -51,7 +51,8 @@ const HeaderControls = /*#__PURE__*/(0,react.memo)(({
|
|
|
51
51
|
return /*#__PURE__*/react.createElement(ControlsLayout/* ControlsLayout */.C, {
|
|
52
52
|
controlClassName: 'Control',
|
|
53
53
|
controlSize: models/* ControlSizes */.$D.L,
|
|
54
|
-
isWideView: mobileView
|
|
54
|
+
isWideView: mobileView,
|
|
55
|
+
isMobileView: mobileView
|
|
55
56
|
}, /*#__PURE__*/react.createElement(Controls/* default */.Z, {
|
|
56
57
|
className: 'Controls',
|
|
57
58
|
theme: theme,
|
|
@@ -66,59 +67,12 @@ const HeaderControls = /*#__PURE__*/(0,react.memo)(({
|
|
|
66
67
|
});
|
|
67
68
|
HeaderControls.displayName = 'HeaderControls';
|
|
68
69
|
;// CONCATENATED MODULE: ./src/utils.ts
|
|
69
|
-
|
|
70
|
-
const DEFAULT_USER_SETTINGS = {
|
|
71
|
-
theme: models/* Theme */.Q2.Light,
|
|
72
|
-
textSize: models/* TextSizes */.tF.M,
|
|
73
|
-
showMiniToc: true,
|
|
74
|
-
wideFormat: true,
|
|
75
|
-
fullScreen: false
|
|
76
|
-
};
|
|
77
|
-
function getDocSettings() {
|
|
78
|
-
const {
|
|
79
|
-
theme: defaultTheme,
|
|
80
|
-
textSize: defaultTextSize,
|
|
81
|
-
showMiniToc: defaultShowMiniToc,
|
|
82
|
-
wideFormat: defaultWideFormat,
|
|
83
|
-
fullScreen: defaultFullScreen
|
|
84
|
-
} = DEFAULT_USER_SETTINGS;
|
|
85
|
-
const theme = getSetting('theme') || defaultTheme;
|
|
86
|
-
const textSize = getSetting('textSize') || defaultTextSize;
|
|
87
|
-
const showMiniToc = getSetting('showMiniToc') || defaultShowMiniToc;
|
|
88
|
-
const wideFormat = getSetting('wideFormat') || defaultWideFormat;
|
|
89
|
-
const fullScreen = getSetting('fullScreen') || defaultFullScreen;
|
|
90
|
-
return {
|
|
91
|
-
theme,
|
|
92
|
-
textSize,
|
|
93
|
-
showMiniToc: strToBoolean(showMiniToc),
|
|
94
|
-
wideFormat: strToBoolean(wideFormat),
|
|
95
|
-
fullScreen: strToBoolean(fullScreen)
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
function getSetting(name) {
|
|
99
|
-
if (typeof sessionStorage === 'undefined') {
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
return sessionStorage.getItem(name);
|
|
103
|
-
}
|
|
104
|
-
function saveSetting(name, value) {
|
|
105
|
-
if (typeof sessionStorage === 'undefined') {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
sessionStorage.setItem(name, String(value));
|
|
109
|
-
}
|
|
110
70
|
function strToBoolean(str) {
|
|
111
71
|
if (typeof str === 'boolean') {
|
|
112
72
|
return str;
|
|
113
73
|
}
|
|
114
74
|
return str ? str === 'true' : false;
|
|
115
75
|
}
|
|
116
|
-
function withSavingSetting(settingName, onChange) {
|
|
117
|
-
return value => {
|
|
118
|
-
saveSetting(settingName, value);
|
|
119
|
-
onChange(value);
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
76
|
function updateRootClassName({
|
|
123
77
|
theme,
|
|
124
78
|
mobileView = false,
|
|
@@ -186,8 +140,16 @@ Layout.Footer = Footer;
|
|
|
186
140
|
;// CONCATENATED MODULE: ./src/hooks/useSettings.ts
|
|
187
141
|
|
|
188
142
|
|
|
143
|
+
|
|
144
|
+
const DEFAULT_USER_SETTINGS = {
|
|
145
|
+
theme: models/* Theme */.Q2.Light,
|
|
146
|
+
textSize: models/* TextSizes */.tF.M,
|
|
147
|
+
showMiniToc: true,
|
|
148
|
+
wideFormat: true,
|
|
149
|
+
fullScreen: false
|
|
150
|
+
};
|
|
189
151
|
function useSettings() {
|
|
190
|
-
const settings =
|
|
152
|
+
const settings = getSettings();
|
|
191
153
|
const [wideFormat, setWideFormat] = (0,react.useState)(settings.wideFormat);
|
|
192
154
|
const [fullScreen, setFullScreen] = (0,react.useState)(settings.fullScreen);
|
|
193
155
|
const [showMiniToc, setShowMiniToc] = (0,react.useState)(settings.showMiniToc);
|
|
@@ -206,6 +168,41 @@ function useSettings() {
|
|
|
206
168
|
onChangeFullScreen: withSavingSetting('fullScreen', setFullScreen)
|
|
207
169
|
};
|
|
208
170
|
}
|
|
171
|
+
function getSettings() {
|
|
172
|
+
const theme = getSetting('theme');
|
|
173
|
+
const textSize = getSetting('textSize');
|
|
174
|
+
const showMiniToc = getSetting('showMiniToc');
|
|
175
|
+
const wideFormat = getSetting('wideFormat');
|
|
176
|
+
const fullScreen = getSetting('fullScreen');
|
|
177
|
+
return {
|
|
178
|
+
theme,
|
|
179
|
+
textSize,
|
|
180
|
+
showMiniToc: strToBoolean(showMiniToc),
|
|
181
|
+
wideFormat: strToBoolean(wideFormat),
|
|
182
|
+
fullScreen: strToBoolean(fullScreen)
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function getSetting(name) {
|
|
186
|
+
if (typeof sessionStorage === 'undefined') {
|
|
187
|
+
return DEFAULT_USER_SETTINGS[name];
|
|
188
|
+
}
|
|
189
|
+
try {
|
|
190
|
+
return sessionStorage.getItem(name) || DEFAULT_USER_SETTINGS[name];
|
|
191
|
+
} catch {
|
|
192
|
+
return DEFAULT_USER_SETTINGS[name];
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
function setSetting(name, value) {
|
|
196
|
+
try {
|
|
197
|
+
sessionStorage.setItem(name, String(value));
|
|
198
|
+
} catch {}
|
|
199
|
+
}
|
|
200
|
+
function withSavingSetting(settingName, onChange) {
|
|
201
|
+
return value => {
|
|
202
|
+
setSetting(settingName, value);
|
|
203
|
+
onChange(value);
|
|
204
|
+
};
|
|
205
|
+
}
|
|
209
206
|
;// CONCATENATED MODULE: ./src/hooks/useMobile.ts
|
|
210
207
|
|
|
211
208
|
const MOBILE_VIEW_WIDTH_BREAKPOINT = 769;
|
|
@@ -227,6 +224,41 @@ var leading_page_links = __webpack_require__(9380);
|
|
|
227
224
|
const yfm_namespaceObject = require("@diplodoc/transform/dist/js/yfm");
|
|
228
225
|
// EXTERNAL MODULE: ./node_modules/@diplodoc/mermaid-extension/react/index.js
|
|
229
226
|
var mermaid_extension_react = __webpack_require__(5289);
|
|
227
|
+
;// CONCATENATED MODULE: ../../extensions/latex/react/index.js
|
|
228
|
+
// src/react/index.ts
|
|
229
|
+
|
|
230
|
+
function LatexRuntime(props) {
|
|
231
|
+
const renderLatex = useLatex();
|
|
232
|
+
(0,react.useEffect)(() => {
|
|
233
|
+
renderLatex(props).catch(props.onError || (() => {
|
|
234
|
+
}));
|
|
235
|
+
});
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
function useLatex() {
|
|
239
|
+
const [latex, setLatex] = (0,react.useState)(null);
|
|
240
|
+
const render = (0,react.useCallback)(
|
|
241
|
+
async (options) => {
|
|
242
|
+
if (latex) {
|
|
243
|
+
return latex.run(options);
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
[latex]
|
|
247
|
+
);
|
|
248
|
+
(0,react.useEffect)(() => {
|
|
249
|
+
(window.latexJsonp = window.latexJsonp || []).push(setLatex);
|
|
250
|
+
return () => {
|
|
251
|
+
const index = window.latexJsonp.indexOf(setLatex);
|
|
252
|
+
if (index > -1) {
|
|
253
|
+
window.latexJsonp.splice(index, 1);
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
}, []);
|
|
257
|
+
return render;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
//# sourceMappingURL=index.js.map
|
|
261
|
+
|
|
230
262
|
// EXTERNAL MODULE: ./node_modules/@diplodoc/openapi-extension/runtime/index.min.js + 15 modules
|
|
231
263
|
var index_min = __webpack_require__(5584);
|
|
232
264
|
;// CONCATENATED MODULE: ./src/components/App/App.tsx
|
|
@@ -243,6 +275,7 @@ var index_min = __webpack_require__(5584);
|
|
|
243
275
|
|
|
244
276
|
|
|
245
277
|
|
|
278
|
+
|
|
246
279
|
function Page(props) {
|
|
247
280
|
const {
|
|
248
281
|
data,
|
|
@@ -284,6 +317,15 @@ function App(props) {
|
|
|
284
317
|
fullScreen,
|
|
285
318
|
onChangeFullScreen
|
|
286
319
|
};
|
|
320
|
+
const rebase = item => {
|
|
321
|
+
if (item.type !== 'link') {
|
|
322
|
+
return item;
|
|
323
|
+
}
|
|
324
|
+
return {
|
|
325
|
+
...item,
|
|
326
|
+
url: item.url.replace(/^\/?/, '/')
|
|
327
|
+
};
|
|
328
|
+
};
|
|
287
329
|
(0,react.useEffect)(() => {
|
|
288
330
|
updateRootClassName({
|
|
289
331
|
theme,
|
|
@@ -292,6 +334,11 @@ function App(props) {
|
|
|
292
334
|
fullHeader
|
|
293
335
|
});
|
|
294
336
|
}, [theme, mobileView, wideFormat, fullHeader]);
|
|
337
|
+
if (!navigation) {
|
|
338
|
+
return /*#__PURE__*/react.createElement("div", {
|
|
339
|
+
className: "App"
|
|
340
|
+
}, /*#__PURE__*/react.createElement(Page, Object.assign({}, pageProps, settings)));
|
|
341
|
+
}
|
|
295
342
|
const {
|
|
296
343
|
header = {},
|
|
297
344
|
logo
|
|
@@ -324,12 +371,12 @@ function App(props) {
|
|
|
324
371
|
navigation: fullHeader ? {
|
|
325
372
|
header: {
|
|
326
373
|
withBorder: true,
|
|
327
|
-
leftItems,
|
|
328
|
-
rightItems
|
|
374
|
+
leftItems: leftItems.map(rebase),
|
|
375
|
+
rightItems: rightItems.map(rebase)
|
|
329
376
|
},
|
|
330
377
|
logo
|
|
331
378
|
} : undefined
|
|
332
|
-
})), /*#__PURE__*/react.createElement(index_min/* Runtime */.r, null), /*#__PURE__*/react.createElement(mermaid_extension_react/* MermaidRuntime */.u, {
|
|
379
|
+
})), /*#__PURE__*/react.createElement(index_min/* Runtime */.r, null), /*#__PURE__*/react.createElement(LatexRuntime, null), /*#__PURE__*/react.createElement(mermaid_extension_react/* MermaidRuntime */.u, {
|
|
333
380
|
theme: theme === models/* Theme */.Q2.Dark ? 'dark' : 'neutral',
|
|
334
381
|
zoom: {
|
|
335
382
|
showMenu: true,
|
|
@@ -475,7 +522,7 @@ module.exports = require("util");
|
|
|
475
522
|
/******/ __webpack_require__.x = () => {
|
|
476
523
|
/******/ // Load entry module and return exports
|
|
477
524
|
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
|
|
478
|
-
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, [514,736], () => (__webpack_require__(
|
|
525
|
+
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, [514,736], () => (__webpack_require__(6222)))
|
|
479
526
|
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
|
|
480
527
|
/******/ return __webpack_exports__;
|
|
481
528
|
/******/ };
|
package/build/server/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAoC;AAQN;;AAE9B;;AAgBO,MAAMK,cAAc,gBAAGJ,cAAI,CAC9B,CAAC;EACGK,UAAU;EAEVC,KAAK;EACLC,aAAa;EAEbC,QAAQ;EACRC,gBAAgB;EAEhBC,UAAU;EACVC,kBAAkB;EAElBC,WAAW;EACXC;AACJ,CAAC,KAAK;EACF,oBACId,mBAAA,CAACI,oCAAc;IACXY,gBAAgB,EAAE,SAAU;IAC5BC,WAAW,EAAEf,2BAAY,CAACgB,CAAE;IAC5BC,UAAU,EAAEb;EAAW,gBAEvBN,mBAAA,CAACG,uBAAQ;IACLiB,SAAS,EAAE,UAAW;IACtBb,KAAK,EAAEA,KAAM;IACbC,aAAa,EAAEA,aAAc;IAC7BG,UAAU,EAA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AAI,GAAGA,IAAI;MAC/B;IACJ,CAAC,CAAC;EACN;AACJ,CAAC,EAAE,CAAC;;;;;;;;;;;ACjEJ,6BAAe,sCAAY,CAAC;;;;;;;;ACA5B;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;;;ACAA;;;;;;UCAA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;;;;WCrCA;;;;;WCAA;WACA;WACA;WACA;WACA,+BAA+B,wCAAwC;WACvE;WACA;WACA;WACA;WACA,iBAAiB,qBAAqB;WACtC;WACA;WACA,kBAAkB,qBAAqB;WACvC;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,EAAE;WACF;;;;;WCRA;WACA;WACA;WACA,cAAc,6BAA6B;WAC3C;;;;;WCJA;WACA;WACA;WACA;WACA;;;;;WCJA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;WACA;WACA;WACA;WACA;;;;;WCJA;;;;;WCAA;;WAEA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,gBAAgB,qBAAqB;WACrC;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA,aAAa;WACb;WACA,IAAI;WACJ;WACA;;WAEA;;WAEA;;WAEA;;;;;WCrCA;WACA;WACA;WACA;WACA;WACA;;;;;UELA;UACA","sources":["webpack://@diplodoc/client/./src/components/HeaderControls/index.tsx","webpack://@diplodoc/client/./src/utils.ts","webpack://@diplodoc/client/./src/components/Layout/index.tsx","webpack://@diplodoc/client/./src/hooks/useSettings.ts","webpack://@diplodoc/client/./src/hooks/useMobile.ts","webpack://@diplodoc/client/external commonjs2 \"@diplodoc/transform/dist/js/yfm\"","webpack://@diplodoc/client/./src/components/App/App.tsx","webpack://@diplodoc/client/./src/index.server.tsx","webpack://@diplodoc/client/./src/interceptors/leading-page-links.js","webpack://@diplodoc/client/./src/stub/empty-module.js","webpack://@diplodoc/client/external node-commonjs \"crypto\"","webpack://@diplodoc/client/external node-commonjs \"stream\"","webpack://@diplodoc/client/external node-commonjs \"url\"","webpack://@diplodoc/client/external node-commonjs \"util\"","webpack://@diplodoc/client/webpack/bootstrap","webpack://@diplodoc/client/webpack/runtime/amd options","webpack://@diplodoc/client/webpack/runtime/chunk loaded","webpack://@diplodoc/client/webpack/runtime/compat get default export","webpack://@diplodoc/client/webpack/runtime/define property getters","webpack://@diplodoc/client/webpack/runtime/ensure chunk","webpack://@diplodoc/client/webpack/runtime/get javascript chunk filename","webpack://@diplodoc/client/webpack/runtime/get mini-css chunk filename","webpack://@diplodoc/client/webpack/runtime/hasOwnProperty shorthand","webpack://@diplodoc/client/webpack/runtime/make namespace object","webpack://@diplodoc/client/webpack/runtime/node module decorator","webpack://@diplodoc/client/webpack/runtime/publicPath","webpack://@diplodoc/client/webpack/runtime/require chunk loading","webpack://@diplodoc/client/webpack/runtime/startup chunk dependencies","webpack://@diplodoc/client/webpack/before-startup","webpack://@diplodoc/client/webpack/startup","webpack://@diplodoc/client/webpack/after-startup"],"sourcesContent":["import React, { memo } from 'react';\n\nimport {\n ControlSizes,\n Controls,\n ControlsLayout,\n TextSizes,\n Theme,\n} from '@diplodoc/components';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype OnChangeCallback = (value: any) => void;\n\ntype Props = {\n mobileView: boolean;\n\n theme: Theme;\n onChangeTheme: OnChangeCallback;\n textSize: TextSizes;\n onChangeTextSize: OnChangeCallback;\n wideFormat: boolean;\n onChangeWideFormat: OnChangeCallback;\n showMiniToc: boolean;\n onChangeShowMiniToc: OnChangeCallback;\n};\n\nexport const HeaderControls = memo<Props>(\n ({\n mobileView,\n\n theme,\n onChangeTheme,\n\n textSize,\n onChangeTextSize,\n\n wideFormat,\n onChangeWideFormat,\n\n showMiniToc,\n onChangeShowMiniToc,\n }) => {\n return (\n <ControlsLayout\n controlClassName={'Control'}\n controlSize={ControlSizes.L}\n isWideView={mobileView}\n >\n <Controls\n className={'Controls'}\n theme={theme}\n onChangeTheme={onChangeTheme}\n wideFormat={wideFormat}\n onChangeWideFormat={onChangeWideFormat}\n showMiniToc={showMiniToc}\n onChangeShowMiniToc={onChangeShowMiniToc}\n textSize={textSize}\n onChangeTextSize={onChangeTextSize}\n />\n </ControlsLayout>\n );\n },\n);\n\nHeaderControls.displayName = 'HeaderControls';\n","import { TextSizes, Theme } from '@diplodoc/components';\n\nconst DEFAULT_USER_SETTINGS = {\n theme: Theme.Light,\n textSize: TextSizes.M,\n showMiniToc: true,\n wideFormat: true,\n fullScreen: false,\n};\n\nexport function getDocSettings() {\n const {\n theme: defaultTheme,\n textSize: defaultTextSize,\n showMiniToc: defaultShowMiniToc,\n wideFormat: defaultWideFormat,\n fullScreen: defaultFullScreen,\n } = DEFAULT_USER_SETTINGS;\n\n const theme = (getSetting('theme') as Theme) || defaultTheme;\n const textSize = (getSetting('textSize') as TextSizes) || defaultTextSize;\n const showMiniToc = getSetting('showMiniToc') || defaultShowMiniToc;\n const wideFormat = getSetting('wideFormat') || defaultWideFormat;\n const fullScreen = getSetting('fullScreen') || defaultFullScreen;\n\n return {\n theme,\n textSize,\n showMiniToc: strToBoolean(showMiniToc),\n wideFormat: strToBoolean(wideFormat),\n fullScreen: strToBoolean(fullScreen),\n };\n}\n\nexport function getSetting(name: string) {\n if (typeof sessionStorage === 'undefined') {\n return null;\n }\n return sessionStorage.getItem(name);\n}\n\nexport function saveSetting<T>(name: string, value: T) {\n if (typeof sessionStorage === 'undefined') {\n return;\n }\n sessionStorage.setItem(name, String(value));\n}\n\nexport function strToBoolean(str: string | boolean) {\n if (typeof str === 'boolean') {\n return str;\n }\n\n return str ? str === 'true' : false;\n}\n\nexport function withSavingSetting<T>(\n settingName: string,\n onChange: (value: T) => void,\n) {\n return (value: T) => {\n saveSetting<T>(settingName, value);\n\n onChange(value);\n };\n}\n\nexport function updateRootClassName({\n theme,\n mobileView = false,\n wideFormat = false,\n fullHeader = false,\n}: {\n theme: Theme;\n mobileView: boolean;\n wideFormat: boolean;\n fullHeader: boolean;\n}) {\n document.body.className = [\n 'g-root',\n mobileView ? 'mobile' : 'desktop',\n wideFormat && 'dc-root_wide-format',\n fullHeader && 'dc-root_full-header',\n theme === 'light' && 'g-root_theme_light',\n theme === 'dark' && 'g-root_theme_dark',\n ]\n .filter(Boolean)\n .join(' ');\n}\n","import React, { FC, PropsWithChildren, ReactElement } from 'react';\nimport block from 'bem-cn-lite';\n\nimport './Layout.scss';\n\nconst b = block('Layout');\n\nfunction Header() {\n return null;\n}\n\nfunction Content() {\n return null;\n}\n\nfunction Footer() {\n return null;\n}\n\ntype LayoutStatics = {\n Header: FC<PropsWithChildren>;\n Content: FC<PropsWithChildren>;\n Footer: FC<PropsWithChildren>;\n};\n\nexport const Layout: LayoutStatics &\n FC<PropsWithChildren<{ doc?: boolean }>> = (props) => {\n const { children, doc } = props;\n let header, content, footer;\n\n React.Children.forEach(\n children as ReactElement[],\n (child: ReactElement) => {\n switch (child.type) {\n case Header:\n header = child.props.children;\n break;\n case Content:\n content = child.props.children;\n break;\n case Footer:\n footer = child.props.children;\n break;\n }\n },\n );\n\n return (\n <div className={b()}>\n {header && <div className={b('header')}>{header}</div>}\n <div className={b('body')}>\n {content && <div className={b('content')}>{content}</div>}\n {footer && <div className={b('footer', { doc })}>{footer}</div>}\n </div>\n </div>\n );\n};\n\nLayout.displayName = 'Layout';\n\nLayout.defaultProps = {\n doc: false,\n};\n\nLayout.Header = Header;\nLayout.Content = Content;\nLayout.Footer = Footer;\n","import { getDocSettings, withSavingSetting } from '../utils';\nimport { useState } from 'react';\n\nimport { TextSizes, Theme } from '@diplodoc/components';\n\nexport function useSettings() {\n const settings = getDocSettings();\n\n const [wideFormat, setWideFormat] = useState<boolean>(settings.wideFormat);\n const [fullScreen, setFullScreen] = useState<boolean>(settings.fullScreen);\n const [showMiniToc, setShowMiniToc] = useState(settings.showMiniToc);\n const [theme, setTheme] = useState(settings.theme);\n const [textSize, setTextSize] = useState(settings.textSize);\n\n return {\n theme,\n onChangeTheme: withSavingSetting<Theme>('theme', setTheme),\n textSize,\n onChangeTextSize: withSavingSetting<TextSizes>('textSize', setTextSize),\n wideFormat,\n onChangeWideFormat: withSavingSetting<boolean>(\n 'wideFormat',\n setWideFormat,\n ),\n showMiniToc,\n onChangeShowMiniToc: withSavingSetting<boolean>(\n 'showMiniToc',\n setShowMiniToc,\n ),\n fullScreen,\n onChangeFullScreen: withSavingSetting<boolean>(\n 'fullScreen',\n setFullScreen,\n ),\n };\n}\n","import { useCallback, useEffect, useState } from 'react';\n\nconst MOBILE_VIEW_WIDTH_BREAKPOINT = 769;\n\nexport function useMobile() {\n const [mobileView, setMobileView] = useState<boolean>(\n typeof document !== 'undefined' &&\n document.body.clientWidth < MOBILE_VIEW_WIDTH_BREAKPOINT,\n );\n\n const onResizeHandler = useCallback(() => {\n setMobileView(document.body.clientWidth < MOBILE_VIEW_WIDTH_BREAKPOINT);\n }, []);\n\n useEffect(onResizeHandler, [onResizeHandler]);\n\n useEffect(() => {\n window.addEventListener('resize', onResizeHandler);\n\n return () => window.removeEventListener('resize', onResizeHandler);\n }, [onResizeHandler]);\n\n return mobileView;\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@diplodoc/transform/dist/js/yfm\");","import React, { ReactElement, useEffect } from 'react';\n\nimport {\n NavigationData,\n PageConstructor,\n PageConstructorProvider,\n} from '@gravity-ui/page-constructor';\nimport {\n DocLeadingPage,\n DocLeadingPageData,\n DocPage,\n DocPageData,\n Lang,\n Router,\n Theme,\n} from '@diplodoc/components';\nimport { HeaderControls } from '../HeaderControls';\nimport { updateRootClassName } from '../../utils';\nimport { Layout } from '../Layout';\nimport { useSettings } from '../../hooks/useSettings';\nimport { useMobile } from '../../hooks/useMobile';\n\nimport '../../interceptors/leading-page-links';\n\nimport '@diplodoc/transform/dist/js/yfm';\nimport { MermaidRuntime } from '@diplodoc/mermaid-extension/react';\nimport { Runtime as OpenapiSandbox } from '@diplodoc/openapi-extension/runtime';\n\nimport './App.scss';\n\nexport interface AppProps {\n lang: Lang;\n router: Router;\n}\n\nexport type DocInnerProps<Data = DocLeadingPageData | DocPageData> = {\n data: Data;\n} & AppProps;\n\nexport type { DocLeadingPageData, DocPageData };\n\nfunction Page(props: DocInnerProps) {\n const { data, ...pageProps } = props;\n\n const Page = data.leading ? DocLeadingPage : DocPage;\n\n return (\n <Layout>\n <Layout.Content>\n {/*@ts-ignore*/}\n <Page {...data} {...pageProps} />\n </Layout.Content>\n </Layout>\n );\n}\n\ntype TocData = DocPageData['toc'] & {\n navigation: NavigationData;\n};\n\nexport function App(props: DocInnerProps): ReactElement {\n const { data, router, lang } = props;\n const { navigation } = data.toc as TocData;\n\n const settings = useSettings();\n const mobileView = useMobile();\n\n const {\n theme,\n textSize,\n wideFormat,\n fullScreen,\n showMiniToc,\n onChangeFullScreen,\n } = settings;\n const fullHeader = !fullScreen && Boolean(navigation);\n const headerHeight = fullHeader ? 64 : 0;\n const pageProps = {\n headerHeight,\n data,\n router,\n lang,\n wideFormat,\n showMiniToc,\n theme,\n textSize,\n fullScreen,\n onChangeFullScreen,\n };\n\n useEffect(() => {\n updateRootClassName({\n theme,\n mobileView,\n wideFormat,\n fullHeader,\n });\n }, [theme, mobileView, wideFormat, fullHeader]);\n\n const { header = {}, logo } = navigation;\n const { leftItems = [], rightItems = [] } =\n header as NavigationData['header'];\n const headerWithControls = rightItems.some(\n (item: { type: string }) => item.type === 'controls',\n );\n\n return (\n <div className=\"App\">\n <PageConstructorProvider theme={theme}>\n <PageConstructor\n custom={{\n navigation: {\n controls: () => (\n <HeaderControls\n {...settings}\n mobileView={mobileView}\n />\n ),\n },\n blocks: {\n page: () => (\n <Page\n {...pageProps}\n {...(headerWithControls ? {} : settings)}\n />\n ),\n },\n }}\n content={{\n blocks: [\n {\n type: 'page',\n },\n ],\n }}\n navigation={\n fullHeader\n ? {\n header: {\n withBorder: true,\n leftItems,\n rightItems,\n },\n logo,\n }\n : undefined\n }\n />\n </PageConstructorProvider>\n <OpenapiSandbox />\n <MermaidRuntime\n theme={theme === Theme.Dark ? 'dark' : 'neutral'}\n zoom={{\n showMenu: true,\n bindKeys: true,\n }}\n />\n </div>\n );\n}\n","import React from 'react';\nimport { renderToString } from 'react-dom/server';\n\nimport { App, DocInnerProps, DocLeadingPageData, DocPageData } from './components/App/App';\n\nexport type { DocInnerProps, DocPageData, DocLeadingPageData };\n\nexport const render = (props: DocInnerProps) =>\n renderToString(<App {...props} />);\n","(function () {\n /**\n * Element.matches() polyfill.\n * @link https://developer.mozilla.org/ru/docs/Web/API/Element/matches\n */\n if (typeof Element !== 'undefined') {\n (function (e) {\n const matches =\n e.matches ||\n e.matchesSelector ||\n e.webkitMatchesSelector ||\n e.mozMatchesSelector ||\n e.msMatchesSelector ||\n e.oMatchesSelector;\n\n if (matches) {\n e.matches = e.matchesSelector = matches;\n } else {\n e.matches = e.matchesSelector = function (selector) {\n const th = this;\n return Array.prototype.some.call(\n document.querySelectorAll(selector),\n (el) => {\n return el === th;\n },\n );\n };\n }\n })(Element.prototype);\n }\n\n if (typeof document !== 'undefined') {\n document.addEventListener('click', (event) => {\n const href = event.target.href;\n const locationOrigin = window.location.origin;\n\n if (\n event.target.matches('.dc-doc-layout__center a') &&\n href.startsWith(locationOrigin)\n ) {\n event.preventDefault();\n\n const mainFileName = 'index';\n const extention = '.html';\n\n if (href.endsWith('/')) {\n window.location.href = `${href}${mainFileName}${extention}`;\n return;\n }\n\n // https://../file-name, https://../file-name#fragment\n const splitedHref = href.split('#');\n if (\n splitedHref.length > 0 &&\n !splitedHref[0].endsWith(extention)\n ) {\n splitedHref[0] += extention;\n window.location.href = splitedHref.join('#');\n return;\n }\n\n window.location.href = href;\n }\n });\n }\n})();\n","export default function () {}\n","module.exports = require(\"crypto\");","module.exports = require(\"stream\");","module.exports = require(\"url\");","module.exports = require(\"util\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [514,736], () => (__webpack_require__(2722)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","__webpack_require__.amdO = {};","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + {\"514\":\"react\",\"736\":\"vendor\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.p = \"\";","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"loaded\", otherwise not loaded yet\nvar installedChunks = {\n\t143: 1\n};\n\n__webpack_require__.O.require = (chunkId) => (installedChunks[chunkId]);\n\nvar installChunk = (chunk) => {\n\tvar moreModules = chunk.modules, chunkIds = chunk.ids, runtime = chunk.runtime;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\tfor(var i = 0; i < chunkIds.length; i++)\n\t\tinstalledChunks[chunkIds[i]] = 1;\n\t__webpack_require__.O();\n};\n\n// require() chunk loading for javascript\n__webpack_require__.f.require = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\tinstallChunk(require(\"./\" + __webpack_require__.u(chunkId)));\n\t\t} else installedChunks[chunkId] = 1;\n\t}\n};\n\n// no external install chunk\n\n// no HMR\n\n// no HMR manifest","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\t__webpack_require__.e(514);\n\t__webpack_require__.e(736);\n\treturn next();\n};","","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n",""],"names":["React","memo","ControlSizes","Controls","ControlsLayout","HeaderControls","mobileView","theme","onChangeTheme","textSize","onChangeTextSize","wideFormat","onChangeWideFormat","showMiniToc","onChangeShowMiniToc","createElement","controlClassName","controlSize","L","isWideView","className","displayName","TextSizes","Theme","DEFAULT_USER_SETTINGS","Light","M","fullScreen","getDocSettings","defaultTheme","defaultTextSize","defaultShowMiniToc","defaultWideFormat","defaultFullScreen","getSetting","strToBoolean","name","sessionStorage","getItem","saveSetting","value","setItem","String","str","withSavingSetting","settingName","onChange","updateRootClassName","fullHeader","document","body","filter","Boolean","join","block","b","Header","Content","Footer","Layout","props","children","doc","header","content","footer","Children","forEach","child","type","defaultProps","useState","useSettings","settings","setWideFormat","setFullScreen","setShowMiniToc","setTheme","setTextSize","onChangeFullScreen","useCallback","useEffect","MOBILE_VIEW_WIDTH_BREAKPOINT","useMobile","setMobileView","clientWidth","onResizeHandler","window","addEventListener","removeEventListener","PageConstructor","PageConstructorProvider","DocLeadingPage","DocPage","MermaidRuntime","Runtime","OpenapiSandbox","Page","data","pageProps","leading","Object","assign","App","router","lang","navigation","toc","headerHeight","logo","leftItems","rightItems","headerWithControls","some","item","custom","controls","blocks","page","withBorder","undefined","Dark","zoom","showMenu","bindKeys","renderToString","render","Element","e","matches","matchesSelector","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","selector","th","Array","prototype","call","querySelectorAll","el","event","href","target","locationOrigin","location","origin","startsWith","preventDefault","mainFileName","extention","endsWith","splitedHref","split","length"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"app.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAkC;AAE4D;;AAE9F;;AAgBO,MAAMK,cAAc,gBAAGJ,cAAI,CAC9B,CAAC;EACGK,UAAU;EAEVC,KAAK;EACLC,aAAa;EAEbC,QAAQ;EACRC,gBAAgB;EAEhBC,UAAU;EACVC,kBAAkB;EAElBC,WAAW;EACXC;AACJ,CAAC,KAAK;EACF,oBACId,mBAAA,CAACI,oCAAc;IACXY,gBAAgB,EAAE,SAAU;IAC5BC,WAAW,EAAEf,2BAAY,CAACgB,CAAE;IAC5BC,UAAU,EAAEb,UAAW;IACvBc,YAAY,EAAEd;EAAW,gBAEzBN,mBAAA,CAACG,uBAAQ;IACLkB,SAAS,EAAE,UAAW;IACtBd,KAAK,EAAEA,KAAM;IACbC,aAAa,EAAEA,aAAc;IAC7BG,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ACA;WACA;WACA;WACA;WACA;WACA;;;;;WC3BA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,EAAE;WACF;;;;;WCRA;WACA;WACA;WACA,cAAc,6BAA6B;WAC3C;;;;;WCJA;WACA;WACA;WACA;WACA;;;;;WCJA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;WACA;WACA;WACA;WACA;;;;;WCJA;;;;;WCAA;;WAEA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,gBAAgB,qBAAqB;WACrC;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA,aAAa;WACb;WACA,IAAI;WACJ;WACA;;WAEA;;WAEA;;WAEA;;;;;WCrCA;WACA;WACA;WACA;WACA;WACA;;;;;UELA;UACA","sources":["webpack://@diplodoc/client/./src/components/HeaderControls/index.tsx","webpack://@diplodoc/client/./src/utils.ts","webpack://@diplodoc/client/./src/components/Layout/index.tsx","webpack://@diplodoc/client/./src/hooks/useSettings.ts","webpack://@diplodoc/client/./src/hooks/useMobile.ts","webpack://@diplodoc/client/external commonjs2 \"@diplodoc/transform/dist/js/yfm\"","webpack://@diplodoc/client/../../extensions/latex/react/index.js","webpack://@diplodoc/client/./src/components/App/App.tsx","webpack://@diplodoc/client/./src/index.server.tsx","webpack://@diplodoc/client/./src/interceptors/leading-page-links.js","webpack://@diplodoc/client/./src/stub/empty-module.js","webpack://@diplodoc/client/external node-commonjs \"crypto\"","webpack://@diplodoc/client/external node-commonjs \"stream\"","webpack://@diplodoc/client/external node-commonjs \"url\"","webpack://@diplodoc/client/external node-commonjs \"util\"","webpack://@diplodoc/client/webpack/bootstrap","webpack://@diplodoc/client/webpack/runtime/amd options","webpack://@diplodoc/client/webpack/runtime/chunk loaded","webpack://@diplodoc/client/webpack/runtime/compat get default export","webpack://@diplodoc/client/webpack/runtime/define property getters","webpack://@diplodoc/client/webpack/runtime/ensure chunk","webpack://@diplodoc/client/webpack/runtime/get javascript chunk filename","webpack://@diplodoc/client/webpack/runtime/get mini-css chunk filename","webpack://@diplodoc/client/webpack/runtime/hasOwnProperty shorthand","webpack://@diplodoc/client/webpack/runtime/make namespace object","webpack://@diplodoc/client/webpack/runtime/node module decorator","webpack://@diplodoc/client/webpack/runtime/publicPath","webpack://@diplodoc/client/webpack/runtime/require chunk loading","webpack://@diplodoc/client/webpack/runtime/startup chunk dependencies","webpack://@diplodoc/client/webpack/before-startup","webpack://@diplodoc/client/webpack/startup","webpack://@diplodoc/client/webpack/after-startup"],"sourcesContent":["import React, {memo} from 'react';\n\nimport {ControlSizes, Controls, ControlsLayout, TextSizes, Theme} from '@diplodoc/components';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype OnChangeCallback = (value: any) => void;\n\ntype Props = {\n mobileView: boolean;\n\n theme: Theme;\n onChangeTheme: OnChangeCallback;\n textSize: TextSizes;\n onChangeTextSize: OnChangeCallback;\n wideFormat: boolean;\n onChangeWideFormat: OnChangeCallback;\n showMiniToc: boolean;\n onChangeShowMiniToc: OnChangeCallback;\n};\n\nexport const HeaderControls = memo<Props>(\n ({\n mobileView,\n\n theme,\n onChangeTheme,\n\n textSize,\n onChangeTextSize,\n\n wideFormat,\n onChangeWideFormat,\n\n showMiniToc,\n onChangeShowMiniToc,\n }) => {\n return (\n <ControlsLayout\n controlClassName={'Control'}\n controlSize={ControlSizes.L}\n isWideView={mobileView}\n isMobileView={mobileView}\n >\n <Controls\n className={'Controls'}\n theme={theme}\n onChangeTheme={onChangeTheme}\n wideFormat={wideFormat}\n onChangeWideFormat={onChangeWideFormat}\n showMiniToc={showMiniToc}\n onChangeShowMiniToc={onChangeShowMiniToc}\n textSize={textSize}\n onChangeTextSize={onChangeTextSize}\n />\n </ControlsLayout>\n );\n },\n);\n\nHeaderControls.displayName = 'HeaderControls';\n","import {Theme} from '@diplodoc/components';\n\nexport function strToBoolean(str: string | boolean) {\n if (typeof str === 'boolean') {\n return str;\n }\n\n return str ? str === 'true' : false;\n}\n\nexport function updateRootClassName({\n theme,\n mobileView = false,\n wideFormat = false,\n fullHeader = false,\n}: {\n theme: Theme;\n mobileView: boolean;\n wideFormat: boolean;\n fullHeader: boolean;\n}) {\n document.body.className = [\n 'g-root',\n mobileView ? 'mobile' : 'desktop',\n wideFormat && 'dc-root_wide-format',\n fullHeader && 'dc-root_full-header',\n theme === 'light' && 'g-root_theme_light',\n theme === 'dark' && 'g-root_theme_dark',\n ]\n .filter(Boolean)\n .join(' ');\n}\n","import React, {FC, PropsWithChildren, ReactElement} from 'react';\nimport block from 'bem-cn-lite';\n\nimport './Layout.scss';\n\nconst b = block('Layout');\n\nfunction Header() {\n return null;\n}\n\nfunction Content() {\n return null;\n}\n\nfunction Footer() {\n return null;\n}\n\ntype LayoutStatics = {\n Header: FC<PropsWithChildren>;\n Content: FC<PropsWithChildren>;\n Footer: FC<PropsWithChildren>;\n};\n\nexport const Layout: LayoutStatics & FC<PropsWithChildren<{doc?: boolean}>> = (props) => {\n const {children, doc} = props;\n let header, content, footer;\n\n React.Children.forEach(children as ReactElement[], (child: ReactElement) => {\n switch (child.type) {\n case Header:\n header = child.props.children;\n break;\n case Content:\n content = child.props.children;\n break;\n case Footer:\n footer = child.props.children;\n break;\n }\n });\n\n return (\n <div className={b()}>\n {header && <div className={b('header')}>{header}</div>}\n <div className={b('body')}>\n {content && <div className={b('content')}>{content}</div>}\n {footer && <div className={b('footer', {doc})}>{footer}</div>}\n </div>\n </div>\n );\n};\n\nLayout.displayName = 'Layout';\n\nLayout.defaultProps = {\n doc: false,\n};\n\nLayout.Header = Header;\nLayout.Content = Content;\nLayout.Footer = Footer;\n","import {strToBoolean} from '../utils';\nimport {useState} from 'react';\n\nimport {TextSizes, Theme} from '@diplodoc/components';\n\nconst DEFAULT_USER_SETTINGS = {\n theme: Theme.Light,\n textSize: TextSizes.M,\n showMiniToc: true,\n wideFormat: true,\n fullScreen: false,\n};\n\nexport function useSettings() {\n const settings = getSettings();\n\n const [wideFormat, setWideFormat] = useState(settings.wideFormat);\n const [fullScreen, setFullScreen] = useState(settings.fullScreen);\n const [showMiniToc, setShowMiniToc] = useState(settings.showMiniToc);\n const [theme, setTheme] = useState(settings.theme);\n const [textSize, setTextSize] = useState(settings.textSize);\n\n return {\n theme,\n onChangeTheme: withSavingSetting('theme', setTheme),\n textSize,\n onChangeTextSize: withSavingSetting('textSize', setTextSize),\n wideFormat,\n onChangeWideFormat: withSavingSetting('wideFormat', setWideFormat),\n showMiniToc,\n onChangeShowMiniToc: withSavingSetting('showMiniToc', setShowMiniToc),\n fullScreen,\n onChangeFullScreen: withSavingSetting('fullScreen', setFullScreen),\n };\n}\n\nfunction getSettings() {\n const theme = getSetting('theme');\n const textSize = getSetting('textSize');\n const showMiniToc = getSetting('showMiniToc');\n const wideFormat = getSetting('wideFormat');\n const fullScreen = getSetting('fullScreen');\n\n return {\n theme,\n textSize,\n showMiniToc: strToBoolean(showMiniToc),\n wideFormat: strToBoolean(wideFormat),\n fullScreen: strToBoolean(fullScreen),\n };\n}\n\ntype TSettings = typeof DEFAULT_USER_SETTINGS;\n\nfunction getSetting<T extends keyof TSettings>(name: T): TSettings[T] {\n if (typeof sessionStorage === 'undefined') {\n return DEFAULT_USER_SETTINGS[name];\n }\n\n try {\n return (sessionStorage.getItem(name) as TSettings[T]) || DEFAULT_USER_SETTINGS[name];\n } catch {\n return DEFAULT_USER_SETTINGS[name];\n }\n}\n\nfunction setSetting<T>(name: string, value: T) {\n try {\n sessionStorage.setItem(name, String(value));\n } catch {}\n}\n\nfunction withSavingSetting<T>(settingName: string, onChange: (value: T) => void) {\n return (value: T) => {\n setSetting<T>(settingName, value);\n\n onChange(value);\n };\n}\n","import {useCallback, useEffect, useState} from 'react';\n\nconst MOBILE_VIEW_WIDTH_BREAKPOINT = 769;\n\nexport function useMobile() {\n const [mobileView, setMobileView] = useState<boolean>(\n typeof document !== 'undefined' && document.body.clientWidth < MOBILE_VIEW_WIDTH_BREAKPOINT,\n );\n\n const onResizeHandler = useCallback(() => {\n setMobileView(document.body.clientWidth < MOBILE_VIEW_WIDTH_BREAKPOINT);\n }, []);\n\n useEffect(onResizeHandler, [onResizeHandler]);\n\n useEffect(() => {\n window.addEventListener('resize', onResizeHandler);\n\n return () => window.removeEventListener('resize', onResizeHandler);\n }, [onResizeHandler]);\n\n return mobileView;\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = require(\"@diplodoc/transform/dist/js/yfm\");","// src/react/index.ts\nimport { useCallback, useEffect, useState } from \"react\";\nfunction LatexRuntime(props) {\n const renderLatex = useLatex();\n useEffect(() => {\n renderLatex(props).catch(props.onError || (() => {\n }));\n });\n return null;\n}\nfunction useLatex() {\n const [latex, setLatex] = useState(null);\n const render = useCallback(\n async (options) => {\n if (latex) {\n return latex.run(options);\n }\n },\n [latex]\n );\n useEffect(() => {\n (window.latexJsonp = window.latexJsonp || []).push(setLatex);\n return () => {\n const index = window.latexJsonp.indexOf(setLatex);\n if (index > -1) {\n window.latexJsonp.splice(index, 1);\n }\n };\n }, []);\n return render;\n}\nexport {\n LatexRuntime,\n useLatex\n};\n//# sourceMappingURL=index.js.map\n","import React, {ReactElement, useEffect} from 'react';\n\nimport {\n NavigationData,\n PageConstructor,\n PageConstructorProvider,\n} from '@gravity-ui/page-constructor';\nimport {\n DocLeadingPage,\n DocLeadingPageData,\n DocPage,\n DocPageData,\n Lang,\n Router,\n Theme,\n} from '@diplodoc/components';\nimport {HeaderControls} from '../HeaderControls';\nimport {updateRootClassName} from '../../utils';\nimport {Layout} from '../Layout';\nimport {useSettings} from '../../hooks/useSettings';\nimport {useMobile} from '../../hooks/useMobile';\n\nimport '../../interceptors/leading-page-links';\n\nimport '@diplodoc/transform/dist/js/yfm';\nimport {MermaidRuntime} from '@diplodoc/mermaid-extension/react';\nimport {LatexRuntime} from '@diplodoc/latex-extension/react';\nimport {Runtime as OpenapiSandbox} from '@diplodoc/openapi-extension/runtime';\n\nimport './App.scss';\n\nexport interface AppProps {\n lang: Lang;\n router: Router;\n}\n\nexport type DocInnerProps<Data = DocLeadingPageData | DocPageData> = {\n data: Data;\n} & AppProps;\n\nexport type {DocLeadingPageData, DocPageData};\n\nfunction Page(props: DocInnerProps) {\n const {data, ...pageProps} = props;\n\n const Page = data.leading ? DocLeadingPage : DocPage;\n\n return (\n <Layout>\n <Layout.Content>\n {/*@ts-ignore*/}\n <Page {...data} {...pageProps} />\n </Layout.Content>\n </Layout>\n );\n}\n\ntype TocData = DocPageData['toc'] & {\n navigation?: NavigationData;\n};\n\nexport function App(props: DocInnerProps): ReactElement {\n const {data, router, lang} = props;\n const {navigation} = data.toc as TocData;\n\n const settings = useSettings();\n const mobileView = useMobile();\n\n const {theme, textSize, wideFormat, fullScreen, showMiniToc, onChangeFullScreen} = settings;\n const fullHeader = !fullScreen && Boolean(navigation);\n const headerHeight = fullHeader ? 64 : 0;\n const pageProps = {\n headerHeight,\n data,\n router,\n lang,\n wideFormat,\n showMiniToc,\n theme,\n textSize,\n fullScreen,\n onChangeFullScreen,\n };\n\n const rebase = (item: any) => {\n if (item.type !== 'link') {\n return item;\n }\n\n return {\n ...item,\n url: item.url.replace(/^\\/?/, '/'),\n };\n };\n\n useEffect(() => {\n updateRootClassName({\n theme,\n mobileView,\n wideFormat,\n fullHeader,\n });\n }, [theme, mobileView, wideFormat, fullHeader]);\n\n if (!navigation) {\n return (\n <div className=\"App\">\n <Page {...pageProps} {...settings} />\n </div>\n );\n }\n\n const {header = {}, logo} = navigation;\n const {leftItems = [], rightItems = []} = header as NavigationData['header'];\n const headerWithControls = rightItems.some((item: {type: string}) => item.type === 'controls');\n\n return (\n <div className=\"App\">\n <PageConstructorProvider theme={theme}>\n <PageConstructor\n custom={{\n navigation: {\n controls: () => (\n <HeaderControls {...settings} mobileView={mobileView} />\n ),\n },\n blocks: {\n page: () => (\n <Page {...pageProps} {...(headerWithControls ? {} : settings)} />\n ),\n },\n }}\n content={{\n blocks: [\n {\n type: 'page',\n },\n ],\n }}\n navigation={\n fullHeader\n ? {\n header: {\n withBorder: true,\n leftItems: leftItems.map(rebase),\n rightItems: rightItems.map(rebase),\n },\n logo,\n }\n : undefined\n }\n />\n </PageConstructorProvider>\n <OpenapiSandbox />\n <LatexRuntime />\n <MermaidRuntime\n theme={theme === Theme.Dark ? 'dark' : 'neutral'}\n zoom={{\n showMenu: true,\n bindKeys: true,\n }}\n />\n </div>\n );\n}\n","import React from 'react';\nimport {renderToString} from 'react-dom/server';\n\nimport {App, DocInnerProps, DocLeadingPageData, DocPageData} from './components/App/App';\n\nexport type {DocInnerProps, DocPageData, DocLeadingPageData};\n\nexport const render = (props: DocInnerProps) => renderToString(<App {...props} />);\n","(function () {\n /**\n * Element.matches() polyfill.\n * @link https://developer.mozilla.org/ru/docs/Web/API/Element/matches\n */\n if (typeof Element !== 'undefined') {\n (function (e) {\n const matches =\n e.matches ||\n e.matchesSelector ||\n e.webkitMatchesSelector ||\n e.mozMatchesSelector ||\n e.msMatchesSelector ||\n e.oMatchesSelector;\n\n if (matches) {\n e.matches = e.matchesSelector = matches;\n } else {\n e.matches = e.matchesSelector = function (selector) {\n const th = this;\n return Array.prototype.some.call(document.querySelectorAll(selector), (el) => {\n return el === th;\n });\n };\n }\n })(Element.prototype);\n }\n\n if (typeof document !== 'undefined') {\n document.addEventListener('click', (event) => {\n const href = event.target.href;\n const locationOrigin = window.location.origin;\n\n if (\n event.target.matches('.dc-doc-layout__center a') &&\n href.startsWith(locationOrigin)\n ) {\n event.preventDefault();\n\n const mainFileName = 'index';\n const extention = '.html';\n\n if (href.endsWith('/')) {\n window.location.href = `${href}${mainFileName}${extention}`;\n return;\n }\n\n // https://../file-name, https://../file-name#fragment\n const splitedHref = href.split('#');\n if (splitedHref.length > 0 && !splitedHref[0].endsWith(extention)) {\n splitedHref[0] += extention;\n window.location.href = splitedHref.join('#');\n return;\n }\n\n window.location.href = href;\n }\n });\n }\n})();\n","export default function () {}\n","module.exports = require(\"crypto\");","module.exports = require(\"stream\");","module.exports = require(\"url\");","module.exports = require(\"util\");","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// the startup function\n__webpack_require__.x = () => {\n\t// Load entry module and return exports\n\t// This entry module depends on other loaded chunks and execution need to be delayed\n\tvar __webpack_exports__ = __webpack_require__.O(undefined, [514,736], () => (__webpack_require__(6222)))\n\t__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n\treturn __webpack_exports__;\n};\n\n","__webpack_require__.amdO = {};","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + {\"514\":\"react\",\"736\":\"vendor\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks and sibling chunks for the entrypoint\n__webpack_require__.miniCssF = (chunkId) => {\n\t// return url for filenames based on template\n\treturn undefined;\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.p = \"\";","// no baseURI\n\n// object to store loaded chunks\n// \"1\" means \"loaded\", otherwise not loaded yet\nvar installedChunks = {\n\t143: 1\n};\n\n__webpack_require__.O.require = (chunkId) => (installedChunks[chunkId]);\n\nvar installChunk = (chunk) => {\n\tvar moreModules = chunk.modules, chunkIds = chunk.ids, runtime = chunk.runtime;\n\tfor(var moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\tfor(var i = 0; i < chunkIds.length; i++)\n\t\tinstalledChunks[chunkIds[i]] = 1;\n\t__webpack_require__.O();\n};\n\n// require() chunk loading for javascript\n__webpack_require__.f.require = (chunkId, promises) => {\n\t// \"1\" is the signal for \"already loaded\"\n\tif(!installedChunks[chunkId]) {\n\t\tif(true) { // all chunks have JS\n\t\t\tinstallChunk(require(\"./\" + __webpack_require__.u(chunkId)));\n\t\t} else installedChunks[chunkId] = 1;\n\t}\n};\n\n// no external install chunk\n\n// no HMR\n\n// no HMR manifest","var next = __webpack_require__.x;\n__webpack_require__.x = () => {\n\t__webpack_require__.e(514);\n\t__webpack_require__.e(736);\n\treturn next();\n};","","// run startup\nvar __webpack_exports__ = __webpack_require__.x();\n",""],"names":["React","memo","ControlSizes","Controls","ControlsLayout","HeaderControls","mobileView","theme","onChangeTheme","textSize","onChangeTextSize","wideFormat","onChangeWideFormat","showMiniToc","onChangeShowMiniToc","createElement","controlClassName","controlSize","L","isWideView","isMobileView","className","displayName","strToBoolean","str","updateRootClassName","fullHeader","document","body","filter","Boolean","join","block","b","Header","Content","Footer","Layout","props","children","doc","header","content","footer","Children","forEach","child","type","defaultProps","useState","TextSizes","Theme","DEFAULT_USER_SETTINGS","Light","M","fullScreen","useSettings","settings","getSettings","setWideFormat","setFullScreen","setShowMiniToc","setTheme","setTextSize","withSavingSetting","onChangeFullScreen","getSetting","name","sessionStorage","getItem","setSetting","value","setItem","String","settingName","onChange","useCallback","useEffect","MOBILE_VIEW_WIDTH_BREAKPOINT","useMobile","setMobileView","clientWidth","onResizeHandler","window","addEventListener","removeEventListener","PageConstructor","PageConstructorProvider","DocLeadingPage","DocPage","MermaidRuntime","LatexRuntime","Runtime","OpenapiSandbox","Page","data","pageProps","leading","Object","assign","App","router","lang","navigation","toc","headerHeight","rebase","item","url","replace","logo","leftItems","rightItems","headerWithControls","some","custom","controls","blocks","page","withBorder","map","undefined","Dark","zoom","showMenu","bindKeys","renderToString","render","Element","e","matches","matchesSelector","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector","selector","th","Array","prototype","call","querySelectorAll","el","event","href","target","locationOrigin","location","origin","startsWith","preventDefault","mainFileName","extention","endsWith","splitedHref","split","length"],"sourceRoot":""}
|