@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.
Files changed (33) hide show
  1. package/README.md +0 -6
  2. package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.css +12 -0
  3. package/build/cjs/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js +1 -4
  4. package/build/cjs/components/ImageBase/ImageBase.d.ts +1 -1
  5. package/build/cjs/components/ImageBase/ImageBase.js +3 -4
  6. package/build/cjs/components/OutsideClick/OutsideClick.js +3 -5
  7. package/build/cjs/components/ReactPlayer/ReactPlayer.js +13 -6
  8. package/build/cjs/components/Title/TitleItem.css +9 -0
  9. package/build/cjs/components/Title/TitleItem.js +1 -4
  10. package/build/cjs/components/VideoBlock/VideoBlock.d.ts +1 -0
  11. package/build/cjs/components/VideoBlock/VideoBlock.js +5 -6
  12. package/build/cjs/editor/components/AddBlock/AddBlock.css +10 -0
  13. package/build/cjs/editor/components/AddBlock/AddBlock.js +1 -4
  14. package/build/cjs/editor/components/EditBlock/EditBlock.css +9 -0
  15. package/build/cjs/editor/components/EditBlock/EditBlock.js +6 -6
  16. package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.css +12 -0
  17. package/build/esm/blocks/Questions/QuestionBlockItem/QuestionBlockItem.js +1 -4
  18. package/build/esm/components/ImageBase/ImageBase.d.ts +1 -1
  19. package/build/esm/components/ImageBase/ImageBase.js +3 -4
  20. package/build/esm/components/OutsideClick/OutsideClick.js +3 -5
  21. package/build/esm/components/ReactPlayer/ReactPlayer.js +13 -6
  22. package/build/esm/components/Title/TitleItem.css +9 -0
  23. package/build/esm/components/Title/TitleItem.js +1 -4
  24. package/build/esm/components/VideoBlock/VideoBlock.d.ts +1 -0
  25. package/build/esm/components/VideoBlock/VideoBlock.js +6 -7
  26. package/build/esm/editor/components/AddBlock/AddBlock.css +10 -0
  27. package/build/esm/editor/components/AddBlock/AddBlock.js +1 -4
  28. package/build/esm/editor/components/EditBlock/EditBlock.css +9 -0
  29. package/build/esm/editor/components/EditBlock/EditBlock.js +7 -7
  30. package/package.json +1 -1
  31. package/styles/styles.css +1 -0
  32. package/styles/styles.scss +1 -0
  33. 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
- /* eslint-disable jsx-a11y/no-static-element-interactions */
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'), onClick: (e) => e.stopPropagation() }, actionsOrder.map((action) => {
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("div", { key: action, className: b('control'), onClick: actions[action] },
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/page-constructor",
3
- "version": "5.30.0-alpha.0",
3
+ "version": "5.30.1",
4
4
  "description": "Gravity UI Page Constructor",
5
5
  "license": "MIT",
6
6
  "repository": {
package/styles/styles.css CHANGED
@@ -1,4 +1,5 @@
1
1
  @charset "UTF-8";
2
+ @import '@gravity-ui/uikit/styles/fonts.css';
2
3
  @import '~@gravity-ui/uikit/styles/styles.css';
3
4
  @import '~@diplodoc/transform/dist/css/yfm.css';
4
5
  /* use this for style redefinitions to awoid problems with
@@ -1,3 +1,4 @@
1
+ @import '@gravity-ui/uikit/styles/fonts.css';
1
2
  @import '~@gravity-ui/uikit/styles/styles.css';
2
3
  @import './mixins.scss';
3
4
  @import './variables.scss';