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

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.
Files changed (54) hide show
  1. package/LICENSE +661 -0
  2. package/client.d.ts +4 -0
  3. package/client.js +30 -0
  4. package/lib/client/GraphCollectionProvider.d.ts +2 -0
  5. package/lib/client/GraphCollectionProvider.js +97 -0
  6. package/lib/client/GraphCollectionShortcut.d.ts +2 -0
  7. package/lib/client/GraphCollectionShortcut.js +236 -0
  8. package/lib/client/GraphDrawPage.d.ts +13 -0
  9. package/lib/client/GraphDrawPage.js +1746 -0
  10. package/lib/client/action-hooks.d.ts +44 -0
  11. package/lib/client/action-hooks.js +402 -0
  12. package/lib/client/components/AddCollectionAction.d.ts +3 -0
  13. package/lib/client/components/AddCollectionAction.js +73 -0
  14. package/lib/client/components/AddFieldAction.d.ts +3 -0
  15. package/lib/client/components/AddFieldAction.js +85 -0
  16. package/lib/client/components/CollectionNodeProvder.d.ts +10 -0
  17. package/lib/client/components/CollectionNodeProvder.js +42 -0
  18. package/lib/client/components/EditCollectionAction.d.ts +3 -0
  19. package/lib/client/components/EditCollectionAction.js +78 -0
  20. package/lib/client/components/EditFieldAction.d.ts +3 -0
  21. package/lib/client/components/EditFieldAction.js +81 -0
  22. package/lib/client/components/Entity.d.ts +8 -0
  23. package/lib/client/components/Entity.js +603 -0
  24. package/lib/client/components/FieldSummary.d.ts +2 -0
  25. package/lib/client/components/FieldSummary.js +98 -0
  26. package/lib/client/components/OverrideFieldAction.d.ts +3 -0
  27. package/lib/client/components/OverrideFieldAction.js +83 -0
  28. package/lib/client/components/ViewFieldAction.d.ts +3 -0
  29. package/lib/client/components/ViewFieldAction.js +57 -0
  30. package/lib/client/components/ViewNode.d.ts +5 -0
  31. package/lib/client/components/ViewNode.js +40 -0
  32. package/lib/client/index.d.ts +1 -0
  33. package/lib/client/index.js +13 -0
  34. package/lib/client/locale/en-US.d.ts +15 -0
  35. package/lib/client/locale/en-US.js +21 -0
  36. package/lib/client/locale/index.d.ts +3 -0
  37. package/lib/client/locale/index.js +31 -0
  38. package/lib/client/locale/ja-JP.d.ts +14 -0
  39. package/lib/client/locale/ja-JP.js +20 -0
  40. package/lib/client/locale/zh-CN.d.ts +16 -0
  41. package/lib/client/locale/zh-CN.js +22 -0
  42. package/lib/client/style.d.ts +9 -0
  43. package/lib/client/style.js +222 -0
  44. package/lib/client/utils.d.ts +11 -0
  45. package/lib/client/utils.js +565 -0
  46. package/lib/index.d.ts +1 -0
  47. package/lib/index.js +15 -0
  48. package/lib/server/collections/graphPositions.d.ts +2 -0
  49. package/lib/server/collections/graphPositions.js +33 -0
  50. package/lib/server/index.d.ts +5 -0
  51. package/lib/server/index.js +51 -0
  52. package/package.json +18 -0
  53. package/server.d.ts +4 -0
  54. package/server.js +30 -0
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EditCollectionAction = void 0;
7
+
8
+ function _icons() {
9
+ const data = require("@ant-design/icons");
10
+
11
+ _icons = function _icons() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ function _client() {
19
+ const data = require("@nocobase/client");
20
+
21
+ _client = function _client() {
22
+ return data;
23
+ };
24
+
25
+ return data;
26
+ }
27
+
28
+ function _react() {
29
+ const data = _interopRequireDefault(require("react"));
30
+
31
+ _react = function _react() {
32
+ return data;
33
+ };
34
+
35
+ return data;
36
+ }
37
+
38
+ function _css() {
39
+ const data = require("@emotion/css");
40
+
41
+ _css = function _css() {
42
+ return data;
43
+ };
44
+
45
+ return data;
46
+ }
47
+
48
+ var _actionHooks = require("../action-hooks");
49
+
50
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
51
+
52
+ const EditCollectionAction = ({
53
+ item: record
54
+ }) => {
55
+ return _react().default.createElement(_client().EditCollection, {
56
+ item: record,
57
+ scope: {
58
+ useCancelAction: _actionHooks.useCancelAction,
59
+ useUpdateCollectionActionAndRefreshCM: _actionHooks.useUpdateCollectionActionAndRefreshCM,
60
+ createOnly: false
61
+ },
62
+ getContainer: () => document.getElementById('graph_container')
63
+ }, _react().default.createElement(_icons().EditOutlined, {
64
+ className: (0, _css().css)`
65
+ border-color: transparent;
66
+ color: rgb(78 89 105);
67
+ height: 20px;
68
+ width: 22px;
69
+ margin: 0px 5px 4px;
70
+ line-height: 25px;
71
+ &:hover {
72
+ background-color: rgb(229 230 235);
73
+ }
74
+ `
75
+ }));
76
+ };
77
+
78
+ exports.EditCollectionAction = EditCollectionAction;
@@ -0,0 +1,3 @@
1
+ export declare const EditFieldAction: ({ item: record }: {
2
+ item: any;
3
+ }) => JSX.Element;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EditFieldAction = void 0;
7
+
8
+ function _icons() {
9
+ const data = require("@ant-design/icons");
10
+
11
+ _icons = function _icons() {
12
+ return data;
13
+ };
14
+
15
+ return data;
16
+ }
17
+
18
+ function _client() {
19
+ const data = require("@nocobase/client");
20
+
21
+ _client = function _client() {
22
+ return data;
23
+ };
24
+
25
+ return data;
26
+ }
27
+
28
+ function _react() {
29
+ const data = _interopRequireDefault(require("react"));
30
+
31
+ _react = function _react() {
32
+ return data;
33
+ };
34
+
35
+ return data;
36
+ }
37
+
38
+ var _actionHooks = require("../action-hooks");
39
+
40
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41
+
42
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
43
+
44
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
45
+
46
+ const _useUpdateCollectionField = record => {
47
+ const collectionName = record.collectionName;
48
+
49
+ const _useUpdateFieldAction = (0, _actionHooks.useUpdateFieldAction)({
50
+ collectionName,
51
+ name: record.name,
52
+ key: record.key
53
+ }),
54
+ run = _useUpdateFieldAction.run;
55
+
56
+ return {
57
+ run() {
58
+ return _asyncToGenerator(function* () {
59
+ yield run();
60
+ })();
61
+ }
62
+
63
+ };
64
+ };
65
+
66
+ const EditFieldAction = ({
67
+ item: record
68
+ }) => {
69
+ return _react().default.createElement(_client().EditFieldAction, {
70
+ item: record,
71
+ scope: {
72
+ useCancelAction: _actionHooks.useCancelAction,
73
+ useUpdateCollectionField: () => _useUpdateCollectionField(record)
74
+ },
75
+ getContainer: () => document.getElementById('graph_container')
76
+ }, _react().default.createElement(_icons().EditOutlined, {
77
+ className: "btn-edit"
78
+ }));
79
+ };
80
+
81
+ exports.EditFieldAction = EditFieldAction;
@@ -0,0 +1,8 @@
1
+ import '@antv/x6-react-shape';
2
+ import React from 'react';
3
+ declare const Entity: React.FC<{
4
+ node?: Node | any;
5
+ setTargetNode: Function | any;
6
+ targetGraph: any;
7
+ }>;
8
+ export default Entity;