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

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 (111) hide show
  1. package/dist/field/buttons.scss +15 -0
  2. package/dist/field/elements/blockquote/index.scss +9 -0
  3. package/dist/field/elements/link/Element/index.scss +92 -0
  4. package/dist/field/elements/link/LinkDrawer/index.scss +50 -0
  5. package/dist/field/elements/ol/index.scss +7 -0
  6. package/dist/field/elements/relationship/Button/index.scss +7 -0
  7. package/dist/field/elements/relationship/Element/index.scss +93 -0
  8. package/dist/field/elements/ul/index.scss +7 -0
  9. package/dist/field/elements/upload/Button/index.scss +7 -0
  10. package/dist/field/elements/upload/Element/index.scss +147 -0
  11. package/dist/field/icons/IndentLeft/index.scss +16 -0
  12. package/dist/field/icons/IndentRight/index.scss +16 -0
  13. package/dist/field/icons/Link/index.scss +11 -0
  14. package/dist/field/icons/Relationship/index.scss +12 -0
  15. package/dist/field/icons/Upload/index.scss +11 -0
  16. package/dist/field/index.scss +193 -0
  17. package/package.json +6 -5
  18. package/dist/cell/index.d.ts +0 -6
  19. package/dist/data/defaultValue.d.ts +0 -6
  20. package/dist/data/populate.d.ts +0 -20
  21. package/dist/data/recurseNestedFields.d.ts +0 -14
  22. package/dist/data/richTextRelationshipPromise.d.ts +0 -17
  23. package/dist/data/validation.d.ts +0 -4
  24. package/dist/field/RichText.d.ts +0 -16
  25. package/dist/field/elements/Button.d.ts +0 -7
  26. package/dist/field/elements/EnabledRelationshipsCondition.d.ts +0 -3
  27. package/dist/field/elements/ListButton.d.ts +0 -7
  28. package/dist/field/elements/areAllChildrenElements.d.ts +0 -3
  29. package/dist/field/elements/blockquote/index.d.ts +0 -11
  30. package/dist/field/elements/getCommonBlock.d.ts +0 -4
  31. package/dist/field/elements/h1/index.d.ts +0 -10
  32. package/dist/field/elements/h2/index.d.ts +0 -10
  33. package/dist/field/elements/h3/index.d.ts +0 -10
  34. package/dist/field/elements/h4/index.d.ts +0 -10
  35. package/dist/field/elements/h5/index.d.ts +0 -10
  36. package/dist/field/elements/h6/index.d.ts +0 -10
  37. package/dist/field/elements/indent/index.d.ts +0 -10
  38. package/dist/field/elements/index.d.ts +0 -117
  39. package/dist/field/elements/injectVoid.d.ts +0 -4
  40. package/dist/field/elements/isActive.d.ts +0 -4
  41. package/dist/field/elements/isBlockElement.d.ts +0 -9
  42. package/dist/field/elements/isLastSelectedElementEmpty.d.ts +0 -3
  43. package/dist/field/elements/isListActive.d.ts +0 -4
  44. package/dist/field/elements/isWithinListItem.d.ts +0 -3
  45. package/dist/field/elements/li/index.d.ts +0 -6
  46. package/dist/field/elements/link/Button/index.d.ts +0 -7
  47. package/dist/field/elements/link/Element/index.d.ts +0 -12
  48. package/dist/field/elements/link/LinkDrawer/baseFields.d.ts +0 -4
  49. package/dist/field/elements/link/LinkDrawer/index.d.ts +0 -5
  50. package/dist/field/elements/link/LinkDrawer/types.d.ts +0 -9
  51. package/dist/field/elements/link/index.d.ts +0 -17
  52. package/dist/field/elements/link/shared.d.ts +0 -2
  53. package/dist/field/elements/link/utilities.d.ts +0 -16
  54. package/dist/field/elements/listTypes.d.ts +0 -3
  55. package/dist/field/elements/ol/index.d.ts +0 -11
  56. package/dist/field/elements/relationship/Button/Fields/index.d.ts +0 -4
  57. package/dist/field/elements/relationship/Button/index.d.ts +0 -9
  58. package/dist/field/elements/relationship/Element/index.d.ts +0 -13
  59. package/dist/field/elements/relationship/index.d.ts +0 -16
  60. package/dist/field/elements/relationship/plugin.d.ts +0 -3
  61. package/dist/field/elements/textAlign/index.d.ts +0 -7
  62. package/dist/field/elements/toggle.d.ts +0 -4
  63. package/dist/field/elements/toggleList.d.ts +0 -4
  64. package/dist/field/elements/types.d.ts +0 -11
  65. package/dist/field/elements/ul/index.d.ts +0 -11
  66. package/dist/field/elements/unwrapList.d.ts +0 -4
  67. package/dist/field/elements/upload/Button/index.d.ts +0 -9
  68. package/dist/field/elements/upload/Element/UploadDrawer/index.d.ts +0 -8
  69. package/dist/field/elements/upload/Element/index.d.ts +0 -14
  70. package/dist/field/elements/upload/index.d.ts +0 -11
  71. package/dist/field/elements/upload/plugin.d.ts +0 -3
  72. package/dist/field/enablePlugins.d.ts +0 -3
  73. package/dist/field/hotkeys.d.ts +0 -8
  74. package/dist/field/icons/AlignCenter/index.d.ts +0 -4
  75. package/dist/field/icons/AlignLeft/index.d.ts +0 -4
  76. package/dist/field/icons/AlignRight/index.d.ts +0 -4
  77. package/dist/field/icons/Blockquote/index.d.ts +0 -4
  78. package/dist/field/icons/Bold/index.d.ts +0 -4
  79. package/dist/field/icons/Code/index.d.ts +0 -4
  80. package/dist/field/icons/IndentLeft/index.d.ts +0 -5
  81. package/dist/field/icons/IndentRight/index.d.ts +0 -5
  82. package/dist/field/icons/Italic/index.d.ts +0 -4
  83. package/dist/field/icons/Link/index.d.ts +0 -5
  84. package/dist/field/icons/OrderedList/index.d.ts +0 -4
  85. package/dist/field/icons/Relationship/index.d.ts +0 -5
  86. package/dist/field/icons/Strikethrough/index.d.ts +0 -4
  87. package/dist/field/icons/Underline/index.d.ts +0 -4
  88. package/dist/field/icons/UnorderedList/index.d.ts +0 -4
  89. package/dist/field/icons/Upload/index.d.ts +0 -5
  90. package/dist/field/icons/headings/H1/index.d.ts +0 -4
  91. package/dist/field/icons/headings/H2/index.d.ts +0 -4
  92. package/dist/field/icons/headings/H3/index.d.ts +0 -4
  93. package/dist/field/icons/headings/H4/index.d.ts +0 -4
  94. package/dist/field/icons/headings/H5/index.d.ts +0 -4
  95. package/dist/field/icons/headings/H6/index.d.ts +0 -4
  96. package/dist/field/icons/headings/index.d.ts +0 -11
  97. package/dist/field/index.d.ts +0 -5
  98. package/dist/field/leaves/Button.d.ts +0 -8
  99. package/dist/field/leaves/bold/index.d.ts +0 -10
  100. package/dist/field/leaves/code/index.d.ts +0 -10
  101. package/dist/field/leaves/index.d.ts +0 -40
  102. package/dist/field/leaves/isActive.d.ts +0 -3
  103. package/dist/field/leaves/italic/index.d.ts +0 -10
  104. package/dist/field/leaves/strikethrough/index.d.ts +0 -10
  105. package/dist/field/leaves/toggle.d.ts +0 -3
  106. package/dist/field/leaves/underline/index.d.ts +0 -10
  107. package/dist/field/mergeCustomFunctions.d.ts +0 -3
  108. package/dist/field/plugins/withEnterBreakOut.d.ts +0 -3
  109. package/dist/field/plugins/withHTML.d.ts +0 -3
  110. package/dist/index.d.ts +0 -4
  111. package/dist/types.d.ts +0 -55
@@ -1,8 +0,0 @@
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
@@ -1,14 +0,0 @@
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
@@ -1,11 +0,0 @@
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
@@ -1,3 +0,0 @@
1
- declare const withRelationship: (incomingEditor: any) => any;
2
- export default withRelationship;
3
- //# sourceMappingURL=plugin.d.ts.map
@@ -1,3 +0,0 @@
1
- declare const enablePlugins: (CreatedEditor: any, functions: any) => any;
2
- export default enablePlugins;
3
- //# sourceMappingURL=enablePlugins.d.ts.map
@@ -1,8 +0,0 @@
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
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const AlignCenterIcon: React.FC;
3
- export default AlignCenterIcon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const AlignLeftIcon: React.FC;
3
- export default AlignLeftIcon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const AlignRightIcon: React.FC;
3
- export default AlignRightIcon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const BlockquoteIcon: React.FC;
3
- export default BlockquoteIcon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const BoldIcon: React.FC;
3
- export default BoldIcon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const CodeIcon: React.FC;
3
- export default CodeIcon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,5 +0,0 @@
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
@@ -1,5 +0,0 @@
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
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const ItalicIcon: React.FC;
3
- export default ItalicIcon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,5 +0,0 @@
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
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const OrderedListIcon: React.FC;
3
- export default OrderedListIcon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,5 +0,0 @@
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
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const StrikethroughIcon: React.FC;
3
- export default StrikethroughIcon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const UnderlineIcon: React.FC;
3
- export default UnderlineIcon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const UnorderedListIcon: React.FC;
3
- export default UnorderedListIcon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,5 +0,0 @@
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
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const H1Icon: React.FC;
3
- export default H1Icon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const H2Icon: React.FC;
3
- export default H2Icon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const H3Icon: React.FC;
3
- export default H3Icon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const H4Icon: React.FC;
3
- export default H4Icon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const H5Icon: React.FC;
3
- export default H5Icon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- declare const H5Icon: React.FC;
3
- export default H5Icon;
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,11 +0,0 @@
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
@@ -1,5 +0,0 @@
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
@@ -1,8 +0,0 @@
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
@@ -1,10 +0,0 @@
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
@@ -1,10 +0,0 @@
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
@@ -1,40 +0,0 @@
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
@@ -1,3 +0,0 @@
1
- declare const isLeafActive: (editor: any, format: any) => boolean;
2
- export default isLeafActive;
3
- //# sourceMappingURL=isActive.d.ts.map
@@ -1,10 +0,0 @@
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
@@ -1,10 +0,0 @@
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
@@ -1,3 +0,0 @@
1
- declare const toggleLeaf: (editor: any, format: any) => void;
2
- export default toggleLeaf;
3
- //# sourceMappingURL=toggle.d.ts.map
@@ -1,10 +0,0 @@
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
@@ -1,3 +0,0 @@
1
- declare const _default: (enabledFunctions: any, builtInFunctions: any) => any;
2
- export default _default;
3
- //# sourceMappingURL=mergeCustomFunctions.d.ts.map
@@ -1,3 +0,0 @@
1
- declare const withEnterBreakOut: (editor: any) => any;
2
- export default withEnterBreakOut;
3
- //# sourceMappingURL=withEnterBreakOut.d.ts.map
@@ -1,3 +0,0 @@
1
- declare const withHTML: (incomingEditor: any) => any;
2
- export default withHTML;
3
- //# sourceMappingURL=withHTML.d.ts.map
package/dist/index.d.ts DELETED
@@ -1,4 +0,0 @@
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
package/dist/types.d.ts DELETED
@@ -1,55 +0,0 @@
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