@nocobase/plugin-graph-collection-manager 0.9.1-alpha.2 → 0.9.2-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.
- package/lib/client/GraphCollectionProvider.js +8 -27
- package/lib/client/GraphCollectionShortcut.js +6 -37
- package/lib/client/GraphDrawPage.js +66 -271
- package/lib/client/action-hooks.js +26 -114
- package/lib/client/components/AddCollectionAction.js +1 -17
- package/lib/client/components/AddFieldAction.js +2 -21
- package/lib/client/components/CollectionNodeProvder.js +3 -11
- package/lib/client/components/EditCollectionAction.js +0 -16
- package/lib/client/components/EditFieldAction.js +5 -24
- package/lib/client/components/Entity.js +32 -101
- package/lib/client/components/FieldSummary.js +2 -26
- package/lib/client/components/OverrideFieldAction.js +4 -24
- package/lib/client/components/ViewFieldAction.js +3 -16
- package/lib/client/components/ViewNode.js +0 -7
- package/lib/client/index.js +0 -1
- package/lib/client/locale/en-US.d.ts +1 -0
- package/lib/client/locale/en-US.js +1 -0
- package/lib/client/locale/index.js +0 -4
- package/lib/client/locale/pt-BR.d.ts +16 -0
- package/lib/client/locale/pt-BR.js +22 -0
- package/lib/client/locale/zh-CN.d.ts +1 -0
- package/lib/client/locale/zh-CN.js +1 -0
- package/lib/client/style.js +0 -4
- package/lib/client/utils.d.ts +1 -1
- package/lib/client/utils.js +6 -63
- package/lib/index.js +0 -2
- package/lib/server/collections/graphPositions.js +1 -6
- package/lib/server/index.js +0 -14
- package/package.json +4 -4
|
@@ -4,61 +4,43 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.GraphCollectionProvider = void 0;
|
|
7
|
-
|
|
8
7
|
function _client() {
|
|
9
8
|
const data = require("@nocobase/client");
|
|
10
|
-
|
|
11
9
|
_client = function _client() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _react() {
|
|
19
15
|
const data = _interopRequireWildcard(require("react"));
|
|
20
|
-
|
|
21
16
|
_react = function _react() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
var _GraphCollectionShortcut = require("./GraphCollectionShortcut");
|
|
29
|
-
|
|
30
22
|
var _utils = require("./utils");
|
|
31
|
-
|
|
32
23
|
const _excluded = ["routes", "components"];
|
|
33
|
-
|
|
34
24
|
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); }
|
|
35
|
-
|
|
36
25
|
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; }
|
|
37
|
-
|
|
38
26
|
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; }
|
|
39
|
-
|
|
40
27
|
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; }
|
|
41
|
-
|
|
42
|
-
function
|
|
43
|
-
|
|
28
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
29
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
30
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
44
31
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
45
|
-
|
|
46
32
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
47
|
-
|
|
48
33
|
const GraphCollectionProvider = _react().default.memo(props => {
|
|
49
34
|
const ctx = (0, _react().useContext)(_client().PluginManagerContext);
|
|
50
|
-
|
|
51
35
|
const _useContext = (0, _react().useContext)(_client().RouteSwitchContext),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
36
|
+
routes = _useContext.routes,
|
|
37
|
+
components = _useContext.components,
|
|
38
|
+
others = _objectWithoutProperties(_useContext, _excluded);
|
|
39
|
+
// i18n.addResources('en-US', 'graphPositions', enUS);
|
|
55
40
|
// i18n.addResources('ja-JP', 'graphPositions', jaJP);
|
|
56
41
|
// i18n.addResources('zh-CN', 'graphPositions', zhCN);
|
|
57
|
-
|
|
58
|
-
|
|
59
42
|
const _useGCMTranslation = (0, _utils.useGCMTranslation)(),
|
|
60
|
-
|
|
61
|
-
|
|
43
|
+
t = _useGCMTranslation.t;
|
|
62
44
|
const items = (0, _react().useContext)(_client().SettingsCenterContext);
|
|
63
45
|
items['collection-manager']['tabs']['graph'] = {
|
|
64
46
|
title: t("Graphical interface"),
|
|
@@ -80,5 +62,4 @@ const GraphCollectionProvider = _react().default.memo(props => {
|
|
|
80
62
|
})
|
|
81
63
|
}, props.children)));
|
|
82
64
|
});
|
|
83
|
-
|
|
84
65
|
exports.GraphCollectionProvider = GraphCollectionProvider;
|
|
@@ -4,87 +4,61 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.GraphCollectionShortcut = exports.GraphCollectionPane = void 0;
|
|
7
|
-
|
|
8
7
|
function _icons() {
|
|
9
8
|
const data = require("@ant-design/icons");
|
|
10
|
-
|
|
11
9
|
_icons = function _icons() {
|
|
12
10
|
return data;
|
|
13
11
|
};
|
|
14
|
-
|
|
15
12
|
return data;
|
|
16
13
|
}
|
|
17
|
-
|
|
18
14
|
function _css() {
|
|
19
15
|
const data = require("@emotion/css");
|
|
20
|
-
|
|
21
16
|
_css = function _css() {
|
|
22
17
|
return data;
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
return data;
|
|
26
20
|
}
|
|
27
|
-
|
|
28
21
|
function _shared() {
|
|
29
22
|
const data = require("@formily/shared");
|
|
30
|
-
|
|
31
23
|
_shared = function _shared() {
|
|
32
24
|
return data;
|
|
33
25
|
};
|
|
34
|
-
|
|
35
26
|
return data;
|
|
36
27
|
}
|
|
37
|
-
|
|
38
28
|
function _client() {
|
|
39
29
|
const data = require("@nocobase/client");
|
|
40
|
-
|
|
41
30
|
_client = function _client() {
|
|
42
31
|
return data;
|
|
43
32
|
};
|
|
44
|
-
|
|
45
33
|
return data;
|
|
46
34
|
}
|
|
47
|
-
|
|
48
35
|
function _react() {
|
|
49
36
|
const data = _interopRequireWildcard(require("react"));
|
|
50
|
-
|
|
51
37
|
_react = function _react() {
|
|
52
38
|
return data;
|
|
53
39
|
};
|
|
54
|
-
|
|
55
40
|
return data;
|
|
56
41
|
}
|
|
57
|
-
|
|
58
42
|
function _reactRouterDom() {
|
|
59
43
|
const data = require("react-router-dom");
|
|
60
|
-
|
|
61
44
|
_reactRouterDom = function _reactRouterDom() {
|
|
62
45
|
return data;
|
|
63
46
|
};
|
|
64
|
-
|
|
65
47
|
return data;
|
|
66
48
|
}
|
|
67
|
-
|
|
68
49
|
var _actionHooks = require("./action-hooks");
|
|
69
|
-
|
|
70
50
|
var _GraphDrawPage = require("./GraphDrawPage");
|
|
71
|
-
|
|
72
51
|
var _utils = require("./utils");
|
|
73
|
-
|
|
74
52
|
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); }
|
|
75
|
-
|
|
76
53
|
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; }
|
|
77
|
-
|
|
78
54
|
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; }
|
|
79
|
-
|
|
80
55
|
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; }
|
|
81
|
-
|
|
82
|
-
function
|
|
83
|
-
|
|
56
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
57
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
58
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
84
59
|
const useCollectionValues = options => {
|
|
85
60
|
const _useActionContext = (0, _client().useActionContext)(),
|
|
86
|
-
|
|
87
|
-
|
|
61
|
+
visible = _useActionContext.visible;
|
|
88
62
|
const result = (0, _client().useRequest)(() => Promise.resolve({
|
|
89
63
|
data: {
|
|
90
64
|
name: `t_${(0, _shared().uid)()}`,
|
|
@@ -177,13 +151,12 @@ const useCollectionValues = options => {
|
|
|
177
151
|
}, [visible]);
|
|
178
152
|
return result;
|
|
179
153
|
};
|
|
180
|
-
|
|
181
154
|
const GraphCollectionPane = () => {
|
|
182
155
|
return _react().default.createElement("div", {
|
|
183
156
|
className: (0, _css().css)`
|
|
184
157
|
height: calc(100vh - 160px);
|
|
185
158
|
overflow: auto;
|
|
186
|
-
margin: -
|
|
159
|
+
margin: calc(var(--nb-spacing) * -1);
|
|
187
160
|
position: relative;
|
|
188
161
|
`,
|
|
189
162
|
id: "graph_container"
|
|
@@ -208,13 +181,10 @@ const GraphCollectionPane = () => {
|
|
|
208
181
|
}
|
|
209
182
|
}));
|
|
210
183
|
};
|
|
211
|
-
|
|
212
184
|
exports.GraphCollectionPane = GraphCollectionPane;
|
|
213
|
-
|
|
214
185
|
const GraphCollectionShortcut = () => {
|
|
215
186
|
const _useGCMTranslation = (0, _utils.useGCMTranslation)(),
|
|
216
|
-
|
|
217
|
-
|
|
187
|
+
t = _useGCMTranslation.t;
|
|
218
188
|
const history = (0, _reactRouterDom().useHistory)();
|
|
219
189
|
return _react().default.createElement(_client().PluginManager.Toolbar.Item, {
|
|
220
190
|
icon: _react().default.createElement(_icons().PartitionOutlined, null),
|
|
@@ -224,5 +194,4 @@ const GraphCollectionShortcut = () => {
|
|
|
224
194
|
}
|
|
225
195
|
});
|
|
226
196
|
};
|
|
227
|
-
|
|
228
197
|
exports.GraphCollectionShortcut = GraphCollectionShortcut;
|