datocms-plugin-sdk 0.3.1 → 0.3.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.
@@ -1,14 +1,17 @@
1
1
  import { Field, ModelBlock } from './SiteApiSchema';
2
2
  import { ContentAreaSidebarItem, FieldExtensionOverride, InitPropertiesAndMethods, ItemFormSidebarPanel, MainNavigationTab, ManualFieldExtension, OnBootPropertiesAndMethods, RenderConfigScreenPropertiesAndMethods, RenderFieldExtensionPropertiesAndMethods, RenderManualFieldExtensionConfigScreenPropertiesAndMethods, RenderModalPropertiesAndMethods, RenderPagePropertiesAndMethods, RenderSidebarPanePropertiesAndMethods, SettingsAreaSidebarItemGroup } from './types';
3
3
  export declare type SizingUtilities = {
4
- /** Listens for DOM changes and automatically calls `setHeight` when it detects a change */
4
+ /**
5
+ * Listens for DOM changes and automatically calls `setHeight` when it detects a change.
6
+ * If you're using `datocms-react-ui` package, the `<Canvas />` component already takes
7
+ * care of calling this method for you.
8
+ */
5
9
  startAutoResizer: () => void;
6
10
  /** Stops resizing the iframe automatically */
7
11
  stopAutoResizer: () => void;
8
12
  /**
9
- * Triggers a change in the size of the iframe. If you don't explicitely pass
10
- * a `newHeight` it will be automatically calculated using the iframe content
11
- * at the moment
13
+ * Triggers a change in the size of the iframe. If you don't explicitely pass a
14
+ * `newHeight` it will be automatically calculated using the iframe content at the moment
12
15
  */
13
16
  updateHeight: (newHeight?: number) => void;
14
17
  };
@@ -27,8 +30,8 @@ export declare type RenderConfigScreenCtx = RenderConfigScreenPropertiesAndMetho
27
30
  /** The full options you can pass to the `connect` function */
28
31
  export declare type FullConnectParameters = {
29
32
  /**
30
- * This function will be called once at boot time and can be used to perform
31
- * ie. some initial integrity checks on the configuration.
33
+ * This function will be called once at boot time and can be used to perform ie. some
34
+ * initial integrity checks on the configuration.
32
35
  *
33
36
  * @group boot
34
37
  */
@@ -52,72 +55,69 @@ export declare type FullConnectParameters = {
52
55
  */
53
56
  contentAreaSidebarItems: (ctx: IntentCtx) => ContentAreaSidebarItem[];
54
57
  /**
55
- * Use this function to declare new field extensions that users will be able
56
- * to install manually in some field
58
+ * Use this function to declare new field extensions that users will be able to install
59
+ * manually in some field
57
60
  *
58
61
  * @group manualFieldExtensions
59
62
  */
60
63
  manualFieldExtensions: (ctx: IntentCtx) => ManualFieldExtension[];
61
64
  /**
62
- * Use this function to declare new sidebar panels to be shown when the user
63
- * edits records of a particular model
65
+ * Use this function to declare new sidebar panels to be shown when the user edits
66
+ * records of a particular model
64
67
  *
65
68
  * @group sidebarPanels
66
69
  */
67
70
  itemFormSidebarPanels: (itemType: ModelBlock, ctx: IntentCtx) => ItemFormSidebarPanel[];
68
71
  /**
69
- * Use this function to automatically force one or more field extensions to a
70
- * particular field
72
+ * Use this function to automatically force one or more field extensions to a particular field
71
73
  *
72
74
  * @group forcedFieldExtensions
73
75
  */
74
76
  overrideFieldExtensions: (field: Field, ctx: FieldIntentCtx) => FieldExtensionOverride | void;
75
77
  /**
76
- * This function will be called when the plugin needs to render the plugin's
77
- * configuration form
78
+ * This function will be called when the plugin needs to render the plugin's configuration form
78
79
  *
79
80
  * @group configScreen
80
81
  */
81
82
  renderConfigScreen: (ctx: RenderConfigScreenCtx) => void;
82
83
  /**
83
- * This function will be called when the plugin needs to render a specific
84
- * page (see the `mainNavigationTabs`, `settingsAreaSidebarItemGroups` and
85
- * `contentAreaSidebarItems` functions)
84
+ * This function will be called when the plugin needs to render a specific page (see the
85
+ * `mainNavigationTabs`, `settingsAreaSidebarItemGroups` and `contentAreaSidebarItems` functions)
86
86
  *
87
87
  * @group pages
88
88
  */
89
89
  renderPage: (pageId: string, ctx: RenderPageCtx) => void;
90
90
  /**
91
- * This function will be called when the plugin requested to open a modal (see
92
- * the `openModal` function)
91
+ * This function will be called when the plugin requested to open a modal (see the
92
+ * `openModal` function)
93
93
  *
94
94
  * @group modals
95
95
  */
96
96
  renderModal: (modalId: string, ctx: RenderModalCtx) => void;
97
97
  /**
98
- * This function will be called when the plugin needs to render a sidebar
99
- * panel (see the `itemFormSidebarPanels` function)
98
+ * This function will be called when the plugin needs to render a sidebar panel (see the
99
+ * `itemFormSidebarPanels` function)
100
100
  *
101
101
  * @group sidebarPanels
102
102
  */
103
103
  renderItemFormSidebarPanel: (sidebarPaneId: string, ctx: RenderItemFormSidebarPanelCtx) => void;
104
104
  /**
105
- * This function will be called when the plugin needs to render a field
106
- * extension (see the `manualFieldExtensions` and `overrideFieldExtensions` functions)
105
+ * This function will be called when the plugin needs to render a field extension (see
106
+ * the `manualFieldExtensions` and `overrideFieldExtensions` functions)
107
107
  *
108
108
  * @group forcedFieldExtensions
109
109
  */
110
110
  renderFieldExtension: (fieldExtensionId: string, ctx: RenderFieldExtensionCtx) => void;
111
111
  /**
112
- * This function will be called when the plugin needs to render the
113
- * configuration form for installing a field extension inside a particular field
112
+ * This function will be called when the plugin needs to render the configuration form
113
+ * for installing a field extension inside a particular field
114
114
  *
115
115
  * @group manualFieldExtensions
116
116
  */
117
117
  renderManualFieldExtensionConfigScreen: (fieldExtensionId: string, ctx: RenderManualFieldExtensionConfigScreenCtx) => void;
118
118
  /**
119
- * This function will be called each time the configuration object changes. It
120
- * must return an object containing possible validation errors
119
+ * This function will be called each time the configuration object changes. It must
120
+ * return an object containing possible validation errors
121
121
  *
122
122
  * @group manualFieldExtensions
123
123
  */