payload 0.14.5-beta.0 → 0.14.6-beta.0
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/CHANGELOG.md +5 -14
- package/dist/admin/components/forms/field-types/RichText/RichText.d.ts +2 -2
- package/dist/admin/components/forms/field-types/RichText/RichText.js +4 -5
- package/dist/admin/components/forms/field-types/RichText/buttons.scss +4 -0
- package/dist/admin/components/forms/field-types/RichText/elements/Button.d.ts +1 -0
- package/dist/admin/components/forms/field-types/RichText/elements/Button.js +1 -1
- package/dist/admin/components/forms/field-types/RichText/elements/ListButton.d.ts +6 -0
- package/dist/admin/components/forms/field-types/RichText/elements/ListButton.js +19 -0
- package/dist/admin/components/forms/field-types/RichText/elements/indent/index.d.ts +9 -0
- package/dist/admin/components/forms/field-types/RichText/elements/indent/index.js +69 -0
- package/dist/admin/components/forms/field-types/RichText/elements/index.d.ts +7 -3
- package/dist/admin/components/forms/field-types/RichText/elements/index.js +4 -1
- package/dist/admin/components/forms/field-types/RichText/elements/isActive.js +6 -3
- package/dist/admin/components/forms/field-types/RichText/elements/isListActive.d.ts +3 -0
- package/dist/admin/components/forms/field-types/RichText/elements/isListActive.js +18 -0
- package/dist/admin/components/forms/field-types/RichText/elements/li/index.d.ts +1 -4
- package/dist/admin/components/forms/field-types/RichText/elements/li/index.js +7 -1
- package/dist/admin/components/forms/field-types/RichText/elements/link/index.d.ts +1 -1
- package/dist/admin/components/forms/field-types/RichText/elements/ol/index.js +2 -2
- package/dist/admin/components/forms/field-types/RichText/elements/toggle.js +2 -1
- package/dist/admin/components/forms/field-types/RichText/elements/ul/index.js +2 -2
- package/dist/admin/components/forms/field-types/RichText/types.d.ts +4 -0
- package/dist/admin/components/icons/IndentLeft/index.d.ts +4 -0
- package/dist/admin/components/icons/IndentLeft/index.js +8 -0
- package/dist/admin/components/icons/IndentLeft/index.scss +16 -0
- package/dist/admin/components/icons/IndentRight/index.d.ts +4 -0
- package/dist/admin/components/icons/IndentRight/index.js +8 -0
- package/dist/admin/components/icons/IndentRight/index.scss +16 -0
- package/dist/admin/components/icons/Swap/index.d.ts +4 -0
- package/dist/admin/components/icons/Swap/index.js +8 -0
- package/dist/admin/components/icons/Swap/index.scss +12 -0
- package/dist/fields/config/types.d.ts +1 -1
- package/dist/fields/richText/defaultValue.d.ts +1 -0
- package/dist/fields/richText/defaultValue.js +2 -1
- package/docs/fields/rich-text.mdx +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
## [0.14.
|
|
1
|
+
## [0.14.6-beta.0](https://github.com/payloadcms/payload/compare/v0.14.0...v0.14.6-beta.0) (2022-01-12)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
6
|
* ensures multipart/form-data using _payload flattens field data before sending ([ae44727](https://github.com/payloadcms/payload/commit/ae44727fb9734fc3801f7249fa9e78668311c09e))
|
|
7
|
+
* new slate version types ([c5de01b](https://github.com/payloadcms/payload/commit/c5de01bfc48ca6793c1526499fe934d9ad8f0cc9))
|
|
7
8
|
* type error in useField ([ef4e6d3](https://github.com/payloadcms/payload/commit/ef4e6d32a90215c07aa2c1e7217cf53558bfae97))
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
### Features
|
|
11
12
|
|
|
13
|
+
* adds indentation controls to rich text ([7df50f9](https://github.com/payloadcms/payload/commit/7df50f9bf9d4867e65bdd8cebdf43e0ab1737a63))
|
|
12
14
|
* builds a way for multipart/form-data reqs to retain non-string values ([65b0ad7](https://github.com/payloadcms/payload/commit/65b0ad7f084a9c279a1e4fb799542f97c645653d))
|
|
13
15
|
* exposes FieldWithPath type for reuse ([df3a836](https://github.com/payloadcms/payload/commit/df3a83634fcb64724ef239600e3af4fc295fee4f))
|
|
16
|
+
* rich text indent PoC ([2deed8b](https://github.com/payloadcms/payload/commit/2deed8b1464931c4bc76a288923b307cf04b6a4a))
|
|
14
17
|
|
|
15
|
-
## [0.14.
|
|
18
|
+
## [0.14.5-beta.0](https://github.com/payloadcms/payload/compare/v0.14.0...v0.14.5-beta.0) (2022-01-07)
|
|
16
19
|
|
|
17
20
|
|
|
18
21
|
### Bug Fixes
|
|
@@ -26,18 +29,6 @@
|
|
|
26
29
|
* builds a way for multipart/form-data reqs to retain non-string values ([65b0ad7](https://github.com/payloadcms/payload/commit/65b0ad7f084a9c279a1e4fb799542f97c645653d))
|
|
27
30
|
* exposes FieldWithPath type for reuse ([df3a836](https://github.com/payloadcms/payload/commit/df3a83634fcb64724ef239600e3af4fc295fee4f))
|
|
28
31
|
|
|
29
|
-
## [0.14.3-beta.0](https://github.com/payloadcms/payload/compare/v0.14.0...v0.14.3-beta.0) (2022-01-05)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
### Bug Fixes
|
|
33
|
-
* clearing saved number for a localized field ([443a070](https://github.com/payloadcms/payload/commit/5549926d2c51995baf40a06b5de74ebd3443a070)
|
|
34
|
-
* ensures multipart/form-data using _payload flattens field data before sending ([ae44727](https://github.com/payloadcms/payload/commit/ae44727fb9734fc3801f7249fa9e78668311c09e))
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
### Features
|
|
38
|
-
|
|
39
|
-
* builds a way for multipart/form-data reqs to retain non-string values ([65b0ad7](https://github.com/payloadcms/payload/commit/65b0ad7f084a9c279a1e4fb799542f97c645653d))
|
|
40
|
-
|
|
41
32
|
# [0.14.0](https://github.com/payloadcms/payload/compare/v0.13.6...v0.14.0) (2022-01-03)
|
|
42
33
|
|
|
43
34
|
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { BaseEditor } from 'slate';
|
|
3
3
|
import { ReactEditor } from 'slate-react';
|
|
4
4
|
import { HistoryEditor } from 'slate-history';
|
|
5
|
-
import { Props } from './types';
|
|
5
|
+
import { Props, BlurSelectionEditor } from './types';
|
|
6
6
|
import './index.scss';
|
|
7
7
|
declare type CustomText = {
|
|
8
8
|
text: string;
|
|
@@ -14,7 +14,7 @@ declare type CustomElement = {
|
|
|
14
14
|
};
|
|
15
15
|
declare module 'slate' {
|
|
16
16
|
interface CustomTypes {
|
|
17
|
-
Editor: BaseEditor & ReactEditor & HistoryEditor;
|
|
17
|
+
Editor: BaseEditor & ReactEditor & HistoryEditor & BlurSelectionEditor;
|
|
18
18
|
Element: CustomElement;
|
|
19
19
|
Text: CustomText;
|
|
20
20
|
}
|
|
@@ -21,7 +21,7 @@ import listTypes from './elements/listTypes';
|
|
|
21
21
|
import mergeCustomFunctions from './mergeCustomFunctions';
|
|
22
22
|
import withEnterBreakOut from './plugins/withEnterBreakOut';
|
|
23
23
|
import './index.scss';
|
|
24
|
-
const defaultElements = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'link', 'relationship', 'upload'];
|
|
24
|
+
const defaultElements = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ul', 'ol', 'indent', 'link', 'relationship', 'upload'];
|
|
25
25
|
const defaultLeaves = ['bold', 'italic', 'underline', 'strikethrough', 'code'];
|
|
26
26
|
const baseClass = 'rich-text';
|
|
27
27
|
const RichText = (props) => {
|
|
@@ -157,13 +157,12 @@ const RichText = (props) => {
|
|
|
157
157
|
const selectedLeaf = Node.descendant(editor, editor.selection.anchor.path);
|
|
158
158
|
if (Text.isText(selectedLeaf) && String(selectedLeaf.text).length === editor.selection.anchor.offset) {
|
|
159
159
|
Transforms.insertNodes(editor, {
|
|
160
|
-
|
|
161
|
-
children: [{ text: '' }],
|
|
160
|
+
text: '',
|
|
162
161
|
});
|
|
163
162
|
}
|
|
164
163
|
else {
|
|
165
164
|
Transforms.splitNodes(editor);
|
|
166
|
-
Transforms.setNodes(editor, {
|
|
165
|
+
Transforms.setNodes(editor, {});
|
|
167
166
|
}
|
|
168
167
|
}
|
|
169
168
|
}
|
|
@@ -178,7 +177,7 @@ const RichText = (props) => {
|
|
|
178
177
|
match: (n) => SlateElement.isElement(n) && listTypes.includes(n.type),
|
|
179
178
|
split: true,
|
|
180
179
|
});
|
|
181
|
-
Transforms.setNodes(editor, {
|
|
180
|
+
Transforms.setNodes(editor, {});
|
|
182
181
|
}
|
|
183
182
|
}
|
|
184
183
|
else if (editor.isVoid(selectedElement)) {
|
|
@@ -3,7 +3,7 @@ import { useSlate } from 'slate-react';
|
|
|
3
3
|
import isElementActive from './isActive';
|
|
4
4
|
import toggleElement from './toggle';
|
|
5
5
|
import '../buttons.scss';
|
|
6
|
-
const baseClass = 'rich-text__button';
|
|
6
|
+
export const baseClass = 'rich-text__button';
|
|
7
7
|
const ElementButton = ({ format, children, onClick, className }) => {
|
|
8
8
|
const editor = useSlate();
|
|
9
9
|
const defaultOnClick = useCallback((event) => {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { useSlate } from 'slate-react';
|
|
3
|
+
import isListActive from './isListActive';
|
|
4
|
+
import toggleElement from './toggle';
|
|
5
|
+
import '../buttons.scss';
|
|
6
|
+
export const baseClass = 'rich-text__button';
|
|
7
|
+
const ListButton = ({ format, children, onClick, className }) => {
|
|
8
|
+
const editor = useSlate();
|
|
9
|
+
const defaultOnClick = useCallback((event) => {
|
|
10
|
+
event.preventDefault();
|
|
11
|
+
toggleElement(editor, format);
|
|
12
|
+
}, [editor, format]);
|
|
13
|
+
return (React.createElement("button", { type: "button", className: [
|
|
14
|
+
baseClass,
|
|
15
|
+
className,
|
|
16
|
+
isListActive(editor, format) && `${baseClass}__button--active`,
|
|
17
|
+
].filter(Boolean).join(' '), onClick: onClick || defaultOnClick }, children));
|
|
18
|
+
};
|
|
19
|
+
export default ListButton;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
2
|
+
import { useSlate, ReactEditor } from 'slate-react';
|
|
3
|
+
import { Editor, Element, Transforms } from 'slate';
|
|
4
|
+
import IndentLeft from '../../../../../icons/IndentLeft';
|
|
5
|
+
import IndentRight from '../../../../../icons/IndentRight';
|
|
6
|
+
import { baseClass } from '../Button';
|
|
7
|
+
import isElementActive from '../isActive';
|
|
8
|
+
import listTypes from '../listTypes';
|
|
9
|
+
const indentType = 'indent';
|
|
10
|
+
const IndentWithPadding = ({ attributes, children }) => (React.createElement("div", { style: { paddingLeft: 25 }, ...attributes }, children));
|
|
11
|
+
const indent = {
|
|
12
|
+
Button: () => {
|
|
13
|
+
const editor = useSlate();
|
|
14
|
+
const handleIndent = useCallback((e, dir) => {
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
if (editor.blurSelection) {
|
|
17
|
+
Transforms.select(editor, editor.blurSelection);
|
|
18
|
+
}
|
|
19
|
+
if (dir === 'left') {
|
|
20
|
+
Transforms.unwrapNodes(editor, {
|
|
21
|
+
match: (n) => Element.isElement(n) && [indentType, ...listTypes].includes(n.type),
|
|
22
|
+
split: true,
|
|
23
|
+
mode: 'lowest',
|
|
24
|
+
});
|
|
25
|
+
if (isElementActive(editor, 'li')) {
|
|
26
|
+
const [, parentLocation] = Editor.parent(editor, editor.selection);
|
|
27
|
+
const [, parentDepth] = parentLocation;
|
|
28
|
+
if (parentDepth > 0 || parentDepth === 0) {
|
|
29
|
+
Transforms.unwrapNodes(editor, {
|
|
30
|
+
match: (n) => Element.isElement(n) && n.type === 'li',
|
|
31
|
+
split: true,
|
|
32
|
+
mode: 'lowest',
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
Transforms.unsetNodes(editor, ['type']);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
if (dir === 'right') {
|
|
41
|
+
const isCurrentlyOL = isElementActive(editor, 'ol');
|
|
42
|
+
const isCurrentlyUL = isElementActive(editor, 'ul');
|
|
43
|
+
if (isCurrentlyOL || isCurrentlyUL) {
|
|
44
|
+
Transforms.wrapNodes(editor, {
|
|
45
|
+
type: 'li',
|
|
46
|
+
children: [],
|
|
47
|
+
});
|
|
48
|
+
Transforms.wrapNodes(editor, { type: isCurrentlyOL ? 'ol' : 'ul', children: [{ text: ' ' }] });
|
|
49
|
+
Transforms.setNodes(editor, { type: 'li' });
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
Transforms.wrapNodes(editor, { type: indentType, children: [] });
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
ReactEditor.focus(editor);
|
|
56
|
+
}, [editor]);
|
|
57
|
+
const canDeIndent = isElementActive(editor, 'li') || isElementActive(editor, indentType);
|
|
58
|
+
return (React.createElement(React.Fragment, null,
|
|
59
|
+
React.createElement("button", { type: "button", className: [
|
|
60
|
+
baseClass,
|
|
61
|
+
!canDeIndent && `${baseClass}--disabled`,
|
|
62
|
+
].filter(Boolean).join(' '), onClick: canDeIndent ? (e) => handleIndent(e, 'left') : undefined },
|
|
63
|
+
React.createElement(IndentLeft, null)),
|
|
64
|
+
React.createElement("button", { type: "button", className: baseClass, onClick: (e) => handleIndent(e, 'right') },
|
|
65
|
+
React.createElement(IndentRight, null))));
|
|
66
|
+
},
|
|
67
|
+
Element: IndentWithPadding,
|
|
68
|
+
};
|
|
69
|
+
export default indent;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const
|
|
2
|
+
declare const elements: {
|
|
3
3
|
h1: {
|
|
4
4
|
Button: () => JSX.Element;
|
|
5
5
|
Element: ({ attributes, children }: {
|
|
@@ -49,7 +49,7 @@ declare const _default: {
|
|
|
49
49
|
children: any;
|
|
50
50
|
element: any;
|
|
51
51
|
}) => JSX.Element;
|
|
52
|
-
plugins: ((incomingEditor: import("slate").BaseEditor & import("slate-react").ReactEditor & import("slate-history").HistoryEditor) => import("slate").BaseEditor & import("slate-react").ReactEditor & import("slate-history").HistoryEditor)[];
|
|
52
|
+
plugins: ((incomingEditor: import("slate").BaseEditor & import("slate-react").ReactEditor & import("slate-history").HistoryEditor & import("../types").BlurSelectionEditor) => import("slate").BaseEditor & import("slate-react").ReactEditor & import("slate-history").HistoryEditor & import("../types").BlurSelectionEditor)[];
|
|
53
53
|
};
|
|
54
54
|
ol: {
|
|
55
55
|
Button: () => JSX.Element;
|
|
@@ -66,6 +66,10 @@ declare const _default: {
|
|
|
66
66
|
}) => JSX.Element;
|
|
67
67
|
};
|
|
68
68
|
li: {
|
|
69
|
+
Element: (props: any) => JSX.Element;
|
|
70
|
+
};
|
|
71
|
+
indent: {
|
|
72
|
+
Button: () => JSX.Element;
|
|
69
73
|
Element: ({ attributes, children }: {
|
|
70
74
|
attributes: any;
|
|
71
75
|
children: any;
|
|
@@ -91,4 +95,4 @@ declare const _default: {
|
|
|
91
95
|
plugins: ((incomingEditor: any) => any)[];
|
|
92
96
|
};
|
|
93
97
|
};
|
|
94
|
-
export default
|
|
98
|
+
export default elements;
|
|
@@ -8,9 +8,10 @@ import link from './link';
|
|
|
8
8
|
import ol from './ol';
|
|
9
9
|
import ul from './ul';
|
|
10
10
|
import li from './li';
|
|
11
|
+
import indent from './indent';
|
|
11
12
|
import relationship from './relationship';
|
|
12
13
|
import upload from './upload';
|
|
13
|
-
|
|
14
|
+
const elements = {
|
|
14
15
|
h1,
|
|
15
16
|
h2,
|
|
16
17
|
h3,
|
|
@@ -21,6 +22,8 @@ export default {
|
|
|
21
22
|
ol,
|
|
22
23
|
ul,
|
|
23
24
|
li,
|
|
25
|
+
indent,
|
|
24
26
|
relationship,
|
|
25
27
|
upload,
|
|
26
28
|
};
|
|
29
|
+
export default elements;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { Editor, Element } from 'slate';
|
|
2
2
|
const isElementActive = (editor, format) => {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
if (!editor.selection)
|
|
4
|
+
return false;
|
|
5
|
+
const [match] = Array.from(Editor.nodes(editor, {
|
|
6
|
+
at: Editor.unhangRange(editor, editor.selection),
|
|
7
|
+
match: (n) => !Editor.isEditor(n) && Element.isElement(n) && n.type === format,
|
|
8
|
+
}));
|
|
6
9
|
return !!match;
|
|
7
10
|
};
|
|
8
11
|
export default isElementActive;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Editor, Element } from 'slate';
|
|
2
|
+
const isListActive = (editor, format) => {
|
|
3
|
+
if (!editor.selection
|
|
4
|
+
// If focus or anchor is at root of editor,
|
|
5
|
+
// Return false - as Editor.parent will fail
|
|
6
|
+
|| editor.selection.focus.path[1] === 0
|
|
7
|
+
|| editor.selection.anchor.path[1] === 0)
|
|
8
|
+
return false;
|
|
9
|
+
const parentLI = Editor.parent(editor, editor.selection);
|
|
10
|
+
if (parentLI[1].length > 0) {
|
|
11
|
+
const ancestor = Editor.above(editor, {
|
|
12
|
+
at: parentLI[1],
|
|
13
|
+
});
|
|
14
|
+
return Element.isElement(ancestor[0]) && ancestor[0].type === format;
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
};
|
|
18
|
+
export default isListActive;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import listTypes from '../listTypes';
|
|
3
|
+
const LI = (props) => {
|
|
4
|
+
var _a, _b;
|
|
5
|
+
const { attributes, element, children } = props;
|
|
6
|
+
const disableListStyle = element.children.length === 1 && listTypes.includes((_b = (_a = element.children) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.type);
|
|
7
|
+
return (React.createElement("li", { style: { listStyle: disableListStyle ? 'none' : undefined }, ...attributes }, children));
|
|
8
|
+
};
|
|
3
9
|
export default {
|
|
4
10
|
Element: LI,
|
|
5
11
|
};
|
|
@@ -8,6 +8,6 @@ declare const link: {
|
|
|
8
8
|
children: any;
|
|
9
9
|
element: any;
|
|
10
10
|
}) => JSX.Element;
|
|
11
|
-
plugins: ((incomingEditor: import("slate").BaseEditor & ReactEditor & import("slate-history").HistoryEditor) => import("slate").BaseEditor & ReactEditor & import("slate-history").HistoryEditor)[];
|
|
11
|
+
plugins: ((incomingEditor: import("slate").BaseEditor & ReactEditor & import("slate-history").HistoryEditor & import("../../types").BlurSelectionEditor) => import("slate").BaseEditor & ReactEditor & import("slate-history").HistoryEditor & import("../../types").BlurSelectionEditor)[];
|
|
12
12
|
};
|
|
13
13
|
export default link;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import ListButton from '../ListButton';
|
|
3
3
|
import OLIcon from '../../../../../icons/OrderedList';
|
|
4
4
|
const OL = ({ attributes, children }) => (React.createElement("ol", { ...attributes }, children));
|
|
5
5
|
const ol = {
|
|
6
|
-
Button: () => (React.createElement(
|
|
6
|
+
Button: () => (React.createElement(ListButton, { format: "ol" },
|
|
7
7
|
React.createElement(OLIcon, null))),
|
|
8
8
|
Element: OL,
|
|
9
9
|
};
|
|
@@ -7,7 +7,7 @@ const toggleElement = (editor, format) => {
|
|
|
7
7
|
const isList = listTypes.includes(format);
|
|
8
8
|
let type = format;
|
|
9
9
|
if (isActive) {
|
|
10
|
-
type =
|
|
10
|
+
type = undefined;
|
|
11
11
|
}
|
|
12
12
|
else if (isList) {
|
|
13
13
|
type = 'li';
|
|
@@ -18,6 +18,7 @@ const toggleElement = (editor, format) => {
|
|
|
18
18
|
Transforms.unwrapNodes(editor, {
|
|
19
19
|
match: (n) => Element.isElement(n) && listTypes.includes(n.type),
|
|
20
20
|
split: true,
|
|
21
|
+
mode: 'lowest',
|
|
21
22
|
});
|
|
22
23
|
Transforms.setNodes(editor, { type });
|
|
23
24
|
if (!isActive && isList) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import ElementButton from '../Button';
|
|
3
2
|
import ULIcon from '../../../../../icons/UnorderedList';
|
|
3
|
+
import ListButton from '../ListButton';
|
|
4
4
|
const UL = ({ attributes, children }) => (React.createElement("ul", { ...attributes }, children));
|
|
5
5
|
const ul = {
|
|
6
|
-
Button: () => (React.createElement(
|
|
6
|
+
Button: () => (React.createElement(ListButton, { format: "ul" },
|
|
7
7
|
React.createElement(ULIcon, null))),
|
|
8
8
|
Element: UL,
|
|
9
9
|
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { BaseEditor, Selection } from 'slate';
|
|
1
2
|
import { RichTextField } from '../../../../../fields/config/types';
|
|
2
3
|
export declare type Props = Omit<RichTextField, 'type'> & {
|
|
3
4
|
path?: string;
|
|
4
5
|
};
|
|
6
|
+
export interface BlurSelectionEditor extends BaseEditor {
|
|
7
|
+
blurSelection?: Selection;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
const IndentLeft = () => (React.createElement("svg", { className: "icon icon--indent-left", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 25" },
|
|
4
|
+
React.createElement("path", { d: "M16.005 9.61502L21.005 13.1864L21.005 6.04361L16.005 9.61502Z", className: "fill" }),
|
|
5
|
+
React.createElement("rect", { x: "5", y: "5.68199", width: "9.0675", height: "2.15625", className: "fill" }),
|
|
6
|
+
React.createElement("rect", { x: "5", y: "11.4738", width: "9.0675", height: "2.15625", className: "fill" }),
|
|
7
|
+
React.createElement("rect", { x: "5", y: "17.2656", width: "16.005", height: "2.15625", className: "fill" })));
|
|
8
|
+
export default IndentLeft;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@import '../../../scss/styles';
|
|
2
|
+
|
|
3
|
+
.icon--indent-left {
|
|
4
|
+
height: $baseline;
|
|
5
|
+
width: $baseline;
|
|
6
|
+
|
|
7
|
+
.stroke {
|
|
8
|
+
fill: none;
|
|
9
|
+
stroke: $color-dark-gray;
|
|
10
|
+
stroke-width: $style-stroke-width-m;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.fill {
|
|
14
|
+
fill: $color-dark-gray;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
const IndentRight = () => (React.createElement("svg", { className: "icon icon--indent-right", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 25" },
|
|
4
|
+
React.createElement("path", { d: "M10 9.61502L5 6.04361L5 13.1864L10 9.61502Z", fill: "#333333" }),
|
|
5
|
+
React.createElement("rect", { x: "11.9375", y: "5.68199", width: "9.0675", height: "2.15625", className: "fill" }),
|
|
6
|
+
React.createElement("rect", { x: "11.9375", y: "11.4738", width: "9.0675", height: "2.15625", className: "fill" }),
|
|
7
|
+
React.createElement("rect", { x: "5", y: "17.2656", width: "16.005", height: "2.15625", className: "fill" })));
|
|
8
|
+
export default IndentRight;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@import '../../../scss/styles';
|
|
2
|
+
|
|
3
|
+
.icon--indent-right {
|
|
4
|
+
height: $baseline;
|
|
5
|
+
width: $baseline;
|
|
6
|
+
|
|
7
|
+
.stroke {
|
|
8
|
+
fill: none;
|
|
9
|
+
stroke: $color-dark-gray;
|
|
10
|
+
stroke-width: $style-stroke-width-m;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.fill {
|
|
14
|
+
fill: $color-dark-gray;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
const Swap = () => (React.createElement("svg", { className: "icon icon--swap", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 25 25" },
|
|
4
|
+
React.createElement("path", { d: "M9.84631 4.78679L6.00004 8.63306L9.84631 12.4793", className: "stroke" }),
|
|
5
|
+
React.createElement("path", { d: "M15.1537 20.1059L19 16.2596L15.1537 12.4133", className: "stroke" }),
|
|
6
|
+
React.createElement("line", { x1: "7", y1: "8.7013", x2: "15", y2: "8.7013", stroke: "#333333", className: "stroke" }),
|
|
7
|
+
React.createElement("line", { x1: "18", y1: "16.1195", x2: "10", y2: "16.1195", className: "stroke" })));
|
|
8
|
+
export default Swap;
|
|
@@ -183,7 +183,7 @@ export declare type RichTextCustomLeaf = {
|
|
|
183
183
|
Leaf: React.ComponentType;
|
|
184
184
|
plugins?: RichTextPlugin[];
|
|
185
185
|
};
|
|
186
|
-
export declare type RichTextElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'blockquote' | 'ul' | 'ol' | 'link' | 'relationship' | 'upload' | RichTextCustomElement;
|
|
186
|
+
export declare type RichTextElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'blockquote' | 'ul' | 'ol' | 'link' | 'relationship' | 'upload' | 'indent' | RichTextCustomElement;
|
|
187
187
|
export declare type RichTextLeaf = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'code' | RichTextCustomLeaf;
|
|
188
188
|
export declare type RichTextField = FieldBase & {
|
|
189
189
|
type: 'richText';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = [{
|
|
4
|
+
type: 'p',
|
|
4
5
|
children: [{ text: '' }],
|
|
5
6
|
}];
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVmYXVsdFZhbHVlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2ZpZWxkcy9yaWNoVGV4dC9kZWZhdWx0VmFsdWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxrQkFBZSxDQUFDO1FBQ2QsSUFBSSxFQUFFLEdBQUc7UUFDVCxRQUFRLEVBQUUsQ0FBQyxFQUFFLElBQUksRUFBRSxFQUFFLEVBQUUsQ0FBQztLQUN6QixDQUFDLENBQUMifQ==
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payload",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.6-beta.0",
|
|
4
4
|
"description": "Node, React and MongoDB Headless CMS and Application Framework",
|
|
5
5
|
"license": "SEE LICENSE IN license.md",
|
|
6
6
|
"author": {
|
|
@@ -166,10 +166,10 @@
|
|
|
166
166
|
"sass": "^1.42.0",
|
|
167
167
|
"sass-loader": "^10.1.0",
|
|
168
168
|
"sharp": "^0.29.3",
|
|
169
|
-
"slate": "
|
|
169
|
+
"slate": "0.72.3",
|
|
170
170
|
"slate-history": "^0.66.0",
|
|
171
171
|
"slate-hyperscript": "^0.66.0",
|
|
172
|
-
"slate-react": "^0.
|
|
172
|
+
"slate-react": "^0.72.1",
|
|
173
173
|
"style-loader": "^2.0.0",
|
|
174
174
|
"terser-webpack-plugin": "^5.0.3",
|
|
175
175
|
"ts-essentials": "^7.0.1",
|