@payloadcms/richtext-slate 1.0.0-beta.1 → 1.0.0-beta.2

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 (95) hide show
  1. package/dist/cell/index.d.ts +6 -0
  2. package/dist/data/defaultValue.d.ts +6 -0
  3. package/dist/data/populate.d.ts +20 -0
  4. package/dist/data/recurseNestedFields.d.ts +14 -0
  5. package/dist/data/richTextRelationshipPromise.d.ts +17 -0
  6. package/dist/data/validation.d.ts +4 -0
  7. package/dist/field/RichText.d.ts +16 -0
  8. package/dist/field/elements/Button.d.ts +7 -0
  9. package/dist/field/elements/EnabledRelationshipsCondition.d.ts +3 -0
  10. package/dist/field/elements/ListButton.d.ts +7 -0
  11. package/dist/field/elements/areAllChildrenElements.d.ts +3 -0
  12. package/dist/field/elements/blockquote/index.d.ts +11 -0
  13. package/dist/field/elements/getCommonBlock.d.ts +4 -0
  14. package/dist/field/elements/h1/index.d.ts +10 -0
  15. package/dist/field/elements/h2/index.d.ts +10 -0
  16. package/dist/field/elements/h3/index.d.ts +10 -0
  17. package/dist/field/elements/h4/index.d.ts +10 -0
  18. package/dist/field/elements/h5/index.d.ts +10 -0
  19. package/dist/field/elements/h6/index.d.ts +10 -0
  20. package/dist/field/elements/indent/index.d.ts +10 -0
  21. package/dist/field/elements/index.d.ts +117 -0
  22. package/dist/field/elements/injectVoid.d.ts +4 -0
  23. package/dist/field/elements/isActive.d.ts +4 -0
  24. package/dist/field/elements/isBlockElement.d.ts +9 -0
  25. package/dist/field/elements/isLastSelectedElementEmpty.d.ts +3 -0
  26. package/dist/field/elements/isListActive.d.ts +4 -0
  27. package/dist/field/elements/isWithinListItem.d.ts +3 -0
  28. package/dist/field/elements/li/index.d.ts +6 -0
  29. package/dist/field/elements/link/Button/index.d.ts +7 -0
  30. package/dist/field/elements/link/Element/index.d.ts +12 -0
  31. package/dist/field/elements/link/LinkDrawer/baseFields.d.ts +4 -0
  32. package/dist/field/elements/link/LinkDrawer/index.d.ts +5 -0
  33. package/dist/field/elements/link/LinkDrawer/types.d.ts +9 -0
  34. package/dist/field/elements/link/index.d.ts +17 -0
  35. package/dist/field/elements/link/shared.d.ts +2 -0
  36. package/dist/field/elements/link/utilities.d.ts +16 -0
  37. package/dist/field/elements/listTypes.d.ts +3 -0
  38. package/dist/field/elements/ol/index.d.ts +11 -0
  39. package/dist/field/elements/relationship/Button/Fields/index.d.ts +4 -0
  40. package/dist/field/elements/relationship/Button/index.d.ts +9 -0
  41. package/dist/field/elements/relationship/Element/index.d.ts +13 -0
  42. package/dist/field/elements/relationship/index.d.ts +16 -0
  43. package/dist/field/elements/relationship/plugin.d.ts +3 -0
  44. package/dist/field/elements/textAlign/index.d.ts +7 -0
  45. package/dist/field/elements/toggle.d.ts +4 -0
  46. package/dist/field/elements/toggleList.d.ts +4 -0
  47. package/dist/field/elements/types.d.ts +11 -0
  48. package/dist/field/elements/ul/index.d.ts +11 -0
  49. package/dist/field/elements/unwrapList.d.ts +4 -0
  50. package/dist/field/elements/upload/Button/index.d.ts +9 -0
  51. package/dist/field/elements/upload/Element/UploadDrawer/index.d.ts +8 -0
  52. package/dist/field/elements/upload/Element/index.d.ts +14 -0
  53. package/dist/field/elements/upload/index.d.ts +11 -0
  54. package/dist/field/elements/upload/plugin.d.ts +3 -0
  55. package/dist/field/enablePlugins.d.ts +3 -0
  56. package/dist/field/hotkeys.d.ts +8 -0
  57. package/dist/field/icons/AlignCenter/index.d.ts +4 -0
  58. package/dist/field/icons/AlignLeft/index.d.ts +4 -0
  59. package/dist/field/icons/AlignRight/index.d.ts +4 -0
  60. package/dist/field/icons/Blockquote/index.d.ts +4 -0
  61. package/dist/field/icons/Bold/index.d.ts +4 -0
  62. package/dist/field/icons/Code/index.d.ts +4 -0
  63. package/dist/field/icons/IndentLeft/index.d.ts +5 -0
  64. package/dist/field/icons/IndentRight/index.d.ts +5 -0
  65. package/dist/field/icons/Italic/index.d.ts +4 -0
  66. package/dist/field/icons/Link/index.d.ts +5 -0
  67. package/dist/field/icons/OrderedList/index.d.ts +4 -0
  68. package/dist/field/icons/Relationship/index.d.ts +5 -0
  69. package/dist/field/icons/Strikethrough/index.d.ts +4 -0
  70. package/dist/field/icons/Underline/index.d.ts +4 -0
  71. package/dist/field/icons/UnorderedList/index.d.ts +4 -0
  72. package/dist/field/icons/Upload/index.d.ts +5 -0
  73. package/dist/field/icons/headings/H1/index.d.ts +4 -0
  74. package/dist/field/icons/headings/H2/index.d.ts +4 -0
  75. package/dist/field/icons/headings/H3/index.d.ts +4 -0
  76. package/dist/field/icons/headings/H4/index.d.ts +4 -0
  77. package/dist/field/icons/headings/H5/index.d.ts +4 -0
  78. package/dist/field/icons/headings/H6/index.d.ts +4 -0
  79. package/dist/field/icons/headings/index.d.ts +11 -0
  80. package/dist/field/index.d.ts +5 -0
  81. package/dist/field/leaves/Button.d.ts +8 -0
  82. package/dist/field/leaves/bold/index.d.ts +10 -0
  83. package/dist/field/leaves/code/index.d.ts +10 -0
  84. package/dist/field/leaves/index.d.ts +40 -0
  85. package/dist/field/leaves/isActive.d.ts +3 -0
  86. package/dist/field/leaves/italic/index.d.ts +10 -0
  87. package/dist/field/leaves/strikethrough/index.d.ts +10 -0
  88. package/dist/field/leaves/toggle.d.ts +3 -0
  89. package/dist/field/leaves/underline/index.d.ts +10 -0
  90. package/dist/field/mergeCustomFunctions.d.ts +3 -0
  91. package/dist/field/plugins/withEnterBreakOut.d.ts +3 -0
  92. package/dist/field/plugins/withHTML.d.ts +3 -0
  93. package/dist/index.d.ts +4 -0
  94. package/dist/types.d.ts +55 -0
  95. package/package.json +4 -3
@@ -0,0 +1,6 @@
1
+ import type { CellComponentProps, RichTextField } from 'payload/types';
2
+ import React from 'react';
3
+ import type { AdapterArguments } from '../types';
4
+ declare const RichTextCell: React.FC<CellComponentProps<RichTextField<AdapterArguments>, any>>;
5
+ export default RichTextCell;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,6 @@
1
+ export declare const defaultRichTextValue: {
2
+ children: {
3
+ text: string;
4
+ }[];
5
+ }[];
6
+ //# sourceMappingURL=defaultValue.d.ts.map
@@ -0,0 +1,20 @@
1
+ import type { PayloadRequest } from 'payload/types';
2
+ import type { Collection, Field, RichTextField } from 'payload/types';
3
+ import type { AdapterArguments } from '../types';
4
+ type Arguments = {
5
+ currentDepth?: number;
6
+ data: unknown;
7
+ depth: number;
8
+ field: RichTextField<AdapterArguments>;
9
+ key: number | string;
10
+ overrideAccess?: boolean;
11
+ req: PayloadRequest;
12
+ showHiddenFields: boolean;
13
+ };
14
+ export declare const populate: ({ id, collection, currentDepth, data, depth, key, overrideAccess, req, showHiddenFields, }: Omit<Arguments, "field"> & {
15
+ collection: Collection;
16
+ field: Field;
17
+ id: string;
18
+ }) => Promise<void>;
19
+ export {};
20
+ //# sourceMappingURL=populate.d.ts.map
@@ -0,0 +1,14 @@
1
+ import type { Field, PayloadRequest } from 'payload/types';
2
+ type NestedRichTextFieldsArgs = {
3
+ currentDepth?: number;
4
+ data: unknown;
5
+ depth: number;
6
+ fields: Field[];
7
+ overrideAccess: boolean;
8
+ promises: Promise<void>[];
9
+ req: PayloadRequest;
10
+ showHiddenFields: boolean;
11
+ };
12
+ export declare const recurseNestedFields: ({ currentDepth, data, depth, fields, overrideAccess, promises, req, showHiddenFields, }: NestedRichTextFieldsArgs) => void;
13
+ export {};
14
+ //# sourceMappingURL=recurseNestedFields.d.ts.map
@@ -0,0 +1,17 @@
1
+ import type { PayloadRequest, RichTextAdapter, RichTextField } from 'payload/types';
2
+ import type { AdapterArguments } from '../types';
3
+ export type Args = Parameters<RichTextAdapter<AdapterArguments>['afterReadPromise']>[0];
4
+ type RecurseRichTextArgs = {
5
+ children: unknown[];
6
+ currentDepth: number;
7
+ depth: number;
8
+ field: RichTextField<AdapterArguments>;
9
+ overrideAccess: boolean;
10
+ promises: Promise<void>[];
11
+ req: PayloadRequest;
12
+ showHiddenFields: boolean;
13
+ };
14
+ export declare const recurseRichText: ({ children, currentDepth, depth, field, overrideAccess, promises, req, showHiddenFields, }: RecurseRichTextArgs) => void;
15
+ export declare const richTextRelationshipPromise: ({ currentDepth, depth, field, overrideAccess, req, showHiddenFields, siblingDoc, }: Args) => Promise<void>;
16
+ export {};
17
+ //# sourceMappingURL=richTextRelationshipPromise.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { RichTextField, Validate } from 'payload/types';
2
+ import type { AdapterArguments } from '../types';
3
+ export declare const richText: Validate<unknown, unknown, RichTextField<AdapterArguments>>;
4
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1,16 @@
1
+ import type { BaseEditor } from 'slate';
2
+ import type { HistoryEditor } from 'slate-history';
3
+ import type { ReactEditor } from 'slate-react';
4
+ import React from 'react';
5
+ import type { ElementNode, FieldProps, TextNode } from '../types';
6
+ import './index.scss';
7
+ declare module 'slate' {
8
+ interface CustomTypes {
9
+ Editor: BaseEditor & ReactEditor & HistoryEditor;
10
+ Element: ElementNode;
11
+ Text: TextNode;
12
+ }
13
+ }
14
+ declare const _default: React.FC<FieldProps>;
15
+ export default _default;
16
+ //# sourceMappingURL=RichText.d.ts.map
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { ButtonProps } from './types';
3
+ import '../buttons.scss';
4
+ export declare const baseClass = "rich-text__button";
5
+ declare const ElementButton: React.FC<ButtonProps>;
6
+ export default ElementButton;
7
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ export declare const EnabledRelationshipsCondition: React.FC<any>;
3
+ //# sourceMappingURL=EnabledRelationshipsCondition.d.ts.map
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { ButtonProps } from './types';
3
+ import '../buttons.scss';
4
+ export declare const baseClass = "rich-text__button";
5
+ declare const ListButton: React.FC<ButtonProps>;
6
+ export default ListButton;
7
+ //# sourceMappingURL=ListButton.d.ts.map
@@ -0,0 +1,3 @@
1
+ import type { Node } from 'slate';
2
+ export declare const areAllChildrenElements: (node: Node) => boolean;
3
+ //# sourceMappingURL=areAllChildrenElements.d.ts.map
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ declare const blockquote: {
4
+ Button: () => React.JSX.Element;
5
+ Element: ({ attributes, children }: {
6
+ attributes: any;
7
+ children: any;
8
+ }) => React.JSX.Element;
9
+ };
10
+ export default blockquote;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { NodeEntry, NodeMatch } from 'slate';
2
+ import { Editor, Node } from 'slate';
3
+ export declare const getCommonBlock: (editor: Editor, match?: NodeMatch<Node>) => NodeEntry<Node>;
4
+ //# sourceMappingURL=getCommonBlock.d.ts.map
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ declare const h1: {
3
+ Button: () => React.JSX.Element;
4
+ Element: ({ attributes, children }: {
5
+ attributes: any;
6
+ children: any;
7
+ }) => React.JSX.Element;
8
+ };
9
+ export default h1;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ declare const h2: {
3
+ Button: () => React.JSX.Element;
4
+ Element: ({ attributes, children }: {
5
+ attributes: any;
6
+ children: any;
7
+ }) => React.JSX.Element;
8
+ };
9
+ export default h2;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ declare const h3: {
3
+ Button: () => React.JSX.Element;
4
+ Element: ({ attributes, children }: {
5
+ attributes: any;
6
+ children: any;
7
+ }) => React.JSX.Element;
8
+ };
9
+ export default h3;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ declare const h4: {
3
+ Button: () => React.JSX.Element;
4
+ Element: ({ attributes, children }: {
5
+ attributes: any;
6
+ children: any;
7
+ }) => React.JSX.Element;
8
+ };
9
+ export default h4;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ declare const h5: {
3
+ Button: () => React.JSX.Element;
4
+ Element: ({ attributes, children }: {
5
+ attributes: any;
6
+ children: any;
7
+ }) => React.JSX.Element;
8
+ };
9
+ export default h5;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ declare const h6: {
3
+ Button: () => React.JSX.Element;
4
+ Element: ({ attributes, children }: {
5
+ attributes: any;
6
+ children: any;
7
+ }) => React.JSX.Element;
8
+ };
9
+ export default h6;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ declare const indent: {
3
+ Button: () => React.JSX.Element;
4
+ Element: ({ attributes, children }: {
5
+ attributes: any;
6
+ children: any;
7
+ }) => React.JSX.Element;
8
+ };
9
+ export default indent;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,117 @@
1
+ /// <reference types="react" />
2
+ declare const elements: {
3
+ blockquote: {
4
+ Button: () => import("react").JSX.Element;
5
+ Element: ({ attributes, children }: {
6
+ attributes: any;
7
+ children: any;
8
+ }) => import("react").JSX.Element;
9
+ };
10
+ h1: {
11
+ Button: () => import("react").JSX.Element;
12
+ Element: ({ attributes, children }: {
13
+ attributes: any;
14
+ children: any;
15
+ }) => import("react").JSX.Element;
16
+ };
17
+ h2: {
18
+ Button: () => import("react").JSX.Element;
19
+ Element: ({ attributes, children }: {
20
+ attributes: any;
21
+ children: any;
22
+ }) => import("react").JSX.Element;
23
+ };
24
+ h3: {
25
+ Button: () => import("react").JSX.Element;
26
+ Element: ({ attributes, children }: {
27
+ attributes: any;
28
+ children: any;
29
+ }) => import("react").JSX.Element;
30
+ };
31
+ h4: {
32
+ Button: () => import("react").JSX.Element;
33
+ Element: ({ attributes, children }: {
34
+ attributes: any;
35
+ children: any;
36
+ }) => import("react").JSX.Element;
37
+ };
38
+ h5: {
39
+ Button: () => import("react").JSX.Element;
40
+ Element: ({ attributes, children }: {
41
+ attributes: any;
42
+ children: any;
43
+ }) => import("react").JSX.Element;
44
+ };
45
+ h6: {
46
+ Button: () => import("react").JSX.Element;
47
+ Element: ({ attributes, children }: {
48
+ attributes: any;
49
+ children: any;
50
+ }) => import("react").JSX.Element;
51
+ };
52
+ indent: {
53
+ Button: () => import("react").JSX.Element;
54
+ Element: ({ attributes, children }: {
55
+ attributes: any;
56
+ children: any;
57
+ }) => import("react").JSX.Element;
58
+ };
59
+ li: {
60
+ Element: (props: any) => import("react").JSX.Element;
61
+ };
62
+ link: {
63
+ Button: import("react").FC<{
64
+ fieldProps: import("../../types").FieldProps;
65
+ path: string;
66
+ }>;
67
+ Element: import("react").FC<{
68
+ attributes: import("react").HTMLAttributes<HTMLDivElement>;
69
+ children: import("react").ReactNode;
70
+ editorRef: import("react").RefObject<HTMLDivElement>;
71
+ element: any;
72
+ fieldProps: import("../../types").FieldProps;
73
+ }>;
74
+ plugins: ((incomingEditor: import("slate").BaseEditor & import("slate-react").ReactEditor & import("slate-history").HistoryEditor) => import("slate").BaseEditor & import("slate-react").ReactEditor & import("slate-history").HistoryEditor)[];
75
+ };
76
+ ol: {
77
+ Button: () => import("react").JSX.Element;
78
+ Element: ({ attributes, children }: {
79
+ attributes: any;
80
+ children: any;
81
+ }) => import("react").JSX.Element;
82
+ };
83
+ relationship: {
84
+ Button: (props: {
85
+ enabledCollectionSlugs: string[];
86
+ path: string;
87
+ }) => import("react").ReactNode;
88
+ Element: (props: {
89
+ attributes: import("react").HTMLAttributes<HTMLDivElement>;
90
+ children: import("react").ReactNode;
91
+ element: any;
92
+ fieldProps: import("../../types").FieldProps;
93
+ }) => import("react").ReactNode;
94
+ plugins: ((incomingEditor: any) => any)[];
95
+ };
96
+ textAlign: {
97
+ name: string;
98
+ Button: () => import("react").JSX.Element;
99
+ };
100
+ ul: {
101
+ Button: () => import("react").JSX.Element;
102
+ Element: ({ attributes, children }: {
103
+ attributes: any;
104
+ children: any;
105
+ }) => import("react").JSX.Element;
106
+ };
107
+ upload: {
108
+ Button: (props: {
109
+ enabledCollectionSlugs: string[];
110
+ path: string;
111
+ }) => import("react").ReactNode;
112
+ Element: (props: import("./upload/Element").ElementProps) => import("react").ReactNode;
113
+ plugins: ((incomingEditor: any) => any)[];
114
+ };
115
+ };
116
+ export default elements;
117
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { Element } from 'slate';
2
+ import { Editor } from 'slate';
3
+ export declare const injectVoidElement: (editor: Editor, element: Element) => void;
4
+ //# sourceMappingURL=injectVoid.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { Editor } from 'slate';
2
+ declare const isElementActive: (editor: Editor, format: string, blockType?: string) => boolean;
3
+ export default isElementActive;
4
+ //# sourceMappingURL=isActive.d.ts.map
@@ -0,0 +1,9 @@
1
+ import { Editor } from 'slate';
2
+ /**
3
+ * Returns true, if the provided node is a Block Element.
4
+ * Note: Using Editor.isBlock() is not sufficient, as since slate 0.90 it returns `true` for Text nodes and the editor as well.
5
+ *
6
+ * Related Issue: https://github.com/ianstormtaylor/slate/issues/5287
7
+ */
8
+ export declare const isBlockElement: (editor: Editor, node: any) => node is import("../../types").ElementNode;
9
+ //# sourceMappingURL=isBlockElement.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { Editor } from 'slate';
2
+ export declare const isLastSelectedElementEmpty: (editor: Editor) => boolean;
3
+ //# sourceMappingURL=isLastSelectedElementEmpty.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { Editor } from 'slate';
2
+ declare const isListActive: (editor: Editor, format: string) => boolean;
3
+ export default isListActive;
4
+ //# sourceMappingURL=isListActive.d.ts.map
@@ -0,0 +1,3 @@
1
+ import { Editor } from 'slate';
2
+ export declare const isWithinListItem: (editor: Editor) => boolean;
3
+ //# sourceMappingURL=isWithinListItem.d.ts.map
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ Element: (props: any) => React.JSX.Element;
4
+ };
5
+ export default _default;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { FieldProps } from '../../../../types';
3
+ export declare const LinkButton: React.FC<{
4
+ fieldProps: FieldProps;
5
+ path: string;
6
+ }>;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,12 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ import React from 'react';
3
+ import type { FieldProps } from '../../../../types';
4
+ import './index.scss';
5
+ export declare const LinkElement: React.FC<{
6
+ attributes: HTMLAttributes<HTMLDivElement>;
7
+ children: React.ReactNode;
8
+ editorRef: React.RefObject<HTMLDivElement>;
9
+ element: any;
10
+ fieldProps: FieldProps;
11
+ }>;
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { Config } from 'payload/config';
2
+ import type { Field } from 'payload/types';
3
+ export declare const getBaseFields: (config: Config) => Field[];
4
+ //# sourceMappingURL=baseFields.d.ts.map
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { Props } from './types';
3
+ import './index.scss';
4
+ export declare const LinkDrawer: React.FC<Props>;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { Field, Fields } from 'payload/types';
2
+ export type Props = {
3
+ drawerSlug: string;
4
+ fieldSchema: Field[];
5
+ handleClose: () => void;
6
+ handleModalSubmit: (fields: Fields, data: Record<string, unknown>) => void;
7
+ initialState?: Fields;
8
+ };
9
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ declare const link: {
3
+ Button: import("react").FC<{
4
+ fieldProps: import("../../../types").FieldProps;
5
+ path: string;
6
+ }>;
7
+ Element: import("react").FC<{
8
+ attributes: import("react").HTMLAttributes<HTMLDivElement>;
9
+ children: import("react").ReactNode;
10
+ editorRef: import("react").RefObject<HTMLDivElement>;
11
+ element: any;
12
+ fieldProps: import("../../../types").FieldProps;
13
+ }>;
14
+ plugins: ((incomingEditor: import("slate").BaseEditor & import("slate-react").ReactEditor & import("slate-history").HistoryEditor) => import("slate").BaseEditor & import("slate-react").ReactEditor & import("slate-history").HistoryEditor)[];
15
+ };
16
+ export default link;
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export declare const modalSlug = "rich-text-link-modal";
2
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1,16 @@
1
+ import type { i18n } from 'i18next';
2
+ import type { SanitizedConfig } from 'payload/config';
3
+ import type { Field } from 'payload/types';
4
+ import type { Editor } from 'slate';
5
+ export declare const unwrapLink: (editor: Editor) => void;
6
+ export declare const wrapLink: (editor: Editor) => void;
7
+ export declare const withLinks: (incomingEditor: Editor) => Editor;
8
+ /**
9
+ * This function is run to enrich the basefields which every link has with potential, custom user-added fields.
10
+ */
11
+ export declare function transformExtraFields(customFieldSchema: ((args: {
12
+ config: SanitizedConfig;
13
+ defaultFields: Field[];
14
+ i18n: i18n;
15
+ }) => Field[]) | Field[], config: SanitizedConfig, i18n: i18n): Field[];
16
+ //# sourceMappingURL=utilities.d.ts.map
@@ -0,0 +1,3 @@
1
+ declare const _default: string[];
2
+ export default _default;
3
+ //# sourceMappingURL=listTypes.d.ts.map
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ declare const ol: {
4
+ Button: () => React.JSX.Element;
5
+ Element: ({ attributes, children }: {
6
+ attributes: any;
7
+ children: any;
8
+ }) => React.JSX.Element;
9
+ };
10
+ export default ol;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const RelationshipFields: () => React.JSX.Element;
3
+ export default RelationshipFields;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ type Props = {
4
+ enabledCollectionSlugs: string[];
5
+ path: string;
6
+ };
7
+ declare const _default: (props: Props) => React.ReactNode;
8
+ export default _default;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,13 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ import React from 'react';
3
+ import type { FieldProps } from '../../../../types';
4
+ import './index.scss';
5
+ type Props = {
6
+ attributes: HTMLAttributes<HTMLDivElement>;
7
+ children: React.ReactNode;
8
+ element: any;
9
+ fieldProps: FieldProps;
10
+ };
11
+ declare const _default: (props: Props) => React.ReactNode;
12
+ export default _default;
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ Button: (props: {
4
+ enabledCollectionSlugs: string[];
5
+ path: string;
6
+ }) => import("react").ReactNode;
7
+ Element: (props: {
8
+ attributes: import("react").HTMLAttributes<HTMLDivElement>;
9
+ children: import("react").ReactNode;
10
+ element: any;
11
+ fieldProps: import("../../../types").FieldProps;
12
+ }) => import("react").ReactNode;
13
+ plugins: ((incomingEditor: any) => any)[];
14
+ };
15
+ export default _default;
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ declare const withRelationship: (incomingEditor: any) => any;
2
+ export default withRelationship;
3
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ declare const _default: {
3
+ name: string;
4
+ Button: () => React.JSX.Element;
5
+ };
6
+ export default _default;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { Editor } from 'slate';
2
+ declare const toggleElement: (editor: Editor, format: string, blockType?: string) => void;
3
+ export default toggleElement;
4
+ //# sourceMappingURL=toggle.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { Editor } from 'slate';
2
+ declare const toggleList: (editor: Editor, format: string) => void;
3
+ export default toggleList;
4
+ //# sourceMappingURL=toggleList.d.ts.map
@@ -0,0 +1,11 @@
1
+ import type { ElementType } from 'react';
2
+ export type ButtonProps = {
3
+ children?: React.ReactNode;
4
+ className?: string;
5
+ el?: ElementType;
6
+ format: string;
7
+ onClick?: (e: React.MouseEvent) => void;
8
+ tooltip?: string;
9
+ type?: string;
10
+ };
11
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ declare const ul: {
4
+ Button: () => React.JSX.Element;
5
+ Element: ({ attributes, children }: {
6
+ attributes: any;
7
+ children: any;
8
+ }) => React.JSX.Element;
9
+ };
10
+ export default ul;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { Path } from 'slate';
2
+ import { Editor } from 'slate';
3
+ export declare const unwrapList: (editor: Editor, atPath: Path) => void;
4
+ //# sourceMappingURL=unwrapList.d.ts.map
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ type ButtonProps = {
4
+ enabledCollectionSlugs: string[];
5
+ path: string;
6
+ };
7
+ declare const _default: (props: ButtonProps) => React.ReactNode;
8
+ export default _default;
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,8 @@
1
+ import type { SanitizedCollectionConfig } from 'payload/types';
2
+ import React from 'react';
3
+ import type { ElementProps } from '..';
4
+ export declare const UploadDrawer: React.FC<ElementProps & {
5
+ drawerSlug: string;
6
+ relatedCollection: SanitizedCollectionConfig;
7
+ }>;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,14 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ import React from 'react';
3
+ import type { FieldProps } from '../../../../types';
4
+ import './index.scss';
5
+ export type ElementProps = {
6
+ attributes: HTMLAttributes<HTMLDivElement>;
7
+ children: React.ReactNode;
8
+ element: any;
9
+ enabledCollectionSlugs: string[];
10
+ fieldProps: FieldProps;
11
+ };
12
+ declare const _default: (props: ElementProps) => React.ReactNode;
13
+ export default _default;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ Button: (props: {
4
+ enabledCollectionSlugs: string[];
5
+ path: string;
6
+ }) => import("react").ReactNode;
7
+ Element: (props: import("./Element").ElementProps) => import("react").ReactNode;
8
+ plugins: ((incomingEditor: any) => any)[];
9
+ };
10
+ export default _default;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ declare const withRelationship: (incomingEditor: any) => any;
2
+ export default withRelationship;
3
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1,3 @@
1
+ declare const enablePlugins: (CreatedEditor: any, functions: any) => any;
2
+ export default enablePlugins;
3
+ //# sourceMappingURL=enablePlugins.d.ts.map
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ 'mod+`': string;
3
+ 'mod+b': string;
4
+ 'mod+i': string;
5
+ 'mod+u': string;
6
+ };
7
+ export default _default;
8
+ //# sourceMappingURL=hotkeys.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const AlignCenterIcon: React.FC;
3
+ export default AlignCenterIcon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const AlignLeftIcon: React.FC;
3
+ export default AlignLeftIcon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const AlignRightIcon: React.FC;
3
+ export default AlignRightIcon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const BlockquoteIcon: React.FC;
3
+ export default BlockquoteIcon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const BoldIcon: React.FC;
3
+ export default BoldIcon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const CodeIcon: React.FC;
3
+ export default CodeIcon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ declare const IndentLeft: React.FC;
4
+ export default IndentLeft;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ declare const IndentRight: React.FC;
4
+ export default IndentRight;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const ItalicIcon: React.FC;
3
+ export default ItalicIcon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ declare const LinkIcon: React.FC;
4
+ export default LinkIcon;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const OrderedListIcon: React.FC;
3
+ export default OrderedListIcon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ declare const Relationship: React.FC;
4
+ export default Relationship;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const StrikethroughIcon: React.FC;
3
+ export default StrikethroughIcon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const UnderlineIcon: React.FC;
3
+ export default UnderlineIcon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const UnorderedListIcon: React.FC;
3
+ export default UnorderedListIcon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ declare const Upload: React.FC;
4
+ export default Upload;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const H1Icon: React.FC;
3
+ export default H1Icon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const H2Icon: React.FC;
3
+ export default H2Icon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const H3Icon: React.FC;
3
+ export default H3Icon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const H4Icon: React.FC;
3
+ export default H4Icon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const H5Icon: React.FC;
3
+ export default H5Icon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ declare const H5Icon: React.FC;
3
+ export default H5Icon;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ H1: import("react").FC<{}>;
4
+ H2: import("react").FC<{}>;
5
+ H3: import("react").FC<{}>;
6
+ H4: import("react").FC<{}>;
7
+ H5: import("react").FC<{}>;
8
+ H6: import("react").FC<{}>;
9
+ };
10
+ export default _default;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import type { FieldProps } from '../types';
3
+ declare const RichTextField: React.FC<FieldProps>;
4
+ export default RichTextField;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import '../buttons.scss';
3
+ declare const LeafButton: ({ children, format }: {
4
+ children: any;
5
+ format: any;
6
+ }) => React.JSX.Element;
7
+ export default LeafButton;
8
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ declare const bold: {
3
+ Button: () => React.JSX.Element;
4
+ Leaf: ({ attributes, children }: {
5
+ attributes: any;
6
+ children: any;
7
+ }) => React.JSX.Element;
8
+ };
9
+ export default bold;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ declare const code: {
3
+ Button: () => React.JSX.Element;
4
+ Leaf: ({ attributes, children }: {
5
+ attributes: any;
6
+ children: any;
7
+ }) => React.JSX.Element;
8
+ };
9
+ export default code;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,40 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ bold: {
4
+ Button: () => import("react").JSX.Element;
5
+ Leaf: ({ attributes, children }: {
6
+ attributes: any;
7
+ children: any;
8
+ }) => import("react").JSX.Element;
9
+ };
10
+ code: {
11
+ Button: () => import("react").JSX.Element;
12
+ Leaf: ({ attributes, children }: {
13
+ attributes: any;
14
+ children: any;
15
+ }) => import("react").JSX.Element;
16
+ };
17
+ italic: {
18
+ Button: () => import("react").JSX.Element;
19
+ Leaf: ({ attributes, children }: {
20
+ attributes: any;
21
+ children: any;
22
+ }) => import("react").JSX.Element;
23
+ };
24
+ strikethrough: {
25
+ Button: () => import("react").JSX.Element;
26
+ Leaf: ({ attributes, children }: {
27
+ attributes: any;
28
+ children: any;
29
+ }) => import("react").JSX.Element;
30
+ };
31
+ underline: {
32
+ Button: () => import("react").JSX.Element;
33
+ Leaf: ({ attributes, children }: {
34
+ attributes: any;
35
+ children: any;
36
+ }) => import("react").JSX.Element;
37
+ };
38
+ };
39
+ export default _default;
40
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ declare const isLeafActive: (editor: any, format: any) => boolean;
2
+ export default isLeafActive;
3
+ //# sourceMappingURL=isActive.d.ts.map
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ declare const italic: {
3
+ Button: () => React.JSX.Element;
4
+ Leaf: ({ attributes, children }: {
5
+ attributes: any;
6
+ children: any;
7
+ }) => React.JSX.Element;
8
+ };
9
+ export default italic;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ declare const strikethrough: {
3
+ Button: () => React.JSX.Element;
4
+ Leaf: ({ attributes, children }: {
5
+ attributes: any;
6
+ children: any;
7
+ }) => React.JSX.Element;
8
+ };
9
+ export default strikethrough;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ declare const toggleLeaf: (editor: any, format: any) => void;
2
+ export default toggleLeaf;
3
+ //# sourceMappingURL=toggle.d.ts.map
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ declare const underline: {
3
+ Button: () => React.JSX.Element;
4
+ Leaf: ({ attributes, children }: {
5
+ attributes: any;
6
+ children: any;
7
+ }) => React.JSX.Element;
8
+ };
9
+ export default underline;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ declare const _default: (enabledFunctions: any, builtInFunctions: any) => any;
2
+ export default _default;
3
+ //# sourceMappingURL=mergeCustomFunctions.d.ts.map
@@ -0,0 +1,3 @@
1
+ declare const withEnterBreakOut: (editor: any) => any;
2
+ export default withEnterBreakOut;
3
+ //# sourceMappingURL=withEnterBreakOut.d.ts.map
@@ -0,0 +1,3 @@
1
+ declare const withHTML: (incomingEditor: any) => any;
2
+ export default withHTML;
3
+ //# sourceMappingURL=withHTML.d.ts.map
@@ -0,0 +1,4 @@
1
+ import type { RichTextAdapter } from 'payload/types';
2
+ import type { AdapterArguments } from './types';
3
+ export declare function createSlate(args: AdapterArguments): RichTextAdapter<AdapterArguments>;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,55 @@
1
+ /// <reference types="react" />
2
+ import type { i18n as Ii18n } from 'i18next';
3
+ import type { SanitizedConfig } from 'payload/config';
4
+ import type { Field, RichTextFieldProps } from 'payload/types';
5
+ import type { Editor } from 'slate';
6
+ export type TextNode = {
7
+ [x: string]: unknown;
8
+ text: string;
9
+ };
10
+ export type ElementNode = {
11
+ children: (ElementNode | TextNode)[];
12
+ type?: string;
13
+ };
14
+ export declare function nodeIsTextNode(node: ElementNode | TextNode): node is TextNode;
15
+ type RichTextPlugin = (editor: Editor) => Editor;
16
+ export type RichTextCustomElement = {
17
+ Button: React.ComponentType<any>;
18
+ Element: React.ComponentType<any>;
19
+ name: string;
20
+ plugins?: RichTextPlugin[];
21
+ };
22
+ export type RichTextCustomLeaf = {
23
+ Button: React.ComponentType<any>;
24
+ Leaf: React.ComponentType<any>;
25
+ name: string;
26
+ plugins?: RichTextPlugin[];
27
+ };
28
+ export type RichTextElement = 'blockquote' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'indent' | 'link' | 'ol' | 'relationship' | 'textAlign' | 'ul' | 'upload' | RichTextCustomElement;
29
+ export type RichTextLeaf = 'bold' | 'code' | 'italic' | 'strikethrough' | 'underline' | RichTextCustomLeaf;
30
+ export type AdapterArguments = {
31
+ admin?: {
32
+ elements?: RichTextElement[];
33
+ hideGutter?: boolean;
34
+ leaves?: RichTextLeaf[];
35
+ link?: {
36
+ fields?: ((args: {
37
+ config: SanitizedConfig;
38
+ defaultFields: Field[];
39
+ i18n: Ii18n;
40
+ }) => Field[]) | Field[];
41
+ };
42
+ placeholder?: Record<string, string> | string;
43
+ rtl?: boolean;
44
+ upload?: {
45
+ collections: {
46
+ [collection: string]: {
47
+ fields: Field[];
48
+ };
49
+ };
50
+ };
51
+ };
52
+ };
53
+ export type FieldProps = RichTextFieldProps<AdapterArguments>;
54
+ export {};
55
+ //# sourceMappingURL=types.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/richtext-slate",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.2",
4
4
  "description": "The officially supported Slate richtext adapter for Payload",
5
5
  "repository": "https://github.com/payloadcms/payload",
6
6
  "license": "MIT",
@@ -22,8 +22,8 @@
22
22
  "devDependencies": {
23
23
  "@types/node": "20.5.7",
24
24
  "@types/react": "18.2.15",
25
- "@payloadcms/eslint-config": "0.0.1",
26
- "payload": "2.0.0-beta.2"
25
+ "payload": "2.0.0-beta.0",
26
+ "@payloadcms/eslint-config": "0.0.1"
27
27
  },
28
28
  "exports": null,
29
29
  "publishConfig": {
@@ -36,6 +36,7 @@
36
36
  "build": "pnpm copyfiles && pnpm build:swc && pnpm build:types",
37
37
  "build:swc": "swc ./src -d ./dist --config-file .swcrc",
38
38
  "build:types": "tsc --emitDeclarationOnly --outDir dist",
39
+ "clean": "rimraf {dist,*.tsbuildinfo}",
39
40
  "copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/"
40
41
  }
41
42
  }