@contentful/field-editor-rich-text 2.0.0-next.40 → 2.0.0-next.43
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/field-editor-rich-text.cjs.development.js +421 -123
- 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 +426 -128
- package/dist/field-editor-rich-text.esm.js.map +1 -1
- package/dist/helpers/environment.d.ts +1 -1
- package/dist/helpers/sanitizeIncomingSlateDoc.d.ts +6 -0
- package/dist/plugins/shared/EntityStatusIcon.d.ts +7 -0
- package/dist/plugins/shared/FetchingWrappedAssetCard.d.ts +10 -0
- package/dist/prepareDocument.d.ts +2 -2
- package/package.json +4 -4
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TextOrCustomElement } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Ensures all nodes have a child leaf text element. This should be handled by
|
|
4
|
+
* Slate but its behavior has proven to be buggy and unpredictable.
|
|
5
|
+
*/
|
|
6
|
+
export declare function sanitizeIncomingSlateDoc(nodes?: TextOrCustomElement[]): TextOrCustomElement[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Entry, Asset } from '@contentful/field-editor-shared';
|
|
2
|
+
interface EntityStatusIconProps {
|
|
3
|
+
entity: Entry | Asset;
|
|
4
|
+
entityType: 'Entry' | 'Asset';
|
|
5
|
+
}
|
|
6
|
+
export declare function EntityStatusIcon({ entity, entityType }: EntityStatusIconProps): JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FieldExtensionSDK } from '@contentful/app-sdk';
|
|
2
|
+
import { File } from '@contentful/field-editor-shared';
|
|
2
3
|
interface FetchingWrappedAssetCardProps {
|
|
3
4
|
assetId: string;
|
|
4
5
|
isDisabled: boolean;
|
|
@@ -9,5 +10,14 @@ interface FetchingWrappedAssetCardProps {
|
|
|
9
10
|
sdk: FieldExtensionSDK;
|
|
10
11
|
onEntityFetchComplete?: VoidFunction;
|
|
11
12
|
}
|
|
13
|
+
export declare function renderAssetInfo(props: {
|
|
14
|
+
entityFile: File;
|
|
15
|
+
}): ("" | JSX.Element)[];
|
|
16
|
+
export declare function renderActions(props: {
|
|
17
|
+
onEdit?: () => void;
|
|
18
|
+
onRemove?: () => void;
|
|
19
|
+
isDisabled: boolean;
|
|
20
|
+
entityFile?: File;
|
|
21
|
+
}): (JSX.Element | null)[];
|
|
12
22
|
export declare function FetchingWrappedAssetCard(props: FetchingWrappedAssetCardProps): JSX.Element;
|
|
13
23
|
export {};
|
|
@@ -13,8 +13,8 @@ import { RichTextEditor } from 'types';
|
|
|
13
13
|
export declare const hasContent: (doc?: Document | undefined) => boolean;
|
|
14
14
|
export declare const setEditorContent: (editor: Editor, nodes?: Node[] | undefined) => void;
|
|
15
15
|
/**
|
|
16
|
-
* Converts a
|
|
16
|
+
* Converts a Contentful rich text document to the corresponding slate editor
|
|
17
17
|
* value
|
|
18
18
|
*/
|
|
19
|
-
export declare const documentToEditorValue: (doc: any) =>
|
|
19
|
+
export declare const documentToEditorValue: (doc: any) => Descendant[];
|
|
20
20
|
export declare const normalizeEditorValue: (value: Descendant[], options?: Pick<CreatePlateEditorOptions<RichTextEditor>, "plugins" | "disableCorePlugins" | "components" | "overrideByKey"> | undefined) => Descendant[] & any[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-rich-text",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.43",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"tag": "next"
|
|
6
6
|
},
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@contentful/f36-components": "^4.0.33",
|
|
32
32
|
"@contentful/f36-icons": "^4.1.1",
|
|
33
33
|
"@contentful/f36-tokens": "^4.0.0",
|
|
34
|
-
"@contentful/field-editor-reference": "^4.
|
|
34
|
+
"@contentful/field-editor-reference": "^4.0.7",
|
|
35
35
|
"@contentful/field-editor-shared": "^1.0.3",
|
|
36
36
|
"@contentful/rich-text-plain-text-renderer": "^15.11.1",
|
|
37
37
|
"@contentful/rich-text-types": "^15.11.1",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"fast-deep-equal": "^3.1.3",
|
|
49
49
|
"is-hotkey": "^0.2.0",
|
|
50
50
|
"is-plain-obj": "^3.0.0",
|
|
51
|
-
"slate": "^0.
|
|
51
|
+
"slate": "^0.80.0",
|
|
52
52
|
"slate-history": "^0.66.0",
|
|
53
53
|
"slate-hyperscript": "^0.67.0",
|
|
54
|
-
"slate-react": "^0.
|
|
54
|
+
"slate-react": "^0.80.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"react": ">=16.14.0",
|