@contentful/field-editor-rich-text 2.0.3 → 2.1.1
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/CHANGELOG.md +14 -0
- package/dist/field-editor-rich-text.cjs.development.js +1117 -585
- package/dist/field-editor-rich-text.cjs.development.js.map +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js.map +1 -1
- package/dist/field-editor-rich-text.esm.js +1097 -565
- package/dist/field-editor-rich-text.esm.js.map +1 -1
- package/dist/helpers/removeInternalMarks.d.ts +1 -0
- package/dist/plugins/CommandPalette/components/CommandList.d.ts +6 -0
- package/dist/plugins/CommandPalette/components/CommandList.styles.d.ts +13 -0
- package/dist/plugins/CommandPalette/components/CommandPrompt.d.ts +2 -0
- package/dist/plugins/CommandPalette/constants.d.ts +1 -0
- package/dist/plugins/CommandPalette/createCommandPalettePlugin.d.ts +13 -0
- package/dist/plugins/CommandPalette/hooks/useCommandList.d.ts +3 -0
- package/dist/plugins/CommandPalette/index.d.ts +1 -0
- package/dist/plugins/CommandPalette/onKeyDown.d.ts +3 -0
- package/dist/plugins/CommandPalette/useCommands.d.ts +14 -0
- package/dist/plugins/CommandPalette/utils/createInlineEntryNode.d.ts +16 -0
- package/dist/plugins/CommandPalette/utils/fetchAssets.d.ts +8 -0
- package/dist/plugins/CommandPalette/utils/fetchEntries.d.ts +9 -0
- package/dist/plugins/CommandPalette/utils/insertBlock.d.ts +1 -0
- package/dist/plugins/CommandPalette/utils/trimLeadingSlash.d.ts +7 -0
- package/package.json +3 -3
- package/dist/plugins/SlashCommands/SlashCommandsPalette.d.ts +0 -5
- package/dist/plugins/SlashCommands/createSlashCommandsPlugin.d.ts +0 -2
- package/dist/plugins/SlashCommands/helpers.d.ts +0 -6
- package/dist/plugins/SlashCommands/index.d.ts +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const removeInternalMarks: (document: Record<string, unknown>) => any;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const styles: {
|
|
2
|
+
container: string;
|
|
3
|
+
menuContent: string;
|
|
4
|
+
menuList: string;
|
|
5
|
+
menuItem: string;
|
|
6
|
+
menuItemSelected: string;
|
|
7
|
+
menuDivider: string;
|
|
8
|
+
menuHeader: string;
|
|
9
|
+
menuFooter: string;
|
|
10
|
+
footerList: string;
|
|
11
|
+
thumbnail: string;
|
|
12
|
+
};
|
|
13
|
+
export default styles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const COMMAND_PROMPT = "command-prompt";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { RichTextPlugin } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* A command palette plugin (aka slash commands)
|
|
4
|
+
*
|
|
5
|
+
* How does it work?
|
|
6
|
+
* * When the user presses the slash key, the editor will show a command palette
|
|
7
|
+
* * When the user presses a key, the command palette will show the command suggestions
|
|
8
|
+
* * When the user presses enter, the command palette will execute the command
|
|
9
|
+
* * When the user presses escape, the command palette will hide
|
|
10
|
+
* * When the user presses a letter, number, or space, the command palette will show the command suggestions
|
|
11
|
+
* * When the user presses backspace, the command palette will remove the last character from the command string
|
|
12
|
+
*/
|
|
13
|
+
export declare const createCommandPalettePlugin: () => RichTextPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createCommandPalettePlugin } from './createCommandPalettePlugin';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FieldExtensionSDK } from '@contentful/app-sdk';
|
|
2
|
+
import { PlateEditor } from '@udecode/plate-core';
|
|
3
|
+
export interface Command {
|
|
4
|
+
id: string;
|
|
5
|
+
thumbnail?: string;
|
|
6
|
+
label: string;
|
|
7
|
+
callback?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export interface CommandGroup {
|
|
10
|
+
group: string;
|
|
11
|
+
commands: Command[];
|
|
12
|
+
}
|
|
13
|
+
export declare type CommandList = (Command | CommandGroup)[];
|
|
14
|
+
export declare const useCommands: (sdk: FieldExtensionSDK, query: string, editor: PlateEditor) => CommandList;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { INLINES } from '@contentful/rich-text-types';
|
|
2
|
+
export declare function createInlineEntryNode(id: string): {
|
|
3
|
+
type: INLINES;
|
|
4
|
+
children: {
|
|
5
|
+
text: string;
|
|
6
|
+
}[];
|
|
7
|
+
data: {
|
|
8
|
+
target: {
|
|
9
|
+
sys: {
|
|
10
|
+
id: string;
|
|
11
|
+
type: string;
|
|
12
|
+
linkType: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FieldExtensionSDK } from '@contentful/app-sdk';
|
|
2
|
+
export declare function fetchAssets(sdk: FieldExtensionSDK, query: string): Promise<{
|
|
3
|
+
contentTypeName: string;
|
|
4
|
+
displayTitle: string;
|
|
5
|
+
id: string;
|
|
6
|
+
entity: import("@contentful/app-sdk").Asset;
|
|
7
|
+
thumbnail: string;
|
|
8
|
+
}[]>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FieldExtensionSDK } from '@contentful/app-sdk';
|
|
2
|
+
import { ContentTypeProps } from 'contentful-management/types';
|
|
3
|
+
export declare function fetchEntries(sdk: FieldExtensionSDK, contentType: ContentTypeProps, query: string): Promise<{
|
|
4
|
+
contentTypeName: string;
|
|
5
|
+
displayTitle: string;
|
|
6
|
+
id: string;
|
|
7
|
+
description: string;
|
|
8
|
+
entry: import("@contentful/app-sdk").Entry<unknown>;
|
|
9
|
+
}[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function insertBlock(editor: any, nodeType: any, entity: any): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-rich-text",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"source": "./src/index.tsx",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "dist/field-editor-rich-text.esm.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@contentful/f36-components": "^4.0.33",
|
|
30
30
|
"@contentful/f36-icons": "^4.1.1",
|
|
31
31
|
"@contentful/f36-tokens": "^4.0.0",
|
|
32
|
-
"@contentful/field-editor-reference": "^4.3.
|
|
32
|
+
"@contentful/field-editor-reference": "^4.3.11",
|
|
33
33
|
"@contentful/field-editor-shared": "^1.1.3",
|
|
34
34
|
"@contentful/rich-text-plain-text-renderer": "^15.12.1",
|
|
35
35
|
"@contentful/rich-text-types": "^15.12.1",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"@udecode/plate-test-utils": "^3.2.0",
|
|
71
71
|
"react": ">=16.14.0"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "1a0de55209f3ea05919a154eab948865653dfa9d"
|
|
74
74
|
}
|