datocms-plugin-sdk 2.0.2 → 2.0.4

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 (36) hide show
  1. package/dist/cjs/hooks/renderItemCollectionOutlet.js.map +1 -1
  2. package/dist/cjs/manifest.js +266 -255
  3. package/dist/cjs/manifest.js.map +1 -1
  4. package/dist/esm/ctx/base.d.ts +1 -1
  5. package/dist/esm/hooks/renderItemCollectionOutlet.d.ts +6 -1
  6. package/dist/esm/hooks/renderItemCollectionOutlet.js.map +1 -1
  7. package/dist/esm/hooks/renderItemFormSidebar.d.ts +1 -1
  8. package/dist/esm/hooks/renderItemFormSidebarPanel.d.ts +1 -1
  9. package/dist/esm/hooks/renderManualFieldExtensionConfigScreen.d.ts +2 -2
  10. package/dist/esm/hooks/renderModal.d.ts +1 -1
  11. package/dist/esm/hooks/renderUploadSidebar.d.ts +1 -1
  12. package/dist/esm/hooks/renderUploadSidebarPanel.d.ts +1 -1
  13. package/dist/esm/manifest.js +266 -255
  14. package/dist/esm/manifest.js.map +1 -1
  15. package/dist/esm/manifestTypes.d.ts +39 -91
  16. package/dist/types/ctx/base.d.ts +1 -1
  17. package/dist/types/hooks/renderItemCollectionOutlet.d.ts +6 -1
  18. package/dist/types/hooks/renderItemFormSidebar.d.ts +1 -1
  19. package/dist/types/hooks/renderItemFormSidebarPanel.d.ts +1 -1
  20. package/dist/types/hooks/renderManualFieldExtensionConfigScreen.d.ts +2 -2
  21. package/dist/types/hooks/renderModal.d.ts +1 -1
  22. package/dist/types/hooks/renderUploadSidebar.d.ts +1 -1
  23. package/dist/types/hooks/renderUploadSidebarPanel.d.ts +1 -1
  24. package/dist/types/manifestTypes.d.ts +39 -91
  25. package/manifest.json +266 -255
  26. package/package.json +2 -2
  27. package/src/ctx/base.ts +1 -1
  28. package/src/hooks/renderItemCollectionOutlet.ts +6 -1
  29. package/src/hooks/renderItemFormSidebar.ts +1 -1
  30. package/src/hooks/renderItemFormSidebarPanel.ts +1 -1
  31. package/src/hooks/renderManualFieldExtensionConfigScreen.ts +2 -2
  32. package/src/hooks/renderModal.ts +1 -1
  33. package/src/hooks/renderUploadSidebar.ts +1 -1
  34. package/src/hooks/renderUploadSidebarPanel.ts +1 -1
  35. package/src/manifest.ts +422 -377
  36. package/src/manifestTypes.ts +39 -91
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datocms-plugin-sdk",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "DatoCMS Plugin SDK",
5
5
  "keywords": [
6
6
  "datocms",
@@ -45,5 +45,5 @@
45
45
  "glob": "^11.0.0",
46
46
  "typescript": "^5.6.2"
47
47
  },
48
- "gitHead": "ba6263cc54345109ef3a4d4e60726e49888a70b2"
48
+ "gitHead": "c08f8ec853327a4d0910217284d9406febd42b3e"
49
49
  }
package/src/ctx/base.ts CHANGED
@@ -60,7 +60,7 @@ type ProjectProperties = {
60
60
  /** The ID of the current environment */
61
61
  environment: string;
62
62
 
63
- /** The account that is the project owner */
63
+ /** The account/organization that is the project owner */
64
64
  owner: Account | Organization;
65
65
 
66
66
  /**
@@ -1,10 +1,13 @@
1
+ import type { SchemaTypes } from '@datocms/cma-client';
1
2
  import { SelfResizingPluginFrameCtx } from '../ctx/pluginFrame';
2
3
  import { containedRenderModeBootstrapper } from '../utils';
3
4
 
5
+ type ItemType = SchemaTypes.ItemType;
6
+
4
7
  export type RenderItemCollectionOutletHook = {
5
8
  /**
6
9
  * This function will be called when the plugin needs to render an outlet
7
- * defined by the `itemFormOutlets()` hook.
10
+ * defined by the `itemCollectionOutlets()` hook.
8
11
  *
9
12
  * @tag outlets
10
13
  */
@@ -19,6 +22,8 @@ export type RenderItemCollectionOutletCtx = SelfResizingPluginFrameCtx<
19
22
  {
20
23
  /** The ID of the outlet that needs to be rendered */
21
24
  itemCollectionOutletId: string;
25
+ /** The model for which the outlet is being rendered */
26
+ itemType: ItemType;
22
27
  }
23
28
  >;
24
29
 
@@ -8,7 +8,7 @@ import { fullScreenRenderModeBootstrapper } from '../utils';
8
8
  export type RenderItemFormSidebarHook = {
9
9
  /**
10
10
  * This function will be called when the plugin needs to render a sidebar (see
11
- * the `itemFormSidebars` function)
11
+ * the `itemFormSidebars` hook)
12
12
  *
13
13
  * @tag sidebarPanels
14
14
  */
@@ -8,7 +8,7 @@ import { containedRenderModeBootstrapper } from '../utils';
8
8
  export type RenderItemFormSidebarPanelHook = {
9
9
  /**
10
10
  * This function will be called when the plugin needs to render a sidebar panel
11
- * (see the `itemFormSidebarPanels` function)
11
+ * (see the `itemFormSidebarPanels` hook)
12
12
  *
13
13
  * @tag sidebarPanels
14
14
  */
@@ -23,12 +23,12 @@ export type RenderManualFieldExtensionConfigScreenCtx =
23
23
  fieldExtensionId: string;
24
24
  /**
25
25
  * The current value of the parameters (you can change the value with the
26
- * `setParameters` function)
26
+ * `setParameters` hook)
27
27
  */
28
28
  parameters: Record<string, unknown>;
29
29
  /**
30
30
  * The current validation errors for the parameters (you can set them
31
- * implementing the `validateManualFieldExtensionParameters` function)
31
+ * implementing the `validateManualFieldExtensionParameters` hook)
32
32
  */
33
33
  errors: Record<string, unknown>;
34
34
 
@@ -4,7 +4,7 @@ import { containedRenderModeBootstrapper } from '../utils';
4
4
  export type RenderModalHook = {
5
5
  /**
6
6
  * This function will be called when the plugin requested to open a modal (see
7
- * the `openModal` function)
7
+ * the `openModal` hook)
8
8
  *
9
9
  * @tag modals
10
10
  */
@@ -7,7 +7,7 @@ type Upload = SchemaTypes.Upload;
7
7
  export type RenderUploadSidebarHook = {
8
8
  /**
9
9
  * This function will be called when the plugin needs to render a sidebar (see
10
- * the `uploadSidebars` function)
10
+ * the `uploadSidebars` hook)
11
11
  *
12
12
  * @tag sidebarPanels
13
13
  */
@@ -7,7 +7,7 @@ type Upload = SchemaTypes.Upload;
7
7
  export type RenderUploadSidebarPanelHook = {
8
8
  /**
9
9
  * This function will be called when the plugin needs to render a sidebar panel
10
- * (see the `uploadSidebarPanels` function)
10
+ * (see the `uploadSidebarPanels` hook)
11
11
  *
12
12
  * @tag sidebarPanels
13
13
  */