@dr.pogodin/react-utils 1.40.7 → 1.40.8
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.
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
*/
|
|
9
9
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
10
10
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
11
|
-
module.exports = factory(require("@
|
|
11
|
+
module.exports = factory(require("@dr.pogodin/js-utils"), require("@dr.pogodin/react-global-state"), require("@dr.pogodin/react-themes"), require("cookie"), require("dayjs"), require("node-forge/lib/aes"), require("node-forge/lib/forge"), require("qs"), require("react"), require("react-dom"), require("react-dom/client"), require("react-helmet"), require("react-router-dom"));
|
|
12
12
|
else if(typeof define === 'function' && define.amd)
|
|
13
|
-
define(["@
|
|
13
|
+
define(["@dr.pogodin/js-utils", "@dr.pogodin/react-global-state", "@dr.pogodin/react-themes", "cookie", "dayjs", "node-forge/lib/aes", "node-forge/lib/forge", "qs", "react", "react-dom", "react-dom/client", "react-helmet", "react-router-dom"], factory);
|
|
14
14
|
else if(typeof exports === 'object')
|
|
15
|
-
exports["@dr.pogodin/react-utils"] = factory(require("@
|
|
15
|
+
exports["@dr.pogodin/react-utils"] = factory(require("@dr.pogodin/js-utils"), require("@dr.pogodin/react-global-state"), require("@dr.pogodin/react-themes"), require("cookie"), require("dayjs"), require("node-forge/lib/aes"), require("node-forge/lib/forge"), require("qs"), require("react"), require("react-dom"), require("react-dom/client"), require("react-helmet"), require("react-router-dom"));
|
|
16
16
|
else
|
|
17
|
-
root["@dr.pogodin/react-utils"] = factory(root["@
|
|
18
|
-
})(typeof self !== 'undefined' ? self : this, function(
|
|
17
|
+
root["@dr.pogodin/react-utils"] = factory(root["@dr.pogodin/js-utils"], root["@dr.pogodin/react-global-state"], root["@dr.pogodin/react-themes"], root["cookie"], root["dayjs"], root["node-forge/lib/aes"], root["node-forge/lib/forge"], root["qs"], root["react"], root["react-dom"], root["react-dom/client"], root["react-helmet"], root["react-router-dom"]);
|
|
18
|
+
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE__dr_pogodin_js_utils__, __WEBPACK_EXTERNAL_MODULE__dr_pogodin_react_global_state__, __WEBPACK_EXTERNAL_MODULE__dr_pogodin_react_themes__, __WEBPACK_EXTERNAL_MODULE_cookie__, __WEBPACK_EXTERNAL_MODULE_dayjs__, __WEBPACK_EXTERNAL_MODULE_node_forge_lib_aes__, __WEBPACK_EXTERNAL_MODULE_node_forge_lib_forge__, __WEBPACK_EXTERNAL_MODULE_qs__, __WEBPACK_EXTERNAL_MODULE_react__, __WEBPACK_EXTERNAL_MODULE_react_dom__, __WEBPACK_EXTERNAL_MODULE_react_dom_client__, __WEBPACK_EXTERNAL_MODULE_react_helmet__, __WEBPACK_EXTERNAL_MODULE_react_router_dom__) {
|
|
19
19
|
return /******/ (function() { // webpackBootstrap
|
|
20
20
|
/******/ "use strict";
|
|
21
21
|
/******/ var __webpack_modules__ = ({
|
|
@@ -26,7 +26,7 @@ return /******/ (function() { // webpackBootstrap
|
|
|
26
26
|
\******************************/
|
|
27
27
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
28
28
|
|
|
29
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ getInj; }\n/* harmony export */ });\n/* harmony import */ var node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node-forge/lib/forge */ \"node-forge/lib/forge\");\n/* harmony import */ var node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node-forge/lib/aes */ \"node-forge/lib/aes\");\n/* harmony import */ var node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _shared_utils_isomorphy_buildInfo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/utils/isomorphy/buildInfo */ \"./src/shared/utils/isomorphy/buildInfo.ts\");\n// Encapsulates retrieval of server-side data injection into HTML template.\n\n/* global document */\n\n// Note: this way, only required part of \"node-forge\": AES, and some utils,\n// is bundled into client-side code.\n\n\n\n\n// Safeguard is needed here, because the server-side version of Docusaurus docs\n// is compiled (at least now) with settings suggesting it is a client-side\n// environment, but there is no document.\
|
|
29
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ getInj; }\n/* harmony export */ });\n/* harmony import */ var node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node-forge/lib/forge */ \"node-forge/lib/forge\");\n/* harmony import */ var node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! node-forge/lib/aes */ \"node-forge/lib/aes\");\n/* harmony import */ var node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(node_forge_lib_aes__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _shared_utils_isomorphy_buildInfo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/utils/isomorphy/buildInfo */ \"./src/shared/utils/isomorphy/buildInfo.ts\");\n// Encapsulates retrieval of server-side data injection into HTML template.\n\n/* global document */\n\n// Note: this way, only required part of \"node-forge\": AES, and some utils,\n// is bundled into client-side code.\n\n\n\n\n// Safeguard is needed here, because the server-side version of Docusaurus docs\n// is compiled (at least now) with settings suggesting it is a client-side\n// environment, but there is no document.\nlet inj = {};\nconst metaElement = typeof document !== 'undefined' ? document.querySelector('meta[itemprop=\"drpruinj\"]') : null;\nif (metaElement) {\n metaElement.remove();\n let data = node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.decode64(metaElement.content);\n const {\n key\n } = (0,_shared_utils_isomorphy_buildInfo__WEBPACK_IMPORTED_MODULE_2__.getBuildInfo)();\n const d = node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().cipher.createDecipher('AES-CBC', key);\n d.start({\n iv: data.slice(0, key.length)\n });\n d.update(node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.createBuffer(data.slice(key.length)));\n d.finish();\n data = node_forge_lib_forge__WEBPACK_IMPORTED_MODULE_0___default().util.decodeUtf8(d.output.data);\n inj = eval(`(${data})`); // eslint-disable-line no-eval\n} else if (typeof window !== 'undefined' && window.REACT_UTILS_INJECTION) {\n inj = window.REACT_UTILS_INJECTION;\n delete window.REACT_UTILS_INJECTION;\n} else {\n // Otherwise, a bunch of dependent stuff will easily fail in non-standard\n // environments, where no client-side initialization is performed. Like tests,\n // Docusaurus examples, etc.\n inj = {};\n}\nfunction getInj() {\n return inj;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/client/getInj.ts?");
|
|
30
30
|
|
|
31
31
|
/***/ }),
|
|
32
32
|
|
|
@@ -36,7 +36,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
36
36
|
\******************************/
|
|
37
37
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
38
38
|
|
|
39
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ Launch; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom/client */ \"react-dom/client\");\n/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom_client__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ \"react-router-dom\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _getInj__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getInj */ \"./src/client/getInj.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n// Initialization of client-side code.\n/* global document */\n\n\n\n\n\n\n\n/**\n * Prepares and launches the app at client side.\n * @param Application Root application component\n * @param [options={}] Optional. Additional settings.\n */\nfunction Launch(Application) {\n
|
|
39
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ Launch; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom/client */ \"react-dom/client\");\n/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom_client__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-router-dom */ \"react-router-dom\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _getInj__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getInj */ \"./src/client/getInj.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n// Initialization of client-side code.\n/* global document */\n\n\n\n\n\n\n\n/**\n * Prepares and launches the app at client side.\n * @param Application Root application component\n * @param [options={}] Optional. Additional settings.\n */\nfunction Launch(Application) {\n let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n const container = document.getElementById('react-view');\n if (!container) throw Error('Failed to find container for React app');\n const scene = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_1__.GlobalStateProvider, {\n initialState: (0,_getInj__WEBPACK_IMPORTED_MODULE_4__[\"default\"])().ISTATE || options.initialState,\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(react_router_dom__WEBPACK_IMPORTED_MODULE_3__.BrowserRouter, {\n future: {\n v7_relativeSplatPath: true\n },\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(Application, {})\n })\n });\n if (options.dontHydrate) {\n const root = (0,react_dom_client__WEBPACK_IMPORTED_MODULE_2__.createRoot)(container);\n root.render(scene);\n } else (0,react_dom_client__WEBPACK_IMPORTED_MODULE_2__.hydrateRoot)(container, scene);\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/client/index.tsx?");
|
|
40
40
|
|
|
41
41
|
/***/ }),
|
|
42
42
|
|
|
@@ -46,7 +46,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
46
46
|
\**********************/
|
|
47
47
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
48
48
|
|
|
49
|
-
eval("var __dirname = \"/\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Barrier: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Barrier; },\n/* harmony export */ BaseButton: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.BaseButton; },\n/* harmony export */ BaseModal: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.BaseModal; },\n/* harmony export */ Button: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Button; },\n/* harmony export */ Checkbox: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Checkbox; },\n/* harmony export */ CustomDropdown: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.CustomDropdown; },\n/* harmony export */ Dropdown: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Dropdown; },\n/* harmony export */ Emitter: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Emitter; },\n/* harmony export */ GlobalStateProvider: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.GlobalStateProvider; },\n/* harmony export */ Input: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Input; },\n/* harmony export */ Link: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Link; },\n/* harmony export */ MetaTags: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.MetaTags; },\n/* harmony export */ Modal: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Modal; },\n/* harmony export */ NavLink: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.NavLink; },\n/* harmony export */ PageLayout: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.PageLayout; },\n/* harmony export */ Semaphore: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Semaphore; },\n/* harmony export */ Switch: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Switch; },\n/* harmony export */ TextArea: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.TextArea; },\n/* harmony export */ ThemeProvider: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.ThemeProvider; },\n/* harmony export */ Throbber: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Throbber; },\n/* harmony export */ WithTooltip: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.WithTooltip; },\n/* harmony export */ YouTubeVideo: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.YouTubeVideo; },\n/* harmony export */ client: function() { return /* binding */ client; },\n/* harmony export */ config: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.config; },\n/* harmony export */ getGlobalState: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.getGlobalState; },\n/* harmony export */ getSsrContext: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.getSsrContext; },\n/* harmony export */ isomorphy: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.isomorphy; },\n/* harmony export */ newAsyncDataEnvelope: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.newAsyncDataEnvelope; },\n/* harmony export */ server: function() { return /* binding */ server; },\n/* harmony export */ splitComponent: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.splitComponent; },\n/* harmony export */ themed: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.themed; },\n/* harmony export */ time: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.time; },\n/* harmony export */ useAsyncCollection: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.useAsyncCollection; },\n/* harmony export */ useAsyncData: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.useAsyncData; },\n/* harmony export */ useGlobalState: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.useGlobalState; },\n/* harmony export */ webpack: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.webpack; },\n/* harmony export */ withGlobalStateType: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.withGlobalStateType; },\n/* harmony export */ withRetries: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.withRetries; }\n/* harmony export */ });\n/* harmony import */ var _styles_global_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./styles/global.scss */ \"./src/styles/global.scss\");\n/* harmony import */ var _shared_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shared/utils */ \"./src/shared/utils/index.ts\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _shared_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shared/components */ \"./src/shared/components/index.ts\");\n\n\
|
|
49
|
+
eval("var __dirname = \"/\";\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Barrier: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Barrier; },\n/* harmony export */ BaseButton: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.BaseButton; },\n/* harmony export */ BaseModal: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.BaseModal; },\n/* harmony export */ Button: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Button; },\n/* harmony export */ Checkbox: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Checkbox; },\n/* harmony export */ CustomDropdown: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.CustomDropdown; },\n/* harmony export */ Dropdown: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Dropdown; },\n/* harmony export */ Emitter: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Emitter; },\n/* harmony export */ GlobalStateProvider: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.GlobalStateProvider; },\n/* harmony export */ Input: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Input; },\n/* harmony export */ Link: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Link; },\n/* harmony export */ MetaTags: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.MetaTags; },\n/* harmony export */ Modal: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Modal; },\n/* harmony export */ NavLink: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.NavLink; },\n/* harmony export */ PageLayout: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.PageLayout; },\n/* harmony export */ Semaphore: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.Semaphore; },\n/* harmony export */ Switch: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Switch; },\n/* harmony export */ TextArea: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.TextArea; },\n/* harmony export */ ThemeProvider: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.ThemeProvider; },\n/* harmony export */ Throbber: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.Throbber; },\n/* harmony export */ WithTooltip: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.WithTooltip; },\n/* harmony export */ YouTubeVideo: function() { return /* reexport safe */ _shared_components__WEBPACK_IMPORTED_MODULE_3__.YouTubeVideo; },\n/* harmony export */ client: function() { return /* binding */ client; },\n/* harmony export */ config: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.config; },\n/* harmony export */ getGlobalState: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.getGlobalState; },\n/* harmony export */ getSsrContext: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.getSsrContext; },\n/* harmony export */ isomorphy: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.isomorphy; },\n/* harmony export */ newAsyncDataEnvelope: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.newAsyncDataEnvelope; },\n/* harmony export */ server: function() { return /* binding */ server; },\n/* harmony export */ splitComponent: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.splitComponent; },\n/* harmony export */ themed: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.themed; },\n/* harmony export */ time: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.time; },\n/* harmony export */ useAsyncCollection: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.useAsyncCollection; },\n/* harmony export */ useAsyncData: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.useAsyncData; },\n/* harmony export */ useGlobalState: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.useGlobalState; },\n/* harmony export */ webpack: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.webpack; },\n/* harmony export */ withGlobalStateType: function() { return /* reexport safe */ _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__.withGlobalStateType; },\n/* harmony export */ withRetries: function() { return /* reexport safe */ _shared_utils__WEBPACK_IMPORTED_MODULE_1__.withRetries; }\n/* harmony export */ });\n/* harmony import */ var _styles_global_scss__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./styles/global.scss */ \"./src/styles/global.scss\");\n/* harmony import */ var _shared_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./shared/utils */ \"./src/shared/utils/index.ts\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _shared_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shared/components */ \"./src/shared/components/index.ts\");\n\n\nconst server = _shared_utils__WEBPACK_IMPORTED_MODULE_1__.webpack.requireWeak('./server', __dirname);\nconst client = server ? undefined : (__webpack_require__(/*! ./client */ \"./src/client/index.tsx\")[\"default\"]);\n\n\n\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/index.ts?");
|
|
50
50
|
|
|
51
51
|
/***/ }),
|
|
52
52
|
|
|
@@ -56,7 +56,7 @@ eval("var __dirname = \"/\";\n__webpack_require__.r(__webpack_exports__);\n/* ha
|
|
|
56
56
|
\************************************************/
|
|
57
57
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
58
58
|
|
|
59
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseButton: function() { return /* binding */ BaseButton; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Link */ \"./src/shared/components/Link.tsx\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ \"./src/shared/components/Button/style.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n// The <Button> component implements a standard button / button-like link.\n\n\n\n\n\n\n/* eslint-disable react/function-component-definition */\
|
|
59
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseButton: function() { return /* binding */ BaseButton; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Link */ \"./src/shared/components/Link.tsx\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ \"./src/shared/components/Button/style.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n// The <Button> component implements a standard button / button-like link.\n\n\n\n\n\n\n/* eslint-disable react/function-component-definition */\nconst BaseButton = _ref => {\n let {\n active,\n children,\n disabled,\n enforceA,\n onClick,\n onMouseDown,\n openNewTab,\n replace,\n testId,\n theme,\n to\n } = _ref;\n let className = theme.button;\n if (active && theme.active) className += ` ${theme.active}`;\n if (disabled) {\n if (theme.disabled) className += ` ${theme.disabled}`;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(\"div\", {\n className: className,\n \"data-testid\": false ? 0 : testId,\n children: children\n });\n }\n if (to) {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n className: className,\n \"data-testid\": false ? 0 : testId,\n enforceA: enforceA,\n onClick: onClick,\n onMouseDown: onMouseDown,\n openNewTab: openNewTab,\n replace: replace,\n to: to,\n children: children\n });\n }\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(\"div\", {\n className: className,\n \"data-testid\": false ? 0 : testId,\n onClick: onClick,\n onKeyDown: onClick && (e => {\n if (e.key === 'Enter') onClick(e);\n }),\n onMouseDown: onMouseDown,\n role: \"button\",\n tabIndex: 0,\n children: children\n });\n};\n\n/**\n * Button component theme: a map of CSS\n * class names to append to button elements:\n * @prop {string} [active] to the root element of active button.\n * @prop {string} [button] to the root element of any button.\n * @prop {string} [disabled] to the root element of disabled button.\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default()(BaseButton, 'Button', _style_scss__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Button/index.tsx?");
|
|
60
60
|
|
|
61
61
|
/***/ }),
|
|
62
62
|
|
|
@@ -66,7 +66,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
66
66
|
\**************************************************/
|
|
67
67
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
68
68
|
|
|
69
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/Checkbox/theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\
|
|
69
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/Checkbox/theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\nconst Checkbox = _ref => {\n let {\n checked,\n disabled,\n label,\n onChange,\n testId,\n theme\n } = _ref;\n let containerClassName = theme.container;\n if (disabled) containerClassName += ` ${theme.disabled}`;\n let checkboxClassName = theme.checkbox;\n if (checked === 'indeterminate') checkboxClassName += ` ${theme.indeterminate}`;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(\"div\", {\n className: containerClassName,\n children: [label === undefined ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"div\", {\n className: theme.label,\n children: label\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"input\", {\n checked: checked === undefined ? undefined : checked === true,\n className: checkboxClassName,\n \"data-testid\": false ? 0 : testId,\n disabled: disabled,\n onChange: onChange,\n onClick: e => e.stopPropagation(),\n type: \"checkbox\"\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default()(Checkbox, 'Checkbox', _theme_scss__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Checkbox/index.tsx?");
|
|
70
70
|
|
|
71
71
|
/***/ }),
|
|
72
72
|
|
|
@@ -76,7 +76,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_
|
|
|
76
76
|
\*****************************************************/
|
|
77
77
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
78
78
|
|
|
79
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var
|
|
79
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-router-dom */ \"react-router-dom\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ \"./src/shared/components/GenericLink/style.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* global window */\n\n\n\n\n\n/**\n * The `<Link>` component, and almost identical `<NavLink>` component, are\n * auxiliary wrappers around\n * [React Router](https://github.com/ReactTraining/react-router)'s\n * `<Link>` and `<NavLink>` components; they help to handle external and\n * internal links in uniform manner.\n *\n * @param [props] Component properties.\n * @param [props.className] CSS classes to apply to the link.\n * @param [props.disabled] Disables the link.\n * @param [props.enforceA] `true` enforces rendering of the link as\n * a simple `<a>` element.\n * @param [props.keepScrollPosition] If `true`, and the link is\n * rendered as a React Router's component, it won't reset the viewport scrolling\n * position to the origin when clicked.\n * @param [props.onClick] Event handler to trigger upon click.\n * @param [props.onMouseDown] Event handler to trigger on MouseDown\n * event.\n * @param [props.openNewTab] If `true` the link opens in a new tab.\n * @param [props.replace] When `true`, the link will replace current\n * entry in the history stack instead of adding a new one.\n * @param [props.to] Link URL.\n * @param [props.activeClassName] **`<NavLink>`** only: CSS class(es)\n * to apply to rendered link when it is active.\n * @param [props.activeStyle] **`<NavLink>`** only: CSS styles\n * to apply to the rendered link when it is active.\n * @param [props.exact] **`<NavLink>`** only: if `true`, the active\n * class/style will only be applied if the location is matched exactly.\n * @param [props.isActive] **`<NavLink>`** only: Add extra\n * logic for determining whether the link is active. This should be used if you\n * want to do more than verify that the link’s pathname matches the current URL\n * pathname.\n * @param [props.location] **`<NavLink>`** only: `isActive` compares\n * current history location (usually the current browser URL). To compare to\n * a different location, a custom `location` can be passed.\n * @param [props.strict] **`<NavLink>`** only: . When `true`, trailing\n * slash on a location’s pathname will be taken into consideration when\n * determining if the location matches the current URL. See the `<Route strict>`\n * documentation for more information.\n */\nconst GenericLink = _ref => {\n let {\n children,\n className,\n disabled,\n enforceA,\n keepScrollPosition,\n onClick,\n onMouseDown,\n openNewTab,\n replace,\n routerLinkType,\n to,\n ...rest\n } = _ref;\n /* Renders Link as <a> element if:\n * - It is opted explicitely by `enforceA` prop;\n * - It should be opened in a new tab;\n * - It is an absolte URL (starts with http:// or https://);\n * - It is anchor link (starts with #). */\n if (disabled || enforceA || openNewTab || to !== null && to !== void 0 && to.match(/^(#|(https?|mailto):)/)) {\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"a\", {\n className: (className ? className + \" \" : \"\") + \"-dr-pogodin-react-utils___src-shared-components-GenericLink-style___link___zH52sA\"\n // TODO: This requires a fix: disabled is not really an attribute of <a>\n // tag, thus for disabled option we rather should render a plain text\n // styled as a link.\n // disabled={disabled}\n ,\n href: to,\n onClick: disabled ? e => e.preventDefault() : onClick,\n onMouseDown: disabled ? e => e.preventDefault() : onMouseDown,\n rel: \"noopener noreferrer\",\n target: openNewTab ? '_blank' : '',\n children: children\n });\n }\n const L = routerLinkType;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(L, {\n className: className\n // disabled\n ,\n onMouseDown: onMouseDown,\n replace: replace,\n to: to,\n onClick: e => {\n // Executes the user-provided event handler, if any.\n if (onClick) onClick(e);\n\n // By default, clicking the link scrolls the page to beginning.\n if (!keepScrollPosition) window.scroll(0, 0);\n },\n ...rest,\n children: children\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (GenericLink);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/GenericLink/index.tsx?");
|
|
80
80
|
|
|
81
81
|
/***/ }),
|
|
82
82
|
|
|
@@ -86,7 +86,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bab
|
|
|
86
86
|
\***********************************************/
|
|
87
87
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
88
88
|
|
|
89
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var
|
|
89
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/Input/theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\n/**\n * Themeable input field, based on the standard HTML `<input>` element.\n * @param [props]\n * @param [props.label] Input label.\n * @param [props.theme] _Ad hoc_ theme.\n * @param [props...] [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n * @param [props...] Any other properties are passed to the underlying\n * `<input>` element.\n */\nconst Input = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((_ref, ref) => {\n let {\n label,\n testId,\n theme,\n ...rest\n } = _ref;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"span\", {\n className: theme.container,\n children: [label === undefined ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: theme.label,\n children: label\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"input\", {\n className: theme.input,\n \"data-testid\": false ? 0 : testId,\n ref: ref,\n ...rest\n })]\n });\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default()(Input, 'Input', _theme_scss__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Input/index.tsx?");
|
|
90
90
|
|
|
91
91
|
/***/ }),
|
|
92
92
|
|
|
@@ -96,7 +96,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bab
|
|
|
96
96
|
\****************************************/
|
|
97
97
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
98
98
|
|
|
99
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var
|
|
99
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-router-dom */ \"react-router-dom\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _GenericLink__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GenericLink */ \"./src/shared/components/GenericLink/index.tsx\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/**\n * The Link wraps around React Router's Link component, to automatically replace\n * it by the regular <a> element when:\n * - The target reference points to another domain;\n * - User opts to open the reference in a new tab;\n * - User explicitely opts to use <a>.\n */\n\n\n\n\nconst Link = props =>\n/*#__PURE__*/\n/* eslint-disable react/jsx-props-no-spreading */\n(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_GenericLink__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n ...props,\n routerLinkType: react_router_dom__WEBPACK_IMPORTED_MODULE_0__.Link\n})\n/* eslint-enable react/jsx-props-no-spreading */;\n/* harmony default export */ __webpack_exports__[\"default\"] = (Link);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Link.tsx?");
|
|
100
100
|
|
|
101
101
|
/***/ }),
|
|
102
102
|
|
|
@@ -106,7 +106,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bab
|
|
|
106
106
|
\********************************************/
|
|
107
107
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
108
108
|
|
|
109
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_helmet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-helmet */ \"react-helmet\");\n/* harmony import */ var react_helmet__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_helmet__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\
|
|
109
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_helmet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-helmet */ \"react-helmet\");\n/* harmony import */ var react_helmet__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_helmet__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\nconst Context = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.createContext)({\n description: '',\n title: ''\n});\n\n/**\n * The `<MetaTags>` component is an auxiliary wrapper around `react-helmet`,\n * which helps to inject meta tags (page title, a brief content description,\n * and social media thumbnails) into generated pages.\n *\n * When `<MetaTags>` are nested within the app's component tree, meta tags\n * content injected by components encountered down the tree overrides tags\n * injected by previously encountered `<MetaTags>` components.\n *\n * **Children:** `<MetaTags>` children, if any, are rendered at the component's\n * location. The context passes down all meta tag properties of parent\n * `<MetaTag>` instances. These properties can fetched within children\n * hierarchy in the following way, thus facilitating tags modification by\n * children:\n * ```jsx\n * import { useContext } from 'react';\n * import { MetaTags } from '@dr.pogodin/react-utils';\n * export default function SampleComponent() {\n * const { title, description, ...rest } = useContext(MetaTags.Context);\n * // Do something with these props here, e.g. prefix the page title with\n * // the component name:\n * return (\n * <MetaTags title={`Sample component - ${title}`} />\n * );\n * }\n * ```\n * @param [props]\n * @param [props.description] Page description to use in\n * the `description` meta tag, and as a default description of Open Graph Tags.\n * @param [props.image] The absolute URL of thumbnail image to use\n * in Open Graph Tags (`twitter:image`, and `og:image`). By default these tags\n * are not injected.\n *\n * **BEWARE:** It must be a complete, absolute URL, including the correct\n * website domain and HTTP schema.\n *\n * @param [props.siteName]: The site name to use in `twitter:site`,\n * and `og:sitename` tags. By default these tags are not injected.\n *\n * @param [props.socialDescription] The site description to use in\n * `twitter:description` and `og:description` meta tags. By default the value of\n * `description` prop is used.\n * @param [props.socialTitle] The page title to use in\n * `twitter:title`, `og:title`, and `og:image:alt` tags. By default the value of\n * `title` prop is used. Also the `og:image:alt` tag is only injected if `image`\n * prop is present.\n *\n * @param props.title: The page name to use in the `<title>` tag.\n * It is also used as the default value of `socialTitle` prop.\n *\n * @param [props.url] The page URL to use in `og:url` tag.\n * By default the tag is not injected.\n */\nconst MetaTags = _ref => {\n let {\n children,\n description,\n image,\n siteName,\n socialDescription,\n socialTitle,\n title,\n url\n } = _ref;\n const socTitle = socialTitle || title;\n const socDesc = socialDescription || description;\n const context = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({\n description,\n image,\n siteName,\n socialDescription,\n socialTitle,\n title,\n url\n }), [description, image, siteName, socialDescription, socialTitle, title, url]);\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.Fragment, {\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(react_helmet__WEBPACK_IMPORTED_MODULE_1__.Helmet, {\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"title\", {\n children: title\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"meta\", {\n name: \"description\",\n content: description\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"meta\", {\n name: \"twitter:card\",\n content: \"summary_large_image\"\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"meta\", {\n name: \"twitter:title\",\n content: socTitle\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"meta\", {\n name: \"twitter:description\",\n content: socDesc\n }), image ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"meta\", {\n name: \"twitter:image\",\n content: image\n }) : null, siteName ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"meta\", {\n name: \"twitter:site\",\n content: `@${siteName}`\n }) : null, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"meta\", {\n name: \"og:title\",\n content: socTitle\n }), image ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"meta\", {\n name: \"og:image\",\n content: image\n }) : null, image ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"meta\", {\n name: \"og:image:alt\",\n content: socTitle\n }) : null, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"meta\", {\n name: \"og:description\",\n content: socDesc\n }), siteName ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"meta\", {\n name: \"og:sitename\",\n content: siteName\n }) : null, url ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"meta\", {\n name: \"og:url\",\n content: url\n }) : null]\n }), children ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Context.Provider, {\n value: context,\n children: children\n }) : null]\n });\n};\nMetaTags.Context = Context;\n/* harmony default export */ __webpack_exports__[\"default\"] = (MetaTags);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/MetaTags.tsx?");
|
|
110
110
|
|
|
111
111
|
/***/ }),
|
|
112
112
|
|
|
@@ -116,7 +116,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var reac
|
|
|
116
116
|
\***********************************************/
|
|
117
117
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
118
118
|
|
|
119
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseModal: function() { return /* binding */ BaseModal; }\n/* harmony export */ });\n/* harmony import */ var
|
|
119
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BaseModal: function() { return /* binding */ BaseModal; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _base_theme_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./base-theme.scss */ \"./src/shared/components/Modal/base-theme.scss\");\n/* harmony import */ var _styles_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./styles.scss */ \"./src/shared/components/Modal/styles.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* global document */\n\n\n\n\n\n\n\n/**\n * The `<Modal>` component implements a simple themeable modal window, wrapped\n * into the default theme. `<BaseModal>` exposes the base non-themed component.\n * **Children:** Component children are rendered as the modal content.\n * @param {object} props Component properties. Beside props documented below,\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties) are supported as well.\n * @param {function} [props.onCancel] The callback to trigger when user\n * clicks outside the modal, or presses Escape. It is expected to hide the\n * modal.\n * @param {ModalTheme} [props.theme] _Ad hoc_ theme.\n */\nconst BaseModal = _ref => {\n let {\n cancelOnScrolling,\n children,\n containerStyle,\n dontDisableScrolling,\n onCancel,\n style,\n testId,\n testIdForOverlay,\n theme\n } = _ref;\n const containerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const overlayRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const [portal, setPortal] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n const p = document.createElement('div');\n document.body.appendChild(p);\n setPortal(p);\n return () => {\n document.body.removeChild(p);\n };\n }, []);\n\n // Sets up modal cancellation of scrolling, if opted-in.\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n if (cancelOnScrolling && onCancel) {\n window.addEventListener('scroll', onCancel);\n window.addEventListener('wheel', onCancel);\n }\n return () => {\n if (cancelOnScrolling && onCancel) {\n window.removeEventListener('scroll', onCancel);\n window.removeEventListener('wheel', onCancel);\n }\n };\n }, [cancelOnScrolling, onCancel]);\n\n // Disables window scrolling, if it is not opted-out.\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n if (!dontDisableScrolling) {\n document.body.classList.add(_styles_scss__WEBPACK_IMPORTED_MODULE_4__[\"default\"].scrollingDisabledByModal);\n }\n return () => {\n if (!dontDisableScrolling) {\n document.body.classList.remove(_styles_scss__WEBPACK_IMPORTED_MODULE_4__[\"default\"].scrollingDisabledByModal);\n }\n };\n }, [dontDisableScrolling]);\n const focusLast = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n onFocus: () => {\n var _containerRef$current, _overlayRef$current;\n const elems = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.querySelectorAll('*');\n for (let i = elems.length - 1; i >= 0; --i) {\n var _elems$i;\n (_elems$i = elems[i]) === null || _elems$i === void 0 || _elems$i.focus();\n if (document.activeElement === elems[i]) return;\n }\n (_overlayRef$current = overlayRef.current) === null || _overlayRef$current === void 0 || _overlayRef$current.focus();\n }\n /* eslint-disable jsx-a11y/no-noninteractive-tabindex */,\n tabIndex: 0\n /* eslint-enable jsx-a11y/no-noninteractive-tabindex */\n }), []);\n return portal ? /*#__PURE__*/react_dom__WEBPACK_IMPORTED_MODULE_1___default().createPortal(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {\n children: [focusLast, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n \"aria-label\": \"Cancel\",\n className: theme.overlay,\n \"data-testid\": false ? 0 : testIdForOverlay,\n onClick: e => {\n if (onCancel) {\n onCancel();\n e.stopPropagation();\n }\n },\n onKeyDown: e => {\n if (e.key === 'Escape' && onCancel) {\n onCancel();\n e.stopPropagation();\n }\n },\n ref: node => {\n if (node && node !== overlayRef.current) {\n overlayRef.current = node;\n node.focus();\n }\n },\n role: \"button\",\n tabIndex: 0\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n \"aria-modal\": \"true\",\n className: theme.container,\n \"data-testid\": false ? 0 : testId,\n onClick: e => e.stopPropagation(),\n onWheel: event => event.stopPropagation(),\n ref: containerRef,\n role: \"dialog\",\n style: style !== null && style !== void 0 ? style : containerStyle,\n children: children\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n onFocus: () => {\n var _overlayRef$current2;\n (_overlayRef$current2 = overlayRef.current) === null || _overlayRef$current2 === void 0 || _overlayRef$current2.focus();\n }\n /* eslint-disable jsx-a11y/no-noninteractive-tabindex */,\n tabIndex: 0\n /* eslint-enable jsx-a11y/no-noninteractive-tabindex */\n }), focusLast]\n }), portal) : null;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_2___default()(BaseModal, 'Modal', _base_theme_scss__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n\n/* Non-themed version of the Modal. */\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Modal/index.tsx?");
|
|
120
120
|
|
|
121
121
|
/***/ }),
|
|
122
122
|
|
|
@@ -126,7 +126,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
126
126
|
\*******************************************/
|
|
127
127
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
128
128
|
|
|
129
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var
|
|
129
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-router-dom */ \"react-router-dom\");\n/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_router_dom__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _GenericLink__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GenericLink */ \"./src/shared/components/GenericLink/index.tsx\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\nconst NavLink = props =>\n/*#__PURE__*/\n/* eslint-disable react/jsx-props-no-spreading */\n(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_GenericLink__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n ...props,\n routerLinkType: react_router_dom__WEBPACK_IMPORTED_MODULE_0__.NavLink\n})\n/* eslint-enable react/jsx-props-no-spreading */;\n/* harmony default export */ __webpack_exports__[\"default\"] = (NavLink);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/NavLink.tsx?");
|
|
130
130
|
|
|
131
131
|
/***/ }),
|
|
132
132
|
|
|
@@ -136,7 +136,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bab
|
|
|
136
136
|
\****************************************************/
|
|
137
137
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
138
138
|
|
|
139
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _base_theme_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base-theme.scss */ \"./src/shared/components/PageLayout/base-theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n/**\n * Simple and themeable page layout. It keeps the main content centered in\n * a column of limited width, which fills entire viewport on small screens\n * (under `$screen-md = 1024px` size). At larger screens the column keeps\n * `$screen-md` size, and it is centered at the page, surrounded by side\n * panels, where additional content can be displayed.\n *\n * **Children:** Component children are rendered as the content of main panel.\n * @param {object} [props] Component properties.\n * @param {Node} [props.leftSidePanelContent] The content for left side panel.\n * @param {Node} [props.rightSidePanelContent] The content for right side panel.\n * @param {PageLayoutTheme} [props.theme] _Ad hoc_ theme.\n * @param {...any} [props....]\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\
|
|
139
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _base_theme_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base-theme.scss */ \"./src/shared/components/PageLayout/base-theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n/**\n * Simple and themeable page layout. It keeps the main content centered in\n * a column of limited width, which fills entire viewport on small screens\n * (under `$screen-md = 1024px` size). At larger screens the column keeps\n * `$screen-md` size, and it is centered at the page, surrounded by side\n * panels, where additional content can be displayed.\n *\n * **Children:** Component children are rendered as the content of main panel.\n * @param {object} [props] Component properties.\n * @param {Node} [props.leftSidePanelContent] The content for left side panel.\n * @param {Node} [props.rightSidePanelContent] The content for right side panel.\n * @param {PageLayoutTheme} [props.theme] _Ad hoc_ theme.\n * @param {...any} [props....]\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\nconst PageLayout = _ref => {\n let {\n children,\n leftSidePanelContent,\n rightSidePanelContent,\n theme\n } = _ref;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(\"div\", {\n className: theme.container,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"div\", {\n className: [theme.sidePanel, theme.leftSidePanel].join(' '),\n children: leftSidePanelContent\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"div\", {\n className: theme.mainPanel,\n children: children\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"div\", {\n className: [theme.sidePanel, theme.rightSidePanel].join(' '),\n children: rightSidePanelContent\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default()(PageLayout, 'PageLayout', _base_theme_scss__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/PageLayout/index.tsx?");
|
|
140
140
|
|
|
141
141
|
/***/ }),
|
|
142
142
|
|
|
@@ -146,7 +146,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_
|
|
|
146
146
|
\**************************************************/
|
|
147
147
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
148
148
|
|
|
149
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var
|
|
149
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ \"./src/shared/components/TextArea/style.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\nconst TextArea = _ref => {\n let {\n disabled,\n onChange,\n onKeyDown,\n placeholder,\n theme,\n value\n } = _ref;\n const hiddenAreaRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const [height, setHeight] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();\n const [localValue, setLocalValue] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(value || '');\n if (value !== undefined && localValue !== value) setLocalValue(value);\n\n // This resizes text area's height when its width is changed for any reason.\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n const el = hiddenAreaRef.current;\n if (!el) return undefined;\n const cb = () => {\n setHeight(el.scrollHeight);\n };\n const observer = new ResizeObserver(cb);\n observer.observe(el);\n return () => {\n observer.disconnect();\n };\n }, []);\n\n // This resizes the text area when its content is modified.\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n const el = hiddenAreaRef.current;\n if (el) setHeight(el.scrollHeight);\n }, [localValue]);\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"div\", {\n className: theme.container,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"textarea\", {\n // This text area is hidden underneath the primary one below,\n // and it is used for text measurements, to implement auto-scaling\n // of the primary textarea's height.\n readOnly: true,\n ref: hiddenAreaRef,\n className: `${theme.textarea} ${theme.hidden}`,\n value: localValue\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"textarea\", {\n disabled: disabled\n // When value is \"undefined\" the text area is not-managed, and we should\n // manage it internally for the measurement / resizing functionality\n // to work.\n ,\n onChange: value === undefined ? e => {\n setLocalValue(e.target.value);\n } : onChange,\n onKeyDown: onKeyDown,\n placeholder: placeholder,\n style: {\n height\n },\n className: theme.textarea,\n value: localValue\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default()(TextArea, 'TextArea', _style_scss__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/TextArea/index.tsx?");
|
|
150
150
|
|
|
151
151
|
/***/ }),
|
|
152
152
|
|
|
@@ -156,7 +156,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bab
|
|
|
156
156
|
\**************************************************/
|
|
157
157
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
158
158
|
|
|
159
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/Throbber/theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n/**\n * Throbber is an \"action in progress\" indicator, which renders\n * three bouncing circles as a simple pending activity indicator,\n * and can be further themed to a certain degree.\n * @param {object} [props] Component properties.\n * @param {ThrobberTheme} [props.theme] _Ad hoc_ theme.\n * @param {...any} [props....]\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\
|
|
159
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/Throbber/theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n/**\n * Throbber is an \"action in progress\" indicator, which renders\n * three bouncing circles as a simple pending activity indicator,\n * and can be further themed to a certain degree.\n * @param {object} [props] Component properties.\n * @param {ThrobberTheme} [props.theme] _Ad hoc_ theme.\n * @param {...any} [props....]\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\nconst Throbber = _ref => {\n let {\n theme\n } = _ref;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(\"span\", {\n className: theme.container,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"span\", {\n className: theme.circle\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"span\", {\n className: theme.circle\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(\"span\", {\n className: theme.circle\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default()(Throbber, 'Throbber', _theme_scss__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/Throbber/index.tsx?");
|
|
160
160
|
|
|
161
161
|
/***/ }),
|
|
162
162
|
|
|
@@ -166,7 +166,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_
|
|
|
166
166
|
\*******************************************************/
|
|
167
167
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
168
168
|
|
|
169
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ PLACEMENTS: function() { return /* binding */ PLACEMENTS; }\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"@babel/runtime/helpers/slicedToArray\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);\n\n/**\n * The actual tooltip component. It is rendered outside the regular document\n * hierarchy, and with sub-components managed without React to achieve the best\n * performance during animation.\n */\n/* global document, window */\n\n\n\n/* Valid placements of the rendered tooltip. They will be overriden when\n * necessary to fit the tooltip within the viewport. */\nvar PLACEMENTS = /*#__PURE__*/function (PLACEMENTS) {\n PLACEMENTS[\"ABOVE_CURSOR\"] = \"ABOVE_CURSOR\";\n PLACEMENTS[\"ABOVE_ELEMENT\"] = \"ABOVE_ELEMENT\";\n PLACEMENTS[\"BELOW_CURSOR\"] = \"BELOW_CURSOR\";\n PLACEMENTS[\"BELOW_ELEMENT\"] = \"BELOW_ELEMENT\";\n return PLACEMENTS;\n}({});\nvar ARROW_STYLE_DOWN = ['border-bottom-color:transparent', 'border-left-color:transparent', 'border-right-color:transparent'].join(';');\nvar ARROW_STYLE_UP = ['border-top-color:transparent', 'border-left-color:transparent', 'border-right-color:transparent'].join(';');\n/**\n * Creates tooltip components.\n * @ignore\n * @param {object} theme Themes to use for tooltip container, arrow,\n * and content.\n * @return {object} Object with DOM references to the container components:\n * container, arrow, content.\n */\nfunction createTooltipComponents(theme) {\n var arrow = document.createElement('div');\n if (theme.arrow) arrow.setAttribute('class', theme.arrow);\n var content = document.createElement('div');\n if (theme.content) content.setAttribute('class', theme.content);\n var container = document.createElement('div');\n if (theme.container) container.setAttribute('class', theme.container);\n container.appendChild(arrow);\n container.appendChild(content);\n document.body.appendChild(container);\n return {\n container,\n arrow,\n content\n };\n}\n/**\n * Generates bounding client rectangles for tooltip components.\n * @ignore\n * @param tooltip DOM references to the tooltip components.\n * @param tooltip.arrow\n * @param tooltip.container\n * @return Object holding tooltip rectangles in\n * two fields.\n */\nfunction calcTooltipRects(tooltip) {\n return {\n arrow: tooltip.arrow.getBoundingClientRect(),\n container: tooltip.container.getBoundingClientRect()\n };\n}\n\n/**\n * Calculates the document viewport size.\n * @ignore\n * @return {{x, y, width, height}}\n */\nfunction calcViewportRect() {\n var _window = window,\n scrollX = _window.scrollX,\n scrollY = _window.scrollY;\n var _document = document,\n _document$documentEle = _document.documentElement,\n clientHeight = _document$documentEle.clientHeight,\n clientWidth = _document$documentEle.clientWidth;\n return {\n left: scrollX,\n right: scrollX + clientWidth,\n top: scrollY,\n bottom: scrollY + clientHeight\n };\n}\n\n/**\n * Calculates tooltip and arrow positions for the placement just above\n * the cursor.\n * @ignore\n * @param {number} x Cursor page-x position.\n * @param {number} y Cursor page-y position.\n * @param {object} tooltipRects Bounding client rectangles of tooltip parts.\n * @param {object} tooltipRects.arrow\n * @param {object} tooltipRects.container\n * @return {object} Contains the following fields:\n * - {number} arrowX\n * - {number} arrowY\n * - {number} containerX\n * - {number} containerY\n * - {string} baseArrowStyle\n */\nfunction calcPositionAboveXY(x, y, tooltipRects) {\n var arrow = tooltipRects.arrow,\n container = tooltipRects.container;\n return {\n arrowX: 0.5 * (container.width - arrow.width),\n arrowY: container.height,\n containerX: x - container.width / 2,\n containerY: y - container.height - arrow.height / 1.5,\n // TODO: Instead of already setting the base style here, we should\n // introduce a set of constants for arrow directions, which will help\n // to do checks dependant on the arrow direction.\n baseArrowStyle: ARROW_STYLE_DOWN\n };\n}\n\n/*\nconst HIT = {\n NONE: false,\n LEFT: 'LEFT',\n RIGHT: 'RIGHT',\n TOP: 'TOP',\n BOTTOM: 'BOTTOM',\n};\n*/\n\n/**\n * Checks whether\n * @param {object} pos\n * @param {object} tooltipRects\n * @param {object} viewportRect\n * @return {HIT}\n */\n/*\nfunction checkViewportFit(pos, tooltipRects, viewportRect) {\n const { containerX, containerY } = pos;\n if (containerX < viewportRect.left + 6) return HIT.LEFT;\n if (containerX > viewportRect.right - 6) return HIT.RIGHT;\n return HIT.NONE;\n}\n*/\n\n/**\n * Shifts tooltip horizontally to fit into the viewport, while keeping\n * the arrow pointed to the XY point.\n * @param {number} x\n * @param {number} y\n * @param {object} pos\n * @param {number} pageXOffset\n * @param {number} pageXWidth\n */\n/*\nfunction xPageFitCorrection(x, y, pos, pageXOffset, pageXWidth) {\n if (pos.containerX < pageXOffset + 6) {\n pos.containerX = pageXOffset + 6;\n pos.arrowX = Math.max(6, pageX - containerX - arrowRect.width / 2);\n } else {\n const maxX = pageXOffset + docRect.width - containerRect.width - 6;\n if (containerX > maxX) {\n containerX = maxX;\n arrowX = Math.min(\n containerRect.width - 6,\n pageX - containerX - arrowRect.width / 2,\n );\n }\n }\n}\n*/\n\n/**\n * Sets positions of tooltip components to point the tooltip to the specified\n * page point.\n * @ignore\n * @param pageX\n * @param pageY\n * @param placement\n * @param element DOM reference to the element wrapped by the tooltip.\n * @param tooltip\n * @param tooltip.arrow DOM reference to the tooltip arrow.\n * @param tooltip.container DOM reference to the tooltip container.\n */\nfunction setComponentPositions(pageX, pageY, placement, element, tooltip) {\n var tooltipRects = calcTooltipRects(tooltip);\n var viewportRect = calcViewportRect();\n\n /* Default container coords: tooltip at the top. */\n var pos = calcPositionAboveXY(pageX, pageY, tooltipRects);\n if (pos.containerX < viewportRect.left + 6) {\n pos.containerX = viewportRect.left + 6;\n pos.arrowX = Math.max(6, pageX - pos.containerX - tooltipRects.arrow.width / 2);\n } else {\n var maxX = viewportRect.right - 6 - tooltipRects.container.width;\n if (pos.containerX > maxX) {\n pos.containerX = maxX;\n pos.arrowX = Math.min(tooltipRects.container.width - 6, pageX - pos.containerX - tooltipRects.arrow.width / 2);\n }\n }\n\n /* If tooltip has not enough space on top - make it bottom tooltip. */\n if (pos.containerY < viewportRect.top + 6) {\n pos.containerY += tooltipRects.container.height + 2 * tooltipRects.arrow.height;\n pos.arrowY -= tooltipRects.container.height + tooltipRects.arrow.height;\n pos.baseArrowStyle = ARROW_STYLE_UP;\n }\n var containerStyle = `left:${pos.containerX}px;top:${pos.containerY}px`;\n tooltip.container.setAttribute('style', containerStyle);\n var arrowStyle = `${pos.baseArrowStyle};left:${pos.arrowX}px;top:${pos.arrowY}px`;\n tooltip.arrow.setAttribute('style', arrowStyle);\n}\n\n/* The Tooltip component itself. */\nvar Tooltip = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(function (_ref, ref) {\n var children = _ref.children,\n theme = _ref.theme;\n // NOTE: The way it has to be implemented, for clean mounting and unmounting\n // at the client side, the <Tooltip> is fully mounted into DOM in the next\n // rendering cycles, and only then it can be correctly measured and positioned.\n // Thus, when we create the <Tooltip> we have to record its target positioning\n // details, and then apply them when it is created.\n\n var _useRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)({\n lastElement: undefined,\n lastPageX: 0,\n lastPageY: 0,\n lastPlacement: undefined\n }),\n heap = _useRef.current;\n var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null),\n _useState2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_useState, 2),\n components = _useState2[0],\n setComponents = _useState2[1];\n var pointTo = function pointTo(pageX, pageY, placement, element) {\n heap.lastElement = element;\n heap.lastPageX = pageX;\n heap.lastPageY = pageY;\n heap.lastPlacement = placement;\n if (components) {\n setComponentPositions(pageX, pageY, placement, element, components);\n }\n };\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useImperativeHandle)(ref, function () {\n return {\n pointTo\n };\n });\n\n /* Inits and destroys tooltip components. */\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n var x = createTooltipComponents(theme);\n setComponents(x);\n return function () {\n document.body.removeChild(x.container);\n setComponents(null);\n };\n }, [theme]);\n (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(function () {\n if (components) {\n setComponentPositions(heap.lastPageX, heap.lastPageY, heap.lastPlacement, heap.lastElement, components);\n }\n }, [components,\n // BEWARE: Careful about these dependencies - they are updated when mouse\n // is moved over the tool-tipped element, thus potentially may cause\n // unnecessary firing of this effect on each mouse event. It does not\n // happen now just because the mouse movements themselves are not causing\n // the component re-rendering, thus dependencies of this effect are not\n // really re-evaluated.\n heap.lastPageX, heap.lastPageY, heap.lastPlacement, heap.lastElement]);\n return components ? /*#__PURE__*/(0,react_dom__WEBPACK_IMPORTED_MODULE_2__.createPortal)(children, components.content) : null;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (Tooltip);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/WithTooltip/Tooltip.tsx?");
|
|
169
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ PLACEMENTS: function() { return /* binding */ PLACEMENTS; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"react-dom\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/**\n * The actual tooltip component. It is rendered outside the regular document\n * hierarchy, and with sub-components managed without React to achieve the best\n * performance during animation.\n */\n/* global document, window */\n\n\n\n/* Valid placements of the rendered tooltip. They will be overriden when\n * necessary to fit the tooltip within the viewport. */\nlet PLACEMENTS = /*#__PURE__*/function (PLACEMENTS) {\n PLACEMENTS[\"ABOVE_CURSOR\"] = \"ABOVE_CURSOR\";\n PLACEMENTS[\"ABOVE_ELEMENT\"] = \"ABOVE_ELEMENT\";\n PLACEMENTS[\"BELOW_CURSOR\"] = \"BELOW_CURSOR\";\n PLACEMENTS[\"BELOW_ELEMENT\"] = \"BELOW_ELEMENT\";\n return PLACEMENTS;\n}({});\nconst ARROW_STYLE_DOWN = ['border-bottom-color:transparent', 'border-left-color:transparent', 'border-right-color:transparent'].join(';');\nconst ARROW_STYLE_UP = ['border-top-color:transparent', 'border-left-color:transparent', 'border-right-color:transparent'].join(';');\n/**\n * Creates tooltip components.\n * @ignore\n * @param {object} theme Themes to use for tooltip container, arrow,\n * and content.\n * @return {object} Object with DOM references to the container components:\n * container, arrow, content.\n */\nfunction createTooltipComponents(theme) {\n const arrow = document.createElement('div');\n if (theme.arrow) arrow.setAttribute('class', theme.arrow);\n const content = document.createElement('div');\n if (theme.content) content.setAttribute('class', theme.content);\n const container = document.createElement('div');\n if (theme.container) container.setAttribute('class', theme.container);\n container.appendChild(arrow);\n container.appendChild(content);\n document.body.appendChild(container);\n return {\n container,\n arrow,\n content\n };\n}\n/**\n * Generates bounding client rectangles for tooltip components.\n * @ignore\n * @param tooltip DOM references to the tooltip components.\n * @param tooltip.arrow\n * @param tooltip.container\n * @return Object holding tooltip rectangles in\n * two fields.\n */\nfunction calcTooltipRects(tooltip) {\n return {\n arrow: tooltip.arrow.getBoundingClientRect(),\n container: tooltip.container.getBoundingClientRect()\n };\n}\n\n/**\n * Calculates the document viewport size.\n * @ignore\n * @return {{x, y, width, height}}\n */\nfunction calcViewportRect() {\n const {\n scrollX,\n scrollY\n } = window;\n const {\n documentElement: {\n clientHeight,\n clientWidth\n }\n } = document;\n return {\n left: scrollX,\n right: scrollX + clientWidth,\n top: scrollY,\n bottom: scrollY + clientHeight\n };\n}\n\n/**\n * Calculates tooltip and arrow positions for the placement just above\n * the cursor.\n * @ignore\n * @param {number} x Cursor page-x position.\n * @param {number} y Cursor page-y position.\n * @param {object} tooltipRects Bounding client rectangles of tooltip parts.\n * @param {object} tooltipRects.arrow\n * @param {object} tooltipRects.container\n * @return {object} Contains the following fields:\n * - {number} arrowX\n * - {number} arrowY\n * - {number} containerX\n * - {number} containerY\n * - {string} baseArrowStyle\n */\nfunction calcPositionAboveXY(x, y, tooltipRects) {\n const {\n arrow,\n container\n } = tooltipRects;\n return {\n arrowX: 0.5 * (container.width - arrow.width),\n arrowY: container.height,\n containerX: x - container.width / 2,\n containerY: y - container.height - arrow.height / 1.5,\n // TODO: Instead of already setting the base style here, we should\n // introduce a set of constants for arrow directions, which will help\n // to do checks dependant on the arrow direction.\n baseArrowStyle: ARROW_STYLE_DOWN\n };\n}\n\n/*\nconst HIT = {\n NONE: false,\n LEFT: 'LEFT',\n RIGHT: 'RIGHT',\n TOP: 'TOP',\n BOTTOM: 'BOTTOM',\n};\n*/\n\n/**\n * Checks whether\n * @param {object} pos\n * @param {object} tooltipRects\n * @param {object} viewportRect\n * @return {HIT}\n */\n/*\nfunction checkViewportFit(pos, tooltipRects, viewportRect) {\n const { containerX, containerY } = pos;\n if (containerX < viewportRect.left + 6) return HIT.LEFT;\n if (containerX > viewportRect.right - 6) return HIT.RIGHT;\n return HIT.NONE;\n}\n*/\n\n/**\n * Shifts tooltip horizontally to fit into the viewport, while keeping\n * the arrow pointed to the XY point.\n * @param {number} x\n * @param {number} y\n * @param {object} pos\n * @param {number} pageXOffset\n * @param {number} pageXWidth\n */\n/*\nfunction xPageFitCorrection(x, y, pos, pageXOffset, pageXWidth) {\n if (pos.containerX < pageXOffset + 6) {\n pos.containerX = pageXOffset + 6;\n pos.arrowX = Math.max(6, pageX - containerX - arrowRect.width / 2);\n } else {\n const maxX = pageXOffset + docRect.width - containerRect.width - 6;\n if (containerX > maxX) {\n containerX = maxX;\n arrowX = Math.min(\n containerRect.width - 6,\n pageX - containerX - arrowRect.width / 2,\n );\n }\n }\n}\n*/\n\n/**\n * Sets positions of tooltip components to point the tooltip to the specified\n * page point.\n * @ignore\n * @param pageX\n * @param pageY\n * @param placement\n * @param element DOM reference to the element wrapped by the tooltip.\n * @param tooltip\n * @param tooltip.arrow DOM reference to the tooltip arrow.\n * @param tooltip.container DOM reference to the tooltip container.\n */\nfunction setComponentPositions(pageX, pageY, placement, element, tooltip) {\n const tooltipRects = calcTooltipRects(tooltip);\n const viewportRect = calcViewportRect();\n\n /* Default container coords: tooltip at the top. */\n const pos = calcPositionAboveXY(pageX, pageY, tooltipRects);\n if (pos.containerX < viewportRect.left + 6) {\n pos.containerX = viewportRect.left + 6;\n pos.arrowX = Math.max(6, pageX - pos.containerX - tooltipRects.arrow.width / 2);\n } else {\n const maxX = viewportRect.right - 6 - tooltipRects.container.width;\n if (pos.containerX > maxX) {\n pos.containerX = maxX;\n pos.arrowX = Math.min(tooltipRects.container.width - 6, pageX - pos.containerX - tooltipRects.arrow.width / 2);\n }\n }\n\n /* If tooltip has not enough space on top - make it bottom tooltip. */\n if (pos.containerY < viewportRect.top + 6) {\n pos.containerY += tooltipRects.container.height + 2 * tooltipRects.arrow.height;\n pos.arrowY -= tooltipRects.container.height + tooltipRects.arrow.height;\n pos.baseArrowStyle = ARROW_STYLE_UP;\n }\n const containerStyle = `left:${pos.containerX}px;top:${pos.containerY}px`;\n tooltip.container.setAttribute('style', containerStyle);\n const arrowStyle = `${pos.baseArrowStyle};left:${pos.arrowX}px;top:${pos.arrowY}px`;\n tooltip.arrow.setAttribute('style', arrowStyle);\n}\n\n/* The Tooltip component itself. */\nconst Tooltip = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((_ref, ref) => {\n let {\n children,\n theme\n } = _ref;\n // NOTE: The way it has to be implemented, for clean mounting and unmounting\n // at the client side, the <Tooltip> is fully mounted into DOM in the next\n // rendering cycles, and only then it can be correctly measured and positioned.\n // Thus, when we create the <Tooltip> we have to record its target positioning\n // details, and then apply them when it is created.\n\n const {\n current: heap\n } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({\n lastElement: undefined,\n lastPageX: 0,\n lastPageY: 0,\n lastPlacement: undefined\n });\n const [components, setComponents] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);\n const pointTo = (pageX, pageY, placement, element) => {\n heap.lastElement = element;\n heap.lastPageX = pageX;\n heap.lastPageY = pageY;\n heap.lastPlacement = placement;\n if (components) {\n setComponentPositions(pageX, pageY, placement, element, components);\n }\n };\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(ref, () => ({\n pointTo\n }));\n\n /* Inits and destroys tooltip components. */\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n const x = createTooltipComponents(theme);\n setComponents(x);\n return () => {\n document.body.removeChild(x.container);\n setComponents(null);\n };\n }, [theme]);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n if (components) {\n setComponentPositions(heap.lastPageX, heap.lastPageY, heap.lastPlacement, heap.lastElement, components);\n }\n }, [components,\n // BEWARE: Careful about these dependencies - they are updated when mouse\n // is moved over the tool-tipped element, thus potentially may cause\n // unnecessary firing of this effect on each mouse event. It does not\n // happen now just because the mouse movements themselves are not causing\n // the component re-rendering, thus dependencies of this effect are not\n // really re-evaluated.\n heap.lastPageX, heap.lastPageY, heap.lastPlacement, heap.lastElement]);\n return components ? /*#__PURE__*/(0,react_dom__WEBPACK_IMPORTED_MODULE_1__.createPortal)(children, components.content) : null;\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (Tooltip);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/WithTooltip/Tooltip.tsx?");
|
|
170
170
|
|
|
171
171
|
/***/ }),
|
|
172
172
|
|
|
@@ -176,7 +176,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
176
176
|
\*****************************************************/
|
|
177
177
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
178
178
|
|
|
179
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var
|
|
179
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _Tooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Tooltip */ \"./src/shared/components/WithTooltip/Tooltip.tsx\");\n/* harmony import */ var _default_theme_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./default-theme.scss */ \"./src/shared/components/WithTooltip/default-theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* global window */\n\n\n\n\n\n\n/**\n * Implements a simple to use and themeable tooltip component, _e.g._\n * ```js\n * <WithTooltip tip=\"This is example tooltip.\">\n * <p>Hover to see the tooltip.</p>\n * </WithTooltip>\n * ```\n * **Children:** Children are rendered in the place of `<WithTooltip>`,\n * and when hovered the tooltip is shown. By default the wrapper itself is\n * `<div>` block with `display: inline-block`.\n * @param {object} props Component properties.\n * @param {React.node} props.tip – Anything React is able to render,\n * _e.g._ a tooltip text. This will be the tooltip content.\n * @param {WithTooltipTheme} props.theme _Ad hoc_ theme.\n */\nconst Wrapper = _ref => {\n let {\n children,\n placement = _Tooltip__WEBPACK_IMPORTED_MODULE_2__.PLACEMENTS.ABOVE_CURSOR,\n tip,\n theme\n } = _ref;\n const {\n current: heap\n } = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)({\n lastCursorX: 0,\n lastCursorY: 0,\n triggeredByTouch: false,\n timerId: undefined\n });\n const tooltipRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)();\n const wrapperRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const [showTooltip, setShowTooltip] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);\n const updatePortalPosition = (cursorX, cursorY) => {\n if (!showTooltip) {\n heap.lastCursorX = cursorX;\n heap.lastCursorY = cursorY;\n\n // If tooltip was triggered by a touch, we delay its opening by a bit,\n // to ensure it was not a touch-click - in the case of touch click we\n // want to do the click, rather than show the tooltip, and the delay\n // gives click handler a chance to abort the tooltip openning.\n if (heap.triggeredByTouch) {\n if (!heap.timerId) {\n heap.timerId = setTimeout(() => {\n heap.triggeredByTouch = false;\n heap.timerId = undefined;\n setShowTooltip(true);\n }, 300);\n }\n\n // Otherwise we can just open the tooltip right away.\n } else setShowTooltip(true);\n } else {\n const wrapperRect = wrapperRef.current.getBoundingClientRect();\n if (cursorX < wrapperRect.left || cursorX > wrapperRect.right || cursorY < wrapperRect.top || cursorY > wrapperRect.bottom) {\n setShowTooltip(false);\n } else if (tooltipRef.current) {\n tooltipRef.current.pointTo(cursorX + window.scrollX, cursorY + window.scrollY, placement, wrapperRef.current);\n }\n }\n };\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n if (showTooltip && tip !== null) {\n // This is necessary to ensure that even when a single mouse event\n // arrives to a tool-tipped component, the tooltip is correctly positioned\n // once opened (because similar call above does not have effect until\n // the tooltip is fully mounted, and that is delayed to future rendering\n // cycle due to the implementation).\n if (tooltipRef.current) {\n tooltipRef.current.pointTo(heap.lastCursorX + window.scrollX, heap.lastCursorY + window.scrollY, placement, wrapperRef.current);\n }\n const listener = () => setShowTooltip(false);\n window.addEventListener('scroll', listener);\n return () => window.removeEventListener('scroll', listener);\n }\n return undefined;\n }, [heap.lastCursorX, heap.lastCursorY, placement, showTooltip, tip]);\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(\"div\", {\n className: theme.wrapper,\n onMouseLeave: () => setShowTooltip(false),\n onMouseMove: e => updatePortalPosition(e.clientX, e.clientY),\n onClick: () => {\n if (heap.timerId) {\n clearTimeout(heap.timerId);\n heap.timerId = undefined;\n heap.triggeredByTouch = false;\n }\n },\n onTouchStart: () => {\n heap.triggeredByTouch = true;\n },\n ref: wrapperRef,\n role: \"presentation\",\n children: [showTooltip && tip !== null ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Tooltip__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n ref: tooltipRef,\n theme: theme,\n children: tip\n }) : null, children]\n });\n};\nconst ThemedWrapper = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default()(Wrapper, 'WithTooltip', _default_theme_scss__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\nconst e = ThemedWrapper;\ne.PLACEMENTS = _Tooltip__WEBPACK_IMPORTED_MODULE_2__.PLACEMENTS;\n/* harmony default export */ __webpack_exports__[\"default\"] = (e);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/WithTooltip/index.tsx?");
|
|
180
180
|
|
|
181
181
|
/***/ }),
|
|
182
182
|
|
|
@@ -186,7 +186,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bab
|
|
|
186
186
|
\******************************************************/
|
|
187
187
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
188
188
|
|
|
189
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! qs */ \"qs\");\n/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _Throbber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Throbber */ \"./src/shared/components/Throbber/index.tsx\");\n/* harmony import */ var _base_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./base.scss */ \"./src/shared/components/YouTubeVideo/base.scss\");\n/* harmony import */ var _throbber_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./throbber.scss */ \"./src/shared/components/YouTubeVideo/throbber.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\n\n\n/**\n * A component for embeding a YouTube video.\n * @param [props] Component properties.\n * @param [props.autoplay] If `true` the video will start to play\n * automatically once loaded.\n * @param [props.src] URL of the video to play. Can be in any of\n * the following formats, and keeps any additional query parameters understood\n * by the YouTube IFrame player:\n * - `https://www.youtube.com/watch?v=NdF6Rmt6Ado`\n * - `https://youtu.be/NdF6Rmt6Ado`\n * - `https://www.youtube.com/embed/NdF6Rmt6Ado`\n * @param [props.theme] _Ad hoc_ theme.\n * @param [props.title] The `title` attribute to add to the player\n * IFrame.\n */\
|
|
189
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! qs */ \"qs\");\n/* harmony import */ var qs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(qs__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _Throbber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Throbber */ \"./src/shared/components/Throbber/index.tsx\");\n/* harmony import */ var _base_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./base.scss */ \"./src/shared/components/YouTubeVideo/base.scss\");\n/* harmony import */ var _throbber_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./throbber.scss */ \"./src/shared/components/YouTubeVideo/throbber.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\n\n\n/**\n * A component for embeding a YouTube video.\n * @param [props] Component properties.\n * @param [props.autoplay] If `true` the video will start to play\n * automatically once loaded.\n * @param [props.src] URL of the video to play. Can be in any of\n * the following formats, and keeps any additional query parameters understood\n * by the YouTube IFrame player:\n * - `https://www.youtube.com/watch?v=NdF6Rmt6Ado`\n * - `https://youtu.be/NdF6Rmt6Ado`\n * - `https://www.youtube.com/embed/NdF6Rmt6Ado`\n * @param [props.theme] _Ad hoc_ theme.\n * @param [props.title] The `title` attribute to add to the player\n * IFrame.\n */\nconst YouTubeVideo = _ref => {\n var _url;\n let {\n autoplay,\n src,\n theme,\n title\n } = _ref;\n const srcParts = src.split('?');\n let url = srcParts[0];\n const queryString = srcParts[1];\n const query = queryString ? qs__WEBPACK_IMPORTED_MODULE_0___default().parse(queryString) : {};\n const videoId = query.v || ((_url = url) === null || _url === void 0 || (_url = _url.match(/\\/([a-zA-Z0-9-_]*)$/)) === null || _url === void 0 ? void 0 : _url[1]);\n url = `https://www.youtube.com/embed/${videoId}`;\n delete query.v;\n query.autoplay = autoplay ? '1' : '0';\n url += `?${qs__WEBPACK_IMPORTED_MODULE_0___default().stringify(query)}`;\n\n // TODO: https://developers.google.com/youtube/player_parameters\n // More query parameters can be exposed via the component props.\n\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n className: theme.container,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Throbber__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n theme: _throbber_scss__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"iframe\", {\n allow: \"autoplay\",\n allowFullScreen: true,\n className: theme.video,\n src: url,\n title: title\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default()(YouTubeVideo, 'YouTubeVideo', _base_scss__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/YouTubeVideo/index.tsx?");
|
|
190
190
|
|
|
191
191
|
/***/ }),
|
|
192
192
|
|
|
@@ -206,7 +206,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
206
206
|
\**************************************************************************/
|
|
207
207
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
208
208
|
|
|
209
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ areEqual: function() { return /* binding */ areEqual; }\n/* harmony export */ });\n/* harmony import */ var
|
|
209
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ areEqual: function() { return /* binding */ areEqual; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Modal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../Modal */ \"./src/shared/components/Modal/index.tsx\");\n/* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ \"./src/shared/components/selectors/CustomDropdown/Options/style.scss\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../common */ \"./src/shared/components/selectors/common.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\n\nfunction areEqual(a, b) {\n return (a === null || a === void 0 ? void 0 : a.left) === (b === null || b === void 0 ? void 0 : b.left) && (a === null || a === void 0 ? void 0 : a.top) === (b === null || b === void 0 ? void 0 : b.top) && (a === null || a === void 0 ? void 0 : a.width) === (b === null || b === void 0 ? void 0 : b.width);\n}\nconst Options = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((_ref, ref) => {\n let {\n containerClass,\n containerStyle,\n filter,\n onCancel,\n onChange,\n optionClass,\n options\n } = _ref;\n const opsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useImperativeHandle)(ref, () => ({\n measure: () => {\n var _opsRef$current, _opsRef$current2;\n const e = (_opsRef$current = opsRef.current) === null || _opsRef$current === void 0 ? void 0 : _opsRef$current.parentElement;\n if (!e) return undefined;\n const rect = (_opsRef$current2 = opsRef.current) === null || _opsRef$current2 === void 0 ? void 0 : _opsRef$current2.getBoundingClientRect();\n const style = window.getComputedStyle(e);\n const mBottom = parseFloat(style.marginBottom);\n const mTop = parseFloat(style.marginTop);\n rect.height += mBottom + mTop;\n return rect;\n }\n }), []);\n const optionNodes = [];\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (option !== undefined && (!filter || filter(option))) {\n const [iValue, iName] = (0,_common__WEBPACK_IMPORTED_MODULE_3__.optionValueName)(option);\n optionNodes.push(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(\"div\", {\n className: optionClass,\n onClick: e => {\n onChange(iValue);\n e.stopPropagation();\n },\n onKeyDown: e => {\n if (e.key === 'Enter') {\n onChange(iValue);\n e.stopPropagation();\n }\n },\n role: \"button\",\n tabIndex: 0,\n children: iName\n }, iValue));\n }\n }\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Modal__WEBPACK_IMPORTED_MODULE_1__.BaseModal\n // Closes the dropdown (cancels the selection) on any page scrolling attempt.\n // This is the same native <select> elements do on scrolling, and at least for\n // now we have no reason to deal with complications needed to support open\n // dropdowns during the scrolling (that would need to re-position it in\n // response to the position changes of the root dropdown element).\n , {\n cancelOnScrolling: true,\n containerStyle: containerStyle,\n dontDisableScrolling: true,\n onCancel: onCancel,\n theme: {\n ad: '',\n hoc: '',\n container: containerClass,\n context: '',\n overlay: _style_scss__WEBPACK_IMPORTED_MODULE_2__[\"default\"].overlay\n },\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(\"div\", {\n ref: opsRef,\n children: optionNodes\n })\n });\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (Options);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/CustomDropdown/Options/index.tsx?");
|
|
210
210
|
|
|
211
211
|
/***/ }),
|
|
212
212
|
|
|
@@ -216,7 +216,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
216
216
|
\******************************************************************/
|
|
217
217
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
218
218
|
|
|
219
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var
|
|
219
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _Options__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options */ \"./src/shared/components/selectors/CustomDropdown/Options/index.tsx\");\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/selectors/CustomDropdown/theme.scss\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../common */ \"./src/shared/components/selectors/common.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\n\n\nconst BaseCustomDropdown = _ref => {\n let {\n filter,\n label,\n onChange,\n options,\n theme,\n value\n } = _ref;\n if (!options) throw Error('Internal error');\n const [active, setActive] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);\n const dropdownRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const opsRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);\n const [opsPos, setOpsPos] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)();\n const [upward, setUpward] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {\n if (!active) return undefined;\n let id;\n const cb = () => {\n var _dropdownRef$current, _opsRef$current;\n const anchor = (_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === void 0 ? void 0 : _dropdownRef$current.getBoundingClientRect();\n const opsRect = (_opsRef$current = opsRef.current) === null || _opsRef$current === void 0 ? void 0 : _opsRef$current.measure();\n if (anchor && opsRect) {\n var _window$visualViewpor, _window$visualViewpor2;\n const fitsDown = anchor.bottom + opsRect.height < ((_window$visualViewpor = (_window$visualViewpor2 = window.visualViewport) === null || _window$visualViewpor2 === void 0 ? void 0 : _window$visualViewpor2.height) !== null && _window$visualViewpor !== void 0 ? _window$visualViewpor : 0);\n const fitsUp = anchor.top - opsRect.height > 0;\n const up = !fitsDown && fitsUp;\n setUpward(up);\n const pos = up ? {\n top: anchor.top - opsRect.height - 1,\n left: anchor.left,\n width: anchor.width\n } : {\n left: anchor.left,\n top: anchor.bottom,\n width: anchor.width\n };\n setOpsPos(now => (0,_Options__WEBPACK_IMPORTED_MODULE_2__.areEqual)(now, pos) ? now : pos);\n }\n id = requestAnimationFrame(cb);\n };\n requestAnimationFrame(cb);\n return () => {\n cancelAnimationFrame(id);\n };\n }, [active]);\n const openList = e => {\n const view = window.visualViewport;\n const rect = dropdownRef.current.getBoundingClientRect();\n setActive(true);\n\n // NOTE: This first opens the dropdown off-screen, where it is measured\n // by an effect declared above, and then positioned below, or above\n // the original dropdown element, depending where it fits best\n // (if we first open it downward, it would flick if we immediately\n // move it above, at least with the current position update via local\n // react state, and not imperatively).\n setOpsPos({\n left: (view === null || view === void 0 ? void 0 : view.width) || 0,\n top: (view === null || view === void 0 ? void 0 : view.height) || 0,\n width: rect.width\n });\n e.stopPropagation();\n };\n let selected = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {\n children: \"\\u200C\"\n });\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (option !== undefined && (!filter || filter(option))) {\n const [iValue, iName] = (0,_common__WEBPACK_IMPORTED_MODULE_4__.optionValueName)(option);\n if (iValue === value) {\n selected = iName;\n break;\n }\n }\n }\n let containerClassName = theme.container;\n if (active) containerClassName += ` ${theme.active}`;\n let opsContainerClass = theme.select || '';\n if (upward) {\n containerClassName += ` ${theme.upward}`;\n opsContainerClass += ` ${theme.upward}`;\n }\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n className: containerClassName,\n children: [label === undefined ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n className: theme.label,\n children: label\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(\"div\", {\n className: theme.dropdown,\n onClick: openList,\n onKeyDown: e => {\n if (e.key === 'Enter') openList(e);\n },\n ref: dropdownRef,\n role: \"listbox\",\n tabIndex: 0,\n children: [selected, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(\"div\", {\n className: theme.arrow\n })]\n }), active ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Options__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n containerClass: opsContainerClass,\n containerStyle: opsPos,\n onCancel: () => {\n setActive(false);\n },\n onChange: newValue => {\n setActive(false);\n if (onChange) onChange(newValue);\n },\n optionClass: theme.option || '',\n options: options,\n ref: opsRef\n }) : null]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_1___default()(BaseCustomDropdown, 'CustomDropdown', _theme_scss__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/CustomDropdown/index.tsx?");
|
|
220
220
|
|
|
221
221
|
/***/ }),
|
|
222
222
|
|
|
@@ -226,7 +226,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bab
|
|
|
226
226
|
\******************************************************************/
|
|
227
227
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
228
228
|
|
|
229
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var
|
|
229
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/selectors/NativeDropdown/theme.scss\");\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common */ \"./src/shared/components/selectors/common.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n// Implements dropdown based on the native HTML <select> element.\n\n\n\n\n\n/**\n * Implements a themeable dropdown list. Internally it is rendered with help of\n * the standard HTML `<select>` element, thus the styling support is somewhat\n * limited.\n * @param [props] Component properties.\n * @param [props.filter] Options filter function. If provided, only\n * those elements of `options` list will be used by the dropdown, for which this\n * filter returns `true`.\n * @param [props.label] Dropdown label.\n * @param [props.onChange] Selection event handler.\n * @param [props.options=[]] Array of dropdown\n * options. For string elements the option value and name will be the same.\n * It is allowed to mix DropdownOption and string elements in the same option\n * list.\n * @param [props.theme] _Ad hoc_ theme.\n * @param [props.value] Currently selected value.\n * @param [props....]\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\n\nconst Dropdown = _ref => {\n let {\n filter,\n label,\n onChange,\n options,\n testId,\n theme,\n value\n } = _ref;\n if (!options) throw Error('Internal error');\n let isValidValue = false;\n const optionElements = [];\n for (let i = 0; i < options.length; ++i) {\n const option = options[i];\n if (option !== undefined && (!filter || filter(option))) {\n const [iValue, iName] = (0,_common__WEBPACK_IMPORTED_MODULE_2__.optionValueName)(option);\n isValidValue || (isValidValue = iValue === value);\n optionElements.push(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"option\", {\n className: theme.option,\n value: iValue,\n children: iName\n }, iValue));\n }\n }\n\n // NOTE: This element represents the current `value` when it does not match\n // any valid option. In Chrome, and some other browsers, we are able to hide\n // it from the opened dropdown; in others, e.g. Safari, the best we can do is\n // to show it as disabled.\n const hiddenOption = isValidValue ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"option\", {\n disabled: true,\n className: theme.hiddenOption,\n value: value,\n children: value\n }, \"__reactUtilsHiddenOption\");\n let selectClassName = theme.select;\n if (!isValidValue) selectClassName += ` ${theme.invalid}`;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"div\", {\n className: theme.container,\n children: [label === undefined ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: theme.label,\n children: label\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"div\", {\n className: theme.dropdown,\n children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"select\", {\n className: selectClassName,\n \"data-testid\": false ? 0 : testId,\n onChange: onChange,\n value: value,\n children: [hiddenOption, optionElements]\n }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: theme.arrow\n })]\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default()(Dropdown, 'Dropdown', _theme_scss__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/NativeDropdown/index.tsx?");
|
|
230
230
|
|
|
231
231
|
/***/ }),
|
|
232
232
|
|
|
@@ -236,7 +236,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bab
|
|
|
236
236
|
\**********************************************************/
|
|
237
237
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
238
238
|
|
|
239
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var
|
|
239
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../common */ \"./src/shared/components/selectors/common.ts\");\n/* harmony import */ var _theme_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./theme.scss */ \"./src/shared/components/selectors/Switch/theme.scss\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\n\nconst BaseSwitch = _ref => {\n let {\n label,\n onChange,\n options,\n theme,\n value\n } = _ref;\n if (!options || !theme.option) throw Error('Internal error');\n const optionNodes = [];\n for (let i = 0; i < (options === null || options === void 0 ? void 0 : options.length); ++i) {\n const option = options[i];\n if (option !== undefined) {\n const [iValue, iName] = (0,_common__WEBPACK_IMPORTED_MODULE_1__.optionValueName)(option);\n let className = theme.option;\n let onPress;\n if (iValue === value) className += ` ${theme.selected}`;else if (onChange) onPress = () => onChange(iValue);\n optionNodes.push(onPress ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: className,\n onClick: onPress,\n onKeyDown: e => {\n if (onPress && e.key === 'Enter') onPress();\n },\n role: \"button\",\n tabIndex: 0,\n children: iName\n }, iValue) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: className,\n children: iName\n }, iValue));\n }\n }\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(\"div\", {\n className: theme.container,\n children: [label ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: theme.label,\n children: label\n }) : null, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(\"div\", {\n className: theme.options,\n children: optionNodes\n })]\n });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default()(BaseSwitch, 'Switch', _theme_scss__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/Switch/index.tsx?");
|
|
240
240
|
|
|
241
241
|
/***/ }),
|
|
242
242
|
|
|
@@ -246,7 +246,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _bab
|
|
|
246
246
|
\***************************************************/
|
|
247
247
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
248
248
|
|
|
249
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ optionValueName: function() { return /* binding */ optionValueName; }\n/* harmony export */ });\n// The stuff common between different dropdown implementations.\n\nfunction isValue(x) {\n
|
|
249
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ optionValueName: function() { return /* binding */ optionValueName; }\n/* harmony export */ });\n// The stuff common between different dropdown implementations.\n\nfunction isValue(x) {\n const type = typeof x;\n return type === 'number' || type === 'string';\n}\n\n/** Returns option value and name as a tuple. */\nfunction optionValueName(option) {\n var _option$name;\n return isValue(option) ? [option, option] : [option.value, (_option$name = option.name) !== null && _option$name !== void 0 ? _option$name : option.value];\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/components/selectors/common.ts?");
|
|
250
250
|
|
|
251
251
|
/***/ }),
|
|
252
252
|
|
|
@@ -266,7 +266,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
266
266
|
\************************************/
|
|
267
267
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
268
268
|
|
|
269
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _isomorphy_environment_check__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isomorphy/environment-check */ \"./src/shared/utils/isomorphy/environment-check.ts\");\n/* harmony import */ var _webpack__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./webpack */ \"./src/shared/utils/webpack.ts\");\n/* global document */\n\n\n\
|
|
269
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _isomorphy_environment_check__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isomorphy/environment-check */ \"./src/shared/utils/isomorphy/environment-check.ts\");\n/* harmony import */ var _webpack__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./webpack */ \"./src/shared/utils/webpack.ts\");\n/* global document */\n\n\n\nconst config = (_isomorphy_environment_check__WEBPACK_IMPORTED_MODULE_0__.IS_CLIENT_SIDE\n// eslint-disable-next-line global-require\n? (__webpack_require__(/*! ../../client/getInj */ \"./src/client/getInj.ts\")[\"default\"])().CONFIG : (0,_webpack__WEBPACK_IMPORTED_MODULE_1__.requireWeak)('config')) || {};\n\n// The safeguard for \"document\" is necessary because in non-Node environments,\n// like React Native, IS_CLIENT_SIDE is \"true\", however \"document\" and a bunch\n// of other browser-world features are not available.\nif (_isomorphy_environment_check__WEBPACK_IMPORTED_MODULE_0__.IS_CLIENT_SIDE && typeof document !== 'undefined') {\n const cookie = __webpack_require__(/*! cookie */ \"cookie\"); // eslint-disable-line global-require\n config.CSRF = cookie.parse(document.cookie).csrfToken;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (config);\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/config.ts?");
|
|
270
270
|
|
|
271
271
|
/***/ }),
|
|
272
272
|
|
|
@@ -276,7 +276,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _iso
|
|
|
276
276
|
\*****************************************/
|
|
277
277
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
278
278
|
|
|
279
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getSsrContext: function() { return /* binding */ getSsrContext; }\n/* harmony export */ });\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_0__);\n\n\n// The type of data object injected by server into generated markup.\n\
|
|
279
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getSsrContext: function() { return /* binding */ getSsrContext; }\n/* harmony export */ });\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_0__);\n\n\n// The type of data object injected by server into generated markup.\n\nconst {\n getSsrContext\n} = (0,_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_0__.withGlobalStateType)();\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/globalState.ts?");
|
|
280
280
|
|
|
281
281
|
/***/ }),
|
|
282
282
|
|
|
@@ -286,7 +286,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
286
286
|
\***********************************/
|
|
287
287
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
288
288
|
|
|
289
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Barrier: function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.Barrier; },\n/* harmony export */ Emitter: function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.Emitter; },\n/* harmony export */ Semaphore: function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.Semaphore; },\n/* harmony export */ ThemeProvider: function() { return /* reexport safe */ _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__.ThemeProvider; },\n/* harmony export */ config: function() { return /* reexport safe */ _config__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; },\n/* harmony export */ getSsrContext: function() { return /* reexport safe */ _globalState__WEBPACK_IMPORTED_MODULE_6__.getSsrContext; },\n/* harmony export */ isomorphy: function() { return /* reexport module object */ _isomorphy__WEBPACK_IMPORTED_MODULE_2__; },\n/* harmony export */ splitComponent: function() { return /* reexport safe */ _splitComponent__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; },\n/* harmony export */ themed: function() { return /* binding */ themed; },\n/* harmony export */ time: function() { return /* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; },\n/* harmony export */ webpack: function() { return /* reexport module object */ _webpack__WEBPACK_IMPORTED_MODULE_4__; },\n/* harmony export */ withRetries: function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.withRetries; }\n/* harmony export */ });\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./config */ \"./src/shared/utils/config.ts\");\n/* harmony import */ var _isomorphy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isomorphy */ \"./src/shared/utils/isomorphy/index.ts\");\n/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./time */ \"./src/shared/utils/time.ts\");\n/* harmony import */ var _webpack__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./webpack */ \"./src/shared/utils/webpack.ts\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @dr.pogodin/js-utils */ \"@dr.pogodin/js-utils\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _globalState__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./globalState */ \"./src/shared/utils/globalState.ts\");\n/* harmony import */ var _splitComponent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./splitComponent */ \"./src/shared/utils/splitComponent.tsx\");\n\n\n\n\n\n\n\n\
|
|
289
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Barrier: function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.Barrier; },\n/* harmony export */ Emitter: function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.Emitter; },\n/* harmony export */ Semaphore: function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.Semaphore; },\n/* harmony export */ ThemeProvider: function() { return /* reexport safe */ _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__.ThemeProvider; },\n/* harmony export */ config: function() { return /* reexport safe */ _config__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; },\n/* harmony export */ getSsrContext: function() { return /* reexport safe */ _globalState__WEBPACK_IMPORTED_MODULE_6__.getSsrContext; },\n/* harmony export */ isomorphy: function() { return /* reexport module object */ _isomorphy__WEBPACK_IMPORTED_MODULE_2__; },\n/* harmony export */ splitComponent: function() { return /* reexport safe */ _splitComponent__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; },\n/* harmony export */ themed: function() { return /* binding */ themed; },\n/* harmony export */ time: function() { return /* reexport safe */ _time__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; },\n/* harmony export */ webpack: function() { return /* reexport module object */ _webpack__WEBPACK_IMPORTED_MODULE_4__; },\n/* harmony export */ withRetries: function() { return /* reexport safe */ _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.withRetries; }\n/* harmony export */ });\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @dr.pogodin/react-themes */ \"@dr.pogodin/react-themes\");\n/* harmony import */ var _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./config */ \"./src/shared/utils/config.ts\");\n/* harmony import */ var _isomorphy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isomorphy */ \"./src/shared/utils/isomorphy/index.ts\");\n/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./time */ \"./src/shared/utils/time.ts\");\n/* harmony import */ var _webpack__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./webpack */ \"./src/shared/utils/webpack.ts\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @dr.pogodin/js-utils */ \"@dr.pogodin/js-utils\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _globalState__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./globalState */ \"./src/shared/utils/globalState.ts\");\n/* harmony import */ var _splitComponent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./splitComponent */ \"./src/shared/utils/splitComponent.tsx\");\n\n\n\n\n\n\n\n\nconst themed = (_dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0___default());\nthemed.COMPOSE = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__.COMPOSE;\nthemed.PRIORITY = _dr_pogodin_react_themes__WEBPACK_IMPORTED_MODULE_0__.PRIORITY;\n\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/index.ts?");
|
|
290
290
|
|
|
291
291
|
/***/ }),
|
|
292
292
|
|
|
@@ -296,7 +296,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
296
296
|
\*************************************************/
|
|
297
297
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
298
298
|
|
|
299
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getBuildInfo: function() { return /* binding */ getBuildInfo; },\n/* harmony export */ setBuildInfo: function() { return /* binding */ setBuildInfo; }\n/* harmony export */ });\n// Encapsulates access to \"Build Info\" data.\n\n// BEWARE: This should match the type of build info object generated by\n// Webpack build (see \"/config/webpack/app-base.js\"), and currently this\n// match is not checked automatically.\n\n// Depending on the build mode & environment, BUILD_INFO is either a global\n// variable defined at the app launch, or it is replaced by the actual value\n// by the Webpack build.\n\
|
|
299
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ getBuildInfo: function() { return /* binding */ getBuildInfo; },\n/* harmony export */ setBuildInfo: function() { return /* binding */ setBuildInfo; }\n/* harmony export */ });\n// Encapsulates access to \"Build Info\" data.\n\n// BEWARE: This should match the type of build info object generated by\n// Webpack build (see \"/config/webpack/app-base.js\"), and currently this\n// match is not checked automatically.\n\n// Depending on the build mode & environment, BUILD_INFO is either a global\n// variable defined at the app launch, or it is replaced by the actual value\n// by the Webpack build.\n\nlet buildInfo;\n\n// On the client side \"BUILD_INFO\" should be injected by Webpack. Note, however,\n// that in test environment we may need situations were environment is mocked as\n// client-side, although no proper Webpack compilation is executed, thus no info\n// injected; because of this we don't do a hard environment check here.\nif (typeof window.__DEV_BUILD_INFO__ !== 'undefined') buildInfo = window.__DEV_BUILD_INFO__;\n\n/**\n * In scenarious where \"BUILD_INFO\" is not injected by Webpack (server-side,\n * tests, etc.) we expect the host codebase to explicitly set it before it is\n * ever requested. As a precaution, this function throws if build info has been\n * set already, unless `force` flag is explicitly set.\n * @param info\n * @param force\n */\nfunction setBuildInfo(info) {\n let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n if (buildInfo !== undefined && !force) {\n throw Error('\"Build Info\" is already initialized');\n }\n buildInfo = info;\n}\n\n/**\n * Returns \"Build Info\" object; throws if it has not been initialized yet.\n * @returns\n */\nfunction getBuildInfo() {\n if (buildInfo === undefined) {\n throw Error('\"Build Info\" has not been initialized yet');\n }\n return buildInfo;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/isomorphy/buildInfo.ts?");
|
|
300
300
|
|
|
301
301
|
/***/ }),
|
|
302
302
|
|
|
@@ -306,7 +306,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
306
306
|
\*********************************************************/
|
|
307
307
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
308
308
|
|
|
309
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IS_CLIENT_SIDE: function() { return /* binding */ IS_CLIENT_SIDE; },\n/* harmony export */ IS_SERVER_SIDE: function() { return /* binding */ IS_SERVER_SIDE; }\n/* harmony export */ });\n// Checks for client- vs. server-side environment detection.\n\n/**\n * `true` within client-side environment (browser), `false` at server-side.\n */\
|
|
309
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ IS_CLIENT_SIDE: function() { return /* binding */ IS_CLIENT_SIDE; },\n/* harmony export */ IS_SERVER_SIDE: function() { return /* binding */ IS_SERVER_SIDE; }\n/* harmony export */ });\n// Checks for client- vs. server-side environment detection.\n\n/**\n * `true` within client-side environment (browser), `false` at server-side.\n */\nconst IS_CLIENT_SIDE = typeof process !== 'object' || !process.versions || !process.versions.node || !!__webpack_require__.g.REACT_UTILS_FORCE_CLIENT_SIDE;\n\n/**\n * `true` within the server-side environment (node), `false` at client-side.\n */\nconst IS_SERVER_SIDE = !IS_CLIENT_SIDE;\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/isomorphy/environment-check.ts?");
|
|
310
310
|
|
|
311
311
|
/***/ }),
|
|
312
312
|
|
|
@@ -326,7 +326,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
326
326
|
\*********************************************/
|
|
327
327
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
328
328
|
|
|
329
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ bookStyleSheets: function() { return /* binding */ bookStyleSheets; },\n/* harmony export */ \"default\": function() { return /* binding */ splitComponent; },\n/* harmony export */ freeStyleSheets: function() { return /* binding */ freeStyleSheets; }\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"@babel/runtime/helpers/defineProperty\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ \"@babel/runtime/helpers/objectWithoutProperties\");\n/* harmony import */ var _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"@babel/runtime/helpers/asyncToGenerator\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"@babel/runtime/regenerator\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @dr.pogodin/js-utils */ \"@dr.pogodin/js-utils\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _globalState__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./globalState */ \"./src/shared/utils/globalState.ts\");\n/* harmony import */ var _isomorphy__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./isomorphy */ \"./src/shared/utils/isomorphy/index.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n\n\n\nvar _excluded = [\"children\"],\n _excluded2 = [\"children\"];\n\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\n/* eslint-disable react/jsx-props-no-spreading */\n/* global document */\n\n\n\n\n\n\n// Note: At the client side we can get chunk groups immediately when loading\n// the module; at the server-side we only can get them within React render flow.\n// Thus, we set and use the following variable at the client-side, and then when\n// needed on the server side, we'll fetch it differently.\n\nvar clientChunkGroups;\nif (_isomorphy__WEBPACK_IMPORTED_MODULE_7__.IS_CLIENT_SIDE) {\n // eslint-disable-next-line global-require\n clientChunkGroups = (__webpack_require__(/*! ../../client/getInj */ \"./src/client/getInj.ts\")[\"default\"])().CHUNK_GROUPS || {};\n}\nvar refCounts = {};\nfunction getPublicPath() {\n return (0,_isomorphy__WEBPACK_IMPORTED_MODULE_7__.getBuildInfo)().publicPath;\n}\n\n/**\n * Client-side only! Ensures the specified CSS stylesheet is loaded into\n * the document; loads if it is missing; and does simple reference counting\n * to facilitate future clean-up.\n * @param name\n * @param loadedSheets\n * @param refCount\n * @return\n */\nfunction bookStyleSheet(name, loadedSheets, refCount) {\n var res;\n var path = `${getPublicPath()}/${name}`;\n var fullPath = `${document.location.origin}${path}`;\n if (!loadedSheets.has(fullPath)) {\n var link = document.querySelector(`link[href=\"${path}\"]`);\n if (!link) {\n link = document.createElement('link');\n link.setAttribute('rel', 'stylesheet');\n link.setAttribute('href', path);\n document.head.appendChild(link);\n }\n res = new _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_5__.Barrier();\n link.addEventListener('load', function () {\n return res.resolve();\n });\n link.addEventListener('error', function () {\n return res.resolve();\n });\n }\n if (refCount) {\n var current = refCounts[path] || 0;\n refCounts[path] = 1 + current;\n }\n return res;\n}\n\n/**\n * Generates the set of URLs for currently loaded, linked stylesheets.\n * @return\n */\nfunction getLoadedStyleSheets() {\n var res = new Set();\n var _document = document,\n styleSheets = _document.styleSheets;\n for (var i = 0; i < styleSheets.length; ++i) {\n var _styleSheets$i;\n var href = (_styleSheets$i = styleSheets[i]) === null || _styleSheets$i === void 0 ? void 0 : _styleSheets$i.href;\n if (href) res.add(href);\n }\n return res;\n}\nfunction assertChunkName(chunkName, chunkGroups) {\n if (chunkGroups[chunkName]) return;\n throw Error(`Unknown chunk name \"${chunkName}\"`);\n}\n\n/**\n * Client-side only! Ensures all CSS stylesheets required for the specified\n * code chunk are loaded into the document; loads the missing ones; and does\n * simple reference counting to facilitate future clean-up.\n * @param chunkName Chunk name.\n * @param refCount\n * @return Resolves once all pending stylesheets, necessary for\n * the chunk, are either loaded, or failed to load.\n */\nfunction bookStyleSheets(chunkName, chunkGroups, refCount) {\n var promises = [];\n var assets = chunkGroups[chunkName];\n if (!assets) return Promise.resolve();\n var loadedSheets = getLoadedStyleSheets();\n for (var i = 0; i < assets.length; ++i) {\n var asset = assets[i];\n if (asset !== null && asset !== void 0 && asset.endsWith('.css')) {\n var promise = bookStyleSheet(asset, loadedSheets, refCount);\n if (promise) promises.push(promise);\n }\n }\n return promises.length ? Promise.allSettled(promises).then() : Promise.resolve();\n}\n\n/**\n * Client-side only! Frees from the document all CSS stylesheets that are\n * required by the specified chunk, and have reference counter equal to one\n * (for chunks with larger reference counter values, it just decrements\n * the reference counter).\n * @param {string} chunkName\n */\nfunction freeStyleSheets(chunkName, chunkGroups) {\n var assets = chunkGroups[chunkName];\n if (!assets) return;\n for (var i = 0; i < assets.length; ++i) {\n var asset = assets[i];\n if (asset !== null && asset !== void 0 && asset.endsWith('.css')) {\n var path = `${getPublicPath()}/${asset}`;\n var pathRefCount = refCounts[path];\n if (pathRefCount) {\n if (pathRefCount <= 1) {\n document.head.querySelector(`link[href=\"${path}\"]`).remove();\n delete refCounts[path];\n } else refCounts[path] = pathRefCount - 1;\n }\n }\n }\n}\n\n// Holds the set of chunk names already used for splitComponent() calls.\nvar usedChunkNames = new Set();\n/**\n * Given an async component retrieval function `getComponent()` it creates\n * a special \"code split\" component, which uses <Suspense> to asynchronously\n * load on demand the code required by `getComponent()`.\n * @param options\n * @param options.chunkName\n * @param {function} options.getComponent\n * @param {React.Element} [options.placeholder]\n * @return {React.ElementType}\n */\nfunction splitComponent(_ref) {\n var chunkName = _ref.chunkName,\n getComponent = _ref.getComponent,\n placeholder = _ref.placeholder;\n // On the client side we can check right away if the chunk name is known.\n if (_isomorphy__WEBPACK_IMPORTED_MODULE_7__.IS_CLIENT_SIDE) assertChunkName(chunkName, clientChunkGroups);\n\n // The correct usage of splitComponent() assumes a single call per chunk.\n if (usedChunkNames.has(chunkName)) {\n throw Error(`Repeated splitComponent() call for the chunk \"${chunkName}\"`);\n } else usedChunkNames.add(chunkName);\n var LazyComponent = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_4__.lazy)(/*#__PURE__*/_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()(/*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().mark(function _callee() {\n var resolved, Component, Wrapper;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return getComponent();\n case 2:\n resolved = _context.sent;\n Component = 'default' in resolved ? resolved.default : resolved; // This pre-loads necessary stylesheets prior to the first mount of\n // the component (the lazy load function is executed by React one at\n // the frist mount).\n if (!_isomorphy__WEBPACK_IMPORTED_MODULE_7__.IS_CLIENT_SIDE) {\n _context.next = 7;\n break;\n }\n _context.next = 7;\n return bookStyleSheets(chunkName, clientChunkGroups, false);\n case 7:\n Wrapper = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_4__.forwardRef)(function (_ref3, ref) {\n var children = _ref3.children,\n rest = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_ref3, _excluded);\n // On the server side we'll assert the chunk name here,\n // and also push it to the SSR chunks array.\n if (_isomorphy__WEBPACK_IMPORTED_MODULE_7__.IS_SERVER_SIDE) {\n var _ref4 = (0,_globalState__WEBPACK_IMPORTED_MODULE_6__.getSsrContext)(),\n chunkGroups = _ref4.chunkGroups,\n chunks = _ref4.chunks;\n assertChunkName(chunkName, chunkGroups);\n if (!chunks.includes(chunkName)) chunks.push(chunkName);\n }\n\n // This takes care about stylesheets management every time an instance of\n // this component is mounted / unmounted.\n (0,react__WEBPACK_IMPORTED_MODULE_4__.useInsertionEffect)(function () {\n bookStyleSheets(chunkName, clientChunkGroups, true);\n return function () {\n return freeStyleSheets(chunkName, clientChunkGroups);\n };\n }, []);\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(Component, _objectSpread(_objectSpread({\n ref: ref\n }, rest), {}, {\n children: children\n }));\n });\n return _context.abrupt(\"return\", {\n default: Wrapper\n });\n case 9:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n })));\n var CodeSplit = function CodeSplit(_ref5) {\n var children = _ref5.children,\n rest = _babel_runtime_helpers_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1___default()(_ref5, _excluded2);\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(react__WEBPACK_IMPORTED_MODULE_4__.Suspense, {\n fallback: placeholder,\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(LazyComponent, _objectSpread(_objectSpread({}, rest), {}, {\n children: children\n }))\n });\n };\n return CodeSplit;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/splitComponent.tsx?");
|
|
329
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ bookStyleSheets: function() { return /* binding */ bookStyleSheets; },\n/* harmony export */ \"default\": function() { return /* binding */ splitComponent; },\n/* harmony export */ freeStyleSheets: function() { return /* binding */ freeStyleSheets; }\n/* harmony export */ });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @dr.pogodin/js-utils */ \"@dr.pogodin/js-utils\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _globalState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./globalState */ \"./src/shared/utils/globalState.ts\");\n/* harmony import */ var _isomorphy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isomorphy */ \"./src/shared/utils/isomorphy/index.ts\");\n/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ \"./node_modules/react/jsx-runtime.js\");\n/* eslint-disable react/jsx-props-no-spreading */\n/* global document */\n\n\n\n\n\n\n// Note: At the client side we can get chunk groups immediately when loading\n// the module; at the server-side we only can get them within React render flow.\n// Thus, we set and use the following variable at the client-side, and then when\n// needed on the server side, we'll fetch it differently.\n\nlet clientChunkGroups;\nif (_isomorphy__WEBPACK_IMPORTED_MODULE_3__.IS_CLIENT_SIDE) {\n // eslint-disable-next-line global-require\n clientChunkGroups = (__webpack_require__(/*! ../../client/getInj */ \"./src/client/getInj.ts\")[\"default\"])().CHUNK_GROUPS || {};\n}\nconst refCounts = {};\nfunction getPublicPath() {\n return (0,_isomorphy__WEBPACK_IMPORTED_MODULE_3__.getBuildInfo)().publicPath;\n}\n\n/**\n * Client-side only! Ensures the specified CSS stylesheet is loaded into\n * the document; loads if it is missing; and does simple reference counting\n * to facilitate future clean-up.\n * @param name\n * @param loadedSheets\n * @param refCount\n * @return\n */\nfunction bookStyleSheet(name, loadedSheets, refCount) {\n let res;\n const path = `${getPublicPath()}/${name}`;\n const fullPath = `${document.location.origin}${path}`;\n if (!loadedSheets.has(fullPath)) {\n let link = document.querySelector(`link[href=\"${path}\"]`);\n if (!link) {\n link = document.createElement('link');\n link.setAttribute('rel', 'stylesheet');\n link.setAttribute('href', path);\n document.head.appendChild(link);\n }\n res = new _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_1__.Barrier();\n link.addEventListener('load', () => res.resolve());\n link.addEventListener('error', () => res.resolve());\n }\n if (refCount) {\n const current = refCounts[path] || 0;\n refCounts[path] = 1 + current;\n }\n return res;\n}\n\n/**\n * Generates the set of URLs for currently loaded, linked stylesheets.\n * @return\n */\nfunction getLoadedStyleSheets() {\n const res = new Set();\n const {\n styleSheets\n } = document;\n for (let i = 0; i < styleSheets.length; ++i) {\n var _styleSheets$i;\n const href = (_styleSheets$i = styleSheets[i]) === null || _styleSheets$i === void 0 ? void 0 : _styleSheets$i.href;\n if (href) res.add(href);\n }\n return res;\n}\nfunction assertChunkName(chunkName, chunkGroups) {\n if (chunkGroups[chunkName]) return;\n throw Error(`Unknown chunk name \"${chunkName}\"`);\n}\n\n/**\n * Client-side only! Ensures all CSS stylesheets required for the specified\n * code chunk are loaded into the document; loads the missing ones; and does\n * simple reference counting to facilitate future clean-up.\n * @param chunkName Chunk name.\n * @param refCount\n * @return Resolves once all pending stylesheets, necessary for\n * the chunk, are either loaded, or failed to load.\n */\nfunction bookStyleSheets(chunkName, chunkGroups, refCount) {\n const promises = [];\n const assets = chunkGroups[chunkName];\n if (!assets) return Promise.resolve();\n const loadedSheets = getLoadedStyleSheets();\n for (let i = 0; i < assets.length; ++i) {\n const asset = assets[i];\n if (asset !== null && asset !== void 0 && asset.endsWith('.css')) {\n const promise = bookStyleSheet(asset, loadedSheets, refCount);\n if (promise) promises.push(promise);\n }\n }\n return promises.length ? Promise.allSettled(promises).then() : Promise.resolve();\n}\n\n/**\n * Client-side only! Frees from the document all CSS stylesheets that are\n * required by the specified chunk, and have reference counter equal to one\n * (for chunks with larger reference counter values, it just decrements\n * the reference counter).\n * @param {string} chunkName\n */\nfunction freeStyleSheets(chunkName, chunkGroups) {\n const assets = chunkGroups[chunkName];\n if (!assets) return;\n for (let i = 0; i < assets.length; ++i) {\n const asset = assets[i];\n if (asset !== null && asset !== void 0 && asset.endsWith('.css')) {\n const path = `${getPublicPath()}/${asset}`;\n const pathRefCount = refCounts[path];\n if (pathRefCount) {\n if (pathRefCount <= 1) {\n document.head.querySelector(`link[href=\"${path}\"]`).remove();\n delete refCounts[path];\n } else refCounts[path] = pathRefCount - 1;\n }\n }\n }\n}\n\n// Holds the set of chunk names already used for splitComponent() calls.\nconst usedChunkNames = new Set();\n/**\n * Given an async component retrieval function `getComponent()` it creates\n * a special \"code split\" component, which uses <Suspense> to asynchronously\n * load on demand the code required by `getComponent()`.\n * @param options\n * @param options.chunkName\n * @param {function} options.getComponent\n * @param {React.Element} [options.placeholder]\n * @return {React.ElementType}\n */\nfunction splitComponent(_ref) {\n let {\n chunkName,\n getComponent,\n placeholder\n } = _ref;\n // On the client side we can check right away if the chunk name is known.\n if (_isomorphy__WEBPACK_IMPORTED_MODULE_3__.IS_CLIENT_SIDE) assertChunkName(chunkName, clientChunkGroups);\n\n // The correct usage of splitComponent() assumes a single call per chunk.\n if (usedChunkNames.has(chunkName)) {\n throw Error(`Repeated splitComponent() call for the chunk \"${chunkName}\"`);\n } else usedChunkNames.add(chunkName);\n const LazyComponent = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.lazy)(async () => {\n const resolved = await getComponent();\n const Component = 'default' in resolved ? resolved.default : resolved;\n\n // This pre-loads necessary stylesheets prior to the first mount of\n // the component (the lazy load function is executed by React one at\n // the frist mount).\n if (_isomorphy__WEBPACK_IMPORTED_MODULE_3__.IS_CLIENT_SIDE) {\n await bookStyleSheets(chunkName, clientChunkGroups, false);\n }\n const Wrapper = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((_ref2, ref) => {\n let {\n children,\n ...rest\n } = _ref2;\n // On the server side we'll assert the chunk name here,\n // and also push it to the SSR chunks array.\n if (_isomorphy__WEBPACK_IMPORTED_MODULE_3__.IS_SERVER_SIDE) {\n const {\n chunkGroups,\n chunks\n } = (0,_globalState__WEBPACK_IMPORTED_MODULE_2__.getSsrContext)();\n assertChunkName(chunkName, chunkGroups);\n if (!chunks.includes(chunkName)) chunks.push(chunkName);\n }\n\n // This takes care about stylesheets management every time an instance of\n // this component is mounted / unmounted.\n (0,react__WEBPACK_IMPORTED_MODULE_0__.useInsertionEffect)(() => {\n bookStyleSheets(chunkName, clientChunkGroups, true);\n return () => freeStyleSheets(chunkName, clientChunkGroups);\n }, []);\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Component, {\n ref: ref,\n ...rest,\n children: children\n });\n });\n return {\n default: Wrapper\n };\n });\n const CodeSplit = _ref3 => {\n let {\n children,\n ...rest\n } = _ref3;\n return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react__WEBPACK_IMPORTED_MODULE_0__.Suspense, {\n fallback: placeholder,\n children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(LazyComponent, {\n ...rest,\n children: children\n })\n });\n };\n return CodeSplit;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/splitComponent.tsx?");
|
|
330
330
|
|
|
331
331
|
/***/ }),
|
|
332
332
|
|
|
@@ -336,7 +336,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
336
336
|
\**********************************/
|
|
337
337
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
338
338
|
|
|
339
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useCurrent: function() { return /* binding */ useCurrent; },\n/* harmony export */ useTimezoneOffset: function() { return /* binding */ useTimezoneOffset; }\n/* harmony export */ });\n/* harmony import */ var
|
|
339
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ useCurrent: function() { return /* binding */ useCurrent; },\n/* harmony export */ useTimezoneOffset: function() { return /* binding */ useTimezoneOffset; }\n/* harmony export */ });\n/* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! cookie */ \"cookie\");\n/* harmony import */ var cookie__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(cookie__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs */ \"dayjs\");\n/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ \"react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @dr.pogodin/js-utils */ \"@dr.pogodin/js-utils\");\n/* harmony import */ var _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @dr.pogodin/react-global-state */ \"@dr.pogodin/react-global-state\");\n/* harmony import */ var _dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _globalState__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./globalState */ \"./src/shared/utils/globalState.ts\");\n/* global document */\n\n\n\n\n\n\n\n\n/**\n * This react hook wraps Date.now() function in a SSR friendly way,\n * ensuring that all calls to useCurrent() within the same render return\n * exactly the same time (which is retrieved from Date.now() first, and\n * then stored in the global state to be reused in all other calls), which\n * is also passed and used in the first client side render, and then updated\n * with a finite precision to avoid infinite re-rendering loops.\n * @param [options] Optional settings.\n * @param [options.globalStatePath=\"currentTime\"] Global state path\n * to keep the current time value.\n * @param [options.precision= 5 * time.SEC_MS] Current time precision.\n * The hook won't update the current time stored in the global state unless it\n * is different from Date.now() result by this number (in milliseconds).\n * Default to 5 seconds.\n * @param [options.autorefresh=false] Set `true` to automatically\n * refresh time stored in the global state with the given `precision` (and\n * thus automatically re-rendering components dependent on this hook, or\n * the global state with the period equal to the `precision`.\n * @return Unix timestamp in milliseconds.\n */\n// TODO: Should we request the state type as generic parameter, to be able\n// to verify the give globalStatePath is correct?\nfunction useCurrent() {\n let {\n autorefresh = false,\n globalStatePath = 'currentTime',\n precision = 5 * _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__.SEC_MS\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const [now, setter] = (0,_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useGlobalState)(globalStatePath, Date.now);\n (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {\n let timerId;\n const update = () => {\n setter(old => {\n const neu = Date.now();\n return Math.abs(neu - old) > precision ? neu : old;\n });\n if (autorefresh) timerId = setTimeout(update, precision);\n };\n update();\n return () => {\n if (timerId) clearTimeout(timerId);\n };\n }, [autorefresh, precision, setter]);\n return now;\n}\n\n/**\n * Wraps the standard Date.getTimezoneOffset() method in a SSR-friendly way.\n * This hook retrieves the offset value at the client side and uses a cookie\n * to pass it to the server in subsequent requests from that user. At the server\n * side the value from cookie is used in renders and passed back to the client\n * via the global state. Prior to the value being known (in the very first\n * request from the user, when the cookie is still missing), zero value is used\n * as the default value.\n *\n * @param {object} [options] Optional settings.\n * @param {string} [options.cookieName=\"timezoneOffset\"] Optional. The name of\n * cookie to use to store the timezone offset. Defaults \"timezoneOffset\". Set\n * to a falsy value to forbid using cookies altogether (in that case the hook\n * will always return zero value at the server-side, and in the first render\n * at the client-side).\n * @param {string} [options.timezoneOffset=\"timezoneOffset\"] Optional.\n * The global state path to store the offset. Defaults \"timezoneOffset\".\n * @return {number} Timezone offset.\n */\n// TODO: Should we request the state type as generic parameter, to be able\n// to verify the give globalStatePath is correct?\nfunction useTimezoneOffset() {\n let {\n cookieName = 'timezoneOffset',\n globalStatePath = 'timezoneOffset'\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n const ssrContext = (0,_globalState__WEBPACK_IMPORTED_MODULE_5__.getSsrContext)(false);\n const [offset, setOffset] = (0,_dr_pogodin_react_global_state__WEBPACK_IMPORTED_MODULE_4__.useGlobalState)(globalStatePath, () => {\n var _ssrContext$req;\n const value = cookieName && (ssrContext === null || ssrContext === void 0 || (_ssrContext$req = ssrContext.req) === null || _ssrContext$req === void 0 || (_ssrContext$req = _ssrContext$req.cookies) === null || _ssrContext$req === void 0 ? void 0 : _ssrContext$req[cookieName]);\n return value ? parseInt(value, 10) : 0;\n });\n (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {\n const date = new Date();\n const value = date.getTimezoneOffset();\n setOffset(value);\n if (cookieName) {\n document.cookie = cookie__WEBPACK_IMPORTED_MODULE_0___default().serialize(cookieName, value.toString(), {\n path: '/'\n });\n }\n }, [cookieName, setOffset]);\n return offset;\n}\nconst time = {\n DAY_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__.DAY_MS,\n HOUR_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__.HOUR_MS,\n MIN_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__.MIN_MS,\n SEC_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__.SEC_MS,\n YEAR_MS: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__.YEAR_MS,\n now: Date.now,\n timer: _dr_pogodin_js_utils__WEBPACK_IMPORTED_MODULE_3__.timer,\n useCurrent,\n useTimezoneOffset\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object.assign((dayjs__WEBPACK_IMPORTED_MODULE_1___default()), time));\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/time.ts?");
|
|
340
340
|
|
|
341
341
|
/***/ }),
|
|
342
342
|
|
|
@@ -346,7 +346,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
346
346
|
\*************************************/
|
|
347
347
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
348
348
|
|
|
349
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ requireWeak: function() { return /* binding */ requireWeak; },\n/* harmony export */ resolveWeak: function() { return /* binding */ resolveWeak; }\n/* harmony export */ });\n/* harmony import */ var
|
|
349
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ requireWeak: function() { return /* binding */ requireWeak; },\n/* harmony export */ resolveWeak: function() { return /* binding */ resolveWeak; }\n/* harmony export */ });\n/* harmony import */ var _isomorphy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isomorphy */ \"./src/shared/utils/isomorphy/index.ts\");\n\n\n/**\n * Requires the specified module without including it into the bundle during\n * Webpack build.\n * @param modulePath\n * @param [basePath]\n * @return Required module.\n */\nfunction requireWeak(modulePath, basePath) {\n if (_isomorphy__WEBPACK_IMPORTED_MODULE_0__.IS_CLIENT_SIDE) return null;\n try {\n /* eslint-disable no-eval */\n const {\n resolve\n } = eval('require')('path');\n const path = basePath ? resolve(basePath, modulePath) : modulePath;\n const {\n default: def,\n ...named\n } = eval('require')(path);\n /* eslint-enable no-eval */\n\n if (!def) return named;\n Object.entries(named).forEach(_ref => {\n let [key, value] = _ref;\n if (def[key]) {\n if (def[key] !== value) {\n throw Error('Conflict between default and named exports');\n }\n } else def[key] = value;\n });\n return def;\n } catch {\n return null;\n }\n}\n\n/**\n * Resolves specified module path with help of Babel's module resolver.\n * Yes, the function itself just returns its argument to the caller, but Babel\n * is configured to resolve the first argument of resolveWeak(..) function, thus\n * the result will be the resolved path.\n * @param {string} modulePath\n * @return {string} Absolute or relative path to the module.\n */\nfunction resolveWeak(modulePath) {\n return modulePath;\n}\n\n//# sourceURL=webpack://@dr.pogodin/react-utils/./src/shared/utils/webpack.ts?");
|
|
350
350
|
|
|
351
351
|
/***/ }),
|
|
352
352
|
|
|
@@ -540,56 +540,6 @@ eval("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs
|
|
|
540
540
|
|
|
541
541
|
/***/ }),
|
|
542
542
|
|
|
543
|
-
/***/ "@babel/runtime/helpers/asyncToGenerator":
|
|
544
|
-
/*!**********************************************************!*\
|
|
545
|
-
!*** external "@babel/runtime/helpers/asyncToGenerator" ***!
|
|
546
|
-
\**********************************************************/
|
|
547
|
-
/***/ (function(module) {
|
|
548
|
-
|
|
549
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__babel_runtime_helpers_asyncToGenerator__;
|
|
550
|
-
|
|
551
|
-
/***/ }),
|
|
552
|
-
|
|
553
|
-
/***/ "@babel/runtime/helpers/defineProperty":
|
|
554
|
-
/*!********************************************************!*\
|
|
555
|
-
!*** external "@babel/runtime/helpers/defineProperty" ***!
|
|
556
|
-
\********************************************************/
|
|
557
|
-
/***/ (function(module) {
|
|
558
|
-
|
|
559
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__babel_runtime_helpers_defineProperty__;
|
|
560
|
-
|
|
561
|
-
/***/ }),
|
|
562
|
-
|
|
563
|
-
/***/ "@babel/runtime/helpers/objectWithoutProperties":
|
|
564
|
-
/*!*****************************************************************!*\
|
|
565
|
-
!*** external "@babel/runtime/helpers/objectWithoutProperties" ***!
|
|
566
|
-
\*****************************************************************/
|
|
567
|
-
/***/ (function(module) {
|
|
568
|
-
|
|
569
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__babel_runtime_helpers_objectWithoutProperties__;
|
|
570
|
-
|
|
571
|
-
/***/ }),
|
|
572
|
-
|
|
573
|
-
/***/ "@babel/runtime/helpers/slicedToArray":
|
|
574
|
-
/*!*******************************************************!*\
|
|
575
|
-
!*** external "@babel/runtime/helpers/slicedToArray" ***!
|
|
576
|
-
\*******************************************************/
|
|
577
|
-
/***/ (function(module) {
|
|
578
|
-
|
|
579
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__babel_runtime_helpers_slicedToArray__;
|
|
580
|
-
|
|
581
|
-
/***/ }),
|
|
582
|
-
|
|
583
|
-
/***/ "@babel/runtime/regenerator":
|
|
584
|
-
/*!*********************************************!*\
|
|
585
|
-
!*** external "@babel/runtime/regenerator" ***!
|
|
586
|
-
\*********************************************/
|
|
587
|
-
/***/ (function(module) {
|
|
588
|
-
|
|
589
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__babel_runtime_regenerator__;
|
|
590
|
-
|
|
591
|
-
/***/ }),
|
|
592
|
-
|
|
593
543
|
/***/ "@dr.pogodin/js-utils":
|
|
594
544
|
/*!***************************************!*\
|
|
595
545
|
!*** external "@dr.pogodin/js-utils" ***!
|