@supernova-studio/client 0.17.0 → 0.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/dist/index.d.mts +8568 -31209
- package/dist/index.d.ts +8568 -31209
- package/dist/index.js +88 -78
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +147 -137
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/dto/elements/documentation/group-action.ts +8 -4
- package/src/api/dto/elements/documentation/group.ts +20 -0
- package/src/api/dto/elements/documentation/index.ts +0 -2
- package/src/api/dto/elements/documentation/page-actions-v2.ts +8 -4
- package/src/api/dto/elements/index.ts +0 -1
- package/src/yjs/design-system-content/item-configuration.ts +41 -10
- package/src/yjs/design-system-content/item-title.ts +0 -0
- package/src/yjs/docs-editor/model/block.ts +2 -6
- package/src/api/dto/elements/documentation/group-bulk-action.ts +0 -32
- package/src/api/dto/elements/documentation/page-bulk-action-v2.ts +0 -33
- package/src/api/dto/elements/elements-bulk-action-v2.ts +0 -25
package/dist/index.mjs
CHANGED
|
@@ -982,7 +982,12 @@ var PageBlockItemDividerValue = z34.object({});
|
|
|
982
982
|
var PageBlockItemEmbedValue = z34.object({
|
|
983
983
|
value: z34.string().optional(),
|
|
984
984
|
caption: z34.string().optional(),
|
|
985
|
-
height: z34.number().optional()
|
|
985
|
+
height: z34.number().optional(),
|
|
986
|
+
openGraph: z34.object({
|
|
987
|
+
title: z34.string().optional(),
|
|
988
|
+
description: z34.string().optional(),
|
|
989
|
+
imageUrl: z34.string().optional()
|
|
990
|
+
}).optional()
|
|
986
991
|
});
|
|
987
992
|
var PageBlockItemFigmaNodeValue = z34.object({
|
|
988
993
|
selectedPropertyIds: z34.array(z34.string()).optional(),
|
|
@@ -2608,19 +2613,29 @@ var DesignSystemVersionRoom = Entity.extend({
|
|
|
2608
2613
|
});
|
|
2609
2614
|
var DesignSystemVersionRoomInitialState = z119.object({
|
|
2610
2615
|
pages: z119.array(DocumentationPageV2),
|
|
2611
|
-
groups: z119.array(ElementGroup)
|
|
2612
|
-
deletedPagePersistentIds: z119.array(z119.string()),
|
|
2613
|
-
deletedGroupPersistentIds: z119.array(z119.string())
|
|
2616
|
+
groups: z119.array(ElementGroup)
|
|
2614
2617
|
});
|
|
2615
2618
|
var DesignSystemVersionRoomUpdate = DesignSystemVersionRoomInitialState.extend({
|
|
2616
|
-
|
|
2617
|
-
|
|
2619
|
+
deletedPageIds: z119.array(z119.string()),
|
|
2620
|
+
deletedGroupIds: z119.array(z119.string())
|
|
2618
2621
|
});
|
|
2619
2622
|
var DocumentationPageRoom = Entity.extend({
|
|
2620
2623
|
designSystemVersionId: z120.string(),
|
|
2621
2624
|
documentationPageId: z120.string(),
|
|
2622
2625
|
liveblocksId: z120.string()
|
|
2623
2626
|
});
|
|
2627
|
+
var PageBlockEditorModel = z120.object({
|
|
2628
|
+
id: z120.string(),
|
|
2629
|
+
data: PageBlockDataV2
|
|
2630
|
+
});
|
|
2631
|
+
var DocumentationPageRoomRoomUpdate = z120.object({
|
|
2632
|
+
page: DocumentationPageV2,
|
|
2633
|
+
pageParent: ElementGroup
|
|
2634
|
+
});
|
|
2635
|
+
var DocumentationPageRoomInitialState = DocumentationPageRoomRoomUpdate.extend({
|
|
2636
|
+
pageBlocks: z120.array(PageBlockEditorModel),
|
|
2637
|
+
blockDefinitions: z120.array(PageBlockDefinition)
|
|
2638
|
+
});
|
|
2624
2639
|
var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
|
|
2625
2640
|
RoomTypeEnum2["DocumentationPage"] = "documentation-page";
|
|
2626
2641
|
RoomTypeEnum2["DesignSystemVersion"] = "design-system-version";
|
|
@@ -3595,7 +3610,10 @@ var DTOUpdateDocumentationGroupInput = z126.object({
|
|
|
3595
3610
|
id: z126.string().uuid(),
|
|
3596
3611
|
// Group properties
|
|
3597
3612
|
title: z126.string().optional(),
|
|
3598
|
-
configuration: DocumentationItemConfiguration.optional()
|
|
3613
|
+
configuration: DocumentationItemConfiguration.optional(),
|
|
3614
|
+
// Group placement properties
|
|
3615
|
+
afterPersistentId: z126.string().uuid().optional(),
|
|
3616
|
+
parentPersistentId: z126.string().uuid().optional()
|
|
3599
3617
|
});
|
|
3600
3618
|
var DTODuplicateDocumentationGroupInput = z126.object({
|
|
3601
3619
|
// Identifier of the group to duplicate from
|
|
@@ -3606,6 +3624,17 @@ var DTODuplicateDocumentationGroupInput = z126.object({
|
|
|
3606
3624
|
afterPersistentId: z126.string().uuid().optional(),
|
|
3607
3625
|
parentPersistentId: z126.string().uuid()
|
|
3608
3626
|
});
|
|
3627
|
+
var DTOCreateDocumentationTabGroupInput = z126.object({
|
|
3628
|
+
// New group persistent id
|
|
3629
|
+
persistentId: z126.string().uuid(),
|
|
3630
|
+
// Page that will become first tab of the tab group
|
|
3631
|
+
fromPageId: z126.string(),
|
|
3632
|
+
tabName: z126.string()
|
|
3633
|
+
});
|
|
3634
|
+
var DTODeleteDocumentationTabGroupInput = z126.object({
|
|
3635
|
+
// Deleted group id
|
|
3636
|
+
id: z126.string()
|
|
3637
|
+
});
|
|
3609
3638
|
var DTODeleteDocumentationGroupInput = z126.object({
|
|
3610
3639
|
// Identifier
|
|
3611
3640
|
id: z126.string(),
|
|
@@ -3614,21 +3643,24 @@ var DTODeleteDocumentationGroupInput = z126.object({
|
|
|
3614
3643
|
});
|
|
3615
3644
|
|
|
3616
3645
|
// src/api/dto/elements/documentation/group-action.ts
|
|
3646
|
+
var SuccessPayload = z127.object({
|
|
3647
|
+
success: z127.literal(true)
|
|
3648
|
+
});
|
|
3617
3649
|
var DTODocumentationGroupCreateActionOutputV2 = z127.object({
|
|
3618
3650
|
type: z127.literal("DocumentationGroupCreate"),
|
|
3619
|
-
output:
|
|
3651
|
+
output: SuccessPayload
|
|
3620
3652
|
});
|
|
3621
3653
|
var DTODocumentationGroupUpdateActionOutputV2 = z127.object({
|
|
3622
3654
|
type: z127.literal("DocumentationGroupUpdate"),
|
|
3623
|
-
output:
|
|
3655
|
+
output: SuccessPayload
|
|
3624
3656
|
});
|
|
3625
3657
|
var DTODocumentationGroupDuplicateActionOutputV2 = z127.object({
|
|
3626
3658
|
type: z127.literal("DocumentationGroupDuplicate"),
|
|
3627
|
-
output:
|
|
3659
|
+
output: SuccessPayload
|
|
3628
3660
|
});
|
|
3629
3661
|
var DTODocumentationGroupDeleteActionOutputV2 = z127.object({
|
|
3630
3662
|
type: z127.literal("DocumentationGroupDelete"),
|
|
3631
|
-
output:
|
|
3663
|
+
output: SuccessPayload
|
|
3632
3664
|
});
|
|
3633
3665
|
var DTODocumentationGroupCreateActionInputV2 = z127.object({
|
|
3634
3666
|
type: z127.literal("DocumentationGroupCreate"),
|
|
@@ -3647,138 +3679,113 @@ var DTODocumentationGroupDeleteActionInputV2 = z127.object({
|
|
|
3647
3679
|
input: DTODeleteDocumentationGroupInput
|
|
3648
3680
|
});
|
|
3649
3681
|
|
|
3650
|
-
// src/api/dto/elements/documentation/group-bulk-action.ts
|
|
3651
|
-
import { z as z128 } from "zod";
|
|
3652
|
-
var DTODocumentationGroupBulkActionOutputV2 = z128.object({
|
|
3653
|
-
created: z128.array(DTODocumentationGroup),
|
|
3654
|
-
updated: z128.array(DTODocumentationGroup),
|
|
3655
|
-
deleted: z128.array(z128.string())
|
|
3656
|
-
});
|
|
3657
|
-
var DTODocumentationGroupBulkActionInputV2 = z128.object({
|
|
3658
|
-
create: z128.array(DTOCreateDocumentationGroupInput).optional(),
|
|
3659
|
-
update: z128.array(DTOUpdateDocumentationGroupInput).optional(),
|
|
3660
|
-
duplicate: z128.array(DTODuplicateDocumentationGroupInput).optional(),
|
|
3661
|
-
delete: z128.array(z128.string()).optional()
|
|
3662
|
-
});
|
|
3663
|
-
|
|
3664
3682
|
// src/api/dto/elements/documentation/page-actions-v2.ts
|
|
3665
|
-
import { z as
|
|
3683
|
+
import { z as z129 } from "zod";
|
|
3666
3684
|
|
|
3667
3685
|
// src/api/dto/elements/documentation/page-v2.ts
|
|
3668
|
-
import { z as
|
|
3686
|
+
import { z as z128 } from "zod";
|
|
3669
3687
|
var DTODocumentationPageStructureV2 = DocumentationPageV2.omit({
|
|
3670
3688
|
data: true,
|
|
3671
3689
|
meta: true,
|
|
3672
3690
|
parentPersistentId: true,
|
|
3673
3691
|
sortOrder: true
|
|
3674
3692
|
}).extend({
|
|
3675
|
-
title:
|
|
3676
|
-
path:
|
|
3693
|
+
title: z128.string(),
|
|
3694
|
+
path: z128.string()
|
|
3677
3695
|
});
|
|
3678
3696
|
var DTODocumentationPageV2 = DTODocumentationPageStructureV2.extend({
|
|
3679
3697
|
configuration: DocumentationItemConfiguration
|
|
3680
3698
|
});
|
|
3681
|
-
var DTODocumentationHierarchyV2 =
|
|
3682
|
-
pages:
|
|
3683
|
-
groups:
|
|
3699
|
+
var DTODocumentationHierarchyV2 = z128.object({
|
|
3700
|
+
pages: z128.array(DTODocumentationPageStructureV2),
|
|
3701
|
+
groups: z128.array(DTODocumentationGroupStructure)
|
|
3684
3702
|
});
|
|
3685
|
-
var DTOCreateDocumentationPageInputV2 =
|
|
3703
|
+
var DTOCreateDocumentationPageInputV2 = z128.object({
|
|
3686
3704
|
// Identifier
|
|
3687
|
-
persistentId:
|
|
3705
|
+
persistentId: z128.string().uuid(),
|
|
3688
3706
|
// Page properties
|
|
3689
|
-
title:
|
|
3707
|
+
title: z128.string(),
|
|
3690
3708
|
configuration: DocumentationItemConfiguration.optional(),
|
|
3691
3709
|
// Page placement properties
|
|
3692
|
-
parentPersistentId:
|
|
3693
|
-
afterPersistentId:
|
|
3710
|
+
parentPersistentId: z128.string().uuid(),
|
|
3711
|
+
afterPersistentId: z128.string().uuid().optional()
|
|
3694
3712
|
});
|
|
3695
|
-
var DTOUpdateDocumentationPageInputV2 =
|
|
3713
|
+
var DTOUpdateDocumentationPageInputV2 = z128.object({
|
|
3696
3714
|
// Identifier of the group to update
|
|
3697
|
-
id:
|
|
3715
|
+
id: z128.string(),
|
|
3698
3716
|
// Page properties
|
|
3699
|
-
title:
|
|
3717
|
+
title: z128.string().optional(),
|
|
3700
3718
|
configuration: DocumentationItemConfiguration.optional(),
|
|
3701
3719
|
// Page placement properties
|
|
3702
|
-
parentPersistentId:
|
|
3703
|
-
afterPersistentId:
|
|
3720
|
+
parentPersistentId: z128.string().optional(),
|
|
3721
|
+
afterPersistentId: z128.string().optional()
|
|
3704
3722
|
});
|
|
3705
|
-
var DTODuplicateDocumentationPageInputV2 =
|
|
3723
|
+
var DTODuplicateDocumentationPageInputV2 = z128.object({
|
|
3706
3724
|
// Identifier of the page to duplicate from
|
|
3707
|
-
id:
|
|
3725
|
+
id: z128.string(),
|
|
3708
3726
|
// New page persistent id
|
|
3709
|
-
persistentId:
|
|
3727
|
+
persistentId: z128.string().uuid(),
|
|
3710
3728
|
// Page placement properties
|
|
3711
|
-
parentPersistentId:
|
|
3712
|
-
afterPersistentId:
|
|
3729
|
+
parentPersistentId: z128.string().uuid(),
|
|
3730
|
+
afterPersistentId: z128.string().uuid().optional()
|
|
3713
3731
|
});
|
|
3714
|
-
var DTODeleteDocumentationPageInputV2 =
|
|
3732
|
+
var DTODeleteDocumentationPageInputV2 = z128.object({
|
|
3715
3733
|
// Identifier
|
|
3716
|
-
id:
|
|
3734
|
+
id: z128.string()
|
|
3717
3735
|
});
|
|
3718
3736
|
|
|
3719
3737
|
// src/api/dto/elements/documentation/page-actions-v2.ts
|
|
3720
|
-
var
|
|
3721
|
-
|
|
3722
|
-
output: DTODocumentationPageV2
|
|
3738
|
+
var SuccessPayload2 = z129.object({
|
|
3739
|
+
success: z129.literal(true)
|
|
3723
3740
|
});
|
|
3724
|
-
var
|
|
3725
|
-
type:
|
|
3726
|
-
output:
|
|
3741
|
+
var DTODocumentationPageCreateActionOutputV2 = z129.object({
|
|
3742
|
+
type: z129.literal("DocumentationPageCreate"),
|
|
3743
|
+
output: SuccessPayload2
|
|
3727
3744
|
});
|
|
3728
|
-
var
|
|
3729
|
-
type:
|
|
3730
|
-
output:
|
|
3745
|
+
var DTODocumentationPageUpdateActionOutputV2 = z129.object({
|
|
3746
|
+
type: z129.literal("DocumentationPageUpdate"),
|
|
3747
|
+
output: SuccessPayload2
|
|
3731
3748
|
});
|
|
3732
|
-
var
|
|
3733
|
-
type:
|
|
3734
|
-
output:
|
|
3749
|
+
var DTODocumentationPageDuplicateActionOutputV2 = z129.object({
|
|
3750
|
+
type: z129.literal("DocumentationPageDuplicate"),
|
|
3751
|
+
output: SuccessPayload2
|
|
3735
3752
|
});
|
|
3736
|
-
var
|
|
3737
|
-
type:
|
|
3753
|
+
var DTODocumentationPageDeleteActionOutputV2 = z129.object({
|
|
3754
|
+
type: z129.literal("DocumentationPageDelete"),
|
|
3755
|
+
output: SuccessPayload2
|
|
3756
|
+
});
|
|
3757
|
+
var DTODocumentationPageCreateActionInputV2 = z129.object({
|
|
3758
|
+
type: z129.literal("DocumentationPageCreate"),
|
|
3738
3759
|
input: DTOCreateDocumentationPageInputV2
|
|
3739
3760
|
});
|
|
3740
|
-
var DTODocumentationPageUpdateActionInputV2 =
|
|
3741
|
-
type:
|
|
3761
|
+
var DTODocumentationPageUpdateActionInputV2 = z129.object({
|
|
3762
|
+
type: z129.literal("DocumentationPageUpdate"),
|
|
3742
3763
|
input: DTOUpdateDocumentationPageInputV2
|
|
3743
3764
|
});
|
|
3744
|
-
var DTODocumentationPageDuplicateActionInputV2 =
|
|
3745
|
-
type:
|
|
3765
|
+
var DTODocumentationPageDuplicateActionInputV2 = z129.object({
|
|
3766
|
+
type: z129.literal("DocumentationPageDuplicate"),
|
|
3746
3767
|
input: DTODuplicateDocumentationPageInputV2
|
|
3747
3768
|
});
|
|
3748
|
-
var DTODocumentationPageDeleteActionInputV2 =
|
|
3749
|
-
type:
|
|
3769
|
+
var DTODocumentationPageDeleteActionInputV2 = z129.object({
|
|
3770
|
+
type: z129.literal("DocumentationPageDelete"),
|
|
3750
3771
|
input: DTODeleteDocumentationPageInputV2
|
|
3751
3772
|
});
|
|
3752
3773
|
|
|
3753
|
-
// src/api/dto/elements/documentation/page-bulk-action-v2.ts
|
|
3754
|
-
import { z as z131 } from "zod";
|
|
3755
|
-
var DTODocumentationPageBulkActionOutputV2 = z131.object({
|
|
3756
|
-
created: z131.array(DTODocumentationPageV2),
|
|
3757
|
-
updated: z131.array(DTODocumentationPageV2),
|
|
3758
|
-
deleted: z131.array(z131.string())
|
|
3759
|
-
});
|
|
3760
|
-
var DTODocumentationPageBulkActionInputV2 = z131.object({
|
|
3761
|
-
create: z131.array(DTOCreateDocumentationPageInputV2).optional(),
|
|
3762
|
-
update: z131.array(DTOUpdateDocumentationPageInputV2).optional(),
|
|
3763
|
-
duplicate: z131.array(DTODuplicateDocumentationPageInputV2).optional(),
|
|
3764
|
-
delete: z131.array(DTODeleteDocumentationPageInputV2).optional()
|
|
3765
|
-
});
|
|
3766
|
-
|
|
3767
3774
|
// src/api/dto/elements/documentation/page-v1.ts
|
|
3768
|
-
import { z as
|
|
3775
|
+
import { z as z130 } from "zod";
|
|
3769
3776
|
var DocumentationPageV1DTO = DocumentationPageV1.omit({
|
|
3770
3777
|
data: true,
|
|
3771
3778
|
meta: true,
|
|
3772
3779
|
parentPersistentId: true,
|
|
3773
3780
|
sortOrder: true
|
|
3774
3781
|
}).extend(DocumentationPageV1.shape.data.shape).extend({
|
|
3775
|
-
title:
|
|
3776
|
-
path:
|
|
3782
|
+
title: z130.string(),
|
|
3783
|
+
path: z130.string()
|
|
3777
3784
|
});
|
|
3778
3785
|
|
|
3779
3786
|
// src/api/dto/elements/elements-action-v2.ts
|
|
3780
|
-
import { z as
|
|
3781
|
-
var DTOElementActionOutput =
|
|
3787
|
+
import { z as z131 } from "zod";
|
|
3788
|
+
var DTOElementActionOutput = z131.discriminatedUnion("type", [
|
|
3782
3789
|
// Documentation pages
|
|
3783
3790
|
DTODocumentationPageCreateActionOutputV2,
|
|
3784
3791
|
DTODocumentationPageUpdateActionOutputV2,
|
|
@@ -3790,7 +3797,7 @@ var DTOElementActionOutput = z133.discriminatedUnion("type", [
|
|
|
3790
3797
|
DTODocumentationGroupDuplicateActionOutputV2,
|
|
3791
3798
|
DTODocumentationGroupDeleteActionOutputV2
|
|
3792
3799
|
]);
|
|
3793
|
-
var DTOElementActionInput =
|
|
3800
|
+
var DTOElementActionInput = z131.discriminatedUnion("type", [
|
|
3794
3801
|
// Documentation pages
|
|
3795
3802
|
DTODocumentationPageCreateActionInputV2,
|
|
3796
3803
|
DTODocumentationPageUpdateActionInputV2,
|
|
@@ -3803,25 +3810,16 @@ var DTOElementActionInput = z133.discriminatedUnion("type", [
|
|
|
3803
3810
|
DTODocumentationGroupDeleteActionInputV2
|
|
3804
3811
|
]);
|
|
3805
3812
|
|
|
3806
|
-
// src/api/dto/elements/elements-bulk-action-v2.ts
|
|
3807
|
-
import { z as z134 } from "zod";
|
|
3808
|
-
var DTOElementsBulkActionOutputV2 = z134.object({
|
|
3809
|
-
documentationPages: DTODocumentationPageBulkActionOutputV2
|
|
3810
|
-
});
|
|
3811
|
-
var DTOElementsBulkActionInputV2 = z134.object({
|
|
3812
|
-
documentationPages: DTODocumentationPageBulkActionInputV2
|
|
3813
|
-
});
|
|
3814
|
-
|
|
3815
3813
|
// src/api/payloads/documentation/block-definitions.ts
|
|
3816
|
-
import { z as
|
|
3817
|
-
var DTOGetBlockDefinitionsOutput =
|
|
3818
|
-
definitions:
|
|
3814
|
+
import { z as z132 } from "zod";
|
|
3815
|
+
var DTOGetBlockDefinitionsOutput = z132.object({
|
|
3816
|
+
definitions: z132.array(PageBlockDefinition)
|
|
3819
3817
|
});
|
|
3820
3818
|
|
|
3821
3819
|
// src/api/payloads/liveblocks/auth.ts
|
|
3822
|
-
import { z as
|
|
3823
|
-
var DTOLiveblocksAuthRequest =
|
|
3824
|
-
room:
|
|
3820
|
+
import { z as z133 } from "zod";
|
|
3821
|
+
var DTOLiveblocksAuthRequest = z133.object({
|
|
3822
|
+
room: z133.string()
|
|
3825
3823
|
});
|
|
3826
3824
|
|
|
3827
3825
|
// src/yjs/design-system-content/documentation-hierarchy.ts
|
|
@@ -3874,9 +3872,23 @@ function getGroupsYMap(doc) {
|
|
|
3874
3872
|
}
|
|
3875
3873
|
|
|
3876
3874
|
// src/yjs/design-system-content/item-configuration.ts
|
|
3875
|
+
import { z as z134 } from "zod";
|
|
3876
|
+
var DTODocumentationPageRoomHeaderData = z134.object({
|
|
3877
|
+
title: z134.string(),
|
|
3878
|
+
configuration: DocumentationItemConfiguration
|
|
3879
|
+
});
|
|
3880
|
+
var DTODocumentationPageRoomHeaderDataUpdate = z134.object({
|
|
3881
|
+
title: z134.string().optional(),
|
|
3882
|
+
configuration: DocumentationItemConfiguration.omit({ header: true }).extend({ header: DocumentationItemHeader.partial() }).optional()
|
|
3883
|
+
});
|
|
3877
3884
|
function itemConfigurationToYjs(yDoc, item) {
|
|
3878
3885
|
yDoc.transact((trx) => {
|
|
3879
|
-
const
|
|
3886
|
+
const { title, configuration } = item;
|
|
3887
|
+
const header = configuration?.header;
|
|
3888
|
+
if (title !== void 0) {
|
|
3889
|
+
const headerYMap = trx.doc.getMap("itemTitle");
|
|
3890
|
+
headerYMap.set("title", title);
|
|
3891
|
+
}
|
|
3880
3892
|
if (header) {
|
|
3881
3893
|
const headerYMap = trx.doc.getMap("itemHeader");
|
|
3882
3894
|
header.description !== void 0 && headerYMap.set("description", header.description);
|
|
@@ -3889,13 +3901,14 @@ function itemConfigurationToYjs(yDoc, item) {
|
|
|
3889
3901
|
header.showCoverText !== void 0 && headerYMap.set("showCoverText", header.showCoverText);
|
|
3890
3902
|
header.minHeight !== void 0 && headerYMap.set("minHeight", header.minHeight);
|
|
3891
3903
|
}
|
|
3892
|
-
if (
|
|
3904
|
+
if (configuration?.showSidebar !== void 0) {
|
|
3893
3905
|
const configYMap = trx.doc.getMap("itemConfiguration");
|
|
3894
|
-
configYMap.set("showSidebar",
|
|
3906
|
+
configYMap.set("showSidebar", configuration.showSidebar);
|
|
3895
3907
|
}
|
|
3896
3908
|
});
|
|
3897
3909
|
}
|
|
3898
3910
|
function yjsToItemConfiguration(yDoc) {
|
|
3911
|
+
const title = yDoc.getMap("itemTitle").get("title");
|
|
3899
3912
|
const headerYMap = yDoc.getMap("itemHeader");
|
|
3900
3913
|
const rawHeader = {
|
|
3901
3914
|
description: headerYMap.get("description"),
|
|
@@ -3913,20 +3926,19 @@ function yjsToItemConfiguration(yDoc) {
|
|
|
3913
3926
|
showSidebar: configYMap.get("showSidebar"),
|
|
3914
3927
|
header: rawHeader
|
|
3915
3928
|
};
|
|
3916
|
-
return
|
|
3929
|
+
return {
|
|
3930
|
+
title: z134.string().parse(title),
|
|
3931
|
+
configuration: DocumentationItemConfiguration.parse(rawConfig)
|
|
3932
|
+
};
|
|
3917
3933
|
}
|
|
3918
3934
|
|
|
3919
3935
|
// src/yjs/docs-editor/model/block.ts
|
|
3920
|
-
|
|
3921
|
-
var PageBlockEditorModel = z137.object({
|
|
3922
|
-
id: z137.string(),
|
|
3923
|
-
data: PageBlockDataV2
|
|
3924
|
-
});
|
|
3936
|
+
var PageBlockEditorModel2 = PageBlockEditorModel;
|
|
3925
3937
|
|
|
3926
3938
|
// src/yjs/docs-editor/model/page.ts
|
|
3927
|
-
import { z as
|
|
3928
|
-
var DocumentationPageEditorModel =
|
|
3929
|
-
blocks:
|
|
3939
|
+
import { z as z135 } from "zod";
|
|
3940
|
+
var DocumentationPageEditorModel = z135.object({
|
|
3941
|
+
blocks: z135.array(PageBlockEditorModel2)
|
|
3930
3942
|
});
|
|
3931
3943
|
|
|
3932
3944
|
// src/yjs/docs-editor/prosemirror/schema.ts
|
|
@@ -7559,7 +7571,7 @@ var blocks = [
|
|
|
7559
7571
|
|
|
7560
7572
|
// src/yjs/docs-editor/prosemirror-to-blocks.ts
|
|
7561
7573
|
import { yXmlFragmentToProsemirrorJSON } from "y-prosemirror";
|
|
7562
|
-
import { z as
|
|
7574
|
+
import { z as z136 } from "zod";
|
|
7563
7575
|
function yDocToPage(yDoc, definitions) {
|
|
7564
7576
|
return yXmlFragmentToPage(yDoc.getXmlFragment("default"), definitions);
|
|
7565
7577
|
}
|
|
@@ -7571,7 +7583,7 @@ function prosemirrorDocToPage(prosemirrorDoc, definitions) {
|
|
|
7571
7583
|
const definitionsById = mapByUnique2(definitions, (d) => d.id);
|
|
7572
7584
|
return {
|
|
7573
7585
|
blocks: (prosemirrorDoc.content ?? []).map((prosemirrorNode) => {
|
|
7574
|
-
const definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId",
|
|
7586
|
+
const definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId", z136.string());
|
|
7575
7587
|
if (!definitionId) {
|
|
7576
7588
|
console.warn(
|
|
7577
7589
|
`definitionId on ${prosemirrorNode.type} is required to be interpreted as a block, skipping node`
|
|
@@ -7613,7 +7625,7 @@ function parseAsRichText(prosemirrorNode, definition, property) {
|
|
|
7613
7625
|
if (!id)
|
|
7614
7626
|
return null;
|
|
7615
7627
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
7616
|
-
const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type",
|
|
7628
|
+
const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type", z136.string().optional()));
|
|
7617
7629
|
return {
|
|
7618
7630
|
// TODO Artem: indent
|
|
7619
7631
|
id,
|
|
@@ -7713,8 +7725,8 @@ function parseRichTextAttribute(mark) {
|
|
|
7713
7725
|
case "code":
|
|
7714
7726
|
return { type: "Code" };
|
|
7715
7727
|
case "link":
|
|
7716
|
-
const itemId = getProsemirrorAttribute(mark, "itemId",
|
|
7717
|
-
const href = getProsemirrorAttribute(mark, "href",
|
|
7728
|
+
const itemId = getProsemirrorAttribute(mark, "itemId", z136.string().optional());
|
|
7729
|
+
const href = getProsemirrorAttribute(mark, "href", z136.string().optional());
|
|
7718
7730
|
return {
|
|
7719
7731
|
type: "Link",
|
|
7720
7732
|
openInNewWindow: mark.attrs?.target !== "_self",
|
|
@@ -7729,7 +7741,7 @@ function parseAsTable(prosemirrorNode, definition, property) {
|
|
|
7729
7741
|
if (!id)
|
|
7730
7742
|
return null;
|
|
7731
7743
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
7732
|
-
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder",
|
|
7744
|
+
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", z136.boolean().optional()) !== false;
|
|
7733
7745
|
const tableChild = prosemirrorNode.content?.find((c) => c.type === "table");
|
|
7734
7746
|
if (!tableChild) {
|
|
7735
7747
|
return emptyTable(id, variantId, 0);
|
|
@@ -7775,9 +7787,9 @@ function parseAsTableCell(prosemirrorNode) {
|
|
|
7775
7787
|
const id = getProsemirrorBlockId(prosemirrorNode);
|
|
7776
7788
|
if (!id)
|
|
7777
7789
|
return null;
|
|
7778
|
-
const textAlign = getProsemirrorAttribute(prosemirrorNode, "textAlign",
|
|
7790
|
+
const textAlign = getProsemirrorAttribute(prosemirrorNode, "textAlign", z136.string().optional());
|
|
7779
7791
|
let columnWidth;
|
|
7780
|
-
const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, "colwidth",
|
|
7792
|
+
const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, "colwidth", z136.array(z136.number()).optional());
|
|
7781
7793
|
if (columnWidthArray) {
|
|
7782
7794
|
columnWidth = columnWidthArray[0];
|
|
7783
7795
|
}
|
|
@@ -7811,7 +7823,7 @@ function parseAsTableNode(prosemirrorNode) {
|
|
|
7811
7823
|
value: parseRichText(prosemirrorNode.content ?? [])
|
|
7812
7824
|
};
|
|
7813
7825
|
case "image":
|
|
7814
|
-
const url = getProsemirrorAttribute(prosemirrorNode, "src",
|
|
7826
|
+
const url = getProsemirrorAttribute(prosemirrorNode, "src", z136.string().optional());
|
|
7815
7827
|
if (!url)
|
|
7816
7828
|
return null;
|
|
7817
7829
|
return {
|
|
@@ -7905,7 +7917,7 @@ function parseAsCustomBlock(prosemirrorNode, definition) {
|
|
|
7905
7917
|
};
|
|
7906
7918
|
}
|
|
7907
7919
|
function parseBlockItems(prosemirrorNode, definition) {
|
|
7908
|
-
const itemsString = getProsemirrorAttribute(prosemirrorNode, "items",
|
|
7920
|
+
const itemsString = getProsemirrorAttribute(prosemirrorNode, "items", z136.string());
|
|
7909
7921
|
if (!itemsString)
|
|
7910
7922
|
return null;
|
|
7911
7923
|
const itemsJson = JSON.parse(itemsString);
|
|
@@ -7917,11 +7929,11 @@ function parseBlockItems(prosemirrorNode, definition) {
|
|
|
7917
7929
|
}
|
|
7918
7930
|
function parseAppearance(prosemirrorNode) {
|
|
7919
7931
|
const appearance = {};
|
|
7920
|
-
const columns = getProsemirrorAttribute(prosemirrorNode, "columns",
|
|
7932
|
+
const columns = getProsemirrorAttribute(prosemirrorNode, "columns", z136.number().optional());
|
|
7921
7933
|
if (columns) {
|
|
7922
7934
|
appearance.numberOfColumns = columns;
|
|
7923
7935
|
}
|
|
7924
|
-
const backgroundColor = getProsemirrorAttribute(prosemirrorNode, "backgroundColor",
|
|
7936
|
+
const backgroundColor = getProsemirrorAttribute(prosemirrorNode, "backgroundColor", z136.string().optional());
|
|
7925
7937
|
if (backgroundColor) {
|
|
7926
7938
|
const parsedColor = PageBlockColorV2.safeParse(JSON.parse(backgroundColor));
|
|
7927
7939
|
if (parsedColor.success) {
|
|
@@ -8012,13 +8024,13 @@ function valueSchemaForPropertyType(type) {
|
|
|
8012
8024
|
}
|
|
8013
8025
|
}
|
|
8014
8026
|
function getProsemirrorBlockId(prosemirrorNode) {
|
|
8015
|
-
const id = getProsemirrorAttribute(prosemirrorNode, "id",
|
|
8027
|
+
const id = getProsemirrorAttribute(prosemirrorNode, "id", z136.string());
|
|
8016
8028
|
if (!id)
|
|
8017
8029
|
console.warn(`Prosemirror attribute "id" on ${prosemirrorNode.type} is required`);
|
|
8018
8030
|
return id;
|
|
8019
8031
|
}
|
|
8020
8032
|
function getProsemirrorBlockVariantId(prosemirrorNode) {
|
|
8021
|
-
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(
|
|
8033
|
+
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(z136.string()));
|
|
8022
8034
|
}
|
|
8023
8035
|
function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
|
|
8024
8036
|
const parsedAttr = validationSchema.safeParse(prosemirrorNode.attrs?.[attributeName]);
|
|
@@ -8045,12 +8057,12 @@ export {
|
|
|
8045
8057
|
BlockParsingUtils,
|
|
8046
8058
|
DTOCreateDocumentationGroupInput,
|
|
8047
8059
|
DTOCreateDocumentationPageInputV2,
|
|
8060
|
+
DTOCreateDocumentationTabGroupInput,
|
|
8048
8061
|
DTODeleteDocumentationGroupInput,
|
|
8049
8062
|
DTODeleteDocumentationPageInputV2,
|
|
8063
|
+
DTODeleteDocumentationTabGroupInput,
|
|
8050
8064
|
DTODesignSystem,
|
|
8051
8065
|
DTODocumentationGroup,
|
|
8052
|
-
DTODocumentationGroupBulkActionInputV2,
|
|
8053
|
-
DTODocumentationGroupBulkActionOutputV2,
|
|
8054
8066
|
DTODocumentationGroupCreateActionInputV2,
|
|
8055
8067
|
DTODocumentationGroupCreateActionOutputV2,
|
|
8056
8068
|
DTODocumentationGroupDeleteActionInputV2,
|
|
@@ -8061,14 +8073,14 @@ export {
|
|
|
8061
8073
|
DTODocumentationGroupUpdateActionInputV2,
|
|
8062
8074
|
DTODocumentationGroupUpdateActionOutputV2,
|
|
8063
8075
|
DTODocumentationHierarchyV2,
|
|
8064
|
-
DTODocumentationPageBulkActionInputV2,
|
|
8065
|
-
DTODocumentationPageBulkActionOutputV2,
|
|
8066
8076
|
DTODocumentationPageCreateActionInputV2,
|
|
8067
8077
|
DTODocumentationPageCreateActionOutputV2,
|
|
8068
8078
|
DTODocumentationPageDeleteActionInputV2,
|
|
8069
8079
|
DTODocumentationPageDeleteActionOutputV2,
|
|
8070
8080
|
DTODocumentationPageDuplicateActionInputV2,
|
|
8071
8081
|
DTODocumentationPageDuplicateActionOutputV2,
|
|
8082
|
+
DTODocumentationPageRoomHeaderData,
|
|
8083
|
+
DTODocumentationPageRoomHeaderDataUpdate,
|
|
8072
8084
|
DTODocumentationPageStructureV2,
|
|
8073
8085
|
DTODocumentationPageUpdateActionInputV2,
|
|
8074
8086
|
DTODocumentationPageUpdateActionOutputV2,
|
|
@@ -8077,15 +8089,13 @@ export {
|
|
|
8077
8089
|
DTODuplicateDocumentationPageInputV2,
|
|
8078
8090
|
DTOElementActionInput,
|
|
8079
8091
|
DTOElementActionOutput,
|
|
8080
|
-
DTOElementsBulkActionInputV2,
|
|
8081
|
-
DTOElementsBulkActionOutputV2,
|
|
8082
8092
|
DTOGetBlockDefinitionsOutput,
|
|
8083
8093
|
DTOLiveblocksAuthRequest,
|
|
8084
8094
|
DTOUpdateDocumentationGroupInput,
|
|
8085
8095
|
DTOUpdateDocumentationPageInputV2,
|
|
8086
8096
|
DocumentationPageEditorModel,
|
|
8087
8097
|
DocumentationPageV1DTO,
|
|
8088
|
-
PageBlockEditorModel,
|
|
8098
|
+
PageBlockEditorModel2 as PageBlockEditorModel,
|
|
8089
8099
|
blockDefinitionForBlock,
|
|
8090
8100
|
blockToProsemirrorNode,
|
|
8091
8101
|
buildDocPagePublishPaths,
|