@contentful/field-editor-rich-text 1.1.3 → 2.0.0-next.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.
Files changed (190) hide show
  1. package/CHANGELOG.md +0 -60
  2. package/README.md +1 -1
  3. package/dist/ContentfulEditorProvider.d.ts +8 -0
  4. package/dist/RichTextEditor.d.ts +18 -60
  5. package/dist/RichTextEditor.styles.d.ts +7 -0
  6. package/dist/SdkProvider.d.ts +7 -0
  7. package/dist/Toolbar/components/EmbedEntityWidget.d.ts +5 -0
  8. package/dist/Toolbar/components/EmbeddedEntityDropdownButton.d.ts +9 -0
  9. package/dist/Toolbar/components/StickyToolbarWrapper.d.ts +7 -0
  10. package/dist/Toolbar/index.d.ts +5 -20
  11. package/dist/TrackingProvider.d.ts +11 -0
  12. package/dist/constants/Schema.d.ts +93 -11
  13. package/dist/dialogs/openRichTextDialog.d.ts +2 -1
  14. package/dist/dialogs/renderRichTextDialog.d.ts +2 -1
  15. package/dist/field-editor-rich-text.cjs.development.js +4749 -5125
  16. package/dist/field-editor-rich-text.cjs.development.js.map +1 -1
  17. package/dist/field-editor-rich-text.cjs.production.min.js +1 -1
  18. package/dist/field-editor-rich-text.cjs.production.min.js.map +1 -1
  19. package/dist/field-editor-rich-text.esm.js +4729 -5105
  20. package/dist/field-editor-rich-text.esm.js.map +1 -1
  21. package/dist/helpers/editor.d.ts +43 -0
  22. package/dist/helpers/environment.d.ts +2 -0
  23. package/dist/helpers/extractNodes.d.ts +7 -0
  24. package/dist/helpers/formatDateAndTime.d.ts +15 -0
  25. package/dist/helpers/getLinkedContentTypeIdsForNodeType.d.ts +26 -2
  26. package/dist/helpers/newEntitySelectorConfigFromRichTextField.d.ts +5 -1
  27. package/dist/helpers/sanitizeSlateDoc.d.ts +5 -0
  28. package/dist/helpers/transformers.d.ts +8 -0
  29. package/dist/helpers/validations.d.ts +10 -0
  30. package/dist/plugins/Break/createExitBreakPlugin.d.ts +2 -0
  31. package/dist/plugins/Break/createSoftBreakPlugin.d.ts +2 -0
  32. package/dist/plugins/Break/index.d.ts +3 -0
  33. package/dist/plugins/DragAndDrop/index.d.ts +2 -0
  34. package/dist/plugins/EmbeddedEntityBlock/LinkedEntityBlock.d.ts +14 -0
  35. package/dist/plugins/EmbeddedEntityBlock/ToolbarIcon.d.ts +11 -10
  36. package/dist/plugins/EmbeddedEntityBlock/Util.d.ts +2 -23
  37. package/dist/plugins/EmbeddedEntityBlock/index.d.ts +6 -26
  38. package/dist/plugins/EmbeddedEntityInline/FetchingWrappedInlineEntryCard.d.ts +13 -0
  39. package/dist/plugins/EmbeddedEntityInline/Util.d.ts +16 -0
  40. package/dist/plugins/EmbeddedEntityInline/index.d.ts +11 -0
  41. package/dist/plugins/Heading/components/Heading.d.ts +11 -0
  42. package/dist/plugins/Heading/components/ToolbarHeadingButton.d.ts +4 -0
  43. package/dist/plugins/Heading/createHeadingPlugin.d.ts +2 -0
  44. package/dist/plugins/Heading/index.d.ts +2 -380
  45. package/dist/plugins/Hr/index.d.ts +12 -61
  46. package/dist/plugins/Hyperlink/EntryAssetTooltip.d.ts +9 -0
  47. package/dist/plugins/Hyperlink/HyperlinkModal.d.ts +16 -0
  48. package/dist/plugins/Hyperlink/index.d.ts +9 -9
  49. package/dist/plugins/Hyperlink/truncate.d.ts +1 -1
  50. package/dist/plugins/Hyperlink/utils.d.ts +3 -0
  51. package/dist/plugins/List/components/List.d.ts +3 -0
  52. package/dist/plugins/List/components/ListItem.d.ts +2 -0
  53. package/dist/plugins/List/components/ToolbarListButton.d.ts +4 -0
  54. package/dist/plugins/List/createListPlugin.d.ts +2 -0
  55. package/dist/plugins/List/index.d.ts +2 -114
  56. package/dist/plugins/List/insertListBreak.d.ts +2 -0
  57. package/dist/plugins/List/insertListFragment.d.ts +2 -0
  58. package/dist/plugins/List/transforms/insertListItem.d.ts +5 -0
  59. package/dist/plugins/List/utils.d.ts +14 -0
  60. package/dist/plugins/List/withList.d.ts +3 -0
  61. package/dist/plugins/Marks/Bold.d.ts +9 -0
  62. package/dist/plugins/Marks/Code.d.ts +9 -0
  63. package/dist/plugins/Marks/Italic.d.ts +9 -0
  64. package/dist/plugins/Marks/Underline.d.ts +9 -0
  65. package/dist/plugins/Marks/index.d.ts +2 -0
  66. package/dist/plugins/Normalizer/baseRules.d.ts +2 -0
  67. package/dist/plugins/Normalizer/createNormalizerPlugin.d.ts +2 -0
  68. package/dist/plugins/Normalizer/index.d.ts +2 -0
  69. package/dist/plugins/Normalizer/types.d.ts +39 -0
  70. package/dist/plugins/Normalizer/utils.d.ts +8 -0
  71. package/dist/plugins/Normalizer/withNormalizer.d.ts +2 -0
  72. package/dist/plugins/Paragraph/Paragraph.d.ts +2 -0
  73. package/dist/plugins/Paragraph/createParagraphPlugin.d.ts +2 -0
  74. package/dist/plugins/Paragraph/index.d.ts +1 -5
  75. package/dist/plugins/Paragraph/utils.d.ts +2 -0
  76. package/dist/plugins/PasteHTML/createPasteHTMLPlugin.d.ts +2 -0
  77. package/dist/plugins/PasteHTML/index.d.ts +1 -0
  78. package/dist/plugins/PasteHTML/utils/sanitizeHTML.d.ts +1 -0
  79. package/dist/plugins/PasteHTML/utils/sanitizeSheets.d.ts +4 -0
  80. package/dist/plugins/Quote/components/Quote.d.ts +2 -0
  81. package/dist/plugins/Quote/components/ToolbarQuoteButton.d.ts +4 -0
  82. package/dist/plugins/Quote/createQuotePlugin.d.ts +2 -0
  83. package/dist/plugins/Quote/index.d.ts +2 -59
  84. package/dist/plugins/Quote/toggleQuote.d.ts +3 -0
  85. package/dist/plugins/SelectOnBackspace/createSelectOnBackspacePlugin.d.ts +2 -0
  86. package/dist/plugins/SelectOnBackspace/index.d.ts +1 -0
  87. package/dist/plugins/Table/actions/addColumn.d.ts +4 -0
  88. package/dist/plugins/Table/actions/addRow.d.ts +3 -0
  89. package/dist/plugins/Table/actions/index.d.ts +3 -0
  90. package/dist/plugins/Table/actions/setHeader.d.ts +2 -0
  91. package/dist/plugins/Table/addTableTrackingEvents.d.ts +3 -0
  92. package/dist/plugins/Table/components/Cell.d.ts +2 -0
  93. package/dist/plugins/Table/components/HeaderCell.d.ts +2 -0
  94. package/dist/plugins/Table/components/Row.d.ts +2 -0
  95. package/dist/plugins/Table/components/Table.d.ts +2 -0
  96. package/dist/plugins/Table/components/TableActions.d.ts +4 -0
  97. package/dist/plugins/Table/components/ToolbarButton.d.ts +4 -0
  98. package/dist/plugins/Table/createTablePlugin.d.ts +3 -0
  99. package/dist/plugins/Table/helpers.d.ts +15 -0
  100. package/dist/plugins/Table/index.d.ts +2 -0
  101. package/dist/plugins/Text/createTextPlugin.d.ts +2 -0
  102. package/dist/plugins/Text/index.d.ts +1 -0
  103. package/dist/plugins/TrailingParagraph/index.d.ts +1 -0
  104. package/dist/plugins/Voids/createVoidsPlugin.d.ts +2 -0
  105. package/dist/plugins/Voids/index.d.ts +1 -0
  106. package/dist/plugins/Voids/transformVoid.d.ts +6 -0
  107. package/dist/plugins/index.d.ts +6 -1
  108. package/dist/plugins/links-tracking.d.ts +7 -0
  109. package/dist/plugins/shared/EntityStatusIcon.d.ts +7 -0
  110. package/dist/plugins/shared/FetchingWrappedAssetCard.d.ts +23 -0
  111. package/dist/plugins/shared/FetchingWrappedEntryCard.d.ts +13 -0
  112. package/dist/plugins/shared/ToolbarButton.d.ts +11 -0
  113. package/dist/test-utils/assertOutput.d.ts +8 -0
  114. package/dist/test-utils/createEditor.d.ts +14 -0
  115. package/dist/test-utils/index.d.ts +4 -0
  116. package/dist/test-utils/jsx.d.ts +28 -0
  117. package/dist/test-utils/mockPlugin.d.ts +2 -0
  118. package/dist/test-utils/randomId.d.ts +4 -0
  119. package/dist/test-utils/setEmptyDataAttribute.d.ts +6 -0
  120. package/dist/test-utils/validation.d.ts +1 -0
  121. package/dist/types.d.ts +42 -0
  122. package/package.json +40 -34
  123. package/LICENSE +0 -21
  124. package/dist/RichTextEditor.spec.d.ts +0 -1
  125. package/dist/Toolbar/StickyToolbarWrapper.d.ts +0 -12
  126. package/dist/Toolbar/Toolbar.spec.d.ts +0 -1
  127. package/dist/helpers/browserSupport.d.ts +0 -1
  128. package/dist/plugins/Bold/index.d.ts +0 -64
  129. package/dist/plugins/Code/index.d.ts +0 -64
  130. package/dist/plugins/CommandPalette/CommandMark.d.ts +0 -12
  131. package/dist/plugins/CommandPalette/CommandPalette.d.ts +0 -10
  132. package/dist/plugins/CommandPalette/CommandPaletteService.d.ts +0 -20
  133. package/dist/plugins/CommandPalette/CommandPanel/CommandPanelMenu.d.ts +0 -43
  134. package/dist/plugins/CommandPalette/CommandPanel/InViewport/InViewport.d.ts +0 -37
  135. package/dist/plugins/CommandPalette/CommandPanel/index.d.ts +0 -37
  136. package/dist/plugins/CommandPalette/Util.d.ts +0 -5
  137. package/dist/plugins/CommandPalette/index.d.ts +0 -7
  138. package/dist/plugins/EmbeddedEntityBlock/EmbeddedEntityBlock.d.ts +0 -20
  139. package/dist/plugins/EmbeddedEntityBlock/EmbeddedEntityBlock.styles.d.ts +0 -3
  140. package/dist/plugins/EmbeddedEntityBlock/FetchingWrappedAssetCard.d.ts +0 -15
  141. package/dist/plugins/EmbeddedEntityBlock/FetchingWrappedEntryCard.d.ts +0 -15
  142. package/dist/plugins/EmbeddedEntryInline/EmbeddedEntryInline.d.ts +0 -21
  143. package/dist/plugins/EmbeddedEntryInline/EmbeddedEntryInline.styles.d.ts +0 -4
  144. package/dist/plugins/EmbeddedEntryInline/FetchingWrappedInlineEntryCard.d.ts +0 -14
  145. package/dist/plugins/EmbeddedEntryInline/ToolbarIcon.d.ts +0 -11
  146. package/dist/plugins/EmbeddedEntryInline/Utils.d.ts +0 -4
  147. package/dist/plugins/EmbeddedEntryInline/index.d.ts +0 -12
  148. package/dist/plugins/EntryEmbedDropdown/index.d.ts +0 -14
  149. package/dist/plugins/Heading/HeadingDropdown.d.ts +0 -28
  150. package/dist/plugins/Heading/HeadingDropdownItem.d.ts +0 -57
  151. package/dist/plugins/Heading/Paragraph.d.ts +0 -58
  152. package/dist/plugins/Hyperlink/Hyperlink.d.ts +0 -13
  153. package/dist/plugins/Hyperlink/ToolbarIcon.d.ts +0 -7
  154. package/dist/plugins/Hyperlink/Util.d.ts +0 -43
  155. package/dist/plugins/Hyperlink/styles.d.ts +0 -12
  156. package/dist/plugins/Hyperlink/useRequestStatus.d.ts +0 -6
  157. package/dist/plugins/InsertBeforeFirstVoidBlock/Util.d.ts +0 -14
  158. package/dist/plugins/InsertBeforeFirstVoidBlock/index.d.ts +0 -3
  159. package/dist/plugins/Italic/index.d.ts +0 -64
  160. package/dist/plugins/List/EditListWrapper.d.ts +0 -2
  161. package/dist/plugins/List/ToolbarDecorator.d.ts +0 -62
  162. package/dist/plugins/NewLinePlugin/index.d.ts +0 -3
  163. package/dist/plugins/Paste/Paste.d.ts +0 -1
  164. package/dist/plugins/Paste/Paste.spec.d.ts +0 -1
  165. package/dist/plugins/Paste/index.d.ts +0 -7
  166. package/dist/plugins/Paste/index.spec.d.ts +0 -1
  167. package/dist/plugins/PasteHtml/PasteHtml.spec.d.ts +0 -1
  168. package/dist/plugins/PasteHtml/Serializer.d.ts +0 -1
  169. package/dist/plugins/PasteHtml/index.d.ts +0 -3
  170. package/dist/plugins/PasteText/PasteText.spec.d.ts +0 -1
  171. package/dist/plugins/PasteText/index.d.ts +0 -3
  172. package/dist/plugins/Quote/QuotePlugin.d.ts +0 -10
  173. package/dist/plugins/Quote/Util.d.ts +0 -2
  174. package/dist/plugins/Underlined/index.d.ts +0 -64
  175. package/dist/plugins/shared/BlockSelectDecorator.d.ts +0 -63
  176. package/dist/plugins/shared/BlockToggleDecorator.d.ts +0 -65
  177. package/dist/plugins/shared/MarkDecorator.d.ts +0 -12
  178. package/dist/plugins/shared/MarkPlugin.d.ts +0 -9
  179. package/dist/plugins/shared/MarkToggleDecorator.d.ts +0 -62
  180. package/dist/plugins/shared/NodeDecorator.d.ts +0 -15
  181. package/dist/plugins/shared/PasteTestHelpers.d.ts +0 -35
  182. package/dist/plugins/shared/PluginApi.d.ts +0 -31
  183. package/dist/plugins/shared/PropTypes.d.ts +0 -15
  184. package/dist/plugins/shared/ToolbarDropdownListItem.d.ts +0 -14
  185. package/dist/plugins/shared/ToolbarIcon.d.ts +0 -16
  186. package/dist/plugins/shared/Util.d.ts +0 -1
  187. package/dist/plugins/shared/UtilHave.d.ts +0 -24
  188. package/dist/setupTests.d.ts +0 -1
  189. package/dist/validations/index.d.ts +0 -9
  190. package/dist/validations/validations.spec.d.ts +0 -1
@@ -0,0 +1,43 @@
1
+ import { Link } from '@contentful/field-editor-reference/dist/types';
2
+ import { BLOCKS, INLINES } from '@contentful/rich-text-types';
3
+ import { PlateEditor } from '@udecode/plate-core';
4
+ import { Path, Node } from 'slate';
5
+ import { CustomElement } from '../types';
6
+ export declare const LINK_TYPES: INLINES[];
7
+ export declare function isBlockSelected(editor: any, type: string): boolean;
8
+ export declare function isRootLevel(path: Path): boolean;
9
+ export declare function hasSelectionText(editor: any): boolean;
10
+ declare type NodeEntry = [CustomElement, Path];
11
+ declare type NodeType = BLOCKS | INLINES;
12
+ export declare function getNodeEntryFromSelection(editor: any, nodeTypeOrTypes: NodeType | NodeType[]): NodeEntry | [];
13
+ export declare function isNodeTypeSelected(editor: any, nodeType: BLOCKS | INLINES): boolean;
14
+ export declare function moveToTheNextLine(editor: any): void;
15
+ export declare function getElementFromCurrentSelection(editor: any): (import("slate").BaseEditor | CustomElement<unknown> | import("../types").CustomText | Path)[];
16
+ export declare function isList(editor: any): boolean;
17
+ export declare function getTableSize(table: CustomElement): Record<'numRows' | 'numColumns', number> | null;
18
+ interface InsertLinkOptions {
19
+ text: string;
20
+ type: INLINES.HYPERLINK | INLINES.ENTRY_HYPERLINK | INLINES.ASSET_HYPERLINK;
21
+ url?: string;
22
+ target?: Link;
23
+ path?: Path;
24
+ }
25
+ export declare function insertLink(editor: any, options: InsertLinkOptions): void;
26
+ export declare function isLinkActive(editor: any): boolean;
27
+ export declare function unwrapLink(editor: any): void;
28
+ export declare function wrapLink(editor: any, { text, url, target, type, path }: InsertLinkOptions): void;
29
+ export declare function getAncestorPathFromSelection(editor: PlateEditor): Path | undefined;
30
+ export declare function shouldUnwrapBlockquote(editor: PlateEditor, type: BLOCKS): boolean;
31
+ export declare function unwrapFromRoot(editor: PlateEditor): void;
32
+ export declare const isAtEndOfTextSelection: (editor: PlateEditor) => boolean;
33
+ export declare function currentSelectionStartsTableCell(editor: PlateEditor): boolean;
34
+ /**
35
+ * This traversal strategy is unfortunately necessary because Slate doesn't
36
+ * expose something like Node.next(editor).
37
+ */
38
+ export declare function getNextNode(editor: PlateEditor): CustomElement | null;
39
+ export declare function currentSelectionPrecedesTableCell(editor: PlateEditor): boolean;
40
+ export declare const INLINE_TYPES: string[];
41
+ export declare const isInlineOrText: (node: Node) => boolean;
42
+ export declare const focus: (editor: PlateEditor) => void;
43
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const HAS_BEFORE_INPUT_SUPPORT: boolean;
2
+ export declare const IS_SAFARI: boolean;
@@ -0,0 +1,7 @@
1
+ import { PlateEditor } from '@udecode/plate-core';
2
+ import { Path } from 'slate';
3
+ import { CustomElement } from '../types';
4
+ /**
5
+ * It filters out all paragraphs and headings from a path and convert them into paragraphs.
6
+ */
7
+ export declare function extractParagraphs(editor: PlateEditor, path: Path): CustomElement[];
@@ -0,0 +1,15 @@
1
+ declare type DateFormatFn = (date: Date | string, short?: boolean) => string;
2
+ /**
3
+ * @param {Date|string} date A valid constructor argument for moment()
4
+ * @param {boolean=} short Render only Today/Tomorrow/Yesterday if valid. Defaults to false
5
+ */
6
+ export declare const formatDate: DateFormatFn;
7
+ /**
8
+ * Returns the time portion of a date in the local time in the format H:MM AM/PM
9
+ *
10
+ * == Examples
11
+ * * `T15:36:45.000Z` => 3:36 PM (if in +0:00 offset)
12
+ */
13
+ export declare const formatTime: DateFormatFn;
14
+ export declare const formatDateAndTime: DateFormatFn;
15
+ export {};
@@ -1,2 +1,26 @@
1
- declare function _default(field: object, nodeType: string): string[];
2
- export default _default;
1
+ /**
2
+ * Given a field object and a rich text node type, return a list of valid
3
+ * content type IDs associated with the node type, based on that node type's
4
+ * `linkContentType` validation.
5
+ *
6
+ * If there is no such validation or the validation is empty, return an empty
7
+ * array.
8
+ *
9
+ * The navigation here is explained by the `nodes` validation having signature:
10
+ * { nodes: { [nodeType]: validationObject[] } }
11
+ *
12
+ * We defensively navigate through this object because
13
+ * 1) the field may not have a `validations` array,
14
+ * 2) the `validations` array may be empty,
15
+ * 3) the `validations` array may not have a `nodes` validation,
16
+ * 4) the `nodes` validation may not validate the `nodeType`, and
17
+ * 5) the `nodeType` validations may not have a `linkContentType` validation.
18
+ *
19
+ * Note that passing an empty array will result in all possible content types
20
+ * being whitelisted.
21
+ *
22
+ * @param {object} field
23
+ * @param {string} nodeType
24
+ * @returns {string[]}
25
+ */
26
+ export default function getLinkedContentTypeIdsForNodeType(field: any, nodeType: any): string[];
@@ -7,4 +7,8 @@
7
7
  * @param {string} nodeType
8
8
  * @returns {object}
9
9
  */
10
- export default function newEntitySelectorConfigFromRichTextField(field: object, nodeType: string): object;
10
+ export default function newEntitySelectorConfigFromRichTextField(field: any, nodeType: any): {
11
+ entityType: "Entry" | "Asset";
12
+ locale: any;
13
+ contentTypes: string[];
14
+ };
@@ -0,0 +1,5 @@
1
+ import { TextOrCustomElement } from '../types';
2
+ /**
3
+ * Ensures incoming void nodes have a child leaf text element.
4
+ */
5
+ export declare function sanitizeIncomingSlateDoc(nodes?: TextOrCustomElement[]): TextOrCustomElement[];
@@ -0,0 +1,8 @@
1
+ import { BLOCKS, INLINES } from '@contentful/rich-text-types';
2
+ import { PlateEditor } from '@udecode/plate-core';
3
+ import { NodeEntry } from 'slate';
4
+ export declare const transformRemove: (editor: PlateEditor, [, path]: NodeEntry<import("slate").Node>) => void;
5
+ export declare const transformParagraphs: (editor: PlateEditor, entry: NodeEntry<import("slate").Node>) => void;
6
+ export declare const transformUnwrap: (editor: PlateEditor, [, path]: NodeEntry<import("slate").Node>) => void;
7
+ export declare const transformWrapIn: (type: BLOCKS | INLINES) => (editor: PlateEditor, [, path]: NodeEntry<import("slate").Node>) => void;
8
+ export declare const transformLift: (editor: PlateEditor, [, path]: NodeEntry<import("slate").Node>) => void;
@@ -0,0 +1,10 @@
1
+ import { FieldExtensionSDK } from '@contentful/app-sdk';
2
+ import { BLOCKS, INLINES } from '@contentful/rich-text-types';
3
+ export declare const VALIDATIONS: {
4
+ ENABLED_MARKS: string;
5
+ ENABLED_NODE_TYPES: string;
6
+ };
7
+ export declare const DEFAULT_ENABLED_NODE_TYPES: string[];
8
+ export declare const VALIDATABLE_NODE_TYPES: (BLOCKS | INLINES)[];
9
+ export declare const isNodeTypeEnabled: (field: FieldExtensionSDK['field'], nodeType: any) => boolean;
10
+ export declare const isMarkEnabled: (field: FieldExtensionSDK['field'], mark: any) => boolean;
@@ -0,0 +1,2 @@
1
+ import { RichTextPlugin } from '../../types';
2
+ export declare const createExitBreakPlugin: () => RichTextPlugin;
@@ -0,0 +1,2 @@
1
+ import { RichTextPlugin } from '../../types';
2
+ export declare const createSoftBreakPlugin: () => RichTextPlugin;
@@ -0,0 +1,3 @@
1
+ export type { SoftBreakRule, ExitBreakRule } from '@udecode/plate-break';
2
+ export * from './createSoftBreakPlugin';
3
+ export * from './createExitBreakPlugin';
@@ -0,0 +1,2 @@
1
+ import { RichTextPlugin } from '../../types';
2
+ export declare function createDragAndDropPlugin(): RichTextPlugin;
@@ -0,0 +1,14 @@
1
+ import { CustomRenderElementProps } from '../../types';
2
+ declare type LinkedEntityBlockProps = CustomRenderElementProps<{
3
+ target: {
4
+ sys: {
5
+ id: string;
6
+ linkType: 'Entry' | 'Asset';
7
+ type: 'Link';
8
+ };
9
+ };
10
+ }> & {
11
+ onEntityFetchComplete: VoidFunction;
12
+ };
13
+ export declare function LinkedEntityBlock(props: LinkedEntityBlockProps): JSX.Element;
14
+ export {};
@@ -1,11 +1,12 @@
1
- export default class EntityLinkToolbarIcon extends React.Component<any, any, any> {
2
- static propTypes: any;
3
- static defaultProps: {
4
- isButton: boolean;
5
- };
6
- constructor(props: any);
7
- constructor(props: any, context: any);
8
- handleClick: (e: any) => void;
9
- handleAction: (event: any) => any;
1
+ export declare const styles: {
2
+ icon: string;
3
+ };
4
+ interface EmbeddedEntityBlockToolbarIconProps {
5
+ isButton?: boolean;
6
+ isDisabled: boolean;
7
+ logAction?: () => void;
8
+ nodeType: string;
9
+ onClose: () => void;
10
10
  }
11
- import React from "react";
11
+ export declare function EmbeddedEntityBlockToolbarIcon({ isButton, isDisabled, logAction, nodeType, onClose, }: EmbeddedEntityBlockToolbarIconProps): JSX.Element;
12
+ export {};
@@ -1,23 +1,2 @@
1
- /**
2
- * Invokes entity selector modal and inserts block embed.
3
- * @param {string} nodeType
4
- * @param {import('@contentful/field-editor-reference/dist/types').FieldExtensionSDK} sdk
5
- * @param {slate.Editor} editor
6
- * @param {function} logAction
7
- */
8
- export function selectEntityAndInsert(nodeType: string, sdk: import('@contentful/field-editor-reference/dist/types').FieldExtensionSDK, editor: any, logAction: Function): Promise<void>;
9
- export function insertBlock(editor: any, nodeType: any, entity: any, focusNextLine?: boolean): void;
10
- export function hasBlockOfType(editor: any, type: string): boolean;
11
- export function createNode(nodeType: any, entity: any): {
12
- type: any;
13
- object: string;
14
- data: {
15
- target: {
16
- sys: {
17
- id: any;
18
- type: string;
19
- linkType: any;
20
- };
21
- };
22
- };
23
- };
1
+ export declare function selectEntityAndInsert(nodeType: any, sdk: any, editor: any, logAction: any): Promise<void>;
2
+ export declare function insertBlock(editor: any, nodeType: any, entity: any): void;
@@ -1,26 +1,6 @@
1
- export default ToolbarIcon;
2
- export function EmbeddedEntityBlockPlugin({ richTextAPI: { sdk, logShortcutAction, logViewportAction }, nodeType, hotkey, }: {
3
- richTextAPI: {
4
- sdk: any;
5
- logShortcutAction: any;
6
- logViewportAction: any;
7
- };
8
- nodeType: any;
9
- hotkey: any;
10
- }): {
11
- renderNode: (props: any, _editor: any, next: any) => any;
12
- onKeyDown(e: any, editor: any, next: any): any;
13
- };
14
- export function EmbeddedEntryBlockPlugin({ richTextAPI }: {
15
- richTextAPI: any;
16
- }): {
17
- renderNode: (props: any, _editor: any, next: any) => any;
18
- onKeyDown(e: any, editor: any, next: any): any;
19
- };
20
- export function EmbeddedAssetBlockPlugin({ richTextAPI }: {
21
- richTextAPI: any;
22
- }): {
23
- renderNode: (props: any, _editor: any, next: any) => any;
24
- onKeyDown(e: any, editor: any, next: any): any;
25
- };
26
- import ToolbarIcon from "./ToolbarIcon";
1
+ import { FieldExtensionSDK } from '@contentful/app-sdk';
2
+ import { TrackingProvider } from 'TrackingProvider';
3
+ import { RichTextPlugin } from '../../types';
4
+ export { EmbeddedEntityBlockToolbarIcon as ToolbarIcon } from './ToolbarIcon';
5
+ export declare const createEmbeddedEntryBlockPlugin: (sdk: FieldExtensionSDK, tracking: TrackingProvider) => RichTextPlugin;
6
+ export declare const createEmbeddedAssetBlockPlugin: (sdk: FieldExtensionSDK, tracking: TrackingProvider) => RichTextPlugin;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { FieldExtensionSDK } from '@contentful/field-editor-shared';
3
+ interface FetchingWrappedInlineEntryCardProps {
4
+ entryId: string;
5
+ sdk: FieldExtensionSDK;
6
+ isSelected: boolean;
7
+ isDisabled: boolean;
8
+ onEdit: (event: React.MouseEvent<Element, MouseEvent>) => void;
9
+ onRemove: (event: React.MouseEvent<Element, MouseEvent>) => void;
10
+ onEntityFetchComplete?: VoidFunction;
11
+ }
12
+ export declare function FetchingWrappedInlineEntryCard(props: FetchingWrappedInlineEntryCardProps): JSX.Element;
13
+ export {};
@@ -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,11 @@
1
+ import { FieldExtensionSDK } from '@contentful/app-sdk';
2
+ import { TrackingProvider } from 'TrackingProvider';
3
+ import { RichTextPlugin } from '../../types';
4
+ interface ToolbarEmbeddedEntityInlineButtonProps {
5
+ onClose: () => void;
6
+ isDisabled: boolean;
7
+ isButton?: boolean;
8
+ }
9
+ export declare function ToolbarEmbeddedEntityInlineButton(props: ToolbarEmbeddedEntityInlineButtonProps): JSX.Element;
10
+ export declare function createEmbeddedEntityInlinePlugin(sdk: FieldExtensionSDK, tracking: TrackingProvider): RichTextPlugin;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import { BLOCKS } from '@contentful/rich-text-types';
3
+ import * as Slate from 'slate-react';
4
+ export declare const HeadingComponents: {
5
+ "heading-1": React.MemoExoticComponent<(props: Slate.RenderElementProps) => JSX.Element>;
6
+ "heading-2": React.MemoExoticComponent<(props: Slate.RenderElementProps) => JSX.Element>;
7
+ "heading-3": React.MemoExoticComponent<(props: Slate.RenderElementProps) => JSX.Element>;
8
+ "heading-4": React.MemoExoticComponent<(props: Slate.RenderElementProps) => JSX.Element>;
9
+ "heading-5": React.MemoExoticComponent<(props: Slate.RenderElementProps) => JSX.Element>;
10
+ "heading-6": React.MemoExoticComponent<(props: Slate.RenderElementProps) => JSX.Element>;
11
+ };
@@ -0,0 +1,4 @@
1
+ export interface ToolbarHeadingButtonProps {
2
+ isDisabled?: boolean;
3
+ }
4
+ export declare function ToolbarHeadingButton(props: ToolbarHeadingButtonProps): JSX.Element | null;
@@ -0,0 +1,2 @@
1
+ import { RichTextPlugin } from '../../types';
2
+ export declare const createHeadingPlugin: () => RichTextPlugin;