@gravity-ui/page-constructor 5.30.0-alpha.0 → 5.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -6
- package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.css +12 -0
- package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js +1 -4
- package/build/cjs/components/ImageBase/ImageBase.d.ts +1 -1
- package/build/cjs/components/ImageBase/ImageBase.js +3 -4
- package/build/cjs/components/OutsideClick/OutsideClick.js +3 -5
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +13 -6
- package/build/cjs/components/Title/TitleItem.css +9 -0
- package/build/cjs/components/Title/TitleItem.js +1 -4
- package/build/cjs/components/VideoBlock/VideoBlock.d.ts +1 -0
- package/build/cjs/components/VideoBlock/VideoBlock.js +5 -6
- package/build/cjs/editor/components/AddBlock/AddBlock.css +10 -0
- package/build/cjs/editor/components/AddBlock/AddBlock.js +1 -4
- package/build/cjs/editor/components/EditBlock/EditBlock.css +9 -0
- package/build/cjs/editor/components/EditBlock/EditBlock.js +6 -6
- package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.css +12 -0
- package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js +1 -4
- package/build/esm/components/ImageBase/ImageBase.d.ts +1 -1
- package/build/esm/components/ImageBase/ImageBase.js +3 -4
- package/build/esm/components/OutsideClick/OutsideClick.js +3 -5
- package/build/esm/components/ReactPlayer/ReactPlayer.js +13 -6
- package/build/esm/components/Title/TitleItem.css +9 -0
- package/build/esm/components/Title/TitleItem.js +1 -4
- package/build/esm/components/VideoBlock/VideoBlock.d.ts +1 -0
- package/build/esm/components/VideoBlock/VideoBlock.js +6 -7
- package/build/esm/editor/components/AddBlock/AddBlock.css +10 -0
- package/build/esm/editor/components/AddBlock/AddBlock.js +1 -4
- package/build/esm/editor/components/EditBlock/EditBlock.css +9 -0
- package/build/esm/editor/components/EditBlock/EditBlock.js +7 -7
- package/package.json +1 -1
- package/styles/styles.css +1 -0
- package/styles/styles.scss +1 -0
- package/widget/index.js +1 -1
|
@@ -38,6 +38,15 @@ unpredictable css rules order in build */
|
|
|
38
38
|
transform: translateX(-50%);
|
|
39
39
|
}
|
|
40
40
|
.pc-edit-block__control {
|
|
41
|
+
display: inline-block;
|
|
42
|
+
margin: 0;
|
|
43
|
+
padding: 0;
|
|
44
|
+
font: inherit;
|
|
45
|
+
border: none;
|
|
46
|
+
outline: none;
|
|
47
|
+
color: inherit;
|
|
48
|
+
background: none;
|
|
49
|
+
cursor: pointer;
|
|
41
50
|
display: flex;
|
|
42
51
|
justify-content: center;
|
|
43
52
|
align-items: center;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
|
3
|
-
// TODO fix in https://github.com/gravity-ui/page-constructor/issues/965
|
|
4
|
-
import React, { useEffect, useRef } from 'react';
|
|
1
|
+
import React, { useEffect, useMemo, useRef } from 'react';
|
|
5
2
|
import { ChevronDown, ChevronUp, Copy as CopyIcon, TrashBin } from '@gravity-ui/icons';
|
|
3
|
+
import { useActionHandlers } from '@gravity-ui/uikit';
|
|
6
4
|
import { block } from '../../../utils';
|
|
7
5
|
import './EditBlock.css';
|
|
8
6
|
const b = block('edit-block');
|
|
@@ -27,20 +25,22 @@ const editBlockControlsIcons = {
|
|
|
27
25
|
};
|
|
28
26
|
const EditBlock = ({ actions, isActive, onSelect, isHeader, children, resetPaddings, }) => {
|
|
29
27
|
const ref = useRef(null);
|
|
28
|
+
const stopPropagationProps = useMemo(() => ({ onClick: (e) => e.stopPropagation() }), []);
|
|
29
|
+
const { onKeyDown } = useActionHandlers(onSelect);
|
|
30
30
|
useEffect(() => {
|
|
31
31
|
if (isActive && ref.current) {
|
|
32
32
|
//TODO: add behavior 'smooth' after addiiton of dynamic form layout open/close managing support
|
|
33
33
|
ref.current.scrollIntoView({ block: 'center' });
|
|
34
34
|
}
|
|
35
35
|
}, [isActive]);
|
|
36
|
-
return (React.createElement("div", { className: b({ active: isActive }), onClick: onSelect, ref: ref },
|
|
36
|
+
return (React.createElement("div", { className: b({ active: isActive }), onClick: onSelect, onKeyDown: onKeyDown, ref: ref, role: "button", "aria-current": isActive, tabIndex: 0 },
|
|
37
37
|
React.createElement("div", { className: b('controls', {
|
|
38
38
|
active: isActive,
|
|
39
39
|
isHeader,
|
|
40
40
|
'reset-paddings': resetPaddings,
|
|
41
|
-
}) }, isActive && (React.createElement("div", { className: b('controls-content'),
|
|
41
|
+
}) }, isActive && (React.createElement("div", Object.assign({ className: b('controls-content') }, stopPropagationProps), actionsOrder.map((action) => {
|
|
42
42
|
const Icon = editBlockControlsIcons[action];
|
|
43
|
-
return actions[action] ? (React.createElement("
|
|
43
|
+
return actions[action] ? (React.createElement("button", { key: action, className: b('control'), onClick: actions[action] },
|
|
44
44
|
React.createElement(Icon, null))) : null;
|
|
45
45
|
})))),
|
|
46
46
|
children));
|
package/package.json
CHANGED
package/styles/styles.css
CHANGED
package/styles/styles.scss
CHANGED