@gravity-ui/page-constructor 5.12.0 → 5.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/blocks/ContentLayout/schema.d.ts +4 -0
- package/build/cjs/blocks/Form/schema.d.ts +4 -0
- package/build/cjs/blocks/Info/schema.d.ts +8 -0
- package/build/cjs/blocks/Map/schema.d.ts +4 -0
- package/build/cjs/blocks/Media/schema.d.ts +8 -0
- package/build/cjs/blocks/Questions/schema.d.ts +4 -0
- package/build/cjs/blocks/Tabs/schema.d.ts +4 -0
- package/build/cjs/components/IconWrapper/IconWrapper.css +4 -2
- package/build/cjs/components/IconWrapper/IconWrapper.d.ts +2 -2
- package/build/cjs/components/IconWrapper/IconWrapper.js +3 -3
- package/build/cjs/constructor-items.d.ts +1 -1
- package/build/cjs/editor/components/AddBlock/AddBlock.css +1 -2
- package/build/cjs/editor/components/CodeEditor/CodeEditor.css +3 -1
- package/build/cjs/editor/components/ControlPanel/ControlPanel.css +2 -4
- package/build/cjs/editor/components/ControlPanel/ControlPanel.d.ts +4 -2
- package/build/cjs/editor/components/ControlPanel/ControlPanel.js +24 -15
- package/build/cjs/editor/components/ControlPanel/i18n/en.json +2 -1
- package/build/cjs/editor/components/ControlPanel/i18n/index.d.ts +1 -1
- package/build/cjs/editor/components/ControlPanel/i18n/ru.json +2 -1
- package/build/cjs/editor/components/Layout/Layout.css +10 -6
- package/build/cjs/editor/components/Layout/Layout.d.ts +4 -7
- package/build/cjs/editor/components/Layout/Layout.js +8 -10
- package/build/cjs/editor/components/PageSettings/PageSettings.css +26 -0
- package/build/cjs/editor/components/PageSettings/PageSettings.d.ts +11 -0
- package/build/cjs/editor/components/PageSettings/PageSettings.js +30 -0
- package/build/cjs/editor/components/PageSettings/i18n/en.json +3 -0
- package/build/cjs/editor/components/PageSettings/i18n/index.d.ts +1 -0
- package/build/cjs/editor/components/PageSettings/i18n/index.js +9 -0
- package/build/cjs/editor/components/PageSettings/i18n/ru.json +3 -0
- package/build/cjs/editor/containers/Editor/Editor.css +17 -0
- package/build/cjs/editor/containers/Editor/Editor.d.ts +1 -1
- package/build/cjs/editor/containers/Editor/Editor.js +17 -65
- package/build/cjs/editor/containers/Editor/hooks/useCode.d.ts +14 -0
- package/build/cjs/editor/containers/{Form/hooks.js → Editor/hooks/useCode.js} +4 -14
- package/build/cjs/editor/containers/Editor/hooks/useEditorState.d.ts +49 -0
- package/build/cjs/editor/containers/Editor/hooks/useEditorState.js +99 -0
- package/build/cjs/editor/containers/Form/Form.css +0 -10
- package/build/cjs/editor/containers/Form/Form.d.ts +1 -8
- package/build/cjs/editor/containers/Form/Form.js +14 -39
- package/build/cjs/editor/store/main/index.js +1 -1
- package/build/cjs/editor/store/settings/index.d.ts +3 -3
- package/build/cjs/editor/store/settings/index.js +4 -4
- package/build/cjs/editor/store/settings/reducer.d.ts +9 -9
- package/build/cjs/editor/store/settings/reducer.js +6 -6
- package/build/cjs/editor/types/index.d.ts +3 -4
- package/build/cjs/editor/types/index.js +7 -8
- package/build/cjs/models/constructor-items/blocks.d.ts +1 -0
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +3 -3
- package/build/cjs/schema/constants.d.ts +4 -0
- package/build/cjs/schema/validators/common.d.ts +6 -0
- package/build/cjs/schema/validators/common.js +8 -1
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.css +3 -6
- package/build/cjs/sub-blocks/BackgroundCard/BackgroundCard.js +2 -5
- package/build/cjs/sub-blocks/BackgroundCard/schema.js +2 -2
- package/build/cjs/sub-blocks/BasicCard/BasicCard.css +4 -4
- package/build/cjs/sub-blocks/BasicCard/BasicCard.js +3 -6
- package/build/cjs/sub-blocks/BasicCard/schema.js +2 -2
- package/build/cjs/sub-blocks/Content/Content.css +11 -0
- package/build/cjs/sub-blocks/Content/Content.js +2 -2
- package/build/cjs/sub-blocks/Content/schema.d.ts +8 -0
- package/build/cjs/sub-blocks/Content/schema.js +4 -0
- package/build/cjs/sub-blocks/ImageCard/ImageCard.css +2 -0
- package/build/cjs/sub-blocks/ImageCard/ImageCard.js +4 -2
- package/build/cjs/sub-blocks/ImageCard/schema.d.ts +4 -0
- package/build/cjs/sub-blocks/ImageCard/schema.js +2 -2
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.css +3 -2
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
- package/build/cjs/sub-blocks/LayoutItem/LayoutItem.js +4 -6
- package/build/cjs/sub-blocks/LayoutItem/schema.d.ts +4 -0
- package/build/cjs/sub-blocks/LayoutItem/schema.js +1 -4
- package/build/esm/blocks/ContentLayout/schema.d.ts +4 -0
- package/build/esm/blocks/Form/schema.d.ts +4 -0
- package/build/esm/blocks/Info/schema.d.ts +8 -0
- package/build/esm/blocks/Map/schema.d.ts +4 -0
- package/build/esm/blocks/Media/schema.d.ts +8 -0
- package/build/esm/blocks/Questions/schema.d.ts +4 -0
- package/build/esm/blocks/Tabs/schema.d.ts +4 -0
- package/build/esm/components/IconWrapper/IconWrapper.css +4 -2
- package/build/esm/components/IconWrapper/IconWrapper.d.ts +2 -2
- package/build/esm/components/IconWrapper/IconWrapper.js +3 -3
- package/build/esm/constructor-items.d.ts +1 -1
- package/build/esm/editor/components/AddBlock/AddBlock.css +1 -2
- package/build/esm/editor/components/CodeEditor/CodeEditor.css +3 -1
- package/build/esm/editor/components/ControlPanel/ControlPanel.css +2 -4
- package/build/esm/editor/components/ControlPanel/ControlPanel.d.ts +4 -2
- package/build/esm/editor/components/ControlPanel/ControlPanel.js +26 -17
- package/build/esm/editor/components/ControlPanel/i18n/en.json +2 -1
- package/build/esm/editor/components/ControlPanel/i18n/index.d.ts +1 -1
- package/build/esm/editor/components/ControlPanel/i18n/ru.json +2 -1
- package/build/esm/editor/components/Layout/Layout.css +10 -6
- package/build/esm/editor/components/Layout/Layout.d.ts +4 -7
- package/build/esm/editor/components/Layout/Layout.js +9 -11
- package/build/esm/editor/components/PageSettings/PageSettings.css +26 -0
- package/build/esm/editor/components/PageSettings/PageSettings.d.ts +12 -0
- package/build/esm/editor/components/PageSettings/PageSettings.js +27 -0
- package/build/esm/editor/components/PageSettings/i18n/en.json +3 -0
- package/build/esm/editor/components/PageSettings/i18n/index.d.ts +1 -0
- package/build/esm/editor/components/PageSettings/i18n/index.js +5 -0
- package/build/esm/editor/components/PageSettings/i18n/ru.json +3 -0
- package/build/esm/editor/containers/Editor/Editor.css +17 -0
- package/build/esm/editor/containers/Editor/Editor.d.ts +2 -1
- package/build/esm/editor/containers/Editor/Editor.js +18 -66
- package/build/esm/editor/containers/Editor/hooks/useCode.d.ts +14 -0
- package/build/esm/editor/containers/{Form/hooks.js → Editor/hooks/useCode.js} +4 -14
- package/build/esm/editor/containers/Editor/hooks/useEditorState.d.ts +49 -0
- package/build/esm/editor/containers/Editor/hooks/useEditorState.js +95 -0
- package/build/esm/editor/containers/Form/Form.css +0 -10
- package/build/esm/editor/containers/Form/Form.d.ts +1 -8
- package/build/esm/editor/containers/Form/Form.js +16 -42
- package/build/esm/editor/store/main/index.js +1 -1
- package/build/esm/editor/store/settings/index.d.ts +3 -3
- package/build/esm/editor/store/settings/index.js +5 -5
- package/build/esm/editor/store/settings/reducer.d.ts +9 -9
- package/build/esm/editor/store/settings/reducer.js +6 -6
- package/build/esm/editor/types/index.d.ts +3 -4
- package/build/esm/editor/types/index.js +6 -7
- package/build/esm/models/constructor-items/blocks.d.ts +1 -0
- package/build/esm/models/constructor-items/sub-blocks.d.ts +3 -3
- package/build/esm/schema/constants.d.ts +4 -0
- package/build/esm/schema/validators/common.d.ts +6 -0
- package/build/esm/schema/validators/common.js +6 -0
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.css +3 -6
- package/build/esm/sub-blocks/BackgroundCard/BackgroundCard.js +3 -6
- package/build/esm/sub-blocks/BackgroundCard/schema.js +3 -3
- package/build/esm/sub-blocks/BasicCard/BasicCard.css +4 -4
- package/build/esm/sub-blocks/BasicCard/BasicCard.js +4 -7
- package/build/esm/sub-blocks/BasicCard/schema.js +3 -3
- package/build/esm/sub-blocks/Content/Content.css +11 -0
- package/build/esm/sub-blocks/Content/Content.js +2 -2
- package/build/esm/sub-blocks/Content/schema.d.ts +8 -0
- package/build/esm/sub-blocks/Content/schema.js +4 -0
- package/build/esm/sub-blocks/ImageCard/ImageCard.css +2 -0
- package/build/esm/sub-blocks/ImageCard/ImageCard.js +4 -2
- package/build/esm/sub-blocks/ImageCard/schema.d.ts +4 -0
- package/build/esm/sub-blocks/ImageCard/schema.js +3 -3
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.css +3 -2
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.d.ts +1 -1
- package/build/esm/sub-blocks/LayoutItem/LayoutItem.js +5 -7
- package/build/esm/sub-blocks/LayoutItem/schema.d.ts +4 -0
- package/build/esm/sub-blocks/LayoutItem/schema.js +2 -5
- package/package.json +1 -1
- package/server/models/constructor-items/blocks.d.ts +1 -0
- package/server/models/constructor-items/sub-blocks.d.ts +3 -3
- package/widget/index.js +1 -1
- package/build/cjs/editor/components/PagePropsForm/PagePropsForm.d.ts +0 -10
- package/build/cjs/editor/components/PagePropsForm/PagePropsForm.js +0 -17
- package/build/cjs/editor/containers/Form/hooks.d.ts +0 -8
- package/build/esm/editor/components/PagePropsForm/PagePropsForm.d.ts +0 -10
- package/build/esm/editor/components/PagePropsForm/PagePropsForm.js +0 -13
- package/build/esm/editor/containers/Form/hooks.d.ts +0 -8
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PageContent } from '../../../models';
|
|
3
|
-
import { CustomSpec } from '../../dynamic-forms-custom/parser/types';
|
|
4
|
-
export type PagePropsFormData = Omit<PageContent, 'blocks'>;
|
|
5
|
-
export interface PagePropsFormProps {
|
|
6
|
-
data: PagePropsFormData;
|
|
7
|
-
spec: CustomSpec;
|
|
8
|
-
onChange: (data: PagePropsFormData) => void;
|
|
9
|
-
}
|
|
10
|
-
export declare const PagePropsForm: React.MemoExoticComponent<({ data: content, spec, onChange }: PagePropsFormProps) => JSX.Element>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PagePropsForm = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
-
const dynamic_forms_1 = require("@gravity-ui/dynamic-forms");
|
|
7
|
-
const noop_1 = tslib_1.__importDefault(require("lodash/noop"));
|
|
8
|
-
const react_final_form_1 = require("react-final-form");
|
|
9
|
-
const config_1 = require("../../dynamic-forms-custom/config");
|
|
10
|
-
exports.PagePropsForm = (0, react_1.memo)(({ data: content, spec, onChange }) => {
|
|
11
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
12
|
-
const initialValues = (0, react_1.useMemo)(() => ({ content }), []);
|
|
13
|
-
return (react_1.default.createElement(react_final_form_1.Form, { initialValues: initialValues, onSubmit: noop_1.default }, () => (react_1.default.createElement("div", null,
|
|
14
|
-
react_1.default.createElement(react_final_form_1.FormSpy, { onChange: ({ values }) => onChange(Object.assign({}, values.content)), subscription: { values: true } }),
|
|
15
|
-
react_1.default.createElement(dynamic_forms_1.DynamicField, { name: "content", spec: spec, config: config_1.dynamicConfig })))));
|
|
16
|
-
});
|
|
17
|
-
exports.PagePropsForm.displayName = 'PagePropsForm';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FormProps } from './Form';
|
|
2
|
-
/**
|
|
3
|
-
* Transorms PageConstructor content in JSON to YAML on code editor mode switching
|
|
4
|
-
*
|
|
5
|
-
* @param {Object} props - props parent from form
|
|
6
|
-
* @returns {string} - updated code
|
|
7
|
-
*/
|
|
8
|
-
export declare function useCode({ activeTab, content, codeFullscreeModeOn, }: Pick<FormProps, 'activeTab' | 'content' | 'codeFullscreeModeOn'>): string;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { PageContent } from '../../../models';
|
|
3
|
-
import { CustomSpec } from '../../dynamic-forms-custom/parser/types';
|
|
4
|
-
export type PagePropsFormData = Omit<PageContent, 'blocks'>;
|
|
5
|
-
export interface PagePropsFormProps {
|
|
6
|
-
data: PagePropsFormData;
|
|
7
|
-
spec: CustomSpec;
|
|
8
|
-
onChange: (data: PagePropsFormData) => void;
|
|
9
|
-
}
|
|
10
|
-
export declare const PagePropsForm: React.MemoExoticComponent<({ data: content, spec, onChange }: PagePropsFormProps) => JSX.Element>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React, { memo, useMemo } from 'react';
|
|
2
|
-
import { DynamicField } from '@gravity-ui/dynamic-forms';
|
|
3
|
-
import noop from 'lodash/noop';
|
|
4
|
-
import { Form as FinalForm, FormSpy } from 'react-final-form';
|
|
5
|
-
import { dynamicConfig } from '../../dynamic-forms-custom/config';
|
|
6
|
-
export const PagePropsForm = memo(({ data: content, spec, onChange }) => {
|
|
7
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
8
|
-
const initialValues = useMemo(() => ({ content }), []);
|
|
9
|
-
return (React.createElement(FinalForm, { initialValues: initialValues, onSubmit: noop }, () => (React.createElement("div", null,
|
|
10
|
-
React.createElement(FormSpy, { onChange: ({ values }) => onChange(Object.assign({}, values.content)), subscription: { values: true } }),
|
|
11
|
-
React.createElement(DynamicField, { name: "content", spec: spec, config: dynamicConfig })))));
|
|
12
|
-
});
|
|
13
|
-
PagePropsForm.displayName = 'PagePropsForm';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FormProps } from './Form';
|
|
2
|
-
/**
|
|
3
|
-
* Transorms PageConstructor content in JSON to YAML on code editor mode switching
|
|
4
|
-
*
|
|
5
|
-
* @param {Object} props - props parent from form
|
|
6
|
-
* @returns {string} - updated code
|
|
7
|
-
*/
|
|
8
|
-
export declare function useCode({ activeTab, content, codeFullscreeModeOn, }: Pick<FormProps, 'activeTab' | 'content' | 'codeFullscreeModeOn'>): string;
|