datocms-plugin-sdk 2.0.4 → 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.
Files changed (131) hide show
  1. package/dist/cjs/guardUtils.js +33 -0
  2. package/dist/cjs/guardUtils.js.map +1 -0
  3. package/dist/cjs/hooks/assetSources.js +25 -0
  4. package/dist/cjs/hooks/assetSources.js.map +1 -1
  5. package/dist/cjs/hooks/buildItemPresentationInfo.js +13 -0
  6. package/dist/cjs/hooks/buildItemPresentationInfo.js.map +1 -1
  7. package/dist/cjs/hooks/contentAreaSidebarItems.js +17 -0
  8. package/dist/cjs/hooks/contentAreaSidebarItems.js.map +1 -1
  9. package/dist/cjs/hooks/customBlockStylesForStructuredTextField.js +14 -0
  10. package/dist/cjs/hooks/customBlockStylesForStructuredTextField.js.map +1 -1
  11. package/dist/cjs/hooks/customMarksForStructuredTextField.js +18 -0
  12. package/dist/cjs/hooks/customMarksForStructuredTextField.js.map +1 -1
  13. package/dist/cjs/hooks/initialLocationQueryForItemSelector.js +12 -0
  14. package/dist/cjs/hooks/initialLocationQueryForItemSelector.js.map +1 -1
  15. package/dist/cjs/hooks/itemCollectionOutlets.js +13 -0
  16. package/dist/cjs/hooks/itemCollectionOutlets.js.map +1 -1
  17. package/dist/cjs/hooks/itemFormOutlets.js +13 -0
  18. package/dist/cjs/hooks/itemFormOutlets.js.map +1 -1
  19. package/dist/cjs/hooks/itemFormSidebarPanels.js +17 -0
  20. package/dist/cjs/hooks/itemFormSidebarPanels.js.map +1 -1
  21. package/dist/cjs/hooks/itemFormSidebars.js +15 -0
  22. package/dist/cjs/hooks/itemFormSidebars.js.map +1 -1
  23. package/dist/cjs/hooks/mainNavigationTabs.js +17 -0
  24. package/dist/cjs/hooks/mainNavigationTabs.js.map +1 -1
  25. package/dist/cjs/hooks/manualFieldExtensions.js +25 -0
  26. package/dist/cjs/hooks/manualFieldExtensions.js.map +1 -1
  27. package/dist/cjs/hooks/overrideFieldExtensions.js +46 -0
  28. package/dist/cjs/hooks/overrideFieldExtensions.js.map +1 -1
  29. package/dist/cjs/hooks/uploadSidebarPanels.js +17 -0
  30. package/dist/cjs/hooks/uploadSidebarPanels.js.map +1 -1
  31. package/dist/cjs/hooks/uploadSidebars.js +15 -0
  32. package/dist/cjs/hooks/uploadSidebars.js.map +1 -1
  33. package/dist/cjs/icon.js +9 -0
  34. package/dist/cjs/icon.js.map +1 -1
  35. package/dist/cjs/manifest.js +17 -17
  36. package/dist/cjs/shared.js +25 -0
  37. package/dist/cjs/shared.js.map +1 -1
  38. package/dist/esm/guardUtils.d.ts +7 -0
  39. package/dist/esm/guardUtils.js +24 -0
  40. package/dist/esm/guardUtils.js.map +1 -0
  41. package/dist/esm/hooks/assetSources.d.ts +11 -1
  42. package/dist/esm/hooks/assetSources.js +24 -1
  43. package/dist/esm/hooks/assetSources.js.map +1 -1
  44. package/dist/esm/hooks/buildItemPresentationInfo.d.ts +11 -0
  45. package/dist/esm/hooks/buildItemPresentationInfo.js +12 -1
  46. package/dist/esm/hooks/buildItemPresentationInfo.js.map +1 -1
  47. package/dist/esm/hooks/contentAreaSidebarItems.d.ts +11 -0
  48. package/dist/esm/hooks/contentAreaSidebarItems.js +16 -1
  49. package/dist/esm/hooks/contentAreaSidebarItems.js.map +1 -1
  50. package/dist/esm/hooks/customBlockStylesForStructuredTextField.d.ts +11 -1
  51. package/dist/esm/hooks/customBlockStylesForStructuredTextField.js +13 -1
  52. package/dist/esm/hooks/customBlockStylesForStructuredTextField.js.map +1 -1
  53. package/dist/esm/hooks/customMarksForStructuredTextField.d.ts +11 -1
  54. package/dist/esm/hooks/customMarksForStructuredTextField.js +17 -1
  55. package/dist/esm/hooks/customMarksForStructuredTextField.js.map +1 -1
  56. package/dist/esm/hooks/initialLocationQueryForItemSelector.d.ts +11 -0
  57. package/dist/esm/hooks/initialLocationQueryForItemSelector.js +11 -1
  58. package/dist/esm/hooks/initialLocationQueryForItemSelector.js.map +1 -1
  59. package/dist/esm/hooks/itemCollectionOutlets.d.ts +11 -1
  60. package/dist/esm/hooks/itemCollectionOutlets.js +12 -1
  61. package/dist/esm/hooks/itemCollectionOutlets.js.map +1 -1
  62. package/dist/esm/hooks/itemFormOutlets.d.ts +11 -0
  63. package/dist/esm/hooks/itemFormOutlets.js +12 -1
  64. package/dist/esm/hooks/itemFormOutlets.js.map +1 -1
  65. package/dist/esm/hooks/itemFormSidebarPanels.d.ts +12 -0
  66. package/dist/esm/hooks/itemFormSidebarPanels.js +16 -1
  67. package/dist/esm/hooks/itemFormSidebarPanels.js.map +1 -1
  68. package/dist/esm/hooks/itemFormSidebars.d.ts +12 -0
  69. package/dist/esm/hooks/itemFormSidebars.js +14 -1
  70. package/dist/esm/hooks/itemFormSidebars.js.map +1 -1
  71. package/dist/esm/hooks/mainNavigationTabs.d.ts +11 -1
  72. package/dist/esm/hooks/mainNavigationTabs.js +16 -1
  73. package/dist/esm/hooks/mainNavigationTabs.js.map +1 -1
  74. package/dist/esm/hooks/manualFieldExtensions.d.ts +12 -0
  75. package/dist/esm/hooks/manualFieldExtensions.js +24 -1
  76. package/dist/esm/hooks/manualFieldExtensions.js.map +1 -1
  77. package/dist/esm/hooks/overrideFieldExtensions.d.ts +20 -0
  78. package/dist/esm/hooks/overrideFieldExtensions.js +43 -1
  79. package/dist/esm/hooks/overrideFieldExtensions.js.map +1 -1
  80. package/dist/esm/hooks/uploadSidebarPanels.d.ts +12 -0
  81. package/dist/esm/hooks/uploadSidebarPanels.js +16 -1
  82. package/dist/esm/hooks/uploadSidebarPanels.js.map +1 -1
  83. package/dist/esm/hooks/uploadSidebars.d.ts +12 -0
  84. package/dist/esm/hooks/uploadSidebars.js +14 -1
  85. package/dist/esm/hooks/uploadSidebars.js.map +1 -1
  86. package/dist/esm/icon.d.ts +1 -0
  87. package/dist/esm/icon.js +8 -1
  88. package/dist/esm/icon.js.map +1 -1
  89. package/dist/esm/manifest.js +17 -17
  90. package/dist/esm/shared.d.ts +12 -0
  91. package/dist/esm/shared.js +23 -1
  92. package/dist/esm/shared.js.map +1 -1
  93. package/dist/types/guardUtils.d.ts +7 -0
  94. package/dist/types/hooks/assetSources.d.ts +11 -1
  95. package/dist/types/hooks/buildItemPresentationInfo.d.ts +11 -0
  96. package/dist/types/hooks/contentAreaSidebarItems.d.ts +11 -0
  97. package/dist/types/hooks/customBlockStylesForStructuredTextField.d.ts +11 -1
  98. package/dist/types/hooks/customMarksForStructuredTextField.d.ts +11 -1
  99. package/dist/types/hooks/initialLocationQueryForItemSelector.d.ts +11 -0
  100. package/dist/types/hooks/itemCollectionOutlets.d.ts +11 -1
  101. package/dist/types/hooks/itemFormOutlets.d.ts +11 -0
  102. package/dist/types/hooks/itemFormSidebarPanels.d.ts +12 -0
  103. package/dist/types/hooks/itemFormSidebars.d.ts +12 -0
  104. package/dist/types/hooks/mainNavigationTabs.d.ts +11 -1
  105. package/dist/types/hooks/manualFieldExtensions.d.ts +12 -0
  106. package/dist/types/hooks/overrideFieldExtensions.d.ts +20 -0
  107. package/dist/types/hooks/uploadSidebarPanels.d.ts +12 -0
  108. package/dist/types/hooks/uploadSidebars.d.ts +12 -0
  109. package/dist/types/icon.d.ts +1 -0
  110. package/dist/types/shared.d.ts +12 -0
  111. package/manifest.json +17 -17
  112. package/package.json +2 -2
  113. package/src/guardUtils.ts +34 -0
  114. package/src/hooks/assetSources.ts +32 -2
  115. package/src/hooks/buildItemPresentationInfo.ts +22 -0
  116. package/src/hooks/contentAreaSidebarItems.ts +32 -1
  117. package/src/hooks/customBlockStylesForStructuredTextField.ts +23 -1
  118. package/src/hooks/customMarksForStructuredTextField.ts +33 -2
  119. package/src/hooks/initialLocationQueryForItemSelector.ts +21 -1
  120. package/src/hooks/itemCollectionOutlets.ts +22 -1
  121. package/src/hooks/itemFormOutlets.ts +20 -0
  122. package/src/hooks/itemFormSidebarPanels.ts +34 -0
  123. package/src/hooks/itemFormSidebars.ts +23 -0
  124. package/src/hooks/mainNavigationTabs.ts +32 -2
  125. package/src/hooks/manualFieldExtensions.ts +42 -0
  126. package/src/hooks/overrideFieldExtensions.ts +64 -0
  127. package/src/hooks/uploadSidebarPanels.ts +34 -0
  128. package/src/hooks/uploadSidebars.ts +23 -0
  129. package/src/icon.ts +12 -0
  130. package/src/manifest.ts +17 -17
  131. package/src/shared.ts +48 -1
@@ -58,7 +58,7 @@ exports.manifest = {
58
58
  returnType: 'UploadSidebar[]',
59
59
  location: {
60
60
  filePath: 'src/hooks/uploadSidebars.ts',
61
- lineNumber: 10,
61
+ lineNumber: 11,
62
62
  },
63
63
  },
64
64
  uploadSidebarPanels: {
@@ -76,7 +76,7 @@ exports.manifest = {
76
76
  returnType: 'UploadSidebarPanel[]',
77
77
  location: {
78
78
  filePath: 'src/hooks/uploadSidebarPanels.ts',
79
- lineNumber: 10,
79
+ lineNumber: 18,
80
80
  },
81
81
  },
82
82
  settingsAreaSidebarItemGroups: {
@@ -1481,7 +1481,7 @@ exports.manifest = {
1481
1481
  itemType: {
1482
1482
  location: {
1483
1483
  filePath: 'src/hooks/overrideFieldExtensions.ts',
1484
- lineNumber: 22,
1484
+ lineNumber: 31,
1485
1485
  },
1486
1486
  type: 'ItemType',
1487
1487
  },
@@ -1493,7 +1493,7 @@ exports.manifest = {
1493
1493
  returnType: 'FieldExtensionOverride | undefined',
1494
1494
  location: {
1495
1495
  filePath: 'src/hooks/overrideFieldExtensions.ts',
1496
- lineNumber: 15,
1496
+ lineNumber: 24,
1497
1497
  },
1498
1498
  },
1499
1499
  onBoot: {
@@ -1621,7 +1621,7 @@ exports.manifest = {
1621
1621
  returnType: 'ManualFieldExtension[]',
1622
1622
  location: {
1623
1623
  filePath: 'src/hooks/manualFieldExtensions.ts',
1624
- lineNumber: 10,
1624
+ lineNumber: 18,
1625
1625
  },
1626
1626
  },
1627
1627
  mainNavigationTabs: {
@@ -1639,7 +1639,7 @@ exports.manifest = {
1639
1639
  returnType: 'MainNavigationTab[]',
1640
1640
  location: {
1641
1641
  filePath: 'src/hooks/mainNavigationTabs.ts',
1642
- lineNumber: 11,
1642
+ lineNumber: 18,
1643
1643
  },
1644
1644
  },
1645
1645
  itemsDropdownActions: {
@@ -1697,7 +1697,7 @@ exports.manifest = {
1697
1697
  returnType: 'ItemFormSidebar[]',
1698
1698
  location: {
1699
1699
  filePath: 'src/hooks/itemFormSidebars.ts',
1700
- lineNumber: 13,
1700
+ lineNumber: 14,
1701
1701
  },
1702
1702
  },
1703
1703
  itemFormSidebarPanels: {
@@ -1720,7 +1720,7 @@ exports.manifest = {
1720
1720
  returnType: 'ItemFormSidebarPanel[]',
1721
1721
  location: {
1722
1722
  filePath: 'src/hooks/itemFormSidebarPanels.ts',
1723
- lineNumber: 14,
1723
+ lineNumber: 22,
1724
1724
  },
1725
1725
  },
1726
1726
  itemFormOutlets: {
@@ -1743,7 +1743,7 @@ exports.manifest = {
1743
1743
  returnType: 'ItemFormOutlet[]',
1744
1744
  location: {
1745
1745
  filePath: 'src/hooks/itemFormOutlets.ts',
1746
- lineNumber: 13,
1746
+ lineNumber: 14,
1747
1747
  },
1748
1748
  },
1749
1749
  itemFormDropdownActions: {
@@ -1878,7 +1878,7 @@ exports.manifest = {
1878
1878
  returnType: 'ItemCollectionOutlet[]',
1879
1879
  location: {
1880
1880
  filePath: 'src/hooks/itemCollectionOutlets.ts',
1881
- lineNumber: 13,
1881
+ lineNumber: 14,
1882
1882
  },
1883
1883
  },
1884
1884
  initialLocationQueryForItemSelector: {
@@ -2652,7 +2652,7 @@ exports.manifest = {
2652
2652
  itemType: {
2653
2653
  location: {
2654
2654
  filePath: 'src/hooks/customMarksForStructuredTextField.ts',
2655
- lineNumber: 22,
2655
+ lineNumber: 29,
2656
2656
  },
2657
2657
  type: 'ItemType',
2658
2658
  },
@@ -2664,7 +2664,7 @@ exports.manifest = {
2664
2664
  returnType: 'StructuredTextCustomMark[] | undefined',
2665
2665
  location: {
2666
2666
  filePath: 'src/hooks/customMarksForStructuredTextField.ts',
2667
- lineNumber: 15,
2667
+ lineNumber: 22,
2668
2668
  },
2669
2669
  },
2670
2670
  customBlockStylesForStructuredTextField: {
@@ -2687,7 +2687,7 @@ exports.manifest = {
2687
2687
  itemType: {
2688
2688
  location: {
2689
2689
  filePath: 'src/hooks/customBlockStylesForStructuredTextField.ts',
2690
- lineNumber: 22,
2690
+ lineNumber: 23,
2691
2691
  },
2692
2692
  type: 'ItemType',
2693
2693
  },
@@ -2699,7 +2699,7 @@ exports.manifest = {
2699
2699
  returnType: 'StructuredTextCustomBlockStyle[] | undefined',
2700
2700
  location: {
2701
2701
  filePath: 'src/hooks/customBlockStylesForStructuredTextField.ts',
2702
- lineNumber: 15,
2702
+ lineNumber: 16,
2703
2703
  },
2704
2704
  },
2705
2705
  contentAreaSidebarItems: {
@@ -2717,7 +2717,7 @@ exports.manifest = {
2717
2717
  returnType: 'ContentAreaSidebarItem[]',
2718
2718
  location: {
2719
2719
  filePath: 'src/hooks/contentAreaSidebarItems.ts',
2720
- lineNumber: 10,
2720
+ lineNumber: 17,
2721
2721
  },
2722
2722
  },
2723
2723
  buildItemPresentationInfo: {
@@ -2740,7 +2740,7 @@ exports.manifest = {
2740
2740
  returnType: 'MaybePromise<ItemPresentationInfo | undefined>',
2741
2741
  location: {
2742
2742
  filePath: 'src/hooks/buildItemPresentationInfo.ts',
2743
- lineNumber: 14,
2743
+ lineNumber: 15,
2744
2744
  },
2745
2745
  },
2746
2746
  assetSources: {
@@ -2758,7 +2758,7 @@ exports.manifest = {
2758
2758
  returnType: 'AssetSource[] | undefined',
2759
2759
  location: {
2760
2760
  filePath: 'src/hooks/assetSources.ts',
2761
- lineNumber: 11,
2761
+ lineNumber: 12,
2762
2762
  },
2763
2763
  },
2764
2764
  },
@@ -1,3 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isDropdownAction = isDropdownAction;
4
+ exports.isDropdownActionGroup = isDropdownActionGroup;
5
+ var guardUtils_js_1 = require("./guardUtils.js");
6
+ var icon_1 = require("./icon");
7
+ function isDropdownAction(value) {
8
+ if (!(0, guardUtils_js_1.isRecord)(value))
9
+ return false;
10
+ return ((0, guardUtils_js_1.isString)(value.id) &&
11
+ ((0, guardUtils_js_1.isNullish)(value.parameters) || (0, guardUtils_js_1.isRecord)(value.parameters)) &&
12
+ (0, guardUtils_js_1.isString)(value.label) &&
13
+ (0, icon_1.isIcon)(value.icon) &&
14
+ ((0, guardUtils_js_1.isNullish)(value.active) || (0, guardUtils_js_1.isBoolean)(value.active)) &&
15
+ ((0, guardUtils_js_1.isNullish)(value.alert) || (0, guardUtils_js_1.isBoolean)(value.alert)) &&
16
+ ((0, guardUtils_js_1.isNullish)(value.disabled) || (0, guardUtils_js_1.isBoolean)(value.disabled)) &&
17
+ ((0, guardUtils_js_1.isNullish)(value.closeMenuOnClick) || (0, guardUtils_js_1.isBoolean)(value.closeMenuOnClick)) &&
18
+ ((0, guardUtils_js_1.isNullish)(value.rank) || (0, guardUtils_js_1.isNumber)(value.rank)));
19
+ }
20
+ function isDropdownActionGroup(value) {
21
+ if (!(0, guardUtils_js_1.isRecord)(value))
22
+ return false;
23
+ return ((0, guardUtils_js_1.isString)(value.label) &&
24
+ (0, icon_1.isIcon)(value.icon) &&
25
+ (0, guardUtils_js_1.isArray)(value.actions, isDropdownAction) &&
26
+ ((0, guardUtils_js_1.isNullish)(value.rank) || (0, guardUtils_js_1.isNumber)(value.rank)));
27
+ }
3
28
  //# sourceMappingURL=shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/shared.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/shared.ts"],"names":[],"mappings":";;AAsFA,4CAcC;AAED,sDAWC;AAjHD,iDAOyB;AACzB,+BAAsC;AA8EtC,SAAgB,gBAAgB,CAAC,KAAc;IAC7C,IAAI,CAAC,IAAA,wBAAQ,EAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAEnC,OAAO,CACL,IAAA,wBAAQ,EAAC,KAAK,CAAC,EAAE,CAAC;QAClB,CAAC,IAAA,yBAAS,EAAC,KAAK,CAAC,UAAU,CAAC,IAAI,IAAA,wBAAQ,EAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC3D,IAAA,wBAAQ,EAAC,KAAK,CAAC,KAAK,CAAC;QACrB,IAAA,aAAM,EAAC,KAAK,CAAC,IAAI,CAAC;QAClB,CAAC,IAAA,yBAAS,EAAC,KAAK,CAAC,MAAM,CAAC,IAAI,IAAA,yBAAS,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACpD,CAAC,IAAA,yBAAS,EAAC,KAAK,CAAC,KAAK,CAAC,IAAI,IAAA,yBAAS,EAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAClD,CAAC,IAAA,yBAAS,EAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,IAAA,yBAAS,EAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACxD,CAAC,IAAA,yBAAS,EAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,IAAA,yBAAS,EAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACxE,CAAC,IAAA,yBAAS,EAAC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAA,wBAAQ,EAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAChD,CAAC;AACJ,CAAC;AAED,SAAgB,qBAAqB,CACnC,KAAc;IAEd,IAAI,CAAC,IAAA,wBAAQ,EAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAEnC,OAAO,CACL,IAAA,wBAAQ,EAAC,KAAK,CAAC,KAAK,CAAC;QACrB,IAAA,aAAM,EAAC,KAAK,CAAC,IAAI,CAAC;QAClB,IAAA,uBAAO,EAAC,KAAK,CAAC,OAAO,EAAE,gBAAgB,CAAC;QACxC,CAAC,IAAA,yBAAS,EAAC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAA,wBAAQ,EAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAChD,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare function isNullish(value: unknown): value is null | undefined;
2
+ export declare function isBoolean(value: unknown): value is boolean;
3
+ export declare function isString(value: unknown): value is string;
4
+ export declare function isNumber(value: unknown): value is number;
5
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
6
+ export declare function isArray<T>(value: unknown, checkItem: (item: unknown) => item is T): value is T[];
7
+ export declare function isPlacement(value: unknown): boolean;
@@ -0,0 +1,24 @@
1
+ export function isNullish(value) {
2
+ return value === null || value === undefined;
3
+ }
4
+ export function isBoolean(value) {
5
+ return typeof value === 'boolean';
6
+ }
7
+ export function isString(value) {
8
+ return typeof value === 'string';
9
+ }
10
+ export function isNumber(value) {
11
+ return typeof value === 'number';
12
+ }
13
+ export function isRecord(value) {
14
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
15
+ }
16
+ export function isArray(value, checkItem) {
17
+ return Array.isArray(value) && value.every(checkItem);
18
+ }
19
+ export function isPlacement(value) {
20
+ return (isArray(value, isString) &&
21
+ value.length === 2 &&
22
+ ['before', 'after'].includes(value[0]));
23
+ }
24
+ //# sourceMappingURL=guardUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guardUtils.js","sourceRoot":"","sources":["../../src/guardUtils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,OAAO,OAAO,KAAK,KAAK,SAAS,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,MAAM,UAAU,OAAO,CACrB,KAAc,EACd,SAAuC;IAEvC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,OAAO,CACL,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC;QACxB,KAAK,CAAC,MAAM,KAAK,CAAC;QAClB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACvC,CAAC;AACJ,CAAC"}
@@ -10,7 +10,11 @@ export type AssetSourcesHook = {
10
10
  assetSources: (ctx: AssetSourcesCtx) => AssetSource[] | undefined;
11
11
  };
12
12
  export type AssetSourcesCtx = Ctx;
13
- /** An additional asset source */
13
+ /**
14
+ * An object expressing an additional asset source
15
+ *
16
+ * @see {isAssetSource}
17
+ */
14
18
  export type AssetSource = {
15
19
  /**
16
20
  * ID of the asset source. Will be the first argument for the
@@ -40,3 +44,9 @@ export type AssetSource = {
40
44
  initialHeight?: number;
41
45
  };
42
46
  };
47
+ /**
48
+ * Type guard for AssetSource.
49
+ * @param value - The value to check.
50
+ * @returns true if the value is an AssetSource, false otherwise.
51
+ */
52
+ export declare function isAssetSource(value: unknown): value is AssetSource;
@@ -1,2 +1,25 @@
1
- export {};
1
+ import { isNullish, isNumber, isRecord, isString } from '../guardUtils.js';
2
+ import { isIcon } from '../icon';
3
+ /**
4
+ * Type guard for AssetSource.
5
+ * @param value - The value to check.
6
+ * @returns true if the value is an AssetSource, false otherwise.
7
+ */
8
+ export function isAssetSource(value) {
9
+ if (isNullish(value))
10
+ return false;
11
+ if (!isRecord(value))
12
+ return false;
13
+ var id = value.id, name = value.name, icon = value.icon, modal = value.modal;
14
+ return (isString(id) &&
15
+ isString(name) &&
16
+ isIcon(icon) &&
17
+ (isNullish(modal) ||
18
+ (isRecord(modal) &&
19
+ (isNullish(modal.width) ||
20
+ (isString(modal.width) &&
21
+ ['s', 'm', 'l', 'xl'].includes(modal.width)) ||
22
+ isNumber(modal.width)) &&
23
+ (isNullish(modal.initialHeight) || isNumber(modal.initialHeight)))));
24
+ }
2
25
  //# sourceMappingURL=assetSources.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"assetSources.js","sourceRoot":"","sources":["../../../src/hooks/assetSources.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"assetSources.js","sourceRoot":"","sources":["../../../src/hooks/assetSources.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAQ,MAAM,EAAE,MAAM,SAAS,CAAC;AAiDvC;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,SAAS,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACnC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAE3B,IAAA,EAAE,GAAwB,KAAK,GAA7B,EAAE,IAAI,GAAkB,KAAK,KAAvB,EAAE,IAAI,GAAY,KAAK,KAAjB,EAAE,KAAK,GAAK,KAAK,MAAV,CAAW;IAExC,OAAO,CACL,QAAQ,CAAC,EAAE,CAAC;QACZ,QAAQ,CAAC,IAAI,CAAC;QACd,MAAM,CAAC,IAAI,CAAC;QACZ,CAAC,SAAS,CAAC,KAAK,CAAC;YACf,CAAC,QAAQ,CAAC,KAAK,CAAC;gBACd,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC;oBACrB,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;wBACpB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBAC9C,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACxB,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CACxE,CAAC;AACJ,CAAC"}
@@ -12,6 +12,11 @@ export type BuildItemPresentationInfoHook = {
12
12
  buildItemPresentationInfo: (item: Item, ctx: BuildItemPresentationInfoCtx) => MaybePromise<ItemPresentationInfo | undefined>;
13
13
  };
14
14
  export type BuildItemPresentationInfoCtx = Ctx;
15
+ /**
16
+ * An object expressing how a record should be presented in the interface
17
+ *
18
+ * @see {isItemPresentationInfo}
19
+ */
15
20
  export type ItemPresentationInfo = {
16
21
  /** The title to present the record */
17
22
  title: string;
@@ -26,4 +31,10 @@ export type ItemPresentationInfo = {
26
31
  */
27
32
  rank?: number;
28
33
  };
34
+ /**
35
+ * Checks if the value is an ItemPresentationInfo type.
36
+ * @param value The value to check.
37
+ * @returns True if the value is an ItemPresentationInfo, false otherwise.
38
+ */
39
+ export declare function isItemPresentationInfo(value: unknown): value is ItemPresentationInfo;
29
40
  export {};
@@ -1,2 +1,13 @@
1
- export {};
1
+ import { isNullish, isNumber, isRecord, isString } from '../guardUtils.js';
2
+ /**
3
+ * Checks if the value is an ItemPresentationInfo type.
4
+ * @param value The value to check.
5
+ * @returns True if the value is an ItemPresentationInfo, false otherwise.
6
+ */
7
+ export function isItemPresentationInfo(value) {
8
+ return (isRecord(value) &&
9
+ isString(value.title) &&
10
+ (isNullish(value.imageUrl) || isString(value.imageUrl)) &&
11
+ (isNullish(value.rank) || isNumber(value.rank)));
12
+ }
2
13
  //# sourceMappingURL=buildItemPresentationInfo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildItemPresentationInfo.js","sourceRoot":"","sources":["../../../src/hooks/buildItemPresentationInfo.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"buildItemPresentationInfo.js","sourceRoot":"","sources":["../../../src/hooks/buildItemPresentationInfo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAwC3E;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CACpC,KAAc;IAEd,OAAO,CACL,QAAQ,CAAC,KAAK,CAAC;QACf,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;QACrB,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QACvD,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAChD,CAAC;AACJ,CAAC"}
@@ -9,6 +9,11 @@ export type ContentAreaSidebarItemsHook = {
9
9
  contentAreaSidebarItems: (ctx: ContentAreaSidebarItemsCtx) => ContentAreaSidebarItem[];
10
10
  };
11
11
  export type ContentAreaSidebarItemsCtx = Ctx;
12
+ /**
13
+ * An object expressing an item in the content area sidebar
14
+ *
15
+ * @see {isContentAreaSidebarItem}
16
+ */
12
17
  export type ContentAreaSidebarItem = {
13
18
  /** Label to be shown. Must be unique. */
14
19
  label: string;
@@ -38,3 +43,9 @@ export type ContentAreaSidebarItem = {
38
43
  */
39
44
  rank?: number;
40
45
  };
46
+ /**
47
+ * Checks if the value is a ContentAreaSidebarItem.
48
+ * @param value - The value to check.
49
+ * @returns True if the value is a ContentAreaSidebarItem, false otherwise.
50
+ */
51
+ export declare function isContentAreaSidebarItem(value: unknown): value is ContentAreaSidebarItem;
@@ -1,2 +1,17 @@
1
- export {};
1
+ import { isNullish, isNumber, isPlacement, isRecord, isString, } from '../guardUtils.js';
2
+ import { isIcon } from '../icon';
3
+ /**
4
+ * Checks if the value is a ContentAreaSidebarItem.
5
+ * @param value - The value to check.
6
+ * @returns True if the value is a ContentAreaSidebarItem, false otherwise.
7
+ */
8
+ export function isContentAreaSidebarItem(value) {
9
+ return (isRecord(value) &&
10
+ isString(value.label) &&
11
+ isIcon(value.icon) &&
12
+ isRecord(value.pointsTo) &&
13
+ isString(value.pointsTo.pageId) &&
14
+ (isNullish(value.placement) || isPlacement(value.placement)) &&
15
+ (isNullish(value.rank) || isNumber(value.rank)));
16
+ }
2
17
  //# sourceMappingURL=contentAreaSidebarItems.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"contentAreaSidebarItems.js","sourceRoot":"","sources":["../../../src/hooks/contentAreaSidebarItems.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"contentAreaSidebarItems.js","sourceRoot":"","sources":["../../../src/hooks/contentAreaSidebarItems.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAQ,MAAM,EAAE,MAAM,SAAS,CAAC;AAkDvC;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACtC,KAAc;IAEd,OAAO,CACL,QAAQ,CAAC,KAAK,CAAC;QACf,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;QACrB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;QAClB,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;QACxB,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC/B,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC5D,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAChD,CAAC;AACJ,CAAC"}
@@ -15,7 +15,11 @@ export type CustomBlockStylesForStructuredTextFieldHook = {
15
15
  export type CustomBlockStylesForStructuredTextFieldCtx = Ctx<{
16
16
  itemType: ItemType;
17
17
  }>;
18
- /** An object expressing a custom block style for a Structured Text field */
18
+ /**
19
+ * An object expressing a custom block style for a Structured Text field
20
+ *
21
+ * @see {isStructuredTextCustomBlockStyle}
22
+ */
19
23
  export type StructuredTextCustomBlockStyle = {
20
24
  /** ID of custom block style */
21
25
  id: string;
@@ -33,4 +37,10 @@ export type StructuredTextCustomBlockStyle = {
33
37
  */
34
38
  rank?: number;
35
39
  };
40
+ /**
41
+ * Checks if the given value is a StructuredTextCustomBlockStyle.
42
+ * @param value - The value to check.
43
+ * @returns True if the value is a StructuredTextCustomBlockStyle, otherwise false.
44
+ */
45
+ export declare function isStructuredTextCustomBlockStyle(value: unknown): value is StructuredTextCustomBlockStyle;
36
46
  export {};
@@ -1,2 +1,14 @@
1
- export {};
1
+ import { isNullish, isNumber, isRecord, isString } from '../guardUtils.js';
2
+ /**
3
+ * Checks if the given value is a StructuredTextCustomBlockStyle.
4
+ * @param value - The value to check.
5
+ * @returns True if the value is a StructuredTextCustomBlockStyle, otherwise false.
6
+ */
7
+ export function isStructuredTextCustomBlockStyle(value) {
8
+ return (isRecord(value) &&
9
+ isString(value.id) &&
10
+ isString(value.label) &&
11
+ isString(value.node) &&
12
+ (isNullish(value.rank) || isNumber(value.rank)));
13
+ }
2
14
  //# sourceMappingURL=customBlockStylesForStructuredTextField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"customBlockStylesForStructuredTextField.js","sourceRoot":"","sources":["../../../src/hooks/customBlockStylesForStructuredTextField.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"customBlockStylesForStructuredTextField.js","sourceRoot":"","sources":["../../../src/hooks/customBlockStylesForStructuredTextField.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AA6C3E;;;;GAIG;AACH,MAAM,UAAU,gCAAgC,CAC9C,KAAc;IAEd,OAAO,CACL,QAAQ,CAAC,KAAK,CAAC;QACf,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAClB,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;QACrB,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC;QACpB,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAChD,CAAC;AACJ,CAAC"}
@@ -15,7 +15,11 @@ export type CustomMarksForStructuredTextFieldHook = {
15
15
  export type CustomMarksForStructuredTextFieldCtx = Ctx<{
16
16
  itemType: ItemType;
17
17
  }>;
18
- /** An object expressing a custom mark for a Structured Text field */
18
+ /**
19
+ * An object expressing a custom mark for a Structured Text field
20
+ *
21
+ * @see {isStructuredTextCustomMark}
22
+ */
19
23
  export type StructuredTextCustomMark = {
20
24
  /** ID of mark */
21
25
  id: string;
@@ -54,4 +58,10 @@ export type StructuredTextCustomMarkPlacement = [
54
58
  'before' | 'after',
55
59
  'strong' | 'emphasis' | 'underline' | 'code' | 'highlight' | 'strikethrough'
56
60
  ];
61
+ /**
62
+ * Checks if the given value is a StructuredTextCustomMark.
63
+ * @param value The value to check.
64
+ * @returns True if the value is a StructuredTextCustomMark, false otherwise.
65
+ */
66
+ export declare function isStructuredTextCustomMark(value: unknown): value is StructuredTextCustomMark;
57
67
  export {};
@@ -1,2 +1,18 @@
1
- export {};
1
+ import { isNullish, isNumber, isPlacement, isRecord, isString, } from '../guardUtils.js';
2
+ import { isIcon } from '../icon';
3
+ /**
4
+ * Checks if the given value is a StructuredTextCustomMark.
5
+ * @param value The value to check.
6
+ * @returns True if the value is a StructuredTextCustomMark, false otherwise.
7
+ */
8
+ export function isStructuredTextCustomMark(value) {
9
+ return (isRecord(value) &&
10
+ isString(value.id) &&
11
+ isString(value.label) &&
12
+ isIcon(value.icon) &&
13
+ (isNullish(value.placement) || isPlacement(value.placement)) &&
14
+ (isNullish(value.rank) || isNumber(value.rank)) &&
15
+ (isNullish(value.keyboardShortcut) || isString(value.keyboardShortcut)) &&
16
+ isRecord(value.appliedStyle));
17
+ }
2
18
  //# sourceMappingURL=customMarksForStructuredTextField.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"customMarksForStructuredTextField.js","sourceRoot":"","sources":["../../../src/hooks/customMarksForStructuredTextField.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"customMarksForStructuredTextField.js","sourceRoot":"","sources":["../../../src/hooks/customMarksForStructuredTextField.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAQ,MAAM,EAAE,MAAM,SAAS,CAAC;AAmEvC;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CACxC,KAAc;IAEd,OAAO,CACL,QAAQ,CAAC,KAAK,CAAC;QACf,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAClB,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;QACrB,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;QAClB,CAAC,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC5D,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC/C,CAAC,SAAS,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACvE,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC,CAC7B,CAAC;AACJ,CAAC"}
@@ -13,6 +13,11 @@ export type InitialLocationQueryForItemSelectorHook = {
13
13
  initialLocationQueryForItemSelector: (openerField: Field, itemType: ItemType, ctx: InitialLocationQueryForItemSelectorCtx) => MaybePromise<InitialLocationQueryForItemSelector | undefined>;
14
14
  };
15
15
  export type InitialLocationQueryForItemSelectorCtx = Ctx;
16
+ /**
17
+ * An object expressing which filters should be applied to the record selector
18
+ *
19
+ * @see {isInitialLocationQueryForItemSelector}
20
+ */
16
21
  export type InitialLocationQueryForItemSelector = {
17
22
  locationQuery: ItemListLocationQuery;
18
23
  /**
@@ -24,4 +29,10 @@ export type InitialLocationQueryForItemSelector = {
24
29
  */
25
30
  rank?: number;
26
31
  };
32
+ /**
33
+ * Type guard for InitialLocationQueryForItemSelector
34
+ * @param value - The value to check
35
+ * @returns True if value is of type InitialLocationQueryForItemSelector, false otherwise
36
+ */
37
+ export declare function isInitialLocationQueryForItemSelector(value: unknown): value is InitialLocationQueryForItemSelector;
27
38
  export {};
@@ -1,2 +1,12 @@
1
- export {};
1
+ import { isNullish, isNumber, isRecord } from '../guardUtils.js';
2
+ /**
3
+ * Type guard for InitialLocationQueryForItemSelector
4
+ * @param value - The value to check
5
+ * @returns True if value is of type InitialLocationQueryForItemSelector, false otherwise
6
+ */
7
+ export function isInitialLocationQueryForItemSelector(value) {
8
+ return (isRecord(value) &&
9
+ isRecord(value.locationQuery) &&
10
+ (isNullish(value.rank) || isNumber(value.rank)));
11
+ }
2
12
  //# sourceMappingURL=initialLocationQueryForItemSelector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"initialLocationQueryForItemSelector.js","sourceRoot":"","sources":["../../../src/hooks/initialLocationQueryForItemSelector.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"initialLocationQueryForItemSelector.js","sourceRoot":"","sources":["../../../src/hooks/initialLocationQueryForItemSelector.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAuCjE;;;;GAIG;AACH,MAAM,UAAU,qCAAqC,CACnD,KAAc;IAEd,OAAO,CACL,QAAQ,CAAC,KAAK,CAAC;QACf,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC;QAC7B,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAChD,CAAC;AACJ,CAAC"}
@@ -11,7 +11,11 @@ export type ItemCollectionOutletsHook = {
11
11
  itemCollectionOutlets: (itemType: ItemType, ctx: ItemCollectionOutletsCtx) => ItemCollectionOutlet[];
12
12
  };
13
13
  export type ItemCollectionOutletsCtx = Ctx;
14
- /** An outlet to be shown at the top of a record's collection page */
14
+ /**
15
+ * An object expressing an outlet to be shown at the top of a record's collection page
16
+ *
17
+ * @see {isItemCollectionOutlet}
18
+ */
15
19
  export type ItemCollectionOutlet = {
16
20
  /**
17
21
  * ID of the outlet. Will be the first argument for the `renderItemCollectionOutlet`
@@ -28,4 +32,10 @@ export type ItemCollectionOutlet = {
28
32
  /** The initial height to set for the iframe that will render the outlet */
29
33
  initialHeight?: number;
30
34
  };
35
+ /**
36
+ * Checks if the given value is an ItemCollectionOutlet.
37
+ * @param value - The value to check.
38
+ * @returns True if the value is an ItemCollectionOutlet, false otherwise.
39
+ */
40
+ export declare function isItemCollectionOutlet(value: unknown): value is ItemCollectionOutlet;
31
41
  export {};
@@ -1,2 +1,13 @@
1
- export {};
1
+ import { isNullish, isNumber, isRecord, isString } from '../guardUtils.js';
2
+ /**
3
+ * Checks if the given value is an ItemCollectionOutlet.
4
+ * @param value - The value to check.
5
+ * @returns True if the value is an ItemCollectionOutlet, false otherwise.
6
+ */
7
+ export function isItemCollectionOutlet(value) {
8
+ return (isRecord(value) &&
9
+ isString(value.id) &&
10
+ (isNullish(value.rank) || isNumber(value.rank)) &&
11
+ (isNullish(value.initialHeight) || isNumber(value.initialHeight)));
12
+ }
2
13
  //# sourceMappingURL=itemCollectionOutlets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"itemCollectionOutlets.js","sourceRoot":"","sources":["../../../src/hooks/itemCollectionOutlets.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"itemCollectionOutlets.js","sourceRoot":"","sources":["../../../src/hooks/itemCollectionOutlets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAyC3E;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CACpC,KAAc;IAEd,OAAO,CACL,QAAQ,CAAC,KAAK,CAAC;QACf,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAClB,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC/C,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAClE,CAAC;AACJ,CAAC"}
@@ -11,6 +11,11 @@ export type ItemFormOutletsHook = {
11
11
  itemFormOutlets: (itemType: ItemType, ctx: ItemFormOutletsCtx) => ItemFormOutlet[];
12
12
  };
13
13
  export type ItemFormOutletsCtx = Ctx;
14
+ /**
15
+ * An object expressing an outlet to be shown at the top of a record's editing page
16
+ *
17
+ * @see {isItemFormOutlet}
18
+ */
14
19
  export type ItemFormOutlet = {
15
20
  /**
16
21
  * ID of the outlet. Will be the first argument for the `renderItemFormOutlet`
@@ -27,4 +32,10 @@ export type ItemFormOutlet = {
27
32
  /** The initial height to set for the iframe that will render the outlet */
28
33
  initialHeight?: number;
29
34
  };
35
+ /**
36
+ * Checks if the given value is an ItemFormOutlet.
37
+ * @param value - The value to check.
38
+ * @returns True if the value is an ItemFormOutlet, false otherwise.
39
+ */
40
+ export declare function isItemFormOutlet(value: unknown): value is ItemFormOutlet;
30
41
  export {};
@@ -1,2 +1,13 @@
1
- export {};
1
+ import { isNullish, isNumber, isRecord, isString } from '../guardUtils.js';
2
+ /**
3
+ * Checks if the given value is an ItemFormOutlet.
4
+ * @param value - The value to check.
5
+ * @returns True if the value is an ItemFormOutlet, false otherwise.
6
+ */
7
+ export function isItemFormOutlet(value) {
8
+ return (isRecord(value) &&
9
+ isString(value.id) &&
10
+ (isNullish(value.rank) || isNumber(value.rank)) &&
11
+ (isNullish(value.initialHeight) || isNumber(value.initialHeight)));
12
+ }
2
13
  //# sourceMappingURL=itemFormOutlets.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"itemFormOutlets.js","sourceRoot":"","sources":["../../../src/hooks/itemFormOutlets.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"itemFormOutlets.js","sourceRoot":"","sources":["../../../src/hooks/itemFormOutlets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAyC3E;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,CACL,QAAQ,CAAC,KAAK,CAAC;QACf,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAClB,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC/C,CAAC,SAAS,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAClE,CAAC;AACJ,CAAC"}
@@ -12,6 +12,12 @@ export type ItemFormSidebarPanelsHook = {
12
12
  itemFormSidebarPanels: (itemType: ItemType, ctx: ItemFormSidebarPanelsCtx) => ItemFormSidebarPanel[];
13
13
  };
14
14
  export type ItemFormSidebarPanelsCtx = Ctx;
15
+ /**
16
+ * An object expressing a sidebar panel to be shown when the user
17
+ * edits records of a particular model
18
+ *
19
+ * @see {isItemFormSidebarPanel}
20
+ */
15
21
  export type ItemFormSidebarPanel = {
16
22
  /**
17
23
  * ID of the panel. Will be the first argument for the
@@ -45,4 +51,10 @@ export type ItemFormSidebarPanel = {
45
51
  /** The initial height to set for the iframe that will render the sidebar panel */
46
52
  initialHeight?: number;
47
53
  };
54
+ /**
55
+ * Checks if the given value is an ItemFormSidebarPanel.
56
+ * @param value - The value to check.
57
+ * @returns True if the value is an ItemFormSidebarPanel, false otherwise.
58
+ */
59
+ export declare function isItemFormSidebarPanel(value: unknown): value is ItemFormSidebarPanel;
48
60
  export {};