@contentful/field-editor-rich-text 2.0.2 → 2.1.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/CHANGELOG.md +14 -0
- package/dist/field-editor-rich-text.cjs.development.js +1112 -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 +1092 -565
- package/dist/field-editor-rich-text.esm.js.map +1 -1
- 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/CommandPalette/CommandPanel/InViewport/InViewport.d.ts +0 -37
- package/dist/plugins/EmbeddedEntryInline/FetchingWrappedInlineEntryCard.d.ts +0 -14
- package/dist/plugins/Hyperlink/Hyperlink.d.ts +0 -13
- 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,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.0
|
|
3
|
+
"version": "2.1.0",
|
|
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": "0a64b352a8e7f64c4ba35a1075beb32ac3d9b432"
|
|
74
74
|
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export class InViewport extends React.Component<any, any, any> {
|
|
2
|
-
static defaultProps: {
|
|
3
|
-
testId: string;
|
|
4
|
-
offset: number;
|
|
5
|
-
};
|
|
6
|
-
constructor(props: any);
|
|
7
|
-
constructor(props: any, context: any);
|
|
8
|
-
tGetDomPosition: any;
|
|
9
|
-
nodeRef: any;
|
|
10
|
-
lastOverflowAt: any;
|
|
11
|
-
tOnOverflowTop: (...args: any[]) => any;
|
|
12
|
-
tOnOverflowBottom: (...args: any[]) => any;
|
|
13
|
-
tOnOverflowRight: (...args: any[]) => any;
|
|
14
|
-
tOnOverflowLeft: (...args: any[]) => any;
|
|
15
|
-
getDomPosition: () => void;
|
|
16
|
-
bindEventListeners: () => void;
|
|
17
|
-
handleOverflow: ({ top, left, bottom, right }: {
|
|
18
|
-
top: any;
|
|
19
|
-
left: any;
|
|
20
|
-
bottom: any;
|
|
21
|
-
right: any;
|
|
22
|
-
}, windowWidth: any, windowHeight: any) => void;
|
|
23
|
-
}
|
|
24
|
-
export namespace InViewport {
|
|
25
|
-
export namespace propTypes {
|
|
26
|
-
export const offset: PropTypes.Requireable<number>;
|
|
27
|
-
export const onOverflowTop: PropTypes.Requireable<(...args: any[]) => any>;
|
|
28
|
-
export const onOverflowRight: PropTypes.Requireable<(...args: any[]) => any>;
|
|
29
|
-
export const onOverflowBottom: PropTypes.Requireable<(...args: any[]) => any>;
|
|
30
|
-
export const onOverflowLeft: PropTypes.Requireable<(...args: any[]) => any>;
|
|
31
|
-
export const className: PropTypes.Requireable<string>;
|
|
32
|
-
export const children: PropTypes.Requireable<any>;
|
|
33
|
-
export const testId: PropTypes.Requireable<string>;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
import React from "react";
|
|
37
|
-
import PropTypes from "prop-types";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export function FetchingWrappedInlineEntryCard(props: any): JSX.Element;
|
|
2
|
-
export namespace FetchingWrappedInlineEntryCard {
|
|
3
|
-
export namespace propTypes {
|
|
4
|
-
export const sdk: PropTypes.Validator<object>;
|
|
5
|
-
export const entryId: PropTypes.Validator<string>;
|
|
6
|
-
export const isDisabled: PropTypes.Validator<boolean>;
|
|
7
|
-
export const isSelected: PropTypes.Validator<boolean>;
|
|
8
|
-
export const isReadOnly: PropTypes.Validator<boolean>;
|
|
9
|
-
export const onRemove: PropTypes.Validator<(...args: any[]) => any>;
|
|
10
|
-
export const onEdit: PropTypes.Validator<(...args: any[]) => any>;
|
|
11
|
-
export const onEntityFetchComplete: PropTypes.Requireable<(...args: any[]) => any>;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
import PropTypes from "prop-types";
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
declare function Hyperlink(props: any): JSX.Element;
|
|
2
|
-
declare namespace Hyperlink {
|
|
3
|
-
export namespace propTypes {
|
|
4
|
-
export const attributes: PropTypes.Validator<object>;
|
|
5
|
-
export const node: PropTypes.Validator<object>;
|
|
6
|
-
export const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
7
|
-
export const editor: PropTypes.Requireable<object>;
|
|
8
|
-
export const richTextAPI: PropTypes.Validator<object>;
|
|
9
|
-
export const onEdit: PropTypes.Requireable<(...args: any[]) => any>;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
export default Hyperlink;
|
|
13
|
-
import PropTypes from "prop-types";
|