@uipath/apollo-react 3.47.0 → 3.47.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.
@@ -130,16 +130,40 @@ class CategoryTree {
130
130
  }
131
131
  filterBySearch(searchTerm) {
132
132
  if (!searchTerm) return this;
133
- const searchLower = searchTerm.toLowerCase();
134
- return this.filter({
135
- nodeFilter: (node)=>{
136
- const matchesLabel = node.display.label.toLowerCase().includes(searchLower);
137
- const matchesType = node.nodeType.toLowerCase().includes(searchLower);
138
- const matchesDescription = node.description?.toLowerCase().includes(searchLower);
139
- const matchesTags = node.tags?.some((tag)=>'string' == typeof tag && tag.toLowerCase().includes(searchLower));
140
- return matchesLabel || matchesType || matchesDescription || matchesTags;
133
+ const searchWords = searchTerm.toLowerCase().split(/\s+/).filter(Boolean);
134
+ if (0 === searchWords.length) return this;
135
+ const matchesAllWords = (node, ancestorCategoryNames)=>{
136
+ const searchableTexts = [
137
+ node.display.label.toLowerCase(),
138
+ node.nodeType.toLowerCase(),
139
+ ...node.description ? [
140
+ node.description.toLowerCase()
141
+ ] : [],
142
+ ...node.tags?.filter((tag)=>'string' == typeof tag).map((tag)=>tag.toLowerCase()) ?? [],
143
+ ...ancestorCategoryNames
144
+ ];
145
+ return searchWords.every((word)=>searchableTexts.some((text)=>text.includes(word)));
146
+ };
147
+ const filterTree = (tree, ancestorNames)=>{
148
+ const filtered = [];
149
+ for (const item of tree){
150
+ const categoryNames = [
151
+ ...ancestorNames,
152
+ item.name.toLowerCase()
153
+ ];
154
+ const nestedCategories = filterTree(item.nestedCategories, categoryNames);
155
+ const nodes = item.nodes.filter((node)=>matchesAllWords(node, categoryNames));
156
+ if (nestedCategories.length > 0 || nodes.length > 0) filtered.push({
157
+ ...item,
158
+ nestedCategories,
159
+ nodes
160
+ });
141
161
  }
142
- });
162
+ return filtered;
163
+ };
164
+ const filteredRoots = filterTree(this.rootCategories, []);
165
+ const filteredRootNodes = this.rootNodes.filter((node)=>matchesAllWords(node, []));
166
+ return CategoryTree.fromPrebuilt(filteredRoots, filteredRootNodes);
143
167
  }
144
168
  filterByConnections(validator) {
145
169
  return this.filter({
@@ -1 +1 @@
1
- {"version":3,"file":"CategoryTree.d.ts","sourceRoot":"","sources":["../../../src/canvas/core/CategoryTree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAKhF,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,gBAAgB,EAAE,gBAAgB,EAAE,CAAC;IACrC,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB;AAKD,MAAM,WAAW,yBAAyB;IAExC,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,OAAO,CAAC;IAEzD,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC;CAC9C;AAMD,MAAM,WAAW,mBAAmB;IAMlC,4BAA4B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IAO1D,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC3C;AA8BD,qBAAa,YAAY;IACvB,OAAO,CAAC,cAAc,CAAqB;IAC3C,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,WAAW,CAAgC;gBAQvC,UAAU,EAAE,gBAAgB,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE;IAYjE,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAmBxE,MAAM,CAAC,YAAY,CAAC,cAAc,EAAE,gBAAgB,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,YAAY;IAkBhG,SAAS,CACP,UAAU,EAAE,gBAAgB,EAAE,EAC9B,KAAK,EAAE,YAAY,EAAE,GACpB;QAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC;QAA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,CAAqB;IAC3C,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,WAAW,CAAgC;gBAQvC,UAAU,EAAE,gBAAgB,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE;IAYjE,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAmBxE,MAAM,CAAC,YAAY,CAAC,cAAc,EAAE,gBAAgB,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,YAAY;IAkBhG,SAAS,CACP,UAAU,EAAE,gBAAgB,EAAE,EAC9B,KAAK,EAAE,YAAY,EAAE,GACpB;QAAE,cAAc,EAAE,gBAAgB,EAAE,CAAC;QAAC,SAAS,EAAE,YAAY,EAAE,CAAA;KAAE;IAsFpE,iBAAiB,IAAI,gBAAgB,EAAE;IASvC,YAAY,IAAI,YAAY,EAAE;IAU9B,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAWzD,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY;IAuB5C,MAAM,CAAC,OAAO,GAAE,yBAA8B,GAAG,YAAY;IAmD7D,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY;IA2EhD,mBAAmB,CAAC,SAAS,EAAE,mBAAmB,GAAG,YAAY;IAoBjE,iBAAiB,IAAI,YAAY;IA4BjC,OAAO,IAAI,YAAY;IAoBvB,OAAO,IAAI,OAAO;IASlB,gBAAgB,IAAI,gBAAgB,EAAE;IAStC,WAAW,IAAI,YAAY,EAAE;IAa7B,gBAAgB,IAAI,MAAM;IAS1B,YAAY,IAAI,MAAM;CAOvB"}
@@ -102,16 +102,40 @@ class CategoryTree {
102
102
  }
103
103
  filterBySearch(searchTerm) {
104
104
  if (!searchTerm) return this;
105
- const searchLower = searchTerm.toLowerCase();
106
- return this.filter({
107
- nodeFilter: (node)=>{
108
- const matchesLabel = node.display.label.toLowerCase().includes(searchLower);
109
- const matchesType = node.nodeType.toLowerCase().includes(searchLower);
110
- const matchesDescription = node.description?.toLowerCase().includes(searchLower);
111
- const matchesTags = node.tags?.some((tag)=>'string' == typeof tag && tag.toLowerCase().includes(searchLower));
112
- return matchesLabel || matchesType || matchesDescription || matchesTags;
105
+ const searchWords = searchTerm.toLowerCase().split(/\s+/).filter(Boolean);
106
+ if (0 === searchWords.length) return this;
107
+ const matchesAllWords = (node, ancestorCategoryNames)=>{
108
+ const searchableTexts = [
109
+ node.display.label.toLowerCase(),
110
+ node.nodeType.toLowerCase(),
111
+ ...node.description ? [
112
+ node.description.toLowerCase()
113
+ ] : [],
114
+ ...node.tags?.filter((tag)=>'string' == typeof tag).map((tag)=>tag.toLowerCase()) ?? [],
115
+ ...ancestorCategoryNames
116
+ ];
117
+ return searchWords.every((word)=>searchableTexts.some((text)=>text.includes(word)));
118
+ };
119
+ const filterTree = (tree, ancestorNames)=>{
120
+ const filtered = [];
121
+ for (const item of tree){
122
+ const categoryNames = [
123
+ ...ancestorNames,
124
+ item.name.toLowerCase()
125
+ ];
126
+ const nestedCategories = filterTree(item.nestedCategories, categoryNames);
127
+ const nodes = item.nodes.filter((node)=>matchesAllWords(node, categoryNames));
128
+ if (nestedCategories.length > 0 || nodes.length > 0) filtered.push({
129
+ ...item,
130
+ nestedCategories,
131
+ nodes
132
+ });
113
133
  }
114
- });
134
+ return filtered;
135
+ };
136
+ const filteredRoots = filterTree(this.rootCategories, []);
137
+ const filteredRootNodes = this.rootNodes.filter((node)=>matchesAllWords(node, []));
138
+ return CategoryTree.fromPrebuilt(filteredRoots, filteredRootNodes);
115
139
  }
116
140
  filterByConnections(validator) {
117
141
  return this.filter({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/apollo-react",
3
- "version": "3.47.0",
3
+ "version": "3.47.1",
4
4
  "description": "Apollo Design System - React component library with Material UI theming",
5
5
  "repository": {
6
6
  "type": "git",
@@ -200,8 +200,8 @@
200
200
  "use-sync-external-store": "^1.2.0",
201
201
  "zod": "^4.3.5",
202
202
  "zustand": "^5.0.9",
203
- "@uipath/apollo-wind": "0.11.0",
204
- "@uipath/apollo-core": "5.7.0"
203
+ "@uipath/apollo-core": "5.7.0",
204
+ "@uipath/apollo-wind": "0.11.0"
205
205
  },
206
206
  "devDependencies": {
207
207
  "@lingui/cli": "^5.6.1",