@crashbytes/contentful-richtext-editor 1.0.9 → 1.0.11
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/README.md +118 -472
- package/dist/index.css +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +353 -241
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +353 -241
- package/dist/index.js.map +1 -1
- package/package.json +32 -9
- package/dist/components/ContentfulDocument.d.ts +0 -2
- package/dist/components/ContentfulEditor.d.ts +0 -34
- package/dist/components/ContentfulEditor.stories.d.ts +0 -18
- package/dist/components/ContentfulEmbedded.d.ts +0 -15
- package/dist/components/Toolbar.d.ts +0 -14
- package/dist/components/Toolbar.stories.d.ts +0 -10
- package/dist/index.d.ts +0 -8
- package/dist/testData/samples.d.ts +0 -11
- package/dist/utils/configParser.d.ts +0 -37
- package/dist/utils/contentfulTransform.d.ts +0 -48
- package/dist/utils/contentfulTransform.stories.d.ts +0 -6
- package/dist/utils/types.d.ts +0 -141
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crashbytes/contentful-richtext-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "A Tiptap-based rich text editor compatible with Contentful's rich text format",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,7 +30,18 @@
|
|
|
30
30
|
"clean": "rm -rf dist",
|
|
31
31
|
"prepublishOnly": "npm run clean && npm run build",
|
|
32
32
|
"storybook": "storybook dev -p 6006",
|
|
33
|
-
"build-storybook": "storybook build"
|
|
33
|
+
"build-storybook": "storybook build",
|
|
34
|
+
"release": "standard-version",
|
|
35
|
+
"release:minor": "standard-version --release-as minor",
|
|
36
|
+
"release:major": "standard-version --release-as major",
|
|
37
|
+
"release:patch": "standard-version --release-as patch",
|
|
38
|
+
"release:prerelease": "standard-version --prerelease",
|
|
39
|
+
"release:alpha": "standard-version --prerelease alpha",
|
|
40
|
+
"release:beta": "standard-version --prerelease beta",
|
|
41
|
+
"test": "jest",
|
|
42
|
+
"test:watch": "jest --watchAll=false",
|
|
43
|
+
"test:coverage": "jest --coverage",
|
|
44
|
+
"test:ci": "jest --ci --coverage --watchAll=false"
|
|
34
45
|
},
|
|
35
46
|
"peerDependencies": {
|
|
36
47
|
"react": ">=16.8.0",
|
|
@@ -50,19 +61,31 @@
|
|
|
50
61
|
"@tiptap/starter-kit": "^2.0.0"
|
|
51
62
|
},
|
|
52
63
|
"devDependencies": {
|
|
64
|
+
"@babel/preset-env": "^7.27.2",
|
|
65
|
+
"@babel/preset-react": "^7.27.1",
|
|
66
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
53
67
|
"@rollup/plugin-babel": "^6.0.4",
|
|
54
68
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
55
69
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
56
70
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
57
|
-
"@storybook/addon-
|
|
58
|
-
"@storybook/
|
|
59
|
-
"@storybook/addon-links": "^7.6.20",
|
|
60
|
-
"@storybook/blocks": "^7.6.20",
|
|
61
|
-
"@storybook/react": "^7.6.20",
|
|
62
|
-
"@storybook/react-vite": "^7.6.20",
|
|
71
|
+
"@storybook/addon-links": "^9.0.14",
|
|
72
|
+
"@storybook/react-vite": "^9.0.14",
|
|
63
73
|
"@storybook/testing-library": "^0.2.2",
|
|
74
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
75
|
+
"@testing-library/react": "^16.3.0",
|
|
76
|
+
"@testing-library/user-event": "^14.6.1",
|
|
77
|
+
"@types/jest": "^30.0.0",
|
|
78
|
+
"babel-jest": "^30.0.2",
|
|
79
|
+
"identity-obj-proxy": "^3.0.0",
|
|
80
|
+
"jest": "^30.0.3",
|
|
81
|
+
"jest-environment-jsdom": "^30.0.2",
|
|
82
|
+
"jest-transform-stub": "^2.0.0",
|
|
64
83
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
65
84
|
"rollup-plugin-postcss": "^4.0.2",
|
|
66
|
-
"
|
|
85
|
+
"standard-version": "^9.5.0",
|
|
86
|
+
"storybook": "^9.0.14",
|
|
87
|
+
"ts-jest": "^29.4.0",
|
|
88
|
+
"vite": "^5.4.19",
|
|
89
|
+
"@storybook/addon-docs": "^9.0.14"
|
|
67
90
|
}
|
|
68
91
|
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Document } from '@contentful/rich-text-types';
|
|
3
|
-
import type { ContentfulFieldConfiguration } from '../utils/configParser';
|
|
4
|
-
import '../styles/editor.css';
|
|
5
|
-
export interface ContentfulRichTextEditorProps {
|
|
6
|
-
/** Initial Contentful rich text document */
|
|
7
|
-
initialValue?: Document;
|
|
8
|
-
/** Callback when content changes - returns Contentful Document */
|
|
9
|
-
onChange?: (document: Document) => void;
|
|
10
|
-
/** Callback for handling embedded entries */
|
|
11
|
-
onEmbedEntry?: () => Promise<any> | void;
|
|
12
|
-
/** Callback for handling embedded assets */
|
|
13
|
-
onEmbedAsset?: () => Promise<any> | void;
|
|
14
|
-
/** Callback for handling inline entries */
|
|
15
|
-
onEmbedInlineEntry?: () => Promise<any> | void;
|
|
16
|
-
/** Custom CSS classes */
|
|
17
|
-
className?: string;
|
|
18
|
-
/** Whether the editor is read-only */
|
|
19
|
-
readonly?: boolean;
|
|
20
|
-
/** Placeholder text */
|
|
21
|
-
placeholder?: string;
|
|
22
|
-
/** Contentful field configuration - takes precedence over manual settings */
|
|
23
|
-
fieldConfiguration?: ContentfulFieldConfiguration;
|
|
24
|
-
/** Manual disable features (fallback if no fieldConfiguration provided) */
|
|
25
|
-
disabledFeatures?: Array<'bold' | 'italic' | 'underline' | 'link' | 'lists' | 'headings' | 'quote' | 'table' | 'embed'>;
|
|
26
|
-
/** Custom styling options */
|
|
27
|
-
theme?: 'default' | 'minimal' | 'contentful';
|
|
28
|
-
/** Manual heading levels (fallback if no fieldConfiguration provided) */
|
|
29
|
-
availableHeadings?: Array<1 | 2 | 3 | 4 | 5 | 6>;
|
|
30
|
-
/** Manual text marks (fallback if no fieldConfiguration provided) */
|
|
31
|
-
availableMarks?: Array<'bold' | 'italic' | 'underline'>;
|
|
32
|
-
}
|
|
33
|
-
export declare const ContentfulRichTextEditor: React.FC<ContentfulRichTextEditorProps>;
|
|
34
|
-
export default ContentfulRichTextEditor;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
import { ContentfulRichTextEditor } from './ContentfulEditor';
|
|
3
|
-
declare const meta: Meta<typeof ContentfulRichTextEditor>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const BlogPostExample: Story;
|
|
8
|
-
export declare const MarketingCopyExample: Story;
|
|
9
|
-
export declare const TechnicalDocumentationExample: Story;
|
|
10
|
-
export declare const RecipeExample: Story;
|
|
11
|
-
export declare const ContentfulTheme: Story;
|
|
12
|
-
export declare const MinimalTheme: Story;
|
|
13
|
-
export declare const DefaultTheme: Story;
|
|
14
|
-
export declare const ReadOnly: Story;
|
|
15
|
-
export declare const LimitedFeatures: Story;
|
|
16
|
-
export declare const SimpleEditor: Story;
|
|
17
|
-
export declare const WithEmbedHandlers: Story;
|
|
18
|
-
export declare const CustomStyling: Story;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Node } from '@tiptap/core';
|
|
2
|
-
export declare const EmbeddedEntry: Node<any, any>;
|
|
3
|
-
export declare const InlineEmbeddedEntry: Node<any, any>;
|
|
4
|
-
export declare const EmbeddedAsset: Node<any, any>;
|
|
5
|
-
export declare const createEmbeddedEntryFromContentful: (entry: any) => {
|
|
6
|
-
entryId: any;
|
|
7
|
-
contentType: any;
|
|
8
|
-
title: any;
|
|
9
|
-
};
|
|
10
|
-
export declare const createEmbeddedAssetFromContentful: (asset: any) => {
|
|
11
|
-
assetId: any;
|
|
12
|
-
title: any;
|
|
13
|
-
url: any;
|
|
14
|
-
mimeType: any;
|
|
15
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Editor } from '@tiptap/react';
|
|
3
|
-
interface ToolbarProps {
|
|
4
|
-
editor: Editor;
|
|
5
|
-
onEmbedEntry?: () => void;
|
|
6
|
-
onEmbedAsset?: () => void;
|
|
7
|
-
onEmbedInlineEntry?: () => void;
|
|
8
|
-
disabledFeatures?: Array<string>;
|
|
9
|
-
availableHeadings?: Array<1 | 2 | 3 | 4 | 5 | 6>;
|
|
10
|
-
availableMarks?: Array<'bold' | 'italic' | 'underline'>;
|
|
11
|
-
allowHyperlinks?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare const ContentfulToolbar: React.FC<ToolbarProps>;
|
|
14
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
declare const MockToolbarWrapper: ({ disabledFeatures, availableHeadings, availableMarks, onEmbedEntry, onEmbedAsset, }: any) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare const meta: Meta<typeof MockToolbarWrapper>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const LimitedFeatures: Story;
|
|
8
|
-
export declare const MinimalToolbar: Story;
|
|
9
|
-
export declare const OnlyHeadings: Story;
|
|
10
|
-
export declare const NoEmbedControls: Story;
|
package/dist/index.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { ContentfulRichTextEditor } from './components/ContentfulEditor';
|
|
2
|
-
export type { ContentfulRichTextEditorProps } from './components/ContentfulEditor';
|
|
3
|
-
export { ContentfulToolbar } from './components/Toolbar';
|
|
4
|
-
export { contentfulToTiptap, tiptapToContentful, validateContentfulDocument, createEmptyDocument, sanitizeContentfulDocument, extractPlainText, countWords, findEmbeddedContent } from './utils/contentfulTransform';
|
|
5
|
-
export { parseContentfulFieldConfig, fetchContentfulFieldConfig, createMockFieldConfig, } from './utils/configParser';
|
|
6
|
-
export type { ContentfulEditorTheme, EmbeddedEntry, EmbeddedAsset, ContentfulFieldValidation, ContentfulFieldConfiguration, ParsedEditorConfig, EditorFeatureConfig, ContentfulNode, ContentfulText, ContentfulDocument, TiptapNode, TiptapDocument, EditorState, OnChangeCallback, OnEmbedCallback, ThemeConfig, ValidationRule, FieldValidationConfig, LocalizationConfig, A11yConfig, AdvancedEditorConfig, PluginConfig, DeepPartial, RequiredFields, OptionalFields, } from './utils/types';
|
|
7
|
-
export type { Document, Block, Inline, Text } from '@contentful/rich-text-types';
|
|
8
|
-
export { BLOCKS, MARKS, INLINES } from '@contentful/rich-text-types';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Document } from '@contentful/rich-text-types';
|
|
2
|
-
export declare const blogPostSample: Document;
|
|
3
|
-
export declare const marketingCopySample: Document;
|
|
4
|
-
export declare const technicalDocSample: Document;
|
|
5
|
-
export declare const recipeSample: Document;
|
|
6
|
-
export declare const testDataSamples: {
|
|
7
|
-
blogPost: Document;
|
|
8
|
-
marketingCopy: Document;
|
|
9
|
-
technicalDoc: Document;
|
|
10
|
-
recipe: Document;
|
|
11
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export interface ContentfulFieldValidation {
|
|
2
|
-
enabledMarks?: string[];
|
|
3
|
-
enabledNodeTypes?: string[];
|
|
4
|
-
}
|
|
5
|
-
export interface ContentfulFieldConfiguration {
|
|
6
|
-
validations?: ContentfulFieldValidation[];
|
|
7
|
-
settings?: {
|
|
8
|
-
helpText?: string;
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
export interface ParsedEditorConfig {
|
|
12
|
-
availableHeadings: Array<1 | 2 | 3 | 4 | 5 | 6>;
|
|
13
|
-
availableMarks: Array<'bold' | 'italic' | 'underline'>;
|
|
14
|
-
disabledFeatures: string[];
|
|
15
|
-
allowHyperlinks: boolean;
|
|
16
|
-
allowEmbeddedEntries: boolean;
|
|
17
|
-
allowEmbeddedAssets: boolean;
|
|
18
|
-
allowInlineEntries: boolean;
|
|
19
|
-
allowTables: boolean;
|
|
20
|
-
allowQuotes: boolean;
|
|
21
|
-
allowLists: boolean;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Parses Contentful field configuration to determine editor capabilities
|
|
25
|
-
*/
|
|
26
|
-
export declare const parseContentfulFieldConfig: (fieldConfiguration?: ContentfulFieldConfiguration) => ParsedEditorConfig;
|
|
27
|
-
/**
|
|
28
|
-
* Helper function to fetch Contentful field configuration from Management API
|
|
29
|
-
*/
|
|
30
|
-
export declare const fetchContentfulFieldConfig: (spaceId: string, contentTypeId: string, fieldId: string, accessToken: string) => Promise<ContentfulFieldConfiguration | null>;
|
|
31
|
-
/**
|
|
32
|
-
* Creates a mock field configuration for testing purposes
|
|
33
|
-
*/
|
|
34
|
-
export declare const createMockFieldConfig: (options: {
|
|
35
|
-
enabledMarks?: string[];
|
|
36
|
-
enabledNodeTypes?: string[];
|
|
37
|
-
}) => ContentfulFieldConfiguration;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Document } from '@contentful/rich-text-types';
|
|
2
|
-
interface TiptapNode {
|
|
3
|
-
type: string;
|
|
4
|
-
attrs?: Record<string, any>;
|
|
5
|
-
content?: TiptapNode[];
|
|
6
|
-
text?: string;
|
|
7
|
-
marks?: Array<{
|
|
8
|
-
type: string;
|
|
9
|
-
attrs?: Record<string, any>;
|
|
10
|
-
}>;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Converts a Contentful Rich Text Document to Tiptap JSON format
|
|
14
|
-
*/
|
|
15
|
-
export declare const contentfulToTiptap: (document: Document) => TiptapNode;
|
|
16
|
-
/**
|
|
17
|
-
* Converts Tiptap JSON format to Contentful Rich Text Document
|
|
18
|
-
*/
|
|
19
|
-
export declare const tiptapToContentful: (tiptapDoc: any) => Document;
|
|
20
|
-
/**
|
|
21
|
-
* Validates if a Contentful document is properly formatted
|
|
22
|
-
*/
|
|
23
|
-
export declare const validateContentfulDocument: (document: any) => document is Document;
|
|
24
|
-
/**
|
|
25
|
-
* Creates an empty Contentful document
|
|
26
|
-
*/
|
|
27
|
-
export declare const createEmptyDocument: () => Document;
|
|
28
|
-
/**
|
|
29
|
-
* Sanitizes a Contentful document by removing invalid nodes/marks based on configuration
|
|
30
|
-
*/
|
|
31
|
-
export declare const sanitizeContentfulDocument: (document: Document, allowedNodeTypes: string[], allowedMarks: string[]) => Document;
|
|
32
|
-
/**
|
|
33
|
-
* Extracts plain text from a Contentful document
|
|
34
|
-
*/
|
|
35
|
-
export declare const extractPlainText: (document: Document) => string;
|
|
36
|
-
/**
|
|
37
|
-
* Counts words in a Contentful document
|
|
38
|
-
*/
|
|
39
|
-
export declare const countWords: (document: Document) => number;
|
|
40
|
-
/**
|
|
41
|
-
* Finds all embedded entries/assets in a document
|
|
42
|
-
*/
|
|
43
|
-
export declare const findEmbeddedContent: (document: Document) => {
|
|
44
|
-
entries: string[];
|
|
45
|
-
assets: string[];
|
|
46
|
-
inlineEntries: string[];
|
|
47
|
-
};
|
|
48
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
-
declare const TransformationDemo: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
declare const meta: Meta<typeof TransformationDemo>;
|
|
4
|
-
export default meta;
|
|
5
|
-
type Story = StoryObj<typeof meta>;
|
|
6
|
-
export declare const InteractiveDemo: Story;
|
package/dist/utils/types.d.ts
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
export type ContentfulEditorTheme = 'default' | 'minimal' | 'contentful';
|
|
2
|
-
export interface EmbeddedEntry {
|
|
3
|
-
sys: {
|
|
4
|
-
id: string;
|
|
5
|
-
type: string;
|
|
6
|
-
contentType: {
|
|
7
|
-
sys: {
|
|
8
|
-
id: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
fields: Record<string, any>;
|
|
13
|
-
}
|
|
14
|
-
export interface EmbeddedAsset {
|
|
15
|
-
sys: {
|
|
16
|
-
id: string;
|
|
17
|
-
type: string;
|
|
18
|
-
};
|
|
19
|
-
fields: {
|
|
20
|
-
title?: string;
|
|
21
|
-
description?: string;
|
|
22
|
-
file?: {
|
|
23
|
-
url: string;
|
|
24
|
-
fileName: string;
|
|
25
|
-
contentType: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
export type { ContentfulFieldValidation, ContentfulFieldConfiguration, ParsedEditorConfig, } from './configParser';
|
|
30
|
-
export interface EditorFeatureConfig {
|
|
31
|
-
bold?: boolean;
|
|
32
|
-
italic?: boolean;
|
|
33
|
-
underline?: boolean;
|
|
34
|
-
code?: boolean;
|
|
35
|
-
link?: boolean;
|
|
36
|
-
headings?: Array<1 | 2 | 3 | 4 | 5 | 6>;
|
|
37
|
-
lists?: boolean;
|
|
38
|
-
quote?: boolean;
|
|
39
|
-
table?: boolean;
|
|
40
|
-
embeddedEntries?: boolean;
|
|
41
|
-
embeddedAssets?: boolean;
|
|
42
|
-
inlineEntries?: boolean;
|
|
43
|
-
}
|
|
44
|
-
export interface ContentfulNode {
|
|
45
|
-
nodeType: string;
|
|
46
|
-
data: Record<string, any>;
|
|
47
|
-
content?: Array<ContentfulNode | ContentfulText>;
|
|
48
|
-
}
|
|
49
|
-
export interface ContentfulText {
|
|
50
|
-
nodeType: 'text';
|
|
51
|
-
value: string;
|
|
52
|
-
marks?: Array<{
|
|
53
|
-
type: string;
|
|
54
|
-
}>;
|
|
55
|
-
data: Record<string, any>;
|
|
56
|
-
}
|
|
57
|
-
export interface ContentfulDocument extends ContentfulNode {
|
|
58
|
-
nodeType: 'document';
|
|
59
|
-
content: ContentfulNode[];
|
|
60
|
-
}
|
|
61
|
-
export interface TiptapNode {
|
|
62
|
-
type: string;
|
|
63
|
-
attrs?: Record<string, any>;
|
|
64
|
-
content?: TiptapNode[];
|
|
65
|
-
text?: string;
|
|
66
|
-
marks?: Array<{
|
|
67
|
-
type: string;
|
|
68
|
-
attrs?: Record<string, any>;
|
|
69
|
-
}>;
|
|
70
|
-
}
|
|
71
|
-
export interface TiptapDocument extends TiptapNode {
|
|
72
|
-
type: 'doc';
|
|
73
|
-
content: TiptapNode[];
|
|
74
|
-
}
|
|
75
|
-
export interface EditorState {
|
|
76
|
-
canUndo: boolean;
|
|
77
|
-
canRedo: boolean;
|
|
78
|
-
activeMarks: string[];
|
|
79
|
-
activeNodes: string[];
|
|
80
|
-
currentHeading?: number;
|
|
81
|
-
}
|
|
82
|
-
export type OnChangeCallback = (document: any) => void;
|
|
83
|
-
export type OnEmbedCallback = () => Promise<EmbeddedEntry | EmbeddedAsset | null> | void;
|
|
84
|
-
export interface ThemeConfig {
|
|
85
|
-
name: ContentfulEditorTheme;
|
|
86
|
-
className: string;
|
|
87
|
-
toolbarStyle?: 'minimal' | 'full' | 'compact';
|
|
88
|
-
showBorders?: boolean;
|
|
89
|
-
customStyles?: Record<string, string>;
|
|
90
|
-
}
|
|
91
|
-
export interface ValidationRule {
|
|
92
|
-
type: 'required' | 'minLength' | 'maxLength' | 'pattern' | 'custom';
|
|
93
|
-
value?: any;
|
|
94
|
-
message?: string;
|
|
95
|
-
validator?: (value: any) => boolean | string;
|
|
96
|
-
}
|
|
97
|
-
export interface FieldValidationConfig {
|
|
98
|
-
rules?: ValidationRule[];
|
|
99
|
-
showErrors?: boolean;
|
|
100
|
-
validateOnBlur?: boolean;
|
|
101
|
-
validateOnChange?: boolean;
|
|
102
|
-
}
|
|
103
|
-
export interface LocalizationConfig {
|
|
104
|
-
locale: string;
|
|
105
|
-
messages: Record<string, string>;
|
|
106
|
-
rtl?: boolean;
|
|
107
|
-
}
|
|
108
|
-
export interface A11yConfig {
|
|
109
|
-
ariaLabel?: string;
|
|
110
|
-
ariaDescribedBy?: string;
|
|
111
|
-
announceChanges?: boolean;
|
|
112
|
-
keyboardShortcuts?: Record<string, string>;
|
|
113
|
-
}
|
|
114
|
-
export interface AdvancedEditorConfig {
|
|
115
|
-
autofocus?: boolean;
|
|
116
|
-
spellcheck?: boolean;
|
|
117
|
-
autocomplete?: boolean;
|
|
118
|
-
wordWrap?: boolean;
|
|
119
|
-
lineNumbers?: boolean;
|
|
120
|
-
minimap?: boolean;
|
|
121
|
-
dragDrop?: boolean;
|
|
122
|
-
paste?: {
|
|
123
|
-
plainTextOnly?: boolean;
|
|
124
|
-
cleanupPaste?: boolean;
|
|
125
|
-
preserveWhitespace?: boolean;
|
|
126
|
-
};
|
|
127
|
-
history?: {
|
|
128
|
-
depth?: number;
|
|
129
|
-
newGroupDelay?: number;
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
export interface PluginConfig {
|
|
133
|
-
name: string;
|
|
134
|
-
enabled: boolean;
|
|
135
|
-
options?: Record<string, any>;
|
|
136
|
-
}
|
|
137
|
-
export type DeepPartial<T> = {
|
|
138
|
-
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
139
|
-
};
|
|
140
|
-
export type RequiredFields<T, K extends keyof T> = T & Required<Pick<T, K>>;
|
|
141
|
-
export type OptionalFields<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|