datocms-plugin-sdk 0.3.24-alpha.2 → 0.3.26

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,4 +1,4 @@
1
- import { Account, Field, Item, ModelBlock, Plugin, PluginAttributes, Role, Site, SsoUser, Upload, UploadCreateSchema, User } from './SiteApiSchema';
1
+ import { Account, Field, Item, ModelBlock, Plugin, PluginAttributes, Role, Site, SsoUser, Upload, User } from './SiteApiSchema';
2
2
  export declare type Icon = string | {
3
3
  type: 'svg';
4
4
  viewBox: string;
@@ -316,7 +316,12 @@ export declare type AssetSource = {
316
316
  * Configuration options for the modal that will be opened to select a media
317
317
  * file from this source
318
318
  */
319
- modal?: Pick<Modal, 'width' | 'initialHeight'>;
319
+ modal?: {
320
+ /** Width of the modal. Can be a number, or one of the predefined sizes */
321
+ width?: 's' | 'm' | 'l' | 'xl' | number;
322
+ /** The initial height to set for the iframe that will render the modal content */
323
+ initialHeight?: number;
324
+ };
320
325
  };
321
326
  /** A toast notification to present to the user */
322
327
  export declare type Toast<CtaValue = unknown> = {
@@ -891,7 +896,7 @@ export declare type IframeMethods = {
891
896
  /** Sets the height for the iframe */
892
897
  setHeight: (number: number) => Promise<void>;
893
898
  };
894
- export declare type RenderMethods = LoadDataMethods & UpdateParametersMethods & ToastMethods & CustomDialogMethods & NavigateMethods;
899
+ export declare type RenderMethods = LoadDataMethods & UpdateParametersMethods & ToastMethods & ItemDialogMethods & UploadDialogMethods & CustomDialogMethods & NavigateMethods;
895
900
  /**
896
901
  * These information describe the current state of the form that's being shown
897
902
  * to the end-user to edit a record
@@ -1116,7 +1121,25 @@ export declare type NewUpload = {
1116
1121
  * An hash containing, for each locale of the project, the default metadata to
1117
1122
  * apply to the asset
1118
1123
  */
1119
- defaultFieldMetadata?: NonNullable<Record<string, UploadCreateSchema['data']['attributes']['default_field_metadata']>>;
1124
+ default_field_metadata?: {
1125
+ [k: string]: {
1126
+ /** Alternate text for the asset */
1127
+ alt: string | null;
1128
+ /** Title for the asset */
1129
+ title: string | null;
1130
+ /** Object with arbitrary metadata */
1131
+ custom_data: {
1132
+ [k: string]: unknown;
1133
+ };
1134
+ /** Focal point (only for image assets) */
1135
+ focal_point?: {
1136
+ /** Horizontal position expressed as float between 0 and 1 */
1137
+ x: number;
1138
+ /** Vertical position expressed as float between 0 and 1 */
1139
+ y: number;
1140
+ } | null;
1141
+ };
1142
+ };
1120
1143
  };
1121
1144
  /** Use these methods to confirm */
1122
1145
  export declare type RenderAssetSourceAdditionalMethods = {
@@ -1141,7 +1164,7 @@ export declare type RenderAssetSourceAdditionalMethods = {
1141
1164
  * });
1142
1165
  * ```
1143
1166
  */
1144
- select: (newUpload: NewUpload) => Promise<void>;
1167
+ select: (newUpload: NewUpload) => void;
1145
1168
  };
1146
1169
  export declare type RenderAssetSourceMethods = RenderMethods & IframeMethods & RenderAssetSourceAdditionalMethods;
1147
1170
  export declare type RenderAssetSourcePropertiesAndMethods = RenderAssetSourceMethods & RenderAssetSourceProperties;
@@ -1,4 +1,4 @@
1
- import { Account, Field, Item, ModelBlock, Plugin, PluginAttributes, Role, Site, SsoUser, Upload, UploadCreateSchema, User } from './SiteApiSchema';
1
+ import { Account, Field, Item, ModelBlock, Plugin, PluginAttributes, Role, Site, SsoUser, Upload, User } from './SiteApiSchema';
2
2
  export declare type Icon = string | {
3
3
  type: 'svg';
4
4
  viewBox: string;
@@ -316,7 +316,12 @@ export declare type AssetSource = {
316
316
  * Configuration options for the modal that will be opened to select a media
317
317
  * file from this source
318
318
  */
319
- modal?: Pick<Modal, 'width' | 'initialHeight'>;
319
+ modal?: {
320
+ /** Width of the modal. Can be a number, or one of the predefined sizes */
321
+ width?: 's' | 'm' | 'l' | 'xl' | number;
322
+ /** The initial height to set for the iframe that will render the modal content */
323
+ initialHeight?: number;
324
+ };
320
325
  };
321
326
  /** A toast notification to present to the user */
322
327
  export declare type Toast<CtaValue = unknown> = {
@@ -891,7 +896,7 @@ export declare type IframeMethods = {
891
896
  /** Sets the height for the iframe */
892
897
  setHeight: (number: number) => Promise<void>;
893
898
  };
894
- export declare type RenderMethods = LoadDataMethods & UpdateParametersMethods & ToastMethods & CustomDialogMethods & NavigateMethods;
899
+ export declare type RenderMethods = LoadDataMethods & UpdateParametersMethods & ToastMethods & ItemDialogMethods & UploadDialogMethods & CustomDialogMethods & NavigateMethods;
895
900
  /**
896
901
  * These information describe the current state of the form that's being shown
897
902
  * to the end-user to edit a record
@@ -1116,7 +1121,25 @@ export declare type NewUpload = {
1116
1121
  * An hash containing, for each locale of the project, the default metadata to
1117
1122
  * apply to the asset
1118
1123
  */
1119
- defaultFieldMetadata?: NonNullable<Record<string, UploadCreateSchema['data']['attributes']['default_field_metadata']>>;
1124
+ default_field_metadata?: {
1125
+ [k: string]: {
1126
+ /** Alternate text for the asset */
1127
+ alt: string | null;
1128
+ /** Title for the asset */
1129
+ title: string | null;
1130
+ /** Object with arbitrary metadata */
1131
+ custom_data: {
1132
+ [k: string]: unknown;
1133
+ };
1134
+ /** Focal point (only for image assets) */
1135
+ focal_point?: {
1136
+ /** Horizontal position expressed as float between 0 and 1 */
1137
+ x: number;
1138
+ /** Vertical position expressed as float between 0 and 1 */
1139
+ y: number;
1140
+ } | null;
1141
+ };
1142
+ };
1120
1143
  };
1121
1144
  /** Use these methods to confirm */
1122
1145
  export declare type RenderAssetSourceAdditionalMethods = {
@@ -1141,7 +1164,7 @@ export declare type RenderAssetSourceAdditionalMethods = {
1141
1164
  * });
1142
1165
  * ```
1143
1166
  */
1144
- select: (newUpload: NewUpload) => Promise<void>;
1167
+ select: (newUpload: NewUpload) => void;
1145
1168
  };
1146
1169
  export declare type RenderAssetSourceMethods = RenderMethods & IframeMethods & RenderAssetSourceAdditionalMethods;
1147
1170
  export declare type RenderAssetSourcePropertiesAndMethods = RenderAssetSourceMethods & RenderAssetSourceProperties;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datocms-plugin-sdk",
3
- "version": "0.3.24-alpha.2",
3
+ "version": "0.3.26",
4
4
  "description": "DatoCMS Plugin SDK",
5
5
  "keywords": [
6
6
  "datocms",
@@ -41,5 +41,5 @@
41
41
  "devDependencies": {
42
42
  "typedoc": "^0.22.8"
43
43
  },
44
- "gitHead": "232649147598f4118b57456aec3b4260a748b038"
44
+ "gitHead": "d69a1acf1fd4bf58604559ffc74be584b51285db"
45
45
  }