@antscorp/antsomi-ui 1.3.3-beta.61 → 1.3.3-beta.63

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.
@@ -5,6 +5,7 @@ export interface RichMenuBlockProps {
5
5
  richMenu: RichMenu;
6
6
  isPreview?: boolean;
7
7
  layerActive?: LayerActiveProps;
8
+ cellActiveIdx?: number;
8
9
  onClickCell?: (cellIdx: number) => void;
9
10
  onChange?: (richMenu: RichMenu, source?: 'user' | 'system') => void;
10
11
  }
@@ -8,7 +8,7 @@ import { RichMenuCell } from './RichMenuCell';
8
8
  import { tryCatchWrapper } from '@antscorp/antsomi-ui/es/utils';
9
9
  const PATH = 'src/app/modules/Dashboard/containers/RichMenu/containers/Design/components/Workspace/components/RichMenuBlock/index.tsx';
10
10
  export const RichMenuBlock = props => {
11
- const { richMenu, layerActive, isPreview, onClickCell, onChange } = props;
11
+ const { richMenu, layerActive, cellActiveIdx, isPreview, onClickCell, onChange } = props;
12
12
  const { gridTemplateCols = [], gridTemplateRows = [], cells = [], uploadMode, image, layoutType, rows, cols, } = richMenu || {};
13
13
  const { imageUrl, imageStyles } = image || {};
14
14
  const grid = {
@@ -44,7 +44,7 @@ export const RichMenuBlock = props => {
44
44
  }
45
45
  }
46
46
  }, PATH);
47
- const renderCell = (cellInfo, ctx) => (React.createElement(RichMenuCell, { context: ctx, isPreview: isPreview, layerActive: layerActive, cell: cellInfo, isSingleMode: isSingleUploadMode, onClick: handleClickCell }));
47
+ const renderCell = (cellInfo, ctx) => (React.createElement(RichMenuCell, { context: ctx, isPreview: isPreview, layerActive: layerActive, cellActiveIdx: cellActiveIdx, cell: cellInfo, isSingleMode: isSingleUploadMode, onClick: handleClickCell }));
48
48
  return (React.createElement(ResizeGrid, Object.assign({ grid: grid, isPreview: isPreview, containerStyle: imageStyles, isCompact: layoutType === 'compact', renderCell: renderCell, cellActiveStyle: { background: 'rgba(0, 95, 184, 0.5)' }, cellBorder: isSingleUploadMode ? '1px solid rgba(0, 95, 184, 1)' : '1px dotted #000000', onChange: handleGridChange }, Object.assign({}, (isSingleUploadMode && {
49
49
  image: imageUrl,
50
50
  imagePosition: imageStyles === null || imageStyles === void 0 ? void 0 : imageStyles.objectPosition,
@@ -5,6 +5,7 @@ interface RichMenuCellProps {
5
5
  context: number;
6
6
  isSingleMode: boolean;
7
7
  isPreview?: boolean;
8
+ cellActiveIdx?: number;
8
9
  layerActive?: LayerActiveProps;
9
10
  onClick: (index: number) => void;
10
11
  }
@@ -23,7 +23,7 @@ import { translations } from '@antscorp/antsomi-ui/es/locales/translations';
23
23
  import i18nInstance from '@antscorp/antsomi-ui/es/locales/i18n';
24
24
  const PATH = 'src/app/modules/Dashboard/containers/RichMenu/containers/Design/components/Workspace/components/RichMenuCell';
25
25
  export const RichMenuCell = props => {
26
- const { cell, context, layerActive = 'all', isSingleMode, isPreview, onClick } = props;
26
+ const { cell, context, layerActive = 'all', cellActiveIdx, isSingleMode, isPreview, onClick, } = props;
27
27
  const [videoState, setVideoState] = useState({
28
28
  status: 'idle',
29
29
  });
@@ -58,7 +58,8 @@ export const RichMenuCell = props => {
58
58
  }
59
59
  };
60
60
  const renderCellContent = (isShow, cellInfo) => {
61
- if (!isShow || layerActive === 'video')
61
+ if (!isShow ||
62
+ (layerActive === 'video' && +context === cellActiveIdx && (action === null || action === void 0 ? void 0 : action.type) === 'video'))
62
63
  return null;
63
64
  const { image, active } = cellInfo;
64
65
  const { imageUrl, imageStyles } = image;
@@ -71,7 +72,9 @@ export const RichMenuCell = props => {
71
72
  return (React.createElement(CellImage, { active: active && !isPreview, src: imageUrl, imagePosition: objectPosition, imageSize: objectFit, style: restImageStyles }));
72
73
  };
73
74
  const renderVideoLayer = (action, cell) => {
74
- if (!action || action.type !== 'video' || layerActive === 'image')
75
+ if (!action ||
76
+ action.type !== 'video' ||
77
+ (layerActive === 'image' && +context === cellActiveIdx))
75
78
  return null;
76
79
  const { previewImage, isAddLabel, videoUrl } = action;
77
80
  const { active } = cell;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.3-beta.61",
3
+ "version": "1.3.3-beta.63",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",