@gravity-ui/page-constructor 6.0.0-beta.5 → 6.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/blocks/CardLayout/CardLayout.js +1 -1
- package/build/cjs/blocks/CardLayout/CardLayout.js.map +1 -1
- package/build/cjs/blocks/Form/schema.js +1 -1
- package/build/cjs/blocks/Form/schema.js.map +1 -1
- package/build/cjs/blocks/Header/Header.css +6 -0
- package/build/cjs/blocks/Header/Header.js +10 -4
- package/build/cjs/blocks/Header/Header.js.map +1 -1
- package/build/cjs/blocks/Header/schema.d.ts +6 -0
- package/build/cjs/blocks/Header/schema.js +3 -0
- package/build/cjs/blocks/Header/schema.js.map +1 -1
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +3 -0
- package/build/cjs/blocks/HeaderSlider/schema.js +1 -1
- package/build/cjs/blocks/HeaderSlider/schema.js.map +1 -1
- package/build/cjs/blocks/Info/schema.js +1 -1
- package/build/cjs/blocks/Info/schema.js.map +1 -1
- package/build/cjs/blocks/Media/schema.js +1 -1
- package/build/cjs/blocks/Media/schema.js.map +1 -1
- package/build/cjs/blocks/Questions/schema.js +1 -1
- package/build/cjs/blocks/Questions/schema.js.map +1 -1
- package/build/cjs/blocks/Slider/Slider.js +3 -3
- package/build/cjs/blocks/Slider/Slider.js.map +1 -1
- package/build/cjs/blocks/Slider/utils.js +1 -1
- package/build/cjs/blocks/Slider/utils.js.map +1 -1
- package/build/cjs/blocks/SliderNew/utils.js +2 -2
- package/build/cjs/blocks/SliderNew/utils.js.map +1 -1
- package/build/cjs/blocks/Tabs/schema.js +1 -1
- package/build/cjs/blocks/Tabs/schema.js.map +1 -1
- package/build/cjs/components/BalancedMasonry/BalancedMasonry.js +3 -3
- package/build/cjs/components/BalancedMasonry/BalancedMasonry.js.map +1 -1
- package/build/cjs/components/FullWidthBackground/FullWidthBackground.js +1 -1
- package/build/cjs/components/FullWidthBackground/FullWidthBackground.js.map +1 -1
- package/build/cjs/components/ImageBase/ImageBase.js +1 -1
- package/build/cjs/components/ImageBase/ImageBase.js.map +1 -1
- package/build/cjs/components/Map/GoogleMap.js +1 -1
- package/build/cjs/components/Map/GoogleMap.js.map +1 -1
- package/build/cjs/components/Map/YMap/YandexMap.js +1 -1
- package/build/cjs/components/Map/YMap/YandexMap.js.map +1 -1
- package/build/cjs/components/Media/Image/Image.js +1 -1
- package/build/cjs/components/Media/Image/Image.js.map +1 -1
- package/build/cjs/components/OutsideClick/OutsideClick.js +1 -1
- package/build/cjs/components/OutsideClick/OutsideClick.js.map +1 -1
- package/build/cjs/components/OverflowScroller/OverflowScroller.js +1 -1
- package/build/cjs/components/OverflowScroller/OverflowScroller.js.map +1 -1
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +1 -1
- package/build/cjs/components/ReactPlayer/ReactPlayer.js.map +1 -1
- package/build/cjs/components/VideoBlock/VideoBlock.js +1 -1
- package/build/cjs/components/VideoBlock/VideoBlock.js.map +1 -1
- package/build/cjs/containers/PageConstructor/PageConstructor.css +1 -0
- package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +1 -1
- package/build/cjs/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js.map +1 -1
- package/build/cjs/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +1 -1
- package/build/cjs/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js.map +1 -1
- package/build/cjs/editor/components/BlockForm/BlockForm.js +2 -2
- package/build/cjs/editor/components/BlockForm/BlockForm.js.map +1 -1
- package/build/cjs/editor/components/CodeEditor/CodeEditor.js +1 -1
- package/build/cjs/editor/components/CodeEditor/CodeEditor.js.map +1 -1
- package/build/cjs/editor/components/PageSettings/PageSettings.js +1 -1
- package/build/cjs/editor/components/PageSettings/PageSettings.js.map +1 -1
- package/build/cjs/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.js +1 -1
- package/build/cjs/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.js.map +1 -1
- package/build/cjs/editor/dynamic-forms-custom/config.js +1 -1
- package/build/cjs/editor/dynamic-forms-custom/config.js.map +1 -1
- package/build/cjs/editor/dynamic-forms-custom/hooks/useOneOf.js +2 -2
- package/build/cjs/editor/dynamic-forms-custom/hooks/useOneOf.js.map +1 -1
- package/build/cjs/editor/store/main/utils.js +1 -1
- package/build/cjs/editor/store/main/utils.js.map +1 -1
- package/build/cjs/editor/utils/index.js +1 -1
- package/build/cjs/editor/utils/index.js.map +1 -1
- package/build/cjs/editor/utils/validation.js +1 -1
- package/build/cjs/editor/utils/validation.js.map +1 -1
- package/build/cjs/hooks/useFocus.js +1 -1
- package/build/cjs/hooks/useFocus.js.map +1 -1
- package/build/cjs/hooks/useHeightCalculator.js +1 -1
- package/build/cjs/hooks/useHeightCalculator.js.map +1 -1
- package/build/cjs/hooks/useWindowBreakpoint.js +1 -1
- package/build/cjs/hooks/useWindowBreakpoint.js.map +1 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +1 -0
- package/build/cjs/models/constructor-items/blocks.js.map +1 -1
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js +1 -1
- package/build/cjs/navigation/components/NavigationItem/NavigationItem.js.map +1 -1
- package/build/cjs/navigation/components/NavigationItem/hooks/useNavigationItemMap.js +1 -1
- package/build/cjs/navigation/components/NavigationItem/hooks/useNavigationItemMap.js.map +1 -1
- package/build/cjs/navigation/hooks/useShowBorder.js +1 -1
- package/build/cjs/navigation/hooks/useShowBorder.js.map +1 -1
- package/build/cjs/navigation/schema.js +1 -1
- package/build/cjs/navigation/schema.js.map +1 -1
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +1 -1
- package/build/cjs/sub-blocks/BackgroundCard/schema.js.map +1 -1
- package/build/cjs/sub-blocks/BasicCard/schema.js +1 -1
- package/build/cjs/sub-blocks/BasicCard/schema.js.map +1 -1
- package/build/cjs/sub-blocks/ImageCard/schema.js +1 -1
- package/build/cjs/sub-blocks/ImageCard/schema.js.map +1 -1
- package/build/cjs/sub-blocks/LayoutItem/schema.js +1 -1
- package/build/cjs/sub-blocks/LayoutItem/schema.js.map +1 -1
- package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js +1 -1
- package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js.map +1 -1
- package/build/cjs/text-transform/transformers.js +2 -2
- package/build/cjs/text-transform/transformers.js.map +1 -1
- package/build/cjs/utils/blocks.js +2 -2
- package/build/cjs/utils/blocks.js.map +1 -1
- package/build/esm/blocks/CardLayout/CardLayout.js +1 -1
- package/build/esm/blocks/CardLayout/CardLayout.js.map +1 -1
- package/build/esm/blocks/Form/schema.js +1 -1
- package/build/esm/blocks/Form/schema.js.map +1 -1
- package/build/esm/blocks/Header/Header.css +6 -0
- package/build/esm/blocks/Header/Header.js +10 -4
- package/build/esm/blocks/Header/Header.js.map +1 -1
- package/build/esm/blocks/Header/schema.d.ts +6 -0
- package/build/esm/blocks/Header/schema.js +3 -0
- package/build/esm/blocks/Header/schema.js.map +1 -1
- package/build/esm/blocks/HeaderSlider/schema.d.ts +3 -0
- package/build/esm/blocks/HeaderSlider/schema.js +1 -1
- package/build/esm/blocks/HeaderSlider/schema.js.map +1 -1
- package/build/esm/blocks/Info/schema.js +1 -1
- package/build/esm/blocks/Info/schema.js.map +1 -1
- package/build/esm/blocks/Media/schema.js +1 -1
- package/build/esm/blocks/Media/schema.js.map +1 -1
- package/build/esm/blocks/Questions/schema.js +1 -1
- package/build/esm/blocks/Questions/schema.js.map +1 -1
- package/build/esm/blocks/Slider/Slider.js +3 -3
- package/build/esm/blocks/Slider/Slider.js.map +1 -1
- package/build/esm/blocks/Slider/utils.js +1 -1
- package/build/esm/blocks/Slider/utils.js.map +1 -1
- package/build/esm/blocks/SliderNew/utils.js +2 -2
- package/build/esm/blocks/SliderNew/utils.js.map +1 -1
- package/build/esm/blocks/Tabs/schema.js +1 -1
- package/build/esm/blocks/Tabs/schema.js.map +1 -1
- package/build/esm/components/BalancedMasonry/BalancedMasonry.js +3 -3
- package/build/esm/components/BalancedMasonry/BalancedMasonry.js.map +1 -1
- package/build/esm/components/FullWidthBackground/FullWidthBackground.js +1 -1
- package/build/esm/components/FullWidthBackground/FullWidthBackground.js.map +1 -1
- package/build/esm/components/ImageBase/ImageBase.js +1 -1
- package/build/esm/components/ImageBase/ImageBase.js.map +1 -1
- package/build/esm/components/Map/GoogleMap.js +1 -1
- package/build/esm/components/Map/GoogleMap.js.map +1 -1
- package/build/esm/components/Map/YMap/YandexMap.js +1 -1
- package/build/esm/components/Map/YMap/YandexMap.js.map +1 -1
- package/build/esm/components/Media/Image/Image.js +1 -1
- package/build/esm/components/Media/Image/Image.js.map +1 -1
- package/build/esm/components/OutsideClick/OutsideClick.js +1 -1
- package/build/esm/components/OutsideClick/OutsideClick.js.map +1 -1
- package/build/esm/components/OverflowScroller/OverflowScroller.js +1 -1
- package/build/esm/components/OverflowScroller/OverflowScroller.js.map +1 -1
- package/build/esm/components/ReactPlayer/ReactPlayer.js +1 -1
- package/build/esm/components/ReactPlayer/ReactPlayer.js.map +1 -1
- package/build/esm/components/VideoBlock/VideoBlock.js +1 -1
- package/build/esm/components/VideoBlock/VideoBlock.js.map +1 -1
- package/build/esm/containers/PageConstructor/PageConstructor.css +1 -0
- package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js +1 -1
- package/build/esm/containers/PageConstructor/components/ConstructorBlock/ConstructorBlock.js.map +1 -1
- package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js +1 -1
- package/build/esm/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.js.map +1 -1
- package/build/esm/editor/components/BlockForm/BlockForm.js +2 -2
- package/build/esm/editor/components/BlockForm/BlockForm.js.map +1 -1
- package/build/esm/editor/components/CodeEditor/CodeEditor.js +1 -1
- package/build/esm/editor/components/CodeEditor/CodeEditor.js.map +1 -1
- package/build/esm/editor/components/PageSettings/PageSettings.js +1 -1
- package/build/esm/editor/components/PageSettings/PageSettings.js.map +1 -1
- package/build/esm/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.js +1 -1
- package/build/esm/editor/dynamic-forms-custom/components/OneOfCustom/OneOfCustom.js.map +1 -1
- package/build/esm/editor/dynamic-forms-custom/config.js +1 -1
- package/build/esm/editor/dynamic-forms-custom/config.js.map +1 -1
- package/build/esm/editor/dynamic-forms-custom/hooks/useOneOf.js +2 -2
- package/build/esm/editor/dynamic-forms-custom/hooks/useOneOf.js.map +1 -1
- package/build/esm/editor/store/main/utils.js +1 -1
- package/build/esm/editor/store/main/utils.js.map +1 -1
- package/build/esm/editor/utils/index.js +1 -1
- package/build/esm/editor/utils/index.js.map +1 -1
- package/build/esm/editor/utils/validation.js +1 -1
- package/build/esm/editor/utils/validation.js.map +1 -1
- package/build/esm/hooks/useFocus.js +1 -1
- package/build/esm/hooks/useFocus.js.map +1 -1
- package/build/esm/hooks/useHeightCalculator.js +1 -1
- package/build/esm/hooks/useHeightCalculator.js.map +1 -1
- package/build/esm/hooks/useWindowBreakpoint.js +1 -1
- package/build/esm/hooks/useWindowBreakpoint.js.map +1 -1
- package/build/esm/models/constructor-items/blocks.d.ts +1 -0
- package/build/esm/models/constructor-items/blocks.js.map +1 -1
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js +1 -1
- package/build/esm/navigation/components/NavigationItem/NavigationItem.js.map +1 -1
- package/build/esm/navigation/components/NavigationItem/hooks/useNavigationItemMap.js +1 -1
- package/build/esm/navigation/components/NavigationItem/hooks/useNavigationItemMap.js.map +1 -1
- package/build/esm/navigation/hooks/useShowBorder.js +1 -1
- package/build/esm/navigation/hooks/useShowBorder.js.map +1 -1
- package/build/esm/navigation/schema.js +1 -1
- package/build/esm/navigation/schema.js.map +1 -1
- package/build/esm/sub-blocks/BackgroundCard/schema.js +1 -1
- package/build/esm/sub-blocks/BackgroundCard/schema.js.map +1 -1
- package/build/esm/sub-blocks/BasicCard/schema.js +1 -1
- package/build/esm/sub-blocks/BasicCard/schema.js.map +1 -1
- package/build/esm/sub-blocks/ImageCard/schema.js +1 -1
- package/build/esm/sub-blocks/ImageCard/schema.js.map +1 -1
- package/build/esm/sub-blocks/LayoutItem/schema.js +1 -1
- package/build/esm/sub-blocks/LayoutItem/schema.js.map +1 -1
- package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js +1 -1
- package/build/esm/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js.map +1 -1
- package/build/esm/text-transform/transformers.js +2 -2
- package/build/esm/text-transform/transformers.js.map +1 -1
- package/build/esm/utils/blocks.js +2 -2
- package/build/esm/utils/blocks.js.map +1 -1
- package/package.json +6 -6
- package/schema/index.js +1 -1
- package/server/models/constructor-items/blocks.d.ts +1 -0
- package/styles/root.scss +1 -0
- package/widget/2957.index.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"../../../../src","sources":["editor/utils/validation.ts"],"names":[],"mappings":";;;AAmBA,0CAOC;AAED,4BAuCC;;AAnED,sDAAuD;AACvD,wEAAuC;AACvC,8DAA2B;AAC3B,oFAA2C;AAE3C,
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"../../../../src","sources":["editor/utils/validation.ts"],"names":[],"mappings":";;;AAmBA,0CAOC;AAED,4BAuCC;;AAnED,sDAAuD;AACvD,wEAAuC;AACvC,8DAA2B;AAC3B,oFAA2C;AAE3C,wEAAqC;AAErC,MAAM,eAAe,GAAG,OAAO,CAAC;AAMhC,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IAC/B,8CAAmB,CAAA;IACnB,8CAAmB,CAAA;IACnB,0CAAe,CAAA;AACnB,CAAC,EAJW,uBAAuB,uCAAvB,uBAAuB,QAIlC;AAED,SAAgB,eAAe,CAAC,MAAmB;IAC/C,MAAM,GAAG,GAAG,IAAI,aAAG,CAAC,EAAC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AAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;oBAC1C,CAAC;oBACD,OAAO,GAAG,GAAG,KAAK,KAAK,EAAE,CAAC;gBAC9B,CAAC,CAAC,CAAC;gBACH,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC/C,OAAO,GAAG,GAAG,GAAG,YAAY,IAAI,UAAU,KAAK,OAAO,KAAK,YAAY,CAAC,IAAI,CACxE,IAAI,CACP,EAAE,CAAC;YACR,CAAC,CACJ,CAAC;YACF,MAAM,GAAG,EAAC,MAAM,EAAE,uBAAuB,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAC,CAAC;QACpF,CAAC;aAAM,CAAC;YACJ,MAAM,GAAG,EAAC,MAAM,EAAE,uBAAuB,CAAC,OAAO,EAAE,IAAI,EAAE,eAAe,EAAC,CAAC;QAC9E,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACT,MAAM,EAAC,OAAO,EAAC,GAAG,CAAsB,CAAC;QACzC,MAAM,GAAG,EAAC,MAAM,EAAE,uBAAuB,CAAC,KAAK,EAAE,IAAI,EAAE,OAAiB,EAAC,CAAC;IAC9E,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import Ajv, {ErrorObject, ValidateFunction} from 'ajv';\nimport ajvKeywords from 'ajv-keywords';\nimport yaml from 'js-yaml';\nimport SourceMap from 'js-yaml-source-map';\nimport {JSONSchema4} from 'json-schema';\nimport isArray from 'lodash/isArray';\n\nconst SUCCESS_MESSAGE = 'Valid';\nexport interface CodeEditorMessageProps {\n text: string;\n status: CodeEditorMessageStatus;\n}\n\nexport enum CodeEditorMessageStatus {\n SUCCESS = 'success',\n WARNING = 'warning',\n ERROR = 'error',\n}\n\nexport function createValidator(schema: JSONSchema4) {\n const ajv = new Ajv({$data: true, allErrors: true, schemas: [schema], strict: false});\n // TODO: select is deprecated, replace with discriminator:\n // https://github.com/ajv-validator/ajv-keywords#selectselectcasesselectdefault\n ajvKeywords(ajv, 'select');\n\n return ajv.compile(schema);\n}\n\nexport function validate(content: string, validator: ValidateFunction) {\n let result: CodeEditorMessageProps;\n\n if (!content) {\n return {status: CodeEditorMessageStatus.SUCCESS, text: SUCCESS_MESSAGE};\n }\n\n try {\n const jsYamlMap = new SourceMap();\n const data = yaml.load(content, {listener: jsYamlMap.listen()});\n\n validator(data);\n\n if (validator.errors) {\n const messages = validator.errors.map(\n ({instancePath, schemaPath, message, params}: ErrorObject) => {\n const pointer = jsYamlMap.lookup(instancePath.split('/').filter(Boolean));\n const stringParams = Object.entries(params).map(([key, value]) => {\n if (isArray(value)) {\n return `${key}: ${value.join(' | ')}`;\n }\n return `${key}: ${value}`;\n });\n const ref = pointer ? `${pointer.line}: ` : '';\n return `${ref}${instancePath || schemaPath}: ${message}\\n${stringParams.join(\n '\\n',\n )}`;\n },\n );\n result = {status: CodeEditorMessageStatus.WARNING, text: messages.join('\\n\\n')};\n } else {\n result = {status: CodeEditorMessageStatus.SUCCESS, text: SUCCESS_MESSAGE};\n }\n } catch (e) {\n const {message} = e as {message: string};\n result = {status: CodeEditorMessageStatus.ERROR, text: message as string};\n }\n\n return result;\n}\n"]}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = useFocus;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const noop_1 = tslib_1.__importDefault(require("lodash/noop"));
|
|
6
|
+
const noop_1 = tslib_1.__importDefault(require("lodash/noop.js"));
|
|
7
7
|
const mobileContext_1 = require("../context/mobileContext/index.js");
|
|
8
8
|
function useFocus(element) {
|
|
9
9
|
const isMobile = React.useContext(mobileContext_1.MobileContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFocus.js","sourceRoot":"../../../src","sources":["hooks/useFocus.ts"],"names":[],"mappings":";;AAMA,2BAkCC;;AAxCD,qDAA+B;AAE/B
|
|
1
|
+
{"version":3,"file":"useFocus.js","sourceRoot":"../../../src","sources":["hooks/useFocus.ts"],"names":[],"mappings":";;AAMA,2BAkCC;;AAxCD,qDAA+B;AAE/B,kEAA+B;AAE/B,qEAAuD;AAEvD,SAAwB,QAAQ,CAAC,OAAqB;IAClD,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CAAC,6BAAa,CAAC,CAAC;IAEjD,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IAChE,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IAEnE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,IAAI,OAAO,EAAE,CAAC;YACV,IAAI,QAAQ,EAAE,CAAC;gBACX,OAAO,CAAC,gBAAgB,CAAC,aAAa,EAAE,QAAQ,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;YACvE,CAAC;iBAAM,CAAC;gBACJ,OAAO,CAAC,gBAAgB,CAAC,YAAY,EAAE,QAAQ,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;gBAClE,OAAO,CAAC,gBAAgB,CAAC,YAAY,EAAE,UAAU,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;YACxE,CAAC;YAED,OAAO,GAAG,EAAE;gBACR,IAAI,QAAQ,EAAE,CAAC;oBACX,OAAO,CAAC,mBAAmB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;gBACzD,CAAC;qBAAM,CAAC;oBACJ,OAAO,CAAC,mBAAmB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;oBACpD,OAAO,CAAC,mBAAmB,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;gBAC1D,CAAC;YACL,CAAC,CAAC;QACN,CAAC;QAED,OAAO,cAAI,CAAC;IAChB,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;IAE9C,OAAO;QACH,QAAQ;QACR,QAAQ;QACR,UAAU;KACb,CAAC;AACN,CAAC","sourcesContent":["import * as React from 'react';\n\nimport noop from 'lodash/noop';\n\nimport {MobileContext} from '../context/mobileContext';\n\nexport default function useFocus(element?: HTMLElement) {\n const isMobile = React.useContext(MobileContext);\n\n const [hasFocus, setHasFocus] = React.useState(false);\n const setFocus = React.useCallback(() => setHasFocus(true), []);\n const unsetFocus = React.useCallback(() => setHasFocus(false), []);\n\n React.useEffect(() => {\n if (element) {\n if (isMobile) {\n element.addEventListener('pointerdown', setFocus, {passive: true});\n } else {\n element.addEventListener('mouseenter', setFocus, {passive: true});\n element.addEventListener('mouseleave', unsetFocus, {passive: true});\n }\n\n return () => {\n if (isMobile) {\n element.removeEventListener('pointerdown', setFocus);\n } else {\n element.removeEventListener('mouseenter', setFocus);\n element.removeEventListener('mouseleave', unsetFocus);\n }\n };\n }\n\n return noop;\n }, [element, isMobile, setFocus, unsetFocus]);\n\n return {\n hasFocus,\n setFocus,\n unsetFocus,\n };\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const React = tslib_1.__importStar(require("react"));
|
|
5
|
-
const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
|
|
5
|
+
const debounce_1 = tslib_1.__importDefault(require("lodash/debounce.js"));
|
|
6
6
|
const DEFAULT_RECALCULATE_ON_RESIZE_DELAY = 1000;
|
|
7
7
|
const DEFAULT_OPTIONS = {
|
|
8
8
|
recalculateOnResizeDelay: DEFAULT_RECALCULATE_ON_RESIZE_DELAY,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHeightCalculator.js","sourceRoot":"../../../src","sources":["hooks/useHeightCalculator.ts"],"names":[],"mappings":";;;AAAA,qDAA+B;AAE/B,
|
|
1
|
+
{"version":3,"file":"useHeightCalculator.js","sourceRoot":"../../../src","sources":["hooks/useHeightCalculator.ts"],"names":[],"mappings":";;;AAAA,qDAA+B;AAE/B,0EAAuC;AAMvC,MAAM,mCAAmC,GAAG,IAAI,CAAC;AACjD,MAAM,eAAe,GAAG;IACpB,wBAAwB,EAAE,mCAAmC;CAChE,CAAC;AAEF,MAAM,mBAAmB,GAGC,CAAC,YAAY,EAAE,OAAO,GAAG,eAAe,EAAE,EAAE;IAClE,MAAM,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAClE,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAqB,SAAS,CAAC,CAAC;IAE5F,MAAM,wBAAwB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE;QACpD,IAAI,YAAY,CAAC,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,YAAY,KAAK,eAAe;YAC7E,kBAAkB,CAAC,YAAY,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC,EAAE,CAAC,YAAY,EAAE,eAAe,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAExD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,MAAM,YAAY,GAAG,IAAA,kBAAQ,EAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC;QAElF,YAAY,EAAE,CAAC;QAEf,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;QACjE,OAAO,GAAG,EAAE;YACR,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;QACvD,CAAC,CAAC;IACN,CAAC,EAAE,CAAC,wBAAwB,EAAE,wBAAwB,CAAC,CAAC,CAAC;IAEzD,OAAO,eAAe,CAAC;AAC3B,CAAC,CAAC;AAEF,kBAAe,mBAAmB,CAAC","sourcesContent":["import * as React from 'react';\n\nimport debounce from 'lodash/debounce';\n\ntype HeightCalculatorOptions = {\n recalculateOnResizeDelay: number;\n};\n\nconst DEFAULT_RECALCULATE_ON_RESIZE_DELAY = 1000;\nconst DEFAULT_OPTIONS = {\n recalculateOnResizeDelay: DEFAULT_RECALCULATE_ON_RESIZE_DELAY,\n};\n\nconst useHeightCalculator: (\n containerRef: React.RefObject<HTMLElement>,\n options?: HeightCalculatorOptions,\n) => number | undefined = (containerRef, options = DEFAULT_OPTIONS) => {\n const recalculateOnResizeDelay = options.recalculateOnResizeDelay;\n const [containerHeight, setContainerHeight] = React.useState<number | undefined>(undefined);\n\n const calculateContainerHeight = React.useCallback(() => {\n if (containerRef.current && containerRef.current.offsetHeight !== containerHeight)\n setContainerHeight(containerRef.current.offsetHeight);\n }, [containerRef, containerHeight, setContainerHeight]);\n\n React.useEffect(() => {\n const handleResize = debounce(calculateContainerHeight, recalculateOnResizeDelay);\n\n handleResize();\n\n window.addEventListener('resize', handleResize, {passive: true});\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, [calculateContainerHeight, recalculateOnResizeDelay]);\n\n return containerHeight;\n};\n\nexport default useHeightCalculator;\n"]}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = useWindowBreakpoint;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
|
|
6
|
+
const debounce_1 = tslib_1.__importDefault(require("lodash/debounce.js"));
|
|
7
7
|
const constants_1 = require("../constants.js");
|
|
8
8
|
function calculate(windowWidth) {
|
|
9
9
|
const breakpointsSorted = Object.values(constants_1.BREAKPOINTS).sort((b1, b2) => b1 - b2);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWindowBreakpoint.js","sourceRoot":"../../../src","sources":["hooks/useWindowBreakpoint.ts"],"names":[],"mappings":";;AAsBA,sCAkBC;;AAxCD,qDAA+B;AAE/B,
|
|
1
|
+
{"version":3,"file":"useWindowBreakpoint.js","sourceRoot":"../../../src","sources":["hooks/useWindowBreakpoint.ts"],"names":[],"mappings":";;AAsBA,sCAkBC;;AAxCD,qDAA+B;AAE/B,0EAAuC;AAEvC,+CAAyC;AAEzC,SAAS,SAAS,CAAC,WAAmB;IAClC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,uBAAW,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IAE/E,IAAI,MAAM,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAElC,KAAK,MAAM,UAAU,IAAI,iBAAiB,EAAE,CAAC;QACzC,IAAI,WAAW,IAAI,UAAU,EAAE,CAAC;YAC5B,MAAM,GAAG,UAAU,CAAC;QACxB,CAAC;aAAM,CAAC;YACJ,OAAO,MAAM,CAAC;QAClB,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC;AAED,SAAwB,mBAAmB;IACvC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,uBAAW,CAAC,EAAE,CAAC,CAAC;IAEnE,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;QAE5C,MAAM,MAAM,GAAG,IAAA,kBAAQ,EAAC,GAAG,EAAE;YACzB,aAAa,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;QAChD,CAAC,EAAE,GAAG,CAAC,CAAC;QAER,MAAM,EAAE,CAAC;QAET,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;QAE3D,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,UAAU,CAAC;AACtB,CAAC","sourcesContent":["import * as React from 'react';\n\nimport debounce from 'lodash/debounce';\n\nimport {BREAKPOINTS} from '../constants';\n\nfunction calculate(windowWidth: number) {\n const breakpointsSorted = Object.values(BREAKPOINTS).sort((b1, b2) => b1 - b2);\n\n let result = breakpointsSorted[0];\n\n for (const breakpoint of breakpointsSorted) {\n if (windowWidth >= breakpoint) {\n result = breakpoint;\n } else {\n return result;\n }\n }\n\n return result;\n}\n\nexport default function useWindowBreakpoint() {\n const [breakpoint, setBreakpoint] = React.useState(BREAKPOINTS.sm);\n\n React.useEffect(() => {\n setBreakpoint(calculate(window.innerWidth));\n\n const detect = debounce(() => {\n setBreakpoint(calculate(window.innerWidth));\n }, 100);\n\n detect();\n\n window.addEventListener('resize', detect, {passive: true});\n\n return () => window.removeEventListener('resize', detect);\n }, []);\n\n return breakpoint;\n}\n"]}
|
|
@@ -123,6 +123,7 @@ export interface HeaderBlockProps {
|
|
|
123
123
|
image?: ThemedImage;
|
|
124
124
|
video?: ThemedMediaVideoProps;
|
|
125
125
|
mediaView?: MediaView;
|
|
126
|
+
centered?: boolean;
|
|
126
127
|
background?: ThemedHeaderBlockBackground;
|
|
127
128
|
theme?: 'light' | 'dark';
|
|
128
129
|
verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.js","sourceRo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AkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,kDAA4B,CAAA;IAC5B,kDAA4B,CAAA;IAC5B,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B","sourcesContent":["import * as React from 'react';\n\nimport {ButtonSize} from '@gravity-ui/uikit';\n\nimport {GridColumnSize, GridColumnSizesType, IndentValue} from '../../grid/types';\nimport {ThemeSupporting} from '../../utils';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {\n AnchorProps,\n Animatable,\n BackgroundImageProps,\n ButtonProps,\n CardBorder,\n ContentSize,\n ContentTextSize,\n ContentTheme,\n FileLinkProps,\n HeaderBreadCrumbsProps,\n HeaderImageSize,\n HeaderOffset,\n HeaderWidth,\n ImageDeviceProps,\n ImageProps,\n Justify,\n LegendTableMarkerType,\n LinkProps,\n MapProps,\n MediaDirection,\n MediaProps,\n MediaView,\n TextSize,\n TextTheme,\n ThemedImage,\n ThemedMediaProps,\n ThemedMediaVideoProps,\n TitleItemBaseProps,\n TitleItemProps,\n WithBorder,\n YandexFormProps,\n} from './common';\nimport {BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels} from './sub-blocks';\n\nexport enum BlockType {\n PromoFeaturesBlock = 'promo-features-block',\n ExtendedFeaturesBlock = 'extended-features-block',\n SliderBlock = 'slider-block',\n QuestionsBlock = 'questions-block',\n BannerBlock = 'banner-block',\n CompaniesBlock = 'companies-block',\n MediaBlock = 'media-block',\n InfoBlock = 'info-block',\n TableBlock = 'table-block',\n TabsBlock = 'tabs-block',\n HeaderSliderBlock = 'header-slider-block',\n HeaderBlock = 'header-block',\n IconsBlock = 'icons-block',\n CardLayoutBlock = 'card-layout-block',\n ContentLayoutBlock = 'content-layout-block',\n ShareBlock = 'share-block',\n MapBlock = 'map-block',\n FilterBlock = 'filter-block',\n FormBlock = 'form-block',\n // unstable\n SliderNewBlock = 'slider-new-block',\n}\n\nexport const BlockTypes = Object.values(BlockType);\nexport const HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];\n\nexport interface Childable {\n children?: SubBlock[];\n}\n\n//block props\nexport interface BlockBaseProps {\n anchor?: AnchorProps;\n visible?: GridColumnSize;\n /** @deprecated */\n resetPaddings?: boolean;\n indent?: {\n top?: IndentValue;\n bottom?: IndentValue;\n };\n qa?: string;\n}\n\nexport interface LoadableProps {\n source: string;\n /**\n * @deprecated Will be moved to params\n */\n serviceId?: number;\n params?: Record<string, string | number | boolean | object>;\n}\n\nexport interface LoadableChildren {\n loadable?: LoadableProps;\n}\n\nexport enum SliderBreakpointNames {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n Xl = 'xl',\n}\n\nexport enum SliderType {\n MediaCard = 'media-card',\n HeaderCard = 'header-card',\n}\n\nexport type SliderBreakpointParams = Record<SliderBreakpointNames, number>;\nexport type SlidesToShow = Partial<SliderBreakpointParams> | number;\n\nexport interface SliderProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface SliderNewProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n}\n\nexport interface HeaderSliderBlockProps extends Omit<SliderProps, 'title' | 'description'> {\n items: HeaderBlockProps[];\n}\n\ninterface HeaderBackgroundProps {\n /** @deprecated replaced by Media Props image */\n url?: string;\n /** @deprecated replaced by Media Props image */\n disableCompress?: boolean;\n}\n\nexport interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, Partial<MediaProps> {\n fullWidth?: boolean;\n fullWidthMedia?: boolean;\n}\n\nexport type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;\n\nexport interface HeaderBlockProps {\n title: string;\n overtitle?: string | JSX.Element;\n description?: string;\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];\n width?: HeaderWidth;\n /** @deprecated imageSize now depends on width */\n imageSize?: HeaderImageSize;\n /**\n * @deprecated used only on the main page\n * TODO: delete after the possibility to remove padding-bottom in the block\n */\n offset?: HeaderOffset;\n image?: ThemedImage;\n video?: ThemedMediaVideoProps;\n mediaView?: MediaView;\n background?: ThemedHeaderBlockBackground;\n theme?: 'light' | 'dark';\n verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';\n breadcrumbs?: HeaderBreadCrumbsProps;\n status?: JSX.Element;\n renderTitle?: (title: string) => React.ReactNode;\n}\n\nexport interface ExtendedFeaturesItem\n extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {\n title: string;\n label?: string;\n icon?: ThemedImage;\n /** @deprecated **/\n link?: LinkProps;\n}\n\nexport interface ExtendedFeaturesProps extends Animatable {\n items: ExtendedFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n colSizes?: GridColumnSizesType;\n}\n\nexport interface PromoFeaturesItem {\n title: string;\n text: string;\n theme?: 'accent' | 'accent-light' | 'primary';\n media?: ThemeSupporting<MediaProps>;\n}\n\nexport interface PromoFeaturesProps extends Animatable {\n items: PromoFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n theme?: 'grey' | 'default';\n}\n\nexport interface QuestionItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface QuestionsProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: QuestionItem[];\n}\n\nexport interface QuestionBlockItemProps extends QuestionItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface BannerBlockProps extends BannerCardProps, Animatable {}\n\nexport interface CompaniesBlockProps extends Animatable {\n title: string;\n description?: string;\n images: ThemeSupporting<ImageDeviceProps>;\n}\n\nexport interface MediaBaseBlockProps extends Animatable, MediaContentProps {\n direction?: MediaDirection;\n mobileDirection?: MediaDirection;\n largeMedia?: boolean;\n mediaOnly?: boolean;\n mediaOnlyColSizes?: GridColumnSizesType;\n}\n\nexport interface MediaContentProps\n extends Omit<ContentBlockProps, 'colSizes' | 'text' | 'title' | 'theme' | 'centered'> {\n title: string;\n description?: string;\n /** @deprecated Use array of buttons from ContentBlockProps instead**/\n button?: ButtonProps;\n}\n\nexport interface MediaBlockProps extends MediaBaseBlockProps, WithBorder {\n media: ThemeSupporting<MediaProps>;\n}\n\nexport interface MapBlockProps extends MediaBaseBlockProps, WithBorder {\n map: MapProps;\n}\n\nexport interface InfoBlockProps {\n theme?: TextTheme;\n backgroundColor?: ThemeSupporting<string>;\n /** @deprecated **/\n title?: string;\n /** @deprecated **/\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme'>[];\n /** @deprecated **/\n sectionsTitle?: string;\n /** @deprecated **/\n links?: Pick<LinkProps, 'text' | 'url'>[];\n leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n}\n\nexport interface TableProps {\n content: string[][];\n legend?: string[];\n hideLegend?: boolean;\n justify?: Justify[];\n marker?: LegendTableMarkerType;\n /**\n * Only as accessible name, not displayed explicitly\n */\n caption?: string;\n}\n\nexport interface TableBlockProps {\n title: string;\n table: TableProps;\n}\n\nexport interface TabsBlockItem\n extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'>,\n WithBorder {\n tabName: string;\n /**\n * @deprecated Use array links from ContentBlockProps instead\n */\n link?: LinkProps;\n image?: ThemedImage;\n caption?: string;\n media?: ThemedMediaProps;\n}\n\nexport interface TabsBlockProps extends Animatable {\n title?: TitleItemProps | string;\n description?: string;\n tabsColSizes?: GridColumnSizesType;\n centered?: boolean;\n direction?: MediaDirection;\n items: TabsBlockItem[];\n contentSize?: ContentSize;\n}\n\nexport interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n titleClassName?: string;\n description?: string;\n colSizes?: GridColumnSizesType;\n background?: ThemeSupporting<\n BackgroundImageProps & {\n border?: CardBorder;\n }\n >;\n}\n\nexport type FilterTag = {\n id: string;\n label: string;\n};\n\nexport type FilterItem = {\n tags: string[];\n card: SubBlockModels;\n};\n\nexport interface FilterBlockProps extends Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n description?: string;\n tags: FilterTag[];\n items: FilterItem[];\n tagButtonSize?: ButtonSize;\n allTag?: boolean | string;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n}\n\nexport interface IconsBlockItemProps extends AnalyticsEventsBase {\n url: string;\n text: string;\n src: ThemeSupporting<string>;\n}\n\nexport interface IconsBlockProps {\n title?: string;\n description?: string;\n size?: 's' | 'm' | 'l';\n items: IconsBlockItemProps[];\n colSizes?: GridColumnSizesType;\n}\n\ninterface ContentLayoutBlockParams {\n size?: ContentSize;\n background?: ThemeSupporting<BackgroundImageProps>;\n centered?: boolean;\n theme?: ContentTheme;\n textWidth?: ContentTextSize;\n}\n\nexport interface ContentLayoutBlockProps extends ContentLayoutBlockParams {\n textContent: ContentBlockProps;\n fileContent?: FileLinkProps[];\n}\n\nexport type SVGIcon = React.FC<React.SVGProps<SVGSVGElement>>;\n\nexport interface ContentItemProps {\n title?: string;\n text?: string;\n icon: ThemeSupporting<ImageProps | SVGIcon>;\n}\n\nexport interface ContentListProps {\n list: ContentItemProps[];\n size: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentBlockProps {\n title?: TitleItemBaseProps | string;\n titleId?: string;\n text?: string;\n textId?: string;\n additionalInfo?: string;\n links?: LinkProps[];\n buttons?: ButtonProps[];\n size?: ContentSize;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n theme?: ContentTheme;\n list?: ContentItemProps[];\n controlPosition?: 'default' | 'bottom';\n}\n\nexport enum PCShareSocialNetwork {\n Vk = 'vk',\n Telegram = 'telegram',\n Twitter = 'twitter',\n Facebook = 'facebook',\n LinkedIn = 'linkedin',\n}\n\nexport interface ShareBlockProps {\n items: PCShareSocialNetwork[];\n title?: string;\n}\n\nexport enum FormBlockDataTypes {\n YANDEX = 'yandex',\n HUBSPOT = 'hubspot',\n}\n\nexport enum FormBlockDirection {\n FormContent = 'form-content',\n ContentForm = 'content-form',\n Center = 'center',\n}\n\nexport interface FormBlockYandexData {\n yandex: ThemeSupporting<YandexFormProps>;\n}\n\nexport interface FormBlockHubspotData {\n hubspot: ThemeSupporting<HubspotFormProps>;\n}\n\nexport type FormBlockData = FormBlockYandexData | FormBlockHubspotData;\n\nexport interface FormBlockProps {\n formData: FormBlockData;\n title?: string;\n textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;\n direction?: FormBlockDirection;\n background?: ThemeSupporting<BackgroundImageProps>;\n}\n\n//block models\nexport type HeaderBlockModel = {\n type: BlockType.HeaderBlock;\n} & HeaderBlockProps;\n\nexport type SliderBlockModel = {\n type: BlockType.SliderBlock;\n} & SliderProps;\n\nexport type ExtendedFeaturesBlockModel = {\n type: BlockType.ExtendedFeaturesBlock;\n} & ExtendedFeaturesProps;\n\nexport type PromoFeaturesBlockModel = {\n type: BlockType.PromoFeaturesBlock;\n} & PromoFeaturesProps;\n\nexport type QuestionsBlockModel = {\n type: BlockType.QuestionsBlock;\n} & QuestionsProps;\n\nexport type BannerBlockModel = {\n type: BlockType.BannerBlock;\n} & BannerBlockProps;\n\nexport type CompaniesBlockModel = {\n type: BlockType.CompaniesBlock;\n} & CompaniesBlockProps;\n\nexport type MediaBlockModel = {\n type: BlockType.MediaBlock;\n} & MediaBlockProps;\n\nexport type MapBlockModel = {\n type: BlockType.MapBlock;\n} & MapBlockProps;\n\nexport type InfoBlockModel = {\n type: BlockType.InfoBlock;\n} & InfoBlockProps;\n\nexport type TableBlockModel = {\n type: BlockType.TableBlock;\n} & TableBlockProps;\n\nexport type TabsBlockModel = {\n type: BlockType.TabsBlock;\n} & TabsBlockProps;\n\nexport type CardLayoutBlockModel = {\n type: BlockType.CardLayoutBlock;\n} & CardLayoutBlockProps;\n\nexport type FilterBlockModel = {\n type: BlockType.FilterBlock;\n} & FilterBlockProps;\n\nexport type IconsBlockModel = {\n type: BlockType.IconsBlock;\n} & IconsBlockProps;\n\nexport type HeaderSliderBlockModel = {\n type: BlockType.HeaderSliderBlock;\n} & HeaderSliderBlockProps;\n\nexport type ContentLayoutBlockModel = {\n type: BlockType.ContentLayoutBlock;\n} & ContentLayoutBlockProps;\n\nexport type ShareBLockModel = {\n type: BlockType.ShareBlock;\n} & ShareBlockProps;\n\nexport type FormBlockModel = {\n type: BlockType.FormBlock;\n} & FormBlockProps;\n\n// unstable block models\nexport type SliderNewBlockModel = {\n type: BlockType.SliderNewBlock;\n} & SliderNewProps;\n\ntype BlockModels =\n | SliderBlockModel\n | ExtendedFeaturesBlockModel\n | PromoFeaturesBlockModel\n | QuestionsBlockModel\n | BannerBlockModel\n | CompaniesBlockModel\n | MediaBlockModel\n | MapBlockModel\n | InfoBlockModel\n | TableBlockModel\n | TabsBlockModel\n | HeaderBlockModel\n | IconsBlockModel\n | HeaderSliderBlockModel\n | CardLayoutBlockModel\n | ContentLayoutBlockModel\n | ShareBLockModel\n | FilterBlockModel\n | FormBlockModel;\n\ntype UnstableBlockModels = SliderNewBlockModel;\n\nexport type Block = (BlockModels | UnstableBlockModels) & BlockBaseProps;\n"]}
|
|
1
|
+
{"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":";;;AA2CA,IAAY,SAsBX;AAtBD,WAAY,SAAS;IACjB,wDAA2C,CAAA;IAC3C,8DAAiD,CA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BAAkB;IAC1B,kDAA4B,CAAA;IAC5B,kDAA4B,CAAA;IAC5B,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B","sourcesContent":["import * as React from 'react';\n\nimport {ButtonSize} from '@gravity-ui/uikit';\n\nimport {GridColumnSize, GridColumnSizesType, IndentValue} from '../../grid/types';\nimport {ThemeSupporting} from '../../utils';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {\n AnchorProps,\n Animatable,\n BackgroundImageProps,\n ButtonProps,\n CardBorder,\n ContentSize,\n ContentTextSize,\n ContentTheme,\n FileLinkProps,\n HeaderBreadCrumbsProps,\n HeaderImageSize,\n HeaderOffset,\n HeaderWidth,\n ImageDeviceProps,\n ImageProps,\n Justify,\n LegendTableMarkerType,\n LinkProps,\n MapProps,\n MediaDirection,\n MediaProps,\n MediaView,\n TextSize,\n TextTheme,\n ThemedImage,\n ThemedMediaProps,\n ThemedMediaVideoProps,\n TitleItemBaseProps,\n TitleItemProps,\n WithBorder,\n YandexFormProps,\n} from './common';\nimport {BannerCardProps, HubspotFormProps, SubBlock, SubBlockModels} from './sub-blocks';\n\nexport enum BlockType {\n PromoFeaturesBlock = 'promo-features-block',\n ExtendedFeaturesBlock = 'extended-features-block',\n SliderBlock = 'slider-block',\n QuestionsBlock = 'questions-block',\n BannerBlock = 'banner-block',\n CompaniesBlock = 'companies-block',\n MediaBlock = 'media-block',\n InfoBlock = 'info-block',\n TableBlock = 'table-block',\n TabsBlock = 'tabs-block',\n HeaderSliderBlock = 'header-slider-block',\n HeaderBlock = 'header-block',\n IconsBlock = 'icons-block',\n CardLayoutBlock = 'card-layout-block',\n ContentLayoutBlock = 'content-layout-block',\n ShareBlock = 'share-block',\n MapBlock = 'map-block',\n FilterBlock = 'filter-block',\n FormBlock = 'form-block',\n // unstable\n SliderNewBlock = 'slider-new-block',\n}\n\nexport const BlockTypes = Object.values(BlockType);\nexport const HeaderBlockTypes = [BlockType.HeaderBlock, BlockType.HeaderSliderBlock];\n\nexport interface Childable {\n children?: SubBlock[];\n}\n\n//block props\nexport interface BlockBaseProps {\n anchor?: AnchorProps;\n visible?: GridColumnSize;\n /** @deprecated */\n resetPaddings?: boolean;\n indent?: {\n top?: IndentValue;\n bottom?: IndentValue;\n };\n qa?: string;\n}\n\nexport interface LoadableProps {\n source: string;\n /**\n * @deprecated Will be moved to params\n */\n serviceId?: number;\n params?: Record<string, string | number | boolean | object>;\n}\n\nexport interface LoadableChildren {\n loadable?: LoadableProps;\n}\n\nexport enum SliderBreakpointNames {\n Sm = 'sm',\n Md = 'md',\n Lg = 'lg',\n Xl = 'xl',\n}\n\nexport enum SliderType {\n MediaCard = 'media-card',\n HeaderCard = 'header-card',\n}\n\nexport type SliderBreakpointParams = Record<SliderBreakpointNames, number>;\nexport type SlidesToShow = Partial<SliderBreakpointParams> | number;\n\nexport interface SliderProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n adaptive?: boolean;\n}\n\nexport interface SliderNewProps extends Childable, Animatable, LoadableChildren {\n dots?: boolean;\n arrows?: boolean;\n slidesToShow?: SlidesToShow;\n disclaimer?: {\n text: string;\n size?: TextSize;\n };\n title?: TitleItemBaseProps;\n description?: string;\n autoplay?: number;\n //for server transforms\n randomOrder?: boolean;\n}\n\nexport interface HeaderSliderBlockProps extends Omit<SliderProps, 'title' | 'description'> {\n items: HeaderBlockProps[];\n}\n\ninterface HeaderBackgroundProps {\n /** @deprecated replaced by Media Props image */\n url?: string;\n /** @deprecated replaced by Media Props image */\n disableCompress?: boolean;\n}\n\nexport interface HeaderBlockBackground extends Partial<HeaderBackgroundProps>, Partial<MediaProps> {\n fullWidth?: boolean;\n fullWidthMedia?: boolean;\n}\n\nexport type ThemedHeaderBlockBackground = ThemeSupporting<HeaderBlockBackground>;\n\nexport interface HeaderBlockProps {\n title: string;\n overtitle?: string | JSX.Element;\n description?: string;\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];\n width?: HeaderWidth;\n /** @deprecated imageSize now depends on width */\n imageSize?: HeaderImageSize;\n /**\n * @deprecated used only on the main page\n * TODO: delete after the possibility to remove padding-bottom in the block\n */\n offset?: HeaderOffset;\n image?: ThemedImage;\n video?: ThemedMediaVideoProps;\n mediaView?: MediaView;\n centered?: boolean;\n background?: ThemedHeaderBlockBackground;\n theme?: 'light' | 'dark';\n verticalOffset?: '0' | 's' | 'm' | 'l' | 'xl';\n breadcrumbs?: HeaderBreadCrumbsProps;\n status?: JSX.Element;\n renderTitle?: (title: string) => React.ReactNode;\n}\n\nexport interface ExtendedFeaturesItem\n extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {\n title: string;\n label?: string;\n icon?: ThemedImage;\n /** @deprecated **/\n link?: LinkProps;\n}\n\nexport interface ExtendedFeaturesProps extends Animatable {\n items: ExtendedFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n colSizes?: GridColumnSizesType;\n}\n\nexport interface PromoFeaturesItem {\n title: string;\n text: string;\n theme?: 'accent' | 'accent-light' | 'primary';\n media?: ThemeSupporting<MediaProps>;\n}\n\nexport interface PromoFeaturesProps extends Animatable {\n items: PromoFeaturesItem[];\n title?: TitleItemProps | string;\n description?: string;\n theme?: 'grey' | 'default';\n}\n\nexport interface QuestionItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface QuestionsProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: QuestionItem[];\n}\n\nexport interface QuestionBlockItemProps extends QuestionItem {\n isOpened: boolean;\n onClick: () => void;\n}\n\nexport interface BannerBlockProps extends BannerCardProps, Animatable {}\n\nexport interface CompaniesBlockProps extends Animatable {\n title: string;\n description?: string;\n images: ThemeSupporting<ImageDeviceProps>;\n}\n\nexport interface MediaBaseBlockProps extends Animatable, MediaContentProps {\n direction?: MediaDirection;\n mobileDirection?: MediaDirection;\n largeMedia?: boolean;\n mediaOnly?: boolean;\n mediaOnlyColSizes?: GridColumnSizesType;\n}\n\nexport interface MediaContentProps\n extends Omit<ContentBlockProps, 'colSizes' | 'text' | 'title' | 'theme' | 'centered'> {\n title: string;\n description?: string;\n /** @deprecated Use array of buttons from ContentBlockProps instead**/\n button?: ButtonProps;\n}\n\nexport interface MediaBlockProps extends MediaBaseBlockProps, WithBorder {\n media: ThemeSupporting<MediaProps>;\n}\n\nexport interface MapBlockProps extends MediaBaseBlockProps, WithBorder {\n map: MapProps;\n}\n\nexport interface InfoBlockProps {\n theme?: TextTheme;\n backgroundColor?: ThemeSupporting<string>;\n /** @deprecated **/\n title?: string;\n /** @deprecated **/\n buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme'>[];\n /** @deprecated **/\n sectionsTitle?: string;\n /** @deprecated **/\n links?: Pick<LinkProps, 'text' | 'url'>[];\n leftContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n rightContent?: Omit<ContentBlockProps, 'colSizes' | 'theme' | 'size'>;\n}\n\nexport interface TableProps {\n content: string[][];\n legend?: string[];\n hideLegend?: boolean;\n justify?: Justify[];\n marker?: LegendTableMarkerType;\n /**\n * Only as accessible name, not displayed explicitly\n */\n caption?: string;\n}\n\nexport interface TableBlockProps {\n title: string;\n table: TableProps;\n}\n\nexport interface TabsBlockItem\n extends Omit<ContentBlockProps, 'size' | 'colSizes' | 'centered' | 'theme'>,\n WithBorder {\n tabName: string;\n /**\n * @deprecated Use array links from ContentBlockProps instead\n */\n link?: LinkProps;\n image?: ThemedImage;\n caption?: string;\n media?: ThemedMediaProps;\n}\n\nexport interface TabsBlockProps extends Animatable {\n title?: TitleItemProps | string;\n description?: string;\n tabsColSizes?: GridColumnSizesType;\n centered?: boolean;\n direction?: MediaDirection;\n items: TabsBlockItem[];\n contentSize?: ContentSize;\n}\n\nexport interface CardLayoutBlockProps extends Childable, Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n titleClassName?: string;\n description?: string;\n colSizes?: GridColumnSizesType;\n background?: ThemeSupporting<\n BackgroundImageProps & {\n border?: CardBorder;\n }\n >;\n}\n\nexport type FilterTag = {\n id: string;\n label: string;\n};\n\nexport type FilterItem = {\n tags: string[];\n card: SubBlockModels;\n};\n\nexport interface FilterBlockProps extends Animatable, LoadableChildren {\n title?: TitleItemProps | string;\n description?: string;\n tags: FilterTag[];\n items: FilterItem[];\n tagButtonSize?: ButtonSize;\n allTag?: boolean | string;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n}\n\nexport interface IconsBlockItemProps extends AnalyticsEventsBase {\n url: string;\n text: string;\n src: ThemeSupporting<string>;\n}\n\nexport interface IconsBlockProps {\n title?: string;\n description?: string;\n size?: 's' | 'm' | 'l';\n items: IconsBlockItemProps[];\n colSizes?: GridColumnSizesType;\n}\n\ninterface ContentLayoutBlockParams {\n size?: ContentSize;\n background?: ThemeSupporting<BackgroundImageProps>;\n centered?: boolean;\n theme?: ContentTheme;\n textWidth?: ContentTextSize;\n}\n\nexport interface ContentLayoutBlockProps extends ContentLayoutBlockParams {\n textContent: ContentBlockProps;\n fileContent?: FileLinkProps[];\n}\n\nexport type SVGIcon = React.FC<React.SVGProps<SVGSVGElement>>;\n\nexport interface ContentItemProps {\n title?: string;\n text?: string;\n icon: ThemeSupporting<ImageProps | SVGIcon>;\n}\n\nexport interface ContentListProps {\n list: ContentItemProps[];\n size: ContentSize;\n theme?: ContentTheme;\n}\n\nexport interface ContentBlockProps {\n title?: TitleItemBaseProps | string;\n titleId?: string;\n text?: string;\n textId?: string;\n additionalInfo?: string;\n links?: LinkProps[];\n buttons?: ButtonProps[];\n size?: ContentSize;\n colSizes?: GridColumnSizesType;\n centered?: boolean;\n theme?: ContentTheme;\n list?: ContentItemProps[];\n controlPosition?: 'default' | 'bottom';\n}\n\nexport enum PCShareSocialNetwork {\n Vk = 'vk',\n Telegram = 'telegram',\n Twitter = 'twitter',\n Facebook = 'facebook',\n LinkedIn = 'linkedin',\n}\n\nexport interface ShareBlockProps {\n items: PCShareSocialNetwork[];\n title?: string;\n}\n\nexport enum FormBlockDataTypes {\n YANDEX = 'yandex',\n HUBSPOT = 'hubspot',\n}\n\nexport enum FormBlockDirection {\n FormContent = 'form-content',\n ContentForm = 'content-form',\n Center = 'center',\n}\n\nexport interface FormBlockYandexData {\n yandex: ThemeSupporting<YandexFormProps>;\n}\n\nexport interface FormBlockHubspotData {\n hubspot: ThemeSupporting<HubspotFormProps>;\n}\n\nexport type FormBlockData = FormBlockYandexData | FormBlockHubspotData;\n\nexport interface FormBlockProps {\n formData: FormBlockData;\n title?: string;\n textContent?: Omit<ContentBlockProps, 'centered' | 'colSizes' | 'size'>;\n direction?: FormBlockDirection;\n background?: ThemeSupporting<BackgroundImageProps>;\n}\n\n//block models\nexport type HeaderBlockModel = {\n type: BlockType.HeaderBlock;\n} & HeaderBlockProps;\n\nexport type SliderBlockModel = {\n type: BlockType.SliderBlock;\n} & SliderProps;\n\nexport type ExtendedFeaturesBlockModel = {\n type: BlockType.ExtendedFeaturesBlock;\n} & ExtendedFeaturesProps;\n\nexport type PromoFeaturesBlockModel = {\n type: BlockType.PromoFeaturesBlock;\n} & PromoFeaturesProps;\n\nexport type QuestionsBlockModel = {\n type: BlockType.QuestionsBlock;\n} & QuestionsProps;\n\nexport type BannerBlockModel = {\n type: BlockType.BannerBlock;\n} & BannerBlockProps;\n\nexport type CompaniesBlockModel = {\n type: BlockType.CompaniesBlock;\n} & CompaniesBlockProps;\n\nexport type MediaBlockModel = {\n type: BlockType.MediaBlock;\n} & MediaBlockProps;\n\nexport type MapBlockModel = {\n type: BlockType.MapBlock;\n} & MapBlockProps;\n\nexport type InfoBlockModel = {\n type: BlockType.InfoBlock;\n} & InfoBlockProps;\n\nexport type TableBlockModel = {\n type: BlockType.TableBlock;\n} & TableBlockProps;\n\nexport type TabsBlockModel = {\n type: BlockType.TabsBlock;\n} & TabsBlockProps;\n\nexport type CardLayoutBlockModel = {\n type: BlockType.CardLayoutBlock;\n} & CardLayoutBlockProps;\n\nexport type FilterBlockModel = {\n type: BlockType.FilterBlock;\n} & FilterBlockProps;\n\nexport type IconsBlockModel = {\n type: BlockType.IconsBlock;\n} & IconsBlockProps;\n\nexport type HeaderSliderBlockModel = {\n type: BlockType.HeaderSliderBlock;\n} & HeaderSliderBlockProps;\n\nexport type ContentLayoutBlockModel = {\n type: BlockType.ContentLayoutBlock;\n} & ContentLayoutBlockProps;\n\nexport type ShareBLockModel = {\n type: BlockType.ShareBlock;\n} & ShareBlockProps;\n\nexport type FormBlockModel = {\n type: BlockType.FormBlock;\n} & FormBlockProps;\n\n// unstable block models\nexport type SliderNewBlockModel = {\n type: BlockType.SliderNewBlock;\n} & SliderNewProps;\n\ntype BlockModels =\n | SliderBlockModel\n | ExtendedFeaturesBlockModel\n | PromoFeaturesBlockModel\n | QuestionsBlockModel\n | BannerBlockModel\n | CompaniesBlockModel\n | MediaBlockModel\n | MapBlockModel\n | InfoBlockModel\n | TableBlockModel\n | TabsBlockModel\n | HeaderBlockModel\n | IconsBlockModel\n | HeaderSliderBlockModel\n | CardLayoutBlockModel\n | ContentLayoutBlockModel\n | ShareBLockModel\n | FilterBlockModel\n | FormBlockModel;\n\ntype UnstableBlockModels = SliderNewBlockModel;\n\nexport type Block = (BlockModels | UnstableBlockModels) & BlockBaseProps;\n"]}
|
|
@@ -4,7 +4,7 @@ exports.NavigationItem = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const React = tslib_1.__importStar(require("react"));
|
|
7
|
-
const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
|
|
7
|
+
const omit_1 = tslib_1.__importDefault(require("lodash/omit.js"));
|
|
8
8
|
const blockIdContext_1 = require("../../../context/blockIdContext/index.js");
|
|
9
9
|
const models_1 = require("../../../models/index.js");
|
|
10
10
|
const utils_1 = require("../../../utils/index.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationItem.js","sourceRoot":"../../../../../src","sources":["navigation/components/NavigationItem/NavigationItem.tsx"],"names":[],"mappings":";;;;;AAAA,qDAA+B;AAE/B
|
|
1
|
+
{"version":3,"file":"NavigationItem.js","sourceRoot":"../../../../../src","sources":["navigation/components/NavigationItem/NavigationItem.tsx"],"names":[],"mappings":";;;;;AAAA,qDAA+B;AAE/B,kEAA+B;AAE/B,6EAA+D;AAC/D,qDAAoF;AACpF,mDAAqC;AAGrC,0EAAkE;AAIlE,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,iBAAiB,CAAC,CAAC;AAEnC,MAAM,YAAY,GAAG,YAAY,CAAC;AAElC,MAAM,6BAA6B,GAAG,4BAAmB,CAAC,MAAM,CAC5D,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,2BAAkB,CAAC,QAAQ,CACjD,CAAC;AAEK,MAAM,cAAc,GAAkC,CAAC,EAKxC,EAAE,EAAE;QALoC,EAC1D,IAAI,EACJ,SAAS,EACT,UAAU,OAEQ,EADf,KAAK,sBAJkD,mCAK7D,CADW;IAER,MAAM,EAAC,IAAI,GAAG,2BAAkB,CAAC,IAAI,EAAC,GAAG,IAAI,CAAC;IAC9C,MAAM,UAAU,GAAG,IAAA,2CAAoB,GAAE,CAAC;IAC1C,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAe,CAAC;IACjD,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACtC,MAAM,mBAAmB,mCAClB,IAAI,GACJ,KAAK,CACX,CAAC;QAEF,IACI,6BAA6B,CAAC,QAAQ,CAClC,IAAsD,CACzD,EACH,CAAC;YACC,OAAO,IAAA,cAAI,EAAC,mBAAmB,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;QAC9D,CAAC;QAED,OAAO,4BAAmB,CAAC,QAAQ,CAAC,IAAI,CAAC;YACrC,CAAC,CAAC,mBAAmB;YACrB,CAAC,iCAAK,mBAAmB,KAAE,UAAU,GAAC,CAAC;IAC/C,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;IAEpC,OAAO,CACH,uBAAC,+BAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YACxC,+BAAI,SAAS,EAAE,CAAC,CAAC,EAAC,aAAa,EAAE,UAAU,EAAC,EAAE,SAAS,CAAC,YACpD,uBAAC,SAAS,oBAAK,cAAc,IAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,CAAC,IAAI,GACjE,GACiB,CAC7B,CAAC;AACN,CAAC,CAAC;AAnCW,QAAA,cAAc,kBAmCzB;AAEF,kBAAe,sBAAc,CAAC","sourcesContent":["import * as React from 'react';\n\nimport omit from 'lodash/omit';\n\nimport {BlockIdContext} from '../../../context/blockIdContext';\nimport {CustomItem, NavigationItemType, NavigationItemTypes} from '../../../models';\nimport {block} from '../../../utils';\nimport {NavigationItemProps} from '../../models';\n\nimport {useNavigationItemMap} from './hooks/useNavigationItemMap';\n\nimport './NavigationItem.scss';\n\nconst b = block('navigation-item');\n\nconst ANALYTICS_ID = 'navigation';\n\nconst nonComplexNavigationItemTypes = NavigationItemTypes.filter(\n (type) => type !== NavigationItemType.Dropdown,\n);\n\nexport const NavigationItem: React.FC<NavigationItemProps> = ({\n data,\n className,\n menuLayout,\n ...props\n}: NavigationItemProps) => {\n const {type = NavigationItemType.Link} = data;\n const navItemMap = useNavigationItemMap();\n const Component = navItemMap[type] as CustomItem;\n const componentProps = React.useMemo(() => {\n const componentProperties = {\n ...data,\n ...props,\n };\n\n if (\n nonComplexNavigationItemTypes.includes(\n type as (typeof nonComplexNavigationItemTypes)[number],\n )\n ) {\n return omit(componentProperties, 'hidePopup', 'isActive');\n }\n\n return NavigationItemTypes.includes(type)\n ? componentProperties\n : {...componentProperties, menuLayout};\n }, [data, props, type, menuLayout]);\n\n return (\n <BlockIdContext.Provider value={ANALYTICS_ID}>\n <li className={b({'menu-layout': menuLayout}, className)}>\n <Component {...componentProps} className={b('content', {type})} />\n </li>\n </BlockIdContext.Provider>\n );\n};\n\nexport default NavigationItem;\n"]}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useNavigationItemMap = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty"));
|
|
6
|
+
const isEmpty_1 = tslib_1.__importDefault(require("lodash/isEmpty.js"));
|
|
7
7
|
const constructor_items_1 = require("../../../../constructor-items.js");
|
|
8
8
|
const innerContext_1 = require("../../../../context/innerContext/index.js");
|
|
9
9
|
const useNavigationItemMap = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNavigationItemMap.js","sourceRoot":"../../../../../../src","sources":["navigation/components/NavigationItem/hooks/useNavigationItemMap.ts"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,
|
|
1
|
+
{"version":3,"file":"useNavigationItemMap.js","sourceRoot":"../../../../../../src","sources":["navigation/components/NavigationItem/hooks/useNavigationItemMap.ts"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,wEAAqC;AAErC,wEAA8E;AAC9E,4EAA8D;AAEvD,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACrC,MAAM,EAAC,UAAU,EAAC,GAAG,KAAK,CAAC,UAAU,CAAC,2BAAY,CAAC,CAAC;IAEpD,OAAO,IAAA,iBAAO,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,8BAAiB,CAAC,CAAC,CAAC,UAAU,CAAC;AAChE,CAAC,CAAC;AAJW,QAAA,oBAAoB,wBAI/B","sourcesContent":["import * as React from 'react';\n\nimport isEmpty from 'lodash/isEmpty';\n\nimport {navItemMap as NavItemMapDefault} from '../../../../constructor-items';\nimport {InnerContext} from '../../../../context/innerContext';\n\nexport const useNavigationItemMap = () => {\n const {navItemMap} = React.useContext(InnerContext);\n\n return isEmpty(navItemMap) ? NavItemMapDefault : navItemMap;\n};\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const React = tslib_1.__importStar(require("react"));
|
|
5
|
-
const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
|
|
5
|
+
const debounce_1 = tslib_1.__importDefault(require("lodash/debounce.js"));
|
|
6
6
|
const useShowBorder = (withBorder, withBorderOnScroll) => {
|
|
7
7
|
const [showBorder, setShowBorder] = React.useState(withBorder);
|
|
8
8
|
React.useEffect(() => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useShowBorder.js","sourceRoot":"../../../../src","sources":["navigation/hooks/useShowBorder.ts"],"names":[],"mappings":";;;AAAA,qDAA+B;AAE/B,
|
|
1
|
+
{"version":3,"file":"useShowBorder.js","sourceRoot":"../../../../src","sources":["navigation/hooks/useShowBorder.ts"],"names":[],"mappings":";;;AAAA,qDAA+B;AAE/B,0EAAuC;AAEvC,MAAM,aAAa,GAAG,CAAC,UAAmB,EAAE,kBAA2B,EAAE,EAAE;IACvE,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAE/D,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,IAAI,CAAC,kBAAkB;YAAE,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;QAEzC,MAAM,kBAAkB,GAAG,GAAG,EAAE;YAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;gBACd,aAAa,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;YACtC,CAAC;QACL,CAAC,CAAC;QAEF,MAAM,aAAa,GAAG,IAAA,kBAAQ,EAAC,kBAAkB,EAAE,EAAE,CAAC,CAAC;QAEvD,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC;QAClE,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,UAAU,CAAC,CAAC;AACxB,CAAC,CAAC;AAEF,kBAAe,aAAa,CAAC","sourcesContent":["import * as React from 'react';\n\nimport debounce from 'lodash/debounce';\n\nconst useShowBorder = (withBorder: boolean, withBorderOnScroll: boolean) => {\n const [showBorder, setShowBorder] = React.useState(withBorder);\n\n React.useEffect(() => {\n if (!withBorderOnScroll) return () => {};\n\n const showBorderOnScroll = () => {\n if (!withBorder) {\n setShowBorder(window.scrollY > 0);\n }\n };\n\n const scrollHandler = debounce(showBorderOnScroll, 20);\n\n window.addEventListener('scroll', scrollHandler, {passive: true});\n return () => window.removeEventListener('scroll', scrollHandler);\n });\n\n return [showBorder];\n};\n\nexport default useShowBorder;\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NavigationHeaderProps = exports.LogoProps = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
|
|
5
|
+
const omit_1 = tslib_1.__importDefault(require("lodash/omit.js"));
|
|
6
6
|
const schema_1 = require("../components/Image/schema.js");
|
|
7
7
|
const common_1 = require("../schema/validators/common.js");
|
|
8
8
|
const utils_1 = require("../schema/validators/utils.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"../../../src","sources":["navigation/schema.ts"],"names":[],"mappings":";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;YACH,IAAI,EAAE,SAAS;SAClB,GACJ;CACJ,CAAC;AAEF,MAAM,yBAAyB,GAAG;IAC9B,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC;IACjC,UAAU,kCACH,oBAAW,KACd,IAAI,oBAAM,kBAAkB,IAC/B;CACJ,CAAC;AAEF,MAAM,2BAA2B,GAAG;IAChC,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;IAC3B,UAAU,kCACH,uBAAuB,KAC1B,IAAI,oBAAM,kBAAkB,GAC5B,KAAK,EAAE,IAAA,qBAAa,EAAC,uBAAuB,CAAC,GAChD;CACJ,CAAC;AAEF,MAAM,mBAAmB,GAAG;IACxB,KAAK,EAAE;QACH,IAAA,qBAAa,EAAC,uBAAuB,CAAC;QACtC,IAAA,qBAAa,EAAC,yBAAyB,CAAC;QACxC,IAAA,qBAAa,EAAC,2BAA2B,CAAC;KAC7C;CACJ,CAAC;AAEW,QAAA,qBAAqB,GAAG;IACjC,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,WAAW,CAAC;IACvB,UAAU,EAAE;QACR,SAAS,EAAE,mBAAmB;QAC9B,UAAU,EAAE,mBAAmB;QAC/B,QAAQ,EAAE;YACN,IAAI,EAAE,QAAQ;SACjB;KACJ;CACJ,CAAC","sourcesContent":["import omit from 'lodash/omit';\n\nimport {ImageProps, imageUrlPattern} from '../components/Image/schema';\nimport {ButtonProps} from '../schema/validators/common';\nimport {filteredArray} from '../schema/validators/utils';\n\nconst NavigationItemType = {\n type: 'string',\n enum: ['link', 'button', 'dropdown'],\n};\n\nexport const LogoProps = {\n type: 'object',\n additionalProperties: false,\n required: ['icon'],\n properties: {\n icon: ImageProps,\n text: {\n type: 'string',\n contentType: 'text',\n },\n url: {\n type: 'string',\n },\n },\n};\n\nconst NavigationItemBaseProps = {\n text: {\n type: 'string',\n contentType: 'text',\n },\n url: {\n type: 'string',\n },\n icon: {\n type: 'string',\n pattern: imageUrlPattern,\n },\n iconSize: {\n type: 'number',\n },\n};\n\nconst NavigationItemBaseLinkProps = omit(NavigationItemBaseProps, ['url']);\n\nconst NavigationLinkItemProps = {\n type: 'object',\n additionalProperties: false,\n required: ['type', 'text'],\n properties: {\n ...NavigationItemBaseLinkProps,\n type: {...NavigationItemType},\n url: {\n type: 'string',\n },\n target: {\n type: 'string',\n },\n arrow: {\n type: 'boolean',\n },\n },\n};\n\nconst NavigationButtonItemProps = {\n type: 'object',\n additionalProperties: false,\n required: ['type', 'text', 'url'],\n properties: {\n ...ButtonProps,\n type: {...NavigationItemType},\n },\n};\n\nconst NavigationDropdownItemProps = {\n type: 'object',\n additionalProperties: false,\n required: ['type', 'items'],\n properties: {\n ...NavigationItemBaseProps,\n type: {...NavigationItemType},\n items: filteredArray(NavigationLinkItemProps),\n },\n};\n\nconst NavigationItemProps = {\n oneOf: [\n filteredArray(NavigationLinkItemProps),\n filteredArray(NavigationButtonItemProps),\n filteredArray(NavigationDropdownItemProps),\n ],\n};\n\nexport const NavigationHeaderProps = {\n type: 'object',\n additionalProperties: false,\n required: ['leftItems'],\n properties: {\n leftItems: NavigationItemProps,\n rightItems: NavigationItemProps,\n iconSize: {\n type: 'number',\n },\n },\n};\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BackgroundCard = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
|
|
5
|
+
const omit_1 = tslib_1.__importDefault(require("lodash/omit.js"));
|
|
6
6
|
const schema_1 = require("../../components/Image/schema.js");
|
|
7
7
|
const common_1 = require("../../schema/validators/common.js");
|
|
8
8
|
const event_1 = require("../../schema/validators/event.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/BackgroundCard/schema.ts"],"names":[],"mappings":";;;;AAAA
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/BackgroundCard/schema.ts"],"names":[],"mappings":";;;;AAAA,kEAA+B;AAE/B,6DAA+D;AAC/D,8DAA+F;AAC/F,4DAAmE;AACnE,iDAA8C;AAE9C,MAAM,0BAA0B,GAAG,IAAA,cAAI,EAAC,oBAAW,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAErE,QAAA,cAAc,GAAG;IAC1B,iBAAiB,EAAE;QACf,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;QAC3B,UAAU,4EACH,kBAAS,GACT,iBAAQ,GACR,wBAAe,GACf,0BAA0B,KAC7B,GAAG,EAAE;gBACD,IAAI,EAAE,QAAQ;aACjB,EACD,QAAQ,EAAE;gBACN,IAAI,EAAE,QAAQ;aACjB,EACD,UAAU,EAAE,IAAA,kBAAS,EAAC,yBAAgB,CAAC,EACvC,eAAe,EAAE;gBACb,IAAI,EAAE,QAAQ;aACjB,EACD,aAAa,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC;aAC9B,EACD,eAAe,EAAE;gBACb,KAAK,EAAE;oDAEI,4BAAoB,KACvB,UAAU,EAAE,QAAQ;oBAExB;wBACI,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,4BAAoB;wBAC3B,UAAU,EAAE,MAAM;qBACrB;iBACJ;aACJ,EACD,eAAe,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;aAC9B,GACJ;KACJ;CACJ,CAAC","sourcesContent":["import omit from 'lodash/omit';\n\nimport {ImageObjectProps} from '../../components/Image/schema';\nimport {BaseProps, CardBase, CardLayoutProps, withTheme} from '../../schema/validators/common';\nimport {AnalyticsEventSchema} from '../../schema/validators/event';\nimport {ContentBase} from '../Content/schema';\n\nconst BackgroundCardContentProps = omit(ContentBase, ['size', 'controlPosition']);\n\nexport const BackgroundCard = {\n 'background-card': {\n additionalProperties: false,\n required: ['title', 'text'],\n properties: {\n ...BaseProps,\n ...CardBase,\n ...CardLayoutProps,\n ...BackgroundCardContentProps,\n url: {\n type: 'string',\n },\n urlTitle: {\n type: 'string',\n },\n background: withTheme(ImageObjectProps),\n backgroundColor: {\n type: 'string',\n },\n paddingBottom: {\n type: 'string',\n enum: ['s', 'm', 'l', 'xl'],\n },\n analyticsEvents: {\n oneOf: [\n {\n ...AnalyticsEventSchema,\n optionName: 'single',\n },\n {\n type: 'array',\n items: AnalyticsEventSchema,\n optionName: 'list',\n },\n ],\n },\n controlPosition: {\n type: 'string',\n enum: ['content', 'footer'],\n },\n },\n },\n};\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BasicCard = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
|
|
5
|
+
const omit_1 = tslib_1.__importDefault(require("lodash/omit.js"));
|
|
6
6
|
const schema_1 = require("../../components/Image/schema.js");
|
|
7
7
|
const common_1 = require("../../schema/validators/common.js");
|
|
8
8
|
const schema_2 = require("../Content/schema.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/BasicCard/schema.ts"],"names":[],"mappings":";;;;AAAA
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/BasicCard/schema.ts"],"names":[],"mappings":";;;;AAAA,kEAA+B;AAE/B,6DAAyD;AACzD,8DAAoF;AACpF,iDAA8C;AAE9C,MAAM,qBAAqB,GAAG,IAAA,cAAI,EAAC,oBAAW,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAEzE,QAAA,SAAS,GAAG;IACrB,YAAY,EAAE;QACV,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,EAAE;QACZ,UAAU,4EACH,kBAAS,GACT,iBAAQ,GACR,wBAAe,GACf,qBAAqB,KACxB,GAAG,EAAE;gBACD,IAAI,EAAE,QAAQ;aACjB,EACD,QAAQ,EAAE;gBACN,IAAI,EAAE,QAAQ;aACjB,EACD,IAAI,EAAE,mBAAU,EAChB,MAAM,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;aAC/C,EACD,YAAY,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC;aACxB,EACD,eAAe,EAAE;gBACb,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;aAC9B,GACJ;KACJ;CACJ,CAAC","sourcesContent":["import omit from 'lodash/omit';\n\nimport {ImageProps} from '../../components/Image/schema';\nimport {BaseProps, CardBase, CardLayoutProps} from '../../schema/validators/common';\nimport {ContentBase} from '../Content/schema';\n\nconst BasicCardContentProps = omit(ContentBase, ['size', 'theme', 'controlPosition']);\n\nexport const BasicCard = {\n 'basic-card': {\n additionalProperties: false,\n required: [],\n properties: {\n ...BaseProps,\n ...CardBase,\n ...CardLayoutProps,\n ...BasicCardContentProps,\n url: {\n type: 'string',\n },\n urlTitle: {\n type: 'string',\n },\n icon: ImageProps,\n target: {\n type: 'string',\n enum: ['_blank', '_parent', '_top', '_self'],\n },\n iconPosition: {\n type: 'string',\n enum: ['top', 'left'],\n },\n controlPosition: {\n type: 'string',\n enum: ['content', 'footer'],\n },\n },\n },\n};\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ImageCard = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
|
|
5
|
+
const omit_1 = tslib_1.__importDefault(require("lodash/omit.js"));
|
|
6
6
|
const common_1 = require("../../schema/validators/common.js");
|
|
7
7
|
const components_1 = require("../../schema/validators/components.js");
|
|
8
8
|
const schema_1 = require("../Content/schema.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/ImageCard/schema.ts"],"names":[],"mappings":";;;;AAAA
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/ImageCard/schema.ts"],"names":[],"mappings":";;;;AAAA,kEAA+B;AAE/B,8DAAoF;AACpF,sEAA8D;AAC9D,iDAA8C;AAE9C,MAAM,0BAA0B,GAAG,IAAA,cAAI,EAAC,oBAAW,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAErF,QAAA,SAAS,GAAG;IACrB,YAAY,EAAE;QACV,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,OAAO,CAAC;QACnB,UAAU,4EACH,kBAAS,GACT,iBAAQ,GACR,wBAAe,GACf,0BAA0B,KAC7B,KAAK,EAAE,uBAAU,EACjB,SAAS,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;aAC9B,EACD,OAAO,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;aACnB,EACD,eAAe,EAAE;gBACb,IAAI,EAAE,QAAQ;aACjB,EACD,GAAG,EAAE;gBACD,IAAI,EAAE,QAAQ;aACjB,EACD,QAAQ,EAAE;gBACN,IAAI,EAAE,QAAQ;aACjB,GACJ;KACJ;CACJ,CAAC","sourcesContent":["import omit from 'lodash/omit';\n\nimport {BaseProps, CardBase, CardLayoutProps} from '../../schema/validators/common';\nimport {ImageProps} from '../../schema/validators/components';\nimport {ContentBase} from '../Content/schema';\n\nconst ImageCardBlockContentProps = omit(ContentBase, ['centered', 'colSizes', 'controlPosition']);\n\nexport const ImageCard = {\n 'image-card': {\n additionalProperties: false,\n required: ['image'],\n properties: {\n ...BaseProps,\n ...CardBase,\n ...CardLayoutProps,\n ...ImageCardBlockContentProps,\n image: ImageProps,\n direction: {\n type: 'string',\n enum: ['direct', 'reverse'],\n },\n margins: {\n type: 'string',\n enum: ['s', 'm'],\n },\n backgroundColor: {\n type: 'string',\n },\n url: {\n type: 'string',\n },\n urlTitle: {\n type: 'string',\n },\n },\n },\n};\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LayoutItem = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
|
|
5
|
+
const omit_1 = tslib_1.__importDefault(require("lodash/omit.js"));
|
|
6
6
|
const schema_1 = tslib_1.__importDefault(require("../../components/MetaInfo/schema.js"));
|
|
7
7
|
const common_1 = require("../../schema/validators/common.js");
|
|
8
8
|
const event_1 = require("../../schema/validators/event.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/LayoutItem/schema.ts"],"names":[],"mappings":";;;;AAAA
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"../../../../src","sources":["sub-blocks/LayoutItem/schema.ts"],"names":[],"mappings":";;;;AAAA,kEAA+B;AAE/B,yFAAwD;AACxD,8DAAsF;AACtF,4DAAmE;AACnE,iDAA4D;AAE/C,QAAA,UAAU,GAAG;IACtB,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC;IAC9B,UAAU,gDACH,kBAAS,GACT,wBAAe,KAClB,KAAK,EAAE,mBAAU,EACjB,OAAO,EAAE,IAAA,cAAI,EAAC,oBAAW,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,EAC3D,aAAa,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;YAChB,OAAO,EAAE,GAAG;SACf,EACD,QAAQ,EAAE,gBAAQ,EAClB,MAAM,EAAE;YACJ,IAAI,EAAE,SAAS;SAClB,EACD,UAAU,EAAE;YACR,IAAI,EAAE,SAAS;SAClB,EACD,eAAe,EAAE;YACb,KAAK,EAAE;gDAEI,4BAAoB,KACvB,UAAU,EAAE,QAAQ;gBAExB;oBACI,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,4BAAoB;oBAC3B,UAAU,EAAE,MAAM;iBACrB;aACJ;SACJ,GACJ;CACJ,CAAC","sourcesContent":["import omit from 'lodash/omit';\n\nimport metaInfo from '../../components/MetaInfo/schema';\nimport {BaseProps, CardLayoutProps, MediaProps} from '../../schema/validators/common';\nimport {AnalyticsEventSchema} from '../../schema/validators/event';\nimport {ContentBase} from '../../sub-blocks/Content/schema';\n\nexport const LayoutItem = {\n type: 'object',\n additionalProperties: false,\n required: ['content', 'media'],\n properties: {\n ...BaseProps,\n ...CardLayoutProps,\n media: MediaProps,\n content: omit(ContentBase, ['colSize', 'size', 'centered']),\n contentMargin: {\n type: 'string',\n enum: ['m', 'l'],\n default: 'm',\n },\n metaInfo: metaInfo,\n border: {\n type: 'boolean',\n },\n fullscreen: {\n type: 'boolean',\n },\n analyticsEvents: {\n oneOf: [\n {\n ...AnalyticsEventSchema,\n optionName: 'single',\n },\n {\n type: 'array',\n items: AnalyticsEventSchema,\n optionName: 'list',\n },\n ],\n },\n },\n};\n"]}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const chunk_1 = tslib_1.__importDefault(require("lodash/chunk"));
|
|
6
|
+
const chunk_1 = tslib_1.__importDefault(require("lodash/chunk.js"));
|
|
7
7
|
const components_1 = require("../../../components/index.js");
|
|
8
8
|
const constants_1 = require("../../../constants.js");
|
|
9
9
|
const grid_1 = require("../../../grid/index.js");
|
package/build/cjs/sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CombinedPriceDetailed.js","sourceRoot":"../../../../../src","sources":["sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,
|
|
1
|
+
{"version":3,"file":"CombinedPriceDetailed.js","sourceRoot":"../../../../../src","sources":["sub-blocks/PriceDetailed/CombinedPriceDetailed/CombinedPriceDetailed.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,oEAAiC;AAEjC,6DAA6C;AAC7C,qDAA+C;AAC/C,iDAA6D;AAS7D,mDAAqC;AAIrC,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,+BAA+B,CAAC,CAAC;AAEjD,MAAM,uBAAuB,GAAG;IAC5B,CAAC,qBAAc,CAAC,EAAE,CAAC,EAAE,CAAC;IACtB,CAAC,qBAAc,CAAC,EAAE,CAAC,EAAE,CAAC;IACtB,CAAC,qBAAc,CAAC,EAAE,CAAC,EAAE,CAAC;CACzB,CAAC;AAaF,MAAM,qBAAqB,GAAG,CAAC,KAAiC,EAAE,EAAE;IAChE,MAAM,EACF,KAAK,EACL,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,u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OAAO,CACH,uBAAC,UAAG,IAAU,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,YAC5B,QAAQ,CAAC,IAAI,CAAC,IADT,EAAE,CAEN,CACT,CAAC;gBACN,CAAC,CAAC,GACC,GACQ,GACZ,CACd,CAAC;AACN,CAAC,CAAC;AAEF,kBAAe,qBAAqB,CAAC","sourcesContent":["import * as React from 'react';\n\nimport chunk from 'lodash/chunk';\n\nimport {CardBase} from '../../../components';\nimport {BREAKPOINTS} from '../../../constants';\nimport {Col, Grid, GridColumnSize, Row} from '../../../grid';\nimport {\n AnalyticsEventsBase,\n CardBorder,\n PriceDescriptionProps,\n PriceDetailsListProps,\n PriceDetailsSettingsProps,\n PriceItemProps,\n} from '../../../models';\nimport {block} from '../../../utils';\n\nimport './CombinedPriceDetailed.scss';\n\nconst b = block('combined-price-detailed-block');\n\nconst CombinedPricesGroupSize = {\n [GridColumnSize.Sm]: 1,\n [GridColumnSize.Md]: 2,\n [GridColumnSize.Lg]: 3,\n};\n\ninterface CombinedPriceDetailedProps extends AnalyticsEventsBase {\n items: PriceItemProps[];\n numberGroupItems: number;\n useMixedView?: boolean;\n getDescriptionComponent: (priceDescription: PriceDescriptionProps) => JSX.Element;\n getDetailsComponent: (\n priceDetails?: PriceDetailsSettingsProps[] | PriceDetailsListProps[],\n ) => JSX.Element;\n border?: CardBorder;\n}\n\nconst CombinedPriceDetailed = (props: CombinedPriceDetailedProps) => {\n const {\n items,\n numberGroupItems,\n border,\n useMixedView,\n getDescriptionComponent,\n getDetailsComponent,\n analyticsEvents,\n } = props;\n\n const [groupItemsSize, setGroupItemsSize] = React.useState<number>(numberGroupItems);\n\n const updateGroupItemsSize = React.useCallback(\n (windowWidth: number) => {\n if (windowWidth >= BREAKPOINTS.lg) {\n setGroupItemsSize(numberGroupItems);\n } else if (BREAKPOINTS.lg > windowWidth && windowWidth >= BREAKPOINTS.md) {\n setGroupItemsSize(CombinedPricesGroupSize[GridColumnSize.Lg]);\n } else if (BREAKPOINTS.md > windowWidth && windowWidth >= BREAKPOINTS.sm) {\n setGroupItemsSize(CombinedPricesGroupSize[GridColumnSize.Md]);\n } else {\n setGroupItemsSize(CombinedPricesGroupSize[GridColumnSize.Sm]);\n }\n },\n [numberGroupItems],\n );\n\n React.useEffect(() => {\n function handleResize() {\n updateGroupItemsSize(window.innerWidth);\n }\n\n handleResize();\n\n window.addEventListener('resize', handleResize, {passive: true});\n return () => window.removeEventListener('resize', handleResize);\n }, [updateGroupItemsSize]);\n\n const getPrice = (groupPrices: PriceItemProps[]) => {\n const descriptionComponents: JSX.Element[] = Array(groupItemsSize);\n const detailsComponents: JSX.Element[] = Array(groupItemsSize);\n\n for (let id = 0; id < groupItemsSize; id++) {\n const price = groupPrices[id];\n\n descriptionComponents[id] = (\n <Col key={`card_${id}`}>{price && getDescriptionComponent(price)}</Col>\n );\n detailsComponents[id] = (\n <Col key={`details_${id}`} className={price ? '' : b('empty-column')}>\n {price && getDetailsComponent(price.items)}\n </Col>\n );\n }\n\n return (\n <React.Fragment>\n <div>{descriptionComponents}</div>\n <div className={b('description', {delimiter: useMixedView})}>\n {detailsComponents}\n </div>\n </React.Fragment>\n );\n };\n\n const chunkedItems = chunk(items, groupItemsSize);\n\n return (\n <CardBase className={b()} border={border} analyticsEvents={analyticsEvents}>\n <CardBase.Content>\n <Grid>\n {chunkedItems.map((item: PriceItemProps[], id) => {\n return (\n <Row key={id} className={b('row')}>\n {getPrice(item)}\n </Row>\n );\n })}\n </Grid>\n </CardBase.Content>\n </CardBase>\n );\n};\n\nexport default CombinedPriceDetailed;\n"]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.contentTransformer = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const cloneDeep_1 = tslib_1.__importDefault(require("lodash/cloneDeep"));
|
|
6
|
-
const shuffle_1 = tslib_1.__importDefault(require("lodash/shuffle"));
|
|
5
|
+
const cloneDeep_1 = tslib_1.__importDefault(require("lodash/cloneDeep.js"));
|
|
6
|
+
const shuffle_1 = tslib_1.__importDefault(require("lodash/shuffle.js"));
|
|
7
7
|
const config_1 = require("./config.js");
|
|
8
8
|
const filter_1 = require("./filter.js");
|
|
9
9
|
function transformBlocks(blocks, lang, customConfig = {}, options = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformers.js","sourceRoot":"../../../src","sources":["text-transform/transformers.ts"],"names":[],"mappings":";;;;AAGA,
|
|
1
|
+
{"version":3,"file":"transformers.js","sourceRoot":"../../../src","sources":["text-transform/transformers.ts"],"names":[],"mappings":";;;;AAGA,4EAAyC;AACzC,wEAAqC;AAKrC,wCAA8C;AAC9C,wCAA0D;AAgB1D,SAAS,eAAe,CACpB,MAA0B,EAC1B,IAAU,EACV,YAAY,GAAG,EAAE,EACjB,UAA4C,EAAE;IAE9C,MAAM,UAAU,mCAAO,eAAM,GAAK,YAAY,CAAC,CAAC;IAChD,MAAM,EAAC,OAAO,GAAG,EAAE,EAAC,GAAG,OAAO,CAAC;IAE/B,MAAM,YAAY,GAAG,IAAA,mBAAS,EAAC,MAAM,CAAC,CAAC;IAEvC,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AACzF,CAAC;AAED,SAAS,cAAc,CACnB,IAAU,EACV,YAA0B,EAC1B,KAAuB,EACvB,OAA6B;IAE7B,MAAM,WAAW,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE7C,IAAI,KAAK,EAAE,CAAC;QACR,IAAI,aAAa,IAAI,KAAK,IAAI,KAAK,CAAC,WAAW,IAAI,UAAU,IAAI,KAAK,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;YACvF,KAAK,CAAC,QAAQ,GAAG,IAAA,iBAAO,EAAC,KAAK,CAAC,Q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C,QAA8B,EAAE,IAAI,EAAE,YAAY,EAAE;YACvF,OAAO;SACV,CAAC,CAAC;IACP,CAAC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAEM,MAAM,kBAAkB,GAAG,CAAC,EAAC,OAAO,EAAE,OAAO,EAA0B,EAAE,EAAE;IAC9E,MAAM,EAAC,IAAI,EAAE,YAAY,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,GAAG,EAAE,EAAC,GAAG,OAAO,CAAC;IAC9D,MAAM,EAAC,MAAM,GAAG,EAAE,EAAC,GAAG,CAClB,IAAI,CAAC,CAAC,CAAC,IAAA,sBAAa,EAAC,OAA4B,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CACtD,CAAC;IAEjB,MAAM,iBAAiB,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE;QAClE,OAAO;KACV,CAAC,CAAC;IAEH,OAAO;QACH,MAAM,EAAE,iBAAiB;KAC5B,CAAC;AACN,CAAC,CAAC;AAbW,QAAA,kBAAkB,sBAa7B","sourcesContent":["/* eslint-disable no-param-reassign */\n/* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */\nimport {MarkdownItPluginCb} from '@diplodoc/transform/lib/plugins/typings';\nimport cloneDeep from 'lodash/cloneDeep';\nimport shuffle from 'lodash/shuffle';\n\nimport {ConstructorBlock, PageContent} from '../models/constructor';\n\nimport {Transformer} from './common';\nimport {BlocksConfig, config} from './config';\nimport {FilterableContent, filterContent} from './filter';\nimport {Lang} from './types';\n\nexport type ContentVariables = Record<string, string>;\nexport type ContentTransformerProps = {\n content: {\n blocks?: ConstructorBlock[];\n };\n options: {\n lang: Lang;\n customConfig?: {};\n vars?: ContentVariables;\n plugins?: MarkdownItPluginCb[];\n };\n};\n\nfunction transformBlocks(\n blocks: ConstructorBlock[],\n lang: Lang,\n customConfig = {},\n options: {plugins?: MarkdownItPluginCb[]} = {},\n) {\n const fullConfig = {...config, ...customConfig};\n const {plugins = []} = options;\n\n const clonedBlocks = cloneDeep(blocks);\n\n return clonedBlocks.map((block) => transformBlock(lang, fullConfig, block, plugins));\n}\n\nfunction transformBlock(\n lang: Lang,\n blocksConfig: BlocksConfig,\n block: ConstructorBlock,\n plugins: MarkdownItPluginCb[],\n) {\n const blockConfig = blocksConfig[block.type];\n\n if (block) {\n if ('randomOrder' in block && block.randomOrder && 'children' in block && block.children) {\n block.children = shuffle(block.children as ConstructorBlock[]);\n }\n }\n\n if (blockConfig) {\n const configs = Array.isArray(blockConfig) ? blockConfig : [blockConfig];\n\n configs.forEach((transformConfig) => {\n const {fields, transformer: transformerRaw, parser} = transformConfig;\n const transformer: Transformer = (content) =>\n // eslint-disable-next-line no-useless-call\n transformerRaw.call(null, lang, content, {plugins});\n\n if (fields) {\n (fields as (keyof typeof block)[]).forEach((field) => {\n if (block[field]) {\n if (parser) {\n block[field] = parser(transformer, block[field]);\n } else if (typeof block[field] === 'string') {\n block[field] = transformer(block[field] as string);\n }\n }\n });\n } else if (parser) {\n parser(transformer, block);\n }\n });\n }\n\n if ('children' in block && block.children) {\n block.children = transformBlocks(block.children as ConstructorBlock[], lang, blocksConfig, {\n plugins,\n });\n }\n\n return block;\n}\n\nexport const contentTransformer = ({content, options}: ContentTransformerProps) => {\n const {lang, customConfig = {}, vars, plugins = []} = options;\n const {blocks = []} = (\n vars ? filterContent(content as FilterableContent, vars) : content\n ) as PageContent;\n\n const transformedBlocks = transformBlocks(blocks, lang, customConfig, {\n plugins,\n });\n\n return {\n blocks: transformedBlocks,\n };\n};\n"]}
|
|
@@ -5,8 +5,8 @@ exports.getHeaderTag = getHeaderTag;
|
|
|
5
5
|
exports.hasBlockTag = hasBlockTag;
|
|
6
6
|
exports.getBlockKey = getBlockKey;
|
|
7
7
|
const tslib_1 = require("tslib");
|
|
8
|
-
const camelCase_1 = tslib_1.__importDefault(require("lodash/camelCase"));
|
|
9
|
-
const flatten_1 = tslib_1.__importDefault(require("lodash/flatten"));
|
|
8
|
+
const camelCase_1 = tslib_1.__importDefault(require("lodash/camelCase.js"));
|
|
9
|
+
const flatten_1 = tslib_1.__importDefault(require("lodash/flatten.js"));
|
|
10
10
|
const models_1 = require("../models/index.js");
|
|
11
11
|
const BLOCK_ELEMENTS = [
|
|
12
12
|
'div',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.js","sourceRoot":"../../../src","sources":["utils/blocks.ts"],"names":[],"mappings":";;;AA8CA,oCAYC;AAED,kCAGC;AAED,kCAEC;;AAnED,
|
|
1
|
+
{"version":3,"file":"blocks.js","sourceRoot":"../../../src","sources":["utils/blocks.ts"],"names":[],"mappings":";;;AA8CA,oCAYC;AAED,kCAGC;AAED,kCAEC;;AAnED,4EAAyC;AACzC,wEAAqC;AAErC,+CAAyF;AAEzF,MAAM,cAAc,GAAG;IACnB,KAAK;IACL,GAAG;IACH,QAAQ;IACR,SAAS;IACT,SAAS;IACT,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,KAAK;IACL,SAAS;IACT,OAAO;IACP,KAAK;IACL,QAAQ;IACR,MAAM;IACN,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,IAAI;CACP,CAAC;AAEF,MAAM,oBAAoB,GAAG,KAAK,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;AAEpE,MAAM,kBAAkB,GAAG,CAAC,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AAE7F,SAAgB,YAAY,CAAC,IAAc;IACvC,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,GAAG;YACJ,OAAO,IAAI,CAAC;QAChB,KAAK,GAAG;YAC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kCAAkC,EAAE;gBAC7D,GAAG;gBACH,IAAI,EAAE,KAAK;aACd,CAAC,CAAC;QACP,KAAK,6BAAoB,CAAC,EAAE;YACxB,OAAO,qBAAqB,CAAC,0BAA0B,EAAE;gBACrD,GAAG;gBACH,KAAK;gBACL,OAAO,EAAE,IAAI;aAChB,CAAC,CAAC;QACP,KAAK,6BAAoB,CAAC,QAAQ;YAC9B,OAAO,qBAAqB,CAAC,iDAAiD,EAAE;gBAC5E,GAAG;aACN,CAAC,CAAC;QACP;YACI,sCAAsC;YACtC,OAAO,CAAC,KAAK,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC;YAE7C,OAAO,SAAS,CAAC;IACzB,CAAC;AACL,CAAC,CAAC;AAjCW,QAAA,YAAY,gBAiCvB;AAEK,MAAM,eAAe,GAAG,CAAC,EAAW,EAAE,GAAG,UAAsC,EAAE,EAAE;IACtF,MAAM,UAAU,GAA2B,EAAE,CAAC;IAE9C,IAAI,EAAE,EAAE,CAAC;QACL,MAAM,IAAI,GAAG,kBAAkB,CAAC,MAAM,CAAC,IAAA,iBAAO,EAAC,UAAU,CAAC,CAAC,CAAC;QAE5D,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACjB,UAAU,CAAC,IAAA,mBAAS,EAAC,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,IAAI,GAAG,EAAE,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,UAAU,CAAC,OAAO,GAAG,EAAE,CAAC;IAC5B,CAAC;IAED,OAAO,UAAU,CAAC;AACtB,CAAC,CAAC;AAdW,QAAA,eAAe,mBAc1B","sourcesContent":["import camelCase from 'lodash/camelCase';\nimport flatten from 'lodash/flatten';\n\nimport {ConstructorBlock, CustomConfig, PCShareSocialNetwork, TextSize} from '../models';\n\nconst BLOCK_ELEMENTS = [\n 'div',\n 'p',\n 'h[1-6]',\n 'address',\n 'article',\n 'aside',\n 'blockquote',\n 'canvas',\n 'dd',\n 'dl',\n 'dt',\n 'fieldset',\n 'figcaption',\n 'footer',\n 'header',\n 'hr',\n 'main',\n 'nav',\n 'section',\n 'video',\n 'pre',\n 'figure',\n 'form',\n 'pre',\n 'ol',\n 'ul',\n 'li',\n 'table',\n 'thead',\n 'tbody',\n 'tfoot',\n 'tr',\n 'th',\n 'td',\n];\n\nconst BLOCK_ELEMENTS_REGEX = `<(${BLOCK_ELEMENTS.join('|')})[^>]*>`;\n\nconst QA_ATTRIBUTES_KEYS = ['container', 'content', 'wrapper', 'image', 'button', 'animate'];\n\nexport function getHeaderTag(size: TextSize) {\n switch (size) {\n case 'l':\n return 'h1';\n case 's':\n return 'h3';\n case 'xs':\n return 'h4';\n case 'm':\n default:\n return 'h2';\n }\n}\n\nexport function hasBlockTag(content: string): boolean {\n const regex = new RegExp(BLOCK_ELEMENTS_REGEX, 'g');\n return regex.test(content);\n}\n\nexport function getBlockKey(block: ConstructorBlock, index: number) {\n return `${block.type}-${index}`;\n}\n\nexport const getCustomItems = (types: (keyof CustomConfig)[], customBlocks: CustomConfig = {}) => {\n return types.reduce((result, type: keyof CustomConfig) => {\n return Object.assign(result, customBlocks[type] || {});\n }, {});\n};\n\nexport const getCustomTypes = (types: (keyof CustomConfig)[], customBlocks: CustomConfig = {}) => {\n return types.reduce((result, type: keyof CustomConfig) => {\n return result.concat(Object.keys(customBlocks[type] || {}));\n }, [] as string[]);\n};\n\nconst getShareUrlWithParams = (url: string, params: Record<string, string | undefined> = {}) => {\n const result = new URL(url);\n\n Object.entries(params).forEach(([name, value]) => {\n if (value) {\n result.searchParams.set(name, value);\n }\n });\n\n return result.toString();\n};\n\nexport const getOrderedBlocks = (blocks: ConstructorBlock[], headerBlockTypes: string[] = []) => {\n return blocks.filter(({type}) => !headerBlockTypes.includes(type));\n};\n\nexport const getHeaderBlock = (blocks: ConstructorBlock[], headerBlockTypes: string[] = []) => {\n return blocks.find(({type}) => headerBlockTypes.includes(type));\n};\n\nexport const getShareLink = (\n url: string,\n type: PCShareSocialNetwork,\n title?: string,\n text?: string,\n) => {\n // https://github.com/bradvin/social-share-urls\n switch (type) {\n case PCShareSocialNetwork.Telegram:\n return getShareUrlWithParams('https://t.me/share/url', {url, text: title});\n case PCShareSocialNetwork.Facebook:\n return getShareUrlWithParams('https://facebook.com/sharer.php', {u: url});\n case PCShareSocialNetwork.Twitter:\n return getShareUrlWithParams('https://twitter.com/intent/tweet', {\n url,\n text: title,\n });\n case PCShareSocialNetwork.Vk:\n return getShareUrlWithParams('https://vk.com/share.php', {\n url,\n title,\n comment: text,\n });\n case PCShareSocialNetwork.LinkedIn:\n return getShareUrlWithParams('https://www.linkedin.com/sharing/share-offsite/', {\n url,\n });\n default:\n // eslint-disable-next-line no-console\n console.error(`Unknown share type: ${type}`);\n\n return undefined;\n }\n};\n\nexport const getQaAttrubutes = (qa?: string, ...customKeys: (string | Array<string>)[]) => {\n const attributes: Record<string, string> = {};\n\n if (qa) {\n const keys = QA_ATTRIBUTES_KEYS.concat(flatten(customKeys));\n\n keys.forEach((key) => {\n attributes[camelCase(key)] = `${qa}-${key}`;\n });\n\n attributes.default = qa;\n }\n\n return attributes;\n};\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import isEmpty from
|
|
4
|
+
import isEmpty from "lodash/isEmpty.js";
|
|
5
5
|
import { AnimateBlock, BackgroundImage, Title } from "../../components/index.js";
|
|
6
6
|
import { useTheme } from "../../context/theme/index.js";
|
|
7
7
|
import { Col, Row } from "../../grid/index.js";
|