datocms-plugin-sdk 2.0.3 → 2.0.5
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/dist/cjs/guardUtils.js +33 -0
- package/dist/cjs/guardUtils.js.map +1 -0
- package/dist/cjs/hooks/assetSources.js +25 -0
- package/dist/cjs/hooks/assetSources.js.map +1 -1
- package/dist/cjs/hooks/buildItemPresentationInfo.js +13 -0
- package/dist/cjs/hooks/buildItemPresentationInfo.js.map +1 -1
- package/dist/cjs/hooks/contentAreaSidebarItems.js +17 -0
- package/dist/cjs/hooks/contentAreaSidebarItems.js.map +1 -1
- package/dist/cjs/hooks/customBlockStylesForStructuredTextField.js +14 -0
- package/dist/cjs/hooks/customBlockStylesForStructuredTextField.js.map +1 -1
- package/dist/cjs/hooks/customMarksForStructuredTextField.js +18 -0
- package/dist/cjs/hooks/customMarksForStructuredTextField.js.map +1 -1
- package/dist/cjs/hooks/initialLocationQueryForItemSelector.js +12 -0
- package/dist/cjs/hooks/initialLocationQueryForItemSelector.js.map +1 -1
- package/dist/cjs/hooks/itemCollectionOutlets.js +13 -0
- package/dist/cjs/hooks/itemCollectionOutlets.js.map +1 -1
- package/dist/cjs/hooks/itemFormOutlets.js +13 -0
- package/dist/cjs/hooks/itemFormOutlets.js.map +1 -1
- package/dist/cjs/hooks/itemFormSidebarPanels.js +17 -0
- package/dist/cjs/hooks/itemFormSidebarPanels.js.map +1 -1
- package/dist/cjs/hooks/itemFormSidebars.js +15 -0
- package/dist/cjs/hooks/itemFormSidebars.js.map +1 -1
- package/dist/cjs/hooks/mainNavigationTabs.js +17 -0
- package/dist/cjs/hooks/mainNavigationTabs.js.map +1 -1
- package/dist/cjs/hooks/manualFieldExtensions.js +25 -0
- package/dist/cjs/hooks/manualFieldExtensions.js.map +1 -1
- package/dist/cjs/hooks/overrideFieldExtensions.js +46 -0
- package/dist/cjs/hooks/overrideFieldExtensions.js.map +1 -1
- package/dist/cjs/hooks/renderItemCollectionOutlet.js.map +1 -1
- package/dist/cjs/hooks/uploadSidebarPanels.js +17 -0
- package/dist/cjs/hooks/uploadSidebarPanels.js.map +1 -1
- package/dist/cjs/hooks/uploadSidebars.js +15 -0
- package/dist/cjs/hooks/uploadSidebars.js.map +1 -1
- package/dist/cjs/icon.js +9 -0
- package/dist/cjs/icon.js.map +1 -1
- package/dist/cjs/manifest.js +30 -20
- package/dist/cjs/manifest.js.map +1 -1
- package/dist/cjs/shared.js +25 -0
- package/dist/cjs/shared.js.map +1 -1
- package/dist/esm/guardUtils.d.ts +7 -0
- package/dist/esm/guardUtils.js +24 -0
- package/dist/esm/guardUtils.js.map +1 -0
- package/dist/esm/hooks/assetSources.d.ts +11 -1
- package/dist/esm/hooks/assetSources.js +24 -1
- package/dist/esm/hooks/assetSources.js.map +1 -1
- package/dist/esm/hooks/buildItemPresentationInfo.d.ts +11 -0
- package/dist/esm/hooks/buildItemPresentationInfo.js +12 -1
- package/dist/esm/hooks/buildItemPresentationInfo.js.map +1 -1
- package/dist/esm/hooks/contentAreaSidebarItems.d.ts +11 -0
- package/dist/esm/hooks/contentAreaSidebarItems.js +16 -1
- package/dist/esm/hooks/contentAreaSidebarItems.js.map +1 -1
- package/dist/esm/hooks/customBlockStylesForStructuredTextField.d.ts +11 -1
- package/dist/esm/hooks/customBlockStylesForStructuredTextField.js +13 -1
- package/dist/esm/hooks/customBlockStylesForStructuredTextField.js.map +1 -1
- package/dist/esm/hooks/customMarksForStructuredTextField.d.ts +11 -1
- package/dist/esm/hooks/customMarksForStructuredTextField.js +17 -1
- package/dist/esm/hooks/customMarksForStructuredTextField.js.map +1 -1
- package/dist/esm/hooks/initialLocationQueryForItemSelector.d.ts +11 -0
- package/dist/esm/hooks/initialLocationQueryForItemSelector.js +11 -1
- package/dist/esm/hooks/initialLocationQueryForItemSelector.js.map +1 -1
- package/dist/esm/hooks/itemCollectionOutlets.d.ts +11 -1
- package/dist/esm/hooks/itemCollectionOutlets.js +12 -1
- package/dist/esm/hooks/itemCollectionOutlets.js.map +1 -1
- package/dist/esm/hooks/itemFormOutlets.d.ts +11 -0
- package/dist/esm/hooks/itemFormOutlets.js +12 -1
- package/dist/esm/hooks/itemFormOutlets.js.map +1 -1
- package/dist/esm/hooks/itemFormSidebarPanels.d.ts +12 -0
- package/dist/esm/hooks/itemFormSidebarPanels.js +16 -1
- package/dist/esm/hooks/itemFormSidebarPanels.js.map +1 -1
- package/dist/esm/hooks/itemFormSidebars.d.ts +12 -0
- package/dist/esm/hooks/itemFormSidebars.js +14 -1
- package/dist/esm/hooks/itemFormSidebars.js.map +1 -1
- package/dist/esm/hooks/mainNavigationTabs.d.ts +11 -1
- package/dist/esm/hooks/mainNavigationTabs.js +16 -1
- package/dist/esm/hooks/mainNavigationTabs.js.map +1 -1
- package/dist/esm/hooks/manualFieldExtensions.d.ts +12 -0
- package/dist/esm/hooks/manualFieldExtensions.js +24 -1
- package/dist/esm/hooks/manualFieldExtensions.js.map +1 -1
- package/dist/esm/hooks/overrideFieldExtensions.d.ts +20 -0
- package/dist/esm/hooks/overrideFieldExtensions.js +43 -1
- package/dist/esm/hooks/overrideFieldExtensions.js.map +1 -1
- package/dist/esm/hooks/renderItemCollectionOutlet.d.ts +6 -1
- package/dist/esm/hooks/renderItemCollectionOutlet.js.map +1 -1
- package/dist/esm/hooks/uploadSidebarPanels.d.ts +12 -0
- package/dist/esm/hooks/uploadSidebarPanels.js +16 -1
- package/dist/esm/hooks/uploadSidebarPanels.js.map +1 -1
- package/dist/esm/hooks/uploadSidebars.d.ts +12 -0
- package/dist/esm/hooks/uploadSidebars.js +14 -1
- package/dist/esm/hooks/uploadSidebars.js.map +1 -1
- package/dist/esm/icon.d.ts +1 -0
- package/dist/esm/icon.js +8 -1
- package/dist/esm/icon.js.map +1 -1
- package/dist/esm/manifest.js +30 -20
- package/dist/esm/manifest.js.map +1 -1
- package/dist/esm/shared.d.ts +12 -0
- package/dist/esm/shared.js +23 -1
- package/dist/esm/shared.js.map +1 -1
- package/dist/types/guardUtils.d.ts +7 -0
- package/dist/types/hooks/assetSources.d.ts +11 -1
- package/dist/types/hooks/buildItemPresentationInfo.d.ts +11 -0
- package/dist/types/hooks/contentAreaSidebarItems.d.ts +11 -0
- package/dist/types/hooks/customBlockStylesForStructuredTextField.d.ts +11 -1
- package/dist/types/hooks/customMarksForStructuredTextField.d.ts +11 -1
- package/dist/types/hooks/initialLocationQueryForItemSelector.d.ts +11 -0
- package/dist/types/hooks/itemCollectionOutlets.d.ts +11 -1
- package/dist/types/hooks/itemFormOutlets.d.ts +11 -0
- package/dist/types/hooks/itemFormSidebarPanels.d.ts +12 -0
- package/dist/types/hooks/itemFormSidebars.d.ts +12 -0
- package/dist/types/hooks/mainNavigationTabs.d.ts +11 -1
- package/dist/types/hooks/manualFieldExtensions.d.ts +12 -0
- package/dist/types/hooks/overrideFieldExtensions.d.ts +20 -0
- package/dist/types/hooks/renderItemCollectionOutlet.d.ts +6 -1
- package/dist/types/hooks/uploadSidebarPanels.d.ts +12 -0
- package/dist/types/hooks/uploadSidebars.d.ts +12 -0
- package/dist/types/icon.d.ts +1 -0
- package/dist/types/shared.d.ts +12 -0
- package/manifest.json +30 -20
- package/package.json +2 -2
- package/src/guardUtils.ts +34 -0
- package/src/hooks/assetSources.ts +32 -2
- package/src/hooks/buildItemPresentationInfo.ts +22 -0
- package/src/hooks/contentAreaSidebarItems.ts +32 -1
- package/src/hooks/customBlockStylesForStructuredTextField.ts +23 -1
- package/src/hooks/customMarksForStructuredTextField.ts +33 -2
- package/src/hooks/initialLocationQueryForItemSelector.ts +21 -1
- package/src/hooks/itemCollectionOutlets.ts +22 -1
- package/src/hooks/itemFormOutlets.ts +20 -0
- package/src/hooks/itemFormSidebarPanels.ts +34 -0
- package/src/hooks/itemFormSidebars.ts +23 -0
- package/src/hooks/mainNavigationTabs.ts +32 -2
- package/src/hooks/manualFieldExtensions.ts +42 -0
- package/src/hooks/overrideFieldExtensions.ts +64 -0
- package/src/hooks/renderItemCollectionOutlet.ts +6 -1
- package/src/hooks/uploadSidebarPanels.ts +34 -0
- package/src/hooks/uploadSidebars.ts +23 -0
- package/src/icon.ts +12 -0
- package/src/manifest.ts +31 -20
- package/src/shared.ts +48 -1
package/src/icon.ts
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
import { isRecord, isString } from './guardUtils.js';
|
|
2
|
+
|
|
1
3
|
export type Icon =
|
|
2
4
|
| AwesomeFontIconIdentifier
|
|
3
5
|
| { type: 'svg'; viewBox: string; content: string };
|
|
4
6
|
|
|
7
|
+
export function isIcon(value: unknown): value is Icon {
|
|
8
|
+
return (
|
|
9
|
+
isString(value) ||
|
|
10
|
+
(isRecord(value) &&
|
|
11
|
+
value.type === 'svg' &&
|
|
12
|
+
isString(value.viewBox) &&
|
|
13
|
+
isString(value.content))
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
5
17
|
export type AwesomeFontIconIdentifier =
|
|
6
18
|
| '0'
|
|
7
19
|
| '00'
|
package/src/manifest.ts
CHANGED
|
@@ -60,7 +60,7 @@ export const manifest: Manifest = {
|
|
|
60
60
|
returnType: 'UploadSidebar[]',
|
|
61
61
|
location: {
|
|
62
62
|
filePath: 'src/hooks/uploadSidebars.ts',
|
|
63
|
-
lineNumber:
|
|
63
|
+
lineNumber: 11,
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
66
|
uploadSidebarPanels: {
|
|
@@ -79,7 +79,7 @@ export const manifest: Manifest = {
|
|
|
79
79
|
returnType: 'UploadSidebarPanel[]',
|
|
80
80
|
location: {
|
|
81
81
|
filePath: 'src/hooks/uploadSidebarPanels.ts',
|
|
82
|
-
lineNumber:
|
|
82
|
+
lineNumber: 18,
|
|
83
83
|
},
|
|
84
84
|
},
|
|
85
85
|
settingsAreaSidebarItemGroups: {
|
|
@@ -1150,7 +1150,7 @@ export const manifest: Manifest = {
|
|
|
1150
1150
|
name: 'renderItemCollectionOutlet',
|
|
1151
1151
|
comment: {
|
|
1152
1152
|
markdownText:
|
|
1153
|
-
'This function will be called when the plugin needs to render an outlet\ndefined by the `
|
|
1153
|
+
'This function will be called when the plugin needs to render an outlet\ndefined by the `itemCollectionOutlets()` hook.',
|
|
1154
1154
|
tag: 'outlets',
|
|
1155
1155
|
},
|
|
1156
1156
|
nonCtxArguments: [
|
|
@@ -1171,10 +1171,21 @@ export const manifest: Manifest = {
|
|
|
1171
1171
|
},
|
|
1172
1172
|
location: {
|
|
1173
1173
|
filePath: 'src/hooks/renderItemCollectionOutlet.ts',
|
|
1174
|
-
lineNumber:
|
|
1174
|
+
lineNumber: 24,
|
|
1175
1175
|
},
|
|
1176
1176
|
type: 'string',
|
|
1177
1177
|
},
|
|
1178
|
+
itemType: {
|
|
1179
|
+
comment: {
|
|
1180
|
+
markdownText:
|
|
1181
|
+
'The model for which the outlet is being rendered.',
|
|
1182
|
+
},
|
|
1183
|
+
location: {
|
|
1184
|
+
filePath: 'src/hooks/renderItemCollectionOutlet.ts',
|
|
1185
|
+
lineNumber: 26,
|
|
1186
|
+
},
|
|
1187
|
+
type: 'ItemType',
|
|
1188
|
+
},
|
|
1178
1189
|
},
|
|
1179
1190
|
},
|
|
1180
1191
|
],
|
|
@@ -1183,7 +1194,7 @@ export const manifest: Manifest = {
|
|
|
1183
1194
|
returnType: 'void',
|
|
1184
1195
|
location: {
|
|
1185
1196
|
filePath: 'src/hooks/renderItemCollectionOutlet.ts',
|
|
1186
|
-
lineNumber:
|
|
1197
|
+
lineNumber: 14,
|
|
1187
1198
|
},
|
|
1188
1199
|
},
|
|
1189
1200
|
renderFieldExtension: {
|
|
@@ -1590,7 +1601,7 @@ export const manifest: Manifest = {
|
|
|
1590
1601
|
itemType: {
|
|
1591
1602
|
location: {
|
|
1592
1603
|
filePath: 'src/hooks/overrideFieldExtensions.ts',
|
|
1593
|
-
lineNumber:
|
|
1604
|
+
lineNumber: 31,
|
|
1594
1605
|
},
|
|
1595
1606
|
type: 'ItemType',
|
|
1596
1607
|
},
|
|
@@ -1602,7 +1613,7 @@ export const manifest: Manifest = {
|
|
|
1602
1613
|
returnType: 'FieldExtensionOverride | undefined',
|
|
1603
1614
|
location: {
|
|
1604
1615
|
filePath: 'src/hooks/overrideFieldExtensions.ts',
|
|
1605
|
-
lineNumber:
|
|
1616
|
+
lineNumber: 24,
|
|
1606
1617
|
},
|
|
1607
1618
|
},
|
|
1608
1619
|
onBoot: {
|
|
@@ -1736,7 +1747,7 @@ export const manifest: Manifest = {
|
|
|
1736
1747
|
returnType: 'ManualFieldExtension[]',
|
|
1737
1748
|
location: {
|
|
1738
1749
|
filePath: 'src/hooks/manualFieldExtensions.ts',
|
|
1739
|
-
lineNumber:
|
|
1750
|
+
lineNumber: 18,
|
|
1740
1751
|
},
|
|
1741
1752
|
},
|
|
1742
1753
|
mainNavigationTabs: {
|
|
@@ -1755,7 +1766,7 @@ export const manifest: Manifest = {
|
|
|
1755
1766
|
returnType: 'MainNavigationTab[]',
|
|
1756
1767
|
location: {
|
|
1757
1768
|
filePath: 'src/hooks/mainNavigationTabs.ts',
|
|
1758
|
-
lineNumber:
|
|
1769
|
+
lineNumber: 18,
|
|
1759
1770
|
},
|
|
1760
1771
|
},
|
|
1761
1772
|
itemsDropdownActions: {
|
|
@@ -1815,7 +1826,7 @@ export const manifest: Manifest = {
|
|
|
1815
1826
|
returnType: 'ItemFormSidebar[]',
|
|
1816
1827
|
location: {
|
|
1817
1828
|
filePath: 'src/hooks/itemFormSidebars.ts',
|
|
1818
|
-
lineNumber:
|
|
1829
|
+
lineNumber: 14,
|
|
1819
1830
|
},
|
|
1820
1831
|
},
|
|
1821
1832
|
itemFormSidebarPanels: {
|
|
@@ -1839,7 +1850,7 @@ export const manifest: Manifest = {
|
|
|
1839
1850
|
returnType: 'ItemFormSidebarPanel[]',
|
|
1840
1851
|
location: {
|
|
1841
1852
|
filePath: 'src/hooks/itemFormSidebarPanels.ts',
|
|
1842
|
-
lineNumber:
|
|
1853
|
+
lineNumber: 22,
|
|
1843
1854
|
},
|
|
1844
1855
|
},
|
|
1845
1856
|
itemFormOutlets: {
|
|
@@ -1863,7 +1874,7 @@ export const manifest: Manifest = {
|
|
|
1863
1874
|
returnType: 'ItemFormOutlet[]',
|
|
1864
1875
|
location: {
|
|
1865
1876
|
filePath: 'src/hooks/itemFormOutlets.ts',
|
|
1866
|
-
lineNumber:
|
|
1877
|
+
lineNumber: 14,
|
|
1867
1878
|
},
|
|
1868
1879
|
},
|
|
1869
1880
|
itemFormDropdownActions: {
|
|
@@ -2006,7 +2017,7 @@ export const manifest: Manifest = {
|
|
|
2006
2017
|
returnType: 'ItemCollectionOutlet[]',
|
|
2007
2018
|
location: {
|
|
2008
2019
|
filePath: 'src/hooks/itemCollectionOutlets.ts',
|
|
2009
|
-
lineNumber:
|
|
2020
|
+
lineNumber: 14,
|
|
2010
2021
|
},
|
|
2011
2022
|
},
|
|
2012
2023
|
initialLocationQueryForItemSelector: {
|
|
@@ -2840,7 +2851,7 @@ export const manifest: Manifest = {
|
|
|
2840
2851
|
itemType: {
|
|
2841
2852
|
location: {
|
|
2842
2853
|
filePath: 'src/hooks/customMarksForStructuredTextField.ts',
|
|
2843
|
-
lineNumber:
|
|
2854
|
+
lineNumber: 29,
|
|
2844
2855
|
},
|
|
2845
2856
|
type: 'ItemType',
|
|
2846
2857
|
},
|
|
@@ -2852,7 +2863,7 @@ export const manifest: Manifest = {
|
|
|
2852
2863
|
returnType: 'StructuredTextCustomMark[] | undefined',
|
|
2853
2864
|
location: {
|
|
2854
2865
|
filePath: 'src/hooks/customMarksForStructuredTextField.ts',
|
|
2855
|
-
lineNumber:
|
|
2866
|
+
lineNumber: 22,
|
|
2856
2867
|
},
|
|
2857
2868
|
},
|
|
2858
2869
|
customBlockStylesForStructuredTextField: {
|
|
@@ -2877,7 +2888,7 @@ export const manifest: Manifest = {
|
|
|
2877
2888
|
location: {
|
|
2878
2889
|
filePath:
|
|
2879
2890
|
'src/hooks/customBlockStylesForStructuredTextField.ts',
|
|
2880
|
-
lineNumber:
|
|
2891
|
+
lineNumber: 23,
|
|
2881
2892
|
},
|
|
2882
2893
|
type: 'ItemType',
|
|
2883
2894
|
},
|
|
@@ -2889,7 +2900,7 @@ export const manifest: Manifest = {
|
|
|
2889
2900
|
returnType: 'StructuredTextCustomBlockStyle[] | undefined',
|
|
2890
2901
|
location: {
|
|
2891
2902
|
filePath: 'src/hooks/customBlockStylesForStructuredTextField.ts',
|
|
2892
|
-
lineNumber:
|
|
2903
|
+
lineNumber: 16,
|
|
2893
2904
|
},
|
|
2894
2905
|
},
|
|
2895
2906
|
contentAreaSidebarItems: {
|
|
@@ -2908,7 +2919,7 @@ export const manifest: Manifest = {
|
|
|
2908
2919
|
returnType: 'ContentAreaSidebarItem[]',
|
|
2909
2920
|
location: {
|
|
2910
2921
|
filePath: 'src/hooks/contentAreaSidebarItems.ts',
|
|
2911
|
-
lineNumber:
|
|
2922
|
+
lineNumber: 17,
|
|
2912
2923
|
},
|
|
2913
2924
|
},
|
|
2914
2925
|
buildItemPresentationInfo: {
|
|
@@ -2932,7 +2943,7 @@ export const manifest: Manifest = {
|
|
|
2932
2943
|
returnType: 'MaybePromise<ItemPresentationInfo | undefined>',
|
|
2933
2944
|
location: {
|
|
2934
2945
|
filePath: 'src/hooks/buildItemPresentationInfo.ts',
|
|
2935
|
-
lineNumber:
|
|
2946
|
+
lineNumber: 15,
|
|
2936
2947
|
},
|
|
2937
2948
|
},
|
|
2938
2949
|
assetSources: {
|
|
@@ -2951,7 +2962,7 @@ export const manifest: Manifest = {
|
|
|
2951
2962
|
returnType: 'AssetSource[] | undefined',
|
|
2952
2963
|
location: {
|
|
2953
2964
|
filePath: 'src/hooks/assetSources.ts',
|
|
2954
|
-
lineNumber:
|
|
2965
|
+
lineNumber: 12,
|
|
2955
2966
|
},
|
|
2956
2967
|
},
|
|
2957
2968
|
},
|
package/src/shared.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
isArray,
|
|
3
|
+
isBoolean,
|
|
4
|
+
isNullish,
|
|
5
|
+
isNumber,
|
|
6
|
+
isRecord,
|
|
7
|
+
isString,
|
|
8
|
+
} from './guardUtils.js';
|
|
9
|
+
import { Icon, isIcon } from './icon';
|
|
2
10
|
|
|
11
|
+
/**
|
|
12
|
+
* An object expressing a dropdown action to be shown in the interface
|
|
13
|
+
*
|
|
14
|
+
* @see {isDropdownAction}
|
|
15
|
+
*/
|
|
3
16
|
export type DropdownAction = {
|
|
4
17
|
/**
|
|
5
18
|
* ID of action. Will be the first argument for the
|
|
@@ -38,6 +51,11 @@ export type DropdownAction = {
|
|
|
38
51
|
rank?: number;
|
|
39
52
|
};
|
|
40
53
|
|
|
54
|
+
/**
|
|
55
|
+
* An object expressing a dropdown submenu containing actions to be shown in the interface
|
|
56
|
+
*
|
|
57
|
+
* @see {isDropdownActionGroup}
|
|
58
|
+
*/
|
|
41
59
|
export type DropdownActionGroup = {
|
|
42
60
|
/** Label to be shown. Must be unique. */
|
|
43
61
|
label: string;
|
|
@@ -65,3 +83,32 @@ export type ItemFormSidebarPanelPlacement = [
|
|
|
65
83
|
'before' | 'after',
|
|
66
84
|
'info' | 'publishedVersion' | 'schedule' | 'links' | 'history',
|
|
67
85
|
];
|
|
86
|
+
|
|
87
|
+
export function isDropdownAction(value: unknown): value is DropdownAction {
|
|
88
|
+
if (!isRecord(value)) return false;
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
isString(value.id) &&
|
|
92
|
+
(isNullish(value.parameters) || isRecord(value.parameters)) &&
|
|
93
|
+
isString(value.label) &&
|
|
94
|
+
isIcon(value.icon) &&
|
|
95
|
+
(isNullish(value.active) || isBoolean(value.active)) &&
|
|
96
|
+
(isNullish(value.alert) || isBoolean(value.alert)) &&
|
|
97
|
+
(isNullish(value.disabled) || isBoolean(value.disabled)) &&
|
|
98
|
+
(isNullish(value.closeMenuOnClick) || isBoolean(value.closeMenuOnClick)) &&
|
|
99
|
+
(isNullish(value.rank) || isNumber(value.rank))
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function isDropdownActionGroup(
|
|
104
|
+
value: unknown,
|
|
105
|
+
): value is DropdownActionGroup {
|
|
106
|
+
if (!isRecord(value)) return false;
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
isString(value.label) &&
|
|
110
|
+
isIcon(value.icon) &&
|
|
111
|
+
isArray(value.actions, isDropdownAction) &&
|
|
112
|
+
(isNullish(value.rank) || isNumber(value.rank))
|
|
113
|
+
);
|
|
114
|
+
}
|