yootd 0.0.13 → 0.0.14

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.
@@ -42,7 +42,7 @@ export var Preview = function Preview(_ref) {
42
42
  phone: Phone,
43
43
  web: Web
44
44
  };
45
- var _useState = useState('phone'),
45
+ var _useState = useState(),
46
46
  _useState2 = _slicedToArray(_useState, 2),
47
47
  mode = _useState2[0],
48
48
  setMode = _useState2[1];
@@ -54,7 +54,6 @@ export var Preview = function Preview(_ref) {
54
54
  useEffect(function () {
55
55
  setMode(modes === null || modes === void 0 ? void 0 : modes[0]);
56
56
  }, [modes]);
57
- console.log('modes');
58
57
  return /*#__PURE__*/React.createElement("div", {
59
58
  className: "".concat(mb),
60
59
  style: _objectSpread(_objectSpread({}, style), {}, {
@@ -63,7 +62,7 @@ export var Preview = function Preview(_ref) {
63
62
  })
64
63
  }, /*#__PURE__*/React.createElement(ReactFlow, {
65
64
  nodeTypes: nodeTypes,
66
- nodes: [{
65
+ nodes: mode != null ? [{
67
66
  id: "preview-".concat(mode),
68
67
  type: mode,
69
68
  data: {
@@ -75,7 +74,7 @@ export var Preview = function Preview(_ref) {
75
74
  x: 0,
76
75
  y: 0
77
76
  }
78
- }],
77
+ }] : [],
79
78
  maxZoom: maxZoom,
80
79
  minZoom: minZoom,
81
80
  panOnDrag: panOnDrag,
@@ -90,7 +89,7 @@ export var Preview = function Preview(_ref) {
90
89
  style: {
91
90
  backgroundColor: '#F1F1F1'
92
91
  }
93
- }), (modes === null || modes === void 0 ? void 0 : modes.length) > 1 && /*#__PURE__*/React.createElement(TopPreview, {
92
+ }), (modes === null || modes === void 0 ? void 0 : modes.length) > 1 && mode && /*#__PURE__*/React.createElement(TopPreview, {
94
93
  mode: mode,
95
94
  onChange: changeMode
96
95
  })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yootd",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "A react library developed with dumi",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",