sdoc-editor-cli 0.9.2 → 0.10.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.
- package/README.md +467 -467
- package/bin/sdoc.js +0 -0
- package/dist/examples/operations/delete-block.json +17 -17
- package/dist/examples/operations/delete-section.json +12 -12
- package/dist/examples/operations/insert-block.json +19 -19
- package/dist/examples/operations/insert-section.json +21 -21
- package/dist/examples/operations/move-block.json +21 -21
- package/dist/examples/operations/move-section.json +16 -16
- package/dist/examples/operations/rename-block-id.json +13 -13
- package/dist/examples/operations/rename-heading.json +13 -13
- package/dist/examples/operations/replace-block.json +21 -21
- package/dist/examples/operations/set-document-title.json +17 -17
- package/dist/examples/operations/set-heading-level.json +13 -13
- package/dist/examples/operations/update-block-attrs.json +13 -13
- package/dist/examples/operations/update-document-metadata.json +15 -15
- package/dist/examples/operations/update-document-settings.json +16 -16
- package/dist/schemas/sdoc.operations.schema.json +385 -385
- package/dist/schemas/sdoc.schema.json +559 -559
- package/dist/sdoc.js +299 -185
- package/package.json +30 -30
package/bin/sdoc.js
CHANGED
|
File without changes
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contract": "sdoc.operations/1",
|
|
3
|
-
"expected": {
|
|
4
|
-
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
-
},
|
|
6
|
-
"operations": [
|
|
7
|
-
{
|
|
8
|
-
"op": "deleteBlock",
|
|
9
|
-
"target": {
|
|
10
|
-
"kind": "snapshot",
|
|
11
|
-
"path": [1],
|
|
12
|
-
"nodeType": "paragraph",
|
|
13
|
-
"digest": "sha256:1111111111111111111111111111111111111111111111111111111111111111"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "deleteBlock",
|
|
9
|
+
"target": {
|
|
10
|
+
"kind": "snapshot",
|
|
11
|
+
"path": [1],
|
|
12
|
+
"nodeType": "paragraph",
|
|
13
|
+
"digest": "sha256:1111111111111111111111111111111111111111111111111111111111111111"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contract": "sdoc.operations/1",
|
|
3
|
-
"expected": {
|
|
4
|
-
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
-
},
|
|
6
|
-
"operations": [
|
|
7
|
-
{
|
|
8
|
-
"op": "deleteSection",
|
|
9
|
-
"target": { "kind": "id", "id": "section-heading-id-from-inspect" }
|
|
10
|
-
}
|
|
11
|
-
]
|
|
12
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "deleteSection",
|
|
9
|
+
"target": { "kind": "id", "id": "section-heading-id-from-inspect" }
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contract": "sdoc.operations/1",
|
|
3
|
-
"expected": {
|
|
4
|
-
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
-
},
|
|
6
|
-
"operations": [
|
|
7
|
-
{
|
|
8
|
-
"op": "insertBlock",
|
|
9
|
-
"destination": {
|
|
10
|
-
"position": "section-end",
|
|
11
|
-
"target": { "kind": "id", "id": "heading-id-from-inspect" }
|
|
12
|
-
},
|
|
13
|
-
"block": {
|
|
14
|
-
"type": "paragraph",
|
|
15
|
-
"content": [{ "type": "text", "text": "Inserted paragraph" }]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "insertBlock",
|
|
9
|
+
"destination": {
|
|
10
|
+
"position": "section-end",
|
|
11
|
+
"target": { "kind": "id", "id": "heading-id-from-inspect" }
|
|
12
|
+
},
|
|
13
|
+
"block": {
|
|
14
|
+
"type": "paragraph",
|
|
15
|
+
"content": [{ "type": "text", "text": "Inserted paragraph" }]
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contract": "sdoc.operations/1",
|
|
3
|
-
"expected": {
|
|
4
|
-
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
-
},
|
|
6
|
-
"operations": [
|
|
7
|
-
{
|
|
8
|
-
"op": "insertSection",
|
|
9
|
-
"target": { "kind": "id", "id": "sibling-heading-id-from-inspect" },
|
|
10
|
-
"position": "after",
|
|
11
|
-
"title": "New sibling section",
|
|
12
|
-
"id": "new-section-id",
|
|
13
|
-
"blocks": [
|
|
14
|
-
{
|
|
15
|
-
"type": "paragraph",
|
|
16
|
-
"content": [{ "type": "text", "text": "Section body" }]
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
]
|
|
21
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "insertSection",
|
|
9
|
+
"target": { "kind": "id", "id": "sibling-heading-id-from-inspect" },
|
|
10
|
+
"position": "after",
|
|
11
|
+
"title": "New sibling section",
|
|
12
|
+
"id": "new-section-id",
|
|
13
|
+
"blocks": [
|
|
14
|
+
{
|
|
15
|
+
"type": "paragraph",
|
|
16
|
+
"content": [{ "type": "text", "text": "Section body" }]
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contract": "sdoc.operations/1",
|
|
3
|
-
"expected": {
|
|
4
|
-
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
-
},
|
|
6
|
-
"operations": [
|
|
7
|
-
{
|
|
8
|
-
"op": "moveBlock",
|
|
9
|
-
"target": {
|
|
10
|
-
"kind": "snapshot",
|
|
11
|
-
"path": [1],
|
|
12
|
-
"nodeType": "paragraph",
|
|
13
|
-
"digest": "sha256:1111111111111111111111111111111111111111111111111111111111111111"
|
|
14
|
-
},
|
|
15
|
-
"destination": {
|
|
16
|
-
"position": "after",
|
|
17
|
-
"target": { "kind": "id", "id": "image-id-from-inspect" }
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
]
|
|
21
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "moveBlock",
|
|
9
|
+
"target": {
|
|
10
|
+
"kind": "snapshot",
|
|
11
|
+
"path": [1],
|
|
12
|
+
"nodeType": "paragraph",
|
|
13
|
+
"digest": "sha256:1111111111111111111111111111111111111111111111111111111111111111"
|
|
14
|
+
},
|
|
15
|
+
"destination": {
|
|
16
|
+
"position": "after",
|
|
17
|
+
"target": { "kind": "id", "id": "image-id-from-inspect" }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contract": "sdoc.operations/1",
|
|
3
|
-
"expected": {
|
|
4
|
-
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
-
},
|
|
6
|
-
"operations": [
|
|
7
|
-
{
|
|
8
|
-
"op": "moveSection",
|
|
9
|
-
"target": { "kind": "id", "id": "section-heading-id-from-inspect" },
|
|
10
|
-
"destination": {
|
|
11
|
-
"position": "before",
|
|
12
|
-
"target": { "kind": "id", "id": "destination-heading-id-from-inspect" }
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
]
|
|
16
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "moveSection",
|
|
9
|
+
"target": { "kind": "id", "id": "section-heading-id-from-inspect" },
|
|
10
|
+
"destination": {
|
|
11
|
+
"position": "before",
|
|
12
|
+
"target": { "kind": "id", "id": "destination-heading-id-from-inspect" }
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contract": "sdoc.operations/1",
|
|
3
|
-
"expected": {
|
|
4
|
-
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
-
},
|
|
6
|
-
"operations": [
|
|
7
|
-
{
|
|
8
|
-
"op": "renameBlockId",
|
|
9
|
-
"target": { "kind": "id", "id": "old-id-from-inspect", "expectedType": "heading" },
|
|
10
|
-
"newId": "meaningful-section-id"
|
|
11
|
-
}
|
|
12
|
-
]
|
|
13
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "renameBlockId",
|
|
9
|
+
"target": { "kind": "id", "id": "old-id-from-inspect", "expectedType": "heading" },
|
|
10
|
+
"newId": "meaningful-section-id"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contract": "sdoc.operations/1",
|
|
3
|
-
"expected": {
|
|
4
|
-
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
-
},
|
|
6
|
-
"operations": [
|
|
7
|
-
{
|
|
8
|
-
"op": "renameHeading",
|
|
9
|
-
"target": { "kind": "id", "id": "heading-id-from-inspect" },
|
|
10
|
-
"title": "Updated heading"
|
|
11
|
-
}
|
|
12
|
-
]
|
|
13
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "renameHeading",
|
|
9
|
+
"target": { "kind": "id", "id": "heading-id-from-inspect" },
|
|
10
|
+
"title": "Updated heading"
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contract": "sdoc.operations/1",
|
|
3
|
-
"expected": {
|
|
4
|
-
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
-
},
|
|
6
|
-
"operations": [
|
|
7
|
-
{
|
|
8
|
-
"op": "replaceBlock",
|
|
9
|
-
"target": {
|
|
10
|
-
"kind": "snapshot",
|
|
11
|
-
"path": [1],
|
|
12
|
-
"nodeType": "paragraph",
|
|
13
|
-
"digest": "sha256:1111111111111111111111111111111111111111111111111111111111111111"
|
|
14
|
-
},
|
|
15
|
-
"block": {
|
|
16
|
-
"type": "paragraph",
|
|
17
|
-
"content": [{ "type": "text", "text": "Replacement paragraph" }]
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
]
|
|
21
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "replaceBlock",
|
|
9
|
+
"target": {
|
|
10
|
+
"kind": "snapshot",
|
|
11
|
+
"path": [1],
|
|
12
|
+
"nodeType": "paragraph",
|
|
13
|
+
"digest": "sha256:1111111111111111111111111111111111111111111111111111111111111111"
|
|
14
|
+
},
|
|
15
|
+
"block": {
|
|
16
|
+
"type": "paragraph",
|
|
17
|
+
"content": [{ "type": "text", "text": "Replacement paragraph" }]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contract": "sdoc.operations/1",
|
|
3
|
-
"expected": {
|
|
4
|
-
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
-
},
|
|
6
|
-
"operations": [
|
|
7
|
-
{
|
|
8
|
-
"op": "setDocumentTitle",
|
|
9
|
-
"title": "Updated document title",
|
|
10
|
-
"headingTarget": {
|
|
11
|
-
"kind": "id",
|
|
12
|
-
"id": "document-title-from-inspect",
|
|
13
|
-
"expectedType": "heading"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "setDocumentTitle",
|
|
9
|
+
"title": "Updated document title",
|
|
10
|
+
"headingTarget": {
|
|
11
|
+
"kind": "id",
|
|
12
|
+
"id": "document-title-from-inspect",
|
|
13
|
+
"expectedType": "heading"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contract": "sdoc.operations/1",
|
|
3
|
-
"expected": {
|
|
4
|
-
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
-
},
|
|
6
|
-
"operations": [
|
|
7
|
-
{
|
|
8
|
-
"op": "setHeadingLevel",
|
|
9
|
-
"target": { "kind": "id", "id": "heading-id-from-inspect", "expectedType": "heading" },
|
|
10
|
-
"level": 1
|
|
11
|
-
}
|
|
12
|
-
]
|
|
13
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "setHeadingLevel",
|
|
9
|
+
"target": { "kind": "id", "id": "heading-id-from-inspect", "expectedType": "heading" },
|
|
10
|
+
"level": 1
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contract": "sdoc.operations/1",
|
|
3
|
-
"expected": {
|
|
4
|
-
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
-
},
|
|
6
|
-
"operations": [
|
|
7
|
-
{
|
|
8
|
-
"op": "updateBlockAttrs",
|
|
9
|
-
"target": { "kind": "id", "id": "image-id-from-inspect", "expectedType": "image" },
|
|
10
|
-
"attrs": { "alt": "Updated alternative text", "width": 640 }
|
|
11
|
-
}
|
|
12
|
-
]
|
|
13
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "updateBlockAttrs",
|
|
9
|
+
"target": { "kind": "id", "id": "image-id-from-inspect", "expectedType": "image" },
|
|
10
|
+
"attrs": { "alt": "Updated alternative text", "width": 640 }
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contract": "sdoc.operations/1",
|
|
3
|
-
"expected": {
|
|
4
|
-
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
-
},
|
|
6
|
-
"operations": [
|
|
7
|
-
{
|
|
8
|
-
"op": "updateDocumentMetadata",
|
|
9
|
-
"patch": {
|
|
10
|
-
"author": "SDOC Agent",
|
|
11
|
-
"version": "1.0"
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "updateDocumentMetadata",
|
|
9
|
+
"patch": {
|
|
10
|
+
"author": "SDOC Agent",
|
|
11
|
+
"version": "1.0"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
{
|
|
2
|
-
"contract": "sdoc.operations/1",
|
|
3
|
-
"expected": {
|
|
4
|
-
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
-
},
|
|
6
|
-
"operations": [
|
|
7
|
-
{
|
|
8
|
-
"op": "updateDocumentSettings",
|
|
9
|
-
"patch": {
|
|
10
|
-
"headingNumbering": true,
|
|
11
|
-
"captionStyle": "modern",
|
|
12
|
-
"showTitleSlide": null
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
]
|
|
16
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"contract": "sdoc.operations/1",
|
|
3
|
+
"expected": {
|
|
4
|
+
"revision": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
|
|
5
|
+
},
|
|
6
|
+
"operations": [
|
|
7
|
+
{
|
|
8
|
+
"op": "updateDocumentSettings",
|
|
9
|
+
"patch": {
|
|
10
|
+
"headingNumbering": true,
|
|
11
|
+
"captionStyle": "modern",
|
|
12
|
+
"showTitleSlide": null
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|