datocms-plugin-sdk 0.3.34 → 0.3.35-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 +2 -0
- package/dist/cjs/connect.js.map +1 -1
- package/dist/esm/connect.d.ts +15 -0
- package/dist/esm/connect.js +2 -0
- package/dist/esm/connect.js.map +1 -1
- package/dist/esm/types.d.ts +60 -1
- package/dist/types/connect.d.ts +15 -0
- package/dist/types/types.d.ts +60 -1
- package/package.json +4 -2
- package/src/connect.ts +30 -0
- package/src/types.ts +63 -1
- package/types.json +1952 -1374
package/dist/cjs/connect.js
CHANGED
|
@@ -136,6 +136,8 @@ 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),
|
|
139
141
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
140
142
|
onChange: function (newSettings) {
|
|
141
143
|
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;AAqMlB,SAAS,YAAY,CACnB,EAA+D;IAE/D,OAAO,UACL,MAA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AAC,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;AAlOD,0BAkOC"}
|
package/dist/esm/connect.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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 '.';
|
|
3
4
|
export declare type SizingUtilities = {
|
|
4
5
|
/**
|
|
5
6
|
* Listens for DOM changes and automatically calls `setHeight` when it detects
|
|
@@ -84,6 +85,20 @@ export declare type FullConnectParameters = {
|
|
|
84
85
|
* @group forcedFieldExtensions
|
|
85
86
|
*/
|
|
86
87
|
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;
|
|
87
102
|
/**
|
|
88
103
|
* This function will be called when the plugin needs to render the plugin's
|
|
89
104
|
* configuration form
|
package/dist/esm/connect.js
CHANGED
|
@@ -130,6 +130,8 @@ 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),
|
|
133
135
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
134
136
|
onChange: function (newSettings) {
|
|
135
137
|
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,EAC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AM,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/esm/types.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BlockNodeTypeWithCustomStyle } from 'datocms-structured-text-utils';
|
|
1
3
|
import { Account, Field, Fieldset, Item, ModelBlock, Plugin, Role, Site, SsoUser, Upload, User } from './SiteApiSchema';
|
|
2
4
|
export declare type Icon = string | {
|
|
3
5
|
type: 'svg';
|
|
@@ -32,7 +34,7 @@ export declare type MainNavigationTab = {
|
|
|
32
34
|
* be displayed by ascending `rank`. If you want to specify an explicit value
|
|
33
35
|
* for `rank`, make sure to offer a way for final users to customize it inside
|
|
34
36
|
* the plugin's settings form, otherwise the hardcoded value you choose might
|
|
35
|
-
* clash with the one of another plugin!
|
|
37
|
+
* clash with the one of another plugin!
|
|
36
38
|
*/
|
|
37
39
|
rank?: number;
|
|
38
40
|
};
|
|
@@ -247,6 +249,63 @@ export declare type AddonOverride = {
|
|
|
247
249
|
/** The initial height to set for the iframe that will render the field extension */
|
|
248
250
|
initialHeight?: number;
|
|
249
251
|
};
|
|
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
|
+
/**
|
|
263
|
+
* Icon to be shown alongside the label. Can be a FontAwesome icon name (ie.
|
|
264
|
+
* `"address-book"`) or a custom SVG definition. To maintain visual
|
|
265
|
+
* consistency with the rest of the interface, try to use FontAwesome icons
|
|
266
|
+
* whenever possible
|
|
267
|
+
*/
|
|
268
|
+
icon: Icon;
|
|
269
|
+
/**
|
|
270
|
+
* Expresses where you want the custom mark button to be placed inside the
|
|
271
|
+
* toolbar. If not specified, the item will be placed after the standard marks
|
|
272
|
+
* provided by DatoCMS itself.
|
|
273
|
+
*/
|
|
274
|
+
placement?: StructuredTextCustomMarkPlacement;
|
|
275
|
+
/**
|
|
276
|
+
* If multiple custom marks specify the same `placement` for their toolbar
|
|
277
|
+
* button, they will be sorted by ascending `rank`. If you want to specify an
|
|
278
|
+
* explicit value for `rank`, make sure to offer a way for final users to
|
|
279
|
+
* customize it inside the plugin's settings form, otherwise the hardcoded
|
|
280
|
+
* value you choose might clash with the one of another plugin!
|
|
281
|
+
*/
|
|
282
|
+
rank?: number;
|
|
283
|
+
/**
|
|
284
|
+
* Keyboard shortcut associated with the custom mark, expressed using the
|
|
285
|
+
* https://github.com/ianstormtaylor/is-hotkey syntax (ie. `mod+shift+x`)
|
|
286
|
+
*/
|
|
287
|
+
keyboardShortcut?: string;
|
|
288
|
+
/** How the custom mark will be styled inside the editor */
|
|
289
|
+
appliedStyle: React.CSSProperties;
|
|
290
|
+
};
|
|
291
|
+
/** An object expressing a custom block style for a Structured Text field */
|
|
292
|
+
export declare type StructuredTextCustomBlockStyle = {
|
|
293
|
+
/** ID of custom block style */
|
|
294
|
+
id: string;
|
|
295
|
+
/** The block node that can apply this style */
|
|
296
|
+
node: BlockNodeTypeWithCustomStyle;
|
|
297
|
+
/** ID of custom block style */
|
|
298
|
+
label: string;
|
|
299
|
+
/** How the block will be styled inside the editor to represent the style */
|
|
300
|
+
appliedStyle: React.CSSProperties;
|
|
301
|
+
/**
|
|
302
|
+
* Custom styles for a block node will be sorted by ascending `rank`. If you
|
|
303
|
+
* want to specify an explicit value for `rank`, make sure to offer a way for
|
|
304
|
+
* final users to customize it inside the plugin's settings form, otherwise
|
|
305
|
+
* the hardcoded value you choose might clash with the one of another plugin!
|
|
306
|
+
*/
|
|
307
|
+
rank?: number;
|
|
308
|
+
};
|
|
250
309
|
/** An object expressing some field extensions you want to force on a particular field */
|
|
251
310
|
export declare type FieldExtensionOverride = {
|
|
252
311
|
/** Force a field editor/sidebar extension on a field */
|
package/dist/types/connect.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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 '.';
|
|
3
4
|
export declare type SizingUtilities = {
|
|
4
5
|
/**
|
|
5
6
|
* Listens for DOM changes and automatically calls `setHeight` when it detects
|
|
@@ -84,6 +85,20 @@ export declare type FullConnectParameters = {
|
|
|
84
85
|
* @group forcedFieldExtensions
|
|
85
86
|
*/
|
|
86
87
|
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;
|
|
87
102
|
/**
|
|
88
103
|
* This function will be called when the plugin needs to render the plugin's
|
|
89
104
|
* configuration form
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BlockNodeTypeWithCustomStyle } from 'datocms-structured-text-utils';
|
|
1
3
|
import { Account, Field, Fieldset, Item, ModelBlock, Plugin, Role, Site, SsoUser, Upload, User } from './SiteApiSchema';
|
|
2
4
|
export declare type Icon = string | {
|
|
3
5
|
type: 'svg';
|
|
@@ -32,7 +34,7 @@ export declare type MainNavigationTab = {
|
|
|
32
34
|
* be displayed by ascending `rank`. If you want to specify an explicit value
|
|
33
35
|
* for `rank`, make sure to offer a way for final users to customize it inside
|
|
34
36
|
* the plugin's settings form, otherwise the hardcoded value you choose might
|
|
35
|
-
* clash with the one of another plugin!
|
|
37
|
+
* clash with the one of another plugin!
|
|
36
38
|
*/
|
|
37
39
|
rank?: number;
|
|
38
40
|
};
|
|
@@ -247,6 +249,63 @@ export declare type AddonOverride = {
|
|
|
247
249
|
/** The initial height to set for the iframe that will render the field extension */
|
|
248
250
|
initialHeight?: number;
|
|
249
251
|
};
|
|
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
|
+
/**
|
|
263
|
+
* Icon to be shown alongside the label. Can be a FontAwesome icon name (ie.
|
|
264
|
+
* `"address-book"`) or a custom SVG definition. To maintain visual
|
|
265
|
+
* consistency with the rest of the interface, try to use FontAwesome icons
|
|
266
|
+
* whenever possible
|
|
267
|
+
*/
|
|
268
|
+
icon: Icon;
|
|
269
|
+
/**
|
|
270
|
+
* Expresses where you want the custom mark button to be placed inside the
|
|
271
|
+
* toolbar. If not specified, the item will be placed after the standard marks
|
|
272
|
+
* provided by DatoCMS itself.
|
|
273
|
+
*/
|
|
274
|
+
placement?: StructuredTextCustomMarkPlacement;
|
|
275
|
+
/**
|
|
276
|
+
* If multiple custom marks specify the same `placement` for their toolbar
|
|
277
|
+
* button, they will be sorted by ascending `rank`. If you want to specify an
|
|
278
|
+
* explicit value for `rank`, make sure to offer a way for final users to
|
|
279
|
+
* customize it inside the plugin's settings form, otherwise the hardcoded
|
|
280
|
+
* value you choose might clash with the one of another plugin!
|
|
281
|
+
*/
|
|
282
|
+
rank?: number;
|
|
283
|
+
/**
|
|
284
|
+
* Keyboard shortcut associated with the custom mark, expressed using the
|
|
285
|
+
* https://github.com/ianstormtaylor/is-hotkey syntax (ie. `mod+shift+x`)
|
|
286
|
+
*/
|
|
287
|
+
keyboardShortcut?: string;
|
|
288
|
+
/** How the custom mark will be styled inside the editor */
|
|
289
|
+
appliedStyle: React.CSSProperties;
|
|
290
|
+
};
|
|
291
|
+
/** An object expressing a custom block style for a Structured Text field */
|
|
292
|
+
export declare type StructuredTextCustomBlockStyle = {
|
|
293
|
+
/** ID of custom block style */
|
|
294
|
+
id: string;
|
|
295
|
+
/** The block node that can apply this style */
|
|
296
|
+
node: BlockNodeTypeWithCustomStyle;
|
|
297
|
+
/** ID of custom block style */
|
|
298
|
+
label: string;
|
|
299
|
+
/** How the block will be styled inside the editor to represent the style */
|
|
300
|
+
appliedStyle: React.CSSProperties;
|
|
301
|
+
/**
|
|
302
|
+
* Custom styles for a block node will be sorted by ascending `rank`. If you
|
|
303
|
+
* want to specify an explicit value for `rank`, make sure to offer a way for
|
|
304
|
+
* final users to customize it inside the plugin's settings form, otherwise
|
|
305
|
+
* the hardcoded value you choose might clash with the one of another plugin!
|
|
306
|
+
*/
|
|
307
|
+
rank?: number;
|
|
308
|
+
};
|
|
250
309
|
/** An object expressing some field extensions you want to force on a particular field */
|
|
251
310
|
export declare type FieldExtensionOverride = {
|
|
252
311
|
/** Force a field editor/sidebar extension on a field */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "datocms-plugin-sdk",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.35-alpha.0",
|
|
4
4
|
"description": "DatoCMS Plugin SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datocms",
|
|
@@ -36,10 +36,12 @@
|
|
|
36
36
|
"url": "https://github.com/datocms/plugins-sdk/issues"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
+
"datocms-structured-text-utils": "next",
|
|
39
40
|
"penpal": "^4.1.1"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
43
|
+
"@types/react": "^17.0.3",
|
|
42
44
|
"typedoc": "^0.22.8"
|
|
43
45
|
},
|
|
44
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "160c57bb738835b4c1266e7bed914e1e5b71f0bb"
|
|
45
47
|
}
|
package/src/connect.ts
CHANGED
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
isRenderSidebarPaneParent,
|
|
39
39
|
Parent,
|
|
40
40
|
} from './guards';
|
|
41
|
+
import { StructuredTextCustomBlockStyle, StructuredTextCustomMark } from '.';
|
|
41
42
|
|
|
42
43
|
export type SizingUtilities = {
|
|
43
44
|
/**
|
|
@@ -139,6 +140,29 @@ export type FullConnectParameters = {
|
|
|
139
140
|
field: Field,
|
|
140
141
|
ctx: FieldIntentCtx,
|
|
141
142
|
) => 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
|
+
|
|
142
166
|
/**
|
|
143
167
|
* This function will be called when the plugin needs to render the plugin's
|
|
144
168
|
* configuration form
|
|
@@ -341,6 +365,12 @@ export async function connect(
|
|
|
341
365
|
overrideFieldExtensions: toMultifield(
|
|
342
366
|
configuration.overrideFieldExtensions,
|
|
343
367
|
),
|
|
368
|
+
customMarksForStructuredTextField: toMultifield(
|
|
369
|
+
configuration.customMarksForStructuredTextField,
|
|
370
|
+
),
|
|
371
|
+
customBlockStylesForStructuredTextField: toMultifield(
|
|
372
|
+
configuration.customBlockStylesForStructuredTextField,
|
|
373
|
+
),
|
|
344
374
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
345
375
|
onChange(newSettings: any) {
|
|
346
376
|
if (listener) {
|
package/src/types.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { BlockNodeTypeWithCustomStyle } from 'datocms-structured-text-utils';
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
4
|
Account,
|
|
3
5
|
Field,
|
|
@@ -42,7 +44,7 @@ export type MainNavigationTab = {
|
|
|
42
44
|
* be displayed by ascending `rank`. If you want to specify an explicit value
|
|
43
45
|
* for `rank`, make sure to offer a way for final users to customize it inside
|
|
44
46
|
* the plugin's settings form, otherwise the hardcoded value you choose might
|
|
45
|
-
* clash with the one of another plugin!
|
|
47
|
+
* clash with the one of another plugin!
|
|
46
48
|
*/
|
|
47
49
|
rank?: number;
|
|
48
50
|
};
|
|
@@ -291,6 +293,66 @@ export type AddonOverride = {
|
|
|
291
293
|
initialHeight?: number;
|
|
292
294
|
};
|
|
293
295
|
|
|
296
|
+
export type StructuredTextCustomMarkPlacement = [
|
|
297
|
+
'before' | 'after',
|
|
298
|
+
'strong' | 'emphasis' | 'underline' | 'code' | 'highlight' | 'strikethrough',
|
|
299
|
+
];
|
|
300
|
+
|
|
301
|
+
/** An object expressing a custom mark for a Structured Text field */
|
|
302
|
+
export type StructuredTextCustomMark = {
|
|
303
|
+
/** ID of mark */
|
|
304
|
+
id: string;
|
|
305
|
+
/** Label representing the custom mark */
|
|
306
|
+
label: string;
|
|
307
|
+
/**
|
|
308
|
+
* Icon to be shown alongside the label. Can be a FontAwesome icon name (ie.
|
|
309
|
+
* `"address-book"`) or a custom SVG definition. To maintain visual
|
|
310
|
+
* consistency with the rest of the interface, try to use FontAwesome icons
|
|
311
|
+
* whenever possible
|
|
312
|
+
*/
|
|
313
|
+
icon: Icon;
|
|
314
|
+
/**
|
|
315
|
+
* Expresses where you want the custom mark button to be placed inside the
|
|
316
|
+
* toolbar. If not specified, the item will be placed after the standard marks
|
|
317
|
+
* provided by DatoCMS itself.
|
|
318
|
+
*/
|
|
319
|
+
placement?: StructuredTextCustomMarkPlacement;
|
|
320
|
+
/**
|
|
321
|
+
* If multiple custom marks specify the same `placement` for their toolbar
|
|
322
|
+
* button, they will be sorted by ascending `rank`. If you want to specify an
|
|
323
|
+
* explicit value for `rank`, make sure to offer a way for final users to
|
|
324
|
+
* customize it inside the plugin's settings form, otherwise the hardcoded
|
|
325
|
+
* value you choose might clash with the one of another plugin!
|
|
326
|
+
*/
|
|
327
|
+
rank?: number;
|
|
328
|
+
/**
|
|
329
|
+
* Keyboard shortcut associated with the custom mark, expressed using the
|
|
330
|
+
* https://github.com/ianstormtaylor/is-hotkey syntax (ie. `mod+shift+x`)
|
|
331
|
+
*/
|
|
332
|
+
keyboardShortcut?: string;
|
|
333
|
+
/** How the custom mark will be styled inside the editor */
|
|
334
|
+
appliedStyle: React.CSSProperties;
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
/** An object expressing a custom block style for a Structured Text field */
|
|
338
|
+
export type StructuredTextCustomBlockStyle = {
|
|
339
|
+
/** ID of custom block style */
|
|
340
|
+
id: string;
|
|
341
|
+
/** The block node that can apply this style */
|
|
342
|
+
node: BlockNodeTypeWithCustomStyle;
|
|
343
|
+
/** ID of custom block style */
|
|
344
|
+
label: string;
|
|
345
|
+
/** How the block will be styled inside the editor to represent the style */
|
|
346
|
+
appliedStyle: React.CSSProperties;
|
|
347
|
+
/**
|
|
348
|
+
* Custom styles for a block node will be sorted by ascending `rank`. If you
|
|
349
|
+
* want to specify an explicit value for `rank`, make sure to offer a way for
|
|
350
|
+
* final users to customize it inside the plugin's settings form, otherwise
|
|
351
|
+
* the hardcoded value you choose might clash with the one of another plugin!
|
|
352
|
+
*/
|
|
353
|
+
rank?: number;
|
|
354
|
+
};
|
|
355
|
+
|
|
294
356
|
/** An object expressing some field extensions you want to force on a particular field */
|
|
295
357
|
export type FieldExtensionOverride = {
|
|
296
358
|
/** Force a field editor/sidebar extension on a field */
|