@mantine/spotlight 4.1.3 → 4.2.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/cjs/Spotlight/filter-actions/filter-actions.js +8 -2
- package/cjs/Spotlight/filter-actions/filter-actions.js.map +1 -1
- package/esm/Spotlight/filter-actions/filter-actions.js +8 -2
- package/esm/Spotlight/filter-actions/filter-actions.js.map +1 -1
- package/lib/Spotlight/filter-actions/filter-actions.d.ts +1 -1
- package/lib/Spotlight/filter-actions/filter-actions.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -13,10 +13,16 @@ function getKeywords(keywords) {
|
|
|
13
13
|
}
|
|
14
14
|
function filterActions(_query, actions) {
|
|
15
15
|
const query = _query.trim().toLowerCase();
|
|
16
|
-
|
|
16
|
+
const priorityMatrix = [[], []];
|
|
17
|
+
actions.forEach((action) => {
|
|
17
18
|
var _a, _b;
|
|
18
|
-
|
|
19
|
+
if ((_a = action.title) == null ? void 0 : _a.toLowerCase().includes(query)) {
|
|
20
|
+
priorityMatrix[0].push(action);
|
|
21
|
+
} else if (((_b = action.description) == null ? void 0 : _b.toLowerCase().includes(query)) || getKeywords(action.keywords).includes(query)) {
|
|
22
|
+
priorityMatrix[1].push(action);
|
|
23
|
+
}
|
|
19
24
|
});
|
|
25
|
+
return priorityMatrix.flat();
|
|
20
26
|
}
|
|
21
27
|
|
|
22
28
|
exports.filterActions = filterActions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-actions.js","sources":["../../../src/Spotlight/filter-actions/filter-actions.ts"],"sourcesContent":["import type { SpotlightAction } from '../../types';\n\nfunction getKeywords(keywords: string | string[]) {\n if (Array.isArray(keywords)) {\n return keywords\n .map((keyword) => keyword.trim())\n .join(',')\n .toLowerCase()\n .trim();\n }\n\n if (typeof keywords === 'string') {\n return keywords.toLowerCase().trim();\n }\n\n return '';\n}\n\nexport function filterActions(_query: string, actions: SpotlightAction[]) {\n const query = _query.trim().toLowerCase();\n
|
|
1
|
+
{"version":3,"file":"filter-actions.js","sources":["../../../src/Spotlight/filter-actions/filter-actions.ts"],"sourcesContent":["import type { SpotlightAction } from '../../types';\n\nfunction getKeywords(keywords: string | string[]) {\n if (Array.isArray(keywords)) {\n return keywords\n .map((keyword) => keyword.trim())\n .join(',')\n .toLowerCase()\n .trim();\n }\n\n if (typeof keywords === 'string') {\n return keywords.toLowerCase().trim();\n }\n\n return '';\n}\n\nexport function filterActions(_query: string, actions: SpotlightAction[]) {\n const query = _query.trim().toLowerCase();\n const priorityMatrix = [[], []];\n actions.forEach((action) => {\n if (action.title?.toLowerCase().includes(query)) {\n priorityMatrix[0].push(action);\n } else if (\n action.description?.toLowerCase().includes(query) ||\n getKeywords(action.keywords).includes(query)\n ) {\n priorityMatrix[1].push(action);\n }\n });\n\n return priorityMatrix.flat();\n}\n"],"names":[],"mappings":";;;;AAAA,SAAS,WAAW,CAAC,QAAQ,EAAE;AAC/B,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;AAC/B,IAAI,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;AACpF,GAAG;AACH,EAAE,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;AACpC,IAAI,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;AACzC,GAAG;AACH,EAAE,OAAO,EAAE,CAAC;AACZ,CAAC;AACM,SAAS,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE;AAC/C,EAAE,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAC5C,EAAE,MAAM,cAAc,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAClC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK;AAC9B,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC;AACf,IAAI,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACjF,MAAM,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACrC,KAAK,MAAM,IAAI,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,WAAW,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AAChJ,MAAM,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACrC,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,cAAc,CAAC,IAAI,EAAE,CAAC;AAC/B;;;;"}
|
|
@@ -9,10 +9,16 @@ function getKeywords(keywords) {
|
|
|
9
9
|
}
|
|
10
10
|
function filterActions(_query, actions) {
|
|
11
11
|
const query = _query.trim().toLowerCase();
|
|
12
|
-
|
|
12
|
+
const priorityMatrix = [[], []];
|
|
13
|
+
actions.forEach((action) => {
|
|
13
14
|
var _a, _b;
|
|
14
|
-
|
|
15
|
+
if ((_a = action.title) == null ? void 0 : _a.toLowerCase().includes(query)) {
|
|
16
|
+
priorityMatrix[0].push(action);
|
|
17
|
+
} else if (((_b = action.description) == null ? void 0 : _b.toLowerCase().includes(query)) || getKeywords(action.keywords).includes(query)) {
|
|
18
|
+
priorityMatrix[1].push(action);
|
|
19
|
+
}
|
|
15
20
|
});
|
|
21
|
+
return priorityMatrix.flat();
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
export { filterActions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-actions.js","sources":["../../../src/Spotlight/filter-actions/filter-actions.ts"],"sourcesContent":["import type { SpotlightAction } from '../../types';\n\nfunction getKeywords(keywords: string | string[]) {\n if (Array.isArray(keywords)) {\n return keywords\n .map((keyword) => keyword.trim())\n .join(',')\n .toLowerCase()\n .trim();\n }\n\n if (typeof keywords === 'string') {\n return keywords.toLowerCase().trim();\n }\n\n return '';\n}\n\nexport function filterActions(_query: string, actions: SpotlightAction[]) {\n const query = _query.trim().toLowerCase();\n
|
|
1
|
+
{"version":3,"file":"filter-actions.js","sources":["../../../src/Spotlight/filter-actions/filter-actions.ts"],"sourcesContent":["import type { SpotlightAction } from '../../types';\n\nfunction getKeywords(keywords: string | string[]) {\n if (Array.isArray(keywords)) {\n return keywords\n .map((keyword) => keyword.trim())\n .join(',')\n .toLowerCase()\n .trim();\n }\n\n if (typeof keywords === 'string') {\n return keywords.toLowerCase().trim();\n }\n\n return '';\n}\n\nexport function filterActions(_query: string, actions: SpotlightAction[]) {\n const query = _query.trim().toLowerCase();\n const priorityMatrix = [[], []];\n actions.forEach((action) => {\n if (action.title?.toLowerCase().includes(query)) {\n priorityMatrix[0].push(action);\n } else if (\n action.description?.toLowerCase().includes(query) ||\n getKeywords(action.keywords).includes(query)\n ) {\n priorityMatrix[1].push(action);\n }\n });\n\n return priorityMatrix.flat();\n}\n"],"names":[],"mappings":"AAAA,SAAS,WAAW,CAAC,QAAQ,EAAE;AAC/B,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;AAC/B,IAAI,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;AACpF,GAAG;AACH,EAAE,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;AACpC,IAAI,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC;AACzC,GAAG;AACH,EAAE,OAAO,EAAE,CAAC;AACZ,CAAC;AACM,SAAS,aAAa,CAAC,MAAM,EAAE,OAAO,EAAE;AAC/C,EAAE,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAC5C,EAAE,MAAM,cAAc,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAClC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK;AAC9B,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC;AACf,IAAI,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AACjF,MAAM,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACrC,KAAK,MAAM,IAAI,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,WAAW,KAAK,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;AAChJ,MAAM,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACrC,KAAK;AACL,GAAG,CAAC,CAAC;AACL,EAAE,OAAO,cAAc,CAAC,IAAI,EAAE,CAAC;AAC/B;;;;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { SpotlightAction } from '../../types';
|
|
2
|
-
export declare function filterActions(_query: string, actions: SpotlightAction[]):
|
|
2
|
+
export declare function filterActions(_query: string, actions: SpotlightAction[]): any[];
|
|
3
3
|
//# sourceMappingURL=filter-actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-actions.d.ts","sourceRoot":"","sources":["../../../src/Spotlight/filter-actions/filter-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAkBnD,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"filter-actions.d.ts","sourceRoot":"","sources":["../../../src/Spotlight/filter-actions/filter-actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAkBnD,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,SAevE"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine/spotlight",
|
|
3
3
|
"description": "Command center for your application",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.2.0",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"directory": "src/mantine-spotlight"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@mantine/core": "4.
|
|
19
|
-
"@mantine/hooks": "4.
|
|
18
|
+
"@mantine/core": "4.2.0",
|
|
19
|
+
"@mantine/hooks": "4.2.0",
|
|
20
20
|
"react": ">=16.8.0",
|
|
21
21
|
"react-dom": ">=16.8.0"
|
|
22
22
|
},
|