@nocobase/plugin-graph-collection-manager 0.9.0-alpha.1 → 0.9.0-alpha.2

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.
@@ -25,19 +25,9 @@ function _react() {
25
25
  return data;
26
26
  }
27
27
 
28
- function _reactI18next() {
29
- const data = require("react-i18next");
30
-
31
- _reactI18next = function _reactI18next() {
32
- return data;
33
- };
34
-
35
- return data;
36
- }
37
-
38
28
  var _GraphCollectionShortcut = require("./GraphCollectionShortcut");
39
29
 
40
- var _locale = require("./locale");
30
+ var _utils = require("./utils");
41
31
 
42
32
  const _excluded = ["routes", "components"];
43
33
 
@@ -61,16 +51,13 @@ const GraphCollectionProvider = _react().default.memo(props => {
61
51
  const _useContext = (0, _react().useContext)(_client().RouteSwitchContext),
62
52
  routes = _useContext.routes,
63
53
  components = _useContext.components,
64
- others = _objectWithoutProperties(_useContext, _excluded);
65
-
66
- _client().i18n.addResources('en-US', 'graphPositions', _locale.enUS);
67
-
68
- _client().i18n.addResources('ja-JP', 'graphPositions', _locale.jaJP);
54
+ others = _objectWithoutProperties(_useContext, _excluded); // i18n.addResources('en-US', 'graphPositions', enUS);
55
+ // i18n.addResources('ja-JP', 'graphPositions', jaJP);
56
+ // i18n.addResources('zh-CN', 'graphPositions', zhCN);
69
57
 
70
- _client().i18n.addResources('zh-CN', 'graphPositions', _locale.zhCN);
71
58
 
72
- const _useTranslation = (0, _reactI18next().useTranslation)('graphPositions'),
73
- t = _useTranslation.t;
59
+ const _useGCMTranslation = (0, _utils.useGCMTranslation)(),
60
+ t = _useGCMTranslation.t;
74
61
 
75
62
  const items = (0, _react().useContext)(_client().SettingsCenterContext);
76
63
  items['collection-manager']['tabs']['graph'] = {
@@ -15,6 +15,16 @@ function _icons() {
15
15
  return data;
16
16
  }
17
17
 
18
+ function _css() {
19
+ const data = require("@emotion/css");
20
+
21
+ _css = function _css() {
22
+ return data;
23
+ };
24
+
25
+ return data;
26
+ }
27
+
18
28
  function _shared() {
19
29
  const data = require("@formily/shared");
20
30
 
@@ -45,26 +55,6 @@ function _react() {
45
55
  return data;
46
56
  }
47
57
 
48
- function _css() {
49
- const data = require("@emotion/css");
50
-
51
- _css = function _css() {
52
- return data;
53
- };
54
-
55
- return data;
56
- }
57
-
58
- function _reactI18next() {
59
- const data = require("react-i18next");
60
-
61
- _reactI18next = function _reactI18next() {
62
- return data;
63
- };
64
-
65
- return data;
66
- }
67
-
68
58
  function _reactRouterDom() {
69
59
  const data = require("react-router-dom");
70
60
 
@@ -79,6 +69,8 @@ var _actionHooks = require("./action-hooks");
79
69
 
80
70
  var _GraphDrawPage = require("./GraphDrawPage");
81
71
 
72
+ var _utils = require("./utils");
73
+
82
74
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
83
75
 
84
76
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -220,8 +212,8 @@ const GraphCollectionPane = () => {
220
212
  exports.GraphCollectionPane = GraphCollectionPane;
221
213
 
222
214
  const GraphCollectionShortcut = () => {
223
- const _useTranslation = (0, _reactI18next().useTranslation)('graphPositions'),
224
- t = _useTranslation.t;
215
+ const _useGCMTranslation = (0, _utils.useGCMTranslation)(),
216
+ t = _useGCMTranslation.t;
225
217
 
226
218
  const history = (0, _reactRouterDom().useHistory)();
227
219
  return _react().default.createElement(_client().PluginManager.Toolbar.Item, {
@@ -107,28 +107,18 @@ function _react2() {
107
107
  return data;
108
108
  }
109
109
 
110
- function _reactI18next() {
111
- const data = require("react-i18next");
112
-
113
- _reactI18next = function _reactI18next() {
114
- return data;
115
- };
116
-
117
- return data;
118
- }
119
-
120
110
  var _actionHooks = require("./action-hooks");
121
111
 
122
112
  var _AddCollectionAction = require("./components/AddCollectionAction");
123
113
 
124
114
  var _Entity = _interopRequireDefault(require("./components/Entity"));
125
115
 
116
+ var _ViewNode = require("./components/ViewNode");
117
+
126
118
  var _style = require("./style");
127
119
 
128
120
  var _utils = require("./utils");
129
121
 
130
- var _ViewNode = require("./components/ViewNode");
131
-
132
122
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
133
123
 
134
124
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -557,8 +547,8 @@ const GraphDrawPage = _react2().default.memo(() => {
557
547
  const api = (0, _client().useAPIClient)();
558
548
  const compile = (0, _client().useCompile)();
559
549
 
560
- const _useTranslation = (0, _reactI18next().useTranslation)('graphPositions'),
561
- t = _useTranslation.t;
550
+ const _useGCMTranslation = (0, _utils.useGCMTranslation)(),
551
+ t = _useGCMTranslation.t;
562
552
 
563
553
  const _useState = (0, _react2().useState)([]),
564
554
  _useState2 = _slicedToArray(_useState, 2),
@@ -47,16 +47,6 @@ function _client() {
47
47
  return data;
48
48
  }
49
49
 
50
- function _reactI18next() {
51
- const data = require("react-i18next");
52
-
53
- _reactI18next = function _reactI18next() {
54
- return data;
55
- };
56
-
57
- return data;
58
- }
59
-
60
50
  function _antd() {
61
51
  const data = require("antd");
62
52
 
@@ -67,20 +57,20 @@ function _antd() {
67
57
  return data;
68
58
  }
69
59
 
70
- function _react() {
71
- const data = _interopRequireWildcard(require("react"));
60
+ function _lodash() {
61
+ const data = require("lodash");
72
62
 
73
- _react = function _react() {
63
+ _lodash = function _lodash() {
74
64
  return data;
75
65
  };
76
66
 
77
67
  return data;
78
68
  }
79
69
 
80
- function _lodash() {
81
- const data = require("lodash");
70
+ function _react() {
71
+ const data = _interopRequireWildcard(require("react"));
82
72
 
83
- _lodash = function _lodash() {
73
+ _react = function _react() {
84
74
  return data;
85
75
  };
86
76
 
@@ -91,20 +81,22 @@ var _actionHooks = require("../action-hooks");
91
81
 
92
82
  var _style = require("../style");
93
83
 
94
- var _FieldSummary = require("./FieldSummary");
84
+ var _utils = require("../utils");
95
85
 
96
86
  var _AddFieldAction = require("./AddFieldAction");
97
87
 
98
88
  var _CollectionNodeProvder = require("./CollectionNodeProvder");
99
89
 
90
+ var _EditCollectionAction = require("./EditCollectionAction");
91
+
100
92
  var _EditFieldAction = require("./EditFieldAction");
101
93
 
94
+ var _FieldSummary = require("./FieldSummary");
95
+
102
96
  var _OverrideFieldAction = require("./OverrideFieldAction");
103
97
 
104
98
  var _ViewFieldAction = require("./ViewFieldAction");
105
99
 
106
- var _EditCollectionAction = require("./EditCollectionAction");
107
-
108
100
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
109
101
 
110
102
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -284,8 +276,8 @@ const PortsCom = _react().default.memo(({
284
276
  collapse = _useState2[0],
285
277
  setCollapse = _useState2[1];
286
278
 
287
- const _useTranslation = (0, _reactI18next().useTranslation)('graphPositions'),
288
- t = _useTranslation.t;
279
+ const _useGCMTranslation = (0, _utils.useGCMTranslation)(),
280
+ t = _useGCMTranslation.t;
289
281
 
290
282
  const compile = (0, _client().useCompile)();
291
283
  const portsData = (0, _lodash().groupBy)(ports.items, v => {
@@ -1,3 +1,4 @@
1
+ export declare const useGCMTranslation: () => import("react-i18next").UseTranslationResponse<"graph-collection-manager", undefined>;
1
2
  export declare const getInheritCollections: (collections: any, name: any) => any[];
2
3
  export declare const getChildrenCollections: (collections: any, name: any) => any[];
3
4
  export declare const formatData: (data: any) => {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getInheritCollections = exports.getDiffNode = exports.getDiffEdge = exports.getChildrenCollections = exports.formatPortData = exports.formatInheritEdgeData = exports.formatData = void 0;
6
+ exports.useGCMTranslation = exports.getInheritCollections = exports.getDiffNode = exports.getDiffEdge = exports.getChildrenCollections = exports.formatPortData = exports.formatInheritEdgeData = exports.formatData = void 0;
7
7
 
8
8
  function _lodash() {
9
9
  const data = require("lodash");
@@ -15,6 +15,16 @@ function _lodash() {
15
15
  return data;
16
16
  }
17
17
 
18
+ function _reactI18next() {
19
+ const data = require("react-i18next");
20
+
21
+ _reactI18next = function _reactI18next() {
22
+ return data;
23
+ };
24
+
25
+ return data;
26
+ }
27
+
18
28
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
29
 
20
30
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -26,6 +36,12 @@ const shape = {
26
36
  EDGE: 'edge'
27
37
  };
28
38
 
39
+ const useGCMTranslation = () => {
40
+ return (0, _reactI18next().useTranslation)('graph-collection-manager');
41
+ };
42
+
43
+ exports.useGCMTranslation = useGCMTranslation;
44
+
29
45
  const getInheritCollections = (collections, name) => {
30
46
  const parents = [];
31
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-graph-collection-manager",
3
- "version": "0.9.0-alpha.1",
3
+ "version": "0.9.0-alpha.2",
4
4
  "description": "",
5
5
  "license": "AGPL-3.0",
6
6
  "main": "./lib/index.js",
@@ -11,8 +11,8 @@
11
11
  "dagre": "^0.8.5"
12
12
  },
13
13
  "devDependencies": {
14
- "@nocobase/client": "0.9.0-alpha.1",
15
- "@nocobase/test": "0.9.0-alpha.1"
14
+ "@nocobase/client": "0.9.0-alpha.2",
15
+ "@nocobase/test": "0.9.0-alpha.2"
16
16
  },
17
- "gitHead": "d84c2a47c42c2ffec4fbf317d53268952fbd58d7"
17
+ "gitHead": "b8f76ad38e60e677c5bb4aab0a4cdb28d98a0f49"
18
18
  }