@onehat/ui 0.3.317 → 0.3.319

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": "@onehat/ui",
3
- "version": "0.3.317",
3
+ "version": "0.3.319",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -25,6 +25,7 @@
25
25
  },
26
26
  "license": "UNLICENSED",
27
27
  "dependencies": {
28
+ "@gluestack-style/animation-resolver": "^1.0.4",
28
29
  "@gluestack-style/react": "^1.0.56",
29
30
  "@gluestack-ui/config": "^1.1.18",
30
31
  "@gluestack-ui/themed": "^1.1.26",
@@ -52,11 +53,10 @@
52
53
  "react-dnd-html5-backend": "^16.0.1",
53
54
  "react-dnd-touch-backend":"16.0.1",
54
55
  "react-draggable": "^4.4.5",
55
- "react-json-view": "^1.21.3",
56
- "react-json-view-lite": "^1.4.0",
57
56
  "react-native": "*",
58
57
  "react-native-draggable": "^3.3.0",
59
58
  "react-native-svg": "*",
59
+ "react18-json-view": "^0.2.8",
60
60
  "use-file-picker": "^2.1.1"
61
61
  },
62
62
  "devDependencies": {
@@ -46,6 +46,7 @@ export function ComboComponent(props) {
46
46
  showEyeButton = false,
47
47
  viewerProps = {}, // popup for eyeButton
48
48
  _input = {},
49
+ _editor = {},
49
50
  isEditor = false,
50
51
  isDisabled = false,
51
52
  isInTag = false,
@@ -817,6 +818,7 @@ export function ComboComponent(props) {
817
818
  onInputFocus();
818
819
  }
819
820
  }}
821
+ {..._editor}
820
822
  />;
821
823
  if (UiGlobals.mode === UI_MODE_WEB) {
822
824
  dropdownMenu = <Popover
@@ -7,12 +7,12 @@ import {
7
7
  import {
8
8
  UI_MODE_REACT_NATIVE,
9
9
  UI_MODE_WEB,
10
- } from '../../../constants/UiModes.js';
10
+ } from '../../../Constants/UiModes.js';
11
11
  import UiGlobals from '../../../UiGlobals.js';
12
12
  import withComponent from '../../Hoc/withComponent.js';
13
13
  import withValue from '../../Hoc/withValue.js';
14
- import testProps from '../../../functions/testProps.js';
15
- import getComponentFromType from '../../../functions/getComponentFromType.js';
14
+ import testProps from '../../../Functions/testProps.js';
15
+ import getComponentFromType from '../../../Functions/getComponentFromType.js';
16
16
  import _ from 'lodash';
17
17
 
18
18
 
@@ -21,7 +21,7 @@ export function JsonElement(props) {
21
21
  tooltipRef = null,
22
22
  tooltip = null,
23
23
  isDisabled = false,
24
- isEditable = true,
24
+ isViewOnly = false,
25
25
  tooltipPlacement = 'bottom',
26
26
  testID,
27
27
 
@@ -34,34 +34,29 @@ export function JsonElement(props) {
34
34
  ...propsToPass
35
35
  } = props,
36
36
  styles = UiGlobals.styles,
37
- JsonEditor = getComponentFromType('JsonEditor'),
38
- JsonViewer = getComponentFromType('JsonViewer');
39
-
37
+ JsonEditor = getComponentFromType('JsonEditor');
38
+
40
39
  let assembledComponents = null;
41
40
 
42
41
  if (UiGlobals.mode === UI_MODE_WEB) {
43
42
  const src = JSON.parse(value);
44
-
45
- if (isEditable) {
46
- assembledComponents =
43
+ assembledComponents =
44
+ <Row
45
+ flex={1}
46
+ {...propsToPass}
47
+ justifyContent="flex-start"
48
+ >
47
49
  <JsonEditor
48
- // {...propsToPass}
50
+ width="100%"
51
+ editable={!isViewOnly}
49
52
  src={src}
50
53
  enableClipboard={false}
51
54
  collapsed={true}
52
- editable={isEditable}
53
55
  onEdit={(obj) => {
54
56
  setValue(JSON.stringify(obj.updated_src));
55
57
  }}
56
- isDisabled={isDisabled}
57
- />;
58
- } else {
59
- assembledComponents =
60
- <JsonViewer
61
- // {...propsToPass}
62
- data={src}
63
- />;
64
- }
58
+ />
59
+ </Row>;
65
60
 
66
61
  }
67
62
  if (UiGlobals.mode === UI_MODE_REACT_NATIVE) {
@@ -122,7 +122,7 @@ function GridRow(props) {
122
122
  if (UiGlobals.mode === UI_MODE_WEB) {
123
123
  elementProps.textOverflow = 'ellipsis';
124
124
  }
125
- if (type.match(/(Tag|TagEditor)$/)) {
125
+ if (type.match(/(Tag|TagEditor|Json)$/)) {
126
126
  elementProps.isViewOnly = true; // TODO: this won't work for InlineGridEditor, bc that Grid can't use isViewOnly when actually editing
127
127
  }
128
128
  if (config.getCellProps) {
@@ -5,7 +5,6 @@ import Datetime from '../PlatformImports/Web/Datetime.js';
5
5
  import Draggable from '../PlatformImports/Web/Draggable.js';
6
6
  import File from '../PlatformImports/Web/File.js';
7
7
  import JsonEditor from '../PlatformImports/Web/JsonEditor.js';
8
- import JsonViewer from '../PlatformImports/Web/JsonViewer.js';
9
8
  import useWindowSize from '../PlatformImports/Web/useWindowSize.js';
10
9
  import _ from 'lodash';
11
10
 
@@ -17,7 +16,6 @@ export default function registerWebComponents() {
17
16
  Draggable,
18
17
  File,
19
18
  JsonEditor,
20
- JsonViewer,
21
19
  useWindowSize,
22
20
  });
23
21
  }
@@ -1,3 +1,4 @@
1
- import ReactJson from 'react-json-view'; // https://www.npmjs.com/package/react-json-view
1
+ import ReactJson from 'react18-json-view'; // https://www.npmjs.com/package/react18-json-view
2
+ import 'react18-json-view/src/style.css'
2
3
 
3
4
  export default ReactJson.default || ReactJson;
@@ -1,4 +0,0 @@
1
- import { JsonView, allExpanded, darkStyles, defaultStyles } from 'react-json-view-lite'; // https://www.npmjs.com/package/react-json-view-lite
2
- import 'react-json-view-lite/dist/index.css';
3
-
4
- export default JsonView;