datocms-plugin-sdk 2.0.0 → 2.0.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.
Files changed (105) hide show
  1. package/dist/cjs/hooks/renderItemCollectionOutlet.js.map +1 -1
  2. package/dist/cjs/manifest.js +2373 -2110
  3. package/dist/cjs/manifest.js.map +1 -1
  4. package/dist/esm/ctx/base.d.ts +43 -29
  5. package/dist/esm/hooks/assetSources.d.ts +2 -1
  6. package/dist/esm/hooks/buildItemPresentationInfo.d.ts +2 -1
  7. package/dist/esm/hooks/contentAreaSidebarItems.d.ts +2 -1
  8. package/dist/esm/hooks/customBlockStylesForStructuredTextField.d.ts +2 -2
  9. package/dist/esm/hooks/customMarksForStructuredTextField.d.ts +2 -2
  10. package/dist/esm/hooks/executeFieldDropdownAction.d.ts +9 -1
  11. package/dist/esm/hooks/executeItemFormDropdownAction.d.ts +9 -1
  12. package/dist/esm/hooks/executeItemsDropdownAction.d.ts +11 -1
  13. package/dist/esm/hooks/executeUploadsDropdownAction.d.ts +11 -1
  14. package/dist/esm/hooks/fieldDropdownActions.d.ts +9 -0
  15. package/dist/esm/hooks/initialLocationQueryForItemSelector.d.ts +2 -1
  16. package/dist/esm/hooks/itemCollectionOutlets.d.ts +8 -1
  17. package/dist/esm/hooks/itemFormDropdownActions.d.ts +9 -0
  18. package/dist/esm/hooks/itemFormOutlets.d.ts +3 -2
  19. package/dist/esm/hooks/itemFormSidebarPanels.d.ts +2 -1
  20. package/dist/esm/hooks/itemFormSidebars.d.ts +2 -1
  21. package/dist/esm/hooks/itemsDropdownActions.d.ts +12 -0
  22. package/dist/esm/hooks/mainNavigationTabs.d.ts +2 -1
  23. package/dist/esm/hooks/manualFieldExtensions.d.ts +2 -1
  24. package/dist/esm/hooks/onBeforeItemUpsert.d.ts +2 -1
  25. package/dist/esm/hooks/onBeforeItemsDestroy.d.ts +2 -1
  26. package/dist/esm/hooks/onBeforeItemsPublish.d.ts +2 -1
  27. package/dist/esm/hooks/onBeforeItemsUnpublish.d.ts +2 -1
  28. package/dist/esm/hooks/overrideFieldExtensions.d.ts +2 -2
  29. package/dist/esm/hooks/renderItemCollectionOutlet.d.ts +6 -0
  30. package/dist/esm/hooks/renderItemCollectionOutlet.js.map +1 -1
  31. package/dist/esm/hooks/renderItemFormOutlet.d.ts +3 -3
  32. package/dist/esm/hooks/settingsAreaSidebarItemGroups.d.ts +2 -1
  33. package/dist/esm/hooks/uploadSidebarPanels.d.ts +2 -1
  34. package/dist/esm/hooks/uploadSidebars.d.ts +2 -1
  35. package/dist/esm/hooks/uploadsDropdownActions.d.ts +15 -1
  36. package/dist/esm/manifest.js +2373 -2110
  37. package/dist/esm/manifest.js.map +1 -1
  38. package/dist/esm/manifestTypes.d.ts +117 -22
  39. package/dist/types/ctx/base.d.ts +43 -29
  40. package/dist/types/hooks/assetSources.d.ts +2 -1
  41. package/dist/types/hooks/buildItemPresentationInfo.d.ts +2 -1
  42. package/dist/types/hooks/contentAreaSidebarItems.d.ts +2 -1
  43. package/dist/types/hooks/customBlockStylesForStructuredTextField.d.ts +2 -2
  44. package/dist/types/hooks/customMarksForStructuredTextField.d.ts +2 -2
  45. package/dist/types/hooks/executeFieldDropdownAction.d.ts +9 -1
  46. package/dist/types/hooks/executeItemFormDropdownAction.d.ts +9 -1
  47. package/dist/types/hooks/executeItemsDropdownAction.d.ts +11 -1
  48. package/dist/types/hooks/executeUploadsDropdownAction.d.ts +11 -1
  49. package/dist/types/hooks/fieldDropdownActions.d.ts +9 -0
  50. package/dist/types/hooks/initialLocationQueryForItemSelector.d.ts +2 -1
  51. package/dist/types/hooks/itemCollectionOutlets.d.ts +8 -1
  52. package/dist/types/hooks/itemFormDropdownActions.d.ts +9 -0
  53. package/dist/types/hooks/itemFormOutlets.d.ts +3 -2
  54. package/dist/types/hooks/itemFormSidebarPanels.d.ts +2 -1
  55. package/dist/types/hooks/itemFormSidebars.d.ts +2 -1
  56. package/dist/types/hooks/itemsDropdownActions.d.ts +12 -0
  57. package/dist/types/hooks/mainNavigationTabs.d.ts +2 -1
  58. package/dist/types/hooks/manualFieldExtensions.d.ts +2 -1
  59. package/dist/types/hooks/onBeforeItemUpsert.d.ts +2 -1
  60. package/dist/types/hooks/onBeforeItemsDestroy.d.ts +2 -1
  61. package/dist/types/hooks/onBeforeItemsPublish.d.ts +2 -1
  62. package/dist/types/hooks/onBeforeItemsUnpublish.d.ts +2 -1
  63. package/dist/types/hooks/overrideFieldExtensions.d.ts +2 -2
  64. package/dist/types/hooks/renderItemCollectionOutlet.d.ts +6 -0
  65. package/dist/types/hooks/renderItemFormOutlet.d.ts +3 -3
  66. package/dist/types/hooks/settingsAreaSidebarItemGroups.d.ts +2 -1
  67. package/dist/types/hooks/uploadSidebarPanels.d.ts +2 -1
  68. package/dist/types/hooks/uploadSidebars.d.ts +2 -1
  69. package/dist/types/hooks/uploadsDropdownActions.d.ts +15 -1
  70. package/dist/types/manifestTypes.d.ts +117 -22
  71. package/manifest.json +2283 -2020
  72. package/package.json +4 -4
  73. package/src/ctx/base.ts +62 -30
  74. package/src/hooks/assetSources.ts +3 -1
  75. package/src/hooks/buildItemPresentationInfo.ts +3 -1
  76. package/src/hooks/contentAreaSidebarItems.ts +5 -1
  77. package/src/hooks/customBlockStylesForStructuredTextField.ts +2 -2
  78. package/src/hooks/customMarksForStructuredTextField.ts +2 -2
  79. package/src/hooks/executeFieldDropdownAction.ts +7 -0
  80. package/src/hooks/executeItemFormDropdownAction.ts +7 -0
  81. package/src/hooks/executeItemsDropdownAction.ts +8 -0
  82. package/src/hooks/executeUploadsDropdownAction.ts +9 -0
  83. package/src/hooks/fieldDropdownActions.ts +9 -0
  84. package/src/hooks/initialLocationQueryForItemSelector.ts +3 -1
  85. package/src/hooks/itemCollectionOutlets.ts +9 -1
  86. package/src/hooks/itemFormDropdownActions.ts +9 -0
  87. package/src/hooks/itemFormOutlets.ts +7 -2
  88. package/src/hooks/itemFormSidebarPanels.ts +3 -1
  89. package/src/hooks/itemFormSidebars.ts +6 -1
  90. package/src/hooks/itemsDropdownActions.ts +12 -0
  91. package/src/hooks/mainNavigationTabs.ts +3 -1
  92. package/src/hooks/manualFieldExtensions.ts +5 -1
  93. package/src/hooks/onBeforeItemUpsert.ts +3 -1
  94. package/src/hooks/onBeforeItemsDestroy.ts +6 -1
  95. package/src/hooks/onBeforeItemsPublish.ts +6 -1
  96. package/src/hooks/onBeforeItemsUnpublish.ts +6 -1
  97. package/src/hooks/overrideFieldExtensions.ts +2 -2
  98. package/src/hooks/renderItemCollectionOutlet.ts +6 -0
  99. package/src/hooks/renderItemFormOutlet.ts +3 -3
  100. package/src/hooks/settingsAreaSidebarItemGroups.ts +5 -1
  101. package/src/hooks/uploadSidebarPanels.ts +3 -1
  102. package/src/hooks/uploadSidebars.ts +3 -1
  103. package/src/hooks/uploadsDropdownActions.ts +15 -1
  104. package/src/manifest.ts +2487 -2174
  105. package/src/manifestTypes.ts +125 -28
@@ -1,56 +1,153 @@
1
+ /**
2
+ * Type representing a manifest.
3
+ */
1
4
  export type Manifest = {
5
+ /**
6
+ * Hooks and their respective information.
7
+ */
2
8
  hooks: Record<string, HookInfo>;
9
+ /**
10
+ * Base properties and methods available on every context argument.
11
+ */
3
12
  baseCtx: {
4
- properties: AdditionalPropertiesOrMethods;
5
- methods: AdditionalPropertiesOrMethods;
13
+ /**
14
+ * Properties in the base context.
15
+ */
16
+ properties: AdditionalPropertiesOrMethodsGroup[];
17
+ /**
18
+ * Methods in the base context.
19
+ */
20
+ methods: AdditionalPropertiesOrMethodsGroup[];
6
21
  };
7
- selfResizingPluginFrameCtxSizingUtilities: AdditionalPropertiesOrMethods;
22
+ /**
23
+ * Extra properties and methods available on every SelfResizingPluginFrameCtx context argument
24
+ */
25
+ selfResizingPluginFrameCtxSizingUtilities: AdditionalPropertiesOrMethodsGroup;
26
+ };
27
+
28
+ /**
29
+ * Type representing hook information.
30
+ */
31
+ export type HookInfo = {
32
+ /**
33
+ * Name of the hook.
34
+ */
35
+ name: string;
36
+ /**
37
+ * JSDoc comment and tag for the hook.
38
+ */
39
+ comment?: Comment;
40
+ /**
41
+ * Non-context arguments for the hook.
42
+ */
43
+ nonCtxArguments: NonCtxArgument[];
44
+ /**
45
+ * Context argument for the hook, if any.
46
+ */
47
+ ctxArgument?: CtxArgument;
48
+ /**
49
+ * Return type of the hook function.
50
+ */
51
+ returnType: string;
52
+ /**
53
+ * Code location where the hook is defined.
54
+ */
55
+ location: CodeLocation;
56
+ };
57
+
58
+ /**
59
+ * Type representing a code location.
60
+ */
61
+ export type CodeLocation = {
62
+ /**
63
+ * File path where the code is defined.
64
+ */
65
+ filePath: string;
66
+ /**
67
+ * Line number in the file where the hook is defined.
68
+ */
69
+ lineNumber: number;
8
70
  };
9
71
 
10
72
  /**
11
73
  * Type alias for additional parameters or methods in context.
12
74
  */
13
75
  export type AdditionalPropertyOrMethod = {
14
- comment: Comment | null; // Description of the parameter or method
15
- location: {
16
- filePath: string; // File path where the parameter or method is defined
17
- lineNumber: number; // Line number in the file
18
- };
19
- type: string; // Type of the parameter or method
76
+ /**
77
+ * Description of the parameter or method.
78
+ */
79
+ comment?: Comment;
80
+ /**
81
+ * Code location where the parameter or method is defined.
82
+ */
83
+ location: CodeLocation;
84
+ /**
85
+ * Type of the parameter or method.
86
+ */
87
+ type: string;
20
88
  };
21
89
 
22
- export type AdditionalPropertiesOrMethods = Record<
23
- string,
24
- AdditionalPropertyOrMethod
25
- >;
90
+ export type AdditionalPropertiesOrMethodsGroup = {
91
+ /**
92
+ * Name of the group
93
+ */
94
+ name?: string;
95
+ /**
96
+ * Description of the group
97
+ */
98
+ comment?: Comment;
99
+ /**
100
+ * Type of the parameter or method.
101
+ */
102
+ items: Record<string, AdditionalPropertyOrMethod>;
103
+ };
26
104
 
27
105
  /**
28
106
  * Type alias for the context argument extracted from hook type.
29
107
  */
30
108
  export type CtxArgument = {
109
+ /**
110
+ * Type of the context argument.
111
+ */
31
112
  type: string;
32
- additionalProperties: AdditionalPropertiesOrMethods | null;
33
- additionalMethods: AdditionalPropertiesOrMethods | null;
113
+ /**
114
+ * Additional properties in the context argument, if any.
115
+ */
116
+ additionalProperties?: AdditionalPropertiesOrMethodsGroup[];
117
+ /**
118
+ * Additional methods in the context argument, if any.
119
+ */
120
+ additionalMethods?: AdditionalPropertiesOrMethodsGroup[];
34
121
  };
35
122
 
36
123
  /**
37
124
  * Type alias for non-context arguments.
38
125
  */
39
126
  export type NonCtxArgument = {
127
+ /**
128
+ * Name of the non-context argument.
129
+ */
40
130
  name: string;
131
+ /**
132
+ * Type name of the non-context argument.
133
+ */
41
134
  typeName: string;
42
135
  };
43
136
 
44
- export interface HookInfo {
45
- name: string;
46
- comment: Comment | null; // JSDoc comment and tag
47
- nonCtxArguments: NonCtxArgument[]; // Non-context arguments
48
- ctxArgument: CtxArgument | null; // Context argument
49
- returnType: string; // Return type of the function
50
- location: {
51
- filePath: string; // File path where the hook is defined
52
- lineNumber: number; // Line number in the file
53
- };
54
- }
55
-
56
- export type Comment = { comment: string; tag?: string; example?: string };
137
+ /**
138
+ * Type representing a comment.
139
+ */
140
+ export type Comment = {
141
+ /**
142
+ * The comment itself.
143
+ */
144
+ comment: string;
145
+ /**
146
+ * JSDoc tag for the comment, if any.
147
+ */
148
+ tag?: string;
149
+ /**
150
+ * Example or example code for the comment, if any.
151
+ */
152
+ example?: string;
153
+ };