@next-core/editor-bricks-helper 0.32.33 → 0.33.0

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/CHANGELOG.md CHANGED
@@ -3,15 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [0.32.33](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.32...@next-core/editor-bricks-helper@0.32.33) (2021-12-06)
6
+ # [0.33.0](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.36...@next-core/editor-bricks-helper@0.33.0) (2021-12-23)
7
7
 
8
- **Note:** Version bump only for package @next-core/editor-bricks-helper
9
8
 
9
+ ### Features
10
10
 
11
+ * display brick alias/id/dataset.testid/brick.name in order ([3645841](https://github.com/easyops-cn/next-core/commit/3645841ccf12f8ca3fe74f673a541ec75ff45d1c))
11
12
 
12
13
 
13
14
 
14
- ## [0.32.32](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.31...@next-core/editor-bricks-helper@0.32.32) (2021-12-05)
15
+
16
+
17
+ ## [0.32.36](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.35...@next-core/editor-bricks-helper@0.32.36) (2021-12-17)
15
18
 
16
19
  **Note:** Version bump only for package @next-core/editor-bricks-helper
17
20
 
@@ -19,118 +22,78 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
19
22
 
20
23
 
21
24
 
22
- ## [0.32.31](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.30...@next-core/editor-bricks-helper@0.32.31) (2021-12-03)
25
+ ## [0.32.35](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.34...@next-core/editor-bricks-helper@0.32.35) (2021-12-15)
23
26
 
24
27
  **Note:** Version bump only for package @next-core/editor-bricks-helper
25
28
 
29
+ ## [0.32.34](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.33...@next-core/editor-bricks-helper@0.32.34) (2021-12-06)
26
30
 
31
+ **Note:** Version bump only for package @next-core/editor-bricks-helper
27
32
 
33
+ ## [0.32.33](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.32...@next-core/editor-bricks-helper@0.32.33) (2021-12-06)
28
34
 
35
+ **Note:** Version bump only for package @next-core/editor-bricks-helper
29
36
 
30
- ## [0.32.30](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.29...@next-core/editor-bricks-helper@0.32.30) (2021-12-03)
37
+ ## [0.32.32](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.31...@next-core/editor-bricks-helper@0.32.32) (2021-12-05)
31
38
 
32
39
  **Note:** Version bump only for package @next-core/editor-bricks-helper
33
40
 
41
+ ## [0.32.31](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.30...@next-core/editor-bricks-helper@0.32.31) (2021-12-03)
34
42
 
43
+ **Note:** Version bump only for package @next-core/editor-bricks-helper
35
44
 
45
+ ## [0.32.30](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.29...@next-core/editor-bricks-helper@0.32.30) (2021-12-03)
36
46
 
47
+ **Note:** Version bump only for package @next-core/editor-bricks-helper
37
48
 
38
49
  ## [0.32.29](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.28...@next-core/editor-bricks-helper@0.32.29) (2021-12-01)
39
50
 
40
51
  **Note:** Version bump only for package @next-core/editor-bricks-helper
41
52
 
42
-
43
-
44
-
45
-
46
53
  ## [0.32.28](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.27...@next-core/editor-bricks-helper@0.32.28) (2021-11-29)
47
54
 
48
55
  **Note:** Version bump only for package @next-core/editor-bricks-helper
49
56
 
50
-
51
-
52
-
53
-
54
57
  ## [0.32.27](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.26...@next-core/editor-bricks-helper@0.32.27) (2021-11-26)
55
58
 
56
59
  **Note:** Version bump only for package @next-core/editor-bricks-helper
57
60
 
58
-
59
-
60
-
61
-
62
61
  ## [0.32.26](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.25...@next-core/editor-bricks-helper@0.32.26) (2021-11-25)
63
62
 
64
63
  **Note:** Version bump only for package @next-core/editor-bricks-helper
65
64
 
66
-
67
-
68
-
69
-
70
65
  ## [0.32.25](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.24...@next-core/editor-bricks-helper@0.32.25) (2021-11-25)
71
66
 
72
67
  **Note:** Version bump only for package @next-core/editor-bricks-helper
73
68
 
74
-
75
-
76
-
77
-
78
69
  ## [0.32.24](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.23...@next-core/editor-bricks-helper@0.32.24) (2021-11-25)
79
70
 
80
71
  **Note:** Version bump only for package @next-core/editor-bricks-helper
81
72
 
82
-
83
-
84
-
85
-
86
73
  ## [0.32.23](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.22...@next-core/editor-bricks-helper@0.32.23) (2021-11-25)
87
74
 
88
75
  **Note:** Version bump only for package @next-core/editor-bricks-helper
89
76
 
90
-
91
-
92
-
93
-
94
77
  ## [0.32.22](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.21...@next-core/editor-bricks-helper@0.32.22) (2021-11-23)
95
78
 
96
79
  **Note:** Version bump only for package @next-core/editor-bricks-helper
97
80
 
98
-
99
-
100
-
101
-
102
81
  ## [0.32.21](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.20...@next-core/editor-bricks-helper@0.32.21) (2021-11-23)
103
82
 
104
83
  **Note:** Version bump only for package @next-core/editor-bricks-helper
105
84
 
106
-
107
-
108
-
109
-
110
85
  ## [0.32.20](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.19...@next-core/editor-bricks-helper@0.32.20) (2021-11-23)
111
86
 
112
87
  **Note:** Version bump only for package @next-core/editor-bricks-helper
113
88
 
114
-
115
-
116
-
117
-
118
89
  ## [0.32.19](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.18...@next-core/editor-bricks-helper@0.32.19) (2021-11-18)
119
90
 
120
91
  **Note:** Version bump only for package @next-core/editor-bricks-helper
121
92
 
122
-
123
-
124
-
125
-
126
93
  ## [0.32.18](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.17...@next-core/editor-bricks-helper@0.32.18) (2021-11-18)
127
94
 
128
95
  **Note:** Version bump only for package @next-core/editor-bricks-helper
129
96
 
130
-
131
-
132
-
133
-
134
97
  ## [0.32.17](https://github.com/easyops-cn/next-core/compare/@next-core/editor-bricks-helper@0.32.16...@next-core/editor-bricks-helper@0.32.17) (2021-11-12)
135
98
 
136
99
  **Note:** Version bump only for package @next-core/editor-bricks-helper
@@ -414,10 +414,11 @@
414
414
  }
415
415
  }
416
416
 
417
- var nodeIgnoreFields = ["parent", "children", "graphInfo", "mountPoint"];
418
- function getBuilderNode(nodeData, nodeUid, isTemplateInternalNode) {
419
- var _nodeData$alias;
417
+ var nodeIgnoreFields = ["parent", "children", "graphInfo", "mountPoint"]; // Match evaluations and placeholders,
418
+ // E.g.: `<% QUERY.x %>` or `${QUERY.x}`.
420
419
 
420
+ var computationRegExp = /[<{]/;
421
+ function getBuilderNode(nodeData, nodeUid, isTemplateInternalNode) {
421
422
  var matchedSelectors = [];
422
423
 
423
424
  if (nodeData.brick) {
@@ -427,19 +428,29 @@
427
428
  var normalized = brickUtils.normalizeBuilderNode(nodeData);
428
429
  var jsonFieldsInBrick = ["properties", "events", "lifeCycle"];
429
430
  var parsedFields = [];
431
+ var parsedId;
432
+ var parsedTestId;
430
433
 
431
434
  for (var field of jsonFieldsInBrick) {
432
435
  var parsed = lodash.cloneDeep(normalized === null || normalized === void 0 ? void 0 : normalized[field]);
433
436
  parsedFields.push(["$$parsed".concat(lodash.upperFirst(field)), parsed !== null && parsed !== void 0 ? parsed : {}]);
434
437
 
435
- if (field === "properties" && parsed !== null && parsed !== void 0 && parsed.id && typeof parsed.id === "string" && // Ignore evaluations and placeholders,
436
- // E.g.: `<% QUERY.x %>` or `${QUERY.x}`.
437
- !/[<{]/.test(parsed.id)) {
438
- matchedSelectors.push("#".concat(parsed.id));
438
+ if (field === "properties") {
439
+ var _parsed$dataset;
440
+
441
+ var tempParsedId = void 0;
442
+ var tempParsedTestId = void 0;
443
+
444
+ if ((tempParsedId = parsed === null || parsed === void 0 ? void 0 : parsed.id, typeof tempParsedId === "string") && !computationRegExp.test(tempParsedId)) {
445
+ parsedId = tempParsedId;
446
+ matchedSelectors.push("#".concat(parsedId));
447
+ } else if ((tempParsedTestId = parsed === null || parsed === void 0 ? void 0 : (_parsed$dataset = parsed.dataset) === null || _parsed$dataset === void 0 ? void 0 : _parsed$dataset.testid, typeof tempParsedTestId === "string") && !computationRegExp.test(tempParsedTestId)) {
448
+ parsedTestId = tempParsedTestId;
449
+ }
439
450
  }
440
451
  }
441
452
 
442
- return Object.fromEntries(Object.entries(nodeData).filter(entry => !nodeIgnoreFields.includes(entry[0])).concat([["alias", (_nodeData$alias = nodeData.alias) !== null && _nodeData$alias !== void 0 ? _nodeData$alias : brickUtils.isBrickNode(nodeData) ? nodeData.brick.split(".").pop() : undefined], ["$$uid", nodeUid], ["$$matchedSelectors", matchedSelectors], ["$$isTemplateInternalNode", isTemplateInternalNode], ["$$normalized", normalized]]).concat(parsedFields));
453
+ return Object.fromEntries(Object.entries(nodeData).filter(entry => !nodeIgnoreFields.includes(entry[0])).concat([["alias", nodeData.alias || (brickUtils.isBrickNode(nodeData) ? parsedId || parsedTestId || nodeData.brick.split(".").pop() : undefined)], ["$$uid", nodeUid], ["$$matchedSelectors", matchedSelectors], ["$$isTemplateInternalNode", isTemplateInternalNode], ["$$normalized", normalized]]).concat(parsedFields));
443
454
  }
444
455
 
445
456
  function getAppendingNodesAndEdges(nodeData, nodeUid, templateSourceMap) {