@uipath/apollo-react 6.16.0 → 6.16.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.
@@ -95,36 +95,42 @@ function resolveAxisCandidate(dragged, others, threshold, orientation) {
95
95
  }
96
96
  return candidates.filter(({ delta })=>Math.abs(delta) <= threshold).sort((a, b)=>Math.abs(a.delta) - Math.abs(b.delta) || a.priority - b.priority || a.position - b.position || a.matchedNodeId.localeCompare(b.matchedNodeId))[0];
97
97
  }
98
- function buildGuide(candidate, dragged, others, orientation) {
99
- const matchingOthers = others.filter((other)=>{
100
- const anchors = getAxisAnchors(other, orientation);
101
- const candidateAnchors = 'center' === candidate.kind ? [
102
- anchors[1]
103
- ] : [
104
- anchors[0],
105
- anchors[2]
98
+ function buildAlignedGuides(dragged, others, orientation) {
99
+ const draggedAnchors = getAxisAnchors(dragged, orientation);
100
+ return draggedAnchors.flatMap((position, draggedIndex)=>{
101
+ const matchingOthers = others.filter((other)=>{
102
+ const anchors = getAxisAnchors(other, orientation);
103
+ const comparableAnchors = 1 === draggedIndex ? [
104
+ anchors[1]
105
+ ] : [
106
+ anchors[0],
107
+ anchors[2]
108
+ ];
109
+ return comparableAnchors.some((anchor)=>Math.abs(anchor - position) < 0.5);
110
+ });
111
+ if (0 === matchingOthers.length) return [];
112
+ const ranges = [
113
+ dragged,
114
+ ...matchingOthers
115
+ ].map((bounds)=>'vertical' === orientation ? [
116
+ bounds.y1,
117
+ bounds.y2
118
+ ] : [
119
+ bounds.x1,
120
+ bounds.x2
121
+ ]);
122
+ return [
123
+ {
124
+ id: `${orientation}-${draggedIndex}-${position}`,
125
+ orientation,
126
+ position,
127
+ start: Math.min(...ranges.map(([rangeStart])=>rangeStart)),
128
+ end: Math.max(...ranges.map(([, rangeEnd])=>rangeEnd)),
129
+ kind: 1 === draggedIndex ? 'center' : 'edge',
130
+ matchedNodeIds: matchingOthers.map(({ id })=>id)
131
+ }
106
132
  ];
107
- return candidateAnchors.some((anchor)=>Math.abs(anchor - candidate.position) < 0.5);
108
133
  });
109
- const ranges = [
110
- dragged,
111
- ...matchingOthers
112
- ].map((bounds)=>'vertical' === orientation ? [
113
- bounds.y1,
114
- bounds.y2
115
- ] : [
116
- bounds.x1,
117
- bounds.x2
118
- ]);
119
- return {
120
- id: `${orientation}-${candidate.position}`,
121
- orientation,
122
- position: candidate.position,
123
- start: Math.min(...ranges.map(([rangeStart])=>rangeStart)),
124
- end: Math.max(...ranges.map(([, rangeEnd])=>rangeEnd)),
125
- kind: candidate.kind,
126
- matchedNodeIds: matchingOthers.map(({ id })=>id)
127
- };
128
134
  }
129
135
  function computeAlignmentResult(dragged, others, threshold) {
130
136
  const vertical = resolveAxisCandidate(dragged, others, threshold, 'vertical');
@@ -143,12 +149,8 @@ function computeAlignmentResult(dragged, others, threshold) {
143
149
  cy: dragged.cy + delta.dy
144
150
  };
145
151
  const guides = [
146
- ...vertical ? [
147
- buildGuide(vertical, snapped, others, 'vertical')
148
- ] : [],
149
- ...horizontal ? [
150
- buildGuide(horizontal, snapped, others, 'horizontal')
151
- ] : []
152
+ ...vertical ? buildAlignedGuides(snapped, others, 'vertical') : [],
153
+ ...horizontal ? buildAlignedGuides(snapped, others, 'horizontal') : []
152
154
  ];
153
155
  return {
154
156
  guides,
@@ -1 +1 @@
1
- {"version":3,"file":"useAlignmentGuides.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/AlignmentGuides/useAlignmentGuides.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAKjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAM9E,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,GAAE,IAAI,EAAW,GAAG,UAAU,CAW1E;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE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,GAAE,yBAA8B,GACtC,wBAAwB,CAkD1B"}
1
+ {"version":3,"file":"useAlignmentGuides.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/AlignmentGuides/useAlignmentGuides.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,0CAA0C,CAAC;AAKjF,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAM9E,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,GAAE,IAAI,EAAW,GAAG,UAAU,CAW1E;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,KAAK,EAAE,kBAAkB,CAAC;CAC3B;AAwGD,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,UAAU,EAAE,EACpB,SAAS,EAAE,MAAM,GAChB,eAAe,CAmBjB;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,UAAU,EAAE,EACpB,SAAS,EAAE,MAAM,GAChB,kBAAkB,EAAE,CAEtB;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,UAAU,EAAE,EACpB,SAAS,EAAE,MAAM,GAChB,kBAAkB,CAEpB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,QAAQ,GAAE,IAAI,EAAU,GAAG,UAAU,CAejF;AAED,MAAM,WAAW,yBAAyB;IAOxC,WAAW,CAAC,EAAE,MAAM,CAAC;IAMrB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,uBAAuB,EAAE,KAAK,IAAI,CAAC;CACvD;AAED,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpC;AAED,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,IAAI,EAAE,EACb,KAAK,EAAE,kBAAkB,GACxB,uBAAuB,EAAE,CAK3B;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAC7B,aAAa,EAAE,UAAU,GAAG,IAAI,CAAC;IACjC,UAAU,EAAE,UAAU,CAAC;IACvB,cAAc,EAAE,UAAU,CAAC;CAC5B;AAUD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,IAAI,EAAE,EACb,OAAO,GAAE,yBAA8B,GACtC,wBAAwB,CAkD1B"}
@@ -61,36 +61,42 @@ function resolveAxisCandidate(dragged, others, threshold, orientation) {
61
61
  }
62
62
  return candidates.filter(({ delta })=>Math.abs(delta) <= threshold).sort((a, b)=>Math.abs(a.delta) - Math.abs(b.delta) || a.priority - b.priority || a.position - b.position || a.matchedNodeId.localeCompare(b.matchedNodeId))[0];
63
63
  }
64
- function buildGuide(candidate, dragged, others, orientation) {
65
- const matchingOthers = others.filter((other)=>{
66
- const anchors = getAxisAnchors(other, orientation);
67
- const candidateAnchors = 'center' === candidate.kind ? [
68
- anchors[1]
69
- ] : [
70
- anchors[0],
71
- anchors[2]
64
+ function buildAlignedGuides(dragged, others, orientation) {
65
+ const draggedAnchors = getAxisAnchors(dragged, orientation);
66
+ return draggedAnchors.flatMap((position, draggedIndex)=>{
67
+ const matchingOthers = others.filter((other)=>{
68
+ const anchors = getAxisAnchors(other, orientation);
69
+ const comparableAnchors = 1 === draggedIndex ? [
70
+ anchors[1]
71
+ ] : [
72
+ anchors[0],
73
+ anchors[2]
74
+ ];
75
+ return comparableAnchors.some((anchor)=>Math.abs(anchor - position) < 0.5);
76
+ });
77
+ if (0 === matchingOthers.length) return [];
78
+ const ranges = [
79
+ dragged,
80
+ ...matchingOthers
81
+ ].map((bounds)=>'vertical' === orientation ? [
82
+ bounds.y1,
83
+ bounds.y2
84
+ ] : [
85
+ bounds.x1,
86
+ bounds.x2
87
+ ]);
88
+ return [
89
+ {
90
+ id: `${orientation}-${draggedIndex}-${position}`,
91
+ orientation,
92
+ position,
93
+ start: Math.min(...ranges.map(([rangeStart])=>rangeStart)),
94
+ end: Math.max(...ranges.map(([, rangeEnd])=>rangeEnd)),
95
+ kind: 1 === draggedIndex ? 'center' : 'edge',
96
+ matchedNodeIds: matchingOthers.map(({ id })=>id)
97
+ }
72
98
  ];
73
- return candidateAnchors.some((anchor)=>Math.abs(anchor - candidate.position) < 0.5);
74
99
  });
75
- const ranges = [
76
- dragged,
77
- ...matchingOthers
78
- ].map((bounds)=>'vertical' === orientation ? [
79
- bounds.y1,
80
- bounds.y2
81
- ] : [
82
- bounds.x1,
83
- bounds.x2
84
- ]);
85
- return {
86
- id: `${orientation}-${candidate.position}`,
87
- orientation,
88
- position: candidate.position,
89
- start: Math.min(...ranges.map(([rangeStart])=>rangeStart)),
90
- end: Math.max(...ranges.map(([, rangeEnd])=>rangeEnd)),
91
- kind: candidate.kind,
92
- matchedNodeIds: matchingOthers.map(({ id })=>id)
93
- };
94
100
  }
95
101
  function computeAlignmentResult(dragged, others, threshold) {
96
102
  const vertical = resolveAxisCandidate(dragged, others, threshold, 'vertical');
@@ -109,12 +115,8 @@ function computeAlignmentResult(dragged, others, threshold) {
109
115
  cy: dragged.cy + delta.dy
110
116
  };
111
117
  const guides = [
112
- ...vertical ? [
113
- buildGuide(vertical, snapped, others, 'vertical')
114
- ] : [],
115
- ...horizontal ? [
116
- buildGuide(horizontal, snapped, others, 'horizontal')
117
- ] : []
118
+ ...vertical ? buildAlignedGuides(snapped, others, 'vertical') : [],
119
+ ...horizontal ? buildAlignedGuides(snapped, others, 'horizontal') : []
118
120
  ];
119
121
  return {
120
122
  guides,
@@ -275,7 +275,7 @@ const ListViewRow = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ in
275
275
  children: item.name
276
276
  }),
277
277
  showDescription && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
278
- className: "text-xs text-foreground-muted",
278
+ className: "text-xs text-foreground-inv-de-emp",
279
279
  children: item.description
280
280
  }),
281
281
  item.detail && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
@@ -240,7 +240,7 @@ const ListViewRow = /*#__PURE__*/ memo(({ index, style, ariaAttributes, rendered
240
240
  children: item.name
241
241
  }),
242
242
  showDescription && /*#__PURE__*/ jsx("span", {
243
- className: "text-xs text-foreground-muted",
243
+ className: "text-xs text-foreground-inv-de-emp",
244
244
  children: item.description
245
245
  }),
246
246
  item.detail && /*#__PURE__*/ jsx("span", {