@logicflow/extension 2.2.0-alpha.7 → 2.2.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 (125) hide show
  1. package/README.md +16 -0
  2. package/package.json +10 -7
  3. package/.turbo/turbo-build.log +0 -38
  4. package/CHANGELOG.md +0 -1829
  5. package/__test__/bpmn-adapter.test.js +0 -227
  6. package/es/materials/curved-edge/__test__/curved-edge.test.d.ts +0 -1
  7. package/es/materials/curved-edge/__test__/curved-edge.test.js +0 -18
  8. package/jest.config.js +0 -198
  9. package/lib/materials/curved-edge/__test__/curved-edge.test.d.ts +0 -1
  10. package/lib/materials/curved-edge/__test__/curved-edge.test.js +0 -20
  11. package/rollup.config.js +0 -52
  12. package/src/NodeResize/BasicShape/Ellipse.tsx +0 -22
  13. package/src/NodeResize/BasicShape/Polygon.tsx +0 -24
  14. package/src/NodeResize/BasicShape/Rect.tsx +0 -44
  15. package/src/NodeResize/control/Control.tsx +0 -537
  16. package/src/NodeResize/control/ControlGroup.tsx +0 -76
  17. package/src/NodeResize/control/Util.ts +0 -206
  18. package/src/NodeResize/index.ts +0 -26
  19. package/src/NodeResize/node/DiamondResize.tsx +0 -149
  20. package/src/NodeResize/node/EllipseResize.tsx +0 -140
  21. package/src/NodeResize/node/HtmlResize.tsx +0 -125
  22. package/src/NodeResize/node/RectResize.tsx +0 -126
  23. package/src/NodeResize/node/index.ts +0 -4
  24. package/src/bpmn/constant.ts +0 -56
  25. package/src/bpmn/events/EndEvent.ts +0 -73
  26. package/src/bpmn/events/StartEvent.ts +0 -52
  27. package/src/bpmn/events/index.ts +0 -2
  28. package/src/bpmn/flow/SequenceFlow.ts +0 -25
  29. package/src/bpmn/flow/index.ts +0 -1
  30. package/src/bpmn/gateways/ExclusiveGateway.ts +0 -71
  31. package/src/bpmn/gateways/index.ts +0 -1
  32. package/src/bpmn/getBpmnId.ts +0 -31
  33. package/src/bpmn/index.ts +0 -60
  34. package/src/bpmn/tasks/ServiceTask.ts +0 -63
  35. package/src/bpmn/tasks/UserTask.ts +0 -64
  36. package/src/bpmn/tasks/index.ts +0 -2
  37. package/src/bpmn-adapter/bpmnIds.ts +0 -31
  38. package/src/bpmn-adapter/index.ts +0 -835
  39. package/src/bpmn-adapter/json2xml.ts +0 -127
  40. package/src/bpmn-adapter/xml2json.ts +0 -544
  41. package/src/bpmn-elements/README.md +0 -223
  42. package/src/bpmn-elements/__tests__/definition.test.js +0 -72
  43. package/src/bpmn-elements/index.d.ts +0 -26
  44. package/src/bpmn-elements/index.ts +0 -107
  45. package/src/bpmn-elements/presets/Event/EndEventFactory.ts +0 -114
  46. package/src/bpmn-elements/presets/Event/IntermediateCatchEvent.ts +0 -108
  47. package/src/bpmn-elements/presets/Event/IntermediateThrowEvent.ts +0 -109
  48. package/src/bpmn-elements/presets/Event/StartEventFactory.ts +0 -114
  49. package/src/bpmn-elements/presets/Event/boundaryEventFactory.ts +0 -117
  50. package/src/bpmn-elements/presets/Event/index.ts +0 -14
  51. package/src/bpmn-elements/presets/Flow/flow.d.ts +0 -6
  52. package/src/bpmn-elements/presets/Flow/index.ts +0 -8
  53. package/src/bpmn-elements/presets/Flow/manhattan.ts +0 -691
  54. package/src/bpmn-elements/presets/Flow/sequenceFlow.ts +0 -65
  55. package/src/bpmn-elements/presets/Gateway/gateway.ts +0 -107
  56. package/src/bpmn-elements/presets/Gateway/index.ts +0 -23
  57. package/src/bpmn-elements/presets/Pool/Lane.ts +0 -211
  58. package/src/bpmn-elements/presets/Pool/Pool.ts +0 -284
  59. package/src/bpmn-elements/presets/Pool/index.ts +0 -89
  60. package/src/bpmn-elements/presets/Task/index.ts +0 -122
  61. package/src/bpmn-elements/presets/Task/subProcess.ts +0 -189
  62. package/src/bpmn-elements/presets/Task/task.ts +0 -193
  63. package/src/bpmn-elements/presets/icons.ts +0 -155
  64. package/src/bpmn-elements/utils.ts +0 -52
  65. package/src/bpmn-elements-adapter/README.md +0 -293
  66. package/src/bpmn-elements-adapter/__tests__/adapter_in.test.js +0 -528
  67. package/src/bpmn-elements-adapter/__tests__/adapter_out.test.js +0 -569
  68. package/src/bpmn-elements-adapter/constant.ts +0 -76
  69. package/src/bpmn-elements-adapter/index.ts +0 -1134
  70. package/src/bpmn-elements-adapter/json2xml.ts +0 -105
  71. package/src/bpmn-elements-adapter/xml2json.ts +0 -542
  72. package/src/components/context-menu/index.ts +0 -253
  73. package/src/components/control/index.ts +0 -155
  74. package/src/components/dnd-panel/index.ts +0 -137
  75. package/src/components/highlight/index.ts +0 -227
  76. package/src/components/menu/index.ts +0 -748
  77. package/src/components/mini-map/index.ts +0 -686
  78. package/src/components/selection-select/index.ts +0 -387
  79. package/src/dynamic-group/index.ts +0 -774
  80. package/src/dynamic-group/model.ts +0 -580
  81. package/src/dynamic-group/node.ts +0 -288
  82. package/src/dynamic-group/utils.ts +0 -46
  83. package/src/index.less +0 -1
  84. package/src/index.ts +0 -47
  85. package/src/insert-node-in-polyline/edge.ts +0 -175
  86. package/src/insert-node-in-polyline/index.ts +0 -193
  87. package/src/materials/curved-edge/__test__/curved-edge.test.ts +0 -46
  88. package/src/materials/curved-edge/index.ts +0 -217
  89. package/src/materials/group/GroupNode.ts +0 -437
  90. package/src/materials/group/index.ts +0 -542
  91. package/src/materials/node-selection/index.ts +0 -380
  92. package/src/mindmap/fakerRoot.ts +0 -19
  93. package/src/mindmap/index.ts +0 -328
  94. package/src/mindmap/markContent.ts +0 -81
  95. package/src/mindmap/markContentOption.ts +0 -81
  96. package/src/mindmap/markEntity.ts +0 -82
  97. package/src/mindmap/markRoot.ts +0 -83
  98. package/src/mindmap/theme.ts +0 -11
  99. package/src/pool/LaneModel.ts +0 -226
  100. package/src/pool/LaneView.ts +0 -220
  101. package/src/pool/PoolModel.ts +0 -631
  102. package/src/pool/PoolView.ts +0 -75
  103. package/src/pool/constant.ts +0 -19
  104. package/src/pool/index.ts +0 -621
  105. package/src/pool/utils.ts +0 -46
  106. package/src/rect-label-node/RectLabelNodeView.ts +0 -33
  107. package/src/rect-label-node/index.ts +0 -15
  108. package/src/style/index.less +0 -381
  109. package/src/style/raw.ts +0 -328
  110. package/src/tools/auto-layout/index.ts +0 -282
  111. package/src/tools/flow-path/index.ts +0 -233
  112. package/src/tools/label/Label.tsx +0 -357
  113. package/src/tools/label/LabelModel.ts +0 -83
  114. package/src/tools/label/LabelOverlay.tsx +0 -162
  115. package/src/tools/label/algorithm.ts +0 -42
  116. package/src/tools/label/index.ts +0 -479
  117. package/src/tools/label/mediumEditor.ts +0 -121
  118. package/src/tools/label/utils.ts +0 -395
  119. package/src/tools/proximity-connect/index.ts +0 -435
  120. package/src/tools/snapshot/README.md +0 -145
  121. package/src/tools/snapshot/index.ts +0 -701
  122. package/src/tools/snapshot/utils.ts +0 -163
  123. package/src/turbo-adapter/index.ts +0 -212
  124. package/stats.html +0 -4842
  125. package/tsconfig.json +0 -18
@@ -1,227 +0,0 @@
1
- import { toXmlJson, toNormalJson } from '../src/bpmn-adapter/index'
2
- import { lfJson2Xml } from '../src/bpmn-adapter/json2xml'
3
- import { lfXml2Json } from '../src/bpmn-adapter/xml2json'
4
-
5
- /**
6
- * @jest-environment jsdom
7
- */
8
- test('transform data from json to xml', () => {
9
- const testObj = {
10
- nodes: [
11
- {
12
- id: 'node_1',
13
- type: 'rect',
14
- x: 100,
15
- y: 200,
16
- properties: {},
17
- },
18
- {
19
- id: 'node_2',
20
- type: 'circle',
21
- x: 300,
22
- y: 160,
23
- properties: {},
24
- },
25
- ],
26
- edges: [
27
- {
28
- id: 'ca1dea84-c5e8-4344-b888-8bb09666ac42',
29
- type: 'polyline',
30
- sourceNodeId: 'node_1',
31
- targetNodeId: 'node_2',
32
- startPoint: {
33
- x: 150,
34
- y: 200,
35
- },
36
- endPoint: {
37
- x: 250,
38
- y: 160,
39
- },
40
- properties: {},
41
- pointsList: [
42
- {
43
- x: 150,
44
- y: 200,
45
- },
46
- {
47
- x: 200,
48
- y: 200,
49
- },
50
- {
51
- x: 200,
52
- y: 160,
53
- },
54
- {
55
- x: 250,
56
- y: 160,
57
- },
58
- ],
59
- },
60
- ],
61
- }
62
- expect(toXmlJson()(testObj)).toStrictEqual({
63
- nodes: [
64
- {
65
- '-id': 'node_1',
66
- '-type': 'rect',
67
- '-x': 100,
68
- '-y': 200,
69
- '-properties': {},
70
- },
71
- {
72
- '-id': 'node_2',
73
- '-type': 'circle',
74
- '-x': 300,
75
- '-y': 160,
76
- '-properties': {},
77
- },
78
- ],
79
- edges: [
80
- {
81
- '-id': 'ca1dea84-c5e8-4344-b888-8bb09666ac42',
82
- '-type': 'polyline',
83
- '-sourceNodeId': 'node_1',
84
- '-targetNodeId': 'node_2',
85
- '-startPoint': {
86
- '-x': 150,
87
- '-y': 200,
88
- },
89
- '-endPoint': {
90
- '-x': 250,
91
- '-y': 160,
92
- },
93
- '-properties': {},
94
- '-pointsList': [
95
- {
96
- '-x': 150,
97
- '-y': 200,
98
- },
99
- {
100
- '-x': 200,
101
- '-y': 200,
102
- },
103
- {
104
- '-x': 200,
105
- '-y': 160,
106
- },
107
- {
108
- '-x': 250,
109
- '-y': 160,
110
- },
111
- ],
112
- },
113
- ],
114
- })
115
-
116
- const xmlJson = toXmlJson()(testObj)
117
- expect(toNormalJson(xmlJson)).toStrictEqual({
118
- nodes: [
119
- {
120
- id: 'node_1',
121
- type: 'rect',
122
- x: 100,
123
- y: 200,
124
- properties: {},
125
- },
126
- {
127
- id: 'node_2',
128
- type: 'circle',
129
- x: 300,
130
- y: 160,
131
- properties: {},
132
- },
133
- ],
134
- edges: [
135
- {
136
- id: 'ca1dea84-c5e8-4344-b888-8bb09666ac42',
137
- type: 'polyline',
138
- sourceNodeId: 'node_1',
139
- targetNodeId: 'node_2',
140
- startPoint: {
141
- x: 150,
142
- y: 200,
143
- },
144
- endPoint: {
145
- x: 250,
146
- y: 160,
147
- },
148
- properties: {},
149
- pointsList: [
150
- {
151
- x: 150,
152
- y: 200,
153
- },
154
- {
155
- x: 200,
156
- y: 200,
157
- },
158
- {
159
- x: 200,
160
- y: 160,
161
- },
162
- {
163
- x: 250,
164
- y: 160,
165
- },
166
- ],
167
- },
168
- ],
169
- })
170
-
171
- expect(lfJson2Xml(xmlJson)).toStrictEqual(
172
- '\t\n <nodes id="node_1" type="rect" x="100" y="200" properties="{}" />\t\n <nodes id="node_2" type="circle" x="300" y="160" properties="{}" />\t\n <edges id="ca1dea84-c5e8-4344-b888-8bb09666ac42" type="polyline" sourceNodeId="node_1" targetNodeId="node_2" startPoint="{\'x\':150,\'y\':200}" endPoint="{\'x\':250,\'y\':160}" properties="{}" pointsList="[{\'x\':150,\'y\':200},{\'x\':200,\'y\':200},{\'x\':200,\'y\':160},{\'x\':250,\'y\':160}]" />',
173
- )
174
-
175
- const xml = lfJson2Xml(xmlJson)
176
- expect(lfXml2Json(xml)).toStrictEqual({
177
- nodes: [
178
- {
179
- '-id': 'node_1',
180
- '-type': 'rect',
181
- '-x': 100,
182
- '-y': 200,
183
- '-properties': {},
184
- },
185
- {
186
- '-id': 'node_2',
187
- '-type': 'circle',
188
- '-x': 300,
189
- '-y': 160,
190
- '-properties': {},
191
- },
192
- ],
193
- edges: {
194
- '-id': 'ca1dea84-c5e8-4344-b888-8bb09666ac42',
195
- '-type': 'polyline',
196
- '-sourceNodeId': 'node_1',
197
- '-targetNodeId': 'node_2',
198
- '-startPoint': {
199
- x: 150,
200
- y: 200,
201
- },
202
- '-endPoint': {
203
- x: 250,
204
- y: 160,
205
- },
206
- '-properties': {},
207
- '-pointsList': [
208
- {
209
- x: 150,
210
- y: 200,
211
- },
212
- {
213
- x: 200,
214
- y: 200,
215
- },
216
- {
217
- x: 200,
218
- y: 160,
219
- },
220
- {
221
- x: 250,
222
- y: 160,
223
- },
224
- ],
225
- },
226
- })
227
- })
@@ -1,18 +0,0 @@
1
- import { getCurvedEdgePath } from '../index';
2
- describe('test curved edge ', function () {
3
- test('path calculation', function () {
4
- var radius = 5;
5
- var points1 = '460,150 670,150';
6
- var path1 = 'M460 150 L 670 150';
7
- expect(getCurvedEdgePath(points1.split(' ').map(function (p) { return p.split(',').map(function (a) { return +a; }); }), radius)).toBe(path1);
8
- var points2 = '510,250 540,250 540,175 490,175 490,100 520,100';
9
- var path2 = 'M510 250L 510 250L 535 250 Q 540 250 540 245L 540 245L 540 180 Q 540 175 535 175L 535 175L 495 175 Q 490 175 490 170L 490 170L 490 105 Q 490 100 495 100L 520 100';
10
- expect(getCurvedEdgePath(points2.split(' ').map(function (p) { return p.split(',').map(function (a) { return +a; }); }), radius)).toBe(path2);
11
- var points3 = '690,120 720,120 720,50 560,50 560,260 690,260';
12
- var path3 = 'M690 120L 690 120L 715 120 Q 720 120 720 115L 720 115L 720 55 Q 720 50 715 50L 715 50L 565 50 Q 560 50 560 55L 560 55L 560 255 Q 560 260 565 260L 690 260';
13
- expect(getCurvedEdgePath(points3.split(' ').map(function (p) { return p.split(',').map(function (a) { return +a; }); }), radius)).toBe(path3);
14
- var point4 = '690,180 690,210 660,210 660,190 630,190 630,220';
15
- var path4 = 'M690 180L 690 180L 690 205 Q 690 210 685 210L 685 210L 665 210 Q 660 210 660 205L 660 205L 660 195 Q 660 190 655 190L 655 190L 635 190 Q 630 190 630 195L 630 220';
16
- expect(getCurvedEdgePath(point4.split(' ').map(function (p) { return p.split(',').map(function (a) { return +a; }); }), radius)).toBe(path4);
17
- });
18
- });
package/jest.config.js DELETED
@@ -1,198 +0,0 @@
1
- /* eslint-disable max-len */
2
- /*
3
- * For a detailed explanation regarding each configuration property, visit:
4
- * https://jestjs.io/docs/en/configuration.html
5
- */
6
-
7
- module.exports = {
8
- // All imported modules in your tests should be mocked automatically
9
- // automock: false,
10
-
11
- // Stop running tests after `n` failures
12
- // bail: 0,
13
-
14
- // The directory where Jest should store its cached dependency information
15
- // cacheDirectory: "/private/var/folders/xw/v6yjfmzn2hvglj9fm0cb4xbm0000ks/T/jest_gp",
16
-
17
- // Automatically clear mock calls and instances between every test
18
- // clearMocks: false,
19
-
20
- // Indicates whether the coverage information should be collected while executing the test
21
- // collectCoverage: false,
22
-
23
- // An array of glob patterns indicating a set of files for which coverage information should be collected
24
- // collectCoverageFrom: undefined,
25
-
26
- // The directory where Jest should output its coverage files
27
- coverageDirectory: 'coverage',
28
-
29
- // An array of regexp pattern strings used to skip coverage collection
30
- // coveragePathIgnorePatterns: [
31
- // "/node_modules/"
32
- // ],
33
-
34
- // Indicates which provider should be used to instrument code for coverage
35
- coverageProvider: 'v8',
36
-
37
- // A list of reporter names that Jest uses when writing coverage reports
38
- // coverageReporters: [
39
- // "json",
40
- // "text",
41
- // "lcov",
42
- // "clover"
43
- // ],
44
-
45
- // An object that configures minimum threshold enforcement for coverage results
46
- // coverageThreshold: undefined,
47
-
48
- // A path to a custom dependency extractor
49
- // dependencyExtractor: undefined,
50
-
51
- // Make calling deprecated APIs throw helpful error messages
52
- // errorOnDeprecated: false,
53
-
54
- // Force coverage collection from ignored files using an array of glob patterns
55
- // forceCoverageMatch: [],
56
-
57
- // A path to a module which exports an async function that is triggered once before all test suites
58
- // globalSetup: undefined,
59
-
60
- // A path to a module which exports an async function that is triggered once after all test suites
61
- // globalTeardown: undefined,
62
-
63
- // A set of global variables that need to be available in all test environments
64
- // globals: {},
65
-
66
- // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
67
- // maxWorkers: "50%",
68
-
69
- // An array of directory names to be searched recursively up from the requiring module's location
70
- // moduleDirectories: [
71
- // "node_modules"
72
- // ],
73
-
74
- // An array of file extensions your modules use
75
- // moduleFileExtensions: [
76
- // "js",
77
- // "json",
78
- // "jsx",
79
- // "ts",
80
- // "tsx",
81
- // "node"
82
- // ],
83
-
84
- // A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
85
- // moduleNameMapper: {},
86
- moduleNameMapper: {
87
- '^lodash-es$': 'lodash',
88
- },
89
-
90
- // An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
91
- // modulePathIgnorePatterns: [],
92
-
93
- // Activates notifications for test results
94
- // notify: false,
95
-
96
- // An enum that specifies notification mode. Requires { notify: true }
97
- // notifyMode: "failure-change",
98
-
99
- // A preset that is used as a base for Jest's configuration
100
- // preset: undefined,
101
-
102
- // Run tests from one or more projects
103
- // projects: undefined,
104
-
105
- // Use this configuration option to add custom reporters to Jest
106
- // reporters: undefined,
107
-
108
- // Automatically reset mock state between every test
109
- // resetMocks: false,
110
-
111
- // Reset the module registry before running each individual test
112
- // resetModules: false,
113
-
114
- // A path to a custom resolver
115
- // resolver: undefined,
116
-
117
- // Automatically restore mock state between every test
118
- // restoreMocks: false,
119
-
120
- // The root directory that Jest should scan for tests and modules within
121
- // rootDir: undefined,
122
-
123
- // A list of paths to directories that Jest should use to search for files in
124
- // roots: [
125
- // "<rootDir>"
126
- // ],
127
-
128
- // Allows you to use a custom runner instead of Jest's default test runner
129
- // runner: "jest-runner",
130
-
131
- // The paths to modules that run some code to configure or set up the testing environment before each test
132
- // setupFiles: [],
133
-
134
- // A list of paths to modules that run some code to configure or set up the testing framework before each test
135
- // setupFilesAfterEnv: [],
136
-
137
- // The number of seconds after which a test is considered as slow and reported as such in the results.
138
- // slowTestThreshold: 5,
139
-
140
- // A list of paths to snapshot serializer modules Jest should use for snapshot testing
141
- // snapshotSerializers: [],
142
-
143
- // The test environment that will be used for testing
144
- testEnvironment: 'jest-environment-jsdom',
145
-
146
- // Options that will be passed to the testEnvironment
147
- // testEnvironmentOptions: {},
148
-
149
- // Adds a location field to test results
150
- // testLocationInResults: false,
151
-
152
- // The glob patterns Jest uses to detect test files
153
- // testMatch: [
154
- // "**/__tests__/**/*.[jt]s?(x)",
155
- // "**/?(*.)+(spec|test).[tj]s?(x)"
156
- // ],
157
-
158
- // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
159
- // testPathIgnorePatterns: [
160
- // "/node_modules/"
161
- // ],
162
-
163
- // The regexp pattern or array of patterns that Jest uses to detect test files
164
- // testRegex: [],
165
-
166
- // This option allows the use of a custom results processor
167
- // testResultsProcessor: undefined,
168
-
169
- // This option allows use of a custom test runner
170
- // testRunner: "jasmine2",
171
-
172
- // This option sets the URL for the jsdom environment. It is reflected in properties such as location.href
173
- // testURL: "http://localhost",
174
-
175
- // Setting this value to "fake" allows the use of fake timers for functions such as "setTimeout"
176
- // timers: "real",
177
-
178
- // A map from regular expressions to paths to transformers
179
- // transform: undefined,
180
-
181
- // An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
182
- // transformIgnorePatterns: [
183
- // "/node_modules/",
184
- // "\\.pnp\\.[^\\/]+$"
185
- // ],
186
-
187
- // An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
188
- // unmockedModulePathPatterns: undefined,
189
-
190
- // Indicates whether each individual test should be reported during the run
191
- // verbose: undefined,
192
-
193
- // An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
194
- // watchPathIgnorePatterns: [],
195
-
196
- // Whether to use watchman for file crawling
197
- // watchman: true,
198
- }
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var index_1 = require("../index");
4
- describe('test curved edge ', function () {
5
- test('path calculation', function () {
6
- var radius = 5;
7
- var points1 = '460,150 670,150';
8
- var path1 = 'M460 150 L 670 150';
9
- expect((0, index_1.getCurvedEdgePath)(points1.split(' ').map(function (p) { return p.split(',').map(function (a) { return +a; }); }), radius)).toBe(path1);
10
- var points2 = '510,250 540,250 540,175 490,175 490,100 520,100';
11
- var path2 = 'M510 250L 510 250L 535 250 Q 540 250 540 245L 540 245L 540 180 Q 540 175 535 175L 535 175L 495 175 Q 490 175 490 170L 490 170L 490 105 Q 490 100 495 100L 520 100';
12
- expect((0, index_1.getCurvedEdgePath)(points2.split(' ').map(function (p) { return p.split(',').map(function (a) { return +a; }); }), radius)).toBe(path2);
13
- var points3 = '690,120 720,120 720,50 560,50 560,260 690,260';
14
- var path3 = 'M690 120L 690 120L 715 120 Q 720 120 720 115L 720 115L 720 55 Q 720 50 715 50L 715 50L 565 50 Q 560 50 560 55L 560 55L 560 255 Q 560 260 565 260L 690 260';
15
- expect((0, index_1.getCurvedEdgePath)(points3.split(' ').map(function (p) { return p.split(',').map(function (a) { return +a; }); }), radius)).toBe(path3);
16
- var point4 = '690,180 690,210 660,210 660,190 630,190 630,220';
17
- var path4 = 'M690 180L 690 180L 690 205 Q 690 210 685 210L 685 210L 665 210 Q 660 210 660 205L 660 205L 660 195 Q 660 190 655 190L 655 190L 635 190 Q 630 190 630 195L 630 220';
18
- expect((0, index_1.getCurvedEdgePath)(point4.split(' ').map(function (p) { return p.split(',').map(function (a) { return +a; }); }), radius)).toBe(path4);
19
- });
20
- });
package/rollup.config.js DELETED
@@ -1,52 +0,0 @@
1
- import path from 'node:path'
2
- import postcss from 'rollup-plugin-postcss'
3
- import postcssUrl from 'postcss-url'
4
- import postcssImport from 'postcss-import'
5
- import { rollupConfig } from '../../rollup.config'
6
-
7
- export default [
8
- {
9
- input: 'src/index.less',
10
- output: [
11
- {
12
- file: 'dist/index.css',
13
- },
14
- {
15
- file: 'lib/index.css',
16
- },
17
- {
18
- file: 'lib/style/index.css',
19
- },
20
- {
21
- file: 'es/index.css',
22
- },
23
- {
24
- file: 'es/style/index.css',
25
- },
26
- ],
27
- plugins: [
28
- postcss({
29
- plugins: [
30
- postcssImport({
31
- resolve: (id) => {
32
- if (id.startsWith('~')) {
33
- return path.resolve('node_modules', id.slice(1))
34
- }
35
- return id
36
- },
37
- }),
38
- postcssUrl({
39
- url: 'inline', // 选择 'inline' 选项将外部资源内联到最终的 CSS 文件中
40
- // maxSize: 10, // 以KB为单位的最大文件大小,超过此大小的文件将不会被内联
41
- }),
42
- ],
43
- use: [['less', { javascriptEnabled: true }]],
44
- extract: true,
45
- // extract: 'index.css', // 提取到一个单独的 CSS 文件
46
- // extract: path.resolve('dist/index.css'), // 提取到一个单独的 CSS 文件
47
- minimize: true,
48
- }),
49
- ],
50
- },
51
- rollupConfig(),
52
- ]
@@ -1,22 +0,0 @@
1
- import { h } from '@logicflow/core'
2
-
3
- function Ellipse(props: Record<string, any>): h.JSX.Element {
4
- const { x = 0, y = 0, rx = 4, ry = 4 } = props
5
-
6
- const attrs = {
7
- cx: x,
8
- cy: y,
9
- rx,
10
- ry,
11
- fill: 'transparent',
12
- fillOpacity: 1,
13
- strokeWidth: 1,
14
- stroke: '#000',
15
- strokeOpacity: 1,
16
- ...props,
17
- }
18
-
19
- return <ellipse {...attrs} />
20
- }
21
-
22
- export default Ellipse
@@ -1,24 +0,0 @@
1
- import { h } from '@logicflow/core'
2
-
3
- export default function Polygon({
4
- fillOpacity = 1,
5
- strokeWidth = 1,
6
- strokeOpacity = 1,
7
- fill = 'transparent',
8
- stroke = '#000',
9
- points,
10
- className = 'lf-basic-shape',
11
- }: any): h.JSX.Element {
12
- const attrs = {
13
- fill,
14
- fillOpacity,
15
- strokeWidth,
16
- stroke,
17
- strokeOpacity,
18
- points: '',
19
- className,
20
- }
21
- attrs.points = points.map((point: any) => point.join(',')).join(' ')
22
-
23
- return <polygon {...attrs} />
24
- }
@@ -1,44 +0,0 @@
1
- import LogicFlow from '@logicflow/core'
2
-
3
- import Point = LogicFlow.Point
4
- import RectSize = LogicFlow.RectSize
5
-
6
- type IProps = {
7
- className?: string
8
- radius?: number
9
- stroke?: string
10
- strokeDasharray?: string
11
- } & Point &
12
- RectSize
13
-
14
- export default function Rect(props: IProps) {
15
- const { x, y, width = 10, height = 10, radius, className } = props
16
-
17
- const leftTopX = x - width / 2
18
- const leftTopY = y - height / 2
19
-
20
- const attrs = {
21
- // default
22
- cx: 0,
23
- cy: 0,
24
- rx: radius || 0,
25
- ry: radius || 0,
26
- fill: 'transparent',
27
- fillOpacity: 1,
28
- strokeWidth: '1px',
29
- stroke: '#000',
30
- strokeOpacity: 1,
31
- className: `lf-basic-shape ${className}`,
32
- ...props,
33
- x: leftTopX,
34
- y: leftTopY,
35
- }
36
- return <rect {...attrs} />
37
- }
38
-
39
- Rect.defaultProps = {
40
- radius: 0,
41
- stroke: '',
42
- strokeDasharray: '',
43
- className: '',
44
- }