@mantine/spotlight 7.12.0 → 7.12.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.
- package/cjs/index.cjs +2 -0
- package/cjs/index.cjs.map +1 -1
- package/cjs/limit-actions.cjs +13 -12
- package/cjs/limit-actions.cjs.map +1 -1
- package/esm/index.mjs +1 -0
- package/esm/index.mjs.map +1 -1
- package/esm/limit-actions.mjs +13 -12
- package/esm/limit-actions.mjs.map +1 -1
- package/lib/index.d.mts +1 -0
- package/lib/index.d.ts +1 -0
- package/package.json +6 -6
package/cjs/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var spotlight_store = require('./spotlight.store.cjs');
|
|
4
4
|
var isActionsGroup = require('./is-actions-group.cjs');
|
|
5
5
|
var Spotlight = require('./Spotlight.cjs');
|
|
6
|
+
var SpotlightRoot = require('./SpotlightRoot.cjs');
|
|
6
7
|
var SpotlightAction = require('./SpotlightAction.cjs');
|
|
7
8
|
var SpotlightActionsGroup = require('./SpotlightActionsGroup.cjs');
|
|
8
9
|
var SpotlightActionsList = require('./SpotlightActionsList.cjs');
|
|
@@ -21,6 +22,7 @@ exports.toggleSpotlight = spotlight_store.toggleSpotlight;
|
|
|
21
22
|
exports.useSpotlight = spotlight_store.useSpotlight;
|
|
22
23
|
exports.isActionsGroup = isActionsGroup.isActionsGroup;
|
|
23
24
|
exports.Spotlight = Spotlight.Spotlight;
|
|
25
|
+
exports.SpotlightRoot = SpotlightRoot.SpotlightRoot;
|
|
24
26
|
exports.SpotlightAction = SpotlightAction.SpotlightAction;
|
|
25
27
|
exports.SpotlightActionsGroup = SpotlightActionsGroup.SpotlightActionsGroup;
|
|
26
28
|
exports.SpotlightActionsList = SpotlightActionsList.SpotlightActionsList;
|
package/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/cjs/limit-actions.cjs
CHANGED
|
@@ -4,26 +4,27 @@
|
|
|
4
4
|
var isActionsGroup = require('./is-actions-group.cjs');
|
|
5
5
|
|
|
6
6
|
function limitActions(actions, limit) {
|
|
7
|
-
const result = [];
|
|
8
7
|
if (!Array.isArray(actions)) {
|
|
9
8
|
return [];
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (
|
|
14
|
-
return
|
|
10
|
+
let count = 0;
|
|
11
|
+
return actions.reduce((acc, item) => {
|
|
12
|
+
if (count >= limit) {
|
|
13
|
+
return acc;
|
|
15
14
|
}
|
|
16
15
|
if (isActionsGroup.isActionsGroup(item)) {
|
|
17
|
-
|
|
16
|
+
const groupActions = limitActions(item.actions, limit - count);
|
|
17
|
+
acc.push({
|
|
18
18
|
group: item.group,
|
|
19
|
-
actions:
|
|
19
|
+
actions: groupActions
|
|
20
20
|
});
|
|
21
|
+
count += groupActions.length;
|
|
22
|
+
} else {
|
|
23
|
+
acc.push(item);
|
|
24
|
+
count += 1;
|
|
21
25
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return result;
|
|
26
|
+
return acc;
|
|
27
|
+
}, []);
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
exports.limitActions = limitActions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limit-actions.cjs","sources":["../src/limit-actions.ts"],"sourcesContent":["import { isActionsGroup } from './is-actions-group';\nimport type { SpotlightActionData, SpotlightActions } from './Spotlight';\n\nexport function limitActions(actions: SpotlightActions[], limit: number) {\n
|
|
1
|
+
{"version":3,"file":"limit-actions.cjs","sources":["../src/limit-actions.ts"],"sourcesContent":["import { isActionsGroup } from './is-actions-group';\nimport type { SpotlightActionData, SpotlightActions } from './Spotlight';\n\nexport function limitActions(actions: SpotlightActions[], limit: number) {\n if (!Array.isArray(actions)) {\n return [];\n }\n\n let count = 0;\n return actions.reduce<SpotlightActions[]>((acc, item) => {\n if (count >= limit) {\n return acc;\n }\n\n if (isActionsGroup(item)) {\n const groupActions = limitActions(item.actions, limit - count);\n acc.push({\n group: item.group,\n actions: groupActions as SpotlightActionData[],\n });\n count += groupActions.length;\n } else {\n acc.push(item);\n count += 1;\n }\n\n return acc;\n }, []);\n}\n"],"names":["isActionsGroup"],"mappings":";;;;;AAEO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAE,KAAK,CAAE,CAAA,CAAA;AAC7C,CAAE,CAAA,CAAA,CAAA,CAAA,CAAI,CAAC,CAAK,CAAA,CAAA,CAAA,CAAA,CAAC,OAAO,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAC,CAAE,CAAA,CAAA;AAC/B,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,EAAE,CAAC;AACd,CAAG,CAAA,CAAA;AACH,CAAA,CAAE,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAC,CAAC;AAChB,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,OAAO,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAC,CAAA,CAAA,CAAG,CAAE,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA;AACvC,CAAA,CAAA,CAAA,CAAI,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAI,CAAA,CAAA,CAAA,CAA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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,EAAE,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAC7B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAC,CAAC;AACT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,MAAM,CAAC;AACnC,CAAA,CAAA,CAAA,CAAA,CAAK,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACX,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,GAAG,CAAC,CAAA,CAAA,CAAA,CAAI,CAAC,CAAA,CAAA,CAAA,CAAI,CAAC,CAAC;AACrB,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAI,CAAA,CAAA,CAAA,CAAC,CAAC;AACjB,CAAK,CAAA,CAAA,CAAA,CAAA;AACL,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,GAAG,CAAC;AACf,CAAG,CAAA,CAAA,CAAA,CAAE,CAAE,CAAA,CAAC,CAAC;AACT,CAAA;;"}
|
package/esm/index.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { closeSpotlight, createSpotlight, createSpotlightStore, openSpotlight, spotlight, toggleSpotlight, useSpotlight } from './spotlight.store.mjs';
|
|
2
2
|
export { isActionsGroup } from './is-actions-group.mjs';
|
|
3
3
|
export { Spotlight } from './Spotlight.mjs';
|
|
4
|
+
export { SpotlightRoot } from './SpotlightRoot.mjs';
|
|
4
5
|
export { SpotlightAction } from './SpotlightAction.mjs';
|
|
5
6
|
export { SpotlightActionsGroup } from './SpotlightActionsGroup.mjs';
|
|
6
7
|
export { SpotlightActionsList } from './SpotlightActionsList.mjs';
|
package/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
package/esm/limit-actions.mjs
CHANGED
|
@@ -2,26 +2,27 @@
|
|
|
2
2
|
import { isActionsGroup } from './is-actions-group.mjs';
|
|
3
3
|
|
|
4
4
|
function limitActions(actions, limit) {
|
|
5
|
-
const result = [];
|
|
6
5
|
if (!Array.isArray(actions)) {
|
|
7
6
|
return [];
|
|
8
7
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (
|
|
12
|
-
return
|
|
8
|
+
let count = 0;
|
|
9
|
+
return actions.reduce((acc, item) => {
|
|
10
|
+
if (count >= limit) {
|
|
11
|
+
return acc;
|
|
13
12
|
}
|
|
14
13
|
if (isActionsGroup(item)) {
|
|
15
|
-
|
|
14
|
+
const groupActions = limitActions(item.actions, limit - count);
|
|
15
|
+
acc.push({
|
|
16
16
|
group: item.group,
|
|
17
|
-
actions:
|
|
17
|
+
actions: groupActions
|
|
18
18
|
});
|
|
19
|
+
count += groupActions.length;
|
|
20
|
+
} else {
|
|
21
|
+
acc.push(item);
|
|
22
|
+
count += 1;
|
|
19
23
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
return result;
|
|
24
|
+
return acc;
|
|
25
|
+
}, []);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
export { limitActions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limit-actions.mjs","sources":["../src/limit-actions.ts"],"sourcesContent":["import { isActionsGroup } from './is-actions-group';\nimport type { SpotlightActionData, SpotlightActions } from './Spotlight';\n\nexport function limitActions(actions: SpotlightActions[], limit: number) {\n
|
|
1
|
+
{"version":3,"file":"limit-actions.mjs","sources":["../src/limit-actions.ts"],"sourcesContent":["import { isActionsGroup } from './is-actions-group';\nimport type { SpotlightActionData, SpotlightActions } from './Spotlight';\n\nexport function limitActions(actions: SpotlightActions[], limit: number) {\n if (!Array.isArray(actions)) {\n return [];\n }\n\n let count = 0;\n return actions.reduce<SpotlightActions[]>((acc, item) => {\n if (count >= limit) {\n return acc;\n }\n\n if (isActionsGroup(item)) {\n const groupActions = limitActions(item.actions, limit - count);\n acc.push({\n group: item.group,\n actions: groupActions as SpotlightActionData[],\n });\n count += groupActions.length;\n } else {\n acc.push(item);\n count += 1;\n }\n\n return acc;\n }, []);\n}\n"],"names":[],"mappings":";;;AAEO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAE,KAAK,CAAE,CAAA,CAAA;AAC7C,CAAE,CAAA,CAAA,CAAA,CAAA,CAAI,CAAC,CAAK,CAAA,CAAA,CAAA,CAAA,CAAC,OAAO,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAC,CAAE,CAAA,CAAA;AAC/B,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,EAAE,CAAC;AACd,CAAG,CAAA,CAAA;AACH,CAAA,CAAE,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAC,CAAC;AAChB,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,OAAO,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAC,CAAC,CAAA,CAAA,CAAG,CAAE,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA;AAC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CAAA,CAAA,CAAA,CAAA,CAAO,EAAE,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAC7B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,CAAC,CAAC;AACT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAC,MAAM,CAAC;AACnC,CAAA,CAAA,CAAA,CAAA,CAAK,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AACX,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,GAAG,CAAC,CAAA,CAAA,CAAA,CAAI,CAAC,CAAA,CAAA,CAAA,CAAI,CAAC,CAAC;AACrB,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAI,CAAA,CAAA,CAAA,CAAC,CAAC;AACjB,CAAK,CAAA,CAAA,CAAA,CAAA;AACL,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,GAAG,CAAC;AACf,CAAG,CAAA,CAAA,CAAA,CAAE,CAAE,CAAA,CAAC,CAAC;AACT,CAAA;;"}
|
package/lib/index.d.mts
CHANGED
|
@@ -2,6 +2,7 @@ export { spotlight, createSpotlight, createSpotlightStore, useSpotlight, openSpo
|
|
|
2
2
|
export type { SpotlightState, SpotlightStore } from './spotlight.store';
|
|
3
3
|
export { isActionsGroup } from './is-actions-group';
|
|
4
4
|
export { Spotlight } from './Spotlight';
|
|
5
|
+
export { SpotlightRoot } from './SpotlightRoot';
|
|
5
6
|
export { SpotlightAction } from './SpotlightAction';
|
|
6
7
|
export { SpotlightActionsGroup } from './SpotlightActionsGroup';
|
|
7
8
|
export { SpotlightActionsList } from './SpotlightActionsList';
|
package/lib/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { spotlight, createSpotlight, createSpotlightStore, useSpotlight, openSpo
|
|
|
2
2
|
export type { SpotlightState, SpotlightStore } from './spotlight.store';
|
|
3
3
|
export { isActionsGroup } from './is-actions-group';
|
|
4
4
|
export { Spotlight } from './Spotlight';
|
|
5
|
+
export { SpotlightRoot } from './SpotlightRoot';
|
|
5
6
|
export { SpotlightAction } from './SpotlightAction';
|
|
6
7
|
export { SpotlightActionsGroup } from './SpotlightActionsGroup';
|
|
7
8
|
export { SpotlightActionsList } from './SpotlightActionsList';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine/spotlight",
|
|
3
|
-
"version": "7.12.
|
|
3
|
+
"version": "7.12.2",
|
|
4
4
|
"description": "Command center components for react and Mantine",
|
|
5
5
|
"homepage": "https://mantine.dev",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,17 +41,17 @@
|
|
|
41
41
|
"directory": "packages/@mantine/spotlight"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@mantine/core": "7.12.
|
|
45
|
-
"@mantine/hooks": "7.12.
|
|
44
|
+
"@mantine/core": "7.12.2",
|
|
45
|
+
"@mantine/hooks": "7.12.2",
|
|
46
46
|
"react": "^18.2.0",
|
|
47
47
|
"react-dom": "^18.2.0"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@mantine/store": "7.12.
|
|
50
|
+
"@mantine/store": "7.12.2"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@mantine-tests/core": "1.1.0",
|
|
54
|
-
"@mantine/core": "7.12.
|
|
55
|
-
"@mantine/hooks": "7.12.
|
|
54
|
+
"@mantine/core": "7.12.2",
|
|
55
|
+
"@mantine/hooks": "7.12.2"
|
|
56
56
|
}
|
|
57
57
|
}
|