datocms-plugin-sdk 0.3.34-alpha.1 → 0.3.34
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 +0 -2
- package/dist/cjs/connect.js.map +1 -1
- package/dist/esm/connect.d.ts +0 -15
- package/dist/esm/connect.js +0 -2
- package/dist/esm/connect.js.map +1 -1
- package/dist/esm/types.d.ts +2 -63
- package/dist/types/connect.d.ts +0 -15
- package/dist/types/types.d.ts +2 -63
- package/package.json +2 -4
- package/src/connect.ts +0 -30
- package/src/types.ts +2 -79
- package/types.json +1442 -2072
package/dist/cjs/connect.js
CHANGED
|
@@ -136,8 +136,6 @@ function connect(configuration) {
|
|
|
136
136
|
manualFieldExtensions: manualFieldExtensions,
|
|
137
137
|
itemFormSidebarPanels: itemFormSidebarPanels,
|
|
138
138
|
overrideFieldExtensions: toMultifield(configuration.overrideFieldExtensions),
|
|
139
|
-
customMarksForStructuredTextField: toMultifield(configuration.customMarksForStructuredTextField),
|
|
140
|
-
customBlockStylesForStructuredTextField: toMultifield(configuration.customBlockStylesForStructuredTextField),
|
|
141
139
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
142
140
|
onChange: function (newSettings) {
|
|
143
141
|
if (listener) {
|
package/dist/cjs/connect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+EAAyD;AA4BzD,mCAWkB;
|
|
1
|
+
{"version":3,"file":"connect.js","sourceRoot":"","sources":["../../src/connect.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+EAAyD;AA4BzD,mCAWkB;AA6KlB,SAAS,YAAY,CACnB,EAA+D;IAE/D,OAAO,UACL,MAA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GACN,QAAQ,GACR,aAAW,EAEjB,CAAC;wBACJ,CAAC,CAAC;wBAEF,QAAQ,GAAG,MAAM,CAAC;wBAClB,MAAM,CAAC,eAA2B,CAAC,CAAC;qBACrC;;;;;CACF;AA5ND,0BA4NC"}
|
package/dist/esm/connect.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Field, ModelBlock } from './SiteApiSchema';
|
|
2
2
|
import { AssetSource, ContentAreaSidebarItem, FieldExtensionOverride, InitPropertiesAndMethods, ItemFormSidebarPanel, MainNavigationTab, ManualFieldExtension, OnBootPropertiesAndMethods, RenderAssetSourcePropertiesAndMethods, RenderConfigScreenPropertiesAndMethods, RenderFieldExtensionPropertiesAndMethods, RenderManualFieldExtensionConfigScreenPropertiesAndMethods, RenderModalPropertiesAndMethods, RenderPagePropertiesAndMethods, RenderSidebarPanePropertiesAndMethods, SettingsAreaSidebarItemGroup } from './types';
|
|
3
|
-
import { StructuredTextCustomBlockStyle, StructuredTextCustomMark } from '.';
|
|
4
3
|
export declare type SizingUtilities = {
|
|
5
4
|
/**
|
|
6
5
|
* Listens for DOM changes and automatically calls `setHeight` when it detects
|
|
@@ -85,20 +84,6 @@ export declare type FullConnectParameters = {
|
|
|
85
84
|
* @group forcedFieldExtensions
|
|
86
85
|
*/
|
|
87
86
|
overrideFieldExtensions: (field: Field, ctx: FieldIntentCtx) => FieldExtensionOverride | void;
|
|
88
|
-
/**
|
|
89
|
-
* Use this function to define a number of custom marks for a specific
|
|
90
|
-
* Structured Text field
|
|
91
|
-
*
|
|
92
|
-
* @group structuredText
|
|
93
|
-
*/
|
|
94
|
-
customMarksForStructuredTextField: (field: Field, ctx: FieldIntentCtx) => StructuredTextCustomMark[] | void;
|
|
95
|
-
/**
|
|
96
|
-
* Use this function to define a number of custom block styles for a specific
|
|
97
|
-
* Structured Text field
|
|
98
|
-
*
|
|
99
|
-
* @group structuredText
|
|
100
|
-
*/
|
|
101
|
-
customBlockStylesForStructuredTextField: (field: Field, ctx: FieldIntentCtx) => StructuredTextCustomBlockStyle[] | void;
|
|
102
87
|
/**
|
|
103
88
|
* This function will be called when the plugin needs to render the plugin's
|
|
104
89
|
* configuration form
|
package/dist/esm/connect.js
CHANGED
|
@@ -130,8 +130,6 @@ export function connect(configuration) {
|
|
|
130
130
|
manualFieldExtensions: manualFieldExtensions,
|
|
131
131
|
itemFormSidebarPanels: itemFormSidebarPanels,
|
|
132
132
|
overrideFieldExtensions: toMultifield(configuration.overrideFieldExtensions),
|
|
133
|
-
customMarksForStructuredTextField: toMultifield(configuration.customMarksForStructuredTextField),
|
|
134
|
-
customBlockStylesForStructuredTextField: toMultifield(configuration.customBlockStylesForStructuredTextField),
|
|
135
133
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
136
134
|
onChange: function (newSettings) {
|
|
137
135
|
if (listener) {
|
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,4BAA4B,EAC5B,8CAA8C,EAC9C,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB,GAE1B,MAAM,UAAU,CAAC;
|
|
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,4BAA4B,EAC5B,8CAA8C,EAC9C,mBAAmB,EACnB,kBAAkB,EAClB,yBAAyB,GAE1B,MAAM,UAAU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AAM,GACN,QAAQ,GACR,aAAW,EAEjB,CAAC;wBACJ,CAAC,CAAC;wBAEF,QAAQ,GAAG,MAAM,CAAC;wBAClB,MAAM,CAAC,eAA2B,CAAC,CAAC;qBACrC;;;;;CACF"}
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { BlockquoteType, CodeType, HeadingType, ListType, ParagraphType, ThematicBreakType } from 'datocms-structured-text-utils';
|
|
3
1
|
import { Account, Field, Fieldset, Item, ModelBlock, Plugin, Role, Site, SsoUser, Upload, User } from './SiteApiSchema';
|
|
4
2
|
export declare type Icon = string | {
|
|
5
3
|
type: 'svg';
|
|
@@ -34,7 +32,7 @@ export declare type MainNavigationTab = {
|
|
|
34
32
|
* be displayed by ascending `rank`. If you want to specify an explicit value
|
|
35
33
|
* for `rank`, make sure to offer a way for final users to customize it inside
|
|
36
34
|
* the plugin's settings form, otherwise the hardcoded value you choose might
|
|
37
|
-
* clash with the one of another plugin!
|
|
35
|
+
* clash with the one of another plugin! *
|
|
38
36
|
*/
|
|
39
37
|
rank?: number;
|
|
40
38
|
};
|
|
@@ -249,65 +247,6 @@ export declare type AddonOverride = {
|
|
|
249
247
|
/** The initial height to set for the iframe that will render the field extension */
|
|
250
248
|
initialHeight?: number;
|
|
251
249
|
};
|
|
252
|
-
export declare type StructuredTextCustomMarkPlacement = [
|
|
253
|
-
'before' | 'after',
|
|
254
|
-
'strong' | 'emphasis' | 'underline' | 'code' | 'highlight' | 'strikethrough'
|
|
255
|
-
];
|
|
256
|
-
/** An object expressing a custom mark for a Structured Text field */
|
|
257
|
-
export declare type StructuredTextCustomMark = {
|
|
258
|
-
/** ID of mark */
|
|
259
|
-
id: string;
|
|
260
|
-
/** Label representing the custom mark */
|
|
261
|
-
label: string;
|
|
262
|
-
toolbarButton: {
|
|
263
|
-
/**
|
|
264
|
-
* Icon to be shown alongside the label. Can be a FontAwesome icon name (ie.
|
|
265
|
-
* `"address-book"`) or a custom SVG definition. To maintain visual
|
|
266
|
-
* consistency with the rest of the interface, try to use FontAwesome icons
|
|
267
|
-
* whenever possible
|
|
268
|
-
*/
|
|
269
|
-
icon: Icon;
|
|
270
|
-
/**
|
|
271
|
-
* Expresses where you want the custom mark button to be placed inside the
|
|
272
|
-
* toolbar. If not specified, the item will be placed after the standard
|
|
273
|
-
* marks provided by DatoCMS itself.
|
|
274
|
-
*/
|
|
275
|
-
placement?: StructuredTextCustomMarkPlacement;
|
|
276
|
-
/**
|
|
277
|
-
* If multiple custom marks specify the same `placement` for their toolbar
|
|
278
|
-
* button, they will be sorted by ascending `rank`. If you want to specify
|
|
279
|
-
* an explicit value for `rank`, make sure to offer a way for final users to
|
|
280
|
-
* customize it inside the plugin's settings form, otherwise the hardcoded
|
|
281
|
-
* value you choose might clash with the one of another plugin!
|
|
282
|
-
*/
|
|
283
|
-
rank?: number;
|
|
284
|
-
};
|
|
285
|
-
/**
|
|
286
|
-
* Keyboard shortcut associated with the custom mark, expressed using the
|
|
287
|
-
* https://github.com/ianstormtaylor/is-hotkey syntax (ie. `mod+shift+x`)
|
|
288
|
-
*/
|
|
289
|
-
keyboardShortcut?: string;
|
|
290
|
-
/** How the custom mark will be styled inside the editor */
|
|
291
|
-
appliedStyle: React.CSSProperties;
|
|
292
|
-
};
|
|
293
|
-
/** An object expressing a custom block style for a Structured Text field */
|
|
294
|
-
export declare type StructuredTextCustomBlockStyle = {
|
|
295
|
-
/** ID of custom block style */
|
|
296
|
-
id: string;
|
|
297
|
-
/** The block node that can apply this style */
|
|
298
|
-
node: ParagraphType | HeadingType | ListType | BlockquoteType | CodeType | ThematicBreakType;
|
|
299
|
-
/** ID of custom block style */
|
|
300
|
-
label: string;
|
|
301
|
-
/** How the block will be styled inside the editor to represent the style */
|
|
302
|
-
appliedStyle: React.CSSProperties;
|
|
303
|
-
/**
|
|
304
|
-
* Custom styles for a block node will be sorted by ascending `rank`. If you
|
|
305
|
-
* want to specify an explicit value for `rank`, make sure to offer a way for
|
|
306
|
-
* final users to customize it inside the plugin's settings form, otherwise
|
|
307
|
-
* the hardcoded value you choose might clash with the one of another plugin!
|
|
308
|
-
*/
|
|
309
|
-
rank?: number;
|
|
310
|
-
};
|
|
311
250
|
/** An object expressing some field extensions you want to force on a particular field */
|
|
312
251
|
export declare type FieldExtensionOverride = {
|
|
313
252
|
/** Force a field editor/sidebar extension on a field */
|
|
@@ -1085,7 +1024,7 @@ export declare type ItemFormAdditionalMethods = {
|
|
|
1085
1024
|
* await ctx.saveCurrentItem();
|
|
1086
1025
|
* ```
|
|
1087
1026
|
*/
|
|
1088
|
-
saveCurrentItem: () => Promise<void>;
|
|
1027
|
+
saveCurrentItem: (showToast?: boolean) => Promise<void>;
|
|
1089
1028
|
};
|
|
1090
1029
|
export declare type ItemFormMethods = RenderMethods & IframeMethods & ItemFormAdditionalMethods;
|
|
1091
1030
|
/** Information regarding the specific sidebar panel that you need to render */
|
package/dist/types/connect.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Field, ModelBlock } from './SiteApiSchema';
|
|
2
2
|
import { AssetSource, ContentAreaSidebarItem, FieldExtensionOverride, InitPropertiesAndMethods, ItemFormSidebarPanel, MainNavigationTab, ManualFieldExtension, OnBootPropertiesAndMethods, RenderAssetSourcePropertiesAndMethods, RenderConfigScreenPropertiesAndMethods, RenderFieldExtensionPropertiesAndMethods, RenderManualFieldExtensionConfigScreenPropertiesAndMethods, RenderModalPropertiesAndMethods, RenderPagePropertiesAndMethods, RenderSidebarPanePropertiesAndMethods, SettingsAreaSidebarItemGroup } from './types';
|
|
3
|
-
import { StructuredTextCustomBlockStyle, StructuredTextCustomMark } from '.';
|
|
4
3
|
export declare type SizingUtilities = {
|
|
5
4
|
/**
|
|
6
5
|
* Listens for DOM changes and automatically calls `setHeight` when it detects
|
|
@@ -85,20 +84,6 @@ export declare type FullConnectParameters = {
|
|
|
85
84
|
* @group forcedFieldExtensions
|
|
86
85
|
*/
|
|
87
86
|
overrideFieldExtensions: (field: Field, ctx: FieldIntentCtx) => FieldExtensionOverride | void;
|
|
88
|
-
/**
|
|
89
|
-
* Use this function to define a number of custom marks for a specific
|
|
90
|
-
* Structured Text field
|
|
91
|
-
*
|
|
92
|
-
* @group structuredText
|
|
93
|
-
*/
|
|
94
|
-
customMarksForStructuredTextField: (field: Field, ctx: FieldIntentCtx) => StructuredTextCustomMark[] | void;
|
|
95
|
-
/**
|
|
96
|
-
* Use this function to define a number of custom block styles for a specific
|
|
97
|
-
* Structured Text field
|
|
98
|
-
*
|
|
99
|
-
* @group structuredText
|
|
100
|
-
*/
|
|
101
|
-
customBlockStylesForStructuredTextField: (field: Field, ctx: FieldIntentCtx) => StructuredTextCustomBlockStyle[] | void;
|
|
102
87
|
/**
|
|
103
88
|
* This function will be called when the plugin needs to render the plugin's
|
|
104
89
|
* configuration form
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { BlockquoteType, CodeType, HeadingType, ListType, ParagraphType, ThematicBreakType } from 'datocms-structured-text-utils';
|
|
3
1
|
import { Account, Field, Fieldset, Item, ModelBlock, Plugin, Role, Site, SsoUser, Upload, User } from './SiteApiSchema';
|
|
4
2
|
export declare type Icon = string | {
|
|
5
3
|
type: 'svg';
|
|
@@ -34,7 +32,7 @@ export declare type MainNavigationTab = {
|
|
|
34
32
|
* be displayed by ascending `rank`. If you want to specify an explicit value
|
|
35
33
|
* for `rank`, make sure to offer a way for final users to customize it inside
|
|
36
34
|
* the plugin's settings form, otherwise the hardcoded value you choose might
|
|
37
|
-
* clash with the one of another plugin!
|
|
35
|
+
* clash with the one of another plugin! *
|
|
38
36
|
*/
|
|
39
37
|
rank?: number;
|
|
40
38
|
};
|
|
@@ -249,65 +247,6 @@ export declare type AddonOverride = {
|
|
|
249
247
|
/** The initial height to set for the iframe that will render the field extension */
|
|
250
248
|
initialHeight?: number;
|
|
251
249
|
};
|
|
252
|
-
export declare type StructuredTextCustomMarkPlacement = [
|
|
253
|
-
'before' | 'after',
|
|
254
|
-
'strong' | 'emphasis' | 'underline' | 'code' | 'highlight' | 'strikethrough'
|
|
255
|
-
];
|
|
256
|
-
/** An object expressing a custom mark for a Structured Text field */
|
|
257
|
-
export declare type StructuredTextCustomMark = {
|
|
258
|
-
/** ID of mark */
|
|
259
|
-
id: string;
|
|
260
|
-
/** Label representing the custom mark */
|
|
261
|
-
label: string;
|
|
262
|
-
toolbarButton: {
|
|
263
|
-
/**
|
|
264
|
-
* Icon to be shown alongside the label. Can be a FontAwesome icon name (ie.
|
|
265
|
-
* `"address-book"`) or a custom SVG definition. To maintain visual
|
|
266
|
-
* consistency with the rest of the interface, try to use FontAwesome icons
|
|
267
|
-
* whenever possible
|
|
268
|
-
*/
|
|
269
|
-
icon: Icon;
|
|
270
|
-
/**
|
|
271
|
-
* Expresses where you want the custom mark button to be placed inside the
|
|
272
|
-
* toolbar. If not specified, the item will be placed after the standard
|
|
273
|
-
* marks provided by DatoCMS itself.
|
|
274
|
-
*/
|
|
275
|
-
placement?: StructuredTextCustomMarkPlacement;
|
|
276
|
-
/**
|
|
277
|
-
* If multiple custom marks specify the same `placement` for their toolbar
|
|
278
|
-
* button, they will be sorted by ascending `rank`. If you want to specify
|
|
279
|
-
* an explicit value for `rank`, make sure to offer a way for final users to
|
|
280
|
-
* customize it inside the plugin's settings form, otherwise the hardcoded
|
|
281
|
-
* value you choose might clash with the one of another plugin!
|
|
282
|
-
*/
|
|
283
|
-
rank?: number;
|
|
284
|
-
};
|
|
285
|
-
/**
|
|
286
|
-
* Keyboard shortcut associated with the custom mark, expressed using the
|
|
287
|
-
* https://github.com/ianstormtaylor/is-hotkey syntax (ie. `mod+shift+x`)
|
|
288
|
-
*/
|
|
289
|
-
keyboardShortcut?: string;
|
|
290
|
-
/** How the custom mark will be styled inside the editor */
|
|
291
|
-
appliedStyle: React.CSSProperties;
|
|
292
|
-
};
|
|
293
|
-
/** An object expressing a custom block style for a Structured Text field */
|
|
294
|
-
export declare type StructuredTextCustomBlockStyle = {
|
|
295
|
-
/** ID of custom block style */
|
|
296
|
-
id: string;
|
|
297
|
-
/** The block node that can apply this style */
|
|
298
|
-
node: ParagraphType | HeadingType | ListType | BlockquoteType | CodeType | ThematicBreakType;
|
|
299
|
-
/** ID of custom block style */
|
|
300
|
-
label: string;
|
|
301
|
-
/** How the block will be styled inside the editor to represent the style */
|
|
302
|
-
appliedStyle: React.CSSProperties;
|
|
303
|
-
/**
|
|
304
|
-
* Custom styles for a block node will be sorted by ascending `rank`. If you
|
|
305
|
-
* want to specify an explicit value for `rank`, make sure to offer a way for
|
|
306
|
-
* final users to customize it inside the plugin's settings form, otherwise
|
|
307
|
-
* the hardcoded value you choose might clash with the one of another plugin!
|
|
308
|
-
*/
|
|
309
|
-
rank?: number;
|
|
310
|
-
};
|
|
311
250
|
/** An object expressing some field extensions you want to force on a particular field */
|
|
312
251
|
export declare type FieldExtensionOverride = {
|
|
313
252
|
/** Force a field editor/sidebar extension on a field */
|
|
@@ -1085,7 +1024,7 @@ export declare type ItemFormAdditionalMethods = {
|
|
|
1085
1024
|
* await ctx.saveCurrentItem();
|
|
1086
1025
|
* ```
|
|
1087
1026
|
*/
|
|
1088
|
-
saveCurrentItem: () => Promise<void>;
|
|
1027
|
+
saveCurrentItem: (showToast?: boolean) => Promise<void>;
|
|
1089
1028
|
};
|
|
1090
1029
|
export declare type ItemFormMethods = RenderMethods & IframeMethods & ItemFormAdditionalMethods;
|
|
1091
1030
|
/** Information regarding the specific sidebar panel that you need to render */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "datocms-plugin-sdk",
|
|
3
|
-
"version": "0.3.34
|
|
3
|
+
"version": "0.3.34",
|
|
4
4
|
"description": "DatoCMS Plugin SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datocms",
|
|
@@ -36,12 +36,10 @@
|
|
|
36
36
|
"url": "https://github.com/datocms/plugins-sdk/issues"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"datocms-structured-text-utils": "1.2.3-alpha.0",
|
|
40
39
|
"penpal": "^4.1.1"
|
|
41
40
|
},
|
|
42
41
|
"devDependencies": {
|
|
43
|
-
"@types/react": "^17.0.3",
|
|
44
42
|
"typedoc": "^0.22.8"
|
|
45
43
|
},
|
|
46
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "6d45ff0912ff738fec1e5e74662b7a166d578082"
|
|
47
45
|
}
|
package/src/connect.ts
CHANGED
|
@@ -38,7 +38,6 @@ import {
|
|
|
38
38
|
isRenderSidebarPaneParent,
|
|
39
39
|
Parent,
|
|
40
40
|
} from './guards';
|
|
41
|
-
import { StructuredTextCustomBlockStyle, StructuredTextCustomMark } from '.';
|
|
42
41
|
|
|
43
42
|
export type SizingUtilities = {
|
|
44
43
|
/**
|
|
@@ -140,29 +139,6 @@ export type FullConnectParameters = {
|
|
|
140
139
|
field: Field,
|
|
141
140
|
ctx: FieldIntentCtx,
|
|
142
141
|
) => FieldExtensionOverride | void;
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Use this function to define a number of custom marks for a specific
|
|
146
|
-
* Structured Text field
|
|
147
|
-
*
|
|
148
|
-
* @group structuredText
|
|
149
|
-
*/
|
|
150
|
-
customMarksForStructuredTextField: (
|
|
151
|
-
field: Field,
|
|
152
|
-
ctx: FieldIntentCtx,
|
|
153
|
-
) => StructuredTextCustomMark[] | void;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Use this function to define a number of custom block styles for a specific
|
|
157
|
-
* Structured Text field
|
|
158
|
-
*
|
|
159
|
-
* @group structuredText
|
|
160
|
-
*/
|
|
161
|
-
customBlockStylesForStructuredTextField: (
|
|
162
|
-
field: Field,
|
|
163
|
-
ctx: FieldIntentCtx,
|
|
164
|
-
) => StructuredTextCustomBlockStyle[] | void;
|
|
165
|
-
|
|
166
142
|
/**
|
|
167
143
|
* This function will be called when the plugin needs to render the plugin's
|
|
168
144
|
* configuration form
|
|
@@ -365,12 +341,6 @@ export async function connect(
|
|
|
365
341
|
overrideFieldExtensions: toMultifield(
|
|
366
342
|
configuration.overrideFieldExtensions,
|
|
367
343
|
),
|
|
368
|
-
customMarksForStructuredTextField: toMultifield(
|
|
369
|
-
configuration.customMarksForStructuredTextField,
|
|
370
|
-
),
|
|
371
|
-
customBlockStylesForStructuredTextField: toMultifield(
|
|
372
|
-
configuration.customBlockStylesForStructuredTextField,
|
|
373
|
-
),
|
|
374
344
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
375
345
|
onChange(newSettings: any) {
|
|
376
346
|
if (listener) {
|
package/src/types.ts
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
BlockquoteType,
|
|
3
|
-
CodeType,
|
|
4
|
-
HeadingType,
|
|
5
|
-
ListType,
|
|
6
|
-
ParagraphType,
|
|
7
|
-
ThematicBreakType,
|
|
8
|
-
} from 'datocms-structured-text-utils';
|
|
9
|
-
|
|
10
1
|
import {
|
|
11
2
|
Account,
|
|
12
3
|
Field,
|
|
@@ -51,7 +42,7 @@ export type MainNavigationTab = {
|
|
|
51
42
|
* be displayed by ascending `rank`. If you want to specify an explicit value
|
|
52
43
|
* for `rank`, make sure to offer a way for final users to customize it inside
|
|
53
44
|
* the plugin's settings form, otherwise the hardcoded value you choose might
|
|
54
|
-
* clash with the one of another plugin!
|
|
45
|
+
* clash with the one of another plugin! *
|
|
55
46
|
*/
|
|
56
47
|
rank?: number;
|
|
57
48
|
};
|
|
@@ -300,74 +291,6 @@ export type AddonOverride = {
|
|
|
300
291
|
initialHeight?: number;
|
|
301
292
|
};
|
|
302
293
|
|
|
303
|
-
export type StructuredTextCustomMarkPlacement = [
|
|
304
|
-
'before' | 'after',
|
|
305
|
-
'strong' | 'emphasis' | 'underline' | 'code' | 'highlight' | 'strikethrough',
|
|
306
|
-
];
|
|
307
|
-
|
|
308
|
-
/** An object expressing a custom mark for a Structured Text field */
|
|
309
|
-
export type StructuredTextCustomMark = {
|
|
310
|
-
/** ID of mark */
|
|
311
|
-
id: string;
|
|
312
|
-
/** Label representing the custom mark */
|
|
313
|
-
label: string;
|
|
314
|
-
toolbarButton: {
|
|
315
|
-
/**
|
|
316
|
-
* Icon to be shown alongside the label. Can be a FontAwesome icon name (ie.
|
|
317
|
-
* `"address-book"`) or a custom SVG definition. To maintain visual
|
|
318
|
-
* consistency with the rest of the interface, try to use FontAwesome icons
|
|
319
|
-
* whenever possible
|
|
320
|
-
*/
|
|
321
|
-
icon: Icon;
|
|
322
|
-
/**
|
|
323
|
-
* Expresses where you want the custom mark button to be placed inside the
|
|
324
|
-
* toolbar. If not specified, the item will be placed after the standard
|
|
325
|
-
* marks provided by DatoCMS itself.
|
|
326
|
-
*/
|
|
327
|
-
placement?: StructuredTextCustomMarkPlacement;
|
|
328
|
-
/**
|
|
329
|
-
* If multiple custom marks specify the same `placement` for their toolbar
|
|
330
|
-
* button, they will be sorted by ascending `rank`. If you want to specify
|
|
331
|
-
* an explicit value for `rank`, make sure to offer a way for final users to
|
|
332
|
-
* customize it inside the plugin's settings form, otherwise the hardcoded
|
|
333
|
-
* value you choose might clash with the one of another plugin!
|
|
334
|
-
*/
|
|
335
|
-
rank?: number;
|
|
336
|
-
};
|
|
337
|
-
/**
|
|
338
|
-
* Keyboard shortcut associated with the custom mark, expressed using the
|
|
339
|
-
* https://github.com/ianstormtaylor/is-hotkey syntax (ie. `mod+shift+x`)
|
|
340
|
-
*/
|
|
341
|
-
keyboardShortcut?: string;
|
|
342
|
-
/** How the custom mark will be styled inside the editor */
|
|
343
|
-
appliedStyle: React.CSSProperties;
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
/** An object expressing a custom block style for a Structured Text field */
|
|
347
|
-
export type StructuredTextCustomBlockStyle = {
|
|
348
|
-
/** ID of custom block style */
|
|
349
|
-
id: string;
|
|
350
|
-
/** The block node that can apply this style */
|
|
351
|
-
node:
|
|
352
|
-
| ParagraphType
|
|
353
|
-
| HeadingType
|
|
354
|
-
| ListType
|
|
355
|
-
| BlockquoteType
|
|
356
|
-
| CodeType
|
|
357
|
-
| ThematicBreakType;
|
|
358
|
-
/** ID of custom block style */
|
|
359
|
-
label: string;
|
|
360
|
-
/** How the block will be styled inside the editor to represent the style */
|
|
361
|
-
appliedStyle: React.CSSProperties;
|
|
362
|
-
/**
|
|
363
|
-
* Custom styles for a block node will be sorted by ascending `rank`. If you
|
|
364
|
-
* want to specify an explicit value for `rank`, make sure to offer a way for
|
|
365
|
-
* final users to customize it inside the plugin's settings form, otherwise
|
|
366
|
-
* the hardcoded value you choose might clash with the one of another plugin!
|
|
367
|
-
*/
|
|
368
|
-
rank?: number;
|
|
369
|
-
};
|
|
370
|
-
|
|
371
294
|
/** An object expressing some field extensions you want to force on a particular field */
|
|
372
295
|
export type FieldExtensionOverride = {
|
|
373
296
|
/** Force a field editor/sidebar extension on a field */
|
|
@@ -1188,7 +1111,7 @@ export type ItemFormAdditionalMethods = {
|
|
|
1188
1111
|
* await ctx.saveCurrentItem();
|
|
1189
1112
|
* ```
|
|
1190
1113
|
*/
|
|
1191
|
-
saveCurrentItem: () => Promise<void>;
|
|
1114
|
+
saveCurrentItem: (showToast?: boolean) => Promise<void>;
|
|
1192
1115
|
};
|
|
1193
1116
|
|
|
1194
1117
|
export type ItemFormMethods = RenderMethods &
|