datocms-plugin-sdk 0.6.7 → 0.6.10
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.
- package/dist/cjs/SiteApiSchema.js +4 -1
- package/dist/cjs/SiteApiSchema.js.map +1 -1
- package/dist/cjs/connect.js.map +1 -1
- package/dist/cjs/guards.js.map +1 -1
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/SiteApiSchema.d.ts +650 -318
- package/dist/esm/SiteApiSchema.js +4 -1
- package/dist/esm/SiteApiSchema.js.map +1 -1
- package/dist/esm/connect.d.ts +10 -5
- package/dist/esm/connect.js.map +1 -1
- package/dist/esm/guards.js.map +1 -1
- package/dist/esm/types.d.ts +71 -22
- package/dist/types/SiteApiSchema.d.ts +650 -318
- package/dist/types/connect.d.ts +10 -5
- package/dist/types/types.d.ts +71 -22
- package/package.json +3 -3
- package/src/SiteApiSchema.ts +653 -321
- package/src/connect.ts +14 -9
- package/src/guards.ts +14 -18
- package/src/types.ts +80 -30
- package/types.json +12141 -5075
package/dist/types/connect.d.ts
CHANGED
|
@@ -41,19 +41,22 @@ export declare type FullConnectParameters = {
|
|
|
41
41
|
*/
|
|
42
42
|
onBoot: (ctx: OnBootCtx) => void;
|
|
43
43
|
/**
|
|
44
|
-
* Use this function to declare new tabs you want to add in the top-bar of the
|
|
44
|
+
* Use this function to declare new tabs you want to add in the top-bar of the
|
|
45
|
+
* UI
|
|
45
46
|
*
|
|
46
47
|
* @group pages
|
|
47
48
|
*/
|
|
48
49
|
mainNavigationTabs: (ctx: IntentCtx) => MainNavigationTab[];
|
|
49
50
|
/**
|
|
50
|
-
* Use this function to declare new navigation sections in the Settings Area
|
|
51
|
+
* Use this function to declare new navigation sections in the Settings Area
|
|
52
|
+
* sidebar
|
|
51
53
|
*
|
|
52
54
|
* @group pages
|
|
53
55
|
*/
|
|
54
56
|
settingsAreaSidebarItemGroups: (ctx: IntentCtx) => SettingsAreaSidebarItemGroup[];
|
|
55
57
|
/**
|
|
56
|
-
* Use this function to declare new navigation items in the Content Area
|
|
58
|
+
* Use this function to declare new navigation items in the Content Area
|
|
59
|
+
* sidebar
|
|
57
60
|
*
|
|
58
61
|
* @group pages
|
|
59
62
|
*/
|
|
@@ -152,14 +155,16 @@ export declare type FullConnectParameters = {
|
|
|
152
155
|
renderAssetSource: (assetSourceId: string, ctx: RenderAssetSourceCtx) => void;
|
|
153
156
|
/**
|
|
154
157
|
* This function will be called when the plugin needs to render a field
|
|
155
|
-
* extension (see the `manualFieldExtensions` and `overrideFieldExtensions`
|
|
158
|
+
* extension (see the `manualFieldExtensions` and `overrideFieldExtensions`
|
|
159
|
+
* functions)
|
|
156
160
|
*
|
|
157
161
|
* @group forcedFieldExtensions
|
|
158
162
|
*/
|
|
159
163
|
renderFieldExtension: (fieldExtensionId: string, ctx: RenderFieldExtensionCtx) => void;
|
|
160
164
|
/**
|
|
161
165
|
* This function will be called when the plugin needs to render the
|
|
162
|
-
* configuration form for installing a field extension inside a particular
|
|
166
|
+
* configuration form for installing a field extension inside a particular
|
|
167
|
+
* field
|
|
163
168
|
*
|
|
164
169
|
* @group manualFieldExtensions
|
|
165
170
|
*/
|
package/dist/types/types.d.ts
CHANGED
|
@@ -120,7 +120,8 @@ export declare type FieldType = 'boolean' | 'color' | 'date_time' | 'date' | 'fi
|
|
|
120
120
|
/**
|
|
121
121
|
* Field extensions extend the basic functionality of DatoCMS when it comes to
|
|
122
122
|
* presenting record's fields to the final user. Depending on the extension type
|
|
123
|
-
* (`editor` or `addon`) they will be shown in different places of the
|
|
123
|
+
* (`editor` or `addon`) they will be shown in different places of the
|
|
124
|
+
* interface.
|
|
124
125
|
*/
|
|
125
126
|
export declare type ManualFieldExtension = {
|
|
126
127
|
/**
|
|
@@ -158,7 +159,10 @@ export declare type ManualFieldExtension = {
|
|
|
158
159
|
configurable?: boolean | {
|
|
159
160
|
initialHeight: number;
|
|
160
161
|
};
|
|
161
|
-
/**
|
|
162
|
+
/**
|
|
163
|
+
* The initial height to set for the iframe that will render the field
|
|
164
|
+
* extension
|
|
165
|
+
*/
|
|
162
166
|
initialHeight?: number;
|
|
163
167
|
};
|
|
164
168
|
export declare type ItemFormSidebarPanelPlacement = [
|
|
@@ -176,7 +180,8 @@ export declare type ItemFormSidebarPanel = {
|
|
|
176
180
|
label: string;
|
|
177
181
|
/**
|
|
178
182
|
* An arbitrary configuration object that will be passed as the `parameters`
|
|
179
|
-
* property of the second argument of the `renderItemFormSidebarPanel`
|
|
183
|
+
* property of the second argument of the `renderItemFormSidebarPanel`
|
|
184
|
+
* function
|
|
180
185
|
*/
|
|
181
186
|
parameters?: Record<string, unknown>;
|
|
182
187
|
/** Whether the sidebar panel will start open or collapsed */
|
|
@@ -200,7 +205,10 @@ export declare type ItemFormSidebarPanel = {
|
|
|
200
205
|
};
|
|
201
206
|
/** An outlet to be shown at the top of a record's editing page */
|
|
202
207
|
export declare type ItemFormOutlet = {
|
|
203
|
-
/**
|
|
208
|
+
/**
|
|
209
|
+
* ID of the outlet. Will be the first argument for the `renderItemFormOutlet`
|
|
210
|
+
* function
|
|
211
|
+
*/
|
|
204
212
|
id: string;
|
|
205
213
|
/**
|
|
206
214
|
* Multiple outlets will be sorted by ascending `rank`. If you want to specify
|
|
@@ -219,7 +227,10 @@ export declare type EditorOverride = {
|
|
|
219
227
|
* `renderFieldExtension` function
|
|
220
228
|
*/
|
|
221
229
|
id: string;
|
|
222
|
-
/**
|
|
230
|
+
/**
|
|
231
|
+
* Moves the field to the sidebar of the record editing page, mimicking a
|
|
232
|
+
* sidebar panel
|
|
233
|
+
*/
|
|
223
234
|
asSidebarPanel?: boolean | {
|
|
224
235
|
startOpen?: boolean;
|
|
225
236
|
placement?: ItemFormSidebarPanelPlacement;
|
|
@@ -237,7 +248,10 @@ export declare type EditorOverride = {
|
|
|
237
248
|
* another plugin!
|
|
238
249
|
*/
|
|
239
250
|
rank?: number;
|
|
240
|
-
/**
|
|
251
|
+
/**
|
|
252
|
+
* The initial height to set for the iframe that will render the field
|
|
253
|
+
* extension
|
|
254
|
+
*/
|
|
241
255
|
initialHeight?: number;
|
|
242
256
|
};
|
|
243
257
|
/** A field addon extension forced on a field */
|
|
@@ -260,7 +274,10 @@ export declare type AddonOverride = {
|
|
|
260
274
|
* the one of another plugin!
|
|
261
275
|
*/
|
|
262
276
|
rank?: number;
|
|
263
|
-
/**
|
|
277
|
+
/**
|
|
278
|
+
* The initial height to set for the iframe that will render the field
|
|
279
|
+
* extension
|
|
280
|
+
*/
|
|
264
281
|
initialHeight?: number;
|
|
265
282
|
};
|
|
266
283
|
export declare type StructuredTextCustomMarkPlacement = [
|
|
@@ -320,7 +337,10 @@ export declare type StructuredTextCustomBlockStyle = {
|
|
|
320
337
|
*/
|
|
321
338
|
rank?: number;
|
|
322
339
|
};
|
|
323
|
-
/**
|
|
340
|
+
/**
|
|
341
|
+
* An object expressing some field extensions you want to force on a particular
|
|
342
|
+
* field
|
|
343
|
+
*/
|
|
324
344
|
export declare type FieldExtensionOverride = {
|
|
325
345
|
/** Force a field editor/sidebar extension on a field */
|
|
326
346
|
editor?: EditorOverride;
|
|
@@ -396,7 +416,10 @@ export declare type AssetSource = {
|
|
|
396
416
|
modal?: {
|
|
397
417
|
/** Width of the modal. Can be a number, or one of the predefined sizes */
|
|
398
418
|
width?: 's' | 'm' | 'l' | 'xl' | number;
|
|
399
|
-
/**
|
|
419
|
+
/**
|
|
420
|
+
* The initial height to set for the iframe that will render the modal
|
|
421
|
+
* content
|
|
422
|
+
*/
|
|
400
423
|
initialHeight?: number;
|
|
401
424
|
};
|
|
402
425
|
};
|
|
@@ -433,7 +456,10 @@ export declare type ConfirmChoice = {
|
|
|
433
456
|
* clicked by the user
|
|
434
457
|
*/
|
|
435
458
|
value: unknown;
|
|
436
|
-
/**
|
|
459
|
+
/**
|
|
460
|
+
* The intent of the button. Will present the button in a different color
|
|
461
|
+
* accent.
|
|
462
|
+
*/
|
|
437
463
|
intent?: 'positive' | 'negative';
|
|
438
464
|
};
|
|
439
465
|
/** Options for the `openConfirm` function */
|
|
@@ -707,7 +733,10 @@ export declare type LoadDataMethods = {
|
|
|
707
733
|
*/
|
|
708
734
|
loadSsoUsers: () => Promise<SsoUser[]>;
|
|
709
735
|
};
|
|
710
|
-
/**
|
|
736
|
+
/**
|
|
737
|
+
* These methods let you open the standard DatoCMS dialogs needed to interact
|
|
738
|
+
* with records
|
|
739
|
+
*/
|
|
711
740
|
export declare type ItemDialogMethods = {
|
|
712
741
|
/**
|
|
713
742
|
* Opens a dialog for creating a new record. It returns a promise resolved
|
|
@@ -778,7 +807,10 @@ export declare type ItemDialogMethods = {
|
|
|
778
807
|
*/
|
|
779
808
|
editItem: (itemId: string) => Promise<Item | null>;
|
|
780
809
|
};
|
|
781
|
-
/**
|
|
810
|
+
/**
|
|
811
|
+
* These methods can be used to show UI-consistent toast notifications to the
|
|
812
|
+
* end-user
|
|
813
|
+
*/
|
|
782
814
|
export declare type ToastMethods = {
|
|
783
815
|
/**
|
|
784
816
|
* Triggers an "error" toast displaying the selected message
|
|
@@ -811,7 +843,8 @@ export declare type ToastMethods = {
|
|
|
811
843
|
*/
|
|
812
844
|
notice: (message: string) => Promise<void>;
|
|
813
845
|
/**
|
|
814
|
-
* Triggers a custom toast displaying the selected message (and optionally a
|
|
846
|
+
* Triggers a custom toast displaying the selected message (and optionally a
|
|
847
|
+
* CTA)
|
|
815
848
|
*
|
|
816
849
|
* @example
|
|
817
850
|
*
|
|
@@ -865,7 +898,8 @@ export declare type UploadDialogMethods = {
|
|
|
865
898
|
}): Promise<Upload | null>;
|
|
866
899
|
};
|
|
867
900
|
/**
|
|
868
|
-
* Opens a dialog for editing a Media Area asset. It returns a promise
|
|
901
|
+
* Opens a dialog for editing a Media Area asset. It returns a promise
|
|
902
|
+
* resolved with:
|
|
869
903
|
*
|
|
870
904
|
* - The updated asset, if the user persists some changes to the asset itself
|
|
871
905
|
* - `null`, if the user closes the dialog without persisting any change
|
|
@@ -1008,7 +1042,10 @@ export declare type RenderMethods = LoadDataMethods & UpdateParametersMethods &
|
|
|
1008
1042
|
export declare type ItemFormAdditionalProperties = {
|
|
1009
1043
|
/** The currently active locale for the record */
|
|
1010
1044
|
locale: string;
|
|
1011
|
-
/**
|
|
1045
|
+
/**
|
|
1046
|
+
* If an already persisted record is being edited, returns the full record
|
|
1047
|
+
* entity
|
|
1048
|
+
*/
|
|
1012
1049
|
item: Item | null;
|
|
1013
1050
|
/** The model for the record being edited */
|
|
1014
1051
|
itemType: ItemType;
|
|
@@ -1072,7 +1109,8 @@ export declare type ItemFormAdditionalMethods = {
|
|
|
1072
1109
|
disableField: (path: string, disable: boolean) => Promise<void>;
|
|
1073
1110
|
/**
|
|
1074
1111
|
* Smoothly navigates to a specific field in the form. If the field is
|
|
1075
|
-
* localized it will switch language tab and then navigate to the chosen
|
|
1112
|
+
* localized it will switch language tab and then navigate to the chosen
|
|
1113
|
+
* field.
|
|
1076
1114
|
*
|
|
1077
1115
|
* @example
|
|
1078
1116
|
*
|
|
@@ -1156,7 +1194,10 @@ export declare type RenderFieldExtensionAdditionalProperties = {
|
|
|
1156
1194
|
placeholder: string;
|
|
1157
1195
|
/** Whether the field is currently disabled or not */
|
|
1158
1196
|
disabled: boolean;
|
|
1159
|
-
/**
|
|
1197
|
+
/**
|
|
1198
|
+
* The path in the `formValues` object where to find the current value for the
|
|
1199
|
+
* field
|
|
1200
|
+
*/
|
|
1160
1201
|
fieldPath: string;
|
|
1161
1202
|
/** The field where the field extension is installed to */
|
|
1162
1203
|
field: Field;
|
|
@@ -1186,7 +1227,10 @@ export declare type RenderModalAdditionalProperties = {
|
|
|
1186
1227
|
mode: 'renderModal';
|
|
1187
1228
|
/** The ID of the modal that needs to be rendered */
|
|
1188
1229
|
modalId: string;
|
|
1189
|
-
/**
|
|
1230
|
+
/**
|
|
1231
|
+
* The arbitrary `parameters` of the modal declared in the `openModal`
|
|
1232
|
+
* function
|
|
1233
|
+
*/
|
|
1190
1234
|
parameters: Record<string, unknown>;
|
|
1191
1235
|
};
|
|
1192
1236
|
export declare type RenderModalProperties = RenderProperties & RenderModalAdditionalProperties;
|
|
@@ -1212,7 +1256,10 @@ export declare type RenderModalAdditionalMethods = {
|
|
|
1212
1256
|
};
|
|
1213
1257
|
export declare type RenderModalMethods = RenderMethods & IframeMethods & RenderModalAdditionalMethods;
|
|
1214
1258
|
export declare type RenderModalPropertiesAndMethods = RenderModalMethods & RenderModalProperties;
|
|
1215
|
-
/**
|
|
1259
|
+
/**
|
|
1260
|
+
* Information regarding the specific asset source browser that you need to
|
|
1261
|
+
* render
|
|
1262
|
+
*/
|
|
1216
1263
|
export declare type RenderAssetSourceAdditionalProperties = {
|
|
1217
1264
|
mode: 'renderAssetSource';
|
|
1218
1265
|
/** The ID of the assetSource that needs to be rendered */
|
|
@@ -1291,8 +1338,7 @@ export declare type RenderAssetSourceAdditionalMethods = {
|
|
|
1291
1338
|
* ```js
|
|
1292
1339
|
* await ctx.select({
|
|
1293
1340
|
* resource: {
|
|
1294
|
-
* url:
|
|
1295
|
-
* 'https://images.unsplash.com/photo-1416339306562-f3d12fefd36f',
|
|
1341
|
+
* url: 'https://images.unsplash.com/photo-1416339306562-f3d12fefd36f',
|
|
1296
1342
|
* filename: 'man-drinking-coffee.jpg',
|
|
1297
1343
|
* },
|
|
1298
1344
|
* copyright: 'Royalty free (Unsplash)',
|
|
@@ -1338,7 +1384,10 @@ export declare type PendingField = {
|
|
|
1338
1384
|
*/
|
|
1339
1385
|
export declare type RenderManualFieldExtensionConfigScreenAdditionalProperties = {
|
|
1340
1386
|
mode: 'renderManualFieldExtensionConfigScreen';
|
|
1341
|
-
/**
|
|
1387
|
+
/**
|
|
1388
|
+
* The ID of the field extension for which we need to render the parameters
|
|
1389
|
+
* form
|
|
1390
|
+
*/
|
|
1342
1391
|
fieldExtensionId: string;
|
|
1343
1392
|
/**
|
|
1344
1393
|
* The current value of the parameters (you can change the value with the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "datocms-plugin-sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.10",
|
|
4
4
|
"description": "DatoCMS Plugin SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datocms",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"penpal": "^4.1.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"typedoc": "^0.
|
|
44
|
+
"typedoc": "^0.23.20"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "ee402f7da5c79a0675995519c792000bb220bc7a"
|
|
47
47
|
}
|