@gravity-ui/page-constructor 6.3.2-alpha.3 → 6.3.2-alpha.6
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/README.md +98 -10
- package/build/cjs/blocks/FoldableList/FoldableList.css +13 -0
- package/build/cjs/blocks/FoldableList/FoldableList.d.ts +3 -0
- package/build/cjs/blocks/FoldableList/FoldableList.js +31 -0
- package/build/cjs/blocks/FoldableList/FoldableList.js.map +1 -0
- package/build/cjs/blocks/FoldableList/FoldableListBlockItem/FoldableListBlockItem.css +78 -0
- package/build/cjs/blocks/FoldableList/FoldableListBlockItem/FoldableListBlockItem.d.ts +2 -0
- package/build/cjs/blocks/FoldableList/FoldableListBlockItem/FoldableListBlockItem.js +20 -0
- package/build/cjs/blocks/FoldableList/FoldableListBlockItem/FoldableListBlockItem.js.map +1 -0
- package/build/cjs/blocks/FoldableList/schema.d.ts +140 -0
- package/build/cjs/blocks/FoldableList/schema.js +39 -0
- package/build/cjs/blocks/FoldableList/schema.js.map +1 -0
- package/build/cjs/blocks/Header/Header.css +12 -1
- package/build/cjs/blocks/Header/Header.js +4 -1
- package/build/cjs/blocks/Header/Header.js.map +1 -1
- package/build/cjs/blocks/Header/schema.d.ts +10 -0
- package/build/cjs/blocks/Header/schema.js +5 -0
- package/build/cjs/blocks/Header/schema.js.map +1 -1
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +5 -0
- package/build/cjs/blocks/Slider/Slider.js +4 -1
- package/build/cjs/blocks/Slider/Slider.js.map +1 -1
- package/build/cjs/blocks/index.d.ts +1 -0
- package/build/cjs/blocks/index.js +3 -1
- package/build/cjs/blocks/index.js.map +1 -1
- package/build/cjs/common/store.d.ts +1 -0
- package/build/cjs/common/store.js +1 -0
- package/build/cjs/common/store.js.map +1 -1
- package/build/cjs/common/types/forms.d.ts +12 -1
- package/build/cjs/common/types/forms.js.map +1 -1
- package/build/cjs/components/FullscreenImage/FullscreenImage.css +1 -1
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +4 -1
- package/build/cjs/components/ReactPlayer/ReactPlayer.js.map +1 -1
- package/build/cjs/constructor-items.d.ts +1 -0
- package/build/cjs/constructor-items.js +4 -4
- package/build/cjs/constructor-items.js.map +1 -1
- package/build/cjs/containers/PageConstructor/PageConstructor.js +18 -1
- package/build/cjs/containers/PageConstructor/PageConstructor.js.map +1 -1
- package/build/cjs/editor-v2/components/DynamicForm/DynamicForm.js +8 -1
- package/build/cjs/editor-v2/components/DynamicForm/DynamicForm.js.map +1 -1
- package/build/cjs/editor-v2/components/DynamicForm/FieldBase/FieldBase.css +8 -6
- package/build/cjs/editor-v2/components/DynamicForm/FieldBase/FieldBase.js +7 -3
- package/build/cjs/editor-v2/components/DynamicForm/FieldBase/FieldBase.js.map +1 -1
- package/build/cjs/editor-v2/components/DynamicForm/Fields/AnyOf/AnyOf.css +6 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/AnyOf/AnyOf.d.ts +9 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/AnyOf/AnyOf.js +35 -0
- package/build/cjs/editor-v2/components/DynamicForm/Fields/AnyOf/AnyOf.js.map +1 -0
- package/build/cjs/editor-v2/containers/BlockConfigForm/BlockConfigForm.css +2 -2
- package/build/cjs/editor-v2/containers/Editor/Editor.d.ts +1 -0
- package/build/cjs/editor-v2/containers/Editor/Editor.js +2 -2
- package/build/cjs/editor-v2/containers/Editor/Editor.js.map +1 -1
- package/build/cjs/editor-v2/containers/MiddleScreen/MiddleScreen.css +40 -1
- package/build/cjs/editor-v2/containers/MiddleScreen/MiddleScreen.js +9 -6
- package/build/cjs/editor-v2/containers/MiddleScreen/MiddleScreen.js.map +1 -1
- package/build/cjs/editor-v2/containers/Overlay/Overlay.css +12 -9
- package/build/cjs/editor-v2/containers/Overlay/Overlay.js +1 -1
- package/build/cjs/editor-v2/containers/Overlay/Overlay.js.map +1 -1
- package/build/cjs/editor-v2/containers/SourceCode/SourceCode.d.ts +2 -1
- package/build/cjs/editor-v2/containers/SourceCode/SourceCode.js +26 -4
- package/build/cjs/editor-v2/containers/SourceCode/SourceCode.js.map +1 -1
- package/build/cjs/editor-v2/containers/ViewSwitches/ViewSwitches.js +2 -2
- package/build/cjs/editor-v2/containers/ViewSwitches/ViewSwitches.js.map +1 -1
- package/build/cjs/editor-v2/hooks/useEditorTabs.js +2 -2
- package/build/cjs/editor-v2/hooks/useEditorTabs.js.map +1 -1
- package/build/cjs/editor-v2/hooks/useMainEditorInitialize.d.ts +2 -1
- package/build/cjs/editor-v2/hooks/useMainEditorInitialize.js +12 -2
- package/build/cjs/editor-v2/hooks/useMainEditorInitialize.js.map +1 -1
- package/build/cjs/editor-v2/store.d.ts +1 -0
- package/build/cjs/editor-v2/store.js +3 -0
- package/build/cjs/editor-v2/store.js.map +1 -1
- package/build/cjs/editor-v2/styles/root.css +3 -3
- package/build/cjs/hooks/usePCEditorBlockMouseEvents.d.ts +1 -0
- package/build/cjs/hooks/usePCEditorBlockMouseEvents.js +1 -0
- package/build/cjs/hooks/usePCEditorBlockMouseEvents.js.map +1 -1
- package/build/cjs/hooks/usePCEditorItemWrap.d.ts +1 -0
- package/build/cjs/internal-typings/global.d.ts +1 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +19 -1
- package/build/cjs/models/constructor-items/blocks.js +1 -0
- package/build/cjs/models/constructor-items/blocks.js.map +1 -1
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +2 -1
- package/build/cjs/models/constructor-items/sub-blocks.js.map +1 -1
- package/build/cjs/navigation/schema.d.ts +2 -0
- package/build/cjs/navigation/schema.js +12 -3
- package/build/cjs/navigation/schema.js.map +1 -1
- package/build/cjs/schema/constants.js +1 -0
- package/build/cjs/schema/constants.js.map +1 -1
- package/build/cjs/schema/index.d.ts +2 -0
- package/build/cjs/schema/validators/blocks.d.ts +1 -0
- package/build/cjs/schema/validators/blocks.js +1 -0
- package/build/cjs/schema/validators/blocks.js.map +1 -1
- package/build/cjs/sub-blocks/HubspotForm/HubspotFormContainer.d.ts +1 -1
- package/build/cjs/sub-blocks/HubspotForm/HubspotFormContainer.js +5 -1
- package/build/cjs/sub-blocks/HubspotForm/HubspotFormContainer.js.map +1 -1
- package/build/cjs/sub-blocks/HubspotForm/index.js +2 -2
- package/build/cjs/sub-blocks/HubspotForm/index.js.map +1 -1
- package/build/cjs/sub-blocks/HubspotForm/setHubspotDefaultValues.d.ts +2 -0
- package/build/cjs/sub-blocks/HubspotForm/setHubspotDefaultValues.js +51 -0
- package/build/cjs/sub-blocks/HubspotForm/setHubspotDefaultValues.js.map +1 -0
- package/build/cjs/text-transform/config.js +25 -1
- package/build/cjs/text-transform/config.js.map +1 -1
- package/build/cjs/utils/form-generator.js +27 -0
- package/build/cjs/utils/form-generator.js.map +1 -1
- package/build/cjs/utils/hubspot.d.ts +1 -0
- package/build/cjs/utils/hubspot.js.map +1 -1
- package/build/esm/blocks/FoldableList/FoldableList.css +13 -0
- package/build/esm/blocks/FoldableList/FoldableList.d.ts +4 -0
- package/build/esm/blocks/FoldableList/FoldableList.js +29 -0
- package/build/esm/blocks/FoldableList/FoldableList.js.map +1 -0
- package/build/esm/blocks/FoldableList/FoldableListBlockItem/FoldableListBlockItem.css +78 -0
- package/build/esm/blocks/FoldableList/FoldableListBlockItem/FoldableListBlockItem.d.ts +3 -0
- package/build/esm/blocks/FoldableList/FoldableListBlockItem/FoldableListBlockItem.js +16 -0
- package/build/esm/blocks/FoldableList/FoldableListBlockItem/FoldableListBlockItem.js.map +1 -0
- package/build/esm/blocks/FoldableList/schema.d.ts +140 -0
- package/build/esm/blocks/FoldableList/schema.js +35 -0
- package/build/esm/blocks/FoldableList/schema.js.map +1 -0
- package/build/esm/blocks/Header/Header.css +12 -1
- package/build/esm/blocks/Header/Header.js +4 -1
- package/build/esm/blocks/Header/Header.js.map +1 -1
- package/build/esm/blocks/Header/schema.d.ts +10 -0
- package/build/esm/blocks/Header/schema.js +5 -0
- package/build/esm/blocks/Header/schema.js.map +1 -1
- package/build/esm/blocks/HeaderSlider/schema.d.ts +5 -0
- package/build/esm/blocks/Slider/Slider.js +4 -1
- package/build/esm/blocks/Slider/Slider.js.map +1 -1
- package/build/esm/blocks/index.d.ts +1 -0
- package/build/esm/blocks/index.js +1 -0
- package/build/esm/blocks/index.js.map +1 -1
- package/build/esm/common/store.d.ts +1 -0
- package/build/esm/common/store.js +1 -0
- package/build/esm/common/store.js.map +1 -1
- package/build/esm/common/types/forms.d.ts +12 -1
- package/build/esm/common/types/forms.js.map +1 -1
- package/build/esm/components/FullscreenImage/FullscreenImage.css +1 -1
- package/build/esm/components/ReactPlayer/ReactPlayer.js +4 -1
- package/build/esm/components/ReactPlayer/ReactPlayer.js.map +1 -1
- package/build/esm/constructor-items.d.ts +1 -0
- package/build/esm/constructor-items.js +5 -5
- package/build/esm/constructor-items.js.map +1 -1
- package/build/esm/containers/PageConstructor/PageConstructor.js +18 -1
- package/build/esm/containers/PageConstructor/PageConstructor.js.map +1 -1
- package/build/esm/editor-v2/components/DynamicForm/DynamicForm.js +8 -1
- package/build/esm/editor-v2/components/DynamicForm/DynamicForm.js.map +1 -1
- package/build/esm/editor-v2/components/DynamicForm/FieldBase/FieldBase.css +8 -6
- package/build/esm/editor-v2/components/DynamicForm/FieldBase/FieldBase.js +8 -4
- package/build/esm/editor-v2/components/DynamicForm/FieldBase/FieldBase.js.map +1 -1
- package/build/esm/editor-v2/components/DynamicForm/Fields/AnyOf/AnyOf.css +6 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/AnyOf/AnyOf.d.ts +10 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/AnyOf/AnyOf.js +33 -0
- package/build/esm/editor-v2/components/DynamicForm/Fields/AnyOf/AnyOf.js.map +1 -0
- package/build/esm/editor-v2/containers/BlockConfigForm/BlockConfigForm.css +2 -2
- package/build/esm/editor-v2/containers/Editor/Editor.d.ts +1 -0
- package/build/esm/editor-v2/containers/Editor/Editor.js +2 -2
- package/build/esm/editor-v2/containers/Editor/Editor.js.map +1 -1
- package/build/esm/editor-v2/containers/MiddleScreen/MiddleScreen.css +40 -1
- package/build/esm/editor-v2/containers/MiddleScreen/MiddleScreen.js +10 -7
- package/build/esm/editor-v2/containers/MiddleScreen/MiddleScreen.js.map +1 -1
- package/build/esm/editor-v2/containers/Overlay/Overlay.css +12 -9
- package/build/esm/editor-v2/containers/Overlay/Overlay.js +1 -1
- package/build/esm/editor-v2/containers/Overlay/Overlay.js.map +1 -1
- package/build/esm/editor-v2/containers/SourceCode/SourceCode.d.ts +2 -1
- package/build/esm/editor-v2/containers/SourceCode/SourceCode.js +26 -4
- package/build/esm/editor-v2/containers/SourceCode/SourceCode.js.map +1 -1
- package/build/esm/editor-v2/containers/ViewSwitches/ViewSwitches.js +3 -3
- package/build/esm/editor-v2/containers/ViewSwitches/ViewSwitches.js.map +1 -1
- package/build/esm/editor-v2/hooks/useEditorTabs.js +2 -2
- package/build/esm/editor-v2/hooks/useEditorTabs.js.map +1 -1
- package/build/esm/editor-v2/hooks/useMainEditorInitialize.d.ts +2 -1
- package/build/esm/editor-v2/hooks/useMainEditorInitialize.js +11 -2
- package/build/esm/editor-v2/hooks/useMainEditorInitialize.js.map +1 -1
- package/build/esm/editor-v2/store.d.ts +1 -0
- package/build/esm/editor-v2/store.js +3 -0
- package/build/esm/editor-v2/store.js.map +1 -1
- package/build/esm/editor-v2/styles/root.css +3 -3
- package/build/esm/hooks/usePCEditorBlockMouseEvents.d.ts +1 -0
- package/build/esm/hooks/usePCEditorBlockMouseEvents.js +1 -0
- package/build/esm/hooks/usePCEditorBlockMouseEvents.js.map +1 -1
- package/build/esm/hooks/usePCEditorItemWrap.d.ts +1 -0
- package/build/esm/internal-typings/global.d.ts +1 -0
- package/build/esm/models/constructor-items/blocks.d.ts +19 -1
- package/build/esm/models/constructor-items/blocks.js +1 -0
- package/build/esm/models/constructor-items/blocks.js.map +1 -1
- package/build/esm/models/constructor-items/sub-blocks.d.ts +2 -1
- package/build/esm/models/constructor-items/sub-blocks.js.map +1 -1
- package/build/esm/navigation/schema.d.ts +2 -0
- package/build/esm/navigation/schema.js +12 -3
- package/build/esm/navigation/schema.js.map +1 -1
- package/build/esm/schema/constants.js +2 -1
- package/build/esm/schema/constants.js.map +1 -1
- package/build/esm/schema/index.d.ts +2 -0
- package/build/esm/schema/validators/blocks.d.ts +1 -0
- package/build/esm/schema/validators/blocks.js +1 -0
- package/build/esm/schema/validators/blocks.js.map +1 -1
- package/build/esm/sub-blocks/HubspotForm/HubspotFormContainer.d.ts +1 -1
- package/build/esm/sub-blocks/HubspotForm/HubspotFormContainer.js +5 -1
- package/build/esm/sub-blocks/HubspotForm/HubspotFormContainer.js.map +1 -1
- package/build/esm/sub-blocks/HubspotForm/index.js +2 -2
- package/build/esm/sub-blocks/HubspotForm/index.js.map +1 -1
- package/build/esm/sub-blocks/HubspotForm/setHubspotDefaultValues.d.ts +2 -0
- package/build/esm/sub-blocks/HubspotForm/setHubspotDefaultValues.js +47 -0
- package/build/esm/sub-blocks/HubspotForm/setHubspotDefaultValues.js.map +1 -0
- package/build/esm/text-transform/config.js +25 -1
- package/build/esm/text-transform/config.js.map +1 -1
- package/build/esm/utils/form-generator.js +27 -0
- package/build/esm/utils/form-generator.js.map +1 -1
- package/build/esm/utils/hubspot.d.ts +1 -0
- package/build/esm/utils/hubspot.js.map +1 -1
- package/package.json +13 -15
- package/schema/index.js +1 -1
- package/server/models/constructor-items/blocks.d.ts +19 -1
- package/server/models/constructor-items/blocks.js +1 -0
- package/server/models/constructor-items/sub-blocks.d.ts +2 -1
- package/server/text-transform/config.js +25 -1
- package/server/utils/hubspot.d.ts +1 -0
- package/widget/{5287.index.js → 1092.index.js} +1 -1
- package/widget/{8092.index.js → 1130.index.js} +1 -1
- package/widget/1219.index.js +1 -0
- package/widget/{2390.index.js → 122.index.js} +1 -1
- package/widget/{6817.index.js → 1289.index.js} +1 -1
- package/widget/{2921.index.js → 1335.index.js} +1 -1
- package/widget/{1876.index.js → 1340.index.js} +1 -1
- package/widget/{3901.index.js → 1349.index.js} +1 -1
- package/widget/1532.index.js +1 -0
- package/widget/{2957.index.js → 1750.index.js} +1 -1
- package/widget/{5105.index.js → 1995.index.js} +1 -1
- package/widget/{5418.index.js → 2010.index.js} +1 -1
- package/widget/{9517.index.js → 2026.index.js} +1 -1
- package/widget/{1794.index.js → 2187.index.js} +1 -1
- package/widget/{7548.index.js → 2218.index.js} +1 -1
- package/widget/225.index.js +1 -0
- package/widget/2338.index.js +1 -0
- package/widget/{4653.index.js → 2355.index.js} +1 -1
- package/widget/{5001.index.js → 2369.index.js} +1 -1
- package/widget/{4127.index.js → 2487.index.js} +1 -1
- package/widget/{6165.index.js → 2498.index.js} +1 -1
- package/widget/{5254.index.js → 2509.index.js} +1 -1
- package/widget/2544.index.js +1 -1
- package/widget/2619.index.js +1 -0
- package/widget/{5941.index.js → 2673.index.js} +1 -1
- package/widget/{4717.index.js → 2698.index.js} +1 -1
- package/widget/{7427.index.js → 2706.index.js} +1 -1
- package/widget/{8602.index.js → 2739.index.js} +1 -1
- package/widget/2745.index.js +1 -0
- package/widget/2796.index.js +1 -0
- package/widget/{7573.index.js → 2830.index.js} +1 -1
- package/widget/{3237.index.js → 2878.index.js} +1 -1
- package/widget/292.index.js +1 -0
- package/widget/2979.index.js +1 -0
- package/widget/3187.index.js +1 -0
- package/widget/321.index.js +1 -0
- package/widget/{5437.index.js → 3222.index.js} +1 -1
- package/widget/{1987.index.js → 3225.index.js} +1 -1
- package/widget/{7719.index.js → 3309.index.js} +1 -1
- package/widget/{4254.index.js → 3433.index.js} +1 -1
- package/widget/{2722.index.js → 3473.index.js} +1 -1
- package/widget/3532.index.js +1 -0
- package/widget/3562.index.js +1 -0
- package/widget/{6148.index.js → 3672.index.js} +1 -1
- package/widget/{4990.index.js → 3713.index.js} +1 -1
- package/widget/{8894.index.js → 3860.index.js} +1 -1
- package/widget/{5551.index.js → 3900.index.js} +1 -1
- package/widget/{6629.index.js → 4007.index.js} +1 -1
- package/widget/{7467.index.js → 4061.index.js} +1 -1
- package/widget/{5423.index.js → 4072.index.js} +1 -1
- package/widget/{4144.index.js → 4173.index.js} +1 -1
- package/widget/4288.index.js +1 -0
- package/widget/{8242.index.js → 4309.index.js} +1 -1
- package/widget/{8146.index.js → 4334.index.js} +1 -1
- package/widget/{9339.index.js → 4405.index.js} +1 -1
- package/widget/4457.index.js +1 -0
- package/widget/{8768.index.js → 4485.index.js} +1 -1
- package/widget/4509.index.js +1 -0
- package/widget/{4067.index.js → 4608.index.js} +1 -1
- package/widget/465.index.js +1 -0
- package/widget/{7118.index.js → 4719.index.js} +1 -1
- package/widget/4734.index.js +1 -0
- package/widget/4780.index.js +1 -0
- package/widget/4895.index.js +1 -0
- package/widget/{790.index.js → 494.index.js} +1 -1
- package/widget/5012.index.js +1 -0
- package/widget/{4722.index.js → 5084.index.js} +1 -1
- package/widget/5285.index.js +1 -0
- package/widget/5376.index.js +1 -0
- package/widget/539.index.js +1 -0
- package/widget/5414.index.js +1 -0
- package/widget/{8980.index.js → 5513.index.js} +1 -1
- package/widget/5530.index.js +1 -0
- package/widget/5571.index.js +1 -0
- package/widget/{8540.index.js → 5592.index.js} +1 -1
- package/widget/5616.index.js +1 -0
- package/widget/{5903.index.js → 5662.index.js} +1 -1
- package/widget/{7109.index.js → 5665.index.js} +1 -1
- package/widget/{8792.index.js → 5681.index.js} +1 -1
- package/widget/5760.index.js +1 -0
- package/widget/{6257.index.js → 5811.index.js} +1 -1
- package/widget/{5054.index.js → 5826.index.js} +1 -1
- package/widget/{1560.index.js → 5877.index.js} +1 -1
- package/widget/{9149.index.js → 5944.index.js} +1 -1
- package/widget/{8341.index.js → 5977.index.js} +1 -1
- package/widget/{3646.index.js → 5993.index.js} +1 -1
- package/widget/{2009.index.js → 6007.index.js} +1 -1
- package/widget/{3852.index.js → 6033.index.js} +1 -1
- package/widget/{5567.index.js → 6101.index.js} +1 -1
- package/widget/623.index.js +1 -0
- package/widget/{7989.index.js → 6290.index.js} +1 -1
- package/widget/6364.index.js +1 -0
- package/widget/{7387.index.js → 6400.index.js} +1 -1
- package/widget/{5473.index.js → 6462.index.js} +1 -1
- package/widget/6467.index.js +1 -0
- package/widget/{6622.index.js → 6481.index.js} +1 -1
- package/widget/{4888.index.js → 6605.index.js} +1 -1
- package/widget/{2966.index.js → 6803.index.js} +1 -1
- package/widget/{5627.index.js → 6847.index.js} +1 -1
- package/widget/{2019.index.js → 7081.index.js} +1 -1
- package/widget/7205.index.js +1 -0
- package/widget/{5596.index.js → 7250.index.js} +1 -1
- package/widget/{7763.index.js → 7317.index.js} +1 -1
- package/widget/7329.index.js +1 -0
- package/widget/{5159.index.js → 7406.index.js} +1 -1
- package/widget/{7632.index.js → 7409.index.js} +1 -1
- package/widget/{3783.index.js → 7420.index.js} +1 -1
- package/widget/{7101.index.js → 7439.index.js} +1 -1
- package/widget/{9197.index.js → 7674.index.js} +1 -1
- package/widget/{5805.index.js → 7690.index.js} +1 -1
- package/widget/{2641.index.js → 7741.index.js} +1 -1
- package/widget/{4724.index.js → 7933.index.js} +1 -1
- package/widget/{9132.index.js → 8003.index.js} +1 -1
- package/widget/813.index.js +1 -0
- package/widget/{6513.index.js → 8142.index.js} +1 -1
- package/widget/{8562.index.js → 8298.index.js} +1 -1
- package/widget/{7200.index.js → 8361.index.js} +1 -1
- package/widget/{4855.index.js → 8418.index.js} +1 -1
- package/widget/860.index.js +1 -0
- package/widget/{1796.index.js → 8615.index.js} +1 -1
- package/widget/{6312.index.js → 8660.index.js} +1 -1
- package/widget/880.index.js +1 -0
- package/widget/8804.index.js +1 -0
- package/widget/8809.index.js +1 -0
- package/widget/{9157.index.js → 8928.index.js} +1 -1
- package/widget/912.index.js +1 -0
- package/widget/9160.index.js +1 -0
- package/widget/{5914.index.js → 9252.index.js} +1 -1
- package/widget/{3706.index.js → 9286.index.js} +1 -1
- package/widget/{2502.index.js → 9294.index.js} +1 -1
- package/widget/{9182.index.js → 9423.index.js} +1 -1
- package/widget/{8477.index.js → 9464.index.js} +1 -1
- package/widget/950.index.js +1 -0
- package/widget/952.index.js +1 -0
- package/widget/9677.index.js +1 -0
- package/widget/9751.index.js +1 -0
- package/widget/{3220.index.js → 9836.index.js} +1 -1
- package/widget/{2376.index.js → 9865.index.js} +1 -1
- package/widget/{5109.index.js → 9881.index.js} +1 -1
- package/widget/9911.index.js +1 -1
- package/widget/{7822.index.js → 9964.index.js} +1 -1
- package/widget/{9091.index.js → 9990.index.js} +1 -1
- package/widget/9998.index.js +1 -0
- package/widget/index.js +1 -1
- package/widget/1113.index.js +0 -1
- package/widget/123.index.js +0 -1
- package/widget/1573.index.js +0 -1
- package/widget/2030.index.js +0 -1
- package/widget/229.index.js +0 -1
- package/widget/261.index.js +0 -1
- package/widget/302.index.js +0 -1
- package/widget/3035.index.js +0 -1
- package/widget/313.index.js +0 -1
- package/widget/3521.index.js +0 -1
- package/widget/3864.index.js +0 -1
- package/widget/3939.index.js +0 -1
- package/widget/4017.index.js +0 -1
- package/widget/4149.index.js +0 -1
- package/widget/4502.index.js +0 -1
- package/widget/466.index.js +0 -1
- package/widget/504.index.js +0 -1
- package/widget/5321.index.js +0 -1
- package/widget/5742.index.js +0 -1
- package/widget/5817.index.js +0 -1
- package/widget/600.index.js +0 -1
- package/widget/6023.index.js +0 -1
- package/widget/6159.index.js +0 -1
- package/widget/617.index.js +0 -1
- package/widget/6183.index.js +0 -1
- package/widget/6509.index.js +0 -1
- package/widget/6636.index.js +0 -1
- package/widget/6831.index.js +0 -1
- package/widget/6953.index.js +0 -1
- package/widget/7296.index.js +0 -1
- package/widget/7486.index.js +0 -1
- package/widget/7496.index.js +0 -1
- package/widget/7553.index.js +0 -1
- package/widget/758.index.js +0 -1
- package/widget/772.index.js +0 -1
- package/widget/7797.index.js +0 -1
- package/widget/8066.index.js +0 -1
- package/widget/8507.index.js +0 -1
- package/widget/8529.index.js +0 -1
- package/widget/8727.index.js +0 -1
- package/widget/8864.index.js +0 -1
- package/widget/8889.index.js +0 -1
- package/widget/953.index.js +0 -1
- package/widget/9670.index.js +0 -1
- package/widget/9682.index.js +0 -1
- package/widget/9928.index.js +0 -1
|
@@ -10,6 +10,7 @@ export declare enum BlockType {
|
|
|
10
10
|
ExtendedFeaturesBlock = "extended-features-block",
|
|
11
11
|
SliderBlock = "slider-block",
|
|
12
12
|
QuestionsBlock = "questions-block",
|
|
13
|
+
FoldableListBlock = "foldable-list-block",
|
|
13
14
|
BannerBlock = "banner-block",
|
|
14
15
|
CompaniesBlock = "companies-block",
|
|
15
16
|
MediaBlock = "media-block",
|
|
@@ -112,6 +113,7 @@ export interface HeaderBlockProps {
|
|
|
112
113
|
title: string;
|
|
113
114
|
overtitle?: string | JSX.Element;
|
|
114
115
|
description?: string;
|
|
116
|
+
additionalInfo?: string;
|
|
115
117
|
buttons?: Pick<ButtonProps, 'url' | 'text' | 'theme' | 'primary' | 'size' | 'extraProps'>[];
|
|
116
118
|
width?: HeaderWidth;
|
|
117
119
|
/** @deprecated imageSize now depends on width */
|
|
@@ -170,6 +172,19 @@ export interface QuestionBlockItemProps extends QuestionItem {
|
|
|
170
172
|
isOpened: boolean;
|
|
171
173
|
onClick: () => void;
|
|
172
174
|
}
|
|
175
|
+
export interface FoldableListItem {
|
|
176
|
+
title: string;
|
|
177
|
+
text: string;
|
|
178
|
+
listStyle?: 'dash' | 'disk';
|
|
179
|
+
link?: LinkProps;
|
|
180
|
+
}
|
|
181
|
+
export interface FoldableListProps extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {
|
|
182
|
+
items: FoldableListItem[];
|
|
183
|
+
}
|
|
184
|
+
export interface FoldableListBlockItemProps extends FoldableListItem {
|
|
185
|
+
isOpened: boolean;
|
|
186
|
+
onClick: () => void;
|
|
187
|
+
}
|
|
173
188
|
export interface BannerBlockProps extends BannerCardProps, Animatable {
|
|
174
189
|
}
|
|
175
190
|
export interface CompaniesBlockProps extends Animatable {
|
|
@@ -369,6 +384,9 @@ export type PromoFeaturesBlockModel = {
|
|
|
369
384
|
export type QuestionsBlockModel = {
|
|
370
385
|
type: BlockType.QuestionsBlock;
|
|
371
386
|
} & QuestionsProps;
|
|
387
|
+
export type FoldableListBlockModel = {
|
|
388
|
+
type: BlockType.FoldableListBlock;
|
|
389
|
+
} & FoldableListProps;
|
|
372
390
|
export type BannerBlockModel = {
|
|
373
391
|
type: BlockType.BannerBlock;
|
|
374
392
|
} & BannerBlockProps;
|
|
@@ -414,7 +432,7 @@ export type FormBlockModel = {
|
|
|
414
432
|
export type SliderNewBlockModel = {
|
|
415
433
|
type: BlockType.SliderNewBlock;
|
|
416
434
|
} & SliderNewProps;
|
|
417
|
-
type BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel | FormBlockModel;
|
|
435
|
+
type BlockModels = SliderBlockModel | ExtendedFeaturesBlockModel | PromoFeaturesBlockModel | QuestionsBlockModel | FoldableListBlockModel | BannerBlockModel | CompaniesBlockModel | MediaBlockModel | MapBlockModel | InfoBlockModel | TableBlockModel | TabsBlockModel | HeaderBlockModel | IconsBlockModel | HeaderSliderBlockModel | CardLayoutBlockModel | ContentLayoutBlockModel | ShareBLockModel | FilterBlockModel | FormBlockModel;
|
|
418
436
|
type UnstableBlockModels = SliderNewBlockModel;
|
|
419
437
|
export type Block = (BlockModels | UnstableBlockModels) & BlockBaseProps;
|
|
420
438
|
export {};
|
|
@@ -7,6 +7,7 @@ var BlockType;
|
|
|
7
7
|
BlockType["ExtendedFeaturesBlock"] = "extended-features-block";
|
|
8
8
|
BlockType["SliderBlock"] = "slider-block";
|
|
9
9
|
BlockType["QuestionsBlock"] = "questions-block";
|
|
10
|
+
BlockType["FoldableListBlock"] = "foldable-list-block";
|
|
10
11
|
BlockType["BannerBlock"] = "banner-block";
|
|
11
12
|
BlockType["CompaniesBlock"] = "companies-block";
|
|
12
13
|
BlockType["MediaBlock"] = "media-block";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":";;;AA2CA,IAAY,SAuBX;AAvBD,WAAY,SAAS;IACjB,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,uCAA0B,CAAA;IAC1B,kDAAqC,CAAA;IACrC,wDAA2C,CAAA;IAC3C,uCAA0B,CAAA;IAC1B,mCAAsB,CAAA;IACtB,yCAA4B,CAAA;IAC5B,qCAAwB,CAAA;IACxB,WAAW;IACX,kDAAqC,CAAA;IACrC,gDAAmC,CAAA;AACvC,CAAC,EAvBW,SAAS,yBAAT,SAAS,QAuBpB;AAEY,QAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACtC,QAAA,gBAAgB,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAgCrF,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC7B,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;AACb,CAAC,EALW,qBAAqB,qCAArB,qBAAqB,QAKhC;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,sCAAwB,CAAA;IACxB,wCAA0B,CAAA;AAC9B,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AA+SD,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,iCAAS,CAAA;IACT,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACzB,CAAC,EANW,oBAAoB,oCAApB,oBAAoB,QAM/B;AAOD,IAAY,kBAGX;AAHD,WAAY,kBAAkB;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 TestEditorBlock = 'test-editor-block',\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"]}
|
|
1
|
+
{"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/blocks.ts"],"names":[],"mappings":";;;AA2CA,IAAY,SAwBX;AAxBD,WAAY,SAAS;IACjB,wDAA2C,CAAA;IAC3C,8DAAiD,CAAA;IACjD,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,+CAAkC,CAAA;IAClC,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,sDAAyC,CAAA;IACzC,yCAA4B,CAAA;IAC5B,uCAA0B,CAAA;IAC1B,kDAAqC,CAAA;IACrC,wDAA2C,CAAA;IAC3C,uCAA0B,CAAA;IAC1B,mCAAsB,CAAA;IACtB,yCAA4B,CAAA;IAC5B,qCAAwB,CAAA;IACxB,WAAW;IACX,kDAAqC,CAAA;IACrC,gDAAmC,CAAA;AACvC,CAAC,EAxBW,SAAS,yBAAT,SAAS,QAwBpB;AAEY,QAAA,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACtC,QAAA,gBAAgB,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;AAgCrF,IAAY,qBAKX;AALD,WAAY,qBAAqB;IAC7B,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;IACT,kCAAS,CAAA;AACb,CAAC,EALW,qBAAqB,qCAArB,qBAAqB,QAKhC;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,sCAAwB,CAAA;IACxB,wCAA0B,CAAA;AAC9B,CAAC,EAHW,UAAU,0BAAV,UAAU,QAGrB;AAiUD,IAAY,oBAMX;AAND,WAAY,oBAAoB;IAC5B,iCAAS,CAAA;IACT,6CAAqB,CAAA;IACrB,2CAAmB,CAAA;IACnB,6CAAqB,CAAA;IACrB,6CAAqB,CAAA;AACzB,CAAC,EANW,oBAAoB,oCAApB,oBAAoB,QAM/B;AAOD,IAAY,kBAGX;AAHD,WAAY,kBAAkB;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 FoldableListBlock = 'foldable-list-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 TestEditorBlock = 'test-editor-block',\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 additionalInfo?: 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 FoldableListItem {\n title: string;\n text: string;\n listStyle?: 'dash' | 'disk';\n link?: LinkProps;\n}\n\nexport interface FoldableListProps\n extends Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme'> {\n items: FoldableListItem[];\n}\n\nexport interface FoldableListBlockItemProps extends FoldableListItem {\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 FoldableListBlockModel = {\n type: BlockType.FoldableListBlock;\n} & FoldableListProps;\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 | FoldableListBlockModel\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,6 +1,6 @@
|
|
|
1
1
|
import { ClassNameProps, QuoteType } from "../index.js";
|
|
2
2
|
import { ThemeSupporting } from "../../utils/index.js";
|
|
3
|
-
import { HubspotEventData, HubspotEventHandlers } from "../../utils/hubspot.js";
|
|
3
|
+
import { HubspotEventData, HubspotEventHandlers, HubspotFormDefaultValues } from "../../utils/hubspot.js";
|
|
4
4
|
import { AnalyticsEventsBase } from "../common.js";
|
|
5
5
|
import { ContentBlockProps } from "./blocks.js";
|
|
6
6
|
import { AuthorItem, ButtonProps, CardBaseProps, CardLayoutProps, ContentTheme, DividerSize, ImageCardMargins, ImageObjectProps, ImageProps, LayoutItemContentMargin, LinkProps, MediaProps, MediaView, PriceDetailedProps, TextTheme, Themable, ThemedImage } from "./common.js";
|
|
@@ -72,6 +72,7 @@ export interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsB
|
|
|
72
72
|
onLoad?: (arg: HubspotEventData) => void;
|
|
73
73
|
hubspotEvents?: string[];
|
|
74
74
|
createDOMElement?: boolean;
|
|
75
|
+
defaultValues?: HubspotFormDefaultValues;
|
|
75
76
|
}
|
|
76
77
|
export interface QuoteProps extends Themable, CardBaseProps {
|
|
77
78
|
text?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sub-blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/sub-blocks.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"sub-blocks.js","sourceRoot":"../../../../src","sources":["models/constructor-items/sub-blocks.ts"],"names":[],"mappings":";;;AA8BA,IAAY,YAoBX;AApBD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf;;OAEG;IACH,gDAAgC,CAAA;IAChC,wCAAwB,CAAA;IACxB,0CAA0B,CAAA;IAC1B,0CAA0B,CAAA;IAC1B,kDAAkC,CAAA;IAClC,wCAAwB,CAAA;IACxB,mCAAmB,CAAA;IACnB,4CAA4B,CAAA;IAC5B;;OAEG;IACH,6BAAa,CAAA;IACb,wCAAwB,CAAA;IACxB,wCAAwB,CAAA;AAC5B,CAAC,EApBW,YAAY,4BAAZ,YAAY,QAoBvB;AAED,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,2BAAW,CAAA;IACX,6BAAa,CAAA;AACjB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAWD,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAEY,QAAA,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC","sourcesContent":["import {ClassNameProps, QuoteType} from '../../models';\nimport {ThemeSupporting} from '../../utils';\nimport {\n HubspotEventData,\n HubspotEventHandlers,\n HubspotFormDefaultValues,\n} from '../../utils/hubspot';\nimport {AnalyticsEventsBase} from '../common';\n\nimport {ContentBlockProps} from './blocks';\nimport {\n AuthorItem,\n ButtonProps,\n CardBaseProps,\n CardLayoutProps,\n ContentTheme,\n DividerSize,\n ImageCardMargins,\n ImageObjectProps,\n ImageProps,\n LayoutItemContentMargin,\n LinkProps,\n MediaProps,\n MediaView,\n PriceDetailedProps,\n TextTheme,\n Themable,\n ThemedImage,\n} from './common';\n\nexport enum SubBlockType {\n Divider = 'divider',\n Quote = 'quote',\n /**\n * @deprecated Will be removed\n */\n PriceDetailed = 'price-detailed',\n MediaCard = 'media-card',\n BannerCard = 'banner-card',\n LayoutItem = 'layout-item',\n BackgroundCard = 'background-card',\n BasicCard = 'basic-card',\n Content = 'content',\n HubspotForm = 'hubspot-form',\n /**\n * @deprecated Will be removed, use BasicCard instead\n */\n Card = 'card',\n PriceCard = 'price-card',\n ImageCard = 'image-card',\n}\n\nexport enum IconPosition {\n Top = 'top',\n Left = 'left',\n}\n\nexport interface PositionedIcon {\n value: ImageProps;\n position?: IconPosition;\n}\n\nexport interface IconWrapperProps {\n icon?: PositionedIcon;\n}\n\nexport enum ImageCardDirection {\n Direct = 'direct',\n Reverse = 'reverse',\n}\n\nexport const SubBlockTypes = Object.values(SubBlockType);\n\nexport interface DividerProps {\n size?: DividerSize;\n border?: boolean;\n}\n\nexport interface HubspotFormProps extends HubspotEventHandlers, AnalyticsEventsBase {\n className?: string;\n theme?: ContentTheme;\n isMobile?: boolean;\n region?: string;\n portalId: string;\n formId: string;\n formInstanceId?: string;\n formClassName?: string;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeLoad?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onBeforeSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onSubmit?: (arg: HubspotEventData) => void;\n\n /**\n * To use this handler for component that is rendered in iframe, set up useLoopBackHubspotEvents hook on top level frame\n */\n onLoad?: (arg: HubspotEventData) => void;\n hubspotEvents?: string[];\n createDOMElement?: boolean;\n defaultValues?: HubspotFormDefaultValues;\n}\n\n//cards\nexport interface QuoteProps extends Themable, CardBaseProps {\n text?: string;\n // for backward compatibility, yfmText will become property 'text' in major\n yfmText?: string;\n image: ThemedImage;\n logo: ThemeSupporting<ImageProps>;\n color?: string;\n /**\n * @deprecated use property button instead\n */\n url?: string;\n /**\n * @deprecated use property button instead\n */\n urlTitle?: string;\n author?: AuthorItem;\n /**\n * @deprecated use property button instead\n */\n buttonText?: string;\n theme?: TextTheme;\n quoteType?: QuoteType;\n button?: ButtonProps;\n}\n\nexport interface BackgroundCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'controlPosition'> {\n url?: string;\n urlTitle?: string;\n background?: ThemeSupporting<ImageObjectProps>;\n paddingBottom?: 's' | 'm' | 'l' | 'xl';\n backgroundColor?: string;\n}\n\nexport interface BasicCardProps\n extends CardBaseProps,\n AnalyticsEventsBase,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size' | 'theme' | 'controlPosition'> {\n url: string;\n urlTitle?: string;\n icon?: ThemeSupporting<ImageProps>;\n target?: string;\n iconPosition?: IconPosition;\n}\n\nexport interface BannerCardProps {\n title: string;\n subtitle?: string;\n className?: string;\n image?: ThemeSupporting<string>;\n disableCompress?: boolean;\n color?: ThemeSupporting<string>;\n theme?: TextTheme;\n button?: Pick<ButtonProps, 'text' | 'url' | 'target' | 'theme'>;\n mediaView?: MediaView;\n}\n\nexport interface MediaCardProps extends MediaProps, AnalyticsEventsBase, CardBaseProps {}\n\nexport interface PriceCardProps extends CardBaseProps, Pick<ContentBlockProps, 'theme'> {\n title: string;\n price: string;\n pricePeriod?: string;\n priceDetails?: string;\n description?: string;\n buttons?: ButtonProps[];\n links?: LinkProps[];\n backgroundColor?: string;\n list?: string[];\n}\n\nexport interface LayoutItemProps extends ClassNameProps, CardLayoutProps, AnalyticsEventsBase {\n content: Omit<ContentBlockProps, 'colSizes' | 'centered' | 'size'>;\n contentMargin?: LayoutItemContentMargin;\n media?: ThemeSupporting<MediaProps>;\n metaInfo?: string[];\n border?: boolean;\n fullscreen?: boolean;\n icon?: ThemeSupporting<PositionedIcon>;\n}\n\nexport interface ImageCardProps\n extends CardBaseProps,\n CardLayoutProps,\n Omit<ContentBlockProps, 'colSizes' | 'centered' | 'controlPosition'> {\n image: ThemeSupporting<ImageProps>;\n enableImageBorderRadius?: boolean;\n margins?: ImageCardMargins;\n direction?: ImageCardDirection;\n backgroundColor?: string;\n url?: string;\n urlTitle?: string;\n target?: string;\n}\n\n// sub-block models\nexport type DividerModel = {\n type: SubBlockType.Divider;\n} & DividerProps;\n\nexport type QuoteModel = {\n type: SubBlockType.Quote;\n} & QuoteProps;\n\nexport type LayoutItemModel = {\n type: SubBlockType.LayoutItem;\n} & LayoutItemProps;\n\nexport type BackgroundCardModel = {\n type: SubBlockType.BackgroundCard;\n} & BackgroundCardProps;\n\n/** @deprecated */\nexport type PriceDetailedModel = {\n type: SubBlockType.PriceDetailed;\n} & PriceDetailedProps;\n\nexport type MediaCardModel = {\n type: SubBlockType.MediaCard;\n} & MediaCardProps;\n\nexport type HubspotFormModel = {\n type: SubBlockType.HubspotForm;\n} & HubspotFormProps;\n\nexport type BannerCardModel = {\n type: SubBlockType.BannerCard;\n} & BannerCardProps;\n\nexport type BasicCardModel = {\n type: SubBlockType.BasicCard;\n} & BasicCardProps;\n\nexport type PriceCardModel = {\n type: SubBlockType.PriceCard;\n} & PriceCardProps;\n\nexport type ImageCardModel = {\n type: SubBlockType.ImageCard;\n} & ImageCardProps;\n\nexport type SubBlockModels =\n | DividerModel\n | QuoteModel\n | PriceDetailedModel\n | MediaCardModel\n | BackgroundCardModel\n | HubspotFormModel\n | BannerCardModel\n | BasicCardModel\n | PriceCardModel\n | LayoutItemModel\n | ImageCardModel;\n\nexport type SubBlock = SubBlockModels;\n"]}
|
|
@@ -55,6 +55,7 @@ export declare const NavigationHeaderProps: {
|
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
|
+
optionName: string;
|
|
58
59
|
}[];
|
|
59
60
|
};
|
|
60
61
|
rightItems: {
|
|
@@ -68,6 +69,7 @@ export declare const NavigationHeaderProps: {
|
|
|
68
69
|
};
|
|
69
70
|
};
|
|
70
71
|
};
|
|
72
|
+
optionName: string;
|
|
71
73
|
}[];
|
|
72
74
|
};
|
|
73
75
|
iconSize: {
|
|
@@ -81,9 +81,18 @@ const NavigationDropdownItemProps = {
|
|
|
81
81
|
};
|
|
82
82
|
const NavigationItemProps = {
|
|
83
83
|
oneOf: [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
{
|
|
85
|
+
optionName: 'link',
|
|
86
|
+
...(0, utils_1.filteredArray)(NavigationLinkItemProps),
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
optionName: 'button',
|
|
90
|
+
...(0, utils_1.filteredArray)(NavigationButtonItemProps),
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
optionName: 'dropdown',
|
|
94
|
+
...(0, utils_1.filteredArray)(NavigationDropdownItemProps),
|
|
95
|
+
},
|
|
87
96
|
],
|
|
88
97
|
};
|
|
89
98
|
exports.NavigationHeaderProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"../../../src","sources":["navigation/schema.ts"],"names":[],"mappings":";;;;AAAA,kEAA+B;AAE/B,0DAAuE;AACvE,2DAAwD;AACxD,yDAAyD;AAEzD,MAAM,kBAAkB,GAAG;IACvB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,CAAC;CACvC,CAAC;AAEW,QAAA,SAAS,GAAG;IACrB,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,UAAU,EAAE;QACR,IAAI,EAAE,mBAAU;QAChB,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,MAAM;SACtB;QACD,GAAG,EAAE;YACD,IAAI,EAAE,QAAQ;SACjB;KACJ;CACJ,CAAC;AAEF,MAAM,uBAAuB,GAAG;IAC5B,IAAI,EAAE;QACF,IAAI,EAAE,QAAQ;QACd,WA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Pattern} 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 {\n optionName: 'link',\n ...filteredArray(NavigationLinkItemProps),\n },\n {\n optionName: 'button',\n ...filteredArray(NavigationButtonItemProps),\n },\n {\n optionName: 'dropdown',\n ...filteredArray(NavigationDropdownItemProps),\n },\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"../../../src","sources":["schema/constants.ts"],"names":[],"mappings":";;;AAAA,wEAAgE;AAGhE,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"../../../src","sources":["schema/constants.ts"],"names":[],"mappings":";;;AAAA,wEAAgE;AAGhE,mDAuB6B;AAC7B,2DASiC;AAEpB,QAAA,YAAY,GAA8B;IACnD,GAAG,oBAAO;IACV,GAAG,8BAAqB;IACxB,GAAG,2BAAkB;IACrB,GAAG,oBAAW;IACd,GAAG,uBAAc;IACjB,GAAG,0BAAiB;IACpB,GAAG,oBAAW;IACd,GAAG,oBAAW;IACd,GAAG,uBAAc;IACjB,GAAG,mBAAU;IACb,GAAG,iBAAQ;IACX,GAAG,kBAAS;IACZ,GAAG,mBAAU;IACb,GAAG,kBAAS;IACZ,GAAG,0BAAiB;IACpB,GAAG,mBAAU;IACb,GAAG,wBAAe;IAClB,GAAG,2BAAkB;IACrB,GAAG,mBAAU;IACb,GAAG,oBAAW;IACd,GAAG,kBAAS;IACZ,GAAG,uCAAqB;IACxB,GAAG,uBAAc;CACpB,CAAC;AAEW,QAAA,WAAW,GAAG;IACvB,GAAG,2BAAc;IACjB,GAAG,mBAAU;IACb,GAAG,+BAAkB;IACrB,GAAG,2BAAc;IACjB,GAAG,kBAAK;IACR,GAAG,sBAAS;IACZ,GAAG,2BAAc;IACjB,GAAG,sBAAS;CACf,CAAC;AAEW,QAAA,2BAA2B,GAAG;IACvC,SAAS;IACT,OAAO;IACP,OAAO;IACP,MAAM;IACN,yBAAyB;IACzB,sBAAsB;IACtB,cAAc;IACd,iBAAiB;IACjB,cAAc;IACd,cAAc;IACd,iBAAiB;IACjB,aAAa;IACb,WAAW;IACX,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,kBAAkB;IAClB,gBAAgB;IAChB,qBAAqB;IACrB,wBAAwB;IACxB,aAAa;IACb,mBAAmB;IACnB,sBAAsB;IACtB,aAAa;IACb,cAAc;IACd,YAAY;CACf,CAAC;AAEW,QAAA,0BAA0B,GAAG;IACtC,YAAY;IACZ,aAAa;IACb,kBAAkB;IAClB,gBAAgB;IAChB,iBAAiB;IACjB,OAAO;IACP,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,YAAY;CACf,CAAC","sourcesContent":["import {TestEditorBlockSchema} from '../blocks/TestEditorBlock';\nimport {BlockType} from '../models';\n\nimport {\n BannerBlock,\n BannerCard,\n CardLayoutBlock,\n CompaniesBlock,\n ContentLayoutBlock,\n ExtendedFeaturesBlock,\n FilterBlock,\n FoldableListBlock,\n FormBlock,\n HeaderBlock,\n HeaderSliderBlock,\n IconsBlock,\n InfoBlock,\n MapBlock,\n MediaBlock,\n PromoFeaturesBlock,\n QuestionsBlock,\n ShareBlock,\n SliderBlock,\n SliderNewBlock,\n TableBlock,\n TabsBlock,\n} from './validators/blocks';\nimport {\n BackgroundCard,\n BasicCard,\n Divider,\n ImageCard,\n MediaCardBlock,\n PriceCardBlock,\n PriceDetailedBlock,\n Quote,\n} from './validators/sub-blocks';\n\nexport const blockSchemas: Record<BlockType, object> = {\n ...Divider,\n ...ExtendedFeaturesBlock,\n ...PromoFeaturesBlock,\n ...SliderBlock,\n ...QuestionsBlock,\n ...FoldableListBlock,\n ...HeaderBlock,\n ...BannerBlock,\n ...CompaniesBlock,\n ...MediaBlock,\n ...MapBlock,\n ...InfoBlock,\n ...TableBlock,\n ...TabsBlock,\n ...HeaderSliderBlock,\n ...IconsBlock,\n ...CardLayoutBlock,\n ...ContentLayoutBlock,\n ...ShareBlock,\n ...FilterBlock,\n ...FormBlock,\n ...TestEditorBlockSchema,\n ...SliderNewBlock,\n};\n\nexport const cardSchemas = {\n ...MediaCardBlock,\n ...BannerCard,\n ...PriceDetailedBlock,\n ...BackgroundCard,\n ...Quote,\n ...BasicCard,\n ...PriceCardBlock,\n ...ImageCard,\n};\n\nexport const constructorBlockSchemaNames = [\n 'divider',\n 'quote',\n 'event',\n 'post',\n 'extended-features-block',\n 'promo-features-block',\n 'slider-block',\n 'questions-block',\n 'header-block',\n 'banner-block',\n 'companies-block',\n 'media-block',\n 'map-block',\n 'info-block',\n 'table-block',\n 'tabs-block',\n /** @deprecated */\n 'price-detailed',\n 'header-slider-block',\n 'cards-with-image-block',\n 'icons-block',\n 'card-layout-block',\n 'content-layout-block',\n 'share-block',\n 'filter-block',\n 'form-block',\n];\n\nexport const constructorCardSchemaNames = [\n 'media-card',\n 'banner-card',\n /** @deprecated */\n 'price-detailed',\n 'background-card',\n 'quote',\n 'basic-card',\n 'layout-item',\n 'price-card',\n 'image-card',\n];\n"]}
|
|
@@ -81,6 +81,7 @@ export declare const defaultComponentsConfigurationSchema: {
|
|
|
81
81
|
};
|
|
82
82
|
};
|
|
83
83
|
};
|
|
84
|
+
optionName: string;
|
|
84
85
|
}[];
|
|
85
86
|
};
|
|
86
87
|
rightItems: {
|
|
@@ -94,6 +95,7 @@ export declare const defaultComponentsConfigurationSchema: {
|
|
|
94
95
|
};
|
|
95
96
|
};
|
|
96
97
|
};
|
|
98
|
+
optionName: string;
|
|
97
99
|
}[];
|
|
98
100
|
};
|
|
99
101
|
iconSize: {
|
|
@@ -7,6 +7,7 @@ export * from "../../blocks/Info/schema.js";
|
|
|
7
7
|
export * from "../../blocks/Media/schema.js";
|
|
8
8
|
export * from "../../blocks/Map/schema.js";
|
|
9
9
|
export * from "../../blocks/Questions/schema.js";
|
|
10
|
+
export * from "../../blocks/FoldableList/schema.js";
|
|
10
11
|
export * from "../../blocks/Slider/schema.js";
|
|
11
12
|
export * from "../../blocks/Table/schema.js";
|
|
12
13
|
export * from "../../blocks/Tabs/schema.js";
|
|
@@ -10,6 +10,7 @@ tslib_1.__exportStar(require("../../blocks/Info/schema.js"), exports);
|
|
|
10
10
|
tslib_1.__exportStar(require("../../blocks/Media/schema.js"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("../../blocks/Map/schema.js"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("../../blocks/Questions/schema.js"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("../../blocks/FoldableList/schema.js"), exports);
|
|
13
14
|
tslib_1.__exportStar(require("../../blocks/Slider/schema.js"), exports);
|
|
14
15
|
tslib_1.__exportStar(require("../../blocks/Table/schema.js"), exports);
|
|
15
16
|
tslib_1.__exportStar(require("../../blocks/Tabs/schema.js"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["schema/validators/blocks.ts"],"names":[],"mappings":";;;AAAA,wEAA2C;AAC3C,2EAA8C;AAC9C,kFAAqD;AACrD,oFAAuD;AACvD,wEAA2C;AAC3C,sEAAyC;AACzC,uEAA0C;AAC1C,qEAAwC;AACxC,2EAA8C;AAC9C,wEAA2C;AAC3C,uEAA0C;AAC1C,sEAAyC;AACzC,8EAAiD;AACjD,uEAA0C;AAC1C,4EAA+C;AAC/C,+EAAkD;AAClD,uEAA0C;AAC1C,6EAAgD;AAChD,sEAAyC;AACzC,2EAA8C","sourcesContent":["export * from '../../blocks/Banner/schema';\nexport * from '../../blocks/Companies/schema';\nexport * from '../../blocks/ExtendedFeatures/schema';\nexport * from '../../blocks/PromoFeaturesBlock/schema';\nexport * from '../../blocks/Header/schema';\nexport * from '../../blocks/Info/schema';\nexport * from '../../blocks/Media/schema';\nexport * from '../../blocks/Map/schema';\nexport * from '../../blocks/Questions/schema';\nexport * from '../../blocks/Slider/schema';\nexport * from '../../blocks/Table/schema';\nexport * from '../../blocks/Tabs/schema';\nexport * from '../../blocks/HeaderSlider/schema';\nexport * from '../../blocks/Icons/schema';\nexport * from '../../blocks/CardLayout/schema';\nexport * from '../../blocks/ContentLayout/schema';\nexport * from '../../blocks/Share/schema';\nexport * from '../../blocks/FilterBlock/schema';\nexport * from '../../blocks/Form/schema';\nexport * from '../../blocks/SliderNew/schema';\n"]}
|
|
1
|
+
{"version":3,"file":"blocks.js","sourceRoot":"../../../../src","sources":["schema/validators/blocks.ts"],"names":[],"mappings":";;;AAAA,wEAA2C;AAC3C,2EAA8C;AAC9C,kFAAqD;AACrD,oFAAuD;AACvD,wEAA2C;AAC3C,sEAAyC;AACzC,uEAA0C;AAC1C,qEAAwC;AACxC,2EAA8C;AAC9C,8EAAiD;AACjD,wEAA2C;AAC3C,uEAA0C;AAC1C,sEAAyC;AACzC,8EAAiD;AACjD,uEAA0C;AAC1C,4EAA+C;AAC/C,+EAAkD;AAClD,uEAA0C;AAC1C,6EAAgD;AAChD,sEAAyC;AACzC,2EAA8C","sourcesContent":["export * from '../../blocks/Banner/schema';\nexport * from '../../blocks/Companies/schema';\nexport * from '../../blocks/ExtendedFeatures/schema';\nexport * from '../../blocks/PromoFeaturesBlock/schema';\nexport * from '../../blocks/Header/schema';\nexport * from '../../blocks/Info/schema';\nexport * from '../../blocks/Media/schema';\nexport * from '../../blocks/Map/schema';\nexport * from '../../blocks/Questions/schema';\nexport * from '../../blocks/FoldableList/schema';\nexport * from '../../blocks/Slider/schema';\nexport * from '../../blocks/Table/schema';\nexport * from '../../blocks/Tabs/schema';\nexport * from '../../blocks/HeaderSlider/schema';\nexport * from '../../blocks/Icons/schema';\nexport * from '../../blocks/CardLayout/schema';\nexport * from '../../blocks/ContentLayout/schema';\nexport * from '../../blocks/Share/schema';\nexport * from '../../blocks/FilterBlock/schema';\nexport * from '../../blocks/Form/schema';\nexport * from '../../blocks/SliderNew/schema';\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { HubspotFormProps } from "../../models/index.js";
|
|
3
|
-
type HubspotFormContainerPropsKeys = 'className' | 'formId' | 'formInstanceId' | 'portalId' | 'region' | 'formClassName' | 'createDOMElement';
|
|
3
|
+
type HubspotFormContainerPropsKeys = 'className' | 'formId' | 'formInstanceId' | 'portalId' | 'region' | 'formClassName' | 'createDOMElement' | 'defaultValues';
|
|
4
4
|
type HubspotFormContainerProps = Pick<HubspotFormProps, HubspotFormContainerPropsKeys>;
|
|
5
5
|
declare const HubspotFormContainer: React.ForwardRefExoticComponent<HubspotFormContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
export default HubspotFormContainer;
|
|
@@ -5,8 +5,9 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const hooks_1 = require("../../hooks/index.js");
|
|
7
7
|
const loadHubspotScript_1 = tslib_1.__importDefault(require("./loadHubspotScript.js"));
|
|
8
|
+
const setHubspotDefaultValues_1 = require("./setHubspotDefaultValues.js");
|
|
8
9
|
const HubspotFormContainer = React.forwardRef((props, ref) => {
|
|
9
|
-
const { className, formId, formInstanceId, portalId, region, formClassName, createDOMElement, } = props;
|
|
10
|
+
const { className, formId, formInstanceId, portalId, region, formClassName, createDOMElement, defaultValues, } = props;
|
|
10
11
|
const containerRef = React.useRef(null);
|
|
11
12
|
const hsContainerRef = React.useRef();
|
|
12
13
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
@@ -30,6 +31,9 @@ const HubspotFormContainer = React.forwardRef((props, ref) => {
|
|
|
30
31
|
target: `#${containerId}`,
|
|
31
32
|
cssClass: formClassName,
|
|
32
33
|
formInstanceId,
|
|
34
|
+
onFormReady: defaultValues
|
|
35
|
+
? (form) => (0, setHubspotDefaultValues_1.setHubspotDefaultValues)(form, defaultValues)
|
|
36
|
+
: undefined,
|
|
33
37
|
});
|
|
34
38
|
}
|
|
35
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HubspotFormContainer.js","sourceRoot":"../../../../src","sources":["sub-blocks/HubspotForm/HubspotFormContainer.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,gDAAqC;AAGrC,uFAAoD;
|
|
1
|
+
{"version":3,"file":"HubspotFormContainer.js","sourceRoot":"../../../../src","sources":["sub-blocks/HubspotForm/HubspotFormContainer.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,gDAAqC;AAGrC,uFAAoD;AACpD,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a;oBACvB,cAAc;oBACd,WAAW,EAAE,aAAa;wBACtB,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,iDAAuB,EAAC,IAAI,EAAE,aAAa,CAAC;wBACxD,CAAC,CAAC,SAAS;iBAClB,CAAC,CAAC;YACP,CAAC;QACL,CAAC;IACL,CAAC,CAAC;IAEF,IAAA,gBAAQ,EAAC,GAAG,EAAE;QACV,CAAC,KAAK,IAAI,EAAE;YACR,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;gBAChB,MAAM,IAAA,2BAAiB,GAAE,CAAC;YAC9B,CAAC;YAED,UAAU,EAAE,CAAC;QACjB,CAAC,CAAC,EAAE,CAAC;QAEL,OAAO,GAAG,EAAE;YACR,IAAI,gBAAgB,IAAI,YAAY,CAAC,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;gBAC7E,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;YACrE,CAAC;QACL,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,OAAO,gCAAK,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,YAAY,GAAI,CAAC;AAC7E,CAAC,CACJ,CAAC;AAEF,oBAAoB,CAAC,WAAW,GAAG,sBAAsB,CAAC;AAE1D,kBAAe,oBAAoB,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {useMount} from '../../hooks';\nimport {HubspotFormProps} from '../../models';\n\nimport loadHubspotScript from './loadHubspotScript';\nimport {setHubspotDefaultValues} from './setHubspotDefaultValues';\n\ntype HubspotFormContainerPropsKeys =\n | 'className'\n | 'formId'\n | 'formInstanceId'\n | 'portalId'\n | 'region'\n | 'formClassName'\n | 'createDOMElement'\n | 'defaultValues';\n\ntype HubspotFormContainerProps = Pick<HubspotFormProps, HubspotFormContainerPropsKeys>;\n\nconst HubspotFormContainer = React.forwardRef<HTMLDivElement, HubspotFormContainerProps>(\n (props, ref) => {\n const {\n className,\n\n formId,\n formInstanceId,\n portalId,\n region,\n formClassName,\n createDOMElement,\n defaultValues,\n } = props;\n\n const containerRef = React.useRef<HTMLDivElement>(null);\n const hsContainerRef = React.useRef<HTMLDivElement>();\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n React.useImperativeHandle(ref, () => containerRef.current!);\n\n const containerId = formInstanceId\n ? `hubspot-form-${formId}-${formInstanceId}`\n : `hubspot-form-${formId}`;\n\n const createForm = () => {\n if (containerRef.current && !hsContainerRef.current && createDOMElement) {\n hsContainerRef.current = document.createElement('div');\n containerRef.current.id = '';\n hsContainerRef.current.id = containerId;\n containerRef.current.appendChild(hsContainerRef.current);\n }\n\n if (!createDOMElement || hsContainerRef.current) {\n if (window.hbspt) {\n window.hbspt.forms.create({\n region,\n portalId,\n formId,\n target: `#${containerId}`,\n cssClass: formClassName,\n formInstanceId,\n onFormReady: defaultValues\n ? (form) => setHubspotDefaultValues(form, defaultValues)\n : undefined,\n });\n }\n }\n };\n\n useMount(() => {\n (async () => {\n if (!window.hbspt) {\n await loadHubspotScript();\n }\n\n createForm();\n })();\n\n return () => {\n if (createDOMElement && containerRef.current && containerRef.current.lastChild) {\n containerRef.current.removeChild(containerRef.current.lastChild);\n }\n };\n });\n\n return <div className={className} id={containerId} ref={containerRef} />;\n },\n);\n\nHubspotFormContainer.displayName = 'HubspotFormContainer';\n\nexport default HubspotFormContainer;\n"]}
|
|
@@ -13,7 +13,7 @@ const b = (0, utils_1.block)('hubspot-form');
|
|
|
13
13
|
const HubspotForm = React.forwardRef((props, ref) => {
|
|
14
14
|
const { className, theme: themeProp, isMobile: isMobileProp, formId, formInstanceId, portalId, region, formClassName,
|
|
15
15
|
// hubspotEvents, // TODO: decide how to handle them
|
|
16
|
-
analyticsEvents, onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, createDOMElement, onSubmitError, } = props;
|
|
16
|
+
analyticsEvents, onBeforeSubmit, onSubmit, onBeforeLoad, onLoad, createDOMElement, onSubmitError, defaultValues, } = props;
|
|
17
17
|
const themeValue = (0, theme_1.useTheme)();
|
|
18
18
|
const handleAnalytics = (0, hooks_1.useAnalytics)(models_1.DefaultEventNames.HubspotFormSubmit);
|
|
19
19
|
const isMobileValue = React.useContext(mobileContext_1.MobileContext);
|
|
@@ -38,7 +38,7 @@ const HubspotForm = React.forwardRef((props, ref) => {
|
|
|
38
38
|
onSubmitError,
|
|
39
39
|
]);
|
|
40
40
|
(0, hooks_1.useHandleHubspotEvents)(handlers, formId);
|
|
41
|
-
return ((0, jsx_runtime_1.jsx)(HubspotFormContainer_1.default, { createDOMElement: createDOMElement, className: b({ theme, mobile }, className), formClassName: formClassName, formId: formId, portalId: portalId, formInstanceId: formInstanceId, region: region, ref: ref }, [formClassName, formId, formInstanceId, portalId, region].join()));
|
|
41
|
+
return ((0, jsx_runtime_1.jsx)(HubspotFormContainer_1.default, { createDOMElement: createDOMElement, className: b({ theme, mobile }, className), formClassName: formClassName, formId: formId, portalId: portalId, formInstanceId: formInstanceId, region: region, defaultValues: defaultValues, ref: ref }, [formClassName, formId, formInstanceId, portalId, region].join()));
|
|
42
42
|
});
|
|
43
43
|
HubspotForm.displayName = 'HubspotForm';
|
|
44
44
|
exports.default = HubspotForm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../../../../src","sources":["sub-blocks/HubspotForm/index.tsx"],"names":[],"mappings":";;;;AAAA,qDAA+B;AAE/B,wEAA0D;AAC1D,wDAA6C;AAC7C,gDAAiE;AACjE,kDAAiE;AACjE,gDAAwD;AAExD,6FAA0D;AAI1D,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,cAAc,CAAC,CAAC;AAEhC,MAAM,WAAW,GAAG,KAAK,CAAC,UAAU,CAAmC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAClF,MAAM,EACF,SAAS,EACT,KAAK,EAAE,SAAS,EAChB,QAAQ,E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AEF,IAAA,8BAAsB,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzC,OAAO,CACH,uBAAC,8BAAoB,IACjB,gBAAgB,EAAE,gBAAgB,EAElC,SAAS,EAAE,CAAC,CAAC,EAAC,KAAK,EAAE,MAAM,EAAC,EAAE,SAAS,CAAC,EACxC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,GAAG,IARH,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CASvE,CACL,CAAC;AACN,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAExC,kBAAe,WAAW,CAAC","sourcesContent":["import * as React from 'react';\n\nimport {MobileContext} from '../../context/mobileContext';\nimport {useTheme} from '../../context/theme';\nimport {useAnalytics, useHandleHubspotEvents} from '../../hooks';\nimport {DefaultEventNames, HubspotFormProps} from '../../models';\nimport {HubspotEventHandlers, block} from '../../utils';\n\nimport HubspotFormContainer from './HubspotFormContainer';\n\nimport './HubspotForm.scss';\n\nconst b = block('hubspot-form');\n\nconst HubspotForm = React.forwardRef<HTMLDivElement, HubspotFormProps>((props, ref) => {\n const {\n className,\n theme: themeProp,\n isMobile: isMobileProp,\n formId,\n formInstanceId,\n portalId,\n region,\n formClassName,\n // hubspotEvents, // TODO: decide how to handle them\n analyticsEvents,\n onBeforeSubmit,\n onSubmit,\n onBeforeLoad,\n onLoad,\n createDOMElement,\n onSubmitError,\n defaultValues,\n } = props;\n\n const themeValue = useTheme();\n const handleAnalytics = useAnalytics(DefaultEventNames.HubspotFormSubmit);\n const isMobileValue = React.useContext(MobileContext);\n\n const theme = themeProp ?? themeValue;\n const mobile = isMobileProp ?? isMobileValue;\n\n const handlers = React.useMemo<HubspotEventHandlers>(\n () => ({\n onBeforeLoad,\n onBeforeSubmit,\n onLoad,\n onSubmitError,\n onSubmit: (event) => {\n handleAnalytics(analyticsEvents);\n onSubmit?.(event);\n },\n }),\n [\n onBeforeLoad,\n onBeforeSubmit,\n onLoad,\n handleAnalytics,\n analyticsEvents,\n onSubmit,\n onSubmitError,\n ],\n );\n\n useHandleHubspotEvents(handlers, formId);\n return (\n <HubspotFormContainer\n createDOMElement={createDOMElement}\n key={[formClassName, formId, formInstanceId, portalId, region].join()}\n className={b({theme, mobile}, className)}\n formClassName={formClassName}\n formId={formId}\n portalId={portalId}\n formInstanceId={formInstanceId}\n region={region}\n defaultValues={defaultValues}\n ref={ref}\n />\n );\n});\n\nHubspotForm.displayName = 'HubspotForm';\n\nexport default HubspotForm;\n"]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setHubspotDefaultValues = void 0;
|
|
4
|
+
const setInputValue = (inputs, value) => {
|
|
5
|
+
const input = inputs[0];
|
|
6
|
+
const type = input.type;
|
|
7
|
+
switch (type) {
|
|
8
|
+
case 'checkbox':
|
|
9
|
+
input.checked = Boolean(value);
|
|
10
|
+
return;
|
|
11
|
+
case 'radio':
|
|
12
|
+
inputs.forEach((radio) => {
|
|
13
|
+
if (radio.value === String(value)) {
|
|
14
|
+
input.checked = true;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return;
|
|
18
|
+
default:
|
|
19
|
+
input.value = String(value);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const setSelectValue = (select, value) => {
|
|
23
|
+
const options = Array.from(select.querySelectorAll('option'));
|
|
24
|
+
options.forEach((option) => {
|
|
25
|
+
if (option.value === String(value)) {
|
|
26
|
+
option.selected = true;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
const setValue = (elements, value) => {
|
|
31
|
+
const element = elements[0];
|
|
32
|
+
switch (element.tagName.toLowerCase()) {
|
|
33
|
+
case 'input':
|
|
34
|
+
setInputValue(elements, value);
|
|
35
|
+
return;
|
|
36
|
+
case 'textarea':
|
|
37
|
+
element.value = String(value);
|
|
38
|
+
return;
|
|
39
|
+
case 'select':
|
|
40
|
+
setSelectValue(element, value);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const setHubspotDefaultValues = (form, defaultValues) => {
|
|
45
|
+
Object.entries(defaultValues).forEach(([name, value]) => {
|
|
46
|
+
const inputs = Array.from(form.querySelectorAll(`[name="${name}"]`));
|
|
47
|
+
setValue(inputs, value);
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
exports.setHubspotDefaultValues = setHubspotDefaultValues;
|
|
51
|
+
//# sourceMappingURL=setHubspotDefaultValues.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setHubspotDefaultValues.js","sourceRoot":"../../../../src","sources":["sub-blocks/HubspotForm/setHubspotDefaultValues.ts"],"names":[],"mappings":";;;AAOA,MAAM,aAAa,GAAG,CAAC,MAA0B,EAAE,KAAwB,EAAE,EAAE;IAC3E,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACxB,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IAExB,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,UAAU;YACX,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;YAC/B,OAAO;QACX,KAAK,OAAO;YACR,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;gBACrB,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;oBAChC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC;gBACzB,CAAC;YACL,CAAC,CAAC,CAAC;YACH,OAAO;QACX;YACI,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC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AAC,CAAC,CAAC;AACP,CAAC,CAAC;AARW,QAAA,uBAAuB,2BAQlC","sourcesContent":["import {HubspotFormDefaultValues} from '../../utils/hubspot';\n\n/* eslint-disable no-not-accumulator-reassign/no-not-accumulator-reassign */\n/* eslint-disable no-param-reassign */\n\ntype HubspotInputValue = HubspotFormDefaultValues[string];\n\nconst setInputValue = (inputs: HTMLInputElement[], value: HubspotInputValue) => {\n const input = inputs[0];\n const type = input.type;\n\n switch (type) {\n case 'checkbox':\n input.checked = Boolean(value);\n return;\n case 'radio':\n inputs.forEach((radio) => {\n if (radio.value === String(value)) {\n input.checked = true;\n }\n });\n return;\n default:\n input.value = String(value);\n }\n};\n\nconst setSelectValue = (select: HTMLSelectElement, value: HubspotInputValue) => {\n const options = Array.from(select.querySelectorAll('option'));\n\n options.forEach((option) => {\n if (option.value === String(value)) {\n option.selected = true;\n }\n });\n};\n\nconst setValue = (elements: Element[], value: HubspotInputValue) => {\n const element = elements[0];\n\n switch (element.tagName.toLowerCase()) {\n case 'input':\n setInputValue(elements as HTMLInputElement[], value);\n return;\n case 'textarea':\n (element as HTMLTextAreaElement).value = String(value);\n return;\n case 'select':\n setSelectValue(element as HTMLSelectElement, value);\n return;\n }\n};\n\nexport const setHubspotDefaultValues = (\n form: HTMLFormElement,\n defaultValues: HubspotFormDefaultValues,\n) => {\n Object.entries(defaultValues).forEach(([name, value]) => {\n const inputs = Array.from(form.querySelectorAll(`[name=\"${name}\"]`));\n setValue(inputs, value);\n });\n};\n"]}
|
|
@@ -88,6 +88,10 @@ function parseContentLayoutTitle(transformer, content) {
|
|
|
88
88
|
}
|
|
89
89
|
return content;
|
|
90
90
|
}
|
|
91
|
+
const parseBackgroundCardItems = (transformer, items) => items.map(({ text, ...rest }) => ({
|
|
92
|
+
text: text && parseTitle(transformer, text),
|
|
93
|
+
...rest,
|
|
94
|
+
}));
|
|
91
95
|
exports.blockHeaderTransformer = [
|
|
92
96
|
{
|
|
93
97
|
fields: ['title'],
|
|
@@ -119,6 +123,11 @@ exports.config = {
|
|
|
119
123
|
fields: ['title'],
|
|
120
124
|
transformer: common_1.typografTransformer,
|
|
121
125
|
},
|
|
126
|
+
{
|
|
127
|
+
fields: ['list'],
|
|
128
|
+
parser: parseBackgroundCardItems,
|
|
129
|
+
transformer: common_1.typografTransformer,
|
|
130
|
+
},
|
|
122
131
|
],
|
|
123
132
|
[models_1.SubBlockType.ImageCard]: [
|
|
124
133
|
{
|
|
@@ -195,6 +204,21 @@ exports.config = {
|
|
|
195
204
|
parser: parseFeatures,
|
|
196
205
|
},
|
|
197
206
|
],
|
|
207
|
+
[models_1.BlockType.FoldableListBlock]: [
|
|
208
|
+
{
|
|
209
|
+
fields: ['title'],
|
|
210
|
+
transformer: common_1.typografTransformer,
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
fields: ['text', 'additionalInfo'],
|
|
214
|
+
transformer: common_1.yfmTransformer,
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
fields: ['items'],
|
|
218
|
+
transformer: common_1.yfmTransformer,
|
|
219
|
+
parser: parseFeatures,
|
|
220
|
+
},
|
|
221
|
+
],
|
|
198
222
|
[models_1.BlockType.BannerBlock]: [
|
|
199
223
|
{
|
|
200
224
|
fields: ['title'],
|
|
@@ -274,7 +298,7 @@ exports.config = {
|
|
|
274
298
|
],
|
|
275
299
|
[models_1.BlockType.HeaderBlock]: [
|
|
276
300
|
{
|
|
277
|
-
fields: ['description'],
|
|
301
|
+
fields: ['description', 'additionalInfo'],
|
|
278
302
|
transformer: common_1.yfmTransformer,
|
|
279
303
|
},
|
|
280
304
|
],
|