@kanaries/graphic-walker 0.2.5 → 0.2.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanaries/graphic-walker",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "scripts": {
5
5
  "dev:front_end": "vite --host",
6
6
  "dev": "npm run dev:front_end",
@@ -34,7 +34,6 @@
34
34
  "dependencies": {
35
35
  "@heroicons/react": "^2.0.8",
36
36
  "@kanaries/web-data-loader": "0.1.5",
37
- "@types/styled-components": "^5.1.26",
38
37
  "autoprefixer": "^10.3.5",
39
38
  "i18next": "^21.9.1",
40
39
  "i18next-browser-languagedetector": "^6.1.5",
@@ -43,13 +42,10 @@
43
42
  "mobx-react-lite": "^3.2.1",
44
43
  "postcss": "^8.3.7",
45
44
  "re-resizable": "^6.9.8",
46
- "react": "^17.0.2",
47
45
  "react-beautiful-dnd": "^13.1.1",
48
- "react-dom": "^17.0.2",
49
46
  "react-i18next": "^11.18.6",
50
47
  "react-json-view": "^1.21.3",
51
48
  "rxjs": "^7.3.0",
52
- "styled-components": "^5.3.6",
53
49
  "tailwindcss": "^2.2.15",
54
50
  "uuid": "^8.3.2",
55
51
  "vega": "^5.22.1",
@@ -62,9 +58,15 @@
62
58
  "@types/react": "^17.x",
63
59
  "@types/react-beautiful-dnd": "^13.1.2",
64
60
  "@types/react-dom": "^17.x",
61
+ "@types/styled-components": "^5.1.26",
65
62
  "@types/uuid": "^8.3.1",
66
63
  "@vitejs/plugin-react-refresh": "^1.3.6",
67
64
  "typescript": "^4.3.2",
68
65
  "vite": "^3.1.0"
66
+ },
67
+ "peerDependencies": {
68
+ "react": "^17.0.2",
69
+ "react-dom": "^17.0.2",
70
+ "styled-components": "^5.3.6"
69
71
  }
70
72
  }
package/src/App.tsx CHANGED
@@ -31,6 +31,7 @@ export interface EditorProps {
31
31
  hideDataSourceConfig?: boolean;
32
32
  i18nLang?: string;
33
33
  i18nResources?: { [lang: string]: Record<string, string | any> };
34
+ keepAlive?: boolean;
34
35
  }
35
36
 
36
37
  const App: React.FC<EditorProps> = props => {
@@ -79,9 +79,9 @@ const SliderSlice = styled.div({
79
79
 
80
80
 
81
81
  const nicer = (range: readonly [number, number], value: number): string => {
82
- const precision = /(\.\d*)$/.exec(((range[1] - range[0]) / 1000).toString())![0].length;
82
+ const precision = /(\.\d*)$/.exec(((range[1] - range[0]) / 1000).toString())?.[0].length;
83
83
 
84
- return value.toFixed(precision).replace(/\.?0+$/, '');
84
+ return precision === undefined ? `${value}` : value.toFixed(precision).replace(/\.?0+$/, '');
85
85
  };
86
86
 
87
87
  interface SliderProps {
package/src/index.tsx CHANGED
@@ -4,7 +4,7 @@ import { StoreWrapper } from './store/index';
4
4
  import { FieldsContextWrapper } from './fields/fieldsContext';
5
5
 
6
6
  export const GraphicWalker: React.FC<EditorProps> = props => {
7
- return <StoreWrapper>
7
+ return <StoreWrapper keepAlive={props.keepAlive}>
8
8
  <FieldsContextWrapper>
9
9
  <App {...props} />
10
10
  </FieldsContextWrapper>