@gravity-ui/page-constructor 6.3.0 → 6.3.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.
@@ -13,6 +13,8 @@ unpredictable css rules order in build */
13
13
  border-radius: calc(var(--pc-border-radius) / 2);
14
14
  background: var(--g-color-base-float);
15
15
  box-shadow: 0 3px 10px var(--g-color-sfx-shadow);
16
+ font-size: var(--g-text-body-2-font-size);
17
+ line-height: var(--g-text-body-2-line-height);
16
18
  }
17
19
  .pc-navigation-popup__list {
18
20
  margin: 0;
@@ -9,11 +9,19 @@ const models_1 = require("../../models.js");
9
9
  const NavigationItem_1 = tslib_1.__importDefault(require("../NavigationItem/index.js"));
10
10
  const b = (0, utils_1.block)('navigation-popup');
11
11
  const OFFSET_RESET = { mainAxis: 0, crossAxis: 0 };
12
- const NavigationPopup = ({ anchorRef, items, onClose, open, }) => ((0, jsx_runtime_1.jsx)(uikit_1.Popup
13
- // Workaround to recalculate position on every opening. Required for valid position calculation for scrolled header links.
14
- , {
15
- // Workaround to recalculate position on every opening. Required for valid position calculation for scrolled header links.
16
- anchorRef: open ? anchorRef : undefined, open: open, onClose: onClose, onOutsideClick: onClose, keepMounted: true, disablePortal: true, strategy: "fixed", placement: "bottom-start", offset: OFFSET_RESET, children: (0, jsx_runtime_1.jsx)("ul", { className: b('list'), children: items.map((item) => ((0, jsx_runtime_1.jsx)(NavigationItem_1.default, { className: b('link'), data: item, menuLayout: models_1.NavigationLayout.Dropdown }, item.text))) }) }));
12
+ const NavigationPopup = ({ anchorRef, items, onClose, open, }) => {
13
+ // Opening and closing is controlled by the associated button,
14
+ // but in order to give the popup control over closing as well (e.g. on click outside or escape key press)
15
+ // there needs to be an awkward looking handler like this.
16
+ const onOpenChange = (isOpen) => {
17
+ if (!isOpen) {
18
+ onClose();
19
+ }
20
+ };
21
+ return ((0, jsx_runtime_1.jsx)(uikit_1.Popup, { className: b(),
22
+ // Workaround to recalculate position on every opening. Required for valid position calculation for scrolled header links.
23
+ anchorElement: anchorRef.current, open: open, onOpenChange: onOpenChange, keepMounted: true, strategy: "fixed", placement: "bottom-start", offset: OFFSET_RESET, children: (0, jsx_runtime_1.jsx)("ul", { className: b('list'), children: items.map((item) => ((0, jsx_runtime_1.jsx)(NavigationItem_1.default, { className: b('link'), data: item, menuLayout: models_1.NavigationLayout.Dropdown }, item.text))) }) }));
24
+ };
17
25
  exports.NavigationPopup = NavigationPopup;
18
26
  exports.default = exports.NavigationPopup;
19
27
  //# sourceMappingURL=NavigationPopup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationPopup.js","sourceRoot":"../../../../../src","sources":["navigation/components/NavigationPopup/NavigationPopup.tsx"],"names":[],"mappings":";;;;;AAEA,6CAAwC;AAExC,mDAAqC;AACrC,4CAAoE;AACpE,wFAA+C;AAI/C,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,kBAAkB,CAAC,CAAC;AACpC,MAAM,YAAY,GAA4C,EAAC,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAC,CAAC;AAEnF,MAAM,eAAe,GAAmC,CAAC,EAC5D,SAAS,EACT,KAAK,EACL,OAAO,EACP,IAAI,GACP,EAAE,EAAE,CAAC,CACF,uBAAC,aAAK;AACF,0HAA0H;;IAA1H,0HAA0H;IAC1H,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,OAAO,EACvB,WAAW,QACX,aAAa,QACb,QAAQ,EAAC,OAAO,EAChB,SAAS,EAAC,cAAc,EACxB,MAAM,EAAE,YAAY,YAEpB,+BAAI,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YACnB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACjB,uBAAC,wBAAc,IAEX,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EACpB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,yBAAgB,CAAC,QAAQ,IAHhC,IAAI,CAAC,IAAI,CAIhB,CACL,CAAC,GACD,GACD,CACX,CAAC;AA7BW,QAAA,eAAe,mBA6B1B;AAEF,kBAAe,uBAAe,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {Popup} from '@gravity-ui/uikit';\n\nimport {block} from '../../../utils';\nimport {NavigationLayout, NavigationPopupProps} from '../../models';\nimport NavigationItem from '../NavigationItem';\n\nimport './NavigationPopup.scss';\n\nconst b = block('navigation-popup');\nconst OFFSET_RESET: {mainAxis?: number; crossAxis?: number} = {mainAxis: 0, crossAxis: 0};\n\nexport const NavigationPopup: React.FC<NavigationPopupProps> = ({\n anchorRef,\n items,\n onClose,\n open,\n}) => (\n <Popup\n // Workaround to recalculate position on every opening. Required for valid position calculation for scrolled header links.\n anchorRef={open ? anchorRef : undefined}\n open={open}\n onClose={onClose}\n onOutsideClick={onClose}\n keepMounted\n disablePortal\n strategy=\"fixed\"\n placement=\"bottom-start\"\n offset={OFFSET_RESET}\n >\n <ul className={b('list')}>\n {items.map((item) => (\n <NavigationItem\n key={item.text}\n className={b('link')}\n data={item}\n menuLayout={NavigationLayout.Dropdown}\n />\n ))}\n </ul>\n </Popup>\n);\n\nexport default NavigationPopup;\n"]}
1
+ {"version":3,"file":"NavigationPopup.js","sourceRoot":"../../../../../src","sources":["navigation/components/NavigationPopup/NavigationPopup.tsx"],"names":[],"mappings":";;;;;AAEA,6CAAwC;AAExC,mDAAqC;AACrC,4CAAoE;AACpE,wFAA+C;AAI/C,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,kBAAkB,CAAC,CAAC;AACpC,MAAM,YAAY,GAA4C,EAAC,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAC,CAAC;AAEnF,MAAM,eAAe,GAAmC,CAAC,EAC5D,SAAS,EACT,KAAK,EACL,OAAO,EACP,IAAI,GACP,EAAE,EAAE;IACD,8DAA8D;IAC9D,0GAA0G;IAC1G,0DAA0D;IAC1D,MAAM,YAAY,GAAG,CAAC,MAAe,EAAE,EAAE;QACrC,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;QACd,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACH,uBAAC,aAAK,IACF,SAAS,EAAE,CAAC,EAAE;QACd,0HAA0H;QAC1H,aAAa,EAAE,SAAS,CAAC,OAAO,EAChC,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,WAAW,QACX,QAAQ,EAAC,OAAO,EAChB,SAAS,EAAC,cAAc,EACxB,MAAM,EAAE,YAAY,YAEpB,+BAAI,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YACnB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACjB,uBAAC,wBAAc,IAEX,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EACpB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,yBAAgB,CAAC,QAAQ,IAHhC,IAAI,CAAC,IAAI,CAIhB,CACL,CAAC,GACD,GACD,CACX,CAAC;AACN,CAAC,CAAC;AAvCW,QAAA,eAAe,mBAuC1B;AAEF,kBAAe,uBAAe,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {Popup} from '@gravity-ui/uikit';\n\nimport {block} from '../../../utils';\nimport {NavigationLayout, NavigationPopupProps} from '../../models';\nimport NavigationItem from '../NavigationItem';\n\nimport './NavigationPopup.scss';\n\nconst b = block('navigation-popup');\nconst OFFSET_RESET: {mainAxis?: number; crossAxis?: number} = {mainAxis: 0, crossAxis: 0};\n\nexport const NavigationPopup: React.FC<NavigationPopupProps> = ({\n anchorRef,\n items,\n onClose,\n open,\n}) => {\n // Opening and closing is controlled by the associated button,\n // but in order to give the popup control over closing as well (e.g. on click outside or escape key press)\n // there needs to be an awkward looking handler like this.\n const onOpenChange = (isOpen: boolean) => {\n if (!isOpen) {\n onClose();\n }\n };\n\n return (\n <Popup\n className={b()}\n // Workaround to recalculate position on every opening. Required for valid position calculation for scrolled header links.\n anchorElement={anchorRef.current}\n open={open}\n onOpenChange={onOpenChange}\n keepMounted\n strategy=\"fixed\"\n placement=\"bottom-start\"\n offset={OFFSET_RESET}\n >\n <ul className={b('list')}>\n {items.map((item) => (\n <NavigationItem\n key={item.text}\n className={b('link')}\n data={item}\n menuLayout={NavigationLayout.Dropdown}\n />\n ))}\n </ul>\n </Popup>\n );\n};\n\nexport default NavigationPopup;\n"]}
@@ -13,6 +13,8 @@ unpredictable css rules order in build */
13
13
  border-radius: calc(var(--pc-border-radius) / 2);
14
14
  background: var(--g-color-base-float);
15
15
  box-shadow: 0 3px 10px var(--g-color-sfx-shadow);
16
+ font-size: var(--g-text-body-2-font-size);
17
+ line-height: var(--g-text-body-2-line-height);
16
18
  }
17
19
  .pc-navigation-popup__list {
18
20
  margin: 0;
@@ -6,10 +6,18 @@ import NavigationItem from "../NavigationItem/index.js";
6
6
  import './NavigationPopup.css';
7
7
  const b = block('navigation-popup');
8
8
  const OFFSET_RESET = { mainAxis: 0, crossAxis: 0 };
9
- export const NavigationPopup = ({ anchorRef, items, onClose, open, }) => (_jsx(Popup
10
- // Workaround to recalculate position on every opening. Required for valid position calculation for scrolled header links.
11
- , {
12
- // Workaround to recalculate position on every opening. Required for valid position calculation for scrolled header links.
13
- anchorRef: open ? anchorRef : undefined, open: open, onClose: onClose, onOutsideClick: onClose, keepMounted: true, disablePortal: true, strategy: "fixed", placement: "bottom-start", offset: OFFSET_RESET, children: _jsx("ul", { className: b('list'), children: items.map((item) => (_jsx(NavigationItem, { className: b('link'), data: item, menuLayout: NavigationLayout.Dropdown }, item.text))) }) }));
9
+ export const NavigationPopup = ({ anchorRef, items, onClose, open, }) => {
10
+ // Opening and closing is controlled by the associated button,
11
+ // but in order to give the popup control over closing as well (e.g. on click outside or escape key press)
12
+ // there needs to be an awkward looking handler like this.
13
+ const onOpenChange = (isOpen) => {
14
+ if (!isOpen) {
15
+ onClose();
16
+ }
17
+ };
18
+ return (_jsx(Popup, { className: b(),
19
+ // Workaround to recalculate position on every opening. Required for valid position calculation for scrolled header links.
20
+ anchorElement: anchorRef.current, open: open, onOpenChange: onOpenChange, keepMounted: true, strategy: "fixed", placement: "bottom-start", offset: OFFSET_RESET, children: _jsx("ul", { className: b('list'), children: items.map((item) => (_jsx(NavigationItem, { className: b('link'), data: item, menuLayout: NavigationLayout.Dropdown }, item.text))) }) }));
21
+ };
14
22
  export default NavigationPopup;
15
23
  //# sourceMappingURL=NavigationPopup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationPopup.js","sourceRoot":"../../../../../src","sources":["navigation/components/NavigationPopup/NavigationPopup.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAC,KAAK,EAAC,gCAAuB;AACrC,OAAO,EAAC,gBAAgB,EAAuB,wBAAqB;AACpE,OAAO,cAAc,mCAA0B;AAE/C,OAAO,uBAAuB,CAAC;AAE/B,MAAM,CAAC,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC;AACpC,MAAM,YAAY,GAA4C,EAAC,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAC,CAAC;AAE1F,MAAM,CAAC,MAAM,eAAe,GAAmC,CAAC,EAC5D,SAAS,EACT,KAAK,EACL,OAAO,EACP,IAAI,GACP,EAAE,EAAE,CAAC,CACF,KAAC,KAAK;AACF,0HAA0H;;IAA1H,0HAA0H;IAC1H,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,EACvC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,OAAO,EACvB,WAAW,QACX,aAAa,QACb,QAAQ,EAAC,OAAO,EAChB,SAAS,EAAC,cAAc,EACxB,MAAM,EAAE,YAAY,YAEpB,aAAI,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YACnB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACjB,KAAC,cAAc,IAEX,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EACpB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,gBAAgB,CAAC,QAAQ,IAHhC,IAAI,CAAC,IAAI,CAIhB,CACL,CAAC,GACD,GACD,CACX,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {Popup} from '@gravity-ui/uikit';\n\nimport {block} from '../../../utils';\nimport {NavigationLayout, NavigationPopupProps} from '../../models';\nimport NavigationItem from '../NavigationItem';\n\nimport './NavigationPopup.scss';\n\nconst b = block('navigation-popup');\nconst OFFSET_RESET: {mainAxis?: number; crossAxis?: number} = {mainAxis: 0, crossAxis: 0};\n\nexport const NavigationPopup: React.FC<NavigationPopupProps> = ({\n anchorRef,\n items,\n onClose,\n open,\n}) => (\n <Popup\n // Workaround to recalculate position on every opening. Required for valid position calculation for scrolled header links.\n anchorRef={open ? anchorRef : undefined}\n open={open}\n onClose={onClose}\n onOutsideClick={onClose}\n keepMounted\n disablePortal\n strategy=\"fixed\"\n placement=\"bottom-start\"\n offset={OFFSET_RESET}\n >\n <ul className={b('list')}>\n {items.map((item) => (\n <NavigationItem\n key={item.text}\n className={b('link')}\n data={item}\n menuLayout={NavigationLayout.Dropdown}\n />\n ))}\n </ul>\n </Popup>\n);\n\nexport default NavigationPopup;\n"]}
1
+ {"version":3,"file":"NavigationPopup.js","sourceRoot":"../../../../../src","sources":["navigation/components/NavigationPopup/NavigationPopup.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAC,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAC,KAAK,EAAC,gCAAuB;AACrC,OAAO,EAAC,gBAAgB,EAAuB,wBAAqB;AACpE,OAAO,cAAc,mCAA0B;AAE/C,OAAO,uBAAuB,CAAC;AAE/B,MAAM,CAAC,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC;AACpC,MAAM,YAAY,GAA4C,EAAC,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAC,CAAC;AAE1F,MAAM,CAAC,MAAM,eAAe,GAAmC,CAAC,EAC5D,SAAS,EACT,KAAK,EACL,OAAO,EACP,IAAI,GACP,EAAE,EAAE;IACD,8DAA8D;IAC9D,0GAA0G;IAC1G,0DAA0D;IAC1D,MAAM,YAAY,GAAG,CAAC,MAAe,EAAE,EAAE;QACrC,IAAI,CAAC,MAAM,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;QACd,CAAC;IACL,CAAC,CAAC;IAEF,OAAO,CACH,KAAC,KAAK,IACF,SAAS,EAAE,CAAC,EAAE;QACd,0HAA0H;QAC1H,aAAa,EAAE,SAAS,CAAC,OAAO,EAChC,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,WAAW,QACX,QAAQ,EAAC,OAAO,EAChB,SAAS,EAAC,cAAc,EACxB,MAAM,EAAE,YAAY,YAEpB,aAAI,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,YACnB,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACjB,KAAC,cAAc,IAEX,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EACpB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,gBAAgB,CAAC,QAAQ,IAHhC,IAAI,CAAC,IAAI,CAIhB,CACL,CAAC,GACD,GACD,CACX,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {Popup} from '@gravity-ui/uikit';\n\nimport {block} from '../../../utils';\nimport {NavigationLayout, NavigationPopupProps} from '../../models';\nimport NavigationItem from '../NavigationItem';\n\nimport './NavigationPopup.scss';\n\nconst b = block('navigation-popup');\nconst OFFSET_RESET: {mainAxis?: number; crossAxis?: number} = {mainAxis: 0, crossAxis: 0};\n\nexport const NavigationPopup: React.FC<NavigationPopupProps> = ({\n anchorRef,\n items,\n onClose,\n open,\n}) => {\n // Opening and closing is controlled by the associated button,\n // but in order to give the popup control over closing as well (e.g. on click outside or escape key press)\n // there needs to be an awkward looking handler like this.\n const onOpenChange = (isOpen: boolean) => {\n if (!isOpen) {\n onClose();\n }\n };\n\n return (\n <Popup\n className={b()}\n // Workaround to recalculate position on every opening. Required for valid position calculation for scrolled header links.\n anchorElement={anchorRef.current}\n open={open}\n onOpenChange={onOpenChange}\n keepMounted\n strategy=\"fixed\"\n placement=\"bottom-start\"\n offset={OFFSET_RESET}\n >\n <ul className={b('list')}>\n {items.map((item) => (\n <NavigationItem\n key={item.text}\n className={b('link')}\n data={item}\n menuLayout={NavigationLayout.Dropdown}\n />\n ))}\n </ul>\n </Popup>\n );\n};\n\nexport default NavigationPopup;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "6.3.0",
3
+ "version": "6.3.1",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",