datocms-plugin-sdk 0.6.10 → 0.6.15-alpha.0
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/connect.js +7 -2
- package/dist/cjs/connect.js.map +1 -1
- package/dist/esm/connect.d.ts +56 -21
- package/dist/esm/connect.js +7 -2
- package/dist/esm/connect.js.map +1 -1
- package/dist/types/connect.d.ts +56 -21
- package/package.json +2 -2
- package/src/connect.ts +72 -21
- package/types.json +2525 -1830
package/dist/cjs/connect.js
CHANGED
|
@@ -119,11 +119,11 @@ var buildRenderUtils = function (parent) {
|
|
|
119
119
|
function connect(configuration) {
|
|
120
120
|
if (configuration === void 0) { configuration = {}; }
|
|
121
121
|
return __awaiter(this, void 0, void 0, function () {
|
|
122
|
-
var assetSources, mainNavigationTabs, settingsAreaSidebarItemGroups, contentAreaSidebarItems, manualFieldExtensions, itemFormSidebarPanels, itemFormOutlets, listener, penpalConnection, parent, initialSettings, render, render, renderUtils_1, render, renderUtils_2, render, renderUtils_3, render, renderUtils_4, render, renderUtils_5, render, renderUtils_6, render, renderUtils_7, render;
|
|
122
|
+
var assetSources, mainNavigationTabs, settingsAreaSidebarItemGroups, contentAreaSidebarItems, manualFieldExtensions, itemFormSidebarPanels, itemFormOutlets, onBeforeItemDestroy, onBeforeItemPublish, onBeforeItemUnpublish, onBeforeItemSave, onBeforeItemDuplicate, listener, penpalConnection, parent, initialSettings, render, render, renderUtils_1, render, renderUtils_2, render, renderUtils_3, render, renderUtils_4, render, renderUtils_5, render, renderUtils_6, render, renderUtils_7, render;
|
|
123
123
|
return __generator(this, function (_a) {
|
|
124
124
|
switch (_a.label) {
|
|
125
125
|
case 0:
|
|
126
|
-
assetSources = configuration.assetSources, mainNavigationTabs = configuration.mainNavigationTabs, settingsAreaSidebarItemGroups = configuration.settingsAreaSidebarItemGroups, contentAreaSidebarItems = configuration.contentAreaSidebarItems, manualFieldExtensions = configuration.manualFieldExtensions, itemFormSidebarPanels = configuration.itemFormSidebarPanels, itemFormOutlets = configuration.itemFormOutlets;
|
|
126
|
+
assetSources = configuration.assetSources, mainNavigationTabs = configuration.mainNavigationTabs, settingsAreaSidebarItemGroups = configuration.settingsAreaSidebarItemGroups, contentAreaSidebarItems = configuration.contentAreaSidebarItems, manualFieldExtensions = configuration.manualFieldExtensions, itemFormSidebarPanels = configuration.itemFormSidebarPanels, itemFormOutlets = configuration.itemFormOutlets, onBeforeItemDestroy = configuration.onBeforeItemDestroy, onBeforeItemPublish = configuration.onBeforeItemPublish, onBeforeItemUnpublish = configuration.onBeforeItemUnpublish, onBeforeItemSave = configuration.onBeforeItemSave, onBeforeItemDuplicate = configuration.onBeforeItemDuplicate;
|
|
127
127
|
listener = null;
|
|
128
128
|
penpalConnection = (0, connectToParent_1.default)({
|
|
129
129
|
methods: {
|
|
@@ -144,6 +144,11 @@ function connect(configuration) {
|
|
|
144
144
|
manualFieldExtensions: manualFieldExtensions,
|
|
145
145
|
itemFormSidebarPanels: itemFormSidebarPanels,
|
|
146
146
|
itemFormOutlets: itemFormOutlets,
|
|
147
|
+
onBeforeItemDestroy: onBeforeItemDestroy,
|
|
148
|
+
onBeforeItemPublish: onBeforeItemPublish,
|
|
149
|
+
onBeforeItemUnpublish: onBeforeItemUnpublish,
|
|
150
|
+
onBeforeItemSave: onBeforeItemSave,
|
|
151
|
+
onBeforeItemDuplicate: onBeforeItemDuplicate,
|
|
147
152
|
overrideFieldExtensions: toMultifield(configuration.overrideFieldExtensions),
|
|
148
153
|
customMarksForStructuredTextField: toMultifield(configuration.customMarksForStructuredTextField),
|
|
149
154
|
customBlockStylesForStructuredTextField: toMultifield(configuration.customBlockStylesForStructuredTextField),
|
package/dist/cjs/connect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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qBACrC;oBAED,IAAI,IAAA,uDAA8C,EAAC,MAAM,EAAE,eAAe,CAAC,EAAE;wBAKrE,gBAAc,gBAAgB,CAAC,MAAM,CAAC,CAAC;wBAEvC,MAAM,GAAG,UAAC,QAAkB;4BAChC,IAAI,CAAC,aAAa,CAAC,sCAAsC,EAAE;gCACzD,OAAO;6BACR;4BAED,aAAa,CAAC,sCAAsC,CAClD,QAAQ,CAAC,gBAAgB,iCAEpB,MAAM,GACN,QAAQ,GACR,aAAW,EAEjB,CAAC;wBACJ,CAAC,CAAC;wBAEF,QAAQ,GAAG,MAAM,CAAC;wBAClB,MAAM,CAAC,eAA2B,CAAC,CAAC;qBACrC;;;;;CACF;AAnQD,0BAmQC"}
|
package/dist/esm/connect.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Field, ItemType } from './SiteApiSchema';
|
|
1
|
+
import { Field, Item, ItemType } from './SiteApiSchema';
|
|
2
2
|
import { AssetSource, ContentAreaSidebarItem, FieldExtensionOverride, InitPropertiesAndMethods, ItemFormSidebarPanel, MainNavigationTab, ManualFieldExtension, OnBootPropertiesAndMethods, RenderAssetSourcePropertiesAndMethods, RenderConfigScreenPropertiesAndMethods, RenderFieldExtensionPropertiesAndMethods, RenderManualFieldExtensionConfigScreenPropertiesAndMethods, RenderModalPropertiesAndMethods, RenderPagePropertiesAndMethods, RenderSidebarPanelPropertiesAndMethods, SettingsAreaSidebarItemGroup } from './types';
|
|
3
3
|
import { ItemFormOutlet, RenderItemFormOutletPropertiesAndMethods, StructuredTextCustomBlockStyle, StructuredTextCustomMark } from '.';
|
|
4
4
|
export declare type SizingUtilities = {
|
|
@@ -37,84 +37,119 @@ export declare type FullConnectParameters = {
|
|
|
37
37
|
* This function will be called once at boot time and can be used to perform
|
|
38
38
|
* ie. some initial integrity checks on the configuration.
|
|
39
39
|
*
|
|
40
|
-
* @
|
|
40
|
+
* @tag boot
|
|
41
41
|
*/
|
|
42
42
|
onBoot: (ctx: OnBootCtx) => void;
|
|
43
|
+
/**
|
|
44
|
+
* This function will be called before destroying a record. You can stop the
|
|
45
|
+
* action by returning `false`
|
|
46
|
+
*
|
|
47
|
+
* @tag beforeHooks
|
|
48
|
+
*/
|
|
49
|
+
onBeforeItemDestroy: (item: Item, ctx: OnBootCtx) => Promise<boolean>;
|
|
50
|
+
/**
|
|
51
|
+
* This function will be called before saving a new version of a record. You
|
|
52
|
+
* can stop the action by returning `false`
|
|
53
|
+
*
|
|
54
|
+
* @tag beforeHooks
|
|
55
|
+
*/
|
|
56
|
+
onBeforeItemSave: (item: Item, ctx: OnBootCtx) => Promise<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* This function will be called before publishing a record. You can stop the
|
|
59
|
+
* action by returning `false`
|
|
60
|
+
*
|
|
61
|
+
* @tag beforeHooks
|
|
62
|
+
*/
|
|
63
|
+
onBeforeItemPublish: (item: Item, ctx: OnBootCtx) => Promise<boolean>;
|
|
64
|
+
/**
|
|
65
|
+
* This function will be called before unpublishing a record. You can stop the
|
|
66
|
+
* action by returning `false`
|
|
67
|
+
*
|
|
68
|
+
* @tag beforeHooks
|
|
69
|
+
*/
|
|
70
|
+
onBeforeItemUnpublish: (item: Item, ctx: OnBootCtx) => Promise<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* This function will be called before duplicating a record. You can stop the
|
|
73
|
+
* action by returning `false`
|
|
74
|
+
*
|
|
75
|
+
* @tag beforeHooks
|
|
76
|
+
*/
|
|
77
|
+
onBeforeItemDuplicate: (item: Item, ctx: OnBootCtx) => Promise<boolean>;
|
|
43
78
|
/**
|
|
44
79
|
* Use this function to declare new tabs you want to add in the top-bar of the
|
|
45
80
|
* UI
|
|
46
81
|
*
|
|
47
|
-
* @
|
|
82
|
+
* @tag pages
|
|
48
83
|
*/
|
|
49
84
|
mainNavigationTabs: (ctx: IntentCtx) => MainNavigationTab[];
|
|
50
85
|
/**
|
|
51
86
|
* Use this function to declare new navigation sections in the Settings Area
|
|
52
87
|
* sidebar
|
|
53
88
|
*
|
|
54
|
-
* @
|
|
89
|
+
* @tag pages
|
|
55
90
|
*/
|
|
56
91
|
settingsAreaSidebarItemGroups: (ctx: IntentCtx) => SettingsAreaSidebarItemGroup[];
|
|
57
92
|
/**
|
|
58
93
|
* Use this function to declare new navigation items in the Content Area
|
|
59
94
|
* sidebar
|
|
60
95
|
*
|
|
61
|
-
* @
|
|
96
|
+
* @tag pages
|
|
62
97
|
*/
|
|
63
98
|
contentAreaSidebarItems: (ctx: IntentCtx) => ContentAreaSidebarItem[];
|
|
64
99
|
/**
|
|
65
100
|
* Use this function to declare new field extensions that users will be able
|
|
66
101
|
* to install manually in some field
|
|
67
102
|
*
|
|
68
|
-
* @
|
|
103
|
+
* @tag manualFieldExtensions
|
|
69
104
|
*/
|
|
70
105
|
manualFieldExtensions: (ctx: IntentCtx) => ManualFieldExtension[];
|
|
71
106
|
/**
|
|
72
107
|
* Use this function to declare additional sources to be shown when users want
|
|
73
108
|
* to upload new assets
|
|
74
109
|
*
|
|
75
|
-
* @
|
|
110
|
+
* @tag assetSources
|
|
76
111
|
*/
|
|
77
112
|
assetSources: (ctx: IntentCtx) => AssetSource[] | void;
|
|
78
113
|
/**
|
|
79
114
|
* Use this function to declare new sidebar panels to be shown when the user
|
|
80
115
|
* edits records of a particular model
|
|
81
116
|
*
|
|
82
|
-
* @
|
|
117
|
+
* @tag sidebarPanels
|
|
83
118
|
*/
|
|
84
119
|
itemFormSidebarPanels: (itemType: ItemType, ctx: IntentCtx) => ItemFormSidebarPanel[];
|
|
85
120
|
/**
|
|
86
121
|
* Use this function to declare custom outlets to be shown at the top of the
|
|
87
122
|
* record's editing page
|
|
88
123
|
*
|
|
89
|
-
* @
|
|
124
|
+
* @tag itemFormOutlets
|
|
90
125
|
*/
|
|
91
126
|
itemFormOutlets: (itemType: ItemType, ctx: IntentCtx) => ItemFormOutlet[];
|
|
92
127
|
/**
|
|
93
128
|
* Use this function to automatically force one or more field extensions to a
|
|
94
129
|
* particular field
|
|
95
130
|
*
|
|
96
|
-
* @
|
|
131
|
+
* @tag forcedFieldExtensions
|
|
97
132
|
*/
|
|
98
133
|
overrideFieldExtensions: (field: Field, ctx: FieldIntentCtx) => FieldExtensionOverride | void;
|
|
99
134
|
/**
|
|
100
135
|
* Use this function to define a number of custom marks for a specific
|
|
101
136
|
* Structured Text field
|
|
102
137
|
*
|
|
103
|
-
* @
|
|
138
|
+
* @tag structuredText
|
|
104
139
|
*/
|
|
105
140
|
customMarksForStructuredTextField: (field: Field, ctx: FieldIntentCtx) => StructuredTextCustomMark[] | void;
|
|
106
141
|
/**
|
|
107
142
|
* Use this function to define a number of custom block styles for a specific
|
|
108
143
|
* Structured Text field
|
|
109
144
|
*
|
|
110
|
-
* @
|
|
145
|
+
* @tag structuredText
|
|
111
146
|
*/
|
|
112
147
|
customBlockStylesForStructuredTextField: (field: Field, ctx: FieldIntentCtx) => StructuredTextCustomBlockStyle[] | void;
|
|
113
148
|
/**
|
|
114
149
|
* This function will be called when the plugin needs to render the plugin's
|
|
115
150
|
* configuration form
|
|
116
151
|
*
|
|
117
|
-
* @
|
|
152
|
+
* @tag configScreen
|
|
118
153
|
*/
|
|
119
154
|
renderConfigScreen: (ctx: RenderConfigScreenCtx) => void;
|
|
120
155
|
/**
|
|
@@ -122,35 +157,35 @@ export declare type FullConnectParameters = {
|
|
|
122
157
|
* page (see the `mainNavigationTabs`, `settingsAreaSidebarItemGroups` and
|
|
123
158
|
* `contentAreaSidebarItems` functions)
|
|
124
159
|
*
|
|
125
|
-
* @
|
|
160
|
+
* @tag pages
|
|
126
161
|
*/
|
|
127
162
|
renderPage: (pageId: string, ctx: RenderPageCtx) => void;
|
|
128
163
|
/**
|
|
129
164
|
* This function will be called when the plugin requested to open a modal (see
|
|
130
165
|
* the `openModal` function)
|
|
131
166
|
*
|
|
132
|
-
* @
|
|
167
|
+
* @tag modals
|
|
133
168
|
*/
|
|
134
169
|
renderModal: (modalId: string, ctx: RenderModalCtx) => void;
|
|
135
170
|
/**
|
|
136
171
|
* This function will be called when the plugin needs to render a sidebar
|
|
137
172
|
* panel (see the `itemFormSidebarPanels` function)
|
|
138
173
|
*
|
|
139
|
-
* @
|
|
174
|
+
* @tag sidebarPanels
|
|
140
175
|
*/
|
|
141
176
|
renderItemFormSidebarPanel: (sidebarPaneId: string, ctx: RenderItemFormSidebarPanelCtx) => void;
|
|
142
177
|
/**
|
|
143
178
|
* This function will be called when the plugin needs to render an outlet (see
|
|
144
179
|
* the `itemFormOutlets` function)
|
|
145
180
|
*
|
|
146
|
-
* @
|
|
181
|
+
* @tag itemFormOutlets
|
|
147
182
|
*/
|
|
148
183
|
renderItemFormOutlet: (itemFormOutletId: string, ctx: RenderItemFormOutletCtx) => void;
|
|
149
184
|
/**
|
|
150
185
|
* This function will be called when the user selects one of the plugin's
|
|
151
186
|
* asset sources to upload a new media file.
|
|
152
187
|
*
|
|
153
|
-
* @
|
|
188
|
+
* @tag assetSources
|
|
154
189
|
*/
|
|
155
190
|
renderAssetSource: (assetSourceId: string, ctx: RenderAssetSourceCtx) => void;
|
|
156
191
|
/**
|
|
@@ -158,7 +193,7 @@ export declare type FullConnectParameters = {
|
|
|
158
193
|
* extension (see the `manualFieldExtensions` and `overrideFieldExtensions`
|
|
159
194
|
* functions)
|
|
160
195
|
*
|
|
161
|
-
* @
|
|
196
|
+
* @tag forcedFieldExtensions
|
|
162
197
|
*/
|
|
163
198
|
renderFieldExtension: (fieldExtensionId: string, ctx: RenderFieldExtensionCtx) => void;
|
|
164
199
|
/**
|
|
@@ -166,14 +201,14 @@ export declare type FullConnectParameters = {
|
|
|
166
201
|
* configuration form for installing a field extension inside a particular
|
|
167
202
|
* field
|
|
168
203
|
*
|
|
169
|
-
* @
|
|
204
|
+
* @tag manualFieldExtensions
|
|
170
205
|
*/
|
|
171
206
|
renderManualFieldExtensionConfigScreen: (fieldExtensionId: string, ctx: RenderManualFieldExtensionConfigScreenCtx) => void;
|
|
172
207
|
/**
|
|
173
208
|
* This function will be called each time the configuration object changes. It
|
|
174
209
|
* must return an object containing possible validation errors
|
|
175
210
|
*
|
|
176
|
-
* @
|
|
211
|
+
* @tag manualFieldExtensions
|
|
177
212
|
*/
|
|
178
213
|
validateManualFieldExtensionParameters: (fieldExtensionId: string, parameters: Record<string, unknown>) => Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
179
214
|
};
|
package/dist/esm/connect.js
CHANGED
|
@@ -113,11 +113,11 @@ var buildRenderUtils = function (parent) {
|
|
|
113
113
|
export function connect(configuration) {
|
|
114
114
|
if (configuration === void 0) { configuration = {}; }
|
|
115
115
|
return __awaiter(this, void 0, void 0, function () {
|
|
116
|
-
var assetSources, mainNavigationTabs, settingsAreaSidebarItemGroups, contentAreaSidebarItems, manualFieldExtensions, itemFormSidebarPanels, itemFormOutlets, listener, penpalConnection, parent, initialSettings, render, render, renderUtils_1, render, renderUtils_2, render, renderUtils_3, render, renderUtils_4, render, renderUtils_5, render, renderUtils_6, render, renderUtils_7, render;
|
|
116
|
+
var assetSources, mainNavigationTabs, settingsAreaSidebarItemGroups, contentAreaSidebarItems, manualFieldExtensions, itemFormSidebarPanels, itemFormOutlets, onBeforeItemDestroy, onBeforeItemPublish, onBeforeItemUnpublish, onBeforeItemSave, onBeforeItemDuplicate, listener, penpalConnection, parent, initialSettings, render, render, renderUtils_1, render, renderUtils_2, render, renderUtils_3, render, renderUtils_4, render, renderUtils_5, render, renderUtils_6, render, renderUtils_7, render;
|
|
117
117
|
return __generator(this, function (_a) {
|
|
118
118
|
switch (_a.label) {
|
|
119
119
|
case 0:
|
|
120
|
-
assetSources = configuration.assetSources, mainNavigationTabs = configuration.mainNavigationTabs, settingsAreaSidebarItemGroups = configuration.settingsAreaSidebarItemGroups, contentAreaSidebarItems = configuration.contentAreaSidebarItems, manualFieldExtensions = configuration.manualFieldExtensions, itemFormSidebarPanels = configuration.itemFormSidebarPanels, itemFormOutlets = configuration.itemFormOutlets;
|
|
120
|
+
assetSources = configuration.assetSources, mainNavigationTabs = configuration.mainNavigationTabs, settingsAreaSidebarItemGroups = configuration.settingsAreaSidebarItemGroups, contentAreaSidebarItems = configuration.contentAreaSidebarItems, manualFieldExtensions = configuration.manualFieldExtensions, itemFormSidebarPanels = configuration.itemFormSidebarPanels, itemFormOutlets = configuration.itemFormOutlets, onBeforeItemDestroy = configuration.onBeforeItemDestroy, onBeforeItemPublish = configuration.onBeforeItemPublish, onBeforeItemUnpublish = configuration.onBeforeItemUnpublish, onBeforeItemSave = configuration.onBeforeItemSave, onBeforeItemDuplicate = configuration.onBeforeItemDuplicate;
|
|
121
121
|
listener = null;
|
|
122
122
|
penpalConnection = connectToParent({
|
|
123
123
|
methods: {
|
|
@@ -138,6 +138,11 @@ export function connect(configuration) {
|
|
|
138
138
|
manualFieldExtensions: manualFieldExtensions,
|
|
139
139
|
itemFormSidebarPanels: itemFormSidebarPanels,
|
|
140
140
|
itemFormOutlets: itemFormOutlets,
|
|
141
|
+
onBeforeItemDestroy: onBeforeItemDestroy,
|
|
142
|
+
onBeforeItemPublish: onBeforeItemPublish,
|
|
143
|
+
onBeforeItemUnpublish: onBeforeItemUnpublish,
|
|
144
|
+
onBeforeItemSave: onBeforeItemSave,
|
|
145
|
+
onBeforeItemDuplicate: onBeforeItemDuplicate,
|
|
141
146
|
overrideFieldExtensions: toMultifield(configuration.overrideFieldExtensions),
|
|
142
147
|
customMarksForStructuredTextField: toMultifield(configuration.customMarksForStructuredTextField),
|
|
143
148
|
customBlockStylesForStructuredTextField: toMultifield(configuration.customBlockStylesForStructuredTextField),
|
package/dist/esm/connect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,eAAe,MAAM,4BAA4B,CAAC;AA4BzD,OAAO,EACL,YAAY,EACZ,cAAc,EACd,yBAAyB,EACzB,0BAA0B,EAC1B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O;6BACR;4BAED,aAAa,CAAC,oBAAoB,CAAC,QAAQ,CAAC,gBAAgB,iCACvD,MAAM,GACN,QAAQ,GACR,aAAW,EACd,CAAC;wBACL,CAAC,CAAC;wBAEF,QAAQ,GAAG,MAAM,CAAC;wBAClB,MAAM,CAAC,eAA2B,CAAC,CAAC;qBACrC;oBAED,IAAI,8CAA8C,CAAC,MAAM,EAAE,eAAe,CAAC,EAAE;wBAKrE,gBAAc,gBAAgB,CAAC,MAAM,CAAC,CAAC;wBAEvC,MAAM,GAAG,UAAC,QAAkB;4BAChC,IAAI,CAAC,aAAa,CAAC,sCAAsC,EAAE;gCACzD,OAAO;6BACR;4BAED,aAAa,CAAC,sCAAsC,CAClD,QAAQ,CAAC,gBAAgB,iCAEpB,MAAM,GACN,QAAQ,GACR,aAAW,EAEjB,CAAC;wBACJ,CAAC,CAAC;wBAEF,QAAQ,GAAG,MAAM,CAAC;wBAClB,MAAM,CAAC,eAA2B,CAAC,CAAC;qBACrC;;;;;CACF"}
|
package/dist/types/connect.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Field, ItemType } from './SiteApiSchema';
|
|
1
|
+
import { Field, Item, ItemType } from './SiteApiSchema';
|
|
2
2
|
import { AssetSource, ContentAreaSidebarItem, FieldExtensionOverride, InitPropertiesAndMethods, ItemFormSidebarPanel, MainNavigationTab, ManualFieldExtension, OnBootPropertiesAndMethods, RenderAssetSourcePropertiesAndMethods, RenderConfigScreenPropertiesAndMethods, RenderFieldExtensionPropertiesAndMethods, RenderManualFieldExtensionConfigScreenPropertiesAndMethods, RenderModalPropertiesAndMethods, RenderPagePropertiesAndMethods, RenderSidebarPanelPropertiesAndMethods, SettingsAreaSidebarItemGroup } from './types';
|
|
3
3
|
import { ItemFormOutlet, RenderItemFormOutletPropertiesAndMethods, StructuredTextCustomBlockStyle, StructuredTextCustomMark } from '.';
|
|
4
4
|
export declare type SizingUtilities = {
|
|
@@ -37,84 +37,119 @@ export declare type FullConnectParameters = {
|
|
|
37
37
|
* This function will be called once at boot time and can be used to perform
|
|
38
38
|
* ie. some initial integrity checks on the configuration.
|
|
39
39
|
*
|
|
40
|
-
* @
|
|
40
|
+
* @tag boot
|
|
41
41
|
*/
|
|
42
42
|
onBoot: (ctx: OnBootCtx) => void;
|
|
43
|
+
/**
|
|
44
|
+
* This function will be called before destroying a record. You can stop the
|
|
45
|
+
* action by returning `false`
|
|
46
|
+
*
|
|
47
|
+
* @tag beforeHooks
|
|
48
|
+
*/
|
|
49
|
+
onBeforeItemDestroy: (item: Item, ctx: OnBootCtx) => Promise<boolean>;
|
|
50
|
+
/**
|
|
51
|
+
* This function will be called before saving a new version of a record. You
|
|
52
|
+
* can stop the action by returning `false`
|
|
53
|
+
*
|
|
54
|
+
* @tag beforeHooks
|
|
55
|
+
*/
|
|
56
|
+
onBeforeItemSave: (item: Item, ctx: OnBootCtx) => Promise<boolean>;
|
|
57
|
+
/**
|
|
58
|
+
* This function will be called before publishing a record. You can stop the
|
|
59
|
+
* action by returning `false`
|
|
60
|
+
*
|
|
61
|
+
* @tag beforeHooks
|
|
62
|
+
*/
|
|
63
|
+
onBeforeItemPublish: (item: Item, ctx: OnBootCtx) => Promise<boolean>;
|
|
64
|
+
/**
|
|
65
|
+
* This function will be called before unpublishing a record. You can stop the
|
|
66
|
+
* action by returning `false`
|
|
67
|
+
*
|
|
68
|
+
* @tag beforeHooks
|
|
69
|
+
*/
|
|
70
|
+
onBeforeItemUnpublish: (item: Item, ctx: OnBootCtx) => Promise<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* This function will be called before duplicating a record. You can stop the
|
|
73
|
+
* action by returning `false`
|
|
74
|
+
*
|
|
75
|
+
* @tag beforeHooks
|
|
76
|
+
*/
|
|
77
|
+
onBeforeItemDuplicate: (item: Item, ctx: OnBootCtx) => Promise<boolean>;
|
|
43
78
|
/**
|
|
44
79
|
* Use this function to declare new tabs you want to add in the top-bar of the
|
|
45
80
|
* UI
|
|
46
81
|
*
|
|
47
|
-
* @
|
|
82
|
+
* @tag pages
|
|
48
83
|
*/
|
|
49
84
|
mainNavigationTabs: (ctx: IntentCtx) => MainNavigationTab[];
|
|
50
85
|
/**
|
|
51
86
|
* Use this function to declare new navigation sections in the Settings Area
|
|
52
87
|
* sidebar
|
|
53
88
|
*
|
|
54
|
-
* @
|
|
89
|
+
* @tag pages
|
|
55
90
|
*/
|
|
56
91
|
settingsAreaSidebarItemGroups: (ctx: IntentCtx) => SettingsAreaSidebarItemGroup[];
|
|
57
92
|
/**
|
|
58
93
|
* Use this function to declare new navigation items in the Content Area
|
|
59
94
|
* sidebar
|
|
60
95
|
*
|
|
61
|
-
* @
|
|
96
|
+
* @tag pages
|
|
62
97
|
*/
|
|
63
98
|
contentAreaSidebarItems: (ctx: IntentCtx) => ContentAreaSidebarItem[];
|
|
64
99
|
/**
|
|
65
100
|
* Use this function to declare new field extensions that users will be able
|
|
66
101
|
* to install manually in some field
|
|
67
102
|
*
|
|
68
|
-
* @
|
|
103
|
+
* @tag manualFieldExtensions
|
|
69
104
|
*/
|
|
70
105
|
manualFieldExtensions: (ctx: IntentCtx) => ManualFieldExtension[];
|
|
71
106
|
/**
|
|
72
107
|
* Use this function to declare additional sources to be shown when users want
|
|
73
108
|
* to upload new assets
|
|
74
109
|
*
|
|
75
|
-
* @
|
|
110
|
+
* @tag assetSources
|
|
76
111
|
*/
|
|
77
112
|
assetSources: (ctx: IntentCtx) => AssetSource[] | void;
|
|
78
113
|
/**
|
|
79
114
|
* Use this function to declare new sidebar panels to be shown when the user
|
|
80
115
|
* edits records of a particular model
|
|
81
116
|
*
|
|
82
|
-
* @
|
|
117
|
+
* @tag sidebarPanels
|
|
83
118
|
*/
|
|
84
119
|
itemFormSidebarPanels: (itemType: ItemType, ctx: IntentCtx) => ItemFormSidebarPanel[];
|
|
85
120
|
/**
|
|
86
121
|
* Use this function to declare custom outlets to be shown at the top of the
|
|
87
122
|
* record's editing page
|
|
88
123
|
*
|
|
89
|
-
* @
|
|
124
|
+
* @tag itemFormOutlets
|
|
90
125
|
*/
|
|
91
126
|
itemFormOutlets: (itemType: ItemType, ctx: IntentCtx) => ItemFormOutlet[];
|
|
92
127
|
/**
|
|
93
128
|
* Use this function to automatically force one or more field extensions to a
|
|
94
129
|
* particular field
|
|
95
130
|
*
|
|
96
|
-
* @
|
|
131
|
+
* @tag forcedFieldExtensions
|
|
97
132
|
*/
|
|
98
133
|
overrideFieldExtensions: (field: Field, ctx: FieldIntentCtx) => FieldExtensionOverride | void;
|
|
99
134
|
/**
|
|
100
135
|
* Use this function to define a number of custom marks for a specific
|
|
101
136
|
* Structured Text field
|
|
102
137
|
*
|
|
103
|
-
* @
|
|
138
|
+
* @tag structuredText
|
|
104
139
|
*/
|
|
105
140
|
customMarksForStructuredTextField: (field: Field, ctx: FieldIntentCtx) => StructuredTextCustomMark[] | void;
|
|
106
141
|
/**
|
|
107
142
|
* Use this function to define a number of custom block styles for a specific
|
|
108
143
|
* Structured Text field
|
|
109
144
|
*
|
|
110
|
-
* @
|
|
145
|
+
* @tag structuredText
|
|
111
146
|
*/
|
|
112
147
|
customBlockStylesForStructuredTextField: (field: Field, ctx: FieldIntentCtx) => StructuredTextCustomBlockStyle[] | void;
|
|
113
148
|
/**
|
|
114
149
|
* This function will be called when the plugin needs to render the plugin's
|
|
115
150
|
* configuration form
|
|
116
151
|
*
|
|
117
|
-
* @
|
|
152
|
+
* @tag configScreen
|
|
118
153
|
*/
|
|
119
154
|
renderConfigScreen: (ctx: RenderConfigScreenCtx) => void;
|
|
120
155
|
/**
|
|
@@ -122,35 +157,35 @@ export declare type FullConnectParameters = {
|
|
|
122
157
|
* page (see the `mainNavigationTabs`, `settingsAreaSidebarItemGroups` and
|
|
123
158
|
* `contentAreaSidebarItems` functions)
|
|
124
159
|
*
|
|
125
|
-
* @
|
|
160
|
+
* @tag pages
|
|
126
161
|
*/
|
|
127
162
|
renderPage: (pageId: string, ctx: RenderPageCtx) => void;
|
|
128
163
|
/**
|
|
129
164
|
* This function will be called when the plugin requested to open a modal (see
|
|
130
165
|
* the `openModal` function)
|
|
131
166
|
*
|
|
132
|
-
* @
|
|
167
|
+
* @tag modals
|
|
133
168
|
*/
|
|
134
169
|
renderModal: (modalId: string, ctx: RenderModalCtx) => void;
|
|
135
170
|
/**
|
|
136
171
|
* This function will be called when the plugin needs to render a sidebar
|
|
137
172
|
* panel (see the `itemFormSidebarPanels` function)
|
|
138
173
|
*
|
|
139
|
-
* @
|
|
174
|
+
* @tag sidebarPanels
|
|
140
175
|
*/
|
|
141
176
|
renderItemFormSidebarPanel: (sidebarPaneId: string, ctx: RenderItemFormSidebarPanelCtx) => void;
|
|
142
177
|
/**
|
|
143
178
|
* This function will be called when the plugin needs to render an outlet (see
|
|
144
179
|
* the `itemFormOutlets` function)
|
|
145
180
|
*
|
|
146
|
-
* @
|
|
181
|
+
* @tag itemFormOutlets
|
|
147
182
|
*/
|
|
148
183
|
renderItemFormOutlet: (itemFormOutletId: string, ctx: RenderItemFormOutletCtx) => void;
|
|
149
184
|
/**
|
|
150
185
|
* This function will be called when the user selects one of the plugin's
|
|
151
186
|
* asset sources to upload a new media file.
|
|
152
187
|
*
|
|
153
|
-
* @
|
|
188
|
+
* @tag assetSources
|
|
154
189
|
*/
|
|
155
190
|
renderAssetSource: (assetSourceId: string, ctx: RenderAssetSourceCtx) => void;
|
|
156
191
|
/**
|
|
@@ -158,7 +193,7 @@ export declare type FullConnectParameters = {
|
|
|
158
193
|
* extension (see the `manualFieldExtensions` and `overrideFieldExtensions`
|
|
159
194
|
* functions)
|
|
160
195
|
*
|
|
161
|
-
* @
|
|
196
|
+
* @tag forcedFieldExtensions
|
|
162
197
|
*/
|
|
163
198
|
renderFieldExtension: (fieldExtensionId: string, ctx: RenderFieldExtensionCtx) => void;
|
|
164
199
|
/**
|
|
@@ -166,14 +201,14 @@ export declare type FullConnectParameters = {
|
|
|
166
201
|
* configuration form for installing a field extension inside a particular
|
|
167
202
|
* field
|
|
168
203
|
*
|
|
169
|
-
* @
|
|
204
|
+
* @tag manualFieldExtensions
|
|
170
205
|
*/
|
|
171
206
|
renderManualFieldExtensionConfigScreen: (fieldExtensionId: string, ctx: RenderManualFieldExtensionConfigScreenCtx) => void;
|
|
172
207
|
/**
|
|
173
208
|
* This function will be called each time the configuration object changes. It
|
|
174
209
|
* must return an object containing possible validation errors
|
|
175
210
|
*
|
|
176
|
-
* @
|
|
211
|
+
* @tag manualFieldExtensions
|
|
177
212
|
*/
|
|
178
213
|
validateManualFieldExtensionParameters: (fieldExtensionId: string, parameters: Record<string, unknown>) => Record<string, unknown> | Promise<Record<string, unknown>>;
|
|
179
214
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "datocms-plugin-sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.15-alpha.0",
|
|
4
4
|
"description": "DatoCMS Plugin SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datocms",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"typedoc": "^0.23.20"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "7f9db5ea70b5dbd7b48116bdc00e41e3b4d7f203"
|
|
47
47
|
}
|