@dr.pogodin/react-utils 1.14.2 → 1.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/bin/release.sh +1 -0
  2. package/build/development/shared/components/Button/index.js +1 -1
  3. package/build/development/shared/components/Checkbox/index.js +1 -1
  4. package/build/development/shared/components/CodeSplit/ClientSide.js +5 -4
  5. package/build/development/shared/components/CodeSplit/ClientSide.js.map +1 -1
  6. package/build/development/shared/components/Dropdown/index.js +1 -1
  7. package/build/development/shared/components/Input/index.js +1 -1
  8. package/build/development/shared/components/Modal/index.js +1 -1
  9. package/build/development/shared/components/PageLayout/index.js +1 -1
  10. package/build/development/shared/components/Throbber/index.js +1 -1
  11. package/build/development/shared/components/WithTooltip/index.js +1 -1
  12. package/build/development/shared/components/YouTubeVideo/index.js +2 -2
  13. package/build/development/shared/utils/Semaphore.js +42 -13
  14. package/build/development/shared/utils/Semaphore.js.map +1 -1
  15. package/build/development/web.bundle.js +6 -6
  16. package/build/production/shared/components/Button/index.js +1 -1
  17. package/build/production/shared/components/Button/index.js.map +1 -1
  18. package/build/production/shared/components/Checkbox/index.js +1 -1
  19. package/build/production/shared/components/Checkbox/index.js.map +1 -1
  20. package/build/production/shared/components/CodeSplit/ClientSide.js +2 -2
  21. package/build/production/shared/components/CodeSplit/ClientSide.js.map +1 -1
  22. package/build/production/shared/components/Dropdown/index.js +1 -1
  23. package/build/production/shared/components/Dropdown/index.js.map +1 -1
  24. package/build/production/shared/components/Input/index.js +1 -1
  25. package/build/production/shared/components/Input/index.js.map +1 -1
  26. package/build/production/shared/components/Modal/index.js +1 -1
  27. package/build/production/shared/components/Modal/index.js.map +1 -1
  28. package/build/production/shared/components/PageLayout/index.js +1 -1
  29. package/build/production/shared/components/PageLayout/index.js.map +1 -1
  30. package/build/production/shared/components/Throbber/index.js +1 -1
  31. package/build/production/shared/components/Throbber/index.js.map +1 -1
  32. package/build/production/shared/components/WithTooltip/index.js +1 -1
  33. package/build/production/shared/components/WithTooltip/index.js.map +1 -1
  34. package/build/production/shared/components/YouTubeVideo/index.js +1 -1
  35. package/build/production/shared/components/YouTubeVideo/index.js.map +1 -1
  36. package/build/production/shared/utils/Semaphore.js +15 -3
  37. package/build/production/shared/utils/Semaphore.js.map +1 -1
  38. package/build/production/web.bundle.js +1 -1
  39. package/build/production/web.bundle.js.map +1 -1
  40. package/config/babel/node-ssr.js +5 -67
  41. package/config/babel/webpack.js +10 -53
  42. package/node-entry.js +5 -0
  43. package/null.js +0 -0
  44. package/package.json +45 -22
  45. package/config/shared/utils.js +0 -20
  46. package/dev-styles.js +0 -7
  47. package/index.js +0 -32
  48. package/mixins.scss +0 -1
  49. package/prod-styles.js +0 -7
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _utils=require("../../utils");var _jsxRuntime=require("react/jsx-runtime");var defaultTheme={"context":"dNQcC6","ad":"earXxa","hoc":"qAPfQ6","checkbox":"A-f8qJ","container":"Kr0g3M","label":"_3dML-O"};function Checkbox({checked,label,onChange,theme}){return/*#__PURE__*/(0,_jsxRuntime.jsxs)("div",{className:theme.container,children:[label===undefined?null:/*#__PURE__*/(0,_jsxRuntime.jsx)("p",{className:theme.label,children:label}),/*#__PURE__*/(0,_jsxRuntime.jsx)("input",{checked:checked,className:theme.checkbox,onChange:onChange,type:"checkbox"})]})}/**
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _utils=require("../../utils");var _jsxRuntime=require("react/jsx-runtime");const defaultTheme={"context":"dNQcC6","ad":"earXxa","hoc":"qAPfQ6","checkbox":"A-f8qJ","container":"Kr0g3M","label":"_3dML-O"};function Checkbox({checked,label,onChange,theme}){return/*#__PURE__*/(0,_jsxRuntime.jsxs)("div",{className:theme.container,children:[label===undefined?null:/*#__PURE__*/(0,_jsxRuntime.jsx)("p",{className:theme.label,children:label}),/*#__PURE__*/(0,_jsxRuntime.jsx)("input",{checked:checked,className:theme.checkbox,onChange:onChange,type:"checkbox"})]})}/**
2
2
  * Checkbox component theme: a map of
3
3
  * CSS classes to append to its elements:
4
4
  * @prop {string} [checkbox] to the underlying checkbox `<input>` element.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/shared/components/Checkbox/index.jsx"],"names":["Checkbox","checked","label","onChange","theme","container","undefined","checkbox","ThemedCheckbox","defaultTheme","propTypes","PT","bool","string","func","themeType","isRequired","defaultProps"],"mappings":"gLAAA,6DAEA,kC,2KAIA,QAASA,CAAAA,QAAT,CAAkB,CAChBC,OADgB,CAEhBC,KAFgB,CAGhBC,QAHgB,CAIhBC,KAJgB,CAAlB,CAKG,CACD,mBACE,4BAAK,SAAS,CAAEA,KAAK,CAACC,SAAtB,WACIH,KAAK,GAAKI,SAAV,CAAsB,IAAtB,cAA6B,yBAAG,SAAS,CAAEF,KAAK,CAACF,KAApB,UAA4BA,KAA5B,EADjC,cAEE,6BACE,OAAO,CAAED,OADX,CAEE,SAAS,CAAEG,KAAK,CAACG,QAFnB,CAGE,QAAQ,CAAEJ,QAHZ,CAIE,IAAI,CAAC,UAJP,EAFF,GAUH,CAED;AACA;AACA;AACA;AACA;AACA;AACA,GACA,KAAMK,CAAAA,cAAc,CAAG,kBAAO,UAAP,CAAmB,CACxC,UADwC,CAExC,WAFwC,CAGxC,OAHwC,CAAnB,CAIpBC,YAJoB,EAINT,QAJM,CAAvB,CAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACAA,QAAQ,CAACU,SAAT,CAAqB,CACnBT,OAAO,CAAEU,mBAAGC,IADO,CAEnBV,KAAK,CAAES,mBAAGE,MAFS,CAGnBV,QAAQ,CAAEQ,mBAAGG,IAHM,CAInBV,KAAK,CAAEI,cAAc,CAACO,SAAf,CAAyBC,UAJb,CAArB,CAOAhB,QAAQ,CAACiB,YAAT,CAAwB,CACtBhB,OAAO,CAAEK,SADa,CAEtBJ,KAAK,CAAEI,SAFe,CAGtBH,QAAQ,CAAEG,SAHY,CAAxB,C,aAMeE,c","sourcesContent":["import PT from 'prop-types';\n\nimport { themed } from 'utils';\n\nimport defaultTheme from './theme.scss';\n\nfunction Checkbox({\n checked,\n label,\n onChange,\n theme,\n}) {\n return (\n <div className={theme.container}>\n { label === undefined ? null : <p className={theme.label}>{label}</p> }\n <input\n checked={checked}\n className={theme.checkbox}\n onChange={onChange}\n type=\"checkbox\"\n />\n </div>\n );\n}\n\n/**\n * Checkbox component theme: a map of\n * CSS classes to append to its elements:\n * @prop {string} [checkbox] to the underlying checkbox `<input>` element.\n * @prop {string} [container] to the root checkbox element.\n * @prop {string} [label] to the checkbox label element.\n */\nconst ThemedCheckbox = themed('Checkbox', [\n 'checkbox',\n 'container',\n 'label',\n], defaultTheme)(Checkbox);\n\n/**\n * The `<Checkbox>` component implements themeable checkboxes.\n * @param {object} [props] Component properties.\n * @param {boolean} [props.checked] Checkbox value.\n * @param {string} [props.label] Checkbox label.\n * @param {function} [props.onChange] State change handler.\n * @param {CheckboxTheme} [props.theme] _Ad hoc_ theme.\n * @param {...any} [props....]\n * [Other properties of themeable components](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties).\n */\nCheckbox.propTypes = {\n checked: PT.bool,\n label: PT.string,\n onChange: PT.func,\n theme: ThemedCheckbox.themeType.isRequired,\n};\n\nCheckbox.defaultProps = {\n checked: undefined,\n label: undefined,\n onChange: undefined,\n};\n\nexport default ThemedCheckbox;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../../src/shared/components/Checkbox/index.jsx"],"names":["Checkbox","checked","label","onChange","theme","container","undefined","checkbox","ThemedCheckbox","defaultTheme","propTypes","PT","bool","string","func","themeType","isRequired","defaultProps"],"mappings":"gLAAA,6DAEA,kC,6KAIA,QAASA,CAAAA,QAAT,CAAkB,CAChBC,OADgB,CAEhBC,KAFgB,CAGhBC,QAHgB,CAIhBC,KAJgB,CAAlB,CAKG,CACD,mBACE,4BAAK,SAAS,CAAEA,KAAK,CAACC,SAAtB,WACIH,KAAK,GAAKI,SAAV,CAAsB,IAAtB,cAA6B,yBAAG,SAAS,CAAEF,KAAK,CAACF,KAApB,UAA4BA,KAA5B,EADjC,cAEE,6BACE,OAAO,CAAED,OADX,CAEE,SAAS,CAAEG,KAAK,CAACG,QAFnB,CAGE,QAAQ,CAAEJ,QAHZ,CAIE,IAAI,CAAC,UAJP,EAFF,GAUH,CAED;AACA;AACA;AACA;AACA;AACA;AACA,GACA,KAAMK,CAAAA,cAAc,CAAG,kBAAO,UAAP,CAAmB,CACxC,UADwC,CAExC,WAFwC,CAGxC,OAHwC,CAAnB,CAIpBC,YAJoB,EAINT,QAJM,CAAvB,CAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACAA,QAAQ,CAACU,SAAT,CAAqB,CACnBT,OAAO,CAAEU,mBAAGC,IADO,CAEnBV,KAAK,CAAES,mBAAGE,MAFS,CAGnBV,QAAQ,CAAEQ,mBAAGG,IAHM,CAInBV,KAAK,CAAEI,cAAc,CAACO,SAAf,CAAyBC,UAJb,CAArB,CAOAhB,QAAQ,CAACiB,YAAT,CAAwB,CACtBhB,OAAO,CAAEK,SADa,CAEtBJ,KAAK,CAAEI,SAFe,CAGtBH,QAAQ,CAAEG,SAHY,CAAxB,C,aAMeE,c","sourcesContent":["import PT from 'prop-types';\n\nimport { themed } from 'utils';\n\nimport defaultTheme from './theme.scss';\n\nfunction Checkbox({\n checked,\n label,\n onChange,\n theme,\n}) {\n return (\n <div className={theme.container}>\n { label === undefined ? null : <p className={theme.label}>{label}</p> }\n <input\n checked={checked}\n className={theme.checkbox}\n onChange={onChange}\n type=\"checkbox\"\n />\n </div>\n );\n}\n\n/**\n * Checkbox component theme: a map of\n * CSS classes to append to its elements:\n * @prop {string} [checkbox] to the underlying checkbox `<input>` element.\n * @prop {string} [container] to the root checkbox element.\n * @prop {string} [label] to the checkbox label element.\n */\nconst ThemedCheckbox = themed('Checkbox', [\n 'checkbox',\n 'container',\n 'label',\n], defaultTheme)(Checkbox);\n\n/**\n * The `<Checkbox>` component implements themeable checkboxes.\n * @param {object} [props] Component properties.\n * @param {boolean} [props.checked] Checkbox value.\n * @param {string} [props.label] Checkbox label.\n * @param {function} [props.onChange] State change handler.\n * @param {CheckboxTheme} [props.theme] _Ad hoc_ theme.\n * @param {...any} [props....]\n * [Other properties of themeable components](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties).\n */\nCheckbox.propTypes = {\n checked: PT.bool,\n label: PT.string,\n onChange: PT.func,\n theme: ThemedCheckbox.themeType.isRequired,\n};\n\nCheckbox.defaultProps = {\n checked: undefined,\n label: undefined,\n onChange: undefined,\n};\n\nexport default ThemedCheckbox;\n"],"file":"index.js"}
@@ -9,7 +9,7 @@ const{publicPath}=(0,_isomorphy.getBuildInfo)();// This code block initiates sty
9
9
  // to handle CSS chunk mounting and unmounting, which it is able to do).
10
10
  if(!heap.mounted){heap.mounted=true;window.CHUNK_GROUPS[chunkName].forEach(asset=>{if(!asset.endsWith(".css"))return;const path=`${publicPath}/${asset}`;let link=document.querySelector(`link[href="${path}"]`);if(!link){link=document.createElement("link");link.setAttribute("href",path);link.setAttribute("rel","stylesheet");const barrier=(0,_Barrier.newBarrier)();link.onload=barrier.resolve;// Even if the style load failed, still allow to mount the component,
11
11
  // abeit with broken styling.
12
- link.onerror=barrier.resolve;heap.pendingStyles.push(barrier);const head=document.querySelector("head");head.appendChild(link)}if(!link.dependants)link.dependants=new Set([chunkName]);else link.dependants.add(chunkName)})}// Async loading of React component necessary to render the chunk.
12
+ link.onerror=barrier.resolve;heap.pendingStyles.push(barrier);const head=document.querySelector("head");head.appendChild(link)}window.STYLESHEET_USAGE_COUNTERS||={};window.STYLESHEET_USAGE_COUNTERS[path]||=0;++window.STYLESHEET_USAGE_COUNTERS[path]})}// Async loading of React component necessary to render the chunk.
13
13
  const{data}=(0,_reactGlobalState.useAsyncData)(`dr_pogodin_react_utils___split_components.${chunkName}`,getClientSide,{maxage:_time.default.YEAR_MS});const createRender=()=>{const Scene=data.default||data;return/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{"data-chunk-name":chunkName,children:/*#__PURE__*/(0,_jsxRuntime.jsx)(Scene,{...rest,children:children})})};const[render,setRender]=(0,_react.useState)(()=>{// No need to await anything, we can render the final component right away.
14
14
  if(data&&!heap.pendingStyles.length){heap.renderInitialized=true;return createRender()}// Try to reuse the markup rendered during SSR.
15
15
  const node=document.querySelector(`[data-chunk-name=${chunkName}]`);if(node){return/*#__PURE__*/(0,_jsxRuntime.jsx)("div",{/* eslint-disable react/no-danger */dangerouslySetInnerHTML:{__html:node.innerHTML||""}/* eslint-disable react/no-danger */,"data-chunk-name":chunkName})}// Else render placeholder, or empty div.
@@ -17,5 +17,5 @@ const Scene=placeholder||(()=>null);return/*#__PURE__*/(0,_jsxRuntime.jsx)("div"
17
17
  // means we have to await styles loading; once it is done, and if we are still
18
18
  // mounted, we can set the final render.
19
19
  if(data&&!heap.renderInitialized){heap.renderInitialized=true;Promise.all(heap.pendingStyles).then(()=>{if(heap.mounted)setRender(createRender())})}// This effectively fires only once, just before the component unmounts.
20
- (0,_react.useEffect)(()=>()=>{heap.mounted=false;window.CHUNK_GROUPS[chunkName].forEach(item=>{if(!item.endsWith(".css"))return;const path=`${publicPath}/${item}`;const link=document.querySelector(`link[href="${path}"]`);link.dependants.delete(chunkName);if(!link.dependants.size){const head=document.querySelector("head");head.removeChild(link)}})},[chunkName,heap,publicPath]);return render}
20
+ (0,_react.useEffect)(()=>()=>{heap.mounted=false;window.CHUNK_GROUPS[chunkName].forEach(item=>{if(!item.endsWith(".css"))return;const path=`${publicPath}/${item}`;if(--window.STYLESHEET_USAGE_COUNTERS[path]<=0){const link=document.querySelector(`link[href="${path}"]`);const head=document.querySelector("head");head.removeChild(link)}})},[chunkName,heap,publicPath]);return render}
21
21
  //# sourceMappingURL=ClientSide.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/shared/components/CodeSplit/ClientSide.jsx"],"names":["ClientSide","chunkName","children","getClientSide","placeholder","serverSide","rest","current","heap","mounted","pendingStyles","renderInitialized","publicPath","window","CHUNK_GROUPS","forEach","asset","endsWith","path","link","document","querySelector","createElement","setAttribute","barrier","onload","resolve","onerror","push","head","appendChild","dependants","Set","add","data","maxage","time","YEAR_MS","createRender","Scene","default","render","setRender","length","node","__html","innerHTML","Promise","all","then","item","delete","size","removeChild"],"mappings":"oLAMA,4BAEA,gEAEA,4CACA,gDACA,8D,6CAZA;AACA;AACA,G,CACA,6B,CACA,iDAUe,QAASA,CAAAA,UAAT,CAAoB,CACjCC,SADiC,CAEjCC,QAFiC,CAGjCC,aAHiC,CAIjCC,WAJiC,CAMjC;AACAC,UAPiC,CASjC,GAAGC,IAT8B,CAApB,CAUZ,CACD,KAAM,CAAEC,OAAO,CAAEC,IAAX,EAAoB,kBAAO,CAC/BC,OAAO,CAAE,KADsB,CAE/BC,aAAa,CAAE,EAFgB,CAG/BC,iBAAiB,CAAE,KAHY,CAAP,CAA1B,CAMA;AACA,KAAM,CAAEC,UAAF,EAAiB,6BAAvB,CAEA;AACA;AACA;AACA;AACA;AACA,GAAI,CAACJ,IAAI,CAACC,OAAV,CAAmB,CACjBD,IAAI,CAACC,OAAL,CAAe,IAAf,CACAI,MAAM,CAACC,YAAP,CAAoBb,SAApB,EAA+Bc,OAA/B,CAAwCC,KAAD,EAAW,CAChD,GAAI,CAACA,KAAK,CAACC,QAAN,CAAe,MAAf,CAAL,CAA6B,OAC7B,KAAMC,CAAAA,IAAI,CAAI,GAAEN,UAAW,IAAGI,KAAM,EAApC,CACA,GAAIG,CAAAA,IAAI,CAAGC,QAAQ,CAACC,aAAT,CAAwB,cAAaH,IAAK,IAA1C,CAAX,CACA,GAAI,C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zB,KAAMvB,CAAAA,IAAI,CAAGT,QAAQ,CAACC,aAAT,CAAuB,MAAvB,CAAb,CACAQ,IAAI,CAACwB,WAAL,CAAiBlC,IAAjB,CACD,CACF,CATD,CAUD,CAZD,CAYG,CAAClB,SAAD,CAAYO,IAAZ,CAAkBI,UAAlB,CAZH,EAcA,MAAO6B,CAAAA,MACR","sourcesContent":["/**\n * Client-side implementation of a split code chunk.\n */\n/* global document, window */\n/* eslint-disable react/jsx-props-no-spreading */\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport { useAsyncData } from '@dr.pogodin/react-global-state';\n\nimport { newBarrier } from 'utils/Barrier';\nimport { getBuildInfo } from 'utils/isomorphy';\nimport time from 'utils/time';\n\nexport default function ClientSide({\n chunkName,\n children,\n getClientSide,\n placeholder,\n\n // Not used in <ClientSide>, but should not go into \"...rest\" either.\n serverSide,\n\n ...rest\n}) {\n const { current: heap } = useRef({\n mounted: false,\n pendingStyles: [],\n renderInitialized: false,\n });\n\n // publicPath from buildInfo does not have a trailing slash at the end.\n const { publicPath } = getBuildInfo();\n\n // This code block initiates style loading as soon as possible, even prior to\n // the component loading, and it collects all style load / failure promises\n // into heap.pendingStyles array, allowing us to wait and thus avoid flash of\n // unstyled content issue (that's why we don't rely on mini-css-extract-plugin\n // to handle CSS chunk mounting and unmounting, which it is able to do).\n if (!heap.mounted) {\n heap.mounted = true;\n window.CHUNK_GROUPS[chunkName].forEach((asset) => {\n if (!asset.endsWith('.css')) return;\n const path = `${publicPath}/${asset}`;\n let link = document.querySelector(`link[href=\"${path}\"]`);\n if (!link) {\n link = document.createElement('link');\n link.setAttribute('href', path);\n link.setAttribute('rel', 'stylesheet');\n\n const barrier = newBarrier();\n link.onload = barrier.resolve;\n\n // Even if the style load failed, still allow to mount the component,\n // abeit with broken styling.\n link.onerror = barrier.resolve;\n\n heap.pendingStyles.push(barrier);\n\n const head = document.querySelector('head');\n head.appendChild(link);\n }\n if (!link.dependants) link.dependants = new Set([chunkName]);\n else link.dependants.add(chunkName);\n });\n }\n\n // Async loading of React component necessary to render the chunk.\n const { data } = useAsyncData(\n `dr_pogodin_react_utils___split_components.${chunkName}`,\n getClientSide,\n { maxage: time.YEAR_MS },\n );\n\n const createRender = () => {\n const Scene = data.default || data;\n return (\n <div data-chunk-name={chunkName}>\n <Scene {...rest}>\n {children}\n </Scene>\n </div>\n );\n };\n\n const [render, setRender] = useState(() => {\n // No need to await anything, we can render the final component right away.\n if (data && !heap.pendingStyles.length) {\n heap.renderInitialized = true;\n return createRender();\n }\n\n // Try to reuse the markup rendered during SSR.\n const node = document.querySelector(`[data-chunk-name=${chunkName}]`);\n if (node) {\n return (\n <div\n /* eslint-disable react/no-danger */\n dangerouslySetInnerHTML={{ __html: node.innerHTML || '' }}\n /* eslint-disable react/no-danger */\n data-chunk-name={chunkName}\n />\n );\n }\n\n // Else render placeholder, or empty div.\n const Scene = placeholder || (() => null);\n return <div><Scene {...rest}>{children}</Scene></div>;\n });\n\n // At this point, if we have data, the absense of heap.renderInitialized flag\n // means we have to await styles loading; once it is done, and if we are still\n // mounted, we can set the final render.\n if (data && !heap.renderInitialized) {\n heap.renderInitialized = true;\n Promise.all(heap.pendingStyles).then(() => {\n if (heap.mounted) setRender(createRender());\n });\n }\n\n // This effectively fires only once, just before the component unmounts.\n useEffect(() => () => {\n heap.mounted = false;\n window.CHUNK_GROUPS[chunkName].forEach((item) => {\n if (!item.endsWith('.css')) return;\n const path = `${publicPath}/${item}`;\n const link = document.querySelector(`link[href=\"${path}\"]`);\n link.dependants.delete(chunkName);\n if (!link.dependants.size) {\n const head = document.querySelector('head');\n head.removeChild(link);\n }\n });\n }, [chunkName, heap, publicPath]);\n\n return render;\n}\n"],"file":"ClientSide.js"}
1
+ {"version":3,"sources":["../../../../../src/shared/components/CodeSplit/ClientSide.jsx"],"names":["ClientSide","chunkName","children","getClientSide","placeholder","serverSide","rest","current","heap","mounted","pendingStyles","renderInitialized","publicPath","window","CHUNK_GROUPS","forEach","asset","endsWith","path","link","document","querySelector","createElement","setAttribute","barrier","onload","resolve","onerror","push","head","appendChild","STYLESHEET_USAGE_COUNTERS","data","maxage","time","YEAR_MS","createRender","Scene","default","render","setRender","length","node","__html","innerHTML","Promise","all","then","item","removeChild"],"mappings":"oLAMA,4BAEA,gEAEA,4CACA,gDACA,8D,6CAZA;AACA;AACA,G,CACA,6B,CACA,iDAUe,QAASA,CAAAA,UAAT,CAAoB,CACjCC,SADiC,CAEjCC,QAFiC,CAGjCC,aAHiC,CAIjCC,WAJiC,CAMjC;AACAC,UAPiC,CASjC,GAAGC,IAT8B,CAApB,CAUZ,CACD,KAAM,CAAEC,OAAO,CAAEC,IAAX,EAAoB,kBAAO,CAC/BC,OAAO,CAAE,KADsB,CAE/BC,aAAa,CAAE,EAFgB,CAG/BC,iBAAiB,CAAE,KAHY,CAAP,CAA1B,CAMA;AACA,KAAM,CAAEC,UAAF,EAAiB,6BAAvB,CAEA;AACA;AACA;AACA;AACA;AACA,GAAI,CAACJ,IAAI,CAACC,OAAV,CAAmB,CACjBD,IAAI,CAACC,OAAL,CAAe,IAAf,CACAI,MAAM,CAACC,YAAP,CAAoBb,SAApB,EAA+Bc,OAA/B,CAAwCC,KAAD,EAAW,CAChD,GAAI,CAACA,KAAK,CAACC,QAAN,CAAe,MAAf,CAAL,CAA6B,OAC7B,KAAMC,CAAAA,IAAI,CAAI,GAAEN,UAAW,IAAGI,KAAM,EAApC,CACA,GAAIG,CAAAA,IAAI,CAAGC,QAAQ,CAACC,aAAT,CAAwB,cAAaH,IAAK,IAA1C,CAAX,CACA,GAAI,CAACC,IAAL,CAAW,CACTA,IAAI,CAAGC,QAAQ,CAACE,aAAT,CAAuB,MAAvB,CAAP,CACAH,IAAI,CAACI,YAAL,CAAkB,MAAlB,CAA0BL,IAA1B,EACAC,IAAI,CAACI,YAAL,CAAkB,KAAlB,CAAyB,YAAzB,EAEA,KAAMC,CAAAA,OAAO,CAAG,yBAAhB,CACAL,IAAI,CAACM,MAAL,CAAcD,OA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AAMoC,CAAAA,KAAK,CAAGjC,WAAW,GAAK,IAAM,IAAX,CAAzB,CACA,mBAAO,iDAAK,oBAAC,KAAD,KAAWE,IAAX,UAAkBJ,QAAlB,EAAL,EACR,CAvB2B,CAA5B,CAyBA;AACA;AACA;AACA,GAAI8B,IAAI,EAAI,CAACxB,IAAI,CAACG,iBAAlB,CAAqC,CACnCH,IAAI,CAACG,iBAAL,CAAyB,IAAzB,CACAkC,OAAO,CAACC,GAAR,CAAYtC,IAAI,CAACE,aAAjB,EAAgCqC,IAAhC,CAAqC,IAAM,CACzC,GAAIvC,IAAI,CAACC,OAAT,CAAkB+B,SAAS,CAACJ,YAAY,EAAb,CAC5B,CAFD,CAGD,CAED;AACA,qBAAU,IAAM,IAAM,CACpB5B,IAAI,CAACC,OAAL,CAAe,KAAf,CACAI,MAAM,CAACC,YAAP,CAAoBb,SAApB,EAA+Bc,OAA/B,CAAwCiC,IAAD,EAAU,CAC/C,GAAI,CAACA,IAAI,CAAC/B,QAAL,CAAc,MAAd,CAAL,CAA4B,OAC5B,KAAMC,CAAAA,IAAI,CAAI,GAAEN,UAAW,IAAGoC,IAAK,EAAnC,CACA,GAAI,EAAEnC,MAAM,CAACkB,yBAAP,CAAiCb,IAAjC,CAAF,EAA4C,CAAhD,CAAmD,CACjD,KAAMC,CAAAA,IAAI,CAAGC,QAAQ,CAACC,aAAT,CAAwB,cAAaH,IAAK,IAA1C,CAAb,CACA,KAAMW,CAAAA,IAAI,CAAGT,QAAQ,CAACC,aAAT,CAAuB,MAAvB,CAAb,CACAQ,IAAI,CAACoB,WAAL,CAAiB9B,IAAjB,CACD,CACF,CARD,CASD,CAXD,CAWG,CAAClB,SAAD,CAAYO,IAAZ,CAAkBI,UAAlB,CAXH,EAaA,MAAO2B,CAAAA,MACR","sourcesContent":["/**\n * Client-side implementation of a split code chunk.\n */\n/* global document, window */\n/* eslint-disable react/jsx-props-no-spreading */\n\nimport { useEffect, useRef, useState } from 'react';\n\nimport { useAsyncData } from '@dr.pogodin/react-global-state';\n\nimport { newBarrier } from 'utils/Barrier';\nimport { getBuildInfo } from 'utils/isomorphy';\nimport time from 'utils/time';\n\nexport default function ClientSide({\n chunkName,\n children,\n getClientSide,\n placeholder,\n\n // Not used in <ClientSide>, but should not go into \"...rest\" either.\n serverSide,\n\n ...rest\n}) {\n const { current: heap } = useRef({\n mounted: false,\n pendingStyles: [],\n renderInitialized: false,\n });\n\n // publicPath from buildInfo does not have a trailing slash at the end.\n const { publicPath } = getBuildInfo();\n\n // This code block initiates style loading as soon as possible, even prior to\n // the component loading, and it collects all style load / failure promises\n // into heap.pendingStyles array, allowing us to wait and thus avoid flash of\n // unstyled content issue (that's why we don't rely on mini-css-extract-plugin\n // to handle CSS chunk mounting and unmounting, which it is able to do).\n if (!heap.mounted) {\n heap.mounted = true;\n window.CHUNK_GROUPS[chunkName].forEach((asset) => {\n if (!asset.endsWith('.css')) return;\n const path = `${publicPath}/${asset}`;\n let link = document.querySelector(`link[href=\"${path}\"]`);\n if (!link) {\n link = document.createElement('link');\n link.setAttribute('href', path);\n link.setAttribute('rel', 'stylesheet');\n\n const barrier = newBarrier();\n link.onload = barrier.resolve;\n\n // Even if the style load failed, still allow to mount the component,\n // abeit with broken styling.\n link.onerror = barrier.resolve;\n\n heap.pendingStyles.push(barrier);\n\n const head = document.querySelector('head');\n head.appendChild(link);\n }\n window.STYLESHEET_USAGE_COUNTERS ||= {};\n window.STYLESHEET_USAGE_COUNTERS[path] ||= 0;\n ++window.STYLESHEET_USAGE_COUNTERS[path];\n });\n }\n\n // Async loading of React component necessary to render the chunk.\n const { data } = useAsyncData(\n `dr_pogodin_react_utils___split_components.${chunkName}`,\n getClientSide,\n { maxage: time.YEAR_MS },\n );\n\n const createRender = () => {\n const Scene = data.default || data;\n return (\n <div data-chunk-name={chunkName}>\n <Scene {...rest}>\n {children}\n </Scene>\n </div>\n );\n };\n\n const [render, setRender] = useState(() => {\n // No need to await anything, we can render the final component right away.\n if (data && !heap.pendingStyles.length) {\n heap.renderInitialized = true;\n return createRender();\n }\n\n // Try to reuse the markup rendered during SSR.\n const node = document.querySelector(`[data-chunk-name=${chunkName}]`);\n if (node) {\n return (\n <div\n /* eslint-disable react/no-danger */\n dangerouslySetInnerHTML={{ __html: node.innerHTML || '' }}\n /* eslint-disable react/no-danger */\n data-chunk-name={chunkName}\n />\n );\n }\n\n // Else render placeholder, or empty div.\n const Scene = placeholder || (() => null);\n return <div><Scene {...rest}>{children}</Scene></div>;\n });\n\n // At this point, if we have data, the absense of heap.renderInitialized flag\n // means we have to await styles loading; once it is done, and if we are still\n // mounted, we can set the final render.\n if (data && !heap.renderInitialized) {\n heap.renderInitialized = true;\n Promise.all(heap.pendingStyles).then(() => {\n if (heap.mounted) setRender(createRender());\n });\n }\n\n // This effectively fires only once, just before the component unmounts.\n useEffect(() => () => {\n heap.mounted = false;\n window.CHUNK_GROUPS[chunkName].forEach((item) => {\n if (!item.endsWith('.css')) return;\n const path = `${publicPath}/${item}`;\n if (--window.STYLESHEET_USAGE_COUNTERS[path] <= 0) {\n const link = document.querySelector(`link[href=\"${path}\"]`);\n const head = document.querySelector('head');\n head.removeChild(link);\n }\n });\n }, [chunkName, heap, publicPath]);\n\n return render;\n}\n"],"file":"ClientSide.js"}
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _lodash=require("lodash");var _propTypes=_interopRequireDefault(require("prop-types"));var _utils=require("../../utils");var _jsxRuntime=require("react/jsx-runtime");var defaultTheme={"context":"haRIry","ad":"D4XHG2","hoc":"N3nd34","arrow":"-zPK7Y","container":"_9CQpeA","label":"Gv0kyu","option":"xmsujA","hiddenOption":"RdW3yR","select":"JXK1uw"};/**
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _lodash=require("lodash");var _propTypes=_interopRequireDefault(require("prop-types"));var _utils=require("../../utils");var _jsxRuntime=require("react/jsx-runtime");const defaultTheme={"context":"haRIry","ad":"D4XHG2","hoc":"N3nd34","arrow":"-zPK7Y","container":"_9CQpeA","label":"Gv0kyu","option":"xmsujA","hiddenOption":"RdW3yR","select":"JXK1uw"};/**
2
2
  * Implements a themeable dropdown list. Internally it is rendered with help of
3
3
  * the standard HTML `<select>` element, thus the styling support is somewhat
4
4
  * limited.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/shared/components/Dropdown/index.jsx"],"names":["Dropdown","filter","label","onChange","options","theme","value","optionArray","hiddenOption","i","length","op","push","option","name","undefined","container","select","arrow","ThemedDropdown","defaultTheme","propTypes","PT","func","string","arrayOf","oneOfType","shape","node","isRequired","themeType","defaultProps"],"mappings":"gLAAA,8BACA,6DAEA,kC,oOAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,QAASA,CAAAA,QAAT,CAAkB,CAChBC,MADgB,CAEhBC,KAFgB,CAGhBC,QAHgB,CAIhBC,OAJgB,CAKhBC,KALgB,CAMhBC,KANgB,CAAlB,CAOG,CACD,KAAMC,CAAAA,WAAW,CAAG,cAClB,8BACE,SAAS,CAAEF,KAAK,CAACG,YADnB,oBAEM,0BAFN,CADkB,CAApB,CAQA,IAAK,GAAIC,CAAAA,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGL,OAAO,CAACM,MAA5B,CAAoC,EAAED,CAAtC,CAAyC,CACvC,GAAIE,CAAAA,EAAE,CAAGP,OAAO,CAACK,CAAD,CAAhB,CACA,GAAI,CAACR,MAAD,EAAWA,MAAM,CAACU,EAAD,CAArB,CAA2B,CACzB,GAAI,qBAASA,EAAT,CAAJ,CAAkBA,EAAE,CAAG,CAAEL,KAAK,CAAEK,EAAT,CAAL,CAClBJ,WAAW,CAACK,IAAZ,cACE,8BAAQ,SAAS,CAAEP,KAAK,CAACQ,MAAz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Bb,KAAK,CAAEa,SAFe,CAGtBZ,QAAQ,CAAEY,SAHY,CAItBX,OAAO,CAAE,EAJa,CAKtBE,KAAK,CAAES,SALe,CAAxB,C,aAQeI,c","sourcesContent":["import { isString } from 'lodash';\nimport PT from 'prop-types';\n\nimport { themed } from 'utils';\n\nimport defaultTheme from './theme.scss';\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 {object} [props] Component properties.\n * @param {function} [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 {string} [props.label] Dropdown label.\n * @param {string} [props.onChange] Selection event handler.\n * @param {DropdownOption[]|string[]} [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 {DropdownTheme} [props.theme] _Ad hoc_ theme.\n * @param {string} [props.value] Currently selected value.\n * @param {...any} [props....]\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\nfunction Dropdown({\n filter,\n label,\n onChange,\n options,\n theme,\n value,\n}) {\n const optionArray = [(\n <option\n className={theme.hiddenOption}\n key=\"__reactUtilsHiddenOption\"\n >\n &zwnj;\n </option>\n )];\n for (let i = 0; i < options.length; ++i) {\n let op = options[i];\n if (!filter || filter(op)) {\n if (isString(op)) op = { value: op };\n optionArray.push((\n <option className={theme.option} key={op.value} value={op.value}>\n {op.name === undefined ? op.value : op.name }\n </option>\n ));\n }\n }\n return (\n <div className={theme.container}>\n { label === undefined ? null : <p className={theme.label}>{label}</p> }\n <select\n className={theme.select}\n onChange={onChange}\n value={value}\n >\n {optionArray}\n </select>\n <div className={theme.arrow}>▼</div>\n </div>\n );\n}\n\nconst ThemedDropdown = themed('Dropdown', [\n 'arrow',\n 'container',\n 'hiddenOption',\n 'label',\n 'option',\n 'select',\n], defaultTheme)(Dropdown);\n\nDropdown.propTypes = {\n filter: PT.func,\n label: PT.string,\n onChange: PT.func,\n options: PT.arrayOf(\n PT.oneOfType([\n PT.shape({\n name: PT.node,\n value: PT.string.isRequired,\n }),\n PT.string,\n ]).isRequired,\n ),\n theme: ThemedDropdown.themeType.isRequired,\n value: PT.string,\n};\n\nDropdown.defaultProps = {\n filter: undefined,\n label: undefined,\n onChange: undefined,\n options: [],\n value: undefined,\n};\n\nexport default ThemedDropdown;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../../src/shared/components/Dropdown/index.jsx"],"names":["Dropdown","filter","label","onChange","options","theme","value","optionArray","hiddenOption","i","length","op","push","option","name","undefined","container","select","arrow","ThemedDropdown","defaultTheme","propTypes","PT","func","string","arrayOf","oneOfType","shape","node","isRequired","themeType","defaultProps"],"mappings":"gLAAA,8BACA,6DAEA,kC,sOAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,QAASA,CAAAA,QAAT,CAAkB,CAChBC,MADgB,CAEhBC,KAFgB,CAGhBC,QAHgB,CAIhBC,OAJgB,CAKhBC,KALgB,CAMhBC,KANgB,CAAlB,CAOG,CACD,KAAMC,CAAAA,WAAW,CAAG,cAClB,8BACE,SAAS,CAAEF,KAAK,CAACG,YADnB,oBAEM,0BAFN,CADkB,CAApB,CAQA,IAAK,GAAIC,CAAAA,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGL,OAAO,CAACM,MAA5B,CAAoC,EAAED,CAAtC,CAAyC,CACvC,GAAIE,CAAAA,EAAE,CAAGP,OAAO,CAACK,CAAD,CAAhB,CACA,GAAI,CAACR,MAAD,EAAWA,MAAM,CAACU,EAAD,CAArB,CAA2B,CACzB,GAAI,qBAASA,EAAT,CAAJ,CAAkBA,EAAE,CAAG,CAAEL,KAAK,CAAEK,EAAT,CAAL,CAClBJ,WAAW,CAACK,IAAZ,cACE,8BAAQ,SAAS,CAAEP,KAAK,CAACQ,MAAzB,CAAgD,KA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AEa,SAFe,CAGtBZ,QAAQ,CAAEY,SAHY,CAItBX,OAAO,CAAE,EAJa,CAKtBE,KAAK,CAAES,SALe,CAAxB,C,aAQeI,c","sourcesContent":["import { isString } from 'lodash';\nimport PT from 'prop-types';\n\nimport { themed } from 'utils';\n\nimport defaultTheme from './theme.scss';\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 {object} [props] Component properties.\n * @param {function} [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 {string} [props.label] Dropdown label.\n * @param {string} [props.onChange] Selection event handler.\n * @param {DropdownOption[]|string[]} [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 {DropdownTheme} [props.theme] _Ad hoc_ theme.\n * @param {string} [props.value] Currently selected value.\n * @param {...any} [props....]\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\nfunction Dropdown({\n filter,\n label,\n onChange,\n options,\n theme,\n value,\n}) {\n const optionArray = [(\n <option\n className={theme.hiddenOption}\n key=\"__reactUtilsHiddenOption\"\n >\n &zwnj;\n </option>\n )];\n for (let i = 0; i < options.length; ++i) {\n let op = options[i];\n if (!filter || filter(op)) {\n if (isString(op)) op = { value: op };\n optionArray.push((\n <option className={theme.option} key={op.value} value={op.value}>\n {op.name === undefined ? op.value : op.name }\n </option>\n ));\n }\n }\n return (\n <div className={theme.container}>\n { label === undefined ? null : <p className={theme.label}>{label}</p> }\n <select\n className={theme.select}\n onChange={onChange}\n value={value}\n >\n {optionArray}\n </select>\n <div className={theme.arrow}>▼</div>\n </div>\n );\n}\n\nconst ThemedDropdown = themed('Dropdown', [\n 'arrow',\n 'container',\n 'hiddenOption',\n 'label',\n 'option',\n 'select',\n], defaultTheme)(Dropdown);\n\nDropdown.propTypes = {\n filter: PT.func,\n label: PT.string,\n onChange: PT.func,\n options: PT.arrayOf(\n PT.oneOfType([\n PT.shape({\n name: PT.node,\n value: PT.string.isRequired,\n }),\n PT.string,\n ]).isRequired,\n ),\n theme: ThemedDropdown.themeType.isRequired,\n value: PT.string,\n};\n\nDropdown.defaultProps = {\n filter: undefined,\n label: undefined,\n onChange: undefined,\n options: [],\n value: undefined,\n};\n\nexport default ThemedDropdown;\n"],"file":"index.js"}
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _utils=require("../../utils");var _jsxRuntime=require("react/jsx-runtime");var defaultTheme={"context":"X5WszA","ad":"_8s7GCr","hoc":"TVlBYc","container":"Cxx397","input":"M07d4s","label":"gfbdq-"};/**
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _utils=require("../../utils");var _jsxRuntime=require("react/jsx-runtime");const defaultTheme={"context":"X5WszA","ad":"_8s7GCr","hoc":"TVlBYc","container":"Cxx397","input":"M07d4s","label":"gfbdq-"};/**
2
2
  * Themeable input field, based on the standard HTML `<input>` element.
3
3
  * @param {object} [props]
4
4
  * @param {string} [props.label] Input label.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/shared/components/Input/index.jsx"],"names":["Input","label","theme","rest","container","undefined","input","ThemedInput","defaultTheme","propTypes","PT","string","themeType","isRequired","defaultProps"],"mappings":"gLAAA,6DAEA,kC,wKAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,QAASA,CAAAA,KAAT,CAAe,CACbC,KADa,CAEbC,KAFa,CAGb,GAAGC,IAHU,CAAf,CAIG,CACD,mBACE,4BAAK,SAAS,CAAED,KAAK,CAACE,SAAtB,WACIH,KAAK,GAAKI,SAAV,CAAsB,IAAtB,cAA6B,yBAAG,SAAS,CAAEH,KAAK,CAACD,KAApB,UAA4BA,KAA5B,EADjC,cAEE,6BACE,SAAS,CAAEC,KAAK,CAACI,KADnB,IAEMH,IAFN,EAFF,GAQH,CAED,KAAMI,CAAAA,WAAW,CAAG,kBAAO,OAAP,CAAgB,CAClC,WADkC,CAElC,OAFkC,CAGlC,OAHkC,CAAhB,CAIjBC,YAJiB,EAIHR,KAJG,CAApB,CAMAA,KAAK,CAACS,SAAN,CAAkB,CAChBR,KAAK,CAAES,mBAAGC,MADM,CAEhBT,KAAK,CAAEK,WAAW,CAACK,SAAZ,CAAsBC,UAFb,CAAlB,CAKAb,KAAK,CAACc,YAAN,CAAqB,CACnBb,KAAK,CAAEI,SADY,CAArB,C,aAIeE,W","sourcesContent":["import PT from 'prop-types';\n\nimport { themed } from 'utils';\n\nimport defaultTheme from './theme.scss';\n\n/**\n * Themeable input field, based on the standard HTML `<input>` element.\n * @param {object} [props]\n * @param {string} [props.label] Input label.\n * @param {InputTheme} [props.theme] _Ad hoc_ theme.\n * @param {...any} [props....] [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n * @param {...any} [props....] Any other properties are passed to the underlying\n * `<input>` element.\n */\nfunction Input({\n label,\n theme,\n ...rest\n}) {\n return (\n <div className={theme.container}>\n { label === undefined ? null : <p className={theme.label}>{label}</p> }\n <input\n className={theme.input}\n {...rest} // eslint-disable-line react/jsx-props-no-spreading\n />\n </div>\n );\n}\n\nconst ThemedInput = themed('Input', [\n 'container',\n 'input',\n 'label',\n], defaultTheme)(Input);\n\nInput.propTypes = {\n label: PT.string,\n theme: ThemedInput.themeType.isRequired,\n};\n\nInput.defaultProps = {\n label: undefined,\n};\n\nexport default ThemedInput;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../../src/shared/components/Input/index.jsx"],"names":["Input","label","theme","rest","container","undefined","input","ThemedInput","defaultTheme","propTypes","PT","string","themeType","isRequired","defaultProps"],"mappings":"gLAAA,6DAEA,kC,0KAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,QAASA,CAAAA,KAAT,CAAe,CACbC,KADa,CAEbC,KAFa,CAGb,GAAGC,IAHU,CAAf,CAIG,CACD,mBACE,4BAAK,SAAS,CAAED,KAAK,CAACE,SAAtB,WACIH,KAAK,GAAKI,SAAV,CAAsB,IAAtB,cAA6B,yBAAG,SAAS,CAAEH,KAAK,CAACD,KAApB,UAA4BA,KAA5B,EADjC,cAEE,6BACE,SAAS,CAAEC,KAAK,CAACI,KADnB,IAEMH,IAFN,EAFF,GAQH,CAED,KAAMI,CAAAA,WAAW,CAAG,kBAAO,OAAP,CAAgB,CAClC,WADkC,CAElC,OAFkC,CAGlC,OAHkC,CAAhB,CAIjBC,YAJiB,EAIHR,KAJG,CAApB,CAMAA,KAAK,CAACS,SAAN,CAAkB,CAChBR,KAAK,CAAES,mBAAGC,MADM,CAEhBT,KAAK,CAAEK,WAAW,CAACK,SAAZ,CAAsBC,UAFb,CAAlB,CAKAb,KAAK,CAACc,YAAN,CAAqB,CACnBb,KAAK,CAAEI,SADY,CAArB,C,aAIeE,W","sourcesContent":["import PT from 'prop-types';\n\nimport { themed } from 'utils';\n\nimport defaultTheme from './theme.scss';\n\n/**\n * Themeable input field, based on the standard HTML `<input>` element.\n * @param {object} [props]\n * @param {string} [props.label] Input label.\n * @param {InputTheme} [props.theme] _Ad hoc_ theme.\n * @param {...any} [props....] [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n * @param {...any} [props....] Any other properties are passed to the underlying\n * `<input>` element.\n */\nfunction Input({\n label,\n theme,\n ...rest\n}) {\n return (\n <div className={theme.container}>\n { label === undefined ? null : <p className={theme.label}>{label}</p> }\n <input\n className={theme.input}\n {...rest} // eslint-disable-line react/jsx-props-no-spreading\n />\n </div>\n );\n}\n\nconst ThemedInput = themed('Input', [\n 'container',\n 'input',\n 'label',\n], defaultTheme)(Input);\n\nInput.propTypes = {\n label: PT.string,\n theme: ThemedInput.themeType.isRequired,\n};\n\nInput.defaultProps = {\n label: undefined,\n};\n\nexport default ThemedInput;\n"],"file":"index.js"}
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.BaseModal=BaseModal;exports.default=void 0;var _lodash=require("lodash");var _react=require("react");var _reactDom=_interopRequireDefault(require("react-dom"));var _propTypes=_interopRequireDefault(require("prop-types"));var _reactThemes=_interopRequireDefault(require("@dr.pogodin/react-themes"));var _jsxRuntime=require("react/jsx-runtime");/* global document */var baseTheme={"context":"Szmbbz","ad":"Ah-Nsc","hoc":"Wki41G","overlay":"ye2BZo","container":"gyZ4rc"};/**
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.BaseModal=BaseModal;exports.default=void 0;var _lodash=require("lodash");var _react=require("react");var _reactDom=_interopRequireDefault(require("react-dom"));var _propTypes=_interopRequireDefault(require("prop-types"));var _reactThemes=_interopRequireDefault(require("@dr.pogodin/react-themes"));var _jsxRuntime=require("react/jsx-runtime");/* global document */const baseTheme={"context":"Szmbbz","ad":"Ah-Nsc","hoc":"Wki41G","overlay":"ye2BZo","container":"gyZ4rc"};/**
2
2
  * The `<Modal>` component implements a simple themeable modal window, wrapped
3
3
  * into the default theme. `<BaseModal>` exposes the base non-themed component.
4
4
  * **Children:** Component children are rendered as the modal content.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/shared/components/Modal/index.jsx"],"names":["BaseModal","children","onCancel","theme","containerRef","overlayRef","portal","setPortal","p","document","createElement","body","classList","add","appendChild","remove","removeChild","focusLast","elems","current","querySelectorAll","i","length","focus","activeElement","ReactDom","createPortal","overlay","e","key","node","container","event","stopPropagation","ThemedModal","baseTheme","propTypes","PT","func","themeType","isRequired","defaultProps","noop"],"mappings":"4MAEA,8BACA,4BAMA,2DACA,6DACA,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AEvBzC,QAAQ,CAAE,IAFa,CAAzB,C,aAKeiC,W,CAEf,sC","sourcesContent":["/* global document */\n\nimport { noop } from 'lodash';\nimport {\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport ReactDom from 'react-dom';\nimport PT from 'prop-types';\nimport themed from '@dr.pogodin/react-themes';\n\nimport baseTheme from './base-theme.scss';\nimport './styles.scss';\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.\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 * @param {...any} [props....]\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\nfunction BaseModal({\n children,\n onCancel,\n theme,\n}) {\n const containerRef = useRef();\n const overlayRef = useRef();\n const [portal, setPortal] = useState();\n\n useEffect(() => {\n const p = document.createElement('div');\n document.body.classList.add('scrolling-disabled-by-modal');\n document.body.appendChild(p);\n setPortal(p);\n return () => {\n document.body.classList.remove('scrolling-disabled-by-modal');\n document.body.removeChild(p);\n };\n }, []);\n\n const focusLast = useMemo(() => (\n <div\n onFocus={() => {\n const elems = containerRef.current.querySelectorAll('*');\n for (let i = elems.length - 1; i >= 0; --i) {\n elems[i].focus();\n if (document.activeElement === elems[i]) return;\n }\n 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 ), []);\n\n return portal ? ReactDom.createPortal(\n (\n <>\n {focusLast}\n <div\n aria-label=\"Cancel\"\n className={theme.overlay}\n onClick={() => onCancel()}\n onKeyDown={(e) => {\n if (e.key === 'Escape') onCancel();\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 />\n <div\n aria-modal=\"true\"\n className={theme.container}\n onWheel={(event) => event.stopPropagation()}\n ref={containerRef}\n role=\"dialog\"\n >\n {children}\n </div>\n <div\n onFocus={() => {\n 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 {focusLast}\n </>\n ),\n portal,\n ) : null;\n}\n\nconst ThemedModal = themed(\n 'Modal',\n [\n 'container',\n 'overlay',\n ],\n baseTheme,\n)(BaseModal);\n\nBaseModal.propTypes = {\n onCancel: PT.func,\n children: PT.node,\n theme: ThemedModal.themeType.isRequired,\n};\n\nBaseModal.defaultProps = {\n onCancel: noop,\n children: null,\n};\n\nexport default ThemedModal;\n\n/* Non-themed version of the Modal. */\nexport { BaseModal };\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../../src/shared/components/Modal/index.jsx"],"names":["BaseModal","children","onCancel","theme","containerRef","overlayRef","portal","setPortal","p","document","createElement","body","classList","add","appendChild","remove","removeChild","focusLast","elems","current","querySelectorAll","i","length","focus","activeElement","ReactDom","createPortal","overlay","e","key","node","container","event","stopPropagation","ThemedModal","baseTheme","propTypes","PT","func","themeType","isRequired","defaultProps","noop"],"mappings":"4MAEA,8BACA,4BAMA,2DACA,6DACA,6E,6CAXA,qB,0GAgBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,QAASA,CAAAA,SAAT,CAAmB,CACjBC,QADiB,CAEjBC,QAFiB,CAGjBC,KAHiB,CAAnB,CAIG,CACD,KAAMC,CAAAA,YAAY,CAAG,mBAArB,CACA,KAAMC,CAAAA,UAAU,CAAG,mBAAnB,CACA,KAAM,CAACC,MAAD,CAASC,SAAT,EAAsB,qBAA5B,CAEA,qBAAU,IAAM,CACd,KAAMC,CAAAA,CAAC,CAAGC,QAAQ,CAACC,aAAT,CAAuB,K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UAAU,CAACc,OAAX,CAAqBW,IAArB,CACAA,IAAI,CAACP,KAAL,EACD,CACF,CAZH,CAaE,IAAI,CAAC,QAbP,CAcE,QAAQ,CAAC,GAdX,EAFF,cAkBE,2BACE,aAAW,MADb,CAEE,SAAS,CAAEpB,KAAK,CAAC4B,SAFnB,CAGE,OAAO,CAAGC,KAAD,EAAWA,KAAK,CAACC,eAAN,EAHtB,CAIE,GAAG,CAAE7B,YAJP,CAKE,IAAI,CAAC,QALP,UAOGH,QAPH,EAlBF,cA2BE,2BACE,OAAO,CAAE,IAAM,CACbI,UAAU,CAACc,OAAX,CAAmBI,KAAnB,EACD,CACD,wDAJF,CAKE,QAAQ,CAAC,GACT,uDANF,EA3BF,CAmCGN,SAnCH,GAFY,CAwCdX,MAxCc,CAAH,CAyCT,IACL,CAED,KAAM4B,CAAAA,WAAW,CAAG,yBAClB,OADkB,CAElB,CACE,WADF,CAEE,SAFF,CAFkB,CAMlBC,SANkB,EAOlBnC,SAPkB,CAApB,CASAA,SAAS,CAACoC,SAAV,CAAsB,CACpBlC,QAAQ,CAAEmC,mBAAGC,IADO,CAEpBrC,QAAQ,CAAEoC,mBAAGP,IAFO,CAGpB3B,KAAK,CAAE+B,WAAW,CAACK,SAAZ,CAAsBC,UAHT,CAAtB,CAMAxC,SAAS,CAACyC,YAAV,CAAyB,CACvBvC,QAAQ,CAAEwC,YADa,CAEvBzC,QAAQ,CAAE,IAFa,CAAzB,C,aAKeiC,W,CAEf,sC","sourcesContent":["/* global document */\n\nimport { noop } from 'lodash';\nimport {\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport ReactDom from 'react-dom';\nimport PT from 'prop-types';\nimport themed from '@dr.pogodin/react-themes';\n\nimport baseTheme from './base-theme.scss';\nimport './styles.scss';\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.\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 * @param {...any} [props....]\n * [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)\n */\nfunction BaseModal({\n children,\n onCancel,\n theme,\n}) {\n const containerRef = useRef();\n const overlayRef = useRef();\n const [portal, setPortal] = useState();\n\n useEffect(() => {\n const p = document.createElement('div');\n document.body.classList.add('scrolling-disabled-by-modal');\n document.body.appendChild(p);\n setPortal(p);\n return () => {\n document.body.classList.remove('scrolling-disabled-by-modal');\n document.body.removeChild(p);\n };\n }, []);\n\n const focusLast = useMemo(() => (\n <div\n onFocus={() => {\n const elems = containerRef.current.querySelectorAll('*');\n for (let i = elems.length - 1; i >= 0; --i) {\n elems[i].focus();\n if (document.activeElement === elems[i]) return;\n }\n 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 ), []);\n\n return portal ? ReactDom.createPortal(\n (\n <>\n {focusLast}\n <div\n aria-label=\"Cancel\"\n className={theme.overlay}\n onClick={() => onCancel()}\n onKeyDown={(e) => {\n if (e.key === 'Escape') onCancel();\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 />\n <div\n aria-modal=\"true\"\n className={theme.container}\n onWheel={(event) => event.stopPropagation()}\n ref={containerRef}\n role=\"dialog\"\n >\n {children}\n </div>\n <div\n onFocus={() => {\n 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 {focusLast}\n </>\n ),\n portal,\n ) : null;\n}\n\nconst ThemedModal = themed(\n 'Modal',\n [\n 'container',\n 'overlay',\n ],\n baseTheme,\n)(BaseModal);\n\nBaseModal.propTypes = {\n onCancel: PT.func,\n children: PT.node,\n theme: ThemedModal.themeType.isRequired,\n};\n\nBaseModal.defaultProps = {\n onCancel: noop,\n children: null,\n};\n\nexport default ThemedModal;\n\n/* Non-themed version of the Modal. */\nexport { BaseModal };\n"],"file":"index.js"}
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _utils=require("../../utils");var _jsxRuntime=require("react/jsx-runtime");var baseTheme={"context":"m4mL-M","ad":"m3-mdC","hoc":"J15Z4H","container":"T3cuHB","mainPanel":"pPlQO2","sidePanel":"lqNh4h"};/**
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _utils=require("../../utils");var _jsxRuntime=require("react/jsx-runtime");const baseTheme={"context":"m4mL-M","ad":"m3-mdC","hoc":"J15Z4H","container":"T3cuHB","mainPanel":"pPlQO2","sidePanel":"lqNh4h"};/**
2
2
  * Simple and themeable page layout. It keeps the main content centered in
3
3
  * a column of limited width, which fills entire viewport on small screens
4
4
  * (under `$screen-md = 1024px` size). At larger screens the column keeps
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/shared/components/PageLayout/index.jsx"],"names":["PageLayout","children","leftSidePanelContent","rightSidePanelContent","theme","container","sidePanel","leftSidePanel","join","mainPanel","rightSidePanel","ThemedPageLayout","baseTheme","propTypes","PT","node","themeType","isRequired","defaultProps"],"mappings":"gLAAA,6DAEA,kC,4KAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,QAASA,CAAAA,UAAT,CAAoB,CAClBC,QADkB,CAElBC,oBAFkB,CAGlBC,qBAHkB,CAIlBC,KAJkB,CAApB,CAKG,CACD,mBACE,4BAAK,SAAS,CAAEA,KAAK,CAACC,SAAtB,wBACE,2BAAK,SAAS,CAAE,CAACD,KAAK,CAACE,SAAP,CAAkBF,KAAK,CAACG,aAAxB,EAAuCC,IAAvC,CAA4C,GAA5C,CAAhB,UACGN,oBADH,EADF,cAIE,2BAAK,SAAS,CAAEE,KAAK,CAACK,SAAtB,UACGR,QADH,EAJF,cAOE,2BAAK,SAAS,CAAE,CAACG,KAAK,CAACE,SAAP,CAAkBF,KAAK,CAACM,cAAxB,EAAwCF,IAAxC,CAA6C,GAA7C,CAAhB,UACGL,qBADH,EAPF,GAYH,CAED,KAAMQ,CAAAA,gBAAgB,CAAG,kBAAO,YAAP,CAAqB,CAC5C,WAD4C,CAE5C,eAF4C,CAG5C,WAH4C,CAI5C,gBAJ4C,CAK5C,WAL4C,CAArB,CAMtBC,SANsB,EAMXZ,UANW,CAAzB,CAQAA,UAAU,CAACa,SAAX,CAAuB,CACrBZ,QAAQ,CAAEa,mBAAGC,IADQ,CAErBb,oBAAoB,CAAEY,mBAAGC,IAFJ,CAGrBZ,qBAAqB,CAAEW,mBAAGC,IAHL,CAIrBX,KAAK,CAAEO,gBAAgB,CAACK,SAAjB,CAA2BC,UAJb,CAAvB,CAOAjB,UAAU,CAACkB,YAAX,CAA0B,CACxBjB,QAAQ,CAAE,IADc,CAExBC,oBAAoB,CAAE,IAFE,CAGxBC,qBAAqB,CAAE,IAHC,CAA1B,C,aAMeQ,gB","sourcesContent":["import PT from 'prop-types';\n\nimport { themed } from 'utils';\n\nimport baseTheme from './base-theme.scss';\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 */\nfunction PageLayout({\n children,\n leftSidePanelContent,\n rightSidePanelContent,\n theme,\n}) {\n return (\n <div className={theme.container}>\n <div className={[theme.sidePanel, theme.leftSidePanel].join(' ')}>\n {leftSidePanelContent}\n </div>\n <div className={theme.mainPanel}>\n {children}\n </div>\n <div className={[theme.sidePanel, theme.rightSidePanel].join(' ')}>\n {rightSidePanelContent}\n </div>\n </div>\n );\n}\n\nconst ThemedPageLayout = themed('PageLayout', [\n 'container',\n 'leftSidePanel',\n 'mainPanel',\n 'rightSidePanel',\n 'sidePanel',\n], baseTheme)(PageLayout);\n\nPageLayout.propTypes = {\n children: PT.node,\n leftSidePanelContent: PT.node,\n rightSidePanelContent: PT.node,\n theme: ThemedPageLayout.themeType.isRequired,\n};\n\nPageLayout.defaultProps = {\n children: null,\n leftSidePanelContent: null,\n rightSidePanelContent: null,\n};\n\nexport default ThemedPageLayout;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../../src/shared/components/PageLayout/index.jsx"],"names":["PageLayout","children","leftSidePanelContent","rightSidePanelContent","theme","container","sidePanel","leftSidePanel","join","mainPanel","rightSidePanel","ThemedPageLayout","baseTheme","propTypes","PT","node","themeType","isRequired","defaultProps"],"mappings":"gLAAA,6DAEA,kC,8KAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,QAASA,CAAAA,UAAT,CAAoB,CAClBC,QADkB,CAElBC,oBAFkB,CAGlBC,qBAHkB,CAIlBC,KAJkB,CAApB,CAKG,CACD,mBACE,4BAAK,SAAS,CAAEA,KAAK,CAACC,SAAtB,wBACE,2BAAK,SAAS,CAAE,CAACD,KAAK,CAACE,SAAP,CAAkBF,KAAK,CAACG,aAAxB,EAAuCC,IAAvC,CAA4C,GAA5C,CAAhB,UACGN,oBADH,EADF,cAIE,2BAAK,SAAS,CAAEE,KAAK,CAACK,SAAtB,UACGR,QADH,EAJF,cAOE,2BAAK,SAAS,CAAE,CAACG,KAAK,CAACE,SAAP,CAAkBF,KAAK,CAACM,cAAxB,EAAwCF,IAAxC,CAA6C,GAA7C,CAAhB,UACGL,qBADH,EAPF,GAYH,CAED,KAAMQ,CAAAA,gBAAgB,CAAG,kBAAO,YAAP,CAAqB,CAC5C,WAD4C,CAE5C,eAF4C,CAG5C,WAH4C,CAI5C,gBAJ4C,CAK5C,WAL4C,CAArB,CAMtBC,SANsB,EAMXZ,UANW,CAAzB,CAQAA,UAAU,CAACa,SAAX,CAAuB,CACrBZ,QAAQ,CAAEa,mBAAGC,IADQ,CAErBb,oBAAoB,CAAEY,mBAAGC,IAFJ,CAGrBZ,qBAAqB,CAAEW,mBAAGC,IAHL,CAIrBX,KAAK,CAAEO,gBAAgB,CAACK,SAAjB,CAA2BC,UAJb,CAAvB,CAOAjB,UAAU,CAACkB,YAAX,CAA0B,CACxBjB,QAAQ,CAAE,IADc,CAExBC,oBAAoB,CAAE,IAFE,CAGxBC,qBAAqB,CAAE,IAHC,CAA1B,C,aAMeQ,gB","sourcesContent":["import PT from 'prop-types';\n\nimport { themed } from 'utils';\n\nimport baseTheme from './base-theme.scss';\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 */\nfunction PageLayout({\n children,\n leftSidePanelContent,\n rightSidePanelContent,\n theme,\n}) {\n return (\n <div className={theme.container}>\n <div className={[theme.sidePanel, theme.leftSidePanel].join(' ')}>\n {leftSidePanelContent}\n </div>\n <div className={theme.mainPanel}>\n {children}\n </div>\n <div className={[theme.sidePanel, theme.rightSidePanel].join(' ')}>\n {rightSidePanelContent}\n </div>\n </div>\n );\n}\n\nconst ThemedPageLayout = themed('PageLayout', [\n 'container',\n 'leftSidePanel',\n 'mainPanel',\n 'rightSidePanel',\n 'sidePanel',\n], baseTheme)(PageLayout);\n\nPageLayout.propTypes = {\n children: PT.node,\n leftSidePanelContent: PT.node,\n rightSidePanelContent: PT.node,\n theme: ThemedPageLayout.themeType.isRequired,\n};\n\nPageLayout.defaultProps = {\n children: null,\n leftSidePanelContent: null,\n rightSidePanelContent: null,\n};\n\nexport default ThemedPageLayout;\n"],"file":"index.js"}
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _reactThemes=_interopRequireDefault(require("@dr.pogodin/react-themes"));var _jsxRuntime=require("react/jsx-runtime");var defaultTheme={"context":"uIObt7","ad":"XIxe9o","hoc":"YOyORH","bouncing":"TJe-6j","container":"_7zdld4","circle":"dBrB4g"};/**
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _reactThemes=_interopRequireDefault(require("@dr.pogodin/react-themes"));var _jsxRuntime=require("react/jsx-runtime");const defaultTheme={"context":"uIObt7","ad":"XIxe9o","hoc":"YOyORH","bouncing":"TJe-6j","container":"_7zdld4","circle":"dBrB4g"};/**
2
2
  * Throbber is an "action in progress" indicator, which renders
3
3
  * three bouncing circles as a simple pending activity indicator,
4
4
  * and can be further themed to a certain degree.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/shared/components/Throbber/index.jsx"],"names":["Throbber","theme","container","circle","defaultProps","propTypes","PT","shape","string","defaultTheme"],"mappings":"gLAAA,6DACA,6E,4KAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,QAASA,CAAAA,QAAT,CAAkB,CAChBC,KADgB,CAAlB,CAEG,CACD,mBACE,4BAAK,SAAS,EAAEA,KAAK,CAACC,SAAR,CAAED,KAAK,CAACC,SAAR,kBAAd,wBACE,2BAAK,SAAS,EAAED,KAAK,CAACE,MAAR,CAAEF,KAAK,CAACE,MAAR,iBAAd,EADF,cAEE,2BAAK,SAAS,EAAEF,KAAK,CAACE,MAAR,CAAEF,KAAK,CAACE,MAAR,iBAAd,EAFF,cAGE,2BAAK,SAAS,EAAEF,KAAK,CAACE,MAAR,CAAEF,KAAK,CAACE,MAAR,iBAAd,EAHF,GAMH,CAEDH,QAAQ,CAACI,YAAT,CAAwB,CACtBH,KAAK,CAAE,EADe,CAAxB,CAIAD,QAAQ,CAACK,SAAT,CAAqB,CACnBJ,KAAK,CAAEK,mBAAGC,KAAH,CAAS,CACdL,SAAS,CAAEI,mBAAGE,MADA,CAEdL,MAAM,CAAEG,mBAAGE,MAFG,CAAT,CADY,CAArB,C,aAOe,yBAAO,UAAP,CAAmB,CAChC,QADgC,CAEhC,WAFgC,CAAnB,CAGZC,YAHY,EAGET,QAHF,C","sourcesContent":["import PT from 'prop-types';\nimport themed from '@dr.pogodin/react-themes';\n\nimport defaultTheme from './theme.scss';\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 */\nfunction Throbber({\n theme,\n}) {\n return (\n <div className={theme.container} styleName=\"container\">\n <div className={theme.circle} styleName=\"circle\" />\n <div className={theme.circle} styleName=\"circle\" />\n <div className={theme.circle} styleName=\"circle\" />\n </div>\n );\n}\n\nThrobber.defaultProps = {\n theme: {},\n};\n\nThrobber.propTypes = {\n theme: PT.shape({\n container: PT.string,\n circle: PT.string,\n }),\n};\n\nexport default themed('Throbber', [\n 'circle',\n 'container',\n], defaultTheme)(Throbber);\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../../src/shared/components/Throbber/index.jsx"],"names":["Throbber","theme","container","circle","defaultProps","propTypes","PT","shape","string","defaultTheme"],"mappings":"gLAAA,6DACA,6E,8KAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,QAASA,CAAAA,QAAT,CAAkB,CAChBC,KADgB,CAAlB,CAEG,CACD,mBACE,4BAAK,SAAS,EAAEA,KAAK,CAACC,SAAR,CAAED,KAAK,CAACC,SAAR,kBAAd,wBACE,2BAAK,SAAS,EAAED,KAAK,CAACE,MAAR,CAAEF,KAAK,CAACE,MAAR,iBAAd,EADF,cAEE,2BAAK,SAAS,EAAEF,KAAK,CAACE,MAAR,CAAEF,KAAK,CAACE,MAAR,iBAAd,EAFF,cAGE,2BAAK,SAAS,EAAEF,KAAK,CAACE,MAAR,CAAEF,KAAK,CAACE,MAAR,iBAAd,EAHF,GAMH,CAEDH,QAAQ,CAACI,YAAT,CAAwB,CACtBH,KAAK,CAAE,EADe,CAAxB,CAIAD,QAAQ,CAACK,SAAT,CAAqB,CACnBJ,KAAK,CAAEK,mBAAGC,KAAH,CAAS,CACdL,SAAS,CAAEI,mBAAGE,MADA,CAEdL,MAAM,CAAEG,mBAAGE,MAFG,CAAT,CADY,CAArB,C,aAOe,yBAAO,UAAP,CAAmB,CAChC,QADgC,CAEhC,WAFgC,CAAnB,CAGZC,YAHY,EAGET,QAHF,C","sourcesContent":["import PT from 'prop-types';\nimport themed from '@dr.pogodin/react-themes';\n\nimport defaultTheme from './theme.scss';\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 */\nfunction Throbber({\n theme,\n}) {\n return (\n <div className={theme.container} styleName=\"container\">\n <div className={theme.circle} styleName=\"circle\" />\n <div className={theme.circle} styleName=\"circle\" />\n <div className={theme.circle} styleName=\"circle\" />\n </div>\n );\n}\n\nThrobber.defaultProps = {\n theme: {},\n};\n\nThrobber.propTypes = {\n theme: PT.shape({\n container: PT.string,\n circle: PT.string,\n }),\n};\n\nexport default themed('Throbber', [\n 'circle',\n 'container',\n], defaultTheme)(Throbber);\n"],"file":"index.js"}
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _react=require("react");var _utils=require("../../utils");var _Tooltip=_interopRequireWildcard(require("./Tooltip"));var _jsxRuntime=require("react/jsx-runtime");function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}/* global window */var defaultTheme={"ad":"_4xT7zE","hoc":"zd-vnH","context":"GdZucr","appearance":"L4ubm-","arrow":"M9gywF","container":"f9gY8K","wrapper":"_4qDBRM"};/**
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _react=require("react");var _utils=require("../../utils");var _Tooltip=_interopRequireWildcard(require("./Tooltip"));var _jsxRuntime=require("react/jsx-runtime");function _getRequireWildcardCache(nodeInterop){if(typeof WeakMap!=="function")return null;var cacheBabelInterop=new WeakMap;var cacheNodeInterop=new WeakMap;return(_getRequireWildcardCache=function(nodeInterop){return nodeInterop?cacheNodeInterop:cacheBabelInterop})(nodeInterop)}function _interopRequireWildcard(obj,nodeInterop){if(!nodeInterop&&obj&&obj.__esModule){return obj}if(obj===null||typeof obj!=="object"&&typeof obj!=="function"){return{default:obj}}var cache=_getRequireWildcardCache(nodeInterop);if(cache&&cache.has(obj)){return cache.get(obj)}var newObj={};var hasPropertyDescriptor=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var key in obj){if(key!=="default"&&Object.prototype.hasOwnProperty.call(obj,key)){var desc=hasPropertyDescriptor?Object.getOwnPropertyDescriptor(obj,key):null;if(desc&&(desc.get||desc.set)){Object.defineProperty(newObj,key,desc)}else{newObj[key]=obj[key]}}}newObj.default=obj;if(cache){cache.set(obj,newObj)}return newObj}/* global window */const defaultTheme={"ad":"_4xT7zE","hoc":"zd-vnH","context":"GdZucr","appearance":"L4ubm-","arrow":"M9gywF","container":"f9gY8K","wrapper":"_4qDBRM"};/**
2
2
  * Implements a simple to use and themeable tooltip component, _e.g._
3
3
  * ```js
4
4
  * <WithTooltip tip="This is example tooltip.">
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/shared/components/WithTooltip/index.jsx"],"names":["Wrapper","children","placement","tip","theme","tooltipRef","wrapperRef","showTooltip","setShowTooltip","updatePortalPosition","cursorX","cursorY","wrapperRect","current","getBoundingClientRect","left","right","top","bottom","pointTo","window","pageXOffset","pageYOffset","listener","addEventListener","removeEventListener","undefined","wrapper","e","clientX","clientY","ThemedWrapper","defaultTheme","PLACEMENTS","propTypes","PT","node","oneOf","Object","values","themeType","isRequired","defaultProps","ABOVE_CURSOR"],"mappings":"gLAEA,6DACA,4BAEA,kCAEA,2D,igCAPA,mB,oJAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,QAASA,CAAAA,OAAT,CAAiB,CACfC,QADe,CAEfC,SAFe,CAGfC,GAHe,CAIfC,KAJe,CAAjB,CAKG,CACD,KAAMC,CAAAA,UAAU,CAAG,mBAAnB,CACA,KAAMC,CAAAA,UAAU,CAAG,mBAAnB,CACA,KAAM,CAACC,WAAD,CAAcC,cAAd,EAAgC,oBAAS,KAAT,CAAtC,CAEA,KAAMC,CAAAA,oBAAoB,CAAG,CAACC,OAAD,CAAUC,OAAV,GAAsB,CACjD,GAAI,CAACJ,WAAL,CAAkBC,cAAc,CAAC,IAAD,CAAd,CAAlB,IACK,CACH,KAAMI,CAAAA,WAAW,CAAGN,UAAU,CAACO,OAAX,CAAmBC,qBAAnB,EAApB,CACA,GACEJ,OAAO,CAAGE,WAAW,CAACG,IAAtB,EACGL,OAAO,CAAGE,WAAW,CAACI,KADzB,EAEGL,OAAO,CAAGC,WAAW,CAACK,GAFzB,EAGGN,OAAO,CAAGC,WAAW,CAACM,MAJ3B,CAKE,CACAV,cAAc,CAAC,KAAD,CACf,CAPD,IAOO,IAAIH,UAAU,CAACQ,OAAf,CAAwB,CAC7BR,UAAU,CAACQ,OAAX,CAAmBM,OAAnB,CACET,OAAO,CAAGU,MAAM,CAACC,WADnB,CAEEV,OAAO,CAAGS,MAAM,CAACE,WAFnB,CAGEpB,SAHF,CAIEI,UAAU,CAACO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0C,YAAR,CAAuB,CACrBzC,QAAQ,CAAE,IADW,CAErBC,SAAS,CAAE+B,oBAAWU,YAFD,CAGrBxC,GAAG,CAAE,IAHgB,CAAvB,C,aAMe4B,a","sourcesContent":["/* global window */\n\nimport PT from 'prop-types';\nimport { useEffect, useRef, useState } from 'react';\n\nimport { themed } from 'utils';\n\nimport Tooltip, { PLACEMENTS } from './Tooltip';\n\nimport defaultTheme from './default-theme.scss';\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 &ndash; 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 */\nfunction Wrapper({\n children,\n placement,\n tip,\n theme,\n}) {\n const tooltipRef = useRef();\n const wrapperRef = useRef();\n const [showTooltip, setShowTooltip] = useState(false);\n\n const updatePortalPosition = (cursorX, cursorY) => {\n if (!showTooltip) setShowTooltip(true);\n else {\n const wrapperRect = wrapperRef.current.getBoundingClientRect();\n if (\n cursorX < wrapperRect.left\n || cursorX > wrapperRect.right\n || cursorY < wrapperRect.top\n || cursorY > wrapperRect.bottom\n ) {\n setShowTooltip(false);\n } else if (tooltipRef.current) {\n tooltipRef.current.pointTo(\n cursorX + window.pageXOffset,\n cursorY + window.pageYOffset,\n placement,\n wrapperRef.current,\n );\n }\n }\n };\n\n useEffect(() => {\n if (showTooltip && tip !== null) {\n const listener = () => setShowTooltip(false);\n window.addEventListener('scroll', listener);\n return () => window.removeEventListener('scroll', listener);\n }\n return undefined;\n }, [showTooltip, tip]);\n\n return (\n <div\n className={theme.wrapper}\n onMouseLeave={() => setShowTooltip(false)}\n onMouseMove={(e) => updatePortalPosition(e.clientX, e.clientY)}\n ref={wrapperRef}\n >\n {\n showTooltip && tip !== null ? (\n <Tooltip ref={tooltipRef} theme={theme}>{tip}</Tooltip>\n ) : null\n }\n {children}\n </div>\n );\n}\n\nconst ThemedWrapper = themed(\n 'WithTooltip',\n [\n 'appearance',\n 'arrow',\n 'container',\n 'content',\n 'wrapper',\n ],\n defaultTheme,\n)(Wrapper);\n\nThemedWrapper.PLACEMENTS = PLACEMENTS;\n\nWrapper.propTypes = {\n children: PT.node,\n placement: PT.oneOf(Object.values(PLACEMENTS)),\n theme: ThemedWrapper.themeType.isRequired,\n tip: PT.node,\n};\n\nWrapper.defaultProps = {\n children: null,\n placement: PLACEMENTS.ABOVE_CURSOR,\n tip: null,\n};\n\nexport default ThemedWrapper;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../../src/shared/components/WithTooltip/index.jsx"],"names":["Wrapper","children","placement","tip","theme","tooltipRef","wrapperRef","showTooltip","setShowTooltip","updatePortalPosition","cursorX","cursorY","wrapperRect","current","getBoundingClientRect","left","right","top","bottom","pointTo","window","pageXOffset","pageYOffset","listener","addEventListener","removeEventListener","undefined","wrapper","e","clientX","clientY","ThemedWrapper","defaultTheme","PLACEMENTS","propTypes","PT","node","oneOf","Object","values","themeType","isRequired","defaultProps","ABOVE_CURSOR"],"mappings":"gLAEA,6DACA,4BAEA,kCAEA,2D,igCAPA,mB,sJAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,QAASA,CAAAA,OAAT,CAAiB,CACfC,QADe,CAEfC,SAFe,CAGfC,GAHe,CAIfC,KAJe,CAAjB,CAKG,CACD,KAAMC,CAAAA,UAAU,CAAG,mBAAnB,CACA,KAAMC,CAAAA,UAAU,CAAG,mBAAnB,CACA,KAAM,CAACC,WAAD,CAAcC,cAAd,EAAgC,oBAAS,KAAT,CAAtC,CAEA,KAAMC,CAAAA,oBAAoB,CAAG,CAACC,OAAD,CAAUC,OAA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,KAAK,CAAED,KAAjC,UAAyCD,GAAzC,EADF,CAEI,IATR,CAWGF,QAXH,GAcH,CAED,KAAM8B,CAAAA,aAAa,CAAG,kBACpB,aADoB,CAEpB,CACE,YADF,CAEE,OAFF,CAGE,WAHF,CAIE,SAJF,CAKE,SALF,CAFoB,CASpBC,YAToB,EAUpBhC,OAVoB,CAAtB,CAYA+B,aAAa,CAACE,UAAd,CAA2BA,mBAA3B,CAEAjC,OAAO,CAACkC,SAAR,CAAoB,CAClBjC,QAAQ,CAAEkC,mBAAGC,IADK,CAElBlC,SAAS,CAAEiC,mBAAGE,KAAH,CAASC,MAAM,CAACC,MAAP,CAAcN,mBAAd,CAAT,CAFO,CAGlB7B,KAAK,CAAE2B,aAAa,CAACS,SAAd,CAAwBC,UAHb,CAIlBtC,GAAG,CAAEgC,mBAAGC,IAJU,CAApB,CAOApC,OAAO,CAAC0C,YAAR,CAAuB,CACrBzC,QAAQ,CAAE,IADW,CAErBC,SAAS,CAAE+B,oBAAWU,YAFD,CAGrBxC,GAAG,CAAE,IAHgB,CAAvB,C,aAMe4B,a","sourcesContent":["/* global window */\n\nimport PT from 'prop-types';\nimport { useEffect, useRef, useState } from 'react';\n\nimport { themed } from 'utils';\n\nimport Tooltip, { PLACEMENTS } from './Tooltip';\n\nimport defaultTheme from './default-theme.scss';\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 &ndash; 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 */\nfunction Wrapper({\n children,\n placement,\n tip,\n theme,\n}) {\n const tooltipRef = useRef();\n const wrapperRef = useRef();\n const [showTooltip, setShowTooltip] = useState(false);\n\n const updatePortalPosition = (cursorX, cursorY) => {\n if (!showTooltip) setShowTooltip(true);\n else {\n const wrapperRect = wrapperRef.current.getBoundingClientRect();\n if (\n cursorX < wrapperRect.left\n || cursorX > wrapperRect.right\n || cursorY < wrapperRect.top\n || cursorY > wrapperRect.bottom\n ) {\n setShowTooltip(false);\n } else if (tooltipRef.current) {\n tooltipRef.current.pointTo(\n cursorX + window.pageXOffset,\n cursorY + window.pageYOffset,\n placement,\n wrapperRef.current,\n );\n }\n }\n };\n\n useEffect(() => {\n if (showTooltip && tip !== null) {\n const listener = () => setShowTooltip(false);\n window.addEventListener('scroll', listener);\n return () => window.removeEventListener('scroll', listener);\n }\n return undefined;\n }, [showTooltip, tip]);\n\n return (\n <div\n className={theme.wrapper}\n onMouseLeave={() => setShowTooltip(false)}\n onMouseMove={(e) => updatePortalPosition(e.clientX, e.clientY)}\n ref={wrapperRef}\n >\n {\n showTooltip && tip !== null ? (\n <Tooltip ref={tooltipRef} theme={theme}>{tip}</Tooltip>\n ) : null\n }\n {children}\n </div>\n );\n}\n\nconst ThemedWrapper = themed(\n 'WithTooltip',\n [\n 'appearance',\n 'arrow',\n 'container',\n 'content',\n 'wrapper',\n ],\n defaultTheme,\n)(Wrapper);\n\nThemedWrapper.PLACEMENTS = PLACEMENTS;\n\nWrapper.propTypes = {\n children: PT.node,\n placement: PT.oneOf(Object.values(PLACEMENTS)),\n theme: ThemedWrapper.themeType.isRequired,\n tip: PT.node,\n};\n\nWrapper.defaultProps = {\n children: null,\n placement: PLACEMENTS.ABOVE_CURSOR,\n tip: null,\n};\n\nexport default ThemedWrapper;\n"],"file":"index.js"}
@@ -1,4 +1,4 @@
1
- "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _qs=_interopRequireDefault(require("qs"));var _ScalableRect=_interopRequireDefault(require("../ScalableRect"));var _reactThemes=_interopRequireDefault(require("@dr.pogodin/react-themes"));var _Throbber=_interopRequireDefault(require("../Throbber"));var _jsxRuntime=require("react/jsx-runtime");var baseTheme={"context":"veKyYi","ad":"r3ABzd","hoc":"YKcPnR","container":"sXHM81","video":"SlV2zw"};var throbberTheme={"context":"dzIcLh","ad":"_5a9XX1","hoc":"_7sH52O","container":"jTxmOX"};/**
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _propTypes=_interopRequireDefault(require("prop-types"));var _qs=_interopRequireDefault(require("qs"));var _ScalableRect=_interopRequireDefault(require("../ScalableRect"));var _reactThemes=_interopRequireDefault(require("@dr.pogodin/react-themes"));var _Throbber=_interopRequireDefault(require("../Throbber"));var _jsxRuntime=require("react/jsx-runtime");const baseTheme={"context":"veKyYi","ad":"r3ABzd","hoc":"YKcPnR","container":"sXHM81","video":"SlV2zw"};const throbberTheme={"context":"dzIcLh","ad":"_5a9XX1","hoc":"_7sH52O","container":"jTxmOX"};/**
2
2
  * A component for embeding a YouTube video.
3
3
  * @param {object} [props] Component properties.
4
4
  * @param {boolean} [props.autoplay] If `true` the video will start to play
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/shared/components/YouTubeVideo/index.jsx"],"names":["YouTubeVideo","autoplay","src","theme","title","url","query","split","qs","parse","videoId","v","match","stringify","container","throbberTheme","video","ThemedYouTubeVideo","baseTheme","propTypes","PT","bool","string","isRequired","themeType","defaultProps"],"mappings":"gLAAA,6DACA,8CACA,qEACA,6EACA,6D,8OAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,QAASA,CAAAA,YAAT,CAAsB,CACpBC,QADoB,CAEpBC,GAFoB,CAGpBC,KAHoB,CAIpBC,KAJoB,CAAtB,CAKG,CACD,GAAI,CAACC,GAAD,CAAMC,KAAN,EAAeJ,GAAG,CAACK,KAA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ScalableRect from 'components/ScalableRect';\nimport themed from '@dr.pogodin/react-themes';\nimport Throbber from 'components/Throbber';\n\nimport baseTheme from './base.scss';\nimport throbberTheme from './throbber.scss';\n\n/**\n * A component for embeding a YouTube video.\n * @param {object} [props] Component properties.\n * @param {boolean} [props.autoplay] If `true` the video will start to play\n * automatically once loaded.\n * @param {string} [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 {YouTubeVideoTheme} [props.theme] _Ad hoc_ theme.\n * @param {string} [props.title] The `title` attribute to add to the player\n * IFrame.\n */\nfunction YouTubeVideo({\n autoplay,\n src,\n theme,\n title,\n}) {\n let [url, query] = src.split('?');\n query = query ? qs.parse(query) : {};\n\n const videoId = query.v || url.match(/\\/([a-zA-Z0-9-_]*)$/)[1];\n url = `https://www.youtube.com/embed/${videoId}`;\n\n delete query.v;\n query.autoplay = autoplay ? 1 : 0;\n url += `?${qs.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 (\n <ScalableRect className={theme.container} ratio=\"16:9\">\n <Throbber theme={throbberTheme} />\n <iframe\n allow=\"autoplay\"\n allowFullScreen\n className={theme.video}\n src={url}\n title={title}\n />\n </ScalableRect>\n );\n}\n\nconst ThemedYouTubeVideo = themed(\n 'YouTubeVideo',\n [\n 'container',\n 'video',\n ],\n baseTheme,\n)(YouTubeVideo);\n\nYouTubeVideo.propTypes = {\n autoplay: PT.bool,\n src: PT.string.isRequired,\n theme: ThemedYouTubeVideo.themeType.isRequired,\n title: PT.string,\n};\n\nYouTubeVideo.defaultProps = {\n autoplay: false,\n title: '',\n};\n\nexport default ThemedYouTubeVideo;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../../../src/shared/components/YouTubeVideo/index.jsx"],"names":["YouTubeVideo","autoplay","src","theme","title","url","query","split","qs","parse","videoId","v","match","stringify","container","throbberTheme","video","ThemedYouTubeVideo","baseTheme","propTypes","PT","bool","string","isRequired","themeType","defaultProps"],"mappings":"gLAAA,6DACA,8CACA,qEACA,6EACA,6D,kPAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,QAASA,CAAAA,YAAT,CAAsB,CACpBC,QADoB,CAEpBC,GAFoB,CAGpBC,KAHoB,CAIpBC,KAJoB,CAAtB,CAKG,CACD,GAAI,CAACC,GAAD,CAAMC,KAAN,EAAeJ,GAAG,CAACK,KAAJ,CAAU,GAAV,CAAnB,CACAD,KAAK,CAAGA,KAAK,CAAGE,YAAGC,KAAH,CAASH,KAAT,CAAH,CAAqB,EAAlC,CAEA,KAAMI,CAAAA,OAAO,CAAGJ,KAAK,CAACK,CAAN,EAAWN,GAAG,CAACO,KAAJ,CAAU,qBAAV,EAAiC,CAAjC,CAA3B,CACAP,GAAG,CAAI,iCAAgCK,OAAQ,EAA/C,CAEA,MAAOJ,CAAAA,KAAK,CAACK,CAAb,CACAL,KAAK,CAACL,QAAN,CAAiBA,QAAQ,CAAG,CAAH,CAAO,CAAhC,CACAI,GAAG,EAAK,IAAGG,YAAGK,SAAH,CAAaP,KAAb,CAAoB,EAA/B,CAEA;AACA;AAEA,mBACE,qBAAC,qBAAD,EAAc,SAAS,CAAEH,KAAK,CAACW,SAA/B,CAA0C,KAAK,CAAC,MAAhD,wBACE,oBAAC,iBAAD,EAAU,KAAK,CAAEC,aAAjB,EADF,cAEE,8BACE,KAAK,CAAC,UADR,CAEE,eAAe,KAFjB,CAGE,SAAS,CAAEZ,KAAK,CAACa,KAHnB,CAIE,GAAG,CAAEX,GAJP,CAKE,KAAK,CAAED,KALT,EAFF,GAWH,CAED,KAAMa,CAAAA,kBAAkB,CAAG,yBACzB,cADyB,CAEzB,CACE,WADF,CAEE,OAFF,CAFyB,CAMzBC,SANyB,EAOzBlB,YAPyB,CAA3B,CASAA,YAAY,CAACmB,SAAb,CAAyB,CACvBlB,QAAQ,CAAEmB,mBAAGC,IADU,CAEvBnB,GAAG,CAAEkB,mBAAGE,MAAH,CAAUC,UAFQ,CAGvBpB,KAAK,CAAEc,kBAAkB,CAACO,SAAnB,CAA6BD,UAHb,CAIvBnB,KAAK,CAAEgB,mBAAGE,MAJa,CAAzB,CAOAtB,YAAY,CAACyB,YAAb,CAA4B,CAC1BxB,QAAQ,CAAE,KADgB,CAE1BG,KAAK,CAAE,EAFmB,CAA5B,C,aAKea,kB","sourcesContent":["import PT from 'prop-types';\nimport qs from 'qs';\nimport ScalableRect from 'components/ScalableRect';\nimport themed from '@dr.pogodin/react-themes';\nimport Throbber from 'components/Throbber';\n\nimport baseTheme from './base.scss';\nimport throbberTheme from './throbber.scss';\n\n/**\n * A component for embeding a YouTube video.\n * @param {object} [props] Component properties.\n * @param {boolean} [props.autoplay] If `true` the video will start to play\n * automatically once loaded.\n * @param {string} [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 {YouTubeVideoTheme} [props.theme] _Ad hoc_ theme.\n * @param {string} [props.title] The `title` attribute to add to the player\n * IFrame.\n */\nfunction YouTubeVideo({\n autoplay,\n src,\n theme,\n title,\n}) {\n let [url, query] = src.split('?');\n query = query ? qs.parse(query) : {};\n\n const videoId = query.v || url.match(/\\/([a-zA-Z0-9-_]*)$/)[1];\n url = `https://www.youtube.com/embed/${videoId}`;\n\n delete query.v;\n query.autoplay = autoplay ? 1 : 0;\n url += `?${qs.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 (\n <ScalableRect className={theme.container} ratio=\"16:9\">\n <Throbber theme={throbberTheme} />\n <iframe\n allow=\"autoplay\"\n allowFullScreen\n className={theme.video}\n src={url}\n title={title}\n />\n </ScalableRect>\n );\n}\n\nconst ThemedYouTubeVideo = themed(\n 'YouTubeVideo',\n [\n 'container',\n 'video',\n ],\n baseTheme,\n)(YouTubeVideo);\n\nYouTubeVideo.propTypes = {\n autoplay: PT.bool,\n src: PT.string.isRequired,\n theme: ThemedYouTubeVideo.themeType.isRequired,\n title: PT.string,\n};\n\nYouTubeVideo.defaultProps = {\n autoplay: false,\n title: '',\n};\n\nexport default ThemedYouTubeVideo;\n"],"file":"index.js"}
@@ -1,8 +1,20 @@
1
1
  "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _Barrier=require("./Barrier");/**
2
2
  * Implements a simple semaphore for async code logic.
3
- */class Semaphore{#barrier;#ready;constructor(ready=false){this.#ready=ready}get ready(){return this.#ready}setReady(ready){this.#ready=ready;if(this.#barrier){this.#barrier.resolve();this.#barrier=undefined}}/**
3
+ */class Semaphore{constructor(ready){this.#ready=!!ready}get ready(){return this.#ready}setReady(ready){const bool=!!ready;if(this.#ready!==bool){this.#ready=bool;if(bool&&!this.#draining)this.#drainQueue()}}/**
4
4
  * Waits until the semaphore is ready, and marks it as non-ready (seizes it).
5
5
  * @return {Promise}
6
- */async seize(){await this.waitReady();this.setReady(false)}async waitReady(){while(!this.#ready){if(!this.#barrier)this.#barrier=(0,_Barrier.newBarrier)();await this.#barrier;// eslint-disable-line no-await-in-loop
7
- }}}exports.default=Semaphore;
6
+ */async seize(){await this.waitReady();this.setReady(false)}async waitReady(){if(!this.#ready||this.#queue.length){const barrier=(0,_Barrier.newBarrier)();this.#queue.push(barrier);await barrier}}// Private members below this point.
7
+ /**
8
+ * If semaphore is ready, it releases the next barrier in the queue, if any,
9
+ * and reschedules itself for a call in the next event loop iteration.
10
+ * Otherwise, it breaks the queue draining loop, which will be restarted
11
+ * the next time the semaphore is set ready.
12
+ */#drainQueue(){if(this.#ready&&this.#queue.length){const next=this.#queue.shift();next.resolve();// Re-schedules itself for the next event loop iteration.
13
+ if(this.#queue.length){setTimeout(this.#drainQueue.bind(this));this.#draining=true;return;// Exit here to avoid the drain loop termination below.
14
+ }}// Cleans up for the drain loop termination.
15
+ this.#draining=false}// "true" when the drain queue process is running (and thus no need to start
16
+ // a new one).
17
+ #draining=false;// The array of barriers set for each async code flow awaiting for
18
+ // the Semaphore to become ready.
19
+ #queue=[];#ready}exports.default=Semaphore;
8
20
  //# sourceMappingURL=Semaphore.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/shared/utils/Semaphore.js"],"names":["Semaphore","barrier","ready","constructor","setReady","resolve","undefined","seize","waitReady"],"mappings":"6FAAA,kCAEA;AACA;AACA,GACe,KAAMA,CAAAA,SAAU,CAC7B,CAACC,OAAD,CAEA,CAACC,KAAD,CAEAC,WAAW,CAACD,KAAK,CAAG,KAAT,CAAgB,CACzB,KAAK,CAACA,KAAN,CAAcA,KACf,CAEQ,GAALA,CAAAA,KAAK,EAAG,CAAE,MAAO,MAAK,CAACA,KAAQ,CAEnCE,QAAQ,CAACF,KAAD,CAAQ,CACd,KAAK,CAACA,KAAN,CAAcA,KAAd,CACA,GAAI,KAAK,CAACD,OAAV,CAAmB,CACjB,KAAK,CAACA,OAAN,CAAcI,OAAd,GACA,KAAK,CAACJ,OAAN,CAAgBK,SACjB,CACF,CAED;AACF;AACA;AACA,KACa,KAALC,CAAAA,KAAK,EAAG,CACZ,KAAM,MAAKC,SAAL,EAAN,CACA,KAAKJ,QAAL,CAAc,KAAd,CACD,CAEc,KAATI,CAAAA,SAAS,EAAG,CAChB,MAAO,CAAC,KAAK,CAACN,KAAd,CAAqB,CACnB,GAAI,CAAC,KAAK,CAACD,OAAX,CAAoB,KAAK,CAACA,OAAN,CAAgB,yBAAhB,CACpB,KAAM,MAAK,CAACA,OAAZ,CAAqB;AACtB,CACF,CAjC4B,C","sourcesContent":["import { newBarrier } from './Barrier';\n\n/**\n * Implements a simple semaphore for async code logic.\n */\nexport default class Semaphore {\n #barrier;\n\n #ready;\n\n constructor(ready = false) {\n this.#ready = ready;\n }\n\n get ready() { return this.#ready; }\n\n setReady(ready) {\n this.#ready = ready;\n if (this.#barrier) {\n this.#barrier.resolve();\n this.#barrier = undefined;\n }\n }\n\n /**\n * Waits until the semaphore is ready, and marks it as non-ready (seizes it).\n * @return {Promise}\n */\n async seize() {\n await this.waitReady();\n this.setReady(false);\n }\n\n async waitReady() {\n while (!this.#ready) {\n if (!this.#barrier) this.#barrier = newBarrier();\n await this.#barrier; // eslint-disable-line no-await-in-loop\n }\n }\n}\n"],"file":"Semaphore.js"}
1
+ {"version":3,"sources":["../../../../src/shared/utils/Semaphore.js"],"names":["Semaphore","constructor","ready","setReady","bool","draining","drainQueue","seize","waitReady","queue","length","barrier","push","next","shift","resolve","setTimeout","bind"],"mappings":"6FAAA,kCAEA;AACA;AACA,GACe,KAAMA,CAAAA,SAAU,CAC7BC,WAAW,CAACC,KAAD,CAAQ,CACjB,KAAK,CAACA,KAAN,CAAc,CAAC,CAACA,KACjB,CAEQ,GAALA,CAAAA,KAAK,EAAG,CAAE,MAAO,MAAK,CAACA,KAAQ,CAEnCC,QAAQ,CAACD,KAAD,CAAQ,CACd,KAAME,CAAAA,IAAI,CAAG,CAAC,CAACF,KAAf,CACA,GAAI,KAAK,CAACA,KAAN,GAAgBE,IAApB,CAA0B,CACxB,KAAK,CAACF,KAAN,CAAcE,IAAd,CACA,GAAIA,IAAI,EAAI,CAAC,KAAK,CAACC,QAAnB,CAA6B,KAAK,CAACC,UAAN,EAC9B,CACF,CAED;AACF;AACA;AACA,KACa,KAALC,CAAAA,KAAK,EAAG,CACZ,KAAM,MAAKC,SAAL,EAAN,CACA,KAAKL,QAAL,CAAc,KAAd,CACD,CAEc,KAATK,CAAAA,SAAS,EAAG,CAChB,GAAI,CAAC,KAAK,CAACN,KAAP,EAAgB,KAAK,CAACO,KAAN,CAAYC,MAAhC,CAAwC,CACtC,KAAMC,CAAAA,OAAO,CAAG,yBAAhB,CACA,KAAK,CAACF,KAAN,CAAYG,IAAZ,CAAiBD,OAAjB,EACA,KAAMA,CAAAA,OACP,CACF,CAED;AAEA;AACF;AACA;AACA;AACA;AACA,KACE,CAACL,UAAU,EAAG,CACZ,GAAI,KAAK,CAACJ,KAAN,EAAe,KAAK,CAACO,KAAN,CAAYC,MAA/B,CAAuC,CACrC,KAAMG,CAAAA,IAAI,CAAG,KAAK,CAACJ,KAAN,CAAYK,KAAZ,EAAb,CACAD,IAAI,CAACE,OAAL,GAEA;AACA,GAAI,KAAK,CAACN,KAAN,CAAYC,MAAhB,CAAwB,CACtBM,UAAU,CAAC,KAAK,CAACV,UAAN,CAAiBW,IAAjB,CAAsB,IAAtB,CAAD,CAAV,CACA,KAAK,CAACZ,QAAN,CAAiB,IAAjB,CACA,OAAQ;AACT,CACF,CAED;AACA,KAAK,CAACA,QAAN,CAAiB,KAClB,CAED;AACA;AACA,CAACA,QAAD,CAAY,KAAZ,CAEA;AACA;AACA,CAACI,KAAD,CAAS,EAAT,CAEA,CAACP,KAjE4B,C","sourcesContent":["import { newBarrier } from './Barrier';\n\n/**\n * Implements a simple semaphore for async code logic.\n */\nexport default class Semaphore {\n constructor(ready) {\n this.#ready = !!ready;\n }\n\n get ready() { return this.#ready; }\n\n setReady(ready) {\n const bool = !!ready;\n if (this.#ready !== bool) {\n this.#ready = bool;\n if (bool && !this.#draining) this.#drainQueue();\n }\n }\n\n /**\n * Waits until the semaphore is ready, and marks it as non-ready (seizes it).\n * @return {Promise}\n */\n async seize() {\n await this.waitReady();\n this.setReady(false);\n }\n\n async waitReady() {\n if (!this.#ready || this.#queue.length) {\n const barrier = newBarrier();\n this.#queue.push(barrier);\n await barrier;\n }\n }\n\n // Private members below this point.\n\n /**\n * If semaphore is ready, it releases the next barrier in the queue, if any,\n * and reschedules itself for a call in the next event loop iteration.\n * Otherwise, it breaks the queue draining loop, which will be restarted\n * the next time the semaphore is set ready.\n */\n #drainQueue() {\n if (this.#ready && this.#queue.length) {\n const next = this.#queue.shift();\n next.resolve();\n\n // Re-schedules itself for the next event loop iteration.\n if (this.#queue.length) {\n setTimeout(this.#drainQueue.bind(this));\n this.#draining = true;\n return; // Exit here to avoid the drain loop termination below.\n }\n }\n\n // Cleans up for the drain loop termination.\n this.#draining = false;\n }\n\n // \"true\" when the drain queue process is running (and thus no need to start\n // a new one).\n #draining = false;\n\n // The array of barriers set for each async code flow awaiting for\n // the Semaphore to become ready.\n #queue = [];\n\n #ready;\n}\n"],"file":"Semaphore.js"}