datocms-plugin-sdk 2.0.1 → 2.0.3
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/manifest.js +376 -303
- package/dist/cjs/manifest.js.map +1 -1
- package/dist/esm/ctx/base.d.ts +1 -1
- package/dist/esm/ctx/commonExtras/field.d.ts +4 -0
- package/dist/esm/ctx/commonExtras/itemForm.d.ts +14 -12
- package/dist/esm/ctx/commonExtras/sizing.d.ts +1 -0
- package/dist/esm/hooks/renderItemFormSidebar.d.ts +1 -1
- package/dist/esm/hooks/renderItemFormSidebarPanel.d.ts +1 -1
- package/dist/esm/hooks/renderManualFieldExtensionConfigScreen.d.ts +2 -2
- package/dist/esm/hooks/renderModal.d.ts +1 -1
- package/dist/esm/hooks/renderUploadSidebar.d.ts +1 -1
- package/dist/esm/hooks/renderUploadSidebarPanel.d.ts +1 -1
- package/dist/esm/manifest.js +376 -303
- package/dist/esm/manifest.js.map +1 -1
- package/dist/esm/manifestTypes.d.ts +39 -91
- package/dist/types/ctx/base.d.ts +1 -1
- package/dist/types/ctx/commonExtras/field.d.ts +4 -0
- package/dist/types/ctx/commonExtras/itemForm.d.ts +14 -12
- package/dist/types/ctx/commonExtras/sizing.d.ts +1 -0
- package/dist/types/hooks/renderItemFormSidebar.d.ts +1 -1
- package/dist/types/hooks/renderItemFormSidebarPanel.d.ts +1 -1
- package/dist/types/hooks/renderManualFieldExtensionConfigScreen.d.ts +2 -2
- package/dist/types/hooks/renderModal.d.ts +1 -1
- package/dist/types/hooks/renderUploadSidebar.d.ts +1 -1
- package/dist/types/hooks/renderUploadSidebarPanel.d.ts +1 -1
- package/dist/types/manifestTypes.d.ts +39 -91
- package/manifest.json +376 -303
- package/package.json +2 -2
- package/src/ctx/base.ts +1 -1
- package/src/ctx/commonExtras/field.ts +4 -0
- package/src/ctx/commonExtras/itemForm.ts +15 -12
- package/src/ctx/commonExtras/sizing.ts +1 -0
- package/src/hooks/renderItemFormSidebar.ts +1 -1
- package/src/hooks/renderItemFormSidebarPanel.ts +1 -1
- package/src/hooks/renderManualFieldExtensionConfigScreen.ts +2 -2
- package/src/hooks/renderModal.ts +1 -1
- package/src/hooks/renderUploadSidebar.ts +1 -1
- package/src/hooks/renderUploadSidebarPanel.ts +1 -1
- package/src/manifest.ts +533 -401
- package/src/manifestTypes.ts +39 -91
package/src/manifest.ts
CHANGED
|
@@ -5,8 +5,8 @@ export const manifest: Manifest = {
|
|
|
5
5
|
validateManualFieldExtensionParameters: {
|
|
6
6
|
name: 'validateManualFieldExtensionParameters',
|
|
7
7
|
comment: {
|
|
8
|
-
|
|
9
|
-
'This function will be called each time the configuration object changes. It\nmust return an object containing possible validation errors',
|
|
8
|
+
markdownText:
|
|
9
|
+
'This function will be called each time the configuration object changes. It\nmust return an object containing possible validation errors.',
|
|
10
10
|
tag: 'manualFieldExtensions',
|
|
11
11
|
},
|
|
12
12
|
nonCtxArguments: [
|
|
@@ -28,7 +28,7 @@ export const manifest: Manifest = {
|
|
|
28
28
|
uploadsDropdownActions: {
|
|
29
29
|
name: 'uploadsDropdownActions',
|
|
30
30
|
comment: {
|
|
31
|
-
|
|
31
|
+
markdownText:
|
|
32
32
|
'This function lets you set up custom actions (or groups of actions) that\nshow up when the user:\n\n* selects multiple assets in the Media Area for batch operations, or\n* opens up a specific asset from the Media Area.\n\nThe `executeUploadsDropdownAction()` hook will be triggered once the user\nclicks on one of the defined actions.',
|
|
33
33
|
tag: 'dropdownActions',
|
|
34
34
|
},
|
|
@@ -47,8 +47,8 @@ export const manifest: Manifest = {
|
|
|
47
47
|
uploadSidebars: {
|
|
48
48
|
name: 'uploadSidebars',
|
|
49
49
|
comment: {
|
|
50
|
-
|
|
51
|
-
'Use this function to declare new sidebar to be shown when the user opens\nup an asset in the Media Area',
|
|
50
|
+
markdownText:
|
|
51
|
+
'Use this function to declare new sidebar to be shown when the user opens\nup an asset in the Media Area.',
|
|
52
52
|
tag: 'sidebarPanels',
|
|
53
53
|
},
|
|
54
54
|
nonCtxArguments: [],
|
|
@@ -66,8 +66,8 @@ export const manifest: Manifest = {
|
|
|
66
66
|
uploadSidebarPanels: {
|
|
67
67
|
name: 'uploadSidebarPanels',
|
|
68
68
|
comment: {
|
|
69
|
-
|
|
70
|
-
'Use this function to declare new sidebar panels to be shown when the user\nopens up an asset in the Media Area',
|
|
69
|
+
markdownText:
|
|
70
|
+
'Use this function to declare new sidebar panels to be shown when the user\nopens up an asset in the Media Area.',
|
|
71
71
|
tag: 'sidebarPanels',
|
|
72
72
|
},
|
|
73
73
|
nonCtxArguments: [],
|
|
@@ -85,8 +85,8 @@ export const manifest: Manifest = {
|
|
|
85
85
|
settingsAreaSidebarItemGroups: {
|
|
86
86
|
name: 'settingsAreaSidebarItemGroups',
|
|
87
87
|
comment: {
|
|
88
|
-
|
|
89
|
-
'Use this function to declare new navigation sections in the Settings Area\nsidebar',
|
|
88
|
+
markdownText:
|
|
89
|
+
'Use this function to declare new navigation sections in the Settings Area\nsidebar.',
|
|
90
90
|
tag: 'pages',
|
|
91
91
|
},
|
|
92
92
|
nonCtxArguments: [],
|
|
@@ -104,8 +104,8 @@ export const manifest: Manifest = {
|
|
|
104
104
|
renderUploadSidebarPanel: {
|
|
105
105
|
name: 'renderUploadSidebarPanel',
|
|
106
106
|
comment: {
|
|
107
|
-
|
|
108
|
-
'This function will be called when the plugin needs to render a sidebar panel\n(see the `uploadSidebarPanels`
|
|
107
|
+
markdownText:
|
|
108
|
+
'This function will be called when the plugin needs to render a sidebar panel\n(see the `uploadSidebarPanels` hook).',
|
|
109
109
|
tag: 'sidebarPanels',
|
|
110
110
|
},
|
|
111
111
|
nonCtxArguments: [
|
|
@@ -121,8 +121,8 @@ export const manifest: Manifest = {
|
|
|
121
121
|
items: {
|
|
122
122
|
sidebarPaneId: {
|
|
123
123
|
comment: {
|
|
124
|
-
|
|
125
|
-
'The ID of the sidebar panel that needs to be rendered',
|
|
124
|
+
markdownText:
|
|
125
|
+
'The ID of the sidebar panel that needs to be rendered.',
|
|
126
126
|
},
|
|
127
127
|
location: {
|
|
128
128
|
filePath: 'src/hooks/renderUploadSidebarPanel.ts',
|
|
@@ -132,8 +132,8 @@ export const manifest: Manifest = {
|
|
|
132
132
|
},
|
|
133
133
|
parameters: {
|
|
134
134
|
comment: {
|
|
135
|
-
|
|
136
|
-
'The arbitrary `parameters` of the panel declared in the\n`uploadSidebarPanels` function',
|
|
135
|
+
markdownText:
|
|
136
|
+
'The arbitrary `parameters` of the panel declared in the\n`uploadSidebarPanels` function.',
|
|
137
137
|
},
|
|
138
138
|
location: {
|
|
139
139
|
filePath: 'src/hooks/renderUploadSidebarPanel.ts',
|
|
@@ -143,7 +143,7 @@ export const manifest: Manifest = {
|
|
|
143
143
|
},
|
|
144
144
|
upload: {
|
|
145
145
|
comment: {
|
|
146
|
-
|
|
146
|
+
markdownText: 'The active asset.',
|
|
147
147
|
},
|
|
148
148
|
location: {
|
|
149
149
|
filePath: 'src/hooks/renderUploadSidebarPanel.ts',
|
|
@@ -165,8 +165,8 @@ export const manifest: Manifest = {
|
|
|
165
165
|
renderUploadSidebar: {
|
|
166
166
|
name: 'renderUploadSidebar',
|
|
167
167
|
comment: {
|
|
168
|
-
|
|
169
|
-
'This function will be called when the plugin needs to render a sidebar (see\nthe `uploadSidebars`
|
|
168
|
+
markdownText:
|
|
169
|
+
'This function will be called when the plugin needs to render a sidebar (see\nthe `uploadSidebars` hook).',
|
|
170
170
|
tag: 'sidebarPanels',
|
|
171
171
|
},
|
|
172
172
|
nonCtxArguments: [
|
|
@@ -182,7 +182,8 @@ export const manifest: Manifest = {
|
|
|
182
182
|
items: {
|
|
183
183
|
sidebarId: {
|
|
184
184
|
comment: {
|
|
185
|
-
|
|
185
|
+
markdownText:
|
|
186
|
+
'The ID of the sidebar that needs to be rendered.',
|
|
186
187
|
},
|
|
187
188
|
location: {
|
|
188
189
|
filePath: 'src/hooks/renderUploadSidebar.ts',
|
|
@@ -192,8 +193,8 @@ export const manifest: Manifest = {
|
|
|
192
193
|
},
|
|
193
194
|
parameters: {
|
|
194
195
|
comment: {
|
|
195
|
-
|
|
196
|
-
'The arbitrary `parameters` of the declared in the `uploadSidebars`\nfunction',
|
|
196
|
+
markdownText:
|
|
197
|
+
'The arbitrary `parameters` of the declared in the `uploadSidebars`\nfunction.',
|
|
197
198
|
},
|
|
198
199
|
location: {
|
|
199
200
|
filePath: 'src/hooks/renderUploadSidebar.ts',
|
|
@@ -203,7 +204,7 @@ export const manifest: Manifest = {
|
|
|
203
204
|
},
|
|
204
205
|
upload: {
|
|
205
206
|
comment: {
|
|
206
|
-
|
|
207
|
+
markdownText: 'The active asset.',
|
|
207
208
|
},
|
|
208
209
|
location: {
|
|
209
210
|
filePath: 'src/hooks/renderUploadSidebar.ts',
|
|
@@ -225,8 +226,8 @@ export const manifest: Manifest = {
|
|
|
225
226
|
renderPage: {
|
|
226
227
|
name: 'renderPage',
|
|
227
228
|
comment: {
|
|
228
|
-
|
|
229
|
-
'This function will be called when the plugin needs to render a specific\npage (see the `mainNavigationTabs`, `settingsAreaSidebarItemGroups` and\n`contentAreaSidebarItems` functions)',
|
|
229
|
+
markdownText:
|
|
230
|
+
'This function will be called when the plugin needs to render a specific\npage (see the `mainNavigationTabs`, `settingsAreaSidebarItemGroups` and\n`contentAreaSidebarItems` functions).',
|
|
230
231
|
tag: 'pages',
|
|
231
232
|
},
|
|
232
233
|
nonCtxArguments: [
|
|
@@ -242,7 +243,7 @@ export const manifest: Manifest = {
|
|
|
242
243
|
items: {
|
|
243
244
|
pageId: {
|
|
244
245
|
comment: {
|
|
245
|
-
|
|
246
|
+
markdownText: 'The ID of the page that needs to be rendered.',
|
|
246
247
|
},
|
|
247
248
|
location: {
|
|
248
249
|
filePath: 'src/hooks/renderPage.ts',
|
|
@@ -264,8 +265,8 @@ export const manifest: Manifest = {
|
|
|
264
265
|
renderModal: {
|
|
265
266
|
name: 'renderModal',
|
|
266
267
|
comment: {
|
|
267
|
-
|
|
268
|
-
'This function will be called when the plugin requested to open a modal (see\nthe `openModal`
|
|
268
|
+
markdownText:
|
|
269
|
+
'This function will be called when the plugin requested to open a modal (see\nthe `openModal` hook).',
|
|
269
270
|
tag: 'modals',
|
|
270
271
|
},
|
|
271
272
|
nonCtxArguments: [
|
|
@@ -281,7 +282,8 @@ export const manifest: Manifest = {
|
|
|
281
282
|
items: {
|
|
282
283
|
modalId: {
|
|
283
284
|
comment: {
|
|
284
|
-
|
|
285
|
+
markdownText:
|
|
286
|
+
'The ID of the modal that needs to be rendered.',
|
|
285
287
|
},
|
|
286
288
|
location: {
|
|
287
289
|
filePath: 'src/hooks/renderModal.ts',
|
|
@@ -291,8 +293,8 @@ export const manifest: Manifest = {
|
|
|
291
293
|
},
|
|
292
294
|
parameters: {
|
|
293
295
|
comment: {
|
|
294
|
-
|
|
295
|
-
'The arbitrary `parameters` of the modal declared in the `openModal`\nfunction',
|
|
296
|
+
markdownText:
|
|
297
|
+
'The arbitrary `parameters` of the modal declared in the `openModal`\nfunction.',
|
|
296
298
|
},
|
|
297
299
|
location: {
|
|
298
300
|
filePath: 'src/hooks/renderModal.ts',
|
|
@@ -308,8 +310,8 @@ export const manifest: Manifest = {
|
|
|
308
310
|
items: {
|
|
309
311
|
resolve: {
|
|
310
312
|
comment: {
|
|
311
|
-
|
|
312
|
-
'A function to be called by the plugin to close the modal. The `openModal`\ncall will be resolved with the passed return value',
|
|
313
|
+
markdownText:
|
|
314
|
+
'A function to be called by the plugin to close the modal. The `openModal`\ncall will be resolved with the passed return value.',
|
|
313
315
|
example:
|
|
314
316
|
"const returnValue = prompt(\n 'Please specify the value to return to the caller:',\n 'success',\n);\n\nawait ctx.resolve(returnValue);",
|
|
315
317
|
},
|
|
@@ -344,8 +346,8 @@ export const manifest: Manifest = {
|
|
|
344
346
|
items: {
|
|
345
347
|
fieldExtensionId: {
|
|
346
348
|
comment: {
|
|
347
|
-
|
|
348
|
-
'The ID of the field extension for which we need to render the parameters\nform',
|
|
349
|
+
markdownText:
|
|
350
|
+
'The ID of the field extension for which we need to render the parameters\nform.',
|
|
349
351
|
},
|
|
350
352
|
location: {
|
|
351
353
|
filePath:
|
|
@@ -356,8 +358,8 @@ export const manifest: Manifest = {
|
|
|
356
358
|
},
|
|
357
359
|
parameters: {
|
|
358
360
|
comment: {
|
|
359
|
-
|
|
360
|
-
'The current value of the parameters (you can change the value with the\n`setParameters`
|
|
361
|
+
markdownText:
|
|
362
|
+
'The current value of the parameters (you can change the value with the\n`setParameters` hook).',
|
|
361
363
|
},
|
|
362
364
|
location: {
|
|
363
365
|
filePath:
|
|
@@ -368,8 +370,8 @@ export const manifest: Manifest = {
|
|
|
368
370
|
},
|
|
369
371
|
errors: {
|
|
370
372
|
comment: {
|
|
371
|
-
|
|
372
|
-
'The current validation errors for the parameters (you can set them\nimplementing the `validateManualFieldExtensionParameters`
|
|
373
|
+
markdownText:
|
|
374
|
+
'The current validation errors for the parameters (you can set them\nimplementing the `validateManualFieldExtensionParameters` hook).',
|
|
373
375
|
},
|
|
374
376
|
location: {
|
|
375
377
|
filePath:
|
|
@@ -380,7 +382,8 @@ export const manifest: Manifest = {
|
|
|
380
382
|
},
|
|
381
383
|
pendingField: {
|
|
382
384
|
comment: {
|
|
383
|
-
|
|
385
|
+
markdownText:
|
|
386
|
+
'The field entity that is being edited in the form.',
|
|
384
387
|
},
|
|
385
388
|
location: {
|
|
386
389
|
filePath:
|
|
@@ -391,7 +394,7 @@ export const manifest: Manifest = {
|
|
|
391
394
|
},
|
|
392
395
|
itemType: {
|
|
393
396
|
comment: {
|
|
394
|
-
|
|
397
|
+
markdownText: 'The model for the field being edited.',
|
|
395
398
|
},
|
|
396
399
|
location: {
|
|
397
400
|
filePath:
|
|
@@ -408,7 +411,7 @@ export const manifest: Manifest = {
|
|
|
408
411
|
items: {
|
|
409
412
|
setParameters: {
|
|
410
413
|
comment: {
|
|
411
|
-
|
|
414
|
+
markdownText: 'Sets a new value for the parameters.',
|
|
412
415
|
example: "await ctx.setParameters({ color: '#ff0000' });",
|
|
413
416
|
},
|
|
414
417
|
location: {
|
|
@@ -431,8 +434,8 @@ export const manifest: Manifest = {
|
|
|
431
434
|
renderItemFormSidebarPanel: {
|
|
432
435
|
name: 'renderItemFormSidebarPanel',
|
|
433
436
|
comment: {
|
|
434
|
-
|
|
435
|
-
'This function will be called when the plugin needs to render a sidebar panel\n(see the `itemFormSidebarPanels`
|
|
437
|
+
markdownText:
|
|
438
|
+
'This function will be called when the plugin needs to render a sidebar panel\n(see the `itemFormSidebarPanels` hook).',
|
|
436
439
|
tag: 'sidebarPanels',
|
|
437
440
|
},
|
|
438
441
|
nonCtxArguments: [
|
|
@@ -445,10 +448,15 @@ export const manifest: Manifest = {
|
|
|
445
448
|
type: 'SelfResizingPluginFrameCtx',
|
|
446
449
|
additionalProperties: [
|
|
447
450
|
{
|
|
451
|
+
name: 'ItemFormAdditionalProperties',
|
|
452
|
+
comment: {
|
|
453
|
+
markdownText:
|
|
454
|
+
"These information describe the current state of the form that's being shown\nto the end-user to edit a record.",
|
|
455
|
+
},
|
|
448
456
|
items: {
|
|
449
457
|
locale: {
|
|
450
458
|
comment: {
|
|
451
|
-
|
|
459
|
+
markdownText: 'The currently active locale for the record.',
|
|
452
460
|
},
|
|
453
461
|
location: {
|
|
454
462
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -458,8 +466,8 @@ export const manifest: Manifest = {
|
|
|
458
466
|
},
|
|
459
467
|
item: {
|
|
460
468
|
comment: {
|
|
461
|
-
|
|
462
|
-
'If an already persisted record is being edited, returns the full record\nentity',
|
|
469
|
+
markdownText:
|
|
470
|
+
'If an already persisted record is being edited, returns the full record\nentity.',
|
|
463
471
|
},
|
|
464
472
|
location: {
|
|
465
473
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -469,7 +477,7 @@ export const manifest: Manifest = {
|
|
|
469
477
|
},
|
|
470
478
|
itemType: {
|
|
471
479
|
comment: {
|
|
472
|
-
|
|
480
|
+
markdownText: 'The model for the record being edited.',
|
|
473
481
|
},
|
|
474
482
|
location: {
|
|
475
483
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -479,7 +487,7 @@ export const manifest: Manifest = {
|
|
|
479
487
|
},
|
|
480
488
|
formValues: {
|
|
481
489
|
comment: {
|
|
482
|
-
|
|
490
|
+
markdownText: 'The complete internal form state.',
|
|
483
491
|
},
|
|
484
492
|
location: {
|
|
485
493
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -489,7 +497,8 @@ export const manifest: Manifest = {
|
|
|
489
497
|
},
|
|
490
498
|
itemStatus: {
|
|
491
499
|
comment: {
|
|
492
|
-
|
|
500
|
+
markdownText:
|
|
501
|
+
'The current status of the record being edited.',
|
|
493
502
|
},
|
|
494
503
|
location: {
|
|
495
504
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -499,8 +508,8 @@ export const manifest: Manifest = {
|
|
|
499
508
|
},
|
|
500
509
|
isSubmitting: {
|
|
501
510
|
comment: {
|
|
502
|
-
|
|
503
|
-
'Whether the form is currently submitting itself or not',
|
|
511
|
+
markdownText:
|
|
512
|
+
'Whether the form is currently submitting itself or not.',
|
|
504
513
|
},
|
|
505
514
|
location: {
|
|
506
515
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -510,8 +519,8 @@ export const manifest: Manifest = {
|
|
|
510
519
|
},
|
|
511
520
|
isFormDirty: {
|
|
512
521
|
comment: {
|
|
513
|
-
|
|
514
|
-
'Whether the form has some non-persisted changes or not',
|
|
522
|
+
markdownText:
|
|
523
|
+
'Whether the form has some non-persisted changes or not.',
|
|
515
524
|
},
|
|
516
525
|
location: {
|
|
517
526
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -521,13 +530,14 @@ export const manifest: Manifest = {
|
|
|
521
530
|
},
|
|
522
531
|
blocksAnalysis: {
|
|
523
532
|
comment: {
|
|
524
|
-
|
|
533
|
+
markdownText:
|
|
534
|
+
'Provides information on how many blocks are currently present in the form.',
|
|
525
535
|
},
|
|
526
536
|
location: {
|
|
527
537
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
528
538
|
lineNumber: 29,
|
|
529
539
|
},
|
|
530
|
-
type: '
|
|
540
|
+
type: 'BlocksAnalysis',
|
|
531
541
|
},
|
|
532
542
|
},
|
|
533
543
|
},
|
|
@@ -535,8 +545,8 @@ export const manifest: Manifest = {
|
|
|
535
545
|
items: {
|
|
536
546
|
sidebarPaneId: {
|
|
537
547
|
comment: {
|
|
538
|
-
|
|
539
|
-
'The ID of the sidebar panel that needs to be rendered',
|
|
548
|
+
markdownText:
|
|
549
|
+
'The ID of the sidebar panel that needs to be rendered.',
|
|
540
550
|
},
|
|
541
551
|
location: {
|
|
542
552
|
filePath: 'src/hooks/renderItemFormSidebarPanel.ts',
|
|
@@ -546,8 +556,8 @@ export const manifest: Manifest = {
|
|
|
546
556
|
},
|
|
547
557
|
parameters: {
|
|
548
558
|
comment: {
|
|
549
|
-
|
|
550
|
-
'The arbitrary `parameters` of the panel declared in the\n`itemFormSidebarPanels` function',
|
|
559
|
+
markdownText:
|
|
560
|
+
'The arbitrary `parameters` of the panel declared in the\n`itemFormSidebarPanels` function.',
|
|
551
561
|
},
|
|
552
562
|
location: {
|
|
553
563
|
filePath: 'src/hooks/renderItemFormSidebarPanel.ts',
|
|
@@ -560,89 +570,96 @@ export const manifest: Manifest = {
|
|
|
560
570
|
],
|
|
561
571
|
additionalMethods: [
|
|
562
572
|
{
|
|
573
|
+
name: 'ItemFormAdditionalMethods',
|
|
574
|
+
comment: {
|
|
575
|
+
markdownText:
|
|
576
|
+
"These methods can be used to interact with the form that's being shown to the\nend-user to edit a record.",
|
|
577
|
+
},
|
|
563
578
|
items: {
|
|
564
579
|
toggleField: {
|
|
565
580
|
comment: {
|
|
566
|
-
|
|
581
|
+
markdownText:
|
|
567
582
|
'Hides/shows a specific field in the form. Please be aware that when a field\nis hidden, the field editor for that field will be removed from the DOM\nitself, including any associated plugins. When it is shown again, its\nplugins will be reinitialized.',
|
|
568
583
|
example:
|
|
569
584
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.toggleField(fieldPath, true);",
|
|
570
585
|
},
|
|
571
586
|
location: {
|
|
572
587
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
573
|
-
lineNumber:
|
|
588
|
+
lineNumber: 68,
|
|
574
589
|
},
|
|
575
590
|
type: '(path: string, show: boolean) => Promise<void>',
|
|
576
591
|
},
|
|
577
592
|
disableField: {
|
|
578
593
|
comment: {
|
|
579
|
-
|
|
594
|
+
markdownText:
|
|
595
|
+
'Disables/re-enables a specific field in the form.',
|
|
580
596
|
example:
|
|
581
597
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.disableField(fieldPath, true);",
|
|
582
598
|
},
|
|
583
599
|
location: {
|
|
584
600
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
585
|
-
lineNumber:
|
|
601
|
+
lineNumber: 83,
|
|
586
602
|
},
|
|
587
603
|
type: '(path: string, disable: boolean) => Promise<void>',
|
|
588
604
|
},
|
|
589
605
|
scrollToField: {
|
|
590
606
|
comment: {
|
|
591
|
-
|
|
607
|
+
markdownText:
|
|
592
608
|
'Smoothly navigates to a specific field in the form. If the field is\nlocalized it will switch language tab and then navigate to the chosen\nfield.',
|
|
593
609
|
example:
|
|
594
610
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.scrollToField(fieldPath);",
|
|
595
611
|
},
|
|
596
612
|
location: {
|
|
597
613
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
598
|
-
lineNumber:
|
|
614
|
+
lineNumber: 100,
|
|
599
615
|
},
|
|
600
616
|
type: '(path: string, locale?: string) => Promise<void>',
|
|
601
617
|
},
|
|
602
618
|
setFieldValue: {
|
|
603
619
|
comment: {
|
|
604
|
-
|
|
620
|
+
markdownText:
|
|
621
|
+
'Changes a specific path of the `formValues` object.',
|
|
605
622
|
example:
|
|
606
623
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.setFieldValue(fieldPath, 'new value');",
|
|
607
624
|
},
|
|
608
625
|
location: {
|
|
609
626
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
610
|
-
lineNumber:
|
|
627
|
+
lineNumber: 115,
|
|
611
628
|
},
|
|
612
629
|
type: '(path: string, value: unknown) => Promise<void>',
|
|
613
630
|
},
|
|
614
631
|
formValuesToItem: {
|
|
615
632
|
comment: {
|
|
616
|
-
|
|
633
|
+
markdownText:
|
|
617
634
|
'Takes the internal form state, and transforms it into an Item entity\ncompatible with DatoCMS API.\n\nWhen `skipUnchangedFields`, only the fields that changed value will be\nserialized.\n\nIf the required nested blocks are still not loaded, this method will return\n`undefined`.',
|
|
618
635
|
example: 'await ctx.formValuesToItem(ctx.formValues, false);',
|
|
619
636
|
},
|
|
620
637
|
location: {
|
|
621
638
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
622
|
-
lineNumber:
|
|
639
|
+
lineNumber: 132,
|
|
623
640
|
},
|
|
624
641
|
type: "(\n formValues: Record<string, unknown>,\n skipUnchangedFields?: boolean,\n ) => Promise<Omit<Item, 'id' | 'meta'> | undefined>",
|
|
625
642
|
},
|
|
626
643
|
itemToFormValues: {
|
|
627
644
|
comment: {
|
|
628
|
-
|
|
629
|
-
'Takes an Item entity, and converts it into the internal form state',
|
|
645
|
+
markdownText:
|
|
646
|
+
'Takes an Item entity, and converts it into the internal form state.',
|
|
630
647
|
example: 'await ctx.itemToFormValues(ctx.item);',
|
|
631
648
|
},
|
|
632
649
|
location: {
|
|
633
650
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
634
|
-
lineNumber:
|
|
651
|
+
lineNumber: 145,
|
|
635
652
|
},
|
|
636
653
|
type: "(\n item: Omit<Item, 'id' | 'meta'>,\n ) => Promise<Record<string, unknown>>",
|
|
637
654
|
},
|
|
638
655
|
saveCurrentItem: {
|
|
639
656
|
comment: {
|
|
640
|
-
|
|
657
|
+
markdownText: 'Triggers a submit form for current record.',
|
|
641
658
|
example: 'await ctx.saveCurrentItem();',
|
|
642
659
|
},
|
|
643
660
|
location: {
|
|
644
661
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
645
|
-
lineNumber:
|
|
662
|
+
lineNumber: 157,
|
|
646
663
|
},
|
|
647
664
|
type: '(showToast?: boolean) => Promise<void>',
|
|
648
665
|
},
|
|
@@ -659,8 +676,8 @@ export const manifest: Manifest = {
|
|
|
659
676
|
renderItemFormSidebar: {
|
|
660
677
|
name: 'renderItemFormSidebar',
|
|
661
678
|
comment: {
|
|
662
|
-
|
|
663
|
-
'This function will be called when the plugin needs to render a sidebar (see\nthe `itemFormSidebars`
|
|
679
|
+
markdownText:
|
|
680
|
+
'This function will be called when the plugin needs to render a sidebar (see\nthe `itemFormSidebars` hook).',
|
|
664
681
|
tag: 'sidebarPanels',
|
|
665
682
|
},
|
|
666
683
|
nonCtxArguments: [
|
|
@@ -673,10 +690,15 @@ export const manifest: Manifest = {
|
|
|
673
690
|
type: 'ImposedSizePluginFrameCtx',
|
|
674
691
|
additionalProperties: [
|
|
675
692
|
{
|
|
693
|
+
name: 'ItemFormAdditionalProperties',
|
|
694
|
+
comment: {
|
|
695
|
+
markdownText:
|
|
696
|
+
"These information describe the current state of the form that's being shown\nto the end-user to edit a record.",
|
|
697
|
+
},
|
|
676
698
|
items: {
|
|
677
699
|
locale: {
|
|
678
700
|
comment: {
|
|
679
|
-
|
|
701
|
+
markdownText: 'The currently active locale for the record.',
|
|
680
702
|
},
|
|
681
703
|
location: {
|
|
682
704
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -686,8 +708,8 @@ export const manifest: Manifest = {
|
|
|
686
708
|
},
|
|
687
709
|
item: {
|
|
688
710
|
comment: {
|
|
689
|
-
|
|
690
|
-
'If an already persisted record is being edited, returns the full record\nentity',
|
|
711
|
+
markdownText:
|
|
712
|
+
'If an already persisted record is being edited, returns the full record\nentity.',
|
|
691
713
|
},
|
|
692
714
|
location: {
|
|
693
715
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -697,7 +719,7 @@ export const manifest: Manifest = {
|
|
|
697
719
|
},
|
|
698
720
|
itemType: {
|
|
699
721
|
comment: {
|
|
700
|
-
|
|
722
|
+
markdownText: 'The model for the record being edited.',
|
|
701
723
|
},
|
|
702
724
|
location: {
|
|
703
725
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -707,7 +729,7 @@ export const manifest: Manifest = {
|
|
|
707
729
|
},
|
|
708
730
|
formValues: {
|
|
709
731
|
comment: {
|
|
710
|
-
|
|
732
|
+
markdownText: 'The complete internal form state.',
|
|
711
733
|
},
|
|
712
734
|
location: {
|
|
713
735
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -717,7 +739,8 @@ export const manifest: Manifest = {
|
|
|
717
739
|
},
|
|
718
740
|
itemStatus: {
|
|
719
741
|
comment: {
|
|
720
|
-
|
|
742
|
+
markdownText:
|
|
743
|
+
'The current status of the record being edited.',
|
|
721
744
|
},
|
|
722
745
|
location: {
|
|
723
746
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -727,8 +750,8 @@ export const manifest: Manifest = {
|
|
|
727
750
|
},
|
|
728
751
|
isSubmitting: {
|
|
729
752
|
comment: {
|
|
730
|
-
|
|
731
|
-
'Whether the form is currently submitting itself or not',
|
|
753
|
+
markdownText:
|
|
754
|
+
'Whether the form is currently submitting itself or not.',
|
|
732
755
|
},
|
|
733
756
|
location: {
|
|
734
757
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -738,8 +761,8 @@ export const manifest: Manifest = {
|
|
|
738
761
|
},
|
|
739
762
|
isFormDirty: {
|
|
740
763
|
comment: {
|
|
741
|
-
|
|
742
|
-
'Whether the form has some non-persisted changes or not',
|
|
764
|
+
markdownText:
|
|
765
|
+
'Whether the form has some non-persisted changes or not.',
|
|
743
766
|
},
|
|
744
767
|
location: {
|
|
745
768
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -749,13 +772,14 @@ export const manifest: Manifest = {
|
|
|
749
772
|
},
|
|
750
773
|
blocksAnalysis: {
|
|
751
774
|
comment: {
|
|
752
|
-
|
|
775
|
+
markdownText:
|
|
776
|
+
'Provides information on how many blocks are currently present in the form.',
|
|
753
777
|
},
|
|
754
778
|
location: {
|
|
755
779
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
756
780
|
lineNumber: 29,
|
|
757
781
|
},
|
|
758
|
-
type: '
|
|
782
|
+
type: 'BlocksAnalysis',
|
|
759
783
|
},
|
|
760
784
|
},
|
|
761
785
|
},
|
|
@@ -763,7 +787,8 @@ export const manifest: Manifest = {
|
|
|
763
787
|
items: {
|
|
764
788
|
sidebarId: {
|
|
765
789
|
comment: {
|
|
766
|
-
|
|
790
|
+
markdownText:
|
|
791
|
+
'The ID of the sidebar that needs to be rendered.',
|
|
767
792
|
},
|
|
768
793
|
location: {
|
|
769
794
|
filePath: 'src/hooks/renderItemFormSidebar.ts',
|
|
@@ -773,8 +798,8 @@ export const manifest: Manifest = {
|
|
|
773
798
|
},
|
|
774
799
|
parameters: {
|
|
775
800
|
comment: {
|
|
776
|
-
|
|
777
|
-
'The arbitrary `parameters` of the declared in the `itemFormSidebars`\nfunction',
|
|
801
|
+
markdownText:
|
|
802
|
+
'The arbitrary `parameters` of the declared in the `itemFormSidebars`\nfunction.',
|
|
778
803
|
},
|
|
779
804
|
location: {
|
|
780
805
|
filePath: 'src/hooks/renderItemFormSidebar.ts',
|
|
@@ -787,89 +812,96 @@ export const manifest: Manifest = {
|
|
|
787
812
|
],
|
|
788
813
|
additionalMethods: [
|
|
789
814
|
{
|
|
815
|
+
name: 'ItemFormAdditionalMethods',
|
|
816
|
+
comment: {
|
|
817
|
+
markdownText:
|
|
818
|
+
"These methods can be used to interact with the form that's being shown to the\nend-user to edit a record.",
|
|
819
|
+
},
|
|
790
820
|
items: {
|
|
791
821
|
toggleField: {
|
|
792
822
|
comment: {
|
|
793
|
-
|
|
823
|
+
markdownText:
|
|
794
824
|
'Hides/shows a specific field in the form. Please be aware that when a field\nis hidden, the field editor for that field will be removed from the DOM\nitself, including any associated plugins. When it is shown again, its\nplugins will be reinitialized.',
|
|
795
825
|
example:
|
|
796
826
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.toggleField(fieldPath, true);",
|
|
797
827
|
},
|
|
798
828
|
location: {
|
|
799
829
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
800
|
-
lineNumber:
|
|
830
|
+
lineNumber: 68,
|
|
801
831
|
},
|
|
802
832
|
type: '(path: string, show: boolean) => Promise<void>',
|
|
803
833
|
},
|
|
804
834
|
disableField: {
|
|
805
835
|
comment: {
|
|
806
|
-
|
|
836
|
+
markdownText:
|
|
837
|
+
'Disables/re-enables a specific field in the form.',
|
|
807
838
|
example:
|
|
808
839
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.disableField(fieldPath, true);",
|
|
809
840
|
},
|
|
810
841
|
location: {
|
|
811
842
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
812
|
-
lineNumber:
|
|
843
|
+
lineNumber: 83,
|
|
813
844
|
},
|
|
814
845
|
type: '(path: string, disable: boolean) => Promise<void>',
|
|
815
846
|
},
|
|
816
847
|
scrollToField: {
|
|
817
848
|
comment: {
|
|
818
|
-
|
|
849
|
+
markdownText:
|
|
819
850
|
'Smoothly navigates to a specific field in the form. If the field is\nlocalized it will switch language tab and then navigate to the chosen\nfield.',
|
|
820
851
|
example:
|
|
821
852
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.scrollToField(fieldPath);",
|
|
822
853
|
},
|
|
823
854
|
location: {
|
|
824
855
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
825
|
-
lineNumber:
|
|
856
|
+
lineNumber: 100,
|
|
826
857
|
},
|
|
827
858
|
type: '(path: string, locale?: string) => Promise<void>',
|
|
828
859
|
},
|
|
829
860
|
setFieldValue: {
|
|
830
861
|
comment: {
|
|
831
|
-
|
|
862
|
+
markdownText:
|
|
863
|
+
'Changes a specific path of the `formValues` object.',
|
|
832
864
|
example:
|
|
833
865
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.setFieldValue(fieldPath, 'new value');",
|
|
834
866
|
},
|
|
835
867
|
location: {
|
|
836
868
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
837
|
-
lineNumber:
|
|
869
|
+
lineNumber: 115,
|
|
838
870
|
},
|
|
839
871
|
type: '(path: string, value: unknown) => Promise<void>',
|
|
840
872
|
},
|
|
841
873
|
formValuesToItem: {
|
|
842
874
|
comment: {
|
|
843
|
-
|
|
875
|
+
markdownText:
|
|
844
876
|
'Takes the internal form state, and transforms it into an Item entity\ncompatible with DatoCMS API.\n\nWhen `skipUnchangedFields`, only the fields that changed value will be\nserialized.\n\nIf the required nested blocks are still not loaded, this method will return\n`undefined`.',
|
|
845
877
|
example: 'await ctx.formValuesToItem(ctx.formValues, false);',
|
|
846
878
|
},
|
|
847
879
|
location: {
|
|
848
880
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
849
|
-
lineNumber:
|
|
881
|
+
lineNumber: 132,
|
|
850
882
|
},
|
|
851
883
|
type: "(\n formValues: Record<string, unknown>,\n skipUnchangedFields?: boolean,\n ) => Promise<Omit<Item, 'id' | 'meta'> | undefined>",
|
|
852
884
|
},
|
|
853
885
|
itemToFormValues: {
|
|
854
886
|
comment: {
|
|
855
|
-
|
|
856
|
-
'Takes an Item entity, and converts it into the internal form state',
|
|
887
|
+
markdownText:
|
|
888
|
+
'Takes an Item entity, and converts it into the internal form state.',
|
|
857
889
|
example: 'await ctx.itemToFormValues(ctx.item);',
|
|
858
890
|
},
|
|
859
891
|
location: {
|
|
860
892
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
861
|
-
lineNumber:
|
|
893
|
+
lineNumber: 145,
|
|
862
894
|
},
|
|
863
895
|
type: "(\n item: Omit<Item, 'id' | 'meta'>,\n ) => Promise<Record<string, unknown>>",
|
|
864
896
|
},
|
|
865
897
|
saveCurrentItem: {
|
|
866
898
|
comment: {
|
|
867
|
-
|
|
899
|
+
markdownText: 'Triggers a submit form for current record.',
|
|
868
900
|
example: 'await ctx.saveCurrentItem();',
|
|
869
901
|
},
|
|
870
902
|
location: {
|
|
871
903
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
872
|
-
lineNumber:
|
|
904
|
+
lineNumber: 157,
|
|
873
905
|
},
|
|
874
906
|
type: '(showToast?: boolean) => Promise<void>',
|
|
875
907
|
},
|
|
@@ -886,7 +918,7 @@ export const manifest: Manifest = {
|
|
|
886
918
|
renderItemFormOutlet: {
|
|
887
919
|
name: 'renderItemFormOutlet',
|
|
888
920
|
comment: {
|
|
889
|
-
|
|
921
|
+
markdownText:
|
|
890
922
|
'This function will be called when the plugin needs to render an outlet\ndefined by the `itemFormOutlets()` hook.',
|
|
891
923
|
tag: 'outlets',
|
|
892
924
|
},
|
|
@@ -900,10 +932,15 @@ export const manifest: Manifest = {
|
|
|
900
932
|
type: 'SelfResizingPluginFrameCtx',
|
|
901
933
|
additionalProperties: [
|
|
902
934
|
{
|
|
935
|
+
name: 'ItemFormAdditionalProperties',
|
|
936
|
+
comment: {
|
|
937
|
+
markdownText:
|
|
938
|
+
"These information describe the current state of the form that's being shown\nto the end-user to edit a record.",
|
|
939
|
+
},
|
|
903
940
|
items: {
|
|
904
941
|
locale: {
|
|
905
942
|
comment: {
|
|
906
|
-
|
|
943
|
+
markdownText: 'The currently active locale for the record.',
|
|
907
944
|
},
|
|
908
945
|
location: {
|
|
909
946
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -913,8 +950,8 @@ export const manifest: Manifest = {
|
|
|
913
950
|
},
|
|
914
951
|
item: {
|
|
915
952
|
comment: {
|
|
916
|
-
|
|
917
|
-
'If an already persisted record is being edited, returns the full record\nentity',
|
|
953
|
+
markdownText:
|
|
954
|
+
'If an already persisted record is being edited, returns the full record\nentity.',
|
|
918
955
|
},
|
|
919
956
|
location: {
|
|
920
957
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -924,7 +961,7 @@ export const manifest: Manifest = {
|
|
|
924
961
|
},
|
|
925
962
|
itemType: {
|
|
926
963
|
comment: {
|
|
927
|
-
|
|
964
|
+
markdownText: 'The model for the record being edited.',
|
|
928
965
|
},
|
|
929
966
|
location: {
|
|
930
967
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -934,7 +971,7 @@ export const manifest: Manifest = {
|
|
|
934
971
|
},
|
|
935
972
|
formValues: {
|
|
936
973
|
comment: {
|
|
937
|
-
|
|
974
|
+
markdownText: 'The complete internal form state.',
|
|
938
975
|
},
|
|
939
976
|
location: {
|
|
940
977
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -944,7 +981,8 @@ export const manifest: Manifest = {
|
|
|
944
981
|
},
|
|
945
982
|
itemStatus: {
|
|
946
983
|
comment: {
|
|
947
|
-
|
|
984
|
+
markdownText:
|
|
985
|
+
'The current status of the record being edited.',
|
|
948
986
|
},
|
|
949
987
|
location: {
|
|
950
988
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -954,8 +992,8 @@ export const manifest: Manifest = {
|
|
|
954
992
|
},
|
|
955
993
|
isSubmitting: {
|
|
956
994
|
comment: {
|
|
957
|
-
|
|
958
|
-
'Whether the form is currently submitting itself or not',
|
|
995
|
+
markdownText:
|
|
996
|
+
'Whether the form is currently submitting itself or not.',
|
|
959
997
|
},
|
|
960
998
|
location: {
|
|
961
999
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -965,8 +1003,8 @@ export const manifest: Manifest = {
|
|
|
965
1003
|
},
|
|
966
1004
|
isFormDirty: {
|
|
967
1005
|
comment: {
|
|
968
|
-
|
|
969
|
-
'Whether the form has some non-persisted changes or not',
|
|
1006
|
+
markdownText:
|
|
1007
|
+
'Whether the form has some non-persisted changes or not.',
|
|
970
1008
|
},
|
|
971
1009
|
location: {
|
|
972
1010
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -976,13 +1014,14 @@ export const manifest: Manifest = {
|
|
|
976
1014
|
},
|
|
977
1015
|
blocksAnalysis: {
|
|
978
1016
|
comment: {
|
|
979
|
-
|
|
1017
|
+
markdownText:
|
|
1018
|
+
'Provides information on how many blocks are currently present in the form.',
|
|
980
1019
|
},
|
|
981
1020
|
location: {
|
|
982
1021
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
983
1022
|
lineNumber: 29,
|
|
984
1023
|
},
|
|
985
|
-
type: '
|
|
1024
|
+
type: 'BlocksAnalysis',
|
|
986
1025
|
},
|
|
987
1026
|
},
|
|
988
1027
|
},
|
|
@@ -990,7 +1029,8 @@ export const manifest: Manifest = {
|
|
|
990
1029
|
items: {
|
|
991
1030
|
itemFormOutletId: {
|
|
992
1031
|
comment: {
|
|
993
|
-
|
|
1032
|
+
markdownText:
|
|
1033
|
+
'The ID of the outlet that needs to be rendered.',
|
|
994
1034
|
},
|
|
995
1035
|
location: {
|
|
996
1036
|
filePath: 'src/hooks/renderItemFormOutlet.ts',
|
|
@@ -1003,89 +1043,96 @@ export const manifest: Manifest = {
|
|
|
1003
1043
|
],
|
|
1004
1044
|
additionalMethods: [
|
|
1005
1045
|
{
|
|
1046
|
+
name: 'ItemFormAdditionalMethods',
|
|
1047
|
+
comment: {
|
|
1048
|
+
markdownText:
|
|
1049
|
+
"These methods can be used to interact with the form that's being shown to the\nend-user to edit a record.",
|
|
1050
|
+
},
|
|
1006
1051
|
items: {
|
|
1007
1052
|
toggleField: {
|
|
1008
1053
|
comment: {
|
|
1009
|
-
|
|
1054
|
+
markdownText:
|
|
1010
1055
|
'Hides/shows a specific field in the form. Please be aware that when a field\nis hidden, the field editor for that field will be removed from the DOM\nitself, including any associated plugins. When it is shown again, its\nplugins will be reinitialized.',
|
|
1011
1056
|
example:
|
|
1012
1057
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.toggleField(fieldPath, true);",
|
|
1013
1058
|
},
|
|
1014
1059
|
location: {
|
|
1015
1060
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
1016
|
-
lineNumber:
|
|
1061
|
+
lineNumber: 68,
|
|
1017
1062
|
},
|
|
1018
1063
|
type: '(path: string, show: boolean) => Promise<void>',
|
|
1019
1064
|
},
|
|
1020
1065
|
disableField: {
|
|
1021
1066
|
comment: {
|
|
1022
|
-
|
|
1067
|
+
markdownText:
|
|
1068
|
+
'Disables/re-enables a specific field in the form.',
|
|
1023
1069
|
example:
|
|
1024
1070
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.disableField(fieldPath, true);",
|
|
1025
1071
|
},
|
|
1026
1072
|
location: {
|
|
1027
1073
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
1028
|
-
lineNumber:
|
|
1074
|
+
lineNumber: 83,
|
|
1029
1075
|
},
|
|
1030
1076
|
type: '(path: string, disable: boolean) => Promise<void>',
|
|
1031
1077
|
},
|
|
1032
1078
|
scrollToField: {
|
|
1033
1079
|
comment: {
|
|
1034
|
-
|
|
1080
|
+
markdownText:
|
|
1035
1081
|
'Smoothly navigates to a specific field in the form. If the field is\nlocalized it will switch language tab and then navigate to the chosen\nfield.',
|
|
1036
1082
|
example:
|
|
1037
1083
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.scrollToField(fieldPath);",
|
|
1038
1084
|
},
|
|
1039
1085
|
location: {
|
|
1040
1086
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
1041
|
-
lineNumber:
|
|
1087
|
+
lineNumber: 100,
|
|
1042
1088
|
},
|
|
1043
1089
|
type: '(path: string, locale?: string) => Promise<void>',
|
|
1044
1090
|
},
|
|
1045
1091
|
setFieldValue: {
|
|
1046
1092
|
comment: {
|
|
1047
|
-
|
|
1093
|
+
markdownText:
|
|
1094
|
+
'Changes a specific path of the `formValues` object.',
|
|
1048
1095
|
example:
|
|
1049
1096
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.setFieldValue(fieldPath, 'new value');",
|
|
1050
1097
|
},
|
|
1051
1098
|
location: {
|
|
1052
1099
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
1053
|
-
lineNumber:
|
|
1100
|
+
lineNumber: 115,
|
|
1054
1101
|
},
|
|
1055
1102
|
type: '(path: string, value: unknown) => Promise<void>',
|
|
1056
1103
|
},
|
|
1057
1104
|
formValuesToItem: {
|
|
1058
1105
|
comment: {
|
|
1059
|
-
|
|
1106
|
+
markdownText:
|
|
1060
1107
|
'Takes the internal form state, and transforms it into an Item entity\ncompatible with DatoCMS API.\n\nWhen `skipUnchangedFields`, only the fields that changed value will be\nserialized.\n\nIf the required nested blocks are still not loaded, this method will return\n`undefined`.',
|
|
1061
1108
|
example: 'await ctx.formValuesToItem(ctx.formValues, false);',
|
|
1062
1109
|
},
|
|
1063
1110
|
location: {
|
|
1064
1111
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
1065
|
-
lineNumber:
|
|
1112
|
+
lineNumber: 132,
|
|
1066
1113
|
},
|
|
1067
1114
|
type: "(\n formValues: Record<string, unknown>,\n skipUnchangedFields?: boolean,\n ) => Promise<Omit<Item, 'id' | 'meta'> | undefined>",
|
|
1068
1115
|
},
|
|
1069
1116
|
itemToFormValues: {
|
|
1070
1117
|
comment: {
|
|
1071
|
-
|
|
1072
|
-
'Takes an Item entity, and converts it into the internal form state',
|
|
1118
|
+
markdownText:
|
|
1119
|
+
'Takes an Item entity, and converts it into the internal form state.',
|
|
1073
1120
|
example: 'await ctx.itemToFormValues(ctx.item);',
|
|
1074
1121
|
},
|
|
1075
1122
|
location: {
|
|
1076
1123
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
1077
|
-
lineNumber:
|
|
1124
|
+
lineNumber: 145,
|
|
1078
1125
|
},
|
|
1079
1126
|
type: "(\n item: Omit<Item, 'id' | 'meta'>,\n ) => Promise<Record<string, unknown>>",
|
|
1080
1127
|
},
|
|
1081
1128
|
saveCurrentItem: {
|
|
1082
1129
|
comment: {
|
|
1083
|
-
|
|
1130
|
+
markdownText: 'Triggers a submit form for current record.',
|
|
1084
1131
|
example: 'await ctx.saveCurrentItem();',
|
|
1085
1132
|
},
|
|
1086
1133
|
location: {
|
|
1087
1134
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
1088
|
-
lineNumber:
|
|
1135
|
+
lineNumber: 157,
|
|
1089
1136
|
},
|
|
1090
1137
|
type: '(showToast?: boolean) => Promise<void>',
|
|
1091
1138
|
},
|
|
@@ -1102,7 +1149,7 @@ export const manifest: Manifest = {
|
|
|
1102
1149
|
renderItemCollectionOutlet: {
|
|
1103
1150
|
name: 'renderItemCollectionOutlet',
|
|
1104
1151
|
comment: {
|
|
1105
|
-
|
|
1152
|
+
markdownText:
|
|
1106
1153
|
'This function will be called when the plugin needs to render an outlet\ndefined by the `itemFormOutlets()` hook.',
|
|
1107
1154
|
tag: 'outlets',
|
|
1108
1155
|
},
|
|
@@ -1119,7 +1166,8 @@ export const manifest: Manifest = {
|
|
|
1119
1166
|
items: {
|
|
1120
1167
|
itemCollectionOutletId: {
|
|
1121
1168
|
comment: {
|
|
1122
|
-
|
|
1169
|
+
markdownText:
|
|
1170
|
+
'The ID of the outlet that needs to be rendered.',
|
|
1123
1171
|
},
|
|
1124
1172
|
location: {
|
|
1125
1173
|
filePath: 'src/hooks/renderItemCollectionOutlet.ts',
|
|
@@ -1141,8 +1189,8 @@ export const manifest: Manifest = {
|
|
|
1141
1189
|
renderFieldExtension: {
|
|
1142
1190
|
name: 'renderFieldExtension',
|
|
1143
1191
|
comment: {
|
|
1144
|
-
|
|
1145
|
-
'This function will be called when the plugin needs to render a field\nextension (see the `manualFieldExtensions` and `overrideFieldExtensions`\nfunctions)',
|
|
1192
|
+
markdownText:
|
|
1193
|
+
'This function will be called when the plugin needs to render a field\nextension (see the `manualFieldExtensions` and `overrideFieldExtensions`\nfunctions).',
|
|
1146
1194
|
tag: 'forcedFieldExtensions',
|
|
1147
1195
|
},
|
|
1148
1196
|
nonCtxArguments: [
|
|
@@ -1155,10 +1203,15 @@ export const manifest: Manifest = {
|
|
|
1155
1203
|
type: 'SelfResizingPluginFrameCtx',
|
|
1156
1204
|
additionalProperties: [
|
|
1157
1205
|
{
|
|
1206
|
+
name: 'ItemFormAdditionalProperties',
|
|
1207
|
+
comment: {
|
|
1208
|
+
markdownText:
|
|
1209
|
+
"These information describe the current state of the form that's being shown\nto the end-user to edit a record.",
|
|
1210
|
+
},
|
|
1158
1211
|
items: {
|
|
1159
1212
|
locale: {
|
|
1160
1213
|
comment: {
|
|
1161
|
-
|
|
1214
|
+
markdownText: 'The currently active locale for the record.',
|
|
1162
1215
|
},
|
|
1163
1216
|
location: {
|
|
1164
1217
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -1168,8 +1221,8 @@ export const manifest: Manifest = {
|
|
|
1168
1221
|
},
|
|
1169
1222
|
item: {
|
|
1170
1223
|
comment: {
|
|
1171
|
-
|
|
1172
|
-
'If an already persisted record is being edited, returns the full record\nentity',
|
|
1224
|
+
markdownText:
|
|
1225
|
+
'If an already persisted record is being edited, returns the full record\nentity.',
|
|
1173
1226
|
},
|
|
1174
1227
|
location: {
|
|
1175
1228
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -1179,7 +1232,7 @@ export const manifest: Manifest = {
|
|
|
1179
1232
|
},
|
|
1180
1233
|
itemType: {
|
|
1181
1234
|
comment: {
|
|
1182
|
-
|
|
1235
|
+
markdownText: 'The model for the record being edited.',
|
|
1183
1236
|
},
|
|
1184
1237
|
location: {
|
|
1185
1238
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -1189,7 +1242,7 @@ export const manifest: Manifest = {
|
|
|
1189
1242
|
},
|
|
1190
1243
|
formValues: {
|
|
1191
1244
|
comment: {
|
|
1192
|
-
|
|
1245
|
+
markdownText: 'The complete internal form state.',
|
|
1193
1246
|
},
|
|
1194
1247
|
location: {
|
|
1195
1248
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -1199,7 +1252,8 @@ export const manifest: Manifest = {
|
|
|
1199
1252
|
},
|
|
1200
1253
|
itemStatus: {
|
|
1201
1254
|
comment: {
|
|
1202
|
-
|
|
1255
|
+
markdownText:
|
|
1256
|
+
'The current status of the record being edited.',
|
|
1203
1257
|
},
|
|
1204
1258
|
location: {
|
|
1205
1259
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -1209,8 +1263,8 @@ export const manifest: Manifest = {
|
|
|
1209
1263
|
},
|
|
1210
1264
|
isSubmitting: {
|
|
1211
1265
|
comment: {
|
|
1212
|
-
|
|
1213
|
-
'Whether the form is currently submitting itself or not',
|
|
1266
|
+
markdownText:
|
|
1267
|
+
'Whether the form is currently submitting itself or not.',
|
|
1214
1268
|
},
|
|
1215
1269
|
location: {
|
|
1216
1270
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -1220,8 +1274,8 @@ export const manifest: Manifest = {
|
|
|
1220
1274
|
},
|
|
1221
1275
|
isFormDirty: {
|
|
1222
1276
|
comment: {
|
|
1223
|
-
|
|
1224
|
-
'Whether the form has some non-persisted changes or not',
|
|
1277
|
+
markdownText:
|
|
1278
|
+
'Whether the form has some non-persisted changes or not.',
|
|
1225
1279
|
},
|
|
1226
1280
|
location: {
|
|
1227
1281
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -1231,69 +1285,76 @@ export const manifest: Manifest = {
|
|
|
1231
1285
|
},
|
|
1232
1286
|
blocksAnalysis: {
|
|
1233
1287
|
comment: {
|
|
1234
|
-
|
|
1288
|
+
markdownText:
|
|
1289
|
+
'Provides information on how many blocks are currently present in the form.',
|
|
1235
1290
|
},
|
|
1236
1291
|
location: {
|
|
1237
1292
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
1238
1293
|
lineNumber: 29,
|
|
1239
1294
|
},
|
|
1240
|
-
type: '
|
|
1295
|
+
type: 'BlocksAnalysis',
|
|
1241
1296
|
},
|
|
1242
1297
|
},
|
|
1243
1298
|
},
|
|
1244
1299
|
{
|
|
1300
|
+
name: 'FieldAdditionalProperties',
|
|
1301
|
+
comment: {
|
|
1302
|
+
markdownText:
|
|
1303
|
+
'These information describe the current state of the field where this plugin\nis applied to.',
|
|
1304
|
+
},
|
|
1245
1305
|
items: {
|
|
1246
1306
|
disabled: {
|
|
1247
1307
|
comment: {
|
|
1248
|
-
|
|
1308
|
+
markdownText:
|
|
1309
|
+
'Whether the field is currently disabled or not.',
|
|
1249
1310
|
},
|
|
1250
1311
|
location: {
|
|
1251
1312
|
filePath: 'src/ctx/commonExtras/field.ts',
|
|
1252
|
-
lineNumber:
|
|
1313
|
+
lineNumber: 12,
|
|
1253
1314
|
},
|
|
1254
1315
|
type: 'boolean',
|
|
1255
1316
|
},
|
|
1256
1317
|
fieldPath: {
|
|
1257
1318
|
comment: {
|
|
1258
|
-
|
|
1259
|
-
'The path in the `formValues` object where to find the current value for the\nfield',
|
|
1319
|
+
markdownText:
|
|
1320
|
+
'The path in the `formValues` object where to find the current value for the\nfield.',
|
|
1260
1321
|
},
|
|
1261
1322
|
location: {
|
|
1262
1323
|
filePath: 'src/ctx/commonExtras/field.ts',
|
|
1263
|
-
lineNumber:
|
|
1324
|
+
lineNumber: 17,
|
|
1264
1325
|
},
|
|
1265
1326
|
type: 'string',
|
|
1266
1327
|
},
|
|
1267
1328
|
field: {
|
|
1268
1329
|
comment: {
|
|
1269
|
-
|
|
1270
|
-
'The field where the field extension is installed to',
|
|
1330
|
+
markdownText:
|
|
1331
|
+
'The field where the field extension is installed to.',
|
|
1271
1332
|
},
|
|
1272
1333
|
location: {
|
|
1273
1334
|
filePath: 'src/ctx/commonExtras/field.ts',
|
|
1274
|
-
lineNumber:
|
|
1335
|
+
lineNumber: 19,
|
|
1275
1336
|
},
|
|
1276
1337
|
type: 'Field',
|
|
1277
1338
|
},
|
|
1278
1339
|
parentField: {
|
|
1279
1340
|
comment: {
|
|
1280
|
-
|
|
1281
|
-
'If the field extension is installed in a field of a block, returns the top\nlevel Modular Content/Structured Text field containing the block itself',
|
|
1341
|
+
markdownText:
|
|
1342
|
+
'If the field extension is installed in a field of a block, returns the top\nlevel Modular Content/Structured Text field containing the block itself.',
|
|
1282
1343
|
},
|
|
1283
1344
|
location: {
|
|
1284
1345
|
filePath: 'src/ctx/commonExtras/field.ts',
|
|
1285
|
-
lineNumber:
|
|
1346
|
+
lineNumber: 24,
|
|
1286
1347
|
},
|
|
1287
1348
|
type: 'Field | undefined',
|
|
1288
1349
|
},
|
|
1289
1350
|
block: {
|
|
1290
1351
|
comment: {
|
|
1291
|
-
|
|
1352
|
+
markdownText:
|
|
1292
1353
|
'If the field extension is installed in a field of a block, returns the ID\nof the block — or `undefined` if the block is still not persisted — and the\nblock model.',
|
|
1293
1354
|
},
|
|
1294
1355
|
location: {
|
|
1295
1356
|
filePath: 'src/ctx/commonExtras/field.ts',
|
|
1296
|
-
lineNumber:
|
|
1357
|
+
lineNumber: 30,
|
|
1297
1358
|
},
|
|
1298
1359
|
type: 'undefined | { id: string | undefined; blockModel: ItemType }',
|
|
1299
1360
|
},
|
|
@@ -1303,8 +1364,8 @@ export const manifest: Manifest = {
|
|
|
1303
1364
|
items: {
|
|
1304
1365
|
fieldExtensionId: {
|
|
1305
1366
|
comment: {
|
|
1306
|
-
|
|
1307
|
-
'The ID of the field extension that needs to be rendered',
|
|
1367
|
+
markdownText:
|
|
1368
|
+
'The ID of the field extension that needs to be rendered.',
|
|
1308
1369
|
},
|
|
1309
1370
|
location: {
|
|
1310
1371
|
filePath: 'src/hooks/renderFieldExtension.ts',
|
|
@@ -1314,7 +1375,8 @@ export const manifest: Manifest = {
|
|
|
1314
1375
|
},
|
|
1315
1376
|
parameters: {
|
|
1316
1377
|
comment: {
|
|
1317
|
-
|
|
1378
|
+
markdownText:
|
|
1379
|
+
'The arbitrary `parameters` of the field extension.',
|
|
1318
1380
|
},
|
|
1319
1381
|
location: {
|
|
1320
1382
|
filePath: 'src/hooks/renderFieldExtension.ts',
|
|
@@ -1327,89 +1389,96 @@ export const manifest: Manifest = {
|
|
|
1327
1389
|
],
|
|
1328
1390
|
additionalMethods: [
|
|
1329
1391
|
{
|
|
1392
|
+
name: 'ItemFormAdditionalMethods',
|
|
1393
|
+
comment: {
|
|
1394
|
+
markdownText:
|
|
1395
|
+
"These methods can be used to interact with the form that's being shown to the\nend-user to edit a record.",
|
|
1396
|
+
},
|
|
1330
1397
|
items: {
|
|
1331
1398
|
toggleField: {
|
|
1332
1399
|
comment: {
|
|
1333
|
-
|
|
1400
|
+
markdownText:
|
|
1334
1401
|
'Hides/shows a specific field in the form. Please be aware that when a field\nis hidden, the field editor for that field will be removed from the DOM\nitself, including any associated plugins. When it is shown again, its\nplugins will be reinitialized.',
|
|
1335
1402
|
example:
|
|
1336
1403
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.toggleField(fieldPath, true);",
|
|
1337
1404
|
},
|
|
1338
1405
|
location: {
|
|
1339
1406
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
1340
|
-
lineNumber:
|
|
1407
|
+
lineNumber: 68,
|
|
1341
1408
|
},
|
|
1342
1409
|
type: '(path: string, show: boolean) => Promise<void>',
|
|
1343
1410
|
},
|
|
1344
1411
|
disableField: {
|
|
1345
1412
|
comment: {
|
|
1346
|
-
|
|
1413
|
+
markdownText:
|
|
1414
|
+
'Disables/re-enables a specific field in the form.',
|
|
1347
1415
|
example:
|
|
1348
1416
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.disableField(fieldPath, true);",
|
|
1349
1417
|
},
|
|
1350
1418
|
location: {
|
|
1351
1419
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
1352
|
-
lineNumber:
|
|
1420
|
+
lineNumber: 83,
|
|
1353
1421
|
},
|
|
1354
1422
|
type: '(path: string, disable: boolean) => Promise<void>',
|
|
1355
1423
|
},
|
|
1356
1424
|
scrollToField: {
|
|
1357
1425
|
comment: {
|
|
1358
|
-
|
|
1426
|
+
markdownText:
|
|
1359
1427
|
'Smoothly navigates to a specific field in the form. If the field is\nlocalized it will switch language tab and then navigate to the chosen\nfield.',
|
|
1360
1428
|
example:
|
|
1361
1429
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.scrollToField(fieldPath);",
|
|
1362
1430
|
},
|
|
1363
1431
|
location: {
|
|
1364
1432
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
1365
|
-
lineNumber:
|
|
1433
|
+
lineNumber: 100,
|
|
1366
1434
|
},
|
|
1367
1435
|
type: '(path: string, locale?: string) => Promise<void>',
|
|
1368
1436
|
},
|
|
1369
1437
|
setFieldValue: {
|
|
1370
1438
|
comment: {
|
|
1371
|
-
|
|
1439
|
+
markdownText:
|
|
1440
|
+
'Changes a specific path of the `formValues` object.',
|
|
1372
1441
|
example:
|
|
1373
1442
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.setFieldValue(fieldPath, 'new value');",
|
|
1374
1443
|
},
|
|
1375
1444
|
location: {
|
|
1376
1445
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
1377
|
-
lineNumber:
|
|
1446
|
+
lineNumber: 115,
|
|
1378
1447
|
},
|
|
1379
1448
|
type: '(path: string, value: unknown) => Promise<void>',
|
|
1380
1449
|
},
|
|
1381
1450
|
formValuesToItem: {
|
|
1382
1451
|
comment: {
|
|
1383
|
-
|
|
1452
|
+
markdownText:
|
|
1384
1453
|
'Takes the internal form state, and transforms it into an Item entity\ncompatible with DatoCMS API.\n\nWhen `skipUnchangedFields`, only the fields that changed value will be\nserialized.\n\nIf the required nested blocks are still not loaded, this method will return\n`undefined`.',
|
|
1385
1454
|
example: 'await ctx.formValuesToItem(ctx.formValues, false);',
|
|
1386
1455
|
},
|
|
1387
1456
|
location: {
|
|
1388
1457
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
1389
|
-
lineNumber:
|
|
1458
|
+
lineNumber: 132,
|
|
1390
1459
|
},
|
|
1391
1460
|
type: "(\n formValues: Record<string, unknown>,\n skipUnchangedFields?: boolean,\n ) => Promise<Omit<Item, 'id' | 'meta'> | undefined>",
|
|
1392
1461
|
},
|
|
1393
1462
|
itemToFormValues: {
|
|
1394
1463
|
comment: {
|
|
1395
|
-
|
|
1396
|
-
'Takes an Item entity, and converts it into the internal form state',
|
|
1464
|
+
markdownText:
|
|
1465
|
+
'Takes an Item entity, and converts it into the internal form state.',
|
|
1397
1466
|
example: 'await ctx.itemToFormValues(ctx.item);',
|
|
1398
1467
|
},
|
|
1399
1468
|
location: {
|
|
1400
1469
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
1401
|
-
lineNumber:
|
|
1470
|
+
lineNumber: 145,
|
|
1402
1471
|
},
|
|
1403
1472
|
type: "(\n item: Omit<Item, 'id' | 'meta'>,\n ) => Promise<Record<string, unknown>>",
|
|
1404
1473
|
},
|
|
1405
1474
|
saveCurrentItem: {
|
|
1406
1475
|
comment: {
|
|
1407
|
-
|
|
1476
|
+
markdownText: 'Triggers a submit form for current record.',
|
|
1408
1477
|
example: 'await ctx.saveCurrentItem();',
|
|
1409
1478
|
},
|
|
1410
1479
|
location: {
|
|
1411
1480
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
1412
|
-
lineNumber:
|
|
1481
|
+
lineNumber: 157,
|
|
1413
1482
|
},
|
|
1414
1483
|
type: '(showToast?: boolean) => Promise<void>',
|
|
1415
1484
|
},
|
|
@@ -1426,8 +1495,8 @@ export const manifest: Manifest = {
|
|
|
1426
1495
|
renderConfigScreen: {
|
|
1427
1496
|
name: 'renderConfigScreen',
|
|
1428
1497
|
comment: {
|
|
1429
|
-
|
|
1430
|
-
"This function will be called when the plugin needs to render the plugin's\nconfiguration form",
|
|
1498
|
+
markdownText:
|
|
1499
|
+
"This function will be called when the plugin needs to render the plugin's\nconfiguration form.",
|
|
1431
1500
|
tag: 'configScreen',
|
|
1432
1501
|
},
|
|
1433
1502
|
nonCtxArguments: [],
|
|
@@ -1445,7 +1514,7 @@ export const manifest: Manifest = {
|
|
|
1445
1514
|
renderAssetSource: {
|
|
1446
1515
|
name: 'renderAssetSource',
|
|
1447
1516
|
comment: {
|
|
1448
|
-
|
|
1517
|
+
markdownText:
|
|
1449
1518
|
"This function will be called when the user selects one of the plugin's\nasset sources to upload a new media file.",
|
|
1450
1519
|
tag: 'assetSources',
|
|
1451
1520
|
},
|
|
@@ -1462,8 +1531,8 @@ export const manifest: Manifest = {
|
|
|
1462
1531
|
items: {
|
|
1463
1532
|
assetSourceId: {
|
|
1464
1533
|
comment: {
|
|
1465
|
-
|
|
1466
|
-
'The ID of the assetSource that needs to be rendered',
|
|
1534
|
+
markdownText:
|
|
1535
|
+
'The ID of the assetSource that needs to be rendered.',
|
|
1467
1536
|
},
|
|
1468
1537
|
location: {
|
|
1469
1538
|
filePath: 'src/hooks/renderAssetSource.ts',
|
|
@@ -1479,7 +1548,7 @@ export const manifest: Manifest = {
|
|
|
1479
1548
|
items: {
|
|
1480
1549
|
select: {
|
|
1481
1550
|
comment: {
|
|
1482
|
-
|
|
1551
|
+
markdownText:
|
|
1483
1552
|
'Function to be called when the user selects the asset: it will trigger the\ncreation of a new `Upload` that will be added in the Media Area.',
|
|
1484
1553
|
example:
|
|
1485
1554
|
"await ctx.select({\n resource: {\n url: 'https://images.unsplash.com/photo-1416339306562-f3d12fefd36f',\n filename: 'man-drinking-coffee.jpg',\n },\n copyright: 'Royalty free (Unsplash)',\n author: 'Jeff Sheldon',\n notes: 'A man drinking a coffee',\n tags: ['man', 'coffee'],\n});",
|
|
@@ -1503,8 +1572,8 @@ export const manifest: Manifest = {
|
|
|
1503
1572
|
overrideFieldExtensions: {
|
|
1504
1573
|
name: 'overrideFieldExtensions',
|
|
1505
1574
|
comment: {
|
|
1506
|
-
|
|
1507
|
-
'Use this function to automatically force one or more field extensions to a\nparticular field',
|
|
1575
|
+
markdownText:
|
|
1576
|
+
'Use this function to automatically force one or more field extensions to a\nparticular field.',
|
|
1508
1577
|
tag: 'forcedFieldExtensions',
|
|
1509
1578
|
},
|
|
1510
1579
|
nonCtxArguments: [
|
|
@@ -1539,7 +1608,7 @@ export const manifest: Manifest = {
|
|
|
1539
1608
|
onBoot: {
|
|
1540
1609
|
name: 'onBoot',
|
|
1541
1610
|
comment: {
|
|
1542
|
-
|
|
1611
|
+
markdownText:
|
|
1543
1612
|
'This function will be called once at boot time and can be used to perform\nie. some initial integrity checks on the configuration.',
|
|
1544
1613
|
tag: 'boot',
|
|
1545
1614
|
},
|
|
@@ -1558,8 +1627,8 @@ export const manifest: Manifest = {
|
|
|
1558
1627
|
onBeforeItemsUnpublish: {
|
|
1559
1628
|
name: 'onBeforeItemsUnpublish',
|
|
1560
1629
|
comment: {
|
|
1561
|
-
|
|
1562
|
-
'This function will be called before unpublishing records. You can stop the\naction by returning `false
|
|
1630
|
+
markdownText:
|
|
1631
|
+
'This function will be called before unpublishing records. You can stop the\naction by returning `false`.',
|
|
1563
1632
|
tag: 'beforeHooks',
|
|
1564
1633
|
},
|
|
1565
1634
|
nonCtxArguments: [
|
|
@@ -1582,8 +1651,8 @@ export const manifest: Manifest = {
|
|
|
1582
1651
|
onBeforeItemsPublish: {
|
|
1583
1652
|
name: 'onBeforeItemsPublish',
|
|
1584
1653
|
comment: {
|
|
1585
|
-
|
|
1586
|
-
'This function will be called before publishing records. You can stop the\naction by returning `false
|
|
1654
|
+
markdownText:
|
|
1655
|
+
'This function will be called before publishing records. You can stop the\naction by returning `false`.',
|
|
1587
1656
|
tag: 'beforeHooks',
|
|
1588
1657
|
},
|
|
1589
1658
|
nonCtxArguments: [
|
|
@@ -1606,8 +1675,8 @@ export const manifest: Manifest = {
|
|
|
1606
1675
|
onBeforeItemsDestroy: {
|
|
1607
1676
|
name: 'onBeforeItemsDestroy',
|
|
1608
1677
|
comment: {
|
|
1609
|
-
|
|
1610
|
-
'This function will be called before destroying records. You can stop the\naction by returning `false
|
|
1678
|
+
markdownText:
|
|
1679
|
+
'This function will be called before destroying records. You can stop the\naction by returning `false`.',
|
|
1611
1680
|
tag: 'beforeHooks',
|
|
1612
1681
|
},
|
|
1613
1682
|
nonCtxArguments: [
|
|
@@ -1630,8 +1699,8 @@ export const manifest: Manifest = {
|
|
|
1630
1699
|
onBeforeItemUpsert: {
|
|
1631
1700
|
name: 'onBeforeItemUpsert',
|
|
1632
1701
|
comment: {
|
|
1633
|
-
|
|
1634
|
-
'This function will be called before saving a new version of a record. You\ncan stop the action by returning `false
|
|
1702
|
+
markdownText:
|
|
1703
|
+
'This function will be called before saving a new version of a record. You\ncan stop the action by returning `false`.',
|
|
1635
1704
|
tag: 'beforeHooks',
|
|
1636
1705
|
},
|
|
1637
1706
|
nonCtxArguments: [
|
|
@@ -1654,8 +1723,8 @@ export const manifest: Manifest = {
|
|
|
1654
1723
|
manualFieldExtensions: {
|
|
1655
1724
|
name: 'manualFieldExtensions',
|
|
1656
1725
|
comment: {
|
|
1657
|
-
|
|
1658
|
-
'Use this function to declare new field extensions that users will be able\nto install manually in some field',
|
|
1726
|
+
markdownText:
|
|
1727
|
+
'Use this function to declare new field extensions that users will be able\nto install manually in some field.',
|
|
1659
1728
|
tag: 'manualFieldExtensions',
|
|
1660
1729
|
},
|
|
1661
1730
|
nonCtxArguments: [],
|
|
@@ -1673,8 +1742,8 @@ export const manifest: Manifest = {
|
|
|
1673
1742
|
mainNavigationTabs: {
|
|
1674
1743
|
name: 'mainNavigationTabs',
|
|
1675
1744
|
comment: {
|
|
1676
|
-
|
|
1677
|
-
'Use this function to declare new tabs you want to add in the top-bar of the\nUI',
|
|
1745
|
+
markdownText:
|
|
1746
|
+
'Use this function to declare new tabs you want to add in the top-bar of the\nUI.',
|
|
1678
1747
|
tag: 'pages',
|
|
1679
1748
|
},
|
|
1680
1749
|
nonCtxArguments: [],
|
|
@@ -1692,7 +1761,7 @@ export const manifest: Manifest = {
|
|
|
1692
1761
|
itemsDropdownActions: {
|
|
1693
1762
|
name: 'itemsDropdownActions',
|
|
1694
1763
|
comment: {
|
|
1695
|
-
|
|
1764
|
+
markdownText:
|
|
1696
1765
|
'This function lets you set up custom actions (or groups of actions) that\nshow up when the user:\n\n* selects multiple records in the collection view for batch operations, or\n* starts editing a specific record.\n\nThe `executeItemsDropdownAction()` hook will be triggered once the user\nclicks on one of the defined actions.',
|
|
1697
1766
|
tag: 'dropdownActions',
|
|
1698
1767
|
},
|
|
@@ -1728,8 +1797,8 @@ export const manifest: Manifest = {
|
|
|
1728
1797
|
itemFormSidebars: {
|
|
1729
1798
|
name: 'itemFormSidebars',
|
|
1730
1799
|
comment: {
|
|
1731
|
-
|
|
1732
|
-
'Use this function to declare new sidebar to be shown when the user edits\nrecords of a particular model',
|
|
1800
|
+
markdownText:
|
|
1801
|
+
'Use this function to declare new sidebar to be shown when the user edits\nrecords of a particular model.',
|
|
1733
1802
|
tag: 'sidebarPanels',
|
|
1734
1803
|
},
|
|
1735
1804
|
nonCtxArguments: [
|
|
@@ -1752,8 +1821,8 @@ export const manifest: Manifest = {
|
|
|
1752
1821
|
itemFormSidebarPanels: {
|
|
1753
1822
|
name: 'itemFormSidebarPanels',
|
|
1754
1823
|
comment: {
|
|
1755
|
-
|
|
1756
|
-
'Use this function to declare new sidebar panels to be shown when the user\nedits records of a particular model',
|
|
1824
|
+
markdownText:
|
|
1825
|
+
'Use this function to declare new sidebar panels to be shown when the user\nedits records of a particular model.',
|
|
1757
1826
|
tag: 'sidebarPanels',
|
|
1758
1827
|
},
|
|
1759
1828
|
nonCtxArguments: [
|
|
@@ -1776,8 +1845,8 @@ export const manifest: Manifest = {
|
|
|
1776
1845
|
itemFormOutlets: {
|
|
1777
1846
|
name: 'itemFormOutlets',
|
|
1778
1847
|
comment: {
|
|
1779
|
-
|
|
1780
|
-
"Use this function to declare custom outlets to be shown at the top of the\nrecord's editing page",
|
|
1848
|
+
markdownText:
|
|
1849
|
+
"Use this function to declare custom outlets to be shown at the top of the\nrecord's editing page.",
|
|
1781
1850
|
tag: 'outlets',
|
|
1782
1851
|
},
|
|
1783
1852
|
nonCtxArguments: [
|
|
@@ -1800,7 +1869,7 @@ export const manifest: Manifest = {
|
|
|
1800
1869
|
itemFormDropdownActions: {
|
|
1801
1870
|
name: 'itemFormDropdownActions',
|
|
1802
1871
|
comment: {
|
|
1803
|
-
|
|
1872
|
+
markdownText:
|
|
1804
1873
|
'Use this function to define custom actions (or groups of actions) to be\ndisplayed at when editing a particular record.\n\nThe `executeItemFormDropdownAction()` hook will be triggered once the user\nclicks on one of the defined actions.',
|
|
1805
1874
|
tag: 'dropdownActions',
|
|
1806
1875
|
},
|
|
@@ -1814,10 +1883,15 @@ export const manifest: Manifest = {
|
|
|
1814
1883
|
type: 'Ctx',
|
|
1815
1884
|
additionalProperties: [
|
|
1816
1885
|
{
|
|
1886
|
+
name: 'ItemFormAdditionalProperties',
|
|
1887
|
+
comment: {
|
|
1888
|
+
markdownText:
|
|
1889
|
+
"These information describe the current state of the form that's being shown\nto the end-user to edit a record.",
|
|
1890
|
+
},
|
|
1817
1891
|
items: {
|
|
1818
1892
|
locale: {
|
|
1819
1893
|
comment: {
|
|
1820
|
-
|
|
1894
|
+
markdownText: 'The currently active locale for the record.',
|
|
1821
1895
|
},
|
|
1822
1896
|
location: {
|
|
1823
1897
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -1827,8 +1901,8 @@ export const manifest: Manifest = {
|
|
|
1827
1901
|
},
|
|
1828
1902
|
item: {
|
|
1829
1903
|
comment: {
|
|
1830
|
-
|
|
1831
|
-
'If an already persisted record is being edited, returns the full record\nentity',
|
|
1904
|
+
markdownText:
|
|
1905
|
+
'If an already persisted record is being edited, returns the full record\nentity.',
|
|
1832
1906
|
},
|
|
1833
1907
|
location: {
|
|
1834
1908
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -1838,7 +1912,7 @@ export const manifest: Manifest = {
|
|
|
1838
1912
|
},
|
|
1839
1913
|
itemType: {
|
|
1840
1914
|
comment: {
|
|
1841
|
-
|
|
1915
|
+
markdownText: 'The model for the record being edited.',
|
|
1842
1916
|
},
|
|
1843
1917
|
location: {
|
|
1844
1918
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -1848,7 +1922,7 @@ export const manifest: Manifest = {
|
|
|
1848
1922
|
},
|
|
1849
1923
|
formValues: {
|
|
1850
1924
|
comment: {
|
|
1851
|
-
|
|
1925
|
+
markdownText: 'The complete internal form state.',
|
|
1852
1926
|
},
|
|
1853
1927
|
location: {
|
|
1854
1928
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -1858,7 +1932,8 @@ export const manifest: Manifest = {
|
|
|
1858
1932
|
},
|
|
1859
1933
|
itemStatus: {
|
|
1860
1934
|
comment: {
|
|
1861
|
-
|
|
1935
|
+
markdownText:
|
|
1936
|
+
'The current status of the record being edited.',
|
|
1862
1937
|
},
|
|
1863
1938
|
location: {
|
|
1864
1939
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -1868,8 +1943,8 @@ export const manifest: Manifest = {
|
|
|
1868
1943
|
},
|
|
1869
1944
|
isSubmitting: {
|
|
1870
1945
|
comment: {
|
|
1871
|
-
|
|
1872
|
-
'Whether the form is currently submitting itself or not',
|
|
1946
|
+
markdownText:
|
|
1947
|
+
'Whether the form is currently submitting itself or not.',
|
|
1873
1948
|
},
|
|
1874
1949
|
location: {
|
|
1875
1950
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -1879,8 +1954,8 @@ export const manifest: Manifest = {
|
|
|
1879
1954
|
},
|
|
1880
1955
|
isFormDirty: {
|
|
1881
1956
|
comment: {
|
|
1882
|
-
|
|
1883
|
-
'Whether the form has some non-persisted changes or not',
|
|
1957
|
+
markdownText:
|
|
1958
|
+
'Whether the form has some non-persisted changes or not.',
|
|
1884
1959
|
},
|
|
1885
1960
|
location: {
|
|
1886
1961
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -1890,13 +1965,14 @@ export const manifest: Manifest = {
|
|
|
1890
1965
|
},
|
|
1891
1966
|
blocksAnalysis: {
|
|
1892
1967
|
comment: {
|
|
1893
|
-
|
|
1968
|
+
markdownText:
|
|
1969
|
+
'Provides information on how many blocks are currently present in the form.',
|
|
1894
1970
|
},
|
|
1895
1971
|
location: {
|
|
1896
1972
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
1897
1973
|
lineNumber: 29,
|
|
1898
1974
|
},
|
|
1899
|
-
type: '
|
|
1975
|
+
type: 'BlocksAnalysis',
|
|
1900
1976
|
},
|
|
1901
1977
|
},
|
|
1902
1978
|
},
|
|
@@ -1912,8 +1988,8 @@ export const manifest: Manifest = {
|
|
|
1912
1988
|
itemCollectionOutlets: {
|
|
1913
1989
|
name: 'itemCollectionOutlets',
|
|
1914
1990
|
comment: {
|
|
1915
|
-
|
|
1916
|
-
'Use this function to declare custom outlets to be shown at the top of a\ncollection of records of a particular model',
|
|
1991
|
+
markdownText:
|
|
1992
|
+
'Use this function to declare custom outlets to be shown at the top of a\ncollection of records of a particular model.',
|
|
1917
1993
|
tag: 'outlets',
|
|
1918
1994
|
},
|
|
1919
1995
|
nonCtxArguments: [
|
|
@@ -1936,8 +2012,8 @@ export const manifest: Manifest = {
|
|
|
1936
2012
|
initialLocationQueryForItemSelector: {
|
|
1937
2013
|
name: 'initialLocationQueryForItemSelector',
|
|
1938
2014
|
comment: {
|
|
1939
|
-
|
|
1940
|
-
'Use this function to customize the initial filters when opening a record\nselector via a "Single link" or "Multiple links" field',
|
|
2015
|
+
markdownText:
|
|
2016
|
+
'Use this function to customize the initial filters when opening a record\nselector via a "Single link" or "Multiple links" field.',
|
|
1941
2017
|
tag: 'locationQuery',
|
|
1942
2018
|
},
|
|
1943
2019
|
nonCtxArguments: [
|
|
@@ -1965,7 +2041,7 @@ export const manifest: Manifest = {
|
|
|
1965
2041
|
fieldDropdownActions: {
|
|
1966
2042
|
name: 'fieldDropdownActions',
|
|
1967
2043
|
comment: {
|
|
1968
|
-
|
|
2044
|
+
markdownText:
|
|
1969
2045
|
'Use this function to define custom actions (or groups of actions) to be\ndisplayed at the individual field level in the record editing form.\n\nThe `executeFieldDropdownAction()` hook will be triggered once the user\nclicks on one of the defined actions.',
|
|
1970
2046
|
tag: 'dropdownActions',
|
|
1971
2047
|
},
|
|
@@ -1979,10 +2055,15 @@ export const manifest: Manifest = {
|
|
|
1979
2055
|
type: 'Ctx',
|
|
1980
2056
|
additionalProperties: [
|
|
1981
2057
|
{
|
|
2058
|
+
name: 'ItemFormAdditionalProperties',
|
|
2059
|
+
comment: {
|
|
2060
|
+
markdownText:
|
|
2061
|
+
"These information describe the current state of the form that's being shown\nto the end-user to edit a record.",
|
|
2062
|
+
},
|
|
1982
2063
|
items: {
|
|
1983
2064
|
locale: {
|
|
1984
2065
|
comment: {
|
|
1985
|
-
|
|
2066
|
+
markdownText: 'The currently active locale for the record.',
|
|
1986
2067
|
},
|
|
1987
2068
|
location: {
|
|
1988
2069
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -1992,8 +2073,8 @@ export const manifest: Manifest = {
|
|
|
1992
2073
|
},
|
|
1993
2074
|
item: {
|
|
1994
2075
|
comment: {
|
|
1995
|
-
|
|
1996
|
-
'If an already persisted record is being edited, returns the full record\nentity',
|
|
2076
|
+
markdownText:
|
|
2077
|
+
'If an already persisted record is being edited, returns the full record\nentity.',
|
|
1997
2078
|
},
|
|
1998
2079
|
location: {
|
|
1999
2080
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2003,7 +2084,7 @@ export const manifest: Manifest = {
|
|
|
2003
2084
|
},
|
|
2004
2085
|
itemType: {
|
|
2005
2086
|
comment: {
|
|
2006
|
-
|
|
2087
|
+
markdownText: 'The model for the record being edited.',
|
|
2007
2088
|
},
|
|
2008
2089
|
location: {
|
|
2009
2090
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2013,7 +2094,7 @@ export const manifest: Manifest = {
|
|
|
2013
2094
|
},
|
|
2014
2095
|
formValues: {
|
|
2015
2096
|
comment: {
|
|
2016
|
-
|
|
2097
|
+
markdownText: 'The complete internal form state.',
|
|
2017
2098
|
},
|
|
2018
2099
|
location: {
|
|
2019
2100
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2023,7 +2104,8 @@ export const manifest: Manifest = {
|
|
|
2023
2104
|
},
|
|
2024
2105
|
itemStatus: {
|
|
2025
2106
|
comment: {
|
|
2026
|
-
|
|
2107
|
+
markdownText:
|
|
2108
|
+
'The current status of the record being edited.',
|
|
2027
2109
|
},
|
|
2028
2110
|
location: {
|
|
2029
2111
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2033,8 +2115,8 @@ export const manifest: Manifest = {
|
|
|
2033
2115
|
},
|
|
2034
2116
|
isSubmitting: {
|
|
2035
2117
|
comment: {
|
|
2036
|
-
|
|
2037
|
-
'Whether the form is currently submitting itself or not',
|
|
2118
|
+
markdownText:
|
|
2119
|
+
'Whether the form is currently submitting itself or not.',
|
|
2038
2120
|
},
|
|
2039
2121
|
location: {
|
|
2040
2122
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2044,8 +2126,8 @@ export const manifest: Manifest = {
|
|
|
2044
2126
|
},
|
|
2045
2127
|
isFormDirty: {
|
|
2046
2128
|
comment: {
|
|
2047
|
-
|
|
2048
|
-
'Whether the form has some non-persisted changes or not',
|
|
2129
|
+
markdownText:
|
|
2130
|
+
'Whether the form has some non-persisted changes or not.',
|
|
2049
2131
|
},
|
|
2050
2132
|
location: {
|
|
2051
2133
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2055,69 +2137,76 @@ export const manifest: Manifest = {
|
|
|
2055
2137
|
},
|
|
2056
2138
|
blocksAnalysis: {
|
|
2057
2139
|
comment: {
|
|
2058
|
-
|
|
2140
|
+
markdownText:
|
|
2141
|
+
'Provides information on how many blocks are currently present in the form.',
|
|
2059
2142
|
},
|
|
2060
2143
|
location: {
|
|
2061
2144
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2062
2145
|
lineNumber: 29,
|
|
2063
2146
|
},
|
|
2064
|
-
type: '
|
|
2147
|
+
type: 'BlocksAnalysis',
|
|
2065
2148
|
},
|
|
2066
2149
|
},
|
|
2067
2150
|
},
|
|
2068
2151
|
{
|
|
2152
|
+
name: 'FieldAdditionalProperties',
|
|
2153
|
+
comment: {
|
|
2154
|
+
markdownText:
|
|
2155
|
+
'These information describe the current state of the field where this plugin\nis applied to.',
|
|
2156
|
+
},
|
|
2069
2157
|
items: {
|
|
2070
2158
|
disabled: {
|
|
2071
2159
|
comment: {
|
|
2072
|
-
|
|
2160
|
+
markdownText:
|
|
2161
|
+
'Whether the field is currently disabled or not.',
|
|
2073
2162
|
},
|
|
2074
2163
|
location: {
|
|
2075
2164
|
filePath: 'src/ctx/commonExtras/field.ts',
|
|
2076
|
-
lineNumber:
|
|
2165
|
+
lineNumber: 12,
|
|
2077
2166
|
},
|
|
2078
2167
|
type: 'boolean',
|
|
2079
2168
|
},
|
|
2080
2169
|
fieldPath: {
|
|
2081
2170
|
comment: {
|
|
2082
|
-
|
|
2083
|
-
'The path in the `formValues` object where to find the current value for the\nfield',
|
|
2171
|
+
markdownText:
|
|
2172
|
+
'The path in the `formValues` object where to find the current value for the\nfield.',
|
|
2084
2173
|
},
|
|
2085
2174
|
location: {
|
|
2086
2175
|
filePath: 'src/ctx/commonExtras/field.ts',
|
|
2087
|
-
lineNumber:
|
|
2176
|
+
lineNumber: 17,
|
|
2088
2177
|
},
|
|
2089
2178
|
type: 'string',
|
|
2090
2179
|
},
|
|
2091
2180
|
field: {
|
|
2092
2181
|
comment: {
|
|
2093
|
-
|
|
2094
|
-
'The field where the field extension is installed to',
|
|
2182
|
+
markdownText:
|
|
2183
|
+
'The field where the field extension is installed to.',
|
|
2095
2184
|
},
|
|
2096
2185
|
location: {
|
|
2097
2186
|
filePath: 'src/ctx/commonExtras/field.ts',
|
|
2098
|
-
lineNumber:
|
|
2187
|
+
lineNumber: 19,
|
|
2099
2188
|
},
|
|
2100
2189
|
type: 'Field',
|
|
2101
2190
|
},
|
|
2102
2191
|
parentField: {
|
|
2103
2192
|
comment: {
|
|
2104
|
-
|
|
2105
|
-
'If the field extension is installed in a field of a block, returns the top\nlevel Modular Content/Structured Text field containing the block itself',
|
|
2193
|
+
markdownText:
|
|
2194
|
+
'If the field extension is installed in a field of a block, returns the top\nlevel Modular Content/Structured Text field containing the block itself.',
|
|
2106
2195
|
},
|
|
2107
2196
|
location: {
|
|
2108
2197
|
filePath: 'src/ctx/commonExtras/field.ts',
|
|
2109
|
-
lineNumber:
|
|
2198
|
+
lineNumber: 24,
|
|
2110
2199
|
},
|
|
2111
2200
|
type: 'Field | undefined',
|
|
2112
2201
|
},
|
|
2113
2202
|
block: {
|
|
2114
2203
|
comment: {
|
|
2115
|
-
|
|
2204
|
+
markdownText:
|
|
2116
2205
|
'If the field extension is installed in a field of a block, returns the ID\nof the block — or `undefined` if the block is still not persisted — and the\nblock model.',
|
|
2117
2206
|
},
|
|
2118
2207
|
location: {
|
|
2119
2208
|
filePath: 'src/ctx/commonExtras/field.ts',
|
|
2120
|
-
lineNumber:
|
|
2209
|
+
lineNumber: 30,
|
|
2121
2210
|
},
|
|
2122
2211
|
type: 'undefined | { id: string | undefined; blockModel: ItemType }',
|
|
2123
2212
|
},
|
|
@@ -2135,7 +2224,7 @@ export const manifest: Manifest = {
|
|
|
2135
2224
|
executeUploadsDropdownAction: {
|
|
2136
2225
|
name: 'executeUploadsDropdownAction',
|
|
2137
2226
|
comment: {
|
|
2138
|
-
|
|
2227
|
+
markdownText:
|
|
2139
2228
|
'Use this function to execute a particular dropdown action defined via\nthe `uploadsDropdownActions()` hook.',
|
|
2140
2229
|
tag: 'dropdownActions',
|
|
2141
2230
|
},
|
|
@@ -2175,7 +2264,7 @@ export const manifest: Manifest = {
|
|
|
2175
2264
|
executeItemsDropdownAction: {
|
|
2176
2265
|
name: 'executeItemsDropdownAction',
|
|
2177
2266
|
comment: {
|
|
2178
|
-
|
|
2267
|
+
markdownText:
|
|
2179
2268
|
'Use this function to execute a particular dropdown action defined via\nthe `itemsDropdownActions()` hook.',
|
|
2180
2269
|
tag: 'dropdownActions',
|
|
2181
2270
|
},
|
|
@@ -2215,7 +2304,7 @@ export const manifest: Manifest = {
|
|
|
2215
2304
|
executeItemFormDropdownAction: {
|
|
2216
2305
|
name: 'executeItemFormDropdownAction',
|
|
2217
2306
|
comment: {
|
|
2218
|
-
|
|
2307
|
+
markdownText:
|
|
2219
2308
|
'Use this function to execute a particular dropdown action defined via\nthe `itemFormDropdownActions()` hook.',
|
|
2220
2309
|
tag: 'dropdownActions',
|
|
2221
2310
|
},
|
|
@@ -2229,10 +2318,15 @@ export const manifest: Manifest = {
|
|
|
2229
2318
|
type: 'Ctx',
|
|
2230
2319
|
additionalProperties: [
|
|
2231
2320
|
{
|
|
2321
|
+
name: 'ItemFormAdditionalProperties',
|
|
2322
|
+
comment: {
|
|
2323
|
+
markdownText:
|
|
2324
|
+
"These information describe the current state of the form that's being shown\nto the end-user to edit a record.",
|
|
2325
|
+
},
|
|
2232
2326
|
items: {
|
|
2233
2327
|
locale: {
|
|
2234
2328
|
comment: {
|
|
2235
|
-
|
|
2329
|
+
markdownText: 'The currently active locale for the record.',
|
|
2236
2330
|
},
|
|
2237
2331
|
location: {
|
|
2238
2332
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2242,8 +2336,8 @@ export const manifest: Manifest = {
|
|
|
2242
2336
|
},
|
|
2243
2337
|
item: {
|
|
2244
2338
|
comment: {
|
|
2245
|
-
|
|
2246
|
-
'If an already persisted record is being edited, returns the full record\nentity',
|
|
2339
|
+
markdownText:
|
|
2340
|
+
'If an already persisted record is being edited, returns the full record\nentity.',
|
|
2247
2341
|
},
|
|
2248
2342
|
location: {
|
|
2249
2343
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2253,7 +2347,7 @@ export const manifest: Manifest = {
|
|
|
2253
2347
|
},
|
|
2254
2348
|
itemType: {
|
|
2255
2349
|
comment: {
|
|
2256
|
-
|
|
2350
|
+
markdownText: 'The model for the record being edited.',
|
|
2257
2351
|
},
|
|
2258
2352
|
location: {
|
|
2259
2353
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2263,7 +2357,7 @@ export const manifest: Manifest = {
|
|
|
2263
2357
|
},
|
|
2264
2358
|
formValues: {
|
|
2265
2359
|
comment: {
|
|
2266
|
-
|
|
2360
|
+
markdownText: 'The complete internal form state.',
|
|
2267
2361
|
},
|
|
2268
2362
|
location: {
|
|
2269
2363
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2273,7 +2367,8 @@ export const manifest: Manifest = {
|
|
|
2273
2367
|
},
|
|
2274
2368
|
itemStatus: {
|
|
2275
2369
|
comment: {
|
|
2276
|
-
|
|
2370
|
+
markdownText:
|
|
2371
|
+
'The current status of the record being edited.',
|
|
2277
2372
|
},
|
|
2278
2373
|
location: {
|
|
2279
2374
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2283,8 +2378,8 @@ export const manifest: Manifest = {
|
|
|
2283
2378
|
},
|
|
2284
2379
|
isSubmitting: {
|
|
2285
2380
|
comment: {
|
|
2286
|
-
|
|
2287
|
-
'Whether the form is currently submitting itself or not',
|
|
2381
|
+
markdownText:
|
|
2382
|
+
'Whether the form is currently submitting itself or not.',
|
|
2288
2383
|
},
|
|
2289
2384
|
location: {
|
|
2290
2385
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2294,8 +2389,8 @@ export const manifest: Manifest = {
|
|
|
2294
2389
|
},
|
|
2295
2390
|
isFormDirty: {
|
|
2296
2391
|
comment: {
|
|
2297
|
-
|
|
2298
|
-
'Whether the form has some non-persisted changes or not',
|
|
2392
|
+
markdownText:
|
|
2393
|
+
'Whether the form has some non-persisted changes or not.',
|
|
2299
2394
|
},
|
|
2300
2395
|
location: {
|
|
2301
2396
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2305,13 +2400,14 @@ export const manifest: Manifest = {
|
|
|
2305
2400
|
},
|
|
2306
2401
|
blocksAnalysis: {
|
|
2307
2402
|
comment: {
|
|
2308
|
-
|
|
2403
|
+
markdownText:
|
|
2404
|
+
'Provides information on how many blocks are currently present in the form.',
|
|
2309
2405
|
},
|
|
2310
2406
|
location: {
|
|
2311
2407
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2312
2408
|
lineNumber: 29,
|
|
2313
2409
|
},
|
|
2314
|
-
type: '
|
|
2410
|
+
type: 'BlocksAnalysis',
|
|
2315
2411
|
},
|
|
2316
2412
|
},
|
|
2317
2413
|
},
|
|
@@ -2329,89 +2425,96 @@ export const manifest: Manifest = {
|
|
|
2329
2425
|
],
|
|
2330
2426
|
additionalMethods: [
|
|
2331
2427
|
{
|
|
2428
|
+
name: 'ItemFormAdditionalMethods',
|
|
2429
|
+
comment: {
|
|
2430
|
+
markdownText:
|
|
2431
|
+
"These methods can be used to interact with the form that's being shown to the\nend-user to edit a record.",
|
|
2432
|
+
},
|
|
2332
2433
|
items: {
|
|
2333
2434
|
toggleField: {
|
|
2334
2435
|
comment: {
|
|
2335
|
-
|
|
2436
|
+
markdownText:
|
|
2336
2437
|
'Hides/shows a specific field in the form. Please be aware that when a field\nis hidden, the field editor for that field will be removed from the DOM\nitself, including any associated plugins. When it is shown again, its\nplugins will be reinitialized.',
|
|
2337
2438
|
example:
|
|
2338
2439
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.toggleField(fieldPath, true);",
|
|
2339
2440
|
},
|
|
2340
2441
|
location: {
|
|
2341
2442
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2342
|
-
lineNumber:
|
|
2443
|
+
lineNumber: 68,
|
|
2343
2444
|
},
|
|
2344
2445
|
type: '(path: string, show: boolean) => Promise<void>',
|
|
2345
2446
|
},
|
|
2346
2447
|
disableField: {
|
|
2347
2448
|
comment: {
|
|
2348
|
-
|
|
2449
|
+
markdownText:
|
|
2450
|
+
'Disables/re-enables a specific field in the form.',
|
|
2349
2451
|
example:
|
|
2350
2452
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.disableField(fieldPath, true);",
|
|
2351
2453
|
},
|
|
2352
2454
|
location: {
|
|
2353
2455
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2354
|
-
lineNumber:
|
|
2456
|
+
lineNumber: 83,
|
|
2355
2457
|
},
|
|
2356
2458
|
type: '(path: string, disable: boolean) => Promise<void>',
|
|
2357
2459
|
},
|
|
2358
2460
|
scrollToField: {
|
|
2359
2461
|
comment: {
|
|
2360
|
-
|
|
2462
|
+
markdownText:
|
|
2361
2463
|
'Smoothly navigates to a specific field in the form. If the field is\nlocalized it will switch language tab and then navigate to the chosen\nfield.',
|
|
2362
2464
|
example:
|
|
2363
2465
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.scrollToField(fieldPath);",
|
|
2364
2466
|
},
|
|
2365
2467
|
location: {
|
|
2366
2468
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2367
|
-
lineNumber:
|
|
2469
|
+
lineNumber: 100,
|
|
2368
2470
|
},
|
|
2369
2471
|
type: '(path: string, locale?: string) => Promise<void>',
|
|
2370
2472
|
},
|
|
2371
2473
|
setFieldValue: {
|
|
2372
2474
|
comment: {
|
|
2373
|
-
|
|
2475
|
+
markdownText:
|
|
2476
|
+
'Changes a specific path of the `formValues` object.',
|
|
2374
2477
|
example:
|
|
2375
2478
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.setFieldValue(fieldPath, 'new value');",
|
|
2376
2479
|
},
|
|
2377
2480
|
location: {
|
|
2378
2481
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2379
|
-
lineNumber:
|
|
2482
|
+
lineNumber: 115,
|
|
2380
2483
|
},
|
|
2381
2484
|
type: '(path: string, value: unknown) => Promise<void>',
|
|
2382
2485
|
},
|
|
2383
2486
|
formValuesToItem: {
|
|
2384
2487
|
comment: {
|
|
2385
|
-
|
|
2488
|
+
markdownText:
|
|
2386
2489
|
'Takes the internal form state, and transforms it into an Item entity\ncompatible with DatoCMS API.\n\nWhen `skipUnchangedFields`, only the fields that changed value will be\nserialized.\n\nIf the required nested blocks are still not loaded, this method will return\n`undefined`.',
|
|
2387
2490
|
example: 'await ctx.formValuesToItem(ctx.formValues, false);',
|
|
2388
2491
|
},
|
|
2389
2492
|
location: {
|
|
2390
2493
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2391
|
-
lineNumber:
|
|
2494
|
+
lineNumber: 132,
|
|
2392
2495
|
},
|
|
2393
2496
|
type: "(\n formValues: Record<string, unknown>,\n skipUnchangedFields?: boolean,\n ) => Promise<Omit<Item, 'id' | 'meta'> | undefined>",
|
|
2394
2497
|
},
|
|
2395
2498
|
itemToFormValues: {
|
|
2396
2499
|
comment: {
|
|
2397
|
-
|
|
2398
|
-
'Takes an Item entity, and converts it into the internal form state',
|
|
2500
|
+
markdownText:
|
|
2501
|
+
'Takes an Item entity, and converts it into the internal form state.',
|
|
2399
2502
|
example: 'await ctx.itemToFormValues(ctx.item);',
|
|
2400
2503
|
},
|
|
2401
2504
|
location: {
|
|
2402
2505
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2403
|
-
lineNumber:
|
|
2506
|
+
lineNumber: 145,
|
|
2404
2507
|
},
|
|
2405
2508
|
type: "(\n item: Omit<Item, 'id' | 'meta'>,\n ) => Promise<Record<string, unknown>>",
|
|
2406
2509
|
},
|
|
2407
2510
|
saveCurrentItem: {
|
|
2408
2511
|
comment: {
|
|
2409
|
-
|
|
2512
|
+
markdownText: 'Triggers a submit form for current record.',
|
|
2410
2513
|
example: 'await ctx.saveCurrentItem();',
|
|
2411
2514
|
},
|
|
2412
2515
|
location: {
|
|
2413
2516
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2414
|
-
lineNumber:
|
|
2517
|
+
lineNumber: 157,
|
|
2415
2518
|
},
|
|
2416
2519
|
type: '(showToast?: boolean) => Promise<void>',
|
|
2417
2520
|
},
|
|
@@ -2428,7 +2531,7 @@ export const manifest: Manifest = {
|
|
|
2428
2531
|
executeFieldDropdownAction: {
|
|
2429
2532
|
name: 'executeFieldDropdownAction',
|
|
2430
2533
|
comment: {
|
|
2431
|
-
|
|
2534
|
+
markdownText:
|
|
2432
2535
|
'Use this function to execute a particular dropdown action defined via\nthe `fieldDropdownActions()` hook.',
|
|
2433
2536
|
tag: 'dropdownActions',
|
|
2434
2537
|
},
|
|
@@ -2442,10 +2545,15 @@ export const manifest: Manifest = {
|
|
|
2442
2545
|
type: 'Ctx',
|
|
2443
2546
|
additionalProperties: [
|
|
2444
2547
|
{
|
|
2548
|
+
name: 'ItemFormAdditionalProperties',
|
|
2549
|
+
comment: {
|
|
2550
|
+
markdownText:
|
|
2551
|
+
"These information describe the current state of the form that's being shown\nto the end-user to edit a record.",
|
|
2552
|
+
},
|
|
2445
2553
|
items: {
|
|
2446
2554
|
locale: {
|
|
2447
2555
|
comment: {
|
|
2448
|
-
|
|
2556
|
+
markdownText: 'The currently active locale for the record.',
|
|
2449
2557
|
},
|
|
2450
2558
|
location: {
|
|
2451
2559
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2455,8 +2563,8 @@ export const manifest: Manifest = {
|
|
|
2455
2563
|
},
|
|
2456
2564
|
item: {
|
|
2457
2565
|
comment: {
|
|
2458
|
-
|
|
2459
|
-
'If an already persisted record is being edited, returns the full record\nentity',
|
|
2566
|
+
markdownText:
|
|
2567
|
+
'If an already persisted record is being edited, returns the full record\nentity.',
|
|
2460
2568
|
},
|
|
2461
2569
|
location: {
|
|
2462
2570
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2466,7 +2574,7 @@ export const manifest: Manifest = {
|
|
|
2466
2574
|
},
|
|
2467
2575
|
itemType: {
|
|
2468
2576
|
comment: {
|
|
2469
|
-
|
|
2577
|
+
markdownText: 'The model for the record being edited.',
|
|
2470
2578
|
},
|
|
2471
2579
|
location: {
|
|
2472
2580
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2476,7 +2584,7 @@ export const manifest: Manifest = {
|
|
|
2476
2584
|
},
|
|
2477
2585
|
formValues: {
|
|
2478
2586
|
comment: {
|
|
2479
|
-
|
|
2587
|
+
markdownText: 'The complete internal form state.',
|
|
2480
2588
|
},
|
|
2481
2589
|
location: {
|
|
2482
2590
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2486,7 +2594,8 @@ export const manifest: Manifest = {
|
|
|
2486
2594
|
},
|
|
2487
2595
|
itemStatus: {
|
|
2488
2596
|
comment: {
|
|
2489
|
-
|
|
2597
|
+
markdownText:
|
|
2598
|
+
'The current status of the record being edited.',
|
|
2490
2599
|
},
|
|
2491
2600
|
location: {
|
|
2492
2601
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2496,8 +2605,8 @@ export const manifest: Manifest = {
|
|
|
2496
2605
|
},
|
|
2497
2606
|
isSubmitting: {
|
|
2498
2607
|
comment: {
|
|
2499
|
-
|
|
2500
|
-
'Whether the form is currently submitting itself or not',
|
|
2608
|
+
markdownText:
|
|
2609
|
+
'Whether the form is currently submitting itself or not.',
|
|
2501
2610
|
},
|
|
2502
2611
|
location: {
|
|
2503
2612
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2507,8 +2616,8 @@ export const manifest: Manifest = {
|
|
|
2507
2616
|
},
|
|
2508
2617
|
isFormDirty: {
|
|
2509
2618
|
comment: {
|
|
2510
|
-
|
|
2511
|
-
'Whether the form has some non-persisted changes or not',
|
|
2619
|
+
markdownText:
|
|
2620
|
+
'Whether the form has some non-persisted changes or not.',
|
|
2512
2621
|
},
|
|
2513
2622
|
location: {
|
|
2514
2623
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
@@ -2518,69 +2627,76 @@ export const manifest: Manifest = {
|
|
|
2518
2627
|
},
|
|
2519
2628
|
blocksAnalysis: {
|
|
2520
2629
|
comment: {
|
|
2521
|
-
|
|
2630
|
+
markdownText:
|
|
2631
|
+
'Provides information on how many blocks are currently present in the form.',
|
|
2522
2632
|
},
|
|
2523
2633
|
location: {
|
|
2524
2634
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2525
2635
|
lineNumber: 29,
|
|
2526
2636
|
},
|
|
2527
|
-
type: '
|
|
2637
|
+
type: 'BlocksAnalysis',
|
|
2528
2638
|
},
|
|
2529
2639
|
},
|
|
2530
2640
|
},
|
|
2531
2641
|
{
|
|
2642
|
+
name: 'FieldAdditionalProperties',
|
|
2643
|
+
comment: {
|
|
2644
|
+
markdownText:
|
|
2645
|
+
'These information describe the current state of the field where this plugin\nis applied to.',
|
|
2646
|
+
},
|
|
2532
2647
|
items: {
|
|
2533
2648
|
disabled: {
|
|
2534
2649
|
comment: {
|
|
2535
|
-
|
|
2650
|
+
markdownText:
|
|
2651
|
+
'Whether the field is currently disabled or not.',
|
|
2536
2652
|
},
|
|
2537
2653
|
location: {
|
|
2538
2654
|
filePath: 'src/ctx/commonExtras/field.ts',
|
|
2539
|
-
lineNumber:
|
|
2655
|
+
lineNumber: 12,
|
|
2540
2656
|
},
|
|
2541
2657
|
type: 'boolean',
|
|
2542
2658
|
},
|
|
2543
2659
|
fieldPath: {
|
|
2544
2660
|
comment: {
|
|
2545
|
-
|
|
2546
|
-
'The path in the `formValues` object where to find the current value for the\nfield',
|
|
2661
|
+
markdownText:
|
|
2662
|
+
'The path in the `formValues` object where to find the current value for the\nfield.',
|
|
2547
2663
|
},
|
|
2548
2664
|
location: {
|
|
2549
2665
|
filePath: 'src/ctx/commonExtras/field.ts',
|
|
2550
|
-
lineNumber:
|
|
2666
|
+
lineNumber: 17,
|
|
2551
2667
|
},
|
|
2552
2668
|
type: 'string',
|
|
2553
2669
|
},
|
|
2554
2670
|
field: {
|
|
2555
2671
|
comment: {
|
|
2556
|
-
|
|
2557
|
-
'The field where the field extension is installed to',
|
|
2672
|
+
markdownText:
|
|
2673
|
+
'The field where the field extension is installed to.',
|
|
2558
2674
|
},
|
|
2559
2675
|
location: {
|
|
2560
2676
|
filePath: 'src/ctx/commonExtras/field.ts',
|
|
2561
|
-
lineNumber:
|
|
2677
|
+
lineNumber: 19,
|
|
2562
2678
|
},
|
|
2563
2679
|
type: 'Field',
|
|
2564
2680
|
},
|
|
2565
2681
|
parentField: {
|
|
2566
2682
|
comment: {
|
|
2567
|
-
|
|
2568
|
-
'If the field extension is installed in a field of a block, returns the top\nlevel Modular Content/Structured Text field containing the block itself',
|
|
2683
|
+
markdownText:
|
|
2684
|
+
'If the field extension is installed in a field of a block, returns the top\nlevel Modular Content/Structured Text field containing the block itself.',
|
|
2569
2685
|
},
|
|
2570
2686
|
location: {
|
|
2571
2687
|
filePath: 'src/ctx/commonExtras/field.ts',
|
|
2572
|
-
lineNumber:
|
|
2688
|
+
lineNumber: 24,
|
|
2573
2689
|
},
|
|
2574
2690
|
type: 'Field | undefined',
|
|
2575
2691
|
},
|
|
2576
2692
|
block: {
|
|
2577
2693
|
comment: {
|
|
2578
|
-
|
|
2694
|
+
markdownText:
|
|
2579
2695
|
'If the field extension is installed in a field of a block, returns the ID\nof the block — or `undefined` if the block is still not persisted — and the\nblock model.',
|
|
2580
2696
|
},
|
|
2581
2697
|
location: {
|
|
2582
2698
|
filePath: 'src/ctx/commonExtras/field.ts',
|
|
2583
|
-
lineNumber:
|
|
2699
|
+
lineNumber: 30,
|
|
2584
2700
|
},
|
|
2585
2701
|
type: 'undefined | { id: string | undefined; blockModel: ItemType }',
|
|
2586
2702
|
},
|
|
@@ -2600,89 +2716,96 @@ export const manifest: Manifest = {
|
|
|
2600
2716
|
],
|
|
2601
2717
|
additionalMethods: [
|
|
2602
2718
|
{
|
|
2719
|
+
name: 'ItemFormAdditionalMethods',
|
|
2720
|
+
comment: {
|
|
2721
|
+
markdownText:
|
|
2722
|
+
"These methods can be used to interact with the form that's being shown to the\nend-user to edit a record.",
|
|
2723
|
+
},
|
|
2603
2724
|
items: {
|
|
2604
2725
|
toggleField: {
|
|
2605
2726
|
comment: {
|
|
2606
|
-
|
|
2727
|
+
markdownText:
|
|
2607
2728
|
'Hides/shows a specific field in the form. Please be aware that when a field\nis hidden, the field editor for that field will be removed from the DOM\nitself, including any associated plugins. When it is shown again, its\nplugins will be reinitialized.',
|
|
2608
2729
|
example:
|
|
2609
2730
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.toggleField(fieldPath, true);",
|
|
2610
2731
|
},
|
|
2611
2732
|
location: {
|
|
2612
2733
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2613
|
-
lineNumber:
|
|
2734
|
+
lineNumber: 68,
|
|
2614
2735
|
},
|
|
2615
2736
|
type: '(path: string, show: boolean) => Promise<void>',
|
|
2616
2737
|
},
|
|
2617
2738
|
disableField: {
|
|
2618
2739
|
comment: {
|
|
2619
|
-
|
|
2740
|
+
markdownText:
|
|
2741
|
+
'Disables/re-enables a specific field in the form.',
|
|
2620
2742
|
example:
|
|
2621
2743
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.disableField(fieldPath, true);",
|
|
2622
2744
|
},
|
|
2623
2745
|
location: {
|
|
2624
2746
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2625
|
-
lineNumber:
|
|
2747
|
+
lineNumber: 83,
|
|
2626
2748
|
},
|
|
2627
2749
|
type: '(path: string, disable: boolean) => Promise<void>',
|
|
2628
2750
|
},
|
|
2629
2751
|
scrollToField: {
|
|
2630
2752
|
comment: {
|
|
2631
|
-
|
|
2753
|
+
markdownText:
|
|
2632
2754
|
'Smoothly navigates to a specific field in the form. If the field is\nlocalized it will switch language tab and then navigate to the chosen\nfield.',
|
|
2633
2755
|
example:
|
|
2634
2756
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.scrollToField(fieldPath);",
|
|
2635
2757
|
},
|
|
2636
2758
|
location: {
|
|
2637
2759
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2638
|
-
lineNumber:
|
|
2760
|
+
lineNumber: 100,
|
|
2639
2761
|
},
|
|
2640
2762
|
type: '(path: string, locale?: string) => Promise<void>',
|
|
2641
2763
|
},
|
|
2642
2764
|
setFieldValue: {
|
|
2643
2765
|
comment: {
|
|
2644
|
-
|
|
2766
|
+
markdownText:
|
|
2767
|
+
'Changes a specific path of the `formValues` object.',
|
|
2645
2768
|
example:
|
|
2646
2769
|
"const fieldPath = prompt(\n 'Please insert the path of a field in the form',\n ctx.fieldPath,\n);\n\nawait ctx.setFieldValue(fieldPath, 'new value');",
|
|
2647
2770
|
},
|
|
2648
2771
|
location: {
|
|
2649
2772
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2650
|
-
lineNumber:
|
|
2773
|
+
lineNumber: 115,
|
|
2651
2774
|
},
|
|
2652
2775
|
type: '(path: string, value: unknown) => Promise<void>',
|
|
2653
2776
|
},
|
|
2654
2777
|
formValuesToItem: {
|
|
2655
2778
|
comment: {
|
|
2656
|
-
|
|
2779
|
+
markdownText:
|
|
2657
2780
|
'Takes the internal form state, and transforms it into an Item entity\ncompatible with DatoCMS API.\n\nWhen `skipUnchangedFields`, only the fields that changed value will be\nserialized.\n\nIf the required nested blocks are still not loaded, this method will return\n`undefined`.',
|
|
2658
2781
|
example: 'await ctx.formValuesToItem(ctx.formValues, false);',
|
|
2659
2782
|
},
|
|
2660
2783
|
location: {
|
|
2661
2784
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2662
|
-
lineNumber:
|
|
2785
|
+
lineNumber: 132,
|
|
2663
2786
|
},
|
|
2664
2787
|
type: "(\n formValues: Record<string, unknown>,\n skipUnchangedFields?: boolean,\n ) => Promise<Omit<Item, 'id' | 'meta'> | undefined>",
|
|
2665
2788
|
},
|
|
2666
2789
|
itemToFormValues: {
|
|
2667
2790
|
comment: {
|
|
2668
|
-
|
|
2669
|
-
'Takes an Item entity, and converts it into the internal form state',
|
|
2791
|
+
markdownText:
|
|
2792
|
+
'Takes an Item entity, and converts it into the internal form state.',
|
|
2670
2793
|
example: 'await ctx.itemToFormValues(ctx.item);',
|
|
2671
2794
|
},
|
|
2672
2795
|
location: {
|
|
2673
2796
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2674
|
-
lineNumber:
|
|
2797
|
+
lineNumber: 145,
|
|
2675
2798
|
},
|
|
2676
2799
|
type: "(\n item: Omit<Item, 'id' | 'meta'>,\n ) => Promise<Record<string, unknown>>",
|
|
2677
2800
|
},
|
|
2678
2801
|
saveCurrentItem: {
|
|
2679
2802
|
comment: {
|
|
2680
|
-
|
|
2803
|
+
markdownText: 'Triggers a submit form for current record.',
|
|
2681
2804
|
example: 'await ctx.saveCurrentItem();',
|
|
2682
2805
|
},
|
|
2683
2806
|
location: {
|
|
2684
2807
|
filePath: 'src/ctx/commonExtras/itemForm.ts',
|
|
2685
|
-
lineNumber:
|
|
2808
|
+
lineNumber: 157,
|
|
2686
2809
|
},
|
|
2687
2810
|
type: '(showToast?: boolean) => Promise<void>',
|
|
2688
2811
|
},
|
|
@@ -2699,8 +2822,8 @@ export const manifest: Manifest = {
|
|
|
2699
2822
|
customMarksForStructuredTextField: {
|
|
2700
2823
|
name: 'customMarksForStructuredTextField',
|
|
2701
2824
|
comment: {
|
|
2702
|
-
|
|
2703
|
-
'Use this function to define a number of custom marks for a specific\nStructured Text field',
|
|
2825
|
+
markdownText:
|
|
2826
|
+
'Use this function to define a number of custom marks for a specific\nStructured Text field.',
|
|
2704
2827
|
tag: 'structuredText',
|
|
2705
2828
|
},
|
|
2706
2829
|
nonCtxArguments: [
|
|
@@ -2735,8 +2858,8 @@ export const manifest: Manifest = {
|
|
|
2735
2858
|
customBlockStylesForStructuredTextField: {
|
|
2736
2859
|
name: 'customBlockStylesForStructuredTextField',
|
|
2737
2860
|
comment: {
|
|
2738
|
-
|
|
2739
|
-
'Use this function to define a number of custom block styles for a specific\nStructured Text field',
|
|
2861
|
+
markdownText:
|
|
2862
|
+
'Use this function to define a number of custom block styles for a specific\nStructured Text field.',
|
|
2740
2863
|
tag: 'structuredText',
|
|
2741
2864
|
},
|
|
2742
2865
|
nonCtxArguments: [
|
|
@@ -2772,8 +2895,8 @@ export const manifest: Manifest = {
|
|
|
2772
2895
|
contentAreaSidebarItems: {
|
|
2773
2896
|
name: 'contentAreaSidebarItems',
|
|
2774
2897
|
comment: {
|
|
2775
|
-
|
|
2776
|
-
'Use this function to declare new items in the content area sidebar',
|
|
2898
|
+
markdownText:
|
|
2899
|
+
'Use this function to declare new items in the content area sidebar.',
|
|
2777
2900
|
tag: 'sidebarItems',
|
|
2778
2901
|
},
|
|
2779
2902
|
nonCtxArguments: [],
|
|
@@ -2791,8 +2914,8 @@ export const manifest: Manifest = {
|
|
|
2791
2914
|
buildItemPresentationInfo: {
|
|
2792
2915
|
name: 'buildItemPresentationInfo',
|
|
2793
2916
|
comment: {
|
|
2794
|
-
|
|
2795
|
-
'Use this function to customize the presentation of a record in records\ncollections and "Single link" or "Multiple links" field',
|
|
2917
|
+
markdownText:
|
|
2918
|
+
'Use this function to customize the presentation of a record in records\ncollections and "Single link" or "Multiple links" field.',
|
|
2796
2919
|
tag: 'presentation',
|
|
2797
2920
|
},
|
|
2798
2921
|
nonCtxArguments: [
|
|
@@ -2815,8 +2938,8 @@ export const manifest: Manifest = {
|
|
|
2815
2938
|
assetSources: {
|
|
2816
2939
|
name: 'assetSources',
|
|
2817
2940
|
comment: {
|
|
2818
|
-
|
|
2819
|
-
'Use this function to declare additional sources to be shown when users want\nto upload new assets',
|
|
2941
|
+
markdownText:
|
|
2942
|
+
'Use this function to declare additional sources to be shown when users want\nto upload new assets.',
|
|
2820
2943
|
tag: 'assetSources',
|
|
2821
2944
|
},
|
|
2822
2945
|
nonCtxArguments: [],
|
|
@@ -2837,13 +2960,13 @@ export const manifest: Manifest = {
|
|
|
2837
2960
|
{
|
|
2838
2961
|
name: 'PluginProperties',
|
|
2839
2962
|
comment: {
|
|
2840
|
-
|
|
2963
|
+
markdownText:
|
|
2841
2964
|
"Information about the current plugin. Useful to access the plugin's global\nconfiguration object.",
|
|
2842
2965
|
},
|
|
2843
2966
|
items: {
|
|
2844
2967
|
plugin: {
|
|
2845
2968
|
comment: {
|
|
2846
|
-
|
|
2969
|
+
markdownText: 'The current plugin.',
|
|
2847
2970
|
},
|
|
2848
2971
|
location: {
|
|
2849
2972
|
filePath: 'src/ctx/base.ts',
|
|
@@ -2856,12 +2979,12 @@ export const manifest: Manifest = {
|
|
|
2856
2979
|
{
|
|
2857
2980
|
name: 'AuthenticationProperties',
|
|
2858
2981
|
comment: {
|
|
2859
|
-
|
|
2982
|
+
markdownText: 'Information about the current user using the CMS.',
|
|
2860
2983
|
},
|
|
2861
2984
|
items: {
|
|
2862
2985
|
currentUser: {
|
|
2863
2986
|
comment: {
|
|
2864
|
-
|
|
2987
|
+
markdownText:
|
|
2865
2988
|
'The current DatoCMS user. It can either be the owner or one of the\ncollaborators (regular or SSO).',
|
|
2866
2989
|
},
|
|
2867
2990
|
location: {
|
|
@@ -2872,7 +2995,7 @@ export const manifest: Manifest = {
|
|
|
2872
2995
|
},
|
|
2873
2996
|
currentRole: {
|
|
2874
2997
|
comment: {
|
|
2875
|
-
|
|
2998
|
+
markdownText: 'The role for the current DatoCMS user.',
|
|
2876
2999
|
},
|
|
2877
3000
|
location: {
|
|
2878
3001
|
filePath: 'src/ctx/base.ts',
|
|
@@ -2882,8 +3005,8 @@ export const manifest: Manifest = {
|
|
|
2882
3005
|
},
|
|
2883
3006
|
currentUserAccessToken: {
|
|
2884
3007
|
comment: {
|
|
2885
|
-
|
|
2886
|
-
'The access token to perform API calls on behalf of the current user. Only\navailable if `currentUserAccessToken` additional permission is granted',
|
|
3008
|
+
markdownText:
|
|
3009
|
+
'The access token to perform API calls on behalf of the current user. Only\navailable if `currentUserAccessToken` additional permission is granted.',
|
|
2887
3010
|
},
|
|
2888
3011
|
location: {
|
|
2889
3012
|
filePath: 'src/ctx/base.ts',
|
|
@@ -2898,7 +3021,7 @@ export const manifest: Manifest = {
|
|
|
2898
3021
|
items: {
|
|
2899
3022
|
site: {
|
|
2900
3023
|
comment: {
|
|
2901
|
-
|
|
3024
|
+
markdownText: 'The current DatoCMS project.',
|
|
2902
3025
|
},
|
|
2903
3026
|
location: {
|
|
2904
3027
|
filePath: 'src/ctx/base.ts',
|
|
@@ -2908,7 +3031,7 @@ export const manifest: Manifest = {
|
|
|
2908
3031
|
},
|
|
2909
3032
|
environment: {
|
|
2910
3033
|
comment: {
|
|
2911
|
-
|
|
3034
|
+
markdownText: 'The ID of the current environment.',
|
|
2912
3035
|
},
|
|
2913
3036
|
location: {
|
|
2914
3037
|
filePath: 'src/ctx/base.ts',
|
|
@@ -2918,7 +3041,8 @@ export const manifest: Manifest = {
|
|
|
2918
3041
|
},
|
|
2919
3042
|
owner: {
|
|
2920
3043
|
comment: {
|
|
2921
|
-
|
|
3044
|
+
markdownText:
|
|
3045
|
+
'The account/organization that is the project owner.',
|
|
2922
3046
|
},
|
|
2923
3047
|
location: {
|
|
2924
3048
|
filePath: 'src/ctx/base.ts',
|
|
@@ -2928,7 +3052,9 @@ export const manifest: Manifest = {
|
|
|
2928
3052
|
},
|
|
2929
3053
|
account: {
|
|
2930
3054
|
comment: {
|
|
2931
|
-
|
|
3055
|
+
markdownText: 'The account that is the project owner.',
|
|
3056
|
+
deprecatedMarkdownText:
|
|
3057
|
+
'Please use `.owner` instead, as the project owner can also be\nan organization',
|
|
2932
3058
|
},
|
|
2933
3059
|
location: {
|
|
2934
3060
|
filePath: 'src/ctx/base.ts',
|
|
@@ -2938,8 +3064,8 @@ export const manifest: Manifest = {
|
|
|
2938
3064
|
},
|
|
2939
3065
|
ui: {
|
|
2940
3066
|
comment: {
|
|
2941
|
-
|
|
2942
|
-
'UI preferences of the current user (right now, only the preferred locale is\navailable)',
|
|
3067
|
+
markdownText:
|
|
3068
|
+
'UI preferences of the current user (right now, only the preferred locale is\navailable).',
|
|
2943
3069
|
},
|
|
2944
3070
|
location: {
|
|
2945
3071
|
filePath: 'src/ctx/base.ts',
|
|
@@ -2949,8 +3075,8 @@ export const manifest: Manifest = {
|
|
|
2949
3075
|
},
|
|
2950
3076
|
theme: {
|
|
2951
3077
|
comment: {
|
|
2952
|
-
|
|
2953
|
-
'An object containing the theme colors for the current DatoCMS project',
|
|
3078
|
+
markdownText:
|
|
3079
|
+
'An object containing the theme colors for the current DatoCMS project.',
|
|
2954
3080
|
},
|
|
2955
3081
|
location: {
|
|
2956
3082
|
filePath: 'src/ctx/base.ts',
|
|
@@ -2963,14 +3089,14 @@ export const manifest: Manifest = {
|
|
|
2963
3089
|
{
|
|
2964
3090
|
name: 'EntityReposProperties',
|
|
2965
3091
|
comment: {
|
|
2966
|
-
|
|
3092
|
+
markdownText:
|
|
2967
3093
|
'These properties provide access to "entity repos", that is, the collection of\nresources of a particular type that have been loaded by the CMS up to this\nmoment. The entity repos are objects, indexed by the ID of the entity itself.',
|
|
2968
3094
|
},
|
|
2969
3095
|
items: {
|
|
2970
3096
|
itemTypes: {
|
|
2971
3097
|
comment: {
|
|
2972
|
-
|
|
2973
|
-
'All the models of the current DatoCMS project, indexed by ID',
|
|
3098
|
+
markdownText:
|
|
3099
|
+
'All the models of the current DatoCMS project, indexed by ID.',
|
|
2974
3100
|
},
|
|
2975
3101
|
location: {
|
|
2976
3102
|
filePath: 'src/ctx/base.ts',
|
|
@@ -2980,7 +3106,7 @@ export const manifest: Manifest = {
|
|
|
2980
3106
|
},
|
|
2981
3107
|
fields: {
|
|
2982
3108
|
comment: {
|
|
2983
|
-
|
|
3109
|
+
markdownText:
|
|
2984
3110
|
'All the fields currently loaded for the current DatoCMS project, indexed by\nID. If some fields you need are not present, use the `loadItemTypeFields`\nfunction to load them.',
|
|
2985
3111
|
},
|
|
2986
3112
|
location: {
|
|
@@ -2991,7 +3117,7 @@ export const manifest: Manifest = {
|
|
|
2991
3117
|
},
|
|
2992
3118
|
fieldsets: {
|
|
2993
3119
|
comment: {
|
|
2994
|
-
|
|
3120
|
+
markdownText:
|
|
2995
3121
|
'All the fieldsets currently loaded for the current DatoCMS project, indexed\nby ID. If some fields you need are not present, use the\n`loadItemTypeFieldsets` function to load them.',
|
|
2996
3122
|
},
|
|
2997
3123
|
location: {
|
|
@@ -3002,7 +3128,7 @@ export const manifest: Manifest = {
|
|
|
3002
3128
|
},
|
|
3003
3129
|
users: {
|
|
3004
3130
|
comment: {
|
|
3005
|
-
|
|
3131
|
+
markdownText:
|
|
3006
3132
|
'All the regular users currently loaded for the current DatoCMS project,\nindexed by ID. It will always contain the current user. If some users you\nneed are not present, use the `loadUsers` function to load them.',
|
|
3007
3133
|
},
|
|
3008
3134
|
location: {
|
|
@@ -3013,7 +3139,7 @@ export const manifest: Manifest = {
|
|
|
3013
3139
|
},
|
|
3014
3140
|
ssoUsers: {
|
|
3015
3141
|
comment: {
|
|
3016
|
-
|
|
3142
|
+
markdownText:
|
|
3017
3143
|
'All the SSO users currently loaded for the current DatoCMS project, indexed\nby ID. It will always contain the current user. If some users you need are\nnot present, use the `loadSsoUsers` function to load them.',
|
|
3018
3144
|
},
|
|
3019
3145
|
location: {
|
|
@@ -3029,13 +3155,13 @@ export const manifest: Manifest = {
|
|
|
3029
3155
|
{
|
|
3030
3156
|
name: 'LoadDataMethods',
|
|
3031
3157
|
comment: {
|
|
3032
|
-
|
|
3033
|
-
'These methods can be used to asyncronously load additional information your\nplugin needs to work',
|
|
3158
|
+
markdownText:
|
|
3159
|
+
'These methods can be used to asyncronously load additional information your\nplugin needs to work.',
|
|
3034
3160
|
},
|
|
3035
3161
|
items: {
|
|
3036
3162
|
loadItemTypeFields: {
|
|
3037
3163
|
comment: {
|
|
3038
|
-
|
|
3164
|
+
markdownText:
|
|
3039
3165
|
'Loads all the fields for a specific model (or block). Fields will be\nreturned and will also be available in the the `fields` property.',
|
|
3040
3166
|
example:
|
|
3041
3167
|
"const itemTypeId = prompt('Please insert a model ID:');\n\nconst fields = await ctx.loadItemTypeFields(itemTypeId);\n\nctx.notice(\n `Success! ${fields\n .map((field) => field.attributes.api_key)\n .join(', ')}`,\n);",
|
|
@@ -3048,7 +3174,7 @@ export const manifest: Manifest = {
|
|
|
3048
3174
|
},
|
|
3049
3175
|
loadItemTypeFieldsets: {
|
|
3050
3176
|
comment: {
|
|
3051
|
-
|
|
3177
|
+
markdownText:
|
|
3052
3178
|
'Loads all the fieldsets for a specific model (or block). Fieldsets will be\nreturned and will also be available in the the `fieldsets` property.',
|
|
3053
3179
|
example:
|
|
3054
3180
|
"const itemTypeId = prompt('Please insert a model ID:');\n\nconst fieldsets = await ctx.loadItemTypeFieldsets(itemTypeId);\n\nctx.notice(\n `Success! ${fieldsets\n .map((fieldset) => fieldset.attributes.title)\n .join(', ')}`,\n);",
|
|
@@ -3061,7 +3187,7 @@ export const manifest: Manifest = {
|
|
|
3061
3187
|
},
|
|
3062
3188
|
loadFieldsUsingPlugin: {
|
|
3063
3189
|
comment: {
|
|
3064
|
-
|
|
3190
|
+
markdownText:
|
|
3065
3191
|
'Loads all the fields in the project that are currently using the plugin for\none of its manual field extensions.',
|
|
3066
3192
|
example:
|
|
3067
3193
|
"const fields = await ctx.loadFieldsUsingPlugin();\n\nctx.notice(\n `Success! ${fields\n .map((field) => field.attributes.api_key)\n .join(', ')}`,\n);",
|
|
@@ -3074,7 +3200,7 @@ export const manifest: Manifest = {
|
|
|
3074
3200
|
},
|
|
3075
3201
|
loadUsers: {
|
|
3076
3202
|
comment: {
|
|
3077
|
-
|
|
3203
|
+
markdownText:
|
|
3078
3204
|
'Loads all regular users. Users will be returned and will also be available\nin the the `users` property.',
|
|
3079
3205
|
example:
|
|
3080
3206
|
"const users = await ctx.loadUsers();\n\nctx.notice(`Success! ${users.map((user) => user.id).join(', ')}`);",
|
|
@@ -3087,7 +3213,7 @@ export const manifest: Manifest = {
|
|
|
3087
3213
|
},
|
|
3088
3214
|
loadSsoUsers: {
|
|
3089
3215
|
comment: {
|
|
3090
|
-
|
|
3216
|
+
markdownText:
|
|
3091
3217
|
'Loads all SSO users. Users will be returned and will also be available in\nthe the `ssoUsers` property.',
|
|
3092
3218
|
example:
|
|
3093
3219
|
"const users = await ctx.loadSsoUsers();\n\nctx.notice(`Success! ${users.map((user) => user.id).join(', ')}`);",
|
|
@@ -3103,13 +3229,13 @@ export const manifest: Manifest = {
|
|
|
3103
3229
|
{
|
|
3104
3230
|
name: 'UpdatePluginParametersMethods',
|
|
3105
3231
|
comment: {
|
|
3106
|
-
|
|
3232
|
+
markdownText:
|
|
3107
3233
|
'These methods can be used to update both plugin parameters and manual field\nextensions configuration.',
|
|
3108
3234
|
},
|
|
3109
3235
|
items: {
|
|
3110
3236
|
updatePluginParameters: {
|
|
3111
3237
|
comment: {
|
|
3112
|
-
|
|
3238
|
+
markdownText:
|
|
3113
3239
|
'Updates the plugin parameters.\n\nAlways check `ctx.currentRole.meta.final_permissions.can_edit_schema`\nbefore calling this, as the user might not have the permission to perform\nthe operation.',
|
|
3114
3240
|
example:
|
|
3115
3241
|
"await ctx.updatePluginParameters({ debugMode: true });\nawait ctx.notice('Plugin parameters successfully updated!');",
|
|
@@ -3122,7 +3248,7 @@ export const manifest: Manifest = {
|
|
|
3122
3248
|
},
|
|
3123
3249
|
updateFieldAppearance: {
|
|
3124
3250
|
comment: {
|
|
3125
|
-
|
|
3251
|
+
markdownText:
|
|
3126
3252
|
'Performs changes in the appearance of a field. You can install/remove a\nmanual field extension, or tweak their parameters. If multiple changes are\npassed, they will be applied sequencially.\n\nAlways check `ctx.currentRole.meta.final_permissions.can_edit_schema`\nbefore calling this, as the user might not have the permission to perform\nthe operation.',
|
|
3127
3253
|
example:
|
|
3128
3254
|
"const fields = await ctx.loadFieldsUsingPlugin();\n\nif (fields.length === 0) {\n ctx.alert('No field is using this plugin as a manual extension!');\n return;\n}\n\nfor (const field of fields) {\n const { appearance } = field.attributes;\n const operations = [];\n\n if (appearance.editor === ctx.plugin.id) {\n operations.push({\n operation: 'updateEditor',\n newParameters: {\n ...appearance.parameters,\n foo: 'bar',\n },\n });\n }\n\n appearance.addons.forEach((addon, i) => {\n if (addon.id !== ctx.plugin.id) {\n return;\n }\n\n operations.push({\n operation: 'updateAddon',\n index: i,\n newParameters: { ...addon.parameters, foo: 'bar' },\n });\n });\n\n await ctx.updateFieldAppearance(field.id, operations);\n ctx.notice(`Successfully edited field ${field.attributes.api_key}`);\n}",
|
|
@@ -3138,14 +3264,14 @@ export const manifest: Manifest = {
|
|
|
3138
3264
|
{
|
|
3139
3265
|
name: 'ToastMethods',
|
|
3140
3266
|
comment: {
|
|
3141
|
-
|
|
3142
|
-
'These methods can be used to show UI-consistent toast notifications to the\nend-user',
|
|
3267
|
+
markdownText:
|
|
3268
|
+
'These methods can be used to show UI-consistent toast notifications to the\nend-user.',
|
|
3143
3269
|
},
|
|
3144
3270
|
items: {
|
|
3145
3271
|
alert: {
|
|
3146
3272
|
comment: {
|
|
3147
|
-
|
|
3148
|
-
'Triggers an "error" toast displaying the selected message',
|
|
3273
|
+
markdownText:
|
|
3274
|
+
'Triggers an "error" toast displaying the selected message.',
|
|
3149
3275
|
example:
|
|
3150
3276
|
"const message = prompt(\n 'Please insert a message:',\n 'This is an alert message!',\n);\n\nawait ctx.alert(message);",
|
|
3151
3277
|
},
|
|
@@ -3157,8 +3283,8 @@ export const manifest: Manifest = {
|
|
|
3157
3283
|
},
|
|
3158
3284
|
notice: {
|
|
3159
3285
|
comment: {
|
|
3160
|
-
|
|
3161
|
-
'Triggers a "success" toast displaying the selected message',
|
|
3286
|
+
markdownText:
|
|
3287
|
+
'Triggers a "success" toast displaying the selected message.',
|
|
3162
3288
|
example:
|
|
3163
3289
|
"const message = prompt(\n 'Please insert a message:',\n 'This is a notice message!',\n);\n\nawait ctx.notice(message);",
|
|
3164
3290
|
},
|
|
@@ -3170,8 +3296,8 @@ export const manifest: Manifest = {
|
|
|
3170
3296
|
},
|
|
3171
3297
|
customToast: {
|
|
3172
3298
|
comment: {
|
|
3173
|
-
|
|
3174
|
-
'Triggers a custom toast displaying the selected message (and optionally a\nCTA)',
|
|
3299
|
+
markdownText:
|
|
3300
|
+
'Triggers a custom toast displaying the selected message (and optionally a\nCTA).',
|
|
3175
3301
|
example:
|
|
3176
3302
|
"const result = await ctx.customToast({\n type: 'warning',\n message: 'Just a sample warning notification!',\n dismissOnPageChange: true,\n dismissAfterTimeout: 5000,\n cta: {\n label: 'Execute call-to-action',\n value: 'cta',\n },\n});\n\nif (result === 'cta') {\n ctx.notice(`Clicked CTA!`);\n}",
|
|
3177
3303
|
},
|
|
@@ -3186,13 +3312,13 @@ export const manifest: Manifest = {
|
|
|
3186
3312
|
{
|
|
3187
3313
|
name: 'ItemDialogMethods',
|
|
3188
3314
|
comment: {
|
|
3189
|
-
|
|
3190
|
-
'These methods let you open the standard DatoCMS dialogs needed to interact\nwith records',
|
|
3315
|
+
markdownText:
|
|
3316
|
+
'These methods let you open the standard DatoCMS dialogs needed to interact\nwith records.',
|
|
3191
3317
|
},
|
|
3192
3318
|
items: {
|
|
3193
3319
|
createNewItem: {
|
|
3194
3320
|
comment: {
|
|
3195
|
-
|
|
3321
|
+
markdownText:
|
|
3196
3322
|
'Opens a dialog for creating a new record. It returns a promise resolved\nwith the newly created record or `null` if the user closes the dialog\nwithout creating anything.',
|
|
3197
3323
|
example:
|
|
3198
3324
|
"const itemTypeId = prompt('Please insert a model ID:');\n\nconst item = await ctx.createNewItem(itemTypeId);\n\nif (item) {\n ctx.notice(`Success! ${item.id}`);\n} else {\n ctx.alert('Closed!');\n}",
|
|
@@ -3205,7 +3331,7 @@ export const manifest: Manifest = {
|
|
|
3205
3331
|
},
|
|
3206
3332
|
selectItem: {
|
|
3207
3333
|
comment: {
|
|
3208
|
-
|
|
3334
|
+
markdownText:
|
|
3209
3335
|
'Opens a dialog for selecting one (or multiple) record(s) from a list of\nexisting records of type `itemTypeId`. It returns a promise resolved with\nthe selected record(s), or `null` if the user closes the dialog without\nchoosing any record.',
|
|
3210
3336
|
example:
|
|
3211
3337
|
"const itemTypeId = prompt('Please insert a model ID:');\n\nconst items = await ctx.selectItem(itemTypeId, { multiple: true });\n\nif (items) {\n ctx.notice(`Success! ${items.map((i) => i.id).join(', ')}`);\n} else {\n ctx.alert('Closed!');\n}",
|
|
@@ -3218,7 +3344,7 @@ export const manifest: Manifest = {
|
|
|
3218
3344
|
},
|
|
3219
3345
|
editItem: {
|
|
3220
3346
|
comment: {
|
|
3221
|
-
|
|
3347
|
+
markdownText:
|
|
3222
3348
|
'Opens a dialog for editing an existing record. It returns a promise\nresolved with the edited record, or `null` if the user closes the dialog\nwithout persisting any change.',
|
|
3223
3349
|
example:
|
|
3224
3350
|
"const itemId = prompt('Please insert a record ID:');\n\nconst item = await ctx.editItem(itemId);\n\nif (item) {\n ctx.notice(`Success! ${item.id}`);\n} else {\n ctx.alert('Closed!');\n}",
|
|
@@ -3234,13 +3360,13 @@ export const manifest: Manifest = {
|
|
|
3234
3360
|
{
|
|
3235
3361
|
name: 'UploadDialogMethods',
|
|
3236
3362
|
comment: {
|
|
3237
|
-
|
|
3238
|
-
'These methods let you open the standard DatoCMS dialogs needed to interact\nwith Media Area assets',
|
|
3363
|
+
markdownText:
|
|
3364
|
+
'These methods let you open the standard DatoCMS dialogs needed to interact\nwith Media Area assets.',
|
|
3239
3365
|
},
|
|
3240
3366
|
items: {
|
|
3241
3367
|
selectUpload: {
|
|
3242
3368
|
comment: {
|
|
3243
|
-
|
|
3369
|
+
markdownText:
|
|
3244
3370
|
'Opens a dialog for selecting one (or multiple) existing asset(s). It\nreturns a promise resolved with the selected asset(s), or `null` if the\nuser closes the dialog without selecting any upload.',
|
|
3245
3371
|
example:
|
|
3246
3372
|
"const item = await ctx.selectUpload({ multiple: false });\n\nif (item) {\n ctx.notice(`Success! ${item.id}`);\n} else {\n ctx.alert('Closed!');\n}",
|
|
@@ -3253,8 +3379,8 @@ export const manifest: Manifest = {
|
|
|
3253
3379
|
},
|
|
3254
3380
|
editUpload: {
|
|
3255
3381
|
comment: {
|
|
3256
|
-
|
|
3257
|
-
'Opens a dialog for editing a Media Area asset. It returns a promise\nresolved with:\n\n- The updated asset, if the user persists some changes to the asset itself\n- `null`, if the user closes the dialog without persisting any change\n- An asset structure with an additional `deleted` property set to true, if\n the user deletes the asset',
|
|
3382
|
+
markdownText:
|
|
3383
|
+
'Opens a dialog for editing a Media Area asset. It returns a promise\nresolved with:\n\n- The updated asset, if the user persists some changes to the asset itself\n- `null`, if the user closes the dialog without persisting any change\n- An asset structure with an additional `deleted` property set to true, if\n the user deletes the asset.',
|
|
3258
3384
|
example:
|
|
3259
3385
|
"const uploadId = prompt('Please insert an asset ID:');\n\nconst item = await ctx.editUpload(uploadId);\n\nif (item) {\n ctx.notice(`Success! ${item.id}`);\n} else {\n ctx.alert('Closed!');\n}",
|
|
3260
3386
|
},
|
|
@@ -3266,7 +3392,7 @@ export const manifest: Manifest = {
|
|
|
3266
3392
|
},
|
|
3267
3393
|
editUploadMetadata: {
|
|
3268
3394
|
comment: {
|
|
3269
|
-
|
|
3395
|
+
markdownText:
|
|
3270
3396
|
'Opens a dialog for editing a "single asset" field structure. It returns a\npromise resolved with the updated structure, or `null` if the user closes\nthe dialog without persisting any change.',
|
|
3271
3397
|
example:
|
|
3272
3398
|
"const uploadId = prompt('Please insert an asset ID:');\n\nconst result = await ctx.editUploadMetadata({\n upload_id: uploadId,\n alt: null,\n title: null,\n custom_data: {},\n focal_point: null,\n});\n\nif (result) {\n ctx.notice(`Success! ${JSON.stringify(result)}`);\n} else {\n ctx.alert('Closed!');\n}",
|
|
@@ -3282,14 +3408,14 @@ export const manifest: Manifest = {
|
|
|
3282
3408
|
{
|
|
3283
3409
|
name: 'CustomDialogMethods',
|
|
3284
3410
|
comment: {
|
|
3285
|
-
|
|
3286
|
-
'These methods can be used to open custom dialogs/confirmation panels',
|
|
3411
|
+
markdownText:
|
|
3412
|
+
'These methods can be used to open custom dialogs/confirmation panels.',
|
|
3287
3413
|
},
|
|
3288
3414
|
items: {
|
|
3289
3415
|
openModal: {
|
|
3290
3416
|
comment: {
|
|
3291
|
-
|
|
3292
|
-
'Opens a custom modal. Returns a promise resolved with what the modal itself\nreturns calling the `resolve()` function',
|
|
3417
|
+
markdownText:
|
|
3418
|
+
'Opens a custom modal. Returns a promise resolved with what the modal itself\nreturns calling the `resolve()` function.',
|
|
3293
3419
|
example:
|
|
3294
3420
|
"const result = await ctx.openModal({\n id: 'regular',\n title: 'Custom title!',\n width: 'l',\n parameters: { foo: 'bar' },\n});\n\nif (result) {\n ctx.notice(`Success! ${JSON.stringify(result)}`);\n} else {\n ctx.alert('Closed!');\n}",
|
|
3295
3421
|
},
|
|
@@ -3301,8 +3427,8 @@ export const manifest: Manifest = {
|
|
|
3301
3427
|
},
|
|
3302
3428
|
openConfirm: {
|
|
3303
3429
|
comment: {
|
|
3304
|
-
|
|
3305
|
-
'Opens a UI-consistent confirmation dialog. Returns a promise resolved with\nthe value of the choice made by the user',
|
|
3430
|
+
markdownText:
|
|
3431
|
+
'Opens a UI-consistent confirmation dialog. Returns a promise resolved with\nthe value of the choice made by the user.',
|
|
3306
3432
|
example:
|
|
3307
3433
|
"const result = await ctx.openConfirm({\n title: 'Custom title',\n content:\n 'Lorem Ipsum is simply dummy text of the printing and typesetting industry',\n choices: [\n {\n label: 'Positive',\n value: 'positive',\n intent: 'positive',\n },\n {\n label: 'Negative',\n value: 'negative',\n intent: 'negative',\n },\n ],\n cancel: {\n label: 'Cancel',\n value: false,\n },\n});\n\nif (result) {\n ctx.notice(`Success! ${result}`);\n} else {\n ctx.alert('Cancelled!');\n}",
|
|
3308
3434
|
},
|
|
@@ -3317,13 +3443,14 @@ export const manifest: Manifest = {
|
|
|
3317
3443
|
{
|
|
3318
3444
|
name: 'NavigateMethods',
|
|
3319
3445
|
comment: {
|
|
3320
|
-
|
|
3321
|
-
'These methods can be used to take the user to different pages',
|
|
3446
|
+
markdownText:
|
|
3447
|
+
'These methods can be used to take the user to different pages.',
|
|
3322
3448
|
},
|
|
3323
3449
|
items: {
|
|
3324
3450
|
navigateTo: {
|
|
3325
3451
|
comment: {
|
|
3326
|
-
|
|
3452
|
+
markdownText:
|
|
3453
|
+
'Moves the user to another URL internal to the backend.',
|
|
3327
3454
|
example: "await ctx.navigateTo('/');",
|
|
3328
3455
|
},
|
|
3329
3456
|
location: {
|
|
@@ -3337,36 +3464,41 @@ export const manifest: Manifest = {
|
|
|
3337
3464
|
],
|
|
3338
3465
|
},
|
|
3339
3466
|
selfResizingPluginFrameCtxSizingUtilities: {
|
|
3467
|
+
name: 'SizingUtilities',
|
|
3468
|
+
comment: {
|
|
3469
|
+
markdownText:
|
|
3470
|
+
'A number of methods that you can use to control the size of the plugin frame.',
|
|
3471
|
+
},
|
|
3340
3472
|
items: {
|
|
3341
3473
|
startAutoResizer: {
|
|
3342
3474
|
comment: {
|
|
3343
|
-
|
|
3475
|
+
markdownText:
|
|
3344
3476
|
"Listens for DOM changes and automatically calls `setHeight` when it detects\na change. If you're using `datocms-react-ui` package, the `<Canvas />`\ncomponent already takes care of calling this method for you.",
|
|
3345
3477
|
},
|
|
3346
3478
|
location: {
|
|
3347
3479
|
filePath: 'src/ctx/commonExtras/sizing.ts',
|
|
3348
|
-
lineNumber:
|
|
3480
|
+
lineNumber: 8,
|
|
3349
3481
|
},
|
|
3350
3482
|
type: '() => void',
|
|
3351
3483
|
},
|
|
3352
3484
|
stopAutoResizer: {
|
|
3353
3485
|
comment: {
|
|
3354
|
-
|
|
3486
|
+
markdownText: 'Stops resizing the iframe automatically.',
|
|
3355
3487
|
},
|
|
3356
3488
|
location: {
|
|
3357
3489
|
filePath: 'src/ctx/commonExtras/sizing.ts',
|
|
3358
|
-
lineNumber:
|
|
3490
|
+
lineNumber: 11,
|
|
3359
3491
|
},
|
|
3360
3492
|
type: '() => void',
|
|
3361
3493
|
},
|
|
3362
3494
|
updateHeight: {
|
|
3363
3495
|
comment: {
|
|
3364
|
-
|
|
3365
|
-
"Triggers a change in the size of the iframe. If you don't explicitely pass\na `newHeight` it will be automatically calculated using the iframe content\nat the moment",
|
|
3496
|
+
markdownText:
|
|
3497
|
+
"Triggers a change in the size of the iframe. If you don't explicitely pass\na `newHeight` it will be automatically calculated using the iframe content\nat the moment.",
|
|
3366
3498
|
},
|
|
3367
3499
|
location: {
|
|
3368
3500
|
filePath: 'src/ctx/commonExtras/sizing.ts',
|
|
3369
|
-
lineNumber:
|
|
3501
|
+
lineNumber: 18,
|
|
3370
3502
|
},
|
|
3371
3503
|
type: '(newHeight?: number) => void',
|
|
3372
3504
|
},
|