@supernova-studio/client 0.4.2 → 0.4.4
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/dist/index.d.mts +3932 -19
- package/dist/index.d.ts +3932 -19
- package/dist/index.js +119 -530
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +874 -1285
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -2
- package/src/api/index.ts +1 -0
- package/src/api/requests/index.ts +2 -0
- package/src/api/requests/post-bulk-doc-page-elements.ts +51 -0
- package/src/api/requests/post-liveblocks-auth.ts +6 -0
- package/src/docs-editor/blocks-to-prosemirror.ts +1 -1
- package/src/docs-editor/prosemirror/schema.ts +3 -0
- package/src/index.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supernova-studio/client",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "Supernova Data Models",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,11 +26,15 @@
|
|
|
26
26
|
"build": "tsup",
|
|
27
27
|
"typecheck": "tsc --noEmit",
|
|
28
28
|
"publish": "npm run build && npm publish",
|
|
29
|
-
"test:unit": "vitest run"
|
|
29
|
+
"test:unit": "vitest run",
|
|
30
|
+
"index": "node ./create-indexes.js"
|
|
30
31
|
},
|
|
31
32
|
"author": "",
|
|
32
33
|
"license": "ISC",
|
|
33
34
|
"dependencies": {
|
|
35
|
+
"@supernova-studio/model": "*",
|
|
36
|
+
"prosemirror-model": "^1.19.4",
|
|
37
|
+
"typescript": "^5.0.4",
|
|
34
38
|
"y-prosemirror": "^1.2.2",
|
|
35
39
|
"yjs": "^13.6.10",
|
|
36
40
|
"zod": "^3.22.4"
|
package/src/api/index.ts
CHANGED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import { DocumentationItemConfiguration } from "@supernova-studio/model"
|
|
4
|
+
|
|
5
|
+
export const CreateBulkElementsInput = z.object({
|
|
6
|
+
persistentId: z.string().uuid(),
|
|
7
|
+
title: z.string(),
|
|
8
|
+
configuration: DocumentationItemConfiguration,
|
|
9
|
+
parentPersistentId: z.string().nullish(),
|
|
10
|
+
afterPersistentId: z.string().nullish(),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export type CreateBulkElementsInput = z.infer<typeof CreateBulkElementsInput>;
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export const UpdateBulkElementsInput = z.object({
|
|
17
|
+
id: z.string(),
|
|
18
|
+
title: z.string().optional(),
|
|
19
|
+
configuration: DocumentationItemConfiguration.optional(),
|
|
20
|
+
parentPersistentId: z.string().optional(),
|
|
21
|
+
afterPersistentId: z.string().optional(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type UpdateBulkElementsInput = z.infer<typeof UpdateBulkElementsInput>;
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
export const DeleteBulkElementsInput = z.array(z.string());
|
|
28
|
+
|
|
29
|
+
export type DeleteBulkElementsInput = z.infer<typeof DeleteBulkElementsInput>;
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export const DuplicateBulkElementsInput = z.object({
|
|
33
|
+
id: z.string(),
|
|
34
|
+
persistentId: z.string().uuid(),
|
|
35
|
+
parentPersistentId: z.string().uuid(),
|
|
36
|
+
afterPersistentId: z.string().uuid().nullish(),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export type DuplicateBulkElementsInput = z.infer<typeof DuplicateBulkElementsInput>;
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
export const BulkEditDocPageElementsInput = z.object({
|
|
43
|
+
documentationPages: z.object({
|
|
44
|
+
create: z.array(CreateBulkElementsInput).optional(),
|
|
45
|
+
update: z.array(UpdateBulkElementsInput).optional(),
|
|
46
|
+
delete: DeleteBulkElementsInput.optional(),
|
|
47
|
+
duplicate: z.array(DuplicateBulkElementsInput).optional()
|
|
48
|
+
})
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export type BulkEditDocPageElementsInput = z.infer<typeof BulkEditDocPageElementsInput>;
|
|
@@ -517,7 +517,7 @@ function serializeTextSpan(span: PageBlockTextSpan): ProsemirrorNode[] {
|
|
|
517
517
|
);
|
|
518
518
|
}
|
|
519
519
|
|
|
520
|
-
return interspersed;
|
|
520
|
+
return interspersed.filter(t => !!t.text);
|
|
521
521
|
}
|
|
522
522
|
|
|
523
523
|
function serializeTextSpanAttribute(spanAttribute: PageBlockTextSpanAttribute): ProsemirrorMark {
|
package/src/index.ts
CHANGED