@contentful/field-editor-rich-text 3.12.4 → 3.12.5
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/types/ContentfulEditorProvider.d.ts +2 -2
- package/dist/types/RichTextEditor.d.ts +2 -2
- package/dist/types/SdkProvider.d.ts +3 -3
- package/dist/types/__fixtures__/FakeSdk.d.ts +2 -2
- package/dist/types/dialogs/openRichTextDialog.d.ts +2 -2
- package/dist/types/dialogs/renderRichTextDialog.d.ts +2 -2
- package/dist/types/helpers/validations.d.ts +3 -3
- package/dist/types/plugins/CommandPalette/useCommands.d.ts +3 -3
- package/dist/types/plugins/CommandPalette/utils/fetchAssets.d.ts +2 -2
- package/dist/types/plugins/CommandPalette/utils/fetchEntries.d.ts +2 -2
- package/dist/types/plugins/EmbeddedEntityBlock/index.d.ts +3 -3
- package/dist/types/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.d.ts +2 -2
- package/dist/types/plugins/EmbeddedEntityInline/index.d.ts +2 -2
- package/dist/types/plugins/EmbeddedResourceBlock/index.d.ts +2 -2
- package/dist/types/plugins/Hyperlink/HyperlinkModal.d.ts +3 -3
- package/dist/types/plugins/Hyperlink/createHyperlinkPlugin.d.ts +2 -2
- package/dist/types/plugins/Hyperlink/useEntityInfo.d.ts +2 -2
- package/dist/types/plugins/index.d.ts +2 -2
- package/dist/types/plugins/shared/EmbeddedBlockUtil.d.ts +2 -2
- package/dist/types/plugins/shared/FetchingWrappedAssetCard.d.ts +2 -2
- package/dist/types/plugins/shared/FetchingWrappedEntryCard.d.ts +2 -2
- package/dist/types/plugins/shared/FetchingWrappedResourceCard.d.ts +2 -2
- package/dist/types/test-utils/createEditor.d.ts +2 -2
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
export declare function getContentfulEditorId(sdk:
|
|
2
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
3
|
+
export declare function getContentfulEditorId(sdk: FieldAppSDK): string;
|
|
4
4
|
export declare const editorContext: import("react").Context<string>;
|
|
5
5
|
export declare const ContentfulEditorIdProvider: import("react").Provider<string>;
|
|
6
6
|
export declare function useContentfulEditorId(id?: string): string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
3
3
|
import * as Contentful from '@contentful/rich-text-types';
|
|
4
4
|
import { RichTextTrackingActionHandler } from './plugins/Tracking';
|
|
5
5
|
type ConnectedProps = {
|
|
6
|
-
sdk:
|
|
6
|
+
sdk: FieldAppSDK;
|
|
7
7
|
onAction?: RichTextTrackingActionHandler;
|
|
8
8
|
minHeight?: string | number;
|
|
9
9
|
maxHeight?: string | number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
3
3
|
interface SdkProviderProps {
|
|
4
|
-
sdk:
|
|
4
|
+
sdk: FieldAppSDK;
|
|
5
5
|
}
|
|
6
|
-
export declare const SdkProvider: React.FC<SdkProviderProps>, useSdkContext: () =>
|
|
6
|
+
export declare const SdkProvider: React.FC<SdkProviderProps>, useSdkContext: () => FieldAppSDK;
|
|
7
7
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
2
2
|
import { Emitter } from 'mitt';
|
|
3
3
|
export type ReferenceEditorSdkProps = {
|
|
4
4
|
initialValue?: any;
|
|
5
5
|
validations?: any;
|
|
6
6
|
fetchDelay?: number;
|
|
7
7
|
};
|
|
8
|
-
export declare function newReferenceEditorFakeSdk(props?: ReferenceEditorSdkProps): [
|
|
8
|
+
export declare function newReferenceEditorFakeSdk(props?: ReferenceEditorSdkProps): [FieldAppSDK, Emitter];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const openRichTextDialog: (sdk:
|
|
1
|
+
import { DialogAppSDK } from '@contentful/app-sdk';
|
|
2
|
+
export declare const openRichTextDialog: (sdk: DialogAppSDK) => (options: any) => Promise<unknown>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export declare const renderRichTextDialog: (sdk:
|
|
2
|
+
import { DialogAppSDK } from '@contentful/app-sdk';
|
|
3
|
+
export declare const renderRichTextDialog: (sdk: DialogAppSDK) => React.JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
2
2
|
import { BLOCKS, INLINES } from '@contentful/rich-text-types';
|
|
3
3
|
export declare const VALIDATIONS: {
|
|
4
4
|
ENABLED_MARKS: string;
|
|
@@ -6,5 +6,5 @@ export declare const VALIDATIONS: {
|
|
|
6
6
|
};
|
|
7
7
|
export declare const DEFAULT_ENABLED_NODE_TYPES: string[];
|
|
8
8
|
export declare const VALIDATABLE_NODE_TYPES: (INLINES | BLOCKS)[];
|
|
9
|
-
export declare const isNodeTypeEnabled: (field:
|
|
10
|
-
export declare const isMarkEnabled: (field:
|
|
9
|
+
export declare const isNodeTypeEnabled: (field: FieldAppSDK['field'], nodeType: any) => boolean;
|
|
10
|
+
export declare const isMarkEnabled: (field: FieldAppSDK['field'], mark: any) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
2
2
|
import { PlateEditor } from '../../internal/types';
|
|
3
3
|
export interface Command {
|
|
4
4
|
id: string;
|
|
@@ -12,9 +12,9 @@ export interface CommandGroup {
|
|
|
12
12
|
commands: Command[];
|
|
13
13
|
}
|
|
14
14
|
export type CommandList = (Command | CommandGroup)[];
|
|
15
|
-
export declare function isCommandPromptPluginEnabled(sdk:
|
|
15
|
+
export declare function isCommandPromptPluginEnabled(sdk: FieldAppSDK): {
|
|
16
16
|
inlineAllowed: boolean;
|
|
17
17
|
entriesAllowed: boolean;
|
|
18
18
|
assetsAllowed: boolean;
|
|
19
19
|
};
|
|
20
|
-
export declare const useCommands: (sdk:
|
|
20
|
+
export declare const useCommands: (sdk: FieldAppSDK, query: string, editor: PlateEditor) => CommandList;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function fetchAssets(sdk:
|
|
1
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
2
|
+
export declare function fetchAssets(sdk: FieldAppSDK, query: string): Promise<{
|
|
3
3
|
contentTypeName: string;
|
|
4
4
|
displayTitle: string;
|
|
5
5
|
id: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
2
2
|
import { ContentTypeProps } from 'contentful-management/types';
|
|
3
|
-
export declare function fetchEntries(sdk:
|
|
3
|
+
export declare function fetchEntries(sdk: FieldAppSDK, contentType: ContentTypeProps, query: string): Promise<{
|
|
4
4
|
contentTypeName: string;
|
|
5
5
|
displayTitle: string;
|
|
6
6
|
id: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
2
2
|
import { PlatePlugin } from '../../internal';
|
|
3
|
-
export declare const createEmbeddedEntryBlockPlugin: (sdk:
|
|
4
|
-
export declare const createEmbeddedAssetBlockPlugin: (sdk:
|
|
3
|
+
export declare const createEmbeddedEntryBlockPlugin: (sdk: FieldAppSDK) => PlatePlugin;
|
|
4
|
+
export declare const createEmbeddedAssetBlockPlugin: (sdk: FieldAppSDK) => PlatePlugin;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FieldAppSDK } from '@contentful/field-editor-shared';
|
|
3
3
|
interface FetchingWrappedInlineEntryCardProps {
|
|
4
4
|
entryId: string;
|
|
5
|
-
sdk:
|
|
5
|
+
sdk: FieldAppSDK;
|
|
6
6
|
isSelected: boolean;
|
|
7
7
|
isDisabled: boolean;
|
|
8
8
|
onEdit: (event: React.MouseEvent<Element, MouseEvent>) => void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
3
3
|
import { PlatePlugin } from '../../internal/types';
|
|
4
4
|
interface ToolbarEmbeddedEntityInlineButtonProps {
|
|
5
5
|
onClose: () => void;
|
|
6
6
|
isDisabled: boolean;
|
|
7
7
|
}
|
|
8
8
|
export declare function ToolbarEmbeddedEntityInlineButton(props: ToolbarEmbeddedEntityInlineButtonProps): React.JSX.Element;
|
|
9
|
-
export declare function createEmbeddedEntityInlinePlugin(sdk:
|
|
9
|
+
export declare function createEmbeddedEntityInlinePlugin(sdk: FieldAppSDK): PlatePlugin;
|
|
10
10
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
2
2
|
import { PlatePlugin } from '../../internal';
|
|
3
|
-
export declare const createEmbeddedResourceBlockPlugin: (sdk:
|
|
3
|
+
export declare const createEmbeddedResourceBlockPlugin: (sdk: FieldAppSDK) => PlatePlugin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Link } from '@contentful/field-editor-reference';
|
|
3
|
-
import {
|
|
3
|
+
import { FieldAppSDK } from '@contentful/field-editor-shared';
|
|
4
4
|
import { PlateEditor, Path } from '../../internal/types';
|
|
5
5
|
import { TrackingPluginActions } from '../../plugins/Tracking';
|
|
6
6
|
interface HyperlinkModalProps {
|
|
@@ -9,9 +9,9 @@ interface HyperlinkModalProps {
|
|
|
9
9
|
linkTarget?: string;
|
|
10
10
|
linkEntity?: Link;
|
|
11
11
|
onClose: (value: unknown) => void;
|
|
12
|
-
sdk:
|
|
12
|
+
sdk: FieldAppSDK;
|
|
13
13
|
readonly: boolean;
|
|
14
14
|
}
|
|
15
15
|
export declare function HyperlinkModal(props: HyperlinkModalProps): React.JSX.Element;
|
|
16
|
-
export declare function addOrEditLink(editor: PlateEditor, sdk:
|
|
16
|
+
export declare function addOrEditLink(editor: PlateEditor, sdk: FieldAppSDK, logAction: TrackingPluginActions['onToolbarAction'] | TrackingPluginActions['onShortcutAction'] | TrackingPluginActions['onViewportAction'], targetPath?: Path): Promise<void>;
|
|
17
17
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
2
2
|
import { PlatePlugin } from '../../internal/types';
|
|
3
|
-
export declare const createHyperlinkPlugin: (sdk:
|
|
3
|
+
export declare const createHyperlinkPlugin: (sdk: FieldAppSDK) => PlatePlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Asset, ContentEntityType, Entry,
|
|
1
|
+
import { Asset, ContentEntityType, Entry, FieldAppSDK, Link, ScheduledAction } from '@contentful/app-sdk';
|
|
2
2
|
import { entityHelpers } from '@contentful/field-editor-shared';
|
|
3
3
|
export type FetchedEntityData = {
|
|
4
4
|
jobs: ScheduledAction[];
|
|
@@ -10,7 +10,7 @@ export type FetchedEntityData = {
|
|
|
10
10
|
};
|
|
11
11
|
export type EntityInfoProps = {
|
|
12
12
|
target: Link<ContentEntityType>;
|
|
13
|
-
sdk:
|
|
13
|
+
sdk: FieldAppSDK;
|
|
14
14
|
onEntityFetchComplete?: VoidFunction;
|
|
15
15
|
};
|
|
16
16
|
export declare function useEntityInfo(props: EntityInfoProps): string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
2
2
|
import { PlateProps } from '@udecode/plate-common';
|
|
3
3
|
import { PlatePlugin } from '../internal/types';
|
|
4
4
|
import { RichTextTrackingActionHandler } from './Tracking';
|
|
5
|
-
export declare const getPlugins: (sdk:
|
|
5
|
+
export declare const getPlugins: (sdk: FieldAppSDK, onAction: RichTextTrackingActionHandler, restrictedMarks?: string[]) => PlatePlugin[];
|
|
6
6
|
export declare const disableCorePlugins: PlateProps['disableCorePlugins'];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
2
2
|
import { BLOCKS } from '@contentful/rich-text-types';
|
|
3
3
|
import { HotkeyPlugin } from '@udecode/plate-common';
|
|
4
4
|
import { KeyboardHandler } from '../../internal';
|
|
5
5
|
import { TrackingPluginActions } from '../Tracking';
|
|
6
|
-
export declare function getWithEmbeddedBlockEvents(nodeType: BLOCKS.EMBEDDED_ENTRY | BLOCKS.EMBEDDED_ASSET | BLOCKS.EMBEDDED_RESOURCE, sdk:
|
|
6
|
+
export declare function getWithEmbeddedBlockEvents(nodeType: BLOCKS.EMBEDDED_ENTRY | BLOCKS.EMBEDDED_ASSET | BLOCKS.EMBEDDED_RESOURCE, sdk: FieldAppSDK): KeyboardHandler<HotkeyPlugin>;
|
|
7
7
|
export declare function selectEntityAndInsert(nodeType: any, sdk: any, editor: any, logAction: TrackingPluginActions['onToolbarAction'] | TrackingPluginActions['onShortcutAction']): Promise<void>;
|
|
8
8
|
export declare function selectResourceEntityAndInsert(sdk: any, editor: any, logAction: TrackingPluginActions['onToolbarAction'] | TrackingPluginActions['onShortcutAction']): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
3
3
|
interface FetchingWrappedAssetCardProps {
|
|
4
4
|
assetId: string;
|
|
5
5
|
isDisabled: boolean;
|
|
@@ -7,7 +7,7 @@ interface FetchingWrappedAssetCardProps {
|
|
|
7
7
|
locale: string;
|
|
8
8
|
onEdit?: () => void;
|
|
9
9
|
onRemove?: () => unknown;
|
|
10
|
-
sdk:
|
|
10
|
+
sdk: FieldAppSDK;
|
|
11
11
|
onEntityFetchComplete?: VoidFunction;
|
|
12
12
|
}
|
|
13
13
|
export declare function FetchingWrappedAssetCard(props: FetchingWrappedAssetCardProps): React.JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
3
3
|
interface FetchingWrappedEntryCardProps {
|
|
4
4
|
entryId: string;
|
|
5
5
|
isDisabled: boolean;
|
|
6
6
|
isSelected: boolean;
|
|
7
7
|
locale: string;
|
|
8
|
-
sdk:
|
|
8
|
+
sdk: FieldAppSDK;
|
|
9
9
|
onEntityFetchComplete?: VoidFunction;
|
|
10
10
|
onEdit?: VoidFunction;
|
|
11
11
|
onRemove?: VoidFunction;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
3
3
|
import { ResourceLink } from '@contentful/rich-text-types';
|
|
4
4
|
interface FetchingWrappedResourceCardProps {
|
|
5
5
|
link: ResourceLink['sys'];
|
|
6
6
|
isDisabled: boolean;
|
|
7
7
|
isSelected: boolean;
|
|
8
|
-
sdk:
|
|
8
|
+
sdk: FieldAppSDK;
|
|
9
9
|
onEntityFetchComplete?: VoidFunction;
|
|
10
10
|
onEdit?: VoidFunction;
|
|
11
11
|
onRemove?: VoidFunction;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldAppSDK } from '@contentful/app-sdk';
|
|
2
2
|
import { PlatePlugin } from '../internal/types';
|
|
3
3
|
import { RichTextTrackingActionHandler } from '../plugins/Tracking';
|
|
4
4
|
export declare const createTestEditor: (options: {
|
|
5
5
|
input?: any;
|
|
6
|
-
sdk?:
|
|
6
|
+
sdk?: FieldAppSDK;
|
|
7
7
|
trackingHandler?: RichTextTrackingActionHandler;
|
|
8
8
|
plugins?: PlatePlugin[];
|
|
9
9
|
}) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-rich-text",
|
|
3
|
-
"version": "3.12.
|
|
3
|
+
"version": "3.12.5",
|
|
4
4
|
"source": "./src/index.tsx",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"@contentful/f36-icons": "^4.1.1",
|
|
45
45
|
"@contentful/f36-tokens": "^4.0.0",
|
|
46
46
|
"@contentful/f36-utils": "^4.19.0",
|
|
47
|
-
"@contentful/field-editor-reference": "^5.16.
|
|
48
|
-
"@contentful/field-editor-shared": "^1.4.
|
|
47
|
+
"@contentful/field-editor-reference": "^5.16.3",
|
|
48
|
+
"@contentful/field-editor-shared": "^1.4.2",
|
|
49
49
|
"@contentful/rich-text-plain-text-renderer": "^16.0.4",
|
|
50
50
|
"@contentful/rich-text-types": "16.3.0",
|
|
51
51
|
"@popperjs/core": "^2.11.5",
|
|
@@ -74,12 +74,12 @@
|
|
|
74
74
|
"react-dom": ">=16.14.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
|
-
"@contentful/field-editor-test-utils": "^1.4.
|
|
77
|
+
"@contentful/field-editor-test-utils": "^1.4.3",
|
|
78
78
|
"@contentful/rich-text-react-renderer": "^15.16.4",
|
|
79
79
|
"@types/is-hotkey": "^0.1.6",
|
|
80
80
|
"@udecode/plate-test-utils": "^3.2.0",
|
|
81
81
|
"prism-react-renderer": "2.0.5",
|
|
82
82
|
"react": ">=16.14.0"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "ef0adb263ad287e6f78888a05727d0f2f4f8968d"
|
|
85
85
|
}
|