@antscorp/antsomi-ui 1.3.3-beta.53 → 1.3.3-beta.55

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.
@@ -19,7 +19,6 @@ var __rest = (this && this.__rest) || function (s, e) {
19
19
  return t;
20
20
  };
21
21
  import React, { useState, useRef, useEffect } from 'react';
22
- import domtoimage from 'dom-to-image';
23
22
  import { Cell } from './components/Cell';
24
23
  import { GRID_TEMPLATE, MIN_SIZE, THREADHOLD, buildGrid } from './constant';
25
24
  import { StyledGrid, StyledMiddleLayer, StyledBGLayer, StyledLine } from './styled';
@@ -31,7 +30,7 @@ const defaultProps = {
31
30
  cellActiveStyle: { background: '#2f79bf80' },
32
31
  isPreview: false,
33
32
  isCompact: false,
34
- delayUpdate: 300,
33
+ delayUpdate: 200,
35
34
  selectColor: '#2f79bf80',
36
35
  };
37
36
  export const ResizeGrid = props => {
@@ -87,32 +86,6 @@ export const ResizeGrid = props => {
87
86
  y: childBox.y - container.y,
88
87
  };
89
88
  });
90
- // capture
91
- // html2canvas(containerRef.current).then(canvas => {
92
- // const img = canvas.toDataURL("image/png");
93
- // console.log('img', img)
94
- // window.open(img);
95
- // });
96
- console.time();
97
- domtoimage.toJpeg(containerRef.current, { quality: 1 })
98
- .then(dataUrl => {
99
- console.timeEnd();
100
- const link = document.createElement('a');
101
- link.download = 'my-image-name.jpeg';
102
- link.href = dataUrl;
103
- link.click();
104
- });
105
- // toPng(containerRef.current, { cacheBust: true, })
106
- // .then((dataUrl) => {
107
- // console.timeEnd()
108
- // const link = document.createElement('a')
109
- // link.download = 'my-image-name.png'
110
- // link.href = dataUrl
111
- // link.click()
112
- // })
113
- // .catch((err) => {
114
- // console.log(err)
115
- // })
116
89
  if (typeof onChange === 'function') {
117
90
  onChange(grid, childs, firstChangeRef.current ? 'system' : 'user');
118
91
  acceptUpdateRef.current = false;
@@ -136,7 +109,7 @@ export const ResizeGrid = props => {
136
109
  }, [grid]);
137
110
  useDeepCompareEffect(() => {
138
111
  // console.log('changed grid', initGrid, acceptUpdateRef.current, initGrid?.rows, initGrid?.cols)
139
- console.log(initRef.current < 2, !initDoneRef.current, acceptUpdateRef.current);
112
+ // console.log(initRef.current < 2,!initDoneRef.current, acceptUpdateRef.current)
140
113
  if ((initRef.current < 2 || !initDoneRef.current || acceptUpdateRef.current) &&
141
114
  (initGrid === null || initGrid === void 0 ? void 0 : initGrid.rows) &&
142
115
  (initGrid === null || initGrid === void 0 ? void 0 : initGrid.cols)) {
@@ -1,6 +1,6 @@
1
1
  import Icon from '@antscorp/icons';
2
2
  import { Dropdown } from 'antd';
3
- import { produce } from 'immer';
3
+ import produce from 'immer';
4
4
  import React from 'react';
5
5
  import { updateObjAccessInfo } from '../../actions';
6
6
  import { GENERAL_ACCESS, PUBLIC_ROLE, ROLE_ACCESS_LABEL } from '../../constants';
@@ -1,5 +1,5 @@
1
1
  import { Button } from 'antd';
2
- import { produce } from 'immer';
2
+ import produce from 'immer';
3
3
  import React from 'react';
4
4
  import { updateModalTransferOwnership, updateObjAccessInfo } from '../../actions';
5
5
  import { ACCESS_PROPERTIES_BY_ROLE, ROLE_MAPPING } from '../../constants';
@@ -1,5 +1,5 @@
1
1
  import Icon from '@antscorp/icons';
2
- import { produce } from 'immer';
2
+ import produce from 'immer';
3
3
  import { Avatar, Dropdown, List } from 'antd';
4
4
  import { remove } from 'lodash';
5
5
  import React from 'react';
@@ -13,7 +13,7 @@ import { useDebounce } from '@antscorp/antsomi-ui/es/hooks/useDebounceV2';
13
13
  import { StyledSearchUserRoot, StyledSelectItem } from './styled';
14
14
  import { isEmail } from '@antscorp/antsomi-ui/es/utils';
15
15
  import { useShareAccess } from '../../hooks';
16
- import { produce } from 'immer';
16
+ import produce from 'immer';
17
17
  import { ACCESS_PROPERTIES_BY_ROLE, ROLE_MAPPING } from '../../constants';
18
18
  import { updateObjAccessInfo } from '../../actions';
19
19
  export const SearchUser = (props) => {
@@ -1,4 +1,4 @@
1
- import { produce } from 'immer';
1
+ import produce from 'immer';
2
2
  import { TYPES } from './actions';
3
3
  export const shareAccessReducer = (onChange) => (state, action) => produce(state, draft => {
4
4
  switch (action.type) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "1.3.3-beta.53",
3
+ "version": "1.3.3-beta.55",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",
@@ -75,7 +75,7 @@
75
75
  "html-entities": "^2.0.2",
76
76
  "html-to-image": "^1.11.11",
77
77
  "html2canvas": "^1.4.1",
78
- "immer": "^10.0.3",
78
+ "immer": "3.0.0",
79
79
  "i18next": "21.6.16",
80
80
  "i18next-browser-languagedetector": "6.1.2",
81
81
  "lodash": "^4.17.21",