@platecms/delta-cast-util-from-slate 1.17.0 → 1.19.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/package.json +5 -5
- package/src/lib/index.spec.ts +22 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platecms/delta-cast-util-from-slate",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "Utility to convert slate nodes to a CAST tree.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"publishConfig": {
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"src/**/*"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@platecms/delta-cast": "1.
|
|
21
|
-
"@platecms/delta-castscript": "1.
|
|
22
|
-
"@platecms/delta-client": "1.
|
|
23
|
-
"@platecms/delta-plate-resource-notation": "1.
|
|
20
|
+
"@platecms/delta-cast": "1.19.0",
|
|
21
|
+
"@platecms/delta-castscript": "1.19.0",
|
|
22
|
+
"@platecms/delta-client": "1.19.0",
|
|
23
|
+
"@platecms/delta-plate-resource-notation": "1.19.0",
|
|
24
24
|
"@graphql-typed-document-node/core": "3.2.0",
|
|
25
25
|
"class-transformer": "0.5.1",
|
|
26
26
|
"graphql": "16.11.0",
|
package/src/lib/index.spec.ts
CHANGED
|
@@ -27,6 +27,28 @@ describe("single nodes", () => {
|
|
|
27
27
|
expect(result).toEqual(expected);
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
+
it("should convert a soft return within a paragraph from slate to cast", () => {
|
|
31
|
+
// Arrange
|
|
32
|
+
const slate: Descendant[] = [
|
|
33
|
+
{
|
|
34
|
+
type: "paragraph",
|
|
35
|
+
children: [
|
|
36
|
+
{
|
|
37
|
+
text: "Line one\nLine two",
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
const expected: Root = c("root", [c("paragraph", "Line one\nLine two")]);
|
|
44
|
+
|
|
45
|
+
// Act
|
|
46
|
+
const result = fromSlate(slate);
|
|
47
|
+
|
|
48
|
+
// Assert
|
|
49
|
+
expect(result).toEqual(expected);
|
|
50
|
+
});
|
|
51
|
+
|
|
30
52
|
it("should convert a heading from slate to cast", () => {
|
|
31
53
|
// Arrange
|
|
32
54
|
const slate: Descendant[] = [
|