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